@inkeep/open-knowledge 0.64.0 → 0.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-DodNWez3.mjs → acp-harness-probe-BS2KKWDg.mjs} +2 -2
- package/dist/cli.mjs +51 -51
- package/dist/constants-VMvduCQu.mjs +2 -0
- package/dist/{git-handle-3QlrPfzF.mjs → git-handle-29BNYqgw.mjs} +2 -2
- package/dist/git-handle-DfQBBy3_.mjs +1 -0
- package/dist/index.mjs +105 -105
- package/dist/{init-DeSBToha.mjs → init-CB9b8ABp.mjs} +5 -5
- package/dist/init-C_7xLv5L.mjs +1 -0
- package/dist/{launch-json-removal-Db1ziD-H.mjs → launch-json-removal-lmoBoEPZ.mjs} +2 -2
- package/dist/loader-CqMTrIZH.mjs +1 -0
- package/dist/{loader-anKuU0KS.mjs → loader-DyT98uPM.mjs} +2 -2
- package/dist/md-manager-CZcRasmz.mjs +2 -0
- package/dist/{open-browser-W5CxYsJ4.mjs → open-browser-aU_PSdrG.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-C1REvdOf.mjs → preview-B0PMP9Tc.mjs} +2 -2
- package/dist/preview-BnhlaGQl.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-Ckg5Pq_4.js → ActivityModeContent-rGNWFHTn.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-gQRcjJmF.js → AddPropertiesButton-2JRBAQEf.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-D-ZLGFAR.js → AgentDiffPane-DaORQqpS.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-D4jxeqvH.js → AgentThreadClientBinder-CJYGMIr6.js} +1 -1
- package/dist/public/assets/{BugReportHistory-DihyFd3f.js → BugReportHistory-Cuh__mug.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-CSNrPEOi.js → BugReportHistoryDialog-C_9BqWro.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-DjB69jRg.js → CodeMirrorPropInput-B8JfraRG.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-DQ8IUXhF.js → ConsentDialogBody-CK9RceLc.js} +1 -1
- package/dist/public/assets/{DocumentContext-iKEZSiB2.js → DocumentContext-DyBKMWUQ.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-DEPlArB5.js → EditorModeToggle-CTMAAr-X.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CwJc4GMj.js → EnableSyncConfirmDialog-D80Aucr3.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-BCYrkDNU.js → ExcalidrawDocEditor-CMeQn_u0.js} +1 -1
- package/dist/public/assets/FeedbackForm-SUXnCd9B.js +1 -0
- package/dist/public/assets/{GraphPanel-DHmyVvBK.js → GraphPanel-CnxzWV5D.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-BKP46Eid.js → ImportSkillDialog-DUdFUw6e.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-HYgFdkkR.js → LintConfigEditor-BC8TYjz-.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-VBkp3E3_.js → ManagedArtifactProperties-Cr21JXmD.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-DVT7r-wR.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-CLbFOZa8.js → MermaidDocEditor-CCEt4Opw.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-D7ELTVgR.js → PropertyDisplayRow-CTVCclTK.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-C1oy3fl2.js → ReportBugDialogBody-VIeqRFre.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-B7rMT9lS.js → SchemaConfigEditor-UcCzcUIa.js} +1 -1
- package/dist/public/assets/{SessionsHost-BxDNMNVk.js → SessionsHost-gxeaEpjc.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-Cg-2MbSs.js → SettingsDialogBody-CxoXcrrW.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-COPm8JOC.js → ShareBranchSwitchDialog-Cee3pwDa.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-qD-iDy_7.js → ShareReceiveDialog-blTr_HPx.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BkGSRaoZ.js → ShareReceiveMissDialog-DJ9DvFJq.js} +1 -1
- package/dist/public/assets/{SkillCostValue-DgVDZJg4.js → SkillCostValue-DEly99Yk.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-CVlq-SCL.js → SkillEditBanner-bd1zvQfx.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-CP0nLWRp.js → SkillInstallMenu-sneUc7PA.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-6IYNkHCE.js → SkillOriginInline-BQIo2jSh.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-DQAXaxz9.js → SkillToolbarControls-A3BqTaVC.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-Caq-eS5D.js → SlidesToolbarControls-DpcrHeKz.js} +1 -1
- package/dist/public/assets/{SourceEditor-iZTT-gls.js → SourceEditor-yCp7AOuC.js} +1 -1
- package/dist/public/assets/{TerminalPanel-hYpLMc82.js → TerminalPanel-DitPHk-i.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CqhdtLqo.js → TerminalWindowApp-CEMvQfmt.js} +1 -1
- package/dist/public/assets/{TextDocEditor-lp_L8pQg.js → TextDocEditor-Ckd918Mb.js} +1 -1
- package/dist/public/assets/{ThreadView-B0bXdy0X.js → ThreadView-DGR1KByM.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-jTy3D_Yh.js → TimelineDiffPane-CpgSHJGN.js} +1 -1
- package/dist/public/assets/{agent-diff-store-B7QUf8gQ.js → agent-diff-store-DzZwPUH2.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CcdfpjLM.js → auth-state-cache-CEf8XB-q.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-Buxf0r5c.js → bug-report-send-manager-D19JO93p.js} +1 -1
- package/dist/public/assets/{chunk-BO2N2NFS-BVKS5mdX.js → chunk-BO2N2NFS-aa_rQr8f.js} +31 -31
- package/dist/public/assets/client-version-ow2B_U-6.js +1 -0
- package/dist/public/assets/{comment-chips-z8F67ebz.js → comment-chips-C076-HNt.js} +1 -1
- package/dist/public/assets/{config-provider-DcdQLVo-.js → config-provider-JYp7fF6x.js} +1 -1
- package/dist/public/assets/{dist-DSS3ixln2.js → dist-CWxNQtC52.js} +41 -41
- package/dist/public/assets/{doc-paths-oMq41Y7d.js → doc-paths-DgbGdxZ1.js} +1 -1
- package/dist/public/assets/{documents-events-DCcMe0wm.js → documents-events-DViu97ho.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-X5fV07Z_.js → file-tree-adapter-B2J82X4l.js} +1 -1
- package/dist/public/assets/{file-tree-utils-DL6Pvgvd.js → file-tree-utils-MiagXf7l.js} +1 -1
- package/dist/public/assets/{folder-config-api-Ca2OxXT-.js → folder-config-api-CNXuE5zD.js} +1 -1
- package/dist/public/assets/{highlighted-body-OFNGDK62-R5erL3S3.js → highlighted-body-OFNGDK62-eLakIx_-.js} +1 -1
- package/dist/public/assets/i18n-CqDKlhNm.js +1 -0
- package/dist/public/assets/{index-Cx0Su1s3.js → index-CVIfHBfN.js} +7 -7
- package/dist/public/assets/lib-DH_OjOEF.js +29 -0
- package/dist/public/assets/{lint-config-client-CumTSl-t.js → lint-config-client-RzlDcfLl.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BYdFk19L.js → markdownlint-rule-browser-Bmk3lsoP.js} +1 -1
- package/dist/public/assets/mermaid-GHXKKRXX-ChsT7WMf.js +1 -0
- package/dist/public/assets/{page-list-cache-NegxJAbd.js → page-list-cache-CEyxAohw.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-kFxMX_hs.js → pending-receive-nav-store-CTqjXsBl.js} +1 -1
- package/dist/public/assets/{progress-BOWBNgYM.js → progress-OoUVKpXn.js} +1 -1
- package/dist/public/assets/{project-paths-C-SkuTbI.js → project-paths-BdGjLtxT.js} +1 -1
- package/dist/public/assets/{prop-types-nOgQFiCi.js → prop-types-CU7HQl68.js} +1 -1
- package/dist/public/assets/{receive-store-D9Px8yTN.js → receive-store-CJtiTNp3.js} +1 -1
- package/dist/public/assets/{selection-context-CYahjTQ5.js → selection-context-DR7ab7yE.js} +1 -1
- package/dist/public/assets/{skill-scope-DWsJ838z.js → skill-scope-BAozv3yS.js} +1 -1
- package/dist/public/assets/{skills-api-BLXzXEC-.js → skills-api-DY2ILAVx.js} +1 -1
- package/dist/public/assets/{src-DMJQ5Vxd.js → src-CGTpf8aj.js} +1 -1
- package/dist/public/assets/{tag-pill-input-DwIQ-TmP.js → tag-pill-input-llQtM5Z_.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CJUCqJBv.js → target-navigation-intent-HQou_X-w.js} +1 -1
- package/dist/public/assets/{telemetry-impl-Bbh5su9o.js → telemetry-impl-BIepj08G.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DVLjCMTC.js → telemetry-startup-B7OSl-z5.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-C-s_gqLX.js → terminal-cli-display-DTFiZBBc.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-CwapFFW5.js → terminal-launch-events-Bfi4m2vK.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-B16z13Uq.js → terminal-telemetry-CboX_HNN.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DOfSmyLX.js → typing-burst-detector-C4y2fKpb.js} +1 -1
- package/dist/public/assets/{uninstall-3RuzHXuR.js → uninstall-Bf9OgFpb.js} +1 -1
- package/dist/public/assets/{use-activity-panel-ewhIckJf.js → use-activity-panel-D_OG3gXD.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-BEWFuTWv.js → use-apply-config-color-theme-H1zX9cBU.js} +1 -1
- package/dist/public/assets/{use-collab-url-CwkAA1lj.js → use-collab-url-Dk-3M_go.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-C2sLeh-e.js → use-live-xterm-theme-ChdQbgac.js} +1 -1
- package/dist/public/assets/{use-open-skill-Bwm3tOLL.js → use-open-skill-BeZcrVWu.js} +1 -1
- package/dist/public/assets/{use-settings-route-DOVNFDSn.js → use-settings-route-CHUO6Vb3.js} +1 -1
- package/dist/public/assets/{use-skill-origin-Cyn5juIp.js → use-skill-origin-CLzO6XeG.js} +1 -1
- package/dist/public/assets/{use-skills-szHEgJLb.js → use-skills-B1r84pEp.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-Chvkm0XM.js → use-terminal-enabled-BCESHfrF.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-BN_8QKGi.js → use-timeline-entry-diff-Bs-prtib.js} +1 -1
- package/dist/public/assets/{use-workspace-DriKk3ci.js → use-workspace-DigIBtSV.js} +1 -1
- package/dist/public/index.html +47 -47
- package/dist/public/uninstall.html +4 -4
- package/dist/{repair-launch-json-Bh0ZbSGM.mjs → repair-launch-json-DGu77VVa.mjs} +2 -2
- package/dist/{repair-mcp-configs-C4QkDSa4.mjs → repair-mcp-configs-BKUZ3NzW.mjs} +2 -2
- package/dist/repair-skills-BABpOhB_.mjs +1 -0
- package/dist/{repair-skills-DquHsHSZ.mjs → repair-skills-CRG-r1Xh.mjs} +2 -2
- package/dist/{resolve-project-root-TgFFxl73.mjs → resolve-project-root-urAKqvDX.mjs} +4 -4
- package/dist/server-lock-C_5VGPQF.mjs +1 -0
- package/dist/{server-lock-DW446_ti.mjs → server-lock-_JWkU2Mh.mjs} +2 -2
- package/dist/{skill-teardown-DLbNuqvC.mjs → skill-teardown-CVMrfSeZ.mjs} +2 -2
- package/dist/{src-nJP2O0vw.mjs → src-BRlSw7bk.mjs} +1 -1
- package/dist/src-CjFV1e1Z.mjs +2039 -0
- package/dist/src-D6Ou79Ng.mjs +1 -0
- package/dist/{src-BSyYJ3UA.mjs → src-DBh4BCS2.mjs} +4 -4
- package/dist/{src-Cjs2mjwW.mjs → src-DhKkOAcb.mjs} +128 -128
- package/dist/start-CGzXGtnH.mjs +1 -0
- package/dist/{start-DXw9a2ML.mjs → start-DaYtIHPj.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-DfUFKoK2.mjs +0 -2
- package/dist/git-handle-ACPhpYTy.mjs +0 -1
- package/dist/init-sHqvUFdz.mjs +0 -1
- package/dist/loader-BdMPNOLm.mjs +0 -1
- package/dist/md-manager-CTy1swXK.mjs +0 -2
- package/dist/preview-CY1N1FhZ.mjs +0 -1
- package/dist/public/assets/FeedbackForm-Bmmb6Lzs.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CluUiwa8.js +0 -1
- package/dist/public/assets/client-version-B9jWAX8Y.js +0 -1
- package/dist/public/assets/i18n-CwbBw0OU.js +0 -1
- package/dist/public/assets/lib-CQqy20Z3.js +0 -29
- package/dist/public/assets/mermaid-GHXKKRXX-D2pBG5L4.js +0 -1
- package/dist/repair-skills-CiWDpMXb.mjs +0 -1
- package/dist/server-lock-CKYMJfzI.mjs +0 -1
- package/dist/src-2igu-66q.mjs +0 -2039
- package/dist/src-D5jc9qKa.mjs +0 -1
- package/dist/start-NSSGTzDh.mjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./markdownit-Du2gL9_G.js","./chunk-CYidjpOJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-CYidjpOJ.js";import{t as o}from"./preload-helper-Chd9yIcd.js";import{n as s,t as c}from"./trace-api-BslS_6CM.js";import{A as l,C as u,D as d,E as f,F as p,G as m,H as h,I as g,J as _,K as v,L as y,M as b,N as x,O as S,P as C,R as w,S as T,T as E,U as D,V as ee,X as te,Y as ne,_ as re,a as ie,at as ae,b as oe,c as se,d as ce,f as O,g as le,h as ue,i as de,it as k,j as A,k as fe,l as pe,m as me,n as he,o as ge,p as _e,q as ve,s as ye,t as be,tt as xe,u as Se,v as Ce,w as we,x as Te,y as Ee}from"./lib-CQqy20Z3.js";import{n as De,t as Oe}from"./w3c-keyname-yVu9TQnl.js";import{i as ke,n as Ae,r as je}from"./html-void-elements-XfxYgU9i.js";import{n as Me,r as Ne,t as Pe}from"./lib-B3XVxNhx.js";import{n as Fe,t as Ie}from"./markdownit-Du2gL9_G.js";var Le;function j(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Re=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ze=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Le=globalThis).__zod_globalConfig??(Le.__zod_globalConfig={});var Be=globalThis.__zod_globalConfig;function Ve(e){return e&&Object.assign(Be,e),Be}function He(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ue(e,t){return typeof t==`bigint`?t.toString():t}function We(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Ge(e){return e==null}function Ke(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function qe(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Je=Symbol(`evaluating`);function Ye(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Je)return r===void 0&&(r=Je,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Xe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ze(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Qe(e){return JSON.stringify(e)}function $e(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var et=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var nt=We(()=>{if(Be.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function rt(e){if(tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(tt(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function it(e){return rt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var eee=new Set([`string`,`number`,`symbol`]);function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ot(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function M(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function st(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ct={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function lt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return ot(e,Ze(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Xe(this,`shape`,e),e},checks:[]}))}function ut(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return ot(e,Ze(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Xe(this,`shape`,r),r},checks:[]}))}function dt(e,t){if(!rt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ot(e,Ze(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Xe(this,`shape`,n),n}}))}function ft(e,t){if(!rt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ot(e,Ze(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Xe(this,`shape`,n),n}}))}function pt(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return ot(e,Ze(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Xe(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function mt(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return ot(t,Ze(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Xe(this,`shape`,i),i},checks:[]}))}function ht(e,t,n){return ot(t,Ze(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Xe(this,`shape`,i),i}}))}function gt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function _t(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function vt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function yt(e){return typeof e==`string`?e:e?.message}function bt(e,t,n){let r=e.message?e.message:yt(e.inst?._zod.def?.error?.(e))??yt(t?.error?.(e))??yt(n.customError?.(e))??yt(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function xt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function St(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ct=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ue,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},wt=j(`$ZodError`,Ct),Tt=j(`$ZodError`,Ct,{Parent:Error});function Et(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Dt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Ot=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Re;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>bt(e,a,Ve())));throw et(t,i?.callee),t}return o.value},kt=Ot(Tt),At=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>bt(e,a,Ve())));throw et(t,i?.callee),t}return o.value},jt=At(Tt),Mt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Re;return a.issues.length?{success:!1,error:new(e??wt)(a.issues.map(e=>bt(e,i,Ve())))}:{success:!0,data:a.value}},Nt=Mt(Tt),Pt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>bt(e,i,Ve())))}:{success:!0,data:a.value}},tee=Pt(Tt),nee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ot(e)(t,n,i)},ree=e=>(t,n,r)=>Ot(e)(t,n,r),iee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return At(e)(t,n,i)},aee=e=>async(t,n,r)=>At(e)(t,n,r),oee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Mt(e)(t,n,i)},see=e=>(t,n,r)=>Mt(e)(t,n,r),cee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pt(e)(t,n,i)},lee=e=>async(t,n,r)=>Pt(e)(t,n,r),uee=/^[cC][0-9a-z]{6,}$/,dee=/^[0-9a-z]+$/,fee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pee=/^[0-9a-vA-V]{20}$/,mee=/^[A-Za-z0-9]{27}$/,hee=/^[a-zA-Z0-9_-]{21}$/,gee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_ee=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ft=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,It=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Lt=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Rt(){return new RegExp(Lt,`u`)}var zt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Vt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ht=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ut=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wt=/^[A-Za-z0-9_-]*$/,Gt=/^https?$/,Kt=/^\+[1-9]\d{6,14}$/,qt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Jt=RegExp(`^${qt}$`);function Yt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Xt(e){return RegExp(`^${Yt(e)}$`)}function Zt(e){let t=Yt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${qt}T(?:${r})$`)}var Qt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},$t=/^-?\d+$/,en=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,nn=/^null$/i,rn=/^[^A-Z]*$/,an=/^[^a-z]*$/,on=j(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),sn={number:`number`,bigint:`bigint`,object:`date`},cn=j(`$ZodCheckLessThan`,(e,t)=>{on.init(e,t);let n=sn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ln=j(`$ZodCheckGreaterThan`,(e,t)=>{on.init(e,t);let n=sn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),un=j(`$ZodCheckMultipleOf`,(e,t)=>{on.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):qe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),dn=j(`$ZodCheckNumberFormat`,(e,t)=>{on.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ct[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=$t)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),fn=j(`$ZodCheckMaxLength`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ge(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=xt(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pn=j(`$ZodCheckMinLength`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ge(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=xt(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),mn=j(`$ZodCheckLengthEquals`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ge(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=xt(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),hn=j(`$ZodCheckStringFormat`,(e,t)=>{var n,r;on.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),gn=j(`$ZodCheckRegex`,(e,t)=>{hn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_n=j(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=rn,hn.init(e,t)}),vn=j(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=an,hn.init(e,t)}),yn=j(`$ZodCheckIncludes`,(e,t)=>{on.init(e,t);let n=at(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),bn=j(`$ZodCheckStartsWith`,(e,t)=>{on.init(e,t);let n=RegExp(`^${at(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),xn=j(`$ZodCheckEndsWith`,(e,t)=>{on.init(e,t);let n=RegExp(`.*${at(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Sn=j(`$ZodCheckOverwrite`,(e,t)=>{on.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Cn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-CYidjpOJ.js";import{t as o}from"./preload-helper-Chd9yIcd.js";import{n as s,t as c}from"./trace-api-BslS_6CM.js";import{$ as l,A as u,B as d,C as f,D as p,G as m,H as h,J as g,K as _,L as v,M as y,O as b,Q as x,T as S,U as C,V as w,W as ee,X as T,Y as E,Z as te,_ as ne,a as re,at as ie,b as ae,c as oe,d as se,et as ce,f as le,g as D,h as ue,i as de,it as fe,j as O,k,l as pe,m as me,n as he,nt as ge,o as _e,p as ve,q as ye,rt as be,s as xe,t as A,tt as Se,u as Ce,v as we,w as Te,y as Ee}from"./lib-DH_OjOEF.js";import{n as De,t as Oe}from"./w3c-keyname-yVu9TQnl.js";import{i as ke,n as Ae,r as je}from"./html-void-elements-XfxYgU9i.js";import{n as Me,r as Ne,t as Pe}from"./lib-B3XVxNhx.js";import{n as Fe,t as Ie}from"./markdownit-Du2gL9_G.js";var Le;function j(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Re=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ze=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Le=globalThis).__zod_globalConfig??(Le.__zod_globalConfig={});var Be=globalThis.__zod_globalConfig;function Ve(e){return e&&Object.assign(Be,e),Be}function He(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ue(e,t){return typeof t==`bigint`?t.toString():t}function We(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Ge(e){return e==null}function Ke(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function qe(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Je=Symbol(`evaluating`);function Ye(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Je)return r===void 0&&(r=Je,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Xe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ze(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Qe(e){return JSON.stringify(e)}function $e(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var et=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var nt=We(()=>{if(Be.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function rt(e){if(tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(tt(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function it(e){return rt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var eee=new Set([`string`,`number`,`symbol`]);function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ot(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function M(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function st(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ct={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function lt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return ot(e,Ze(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Xe(this,`shape`,e),e},checks:[]}))}function ut(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return ot(e,Ze(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Xe(this,`shape`,r),r},checks:[]}))}function dt(e,t){if(!rt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ot(e,Ze(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Xe(this,`shape`,n),n}}))}function ft(e,t){if(!rt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ot(e,Ze(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Xe(this,`shape`,n),n}}))}function pt(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return ot(e,Ze(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Xe(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function mt(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return ot(t,Ze(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Xe(this,`shape`,i),i},checks:[]}))}function ht(e,t,n){return ot(t,Ze(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Xe(this,`shape`,i),i}}))}function gt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function _t(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function vt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function yt(e){return typeof e==`string`?e:e?.message}function bt(e,t,n){let r=e.message?e.message:yt(e.inst?._zod.def?.error?.(e))??yt(t?.error?.(e))??yt(n.customError?.(e))??yt(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function xt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function St(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ct=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ue,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},wt=j(`$ZodError`,Ct),Tt=j(`$ZodError`,Ct,{Parent:Error});function Et(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Dt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Ot=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Re;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>bt(e,a,Ve())));throw et(t,i?.callee),t}return o.value},kt=Ot(Tt),At=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>bt(e,a,Ve())));throw et(t,i?.callee),t}return o.value},jt=At(Tt),Mt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Re;return a.issues.length?{success:!1,error:new(e??wt)(a.issues.map(e=>bt(e,i,Ve())))}:{success:!0,data:a.value}},Nt=Mt(Tt),Pt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>bt(e,i,Ve())))}:{success:!0,data:a.value}},tee=Pt(Tt),nee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ot(e)(t,n,i)},ree=e=>(t,n,r)=>Ot(e)(t,n,r),iee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return At(e)(t,n,i)},aee=e=>async(t,n,r)=>At(e)(t,n,r),oee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Mt(e)(t,n,i)},see=e=>(t,n,r)=>Mt(e)(t,n,r),cee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pt(e)(t,n,i)},lee=e=>async(t,n,r)=>Pt(e)(t,n,r),uee=/^[cC][0-9a-z]{6,}$/,dee=/^[0-9a-z]+$/,fee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pee=/^[0-9a-vA-V]{20}$/,mee=/^[A-Za-z0-9]{27}$/,hee=/^[a-zA-Z0-9_-]{21}$/,gee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_ee=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ft=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,It=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Lt=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Rt(){return new RegExp(Lt,`u`)}var zt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Vt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ht=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ut=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wt=/^[A-Za-z0-9_-]*$/,Gt=/^https?$/,Kt=/^\+[1-9]\d{6,14}$/,qt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Jt=RegExp(`^${qt}$`);function Yt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Xt(e){return RegExp(`^${Yt(e)}$`)}function Zt(e){let t=Yt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${qt}T(?:${r})$`)}var Qt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},$t=/^-?\d+$/,en=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,nn=/^null$/i,rn=/^[^A-Z]*$/,an=/^[^a-z]*$/,on=j(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),sn={number:`number`,bigint:`bigint`,object:`date`},cn=j(`$ZodCheckLessThan`,(e,t)=>{on.init(e,t);let n=sn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ln=j(`$ZodCheckGreaterThan`,(e,t)=>{on.init(e,t);let n=sn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),un=j(`$ZodCheckMultipleOf`,(e,t)=>{on.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):qe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),dn=j(`$ZodCheckNumberFormat`,(e,t)=>{on.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ct[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=$t)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),fn=j(`$ZodCheckMaxLength`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ge(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=xt(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pn=j(`$ZodCheckMinLength`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ge(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=xt(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),mn=j(`$ZodCheckLengthEquals`,(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ge(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=xt(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),hn=j(`$ZodCheckStringFormat`,(e,t)=>{var n,r;on.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),gn=j(`$ZodCheckRegex`,(e,t)=>{hn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_n=j(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=rn,hn.init(e,t)}),vn=j(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=an,hn.init(e,t)}),yn=j(`$ZodCheckIncludes`,(e,t)=>{on.init(e,t);let n=at(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),bn=j(`$ZodCheckStartsWith`,(e,t)=>{on.init(e,t);let n=RegExp(`^${at(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),xn=j(`$ZodCheckEndsWith`,(e,t)=>{on.init(e,t);let n=RegExp(`.*${at(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Sn=j(`$ZodCheckOverwrite`,(e,t)=>{on.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Cn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
3
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
4
|
`))}},wn={major:4,minor:4,patch:3},Tn=j(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=gt(e),i;for(let a of t){if(a._zod.def.when){if(_t(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Re;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=gt(e,t))});else{if(e.issues.length===t)continue;r||=gt(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(gt(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Re;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Re;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Ye(e,`~standard`,()=>({validate:t=>{try{let n=Nt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return tee(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),En=j(`$ZodString`,(e,t)=>{Tn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Dn=j(`$ZodStringFormat`,(e,t)=>{hn.init(e,t),En.init(e,t)}),On=j(`$ZodGUID`,(e,t)=>{t.pattern??=_ee,Dn.init(e,t)}),kn=j(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ft(e)}else t.pattern??=Ft();Dn.init(e,t)}),An=j(`$ZodEmail`,(e,t)=>{t.pattern??=It,Dn.init(e,t)}),jn=j(`$ZodURL`,(e,t)=>{Dn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Gt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Mn=j(`$ZodEmoji`,(e,t)=>{t.pattern??=Rt(),Dn.init(e,t)}),Nn=j(`$ZodNanoID`,(e,t)=>{t.pattern??=hee,Dn.init(e,t)}),Pn=j(`$ZodCUID`,(e,t)=>{t.pattern??=uee,Dn.init(e,t)}),Fn=j(`$ZodCUID2`,(e,t)=>{t.pattern??=dee,Dn.init(e,t)}),In=j(`$ZodULID`,(e,t)=>{t.pattern??=fee,Dn.init(e,t)}),Ln=j(`$ZodXID`,(e,t)=>{t.pattern??=pee,Dn.init(e,t)}),Rn=j(`$ZodKSUID`,(e,t)=>{t.pattern??=mee,Dn.init(e,t)}),zn=j(`$ZodISODateTime`,(e,t)=>{t.pattern??=Zt(t),Dn.init(e,t)}),Bn=j(`$ZodISODate`,(e,t)=>{t.pattern??=Jt,Dn.init(e,t)}),Vn=j(`$ZodISOTime`,(e,t)=>{t.pattern??=Xt(t),Dn.init(e,t)}),Hn=j(`$ZodISODuration`,(e,t)=>{t.pattern??=gee,Dn.init(e,t)}),Un=j(`$ZodIPv4`,(e,t)=>{t.pattern??=zt,Dn.init(e,t),e._zod.bag.format=`ipv4`}),Wn=j(`$ZodIPv6`,(e,t)=>{t.pattern??=Bt,Dn.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Gn=j(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Vt,Dn.init(e,t)}),Kn=j(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ht,Dn.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function qn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Jn=j(`$ZodBase64`,(e,t)=>{t.pattern??=Ut,Dn.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{qn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Yn(e){if(!Wt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return qn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Xn=j(`$ZodBase64URL`,(e,t)=>{t.pattern??=Wt,Dn.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Yn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Zn=j(`$ZodE164`,(e,t)=>{t.pattern??=Kt,Dn.init(e,t)});function Qn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var $n=j(`$ZodJWT`,(e,t)=>{Dn.init(e,t),e._zod.check=n=>{Qn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),er=j(`$ZodNumber`,(e,t)=>{Tn.init(e,t),e._zod.pattern=e._zod.bag.pattern??en,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),tr=j(`$ZodNumberFormat`,(e,t)=>{dn.init(e,t),er.init(e,t)}),nr=j(`$ZodBoolean`,(e,t)=>{Tn.init(e,t),e._zod.pattern=tn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),rr=j(`$ZodNull`,(e,t)=>{Tn.init(e,t),e._zod.pattern=nn,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),ir=j(`$ZodUnknown`,(e,t)=>{Tn.init(e,t),e._zod.parse=e=>e}),ar=j(`$ZodNever`,(e,t)=>{Tn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function or(e,t,n){e.issues.length&&t.issues.push(...vt(n,e.issues)),t.value[n]=e.value}var sr=j(`$ZodArray`,(e,t)=>{Tn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>or(t,n,e))):or(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function cr(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...vt(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function lr(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=st(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ur(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>cr(e,n,i,t,u,d))):cr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var vee=j(`$ZodObject`,(e,t)=>{if(Tn.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=We(()=>lr(t));Ye(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=tt,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>cr(n,t,e,s,r,i))):cr(a,t,e,s,r,i)}return i?ur(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),yee=j(`$ZodObjectJIT`,(e,t)=>{vee.init(e,t);let n=e._zod.parse,r=We(()=>lr(t)),i=e=>{let t=new Cn([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Qe(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Qe(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
5
5
|
if (${n}.issues.length) {
|
|
@@ -191,7 +191,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
191
191
|
`),slice:t}}function Ab(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new W(U.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
192
192
|
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Xh.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Ub(n),Bv&&Wb(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||zh.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!jb.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Gb(Lb(s,+u[1],+u[2]),u[4]);else if(s=W.maxOpen(Mb(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Lb(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var jb=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Mb(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&Pb(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Fb(a[a.length-1],i.length));let n=Nb(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return U.from(a)}return e}function Nb(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,U.from(e));return e}function Pb(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=Pb(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(U.from(Nb(n,e,i+1))))}}function Fb(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Fb(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(U.empty,!0);return e.copy(n.append(r))}function Ib(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=Ib(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(U.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Lb(e,t,n){return t<e.openStart&&(e=new W(Ib(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new W(Ib(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Rb={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},zb=null;function Bb(){return zb||=document.implementation.createHTMLDocument(`title`)}var Vb=null;function Hb(e){let t=window.trustedTypes;return t?(Vb||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),Vb.createHTML(e)):e}function Ub(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Bb().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Rb[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Hb(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Wb(e){let t=e.querySelectorAll(Nv?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Gb(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=U.from(t.create(r[e+1],i)),a++,o++}return new W(i,a,o)}var Kb={},qb={},Jb={touchstart:!0,touchmove:!0},Yb=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Xb(e){for(let t in Kb){let n=Kb[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{tx(e,t)&&!ex(e,t)&&(e.editable||!(t.type in qb))&&n(e,t)},Jb[t]?{passive:!0}:void 0)}Fv&&e.dom.addEventListener(`input`,()=>null),$b(e)}function Zb(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Qb(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function $b(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ex(e,t))})}function ex(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function tx(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function nx(e,t){!ex(e,t)&&Kb[t.type]&&(e.editable||!(t.type in qb))&&Kb[t.type](e,t)}qb.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!gx(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(zv&&Nv&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Iv&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,bv(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Ob(e,n)?n.preventDefault():Zb(e,`key`)},qb.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},qb.keypress=(e,t)=>{let n=t;if(gx(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Lv&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof K)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function rx(e){return{left:e.clientX,top:e.clientY}}function ix(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function ax(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function ox(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function sx(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&q.isSelectable(r)?(ox(e,new q(n),`pointer`),!0):!1}function cx(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof q&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(q.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(ox(e,q.create(e.state.doc,i),`pointer`),!0)}function lx(e,t,n,r,i){return ax(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?cx(e,n):sx(e,n))}function ux(e,t,n,r){return ax(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function dx(e,t,n,r){return ax(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||fx(e,n,r)}function fx(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(ox(e,K.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)ox(e,K.create(r,a+1,a+1+n.content.size),`pointer`);else if(q.isSelectable(n))ox(e,q.create(r,a),`pointer`);else continue;return!0}}function px(e){return Cx(e)}var mx=Lv?`metaKey`:`ctrlKey`;Kb.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=px(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&ix(n,e.input.lastClick)&&!n[mx]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(rx(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new hx(e,o,n,!!r)):(a==`doubleClick`?ux:dx)(e,o.pos,o.inside,n)?n.preventDefault():Zb(e,`pointer`))};var hx=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[mx],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof q&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&jv&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),Zb(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Zy(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(rx(e))),this.updateAllowDefault(e),this.allowDefault||!t?Zb(this.view,`pointer`):lx(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fv&&this.mightDrag&&!this.mightDrag.node.isAtom||Nv&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ox(this.view,G.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Zb(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Zb(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};Kb.touchstart=e=>{e.input.lastTouch=Date.now(),px(e),Zb(e,`pointer`)},Kb.touchmove=e=>{e.input.lastTouch=Date.now(),Zb(e,`pointer`)},Kb.contextmenu=e=>px(e);function gx(e,t){return e.composing?!0:Fv&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var _x=zv?5e3:-1;qb.compositionstart=qb.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof K&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||Nv&&Rv&&vx(e)))e.markCursor=e.state.storedMarks||n.marks(),Cx(e,!0),e.markCursor=null;else if(Cx(e,!t.selection.empty),jv&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}yx(e,_x)};function vx(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}qb.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,yx(e,20))};function yx(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Cx(e),t))}function bx(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Sx());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function xx(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=hv(t.focusNode,t.focusOffset),r=gv(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function Sx(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function Cx(e,t=!1){if(!(zv&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),bx(e),t||e.docView&&e.docView.dirty){let n=Yy(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function wx(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Tx=kv&&Av<15||Iv&&Vv<604;Kb.copy=qb.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Tx?null:n.clipboardData,{dom:o,text:s}=kb(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):wx(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Ex(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Dx(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ox(e,r.value,null,i,t):Ox(e,r.textContent,r.innerHTML,i,t)},50)}function Ox(e,t,n,r,i){let a=Ab(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||W.empty)))return!0;if(!a)return!1;let o=Ex(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function kx(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}qb.paste=(e,t)=>{let n=t;if(e.composing&&!zv)return;let r=Tx?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Ox(e,kx(r),r.getData(`text/html`),i,n)?n.preventDefault():Dx(e,n)};var Ax=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},jx=Lv?`altKey`:`ctrlKey`;function Mx(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[jx]:!n}Kb.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(rx(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof q?i.to-1:i.to))){if(r&&r.mightDrag)o=q.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=q.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=kb(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Nv||Pv>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Tx?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Tx||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Ax(l,Mx(e,n),o)},Kb.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},qb.dragover=qb.dragenter=(e,t)=>t.preventDefault(),qb.drop=(e,t)=>{try{Nx(e,t,e.dragging)}finally{e.dragging=null}};function Nx(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(rx(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Ab(e,kx(t.dataTransfer),Tx?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Mx(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||W.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Mg(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&q.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new q(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(ob(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}Kb.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Zy(e)},20))},Kb.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},Kb.beforeinput=(e,t)=>{if(Nv&&zv&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,bv(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in qb)Kb[e]=qb[e];function Px(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Fx=class e{constructor(e,t){this.toDOM=e,this.spec=t||Bx,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Rx(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Px(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Ix=class e{constructor(e,t){this.attrs=e,this.spec=t||Bx}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Rx(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Px(this.attrs,t.attrs)&&Px(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},Lx=class e{constructor(e,t){this.attrs=e,this.spec=t||Bx}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new Rx(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Px(this.attrs,t.attrs)&&Px(this.spec,t.spec)}destroy(){}},Rx=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new Fx(n,r))}static inline(t,n,r,i){return new e(t,n,new Ix(r,i))}static node(t,n,r,i){return new e(t,n,new Lx(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ix}get widget(){return this.type instanceof Fx}},zx=[],Bx={},Vx=class e{constructor(e,t){this.local=e.length?e:zx,this.children=t.length?t:zx}static create(e,t){return t.length?Yx(t,e,0,Bx):Hx}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==Hx||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Bx)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Wx(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Xx),zx):Hx}add(t,n){return n.length?this==Hx?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=qx(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,Yx(s,e,o+1,Bx)),a+=3}});let o=Gx(a?Jx(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(Xx):this.local,i||this.children)}remove(e){return e.length==0||this==Hx?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==Hx?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):Hx}forChild(t,n){if(this==Hx)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof Ix){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(Xx),zx);return r?new Ux([t,r]):t}return r||Hx}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return Zx(this.localsInner(e))}localsInner(e){if(this==Hx)return zx;if(e.inlineContent||!this.local.some(Ix.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Ix||t.push(this.local[e]);return t}forEachSet(e){e(this)}};Vx.empty=new Vx([],[]),Vx.removeOverlap=Zx;var Hx=Vx.empty,Ux=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Bx));return e.from(r)}forChild(t,n){if(n.isLeaf)return Vx.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Hx&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?Zx(n?t:t.sort(Xx)):zx}static from(t){switch(t.length){case 0:return Hx;case 1:return t[0];default:return new e(t.every(e=>e instanceof Vx)?t:t.reduce((e,t)=>e.concat(t instanceof Vx?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Wx(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==Hx?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Yx(Kx(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Vx(t.sort(Xx),s)}function Gx(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Rx(i.from+t,i.to+t,i.type))}return n}function Kx(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function qx(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function Jx(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Yx(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=qx(e,t,o+n);if(s){a=!0;let e=Yx(s,t,n+o+1,r);e!=Hx&&i.push(o,o+t.nodeSize,e)}});let o=Gx(a?Jx(e):e,-n).sort(Xx);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new Vx(o,i):Hx}function Xx(e,t){return e.from-t.from||e.to-t.to}function Zx(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Qx(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Qx(t,i,r.copy(a.from,r.to)));break}}}return t}function Qx(e,t,n){for(;t<e.length&&Xx(n,e[t])>0;)t++;e.splice(t,0,n)}function $x(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Hx&&t.push(r)}),e.cursorWrapper&&t.push(Vx.create(e.state.doc,[e.cursorWrapper.deco])),Ux.from(t)}var eS={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tS=kv&&Av<=11,nS=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},rS=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new nS,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);kv&&Av<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Fv&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),tS&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,eS)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(sb(this.view)){if(this.suppressingSelectionUpdates)return Zy(this.view);if(kv&&Av<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&dv(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=sv(n))t.add(n);for(let r=e.anchorNode;r;r=sv(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&sb(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(jv&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||lS(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&yv(n)&&(c=Yy(e))&&c.eq(G.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Zy(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),oS(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,uS(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Zy(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(kv&&Av<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?ov(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?ov(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},iS=new WeakMap,aS=!1;function oS(e){if(!iS.has(e)&&(iS.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=jv,aS)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),aS=!0}}function sS(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return dv(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function cS(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return sS(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?sS(e,n):null}function lS(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function uS(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function dS(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],yv(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Nv&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||zh.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:fS,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function fS(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Fv&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||Fv&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var pS=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function mS(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Yy(e,t);if(n&&!e.state.selection.eq(n)){if(Nv&&zv&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,bv(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=dS(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=yS(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Iv&&e.input.lastIOSEnter>Date.now()-225||zv)&&i.some(e=>e.nodeType==1&&!pS.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,bv(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof K&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=hS(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof K&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),kv&&Av<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Iv&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,bv(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&_S(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,bv(8,`Backspace`)))){zv&&Nv&&e.domObserver.suppressSelectionUpdates();return}Nv&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),zv&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,bv(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=hS(e,n.doc,l.sel);t&&!(Nv&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||kv&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){kv&&Av<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Zy(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=gS(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function hS(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ob(e,t.resolve(n.anchor),t.resolve(n.head))}function gS(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(U.from(l).eq(e))return{mark:s,type:o}}function _S(e,t,n,r,i){if(n-t<=i.pos-r.pos||vS(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(vS(a,!0,!0));return!o.parent.isTextblock||o.pos>n||vS(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function vS(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function yS(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&bS(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&bS(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function bS(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var xS=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Yb,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(OS),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=wS(this),CS(this),this.nodeViews=ES(this),this.docView=ky(this.state.doc,SS(this),$x(this),this.dom,this),this.domObserver=new rS(this,(e,t,n,r)=>mS(this,e,t,n,r)),this.domObserver.start(),Xb(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&$b(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(OS),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(bx(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=ES(this);DS(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&$b(this),this.editable=wS(this),CS(this);let o=$x(this),s=SS(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Kv(this);if(i){this.domObserver.stop();let t=l&&(kv||Nv)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&TS(n.selection,e.selection);if(l){let n=Nv?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=xx(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=ky(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&lb(this))?Zy(this,t):(ib(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Jv(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof q){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Gv(this,t.getBoundingClientRect(),e)}else Gv(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Ax(e.slice,e.move,r<0?void 0:q.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(kv){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Zv(this.dom),Zy(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ay(this,e)}coordsAtPos(e,t=1){return ly(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return yy(this,t||this.state,e)}pasteHTML(e,t){return Ox(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Ox(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return kb(this,e)}destroy(){this.docView&&(Qb(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$x(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,uv())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return nx(this,e)}domSelectionRange(){let e=this.domSelection();return e?Fv&&this.root.nodeType===11&&xv(this.dom.ownerDocument)==this.dom&&cS(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};xS.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function SS(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Rx.node(0,e.state.doc.content.size,t)]}function CS(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:Rx.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function wS(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function TS(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function ES(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function DS(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function OS(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var kS=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),AS=typeof navigator<`u`&&/Win/.test(navigator.platform);function jS(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))kS?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function MS(e){let t=Object.create(null);for(let n in e)t[jS(n)]=e[n];return t}function NS(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function PS(e){return new f_({props:{handleKeyDown:FS(e)}})}function FS(e){let t=MS(e);return function(e,n){let r=De(n),i,a=t[NS(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[NS(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(AS&&n.ctrlKey&&n.altKey)&&(i=Oe[n.keyCode])&&i!=r){let r=t[NS(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var IS=Object.defineProperty,LS=(e,t)=>{for(var n in t)IS(e,n,{get:t[n],enumerable:!0})};function RS(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var zS=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:RS({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},BS={};LS(BS,{blur:()=>VS,clearContent:()=>HS,clearNodes:()=>US,command:()=>WS,createParagraphNear:()=>GS,cut:()=>KS,deleteCurrentNode:()=>qS,deleteNode:()=>YS,deleteRange:()=>XS,deleteSelection:()=>ZS,enter:()=>QS,exitCode:()=>$S,extendMarkRange:()=>oC,first:()=>sC,focus:()=>mC,forEach:()=>hC,insertContent:()=>gC,insertContentAt:()=>SC,joinBackward:()=>TC,joinDown:()=>wC,joinForward:()=>EC,joinItemBackward:()=>DC,joinItemForward:()=>OC,joinTextblockBackward:()=>kC,joinTextblockForward:()=>AC,joinUp:()=>CC,keyboardShortcut:()=>NC,lift:()=>FC,liftEmptyBlock:()=>IC,liftListItem:()=>LC,newlineInCode:()=>RC,resetAttributes:()=>VC,scrollIntoView:()=>HC,selectAll:()=>UC,selectNodeBackward:()=>WC,selectNodeForward:()=>GC,selectParentNode:()=>KC,selectTextblockEnd:()=>qC,selectTextblockStart:()=>JC,setContent:()=>XC,setMark:()=>Xw,setMeta:()=>Zw,setNode:()=>Qw,setNodeSelection:()=>$w,setTextDirection:()=>eT,setTextSelection:()=>tT,sinkListItem:()=>nT,splitBlock:()=>iT,splitListItem:()=>aT,toggleList:()=>lT,toggleMark:()=>uT,toggleNode:()=>dT,toggleWrap:()=>fT,undoInputRule:()=>pT,unsetAllMarks:()=>mT,unsetMark:()=>hT,unsetTextDirection:()=>gT,updateAttributes:()=>_T,wrapIn:()=>vT,wrapInList:()=>yT});var VS=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),HS=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),US=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=Cg(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},WS=e=>t=>e(t),GS=()=>({state:e,dispatch:t})=>F_(e,t),KS=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new K(r.doc.resolve(Math.max(o-1,0)))),!0},qS=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function JS(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var YS=e=>({tr:t,state:n,dispatch:r})=>{let i=JS(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},XS=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},ZS=()=>({state:e,dispatch:t})=>g_(e,t),QS=()=>({commands:e})=>e.keyboardShortcut(`Enter`),$S=()=>({state:e,dispatch:t})=>P_(e,t);function eC(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function tC(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:eC(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function nC(e,t,n={}){return e.find(e=>e.type===t&&tC(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function rC(e,t,n={}){return!!nC(e,t,n)}function iC(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!nC([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&rC([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&rC([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function aC(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var oC=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=aC(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=iC(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=K.create(o,e.from,e.to);n.setSelection(t)}}return!0},sC=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function cC(e){return e instanceof K}function lC(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function uC(e,t=null){if(!t)return null;let n=G.atStart(e),r=G.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?K.create(e,lC(0,i,a),lC(e.content.size,i,a)):K.create(e,lC(t,i,a),lC(t,i,a))}function dC(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function fC(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function pC(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var mC=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(fC()||dC())&&r.dom.focus(),pC()&&!fC()&&!dC()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!cC(n.state.selection))return o(),!0;let s=uC(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},hC=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),gC=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),_C=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&_C(r)}return e};function vC(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return _C(n)}function yC(e,t,n){if(e instanceof gh||e instanceof U)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return U.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),yC(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new Lh({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?zh.fromSchema(a).parseSlice(vC(e),n.parseOptions):zh.fromSchema(a).parse(vC(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=zh.fromSchema(t);return n.slice?r.parseSlice(vC(e),n.parseOptions).content:r.parse(vC(e),n.parseOptions)}return yC(``,t,n)}function bC(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof yg||i instanceof bg))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(G.near(e.doc.resolve(o),n))}var xC=e=>!(`type`in e),SC=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{yC(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=yC(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((xC(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof U){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&bC(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},CC=()=>({state:e,dispatch:t})=>k_(e,t),wC=()=>({state:e,dispatch:t})=>A_(e,t),TC=()=>({state:e,dispatch:t})=>v_(e,t),EC=()=>({state:e,dispatch:t})=>E_(e,t),DC=()=>({state:e,dispatch:t,tr:n})=>{try{let r=jg(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},OC=()=>({state:e,dispatch:t,tr:n})=>{try{let r=jg(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},kC=()=>({state:e,dispatch:t})=>y_(e,t),AC=()=>({state:e,dispatch:t})=>b_(e,t);function jC(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function MC(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))fC()||jC()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var NC=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=MC(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function PC(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?JS(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>tC(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var FC=(e,t={})=>({state:n,dispatch:r})=>PC(n,JS(e,n.schema),t)?j_(n,r):!1,IC=()=>({state:e,dispatch:t})=>I_(e,t),LC=e=>({state:t,dispatch:n})=>nv(JS(e,t.schema))(t,n),RC=()=>({state:e,dispatch:t})=>M_(e,t);function zC(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function BC(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var VC=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=zC(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=JS(e,r.schema)),s===`mark`&&(o=aC(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,BC(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(BC(a.attrs,t))))})})}),c},HC=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),UC=()=>({tr:e,dispatch:t})=>{if(t){let t=new Qg(e.doc);e.setSelection(t)}return!0},WC=()=>({state:e,dispatch:t})=>C_(e,t),GC=()=>({state:e,dispatch:t})=>D_(e,t),KC=()=>({state:e,dispatch:t})=>z_(e,t),qC=()=>({state:e,dispatch:t})=>G_(e,t),JC=()=>({state:e,dispatch:t})=>W_(e,t);function YC(e,t,n={},r={}){return yC(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var XC=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=YC(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function ZC(e,t){let n=aC(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function QC(e,t){let n=new Gg(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function $C(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ew(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function tw(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function nw(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function rw(e){return t=>nw(t.$from,e)}function J(e,t,n){return e.config[t]===void 0&&e.parent?J(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?J(e.parent,t,n):null}):e.config[t]}function iw(e){return e.map(e=>{let t=J(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...iw(t())]:e}).flat(10)}function aw(e,t){let n=Xh.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function ow(e){return typeof e==`function`}function sw(e,t=void 0,...n){return ow(e)?t?e.bind(t)(...n):e(...n):e}function cw(e={}){return Object.keys(e).length===0&&e.constructor===Object}function lw(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function uw(e){let t=[],{nodeExtensions:n,markExtensions:r}=lw(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=J(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=J(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function dw(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function fw(e){let t=[],n=dw(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function pw(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...fw(n[e]),...fw(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function mw(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>pw(e,t),{})}function hw(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function gw(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):hw(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function _w(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&cw(t)?!1:t!=null))}function vw(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function yw(e,t){let n=uw(e),{nodeExtensions:r,markExtensions:i}=lw(e);return new Lh({topNode:r.find(e=>J(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=_w({...e.reduce((e,t)=>{let n=J(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:sw(J(r,`content`,a)),marks:sw(J(r,`marks`,a)),group:sw(J(r,`group`,a)),inline:sw(J(r,`inline`,a)),atom:sw(J(r,`atom`,a)),selectable:sw(J(r,`selectable`,a)),draggable:sw(J(r,`draggable`,a)),code:sw(J(r,`code`,a)),whitespace:sw(J(r,`whitespace`,a)),linebreakReplacement:sw(J(r,`linebreakReplacement`,a)),defining:sw(J(r,`defining`,a)),isolating:sw(J(r,`isolating`,a)),attrs:Object.fromEntries(i.map(vw))}),s=sw(J(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>gw(e,i)));let c=J(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:mw(e,i)}));let l=J(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=_w({...e.reduce((e,t)=>{let n=J(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:sw(J(r,`inclusive`,a)),excludes:sw(J(r,`excludes`,a)),group:sw(J(r,`group`,a)),spanning:sw(J(r,`spanning`,a)),code:sw(J(r,`code`,a)),attrs:Object.fromEntries(i.map(vw))}),s=sw(J(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>gw(e,i)));let c=J(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:mw(e,i)})),[r.name,o]}))})}function bw(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function xw(e){return e.sort((e,t)=>{let n=J(e,`priority`)||100,r=J(t,`priority`)||100;return n>r?-1:+(n<r)})}function Sw(e){let t=xw(iw(e)),n=bw(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Cw(e,t){return yw(Sw(e),t)}function ww(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
193
193
|
|
|
194
|
-
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Tw(e,t){return ww(e,{from:0,to:e.content.size},t)}function Ew(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Dw(e,t){let n=JS(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Ow(e,t){let n=zC(typeof t==`string`?t:t.name,e.schema);return n===`node`?Dw(e,t):n===`mark`?ZC(e,t):{}}function kw(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Aw(e){let t=kw(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function jw(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Aw(r)}function Mw(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=iC(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Nw=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function Pw(e,t){return t.nodes[e]||t.marks[e]||null}function Fw(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Iw=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Lw(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?aC(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>tC(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>tC(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Rw(e,t,n={}){if(!t)return PC(e,null,n)||Lw(e,null,n);let r=zC(t,e.schema);return r===`node`?PC(e,t,n):r===`mark`?Lw(e,t,n):!1}var zw=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=rw(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Bw=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Vw(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Hw(e,t){let{nodeExtensions:n}=lw(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=sw(J(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function Uw(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Uw(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Ww(e){return e instanceof q}var Gw=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Kw(e,t){let n=t.mapping.mapResult(e.position);return{position:new Gw(n.pos),mapResult:n}}function qw(e){return new Gw(e)}function Jw(e,t,n){let r=e.state.doc.content.size,i=lC(t,0,r),a=lC(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function Yw(e,t,n){let{selection:r}=t,i=null;if(cC(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var Xw=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=aC(e,r.schema);if(i)if(o){let e=ZC(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return Yw(r,n,c)},Zw=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Qw=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=JS(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>q_(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>q_(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},$w=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=lC(e,0,n.content.size),i=q.create(n,r);t.setSelection(i)}return!0},eT=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},tT=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=K.atStart(n).from,o=K.atEnd(n).to,s=lC(r,a,o),c=lC(i,a,o),l=K.create(n,s,c);t.setSelection(l)}return!0},nT=e=>({state:t,dispatch:n})=>av(JS(e,t.schema))(t,n);function rT(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var iT=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Fw(l,s.node().type.name,s.node().attrs);if(a instanceof q&&a.node.isBlock)return!s.parentOffset||!Og(o,s.pos)?!1:(r&&(e&&rT(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:$C(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=Og(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&Og(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof K&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&rT(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},aT=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=JS(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=U.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=U.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...Fw(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(U.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new W(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(K.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Fw(d,u.type.name,u.attrs),...t},m={...Fw(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!Og(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},oT=(e,t)=>{let n=rw(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&kg(e.doc,n.pos)&&e.join(n.pos),!0},sT=(e,t)=>{let n=rw(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&kg(e.doc,r)&&e.join(r),!0};function cT(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return K.create(t,1,r)}var lT=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=JS(e,o.schema),m=JS(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=rw(e=>Hw(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&Hw(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,D=!!x&&y.depth>=1&&y.depth-x.depth<=1,ee=!!T;if((D||ee)&&E){if(E.node.type===p)return S&&ee?c().command(({tr:e,dispatch:t})=>{let n=cT(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Hw(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>oT(a,p)).command(()=>sT(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>oT(a,p)).command(()=>sT(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>oT(a,p)).command(()=>sT(a,p)).run()},uT=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=aC(e,r.schema);return Lw(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},dT=(e,t,n={})=>({state:r,commands:i})=>{let a=JS(e,r.schema),o=JS(t,r.schema),s=PC(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},fT=(e,t={})=>({state:n,commands:r})=>{let i=JS(e,n.schema);return PC(n,i,t)?r.lift(i):r.wrapIn(i,t)},pT=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},mT=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},hT=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=aC(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=iC(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},gT=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},_T=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=zC(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=JS(e,r.schema)),s===`mark`&&(o=aC(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},vT=(e,t={})=>({state:n,dispatch:r})=>K_(JS(e,n.schema),t)(n,r),yT=(e,t={})=>({state:n,dispatch:r})=>$_(JS(e,n.schema),t)(n,r),bT=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},xT=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},ST=(e,t)=>{if(eC(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function CT(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=Iw(c)+i;return a.forEach(e=>{if(l)return;let a=ST(u,e.find);if(!a)return;let c=s.state.tr,d=RS({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new zS({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function wT(e){let{editor:t,rules:n}=e,r=new f_({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:aw(U.from(e),a.schema);let{from:i}=s;CT({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return CT({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&CT({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?CT({editor:t,from:a.pos,to:a.pos,text:`
|
|
194
|
+
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Tw(e,t){return ww(e,{from:0,to:e.content.size},t)}function Ew(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Dw(e,t){let n=JS(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Ow(e,t){let n=zC(typeof t==`string`?t:t.name,e.schema);return n===`node`?Dw(e,t):n===`mark`?ZC(e,t):{}}function kw(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Aw(e){let t=kw(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function jw(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Aw(r)}function Mw(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=iC(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Nw=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function Pw(e,t){return t.nodes[e]||t.marks[e]||null}function Fw(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Iw=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Lw(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?aC(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>tC(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>tC(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Rw(e,t,n={}){if(!t)return PC(e,null,n)||Lw(e,null,n);let r=zC(t,e.schema);return r===`node`?PC(e,t,n):r===`mark`?Lw(e,t,n):!1}var zw=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=rw(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Bw=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Vw(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Hw(e,t){let{nodeExtensions:n}=lw(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=sw(J(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function Uw(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Uw(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Ww(e){return e instanceof q}var Gw=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Kw(e,t){let n=t.mapping.mapResult(e.position);return{position:new Gw(n.pos),mapResult:n}}function qw(e){return new Gw(e)}function Jw(e,t,n){let r=e.state.doc.content.size,i=lC(t,0,r),a=lC(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function Yw(e,t,n){let{selection:r}=t,i=null;if(cC(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var Xw=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=aC(e,r.schema);if(i)if(o){let e=ZC(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return Yw(r,n,c)},Zw=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Qw=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=JS(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>q_(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>q_(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},$w=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=lC(e,0,n.content.size),i=q.create(n,r);t.setSelection(i)}return!0},eT=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},tT=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=K.atStart(n).from,o=K.atEnd(n).to,s=lC(r,a,o),c=lC(i,a,o),l=K.create(n,s,c);t.setSelection(l)}return!0},nT=e=>({state:t,dispatch:n})=>av(JS(e,t.schema))(t,n);function rT(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var iT=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Fw(l,s.node().type.name,s.node().attrs);if(a instanceof q&&a.node.isBlock)return!s.parentOffset||!Og(o,s.pos)?!1:(r&&(e&&rT(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:$C(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=Og(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&Og(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof K&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&rT(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},aT=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=JS(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=U.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=U.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...Fw(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(U.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new W(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(K.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Fw(d,u.type.name,u.attrs),...t},m={...Fw(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!Og(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},oT=(e,t)=>{let n=rw(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&kg(e.doc,n.pos)&&e.join(n.pos),!0},sT=(e,t)=>{let n=rw(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&kg(e.doc,r)&&e.join(r),!0};function cT(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return K.create(t,1,r)}var lT=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=JS(e,o.schema),m=JS(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=rw(e=>Hw(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,ee=S&&w&&Hw(w.type.name,d)?{node:w,pos:0,depth:0}:null,T=x??ee,E=!!x&&y.depth>=1&&y.depth-x.depth<=1,te=!!ee;if((E||te)&&T){if(T.node.type===p)return S&&te?c().command(({tr:e,dispatch:t})=>{let n=cT(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Hw(T.node.type.name,d)&&p.validContent(T.node.content))return c().command(()=>(a.setNodeMarkup(T.pos,p),!0)).command(()=>oT(a,p)).command(()=>sT(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>oT(a,p)).command(()=>sT(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>oT(a,p)).command(()=>sT(a,p)).run()},uT=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=aC(e,r.schema);return Lw(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},dT=(e,t,n={})=>({state:r,commands:i})=>{let a=JS(e,r.schema),o=JS(t,r.schema),s=PC(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},fT=(e,t={})=>({state:n,commands:r})=>{let i=JS(e,n.schema);return PC(n,i,t)?r.lift(i):r.wrapIn(i,t)},pT=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},mT=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},hT=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=aC(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=iC(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},gT=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},_T=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=zC(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=JS(e,r.schema)),s===`mark`&&(o=aC(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},vT=(e,t={})=>({state:n,dispatch:r})=>K_(JS(e,n.schema),t)(n,r),yT=(e,t={})=>({state:n,dispatch:r})=>$_(JS(e,n.schema),t)(n,r),bT=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},xT=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},ST=(e,t)=>{if(eC(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function CT(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=Iw(c)+i;return a.forEach(e=>{if(l)return;let a=ST(u,e.find);if(!a)return;let c=s.state.tr,d=RS({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new zS({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function wT(e){let{editor:t,rules:n}=e,r=new f_({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:aw(U.from(e),a.schema);let{from:i}=s;CT({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return CT({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&CT({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?CT({editor:t,from:a.pos,to:a.pos,text:`
|
|
195
195
|
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function TT(e){return Object.prototype.toString.call(e).slice(8,-1)}function ET(e){return TT(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function DT(e,t){let n={...e};return ET(e)&&ET(t)&&Object.keys(t).forEach(r=>{ET(t[r])&&ET(e[r])?n[r]=DT(e[r],t[r]):n[r]=t[r]}),n}var OT=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...sw(J(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...sw(J(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>DT(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},kT=class e extends OT{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function AT(e){return typeof e==`number`}var jT=class{constructor(e){this.find=e.find,this.handler=e.handler}},MT=(e,t,n)=>{if(eC(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function NT(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new zS({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||MT(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var PT=null,FT=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function IT(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!NT({editor:t,state:RS({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new f_({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(PT=t)},i=()=>{PT&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=PT;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:aw(U.from(t),r.schema);let{from:n}=d,i=n+t.length,a=FT(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!AT(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var LT=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Sw(e),this.schema=yw(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=J(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Pw(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return xw([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Pw(t.name,this.schema)},r=[],i=J(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&J(t,`exitable`,n)&&(a.ArrowRight=()=>kT.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=PS(a);r.push(o);let s=J(t,`addInputRules`,n);if(Vw(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=wT({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=J(t,`addPasteRules`,n);if(Vw(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=IT({editor:e,rules:t});r.push(...n)}}let l=J(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return uw(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=lw(this.extensions);return Object.fromEntries(t.filter(e=>!!J(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=J(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:JS(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:mw(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return xw([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Pw(n.name,this.schema)},i=J(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return xw([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Pw(n.name,this.schema)},i=J(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=lw(this.extensions);return Object.fromEntries(t.filter(e=>!!J(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=J(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:aC(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=mw(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{xE(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Pw(e.name,this.schema)};e.type===`mark`&&(sw(J(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=J(e,`onBeforeCreate`,t),r=J(e,`onCreate`,t),i=J(e,`onUpdate`,t),a=J(e,`onSelectionUpdate`,t),o=J(e,`onTransaction`,t),s=J(e,`onFocus`,t),c=J(e,`onBlur`,t),l=J(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};LT.resolve=Sw,LT.sort=xw,LT.flatten=iw,LS({},{ClipboardTextSerializer:()=>zT,Commands:()=>BT,Delete:()=>VT,Drop:()=>HT,Editable:()=>UT,FocusEvents:()=>GT,Keymap:()=>KT,Paste:()=>qT,Tabindex:()=>JT,TextDirection:()=>YT,focusEventsPluginKey:()=>WT});var RT=class e extends OT{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},zT=RT.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new f_({key:new h_(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=Ew(n);return ww(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),BT=RT.create({name:`commands`,addCommands(){return{...BS}}}),VT=RT.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=QC(e.before,[e,...t]);jw(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof gg){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),HT=RT.create({name:`drop`,addProseMirrorPlugins(){return[new f_({key:new h_(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),UT=RT.create({name:`editable`,addProseMirrorPlugins(){return[new f_({key:new h_(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),WT=new h_(`focusEvents`),GT=RT.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new f_({key:WT,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),KT=RT.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:G.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return fC()||jC()?i:r},addProseMirrorPlugins(){return[new f_({key:new h_(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=G.atStart(t.doc).from,l=G.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!Uw(n.doc))return;let u=n.tr,d=RS({state:n,transaction:u}),{commands:f}=new zS({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),qT=RT.create({name:`paste`,addProseMirrorPlugins(){return[new f_({key:new h_(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),JT=RT.create({name:`tabindex`,addProseMirrorPlugins(){return[new f_({key:new h_(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),YT=RT.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=lw(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new f_({key:new h_(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),XT=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},ZT=`.ProseMirror {
|
|
196
196
|
position: relative;
|
|
197
197
|
}
|
|
@@ -325,17 +325,17 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
325
325
|
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
|
|
326
326
|
`),[i,a]=Ere(r);if(i.length===0)return;let o=yA(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
|
|
327
327
|
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Ore,this.editor.getAttributes(bA)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=rE({find:xA,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=rE({find:xA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(bA)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),kre=/^\s*(\[([( |x])?\])\s$/,Are=SE.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,pw(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>_E(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=mw(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[rE({find:kre,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),jre=SE.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,pw(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
328
|
-
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=gE(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=gE(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});RT.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(oA.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(sA.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(_A.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(SA.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Are.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(jre.configure(this.options.taskList)),e}});var CA=` `,wA=`\xA0`,Mre=SE.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,pw(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===CA||n[0].text===CA||n[0].raw===wA||n[0].text===wA)&&r.length===1&&r[0].type===`text`&&(r[0].text===CA||r[0].text===wA)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?CA:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Nre=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Pre=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,TA=kT.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,pw(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[eE({find:Nre,type:this.type})]},addPasteRules(){return[wE({find:Pre,type:this.type})]}}),Fre=TA,Ire=SE.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),EA=kT.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,pw(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Lre=EA;function Rre(e={}){return new f_({view(t){return new zre(t,e)}})}var zre=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=Mg(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},DA=class e extends G{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):G.near(r)}content(){return W.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Bre(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Vre(e)||!Hre(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!q.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};DA.prototype.visible=!1,DA.findFrom=DA.findGapCursorFrom,G.jsonID(`gapcursor`,DA);var Bre=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return DA.valid(t)?new DA(t):G.near(t)}};function OA(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Vre(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||OA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Hre(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||OA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Ure(){return new f_({props:{decorations:qre,createSelectionBetween(e,t,n){return t.pos==n.pos&&DA.valid(n)?new DA(n):null},handleClick:Gre,handleKeyDown:Wre,handleDOMEvents:{beforeinput:Kre}}})}var Wre=FS({ArrowLeft:kA(`horiz`,-1),ArrowRight:kA(`horiz`,1),ArrowUp:kA(`vert`,-1),ArrowDown:kA(`vert`,1)});function kA(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof K){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=DA.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new DA(c))),!0):!1}}function Gre(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!DA.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&q.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new DA(r))),!0)}function Kre(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof DA))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=U.empty;for(let e=r.length-1;e>=0;e--)i=U.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new W(i,0,0));return a.setSelection(K.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function qre(e){if(!(e.selection instanceof DA))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Vx.create(e.doc,[Rx.widget(e.selection.head,t,{key:`gapcursor`})])}var AA=200,jA=function(){};jA.prototype.append=function(e){return e.length?(e=jA.from(e),!this.length&&e||e.length<AA&&this.leafAppend(e)||this.length<AA&&e.leafPrepend(this)||this.appendInner(e)):this},jA.prototype.prepend=function(e){return e.length?jA.from(e).append(this):this},jA.prototype.appendInner=function(e){return new Jre(this,e)},jA.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?jA.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},jA.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},jA.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},jA.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},jA.from=function(e){return e instanceof jA?e:e&&e.length?new MA(e):jA.empty};var MA=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=AA)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=AA)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(jA);jA.empty=new MA([]);var Jre=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(jA),Yre=500,NA=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new PA(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new PA(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new PA(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Zre&&(s=Xre(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new ug;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new PA(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new PA(i,o,l))}else r.push(new PA(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new PA(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>Yre&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new PA(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(jA.from(i.reverse()),a)}};NA.empty=new NA(jA.empty,0);function Xre(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var PA=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},FA=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Zre=20;function Qre(e,t,n,r){let i=n.getMeta(VA),a;if(i)return i.historyState;n.getMeta(tie)&&(e=new FA(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(VA))return o.getMeta(VA).redo?new FA(e.done.addTransform(n,void 0,r,BA(t)),e.undone,IA(n.mapping.maps),e.prevTime,e.prevComposition):new FA(e.done,e.undone.addTransform(n,void 0,r,BA(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!$re(n,e.prevRanges)),s=o?LA(e.prevRanges,n.mapping):IA(n.mapping.maps);return new FA(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,BA(t)),NA.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new FA(e.done.rebased(n,a),e.undone.rebased(n,a),LA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new FA(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),LA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function $re(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function IA(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function LA(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function eie(e,t,n){let r=BA(t),i=VA.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new FA(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(VA,{redo:n,historyState:c})}var RA=!1,zA=null;function BA(e){let t=e.plugins;if(zA!=t){RA=!1,zA=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){RA=!0;break}}return RA}var VA=new h_(`history`),tie=new h_(`closeHistory`);function HA(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new f_({key:VA,state:{init(){return new FA(NA.empty,NA.empty,null,0,-1)},apply(t,n,r){return Qre(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?WA:n==`historyRedo`?GA:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function UA(e,t){return(n,r)=>{let i=VA.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=eie(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var WA=UA(!1,!0),GA=UA(!0,!0);RT.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new f_({key:new h_(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var nie=RT.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Rre(this.options)]}});RT.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new f_({key:new h_(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return Vx.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Rx.node(t,t+e.nodeSize,{class:this.options.className}))}),Vx.create(e,a)}}})]}});var rie=RT.create({name:`gapCursor`,addProseMirrorPlugins(){return[Ure()]},extendNodeSchema(e){return{allowGapCursor:sw(J(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),KA=`placeholder`;function iie(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var aie=RT.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:KA,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${iie(this.options.dataAttribute)}`:`data-${KA}`;return[new f_({key:new h_(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&Uw(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=Rx.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),Vx.create(t,a)}}})]}});RT.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new f_({key:new h_(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||Ww(n.selection)||e.view.dragging?null:Vx.create(n.doc,[Rx.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function qA({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var JA=RT.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new h_(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new f_({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!qA({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!qA({node:r,types:n})}}})]}}),YA=RT.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>WA(e,t),redo:()=>({state:e,dispatch:t})=>GA(e,t)}},addProseMirrorPlugins(){return[HA(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),XA=RT.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(FE.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(tA.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(oA.configure(this.options.bulletList)),this.options.code!==!1&&e.push(nA.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(OE.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(yre.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(nie.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(rie.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(UE.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(GE.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(YA.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(rA.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(VE.configure(this.options.italic)),this.options.listItem!==!1&&e.push(sA.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(_A.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(nk.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(SA.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Mre.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(TA.configure(this.options.strike)),this.options.text!==!1&&e.push(Ire.configure(this.options.text)),this.options.underline!==!1&&e.push(EA.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(JA.configure(this.options?.trailingNode)),e}}),ZA={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},QA=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,$A=/-[a-z]/g,ej=/%c(?:([-+])(\d+))?/g,tj=/%x/g,nj={2:!0,1:!1,0:null},rj={};function ij(e,t){let n=t||rj,r=n.onerror,i=e instanceof _?e:new _(e),a=n.fragment?te:ne,o=String(i);return xe(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=aj(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=ZA[a],o=new k(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=nj[c],o.note=l(n.description),o.url=n.url===!1?void 0:QA+t,r(o)}function l(t){return t.replace(ej,n).replace(tj,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return sj(o.charAt(e.startOffset+i))}function r(){return cj(o.charCodeAt(e.startOffset))}}}}function aj(e){return e.replace($A,oj)}function oj(e){return e.charAt(1).toUpperCase()}function sj(e){return e==="`"?"` ` `":e}function cj(e){return`0x`+e.toString(16).toUpperCase()}function lj(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return ij(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var uj=(function(e,t,n,r,i){let a=dj(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return gj(e)?a.call(i,e,n,r):!1}),dj=(function(e){if(e==null)return hj;if(typeof e==`string`)return pj(e);if(typeof e==`object`)return fj(e);if(typeof e==`function`)return mj(e);throw Error("Expected function, string, or array as `test`")});function fj(e){let t=[],n=-1;for(;++n<e.length;)t[n]=dj(e[n]);return mj(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function pj(e){return mj(t);function t(t){return t.tagName===e}}function mj(e){return t;function t(t,n,r){return!!(gj(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function hj(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function gj(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var _j=dj(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`}),vj=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`),yj=[`button`,`input`,`select`,`textarea`],bj=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`],xj={},Sj=m([`comment`,`doctype`]);function Cj(e,t){wj(e,{collapse:Fj((t||xj).newlines?Nj:Pj),whitespace:`normal`})}function wj(e,t){if(`children`in e){let n={...t};return(e.type===`root`||Aj(e))&&(n.before=!0,n.after=!0),n.whitespace=Ij(e,t),Ej(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return Tj(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:Sj(e),stripAtStart:!1,remove:!1}}function Tj(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&Mj(n.charAt(0))&&i++,i!==a&&Mj(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function Ej(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=wj(i[o],{...t,after:Dj(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),kj(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function Dj(e,t,n){for(;++t<e.length;){let n=e[t],r=Oj(n);if(r===void 0&&`children`in n&&!jj(n)&&(r=Dj(n.children,-1)),typeof r==`boolean`)return r}return n}function Oj(e){if(e.type===`element`){if(kj(e))return!1;if(Aj(e))return!0}else if(e.type===`text`){if(!ke(e))return!1}else if(!Sj(e))return!1}function kj(e){return _j(e)||uj(e,yj)}function Aj(e){return uj(e,vj)}function jj(e){return!!(e.type===`element`&&e.properties.hidden)||Sj(e)||uj(e,bj)}function Mj(e){return e===` `||e===`
|
|
329
|
-
`}function Nj(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function Pj(){return` `}function Fj(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function Ij(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}function Lj(e){return function(t){Cj(t,e)}}function Rj(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}function zj(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}function Bj(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}function Vj(e,t){let n={type:`break`};return e.patch(t,n),n}var Hj=(function(e,t,n){let r=
|
|
328
|
+
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=gE(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=gE(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});RT.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(oA.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(sA.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(_A.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(SA.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Are.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(jre.configure(this.options.taskList)),e}});var CA=` `,wA=`\xA0`,Mre=SE.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,pw(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===CA||n[0].text===CA||n[0].raw===wA||n[0].text===wA)&&r.length===1&&r[0].type===`text`&&(r[0].text===CA||r[0].text===wA)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?CA:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Nre=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Pre=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,TA=kT.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,pw(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[eE({find:Nre,type:this.type})]},addPasteRules(){return[wE({find:Pre,type:this.type})]}}),Fre=TA,Ire=SE.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),EA=kT.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,pw(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Lre=EA;function Rre(e={}){return new f_({view(t){return new zre(t,e)}})}var zre=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=Mg(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},DA=class e extends G{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):G.near(r)}content(){return W.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Bre(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Vre(e)||!Hre(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!q.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};DA.prototype.visible=!1,DA.findFrom=DA.findGapCursorFrom,G.jsonID(`gapcursor`,DA);var Bre=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return DA.valid(t)?new DA(t):G.near(t)}};function OA(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Vre(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||OA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Hre(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||OA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Ure(){return new f_({props:{decorations:qre,createSelectionBetween(e,t,n){return t.pos==n.pos&&DA.valid(n)?new DA(n):null},handleClick:Gre,handleKeyDown:Wre,handleDOMEvents:{beforeinput:Kre}}})}var Wre=FS({ArrowLeft:kA(`horiz`,-1),ArrowRight:kA(`horiz`,1),ArrowUp:kA(`vert`,-1),ArrowDown:kA(`vert`,1)});function kA(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof K){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=DA.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new DA(c))),!0):!1}}function Gre(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!DA.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&q.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new DA(r))),!0)}function Kre(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof DA))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=U.empty;for(let e=r.length-1;e>=0;e--)i=U.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new W(i,0,0));return a.setSelection(K.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function qre(e){if(!(e.selection instanceof DA))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Vx.create(e.doc,[Rx.widget(e.selection.head,t,{key:`gapcursor`})])}var AA=200,jA=function(){};jA.prototype.append=function(e){return e.length?(e=jA.from(e),!this.length&&e||e.length<AA&&this.leafAppend(e)||this.length<AA&&e.leafPrepend(this)||this.appendInner(e)):this},jA.prototype.prepend=function(e){return e.length?jA.from(e).append(this):this},jA.prototype.appendInner=function(e){return new Jre(this,e)},jA.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?jA.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},jA.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},jA.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},jA.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},jA.from=function(e){return e instanceof jA?e:e&&e.length?new MA(e):jA.empty};var MA=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=AA)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=AA)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(jA);jA.empty=new MA([]);var Jre=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(jA),Yre=500,NA=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new PA(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new PA(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new PA(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Zre&&(s=Xre(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new ug;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new PA(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new PA(i,o,l))}else r.push(new PA(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new PA(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>Yre&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new PA(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(jA.from(i.reverse()),a)}};NA.empty=new NA(jA.empty,0);function Xre(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var PA=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},FA=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Zre=20;function Qre(e,t,n,r){let i=n.getMeta(VA),a;if(i)return i.historyState;n.getMeta(tie)&&(e=new FA(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(VA))return o.getMeta(VA).redo?new FA(e.done.addTransform(n,void 0,r,BA(t)),e.undone,IA(n.mapping.maps),e.prevTime,e.prevComposition):new FA(e.done,e.undone.addTransform(n,void 0,r,BA(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!$re(n,e.prevRanges)),s=o?LA(e.prevRanges,n.mapping):IA(n.mapping.maps);return new FA(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,BA(t)),NA.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new FA(e.done.rebased(n,a),e.undone.rebased(n,a),LA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new FA(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),LA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function $re(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function IA(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function LA(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function eie(e,t,n){let r=BA(t),i=VA.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new FA(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(VA,{redo:n,historyState:c})}var RA=!1,zA=null;function BA(e){let t=e.plugins;if(zA!=t){RA=!1,zA=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){RA=!0;break}}return RA}var VA=new h_(`history`),tie=new h_(`closeHistory`);function HA(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new f_({key:VA,state:{init(){return new FA(NA.empty,NA.empty,null,0,-1)},apply(t,n,r){return Qre(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?WA:n==`historyRedo`?GA:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function UA(e,t){return(n,r)=>{let i=VA.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=eie(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var WA=UA(!1,!0),GA=UA(!0,!0);RT.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new f_({key:new h_(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var nie=RT.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Rre(this.options)]}});RT.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new f_({key:new h_(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return Vx.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Rx.node(t,t+e.nodeSize,{class:this.options.className}))}),Vx.create(e,a)}}})]}});var rie=RT.create({name:`gapCursor`,addProseMirrorPlugins(){return[Ure()]},extendNodeSchema(e){return{allowGapCursor:sw(J(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),KA=`placeholder`;function iie(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var aie=RT.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:KA,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${iie(this.options.dataAttribute)}`:`data-${KA}`;return[new f_({key:new h_(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&Uw(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=Rx.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),Vx.create(t,a)}}})]}});RT.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new f_({key:new h_(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||Ww(n.selection)||e.view.dragging?null:Vx.create(n.doc,[Rx.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function qA({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var JA=RT.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new h_(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new f_({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!qA({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!qA({node:r,types:n})}}})]}}),YA=RT.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>WA(e,t),redo:()=>({state:e,dispatch:t})=>GA(e,t)}},addProseMirrorPlugins(){return[HA(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),XA=RT.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(FE.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(tA.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(oA.configure(this.options.bulletList)),this.options.code!==!1&&e.push(nA.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(OE.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(yre.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(nie.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(rie.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(UE.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(GE.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(YA.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(rA.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(VE.configure(this.options.italic)),this.options.listItem!==!1&&e.push(sA.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(_A.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(nk.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(SA.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Mre.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(TA.configure(this.options.strike)),this.options.text!==!1&&e.push(Ire.configure(this.options.text)),this.options.underline!==!1&&e.push(EA.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(JA.configure(this.options?.trailingNode)),e}}),ZA={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},QA=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,$A=/-[a-z]/g,ej=/%c(?:([-+])(\d+))?/g,tj=/%x/g,nj={2:!0,1:!1,0:null},rj={};function ij(e,t){let n=t||rj,r=n.onerror,i=e instanceof u?e:new u(e),a=n.fragment?y:O,o=String(i);return v(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=aj(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=ZA[a],o=new fe(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=nj[c],o.note=l(n.description),o.url=n.url===!1?void 0:QA+t,r(o)}function l(t){return t.replace(ej,n).replace(tj,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return sj(o.charAt(e.startOffset+i))}function r(){return cj(o.charCodeAt(e.startOffset))}}}}function aj(e){return e.replace($A,oj)}function oj(e){return e.charAt(1).toUpperCase()}function sj(e){return e==="`"?"` ` `":e}function cj(e){return`0x`+e.toString(16).toUpperCase()}function lj(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return ij(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var uj=(function(e,t,n,r,i){let a=dj(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return gj(e)?a.call(i,e,n,r):!1}),dj=(function(e){if(e==null)return hj;if(typeof e==`string`)return pj(e);if(typeof e==`object`)return fj(e);if(typeof e==`function`)return mj(e);throw Error("Expected function, string, or array as `test`")});function fj(e){let t=[],n=-1;for(;++n<e.length;)t[n]=dj(e[n]);return mj(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function pj(e){return mj(t);function t(t){return t.tagName===e}}function mj(e){return t;function t(t,n,r){return!!(gj(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function hj(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function gj(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var _j=dj(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`}),vj=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`),yj=[`button`,`input`,`select`,`textarea`],bj=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`],xj={},Sj=p([`comment`,`doctype`]);function Cj(e,t){wj(e,{collapse:Fj((t||xj).newlines?Nj:Pj),whitespace:`normal`})}function wj(e,t){if(`children`in e){let n={...t};return(e.type===`root`||Aj(e))&&(n.before=!0,n.after=!0),n.whitespace=Ij(e,t),Ej(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return Tj(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:Sj(e),stripAtStart:!1,remove:!1}}function Tj(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&Mj(n.charAt(0))&&i++,i!==a&&Mj(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function Ej(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=wj(i[o],{...t,after:Dj(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),kj(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function Dj(e,t,n){for(;++t<e.length;){let n=e[t],r=Oj(n);if(r===void 0&&`children`in n&&!jj(n)&&(r=Dj(n.children,-1)),typeof r==`boolean`)return r}return n}function Oj(e){if(e.type===`element`){if(kj(e))return!1;if(Aj(e))return!0}else if(e.type===`text`){if(!ke(e))return!1}else if(!Sj(e))return!1}function kj(e){return _j(e)||uj(e,yj)}function Aj(e){return uj(e,vj)}function jj(e){return!!(e.type===`element`&&e.properties.hidden)||Sj(e)||uj(e,bj)}function Mj(e){return e===` `||e===`
|
|
329
|
+
`}function Nj(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function Pj(){return` `}function Fj(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function Ij(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}function Lj(e){return function(t){Cj(t,e)}}function Rj(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}function zj(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}function Bj(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}function Vj(e,t){let n={type:`break`};return e.patch(t,n),n}var Hj=(function(e,t,n){let r=p(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Uj=/\n/g,Wj=/[\t ]+/g,Gj=dj(`br`),Kj=dj(aM),qj=dj(`p`),Jj=dj(`tr`),Yj=dj([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,iM,oM]),Xj=dj(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function Zj(e,t){let n=t||{},r=`children`in e?e.children:[],i=Xj(e),a=rM(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...eM(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...Qj(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?Gj(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
|
|
330
330
|
`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function Qj(e,t,n){return e.type===`element`?$j(e,t,n):e.type===`text`?n.whitespace===`normal`?eM(e,n):tM(e):[]}function $j(e,t,n){let r=rM(e,n),i=e.children||[],a=-1,o=[];if(Yj(e))return o;let s,c;for(Gj(e)||Jj(e)&&Hj(t,e,Jj)?c=`
|
|
331
|
-
`:qj(e)?(s=2,c=2):Xj(e)&&(s=1,c=1);++a<i.length;)o=o.concat(Qj(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?Gj(i[a+1]):c}));return Kj(e)&&Hj(t,e,Kj)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function eM(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){Uj.lastIndex=a;let e=Uj.exec(n),i=e&&`index`in e?e.index:n.length;r.push(nM(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function tM(e){return[String(e.value)]}function nM(e,t,n){let r=[],i=0,a;for(;i<e.length;){Wj.lastIndex=i;let n=Wj.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function rM(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function iM(e){return!!(e.properties||{}).hidden}function aM(e){return e.tagName===`td`||e.tagName===`th`}function oM(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function sM(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var cM=`language-`;function lM(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===cM){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:sM(Zj(t))};return e.patch(t,o),o}function uM(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}function dM(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}function fM(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}function pM(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[...mM(e,r[i].titles),...mM(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:fM(o),children:o};return e.patch(t,n),n}}function mM(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,hM);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:fM(r),children:r}]}function hM(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function gM(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}function _M(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}function vM(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:_M(e.all(t))};return e.patch(t,n),n}function yM(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}function bM(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}function xM(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}function SM(e,t){let n={type:`inlineCode`,value:Zj(t)};return e.patch(t,n),n}function CM(e,t){let n=[],r=[],i=t||e.properties||{},a=wM(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=Zj(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function wM(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...wM(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var TM=`[x]`,EM=`[ ]`;function DM(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||TM:e.options.unchecked||EM};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=CM(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var OM={}.hasOwnProperty;function kM(e,t){let n=e.type===`element`&&OM.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var AM=new Set([`pingback`,`prefetch`,`stylesheet`]);function jM(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!AM.has(String(t[n])))return!1;return!0}var MM=dj(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),NM=dj(`meta`);function PM(e){return!!(e.type===`text`||MM(e)||_j(e)||jM(e)||NM(e)&&kM(e,`itemProp`))}function FM(e,t){let{rest:n,checkbox:r}=LM(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:IM(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function IM(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(PM(r))continue;if(r.tagName===`p`||n||IM(r))return!0;n=!0}}return!1}function LM(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=LM(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}function RM(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),zM),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:fM(r),children:r};return e.patch(t,a),a}function zM(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function BM(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!GM(n)||`children`in n&&BM(n.children))return!0}return!1}function VM(e){return UM(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?ke(e.value):!1})?[]:[{type:`paragraph`,children:_M(e)}]}}function HM(e){return UM(e.children,t,n);function t(t){let n=KM(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=KM(e),r=KM(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function UM(e,t,n){let r=WM(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];GM(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function WM(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&BM(r.children)?t.push(...HM(r)):t.push(r)}return t}function GM(e){let t=e.data&&e.data.hName;return t?PM({type:`element`,tagName:t,properties:{},children:[]}):y(e)}function KM(e){return ve({...e,children:[]})}function qM(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(h({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||BM(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:w(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}function JM(e,t){let n=_M(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var YM=[`"`];function XM(e,t){let n=e.options.quotes||YM;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}function ZM(e,t){let n=e.all(t);(e.options.document||BM(n))&&(n=VM(n));let r={type:`root`,children:n};return e.patch(t,r),r}function QM(e,t){let n=CM(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}function $M(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}function eN(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}function tN(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),nN)};return e.patch(t,n),n}function nN(){return{type:`tableCell`,children:[]}}function rN(e,t){if(e.inTable){let n={type:`text`,value:Zj(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=iN(t),i=e.toSpecificContent(e.all(t),oN);r&&i.unshift(oN());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,aN)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function iN(e){let t={align:[null],headless:!0},n=0,r=0;return h(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return D;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function aN(){return{type:`tableCell`,children:[]}}function oN(){return{type:`tableRow`,children:[]}}function sN(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}function cN(e,t){let n={type:`text`,value:Zj(t)};return e.patch(t,n),n}function lN(e,t){let n={type:`text`,value:``};return e.patch(t,n),n}var uN={comment:uM,doctype:mN,root:ZM,text:sN},dN={applet:mN,area:mN,basefont:mN,bgsound:mN,caption:mN,col:mN,colgroup:mN,command:mN,content:mN,datalist:mN,dialog:mN,element:mN,embed:mN,frame:mN,frameset:mN,isindex:mN,keygen:mN,link:mN,math:mN,menu:mN,menuitem:mN,meta:mN,nextid:mN,noembed:mN,noframes:mN,optgroup:mN,option:mN,param:mN,script:mN,shadow:mN,source:mN,spacer:mN,style:mN,svg:mN,template:mN,title:mN,track:mN,abbr:fN,acronym:fN,bdi:fN,bdo:fN,big:fN,blink:fN,button:fN,canvas:fN,cite:fN,data:fN,details:fN,dfn:fN,font:fN,ins:fN,label:fN,map:fN,marquee:fN,meter:fN,nobr:fN,noscript:fN,object:fN,output:fN,progress:fN,rb:fN,rbc:fN,rp:fN,rt:fN,rtc:fN,ruby:fN,slot:fN,small:fN,span:fN,sup:fN,sub:fN,tbody:fN,tfoot:fN,thead:fN,time:fN,address:pN,article:pN,aside:pN,body:pN,center:pN,div:pN,fieldset:pN,figcaption:pN,figure:pN,form:pN,footer:pN,header:pN,hgroup:pN,html:pN,legend:pN,main:pN,multicol:pN,nav:pN,picture:pN,section:pN,a:Rj,audio:qM,b:$M,base:zj,blockquote:Bj,br:Vj,code:SM,dir:RM,dl:pM,dt:FM,dd:FM,del:dM,em:gM,h1:vM,h2:vM,h3:vM,h4:vM,h5:vM,h6:vM,hr:yM,i:gM,iframe:bM,img:xM,image:xM,input:DM,kbd:SM,li:FM,listing:lM,mark:gM,ol:RM,p:JM,plaintext:lM,pre:lM,q:XM,s:dM,samp:SM,select:QM,strike:dM,strong:$M,summary:JM,table:rN,td:eN,textarea:cN,th:eN,tr:tN,tt:SM,u:gM,ul:RM,var:SM,video:qM,wbr:lN,xmp:lM};function fN(e,t){return e.all(t)}function pN(e,t){return e.toFlow(e.all(t))}function mN(){}var hN={}.hasOwnProperty;function gN(e){return{all:_N,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...dN,...e.handlers},inTable:!1,nodeHandlers:{...uN,...e.nodeHandlers},one:vN,options:e,patch:yN,qNesting:0,resolve:bN,toFlow:xN,toSpecificContent:SN}}function _N(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function vN(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if(hN.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if(hN.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function yN(e,t){e.position&&(t.position=ee(e))}function bN(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function xN(e){return VM(e)}function SN(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var CN={};function wN(e,t){let n=ve(e),r=t||CN,i=Lj({newlines:r.newlines===!0}),a=gN(r),o;i(n),h(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},h(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var TN={document:!0};function EN(e,t){return e&&`run`in e?async function(n,r){let i=wN(n,{...TN,...t});await e.run(i,r)}:function(t){return wN(t,{...TN,...e})}}var DN={}.hasOwnProperty;function ON(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)ON(e,t.extensions[n]);for(r in t)if(DN.call(t,r))switch(r){case`extensions`:break;case`unsafe`:kN(e[r],t[r]);break;case`join`:kN(e[r],t[r]);break;case`handlers`:AN(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function kN(e,t){t&&e.push(...t)}function AN(e,t){t&&Object.assign(e,t)}var jN=[MN];function MN(e,t,n,r){if(t.type===`code`&&S(t,r)&&(e.type===`list`||e.type===t.type&&S(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&E(t,r))?void 0:+!!n.spread}var NN=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],PN=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
|
|
331
|
+
`:qj(e)?(s=2,c=2):Xj(e)&&(s=1,c=1);++a<i.length;)o=o.concat(Qj(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?Gj(i[a+1]):c}));return Kj(e)&&Hj(t,e,Kj)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function eM(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){Uj.lastIndex=a;let e=Uj.exec(n),i=e&&`index`in e?e.index:n.length;r.push(nM(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function tM(e){return[String(e.value)]}function nM(e,t,n){let r=[],i=0,a;for(;i<e.length;){Wj.lastIndex=i;let n=Wj.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function rM(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function iM(e){return!!(e.properties||{}).hidden}function aM(e){return e.tagName===`td`||e.tagName===`th`}function oM(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function sM(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var cM=`language-`;function lM(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===cM){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:sM(Zj(t))};return e.patch(t,o),o}function uM(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}function dM(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}function fM(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}function pM(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[...mM(e,r[i].titles),...mM(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:fM(o),children:o};return e.patch(t,n),n}}function mM(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,hM);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:fM(r),children:r}]}function hM(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function gM(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}function _M(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}function vM(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:_M(e.all(t))};return e.patch(t,n),n}function yM(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}function bM(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}function xM(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}function SM(e,t){let n={type:`inlineCode`,value:Zj(t)};return e.patch(t,n),n}function CM(e,t){let n=[],r=[],i=t||e.properties||{},a=wM(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=Zj(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function wM(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...wM(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var TM=`[x]`,EM=`[ ]`;function DM(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||TM:e.options.unchecked||EM};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=CM(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var OM={}.hasOwnProperty;function kM(e,t){let n=e.type===`element`&&OM.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var AM=new Set([`pingback`,`prefetch`,`stylesheet`]);function jM(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!AM.has(String(t[n])))return!1;return!0}var MM=dj(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),NM=dj(`meta`);function PM(e){return!!(e.type===`text`||MM(e)||_j(e)||jM(e)||NM(e)&&kM(e,`itemProp`))}function FM(e,t){let{rest:n,checkbox:r}=LM(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:IM(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function IM(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(PM(r))continue;if(r.tagName===`p`||n||IM(r))return!0;n=!0}}return!1}function LM(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=LM(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}function RM(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),zM),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:fM(r),children:r};return e.patch(t,a),a}function zM(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function BM(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!GM(n)||`children`in n&&BM(n.children))return!0}return!1}function VM(e){return UM(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?ke(e.value):!1})?[]:[{type:`paragraph`,children:_M(e)}]}}function HM(e){return UM(e.children,t,n);function t(t){let n=KM(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=KM(e),r=KM(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function UM(e,t,n){let r=WM(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];GM(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function WM(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&BM(r.children)?t.push(...HM(r)):t.push(r)}return t}function GM(e){let t=e.data&&e.data.hName;return t?PM({type:`element`,tagName:t,properties:{},children:[]}):ae(e)}function KM(e){return k({...e,children:[]})}function qM(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(Te({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||BM(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:be(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}function JM(e,t){let n=_M(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var YM=[`"`];function XM(e,t){let n=e.options.quotes||YM;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}function ZM(e,t){let n=e.all(t);(e.options.document||BM(n))&&(n=VM(n));let r={type:`root`,children:n};return e.patch(t,r),r}function QM(e,t){let n=CM(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}function $M(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}function eN(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}function tN(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),nN)};return e.patch(t,n),n}function nN(){return{type:`tableCell`,children:[]}}function rN(e,t){if(e.inTable){let n={type:`text`,value:Zj(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=iN(t),i=e.toSpecificContent(e.all(t),oN);r&&i.unshift(oN());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,aN)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function iN(e){let t={align:[null],headless:!0},n=0,r=0;return Te(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return S;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function aN(){return{type:`tableCell`,children:[]}}function oN(){return{type:`tableRow`,children:[]}}function sN(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}function cN(e,t){let n={type:`text`,value:Zj(t)};return e.patch(t,n),n}function lN(e,t){let n={type:`text`,value:``};return e.patch(t,n),n}var uN={comment:uM,doctype:mN,root:ZM,text:sN},dN={applet:mN,area:mN,basefont:mN,bgsound:mN,caption:mN,col:mN,colgroup:mN,command:mN,content:mN,datalist:mN,dialog:mN,element:mN,embed:mN,frame:mN,frameset:mN,isindex:mN,keygen:mN,link:mN,math:mN,menu:mN,menuitem:mN,meta:mN,nextid:mN,noembed:mN,noframes:mN,optgroup:mN,option:mN,param:mN,script:mN,shadow:mN,source:mN,spacer:mN,style:mN,svg:mN,template:mN,title:mN,track:mN,abbr:fN,acronym:fN,bdi:fN,bdo:fN,big:fN,blink:fN,button:fN,canvas:fN,cite:fN,data:fN,details:fN,dfn:fN,font:fN,ins:fN,label:fN,map:fN,marquee:fN,meter:fN,nobr:fN,noscript:fN,object:fN,output:fN,progress:fN,rb:fN,rbc:fN,rp:fN,rt:fN,rtc:fN,ruby:fN,slot:fN,small:fN,span:fN,sup:fN,sub:fN,tbody:fN,tfoot:fN,thead:fN,time:fN,address:pN,article:pN,aside:pN,body:pN,center:pN,div:pN,fieldset:pN,figcaption:pN,figure:pN,form:pN,footer:pN,header:pN,hgroup:pN,html:pN,legend:pN,main:pN,multicol:pN,nav:pN,picture:pN,section:pN,a:Rj,audio:qM,b:$M,base:zj,blockquote:Bj,br:Vj,code:SM,dir:RM,dl:pM,dt:FM,dd:FM,del:dM,em:gM,h1:vM,h2:vM,h3:vM,h4:vM,h5:vM,h6:vM,hr:yM,i:gM,iframe:bM,img:xM,image:xM,input:DM,kbd:SM,li:FM,listing:lM,mark:gM,ol:RM,p:JM,plaintext:lM,pre:lM,q:XM,s:dM,samp:SM,select:QM,strike:dM,strong:$M,summary:JM,table:rN,td:eN,textarea:cN,th:eN,tr:tN,tt:SM,u:gM,ul:RM,var:SM,video:qM,wbr:lN,xmp:lM};function fN(e,t){return e.all(t)}function pN(e,t){return e.toFlow(e.all(t))}function mN(){}var hN={}.hasOwnProperty;function gN(e){return{all:_N,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...dN,...e.handlers},inTable:!1,nodeHandlers:{...uN,...e.nodeHandlers},one:vN,options:e,patch:yN,qNesting:0,resolve:bN,toFlow:xN,toSpecificContent:SN}}function _N(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function vN(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if(hN.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if(hN.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function yN(e,t){e.position&&(t.position=f(e))}function bN(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function xN(e){return VM(e)}function SN(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var CN={};function wN(e,t){let n=k(e),r=t||CN,i=Lj({newlines:r.newlines===!0}),a=gN(r),o;i(n),Te(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},Te(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var TN={document:!0};function EN(e,t){return e&&`run`in e?async function(n,r){let i=wN(n,{...TN,...t});await e.run(i,r)}:function(t){return wN(t,{...TN,...e})}}var DN={}.hasOwnProperty;function ON(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)ON(e,t.extensions[n]);for(r in t)if(DN.call(t,r))switch(r){case`extensions`:break;case`unsafe`:kN(e[r],t[r]);break;case`join`:kN(e[r],t[r]);break;case`handlers`:AN(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function kN(e,t){t&&e.push(...t)}function AN(e,t){t&&Object.assign(e,t)}var jN=[MN];function MN(e,t,n,r){if(t.type===`code`&&D(t,r)&&(e.type===`list`||e.type===t.type&&D(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&me(t,r))?void 0:+!!n.spread}var NN=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],PN=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
|
|
332
332
|
`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:NN},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
|
|
333
333
|
]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:NN},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
|
|
334
334
|
*])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:NN},{atBreak:!0,character:`+`,after:`(?:[ \r
|
|
335
335
|
])`},{atBreak:!0,character:`-`,after:`(?:[ \r
|
|
336
336
|
-])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
|
|
337
|
-
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:NN},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:NN},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:NN},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:NN},{atBreak:!0,character:`~`}];function FN(e){return e.label||!e.identifier?e.label||``:
|
|
338
|
-
`)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let
|
|
337
|
+
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:NN},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:NN},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:NN},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:NN},{atBreak:!0,character:`~`}];function FN(e){return e.label||!e.identifier?e.label||``:d(e.identifier)}function IN(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function LN(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
|
|
338
|
+
`)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=ue(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+ue(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function RN(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
|
|
339
339
|
`,after:`
|
|
340
340
|
`,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(zN(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function zN(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
|
|
341
341
|
`.repeat(1+a);if(a===!1)return`
|
|
@@ -344,16 +344,16 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
344
344
|
|
|
345
345
|
`}return`
|
|
346
346
|
|
|
347
|
-
`}var BN=/\r?\n|\r/g;function VN(e,t){let n=[],r=0,i=0,a;for(;a=BN.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function HN(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!
|
|
347
|
+
`}var BN=/\r?\n|\r/g;function VN(e,t){let n=[],r=0,i=0,a;for(;a=BN.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function HN(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!we(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(UN);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(WN(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(ue(r.charCodeAt(e))),c++))}return a.push(WN(r.slice(c,l),n.after)),a.join(``)}function UN(e,t){return e-t}function WN(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function GN(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function KN(e,t){let n=t||{},r={associationId:FN,containerPhrasing:XN,containerFlow:ZN,createTracker:GN,compilePattern:IN,enter:a,handlers:{...ve},handle:void 0,indentLines:VN,indexStack:[],join:[...jN],options:{},safe:QN,stack:[],unsafe:[...PN]};ON(r,n),r.options.tightDefinitions&&r.join.push(YN),r.handle=Ae(`type`,{invalid:qN,unknown:JN,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
348
348
|
`,after:`
|
|
349
349
|
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
350
|
-
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function qN(e){throw Error("Cannot handle value `"+e+"`, expected node")}function JN(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function YN(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function XN(e,t){return LN(e,this,t)}function ZN(e,t){return RN(e,this,t)}function QN(e,t){return HN(this,e,t)}function $N(e){let t=this;t.compiler=n;function n(n){return KN(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function eP(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return
|
|
350
|
+
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function qN(e){throw Error("Cannot handle value `"+e+"`, expected node")}function JN(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function YN(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function XN(e,t){return LN(e,this,t)}function ZN(e,t){return RN(e,this,t)}function QN(e,t){return HN(this,e,t)}function $N(e){let t=this;t.compiler=n;function n(n){return KN(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function eP(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return Te(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return cP(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){let t=i?r[i-1]:void 0;if(t?.type===`break`&&t.data?.sourceStyle!==`html`){if(!Array.isArray(a)&&a.type===e.nodes.text){let t=iP(a.text);a=t.length>0?e.text(t):void 0}else if(!Array.isArray(a)&&a.type!==e.nodes.text){let t=a.firstChild;if(t&&t.type===e.nodes.text){let n=iP(t.text),r=U.from(a.content);a=a.copy(n.length>0?r.replaceChild(0,e.text(n)):r.cut(t.nodeSize))}}}}a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}}function tP(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function nP(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(U.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(U.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function rP(e){throw Error(`unknown markdown node: ${e.type}`)}function iP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function aP(){}function oP(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function sP(e,t,n,r){return Ae(`tagName`,{handlers:e})(t,n,r)}function cP(e,t,n,r,i,a){return Ae(`type`,{invalid:oP,unknown:rP,handlers:{toml:aP,yaml:aP,definition:aP,footnoteDefinition:aP,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=ij(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?sP(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=tP(_e(String(t.value)));return n?e.text(n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return nP(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function lP(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function uP(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}var dP=function(e,t){let n=cP(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,eP(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},fP=function(e){this.compiler=function(t){return dP(t,e)}};function pP(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>b(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){console.warn(`[mdast-util-from-prosemirror] degenerate mark partition; falling back to per-span rendering`,{spanCount:e.length,firstSpanMarks:e[0]?.marks.map(e=>e.type.name),lastSpanMarks:e[e.length-1]?.marks.map(e=>e.type.name)});let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function mP(e,t){return pP(t.nodeHandlers,t.markHandlers).one(e)}function hP(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function gP(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}var _P=r(a(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1),vP=Object.assign(yP(Error),{eval:yP(EvalError),range:yP(RangeError),reference:yP(ReferenceError),syntax:yP(SyntaxError),type:yP(TypeError),uri:yP(URIError)});function yP(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,_P.default)(t,...n))}}var bP={}.hasOwnProperty,xP={yaml:`-`,toml:`+`};function SP(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=CP(r[n]);return t}function CP(e){let t=e;if(typeof t==`string`){if(!bP.call(xP,t))throw vP("Missing matter definition for `%s`",t);t={type:t,marker:xP[t]}}else if(typeof t!=`object`)throw vP("Expected matter to be an object, not `%j`",t);if(!bP.call(t,`type`))throw vP("Missing `type` in matter `%j`",t);if(!bP.call(t,`fence`)&&!bP.call(t,`marker`))throw vP("Missing `marker` or `fence` in matter `%j`",t);return t}function wP(e){let t=SP(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=EP(e,`open`).charCodeAt(0),a=TP(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function TP(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=EP(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),te(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return te(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return E(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=EP(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||E(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||E(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),te(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return te(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||E(i)?(e.exit(r),t(i)):n(i)}}}function EP(e,t){return e.marker?DP(e.marker,t).repeat(3):DP(e.fence,t)}function DP(e,t){return typeof e==`string`?e:e[t]}function OP(e){let t=SP(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=kP(e),r[e.type]=AP,r[e.type+`Value`]=jP}return{enter:n,exit:r}}function kP(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function AP(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function jP(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function MP(e){let t=[],n={},r=SP(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=NP(e);let a=PP(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:Ee(a.charAt(1))})}return{unsafe:t,handlers:n}}function NP(e){let t=PP(e,`open`),n=PP(e,`close`);return r;function r(e){return t+(e.value?`
|
|
351
351
|
`+e.value:``)+`
|
|
352
|
-
`+n}}function PP(e,t){return e.marker?FP(e.marker,t).repeat(3):FP(e.fence,t)}function FP(e,t){return typeof e==`string`?e:e[t]}var IP=`yaml`;function LP(e){let t=this,n=e||IP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(wP(n)),a.push(OP(n)),o.push(MP(n))}function RP(e){return e.charAt(0).toUpperCase()+e.slice(1)}var zP={note:`<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`,tip:`<svg class="octicon octicon-light-bulb mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>`,important:`<svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,warning:`<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,caution:`<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`};function BP(e){return e.replace(`<svg`,~e.indexOf(`xmlns`)?`<svg`:`<svg xmlns="http://www.w3.org/2000/svg"`).replaceAll(`"`,`'`).replaceAll(`%`,`%25`).replaceAll(`#`,`%23`).replaceAll(`{`,`%7B`).replaceAll(`}`,`%7D`).replaceAll(`<`,`%3C`).replaceAll(`>`,`%3E`)}var VP=(e={})=>{let{markers:t=[`TIP`,`NOTE`,`IMPORTANT`,`WARNING`,`CAUTION`],icons:n=zP,matchCaseSensitive:r=!1,titles:i={},classPrefix:a=`markdown-alert`,ignoreSquareBracket:o=!1}=e,s=t===`*`?`\\w+`:t.join(`|`),c=RegExp(o?`^!(${s})([^\\n\\r]*)`:`^\\[\\!(${s})\\]([^\\n\\r]*)`,r?``:`i`);return e=>(
|
|
353
|
-
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(
|
|
352
|
+
`+n}}function PP(e,t){return e.marker?FP(e.marker,t).repeat(3):FP(e.fence,t)}function FP(e,t){return typeof e==`string`?e:e[t]}var IP=`yaml`;function LP(e){let t=this,n=e||IP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(wP(n)),a.push(OP(n)),o.push(MP(n))}function RP(e){return e.charAt(0).toUpperCase()+e.slice(1)}var zP={note:`<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`,tip:`<svg class="octicon octicon-light-bulb mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>`,important:`<svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,warning:`<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,caution:`<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`};function BP(e){return e.replace(`<svg`,~e.indexOf(`xmlns`)?`<svg`:`<svg xmlns="http://www.w3.org/2000/svg"`).replaceAll(`"`,`'`).replaceAll(`%`,`%25`).replaceAll(`#`,`%23`).replaceAll(`{`,`%7B`).replaceAll(`}`,`%7D`).replaceAll(`<`,`%3C`).replaceAll(`>`,`%3E`)}var VP=(e={})=>{let{markers:t=[`TIP`,`NOTE`,`IMPORTANT`,`WARNING`,`CAUTION`],icons:n=zP,matchCaseSensitive:r=!1,titles:i={},classPrefix:a=`markdown-alert`,ignoreSquareBracket:o=!1}=e,s=t===`*`?`\\w+`:t.join(`|`),c=RegExp(o?`^!(${s})([^\\n\\r]*)`:`^\\[\\!(${s})\\]([^\\n\\r]*)`,r?``:`i`);return e=>(Te(e,`blockquote`,(e,t,r)=>{let o=e.children[0];if(!o)return;let s=o.children?.[0];if(!s||(!(`value`in s)&&`children`in s&&s.children[0]&&(s=s.children[0]),s.type!==`text`))return;let l=s.value.match(c);if(!l)return;let u=l[1]?.toLowerCase(),d=l[2]?.trim()||(i[u]??RP(u)),f=n[u],p=`data:image/svg+xml;utf8,${BP(f)}`;t===void 0||!r||(s.value=s.value.slice(l[0].length).trimStart(),e.data={hName:`div`,hProperties:{class:`${a} ${a}-${u}`}},e.children=[{type:`paragraph`,data:{hName:`p`,hProperties:{class:`${a}-title`}},children:[{type:`span`,data:{hName:`span`,hProperties:{class:`octicon octicon-${u}`,style:`--oct-icon: url("${p}")`}}},{type:`text`,value:d}]},...e.children])}),e)};function HP(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function UP(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
|
|
353
|
+
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(ne(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
|
|
354
354
|
`,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
|
|
355
355
|
`),i&&(c+=a.move(i+`
|
|
356
|
-
`)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var WP={tokenize:KP,concrete:!0,name:`mathFlow`},GP={tokenize:qP,partial:!0};function KP(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),re(e,l,`whitespace`)(t))}function l(t){return t===null||b(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||b(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(GP,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?re(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):b(t)?e.attempt(GP,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||b(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return re(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),re(e,c,`whitespace`)(t))}function c(r){return r===null||b(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function qP(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function JP(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:YP,previous:XP,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):b(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||b(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function YP(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function XP(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function ZP(e){return{flow:{36:WP},text:{36:JP(e)}}}var QP={};function $P(e){let t=this,n=e||QP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ZP(n)),a.push(HP()),o.push(UP(n))}function eF(){return{enter:{mdxFlowExpression:nF,mdxTextExpression:rF},exit:{mdxFlowExpression:iF,mdxFlowExpressionChunk:aF,mdxTextExpression:iF,mdxTextExpressionChunk:aF}}}function tF(){return{handlers:{mdxFlowExpression:oF,mdxTextExpression:oF},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function nF(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function rF(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function iF(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function aF(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function oF(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}var sF={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function cF(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function lF(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function uF(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function dF(e){return uF(e)||cF(e)}var fF=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function pF(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let d=(c?c.line:0)||1,f=(c?c.column:0)||1,p=h(),m;for(a--;++a<=e.length;)if(m===10&&(f=(l?l[o]:0)||1),m=e.charCodeAt(a),m===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(m),f++;continue}let o=a+1,c=o,l=o,d;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(d=`hexadecimal`,l=++c):d=`decimal`}else d=`named`;let v=``,y=``,b=``,x=d===`named`?dF:d===`decimal`?cF:lF;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!x(t))break;b+=String.fromCharCode(t),d===`named`&&Ne.includes(b)&&(v=b,y=u(b))}let S=e.charCodeAt(l)===59;if(S){l++;let e=d===`named`?u(b):!1;e&&(v=b,y=e)}let C=1+l-o,w=``;if(!(!S&&n.nonTerminated===!1))if(!b)d!==`named`&&g(4,C);else if(d===`named`){if(S&&!y)g(5,1);else if(v!==b&&(l=c+v.length,C=1+l-c,S=!1),!S){let t=v?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(g(t,C),y=``):dF(n)?y=``:g(t,C)}else g(t,C)}w=y}else{S||g(2,C);let e=Number.parseInt(b,d===`hexadecimal`?16:10);if(mF(e))g(7,C),w=`�`;else if(e in sF)g(6,C),w=sF[e];else{let t=``;hF(e)&&g(6,C),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),w=t+String.fromCharCode(e)}}if(w){_(),p=h(),a=l-1,f+=l-o+1,i.push(w);let t=h();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,w,{start:p,end:t},e.slice(o-1,l)),p=t}else b=e.slice(o-1,l),s+=b,f+=b.length,a=l-1}else m===10&&(d++,o++,f=0),Number.isNaN(m)?_():(s+=String.fromCharCode(m),f++);return i.join(``);function h(){return{line:d,column:f,offset:a+((c?c.offset:0)||0)}}function g(e,t){let r;n.warning&&(r=h(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,fF[e],r,e))}function _(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:p,end:h()}),``)}}function mF(e){return e>=55296&&e<=57343||e>1114111}function hF(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var gF=` `;function _F(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new k("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new k(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new k("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=pF(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new k("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+ae(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new k("Expected a closing tag for `"+S(r)+"` ("+ae({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new k("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+ae(t.end)+") or another opening tag after the start of `"+t.type+"` ("+ae(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function vF(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=SF,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=xF(bF(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&je(e,n)>je(e,o)?o:n;s=t+Me(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+gF+m[e];b+=y.move(`
|
|
356
|
+
`)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var WP={tokenize:KP,concrete:!0,name:`mathFlow`},GP={tokenize:qP,partial:!0};function KP(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),ye(e,l,`whitespace`)(t))}function l(t){return t===null||E(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||E(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(GP,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?ye(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):E(t)?e.attempt(GP,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||E(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return ye(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),ye(e,c,`whitespace`)(t))}function c(r){return r===null||E(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function qP(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function JP(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:YP,previous:XP,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):E(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||E(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function YP(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function XP(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function ZP(e){return{flow:{36:WP},text:{36:JP(e)}}}var QP={};function $P(e){let t=this,n=e||QP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ZP(n)),a.push(HP()),o.push(UP(n))}function eF(){return{enter:{mdxFlowExpression:nF,mdxTextExpression:rF},exit:{mdxFlowExpression:iF,mdxFlowExpressionChunk:aF,mdxTextExpression:iF,mdxTextExpressionChunk:aF}}}function tF(){return{handlers:{mdxFlowExpression:oF,mdxTextExpression:oF},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function nF(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function rF(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function iF(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function aF(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function oF(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}var sF={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function cF(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function lF(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function uF(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function dF(e){return uF(e)||cF(e)}var fF=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function pF(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?dF:u===`decimal`?cF:lF;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Ne.includes(y)&&(_=y,v=ge(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?ge(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):dF(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(mF(e))h(7,S),C=`�`;else if(e in sF)h(6,S),C=sF[e];else{let t=``;hF(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,fF[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function mF(e){return e>=55296&&e<=57343||e>1114111}function hF(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var gF=` `;function _F(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new fe("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new fe(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new fe("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=pF(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new fe("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+ie(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new fe("Expected a closing tag for `"+S(r)+"` ("+ie({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new fe("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+ie(t.end)+") or another opening tag after the start of `"+t.type+"` ("+ie(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function vF(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=SF,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=xF(bF(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&je(e,n)>je(e,o)?o:n;s=t+Me(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+gF+m[e];b+=y.move(`
|
|
357
357
|
`+m.join(`
|
|
358
358
|
`)+`
|
|
359
359
|
`+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
|
|
@@ -362,29 +362,29 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
362
362
|
`,after:`
|
|
363
363
|
`,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
|
|
364
364
|
|
|
365
|
-
`))}return r.pop(),s.join(``)}function bF(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function xF(e){return gF.repeat(e)}function SF(){return`<`}function CF(){return{enter:{mdxjsEsm:TF},exit:{mdxjsEsm:EF,mdxjsEsmData:DF}}}function wF(){return{handlers:{mdxjsEsm:OF}}}function TF(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function EF(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function DF(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function OF(e){return e.value||``}function kF(){return[eF(),_F(),CF()]}function AF(e){return{extensions:[tF(),vF(e),wF()]}}function jF(e){return e}var MF={}.hasOwnProperty,NF=Symbol(`continue`),PF=Symbol(`exit`),FF=Symbol(`skip`);function IF(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return RF(e)&&(s.displayName=`node (`+jF(e.type)+`)`),s;function s(){let s=n?LF(n(e,t,a,o)):[];if(s[0]===PF)return s;if(s[0]!==FF){let t;for(t in e)if(MF.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(RF(r)){let e=i(r,t,a,n)();if(e[0]===PF)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(RF(r)){let e=i(r,t,void 0,n)();if(e[0]===PF)return e}}}return r?LF(r(e,t,a,o)):s}}}function LF(e){return Array.isArray(e)?e:typeof e==`number`?[NF,e]:[e]}function RF(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function zF(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=VF(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&BF(m);if(g&&!t.allowEmpty)throw new
|
|
365
|
+
`))}return r.pop(),s.join(``)}function bF(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function xF(e){return gF.repeat(e)}function SF(){return`<`}function CF(){return{enter:{mdxjsEsm:TF},exit:{mdxjsEsm:EF,mdxjsEsmData:DF}}}function wF(){return{handlers:{mdxjsEsm:OF}}}function TF(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function EF(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function DF(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function OF(e){return e.value||``}function kF(){return[eF(),_F(),CF()]}function AF(e){return{extensions:[tF(),vF(e),wF()]}}function jF(e){return e}var MF={}.hasOwnProperty,NF=Symbol(`continue`),PF=Symbol(`exit`),FF=Symbol(`skip`);function IF(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return RF(e)&&(s.displayName=`node (`+jF(e.type)+`)`),s;function s(){let s=n?LF(n(e,t,a,o)):[];if(s[0]===PF)return s;if(s[0]!==FF){let t;for(t in e)if(MF.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(RF(r)){let e=i(r,t,a,n)();if(e[0]===PF)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(RF(r)){let e=i(r,t,void 0,n)();if(e[0]===PF)return e}}}return r?LF(r(e,t,a,o)):s}}}function LF(e){return Array.isArray(e)?e:typeof e==`number`?[NF,e]:[e]}function RF(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function zF(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=VF(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&BF(m);if(g&&!t.allowEmpty)throw new fe(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(BF(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,IF(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=HF(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function BF(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function VF(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=UF(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function HF(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function UF(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
|
|
366
366
|
`;break;case-3:a=`\r
|
|
367
|
-
`;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function WF(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=GF(n.start,r[0]||t.start),a=GF(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function GF(e,t){if(e&&typeof e==`object`){let n=`line`in e?KF(e.line):void 0,r=`column`in e?KF(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:KF(t)}}}function KF(e){return typeof e==`number`&&e>-1?e:void 0}var qF=2,JF=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,YF=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,XF=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,ZF=`#unexpected-type-in-code-expected-an-object-spread-spread`,QF=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,$F=`#could-not-parse-expression-with-acorn`;function eI(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new k("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=JF+YF,e}if(b(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?tI.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||b(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new k("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=JF+XF,e}return C(t)?re(e,_,`linePrefix`,qF+1)(t):_(t)}}function tI(e,t,n,r,i,a,o){let s=zF(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=WF(e),n=new k("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=JF+ZF,n}if(e.expression.properties[1]){let t=new k(`Unexpected extra content in spread: only a single spread is supported`,{place:WF(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=JF+QF,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=WF(e.expression.properties[0]),n=new k("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=JF+ZF,n}}if(s.error){let e=new k(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=JF+$F,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function nI(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return eI.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return C(t)?re(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||b(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return eI.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var rI=`https://github.com/micromark/micromark-extension-mdx-jsx`;function iI(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,S,w,T,E,D,ee,te,ne,re,ie,ae,oe,se){let ce=this,O,le;return ue;function ue(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),A}function A(e){return x(e)?n(e):(O=fe,Ie(e))}function fe(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),O=pe,Ie;if(t===62)return Fe(t);if(t!==null&&t>=0&&de(t))return e.enter(d),e.enter(f),e.consume(t),me;Re(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function pe(t){if(t===62)return Fe(t);if(t!==null&&t>=0&&de(t))return e.enter(d),e.enter(f),e.consume(t),me;Re(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function me(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),me;if(t===46||t===47||t===58||t===62||t===123||x(t)||g(t))return e.exit(f),O=ge,Ie(t);Re(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ge(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),O=_e,Ie;if(t===58)return e.enter(h),e.consume(t),e.exit(h),O=be,Ie;if(t===47||t===62||t===123||t!==null&&t>=0&&de(t))return e.exit(d),Ce(t);Re(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function _e(t){if(t!==null&&t>=0&&de(t))return e.enter(m),e.consume(t),ve;Re(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ve(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),ve;if(t===46||t===47||t===62||t===123||x(t)||g(t))return e.exit(m),O=ye,Ie(t);Re(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ye(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),O=_e,Ie;if(t===47||t===62||t===123||t!==null&&t>=0&&de(t))return e.exit(d),Ce(t);Re(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function be(t){if(t!==null&&t>=0&&de(t))return e.enter(_),e.consume(t),xe;Re(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function xe(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),xe;if(t===47||t===62||t===123||x(t)||g(t))return e.exit(_),O=Se,Ie(t);Re(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Se(t){if(t===47||t===62||t===123||t!==null&&t>=0&&de(t))return e.exit(d),Ce(t);Re(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Ce(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),O=Pe,Ie;if(t===62)return Fe(t);if(t===123)return eI.call(ce,e,we,v,y,S,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&de(t))return e.enter(w),e.enter(T),e.enter(E),e.consume(t),Te;Re(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function we(e){return O=Ce,Ie(e)}function Te(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),Te;if(t===47||t===58||t===61||t===62||t===123||x(t)||g(t))return e.exit(E),O=Ee,Ie(t);Re(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Ee(t){if(t===58)return e.enter(D),e.consume(t),e.exit(D),O=De,Ie;if(t===61)return e.exit(T),e.enter(te),e.consume(t),e.exit(te),O=Ae,Ie;if(t===47||t===62||t===123||x(t)||g(t)||t!==null&&t>=0&&de(t))return e.exit(T),e.exit(w),O=Ce,Ie(t);Re(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function De(t){if(t!==null&&t>=0&&de(t))return e.enter(ee),e.consume(t),Oe;Re(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Oe(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),Oe;if(t===47||t===61||t===62||t===123||x(t)||g(t))return e.exit(ee),e.exit(T),O=ke,Ie(t);Re(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function ke(t){if(t===61)return e.enter(te),e.consume(t),e.exit(te),O=Ae,Ie;if(t===47||t===62||t===123||t!==null&&t>=0&&de(t))return e.exit(w),Ce(t);Re(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ae(t){if(t===34||t===39)return e.enter(ne),e.enter(re),e.consume(t),e.exit(re),le=t,Me;if(t===123)return eI.call(ce,e,je,ae,oe,se,r,i,a,!1,!1,o)(t);Re(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function je(t){return e.exit(w),O=Ce,Ie(t)}function Me(t){return t===null&&Re(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(le)+"`"),t===le?(e.enter(re),e.consume(t),e.exit(re),e.exit(ne),e.exit(w),le=void 0,O=Ce,Ie):b(t)?(O=Me,Ie(t)):(e.enter(ie),Ne(t))}function Ne(t){return t===null||t===le||b(t)?(e.exit(ie),Me(t)):(e.consume(t),Ne)}function Pe(e){if(e===62)return Fe(e);Re(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Fe(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Ie(t){return b(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j):C(t)||g(t)?(e.enter(`esWhitespace`),Le(t)):O(t)}function Le(t){return b(t)?(e.exit(`esWhitespace`),Ie(t)):C(t)||g(t)?(e.consume(t),Le):(e.exit(`esWhitespace`),O(t))}function j(e){if(!o&&ce.parser.lazy[ce.now().line]){let e=new k("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",ce.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=rI+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Ie(e)}function Re(e,t,n){let r=new k(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+aI(e)+`)`)+` `+t+`, expected `+n,ce.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=rI+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function aI(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function oI(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return iI.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function sI(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return iI.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return C(e)?re(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||b(e)?r(e):i(e)}}}function cI(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:sI(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:oI(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function lI(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}function uI(){return oe([nI(),cI(),lI()])}var dI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;var a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),fI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=dI(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),X=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=dI(),n=fI(),r=dI();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`strConcat`,{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`getProperty`,{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`regexpCode`,{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}});var i=fI();Object.defineProperty(e,`Scope`,{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,`ValueScope`,{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,`ValueScopeName`,{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,`varKinds`,{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=te(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=te(this.rhs,e,n),this}get names(){return ee(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=te(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(ne(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>D(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(re(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=te(this.condition,e,t),this}get names(){let e=super.names;return ee(e,this.condition),this.else&&D(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=te(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return ee(ee(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=te(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var E=class extends m{render(e){return`finally`+super.render(e)}};E.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
368
|
-
`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new E,this.code(n)),this._endBlockNode(T,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function D(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function ee(e,n){return n instanceof t._CodeOrName?D(e,n.names):e}function te(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function ne(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function re(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${O(e)}`}e.not=re;var ie=ce(e.operators.AND);function ae(...e){return e.reduce(ie)}e.and=ae;var oe=ce(e.operators.OR);function se(...e){return e.reduce(oe)}e.or=se;function ce(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${O(n)} ${e} ${O(r)}`}function O(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),pI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=X(),n=dI();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0?!0:(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),mI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),hI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=X(),n=pI(),r=mI();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),gI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=hI(),n=X(),r=mI(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),_I=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),vI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),yI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=_I(),n=vI(),r=hI(),i=X(),a=pI(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
|
|
367
|
+
`;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function WF(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=GF(n.start,r[0]||t.start),a=GF(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function GF(e,t){if(e&&typeof e==`object`){let n=`line`in e?KF(e.line):void 0,r=`column`in e?KF(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:KF(t)}}}function KF(e){return typeof e==`number`&&e>-1?e:void 0}var qF=2,JF=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,YF=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,XF=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,ZF=`#unexpected-type-in-code-expected-an-object-spread-spread`,QF=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,$F=`#could-not-parse-expression-with-acorn`;function eI(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new fe("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=JF+YF,e}if(E(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?tI.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||E(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new fe("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=JF+XF,e}return te(t)?ye(e,_,`linePrefix`,qF+1)(t):_(t)}}function tI(e,t,n,r,i,a,o){let s=zF(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=WF(e),n=new fe("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=JF+ZF,n}if(e.expression.properties[1]){let t=new fe(`Unexpected extra content in spread: only a single spread is supported`,{place:WF(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=JF+QF,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=WF(e.expression.properties[0]),n=new fe("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=JF+ZF,n}}if(s.error){let e=new fe(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=JF+$F,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function nI(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return eI.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return te(t)?ye(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||E(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return eI.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var rI=`https://github.com/micromark/micromark-extension-mdx-jsx`;function iI(e,t,n,r,i,a,o,s,c,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,ee,ne,re,ie,ae,oe,se,ce){let le=this,D,ue;return O;function O(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),k}function k(e){return T(e)?n(e):(D=pe,Ie(e))}function pe(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),D=me,Ie;if(t===62)return Fe(t);if(t!==null&&t>=0&&de(t))return e.enter(f),e.enter(p),e.consume(t),ge;Re(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function me(t){if(t===62)return Fe(t);if(t!==null&&t>=0&&de(t))return e.enter(f),e.enter(p),e.consume(t),ge;Re(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ge(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),ge;if(t===46||t===47||t===58||t===62||t===123||T(t)||l(t))return e.exit(p),D=_e,Ie(t);Re(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function _e(t){if(t===46)return e.enter(m),e.consume(t),e.exit(m),D=ve,Ie;if(t===58)return e.enter(g),e.consume(t),e.exit(g),D=xe,Ie;if(t===47||t===62||t===123||t!==null&&t>=0&&de(t))return e.exit(f),Ce(t);Re(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ve(t){if(t!==null&&t>=0&&de(t))return e.enter(h),e.consume(t),ye;Re(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ye(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),ye;if(t===46||t===47||t===62||t===123||T(t)||l(t))return e.exit(h),D=be,Ie(t);Re(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function be(t){if(t===46)return e.enter(m),e.consume(t),e.exit(m),D=ve,Ie;if(t===47||t===62||t===123||t!==null&&t>=0&&de(t))return e.exit(f),Ce(t);Re(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function xe(t){if(t!==null&&t>=0&&de(t))return e.enter(_),e.consume(t),A;Re(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function A(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),A;if(t===47||t===62||t===123||T(t)||l(t))return e.exit(_),D=Se,Ie(t);Re(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Se(t){if(t===47||t===62||t===123||t!==null&&t>=0&&de(t))return e.exit(f),Ce(t);Re(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Ce(t){if(t===47)return e.enter(d),e.consume(t),e.exit(d),D=Pe,Ie;if(t===62)return Fe(t);if(t===123)return eI.call(le,e,we,v,y,b,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&de(t))return e.enter(x),e.enter(S),e.enter(C),e.consume(t),Te;Re(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function we(e){return D=Ce,Ie(e)}function Te(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),Te;if(t===47||t===58||t===61||t===62||t===123||T(t)||l(t))return e.exit(C),D=Ee,Ie(t);Re(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Ee(t){if(t===58)return e.enter(w),e.consume(t),e.exit(w),D=De,Ie;if(t===61)return e.exit(S),e.enter(ne),e.consume(t),e.exit(ne),D=Ae,Ie;if(t===47||t===62||t===123||T(t)||l(t)||t!==null&&t>=0&&de(t))return e.exit(S),e.exit(x),D=Ce,Ie(t);Re(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function De(t){if(t!==null&&t>=0&&de(t))return e.enter(ee),e.consume(t),Oe;Re(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Oe(t){if(t!==null&&t>=0&&he(t,{jsx:!0}))return e.consume(t),Oe;if(t===47||t===61||t===62||t===123||T(t)||l(t))return e.exit(ee),e.exit(S),D=ke,Ie(t);Re(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function ke(t){if(t===61)return e.enter(ne),e.consume(t),e.exit(ne),D=Ae,Ie;if(t===47||t===62||t===123||t!==null&&t>=0&&de(t))return e.exit(x),Ce(t);Re(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ae(t){if(t===34||t===39)return e.enter(re),e.enter(ie),e.consume(t),e.exit(ie),ue=t,Me;if(t===123)return eI.call(le,e,je,oe,se,ce,r,i,a,!1,!1,o)(t);Re(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function je(t){return e.exit(x),D=Ce,Ie(t)}function Me(t){return t===null&&Re(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(ue)+"`"),t===ue?(e.enter(ie),e.consume(t),e.exit(ie),e.exit(re),e.exit(x),ue=void 0,D=Ce,Ie):E(t)?(D=Me,Ie(t)):(e.enter(ae),Ne(t))}function Ne(t){return t===null||t===ue||E(t)?(e.exit(ae),Me(t)):(e.consume(t),Ne)}function Pe(e){if(e===62)return Fe(e);Re(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Fe(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Ie(t){return E(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j):te(t)||l(t)?(e.enter(`esWhitespace`),Le(t)):D(t)}function Le(t){return E(t)?(e.exit(`esWhitespace`),Ie(t)):te(t)||l(t)?(e.consume(t),Le):(e.exit(`esWhitespace`),D(t))}function j(e){if(!o&&le.parser.lazy[le.now().line]){let e=new fe("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",le.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=rI+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Ie(e)}function Re(e,t,n){let r=new fe(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+aI(e)+`)`)+` `+t+`, expected `+n,le.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=rI+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function aI(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function oI(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return iI.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function sI(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return iI.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return te(e)?ye(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||E(e)?r(e):i(e)}}}function cI(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:sI(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:oI(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function lI(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}function uI(){return Se([nI(),cI(),lI()])}var dI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;var a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),fI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=dI(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),X=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=dI(),n=fI(),r=dI();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`strConcat`,{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`getProperty`,{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`regexpCode`,{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}});var i=fI();Object.defineProperty(e,`Scope`,{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,`ValueScope`,{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,`ValueScopeName`,{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,`varKinds`,{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=ne(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ne(this.rhs,e,n),this}get names(){return te(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=ne(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(re(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>E(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(ie(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=ne(this.condition,e,t),this}get names(){let e=super.names;return te(e,this.condition),this.else&&E(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=ne(this.iteration,e,t),this}get names(){return E(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return te(te(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=ne(this.iterable,e,t),this}get names(){return E(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&E(e,this.catch.names),this.finally&&E(e,this.finally.names),e}},ee=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ee.kind=`catch`;var T=class extends m{render(e){return`finally`+super.render(e)}};T.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
368
|
+
`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new ee(e),t(e)}return n&&(this._currNode=r.finally=new T,this.code(n)),this._endBlockNode(ee,T)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function E(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function te(e,n){return n instanceof t._CodeOrName?E(e,n.names):e}function ne(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function re(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function ie(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${D(e)}`}e.not=ie;var ae=le(e.operators.AND);function oe(...e){return e.reduce(ae)}e.and=oe;var se=le(e.operators.OR);function ce(...e){return e.reduce(se)}e.or=ce;function le(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${D(n)} ${e} ${D(r)}`}function D(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),pI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=X(),n=dI();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0?!0:(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),mI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),hI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=X(),n=pI(),r=mI();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),gI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=hI(),n=X(),r=mI(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),_I=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),vI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),yI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=_I(),n=vI(),r=hI(),i=X(),a=pI(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
|
|
369
369
|
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
|
|
370
370
|
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
|
|
371
|
-
|| ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;var g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),bI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assignDefaults=void 0;var t=X(),n=pI();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),xI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=X(),n=pI(),r=mI(),i=pI();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;var h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),SI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=X(),n=mI(),r=xI(),i=hI();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),CI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=X(),n=pI();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),wI=a(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),TI=a(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else (p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),EI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=pI(),n=wI(),r=TI(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;var d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;var m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),DI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=gI(),n=yI(),r=vI(),i=yI(),a=bI(),o=SI(),s=CI(),c=X(),l=mI(),u=EI(),d=pI(),f=hI();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&ne(e),D(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),T(e),re(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&ne(e),ee(e),te(e);let a=r.const(`_errs`,l.default.errors);T(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),E(e)}function T(e,t){if(e.opts.jtd)return ae(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);ae(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function E(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function D(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function ee(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function te(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function ne({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function re(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&ie(e),t.return((0,c._)`${l.default.errors} === 0`))}function ie({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function ae(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>pe(e,`$ref`,h.all.$ref.definition));return}p.jtd||se(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),oe(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):oe(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function oe(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&pe(e,n.keyword,n.definition,t.type)})}function se(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(ce(e,t),e.opts.allowUnionTypes||O(e,t),le(e,e.dataTypes))}function ce(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{de(e.dataTypes,t)||A(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),k(e,t)}}function O(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&A(e,`use allowUnionTypes to allow union type keyword`)}function le(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>ue(t,e))&&A(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function ue(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function de(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function k(e,t){let n=[];for(let r of e.dataTypes)de(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function A(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var fe=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,ge(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=fe;function pe(e,t,n,r){let i=new fe(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}var me=/^\/(?:[^~]|~0|~1)*$/,he=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ge(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!me.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=he.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=ge})),OI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),kI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=EI();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),AI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=X(),n=OI(),r=mI(),i=EI(),a=pI(),o=DI(),s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;var h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),jI=i({$id:()=>MI,additionalProperties:()=>!1,default:()=>LI,description:()=>NI,properties:()=>II,required:()=>FI,type:()=>PI}),MI,NI,PI,FI,II,LI,RI=n((()=>{MI=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,NI=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,PI=`object`,FI=[`$data`],II={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},LI={$id:MI,description:NI,type:PI,required:FI,properties:II,additionalProperties:!1}})),zI=a(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var c=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function u(e,t,n){if(e.length){let r=s(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function d(e){let t=0,n={error:!1,address:``,zone:``},r=[],i=[],a=!1,o=!1,c=u;for(let s=0;s<e.length;s++){let u=e[s];if(!(u===`[`||u===`]`))if(u===`:`){if(a===!0&&(o=!0),!c(i,r,n))break;if(++t>7){n.error=!0;break}s>0&&e[s-1]===`:`&&(a=!0),r.push(`:`);continue}else if(u===`%`){if(!c(i,r,n))break;c=l}else{i.push(u);continue}}return i.length&&(c===l?n.zone=i.join(``):o?r.push(i.join(``)):r.push(s(i))),n.address=r.join(``),n}function f(e){if(p(e,`:`)<2)return{host:e,isIPV6:!1};let t=d(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function p(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function m(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}else{n.push(t);break}}else if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}else if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}var h={"@":`%40`,"/":`%2F`,"?":`%3F`,"#":`%23`,":":`%3A`},g=/[@/?#:]/g,_=/[@/?#]/g;function v(e,t){let n=t?_:g;return n.lastIndex=0,e.replace(n,e=>h[e])}function y(e,t=!1){if(e.indexOf(`%`)===-1)return e;let n=``;for(let r=0;r<e.length;r++){if(e[r]===`%`&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&a(i)?n+=i:n+=`%`+e,r+=2;continue}}n+=e[r]}return n}function b(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){let e=r.toUpperCase(),i=String.fromCharCode(parseInt(e,16));i!==`.`&&a(i)?t+=i:t+=`%`+e,n+=2;continue}}o(e[n])?t+=e[n]:t+=escape(e[n])}return t}function x(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){t+=`%`+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function S(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let e=f(n);n=e.isIPV6===!0?`[${e.escapedHost}]`:v(n,!1)}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:c,recomposeAuthority:S,reescapeHostDelimiters:v,normalizePercentEncoding:y,normalizePathEncoding:b,escapePreservingEscapes:x,removeDotSegments:m,isIPv4:r,isUUID:n,normalizeIPv6:f,stringArrayToHexStripped:s}})),BI=a(((e,t)=>{var{isUUID:n}=zI(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),VI=a(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizePercentEncoding:a,normalizePathEncoding:o,escapePreservingEscapes:s,reescapeHostDelimiters:c,isIPv4:l,nonSimpleDomain:u}=zI(),{SCHEMES:d,getSchemeHandler:f}=BI();function p(e,t){return typeof e==`string`?e=w(e,t):typeof e==`object`&&(e=C(_(e,t),t)),e}function m(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},{parsed:i,malformedAuthorityOrPort:a}=S(e,r),{parsed:o,malformedAuthorityOrPort:s}=S(t,r);if(a||s)throw Error(i.error||o.error||`URI is malformed.`);let c=h(i,o,r,!0);return r.skipEscape=!0,_(c,r)}function h(e,t,n,i){let a={};return i||(e=C(_(e,n),n),t=C(_(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path=`/`+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:a.path=t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,t.query===void 0?a.query=e.query:a.query=t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function g(e,t,n){let r=E(e,n),i=E(t,n);return r!==void 0&&i!==void 0&&r.toLowerCase()===i.toLowerCase()}function _(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},o=Object.assign({},t),c=[],l=f(o.scheme||n.scheme);l&&l.serialize&&l.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=a(n.path):(n.path=s(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),o.reference!==`suffix`&&n.scheme&&c.push(n.scheme,`:`);let u=i(n);if(u!==void 0&&(o.reference!==`suffix`&&c.push(`//`),c.push(u),n.path&&n.path[0]!==`/`&&c.push(`/`)),n.path!==void 0){let e=n.path;!o.absolutePath&&(!l||!l.absolutePath)&&(e=r(e)),u===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),c.push(e)}return n.query!==void 0&&c.push(`?`,n.query),n.fragment!==void 0&&c.push(`#`,n.fragment),c.join(``)}var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,y=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,b=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function x(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!==`/`)return`URI path must start with "/" when authority is present.`;if(typeof e.port==`number`&&(e.port<0||e.port>65535))return`URI port is malformed.`}function S(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1,s=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let d=e.match(y);d!==null&&d[1].indexOf(`\\`)!==-1&&(i.error=`URI authority must not contain a literal backslash.`,a=!0);let p=e.match(b);if(p!==null){let e=p[1],t=e.replace(/[\t\n\r]/g,``);t.length>=2&&(t.slice(0,2)===`//`?e.length!==t.length&&(i.error=i.error||`URI authority introducer must not contain whitespace.`,a=!0):(i.error=i.error||`URI authority must not contain a literal backslash.`,a=!0))}let m=e.match(v);if(m){i.scheme=m[1],i.userinfo=m[3],i.host=m[4],i.port=parseInt(m[5],10),i.path=m[6]||``,i.query=m[7],i.fragment=m[8],isNaN(i.port)&&(i.port=m[5]);let t=x(i,m);if(t!==void 0&&(i.error=i.error||t,a=!0),i.host)if(l(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),s=e.isIPV6}else s=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference=`same-document`:i.scheme===void 0?i.reference=`relative`:i.fragment===void 0?i.reference=`absolute`:i.reference=`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let d=f(r.scheme||i.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&i.host&&(r.domainHost||d&&d.domainHost)&&s===!1&&u(i.host))try{i.host=new URL(`http://`+i.host).hostname}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}if((!d||d&&!d.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=c(unescape(i.host),s))),i.path&&=o(i.path),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||`URI malformed`}d&&d.parse&&d.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return{parsed:i,malformedAuthorityOrPort:a}}function C(e,t){return S(e,t).parsed}function w(e,t){return T(e,t).normalized}function T(e,t){let{parsed:n,malformedAuthorityOrPort:r}=S(e,t);return{normalized:r?e:_(n,t),malformedAuthorityOrPort:r}}function E(e,t){if(typeof e==`string`){let{normalized:n,malformedAuthorityOrPort:r}=T(e,t);return r?void 0:n}if(typeof e==`object`)return _(e,t)}var D={SCHEMES:d,normalize:p,resolve:m,resolveComponent:h,equal:g,serialize:_,parse:C};t.exports=D,t.exports.default=D,t.exports.fastUri=D})),HI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=VI();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),UI=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=DI();Object.defineProperty(t,`KeywordCxt`,{enumerable:!0,get:function(){return n.KeywordCxt}});var r=X();Object.defineProperty(t,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,`Name`,{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,`CodeGen`,{enumerable:!0,get:function(){return r.CodeGen}});var i=OI(),a=kI(),o=_I(),s=AI(),c=X(),l=EI(),u=yI(),d=pI(),f=(RI(),e(jI).default),p=HI(),m=(e,t)=>new RegExp(e,t);m.code=`new RegExp`;var h=[`removeAdditional`,`useDefaults`,`coerceTypes`],g=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),_={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},v={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},y=200;function b(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??m,a=e.uriResolver??p.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??y,loopEnum:e.loopEnum??y,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var x=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=te(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),S.call(this,_,e,`NOT SUPPORTED`),S.call(this,v,e,`DEPRECATED`,`warn`),this._metaOpts=D.call(this),e.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&E.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),w.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=f;n===`id`&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=C.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new s.SchemaEnv({schema:{},schemaId:n});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=C.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(re.call(this,n,t),!t)return(0,d.eachItem)(n,e=>ie.call(this,e)),this;oe.call(this,t);let r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,r.type.length===0?e=>ie.call(this,e,r):e=>r.type.forEach(t=>ie.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=ce(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let c=this._cache.get(e);if(c!==void 0)return c;n=(0,l.normalizeId)(a||n);let u=l.getSchemaRefs.call(this,e,n);return c=new s.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=c),r&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};x.ValidationError=i.default,x.MissingRefError=a.default,t.default=x;function S(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function C(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function w(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function T(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function E(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function D(){let e={...this.opts};for(let t of h)delete e[t];return e}var ee={log(){},warn(){},error(){}};function te(e){if(e===!1)return ee;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var ne=/^[a-z_$][a-z0-9_$:-]*$/i;function re(e,t){let{RULES:n}=this;if((0,d.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!ne.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function ie(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?ae.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function ae(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function oe(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ce(t)),e.validateSchema=this.compile(t,!0))}var se={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function ce(e){return{anyOf:[e,se]}}})),WI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),GI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.callRef=e.getValidate=void 0;var t=kI(),n=xI(),r=X(),i=mI(),a=AI(),o=pI(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),KI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=WI(),n=GI();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),qI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),JI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),YI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),XI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=YI();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),ZI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xI(),n=pI(),r=X();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),QI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),$I=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xI(),n=X(),r=pI();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),eL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),tL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=wI();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),nL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=yI(),n=X(),r=pI(),i=tL();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),rL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=tL();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),iL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=tL();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),aL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=qI(),n=JI(),r=XI(),i=ZI(),a=QI(),o=$I(),s=eL(),c=nL(),l=rL(),u=iL();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),oL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateAdditionalItems=void 0;var t=X(),n=pI(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),sL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTuple=void 0;var t=X(),n=pI(),r=xI(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),cL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=sL();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),lL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=xI(),i=oL();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),uL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),dL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=X(),n=pI(),r=xI();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
|
|
371
|
+
|| ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;var g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),bI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assignDefaults=void 0;var t=X(),n=pI();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),xI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=X(),n=pI(),r=mI(),i=pI();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;var h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),SI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=X(),n=mI(),r=xI(),i=hI();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),CI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=X(),n=pI();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),wI=a(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),TI=a(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else (p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),EI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=pI(),n=wI(),r=TI(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;var d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;var m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),DI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=gI(),n=yI(),r=vI(),i=yI(),a=bI(),o=SI(),s=CI(),c=X(),l=mI(),u=EI(),d=pI(),f=hI();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&re(e),E(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),ee(e),ie(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&re(e),te(e),ne(e);let a=r.const(`_errs`,l.default.errors);ee(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),T(e)}function ee(e,t){if(e.opts.jtd)return oe(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);oe(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function T(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function E(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function te(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function ne(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function re({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function ie(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&ae(e),t.return((0,c._)`${l.default.errors} === 0`))}function ae({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function oe(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>me(e,`$ref`,h.all.$ref.definition));return}p.jtd||ce(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),se(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):se(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function se(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&me(e,n.keyword,n.definition,t.type)})}function ce(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(le(e,t),e.opts.allowUnionTypes||D(e,t),ue(e,e.dataTypes))}function le(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{fe(e.dataTypes,t)||k(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),O(e,t)}}function D(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&k(e,`use allowUnionTypes to allow union type keyword`)}function ue(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>de(t,e))&&k(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function de(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function fe(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function O(e,t){let n=[];for(let r of e.dataTypes)fe(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function k(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var pe=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,_e(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=pe;function me(e,t,n,r){let i=new pe(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}var he=/^\/(?:[^~]|~0|~1)*$/,ge=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _e(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!he.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=ge.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=_e})),OI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),kI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=EI();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),AI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=X(),n=OI(),r=mI(),i=EI(),a=pI(),o=DI(),s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;var h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),jI=i({$id:()=>MI,additionalProperties:()=>!1,default:()=>LI,description:()=>NI,properties:()=>II,required:()=>FI,type:()=>PI}),MI,NI,PI,FI,II,LI,RI=n((()=>{MI=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,NI=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,PI=`object`,FI=[`$data`],II={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},LI={$id:MI,description:NI,type:PI,required:FI,properties:II,additionalProperties:!1}})),zI=a(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var c=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function u(e,t,n){if(e.length){let r=s(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function d(e){let t=0,n={error:!1,address:``,zone:``},r=[],i=[],a=!1,o=!1,c=u;for(let s=0;s<e.length;s++){let u=e[s];if(!(u===`[`||u===`]`))if(u===`:`){if(a===!0&&(o=!0),!c(i,r,n))break;if(++t>7){n.error=!0;break}s>0&&e[s-1]===`:`&&(a=!0),r.push(`:`);continue}else if(u===`%`){if(!c(i,r,n))break;c=l}else{i.push(u);continue}}return i.length&&(c===l?n.zone=i.join(``):o?r.push(i.join(``)):r.push(s(i))),n.address=r.join(``),n}function f(e){if(p(e,`:`)<2)return{host:e,isIPV6:!1};let t=d(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function p(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function m(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}else{n.push(t);break}}else if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}else if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}var h={"@":`%40`,"/":`%2F`,"?":`%3F`,"#":`%23`,":":`%3A`},g=/[@/?#:]/g,_=/[@/?#]/g;function v(e,t){let n=t?_:g;return n.lastIndex=0,e.replace(n,e=>h[e])}function y(e,t=!1){if(e.indexOf(`%`)===-1)return e;let n=``;for(let r=0;r<e.length;r++){if(e[r]===`%`&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&a(i)?n+=i:n+=`%`+e,r+=2;continue}}n+=e[r]}return n}function b(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){let e=r.toUpperCase(),i=String.fromCharCode(parseInt(e,16));i!==`.`&&a(i)?t+=i:t+=`%`+e,n+=2;continue}}o(e[n])?t+=e[n]:t+=escape(e[n])}return t}function x(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){t+=`%`+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function S(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let e=f(n);n=e.isIPV6===!0?`[${e.escapedHost}]`:v(n,!1)}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:c,recomposeAuthority:S,reescapeHostDelimiters:v,normalizePercentEncoding:y,normalizePathEncoding:b,escapePreservingEscapes:x,removeDotSegments:m,isIPv4:r,isUUID:n,normalizeIPv6:f,stringArrayToHexStripped:s}})),BI=a(((e,t)=>{var{isUUID:n}=zI(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),VI=a(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizePercentEncoding:a,normalizePathEncoding:o,escapePreservingEscapes:s,reescapeHostDelimiters:c,isIPv4:l,nonSimpleDomain:u}=zI(),{SCHEMES:d,getSchemeHandler:f}=BI();function p(e,t){return typeof e==`string`?e=w(e,t):typeof e==`object`&&(e=C(_(e,t),t)),e}function m(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},{parsed:i,malformedAuthorityOrPort:a}=S(e,r),{parsed:o,malformedAuthorityOrPort:s}=S(t,r);if(a||s)throw Error(i.error||o.error||`URI is malformed.`);let c=h(i,o,r,!0);return r.skipEscape=!0,_(c,r)}function h(e,t,n,i){let a={};return i||(e=C(_(e,n),n),t=C(_(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path=`/`+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:a.path=t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,t.query===void 0?a.query=e.query:a.query=t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function g(e,t,n){let r=T(e,n),i=T(t,n);return r!==void 0&&i!==void 0&&r.toLowerCase()===i.toLowerCase()}function _(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},o=Object.assign({},t),c=[],l=f(o.scheme||n.scheme);l&&l.serialize&&l.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=a(n.path):(n.path=s(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),o.reference!==`suffix`&&n.scheme&&c.push(n.scheme,`:`);let u=i(n);if(u!==void 0&&(o.reference!==`suffix`&&c.push(`//`),c.push(u),n.path&&n.path[0]!==`/`&&c.push(`/`)),n.path!==void 0){let e=n.path;!o.absolutePath&&(!l||!l.absolutePath)&&(e=r(e)),u===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),c.push(e)}return n.query!==void 0&&c.push(`?`,n.query),n.fragment!==void 0&&c.push(`#`,n.fragment),c.join(``)}var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,y=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,b=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function x(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!==`/`)return`URI path must start with "/" when authority is present.`;if(typeof e.port==`number`&&(e.port<0||e.port>65535))return`URI port is malformed.`}function S(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1,s=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let d=e.match(y);d!==null&&d[1].indexOf(`\\`)!==-1&&(i.error=`URI authority must not contain a literal backslash.`,a=!0);let p=e.match(b);if(p!==null){let e=p[1],t=e.replace(/[\t\n\r]/g,``);t.length>=2&&(t.slice(0,2)===`//`?e.length!==t.length&&(i.error=i.error||`URI authority introducer must not contain whitespace.`,a=!0):(i.error=i.error||`URI authority must not contain a literal backslash.`,a=!0))}let m=e.match(v);if(m){i.scheme=m[1],i.userinfo=m[3],i.host=m[4],i.port=parseInt(m[5],10),i.path=m[6]||``,i.query=m[7],i.fragment=m[8],isNaN(i.port)&&(i.port=m[5]);let t=x(i,m);if(t!==void 0&&(i.error=i.error||t,a=!0),i.host)if(l(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),s=e.isIPV6}else s=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference=`same-document`:i.scheme===void 0?i.reference=`relative`:i.fragment===void 0?i.reference=`absolute`:i.reference=`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let d=f(r.scheme||i.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&i.host&&(r.domainHost||d&&d.domainHost)&&s===!1&&u(i.host))try{i.host=new URL(`http://`+i.host).hostname}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}if((!d||d&&!d.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=c(unescape(i.host),s))),i.path&&=o(i.path),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||`URI malformed`}d&&d.parse&&d.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return{parsed:i,malformedAuthorityOrPort:a}}function C(e,t){return S(e,t).parsed}function w(e,t){return ee(e,t).normalized}function ee(e,t){let{parsed:n,malformedAuthorityOrPort:r}=S(e,t);return{normalized:r?e:_(n,t),malformedAuthorityOrPort:r}}function T(e,t){if(typeof e==`string`){let{normalized:n,malformedAuthorityOrPort:r}=ee(e,t);return r?void 0:n}if(typeof e==`object`)return _(e,t)}var E={SCHEMES:d,normalize:p,resolve:m,resolveComponent:h,equal:g,serialize:_,parse:C};t.exports=E,t.exports.default=E,t.exports.fastUri=E})),HI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=VI();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),UI=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=DI();Object.defineProperty(t,`KeywordCxt`,{enumerable:!0,get:function(){return n.KeywordCxt}});var r=X();Object.defineProperty(t,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,`Name`,{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,`CodeGen`,{enumerable:!0,get:function(){return r.CodeGen}});var i=OI(),a=kI(),o=_I(),s=AI(),c=X(),l=EI(),u=yI(),d=pI(),f=(RI(),e(jI).default),p=HI(),m=(e,t)=>new RegExp(e,t);m.code=`new RegExp`;var h=[`removeAdditional`,`useDefaults`,`coerceTypes`],g=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),_={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},v={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},y=200;function b(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??m,a=e.uriResolver??p.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??y,loopEnum:e.loopEnum??y,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var x=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=ne(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),S.call(this,_,e,`NOT SUPPORTED`),S.call(this,v,e,`DEPRECATED`,`warn`),this._metaOpts=E.call(this),e.formats&&ee.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&T.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),w.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=f;n===`id`&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=C.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new s.SchemaEnv({schema:{},schemaId:n});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=C.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(ie.call(this,n,t),!t)return(0,d.eachItem)(n,e=>ae.call(this,e)),this;se.call(this,t);let r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,r.type.length===0?e=>ae.call(this,e,r):e=>r.type.forEach(t=>ae.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=le(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let c=this._cache.get(e);if(c!==void 0)return c;n=(0,l.normalizeId)(a||n);let u=l.getSchemaRefs.call(this,e,n);return c=new s.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=c),r&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};x.ValidationError=i.default,x.MissingRefError=a.default,t.default=x;function S(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function C(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function w(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function ee(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function T(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function E(){let e={...this.opts};for(let t of h)delete e[t];return e}var te={log(){},warn(){},error(){}};function ne(e){if(e===!1)return te;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var re=/^[a-z_$][a-z0-9_$:-]*$/i;function ie(e,t){let{RULES:n}=this;if((0,d.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!re.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function ae(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?oe.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function oe(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function se(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=le(t)),e.validateSchema=this.compile(t,!0))}var ce={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function le(e){return{anyOf:[e,ce]}}})),WI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),GI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.callRef=e.getValidate=void 0;var t=kI(),n=xI(),r=X(),i=mI(),a=AI(),o=pI(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),KI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=WI(),n=GI();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),qI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),JI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),YI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),XI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=YI();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),ZI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xI(),n=pI(),r=X();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),QI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),$I=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xI(),n=X(),r=pI();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),eL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),tL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=wI();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),nL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=yI(),n=X(),r=pI(),i=tL();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),rL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=tL();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),iL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=tL();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),aL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=qI(),n=JI(),r=XI(),i=ZI(),a=QI(),o=$I(),s=eL(),c=nL(),l=rL(),u=iL();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),oL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateAdditionalItems=void 0;var t=X(),n=pI(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),sL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTuple=void 0;var t=X(),n=pI(),r=xI(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),cL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=sL();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),lL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=xI(),i=oL();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),uL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),dL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=X(),n=pI(),r=xI();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
|
|
372
372
|
missingProperty: ${i},
|
|
373
373
|
depsCount: ${n},
|
|
374
|
-
deps: ${r}}`};var i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),fL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),pL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xI(),n=X(),r=mI(),i=pI();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),mL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=DI(),n=xI(),r=pI(),i=pL();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),hL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xI(),n=X(),r=pI(),i=pI();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),gL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),_L=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:xI().validateUnion,error:{message:`must match a schema in anyOf`}}})),vL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),yL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),bL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),xL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),SL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=oL(),n=cL(),r=sL(),i=lL(),a=uL(),o=dL(),s=fL(),c=pL(),l=mL(),u=hL(),d=gL(),f=_L(),p=vL(),m=yL(),h=bL(),g=xL();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),CL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),wL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=[CL().default]})),TL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),EL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=KI(),n=aL(),r=SL(),i=wL(),a=TL();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),DL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),OL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=DL(),r=AI(),i=kI(),a=pI();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),kL=i({$id:()=>jL,$schema:()=>AL,default:()=>IL,definitions:()=>NL,properties:()=>FL,title:()=>ML,type:()=>PL}),AL,jL,ML,NL,PL,FL,IL,LL=n((()=>{AL=`http://json-schema.org/draft-07/schema#`,jL=`http://json-schema.org/draft-07/schema#`,ML=`Core schema meta-schema`,NL={schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},PL=[`object`,`boolean`],FL={$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},IL={$schema:AL,$id:jL,title:ML,definitions:NL,type:PL,properties:FL,default:!0}})),RL=a(((t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=UI(),i=EL(),a=OL(),o=(LL(),e(kL).default),s=[`/properties`],c=`http://json-schema.org/draft-07/schema`,l=class extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(e,c,!1),this.refs[`http://json-schema.org/schema`]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};t.Ajv=l,n.exports=t=l,n.exports.Ajv=l,Object.defineProperty(t,`__esModule`,{value:!0}),t.default=l;var u=DI();Object.defineProperty(t,`KeywordCxt`,{enumerable:!0,get:function(){return u.KeywordCxt}});var d=X();Object.defineProperty(t,`_`,{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,`str`,{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,`stringify`,{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,`nil`,{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,`Name`,{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,`CodeGen`,{enumerable:!0,get:function(){return d.CodeGen}});var f=OI();Object.defineProperty(t,`ValidationError`,{enumerable:!0,get:function(){return f.default}});var p=kI();Object.defineProperty(t,`MissingRefError`,{enumerable:!0,get:function(){return p.default}})})),zL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicAnchor=void 0;var t=X(),n=mI(),r=AI(),i=GI(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),BL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicRef=void 0;var t=X(),n=mI(),r=GI(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),VL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=zL(),n=pI();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),HL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=BL();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),UL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=zL(),n=BL(),r=VL(),i=HL();e.default=[t.default,n.default,r.default,i.default]})),WL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=dL();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),GL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=dL();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),KL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),qL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=WL(),n=GL(),r=KL();e.default=[t.default,n.default,r.default]})),JL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=mI();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),YL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),XL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=JL(),n=YL();e.default=[t.default,n.default]})),ZL=i({$id:()=>$L,$recursiveAnchor:()=>!0,$schema:()=>QL,$vocabulary:()=>eR,allOf:()=>nR,default:()=>aR,properties:()=>iR,title:()=>tR,type:()=>rR}),QL,$L,eR,tR,nR,rR,iR,aR,oR=n((()=>{QL=`https://json-schema.org/draft/2019-09/schema`,$L=`https://json-schema.org/draft/2019-09/schema`,eR={"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},tR=`Core and Validation specifications meta-schema`,nR=[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format`},{$ref:`meta/content`}],rR=[`object`,`boolean`],iR={definitions:{$comment:`While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.`,type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},dependencies:{$comment:`"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"`,type:`object`,additionalProperties:{anyOf:[{$recursiveRef:`#`},{$ref:`meta/validation#/$defs/stringArray`}]}}},aR={$schema:QL,$id:$L,$vocabulary:eR,$recursiveAnchor:!0,title:tR,allOf:nR,type:rR,properties:iR}})),sR=i({$defs:()=>mR,$id:()=>lR,$recursiveAnchor:()=>!0,$schema:()=>cR,$vocabulary:()=>uR,default:()=>hR,properties:()=>pR,title:()=>dR,type:()=>fR}),cR,lR,uR,dR,fR,pR,mR,hR,gR=n((()=>{cR=`https://json-schema.org/draft/2019-09/schema`,lR=`https://json-schema.org/draft/2019-09/meta/applicator`,uR={"https://json-schema.org/draft/2019-09/vocab/applicator":!0},dR=`Applicator vocabulary meta-schema`,fR=[`object`,`boolean`],pR={additionalItems:{$recursiveRef:`#`},unevaluatedItems:{$recursiveRef:`#`},items:{anyOf:[{$recursiveRef:`#`},{$ref:`#/$defs/schemaArray`}]},contains:{$recursiveRef:`#`},additionalProperties:{$recursiveRef:`#`},unevaluatedProperties:{$recursiveRef:`#`},properties:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$recursiveRef:`#`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$recursiveRef:`#`}},propertyNames:{$recursiveRef:`#`},if:{$recursiveRef:`#`},then:{$recursiveRef:`#`},else:{$recursiveRef:`#`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$recursiveRef:`#`}},mR={schemaArray:{type:`array`,minItems:1,items:{$recursiveRef:`#`}}},hR={$schema:cR,$id:lR,$vocabulary:uR,$recursiveAnchor:!0,title:dR,type:fR,properties:pR,$defs:mR}})),_R=i({$id:()=>yR,$recursiveAnchor:()=>!0,$schema:()=>vR,$vocabulary:()=>bR,default:()=>wR,properties:()=>CR,title:()=>xR,type:()=>SR}),vR,yR,bR,xR,SR,CR,wR,TR=n((()=>{vR=`https://json-schema.org/draft/2019-09/schema`,yR=`https://json-schema.org/draft/2019-09/meta/content`,bR={"https://json-schema.org/draft/2019-09/vocab/content":!0},xR=`Content vocabulary meta-schema`,SR=[`object`,`boolean`],CR={contentMediaType:{type:`string`},contentEncoding:{type:`string`},contentSchema:{$recursiveRef:`#`}},wR={$schema:vR,$id:yR,$vocabulary:bR,$recursiveAnchor:!0,title:xR,type:SR,properties:CR}})),ER=i({$id:()=>OR,$recursiveAnchor:()=>!0,$schema:()=>DR,$vocabulary:()=>kR,default:()=>NR,properties:()=>MR,title:()=>AR,type:()=>jR}),DR,OR,kR,AR,jR,MR,NR,PR=n((()=>{DR=`https://json-schema.org/draft/2019-09/schema`,OR=`https://json-schema.org/draft/2019-09/meta/core`,kR={"https://json-schema.org/draft/2019-09/vocab/core":!0},AR=`Core vocabulary meta-schema`,jR=[`object`,`boolean`],MR={$id:{type:`string`,format:`uri-reference`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{type:`string`,format:`uri`},$anchor:{type:`string`,pattern:`^[A-Za-z][-A-Za-z0-9.:_]*$`},$ref:{type:`string`,format:`uri-reference`},$recursiveRef:{type:`string`,format:`uri-reference`},$recursiveAnchor:{type:`boolean`,default:!1},$vocabulary:{type:`object`,propertyNames:{type:`string`,format:`uri`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}}},NR={$schema:DR,$id:OR,$vocabulary:kR,$recursiveAnchor:!0,title:AR,type:jR,properties:MR}})),FR=i({$id:()=>LR,$recursiveAnchor:()=>!0,$schema:()=>IR,$vocabulary:()=>RR,default:()=>HR,properties:()=>VR,title:()=>zR,type:()=>BR}),IR,LR,RR,zR,BR,VR,HR,UR=n((()=>{IR=`https://json-schema.org/draft/2019-09/schema`,LR=`https://json-schema.org/draft/2019-09/meta/format`,RR={"https://json-schema.org/draft/2019-09/vocab/format":!0},zR=`Format vocabulary meta-schema`,BR=[`object`,`boolean`],VR={format:{type:`string`}},HR={$schema:IR,$id:LR,$vocabulary:RR,$recursiveAnchor:!0,title:zR,type:BR,properties:VR}})),WR=i({$id:()=>KR,$recursiveAnchor:()=>!0,$schema:()=>GR,$vocabulary:()=>qR,default:()=>ZR,properties:()=>XR,title:()=>JR,type:()=>YR}),GR,KR,qR,JR,YR,XR,ZR,QR=n((()=>{GR=`https://json-schema.org/draft/2019-09/schema`,KR=`https://json-schema.org/draft/2019-09/meta/meta-data`,qR={"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},JR=`Meta-data vocabulary meta-schema`,YR=[`object`,`boolean`],XR={title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}},ZR={$schema:GR,$id:KR,$vocabulary:qR,$recursiveAnchor:!0,title:JR,type:YR,properties:XR}})),$R=i({$defs:()=>oz,$id:()=>tz,$recursiveAnchor:()=>!0,$schema:()=>ez,$vocabulary:()=>nz,default:()=>sz,properties:()=>az,title:()=>rz,type:()=>iz}),ez,tz,nz,rz,iz,az,oz,sz,cz=n((()=>{ez=`https://json-schema.org/draft/2019-09/schema`,tz=`https://json-schema.org/draft/2019-09/meta/validation`,nz={"https://json-schema.org/draft/2019-09/vocab/validation":!0},rz=`Validation vocabulary meta-schema`,iz=[`object`,`boolean`],az={multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}},const:!0,enum:{type:`array`,items:!0},type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]}},oz={nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},sz={$schema:ez,$id:tz,$vocabulary:nz,$recursiveAnchor:!0,title:rz,type:iz,properties:az,$defs:oz}})),lz=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(oR(),e(ZL).default),r=(gR(),e(sR).default),i=(TR(),e(_R).default),a=(PR(),e(ER).default),o=(UR(),e(FR).default),s=(QR(),e(WR).default),c=(cz(),e($R).default),l=[`/properties`];function u(e){return[n,r,i,a,t(this,o),s,t(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,n){return e?t.$dataMetaSchema(n,l):n}}t.default=u})),uz=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;var n=UI(),r=EL(),i=UL(),a=qL(),o=XL(),s=OL(),c=lz(),l=`https://json-schema.org/draft/2019-09/schema`,u=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(i.default),r.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(a.default),this.addVocabulary(o.default),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(c.default.call(this,e),this.refs[`http://json-schema.org/schema`]=l)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=u;var d=DI();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return d.KeywordCxt}});var f=X();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return f.CodeGen}});var p=OI();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return p.default}});var m=kI();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return m.default}})})),dz=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=KI(),n=aL(),r=SL(),i=UL(),a=qL(),o=XL(),s=wL(),c=TL();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),fz=i({$comment:()=>bz,$dynamicAnchor:()=>gz,$id:()=>mz,$schema:()=>pz,$vocabulary:()=>hz,allOf:()=>vz,default:()=>Sz,properties:()=>xz,title:()=>_z,type:()=>yz}),pz,mz,hz,gz,_z,vz,yz,bz,xz,Sz,Cz=n((()=>{pz=`https://json-schema.org/draft/2020-12/schema`,mz=`https://json-schema.org/draft/2020-12/schema`,hz={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},gz=`meta`,_z=`Core and Validation specifications meta-schema`,vz=[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],yz=[`object`,`boolean`],bz=`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,xz={definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}},Sz={$schema:pz,$id:mz,$vocabulary:hz,$dynamicAnchor:gz,title:_z,allOf:vz,type:yz,$comment:bz,properties:xz}})),wz=i({$defs:()=>Mz,$dynamicAnchor:()=>Oz,$id:()=>Ez,$schema:()=>Tz,$vocabulary:()=>Dz,default:()=>Nz,properties:()=>jz,title:()=>kz,type:()=>Az}),Tz,Ez,Dz,Oz,kz,Az,jz,Mz,Nz,Pz=n((()=>{Tz=`https://json-schema.org/draft/2020-12/schema`,Ez=`https://json-schema.org/draft/2020-12/meta/applicator`,Dz={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Oz=`meta`,kz=`Applicator vocabulary meta-schema`,Az=[`object`,`boolean`],jz={prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},Mz={schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}},Nz={$schema:Tz,$id:Ez,$vocabulary:Dz,$dynamicAnchor:Oz,title:kz,type:Az,properties:jz,$defs:Mz}})),Fz=i({$dynamicAnchor:()=>zz,$id:()=>Lz,$schema:()=>Iz,$vocabulary:()=>Rz,default:()=>Uz,properties:()=>Hz,title:()=>Bz,type:()=>Vz}),Iz,Lz,Rz,zz,Bz,Vz,Hz,Uz,Wz=n((()=>{Iz=`https://json-schema.org/draft/2020-12/schema`,Lz=`https://json-schema.org/draft/2020-12/meta/unevaluated`,Rz={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},zz=`meta`,Bz=`Unevaluated applicator vocabulary meta-schema`,Vz=[`object`,`boolean`],Hz={unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}},Uz={$schema:Iz,$id:Lz,$vocabulary:Rz,$dynamicAnchor:zz,title:Bz,type:Vz,properties:Hz}})),Gz=i({$dynamicAnchor:()=>Yz,$id:()=>qz,$schema:()=>Kz,$vocabulary:()=>Jz,default:()=>$z,properties:()=>Qz,title:()=>Xz,type:()=>Zz}),Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB=n((()=>{Kz=`https://json-schema.org/draft/2020-12/schema`,qz=`https://json-schema.org/draft/2020-12/meta/content`,Jz={"https://json-schema.org/draft/2020-12/vocab/content":!0},Yz=`meta`,Xz=`Content vocabulary meta-schema`,Zz=[`object`,`boolean`],Qz={contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}},$z={$schema:Kz,$id:qz,$vocabulary:Jz,$dynamicAnchor:Yz,title:Xz,type:Zz,properties:Qz}})),tB=i({$defs:()=>lB,$dynamicAnchor:()=>aB,$id:()=>rB,$schema:()=>nB,$vocabulary:()=>iB,default:()=>uB,properties:()=>cB,title:()=>oB,type:()=>sB}),nB,rB,iB,aB,oB,sB,cB,lB,uB,dB=n((()=>{nB=`https://json-schema.org/draft/2020-12/schema`,rB=`https://json-schema.org/draft/2020-12/meta/core`,iB={"https://json-schema.org/draft/2020-12/vocab/core":!0},aB=`meta`,oB=`Core vocabulary meta-schema`,sB=[`object`,`boolean`],cB={$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},lB={anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}},uB={$schema:nB,$id:rB,$vocabulary:iB,$dynamicAnchor:aB,title:oB,type:sB,properties:cB,$defs:lB}})),fB=i({$dynamicAnchor:()=>gB,$id:()=>mB,$schema:()=>pB,$vocabulary:()=>hB,default:()=>bB,properties:()=>yB,title:()=>_B,type:()=>vB}),pB,mB,hB,gB,_B,vB,yB,bB,xB=n((()=>{pB=`https://json-schema.org/draft/2020-12/schema`,mB=`https://json-schema.org/draft/2020-12/meta/format-annotation`,hB={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},gB=`meta`,_B=`Format vocabulary meta-schema for annotation results`,vB=[`object`,`boolean`],yB={format:{type:`string`}},bB={$schema:pB,$id:mB,$vocabulary:hB,$dynamicAnchor:gB,title:_B,type:vB,properties:yB}})),SB=i({$dynamicAnchor:()=>EB,$id:()=>wB,$schema:()=>CB,$vocabulary:()=>TB,default:()=>AB,properties:()=>kB,title:()=>DB,type:()=>OB}),CB,wB,TB,EB,DB,OB,kB,AB,jB=n((()=>{CB=`https://json-schema.org/draft/2020-12/schema`,wB=`https://json-schema.org/draft/2020-12/meta/meta-data`,TB={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},EB=`meta`,DB=`Meta-data vocabulary meta-schema`,OB=[`object`,`boolean`],kB={title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}},AB={$schema:CB,$id:wB,$vocabulary:TB,$dynamicAnchor:EB,title:DB,type:OB,properties:kB}})),MB=i({$defs:()=>BB,$dynamicAnchor:()=>IB,$id:()=>PB,$schema:()=>NB,$vocabulary:()=>FB,default:()=>VB,properties:()=>zB,title:()=>LB,type:()=>RB}),NB,PB,FB,IB,LB,RB,zB,BB,VB,HB=n((()=>{NB=`https://json-schema.org/draft/2020-12/schema`,PB=`https://json-schema.org/draft/2020-12/meta/validation`,FB={"https://json-schema.org/draft/2020-12/vocab/validation":!0},IB=`meta`,LB=`Validation vocabulary meta-schema`,RB=[`object`,`boolean`],zB={type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},BB={nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},VB={$schema:NB,$id:PB,$vocabulary:FB,$dynamicAnchor:IB,title:LB,type:RB,properties:zB,$defs:BB}})),UB=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(Cz(),e(fz).default),r=(Pz(),e(wz).default),i=(Wz(),e(Fz).default),a=(eB(),e(Gz).default),o=(dB(),e(tB).default),s=(xB(),e(fB).default),c=(jB(),e(SB).default),l=(HB(),e(MB).default),u=[`/properties`];function d(e){return[n,r,i,a,o,t(this,s),c,t(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,n){return e?t.$dataMetaSchema(n,u):n}}t.default=d})),WB=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;var n=UI(),r=dz(),i=OL(),a=UB(),o=`https://json-schema.org/draft/2020-12/schema`,s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s;var c=DI();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return c.KeywordCxt}});var l=X();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return l.CodeGen}});var u=OI();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return u.default}});var d=kI();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return d.default}})})),GB=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:E,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:w},double:{type:`number`,validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}var s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}var d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}var h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}var v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(e){return v.lastIndex=0,v.test(e)}var b=-(2**31),x=2**31-1;function S(e){return Number.isInteger(e)&&e<=x&&e>=b}function C(e){return Number.isInteger(e)}function w(){return!0}var T=/[^\\]\\Z/;function E(e){if(T.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),KB=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatLimitDefinition=void 0;var t=RL(),n=X(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),qB=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});var n=GB(),r=KB(),i=X(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s})),JB=a(((e,t)=>{var n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f,SEP:`/`},h={...m,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}})),YB=a((e=>{var{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=JB();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),XB=a(((e,t)=>{var n=YB(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=JB(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,ee=0,te=0,ne=!1,re=!1,ie=!1,ae=!1,oe=!1,se=!1,ce=!1,O=!1,le=!1,ue=!1,de=0,k,A,fe={value:``,depth:0,isGlob:!1},pe=()=>D>=x,me=()=>E.charCodeAt(D+1),he=()=>(k=A,E.charCodeAt(++D));for(;D<x;){A=he();let e;if(A===a){ce=fe.backslashes=!0,A=he(),A===u&&(se=!0);continue}if(se===!0||A===u){for(de++;pe()!==!0&&(A=he());){if(A===a){ce=fe.backslashes=!0,he();continue}if(A===u){de++;continue}if(se!==!0&&A===s&&(A=he())===s){if(ne=fe.isBrace=!0,ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(se!==!0&&A===o){if(ne=fe.isBrace=!0,ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(A===h&&(de--,de===0)){se=!1,ne=fe.isBrace=!0,ue=!0;break}}if(S===!0)continue;break}if(A===l){if(C.push(D),w.push(fe),fe={value:``,depth:0,isGlob:!1},ue===!0)continue;if(k===s&&D===ee+1){ee+=2;continue}te=D+1;continue}if(b.noext!==!0&&(A===p||A===i||A===r||A===m||A===c)&&me()===d){if(ie=fe.isGlob=!0,ae=fe.isExtglob=!0,ue=!0,A===c&&D===ee&&(le=!0),S===!0){for(;pe()!==!0&&(A=he());){if(A===a){ce=fe.backslashes=!0,A=he();continue}if(A===g){ie=fe.isGlob=!0,ue=!0;break}}continue}break}if(A===r){if(k===r&&(oe=fe.isGlobstar=!0),ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(A===m){if(ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(A===f){for(;pe()!==!0&&(e=he());){if(e===a){ce=fe.backslashes=!0,he();continue}if(e===_){re=fe.isBracket=!0,ie=fe.isGlob=!0,ue=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&A===c&&D===ee){O=fe.negated=!0,ee++;continue}if(b.noparen!==!0&&A===d){if(ie=fe.isGlob=!0,S===!0){for(;pe()!==!0&&(A=he());){if(A===d){ce=fe.backslashes=!0,A=he();continue}if(A===g){ue=!0;break}}continue}break}if(ie===!0){if(ue=!0,S===!0)continue;break}}b.noext===!0&&(ae=!1,ie=!1);let ge=E,_e=``,ve=``;ee>0&&(_e=E.slice(0,ee),E=E.slice(ee),te-=ee),ge&&ie===!0&&te>0?(ge=E.slice(0,te),ve=E.slice(te)):ie===!0?(ge=``,ve=E):ge=E,ge&&ge!==``&&ge!==`/`&&ge!==E&&v(ge.charCodeAt(ge.length-1))&&(ge=ge.slice(0,-1)),b.unescape===!0&&(ve&&=n.removeBackslashes(ve),ge&&ce===!0&&(ge=n.removeBackslashes(ge)));let ye={prefix:_e,input:e,start:ee,base:ge,glob:ve,isBrace:ne,isBracket:re,isGlob:ie,isExtglob:ae,isGlobstar:oe,negated:O,negatedExtglob:le};if(b.tokens===!0&&(ye.maxDepth=0,v(A)||w.push(fe),ye.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:ee,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&ee!==0?(w[n].isPrefix=!0,w[n].value=_e):w[n].value=a,y(w[n]),ye.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),ye.maxDepth+=w[w.length-1].depth)}ye.slashes=C,ye.parts=T}return ye}})),ZB=a(((e,t)=>{var n=JB(),r=YB(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:ee,QMARK:te,QMARK_NO_DOT:ne,STAR:re,START_ANCHOR:ie}=_,ae=e=>`(${g}(?:(?!${ie}${e.dot?T:x}).)*?)`,oe=d.dot?``:E,se=d.dot?te:ne,ce=d.bash===!0?ae(d):re;d.capture&&(ce=`(${ce})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let O={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,O),p=e.length;let le=[],ue=[],de=[],k=m,A,fe=()=>O.index===p-1,pe=O.peek=(t=1)=>e[O.index+t],me=O.advance=()=>e[++O.index]||``,he=()=>e.slice(O.index+1),ge=(e=``,t=0)=>{O.consumed+=e,O.index+=t},_e=e=>{O.output+=e.output==null?e.value:e.output,ge(e.value)},ve=()=>{let e=1;for(;pe()===`!`&&(pe(2)!==`(`||pe(3)===`?`);)me(),O.start++,e++;return e%2==0?!1:(O.negated=!0,O.start++,!0)},ye=e=>{O[e]++,de.push(e)},be=e=>{O[e]--,de.pop()},xe=e=>{if(k.type===`globstar`){let t=O.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||le.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(O.output=O.output.slice(0,-k.output.length),k.type=`star`,k.value=`*`,k.output=ce,O.output+=k.output)}if(le.length&&e.type!==`paren`&&(le[le.length-1].inner+=e.value),(e.value||e.output)&&_e(e),k&&k.type===`text`&&e.type===`text`){k.output=(k.output||k.value)+e.value,k.value+=e.value;return}e.prev=k,h.push(e),k=e},Se=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=k,n.parens=O.parens,n.output=O.output,n.startIndex=O.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ye(`parens`),xe({type:e,value:t,output:O.output?``:w}),xe({type:`paren`,extglob:!0,value:me(),output:r}),le.push(n)},Ce=n=>{let i=e.slice(n.startIndex,O.index+1),a=y(e.slice(n.startIndex+2,O.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:w)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;O.output=n.output+t.output,O.backtrack=!0,xe({type:`paren`,extglob:!0,value:A,output:``}),be(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=ce;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ae(d)),(e!==ce||fe()||/^\)+$/.test(he()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=he())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${b(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(O.negatedExtglob=!0)}xe({type:`paren`,extglob:!0,value:A,output:o}),be(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?te.repeat(a.length):``):o===0?se+(a?te.repeat(a.length):``):te.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?ce:``):ce:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(O.output=e,O):(O.output=r.wrapOutput(i,O,t),O)}for(;!fe();){if(A=me(),A===`\0`)continue;if(A===`\\`){let e=pe();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){A+=`\\`,xe({type:`text`,value:A});continue}let t=/^\\+/.exec(he()),n=0;if(t&&t[0].length>2&&(n=t[0].length,O.index+=n,n%2!=0&&(A+=`\\`)),d.unescape===!0?A=me():A+=me(),O.brackets===0){xe({type:`text`,value:A});continue}}if(O.brackets>0&&(A!==`]`||k.value===`[`||k.value===`[^`)){if(d.posix!==!1&&A===`:`){let e=k.value.slice(1);if(e.includes(`[`)&&(k.posix=!0,e.includes(`:`))){let e=k.value.lastIndexOf(`[`),t=k.value.slice(0,e),n=a[k.value.slice(e+2)];if(n){k.value=t+n,O.backtrack=!0,me(),!m.output&&h.indexOf(k)===1&&(m.output=w);continue}}}(A===`[`&&pe()!==`:`||A===`-`&&pe()===`]`)&&(A=`\\${A}`),A===`]`&&(k.value===`[`||k.value===`[^`)&&(A=`\\${A}`),d.posix===!0&&A===`!`&&k.value===`[`&&(A=`^`),k.value+=A,_e({value:A});continue}if(O.quotes===1&&A!==`"`){A=r.escapeRegex(A),k.value+=A,_e({value:A});continue}if(A===`"`){O.quotes=O.quotes===1?0:1,d.keepQuotes===!0&&xe({type:`text`,value:A});continue}if(A===`(`){ye(`parens`),xe({type:`paren`,value:A});continue}if(A===`)`){if(O.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=le[le.length-1];if(e&&O.parens===e.parens+1){Ce(le.pop());continue}xe({type:`paren`,value:A,output:O.parens?`)`:`\\)`}),be(`parens`);continue}if(A===`[`){if(d.nobracket===!0||!he().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));A=`\\${A}`}else ye(`brackets`);xe({type:`bracket`,value:A});continue}if(A===`]`){if(d.nobracket===!0||k&&k.type===`bracket`&&k.value.length===1){xe({type:`text`,value:A,output:`\\${A}`});continue}if(O.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));xe({type:`text`,value:A,output:`\\${A}`});continue}be(`brackets`);let e=k.value.slice(1);if(k.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(A=`/${A}`),k.value+=A,_e({value:A}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(k.value);if(O.output=O.output.slice(0,-k.value.length),d.literalBrackets===!0){O.output+=t,k.value=t;continue}k.value=`(${g}${t}|${k.value})`,O.output+=k.value;continue}if(A===`{`&&d.nobrace!==!0){ye(`braces`);let e={type:`brace`,value:A,output:`(`,outputIndex:O.output.length,tokensIndex:O.tokens.length};ue.push(e),xe(e);continue}if(A===`}`){let e=ue[ue.length-1];if(d.nobrace===!0||!e){xe({type:`text`,value:A,output:A});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),O.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=O.output.slice(0,e.outputIndex),r=O.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,A=t=`\\}`,O.output=n;for(let e of r)O.output+=e.output||e.value}xe({type:`brace`,value:A,output:t}),be(`braces`),ue.pop();continue}if(A===`|`){le.length>0&&le[le.length-1].conditions++,xe({type:`text`,value:A});continue}if(A===`,`){let e=A,t=ue[ue.length-1];t&&de[de.length-1]===`braces`&&(t.comma=!0,e=`|`),xe({type:`comma`,value:A,output:e});continue}if(A===`/`){if(k.type===`dot`&&O.index===O.start+1){O.start=O.index+1,O.consumed=``,O.output=``,h.pop(),k=m;continue}xe({type:`slash`,value:A,output:C});continue}if(A===`.`){if(O.braces>0&&k.type===`dot`){k.value===`.`&&(k.output=x);let e=ue[ue.length-1];k.type=`dots`,k.output+=A,k.value+=A,e.dots=!0;continue}if(O.braces+O.parens===0&&k.type!==`bos`&&k.type!==`slash`){xe({type:`text`,value:A,output:x});continue}xe({type:`dot`,value:A,output:x});continue}if(A===`?`){if(!(k&&k.value===`(`)&&d.noextglob!==!0&&pe()===`(`&&pe(2)!==`?`){Se(`qmark`,A);continue}if(k&&k.type===`paren`){let e=pe(),t=A;(k.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(he()))&&(t=`\\${A}`),xe({type:`text`,value:A,output:t});continue}if(d.dot!==!0&&(k.type===`slash`||k.type===`bos`)){xe({type:`qmark`,value:A,output:ne});continue}xe({type:`qmark`,value:A,output:te});continue}if(A===`!`){if(d.noextglob!==!0&&pe()===`(`&&(pe(2)!==`?`||!/[!=<:]/.test(pe(3)))){Se(`negate`,A);continue}if(d.nonegate!==!0&&O.index===0){ve();continue}}if(A===`+`){if(d.noextglob!==!0&&pe()===`(`&&pe(2)!==`?`){Se(`plus`,A);continue}if(k&&k.value===`(`||d.regex===!1){xe({type:`plus`,value:A,output:S});continue}if(k&&(k.type===`bracket`||k.type===`paren`||k.type===`brace`)||O.parens>0){xe({type:`plus`,value:A});continue}xe({type:`plus`,value:S});continue}if(A===`@`){if(d.noextglob!==!0&&pe()===`(`&&pe(2)!==`?`){xe({type:`at`,extglob:!0,value:A,output:``});continue}xe({type:`text`,value:A});continue}if(A!==`*`){(A===`$`||A===`^`)&&(A=`\\${A}`);let e=o.exec(he());e&&(A+=e[0],O.index+=e[0].length),xe({type:`text`,value:A});continue}if(k&&(k.type===`globstar`||k.star===!0)){k.type=`star`,k.star=!0,k.value+=A,k.output=ce,O.backtrack=!0,O.globstar=!0,ge(A);continue}let t=he();if(d.noextglob!==!0&&/^\([^?]/.test(t)){Se(`star`,A);continue}if(k.type===`star`){if(d.noglobstar===!0){ge(A);continue}let n=k.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){xe({type:`star`,value:A,output:``});continue}let o=O.braces>0&&(n.type===`comma`||n.type===`brace`),s=le.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){xe({type:`star`,value:A,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[O.index+4];if(n&&n!==`/`)break;t=t.slice(3),ge(`/**`,3)}if(n.type===`bos`&&fe()){k.type=`globstar`,k.value+=A,k.output=ae(d),O.output=k.output,O.globstar=!0,ge(A);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&fe()){O.output=O.output.slice(0,-(n.output+k.output).length),n.output=`(?:${n.output}`,k.type=`globstar`,k.output=ae(d)+(d.strictSlashes?`)`:`|$)`),k.value+=A,O.globstar=!0,O.output+=n.output+k.output,ge(A);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;O.output=O.output.slice(0,-(n.output+k.output).length),n.output=`(?:${n.output}`,k.type=`globstar`,k.output=`${ae(d)}${C}|${C}${e})`,k.value+=A,O.output+=n.output+k.output,O.globstar=!0,ge(A+me()),xe({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){k.type=`globstar`,k.value+=A,k.output=`(?:^|${C}|${ae(d)}${C})`,O.output=k.output,O.globstar=!0,ge(A+me()),xe({type:`slash`,value:`/`,output:``});continue}O.output=O.output.slice(0,-k.output.length),k.type=`globstar`,k.output=ae(d),k.value+=A,O.output+=k.output,O.globstar=!0,ge(A);continue}let n={type:`star`,value:A,output:ce};if(d.bash===!0){n.output=`.*?`,(k.type===`bos`||k.type===`slash`)&&(n.output=oe+n.output),xe(n);continue}if(k&&(k.type===`bracket`||k.type===`paren`)&&d.regex===!0){n.output=A,xe(n);continue}(O.index===O.start||k.type===`slash`||k.type===`dot`)&&(k.type===`dot`?(O.output+=D,k.output+=D):d.dot===!0?(O.output+=ee,k.output+=ee):(O.output+=oe,k.output+=oe),pe()!==`*`&&(O.output+=w,k.output+=w)),xe(n)}for(;O.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));O.output=r.escapeLast(O.output,`[`),be(`brackets`)}for(;O.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));O.output=r.escapeLast(O.output,`(`),be(`parens`)}for(;O.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));O.output=r.escapeLast(O.output,`{`),be(`braces`)}if(d.strictSlashes!==!0&&(k.type===`star`||k.type===`bracket`)&&xe({type:`maybe_slash`,value:``,output:`${C}?`}),O.backtrack===!0){O.output=``;for(let e of O.tokens)O.output+=e.output==null?e.value:e.output,e.suffix&&(O.output+=e.suffix)}return O};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),QB=a(((e,t)=>{var n=XB(),r=ZB(),i=YB(),a=JB(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),$B=a(((e,t)=>{var n=QB(),r=YB();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})),eV=r(RL(),1),tV=r(uz(),1),nV=r(WB(),1),rV=r(qB(),1),iV=r($B(),1),aV=()=>Error(`Node APIs are not available in browser context.`),oV=()=>{throw aV()},sV={access:(e,t)=>t(aV()),accessSync:oV,readFile:(e,t,n)=>n(aV()),readFileSync:oV},cV={},lV=a(((e,t)=>{var{flatTokensSymbol:n,htmlFlowSymbol:r,newlineRe:i}=Fe();function a(e){return Object.hasOwn(e,r)}function o(e){let{text:t,type:n}=e;if(n===`htmlFlow`&&t.startsWith(`<!--`)&&t.endsWith(`-->`)){let e=t.slice(4,-3);return!e.startsWith(`>`)&&!e.startsWith(`->`)&&!e.endsWith(`-`)}return!1}function s(e,t,n){for(let r=t;r<=n;r++)e.add(r)}function c(e,t,n){let r=[],i=[{array:e,index:0}];for(;i.length>0;){let e=i[i.length-1],{array:a,index:o}=e;if(o<a.length){let o=a[e.index++];t(o)&&r.push(o);let{children:s}=o;if(s.length>0){let e=n?n(o):s;i.push({array:e,index:0})}}else i.pop()}return r}function l(e,t,r){let i=e=>t.includes(e.type)&&(r||!a(e)),o=e[n];return o?o.filter(i):c(e,i)}function u(e,t,n=1){return l(e,[`blockQuotePrefix`,`linePrefix`]).filter(e=>e.startLine===t).map(e=>e.text).join(``).trimEnd().concat(`
|
|
374
|
+
deps: ${r}}`};var i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),fL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),pL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xI(),n=X(),r=mI(),i=pI();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),mL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=DI(),n=xI(),r=pI(),i=pL();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),hL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xI(),n=X(),r=pI(),i=pI();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),gL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),_L=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:xI().validateUnion,error:{message:`must match a schema in anyOf`}}})),vL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),yL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),bL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),xL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),SL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=oL(),n=cL(),r=sL(),i=lL(),a=uL(),o=dL(),s=fL(),c=pL(),l=mL(),u=hL(),d=gL(),f=_L(),p=vL(),m=yL(),h=bL(),g=xL();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),CL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),wL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=[CL().default]})),TL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),EL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=KI(),n=aL(),r=SL(),i=wL(),a=TL();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),DL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),OL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=DL(),r=AI(),i=kI(),a=pI();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),kL=i({$id:()=>jL,$schema:()=>AL,default:()=>IL,definitions:()=>NL,properties:()=>FL,title:()=>ML,type:()=>PL}),AL,jL,ML,NL,PL,FL,IL,LL=n((()=>{AL=`http://json-schema.org/draft-07/schema#`,jL=`http://json-schema.org/draft-07/schema#`,ML=`Core schema meta-schema`,NL={schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},PL=[`object`,`boolean`],FL={$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},IL={$schema:AL,$id:jL,title:ML,definitions:NL,type:PL,properties:FL,default:!0}})),RL=a(((t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=UI(),i=EL(),a=OL(),o=(LL(),e(kL).default),s=[`/properties`],c=`http://json-schema.org/draft-07/schema`,l=class extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(e,c,!1),this.refs[`http://json-schema.org/schema`]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};t.Ajv=l,n.exports=t=l,n.exports.Ajv=l,Object.defineProperty(t,`__esModule`,{value:!0}),t.default=l;var u=DI();Object.defineProperty(t,`KeywordCxt`,{enumerable:!0,get:function(){return u.KeywordCxt}});var d=X();Object.defineProperty(t,`_`,{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,`str`,{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,`stringify`,{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,`nil`,{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,`Name`,{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,`CodeGen`,{enumerable:!0,get:function(){return d.CodeGen}});var f=OI();Object.defineProperty(t,`ValidationError`,{enumerable:!0,get:function(){return f.default}});var p=kI();Object.defineProperty(t,`MissingRefError`,{enumerable:!0,get:function(){return p.default}})})),zL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicAnchor=void 0;var t=X(),n=mI(),r=AI(),i=GI(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),BL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicRef=void 0;var t=X(),n=mI(),r=GI(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),VL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=zL(),n=pI();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),HL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=BL();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),UL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=zL(),n=BL(),r=VL(),i=HL();e.default=[t.default,n.default,r.default,i.default]})),WL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=dL();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),GL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=dL();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),KL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),qL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=WL(),n=GL(),r=KL();e.default=[t.default,n.default,r.default]})),JL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI(),r=mI();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),YL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=pI();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),XL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=JL(),n=YL();e.default=[t.default,n.default]})),ZL=i({$id:()=>$L,$recursiveAnchor:()=>!0,$schema:()=>QL,$vocabulary:()=>eR,allOf:()=>nR,default:()=>aR,properties:()=>iR,title:()=>tR,type:()=>rR}),QL,$L,eR,tR,nR,rR,iR,aR,oR=n((()=>{QL=`https://json-schema.org/draft/2019-09/schema`,$L=`https://json-schema.org/draft/2019-09/schema`,eR={"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},tR=`Core and Validation specifications meta-schema`,nR=[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format`},{$ref:`meta/content`}],rR=[`object`,`boolean`],iR={definitions:{$comment:`While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.`,type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},dependencies:{$comment:`"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"`,type:`object`,additionalProperties:{anyOf:[{$recursiveRef:`#`},{$ref:`meta/validation#/$defs/stringArray`}]}}},aR={$schema:QL,$id:$L,$vocabulary:eR,$recursiveAnchor:!0,title:tR,allOf:nR,type:rR,properties:iR}})),sR=i({$defs:()=>mR,$id:()=>lR,$recursiveAnchor:()=>!0,$schema:()=>cR,$vocabulary:()=>uR,default:()=>hR,properties:()=>pR,title:()=>dR,type:()=>fR}),cR,lR,uR,dR,fR,pR,mR,hR,gR=n((()=>{cR=`https://json-schema.org/draft/2019-09/schema`,lR=`https://json-schema.org/draft/2019-09/meta/applicator`,uR={"https://json-schema.org/draft/2019-09/vocab/applicator":!0},dR=`Applicator vocabulary meta-schema`,fR=[`object`,`boolean`],pR={additionalItems:{$recursiveRef:`#`},unevaluatedItems:{$recursiveRef:`#`},items:{anyOf:[{$recursiveRef:`#`},{$ref:`#/$defs/schemaArray`}]},contains:{$recursiveRef:`#`},additionalProperties:{$recursiveRef:`#`},unevaluatedProperties:{$recursiveRef:`#`},properties:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$recursiveRef:`#`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$recursiveRef:`#`}},propertyNames:{$recursiveRef:`#`},if:{$recursiveRef:`#`},then:{$recursiveRef:`#`},else:{$recursiveRef:`#`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$recursiveRef:`#`}},mR={schemaArray:{type:`array`,minItems:1,items:{$recursiveRef:`#`}}},hR={$schema:cR,$id:lR,$vocabulary:uR,$recursiveAnchor:!0,title:dR,type:fR,properties:pR,$defs:mR}})),_R=i({$id:()=>yR,$recursiveAnchor:()=>!0,$schema:()=>vR,$vocabulary:()=>bR,default:()=>wR,properties:()=>CR,title:()=>xR,type:()=>SR}),vR,yR,bR,xR,SR,CR,wR,TR=n((()=>{vR=`https://json-schema.org/draft/2019-09/schema`,yR=`https://json-schema.org/draft/2019-09/meta/content`,bR={"https://json-schema.org/draft/2019-09/vocab/content":!0},xR=`Content vocabulary meta-schema`,SR=[`object`,`boolean`],CR={contentMediaType:{type:`string`},contentEncoding:{type:`string`},contentSchema:{$recursiveRef:`#`}},wR={$schema:vR,$id:yR,$vocabulary:bR,$recursiveAnchor:!0,title:xR,type:SR,properties:CR}})),ER=i({$id:()=>OR,$recursiveAnchor:()=>!0,$schema:()=>DR,$vocabulary:()=>kR,default:()=>NR,properties:()=>MR,title:()=>AR,type:()=>jR}),DR,OR,kR,AR,jR,MR,NR,PR=n((()=>{DR=`https://json-schema.org/draft/2019-09/schema`,OR=`https://json-schema.org/draft/2019-09/meta/core`,kR={"https://json-schema.org/draft/2019-09/vocab/core":!0},AR=`Core vocabulary meta-schema`,jR=[`object`,`boolean`],MR={$id:{type:`string`,format:`uri-reference`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{type:`string`,format:`uri`},$anchor:{type:`string`,pattern:`^[A-Za-z][-A-Za-z0-9.:_]*$`},$ref:{type:`string`,format:`uri-reference`},$recursiveRef:{type:`string`,format:`uri-reference`},$recursiveAnchor:{type:`boolean`,default:!1},$vocabulary:{type:`object`,propertyNames:{type:`string`,format:`uri`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}}},NR={$schema:DR,$id:OR,$vocabulary:kR,$recursiveAnchor:!0,title:AR,type:jR,properties:MR}})),FR=i({$id:()=>LR,$recursiveAnchor:()=>!0,$schema:()=>IR,$vocabulary:()=>RR,default:()=>HR,properties:()=>VR,title:()=>zR,type:()=>BR}),IR,LR,RR,zR,BR,VR,HR,UR=n((()=>{IR=`https://json-schema.org/draft/2019-09/schema`,LR=`https://json-schema.org/draft/2019-09/meta/format`,RR={"https://json-schema.org/draft/2019-09/vocab/format":!0},zR=`Format vocabulary meta-schema`,BR=[`object`,`boolean`],VR={format:{type:`string`}},HR={$schema:IR,$id:LR,$vocabulary:RR,$recursiveAnchor:!0,title:zR,type:BR,properties:VR}})),WR=i({$id:()=>KR,$recursiveAnchor:()=>!0,$schema:()=>GR,$vocabulary:()=>qR,default:()=>ZR,properties:()=>XR,title:()=>JR,type:()=>YR}),GR,KR,qR,JR,YR,XR,ZR,QR=n((()=>{GR=`https://json-schema.org/draft/2019-09/schema`,KR=`https://json-schema.org/draft/2019-09/meta/meta-data`,qR={"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},JR=`Meta-data vocabulary meta-schema`,YR=[`object`,`boolean`],XR={title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}},ZR={$schema:GR,$id:KR,$vocabulary:qR,$recursiveAnchor:!0,title:JR,type:YR,properties:XR}})),$R=i({$defs:()=>oz,$id:()=>tz,$recursiveAnchor:()=>!0,$schema:()=>ez,$vocabulary:()=>nz,default:()=>sz,properties:()=>az,title:()=>rz,type:()=>iz}),ez,tz,nz,rz,iz,az,oz,sz,cz=n((()=>{ez=`https://json-schema.org/draft/2019-09/schema`,tz=`https://json-schema.org/draft/2019-09/meta/validation`,nz={"https://json-schema.org/draft/2019-09/vocab/validation":!0},rz=`Validation vocabulary meta-schema`,iz=[`object`,`boolean`],az={multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}},const:!0,enum:{type:`array`,items:!0},type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]}},oz={nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},sz={$schema:ez,$id:tz,$vocabulary:nz,$recursiveAnchor:!0,title:rz,type:iz,properties:az,$defs:oz}})),lz=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(oR(),e(ZL).default),r=(gR(),e(sR).default),i=(TR(),e(_R).default),a=(PR(),e(ER).default),o=(UR(),e(FR).default),s=(QR(),e(WR).default),c=(cz(),e($R).default),l=[`/properties`];function u(e){return[n,r,i,a,t(this,o),s,t(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,n){return e?t.$dataMetaSchema(n,l):n}}t.default=u})),uz=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;var n=UI(),r=EL(),i=UL(),a=qL(),o=XL(),s=OL(),c=lz(),l=`https://json-schema.org/draft/2019-09/schema`,u=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(i.default),r.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(a.default),this.addVocabulary(o.default),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(c.default.call(this,e),this.refs[`http://json-schema.org/schema`]=l)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=u;var d=DI();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return d.KeywordCxt}});var f=X();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return f.CodeGen}});var p=OI();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return p.default}});var m=kI();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return m.default}})})),dz=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=KI(),n=aL(),r=SL(),i=UL(),a=qL(),o=XL(),s=wL(),c=TL();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),fz=i({$comment:()=>bz,$dynamicAnchor:()=>gz,$id:()=>mz,$schema:()=>pz,$vocabulary:()=>hz,allOf:()=>vz,default:()=>Sz,properties:()=>xz,title:()=>_z,type:()=>yz}),pz,mz,hz,gz,_z,vz,yz,bz,xz,Sz,Cz=n((()=>{pz=`https://json-schema.org/draft/2020-12/schema`,mz=`https://json-schema.org/draft/2020-12/schema`,hz={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},gz=`meta`,_z=`Core and Validation specifications meta-schema`,vz=[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],yz=[`object`,`boolean`],bz=`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,xz={definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}},Sz={$schema:pz,$id:mz,$vocabulary:hz,$dynamicAnchor:gz,title:_z,allOf:vz,type:yz,$comment:bz,properties:xz}})),wz=i({$defs:()=>Mz,$dynamicAnchor:()=>Oz,$id:()=>Ez,$schema:()=>Tz,$vocabulary:()=>Dz,default:()=>Nz,properties:()=>jz,title:()=>kz,type:()=>Az}),Tz,Ez,Dz,Oz,kz,Az,jz,Mz,Nz,Pz=n((()=>{Tz=`https://json-schema.org/draft/2020-12/schema`,Ez=`https://json-schema.org/draft/2020-12/meta/applicator`,Dz={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Oz=`meta`,kz=`Applicator vocabulary meta-schema`,Az=[`object`,`boolean`],jz={prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},Mz={schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}},Nz={$schema:Tz,$id:Ez,$vocabulary:Dz,$dynamicAnchor:Oz,title:kz,type:Az,properties:jz,$defs:Mz}})),Fz=i({$dynamicAnchor:()=>zz,$id:()=>Lz,$schema:()=>Iz,$vocabulary:()=>Rz,default:()=>Uz,properties:()=>Hz,title:()=>Bz,type:()=>Vz}),Iz,Lz,Rz,zz,Bz,Vz,Hz,Uz,Wz=n((()=>{Iz=`https://json-schema.org/draft/2020-12/schema`,Lz=`https://json-schema.org/draft/2020-12/meta/unevaluated`,Rz={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},zz=`meta`,Bz=`Unevaluated applicator vocabulary meta-schema`,Vz=[`object`,`boolean`],Hz={unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}},Uz={$schema:Iz,$id:Lz,$vocabulary:Rz,$dynamicAnchor:zz,title:Bz,type:Vz,properties:Hz}})),Gz=i({$dynamicAnchor:()=>Yz,$id:()=>qz,$schema:()=>Kz,$vocabulary:()=>Jz,default:()=>$z,properties:()=>Qz,title:()=>Xz,type:()=>Zz}),Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB=n((()=>{Kz=`https://json-schema.org/draft/2020-12/schema`,qz=`https://json-schema.org/draft/2020-12/meta/content`,Jz={"https://json-schema.org/draft/2020-12/vocab/content":!0},Yz=`meta`,Xz=`Content vocabulary meta-schema`,Zz=[`object`,`boolean`],Qz={contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}},$z={$schema:Kz,$id:qz,$vocabulary:Jz,$dynamicAnchor:Yz,title:Xz,type:Zz,properties:Qz}})),tB=i({$defs:()=>lB,$dynamicAnchor:()=>aB,$id:()=>rB,$schema:()=>nB,$vocabulary:()=>iB,default:()=>uB,properties:()=>cB,title:()=>oB,type:()=>sB}),nB,rB,iB,aB,oB,sB,cB,lB,uB,dB=n((()=>{nB=`https://json-schema.org/draft/2020-12/schema`,rB=`https://json-schema.org/draft/2020-12/meta/core`,iB={"https://json-schema.org/draft/2020-12/vocab/core":!0},aB=`meta`,oB=`Core vocabulary meta-schema`,sB=[`object`,`boolean`],cB={$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},lB={anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}},uB={$schema:nB,$id:rB,$vocabulary:iB,$dynamicAnchor:aB,title:oB,type:sB,properties:cB,$defs:lB}})),fB=i({$dynamicAnchor:()=>gB,$id:()=>mB,$schema:()=>pB,$vocabulary:()=>hB,default:()=>bB,properties:()=>yB,title:()=>_B,type:()=>vB}),pB,mB,hB,gB,_B,vB,yB,bB,xB=n((()=>{pB=`https://json-schema.org/draft/2020-12/schema`,mB=`https://json-schema.org/draft/2020-12/meta/format-annotation`,hB={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},gB=`meta`,_B=`Format vocabulary meta-schema for annotation results`,vB=[`object`,`boolean`],yB={format:{type:`string`}},bB={$schema:pB,$id:mB,$vocabulary:hB,$dynamicAnchor:gB,title:_B,type:vB,properties:yB}})),SB=i({$dynamicAnchor:()=>EB,$id:()=>wB,$schema:()=>CB,$vocabulary:()=>TB,default:()=>AB,properties:()=>kB,title:()=>DB,type:()=>OB}),CB,wB,TB,EB,DB,OB,kB,AB,jB=n((()=>{CB=`https://json-schema.org/draft/2020-12/schema`,wB=`https://json-schema.org/draft/2020-12/meta/meta-data`,TB={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},EB=`meta`,DB=`Meta-data vocabulary meta-schema`,OB=[`object`,`boolean`],kB={title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}},AB={$schema:CB,$id:wB,$vocabulary:TB,$dynamicAnchor:EB,title:DB,type:OB,properties:kB}})),MB=i({$defs:()=>BB,$dynamicAnchor:()=>IB,$id:()=>PB,$schema:()=>NB,$vocabulary:()=>FB,default:()=>VB,properties:()=>zB,title:()=>LB,type:()=>RB}),NB,PB,FB,IB,LB,RB,zB,BB,VB,HB=n((()=>{NB=`https://json-schema.org/draft/2020-12/schema`,PB=`https://json-schema.org/draft/2020-12/meta/validation`,FB={"https://json-schema.org/draft/2020-12/vocab/validation":!0},IB=`meta`,LB=`Validation vocabulary meta-schema`,RB=[`object`,`boolean`],zB={type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},BB={nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},VB={$schema:NB,$id:PB,$vocabulary:FB,$dynamicAnchor:IB,title:LB,type:RB,properties:zB,$defs:BB}})),UB=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(Cz(),e(fz).default),r=(Pz(),e(wz).default),i=(Wz(),e(Fz).default),a=(eB(),e(Gz).default),o=(dB(),e(tB).default),s=(xB(),e(fB).default),c=(jB(),e(SB).default),l=(HB(),e(MB).default),u=[`/properties`];function d(e){return[n,r,i,a,o,t(this,s),c,t(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,n){return e?t.$dataMetaSchema(n,u):n}}t.default=d})),WB=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;var n=UI(),r=dz(),i=OL(),a=UB(),o=`https://json-schema.org/draft/2020-12/schema`,s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s;var c=DI();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return c.KeywordCxt}});var l=X();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return l.CodeGen}});var u=OI();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return u.default}});var d=kI();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return d.default}})})),GB=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:T,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:w},double:{type:`number`,validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}var s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}var d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}var h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}var v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(e){return v.lastIndex=0,v.test(e)}var b=-(2**31),x=2**31-1;function S(e){return Number.isInteger(e)&&e<=x&&e>=b}function C(e){return Number.isInteger(e)}function w(){return!0}var ee=/[^\\]\\Z/;function T(e){if(ee.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),KB=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatLimitDefinition=void 0;var t=RL(),n=X(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),qB=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});var n=GB(),r=KB(),i=X(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s})),JB=a(((e,t)=>{var n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f,SEP:`/`},h={...m,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}})),YB=a((e=>{var{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=JB();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),XB=a(((e,t)=>{var n=YB(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=JB(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],ee=[],T=e,E=-1,te=0,ne=0,re=!1,ie=!1,ae=!1,oe=!1,se=!1,ce=!1,le=!1,D=!1,ue=!1,de=!1,fe=0,O,k,pe={value:``,depth:0,isGlob:!1},me=()=>E>=x,he=()=>T.charCodeAt(E+1),ge=()=>(O=k,T.charCodeAt(++E));for(;E<x;){k=ge();let e;if(k===a){le=pe.backslashes=!0,k=ge(),k===u&&(ce=!0);continue}if(ce===!0||k===u){for(fe++;me()!==!0&&(k=ge());){if(k===a){le=pe.backslashes=!0,ge();continue}if(k===u){fe++;continue}if(ce!==!0&&k===s&&(k=ge())===s){if(re=pe.isBrace=!0,ae=pe.isGlob=!0,de=!0,S===!0)continue;break}if(ce!==!0&&k===o){if(re=pe.isBrace=!0,ae=pe.isGlob=!0,de=!0,S===!0)continue;break}if(k===h&&(fe--,fe===0)){ce=!1,re=pe.isBrace=!0,de=!0;break}}if(S===!0)continue;break}if(k===l){if(C.push(E),w.push(pe),pe={value:``,depth:0,isGlob:!1},de===!0)continue;if(O===s&&E===te+1){te+=2;continue}ne=E+1;continue}if(b.noext!==!0&&(k===p||k===i||k===r||k===m||k===c)&&he()===d){if(ae=pe.isGlob=!0,oe=pe.isExtglob=!0,de=!0,k===c&&E===te&&(ue=!0),S===!0){for(;me()!==!0&&(k=ge());){if(k===a){le=pe.backslashes=!0,k=ge();continue}if(k===g){ae=pe.isGlob=!0,de=!0;break}}continue}break}if(k===r){if(O===r&&(se=pe.isGlobstar=!0),ae=pe.isGlob=!0,de=!0,S===!0)continue;break}if(k===m){if(ae=pe.isGlob=!0,de=!0,S===!0)continue;break}if(k===f){for(;me()!==!0&&(e=ge());){if(e===a){le=pe.backslashes=!0,ge();continue}if(e===_){ie=pe.isBracket=!0,ae=pe.isGlob=!0,de=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&k===c&&E===te){D=pe.negated=!0,te++;continue}if(b.noparen!==!0&&k===d){if(ae=pe.isGlob=!0,S===!0){for(;me()!==!0&&(k=ge());){if(k===d){le=pe.backslashes=!0,k=ge();continue}if(k===g){de=!0;break}}continue}break}if(ae===!0){if(de=!0,S===!0)continue;break}}b.noext===!0&&(oe=!1,ae=!1);let _e=T,ve=``,ye=``;te>0&&(ve=T.slice(0,te),T=T.slice(te),ne-=te),_e&&ae===!0&&ne>0?(_e=T.slice(0,ne),ye=T.slice(ne)):ae===!0?(_e=``,ye=T):_e=T,_e&&_e!==``&&_e!==`/`&&_e!==T&&v(_e.charCodeAt(_e.length-1))&&(_e=_e.slice(0,-1)),b.unescape===!0&&(ye&&=n.removeBackslashes(ye),_e&&le===!0&&(_e=n.removeBackslashes(_e)));let be={prefix:ve,input:e,start:te,base:_e,glob:ye,isBrace:re,isBracket:ie,isGlob:ae,isExtglob:oe,isGlobstar:se,negated:D,negatedExtglob:ue};if(b.tokens===!0&&(be.maxDepth=0,v(k)||w.push(pe),be.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:te,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&te!==0?(w[n].isPrefix=!0,w[n].value=ve):w[n].value=a,y(w[n]),be.maxDepth+=w[n].depth),(n!==0||a!==``)&&ee.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);ee.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),be.maxDepth+=w[w.length-1].depth)}be.slashes=C,be.parts=ee}return be}})),ZB=a(((e,t)=>{var n=JB(),r=YB(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:ee,NO_DOT:T,NO_DOT_SLASH:E,NO_DOTS_SLASH:te,QMARK:ne,QMARK_NO_DOT:re,STAR:ie,START_ANCHOR:ae}=_,oe=e=>`(${g}(?:(?!${ae}${e.dot?ee:x}).)*?)`,se=d.dot?``:T,ce=d.dot?ne:re,le=d.bash===!0?oe(d):ie;d.capture&&(le=`(${le})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let D={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,D),p=e.length;let ue=[],de=[],fe=[],O=m,k,pe=()=>D.index===p-1,me=D.peek=(t=1)=>e[D.index+t],he=D.advance=()=>e[++D.index]||``,ge=()=>e.slice(D.index+1),_e=(e=``,t=0)=>{D.consumed+=e,D.index+=t},ve=e=>{D.output+=e.output==null?e.value:e.output,_e(e.value)},ye=()=>{let e=1;for(;me()===`!`&&(me(2)!==`(`||me(3)===`?`);)he(),D.start++,e++;return e%2==0?!1:(D.negated=!0,D.start++,!0)},be=e=>{D[e]++,fe.push(e)},xe=e=>{D[e]--,fe.pop()},A=e=>{if(O.type===`globstar`){let t=D.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||ue.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(D.output=D.output.slice(0,-O.output.length),O.type=`star`,O.value=`*`,O.output=le,D.output+=O.output)}if(ue.length&&e.type!==`paren`&&(ue[ue.length-1].inner+=e.value),(e.value||e.output)&&ve(e),O&&O.type===`text`&&e.type===`text`){O.output=(O.output||O.value)+e.value,O.value+=e.value;return}e.prev=O,h.push(e),O=e},Se=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=O,n.parens=D.parens,n.output=D.output,n.startIndex=D.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;be(`parens`),A({type:e,value:t,output:D.output?``:w}),A({type:`paren`,extglob:!0,value:he(),output:r}),ue.push(n)},Ce=n=>{let i=e.slice(n.startIndex,D.index+1),a=y(e.slice(n.startIndex+2,D.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:w)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;D.output=n.output+t.output,D.backtrack=!0,A({type:`paren`,extglob:!0,value:k,output:``}),xe(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=le;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=oe(d)),(e!==le||pe()||/^\)+$/.test(ge()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=ge())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${b(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(D.negatedExtglob=!0)}A({type:`paren`,extglob:!0,value:k,output:o}),xe(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?ne.repeat(a.length):``):o===0?ce+(a?ne.repeat(a.length):``):ne.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?le:``):le:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(D.output=e,D):(D.output=r.wrapOutput(i,D,t),D)}for(;!pe();){if(k=he(),k===`\0`)continue;if(k===`\\`){let e=me();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){k+=`\\`,A({type:`text`,value:k});continue}let t=/^\\+/.exec(ge()),n=0;if(t&&t[0].length>2&&(n=t[0].length,D.index+=n,n%2!=0&&(k+=`\\`)),d.unescape===!0?k=he():k+=he(),D.brackets===0){A({type:`text`,value:k});continue}}if(D.brackets>0&&(k!==`]`||O.value===`[`||O.value===`[^`)){if(d.posix!==!1&&k===`:`){let e=O.value.slice(1);if(e.includes(`[`)&&(O.posix=!0,e.includes(`:`))){let e=O.value.lastIndexOf(`[`),t=O.value.slice(0,e),n=a[O.value.slice(e+2)];if(n){O.value=t+n,D.backtrack=!0,he(),!m.output&&h.indexOf(O)===1&&(m.output=w);continue}}}(k===`[`&&me()!==`:`||k===`-`&&me()===`]`)&&(k=`\\${k}`),k===`]`&&(O.value===`[`||O.value===`[^`)&&(k=`\\${k}`),d.posix===!0&&k===`!`&&O.value===`[`&&(k=`^`),O.value+=k,ve({value:k});continue}if(D.quotes===1&&k!==`"`){k=r.escapeRegex(k),O.value+=k,ve({value:k});continue}if(k===`"`){D.quotes=D.quotes===1?0:1,d.keepQuotes===!0&&A({type:`text`,value:k});continue}if(k===`(`){be(`parens`),A({type:`paren`,value:k});continue}if(k===`)`){if(D.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=ue[ue.length-1];if(e&&D.parens===e.parens+1){Ce(ue.pop());continue}A({type:`paren`,value:k,output:D.parens?`)`:`\\)`}),xe(`parens`);continue}if(k===`[`){if(d.nobracket===!0||!ge().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));k=`\\${k}`}else be(`brackets`);A({type:`bracket`,value:k});continue}if(k===`]`){if(d.nobracket===!0||O&&O.type===`bracket`&&O.value.length===1){A({type:`text`,value:k,output:`\\${k}`});continue}if(D.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));A({type:`text`,value:k,output:`\\${k}`});continue}xe(`brackets`);let e=O.value.slice(1);if(O.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(k=`/${k}`),O.value+=k,ve({value:k}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(O.value);if(D.output=D.output.slice(0,-O.value.length),d.literalBrackets===!0){D.output+=t,O.value=t;continue}O.value=`(${g}${t}|${O.value})`,D.output+=O.value;continue}if(k===`{`&&d.nobrace!==!0){be(`braces`);let e={type:`brace`,value:k,output:`(`,outputIndex:D.output.length,tokensIndex:D.tokens.length};de.push(e),A(e);continue}if(k===`}`){let e=de[de.length-1];if(d.nobrace===!0||!e){A({type:`text`,value:k,output:k});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),D.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,k=t=`\\}`,D.output=n;for(let e of r)D.output+=e.output||e.value}A({type:`brace`,value:k,output:t}),xe(`braces`),de.pop();continue}if(k===`|`){ue.length>0&&ue[ue.length-1].conditions++,A({type:`text`,value:k});continue}if(k===`,`){let e=k,t=de[de.length-1];t&&fe[fe.length-1]===`braces`&&(t.comma=!0,e=`|`),A({type:`comma`,value:k,output:e});continue}if(k===`/`){if(O.type===`dot`&&D.index===D.start+1){D.start=D.index+1,D.consumed=``,D.output=``,h.pop(),O=m;continue}A({type:`slash`,value:k,output:C});continue}if(k===`.`){if(D.braces>0&&O.type===`dot`){O.value===`.`&&(O.output=x);let e=de[de.length-1];O.type=`dots`,O.output+=k,O.value+=k,e.dots=!0;continue}if(D.braces+D.parens===0&&O.type!==`bos`&&O.type!==`slash`){A({type:`text`,value:k,output:x});continue}A({type:`dot`,value:k,output:x});continue}if(k===`?`){if(!(O&&O.value===`(`)&&d.noextglob!==!0&&me()===`(`&&me(2)!==`?`){Se(`qmark`,k);continue}if(O&&O.type===`paren`){let e=me(),t=k;(O.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ge()))&&(t=`\\${k}`),A({type:`text`,value:k,output:t});continue}if(d.dot!==!0&&(O.type===`slash`||O.type===`bos`)){A({type:`qmark`,value:k,output:re});continue}A({type:`qmark`,value:k,output:ne});continue}if(k===`!`){if(d.noextglob!==!0&&me()===`(`&&(me(2)!==`?`||!/[!=<:]/.test(me(3)))){Se(`negate`,k);continue}if(d.nonegate!==!0&&D.index===0){ye();continue}}if(k===`+`){if(d.noextglob!==!0&&me()===`(`&&me(2)!==`?`){Se(`plus`,k);continue}if(O&&O.value===`(`||d.regex===!1){A({type:`plus`,value:k,output:S});continue}if(O&&(O.type===`bracket`||O.type===`paren`||O.type===`brace`)||D.parens>0){A({type:`plus`,value:k});continue}A({type:`plus`,value:S});continue}if(k===`@`){if(d.noextglob!==!0&&me()===`(`&&me(2)!==`?`){A({type:`at`,extglob:!0,value:k,output:``});continue}A({type:`text`,value:k});continue}if(k!==`*`){(k===`$`||k===`^`)&&(k=`\\${k}`);let e=o.exec(ge());e&&(k+=e[0],D.index+=e[0].length),A({type:`text`,value:k});continue}if(O&&(O.type===`globstar`||O.star===!0)){O.type=`star`,O.star=!0,O.value+=k,O.output=le,D.backtrack=!0,D.globstar=!0,_e(k);continue}let t=ge();if(d.noextglob!==!0&&/^\([^?]/.test(t)){Se(`star`,k);continue}if(O.type===`star`){if(d.noglobstar===!0){_e(k);continue}let n=O.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){A({type:`star`,value:k,output:``});continue}let o=D.braces>0&&(n.type===`comma`||n.type===`brace`),s=ue.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){A({type:`star`,value:k,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[D.index+4];if(n&&n!==`/`)break;t=t.slice(3),_e(`/**`,3)}if(n.type===`bos`&&pe()){O.type=`globstar`,O.value+=k,O.output=oe(d),D.output=O.output,D.globstar=!0,_e(k);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&pe()){D.output=D.output.slice(0,-(n.output+O.output).length),n.output=`(?:${n.output}`,O.type=`globstar`,O.output=oe(d)+(d.strictSlashes?`)`:`|$)`),O.value+=k,D.globstar=!0,D.output+=n.output+O.output,_e(k);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;D.output=D.output.slice(0,-(n.output+O.output).length),n.output=`(?:${n.output}`,O.type=`globstar`,O.output=`${oe(d)}${C}|${C}${e})`,O.value+=k,D.output+=n.output+O.output,D.globstar=!0,_e(k+he()),A({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){O.type=`globstar`,O.value+=k,O.output=`(?:^|${C}|${oe(d)}${C})`,D.output=O.output,D.globstar=!0,_e(k+he()),A({type:`slash`,value:`/`,output:``});continue}D.output=D.output.slice(0,-O.output.length),O.type=`globstar`,O.output=oe(d),O.value+=k,D.output+=O.output,D.globstar=!0,_e(k);continue}let n={type:`star`,value:k,output:le};if(d.bash===!0){n.output=`.*?`,(O.type===`bos`||O.type===`slash`)&&(n.output=se+n.output),A(n);continue}if(O&&(O.type===`bracket`||O.type===`paren`)&&d.regex===!0){n.output=k,A(n);continue}(D.index===D.start||O.type===`slash`||O.type===`dot`)&&(O.type===`dot`?(D.output+=E,O.output+=E):d.dot===!0?(D.output+=te,O.output+=te):(D.output+=se,O.output+=se),me()!==`*`&&(D.output+=w,O.output+=w)),A(n)}for(;D.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));D.output=r.escapeLast(D.output,`[`),xe(`brackets`)}for(;D.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));D.output=r.escapeLast(D.output,`(`),xe(`parens`)}for(;D.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));D.output=r.escapeLast(D.output,`{`),xe(`braces`)}if(d.strictSlashes!==!0&&(O.type===`star`||O.type===`bracket`)&&A({type:`maybe_slash`,value:``,output:`${C}?`}),D.backtrack===!0){D.output=``;for(let e of D.tokens)D.output+=e.output==null?e.value:e.output,e.suffix&&(D.output+=e.suffix)}return D};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},ee=w(r.removePrefix(e,x));return ee&&a.strictSlashes!==!0&&(ee+=`${u}?`),ee},t.exports=b})),QB=a(((e,t)=>{var n=XB(),r=ZB(),i=YB(),a=JB(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),$B=a(((e,t)=>{var n=QB(),r=YB();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})),eV=r(RL(),1),tV=r(uz(),1),nV=r(WB(),1),rV=r(qB(),1),iV=r($B(),1),aV=()=>Error(`Node APIs are not available in browser context.`),oV=()=>{throw aV()},sV={access:(e,t)=>t(aV()),accessSync:oV,readFile:(e,t,n)=>n(aV()),readFileSync:oV},cV={},lV=a(((e,t)=>{var{flatTokensSymbol:n,htmlFlowSymbol:r,newlineRe:i}=Fe();function a(e){return Object.hasOwn(e,r)}function o(e){let{text:t,type:n}=e;if(n===`htmlFlow`&&t.startsWith(`<!--`)&&t.endsWith(`-->`)){let e=t.slice(4,-3);return!e.startsWith(`>`)&&!e.startsWith(`->`)&&!e.endsWith(`-`)}return!1}function s(e,t,n){for(let r=t;r<=n;r++)e.add(r)}function c(e,t,n){let r=[],i=[{array:e,index:0}];for(;i.length>0;){let e=i[i.length-1],{array:a,index:o}=e;if(o<a.length){let o=a[e.index++];t(o)&&r.push(o);let{children:s}=o;if(s.length>0){let e=n?n(o):s;i.push({array:e,index:0})}}else i.pop()}return r}function l(e,t,r){let i=e=>t.includes(e.type)&&(r||!a(e)),o=e[n];return o?o.filter(i):c(e,i)}function u(e,t,n=1){return l(e,[`blockQuotePrefix`,`linePrefix`]).filter(e=>e.startLine===t).map(e=>e.text).join(``).trimEnd().concat(`
|
|
375
375
|
`).repeat(n)}function d(e,t){let n=Array.isArray(e)?e:[e];for(let e of t){let t=t=>Array.isArray(e)?e.includes(t.type):e===t.type;n=n.flatMap(e=>e.children.filter(t))}return n}function f(e){let t=1,{text:n}=e.children.find(e=>[`atxHeadingSequence`,`setextHeadingLine`].includes(e.type));return n[0]===`#`?t=Math.min(n.length,6):n[0]===`-`&&(t=2),t}function p(e){return e.type===`setextHeading`?`setext`:e.children.filter(e=>e.type===`atxHeadingSequence`).length===1?`atx`:`atx_closed`}function m(e){return d(e,[[`atxHeadingText`,`setextHeadingText`]]).flatMap(e=>e.children.filter(e=>e.type!==`htmlText`)).map(e=>e.text).join(``).replace(i,` `)}function h(e){let t=/^<([^!>][^/\s>]*)/;if(e.type===`htmlText`){let n=t.exec(e.text);if(n){let e=n[1],t=e.startsWith(`/`);return{close:t,name:t?e.slice(1):e}}}return null}function g(e,t){let n=e;for(;(n=n.parent)&&!t.includes(n.type););return n}var _=/^#tab\//;function v(e){if(e?.type===`atxHeading`){let t=d(e,[`atxHeadingText`]);if(t.length===1&&t[0].children.length===1&&t[0].children[0].type===`link`){let e=l(t[0].children[0].children,[`resourceDestinationString`]);return e.length===1&&_.test(e[0].text)}}return!1}t.exports={addRangeToSet:s,filterByPredicate:c,filterByTypes:l,getBlockQuotePrefixText:u,getDescendantsByType:d,getHeadingLevel:f,getHeadingStyle:p,getHeadingText:m,getHtmlTagInfo:h,getParentOfType:g,inHtmlFlow:a,isDocfxTab:v,isHtmlFlowComment:o,nonContentTokens:new Set([`blockQuoteMarker`,`blockQuotePrefix`,`blockQuotePrefixWhitespace`,`gfmFootnoteDefinitionIndent`,`lineEnding`,`lineEndingBlank`,`linePrefix`,`listItemIndent`,`undefinedReference`,`undefinedReferenceCollapsed`,`undefinedReferenceFull`,`undefinedReferenceShortcut`])}})),Z=r(a(((e,t)=>{var n=lV(),{newlineRe:r,nextLinesRe:i}=Fe();t.exports.newLineRe=r,t.exports.nextLinesRe=i,t.exports.frontMatterRe=/((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m;var a=/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;t.exports.inlineCommentStartRe=a,t.exports.endOfLineHtmlEntityRe=/&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/,t.exports.endOfLineGemojiCodeRe=/:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;var o=`.,;:!?。,;:!?`;t.exports.allPunctuation=o,t.exports.allPunctuationNoQuestion=o.replace(/[??]/gu,``);function s(e){return typeof e==`number`}t.exports.isNumber=s;function c(e){return typeof e==`string`}t.exports.isString=c;function l(e){return e.length===0}t.exports.isEmptyString=l;function u(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}t.exports.isObject=u;function d(e){return!!e&&Object.getPrototypeOf(e)===URL.prototype}t.exports.isUrl=d;function f(e){return Array.isArray(e)?[...e]:e}t.exports.cloneIfArray=f;function p(e){return d(e)?new URL(e):e}t.exports.cloneIfUrl=p,t.exports.getHtmlAttributeRe=function(e){return RegExp(`\\s${e}\\s*=\\s*['"]?([^'"\\s>]*)`,`iu`)};function m(e){return!e||!e.trim()||!(e=>{for(;;){let t=e.indexOf(`<!--`),n=e.indexOf(`-->`);if(n!==-1&&(t===-1||n<t))e=e.slice(n+3);else if(t!==-1&&n!==-1)e=e.slice(0,t)+e.slice(n+3);else if(t!==-1&&n===-1)e=e.slice(0,t);else return e}})(e).replace(/>/g,``).trim()}t.exports.isBlankLine=m;var h=`<!--`,g=`-->`,_=`.`,v=/^ *\|/,y=/[^\r\n]/g,b=/[^ \r\n]/g,x=/ +[\r\n]/g,S=e=>e.replace(y,_);t.exports.clearHtmlCommentText=function(e){let t=0;for(;(t=e.indexOf(h,t))!==-1;){let n=e.indexOf(g,t+2);if(n===-1)break;if(n>t+4){let r=e.slice(t+4,n),i=e.lastIndexOf(`
|
|
376
376
|
`,t)+1,a=e.slice(i,t),o=a.trim().length===0,s=v.test(a)&&r.includes(`
|
|
377
|
-
`);if(o||!(s||r.startsWith(`>`)||r.startsWith(`->`)||r.endsWith(`-`)||r.includes(`--`))){let i=r.replace(b,_).replace(x,S);e=e.slice(0,t+4)+i+e.slice(n)}}t=n+3}return e},t.exports.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)};function C(e,t,n){return e.length<=30||(e=t&&n?e.slice(0,15)+`...`+e.slice(-15):n?`...`+e.slice(-30):e.slice(0,30)+`...`),e}t.exports.ellipsify=C;function w(e,t,n,r,i,a){e({lineNumber:t,detail:n,context:r,range:i,fixInfo:a})}t.exports.addError=w;function
|
|
378
|
-
`),i,a),w(e,t,void 0,n,o,s)}t.exports.addErrorContext=
|
|
377
|
+
`);if(o||!(s||r.startsWith(`>`)||r.startsWith(`->`)||r.endsWith(`-`)||r.includes(`--`))){let i=r.replace(b,_).replace(x,S);e=e.slice(0,t+4)+i+e.slice(n)}}t=n+3}return e},t.exports.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)};function C(e,t,n){return e.length<=30||(e=t&&n?e.slice(0,15)+`...`+e.slice(-15):n?`...`+e.slice(-30):e.slice(0,30)+`...`),e}t.exports.ellipsify=C;function w(e,t,n,r,i,a){e({lineNumber:t,detail:n,context:r,range:i,fixInfo:a})}t.exports.addError=w;function ee(e,t,n,r,i,a,o,s){n!==r&&w(e,t,`Expected: `+n+`; Actual: `+r+(i?`; `+i:``),a,o,s)}t.exports.addErrorDetailIf=ee;function T(e,t,n,i,a,o,s){n=C(n.replace(r,`
|
|
378
|
+
`),i,a),w(e,t,void 0,n,o,s)}t.exports.addErrorContext=T;var E=(e,t,n,r)=>e<n||e===n&&t<=r;t.exports.hasOverlap=function(e,t){let n=E(e.startLine,e.startColumn,t.startLine,t.startColumn),r=n?e:t,i=n?t:e;return E(i.startLine,i.startColumn,r.endLine,r.endColumn)},t.exports.frontMatterHasTitle=function(e,t){let n=t!==void 0&&!t,r=new RegExp(String(t||`^\\s*"?title"?\\s*[:=]`),`i`);return!n&&e.some(e=>r.test(e))};function te(e){let t=e=>e.toLowerCase().trim().replace(/\s+/g,` `),r=e=>e?.children.filter(e=>e.type!==`blockQuotePrefix`).map(e=>e.text).join(``),i=new Map,a=new Map,o=(e,n,r)=>{let o=[e.startLine-1,e.startColumn-1,e.text.length],s=t(n),c=r?a:i,l=c.get(s)||[];l.push(o),c.set(s,l)},s=new Map,c=[],l=[],u=n.filterByTypes(e,[`definition`,`gfmFootnoteDefinition`,`definitionLabelString`,`gfmFootnoteDefinitionLabelString`,`gfmFootnoteCall`,`image`,`link`,`undefinedReferenceCollapsed`,`undefinedReferenceFull`,`undefinedReferenceShortcut`]);for(let e of u){let i=``;switch(e.type){case`definition`:case`gfmFootnoteDefinition`:for(let t=e.startLine;t<=e.endLine;t++)c.push(t-1);break;case`gfmFootnoteDefinitionLabelString`:i=`^`;case`definitionLabelString`:{let r=t(`${i}${e.text}`);if(s.has(r))l.push([r,e.startLine-1]);else{let t=n.getParentOfType(e,[`definition`]),i=t&&n.getDescendantsByType(t,[`definitionDestination`,`definitionDestinationRaw`,`definitionDestinationString`])[0]?.text;s.set(r,[e.startLine-1,i||``])}break}case`gfmFootnoteCall`:case`image`:case`link`:{let t=e.children.length===1,i=e.children.length===2&&!e.children.some(e=>e.type===`resource`),[a]=n.getDescendantsByType(e,[`label`,`labelText`]),[s]=n.getDescendantsByType(e,[`reference`,`referenceString`]),c=r(a);if(!t&&!i){let[n,r]=e.children.filter(e=>[`gfmFootnoteCallMarker`,`gfmFootnoteCallString`].includes(e.type));n&&r&&(c=`${n.text}${r.text}`,t=!0)}(t||i)&&o(e,r(s)||c,t);break}case`undefinedReferenceCollapsed`:case`undefinedReferenceFull`:case`undefinedReferenceShortcut`:o(e,n.getDescendantsByType(e,[`undefinedReference`])[0].children.map(e=>e.text).join(``),e.type===`undefinedReferenceShortcut`);break}}return{references:i,shortcuts:a,definitions:s,duplicateDefinitions:l,definitionLineIndices:c}}t.exports.getReferenceLinkImageData=te;function ne(e,t){let n=0,i=0,a=0,o=e.match(r)||[];for(let e of o)switch(e){case`\r`:n++;break;case`
|
|
379
379
|
`:i++;break;case`\r
|
|
380
380
|
`:a++;break}let s=null;return s=!n&&!i&&!a?t&&t.EOL||`
|
|
381
381
|
`:i>=a&&i>=n?`
|
|
382
382
|
`:a>=n?`\r
|
|
383
|
-
`:`\r`,s}t.exports.getPreferredLineEnding=te;function ne(e,t){let n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e}t.exports.expandTildePath=ne;function re(e){let t={ruleNames:[],lineNumber:-1};return e.filter((e,n,r)=>{delete e.fixInfo,delete e.severity;let i=r[n-1]||t;return e.ruleNames[0]!==i.ruleNames[0]||e.lineNumber!==i.lineNumber})}function ie(e){for(let t of e)t.ruleName=t.ruleNames[0],t.ruleAlias=t.ruleNames[1]||t.ruleName,delete t.ruleNames;return e}function ae(e){let t={};for(let n of e){let e=n.ruleNames[0],r=t[e]||[];r.push(n.lineNumber),t[e]=r}return t}function oe(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i.map(e=>({...e})));return n}t.exports.convertToResultVersion0=function(e){return oe(e,e=>ae(re(e)))},t.exports.convertToResultVersion1=function(e){return oe(e,e=>ie(re(e)))},t.exports.convertToResultVersion2=function(e){return oe(e,re)},t.exports.formatLintResults=function(e){let t=[],n=Object.entries(e||{});n.sort((e,t)=>e[0].localeCompare(t[0]));for(let[e,r]of n)for(let n of r){let{lineNumber:r,ruleNames:i,ruleDescription:a,errorDetail:o,errorContext:s,errorRange:c,severity:l}=n,u=i.join(`/`),d=`:${r}`,f=c&&c[0]||0,p=f?`:${f}`:``,m=a,h=o?` [${o}]`:``,g=s?` [Context: "${s}"]`:``;t.push(`${e}${d}${p} ${l} ${u} ${m}${h}${g}`)}return t}}))(),1),Q=lV(),uV=new Map,dV=void 0;function fV(e){uV.clear(),dV=e}function pV(){return dV?.parsers.micromark.tokens||[]}function mV(e,t){if(uV.has(e))return uV.get(e);let n=t();return uV.set(e,n),n}function $(e,t){return mV(JSON.stringify(arguments),()=>(0,Q.filterByTypes)(pV(),e,t))}function hV(){return mV(hV.name,()=>(0,Z.getReferenceLinkImageData)(pV()))}var gV=`https://github.com/DavidAnson/markdownlint`,_V=`0.41.1`,vV=a(((e,t)=>{function n(){return Ie()}t.exports={requireMarkdownItCjs:n}})),yV=a(((e,n)=>{var r=typeof __non_webpack_require__>`u`?t:__non_webpack_require__,i=(e,t,n=[])=>{let r=e.paths?.(``)||[];return e(t,{paths:[...n,...r]})};n.exports={resolveModule:(e,t)=>i(r.resolve,e,t),resolveModuleCustomResolve:i}})),bV=vV();yV();var xV={names:[`MD001`,`heading-increment`],description:`Heading levels should only increment by one level at a time`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)?1:2**53-1;for(let e of $([`atxHeading`,`setextHeading`])){let r=(0,Q.getHeadingLevel)(e);r>n&&(0,Z.addErrorDetailIf)(t,e.startLine,`h${n+1}`,`h${r}`),n=r}}},SV={names:[`MD003`,`heading-style`],description:`Heading style`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of $([`atxHeading`,`setextHeading`])){let r=(0,Q.getHeadingStyle)(e);if(n===`consistent`&&(n=r),r!==n){let i=(0,Q.getHeadingLevel)(e)<=2;if(!(n===`setext_with_atx`&&(i&&r===`setext`||!i&&r===`atx`))&&!(n===`setext_with_atx_closed`&&(i&&r===`setext`||!i&&r===`atx_closed`))){let a=n;n===`setext_with_atx`?a=i?`setext`:`atx`:n===`setext_with_atx_closed`&&(a=i?`setext`:`atx_closed`),(0,Z.addErrorDetailIf)(t,e.startLine,a,r)}}}}},CV=e=>e===`-`?`dash`:e===`+`?`plus`:`asterisk`,wV=e=>e===`dash`?`-`:e===`plus`?`+`:`*`,TV=e=>e===`dash`?`plus`:e===`plus`?`asterisk`:`dash`,EV=new Set([`asterisk`,`consistent`,`dash`,`plus`,`sublist`]),DV={names:[`MD004`,`ul-style`],description:`Unordered list style`,tags:[`bullet`,`ul`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=EV.has(n)?n:`dash`,i=[];for(let e of $([`listUnordered`])){let a=0;if(n===`sublist`){let t=e;for(;t=(0,Q.getParentOfType)(t,[`listOrdered`,`listUnordered`]);)a++}let o=(0,Q.getDescendantsByType)(e,[`listItemPrefix`,`listItemMarker`]);for(let e of o){let o=CV(e.text);n===`sublist`?(i[a]||(i[a]=o===i[a-1]?TV(o):o),r=i[a]):r===`consistent`&&(r=o);let s=e.startColumn,c=e.endColumn-e.startColumn;(0,Z.addErrorDetailIf)(t,e.startLine,r,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:wV(r)})}}}},OV={names:[`MD005`,`list-indent`],description:`Inconsistent indentation for list items at the same level`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){for(let e of $([`listOrdered`,`listUnordered`])){let n=e.startColumn-1,r=0,i=!1,a=e.children.filter(e=>e.type===`listItemPrefix`);for(let o of a){let a=o.startLine,s=o.startColumn-1,c=[1,o.endColumn-1];if(e.type===`listUnordered`)(0,Z.addErrorDetailIf)(t,a,n,s,void 0,void 0,c);else{let e=o.text.trim().length,l=o.startColumn+e-1;if(r||=l,n!==s||i)if(r===l)i=!0;else{let o=i?`Expected: (${r}); Actual: (${l})`:`Expected: ${n}; Actual: ${s}`,u=i?r-e:n,d=i?l-e:s;(0,Z.addError)(t,a,o,void 0,c,{editColumn:Math.min(d,u)+1,deleteCount:Math.max(d-u,0),insertText:``.padEnd(Math.max(u-d,0))})}}}}}},kV=[`blockQuotePrefix`,`listItemPrefix`,`listUnordered`],AV=[`blockQuote`,`listOrdered`,`listUnordered`],jV={names:[`MD007`,`ul-indent`],description:`Unordered list indentation`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){let n=Number(e.config.indent||2),r=!!e.config.start_indented,i=Number(e.config.start_indent||n),a=new Map,o=null,s=$(kV);for(let e of s){let{endColumn:s,parent:c,startColumn:l,startLine:u,type:d}=e;if(d===`blockQuotePrefix`)o=e;else if(d===`listUnordered`){let t=0,n=e;for(;n=(0,Q.getParentOfType)(n,AV);){if(n.type===`listUnordered`){t++;continue}else n.type===`listOrdered`&&(t=-1);break}t>=0&&a.set(e,t)}else{let d=a.get(c);if(d!==void 0){let a=((0,Q.getParentOfType)(e,[`gfmFootnoteDefinition`])?4:0)+(r?i:0)+d*n,c=o?.endLine===u?o.endColumn-1:0,f=l-1-c;(0,Z.addErrorDetailIf)(t,u,a,f,void 0,void 0,[1,s-1],{editColumn:l-f,deleteCount:Math.max(f-a,0),insertText:``.padEnd(Math.max(a-f,0))})}}}}},MV={names:[`MD009`,`no-trailing-spaces`],description:`Trailing spaces`,tags:[`whitespace`],parser:`micromark`,function:function(e,t){let n=e.config.br_spaces;n=Number(n===void 0?2:n);let r=e.config.code_blocks,i=r===void 0?!1:!!r,a=!!e.config.list_item_empty_lines,o=!!e.config.strict,s=new Set;if(!i){for(let e of $([`codeFenced`]))(0,Q.addRangeToSet)(s,e.startLine+1,e.endLine-1);for(let e of $([`codeIndented`]))(0,Q.addRangeToSet)(s,e.startLine,e.endLine)}let c=new Set;if(a)for(let e of $([`listOrdered`,`listUnordered`])){(0,Q.addRangeToSet)(c,e.startLine,e.endLine);let t=!0;for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];switch(r.type){case`content`:t=!1;break;case`listItemIndent`:t&&c.delete(r.startLine);break;case`listItemPrefix`:t=!0;break;default:break}}}let l=new Set,u=new Set;if(o){for(let e of $([`paragraph`]))(0,Q.addRangeToSet)(l,e.startLine,e.endLine-1);for(let e of $([`codeText`]))(0,Q.addRangeToSet)(u,e.startLine,e.endLine-1)}let d=n<2?0:n;for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=n+1,a=r.length-r.trimEnd().length;if(a&&!s.has(i)&&!c.has(i)&&(d!==a||o&&(!l.has(i)||u.has(i)))){let e=r.length-a+1;(0,Z.addError)(t,i,`Expected: `+(d===0?``:`0 or `)+d+`; Actual: `+a,void 0,[e,a],{editColumn:e,deleteCount:a})}}}},NV=/\t+/g,PV={names:[`MD010`,`no-hard-tabs`],description:`Hard tabs`,tags:[`whitespace`,`hard_tab`],parser:`micromark`,function:function(e,t){let n=e.config.code_blocks,r=n===void 0?!0:!!n,i=new Set((e.config.ignore_code_languages||[]).map(e=>String(e).toLowerCase())),a=e.config.spaces_per_tab,o=a===void 0?1:Math.max(0,Number(a)),s=[];r?i.size>0&&s.push(`codeFenced`):s.push(`codeFenced`,`codeIndented`,`codeText`);let c=$(s).filter(e=>e.type===`codeFenced`&&i.size>0?(0,Q.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceInfo`]).every(e=>i.has(e.text.toLowerCase())):!0).map(e=>{let{type:t,startLine:n,startColumn:r,endLine:i,endColumn:a}=e,o=t===`codeFenced`;return{startLine:n+ +!!o,startColumn:o?0:r,endLine:i-+!!o,endColumn:o?2**53-1:a}});for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=null;for(;(i=NV.exec(r))!==null;){let e=n+1,r=i.index+1,a=i[0].length,s={startLine:e,startColumn:r,endLine:e,endColumn:r+a-1};c.some(e=>(0,Z.hasOverlap)(e,s))||(0,Z.addError)(t,e,`Column: `+r,void 0,[r,a],{editColumn:r,deleteCount:a,insertText:``.padEnd(a*o)})}}}},FV=/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g,IV={names:[`MD011`,`no-reversed-links`],description:`Reversed link syntax`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=new Set;for(let e of $([`codeFenced`,`codeIndented`,`mathFlow`]))(0,Q.addRangeToSet)(n,e.startLine,e.endLine);let r=$([`codeText`,`mathText`]);for(let[i,a]of e.lines.entries()){let e=i+1;if(!n.has(e)){let n=null;for(;(n=FV.exec(a))!==null;){let[i,a,o,s]=n;if(!o.endsWith(`\\`)&&!s.endsWith(`\\`)){let c=n.index+a.length+1,l=n[0].length-a.length,u={startLine:e,startColumn:c,endLine:e,endColumn:c+l-1};r.some(e=>(0,Z.hasOverlap)(e,u))||(0,Z.addError)(t,e,i.slice(a.length),void 0,[c,l],{editColumn:c,deleteCount:l,insertText:`[${o}](${s})`})}}}}}},LV={names:[`MD012`,`no-multiple-blanks`],description:`Multiple consecutive blank lines`,tags:[`whitespace`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=Number(e.config.maximum||1),{lines:r}=e,i=new Set;for(let e of $([`codeFenced`,`codeIndented`]))(0,Q.addRangeToSet)(i,e.startLine,e.endLine);let a=0;for(let[e,o]of r.entries())a=i.has(e+1)||o.trim().length>0?0:a+1,n<a&&(0,Z.addErrorDetailIf)(t,e+1,n,a,void 0,void 0,void 0,{deleteCount:-1})}},RV=/^(?:[#>\s]*\s)?\S*$/,zV={names:[`MD013`,`line-length`],description:`Line length`,tags:[`line_length`],parser:`micromark`,function:function(e,t){let n=Number(e.config.line_length||80),r=Number(e.config.heading_line_length||n),i=Number(e.config.code_block_line_length||n),a=!!e.config.strict,o=!!e.config.stern,s=e.config.code_blocks,c=s===void 0?!0:!!s,l=e.config.tables,u=l===void 0?!0:!!l,d=e.config.headings,f=d===void 0?!0:!!d,p=new Set;for(let e of $([`atxHeading`,`setextHeading`]))(0,Q.addRangeToSet)(p,e.startLine,e.endLine);let m=new Set;for(let e of $([`codeFenced`,`codeIndented`]))(0,Q.addRangeToSet)(m,e.startLine,e.endLine);let h=new Set;for(let e of $([`table`]))(0,Q.addRangeToSet)(h,e.startLine,e.endLine);let g=new Set;for(let e of $([`autolink`,`image`,`link`,`literalAutolink`]))(0,Q.addRangeToSet)(g,e.startLine,e.endLine);let _=new Set;for(let e of $([`paragraph`]))for(let t of(0,Q.getDescendantsByType)(e,[`data`]))(0,Q.addRangeToSet)(_,t.startLine,t.endLine);let v=new Set;for(let e of g)_.has(e)||v.add(e);let y=new Set(hV().definitionLineIndices);for(let s=0;s<e.lines.length;s++){let l=e.lines[s],d=s+1,g=p.has(d),_=m.has(d),b=h.has(d),x=_?i:g?r:n,S=a||o?l:l.replace(/\S*$/u,`#`);x>0&&(c||!_)&&(u||!b)&&(f||!g)&&!y.has(s)&&(a||!(o&&RV.test(l))&&!v.has(d))&&S.length>x&&(0,Z.addErrorDetailIf)(t,d,x,l.length,void 0,void 0,[x+1,l.length-x])}}},BV=/^(\s*)(\$\s+)/,VV={names:[`MD014`,`commands-show-output`],description:`Dollar signs used before commands without showing output`,tags:[`code`],parser:`micromark`,function:function(e,t){for(let e of $([`codeFenced`,`codeIndented`])){let n=e.children.filter(e=>e.type===`codeFlowValue`),r=n.map(e=>({result:e.text.match(BV),startColumn:e.startColumn,startLine:e.startLine,text:e.text})).filter(e=>e.result);if(r.length===n.length)for(let e of r){let n=e.startColumn+e.result[1].length,r=e.result[2].length;(0,Z.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[n,r],{editColumn:n,deleteCount:r})}}}},HV={names:[`MD018`,`no-missing-space-atx`],description:`No space after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of $([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Q.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)&&/^#+[^# \t]/.test(i)&&!/#\s*$/.test(i)&&!i.startsWith(`#️⃣`)){let n=/^#+/.exec(i)[0].length;(0,Z.addErrorContext)(t,e+1,i.trim(),void 0,void 0,[1,n+1],{editColumn:n+1,insertText:` `})}}};function UV(e,t,n){let{children:r,startLine:i,text:a}=t,o=n>0?0:r.length-1;for(;r[o]&&r[o].type!==`atxHeadingSequence`;)o+=n;let s=r[o],c=r[o+n];if(s?.type===`atxHeadingSequence`&&c?.type===`whitespace`&&c.text.length>1){let t=c.startColumn+1,r=c.endColumn-t;(0,Z.addErrorContext)(e,i,a.trim(),n>0,n<0,[t,r],{editColumn:t,deleteCount:r})}}var WV=[{names:[`MD019`,`no-multiple-space-atx`],description:`Multiple spaces after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`]).filter(e=>(0,Q.getHeadingStyle)(e)===`atx`);for(let e of n)UV(t,e,1)}},{names:[`MD021`,`no-multiple-space-closed-atx`],description:`Multiple spaces inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`]).filter(e=>(0,Q.getHeadingStyle)(e)===`atx_closed`);for(let e of n)UV(t,e,1),UV(t,e,-1)}}],GV={names:[`MD020`,`no-missing-space-closed-atx`],description:`No space inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of $([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Q.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)){let n=/^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(i);if(n){let[,r,{length:a},o,{length:s},c,l,{length:u}]=n,d=r.length,f=l.length,p=!a,m=!s||!!c,h=c?`${c} `:``;if(p||m){let n=p?[1,d+1]:[i.length-u-f,f+1];(0,Z.addErrorContext)(t,e+1,i.trim(),p,m,n,{editColumn:1,deleteCount:i.length,insertText:`${r} ${o} ${h}${l}`})}}}}},KV=1,qV=e=>{if(Array.isArray(e)){let t=[,,,,,,].fill(KV);for(let[n,r]of[...e.entries()].slice(0,6))t[n]=r;return e=>t[(0,Q.getHeadingLevel)(e)-1]}let t=e===void 0?KV:Number(e);return()=>t},JV=(e,t,n,r)=>t>=0&&t<e.length?e[t]:r&&n.length>0&&t<0&&t>=-n.length?n[n.length+t]:``,YV={names:[`MD022`,`blanks-around-headings`],description:`Headings should be surrounded by blank lines`,tags:[`headings`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=qV(e.config.lines_above),r=qV(e.config.lines_below),i=!!e.config.include_front_matter,{lines:a,frontMatterLines:o}=e,s=$([`blockQuotePrefix`,`linePrefix`]);for(let e of $([`atxHeading`,`setextHeading`])){let{startLine:c,endLine:l}=e,u=a[c-1].trim(),d=n(e);if(d>=0){let e=0;for(let t=0;t<d&&(0,Z.isBlankLine)(JV(a,c-2-t,o,i));t++)e++;(0,Z.addErrorDetailIf)(t,c,d,e,`Above`,u,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(s,c-1,d-e)})}let f=r(e);if(f>=0){let e=0;for(let t=0;t<f&&(0,Z.isBlankLine)(JV(a,l+t,o,!1));t++)e++;(0,Z.addErrorDetailIf)(t,c,f,e,`Below`,u,void 0,{lineNumber:l+1,insertText:(0,Q.getBlockQuotePrefixText)(s,l+1,f-e)})}}}},XV={names:[`MD023`,`heading-start-left`],description:`Headings must start at the beginning of the line`,tags:[`headings`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`,`linePrefix`,`setextHeading`]);for(let r=0;r<n.length-1;r++)if(n[r].type===`linePrefix`&&n[r+1].type!==`linePrefix`&&n[r].startLine===n[r+1].startLine){let{endColumn:i,startColumn:a,startLine:o}=n[r],s=i-a;(0,Z.addErrorContext)(t,o,e.lines[o-1],!0,!1,[a,s],{editColumn:a,deleteCount:s})}}},ZV={names:[`MD024`,`no-duplicate-heading`],description:`Multiple headings with the same content`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.siblings_only,r=[null,[]],i=1,a=r[i];for(let e of $([`atxHeading`,`setextHeading`])){let o=(0,Q.getHeadingText)(e);if(n){let t=(0,Q.getHeadingLevel)(e);for(;i<t;)i++,r[i]=[];for(;i>t;)r[i]=[],i--;a=r[t]}a.includes(o)?(0,Z.addErrorContext)(t,e.startLine,o.trim()):a.push(o)}}},QV={names:[`MD025`,`single-title`,`single-h1`],description:`Multiple top-level headings in the same document`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=Number(e.config.level||1),{tokens:r}=e.parsers.micromark,i=$([`atxHeading`,`setextHeading`]).filter(e=>n===(0,Q.getHeadingLevel)(e)&&!(0,Q.isDocfxTab)(e));if(i.length>0){let n=(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title),a=n;if(a||=r.slice(0,r.indexOf(i[0])).every(e=>Q.nonContentTokens.has(e.type)||(0,Q.isHtmlFlowComment)(e)),a)for(let e of i.slice(+!n))(0,Z.addErrorContext)(t,e.startLine,(0,Q.getHeadingText)(e))}}},$V={names:[`MD026`,`no-trailing-punctuation`],description:`Trailing punctuation in heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?Z.allPunctuationNoQuestion:n);let r=RegExp(`\\s*[`+(0,Z.escapeForRegExp)(n)+`]+$`),i=$([`atxHeadingText`,`setextHeadingText`]);for(let e of i){let{endColumn:n,endLine:i,text:a}=e,o=r.exec(a);if(o&&!Z.endOfLineHtmlEntityRe.test(a)&&!Z.endOfLineGemojiCodeRe.test(a)){let e=o[0],r=e.length,a=n-r;(0,Z.addError)(t,i,`Punctuation: '${e}'`,void 0,[a,r],{editColumn:a,deleteCount:r})}}}},eH=[`listOrdered`,`listUnordered`],tH={names:[`MD027`,`no-multiple-space-blockquote`],description:`Multiple spaces after blockquote symbol`,tags:[`blockquote`,`whitespace`,`indentation`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{tokens:i}=e.parsers.micromark;for(let n of $([`linePrefix`])){let a=n.parent,o=a?.type===`codeIndented`,s=a?.children||i;if(!o&&s[s.indexOf(n)-1]?.type===`blockQuotePrefix`&&(r||!eH.includes(s[s.indexOf(n)+1]?.type)&&!(0,Q.getParentOfType)(n,eH))){let{startColumn:r,startLine:i,text:a}=n,{length:o}=a,s=e.lines[i-1];(0,Z.addErrorContext)(t,i,s,void 0,void 0,[r,o],{editColumn:r,deleteCount:o})}}}},nH=new Set([`lineEnding`,`listItemIndent`,`linePrefix`]),rH={names:[`MD028`,`no-blanks-blockquote`],description:`Blank line inside blockquote`,tags:[`blockquote`,`whitespace`],parser:`micromark`,function:function(e,t){for(let n of $([`blockQuote`])){let r=[],i=n.parent?.children||e.parsers.micromark.tokens;for(let e=i.indexOf(n)+1;e<i.length;e++){let{startLine:n,type:a}=i[e];if(a===`lineEndingBlank`)r.push(n);else if(!nH.has(a))if(a===`blockQuote`){for(let e of r)(0,Z.addError)(t,e);break}else break}}}},iH={one:`1/1/1`,ordered:`1/2/3`,zero:`0/0/0`},aH=Object.keys(iH);function oH(e){let{startColumn:t,endColumn:n,text:r}=(0,Q.getDescendantsByType)(e,[`listItemValue`])[0];return{startColumn:t,endColumn:n,text:r,number:Number(r)}}var sH={names:[`MD029`,`ol-prefix`],description:`Ordered list item prefix`,tags:[`ol`],parser:`micromark`,function:function(e,t){let n=String(e.config.style);for(let e of $([`listOrdered`])){let r=(0,Q.getDescendantsByType)(e,[`listItemPrefix`]),i=1,a=!1,o=!1,s=!1;if(r.length>0){let e=r[0].endColumn;if(o=r.every(t=>t.endColumn===e),r.length>1){let e=oH(r[0]);(oH(r[1]).number!==1||e.number===0)&&(a=!0,e.number===0&&(i=0)),s=e.text.startsWith(`0`)}}let c=aH.includes(n)?n:a?`ordered`:`one`;c===`zero`?i=0:c===`one`&&(i=1);for(let e of r){let n=i.toString(),{endColumn:r,startColumn:a,number:l}=oH(e),u=r-a,d={editColumn:a,deleteCount:u,insertText:o?n.padStart(u,s?`0`:` `):n};(0,Z.addErrorDetailIf)(t,e.startLine,i,l,`Style: `+iH[c],void 0,[e.startColumn,e.endColumn-e.startColumn],d),c===`ordered`&&i++}}}},cH={names:[`MD030`,`list-marker-space`],description:`Spaces after list markers`,tags:[`ol`,`ul`,`whitespace`],parser:`micromark`,function:function(e,t){let n=Number(e.config.ul_single||1),r=Number(e.config.ol_single||1),i=Number(e.config.ul_multi||1),a=Number(e.config.ol_multi||1);for(let e of $([`listOrdered`,`listUnordered`])){let o=e.type===`listOrdered`,s=e.children.filter(e=>e.type===`listItemPrefix`),c=e.endLine-e.startLine+1===s.length,l=o?c?r:a:c?n:i;for(let e of s){let n=[e.startColumn,e.endColumn-e.startColumn],r=e.children.filter(e=>e.type===`listItemPrefixWhitespace`);for(let e of r){let{endColumn:r,startColumn:i,startLine:a}=e,o=r-i;(0,Z.addErrorDetailIf)(t,a,l,o,void 0,void 0,n,{editColumn:i,deleteCount:o,insertText:``.padEnd(l)})}}}}},lH=/^(.*?)[`~]/;function uH(e,t,n,r){let i=t[n-1],[,a]=i.match(lH)||[],o=a===void 0?void 0:{lineNumber:n+ +!r,insertText:`${a.replace(/[^>]/g,` `).trim()}\n`};(0,Z.addErrorContext)(e,n,i.trim(),void 0,void 0,void 0,o)}var dH={names:[`MD031`,`blanks-around-fences`],description:`Fenced code blocks should be surrounded by blank lines`,tags:[`code`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{lines:i}=e;for(let e of $([`codeFenced`]))(r||!(0,Q.getParentOfType)(e,[`listOrdered`,`listUnordered`]))&&((0,Z.isBlankLine)(i[e.startLine-2])||uH(t,i,e.startLine,!0),!(0,Z.isBlankLine)(i[e.endLine])&&!(0,Z.isBlankLine)(i[e.endLine-1])&&uH(t,i,e.endLine,!1))}},fH=e=>e.type===`listOrdered`||e.type===`listUnordered`,pH={names:[`MD032`,`blanks-around-lists`],description:`Lists should be surrounded by blank lines`,tags:[`bullet`,`ul`,`ol`,`blank_lines`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=$([`blockQuotePrefix`,`linePrefix`]),a=(0,Q.filterByPredicate)(r.micromark.tokens,fH,e=>fH(e)||e.type===`htmlFlow`?[]:e.children);for(let e of a){let r=e.startLine;(0,Z.isBlankLine)(n[r-2])||(0,Z.addErrorContext)(t,r,n[r-1].trim(),void 0,void 0,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(i,r)});let a=(0,Q.filterByPredicate)(e.children,e=>!Q.nonContentTokens.has(e.type),e=>Q.nonContentTokens.has(e.type)?[]:e.children),o=(a.length>0?a[a.length-1]:e).endLine;(0,Z.isBlankLine)(n[o])||(0,Z.addErrorContext)(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:(0,Q.getBlockQuotePrefixText)(i,o)})}}},mH=e=>Array.isArray(e)?e.map(e=>String(e).toLowerCase()):[],hH={names:[`MD033`,`no-inline-html`],description:`Inline HTML`,tags:[`html`],parser:`micromark`,function:function(e,t){let n=mH(e.config.allowed_elements),r=mH(e.config.table_allowed_elements||e.config.allowed_elements);for(let e of $([`htmlText`],!0)){let i=(0,Q.getHtmlTagInfo)(e);if(i&&!i.close){let a=i?.name.toLowerCase(),o=!!(0,Q.getParentOfType)(e,[`table`]);if((o||!n.includes(a))&&(!o||!r.includes(a))){let n=[e.startColumn,e.text.replace(Z.nextLinesRe,``).length];(0,Z.addError)(t,e.startLine,`Element: `+i.name,void 0,n)}}}}},gH={names:[`MD034`,`no-bare-urls`],description:`Bare URL used`,tags:[`links`,`url`],parser:`micromark`,function:function(e,t){let n=e=>(0,Q.filterByPredicate)(e,e=>{if(e.type===`literalAutolink`&&!(0,Q.inHtmlFlow)(e)){let t=e.parent?.children,n=t?.indexOf(e),r=t?.at(n-1),i=t?.at(n+1);return!(r&&i&&r.type===`data`&&i.type===`data`&&r.text.endsWith(`<`)&&i.text.startsWith(`>`))}return!1},e=>{let{children:t}=e,n=[];for(let e=0;e<t.length;e++){let r=t[e],i=(0,Q.getHtmlTagInfo)(r);if(i&&!i.close){let n=1;for(let r=e+1;r<t.length;r++){let a=t[r],o=(0,Q.getHtmlTagInfo)(a);if(o&&i.name===o.name)if(o.close){if(n--,n===0){e=r;break}}else n++}}else n.push(r)}return n});for(let r of n(e.parsers.micromark.tokens)){let e=[r.startColumn,r.endColumn-r.startColumn],n={editColumn:e[0],deleteCount:e[1],insertText:`<${r.text}>`};(0,Z.addErrorContext)(t,r.startLine,r.text,void 0,void 0,e,n)}}},_H={names:[`MD035`,`hr-style`],description:`Horizontal rule style`,tags:[`hr`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`).trim(),r=$([`thematicBreak`]);for(let e of r){let{startLine:r,text:i}=e;n===`consistent`&&(n=i),(0,Z.addErrorDetailIf)(t,r,n,i)}}},vH=[[`emphasis`,`emphasisText`],[`strong`,`strongText`]],yH=e=>!(e.type===`htmlText`||e.type===`data`&&e.text.trim().length===0),bH={names:[`MD036`,`no-emphasis-as-heading`],description:`Emphasis used instead of a heading`,tags:[`headings`,`emphasis`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?Z.allPunctuation:n);let r=RegExp(`[`+n+`]$`),i=$([`paragraph`],!0).filter(e=>e.parent?.type===`content`&&(!e.parent?.parent||e.parent?.parent?.type===`htmlFlow`&&!e.parent?.parent?.parent)&&e.children.filter(yH).length===1);for(let e of vH){let n=(0,Q.getDescendantsByType)(i,e);for(let e of n)e.children.length===1&&e.children[0].type===`data`&&!r.test(e.text)&&(0,Z.addErrorContext)(t,e.startLine,e.text)}}},xH={names:[`MD037`,`no-space-in-emphasis`],description:`Spaces inside emphasis markers`,tags:[`whitespace`,`emphasis`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=new Map;for(let e of[`_`,`__`,`___`,`*`,`**`,`***`])i.set(e,[]);let a=(0,Q.filterByPredicate)(r.micromark.tokens,e=>e.children.some(e=>e.type===`data`));for(let e of a){for(let e of i.values())e.length=0;for(let t of e.children){let{text:e,type:n}=t;if(n===`data`&&e.length<=3){let n=i.get(e);n&&!(0,Q.inHtmlFlow)(t)&&n.push(t)}}for(let[e,r]of i)for(let i=0;i+1<r.length;i+=2){let a=r[i],o=n[a.startLine-1].slice(a.endColumn-1).match(/^\s+\S/);if(o){let[n]=o,r=`${e}${n}`,i=a.endColumn,s=n.length-1;(0,Z.addError)(t,a.startLine,void 0,r,[i,s],{editColumn:i,deleteCount:s})}let s=r[i+1],c=n[s.startLine-1].slice(0,s.startColumn-1).match(/\S\s+$/);if(c){let[n]=c,r=`${n}${e}`,i=s.startColumn-(n.length-1),a=n.length-1;(0,Z.addError)(t,s.startLine,void 0,r,[i,a],{editColumn:i,deleteCount:a})}}}}},SH={names:[`MD038`,`no-space-in-code`],description:`Spaces inside code span elements`,tags:[`whitespace`,`code`],parser:`micromark`,function:function(e,t){let n=$([`codeText`]);for(let e of n){let n=(0,Q.getDescendantsByType)(e,[`codeTextData`]);if(n.length>0){let r=(0,Q.getDescendantsByType)(e,[`codeTextPadding`]),i=r[0],a=n[0],o=/^(\s+)(\S)/.exec(a.text)||[null,``,``],s=o[2]==="`",c=o[1].length-(s&&!i?1:0),l=c>0,u=r[r.length-1],d=n[n.length-1],f=/(\S)(\s+)$/.exec(d.text)||[null,``,``],p=f[1]==="`",m=f[2].length-(p&&!u?1:0),h=m>0,g=l&&h&&i&&u&&!s&&!p,_=e.text;if(l){let e=(g?i:a).startColumn,n=c+(g?i.text.length:0);(0,Z.addErrorContext)(t,a.startLine,_,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(h){let e=(g?u:d).endColumn,n=m+(g?u.text.length:0);(0,Z.addErrorContext)(t,d.endLine,_,!1,!0,[e-n,n],{editColumn:e-n,deleteCount:n})}}}}};function CH(e,t,n,r){let i=n.text.match(r?/^[^\S\r\n]+/:/[^\S\r\n]+$/),a=i?[r?n.startColumn:n.endColumn-i[0].length,i[0].length]:void 0;(0,Z.addErrorContext)(e,r?n.startLine+ +!i:n.endLine-+!i,t.text.replace(/\s+/g,` `),r,!r,a,a?{editColumn:a[0],deleteCount:a[1]}:void 0)}var wH={names:[`MD039`,`no-space-in-links`],description:`Spaces inside link text`,tags:[`whitespace`,`links`],parser:`micromark`,function:function(e,t){let n=$([`label`]).filter(e=>e.parent?.type===`link`);for(let e of n){let n=e.children.filter(e=>e.type===`labelText`);for(let r of n)r.text.trimStart().length!==r.text.length&&CH(t,e,r,!0),r.text.trimEnd().length!==r.text.length&&CH(t,e,r,!1)}}},TH={names:[`MD040`,`fenced-code-language`],description:`Fenced code blocks should have a language specified`,tags:[`code`,`language`],parser:`micromark`,function:function(e,t){let n=e.config.allowed_languages;n=Array.isArray(n)?n:[];let r=!!e.config.language_only,i=$([`codeFenced`]);for(let e of i){let i=(0,Q.getDescendantsByType)(e,[`codeFencedFence`])[0],{startLine:a,text:o}=i,s=(0,Q.getDescendantsByType)(i,[`codeFencedFenceInfo`])[0]?.text;s?n.length>0&&!n.includes(s)&&(0,Z.addError)(t,a,`"${s}" is not allowed`):(0,Z.addErrorContext)(t,a,o),r&&(0,Q.getDescendantsByType)(i,[`codeFencedFenceMeta`]).length>0&&(0,Z.addError)(t,a,`Info string contains more than language: "${o}"`)}}},EH=/^h[1-6]$/;function DH(e){let{children:t,type:n}=e;if(n===`htmlFlow`){let e=(0,Q.filterByTypes)(t,[`htmlText`],!0),n=e.length>0&&(0,Q.getHtmlTagInfo)(e[0]);if(n)return n.name.toLowerCase()}return null}var OH={names:[`MD041`,`first-line-heading`,`first-line-h1`],description:`First line in a file should be a top-level heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.allow_preamble,r=Number(e.config.level||1),{tokens:i}=e.parsers.micromark;if(!(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)){let a=0;for(let e of i){let{startLine:t,type:i}=e;if(!Q.nonContentTokens.has(i)&&!(0,Q.isHtmlFlowComment)(e)){let o=null;if(i===`atxHeading`||i===`setextHeading`){(0,Q.getHeadingLevel)(e)!==r&&(a=t);break}else if((o=DH(e))&&EH.test(o)){o!==`h${r}`&&(a=t);break}else if(!n){a=t;break}}}a>0&&(0,Z.addErrorContext)(t,a,e.lines[a-1])}}},kH={names:[`MD042`,`no-empty-links`],description:`No empty links`,tags:[`links`],parser:`micromark`,function:function(e,t){let{definitions:n}=hV(),r=e=>{let t=n.get(e.text.trim());return!!(t&&t[1]===`#`)},i=$([`link`]);for(let e of i){let n=(0,Q.getDescendantsByType)(e,[`label`,`labelText`]),i=(0,Q.getDescendantsByType)(e,[`reference`]),a=(0,Q.getDescendantsByType)(e,[`resource`]),o=(0,Q.getDescendantsByType)(i,[`referenceString`]),s=(0,Q.getDescendantsByType)(a,[`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`]),c=n.length>0,l=i.length>0,u=a.length>0,d=o.length>0,f=s.length>0,p=!1;c&&(!l&&!u||l&&!d)?p=r(n[0]):d&&!f?p=r(o[0]):!d&&f?p=s[0].text.trim()===`#`:!d&&!f&&(p=!0),p&&(0,Z.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[e.startColumn,e.endColumn-e.startColumn])}}},AH={names:[`MD043`,`required-headings`],description:`Required heading structure`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.headings;if(!Array.isArray(n))return;let r=e.config.match_case||!1,i=0,a=!1,o=!1,s=!1,c=()=>String(n[i++]||`[None]`),l=e=>r?e:e.toLowerCase();for(let e of $([`atxHeading`,`setextHeading`]))if(!o){let n=(0,Q.getHeadingText)(e),r=(0,Q.getHeadingLevel)(e);s=!0;let u=`${``.padEnd(r,`#`)} ${n}`,d=c();d===`*`?l(c())!==l(u)&&(a=!0,i--):d===`+`?a=!0:d===`?`||(l(d)===l(u)?a=!1:a?i--:((0,Z.addErrorDetailIf)(t,e.startLine,d,u),o=!0))}let u=n.length-i;!o&&(u>1||u===1&&n[i]!==`*`)&&(s||!n.every(e=>e===`*`))&&(0,Z.addErrorContext)(t,e.lines.length,n[i])}};function jH(e,t,n,r,i,a,o,s,c,l,u,d,f,m,h){let _,v;return y;function y(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),S}function S(t){return t===35?(_=o,w(t)):t===46?(_=s,w(t)):h&&C(t)?re(e,S,`whitespace`)(t):!h&&x(t)?le(e,S)(t):t===null||b(t)||g(t)||p(t)&&t!==45&&t!==95?ce(t):(e.enter(a),e.enter(c),e.consume(t),D)}function w(t){let n=_+`Marker`;return e.enter(a),e.enter(_),e.enter(n),e.consume(t),e.exit(n),T}function T(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||x(t))return n(t);let r=_+`Value`;return e.enter(r),e.consume(t),E}function E(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||x(t)){let n=_+`Value`;return e.exit(n),e.exit(_),e.exit(a),S(t)}return e.consume(t),E}function D(t){return t===null||b(t)||g(t)||p(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),h&&C(t)?re(e,ee,`whitespace`)(t):!h&&x(t)?le(e,ee)(t):ee(t)):(e.consume(t),D)}function ee(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),te):(e.exit(a),S(t))}function te(t){return t===null||t===60||t===61||t===62||t===96||t===125||h&&b(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),v=t,ie):h&&C(t)?re(e,te,`whitespace`)(t):!h&&x(t)?le(e,te)(t):(e.enter(d),e.enter(m),e.consume(t),v=void 0,ne)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||x(t)?(e.exit(m),e.exit(d),e.exit(a),S(t)):(e.consume(t),ne)}function ie(t){return t===v?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),se):(e.enter(d),ae(t))}function ae(t){return t===v?(e.exit(d),ie(t)):t===null?n(t):b(t)?h?n(t):le(e,ae)(t):(e.enter(m),e.consume(t),oe)}function oe(t){return t===v||t===null||b(t)?(e.exit(m),ae(t)):(e.consume(t),oe)}function se(e){return e===125||x(e)?S(e):ce(e)}function ce(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function MH(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):b(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function NH(e,t,n,r){let i=this;return a;function a(t){return t===null||b(t)||p(t)||g(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||b(a)||g(a)||p(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}var PH={tokenize:RH,concrete:!0},FH={tokenize:zH,partial:!0},IH={tokenize:BH,partial:!0},LH={tokenize:VH,partial:!0};function RH(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),NH.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(FH,d,d)(t):d(t)}function d(t){return t===123?e.attempt(IH,f,f)(t):f(t)}function f(t){return re(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?w(i):b(i)?r.interrupt?t(i):e.attempt(LH,m,w)(i):n(i)}function m(t){return t===null?w(t):b(t)?e.check(LH,y,w)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:T,partial:!0},C,a?re(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?C(t):b(t)?e.check(LH,v,C)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,C(t)}return b(t)?e.check(LH,x,S)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function x(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function S(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,C(t)}function C(t){return e.exit(`directiveContainerContent`),w(t)}function w(n){return e.exit(`directiveContainer`),t(n)}function T(e,t,n){let i=0;return re(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),re(e,c,`whitespace`)(t))}function c(r){return r===null||b(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function zH(e,t,n){return MH(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function BH(e,t,n){return jH(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function VH(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var HH={tokenize:GH},UH={tokenize:KH,partial:!0},WH={tokenize:qH,partial:!0};function GH(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),NH.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(UH,s,s)(t):s(t)}function s(t){return t===123?e.attempt(WH,c,c)(t):c(t)}function c(t){return re(e,l,`whitespace`)(t)}function l(r){return r===null||b(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function KH(e,t,n){return MH(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function qH(e,t,n){return jH(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}var JH={tokenize:QH,previous:ZH},YH={tokenize:$H,partial:!0},XH={tokenize:eU,partial:!0};function ZH(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function QH(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),NH.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(YH,o,o)(t):o(t)}function o(t){return t===123?e.attempt(XH,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function $H(e,t,n){return MH(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function eU(e,t,n){return jH(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function tU(){return{text:{58:JH},flow:{58:[PH,HH]}}}var nU=Fe();function rU(){let e={...tU()};return delete e.text,e}function iU(e,t){return e.slice(t.start.offset,t.end.offset)}function aU(e,t={}){let n=[rU(),Ee(),me(),_e(),ZP(),...t.extensions||[]],r=[],i=ue.tokenize;function a(t,n,a){let o=this,s=o.events;return i.call(o,t,n,t=>{let n=s.length;for(;--n>=0;){let[e,t]=s[n];if(e===`enter`){let{type:e}=t;if(e===`labelImage`||e===`labelLink`)break}}if(n>=0){let[,t]=s[n],[,i]=s[s.length-1],a={type:`undefinedReferenceShortcut`,start:t.start,end:i.end},c={type:`undefinedReference`,start:t.start,end:i.end},l=s.slice(n).filter(e=>{let[,t]=e,{type:n}=t;return n===`data`||n===`lineEnding`}),u=r.length>0&&r[r.length-1][0],d=u&&u[1];d&&d.end.line===a.start.line&&d.end.column===a.start.column&&(l.length===0?(d.type=`undefinedReferenceCollapsed`,d.end=i.end):(a.type=`undefinedReferenceFull`,a.start=d.start,r.pop()));let f=l.filter(e=>e[0]===`enter`).map(t=>iU(e,t[1])).join(``).trim();if(f.length>0&&!f.includes(`]`)){let e=[[`enter`,a,o],[`enter`,c,o]];for(let t of l){let[n,r]=t;e.push([n,{...r},o])}e.push([`exit`,c,o],[`exit`,a,o]),r.push(e)}}return a(t)})}try{ue.tokenize=a;let i=se({...t,extensions:n}),o=ge()(e,void 0,!0);return ye(i.document().write(o)).concat(...r)}finally{ue.tokenize=i}}function oU(e,t={},n={},r=0,i=void 0){let a=!!t.freezeTokens,o=aU(e,n),s=[],c=[],l={type:`data`,startLine:-1,startColumn:-1,endLine:-1,endColumn:-1,text:`ROOT`,children:s,parent:null},u=[l],d=l,f=null,p=null,m=!1;for(let s of o){let[o,h]=s,{type:g,start:_,end:v}=h,{column:y,line:b}=_,{column:x,line:S}=v,C=iU(e,h);if(o===`enter`&&!m){let a=d;if(u.push(a),d={type:g,startLine:b+r,startColumn:y,endLine:S+r,endColumn:x,text:C,children:[],parent:a===l?i||null:a},i&&Object.defineProperty(d,nU.htmlFlowSymbol,{value:!0}),a.children.push(d),c.push(d),d.type===`htmlFlow`&&!(0,Q.isHtmlFlowComment)(d)){m=!0,(!f||!p)&&(f={...n,extensions:[{disable:{null:[`codeIndented`,`htmlFlow`]}}]},p=e.split(nU.newlineRe));let r=oU(p.slice(d.startLine-1,d.endLine).join(`
|
|
383
|
+
`:`\r`,s}t.exports.getPreferredLineEnding=ne;function re(e,t){let n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e}t.exports.expandTildePath=re;function ie(e){let t={ruleNames:[],lineNumber:-1};return e.filter((e,n,r)=>{delete e.fixInfo,delete e.severity;let i=r[n-1]||t;return e.ruleNames[0]!==i.ruleNames[0]||e.lineNumber!==i.lineNumber})}function ae(e){for(let t of e)t.ruleName=t.ruleNames[0],t.ruleAlias=t.ruleNames[1]||t.ruleName,delete t.ruleNames;return e}function oe(e){let t={};for(let n of e){let e=n.ruleNames[0],r=t[e]||[];r.push(n.lineNumber),t[e]=r}return t}function se(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i.map(e=>({...e})));return n}t.exports.convertToResultVersion0=function(e){return se(e,e=>oe(ie(e)))},t.exports.convertToResultVersion1=function(e){return se(e,e=>ae(ie(e)))},t.exports.convertToResultVersion2=function(e){return se(e,ie)},t.exports.formatLintResults=function(e){let t=[],n=Object.entries(e||{});n.sort((e,t)=>e[0].localeCompare(t[0]));for(let[e,r]of n)for(let n of r){let{lineNumber:r,ruleNames:i,ruleDescription:a,errorDetail:o,errorContext:s,errorRange:c,severity:l}=n,u=i.join(`/`),d=`:${r}`,f=c&&c[0]||0,p=f?`:${f}`:``,m=a,h=o?` [${o}]`:``,g=s?` [Context: "${s}"]`:``;t.push(`${e}${d}${p} ${l} ${u} ${m}${h}${g}`)}return t}}))(),1),Q=lV(),uV=new Map,dV=void 0;function fV(e){uV.clear(),dV=e}function pV(){return dV?.parsers.micromark.tokens||[]}function mV(e,t){if(uV.has(e))return uV.get(e);let n=t();return uV.set(e,n),n}function $(e,t){return mV(JSON.stringify(arguments),()=>(0,Q.filterByTypes)(pV(),e,t))}function hV(){return mV(hV.name,()=>(0,Z.getReferenceLinkImageData)(pV()))}var gV=`https://github.com/DavidAnson/markdownlint`,_V=`0.41.1`,vV=a(((e,t)=>{function n(){return Ie()}t.exports={requireMarkdownItCjs:n}})),yV=a(((e,n)=>{var r=typeof __non_webpack_require__>`u`?t:__non_webpack_require__,i=(e,t,n=[])=>{let r=e.paths?.(``)||[];return e(t,{paths:[...n,...r]})};n.exports={resolveModule:(e,t)=>i(r.resolve,e,t),resolveModuleCustomResolve:i}})),bV=vV();yV();var xV={names:[`MD001`,`heading-increment`],description:`Heading levels should only increment by one level at a time`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)?1:2**53-1;for(let e of $([`atxHeading`,`setextHeading`])){let r=(0,Q.getHeadingLevel)(e);r>n&&(0,Z.addErrorDetailIf)(t,e.startLine,`h${n+1}`,`h${r}`),n=r}}},SV={names:[`MD003`,`heading-style`],description:`Heading style`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of $([`atxHeading`,`setextHeading`])){let r=(0,Q.getHeadingStyle)(e);if(n===`consistent`&&(n=r),r!==n){let i=(0,Q.getHeadingLevel)(e)<=2;if(!(n===`setext_with_atx`&&(i&&r===`setext`||!i&&r===`atx`))&&!(n===`setext_with_atx_closed`&&(i&&r===`setext`||!i&&r===`atx_closed`))){let a=n;n===`setext_with_atx`?a=i?`setext`:`atx`:n===`setext_with_atx_closed`&&(a=i?`setext`:`atx_closed`),(0,Z.addErrorDetailIf)(t,e.startLine,a,r)}}}}},CV=e=>e===`-`?`dash`:e===`+`?`plus`:`asterisk`,wV=e=>e===`dash`?`-`:e===`plus`?`+`:`*`,TV=e=>e===`dash`?`plus`:e===`plus`?`asterisk`:`dash`,EV=new Set([`asterisk`,`consistent`,`dash`,`plus`,`sublist`]),DV={names:[`MD004`,`ul-style`],description:`Unordered list style`,tags:[`bullet`,`ul`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=EV.has(n)?n:`dash`,i=[];for(let e of $([`listUnordered`])){let a=0;if(n===`sublist`){let t=e;for(;t=(0,Q.getParentOfType)(t,[`listOrdered`,`listUnordered`]);)a++}let o=(0,Q.getDescendantsByType)(e,[`listItemPrefix`,`listItemMarker`]);for(let e of o){let o=CV(e.text);n===`sublist`?(i[a]||(i[a]=o===i[a-1]?TV(o):o),r=i[a]):r===`consistent`&&(r=o);let s=e.startColumn,c=e.endColumn-e.startColumn;(0,Z.addErrorDetailIf)(t,e.startLine,r,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:wV(r)})}}}},OV={names:[`MD005`,`list-indent`],description:`Inconsistent indentation for list items at the same level`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){for(let e of $([`listOrdered`,`listUnordered`])){let n=e.startColumn-1,r=0,i=!1,a=e.children.filter(e=>e.type===`listItemPrefix`);for(let o of a){let a=o.startLine,s=o.startColumn-1,c=[1,o.endColumn-1];if(e.type===`listUnordered`)(0,Z.addErrorDetailIf)(t,a,n,s,void 0,void 0,c);else{let e=o.text.trim().length,l=o.startColumn+e-1;if(r||=l,n!==s||i)if(r===l)i=!0;else{let o=i?`Expected: (${r}); Actual: (${l})`:`Expected: ${n}; Actual: ${s}`,u=i?r-e:n,d=i?l-e:s;(0,Z.addError)(t,a,o,void 0,c,{editColumn:Math.min(d,u)+1,deleteCount:Math.max(d-u,0),insertText:``.padEnd(Math.max(u-d,0))})}}}}}},kV=[`blockQuotePrefix`,`listItemPrefix`,`listUnordered`],AV=[`blockQuote`,`listOrdered`,`listUnordered`],jV={names:[`MD007`,`ul-indent`],description:`Unordered list indentation`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){let n=Number(e.config.indent||2),r=!!e.config.start_indented,i=Number(e.config.start_indent||n),a=new Map,o=null,s=$(kV);for(let e of s){let{endColumn:s,parent:c,startColumn:l,startLine:u,type:d}=e;if(d===`blockQuotePrefix`)o=e;else if(d===`listUnordered`){let t=0,n=e;for(;n=(0,Q.getParentOfType)(n,AV);){if(n.type===`listUnordered`){t++;continue}else n.type===`listOrdered`&&(t=-1);break}t>=0&&a.set(e,t)}else{let d=a.get(c);if(d!==void 0){let a=((0,Q.getParentOfType)(e,[`gfmFootnoteDefinition`])?4:0)+(r?i:0)+d*n,c=o?.endLine===u?o.endColumn-1:0,f=l-1-c;(0,Z.addErrorDetailIf)(t,u,a,f,void 0,void 0,[1,s-1],{editColumn:l-f,deleteCount:Math.max(f-a,0),insertText:``.padEnd(Math.max(a-f,0))})}}}}},MV={names:[`MD009`,`no-trailing-spaces`],description:`Trailing spaces`,tags:[`whitespace`],parser:`micromark`,function:function(e,t){let n=e.config.br_spaces;n=Number(n===void 0?2:n);let r=e.config.code_blocks,i=r===void 0?!1:!!r,a=!!e.config.list_item_empty_lines,o=!!e.config.strict,s=new Set;if(!i){for(let e of $([`codeFenced`]))(0,Q.addRangeToSet)(s,e.startLine+1,e.endLine-1);for(let e of $([`codeIndented`]))(0,Q.addRangeToSet)(s,e.startLine,e.endLine)}let c=new Set;if(a)for(let e of $([`listOrdered`,`listUnordered`])){(0,Q.addRangeToSet)(c,e.startLine,e.endLine);let t=!0;for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];switch(r.type){case`content`:t=!1;break;case`listItemIndent`:t&&c.delete(r.startLine);break;case`listItemPrefix`:t=!0;break;default:break}}}let l=new Set,u=new Set;if(o){for(let e of $([`paragraph`]))(0,Q.addRangeToSet)(l,e.startLine,e.endLine-1);for(let e of $([`codeText`]))(0,Q.addRangeToSet)(u,e.startLine,e.endLine-1)}let d=n<2?0:n;for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=n+1,a=r.length-r.trimEnd().length;if(a&&!s.has(i)&&!c.has(i)&&(d!==a||o&&(!l.has(i)||u.has(i)))){let e=r.length-a+1;(0,Z.addError)(t,i,`Expected: `+(d===0?``:`0 or `)+d+`; Actual: `+a,void 0,[e,a],{editColumn:e,deleteCount:a})}}}},NV=/\t+/g,PV={names:[`MD010`,`no-hard-tabs`],description:`Hard tabs`,tags:[`whitespace`,`hard_tab`],parser:`micromark`,function:function(e,t){let n=e.config.code_blocks,r=n===void 0?!0:!!n,i=new Set((e.config.ignore_code_languages||[]).map(e=>String(e).toLowerCase())),a=e.config.spaces_per_tab,o=a===void 0?1:Math.max(0,Number(a)),s=[];r?i.size>0&&s.push(`codeFenced`):s.push(`codeFenced`,`codeIndented`,`codeText`);let c=$(s).filter(e=>e.type===`codeFenced`&&i.size>0?(0,Q.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceInfo`]).every(e=>i.has(e.text.toLowerCase())):!0).map(e=>{let{type:t,startLine:n,startColumn:r,endLine:i,endColumn:a}=e,o=t===`codeFenced`;return{startLine:n+ +!!o,startColumn:o?0:r,endLine:i-+!!o,endColumn:o?2**53-1:a}});for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=null;for(;(i=NV.exec(r))!==null;){let e=n+1,r=i.index+1,a=i[0].length,s={startLine:e,startColumn:r,endLine:e,endColumn:r+a-1};c.some(e=>(0,Z.hasOverlap)(e,s))||(0,Z.addError)(t,e,`Column: `+r,void 0,[r,a],{editColumn:r,deleteCount:a,insertText:``.padEnd(a*o)})}}}},FV=/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g,IV={names:[`MD011`,`no-reversed-links`],description:`Reversed link syntax`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=new Set;for(let e of $([`codeFenced`,`codeIndented`,`mathFlow`]))(0,Q.addRangeToSet)(n,e.startLine,e.endLine);let r=$([`codeText`,`mathText`]);for(let[i,a]of e.lines.entries()){let e=i+1;if(!n.has(e)){let n=null;for(;(n=FV.exec(a))!==null;){let[i,a,o,s]=n;if(!o.endsWith(`\\`)&&!s.endsWith(`\\`)){let c=n.index+a.length+1,l=n[0].length-a.length,u={startLine:e,startColumn:c,endLine:e,endColumn:c+l-1};r.some(e=>(0,Z.hasOverlap)(e,u))||(0,Z.addError)(t,e,i.slice(a.length),void 0,[c,l],{editColumn:c,deleteCount:l,insertText:`[${o}](${s})`})}}}}}},LV={names:[`MD012`,`no-multiple-blanks`],description:`Multiple consecutive blank lines`,tags:[`whitespace`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=Number(e.config.maximum||1),{lines:r}=e,i=new Set;for(let e of $([`codeFenced`,`codeIndented`]))(0,Q.addRangeToSet)(i,e.startLine,e.endLine);let a=0;for(let[e,o]of r.entries())a=i.has(e+1)||o.trim().length>0?0:a+1,n<a&&(0,Z.addErrorDetailIf)(t,e+1,n,a,void 0,void 0,void 0,{deleteCount:-1})}},RV=/^(?:[#>\s]*\s)?\S*$/,zV={names:[`MD013`,`line-length`],description:`Line length`,tags:[`line_length`],parser:`micromark`,function:function(e,t){let n=Number(e.config.line_length||80),r=Number(e.config.heading_line_length||n),i=Number(e.config.code_block_line_length||n),a=!!e.config.strict,o=!!e.config.stern,s=e.config.code_blocks,c=s===void 0?!0:!!s,l=e.config.tables,u=l===void 0?!0:!!l,d=e.config.headings,f=d===void 0?!0:!!d,p=new Set;for(let e of $([`atxHeading`,`setextHeading`]))(0,Q.addRangeToSet)(p,e.startLine,e.endLine);let m=new Set;for(let e of $([`codeFenced`,`codeIndented`]))(0,Q.addRangeToSet)(m,e.startLine,e.endLine);let h=new Set;for(let e of $([`table`]))(0,Q.addRangeToSet)(h,e.startLine,e.endLine);let g=new Set;for(let e of $([`autolink`,`image`,`link`,`literalAutolink`]))(0,Q.addRangeToSet)(g,e.startLine,e.endLine);let _=new Set;for(let e of $([`paragraph`]))for(let t of(0,Q.getDescendantsByType)(e,[`data`]))(0,Q.addRangeToSet)(_,t.startLine,t.endLine);let v=new Set;for(let e of g)_.has(e)||v.add(e);let y=new Set(hV().definitionLineIndices);for(let s=0;s<e.lines.length;s++){let l=e.lines[s],d=s+1,g=p.has(d),_=m.has(d),b=h.has(d),x=_?i:g?r:n,S=a||o?l:l.replace(/\S*$/u,`#`);x>0&&(c||!_)&&(u||!b)&&(f||!g)&&!y.has(s)&&(a||!(o&&RV.test(l))&&!v.has(d))&&S.length>x&&(0,Z.addErrorDetailIf)(t,d,x,l.length,void 0,void 0,[x+1,l.length-x])}}},BV=/^(\s*)(\$\s+)/,VV={names:[`MD014`,`commands-show-output`],description:`Dollar signs used before commands without showing output`,tags:[`code`],parser:`micromark`,function:function(e,t){for(let e of $([`codeFenced`,`codeIndented`])){let n=e.children.filter(e=>e.type===`codeFlowValue`),r=n.map(e=>({result:e.text.match(BV),startColumn:e.startColumn,startLine:e.startLine,text:e.text})).filter(e=>e.result);if(r.length===n.length)for(let e of r){let n=e.startColumn+e.result[1].length,r=e.result[2].length;(0,Z.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[n,r],{editColumn:n,deleteCount:r})}}}},HV={names:[`MD018`,`no-missing-space-atx`],description:`No space after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of $([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Q.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)&&/^#+[^# \t]/.test(i)&&!/#\s*$/.test(i)&&!i.startsWith(`#️⃣`)){let n=/^#+/.exec(i)[0].length;(0,Z.addErrorContext)(t,e+1,i.trim(),void 0,void 0,[1,n+1],{editColumn:n+1,insertText:` `})}}};function UV(e,t,n){let{children:r,startLine:i,text:a}=t,o=n>0?0:r.length-1;for(;r[o]&&r[o].type!==`atxHeadingSequence`;)o+=n;let s=r[o],c=r[o+n];if(s?.type===`atxHeadingSequence`&&c?.type===`whitespace`&&c.text.length>1){let t=c.startColumn+1,r=c.endColumn-t;(0,Z.addErrorContext)(e,i,a.trim(),n>0,n<0,[t,r],{editColumn:t,deleteCount:r})}}var WV=[{names:[`MD019`,`no-multiple-space-atx`],description:`Multiple spaces after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`]).filter(e=>(0,Q.getHeadingStyle)(e)===`atx`);for(let e of n)UV(t,e,1)}},{names:[`MD021`,`no-multiple-space-closed-atx`],description:`Multiple spaces inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`]).filter(e=>(0,Q.getHeadingStyle)(e)===`atx_closed`);for(let e of n)UV(t,e,1),UV(t,e,-1)}}],GV={names:[`MD020`,`no-missing-space-closed-atx`],description:`No space inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of $([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Q.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)){let n=/^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(i);if(n){let[,r,{length:a},o,{length:s},c,l,{length:u}]=n,d=r.length,f=l.length,p=!a,m=!s||!!c,h=c?`${c} `:``;if(p||m){let n=p?[1,d+1]:[i.length-u-f,f+1];(0,Z.addErrorContext)(t,e+1,i.trim(),p,m,n,{editColumn:1,deleteCount:i.length,insertText:`${r} ${o} ${h}${l}`})}}}}},KV=1,qV=e=>{if(Array.isArray(e)){let t=[,,,,,,].fill(KV);for(let[n,r]of[...e.entries()].slice(0,6))t[n]=r;return e=>t[(0,Q.getHeadingLevel)(e)-1]}let t=e===void 0?KV:Number(e);return()=>t},JV=(e,t,n,r)=>t>=0&&t<e.length?e[t]:r&&n.length>0&&t<0&&t>=-n.length?n[n.length+t]:``,YV={names:[`MD022`,`blanks-around-headings`],description:`Headings should be surrounded by blank lines`,tags:[`headings`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=qV(e.config.lines_above),r=qV(e.config.lines_below),i=!!e.config.include_front_matter,{lines:a,frontMatterLines:o}=e,s=$([`blockQuotePrefix`,`linePrefix`]);for(let e of $([`atxHeading`,`setextHeading`])){let{startLine:c,endLine:l}=e,u=a[c-1].trim(),d=n(e);if(d>=0){let e=0;for(let t=0;t<d&&(0,Z.isBlankLine)(JV(a,c-2-t,o,i));t++)e++;(0,Z.addErrorDetailIf)(t,c,d,e,`Above`,u,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(s,c-1,d-e)})}let f=r(e);if(f>=0){let e=0;for(let t=0;t<f&&(0,Z.isBlankLine)(JV(a,l+t,o,!1));t++)e++;(0,Z.addErrorDetailIf)(t,c,f,e,`Below`,u,void 0,{lineNumber:l+1,insertText:(0,Q.getBlockQuotePrefixText)(s,l+1,f-e)})}}}},XV={names:[`MD023`,`heading-start-left`],description:`Headings must start at the beginning of the line`,tags:[`headings`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`,`linePrefix`,`setextHeading`]);for(let r=0;r<n.length-1;r++)if(n[r].type===`linePrefix`&&n[r+1].type!==`linePrefix`&&n[r].startLine===n[r+1].startLine){let{endColumn:i,startColumn:a,startLine:o}=n[r],s=i-a;(0,Z.addErrorContext)(t,o,e.lines[o-1],!0,!1,[a,s],{editColumn:a,deleteCount:s})}}},ZV={names:[`MD024`,`no-duplicate-heading`],description:`Multiple headings with the same content`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.siblings_only,r=[null,[]],i=1,a=r[i];for(let e of $([`atxHeading`,`setextHeading`])){let o=(0,Q.getHeadingText)(e);if(n){let t=(0,Q.getHeadingLevel)(e);for(;i<t;)i++,r[i]=[];for(;i>t;)r[i]=[],i--;a=r[t]}a.includes(o)?(0,Z.addErrorContext)(t,e.startLine,o.trim()):a.push(o)}}},QV={names:[`MD025`,`single-title`,`single-h1`],description:`Multiple top-level headings in the same document`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=Number(e.config.level||1),{tokens:r}=e.parsers.micromark,i=$([`atxHeading`,`setextHeading`]).filter(e=>n===(0,Q.getHeadingLevel)(e)&&!(0,Q.isDocfxTab)(e));if(i.length>0){let n=(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title),a=n;if(a||=r.slice(0,r.indexOf(i[0])).every(e=>Q.nonContentTokens.has(e.type)||(0,Q.isHtmlFlowComment)(e)),a)for(let e of i.slice(+!n))(0,Z.addErrorContext)(t,e.startLine,(0,Q.getHeadingText)(e))}}},$V={names:[`MD026`,`no-trailing-punctuation`],description:`Trailing punctuation in heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?Z.allPunctuationNoQuestion:n);let r=RegExp(`\\s*[`+(0,Z.escapeForRegExp)(n)+`]+$`),i=$([`atxHeadingText`,`setextHeadingText`]);for(let e of i){let{endColumn:n,endLine:i,text:a}=e,o=r.exec(a);if(o&&!Z.endOfLineHtmlEntityRe.test(a)&&!Z.endOfLineGemojiCodeRe.test(a)){let e=o[0],r=e.length,a=n-r;(0,Z.addError)(t,i,`Punctuation: '${e}'`,void 0,[a,r],{editColumn:a,deleteCount:r})}}}},eH=[`listOrdered`,`listUnordered`],tH={names:[`MD027`,`no-multiple-space-blockquote`],description:`Multiple spaces after blockquote symbol`,tags:[`blockquote`,`whitespace`,`indentation`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{tokens:i}=e.parsers.micromark;for(let n of $([`linePrefix`])){let a=n.parent,o=a?.type===`codeIndented`,s=a?.children||i;if(!o&&s[s.indexOf(n)-1]?.type===`blockQuotePrefix`&&(r||!eH.includes(s[s.indexOf(n)+1]?.type)&&!(0,Q.getParentOfType)(n,eH))){let{startColumn:r,startLine:i,text:a}=n,{length:o}=a,s=e.lines[i-1];(0,Z.addErrorContext)(t,i,s,void 0,void 0,[r,o],{editColumn:r,deleteCount:o})}}}},nH=new Set([`lineEnding`,`listItemIndent`,`linePrefix`]),rH={names:[`MD028`,`no-blanks-blockquote`],description:`Blank line inside blockquote`,tags:[`blockquote`,`whitespace`],parser:`micromark`,function:function(e,t){for(let n of $([`blockQuote`])){let r=[],i=n.parent?.children||e.parsers.micromark.tokens;for(let e=i.indexOf(n)+1;e<i.length;e++){let{startLine:n,type:a}=i[e];if(a===`lineEndingBlank`)r.push(n);else if(!nH.has(a))if(a===`blockQuote`){for(let e of r)(0,Z.addError)(t,e);break}else break}}}},iH={one:`1/1/1`,ordered:`1/2/3`,zero:`0/0/0`},aH=Object.keys(iH);function oH(e){let{startColumn:t,endColumn:n,text:r}=(0,Q.getDescendantsByType)(e,[`listItemValue`])[0];return{startColumn:t,endColumn:n,text:r,number:Number(r)}}var sH={names:[`MD029`,`ol-prefix`],description:`Ordered list item prefix`,tags:[`ol`],parser:`micromark`,function:function(e,t){let n=String(e.config.style);for(let e of $([`listOrdered`])){let r=(0,Q.getDescendantsByType)(e,[`listItemPrefix`]),i=1,a=!1,o=!1,s=!1;if(r.length>0){let e=r[0].endColumn;if(o=r.every(t=>t.endColumn===e),r.length>1){let e=oH(r[0]);(oH(r[1]).number!==1||e.number===0)&&(a=!0,e.number===0&&(i=0)),s=e.text.startsWith(`0`)}}let c=aH.includes(n)?n:a?`ordered`:`one`;c===`zero`?i=0:c===`one`&&(i=1);for(let e of r){let n=i.toString(),{endColumn:r,startColumn:a,number:l}=oH(e),u=r-a,d={editColumn:a,deleteCount:u,insertText:o?n.padStart(u,s?`0`:` `):n};(0,Z.addErrorDetailIf)(t,e.startLine,i,l,`Style: `+iH[c],void 0,[e.startColumn,e.endColumn-e.startColumn],d),c===`ordered`&&i++}}}},cH={names:[`MD030`,`list-marker-space`],description:`Spaces after list markers`,tags:[`ol`,`ul`,`whitespace`],parser:`micromark`,function:function(e,t){let n=Number(e.config.ul_single||1),r=Number(e.config.ol_single||1),i=Number(e.config.ul_multi||1),a=Number(e.config.ol_multi||1);for(let e of $([`listOrdered`,`listUnordered`])){let o=e.type===`listOrdered`,s=e.children.filter(e=>e.type===`listItemPrefix`),c=e.endLine-e.startLine+1===s.length,l=o?c?r:a:c?n:i;for(let e of s){let n=[e.startColumn,e.endColumn-e.startColumn],r=e.children.filter(e=>e.type===`listItemPrefixWhitespace`);for(let e of r){let{endColumn:r,startColumn:i,startLine:a}=e,o=r-i;(0,Z.addErrorDetailIf)(t,a,l,o,void 0,void 0,n,{editColumn:i,deleteCount:o,insertText:``.padEnd(l)})}}}}},lH=/^(.*?)[`~]/;function uH(e,t,n,r){let i=t[n-1],[,a]=i.match(lH)||[],o=a===void 0?void 0:{lineNumber:n+ +!r,insertText:`${a.replace(/[^>]/g,` `).trim()}\n`};(0,Z.addErrorContext)(e,n,i.trim(),void 0,void 0,void 0,o)}var dH={names:[`MD031`,`blanks-around-fences`],description:`Fenced code blocks should be surrounded by blank lines`,tags:[`code`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{lines:i}=e;for(let e of $([`codeFenced`]))(r||!(0,Q.getParentOfType)(e,[`listOrdered`,`listUnordered`]))&&((0,Z.isBlankLine)(i[e.startLine-2])||uH(t,i,e.startLine,!0),!(0,Z.isBlankLine)(i[e.endLine])&&!(0,Z.isBlankLine)(i[e.endLine-1])&&uH(t,i,e.endLine,!1))}},fH=e=>e.type===`listOrdered`||e.type===`listUnordered`,pH={names:[`MD032`,`blanks-around-lists`],description:`Lists should be surrounded by blank lines`,tags:[`bullet`,`ul`,`ol`,`blank_lines`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=$([`blockQuotePrefix`,`linePrefix`]),a=(0,Q.filterByPredicate)(r.micromark.tokens,fH,e=>fH(e)||e.type===`htmlFlow`?[]:e.children);for(let e of a){let r=e.startLine;(0,Z.isBlankLine)(n[r-2])||(0,Z.addErrorContext)(t,r,n[r-1].trim(),void 0,void 0,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(i,r)});let a=(0,Q.filterByPredicate)(e.children,e=>!Q.nonContentTokens.has(e.type),e=>Q.nonContentTokens.has(e.type)?[]:e.children),o=(a.length>0?a[a.length-1]:e).endLine;(0,Z.isBlankLine)(n[o])||(0,Z.addErrorContext)(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:(0,Q.getBlockQuotePrefixText)(i,o)})}}},mH=e=>Array.isArray(e)?e.map(e=>String(e).toLowerCase()):[],hH={names:[`MD033`,`no-inline-html`],description:`Inline HTML`,tags:[`html`],parser:`micromark`,function:function(e,t){let n=mH(e.config.allowed_elements),r=mH(e.config.table_allowed_elements||e.config.allowed_elements);for(let e of $([`htmlText`],!0)){let i=(0,Q.getHtmlTagInfo)(e);if(i&&!i.close){let a=i?.name.toLowerCase(),o=!!(0,Q.getParentOfType)(e,[`table`]);if((o||!n.includes(a))&&(!o||!r.includes(a))){let n=[e.startColumn,e.text.replace(Z.nextLinesRe,``).length];(0,Z.addError)(t,e.startLine,`Element: `+i.name,void 0,n)}}}}},gH={names:[`MD034`,`no-bare-urls`],description:`Bare URL used`,tags:[`links`,`url`],parser:`micromark`,function:function(e,t){let n=e=>(0,Q.filterByPredicate)(e,e=>{if(e.type===`literalAutolink`&&!(0,Q.inHtmlFlow)(e)){let t=e.parent?.children,n=t?.indexOf(e),r=t?.at(n-1),i=t?.at(n+1);return!(r&&i&&r.type===`data`&&i.type===`data`&&r.text.endsWith(`<`)&&i.text.startsWith(`>`))}return!1},e=>{let{children:t}=e,n=[];for(let e=0;e<t.length;e++){let r=t[e],i=(0,Q.getHtmlTagInfo)(r);if(i&&!i.close){let n=1;for(let r=e+1;r<t.length;r++){let a=t[r],o=(0,Q.getHtmlTagInfo)(a);if(o&&i.name===o.name)if(o.close){if(n--,n===0){e=r;break}}else n++}}else n.push(r)}return n});for(let r of n(e.parsers.micromark.tokens)){let e=[r.startColumn,r.endColumn-r.startColumn],n={editColumn:e[0],deleteCount:e[1],insertText:`<${r.text}>`};(0,Z.addErrorContext)(t,r.startLine,r.text,void 0,void 0,e,n)}}},_H={names:[`MD035`,`hr-style`],description:`Horizontal rule style`,tags:[`hr`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`).trim(),r=$([`thematicBreak`]);for(let e of r){let{startLine:r,text:i}=e;n===`consistent`&&(n=i),(0,Z.addErrorDetailIf)(t,r,n,i)}}},vH=[[`emphasis`,`emphasisText`],[`strong`,`strongText`]],yH=e=>!(e.type===`htmlText`||e.type===`data`&&e.text.trim().length===0),bH={names:[`MD036`,`no-emphasis-as-heading`],description:`Emphasis used instead of a heading`,tags:[`headings`,`emphasis`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?Z.allPunctuation:n);let r=RegExp(`[`+n+`]$`),i=$([`paragraph`],!0).filter(e=>e.parent?.type===`content`&&(!e.parent?.parent||e.parent?.parent?.type===`htmlFlow`&&!e.parent?.parent?.parent)&&e.children.filter(yH).length===1);for(let e of vH){let n=(0,Q.getDescendantsByType)(i,e);for(let e of n)e.children.length===1&&e.children[0].type===`data`&&!r.test(e.text)&&(0,Z.addErrorContext)(t,e.startLine,e.text)}}},xH={names:[`MD037`,`no-space-in-emphasis`],description:`Spaces inside emphasis markers`,tags:[`whitespace`,`emphasis`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=new Map;for(let e of[`_`,`__`,`___`,`*`,`**`,`***`])i.set(e,[]);let a=(0,Q.filterByPredicate)(r.micromark.tokens,e=>e.children.some(e=>e.type===`data`));for(let e of a){for(let e of i.values())e.length=0;for(let t of e.children){let{text:e,type:n}=t;if(n===`data`&&e.length<=3){let n=i.get(e);n&&!(0,Q.inHtmlFlow)(t)&&n.push(t)}}for(let[e,r]of i)for(let i=0;i+1<r.length;i+=2){let a=r[i],o=n[a.startLine-1].slice(a.endColumn-1).match(/^\s+\S/);if(o){let[n]=o,r=`${e}${n}`,i=a.endColumn,s=n.length-1;(0,Z.addError)(t,a.startLine,void 0,r,[i,s],{editColumn:i,deleteCount:s})}let s=r[i+1],c=n[s.startLine-1].slice(0,s.startColumn-1).match(/\S\s+$/);if(c){let[n]=c,r=`${n}${e}`,i=s.startColumn-(n.length-1),a=n.length-1;(0,Z.addError)(t,s.startLine,void 0,r,[i,a],{editColumn:i,deleteCount:a})}}}}},SH={names:[`MD038`,`no-space-in-code`],description:`Spaces inside code span elements`,tags:[`whitespace`,`code`],parser:`micromark`,function:function(e,t){let n=$([`codeText`]);for(let e of n){let n=(0,Q.getDescendantsByType)(e,[`codeTextData`]);if(n.length>0){let r=(0,Q.getDescendantsByType)(e,[`codeTextPadding`]),i=r[0],a=n[0],o=/^(\s+)(\S)/.exec(a.text)||[null,``,``],s=o[2]==="`",c=o[1].length-(s&&!i?1:0),l=c>0,u=r[r.length-1],d=n[n.length-1],f=/(\S)(\s+)$/.exec(d.text)||[null,``,``],p=f[1]==="`",m=f[2].length-(p&&!u?1:0),h=m>0,g=l&&h&&i&&u&&!s&&!p,_=e.text;if(l){let e=(g?i:a).startColumn,n=c+(g?i.text.length:0);(0,Z.addErrorContext)(t,a.startLine,_,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(h){let e=(g?u:d).endColumn,n=m+(g?u.text.length:0);(0,Z.addErrorContext)(t,d.endLine,_,!1,!0,[e-n,n],{editColumn:e-n,deleteCount:n})}}}}};function CH(e,t,n,r){let i=n.text.match(r?/^[^\S\r\n]+/:/[^\S\r\n]+$/),a=i?[r?n.startColumn:n.endColumn-i[0].length,i[0].length]:void 0;(0,Z.addErrorContext)(e,r?n.startLine+ +!i:n.endLine-+!i,t.text.replace(/\s+/g,` `),r,!r,a,a?{editColumn:a[0],deleteCount:a[1]}:void 0)}var wH={names:[`MD039`,`no-space-in-links`],description:`Spaces inside link text`,tags:[`whitespace`,`links`],parser:`micromark`,function:function(e,t){let n=$([`label`]).filter(e=>e.parent?.type===`link`);for(let e of n){let n=e.children.filter(e=>e.type===`labelText`);for(let r of n)r.text.trimStart().length!==r.text.length&&CH(t,e,r,!0),r.text.trimEnd().length!==r.text.length&&CH(t,e,r,!1)}}},TH={names:[`MD040`,`fenced-code-language`],description:`Fenced code blocks should have a language specified`,tags:[`code`,`language`],parser:`micromark`,function:function(e,t){let n=e.config.allowed_languages;n=Array.isArray(n)?n:[];let r=!!e.config.language_only,i=$([`codeFenced`]);for(let e of i){let i=(0,Q.getDescendantsByType)(e,[`codeFencedFence`])[0],{startLine:a,text:o}=i,s=(0,Q.getDescendantsByType)(i,[`codeFencedFenceInfo`])[0]?.text;s?n.length>0&&!n.includes(s)&&(0,Z.addError)(t,a,`"${s}" is not allowed`):(0,Z.addErrorContext)(t,a,o),r&&(0,Q.getDescendantsByType)(i,[`codeFencedFenceMeta`]).length>0&&(0,Z.addError)(t,a,`Info string contains more than language: "${o}"`)}}},EH=/^h[1-6]$/;function DH(e){let{children:t,type:n}=e;if(n===`htmlFlow`){let e=(0,Q.filterByTypes)(t,[`htmlText`],!0),n=e.length>0&&(0,Q.getHtmlTagInfo)(e[0]);if(n)return n.name.toLowerCase()}return null}var OH={names:[`MD041`,`first-line-heading`,`first-line-h1`],description:`First line in a file should be a top-level heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.allow_preamble,r=Number(e.config.level||1),{tokens:i}=e.parsers.micromark;if(!(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)){let a=0;for(let e of i){let{startLine:t,type:i}=e;if(!Q.nonContentTokens.has(i)&&!(0,Q.isHtmlFlowComment)(e)){let o=null;if(i===`atxHeading`||i===`setextHeading`){(0,Q.getHeadingLevel)(e)!==r&&(a=t);break}else if((o=DH(e))&&EH.test(o)){o!==`h${r}`&&(a=t);break}else if(!n){a=t;break}}}a>0&&(0,Z.addErrorContext)(t,a,e.lines[a-1])}}},kH={names:[`MD042`,`no-empty-links`],description:`No empty links`,tags:[`links`],parser:`micromark`,function:function(e,t){let{definitions:n}=hV(),r=e=>{let t=n.get(e.text.trim());return!!(t&&t[1]===`#`)},i=$([`link`]);for(let e of i){let n=(0,Q.getDescendantsByType)(e,[`label`,`labelText`]),i=(0,Q.getDescendantsByType)(e,[`reference`]),a=(0,Q.getDescendantsByType)(e,[`resource`]),o=(0,Q.getDescendantsByType)(i,[`referenceString`]),s=(0,Q.getDescendantsByType)(a,[`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`]),c=n.length>0,l=i.length>0,u=a.length>0,d=o.length>0,f=s.length>0,p=!1;c&&(!l&&!u||l&&!d)?p=r(n[0]):d&&!f?p=r(o[0]):!d&&f?p=s[0].text.trim()===`#`:!d&&!f&&(p=!0),p&&(0,Z.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[e.startColumn,e.endColumn-e.startColumn])}}},AH={names:[`MD043`,`required-headings`],description:`Required heading structure`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.headings;if(!Array.isArray(n))return;let r=e.config.match_case||!1,i=0,a=!1,o=!1,s=!1,c=()=>String(n[i++]||`[None]`),l=e=>r?e:e.toLowerCase();for(let e of $([`atxHeading`,`setextHeading`]))if(!o){let n=(0,Q.getHeadingText)(e),r=(0,Q.getHeadingLevel)(e);s=!0;let u=`${``.padEnd(r,`#`)} ${n}`,d=c();d===`*`?l(c())!==l(u)&&(a=!0,i--):d===`+`?a=!0:d===`?`||(l(d)===l(u)?a=!1:a?i--:((0,Z.addErrorDetailIf)(t,e.startLine,d,u),o=!0))}let u=n.length-i;!o&&(u>1||u===1&&n[i]!==`*`)&&(s||!n.every(e=>e===`*`))&&(0,Z.addErrorContext)(t,e.lines.length,n[i])}};function jH(e,t,n,r,i,a,o,s,c,u,d,f,p,h,g){let _,v;return y;function y(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),b}function b(t){return t===35?(_=o,S(t)):t===46?(_=s,S(t)):g&&te(t)?ye(e,b,`whitespace`)(t):!g&&T(t)?m(e,b)(t):t===null||E(t)||l(t)||x(t)&&t!==45&&t!==95?le(t):(e.enter(a),e.enter(c),e.consume(t),ee)}function S(t){let n=_+`Marker`;return e.enter(a),e.enter(_),e.enter(n),e.consume(t),e.exit(n),C}function C(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||T(t))return n(t);let r=_+`Value`;return e.enter(r),e.consume(t),w}function w(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||T(t)){let n=_+`Value`;return e.exit(n),e.exit(_),e.exit(a),b(t)}return e.consume(t),w}function ee(t){return t===null||E(t)||l(t)||x(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),g&&te(t)?ye(e,ne,`whitespace`)(t):!g&&T(t)?m(e,ne)(t):ne(t)):(e.consume(t),ee)}function ne(t){return t===61?(e.enter(u),e.consume(t),e.exit(u),re):(e.exit(a),b(t))}function re(t){return t===null||t===60||t===61||t===62||t===96||t===125||g&&E(t)?n(t):t===34||t===39?(e.enter(d),e.enter(p),e.consume(t),e.exit(p),v=t,ae):g&&te(t)?ye(e,re,`whitespace`)(t):!g&&T(t)?m(e,re)(t):(e.enter(f),e.enter(h),e.consume(t),v=void 0,ie)}function ie(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||T(t)?(e.exit(h),e.exit(f),e.exit(a),b(t)):(e.consume(t),ie)}function ae(t){return t===v?(e.enter(p),e.consume(t),e.exit(p),e.exit(d),e.exit(a),ce):(e.enter(f),oe(t))}function oe(t){return t===v?(e.exit(f),ae(t)):t===null?n(t):E(t)?g?n(t):m(e,oe)(t):(e.enter(h),e.consume(t),se)}function se(t){return t===v||t===null||E(t)?(e.exit(h),oe(t)):(e.consume(t),se)}function ce(e){return e===125||T(e)?b(e):le(e)}function le(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function MH(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):E(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function NH(e,t,n,r){let i=this;return a;function a(t){return t===null||E(t)||x(t)||l(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||E(a)||l(a)||x(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}var PH={tokenize:RH,concrete:!0},FH={tokenize:zH,partial:!0},IH={tokenize:BH,partial:!0},LH={tokenize:VH,partial:!0};function RH(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),NH.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(FH,d,d)(t):d(t)}function d(t){return t===123?e.attempt(IH,f,f)(t):f(t)}function f(t){return ye(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):E(i)?r.interrupt?t(i):e.attempt(LH,m,C)(i):n(i)}function m(t){return t===null?C(t):E(t)?e.check(LH,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?ye(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):E(t)?e.check(LH,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return E(t)?e.check(LH,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return ye(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),ye(e,c,`whitespace`)(t))}function c(r){return r===null||E(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function zH(e,t,n){return MH(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function BH(e,t,n){return jH(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function VH(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var HH={tokenize:GH},UH={tokenize:KH,partial:!0},WH={tokenize:qH,partial:!0};function GH(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),NH.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(UH,s,s)(t):s(t)}function s(t){return t===123?e.attempt(WH,c,c)(t):c(t)}function c(t){return ye(e,l,`whitespace`)(t)}function l(r){return r===null||E(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function KH(e,t,n){return MH(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function qH(e,t,n){return jH(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}var JH={tokenize:QH,previous:ZH},YH={tokenize:$H,partial:!0},XH={tokenize:eU,partial:!0};function ZH(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function QH(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),NH.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(YH,o,o)(t):o(t)}function o(t){return t===123?e.attempt(XH,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function $H(e,t,n){return MH(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function eU(e,t,n){return jH(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function tU(){return{text:{58:JH},flow:{58:[PH,HH]}}}var nU=Fe();function rU(){let e={...tU()};return delete e.text,e}function iU(e,t){return e.slice(t.start.offset,t.end.offset)}function aU(e,t={}){let n=[rU(),le(),se(),Ce(),ZP(),...t.extensions||[]],r=[],i=ee.tokenize;function a(t,n,a){let o=this,s=o.events;return i.call(o,t,n,t=>{let n=s.length;for(;--n>=0;){let[e,t]=s[n];if(e===`enter`){let{type:e}=t;if(e===`labelImage`||e===`labelLink`)break}}if(n>=0){let[,t]=s[n],[,i]=s[s.length-1],a={type:`undefinedReferenceShortcut`,start:t.start,end:i.end},c={type:`undefinedReference`,start:t.start,end:i.end},l=s.slice(n).filter(e=>{let[,t]=e,{type:n}=t;return n===`data`||n===`lineEnding`}),u=r.length>0&&r[r.length-1][0],d=u&&u[1];d&&d.end.line===a.start.line&&d.end.column===a.start.column&&(l.length===0?(d.type=`undefinedReferenceCollapsed`,d.end=i.end):(a.type=`undefinedReferenceFull`,a.start=d.start,r.pop()));let f=l.filter(e=>e[0]===`enter`).map(t=>iU(e,t[1])).join(``).trim();if(f.length>0&&!f.includes(`]`)){let e=[[`enter`,a,o],[`enter`,c,o]];for(let t of l){let[n,r]=t;e.push([n,{...r},o])}e.push([`exit`,c,o],[`exit`,a,o]),r.push(e)}}return a(t)})}try{ee.tokenize=a;let i=C({...t,extensions:n}),o=w()(e,void 0,!0);return h(i.document().write(o)).concat(...r)}finally{ee.tokenize=i}}function oU(e,t={},n={},r=0,i=void 0){let a=!!t.freezeTokens,o=aU(e,n),s=[],c=[],l={type:`data`,startLine:-1,startColumn:-1,endLine:-1,endColumn:-1,text:`ROOT`,children:s,parent:null},u=[l],d=l,f=null,p=null,m=!1;for(let s of o){let[o,h]=s,{type:g,start:_,end:v}=h,{column:y,line:b}=_,{column:x,line:S}=v,C=iU(e,h);if(o===`enter`&&!m){let a=d;if(u.push(a),d={type:g,startLine:b+r,startColumn:y,endLine:S+r,endColumn:x,text:C,children:[],parent:a===l?i||null:a},i&&Object.defineProperty(d,nU.htmlFlowSymbol,{value:!0}),a.children.push(d),c.push(d),d.type===`htmlFlow`&&!(0,Q.isHtmlFlowComment)(d)){m=!0,(!f||!p)&&(f={...n,extensions:[{disable:{null:[`codeIndented`,`htmlFlow`]}}]},p=e.split(nU.newlineRe));let r=oU(p.slice(d.startLine-1,d.endLine).join(`
|
|
384
384
|
`),t,f,d.startLine-1,d);d.children=r,c=c.concat(r[nU.flatTokensSymbol])}}else o===`exit`&&(g===`htmlFlow`&&(m=!1),m||(a&&(Object.freeze(d.children),Object.freeze(d)),d=u.pop()))}return Object.defineProperty(s,nU.flatTokensSymbol,{value:c}),a&&Object.freeze(s),s}function sU(e,t){return oU(e,t)}var cU=new Set([`codeFencedFence`,`definition`,`reference`,`resource`]),lU={names:[`MD044`,`proper-names`],description:`Proper names should have the correct capitalization`,tags:[`spelling`],parser:`micromark`,function:function(e,t){let n=e.config.names;if(n=Array.isArray(n)?n:[],n.sort((e,t)=>t.length-e.length||e.localeCompare(t)),n.length===0)return;let r=e.config.code_blocks,i=r===void 0?!0:!!r,a=e.config.html_elements,o=a===void 0?!0:!!a,s=new Set([`data`]);i&&(s.add(`codeFlowValue`),s.add(`codeTextData`)),o&&(s.add(`htmlFlowData`),s.add(`htmlTextData`));let c=(0,Q.filterByPredicate)(e.parsers.micromark.tokens,e=>s.has(e.type),e=>e.children.filter(e=>!cU.has(e.type))),l=[],u=new Set;for(let e of n){let r=(0,Z.escapeForRegExp)(e),i=`(${/^\W/.test(e)?``:`\\b_*`})(${r})${/\W$/.test(e)?``:`_*\\b`}`,a=new RegExp(i,`gi`);for(let r of c){let i=null;for(;(i=a.exec(r.text))!==null;){let[,a,o]=i,s=r.startColumn+i.index+a.length,c=o.length,d=r.startLine,f={startLine:d,startColumn:s,endLine:d,endColumn:s+c-1};if(!n.includes(o)&&!l.some(e=>(0,Z.hasOverlap)(e,f))){let n=[];u.has(r)||(n=(0,Q.filterByTypes)(sU(r.text),[`literalAutolink`]).map(e=>({startLine:d,startColumn:r.startColumn+e.startColumn-1,endLine:d,endColumn:r.endColumn+e.endColumn-1})),l.push(...n),u.add(r)),n.some(e=>(0,Z.hasOverlap)(e,f))||(0,Z.addErrorDetailIf)(t,r.startLine,e,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:e})}l.push(f)}}}}},uU=(0,Z.getHtmlAttributeRe)(`alt`),dU=(0,Z.getHtmlAttributeRe)(`aria-hidden`),fU={names:[`MD045`,`no-alt-text`],description:`Images should have alternate text (alt text)`,tags:[`accessibility`,`images`],parser:`micromark`,function:function(e,t){let n=$([`image`]);for(let e of n)if((0,Q.getDescendantsByType)(e,[`label`,`labelText`]).some(e=>e.text.length===0)){let n=e.startLine===e.endLine?[e.startColumn,e.endColumn-e.startColumn]:void 0;(0,Z.addError)(t,e.startLine,void 0,void 0,n)}let r=$([`htmlText`],!0);for(let e of r){let{startColumn:n,startLine:r,text:i}=e,a=(0,Q.getHtmlTagInfo)(e);a&&!a.close&&a.name.toLowerCase()===`img`&&!uU.test(i)&&dU.exec(i)?.[1].toLowerCase()!==`true`&&(0,Z.addError)(t,r,void 0,void 0,[n,i.replace(Z.nextLinesRe,``).length])}}},pU=e=>e===`codeFenced`?`fenced`:`indented`,mU={names:[`MD046`,`code-block-style`],description:`Code block style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of $([`codeFenced`,`codeIndented`])){let{startLine:r,type:i}=e;n===`consistent`&&(n=pU(i)),(0,Z.addErrorDetailIf)(t,r,n,pU(i))}}},hU={names:[`MD047`,`single-trailing-newline`],description:`Files should end with a single newline character`,tags:[`blank_lines`],parser:`none`,function:function(e,t){let n=e.lines.length,r=e.lines[n-1];(0,Z.isBlankLine)(r)||(0,Z.addError)(t,n,void 0,void 0,[r.length,1],{insertText:`
|
|
385
385
|
`,editColumn:r.length+1})}};function gU(e){switch(e[0]){case`~`:return`tilde`;default:return`backtick`}}var _U={names:[`MD048`,`code-fence-style`],description:`Code fence style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=$([`codeFenced`]);for(let e of r){let{startLine:r,text:i}=(0,Q.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceSequence`])[0];n===`consistent`&&(n=gU(i)),(0,Z.addErrorDetailIf)(t,r,n,gU(i))}}},vU=/^\w$/;function yU(e){switch(e[0]){case`*`:return`asterisk`;default:return`underscore`}}var bU=(e,t,n,r,i,a,o=`consistent`)=>{let{lines:s,parsers:c}=e,l=(0,Q.filterByPredicate)(c.micromark.tokens,e=>e.type===n,e=>e.type===`htmlFlow`?[]:e.children);for(let e of l){let n=(0,Q.getDescendantsByType)(e,[r]),c=n[0],l=n[n.length-1];if(c&&l){let e=yU(c.text);if(o===`consistent`&&(o=e),o!==e&&!(o===`underscore`&&(vU.test(s[c.startLine-1][c.startColumn-2])||vU.test(s[l.endLine-1][l.endColumn-1]))))for(let n of[c,l])(0,Z.addError)(t,n.startLine,`Expected: ${o}; Actual: ${e}`,void 0,[n.startColumn,n.text.length],{editColumn:n.startColumn,deleteCount:n.text.length,insertText:o===`asterisk`?i:a})}}},xU=[{names:[`MD049`,`emphasis-style`],description:`Emphasis style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return bU(e,t,`emphasis`,`emphasisSequence`,`*`,`_`,e.config.style||void 0)}},{names:[`MD050`,`strong-style`],description:`Strong style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return bU(e,t,`strong`,`strongSequence`,`**`,`__`,e.config.style||void 0)}}],SU=(0,Z.getHtmlAttributeRe)(`id`),CU=(0,Z.getHtmlAttributeRe)(`name`),wU=/\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu,TU=/^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/,EU=new Set([`image`,`reference`,`resource`]),DU=new Set([`characterEscapeValue`,`codeTextData`,`data`,`mathTextData`]);function OU(e){let t=(0,Q.filterByPredicate)(e.children,e=>DU.has(e.type),e=>EU.has(e.type)?[]:e.children).map(e=>e.text).join(``);return`#`+encodeURIComponent(t.toLowerCase().replace(/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,``).replace(/ /gu,`-`).toWellFormed())}function kU(e){return(0,Q.filterByTypes)(e.children,[`characterEscapeValue`,`data`]).map(e=>e.text).join(``)}var AU={names:[`MD051`,`link-fragments`],description:`Link fragments should be valid`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=e.config.ignore_case||!1,r=e.config.ignored_pattern||``,i=new RegExp(r||`^$`),a=new Map([[`#top`,0]]),o=$([`atxHeadingText`,`setextHeadingText`]);for(let e of o){let t=OU(e);if(t!==`#`){let n=a.get(t)||0;n&&a.set(`${t}-${n}`,0),a.set(t,n+1);let r=null;for(;(r=wU.exec(e.text))!==null;){let[,e]=r;a.has(e)||a.set(e,1)}}}for(let e of $([`htmlText`],!0)){let t=(0,Q.getHtmlTagInfo)(e);if(t&&!t.close){let n=SU.exec(e.text)||t.name.toLowerCase()===`a`&&CU.exec(e.text);n&&n.length>0&&a.set(`#${n[1]}`,0)}}for(let[e,r]of[[`link`,`resourceDestinationString`],[`definition`,`definitionDestinationString`]]){let o=$([e]).filter(e=>!(e.parent?.type===`atxHeadingText`&&(0,Q.isDocfxTab)(e.parent.parent)));for(let e of o){let o=(0,Q.filterByTypes)(e.children,[r]);for(let r of o){let{endColumn:o,startColumn:s}=r,c=kU(r),l=c.slice(1),u=`#${encodeURIComponent(l.toWellFormed())}`;if(c.length>1&&c.startsWith(`#`)&&!a.has(u)&&!TU.test(u)&&!i.test(l)){let r,i,l;e.startLine===e.endLine&&(r=e.text,i=[e.startColumn,e.endColumn-e.startColumn],l={editColumn:s,deleteCount:o-s});let u=c.toLowerCase(),d=[...a.keys()].find(e=>u===e.toLowerCase());d?((l||{}).insertText=d,!n&&d!==c&&(0,Z.addError)(t,e.startLine,`Expected: ${d}; Actual: ${c}`,r,i,l)):(0,Z.addError)(t,e.startLine,void 0,r,i)}}}}}},jU={names:[`MD052`,`reference-links-images`],description:`Reference links and images should use a label that is defined`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let{config:n,lines:r}=e,i=n.shortcut_syntax||!1,a=new Set(n.ignored_labels||[`x`]),{definitions:o,references:s,shortcuts:c}=hV(),l=i?[...s.entries(),...c.entries()]:s.entries();for(let e of l){let[n,i]=e;if(!o.has(n)&&!a.has(n))for(let e of i){let[i,a,o]=e,s=r[i].slice(a,a+o);(0,Z.addError)(t,i+1,`Missing link or image reference definition: "${n}"`,s,[a+1,s.length])}}}},MU=/^ {0,3}\[([^\]]*[^\\])\]:/,NU={names:[`MD053`,`link-image-reference-definitions`],description:`Link and image reference definitions should be needed`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let n=new Set(e.config.ignored_definitions||[`//`]),r=e.lines,{references:i,shortcuts:a,definitions:o,duplicateDefinitions:s}=hV(),c=e=>e.replace(MU,``).trim().length>0,l={deleteCount:-1};for(let e of o.entries()){let[o,[s]]=e;if(!n.has(o)&&!i.has(o)&&!a.has(o)){let e=r[s];(0,Z.addError)(t,s+1,`Unused link or image reference definition: "${o}"`,(0,Z.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}for(let e of s){let[i,a]=e;if(!n.has(i)){let e=r[a];(0,Z.addError)(t,a+1,`Duplicate link or image reference definition: "${i}"`,(0,Z.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}}},PU=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,FU=e=>e.replace(PU,`$1`),IU=/[ <>]/,LU=e=>{try{new URL(e)}catch{return!1}return!IU.test(e)},RU={names:[`MD054`,`link-image-style`],description:`Link and image style`,tags:[`images`,`links`],parser:`micromark`,function:(e,t)=>{let n=e.config,r=n.autolink===void 0||!!n.autolink,i=n.inline===void 0||!!n.inline,a=n.full===void 0||!!n.full,o=n.collapsed===void 0||!!n.collapsed,s=n.shortcut===void 0||!!n.shortcut,c=n.url_inline===void 0||!!n.url_inline;if(r&&i&&a&&o&&s&&c)return;let{definitions:l}=hV(),u=$([`autolink`,`image`,`link`]);for(let e of u){let n=null,u=null,{endColumn:d,endLine:f,startColumn:p,startLine:m,text:h,type:g}=e,_=g===`image`,v=!1;if(g===`autolink`)u=(0,Q.getDescendantsByType)(e,[[`autolinkEmail`,`autolinkProtocol`]])[0]?.text,n=u,v=!r&&!!u;else if(n=(0,Q.getDescendantsByType)(e,[`label`,`labelText`])[0].text,u=(0,Q.getDescendantsByType)(e,[`resource`,`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`])[0]?.text,u){let t=(0,Q.getDescendantsByType)(e,[`resource`,`resourceTitle`,`resourceTitleString`])[0]?.text;v=!i||!c&&r&&!_&&!t&&n===u&&LU(u)}else{let t=(0,Q.getDescendantsByType)(e,[`reference`]).length===0,r=(0,Q.getDescendantsByType)(e,[`reference`,`referenceString`])[0]?.text,i=r===void 0,c=l.get(r||n);u=c&&c[1]||``,v=!!(u&&(t?!s:i?!o:!a))}if(v){let e,a;if(m===f){e=[p,d-p];let t=null,o=i&&n,s=r&&!_&&LU(u);o&&(c||!s)?t=`${_?`!`:``}[${n.replace(/[[\]]/g,`\\$&`)}](${u.replace(/[()]/g,`\\$&`)})`:s&&(t=`<${FU(u)}>`),t&&(a={editColumn:e[0],insertText:t,deleteCount:e[1]})}(0,Z.addErrorContext)(t,m,h.replace(Z.nextLinesRe,``),void 0,void 0,e,a)}}}},zU=new Set([`linePrefix`,`whitespace`]),BU=e=>e.filter(e=>!zU.has(e.type)),VU=e=>e[0],HU=e=>e[e.length-1],UU=(e,t)=>[e,t-e+1],WU={names:[`MD055`,`table-pipe-style`],description:`Table pipe style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=n!==`no_leading_or_trailing`&&n!==`trailing_only`,i=n!==`no_leading_or_trailing`&&n!==`leading_only`,a=$([`tableDelimiterRow`,`tableRow`]);for(let e of a){let a=VU(e.children),o=VU(BU(a.children)).type===`tableCellDivider`,s=HU(e.children),c=HU(BU(s.children)).type===`tableCellDivider`,l=o?c?`leading_and_trailing`:`leading_only`:c?`trailing_only`:`no_leading_or_trailing`;n===`consistent`&&(n=l,r=o,i=c),o!==r&&(0,Z.addErrorDetailIf)(t,a.startLine,n,l,`${r?`Missing`:`Unexpected`} leading pipe`,void 0,UU(e.startColumn,a.startColumn)),c!==i&&(0,Z.addErrorDetailIf)(t,s.endLine,n,l,`${i?`Missing`:`Unexpected`} trailing pipe`,void 0,UU(s.endColumn-1,e.endColumn-1))}}},GU=(e,t)=>[e,t-e+1],KU={names:[`MD056`,`table-column-count`],description:`Table column count`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=$([`tableDelimiterRow`,`tableRow`]),r=0,i=null;for(let e of n){let n=(0,Q.getParentOfType)(e,[`table`]);i!==n&&(r=0,i=n);let a=e.children.filter(e=>[`tableData`,`tableDelimiter`,`tableHeader`].includes(e.type)),o=a.length;r||=o;let s,c;o<r?(s=`Too few cells, row will be missing data`,c=[e.endColumn-1,1]):r<o&&(s=`Too many cells, extra data will be missing`,c=GU(a[r].startColumn,e.endColumn-1)),(0,Z.addErrorDetailIf)(t,e.endLine,r,o,s,void 0,c)}}},qU={names:[`MD058`,`blanks-around-tables`],description:`Tables should be surrounded by blank lines`,tags:[`table`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=$([`blockQuotePrefix`,`linePrefix`]),i=$([`table`]);for(let e of i){let i=e.startLine;(0,Z.isBlankLine)(n[i-2])||(0,Z.addErrorContext)(t,i,n[i-1].trim(),void 0,void 0,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(r,i)});let a=e.endLine;(0,Z.isBlankLine)(n[a])||(0,Z.addErrorContext)(t,a,n[a-1].trim(),void 0,void 0,void 0,{lineNumber:a+1,insertText:(0,Q.getBlockQuotePrefixText)(r,a)})}}},JU=new Set([`codeText`,`htmlText`]),YU=[`click here`,`here`,`link`,`more`];function XU(e){return e.replace(/[\W_]+/g,` `).replace(/\s+/g,` `).toLowerCase().trim()}var ZU={names:[`MD059`,`descriptive-link-text`],description:`Link text should be descriptive`,tags:[`accessibility`,`links`],parser:`micromark`,function:function(e,t){let n=new Set((e.config.prohibited_texts||YU).map(XU));if(n.size>0){let e=$([`link`]);for(let r of e){let e=(0,Q.getDescendantsByType)(r,[`label`,`labelText`]);for(let r of e){let{children:e,endColumn:i,endLine:a,parent:o,startColumn:s,startLine:c,text:l}=r;if(!e.some(e=>JU.has(e.type))&&n.has(XU(l))){let e=c===a?[s,i-s]:void 0;(0,Z.addErrorContext)(t,c,o.text,void 0,void 0,e)}}}}}};function QU({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}var $U=QU();function eW(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(``)?e:e.replace($U,``)}var tW=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],nW=[12288,12288,65281,65376,65504,65510],rW=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],iW=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},aW=19968,[oW,sW]=cW(rW);function cW(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(aW>=i&&aW<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var lW=e=>e<161||e>1114109?!1:iW(tW,e),uW=e=>e<12288||e>65510?!1:iW(nW,e),dW=e=>e>=oW&&e<=sW?!0:e<4352||e>262141?!1:iW(rW,e);function fW(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function pW(e,{ambiguousAsWide:t=!1}={}){return fW(e),uW(e)||dW(e)||t&&lW(e)?2:1}var mW=new Intl.Segmenter,hW=RegExp(`^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})+$`,`v`),gW=RegExp(`^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+`,`v`),_W=RegExp(`^\\p{RGI_Emoji}$`,`v`),vW=/^[\d#*]\u20E3$/,yW=/\p{Extended_Pictographic}/gu;function bW(e){if(e.length>50)return!1;if(vW.test(e))return!0;if(e.includes(``)){let t=e.match(yW);return t!==null&&t.length>=2}return!1}function xW(e){return e.replace(gW,``)}function SW(e){return hW.test(e)}function CW(e){return e>=4352&&e<=4447||e>=43360&&e<=43388}function wW(e){return e>=4448&&e<=4519||e>=55216&&e<=55238}function TW(e){return e>=4520&&e<=4607||e>=55243&&e<=55291}function EW(e){return CW(e)||wW(e)||TW(e)}function DW(e,t){let n=[];for(let t of e)hW.test(t)||n.push(t.codePointAt(0));if(n.length===0)return;let r=0;for(let e=0;e<n.length;e++){let i=n[e];if(!EW(i)){if(r===0)return;for(let i=e;i<n.length;i++)r+=pW(n[i],t);return r}if(CW(i)&&wW(n[e+1])){r+=2,e+=TW(n[e+2])?2:1;continue}r+=pW(i,t)}return r}function OW(e,t){let n=0,r=!0;for(let i of e){if(r){r=!1;continue}i>=``&&i<=``&&(n+=pW(i.codePointAt(0),t))}return n}function kW(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(!r&&(i.includes(`\x1B`)||i.includes(``))&&(i=eW(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of mW.segment(i)){if(SW(e))continue;if(_W.test(e)||bW(e)){a+=2;continue}let t=xW(e),n=DW(t,o);if(n!==void 0){a+=n;continue}let r=t.codePointAt(0);a+=pW(r,o),a+=OW(t,o)}return a}function AW(e,t,n,r,i){e.push({lineNumber:t,detail:r,range:[n,1],fixInfo:i})}function jW(e,t){return(0,Q.filterByTypes)(t.children,[`tableCellDivider`]).map(n=>({actual:n.startColumn,effective:kW(e[t.startLine-1].slice(0,n.startColumn-1))}))}function MW(e,t,n){let r=[],i=t[0],a=jW(e,i);for(let i of t.slice(1)){let t=new Set(a.map(e=>e.effective)),o=jW(e,i);for(let e of o)t.size>0&&!t.delete(e.effective)&&AW(r,i.startLine,e.actual,n)}return r}var NW={names:[`MD060`,`table-column-style`],description:`Table column style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`any`),r=n===`any`||n===`aligned`,i=n===`any`||n===`compact`,a=n===`any`||n===`tight`,o=!!e.config.aligned_delimiter,s=e.lines,c=$([`table`]);for(let e of c){let n=(0,Q.filterByTypes)(e.children,[`tableDelimiterRow`,`tableRow`]),c=[];r&&c.push(...MW(s,n,`Table pipe does not align with header for style "aligned"`));let l=[],u=[];if((i||a)&&!(r&&c.length===0)){if(o){let e=MW(s,n.slice(0,2),`Table pipe does not align with header for option "aligned_delimiter"`);l.push(...e),u.push(...e)}for(let e of n){let t=(0,Q.filterByTypes)(e.children,[`tableCellDivider`,`tableContent`,`whitespace`]);for(let n=0;n<t.length;n++){let{startColumn:r,startLine:i,type:a}=t[n];if(a===`tableCellDivider`){let a=t[n-1];a&&(a.type===`whitespace`?(a.text.length!==1&&AW(l,i,r,`Table pipe has extra space to the left for style "compact"`,{editColumn:a.startColumn,deleteCount:a.text.length-1}),AW(u,i,r,`Table pipe has space to the left for style "tight"`,{editColumn:a.startColumn,deleteCount:a.text.length})):AW(l,i,r,`Table pipe is missing space to the left for style "compact"`,{editColumn:a.endColumn,insertText:` `}));let o=t[n+1];o&&(o.type===`whitespace`?o.endColumn!==e.endColumn&&(o.text.length!==1&&AW(l,i,r,`Table pipe has extra space to the right for style "compact"`,{editColumn:o.startColumn,deleteCount:o.text.length-1}),AW(u,i,r,`Table pipe has space to the right for style "tight"`,{editColumn:o.startColumn,deleteCount:o.text.length})):AW(l,i,r,`Table pipe is missing space to the right for style "compact"`,{editColumn:o.startColumn,insertText:` `}))}}}}let d=c;i&&(l.length<d.length||!r)&&(d=l),a&&(u.length<d.length||!r&&!i)&&(d=u);for(let e of d)t(e)}}},[PW,FW]=WV,[IW,LW]=xU,RW=[xV,SV,DV,OV,jV,MV,PV,IV,LV,zV,VV,HV,PW,GV,FW,YV,XV,ZV,QV,$V,tH,rH,sH,cH,dH,pH,hH,gH,_H,bH,xH,SH,wH,TH,OH,kH,AH,lU,fU,mU,hU,_U,IW,LW,AU,jU,NU,RU,WU,KU,qU,ZU,NW];for(let e of RW){let t=e.names[0].toLowerCase();e.information=new URL(`${gV}/blob/v${_V}/doc/${t}.md`)}function zW(e,t,n){let r=null,i=null,a=[],o=0;return(n||[JSON.parse]).every(e=>{try{let n=e(t);return r=n&&typeof n==`object`&&!Array.isArray(n)?n:{},!1}catch(e){a.push(`Parser ${o++}: ${e?.message}`)}return!0})&&(a.unshift(`Unable to parse '${e}'`),i=a.join(`; `)),{config:r,message:i}}function BW(e,t){let n=null;if(e.length===RW.length)return n;let r={};for(let[i,a]of e.entries()){let e=i-RW.length;function o(t,n){return Error(`Property '${t}' of custom rule at index ${e} is incorrect: '${n}'.`)}for(let e of[`names`,`tags`]){let t=a[e];!n&&(!t||!Array.isArray(t)||t.length===0||!t.every(Z.isString)||t.some(Z.isEmptyString))&&(n=o(e,t))}for(let e of[[`description`,`string`],[`function`,`function`]]){let t=e[0],r=a[t];!n&&(!r||typeof r!==e[1])&&(n=o(t,r))}if(!n&&a.parser!==void 0&&a.parser!==`markdownit`&&a.parser!==`micromark`&&a.parser!==`none`&&(n=o(`parser`,a.parser)),!n&&a.information&&!Z.isUrl(a.information)&&(n=o(`information`,a.information)),!n&&a.asynchronous!==void 0&&typeof a.asynchronous!=`boolean`&&(n=o(`asynchronous`,a.asynchronous)),!n&&a.asynchronous&&t&&(n=Error(`Custom rule `+a.names.join(`/`)+` at index `+e+` is asynchronous and can not be used in a synchronous context.`)),!n){for(let t of a.names){let i=t.toUpperCase();!n&&r[i]!==void 0&&(n=Error(`Name '`+t+`' of custom rule at index `+e+` is already used as a name or tag.`)),r[i]=!0}for(let t of a.tags){let i=t.toUpperCase();!n&&r[i]&&(n=Error(`Tag '`+t+`' of custom rule at index `+e+` is already used as a name.`)),r[i]=!1}}}return n}function VW(e,t){let n=[];if(t){let r=e.match(t);if(r&&!r.index){let t=r[0];e=e.slice(t.length),n=t.split(Z.newLineRe),n.length>0&&n[n.length-1]===``&&n.length--}}return{content:e,frontMatterLines:n}}function HW(e){let t={};for(let n of e){let e=n.names[0].toUpperCase();for(let r of n.names){let n=r.toUpperCase();t[n]=[e]}for(let r of n.tags){let n=r.toUpperCase(),i=t[n]||[];i.push(e),t[n]=i}}return t}function UW(e,t,n){let r=!0,i=`error`;Object.entries(t).every(([e,t])=>e.toUpperCase()===`DEFAULT`?(r=!!t,t===`warning`&&(i=`warning`),!1):!0);let a={},o=new Map,s=new Map,c=Object.freeze({});for(let t of e.map(e=>e.names[0].toUpperCase()))a[t]=c,o.set(t,r),s.set(t,i);for(let[e,r]of Object.entries(t)){let t=e.toUpperCase(),i=!1,c=`error`,l={};if(r)if(r instanceof Object){let e=r;i=e.enabled===void 0?!0:!!e.enabled,c=e.severity===`warning`?`warning`:`error`,l=Object.fromEntries(Object.entries(r).filter(([e])=>e!==`enabled`&&e!==`severity`))}else i=!0,c=r===`warning`?`warning`:`error`;for(let e of n[t]||[])Object.freeze(l),a[e]=l,o.set(e,i),s.set(e,c)}return{effectiveConfig:a,rulesEnabled:o,rulesSeverity:s}}function WW(e,t,n,r,i,a,o){let s=new Map,c=s,l=Array(1+n.length);function u(e,t,n=void 0){for(let[i,a]of e.entries()){if(!r){let e=null;for(;e=Z.inlineCommentStartRe.exec(a);){let n=e[2].toUpperCase(),r=e.index+e[1].length,o=a.indexOf(`-->`,r);if(o===-1)break;t(n,a.slice(r,o),i+1)}}n&&n()}}function d(e,t){if(e===`CONFIGURE-FILE`){let{config:e}=zW(`CONFIGURE-FILE`,t,a);e&&(i={...i,...e})}}function f(e,t,n){n=new Map(n);let r=e.startsWith(`ENABLE`),i=t&&t.trim(),a=i?i.toUpperCase().split(/\s+/):b;for(let e of a)for(let t of o[e]||[])n.set(t,r);return n}function p(e,t){(e===`ENABLE-FILE`||e===`DISABLE-FILE`)&&(s=f(e,t,s))}function m(e,t){e===`CAPTURE`?c=s:e===`RESTORE`?s=c:(e===`ENABLE`||e===`DISABLE`)&&(s=f(e,t,s))}function h(){l.push(s)}function g(e,t,r){let i=e===`DISABLE-LINE`,a=e===`DISABLE-NEXT-LINE`;if(i||a){let i=n.length+r+ +!!a;l[i]=f(e,t,l[i])}}u([t.join(`
|
|
386
|
-
`)],d);let{effectiveConfig:_,rulesEnabled:v,rulesSeverity:y}=UW(e,i,o),b=[...v.keys()];return s=new Map(v),c=s,u(t,p),u(t,m,h),u(t,g),{effectiveConfig:_,enabledRulesPerLineNumber:l,enabledRuleList:e.filter(e=>{let t=e.names[0].toUpperCase();return l.some(e=>e.get(t))}),rulesSeverity:y}}function GW(e,t,n,i,a,s,c,l,u,d,f,p){let m=e=>p(e instanceof Error?e:Error(e));i=i.replace(/^\uFEFF/,``);let h=VW(i,l),{frontMatterLines:g}=h;i=h.content;let{effectiveConfig:_,enabledRulesPerLineNumber:v,enabledRuleList:y,rulesSeverity:b}=WW(e,i.split(Z.newLineRe),g,d,s,c,t),x=y.some(e=>e.parser===`markdownit`||e.parser===void 0),S=y.some(e=>e.parser===`micromark`),C=e.length!==RW.length,w=S?sU(i,{freezeTokens:C}):[],
|
|
387
|
-
`){let{editColumn:r,deleteCount:i,insertText:a}=YW(t),o=r-1;return i===-1?null:e.slice(0,o)+a.replace(/\n/g,n)+e.slice(o+i)}function ZW(e,t){let n=Z.getPreferredLineEnding(e,cV),r=e.split(Z.newLineRe),i=t.filter(e=>e.fixInfo).map(e=>YW(e.fixInfo,e.lineNumber));i.sort((e,t)=>{let n=e.deleteCount===-1,r=t.deleteCount===-1;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let a={};i=i.filter(e=>{let t=e.lineNumber!==a.lineNumber||e.editColumn!==a.editColumn||e.deleteCount!==a.deleteCount||e.insertText!==a.insertText;return a=e,t}),a={lineNumber:-1};for(let e of i)e.lineNumber===a.lineNumber&&e.editColumn===a.editColumn&&!e.insertText&&e.deleteCount>0&&a.insertText&&!a.deleteCount&&(e.insertText=a.insertText,a.lineNumber=0),a=e;i=i.filter(e=>e.lineNumber);let o=-1,s=-1;for(let e of i){let{lineNumber:t,editColumn:i,deleteCount:a}=e,c=t-1,l=i-1;(c!==o||a===-1||l+a<=s-(a>0?0:1))&&(r[c]=XW(r[c],e,n)),o=c,s=l}return r.filter(e=>e!==null).join(n)}function QW(e,t){let n=typeof e==`string`?e:e.origin,r=typeof e==`string`?void 0:e.url,i=n.split(`:`),a=i[1]?i[0]:void 0,o=i[1];return Object.defineProperty(s,`name`,{value:n}),s;function s(e){let[n,i]=$W(o,e),s=n===2;if(n)return function(e,n,c){let l=n.messages.length-1;
|
|
386
|
+
`)],d);let{effectiveConfig:_,rulesEnabled:v,rulesSeverity:y}=UW(e,i,o),b=[...v.keys()];return s=new Map(v),c=s,u(t,p),u(t,m,h),u(t,g),{effectiveConfig:_,enabledRulesPerLineNumber:l,enabledRuleList:e.filter(e=>{let t=e.names[0].toUpperCase();return l.some(e=>e.get(t))}),rulesSeverity:y}}function GW(e,t,n,i,a,s,c,l,u,d,f,p){let m=e=>p(e instanceof Error?e:Error(e));i=i.replace(/^\uFEFF/,``);let h=VW(i,l),{frontMatterLines:g}=h;i=h.content;let{effectiveConfig:_,enabledRulesPerLineNumber:v,enabledRuleList:y,rulesSeverity:b}=WW(e,i.split(Z.newLineRe),g,d,s,c,t),x=y.some(e=>e.parser===`markdownit`||e.parser===void 0),S=y.some(e=>e.parser===`micromark`),C=e.length!==RW.length,w=S?sU(i,{freezeTokens:C}):[],ee=i;i=Z.clearHtmlCommentText(i);let T=i.split(Z.newLineRe),E=e=>{let t=Object.freeze({markdownit:Object.freeze({tokens:e})}),r=Object.freeze({micromark:Object.freeze({tokens:w})}),i=Object.freeze({}),a={name:n,version:_V,lines:Object.freeze(T),frontMatterLines:Object.freeze(g)};fV({...a,parsers:r,config:{}});let o=[],s=s=>{let c=s.names[0].toUpperCase(),l={},d=i;s.parser===void 0?(l.tokens=e,d=t):s.parser===`markdownit`?d=t:s.parser===`micromark`&&(d=r);let f=Object.freeze({...a,...l,parsers:d,config:_[c]});function p(e){throw Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${n}'.`)}function m(e){(!e||!Z.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>T.length)&&p(`lineNumber`);let t=e.lineNumber+g.length;if(!v[t].get(c))return;e.detail&&!Z.isString(e.detail)&&p(`detail`),e.context&&!Z.isString(e.context)&&p(`context`),e.information&&!Z.isUrl(e.information)&&p(`information`),e.range&&(!Array.isArray(e.range)||e.range.length!==2||!Z.isNumber(e.range[0])||e.range[0]<1||!Z.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>T[e.lineNumber-1].length)&&p(`range`);let n=e.fixInfo,r={};if(n){Z.isObject(n)||p(`fixInfo`),n.lineNumber!==void 0&&((!Z.isNumber(n.lineNumber)||n.lineNumber<1||n.lineNumber>T.length)&&p(`fixInfo.lineNumber`),r.lineNumber=n.lineNumber+g.length);let t=n.lineNumber||e.lineNumber;n.editColumn!==void 0&&((!Z.isNumber(n.editColumn)||n.editColumn<1||n.editColumn>T[t-1].length+1)&&p(`fixInfo.editColumn`),r.editColumn=n.editColumn),n.deleteCount!==void 0&&((!Z.isNumber(n.deleteCount)||n.deleteCount<-1||n.deleteCount>T[t-1].length)&&p(`fixInfo.deleteCount`),r.deleteCount=n.deleteCount),n.insertText!==void 0&&(Z.isString(n.insertText)||p(`fixInfo.insertText`),r.insertText=n.insertText)}let i=e.information||s.information;o.push({lineNumber:t,ruleNames:s.names,ruleDescription:s.description,ruleInformation:i?i.href:null,errorDetail:e.detail?.replace(Z.newLineRe,` `)||null,errorContext:e.context?.replace(Z.newLineRe,` `)||null,errorRange:e.range?[...e.range]:null,fixInfo:n?r:null,severity:b.get(c)})}let h=e=>m({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),y=()=>s.function(f,m);if(s.asynchronous){let e=Promise.resolve().then(y);return u?e.catch(h):e}try{y()}catch(e){if(u)h(e);else throw e}return null},c=()=>(o.sort((e,t)=>e.ruleNames[0].localeCompare(t.ruleNames[0])||e.lineNumber-t.lineNumber),o),l=y.filter(e=>e.asynchronous),d=y.filter(e=>!e.asynchronous),f=[...l,...d],h=()=>p(null,c());try{let e=f.map(s);l.length>0?Promise.all(e.slice(0,l.length)).then(h).catch(m):h()}catch(e){m(e)}finally{fV()}};!x||f?E(x?(0,bV.requireMarkdownItCjs)().getMarkdownItTokens(a(),ee,T):[]):Promise.all([o(()=>import(`./markdownit-Du2gL9_G.js`).then(e=>r(e.t(),1)),__vite__mapDeps([0,1]),import.meta.url),new Promise(e=>e(a()))]).then(([e,t])=>{E(e.getMarkdownItTokens(t,ee,T))}).catch(m)}function KW(e,t,n,r,i,a,o,s,c,l,u,d){function f(l,f){return l?d(l):GW(e,t,n,f,r,i,a,o,s,c,u,d)}u?f(null,l.readFileSync(n,`utf8`)):l.readFile(n,`utf8`,f)}function qW(e,t,n){e||={},n||=()=>{};let r=[e.customRules||[]].flat().map(e=>({names:Z.cloneIfArray(e.names),description:e.description,information:Z.cloneIfUrl(e.information),tags:Z.cloneIfArray(e.tags),parser:e.parser,asynchronous:e.asynchronous,function:e.function})),i=RW.concat(r),a=BW(i,t);if(a){n(a);return}let o=[];Array.isArray(e.files)?o=[...e.files]:e.files&&(o=[String(e.files)]);let s=e.strings||{},c=Object.keys(s),l=e.config||{default:!0},u=e.configParsers||void 0,d=e.frontMatter===void 0?Z.frontMatterRe:e.frontMatter,f=!!e.handleRuleFailures,p=!!e.noInlineConfig,m=e.markdownItFactory||(()=>{throw Error(`The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set.`)}),h=e.fs||sV,g=HW(i),_={},v=!1,y=0;function b(){let e;function r(r,i){return y--,r?(v=!0,n(r)):(_[e]=i,t||b(),null)}if(!v){if(e=o.shift())y++,KW(i,g,e,m,l,u,d,f,p,h,t,r);else if(e=c.shift())y++,GW(i,g,e,s[e]||``,m,l,u,d,f,p,t,r);else if(y===0){v=!0;let e=Object.entries(_);e.sort(([e],[t])=>e.localeCompare(t));let t=Object.fromEntries(e);return n(null,t)}}return null}if(t)for(;!v;)b();else b(),b(),b(),b(),b(),b(),b(),b()}function JW(e){let t=null;return qW(e,!0,function(e,n){if(e)throw e;t=n}),t}function YW(e,t=0){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||``}}function XW(e,t,n=`
|
|
387
|
+
`){let{editColumn:r,deleteCount:i,insertText:a}=YW(t),o=r-1;return i===-1?null:e.slice(0,o)+a.replace(/\n/g,n)+e.slice(o+i)}function ZW(e,t){let n=Z.getPreferredLineEnding(e,cV),r=e.split(Z.newLineRe),i=t.filter(e=>e.fixInfo).map(e=>YW(e.fixInfo,e.lineNumber));i.sort((e,t)=>{let n=e.deleteCount===-1,r=t.deleteCount===-1;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let a={};i=i.filter(e=>{let t=e.lineNumber!==a.lineNumber||e.editColumn!==a.editColumn||e.deleteCount!==a.deleteCount||e.insertText!==a.insertText;return a=e,t}),a={lineNumber:-1};for(let e of i)e.lineNumber===a.lineNumber&&e.editColumn===a.editColumn&&!e.insertText&&e.deleteCount>0&&a.insertText&&!a.deleteCount&&(e.insertText=a.insertText,a.lineNumber=0),a=e;i=i.filter(e=>e.lineNumber);let o=-1,s=-1;for(let e of i){let{lineNumber:t,editColumn:i,deleteCount:a}=e,c=t-1,l=i-1;(c!==o||a===-1||l+a<=s-(a>0?0:1))&&(r[c]=XW(r[c],e,n)),o=c,s=l}return r.filter(e=>e!==null).join(n)}function QW(e,t){let n=typeof e==`string`?e:e.origin,r=typeof e==`string`?void 0:e.url,i=n.split(`:`),a=i[1]?i[0]:void 0,o=i[1];return Object.defineProperty(s,`name`,{value:n}),s;function s(e){let[n,i]=$W(o,e),s=n===2;if(n)return function(e,n,c){let l=n.messages.length-1;oe(t,function(e){let t=n.messages;if(e&&!t.includes(e))try{n.fail(e)}catch{}for(;++l<t.length;)Object.assign(t[l],{fatal:s,ruleId:o,source:a,url:r});c()})(e,n,i)}}}function $W(e,t){if(Array.isArray(t)){let[n,r]=t;switch(n){case!1:case 0:case`off`:return[0,r];case!0:case 1:case`on`:case`warn`:return[1,r];case 2:case`error`:return[2,r];default:if(typeof n==`number`)throw Error("Incorrect severity `"+n+"` for `"+e+"`, expected 0, 1, or 2");return[1,t]}}return[1,t]}function eG(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return Pe(e,n)}}var tG=a(((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 ee=l+m-x;if(ee>=0&&ee<u&&f[ee]!=-1){var T=o-f[ee];if(C>=T)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var E=-b+v;E<=b-y;E+=2){for(var ee=l+E,T=E==-b||E!=b&&f[ee-1]<f[ee+1]?f[ee+1]:f[ee-1]+1,te=T-E;T<o&&te<s&&e.charAt(o-T-1)==t.charAt(s-te-1);)T++,te++;if(f[ee]=T,T>o)y+=2;else if(te>s)v+=2;else if(!h){var S=l+m-E;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(T=o-T,C>=T)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(`
|
|
388
388
|
`,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(`
|
|
389
389
|
`),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<o.length;){var l=o[s].match(c);if(!l)throw Error(`Invalid patch string: `+o[s]);var u=new n.patch_obj;for(t.push(u),u.start1=parseInt(l[1],10),l[2]===``?(u.start1--,u.length1=1):l[2]==`0`?u.length1=0:(u.start1--,u.length1=parseInt(l[2],10)),u.start2=parseInt(l[3],10),l[4]===``?(u.start2--,u.length2=1):l[4]==`0`?u.length2=0:(u.start2--,u.length2=parseInt(l[4],10)),s++;s<o.length;){var d=o[s].charAt(0);try{var f=decodeURI(o[s].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+f)}if(d==`-`)u.diffs.push(new n.Diff(r,f));else if(d==`+`)u.diffs.push(new n.Diff(i,f));else if(d==` `)u.diffs.push(new n.Diff(a,f));else if(d==`@`)break;else if(d!==``)throw Error(`Invalid patch mode "`+d+`" in: `+f);s++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){for(var e=this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1,t=this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2,n=[`@@ -`+e+` +`+t+` @@
|
|
390
390
|
`],o,s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:o=`+`;break;case r:o=`-`;break;case a:o=` `;break}n[s+1]=o+encodeURI(this.diffs[s][1])+`
|
|
@@ -396,7 +396,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
396
396
|
`,PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL:`Could not find a chat model defined in the secure proxy plugin configuration.
|
|
397
397
|
Please provide a chat model before proceeding with creating an answer session.
|
|
398
398
|
Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#plugin-secure-proxy
|
|
399
|
-
`,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:`The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.`,PLUGIN_COMPONENT_CONFLICT:`The component "%s" is already defined. The plugin "%s" is trying to redefine it.`};function IG(e,...t){let n=Error(pG(FG[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function LG(e){return{raw:Number(e),formatted:_G(e)}}function RG(e){if(e.id){if(typeof e.id!=`string`)throw IG(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return yG()}function zG(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(t!==void 0&&!(r===`geopoint`&&typeof t==`object`&&typeof t.lon==`number`&&typeof t.lat==`number`)&&!(r===`enum`&&(typeof t==`string`||typeof t==`number`))){if(r===`enum[]`&&Array.isArray(t)){let e=t.length;for(let r=0;r<e;r++)if(typeof t[r]!=`string`&&typeof t[r]!=`number`)return n+`.`+r;continue}if(UG(r)){let e=KG(r);if(!Array.isArray(t)||t.length!==e)throw IG(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(WG(r)){if(!Array.isArray(t))return n;let e=GG(r),i=t.length;for(let r=0;r<i;r++)if(typeof t[r]!==e)return n+`.`+r;continue}if(typeof r==`object`){if(!t||typeof t!=`object`)return n;let e=zG(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}var BG={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},VG={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function HG(e){return e===`geopoint`}function UG(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function WG(e){return typeof e==`string`&&BG[e]}function GG(e){return VG[e]}function KG(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw IG(`INVALID_VECTOR_VALUE`,e);case t<=0:throw IG(`INVALID_VECTOR_SIZE`,e);default:return t}}function qG(){return{idToInternalId:new Map,internalIdToId:[],save:JG,load:YG}}function JG(e){return{internalIdToId:e.internalIdToId}}function YG(e,t){let{internalIdToId:n}=t;e.internalDocumentIDStore.idToInternalId.clear(),e.internalDocumentIDStore.internalIdToId=[];let r=n.length;for(let t=0;t<r;t++){let r=n[t];e.internalDocumentIDStore.idToInternalId.set(r,t+1),e.internalDocumentIDStore.internalIdToId.push(r)}}function XG(e,t){if(typeof t==`string`){let n=e.idToInternalId.get(t);if(n)return n;let r=e.idToInternalId.size+1;return e.idToInternalId.set(t,r),e.internalIdToId.push(t),r}return t>e.internalIdToId.length?XG(e,t.toString()):t}function ZG(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function QG(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function $G(e,t){let n=XG(e.sharedInternalDocumentStore,t);return e.docs[n]}function eK(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=XG(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function tK(e){return e.docs}function nK(e,t,n,r){return e.docs[n]===void 0?(e.docs[n]=r,e.count++,!0):!1}function rK(e,t){let n=XG(e.sharedInternalDocumentStore,t);return e.docs[n]===void 0?!1:(delete e.docs[n],e.count--,!0)}function iK(e){return e.count}function aK(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function oK(e){return{docs:e.docs,count:e.count}}function sK(){return{create:QG,get:$G,getMultiple:eK,getAll:tK,store:nK,remove:rK,count:iK,load:aK,save:oK}}var cK=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function lK(e,t){let n=[],r=e.plugins?.length;if(!r)return n;for(let i=0;i<r;i++)try{let r=e.plugins[i];typeof r[t]==`function`&&n.push(r[t])}catch(e){throw console.error(`Caught error in getAllPluginsByHook:`,e),IG(`PLUGIN_CRASHED`)}return n}var uK=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],dK=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function fK(e,t,n,r){if(e.some(OG))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function pK(e,t,n){if(e.some(OG))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function mK(e,t,n,r,i){if(e.some(OG))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function hK(e,t,n,r){if(e.some(OG))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function gK(e,t){if(e.some(OG))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var _K=class e{k;v;l=null;r=null;h=1;constructor(e,t){this.k=e,this.v=new Set(t)}updateHeight(){this.h=Math.max(e.getHeight(this.l),e.getHeight(this.r))+1}static getHeight(e){return e?e.h:0}getBalanceFactor(){return e.getHeight(this.l)-e.getHeight(this.r)}rotateLeft(){let e=this.r;return this.r=e.l,e.l=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.l;return this.l=e.r,e.r=this,this.updateHeight(),e.updateHeight(),e}toJSON(){return{k:this.k,v:Array.from(this.v),l:this.l?this.l.toJSON():null,r:this.r?this.r.toJSON():null,h:this.h}}static fromJSON(t){let n=new e(t.k,t.v);return n.l=t.l?e.fromJSON(t.l):null,n.r=t.r?e.fromJSON(t.r):null,n.h=t.h,n}},vK=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new _K(e,t))}insert(e,t,n=1e3){this.root=this.insertNode(this.root,e,t,n)}insertMultiple(e,t,n=1e3){for(let r of t)this.insert(e,r,n)}rebalance(){this.root&&=this.rebalanceNode(this.root)}toJSON(){return{root:this.root?this.root.toJSON():null,insertCount:this.insertCount}}static fromJSON(t){let n=new e;return n.root=t.root?_K.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new _K(t,[n]);let i=[],a=e,o=null;for(;a!==null;)if(i.push({parent:o,node:a}),t<a.k)if(a.l===null){a.l=new _K(t,[n]),i.push({parent:a,node:a.l});break}else o=a,a=a.l;else if(t>a.k)if(a.r===null){a.r=new _K(t,[n]),i.push({parent:a,node:a.r});break}else o=a,a=a.r;else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},yK=class e{numberToDocumentId;constructor(){this.numberToDocumentId=new Map}insert(e,t){this.numberToDocumentId.has(e)?this.numberToDocumentId.get(e).add(t):this.numberToDocumentId.set(e,new Set([t]))}find(e){let t=this.numberToDocumentId.get(e);return t?Array.from(t):null}remove(e){this.numberToDocumentId.delete(e)}removeDocument(e,t){let n=this.numberToDocumentId.get(t);n&&(n.delete(e),n.size===0&&this.numberToDocumentId.delete(t))}contains(e){return this.numberToDocumentId.has(e)}getSize(){let e=0;for(let t of this.numberToDocumentId.values())e+=t.size;return e}filter(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`eq`:{let t=e[n],r=this.numberToDocumentId.get(t);return r?Array.from(r):[]}case`in`:{let t=e[n],r=new Set;for(let e of t){let t=this.numberToDocumentId.get(e);if(t)for(let e of t)r.add(e)}return Array.from(r)}case`nin`:{let t=new Set(e[n]),r=new Set;for(let[e,n]of this.numberToDocumentId.entries())if(!t.has(e))for(let e of n)r.add(e);return Array.from(r)}default:throw Error(`Invalid operation`)}}filterArr(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`containsAll`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e].filter(e=>t.has(e))));return Array.from(r)}case`containsAny`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e,...t]));return Array.from(r)}default:throw Error(`Invalid operation`)}}static fromJSON(t){if(!t.numberToDocumentId)throw Error(`Invalid Flat Tree JSON`);let n=new e;for(let[e,r]of t.numberToDocumentId)n.numberToDocumentId.set(e,new Set(r));return n}toJSON(){return{numberToDocumentId:Array.from(this.numberToDocumentId.entries()).map(([e,t])=>[e,Array.from(t)])}}};function bK(e,t,n){if(n<0)return-1;if(e===t)return 0;let r=e.length,i=t.length;if(r===0)return i<=n?i:-1;if(i===0)return r<=n?r:-1;let a=Math.abs(r-i);if(e.startsWith(t))return a<=n?a:-1;if(t.startsWith(e))return 0;if(a>n)return-1;let o=[];for(let e=0;e<=r;e++){o[e]=[e];for(let t=1;t<=i;t++)o[e][t]=e===0?t:0}for(let a=1;a<=r;a++){let r=1/0;for(let n=1;n<=i;n++)e[a-1]===t[n-1]?o[a][n]=o[a-1][n-1]:o[a][n]=Math.min(o[a-1][n]+1,o[a][n-1]+1,o[a-1][n-1]+1),r=Math.min(r,o[a][n]);if(r>n)return-1}return o[r][i]<=n?o[r][i]:-1}function xK(e,t,n){let r=bK(e,t,n);return{distance:r,isBounded:r>=0}}var SK=class e{k;s;c=new Map;d=new Set;e;w=``;constructor(e,t,n){this.k=e,this.s=t,this.e=n}updateParent(e){this.w=e.w+this.s}addDocument(e){this.d.add(e)}removeDocument(e){return this.d.delete(e)}findAllWords(e,t,n,r){let i=[this];for(;i.length>0;){let a=i.pop();if(a.e){let{w:i,d:o}=a;if(n&&i!==t)continue;if(bG(e,i)!==null)if(r)if(Math.abs(t.length-i.length)<=r&&xK(t,i,r).isBounded)e[i]=[];else continue;else e[i]=[];if(bG(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}else{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||=!0,r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(xK(e,n,r).isBounded&&(i[n]=[]),bG(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}else{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a)if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}else return{};else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},CK=class e extends SK{constructor(){super(``,``,!1)}static fromJSON(t){let n=new e;return n.w=t.w,n.s=t.s,n.e=t.e,n.k=t.k,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([e,t])=>[e,SK.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},wK=2,TK=6371e3,EK=class e{point;docIDs;left;right;parent;constructor(e,t){this.point=e,this.docIDs=new Set(t),this.left=null,this.right=null,this.parent=null}toJSON(){return{point:this.point,docIDs:Array.from(this.docIDs),left:this.left?this.left.toJSON():null,right:this.right?this.right.toJSON():null}}static fromJSON(t,n=null){let r=new e(t.point,t.docIDs);return r.parent=n,t.left&&(r.left=e.fromJSON(t.left,r)),t.right&&(r.right=e.fromJSON(t.right,r)),r}},DK=class e{root;nodeMap;constructor(){this.root=null,this.nodeMap=new Map}getPointKey(e){return`${e.lon},${e.lat}`}insert(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);if(r){t.forEach(e=>r.docIDs.add(e));return}let i=new EK(e,t);if(this.nodeMap.set(n,i),this.root==null){this.root=i;return}let a=this.root,o=0;for(;;){if(o%wK===0)if(e.lon<a.point.lon){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}else if(e.lat<a.point.lat){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}o++}}contains(e){let t=this.getPointKey(e);return this.nodeMap.has(t)}getDocIDsByCoordinates(e){let t=this.getPointKey(e),n=this.nodeMap.get(t);return n?Array.from(n.docIDs):null}removeDocByID(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);r&&(r.docIDs.delete(t),r.docIDs.size===0&&(this.nodeMap.delete(n),this.deleteNode(r)))}deleteNode(e){let t=e.parent,n=e.left?e.left:e.right;n&&(n.parent=t),t?t.left===e?t.left=n:t.right===e&&(t.right=n):(this.root=n,this.root&&(this.root.parent=null))}searchByRadius(t,n,r=!0,i=`asc`,a=!1){let o=a?e.vincentyDistance:e.haversineDistance,s=[{node:this.root,depth:0}],c=[];for(;s.length>0;){let{node:e,depth:i}=s.pop();if(e==null)continue;let a=o(t,e.point);(r?a<=n:a>n)&&c.push({point:e.point,docIDs:Array.from(e.docIDs)}),e.left!=null&&s.push({node:e.left,depth:i+1}),e.right!=null&&s.push({node:e.right,depth:i+1})}return i&&c.sort((e,n)=>{let r=o(t,e.point),a=o(t,n.point);return i.toLowerCase()===`asc`?r-a:a-r}),c}searchByPolygon(t,n=!0,r=null,i=!1){let a=[{node:this.root,depth:0}],o=[];for(;a.length>0;){let{node:r,depth:i}=a.pop();if(r==null)continue;r.left!=null&&a.push({node:r.left,depth:i+1}),r.right!=null&&a.push({node:r.right,depth:i+1});let s=e.isPointInPolygon(t,r.point);(s&&n||!s&&!n)&&o.push({point:r.point,docIDs:Array.from(r.docIDs)})}let s=e.calculatePolygonCentroid(t);if(r){let t=i?e.vincentyDistance:e.haversineDistance;o.sort((e,n)=>{let i=t(s,e.point),a=t(s,n.point);return r.toLowerCase()===`asc`?i-a:a-i})}return o}toJSON(){return{root:this.root?this.root.toJSON():null}}static fromJSON(t){let n=new e;return t.root&&(n.root=EK.fromJSON(t.root),n.buildNodeMap(n.root)),n}buildNodeMap(e){if(e==null)return;let t=this.getPointKey(e.point);this.nodeMap.set(t,e),e.left&&this.buildNodeMap(e.left),e.right&&this.buildNodeMap(e.right)}static calculatePolygonCentroid(e){let t=0,n=0,r=0,i=e.length;for(let a=0,o=i-1;a<i;o=a++){let i=e[a].lon,s=e[a].lat,c=e[o].lon,l=e[o].lat,u=i*l-c*s;t+=u,n+=(i+c)*u,r+=(s+l)*u}t/=2;let a=6*t;return n/=a,r/=a,{lon:n,lat:r}}static isPointInPolygon(e,t){let n=!1,r=t.lon,i=t.lat,a=e.length;for(let t=0,o=a-1;t<a;o=t++){let a=e[t].lon,s=e[t].lat,c=e[o].lon,l=e[o].lat;s>i!=l>i&&r<(c-a)*(i-s)/(l-s)+a&&(n=!n)}return n}static haversineDistance(e,t){let n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=(t.lat-e.lat)*n,o=(t.lon-e.lon)*n,s=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2);return TK*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))}static vincentyDistance(e,t){let n=6378137,r=1/298.257223563,i=(1-r)*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan((1-r)*Math.tan(o)),u=Math.atan((1-r)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),E=w/1024*(256+w*(-128+w*(74-47*w))),D=E*v*(C+E/4*(y*(-1+2*C*C)-E/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*T*(b-D)}},OK=class e{true;false;constructor(){this.true=new Set,this.false=new Set}insert(e,t){t?this.true.add(e):this.false.add(e)}delete(e,t){t?this.true.delete(e):this.false.delete(e)}getSize(){return this.true.size+this.false.size}toJSON(){return{true:Array.from(this.true),false:Array.from(this.false)}}static fromJSON(t){let n=new e;return n.true=new Set(t.true),n.false=new Set(t.false),n}};function kK(e,t,n,r,i,{k:a,b:o,d:s}){return Math.log(1+(n-t+.5)/(t+.5))*(s+e*(a+1))/(e+a*(1-o+o*r/i))}var AK=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=jK(t,this.size);this.vectors.set(e,[n,t])}remove(e){this.vectors.delete(e)}find(e,t,n){return e instanceof Float32Array||(e=new Float32Array(e)),MK(e,n,this.vectors,this.size,t)}toJSON(){let e=[];for(let[t,[n,r]]of this.vectors)e.push([t,[n,Array.from(r)]]);return{size:this.size,vectors:e}}static fromJSON(t){let n=t,r=new e(n.size);for(let[e,[t,i]]of n.vectors)r.vectors.set(e,[t,new Float32Array(i)]);return r}};function jK(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function MK(e,t,n,r,i){let a=jK(e,r),o=[],s=t||n.keys();for(let t of s){let s=n.get(t);if(!s)continue;let c=s[0],l=s[1],u=0;for(let t=0;t<r;t++)u+=e[t]*l[t];let d=u/(a*c);d>=i&&o.push([t,d])}return o}function NK(e,t,n,r,i){let a=XG(e.sharedInternalDocumentStore,n);e.avgFieldLength[t]=((e.avgFieldLength[t]??0)*(i-1)+r.length)/i,e.fieldLengths[t][a]=r.length,e.frequencies[t][a]={}}function PK(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=XG(e.sharedInternalDocumentStore,n),s=a/r.length;e.frequencies[t][o][i]=s,i in e.tokenOccurrences[t]||(e.tokenOccurrences[t][i]=0),e.tokenOccurrences[t][i]=(e.tokenOccurrences[t][i]??0)+1}function FK(e,t,n,r){let i=XG(e.sharedInternalDocumentStore,n);r>1?e.avgFieldLength[t]=(e.avgFieldLength[t]*r-e.fieldLengths[t][i])/(r-1):e.avgFieldLength[t]=void 0,e.fieldLengths[t][i]=void 0,e.frequencies[t][i]=void 0}function IK(e,t,n){e.tokenOccurrences[t][n]--}function LK(e,t,n,r,i=``){r||={sharedInternalDocumentStore:t,indexes:{},vectorIndexes:{},searchableProperties:[],searchablePropertiesWithTypes:{},frequencies:{},tokenOccurrences:{},avgFieldLength:{},fieldLengths:{}};for(let[a,o]of Object.entries(n)){let n=`${i}${i?`.`:``}${a}`;if(typeof o==`object`&&!Array.isArray(o)){LK(e,t,o,r,n);continue}if(UG(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new AK(KG(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new OK,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new vK(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new CK,isArray:e},r.avgFieldLength[n]=0,r.frequencies[n]={},r.tokenOccurrences[n]={},r.fieldLengths[n]={};break;case`enum`:case`enum[]`:r.indexes[n]={type:`Flat`,node:new yK,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new DK,isArray:e};break;default:throw IG(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function RK(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r]);break}}}function zK(e,t,n,r,i,a,o,s,c,l,u){if(UG(o))return BK(t,n,a,r,i);let d=RK(e,t,n,i,s,c,l,u);if(!WG(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function BK(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function VK(e,t,n,r,i,a,o,s,c,l){if(UG(o))return t.vectorIndexes[n].node.remove(i),!0;let{type:u,node:d}=t.indexes[n];switch(u){case`AVL`:return d.removeDocument(a,i),!0;case`Bool`:return d[a?`true`:`false`].delete(i),!0;case`Radix`:{let o=c.tokenize(a,s,n);e.removeDocumentScoreParameters(t,n,r,l);for(let r of o)e.removeTokenScoreParameters(t,n,r),d.removeDocumentByWord(r,i);return!0}case`Flat`:return d.removeDocument(i,a),!0;case`BKD`:return d.removeDocByID(a,i),!1}}function HK(e,t,n,r,i,a,o,s,c,l){if(!WG(o))return VK(e,t,n,r,i,a,o,s,c,l);let u=GG(o),d=a,f=d.length;for(let a=0;a<f;a++)VK(e,t,n,r,i,d[a],u,s,c,l);return!0}function UK(e,t,n,r,i,a,o,s,c,l){let u=Array.from(r),d=e.avgFieldLength[t],f=e.fieldLengths[t],p=e.tokenOccurrences[t],m=e.frequencies[t],h=typeof p[n]==`number`?p[n]??0:0,g=u.length;for(let e=0;e<g;e++){let r=u[e];if(c&&!c.has(r))continue;l.has(r)||l.set(r,new Map);let p=l.get(r);p.set(t,(p.get(t)||0)+1);let g=kK(m?.[r]?.[n]??0,h,i,f[r],d,a);o.has(r)?o.set(r,o.get(r)+g*s):o.set(r,g*s)}}function WK(e,t,n,r,i,a,o,s,c,l,u,d=0){let f=n.tokenize(t,r),p=f.length||1,m=new Map,h=new Map,g=new Map;for(let n of i){if(!(n in e.indexes))continue;let r=e.indexes[n],{type:i}=r;if(i!==`Radix`)throw IG(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw IG(`INVALID_BOOST_VALUE`,d);f.length===0&&!t&&f.push(``);let p=f.length;for(let t=0;t<p;t++){let i=f[t],s=r.node.find({term:i,exact:a,tolerance:o}),p=Object.keys(s);p.length>0&&h.set(i,!0);let _=p.length;for(let t=0;t<_;t++){let r=p[t],i=s[r];UK(e,n,r,i,l,c,g,d,u,m)}}}let _=Array.from(g.entries()).map(([e,t])=>[e,t]).sort((e,t)=>t[1]-e[1]);if(_.length===0)return[];if(d===1)return _;if(d===0){if(p===1)return _;for(let e of f)if(!h.get(e))return[];return _.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1})}let v=_.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1});if(v.length>0){let e=_.filter(([e])=>!v.some(([t])=>t===e)),t=Math.ceil(e.length*d);return[...v,...e.slice(0,t)]}return _}function GK(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:AG(...i.map(n=>GK(e,t,n,r)))}if(`or`in n&&n.or&&Array.isArray(n.or)){let i=n.or;return i.length===0?new Set:i.map(n=>GK(e,t,n,r)).reduce((e,t)=>MG(e,t),new Set)}if(`not`in n&&n.not){let i=n.not,a=new Set,o=e.sharedInternalDocumentStore;for(let e=1;e<=o.internalIdToId.length;e++)a.add(e);return NG(a,GK(e,t,i,r))}let i=Object.keys(n),a=i.reduce((e,t)=>({[t]:new Set,...e}),{});for(let o of i){let i=n[o];if(e.indexes[o]===void 0)throw IG(`UNKNOWN_FILTER_PROPERTY`,o);let{node:s,type:c,isArray:l}=e.indexes[o];if(c===`Bool`){let e=s,t=i?e.true:e.false;a[o]=MG(a[o],t);continue}if(c===`BKD`){let e;if(`radius`in i)e=`radius`;else if(`polygon`in i)e=`polygon`;else throw Error(`Invalid operation ${i}`);if(e===`radius`){let{value:t,coordinates:n,unit:r=`m`,inside:c=!0,highPrecision:l=!1}=i[e],u=EG(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=ZK(a[o],d)}else{let{coordinates:t,inside:n=!0,highPrecision:r=!1}=i[e],c=s.searchByPolygon(t,n,void 0,r);a[o]=ZK(a[o],c)}continue}if(c===`Radix`&&(typeof i==`string`||Array.isArray(i))){for(let e of[i].flat()){let n=t.tokenize(e,r,o);for(let e of n){let t=s.find({term:e,exact:!0});a[o]=tq(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw IG(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=MG(a[o],e);continue}if(c===`AVL`){let e=u[0],t=i[e],n;switch(e){case`gt`:n=s.greaterThan(t,!1);break;case`gte`:n=s.greaterThan(t,!0);break;case`lt`:n=s.lessThan(t,!1);break;case`lte`:n=s.lessThan(t,!0);break;case`eq`:n=s.find(t)??new Set;break;case`between`:{let[e,r]=t;n=s.rangeSearch(e,r);break}default:throw IG(`INVALID_FILTER_OPERATION`,e)}a[o]=MG(a[o],n)}}return AG(...Object.values(a))}function KK(e){return e.searchableProperties}function qK(e){return e.searchablePropertiesWithTypes}function JK(e,t){let{indexes:n,vectorIndexes:r,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}=t,u={},d={};for(let e of Object.keys(n)){let{node:t,type:r,isArray:i}=n[e];switch(r){case`Radix`:u[e]={type:`Radix`,node:CK.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:yK.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:vK.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:DK.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:OK.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:AK.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function YK(e){let{indexes:t,vectorIndexes:n,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}=e,l={};for(let e of Object.keys(n))l[e]=n[e].node.toJSON();let u={};for(let e of Object.keys(t)){let{type:n,node:r,isArray:i}=t[e];n===`Flat`||n===`Radix`||n===`AVL`||n===`BKD`||n===`Bool`?u[e]={type:n,node:r.toJSON(),isArray:i}:(u[e]=t[e],u[e].node=u[e].node.toJSON())}return{indexes:u,vectorIndexes:l,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}}function XK(){return{create:LK,insert:zK,remove:HK,insertDocumentScoreParameters:NK,insertTokenScoreParameters:PK,removeDocumentScoreParameters:FK,removeTokenScoreParameters:IK,calculateResultScores:UK,search:WK,searchByWhereClause:GK,getSearchableProperties:KK,getSearchablePropertiesWithTypes:qK,load:JK,save:YK}}function ZK(e,t){e||=new Set;let n=t.length;for(let r=0;r<n;r++){let n=t[r].docIDs,i=n.length;for(let t=0;t<i;t++)e.add(n[t])}return e}function QK(e,t,n=!1){let r=n?DK.vincentyDistance:DK.haversineDistance,i=[],a=[];for(let{point:n}of e)a.push(r(t,n));let o=Math.max(...a),s=0;for(let{docIDs:t}of e){let e=o-a[s]+1;for(let n of t)i.push([n,e]);s++}return i.sort((e,t)=>t[1]-e[1]),i}function $K(e,t){let n=Object.keys(e);if(n.length!==1)return{isGeoOnly:!1};let r=n[0],i=e[r];if(t.indexes[r]===void 0)return{isGeoOnly:!1};let{type:a}=t.indexes[r];return a===`BKD`&&i&&(`radius`in i||`polygon`in i)?{isGeoOnly:!0,geoProperty:r,geoOperation:i}:{isGeoOnly:!1}}function eq(e,t){let n=e,r=$K(t,n);if(!r.isGeoOnly||!r.geoProperty||!r.geoOperation)return null;let{node:i}=n.indexes[r.geoProperty],a=r.geoOperation,o=i,s;if(`radius`in a){let{value:e,coordinates:t,unit:n=`m`,inside:r=!0,highPrecision:i=!1}=a.radius,c=t,l=EG(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),QK(s,c,i)}else if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=DK.calculatePolygonCentroid(e);return QK(s,r,n)}return null}function tq(e,t){e||=new Set;let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=t[n[i]],a=r.length;for(let t=0;t<a;t++)e.add(r[t])}return e}function nq(e,t,n,r,i){let a={language:e.tokenizer.language,sharedInternalDocumentStore:t,enabled:!0,isSorted:!0,sortableProperties:[],sortablePropertiesWithTypes:{},sorts:{}};for(let[o,s]of Object.entries(n)){let n=`${i}${i?`.`:``}${o}`;if(!r.includes(n)){if(typeof s==`object`&&!Array.isArray(s)){let i=nq(e,t,s,r,n);fG(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!UG(s))switch(s){case`boolean`:case`number`:case`string`:a.sortableProperties.push(n),a.sortablePropertiesWithTypes[n]=s,a.sorts[n]={docs:new Map,orderedDocsToRemove:new Map,orderedDocs:[],type:s};break;case`geopoint`:case`enum`:continue;case`enum[]`:case`boolean[]`:case`number[]`:case`string[]`:continue;default:throw IG(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function rq(e,t,n,r){return r?.enabled===!1?{disabled:!0}:nq(e,t,n,(r||{}).unsortableProperties||[],``)}function iq(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=XG(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&dq(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function aq(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)lq(e,n);e.isSorted=!0}function oq(e,t,n){return t[1].localeCompare(n[1],aG(e))}function sq(e,t){return e[1]-t[1]}function cq(e,t){return t[1]?-1:1}function lq(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=oq.bind(null,e.language);break;case`number`:r=sq.bind(null);break;case`boolean`:r=cq.bind(null);break}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function uq(e){let t=Object.keys(e.sorts);for(let n of t)dq(e,n)}function dq(e,t){let n=e.sorts[t];n.orderedDocsToRemove.size&&(n.orderedDocs=n.orderedDocs.filter(e=>!n.orderedDocsToRemove.has(e[0])),n.orderedDocsToRemove.clear())}function fq(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=XG(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function pq(e,t,n){if(!e.enabled)throw IG(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw IG(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return dq(e,r),aq(e),t.sort((t,n)=>{let r=a.docs.get(XG(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(XG(e.sharedInternalDocumentStore,n[0])),s=r!==void 0,c=o!==void 0;return!s&&!c?0:s?c?i?o-r:r-o:-1:1}),t}function mq(e){return e.enabled?e.sortableProperties:[]}function hq(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function gq(e,t){let n=t;if(!n.enabled)return{enabled:!1};let r=Object.keys(n.sorts).reduce((e,t)=>{let{docs:r,orderedDocs:i,type:a}=n.sorts[t];return e[t]={docs:new Map(Object.entries(r).map(([e,t])=>[+e,t])),orderedDocsToRemove:new Map,orderedDocs:i,type:a},e},{});return{sharedInternalDocumentStore:e,language:n.language,sortableProperties:n.sortableProperties,sortablePropertiesWithTypes:n.sortablePropertiesWithTypes,sorts:r,enabled:!0,isSorted:n.isSorted}}function _q(e){if(!e.enabled)return{enabled:!1};uq(e),aq(e);let t=Object.keys(e.sorts).reduce((t,n)=>{let{docs:r,orderedDocs:i,type:a}=e.sorts[n];return t[n]={docs:Object.fromEntries(r.entries()),orderedDocs:i,type:a},t},{});return{language:e.language,sortableProperties:e.sortableProperties,sortablePropertiesWithTypes:e.sortablePropertiesWithTypes,sorts:t,enabled:e.enabled,isSorted:e.isSorted}}function vq(){return{create:rq,insert:iq,remove:fq,save:_q,load:gq,sortBy:pq,getSortableProperties:mq,getSortablePropertiesWithTypes:hq}}var yq=192,bq=383,xq=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115];function Sq(e){return e<yq||e>bq?e:xq[e-yq]||e}function Cq(e){let t=[];for(let n=0;n<e.length;n++)t[n]=Sq(e.charCodeAt(n));return String.fromCharCode(...t)}var wq={ational:`ate`,tional:`tion`,enci:`ence`,anci:`ance`,izer:`ize`,bli:`ble`,alli:`al`,entli:`ent`,eli:`e`,ousli:`ous`,ization:`ize`,ation:`ate`,ator:`ate`,alism:`al`,iveness:`ive`,fulness:`ful`,ousness:`ous`,aliti:`al`,iviti:`ive`,biliti:`ble`,logi:`log`},Tq={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},Eq=`[^aeiou]`,Dq=`[aeiouy]`,Oq=Eq+`[^aeiouy]*`;Dq+``;var kq=`^(`+Oq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,Aq=`^(`+Oq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`,jq=`^(`+Oq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,Mq=`^(`+Oq+`)?[aeiouy]`;function Nq(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=new RegExp(kq),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=new RegExp(Mq),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+Oq+Dq+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(Mq),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(kq),t&&r.test(t)&&(e=t+wq[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(kq),t&&r.test(t)&&(e=t+Tq[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=new RegExp(jq),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=new RegExp(jq),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(jq),i=new RegExp(Aq),a=RegExp(`^`+Oq+Dq+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=new RegExp(jq),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function Pq(e,t,n=!0){let r=`${this.language}:${e}:${t}`;return n&&this.normalizationCache.has(r)?this.normalizationCache.get(r):this.stopWords?.includes(t)?(n&&this.normalizationCache.set(r,``),``):(this.stemmer&&!this.stemmerSkipProperties.has(e)&&(t=this.stemmer(t)),t=Cq(t),n&&this.normalizationCache.set(r,t),t)}function Fq(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function Iq(e,t,n,r=!0){if(t&&t!==this.language)throw IG(`LANGUAGE_NOT_SUPPORTED`,t);if(typeof e!=`string`)return[e];let i=this.normalizeToken.bind(this,n??``),a;if(n&&this.tokenizeSkipProperties.has(n))a=[i(e,r)];else{let t=rG[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=Fq(a);return this.allowDuplicates?o:Array.from(new Set(o))}function Lq(e={}){if(!e.language)e.language=`english`;else if(!iG.includes(e.language))throw IG(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e))if(e.stemmer){if(typeof e.stemmer!=`function`)throw IG(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=Nq;else throw IG(`MISSING_STEMMER`,e.language);let n;if(e.stopWords!==!1){if(n=[],Array.isArray(e.stopWords))n=e.stopWords;else if(typeof e.stopWords==`function`)n=e.stopWords(n);else if(e.stopWords)throw IG(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw IG(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw IG(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:Iq,language:e.language,stemmer:t,stemmerSkipProperties:new Set(e.stemmerSkipProperties?[e.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(e.tokenizeSkipProperties?[e.tokenizeSkipProperties].flat():[]),stopWords:n,allowDuplicates:!!e.allowDuplicates,normalizeToken:Pq,normalizationCache:new Map};return r.tokenize=Iq.bind(r),r.normalizeToken=Pq,r}function Rq(e){return{sharedInternalDocumentStore:e,rules:new Map}}function zq(e,t){if(e.rules.has(t.id))throw Error(`PINNING_RULE_ALREADY_EXISTS: A pinning rule with id "${t.id}" already exists. Use updateRule to modify it.`);e.rules.set(t.id,t)}function Bq(e,t){if(!e.rules.has(t.id))throw Error(`PINNING_RULE_NOT_FOUND: Cannot update pinning rule with id "${t.id}" because it does not exist. Use addRule to create it.`);e.rules.set(t.id,t)}function Vq(e,t){return e.rules.delete(t)}function Hq(e,t){return e.rules.get(t)}function Uq(e){return Array.from(e.rules.values())}function Wq(e,t){let n=e.toLowerCase().trim(),r=t.pattern.toLowerCase().trim();switch(t.anchoring){case`is`:return n===r;case`starts_with`:return n.startsWith(r);case`contains`:return n.includes(r);default:return!1}}function Gq(e,t){return e?t.conditions.every(t=>Wq(e,t)):!1}function Kq(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())Gq(t,r)&&n.push(r);return n}function qq(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function Jq(e){return{rules:Array.from(e.rules.entries())}}function Yq(){return{create:Rq,addRule:zq,updateRule:Bq,removeRule:Vq,getRule:Hq,getAllRules:Uq,getMatchingRules:Kq,load:qq,save:Jq}}function Xq(e){let t={formatElapsedTime:LG,getDocumentIndexId:RG,getDocumentProperties:CG,validateSchema:zG};for(let n of dK){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw IG(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!uK.includes(t)&&!dK.includes(t))throw IG(`UNSUPPORTED_COMPONENT`,t)}function Zq({schema:e,sort:t,language:n,components:r,id:i,plugins:a}){r||={};for(let t of a??[]){if(!(`getComponents`in t)||typeof t.getComponents!=`function`)continue;let n=t.getComponents(e),i=Object.keys(n);for(let e of i)if(r[e])throw IG(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=yG();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:Lq(o):Lq({language:n??`english`}),r.tokenizer&&n)throw IG(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=qG();s||=XK(),l||=vq(),c||=sK(),u||=Yq(),Xq(r);let{getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,formatElapsedTime:h}=r,g={data:{},caches:{},schema:e,tokenizer:o,index:s,sorter:l,documentsStore:c,pinning:u,internalDocumentIDStore:d,getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeUpsert:[],afterUpsert:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],beforeUpdateMultiple:[],afterUpdateMultiple:[],beforeUpsertMultiple:[],afterUpsertMultiple:[],afterCreate:[],formatElapsedTime:h,id:i,plugins:a,version:Qq()};g.data={index:g.index.create(g,d,e),docs:g.documentsStore.create(g,d),sorting:g.sorter.create(g,d,e,t),pinning:g.pinning.create(d)};for(let e of cK)g[e]=(g[e]??[]).concat(lK(g,e));let _=g.afterCreate;return _&&gK(_,g),g}function Qq(){return`{{VERSION}}`}function $q(e){return e.documentsStore.count(e.data.docs)}function eJ(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw IG(`SCHEMA_VALIDATION_FAILURE`,a);return OG(e.beforeInsert)||OG(e.afterInsert)||OG(e.index.beforeInsert)||OG(e.index.insert)||OG(e.index.afterInsert)?rJ(e,t,n,r,i):iJ(e,t,n,r,i)}var tJ=new Set([`enum`,`enum[]`]),nJ=new Set([`string`,`number`]);async function rJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw IG(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=XG(e.internalDocumentIDStore,s);if(r||await fK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw IG(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];aJ(n,r,e,t)}return await oJ(e,s,u,f,l,n,t,i),r||await fK(e.afterInsert,e,s,t),s}function iJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw IG(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=XG(e.internalDocumentIDStore,s);if(r||fK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw IG(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];aJ(n,r,e,t)}return sJ(e,s,u,f,l,n,t,i),r||fK(e.afterInsert,e,s,t),s}function aJ(e,t,n,r){if(!(HG(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(UG(t)&&Array.isArray(r))&&!(WG(t)&&Array.isArray(r))&&!(tJ.has(t)&&nJ.has(e))&&e!==t)throw IG(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function oJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o];await e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i);let l=e.internalDocumentIDStore.idToInternalId.get(t);await e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),await e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function sJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o],l=XG(e.internalDocumentIDStore,t);e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i),e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function cJ(e,t,n,r,i,a){return OG(e.afterInsertMultiple)||OG(e.beforeInsertMultiple)||OG(e.index.beforeInsert)||OG(e.index.insert)||OG(e.index.afterInsert)?lJ(e,t,n,r,i,a):uJ(e,t,n,r,i,a)}async function lJ(e,t,n=1e3,r,i,a=0){let o=[],s=async a=>{let s=Math.min(a+n,t.length),c=t.slice(a,s);for(let t of c){let n=await eJ(e,t,r,i,{avlRebalanceThreshold:c.length});o.push(n)}return s};return await(async()=>{let e=0;for(;e<t.length;){let t=Date.now();if(e=await s(e),a>0){let e=a-(Date.now()-t);e>0&&PG(e)}}})(),i||await pK(e.afterInsertMultiple,e,t),o}function uJ(e,t,n=1e3,r,i,a=0){let o=[],s=0;function c(){let a=t.slice(s*n,(s+1)*n);if(a.length===0)return!1;for(let t of a){let n=eJ(e,t,r,i,{avlRebalanceThreshold:a.length});o.push(n)}return s++,!0}function l(){let e=Date.now();for(;c();)if(a>0){let t=Date.now()-e;if(t>=a){let e=a-t%a;e>0&&PG(e)}}}return l(),i||pK(e.afterInsertMultiple,e,t),o}function dJ(e,t){return e[1]-t[1]}function fJ(e,t){return t[1]-e[1]}function pJ(e=`desc`){return e.toLowerCase()===`asc`?dJ:fJ}function mJ(e,t,n){let r={},i=t.map(([e])=>e),a=e.documentsStore.getMultiple(e.data.docs,i),o=Object.keys(n),s=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e of o){let t;if(s[e]===`number`){let{ranges:r}=n[e],i=r.length,a=Array.from({length:i});for(let e=0;e<i;e++){let t=r[e];a[e]=[`${t.from}-${t.to}`,0]}t=Object.fromEntries(a)}r[e]={count:0,values:t??{}}}let c=a.length;for(let e=0;e<c;e++){let t=a[e];for(let e of o){let i=e.includes(`.`)?wG(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;hJ(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=hJ(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:gJ(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=gJ(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw IG(`FACET_NOT_SUPPORTED`,a)}}}for(let e of o){let t=r[e];if(t.count=Object.keys(t.values).length,s[e]===`string`){let r=n[e],i=pJ(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function hJ(e,t,n){return r=>{for(let i of e){let e=`${i.from}-${i.to}`;n?.has(e)||r>=i.from&&r<=i.to&&(t[e]===void 0?t[e]=1:(t[e]++,n?.add(e)))}}}function gJ(e,t,n){let r=t===`boolean`?`false`:``;return t=>{let i=t?.toString()??r;n?.has(i)||(e[i]=(e[i]??0)+1,n?.add(i))}}var _J={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},vJ=[`string`,`number`,`boolean`];function yJ(e,t,n){let r=n.properties,i=r.length,a=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e=0;e<i;e++){let t=r[e];if(a[t]===void 0)throw IG(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!vJ.includes(a[t]))throw IG(`INVALID_GROUP_BY_PROPERTY`,t,vJ.join(`, `),a[t])}let o=t.map(([t])=>ZG(e.internalDocumentIDStore,t)),s=e.documentsStore.getMultiple(e.data.docs,o),c=s.length,l=n.maxResult||2**53-1,u=[],d={};for(let e=0;e<i;e++){let t=r[e],n={property:t,perValue:{}},i=new Set;for(let e=0;e<c;e++){let r=s[e],a=wG(r,t);if(a===void 0)continue;let o=typeof a==`boolean`?``+a:a,c=n.perValue[o]??{indexes:[],count:0};c.count>=l||(c.indexes.push(e),c.count++,n.perValue[o]=c,i.add(a))}u.push(Array.from(i)),d[t]=n}let f=bJ(u),p=f.length,m=[];for(let e=0;e<p;e++){let t=f[e],n=t.length,i={values:[],indexes:[]},a=[];for(let e=0;e<n;e++){let n=t[e],o=r[e];a.push(d[o].perValue[typeof n==`boolean`?``+n:n].indexes),i.values.push(n)}i.indexes=SG(a).sort((e,t)=>e-t),i.indexes.length!==0&&m.push(i)}let h=m.length,g=Array.from({length:h});for(let e=0;e<h;e++){let r=m[e],i=n.reduce||_J,a=r.indexes.map(e=>({id:o[e],score:t[e][1],document:s[e]})),c=i.reducer.bind(null,r.values),l=i.getInitialValue(r.indexes.length),u=a.reduce(c,l);g[e]={values:r.values,result:u}}return g}function bJ(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=bJ(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];fG(n,t),i.push(n)}return i}function xJ(e,t,n,r){let i=Kq(t,r);if(i.length===0)return n;let a=i.flatMap(e=>e.consequence.promote);a.sort((e,t)=>e.position-t.position);let o=new Set,s=new Map,c=new Set;for(let t of a){let n=XG(e.internalDocumentIDStore,t.doc_id);if(n!==void 0){if(s.has(n)){let e=s.get(n);t.position<e&&s.set(n,t.position);continue}c.has(t.position)||(o.add(n),s.set(n,t.position),c.add(t.position))}}if(s.size===0)return n;let l=n.filter(([e])=>!o.has(e)),u=[];for(let[t,r]of s.entries())n.find(([e])=>e===t)?u.push([t,1e6-r]):e.documentsStore.get(e.data.docs,t)&&u.push([t,0]);u.sort((e,t)=>(s.get(e[0])??1/0)-(s.get(t[0])??1/0));let d=[],f=new Map;for(let e of u){let t=s.get(e[0]);f.set(t,e)}let p=0,m=0;for(;m<l.length+u.length;)if(f.has(m))d.push(f.get(m)),m++;else if(p<l.length)d.push(l[p]),p++,m++;else break;for(let[e,t]of f.entries())e>=d.length&&d.push(t);return d}function SJ(e,t,n){let{term:r,properties:i}=t,a=e.data.index,o=e.caches.propertiesToSearch;if(!o){let t=e.index.getSearchablePropertiesWithTypes(a);o=e.index.getSearchableProperties(a),o=o.filter(e=>t[e].startsWith(`string`)),e.caches.propertiesToSearch=o}if(i&&i!==`*`){for(let e of i)if(!o.includes(e))throw IG(`UNKNOWN_INDEX`,e,o.join(`, `));o=o.filter(e=>i.includes(e))}let s=Object.keys(t.where??{}).length>0,c;s&&(c=e.index.searchByWhereClause(a,e.tokenizer,t.where,n));let l,u=t.threshold!==void 0&&t.threshold!==null?t.threshold:1;if(r||i){let i=$q(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},DJ(t.relevance),i,c,u),t.exact&&r){let t=r.trim().split(/\s+/);l=l.filter(([n])=>{let r=e.documentsStore.get(e.data.docs,n);if(!r)return!1;for(let e of o){let n=wJ(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${CJ(e)}\\b`).test(n)))return!0}return!1})}}else l=s?eq(a,t.where)||(c?Array.from(c):[]).map(e=>[+e,0]):Object.keys(e.documentsStore.getAll(e.data.docs)).map(e=>[+e,0]);return l}function CJ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function wJ(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}function TJ(e,t,n){let r=vG();function i(){let i=Object.keys(e.data.index.vectorIndexes),a=t.facets&&Object.keys(t.facets).length>0,{limit:o=10,offset:s=0,distinctOn:c,includeVectors:l=!1}=t,u=t.preflight===!0,d=SJ(e,t,n);if(t.sortBy)if(typeof t.sortBy==`function`){let n=d.map(([e])=>e),r=e.documentsStore.getMultiple(e.data.docs,n).map((e,t)=>[d[t][0],d[t][1],e]);r.sort(t.sortBy),d=r.map(([e,t])=>[e,t])}else d=e.sorter.sortBy(e.data.sorting,d,t.sortBy).map(([t,n])=>[XG(e.internalDocumentIDStore,t),n]);else d=d.sort(xG);d=xJ(e,e.data.pinning,d,t.term);let f;u||(f=c?zJ(e,d,s,o,c):BJ(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||DG(p,i)),a&&(p.facets=mJ(e,d,t.facets)),t.groupBy&&(p.groups=yJ(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime(vG()-r),p}async function a(){e.beforeSearch&&await hK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await mK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}var EJ={k:1.2,b:.75,d:.5};function DJ(e){let t=e??{};return t.k=t.k??EJ.k,t.b=t.b??EJ.b,t.d=t.d??EJ.d,t}function OJ(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw IG(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw IG(`UNKNOWN_VECTOR_PROPERTY`,r.property);let a=i.node.size;if(r?.value.length!==a)throw r?.property===void 0||r?.value.length===void 0?IG(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):IG(`INVALID_INPUT_VECTOR`,r.property,a,r.value.length);let o=e.data.index,s;return Object.keys(t.where??{}).length>0&&(s=e.index.searchByWhereClause(o,e.tokenizer,t.where,n)),i.node.find(r.value,t.similarity??.8,s)}function kJ(e,t,n=`english`){let r=vG();function i(){let i=OJ(e,t,n).sort(xG);i=xJ(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=mJ(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];r&&(s||(r[o]=null),u[t]={id:ZG(e.internalDocumentIDStore,n[0]),score:n[1],document:r})}let d=[];t.groupBy&&(d=yJ(e,i,t.groupBy));let f=vG()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:_G(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await hK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await mK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function AJ(e,t,n){let r=NJ(SJ(e,t,n)),i=OJ(e,t,n),a=t.hybridWeights;return IJ(r,i,t.term??``,a)}function jJ(e,t,n){let r=vG();function i(){let i=AJ(e,t,n);i=xJ(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=mJ(e,i,t.facets));let o;t.groupBy&&(o=yJ(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=BJ(e,i,s,c).filter(Boolean),u=vG(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:_G(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||DG(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await hK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await mK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function MJ(e){return e[1]}function NJ(e){let t=Math.max.apply(Math,e.map(MJ));return e.map(([e,n])=>[e,n/t])}function PJ(e,t){return e/t}function FJ(e,t){return(n,r)=>n*e+r*t}function IJ(e,t,n,r){let i=Math.max.apply(Math,e.map(MJ)),a=Math.max.apply(Math,t.map(MJ)),{text:o,vector:s}=r&&r.text&&r.vector?r:LJ(n),c=new Map,l=e.length,u=FJ(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(PJ(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=PJ(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function LJ(e){return{text:.5,vector:.5}}function RJ(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return TJ(e,t,n);if(r===`vector`)return kJ(e,t);if(r===`hybrid`)return jJ(e,t);throw IG(`INVALID_SEARCH_MODE`,r)}function zJ(e,t,n,r,i){let a=e.data.docs,o=new Map,s=[],c=new Set,l=t.length,u=0;for(let d=0;d<l;d++){let l=t[d];if(l===void 0)continue;let[f,p]=l;if(c.has(f))continue;let m=e.documentsStore.get(a,f),h=wG(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:ZG(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function BJ(e,t,n,r){let i=e.data.docs,a=Array.from({length:r}),o=new Set;for(let s=n;s<r+n;s++){let n=t[s];if(n===void 0)break;let[r,c]=n;if(!o.has(r)){let t=e.documentsStore.get(i,r);a[s]={id:ZG(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}var VJ=r(tG(),1),HJ=/[\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF]/g;function UJ(e){return e.replace(HJ,``)}function WJ(e){return e.replace(/[\u0000-\u001F\u007F]/g,` `)}function GJ(e,t){if(e.length<=t)return e;let n=e.slice(0,t),r=n.charCodeAt(n.length-1);return r>=55296&&r<=56319?n.slice(0,-1):n}var KJ=R({at:N(),transport:N(),outcome:N(),reference:N().optional(),error:N().optional(),errorCode:N().optional()}),qJ=R({reason:N(),at:N(),errorCode:N().optional()});R({version:P().int().catch(1),id:N(),createdAt:N(),bundleLevel:N(),zipBytes:P().int().nonnegative().catch(0),zipDeleted:F().optional(),state:N(),systemWide:F().optional(),projectSlug:N().nullable().optional(),reference:N().optional(),lastError:qJ.optional(),attempts:I(KJ).optional(),note:N().optional()}),R({version:P().int().catch(1),id:N().optional(),sentAt:N().optional(),reference:N().optional()});var JJ=`0.0.0-unknown`,YJ={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function XJ({kind:e,runtimeVersion:t}){return{[YJ.protocol]:`2`,[YJ.runtime]:t,[YJ.kind]:e}}function ZJ({kind:e,runtimeVersion:t}){return{clientProtocolVersion:2,clientRuntimeVersion:t,clientKind:e}}var QJ=`extra/screenshot.png`,$J=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)[^"]+/g,replacement:`$1[REDACTED]`}];$J.map(e=>e.name);function eY(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
399
|
+
`,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:`The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.`,PLUGIN_COMPONENT_CONFLICT:`The component "%s" is already defined. The plugin "%s" is trying to redefine it.`};function IG(e,...t){let n=Error(pG(FG[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function LG(e){return{raw:Number(e),formatted:_G(e)}}function RG(e){if(e.id){if(typeof e.id!=`string`)throw IG(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return yG()}function zG(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(t!==void 0&&!(r===`geopoint`&&typeof t==`object`&&typeof t.lon==`number`&&typeof t.lat==`number`)&&!(r===`enum`&&(typeof t==`string`||typeof t==`number`))){if(r===`enum[]`&&Array.isArray(t)){let e=t.length;for(let r=0;r<e;r++)if(typeof t[r]!=`string`&&typeof t[r]!=`number`)return n+`.`+r;continue}if(UG(r)){let e=KG(r);if(!Array.isArray(t)||t.length!==e)throw IG(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(WG(r)){if(!Array.isArray(t))return n;let e=GG(r),i=t.length;for(let r=0;r<i;r++)if(typeof t[r]!==e)return n+`.`+r;continue}if(typeof r==`object`){if(!t||typeof t!=`object`)return n;let e=zG(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}var BG={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},VG={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function HG(e){return e===`geopoint`}function UG(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function WG(e){return typeof e==`string`&&BG[e]}function GG(e){return VG[e]}function KG(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw IG(`INVALID_VECTOR_VALUE`,e);case t<=0:throw IG(`INVALID_VECTOR_SIZE`,e);default:return t}}function qG(){return{idToInternalId:new Map,internalIdToId:[],save:JG,load:YG}}function JG(e){return{internalIdToId:e.internalIdToId}}function YG(e,t){let{internalIdToId:n}=t;e.internalDocumentIDStore.idToInternalId.clear(),e.internalDocumentIDStore.internalIdToId=[];let r=n.length;for(let t=0;t<r;t++){let r=n[t];e.internalDocumentIDStore.idToInternalId.set(r,t+1),e.internalDocumentIDStore.internalIdToId.push(r)}}function XG(e,t){if(typeof t==`string`){let n=e.idToInternalId.get(t);if(n)return n;let r=e.idToInternalId.size+1;return e.idToInternalId.set(t,r),e.internalIdToId.push(t),r}return t>e.internalIdToId.length?XG(e,t.toString()):t}function ZG(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function QG(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function $G(e,t){let n=XG(e.sharedInternalDocumentStore,t);return e.docs[n]}function eK(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=XG(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function tK(e){return e.docs}function nK(e,t,n,r){return e.docs[n]===void 0?(e.docs[n]=r,e.count++,!0):!1}function rK(e,t){let n=XG(e.sharedInternalDocumentStore,t);return e.docs[n]===void 0?!1:(delete e.docs[n],e.count--,!0)}function iK(e){return e.count}function aK(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function oK(e){return{docs:e.docs,count:e.count}}function sK(){return{create:QG,get:$G,getMultiple:eK,getAll:tK,store:nK,remove:rK,count:iK,load:aK,save:oK}}var cK=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function lK(e,t){let n=[],r=e.plugins?.length;if(!r)return n;for(let i=0;i<r;i++)try{let r=e.plugins[i];typeof r[t]==`function`&&n.push(r[t])}catch(e){throw console.error(`Caught error in getAllPluginsByHook:`,e),IG(`PLUGIN_CRASHED`)}return n}var uK=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],dK=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function fK(e,t,n,r){if(e.some(OG))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function pK(e,t,n){if(e.some(OG))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function mK(e,t,n,r,i){if(e.some(OG))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function hK(e,t,n,r){if(e.some(OG))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function gK(e,t){if(e.some(OG))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var _K=class e{k;v;l=null;r=null;h=1;constructor(e,t){this.k=e,this.v=new Set(t)}updateHeight(){this.h=Math.max(e.getHeight(this.l),e.getHeight(this.r))+1}static getHeight(e){return e?e.h:0}getBalanceFactor(){return e.getHeight(this.l)-e.getHeight(this.r)}rotateLeft(){let e=this.r;return this.r=e.l,e.l=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.l;return this.l=e.r,e.r=this,this.updateHeight(),e.updateHeight(),e}toJSON(){return{k:this.k,v:Array.from(this.v),l:this.l?this.l.toJSON():null,r:this.r?this.r.toJSON():null,h:this.h}}static fromJSON(t){let n=new e(t.k,t.v);return n.l=t.l?e.fromJSON(t.l):null,n.r=t.r?e.fromJSON(t.r):null,n.h=t.h,n}},vK=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new _K(e,t))}insert(e,t,n=1e3){this.root=this.insertNode(this.root,e,t,n)}insertMultiple(e,t,n=1e3){for(let r of t)this.insert(e,r,n)}rebalance(){this.root&&=this.rebalanceNode(this.root)}toJSON(){return{root:this.root?this.root.toJSON():null,insertCount:this.insertCount}}static fromJSON(t){let n=new e;return n.root=t.root?_K.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new _K(t,[n]);let i=[],a=e,o=null;for(;a!==null;)if(i.push({parent:o,node:a}),t<a.k)if(a.l===null){a.l=new _K(t,[n]),i.push({parent:a,node:a.l});break}else o=a,a=a.l;else if(t>a.k)if(a.r===null){a.r=new _K(t,[n]),i.push({parent:a,node:a.r});break}else o=a,a=a.r;else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},yK=class e{numberToDocumentId;constructor(){this.numberToDocumentId=new Map}insert(e,t){this.numberToDocumentId.has(e)?this.numberToDocumentId.get(e).add(t):this.numberToDocumentId.set(e,new Set([t]))}find(e){let t=this.numberToDocumentId.get(e);return t?Array.from(t):null}remove(e){this.numberToDocumentId.delete(e)}removeDocument(e,t){let n=this.numberToDocumentId.get(t);n&&(n.delete(e),n.size===0&&this.numberToDocumentId.delete(t))}contains(e){return this.numberToDocumentId.has(e)}getSize(){let e=0;for(let t of this.numberToDocumentId.values())e+=t.size;return e}filter(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`eq`:{let t=e[n],r=this.numberToDocumentId.get(t);return r?Array.from(r):[]}case`in`:{let t=e[n],r=new Set;for(let e of t){let t=this.numberToDocumentId.get(e);if(t)for(let e of t)r.add(e)}return Array.from(r)}case`nin`:{let t=new Set(e[n]),r=new Set;for(let[e,n]of this.numberToDocumentId.entries())if(!t.has(e))for(let e of n)r.add(e);return Array.from(r)}default:throw Error(`Invalid operation`)}}filterArr(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`containsAll`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e].filter(e=>t.has(e))));return Array.from(r)}case`containsAny`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e,...t]));return Array.from(r)}default:throw Error(`Invalid operation`)}}static fromJSON(t){if(!t.numberToDocumentId)throw Error(`Invalid Flat Tree JSON`);let n=new e;for(let[e,r]of t.numberToDocumentId)n.numberToDocumentId.set(e,new Set(r));return n}toJSON(){return{numberToDocumentId:Array.from(this.numberToDocumentId.entries()).map(([e,t])=>[e,Array.from(t)])}}};function bK(e,t,n){if(n<0)return-1;if(e===t)return 0;let r=e.length,i=t.length;if(r===0)return i<=n?i:-1;if(i===0)return r<=n?r:-1;let a=Math.abs(r-i);if(e.startsWith(t))return a<=n?a:-1;if(t.startsWith(e))return 0;if(a>n)return-1;let o=[];for(let e=0;e<=r;e++){o[e]=[e];for(let t=1;t<=i;t++)o[e][t]=e===0?t:0}for(let a=1;a<=r;a++){let r=1/0;for(let n=1;n<=i;n++)e[a-1]===t[n-1]?o[a][n]=o[a-1][n-1]:o[a][n]=Math.min(o[a-1][n]+1,o[a][n-1]+1,o[a-1][n-1]+1),r=Math.min(r,o[a][n]);if(r>n)return-1}return o[r][i]<=n?o[r][i]:-1}function xK(e,t,n){let r=bK(e,t,n);return{distance:r,isBounded:r>=0}}var SK=class e{k;s;c=new Map;d=new Set;e;w=``;constructor(e,t,n){this.k=e,this.s=t,this.e=n}updateParent(e){this.w=e.w+this.s}addDocument(e){this.d.add(e)}removeDocument(e){return this.d.delete(e)}findAllWords(e,t,n,r){let i=[this];for(;i.length>0;){let a=i.pop();if(a.e){let{w:i,d:o}=a;if(n&&i!==t)continue;if(bG(e,i)!==null)if(r)if(Math.abs(t.length-i.length)<=r&&xK(t,i,r).isBounded)e[i]=[];else continue;else e[i]=[];if(bG(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}else{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||=!0,r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(xK(e,n,r).isBounded&&(i[n]=[]),bG(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}else{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a)if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}else return{};else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},CK=class e extends SK{constructor(){super(``,``,!1)}static fromJSON(t){let n=new e;return n.w=t.w,n.s=t.s,n.e=t.e,n.k=t.k,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([e,t])=>[e,SK.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},wK=2,TK=6371e3,EK=class e{point;docIDs;left;right;parent;constructor(e,t){this.point=e,this.docIDs=new Set(t),this.left=null,this.right=null,this.parent=null}toJSON(){return{point:this.point,docIDs:Array.from(this.docIDs),left:this.left?this.left.toJSON():null,right:this.right?this.right.toJSON():null}}static fromJSON(t,n=null){let r=new e(t.point,t.docIDs);return r.parent=n,t.left&&(r.left=e.fromJSON(t.left,r)),t.right&&(r.right=e.fromJSON(t.right,r)),r}},DK=class e{root;nodeMap;constructor(){this.root=null,this.nodeMap=new Map}getPointKey(e){return`${e.lon},${e.lat}`}insert(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);if(r){t.forEach(e=>r.docIDs.add(e));return}let i=new EK(e,t);if(this.nodeMap.set(n,i),this.root==null){this.root=i;return}let a=this.root,o=0;for(;;){if(o%wK===0)if(e.lon<a.point.lon){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}else if(e.lat<a.point.lat){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}o++}}contains(e){let t=this.getPointKey(e);return this.nodeMap.has(t)}getDocIDsByCoordinates(e){let t=this.getPointKey(e),n=this.nodeMap.get(t);return n?Array.from(n.docIDs):null}removeDocByID(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);r&&(r.docIDs.delete(t),r.docIDs.size===0&&(this.nodeMap.delete(n),this.deleteNode(r)))}deleteNode(e){let t=e.parent,n=e.left?e.left:e.right;n&&(n.parent=t),t?t.left===e?t.left=n:t.right===e&&(t.right=n):(this.root=n,this.root&&(this.root.parent=null))}searchByRadius(t,n,r=!0,i=`asc`,a=!1){let o=a?e.vincentyDistance:e.haversineDistance,s=[{node:this.root,depth:0}],c=[];for(;s.length>0;){let{node:e,depth:i}=s.pop();if(e==null)continue;let a=o(t,e.point);(r?a<=n:a>n)&&c.push({point:e.point,docIDs:Array.from(e.docIDs)}),e.left!=null&&s.push({node:e.left,depth:i+1}),e.right!=null&&s.push({node:e.right,depth:i+1})}return i&&c.sort((e,n)=>{let r=o(t,e.point),a=o(t,n.point);return i.toLowerCase()===`asc`?r-a:a-r}),c}searchByPolygon(t,n=!0,r=null,i=!1){let a=[{node:this.root,depth:0}],o=[];for(;a.length>0;){let{node:r,depth:i}=a.pop();if(r==null)continue;r.left!=null&&a.push({node:r.left,depth:i+1}),r.right!=null&&a.push({node:r.right,depth:i+1});let s=e.isPointInPolygon(t,r.point);(s&&n||!s&&!n)&&o.push({point:r.point,docIDs:Array.from(r.docIDs)})}let s=e.calculatePolygonCentroid(t);if(r){let t=i?e.vincentyDistance:e.haversineDistance;o.sort((e,n)=>{let i=t(s,e.point),a=t(s,n.point);return r.toLowerCase()===`asc`?i-a:a-i})}return o}toJSON(){return{root:this.root?this.root.toJSON():null}}static fromJSON(t){let n=new e;return t.root&&(n.root=EK.fromJSON(t.root),n.buildNodeMap(n.root)),n}buildNodeMap(e){if(e==null)return;let t=this.getPointKey(e.point);this.nodeMap.set(t,e),e.left&&this.buildNodeMap(e.left),e.right&&this.buildNodeMap(e.right)}static calculatePolygonCentroid(e){let t=0,n=0,r=0,i=e.length;for(let a=0,o=i-1;a<i;o=a++){let i=e[a].lon,s=e[a].lat,c=e[o].lon,l=e[o].lat,u=i*l-c*s;t+=u,n+=(i+c)*u,r+=(s+l)*u}t/=2;let a=6*t;return n/=a,r/=a,{lon:n,lat:r}}static isPointInPolygon(e,t){let n=!1,r=t.lon,i=t.lat,a=e.length;for(let t=0,o=a-1;t<a;o=t++){let a=e[t].lon,s=e[t].lat,c=e[o].lon,l=e[o].lat;s>i!=l>i&&r<(c-a)*(i-s)/(l-s)+a&&(n=!n)}return n}static haversineDistance(e,t){let n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=(t.lat-e.lat)*n,o=(t.lon-e.lon)*n,s=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2);return TK*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))}static vincentyDistance(e,t){let n=6378137,r=1/298.257223563,i=(1-r)*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan((1-r)*Math.tan(o)),u=Math.atan((1-r)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),ee=1+w/16384*(4096+w*(-768+w*(320-175*w))),T=w/1024*(256+w*(-128+w*(74-47*w))),E=T*v*(C+T/4*(y*(-1+2*C*C)-T/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*ee*(b-E)}},OK=class e{true;false;constructor(){this.true=new Set,this.false=new Set}insert(e,t){t?this.true.add(e):this.false.add(e)}delete(e,t){t?this.true.delete(e):this.false.delete(e)}getSize(){return this.true.size+this.false.size}toJSON(){return{true:Array.from(this.true),false:Array.from(this.false)}}static fromJSON(t){let n=new e;return n.true=new Set(t.true),n.false=new Set(t.false),n}};function kK(e,t,n,r,i,{k:a,b:o,d:s}){return Math.log(1+(n-t+.5)/(t+.5))*(s+e*(a+1))/(e+a*(1-o+o*r/i))}var AK=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=jK(t,this.size);this.vectors.set(e,[n,t])}remove(e){this.vectors.delete(e)}find(e,t,n){return e instanceof Float32Array||(e=new Float32Array(e)),MK(e,n,this.vectors,this.size,t)}toJSON(){let e=[];for(let[t,[n,r]]of this.vectors)e.push([t,[n,Array.from(r)]]);return{size:this.size,vectors:e}}static fromJSON(t){let n=t,r=new e(n.size);for(let[e,[t,i]]of n.vectors)r.vectors.set(e,[t,new Float32Array(i)]);return r}};function jK(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function MK(e,t,n,r,i){let a=jK(e,r),o=[],s=t||n.keys();for(let t of s){let s=n.get(t);if(!s)continue;let c=s[0],l=s[1],u=0;for(let t=0;t<r;t++)u+=e[t]*l[t];let d=u/(a*c);d>=i&&o.push([t,d])}return o}function NK(e,t,n,r,i){let a=XG(e.sharedInternalDocumentStore,n);e.avgFieldLength[t]=((e.avgFieldLength[t]??0)*(i-1)+r.length)/i,e.fieldLengths[t][a]=r.length,e.frequencies[t][a]={}}function PK(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=XG(e.sharedInternalDocumentStore,n),s=a/r.length;e.frequencies[t][o][i]=s,i in e.tokenOccurrences[t]||(e.tokenOccurrences[t][i]=0),e.tokenOccurrences[t][i]=(e.tokenOccurrences[t][i]??0)+1}function FK(e,t,n,r){let i=XG(e.sharedInternalDocumentStore,n);r>1?e.avgFieldLength[t]=(e.avgFieldLength[t]*r-e.fieldLengths[t][i])/(r-1):e.avgFieldLength[t]=void 0,e.fieldLengths[t][i]=void 0,e.frequencies[t][i]=void 0}function IK(e,t,n){e.tokenOccurrences[t][n]--}function LK(e,t,n,r,i=``){r||={sharedInternalDocumentStore:t,indexes:{},vectorIndexes:{},searchableProperties:[],searchablePropertiesWithTypes:{},frequencies:{},tokenOccurrences:{},avgFieldLength:{},fieldLengths:{}};for(let[a,o]of Object.entries(n)){let n=`${i}${i?`.`:``}${a}`;if(typeof o==`object`&&!Array.isArray(o)){LK(e,t,o,r,n);continue}if(UG(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new AK(KG(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new OK,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new vK(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new CK,isArray:e},r.avgFieldLength[n]=0,r.frequencies[n]={},r.tokenOccurrences[n]={},r.fieldLengths[n]={};break;case`enum`:case`enum[]`:r.indexes[n]={type:`Flat`,node:new yK,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new DK,isArray:e};break;default:throw IG(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function RK(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r]);break}}}function zK(e,t,n,r,i,a,o,s,c,l,u){if(UG(o))return BK(t,n,a,r,i);let d=RK(e,t,n,i,s,c,l,u);if(!WG(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function BK(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function VK(e,t,n,r,i,a,o,s,c,l){if(UG(o))return t.vectorIndexes[n].node.remove(i),!0;let{type:u,node:d}=t.indexes[n];switch(u){case`AVL`:return d.removeDocument(a,i),!0;case`Bool`:return d[a?`true`:`false`].delete(i),!0;case`Radix`:{let o=c.tokenize(a,s,n);e.removeDocumentScoreParameters(t,n,r,l);for(let r of o)e.removeTokenScoreParameters(t,n,r),d.removeDocumentByWord(r,i);return!0}case`Flat`:return d.removeDocument(i,a),!0;case`BKD`:return d.removeDocByID(a,i),!1}}function HK(e,t,n,r,i,a,o,s,c,l){if(!WG(o))return VK(e,t,n,r,i,a,o,s,c,l);let u=GG(o),d=a,f=d.length;for(let a=0;a<f;a++)VK(e,t,n,r,i,d[a],u,s,c,l);return!0}function UK(e,t,n,r,i,a,o,s,c,l){let u=Array.from(r),d=e.avgFieldLength[t],f=e.fieldLengths[t],p=e.tokenOccurrences[t],m=e.frequencies[t],h=typeof p[n]==`number`?p[n]??0:0,g=u.length;for(let e=0;e<g;e++){let r=u[e];if(c&&!c.has(r))continue;l.has(r)||l.set(r,new Map);let p=l.get(r);p.set(t,(p.get(t)||0)+1);let g=kK(m?.[r]?.[n]??0,h,i,f[r],d,a);o.has(r)?o.set(r,o.get(r)+g*s):o.set(r,g*s)}}function WK(e,t,n,r,i,a,o,s,c,l,u,d=0){let f=n.tokenize(t,r),p=f.length||1,m=new Map,h=new Map,g=new Map;for(let n of i){if(!(n in e.indexes))continue;let r=e.indexes[n],{type:i}=r;if(i!==`Radix`)throw IG(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw IG(`INVALID_BOOST_VALUE`,d);f.length===0&&!t&&f.push(``);let p=f.length;for(let t=0;t<p;t++){let i=f[t],s=r.node.find({term:i,exact:a,tolerance:o}),p=Object.keys(s);p.length>0&&h.set(i,!0);let _=p.length;for(let t=0;t<_;t++){let r=p[t],i=s[r];UK(e,n,r,i,l,c,g,d,u,m)}}}let _=Array.from(g.entries()).map(([e,t])=>[e,t]).sort((e,t)=>t[1]-e[1]);if(_.length===0)return[];if(d===1)return _;if(d===0){if(p===1)return _;for(let e of f)if(!h.get(e))return[];return _.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1})}let v=_.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1});if(v.length>0){let e=_.filter(([e])=>!v.some(([t])=>t===e)),t=Math.ceil(e.length*d);return[...v,...e.slice(0,t)]}return _}function GK(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:AG(...i.map(n=>GK(e,t,n,r)))}if(`or`in n&&n.or&&Array.isArray(n.or)){let i=n.or;return i.length===0?new Set:i.map(n=>GK(e,t,n,r)).reduce((e,t)=>MG(e,t),new Set)}if(`not`in n&&n.not){let i=n.not,a=new Set,o=e.sharedInternalDocumentStore;for(let e=1;e<=o.internalIdToId.length;e++)a.add(e);return NG(a,GK(e,t,i,r))}let i=Object.keys(n),a=i.reduce((e,t)=>({[t]:new Set,...e}),{});for(let o of i){let i=n[o];if(e.indexes[o]===void 0)throw IG(`UNKNOWN_FILTER_PROPERTY`,o);let{node:s,type:c,isArray:l}=e.indexes[o];if(c===`Bool`){let e=s,t=i?e.true:e.false;a[o]=MG(a[o],t);continue}if(c===`BKD`){let e;if(`radius`in i)e=`radius`;else if(`polygon`in i)e=`polygon`;else throw Error(`Invalid operation ${i}`);if(e===`radius`){let{value:t,coordinates:n,unit:r=`m`,inside:c=!0,highPrecision:l=!1}=i[e],u=EG(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=ZK(a[o],d)}else{let{coordinates:t,inside:n=!0,highPrecision:r=!1}=i[e],c=s.searchByPolygon(t,n,void 0,r);a[o]=ZK(a[o],c)}continue}if(c===`Radix`&&(typeof i==`string`||Array.isArray(i))){for(let e of[i].flat()){let n=t.tokenize(e,r,o);for(let e of n){let t=s.find({term:e,exact:!0});a[o]=tq(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw IG(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=MG(a[o],e);continue}if(c===`AVL`){let e=u[0],t=i[e],n;switch(e){case`gt`:n=s.greaterThan(t,!1);break;case`gte`:n=s.greaterThan(t,!0);break;case`lt`:n=s.lessThan(t,!1);break;case`lte`:n=s.lessThan(t,!0);break;case`eq`:n=s.find(t)??new Set;break;case`between`:{let[e,r]=t;n=s.rangeSearch(e,r);break}default:throw IG(`INVALID_FILTER_OPERATION`,e)}a[o]=MG(a[o],n)}}return AG(...Object.values(a))}function KK(e){return e.searchableProperties}function qK(e){return e.searchablePropertiesWithTypes}function JK(e,t){let{indexes:n,vectorIndexes:r,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}=t,u={},d={};for(let e of Object.keys(n)){let{node:t,type:r,isArray:i}=n[e];switch(r){case`Radix`:u[e]={type:`Radix`,node:CK.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:yK.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:vK.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:DK.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:OK.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:AK.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function YK(e){let{indexes:t,vectorIndexes:n,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}=e,l={};for(let e of Object.keys(n))l[e]=n[e].node.toJSON();let u={};for(let e of Object.keys(t)){let{type:n,node:r,isArray:i}=t[e];n===`Flat`||n===`Radix`||n===`AVL`||n===`BKD`||n===`Bool`?u[e]={type:n,node:r.toJSON(),isArray:i}:(u[e]=t[e],u[e].node=u[e].node.toJSON())}return{indexes:u,vectorIndexes:l,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}}function XK(){return{create:LK,insert:zK,remove:HK,insertDocumentScoreParameters:NK,insertTokenScoreParameters:PK,removeDocumentScoreParameters:FK,removeTokenScoreParameters:IK,calculateResultScores:UK,search:WK,searchByWhereClause:GK,getSearchableProperties:KK,getSearchablePropertiesWithTypes:qK,load:JK,save:YK}}function ZK(e,t){e||=new Set;let n=t.length;for(let r=0;r<n;r++){let n=t[r].docIDs,i=n.length;for(let t=0;t<i;t++)e.add(n[t])}return e}function QK(e,t,n=!1){let r=n?DK.vincentyDistance:DK.haversineDistance,i=[],a=[];for(let{point:n}of e)a.push(r(t,n));let o=Math.max(...a),s=0;for(let{docIDs:t}of e){let e=o-a[s]+1;for(let n of t)i.push([n,e]);s++}return i.sort((e,t)=>t[1]-e[1]),i}function $K(e,t){let n=Object.keys(e);if(n.length!==1)return{isGeoOnly:!1};let r=n[0],i=e[r];if(t.indexes[r]===void 0)return{isGeoOnly:!1};let{type:a}=t.indexes[r];return a===`BKD`&&i&&(`radius`in i||`polygon`in i)?{isGeoOnly:!0,geoProperty:r,geoOperation:i}:{isGeoOnly:!1}}function eq(e,t){let n=e,r=$K(t,n);if(!r.isGeoOnly||!r.geoProperty||!r.geoOperation)return null;let{node:i}=n.indexes[r.geoProperty],a=r.geoOperation,o=i,s;if(`radius`in a){let{value:e,coordinates:t,unit:n=`m`,inside:r=!0,highPrecision:i=!1}=a.radius,c=t,l=EG(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),QK(s,c,i)}else if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=DK.calculatePolygonCentroid(e);return QK(s,r,n)}return null}function tq(e,t){e||=new Set;let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=t[n[i]],a=r.length;for(let t=0;t<a;t++)e.add(r[t])}return e}function nq(e,t,n,r,i){let a={language:e.tokenizer.language,sharedInternalDocumentStore:t,enabled:!0,isSorted:!0,sortableProperties:[],sortablePropertiesWithTypes:{},sorts:{}};for(let[o,s]of Object.entries(n)){let n=`${i}${i?`.`:``}${o}`;if(!r.includes(n)){if(typeof s==`object`&&!Array.isArray(s)){let i=nq(e,t,s,r,n);fG(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!UG(s))switch(s){case`boolean`:case`number`:case`string`:a.sortableProperties.push(n),a.sortablePropertiesWithTypes[n]=s,a.sorts[n]={docs:new Map,orderedDocsToRemove:new Map,orderedDocs:[],type:s};break;case`geopoint`:case`enum`:continue;case`enum[]`:case`boolean[]`:case`number[]`:case`string[]`:continue;default:throw IG(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function rq(e,t,n,r){return r?.enabled===!1?{disabled:!0}:nq(e,t,n,(r||{}).unsortableProperties||[],``)}function iq(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=XG(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&dq(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function aq(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)lq(e,n);e.isSorted=!0}function oq(e,t,n){return t[1].localeCompare(n[1],aG(e))}function sq(e,t){return e[1]-t[1]}function cq(e,t){return t[1]?-1:1}function lq(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=oq.bind(null,e.language);break;case`number`:r=sq.bind(null);break;case`boolean`:r=cq.bind(null);break}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function uq(e){let t=Object.keys(e.sorts);for(let n of t)dq(e,n)}function dq(e,t){let n=e.sorts[t];n.orderedDocsToRemove.size&&(n.orderedDocs=n.orderedDocs.filter(e=>!n.orderedDocsToRemove.has(e[0])),n.orderedDocsToRemove.clear())}function fq(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=XG(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function pq(e,t,n){if(!e.enabled)throw IG(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw IG(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return dq(e,r),aq(e),t.sort((t,n)=>{let r=a.docs.get(XG(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(XG(e.sharedInternalDocumentStore,n[0])),s=r!==void 0,c=o!==void 0;return!s&&!c?0:s?c?i?o-r:r-o:-1:1}),t}function mq(e){return e.enabled?e.sortableProperties:[]}function hq(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function gq(e,t){let n=t;if(!n.enabled)return{enabled:!1};let r=Object.keys(n.sorts).reduce((e,t)=>{let{docs:r,orderedDocs:i,type:a}=n.sorts[t];return e[t]={docs:new Map(Object.entries(r).map(([e,t])=>[+e,t])),orderedDocsToRemove:new Map,orderedDocs:i,type:a},e},{});return{sharedInternalDocumentStore:e,language:n.language,sortableProperties:n.sortableProperties,sortablePropertiesWithTypes:n.sortablePropertiesWithTypes,sorts:r,enabled:!0,isSorted:n.isSorted}}function _q(e){if(!e.enabled)return{enabled:!1};uq(e),aq(e);let t=Object.keys(e.sorts).reduce((t,n)=>{let{docs:r,orderedDocs:i,type:a}=e.sorts[n];return t[n]={docs:Object.fromEntries(r.entries()),orderedDocs:i,type:a},t},{});return{language:e.language,sortableProperties:e.sortableProperties,sortablePropertiesWithTypes:e.sortablePropertiesWithTypes,sorts:t,enabled:e.enabled,isSorted:e.isSorted}}function vq(){return{create:rq,insert:iq,remove:fq,save:_q,load:gq,sortBy:pq,getSortableProperties:mq,getSortablePropertiesWithTypes:hq}}var yq=192,bq=383,xq=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115];function Sq(e){return e<yq||e>bq?e:xq[e-yq]||e}function Cq(e){let t=[];for(let n=0;n<e.length;n++)t[n]=Sq(e.charCodeAt(n));return String.fromCharCode(...t)}var wq={ational:`ate`,tional:`tion`,enci:`ence`,anci:`ance`,izer:`ize`,bli:`ble`,alli:`al`,entli:`ent`,eli:`e`,ousli:`ous`,ization:`ize`,ation:`ate`,ator:`ate`,alism:`al`,iveness:`ive`,fulness:`ful`,ousness:`ous`,aliti:`al`,iviti:`ive`,biliti:`ble`,logi:`log`},Tq={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},Eq=`[^aeiou]`,Dq=`[aeiouy]`,Oq=Eq+`[^aeiouy]*`;Dq+``;var kq=`^(`+Oq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,Aq=`^(`+Oq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`,jq=`^(`+Oq+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,Mq=`^(`+Oq+`)?[aeiouy]`;function Nq(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=new RegExp(kq),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=new RegExp(Mq),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+Oq+Dq+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(Mq),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(kq),t&&r.test(t)&&(e=t+wq[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(kq),t&&r.test(t)&&(e=t+Tq[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=new RegExp(jq),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=new RegExp(jq),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(jq),i=new RegExp(Aq),a=RegExp(`^`+Oq+Dq+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=new RegExp(jq),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function Pq(e,t,n=!0){let r=`${this.language}:${e}:${t}`;return n&&this.normalizationCache.has(r)?this.normalizationCache.get(r):this.stopWords?.includes(t)?(n&&this.normalizationCache.set(r,``),``):(this.stemmer&&!this.stemmerSkipProperties.has(e)&&(t=this.stemmer(t)),t=Cq(t),n&&this.normalizationCache.set(r,t),t)}function Fq(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function Iq(e,t,n,r=!0){if(t&&t!==this.language)throw IG(`LANGUAGE_NOT_SUPPORTED`,t);if(typeof e!=`string`)return[e];let i=this.normalizeToken.bind(this,n??``),a;if(n&&this.tokenizeSkipProperties.has(n))a=[i(e,r)];else{let t=rG[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=Fq(a);return this.allowDuplicates?o:Array.from(new Set(o))}function Lq(e={}){if(!e.language)e.language=`english`;else if(!iG.includes(e.language))throw IG(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e))if(e.stemmer){if(typeof e.stemmer!=`function`)throw IG(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=Nq;else throw IG(`MISSING_STEMMER`,e.language);let n;if(e.stopWords!==!1){if(n=[],Array.isArray(e.stopWords))n=e.stopWords;else if(typeof e.stopWords==`function`)n=e.stopWords(n);else if(e.stopWords)throw IG(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw IG(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw IG(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:Iq,language:e.language,stemmer:t,stemmerSkipProperties:new Set(e.stemmerSkipProperties?[e.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(e.tokenizeSkipProperties?[e.tokenizeSkipProperties].flat():[]),stopWords:n,allowDuplicates:!!e.allowDuplicates,normalizeToken:Pq,normalizationCache:new Map};return r.tokenize=Iq.bind(r),r.normalizeToken=Pq,r}function Rq(e){return{sharedInternalDocumentStore:e,rules:new Map}}function zq(e,t){if(e.rules.has(t.id))throw Error(`PINNING_RULE_ALREADY_EXISTS: A pinning rule with id "${t.id}" already exists. Use updateRule to modify it.`);e.rules.set(t.id,t)}function Bq(e,t){if(!e.rules.has(t.id))throw Error(`PINNING_RULE_NOT_FOUND: Cannot update pinning rule with id "${t.id}" because it does not exist. Use addRule to create it.`);e.rules.set(t.id,t)}function Vq(e,t){return e.rules.delete(t)}function Hq(e,t){return e.rules.get(t)}function Uq(e){return Array.from(e.rules.values())}function Wq(e,t){let n=e.toLowerCase().trim(),r=t.pattern.toLowerCase().trim();switch(t.anchoring){case`is`:return n===r;case`starts_with`:return n.startsWith(r);case`contains`:return n.includes(r);default:return!1}}function Gq(e,t){return e?t.conditions.every(t=>Wq(e,t)):!1}function Kq(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())Gq(t,r)&&n.push(r);return n}function qq(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function Jq(e){return{rules:Array.from(e.rules.entries())}}function Yq(){return{create:Rq,addRule:zq,updateRule:Bq,removeRule:Vq,getRule:Hq,getAllRules:Uq,getMatchingRules:Kq,load:qq,save:Jq}}function Xq(e){let t={formatElapsedTime:LG,getDocumentIndexId:RG,getDocumentProperties:CG,validateSchema:zG};for(let n of dK){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw IG(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!uK.includes(t)&&!dK.includes(t))throw IG(`UNSUPPORTED_COMPONENT`,t)}function Zq({schema:e,sort:t,language:n,components:r,id:i,plugins:a}){r||={};for(let t of a??[]){if(!(`getComponents`in t)||typeof t.getComponents!=`function`)continue;let n=t.getComponents(e),i=Object.keys(n);for(let e of i)if(r[e])throw IG(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=yG();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:Lq(o):Lq({language:n??`english`}),r.tokenizer&&n)throw IG(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=qG();s||=XK(),l||=vq(),c||=sK(),u||=Yq(),Xq(r);let{getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,formatElapsedTime:h}=r,g={data:{},caches:{},schema:e,tokenizer:o,index:s,sorter:l,documentsStore:c,pinning:u,internalDocumentIDStore:d,getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeUpsert:[],afterUpsert:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],beforeUpdateMultiple:[],afterUpdateMultiple:[],beforeUpsertMultiple:[],afterUpsertMultiple:[],afterCreate:[],formatElapsedTime:h,id:i,plugins:a,version:Qq()};g.data={index:g.index.create(g,d,e),docs:g.documentsStore.create(g,d),sorting:g.sorter.create(g,d,e,t),pinning:g.pinning.create(d)};for(let e of cK)g[e]=(g[e]??[]).concat(lK(g,e));let _=g.afterCreate;return _&&gK(_,g),g}function Qq(){return`{{VERSION}}`}function $q(e){return e.documentsStore.count(e.data.docs)}function eJ(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw IG(`SCHEMA_VALIDATION_FAILURE`,a);return OG(e.beforeInsert)||OG(e.afterInsert)||OG(e.index.beforeInsert)||OG(e.index.insert)||OG(e.index.afterInsert)?rJ(e,t,n,r,i):iJ(e,t,n,r,i)}var tJ=new Set([`enum`,`enum[]`]),nJ=new Set([`string`,`number`]);async function rJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw IG(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=XG(e.internalDocumentIDStore,s);if(r||await fK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw IG(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];aJ(n,r,e,t)}return await oJ(e,s,u,f,l,n,t,i),r||await fK(e.afterInsert,e,s,t),s}function iJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw IG(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=XG(e.internalDocumentIDStore,s);if(r||fK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw IG(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];aJ(n,r,e,t)}return sJ(e,s,u,f,l,n,t,i),r||fK(e.afterInsert,e,s,t),s}function aJ(e,t,n,r){if(!(HG(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(UG(t)&&Array.isArray(r))&&!(WG(t)&&Array.isArray(r))&&!(tJ.has(t)&&nJ.has(e))&&e!==t)throw IG(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function oJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o];await e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i);let l=e.internalDocumentIDStore.idToInternalId.get(t);await e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),await e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function sJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o],l=XG(e.internalDocumentIDStore,t);e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i),e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function cJ(e,t,n,r,i,a){return OG(e.afterInsertMultiple)||OG(e.beforeInsertMultiple)||OG(e.index.beforeInsert)||OG(e.index.insert)||OG(e.index.afterInsert)?lJ(e,t,n,r,i,a):uJ(e,t,n,r,i,a)}async function lJ(e,t,n=1e3,r,i,a=0){let o=[],s=async a=>{let s=Math.min(a+n,t.length),c=t.slice(a,s);for(let t of c){let n=await eJ(e,t,r,i,{avlRebalanceThreshold:c.length});o.push(n)}return s};return await(async()=>{let e=0;for(;e<t.length;){let t=Date.now();if(e=await s(e),a>0){let e=a-(Date.now()-t);e>0&&PG(e)}}})(),i||await pK(e.afterInsertMultiple,e,t),o}function uJ(e,t,n=1e3,r,i,a=0){let o=[],s=0;function c(){let a=t.slice(s*n,(s+1)*n);if(a.length===0)return!1;for(let t of a){let n=eJ(e,t,r,i,{avlRebalanceThreshold:a.length});o.push(n)}return s++,!0}function l(){let e=Date.now();for(;c();)if(a>0){let t=Date.now()-e;if(t>=a){let e=a-t%a;e>0&&PG(e)}}}return l(),i||pK(e.afterInsertMultiple,e,t),o}function dJ(e,t){return e[1]-t[1]}function fJ(e,t){return t[1]-e[1]}function pJ(e=`desc`){return e.toLowerCase()===`asc`?dJ:fJ}function mJ(e,t,n){let r={},i=t.map(([e])=>e),a=e.documentsStore.getMultiple(e.data.docs,i),o=Object.keys(n),s=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e of o){let t;if(s[e]===`number`){let{ranges:r}=n[e],i=r.length,a=Array.from({length:i});for(let e=0;e<i;e++){let t=r[e];a[e]=[`${t.from}-${t.to}`,0]}t=Object.fromEntries(a)}r[e]={count:0,values:t??{}}}let c=a.length;for(let e=0;e<c;e++){let t=a[e];for(let e of o){let i=e.includes(`.`)?wG(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;hJ(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=hJ(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:gJ(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=gJ(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw IG(`FACET_NOT_SUPPORTED`,a)}}}for(let e of o){let t=r[e];if(t.count=Object.keys(t.values).length,s[e]===`string`){let r=n[e],i=pJ(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function hJ(e,t,n){return r=>{for(let i of e){let e=`${i.from}-${i.to}`;n?.has(e)||r>=i.from&&r<=i.to&&(t[e]===void 0?t[e]=1:(t[e]++,n?.add(e)))}}}function gJ(e,t,n){let r=t===`boolean`?`false`:``;return t=>{let i=t?.toString()??r;n?.has(i)||(e[i]=(e[i]??0)+1,n?.add(i))}}var _J={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},vJ=[`string`,`number`,`boolean`];function yJ(e,t,n){let r=n.properties,i=r.length,a=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e=0;e<i;e++){let t=r[e];if(a[t]===void 0)throw IG(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!vJ.includes(a[t]))throw IG(`INVALID_GROUP_BY_PROPERTY`,t,vJ.join(`, `),a[t])}let o=t.map(([t])=>ZG(e.internalDocumentIDStore,t)),s=e.documentsStore.getMultiple(e.data.docs,o),c=s.length,l=n.maxResult||2**53-1,u=[],d={};for(let e=0;e<i;e++){let t=r[e],n={property:t,perValue:{}},i=new Set;for(let e=0;e<c;e++){let r=s[e],a=wG(r,t);if(a===void 0)continue;let o=typeof a==`boolean`?``+a:a,c=n.perValue[o]??{indexes:[],count:0};c.count>=l||(c.indexes.push(e),c.count++,n.perValue[o]=c,i.add(a))}u.push(Array.from(i)),d[t]=n}let f=bJ(u),p=f.length,m=[];for(let e=0;e<p;e++){let t=f[e],n=t.length,i={values:[],indexes:[]},a=[];for(let e=0;e<n;e++){let n=t[e],o=r[e];a.push(d[o].perValue[typeof n==`boolean`?``+n:n].indexes),i.values.push(n)}i.indexes=SG(a).sort((e,t)=>e-t),i.indexes.length!==0&&m.push(i)}let h=m.length,g=Array.from({length:h});for(let e=0;e<h;e++){let r=m[e],i=n.reduce||_J,a=r.indexes.map(e=>({id:o[e],score:t[e][1],document:s[e]})),c=i.reducer.bind(null,r.values),l=i.getInitialValue(r.indexes.length),u=a.reduce(c,l);g[e]={values:r.values,result:u}}return g}function bJ(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=bJ(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];fG(n,t),i.push(n)}return i}function xJ(e,t,n,r){let i=Kq(t,r);if(i.length===0)return n;let a=i.flatMap(e=>e.consequence.promote);a.sort((e,t)=>e.position-t.position);let o=new Set,s=new Map,c=new Set;for(let t of a){let n=XG(e.internalDocumentIDStore,t.doc_id);if(n!==void 0){if(s.has(n)){let e=s.get(n);t.position<e&&s.set(n,t.position);continue}c.has(t.position)||(o.add(n),s.set(n,t.position),c.add(t.position))}}if(s.size===0)return n;let l=n.filter(([e])=>!o.has(e)),u=[];for(let[t,r]of s.entries())n.find(([e])=>e===t)?u.push([t,1e6-r]):e.documentsStore.get(e.data.docs,t)&&u.push([t,0]);u.sort((e,t)=>(s.get(e[0])??1/0)-(s.get(t[0])??1/0));let d=[],f=new Map;for(let e of u){let t=s.get(e[0]);f.set(t,e)}let p=0,m=0;for(;m<l.length+u.length;)if(f.has(m))d.push(f.get(m)),m++;else if(p<l.length)d.push(l[p]),p++,m++;else break;for(let[e,t]of f.entries())e>=d.length&&d.push(t);return d}function SJ(e,t,n){let{term:r,properties:i}=t,a=e.data.index,o=e.caches.propertiesToSearch;if(!o){let t=e.index.getSearchablePropertiesWithTypes(a);o=e.index.getSearchableProperties(a),o=o.filter(e=>t[e].startsWith(`string`)),e.caches.propertiesToSearch=o}if(i&&i!==`*`){for(let e of i)if(!o.includes(e))throw IG(`UNKNOWN_INDEX`,e,o.join(`, `));o=o.filter(e=>i.includes(e))}let s=Object.keys(t.where??{}).length>0,c;s&&(c=e.index.searchByWhereClause(a,e.tokenizer,t.where,n));let l,u=t.threshold!==void 0&&t.threshold!==null?t.threshold:1;if(r||i){let i=$q(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},DJ(t.relevance),i,c,u),t.exact&&r){let t=r.trim().split(/\s+/);l=l.filter(([n])=>{let r=e.documentsStore.get(e.data.docs,n);if(!r)return!1;for(let e of o){let n=wJ(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${CJ(e)}\\b`).test(n)))return!0}return!1})}}else l=s?eq(a,t.where)||(c?Array.from(c):[]).map(e=>[+e,0]):Object.keys(e.documentsStore.getAll(e.data.docs)).map(e=>[+e,0]);return l}function CJ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function wJ(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}function TJ(e,t,n){let r=vG();function i(){let i=Object.keys(e.data.index.vectorIndexes),a=t.facets&&Object.keys(t.facets).length>0,{limit:o=10,offset:s=0,distinctOn:c,includeVectors:l=!1}=t,u=t.preflight===!0,d=SJ(e,t,n);if(t.sortBy)if(typeof t.sortBy==`function`){let n=d.map(([e])=>e),r=e.documentsStore.getMultiple(e.data.docs,n).map((e,t)=>[d[t][0],d[t][1],e]);r.sort(t.sortBy),d=r.map(([e,t])=>[e,t])}else d=e.sorter.sortBy(e.data.sorting,d,t.sortBy).map(([t,n])=>[XG(e.internalDocumentIDStore,t),n]);else d=d.sort(xG);d=xJ(e,e.data.pinning,d,t.term);let f;u||(f=c?zJ(e,d,s,o,c):BJ(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||DG(p,i)),a&&(p.facets=mJ(e,d,t.facets)),t.groupBy&&(p.groups=yJ(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime(vG()-r),p}async function a(){e.beforeSearch&&await hK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await mK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}var EJ={k:1.2,b:.75,d:.5};function DJ(e){let t=e??{};return t.k=t.k??EJ.k,t.b=t.b??EJ.b,t.d=t.d??EJ.d,t}function OJ(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw IG(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw IG(`UNKNOWN_VECTOR_PROPERTY`,r.property);let a=i.node.size;if(r?.value.length!==a)throw r?.property===void 0||r?.value.length===void 0?IG(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):IG(`INVALID_INPUT_VECTOR`,r.property,a,r.value.length);let o=e.data.index,s;return Object.keys(t.where??{}).length>0&&(s=e.index.searchByWhereClause(o,e.tokenizer,t.where,n)),i.node.find(r.value,t.similarity??.8,s)}function kJ(e,t,n=`english`){let r=vG();function i(){let i=OJ(e,t,n).sort(xG);i=xJ(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=mJ(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];r&&(s||(r[o]=null),u[t]={id:ZG(e.internalDocumentIDStore,n[0]),score:n[1],document:r})}let d=[];t.groupBy&&(d=yJ(e,i,t.groupBy));let f=vG()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:_G(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await hK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await mK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function AJ(e,t,n){let r=NJ(SJ(e,t,n)),i=OJ(e,t,n),a=t.hybridWeights;return IJ(r,i,t.term??``,a)}function jJ(e,t,n){let r=vG();function i(){let i=AJ(e,t,n);i=xJ(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=mJ(e,i,t.facets));let o;t.groupBy&&(o=yJ(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=BJ(e,i,s,c).filter(Boolean),u=vG(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:_G(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||DG(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await hK(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await mK(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function MJ(e){return e[1]}function NJ(e){let t=Math.max.apply(Math,e.map(MJ));return e.map(([e,n])=>[e,n/t])}function PJ(e,t){return e/t}function FJ(e,t){return(n,r)=>n*e+r*t}function IJ(e,t,n,r){let i=Math.max.apply(Math,e.map(MJ)),a=Math.max.apply(Math,t.map(MJ)),{text:o,vector:s}=r&&r.text&&r.vector?r:LJ(n),c=new Map,l=e.length,u=FJ(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(PJ(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=PJ(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function LJ(e){return{text:.5,vector:.5}}function RJ(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return TJ(e,t,n);if(r===`vector`)return kJ(e,t);if(r===`hybrid`)return jJ(e,t);throw IG(`INVALID_SEARCH_MODE`,r)}function zJ(e,t,n,r,i){let a=e.data.docs,o=new Map,s=[],c=new Set,l=t.length,u=0;for(let d=0;d<l;d++){let l=t[d];if(l===void 0)continue;let[f,p]=l;if(c.has(f))continue;let m=e.documentsStore.get(a,f),h=wG(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:ZG(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function BJ(e,t,n,r){let i=e.data.docs,a=Array.from({length:r}),o=new Set;for(let s=n;s<r+n;s++){let n=t[s];if(n===void 0)break;let[r,c]=n;if(!o.has(r)){let t=e.documentsStore.get(i,r);a[s]={id:ZG(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}var VJ=r(tG(),1),HJ=/[\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF]/g;function UJ(e){return e.replace(HJ,``)}function WJ(e){return e.replace(/[\u0000-\u001F\u007F]/g,` `)}function GJ(e,t){if(e.length<=t)return e;let n=e.slice(0,t),r=n.charCodeAt(n.length-1);return r>=55296&&r<=56319?n.slice(0,-1):n}var KJ=R({at:N(),transport:N(),outcome:N(),reference:N().optional(),error:N().optional(),errorCode:N().optional()}),qJ=R({reason:N(),at:N(),errorCode:N().optional()});R({version:P().int().catch(1),id:N(),createdAt:N(),bundleLevel:N(),zipBytes:P().int().nonnegative().catch(0),zipDeleted:F().optional(),state:N(),systemWide:F().optional(),projectSlug:N().nullable().optional(),reference:N().optional(),lastError:qJ.optional(),attempts:I(KJ).optional(),note:N().optional()}),R({version:P().int().catch(1),id:N().optional(),sentAt:N().optional(),reference:N().optional()});var JJ=`0.0.0-unknown`,YJ={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function XJ({kind:e,runtimeVersion:t}){return{[YJ.protocol]:`2`,[YJ.runtime]:t,[YJ.kind]:e}}function ZJ({kind:e,runtimeVersion:t}){return{clientProtocolVersion:2,clientRuntimeVersion:t,clientKind:e}}var QJ=`extra/screenshot.png`,$J=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)[^"]+/g,replacement:`$1[REDACTED]`}];$J.map(e=>e.name);function eY(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
400
400
|
`).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of $J)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
|
|
401
401
|
`),patterns:[...t],lineCount:n}}function tY(e){return eY(e).redacted}var nY=8192,rY=32768,iY=`…[truncated]`;function aY(e){let t=e.trim();if(t.length===0||t[0]!==`{`)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!=`object`||!n||Array.isArray(n))return null;let r=n;return{event:typeof r.event==`string`?r.event:void 0,fields:r}}function oY(e){return e.length<=8192?e:`${e.slice(0,nY-12)}${iY}`}function sY(e,t){return!(e.host===`desktop`&&t.host!==`desktop`||e.singleFileHidden&&t.singleFile||e.requiresTerminalCapability&&!t.terminalCapable||e.requiresTerminalLive&&!t.terminalLive||e.requiresCanExpandAll&&!t.canExpandAll||e.requiresCanCollapseAll&&!t.canCollapseAll||e.requiresActiveDoc&&!t.hasActiveDoc||e.requiresInstallSkill&&!t.showInstallSkill||e.requiresTargetKinds&&!e.requiresTargetKinds.includes(t.activeTargetKind))}var cY=[{id:`open-blob-run`,labelKey:`blobRun`,keywords:[`game`,`blob`,`runner`,`play`,`easter egg`,`dino`],availability:{},palette:{group:`app`,visibility:`search-only`}},{id:`navigate-back`,menuActionId:`navigate-back`,labelKey:`back`,keywords:[`previous history`,`go`],shortcutId:`navigate-back`,shortcutDesktopOnly:!0,availability:{host:`desktop`},palette:{group:`commands`,visibility:`search-only`},menu:[{section:`view-history`,order:0,platform:`mac`,accelerator:`Cmd+[`},{section:`view-history`,order:0,platform:`other`,accelerator:`Alt+Left`}]},{id:`navigate-forward`,menuActionId:`navigate-forward`,labelKey:`forward`,keywords:[`next history`,`go`],shortcutId:`navigate-forward`,shortcutDesktopOnly:!0,availability:{host:`desktop`},palette:{group:`commands`,visibility:`search-only`},menu:[{section:`view-history`,order:1,platform:`mac`,accelerator:`Cmd+]`},{section:`view-history`,order:1,platform:`other`,accelerator:`Alt+Right`}]},{id:`new-file`,menuActionId:`new-doc`,labelKey:`newFile`,keywords:[`create file`,`document`,`note`],shortcutId:`new-item`,availability:{},palette:{group:`commands`,visibility:`always`},menu:[{section:`file-create`,order:0,accelerator:`CmdOrCtrl+N`}]},{id:`new-folder`,menuActionId:`new-folder`,labelKey:`newFolder`,keywords:[`create folder`,`directory`],shortcutId:`new-folder`,shortcutDesktopOnly:!0,availability:{},palette:{group:`commands`,visibility:`always`},menu:[{section:`file-create`,order:1,accelerator:`CmdOrCtrl+Shift+N`}]},{id:`open-graph`,labelKey:`openGraph`,keywords:[`graph panel network`,`show`,`view`],availability:{requiresActiveDoc:!0},palette:{group:`commands`,visibility:`always`}},{id:`open-in-new-window`,labelKey:`openInNewWindow`,keywords:[`pop out`,`detach`,`separate window`,`second monitor`],availability:{host:`desktop`,requiresActiveDoc:!0,singleFileHidden:!0},palette:{group:`commands`,visibility:`always`},menu:[{section:`window`,order:0}]},{id:`initialize-starter-pack`,labelKey:`initializeStarterPack`,keywords:[`scaffold`,`seed`,`pack`,`starter`],availability:{},palette:{group:`commands`,visibility:`always`}},{id:`new-skill`,labelKey:`newSkill`,keywords:[`skill`,`create`,`author`,`new`],availability:{singleFileHidden:!0},palette:{group:`commands`,visibility:`always`}},{id:`new-project`,menuActionId:`new-project`,labelKey:`newProject`,keywords:[`create new project scaffold`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:0,ellipsis:!0}]},{id:`open-folder`,labelKey:`openFolderOnDisk`,keywords:[`project`,`folder`,`disk`],shortcutId:`open-folder`,availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:2,accelerator:`CmdOrCtrl+O`,ellipsis:!0,menuLabelKey:`openFolder`}]},{id:`open-file`,labelKey:`openFileOnDisk`,keywords:[`file`,`markdown`,`single`,`standalone`,`temporary`],shortcutId:`open-file`,availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:3,accelerator:`CmdOrCtrl+Shift+O`,ellipsis:!0,menuLabelKey:`openFile`}]},{id:`open-skills`,labelKey:`openSkills`,keywords:[`skills marketplace explore import discover`,`browse`,`install`,`open`],availability:{singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[]},{id:`switch-project`,labelKey:`switchProject`,keywords:[`switch project navigator projects`,`change`],shortcutId:`switch-project`,availability:{host:`desktop`,singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:1,accelerator:`CmdOrCtrl+Shift+P`,ellipsis:!0}]},{id:`settings`,labelKey:`settings`,keywords:[`preferences config`,`open`],shortcutId:`settings`,availability:{singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`app-settings`,order:0,platform:`mac`,accelerator:`CmdOrCtrl+,`,ellipsis:!0},{section:`file-settings`,order:0,platform:`other`,accelerator:`CmdOrCtrl+,`,ellipsis:!0}]},{id:`install-claude-desktop`,labelKey:`installClaudeDesktop`,keywords:[`claude desktop install cowork`],availability:{requiresInstallSkill:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`help-install`,order:0,ellipsis:!0,menuLabelText:`Install for Claude Chat & Cowork (desktop app)`}]},{id:`report-bug`,menuActionId:`report-bug`,labelKey:`reportBug`,keywords:[`bug report issue feedback problem`,`file`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`help-links`,order:1,ellipsis:!0}]},{id:`bug-report-history`,labelKey:`bugReportHistory`,keywords:[`bug report history previous reports past retry resend`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`}},{id:`send-feedback`,menuActionId:`send-feedback`,labelKey:`sendFeedback`,keywords:[`feedback`,`suggestion`,`idea`,`rate`,`survey`,`contact`,`give`],availability:{},palette:{group:`project`,visibility:`always`},menu:[{section:`help-links`,order:2,ellipsis:!0}]},{id:`new-from-template`,menuActionId:`new-from-template`,labelKey:`newFromTemplate`,keywords:[`template`,`create`,`new`],availability:{singleFileHidden:!0},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-create`,order:2,ellipsis:!0}]},{id:`rename`,menuActionId:`rename`,labelKey:`rename`,keywords:[`rename`,`file`,`folder`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:1}]},{id:`duplicate`,menuActionId:`duplicate`,labelKey:`duplicate`,keywords:[`duplicate`,`copy`,`file`,`folder`],shortcutId:`file-tree-duplicate`,availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:0,accelerator:`CmdOrCtrl+D`}]},{id:`move-to-trash`,menuActionId:`move-to-trash`,labelKey:`moveToTrash`,keywords:[`delete`,`trash`,`remove`,`file`,`folder`],shortcutId:`file-tree-delete`,availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:2,accelerator:`CmdOrCtrl+Delete`}]},{id:`reveal-in-finder`,menuActionId:`reveal-in-finder`,labelKey:`revealInFinder`,keywords:[`finder`,`reveal`,`show`,`file`,`folder`,`open`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-reveal`,order:0}]},{id:`send-to-ai`,menuActionId:`send-to-ai`,labelKey:`openWithAi`,keywords:[`ai`,`agent`,`handoff`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`project`]},menu:[{section:`file-reveal`,order:1}]},{id:`copy-full-path`,menuActionId:`copy-full-path`,labelKey:`copyFullPath`,keywords:[`copy`,`path`,`absolute`,`full`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-copy-path`,order:0,menuLabelKey:`fullPath`}]},{id:`copy-relative-path`,menuActionId:`copy-relative-path`,labelKey:`copyRelativePath`,keywords:[`copy`,`path`,`relative`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-copy-path`,order:1,menuLabelKey:`relativePath`}]},{id:`close-tab`,menuActionId:`close-active-tab-or-window`,labelKey:`closeTab`,keywords:[`close`,`tab`,`window`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-close`,order:0,platform:`mac`,accelerator:`CmdOrCtrl+W`}]},{id:`new-worktree`,menuActionId:`new-worktree`,labelKey:`newWorktree`,keywords:[`worktree`,`branch`,`new`,`create`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-worktree`,order:0,ellipsis:!0}]},{id:`switch-worktree`,menuActionId:`switch-worktree`,labelKey:`switchWorktree`,keywords:[`worktree`,`switch`,`branch`,`change`,`checkout`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-worktree`,order:1,ellipsis:!0}]},{id:`toggle-sidebar`,menuActionId:`toggle-sidebar`,labelKey:`sidebarHide`,keywords:[`sidebar`,`files`,`panel`,`toggle`,`show`,`hide`,`open`],shortcutId:`toggle-files-sidebar`,stateToggle:{showKey:`sidebarShow`,hideKey:`sidebarHide`,stateField:`sidebarVisible`,defaultVisible:!0},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:0,accelerator:`CmdOrCtrl+Alt+S`}]},{id:`toggle-doc-panel`,menuActionId:`toggle-doc-panel`,labelKey:`docPanelHide`,keywords:[`document`,`panel`,`info`,`toggle`,`properties`,`show`,`hide`,`open`],shortcutId:`toggle-document-panel`,stateToggle:{showKey:`docPanelShow`,hideKey:`docPanelHide`,stateField:`docPanelVisible`,defaultVisible:!0},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:1,accelerator:`CmdOrCtrl+Alt+B`}]},{id:`toggle-terminal`,menuActionId:`toggle-terminal`,labelKey:`terminalShow`,keywords:[`terminal`,`shell`,`console`,`panel`,`toggle terminal`,`toggle bottom dock`,`show terminal`,`hide terminal`,`close`,`open`],shortcutId:`toggle-terminal-panel`,stateToggle:{showKey:`terminalShow`,hideKey:`terminalHide`,stateField:`terminalVisible`,defaultVisible:!1},availability:{host:`desktop`,requiresTerminalCapability:!0},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:2,accelerator:`CmdOrCtrl+J`}]},{id:`toggle-agent-panel`,menuActionId:`toggle-agent-panel`,labelKey:`agentPanelShow`,keywords:[`agent`,`agents`,`chat`,`ai`,`ask`,`panel`,`toggle`,`open`,`show`,`hide`],shortcutId:`toggle-agent-panel`,stateToggle:{showKey:`agentPanelShow`,hideKey:`agentPanelHide`,stateField:`agentPanelVisible`,defaultVisible:!1,overrideKey:`agentPanelAskSelection`,overrideField:`hasEditorSelection`},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:3,accelerator:`CmdOrCtrl+L`}]},{id:`toggle-show-hidden-files`,menuActionId:`toggle-show-hidden-files`,labelKey:`showHiddenFiles`,keywords:[`hidden`,`dotfiles`,`files`,`show`],checkField:`showHiddenFiles`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:0,accelerator:`CmdOrCtrl+Shift+.`,checkbox:!0}]},{id:`toggle-show-ok-folders`,menuActionId:`toggle-show-ok-folders`,labelKey:`showOkFolders`,keywords:[`ok`,`folders`,`hidden`,`show`],checkField:`showOkFolders`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:1,checkbox:!0}]},{id:`toggle-show-only-markdown-files`,menuActionId:`toggle-show-only-markdown-files`,labelKey:`showOnlyMarkdownFiles`,keywords:[`markdown`,`filter`,`files`,`only`],checkField:`showOnlyMarkdownFiles`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:2,checkbox:!0}]},{id:`toggle-show-skills-section`,menuActionId:`toggle-show-skills-section`,labelKey:`showSkillsSection`,keywords:[`skills`,`section`,`sidebar`,`show`],checkField:`showSkillsSection`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:3,checkbox:!0}]},{id:`expand-all-tree`,menuActionId:`expand-all-tree`,labelKey:`expandAll`,keywords:[`expand`,`tree`,`folders`,`all`],availability:{requiresCanExpandAll:!0},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-tree`,order:0,smartHide:!0}]},{id:`collapse-all-tree`,menuActionId:`collapse-all-tree`,labelKey:`collapseAll`,keywords:[`collapse`,`tree`,`folders`,`all`],availability:{requiresCanCollapseAll:!0},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-tree`,order:1,smartHide:!0}]},{id:`new-terminal`,menuActionId:`new-terminal`,labelKey:`newTerminal`,keywords:[`terminal`,`shell`,`new`,`tab`],availability:{host:`desktop`,requiresTerminalCapability:!0},palette:{group:`terminal`,visibility:`search-only`},menu:[{section:`terminal`,order:0}]},{id:`new-terminal-window`,keywords:[],availability:{host:`desktop`,requiresTerminalCapability:!0},menu:[{section:`terminal`,order:1,menuLabelText:`New Terminal Window`}]},{id:`move-terminal`,menuActionId:`move-terminal`,labelKey:`terminalMoveRight`,keywords:[`terminal`,`move`,`dock`,`right`,`bottom`,`placement`],placementToggle:{bottomKey:`terminalMoveRight`,rightKey:`terminalMoveBottom`},availability:{host:`desktop`,requiresTerminalCapability:!0},palette:{group:`terminal`,visibility:`search-only`},menu:[{section:`terminal`,order:2}]},{id:`kill-terminal`,menuActionId:`kill-terminal`,labelKey:`killTerminal`,keywords:[`terminal`,`kill`,`close`,`session`,`stop`],availability:{host:`desktop`,requiresTerminalCapability:!0,requiresTerminalLive:!0},palette:{group:`terminal`,visibility:`search-only`},menu:[{section:`terminal`,order:3}]},{id:`check-for-updates`,labelKey:`checkForUpdates`,keywords:[`update`,`upgrade`,`version`,`check`,`app`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`app-updates`,order:0,platform:`mac`,ellipsis:!0},{section:`help-updates`,order:0,platform:`other`,ellipsis:!0}]},{id:`set-up-integrations`,labelKey:`setUpIntegrations`,keywords:[`integrations`,`mcp`,`setup`,`claude`,`configure`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`file-integrations`,order:0,ellipsis:!0}]},{id:`toggle-spell-check`,labelKey:`checkSpelling`,keywords:[`spell`,`spelling`,`check`,`typing`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`edit-spell`,order:0,checkbox:!0}]},{id:`open-github`,labelKey:`openOnGithub`,keywords:[`github`,`source`,`repository`,`code`,`view`],availability:{},palette:{group:`app`,visibility:`search-only`},menu:[{section:`help-links`,order:0}]},{id:`uninstall`,keywords:[],availability:{host:`desktop`},menu:[{section:`app-uninstall`,order:0,platform:`mac`,ellipsis:!0,menuLabelText:`Uninstall OpenKnowledge`}]}];function lY(e,t){let n=e.attrs[t];return typeof n==`string`?n:``}function uY(e,t){let n=e.attrs.props;if(typeof n!=`object`||!n)return``;let r=n[t];return typeof r==`string`?r:``}var dY=[`children`,`chart`,`formula`,`alt`,`name`,`alias`,`target`];function fY(e){for(let t of dY){let n=uY(e,t);if(n.length>0)return n}return lY(e,`sourceRaw`)}function pY(e){switch(e.type.name){case`wikiLink`:return lY(e,`alias`)||lY(e,`target`);case`wikiLinkEmbed`:return lY(e,`target`);case`tag`:return`#${lY(e,`value`)}`;case`mathInline`:return lY(e,`formula`);case`image`:case`imageReference`:return lY(e,`alt`);case`footnoteReference`:return lY(e,`label`)||lY(e,`identifier`);case`jsxComponent`:case`jsxInline`:return e.content.size===0?fY(e):``;default:return``}}function mY(e,t,n,r=`
|
|
402
402
|
`,{inlineOnly:i=!1}={}){let a=``,o=!0;return e.nodesBetween(t,n,(e,s)=>{let c=e.isText?(e.text??``).slice(Math.max(t,s)-s,n-s):i&&e.isBlock?``:pY(e);return e.isBlock&&(e.isTextblock||c.length>0)&&r&&(o?o=!1:a+=r),a+=c,!0},0),a}var hY=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function gY(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function _Y(e){let t=gY(e);return t!==null&&hY.has(t)}function vY(e){let t=gY(e);return t===null?null:hY.get(t)??null}var yY=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function bY(e){yY.lastIndex=0;let t=e.match(yY);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=vY(e);if(t===null)return null;n+=t}return n}var xY=new Set([`*`,`_`,"`",`~`,`\\`,`$`]),SY=/^={2,}/,CY=/^<(?:[A-Za-z][A-Za-z0-9+.-]*:[^<>\s]*|[^\s<>@]+@[^\s<>]+)>/,wY=512;function TY(e,t){return CY.test(e.slice(t,t+wY))}function EY(e,t){let n=e.lastIndexOf(`<`,t);return n<0||t-n>wY?!1:CY.exec(e.slice(n,t+1))?.[0].length===t+1-n}var DY=/^<\/?[A-Za-z][A-Za-z0-9-]*(?:\s[^>]*?)?\/?>/,OY=512,kY=/^!(?=\[)/,AY=/^\[\^/,jY=/^\]\[[^\]]*\]/,MY=/^\[\[[^\][|]*\|/,NY=/^#[^\][|]*(?=\]\])/,PY=512,FY=/^\]\([^)]*\)/,IY=512,LY=/^(?:#{1,6}[ \t]+|>[ \t]?|(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?)/,RY=32,zY=`|`,BY=/^(?:`{3,}[^`\n]*|~{3,}[^\n]*)$/,VY=/^(?:(?:[-*_][ \t]*){3,}|=+[ \t]*|[|\-: \t]*-[|\-: \t]*)$/,HY=1024;function UY(e,t){let n=e.indexOf(`
|
|
@@ -500,8 +500,8 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
500
500
|
`)){t.push(n);continue}let r=e.split(`
|
|
501
501
|
`);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function _1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!m1.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&_1(t)}}var v1=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),y1=()=>e=>{b1(e)};function b1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&b1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return x1(t)?[]:S1(t)?t.children:[t]})}}function x1(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function S1(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>v1.has(String(e))):!1}var C1=`docs-internal-guid-`;function w1(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var T1=()=>e=>{E1(e)};function E1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&E1(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(D1(r)||O1(r)){w1(e,t);continue}t++}}function D1(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(C1)}function O1(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var k1=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),A1=()=>e=>{j1(e)};function j1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&j1(t);for(let t of e.children)t.type===`element`&&M1(t)}}function M1(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!k1.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var N1=/^gmail_/,P1=()=>e=>{F1(e)};function F1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&F1(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&I1(r,`gmail_quote`)&&(r.tagName=`blockquote`),L1(r),R1(r)){e.children.splice(t,1,...r.children);continue}t++}}function I1(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function L1(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!N1.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function R1(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var z1=()=>e=>{B1(e)};function B1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&B1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(V1(t),[t])})}}function V1(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var H1=[`o:`,`w:`,`m:`,`v:`,`u1:`],U1=/^Mso[A-Z]/,W1=/^\s*\[if\s+[^\]]*\]/,G1=()=>e=>{K1(e)};function K1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&K1(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return W1.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return q1(t)?[]:(J1(t),[t])})}}function q1(e){return H1.some(t=>e.tagName.startsWith(t))}function J1(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!U1.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&U1.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);H1.some(e=>e===`${n}:`)&&delete t[e]}}var Y1=/^c-(message_kit__|message__|compose|timestamp)/,X1=()=>e=>{Z1(e)};function Z1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&Z1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return Q1(t)?[]:($1(t),[t])})}}function Q1(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function $1(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!Y1.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var e0=()=>e=>{t0(e)};function t0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&t0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;n0(r)&&(e.children[t]=i0(r))}}}function n0(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>r0(e))}function r0(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||r0(e))return!0}return!1}function i0(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>a0(e)).join(`
|
|
502
502
|
`)}]}]}}function a0(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=a0(n));return t}var o0=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function s0(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}s0(e)})}function c0(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
|
|
503
|
-
`)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=e.value.replace(/\|/g,`\\|`))),c0(e)}function l0(e){
|
|
504
|
-
`).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var d0=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},f0=[T1,G1,y1,P1,oie,e0,z1,X1,A1];function p0(e){h(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function m0(e){h(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}var h0={u:_0(`u`),ins:_0(`ins`)},g0=`okUnderlineForm`;function _0(e){return(t,n)=>{let r={type:`emphasis`,children:t.all(n),data:{[g0]:e}};return t.patch(n,r),r}}function v0(e){let t=e=>{if(!Array.isArray(e.children))return;for(let n of e.children)t(n);let n=[];for(let t of e.children){let e=t.data?.[g0],r=t.children;if((e===`u`||e===`ins`)&&Array.isArray(r)){n.push({type:`html`,value:`<${e}>`}),n.push(...r),n.push({type:`html`,value:`</${e}>`});continue}n.push(t)}e.children=n};t(e)}function y0(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new d0(e.length,n);let r=Se().use(lj,{fragment:!0});for(let e of f0)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(EN,{handlers:h0});let i=r.parse(e),a=r.runSync(i);return m0(a),v0(a),p0(a),a}function b0(e){return l0(e),String(Se().use(O).use($N,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function x0(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var S0=new Set([`sourceRaw`,`sourceDirty`,`position`]),C0=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),w0={type:`__br__`},T0=/^<br\s*\/?>$/i;function E0(e){let t=j0(e,E0);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:D0(t.content)}:t}function D0(e){let t=[];for(let n of e){let e=O0(n);e.length!==0&&(t.length>0&&t.push(w0),t.push(...e))}return t}function O0(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?D0(e.content):e.content}function k0(e){return e.type===`hardBreak`||e.type===w0.type||e.text!==void 0&&T0.test(e.text.trim())?w0:j0(e,k0)}var A0=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:E0},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:k0}];function j0(e,t){return e.content?{...e,content:e.content.map(t)}:e}function M0(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=N0(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:N0(e.attrs,t)})).sort((e,t)=>F0(e).localeCompare(F0(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>M0(e,t))),n}function N0(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(S0.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?P0(i,t):i)}return Object.keys(n).length>0?n:null}function P0(e,t){if(Array.isArray(e))return e.map(e=>P0(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=P0(i,t));return n}return e}function F0(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function I0(e,t=!1){let n=``,r=e=>{if(!(t&&e.type===`rawMdxFallback`)&&(e.text!==void 0&&(n+=e.text),e.content))for(let t of e.content)r(t)};return r(e),n.replace(/\s+/g,``)}function L0(e){let t=[],n=e=>{if(e.type&&C0.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function R0(e){let t=e,n=[];for(let e of A0){let r=F0(t),i=e.canonicalize(t);F0(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function z0(e,t,n={}){let r=R0(e),i=R0(t),a=[...new Set([...r.fired,...i.fired])],o=x0(I0(r.normalized),I0(i.normalized)),s=!o&&n.rawSourceSide===`expected`&&x0(I0(r.normalized,!0),I0(i.normalized,!0));if(!o&&!s)return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let c=L0(r.normalized),l=L0(i.normalized);if(F0(c)!==F0(l))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${c.join(`, `)}] vs [${l.join(`, `)}]`};let u=M0(r.normalized,n.ignoreAttrs),d=M0(i.normalized,n.ignoreAttrs);return F0(u)===F0(d)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:B0(u,d)}}function B0(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(F0(a[e])!==F0(o[e]))return B0(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function V0(e,t,n){return!z0(e,t,{ignoreAttrs:n}).equivalent}var H0=new Set([`src`,`href`,`size`]),U0=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function W0(e){if(Array.isArray(e))return e.map(e=>W0(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))H0.has(n)||(t[n]=W0(r));return t}return e}function G0(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&U0.has(e.attrs.componentName)?W0(e):e.content?{...e,content:e.content.map(G0)}:e}function K0(e){if(Array.isArray(e))return e.map(e=>K0(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=K0(r));return t}return e}function q0(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=q0(t);if(e)return e}}function J0(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=q0(e.parse(r)),o=a?G0(K0(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?V0(n,G0(K0(e))):!1}}}function Y0(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&X0(e.value.value,t))continue}let o=Z0(e,t);r>=0?n[r]=o:n.push(o)}return n}function X0(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Z0(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function Q0(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Y0(t,r),children:n.all(t),data:{}}}function $0(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Y0(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var e2=/^[A-Za-z0-9]{20,}$/,t2=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function n2(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function r2(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return e2.test(n)?n:null}function i2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!n2(t.hostname))return null;let n=r2(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&t2.test(r)?r:null}}function a2(e){return i2(e)!==null}function o2(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function s2(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:o2(t.hostname)}var c2=/^[A-Za-z0-9_-]{11}$/;function l2(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function u2(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function d2(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return c2.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return c2.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function f2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!l2(t.hostname))return null;let n=d2(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?u2(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var p2=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],m2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:Pu,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],h2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],g2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:Fu,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(s2(e.src)||a2(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:Pu,hideWhen:e=>typeof e.src==`string`&&(s2(e.src)||a2(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&a2(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(s2(e.src)||a2(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(f2(e.src)!==null||s2(e.src)||a2(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],_2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:Iu,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],v2=[{name:`title`,type:`string`,required:!0,description:`Heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the block renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],y2=[p2[0],p2[1],p2[4],p2[5],p2[6]],b2=[m2[0],m2[1],m2[7]],x2=[v2[0],v2[1],v2[4],v2[5]],S2=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],C2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],w2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],T2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],E2=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],D2=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],O2=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],k2=[O2[0]],A2=[O2[0]],j2=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],M2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],N2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],P2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:Lu,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],F2=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],I2=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function L2(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function R2(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function z2(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var B2=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:p2,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>Q0(`Callout`,e,t,p2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:m2,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>Q0(`img`,e,t,m2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:g2,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>Q0(`video`,e,t,g2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:_2,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>Q0(`audio`,e,t,_2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:P2,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>Q0(`Pdf`,e,t,P2)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:N2,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>Q0(`File`,e,t,N2)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:h2,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>Q0(`Embed`,e,t,h2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:v2,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>Q0(`Accordion`,e,t,v2)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:v2,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block (Notion-style). Same render + props as `<Accordion>` — pick whichever vocabulary matches the vault.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>Q0(`Toggle`,e,t,v2)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:E2,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
|
|
503
|
+
`)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=e.value.replace(/\|/g,`\\|`))),c0(e)}function l0(e){Te(e,`tableCell`,e=>{e.children.some(e=>!o0.has(e.type))&&(e.children=u0(e.children)),s0(e),c0(e)})}function u0(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
|
|
504
|
+
`).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var d0=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},f0=[T1,G1,y1,P1,oie,e0,z1,X1,A1];function p0(e){Te(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function m0(e){Te(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}var h0={u:_0(`u`),ins:_0(`ins`)},g0=`okUnderlineForm`;function _0(e){return(t,n)=>{let r={type:`emphasis`,children:t.all(n),data:{[g0]:e}};return t.patch(n,r),r}}function v0(e){let t=e=>{if(!Array.isArray(e.children))return;for(let n of e.children)t(n);let n=[];for(let t of e.children){let e=t.data?.[g0],r=t.children;if((e===`u`||e===`ins`)&&Array.isArray(r)){n.push({type:`html`,value:`<${e}>`}),n.push(...r),n.push({type:`html`,value:`</${e}>`});continue}n.push(t)}e.children=n};t(e)}function y0(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new d0(e.length,n);let r=xe().use(lj,{fragment:!0});for(let e of f0)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(EN,{handlers:h0});let i=r.parse(e),a=r.runSync(i);return m0(a),v0(a),p0(a),a}function b0(e){return l0(e),String(xe().use(pe).use($N,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function x0(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var S0=new Set([`sourceRaw`,`sourceDirty`,`position`]),C0=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),w0={type:`__br__`},T0=/^<br\s*\/?>$/i;function E0(e){let t=j0(e,E0);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:D0(t.content)}:t}function D0(e){let t=[];for(let n of e){let e=O0(n);e.length!==0&&(t.length>0&&t.push(w0),t.push(...e))}return t}function O0(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?D0(e.content):e.content}function k0(e){return e.type===`hardBreak`||e.type===w0.type||e.text!==void 0&&T0.test(e.text.trim())?w0:j0(e,k0)}var A0=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:E0},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:k0}];function j0(e,t){return e.content?{...e,content:e.content.map(t)}:e}function M0(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=N0(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:N0(e.attrs,t)})).sort((e,t)=>F0(e).localeCompare(F0(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>M0(e,t))),n}function N0(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(S0.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?P0(i,t):i)}return Object.keys(n).length>0?n:null}function P0(e,t){if(Array.isArray(e))return e.map(e=>P0(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=P0(i,t));return n}return e}function F0(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function I0(e,t=!1){let n=``,r=e=>{if(!(t&&e.type===`rawMdxFallback`)&&(e.text!==void 0&&(n+=e.text),e.content))for(let t of e.content)r(t)};return r(e),n.replace(/\s+/g,``)}function L0(e){let t=[],n=e=>{if(e.type&&C0.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function R0(e){let t=e,n=[];for(let e of A0){let r=F0(t),i=e.canonicalize(t);F0(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function z0(e,t,n={}){let r=R0(e),i=R0(t),a=[...new Set([...r.fired,...i.fired])],o=x0(I0(r.normalized),I0(i.normalized)),s=!o&&n.rawSourceSide===`expected`&&x0(I0(r.normalized,!0),I0(i.normalized,!0));if(!o&&!s)return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let c=L0(r.normalized),l=L0(i.normalized);if(F0(c)!==F0(l))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${c.join(`, `)}] vs [${l.join(`, `)}]`};let u=M0(r.normalized,n.ignoreAttrs),d=M0(i.normalized,n.ignoreAttrs);return F0(u)===F0(d)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:B0(u,d)}}function B0(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(F0(a[e])!==F0(o[e]))return B0(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function V0(e,t,n){return!z0(e,t,{ignoreAttrs:n}).equivalent}var H0=new Set([`src`,`href`,`size`]),U0=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function W0(e){if(Array.isArray(e))return e.map(e=>W0(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))H0.has(n)||(t[n]=W0(r));return t}return e}function G0(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&U0.has(e.attrs.componentName)?W0(e):e.content?{...e,content:e.content.map(G0)}:e}function K0(e){if(Array.isArray(e))return e.map(e=>K0(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=K0(r));return t}return e}function q0(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=q0(t);if(e)return e}}function J0(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=q0(e.parse(r)),o=a?G0(K0(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?V0(n,G0(K0(e))):!1}}}function Y0(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&X0(e.value.value,t))continue}let o=Z0(e,t);r>=0?n[r]=o:n.push(o)}return n}function X0(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Z0(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function Q0(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Y0(t,r),children:n.all(t),data:{}}}function $0(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Y0(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var e2=/^[A-Za-z0-9]{20,}$/,t2=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function n2(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function r2(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return e2.test(n)?n:null}function i2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!n2(t.hostname))return null;let n=r2(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&t2.test(r)?r:null}}function a2(e){return i2(e)!==null}function o2(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function s2(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:o2(t.hostname)}var c2=/^[A-Za-z0-9_-]{11}$/;function l2(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function u2(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function d2(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return c2.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return c2.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function f2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!l2(t.hostname))return null;let n=d2(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?u2(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var p2=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],m2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:Pu,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],h2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],g2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:Fu,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(s2(e.src)||a2(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:Pu,hideWhen:e=>typeof e.src==`string`&&(s2(e.src)||a2(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&a2(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(s2(e.src)||a2(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(f2(e.src)!==null||s2(e.src)||a2(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],_2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:Iu,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],v2=[{name:`title`,type:`string`,required:!0,description:`Heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the block renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],y2=[p2[0],p2[1],p2[4],p2[5],p2[6]],b2=[m2[0],m2[1],m2[7]],x2=[v2[0],v2[1],v2[4],v2[5]],S2=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],C2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],w2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],T2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],E2=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],D2=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],O2=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],k2=[O2[0]],A2=[O2[0]],j2=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],M2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],N2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],P2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:Lu,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],F2=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],I2=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function L2(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function R2(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function z2(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var B2=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:p2,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>Q0(`Callout`,e,t,p2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:m2,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>Q0(`img`,e,t,m2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:g2,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>Q0(`video`,e,t,g2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:_2,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>Q0(`audio`,e,t,_2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:P2,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>Q0(`Pdf`,e,t,P2)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:N2,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>Q0(`File`,e,t,N2)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:h2,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>Q0(`Embed`,e,t,h2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:v2,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>Q0(`Accordion`,e,t,v2)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:v2,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block (Notion-style). Same render + props as `<Accordion>` — pick whichever vocabulary matches the vault.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>Q0(`Toggle`,e,t,v2)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:E2,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
|
|
505
505
|
<Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>Q0(`Tabs`,e,t,E2)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:D2,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>Q0(`Tab`,e,t,D2)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:O2,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>Q0(`Math`,e,t,O2)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:j2,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:F2,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>Q0(`Mirror`,e,t,F2)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:I2,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>Q0(`MirrorSource`,e,t,I2)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:y2,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:b2,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (``) — read-only compat. Preserves `` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:C2,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:z2},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:w2,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:z2},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:T2,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:z2},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:M2,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:z2},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:x2,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${L2(n.name)}"`:``,a=n?.id?` id="${L2(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${R2(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:S2,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${L2(i)}"`):`${a} align="${L2(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:k2,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:A2,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],V2={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>Q0(e.attrs.componentName||`*`,e,t)};function H2(){let e=new Map;e.set(`*`,V2);for(let t of B2)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var U2={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function W2(){U2.parseFallback.blockLevel++}function G2(){U2.parseFallback.wholeDoc++}function K2(){U2.parseFallback.wholeDocBudget++}function q2(e){U2.jsxRenderFailure[e]=(U2.jsxRenderFailure[e]??0)+1}function J2(e){U2.jsxAutoConvertFailed[e]=(U2.jsxAutoConvertFailed[e]??0)+1}function Y2(e){U2.jsxAutoConvertSucceeded[e]=(U2.jsxAutoConvertSucceeded[e]??0)+1}function X2(e){U2.jsxPropDropped[e]=(U2.jsxPropDropped[e]??0)+1}function Z2(e){U2.jsxMoveFailed[e]=(U2.jsxMoveFailed[e]??0)+1}function Q2(e){U2.jsxStuckCopyFailed[e]=(U2.jsxStuckCopyFailed[e]??0)+1}function $2(e){U2.jsxStuckDeleteFailed[e]=(U2.jsxStuckDeleteFailed[e]??0)+1}function e4(e){U2.jsxPopoverCloseRestoreFailed[e]=(U2.jsxPopoverCloseRestoreFailed[e]??0)+1}function t4(e){U2.jsxKeyboardDeleteFailed[e]=(U2.jsxKeyboardDeleteFailed[e]??0)+1}function n4(e){U2.blockGripClickSelectFailed[e]=(U2.blockGripClickSelectFailed[e]??0)+1}function r4(e){U2.jsxArrowNodeSelectFailed[e]=(U2.jsxArrowNodeSelectFailed[e]??0)+1}var i4=/^(`{3,}|~{3,})/gm;function a4(e){let t=[],n=null;for(let r of e.matchAll(i4)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function o4(e,t){return t.some(([t,n])=>e>=t&&e<n)}var s4=/`+/g;function c4(e){let t=[];s4.lastIndex=0;for(let n of e.matchAll(s4))t.push({offset:n.index,length:n[0].length});let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let i=e+1;i<t.length;i++){let a=t[i];if(a.length===r.length){n.push([r.offset,a.offset+a.length]),e=i;break}}}return n}var l4=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function u4(e){let t=a4(e),n=[];for(let r of e.matchAll(l4))o4(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
|
|
506
506
|
`)}\n\n`:``}var d4=500,f4=1e3;function p4(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return _4(e,t.parse,0,n)}function m4(e){return e.calls>=f4?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=d4}var h4=500;function g4(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,h4),stack:e.stack?.split(`
|
|
507
507
|
`).slice(0,4).join(`
|
|
@@ -513,14 +513,14 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
513
513
|
`){let t=e[r+1];if(t===`
|
|
514
514
|
`||t===`>`){if(n.onFlush(),t===`
|
|
515
515
|
`)for(;e[r+1]===`
|
|
516
|
-
`;)r++;continue}}let i=e[r];if(!(i!==`{`&&i!==`}`)){if(t){let t=0;for(let n=r-1;n>=0&&e[n]===`\\`;n--)t++;if(t%2==1)continue}n.onBrace(r,i)}}}function r3(e){let t=e;if(P4.test(t))for(let[e,n]of N4)t=t.replaceAll(e,n);t=t.replace(L4,e=>e.replace(/</g,O4).replace(/>/g,k4)),t=t.replace(I4,(e,t)=>`${O4}${t.replaceAll(`:`,A4).replaceAll(`@`,j4)}${k4}`);let n=new Map,r=[...a4(t),...c4(t)];t=t.replace(R4,(e,i,a)=>{if(V4.has(i)){let o=n.get(i)??0;if(o<H4(t,i,a,r))return n.set(i,o+1),e}return e.replace(/</g,O4).replace(/>/g,k4)}),t=t.replace(z4,(e,t)=>B4.has(t)&&e.endsWith(`/>`)||V4.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,O4).replace(/>/g,k4):e),t=t.replace(/<>/g,`${O4}${k4}`);let i=G4(t),a=K4(t),o=q4(t),s=Z4(t);t=t.replace(/</g,(e,n)=>{if(Y4(n,t)||Q4(n,s))return e;let r=t.slice(n,n+256);if(r[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(r)?e:O4;let c=/^<([a-z][a-z0-9]*)/.exec(r);if(c&&B4.has(c[1])&&X4(n,t,o,a))return e;let l=/^<([a-z][a-z0-9]*)([\s/>])/.exec(r);if(l&&V4.has(l[1])){let i=l[1];return r.startsWith(`<${i}/>`)||t.indexOf(`</${i}>`,n)!==-1?e:O4}let u=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(r);if(!u)return O4;let d=u[1],f=W4(a,n),p=f<a.length?a[f]:t.length;if($4(n+1+d.length,t,p))return e;let m=i.get(d);return m&&W4(m,n)<m.length?e:O4});{let{unmatched:e}=e3(t,{escapeAware:!0});if(e.length>0){let n=t.split(``);for(let t of e)n[t]=M4;t=n.join(``)}}return t}function i3(e){return P4.test(e)||F4.test(e)}function a3(){return e=>{
|
|
517
|
-
`,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(T3);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function D3(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(w3);return n?n[1].toLowerCase():null}function O3(e){return S3[e.toLowerCase()]??null}function k3(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&A3(o[0],s)?o.slice(1):o,position:e.position}}function A3(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function j3(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${C3}-title`)}function M3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;
|
|
518
|
-
`?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function V3(e,t,n){return{start:B3(e,t),end:B3(e,n)}}function H3(e,t,n,r){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return;let i=t.position.start.offset;return V3(e,I3(e,i,t.value,n),I3(e,i,t.value,r))}var U3=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,W3=/<!--([\s\S]*?)-->/g;function G3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;q3(e,n),
|
|
519
|
-
`;)r--;let i=e.slice(r,n===t-1?n:n+1);if(i.trim().length===0){n=r-2;continue}return i6.test(i)}return!1}function o6(e){if(!e.includes(`</`))return e;let t=a4(e),n=!1,r=e.replace(r6,(r,i,a,o,s)=>o4(s,t)||!a6(e,s)?r:(n=!0,`${a}${o}`));return n?r:e}var s6=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,c6=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,l6=/^\s*<\/details>\s*$/;function u6(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function d6(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function f6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function p6(e){return e.children[0].value??``}function m6(e){if(!f6(e))return null;let t=p6(e).match(s6);if(!t)return null;let{defaultOpen:n,name:r,id:i}=u6(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:d6({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function h6(e,t){let n=e[t];if(!f6(n))return null;let r=p6(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(c6);if(!i)return null;let{defaultOpen:a,name:o,id:s}=u6(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!f6(t))continue;let r=p6(t);if(l6.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function g6(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(f6(e)){let r=m6(e);if(r){t[n]=r,n++;continue}let i=h6(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:d6(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function _6(){return e=>{
|
|
516
|
+
`;)r++;continue}}let i=e[r];if(!(i!==`{`&&i!==`}`)){if(t){let t=0;for(let n=r-1;n>=0&&e[n]===`\\`;n--)t++;if(t%2==1)continue}n.onBrace(r,i)}}}function r3(e){let t=e;if(P4.test(t))for(let[e,n]of N4)t=t.replaceAll(e,n);t=t.replace(L4,e=>e.replace(/</g,O4).replace(/>/g,k4)),t=t.replace(I4,(e,t)=>`${O4}${t.replaceAll(`:`,A4).replaceAll(`@`,j4)}${k4}`);let n=new Map,r=[...a4(t),...c4(t)];t=t.replace(R4,(e,i,a)=>{if(V4.has(i)){let o=n.get(i)??0;if(o<H4(t,i,a,r))return n.set(i,o+1),e}return e.replace(/</g,O4).replace(/>/g,k4)}),t=t.replace(z4,(e,t)=>B4.has(t)&&e.endsWith(`/>`)||V4.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,O4).replace(/>/g,k4):e),t=t.replace(/<>/g,`${O4}${k4}`);let i=G4(t),a=K4(t),o=q4(t),s=Z4(t);t=t.replace(/</g,(e,n)=>{if(Y4(n,t)||Q4(n,s))return e;let r=t.slice(n,n+256);if(r[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(r)?e:O4;let c=/^<([a-z][a-z0-9]*)/.exec(r);if(c&&B4.has(c[1])&&X4(n,t,o,a))return e;let l=/^<([a-z][a-z0-9]*)([\s/>])/.exec(r);if(l&&V4.has(l[1])){let i=l[1];return r.startsWith(`<${i}/>`)||t.indexOf(`</${i}>`,n)!==-1?e:O4}let u=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(r);if(!u)return O4;let d=u[1],f=W4(a,n),p=f<a.length?a[f]:t.length;if($4(n+1+d.length,t,p))return e;let m=i.get(d);return m&&W4(m,n)<m.length?e:O4});{let{unmatched:e}=e3(t,{escapeAware:!0});if(e.length>0){let n=t.split(``);for(let t of e)n[t]=M4;t=n.join(``)}}return t}function i3(e){return P4.test(e)||F4.test(e)}function a3(){return e=>{Te(e,e=>{let t=e;typeof t.value==`string`&&i3(t.value)&&(t.value=o3(t.value)),typeof t.url==`string`&&i3(t.url)&&(t.url=o3(t.url)),typeof t.title==`string`&&i3(t.title)&&(t.title=o3(t.title)),typeof t.alt==`string`&&i3(t.alt)&&(t.alt=o3(t.alt)),typeof t.lang==`string`&&i3(t.lang)&&(t.lang=o3(t.lang)),typeof t.meta==`string`&&i3(t.meta)&&(t.meta=o3(t.meta))})}}function o3(e){let t=e.replaceAll(O4,`<`).replaceAll(k4,`>`).replaceAll(A4,`:`).replaceAll(j4,`@`).replaceAll(M4,`{`);if(F4.test(t))for(let[e,n]of N4)t=t.replaceAll(n,e);return t}var s3=``,c3=``,l3=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function u3(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function d3(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||u3(e,r)%2==1?t:n(t))}function f3(e){return l3.lastIndex=0,e.replace(l3,e=>{let t=e.slice(1,-1);if(t.startsWith(`#`)){let e=t[1]===`x`||t[1]===`X`;return ce(t.slice(e?2:1),e?16:10)}let n=ge(t);return n===!1?e:n})}function p3(e){return d3(e,l3,e=>`${s3}${e.slice(1,-1)}${c3}`)}var m3=RegExp(`${s3}([^${c3}]+)${c3}`,`g`);function h3(e){if(!e.includes(s3))return{value:e,spans:[]};let t=[],n=``,r=0;m3.lastIndex=0;let i=m3.exec(e);for(;i!==null;){i.index>r&&(n+=e.slice(r,i.index));let a=`&${i[1]??``};`;t.push({offset:n.length,length:a.length,raw:a}),n+=a,r=i.index+i[0].length,i=m3.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function g3(){return e=>{Te(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(s3)){let{value:n,spans:r}=h3(t.value);if(t.value=n,e.type===`text`&&r.length>0){let t=e;t.data??={},t.data.entityRefSpans=r}}for(let e of[`url`,`title`,`alt`,`lang`,`meta`]){let n=t[e];typeof n==`string`&&n.includes(s3)&&(t[e]=h3(n).value)}})}}var _3=``,v3=/\\</g;function y3(e){return d3(e,v3,e=>`${_3}${e.slice(1)}`)}function b3(){return e=>{Te(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(_3)&&(t.value=t.value.split(_3).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(_3)&&(t[e]=n.split(_3).join(``))}})}}var x3=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),S3={note:`note`,tip:`tip`,important:`important`,warning:`warning`,caution:`caution`,abstract:`abstract`,info:`info`,todo:`todo`,success:`success`,question:`question`,failure:`failure`,danger:`danger`,bug:`bug`,example:`example`,quote:`quote`,summary:`abstract`,tldr:`abstract`,check:`success`,done:`success`,help:`question`,faq:`question`,fail:`failure`,missing:`failure`,error:`danger`,cite:`quote`,idea:`tip`,hint:`tip`,warn:`warning`,attention:`warning`},C3=`ok-alert`,w3=RegExp(`(?:^|\\s)${C3}-(\\w+)(?:\\s|$)`),T3=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function E3(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
|
|
517
|
+
`,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(T3);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function D3(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(w3);return n?n[1].toLowerCase():null}function O3(e){return S3[e.toLowerCase()]??null}function k3(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&A3(o[0],s)?o.slice(1):o,position:e.position}}function A3(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function j3(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${C3}-title`)}function M3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;Te(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=D3(e);if(!i)return;let a=O3(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=E3(n,e.position.start.offset),s&&(o=s.title,a||=O3(s.rawType)));let c=a??`note`,l=s&&x3.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=E3(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!j3(e.children[0]))return;let f=k3(e,c,o,l,d);r.children[t]=f})}}var N3=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`,P3={markers:`*`,classPrefix:C3,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>N3})};function F3(e,t,n){return e[t]===`\\`&&t+1<e.length&&e[t+1]===n}function I3(e,t,n,r){let i=t,a=0;for(;a<r&&i<e.length;)i+=F3(e,i,n[a])?2:1,a+=1;return i}var L3=new Set;function R3(e,t){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return null;let n=t.position.start.offset,r=t.value,i=Math.min(t.position.end?.offset??e.length,n+2*r.length,e.length),a=!1;for(let t=n;t<i;t++)if(e.charCodeAt(t)===92){a=!0;break}if(!a)return L3;let o=null,s=n,c=0;for(;c<r.length&&s<e.length;){if(F3(e,s,r[c]))o===null&&(o=new Set),o.add(c),s+=2;else if(e[s]===r[c])s+=1;else break;c+=1}return o??L3}function z3(e,t,n){if(e===null||e.size===0)return!1;for(let r=0;r<n;r++)if(e.has(t+r))return!0;return!1}function B3(e,t){let n=1,r=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
|
|
518
|
+
`?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function V3(e,t,n){return{start:B3(e,t),end:B3(e,n)}}function H3(e,t,n,r){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return;let i=t.position.start.offset;return V3(e,I3(e,i,t.value,n),I3(e,i,t.value,r))}var U3=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,W3=/<!--([\s\S]*?)-->/g;function G3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;q3(e,n),Te(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`%%`)===-1&&i.indexOf(`<!--`)===-1)return;let a=K3(i,R3(n,e));if(a.length===0)return;let o=[],s=0;for(let t of a){if(t.start>s){let r={type:`text`,value:i.slice(s,t.start)},a=H3(n,e,s,t.start);a&&(r.position=a),o.push(r)}let r={type:`comment`,children:[{type:`text`,value:t.body}],data:{sourceForm:t.sourceForm}},a=H3(n,e,t.start,t.end);a&&(r.position=a),o.push(r),s=t.end}if(s<i.length){let t={type:`text`,value:i.slice(s)},r=H3(n,e,s,i.length);r&&(t.position=r),o.push(t)}return r.children.splice(t,1,...o),[S,t+o.length]})}}function K3(e,t){let n=[];U3.lastIndex=0;let r;for(;(r=U3.exec(e))!==null;){if(z3(t,r.index,2)||z3(t,r.index+r[0].length-2,2)){U3.lastIndex=r.index+1;continue}r[1].trim().length!==0&&n.push({start:r.index,end:r.index+r[0].length,body:r[1],sourceForm:`percent`})}W3.lastIndex=0;let i;for(;(i=W3.exec(e))!==null;){if(z3(t,i.index,4)||z3(t,i.index+i[0].length-3,3)){W3.lastIndex=i.index+1;continue}let e=i[1].trim();e!==``&&n.push({start:i.index,end:i.index+i[0].length,body:e,sourceForm:`html`})}n.sort((e,t)=>e.start-t.start);let a=[],o=-1;for(let e of n)e.start<o||(a.push(e),o=e.end);return a}function q3(e,t){let n=e.children,r=0;for(;r<n.length;){let e=n[r];if(e.type===`paragraph`){let i=X3(e);if(i!==null){let a=e.children[0],o,s=()=>(o===void 0&&(o=R3(t,a)),o),c=Z3(i);if(c!==null&&!z3(s(),0,2)&&!z3(s(),i.length-2,2)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:c}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,1,e),r+=1;continue}let l=Q3(i);if(l!==null&&!z3(s(),i.length-i.trimStart().length,4)&&!z3(s(),i.trimEnd().length-3,3)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:l}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}let a=$3(e);if(a!==null&&!Y3(t,e,4,3)){let e={type:`commentBlock`,children:[a],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}let o=e6(e);if(o!==null&&!Y3(t,e,2,2)){let e={type:`commentBlock`,children:[o],data:{sourceForm:`percent`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}if(e.type===`paragraph`&&n6(e,t)){let e=r+1;for(;e<n.length;){let r=n[e];if(r.type===`paragraph`&&n6(r,t))break;e+=1}if(e<n.length&&e>r+1){let t={type:`commentBlock`,children:n.slice(r+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,e-r+1,t),r+=1;continue}}r+=1}}function J3(e,t,n,r){return z3(R3(e,t),n,r)}function Y3(e,t,n,r){let i=t.children[0],a=t.children[t.children.length-1];if(i.type!==`text`||a.type!==`text`)return!1;let o=i.value.length-i.value.trimStart().length,s=a.value.trimEnd().length-r,c=R3(e,i);return z3(c,o,n)?!0:z3(a===i?c:R3(e,a),s,r)}function X3(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function Z3(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function Q3(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function $3(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`<!--`))return null;let i=n.value.trimEnd();if(!i.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(t6(r,`<!--`)>1||t6(r,`-->`)>0)return null}else if(t===e.children.length-1){if(t6(r,`<!--`)>0||t6(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let a=r.slice(4);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-3);o.endsWith(` `)&&(o=o.slice(0,-1));let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function e6(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`%%`)||r.startsWith(`%%%`))return null;let i=n.value.trimEnd();if(!i.endsWith(`%%`)||i.endsWith(`%%%`))return null;let a=r.slice(2);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-2);if(o.endsWith(` `)&&(o=o.slice(0,-1)),a.indexOf(`%%`)!==-1||o.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type===`text`?e.value.trim().length>0:!0)||a.trim().length>0||o.trim().length>0))return null;let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function t6(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function n6(e,t){let n=X3(e);return n===null||n.trim()!==`%%`?!1:!J3(t,e.children[0],n.indexOf(`%%`),2)}var r6=/^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm,i6=/^[ ]{0,3}([-*+]|\d{1,9}[.)])([ \t]|$)/;function a6(e,t){if(t===0)return!1;let n=t-1;for(;n>=0;){let r=n;for(;r>0&&e[r-1]!==`
|
|
519
|
+
`;)r--;let i=e.slice(r,n===t-1?n:n+1);if(i.trim().length===0){n=r-2;continue}return i6.test(i)}return!1}function o6(e){if(!e.includes(`</`))return e;let t=a4(e),n=!1,r=e.replace(r6,(r,i,a,o,s)=>o4(s,t)||!a6(e,s)?r:(n=!0,`${a}${o}`));return n?r:e}var s6=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,c6=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,l6=/^\s*<\/details>\s*$/;function u6(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function d6(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function f6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function p6(e){return e.children[0].value??``}function m6(e){if(!f6(e))return null;let t=p6(e).match(s6);if(!t)return null;let{defaultOpen:n,name:r,id:i}=u6(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:d6({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function h6(e,t){let n=e[t];if(!f6(n))return null;let r=p6(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(c6);if(!i)return null;let{defaultOpen:a,name:o,id:s}=u6(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!f6(t))continue;let r=p6(t);if(l6.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function g6(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(f6(e)){let r=m6(e);if(r){t[n]=r,n++;continue}let i=h6(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:d6(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function _6(){return e=>{Te(e,e=>{`children`in e&&Array.isArray(e.children)&&g6(e)})}}var v6=/^<(div|center)(\s[^>]*?)?\s*>$/i,y6=new Set([`center`,`left`,`right`,`justify`]);function b6(e){if(!e)return null;let t=e.match(/\balign\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+))/i);if(!t)return null;let n=(t[1]??t[2]??t[3]??``).toLowerCase();return y6.has(n)?n:null}function x6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function S6(e){return e.children[0].value??``}function C6(e){if(!x6(e))return null;let t=S6(e).trim().match(v6);if(!t)return null;let n=t[1].toLowerCase(),r=t[2]??``;return{tag:n,align:b6(r)??(n===`center`?`center`:null),sourceAttrs:r}}function w6(e,t,n){let r=new RegExp(String.raw`^\s*</${n}>\s*$`,`i`);for(let i=t+1;i<e.length;i++){let t=e[i];if(!x6(t))continue;let a=S6(t);if(r.test(a))return i;let o=a.trimStart().toLowerCase();if(o.startsWith(`<div`)||o.startsWith(`<center`)||o.includes(`</${n}>`))return null}return null}function T6(e){let t=e.children,n=0;for(;n<t.length;){let e=C6(t[n]);if(e!==null){let r=w6(t,n,e.tag);if(r!==null){let i=t[n],a=t[r],o=t.slice(n+1,r),s=i.position,c=a.position,l={type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[...e.align===null?[]:[{type:`mdxJsxAttribute`,name:`align`,value:e.align}],{type:`mdxJsxAttribute`,name:`tag`,value:e.tag},{type:`mdxJsxAttribute`,name:`sourceAttrs`,value:e.sourceAttrs}],children:o,position:s&&c?{start:s.start,end:c.end}:void 0};t.splice(n,r-n+1,l),n++;continue}}n++}}function E6(){return e=>{Te(e,e=>{`children`in e&&Array.isArray(e.children)&&T6(e)})}}var D6=` `;function O6(e){return e.type===`listItem`&&typeof e.checked==`boolean`}function k6(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];return n?.type===`paragraph`&&(n.children?.length??0)===0}function A6(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];if(n?.type!==`paragraph`||(n.children?.length??0)!==1)return!1;let r=n.children[0];if(r?.type!==`text`||r.value!==D6)return!1;let i=r.data?.entityRefSpans;if(!Array.isArray(i)||i.length!==1)return!1;let a=i[0];return a?.offset===0&&a.length===6&&a.raw===D6}function j6(e){Te(e,`listItem`,e=>{if(!O6(e)||!k6(e))return;let t=e.children[0];t.children=[{type:`text`,value:` `,data:{sourceRaw:D6}}]})}function M6(e){Te(e,`listItem`,e=>{!O6(e)||!A6(e)||(e.children[0].children=[])})}function N6(){return e=>{M6(e)}}var P6=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function F6(e){return e.type===`strong`||e.type===`emphasis`||e.type===`delete`||e.type===`inlineCode`}function I6(e){return e.type===`text`||e.type===`inlineCode`?e.value.length>0?e.value.charAt(0):null:`children`in e&&Array.isArray(e.children)&&e.children.length>0?I6(e.children[0]):null}function L6(e){if(e.type===`text`||e.type===`inlineCode`)return e.value.length>0?e.value.slice(-1):null;if(`children`in e&&Array.isArray(e.children)&&e.children.length>0){let t=e.children;return L6(t[t.length-1])}return null}function R6(e,t,n){let r={type:`text`,value:e.value.slice(t,n)},i=e.data?.entityRefSpans;if(i?.length){let e=i.filter(e=>e.offset>=t&&e.offset+e.length<=n).map(e=>({...e,offset:e.offset-t}));e.length>0&&(r.data={entityRefSpans:e})}return r}function z6(e,t){let n=e.children,r=new Map,i=e=>{let n=r.get(e);if(n!==void 0)return n;let i=R3(t,e);return r.set(e,i),i},a=0;for(;a<n.length;){let e=n[a];if(e.type!==`text`){a++;continue}let t=e.value,r=-1;for(let o=0;o<=t.length-2;o++){if(t.charCodeAt(o)!==61||t.charCodeAt(o+1)!==61||o>0&&t.charCodeAt(o-1)===61||z3(i(e),o,2))continue;let s;if(o+2<t.length)s=t.charAt(o+2);else{let e=n[a+1];if(!e)continue;s=I6(e)}if(!(s===null||/\s/.test(s))){r=o;break}}if(r===-1){a++;continue}let o=-1,s=-1,c=!1;for(let s=r+3;s<=t.length-2;s++){if(t.charCodeAt(s)!==61||t.charCodeAt(s+1)!==61||z3(i(e),s,2))continue;let r=t.charAt(s-1);if(/[\s=]/.test(r))continue;let c;if(s+2<t.length)c=t.charAt(s+2);else{let e=n[a+1];c=e?e.type===`text`?e.value[0]??null:I6(e):null}if(c!==`=`){o=-2;break}}if(o===-2){a++;continue}for(let e=a+1;e<n.length;e++){let t=n[e];if(t.type===`text`){for(let r=0;r<=t.value.length-2;r++){if(t.value.charCodeAt(r)!==61||t.value.charCodeAt(r+1)!==61||z3(i(t),r,2))continue;let a;if(r>0)a=t.value.charAt(r-1);else{let t=n[e-1];a=L6(t)}if(a===null||/[\s=]/.test(a))continue;let l;if(r+2<t.value.length)l=t.value.charAt(r+2);else{let t=n[e+1];l=t?t.type===`text`?t.value[0]??null:I6(t):null}if(l!==`=`){o=e,s=r,c=!0;break}}if(o>=0)break}else if(!F6(t))break}if(o<0){a++;continue}let l=n[o],u=t.slice(0,r),d=t.slice(r+2),f=l.value.slice(0,s),p=l.value.slice(s+2),m=[];d.length>0&&m.push(R6(e,r+2,t.length));for(let e=a+1;e<o;e++)m.push(n[e]);if(f.length>0&&m.push(R6(l,0,s)),!c){a++;continue}let h={type:`mark`,children:m},g=[];u.length>0&&g.push(R6(e,0,r)),g.push(h),p.length>0&&g.push(R6(l,s+2,l.value.length)),n.splice(a,o-a+1,...g),a+=+(u.length>0)+1}}function B6(e,t){if(`children`in e&&Array.isArray(e.children)){z6(e,t);for(let n of e.children)B6(n,t)}}function V6(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;Te(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`==`)===-1)return;let a=R3(n,e);P6.lastIndex=0;let o=[],s;for(;(s=P6.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(z3(a,e,2)||z3(a,t-2,2)){P6.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,i=r+t[0].length;if(r>l){let t=R6(e,l,r),i=H3(n,e,l,r);i&&(t.position=i),c.push(t)}let a=R6(e,r+2,i-2),o=H3(n,e,r+2,i-2);o&&(a.position=o);let s={type:`mark`,children:[a]},u=H3(n,e,r,i);u&&(s.position=u),c.push(s),l=i}if(l<i.length){let t=R6(e,l,i.length),r=H3(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[S,t+c.length]}),B6(e,n),Te(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function H6(){return e=>{Te(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(!r||r.type!==`image`)return;let i=U6(r,e);n.children[t]=i})}}function U6(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];typeof e.alt==`string`&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}var W6=/^( {4}|\t)/;function G6(e){let t=e.split(`
|
|
520
520
|
`),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!W6.test(e)))return!1;return n}function K6(e){return e.split(`
|
|
521
521
|
`).map(e=>e.length===0?e:e.startsWith(` `)?e.slice(4):e.startsWith(` `)?e.slice(1):e).join(`
|
|
522
522
|
`)}function q6(e,t){let n=e.position;if(!n||typeof n.start.offset!=`number`||typeof n.end.offset!=`number`)return null;let r=n.start.offset,i=n.end.offset;if(r<0||i>t.length||r>=i)return null;let a=r;for(;a>0&&t[a-1]!==`
|
|
523
|
-
`;)a--;if(a===r)return null;let o=t.slice(a,r);if(!W6.test(o))return null;let s=t.slice(a,i);if(!G6(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:K6(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var sie=function(){return(e,t)=>{let n=String(t.value??``);n&&
|
|
523
|
+
`;)a--;if(a===r)return null;let o=t.slice(a,r);if(!W6.test(o))return null;let s=t.slice(a,i);if(!G6(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:K6(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var sie=function(){return(e,t)=>{let n=String(t.value??``);n&&Te(e,`paragraph`,(e,t,r)=>{if(!r||r.type!==`root`||t==null)return;let i=r.children[t-1];if(i&&i.type===`list`)return;let a=q6(e,n);a&&(r.children[t]=a)})}},cie=3,lie=/^\n+$/;function uie(e){return e.length<cie||!lie.test(e)?0:e.length-2}function die(e,t){let n=[],r=e.children;for(let e=1;e<r.length;e++){let i=r[e-1],a=r[e],o=i?.position?.end?.offset,s=i?.position?.end?.line,c=a?.position?.start?.offset;if(typeof o!=`number`||typeof c!=`number`||typeof s!=`number`||c<o)continue;let l=uie(t.slice(o,c));if(l===0)continue;let u=[],d=[];for(let e=0;e<l;e++)u.push(s+2+e),d.push(o+2+e);n.push({beforeChildIndex:e,lines:u,offsets:d})}return n}function J6(e,t){let n=die(e,t);if(n.length===0)return;let r=[],i=0;for(let t=0;t<e.children.length;t++){let a=n[i];if(a&&a.beforeChildIndex===t){for(let e=0;e<a.lines.length;e++)r.push(fie(a.lines[e],a.offsets[e]));i+=1}r.push(e.children[t])}e.children=r}function fie(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function Y6(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}function X6(e){let t=e.identifier??e.label;if(typeof t!=`string`)return null;let n=Y6(t);return n.length>0?n:null}function pie(e){let t=new Map;return Te(e,`definition`,e=>{let n=X6(e);n&&!t.has(n)&&t.set(n,e)}),t}function mie(){return e=>{let t=pie(e);t.size!==0&&Te(e,`linkReference`,e=>{let n=X6(e);if(!n)return;let r=t.get(n);r&&(e.data={...e.data,resolvedUrl:r.url,resolvedTitle:r.title??null})})}}function Z6(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function hie(){return e=>{Te(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=Z6(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),Te(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=Z6(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}var Q6=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function gie(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;Q6.lastIndex=0;let a=[],o=0;for(;;){let n=Q6.exec(e);if(n===null)break;let s=n[0],c=n[1],l=n.index;if(l>o){let n={type:`text`,value:e.slice(o,l)},r=H3(t,i,o,l);r&&(n.position=r),a.push(n)}let u={type:`text`,value:c},d=H3(t,i,l+1,l+1+c.length);d&&(u.position=d);let f={type:`link`,url:c,title:null,children:[u],data:{sourceStyle:`autolink`}},p=H3(t,i,l,l+s.length);p&&(f.position=p),a.push(f),o=l+s.length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=H3(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}var _ie=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function $6(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length&&e[r+1]===`|`){n+=`${i}|`,r++;continue}if(i===`|`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function vie(e,t,n=!1,r){if(!t)return;let i=e.position;if(!i||typeof i.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let a=i.start.offset,o=i.end?.offset??a;if(a<0||o>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${a} end=${o} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(a,o),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&_ie.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}n.endsWith(`\\`)&&r.endsWith(`\\`)&&(e.data.sourceRaw=n);break}case`emphasis`:{let n=t[a];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(a,a+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:{let n=t[a],i=t.slice(a,o);if(n===`#`){if(e.data.sourceStyle=`atx`,r?.type===`root`){let n=a;for(;n>0&&t[n-1]!==`
|
|
524
524
|
`;)n--;let r=t.slice(n,a);r.length>=1&&r.length<=3&&/^ +$/.test(r)&&(e.data.sourceLeadingIndent=r.length)}let n=/^#+( {2,})[^ ]/.exec(i);n&&(e.data.sourceInteriorSpacing=n[1].length);let o=/^.*?[ \t](#+)[ \t]*$/.exec(i);o&&(e.data.sourceTrailingHashes=o[1].length)}else{let t=/\n(=+)[ \t]*$/.exec(i),n=/\n(-+)[ \t]*$/.exec(i),r=t??n;r?(e.data.sourceStyle=`setext`,e.data.sourceUnderlineLength=r[1].length):e.data.sourceStyle=`atx`}break}case`blockquote`:{let n=a;for(;n>0&&t[n-1]!==`
|
|
525
525
|
`;)n--;let r=!1;for(let e=n;e<a;e++)if(t[e]===`>`){r=!0;break}let i=t.slice(a,o).split(`
|
|
526
526
|
`),s=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.trim().length===0)continue;if(r&&e>0)break;let n=t.replace(/^ {1,3}/,``);if(n[0]!==`>`){e>0&&t.trimStart()[0]!==`>`&&s.push(`lazy`);continue}if(n.slice(1).trimEnd()!==``)if(n[1]===` `)s.push(1);else{let e=0;for(;n[1+e]===` `;)e++;s.push(e)}}s.length>0&&(e.data.sourceMarkerSpacings=s);break}case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`listItem`:{let n=t.slice(a,o),r=/^(?:([-+*])|(\d{1,9})[.)])( *)/.exec(n);if(!r)break;let s=r[1]?1:(r[2]?.length??0)+1,c=r[3].length;c>=2&&c<=4&&(e.data.sourceMarkerSpacing=c),r[2]&&(e.data.sourceOrdinal=Number.parseInt(r[2],10)),e.checked!=null&&/^\[([xX])\] /.exec(n.slice(s+Math.max(c,1)))?.[1]===`X`&&(e.data.sourceCheckboxChar=`X`);let l=s+(c>=2&&c<=4?c:1),u=a;for(;u>0&&t[u-1]!==`
|
|
@@ -536,9 +536,9 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
536
536
|
`);)t--;n[t]===`"`?e.data.sourceTitleMarker=`double`:n[t]===`'`?e.data.sourceTitleMarker=`single`:n[t]===`)`&&(e.data.sourceTitleMarker=`paren`)}}}}break;case`definition`:{let n=t.slice(a,o);if(e.data.sourceLayout=n.includes(`
|
|
537
537
|
`)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(a,o);break;case`break`:if(e.data.sourceRaw)break;t.slice(a,o).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var yie=`(^|\\s)#([a-zA-Z][\\w/-]*)`;function bie(){return new RegExp(yie,`g`)}var e8=bie(),xie=/^[a-zA-Z][\w/-]*$/;function Sie(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function Cie(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;e8.lastIndex=0;let o=[],s=0;for(;;){let n=e8.exec(e);if(n===null)break;let c=n[1]??``,l=n[2]??``,u=n.index+c.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=u&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===u){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&Sie(t,i))continue}if(u>s){let n={type:`text`,value:e.slice(s,u)},r=H3(t,i,s,u);r&&(n.position=r),o.push(n)}let d={type:`tag`,value:l},f=H3(t,i,u,u+1+l.length);f&&(d.position=f),o.push(d),s=u+1+l.length,r=!0}if(o.length===0)n.push(i);else{if(s<e.length){let n={type:`text`,value:e.slice(s)},r=H3(t,i,s,e.length);r&&(n.position=r),o.push(n)}n.push(...o)}}r&&(e.children=n)}var wie=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.underline.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function t8(e,t){if(!e||typeof e!=`object`)return null;if(typeof e.offset==`number`)return e.offset>=0&&e.offset<=t.length?e.offset:null;let{line:n,column:r}=e;if(typeof n!=`number`||typeof r!=`number`||n<1||r<1)return null;let i=0;for(let e=1;e<n;e++){let e=t.indexOf(`
|
|
538
538
|
`,i);if(e===-1)return null;i=e+1}let a=t.indexOf(`
|
|
539
|
-
`,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function Tie(e,t){if(!e)return null;let n=t8(e.start,t),r=t8(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function Eie(e,t){let n=Tie(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function Die(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;
|
|
539
|
+
`,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function Tie(e,t){if(!e)return null;let n=t8(e.start,t),r=t8(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function Eie(e,t){let n=Tie(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function Die(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;Te(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!wie.has(e.type)){let r=Eie(e,n);return i.children[t]=r,S}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(gie(t,n),Cie(t,n))}if(vie(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function Oie(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function kie(){return e=>{Te(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=Oie(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function n8(){let e=!1,t=``,n=0;return r=>{let i=Aie(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 Aie(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}function r8(e,t,n){for(let r=t;r<n;r++)e[r]=` `}function jie(e,t){if(e[t]!==`<`)return null;let n=e.slice(t).toLowerCase();for(let r of[`pre`,`code`]){if(!n.startsWith(`<${r}`))continue;let i=e[t+r.length+1];if(i===`>`||i===`/`||i===` `||i===` `)return r}return null}function Mie(e,t){let n=null;for(let r=t;r<e.length;r++){let t=e[r];if(n!==null)t===n&&(n=null);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r+1}return null}function i8(e,t,n){let r=RegExp(`</${n}\\s*>`,`i`).exec(e.slice(t));return r?.index===void 0?null:t+r.index+r[0].length}function Nie(e,t){let n=0;for(;e[t+n]==="`";)n+=1;if(n===0)return null;let r=t+n,i=r;for(;i<e.length;){if(e[i]!=="`"){i+=1;continue}let t=0;for(;e[i+t]==="`";)t+=1;if(t===n)return i+n;i+=t}return r}function Pie(e){let t=n8(),n=!1,r=null;return e.map(({text:e,start:i})=>{if(r===null&&!n&&t(e))return{text:` `.repeat(e.length),start:i};let a=e.split(``),o=0;for(;o<e.length;){if(n){let t=e.indexOf(`-->`,o),r=t<0?e.length:t+3;if(r8(a,o,r),o=r,t<0)break;n=!1;continue}if(r!==null){let t=i8(e,o,r);if(r8(a,o,t??e.length),t===null)break;o=t,r=null;continue}let t=e.indexOf(`<!--`,o),i=-1,s=null;for(let t=o;t<e.length;t++){let n=jie(e,t);if(n!==null){i=t,s=n;break}}let c=e.indexOf("`",o),l=t<0?i:i<0?t:Math.min(t,i);if(c>=0&&(l<0||c<l)){o=Nie(e,c)??c+1;continue}if(t<0&&i<0)break;if(t>=0&&(i<0||t<i)){let r=e.indexOf(`-->`,t+4),i=r<0?e.length:r+3;if(r8(a,t,i),o=i,n=r<0,n)break;continue}let u=Mie(e,i);if(u===null||s===null)break;let d=i8(e,u,s),f=d??e.length;if(r8(a,i,f),o=f,r=d===null?s:null,r!==null)break}return{text:a.join(``),start:i}})}function Fie(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r];i===`
|
|
540
540
|
`?(t.push({text:e.slice(n,r),start:n}),n=r+1):i===`\r`&&(t.push({text:e.slice(n,r),start:n}),e[r+1]===`
|
|
541
|
-
`&&(r+=1),n=r+1)}t.push({text:e.slice(n),start:n});let r=Pie(t),i=e.split(``);for(let e of r)for(let t=0;t<e.text.length;t++)i[e.start+t]=e.text[t];return i.join(``)}function Iie(e,t,n,r){return r<=n||e.slice(n,r).trim().length===0?!1:t.slice(n,r).trim().length===0}function Lie(e){return e.type===`link`||e.type===`linkReference`}function Rie(e,t,n,r){let i=n.position?.start.offset,a=n.position?.end.offset;if(i===void 0||a===void 0)return;let o=r.slice(i,a),s={type:`text`,value:o,data:{sourceRaw:o},position:n.position};e.children.splice(t,1,s)}function zie(){return(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value??``);if(n.length===0||!n.includes(`<!--`)&&!/<(pre|code)[\s/>]/i.test(n))return;let r=Fie(n),i=e=>{for(let t=e.children.length-1;t>=0;t--){let a=e.children[t];if(!a||(`children`in a&&Array.isArray(a.children)&&i(a),!Lie(a)))continue;let o=a.position?.start.offset,s=a.position?.end.offset;o===void 0||s===void 0||Iie(n,r,o,s)&&Rie(e,t,a,n)}};i(e)}}function a8(e){return e.data?.sourceRaw}function Bie(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`?a8(e)===``:!1}function o8(e){return e.type===`paragraph`?(e.children??[]).every(Bie):!1}function s8(e){let t=e.children??[],n=t[0]?.children?.length??0,r=0;for(let e=1;e<t.length;e++)r=Math.max(r,t[e]?.children?.length??0);let i=e.align??[];return Math.max(n,r,i.length)}function Vie(e){switch(e.type){case`table`:return s8(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return a8(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return a8(e)===void 0&&e.data?.htmlBoundary===void 0&&(e.children??[]).length===0&&!e.name;case`list`:return(e.children??[]).length===0;default:return!1}}function Hie(e){let t=[];for(let n of e.children){if(n.type===`table`&&s8(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}Vie(n)||(n.type===`paragraph`&&n.children.length>0&&o8(n)&&(n.children=[]),t.push(n))}e.children=t}function Uie(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var Wie=(e,t)=>{if(o8(e)||Uie(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},c8=uI(),l8=kF(),u8=AF();function d8(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===c8)||t.push(c8);let n=e.fromMarkdownExtensions;n.some(e=>e===l8)||n.push(l8);let r=e.toMarkdownExtensions;r.some(e=>e===u8)||r.push(u8)}var f8=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function Gie(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;h(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=R3(n,e);f8.lastIndex=0;let o=[],s;for(;(s=f8.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(z3(a,e,1)||z3(a,t-1,1)){f8.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,a=r+t[0].length;if(r>l){let t={type:`text`,value:i.slice(l,r)},a=H3(n,e,l,r);a&&(t.position=a),c.push(t)}let o={type:`inlineMath`,value:t[1]},s=H3(n,e,r,a);s&&(o.position=s),c.push(o),l=a}if(l<i.length){let t={type:`text`,value:i.slice(l)},r=H3(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[D,t+c.length]})}}var Kie=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]),qie=`<br />`;function Jie(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function Yie(e){e.data??={},e.data.sourceRaw=qie,e.data.sourceStyle=`html`}function p8(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var m8=/[ \t]+$/,h8=/^[ \t]*$/;function Xie(e){return e.some(e=>!(p8(e)&&h8.test(e.value)))}function g8(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(Jie(n)){Yie(n);break}if(n&&Kie.has(n.type)&&`children`in n){let t=n.children;if(g8(t,!0),t.length===0){e.pop();continue}}if(!t&&p8(n)&&m8.test(n.value)){let t=n.value.replace(m8,``);if(t.length>0){n.value=t;continue}if(Xie(e.slice(0,-1))){e.pop();continue}if(e.every(e=>p8(e)&&h8.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var Zie=new Set([`paragraph`,`heading`,`tableCell`]);function Qie(e){let t=e=>{if(Zie.has(e.type)&&`children`in e&&g8(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var _8={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function $ie(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===_8)||e.toMarkdownExtensions.push(_8)}var eae=new Set([`u`,`ins`]);function tae(){return e=>{h(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name===null||!eae.has(e.name)||(e.attributes??[]).length>0)return;let r={type:`underline`,children:e.children??[],data:{sourceForm:e.name===`ins`?`ins`:`u`}};return e.position&&(r.position=e.position),n.children.splice(t,1,r),t+1})}}var v8=/(?<!\uE102)<br[ \t]*\/?>/g,nae=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function rae(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;v8.lastIndex=0;let a=[],o=0;for(;;){let n=v8.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=H3(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=H3(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=H3(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function y8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;h(e,e=>{if(nae.has(e.type))return D;let t=e;Array.isArray(t.children)&&rae(e,n)})}}var b8=33,x8=91,S8=93,C8=124,w8=35,iae={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===x8?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===x8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===w8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===C8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===C8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===S8?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===S8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},aae={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===b8?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===x8?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===x8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===w8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===C8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===C8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===S8?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===S8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function oae(){return{text:{[x8]:iae,[b8]:aae}}}function sae(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function cae(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function T8(e){return e.stack[e.stack.length-1]}function lae(e){let t=T8(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function uae(e){let t=T8(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function dae(e){let t=T8(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function E8(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function fae(e){E8(T8(this)),this.exit(e)}function pae(e){E8(T8(this)),this.exit(e)}var D8={enter:{wikiLink:sae,wikiLinkEmbed:cae},exit:{wikiLinkTarget:lae,wikiLinkAnchor:uae,wikiLinkAlias:dae,wikiLink:fae,wikiLinkEmbed:pae}};function O8(e,t){return typeof e==`string`&&e.trim()===t?e:t}var k8={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${O8(t.data?.sourceTarget,n)}`;return r&&(a+=`#${O8(t.data?.sourceAnchor,r)}`),i&&(a+=`|${O8(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},A8=oae();function j8(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===A8)||e.micromarkExtensions.push(A8),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===D8)||e.fromMarkdownExtensions.push(D8),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===k8)||e.toMarkdownExtensions.push(k8)}function mae(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var hae=[{name:`remark-parse`,plugin:ie},{name:`remark-mdx-agnostic`,plugin:d8},{name:`remark-gfm`,plugin:O},{name:`remark-math`,plugin:$P,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:j8},{name:`remark-github-alerts`,plugin:VP,options:P3},{name:`callout-transformer`,plugin:M3},{name:`restore-from-mdx`,plugin:a3},{name:`void-br-promoter`,plugin:y8},{name:`restore-entity-refs`,plugin:g3},{name:`restore-backslash-escapes`,plugin:b3},{name:`details-accordion-promoter`,plugin:_6},{name:`div-align-promoter`,plugin:E6},{name:`image-promoter`,plugin:H6},{name:`indented-code-promoter`,plugin:sie},{name:`math-promoter`,plugin:hie},{name:`single-dollar-math-promoter`,plugin:Gie},{name:`highlight-promoter`,plugin:V6},{name:`underline-promoter`,plugin:tae},{name:`mermaid-promoter`,plugin:kie},{name:`comment-promoter`,plugin:G3},{name:`merged-post-parse-walker`,plugin:Die},{name:`empty-task-item-unmint`,plugin:N6},{name:`link-reference-destination`,plugin:mie},{name:`non-rendering-context-demote`,plugin:zie},{name:`ensure-non-empty-doc`,plugin:()=>mae}];function gae(e){let t=Se();for(let e of hae)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(fP,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function _ae(e){let t=Se().use(LP,[`yaml`]).use(O,{tablePipeAlign:!1}).use($P,{singleDollarTextMath:!1}).use(d8).use(j8).use($ie).use($N,{bullet:`-`,fences:!0,rule:`-`,join:[Wie],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function M8(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var N8=/^\n+$/,P8=/^\n{2,}$/;function F8(e,t,n){let r,i,a=e.children;if(a.length>0){let e=a[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);N8.test(n)&&(r=n)}let n=a[a.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);P8.test(e)&&(i=e)}}if(!n&&r===void 0&&i===void 0)return;let o={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i}};return e.data??={},e.data.sourceDocBoundary=o,o}function vae(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&N8.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&P8.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function yae(e,t){let{source:n,hadBom:r}=M8(e),i=o6(n),a=new _(p3(r3(y3(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);J6(s,i);let c=F8(s,i,r),l=c?p1(s,c):void 0,u=t.stringify(s);return l?u.type.create({...u.attrs,sourceDocBoundary:l},u.content,u.marks):u}function bae(e,t){return I8(e,t,!1)}function xae(e,t){return I8(e,t,!0)}function I8(e,t,n){let{source:r,hadBom:i}=M8(e),a=o6(r),o=new _(p3(r3(y3(a)))),s=t.parse(o);o.value=a;let c=t.runSync(s,o);n&&J6(c,a);let l=F8(c,a,i);return n&&l&&p1(c,l),c}function Sae(e,t,n){let r=mP(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});j6(r),Qie(r),Hie(r);let i=vae(e.attrs?.sourceDocBoundary),a=String(t.stringify(r));return i?.leading&&(a=i.leading+a),i?.trailing&&(a=a.replace(/\n+$/,``)+i.trailing),i?.bom&&(a=`\uFEFF${a}`),a}function Cae(){return!1}function wae(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function Tae(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function L8(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!fZ(e))return e;let n=Tae(wae(t),e);return n===``||n===`..`||n.startsWith(`../`)?(Cae()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var Eae=Object.assign(Hae,{peek:()=>`$`}),Dae=Object.assign(Uae,{peek:()=>`~`}),Oae=(()=>{for(let e of u8.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),kae=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function Aae(e){let t=e;return t.type===`rawMdxFallback`?{type:`mdxJsxFlowElement`,name:null,attributes:[],children:[],data:{sourceRaw:t.value??``}}:e}var jae={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&HZ(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=U8(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=U8(n,t.slice(o),{...r,before:r.before+a})),a}return U8(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=q8(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=q8(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:V8(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(B8(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(V8(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
541
|
+
`&&(r+=1),n=r+1)}t.push({text:e.slice(n),start:n});let r=Pie(t),i=e.split(``);for(let e of r)for(let t=0;t<e.text.length;t++)i[e.start+t]=e.text[t];return i.join(``)}function Iie(e,t,n,r){return r<=n||e.slice(n,r).trim().length===0?!1:t.slice(n,r).trim().length===0}function Lie(e){return e.type===`link`||e.type===`linkReference`}function Rie(e,t,n,r){let i=n.position?.start.offset,a=n.position?.end.offset;if(i===void 0||a===void 0)return;let o=r.slice(i,a),s={type:`text`,value:o,data:{sourceRaw:o},position:n.position};e.children.splice(t,1,s)}function zie(){return(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value??``);if(n.length===0||!n.includes(`<!--`)&&!/<(pre|code)[\s/>]/i.test(n))return;let r=Fie(n),i=e=>{for(let t=e.children.length-1;t>=0;t--){let a=e.children[t];if(!a||(`children`in a&&Array.isArray(a.children)&&i(a),!Lie(a)))continue;let o=a.position?.start.offset,s=a.position?.end.offset;o===void 0||s===void 0||Iie(n,r,o,s)&&Rie(e,t,a,n)}};i(e)}}function a8(e){return e.data?.sourceRaw}function Bie(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`?a8(e)===``:!1}function o8(e){return e.type===`paragraph`?(e.children??[]).every(Bie):!1}function s8(e){let t=e.children??[],n=t[0]?.children?.length??0,r=0;for(let e=1;e<t.length;e++)r=Math.max(r,t[e]?.children?.length??0);let i=e.align??[];return Math.max(n,r,i.length)}function Vie(e){switch(e.type){case`table`:return s8(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return a8(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return a8(e)===void 0&&e.data?.htmlBoundary===void 0&&(e.children??[]).length===0&&!e.name;case`list`:return(e.children??[]).length===0;default:return!1}}function Hie(e){let t=[];for(let n of e.children){if(n.type===`table`&&s8(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}Vie(n)||(n.type===`paragraph`&&n.children.length>0&&o8(n)&&(n.children=[]),t.push(n))}e.children=t}function Uie(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var Wie=(e,t)=>{if(o8(e)||Uie(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},c8=uI(),l8=kF(),u8=AF();function d8(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===c8)||t.push(c8);let n=e.fromMarkdownExtensions;n.some(e=>e===l8)||n.push(l8);let r=e.toMarkdownExtensions;r.some(e=>e===u8)||r.push(u8)}var f8=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function Gie(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;Te(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=R3(n,e);f8.lastIndex=0;let o=[],s;for(;(s=f8.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(z3(a,e,1)||z3(a,t-1,1)){f8.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,a=r+t[0].length;if(r>l){let t={type:`text`,value:i.slice(l,r)},a=H3(n,e,l,r);a&&(t.position=a),c.push(t)}let o={type:`inlineMath`,value:t[1]},s=H3(n,e,r,a);s&&(o.position=s),c.push(o),l=a}if(l<i.length){let t={type:`text`,value:i.slice(l)},r=H3(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[S,t+c.length]})}}var Kie=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]),qie=`<br />`;function Jie(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function Yie(e){e.data??={},e.data.sourceRaw=qie,e.data.sourceStyle=`html`}function p8(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var m8=/[ \t]+$/,h8=/^[ \t]*$/;function Xie(e){return e.some(e=>!(p8(e)&&h8.test(e.value)))}function g8(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(Jie(n)){Yie(n);break}if(n&&Kie.has(n.type)&&`children`in n){let t=n.children;if(g8(t,!0),t.length===0){e.pop();continue}}if(!t&&p8(n)&&m8.test(n.value)){let t=n.value.replace(m8,``);if(t.length>0){n.value=t;continue}if(Xie(e.slice(0,-1))){e.pop();continue}if(e.every(e=>p8(e)&&h8.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var Zie=new Set([`paragraph`,`heading`,`tableCell`]);function Qie(e){let t=e=>{if(Zie.has(e.type)&&`children`in e&&g8(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var _8={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function $ie(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===_8)||e.toMarkdownExtensions.push(_8)}var eae=new Set([`u`,`ins`]);function tae(){return e=>{Te(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name===null||!eae.has(e.name)||(e.attributes??[]).length>0)return;let r={type:`underline`,children:e.children??[],data:{sourceForm:e.name===`ins`?`ins`:`u`}};return e.position&&(r.position=e.position),n.children.splice(t,1,r),t+1})}}var v8=/(?<!\uE102)<br[ \t]*\/?>/g,nae=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function rae(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;v8.lastIndex=0;let a=[],o=0;for(;;){let n=v8.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=H3(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=H3(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=H3(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function y8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;Te(e,e=>{if(nae.has(e.type))return S;let t=e;Array.isArray(t.children)&&rae(e,n)})}}var b8=33,x8=91,S8=93,C8=124,w8=35,iae={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===x8?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===x8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===w8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===C8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===C8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===S8?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===S8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},aae={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===b8?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===x8?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===x8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===w8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===C8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===C8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===x8?n(t):t===S8?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===S8?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===S8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function oae(){return{text:{[x8]:iae,[b8]:aae}}}function sae(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function cae(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function T8(e){return e.stack[e.stack.length-1]}function lae(e){let t=T8(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function uae(e){let t=T8(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function dae(e){let t=T8(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function E8(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function fae(e){E8(T8(this)),this.exit(e)}function pae(e){E8(T8(this)),this.exit(e)}var D8={enter:{wikiLink:sae,wikiLinkEmbed:cae},exit:{wikiLinkTarget:lae,wikiLinkAnchor:uae,wikiLinkAlias:dae,wikiLink:fae,wikiLinkEmbed:pae}};function O8(e,t){return typeof e==`string`&&e.trim()===t?e:t}var k8={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${O8(t.data?.sourceTarget,n)}`;return r&&(a+=`#${O8(t.data?.sourceAnchor,r)}`),i&&(a+=`|${O8(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},A8=oae();function j8(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===A8)||e.micromarkExtensions.push(A8),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===D8)||e.fromMarkdownExtensions.push(D8),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===k8)||e.toMarkdownExtensions.push(k8)}function mae(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var hae=[{name:`remark-parse`,plugin:re},{name:`remark-mdx-agnostic`,plugin:d8},{name:`remark-gfm`,plugin:pe},{name:`remark-math`,plugin:$P,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:j8},{name:`remark-github-alerts`,plugin:VP,options:P3},{name:`callout-transformer`,plugin:M3},{name:`restore-from-mdx`,plugin:a3},{name:`void-br-promoter`,plugin:y8},{name:`restore-entity-refs`,plugin:g3},{name:`restore-backslash-escapes`,plugin:b3},{name:`details-accordion-promoter`,plugin:_6},{name:`div-align-promoter`,plugin:E6},{name:`image-promoter`,plugin:H6},{name:`indented-code-promoter`,plugin:sie},{name:`math-promoter`,plugin:hie},{name:`single-dollar-math-promoter`,plugin:Gie},{name:`highlight-promoter`,plugin:V6},{name:`underline-promoter`,plugin:tae},{name:`mermaid-promoter`,plugin:kie},{name:`comment-promoter`,plugin:G3},{name:`merged-post-parse-walker`,plugin:Die},{name:`empty-task-item-unmint`,plugin:N6},{name:`link-reference-destination`,plugin:mie},{name:`non-rendering-context-demote`,plugin:zie},{name:`ensure-non-empty-doc`,plugin:()=>mae}];function gae(e){let t=xe();for(let e of hae)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(fP,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function _ae(e){let t=xe().use(LP,[`yaml`]).use(pe,{tablePipeAlign:!1}).use($P,{singleDollarTextMath:!1}).use(d8).use(j8).use($ie).use($N,{bullet:`-`,fences:!0,rule:`-`,join:[Wie],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function M8(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var N8=/^\n+$/,P8=/^\n{2,}$/;function F8(e,t,n){let r,i,a=e.children;if(a.length>0){let e=a[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);N8.test(n)&&(r=n)}let n=a[a.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);P8.test(e)&&(i=e)}}if(!n&&r===void 0&&i===void 0)return;let o={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i}};return e.data??={},e.data.sourceDocBoundary=o,o}function vae(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&N8.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&P8.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function yae(e,t){let{source:n,hadBom:r}=M8(e),i=o6(n),a=new u(p3(r3(y3(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);J6(s,i);let c=F8(s,i,r),l=c?p1(s,c):void 0,d=t.stringify(s);return l?d.type.create({...d.attrs,sourceDocBoundary:l},d.content,d.marks):d}function bae(e,t){return I8(e,t,!1)}function xae(e,t){return I8(e,t,!0)}function I8(e,t,n){let{source:r,hadBom:i}=M8(e),a=o6(r),o=new u(p3(r3(y3(a)))),s=t.parse(o);o.value=a;let c=t.runSync(s,o);n&&J6(c,a);let l=F8(c,a,i);return n&&l&&p1(c,l),c}function Sae(e,t,n){let r=mP(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});j6(r),Qie(r),Hie(r);let i=vae(e.attrs?.sourceDocBoundary),a=String(t.stringify(r));return i?.leading&&(a=i.leading+a),i?.trailing&&(a=a.replace(/\n+$/,``)+i.trailing),i?.bom&&(a=`\uFEFF${a}`),a}function Cae(){return!1}function wae(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function Tae(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function L8(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!fZ(e))return e;let n=Tae(wae(t),e);return n===``||n===`..`||n.startsWith(`../`)?(Cae()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var Eae=Object.assign(Hae,{peek:()=>`$`}),Dae=Object.assign(Uae,{peek:()=>`~`}),Oae=(()=>{for(let e of u8.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),kae=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function Aae(e){let t=e;return t.type===`rawMdxFallback`?{type:`mdxJsxFlowElement`,name:null,attributes:[],children:[],data:{sourceRaw:t.value??``}}:e}var jae={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&HZ(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=U8(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=U8(n,t.slice(o),{...r,before:r.before+a})),a}return U8(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=q8(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=q8(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:V8(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(B8(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(V8(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
542
542
|
`:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(V8(d)),e()}if(e.title){let t=i===`multiline`?`
|
|
543
543
|
`:` `;l+=s.move(B8(e.title,a,t))}return o(),l},thematicBreak(e){return e.data?.sourceRaw??`---`},break(e,t,n){let r=e.data?.sourceRaw;return typeof r==`string`&&r.length>0?r:n.stack.includes(`tableCell`)||n.stack.includes(`okAtxHeading`)?`<br />`:e.data?.sourceStyle===`backslash`?`\\
|
|
544
544
|
`:`
|
|
@@ -552,24 +552,24 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
552
552
|
`):m},inlineCode(e,t,n){let r=e.value??``,i=e.data?.sourceFenceChar===`~`?`~`:"`",a=typeof e.data?.sourceFenceLength==`number`&&e.data.sourceFenceLength>0?e.data.sourceFenceLength:1,o=i==="`"?"`":`~`,s=a;for(;RegExp(`(^|[^${o}])${o.repeat(s)}([^${o}]|$)`).test(r);)s+=1;let c=i.repeat(s);/[^ \r\n]/.test(r)&&(e.data?.sourcePadded===!0||/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||r.startsWith(i)||r.endsWith(i))&&(r=` ${r} `);let l=`${c}${r}${c}`;return n.stack.includes(`tableCell`)?l.replace(/\|/g,`\\$&`):l},inlineMath:Eae,delete:Dae,heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
|
|
553
553
|
`,after:`
|
|
554
554
|
`}),i=e.data?.sourceUnderlineLength,o=typeof i==`number`&&i>=1?i:Math.max(t.length,3);return`${t}\n${(a===1?`=`:`-`).repeat(o)}`}let o=e.data?.sourceLeadingIndent,s=typeof o==`number`&&o>=1&&o<=3?` `.repeat(o):``,c=e.data?.sourceInteriorSpacing,l=typeof c==`number`&&c>=2?` `.repeat(c):` `,u=`#`.repeat(a),d=n.enter(`okAtxHeading`),f=n.containerPhrasing(e,{...r,before:`${u} `,after:`
|
|
555
|
-
`});d();let p=e.data?.sourceTrailingHashes;if(typeof p==`number`&&p>0){let e=`#`.repeat(p);return f?`${s}${u}${l}${f} ${e}`:`${s}${u} ${e}`}return f?`${s}${u}${l}${f}`:`${s}${u}`},list(e,t,n,r){let i=n.options.bullet||`-`,a=!!e.ordered,o=n.bulletCurrent,s=n.bulletLastUsed;if(!a){let t=e.data?.bulletMarker;(t===`-`||t===`*`||t===`+`)&&(n.bulletCurrent=t)}let c=e.children||[],l=[],u=a?e.data?.listMarkerDelimiter??`.`:null,d=e.start??1;for(let t=0;t<c.length;t++){let o=c[t],s=o.data?.sourceOrdinal,f=typeof s==`number`&&s>=0?s:d+t,p=a?`${f}${u}`:e.data?.bulletMarker??i,m=o.data?.sourceMarkerSpacing,h=typeof m==`number`&&m>=2&&m<=4?m:1,g=` `.repeat(h),_=p;o.checked===!0?_+=`${g}[${o.data?.sourceCheckboxChar===`X`?`X`:`x`}]`:o.checked===!1&&(_+=`${g}[ ]`);let v=o.data?.sourceContinuationIndent,y=p.length+h,b=typeof v==`number`&&v>=y&&v<=y+3?v:y,x=` `.repeat(b),S=o.checked===null||o.checked===void 0?g:` `,C=o.children??[],w=C[0]?.type===`list`,
|
|
555
|
+
`});d();let p=e.data?.sourceTrailingHashes;if(typeof p==`number`&&p>0){let e=`#`.repeat(p);return f?`${s}${u}${l}${f} ${e}`:`${s}${u} ${e}`}return f?`${s}${u}${l}${f}`:`${s}${u}`},list(e,t,n,r){let i=n.options.bullet||`-`,a=!!e.ordered,o=n.bulletCurrent,s=n.bulletLastUsed;if(!a){let t=e.data?.bulletMarker;(t===`-`||t===`*`||t===`+`)&&(n.bulletCurrent=t)}let c=e.children||[],l=[],u=a?e.data?.listMarkerDelimiter??`.`:null,d=e.start??1;for(let t=0;t<c.length;t++){let o=c[t],s=o.data?.sourceOrdinal,f=typeof s==`number`&&s>=0?s:d+t,p=a?`${f}${u}`:e.data?.bulletMarker??i,m=o.data?.sourceMarkerSpacing,h=typeof m==`number`&&m>=2&&m<=4?m:1,g=` `.repeat(h),_=p;o.checked===!0?_+=`${g}[${o.data?.sourceCheckboxChar===`X`?`X`:`x`}]`:o.checked===!1&&(_+=`${g}[ ]`);let v=o.data?.sourceContinuationIndent,y=p.length+h,b=typeof v==`number`&&v>=y&&v<=y+3?v:y,x=` `.repeat(b),S=o.checked===null||o.checked===void 0?g:` `,C=o.children??[],w=C[0]?.type===`list`,ee;if(w){let e=o.checked!==null&&o.checked!==void 0,t=n.containerFlow({...o,children:[C[0]]},r),i=C.slice(1),a=i.length?n.containerFlow({...o,children:i},r):``,s=t.split(`
|
|
556
556
|
`).map((t,n)=>n===0?e?`${x}${t}`:`${_}${S}${t}`:t&&`${x}${t}`).join(`
|
|
557
557
|
`),c=[];if(e?c.push(_,``,s):c.push(s),a){let e=a.split(`
|
|
558
558
|
`).map(e=>e&&`${x}${e}`).join(`
|
|
559
|
-
`);c.push(``,e)}
|
|
560
|
-
`)}else
|
|
559
|
+
`);c.push(``,e)}ee=c.join(`
|
|
560
|
+
`)}else ee=n.containerFlow(o,r).split(`
|
|
561
561
|
`).map((e,t)=>t===0?`${_}${S}${e}`:e&&`${x}${e}`).join(`
|
|
562
|
-
`);l.push(
|
|
562
|
+
`);l.push(ee)}n.bulletCurrent=o,n.bulletLastUsed=s;let f=e.spread?`
|
|
563
563
|
|
|
564
564
|
`:`
|
|
565
565
|
`;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);if(f===0)return console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:s.length})),``;let 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))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
|
|
566
566
|
`)},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=R8(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:Oae({...i,attributes:(i.attributes??[]).map(Mae),children:(i.children??[]).map(Aae)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=q8(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},underline(e,t,n,r){let i=e.data?.sourceForm===`ins`?`<ins>`:`<u>`,a=e.data?.sourceForm===`ins`?`</ins>`:`</u>`,o=n.createTracker(r),s=n.enter(`underline`),c=o.move(i);return c+=n.containerPhrasing(e,{before:c,after:a,...o.current()}),c+=o.move(a),s(),c},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=R8(e.attributes??[]),i=(e.children??[]).map(e=>e&&typeof e==`object`&&`value`in e?String(e.value??``):``).join(``);return i?r?`<${n} ${r}>${i}</${n}>`:`<${n}>${i}</${n}>`: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)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!kae.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function R8(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`){n.value.includes(`"`)?t.push(`${e}={${z8(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function z8(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function Mae(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:z8(e.value)}}:e}function B8(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function V8(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 Nae(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>Pae(t)?e:`\\${e}`)}function Pae(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32||t===160}var H8=``,Fae=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Iae(e){return e.replace(Fae,e=>_Y(e)?H8+e.slice(1):e)}function Lae(e){return/[\r\n][\t ]*$/.test(e)}function U8(e,t,n){let{matched:r}=e3(t,{escapeAware:!1});if(r.length===0)return W8(e,t,n);let i=``,a=0,o=r=>{r>a&&(i+=W8(e,t.slice(a,r),{...n,before:n.before+i,after:t.slice(r,r+1)||n.after})),a=r};for(let e of r)o(e.start),!Lae(n.before+i)&&(i+=t.slice(e.start,e.end),a=e.end);return o(t.length),i}function W8(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===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
|
|
567
|
-
]|$)`};return delete t._compiled,t});let i;try{i=e.safe(Iae(t),n)}finally{e.unsafe=r}return i=i.replaceAll(H8,`\\&`),Nae(Vae(i,n))}var G8=1,Rae=2;function K8(e){if(Number.isNaN(e))return`ws`;let t=
|
|
568
|
-
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function Vae(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&Bae(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=zae(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function q8(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);J8(i.charCodeAt(i.length-1),s,r)&&(o=Y8(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return J8(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+Y8(c)),o}function J8(e,t,n){return!(f(t)!==G8||n===`_`&&f(e)===void 0)}function Y8(e){return`&#x${e.toString(16).toUpperCase()};`}function Hae(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!Wae(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function Uae(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=q8(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function Wae(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function X8(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 Gae=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=Cw(e.extensions),this.handlers=Xae(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?J0({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=Zae(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=gae({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=_ae({toMarkdownHandlers:jae})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return yae(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?bae(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?xae(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?p4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=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})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return Sae(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},Z8=H2();function Q8(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 Kae(e){let t=!1;return e.descendants(e=>t?!1:e.type.name===`jsxInline`?(e.attrs.sourceDirty&&(t=!0),!1):e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function qae(e,t){return e.attrs.sourceDirty||Kae(e)?!0:t?t.isDiverged(e.toJSON()):!1}function Jae(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 $8(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function e5(e,t){if(e.length===0)return $8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return $8({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:[e5(n.children,t)]}}return $8({type:`inlineCode`,value:t5(e)},t)}function t5(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=t5(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Yae=Ru;function Xae(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=lP(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=lP(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,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=L8(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)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);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=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&bY(t.raw)!==null&&_Y(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=bY(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),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,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=uP(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=uP(r.highlight)),r.underline&&(i.underline=uP(r.underline,e=>({sourceForm:e.data?.sourceForm===`ins`?`ins`:`u`}))),r.comment&&(i.comment=uP(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=lP(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=uP(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=uP(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=lP(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,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),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`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},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`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=lP(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=lP(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),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:n.data?.resolvedUrl??``,title:n.data?.resolvedTitle??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=Z8.getOrWildcard(o),c=Q8(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=L8(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})}let i=t.name??``,o=i?Z8.get(i):void 0;if(o&&n.jsxInline){let e=Q8(t.attributes,o.props),a=r(t.data)??``,s=(t.children??[]).map(e=>e&&typeof e==`object`&&`value`in e?String(e.value??``):``).join(``);return s&&(e.children=s),n.jsxInline.createAndFill({componentName:i,attributes:t.attributes,sourceRaw:a,sourceDirty:!1,props: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)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??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=iQ(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&&Yae.has(l)&&n.jsxComponent&&Z8.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&&zu.has(l)&&n.jsxComponent&&Z8.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&&Vu.has(l)&&n.jsxComponent&&Z8.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&&Hu.has(l)&&n.jsxComponent&&Z8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:X8(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(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])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;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},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=lP(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},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}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function Zae(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=hP(`paragraph`)),i.blockquote&&(n.blockquote=hP(`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}:{}})),i.heading&&(n.heading=hP(`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,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.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,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=hP(`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}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&Jae(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.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&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=hP(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:u0(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.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`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[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(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!qae(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:Z8.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:Z8,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.`)}})}),i.rawMdxFallback&&(n.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}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.componentName||``;if(t&&e.attrs.sourceDirty)return $0(t,e,Z8.get(t)?.props);let n=e.attrs.attributes,r=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:t||null,attributes:Array.isArray(n)?n:[],children:[],data:{sourceRaw:String(r)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.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,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.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}]}}),a.emphasis&&(r.emphasis=gP(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=gP(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return e5(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=gP(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=gP(`mark`)),a.underline&&(r.underline=gP(`underline`,e=>({data:{sourceForm:e.attrs.sourceForm===`ins`?`ins`:`u`}}))),a.comment&&(r.comment=gP(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=hP(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=hP(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.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??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}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}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},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}),a.sourceLiteral&&(r.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 HZ(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var n5={default:!0,MD013:!1};function r5(e){return e??n5}function i5(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of DX)if(n.endsWith(e))return t.slice(0,-e.length);return t}function a5(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,iV.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();DX.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=i5(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}function Qae(e,t){if(t.length===0)return[];let n=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),r=t.map(i5).filter(e=>e!==``),i=[];for(let e of n){let t=e.startsWith(`!`)?e.slice(1):e;if(t.length===0)continue;let n;try{n=(0,iV.default)(t,{dot:!0,strictBrackets:!0})}catch{continue}r.some(e=>n(e))||i.push(e)}return i}var o5=/[*?[\]{}()+@!|]/;function $ae(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||o5.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function s5(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,iV.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!o5.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!o5.test(r)&&!o5.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!o5.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!o5.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!o5.test(t))return{kind:`name-anywhere`,name:t}}return o5.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function eoe(e){let t=s5(e);if(t.kind!==`pattern`)return[t];let n=$ae(e);if(n!==null){let e=n.map(s5);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function toe(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...eoe(i))}return{includes:n,excludes:r}}function c5(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!a5(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var l5={"draft-06":`http://json-schema.org/draft-06/schema#`,"draft-07":`http://json-schema.org/draft-07/schema#`,"2019-09":`https://json-schema.org/draft/2019-09/schema`,"2020-12":`https://json-schema.org/draft/2020-12/schema`},noe=Object.keys(l5),roe=`draft-07`,ioe=new Map(noe.map(e=>[u5(l5[e]),e]));function u5(e){return e.replace(/^https?:\/\//,``).replace(/#$/,``)}function aoe(e){let t=e.$schema;return t===void 0?roe:typeof t==`string`?ioe.get(u5(t))??null:null}var d5=new Map;function ooe(e){throw Error(`Unhandled FrontmatterSchemaDialect: ${JSON.stringify(e)}`)}function soe(e){let t=d5.get(e);if(t)return t;let n={allErrors:!0,strict:!1},r;switch(e){case`2020-12`:r=new nV.default(n);break;case`2019-09`:r=new tV.default(n);break;case`draft-06`:case`draft-07`:r=new eV.default(n);break;default:return ooe(e)}return(0,rV.default)(r),d5.set(e,r),r}function coe(e){let{$schema:t,...n}=e;return n}function loe(e,t){let n=soe(e),r=t.$id;return typeof r==`string`&&r!==``&&n.removeSchema(r),n.compile(coe(t))}var f5=new Map,uoe=256;function doe(e){let t=JSON.stringify(e),n=f5.get(t);if(n!==void 0)return n;let r=null,i=aoe(e);if(i!==null)try{r=loe(i,e)}catch{r=null}return f5.size>=uoe&&f5.clear(),f5.set(t,r),r}function foe(e){let t=new Map;if(!rm.test(e))return{data:{},keyLines:t};let{frontmatter:n}=am(e),r=sm(n);if(r.trim()===``)return{data:{},keyLines:t};let i=fu(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(qo(i.contents))for(let e of i.contents.items){let n=e.key;if(!Yo(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function poe(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function moe(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function hoe(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function p5(e,t,n){if(t.length===0)return[];let r=n?.source??`frontmatter`,{data:i,keyLines:a}=foe(e),o=e.split(`
|
|
567
|
+
]|$)`};return delete t._compiled,t});let i;try{i=e.safe(Iae(t),n)}finally{e.unsafe=r}return i=i.replaceAll(H8,`\\&`),Nae(Vae(i,n))}var G8=1,Rae=2;function K8(e){if(Number.isNaN(e))return`ws`;let t=_(e);return t===G8?`ws`:t===Rae?`punct`:`other`}function zae(e,t,n){let r=K8(t),i=K8(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function Bae(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
|
|
568
|
+
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function Vae(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&Bae(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=zae(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function q8(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);J8(i.charCodeAt(i.length-1),s,r)&&(o=Y8(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return J8(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+Y8(c)),o}function J8(e,t,n){return!(_(t)!==G8||n===`_`&&_(e)===void 0)}function Y8(e){return`&#x${e.toString(16).toUpperCase()};`}function Hae(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!Wae(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function Uae(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=q8(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function Wae(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function X8(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 Gae=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=Cw(e.extensions),this.handlers=Xae(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?J0({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=Zae(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=gae({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=_ae({toMarkdownHandlers:jae})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return yae(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?bae(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?xae(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?p4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=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})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return Sae(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},Z8=H2();function Q8(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 Kae(e){let t=!1;return e.descendants(e=>t?!1:e.type.name===`jsxInline`?(e.attrs.sourceDirty&&(t=!0),!1):e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function qae(e,t){return e.attrs.sourceDirty||Kae(e)?!0:t?t.isDiverged(e.toJSON()):!1}function Jae(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 $8(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function e5(e,t){if(e.length===0)return $8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return $8({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:[e5(n.children,t)]}}return $8({type:`inlineCode`,value:t5(e)},t)}function t5(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=t5(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Yae=Ru;function Xae(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=lP(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=lP(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,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=L8(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)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);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=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&bY(t.raw)!==null&&_Y(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=bY(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),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,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=uP(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=uP(r.highlight)),r.underline&&(i.underline=uP(r.underline,e=>({sourceForm:e.data?.sourceForm===`ins`?`ins`:`u`}))),r.comment&&(i.comment=uP(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=lP(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=uP(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=uP(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=lP(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,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),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`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},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`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=lP(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=lP(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),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:n.data?.resolvedUrl??``,title:n.data?.resolvedTitle??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=Z8.getOrWildcard(o),c=Q8(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=L8(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})}let i=t.name??``,o=i?Z8.get(i):void 0;if(o&&n.jsxInline){let e=Q8(t.attributes,o.props),a=r(t.data)??``,s=(t.children??[]).map(e=>e&&typeof e==`object`&&`value`in e?String(e.value??``):``).join(``);return s&&(e.children=s),n.jsxInline.createAndFill({componentName:i,attributes:t.attributes,sourceRaw:a,sourceDirty:!1,props: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)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??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=iQ(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&&Yae.has(l)&&n.jsxComponent&&Z8.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&&zu.has(l)&&n.jsxComponent&&Z8.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&&Vu.has(l)&&n.jsxComponent&&Z8.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&&Hu.has(l)&&n.jsxComponent&&Z8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:X8(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(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])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;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},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=lP(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},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}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function Zae(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=hP(`paragraph`)),i.blockquote&&(n.blockquote=hP(`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}:{}})),i.heading&&(n.heading=hP(`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,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.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,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=hP(`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}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&Jae(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.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&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=hP(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:u0(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.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`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[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(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!qae(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:Z8.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:Z8,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.`)}})}),i.rawMdxFallback&&(n.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}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.componentName||``;if(t&&e.attrs.sourceDirty)return $0(t,e,Z8.get(t)?.props);let n=e.attrs.attributes,r=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:t||null,attributes:Array.isArray(n)?n:[],children:[],data:{sourceRaw:String(r)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.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,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.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}]}}),a.emphasis&&(r.emphasis=gP(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=gP(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return e5(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=gP(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=gP(`mark`)),a.underline&&(r.underline=gP(`underline`,e=>({data:{sourceForm:e.attrs.sourceForm===`ins`?`ins`:`u`}}))),a.comment&&(r.comment=gP(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=hP(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=hP(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.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??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}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}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},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}),a.sourceLiteral&&(r.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 HZ(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var n5={default:!0,MD013:!1};function r5(e){return e??n5}function i5(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of DX)if(n.endsWith(e))return t.slice(0,-e.length);return t}function a5(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,iV.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();DX.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=i5(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}function Qae(e,t){if(t.length===0)return[];let n=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),r=t.map(i5).filter(e=>e!==``),i=[];for(let e of n){let t=e.startsWith(`!`)?e.slice(1):e;if(t.length===0)continue;let n;try{n=(0,iV.default)(t,{dot:!0,strictBrackets:!0})}catch{continue}r.some(e=>n(e))||i.push(e)}return i}var o5=/[*?[\]{}()+@!|]/;function $ae(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||o5.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function s5(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,iV.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!o5.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!o5.test(r)&&!o5.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!o5.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!o5.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!o5.test(t))return{kind:`name-anywhere`,name:t}}return o5.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function eoe(e){let t=s5(e);if(t.kind!==`pattern`)return[t];let n=$ae(e);if(n!==null){let e=n.map(s5);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function toe(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...eoe(i))}return{includes:n,excludes:r}}function c5(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!a5(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var l5={"draft-06":`http://json-schema.org/draft-06/schema#`,"draft-07":`http://json-schema.org/draft-07/schema#`,"2019-09":`https://json-schema.org/draft/2019-09/schema`,"2020-12":`https://json-schema.org/draft/2020-12/schema`},noe=Object.keys(l5),roe=`draft-07`,ioe=new Map(noe.map(e=>[u5(l5[e]),e]));function u5(e){return e.replace(/^https?:\/\//,``).replace(/#$/,``)}function aoe(e){let t=e.$schema;return t===void 0?roe:typeof t==`string`?ioe.get(u5(t))??null:null}var d5=new Map;function ooe(e){throw Error(`Unhandled FrontmatterSchemaDialect: ${JSON.stringify(e)}`)}function soe(e){let t=d5.get(e);if(t)return t;let n={allErrors:!0,strict:!1},r;switch(e){case`2020-12`:r=new nV.default(n);break;case`2019-09`:r=new tV.default(n);break;case`draft-06`:case`draft-07`:r=new eV.default(n);break;default:return ooe(e)}return(0,rV.default)(r),d5.set(e,r),r}function coe(e){let{$schema:t,...n}=e;return n}function loe(e,t){let n=soe(e),r=t.$id;return typeof r==`string`&&r!==``&&n.removeSchema(r),n.compile(coe(t))}var f5=new Map,uoe=256;function doe(e){let t=JSON.stringify(e),n=f5.get(t);if(n!==void 0)return n;let r=null,i=aoe(e);if(i!==null)try{r=loe(i,e)}catch{r=null}return f5.size>=uoe&&f5.clear(),f5.set(t,r),r}function foe(e){let t=new Map;if(!rm.test(e))return{data:{},keyLines:t};let{frontmatter:n}=am(e),r=sm(n);if(r.trim()===``)return{data:{},keyLines:t};let i=fu(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(qo(i.contents))for(let e of i.contents.items){let n=e.key;if(!Yo(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function poe(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function moe(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function hoe(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function p5(e,t,n){if(t.length===0)return[];let r=n?.source??`frontmatter`,{data:i,keyLines:a}=foe(e),o=e.split(`
|
|
569
569
|
`),s=e=>({start:{line:e,character:0},end:{line:e,character:o[e]?.length??0}}),c=[];for(let{schema:e,ruleId:n}of t){let t=doe(e);if(t&&!t(i))for(let e of t.errors??[]){let t=e.keyword;if(t===`if`)continue;let o=0,l,u=`invalid`,d;if(t===`maxProperties`&&e.instancePath===``)l=`This document must not have frontmatter`;else if(t===`required`&&e.instancePath===``){let t=String(e.params.missingProperty??``);l=`Frontmatter property "${t}" is required`,u=`missing`,t!==``&&(d=t)}else if(e.instancePath===``)l=`Frontmatter ${e.message??`violates "${t}"`}`;else{let n=moe(e.instancePath);n!==null&&(o=a.get(n)??0);let r=hoe(e.instancePath);if(t===`enum`){let t=e.params.allowedValues??[],a=n!==null&&r===n?i[n]:void 0;l=`Frontmatter property "${r}" must be one of: ${t.map(String).join(`, `)}${poe(a)}`}else l=`Frontmatter property "${r}" ${e.message??`violates "${t}"`}`}c.push({range:s(o),severity:`warning`,source:r,code:n??t,message:l,frontmatterScope:u,...d===void 0?{}:{frontmatterProperty:d}})}}return c}var m5=`doc`;function goe(e,t){return ZW(e,JW({strings:{[m5]:e},config:t})[m5]??[])}function _oe(e,t){let n=JW({strings:{[m5]:e},config:t})[m5]??[],r=e.split(`
|
|
570
|
-
`),i=voe(t);return n.map(e=>boe(e,r,yoe(e,i)))}function voe(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function yoe(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function boe(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[xoe(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function xoe(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var h5=[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`,`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`,`project-no-mdx`];function g5(e,t){return e?.[t]!==!1}var Soe=[{id:`structure`,ids:[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`]},{id:`frontmatter`,ids:[`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`]},{id:`project`,ids:[`project-no-mdx`]}];function Coe(e){throw Error(`Unhandled OkfRuleId variant: ${JSON.stringify(e)}`)}function woe(e){throw Error(`Unhandled OkfRuleGroupId variant: ${JSON.stringify(e)}`)}var Toe=`.ok/okf`;function Eoe(e){return`${e.replace(/^frontmatter-/,``)}.schema.json`}function _5(e){return`${Toe}/${Eoe(e)}`}var Doe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — required frontmatter`,description:"The OKF v0.2 conformance floor. A bundle is conformant when every non-reserved .md file contains a parseable YAML frontmatter block whose `type` is non-empty. This schema is the whole of that floor: a concept carrying only `type` is fully conformant. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#11-conformance",type:`object`,required:[`type`],properties:{type:{type:`string`,pattern:`\\S`,description:"REQUIRED, and the only always-required key in OKF. A short string identifying the kind of concept; consumers use it for routing, filtering, and presentation. Type values are not registered centrally — pick something descriptive and self-explanatory (`BigQuery Table`, `BigQuery Dataset`, `API Endpoint`, `Metric`, `Playbook`, `Reference`, `Attested Computation`). Consumers must tolerate unknown types, typically by treating them as generic concepts. The `\\S` pattern is what makes §11 rule 2 mean what it says, and it replaces a `minLength` rather than joining one: a length check alone accepts a whitespace-only value that no consumer can route on, and having both would report one mistake twice. OKF v0.2 §4.1, §11."}}},Ooe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — recommended frontmatter`,description:"Shapes for the OKF v0.2 recommended keys. Every key here is optional, and nothing is constrained beyond the shape OKF states: declaring a key pins its YAML type when present (so `tags` written as a comma-separated string warns) and advertises it to agents at read time. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#41-frontmatter",type:`object`,properties:{title:{type:`string`,description:`Human-readable display name. If omitted, consumers MAY derive a title from the filename. OKF v0.2 §4.1.`},description:{type:`string`,description:"A single sentence summarizing the concept. Used by `index.md` generators, search snippets, and previews. OKF v0.2 §4.1."},resource:{type:`string`,format:`uri-reference`,description:"A URI that uniquely identifies the underlying asset the concept describes. Absent for concepts that describe abstract ideas rather than physical resources. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or an ordinary relative path — hence `uri-reference`, not `uri`, which would reject `/tables/customers.md`. OKF v0.2 §4.1, §6.2."},tags:{type:`array`,items:{type:`string`},description:`A YAML list of short strings for cross-cutting categorization. Tags stay a first-class concept through this field; OKF specifies no separate per-tag file format, so a consumer that wants a tag-browsing view synthesizes one by scanning frontmatter. OKF v0.2 §3.1, §4.1.`},timestamp:{description:"LEGACY (OKF v0.1), superseded by `generated.at` in v0.2 — one of the two deliberate breaking changes. Consumers MAY fall back to it when `generated` is absent; new documents SHOULD write `generated: { by, at }` instead. Documented here so agents are told what it is and what replaced it, but deliberately left unconstrained: v0.2 does not define it as a producer field, so validating its shape would be a rule OKF no longer has. OKF v0.2 §5.2, §13.1."}}},koe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — provenance, trust, and lifecycle frontmatter`,description:'The optional OKF v0.2 families that make "where did this come from", "how much should I trust it", and "is it still current" answerable from frontmatter alone. Every key is optional, and absence carries meaning rather than being an error: a concept with no `verified` is unverified, and a consumer must not reject it. Only `sources[].resource` and `generated.by` are required-when-their-parent-is-present, because those are the two fields OKF marks REQUIRED in this family; every other field is described but not mandated, so nothing else is enforced. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#5-provenance-trust-and-lifecycle',type:`object`,properties:{sources:{type:`array`,description:"The materials this concept derives from, external or internal to the bundle. Lineage is expressed through links rather than a dedicated field: when an entry's `resource` points at another OKF concept, the derivation edge already exists in the bundle graph, so a consumer may recurse into that source's own `sources`. OKF v0.2 §5.1.",items:{type:`object`,required:[`resource`],properties:{resource:{type:`string`,description:"REQUIRED within an entry. Either a concrete artifact a consumer can follow (an absolute URL, a bundle-relative path, or a path into a `references/` subdirectory) or a population or scope descriptor it cannot, for example `all queries in BigQuery project X`. Deliberately NOT format-constrained: a scope descriptor is prose, so a `uri-reference` check here would warn on conformant documents. OKF v0.2 §5.1, §6.2, §6.3."},id:{type:`string`,description:"Optional. A stable key used to attribute individual claims: a markdown footnote whose label is this id (`[^ga4-schema]`) attributes the claim it follows. SHOULD be present when the body cites the source. Keyed rather than positional because agents constantly rewrite these documents — a positional index misattributes silently the moment the list is reordered. OKF v0.2 §5.1."},title:{type:`string`,description:`Optional. Human-readable label for the source. OKF v0.2 §5.1.`},author:{type:`string`,description:"Optional credibility signal — an authority signal: who or what produced the source. OKF describes this as following the actor convention (§7), but its own examples use a `team:<id>` prefix that the three §7 forms do not cover, so no pattern is enforced. OKF v0.2 §5.1, §7."},usage_count:{type:`integer`,description:"Optional credibility signal — an adoption and liveness signal: how often `resource` was exercised (dashboard views, query executions, page reads) over `usage_window`. For a single artifact it is that artifact's own exercise count; for a scope descriptor it is the number of exercises within the scope that touch the concept. Coarse by design: comparable at the alive-versus-dead and order-of-magnitude level and against a source's own history, but not a precise cross-kind ranking. Read as liveness and trend, not as a score. OKF v0.2 §5.1."},last_modified:{type:`string`,format:`date`,description:"Optional credibility signal — a recency signal: when the source itself last changed, as `YYYY-MM-DD`. Distinct from `generated.at`, which records when the concept was written. OKF v0.2 §5.1."},usage_window:{type:`object`,description:"Optional per-entry override of the `usage_window` written as a sibling of `sources`. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date`,description:"Start of the window framing this entry's `usage_count`, as `YYYY-MM-DD`. OKF v0.2 §5.1."},to:{type:`string`,format:`date`,description:"End of the window framing this entry's `usage_count`, as `YYYY-MM-DD`. OKF v0.2 §5.1."}}}}}},usage_window:{type:`object`,description:"Written once as a sibling of `sources`, this frames every `usage_count` in the list with a `{ from, to }` date range. A single entry may carry its own `usage_window` to override it. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date`,description:"Start of the shared usage window, as `YYYY-MM-DD`. OKF v0.2 §5.1."},to:{type:`string`,format:`date`,description:"End of the shared usage window, as `YYYY-MM-DD`. OKF v0.2 §5.1."}}},generated:{type:`object`,required:[`by`],description:"How the current content was produced. Kept distinct from `verified` because who wrote a concept need not be who confirmed it. OKF v0.2 §5.2.",properties:{by:{type:`string`,description:"REQUIRED within `generated`. An actor in the OKF convention: `<producer>/<version>` for agents and tools (`reference_agent/gemini-2.5-pro`), `human:<id>` for a person (`human:ahormati`), or `process:<id>` for an automated process (`process:finance-nightly`). Consumers that classify trust key off the `human:` prefix, so producers MUST use it for hand-authored or human-confirmed content — a rule about which form to pick for which content, which frontmatter alone cannot check, so the three forms are documented here rather than enforced by a pattern. OKF v0.2 §5.2, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime marking the content's last meaningful change. Consumers use it to tell a recent edit from a stale fact. Supersedes v0.1's top-level `timestamp`. OKF v0.2 §5.2, §13.1."}}},verified:{description:'Who or what has confirmed the content against its sources or `resource` — a list of verification events. Multiple entries capture independent checks, for example a human sign-off plus a nightly process; "how recently" is the latest `at`. Independent of `generated.at`: content can change without re-confirmation, and facts can be re-confirmed without regeneration. A single verifier MAY be written as one bare `{ by, at }` mapping without the list dash, and consumers MUST treat that as a one-element list — hence the two accepted shapes here. Absence means unverified, which is a valid state, never a rejection. OKF v0.2 §5.2, §5.3, §11.',anyOf:[{type:`object`,description:`The bare single-verifier mapping form. OKF v0.2 §5.2.`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:`ISO 8601 datetime of the verification event. OKF v0.2 §5.2.`}}},{type:`array`,description:`The list form: one entry per independent verification event. OKF v0.2 §5.2.`,items:{type:`object`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:`ISO 8601 datetime of the verification event. OKF v0.2 §5.2.`}}}}]},status:{enum:[`draft`,`stable`,`deprecated`],description:"Lifecycle state. `draft` = not yet reviewed, possibly incomplete. `stable` = ready for consumption. `deprecated` = kept for links and history, no longer current. Absent means `stable`, so the key is only worth writing to say draft or deprecated. These three values are the whole set OKF defines, which is why this is the pack's only enum. OKF v0.2 §5.4."},stale_after:{type:`string`,format:`date`,description:"An absolute date, `YYYY-MM-DD`: the concept is stale when `today >= stale_after`. Absolute rather than a relative TTL so staleness stays a plain date comparison with no reference to when the concept was read. A date in the past is a freshness signal for consumers, not a violation. OKF v0.2 §5.5, §10.5."}}},Aoe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — Attested Computation frontmatter`,description:'Shapes for the OKF v0.2 computation keys, which turn a concept into a sanctioned way to compute a value so a consumer can confirm the agent ran the blessed computation instead of improvising its own. Provenance answers "where did this claim come from"; attestation answers "was this number produced the way we said it must be". This file also carries the one value-shaped rule in the pack: `runtime` is the single key OKF marks REQUIRED here, and only when `type` is `Attested Computation`. Ordinary concepts never match that condition and are unaffected, and no other key in the family is mandated. OKF records the computation and the means to check it and executes nothing itself; receipts and verdicts are runtime artifacts that are never stored in the bundle. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#10-attested-computations-concept',type:`object`,if:{required:[`type`],properties:{type:{const:`Attested Computation`,description:"The condition, not a constraint: everything in `then` applies only to documents whose `type` is exactly `Attested Computation`. An ordinary concept never matches, so nothing in this schema is ever asked of it. `type` is also required inside the condition so a document with no type at all fails the conformance floor once, rather than also being told it is missing a `runtime` for a type it never claimed."}}},then:{required:[`runtime`]},properties:{runtime:{type:`string`,description:"REQUIRED for `type: Attested Computation`. The single field that says how to run the computation, and therefore how the executor and attester interpret it and what `parameters` mean — a parameter is a SQL bind variable, a dbt var, or a Python argument depending on the runtime. Keeping `runtime` and `parameters` in one frontmatter is what makes the binding semantics self-evident. Example values: `bigquery`, `postgres`, `dbt`, `python`, `Looker`. Not a closed set, so no enum. OKF v0.2 §10.1, §10.2."},parameters:{type:`array`,description:`The typed, named holes the agent may fill. An agent MAY only supply values for these parameters; it MUST NOT author or edit the computation. That parameter-only surface is what makes "did the sanctioned thing run" a mechanical comparison rather than a judgement call. OKF v0.2 §10.2, §10.3.`,items:{type:`object`,properties:{name:{type:`string`,description:"The parameter name the computation binds, for example `year` bound as `@year` in BigQuery SQL or `{{ var('year') }}` in dbt. OKF v0.2 §10.2, §10.3."},type:{type:`string`,description:"The parameter's type, interpreted by `runtime` (`integer`, `string`, and so on). Deliberately not constrained to JSON Schema type names, because the vocabulary belongs to the runtime. OKF v0.2 §10.2."},required:{type:`boolean`,description:`Whether the agent must supply a value for this parameter. OKF v0.2 §10.2.`}}}},computation:{type:`string`,format:`uri-reference`,description:"Optional. A path to a file holding the computation, used instead of an inline body fence — best for a long or generated computation, or one already kept as a real file shared with non-OKF tooling. When absent, the body's `# Computation` fence IS the computation. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or a relative path. OKF v0.2 §6.2, §10.2, §10.3."},executor:{type:`object`,description:"How the computation is run. A runner — an agent, or deterministic consumer code — follows `resource`, and the run returns a receipt shaped by `receipt`. Binding the computation with the parameter values into the executable artifact is the consumer's job. OKF v0.2 §10.2, §10.5.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names the run instructions or code. What sits behind it — a Skill, a script, a container — is a packaging choice; OKF fixes the interface, not the packaging. Conventionally points into a `references/` subdirectory, for example `references/skills/run-on-bq.md`. OKF v0.2 §1, §6.2, §6.3, §10.2."},receipt:{type:`array`,items:{type:`string`},description:"Declares the fields a run must return — the evidence the attester inspects, for example `[job_id, executed_sql, result]` for BigQuery or `[run_id, compiled_sql, result]` for dbt. Because the attester compares the expanded, compiled artifact the receipt carries, a rewritten query, a swapped computation file, or a mutated dependency fails the check. The receipt itself is a runtime artifact and is never stored in the bundle. OKF v0.2 §10.2, §10.3, §10.5."}}},attester:{type:`object`,description:"The deterministic check that inspects a receipt and returns a verdict. Meant to run consumer-side. Distinct from `verified`: `verified` confirms the definition still matches policy and is recorded in the bundle, while attestation confirms a single run produced the value the sanctioned way and is not stored. OKF v0.2 §10.2, §10.6.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names code — no LLM — that takes a receipt and returns a verdict, independently re-deriving the binding of `computation` with the claimed parameter values to compare against what actually ran. Conventionally points into a `references/` subdirectory, for example `references/attesters/sql-equality.py`. OKF v0.2 §6.2, §6.3, §10.2, §10.3."}}}}},joe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — index files carry no frontmatter`,description:"`index.md` is a reserved filename at any level of the hierarchy and must not be used for a concept document. Index files contain no frontmatter, with exactly one exception — a bundle-root `index.md` may carry `okf_version` — which the scope carves out with a `!index` exclusion rather than a keyword here. `maxProperties: 0` is the mechanism rather than the boolean schema `false`, because a document with no frontmatter block validates as `{}` and `false` would reject that too, flagging the very documents that are correct. `log.md` is deliberately NOT covered: §9 constrains a log's date headings, ordering, and prose entries but never its frontmatter, and OKF's own reference bundle ships a `log.md` carrying `type` and `title`. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#8-index-files",type:`object`,maxProperties:0},Moe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — bundle-root index.md`,description:"The bundle-root `index.md` is the only index file OKF permits frontmatter in, and `okf_version` is the key it names there. OKF states the declaration as a MAY, so it is not required here. Nor is the frontmatter closed to other keys: §8 grants the exception for `okf_version` specifically, but §11 tells consumers not to reject a bundle over unknown additional keys, and that ambiguity is resolved in favor of the looser reading. The one thing pinned is the value's shape, because a YAML float is provably lossy where a version string is not. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#12-versioning",type:`object`,properties:{okf_version:{type:`string`,pattern:`^[0-9]+\\.[0-9]+$`,description:'The OKF version this bundle targets, as `<major>.<minor>` — currently `"0.2"`. Quote it: unquoted `0.2` parses as a YAML number, so a consumer comparing version strings sees a float instead, and `0.10` would silently become `0.1`. A minor bump is backward-compatible additions; a major bump may rename required fields or change reserved filenames. Consumers that do not understand the declared version should attempt best-effort consumption rather than refusing the bundle. OKF v0.2 §12.'}}},v5=[`**`,`!**/{index,log}`],y5=[{id:`frontmatter-required`,appliesTo:v5,schema:Doe},{id:`frontmatter-recommended`,appliesTo:v5,schema:Ooe},{id:`frontmatter-provenance`,appliesTo:v5,schema:koe},{id:`frontmatter-computation`,appliesTo:v5,schema:Aoe},{id:`frontmatter-reserved-index`,appliesTo:[`**/index`,`!index`],schema:joe},{id:`frontmatter-root-index`,appliesTo:[`index`],schema:Moe}],Noe=Object.fromEntries(h5.filter(e=>!y5.some(t=>t.id===e)).map(e=>[e,!1]));function b5(e,t){return t===void 0?[]:y5.filter(n=>g5(e,n.id)&&a5([...n.appliesTo]).matches(t))}function Poe(e){return y5.filter(t=>g5(e,t.id)).map(e=>({appliesTo:[...e.appliesTo],file:_5(e.id)}))}function Foe(e,t,n){let r=b5(t,n);return r.length===0?[]:p5(e,r.map(e=>({file:_5(e.id),schema:e.schema,ruleId:e.id})),{source:`okf`})}function x5(e,t){return QW(`okf:${e}`,(n,r)=>{try{t(n,r)}catch(t){console.warn(`[lint] OKF rule "${e}" failed${r.data.okfDocName?` on "${r.data.okfDocName}"`:``}`,t)}})}function S5(e,t,n){let r=a5(t);return x5(e,(e,t)=>{r.matches(t.data.okfDocName)&&n(e,t)})}var C5=e=>({line:e.line-1,character:e.column-1});function Ioe(e,t){if(e&&`start`in e)return{start:C5(e.start),end:C5(e.end)};if(e){let n=C5(e);return{start:n,end:{line:n.line,character:t[n.line]?.length??0}}}return{start:{line:0,character:0},end:{line:0,character:t[0]?.length??0}}}function Loe(e,t){return{range:Ioe(e.place,t),severity:`warning`,source:`okf`,code:e.ruleId??`okf`,message:e.reason}}function Roe(e,t,n){if(t.length===0)return[];let r=Se().use(ie).use(O).use(LP,[`yaml`]);for(let e of t)r.use(e);let i=new _({value:e});n!==void 0&&(i.data.okfDocName=n);let a=r.parse(i);r.runSync(a,i);let o=e.split(`
|
|
571
|
-
`);return i.messages.map(e=>Loe(e,o))}var zoe=`**/index`;function Boe(e){let t=!1;return
|
|
572
|
-
`?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(qoe)){let{index:i}=e;if((a===void 0?o[i-1]:n[a+i-1])===`!`)continue;let s=r&&a!==void 0?{start:u(i),end:u(i+e[0].length)}:void 0;t.message(Joe(e[0]),s)}})}),Xoe=[`index`,`log`];function Zoe(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return DX.includes(r)?t.slice(0,n):t}var Qoe=x5(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=Zoe(n),i=r.toLowerCase();Xoe.includes(i)&&r!==i&&t.message(`This file is named "${r}", but the Open Knowledge Format only recognizes "${i}". On a case-sensitive filesystem a consumer reads it as an ordinary concept document rather than the reserved file it is meant to be.`)}),T5=[{id:`no-wiki-links`,rule:Yoe},{id:`log-shape`,rule:Koe},{id:`index-shape`,rule:Voe},{id:`reserved-casing`,rule:Qoe}],$oe=T5.map(e=>e.rule);function ese(e){return e===void 0?$oe:T5.filter(t=>g5(e,t.id)).map(e=>e.rule)}var tse=$a([F(),z(bd),ao(N(),qa())]),nse={id:`markdownlint`,sliceSchema:L({enabled:F(),rules:ao(N(),tse)}),defaultSlice:{enabled:!1,rules:n5},async lint(e,t){return _oe(e,r5(t.rules))},fix(e,t){return goe(e,r5(t.rules))}},rse=L({appliesTo:$a([N(),I(N())]).optional(),file:N(),enabled:F().optional(),key:N().optional(),schema:ao(N(),qa()).optional()}),E5=[nse,{id:`frontmatter`,sliceSchema:L({enabled:F(),schemas:I(rse)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return p5(e,c5(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>c5(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:L({enabled:F(),rules:ao(N(),F()).optional(),generate:L({index:F().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...Roe(e,ese(t.rules),n.docName),...Foe(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>b5(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...Noe}}),advertisedMappings:e=>Poe(e.rules)}}],ise={enabled:!0,plugins:Object.fromEntries(E5.map(e=>[e.id,e.defaultSlice]))};function ase(e,t){return e.enabled&&e.plugins[t]?.enabled===!0}function ose(e,t){if(!e?.enabled||t===void 0||t===``)return[];let n=[];for(let r of E5){if(r.frontmatter===void 0)continue;let i=e.plugins[r.id];i?.enabled===!0&&n.push(...r.frontmatter.schemasForDoc(i,t))}return n}function sse(e){let t=Object.fromEntries(E5.map(t=>{let n=e.plugins[t.id]??t.defaultSlice;return t.frontmatter===void 0?[t.id,{...n,enabled:!1}]:[t.id,t.frontmatter.narrowSliceToFrontmatter(n)]}));return{...e,plugins:t}}var cse=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function lse(e){return cse.has(e)}L({docName:j$,summary:P$,content:N().optional(),...N$}).loose(),L({docName:j$,summary:P$,markdown:N(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(DX).optional(),...N$}).loose(),L({docName:j$,summary:P$,find:N().min(1),replace:N(),offset:P().int().nonnegative().optional(),...N$}).loose(),L({docName:j$,connectionId:N().min(1),scope:z([`last`,`session`,`file`,`count`]).optional(),count:P().int().positive().optional(),...N$}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var D5=L({value:N(),truncatedFrom:P().int().nonnegative().optional(),hint:N().optional()}).loose(),use=to(`kind`,[L({kind:B(`inline`),content:N()}),L({kind:B(`truncated`),byteLength:P().int().nonnegative(),hint:N()})]),O5=L({kind:B(`content-divergence`),intendedBytes:P().int().nonnegative(),actualBytes:P().int().nonnegative(),byteDelta:P().int(),divergenceType:N().optional(),currentState:use.optional(),hint:N().optional()}).loose(),dse=L({type:B(`orphan`),parentCandidates:I(N()),message:N()}).loose(),k5=L({kind:B(`disk-edit-reconciled`),intendedBytes:P().int().nonnegative(),actualBytes:P().int().nonnegative(),byteDelta:P().int(),mergeOutcome:N().optional(),hint:N().optional()}).loose(),A5=to(`kind`,[O5,k5]),fse=L({kind:B(`mermaid-parse-error`),fenceIndex:P().int().positive(),fenceFirstLine:N(),message:N(),line:P().int().positive().optional()}).loose(),j5=L({href:N(),targetKind:N(),role:N(),sourceForm:N(),resolvedTarget:N().nullable(),reason:N(),resolutionMethod:N(),fallbackTarget:N().nullable().optional(),definition:L({line:P().int().nonnegative(),label:N()}).loose().optional()}).loose(),M5=I(to(`kind`,[O5,k5,fse,L({kind:B(`lint-violation`),source:N(),code:N(),message:N(),severity:z([`error`,`warning`,`info`,`hint`]),line:P().int().positive(),column:P().int().positive(),linkTarget:N().optional(),localTarget:j5.optional()}).loose()])).min(1),N5=I(L({href:N(),resolvedTo:N().nullable(),reason:z([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:j5.optional()}).loose());L({timestamp:N().min(1),summary:D5.optional(),warning:A5.optional(),warnings:M5.optional()}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),hints:I(dse).optional(),summary:D5.optional(),warning:A5.optional(),warnings:M5.optional(),brokenLinks:N5}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),summary:D5.optional(),warning:A5.optional(),warnings:M5.optional(),brokenLinks:N5}).loose(),L({docName:N().min(1),scope:z([`last`,`session`,`count`]),undone:F()}).loose(),L({docs:I(L({docName:M$,markdown:N(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(DX).optional(),summary:P$}).loose()).min(1).max(100),...N$}).loose();var pse=L({type:e1,title:N(),detail:N().optional()}).loose(),mse=to(`status`,[L({status:B(`written`),docName:N().min(1),summary:D5.optional(),warnings:M5.optional(),brokenLinks:N5}).loose(),L({status:B(`error`),docName:N().min(1),error:pse}).loose()]);L({timestamp:N().min(1),results:I(mse),written:P().int().nonnegative(),failed:P().int().nonnegative()}).loose(),L({docName:j$,patch:ao(N(),$a([fm,Ga()])),types:ao(N(),z(lm)).optional(),summary:P$,...N$}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),appliedKeys:I(N()),summary:D5.optional(),warning:A5.optional(),warnings:M5.optional(),brokenLinks:N5}).loose();function hse(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??n5},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]},okf:{enabled:e.okf?.enabled??!1,...e.okf?.rules===void 0?{}:{rules:e.okf.rules},generate:{index:e.okf?.generate?.index??!1}}}}}var gse=Object.fromEntries(E5.map(e=>[e.id,e.sliceSchema])),_se=L({effective:L({enabled:F(),plugins:L(gse)}),configFile:N().nullable().optional(),configProblems:I(N()).optional()}),vse=$a([F(),ao(N(),qa())]);L({ruleId:N().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:$a([vse,Ga()])}),L({file:N().min(1).max(512),delete:B(!0).optional(),field:N().min(1).max(256).optional(),parentPath:I($a([N().min(1).max(256),L({items:B(!0)}).strict()])).max(8).optional(),removeField:B(!0).optional(),renameTo:N().min(1).max(256).optional(),constraint:L({type:z([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:I($a([N(),P(),F()])).nullable().optional(),itemsEnum:I($a([N(),P(),F()])).nullable().optional(),itemsType:z([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:N().nullable().optional(),format:N().nullable().optional(),description:N().max(2048).nullable().optional(),required:F().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var yse=L({schemas:I(N()),truncated:F()}).strict(),P5=L({line:P(),character:P()}),F5=L({start:P5,end:P5}),I5=L({range:F5,severity:z([`error`,`warning`,`info`,`hint`]),source:N(),code:N(),message:N(),fixes:I(L({range:F5,newText:N()})).optional(),frontmatterScope:z(gd).optional(),frontmatterProperty:N().optional()}),L5=I(N()).optional();L({files:I(L({file:N(),diagnostics:I(I5),ran:L5,warnings:I(N()).optional()})),fileCount:P(),errorCount:P(),warningCount:P(),warnings:I(N()),ran:L5});var bse=I5.extend({linkTarget:N().optional(),localTarget:j5.optional()}),xse=L({files:I(L({file:N(),diagnostics:I(bse)})),fileCount:P(),errorCount:P(),warningCount:P(),warnings:I(N()),ran:L5}),R5=L({errorCount:P().int().nonnegative(),warningCount:P().int().nonnegative()}),Sse=L({files:I(L({file:N(),lint:R5,links:R5})),fileCount:P().int().nonnegative(),errorCount:P().int().nonnegative(),warningCount:P().int().nonnegative(),warnings:I(N())});L({docName:j$,summary:P$,...N$}).loose();var Cse=L({file:N(),fixedCount:P(),diagnostics:I(I5),errorCount:P(),warningCount:P(),ran:L5,warnings:I(N()).optional(),warning:N().optional()});function wse(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function Tse(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:wse(e)&&t.endsWith(`.json`)}var z5=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],Ese=(()=>{let e=new Map;for(let t of z5){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function B5(e){return Ese.get(e.toUpperCase())??null}function Dse(e,t){let n=B5(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))B5(t)===n&&(r={key:t,value:i});return r}var Ose=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],kse=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function Ase(e){for(let[t,n]of kse)if(e.tags.includes(t))return n;return`Style`}function jse(e){let t={lint:{errorCount:0,warningCount:0},links:{errorCount:0,warningCount:0}};for(let n of e){let e=n.source===`links`?t.links:t.lint;n.severity===`error`?e.errorCount+=1:e.warningCount+=1}return t}async function Mse(e,t,n,r){if(!t.enabled)return[];let i=[];for(let a of E5){if(!ase(t,a.id))continue;let o=t.plugins[a.id];try{i.push(...await a.lint(e,o,{docName:n}))}catch(e){console.warn(`[lint] plugin "${a.id}" failed${n?` on "${n}"`:``}`,e),r?.({source:a.id,phase:`lint`,...n===void 0?{}:{docName:n},message:Nse(e)})}}return i}var V5=500;function Nse(e){let t=H5(e);return t.length>V5?`${t.slice(0,V5)}… (truncated)`:t}function H5(e,t=0){if(e instanceof Error)return e.cause===void 0||t>=3?e.message:`${e.message} (cause: ${H5(e.cause,t+1)})`;if(typeof e==`object`&&e)try{let t=JSON.stringify(e);if(t!==void 0)return t}catch{}return String(e)}var Pse=/\p{M}+/gu,Fse=/[^\p{L}\p{N}]+/gu,Ise=/^-+|-+$/g;function U5(e){return e.trim().normalize(`NFKD`).replace(Pse,``).toLowerCase().replace(Fse,`-`).replace(Ise,``)}function Lse(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function W5(e,t){let n=U5(e);return n?Lse(n,t):``}function G5(e,t){let n=U5(e);return t?`#${n}-${U5(t)}`:`#${n}`}var K5=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]),Rse=new Map(B2.flatMap(e=>e.surface===`compat`&&K5.has(e.rendersAs)?[[e.name,e]]:[]));function q5(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function J5(e){let t=e.name;if(!t||!K5.has(t))return null;let n=q5(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function Y5(e){let t=e.name;if(!t)return null;let n=Rse.get(t);if(!n)return null;let r=q5(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var zse=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:G5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Bse=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:G5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Vse=(e,t)=>{let n=t,r=J5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=Y5(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},Hse=(e,t)=>{let n=t,r=J5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=Y5(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Use=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Wse=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},Gse=(e,t)=>{let n=t,r={type:`element`,tagName:n.data?.sourceForm===`ins`?`ins`:`u`,properties:{},children:e.all(n)};return e.patch(t,r),e.applyData(t,r)};function X5(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(X5).join(``):``}var Z5={wikiLink:zse,wikiLinkEmbed:Bse,mdxJsxFlowElement:Vse,mdxJsxTextElement:Hse,rawMdxFallback:Use,mark:Wse,underline:Gse,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:X5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:X5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Kse=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,qse=/\bexpression\s*\(/i,Jse=1e4;function Yse(e){return!(e.length>Jse||Kse.test(e)||qse.test(e))}function Q5(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!dZ(e.split(/\s+/)[0]??``))return!1}return!0}var Xse={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},Zse=new Set([`href`,`src`]),Qse=Ce(`<>`),$5=()=>e=>{h(e,`element`,e=>{let t=Xse[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?f3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(Zse.has(e))if(t===`<>`||t===Qse)r=``;else{let e=f3(t);r=e===t?t:Ce(e)}else r=f3(t);r!==t&&(n[e]=r)}})},e7=()=>e=>{h(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!dZ(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!dZ(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!dZ(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!Q5(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!Q5(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!dZ(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Yse(r)&&delete n.style})};function $se(e){let t=Se().use(be,{handlers:Z5}).use($5).use(e7).use(eG),n=t.runSync(e);return String(t.stringify(n))}function ece(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(t7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(t7(e.slice(r),r>0,!1)),n.join(``)}function t7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var n7=/\r?\n|\r/,tce=(e,t)=>{let n=ece(String(t.value));if(!n7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(n7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function nce(e){let t=Se().use(ie).use(LP,[`yaml`]).use(d8).use(O).use(j8).use(a3).use(y8).use(b3).use(be,{handlers:{...Z5,text:tce}}).use($5).use(e7).use(eG);return String(t.processSync(r3(y3(e))))}uI(),kF(),AF(),L({entries:I(L({level:z([`info`,`warn`,`error`]),message:N().max(nY),event:N().optional(),fields:ao(N(),qa()).optional(),ts:P().optional(),sourceId:N().optional(),lineNumber:P().optional()}).loose()).max(100),droppedSinceLastFlush:P().int().min(0).optional()}).loose(),L({accepted:P().int().min(0)}).loose();var rce=L({exact:N().min(1),prefix:N(),suffix:N(),start:P().int().nonnegative(),end:P().int().nonnegative()}),ice=I($a([N(),P().int().nonnegative()])),ace=to(`kind`,[L({kind:B(`body`)}),L({kind:B(`property`),key:N().min(1),path:ice.default([])})]).default({kind:`body`}),oce=z([`anchored`,`orphaned`,`resolved`]),r7=L({threadId:N().min(1),docName:N().min(1),target:ace,anchor:rce.nullable(),state:oce,queued:F(),latestComment:N(),createdBy:N().min(1),createdAt:P(),updatedAt:P().optional()}),i7=L({docName:N(),instruction:N(),property:N().nullable(),passage:L({exact:N(),prefix:N(),suffix:N()}).nullable(),anchorLost:F(),passageRepeats:F()}).loose(),a7=L({threadId:N(),ok:B(!0)}),o7=L({threadId:N(),ok:B(!1),error:B(`not-found`)});L({threads:I(r7)}).loose();var sce=L({meta:r7,orphaned:F()}).loose(),cce=L({threadId:N()}).loose();L({meta:r7,payload:i7}).loose();var lce=L({results:I($a([a7.extend({meta:r7,payload:i7}),o7]))}).loose(),uce=L({results:I($a([a7.extend({meta:r7}),o7]))}).loose(),dce=L({status:N().min(1),reason:N()}).loose(),fce=L({docName:N().min(1),content:N(),lifecycle:dce.nullable()}).loose(),s7=L({kind:z([`document`,`asset`,`folder`,`file`]).default(`document`),docName:N().min(1).optional(),docExt:N().min(1).default(`.md`),size:P().int().nonnegative(),modified:N().min(1),isSymlink:F().default(!1),canonicalDocName:N().nullable().default(null),targetPath:N().nullable().default(null),path:N().min(1).optional(),assetExt:N().min(1).optional(),mediaKind:z([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:I(N().min(1)).optional(),hasChildren:F().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.hasChildren===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.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),pce=L({documents:I(s7),truncated:F().optional()}).loose(),mce=L({source:N().min(1),anchor:N().nullable(),title:N(),snippet:N().nullable()}).loose(),hce=L({docName:N().min(1),backlinks:I(mce)}).loose(),gce=L({counts:ao(N().min(1),P().int().nonnegative())}).loose();L({counts:ao(N().min(1),P().int().nonnegative())}).loose();var _ce=to(`kind`,[L({kind:B(`doc`),docName:N().min(1),anchor:N().nullable(),title:N(),snippet:N().nullable()}).loose(),L({kind:B(`external`),url:N().min(1),title:N(),snippet:N().nullable()}).loose()]),vce=L({role:N().min(1),sourceForm:N().min(1),targetKind:N().min(1),href:N(),resolvedTarget:N().nullable(),status:N().min(1),reason:N().nullable(),resolutionMethod:N().min(1),fallbackTarget:N().nullable().default(null),range:L({start:P().int().nonnegative(),end:P().int().nonnegative()}),line:P().int().nonnegative(),column:P().int().nonnegative(),definition:L({label:N(),line:P().int().nonnegative()}).nullable().default(null)}).loose(),yce=L({docName:N().min(1),forwardLinks:I(_ce),localTargets:I(vce).optional()}).loose(),bce=to(`kind`,[L({id:N().min(1),kind:B(`doc`),docName:N().min(1),anchor:N().nullable(),label:N(),cluster:N().nullable(),category:N().nullable(),tags:I(N()).nullable(),managed:F().optional()}).loose(),L({id:N().min(1),kind:B(`external`),url:N().min(1),label:N()}).loose()]),xce=L({source:N().min(1),target:N().min(1)}).loose(),Sce=L({nodes:I(bce),links:I(xce)}).loose(),Cce=L({ts:P().int().min(0),url:N(),method:N(),ua:N().optional(),origin:N().optional(),referer:N().optional(),host:N().optional(),remote:N().optional(),secChUa:N().optional(),secChUaMobile:N().optional(),secChUaPlatform:N().optional(),secFetchSite:N().optional(),secFetchDest:N().optional(),secFetchMode:N().optional(),secFetchUser:N().optional()}).loose(),wce=L({app:$a([B(`cursor`),B(`codex`),B(`claude`),Ga()]),signals_fired:I(N())}).loose();L({entries:I(Cce),count:P().int().min(0),detection:wce}).loose();var c7=L({path:N().min(1),code:z([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:N().min(1).optional(),syncScoped:F(),open:to(`kind`,[L({kind:B(`doc`),docName:N().min(1)}),L({kind:B(`asset`),path:N().min(1)})]).optional()}).loose();L({branch:N().nullable(),detached:F(),upstream:N().nullable(),staged:I(c7),notStaged:I(c7),untracked:I(c7),incoming:I(c7),truncated:F(),readable:F().default(!0)}).loose(),L({writers:I(L({id:N().min(1),name:N().optional(),email:N().optional()}).loose()).optional(),summary:P$,...N$}).loose(),L({checkpointRef:N().min(1)}).loose();var Tce=L({v:P().int().optional(),id:N().min(1),name:N().min(1),colorSeed:N().optional(),docs:I(N()),summaries:I(N()).optional()}).loose();L({entries:I(L({sha:N().min(1),timestamp:N().min(1),author:N(),authorEmail:N(),type:z([`checkpoint`,`wip`,`upstream`,`park`]),message:N(),contributors:I(Tce),checkpoint:qa().nullable(),parentSha:N().nullable().optional()}).loose()),total:P().int().nonnegative().optional(),truncated:F().optional(),hasMore:F().optional()}).loose(),L({sha:N().regex(/^[0-9a-f]{40}$/i),content:N(),timestamp:N(),author:N()}).loose();var Ece=L({contentDir:N().min(1),pathSeparator:z([`/`,`\\`]),symlinkResolved:F()}).loose();I(to(`source`,[L({docName:N().min(1),timestamp:N().min(1),size:P().int().nonnegative(),source:B(`flat`)}).loose(),L({docName:N().min(1),timestamp:N().min(1),source:B(`timeline`),sha:N().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var Dce=L({domain:N().min(1),title:N().optional(),description:N().optional(),siteName:N().optional(),faviconDataUri:N().optional()}).loose();L({url:N()}).loose();var Oce=to(`ok`,[L({ok:B(!0),metadata:Dce}).loose(),L({ok:B(!1),reason:N()}).loose()]),kce=L({orphans:I(L({docName:N().min(1),title:N()}).loose())}).loose(),Ace=L({hubs:I(L({docName:N().min(1),title:N(),count:P().int().nonnegative()}).loose())}).loose(),jce=L({source:N().min(1),title:N(),snippet:N().nullable()}).loose();L({deadLinks:I(L({target:N().min(1),sources:I(jce)}).loose())}).loose(),L({target:L({docName:N().min(1),title:N(),aliases:I(N())}).loose(),mentions:I(L({source:N().min(1),excerpt:N(),offset:P().int().nonnegative()}).loose()),truncated:F()}).loose(),L({projectPath:N().min(1)}).loose();var Mce=z([`not-a-git-worktree`,`init-failed`]);to(`ok`,[L({ok:B(!0),projectPath:N().min(1)}).loose(),L({ok:B(!1),reason:Mce,message:N().min(1)}).loose()]),L({host:N().min(1).optional()}).loose(),L({host:N().min(1).optional(),token:N().min(1)}).loose(),L({host:N(),login:N()}).loose(),L({key:N().min(1)}).loose(),L({keyPresent:F()}).loose();var Nce=z([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),Pce=to(`ok`,[L({ok:B(!0),endpoint:N().min(1),model:N().min(1),dimensions:P().int().positive()}).loose(),L({ok:B(!1),endpoint:N().min(1),model:N().min(1),reason:Nce,status:P().int().optional()}).loose()]);L({name:N().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:N().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),L({authenticated:F()}).loose(),L({channel:z([`login`,`gh-login`]).default(`login`)}).loose(),L({}).loose();var l7=65536;function u7(e){let t=e.match(rm);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function Fce(e){if(e.trim()===``)return{doc:new tl({}),map:{}};let t;try{t=fu(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new tl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=_m.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function d7(e){return e===``?{doc:new tl({}),map:{}}:Fce(sm(e))}function f7(e){let{fenced:t}=u7(e),{map:n,parseError:r}=d7(t);return{map:n??{},parseError:r}}function p7(e){let{fenced:t}=u7(e);if(t===``)return[];let{doc:n,map:r}=d7(t);return r===null?[]:_7(n)}function m7(e){return typeof e==`object`&&!!e&&`key`in e}function h7(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function g7(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function _7(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!m7(e))continue;let t=h7(e);t!==null&&n.push(t)}return n}function v7(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function Ice(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:Tm(e.toString(xm))}function Lce(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:l7}:null}function y7(e){let t=Ice(e),n=Lce(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function Rce(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:cm}};let{doc:n,map:r}=d7(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{v7(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=fm.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,wm(n,n.get(e,!0),t.data))}return y7(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function zce(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:cm}};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>m7(e)&&h7(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>m7(e)&&e!==s&&h7(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return g7(s,n),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function b7(e,t){let{doc:n,map:r}=d7(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=_7(n);if(a.length!==t.length||!x7(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(m7),r=[];for(let n of t){let i=e.findIndex(e=>h7(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,y7(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function x7(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function S7(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:cm}:null}function Bce(e,t,n){let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=fm.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return v7(i),i.setIn(t,wm(i,i.getIn(t,!0),o.data)),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Vce(e,t){let n=S7(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=d7(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),y7(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Hce(e,t){if(t.length===0){let t=e.contents;return qo(t)?t:null}let n=e.getIn(t,!0);return qo(n)?n:null}function Uce(e,t,n,r={}){let i=S7(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:cm}};let{doc:o,map:s}=d7(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=Hce(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>m7(e)&&h7(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>m7(e)&&e!==l&&h7(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return g7(l,n),y7(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Wce(e,t,n){if(t.length===0)return b7(e,n);let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!qo(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!m7(e))continue;let t=h7(e);t!==null&&s.push(t)}if(s.length!==n.length||!x7(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(m7),t=[];for(let r of n){let i=e.findIndex(e=>h7(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Gce(e,t,n){let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Xo(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!Kce(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Kce(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var qce=L({changes:I(to(`kind`,[L({key:N(),kind:B(`added`),after:fm}).loose(),L({key:N(),kind:B(`removed`),before:fm}).loose(),L({key:N(),kind:B(`changed`),before:fm,after:fm}).loose()])),unparseable:L({before:N(),after:N()}).loose().nullable()}).loose();function C7(e){let{fenced:t}=u7(e),n=d7(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=Em(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function Jce(e,t){let n=C7(e),r=C7(t);if(n.parseError!==void 0||r.parseError!==void 0)return{changes:[],unparseable:{before:n.fenced,after:r.fenced}};let i=[],a=new Set;for(let e of r.keys){if(a.has(e))continue;a.add(e);let t=r.map[e];if(t===void 0)continue;let o=n.map[e];if(o===void 0){i.push({key:e,kind:`added`,after:t});continue}bm(o,t)||i.push({key:e,kind:`changed`,before:o,after:t})}for(let e of n.keys){if(a.has(e))continue;a.add(e);let t=n.map[e];t!==void 0&&i.push({key:e,kind:`removed`,before:t})}return{changes:i,unparseable:null}}var Yce=L({stackIndex:P().int().min(0),ts:P().int().min(0),additions:P().int().min(0),deletions:P().int().min(0)}).loose(),Xce=L({docName:N().min(1),additionsTotal:P().int().min(0),deletionsTotal:P().int().min(0),lastTs:P().int().min(0),bursts:I(Yce)}).loose(),Zce=L({displayName:N().min(1),color:N().min(1),icon:N().optional(),connectionId:N().min(1)}).loose(),Qce=L({sessionAlive:F(),agent:Zce.nullable(),files:I(Xce)}).loose(),$ce=L({diff:N(),before:N(),after:N(),properties:qce,generatedAt:P().int().min(0)}).loose();L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose();var ele=L({displayName:N().min(1),icon:N(),color:N().min(1),currentDoc:N().nullable(),mode:z([`idle`,`writing`]),ts:P().int().min(0)}).loose();L({presence:ao(N().min(1),ele)}).loose();var tle=L({sessionId:N().min(1),agentType:N().min(1),ts:P().int().min(0),insertedChars:P().int().min(0),deletedChars:P().int().min(0)}).loose();L({effects:I(L({"doc.name":N().min(1),entries:I(tle)}).loose())}).loose(),L({decisions:I(L({ts:P().int().min(0),decision:N().min(1),kind:N().min(1),"doc.name":N().min(1),pathRole:N().min(1)}).loose())}).loose(),ao(N().min(1),F()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),L({path:N().min(1,`path must be non-empty`)}).loose(),L({}).loose();var nle=L({fromDocName:N().min(1),toDocName:N().min(1)}).loose(),rle=L({fromPath:N().min(1),toPath:N().min(1)}).loose();L({}).loose(),L({path:N().min(1),...N$,summary:P$}).loose();var ile=L({docName:N().min(1)}).loose();L({path:N().min(1),...N$,summary:P$}).loose();var ale=L({path:N().min(1)}).loose();L({kind:z([`file`,`folder`]),path:N().min(1),...N$,summary:P$}).loose();var ole=L({kind:z([`file`,`folder`]),path:N().min(1),duplicatedDocNames:I(N().min(1))}).loose(),sle=L({pages:I(L({docName:N().min(1),title:N(),docExt:N().min(1),size:P().int().nonnegative(),modified:N().min(1),icon:N().min(1).max(2048).optional()}).loose())}).loose(),cle=L({level:P().int().min(1).max(6),text:N(),slug:N()}).loose(),lle=L({docName:N().min(1),headings:I(cle)}).loose(),ule=L({docName:N().min(1),rewrites:P().int().nonnegative()}).loose();L({kind:z([`file`,`folder`,`asset`]),fromPath:N().min(1),toPath:N().min(1),...N$,summary:P$}).loose();var dle=L({renamed:I(nle),renamedAssets:I(rle),rewrittenDocs:I(ule).optional(),summary:D5.optional()}).loose();L({kind:z([`file`,`folder`,`asset`]),path:N().min(1),...N$}).loose();var fle=L({deletedDocNames:I(N().min(1))}).loose();L({kind:z([`file`,`folder`,`asset`]),path:N().min(1),...N$,summary:P$}).loose();var ple=L({deletedDocNames:I(N().min(1))}).loose();L({docName:N().min(1),commitSha:N().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:P$,...N$}).loose(),L({restoredFrom:N().min(1),timestamp:N().min(1),summary:D5.optional(),warning:O5.optional(),warnings:M5.optional()}).loose();var mle=/^#[0-9a-fA-F]{6}$/,hle=L(Object.fromEntries(xd.map(e=>[e,N().regex(mle,`must be a #rrggbb hex color`)]))),w7=N().min(1).refine(Td,{message:`must contain a non-whitespace character`}),T7=L({name:w7,author:w7.optional(),variant:z([`dark`,`light`]),palette:hle}).loose(),gle=L({name:N().min(1),scheme:T7,stem:N().min(1).optional(),extension:z([`.yaml`,`.yml`]).optional()}).loose(),_le=L({id:N().min(1),filename:N().min(1)}).loose(),vle=L({id:N().min(1),scheme:T7}).loose(),yle=L({id:N().min(1),filename:N().min(1)}).loose(),ble=to(`existed`,[L({existed:B(!1)}).loose(),L({existed:B(!0),filename:N().min(1),scheme:T7}).loose()]),xle=L({themes:I(to(`ok`,[L({ok:B(!0),id:N().min(1),filename:N().min(1),scheme:T7}),L({ok:B(!1),filename:N().min(1),id:N().min(1).optional(),code:N().min(1),conflictingFilenames:I(N().min(1)).min(2).optional()})])),truncated:F()}).loose(),Sle=z([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Cle=L({label:N().min(1),webUrl:wa().nullable()}).loose(),wle=to(`checkStatus`,[L({checkStatus:B(`allowed`)}).loose(),L({checkStatus:B(`denied`),deniedReason:z([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:N().optional(),declaredLogin:N().optional(),declaredSource:N().optional()}).loose(),L({checkStatus:B(`unknown`),unknownError:z([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),E7=z([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Tle=z(mu),Ele=z([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);L({state:Sle,lastSyncUtc:N().nullable(),lastRunUtc:N().nullable().optional(),lastPullOkUtc:N().nullable().optional(),lastPushOkUtc:N().nullable().optional(),lastFetchUtc:N().nullable(),lastPushedSha:N().nullable(),ahead:P().int().min(0),behind:P().int().min(0),consecutiveFailures:P().int().min(0),conflictCount:P().int().min(0),hasRemote:F(),syncEnabled:F(),identityUnresolved:F(),remote:Cle.nullable().optional(),pushError:N().optional(),pushErrorCode:E7.optional(),pullError:N().optional(),pullErrorCode:E7.optional(),pausedReason:N().optional(),blockingPaths:I(N().min(1)).optional(),pushPermission:wle.optional(),syncMode:Tle.optional(),lastPullUtc:N().nullable().optional(),lastPullOutcome:Ele.nullable().optional()}).loose(),L({action:z([`commit`]),paths:I(N().min(1)),commitSha:N().optional()}).loose(),L({action:z([`commit`])}).loose(),L({op:z([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),L({op:z([`sync`,`push`,`pull`,`fetch`])}).loose(),L({conflicts:I(L({file:N().min(1),detectedAt:N().min(1),oursSha:N().optional(),theirsSha:N().optional(),baseSha:N().optional()}).loose())}).loose(),L({file:N().min(1),strategy:z([`mine`,`theirs`,`content`,`delete`]),content:N().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),L({}).loose(),L({file:N().min(1),base:N(),ours:N(),theirs:N(),kind:z([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:N().nullable()}).loose(),L({plan:No(e=>e!==void 0,{message:`plan is required`})}).loose(),L({plan:No(e=>e!==void 0,{message:`plan is required`})}).loose(),L({result:No(e=>e!==void 0,{message:`result is required`})}).loose(),L({packId:N().min(1)}).strict(),L({installedHosts:I(N()),skills:I(L({name:N().min(1),created:F()}).strict())}).strict();var Dle=L({path:N().min(1),summary:N().min(1)}).loose(),Ole=L({files:P().int().nonnegative(),folders:P().int().nonnegative()}).loose();L({packs:I(L({id:N().min(1),name:N().min(1),description:N().min(1),defaultSubfolder:N().optional(),folders:I(Dle),entryCounts:Ole}).loose())}).loose(),L({noOpen:F().optional(),out:N().min(1).optional()}).loose();var kle=L({reason:z([`unsupported-platform`,`spawn-error`]),message:N()}).loose();to(`status`,[L({status:B(`installed`),outputPath:N(),size:P().int().nonnegative(),sha256:N(),skillVersion:N()}).loose(),L({status:B(`built`),outputPath:N(),size:P().int().nonnegative(),sha256:N(),skillVersion:N(),handoffError:kle.optional()}).loose(),L({status:B(`failed`),buildError:N()}).loose(),L({status:B(`skip-current`),skillVersion:N(),recordedAt:N().optional()}).loose()]);var D7=z(Wp),O7=z(Gp);function k7(e){return e===`agents`||Gp.includes(e)}var Ale=L({alwaysOn:P().int().nonnegative(),onTrigger:P().int().nonnegative(),onDemand:P().int().nonnegative()}).strict(),jle=[`.md`,`.mdx`,`.txt`],Mle=5e3,Nle=4;function A7(e){return Math.round(e/Nle)}function Ple(e){let t=e.lastIndexOf(`.`);return t===-1?!1:jle.includes(e.slice(t).toLowerCase())}function Fle(e){let t=A7((e.name??``).length+(e.description??``).length),n=A7(am(e.skillMd).body.length),r=e.files.some(e=>e.relPath===`overlay.yaml`),i=0;for(let t of e.files)t.content!==null&&t.relPath!==`SKILL.md`&&(r&&t.relPath.startsWith(`upstream/`)||Ple(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:A7(i)}}L({tags:I(L({name:N().min(1),count:P().int().nonnegative(),isLeaf:F()}).loose())}).loose();var Ile=L({docName:N().min(1),title:N(),matchingTags:I(N().min(1)),snippet:N().nullable()}).loose();L({name:N().min(1),docs:I(Ile)}).loose(),L({folder:qa(),frontmatter_local:ao(N(),qa()).nullable()}).loose(),L({path:N(),frontmatter:ao(N(),qa()).optional()}).loose(),L({applied:qa()}).loose();var j7=ao(N(),qa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});L({template:L({name:N().min(1),folder:N(),scope:z([`local`,`inherited`]),path:N().min(1),frontmatter:j7,body:N()}).strict()}).strict();var Lle=L({templates:I(L({name:N().min(1),title:N().optional(),description:N().optional(),path:N().min(1),source_folder:N()}).strict()),truncated:F()}).strict();L({folder:N(),name:N(),body:N().optional(),frontmatter:j7.optional(),...N$,summary:P$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({sourcePath:N().min(1),targetFolder:N(),name:N().optional(),title:N().optional(),deleteSource:F().optional(),...N$,summary:P$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({existed:F(),path:N().min(1)}).strict(),L({fromFolder:N(),fromName:N(),toFolder:N(),toName:N(),body:N().optional(),frontmatter:j7.optional(),...N$,summary:P$}).strict(),L({from:N().min(1),to:N().min(1),committed:F()}).strict();var M7=z(hp),Rle=/^[a-z0-9-]+$/,zle=/^[A-Za-z0-9_-]+$/,N7=L({name:N(),description:N(),metadata:L({pack:N()}).strict().optional()}).strict();L({skill:L({name:N().min(1),scope:M7,path:N().min(1),frontmatter:N7,body:N(),files:I(L({path:N().min(1),text:N().nullable()})).optional(),managed:F().optional()}).strict()}).strict();var Ble=L({source:N().min(1),publisher:N().optional(),skill:N().optional(),marketplaceUrl:N().optional(),importedAt:N().min(1),autoUpdate:F().optional()}).strict(),Vle=L({name:N().min(1),description:N().optional(),scope:M7,path:N().min(1),canonicalPath:N().min(1).optional(),filePaths:I(N()).optional(),absolutePath:N().min(1).optional(),installed:F(),hosts:I(N()),hostQualifier:N().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:I(N()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:ao(N(),N()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:I(N()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:I(N()).optional(),installableEditors:I(N()).optional(),linkMode:F().optional(),customPlacements:I(L({path:N(),mode:z([`copy`,`link`])}).strict()).optional(),plugin:L({name:N().min(1),marketplace:N().min(1),provider:N().min(1),url:N().optional()}).strict().optional(),managed:F().optional(),origin:Ble.optional(),pack:N().optional(),modified:F().optional(),revertable:F().optional(),ignored:F().optional(),size:Ale.optional()}).strict();L({name:N().min(1),scope:M7,apply:F().optional()}).strict(),L({line:N().min(1),gitignorePath:N().min(1),applied:F(),alreadyTracked:F().optional()}).strict();var Hle=L({skills:I(Vle),truncated:F()}).strict();L({scope:M7.default(`project`),name:N().meta({description:`Managed skill name to create or update.`}),body:N().optional(),frontmatter:N7,...N$,summary:P$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({scope:M7.default(`project`),name:N(),dryRun:F().optional(),setAutoUpdate:F().optional(),...N$,summary:P$}).strict(),L({name:N().min(1),updated:F(),source:N().min(1),localBody:N().optional(),upstreamBody:N().optional(),gitTracked:F().optional(),warnings:I(N())}).strict(),L({scope:M7.default(`project`),name:N(),...N$,summary:P$}).strict(),L({name:N().min(1),baselineRef:N().min(1),restoredFiles:I(N()),warnings:I(N())}).strict(),L({existed:F(),path:N().min(1)}).strict(),L({scope:M7.default(`project`),fromName:N(),toName:N(),body:N().optional(),frontmatter:N7.optional(),...N$,summary:P$}).strict(),L({from:N().min(1),to:N().min(1),committed:F()}).strict(),L({name:N(),fromScope:M7,toScope:M7,...N$,summary:P$}).strict(),L({scope:M7,path:N().optional()}).strict(),L({scope:M7,name:N(),toName:N(),...N$,summary:P$}).strict(),L({name:N().min(1)}).strict(),L({name:N(),home:N().min(1)}).strict(),L({docName:N().min(1)}).strict();var P7=z([`reference`,`script`,`file`]);L({scope:M7.default(`project`),name:N(),path:N().min(1),content:N(),...N$,summary:P$}).strict(),L({path:N().min(1),created:F(),kind:P7,content:F()}).strict(),L({scope:M7.default(`project`),name:N(),from:N().min(1),to:N().min(1),...N$,summary:P$}).strict(),L({from:N().min(1),to:N().min(1),fromDocName:N().optional(),toDocName:N().optional()}).strict(),L({path:N().min(1),kind:P7,text:N()}).strict(),L({path:N().min(1),existed:F(),kind:P7}).strict();var F7=$a([O7,B(`agents`)]),I7=N().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),L7=$a([F7,I7]);L({scope:M7.default(`project`),name:N(),targets:I(F7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:I(L7).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:I(L7).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:z([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:L7.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:F().optional(),setSource:N().min(1).optional(),place:L({dir:N().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:z([`copy`,`link`])}).strict().optional(),convert:L({target:L7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:z([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:L({path:N().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...N$,summary:P$,fork:L({editor:N().min(1),action:z([`align`,`make-source`,`rename`]),toName:N().optional()}).strict().optional()}).strict().refine(e=>!(e.targets!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>!(e.source!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),L({name:N().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:I(N()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:F().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:I(N()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:I(z([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:N().optional(),sourceMovedTo:N().optional()}).strict(),L({scope:M7.default(`project`),name:N().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),L({name:N().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:F().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict();var Ule=L({targets:I(D7),configured:F(),folders:I(L({scope:M7,host:N(),root:N(),state:z([`own`,`linked`,`linked-parent`,`absent`]),target:N().optional(),drift:B(!0).optional(),expected:N().optional()}).strict()).optional()}).strict(),R7=L({action:B(`link`),scope:M7,root:N().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:N().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),z7=L({action:B(`unlink`),scope:M7,root:N().min(1).meta({description:`The linked folder to materialize back.`}),exclude:I(N().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),B7=L({action:B(`add-root`),scope:M7,root:I7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),Wle=to(`action`,[R7.extend({preview:F().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),z7,B7]);to(`action`,[R7.strict(),z7,B7]),L({folderAction:Wle}).strict();var V7=L({moves:I(N()),drops:I(N()),removes:I(N()),replaces:I(N()),conflicts:I(N()),strays:I(N())}).strict();L({targets:I(D7),reprojected:I(L({name:N(),hosts:I(N())}).strict()),bundleHosts:I(N()),removedFrom:I(N()),folder:L({moved:I(N()),dropped:I(N()),linked:I(N())}).strict().optional(),preview:V7.optional()}).strict(),L({scope:M7.default(`project`),name:N(),version:N().regex(/^[0-9a-f]{40}$/i),...N$,summary:P$}).strict(),L({name:N().min(1),version:N(),restoredFiles:I(N()),warnings:I(N())}).strict(),L({query:N().optional(),intent:z([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:z([`navigation`,`relevance`]).optional(),scopes:I(z([`page`,`folder`,`content`,`file`])).optional(),scope:N().optional(),limit:P().int().nonnegative().optional(),semantic:F().optional(),source:z([`omnibar`,`mcp`,`http`]).optional()}).loose();var Gle=L({kind:z([`page`,`folder`,`content`,`file`]),path:N().min(1),title:N(),score:P(),signals:ao(N(),qa()),snippet:N().optional()}).loose(),Kle=L({capable:F(),applied:F(),coverage:L({embedded:P().int().nonnegative(),total:P().int().nonnegative()})}).loose();L({enabled:F(),keyPresent:F(),keyNotRequired:F(),keySource:z([`project`,`file`,`env`]).nullable(),keyHint:N().nullable(),ready:F(),capable:F(),embedded:P().int().nonnegative(),total:P().int().nonnegative()}).loose(),L({query:N(),intent:z([`autocomplete`,`full_text`,`omnibar`]),results:I(Gle),elapsedMs:P().nonnegative(),semantic:Kle.optional(),truncated:F().optional(),ready:F().optional()}).loose();var qle=L({version:N().min(1),recordedAt:N().min(1)}).loose();L({currentVersion:N().min(1),targets:ao(N(),qle.nullable())}).loose(),L({scope:M7.default(`project`),source:N().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:N().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:F().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:F().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...N$,summary:P$}).strict(),L({scope:M7.default(`project`),source:N().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:I(N().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:F().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:F().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...N$,summary:P$}).strict(),L({results:I(L({requested:N(),status:z([`imported`,`already-imported`,`not-found`,`failed`]),name:N().optional(),collisionRenamedFrom:N().optional(),warnings:I(N()),error:N().optional()}).loose()),imported:P(),alreadyImported:P(),failed:P()}).loose(),L({scope:M7.default(`project`),names:I(N().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...N$,summary:P$}).strict(),L({results:I(L({requested:N(),status:z([`updated`,`up-to-date`,`not-found`,`failed`]),source:N().optional(),warnings:I(N()),error:N().optional()}).loose()),updated:P(),upToDate:P(),failed:P()}).loose();var Jle=L({source:N(),ref:N().optional(),contentHash:N(),publisher:N().optional()}).loose();L({name:N().min(1).meta({description:`Managed skill name created or matched.`}),path:N().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:F().meta({description:`True when this request created new source files.`}),alreadyImported:F().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:N().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:Jle,warnings:I(N()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose();var Yle=`server-info`,Xle=`branch-switched`,Zle=`disk-ack`,Qle=`config-validation-rejected`,$le=`config-ignore-nested-error`,H7=z([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),eue=L({v:B(1),ch:B(Yle),seq:P(),serverInstanceId:N().min(1),currentBranch:N().min(1).optional()}).loose(),tue=L({v:B(1),ch:B(Xle),seq:P(),branch:N().min(1)}).loose(),nue=L({v:B(1),ch:H7,seq:P()}).loose(),rue=L({v:B(1),ch:B(Zle),seq:P(),docName:N().min(1),sv:N().min(1)}).loose(),iue=L({v:B(1),ch:B(Qle),seq:P(),docName:N().min(1),error:$f}).loose(),aue=L({v:B(1),ch:B($le),seq:P(),path:N().min(1),error:N().min(1)}).loose();function oue(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function sue(e){if(typeof e!=`string`||e.length===0)return e;let t=f2(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(s2(e)){let t=oue(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=i2(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var cue=`https://api.github.com/repos/inkeep/open-knowledge`;async function lue(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(cue,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function uue(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new VJ.default;var due=L({path:I($a([N(),P()])),message:N(),issueCode:N()});to(`code`,[L({code:B(`SCHEMA_INVALID`),issues:I(due)}),L({code:B(`WRITE_ERROR`),detail:N()})]);function fue(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function pue(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var U7=/^---[ \t]*\r?\n---[ \t]*(\r?\n|$)/,mue=/^---([ \t]*)(?=\r?\n|$)/,W7=e=>e.includes(`\r
|
|
570
|
+
`),i=voe(t);return n.map(e=>boe(e,r,yoe(e,i)))}function voe(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function yoe(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function boe(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[xoe(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function xoe(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var h5=[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`,`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`,`project-no-mdx`];function g5(e,t){return e?.[t]!==!1}var Soe=[{id:`structure`,ids:[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`]},{id:`frontmatter`,ids:[`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`]},{id:`project`,ids:[`project-no-mdx`]}];function Coe(e){throw Error(`Unhandled OkfRuleId variant: ${JSON.stringify(e)}`)}function woe(e){throw Error(`Unhandled OkfRuleGroupId variant: ${JSON.stringify(e)}`)}var Toe=`.ok/okf`;function Eoe(e){return`${e.replace(/^frontmatter-/,``)}.schema.json`}function _5(e){return`${Toe}/${Eoe(e)}`}var Doe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — required frontmatter`,description:"The OKF v0.2 conformance floor. A bundle is conformant when every non-reserved .md file contains a parseable YAML frontmatter block whose `type` is non-empty. This schema is the whole of that floor: a concept carrying only `type` is fully conformant. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#11-conformance",type:`object`,required:[`type`],properties:{type:{type:`string`,pattern:`\\S`,description:"REQUIRED, and the only always-required key in OKF. A short string identifying the kind of concept; consumers use it for routing, filtering, and presentation. Type values are not registered centrally — pick something descriptive and self-explanatory (`BigQuery Table`, `BigQuery Dataset`, `API Endpoint`, `Metric`, `Playbook`, `Reference`, `Attested Computation`). Consumers must tolerate unknown types, typically by treating them as generic concepts. The `\\S` pattern is what makes §11 rule 2 mean what it says, and it replaces a `minLength` rather than joining one: a length check alone accepts a whitespace-only value that no consumer can route on, and having both would report one mistake twice. OKF v0.2 §4.1, §11."}}},Ooe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — recommended frontmatter`,description:"Shapes for the OKF v0.2 recommended keys. Every key here is optional, and nothing is constrained beyond the shape OKF states: declaring a key pins its YAML type when present (so `tags` written as a comma-separated string warns) and advertises it to agents at read time. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#41-frontmatter",type:`object`,properties:{title:{type:`string`,description:`Human-readable display name. If omitted, consumers MAY derive a title from the filename. OKF v0.2 §4.1.`},description:{type:`string`,description:"A single sentence summarizing the concept. Used by `index.md` generators, search snippets, and previews. OKF v0.2 §4.1."},resource:{type:`string`,format:`uri-reference`,description:"A URI that uniquely identifies the underlying asset the concept describes. Absent for concepts that describe abstract ideas rather than physical resources. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or an ordinary relative path — hence `uri-reference`, not `uri`, which would reject `/tables/customers.md`. OKF v0.2 §4.1, §6.2."},tags:{type:`array`,items:{type:`string`},description:`A YAML list of short strings for cross-cutting categorization. Tags stay a first-class concept through this field; OKF specifies no separate per-tag file format, so a consumer that wants a tag-browsing view synthesizes one by scanning frontmatter. OKF v0.2 §3.1, §4.1.`},timestamp:{description:"LEGACY (OKF v0.1), superseded by `generated.at` in v0.2 — one of the two deliberate breaking changes. Consumers MAY fall back to it when `generated` is absent; new documents SHOULD write `generated: { by, at }` instead. Documented here so agents are told what it is and what replaced it, but deliberately left unconstrained: v0.2 does not define it as a producer field, so validating its shape would be a rule OKF no longer has. OKF v0.2 §5.2, §13.1."}}},koe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — provenance, trust, and lifecycle frontmatter`,description:'The optional OKF v0.2 families that make "where did this come from", "how much should I trust it", and "is it still current" answerable from frontmatter alone. Every key is optional, and absence carries meaning rather than being an error: a concept with no `verified` is unverified, and a consumer must not reject it. Only `sources[].resource` and `generated.by` are required-when-their-parent-is-present, because those are the two fields OKF marks REQUIRED in this family; every other field is described but not mandated, so nothing else is enforced. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#5-provenance-trust-and-lifecycle',type:`object`,properties:{sources:{type:`array`,description:"The materials this concept derives from, external or internal to the bundle. Lineage is expressed through links rather than a dedicated field: when an entry's `resource` points at another OKF concept, the derivation edge already exists in the bundle graph, so a consumer may recurse into that source's own `sources`. OKF v0.2 §5.1.",items:{type:`object`,required:[`resource`],properties:{resource:{type:`string`,description:"REQUIRED within an entry. Either a concrete artifact a consumer can follow (an absolute URL, a bundle-relative path, or a path into a `references/` subdirectory) or a population or scope descriptor it cannot, for example `all queries in BigQuery project X`. Deliberately NOT format-constrained: a scope descriptor is prose, so a `uri-reference` check here would warn on conformant documents. OKF v0.2 §5.1, §6.2, §6.3."},id:{type:`string`,description:"Optional. A stable key used to attribute individual claims: a markdown footnote whose label is this id (`[^ga4-schema]`) attributes the claim it follows. SHOULD be present when the body cites the source. Keyed rather than positional because agents constantly rewrite these documents — a positional index misattributes silently the moment the list is reordered. OKF v0.2 §5.1."},title:{type:`string`,description:`Optional. Human-readable label for the source. OKF v0.2 §5.1.`},author:{type:`string`,description:"Optional credibility signal — an authority signal: who or what produced the source. OKF describes this as following the actor convention (§7), but its own examples use a `team:<id>` prefix that the three §7 forms do not cover, so no pattern is enforced. OKF v0.2 §5.1, §7."},usage_count:{type:`integer`,description:"Optional credibility signal — an adoption and liveness signal: how often `resource` was exercised (dashboard views, query executions, page reads) over `usage_window`. For a single artifact it is that artifact's own exercise count; for a scope descriptor it is the number of exercises within the scope that touch the concept. Coarse by design: comparable at the alive-versus-dead and order-of-magnitude level and against a source's own history, but not a precise cross-kind ranking. Read as liveness and trend, not as a score. OKF v0.2 §5.1."},last_modified:{type:`string`,format:`date`,description:"Optional credibility signal — a recency signal: when the source itself last changed, as `YYYY-MM-DD`. Distinct from `generated.at`, which records when the concept was written. OKF v0.2 §5.1."},usage_window:{type:`object`,description:"Optional per-entry override of the `usage_window` written as a sibling of `sources`. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date`,description:"Start of the window framing this entry's `usage_count`, as `YYYY-MM-DD`. OKF v0.2 §5.1."},to:{type:`string`,format:`date`,description:"End of the window framing this entry's `usage_count`, as `YYYY-MM-DD`. OKF v0.2 §5.1."}}}}}},usage_window:{type:`object`,description:"Written once as a sibling of `sources`, this frames every `usage_count` in the list with a `{ from, to }` date range. A single entry may carry its own `usage_window` to override it. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date`,description:"Start of the shared usage window, as `YYYY-MM-DD`. OKF v0.2 §5.1."},to:{type:`string`,format:`date`,description:"End of the shared usage window, as `YYYY-MM-DD`. OKF v0.2 §5.1."}}},generated:{type:`object`,required:[`by`],description:"How the current content was produced. Kept distinct from `verified` because who wrote a concept need not be who confirmed it. OKF v0.2 §5.2.",properties:{by:{type:`string`,description:"REQUIRED within `generated`. An actor in the OKF convention: `<producer>/<version>` for agents and tools (`reference_agent/gemini-2.5-pro`), `human:<id>` for a person (`human:ahormati`), or `process:<id>` for an automated process (`process:finance-nightly`). Consumers that classify trust key off the `human:` prefix, so producers MUST use it for hand-authored or human-confirmed content — a rule about which form to pick for which content, which frontmatter alone cannot check, so the three forms are documented here rather than enforced by a pattern. OKF v0.2 §5.2, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime marking the content's last meaningful change. Consumers use it to tell a recent edit from a stale fact. Supersedes v0.1's top-level `timestamp`. OKF v0.2 §5.2, §13.1."}}},verified:{description:'Who or what has confirmed the content against its sources or `resource` — a list of verification events. Multiple entries capture independent checks, for example a human sign-off plus a nightly process; "how recently" is the latest `at`. Independent of `generated.at`: content can change without re-confirmation, and facts can be re-confirmed without regeneration. A single verifier MAY be written as one bare `{ by, at }` mapping without the list dash, and consumers MUST treat that as a one-element list — hence the two accepted shapes here. Absence means unverified, which is a valid state, never a rejection. OKF v0.2 §5.2, §5.3, §11.',anyOf:[{type:`object`,description:`The bare single-verifier mapping form. OKF v0.2 §5.2.`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:`ISO 8601 datetime of the verification event. OKF v0.2 §5.2.`}}},{type:`array`,description:`The list form: one entry per independent verification event. OKF v0.2 §5.2.`,items:{type:`object`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:`ISO 8601 datetime of the verification event. OKF v0.2 §5.2.`}}}}]},status:{enum:[`draft`,`stable`,`deprecated`],description:"Lifecycle state. `draft` = not yet reviewed, possibly incomplete. `stable` = ready for consumption. `deprecated` = kept for links and history, no longer current. Absent means `stable`, so the key is only worth writing to say draft or deprecated. These three values are the whole set OKF defines, which is why this is the pack's only enum. OKF v0.2 §5.4."},stale_after:{type:`string`,format:`date`,description:"An absolute date, `YYYY-MM-DD`: the concept is stale when `today >= stale_after`. Absolute rather than a relative TTL so staleness stays a plain date comparison with no reference to when the concept was read. A date in the past is a freshness signal for consumers, not a violation. OKF v0.2 §5.5, §10.5."}}},Aoe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — Attested Computation frontmatter`,description:'Shapes for the OKF v0.2 computation keys, which turn a concept into a sanctioned way to compute a value so a consumer can confirm the agent ran the blessed computation instead of improvising its own. Provenance answers "where did this claim come from"; attestation answers "was this number produced the way we said it must be". This file also carries the one value-shaped rule in the pack: `runtime` is the single key OKF marks REQUIRED here, and only when `type` is `Attested Computation`. Ordinary concepts never match that condition and are unaffected, and no other key in the family is mandated. OKF records the computation and the means to check it and executes nothing itself; receipts and verdicts are runtime artifacts that are never stored in the bundle. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#10-attested-computations-concept',type:`object`,if:{required:[`type`],properties:{type:{const:`Attested Computation`,description:"The condition, not a constraint: everything in `then` applies only to documents whose `type` is exactly `Attested Computation`. An ordinary concept never matches, so nothing in this schema is ever asked of it. `type` is also required inside the condition so a document with no type at all fails the conformance floor once, rather than also being told it is missing a `runtime` for a type it never claimed."}}},then:{required:[`runtime`]},properties:{runtime:{type:`string`,description:"REQUIRED for `type: Attested Computation`. The single field that says how to run the computation, and therefore how the executor and attester interpret it and what `parameters` mean — a parameter is a SQL bind variable, a dbt var, or a Python argument depending on the runtime. Keeping `runtime` and `parameters` in one frontmatter is what makes the binding semantics self-evident. Example values: `bigquery`, `postgres`, `dbt`, `python`, `Looker`. Not a closed set, so no enum. OKF v0.2 §10.1, §10.2."},parameters:{type:`array`,description:`The typed, named holes the agent may fill. An agent MAY only supply values for these parameters; it MUST NOT author or edit the computation. That parameter-only surface is what makes "did the sanctioned thing run" a mechanical comparison rather than a judgement call. OKF v0.2 §10.2, §10.3.`,items:{type:`object`,properties:{name:{type:`string`,description:"The parameter name the computation binds, for example `year` bound as `@year` in BigQuery SQL or `{{ var('year') }}` in dbt. OKF v0.2 §10.2, §10.3."},type:{type:`string`,description:"The parameter's type, interpreted by `runtime` (`integer`, `string`, and so on). Deliberately not constrained to JSON Schema type names, because the vocabulary belongs to the runtime. OKF v0.2 §10.2."},required:{type:`boolean`,description:`Whether the agent must supply a value for this parameter. OKF v0.2 §10.2.`}}}},computation:{type:`string`,format:`uri-reference`,description:"Optional. A path to a file holding the computation, used instead of an inline body fence — best for a long or generated computation, or one already kept as a real file shared with non-OKF tooling. When absent, the body's `# Computation` fence IS the computation. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or a relative path. OKF v0.2 §6.2, §10.2, §10.3."},executor:{type:`object`,description:"How the computation is run. A runner — an agent, or deterministic consumer code — follows `resource`, and the run returns a receipt shaped by `receipt`. Binding the computation with the parameter values into the executable artifact is the consumer's job. OKF v0.2 §10.2, §10.5.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names the run instructions or code. What sits behind it — a Skill, a script, a container — is a packaging choice; OKF fixes the interface, not the packaging. Conventionally points into a `references/` subdirectory, for example `references/skills/run-on-bq.md`. OKF v0.2 §1, §6.2, §6.3, §10.2."},receipt:{type:`array`,items:{type:`string`},description:"Declares the fields a run must return — the evidence the attester inspects, for example `[job_id, executed_sql, result]` for BigQuery or `[run_id, compiled_sql, result]` for dbt. Because the attester compares the expanded, compiled artifact the receipt carries, a rewritten query, a swapped computation file, or a mutated dependency fails the check. The receipt itself is a runtime artifact and is never stored in the bundle. OKF v0.2 §10.2, §10.3, §10.5."}}},attester:{type:`object`,description:"The deterministic check that inspects a receipt and returns a verdict. Meant to run consumer-side. Distinct from `verified`: `verified` confirms the definition still matches policy and is recorded in the bundle, while attestation confirms a single run produced the value the sanctioned way and is not stored. OKF v0.2 §10.2, §10.6.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names code — no LLM — that takes a receipt and returns a verdict, independently re-deriving the binding of `computation` with the claimed parameter values to compare against what actually ran. Conventionally points into a `references/` subdirectory, for example `references/attesters/sql-equality.py`. OKF v0.2 §6.2, §6.3, §10.2, §10.3."}}}}},joe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — index files carry no frontmatter`,description:"`index.md` is a reserved filename at any level of the hierarchy and must not be used for a concept document. Index files contain no frontmatter, with exactly one exception — a bundle-root `index.md` may carry `okf_version` — which the scope carves out with a `!index` exclusion rather than a keyword here. `maxProperties: 0` is the mechanism rather than the boolean schema `false`, because a document with no frontmatter block validates as `{}` and `false` would reject that too, flagging the very documents that are correct. `log.md` is deliberately NOT covered: §9 constrains a log's date headings, ordering, and prose entries but never its frontmatter, and OKF's own reference bundle ships a `log.md` carrying `type` and `title`. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#8-index-files",type:`object`,maxProperties:0},Moe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — bundle-root index.md`,description:"The bundle-root `index.md` is the only index file OKF permits frontmatter in, and `okf_version` is the key it names there. OKF states the declaration as a MAY, so it is not required here. Nor is the frontmatter closed to other keys: §8 grants the exception for `okf_version` specifically, but §11 tells consumers not to reject a bundle over unknown additional keys, and that ambiguity is resolved in favor of the looser reading. The one thing pinned is the value's shape, because a YAML float is provably lossy where a version string is not. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#12-versioning",type:`object`,properties:{okf_version:{type:`string`,pattern:`^[0-9]+\\.[0-9]+$`,description:'The OKF version this bundle targets, as `<major>.<minor>` — currently `"0.2"`. Quote it: unquoted `0.2` parses as a YAML number, so a consumer comparing version strings sees a float instead, and `0.10` would silently become `0.1`. A minor bump is backward-compatible additions; a major bump may rename required fields or change reserved filenames. Consumers that do not understand the declared version should attempt best-effort consumption rather than refusing the bundle. OKF v0.2 §12.'}}},v5=[`**`,`!**/{index,log}`],y5=[{id:`frontmatter-required`,appliesTo:v5,schema:Doe},{id:`frontmatter-recommended`,appliesTo:v5,schema:Ooe},{id:`frontmatter-provenance`,appliesTo:v5,schema:koe},{id:`frontmatter-computation`,appliesTo:v5,schema:Aoe},{id:`frontmatter-reserved-index`,appliesTo:[`**/index`,`!index`],schema:joe},{id:`frontmatter-root-index`,appliesTo:[`index`],schema:Moe}],Noe=Object.fromEntries(h5.filter(e=>!y5.some(t=>t.id===e)).map(e=>[e,!1]));function b5(e,t){return t===void 0?[]:y5.filter(n=>g5(e,n.id)&&a5([...n.appliesTo]).matches(t))}function Poe(e){return y5.filter(t=>g5(e,t.id)).map(e=>({appliesTo:[...e.appliesTo],file:_5(e.id)}))}function Foe(e,t,n){let r=b5(t,n);return r.length===0?[]:p5(e,r.map(e=>({file:_5(e.id),schema:e.schema,ruleId:e.id})),{source:`okf`})}function x5(e,t){return QW(`okf:${e}`,(n,r)=>{try{t(n,r)}catch(t){console.warn(`[lint] OKF rule "${e}" failed${r.data.okfDocName?` on "${r.data.okfDocName}"`:``}`,t)}})}function S5(e,t,n){let r=a5(t);return x5(e,(e,t)=>{r.matches(t.data.okfDocName)&&n(e,t)})}var C5=e=>({line:e.line-1,character:e.column-1});function Ioe(e,t){if(e&&`start`in e)return{start:C5(e.start),end:C5(e.end)};if(e){let n=C5(e);return{start:n,end:{line:n.line,character:t[n.line]?.length??0}}}return{start:{line:0,character:0},end:{line:0,character:t[0]?.length??0}}}function Loe(e,t){return{range:Ioe(e.place,t),severity:`warning`,source:`okf`,code:e.ruleId??`okf`,message:e.reason}}function Roe(e,t,n){if(t.length===0)return[];let r=xe().use(re).use(pe).use(LP,[`yaml`]);for(let e of t)r.use(e);let i=new u({value:e});n!==void 0&&(i.data.okfDocName=n);let a=r.parse(i);r.runSync(a,i);let o=e.split(`
|
|
571
|
+
`);return i.messages.map(e=>Loe(e,o))}var zoe=`**/index`;function Boe(e){let t=!1;return Te(e,[`link`,`linkReference`],()=>(t=!0,!1)),t}var Voe=S5(`index-shape`,zoe,(e,t)=>{let n=!1;for(let r of e.children){if(r.type===`heading`){n=!0;continue}r.type===`list`&&!n&&t.message(`This index list is not under a section heading, so an Open Knowledge Format consumer reading the file as navigation has no name to file its entries under — an index is one or more heading-led sections of bulleted links.`,r)}Te(e,`listItem`,e=>{e.children.some(e=>e.type===`list`)||Boe(e)||t.message(`This index entry has no link, so an Open Knowledge Format consumer reading the file as navigation has nowhere to follow it. Every entry in the format's own reference bundles is a link followed by a short description.`,e)})}),Hoe=`**/log`,Uoe=/^\s*(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(?!\d)/;function Woe(e,t,n){let r=new Date(Date.UTC(e,t-1,n));return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}var Goe=/^\s*\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/;function w5(e){let t=e.trim();return t.length>60?`${t.slice(0,59)}…`:t}var Koe=S5(`log-shape`,Hoe,(e,t)=>{let n;Te(e,`heading`,e=>{if(e.depth!==2)return;let r=be(e),i=Uoe.exec(r);if(!i){t.message(Goe.test(r)?`Log date heading "${w5(r)}" is not in ISO 8601 YYYY-MM-DD form, the one form an Open Knowledge Format log requires of its date headings.`:`Log entry heading "${w5(r)}" is not a date, so it falls outside the dated-entry format an Open Knowledge Format consumer reads a log as — nothing under it reaches the change-history timeline.`,e);return}let a=`${i[1]}-${i[2]}-${i[3]}`;if(!Woe(Number(i[1]),Number(i[2]),Number(i[3]))){t.message(`Log date heading "${a}" is not a real calendar date, so it is not ISO 8601 — the one form an Open Knowledge Format log requires of its date headings.`,e);return}n!==void 0&&a>n&&t.message(`Log date heading "${a}" is newer than the entry above it — an Open Knowledge Format log is a flat list of date-grouped entries, newest first.`,e),n=a})}),qoe=/\[\[[^[\]\n]+\]\]/g;function Joe(e){let t=`Wiki-link ${e} won't resolve for an external Open Knowledge Format consumer — it renders as literal text and its graph edge is lost.`;return e.includes(`|`)?`${t} The alias "|" also splits a GFM table cell.`:t}var Yoe=x5(`no-wiki-links`,(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value);Te(e,`text`,e=>{let r=e.position?.start,i=e.position?.end,a=r?.offset,o=a===void 0||i?.offset===void 0?e.value:n.slice(a,i.offset),s=0,c=r?.line??0,l=r?.column??0,u=e=>{for(;s<e;s+=1)o[s]===`
|
|
572
|
+
`?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(qoe)){let{index:i}=e;if((a===void 0?o[i-1]:n[a+i-1])===`!`)continue;let s=r&&a!==void 0?{start:u(i),end:u(i+e[0].length)}:void 0;t.message(Joe(e[0]),s)}})}),Xoe=[`index`,`log`];function Zoe(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return DX.includes(r)?t.slice(0,n):t}var Qoe=x5(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=Zoe(n),i=r.toLowerCase();Xoe.includes(i)&&r!==i&&t.message(`This file is named "${r}", but the Open Knowledge Format only recognizes "${i}". On a case-sensitive filesystem a consumer reads it as an ordinary concept document rather than the reserved file it is meant to be.`)}),T5=[{id:`no-wiki-links`,rule:Yoe},{id:`log-shape`,rule:Koe},{id:`index-shape`,rule:Voe},{id:`reserved-casing`,rule:Qoe}],$oe=T5.map(e=>e.rule);function ese(e){return e===void 0?$oe:T5.filter(t=>g5(e,t.id)).map(e=>e.rule)}var tse=$a([F(),z(bd),ao(N(),qa())]),nse={id:`markdownlint`,sliceSchema:L({enabled:F(),rules:ao(N(),tse)}),defaultSlice:{enabled:!1,rules:n5},async lint(e,t){return _oe(e,r5(t.rules))},fix(e,t){return goe(e,r5(t.rules))}},rse=L({appliesTo:$a([N(),I(N())]).optional(),file:N(),enabled:F().optional(),key:N().optional(),schema:ao(N(),qa()).optional()}),E5=[nse,{id:`frontmatter`,sliceSchema:L({enabled:F(),schemas:I(rse)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return p5(e,c5(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>c5(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:L({enabled:F(),rules:ao(N(),F()).optional(),generate:L({index:F().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...Roe(e,ese(t.rules),n.docName),...Foe(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>b5(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...Noe}}),advertisedMappings:e=>Poe(e.rules)}}],ise={enabled:!0,plugins:Object.fromEntries(E5.map(e=>[e.id,e.defaultSlice]))};function ase(e,t){return e.enabled&&e.plugins[t]?.enabled===!0}function ose(e,t){if(!e?.enabled||t===void 0||t===``)return[];let n=[];for(let r of E5){if(r.frontmatter===void 0)continue;let i=e.plugins[r.id];i?.enabled===!0&&n.push(...r.frontmatter.schemasForDoc(i,t))}return n}function sse(e){let t=Object.fromEntries(E5.map(t=>{let n=e.plugins[t.id]??t.defaultSlice;return t.frontmatter===void 0?[t.id,{...n,enabled:!1}]:[t.id,t.frontmatter.narrowSliceToFrontmatter(n)]}));return{...e,plugins:t}}var cse=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function lse(e){return cse.has(e)}L({docName:j$,summary:P$,content:N().optional(),...N$}).loose(),L({docName:j$,summary:P$,markdown:N(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(DX).optional(),...N$}).loose(),L({docName:j$,summary:P$,find:N().min(1),replace:N(),offset:P().int().nonnegative().optional(),...N$}).loose(),L({docName:j$,connectionId:N().min(1),scope:z([`last`,`session`,`file`,`count`]).optional(),count:P().int().positive().optional(),...N$}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var D5=L({value:N(),truncatedFrom:P().int().nonnegative().optional(),hint:N().optional()}).loose(),use=to(`kind`,[L({kind:B(`inline`),content:N()}),L({kind:B(`truncated`),byteLength:P().int().nonnegative(),hint:N()})]),O5=L({kind:B(`content-divergence`),intendedBytes:P().int().nonnegative(),actualBytes:P().int().nonnegative(),byteDelta:P().int(),divergenceType:N().optional(),currentState:use.optional(),hint:N().optional()}).loose(),dse=L({type:B(`orphan`),parentCandidates:I(N()),message:N()}).loose(),k5=L({kind:B(`disk-edit-reconciled`),intendedBytes:P().int().nonnegative(),actualBytes:P().int().nonnegative(),byteDelta:P().int(),mergeOutcome:N().optional(),hint:N().optional()}).loose(),A5=to(`kind`,[O5,k5]),fse=L({kind:B(`mermaid-parse-error`),fenceIndex:P().int().positive(),fenceFirstLine:N(),message:N(),line:P().int().positive().optional()}).loose(),j5=L({href:N(),targetKind:N(),role:N(),sourceForm:N(),resolvedTarget:N().nullable(),reason:N(),resolutionMethod:N(),fallbackTarget:N().nullable().optional(),definition:L({line:P().int().nonnegative(),label:N()}).loose().optional()}).loose(),M5=I(to(`kind`,[O5,k5,fse,L({kind:B(`lint-violation`),source:N(),code:N(),message:N(),severity:z([`error`,`warning`,`info`,`hint`]),line:P().int().positive(),column:P().int().positive(),linkTarget:N().optional(),localTarget:j5.optional()}).loose()])).min(1),N5=I(L({href:N(),resolvedTo:N().nullable(),reason:z([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:j5.optional()}).loose());L({timestamp:N().min(1),summary:D5.optional(),warning:A5.optional(),warnings:M5.optional()}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),hints:I(dse).optional(),summary:D5.optional(),warning:A5.optional(),warnings:M5.optional(),brokenLinks:N5}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),summary:D5.optional(),warning:A5.optional(),warnings:M5.optional(),brokenLinks:N5}).loose(),L({docName:N().min(1),scope:z([`last`,`session`,`count`]),undone:F()}).loose(),L({docs:I(L({docName:M$,markdown:N(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(DX).optional(),summary:P$}).loose()).min(1).max(100),...N$}).loose();var pse=L({type:e1,title:N(),detail:N().optional()}).loose(),mse=to(`status`,[L({status:B(`written`),docName:N().min(1),summary:D5.optional(),warnings:M5.optional(),brokenLinks:N5}).loose(),L({status:B(`error`),docName:N().min(1),error:pse}).loose()]);L({timestamp:N().min(1),results:I(mse),written:P().int().nonnegative(),failed:P().int().nonnegative()}).loose(),L({docName:j$,patch:ao(N(),$a([fm,Ga()])),types:ao(N(),z(lm)).optional(),summary:P$,...N$}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),appliedKeys:I(N()),summary:D5.optional(),warning:A5.optional(),warnings:M5.optional(),brokenLinks:N5}).loose();function hse(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??n5},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]},okf:{enabled:e.okf?.enabled??!1,...e.okf?.rules===void 0?{}:{rules:e.okf.rules},generate:{index:e.okf?.generate?.index??!1}}}}}var gse=Object.fromEntries(E5.map(e=>[e.id,e.sliceSchema])),_se=L({effective:L({enabled:F(),plugins:L(gse)}),configFile:N().nullable().optional(),configProblems:I(N()).optional()}),vse=$a([F(),ao(N(),qa())]);L({ruleId:N().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:$a([vse,Ga()])}),L({file:N().min(1).max(512),delete:B(!0).optional(),field:N().min(1).max(256).optional(),parentPath:I($a([N().min(1).max(256),L({items:B(!0)}).strict()])).max(8).optional(),removeField:B(!0).optional(),renameTo:N().min(1).max(256).optional(),constraint:L({type:z([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:I($a([N(),P(),F()])).nullable().optional(),itemsEnum:I($a([N(),P(),F()])).nullable().optional(),itemsType:z([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:N().nullable().optional(),format:N().nullable().optional(),description:N().max(2048).nullable().optional(),required:F().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var yse=L({schemas:I(N()),truncated:F()}).strict(),P5=L({line:P(),character:P()}),F5=L({start:P5,end:P5}),I5=L({range:F5,severity:z([`error`,`warning`,`info`,`hint`]),source:N(),code:N(),message:N(),fixes:I(L({range:F5,newText:N()})).optional(),frontmatterScope:z(gd).optional(),frontmatterProperty:N().optional()}),L5=I(N()).optional();L({files:I(L({file:N(),diagnostics:I(I5),ran:L5,warnings:I(N()).optional()})),fileCount:P(),errorCount:P(),warningCount:P(),warnings:I(N()),ran:L5});var bse=I5.extend({linkTarget:N().optional(),localTarget:j5.optional()}),xse=L({files:I(L({file:N(),diagnostics:I(bse)})),fileCount:P(),errorCount:P(),warningCount:P(),warnings:I(N()),ran:L5}),R5=L({errorCount:P().int().nonnegative(),warningCount:P().int().nonnegative()}),Sse=L({files:I(L({file:N(),lint:R5,links:R5})),fileCount:P().int().nonnegative(),errorCount:P().int().nonnegative(),warningCount:P().int().nonnegative(),warnings:I(N())});L({docName:j$,summary:P$,...N$}).loose();var Cse=L({file:N(),fixedCount:P(),diagnostics:I(I5),errorCount:P(),warningCount:P(),ran:L5,warnings:I(N()).optional(),warning:N().optional()});function wse(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function Tse(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:wse(e)&&t.endsWith(`.json`)}var z5=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],Ese=(()=>{let e=new Map;for(let t of z5){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function B5(e){return Ese.get(e.toUpperCase())??null}function Dse(e,t){let n=B5(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))B5(t)===n&&(r={key:t,value:i});return r}var Ose=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],kse=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function Ase(e){for(let[t,n]of kse)if(e.tags.includes(t))return n;return`Style`}function jse(e){let t={lint:{errorCount:0,warningCount:0},links:{errorCount:0,warningCount:0}};for(let n of e){let e=n.source===`links`?t.links:t.lint;n.severity===`error`?e.errorCount+=1:e.warningCount+=1}return t}async function Mse(e,t,n,r){if(!t.enabled)return[];let i=[];for(let a of E5){if(!ase(t,a.id))continue;let o=t.plugins[a.id];try{i.push(...await a.lint(e,o,{docName:n}))}catch(e){console.warn(`[lint] plugin "${a.id}" failed${n?` on "${n}"`:``}`,e),r?.({source:a.id,phase:`lint`,...n===void 0?{}:{docName:n},message:Nse(e)})}}return i}var V5=500;function Nse(e){let t=H5(e);return t.length>V5?`${t.slice(0,V5)}… (truncated)`:t}function H5(e,t=0){if(e instanceof Error)return e.cause===void 0||t>=3?e.message:`${e.message} (cause: ${H5(e.cause,t+1)})`;if(typeof e==`object`&&e)try{let t=JSON.stringify(e);if(t!==void 0)return t}catch{}return String(e)}var Pse=/\p{M}+/gu,Fse=/[^\p{L}\p{N}]+/gu,Ise=/^-+|-+$/g;function U5(e){return e.trim().normalize(`NFKD`).replace(Pse,``).toLowerCase().replace(Fse,`-`).replace(Ise,``)}function Lse(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function W5(e,t){let n=U5(e);return n?Lse(n,t):``}function G5(e,t){let n=U5(e);return t?`#${n}-${U5(t)}`:`#${n}`}var K5=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]),Rse=new Map(B2.flatMap(e=>e.surface===`compat`&&K5.has(e.rendersAs)?[[e.name,e]]:[]));function q5(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function J5(e){let t=e.name;if(!t||!K5.has(t))return null;let n=q5(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function Y5(e){let t=e.name;if(!t)return null;let n=Rse.get(t);if(!n)return null;let r=q5(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var zse=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:G5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Bse=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:G5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Vse=(e,t)=>{let n=t,r=J5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=Y5(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},Hse=(e,t)=>{let n=t,r=J5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=Y5(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Use=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Wse=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},Gse=(e,t)=>{let n=t,r={type:`element`,tagName:n.data?.sourceForm===`ins`?`ins`:`u`,properties:{},children:e.all(n)};return e.patch(t,r),e.applyData(t,r)};function X5(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(X5).join(``):``}var Z5={wikiLink:zse,wikiLinkEmbed:Bse,mdxJsxFlowElement:Vse,mdxJsxTextElement:Hse,rawMdxFallback:Use,mark:Wse,underline:Gse,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:X5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:X5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Kse=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,qse=/\bexpression\s*\(/i,Jse=1e4;function Yse(e){return!(e.length>Jse||Kse.test(e)||qse.test(e))}function Q5(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!dZ(e.split(/\s+/)[0]??``))return!1}return!0}var Xse={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},Zse=new Set([`href`,`src`]),Qse=g(`<>`),$5=()=>e=>{Te(e,`element`,e=>{let t=Xse[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?f3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(Zse.has(e))if(t===`<>`||t===Qse)r=``;else{let e=f3(t);r=e===t?t:g(e)}else r=f3(t);r!==t&&(n[e]=r)}})},e7=()=>e=>{Te(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!dZ(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!dZ(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!dZ(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!Q5(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!Q5(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!dZ(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Yse(r)&&delete n.style})};function $se(e){let t=xe().use(A,{handlers:Z5}).use($5).use(e7).use(eG),n=t.runSync(e);return String(t.stringify(n))}function ece(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(t7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(t7(e.slice(r),r>0,!1)),n.join(``)}function t7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var n7=/\r?\n|\r/,tce=(e,t)=>{let n=ece(String(t.value));if(!n7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(n7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function nce(e){let t=xe().use(re).use(LP,[`yaml`]).use(d8).use(pe).use(j8).use(a3).use(y8).use(b3).use(A,{handlers:{...Z5,text:tce}}).use($5).use(e7).use(eG);return String(t.processSync(r3(y3(e))))}uI(),kF(),AF(),L({entries:I(L({level:z([`info`,`warn`,`error`]),message:N().max(nY),event:N().optional(),fields:ao(N(),qa()).optional(),ts:P().optional(),sourceId:N().optional(),lineNumber:P().optional()}).loose()).max(100),droppedSinceLastFlush:P().int().min(0).optional()}).loose(),L({accepted:P().int().min(0)}).loose();var rce=L({exact:N().min(1),prefix:N(),suffix:N(),start:P().int().nonnegative(),end:P().int().nonnegative()}),ice=I($a([N(),P().int().nonnegative()])),ace=to(`kind`,[L({kind:B(`body`)}),L({kind:B(`property`),key:N().min(1),path:ice.default([])})]).default({kind:`body`}),oce=z([`anchored`,`orphaned`,`resolved`]),r7=L({threadId:N().min(1),docName:N().min(1),target:ace,anchor:rce.nullable(),state:oce,queued:F(),latestComment:N(),createdBy:N().min(1),createdAt:P(),updatedAt:P().optional()}),i7=L({docName:N(),instruction:N(),property:N().nullable(),passage:L({exact:N(),prefix:N(),suffix:N()}).nullable(),anchorLost:F(),passageRepeats:F()}).loose(),a7=L({threadId:N(),ok:B(!0)}),o7=L({threadId:N(),ok:B(!1),error:B(`not-found`)});L({threads:I(r7)}).loose();var sce=L({meta:r7,orphaned:F()}).loose(),cce=L({threadId:N()}).loose();L({meta:r7,payload:i7}).loose();var lce=L({results:I($a([a7.extend({meta:r7,payload:i7}),o7]))}).loose(),uce=L({results:I($a([a7.extend({meta:r7}),o7]))}).loose(),dce=L({status:N().min(1),reason:N()}).loose(),fce=L({docName:N().min(1),content:N(),lifecycle:dce.nullable()}).loose(),s7=L({kind:z([`document`,`asset`,`folder`,`file`]).default(`document`),docName:N().min(1).optional(),docExt:N().min(1).default(`.md`),size:P().int().nonnegative(),modified:N().min(1),isSymlink:F().default(!1),canonicalDocName:N().nullable().default(null),targetPath:N().nullable().default(null),path:N().min(1).optional(),assetExt:N().min(1).optional(),mediaKind:z([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:I(N().min(1)).optional(),hasChildren:F().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.hasChildren===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.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),pce=L({documents:I(s7),truncated:F().optional()}).loose(),mce=L({source:N().min(1),anchor:N().nullable(),title:N(),snippet:N().nullable()}).loose(),hce=L({docName:N().min(1),backlinks:I(mce)}).loose(),gce=L({counts:ao(N().min(1),P().int().nonnegative())}).loose();L({counts:ao(N().min(1),P().int().nonnegative())}).loose();var _ce=to(`kind`,[L({kind:B(`doc`),docName:N().min(1),anchor:N().nullable(),title:N(),snippet:N().nullable()}).loose(),L({kind:B(`external`),url:N().min(1),title:N(),snippet:N().nullable()}).loose()]),vce=L({role:N().min(1),sourceForm:N().min(1),targetKind:N().min(1),href:N(),resolvedTarget:N().nullable(),status:N().min(1),reason:N().nullable(),resolutionMethod:N().min(1),fallbackTarget:N().nullable().default(null),range:L({start:P().int().nonnegative(),end:P().int().nonnegative()}),line:P().int().nonnegative(),column:P().int().nonnegative(),definition:L({label:N(),line:P().int().nonnegative()}).nullable().default(null)}).loose(),yce=L({docName:N().min(1),forwardLinks:I(_ce),localTargets:I(vce).optional()}).loose(),bce=to(`kind`,[L({id:N().min(1),kind:B(`doc`),docName:N().min(1),anchor:N().nullable(),label:N(),cluster:N().nullable(),category:N().nullable(),tags:I(N()).nullable(),managed:F().optional()}).loose(),L({id:N().min(1),kind:B(`external`),url:N().min(1),label:N()}).loose()]),xce=L({source:N().min(1),target:N().min(1)}).loose(),Sce=L({nodes:I(bce),links:I(xce)}).loose(),Cce=L({ts:P().int().min(0),url:N(),method:N(),ua:N().optional(),origin:N().optional(),referer:N().optional(),host:N().optional(),remote:N().optional(),secChUa:N().optional(),secChUaMobile:N().optional(),secChUaPlatform:N().optional(),secFetchSite:N().optional(),secFetchDest:N().optional(),secFetchMode:N().optional(),secFetchUser:N().optional()}).loose(),wce=L({app:$a([B(`cursor`),B(`codex`),B(`claude`),Ga()]),signals_fired:I(N())}).loose();L({entries:I(Cce),count:P().int().min(0),detection:wce}).loose();var c7=L({path:N().min(1),code:z([`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `]),origPath:N().min(1).optional(),syncScoped:F(),open:to(`kind`,[L({kind:B(`doc`),docName:N().min(1)}),L({kind:B(`asset`),path:N().min(1)})]).optional()}).loose();L({branch:N().nullable(),detached:F(),upstream:N().nullable(),staged:I(c7),notStaged:I(c7),untracked:I(c7),incoming:I(c7),truncated:F(),readable:F().default(!0)}).loose(),L({writers:I(L({id:N().min(1),name:N().optional(),email:N().optional()}).loose()).optional(),summary:P$,...N$}).loose(),L({checkpointRef:N().min(1)}).loose();var Tce=L({v:P().int().optional(),id:N().min(1),name:N().min(1),colorSeed:N().optional(),docs:I(N()),summaries:I(N()).optional()}).loose();L({entries:I(L({sha:N().min(1),timestamp:N().min(1),author:N(),authorEmail:N(),type:z([`checkpoint`,`wip`,`upstream`,`park`]),message:N(),contributors:I(Tce),checkpoint:qa().nullable(),parentSha:N().nullable().optional()}).loose()),total:P().int().nonnegative().optional(),truncated:F().optional(),hasMore:F().optional()}).loose(),L({sha:N().regex(/^[0-9a-f]{40}$/i),content:N(),timestamp:N(),author:N()}).loose();var Ece=L({contentDir:N().min(1),pathSeparator:z([`/`,`\\`]),symlinkResolved:F()}).loose();I(to(`source`,[L({docName:N().min(1),timestamp:N().min(1),size:P().int().nonnegative(),source:B(`flat`)}).loose(),L({docName:N().min(1),timestamp:N().min(1),source:B(`timeline`),sha:N().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var Dce=L({domain:N().min(1),title:N().optional(),description:N().optional(),siteName:N().optional(),faviconDataUri:N().optional()}).loose();L({url:N()}).loose();var Oce=to(`ok`,[L({ok:B(!0),metadata:Dce}).loose(),L({ok:B(!1),reason:N()}).loose()]),kce=L({orphans:I(L({docName:N().min(1),title:N()}).loose())}).loose(),Ace=L({hubs:I(L({docName:N().min(1),title:N(),count:P().int().nonnegative()}).loose())}).loose(),jce=L({source:N().min(1),title:N(),snippet:N().nullable()}).loose();L({deadLinks:I(L({target:N().min(1),sources:I(jce)}).loose())}).loose(),L({target:L({docName:N().min(1),title:N(),aliases:I(N())}).loose(),mentions:I(L({source:N().min(1),excerpt:N(),offset:P().int().nonnegative()}).loose()),truncated:F()}).loose(),L({projectPath:N().min(1)}).loose();var Mce=z([`not-a-git-worktree`,`init-failed`]);to(`ok`,[L({ok:B(!0),projectPath:N().min(1)}).loose(),L({ok:B(!1),reason:Mce,message:N().min(1)}).loose()]),L({host:N().min(1).optional()}).loose(),L({host:N().min(1).optional(),token:N().min(1)}).loose(),L({host:N(),login:N()}).loose(),L({key:N().min(1)}).loose(),L({keyPresent:F()}).loose();var Nce=z([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),Pce=to(`ok`,[L({ok:B(!0),endpoint:N().min(1),model:N().min(1),dimensions:P().int().positive()}).loose(),L({ok:B(!1),endpoint:N().min(1),model:N().min(1),reason:Nce,status:P().int().optional()}).loose()]);L({name:N().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:N().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),L({authenticated:F()}).loose(),L({channel:z([`login`,`gh-login`]).default(`login`)}).loose(),L({}).loose();var l7=65536;function u7(e){let t=e.match(rm);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function Fce(e){if(e.trim()===``)return{doc:new tl({}),map:{}};let t;try{t=fu(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new tl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=_m.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function d7(e){return e===``?{doc:new tl({}),map:{}}:Fce(sm(e))}function f7(e){let{fenced:t}=u7(e),{map:n,parseError:r}=d7(t);return{map:n??{},parseError:r}}function p7(e){let{fenced:t}=u7(e);if(t===``)return[];let{doc:n,map:r}=d7(t);return r===null?[]:_7(n)}function m7(e){return typeof e==`object`&&!!e&&`key`in e}function h7(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function g7(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function _7(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!m7(e))continue;let t=h7(e);t!==null&&n.push(t)}return n}function v7(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function Ice(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:Tm(e.toString(xm))}function Lce(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:l7}:null}function y7(e){let t=Ice(e),n=Lce(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function Rce(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:cm}};let{doc:n,map:r}=d7(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{v7(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=fm.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,wm(n,n.get(e,!0),t.data))}return y7(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function zce(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:cm}};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>m7(e)&&h7(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>m7(e)&&e!==s&&h7(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return g7(s,n),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function b7(e,t){let{doc:n,map:r}=d7(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=_7(n);if(a.length!==t.length||!x7(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(m7),r=[];for(let n of t){let i=e.findIndex(e=>h7(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,y7(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function x7(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function S7(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:cm}:null}function Bce(e,t,n){let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=fm.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return v7(i),i.setIn(t,wm(i,i.getIn(t,!0),o.data)),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Vce(e,t){let n=S7(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=d7(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),y7(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Hce(e,t){if(t.length===0){let t=e.contents;return qo(t)?t:null}let n=e.getIn(t,!0);return qo(n)?n:null}function Uce(e,t,n,r={}){let i=S7(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:cm}};let{doc:o,map:s}=d7(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=Hce(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>m7(e)&&h7(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>m7(e)&&e!==l&&h7(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return g7(l,n),y7(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Wce(e,t,n){if(t.length===0)return b7(e,n);let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!qo(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!m7(e))continue;let t=h7(e);t!==null&&s.push(t)}if(s.length!==n.length||!x7(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(m7),t=[];for(let r of n){let i=e.findIndex(e=>h7(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Gce(e,t,n){let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Xo(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!Kce(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Kce(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var qce=L({changes:I(to(`kind`,[L({key:N(),kind:B(`added`),after:fm}).loose(),L({key:N(),kind:B(`removed`),before:fm}).loose(),L({key:N(),kind:B(`changed`),before:fm,after:fm}).loose()])),unparseable:L({before:N(),after:N()}).loose().nullable()}).loose();function C7(e){let{fenced:t}=u7(e),n=d7(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=Em(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function Jce(e,t){let n=C7(e),r=C7(t);if(n.parseError!==void 0||r.parseError!==void 0)return{changes:[],unparseable:{before:n.fenced,after:r.fenced}};let i=[],a=new Set;for(let e of r.keys){if(a.has(e))continue;a.add(e);let t=r.map[e];if(t===void 0)continue;let o=n.map[e];if(o===void 0){i.push({key:e,kind:`added`,after:t});continue}bm(o,t)||i.push({key:e,kind:`changed`,before:o,after:t})}for(let e of n.keys){if(a.has(e))continue;a.add(e);let t=n.map[e];t!==void 0&&i.push({key:e,kind:`removed`,before:t})}return{changes:i,unparseable:null}}var Yce=L({stackIndex:P().int().min(0),ts:P().int().min(0),additions:P().int().min(0),deletions:P().int().min(0)}).loose(),Xce=L({docName:N().min(1),additionsTotal:P().int().min(0),deletionsTotal:P().int().min(0),lastTs:P().int().min(0),bursts:I(Yce)}).loose(),Zce=L({displayName:N().min(1),color:N().min(1),icon:N().optional(),connectionId:N().min(1)}).loose(),Qce=L({sessionAlive:F(),agent:Zce.nullable(),files:I(Xce)}).loose(),$ce=L({diff:N(),before:N(),after:N(),properties:qce,generatedAt:P().int().min(0)}).loose();L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose();var ele=L({displayName:N().min(1),icon:N(),color:N().min(1),currentDoc:N().nullable(),mode:z([`idle`,`writing`]),ts:P().int().min(0)}).loose();L({presence:ao(N().min(1),ele)}).loose();var tle=L({sessionId:N().min(1),agentType:N().min(1),ts:P().int().min(0),insertedChars:P().int().min(0),deletedChars:P().int().min(0)}).loose();L({effects:I(L({"doc.name":N().min(1),entries:I(tle)}).loose())}).loose(),L({decisions:I(L({ts:P().int().min(0),decision:N().min(1),kind:N().min(1),"doc.name":N().min(1),pathRole:N().min(1)}).loose())}).loose(),ao(N().min(1),F()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),L({path:N().min(1,`path must be non-empty`)}).loose(),L({}).loose();var nle=L({fromDocName:N().min(1),toDocName:N().min(1)}).loose(),rle=L({fromPath:N().min(1),toPath:N().min(1)}).loose();L({}).loose(),L({path:N().min(1),...N$,summary:P$}).loose();var ile=L({docName:N().min(1)}).loose();L({path:N().min(1),...N$,summary:P$}).loose();var ale=L({path:N().min(1)}).loose();L({kind:z([`file`,`folder`]),path:N().min(1),...N$,summary:P$}).loose();var ole=L({kind:z([`file`,`folder`]),path:N().min(1),duplicatedDocNames:I(N().min(1))}).loose(),sle=L({pages:I(L({docName:N().min(1),title:N(),docExt:N().min(1),size:P().int().nonnegative(),modified:N().min(1),icon:N().min(1).max(2048).optional()}).loose())}).loose(),cle=L({level:P().int().min(1).max(6),text:N(),slug:N()}).loose(),lle=L({docName:N().min(1),headings:I(cle)}).loose(),ule=L({docName:N().min(1),rewrites:P().int().nonnegative()}).loose();L({kind:z([`file`,`folder`,`asset`]),fromPath:N().min(1),toPath:N().min(1),...N$,summary:P$}).loose();var dle=L({renamed:I(nle),renamedAssets:I(rle),rewrittenDocs:I(ule).optional(),summary:D5.optional()}).loose();L({kind:z([`file`,`folder`,`asset`]),path:N().min(1),...N$}).loose();var fle=L({deletedDocNames:I(N().min(1))}).loose();L({kind:z([`file`,`folder`,`asset`]),path:N().min(1),...N$,summary:P$}).loose();var ple=L({deletedDocNames:I(N().min(1))}).loose();L({docName:N().min(1),commitSha:N().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:P$,...N$}).loose(),L({restoredFrom:N().min(1),timestamp:N().min(1),summary:D5.optional(),warning:O5.optional(),warnings:M5.optional()}).loose();var mle=/^#[0-9a-fA-F]{6}$/,hle=L(Object.fromEntries(xd.map(e=>[e,N().regex(mle,`must be a #rrggbb hex color`)]))),w7=N().min(1).refine(Td,{message:`must contain a non-whitespace character`}),T7=L({name:w7,author:w7.optional(),variant:z([`dark`,`light`]),palette:hle}).loose(),gle=L({name:N().min(1),scheme:T7,stem:N().min(1).optional(),extension:z([`.yaml`,`.yml`]).optional()}).loose(),_le=L({id:N().min(1),filename:N().min(1)}).loose(),vle=L({id:N().min(1),scheme:T7}).loose(),yle=L({id:N().min(1),filename:N().min(1)}).loose(),ble=to(`existed`,[L({existed:B(!1)}).loose(),L({existed:B(!0),filename:N().min(1),scheme:T7}).loose()]),xle=L({themes:I(to(`ok`,[L({ok:B(!0),id:N().min(1),filename:N().min(1),scheme:T7}),L({ok:B(!1),filename:N().min(1),id:N().min(1).optional(),code:N().min(1),conflictingFilenames:I(N().min(1)).min(2).optional()})])),truncated:F()}).loose(),Sle=z([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Cle=L({label:N().min(1),webUrl:wa().nullable()}).loose(),wle=to(`checkStatus`,[L({checkStatus:B(`allowed`)}).loose(),L({checkStatus:B(`denied`),deniedReason:z([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:N().optional(),declaredLogin:N().optional(),declaredSource:N().optional()}).loose(),L({checkStatus:B(`unknown`),unknownError:z([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),E7=z([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Tle=z(mu),Ele=z([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);L({state:Sle,lastSyncUtc:N().nullable(),lastRunUtc:N().nullable().optional(),lastPullOkUtc:N().nullable().optional(),lastPushOkUtc:N().nullable().optional(),lastFetchUtc:N().nullable(),lastPushedSha:N().nullable(),ahead:P().int().min(0),behind:P().int().min(0),consecutiveFailures:P().int().min(0),conflictCount:P().int().min(0),hasRemote:F(),syncEnabled:F(),identityUnresolved:F(),remote:Cle.nullable().optional(),pushError:N().optional(),pushErrorCode:E7.optional(),pullError:N().optional(),pullErrorCode:E7.optional(),pausedReason:N().optional(),blockingPaths:I(N().min(1)).optional(),pushPermission:wle.optional(),syncMode:Tle.optional(),lastPullUtc:N().nullable().optional(),lastPullOutcome:Ele.nullable().optional()}).loose(),L({action:z([`commit`]),paths:I(N().min(1)),commitSha:N().optional()}).loose(),L({action:z([`commit`])}).loose(),L({op:z([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),L({op:z([`sync`,`push`,`pull`,`fetch`])}).loose(),L({conflicts:I(L({file:N().min(1),detectedAt:N().min(1),oursSha:N().optional(),theirsSha:N().optional(),baseSha:N().optional()}).loose())}).loose(),L({file:N().min(1),strategy:z([`mine`,`theirs`,`content`,`delete`]),content:N().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),L({}).loose(),L({file:N().min(1),base:N(),ours:N(),theirs:N(),kind:z([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:N().nullable()}).loose(),L({plan:No(e=>e!==void 0,{message:`plan is required`})}).loose(),L({plan:No(e=>e!==void 0,{message:`plan is required`})}).loose(),L({result:No(e=>e!==void 0,{message:`result is required`})}).loose(),L({packId:N().min(1)}).strict(),L({installedHosts:I(N()),skills:I(L({name:N().min(1),created:F()}).strict())}).strict();var Dle=L({path:N().min(1),summary:N().min(1)}).loose(),Ole=L({files:P().int().nonnegative(),folders:P().int().nonnegative()}).loose();L({packs:I(L({id:N().min(1),name:N().min(1),description:N().min(1),defaultSubfolder:N().optional(),folders:I(Dle),entryCounts:Ole}).loose())}).loose(),L({noOpen:F().optional(),out:N().min(1).optional()}).loose();var kle=L({reason:z([`unsupported-platform`,`spawn-error`]),message:N()}).loose();to(`status`,[L({status:B(`installed`),outputPath:N(),size:P().int().nonnegative(),sha256:N(),skillVersion:N()}).loose(),L({status:B(`built`),outputPath:N(),size:P().int().nonnegative(),sha256:N(),skillVersion:N(),handoffError:kle.optional()}).loose(),L({status:B(`failed`),buildError:N()}).loose(),L({status:B(`skip-current`),skillVersion:N(),recordedAt:N().optional()}).loose()]);var D7=z(Wp),O7=z(Gp);function k7(e){return e===`agents`||Gp.includes(e)}var Ale=L({alwaysOn:P().int().nonnegative(),onTrigger:P().int().nonnegative(),onDemand:P().int().nonnegative()}).strict(),jle=[`.md`,`.mdx`,`.txt`],Mle=5e3,Nle=4;function A7(e){return Math.round(e/Nle)}function Ple(e){let t=e.lastIndexOf(`.`);return t===-1?!1:jle.includes(e.slice(t).toLowerCase())}function Fle(e){let t=A7((e.name??``).length+(e.description??``).length),n=A7(am(e.skillMd).body.length),r=e.files.some(e=>e.relPath===`overlay.yaml`),i=0;for(let t of e.files)t.content!==null&&t.relPath!==`SKILL.md`&&(r&&t.relPath.startsWith(`upstream/`)||Ple(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:A7(i)}}L({tags:I(L({name:N().min(1),count:P().int().nonnegative(),isLeaf:F()}).loose())}).loose();var Ile=L({docName:N().min(1),title:N(),matchingTags:I(N().min(1)),snippet:N().nullable()}).loose();L({name:N().min(1),docs:I(Ile)}).loose(),L({folder:qa(),frontmatter_local:ao(N(),qa()).nullable()}).loose(),L({path:N(),frontmatter:ao(N(),qa()).optional()}).loose(),L({applied:qa()}).loose();var j7=ao(N(),qa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});L({template:L({name:N().min(1),folder:N(),scope:z([`local`,`inherited`]),path:N().min(1),frontmatter:j7,body:N()}).strict()}).strict();var Lle=L({templates:I(L({name:N().min(1),title:N().optional(),description:N().optional(),path:N().min(1),source_folder:N()}).strict()),truncated:F()}).strict();L({folder:N(),name:N(),body:N().optional(),frontmatter:j7.optional(),...N$,summary:P$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({sourcePath:N().min(1),targetFolder:N(),name:N().optional(),title:N().optional(),deleteSource:F().optional(),...N$,summary:P$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({existed:F(),path:N().min(1)}).strict(),L({fromFolder:N(),fromName:N(),toFolder:N(),toName:N(),body:N().optional(),frontmatter:j7.optional(),...N$,summary:P$}).strict(),L({from:N().min(1),to:N().min(1),committed:F()}).strict();var M7=z(hp),Rle=/^[a-z0-9-]+$/,zle=/^[A-Za-z0-9_-]+$/,N7=L({name:N(),description:N(),metadata:L({pack:N()}).strict().optional()}).strict();L({skill:L({name:N().min(1),scope:M7,path:N().min(1),frontmatter:N7,body:N(),files:I(L({path:N().min(1),text:N().nullable()})).optional(),managed:F().optional()}).strict()}).strict();var Ble=L({source:N().min(1),publisher:N().optional(),skill:N().optional(),marketplaceUrl:N().optional(),importedAt:N().min(1),autoUpdate:F().optional()}).strict(),Vle=L({name:N().min(1),description:N().optional(),scope:M7,path:N().min(1),canonicalPath:N().min(1).optional(),filePaths:I(N()).optional(),absolutePath:N().min(1).optional(),installed:F(),hosts:I(N()),hostQualifier:N().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:I(N()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:ao(N(),N()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:I(N()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:I(N()).optional(),installableEditors:I(N()).optional(),linkMode:F().optional(),customPlacements:I(L({path:N(),mode:z([`copy`,`link`])}).strict()).optional(),plugin:L({name:N().min(1),marketplace:N().min(1),provider:N().min(1),url:N().optional()}).strict().optional(),managed:F().optional(),origin:Ble.optional(),pack:N().optional(),modified:F().optional(),revertable:F().optional(),ignored:F().optional(),size:Ale.optional()}).strict();L({name:N().min(1),scope:M7,apply:F().optional()}).strict(),L({line:N().min(1),gitignorePath:N().min(1),applied:F(),alreadyTracked:F().optional()}).strict();var Hle=L({skills:I(Vle),truncated:F()}).strict();L({scope:M7.default(`project`),name:N().meta({description:`Managed skill name to create or update.`}),body:N().optional(),frontmatter:N7,...N$,summary:P$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({scope:M7.default(`project`),name:N(),dryRun:F().optional(),setAutoUpdate:F().optional(),...N$,summary:P$}).strict(),L({name:N().min(1),updated:F(),source:N().min(1),localBody:N().optional(),upstreamBody:N().optional(),gitTracked:F().optional(),warnings:I(N())}).strict(),L({scope:M7.default(`project`),name:N(),...N$,summary:P$}).strict(),L({name:N().min(1),baselineRef:N().min(1),restoredFiles:I(N()),warnings:I(N())}).strict(),L({existed:F(),path:N().min(1)}).strict(),L({scope:M7.default(`project`),fromName:N(),toName:N(),body:N().optional(),frontmatter:N7.optional(),...N$,summary:P$}).strict(),L({from:N().min(1),to:N().min(1),committed:F()}).strict(),L({name:N(),fromScope:M7,toScope:M7,...N$,summary:P$}).strict(),L({scope:M7,path:N().optional()}).strict(),L({scope:M7,name:N(),toName:N(),...N$,summary:P$}).strict(),L({name:N().min(1)}).strict(),L({name:N(),home:N().min(1)}).strict(),L({docName:N().min(1)}).strict();var P7=z([`reference`,`script`,`file`]);L({scope:M7.default(`project`),name:N(),path:N().min(1),content:N(),...N$,summary:P$}).strict(),L({path:N().min(1),created:F(),kind:P7,content:F()}).strict(),L({scope:M7.default(`project`),name:N(),from:N().min(1),to:N().min(1),...N$,summary:P$}).strict(),L({from:N().min(1),to:N().min(1),fromDocName:N().optional(),toDocName:N().optional()}).strict(),L({path:N().min(1),kind:P7,text:N()}).strict(),L({path:N().min(1),existed:F(),kind:P7}).strict();var F7=$a([O7,B(`agents`)]),I7=N().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),L7=$a([F7,I7]);L({scope:M7.default(`project`),name:N(),targets:I(F7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:I(L7).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:I(L7).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:z([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:L7.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:F().optional(),setSource:N().min(1).optional(),place:L({dir:N().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:z([`copy`,`link`])}).strict().optional(),convert:L({target:L7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:z([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:L({path:N().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...N$,summary:P$,fork:L({editor:N().min(1),action:z([`align`,`make-source`,`rename`]),toName:N().optional()}).strict().optional()}).strict().refine(e=>!(e.targets!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>!(e.source!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),L({name:N().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:I(N()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:F().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:I(N()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:I(z([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:N().optional(),sourceMovedTo:N().optional()}).strict(),L({scope:M7.default(`project`),name:N().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),L({name:N().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:F().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict();var Ule=L({targets:I(D7),configured:F(),folders:I(L({scope:M7,host:N(),root:N(),state:z([`own`,`linked`,`linked-parent`,`absent`]),target:N().optional(),drift:B(!0).optional(),expected:N().optional()}).strict()).optional()}).strict(),R7=L({action:B(`link`),scope:M7,root:N().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:N().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),z7=L({action:B(`unlink`),scope:M7,root:N().min(1).meta({description:`The linked folder to materialize back.`}),exclude:I(N().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),B7=L({action:B(`add-root`),scope:M7,root:I7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),Wle=to(`action`,[R7.extend({preview:F().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),z7,B7]);to(`action`,[R7.strict(),z7,B7]),L({folderAction:Wle}).strict();var V7=L({moves:I(N()),drops:I(N()),removes:I(N()),replaces:I(N()),conflicts:I(N()),strays:I(N())}).strict();L({targets:I(D7),reprojected:I(L({name:N(),hosts:I(N())}).strict()),bundleHosts:I(N()),removedFrom:I(N()),folder:L({moved:I(N()),dropped:I(N()),linked:I(N())}).strict().optional(),preview:V7.optional()}).strict(),L({scope:M7.default(`project`),name:N(),version:N().regex(/^[0-9a-f]{40}$/i),...N$,summary:P$}).strict(),L({name:N().min(1),version:N(),restoredFiles:I(N()),warnings:I(N())}).strict(),L({query:N().optional(),intent:z([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:z([`navigation`,`relevance`]).optional(),scopes:I(z([`page`,`folder`,`content`,`file`])).optional(),scope:N().optional(),limit:P().int().nonnegative().optional(),semantic:F().optional(),source:z([`omnibar`,`mcp`,`http`]).optional()}).loose();var Gle=L({kind:z([`page`,`folder`,`content`,`file`]),path:N().min(1),title:N(),score:P(),signals:ao(N(),qa()),snippet:N().optional()}).loose(),Kle=L({capable:F(),applied:F(),coverage:L({embedded:P().int().nonnegative(),total:P().int().nonnegative()})}).loose();L({enabled:F(),keyPresent:F(),keyNotRequired:F(),keySource:z([`project`,`file`,`env`]).nullable(),keyHint:N().nullable(),ready:F(),capable:F(),embedded:P().int().nonnegative(),total:P().int().nonnegative()}).loose(),L({query:N(),intent:z([`autocomplete`,`full_text`,`omnibar`]),results:I(Gle),elapsedMs:P().nonnegative(),semantic:Kle.optional(),truncated:F().optional(),ready:F().optional()}).loose();var qle=L({version:N().min(1),recordedAt:N().min(1)}).loose();L({currentVersion:N().min(1),targets:ao(N(),qle.nullable())}).loose(),L({scope:M7.default(`project`),source:N().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:N().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:F().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:F().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...N$,summary:P$}).strict(),L({scope:M7.default(`project`),source:N().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:I(N().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:F().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:F().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...N$,summary:P$}).strict(),L({results:I(L({requested:N(),status:z([`imported`,`already-imported`,`not-found`,`failed`]),name:N().optional(),collisionRenamedFrom:N().optional(),warnings:I(N()),error:N().optional()}).loose()),imported:P(),alreadyImported:P(),failed:P()}).loose(),L({scope:M7.default(`project`),names:I(N().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...N$,summary:P$}).strict(),L({results:I(L({requested:N(),status:z([`updated`,`up-to-date`,`not-found`,`failed`]),source:N().optional(),warnings:I(N()),error:N().optional()}).loose()),updated:P(),upToDate:P(),failed:P()}).loose();var Jle=L({source:N(),ref:N().optional(),contentHash:N(),publisher:N().optional()}).loose();L({name:N().min(1).meta({description:`Managed skill name created or matched.`}),path:N().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:F().meta({description:`True when this request created new source files.`}),alreadyImported:F().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:N().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:Jle,warnings:I(N()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose();var Yle=`server-info`,Xle=`branch-switched`,Zle=`disk-ack`,Qle=`config-validation-rejected`,$le=`config-ignore-nested-error`,H7=z([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),eue=L({v:B(1),ch:B(Yle),seq:P(),serverInstanceId:N().min(1),currentBranch:N().min(1).optional()}).loose(),tue=L({v:B(1),ch:B(Xle),seq:P(),branch:N().min(1)}).loose(),nue=L({v:B(1),ch:H7,seq:P()}).loose(),rue=L({v:B(1),ch:B(Zle),seq:P(),docName:N().min(1),sv:N().min(1)}).loose(),iue=L({v:B(1),ch:B(Qle),seq:P(),docName:N().min(1),error:$f}).loose(),aue=L({v:B(1),ch:B($le),seq:P(),path:N().min(1),error:N().min(1)}).loose();function oue(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function sue(e){if(typeof e!=`string`||e.length===0)return e;let t=f2(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(s2(e)){let t=oue(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=i2(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var cue=`https://api.github.com/repos/inkeep/open-knowledge`;async function lue(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(cue,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function uue(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new VJ.default;var due=L({path:I($a([N(),P()])),message:N(),issueCode:N()});to(`code`,[L({code:B(`SCHEMA_INVALID`),issues:I(due)}),L({code:B(`WRITE_ERROR`),detail:N()})]);function fue(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function pue(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var U7=/^---[ \t]*\r?\n---[ \t]*(\r?\n|$)/,mue=/^---([ \t]*)(?=\r?\n|$)/,W7=e=>e.includes(`\r
|
|
573
573
|
`)?`\r
|
|
574
574
|
`:`
|
|
575
575
|
`,hue=e=>e.replace(mue,`***$1`),G7=e=>`---${e}${e}---${e}`;function K7(e,t){let n=om(e,t);return{md:n,frontmatter:n.slice(0,n.length-t.length)}}function q7(e,t){let{md:n,frontmatter:r}=K7(e,t),i=am(n);return i.frontmatter===r&&i.body===t}function J7(e,t,n,r){let{md:i,frontmatter:a}=K7(t,n);return{md:i,frontmatter:a,body:n,adjusted:r===`none`&&a!==e?`frontmatter`:r}}function gue(e,t){if(q7(e,t))return J7(e,e,t,`none`);let n=hue(t);if(n!==t&&q7(e,n))return J7(e,e,n,`body`);if(U7.test(e)){let n=G7(W7(e));if(q7(n,t))return J7(e,n,t,`frontmatter`)}return J7(e,e,t,`unresolved`)}function _ue(e,t){if(q7(e,t))return J7(e,e,t,`none`);let n=G7(W7(e||t));return(e===``||U7.test(e))&&q7(n,t)?J7(e,n,t,`frontmatter`):J7(e,e,t,`unresolved`)}var vue=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function Y7(e){return{ok:!1,error:e}}function yue(e){return{ok:!0,...e}}function bue(e){return{ok:!0,...e}}function xue(e){return{ok:!0,...e}}function X7(e){return{ok:!0,...e}}function Z7(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${l7}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function Sue(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!bm(e.map[n],t.map[n]))return!1;return!0}var Cue=5;function Q7(e){let t=e.toString();return{snapshot:wue(t),raw:t}}function wue(e){let{map:t,parseError:n}=f7(e);return{map:t,keys:p7(e),parseError:n}}function $7(e){return e.startsWith(`---`)}function Tue(e){let t=e.document,n=t.getText(`source`),r=new Set,i=Q7(n),a=i.snapshot,o=u7(i.raw).fenced,s=$7(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=Q7(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&Sue(a,t)){s=$7(i);return}a=t,o=u7(i).fenced,s=$7(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||Eue(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let t=n.toString(),{fenced:i}=u7(t);if(r=e(i),!r.ok||r.nextFenced===i)return;let a=_ue(r.nextFenced,t.slice(i.length)).frontmatter;n.delete(0,i.length),a!==``&&n.insert(0,a)},vue),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return Y7({code:`SCHEMA_INVALID`,issues:[{path:[cm],message:`'${cm}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=vm.safeParse(e);if(!t.success)return Y7({code:`SCHEMA_INVALID`,issues:t.error.issues.map(fue)});let n=t.data,r=Object.keys(n),i=f(e=>Rce(e,n));return i.ok?yue({appliedKeys:r}):Y7(Z7(i.error))}function m(e,t,n={}){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>zce(r,e,t,n));return r.ok?bue({oldKey:e,newKey:t}):Y7(Z7(r.error))}function h(e){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>b7(t,e));return t.ok?xue({orderedKeys:[...e]}):Y7(Z7(t.error))}function g(e,t){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Bce(n,e,t));return n.ok?X7({path:[...e]}):Y7(Z7(n.error))}function _(e){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>Vce(t,e));return t.ok?X7({path:[...e]}):Y7(Z7(t.error))}function v(e,t,n={}){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>Uce(r,e,t,n));return r.ok?X7({path:[...e]}):Y7(Z7(r.error))}function y(e,t){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Wce(n,e,t));return n.ok?X7({path:[...e]}):Y7(Z7(n.error))}function b(e,t){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Gce(n,e,t));return n.ok?X7({path:[...e]}):Y7(Z7(n.error))}return{current(){return Q7(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function Eue(e,t,n){if(t===0&&n)return!0;let r=t>0?t:Cue,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}function Due(e,t){if(e===``)return{slot:``,body:t};let n=t.match(/^\r?\n/);return n?{slot:n[0],body:t.slice(n[0].length)}:{slot:``,body:t}}function e9(e){let{frontmatter:t,body:n}=am(e);if(t===``)return d1(e);let r=Due(t,n).body;return/^\n*$/.test(r)?d1(e):d1(r)}var Oue=new VJ.default;Oue.Match_Threshold=.5;var kue=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,t9=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,n9=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,Aue=/^\d+([.)])(?=\s)/,jue=`1`,Mue=/\*\*\s*(`[^`]+`)\s*\*\*/g,Nue=/^(`{3,}|~{3,})/;function Pue(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=Nue.exec(i);if(a){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}if(n!==null||r===0||!t9.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||t9.test(o))){t.add(r-1),t.add(r);for(let n=r+1;n<e.length&&e[n].trimEnd().startsWith(`|`);n++)t.add(n)}}return t}function r9(e){return e.slice(0,-1).trimEnd()}var i9=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function a9(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r]??``,a=/^(`{3,}|~{3,})/.exec(i.trimStart());if(a?.[1]){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}n!==null&&t.add(r)}return t}var Fue=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Iue=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Lue=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,Rue=/<\/?[A-Z]/;function zue(e){let t=!1;for(let n=0;n<e.length;n++)if(Rue.test(e[n]??``)){t=!0;break}if(!t)return e;let n=a9(e),r=[],i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t]??``,s=o.trim();if(n.has(t)){r.push(!1),i.push(a);continue}let c=a>=1||!/^[ \t]/.test(o);r.push(c&&Fue.test(s));let l=c&&Lue.test(s),u=c&&!l&&Iue.test(s)&&!s.endsWith(`/>`);l?(a=Math.max(0,a-1),i.push(a)):(i.push(a),u&&(a+=1))}let o=Array(e.length);for(let t=0,n=-1;t<e.length;t++)o[t]=n,(e[t]??``).trim()!==``&&(n=t);let s=Array(e.length);for(let t=e.length-1,n=e.length;t>=0;t--)s[t]=n,(e[t]??``).trim()!==``&&(n=t);let c=new Set;for(let t=0;t<e.length;t++){if((e[t]??``).trim()!==``||n.has(t)||(i[t]??0)<1)continue;let a=o[t]??-1,l=s[t]??e.length;(a>=0&&r[a]===!0||l<e.length&&r[l]===!0)&&c.add(t)}let l=[];for(let t=0;t<e.length;t++){if(c.has(t))continue;let n=e[t]??``;l.push(r[t]===!0&&(i[t]??0)>=1?n.replace(/^[ \t]+/,``):n)}return l}function Bue(e){let t=zue(e.replace(/^/,``).replace(/\r/g,``).replace(kue,`$1`).replace(Mue,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
|