vibelet 1.2.233 → 1.2.235
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/inventory-scan-worker.cjs +1 -1
- package/dist/runtime-version.cjs +1 -1
- package/dist/web/assets/App-CIWR_iGV.css +1 -0
- package/dist/web/assets/App-DenA3QIb.js +2 -0
- package/dist/web/assets/BrowserControlPanel-mCDy7Hcz.js +1 -0
- package/dist/web/assets/{ChipGroup-Ct9ZVlb4.js → ChipGroup-BKnbqJkF.js} +1 -1
- package/dist/web/assets/FilesControlPanel-BAguf3b6.js +1 -0
- package/dist/web/assets/FilesControlPanel-DQpsZVYc.css +1 -0
- package/dist/web/assets/{GlobalPendingDialog-YFbtF-Qi.js → GlobalPendingDialog-D7F43nEr.js} +1 -1
- package/dist/web/assets/ImageViewer-YYuZb1G2.js +1 -0
- package/dist/web/assets/{LanguageSettingsPanel-BJipWB1x.js → LanguageSettingsPanel-CG6ptWAj.js} +1 -1
- package/dist/web/assets/MarkdownModePanel-D73Xg4At.css +1 -0
- package/dist/web/assets/MarkdownModePanel-rXmtsjPb.js +1 -0
- package/dist/web/assets/NewSessionDialog-B_YNEU3D.css +1 -0
- package/dist/web/assets/NewSessionDialog-Pc6Vz8cD.js +1 -0
- package/dist/web/assets/{NotificationSettingsPanel-DomEHL_z.js → NotificationSettingsPanel-BW2YheO8.js} +1 -1
- package/dist/web/assets/RemoteLifeOSBlock-I33jMQfs.js +2 -0
- package/dist/web/assets/TerminalControlPanel-CdYTgewy.js +1 -0
- package/dist/web/assets/ThemeSettingsPanel-CzNm33Ug.js +1 -0
- package/dist/web/assets/{abnfDiagram-VRR7QNED-OQczAdh4.js → abnfDiagram-VRR7QNED-DUxyOnUm.js} +1 -1
- package/dist/web/assets/{arc-B_7S8PBe.js → arc-zRAAWsg9.js} +1 -1
- package/dist/web/assets/{architectureDiagram-ZJ3FMSHR-0RWvjsWb.js → architectureDiagram-ZJ3FMSHR-CANEZiNN.js} +1 -1
- package/dist/web/assets/{arrow-right-DNQLufK9.js → arrow-right-CF_MlpxP.js} +1 -1
- package/dist/web/assets/{blockDiagram-677ZJIJ3-BBUl1A67.js → blockDiagram-677ZJIJ3-CQvH949j.js} +1 -1
- package/dist/web/assets/{c4Diagram-LMCZKHZV-q98KSF-X.js → c4Diagram-LMCZKHZV-CO4XjrCG.js} +1 -1
- package/dist/web/assets/channel-dQPqMnFx.js +1 -0
- package/dist/web/assets/{chunk-2Q5K7J3B-CsJ1LsZP.js → chunk-2Q5K7J3B-DTXIfjoM.js} +1 -1
- package/dist/web/assets/{chunk-32BRIVSS-CcFgBN8P.js → chunk-32BRIVSS-BbmByeWb.js} +1 -1
- package/dist/web/assets/{chunk-5VM5RSS4-BCeKWpkp.js → chunk-5VM5RSS4-55dZW-IZ.js} +1 -1
- package/dist/web/assets/{chunk-EX3LRPZG-CkONpXQe.js → chunk-EX3LRPZG-D-vCHfiB.js} +1 -1
- package/dist/web/assets/{chunk-JWPE2WC7-COD3NKSV.js → chunk-JWPE2WC7-eBvTfuuu.js} +1 -1
- package/dist/web/assets/{chunk-MOJQB5TN-Dq7aeQmI.js → chunk-MOJQB5TN-DYFPVu-x.js} +1 -1
- package/dist/web/assets/{chunk-RYQCIY6F-CmUgPJr0.js → chunk-RYQCIY6F-2xansKrF.js} +1 -1
- package/dist/web/assets/{chunk-V7JOEXUC-QkD3g50d.js → chunk-V7JOEXUC-TVnrO-Wr.js} +1 -1
- package/dist/web/assets/{chunk-VR4S4FIN-bqXmDTmi.js → chunk-VR4S4FIN-BVdWp9C5.js} +1 -1
- package/dist/web/assets/{chunk-XXDRQBXY-CylbQ77X.js → chunk-XXDRQBXY-CVwDg0PW.js} +1 -1
- package/dist/web/assets/classDiagram-OUVF2IWQ-BjI_mxx3.js +1 -0
- package/dist/web/assets/classDiagram-v2-EOCWNBFH-BjI_mxx3.js +1 -0
- package/dist/web/assets/clsx-DaxbA7nq.js +1 -0
- package/dist/web/assets/{collectMessageImages-DhGvB-2f.js → collectMessageImages-Bd_KUcjR.js} +1 -1
- package/dist/web/assets/{cose-bilkent-JH36ORCC-C9Znh1sN.js → cose-bilkent-JH36ORCC-q0D5dKoq.js} +1 -1
- package/dist/web/assets/{cynefin-VYW2F7L2-Bp7Qx0jq.js → cynefin-VYW2F7L2-C0iRs1H7.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-TSTJHNR4-BuCr2MsM.js → cynefinDiagram-TSTJHNR4-BDoOhj6i.js} +1 -1
- package/dist/web/assets/{dagre-VKFMJZFB-Db--wSJy.js → dagre-VKFMJZFB-BhAVeafA.js} +1 -1
- package/dist/web/assets/{diagram-FQU43EPY-CcDlMM65.js → diagram-FQU43EPY-19K6IibX.js} +1 -1
- package/dist/web/assets/{diagram-G47NLZAW-DET75anv.js → diagram-G47NLZAW-BKaIX5yb.js} +1 -1
- package/dist/web/assets/{diagram-NH7WQ7WH-CuSmdJWE.js → diagram-NH7WQ7WH-C0ly0NEX.js} +1 -1
- package/dist/web/assets/{diagram-OA4YK3LP-C4AHJasK.js → diagram-OA4YK3LP-CUkW2x74.js} +1 -1
- package/dist/web/assets/{diagram-WEI45ONY-v2xIwF8y.js → diagram-WEI45ONY-DwdeWCAC.js} +1 -1
- package/dist/web/assets/{ebnfDiagram-CCIWWBDH-wy_kEa8S.js → ebnfDiagram-CCIWWBDH-BsOwHiWw.js} +1 -1
- package/dist/web/assets/{erDiagram-Q63AITRT-B2ZADv-r.js → erDiagram-Q63AITRT-qDA1uJgc.js} +1 -1
- package/dist/web/assets/file-editor-FileCodeEditor-e_cHRyn4.js +2 -0
- package/dist/web/assets/{file-editor-ObsidianCodeEditor-C4QKDNQs.js → file-editor-ObsidianCodeEditor-DI7f8suj.js} +1 -1
- package/dist/web/assets/file-editor-ObsidianFileEditor-ByRz9GFK.js +2 -0
- package/dist/web/assets/{file-editor-index-BEEbdBdH.js → file-editor-index-BOi4gj-u.js} +1 -1
- package/dist/web/assets/{file-editor-index-Blz54FUZ.js → file-editor-index-BWvEAcHp.js} +1 -1
- package/dist/web/assets/{file-editor-index-BJr7v7bw.js → file-editor-index-Bg9-IMrE.js} +1 -1
- package/dist/web/assets/file-editor-index-BocbUhDf.js +1 -0
- package/dist/web/assets/{file-editor-index-B3d2HyrJ.js → file-editor-index-ByGYwqNf.js} +1 -1
- package/dist/web/assets/{file-editor-index-kJrjg6tD.js → file-editor-index-C-F4L_uP.js} +1 -1
- package/dist/web/assets/{file-editor-index-Cy0cJb2y.js → file-editor-index-C6CU7Fik.js} +1 -1
- package/dist/web/assets/{file-editor-index-BFdT3Mv9.js → file-editor-index-C7QHkk3U.js} +1 -1
- package/dist/web/assets/{file-editor-index-BoV5K7VS.js → file-editor-index-CBJfyhrV.js} +1 -1
- package/dist/web/assets/{file-editor-index-BEOxpefN.js → file-editor-index-CMzVhAnN.js} +1 -1
- package/dist/web/assets/{file-editor-index-Dj7iSTai.js → file-editor-index-CVa9xeL0.js} +1 -1
- package/dist/web/assets/{file-editor-index-C-aRVKEr.js → file-editor-index-Ca7mWpkj.js} +1 -1
- package/dist/web/assets/{file-editor-index-CSaCz3EW.js → file-editor-index-CylY6jN7.js} +1 -1
- package/dist/web/assets/{file-editor-index-C5f7s3Eh.js → file-editor-index-D5fLCdey.js} +1 -1
- package/dist/web/assets/{file-editor-index-DGnKtkr2.js → file-editor-index-DBUZobR-.js} +1 -1
- package/dist/web/assets/{file-editor-index-mYPTZLoA.js → file-editor-index-DH8OZ6dS.js} +1 -1
- package/dist/web/assets/{file-editor-index-DfMO4TI8.js → file-editor-index-DIH2DQ5-.js} +1 -1
- package/dist/web/assets/{file-editor-index-CQsZBAf1.js → file-editor-index-DPwrStxR.js} +1 -1
- package/dist/web/assets/{file-editor-index-Cyo3bdPe.js → file-editor-index-DSJHLC6d.js} +1 -1
- package/dist/web/assets/{file-editor-index-B2I28X4j.js → file-editor-index-Dijmg1Xu.js} +1 -1
- package/dist/web/assets/{file-editor-index-rihVD8wm.js → file-editor-index-EvPD_eNu.js} +1 -1
- package/dist/web/assets/{file-editor-index-WHi3JlW8.js → file-editor-index-WprjWcs8.js} +1 -1
- package/dist/web/assets/{file-editor-index-CKwNSFLk.js → file-editor-index-vyjM9L0w.js} +1 -1
- package/dist/web/assets/{file-editor-index-c2dKCHO8.js → file-editor-index-wav2nO7A.js} +1 -1
- package/dist/web/assets/{flowDiagram-23GEKE2U-CX2RaC4p.js → flowDiagram-23GEKE2U-CWT82Psi.js} +1 -1
- package/dist/web/assets/{folder-plus-Cl6NWbNw.js → folder-plus-BuIbO5rO.js} +1 -1
- package/dist/web/assets/{ganttDiagram-NO4QXBWP-C1fJ323v.js → ganttDiagram-NO4QXBWP-BwkNz011.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-IHSO6WYX-BLFS-Drr.js → gitGraphDiagram-IHSO6WYX-Dnd5wgTd.js} +1 -1
- package/dist/web/assets/highlighted-body-TPN3WLV5-B-MOqwqs.js +1 -0
- package/dist/web/assets/index-BBUiU9K_.css +1 -0
- package/dist/web/assets/{index-8_Am9ShR.js → index-CMunTdjK.js} +1 -1
- package/dist/web/assets/index-CdwajBhR.js +2 -0
- package/dist/web/assets/{infoDiagram-FWYZ7A6U-BNpxEHPJ.js → infoDiagram-FWYZ7A6U-CsLiRudn.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-FXEZZL3T-CZA4KSjU.js → ishikawaDiagram-FXEZZL3T-CQ2VItcU.js} +1 -1
- package/dist/web/assets/{journeyDiagram-5HDEW3XC-HFqAA_cn.js → journeyDiagram-5HDEW3XC-20HUCiMA.js} +1 -1
- package/dist/web/assets/{kanban-definition-HUTT4EX6-DD_a9PCM.js → kanban-definition-HUTT4EX6-BlFKyFGS.js} +1 -1
- package/dist/web/assets/{linear-D8Y_m16-.js → linear-DcEW9U4V.js} +1 -1
- package/dist/web/assets/logo-CVsV06Wq.webp +0 -0
- package/dist/web/assets/mermaid-O7DHMXV3-CKUeIBKi.js +2 -0
- package/dist/web/assets/{mermaid-O7DHMXV3-CHSBDxzn.css → mermaid-O7DHMXV3-DQjp4PWc.css} +1 -1
- package/dist/web/assets/{mermaid.core-BOFC-9Zd.js → mermaid.core-CKL91szq.js} +2 -2
- package/dist/web/assets/{mindmap-definition-LN4V7U3C-D5IUgZ6b.js → mindmap-definition-LN4V7U3C-D0VoTzwD.js} +1 -1
- package/dist/web/assets/{pegDiagram-2B236MQR-CefM8hXa.js → pegDiagram-2B236MQR-CefWKSzd.js} +1 -1
- package/dist/web/assets/{pieDiagram-ENE6RG2P-BDEGSmj6.js → pieDiagram-ENE6RG2P-DOqFxLRf.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-ABIIQ3AL-CgbzHIM1.js → quadrantDiagram-ABIIQ3AL-9deKwbNB.js} +1 -1
- package/dist/web/assets/{railroadDiagram-RFXS5EU6-DipKpgnM.js → railroadDiagram-RFXS5EU6-DChzO2BS.js} +1 -1
- package/dist/web/assets/{requirementDiagram-TGXJPOKE-CJWkBC2T.js → requirementDiagram-TGXJPOKE-BxFcGapQ.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-HTMAVEWB-CJgh1qMP.js → sankeyDiagram-HTMAVEWB-DbF_hrnW.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-DBY2YBRQ-oIXo1saQ.js → sequenceDiagram-DBY2YBRQ-CnZJ1pvx.js} +1 -1
- package/dist/web/assets/{sizeCapture-X5ZJPWSS-CrToD-n4.js → sizeCapture-X5ZJPWSS-eGmJC2ld.js} +1 -1
- package/dist/web/assets/{stateDiagram-2N3HPSRC-PQ_QNKS9.js → stateDiagram-2N3HPSRC-C7xdkcAK.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-6OUMAXLB-Cyth9z2I.js +1 -0
- package/dist/web/assets/{swimlanes-5IMT3BWC-B6jyX_3e.js → swimlanes-5IMT3BWC-Bs93ZHOO.js} +2 -2
- package/dist/web/assets/swimlanesDiagram-G3AALYLV-B5jki7rr.js +1 -0
- package/dist/web/assets/{timeline-definition-FHXFAJF6-CZV40Uiu.js → timeline-definition-FHXFAJF6-BJoNIKQC.js} +1 -1
- package/dist/web/assets/{vennDiagram-L72KCM5P-DfURoA_U.js → vennDiagram-L72KCM5P-DKRz7LAp.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-EHGQE667-BJTuXTfz.js → wardleyDiagram-EHGQE667-CzSi7t19.js} +1 -1
- package/dist/web/assets/{xychartDiagram-FW5EYKEG-BruFcrd-.js → xychartDiagram-FW5EYKEG-CKOX-yaI.js} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/obsidian-editor-assets.json +1 -1
- package/package.json +1 -1
- package/dist/web/assets/App-Bw9Q-kI5.css +0 -1
- package/dist/web/assets/App-DFMRw4Fj.js +0 -2
- package/dist/web/assets/BrowserControlPanel-K-f_KMTt.js +0 -1
- package/dist/web/assets/FilesControlPanel-DlSUh03w.js +0 -1
- package/dist/web/assets/FilesControlPanel-PdhHw9AQ.css +0 -1
- package/dist/web/assets/ImageViewer-BGEOxuV3.js +0 -1
- package/dist/web/assets/NewSessionDialog-C4RkGYOJ.css +0 -1
- package/dist/web/assets/NewSessionDialog-CM5UMy33.js +0 -1
- package/dist/web/assets/RemoteLifeOSBlock-INrlOM1O.js +0 -2
- package/dist/web/assets/TerminalControlPanel-CcDilPZY.js +0 -1
- package/dist/web/assets/ThemeSettingsPanel-DyQIWRlL.js +0 -1
- package/dist/web/assets/channel-CL_-wxGg.js +0 -1
- package/dist/web/assets/classDiagram-OUVF2IWQ-C0QG8J89.js +0 -1
- package/dist/web/assets/classDiagram-v2-EOCWNBFH-C0QG8J89.js +0 -1
- package/dist/web/assets/clsx-BNl54vr7.js +0 -1
- package/dist/web/assets/file-editor-FileCodeEditor-DsxCu0Se.js +0 -2
- package/dist/web/assets/file-editor-ObsidianFileEditor-CHQ4_ygH.js +0 -2
- package/dist/web/assets/file-editor-index-Cubo6rhP.js +0 -1
- package/dist/web/assets/highlighted-body-TPN3WLV5-DeaJXkFu.js +0 -1
- package/dist/web/assets/index-BmushmS_.js +0 -2
- package/dist/web/assets/index-Y4eH8Xel.css +0 -1
- package/dist/web/assets/logo-SQcOtj-8.png +0 -0
- package/dist/web/assets/mermaid-O7DHMXV3-DqNZp9oe.js +0 -2
- package/dist/web/assets/stateDiagram-v2-6OUMAXLB-CTC96jcC.js +0 -1
- package/dist/web/assets/swimlanesDiagram-G3AALYLV-XXos6SqD.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-BOFC-9Zd.js","assets/index-BmushmS_.js","assets/index-Y4eH8Xel.css","assets/purify.es-BNLkGfTg.js","assets/marked.esm-BBjA1da9.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var e,t,n,s,r,i,a,o,l,c,u,d,p,f,h,m,g,y,k,w,b,v,S,x,C=e=>{throw TypeError(e)},T=(e,t,n)=>t.has(e)||C("Cannot "+n),O=(e,t,n)=>(T(e,t,"read from private field"),n?n.call(e):t.get(e)),D=(e,t,n)=>t.has(e)?C("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),M=(e,t,n,s)=>(T(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n);import{_ as A,r as N,e as E,l as I,j as R}from"./index-BmushmS_.js";import{af as L,a2 as P,Z as $,a3 as V,a1 as B,a5 as F}from"./App-DFMRw4Fj.js";import{f as z,d as W,e as j,p as _,h as U,z as K,u as q,r as H,g as Y,i as J,t as G,o as Q,l as Z,b as X,S as ee,v as te}from"./index-8_Am9ShR.js";import{az as ne,aA as se}from"./file-editor-index-Cy0cJb2y.js";const re={}.hasOwnProperty;function ie(e,t){let n,s=-1;if(t.extensions)for(;++s<t.extensions.length;)ie(e,t.extensions[s]);for(n in t)if(re.call(t,n))switch(n){case"extensions":break;case"unsafe":case"join":ae(e[n],t[n]);break;case"handlers":oe(e[n],t[n]);break;default:e.options[n]=t[n]}return e}function ae(e,t){t&&e.push(...t)}function oe(e,t){t&&Object.assign(e,t)}const le=[function(e,t,n,s){if("code"===t.type&&z(t,s)&&("list"===e.type||e.type===t.type&&z(e,s)))return!1;if("spread"in n&&"boolean"==typeof n.spread){if("paragraph"===e.type&&(e.type===t.type||"definition"===t.type||"heading"===t.type&&W(t,s)))return;return n.spread?1:0}}],ce=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],ue=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",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:ce},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:ce},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:ce},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:ce},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:ce},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:ce},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:ce},{atBreak:!0,character:"~"}];function de(e){return e.label||!e.identifier?e.label||"":L(e.identifier)}function pe(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function fe(e,t,n,s){let r=s.join.length;for(;r--;){const i=s.join[r](e,t,n,s);if(!0===i||1===i)break;if("number"==typeof i)return"\n".repeat(1+i);if(!1===i)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const he=/\r?\n|\r/g;function me(e,t){const n=[];let s,r=0,i=0;for(;s=he.exec(e);)a(e.slice(r,s.index)),n.push(s[0]),r=s.index+s[0].length,i++;return a(e.slice(r)),n.join("");function a(e){n.push(t(e,i,!e))}}function ge(e,t){return e-t}function ye(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,s=[],r=[],i=e+t;let a,o=-1,l=0;for(;a=n.exec(i);)s.push(a.index);for(;++o<s.length;)l!==s[o]&&r.push(e.slice(l,s[o])),r.push("\\"),l=s[o];return r.push(e.slice(l)),r.join("")}function ke(e){const t=e||{},n=t.now||{};let s=t.lineShift||0,r=n.line||1,i=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),a=n[n.length-1];return r+=n.length-1,i=1===n.length?i+a.length:1+a.length+s,t},current:function(){return{now:{line:r,column:i},lineShift:s}},shift:function(e){s+=e}}}function we(e,t){const n={associationId:de,containerPhrasing:xe,containerFlow:Ce,createTracker:ke,compilePattern:pe,enter:function(e){return n.stack.push(e),function(){n.stack.pop()}},handlers:{...U},handle:void 0,indentLines:me,indexStack:[],join:[...le],options:{},safe:Te,stack:[],unsafe:[...ue]};ie(n,t||{}),n.options.tightDefinitions&&n.join.push(Se),n.handle=K("type",{invalid:be,unknown:ve,handlers:n.handlers});let s=n.handle(e,void 0,n,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return s&&10!==s.charCodeAt(s.length-1)&&13!==s.charCodeAt(s.length-1)&&(s+="\n"),s}function be(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function ve(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function Se(e,t){if("definition"===e.type&&e.type===t.type)return 0}function xe(e,t){return function(e,t,n){const s=t.indexStack,r=e.children||[],i=[];let a,o=-1,l=n.before;s.push(-1);let c=t.createTracker(n);for(;++o<r.length;){const u=r[o];let d;if(s[s.length-1]=o,o+1<r.length){let n=t.handle.handlers[r[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(r[o+1],e,t,{before:"",after:"",...c.current()}).charAt(0):""}else d=n.after;i.length>0&&("\r"===l||"\n"===l)&&"html"===u.type&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),l=" ",c=t.createTracker(n),c.move(i.join("")));let p=t.handle(u,e,t,{...c.current(),after:d,before:l});a&&a===p.slice(0,1)&&(p=j(a.charCodeAt(0))+p.slice(1));const f=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,a=void 0,f&&(i.length>0&&f.before&&l===i[i.length-1].slice(-1)&&(i[i.length-1]=i[i.length-1].slice(0,-1)+j(l.charCodeAt(0))),f.after&&(a=d)),c.move(p),i.push(p),l=p.slice(-1)}return s.pop(),i.join("")}(e,this,t)}function Ce(e,t){return function(e,t,n){const s=t.indexStack,r=e.children||[],i=t.createTracker(n),a=[];let o=-1;for(s.push(-1);++o<r.length;){const n=r[o];s[s.length-1]=o,a.push(i.move(t.handle(n,e,t,{before:"\n",after:"\n",...i.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),o<r.length-1&&a.push(i.move(fe(n,r[o+1],e,t)))}return s.pop(),a.join("")}(e,this,t)}function Te(e,t){return function(e,t,n){const s=(n.before||"")+(t||"")+(n.after||""),r=[],i=[],a={};let o=-1;for(;++o<e.unsafe.length;){const t=e.unsafe[o];if(!_(e.stack,t))continue;const n=e.compilePattern(t);let i;for(;i=n.exec(s);){const e="before"in t||Boolean(t.atBreak),n="after"in t,s=i.index+(e?i[1].length:0);r.includes(s)?(a[s].before&&!e&&(a[s].before=!1),a[s].after&&!n&&(a[s].after=!1)):(r.push(s),a[s]={before:e,after:n})}}r.sort(ge);let l=n.before?n.before.length:0;const c=s.length-(n.after?n.after.length:0);for(o=-1;++o<r.length;){const e=r[o];e<l||e>=c||e+1<c&&r[o+1]===e+1&&a[e].after&&!a[e+1].before&&!a[e+1].after||r[o-1]===e-1&&a[e].before&&!a[e-1].before&&!a[e-1].after||(l!==e&&i.push(ye(s.slice(l,e),"\\")),l=e,!/[!-/:-@[-`{-~]/.test(s.charAt(e))||n.encode&&n.encode.includes(s.charAt(e))?(i.push(j(s.charCodeAt(e))),l++):i.push("\\"))}return i.push(ye(s.slice(l,c),n.after)),i.join("")}(this,e,t)}const Oe=new WeakMap,De="data-lifeos-overlay-active",Me=()=>"undefined"!=typeof HTMLElement;function Ae(e){return e?e.closest(".milkdown"):null}function Ne(e){return e?"dom"in e&&Me()&&e.dom instanceof HTMLElement?Ae(e.dom):Me()&&e instanceof HTMLElement||"undefined"!=typeof SVGElement&&e instanceof SVGElement?Ae(e):"undefined"!=typeof Node&&e instanceof Node?Ae(e.parentElement):null:null}function Ee(e,t){t&&t.size>0?e.setAttribute(De,"true"):e.removeAttribute(De)}function Ie(e,t,n){const s=Ne(e);if(!s)return;const r=Oe.get(s)??new Set;return n?(r.add(t),Oe.set(s,r),void Ee(s,r)):(r.delete(t),0===r.size?(Oe.delete(s),void Ee(s,void 0)):(Oe.set(s,r),void Ee(s,r)))}function Re(e){const t=Ne(e);if(!t)return!1;const n=Oe.get(t);return n?n.size>0:"true"===t.getAttribute(De)}function Le(e){this.content=e}function Pe(e,t,n){for(let s=0;;s++){if(s==e.childCount||s==t.childCount)return e.childCount==t.childCount?null:n;let r=e.child(s),i=t.child(s);if(r!=i){if(!r.sameMarkup(i))return n;if(r.isText&&r.text!=i.text){for(let e=0;r.text[e]==i.text[e];e++)n++;return n}if(r.content.size||i.content.size){let e=Pe(r.content,i.content,n+1);if(null!=e)return e}n+=r.nodeSize}else n+=r.nodeSize}}function $e(e,t,n,s){for(let r=e.childCount,i=t.childCount;;){if(0==r||0==i)return r==i?null:{a:n,b:s};let a=e.child(--r),o=t.child(--i),l=a.nodeSize;if(a!=o){if(!a.sameMarkup(o))return{a:n,b:s};if(a.isText&&a.text!=o.text){let e=0,t=Math.min(a.text.length,o.text.length);for(;e<t&&a.text[a.text.length-e-1]==o.text[o.text.length-e-1];)e++,n--,s--;return{a:n,b:s}}if(a.content.size||o.content.size){let e=$e(a.content,o.content,n-1,s-1);if(e)return e}n-=l,s-=l}else n-=l,s-=l}}Le.prototype={constructor:Le,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var s=n&&n!=e?this.remove(n):this,r=s.find(e),i=s.content.slice();return-1==r?i.push(n||e,t):(i[r+1]=t,n&&(i[r]=n)),new Le(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new Le(n)},addToStart:function(e,t){return new Le([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Le(n)},addBefore:function(e,t,n){var s=this.remove(t),r=s.content.slice(),i=s.find(e);return r.splice(-1==i?r.length:i,0,t,n),new Le(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=Le.from(e)).size?new Le(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Le.from(e)).size?new Le(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Le.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Le.from=function(e){if(e instanceof Le)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Le(t)};class Ve{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,s=0,r){for(let i=0,a=0;a<t;i++){let o=this.content[i],l=a+o.nodeSize;if(l>e&&!1!==n(o,s+a,r||null,i)&&o.content.size){let r=a+1;o.nodesBetween(Math.max(0,e-r),Math.min(o.content.size,t-r),n,s+r)}a=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,s){let r="",i=!0;return this.nodesBetween(e,t,(a,o)=>{let l=a.isText?a.text.slice(Math.max(e,o)-o,t-o):a.isLeaf?s?"function"==typeof s?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&l||a.isTextblock)&&n&&(i?i=!1:r+=n),r+=l},0),r}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,s=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(n)&&(s[s.length-1]=t.withText(t.text+n.text),r=1);r<e.content.length;r++)s.push(e.content[r]);return new Ve(s,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],s=0;if(t>e)for(let r=0,i=0;i<t;r++){let a=this.content[r],o=i+a.nodeSize;o>e&&((i<e||o>t)&&(a=a.isText?a.cut(Math.max(0,e-i),Math.min(a.text.length,t-i)):a.cut(Math.max(0,e-i-1),Math.min(a.content.size,t-i-1))),n.push(a),s+=a.nodeSize),i=o}return new Ve(n,s)}cutByIndex(e,t){return e==t?Ve.empty:0==e&&t==this.content.length?this:new Ve(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let s=this.content.slice(),r=this.size+t.nodeSize-n.nodeSize;return s[e]=t,new Ve(s,r)}addToStart(e){return new Ve([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ve(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let s=this.content[t];e(s,n,t),n+=s.nodeSize}}findDiffStart(e,t=0){return Pe(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return $e(this,e,t,n)}findIndex(e){if(0==e)return Fe(0,e);if(e==this.size)return Fe(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let s=n+this.child(t).nodeSize;if(s>=e)return s==e?Fe(t+1,s):Fe(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Ve.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ve(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ve.empty;let t,n=0;for(let s=0;s<e.length;s++){let r=e[s];n+=r.nodeSize,s&&r.isText&&e[s-1].sameMarkup(r)?(t||(t=e.slice(0,s)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new Ve(t||e,n)}static from(e){if(!e)return Ve.empty;if(e instanceof Ve)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ve([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ve.empty=new Ve([],0);const Be={index:0,offset:0};function Fe(e,t){return Be.index=e,Be.offset=t,Be}function ze(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!ze(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!ze(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class We{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let s=0;s<e.length;s++){let r=e[s];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,s));else{if(r.type.excludes(this.type))return e;!n&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ze(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=n.create(t.attrs);return n.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return We.none;if(e instanceof We)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}We.none=[];class je extends Error{}let _e=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let s=Ke(this.content,t+this.openStart,n);return s&&new e(s,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Ue(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let s=n.openStart||0,r=n.openEnd||0;if("number"!=typeof s||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new e(Ve.fromJSON(t,n.content),s,r)}static maxOpen(t,n=!0){let s=0,r=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)s++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)r++;return new e(t,s,r)}};function Ue(e,t,n){let{index:s,offset:r}=e.findIndex(t),i=e.maybeChild(s),{index:a,offset:o}=e.findIndex(n);if(r==t||i.isText){if(o!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(s!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(s,i.copy(Ue(i.content,t-r-1,n-r-1)))}function Ke(e,t,n,s){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r);if(i==t||a.isText)return s&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let o=Ke(a.content,t-i-1,n,a);return o&&e.replaceChild(r,a.copy(o))}function qe(e,t,n){if(n.openStart>e.depth)throw new je("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new je("Inconsistent open depths");return He(e,t,n,0)}function He(e,t,n,s){let r=e.index(s),i=e.node(s);if(r==t.index(s)&&s<e.depth-n.openStart){let a=He(e,t,n,s+1);return i.copy(i.content.replaceChild(r,a))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=s||t.depth!=s){let{start:r,end:a}=function(e,t){let n=t.depth-e.openStart,s=t.node(n).copy(e.content);for(let r=n-1;r>=0;r--)s=t.node(r).copy(Ve.from(s));return{start:s.resolveNoCache(e.openStart+n),end:s.resolveNoCache(s.content.size-e.openEnd-n)}}(n,e);return Ze(i,Xe(e,r,a,t,s))}{let s=e.parent,r=s.content;return Ze(s,r.cut(0,e.parentOffset).append(n.content).append(r.cut(t.parentOffset)))}}return Ze(i,et(e,t,s))}function Ye(e,t){if(!t.type.compatibleContent(e.type))throw new je("Cannot join "+t.type.name+" onto "+e.type.name)}function Je(e,t,n){let s=e.node(n);return Ye(s,t.node(n)),s}function Ge(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Qe(e,t,n,s){let r=(t||e).node(n),i=0,a=t?t.index(n):r.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Ge(e.nodeAfter,s),i++));for(let o=i;o<a;o++)Ge(r.child(o),s);t&&t.depth==n&&t.textOffset&&Ge(t.nodeBefore,s)}function Ze(e,t){return e.type.checkContent(t),e.copy(t)}function Xe(e,t,n,s,r){let i=e.depth>r&&Je(e,t,r+1),a=s.depth>r&&Je(n,s,r+1),o=[];return Qe(null,e,r,o),i&&a&&t.index(r)==n.index(r)?(Ye(i,a),Ge(Ze(i,Xe(e,t,n,s,r+1)),o)):(i&&Ge(Ze(i,et(e,t,r+1)),o),Qe(t,n,r,o),a&&Ge(Ze(a,et(n,s,r+1)),o)),Qe(s,null,r,o),new Ve(o)}function et(e,t,n){let s=[];return Qe(null,e,n,s),e.depth>n&&Ge(Ze(Je(e,t,n+1),et(e,t,n+1)),s),Qe(t,null,n,s),new Ve(s)}_e.empty=new _e(Ve.empty,0,0);class tt{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],s=e.child(t);return n?e.child(t).cut(n):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],s=0==t?0:this.path[3*t-1]+1;for(let r=0;r<e;r++)s+=n.child(r).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return We.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),s=e.maybeChild(t);if(!n){let e=n;n=s,s=e}let r=n.marks;for(var i=0;i<r.length;i++)!1!==r[i].type.spec.inclusive||s&&r[i].isInSet(s.marks)||(r=r[i--].removeFromSet(r));return r}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,s=e.parent.maybeChild(e.index());for(var r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||s&&n[r].isInSet(s.marks)||(n=n[r--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new it(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],s=0,r=t;for(let i=e;;){let{index:e,offset:t}=i.content.findIndex(r),a=r-t;if(n.push(i,e,s+t),!a)break;if(i=i.child(e),i.isText)break;r=a-1,s+=t+1}return new tt(t,n,r)}static resolveCached(e,t){let n=rt.get(e);if(n)for(let r=0;r<n.elts.length;r++){let e=n.elts[r];if(e.pos==t)return e}else rt.set(e,n=new nt);let s=n.elts[n.i]=tt.resolve(e,t);return n.i=(n.i+1)%st,s}}class nt{constructor(){this.elts=[],this.i=0}}const st=12,rt=new WeakMap;class it{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const at=Object.create(null);let ot=class e{constructor(e,t,n,s=We.none){this.type=e,this.attrs=t,this.marks=s,this.content=n||Ve.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,s=0){this.content.nodesBetween(e,t,n,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,s){return this.content.textBetween(e,t,n,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&ze(this.attrs,t||e.defaultAttrs||at)&&We.sameSet(this.marks,n||We.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return _e.empty;let s=this.resolve(e),r=this.resolve(t),i=n?0:s.sharedDepth(t),a=s.start(i),o=s.node(i).content.cut(s.pos-a,r.pos-a);return new _e(o,s.depth-i,r.depth-i)}replace(e,t,n){return qe(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let s=this.content.child(t-1);return{node:s,index:t-1,offset:n-s.nodeSize}}resolve(e){return tt.resolveCached(this,e)}resolveNoCache(e){return tt.resolve(this,e)}rangeHasMark(e,t,n){let s=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ct(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Ve.empty,s=0,r=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,s,r),a=i&&i.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let o=s;o<r;o++)if(!this.type.allowsMarks(n.child(o).marks))return!1;return!0}canReplaceWith(e,t,n,s){if(s&&!this.type.allowsMarks(s))return!1;let r=this.contentMatchAt(e).matchType(n),i=r&&r.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=We.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!We.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let s=Ve.fromJSON(e,t.content),r=e.nodeType(t.type).create(t.attrs,s,n);return r.type.checkAttrs(r.attrs),r}};ot.prototype.text=void 0;class lt extends ot{constructor(e,t,n,s){if(super(e,t,null,s),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ct(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new lt(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new lt(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ct(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class ut{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new dt(e,t);if(null==n.next)return ut.empty;let s=pt(n);n.next&&n.err("Unexpected trailing text");let r=function(e){let t=Object.create(null);return function n(s){let r=[];s.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let s;for(let e=0;e<r.length;e++)r[e][0]==t&&(s=r[e][1]);kt(e,n).forEach(e=>{s||r.push([t,s=[]]),-1==s.indexOf(e)&&s.push(e)})})});let i=t[s.join(",")]=new ut(s.indexOf(e.length-1)>-1);for(let e=0;e<r.length;e++){let s=r[e][1].sort(yt);i.next.push({type:r[e][0],next:t[s.join(",")]||n(s)})}return i}(kt(e,0))}(function(e){let t=[[]];return r(function e(t,i){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,i)),[]);if("seq"!=t.type){if("star"==t.type){let a=n();return s(i,a),r(e(t.expr,a),a),[s(a)]}if("plus"==t.type){let a=n();return r(e(t.expr,i),a),r(e(t.expr,a),a),[s(a)]}if("opt"==t.type)return[s(i)].concat(e(t.expr,i));if("range"==t.type){let a=i;for(let s=0;s<t.min;s++){let s=n();r(e(t.expr,a),s),a=s}if(-1==t.max)r(e(t.expr,a),a);else for(let i=t.min;i<t.max;i++){let i=n();s(a,i),r(e(t.expr,a),i),a=i}return[s(a)]}if("name"==t.type)return[s(i,void 0,t.value)];throw new Error("Unknown expr type")}for(let s=0;;s++){let a=e(t.exprs[s],i);if(s==t.exprs.length-1)return a;r(a,i=n())}}(e,0),n()),t;function n(){return t.push([])-1}function s(e,n,s){let r={term:s,to:n};return t[e].push(r),r}function r(e,t){e.forEach(e=>e.to=t)}}(s));return function(e,t){for(let n=0,s=[e];n<s.length;n++){let e=s[n],r=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:a}=e.next[t];i.push(n.name),!r||n.isText||n.hasRequiredAttrs()||(r=!1),-1==s.indexOf(a)&&s.push(a)}r&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(r,n),r}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let s=this;for(let r=t;s&&r<n;r++)s=s.matchType(e.child(r).type);return s}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let s=[this];return function r(i,a){let o=i.matchFragment(e,n);if(o&&(!t||o.validEnd))return Ve.from(a.map(e=>e.createAndFill()));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==s.indexOf(n)){s.push(n);let e=r(n,a.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let s=n.shift(),r=s.match;if(r.matchType(e)){let e=[];for(let t=s;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<r.next.length;e++){let{type:i,next:a}=r.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||s.type&&!a.validEnd||(n.push({match:i.contentMatch,type:i,via:s}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let s=0;s<n.next.length;s++)-1==e.indexOf(n.next[s].next)&&t(n.next[s].next)}(this),e.map((t,n)=>{let s=n+(t.validEnd?"*":" ")+" ";for(let r=0;r<t.next.length;r++)s+=(r?", ":"")+t.next[r].type.name+"->"+e.indexOf(t.next[r].next);return s}).join("\n")}}ut.empty=new ut(!0);class dt{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function pt(e){let t=[];do{t.push(ft(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function ft(e){let t=[];do{t.push(ht(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function ht(e){let t=function(e){if(e.eat("(")){let t=pt(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,s=n[t];if(s)return[s];let r=[];for(let i in n){let e=n[i];e.isInGroup(t)&&r.push(e)}return 0==r.length&&e.err("No node type or group '"+t+"' found"),r}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=gt(e,t)}return t}function mt(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function gt(e,t){let n=mt(e),s=n;return e.eat(",")&&(s="}"!=e.next?mt(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:s,expr:t}}function yt(e,t){return t-e}function kt(e,t){let n=[];return function t(s){let r=e[s];if(1==r.length&&!r[0].term)return t(r[0].to);n.push(s);for(let e=0;e<r.length;e++){let{term:s,to:i}=r[e];s||-1!=n.indexOf(i)||t(i)}}(t),n.sort(yt)}function wt(e){let t=Object.create(null);for(let n in e){let s=e[n];if(!s.hasDefault)return null;t[n]=s.default}return t}function bt(e,t){let n=Object.create(null);for(let s in e){let r=t&&t[s];if(void 0===r){let t=e[s];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+s);r=t.default}n[s]=r}return n}function vt(e,t,n,s){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let r in e){let n=e[r];n.validate&&n.validate(t[r])}}function St(e,t){let n=Object.create(null);if(t)for(let s in t)n[s]=new Ct(e,s,t[s]);return n}let xt=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=St(e,n.attrs),this.defaultAttrs=wt(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ut.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:bt(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ot(this,this.computeAttrs(e),Ve.from(t),We.setFrom(n))}createChecked(e=null,t,n){return t=Ve.from(t),this.checkContent(t),new ot(this,this.computeAttrs(e),t,We.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Ve.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let s=this.contentMatch.matchFragment(t),r=s&&s.fillBefore(Ve.empty,!0);return r?new ot(this,e,t.append(r),We.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){vt(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:We.none:e}static compile(t,n){let s=Object.create(null);t.forEach((t,r)=>s[t]=new e(t,n,r));let r=n.spec.topNode||"doc";if(!s[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!s.text)throw new RangeError("Every schema needs a 'text' type");for(let e in s.text.attrs)throw new RangeError("The text node type should not have attributes");return s}};class Ct{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let s=n.split("|");return n=>{let r=null===n?"null":typeof n;if(s.indexOf(r)<0)throw new RangeError(`Expected value of type ${s} for attribute ${t} on type ${e}, got ${r}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Tt{constructor(e,t,n,s){this.name=e,this.rank=t,this.schema=n,this.spec=s,this.attrs=St(e,s.attrs),this.excluded=null;let r=wt(this.attrs);this.instance=r?new We(this,r):null}create(e=null){return!e&&this.instance?this.instance:new We(this,bt(this.attrs,e))}static compile(e,t){let n=Object.create(null),s=0;return e.forEach((e,r)=>n[e]=new Tt(e,s++,t,r)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){vt(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Ot{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Le.from(e.nodes),t.marks=Le.from(e.marks||{}),this.nodes=xt.compile(this.spec.nodes,this),this.marks=Tt.compile(this.spec.marks,this);let n=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let e=this.nodes[s],t=e.spec.content||"",r=e.spec.marks;if(e.contentMatch=n[t]||(n[t]=ut.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==r?null:r?Dt(this,r.split(" ")):""!=r&&e.inlineContent?null:[]}for(let s in this.marks){let e=this.marks[s],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:Dt(this,t.split(" "))}this.nodeFromJSON=e=>ot.fromJSON(this,e),this.markFromJSON=e=>We.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,s){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof xt))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,s)}text(e,t){let n=this.nodes.text;return new lt(n,n.defaultAttrs,e,We.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Dt(e,t){let n=[];for(let s=0;s<t.length;s++){let r=t[s],i=e.marks[r],a=i;if(i)n.push(i);else for(let t in e.marks){let s=e.marks[t];("_"==r||s.spec.group&&s.spec.group.split(" ").indexOf(r)>-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[s]+"'")}return n}class Mt{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Lt(this,t,!1);return n.addAll(e,We.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Lt(this,t,!0);return n.addAll(e,We.none,t.from,t.to),_e.maxOpen(n.finish())}matchTag(e,t,n){for(let s=n?this.tags.indexOf(n)+1:0;s<this.tags.length;s++){let n=this.tags[s];if(Pt(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,s){for(let r=s?this.styles.indexOf(s)+1:0;r<this.styles.length;r++){let s=this.styles[r],i=s.style;if(!(0!=i.indexOf(e)||s.context&&!n.matchesContext(s.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(s.getAttrs){let e=s.getAttrs(t);if(!1===e)continue;s.attrs=e||void 0}return s}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,s=0;for(;s<t.length;s++){let e=t[s];if((null==e.priority?50:e.priority)<n)break}t.splice(s,0,e)}for(let s in e.marks){let t=e.marks[s].spec.parseDOM;t&&t.forEach(e=>{n(e=$t(e)),e.mark||e.ignore||e.clearMark||(e.mark=s)})}for(let s in e.nodes){let t=e.nodes[s].spec.parseDOM;t&&t.forEach(e=>{n(e=$t(e)),e.node||e.ignore||e.mark||(e.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Mt(e,Mt.schemaRules(e)))}}const At={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Nt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Et={ol:!0,ul:!0};function It(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Rt{constructor(e,t,n,s,r,i){this.type=e,this.attrs=t,this.marks=n,this.solid=s,this.options=i,this.content=[],this.activeMarks=We.none,this.match=r||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Ve.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Ve.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Ve.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!At.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Lt{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let s,r=t.topNode,i=It(null,t.preserveWhitespace,0)|(n?4:0);s=r?new Rt(r.type,r.attrs,We.none,!0,t.topMatch||r.type.contentMatch,i):new Rt(n?null:e.schema.topNodeType,null,We.none,!0,null,i),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,s=this.top,r=2&s.options?"full":this.localPreserveWS||(1&s.options)>0,{schema:i}=this.parser;if("full"===r||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r)if("full"===r)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(i.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=s.content[s.content.length-1],r=e.previousSibling;(!t||r&&"BR"==r.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let s=this.localPreserveWS,r=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i,a=e.nodeName.toLowerCase();Et.hasOwnProperty(a)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Et.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));e:if(o?o.ignore:Nt.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let n,s=this.needsBlock;if(At.hasOwnProperty(a))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),n=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let i=o&&o.skip?t:this.readStyles(e,t);i&&this.addAll(e,i),n&&this.sync(r),this.needsBlock=s}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,o,n,!1===o.consuming?i:void 0)}this.localPreserveWS=s}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let e=this.parser.matchedStyles[s],r=n.getPropertyValue(e);if(r)for(let n;;){let s=this.parser.matchStyle(e,r,this,n);if(!s)break;if(s.ignore)return null;if(t=s.clearMark?t.filter(e=>!s.clearMark(e)):t.concat(this.parser.schema.marks[s.mark].create(s.attrs)),!1!==s.consuming)break;n=s}}return t}addElementByRule(e,t,n,s){let r,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(r=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(s)this.addElement(e,n,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let s=e;"string"==typeof t.contentElement?s=e.querySelector(t.contentElement):"function"==typeof t.contentElement?s=t.contentElement(e):t.contentElement&&(s=t.contentElement),this.findAround(e,s,!0),this.addAll(s,n),this.findAround(e,s,!1)}r&&this.sync(a)&&this.open--}addAll(e,t,n,s){let r=n||0;for(let i=n?e.childNodes[n]:e.firstChild,a=null==s?null:e.childNodes[s];i!=a;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i,t);this.findAtPoint(e,r)}findPlace(e,t,n){let s,r;for(let i=this.open,a=0;i>=0;i--){let t=this.nodes[i],o=t.findWrapping(e);if(o&&(!s||s.length>o.length+a)&&(s=o,r=t,!o.length))break;if(t.solid){if(n)break;a+=2}}if(!s)return null;this.sync(r);for(let i=0;i<s.length;i++)t=this.enterInner(s[i],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let s=this.findPlace(e,t,n);if(s){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=We.none;for(let r of s.concat(e.marks))(t.type?t.type.allowsMarkType(r.type):Vt(r.type,e.type))&&(n=r.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,s){let r=this.findPlace(e.create(t),n,!1);return r&&(r=this.enterInner(e,t,n,!0,s)),r}enterInner(e,t,n,s=!1,r){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let a=It(e,r,i.options);4&i.options&&0==i.content.length&&(a|=4);let o=We.none;return n=n.filter(t=>!(i.type?i.type.allowsMarkType(t.type):Vt(t.type,e))||(o=t.addToSet(o),!1)),this.nodes.push(new Rt(e,t,o,s,null,a)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)null==this.find[s].pos&&1==e.nodeType&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(n?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,s=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),r=-(n?n.depth+1:0)+(s?0:1),i=(e,a)=>{for(;e>=0;e--){let o=t[e];if(""==o){if(e==t.length-1||0==e)continue;for(;a>=r;a--)if(i(e-1,a))return!0;return!1}{let e=a>0||0==a&&s?this.nodes[a].type:n&&a>=r?n.node(a-r).type:null;if(!e||e.name!=o&&!e.isInGroup(o))return!1;a--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}}function Pt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function $t(e){let t={};for(let n in e)t[n]=e[n];return t}function Vt(e,t){let n=t.schema.nodes;for(let s in n){let r=n[s];if(!r.allowsMarkType(e))continue;let i=[],a=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:s,next:r}=e.edge(n);if(s==t)return!0;if(i.indexOf(r)<0&&a(r))return!0}};if(a(r.contentMatch))return!0}}class Bt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=zt(t).createDocumentFragment());let s=n,r=[];return e.forEach(e=>{if(r.length||e.marks.length){let n=0,i=0;for(;n<r.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(r[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<r.length;)s=r.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],a=this.serializeMark(n,e.isInline,t);a&&(r.push([n,s]),s.appendChild(a.dom),s=a.contentDOM||a.dom)}}s.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:s}=jt(zt(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let r=this.serializeMark(e.marks[s],e.isInline,t);r&&((r.contentDOM||r.dom).appendChild(n),n=r.dom)}return n}serializeMark(e,t,n={}){let s=this.marks[e.type.name];return s&&jt(zt(n),s(e,t),null,e.attrs)}static renderSpec(e,t,n=null,s){return jt(e,t,n,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Bt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Ft(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Ft(e.marks)}}function Ft(e){let t={};for(let n in e){let s=e[n].spec.toDOM;s&&(t[n]=s)}return t}function zt(e){return e.document||window.document}const Wt=new WeakMap;function jt(e,t,n,s){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(s&&(r=function(e){let t=Wt.get(e);return void 0===t&&Wt.set(e,t=function(e){let t=null;return function e(n){if(n&&"object"==typeof n)if(Array.isArray(n))if("string"==typeof n[0])t||(t=[]),t.push(n);else for(let t=0;t<n.length;t++)e(n[t]);else for(let t in n)e(n[t])}(e),t}(e)),t}(s))&&r.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a,o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let l=n?e.createElementNS(n,i):e.createElement(i),c=t[1],u=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){u=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?l.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&l.style?l.style.cssText=c[e]:l.setAttribute(e,c[e])}}for(let d=u;d<t.length;d++){let r=t[d];if(0===r){if(d<t.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}{let{dom:t,contentDOM:i}=jt(e,r,n,s);if(l.appendChild(t),i){if(a)throw new RangeError("Multiple content holes");a=i}}}return{dom:l,contentDOM:a}}const _t=Math.pow(2,16);function Ut(e,t){return e+t*_t}function Kt(e){return 65535&e}class qt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Ht{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ht.empty)return Ht.empty}recover(e){let t=0,n=Kt(e);if(!this.inverted)for(let s=0;s<n;s++)t+=this.ranges[3*s+2]-this.ranges[3*s+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/_t}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let s=0,r=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let o=this.ranges[a]-(this.inverted?s:0);if(o>e)break;let l=this.ranges[a+r],c=this.ranges[a+i],u=o+l;if(e<=u){let r=o+s+((l?e==o?-1:e==u?1:t:t)<0?0:c);if(n)return r;let i=e==(t<0?o:u)?null:Ut(a/3,e-o),d=e==o?2:e==u?1:4;return(t<0?e!=o:e!=u)&&(d|=8),new qt(r,d,i)}s+=c-l}return n?e+s:new qt(e+s,0,null)}touches(e,t){let n=0,s=Kt(t),r=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let t=this.ranges[a]-(this.inverted?n:0);if(t>e)break;let o=this.ranges[a+r];if(e<=t+o&&a==3*s)return!0;n+=this.ranges[a+i]-o}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let s=0,r=0;s<this.ranges.length;s+=3){let i=this.ranges[s],a=i-(this.inverted?r:0),o=i+(this.inverted?0:r),l=this.ranges[s+t],c=this.ranges[s+n];e(a,a+l,o,o+c),r+=c-l}}invert(){return new Ht(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Ht.empty:new Ht(e<0?[0,-e,0]:[0,0,e])}}Ht.empty=new Ht([]);class Yt{constructor(e,t,n=0,s=(e?e.length:0)){this.mirror=t,this.from=n,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Yt(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],null!=s&&s<t?n+s:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=s&&s>t?n-s-1:void 0)}}invert(){let e=new Yt;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let s=0;for(let r=this.from;r<this.to;r++){let n=this._maps[r].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(r);if(null!=t&&t>r&&t<this.to){r=t,e=this._maps[t].recover(n.recover);continue}}s|=n.delInfo,e=n.pos}return n?e:new qt(e,s,null)}}const Jt=Object.create(null);class Gt{getMap(){return Ht.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Jt[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Jt)throw new RangeError("Duplicate use of step JSON ID "+e);return Jt[e]=t,t.prototype.jsonID=e,t}}class Qt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Qt(e,null)}static fail(e){return new Qt(null,e)}static fromReplace(e,t,n,s){try{return Qt.ok(e.replace(t,n,s))}catch(r){if(r instanceof je)return Qt.fail(r.message);throw r}}}function Zt(e,t,n){let s=[];for(let r=0;r<e.childCount;r++){let i=e.child(r);i.content.size&&(i=i.copy(Zt(i.content,t,i))),i.isInline&&(i=t(i,n,r)),s.push(i)}return Ve.fromArray(s)}class Xt extends Gt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),s=n.node(n.sharedDepth(this.to)),r=new _e(Zt(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,s),t.openStart,t.openEnd);return Qt.fromReplace(e,this.from,this.to,r)}invert(){return new en(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Xt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Xt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Xt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Xt(t.from,t.to,e.markFromJSON(t.mark))}}Gt.jsonID("addMark",Xt);class en extends Gt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new _e(Zt(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Qt.fromReplace(e,this.from,this.to,n)}invert(){return new Xt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new en(t.pos,n.pos,this.mark)}merge(e){return e instanceof en&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new en(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new en(t.from,t.to,e.markFromJSON(t.mark))}}Gt.jsonID("removeMark",en);class tn extends Gt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qt.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Qt.fromReplace(e,this.pos,this.pos+1,new _e(Ve.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new tn(this.pos,t.marks[n]);return new tn(this.pos,this.mark)}}return new nn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new tn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new tn(t.pos,e.markFromJSON(t.mark))}}Gt.jsonID("addNodeMark",tn);class nn extends Gt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qt.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Qt.fromReplace(e,this.pos,this.pos+1,new _e(Ve.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new tn(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new nn(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new nn(t.pos,e.markFromJSON(t.mark))}}Gt.jsonID("removeNodeMark",nn);class sn extends Gt{constructor(e,t,n,s=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=s}apply(e){return this.structure&&an(e,this.from,this.to)?Qt.fail("Structure replace would overwrite content"):Qt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ht([this.from,this.to-this.from,this.slice.size])}invert(e){return new sn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new sn(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof sn)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?_e.empty:new _e(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new sn(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?_e.empty:new _e(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new sn(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new sn(t.from,t.to,_e.fromJSON(e,t.slice),!!t.structure)}}Gt.jsonID("replace",sn);class rn extends Gt{constructor(e,t,n,s,r,i,a=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=s,this.slice=r,this.insert=i,this.structure=a}apply(e){if(this.structure&&(an(e,this.from,this.gapFrom)||an(e,this.gapTo,this.to)))return Qt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Qt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Qt.fromReplace(e,this.from,this.to,n):Qt.fail("Content does not fit in gap")}getMap(){return new Ht([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new rn(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),r=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||s<t.pos||r>n.pos?null:new rn(t.pos,n.pos,s,r,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new rn(t.from,t.to,t.gapFrom,t.gapTo,_e.fromJSON(e,t.slice),t.insert,!!t.structure)}}function an(e,t,n){let s=e.resolve(t),r=n-t,i=s.depth;for(;r>0&&i>0&&s.indexAfter(i)==s.node(i).childCount;)i--,r--;if(r>0){let e=s.node(i).maybeChild(s.indexAfter(i));for(;r>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,r--}}return!1}function on(e,t,n,s=n.contentMatch,r=!0){let i=e.doc.nodeAt(t),a=[],o=t+1;for(let l=0;l<i.childCount;l++){let t=i.child(l),c=o+t.nodeSize,u=s.matchType(t.type);if(u){s=u;for(let s=0;s<t.marks.length;s++)n.allowsMarkType(t.marks[s].type)||e.step(new en(o,c,t.marks[s]));if(r&&t.isText&&"pre"!=n.whitespace){let e,s,r=/\r?\n|\r/g;for(;e=r.exec(t.text);)s||(s=new _e(Ve.from(n.schema.text(" ",n.allowedMarks(t.marks))),0,0)),a.push(new sn(o+e.index,o+e.index+e[0].length,s))}}else a.push(new sn(o,c,_e.empty));o=c}if(!s.validEnd){let t=s.fillBefore(Ve.empty,!0);e.replace(o,o,new _e(t,0,0))}for(let l=a.length-1;l>=0;l--)e.step(a[l])}function ln(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function cn(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,s=0,r=0;;--n){let i=e.$from.node(n),a=e.$from.index(n)+s,o=e.$to.indexAfter(n)-r;if(n<e.depth&&i.canReplace(a,o,t))return n;if(0==n||i.type.spec.isolating||!ln(i,a,o))break;a&&(s=1),o<i.childCount&&(r=1)}return null}function un(e,t,n=null,s=e){let r=function(e,t){let{parent:n,startIndex:s,endIndex:r}=e,i=n.contentMatchAt(s).findWrapping(t);if(!i)return null;let a=i.length?i[0]:t;return n.canReplaceWith(s,r,a)?i:null}(e,t),i=r&&function(e,t){let{parent:n,startIndex:s,endIndex:r}=e,i=n.child(s),a=t.contentMatch.findWrapping(i.type);if(!a)return null;let o=(a.length?a[a.length-1]:t).contentMatch;for(let l=s;o&&l<r;l++)o=o.matchType(n.child(l).type);return o&&o.validEnd?a:null}(s,t);return i?r.map(dn).concat({type:t,attrs:n}).concat(i.map(dn)):null}function dn(e){return{type:e,attrs:null}}function pn(e,t,n,s){t.forEach((r,i)=>{if(r.isText){let a,o=/\r?\n|\r/g;for(;a=o.exec(r.text);){let r=e.mapping.slice(s).map(n+1+i+a.index);e.replaceWith(r,r+1,t.type.schema.linebreakReplacement.create())}}})}function fn(e,t,n,s){t.forEach((r,i)=>{if(r.type==r.type.schema.linebreakReplacement){let r=e.mapping.slice(s).map(n+1+i);e.replaceWith(r,r+1,t.type.schema.text("\n"))}})}function hn(e,t,n=1,s){let r=e.resolve(t),i=r.depth-n,a=s&&s[s.length-1]||r.parent;if(i<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!a.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let c=r.depth-1,u=n-2;c>i;c--,u--){let e=r.node(c),t=r.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),i=s&&s[u+1];i&&(n=n.replaceChild(0,i.type.create(i.attrs)));let a=s&&s[u]||e;if(!e.canReplace(t+1,e.childCount)||!a.type.validContent(n))return!1}let o=r.indexAfter(i),l=s&&s[0];return r.node(i).canReplaceWith(o,o,l?l.type:r.node(i+1).type)}function mn(e,t){let n=e.resolve(t),s=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:s}=e.type.schema;for(let r=0;r<t.childCount;r++){let i=t.child(r),a=i.type==s?e.type.schema.nodes.text:i.type;if(n=n.matchType(a),!n)return!1;if(!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(s,s+1)}function gn(e,t,n=t,s=_e.empty){if(t==n&&!s.size)return null;let r=e.resolve(t),i=e.resolve(n);return yn(r,i,s)?new sn(t,n,s):new kn(r,i,s).fit()}function yn(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Gt.jsonID("replaceAround",rn);class kn{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Ve.empty;for(let s=0;s<=e.depth;s++){let t=e.node(s);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=Ve.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,s=this.close(e<0?this.$to:n.doc.resolve(e));if(!s)return null;let r=this.placed,i=n.depth,a=s.depth;for(;i&&a&&1==r.childCount;)r=r.firstChild.content,i--,a--;let o=new _e(r,i,a);return e>-1?new rn(n.pos,e,this.$to.pos,this.$to.end(),o,t):o.size||n.pos!=this.$to.pos?new sn(n.pos,s.pos,o):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,s=this.unplaced.openEnd;n<e;n++){let r=t.firstChild;if(t.childCount>1&&(s=0),r.type.spec.isolating&&s<=n){e=n;break}t=r.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,s=null;n?(s=vn(this.unplaced.content,n-1).firstChild,e=s.content):e=this.unplaced.content;let r=e.firstChild;for(let i=this.depth;i>=0;i--){let e,{type:a,match:o}=this.frontier[i],l=null;if(1==t&&(r?o.matchType(r.type)||(l=o.fillBefore(Ve.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:i,parent:s,inject:l};if(2==t&&r&&(e=o.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:i,parent:s,wrap:e};if(s&&o.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,s=vn(e,t);return!(!s.childCount||s.firstChild.isLeaf||(this.unplaced=new _e(e,t+1,Math.max(n,s.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,s=vn(e,t);if(s.childCount<=1&&t>0){let r=e.size-t<=t+s.size;this.unplaced=new _e(wn(e,t-1,1),t-1,r?t-1:n)}else this.unplaced=new _e(wn(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:s,wrap:r}){for(;this.depth>t;)this.closeFrontierNode();if(r)for(let h=0;h<r.length;h++)this.openFrontierNode(r[h]);let i=this.unplaced,a=n?n.content:i.content,o=i.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(s){for(let e=0;e<s.childCount;e++)c.push(s.child(e));u=u.matchFragment(s)}let p=a.size+e-(i.content.size-i.openEnd);for(;l<a.childCount;){let e=a.child(l),t=u.matchType(e.type);if(!t)break;l++,(l>1||0==o||e.content.size)&&(u=t,c.push(Sn(e.mark(d.allowedMarks(e.marks)),1==l?o:0,l==a.childCount?p:-1)))}let f=l==a.childCount;f||(p=-1),this.placed=bn(this.placed,t,Ve.from(c)),this.frontier[t].match=u,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let h=0,m=a;h<p;h++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=f?0==e?_e.empty:new _e(wn(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new _e(wn(i.content,e,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!xn(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,s=this.$to.after(n);for(;n>1&&s==this.$to.end(--n);)++s;return s}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:s}=this.frontier[t],r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=xn(e,t,s,n,r);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:s}=this.frontier[n],r=xn(e,n,s,t,!0);if(!r||r.childCount)continue e}return{depth:t,fit:i,move:r?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=bn(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),s=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,s)}return e}openFrontierNode(e,t=null,n){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=bn(this.placed,this.depth,Ve.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Ve.empty,!0);e.childCount&&(this.placed=bn(this.placed,this.frontier.length,e))}}function wn(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(wn(e.firstChild.content,t-1,n)))}function bn(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(bn(e.lastChild.content,t-1,n)))}function vn(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Sn(e,t,n){if(t<=0)return e;let s=e.content;return t>1&&(s=s.replaceChild(0,Sn(s.firstChild,t-1,1==s.childCount?n-1:0))),t>0&&(s=e.type.contentMatch.fillBefore(s).append(s),n<=0&&(s=s.append(e.type.contentMatch.matchFragment(s).fillBefore(Ve.empty,!0)))),e.copy(s)}function xn(e,t,n,s,r){let i=e.node(t),a=r?e.indexAfter(t):e.index(t);if(a==i.childCount&&!n.compatibleContent(i.type))return null;let o=s.fillBefore(i.content,!0,a);return o&&!function(e,t,n){for(let s=n;s<t.childCount;s++)if(!e.allowsMarks(t.child(s).marks))return!0;return!1}(n,i.content,a)?o:null}function Cn(e){return e.spec.defining||e.spec.definingForContent}function Tn(e,t,n,s,r){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(Tn(r.content,t+1,n,s,r)))}if(t>s){let t=r.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Ve.empty,!0))}return e}function On(e,t){let n=[];for(let s=Math.min(e.depth,t.depth);s>=0;s--){let r=e.start(s);if(r<e.pos-(e.depth-s)||t.end(s)>t.pos+(t.depth-s)||e.node(s).type.spec.isolating||t.node(s).type.spec.isolating)break;(r==t.start(s)||s==e.depth&&s==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&s&&t.start(s-1)==r-1)&&n.push(s)}return n}class Dn extends Gt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qt.fail("No node at attribute step's position");let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let s=t.type.create(n,null,t.marks);return Qt.fromReplace(e,this.pos,this.pos+1,new _e(Ve.from(s),0,t.isLeaf?0:1))}getMap(){return Ht.empty}invert(e){return new Dn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Dn(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Dn(t.pos,t.attr,t.value)}}Gt.jsonID("attr",Dn);class Mn extends Gt{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let s in e.attrs)t[s]=e.attrs[s];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Qt.ok(n)}getMap(){return Ht.empty}invert(e){return new Mn(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Mn(t.attr,t.value)}}Gt.jsonID("docAttr",Mn);let An=class extends Error{};An=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(An.prototype=Object.create(Error.prototype)).constructor=An,An.prototype.name="TransformError";class Nn{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Yt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new An(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let s=this.mapping.maps[n];n&&(e=s.map(e,1),t=s.map(t,-1)),s.forEach((n,s,r,i)=>{e=Math.min(e,r),t=Math.max(t,i)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=_e.empty){let s=gn(this.doc,e,t,n);return s&&this.step(s),this}replaceWith(e,t,n){return this.replace(e,t,new _e(Ve.from(n),0,0))}delete(e,t){return this.replace(e,t,_e.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,s){if(!s.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),i=e.doc.resolve(n);if(yn(r,i,s))return e.step(new sn(t,n,s));let a=On(r,i);0==a[a.length-1]&&a.pop();let o=-(r.depth+1);a.unshift(o);for(let p=r.depth,f=r.pos-1;p>0;p--,f--){let e=r.node(p).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;a.indexOf(p)>-1?o=p:r.before(p)==f&&a.splice(1,0,-p)}let l=a.indexOf(o),c=[],u=s.openStart;for(let p=s.content,f=0;;f++){let e=p.firstChild;if(c.push(e),f==s.openStart)break;p=e.content}for(let p=u-1;p>=0;p--){let e=c[p],t=Cn(e.type);if(t&&!e.sameMarkup(r.node(Math.abs(o)-1)))u=p;else if(t||!e.type.isTextblock)break}for(let p=s.openStart;p>=0;p--){let t=(p+u+1)%(s.openStart+1),o=c[t];if(o)for(let c=0;c<a.length;c++){let u=a[(c+l)%a.length],d=!0;u<0&&(d=!1,u=-u);let p=r.node(u-1),f=r.index(u-1);if(p.canReplaceWith(f,f,o.type,o.marks))return e.replace(r.before(u),d?i.after(u):n,new _e(Tn(s.content,0,s.openStart,t),t,s.openEnd))}}let d=e.steps.length;for(let p=a.length-1;p>=0&&(e.replace(t,n,s),!(e.steps.length>d));p--){let e=a[p];e<0||(t=r.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,s){if(!s.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=function(e,t,n){let s=e.resolve(t);if(s.parent.canReplaceWith(s.index(),s.index(),n))return t;if(0==s.parentOffset)for(let r=s.depth-1;r>=0;r--){let e=s.index(r);if(s.node(r).canReplaceWith(e,e,n))return s.before(r+1);if(e>0)return null}if(s.parentOffset==s.parent.content.size)for(let r=s.depth-1;r>=0;r--){let e=s.indexAfter(r);if(s.node(r).canReplaceWith(e,e,n))return s.after(r+1);if(e<s.node(r).childCount)return null}return null}(e.doc,t,s.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new _e(Ve.from(s),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let s=e.doc.resolve(t),r=e.doc.resolve(n),i=On(s,r);for(let a=0;a<i.length;a++){let t=i[a],n=a==i.length-1;if(n&&0==t||s.node(t).type.contentMatch.validEnd)return e.delete(s.start(t),r.end(t));if(t>0&&(n||s.node(t-1).canReplace(s.index(t-1),r.indexAfter(t-1))))return e.delete(s.before(t),r.after(t))}for(let a=1;a<=s.depth&&a<=r.depth;a++)if(t-s.start(a)==s.depth-a&&n>s.end(a)&&r.end(a)-n!=r.depth-a&&s.start(a-1)==r.start(a-1)&&s.node(a-1).canReplace(s.index(a-1),r.index(a-1)))return e.delete(s.before(a),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:s,$to:r,depth:i}=t,a=s.before(i+1),o=r.after(i+1),l=a,c=o,u=Ve.empty,d=0;for(let h=i,m=!1;h>n;h--)m||s.index(h)>0?(m=!0,u=Ve.from(s.node(h).copy(u)),d++):l--;let p=Ve.empty,f=0;for(let h=i,m=!1;h>n;h--)m||r.after(h+1)<r.end(h)?(m=!0,p=Ve.from(r.node(h).copy(p)),f++):c++;e.step(new rn(l,c,a,o,new _e(u.append(p),d,f),u.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let s=null,{linebreakReplacement:r}=e.doc.type.schema,i=e.doc.resolve(t-n),a=i.node().type;if(r&&a.inlineContent){let e="pre"==a.whitespace,t=!!a.contentMatch.matchType(r);e&&!t?s=!1:!e&&t&&(s=!0)}let o=e.steps.length;if(!1===s){let s=e.doc.resolve(t+n);fn(e,s.node(),s.before(),o)}a.inlineContent&&on(e,t+n-1,a,i.node().contentMatchAt(i.index()),null==s);let l=e.mapping.slice(o),c=l.map(t-n);if(e.step(new sn(c,l.map(t+n,-1),_e.empty,!0)),!0===s){let t=e.doc.resolve(c);pn(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let s=Ve.empty;for(let a=n.length-1;a>=0;a--){if(s.size){let e=n[a].type.contentMatch.matchFragment(s);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=Ve.from(n[a].type.create(n[a].attrs,s))}let r=t.start,i=t.end;e.step(new rn(r,i,r,i,new _e(s,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,s=null){return function(e,t,n,s,r){if(!s.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let a="function"==typeof r?r(t):r;if(t.isTextblock&&!t.hasMarkup(s,a)&&function(e,t,n){let s=e.resolve(t),r=s.index();return s.parent.canReplaceWith(r,r+1,n)}(e.doc,e.mapping.slice(i).map(n),s)){let r=null;if(s.schema.linebreakReplacement){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(s.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0)}!1===r&&fn(e,t,n,i),on(e,e.mapping.slice(i).map(n,1),s,void 0,null===r);let o=e.mapping.slice(i),l=o.map(n,1),c=o.map(n+t.nodeSize,1);return e.step(new rn(l,c,l+1,c-1,new _e(Ve.from(s.create(a,null,t.marks)),0,0),1,!0)),!0===r&&pn(e,t,n,i),!1}})}(this,e,t,n,s),this}setNodeMarkup(e,t,n=null,s){return function(e,t,n,s,r){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let a=n.create(s,null,r||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,a);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new rn(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new _e(Ve.from(a),0,0),1,!0))}(this,e,t,n,s),this}setNodeAttribute(e,t,n){return this.step(new Dn(e,t,n)),this}setDocAttribute(e,t){return this.step(new Mn(e,t)),this}addNodeMark(e,t){return this.step(new tn(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof We)t.isInSet(n.marks)&&this.step(new nn(e,t));else{let s,r=n.marks,i=[];for(;s=t.isInSet(r);)i.push(new nn(e,s)),r=s.removeFromSet(r);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,n){return function(e,t,n=1,s){let r=e.doc.resolve(t),i=Ve.empty,a=Ve.empty;for(let o=r.depth,l=r.depth-n,c=n-1;o>l;o--,c--){i=Ve.from(r.node(o).copy(i));let e=s&&s[c];a=Ve.from(e?e.type.create(e.attrs,a):r.node(o).copy(a))}e.step(new sn(t,t,new _e(i.append(a),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,s){let r,i,a=[],o=[];e.doc.nodesBetween(t,n,(e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!s.isInSet(u)&&c.type.allowsMarkType(s.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=s.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(r&&r.to==c&&r.mark.eq(u[e])?r.to=d:a.push(r=new en(c,d,u[e])));i&&i.to==c?i.to=d:o.push(i=new Xt(c,d,s))}}),a.forEach(t=>e.step(t)),o.forEach(t=>e.step(t))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,s){let r=[],i=0;e.doc.nodesBetween(t,n,(e,a)=>{if(!e.isInline)return;i++;let o=null;if(s instanceof Tt){let t,n=e.marks;for(;t=s.isInSet(n);)(o||(o=[])).push(t),n=t.removeFromSet(n)}else s?s.isInSet(e.marks)&&(o=[s]):o=e.marks;if(o&&o.length){let s=Math.min(a+e.nodeSize,n);for(let e=0;e<o.length;e++){let n,l=o[e];for(let e=0;e<r.length;e++){let t=r[e];t.step==i-1&&l.eq(r[e].style)&&(n=t)}n?(n.to=s,n.step=i):r.push({style:l,from:Math.max(a,t),to:s,step:i})}}}),r.forEach(t=>e.step(new en(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return on(this,e,t,n),this}}const En=Object.create(null);class In{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Rn(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=_e.empty){let n=t.content.lastChild,s=null;for(let a=0;a<t.openEnd;a++)s=n,n=n.lastChild;let r=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:o,$to:l}=i[a],c=e.mapping.slice(r);e.replaceRange(c.map(o.pos),c.map(l.pos),a?_e.empty:t),0==a&&_n(e,r,(n?n.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,s=this.ranges;for(let r=0;r<s.length;r++){let{$from:i,$to:a}=s[r],o=e.mapping.slice(n),l=o.map(i.pos),c=o.map(a.pos);r?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),_n(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let s=e.parent.inlineContent?new $n(e):jn(e.node(0),e.parent,e.pos,e.index(),t,n);if(s)return s;for(let r=e.depth-1;r>=0;r--){let s=t<0?jn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):jn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new zn(e.node(0))}static atStart(e){return jn(e,e,0,0,1)||new zn(e)}static atEnd(e){return jn(e,e,e.content.size,e.childCount,-1)||new zn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=En[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in En)throw new RangeError("Duplicate use of selection JSON ID "+e);return En[e]=t,t.prototype.jsonID=e,t}getBookmark(){return $n.between(this.$anchor,this.$head).getBookmark()}}In.prototype.visible=!0;class Rn{constructor(e,t){this.$from=e,this.$to=t}}let Ln=!1;function Pn(e){Ln||e.parent.inlineContent||(Ln=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class $n extends In{constructor(e,t=e){Pn(e),Pn(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return In.near(n);let s=e.resolve(t.map(this.anchor));return new $n(s.parent.inlineContent?s:n,n)}replace(e,t=_e.empty){if(super.replace(e,t),t==_e.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof $n&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Vn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new $n(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let s=e.resolve(t);return new this(s,n==t?s:e.resolve(n))}static between(e,t,n){let s=e.pos-t.pos;if(n&&!s||(n=s>=0?1:-1),!t.parent.inlineContent){let e=In.findFrom(t,n,!0)||In.findFrom(t,-n,!0);if(!e)return In.near(t,n);t=e.$head}return e.parent.inlineContent||(0==s||(e=(In.findFrom(e,-n,!0)||In.findFrom(e,n,!0)).$anchor).pos<t.pos!=s<0)&&(e=t),new $n(e,t)}}In.jsonID("text",$n);class Vn{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Vn(e.map(this.anchor),e.map(this.head))}resolve(e){return $n.between(e.resolve(this.anchor),e.resolve(this.head))}}class Bn extends In{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:s}=t.mapResult(this.anchor),r=e.resolve(s);return n?In.near(r):new Bn(r)}content(){return new _e(Ve.from(this.node),0,0)}eq(e){return e instanceof Bn&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Fn(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Bn(e.resolve(t.anchor))}static create(e,t){return new Bn(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Bn.prototype.visible=!1,In.jsonID("node",Bn);class Fn{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Vn(n,n):new Fn(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Bn.isSelectable(n)?new Bn(t):In.near(t)}}class zn extends In{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=_e.empty){if(t==_e.empty){e.delete(0,e.doc.content.size);let t=In.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new zn(e)}map(e){return new zn(e)}eq(e){return e instanceof zn}getBookmark(){return Wn}}In.jsonID("all",zn);const Wn={map(){return this},resolve:e=>new zn(e)};function jn(e,t,n,s,r,i=!1){if(t.inlineContent)return $n.create(e,n);for(let a=s-(r>0?0:1);r>0?a<t.childCount:a>=0;a+=r){let s=t.child(a);if(s.isAtom){if(!i&&Bn.isSelectable(s))return Bn.create(e,n-(r<0?s.nodeSize:0))}else{let t=jn(e,s,n+r,r<0?s.childCount:0,r,i);if(t)return t}n+=s.nodeSize*r}return null}function _n(e,t,n){let s=e.steps.length-1;if(s<t)return;let r,i=e.steps[s];(i instanceof sn||i instanceof rn)&&(e.mapping.maps[s].forEach((e,t,n,s)=>{null==r&&(r=s)}),e.setSelection(In.near(e.doc.resolve(r),n)))}class Un extends Nn{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return We.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||We.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let s=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let r=this.storedMarks;if(!r){let e=this.doc.resolve(t);r=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,s.text(e,r)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(In.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Kn(e,t){return t&&e?e.bind(t):e}class qn{constructor(e,t,n){this.name=e,this.init=Kn(t.init,n),this.apply=Kn(t.apply,n)}}const Hn=[new qn("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new qn("selection",{init:(e,t)=>e.selection||In.atStart(t.doc),apply:e=>e.selection}),new qn("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,s)=>s.selection.$cursor?e.storedMarks:null}),new qn("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Yn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Hn.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new qn(e.key,e.spec.state,e))})}}class Jn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),s=null;for(;;){let r=!1;for(let i=0;i<this.config.plugins.length;i++){let a=this.config.plugins[i];if(a.spec.appendTransaction){let o=s?s[i].n:0,l=s?s[i].state:this,c=o<t.length&&a.spec.appendTransaction.call(a,o?t.slice(o):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!s){s=[];for(let e=0;e<this.config.plugins.length;e++)s.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),r=!0}s&&(s[i]={state:n,n:t.length})}}if(!r)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Jn(this.config),n=this.config.fields;for(let s=0;s<n.length;s++){let r=n[s];t[r.name]=r.apply(e,this[r.name],this,t)}return t}get tr(){return new Un(this)}static create(e){let t=new Yn(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Jn(t);for(let s=0;s<t.fields.length;s++)n[t.fields[s].name]=t.fields[s].init(e,n);return n}reconfigure(e){let t=new Yn(this.schema,e.plugins),n=t.fields,s=new Jn(t);for(let r=0;r<n.length;r++){let t=n[r].name;s[t]=this.hasOwnProperty(t)?this[t]:n[r].init(e,s)}return s}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[n],r=s.spec.state;r&&r.toJSON&&(t[n]=r.toJSON.call(s,this[s.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new Yn(e.schema,e.plugins),r=new Jn(s);return s.fields.forEach(s=>{if("doc"==s.name)r.doc=ot.fromJSON(e.schema,t.doc);else if("selection"==s.name)r.selection=In.fromJSON(r.doc,t.selection);else if("storedMarks"==s.name)t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let a=n[i],o=a.spec.state;if(a.key==s.name&&o&&o.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(r[s.name]=o.fromJSON.call(a,e,t[i],r))}r[s.name]=s.init(e,r)}}),r}}function Gn(e,t,n){for(let s in e){let r=e[s];r instanceof Function?r=r.bind(t):"handleDOMEvents"==s&&(r=Gn(r,t,{})),n[s]=r}return n}class Qn{constructor(e){this.spec=e,this.props={},e.props&&Gn(e.props,this,this.props),this.key=e.key?e.key.key:Xn("plugin")}getState(e){return e[this.key]}}const Zn=Object.create(null);function Xn(e){return e in Zn?e+"$"+ ++Zn[e]:(Zn[e]=0,e+"$")}class es{constructor(e="key"){this.key=Xn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}var ts=function(e){return e.docTypeError="docTypeError",e.contextNotFound="contextNotFound",e.timerNotFound="timerNotFound",e.ctxCallOutOfScope="ctxCallOutOfScope",e.createNodeInParserFail="createNodeInParserFail",e.stackOverFlow="stackOverFlow",e.parserMatchError="parserMatchError",e.serializerMatchError="serializerMatchError",e.getAtomFromSchemaFail="getAtomFromSchemaFail",e.expectDomTypeError="expectDomTypeError",e.callCommandBeforeEditorView="callCommandBeforeEditorView",e.missingRootElement="missingRootElement",e.missingNodeInSchema="missingNodeInSchema",e.missingMarkInSchema="missingMarkInSchema",e.ctxNotBind="ctxNotBind",e.missingYjsDoc="missingYjsDoc",e.aiProviderError="aiProviderError",e.aiBuildContextError="aiBuildContextError",e}({}),ns=class extends Error{constructor(e,t,n){super(t,n),this.name="MilkdownError",this.code=e,void 0!==n?.cause&&(this.cause=n.cause)}},ss=(e,t)=>"function"==typeof t?"[Function]":t,rs=e=>JSON.stringify(e,ss);function is(){return new ns(ts.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function as(){return new ns(ts.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function ls(e){return new ns(ts.expectDomTypeError,`Expect to be a dom, but get: ${rs(e)}.`)}function cs(){return new ns(ts.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}function us(e){return new ns(ts.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`)}function ds(e){try{return rs(e)}catch{return"[Unserializable]"}}function ps(e){const t=e instanceof Error?e.message:ds(e);return new ns(ts.aiProviderError,`AI provider error: ${t}`,{cause:e})}function fs(e){const t=e instanceof Error?e.message:ds(e);return new ns(ts.aiBuildContextError,`AI buildContext failed: ${t}`,{cause:e})}var hs=class{constructor(){this.sliceMap=new Map,this.get=e=>{const t="string"==typeof e?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);if(!t)throw function(e){return new ns(ts.contextNotFound,`Context "${e}" not found, do you forget to inject it?`)}("string"==typeof e?e:e.name);return t},this.remove=e=>{const t="string"==typeof e?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);t&&this.sliceMap.delete(t.type.id)},this.has=e=>"string"==typeof e?[...this.sliceMap.values()].some(t=>t.type.name===e):this.sliceMap.has(e.id)}},ms=class{#e;#t;#n;constructor(e,t,n){this.#e=[],this.#n=()=>{this.#e.forEach(e=>e(this.#t))},this.set=e=>{this.#t=e,this.#n()},this.get=()=>this.#t,this.update=e=>{this.#t=e(this.#t),this.#n()},this.type=n,this.#t=t,e.set(n.id,this)}on(e){return this.#e.push(e),()=>{this.#e=this.#e.filter(t=>t!==e)}}once(e){const t=this.on(n=>{e(n),t()});return t}off(e){this.#e=this.#e.filter(t=>t!==e)}offAll(){this.#e=[]}},gs=class{constructor(e,t){this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw is()}}create(e,t=this._defaultValue){return new ms(e,t,this)}},ys=(e,t)=>new gs(e,t),ks=class{#s;#r;#i;#a;#o;#l;#c;constructor(e,t,n){this.#a=new Set,this.#o=new Set,this.#l=new Map,this.#c=new Map,this.read=()=>({metadata:this.#s,injectedSlices:[...this.#a].map(e=>({name:"string"==typeof e?e:e.name,value:this.#u(e)})),consumedSlices:[...this.#o].map(e=>({name:"string"==typeof e?e:e.name,value:this.#u(e)})),recordedTimers:[...this.#l].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#d(e)})),waitTimers:[...this.#c].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#d(e)}))}),this.onRecord=e=>{this.#l.set(e,{start:Date.now(),duration:0})},this.onClear=e=>{this.#l.delete(e)},this.onDone=e=>{const t=this.#l.get(e);t&&(t.duration=Date.now()-t.start)},this.onWait=(e,t)=>{const n=Date.now();t.finally(()=>{this.#c.set(e,{duration:Date.now()-n})}).catch(console.error)},this.onInject=e=>{this.#a.add(e)},this.onRemove=e=>{this.#a.delete(e)},this.onUse=e=>{this.#o.add(e)},this.#u=e=>this.#r.get(e).get(),this.#d=e=>this.#i.get(e).status,this.#r=e,this.#i=t,this.#s=n}#u;#d},ws=class e{#r;#i;#s;#p;constructor(t,n,s){this.produce=t=>t&&Object.keys(t).length?new e(this.#r,this.#i,{...t}):this,this.inject=(e,t)=>{const n=e.create(this.#r.sliceMap);return null!=t&&n.set(t),this.#p?.onInject(e),this},this.remove=e=>(this.#r.remove(e),this.#p?.onRemove(e),this),this.record=e=>(e.create(this.#i.store),this.#p?.onRecord(e),this),this.clearTimer=e=>(this.#i.remove(e),this.#p?.onClear(e),this),this.isInjected=e=>this.#r.has(e),this.isRecorded=e=>this.#i.has(e),this.use=e=>(this.#p?.onUse(e),this.#r.get(e)),this.get=e=>this.use(e).get(),this.set=(e,t)=>this.use(e).set(t),this.update=(e,t)=>this.use(e).update(t),this.timer=e=>this.#i.get(e),this.done=e=>{this.timer(e).done(),this.#p?.onDone(e)},this.wait=e=>{const t=this.timer(e).start();return this.#p?.onWait(e,t),t},this.waitTimers=async e=>{await Promise.all(this.get(e).map(e=>this.wait(e)))},this.#r=t,this.#i=n,this.#s=s,s&&(this.#p=new ks(t,n,s))}get meta(){return this.#s}get inspector(){return this.#p}},bs=class{constructor(){this.store=new Map,this.get=e=>{const t=this.store.get(e.id);if(!t)throw function(e){return new ns(ts.timerNotFound,`Timer "${e}" not found, do you forget to record it?`)}(e.name);return t},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}},vs=class{#f;#h;#m;#g;constructor(e,t){this.#f=null,this.#h=null,this.#g="pending",this.start=()=>(this.#f??=new Promise((e,t)=>{this.#h=t=>{t instanceof CustomEvent&&t.detail.id===this.#m&&(this.#g="resolved",this.#y(),t.stopImmediatePropagation(),e())},this.#k(()=>{"pending"===this.#g&&(this.#g="rejected"),this.#y(),t(new Error(`Timing ${this.type.name} timeout.`))}),this.#g="pending",addEventListener(this.type.name,this.#h)}),this.#f),this.done=()=>{const e=new CustomEvent(this.type.name,{detail:{id:this.#m}});dispatchEvent(e)},this.#y=()=>{this.#h&&removeEventListener(this.type.name,this.#h)},this.#k=e=>{setTimeout(()=>{e()},this.type.timeout)},this.#m=Symbol(t.name),this.type=t,e.set(t.id,this)}get status(){return this.#g}#y;#k},Ss=class{constructor(e,t=3e3){this.create=e=>new vs(e,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}},xs=(e,t=3e3)=>new Ss(e,t);function Cs(e){const t=this;t.compiler=function(n){return we(n,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}const Ts=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Os(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const Ds=(e,t,n)=>{let s=Os(e,n);if(!s)return!1;let r=Es(s);if(!r){let n=s.blockRange(),r=n&&cn(n);return null!=r&&(t&&t(e.tr.lift(n,r).scrollIntoView()),!0)}let i=r.nodeBefore;if($s(e,r,t,-1))return!0;if(0==s.parent.content.size&&(As(i,"end")||Bn.isSelectable(i)))for(let a=s.depth;;a--){let n=gn(e.doc,s.before(a),s.after(a),_e.empty);if(n&&n.slice.size<n.to-n.from){if(t){let s=e.tr.step(n);s.setSelection(As(i,"end")?In.findFrom(s.doc.resolve(s.mapping.map(r.pos,-1)),-1):Bn.create(s.doc,r.pos-i.nodeSize)),t(s.scrollIntoView())}return!0}if(1==a||s.node(a-1).childCount>1)break}return!(!i.isAtom||r.depth!=s.depth-1||(t&&t(e.tr.delete(r.pos-i.nodeSize,r.pos).scrollIntoView()),0))},Ms=(e,t,n)=>{let s=Os(e,n);if(!s)return!1;let r=Es(s);return!!r&&function(e,t,n){let s=t.nodeBefore,r=t.pos-1;for(;!s.isTextblock;r--){if(s.type.spec.isolating)return!1;let e=s.lastChild;if(!e)return!1;s=e}let i=t.nodeAfter,a=t.pos+1;for(;!i.isTextblock;a++){if(i.type.spec.isolating)return!1;let e=i.firstChild;if(!e)return!1;i=e}let o=gn(e.doc,r,a,_e.empty);if(!o||o.from!=r||o instanceof sn&&o.slice.size>=a-r)return!1;if(n){let t=e.tr.step(o);t.setSelection($n.create(t.doc,r)),n(t.scrollIntoView())}return!0}(e,r,t)};function As(e,t,n=!1){for(let s=e;s;s="start"==t?s.firstChild:s.lastChild){if(s.isTextblock)return!0;if(n&&1!=s.childCount)return!1}return!1}const Ns=(e,t,n)=>{let{$head:s,empty:r}=e.selection,i=s;if(!r)return!1;if(s.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):s.parentOffset>0)return!1;i=Es(s)}let a=i&&i.nodeBefore;return!(!a||!Bn.isSelectable(a)||(t&&t(e.tr.setSelection(Bn.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),0))};function Es(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Is(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function Rs(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Ls=(e,t)=>{let{$head:n,$anchor:s}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(s))return!1;let r=n.node(-1),i=n.indexAfter(-1),a=Rs(r.contentMatchAt(i));if(!a||!r.canReplaceWith(i,i,a))return!1;if(t){let s=n.after(),r=e.tr.replaceWith(s,s,a.createAndFill());r.setSelection(In.near(r.doc.resolve(s),1)),t(r.scrollIntoView())}return!0},Ps=(e,t)=>{let{$from:n,$to:s}=e.selection;if(e.selection instanceof Bn&&e.selection.node.isBlock)return!(!n.parentOffset||!hn(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let r,i,a=[],o=!1,l=!1;for(let p=n.depth;;p--){if(n.node(p).isBlock){o=n.end(p)==n.pos+(n.depth-p),l=n.start(p)==n.pos-(n.depth-p),i=Rs(n.node(p-1).contentMatchAt(n.indexAfter(p-1))),a.unshift(o&&i?{type:i}:null),r=p;break}if(1==p)return!1;a.unshift(null)}let c=e.tr;(e.selection instanceof $n||e.selection instanceof zn)&&c.deleteSelection();let u=c.mapping.map(n.pos),d=hn(c.doc,u,a.length,a);if(d||(a[0]=i?{type:i}:null,d=hn(c.doc,u,a.length,a)),!d)return!1;if(c.split(u,a.length,a),!o&&l&&n.node(r).type!=i){let e=c.mapping.map(n.before(r)),t=c.doc.resolve(e);i&&n.node(r-1).canReplaceWith(t.index(),t.index()+1,i)&&c.setNodeMarkup(c.mapping.map(n.before(r)),i)}return t&&t(c.scrollIntoView()),!0};function $s(e,t,n,s){let r,i,a=t.nodeBefore,o=t.nodeAfter,l=a.type.spec.isolating||o.type.spec.isolating;if(!l&&function(e,t,n){let s=t.nodeBefore,r=t.nodeAfter,i=t.index();return!(!(s&&r&&s.type.compatibleContent(r.type))||(!s.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-s.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!r.isTextblock&&!mn(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(r=(i=a.contentMatchAt(a.childCount)).findWrapping(o.type))&&i.matchType(r[0]||o.type).validEnd){if(n){let s=t.pos+o.nodeSize,i=Ve.empty;for(let e=r.length-1;e>=0;e--)i=Ve.from(r[e].create(null,i));i=Ve.from(a.copy(i));let l=e.tr.step(new rn(t.pos-1,s,t.pos,s,new _e(i,1,0),r.length,!0)),c=l.doc.resolve(s+2*r.length);c.nodeAfter&&c.nodeAfter.type==a.type&&mn(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let u=o.type.spec.isolating||s>0&&l?null:In.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),p=d&&cn(d);if(null!=p&&p>=t.depth)return n&&n(e.tr.lift(d,p).scrollIntoView()),!0;if(c&&As(o,"start",!0)&&As(a,"end")){let s=a,r=[];for(;r.push(s),!s.isTextblock;)s=s.lastChild;let i=o,l=1;for(;!i.isTextblock;i=i.firstChild)l++;if(s.canReplace(s.childCount,s.childCount,i.content)){if(n){let s=Ve.empty;for(let e=r.length-1;e>=0;e--)s=Ve.from(r[e].copy(s));n(e.tr.step(new rn(t.pos-r.length,t.pos+o.nodeSize,t.pos+l,t.pos+o.nodeSize-l,new _e(s,r.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Vs(e){return function(t,n){let s=t.selection,r=e<0?s.$from:s.$to,i=r.depth;for(;r.node(i).isInline;){if(!i)return!1;i--}return!!r.node(i).isTextblock&&(n&&n(t.tr.setSelection($n.create(t.doc,e<0?r.start(i):r.end(i)))),!0)}}const Bs=Vs(-1),Fs=Vs(1);function zs(e,t=null){return function(n,s){let{$from:r,$to:i}=n.selection,a=r.blockRange(i),o=a&&un(a,e,t);return!!o&&(s&&s(n.tr.wrap(a,o).scrollIntoView()),!0)}}function Ws(e,t=null){return function(n,s){let r=!1;for(let i=0;i<n.selection.ranges.length&&!r;i++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(s,a,(s,i)=>{if(r)return!1;if(s.isTextblock&&!s.hasMarkup(e,t))if(s.type==e)r=!0;else{let t=n.doc.resolve(i),s=t.index();r=t.parent.canReplaceWith(s,s+1,e)}})}if(!r)return!1;if(s){let r=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:i},$to:{pos:a}}=n.selection.ranges[s];r.setBlockType(i,a,e,t)}s(r.scrollIntoView())}return!0}}function js(e,t=null,n){return function(n,s){let{empty:r,$cursor:i,ranges:a}=n.selection;if(r&&!i||!function(e,t,n){for(let s=0;s<t.length;s++){let{$from:r,$to:i}=t[s],a=0==r.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(r.pos,i.pos,(e,t)=>{if(a)return!1;a=e.inlineContent&&e.type.allowsMarkType(n)}),a)return!0}return!1}(n.doc,a,e))return!1;if(s)if(i)e.isInSet(n.storedMarks||i.marks())?s(n.tr.removeStoredMark(e)):s(n.tr.addStoredMark(e.create(t)));else{let r,i=n.tr;r=!a.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e));for(let n=0;n<a.length;n++){let{$from:s,$to:o}=a[n];if(r){let n=s.pos,r=o.pos,a=s.nodeAfter,l=o.nodeBefore,c=a&&a.isText?/^\s*/.exec(a.text)[0].length:0,u=l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+c<r&&(n+=c,r-=u),i.addMark(n,r,e.create(t))}else i.removeMark(s.pos,o.pos,e)}s(i.scrollIntoView())}return!0}}function _s(...e){return function(t,n,s){for(let r=0;r<e.length;r++)if(e[r](t,n,s))return!0;return!1}}let Us=_s(Ts,Ds,Ns),Ks=_s(Ts,(e,t,n)=>{let s=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}(e,n);if(!s)return!1;let r=Is(s);if(!r)return!1;let i=r.nodeAfter;if($s(e,r,t,1))return!0;if(0==s.parent.content.size&&(As(i,"start")||Bn.isSelectable(i))){let n=gn(e.doc,s.before(),s.after(),_e.empty);if(n&&n.slice.size<n.to-n.from){if(t){let s=e.tr.step(n);s.setSelection(As(i,"start")?In.findFrom(s.doc.resolve(s.mapping.map(r.pos)),1):Bn.create(s.doc,s.mapping.map(r.pos))),t(s.scrollIntoView())}return!0}}return!(!i.isAtom||r.depth!=s.depth-1||(t&&t(e.tr.delete(r.pos,r.pos+i.nodeSize).scrollIntoView()),0))},(e,t,n)=>{let{$head:s,empty:r}=e.selection,i=s;if(!r)return!1;if(s.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):s.parentOffset<s.parent.content.size)return!1;i=Is(s)}let a=i&&i.nodeAfter;return!(!a||!Bn.isSelectable(a)||(t&&t(e.tr.setSelection(Bn.create(e.doc,i.pos)).scrollIntoView()),0))});const qs={Enter:_s((e,t)=>{let{$head:n,$anchor:s}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(s)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))},(e,t)=>{let n=e.selection,{$from:s,$to:r}=n;if(n instanceof zn||s.parent.inlineContent||r.parent.inlineContent)return!1;let i=Rs(r.parent.contentMatchAt(r.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!s.parentOffset&&r.index()<r.parent.childCount?s:r).pos,a=e.tr.insert(n,i.createAndFill());a.setSelection($n.create(a.doc,n+1)),t(a.scrollIntoView())}return!0},(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(hn(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let s=n.blockRange(),r=s&&cn(s);return null!=r&&(t&&t(e.tr.lift(s,r).scrollIntoView()),!0)},Ps),"Mod-Enter":Ls,Backspace:Us,"Mod-Backspace":Us,"Shift-Backspace":Us,Delete:Ks,"Mod-Delete":Ks,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new zn(e.doc))),!0)},Hs={"Ctrl-h":qs.Backspace,"Alt-Backspace":qs["Mod-Backspace"],"Ctrl-d":qs.Delete,"Ctrl-Alt-Backspace":qs["Mod-Delete"],"Alt-Delete":qs["Mod-Delete"],"Alt-d":qs["Mod-Delete"],"Ctrl-a":Bs,"Ctrl-e":Fs};for(let os in qs)Hs[os]=qs[os];const Ys=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&"darwin"==os.platform())?Hs:qs;class Js{constructor(e,t,n={}){this.match=e,this.match=e,this.handler="string"==typeof t?function(e){return function(t,n,s,r){let i=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);i+=n[0].slice(e+n[1].length);let t=(s+=e)-r;t>0&&(i=n[0].slice(e-t,e)+i,s=r)}return t.tr.insertText(i,s,r)}}(t):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1,this.inCodeMark=!1!==n.inCodeMark}}const Gs=(e,t)=>{let n=e.plugins;for(let s=0;s<n.length;s++){let r,i=n[s];if(i.spec.isInputRules&&(r=i.getState(e))){if(t){let n=e.tr,s=r.transform;for(let e=s.steps.length-1;e>=0;e--)n.step(s.steps[e].invert(s.docs[e]));if(r.text){let t=n.doc.resolve(r.from).marks();n.replaceWith(r.from,r.to,e.schema.text(r.text,t))}else n.delete(r.from,r.to);t(n)}return!0}}return!1};function Qs(e,t,n=null,s){return new Js(e,(e,r,i,a)=>{let o=n instanceof Function?n(r):n,l=e.tr.delete(i,a),c=l.doc.resolve(i).blockRange(),u=c&&un(c,t,o);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(i-1).nodeBefore;return d&&d.type==t&&mn(l.doc,i-1)&&(!s||s(r,d))&&l.join(i-1),l})}function Zs(e,t,n=null){return new Js(e,(e,s,r,i)=>{let a=e.doc.resolve(r),o=n instanceof Function?n(s):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?e.tr.delete(r,i).setBlockType(r,r,t,o):null})}new Js(/--$/,"—",{inCodeMark:!1}),new Js(/\.\.\.$/,"…",{inCodeMark:!1}),new Js(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1}),new Js(/"$/,"”",{inCodeMark:!1}),new Js(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1}),new Js(/'$/,"’",{inCodeMark:!1});const Xs="undefined"!=typeof navigator?navigator:null,er="undefined"!=typeof document?document:null,tr=Xs&&Xs.userAgent||"",nr=/Edge\/(\d+)/.exec(tr),sr=/MSIE \d/.exec(tr),rr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tr),ir=!!(sr||rr||nr),ar=sr?document.documentMode:rr?+rr[1]:nr?+nr[1]:0,or=!ir&&/gecko\/(\d+)/i.test(tr),lr=or&&+(/Firefox\/(\d+)/.exec(tr)||[0,0])[1],cr=!ir&&/Chrome\/(\d+)/.exec(tr),ur=!!cr,dr=cr?+cr[1]:0,pr=!ir&&!!Xs&&/Apple Computer/.test(Xs.vendor),fr=pr&&(/Mobile\/\w+/.test(tr)||!!Xs&&Xs.maxTouchPoints>2),hr=fr||!!Xs&&/Mac/.test(Xs.platform),mr=/Android \d/.test(tr),gr=!!er&&"webkitFontSmoothing"in er.documentElement.style,yr=gr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var kr=Object.freeze({__proto__:null,android:mr,chrome:ur,chrome_version:dr,gecko:or,gecko_version:lr,ie:ir,ie_version:ar,ios:fr,mac:hr,safari:pr,webkit:gr,webkit_version:yr});function wr(e,t,n,s,r,i){if(e.composing)return!1;const a=e.state,o=a.doc.resolve(t);if(o.parent.type.spec.code)return!1;const l=o.parent.textBetween(Math.max(0,o.parentOffset-500),o.parentOffset,void 0,"")+s;for(let c of r){const r=c,o=r.match.exec(l),u=o&&o[0]&&r.handler(a,o,t-(o[0].length-s.length),n);if(u)return!1!==r.undoable&&u.setMeta(i,{transform:u,from:t,to:n,text:s}),e.dispatch(u),!0}return!1}const br=new es("MILKDOWN_CUSTOM_INPUTRULES");function vr({rules:e}){const t=new Qn({key:br,isInputRules:!0,state:{init:()=>null,apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,s,r,i)=>wr(n,s,r,i,e,t),handleDOMEvents:{compositionend:n=>(setTimeout(()=>{const{$cursor:s}=n.state.selection;s&&wr(n,s.pos,s.pos,"",e,t)}),!1),keydown:(e,t)=>!(!mr||!ur||"Enter"!==t.key||e.composing||!e.someProp("handleKeyDown",n=>n(e,t))||(t.preventDefault(),0))},handleKeyDown(n,s){if("Enter"!==s.key)return!1;const{$cursor:r}=n.state.selection;return!!r&&wr(n,r.pos,r.pos,"\n",e,t)}}});return t}function Sr(e,t,n={}){return new Js(e,(e,s,r,i)=>{var a,o,l,c;const{tr:u}=e;let d,p=s[s.length-1],f=s[0],h=[];const m={group:p,fullMatch:f,start:r,end:i},g=null==(a=n.updateCaptured)?void 0:a.call(n,m);if(Object.assign(m,g),({group:p,fullMatch:f,start:r,end:i}=m),null===f)return null;if(""===(null==p?void 0:p.trim()))return null;if(p){const e=f.search(/\S/),a=r+f.indexOf(p),m=a+p.length;h=null!=(o=u.storedMarks)?o:[],m<i&&u.delete(m,i),a>r&&u.delete(r+e,a),d=r+e+p.length;const g=null==(l=n.getAttr)?void 0:l.call(n,s);u.addMark(r,d,t.create(g)),u.setStoredMarks(h),null==(c=n.beforeDispatch)||c.call(n,{match:s,start:r,end:i,tr:u})}return u})}function xr(e,t,n={}){return new Js(e,(e,s,r,i)=>{var a,o,l;const{tr:c}=e;let u=s[1],d=s[0];const p={group:u,fullMatch:d,start:r,end:i},f=null==(a=n.updateCaptured)?void 0:a.call(n,p);if(Object.assign(p,f),({group:u,fullMatch:d,start:r,end:i}=p),null===d)return null;if(!u||""===u.trim())return null;const h=null==(o=n.getAttr)?void 0:o.call(n,s),m=t.createAndFill(h);return m&&(c.replaceRangeWith(t.isBlock?c.doc.resolve(r).before():r,i,m),null==(l=n.beforeDispatch)||l.call(n,{match:[d,u],start:r,end:i,tr:c})),c})}var Cr=Object.defineProperty,Tr=Object.defineProperties,Or=Object.getOwnPropertyDescriptors,Dr=Object.getOwnPropertySymbols,Mr=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,Nr=(e,t,n)=>t in e?Cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function Er(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Ir(e,t,n){const s=e.state.doc.content.size,r=Er(t,0,s),i=Er(n,0,s),a=e.coordsAtPos(r),o=e.coordsAtPos(i,-1),l=Math.min(a.top,o.top),c=Math.max(a.bottom,o.bottom),u=Math.min(a.left,o.left),d=Math.max(a.right,o.right),p={top:l,bottom:c,left:u,right:d,width:d-u,height:c-l,x:u,y:l};return((e,t)=>Tr(e,Or(t)))(((e,t)=>{for(var n in t||(t={}))Mr.call(t,n)&&Nr(e,n,t[n]);if(Dr)for(var n of Dr(t))Ar.call(t,n)&&Nr(e,n,t[n]);return e})({},p),{toJSON:()=>p})}function Rr(e){return Object.assign(Object.create(e),e).setTime(Date.now())}function Lr(e){if(1===e.content.childCount){const t=e.content.firstChild;if("text"===(null==t?void 0:t.type.name)&&0===t.marks.length)return t;if("paragraph"===(null==t?void 0:t.type.name)&&1===t.childCount){const e=t.firstChild;if("text"===(null==e?void 0:e.type.name)&&0===e.marks.length)return e}}return!1}function Pr(e){return t=>{for(let n=t.depth;n>0;n-=1){const s=t.node(n);if(e(s))return{from:t.before(n),to:t.after(n),node:s}}}}function $r(e,t){return Pr(e=>e.type===t)(e)}function Vr(e,t){const n=t.nodes[e];if(!n)throw function(e,t){return new ns(ts.getAtomFromSchemaFail,`Cannot get node: ${t} from schema.`)}(0,e);return n}function Br(e){return t=>{for(let n=t.depth;n>0;n--){const s=t.node(n);if(e(s))return{pos:t.before(n),start:t.start(n),depth:n,node:s}}}}function Fr(e){return t=>Br(e)(t.$from)}const zr=(e,t)=>{const{selection:n,doc:s}=e;if(n instanceof Bn)return{hasNode:n.node.type===t,pos:n.from,target:n.node};const{from:r,to:i}=n;let a=!1,o=-1,l=null;return s.nodesBetween(r,i,(e,n)=>!(l||e.type===t&&(a=!0,o=n,l=e,1))),{hasNode:a,pos:o,target:l}},Wr="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),jr="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function _r(e){let t,n,s,r,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(let o=0;o<i.length-1;o++){let e=i[o];if(/^(cmd|meta|m)$/i.test(e))r=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))s=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);Wr?r=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),r&&(a="Meta-"+a),s&&(a="Shift-"+a),a}function Ur(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 Kr(e){return new Qn({props:{handleKeyDown:qr(e)}})}function qr(e){let t=function(e){let t=Object.create(null);for(let n in e)t[_r(n)]=e[n];return t}(e);return function(e,n){let s,r=ne(n),i=t[Ur(r,n)];if(i&&i(e.state,e.dispatch,e))return!0;if(1==r.length&&" "!=r){if(n.shiftKey){let s=t[Ur(r,n,!1)];if(s&&s(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(jr&&n.ctrlKey&&n.altKey)&&(s=se[n.keyCode])&&s!=r){let r=t[Ur(s,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Hr=class{},Yr=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=e=>{this.top()?.push(e)},this.open=e=>{this.elements.push(e)},this.close=()=>{const e=this.elements.pop();if(!e)throw as();return e}}},Jr=class e extends Hr{constructor(e,t,n){super(),this.type=e,this.content=t,this.attrs=n}push(e,...t){this.content.push(e,...t)}pop(){return this.content.pop()}static create(t,n,s){return new e(t,n,s)}},Gr=(o=class extends Yr{constructor(o){super(),D(this,e),D(this,t),D(this,n),D(this,s),D(this,r),D(this,i),D(this,a),M(this,e,We.none),M(this,t,e=>e.isText),M(this,n,(e,n)=>{if(O(this,t).call(this,e)&&O(this,t).call(this,n)&&We.sameSet(e.marks,n.marks))return this.schema.text(e.text+n.text,e.marks)}),M(this,s,e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.parseMarkdown.match(e));if(!t)throw function(e){return new ns(ts.parserMatchError,`Cannot match target parser for node: ${rs(e)}.`)}(e);return t}),M(this,r,e=>{const t=O(this,s).call(this,e);t.spec.parseMarkdown.runner(this,e,t)}),this.injectRoot=(e,t,n)=>(this.openNode(t,n),this.next(e.children),this),this.openNode=(e,t)=>(this.open(Jr.create(e,[],t)),this),M(this,i,()=>{M(this,e,We.none);const t=this.close();return O(this,a).call(this,t.type,t.attrs,t.content)}),this.closeNode=()=>{try{O(this,i).call(this)}catch(e){console.error(e)}return this},M(this,a,(t,n,s)=>{const r=t.createAndFill(n,s,O(this,e));if(!r)throw function(e,t,n){const s=`Cannot create node for ${"name"in e?e.name:e}`,r=e=>{if(null==e)return"null";if(Array.isArray(e))return`[${e.map(r).join(", ")}]`;if("object"==typeof e)return"toJSON"in e&&"function"==typeof e.toJSON?JSON.stringify(e.toJSON()):"spec"in e?JSON.stringify(e.spec):JSON.stringify(e);if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("function"==typeof e)return`[Function: ${e.name||"anonymous"}]`;try{return String(e)}catch{return"[Unserializable]"}},i=[["[Description]",s],["[Attributes]",t],["[Content]",(n??[]).map(e=>e?"object"==typeof e&&"type"in e?`${e}`:r(e):"null")]].reduce((e,[t,n])=>{const s=`${t}: ${r(n)}.`;return e.concat(s)},[]);return new ns(ts.createNodeInParserFail,i.join("\n"))}(t,n,s);return this.push(r),r}),this.addNode=(e,t,n)=>{try{O(this,a).call(this,e,t,n)}catch(s){console.error(s)}return this},this.openMark=(t,n)=>{const s=t.create(n);return M(this,e,s.addToSet(O(this,e))),this},this.closeMark=t=>(M(this,e,t.removeFromSet(O(this,e))),this),this.addText=t=>{try{const s=this.top();if(!s)throw as();const r=s.pop(),i=this.schema.text(t,O(this,e));if(!r)return s.push(i),this;const a=O(this,n).call(this,r,i);return a?(s.push(a),this):(s.push(r,i),this)}catch(s){return console.error(s),this}},this.build=()=>{let e;do{e=O(this,i).call(this)}while(this.size());return e},this.next=(e=[])=>([e].flat().forEach(e=>O(this,r).call(this,e)),this),this.toDoc=()=>this.build(),this.run=(e,t)=>{const n=e.runSync(e.parse(t),t);return this.next(n),this},this.schema=o}},e=new WeakMap,t=new WeakMap,n=new WeakMap,s=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,o.create=(e,t)=>{const n=new o(e);return e=>(n.run(t,e),n.toDoc())},o),Qr=((l=class extends Hr{constructor(e,t,n,s={}){super(),this.type=e,this.children=t,this.value=n,this.props=s,this.push=(e,...t)=>{this.children||(this.children=[]),this.children.push(e,...t)},this.pop=()=>this.children?.pop()}}).create=(e,t,n,s={})=>new l(e,t,n,s),l),Zr=(x=class extends Yr{constructor(e){super(),D(this,c),D(this,u),D(this,d),D(this,p),D(this,f),D(this,h),D(this,m),D(this,g),D(this,y),D(this,k),D(this,w),D(this,b),D(this,v),D(this,S),M(this,c,[]),M(this,u,e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.toMarkdown.match(e));if(!t)throw function(e){return new ns(ts.serializerMatchError,`Cannot match target serializer for node: ${rs(e)}.`)}(e.type);return t}),M(this,d,e=>O(this,u).call(this,e).spec.toMarkdown.runner(this,e)),M(this,p,(e,t)=>O(this,u).call(this,e).spec.toMarkdown.runner(this,e,t)),M(this,f,e=>{const t=e=>e.type.spec.priority??50,n=[...e].sort((e,n)=>t(e)-t(n)),s=[];return O(this,c).forEach(({mark:e})=>{const t=n.findIndex(t=>t.eq(e));t>=0&&s.push(...n.splice(t,1))}),s.concat(n)}),M(this,h,e=>{const t=e?.marks;let n=0;for(;n<O(this,c).length;){const{mark:e,spanning:s}=O(this,c)[n];if(!s||!t?.some(t=>t.eq(e)))break;n++}for(let s=O(this,c).length-1;s>=n;s--)O(this,S).call(this,O(this,c)[s].mark)}),M(this,m,(e,t)=>{O(this,f).call(this,e.marks).every(t=>!O(this,p).call(this,t,e))&&O(this,d).call(this,e),O(this,h).call(this,t)}),M(this,g,e=>{const{children:t}=e;return t?(e.children=t.reduce((e,t,n)=>{if(0===n)return[t];const s=e.at(-1);if(s&&s.isMark&&t.isMark){const{children:n,...r}=t,{children:i,...a}=s;if(t.type===s.type&&n&&i&&JSON.stringify(r)===JSON.stringify(a)){const t={...a,children:[...i,...n]};return e.slice(0,-1).concat(O(this,g).call(this,t))}}return e.concat(t)},[]),e):e}),M(this,y,e=>{const t={...e.props,type:e.type};return e.children&&(t.children=e.children),e.value&&(t.value=e.value),t}),this.openNode=(e,t,n)=>(this.open(Qr.create(e,void 0,t,n)),this),M(this,k,(e,t)=>{let n="",s="";const r=e.children;if(r){const e=r[0],t=r.at(-1);if(t&&"text"===t.type&&t.value.endsWith(" ")){const e=t.value,n=e.trimEnd();s=e.slice(n.length),t.value=n}if(e&&"text"===e.type&&e.value.startsWith(" ")){const t=e.value,s=t.trimStart();n=t.slice(0,t.length-s.length),e.value=s}}n.length&&O(this,b).call(this,"text",void 0,n);const i=t();return s.length&&O(this,b).call(this,"text",void 0,s),i}),M(this,w,(e=!1)=>{const t=this.close(),n=()=>O(this,b).call(this,t.type,t.children,t.value,t.props);return e?O(this,k).call(this,t,n):n()}),this.closeNode=()=>(O(this,w).call(this),this),M(this,b,(e,t,n,s)=>{const r=Qr.create(e,t,n,s),i=O(this,g).call(this,O(this,y).call(this,r));return this.push(i),i}),this.addNode=(e,t,n,s)=>(O(this,b).call(this,e,t,n,s),this),M(this,v,(e,t,n,s)=>O(this,c).some(t=>t.mark.eq(e))?this:(O(this,c).push({mark:e,spanning:null==n}),this.openNode(t,n,{...s,isMark:!0}))),M(this,S,e=>{let t=-1;for(let n=O(this,c).length-1;n>=0;n--)if(O(this,c)[n].mark.eq(e)){t=n;break}t<0||(O(this,c).splice(t,1),O(this,w).call(this,!0))}),this.withMark=(e,t,n,s)=>(O(this,v).call(this,e,t,n,s),this),this.closeMark=e=>(O(this,S).call(this,e),this),this.build=()=>{let e=null;do{e=O(this,w).call(this)}while(this.size());return e},this.next=e=>(e=>Object.prototype.hasOwnProperty.call(e,"size"))(e)?(e.forEach((t,n,s)=>{O(this,m).call(this,t,e.maybeChild(s+1)??void 0)}),this):(O(this,m).call(this,e),this),this.toString=e=>e.stringify(this.build()),this.run=e=>(M(this,c,[]),this.next(e),this),this.schema=e}},c=new WeakMap,u=new WeakMap,d=new WeakMap,p=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,k=new WeakMap,w=new WeakMap,b=new WeakMap,v=new WeakMap,S=new WeakMap,x.create=(e,t)=>{const n=new x(e);return e=>(n.run(e),n.toString(t))},x);const Xr=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},ei=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let ti=null;const ni=function(e,t,n){let s=ti||(ti=document.createRange());return s.setEnd(e,n??e.nodeValue.length),s.setStart(e,t||0),s},si=function(e,t,n,s){return n&&(ii(e,t,n,s,-1)||ii(e,t,n,s,1))},ri=/^(img|br|input|textarea|hr)$/i;function ii(e,t,n,s,r){for(var i;;){if(e==n&&t==s)return!0;if(t==(r<0?0:ai(e))){let n=e.parentNode;if(!n||1!=n.nodeType||oi(e)||ri.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Xr(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(r<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(i=n.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;t+=r}else e=n,t=r<0?ai(e):0}}}}function ai(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function oi(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const li=function(e){return e.focusNode&&si(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ci(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const ui="undefined"!=typeof navigator?navigator:null,di="undefined"!=typeof document?document:null,pi=ui&&ui.userAgent||"",fi=/Edge\/(\d+)/.exec(pi),hi=/MSIE \d/.exec(pi),mi=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pi),gi=!!(hi||mi||fi),yi=hi?document.documentMode:mi?+mi[1]:fi?+fi[1]:0,ki=!gi&&/gecko\/(\d+)/i.test(pi);ki&&(/Firefox\/(\d+)/.exec(pi)||[0,0])[1];const wi=!gi&&/Chrome\/(\d+)/.exec(pi),bi=!!wi,vi=wi?+wi[1]:0,Si=!gi&&!!ui&&/Apple Computer/.test(ui.vendor),xi=Si&&(/Mobile\/\w+/.test(pi)||!!ui&&ui.maxTouchPoints>2),Ci=xi||!!ui&&/Mac/.test(ui.platform),Ti=!!ui&&/Win/.test(ui.platform),Oi=/Android \d/.test(pi),Di=!!di&&"webkitFontSmoothing"in di.documentElement.style,Mi=Di?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ai(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ni(e,t){return"number"==typeof e?e:e[t]}function Ei(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,s=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*s}}function Ii(e,t,n){let s=e.someProp("scrollThreshold")||0,r=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let a=n||e.dom;a;){if(1!=a.nodeType){a=ei(a);continue}let e=a,n=e==i.body,o=n?Ai(i):Ei(e),l=0,c=0;if(t.top<o.top+Ni(s,"top")?c=-(o.top-t.top+Ni(r,"top")):t.bottom>o.bottom-Ni(s,"bottom")&&(c=t.bottom-t.top>o.bottom-o.top?t.top+Ni(r,"top")-o.top:t.bottom-o.bottom+Ni(r,"bottom")),t.left<o.left+Ni(s,"left")?l=-(o.left-t.left+Ni(r,"left")):t.right>o.right-Ni(s,"right")&&(l=t.right-o.right+Ni(r,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,s=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let r=e.scrollLeft-n,i=e.scrollTop-s;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}let u=n?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(u))break;a="absolute"==u?a.offsetParent:ei(a)}}function Ri(e){let t=[],n=e.ownerDocument;for(let s=e;s&&(t.push({dom:s,top:s.scrollTop,left:s.scrollLeft}),e!=n);s=ei(s));return t}function Li(e,t){for(let n=0;n<e.length;n++){let{dom:s,top:r,left:i}=e[n];s.scrollTop!=r+t&&(s.scrollTop=r+t),s.scrollLeft!=i&&(s.scrollLeft=i)}}let Pi=null;function $i(e,t){let n,s,r,i,a=2e8,o=0,l=t.top,c=t.top;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(1==u.nodeType)e=u.getClientRects();else{if(3!=u.nodeType)continue;e=ni(u).getClientRects()}for(let p=0;p<e.length;p++){let f=e[p];if(f.top<=l&&f.bottom>=c){l=Math.max(f.bottom,l),c=Math.min(f.top,c);let e=f.left>t.left?f.left-t.left:f.right<t.left?t.left-f.right:0;if(e<a){n=u,a=e,s=e&&3==n.nodeType?{left:f.right<t.left?f.right:f.left,top:t.top}:t,1==u.nodeType&&e&&(o=d+(t.left>=(f.left+f.right)/2?1:0));continue}}else f.top>t.top&&!r&&f.left<=t.left&&f.right>=t.left&&(r=u,i={left:Math.max(f.left,Math.min(f.right,t.left)),top:f.top});!n&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(o=d+1)}}return!n&&r&&(n=r,s=i,a=0),n&&3==n.nodeType?function(e,t){let n,s=e.nodeValue.length,r=document.createRange();for(let i=0;i<s;i++){r.setEnd(e,i+1),r.setStart(e,i);let s=Wi(r,1);if(s.top!=s.bottom&&Vi(t,s)){n={node:e,offset:i+(t.left>=(s.left+s.right)/2?1:0)};break}}return r.detach(),n||{node:e,offset:0}}(n,s):!n||a&&1==n.nodeType?{node:e,offset:o}:$i(n,s)}function Vi(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Bi(e,t,n){let s=e.childNodes.length;if(s&&n.top<n.bottom)for(let r=Math.max(0,Math.min(s-1,Math.floor(s*(t.top-n.top)/(n.bottom-n.top))-2)),i=r;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let s=0;s<e.length;s++){let r=e[s];if(Vi(t,r))return Bi(n,t,r)}}if((i=(i+1)%s)==r)break}return e}function Fi(e,t){let n,s=e.dom.ownerDocument,r=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{let s=e.caretPositionFromPoint(t,n);if(s)return{node:s.offsetNode,offset:Math.min(ai(s.offsetNode),s.offset)}}catch(s){}if(e.caretRangeFromPoint){let s=e.caretRangeFromPoint(t,n);if(s)return{node:s.startContainer,offset:Math.min(ai(s.startContainer),s.startOffset)}}}(s,t.left,t.top);i&&({node:n,offset:r}=i);let a,o=(e.root.elementFromPoint?e.root:s).elementFromPoint(t.left,t.top);if(!o||!e.dom.contains(1!=o.nodeType?o.parentNode:o)){let n=e.dom.getBoundingClientRect();if(!Vi(t,n))return null;if(o=Bi(e.dom,t,n),!o)return null}if(Si)for(let c=o;n&&c;c=ei(c))c.draggable&&(n=void 0);if(o=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(o,t),n){if(ki&&1==n.nodeType&&(r=Math.min(r,n.childNodes.length),r<n.childNodes.length)){let e,s=n.childNodes[r];"IMG"==s.nodeName&&(e=s.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&r++}let s;Di&&r&&1==n.nodeType&&1==(s=n.childNodes[r-1]).nodeType&&"false"==s.contentEditable&&s.getBoundingClientRect().top>=t.top&&r--,n==e.dom&&r==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:0!=r&&1==n.nodeType&&"BR"==n.childNodes[r-1].nodeName||(a=function(e,t,n,s){let r=-1;for(let i=t,a=!1;i!=e.dom;){let t,n=e.docView.nearestDesc(i,!0);if(!n)return null;if(1==n.dom.nodeType&&(n.node.isBlock&&n.parent||!n.contentDOM)&&((t=n.dom.getBoundingClientRect()).width||t.height)&&(n.node.isBlock&&n.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(n.dom.nodeName)&&(!a&&t.left>s.left||t.top>s.top?r=n.posBefore:(!a&&t.right<s.left||t.bottom<s.top)&&(r=n.posAfter),a=!0),!n.contentDOM&&r<0&&!n.node.isText))return(n.node.isBlock?s.top<(t.top+t.bottom)/2:s.left<(t.left+t.right)/2)?n.posBefore:n.posAfter;i=n.dom.parentNode}return r>-1?r:e.docView.posFromDOM(t,n,-1)}(e,n,r,t))}null==a&&(a=function(e,t,n){let{node:s,offset:r}=$i(t,n),i=-1;if(1==s.nodeType&&!s.firstChild){let e=s.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(s,r,i)}(e,o,t));let l=e.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function zi(e){return e.top<e.bottom||e.left<e.right}function Wi(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(zi(e))return e}return Array.prototype.find.call(n,zi)||e.getBoundingClientRect()}const ji=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function _i(e,t,n){let{node:s,offset:r,atom:i}=e.docView.domFromPos(t,n<0?-1:1),a=Di||ki;if(3==s.nodeType){if(!a||!ji.test(s.nodeValue)&&(n<0?r:r!=s.nodeValue.length)){let e=r,t=r,i=n<0?1:-1;return n<0&&!r?(t++,i=-1):n>=0&&r==s.nodeValue.length?(e--,i=1):n<0?e--:t++,Ui(Wi(ni(s,e,t),i),i<0)}{let e=Wi(ni(s,r,r),n);if(ki&&r&&/\s/.test(s.nodeValue[r-1])&&r<s.nodeValue.length){let t=Wi(ni(s,r-1,r-1),-1);if(t.top==e.top){let n=Wi(ni(s,r,r+1),-1);if(n.top!=e.top)return Ui(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&r&&(n<0||r==ai(s))){let e=s.childNodes[r-1];if(1==e.nodeType)return Ki(e.getBoundingClientRect(),!1)}if(null==i&&r<ai(s)){let e=s.childNodes[r];if(1==e.nodeType)return Ki(e.getBoundingClientRect(),!0)}return Ki(s.getBoundingClientRect(),n>=0)}if(null==i&&r&&(n<0||r==ai(s))){let e=s.childNodes[r-1],t=3==e.nodeType?ni(e,ai(e)-(a?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Ui(Wi(t,1),!1)}if(null==i&&r<ai(s)){let e=s.childNodes[r];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?ni(e,0,a?0:1):1==e.nodeType?e:null:null;if(t)return Ui(Wi(t,-1),!0)}return Ui(Wi(3==s.nodeType?ni(s):s,-n),n>=0)}function Ui(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ki(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function qi(e,t,n){let s=e.state,r=e.root.activeElement;s!=t&&e.updateState(t),r!=e.dom&&e.focus();try{return n()}finally{s!=t&&e.updateState(s),r!=e.dom&&r&&r.focus()}}const Hi=/[\u0590-\u08ac]/;let Yi=null,Ji=null,Gi=!1;class Qi{constructor(e,t,n,s){this.parent=e,this.children=t,this.dom=n,this.contentDOM=s,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let s=this.children[t];if(s==e)return n;n+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,s;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(s=n.pmViewDesc)||s.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(s)+s.size:this.posAtStart}{let n,s;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(s=n.pmViewDesc)||s.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(s):this.posAtEnd}}let s;if(e==this.dom&&this.contentDOM)s=t>Xr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){s=!1;break}if(t.previousSibling)break}if(null==s&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){s=!0;break}if(t.nextSibling)break}}return s??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,s=e;s;s=s.parentNode){let r,i=this.getDesc(s);if(i&&(!t||i.node)){if(!n||!(r=i.nodeDOM)||(1==r.nodeType?r.contains(1==e.nodeType?e:e.parentNode):r==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let s=e;s;s=s.parentNode){let r=this.getDesc(s);if(r)return r.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let s=this.children[t],r=n+s.size;if(n==e&&r!=n){for(;!s.border&&s.children.length;)for(let e=0;e<s.children.length;e++){let t=s.children[e];if(t.size){s=t;break}}return s}if(e<r)return s.descAt(e-n-s.border);n=r}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,s=0;for(let r=0;n<this.children.length;n++){let t=this.children[n],i=r+t.size;if(i>e||t instanceof ra){s=e-r;break}r=i}if(s)return this.children[n].domFromPos(s-this.children[n].border,t);for(let r;n&&!(r=this.children[n-1]).size&&r instanceof Zi&&r.side>=0;n--);if(t<=0){let e,s=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,s=!1);return e&&t&&s&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Xr(e.dom)+1:0}}{let e,s=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,s=!1);return e&&s&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Xr(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,r=-1;for(let i=n,a=0;;a++){let n=this.children[a],o=i+n.size;if(-1==s&&e<=o){let r=i+n.border;if(e>=r&&t<=o-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,r);e=i;for(let t=a;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){s=Xr(n.dom)+1;break}e-=n.size}-1==s&&(s=0)}if(s>-1&&(o>t||a==this.children.length-1)){t=o;for(let e=a+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){r=Xr(n.dom);break}t+=n.size}-1==r&&(r=this.contentDOM.childNodes.length);break}i=o}return{node:this.contentDOM,from:e,to:t,fromOffset:s,toOffset:r}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,s=!1){let r=Math.min(e,t),i=Math.max(e,t);for(let f=0,h=0;f<this.children.length;f++){let a=this.children[f],o=h+a.size;if(r>h&&i<o)return a.setSelection(e-h-a.border,t-h-a.border,n,s);h=o}let a=this.domFromPos(e,e?-1:1),o=t==e?a:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),u=!1;if((ki||Si)&&e==t){let{node:e,offset:t}=a;if(3==e.nodeType){if(u=!(!t||"\n"!=e.nodeValue[t-1]),u&&t==e.nodeValue.length)for(let n,s=e;s;s=s.parentNode){if(n=s.nextSibling){"BR"==n.nodeName&&(a=o={node:n.parentNode,offset:Xr(n)+1});break}let e=s.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(ki&&c.focusNode&&c.focusNode!=o.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(s=!0)}if(!(s||u&&Si)&&si(a.node,a.offset,c.anchorNode,c.anchorOffset)&&si(o.node,o.offset,c.focusNode,c.focusOffset))return;let d=!1;if((l.extend||e==t)&&(!u||!ki)){l.collapse(a.node,a.offset);try{e!=t&&l.extend(o.node,o.offset),d=!0}catch(p){}}if(!d){if(e>t){let e=a;a=o,o=e}let n=document.createRange();n.setEnd(o.node,o.offset),n.setStart(a.node,a.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,s=0;s<this.children.length;s++){let r=this.children[s],i=n+r.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let s=n+r.border,a=i-r.border;if(e>=s&&t<=a)return this.dirty=e==n||t==i?2:1,void(e!=s||t!=a||!r.contentLost&&r.dom.parentNode==this.contentDOM?r.markDirty(e-s,t-s):r.dirty=3);r.dirty=r.dom!=r.contentDOM||r.dom.parentNode!=this.contentDOM||r.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Zi extends Qi{constructor(e,t,n,s){let r,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,()=>r?r.parent?r.parent.posBeforeChild(r):void 0:s)),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,r=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Xi extends Qi{constructor(e,t,n,s){super(e,[],t,null),this.textDOM=n,this.text=s}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class ea extends Qi{constructor(e,t,n,s,r){super(e,[],n,s),this.mark=t,this.spec=r}static create(e,t,n,s){let r=s.nodeViews[t.type.name],i=r&&r(t,s,n);return i&&i.dom||(i=Bt.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new ea(e,t,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let s=ea.create(this.parent,this.mark,!0,n),r=this.children,i=this.size;t<i&&(r=ya(r,t,i,n)),e>0&&(r=ya(r,0,e,n));for(let a=0;a<r.length;a++)r[a].parent=s;return s.children=r,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ta extends Qi{constructor(e,t,n,s,r,i,a,o,l){super(e,[],r,i),this.node=t,this.outerDeco=n,this.innerDeco=s,this.nodeDOM=a}static create(e,t,n,s,r,i){let a,o=r.nodeViews[t.type.name],l=o&&o(t,r,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:i,n,s),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=Bt.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:u}=e)}u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=pa(c,n,t),l?a=new ia(e,t,n,s,c,u||null,d,l,r,i+1):t.isText?new sa(e,t,n,s,c,d,r):new ta(e,t,n,s,c,u||null,d,r,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ve.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&fa(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,s=t,r=e.composing?this.localCompositionInfo(e,t):null,i=r&&r.pos>-1?r:null,a=r&&r.pos<0,o=new ma(this,i&&i.node,e);!function(e,t,n,s){let r=t.locals(e),i=0;if(0==r.length){for(let n=0;n<e.childCount;n++){let a=e.child(n);s(a,r,t.forChild(i,a),n),i+=a.nodeSize}return}let a=0,o=[],l=null;for(let c=0;;){let u,d,p,f;for(;a<r.length&&r[a].to==i;){let e=r[a++];e.widget&&(u?(d||(d=[u])).push(e):u=e)}if(u)if(d){d.sort(ga);for(let e=0;e<d.length;e++)n(d[e],c,!!l)}else n(u,c,!!l);if(l)f=-1,p=l,l=null;else{if(!(c<e.childCount))break;f=c,p=e.child(c++)}for(let e=0;e<o.length;e++)o[e].to<=i&&o.splice(e--,1);for(;a<r.length&&r[a].from<=i&&r[a].to>i;)o.push(r[a++]);let h=i+p.nodeSize;if(p.isText){let e=h;a<r.length&&r[a].from<e&&(e=r[a].from);for(let t=0;t<o.length;t++)o[t].to<e&&(e=o[t].to);e<h&&(l=p.cut(e-i),p=p.cut(0,e-i),h=e,f=-1)}else for(;a<r.length&&r[a].to<h;)a++;s(p,p.isInline&&!p.isLeaf?o.filter(e=>!e.inline):o.slice(),t.forChild(i,p),f),i=h}}(this.node,this.innerDeco,(t,r,i)=>{t.spec.marks?o.syncToMarks(t.spec.marks,n,e,r):t.type.side>=0&&!i&&o.syncToMarks(r==this.node.childCount?We.none:this.node.child(r).marks,n,e,r),o.placeWidget(t,e,s)},(t,i,l,c)=>{let u;o.syncToMarks(t.marks,n,e,c),o.findNodeMatch(t,i,l,c)||a&&e.state.selection.from>s&&e.state.selection.to<s+t.nodeSize&&(u=o.findIndexWithChild(r.node))>-1&&o.updateNodeAt(t,i,l,u,e)||o.updateNextNode(t,i,l,e,c,s)||o.addNode(t,i,l,e,s),s+=t.nodeSize}),o.syncToMarks([],n,e,0),this.node.isTextblock&&o.addTextblockHacks(),o.destroyRest(),(o.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),aa(this.contentDOM,this.children,e),xi&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:s}=e.state.selection;if(!(e.state.selection instanceof $n)||n<t||s>t+this.node.content.size)return null;let r=e.input.compositionNode;if(!r||!this.dom.contains(r.parentNode))return null;if(this.node.inlineContent){let e=r.nodeValue,i=function(e,t,n,s){for(let r=0,i=0;r<e.childCount&&i<=s;){let a=e.child(r++),o=i;if(i+=a.nodeSize,!a.isText)continue;let l=a.text;for(;r<e.childCount;){let t=e.child(r++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=n){if(i>=s&&l.slice(s-t.length-o,s-o)==t)return s-t.length;let e=o<s?l.lastIndexOf(t,s-o-1):-1;if(e>=0&&e+t.length+o>=n)return o+e;if(n==s&&l.length>=s+t.length-o&&l.slice(s-o,s-o+t.length)==t)return s}}return-1}(this.node.content,e,n-t,s-t);return i<0?null:{node:r,pos:i,text:e}}return{node:r,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:s}){if(this.getDesc(t))return;let r=t;for(;r.parentNode!=this.contentDOM;r=r.parentNode){for(;r.previousSibling;)r.parentNode.removeChild(r.previousSibling);for(;r.nextSibling;)r.parentNode.removeChild(r.nextSibling);r.pmViewDesc&&(r.pmViewDesc=void 0)}let i=new Xi(this,r,t,s);e.input.compositionNodes.push(i),this.children=ya(this.children,n,n+s.length,e,i)}update(e,t,n,s){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,s),0))}updateInner(e,t,n,s){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(fa(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ua(this.dom,this.nodeDOM,ca(this.outerDeco,this.node,t),ca(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function na(e,t,n,s,r){pa(s,t,e);let i=new ta(void 0,e,t,n,s,s,s,r,0);return i.contentDOM&&i.updateChildren(r,0),i}class sa extends ta{constructor(e,t,n,s,r,i,a){super(e,t,n,s,r,null,i,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,s){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let s=this.node.cut(e,t),r=document.createTextNode(s.text);return new sa(this.parent,s,this.outerDeco,this.innerDeco,r,r,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ra extends Qi{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ia extends ta{constructor(e,t,n,s,r,i,a,o,l,c){super(e,t,n,s,r,i,a,l,c),this.spec=o}update(e,t,n,s){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let r=this.spec.update(e,t,n);return r&&this.updateInner(e,t,n,s),r}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,s){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function aa(e,t,n){let s=e.firstChild,r=!1;for(let i=0;i<t.length;i++){let a=t[i],o=a.dom;if(o.parentNode==e){for(;o!=s;)s=ha(s),r=!0;s=s.nextSibling}else r=!0,e.insertBefore(o,s);if(a instanceof ea){let t=s?s.previousSibling:e.lastChild;aa(a.contentDOM,a.children,n),s=t?t.nextSibling:e.firstChild}}for(;s;)s=ha(s),r=!0;r&&n.trackWrites==e&&(n.trackWrites=null)}const oa=function(e){e&&(this.nodeName=e)};oa.prototype=Object.create(null);const la=[new oa];function ca(e,t,n){if(0==e.length)return la;let s=n?la[0]:new oa,r=[s];for(let i=0;i<e.length;i++){let a=e[i].type.attrs;if(a){a.nodeName&&r.push(s=new oa(a.nodeName));for(let e in a){let i=a[e];null!=i&&(n&&1==r.length&&r.push(s=new oa(t.isInline?"span":"div")),"class"==e?s.class=(s.class?s.class+" ":"")+i:"style"==e?s.style=(s.style?s.style+";":"")+i:"nodeName"!=e&&(s[e]=i))}}}return r}function ua(e,t,n,s){if(n==la&&s==la)return t;let r=t;for(let i=0;i<s.length;i++){let t=s[i],a=n[i];if(i){let n;a&&a.nodeName==t.nodeName&&r!=e&&(n=r.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.nodeName),n.pmIsDeco=!0,n.appendChild(r),a=la[0]),r=n}da(r,a||la[0],t)}return r}function da(e,t,n){for(let s in t)"class"==s||"style"==s||"nodeName"==s||s in n||e.removeAttribute(s);for(let s in n)"class"!=s&&"style"!=s&&"nodeName"!=s&&n[s]!=t[s]&&e.setAttribute(s,n[s]);if(t.class!=n.class){let s=t.class?t.class.split(" ").filter(Boolean):[],r=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<s.length;t++)-1==r.indexOf(s[t])&&e.classList.remove(s[t]);for(let t=0;t<r.length;t++)-1==s.indexOf(r[t])&&e.classList.add(r[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,s=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=s.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function pa(e,t,n){return ua(e,e,la,ca(t,n,1!=e.nodeType))}function fa(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ha(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ma{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,s=n.children.length,r=e.childCount,i=new Map,a=[];e:for(;r>0;){let o;for(;;)if(s){let e=n.children[s-1];if(!(e instanceof ea)){o=e,s--;break}n=e,s=e.children.length}else{if(n==t)break e;s=n.parent.children.indexOf(n),n=n.parent}let l=o.node;if(l){if(l!=e.child(r-1))break;--r,i.set(o,r),a.push(o)}}return{index:r,matched:i,matches:a.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,s){let r=0,i=this.stack.length>>1,a=Math.min(i,e.length);for(;r<a&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1,a=this.top.children.length;s<this.preMatch.index&&(a=Math.min(this.index+3,a));for(let t=this.index;t<a;t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let s=ea.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,s){let r,i=-1;if(s>=this.preMatch.index&&(r=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&r.matchesNode(e,t,n))i=this.top.children.indexOf(r,this.index);else for(let a=this.index,o=Math.min(this.top.children.length,a+5);a<o;a++){let s=this.top.children[a];if(s.matchesNode(e,t,n)&&!this.preMatch.matched.has(s)){i=a;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))}updateNodeAt(e,t,n,s,r){let i=this.top.children[s];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,r)&&(this.destroyBetween(this.index,s),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,s,r,i){for(let a=this.index;a<this.top.children.length;a++){let o=this.top.children[a];if(o instanceof ta){let l=this.preMatch.matched.get(o);if(null!=l&&l!=r)return!1;let c,u=o.dom,d=this.isLocked(u)&&!(e.isText&&o.node&&o.node.isText&&o.nodeDOM.nodeValue==e.text&&3!=o.dirty&&fa(t,o.outerDeco));if(!d&&o.update(e,t,n,s))return this.destroyBetween(this.index,a),o.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(c=this.recreateWrapper(o,e,t,n,s,i)))return this.destroyBetween(this.index,a),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(s,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,s,r,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!fa(n,e.outerDeco)||!s.eq(e.innerDeco))return null;let a=ta.create(this.top,t,n,s,r,i);if(a.contentDOM){a.children=e.children,e.children=[];for(let e of a.children)e.parent=a}return e.destroy(),a}addNode(e,t,n,s,r){let i=ta.create(this.top,e,t,n,s,r);i.contentDOM&&i.updateChildren(s,r+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(!s||!s.matchesWidget(e)||e!=s.widget&&s.widget.type.toDOM.parentNode){let s=new Zi(this.top,e,t,n);this.top.children.splice(this.index++,0,s),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ea;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof sa)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Si||bi)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let s=new ra(this.top,[],n,null);t!=this.top?t.children.push(s):t.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function ga(e,t){return e.type.side-t.type.side}function ya(e,t,n,s,r){let i=[];for(let a=0,o=0;a<e.length;a++){let l=e[a],c=o,u=o+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,s)),r&&(i.push(r),r=void 0),u>n&&i.push(l.slice(n-c,l.size,s)))}return i}function ka(e,t=null){let n=e.domSelectionRange(),s=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),i=r&&0==r.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let o,l,c=s.resolve(a);if(li(n)){for(o=a;r&&!r.node;)r=r.parent;let e=r.node;if(r&&e.isAtom&&Bn.isSelectable(e)&&r.parent&&(!e.isInline||!function(e,t,n){for(let s=0==t,r=t==ai(e);s||r;){if(e==n)return!0;let t=Xr(e);if(!(e=e.parentNode))return!1;s=s&&0==t,r=r&&t==ai(e)}}(n.focusNode,n.focusOffset,r.dom))){let e=r.posBefore;l=new Bn(a==e?c:s.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=a,r=a;for(let s=0;s<n.rangeCount;s++){let i=n.getRangeAt(s);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),r=Math.max(r,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[o,a]=r==e.state.selection.anchor?[r,t]:[t,r],c=s.resolve(a)}else o=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(o<0)return null}let u=s.resolve(o);return l||(l=Da(e,u,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)),l}function wa(e){return e.editable?e.hasFocus():Aa(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ba(e,t=!1){let n=e.state.selection;if(Ta(e,n),wa(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&bi){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&si(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,s="IMG"==n.nodeName;s?t.collapse(n.parentNode,Xr(n)+1):t.collapse(n,0),!s&&!e.state.selection.visible&&gi&&yi<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let s,r,{anchor:i,head:a}=n;!va||n instanceof $n||(n.$from.parent.inlineContent||(s=Sa(e,n.from)),n.empty||n.$from.parent.inlineContent||(r=Sa(e,n.to))),e.docView.setSelection(i,a,e,t),va&&(s&&Ca(s),r&&Ca(r)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),s=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==s&&n.anchorOffset==r||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{wa(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const va=Si||bi&&vi<63;function Sa(e,t){let{node:n,offset:s}=e.docView.domFromPos(t,0),r=s<n.childNodes.length?n.childNodes[s]:null,i=s?n.childNodes[s-1]:null;if(Si&&r&&"false"==r.contentEditable)return xa(r);if(!(r&&"false"!=r.contentEditable||i&&"false"!=i.contentEditable)){if(r)return xa(r);if(i)return xa(i)}}function xa(e){return e.contentEditable="true",Si&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ca(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Ta(e,t){if(t instanceof Bn){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Oa(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Oa(e)}function Oa(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Da(e,t,n,s){return e.someProp("createSelectionBetween",s=>s(e,t,n))||$n.between(t,n,s)}function Ma(e){return!(e.editable&&!e.hasFocus())&&Aa(e)}function Aa(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function Na(e,t){let{$anchor:n,$head:s}=e.selection,r=t>0?n.max(s):n.min(s),i=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return i&&In.findFrom(i,t)}function Ea(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ia(e,t,n){let s=e.state.selection;if(!(s instanceof $n)){if(s instanceof Bn&&s.node.isInline)return Ea(e,new $n(t>0?s.$to:s.$from));{let n=Na(e.state,t);return!!n&&Ea(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=s,r=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!r||r.isText||!r.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+r.nodeSize*(t<0?-1:1));return Ea(e,new $n(s.$anchor,i))}if(!s.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Na(e.state,t);return!!(n&&n instanceof Bn)&&Ea(e,n)}if(!(Ci&&n.indexOf("m")>-1)){let n,r=s.$head,i=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!i||i.isText)return!1;let a=t<0?r.pos-i.nodeSize:r.pos;return!!(i.isAtom||(n=e.docView.descAt(a))&&!n.contentDOM)&&(Bn.isSelectable(i)?Ea(e,new Bn(t<0?e.state.doc.resolve(r.pos-i.nodeSize):r)):!!Di&&Ea(e,new $n(e.state.doc.resolve(t<0?a:a+i.nodeSize))))}}function Ra(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function La(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function Pa(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,s=t.focusOffset;if(!n)return;let r,i,a=!1;for(ki&&1==n.nodeType&&s<Ra(n)&&La(n.childNodes[s],-1)&&(a=!0);;)if(s>0){if(1!=n.nodeType)break;{let e=n.childNodes[s-1];if(La(e,-1))r=n,i=--s;else{if(3!=e.nodeType)break;n=e,s=n.nodeValue.length}}}else{if($a(n))break;{let t=n.previousSibling;for(;t&&La(t,-1);)r=n.parentNode,i=Xr(t),t=t.previousSibling;if(t)n=t,s=Ra(n);else{if(n=n.parentNode,n==e.dom)break;s=0}}}a?Va(e,n,s):r&&Va(e,r,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,s=t.focusOffset;if(!n)return;let r,i,a=Ra(n);for(;;)if(s<a){if(1!=n.nodeType)break;if(!La(n.childNodes[s],1))break;r=n,i=++s}else{if($a(n))break;{let t=n.nextSibling;for(;t&&La(t,1);)r=t.parentNode,i=Xr(t)+1,t=t.nextSibling;if(t)n=t,s=0,a=Ra(n);else{if(n=n.parentNode,n==e.dom)break;s=a=0}}}r&&Va(e,r,i)}(e)}function $a(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Va(e,t,n){if(3!=t.nodeType){let e,s;(s=function(e,t){for(;e&&t==e.childNodes.length&&!oi(e);)t=Xr(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=s,n=0):(e=function(e,t){for(;e&&!t&&!oi(e);)t=Xr(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let s=e.domSelection();if(!s)return;if(li(s)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),s.removeAllRanges(),s.addRange(e)}else s.extend&&s.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&ba(e)},50)}function Ba(e,t){let n=e.state.doc.resolve(t);if(!bi&&!Ti&&n.parent.inlineContent){let s=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),r=(n.top+n.bottom)/2;if(r>s.top&&r<s.bottom&&Math.abs(n.left-s.left)>1)return n.left<s.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),r=(n.top+n.bottom)/2;if(r>s.top&&r<s.bottom&&Math.abs(n.left-s.left)>1)return n.left>s.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Fa(e,t,n){let s=e.state.selection;if(s instanceof $n&&!s.empty||n.indexOf("s")>-1)return!1;if(Ci&&n.indexOf("m")>-1)return!1;let{$from:r,$to:i}=s;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Na(e.state,t);if(n&&n instanceof Bn)return Ea(e,n)}if(!r.parent.inlineContent){let n=t<0?r:i,a=s instanceof zn?In.near(n,t):In.findFrom(n,t);return!!a&&Ea(e,a)}return!1}function za(e,t){if(!(e.state.selection instanceof $n))return!0;let{$head:n,$anchor:s,empty:r}=e.state.selection;if(!n.sameParent(s))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),e.dispatch(s),!0}return!1}function Wa(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ja(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:s,openStart:r,openEnd:i}=t;for(;r>1&&i>1&&1==s.childCount&&1==s.firstChild.childCount;){r--,i--;let e=s.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),s=e.content}let a=e.someProp("clipboardSerializer")||Bt.fromSchema(e.state.schema),o=Za(),l=o.createElement("div");l.appendChild(a.serializeFragment(s,{document:o}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=Ga[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=o.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${r} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function _a(e,t,n,s,r){let i,a,o=r.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(s||o||!n);if(l){if(e.someProp("transformPastedText",n=>{t=n(t,o||s,e)}),o)return a=new _e(Ve.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{a=t(a,e,!0)}),a;let n=e.someProp("clipboardTextParser",n=>n(t,r,s,e));if(n)a=n;else{let n=r.marks(),{schema:s}=e.state,a=Bt.fromSchema(s);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(a.serializeNode(s.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,s=Za().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e);if((n=r&&Ga[r[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join("")),s.innerHTML=function(e){let t=window.trustedTypes;return t?(Xa||(Xa=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),Xa.createHTML(e)):e}(e),n)for(let i=0;i<n.length;i++)s=s.querySelector(n[i])||s;return s}(n),Di&&function(e){let t=e.querySelectorAll(bi?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let s=t[n];1==s.childNodes.length&&" "==s.textContent&&s.parentNode&&s.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),s)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(!a){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Mt.fromSchema(e.state.schema);a=t.parseSlice(i,{preserveWhitespace:!(!l&&!u),context:r,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Ua.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)a=function(e,t){if(!e.size)return e;let n,s=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(o){return e}let{content:r,openStart:i,openEnd:a}=e;for(let l=n.length-2;l>=0;l-=2){let e=s.nodes[n[l]];if(!e||e.hasRequiredAttrs())break;r=Ve.from(e.create(n[l+1],r)),i++,a++}return new _e(r,i,a)}(Ja(a,+u[1],+u[2]),u[4]);else if(a=_e.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let s,r=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach(e=>{if(!i)return;let t,n=r.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&s.length&&qa(n,s,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Ha(i[i.length-1],s.length));let t=Ka(e,n);i.push(t),r=r.matchType(t.type),s=n}}),i)return Ve.from(i)}return e}(a.content,r),!0),a.openStart||a.openEnd){let e=0,t=0;for(let n=a.content.firstChild;e<a.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=a.content.lastChild;t<a.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);a=Ja(a,e,t)}return e.someProp("transformPasted",t=>{a=t(a,e,l)}),a}const Ua=/^(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 Ka(e,t,n=0){for(let s=t.length-1;s>=n;s--)e=t[s].create(null,Ve.from(e));return e}function qa(e,t,n,s,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let i=qa(e,t,n,s.lastChild,r+1);if(i)return s.copy(s.content.replaceChild(s.childCount-1,i));if(s.contentMatchAt(s.childCount).matchType(r==e.length-1?n.type:e[r+1]))return s.copy(s.content.append(Ve.from(Ka(n,e,r+1))))}}function Ha(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Ha(e.lastChild,t-1)),s=e.contentMatchAt(e.childCount).fillBefore(Ve.empty,!0);return e.copy(n.append(s))}function Ya(e,t,n,s,r,i){let a=t<0?e.firstChild:e.lastChild,o=a.content;return e.childCount>1&&(i=0),r<s-1&&(o=Ya(o,t,n,s,r+1,i)),r>=n&&(o=t<0?a.contentMatchAt(0).fillBefore(o,i<=r).append(o):o.append(a.contentMatchAt(a.childCount).fillBefore(Ve.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(o))}function Ja(e,t,n){return t<e.openStart&&(e=new _e(Ya(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new _e(Ya(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Ga={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Qa=null;function Za(){return Qa||(Qa=document.implementation.createHTMLDocument("title"))}let Xa=null;const eo={},to={},no={touchstart:!0,touchmove:!0};class so{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 ro(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function io(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ao(e,t))})}function ao(e,t){return e.someProp("handleDOMEvents",n=>{let s=n[t.type];return!!s&&(s(e,t)||t.defaultPrevented)})}function oo(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||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function lo(e){return{left:e.clientX,top:e.clientY}}function co(e,t,n,s,r){if(-1==s)return!1;let i=e.state.doc.resolve(s);for(let a=i.depth+1;a>0;a--)if(e.someProp(t,t=>a>i.depth?t(e,n,i.nodeAfter,i.before(a),r,!0):t(e,n,i.node(a),i.before(a),r,!1)))return!0;return!1}function uo(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let s=e.state.tr.setSelection(t);s.setMeta("pointer",!0),e.dispatch(s)}function po(e,t,n,s){return co(e,"handleDoubleClickOn",t,n,s)||e.someProp("handleDoubleClick",n=>n(e,t,s))}function fo(e,t,n,s){return co(e,"handleTripleClickOn",t,n,s)||e.someProp("handleTripleClick",n=>n(e,t,s))||function(e,t,n){if(0!=n.button)return!1;let s=e.state.doc;if(-1==t)return!!s.inlineContent&&(uo(e,$n.create(s,0,s.content.size)),!0);let r=s.resolve(t);for(let i=r.depth+1;i>0;i--){let t=i>r.depth?r.nodeAfter:r.node(i),n=r.before(i);if(t.inlineContent)uo(e,$n.create(s,n+1,n+1+t.content.size));else{if(!Bn.isSelectable(t))continue;uo(e,Bn.create(s,n))}return!0}}(e,n,s)}function ho(e){return vo(e)}to.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!yo(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Oi||!bi||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!xi||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||function(e,t){let n=t.keyCode,s=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||Ci&&72==n&&"c"==s)return za(e,-1)||Pa(e,-1);if(46==n&&!t.shiftKey||Ci&&68==n&&"c"==s)return za(e,1)||Pa(e,1);if(13==n||27==n)return!0;if(37==n||Ci&&66==n&&"c"==s){let t=37==n?"ltr"==Ba(e,e.state.selection.from)?-1:1:-1;return Ia(e,t,s)||Pa(e,t)}if(39==n||Ci&&70==n&&"c"==s){let t=39==n?"ltr"==Ba(e,e.state.selection.from)?1:-1:1;return Ia(e,t,s)||Pa(e,t)}return 38==n||Ci&&80==n&&"c"==s?Fa(e,-1,s)||Pa(e,-1):40==n||Ci&&78==n&&"c"==s?function(e){if(!Si||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Wa(e,n,"true"),setTimeout(()=>Wa(e,n,"false"),20)}return!1}(e)||Fa(e,1,s)||Pa(e,1):s==(Ci?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():ro(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,ci(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},to.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},to.keypress=(e,t)=>{let n=t;if(yo(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ci&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let s=e.state.selection;if(!(s instanceof $n&&s.$from.sameParent(s.$to))){let t=String.fromCharCode(n.charCode),r=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,s.$from.pos,s.$to.pos,t,r))||e.dispatch(r()),n.preventDefault()}};const mo=Ci?"metaKey":"ctrlKey";eo.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let s=ho(e),r=Date.now(),i="singleClick";r-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,s=t.y-e.clientY;return n*n+s*s<100}(n,e.input.lastClick)&&!n[mo]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:i,button:n.button};let a=e.posAtCoords(lo(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new go(e,a,n,!!s)):("doubleClick"==i?po:fo)(e,a.pos,a.inside,n)?n.preventDefault():ro(e,"pointer"))};class go{constructor(e,t,n,s){let r,i;if(this.view=e,this.pos=t,this.event=n,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[mo],this.allowDefault=n.shiftKey,t.inside>-1)r=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);r=n.parent,i=n.depth?n.before():0}const a=s?null:n.target,o=a?e.docView.nearestDesc(a,!0):null;this.target=o&&1==o.nodeDOM.nodeType?o.nodeDOM:null;let{selection:l}=e.state;(0==n.button&&r.type.spec.draggable&&!1!==r.type.spec.selectable||l instanceof Bn&&l.from<=i&&l.to>i)&&(this.mightDrag={node:r,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!ki||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)),ro(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(()=>ba(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(lo(e))),this.updateAllowDefault(e),this.allowDefault||!t?ro(this.view,"pointer"):function(e,t,n,s,r){return co(e,"handleClickOn",t,n,s)||e.someProp("handleClick",n=>n(e,t,s))||(r?function(e,t){if(-1==t)return!1;let n,s,r=e.state.selection;r instanceof Bn&&(n=r.node);let i=e.state.doc.resolve(t);for(let a=i.depth+1;a>0;a--){let e=a>i.depth?i.nodeAfter:i.node(a);if(Bn.isSelectable(e)){s=n&&r.$from.depth>0&&a>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?i.before(r.$from.depth):i.before(a);break}}return null!=s&&(uo(e,Bn.create(e.state.doc,s)),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),s=n.nodeAfter;return!!(s&&s.isAtom&&Bn.isSelectable(s))&&(uo(e,new Bn(n)),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Si&&this.mightDrag&&!this.mightDrag.node.isAtom||bi&&!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)?(uo(this.view,In.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ro(this.view,"pointer")}move(e){this.updateAllowDefault(e),ro(this.view,"pointer"),0==e.buttons&&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)}}function yo(e,t){return!!e.composing||!!(Si&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}eo.touchstart=e=>{e.input.lastTouch=Date.now(),ho(e),ro(e,"pointer")},eo.touchmove=e=>{e.input.lastTouch=Date.now(),ro(e,"pointer")},eo.contextmenu=e=>ho(e);const ko=Oi?5e3:-1;function wo(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>vo(e),t))}function bo(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function vo(e,t=!1){if(!(Oi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),bo(e),t||e.docView&&e.docView.dirty){let n=ka(e),s=e.state.selection;return n&&!n.eq(s)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||s.$from.node(s.$from.sharedDepth(s.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}to.compositionstart=to.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof $n&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||bi&&Ti&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let s=t.childNodes[n];return 1==s.nodeType&&"false"==s.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),vo(e,!0),e.markCursor=null;else if(vo(e,!t.selection.empty),ki&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,s=t.focusOffset;n&&1==n.nodeType&&0!=s;){let t=s<0?n.lastChild:n.childNodes[s-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,s=-1}}e.input.composing=!0}wo(e,ko)},to.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++,wo(e,20))};const So=gi&&yi<15||xi&&Mi<604;function xo(e,t,n,s,r){let i=_a(e,t,n,s,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,r,i||_e.empty)))return!0;if(!i)return!1;let a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),o=a?e.state.tr.replaceSelectionWith(a,s):e.state.tr.replaceSelection(i);return e.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Co(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," "):""}eo.copy=to.cut=(e,t)=>{let n=t,s=e.state.selection,r="cut"==n.type;if(s.empty)return;let i=So?null:n.clipboardData,a=s.content(),{dom:o,text:l}=ja(e,a);i?(n.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",l)):function(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 s=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),s.removeAllRanges(),s.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},to.paste=(e,t)=>{let n=t;if(e.composing&&!Oi)return;let s=So?null:n.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;s&&xo(e,Co(s),s.getData("text/html"),r,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,s=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(s.contentEditable="true"),s.style.cssText="position: fixed; left: -10000px; top: 10px",s.focus();let r=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),s.parentNode&&s.parentNode.removeChild(s),n?xo(e,s.value,null,r,t):xo(e,s.textContent,s.innerHTML,r,t)},50)}(e,n)};class To{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Oo=Ci?"altKey":"ctrlKey";function Do(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[Oo]}eo.dragstart=(e,t)=>{let n=t,s=e.input.mouseDown;if(s&&s.done(),!n.dataTransfer)return;let r,i=e.state.selection,a=i.empty?null:e.posAtCoords(lo(n));if(a&&a.pos>=i.from&&a.pos<=(i instanceof Bn?i.to-1:i.to));else if(s&&s.mightDrag)r=Bn.create(e.state.doc,s.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(r=Bn.create(e.state.doc,t.posBefore))}let o=(r||e.state.selection).content(),{dom:l,text:c,slice:u}=ja(e,o);(!n.dataTransfer.files.length||!bi||vi>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(So?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",So||n.dataTransfer.setData("text/plain",c),e.dragging=new To(u,Do(e,n),r)},eo.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},to.dragover=to.dragenter=(e,t)=>t.preventDefault(),to.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let s=e.posAtCoords(lo(t));if(!s)return;let r=e.state.doc.resolve(s.pos),i=n&&n.slice;i?e.someProp("transformPasted",t=>{i=t(i,e,!1)}):i=_a(e,Co(t.dataTransfer),So?null:t.dataTransfer.getData("text/html"),!1,r);let a=!(!n||!Do(e,t));if(e.someProp("handleDrop",n=>n(e,t,i||_e.empty,a)))return void t.preventDefault();if(!i)return;t.preventDefault();let o=i?function(e,t,n){let s=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let i=0;i<n.openStart;i++)r=r.firstChild.content;for(let i=1;i<=(0==n.openStart&&n.size?2:1);i++)for(let e=s.depth;e>=0;e--){let t=e==s.depth?0:s.pos<=(s.start(e+1)+s.end(e+1))/2?-1:1,n=s.index(e)+(t>0?1:0),a=s.node(e),o=!1;if(1==i)o=a.canReplace(n,n,r);else{let e=a.contentMatchAt(n).findWrapping(r.firstChild.type);o=e&&a.canReplaceWith(n,n,e[0])}if(o)return 0==t?s.pos:t<0?s.before(e+1):s.after(e+1)}return null}(e.state.doc,r.pos,i):r.pos;null==o&&(o=r.pos);let l=e.state.tr;if(a){let{node:e}=n;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(o),u=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,d=l.doc;if(u?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),l.doc.eq(d))return;let p=l.doc.resolve(c);if(u&&Bn.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new Bn(p));else{let t=l.mapping.map(o);l.mapping.maps[l.mapping.maps.length-1].forEach((e,n,s,r)=>t=r),l.setSelection(Da(e,p,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},eo.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())&&ba(e)},20))},eo.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(),e.focused=!1)},eo.beforeinput=(e,t)=>{if(bi&&Oi&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,ci(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 os in to)eo[os]=to[os];function Mo(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}class Ao{constructor(e,t){this.toDOM=e,this.spec=t||Lo,this.side=this.spec.side||0}map(e,t,n,s){let{pos:r,deleted:i}=e.mapResult(t.from+s,this.side<0?-1:1);return i?null:new Io(r-n,r-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Ao&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Mo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class No{constructor(e,t){this.attrs=e,this.spec=t||Lo}map(e,t,n,s){let r=e.map(t.from+s,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+s,this.spec.inclusiveEnd?1:-1)-n;return r>=i?null:new Io(r,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof No&&Mo(this.attrs,e.attrs)&&Mo(this.spec,e.spec)}static is(e){return e.type instanceof No}destroy(){}}class Eo{constructor(e,t){this.attrs=e,this.spec=t||Lo}map(e,t,n,s){let r=e.mapResult(t.from+s,1);if(r.deleted)return null;let i=e.mapResult(t.to+s,-1);return i.deleted||i.pos<=r.pos?null:new Io(r.pos-n,i.pos-n,this)}valid(e,t){let n,{index:s,offset:r}=e.content.findIndex(t.from);return r==t.from&&!(n=e.child(s)).isText&&r+n.nodeSize==t.to}eq(e){return this==e||e instanceof Eo&&Mo(this.attrs,e.attrs)&&Mo(this.spec,e.spec)}destroy(){}}class Io{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Io(e,t,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(e,t,n){return new Io(e,e,new Ao(t,n))}static inline(e,t,n,s){return new Io(e,t,new No(n,s))}static node(e,t,n,s){return new Io(e,t,new Eo(n,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof No}get widget(){return this.type instanceof Ao}}const Ro=[],Lo={};class Po{constructor(e,t){this.local=e.length?e:Ro,this.children=t.length?t:Ro}static create(e,t){return t.length?Wo(t,e,0,Lo):$o}find(e,t,n){let s=[];return this.findInner(e??0,t??1e9,s,0,n),s}findInner(e,t,n,s,r){for(let i=0;i<this.local.length;i++){let a=this.local[i];a.from<=t&&a.to>=e&&(!r||r(a.spec))&&n.push(a.copy(a.from+s,a.to+s))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,t-a,n,s+a,r)}}map(e,t,n){return this==$o||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Lo)}mapInner(e,t,n,s,r){let i;for(let a=0;a<this.local.length;a++){let o=this.local[a].map(e,n,s);o&&o.type.valid(t,o)?(i||(i=[])).push(o):r.onRemove&&r.onRemove(this.local[a].spec)}return this.children.length?function(e,t,n,s,r,i,a){let o=e.slice();for(let c=0,u=i;c<n.maps.length;c++){let e=0;n.maps[c].forEach((t,n,s,r)=>{let i=r-s-(n-t);for(let a=0;a<o.length;a+=3){let s=o[a+1];if(s<0||t>s+u-e)continue;let r=o[a]+u-e;n>=r?o[a+1]=t<=r?-2:-1:t>=u&&i&&(o[a]+=i,o[a+1]+=i)}e+=i}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<o.length;c+=3)if(o[c+1]<0){if(-2==o[c+1]){l=!0,o[c+1]=-1;continue}let t=n.map(e[c]+i),u=t-r;if(u<0||u>=s.content.size){l=!0;continue}let d=n.map(e[c+1]+i,-1)-r,{index:p,offset:f}=s.content.findIndex(u),h=s.maybeChild(p);if(h&&f==u&&f+h.nodeSize==d){let s=o[c+2].mapInner(n,h,t+1,e[c]+i+1,a);s!=$o?(o[c]=u,o[c+1]=d,o[c+2]=s):(o[c+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,s,r,i,a){function o(e,t){for(let i=0;i<e.local.length;i++){let o=e.local[i].map(s,r,t);o?n.push(o):a.onRemove&&a.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)o(e.children[n+2],e.children[n]+t+1)}for(let l=0;l<e.length;l+=3)-1==e[l+1]&&o(e[l+2],t[l]+i+1);return n}(o,e,t,n,r,i,a),c=Wo(l,s,0,a);t=c.local;for(let e=0;e<o.length;e+=3)o[e+1]<0&&(o.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<o.length&&o[t]<n;)t+=3;o.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Po(t.sort(jo),o)}(this.children,i||[],e,t,n,s,r):i?new Po(i.sort(jo),Ro):$o}add(e,t){return t.length?this==$o?Po.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let s,r=0;e.forEach((e,i)=>{let a,o=i+n;if(a=Fo(t,e,o)){for(s||(s=this.children.slice());r<s.length&&s[r]<i;)r+=3;s[r]==i?s[r+2]=s[r+2].addInner(e,a,o+1):s.splice(r,0,i,i+e.nodeSize,Wo(a,e,o+1,Lo)),r+=3}});let i=Bo(r?zo(t):t,-n);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new Po(i.length?this.local.concat(i).sort(jo):this.local,s||this.children)}remove(e){return 0==e.length||this==$o?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,s=this.local;for(let r=0;r<n.length;r+=3){let s,i=n[r]+t,a=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<a&&(e[n]=null,(s||(s=[])).push(t));if(!s)continue;n==this.children&&(n=this.children.slice());let o=n[r+2].removeInner(s,i+1);o!=$o?n[r+2]=o:(n.splice(r,3),r-=3)}if(s.length)for(let r,i=0;i<e.length;i++)if(r=e[i])for(let e=0;e<s.length;e++)s[e].eq(r,t)&&(s==this.local&&(s=this.local.slice()),s.splice(e--,1));return n==this.children&&s==this.local?this:s.length||n.length?new Po(s,n):$o}forChild(e,t){if(this==$o)return this;if(t.isLeaf)return Po.empty;let n,s;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let r=e+1,i=r+t.content.size;for(let a=0;a<this.local.length;a++){let e=this.local[a];if(e.from<i&&e.to>r&&e.type instanceof No){let t=Math.max(r,e.from)-r,n=Math.min(i,e.to)-r;t<n&&(s||(s=[])).push(e.copy(t,n))}}if(s){let e=new Po(s.sort(jo),Ro);return n?new Vo([e,n]):e}return n||$o}eq(e){if(this==e)return!0;if(!(e instanceof Po)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return _o(this.localsInner(e))}localsInner(e){if(this==$o)return Ro;if(e.inlineContent||!this.local.some(No.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof No||t.push(this.local[n]);return t}forEachSet(e){e(this)}}Po.empty=new Po([],[]),Po.removeOverlap=_o;const $o=Po.empty;class Vo{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,Lo));return Vo.from(n)}forChild(e,t){if(t.isLeaf)return Po.empty;let n=[];for(let s=0;s<this.members.length;s++){let r=this.members[s].forChild(e,t);r!=$o&&(r instanceof Vo?n=n.concat(r.members):n.push(r))}return Vo.from(n)}eq(e){if(!(e instanceof Vo)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let s=0;s<this.members.length;s++){let r=this.members[s].localsInner(e);if(r.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<r.length;e++)t.push(r[e])}else t=r}return t?_o(n?t:t.sort(jo)):Ro}static from(e){switch(e.length){case 0:return $o;case 1:return e[0];default:return new Vo(e.every(e=>e instanceof Po)?e:e.reduce((e,t)=>e.concat(t instanceof Po?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Bo(e,t){if(!t||!e.length)return e;let n=[];for(let s=0;s<e.length;s++){let r=e[s];n.push(new Io(r.from+t,r.to+t,r.type))}return n}function Fo(e,t,n){if(t.isLeaf)return null;let s=n+t.nodeSize,r=null;for(let i,a=0;a<e.length;a++)(i=e[a])&&i.from>n&&i.to<s&&((r||(r=[])).push(i),e[a]=null);return r}function zo(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Wo(e,t,n,s){let r=[],i=!1;t.forEach((t,a)=>{let o=Fo(e,t,a+n);if(o){i=!0;let e=Wo(o,t,n+a+1,s);e!=$o&&r.push(a,a+t.nodeSize,e)}});let a=Bo(i?zo(e):e,-n).sort(jo);for(let o=0;o<a.length;o++)a[o].type.valid(t,a[o])||(s.onRemove&&s.onRemove(a[o].spec),a.splice(o--,1));return a.length||r.length?new Po(a,r):$o}function jo(e,t){return e.from-t.from||e.to-t.to}function _o(e){let t=e;for(let n=0;n<t.length-1;n++){let s=t[n];if(s.from!=s.to)for(let r=n+1;r<t.length;r++){let i=t[r];if(i.from!=s.from){i.from<s.to&&(t==e&&(t=e.slice()),t[n]=s.copy(s.from,i.from),Uo(t,r,s.copy(i.from,s.to)));break}i.to!=s.to&&(t==e&&(t=e.slice()),t[r]=i.copy(i.from,s.to),Uo(t,r+1,i.copy(s.to,i.to)))}}return t}function Uo(e,t,n){for(;t<e.length&&jo(n,e[t])>0;)t++;e.splice(t,0,n)}function Ko(e){let t=[];return e.someProp("decorations",n=>{let s=n(e.state);s&&s!=$o&&t.push(s)}),e.cursorWrapper&&t.push(Po.create(e.state.doc,[e.cursorWrapper.deco])),Vo.from(t)}const qo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ho=gi&&yi<=11;class Yo{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}}class Jo{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Yo,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]);gi&&yi<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Si&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Ho&&(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,qo)),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(Ma(this.view)){if(this.suppressingSelectionUpdates)return ba(this.view);if(gi&&yi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&si(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,n=new Set;for(let r=e.focusNode;r;r=ei(r))n.add(r);for(let r=e.anchorNode;r;r=ei(r))if(n.has(r)){t=r;break}let s=t&&this.view.docView.nearestDesc(t);return s&&s.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 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(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Ma(e)&&!this.ignoreSelectionChange(n),r=-1,i=-1,a=!1,o=[];if(e.editable)for(let c=0;c<t.length;c++){let e=this.registerMutation(t[c],o);e&&(r=r<0?e.from:Math.min(e.from,r),i=i<0?e.to:Math.max(e.to,i),e.typeOver&&(a=!0))}if(!o.some(e=>"BR"==e.nodeName)||8!=e.input.lastKeyCode&&46!=e.input.lastKeyCode){if(ki&&o.length){let t=o.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let s of t){let t=s.parentNode;!t||"LI"!=t.nodeName||n&&Xo(e,n)==t||s.remove()}}}}else for(let c of o)if("BR"==c.nodeName&&c.parentNode){let e=c.nextSibling;e&&1==e.nodeType&&"false"==e.contentEditable&&c.parentNode.removeChild(c)}let l=null;r<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&li(n)&&(l=ka(e))&&l.eq(In.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ba(e),this.currentSelection.set(n),e.scrollToSelection()):(r>-1||s)&&(r>-1&&(e.docView.markDirty(r,i),function(e){if(!Go.has(e)&&(Go.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=ki,Qo)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."),Qo=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:s,focusOffset:r}=e.domSelectionRange();for(let i of t)if("TR"==(null===(n=i.parentNode)||void 0===n?void 0:n.nodeName)){let t=i.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(i,n.firstChild),s==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}(e,o)),this.handleDOMChange(r,i,a,o),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||ba(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("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let s=e.addedNodes[n];t.push(s),3==s.nodeType&&(this.lastChangedTextNode=s)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let s=e.previousSibling,r=e.nextSibling;if(gi&&yi<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(s=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(r=i)}let i=s&&s.parentNode==e.target?Xr(s)+1:0,a=n.localPosFromDOM(e.target,i,-1),o=r&&r.parentNode==e.target?Xr(r):e.target.childNodes.length;return{from:a,to:n.localPosFromDOM(e.target,o,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Go=new WeakMap,Qo=!1;function Zo(e,t){let n=t.startContainer,s=t.startOffset,r=t.endContainer,i=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return si(a.node,a.offset,r,i)&&([n,s,r,i]=[r,i,n,s]),{anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:i}}function Xo(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 el(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Si&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Si&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const tl=/^(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 nl(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Da(e,t.resolve(n.anchor),t.resolve(n.head))}function sl(e,t,n){let s=e.depth,r=t?e.end():e.pos;for(;s>0&&(t||e.indexAfter(s)==e.node(s).childCount);)s--,r++,t=!1;if(n){let t=e.node(s).maybeChild(e.indexAfter(s));for(;t&&!t.isLeaf;)t=t.firstChild,r++}return r}function rl(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class il{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 so,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ul),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ll(this),ol(this),this.nodeViews=cl(this),this.docView=na(this.state.doc,al(this),Ko(this),this.dom,this),this.domObserver=new Jo(this,(e,t,n,s)=>function(e,t,n,s,r){let i=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=ka(e,t);if(n&&!e.state.selection.eq(n)){if(bi&&Oi&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,ci(13,"Enter"))))return;let s=e.state.tr.setSelection(n);"pointer"==t?s.setMeta("pointer",!0):"key"==t&&s.scrollIntoView(),i&&s.setMeta("composition",i),e.dispatch(s)}return}let a=e.state.doc.resolve(t),o=a.sharedDepth(n);t=a.before(o+1),n=e.state.doc.resolve(n).after(o+1);let l,c,u=e.state.selection,d=function(e,t,n){let s,{node:r,fromOffset:i,toOffset:a,from:o,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(s=[{node:u,offset:c.anchorOffset}],li(c)||s.push({node:c.focusNode,offset:c.focusOffset})),bi&&8===e.input.lastKeyCode)for(let g=a;g>i;g--){let e=r.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){a=g;break}if(!t||t.size)break}let d=e.state.doc,p=e.someProp("domParser")||Mt.fromSchema(e.state.schema),f=d.resolve(o),h=null,m=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:s,ruleFromNode:el,context:f});if(s&&null!=s[0].pos){let e=s[0].pos,t=s[1]&&s[1].pos;null==t&&(t=e),h={anchor:e+o,head:t+o}}return{doc:m,sel:h,from:o,to:l}}(e,t,n),p=e.state.doc,f=p.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,c="end"):(l=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let h=function(e,t,n,s,r){let i=e.findDiffStart(t,n);if(null==i)return null;let{a,b:o}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==r&&(s-=a+Math.max(0,i-Math.min(a,o))-i),a<i&&e.size<t.size){let e=s<=i&&s>=a?i-s:0;i-=e,i&&i<t.size&&rl(t.textBetween(i-1,i+1))&&(i+=e?1:-1),o=i+(o-a),a=i}else if(o<i){let t=s<=i&&s>=o?i-s:0;i-=t,i&&i<e.size&&rl(e.textBetween(i-1,i+1))&&(i+=t?1:-1),a=i+(a-o),o=i}return{start:i,endA:a,endB:o}}(f.content,d.doc.content,d.from,l,c);if(h&&e.input.domChangeCount++,(xi&&e.input.lastIOSEnter>Date.now()-225||Oi)&&r.some(e=>1==e.nodeType&&!tl.test(e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",t=>t(e,ci(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!h){if(!(s&&u instanceof $n&&!u.empty&&u.$head.sameParent(u.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let t=nl(e,e.state.doc,d.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);i&&n.setMeta("composition",i),e.dispatch(n)}}return}h={start:u.from,endA:u.to,endB:u.to}}e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof $n&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),gi&&yi<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>d.from&&" "==d.doc.textBetween(h.start-d.from-1,h.start-d.from+1)&&(h.start--,h.endA--,h.endB--);let m=d.doc.resolveNoCache(h.start-d.from),g=d.doc.resolveNoCache(h.endB-d.from),y=p.resolve(h.start),k=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=h.endA;if((xi&&e.input.lastIOSEnter>Date.now()-225&&(!k||r.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!k&&m.pos<d.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(d.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,ci(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,s,r){if(n-t<=r.pos-s.pos||sl(s,!0,!1)<r.pos)return!1;let i=e.resolve(t);if(!s.parent.isTextblock){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let a=e.resolve(sl(i,!0,!0));return!(!a.parent.isTextblock||a.pos>n||sl(a,!0,!1)<n)&&s.parent.content.cut(s.parentOffset).eq(a.parent.content)}(p,h.start,h.endA,m,g)&&e.someProp("handleKeyDown",t=>t(e,ci(8,"Backspace"))))return void(Oi&&bi&&e.domObserver.suppressSelectionUpdates());bi&&h.endB==h.start&&(e.input.lastChromeDelete=Date.now()),Oi&&!k&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==h.endA&&(h.endB-=2,g=d.doc.resolveNoCache(h.endB-d.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,ci(13,"Enter"))})},20));let w,b=h.start,v=h.endA,S=t=>{let n=t||e.state.tr.replace(b,v,d.doc.slice(h.start-d.from,h.endB-d.from));if(d.sel){let t=nl(e,n.doc,d.sel);t&&!(bi&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==b||t.head==n.mapping.map(v)-1)||gi&&t.empty&&t.head==b)&&n.setSelection(t)}return i&&n.setMeta("composition",i),n.scrollIntoView()};if(k)if(m.pos==g.pos){gi&&yi<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ba(e),20));let t=S(e.state.tr.delete(b,v)),n=p.resolve(h.start).marksAcross(p.resolve(h.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(h.endA==h.endB&&(w=function(e,t){let n,s,r,i=e.firstChild.marks,a=t.firstChild.marks,o=i,l=a;for(let u=0;u<a.length;u++)o=a[u].removeFromSet(o);for(let u=0;u<i.length;u++)l=i[u].removeFromSet(l);if(1==o.length&&0==l.length)s=o[0],n="add",r=e=>e.mark(s.addToSet(e.marks));else{if(0!=o.length||1!=l.length)return null;s=l[0],n="remove",r=e=>e.mark(s.removeFromSet(e.marks))}let c=[];for(let u=0;u<t.childCount;u++)c.push(r(t.child(u)));if(Ve.from(c).eq(e))return{mark:s,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start())))){let t=S(e.state.tr);"add"==w.type?t.addMark(b,v,w.mark):t.removeMark(b,v,w.mark),e.dispatch(t)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>S(e.state.tr.insertText(t,b,v));e.someProp("handleTextInput",s=>s(e,b,v,t,n))||e.dispatch(n())}else e.dispatch(S());else e.dispatch(S())}(this,e,t,n,s)),this.domObserver.start(),function(e){for(let t in eo){let n=eo[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!oo(e,t)||ao(e,t)||!e.editable&&t.type in to||n(e,t)},no[t]?{passive:!0}:void 0)}Si&&e.dom.addEventListener("input",()=>null),io(e)}(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&&io(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ul),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];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){var n;let s=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(bo(this),i=!0),this.state=e;let a=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=cl(this);(function(e,t){let n=0,s=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let r in t)s++;return n!=s})(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&io(this),this.editable=ll(this),ol(this);let o=Ko(this),l=al(this),c=s.plugins==e.plugins||s.doc.eq(e.doc)?e.scrollToSelection>s.scrollToSelection?"to selection":"preserve":"reset",u=r||!this.docView.matchesNode(e.doc,l,o);!u&&e.selection.eq(s.selection)||(i=!0);let d="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,s=e.dom.getBoundingClientRect(),r=Math.max(0,s.top);for(let i=(s.left+s.right)/2,a=r+1;a<Math.min(innerHeight,s.bottom);a+=5){let s=e.root.elementFromPoint(i,a);if(!s||s==e.dom||!e.dom.contains(s))continue;let o=s.getBoundingClientRect();if(o.top>=r-20){t=s,n=o.top;break}}return{refDOM:t,refTop:n,stack:Ri(e.dom)}}(this);if(i){this.domObserver.stop();let t=u&&(gi||bi)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&function(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)}(s.selection,e.selection);if(u){let n=bi?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=ai(e=e.childNodes[t-1])}else{if(!e.parentNode||oi(e))return null;t=Xr(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),s=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||oi(e))return null;t=Xr(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&s&&n!=s){let t=s.pmViewDesc,r=e.domObserver.lastChangedTextNode;if(n==r||s==r)return r;if(!t||!t.isText(s.nodeValue))return s;if(e.input.compositionNode==s){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return s}}return n||s}(this)),!r&&this.docView.update(e.doc,l,o,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=na(e.doc,l,o,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return si(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ba(this,t):(Ta(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():d&&function({refDOM:e,refTop:t,stack:n}){let s=e?e.getBoundingClientRect().top:0;Li(n,0==s?0:s-t)}(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof Bn){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&Ii(this,t.getBoundingClientRect(),e)}else Ii(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)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{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))}}}updateDraggedNode(e,t){let n=e.node,s=-1;if(this.state.doc.nodeAt(n.from)==n.node)s=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(s=e)}this.dragging=new To(e.slice,e.move,s<0?void 0:Bn.create(this.state.doc,s))}someProp(e,t){let n,s=this._props&&this._props[e];if(null!=s&&(n=t?t(s):s))return n;for(let i=0;i<this.directPlugins.length;i++){let s=this.directPlugins[i].props[e];if(null!=s&&(n=t?t(s):s))return n}let r=this.state.plugins;if(r)for(let i=0;i<r.length;i++){let s=r[i].props[e];if(null!=s&&(n=t?t(s):s))return n}}hasFocus(){if(gi){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("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(Pi)return e.focus(Pi);let t=Ri(e);e.focus(null==Pi?{get preventScroll(){return Pi={preventScroll:!0},!0}}:void 0),Pi||(Pi=!1,Li(t,0))}(this.dom),ba(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return Fi(this,e)}coordsAtPos(e,t=1){return _i(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 s=this.docView.posFromDOM(e,t,n);if(null==s)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,t){return function(e,t,n){return Yi==t&&Ji==n?Gi:(Yi=t,Ji=n,Gi="up"==n||"down"==n?function(e,t,n){let s=t.selection,r="up"==n?s.$from:s.$to;return qi(e,t,()=>{let{node:t}=e.docView.domFromPos(r.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let s=_i(e,r.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=ni(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let r=t[e];if(r.bottom>r.top+1&&("up"==n?s.top-r.top>2*(r.bottom-s.top):r.bottom-s.bottom>2*(s.bottom-r.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:s}=t.selection;if(!s.parent.isTextblock)return!1;let r=s.parentOffset,i=!r,a=r==s.parent.content.size,o=e.domSelection();return o?Hi.test(s.parent.textContent)&&o.modify?qi(e,t,()=>{let{focusNode:t,focusOffset:r,anchorNode:i,anchorOffset:a}=e.domSelectionRange(),l=o.caretBidiLevel;o.modify("move",n,"character");let c=s.depth?e.docView.domAfterPos(s.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),p=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&r==d;try{o.collapse(i,a),t&&(t!=i||r!=a)&&o.extend&&o.extend(t,r)}catch(f){}return null!=l&&(o.caretBidiLevel=l),p}):"left"==n||"backward"==n?i:a:s.pos==s.start()||s.pos==s.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return xo(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return xo(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return ja(this,e)}destroy(){this.docView&&(function(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)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ko(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ti=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){ao(e,t)||!eo[t.type]||!e.editable&&t.type in to||eo[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?Si&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Zo(e,n)}let n;function s(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",s,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",s,!0),n?Zo(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function al(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[Io.node(0,e.state.doc.content.size,t)]}function ol(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:Io.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ll(e){return!e.someProp("editable",t=>!1===t(e.state))}function cl(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 ul(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function dl(e,t){return e.meta={package:"@milkdown/core",group:"System",...t},e}il.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};var pl={text:(e,t,n,s)=>{const r=e.value;return/^[^*_\\]*\s+$/.test(r)?r:n.safe(r,{...s,encode:[]})},strong:(e,t,n,s)=>{const r=e.marker||n.options.strong||"*",i=n.enter("strong"),a=n.createTracker(s);let o=a.move(r+r);return o+=a.move(n.containerPhrasing(e,{before:o,after:r,...a.current()})),o+=a.move(r+r),i(),o},emphasis:(e,t,n,s)=>{const r=e.marker||n.options.emphasis||"*",i=n.enter("emphasis"),a=n.createTracker(s);let o=a.move(r);return o+=a.move(n.containerPhrasing(e,{before:o,after:r,...a.current()})),o+=a.move(r),i(),o}},fl=ys({},"editorView"),hl=ys({},"editorState"),ml=ys([],"initTimer"),gl=ys({},"editor"),yl=ys([],"inputRules"),kl=ys([],"prosePlugins"),wl=ys([],"remarkPlugins"),bl=ys([],"nodeView"),vl=ys([],"markView"),Sl=ys(q().use(H).use(Cs),"remark"),xl=ys({handlers:pl,encode:[]},"remarkStringifyOptions"),Cl=xs("ConfigReady"),Tl=xs("InitReady");function Ol(e){const t=t=>(t.inject(gl,e).inject(kl,[]).inject(wl,[]).inject(yl,[]).inject(bl,[]).inject(vl,[]).inject(xl,{handlers:pl,encode:[]}).inject(Sl,q().use(H).use(Cs)).inject(ml,[Cl]).record(Tl),async()=>{await t.waitTimers(ml);const e=t.get(xl);return t.set(Sl,q().use(H).use(Cs,e)),t.done(Tl),()=>{t.remove(gl).remove(kl).remove(wl).remove(yl).remove(bl).remove(vl).remove(xl).remove(Sl).remove(ml).clearTimer(Tl)}});return dl(t,{displayName:"Init"}),t}var Dl=xs("SchemaReady"),Ml=ys([],"schemaTimer"),Al=ys({},"schema"),Nl=ys([],"nodes"),El=ys([],"marks");function Il(e){return{...e,parseDOM:e.parseDOM?.map(t=>({priority:e.priority,...t}))}}var Rl=e=>(e.inject(Al,{}).inject(Nl,[]).inject(El,[]).inject(Ml,[Tl]).record(Dl),async()=>{await e.waitTimers(Ml);const t=e.get(Sl),n=e.get(wl).reduce((e,t)=>e.use(t.plugin,t.options),t);e.set(Sl,n);const s=new Ot({nodes:Object.fromEntries(e.get(Nl).map(([e,t])=>[e,Il(t)])),marks:Object.fromEntries(e.get(El).map(([e,t])=>[e,Il(t)]))});return e.set(Al,s),e.done(Dl),()=>{e.remove(Al).remove(Nl).remove(El).remove(Ml).clearTimer(Dl)}});dl(Rl,{displayName:"Schema"});var Ll=class{constructor(){this.#r=new hs,this.#w=null,this.setCtx=e=>{this.#w=e},this.chain=()=>{if(null==this.#w)throw cs();const e=this.#w,t=[],n=this.get.bind(this),s={run:()=>{const n=_s(...t),s=e.get(fl);return n(s.state,s.dispatch,s)},inline:e=>(t.push(e),s),pipe:function(e,r){const i=n(e);return t.push(i(r)),s}.bind(this)};return s}}#r;#w;get ctx(){return this.#w}create(e,t){const n=e.create(this.#r.sliceMap);return n.set(t),n}get(e){return this.#r.get(e).get()}remove(e){return this.#r.remove(e)}call(e,t){if(null==this.#w)throw cs();const n=this.get(e)(t),s=this.#w.get(fl);return n(s.state,s.dispatch,s)}inline(e){if(null==this.#w)throw cs();const t=this.#w.get(fl);return e(t.state,t.dispatch,t)}},Pl=ys(new Ll,"commands"),$l=ys([Dl],"commandsTimer"),Vl=xs("CommandsReady"),Bl=e=>{const t=new Ll;return t.setCtx(e),e.inject(Pl,t).inject($l,[Dl]).record(Vl),async()=>(await e.waitTimers($l),e.done(Vl),()=>{e.remove(Pl).remove($l).clearTimer(Vl)})};dl(Bl,{displayName:"Commands"});var Fl=class{constructor(){this.#w=null,this.#b=[],this.setCtx=e=>{this.#w=e},this.add=e=>(this.#b.push(e),()=>{this.#b=this.#b.filter(t=>t!==e)}),this.addObjectKeymap=e=>{const t=[];return Object.entries(e).forEach(([e,n])=>{if("function"==typeof n){const s={key:e,onRun:()=>n};this.#b.push(s),t.push(()=>{this.#b=this.#b.filter(e=>e!==s)})}else this.#b.push(n),t.push(()=>{this.#b=this.#b.filter(e=>e!==n)})}),()=>{t.forEach(e=>e())}},this.addBaseKeymap=()=>{const e=function(e){return e.Backspace=_s(Gs,Ts,Ms,Ns),e}(Ys);return this.addObjectKeymap(e)},this.build=()=>{const e={};return this.#b.forEach(t=>{e[t.key]=[...e[t.key]||[],t]}),Object.fromEntries(Object.entries(e).map(([e,t])=>{const n=t.sort((e,t)=>(t.priority??50)-(e.priority??50));return[e,(e,t,s)=>{const r=this.#w;if(null==r)throw is();return _s(...n.map(e=>e.onRun(r)))(e,t,s)}]}))}}#w;#b;get ctx(){return this.#w}},zl=ys(new Fl,"keymap"),Wl=ys([Dl],"keymapTimer"),jl=xs("KeymapReady"),_l=e=>{const t=new Fl;return t.setCtx(e),e.inject(zl,t).inject(Wl,[Dl]).record(jl),async()=>(await e.waitTimers(Wl),e.done(jl),()=>{e.remove(zl).remove(Wl).clearTimer(jl)})},Ul=xs("ParserReady"),Kl=()=>{throw is()},ql=ys(Kl,"parser"),Hl=ys([],"parserTimer"),Yl=e=>(e.inject(ql,Kl).inject(Hl,[Dl]).record(Ul),async()=>{await e.waitTimers(Hl);const t=e.get(Sl),n=e.get(Al);return e.set(ql,Gr.create(n,t)),e.done(Ul),()=>{e.remove(ql).remove(Hl).clearTimer(Ul)}});dl(Yl,{displayName:"Parser"});var Jl=xs("SerializerReady"),Gl=ys([],"serializerTimer"),Ql=()=>{throw is()},Zl=ys(Ql,"serializer"),Xl=e=>(e.inject(Zl,Ql).inject(Gl,[Dl]).record(Jl),async()=>{await e.waitTimers(Gl);const t=e.get(Sl),n=e.get(Al);return e.set(Zl,Zr.create(n,t)),e.done(Jl),()=>{e.remove(Zl).remove(Gl).clearTimer(Jl)}});dl(Xl,{displayName:"Serializer"});var ec=ys("","defaultValue"),tc=ys(e=>e,"stateOptions"),nc=ys([],"editorStateTimer"),sc=xs("EditorStateReady"),rc=new es("MILKDOWN_STATE_TRACKER"),ic=e=>(e.inject(ec,"").inject(hl,{}).inject(tc,e=>e).inject(nc,[Ul,Jl,Vl,jl]).record(sc),async()=>{await e.waitTimers(nc);const t=e.get(Al),n=e.get(ql),s=e.get(yl),r=e.get(tc),i=e.get(kl),a=function(e,t,n){if("string"==typeof e)return t(e);if("html"===e.type)return Mt.fromSchema(n).parse(e.dom);if("json"===e.type)return ot.fromJSON(n,e.value);throw function(e){return new ns(ts.docTypeError,`Doc type error, unsupported type: ${rs(e)}`)}(e)}(e.get(ec),n,t),o=e.get(zl),l=o.addBaseKeymap(),c=[...i,new Qn({key:rc,state:{init:()=>{},apply:(t,n,s,r)=>{e.set(hl,r)}}}),vr({rules:s}),Kr(o.build())];e.set(kl,c);const u=r({schema:t,doc:a,plugins:c}),d=Jn.create(u);return e.set(hl,d),e.done(sc),()=>{l(),e.remove(ec).remove(hl).remove(tc).remove(nc).clearTimer(sc)}});dl(ic,{displayName:"EditorState"});var ac=ys([],"pasteRule"),oc=ys([Dl],"pasteRuleTimer"),lc=xs("PasteRuleReady"),cc=e=>(e.inject(ac,[]).inject(oc,[Dl]).record(lc),async()=>(await e.waitTimers(oc),e.done(lc),()=>{e.remove(ac).remove(oc).clearTimer(lc)}));dl(cc,{displayName:"PasteRule"});var uc=xs("EditorViewReady"),dc=ys([],"editorViewTimer"),pc=ys({},"editorViewOptions"),fc=ys(null,"root"),hc=ys(null,"rootDOM"),mc=ys({},"rootAttrs"),gc=new es("MILKDOWN_VIEW_CLEAR"),yc=e=>(e.inject(fc,document.body).inject(fl,{}).inject(pc,{}).inject(hc,null).inject(mc,{}).inject(dc,[sc,lc]).record(uc),async()=>{await e.wait(Tl);const t=e.get(fc)||document.body,n="string"==typeof t?document.querySelector(t):t;e.update(kl,t=>[new Qn({key:gc,view:t=>{const s=n?function(e,t){const n=document.createElement("div");n.className="milkdown",e.appendChild(n),t.set(hc,n);const s=t.get(mc);return Object.entries(s).forEach(([e,t])=>n.setAttribute(e,t)),n}(n,e):void 0;return(()=>{if(s&&n){const e=t.dom;n.replaceChild(s,e),s.appendChild(e)}})(),{destroy:()=>{s?.parentNode&&s?.parentNode.replaceChild(t.dom,s),s?.remove()}}}}),...t]),await e.waitTimers(dc);const s=e.get(hl),r=e.get(pc),i=new il(n,{state:s,nodeViews:Object.fromEntries(e.get(bl)),markViews:Object.fromEntries(e.get(vl)),transformPasted:(t,n,s)=>(e.get(ac).sort((e,t)=>(t.priority??50)-(e.priority??50)).map(e=>e.run).forEach(e=>{t=e(t,n,s)}),t),...r});return function(e){e.classList.add("editor"),e.setAttribute("role","textbox")}(i.dom),e.set(fl,i),e.done(uc),()=>{i?.destroy(),e.remove(fc).remove(fl).remove(pc).remove(hc).remove(mc).remove(dc).clearTimer(uc)}});dl(yc,{displayName:"EditorView"});var kc=function(e){return e.Idle="Idle",e.OnCreate="OnCreate",e.Created="Created",e.OnDestroy="OnDestroy",e.Destroyed="Destroyed",e}({}),wc=class e{constructor(){this.#v=!1,this.#g="Idle",this.#S=[],this.#x=()=>{},this.#r=new hs,this.#i=new bs,this.#C=new Map,this.#T=new Map,this.#w=new ws(this.#r,this.#i),this.#O=()=>{const e=function(e){const t=t=>(t.record(Cl),async()=>(await e(t),t.done(Cl),()=>{t.clearTimer(Cl)}));return dl(t,{displayName:"Config"}),t}(async e=>{await Promise.all(this.#S.map(t=>Promise.resolve(t(e))))}),t=[Rl,Yl,Xl,Bl,_l,cc,ic,yc,Ol(this),e];this.#D(t,this.#T)},this.#D=(e,t)=>{e.forEach(e=>{const n=this.#w.produce(this.#v?e.meta:void 0),s=e(n);t.set(e,{ctx:n,handler:s,cleanup:void 0})})},this.#M=(e,t=!1)=>Promise.all([e].flat().map(async e=>{const n=this.#C.get(e)?.cleanup;return t?this.#C.delete(e):this.#C.set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),"function"==typeof n?n():n})),this.#A=async()=>{await Promise.all([...this.#T.entries()].map(async([e,{cleanup:t}])=>"function"==typeof t?t():t)),this.#T.clear()},this.#N=e=>{this.#g=e,this.#x(e)},this.#E=e=>[...e.entries()].map(async([t,n])=>{const{ctx:s,handler:r}=n;if(!r)return;const i=await r();e.set(t,{ctx:s,handler:r,cleanup:i})}),this.enableInspector=(e=!0)=>(this.#v=e,this),this.onStatusChange=e=>(this.#x=e,this),this.config=e=>(this.#S.push(e),this),this.removeConfig=e=>(this.#S=this.#S.filter(t=>t!==e),this),this.use=e=>{const t=[e].flat();return t.flat().forEach(e=>{this.#C.set(e,{ctx:void 0,handler:void 0,cleanup:void 0})}),"Created"===this.#g&&this.#D(t,this.#C),this},this.remove=async e=>"OnCreate"===this.#g?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise(t=>{setTimeout(()=>{t(this.remove(e))},50)})):(await this.#M([e].flat(),!0),this),this.create=async()=>("OnCreate"===this.#g||("Created"===this.#g&&await this.destroy(),this.#N("OnCreate"),this.#O(),this.#D([...this.#C.keys()],this.#C),await Promise.all([this.#E(this.#T),this.#E(this.#C)].flat()),this.#N("Created")),this),this.destroy=async(e=!1)=>"Destroyed"===this.#g||"OnDestroy"===this.#g?this:"OnCreate"===this.#g?new Promise(t=>{setTimeout(()=>{t(this.destroy(e))},50)}):(e&&(this.#S=[]),this.#N("OnDestroy"),await this.#M([...this.#C.keys()],e),await this.#A(),this.#N("Destroyed"),this),this.action=e=>e(this.#w),this.inspect=()=>this.#v?[...this.#T.values(),...this.#C.values()].map(({ctx:e})=>e?.inspector?.read()).filter(e=>Boolean(e)):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new e}#v;#g;#S;#x;#r;#i;#C;#T;#w;#O;#D;#M;#A;#N;#E;get ctx(){return this.#w}get status(){return this.#g}};function bc(e,t){const n=function(e="cmdKey"){return ys(()=>()=>!1,e)}(e),s=r=>async()=>{s.key=n,await r.wait(Vl);const i=t(r);return r.get(Pl).create(n,i),s.run=t=>r.get(Pl).call(e,t),()=>{r.get(Pl).remove(n)}};return s}function vc(e){const t=n=>async()=>{await n.wait(Dl);const s=e(n);return n.update(yl,e=>[...e,s]),t.inputRule=s,()=>{n.update(yl,e=>e.filter(e=>e!==s))}};return t}function Sc(e){const t=n=>async()=>{await n.wait(Dl);const s=e(n);return n.update(ac,e=>[...e,s]),t.pasteRule=s,()=>{n.update(ac,e=>e.filter(e=>e!==s))}};return t}function xc(e,t){const n=s=>async()=>{const r=t(s);return s.update(Nl,t=>[...t.filter(t=>t[0]!==e),[e,r]]),n.id=e,n.schema=r,()=>{s.update(Nl,t=>t.filter(([t])=>t!==e))}};return n.type=t=>{const n=t.get(Al).nodes[e];if(!n)throw us(e);return n},n}function Cc(e){let t;const n=n=>async()=>(await n.wait(Dl),t=e(n),n.update(kl,e=>[...e,t]),()=>{n.update(kl,e=>e.filter(e=>e!==t))});return n.plugin=()=>t,n.key=()=>t.spec.key,n}function Tc(e){const t=n=>async()=>{await n.wait(jl);const s=n.get(zl),r=e(n),i=s.addObjectKeymap(r);return t.keymap=r,()=>{i()}};return t}function Oc(e,t){const n=s=>async()=>{await s.wait(Dl);const r=t(s);return e.type(s)instanceof xt?s.update(bl,t=>[...t,[e.id,r]]):s.update(vl,t=>[...t,[e.id,r]]),n.view=r,n.type=e,()=>{e.type(s)instanceof xt?s.update(bl,t=>t.filter(t=>t[0]!==e.id)):s.update(vl,t=>t.filter(t=>t[0]!==e.id))}};return n}function Dc(e,t){const n=ys(e,t),s=e=>(e.inject(n),()=>()=>{e.remove(n)});return s.key=n,s}function Mc(e,t){const n=Dc(t,e),s=xc(e,e=>e.get(n.key)(e)),r=[n,s];return r.id=s.id,r.node=s,r.type=e=>s.type(e),r.ctx=n,r.key=n.key,r.extendSchema=n=>Mc(e,n(t)),r}function Ac(e,t){const n=Dc(t,e),s=function(e){const t=s=>async()=>{const r=(e=>e.get(n.key)(e))(s);return s.update(El,t=>[...t.filter(t=>t[0]!==e),[e,r]]),t.id=e,t.schema=r,()=>{s.update(El,t=>t.filter(([t])=>t!==e))}};return t.type=t=>{const n=t.get(Al).marks[e];if(!n)throw function(e){return new ns(ts.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)}(e);return n},t}(e),r=[n,s];return r.id=s.id,r.mark=s,r.type=e=>s.type(e),r.ctx=n,r.key=n.key,r.extendSchema=n=>Ac(e,n(t)),r}function Nc(e,t){const n=Dc(Object.fromEntries(Object.entries(t).map(([e,{shortcuts:t,priority:n}])=>[e,{shortcuts:t,priority:n}])),`${e}Keymap`),s=Tc(e=>{const s=e.get(n.key),r=Object.entries(t).flatMap(([e,{command:t}])=>{const n=s[e],r=[n.shortcuts].flat(),i=n.priority;return r.map(e=>[e,{key:e,onRun:t,priority:i}])});return Object.fromEntries(r)}),r=[n,s];return r.ctx=n,r.shortcuts=s,r.key=n.key,r.keymap=s.keymap,r}var Ec=(e,t=()=>({}))=>Dc(t,`${e}Attr`),Ic=(e,t=()=>({}))=>Dc(t,`${e}Attr`);function Rc(e,t,n){const s=Dc({},e),r=e=>async()=>{await e.wait(Tl);const n={plugin:t(e),options:e.get(s.key)};return e.update(wl,e=>[...e,n]),()=>{e.update(wl,e=>e.filter(e=>e!==n))}},i=[s,r];return i.id=e,i.plugin=r,i.options=s,i}function Lc(e){return e=>{const t=e.get(fl);return e.get(Al),e.get(Zl)(t.state.doc)}}function Pc(e,t=!1){return n=>{const s=n.get(fl),r=n.get(ql)(e);if(!r)return;if(!t){const{state:e}=s;return s.dispatch(e.tr.replace(0,e.doc.content.size,new _e(r.content,0,0)))}const i=n.get(Al),a=n.get(tc)({schema:i,doc:r,plugins:n.get(kl)}),o=Jn.create(a);s.updateState(o)}}const $c=/^\[!([A-Za-z][\w-]*)\]([+-])?[ \t]*(.*)$/,Vc=/^[ \t]{0,3}>(?:[ \t]?)/;function Bc(e){const t=e?.trim().toLowerCase();return t||"info"}function Fc(e){const t=Bc(e);return"columns"===t||"multi-column"===t}function zc(e){const t=Bc(e);return"column"===t||"blank"===t}function Wc(e,t){const n=t?.trim();return n||Bc(e)}function jc(e){const t=e.match(/^[\t ]*/);return t?t[0].length:0}function _c(e,t=0){const n=jc(e),s=e.slice(n),r=s.match($c);if(!r)return null;const i=r[1]??"",a=`[!${i}]`.length+(r[2]?1:0),o=t+n,l=a+jc(s.slice(a)),c=function(e){const t=e.match(/[\t ]*$/);return t?t[0].length:0}(s),u=Math.max(l,s.length-c);return{raw:s,kind:Bc(i),title:s.slice(l,u),fold:"+"===r[2]?"expanded":"-"===r[2]?"collapsed":void 0,markerFrom:o,markerTo:o+a,titleFrom:t+n+l,titleTo:t+n+u}}function Uc(e,t,n){const s=e.match(Vc);if(!s)return null;const r=s[0];return{from:t,to:n,quoteFrom:t+r.indexOf(">"),quoteTo:t+r.length,contentFrom:t+r.length,contentTo:n}}function Kc(e){if(!e)return[];const t=[];let n=null,s=0;for(;s<e.length;){const r=e.indexOf("\n",s),i=r>=0?r:e.length,a=i>s&&"\r"===e[i-1]?i-1:i,o=e.slice(s,a),l=r>=0?r+1:e.length,c=Uc(o,s,a);if(c){if(n)n.lines.push({...c,isHeader:!1}),n.to=c.to;else{const s=_c(e.slice(c.contentFrom,c.contentTo),c.contentFrom);s&&(n={...s,from:c.from,to:c.to,lines:[{...c,isHeader:!0}]},t.push(n))}s=l}else n=null,s=l}return t}const qc=/\.(png|jpe?g|gif|webp|svg|bmp|ico|avif|heic|heif|tiff?)$/i,Hc=/\.(mp4|webm|ogv|mov|m4v)$/i,Yc=/\.(mp3|wav|ogg|flac|m4a|aac)$/i,Jc=/\.pdf$/i,Gc=/\.excalidraw(\.md)?$/i,Qc=/\.(md|markdown|txt)$/i,Zc=/(!)?\[\[([^\]\r\n|]+)(?:\|([^\]\r\n]+))?\]\]/g,Xc=/^(!)?\[\[([^\]\r\n|]+)(?:\|([^\]\r\n]+))?\]\]$/;function eu(e){const t=e?.trim();return t||void 0}function tu(e){const t=e.indexOf("#");if(t<0)return{target:e.trim()};const n=t>0&&"^"===e[t-1]?t-1:t,s=e.slice(0,n).trim(),r=eu(e.slice(t+1));return r?{target:s,hash:r}:{target:s}}function nu(e,t=0,n=t+e.length){const s=e.match(Xc);if(!s)return null;const r=s[2]?.trim();if(!r)return null;const{target:i,hash:a}=tu(r);return i?{raw:e,target:i,hash:a,alias:eu(s[3]),embed:Boolean(s[1]),from:t,to:n,targetWithHash:r}:null}function su(e,{includeEmbeds:t=!1,includeLinks:n=!0}={}){const s=[];let r;for(Zc.lastIndex=0;null!==(r=Zc.exec(e));){const e=Boolean(r[1]);if(e&&!t||!e&&!n)continue;const i=nu(r[0],r.index,r.index+r[0].length);i&&s.push(i)}return s}function ru(e){const t=e.split("/"),n=t[t.length-1]||e;return n.includes(".")?n.split(".").slice(0,-1).join("."):n}function iu(e,t,n){const s=n||ru(e);return t?`${s}#${t}`:s}function au(e){return e.replace(/\\+([{}])/g,"$1")}function ou(e,t=0,n=t+e.length){const s=nu(e,t,n);return s?.embed?{raw:s.raw,target:s.target,hash:s.hash,alias:s.alias,from:s.from,to:s.to,targetWithHash:s.targetWithHash}:null}function lu(e,t,n){return`![[${au(e)}${t?`#${au(t)}`:""}${n?`|${au(n)}`:""}]]`}function cu(e){return function(e){return qc.test(e)}(e)}function uu(e){return cu(e)?"image":function(e){return function(e){return Hc.test(e)}(e)}(e)?"video":function(e){return function(e){return Yc.test(e)}(e)||/\.webm$/i.test(e)}(e)?"audio":function(e){return function(e){return Jc.test(e)}(e)}(e)?"pdf":function(e){return function(e){return Gc.test(e)}(e)}(e)?"excalidraw":function(e){return null===function(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n<=0||n===t.length-1?null:t.slice(n).toLowerCase()}(e)||function(e){return Qc.test(e)}(e)}(e)?"text":"file"}function du(e){const t=uu(e);return"image"===t||"video"===t||"audio"===t||"pdf"===t}function pu(e){const t=e?.trim();if(!t)return null;const n=Number.parseInt(t,10);return Number.isFinite(n)&&n>0?n:null}function fu(e,t){const n=function(e){return e.replace(/^---\n[\s\S]*?\n---\n?/,"")}(e);if(!t)return{contentWithoutFrontmatter:n,content:n,error:null};if(t.startsWith("^")){const e=function(e,t){const n=e.split("\n");for(let s=0;s<n.length;s+=1){if(!n[s].includes(`^${t}`))continue;const e=[n[s].replace(new RegExp(`\\s*\\^${t}\\s*$`),"")],r=n[s].match(/^(\s*)/)?.[1].length||0;for(let t=s+1;t<n.length;t+=1){const s=n[t].match(/^(\s*)/)?.[1].length||0;if(!(""===n[t].trim()||s>r))break;e.push(n[t])}for(;e.length>0&&""===e[e.length-1].trim();)e.pop();return e.join("\n")}return null}(n,t.slice(1));return{contentWithoutFrontmatter:n,content:e,error:e?null:`Block "${t}" not found`}}const s=function(e,t){const n=e.split("\n"),s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`^(#{1,6})\\s+${s}\\s*$`,"i");for(let i=0;i<n.length;i+=1){const e=n[i].match(r);if(!e)continue;const t=e[1].length,s=[n[i]];for(let r=i+1;r<n.length;r+=1){const e=n[r].match(/^(#{1,6})\s+/);if(e&&e[1].length<=t)break;s.push(n[r])}for(;s.length>0&&""===s[s.length-1].trim();)s.pop();return s.join("\n")}return null}(n,t);return{contentWithoutFrontmatter:n,content:s,error:s?null:`Heading "${t}" not found`}}const hu="LifeOS";function mu(e,t){const n=e.indexOf("\n",t);return n<0?e.length:n}function gu(e,t){return t>0&&"\r"===e[t-1]?t-1:t}function yu(e){return e?.trim()===hu}function ku(e,t=0){const n=mu(e,0),s=gu(e,n),r=e.slice(0,s).match(/^(`{3,}|~{3,})([^\r\n]*)$/);if(!r)return null;const i=r[1],a=i[0],o=i.length;if(!yu(r[2]??""))return null;const l=n<e.length?n+1:e.length;let c=l,u=-1,d=l;const p=new RegExp(`^[\\t ]{0,3}\\${a}{${o},}[\\t ]*$`);for(;d<e.length;){const t=mu(e,d),n=gu(e,t),s=e.slice(d,n);if(p.test(s)){c=d,u=t;break}d=t<e.length?t+1:e.length}if(u<0)return null;let f=c>l&&"\n"===e[c-1]?c-1:c;f>l&&"\r"===e[f-1]&&(f-=1);const h=e.slice(l,f).replace(/\r\n?/g,"\n"),m=i.length;return{raw:e.slice(0,u),value:h,lang:hu,from:t,to:t+u,infoFrom:t+m,infoTo:t+s,contentFrom:t+l,contentTo:t+f}}const wu=/!\[((?:\\.|[^\]\\\r\n])*)\]\(([^)\r\n]+)\)/g,bu=/^(?:\S+|<[^>\r\n]*>)(?:[ \t]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?[ \t]*$/;function vu(e,t){let n=0;for(let s=t-1;s>=0&&"\\"===e[s];s-=1)n+=1;return n%2==1}function Su(e,t=0){const n=[];let s;for(wu.lastIndex=0;null!==(s=wu.exec(e));){if(vu(e,s.index))continue;const r=s[2],i=r.trim();/[ \t]/.test(i)&&!bu.test(r)&&n.push({from:t+s.index,to:t+s.index+s[0].length,raw:s[0],alt:s[1],target:i})}return n}function xu(e){if(!e)return!1;const t=e.codePointAt(0);return null!=t&&(t<128?function(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}(t):!(!function(e){return e>=65296&&e<=65305||e>=65313&&e<=65338||e>=65345&&e<=65370}(t)&&!function(e){return e>=12352&&e<=12543||e>=12544&&e<=12591||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255}(t))||e.toLocaleLowerCase()!==e.toLocaleUpperCase())}function Cu(e,t){let n=0;for(let s=t-1;s>=0&&"\\"===e[s];s-=1)n+=1;return n%2==1}function Tu(e){if(e.length<2)return e;const t=[...e].sort((e,t)=>e.start-t.start||e.end-t.end),n=[{...t[0]}];for(let s=1;s<t.length;s+=1){const e=t[s],r=n[n.length-1];e.start<=r.end?r.end=Math.max(r.end,e.end):n.push({...e})}return n}function Ou(e,t){let n=0,s=e.length;for(;n<s;){const r=n+(s-n>>>1);e[r].start<=t?n=r+1:s=r}return n}function Du(e,t){const n=e[Ou(e,t)-1];return n&&t<n.end?n:null}function Mu(e){let t=-1/0;return e.map(e=>t=Math.max(t,e.end))}function Au(e,t){let n=0;for(let s=t-1;s>=0;s-=1)if(!Cu(e,s))if("]"===e[s])n+=1;else if("["===e[s]){if(0===n)return s;n-=1}return-1}function Nu(e,t){let n=1;for(let s=t+1;s<e.length;s+=1)if(!Cu(e,s)&&("("===e[s]&&(n+=1),")"===e[s]&&0===--n))return s;return-1}function Eu(e){const t=function(e){const t=[];let n=null,s=0;for(;s<=e.length;){const r=e.indexOf("\n",s),i=-1===r?e.length:r,a=e.slice(s,i),o=a.match(/^ {0,3}(`{3,}|~{3,})/u)?.[1]??null;if(!n&&o?n={start:s,marker:o[0],length:o.length}:n&&o&&o[0]===n.marker&&o.length>=n.length&&(t.push({start:n.start,end:-1===r?i:r+1}),n=null),-1===r)break;s=r+1}return n&&t.push({start:n.start,end:e.length}),t}(e),n=function(e,t){const n=[];let s=0;for(;s<e.length&&(s=e.indexOf("`",s),!(s<0));){const r=Du(t,s);if(r){s=r.end;continue}if(Cu(e,s)){s+=1;continue}let i=s+1;for(;"`"===e[i];)i+=1;const a=e.slice(s,i);let o=e.indexOf(a,i);for(;o>=0&&(Cu(e,o)||Du(t,o));)o=e.indexOf(a,o+a.length);if(o<0){s=i;continue}const l=o+a.length;n.push({start:s,end:l}),s=l}return n}(e,t),s=function(e){const t=[];let n=0;for(;n<e.length;){const s=e.indexOf("[[",n);if(-1===s)break;const r=e.indexOf("]]",s+2);if(-1===r)break;t.push({start:s>0&&"!"===e[s-1]&&!Cu(e,s-1)?s-1:s,end:r+2}),n=r+2}return t}(e),r=function(e){const t=[];let n=0;for(;n<e.length;){const s=e.indexOf("<",n);if(-1===s)break;if(e.startsWith("\x3c!--",s)){const r=e.indexOf("--\x3e",s+4),i=-1===r?e.length:r+3;t.push({start:s,end:i}),n=i;continue}const r=e.indexOf(">",s+1);if(-1===r)break;const i=e.slice(s,r+1);(/^<\/?[A-Za-z][\s\S]*>$/u.test(i)||/^<![A-Za-z][\s\S]*>$/u.test(i))&&t.push({start:s,end:r+1}),n=r+1}return t}(e),i=function(e){const t=[];for(const n of e.matchAll(/&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]+);/giu)){const e=n.index;t.push({start:e,end:e+n[0].length})}return t}(e),a=[...t,...n,...s,...r,...i],o=function(e,t){const n=[];let s=0;for(;s<e.length;){let r=e.indexOf("%%",s);for(;r>=0&&(Cu(e,r)||Du(t,r));)r=e.indexOf("%%",r+2);if(r<0)break;let i=e.indexOf("%%",r+2);for(;i>=0&&(Cu(e,i)||Du(t,i));)i=e.indexOf("%%",i+2);if(i<0)break;n.push({start:r,end:i+2}),s=i+2}return n}(e,Tu(a)),l=[...a,...o],c=Tu(l),u=function(e,t){const n=[],s=[],r=[];for(let i=e.indexOf("]");i>=0;i=e.indexOf("]",i+1)){if(Cu(e,i)||Du(t,i))continue;const a=i+1;if("("!==e[a])continue;const o=Au(e,i),l=Nu(e,a);o<0||l<0||Du(t,o)||(n.push({start:o+1,end:i}),s.push({start:a,end:l+1}),r.push({start:o>0&&"!"===e[o-1]&&!Cu(e,o-1)?o-1:o,end:l+1}),i=l)}return{contentRanges:n,excludedRanges:s,structuralRanges:r}}(e,c),d=Tu([...c,...u.excludedRanges]),p=function(e,t){const n=[];let s=0;for(;s<e.length&&(s=e.indexOf("$",s),!(s<0));){const r=Du(t,s);if(r){s=r.end;continue}if(Cu(e,s)){s+=1;continue}const i="$"===e[s+1]?"$$":"$";let a=e.indexOf(i,s+i.length);for(;a>=0&&(Cu(e,a)||Du(t,a));)a=e.indexOf(i,a+i.length);if(a<0||a===s+i.length){s+=i.length;continue}const o=a+i.length;n.push({start:s,end:o}),s=o}return n}(e,d),f=Tu([...d,...p]),h=function(e,t){const n=[];for(const s of e.matchAll(/\[\^[^\]\r\n]+\]/gu)){const r=s.index;Cu(e,r)||Du(t,r)||n.push({start:r,end:r+s[0].length})}return n}(e,f),m=Tu([...f,...h]),g=function(e,t){const n=[],s=[],r=(t,n)=>{if("_"!==t[0])return!1;const s=function(e,t){if(t<=0||t>e.length)return null;const n=e.charCodeAt(t-1),s=n>=56320&&n<=57343&&t>=2?t-2:t-1;return function(e,t){if(t<0||t>=e.length)return null;const n=e.codePointAt(t);if(null==n)return null;const s=String.fromCodePoint(n);return{char:s,nextIndex:t+s.length}}(e,s)?.char??null}(e,n);return"_"===s||xu(s??"")};for(const i of["***","___","**","__","~~","==","*","_"]){let a=0;for(;a<e.length;){let o=e.indexOf(i,a);for(;o>=0&&(Cu(e,o)||Du(t,o)||r(i,o));)o=e.indexOf(i,o+i.length);if(o<0)break;let l=e.indexOf(i,o+i.length);for(;l>=0&&(Cu(e,l)||Du(t,l));)l=e.indexOf(i,l+i.length);if(l<0)break;l>o+i.length&&(n.push({start:o+i.length,end:l}),s.push({start:o,end:l+i.length})),a=l+i.length}}return{contentRanges:n,structuralRanges:s}}(e,m),y=[...u.contentRanges,...g.contentRanges].sort((e,t)=>e.start-t.start||e.end-t.end);return{excludedRanges:m,contentRanges:y,contentRangeMaxEnds:Mu(y),structuralRanges:[...l,...u.structuralRanges,...p,...h,...g.structuralRanges].sort((e,t)=>e.start-t.start||e.end-t.end)}}function Iu(e,t,n){let s=null;for(let r=Ou(e,t)-1;r>=0&&n[r]>t;r--){const n=e[r].end;t<n&&(s=null==s?n:Math.min(s,n))}return s}function Ru(e,t){return e[Ou(e,t)]?.start??null}function Lu(e,t){const n=e.indexOf("![[",t+1),s=e.indexOf("[[",t+1);return n<0?s<0?null:s:s<0?n:Math.min(n,s)}const Pu=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)/iu;function $u(e,t){if(t<0||t>=e.length)return null;const n=e.codePointAt(t);if(null==n)return null;const s=String.fromCodePoint(n);return{char:s,nextIndex:t+s.length}}function Vu(e,t){if(t<=0||t>e.length)return null;const n=e.charCodeAt(t-1),s=n>=56320&&n<=57343&&t>=2?t-2:t-1;return $u(e,s)?.char??null}function Bu(e){return"_"===e||xu(e)}function Fu(e){if(!e||/\s|\uFFFC/u.test(e))return!1;if(!Bu($u(e,0)?.char??""))return!1;let t=0;for(;t<e.length;){const n=$u(e,t),s=n?.char.codePointAt(0);if(!n||null==s||!(s>=48&&s<=57||s>=65296&&s<=65305))break;t=n.nextIndex}if(t>0&&t<e.length){const n=$u(e,t)?.char??"";if("_"!==n&&!xu(n))return!1}return/[\p{L}_]/u.test(e)}function zu(e){return Boolean(e)&&!/\s/u.test(e)}function Wu(e){return"#"===e||"/"===e||"-"===e||Bu(e??"")}function ju(e,t){return t>=0&&t<e.length&&"#"===e[t]&&function(e){return!Wu(e??null)}(Vu(e,t))}function _u(e,t){if(t<0||t>=e.length||"#"!==e[t])return!1;let n=t;for(;n>0;){const t=e.charCodeAt(n-1);if(32===t||10===t||13===t||9===t)break;n-=1}const s=function(e){let t=0;for(;t<e.length;){const n=$u(e,t);if(!n)break;if(xu(n.char))return e.slice(t);t=n.nextIndex}return""}(e.slice(n,t));return Pu.test(s)}function Uu(e,t,n,{allowEndOfText:s=!0}={}){if(function(e,t){let n=0;for(let s=t-1;s>=0&&"\\"===e[s];s-=1)n+=1;return n%2==1}(e,t)||Du(n.excludedRanges,t)||Wu(Vu(e,t)))return null;const r=Iu(n.contentRanges,t,n.contentRangeMaxEnds),i=Ru(n.structuralRanges,t),a=function(e,t,n=e.length){const s=$u(e,t);if(!s||s.nextIndex>n||!Bu(s.char))return null;let r=s.nextIndex;for(;r<n;){const t=$u(e,r);if(!t||t.nextIndex>n||!zu(t.char))break;r=t.nextIndex}return r}(e,t+1,Math.min(r??e.length,i??e.length));if(null==a)return null;const o=e.slice(t+1,a);if(!Fu(o))return null;const l=$u(e,a);return r!==a&&i!==a&&!(l?/\s/u.test(l.char):s)||_u(e,t)?null:{value:o,fullMatch:e.slice(t,a),index:t}}function Ku(e,t){if(!e)return[];const n=[],s=Eu(e);for(let r=e.indexOf("#");r>=0;){const i=Du(s.excludedRanges,r);if(i){r=e.indexOf("#",i.end);continue}const a=Uu(e,r,s,t);a?(n.push(a),r=e.indexOf("#",a.index+a.fullMatch.length)):r=e.indexOf("#",r+1)}return n}function qu(e,t=e.length){if(!e)return null;const n=Math.max(0,Math.min(t,e.length)),s=Eu(e);let r=e.lastIndexOf("#",Math.max(0,n-1));for(;r>=0;){const t=Du(s.excludedRanges,r),i=Iu(s.contentRanges,r,s.contentRangeMaxEnds),a=Ru(s.structuralRanges,r),o=Lu(e,r),l=Math.min(i??e.length,a??e.length,o??e.length),c=e.slice(r+1,n);if(!t&&n<=l&&ju(e,r)&&!_u(e,r)&&!e.slice(0,r).endsWith("[[")&&!e.slice(0,r).endsWith("](")&&!/[\s\uFFFC]/u.test(c)&&!c.includes("'")&&(!c||Fu(c))){let t=n;for(;t<l;){const n=$u(e,t);if(!n||n.nextIndex>l||!zu(n.char)||""===n.char)break;t=n.nextIndex}return{query:c,start:r,end:t}}r=0===r?-1:e.lastIndexOf("#",r-1)}return null}const Hu=_u;function Yu(e){return Ku(e).map(e=>({value:e.value,tag:e.fullMatch,from:e.index,to:e.index+e.fullMatch.length}))}const Ju="task-marker:";function Gu(e){return 1!==e.length?null:" "!==e&&("x"===e||"X"===e||("-"===e?"cancelled":"/"===e?"in-progress":`${Ju}${e}`))}function Qu(e){if(!1===e)return" ";if(!0===e)return"x";if("cancelled"===e)return"-";if("in-progress"===e)return"/";if("string"==typeof e&&e.startsWith(Ju)){const t=e.slice(12);return 1===t.length?t:null}return null}function Zu(e){const t=e.match(/^\[([^\]\r\n])\](?:[ \t]+|$)/);if(t?.[1])return{marker:t[1],markerTextLength:t[0].length};const n=e.match(/^\[( |x|X)\]/);return n?.[1]?{marker:n[1],markerTextLength:n[0].length}:null}const Xu=[{marker:" ",name:"Todo",type:"TODO",next:"x"},{marker:"x",name:"Done",type:"DONE",next:" "}],ed=[{marker:" ",name:"Todo",type:"TODO",next:"/"},{marker:"/",name:"In Progress",type:"IN_PROGRESS",next:"x"},{marker:"x",name:"Done",type:"DONE",next:" "},{marker:"-",name:"Cancelled",type:"CANCELLED",next:" "},{marker:">",name:"Deferred",type:"TODO",next:"x"},{marker:"!",name:"Important",type:"TODO",next:"x"},{marker:"?",name:"Question",type:"TODO",next:"x"},{marker:"@",name:"Commissioned",type:"TODO",next:"x"}];function td(e){if("string"!=typeof e.marker||1!==e.marker.length)return null;const t="string"==typeof e.next&&1===e.next.length?e.next:void 0;return{...e,marker:"X"===e.marker?"x":e.marker,next:"X"===t?"x":t}}function nd(e){if(null==e||""===e)return" ";const t=e.slice(0,1);return"X"===t?"x":t}function sd(e){return"DONE"===e||"CANCELLED"===e?" ":"x"}function rd(e,t){const n=nd(e),s=function(e){const t=new Map;for(const n of ed){const e=td(n);e&&t.set(e.marker,e)}for(const n of Xu){const e=td(n);e&&t.set(e.marker,e)}for(const n of e??[]){const e=td(n);e&&t.set(e.marker,e)}return Array.from(t.values())}(t),r=s.find(e=>e.marker===n),i=r?.type??"TODO",a="DONE"===i,o="CANCELLED"===i,l=a||o;return{marker:n,name:r?.name??`Custom ${n.trim()||"Todo"}`,type:i,next:nd(r?.next??sd(i)),color:r?.color,icon:r?.icon,known:Boolean(r),done:a,cancelled:o,terminal:l,unfinished:!l}}function id(e,t){return rd(e,t).next}function ad({oldChecked:e,newChecked:t,textContent:n,lastTextNodeText:s,today:r}){const i=!0===e&&!0!==t,a=/ \u2705\s*\d{4}-\d{2}-\d{2}(?=(?:\s*\^[\w-]+\s*)?$)/;if(!0===t&&!0!==e){if(n.includes("✅"))return null;const e=s?.match(/\s*\^[\w-]+\s*$/);return{type:"append",appendedText:` ✅ ${r}`,trimTrailingChars:e?e[0].length:0}}if(i){const e=s?.match(a)??n.match(a);if(!e)return null;const t=s??n,r=t.substring(0,t.indexOf(e[0]));return{type:"remove",matchText:e[0],preserveTimestampSpace:/\d{2}:\d{2}$/.test(r)}}return null}const od=/🔁\s*([^#^\n📅📆🗓✅🛫⏳⌛❌]+?)(?=\s*(?:[#^📅📆🗓✅🛫⏳⌛❌]|$))/u,ld={monday:"MO",mon:"MO",tuesday:"TU",tue:"TU",tues:"TU",wednesday:"WE",wed:"WE",thursday:"TH",thu:"TH",thurs:"TH",friday:"FR",fri:"FR",saturday:"SA",sat:"SA",sunday:"SU",sun:"SU"},cd={january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sept:9,sep:9,october:10,oct:10,november:11,nov:11,december:12,dec:12};function ud(e,t,n){const s=[`FREQ=${e}`];return t&&t>1&&s.push(`INTERVAL=${t}`),n&&s.push(...Array.isArray(n)?n:[n]),s.join(";")}function dd(e,t,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n))return;const s=new Date(Date.UTC(e,t-1,n));return s.getUTCFullYear()===e&&s.getUTCMonth()===t-1&&s.getUTCDate()===n?`${String(e).padStart(4,"0")}${String(t).padStart(2,"0")}${String(n).padStart(2,"0")}`:void 0}function pd(e){return cd[e.replace(/\.$/,"").toLowerCase()]}var fd,hd,md,gd,yd,kd={exports:{}};Y((yd||(yd=1,function(e,t){var n={};t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let s=0,r=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(s++,"%c"===e&&(r=s))}),t.splice(r,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(s){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=n.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=(gd?md:(gd=1,md=function(e){function t(e){let s,r,i,a=null;function o(...e){if(!o.enabled)return;const n=o,r=Number(new Date),i=r-(s||r);n.diff=i,n.prev=s,n.curr=r,s=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(s,r)=>{if("%%"===s)return"%";a++;const i=t.formatters[r];if("function"==typeof i){const t=e[a];s=i.call(n,t),e.splice(a,1),a--}return s}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=n,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(r!==t.namespaces&&(r=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(o),o}function n(e,n){const s=t(this.namespace+(void 0===n?":":n)+e);return s.log=this.log,s}function s(e,t){let n=0,s=0,r=-1,i=0;for(;n<e.length;)if(s<t.length&&(t[s]===e[n]||"*"===t[s]))"*"===t[s]?(r=s,i=n,s++):(n++,s++);else{if(-1===r)return!1;s=r+1,i++,n=i}for(;s<t.length&&"*"===t[s];)s++;return s===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const s of n)"-"===s[0]?t.skips.push(s.slice(1)):t.names.push(s)},t.enabled=function(e){for(const n of t.skips)if(s(e,n))return!1;for(const n of t.names)if(s(e,n))return!0;return!1},t.humanize=function(){if(hd)return fd;hd=1;var e=1e3,t=60*e,n=60*t,s=24*n,r=7*s;function i(e,t,n,s){var r=t>=1.5*n;return Math.round(e/n)+" "+s+(r?"s":"")}return fd=function(a,o){o=o||{};var l=typeof a;if("string"===l&&a.length>0)return function(i){if(!((i=String(i)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(a){var o=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return o*r;case"days":case"day":case"d":return o*s;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*t;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(a);if("number"===l&&isFinite(a))return o.long?function(r){var a=Math.abs(r);return a>=s?i(r,a,s,"day"):a>=n?i(r,a,n,"hour"):a>=t?i(r,a,t,"minute"):a>=e?i(r,a,e,"second"):r+" ms"}(a):function(r){var i=Math.abs(r);return i>=s?Math.round(r/s)+"d":i>=n?Math.round(r/n)+"h":i>=t?Math.round(r/t)+"m":i>=e?Math.round(r/e)+"s":r+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}))(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(kd,kd.exports)),kd.exports)).disable();var wd,bd={exports:{}};const vd=Y((wd||(wd=1,bd.exports=function(){var e=6e4,t=36e5,n="millisecond",s="second",r="minute",i="hour",a="day",o="week",l="month",c="quarter",u="year",d="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var s=String(e);return!s||s.length>=t?e:""+Array(t+1-s.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),s=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+g(s,2,"0")+":"+g(r,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var s=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(s,l),i=n-r<0,a=t.clone().add(s+(i?-1:1),l);return+(-(s+(n-r)/(i?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:u,w:o,d:a,D:d,h:i,m:r,s,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},k="en",w={};w[k]=m;var b="$isDayjsObject",v=function(e){return e instanceof T||!(!e||!e[b])},S=function e(t,n,s){var r;if(!t)return k;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(r=i),n&&(w[i]=n,r=i);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var o=t.name;w[o]=t,r=o}return!s&&r&&(k=r),r||!s&&k},x=function(e,t){if(v(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new T(n)},C=y;C.l=S,C.i=v,C.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var T=function(){function m(e){this.$L=S(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var s=t.match(f);if(s){var r=s[2]-1||0,i=(s[7]||"0").substring(0,3);return n?new Date(Date.UTC(s[1],r,s[3]||1,s[4]||0,s[5]||0,s[6]||0,i)):new Date(s[1],r,s[3]||1,s[4]||0,s[5]||0,s[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return C},g.isValid=function(){return!(this.$d.toString()===p)},g.isSame=function(e,t){var n=x(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return x(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<x(e)},g.$g=function(e,t,n){return C.u(e)?this[t]:this.set(n,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var n=this,c=!!C.u(t)||t,p=C.p(e),f=function(e,t){var s=C.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return c?s:s.endOf(a)},h=function(e,t){return C.w(n.toDate()[e].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,y=this.$D,k="set"+(this.$u?"UTC":"");switch(p){case u:return c?f(1,0):f(31,11);case l:return c?f(1,g):f(0,g+1);case o:var w=this.$locale().weekStart||0,b=(m<w?m+7:m)-w;return f(c?y-b:y+(6-b),g);case a:case d:return h(k+"Hours",0);case i:return h(k+"Minutes",1);case r:return h(k+"Seconds",2);case s:return h(k+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var o,c=C.p(e),p="set"+(this.$u?"UTC":""),f=(o={},o[a]=p+"Date",o[d]=p+"Date",o[l]=p+"Month",o[u]=p+"FullYear",o[i]=p+"Hours",o[r]=p+"Minutes",o[s]=p+"Seconds",o[n]=p+"Milliseconds",o)[c],h=c===a?this.$D+(t-this.$W):t;if(c===l||c===u){var m=this.clone().set(d,1);m.$d[f](h),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](h);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[C.p(e)]()},g.add=function(n,c){var d,p=this;n=Number(n);var f=C.p(c),h=function(e){var t=x(p);return C.w(t.date(t.date()+Math.round(e*n)),p)};if(f===l)return this.set(l,this.$M+n);if(f===u)return this.set(u,this.$y+n);if(f===a)return h(1);if(f===o)return h(7);var m=(d={},d[r]=e,d[i]=t,d[s]=1e3,d)[f]||1,g=this.$d.getTime()+n*m;return C.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var s=e||"YYYY-MM-DDTHH:mm:ssZ",r=C.z(this),i=this.$H,a=this.$m,o=this.$M,l=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,r,i){return e&&(e[n]||e(t,s))||r[n].slice(0,i)},f=function(e){return C.s(i%12||12,e,"0")},m=u||function(e,t,n){var s=e<12?"AM":"PM";return n?s.toLowerCase():s};return s.replace(h,function(e,s){return s||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return C.s(t.$y,4,"0");case"M":return o+1;case"MM":return C.s(o+1,2,"0");case"MMM":return d(n.monthsShort,o,c,3);case"MMMM":return d(c,o);case"D":return t.$D;case"DD":return C.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,l,2);case"ddd":return d(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(i);case"HH":return C.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(i,a,!0);case"A":return m(i,a,!1);case"m":return String(a);case"mm":return C.s(a,2,"0");case"s":return String(t.$s);case"ss":return C.s(t.$s,2,"0");case"SSS":return C.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,d,p){var f,h=this,m=C.p(d),g=x(n),y=(g.utcOffset()-this.utcOffset())*e,k=this-g,w=function(){return C.m(h,g)};switch(m){case u:f=w()/12;break;case l:f=w();break;case c:f=w()/3;break;case o:f=(k-y)/6048e5;break;case a:f=(k-y)/864e5;break;case i:f=k/t;break;case r:f=k/e;break;case s:f=k/1e3;break;default:f=k}return p?f:C.a(f)},g.daysInMonth=function(){return this.endOf(l).$D},g.$locale=function(){return w[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),s=S(e,t,!0);return s&&(n.$L=s),n},g.clone=function(){return C.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),O=T.prototype;return x.prototype=O,[["$ms",n],["$s",s],["$m",r],["$H",i],["$W",a],["$M",l],["$y",u],["$D",d]].forEach(function(e){O[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),x.extend=function(e,t){return e.$i||(e(t,T,x),e.$i=!0),x},x.locale=S,x.isDayjs=v,x.unix=function(e){return x(1e3*e)},x.en=w[k],x.Ls=w,x.p={},x}()),bd.exports)),Sd=["YYYY","MMMM","GGGG","gggg","dddd","MMM","ddd","MM","DD","WW","ww","dd","Do","YY","GG","gg","Q","M","D","W","w","d"],xd={YYYY:"(\\d{4})",YY:"(\\d{2})",GGGG:"(\\d{4})",GG:"(\\d{2})",gggg:"(\\d{4})",gg:"(\\d{2})",MMMM:"([^/\\\\._-]+)",MMM:"([^/\\\\._-]+)",MM:"(\\d{2})",M:"(\\d{1,2})",DD:"(\\d{2})",Do:"(\\d{1,2}(?:st|nd|rd|th))",D:"(\\d{1,2})",dddd:"([^/\\\\._-]+)",ddd:"([^/\\\\._-]+)",dd:"([^/\\\\._-]+)",d:"([0-6])",WW:"(\\d{2})",W:"(\\d{1,2})",ww:"(\\d{2})",w:"(\\d{1,2})",Q:"([1-4])"};var Cd,Td,Od,Dd;!function(e){e.PERIODIC="Periodic",e.THEME="Theme",e.CALENDAR="Calendar",e.ACTIVATION="Activation",e.AI="AI",e.AI_MODEL="AI_MODEL",e.AI_PROMPT="AI_PROMPT",e.AI_SKILLS="AI_SKILLS",e.MCP_SERVICES="MCP_SERVICES"}(Cd||(Cd={})),function(e){e.DONE="DONE",e.RECORD="RECORD",e.DUE="DUE"}(Td||(Td={})),function(e){e[e.info=0]="info",e[e.warn=1]="warn",e[e.error=2]="error"}(Od||(Od={})),function(e){e.DAY_GRID_DAY="dayGridDay",e.DAY_GRID_WEEK="dayGridWeek",e.DAY_GRID_MONTH="dayGridMonth",e.TIME_GRID_DAY="timeGridDay",e.TIME_GRID_WEEK="timeGridWeek",e.NORMAL_LIST="normalList"}(Dd||(Dd={}));const Md=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ad=/^\s*(?:[-*+]|\d+\.)\s+\[[^\]\r\n]\]\s+/u,Nd={due:["📅"],scheduled:["⏳"],start:["🛫"],created:["➕"],priority:["🔺","⏫","🔼","🔽","⏬"],recurrence:["🔁"],done:["✅"]};function Ed(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Id(e){return new Date(e.getTime())}function Rd(e,t){const n=Id(e);return n.setDate(n.getDate()+t),n}function Ld(e){return Md[e.getDay()]}function Pd(e){return e?.now?Id(e.now):new Date}function $d(e,t,n=20){const s=e.trim(),r=/^(\d{4})(?:-(\d{0,2})(?:-(\d{0,2}))?)?$/u.exec(s);if(!r||n<=0)return[];const i=Number(r[1]);if(!Number.isInteger(i)||i<1e3||i>9999)return[];const a=Pd(t).getTime(),o=[];for(let l=1;l<=12;l+=1){const e=new Date(i,l,0).getDate();for(let t=1;t<=e;t+=1){const e=new Date(i,l-1,t),n=Ed(e);n.startsWith(s)&&o.push({dateStr:n,weekday:e.getDay(),time:e.getTime()})}}return o.sort((e,t)=>Math.abs(e.time-a)-Math.abs(t.time-a)||e.time-t.time).slice(0,n).map(({dateStr:e,weekday:t})=>({dateStr:e,weekday:t}))}function Vd(e){return Ed(Pd(e))}function Bd(e,t,n){const s=Pd(n),r=Rd(s,1),i=Rd(s,7),a=function(e){const t=Id(e);return t.setMonth(t.getMonth()+1),t}(s),o=function(e){const t=Id(e);return t.setFullYear(t.getFullYear()+1),t}(s),l=Md.map((n,r)=>{const i=s.getDay(),a=Rd(s,(r-i+7)%7||7);return{keywords:[n.toLowerCase()],label:`${n} ${Ed(a)} ${Ld(a)}`,icon:e,insertText:Ed(a),category:t}});return[{keywords:["today"],label:`Today ${Ed(s)} ${Ld(s)}`,icon:e,insertText:Ed(s),category:t},{keywords:["tomorrow"],label:`Tomorrow ${Ed(r)} ${Ld(r)}`,icon:e,insertText:Ed(r),category:t},...l,{keywords:["next week"],label:`Next week ${Ed(i)} ${Ld(i)}`,icon:e,insertText:Ed(i),category:t},{keywords:["next month"],label:`Next month ${Ed(a)} ${Ld(a)}`,icon:e,insertText:Ed(a),category:t},{keywords:["next year"],label:`Next year ${Ed(o)} ${Ld(o)}`,icon:e,insertText:Ed(o),category:t}]}function Fd(e){const t=[{keywords:["highest","highest priority"],label:"Highest priority",icon:"🔺",insertText:"🔺",category:"priority"},{keywords:["high","high priority"],label:"High priority",icon:"⏫",insertText:"⏫",category:"priority"},{keywords:["medium","medium priority"],label:"Medium priority",icon:"🔼",insertText:"🔼",category:"priority"},{keywords:["low","low priority"],label:"Low priority",icon:"🔽",insertText:"🔽",category:"priority"},{keywords:["lowest","lowest priority"],label:"Lowest priority",icon:"⏬",insertText:"⏬",category:"priority"}],n=[{keywords:["every day","daily"],label:"Every day",icon:"🔁",insertText:"every day",category:"recurrence"},{keywords:["every week","weekly"],label:"Every week",icon:"🔁",insertText:"every week",category:"recurrence"},...Md.map(e=>({keywords:[`every week on ${e.toLowerCase()}`],label:`Every week on ${e}`,icon:"🔁",insertText:`every week on ${e}`,category:"recurrence"})),{keywords:["every month","monthly"],label:"Every month",icon:"🔁",insertText:"every month",category:"recurrence"},{keywords:["every quarter","quarterly"],label:"Every quarter",icon:"🔁",insertText:"every quarter",category:"recurrence"},{keywords:["every year","yearly","annually"],label:"Every year",icon:"🔁",insertText:"every year",category:"recurrence"}];return[{keywords:["due","due date","today","tomorrow"],label:"Due date",icon:"📅",insertText:"📅 ",category:"due",followUp:Bd("📅","due",e)},{keywords:["scheduled","scheduled date","sch"],label:"Scheduled date",icon:"⏳",insertText:"⏳ ",category:"scheduled",followUp:Bd("⏳","scheduled",e)},{keywords:["start","start date"],label:"Start date",icon:"🛫",insertText:"🛫 ",category:"start",followUp:Bd("🛫","start",e)},{keywords:["created","created today"],label:"Created date",icon:"➕",insertText:`➕ ${Vd(e)}`,category:"created"},...t,{keywords:["pri","priority"],label:"Priority",icon:"🔼",insertText:"",category:"priority",followUp:t},...n.map(e=>({...e,insertText:`🔁 ${e.insertText}`})),{keywords:["rec","recurrence","recurring","repeat"],label:"Recurrence",icon:"🔁",insertText:"🔁 ",category:"recurrence",followUp:n},{keywords:["done","completion"],label:"Done date",icon:"✅",insertText:`✅ ${Vd(e)}`,category:"done"}]}function zd(e){return Ad.test(e)}function Wd(e,t,n){const s=e.toLowerCase(),r=function(e){const t=new Set;for(const[n,s]of Object.entries(Nd))s.some(t=>e.includes(t))&&t.add(n);return t}(t);return Fd(n).filter(e=>!r.has(e.category)).map((e,t)=>{const n=Math.min(...e.keywords.map(e=>e===s?0:e.startsWith(s)?1:s.startsWith(e)?2:Number.POSITIVE_INFINITY));return{item:e,index:t,matchScore:n}}).filter(({matchScore:e})=>Number.isFinite(e)).sort((e,t)=>e.matchScore-t.matchScore||e.index-t.index).map(({item:e})=>e)}function jd(e,t){return Fd(t).find(t=>t.category===e&&t.followUp?.length)?.followUp??[]}function _d(e,t,n){const s=t.toLowerCase().trimStart(),r=jd(e,n);if(0===s.length)return[...r];const i=r.filter(e=>{const t=e.label.toLowerCase();return e.keywords.some(e=>e.startsWith(s))||t.startsWith(s)||e.insertText.toLowerCase().startsWith(s)});if("due"!==e&&"scheduled"!==e&&"start"!==e)return i;const a=r[0]?.icon??Nd[e][0]??"",o=new Set(i.map(e=>e.insertText)),l=$d(s,n).filter(e=>!o.has(e.dateStr)).map(t=>({keywords:[t.dateStr],label:`${t.dateStr} ${Md[t.weekday]}`,icon:a,insertText:t.dateStr,category:e}));return[...i,...l]}function Ud(e,t,n){if(!zd(e))return null;const s=e.substring(0,t);if(!zd(s))return null;const r=function(e,t){let n;for(const r of Fd(t)){if(!r.followUp?.length||!r.insertText)continue;const t=e.lastIndexOf(r.insertText);if(t<0)continue;const s=t+r.insertText.length;(!n||t>n.markerStart)&&(n={item:r,markerStart:t,markerEnd:s})}if(!n)return null;const s=e.slice(n.markerEnd);return Object.values(Nd).some(e=>e.some(e=>s.includes(e)))||function(e,t,n){const s=t.trim().toLowerCase();return!!s&&(!("due"!==e&&"scheduled"!==e&&"start"!==e||!/^\d{4}-\d{2}-\d{2}(?:\s|$)/u.test(s))||jd(e,n).some(e=>{const t=e.insertText.toLowerCase();return s===t||s.startsWith(`${t} `)}))}(n.item.category,s,t)?null:{category:n.item.category,query:s,fromOffset:n.markerEnd,toOffset:e.length}}(s,n);if(r&&_d(r.category,r.query,n).length>0)return{mode:"follow-up",category:r.category,query:r.query,fromOffset:r.fromOffset,toOffset:r.toOffset};const i=function(e,t,n){for(let s=0;s<e.length;s+=1){if(s>0&&!/\s/u.test(e[s-1]??""))continue;if(/\s/u.test(e[s]??""))continue;const r=e.slice(s);if(r.length<2)continue;const i=r.toLowerCase();if(Wd(r,t,n).some(e=>e.keywords.some(e=>e.startsWith(i))))return{keyword:i,fromOffset:s,toOffset:e.length}}return null}(s,e,n);return i?0===Wd(i.keyword,e,n).length?null:{mode:"keyword",query:i.keyword,fromOffset:i.fromOffset,toOffset:i.toOffset}:null}var Kd=["MO","TU","WE","TH","FR","SA","SU"],qd=function(){function e(e,t){if(0===t)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return e.fromStr=function(t){return new e(Kd.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},e.prototype.toString=function(){var e=Kd[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},e.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},e}(),Hd=function(e){return null!=e},Yd=function(e){return"number"==typeof e},Jd=function(e){return"string"==typeof e&&Kd.includes(e)},Gd=Array.isArray,Qd=function(e,t){void 0===t&&(t=e),1===arguments.length&&(t=e,e=0);for(var n=[],s=e;s<t;s++)n.push(s);return n},Zd=function(e,t){var n=0,s=[];if(Gd(e))for(;n<t;n++)s[n]=[].concat(e);else for(;n<t;n++)s[n]=e;return s},Xd=function(e){return Gd(e)?e:[e]};function ep(e,t,n){void 0===n&&(n=" ");var s=String(e);return t|=0,s.length>t?String(s):((t-=s.length)>n.length&&(n+=Zd(n,t/n.length)),n.slice(0,t)+String(s))}var tp=function(e,t){var n=e%t;return n*t<0?n+t:n},np=function(e,t){return{div:Math.floor(e/t),mod:tp(e,t)}},sp=function(e){return!Hd(e)||0===e.length},rp=function(e){return!sp(e)},ip=function(e,t){return rp(e)&&-1!==e.indexOf(t)},ap=function(e,t,n,s,r,i){return void 0===s&&(s=0),void 0===r&&(r=0),void 0===i&&(i=0),new Date(Date.UTC(e,t-1,n,s,r,i))},op=[31,28,31,30,31,30,31,31,30,31,30,31],lp=864e5,cp=ap(1970,1,1),up=[6,0,1,2,3,4,5],dp=function(e){return e%4==0&&e%100!=0||e%400==0},pp=function(e){return e instanceof Date},fp=function(e){return pp(e)&&!isNaN(e.getTime())},hp=function(e){return function(e,t){var n=e.getTime()-t.getTime();return Math.round(n/lp)}(e,cp)},mp=function(e){return new Date(cp.getTime()+e*lp)},gp=function(e){var t=e.getUTCMonth();return 1===t&&dp(e.getUTCFullYear())?29:op[t]},yp=function(e){return up[e.getUTCDay()]},kp=function(e,t){var n=ap(e,t+1,1);return[yp(n),gp(n)]},wp=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},bp=function(e){return new Date(e.getTime())},vp=function(e){for(var t=[],n=0;n<e.length;n++)t.push(bp(e[n]));return t},Sp=function(e){e.sort(function(e,t){return e.getTime()-t.getTime()})},xp=function(e,t){void 0===t&&(t=!0);var n=new Date(e);return[ep(n.getUTCFullYear().toString(),4,"0"),ep(n.getUTCMonth()+1,2,"0"),ep(n.getUTCDate(),2,"0"),"T",ep(n.getUTCHours(),2,"0"),ep(n.getUTCMinutes(),2,"0"),ep(n.getUTCSeconds(),2,"0"),t?"Z":""].join("")},Cp=function(e){var t=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(e);if(!t)throw new Error("Invalid UNTIL value: ".concat(e));return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))},Tp=function(e,t){return e.toLocaleString("sv-SE",{timeZone:t}).replace(" ","T")+"Z"},Op=function(){function e(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,"between"===e?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):"before"===e?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):"after"===e&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return e.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if("between"===this.method){if(t)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!t||(this.add(e),!1);return this.add(e)},e.prototype.add=function(e){return this._result.push(e),!0},e.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;default:return e.length?e[e.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),Dp=function(e,t){return(Dp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Mp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Dp(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ap=function(){return Ap=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Ap.apply(this,arguments)};function Np(e,t,n){if(n||2===arguments.length)for(var s,r=0,i=t.length;r<i;r++)!s&&r in t||(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Ep,Ip=function(e){function t(t,n,s){var r=e.call(this,t,n)||this;return r.iterator=s,r}return Mp(t,e),t.prototype.add=function(e){return!!this.iterator(e,this._result.length)&&(this._result.push(e),!0)},t}(Op),Rp={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},Lp=function(e,t){return-1!==e.indexOf(t)},Pp=function(e){return e.toString()},$p=function(e,t,n){return"".concat(t," ").concat(n,", ").concat(e)},Vp=function(){function e(e,t,n,s){if(void 0===t&&(t=Pp),void 0===n&&(n=Rp),void 0===s&&(s=$p),this.text=[],this.language=n||Rp,this.gettext=t,this.dateFormatter=s,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var r=[].concat(this.options.bymonthday),i=[].concat(this.options.bynmonthday);r.sort(function(e,t){return e-t}),i.sort(function(e,t){return t-e}),this.bymonthday=r.concat(i),this.bymonthday.length||(this.bymonthday=null)}if(Hd(this.origOptions.byweekday)){var a=Gd(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],o=String(a);this.byweekday={allWeeks:a.filter(function(e){return!e.n}),someWeeks:a.filter(function(e){return Boolean(e.n)}),isWeekdays:-1!==o.indexOf("MO")&&-1!==o.indexOf("TU")&&-1!==o.indexOf("WE")&&-1!==o.indexOf("TH")&&-1!==o.indexOf("FR")&&-1===o.indexOf("SA")&&-1===o.indexOf("SU"),isEveryDay:-1!==o.indexOf("MO")&&-1!==o.indexOf("TU")&&-1!==o.indexOf("WE")&&-1!==o.indexOf("TH")&&-1!==o.indexOf("FR")&&-1!==o.indexOf("SA")&&-1!==o.indexOf("SU")};var l=function(e,t){return e.weekday-t.weekday};this.byweekday.allWeeks.sort(l),this.byweekday.someWeeks.sort(l),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return e.isFullyConvertible=function(t){if(!(t.options.freq in e.IMPLEMENTED))return!1;if(t.origOptions.until&&t.origOptions.count)return!1;for(var n in t.origOptions){if(Lp(["dtstart","tzid","wkst","freq"],n))return!0;if(!Lp(e.IMPLEMENTED[t.options.freq],n))return!1}return!0},e.prototype.isFullyConvertible=function(){return e.isFullyConvertible(this.rrule)},e.prototype.toString=function(){var t=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[Nf.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(t("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?t("times"):t("time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")},e.prototype.HOURLY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},e.prototype.MINUTELY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},e.prototype.DAILY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},e.prototype.WEEKLY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(1===this.options.interval&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},e.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},e.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},e.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},e.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},e.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},e.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},e.prototype.nth=function(e){var t;e=parseInt(e.toString(),10);var n=this.gettext;if(-1===e)return n("last");var s=Math.abs(e);switch(s){case 1:case 21:case 31:t=s+n("st");break;case 2:case 22:t=s+n("nd");break;case 3:case 23:t=s+n("rd");break;default:t=s+n("th")}return e<0?t+" "+n("last"):t},e.prototype.monthtext=function(e){return this.language.monthNames[e-1]},e.prototype.weekdaytext=function(e){var t=Yd(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},e.prototype.plural=function(e){return e%100!=1},e.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},e.prototype.list=function(e,t,n,s){var r=this;void 0===s&&(s=","),Gd(e)||(e=[e]),t=t||function(e){return e.toString()};var i=function(e){return t&&t.call(r,e)};return n?function(e,t,n){for(var s="",r=0;r<e.length;r++)0!==r&&(r===e.length-1?s+=" "+n+" ":s+=t+" "),s+=e[r];return s}(e.map(i),s,n):e.map(i).join(s+" ")},e}(),Bp=function(){function e(e){this.done=!0,this.rules=e}return e.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},e.prototype.isDone=function(){return this.done&&null===this.symbol},e.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in e=null,this.rules){var s=this.rules[n].exec(this.text);s&&(null===e||s[0].length>e[0].length)&&(e=s,t=n)}if(null!=e&&(this.text=this.text.substr(e[0].length),""===this.text&&(this.done=!0)),null==e)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===t);return this.symbol=t,this.value=e,!0},e.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},e}();function Fp(e,t){void 0===t&&(t=Rp);var n={},s=new Bp(t.tokens);return s.start(e)?(function(){s.expect("every");var e=s.acceptNumber();if(e&&(n.interval=parseInt(e[0],10)),s.isDone())throw new Error("Unexpected end");switch(s.symbol){case"day(s)":n.freq=Nf.DAILY,s.nextSymbol()&&(i(),c());break;case"weekday(s)":n.freq=Nf.WEEKLY,n.byweekday=[Nf.MO,Nf.TU,Nf.WE,Nf.TH,Nf.FR],s.nextSymbol(),i(),c();break;case"week(s)":n.freq=Nf.WEEKLY,s.nextSymbol()&&(r(),i(),c());break;case"hour(s)":n.freq=Nf.HOURLY,s.nextSymbol()&&(r(),c());break;case"minute(s)":n.freq=Nf.MINUTELY,s.nextSymbol()&&(r(),c());break;case"month(s)":n.freq=Nf.MONTHLY,s.nextSymbol()&&(r(),c());break;case"year(s)":n.freq=Nf.YEARLY,s.nextSymbol()&&(r(),c());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=Nf.WEEKLY;var t=s.symbol.substr(0,2).toUpperCase();if(n.byweekday=[Nf[t]],!s.nextSymbol())return;for(;s.accept("comma");){if(s.isDone())throw new Error("Unexpected end");var u=o();if(!u)throw new Error("Unexpected symbol "+s.symbol+", expected weekday");n.byweekday.push(Nf[u]),s.nextSymbol()}i(),function(){s.accept("on"),s.accept("the");var e=l();if(e)for(n.bymonthday=[e],s.nextSymbol();s.accept("comma");){if(!(e=l()))throw new Error("Unexpected symbol "+s.symbol+"; expected monthday");n.bymonthday.push(e),s.nextSymbol()}}(),c();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=Nf.YEARLY,n.bymonth=[a()],!s.nextSymbol())return;for(;s.accept("comma");){if(s.isDone())throw new Error("Unexpected end");var d=a();if(!d)throw new Error("Unexpected symbol "+s.symbol+", expected month");n.bymonth.push(d),s.nextSymbol()}r(),c();break;default:throw new Error("Unknown symbol")}}(),n):null;function r(){var e=s.accept("on"),t=s.accept("the");if(e||t)do{var r=l(),i=o(),c=a();if(r)i?(s.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Nf[i].nth(r))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(r),s.accept("day(s)"));else if(i)s.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Nf[i]);else if("weekday(s)"===s.symbol)s.nextSymbol(),n.byweekday||(n.byweekday=[Nf.MO,Nf.TU,Nf.WE,Nf.TH,Nf.FR]);else if("week(s)"===s.symbol){s.nextSymbol();var u=s.acceptNumber();if(!u)throw new Error("Unexpected symbol "+s.symbol+", expected week number");for(n.byweekno=[parseInt(u[0],10)];s.accept("comma");){if(!(u=s.acceptNumber()))throw new Error("Unexpected symbol "+s.symbol+"; expected monthday");n.byweekno.push(parseInt(u[0],10))}}else{if(!c)return;s.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(c)}}while(s.accept("comma")||s.accept("the")||s.accept("on"))}function i(){if(s.accept("at"))do{var e=s.acceptNumber();if(!e)throw new Error("Unexpected symbol "+s.symbol+", expected hour");for(n.byhour=[parseInt(e[0],10)];s.accept("comma");){if(!(e=s.acceptNumber()))throw new Error("Unexpected symbol "+s.symbol+"; expected hour");n.byhour.push(parseInt(e[0],10))}}while(s.accept("comma")||s.accept("at"))}function a(){switch(s.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function o(){switch(s.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return s.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(s.symbol){case"last":return s.nextSymbol(),-1;case"first":return s.nextSymbol(),1;case"second":return s.nextSymbol(),s.accept("last")?-2:2;case"third":return s.nextSymbol(),s.accept("last")?-3:3;case"nth":var e=parseInt(s.value[1],10);if(e<-366||e>366)throw new Error("Nth out of range: "+e);return s.nextSymbol(),s.accept("last")?-e:e;default:return!1}}function c(){if("until"===s.symbol){var e=Date.parse(s.text);if(!e)throw new Error("Cannot parse until date:"+s.text);n.until=new Date(e)}else s.accept("for")&&(n.count=parseInt(s.value[0],10),s.expect("number"))}}function zp(e){return e<Ep.HOURLY}!function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"}(Ep||(Ep={}));var Wp=["count","until","interval","byweekday","bymonthday","bymonth"];Vp.IMPLEMENTED=[],Vp.IMPLEMENTED[Ep.HOURLY]=Wp,Vp.IMPLEMENTED[Ep.MINUTELY]=Wp,Vp.IMPLEMENTED[Ep.DAILY]=["byhour"].concat(Wp),Vp.IMPLEMENTED[Ep.WEEKLY]=Wp,Vp.IMPLEMENTED[Ep.MONTHLY]=Wp,Vp.IMPLEMENTED[Ep.YEARLY]=["byweekno","byyearday"].concat(Wp);var jp=Vp.isFullyConvertible,_p=function(){function e(e,t,n,s){this.hour=e,this.minute=t,this.second=n,this.millisecond=s||0}return e.prototype.getHours=function(){return this.hour},e.prototype.getMinutes=function(){return this.minute},e.prototype.getSeconds=function(){return this.second},e.prototype.getMilliseconds=function(){return this.millisecond},e.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},e}(),Up=function(e){function t(t,n,s,r,i,a,o){var l=e.call(this,r,i,a,o)||this;return l.year=t,l.month=n,l.day=s,l}return Mp(t,e),t.fromDate=function(e){return new this(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.valueOf()%1e3)},t.prototype.getWeekday=function(){return yp(new Date(this.getTime()))},t.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},t.prototype.getDay=function(){return this.day},t.prototype.getMonth=function(){return this.month},t.prototype.getYear=function(){return this.year},t.prototype.addYears=function(e){this.year+=e},t.prototype.addMonths=function(e){if(this.month+=e,this.month>12){var t=Math.floor(this.month/12),n=tp(this.month,12);this.month=n,this.year+=t,0===this.month&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(e,t){t>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-t))+7*e:this.day+=-(this.getWeekday()-t)+7*e,this.fixDay()},t.prototype.addDaily=function(e){this.day+=e,this.fixDay()},t.prototype.addHours=function(e,t,n){for(t&&(this.hour+=Math.floor((23-this.hour)/e)*e);;){this.hour+=e;var s=np(this.hour,24),r=s.div,i=s.mod;if(r&&(this.hour=i,this.addDaily(r)),sp(n)||ip(n,this.hour))break}},t.prototype.addMinutes=function(e,t,n,s){for(t&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/e)*e);;){this.minute+=e;var r=np(this.minute,60),i=r.div,a=r.mod;if(i&&(this.minute=a,this.addHours(i,!1,n)),(sp(n)||ip(n,this.hour))&&(sp(s)||ip(s,this.minute)))break}},t.prototype.addSeconds=function(e,t,n,s,r){for(t&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/e)*e);;){this.second+=e;var i=np(this.second,60),a=i.div,o=i.mod;if(a&&(this.second=o,this.addMinutes(a,!1,n,s)),(sp(n)||ip(n,this.hour))&&(sp(s)||ip(s,this.minute))&&(sp(r)||ip(r,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var e=kp(this.year,this.month-1)[1];if(!(this.day<=e))for(;this.day>e;){if(this.day-=e,++this.month,13===this.month&&(this.month=1,++this.year,this.year>9999))return;e=kp(this.year,this.month-1)[1]}}},t.prototype.add=function(e,t){var n=e.freq,s=e.interval,r=e.wkst,i=e.byhour,a=e.byminute,o=e.bysecond;switch(n){case Ep.YEARLY:return this.addYears(s);case Ep.MONTHLY:return this.addMonths(s);case Ep.WEEKLY:return this.addWeekly(s,r);case Ep.DAILY:return this.addDaily(s);case Ep.HOURLY:return this.addHours(s,t,i);case Ep.MINUTELY:return this.addMinutes(s,t,i,a);case Ep.SECONDLY:return this.addSeconds(s,t,i,a,o)}},t}(_p);function Kp(e){for(var t=[],n=0,s=Object.keys(e);n<s.length;n++){var r=s[n];ip(Af,r)||t.push(r),pp(e[r])&&!fp(e[r])&&t.push(r)}if(t.length)throw new Error("Invalid options: "+t.join(", "));return Ap({},e)}function qp(e){var t=e.split("\n").map(Yp).filter(function(e){return null!==e});return Ap(Ap({},t[0]),t[1])}function Hp(e){var t={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(e);if(!n)return t;var s=n[1],r=n[2];return s&&(t.tzid=s),t.dtstart=Cp(r),t}function Yp(e){if(!(e=e.replace(/^\s+|\s+$/,"")).length)return null;var t=/^([A-Z]+?)[:;]/.exec(e.toUpperCase());if(!t)return Jp(e);var n=t[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return Jp(e);case"DTSTART":return Hp(e);default:throw new Error("Unsupported RFC prop ".concat(n," in ").concat(e))}}function Jp(e){var t=Hp(e.replace(/^RRULE:/i,""));return e.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach(function(n){var s=n.split("="),r=s[0],i=s[1];switch(r.toUpperCase()){case"FREQ":t.freq=Ep[i.toUpperCase()];break;case"WKST":t.wkst=Df[i.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var a=function(e){return-1!==e.indexOf(",")?e.split(",").map(Gp):Gp(e)}(i),o=r.toLowerCase();t[o]=a;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=function(e){return e.split(",").map(function(e){if(2===e.length)return Df[e];var t=e.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!t||t.length<3)throw new SyntaxError("Invalid weekday string: ".concat(e));var n=Number(t[1]),s=t[2],r=Df[s].weekday;return new qd(r,n)})}(i);break;case"DTSTART":case"TZID":var l=Hp(e);t.tzid=l.tzid,t.dtstart=l.dtstart;break;case"UNTIL":t.until=Cp(i);break;case"BYEASTER":t.byeaster=Number(i);break;default:throw new Error("Unknown RRULE property '"+r+"'")}}),t}function Gp(e){return/^[+-]?\d+$/.test(e)?Number(e):e}var Qp=function(){function e(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(e.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var e=xp(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},e.prototype.getTime=function(){return this.date.getTime()},e.prototype.rezonedDate=function(){return this.isUTC?this.date:function(e,t){var n=Intl.DateTimeFormat().resolvedOptions().timeZone,s=new Date(Tp(e,n)),r=new Date(Tp(e,null!=t?t:"UTC")).getTime()-s.getTime();return new Date(e.getTime()-r)}(this.date,this.tzid)},e}();function Zp(e){for(var t=[],n="",s=Object.keys(e),r=Object.keys(Mf),i=0;i<s.length;i++)if("tzid"!==s[i]&&ip(r,s[i])){var a=s[i].toUpperCase(),o=e[s[i]],l="";if(Hd(o)&&(!Gd(o)||o.length)){switch(a){case"FREQ":l=Nf.FREQUENCIES[e.freq];break;case"WKST":l=Yd(o)?new qd(o).toString():o.toString();break;case"BYWEEKDAY":a="BYDAY",l=Xd(o).map(function(e){return e instanceof qd?e:Gd(e)?new qd(e[0],e[1]):new qd(e)}).toString();break;case"DTSTART":n=Xp(o,e.tzid);break;case"UNTIL":l=xp(o,!e.tzid);break;default:if(Gd(o)){for(var c=[],u=0;u<o.length;u++)c[u]=String(o[u]);l=c.toString()}else l=String(o)}l&&t.push([a,l])}}var d=t.map(function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n.toString())}).join(";"),p="";return""!==d&&(p="RRULE:".concat(d)),[n,p].filter(function(e){return!!e}).join("\n")}function Xp(e,t){return e?"DTSTART"+new Qp(new Date(e),t).toString():""}function ef(e,t){return Array.isArray(e)?!!Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return e.getTime()===t[n].getTime()}):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():e===t}var tf=function(){function e(){this.all=!1,this.before=[],this.after=[],this.between=[]}return e.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?bp(t):vp(t)),"all"===e?this.all=t:(n._value=t,this[e].push(n))},e.prototype._cacheGet=function(e,t){var n=!1,s=t?Object.keys(t):[],r=function(e){for(var n=0;n<s.length;n++){var r=s[n];if(!ef(t[r],e[r]))return!0}return!1},i=this[e];if("all"===e)n=this.all;else if(Gd(i))for(var a=0;a<i.length;a++){var o=i[a];if(!s.length||!r(o)){n=o._value;break}}if(!n&&this.all){var l=new Op(e,t);for(a=0;a<this.all.length&&l.accept(this.all[a]);a++);n=l.getValue(),this._cacheAdd(e,n,t)}return Gd(n)?vp(n):n instanceof Date?bp(n):n},e}(),nf=Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np([],Zd(1,31),!0),Zd(2,28),!0),Zd(3,31),!0),Zd(4,30),!0),Zd(5,31),!0),Zd(6,30),!0),Zd(7,31),!0),Zd(8,31),!0),Zd(9,30),!0),Zd(10,31),!0),Zd(11,30),!0),Zd(12,31),!0),Zd(1,7),!0),sf=Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np([],Zd(1,31),!0),Zd(2,29),!0),Zd(3,31),!0),Zd(4,30),!0),Zd(5,31),!0),Zd(6,30),!0),Zd(7,31),!0),Zd(8,31),!0),Zd(9,30),!0),Zd(10,31),!0),Zd(11,30),!0),Zd(12,31),!0),Zd(1,7),!0),rf=Qd(1,29),af=Qd(1,30),of=Qd(1,31),lf=Qd(1,32),cf=Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np([],lf,!0),af,!0),lf,!0),of,!0),lf,!0),of,!0),lf,!0),lf,!0),of,!0),lf,!0),of,!0),lf,!0),lf.slice(0,7),!0),uf=Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np([],lf,!0),rf,!0),lf,!0),of,!0),lf,!0),of,!0),lf,!0),lf,!0),of,!0),lf,!0),of,!0),lf,!0),lf.slice(0,7),!0),df=Qd(-28,0),pf=Qd(-29,0),ff=Qd(-30,0),hf=Qd(-31,0),mf=Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np([],hf,!0),pf,!0),hf,!0),ff,!0),hf,!0),ff,!0),hf,!0),hf,!0),ff,!0),hf,!0),ff,!0),hf,!0),hf.slice(0,7),!0),gf=Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np(Np([],hf,!0),df,!0),hf,!0),ff,!0),hf,!0),ff,!0),hf,!0),hf,!0),ff,!0),hf,!0),ff,!0),hf,!0),hf.slice(0,7),!0),yf=[0,31,60,91,121,152,182,213,244,274,305,335,366],kf=[0,31,59,90,120,151,181,212,243,273,304,334,365],wf=function(){for(var e=[],t=0;t<55;t++)e=e.concat(Qd(7));return e}(),bf=function(){function e(e){this.options=e}return e.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=function(e,t){var n,s,r=ap(e,1,1),i=dp(e)?366:365,a=dp(e+1)?366:365,o=hp(r),l=yp(r),c=Ap(Ap({yearlen:i,nextyearlen:a,yearordinal:o,yearweekday:l},function(e){var t=dp(e)?366:365,n=ap(e,1,1),s=yp(n);return 365===t?{mmask:nf,mdaymask:uf,nmdaymask:gf,wdaymask:wf.slice(s),mrange:kf}:{mmask:sf,mdaymask:cf,nmdaymask:mf,wdaymask:wf.slice(s),mrange:yf}}(e)),{wnomask:null});if(sp(t.byweekno))return c;c.wnomask=Zd(0,i+7);var u=n=tp(7-l+t.wkst,7);u>=4?(u=0,s=c.yearlen+tp(l-t.wkst,7)):s=i-u;for(var d=Math.floor(s/7),p=tp(s,7),f=Math.floor(d+p/4),h=0;h<t.byweekno.length;h++){var m=t.byweekno[h];if(m<0&&(m+=f+1),m>0&&m<=f){var g=void 0;m>1?(g=u+7*(m-1),u!==n&&(g-=7-n)):g=u;for(var y=0;y<7&&(c.wnomask[g]=1,g++,c.wdaymask[g]!==t.wkst);y++);}}if(ip(t.byweekno,1)&&(g=u+7*f,u!==n&&(g-=7-n),g<i))for(h=0;h<7&&(c.wnomask[g]=1,g+=1,c.wdaymask[g]!==t.wkst);h++);if(u){var k=void 0;if(ip(t.byweekno,-1))k=-1;else{var w=yp(ap(e-1,1,1)),b=tp(7-w.valueOf()+t.wkst,7),v=dp(e-1)?366:365,S=void 0;b>=4?(b=0,S=v+tp(w-t.wkst,7)):S=i-u,k=Math.floor(52+tp(S,7)/4)}if(ip(t.byweekno,k))for(g=0;g<u;g++)c.wnomask[g]=1}return c}(e,n)),rp(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var s=this.yearinfo,r=s.yearlen,i=s.mrange,a=s.wdaymask;this.monthinfo=function(e,t,n,s,r,i){var a={lastyear:e,lastmonth:t,nwdaymask:[]},o=[];if(i.freq===Nf.YEARLY)if(sp(i.bymonth))o=[[0,n]];else for(var l=0;l<i.bymonth.length;l++)t=i.bymonth[l],o.push(s.slice(t-1,t+1));else i.freq===Nf.MONTHLY&&(o=[s.slice(t-1,t+1)]);if(sp(o))return a;for(a.nwdaymask=Zd(0,n),l=0;l<o.length;l++)for(var c=o[l],u=c[0],d=c[1]-1,p=0;p<i.bynweekday.length;p++){var f=void 0,h=i.bynweekday[p],m=h[0],g=h[1];g<0?(f=d+7*(g+1),f-=tp(r[f]-m,7)):(f=u+7*(g-1),f+=tp(7-r[f]+m,7)),u<=f&&f<=d&&(a.nwdaymask[f]=1)}return a}(e,t,r,i,a,n)}Hd(n.byeaster)&&(this.eastermask=function(e,t){void 0===t&&(t=0);var n=e%19,s=Math.floor(e/100),r=e%100,i=Math.floor(s/4),a=s%4,o=Math.floor((s+8)/25),l=Math.floor((s-o+1)/3),c=Math.floor(19*n+s-i-l+15)%30,u=Math.floor(r/4),d=r%4,p=Math.floor(32+2*a+2*u-c-d)%7,f=Math.floor((n+11*c+22*p)/451),h=Math.floor((c+p-7*f+114)/31),m=(c+p-7*f+114)%31+1,g=Date.UTC(e,h-1,m+t),y=Date.UTC(e,0,1);return[Math.ceil((g-y)/864e5)]}(e,n.byeaster))},Object.defineProperty(e.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),e.prototype.ydayset=function(){return[Qd(this.yearlen),0,this.yearlen]},e.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],s=this.mrange[t],r=Zd(null,this.yearlen),i=n;i<s;i++)r[i]=i;return[r,n,s]},e.prototype.wdayset=function(e,t,n){for(var s=Zd(null,this.yearlen+7),r=hp(ap(e,t,n))-this.yearordinal,i=r,a=0;a<7&&(s[r]=r,++r,this.wdaymask[r]!==this.options.wkst);a++);return[s,i,r]},e.prototype.ddayset=function(e,t,n){var s=Zd(null,this.yearlen),r=hp(ap(e,t,n))-this.yearordinal;return s[r]=r,[s,r,r+1]},e.prototype.htimeset=function(e,t,n,s){var r=this,i=[];return this.options.byminute.forEach(function(t){i=i.concat(r.mtimeset(e,t,n,s))}),Sp(i),i},e.prototype.mtimeset=function(e,t,n,s){var r=this.options.bysecond.map(function(n){return new _p(e,t,n,s)});return Sp(r),r},e.prototype.stimeset=function(e,t,n,s){return[new _p(e,t,n,s)]},e.prototype.getdayset=function(e){switch(e){case Ep.YEARLY:return this.ydayset.bind(this);case Ep.MONTHLY:return this.mdayset.bind(this);case Ep.WEEKLY:return this.wdayset.bind(this);case Ep.DAILY:default:return this.ddayset.bind(this)}},e.prototype.gettimeset=function(e){switch(e){case Ep.HOURLY:return this.htimeset.bind(this);case Ep.MINUTELY:return this.mtimeset.bind(this);case Ep.SECONDLY:return this.stimeset.bind(this)}},e}();function vf(e,t,n,s,r,i){for(var a=[],o=0;o<e.length;o++){var l,c=void 0,u=void 0,d=e[o];d<0?(c=Math.floor(d/t.length),u=tp(d,t.length)):(c=Math.floor((d-1)/t.length),u=tp(d-1,t.length));for(var p=[],f=n;f<s;f++){var h=i[f];Hd(h)&&p.push(h)}l=c<0?p.slice(c)[0]:p[c];var m=t[u],g=mp(r.yearordinal+l),y=wp(g,m);ip(a,y)||a.push(y)}return Sp(a),a}function Sf(e,t){var n=t.dtstart,s=t.freq,r=t.interval,i=t.until,a=t.bysetpos,o=t.count;if(0===o||0===r)return Tf(e);var l=Up.fromDate(n),c=new bf(t);c.rebuild(l.year,l.month);for(var u=function(e,t,n){var s=n.freq,r=n.byhour,i=n.byminute,a=n.bysecond;return zp(s)?function(e){var t=e.dtstart.getTime()%1e3;if(!zp(e.freq))return[];var n=[];return e.byhour.forEach(function(s){e.byminute.forEach(function(r){e.bysecond.forEach(function(e){n.push(new _p(s,r,e,t))})})}),n}(n):s>=Nf.HOURLY&&rp(r)&&!ip(r,t.hour)||s>=Nf.MINUTELY&&rp(i)&&!ip(i,t.minute)||s>=Nf.SECONDLY&&rp(a)&&!ip(a,t.second)?[]:e.gettimeset(s)(t.hour,t.minute,t.second,t.millisecond)}(c,l,t);;){var d=c.getdayset(s)(l.year,l.month,l.day),p=d[0],f=d[1],h=d[2],m=Of(p,f,h,c,t);if(rp(a))for(var g=vf(a,u,f,h,c,p),y=0;y<g.length;y++){var k=g[y];if(i&&k>i)return Tf(e);if(k>=n){var w=Cf(k,t);if(!e.accept(w))return Tf(e);if(o&&! --o)return Tf(e)}}else for(y=f;y<h;y++){var b=p[y];if(Hd(b))for(var v=mp(c.yearordinal+b),S=0;S<u.length;S++){var x=u[S];if(k=wp(v,x),i&&k>i)return Tf(e);if(k>=n){if(w=Cf(k,t),!e.accept(w))return Tf(e);if(o&&! --o)return Tf(e)}}}if(0===t.interval)return Tf(e);if(l.add(t,m),l.year>9999)return Tf(e);zp(s)||(u=c.gettimeset(s)(l.hour,l.minute,l.second,0)),c.rebuild(l.year,l.month)}}function xf(e,t,n){var s=n.bymonth,r=n.byweekno,i=n.byweekday,a=n.byeaster,o=n.bymonthday,l=n.bynmonthday,c=n.byyearday;return rp(s)&&!ip(s,e.mmask[t])||rp(r)&&!e.wnomask[t]||rp(i)&&!ip(i,e.wdaymask[t])||rp(e.nwdaymask)&&!e.nwdaymask[t]||null!==a&&!ip(e.eastermask,t)||(rp(o)||rp(l))&&!ip(o,e.mdaymask[t])&&!ip(l,e.nmdaymask[t])||rp(c)&&(t<e.yearlen&&!ip(c,t+1)&&!ip(c,-e.yearlen+t)||t>=e.yearlen&&!ip(c,t+1-e.yearlen)&&!ip(c,-e.nextyearlen+t-e.yearlen))}function Cf(e,t){return new Qp(e,t.tzid).rezonedDate()}function Tf(e){return e.getValue()}function Of(e,t,n,s,r){for(var i=!1,a=t;a<n;a++){var o=e[a];(i=xf(s,o,r))&&(e[o]=null)}return i}var Df={MO:new qd(0),TU:new qd(1),WE:new qd(2),TH:new qd(3),FR:new qd(4),SA:new qd(5),SU:new qd(6)},Mf={freq:Ep.YEARLY,dtstart:null,interval:1,wkst:Df.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Af=Object.keys(Mf),Nf=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t=!1),this._cache=t?null:new tf,this.origOptions=Kp(e);var n=function(e){var t=Ap(Ap({},Mf),Kp(e));if(Hd(t.byeaster)&&(t.freq=Nf.YEARLY),!Hd(t.freq)||!Nf.FREQUENCIES[t.freq])throw new Error("Invalid frequency: ".concat(t.freq," ").concat(e.freq));if(t.dtstart||(t.dtstart=new Date((new Date).setMilliseconds(0))),Hd(t.wkst)?Yd(t.wkst)||(t.wkst=t.wkst.weekday):t.wkst=Nf.MO.weekday,Hd(t.bysetpos)){Yd(t.bysetpos)&&(t.bysetpos=[t.bysetpos]);for(var n=0;n<t.bysetpos.length;n++)if(0===(i=t.bysetpos[n])||!(i>=-366&&i<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}if(!(Boolean(t.byweekno)||rp(t.byweekno)||rp(t.byyearday)||Boolean(t.bymonthday)||rp(t.bymonthday)||Hd(t.byweekday)||Hd(t.byeaster)))switch(t.freq){case Nf.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case Nf.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case Nf.WEEKLY:t.byweekday=[yp(t.dtstart)]}if(Hd(t.bymonth)&&!Gd(t.bymonth)&&(t.bymonth=[t.bymonth]),Hd(t.byyearday)&&!Gd(t.byyearday)&&Yd(t.byyearday)&&(t.byyearday=[t.byyearday]),Hd(t.bymonthday))if(Gd(t.bymonthday)){var s=[],r=[];for(n=0;n<t.bymonthday.length;n++){var i;(i=t.bymonthday[n])>0?s.push(i):i<0&&r.push(i)}t.bymonthday=s,t.bynmonthday=r}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);else t.bymonthday=[],t.bynmonthday=[];if(Hd(t.byweekno)&&!Gd(t.byweekno)&&(t.byweekno=[t.byweekno]),Hd(t.byweekday))if(Yd(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(Jd(t.byweekday))t.byweekday=[qd.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof qd)!t.byweekday.n||t.freq>Nf.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{var a=[],o=[];for(n=0;n<t.byweekday.length;n++){var l=t.byweekday[n];Yd(l)?a.push(l):Jd(l)?a.push(qd.fromStr(l).weekday):!l.n||t.freq>Nf.MONTHLY?a.push(l.weekday):o.push([l.weekday,l.n])}t.byweekday=rp(a)?a:null,t.bynweekday=rp(o)?o:null}else t.bynweekday=null;return Hd(t.byhour)?Yd(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq<Nf.HOURLY?[t.dtstart.getUTCHours()]:null,Hd(t.byminute)?Yd(t.byminute)&&(t.byminute=[t.byminute]):t.byminute=t.freq<Nf.MINUTELY?[t.dtstart.getUTCMinutes()]:null,Hd(t.bysecond)?Yd(t.bysecond)&&(t.bysecond=[t.bysecond]):t.bysecond=t.freq<Nf.SECONDLY?[t.dtstart.getUTCSeconds()]:null,{parsedOptions:t}}(e).parsedOptions;this.options=n}return e.parseText=function(e,t){return Fp(e,t)},e.fromText=function(e,t){return function(e,t){return void 0===t&&(t=Rp),new Nf(Fp(e,t)||void 0)}(e,t)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(e){return Sf(e,this.options)},e.prototype._cacheGet=function(e,t){return!!this._cache&&this._cache._cacheGet(e,t)},e.prototype._cacheAdd=function(e,t,n){if(this._cache)return this._cache._cacheAdd(e,t,n)},e.prototype.all=function(e){if(e)return this._iter(new Ip("all",{},e));var t=this._cacheGet("all");return!1===t&&(t=this._iter(new Op("all",{})),this._cacheAdd("all",t)),t},e.prototype.between=function(e,t,n,s){if(void 0===n&&(n=!1),!fp(e)||!fp(t))throw new Error("Invalid date passed in to RRule.between");var r={before:t,after:e,inc:n};if(s)return this._iter(new Ip("between",r,s));var i=this._cacheGet("between",r);return!1===i&&(i=this._iter(new Op("between",r)),this._cacheAdd("between",i,r)),i},e.prototype.before=function(e,t){if(void 0===t&&(t=!1),!fp(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},s=this._cacheGet("before",n);return!1===s&&(s=this._iter(new Op("before",n)),this._cacheAdd("before",s,n)),s},e.prototype.after=function(e,t){if(void 0===t&&(t=!1),!fp(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},s=this._cacheGet("after",n);return!1===s&&(s=this._iter(new Op("after",n)),this._cacheAdd("after",s,n)),s},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return Zp(this.origOptions)},e.prototype.toText=function(e,t,n){return function(e,t,n,s){return new Vp(e,t,n,s).toString()}(this,e,t,n)},e.prototype.isFullyConvertibleToText=function(){return jp(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=Ep.YEARLY,e.MONTHLY=Ep.MONTHLY,e.WEEKLY=Ep.WEEKLY,e.DAILY=Ep.DAILY,e.HOURLY=Ep.HOURLY,e.MINUTELY=Ep.MINUTELY,e.SECONDLY=Ep.SECONDLY,e.MO=Df.MO,e.TU=Df.TU,e.WE=Df.WE,e.TH=Df.TH,e.FR=Df.FR,e.SA=Df.SA,e.SU=Df.SU,e.parseString=qp,e.optionsToString=Zp,e}(),Ef={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function If(e,t){return void 0===t&&(t={}),function(e,t){var n=function(e,t){var n=[],s=[],r=[],i=[],a=Hp(e),o=a.dtstart,l=a.tzid,c=function(e,t){if(void 0===t&&(t=!1),!(e=e&&e.trim()))throw new Error("Invalid empty string");if(!t)return e.split(/\s/);for(var n=e.split("\n"),s=0;s<n.length;){var r=n[s]=n[s].replace(/\s+$/g,"");r?s>0&&" "===r[0]?(n[s-1]+=r.slice(1),n.splice(s,1)):s+=1:n.splice(s,1)}return n}(e,t.unfold);return c.forEach(function(e){var t;if(e){var a=function(e){var t=function(e){if(-1===e.indexOf(":"))return{name:"RRULE",value:e};var t=function(e){var t=e.split(":");return t.slice(0,1).concat([t.slice(1).join(":")])}(e);return{name:t[0],value:t[1]}}(e),n=t.name,s=t.value,r=n.split(";");if(!r)throw new Error("empty property name");return{name:r[0].toUpperCase(),parms:r.slice(1),value:s}}(e),o=a.name,c=a.parms,u=a.value;switch(o.toUpperCase()){case"RRULE":if(c.length)throw new Error("unsupported RRULE parm: ".concat(c.join(",")));n.push(qp(e));break;case"RDATE":var d=(null!==(t=/RDATE(?:;TZID=([^:=]+))?/i.exec(e))&&void 0!==t?t:[])[1];d&&!l&&(l=d),s=s.concat(Lf(u,c));break;case"EXRULE":if(c.length)throw new Error("unsupported EXRULE parm: ".concat(c.join(",")));r.push(qp(u));break;case"EXDATE":i=i.concat(Lf(u,c));break;case"DTSTART":break;default:throw new Error("unsupported property: "+o)}}}),{dtstart:o,tzid:l,rrulevals:n,rdatevals:s,exrulevals:r,exdatevals:i}}(e,t),s=n.rrulevals,r=n.rdatevals,i=n.exrulevals,a=n.exdatevals,o=n.dtstart,l=n.tzid,c=!1===t.cache;if(t.compatible&&(t.forceset=!0,t.unfold=!0),t.forceset||s.length>1||r.length||i.length||a.length){var u=new $f(c);return u.dtstart(o),u.tzid(l||void 0),s.forEach(function(e){u.rrule(new Nf(Rf(e,o,l),c))}),r.forEach(function(e){u.rdate(e)}),i.forEach(function(e){u.exrule(new Nf(Rf(e,o,l),c))}),a.forEach(function(e){u.exdate(e)}),t.compatible&&t.dtstart&&u.rdate(o),u}var d=s[0]||{};return new Nf(Rf(d,d.dtstart||t.dtstart||o,d.tzid||t.tzid||l),c)}(e,function(e){var t=[],n=Object.keys(e),s=Object.keys(Ef);if(n.forEach(function(e){ip(s,e)||t.push(e)}),t.length)throw new Error("Invalid options: "+t.join(", "));return Ap(Ap({},Ef),e)}(t))}function Rf(e,t,n){return Ap(Ap({},e),{dtstart:t,tzid:n})}function Lf(e,t){return function(e){e.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}(t),e.split(",").map(function(e){return Cp(e)})}function Pf(e){var t=this;return function(n){if(void 0!==n&&(t["_".concat(e)]=n),void 0!==t["_".concat(e)])return t["_".concat(e)];for(var s=0;s<t._rrule.length;s++){var r=t._rrule[s].origOptions[e];if(r)return r}}}var $f=function(e){function t(t){void 0===t&&(t=!1);var n=e.call(this,{},t)||this;return n.dtstart=Pf.apply(n,["dtstart"]),n.tzid=Pf.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return Mp(t,e),t.prototype._iter=function(e){return function(e,t,n,s,r,i){var a={},o=e.accept;function l(e,t){n.forEach(function(n){n.between(e,t,!0).forEach(function(e){a[Number(e)]=!0})})}r.forEach(function(e){var t=new Qp(e,i).rezonedDate();a[Number(t)]=!0}),e.accept=function(e){var t=Number(e);return isNaN(t)?o.call(this,e):!(!a[t]&&(l(new Date(t-1),new Date(t+1)),!a[t]))||(a[t]=!0,o.call(this,e))},"between"===e.method&&(l(e.args.after,e.args.before),e.accept=function(e){var t=Number(e);return!!a[t]||(a[t]=!0,o.call(this,e))});for(var c=0;c<s.length;c++){var u=new Qp(s[c],i).rezonedDate();if(!e.accept(new Date(u.getTime())))break}t.forEach(function(t){Sf(e,t.options)});var d=e._result;switch(Sp(d),e.method){case"all":case"between":return d;case"before":return d.length&&d[d.length-1]||null;default:return d.length&&d[0]||null}}(e,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},t.prototype.rrule=function(e){Vf(e,this._rrule)},t.prototype.exrule=function(e){Vf(e,this._exrule)},t.prototype.rdate=function(e){Bf(e,this._rdate)},t.prototype.exdate=function(e){Bf(e,this._exdate)},t.prototype.rrules=function(){return this._rrule.map(function(e){return If(e.toString())})},t.prototype.exrules=function(){return this._exrule.map(function(e){return If(e.toString())})},t.prototype.rdates=function(){return this._rdate.map(function(e){return new Date(e.getTime())})},t.prototype.exdates=function(){return this._exdate.map(function(e){return new Date(e.getTime())})},t.prototype.valueOf=function(){var e=[];return!this._rrule.length&&this._dtstart&&(e=e.concat(Zp({dtstart:this._dtstart}))),this._rrule.forEach(function(t){e=e.concat(t.toString().split("\n"))}),this._exrule.forEach(function(t){e=e.concat(t.toString().split("\n").map(function(e){return e.replace(/^RRULE:/,"EXRULE:")}).filter(function(e){return!/^DTSTART/.test(e)}))}),this._rdate.length&&e.push(Ff("RDATE",this._rdate,this.tzid())),this._exdate.length&&e.push(Ff("EXDATE",this._exdate,this.tzid())),e},t.prototype.toString=function(){return this.valueOf().join("\n")},t.prototype.clone=function(){var e=new t(!!this._cache);return this._rrule.forEach(function(t){return e.rrule(t.clone())}),this._exrule.forEach(function(t){return e.exrule(t.clone())}),this._rdate.forEach(function(t){return e.rdate(new Date(t.getTime()))}),this._exdate.forEach(function(t){return e.exdate(new Date(t.getTime()))}),e},t}(Nf);function Vf(e,t){if(!(e instanceof Nf))throw new TypeError(String(e)+" is not RRule instance");ip(t.map(String),String(e))||t.push(e)}function Bf(e,t){if(!(e instanceof Date))throw new TypeError(String(e)+" is not Date instance");ip(t.map(Number),Number(e))||(t.push(e),Sp(t))}function Ff(e,t,n){var s=!n||"UTC"===n.toUpperCase(),r=s?"".concat(e,":"):"".concat(e,";TZID=").concat(n,":"),i=t.map(function(e){return xp(e.valueOf(),s)}).join(",");return"".concat(r).concat(i)}const zf=Object.freeze(Object.defineProperty({__proto__:null,ALL_WEEKDAYS:Kd,get Frequency(){return Ep},RRule:Nf,RRuleSet:$f,Weekday:qd,datetime:ap,rrulestr:If},Symbol.toStringTag,{value:"Module"})),Wf=zf.rrulestr??zf.default?.rrulestr;if("function"!=typeof Wf)throw new Error("Unable to resolve rrule rrulestr export");const jf=Wf,_f=/^RRULE:/i;function Uf(e){return`${String(e.getUTCFullYear()).padStart(4,"0")}-${String(e.getUTCMonth()+1).padStart(2,"0")}-${String(e.getUTCDate()).padStart(2,"0")}`}function Kf(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}const qf=/^(\s*(?:[-*+]|\d+[.)])\s+)\[([^\]\r\n])\]\s+(.*)$/,Hf=/^(\s*(?:[-*+]|\d+[.)])\s+)(.*)$/,Yf=/(\s*\^[a-zA-Z0-9]+)\s*$/,Jf=/\s*\u2705\s*\d{4}-\d{2}-\d{2}/g,Gf=/\s*\u2705\s*\d{4}-\d{2}-\d{2}/,Qf=/\s*\u274c\s*\d{4}-\d{2}-\d{2}/g,Zf=/\s*\u274c\s*\d{4}-\d{2}-\d{2}/,Xf=/([📅⏳🛫])\s*(\d{4}-\d{2}-\d{2})/gu,eh=["📅","⏳","🛫"];function th(e){return/\d{2}:\d{2}$/.test(e)?`${e} `:e}function nh(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function sh(e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return;const n=Number(t[1]),s=Number(t[2]),r=Number(t[3]),i=new Date(Date.UTC(n,s-1,r));return i.getUTCFullYear()===n&&i.getUTCMonth()===s-1&&i.getUTCDate()===r?i:void 0}function rh(e,t,n,s,r){const i=rd(t,r),a=rd(s,r);let o=n,l="";const c=o.match(Yf);c&&(l=c[1].trim(),o=o.replace(Yf,"").trimEnd()),i.done&&!a.done&&(o=o.replace(Jf,"").trimEnd()),i.cancelled&&!a.cancelled&&(o=o.replace(Qf,"").trimEnd()),!a.done||i.done||Gf.test(o)||(o=`${o.trimEnd()} ✅ ${nh()}`),!a.cancelled||i.cancelled||Zf.test(o)||(o=`${o.trimEnd()} ❌ ${nh()}`);const u=l?` ${l}`:"";return th(`${e}[${a.marker}] ${o}${u}`.trimEnd())}function ih(e,t,n){return t?!1===n?.nextRecurringTaskOnNextLine?`${t}\n${e}`:`${e}\n${t}`:e}function ah(e,t,n,s){const r=rd(t,s);let i=n,a="";const o=i.match(Yf);return o&&(a=o[1].trim(),i=i.replace(Yf,"").trimEnd()),r.done&&(i=i.replace(Jf,"").trimEnd()),r.cancelled&&(i=i.replace(Qf,"").trimEnd()),th(`${e}${i}${a?` ${a}`:""}`.trimEnd())}function oh(e,t){const n=function(e){const t=e.match(od),n=t?.[1]?.trim();return n||void 0}(e);if(!n)return;const s=e.match(qf);if(!s)return;const[,r,i,a]=s,o=function(e){for(const t of eh){const n=e.find(e=>e.marker===t);if(n)return n.date}return e[0]?.date}(function(e){return Array.from(e.matchAll(Xf),e=>({marker:e[1],date:e[2]}))}(e)),l=function(e){return/\bwhen done\b|完成后计算/i.test(e)}(n)?nh():o??nh(),c=function(e,t){return function(e,t){const n=e?function(e){const t=e.trim();if(t)return t.includes("DTSTART")?t:t.split(/\r?\n/).map(e=>e.trim()).find(Boolean)?.replace(_f,"")}(e):void 0;if(!n||!function(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2}$/.test(e)}(t))return;const s=function(e){const[t,n,s]=e.split("-").map(Number);return new Date(Date.UTC(t,n-1,s))}(t);try{const e=function(e,t){const n=function(e){const t=new Map;for(const n of e.split(";")){const e=n.indexOf("=");e<=0||t.set(n.slice(0,e).toUpperCase(),n.slice(e+1))}return t}(e);if("MONTHLY"!==n.get("FREQ")?.toUpperCase())return null;if(["BYDAY","BYSETPOS","BYMONTH","BYYEARDAY","BYWEEKNO","BYHOUR","BYMINUTE","BYSECOND","COUNT"].some(e=>n.has(e)))return null;const s=Number(n.get("INTERVAL")??"1");if(!Number.isInteger(s)||s<1)return null;const r=n.get("BYMONTHDAY");if(r&&!/^(?:-1|[1-9]|[12]\d|3[01])$/.test(r))return null;const i=t.getUTCFullYear(),a=t.getUTCMonth(),o=t.getUTCDate(),l=12*i+a+s,c=Math.floor(l/12),u=l%12,d=Kf(c,u),p=o===Kf(i,a),f=r&&"-1"!==r?Number(r):o,h="-1"===r||!r&&p?d:Math.min(f,d),m=new Date(Date.UTC(c,u,h)),g=n.get("UNTIL")?.match(/^(\d{4})(\d{2})(\d{2})/);return g&&m>new Date(Date.UTC(Number(g[1]),Number(g[2])-1,Number(g[3])))?void 0:m}(n,s);if(null!==e)return e?Uf(e):void 0;const r=n.includes("DTSTART")?n:`DTSTART:${function(e){return e.replace(/-/g,"")}(t)}\nRRULE:${n}`,i=jf(r).after(s,!1);return i?Uf(i):void 0}catch{return}}(function(e){const t=function(e){return e.replace(/\bwhen done\b/gi,"").replace(/完成后计算/g,"").replace(/\s+/g," ").trim().toLowerCase()}(e),{ruleText:n,until:s,hasUntil:r}=function(e){const t=e.match(/\s+(?:until|直到)\s+(.+)$/i);if(!t||void 0===t.index)return{ruleText:e,hasUntil:!1};const n=function(e){const t=e.trim().replace(/\s+/g," ");let n=t.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(n)return dd(Number(n[1]),Number(n[2]),Number(n[3]));if(n=t.match(/^(\d{4})\/(\d{1,2})\/(\d{1,2})$/),n)return dd(Number(n[1]),Number(n[2]),Number(n[3]));if(n=t.match(/^([a-z]+\.?)\s+(\d{1,2})(?:st|nd|rd|th)?,?\s+(\d{4})$/i),n){const e=pd(n[1]);return e?dd(Number(n[3]),e,Number(n[2])):void 0}if(n=t.match(/^(\d{1,2})(?:st|nd|rd|th)?\s+([a-z]+\.?),?\s+(\d{4})$/i),n){const e=pd(n[2]);return e?dd(Number(n[3]),e,Number(n[1])):void 0}return n=t.match(/^(\d{4})\s*年\s*(\d{1,2})\s*月\s*(\d{1,2})\s*日?$/),n?dd(Number(n[1]),Number(n[2]),Number(n[3])):void 0}(t[1]);return n?{ruleText:e.slice(0,t.index).trim(),until:`UNTIL=${n}`,hasUntil:!0}:{ruleText:e,hasUntil:!0}}(t);if(!n)return;if(r&&!s)return;if("daily"===n||"every day"===n)return ud("DAILY",void 0,s);let i=n.match(/^every\s+(\d+)\s+days?$/);if(i)return ud("DAILY",Number(i[1]),s);if(i=n.match(/^每\s*(\d+)?\s*天$/),i)return ud("DAILY",Number(i[1]??"1"),s);if("weekly"===n||"every week"===n)return ud("WEEKLY",void 0,s);if(i=n.match(/^every\s+(\d+)\s+weeks?$/),i)return ud("WEEKLY",Number(i[1]),s);if(i=n.match(/^every\s+(?:(\d+)\s+)?weeks?\s+on\s+(.+)$/),i){const e=function(e){const t=e.split(/\s*(?:,|and|&)\s*/i).map(e=>ld[e.trim().toLowerCase()]).filter(Boolean);return t.length>0?`BYDAY=${Array.from(new Set(t)).join(",")}`:void 0}(i[2]);return ud("WEEKLY",Number(i[1]??"1"),[e,s].filter(Boolean))}return i=n.match(/^每\s*(\d+)?\s*[周週]$/),i?ud("WEEKLY",Number(i[1]??"1"),s):"monthly"===n||"every month"===n?ud("MONTHLY",void 0,s):(i=n.match(/^every\s+(\d+)\s+months?$/),i?ud("MONTHLY",Number(i[1]),s):(i=n.match(/^每\s*(\d+)?\s*(?:个)?月$/),i?ud("MONTHLY",Number(i[1]??"1"),s):"quarterly"===n||"every quarter"===n?ud("MONTHLY",3,s):(i=n.match(/^every\s+(\d+)\s+quarters?$/),i?ud("MONTHLY",3*Number(i[1]),s):(i=n.match(/^每\s*(\d+)?\s*(?:个)?(?:季|季度)$/),i?ud("MONTHLY",3*Number(i[1]??"1"),s):"yearly"===n||"annually"===n||"every year"===n?ud("YEARLY",void 0,s):(i=n.match(/^every\s+(\d+)\s+years?$/),i?ud("YEARLY",Number(i[1]),s):(i=n.match(/^每\s*(\d+)?\s*年$/),i?ud("YEARLY",Number(i[1]??"1"),s):void 0))))))}(e),t)}(n,l);if(!c)return;const u=o??l;return function(e,t,n){const s=sh(t),r=sh(n);if(!s||!r)return e;const i=function(e,t){const n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),s=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.round((n-s)/864e5)}(r,s);return e.replace(Xf,(e,t,n)=>{const s=sh(n);return s?`${t} ${function(e){return`${String(e.getUTCFullYear()).padStart(4,"0")}-${String(e.getUTCMonth()+1).padStart(2,"0")}-${String(e.getUTCDate()).padStart(2,"0")}`}(function(e,t){const n=new Date(e.getTime());return n.setUTCDate(n.getUTCDate()+t),n}(s,i))}`:e})}(function(e){return th(e.replace(Yf,"").trimEnd())}(rh(r,i,a," ",t)),u,c)}function lh(e,t,n){const s=e.match(qf);if(s){const[,e,r,i]=s,a=id(r,t),o=rd(a,t),l=rh(e,r,i,a,t);return{line:ih(l,o.done&&!rd(r,t).done?oh(l,t):void 0,n),status:o.marker}}const r=e.match(Hf);return r?{line:th(`${r[1]}[ ] ${r[2]}`),status:" "}:null}function ch(e,t,n){const s=e.match(qf);if(s){const[,e,r,i]=s,a=function(e,t){const n=rd(e,t),s=rd(id(e,t),t);return n.terminal&&" "===s.marker?{kind:"bullet"}:{kind:"task",marker:s.marker}}(r,t);if("bullet"===a.kind)return{line:ah(e,r,i,t),status:null};const o=rd(a.marker,t),l=rh(e,r,i,a.marker,t);return{line:ih(l,o.done&&!rd(r,t).done?oh(l,t):void 0,n),status:o.marker}}const r=e.match(Hf);return r?{line:th(`${r[1]}[ ] ${r[2]}`),status:" "}:null}function uh(e,t,n){const s=e.match(qf);if("bullet"===t&&s){const[,e,t,r]=s;return ah(e,t,r,n)}const r=e.match(Hf);return"task"===t&&r&&!s?th(`${r[1]}[ ] ${r[2]}`):null}function dh(e){return e.replace(/\\+([{}])/g,"$1")}const ph=/^!\[((?:\\.|[^\]])*)\]\(([\s\S]+)\)$/,fh=/^\[((?:\\.|[^\]])+)\]\(([\s\S]+)\)$/,hh=/^(`+)([\s\S]*)\1$/,mh=/^\$([^$\n](?:\\.|[^$\n])*)\$$/,gh=/^(?:(.*)\|)?(\d+)(?:x\d+)?$/u;function yh(e,t,n){const s=dh(e),r=t?`#${dh(t)}`:"",i=n?dh(n):null;return i?`[[${s}${r}|${i}]]`:`[[${s}${r}]]`}function kh(e){return`#${e}`}function wh(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function bh(e){const t=e.trim();if(!t)return null;let n="",s="";if(t.startsWith("<")){const e=t.indexOf(">");if(e<=0)return null;n=t.slice(1,e),s=t.slice(e+1).trim()}else{const e=t.match(/^(\S+)(?:\s+([\s\S]+))?$/);if(!e)return null;n=e[1],s=(e[2]??"").trim()}if(!s)return{destination:n,title:""};const r=s.match(/^"((?:\\.|[^"\\])*)"$/)??s.match(/^'((?:\\.|[^'\\])*)'$/);if(r)return{destination:n,title:r[1].replace(/\\(["'\\])/g,"$1")};const i=s.match(/^\(([\s\S]*)\)$/);return i?{destination:n,title:i[1]}:null}function vh(e,t="",n=""){return`}"`:""})`}function Sh(e){const t=e.match(gh);if(!t)return{alt:e,width:null};const n=Number.parseInt(t[2],10);return Number.isFinite(n)&&n>0?{alt:t[1]??"",width:n}:{alt:e,width:null}}function xh(e,t){const n=Oh(e),s=Math.round(t);if(!n||!Number.isFinite(s)||s<=0)return null;const r=Sh(n.attrs.alt).alt;return vh(n.attrs.src,`${r}|${s}`,n.attrs.title)}function Ch(e,t,n){return`[${e}](${t}${n?` "${wh(n)}"`:""})`}function Th(e){const t=e.match(/`+/g)??[],n=Math.max(1,...t.map(e=>e.length+1)),s="`".repeat(n);return`${s}${e.startsWith("`")||e.endsWith("`")?` ${e} `:e}${s}`}function Oh(e){const t=e.trim().match(ph);if(!t)return null;const n=bh(t[2]);if(!n)return null;const s=Sh(t[1]);return{kind:"image",raw:e.trim(),attrs:{alt:t[1],src:n.destination,title:n.title},previewText:s.alt||n.destination}}function Dh(e){const t=e.trim();if(t.startsWith("!"))return null;const n=t.match(fh);if(!n)return null;const s=bh(n[2]);return s?{kind:"link",raw:t,attrs:{text:n[1],href:s.destination,title:s.title||null},previewText:n[1]}:null}function Mh(e){const t=e.trim(),n=t.match(hh);if(!n)return null;let s=n[2];return s.startsWith(" ")&&s.endsWith(" ")&&/`/.test(s)&&(s=s.slice(1,-1)),{kind:"inlineCode",raw:t,attrs:{text:s},previewText:s}}function Ah(e){const t=e.trim();if(!t)return null;const n=nu(t);if(n)return n.embed?{kind:"wikiembedding",raw:t,attrs:{target:n.target,hash:n.hash??"",alias:n.alias??""},previewText:`![[${n.hash?`${n.target}#${n.hash}`:n.target}]]`}:{kind:"wikilink",raw:t,attrs:{target:n.target,hash:n.hash??"",alias:n.alias??null},previewText:iu(n.target,n.hash,n.alias)};if(t.startsWith("#")&&Fu(t.slice(1))){const e=t.slice(1);return{kind:"tag",raw:t,attrs:{tag:e},previewText:t}}const s=Oh(t);if(s)return s;const r=Dh(t);if(r)return r;const i=Mh(t);if(i)return i;const a=function(e){const t=e.trim(),n=t.match(mh);return n?{kind:"math_inline",raw:t,attrs:{value:n[1]},previewText:n[1]}:null}(t);return a||null}function Nh(e,t){const n=Ah(t);return n?.kind===e?n:null}function Eh(e){if("image"===e.type.name){const t=e.textContent;return t&&(Oh(t)||t!==String(e.attrs.alt??""))?t:vh(String(e.attrs.src??""),String(e.attrs.alt??""),String(e.attrs.title??""))}return"math_inline"===e.type.name?function(e){return`$${e}$`}(String(e.attrs.value??"")):e.textContent?e.textContent:"tag"===e.type.name?kh(String(e.attrs.tag??"")):"wikilink"===e.type.name?yh(String(e.attrs.target??""),String(e.attrs.hash??""),null==e.attrs.alias?null:String(e.attrs.alias)):"wikiembedding"===e.type.name?lu(String(e.attrs.target??""),String(e.attrs.hash??""),String(e.attrs.alias??"")):""}function Ih(e){const t=e.type.name;return"tag"===t||"wikilink"===t||"wikiembedding"===t||"image"===t||"math_inline"===t?t:null}function Rh(e){const t=Eh(e),n=Nh(Ih(e)??"tag",t);if(n)return n.previewText;if("wikilink"===e.type.name)return iu(String(e.attrs.target??""),String(e.attrs.hash??""),null==e.attrs.alias?null:String(e.attrs.alias));if("wikiembedding"===e.type.name){const t=String(e.attrs.target??""),n=String(e.attrs.hash??"");return`![[${n?`${t}#${n}`:t}]]`}return t}function Lh(e,t){const n=Nh(e.name,t);if(!n)return null;const s=e.schema.text(n.raw),r=Ve.from(s);return e.validContent(r)?e.create(n.attrs,r):e.create(n.attrs)}const Ph=new Set(["tag","wikilink","wikiembedding","image"]),$h=/[\u3400-\u9FFF\uF900-\uFAFF]/u;function Vh({view:e,imeComposing:t,imeInputEndedAt:n,now:s=Date.now()}){if(e&&function(e){return Boolean(e.composing)}(e)||t)return 240;if(n<=0)return 0;const r=1200-(s-n);return r>0?r+40:0}const Bh=/#|\[\[|!\[\[|!\[|\]\(|\]\]|`/u;let Fh=-1,zh=-1;function Wh(){Fh=-1,zh=-1}function jh(e){return Bh.test(e)}function _h(e){const t=e?.type.name;return"tag"===t||"wikilink"===t||"wikiembedding"===t||"image"===t}function Uh(e){return e.isText&&e.marks.some(e=>"inlineCode"===e.type.name)}function Kh(e,t){const n=Math.min(Math.max(0,t),e.content.size);try{const t=e.resolve(n);return t.parent.isTextblock?t.parent.textBetween(0,t.parent.content.size,void 0,""):""}catch{return""}}const qh=new es("inline-edit"),Hh="function"==typeof requestIdleCallback?requestIdleCallback:(e,t)=>setTimeout(()=>e(null),t?.timeout??0),Yh="function"==typeof cancelIdleCallback?cancelIdleCallback:clearTimeout;function Jh(e){const t=t=>{(function(e,t){if(0!==t.button||t.shiftKey||t.metaKey||t.ctrlKey||t.altKey)return!1;const n=t.target instanceof HTMLElement?t.target:null;if(!n||!e.editable||!e.dom.contains(n))return!1;for(const s of e.dom.querySelectorAll(".inline-source-image-preview img, .wiki-embedding-image img")){if(!n.contains(s))continue;const r=s.getBoundingClientRect();if(!r.width||t.clientX<=r.right||t.clientY<r.top||t.clientY>r.bottom)continue;const i=s.closest(".inline-source-image, .wiki-embedding-nodeview");if(!i?.parentNode)continue;const a=Array.prototype.indexOf.call(i.parentNode.childNodes,i)+1,o=e.posAtDOM(i.parentNode,a);if(e.state.doc.resolve(o).parent.isTextblock)return t.preventDefault(),e.dispatch(e.state.tr.setSelection($n.create(e.state.doc,o))),e.focus(),!0}return!1})(e,t)&&t.stopPropagation()};return e.dom.addEventListener("mousedown",t,!0),()=>e.dom.removeEventListener("mousedown",t,!0)}function Gh(e){return e.replace(/\r\n?/g,"\n")}Cc(()=>{let e=!1,t=!1,n=!1,s=0,r=null,i=null,a=null,o=null;function l(){s=Date.now()}function c(r,i=200){a&&clearTimeout(a),o&&(Yh(o),o=null),a=setTimeout(()=>{a=null;const i=Vh({view:r,imeComposing:n,imeInputEndedAt:s});i>0||Re(r)?c(r,i>0?i:240):o=Hh(()=>{o=null;const i=Vh({view:r,imeComposing:n,imeInputEndedAt:s});if(i>0||Re(r))return void c(r,i>0?i:240);const a=!function(e){if("function"==typeof e.hasFocus&&e.hasFocus())return!0;if("undefined"==typeof document)return!1;const t=document.activeElement;return Boolean(t&&e.dom.contains(t))}(r),l=function(e){const{state:t}=e,{doc:n,schema:s}=t,r=s.nodes.wikiembedding;if(!r)return!1;const i=[];if(n.descendants((e,t)=>{if(e.isTextblock)for(let n=0;n<e.childCount-1;n++){const s=e.child(n),r=e.child(n+1);if(s.isText&&s.text?.endsWith("!")&&"wikilink"===r.type.name){let a=0;for(let t=0;t<n;t++)a+=e.child(t).nodeSize;const o=t+1+a+s.nodeSize-1,l=o+1+r.nodeSize;i.push({from:o,to:l,target:r.attrs.target||"",hash:"",alias:r.attrs.alias||""})}}}),0===i.length)return!1;const a=t.tr;for(let o=i.length-1;o>=0;o--){const{from:e,to:t,target:n,hash:s,alias:l}=i[o],c=Lh(r,lu(n,s,l));c&&a.replaceWith(e,t,c)}return e.dispatch(a),!0}(r),u=function(e,t={}){const{state:n}=e,{doc:s,selection:r,schema:i}=n,a=r.from,o=i.nodes.tag,l=t.allowCursorAtRightBoundary??!1;if(!o)return!1;let c=!1;const u=n.tr,d=[];s.descendants((e,t,n)=>{if(e.isText&&_h(n))return!1;if(Uh(e))return!1;if(!e.isText||!e.text)return;const s=e.text;for(const r of Ku(s)){const e=r.fullMatch,n=r.value,i=t+r.index,o=i+e.length;if(a>=i&&(a<o||!l&&a===o))continue;if(-1!==Fh&&i>=Fh&&o<=zh)continue;const c=s.substring(0,r.index);c.lastIndexOf("[[")>c.lastIndexOf("]]")||d.push({from:i,to:o,tagValue:n})}});for(let p=d.length-1;p>=0;p--){const{from:e,to:t,tagValue:n}=d[p];if(u.doc.textBetween(e,t,void 0,"")===`#${n}`){const s=Lh(o,kh(n));if(!s)continue;u.replaceWith(e,t,s),c=!0}}return c&&e.dispatch(u),c}(r,{allowCursorAtRightBoundary:a}),d=function(e){const{state:t}=e,{doc:n,selection:s,schema:r}=t,i=s.from,a=r.nodes.wikiembedding;if(!a)return!1;const o=[];if(n.descendants((e,t,n)=>{if(e.isText&&_h(n))return!1;if(Uh(e))return!1;if(!e.isText||!e.text)return;const s=e.text,r=/!\[\[([^\]|#]+)(?:#([^\]|]+))?(?:\|([^\]]+))?\]\]/g;let a;for(;null!==(a=r.exec(s));){const e=a[0],n=a[1],s=a[2]||"",r=a[3]||"",l=t+a.index,c=l+e.length;i>=l&&i<c||o.push({from:l,to:c,target:n,hash:s,alias:r})}}),0===o.length)return!1;const l=t.tr;let c=!1;for(let u=o.length-1;u>=0;u--){const{from:e,to:t,target:n,hash:s,alias:r}=o[u],i=Lh(a,lu(n,s,r));i&&(l.replaceWith(e,t,i),c=!0)}return c&&e.dispatch(l),c}(r),p=function(e){const{state:t}=e,{doc:n,selection:s,schema:r}=t,i=s.from,a=r.nodes.wikilink;if(!a)return!1;const o=[];if(n.descendants((e,t,n)=>{if(e.isText&&_h(n))return!1;if(Uh(e))return!1;if(!e.isText||!e.text)return;const s=e.text,r=new RegExp("(?<!!)\\[\\[([^\\]|]+)(?:\\|([^\\]]+))?\\]\\]","g");let a;for(;null!==(a=r.exec(s));){const e=a[0],n=a[1],s=a[2]||null,r=t+a.index,l=r+e.length;i>=r&&i<l||o.push({from:r,to:l,target:n,alias:s})}}),0===o.length)return!1;const l=t.tr;let c=!1;for(let u=o.length-1;u>=0;u--){const{from:e,to:t,target:n,alias:s}=o[u];if(l.doc.textBetween(e,t,void 0,"")===(s?`[[${n}|${s}]]`:`[[${n}]]`)){const r=Lh(a,yh(n,"",s));if(!r)continue;l.replaceWith(e,t,r),c=!0}}return c&&e.dispatch(l),c}(r),f=function(e){const{state:t}=e,{doc:n,selection:s,schema:r}=t,i=s.from,a=r.marks.inlineCode;if(!a)return!1;const o=[];if(n.descendants((e,t,n)=>{if(e.isText&&_h(n))return!1;if(Uh(e))return!1;if(!e.isText||!e.text)return;const s=function(e){const t=[];let n=0;for(;n<e.length;){if("`"!==e[n]){n+=1;continue}let s=n+1;for(;"`"===e[s];)s+=1;const r=e.slice(n,s),i=e.indexOf(r,s);if(i<0)break;const a=e.slice(n,i+r.length),o=Mh(a);o&&t.push({index:n,raw:a,code:o.attrs.text}),n=i+r.length}return t}(e.text);for(const r of s){const e=t+r.index,n=e+r.raw.length;i>=e&&i<n||o.push({from:e,to:n,code:r.code})}}),0===o.length)return!1;const l=t.tr;let c=!1;for(let u=o.length-1;u>=0;u--){const{from:e,to:t,code:n}=o[u];l.replaceWith(e,t,r.text(n,[a.create()])),c=!0}return c&&e.dispatch(l),c}(r),h=function(e){const{state:t}=e,{doc:n,selection:s,schema:r}=t,i=s.from,a=r.nodes.image;if(!a)return!1;const o=[];if(n.descendants((e,t,n)=>{if(e.isText&&_h(n))return!1;if(Uh(e))return!1;if(!e.isText||!e.text)return;const s=e.text,r=/!\[((?:\\.|[^\]])*)\]\(([^)]+)\)/g;let a;for(;null!==(a=r.exec(s));){if("["===s[a.index+1]&&"["===s[a.index+2])continue;const e=a[0],n=Oh(e);if(!n)continue;const r=t+a.index,l=r+e.length;i>=r&&i<l||o.push({from:r,to:l,alt:n.attrs.alt,src:n.attrs.src,title:n.attrs.title})}}),0===o.length)return!1;const l=t.tr;let c=!1;for(let u=o.length-1;u>=0;u--){const{from:e,to:t,alt:n,src:s,title:r}=o[u],i=Lh(a,vh(s,n,r));i&&(l.replaceWith(e,t,i),c=!0)}return c&&e.dispatch(l),c}(r),m=function(e){const{state:t}=e,{doc:n,selection:s,schema:r}=t,i=s.from,a=r.marks.link;if(!a)return!1;const o=[];if(n.descendants((e,t,n)=>{if(e.isText&&_h(n))return!1;if(Uh(e))return!1;if(!e.isText||!e.text)return;if(e.marks.some(e=>"link"===e.type.name))return;const s=e.text,r=new RegExp("(?<!!)\\[((?:\\\\.|[^\\]])+)\\]\\(([^)]+)\\)","g");let a;for(;null!==(a=r.exec(s));){const e=a[0],n=Dh(e);if(!n)continue;const r=t+a.index,l=r+e.length;i>=r&&i<l||s.substring(0,a.index).endsWith("[")||o.push({from:r,to:l,text:n.attrs.text,href:n.attrs.href,title:n.attrs.title})}}),0===o.length)return!1;const l=t.tr;let c=!1;for(let u=o.length-1;u>=0;u--){const{from:e,to:t,text:n,href:s,title:i}=o[u],d=a.create({href:s,title:i}),p=r.text(n,[d]);l.replaceWith(e,t,p),c=!0}return c&&e.dispatch(l),c}(r);if(!(l||u||d||p||f||h||m))return e=!1,void(t=!1);e=!1,t=!1},{timeout:500})},i)}return new Qn({key:qh,props:{handleKeyDown(t,n){const s=function(e,t){return!Re(e)&&("Backspace"!==t.key||t.metaKey||t.ctrlKey||t.altKey?("Backspace"!==t.key&&Wh(),!(" "!==t.key||t.metaKey||t.ctrlKey||t.altKey||!function(e){const{state:t}=e,{selection:n}=t;if(!n.empty)return!1;const s=n.$from;if(3!==s.parentOffset)return!1;const r=s.parent;if(!r.isTextblock)return!1;const i=r.textBetween(0,3,void 0,"").match(/^\[([^\]\r\n])\]$/);if(!i)return!1;let a=null,o=-1;for(let d=s.depth;d>=1;d--){const e=s.node(d);if("list_item"===e.type.name){if(null!==e.attrs.checked&&void 0!==e.attrs.checked)return!1;a=e,o=s.before(d);break}}if(!a)return!1;const l=Gu(i[1])??!1,c=o+2,u=t.tr;u.setNodeMarkup(o,void 0,{...a.attrs,checked:l}),u.delete(c,c+3);try{u.setSelection($n.create(u.doc,c))}catch{}return e.dispatch(u),!0}(e))):function(e){const t=function(e){const{state:t}=e,{selection:n}=t;if(!n.empty)return null;const s=n.$from,r=s.parentOffset;if(0===r)return null;const i=s.parent;let a=0;for(let o=0;o<i.childCount;o++){const e=i.child(o),t=a+e.nodeSize;if(t===r&&Ph.has(e.type.name))return{node:e,pos:s.pos-s.parentOffset+a};a=t}return null}(e);if(t){const{node:n,pos:s}=t,{withBackspace:r}=function(e){const t=e.type.name;if("tag"===t){const t=Eh(e);return{full:t,withBackspace:t.slice(0,-1)}}if("wikilink"===t){const t=Eh(e).slice(0,-2);return{full:t,withBackspace:t}}if("wikiembedding"===t){const t=Eh(e).slice(0,-2);return{full:t,withBackspace:t}}if("image"===t){const t=Eh(e).slice(0,-1);return{full:t,withBackspace:t}}return{full:"",withBackspace:""}}(n);if(0===r.length){"tag"===n.type.name&&(Fh=-1,zh=-1);const t=e.state.tr.delete(s,s+n.nodeSize);return e.dispatch(t),!0}"tag"===n.type.name&&(Fh=s,zh=s+r.length);const i=e.state.tr;i.replaceWith(s,s+n.nodeSize,e.state.schema.text(r));const a=s+r.length;return i.setSelection($n.create(i.doc,a)),e.dispatch(i),!0}const n=function(e){const{state:t}=e,{selection:n}=t;if(!n.empty)return null;const s=n.$from,r=s.parent,i=s.parentOffset;if(0===i)return null;const a=r.childBefore(i);if(!a.node)return null;const o=a.node.marks.find(e=>"link"===e.type.name);if(!o)return null;const l=a.offset+a.node.nodeSize;if(i!==l)return null;const c=s.pos-i;let u=-1,d=-1,p=0;for(let f=0;f<r.childCount;f++){const e=r.child(f),t=p+e.nodeSize;if(e.marks.some(e=>e.eq(o)))-1===u&&(u=p),d=t;else{if(-1!==u&&t>l)break;-1!==u&&(u=-1,d=-1)}p=t}return-1===u||-1===d||i!==d?null:{from:c+u,to:c+d,text:r.textBetween(u,d,void 0,""),href:o.attrs.href||"",title:o.attrs.title??null}}(e);if(n){const{from:t,to:s,text:r,href:i,title:a}=n,o=Ch(r,i,a).slice(0,-1),l=e.state.tr;l.replaceWith(t,s,e.state.schema.text(o));const c=t+o.length;return l.setSelection($n.create(l.doc,c)),e.dispatch(l),!0}return!1}(e))}(t,n);return"Backspace"===n.key&&s&&(e=!0),s},handleDOMEvents:{beforeinput:(e,t)=>("undefined"!=typeof InputEvent&&t instanceof InputEvent&&(function(e){return!e.isComposing&&!e.inputType.startsWith("delete")&&"insertCompositionText"!==e.inputType&&e.inputType.startsWith("insert")}(t)&&Wh(),function(e){return Boolean(e.isComposing)||"insertCompositionText"===e.inputType||"deleteCompositionText"===e.inputType||"insertReplacementText"===e.inputType||"insertFromComposition"===e.inputType||Boolean(e.data&&$h.test(e.data))}(t)&&l()),!1),compositionstart:()=>(n=!0,s=0,!1),compositionend:()=>(n=!1,l(),!1),blur:n=>((e||t)&&c(n),!1)}},appendTransaction(e,t,n){const{selection:s}=n;if(!s.empty)return null;const r=s.$from,i=r.parent,a=r.parentOffset;if(0===a)return null;const o=i.childBefore(a);if(!o.node)return null;const l=o.node.marks.find(e=>"link"===e.type.name);if(!l)return null;if(a!==o.offset+o.node.nodeSize)return null;const c=i.childAfter(a);if(c.node?.marks.some(e=>e.eq(l)))return null;const u=n.storedMarks;if(null!==u&&!u.some(e=>"link"===e.type.name))return null;const d=u??r.marks();return n.tr.setStoredMarks(d.filter(e=>"link"!==e.type.name))},view:()=>({update(n){const s=n.state.selection.from,a=null!==i&&s!==i;null===r||n.state.doc.eq(r)||function(e,t){return jh(e)||jh(t)}(r&&null!==i?Kh(r,i):"",Kh(n.state.doc,s))&&(t=!0),function(e){return(e.hasDecomposedText||e.hasPendingInlineText)&&e.selectionMoved}({hasDecomposedText:e,hasPendingInlineText:t,selectionMoved:a})&&c(n),i=s,r=n.state.doc},destroy(){a&&clearTimeout(a),o&&Yh(o)}})})});const Qh="LifeOS",Zh="AinoFrontmatterSource",Xh="AinoCodeBlockSource",em="AinoMathBlockSource",tm="AinoTableSource";function nm(e){return"code_block"===e.type.name&&String(e.attrs.language??"")===Qh}function sm(e){return"code_block"===e.type.name&&String(e.attrs.language??"")===Zh}function rm(e){return"code_block"===e.type.name&&String(e.attrs.language??"")===Xh}function im(e){return"code_block"===e.type.name&&String(e.attrs.language??"")===em}function am(e){return"code_block"===e.type.name&&String(e.attrs.language??"")===tm}function om(e){return nm(e)||sm(e)||rm(e)||im(e)||am(e)}function lm(e){return"code_block"===e.type.name&&"latex"===String(e.attrs.language??"").toLowerCase()}function cm(e){return"lifeosBlock"===e.type.name?"lifeosBlock":"callout"===e.type.name?"callout":"blockquote"===e.type.name?"blockquote":"frontmatter"===e.type.name?"frontmatter":"table"===e.type.name?"table":lm(e)?"mathBlock":"code_block"!==e.type.name||om(e)?null:"codeBlock"}function um(e){return Gh(e).replace(/\|/g,"\\|").replace(/\n/g," ").trim()}function dm(e){return e.trim().replace(/\\([\\|])/g,"$1")}function pm(e,t){let n=0;for(let s=t-1;s>=0&&"\\"===e[s];s-=1)n+=1;return n%2==1}function fm(e,t,n){for(let s=n;s<=e.length-t.length;s+=1)if(e.startsWith(t,s)&&!pm(e,s))return s;return-1}function hm(e,t){const n=fm(e,"]",("!"===e[t]?t+1:t)+1);if(n<0||"("!==e[n+1])return-1;let s=1,r=null;for(let i=n+2;i<e.length;i+=1){const t=e[i];if(!pm(e,i))if(r)t===r&&(r=null);else if('"'!==t&&"'"!==t)if("("!==t){if(")"===t&&(s-=1,0===s))return i+1}else s+=1;else r=t}return-1}function mm(e,t,n,s){n&&e.push(t.text(n,s))}function gm(e,t){return t.addToSet(e)}function ym(e,t,n=[]){const s=[];let r="",i=0;const a=()=>{mm(s,e,r,n),r=""},o=t=>{const r=Ah(t);if(!r||"tag"===r.kind)return!1;if("link"===r.kind){const t=e.marks.link;if(!t)return!1;a();const i=gm(n,t.create({href:r.attrs.href,title:r.attrs.title}));return s.push(...ym(e,r.attrs.text,i)),!0}if("inlineCode"===r.kind){const t=e.marks.inlineCode;return!!t&&(a(),mm(s,e,r.attrs.text,gm(n,t.create())),!0)}const i=function(e,t,n){const s=e.nodes[t.kind];if(!s)return null;const r=e.text(t.raw,n),i=Ve.from(r);return s.validContent(i)?s.create(t.attrs,i,n):s.create(t.attrs,null,n)}(e,r,n);return!!i&&(a(),s.push(i),!0)};for(;i<t.length;){const l=t.slice(i);if(l.startsWith("`")){const e=l.match(/^`+/)?.[0]??"",n=e?fm(t,e,i+e.length):-1;if(n>=0&&o(t.slice(i,n+e.length))){i=n+e.length;continue}}if(l.startsWith("**")){const r=fm(t,"**",i+2);if(r>i+2){const o=e.marks.strong;if(o){a(),s.push(...ym(e,t.slice(i+2,r),gm(n,o.create()))),i=r+2;continue}}}if(l.startsWith("*")&&!l.startsWith("**")){const r=fm(t,"*",i+1);if(r>i+1){const o=e.marks.emphasis;if(o){a(),s.push(...ym(e,t.slice(i+1,r),gm(n,o.create()))),i=r+1;continue}}}if(l.startsWith("![[")||l.startsWith("[[")){const e=fm(t,"]]",i+(l.startsWith("!")?3:2));if(e>=0&&o(t.slice(i,e+2))){i=e+2;continue}}if(l.startsWith("![")||l.startsWith("[")){const e=hm(t,i);if(e>=0&&o(t.slice(i,e))){i=e;continue}}if(l.startsWith("$")&&!l.startsWith("$$")){const e=fm(t,"$",i+1);if(e>i+1&&o(t.slice(i,e+1))){i=e+1;continue}}if(l.startsWith("#")){const e=Ku(l)[0],t=0===e?.index?e.fullMatch:null;if(t&&o(t)){i+=t.length;continue}}r+=t[i],i+=1}return a(),s}function km(e){const t=[];return e.forEach(e=>{t.push(function(e){const t=[];return e.forEach(e=>{if(e.isText)return void t.push(function(e){let t=e.text??"";if(e.marks.find(e=>"inlineCode"===e.type.name))return Th(t);const n=e.marks.find(e=>"link"===e.type.name);return n&&(t=Ch(t,String(n.attrs.href??""),null==n.attrs.title?null:String(n.attrs.title))),e.marks.some(e=>"emphasis"===e.type.name)&&(t=`*${t}*`),e.marks.some(e=>"strong"===e.type.name)&&(t=`**${t}**`),t}(e));const n=Eh(e);t.push(n||e.textContent)}),t.join("")}(e))}),t.join(" ")}function wm(e){return`| ${e.join(" | ")} |`}function bm(e){const t=[];let n="",s=!1;const r=e.trim(),i=r.startsWith("|")?1:0,a=r.endsWith("|")?r.length-1:r.length;for(let o=i;o<a;o++){const e=r[o];s?(n+=`\\${e}`,s=!1):"\\"!==e?"|"!==e?n+=e:(t.push(dm(n)),n=""):s=!0}return s&&(n+="\\"),t.push(dm(n)),t}function vm(e){const t=e.trim();return/^:?-{3,}:?$/.test(t)?t.startsWith(":")&&t.endsWith(":")?"center":t.endsWith(":")?"right":"left":null}function Sm(e,t){const n=e.slice(0,t);for(;n.length<t;)n.push("");return n}function xm(e,t,n,s){const r=function(e,t){return Ve.fromArray(ym(e,t))}(e.schema,n),i=t.create(null,r.size>0?r:null);return e.create({alignment:s},i)}function Cm(e,t){if(nm(e)){const n=t.nodes.lifeosBlock;return n?n.create({value:e.textContent,lang:Qh},null,e.marks):null}return function(e,t){if(!sm(e))return null;const n=t.nodes.frontmatter;if(!n)return null;const s=function(e){const t=Gh(e).split("\n");let n=t.length-1;for(;n>0&&""===t[n];)n--;return"---"!==t[0]?.trim()||n<=0||"---"!==t[n]?.trim()?null:t.slice(1,n).join("\n")}(e.textContent);return null==s?null:n.create({value:s},null,e.marks)}(e,t)??function(e,t){if(!rm(e))return null;const n=t.nodes.code_block;if(!n)return null;const s=function(e){const t=Gh(e).split("\n"),n=t[0]?.match(/^(`{3,}|~{3,})(.*)$/);if(!n)return null;const s=n[1],r=s[0];let i=t.length-1;for(;i>0&&""===t[i];)i--;return i<=0||!function(e,t,n){const s=e.trim();return s.length>=n&&Array.from(s).every(e=>e===t)}(t[i],r,s.length)?null:{language:n[2].trim().split(/\s+/)[0],meta:n[2].trim().replace(/^\S+\s*/,"")||null,value:t.slice(1,i).join("\n")}}(e.textContent);if(!s)return null;const r=s.value?t.text(s.value):null;return n.create({language:s.language,meta:s.meta},r,e.marks)}(e,t)??function(e,t){if(!im(e))return null;const n=t.nodes.code_block;if(!n)return null;const s=function(e){const t=Gh(e).split("\n");let n=t.length-1;for(;n>0&&""===t[n];)n--;return"$$"!==t[0]?.trim()||n<=0||"$$"!==t[n]?.trim()?null:t.slice(1,n).join("\n")}(e.textContent);if(null==s)return null;const r=s?t.text(s):null;return n.create({language:"LaTeX"},r,e.marks)}(e,t)??function(e,t){if(!am(e))return null;const n=t.nodes.table,s=t.nodes.table_header_row,r=t.nodes.table_row,i=t.nodes.table_header,a=t.nodes.table_cell,o=t.nodes.paragraph;if(!(n&&s&&r&&i&&a&&o))return null;const l=function(e){const t=Gh(e).split("\n").map(e=>e.trim()).filter(Boolean);if(t.length<2)return null;const n=bm(t[0]),s=bm(t[1]).map(vm);if(0===n.length||0===s.length||s.some(e=>null==e))return null;const r=Math.max(n.length,s.length),i=Sm(n,r),a=Sm(s.map(e=>e??"left"),r),o=t.slice(2).map(e=>Sm(bm(e),r));return 0===o.length&&o.push(new Array(r).fill("")),{headers:i,alignments:a,rows:o}}(e.textContent);if(!l)return null;const c=s.create(null,l.headers.map((e,t)=>xm(i,o,e,l.alignments[t]??"left"))),u=l.rows.map(e=>r.create(null,e.map((e,t)=>xm(a,o,e,l.alignments[t]??"left"))));return n.create(null,[c,...u],e.marks)}(e,t)??function(e,t){const n=t.nodes.callout,s=t.nodes.paragraph;if(!n||!s||"blockquote"!==e.type.name)return null;const r=e.firstChild;if(!r||"paragraph"!==r.type.name)return null;const i=_c(r.textContent);if(!i)return null;const a=[];return e.content.forEach((e,t,n)=>{n>0&&a.push(e)}),0===a.length&&a.push(s.create()),n.create({kind:i.kind,title:r.textContent.slice(i.titleFrom),folded:i.fold?"collapsed"===i.fold:null},a,e.marks)}(e,t)}function Tm(e){return e.replace(/\r\n?/g,"\n")}function Om(e,t,n){const s=[];return e.doc.descendants((r,i)=>{const a=i,o=i+r.nodeSize;if(a<n&&t<o)return!1;const l=Cm(r,e.schema);return!l||(s.push({from:a,to:o,node:l}),!1)}),s}function Dm(e,t){for(let n=t.length-1;n>=0;n-=1){const s=t[n];e.replaceWith(e.mapping.map(s.from),e.mapping.map(s.to),s.node)}}function Mm(e,t){let n=null;return e.descendants((e,s)=>{if(n)return!1;const r=cm(e);if(!r)return!0;const i=s,a=i+e.nodeSize;return t<i||t>a||(n={node:e,from:i,to:a,kind:r},!1)}),n}function Am(e){const t=e.dom;t&&t.querySelectorAll(".milkdown-code-block").forEach(e=>{const t=e.querySelector(".language-button")?.textContent,n=function(e){const t=String(e??"").trim();return t===Zh||t===Xh||t===em||t===tm}(t),s=e.querySelector(".tools");if(n)return e.dataset.markdownSourceBlock="true",void(s&&(s.hidden=!0));delete e.dataset.markdownSourceBlock,s&&(s.hidden=!1)})}function Nm(e){const t=e.dom,n=t?.ownerDocument.defaultView;n?n.requestAnimationFrame(()=>Am(e)):Am(e)}function Em(e,t){return function(t,n){let{$from:s,$to:r,node:i}=t.selection;if(i&&i.isBlock||s.depth<2||!s.sameParent(r))return!1;let a=s.node(-1);if(a.type!=e)return!1;if(0==s.parent.content.size&&s.node(-1).childCount==s.indexAfter(-1)){if(3==s.depth||s.node(-3).type!=e||s.index(-2)!=s.node(-2).childCount-1)return!1;if(n){let r=Ve.empty,i=s.index(-1)?1:s.index(-2)?2:3;for(let e=s.depth-i;e>=s.depth-3;e--)r=Ve.from(s.node(e).copy(r));let a=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3;r=r.append(Ve.from(e.createAndFill()));let o=s.before(s.depth-(i-1)),l=t.tr.replace(o,s.after(-a),new _e(r,4-i,0)),c=-1;l.doc.nodesBetween(o,l.doc.content.size,(e,t)=>{if(c>-1)return!1;e.isTextblock&&0==e.content.size&&(c=t+1)}),c>-1&&l.setSelection(In.near(l.doc.resolve(c))),n(l.scrollIntoView())}return!0}let o=r.pos==s.end()?a.contentMatchAt(0).defaultType:null,l=t.tr.delete(s.pos,r.pos),c=o?[null,{type:o}]:void 0;return!!hn(l.doc,s.pos,2,c)&&(n&&n(l.split(s.pos,2,c).scrollIntoView()),!0)}}function Im(e){return function(t,n){let{$from:s,$to:r}=t.selection,i=s.blockRange(r,t=>t.childCount>0&&t.firstChild.type==e);return!!i&&(!n||(s.node(i.depth-1).type==e?function(e,t,n,s){let r=e.tr,i=s.end,a=s.$to.end(s.depth);i<a&&(r.step(new rn(i-1,a,i,a,new _e(Ve.from(n.create(null,s.parent.copy())),1,0),1,!0)),s=new it(r.doc.resolve(s.$from.pos),r.doc.resolve(a),s.depth));const o=cn(s);if(null==o)return!1;r.lift(s,o);let l=r.doc.resolve(r.mapping.map(i,-1)-1);return mn(r.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&r.join(l.pos),t(r.scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let s=e.tr,r=n.parent;for(let f=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)f-=r.child(h).nodeSize,s.delete(f-1,f+1);let i=s.doc.resolve(n.start),a=i.nodeAfter;if(s.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let o=0==n.startIndex,l=n.endIndex==r.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(o?0:1),u+1,a.content.append(l?Ve.empty:Ve.from(r))))return!1;let d=i.pos,p=d+a.nodeSize;return s.step(new rn(d-(o?1:0),p+(l?1:0),d+1,p-1,new _e((o?Ve.empty:Ve.from(r.copy(Ve.empty))).append(l?Ve.empty:Ve.from(r.copy(Ve.empty))),o?0:1,l?0:1),o?0:1)),t(s.scrollIntoView()),!0}(t,n,i)))}}function Rm(e){return function(t,n){let{$from:s,$to:r}=t.selection,i=s.blockRange(r,t=>t.childCount>0&&t.firstChild.type==e);if(!i)return!1;let a=i.startIndex;if(0==a)return!1;let o=i.parent,l=o.child(a-1);if(l.type!=e)return!1;if(n){let s=l.lastChild&&l.lastChild.type==o.type,r=Ve.from(s?e.create():null),a=new _e(Ve.from(e.create(null,Ve.from(o.type.create(null,r)))),s?3:1,0),c=i.start,u=i.end;n(t.tr.step(new rn(c-(s?3:1),u,c,u,a,1,!0)).scrollIntoView())}return!0}}const Lm=new Set(["tag","wikilink","wikiembedding","image","math_inline"]);function Pm(e){return Lm.has(e.type.name)}function $m(e){return"link"===e.type.name||"inlineCode"===e.type.name?e.type.name:null}function Vm(e,t,n){return"link"===e?Ch(t,String(n.attrs.href??""),null==n.attrs.title?null:String(n.attrs.title)):Th(t)}function Bm(e){const{selection:t}=e.state;if(!t.empty)return null;const n=t.$from;for(let s=n.depth;s>0;s--){const e=n.node(s),t=Ih(e);if(!t||!Pm(e))continue;const r=n.before(s);return{node:e,from:r,to:r+e.nodeSize,kind:t}}return null}function Fm(e,t){const{selection:n}=e.state;if(!n.empty)return null;const s=n.$from,r=s.parent,i=s.pos-s.parentOffset,a="after"===t?r.childAfter(s.parentOffset):r.childBefore(s.parentOffset),o=a.node;if(!o||!Pm(o))return null;const l=Ih(o);if(!l)return null;const c=i+a.offset;return{node:o,from:c,to:c+o.nodeSize,kind:l}}function zm(e,t,n){const s=Eh(t.node);if(!s)return!1;const r=e.state.schema.text(s),i=e.state.tr.replaceWith(t.from,t.to,r),a="end"===n?t.from+s.length:t.from;return i.setSelection($n.create(i.doc,a)),e.dispatch(i.scrollIntoView()),!0}function Wm(e,t,n){return"math_inline"===t.kind||"image"===t.kind&&t.node.textContent!==Eh(t.node)?zm(e,t,n):!!function(e,t,n){if(t.node.content.size<=0)return!1;const s="start"===n?t.from+1:t.to-1,r=e.state.tr.setSelection($n.create(e.state.doc,s));return e.dispatch(r.scrollIntoView()),!0}(e,t,n)||"image"===t.kind&&zm(e,t,n)}function jm(e,t){let n=null;return e.descendants((e,s)=>{if(n)return!1;if(!Pm(e))return!0;const r=s,i=r+e.nodeSize;if(t<r||t>i)return!0;const a=Ih(e);return!!a&&(n={node:e,from:r,to:i,kind:a},!1)}),n}function _m(e,t,n){if(!n)return null;let s=null,r=0;return e.descendants((e,i)=>{if(!Pm(e))return!0;const a=Ih(e);return!(a&&(!t||t===a)&&Eh(e)===n&&(r+=1,s={node:e,from:i,to:i+e.nodeSize,kind:a},1))}),1===r?s:null}function Um(e,t){return e.marks.some(e=>e.eq(t))}function Km(e,t){for(const n of e.marks){const e=$m(n);if(e&&(!t||t===e))return n}return null}function qm(e,t,n,s,r,i){let a=s,o=s+e.child(n).nodeSize;for(let l=n-1;l>=0;l--){const t=e.child(l);if(!Um(t,r))break;a-=t.nodeSize}for(let l=n+1;l<e.childCount;l++){const t=e.child(l);if(!Um(t,r))break;o+=t.nodeSize}return{from:t+a,to:t+o,kind:i,mark:r,raw:Vm(i,e.textBetween(a,o,void 0,""),r)}}function Hm(e,t,n){const s=Math.min(Math.max(0,t),e.doc.content.size),r=e.doc.resolve(s);for(let i=r.depth;i>0;i--){const e=r.node(i);if(!e.inlineContent)continue;const t=r.start(i),a=Math.min(Math.max(0,s-t),e.content.size),o=[e.childAfter(a),e.childBefore(a)];for(const s of o){if(!s.node)continue;const r=Km(s.node,n);if(!r)continue;const i=$m(r);if(i)return qm(e,t,s.index,s.offset,r,i)}}return null}function Ym(e,t){const{selection:n}=e.state;if(!n.empty)return null;const s=Hm(e.state,n.from);return s&&("after"===t&&s.from===n.from||"before"===t&&s.to===n.from)?s:null}function Jm(e,t,n){const s=e.state.schema.text(t.raw),r=e.state.tr.replaceWith(t.from,t.to,s),i="end"===n?t.from+t.raw.length:t.from;return r.setSelection($n.create(r.doc,i)),e.dispatch(r.scrollIntoView()),!0}const Gm='[data-inline-source-kind="wikilink"], [data-inline-source-kind="wikiembedding"]',Qm=`${Gm}, [data-type="math_inline"]`,Zm=new WeakMap;function Xm(e,t,n){const s=Bm(e);if(s?.kind===n&&(t===s.to-1||t===s.to))return s;const r=Fm(e,"before");if(r?.kind===n&&t===r.to)return r;const i=jm(e.state.doc,t);return i?.kind!==n||t!==i.to-1&&t!==i.to?null:i}function eg(e,t){const n=e.dom;if(!n?.ownerDocument||"function"!=typeof e.posAtDOM)return null;const s=n.ownerDocument.getSelection();if(!s?.isCollapsed||!s.anchorNode)return null;const r=s.anchorNode,i=n.ownerDocument.defaultView?.Element,a=i&&r instanceof i?r:r.parentElement??null,o=a?.closest?.("[data-inline-source-kind]"),l=a?.closest?.(".inline-source-source");if(!o||!n.contains(o))return null;const c=o.getAttribute("data-inline-source-kind");if(!c||!Lm.has(c)||t&&c!==t)return null;try{return{kind:c,pos:e.posAtDOM(r,s.anchorOffset),insideSourceContent:Boolean(l&&o.contains(l))}}catch{return null}}function tg(e,t){if("tag"!==t.kind&&"wikilink"!==t.kind)return!1;const n=Eh(t.node),s=Nh(t.kind,n);if(!s)return!1;const r=e.state.tr;return r.setNodeMarkup(t.from,void 0,s.attrs,t.node.marks),r.insertText(" ",t.to),r.setSelection($n.create(r.doc,t.to+1)),e.dispatch(r.scrollIntoView()),"tag"===t.kind&&Zm.delete(e),!0}function ng(e){const t=function(e){const t=e.dom;if(!t?.ownerDocument||"function"!=typeof e.posAtDOM)return null;const n=t.ownerDocument.getSelection(),s=n?.anchorNode;if(!n?.isCollapsed||!s||!t.contains(s))return null;const r=t.ownerDocument.defaultView?.Element,i=r&&s instanceof r?s:s.parentElement??null;let a=i?.closest?.(Gm)??null,o=!1;if(!a&&r&&s instanceof r&&n.anchorOffset>0){const e=s.childNodes.item(n.anchorOffset-1),t=e instanceof r?e:e?.parentElement??null;a=t?.closest?.(Qm)??null,o=Boolean(a)}if(!a||!t.contains(a))return null;const l=function(e){const t=e.getAttribute("data-inline-source-kind");return"wikilink"===t||"wikiembedding"===t?t:e.matches('[data-type="math_inline"]')?"math_inline":null}(a);return l?{anchorNode:s,anchorOffset:n.anchorOffset,element:a,kind:l,caretIsAfterElement:o}:null}(e);if(!t)return null;const{anchorNode:n,anchorOffset:s,caretIsAfterElement:r,element:i,kind:a}=t;try{if(!r){const t=e.posAtDOM(n,s),r=Xm(e,t,a);if(r)return r}const t=e.posAtDOM(i,0),o=jm(e.state.doc,t);if(o?.kind===a)return o}catch{}const o=i.getAttribute("data-inline-source-raw")??void 0;return"math_inline"===a?null:_m(e.state.doc,a,o)}function sg(e,t,n=t){if(t!==n)return!1;const s=Xm(e,t,"tag");if(s&&tg(e,s))return!0;const r=function(e){const t=eg(e,"tag");return t?.insideSourceContent?Xm(e,t.pos,"tag"):null}(e);return!(!r||!tg(e,r))||function(e){const t=Zm.get(e);if(!t)return!1;if(Date.now()-t.createdAt>1e3)return Zm.delete(e),!1;const n=e.state.doc.nodeAt(t.from);return n&&"tag"===Ih(n)&&Eh(n)===t.raw?tg(e,{node:n,from:t.from,to:t.from+n.nodeSize,kind:"tag"}):(Zm.delete(e),!1)}(e)}function rg(e,t,n=t){if(t!==n)return!1;const s=ng(e);if("wikilink"===s?.kind&&tg(e,s))return!0;const r=Xm(e,t,"wikilink");return!!r&&tg(e,r)}function ig(e){const t=ng(e);if(!t)return!1;e.state.selection.empty&&e.state.selection.from===t.to||e.dispatch(e.state.tr.setSelection($n.create(e.state.doc,t.to)));const n=e.state.selection.$from;for(let s=n.depth;s>0;s-=1){const t=n.node(s);if("list_item"===t.type.name){if(Em(t.type)(e.state,t=>e.dispatch(t)))return!0;break}}return Ps(e.state,t=>e.dispatch(t))}function ag(e,t={}){if((!t.blockKind||t.kind)&&function(e,t={}){let n=null,s=null;const r=function(e){return"link"===e||"inlineCode"===e}(t.kind)?t.kind:void 0;if("number"==typeof t.x&&"number"==typeof t.y){const i=e.posAtCoords({left:t.x,top:t.y});i&&(r?s=Hm(e.state,i.pos,r):n=jm(e.state.doc,i.pos))}return n||s||!r||(s=function(e,t,n){if(!n)return null;let s=null;const r=new Set;return e.descendants((e,i)=>{if(s)return!1;if(!e.inlineContent)return!0;const a=i+1;let o=0;for(let l=0;l<e.childCount;l++){const i=e.child(l),c=Km(i,t);if(!c){o+=i.nodeSize;continue}const u=$m(c);if(!u){o+=i.nodeSize;continue}const d=qm(e,a,l,o,c,u),p=`${d.kind}:${d.from}:${d.to}`;if(!r.has(p)&&(r.add(p),d.raw===n))return s=d,!1;o+=i.nodeSize}return!1}),s}(e.state.doc,r,t.raw)),n??(n=_m(e.state.doc,t.kind,t.raw)),n||s||t.raw||t.kind||(n=function(e){return Bm(e)??Fm(e,"after")??Fm(e,"before")}(e),s=Hm(e.state,e.state.selection.from)),s?Jm(e,s,t.side??"start"):!!n&&Wm(e,n,t.side??"start")}(e,t))return!0;let n=null;if("number"==typeof t.x&&"number"==typeof t.y){const s=e.posAtCoords({left:t.x,top:t.y});if(s){const r=Mm(e.state.doc,s.pos);(!t.blockKind||r?.kind===t.blockKind||"codeBlock"===t.blockKind&&"mathBlock"===r?.kind)&&(n=r)}}if(n??(n=function(e,t){if(!t.blockKind)return null;let n=null,s=0;return e.descendants((e,r)=>{const i=cm(e);if(i!==t.blockKind&&("codeBlock"!==t.blockKind||"mathBlock"!==i))return!0;if("callout"===t.blockKind){const n=String(e.attrs.kind??""),s=String(e.attrs.title??"");if(t.calloutKind&&n!==t.calloutKind)return!0;if(null!=t.calloutTitle&&s!==t.calloutTitle)return!0}return s+=1,n={node:e,from:r,to:r+e.nodeSize,kind:i},!1}),1===s?n:null}(e.state.doc,t)),n||null!=t.x||null!=t.y||(n=function(e){const{selection:t,doc:n}=e.state,s=t instanceof Bn?cm(t.node):null;if(t instanceof Bn&&s)return{node:t.node,from:t.from,to:t.to,kind:s};const r=t.$from;for(let i=r.depth;i>0;i--){const e=r.node(i),t=cm(e);if(!t)continue;const n=r.before(i);return{node:e,from:n,to:n+e.nodeSize,kind:t}}return Mm(n,t.from)}(e)),!n)return!1;!function(e){const t=e.dom,n=t?.ownerDocument.activeElement,s=t?.ownerDocument.defaultView?.HTMLElement;t&&s&&n instanceof s&&n!==t&&t.contains(n)&&"function"==typeof n.blur&&n.blur(),"function"==typeof e.focus&&e.focus()}(e);const s=function(e,t,n){return"lifeosBlock"===t.kind?function(e,t,n){const s=e.state.schema.nodes.code_block;if(!s)return!1;const r=String(t.node.attrs.value??""),i=r?e.state.schema.text(r):null,a=s.create({language:Qh},i),o=e.state.tr;Dm(o,Om(e.state,t.from,t.to));const l=o.mapping.map(t.from),c=o.mapping.map(t.to);o.replaceWith(l,c,a);const u=l+1+("end"===n?r.length:0);return o.setSelection($n.create(o.doc,u)),e.dispatch(o.scrollIntoView()),!0}(e,t,n):"callout"===t.kind?function(e,t,n){const s=e.state.schema.nodes.blockquote,r=e.state.schema.nodes.paragraph;if(!s||!r)return!1;const i=function(e){const t=String(e.attrs.kind||"info"),n=String(e.attrs.title||"");return`[!${t}]${!0===e.attrs.folded?"-":!1===e.attrs.folded?"+":""}${n?` ${n}`:""}`}(t.node),a=[r.create(null,e.state.schema.text(i))];t.node.content.forEach(e=>{a.push(e)});const o=s.create(null,a),l=e.state.tr;Dm(l,Om(e.state,t.from,t.to));const c=l.mapping.map(t.from),u=l.mapping.map(t.to);l.replaceWith(c,u,o);const d=c+2+("end"===n?i.length:0);return l.setSelection($n.create(l.doc,d)),e.dispatch(l.scrollIntoView()),!0}(e,t,n):"frontmatter"===t.kind?function(e,t,n){const s=e.state.schema.nodes.code_block;if(!s)return!1;const r=function(e){return`---\n${Tm(String(e.attrs.value??""))}\n---`}(t.node),i=s.create({language:Zh},e.state.schema.text(r)),a=e.state.tr;Dm(a,Om(e.state,t.from,t.to));const o=a.mapping.map(t.from),l=a.mapping.map(t.to);a.replaceWith(o,l,i);const c=o+1+("end"===n?r.length:0);return a.setSelection($n.create(a.doc,c)),e.dispatch(a.scrollIntoView()),!0}(e,t,n):"mathBlock"===t.kind?function(e,t,n){const s=e.state.schema.nodes.code_block;if(!s||!lm(t.node))return!1;const r=function(e){return`$$\n${Tm(e.textContent)}\n$$`}(t.node),i=s.create({language:em},e.state.schema.text(r)),a=e.state.tr;Dm(a,Om(e.state,t.from,t.to));const o=a.mapping.map(t.from),l=a.mapping.map(t.to);a.replaceWith(o,l,i);const c=o+1+("end"===n?r.length:0);return a.setSelection($n.create(a.doc,c)),e.dispatch(a.scrollIntoView()),!0}(e,t,n):"table"===t.kind?function(e,t,n){const s=e.state.schema.nodes.code_block;if(!s||"table"!==t.node.type.name)return!1;const r=function(e){const t=e.firstChild;if(!t)return"| |\n| --- |\n| |";const n=[],s=[];t.forEach(e=>{n.push(um(km(e))),s.push(function(e){return"center"===e?":---:":"right"===e?"---:":"---"}(function(e){return String(e?.attrs.alignment??"left").toLowerCase()}(e)))});const r=[wm(n),wm(s)];return e.forEach((e,t,n)=>{if(0===n)return;const s=[];e.forEach(e=>{s.push(um(km(e)))}),r.push(wm(s))}),r.join("\n")}(t.node),i=s.create({language:tm},e.state.schema.text(r)),a=e.state.tr;Dm(a,Om(e.state,t.from,t.to));const o=a.mapping.map(t.from),l=a.mapping.map(t.to);a.replaceWith(o,l,i);const c=o+1+("end"===n?r.length:0);return a.setSelection($n.create(a.doc,c)),e.dispatch(a.scrollIntoView()),!0}(e,t,n):"codeBlock"===t.kind?function(e,t,n){const s=e.state.schema.nodes.code_block;if(!s||"code_block"!==t.node.type.name||om(t.node))return!1;const r=function(e){const t=Tm(e.textContent);let n=3;for(const a of t.matchAll(/`+/g))n=Math.max(n,a[0].length+1);const s="`".repeat(n),r=String(e.attrs.language??"").trim(),i=e.attrs.meta?` ${e.attrs.meta}`:"";return`${r?`${s}${r}${i}`:s}\n${t}\n${s}`}(t.node),i=s.create({language:Xh},e.state.schema.text(r)),a=e.state.tr;Dm(a,Om(e.state,t.from,t.to));const o=a.mapping.map(t.from),l=a.mapping.map(t.to);a.replaceWith(o,l,i);const c=o+1+("end"===n?r.length:0);return a.setSelection($n.create(a.doc,c)),e.dispatch(a.scrollIntoView()),!0}(e,t,n):function(e,t,n){const s=e.state.tr;Dm(s,Om(e.state,t.from,t.to));const r=s.mapping.map(t.from),i=s.doc.nodeAt(r);if(!i||"blockquote"!==i.type.name)return!1;const a=i.firstChild;if(!a)return!1;const o=r+1,l="end"===n?Math.max(o+1,o+a.nodeSize-1):Math.min(o+1,o+a.nodeSize-1);return s.setSelection($n.create(s.doc,l)),e.dispatch(s.scrollIntoView()),!0}(e,t,n)}(e,n,t.side??"start");return s&&function(e){const t=e.dom,n=t?.ownerDocument.defaultView;if(!n||"code_block"!==e.state.selection.$from.parent.type.name)return;const{doc:s,selection:r}=e.state;n.requestAnimationFrame(()=>{!e.isDestroyed&&e.state.doc===s&&e.state.selection.eq(r)&&t.ownerDocument.activeElement===t&&e.focus()})}(e),s}function og(e,t){if(e.composing||t.isComposing||229===t.keyCode)return!1;if(t.metaKey||t.ctrlKey||t.altKey)return!1;if(!t.shiftKey&&("ArrowLeft"===t.key||"ArrowRight"===t.key)){const n=Bm(e);if(n&&("image"===n.kind||"wikiembedding"===n.kind)){const s="ArrowLeft"===t.key,r=s?n.from+1:n.to-1;if(e.state.selection.from===r)return e.dispatch(e.state.tr.setSelection($n.create(e.state.doc,s?n.from:n.to)).scrollIntoView()),!0}}if(("Backspace"===t.key||"Delete"===t.key)&&(function(e){const t=eg(e);if(!t?.insideSourceContent)return!1;const n=jm(e.state.doc,t.pos);if(!n||n.kind!==t.kind)return!1;const s=n.from+1,r=n.to-1;if(t.pos<s||t.pos>r)return!1;const i=e.state.selection;i.empty&&i.from===t.pos||e.dispatch(e.state.tr.setSelection($n.create(e.state.doc,t.pos)))}(e),function(e,t){const n=eg(e);if(!n||n.insideSourceContent)return!1;const s=jm(e.state.doc,n.pos);return!(!s||s.kind!==n.kind)&&Wm(e,s,"Backspace"===t?"end":"start")}(e,t.key)))return!0;if(function(e){return" "===e.key||"Space"===e.key||"Spacebar"===e.key||32===e.keyCode}(t))return sg(e,e.state.selection.from,e.state.selection.to)||rg(e,e.state.selection.from,e.state.selection.to);if(Zm.delete(e),"F2"===t.key)return ag(e,{side:"start"});if("Enter"===t.key&&ig(e))return!0;if("Enter"===t.key&&e.state.selection instanceof Bn)return ag(e,{side:"start"});if("Escape"===t.key){const t=Bm(e);if(!t)return!1;const n=e.state.tr.setSelection($n.create(e.state.doc,t.to));return e.dispatch(n.scrollIntoView()),!0}if(("Backspace"===t.key||"Delete"===t.key)&&function(e,t){const n=Bm(e);if(!n)return!1;const s=e.state.selection.from,r=n.from+1,i=n.to-1,a="Backspace"===t?s-1:s,o=a+1;if(a<r||o>i)return!1;const l=a===r&&o===i,c=l?e.state.tr.delete(n.from,n.to):e.state.tr.delete(a,o);return c.setSelection($n.create(c.doc,l?n.from:a)),e.dispatch(c.scrollIntoView()),!0}(e,t.key))return!0;if("ArrowRight"===t.key||"Delete"===t.key){const t=Fm(e,"after");if(t)return Wm(e,t,"start");const n=Ym(e,"after");if(n)return Jm(e,n,"start")}if("ArrowLeft"===t.key||"Backspace"===t.key){const t=Fm(e,"before");if(t){const n=Wm(e,t,"end");return n&&function(e,t){if("tag"!==t.kind)return void Zm.delete(e);const n=Eh(t.node);Nh("tag",n)?Zm.set(e,{from:t.from,raw:n,createdAt:Date.now()}):Zm.delete(e)}(e,t),n}const n=Ym(e,"before");if(n)return Jm(e,n,"end")}return!1}function lg(e,t){return!(e.composing||t.isComposing||229===t.keyCode||(function(e){const t=e.dom,n=t?.ownerDocument.getSelection(),s=n?.anchorNode;if(!(n?.isCollapsed&&s&&t.contains(s)&&e.state.selection.empty))return;const r=t.ownerDocument.defaultView?.Element;if(!(r&&s instanceof r))return;const i=n.anchorOffset,a=[s.childNodes[i-1],s.childNodes[i]];if(a[0]instanceof r&&a[0].classList.contains("ProseMirror-separator")&&a.push(s.childNodes[i-2]),a.some(e=>e instanceof r&&e.matches("[data-inline-source-kind]")))try{const t=e.posAtDOM(s,i);if(t===e.state.selection.from||!e.state.doc.resolve(t).parent.isTextblock)return;e.dispatch(e.state.tr.setSelection($n.create(e.state.doc,t)))}catch{}}(e),"Enter"!==t.key||t.metaKey||t.ctrlKey||t.altKey||!ig(e)||(t.preventDefault(),0)))}function cg(e,t,n,s){return!e.composing&&(" "!==s?(Zm.delete(e),!1):sg(e,t,n)||rg(e,t,n))}function ug(e){const t=document.createElement("wikilink"===e?"a":"span"),n=document.createElement("span"),s=document.createElement("span");return n.className="inline-source-preview",s.className="inline-source-source",t.append(n,s),{dom:t,contentDOM:s,update(r,i){if(r.type.name!==e)return!1;const a=function(e){return e.some(e=>Boolean(e.spec.inlineSourceActive))}(i);!function(e,t,n){const s=Eh(t),r=Nh(n,s);e.dataset.inlineSourceKind=n,e.dataset.inlineSourceRaw=s,"tag"===n?(e.dataset.tag="true",e.dataset.tagValue="tag"===r?.kind?r.attrs.tag:String(t.attrs.tag??"")):"wikilink"===n?(e.dataset.wikilink="true",e.dataset.wikilinkTarget="wikilink"===r?.kind?r.attrs.target:String(t.attrs.target??""),e.dataset.wikilinkHash="wikilink"===r?.kind?r.attrs.hash:String(t.attrs.hash??""),e.dataset.wikilinkAlias="wikilink"===r?.kind&&r.attrs.alias?r.attrs.alias:""):"image"===n&&(e.dataset.imageSrc="image"===r?.kind?r.attrs.src:String(t.attrs.src??""),e.dataset.imageAlt="image"===r?.kind?r.attrs.alt:String(t.attrs.alt??""),e.dataset.imageTitle="image"===r?.kind?r.attrs.title:String(t.attrs.title??""))}(t,r,e),t.className=`${e} inline-source-node${a?" inline-source-node-active":""}`;const o=a?"true":"false";return t.contentEditable!==o&&(t.contentEditable=o),n.textContent=Rh(r),n.style.display=a?"none":"",s.style.display=a?"":"none",!0},ignoreMutation:e=>!s.contains(e.target)}}const dg=/^(#\S+)(\s+)$/u;function pg(e){const{selection:t,doc:n}=e,s=t.$from;for(let r=s.depth;r>0;r--){const e=s.node(r);if(!Pm(e))continue;const i=s.before(r),a=i+e.nodeSize;if(!(t.to>=a))return Po.create(n,[Io.node(i,a,{class:"inline-source-active","data-inline-source-active":"true"},{inlineSourceActive:!0})])}return Po.empty}function fg(e,t){for(const n of[t,t-1])if(!(n<0||n>e.content.size))try{const t=e.resolve(n);for(let e=t.depth;e>0;e-=1){const n=t.node(e);if(n.isTextblock||gg(n))return{from:t.before(e),to:t.after(e)}}}catch{}return null}function hg(e,t,n){if(e.some(e=>e.docChanged&&!e.mapping))return null;if(e.some(e=>e.selectionSet)&&t.selection.eq(n.selection))return null;let s=0;for(const o of e)o.mapping?.maps.forEach(e=>{e.forEach((e,t,n,r)=>{s+=Math.max(t-e,r-n)})});if(s>4096)return null;let r=t.selection.from,i=t.selection.to;for(const o of e)o.mapping&&(r=o.mapping.map(r),i=o.mapping.map(i));const a=[];for(const o of[r,i,n.selection.from,n.selection.to]){const e=fg(n.doc,o);e&&!a.some(t=>t.from===e.from&&t.to===e.to)&&a.push(e)}return a}function mg(e,t,n){if(null!==t)for(const s of t)e.nodesBetween(s.from,s.to,n);else e.descendants(n)}function gg(e){return"blockquote"===e.type.name||om(e)}const yg="lifeos-markdown-image-resize-request";function kg(e,t){const n=Math.max(1,Math.round(t)),s=Math.min(160,n);return Math.min(Math.max(Math.round(e),s),n)}function wg(e,t,n){if("fit"===n)return kg(t,t);const s=e.getBoundingClientRect().width;return kg((e.naturalWidth||s/Math.max(n,.01))*n,t)}function bg(e){const t=e.ownerDocument??document,n=e.ownerWindow??window,s=t.body,r=s.style.cursor,i=s.style.userSelect;let a=kg(e.startWidth,e.maxWidth),o=!0;const l=()=>{t.removeEventListener("pointermove",u),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",c),n.removeEventListener("blur",c),s.classList.remove("markdown-image-resizing"),s.style.cursor=r,s.style.userSelect=i},c=()=>{o&&(o=!1,l(),e.onCommit(a))},u=t=>{o&&(t.preventDefault(),a=kg(e.startWidth+t.clientX-e.startX,e.maxWidth),e.onPreview(a))};return s.classList.add("markdown-image-resizing"),s.style.cursor="nwse-resize",s.style.userSelect="none",t.addEventListener("pointermove",u),t.addEventListener("pointerup",c),t.addEventListener("pointercancel",c),n.addEventListener("blur",c),()=>{o&&(o=!1,l())}}const vg=new es("inline-source-edit"),Sg=(Cc(()=>new Qn({key:vg,view:e=>(Nm(e),{destroy:Jh(e),update(e){Nm(e)}}),props:{decorations:pg,nodeViews:{tag:(e,t,n,s)=>{const r=ug("tag");return r.update?.(e,s,Po.empty),r},wikilink:(e,t,n,s)=>{const r=ug("wikilink");return r.update?.(e,s,Po.empty),r},image:(e,t,n,s)=>{const r=function(e,t){const n=document.createElement("span"),s=document.createElement("span"),r=document.createElement("img"),i=document.createElement("span"),a=document.createElement("button"),o=document.createElement("span");let l=null;s.className="inline-source-preview inline-source-image-preview markdown-image-resizable",i.className="inline-source-image-fallback",a.type="button",a.className="markdown-image-resize-handle",a.dataset.testid="markdown-image-resize-handle",a.setAttribute("aria-label","Resize image"),o.className="inline-source-source",s.contentEditable="false",s.append(r,i,a),n.append(s,o);const c=()=>(n.closest(".ProseMirror")??n.parentElement??e.dom).getBoundingClientRect().width||r.naturalWidth||r.getBoundingClientRect().width,u=e=>{n.classList.add("is-sized"),n.style.width=`${e}px`,n.style.maxWidth="100%",s.style.width="100%",r.style.width="100%",r.style.maxWidth="100%",r.style.height="auto"},d=n=>{const s=t();if("number"!=typeof s)return;const r=e.state.doc.nodeAt(s);if(!r||"image"!==r.type.name)return;const i=xh(Eh(r),n),a=i?Nh("image",i):null;if(!i||"image"!==a?.kind||i===Eh(r))return;const o=r.type.create({...r.attrs,...a.attrs},e.state.schema.text(i),r.marks);e.dispatch(e.state.tr.replaceWith(s,s+r.nodeSize,o))},p=e=>{(e=>{if(e.image!==r)return;const t=wg(r,c(),e.preset);u(t),d(t)})(e.detail)};return window.addEventListener(yg,p),a.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()}),a.addEventListener("keydown",e=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault(),e.stopPropagation();const t=kg((n.getBoundingClientRect().width||r.getBoundingClientRect().width)+("ArrowLeft"===e.key?-10:10),c());u(t),d(t)}),a.addEventListener("pointerdown",e=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation(),a.setPointerCapture?.(e.pointerId),l?.();const t=n.getBoundingClientRect().width||r.getBoundingClientRect().width;n.classList.add("is-resizing"),l=bg({startX:e.clientX,startWidth:t,maxWidth:c(),ownerDocument:n.ownerDocument,ownerWindow:n.ownerDocument.defaultView??window,onPreview:u,onCommit:e=>{n.classList.remove("is-resizing"),l=null,u(e),d(e)}})}),{dom:n,contentDOM:o,update(e,t){if("image"!==e.type.name)return!1;const a=function(e){return e.some(e=>Boolean(e.spec.inlineSourceActive))}(t),l=Eh(e),c=Nh("image",l),d="image"===c?.kind?c.attrs.src:String(e.attrs.src??""),p="image"===c?.kind?c.attrs.alt:String(e.attrs.alt??""),{alt:f,width:h}=Sh(p),m="image"===c?.kind?c.attrs.title:String(e.attrs.title??"");n.dataset.inlineSourceKind="image",n.dataset.inlineSourceRaw=l,n.dataset.imageSrc=d,n.dataset.imageAlt=p,n.dataset.imageTitle=m,n.className="image inline-source-node inline-source-image"+(a?" inline-source-node-active":"");const g=a?"true":"false";return n.contentEditable!==g&&(n.contentEditable=g),function(e,t){if(e.getAttribute("data-resolved-src")!==t&&e.getAttribute("src")!==t){for(const t of["data-resolved-src","data-source-url","data-preview-url","data-aino-image-visibility","width","height"])e.removeAttribute(t);e.onerror=null,e.setAttribute("src",t)}}(r,d),r.alt=f,r.title=m,i.textContent=f||d,r.style.display=d?"":"none",i.style.display=d?"none":"",s.style.display="",o.style.display=a?"":"none",null!==h?u(h):(n.classList.remove("is-sized"),n.style.removeProperty("width"),n.style.removeProperty("max-width"),s.style.removeProperty("width"),r.style.removeProperty("width"),r.style.removeProperty("height")),!0},ignoreMutation:e=>!o.contains(e.target),destroy(){l?.(),window.removeEventListener(yg,p)}}}(t,n);return r.update?.(e,s,Po.empty),r}},handleDOMEvents:{keydown:lg},handleKeyDown:og,handleTextInput:cg},appendTransaction:(e,t,n)=>function(e,t,n){if(!e.some(e=>e.docChanged||e.selectionSet))return null;const s=n.selection,r=[],i=[],a=hg(e,t,n);if(mg(n.doc,a,(e,t)=>{if(!Pm(e))return!0;const a=t,o=t+e.nodeSize,l=Eh(e);if("tag"===e.type.name){const t=l.match(dg);if(t&&Fu(t[1].slice(1))){const s=Nh("tag",t[1]);if(s)return r.push({from:a,to:o,node:[e.type.create(s.attrs,n.schema.text(s.raw),e.marks),n.schema.text(t[2])]}),!1}}if(s.from>a&&s.to<o)return!1;const c=Ah(l);if(!c)return r.push({from:a,to:o,node:n.schema.text(l)}),!1;if(c.kind!==e.type.name){const e=function(e,t){const n=e.nodes[t.kind];if(!n)return null;const s=e.text(t.raw),r=Ve.from(s);return n.validContent(r)?n.create(t.attrs,r):n.create(t.attrs)}(n.schema,c);return r.push({from:a,to:o,node:e??n.schema.text(l)}),!1}return function(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const s of n)if((e[s]??"")!==(t[s]??""))return!1;return!0}(e.attrs,c.attrs)||i.push({pos:t,node:e,attrs:c.attrs}),!1}),0===r.length&&0===i.length)return null;const o=n.tr;for(let l=r.length-1;l>=0;l--){const e=r[l];o.replaceWith(e.from,e.to,e.node)}for(let l=i.length-1;l>=0;l--){const e=i[l],t=o.mapping.map(e.pos),n=o.doc.nodeAt(t);n&&n.type===e.node.type&&o.setNodeMarkup(t,void 0,e.attrs,n.marks)}return o.doc.eq(n.doc)?null:o}(e,t,n)??function(e,t,n){if(!e.some(e=>e.docChanged||e.selectionSet))return null;const s=[],r=hg(e,t,n);if(mg(n.doc,r,(e,t)=>{if(function(e,t,n){const{selection:s}=e;return s.from>t&&s.to<n}(n,t,t+e.nodeSize))return!gg(e);const r=Cm(e,n.schema);return!r||(s.push({from:t,to:t+e.nodeSize,node:r}),!1)}),0===s.length)return null;const i=n.tr;for(let a=s.length-1;a>=0;a--){const e=s[a];i.replaceWith(e.from,e.to,e.node)}return i.doc.eq(n.doc)?null:i}(e,t,n)})),new es("line-boundary"));function xg(e,t){return null!==t&&(t===e||e.contains(t))}function Cg({nodeType:e,checked:t,parentListType:n,orderedIndex:s,headingLevel:r}){if("list_item"===e){const e=Qu(t);return null!=e?`- [${e}] `:"ordered_list"===n?`${s??1}. `:"- "}return"heading"===e?`${"#".repeat(r||1)} `:"blockquote"===e?"> ":""}Cc(()=>new Qn({key:Sg,props:{handleDOMEvents:{keydown:(e,t)=>function(e,t){if("Home"!==t.key&&"End"!==t.key)return!1;if(t.metaKey||t.ctrlKey||t.altKey||t.isComposing||e.composing||229===t.keyCode)return!1;if(!(e.state.selection instanceof $n&&e.state.selection.$head.parent.isTextblock))return!1;if(Re(e))return!1;!function(e){const t=e.dom.ownerDocument.getSelection();if(t&&xg(e.dom,t.anchorNode)&&xg(e.dom,t.focusNode))try{const n=e.posAtDOM(t.anchorNode,t.anchorOffset),s=e.posAtDOM(t.focusNode,t.focusOffset),{doc:r}=e.state;if(!r.resolve(n).parent.isTextblock||!r.resolve(s).parent.isTextblock)return;const i=$n.create(r,n,s);i.eq(e.state.selection)||e.dispatch(e.state.tr.setSelection(i).setMeta("addToHistory",!1))}catch{}}(e),t.preventDefault();const n="Home"===t.key?"backward":"forward";return function(e,t,n){const s=e.dom.ownerDocument.getSelection();if(!s||!function(e){return"function"==typeof e.modify}(s))return!1;if(!xg(e.dom,s.focusNode))return!1;const r=e.state.selection;try{n&&s.collapse(s.focusNode,s.focusOffset),s.modify("move",t,"lineboundary");const{focusNode:i,focusOffset:a}=s;if(!xg(e.dom,i))return!1;const o="backward"===t?1:-1,l=e.posAtDOM(i,a,o);if(e.state.doc.resolve(l).parent!==r.$head.parent)return!1;const c=n?r.anchor:l;return e.dispatch(e.state.tr.setSelection($n.create(e.state.doc,c,l)).scrollIntoView()),!0}catch{return!1}}(e,n,t.shiftKey)||function(e,t,n){const{state:s}=e,r=function(e,t){const n=e.start();let s=n,r=e.end();return e.parent.forEach((t,i)=>{"hard_break"!==t.type.name&&"hardbreak"!==t.type.name||(i<e.parentOffset?s=n+i+t.nodeSize:r===e.end()&&(r=n+i))}),"backward"===t?s:r}(s.selection.$head,t),i=n?s.selection.anchor:r;e.dispatch(s.tr.setSelection($n.create(s.doc,i,r)).scrollIntoView())}(e,n,t.shiftKey),!0}(e,t)}}}));const Tg=new es("line-operations");function Og(e){const{$from:t}=e.state.selection;for(let n=t.depth;n>=0;n--){const e=t.node(n);if("list_item"===e.type.name)return Cg({nodeType:e.type.name,checked:e.attrs.checked,parentListType:n>0?t.node(n-1).type.name:null,orderedIndex:n>0?t.index(n-1)+1:void 0});if("heading"===e.type.name)return Cg({nodeType:e.type.name,headingLevel:e.attrs.level});if("blockquote"===e.type.name)return Cg({nodeType:e.type.name})}return""}function Dg(e,t){if(e.isTextblock)return t+e.nodeSize-1;for(let n=e.childCount-1;n>=0;n--){const s=e.child(n);let r=t+1;for(let t=0;t<n;t++)r+=e.child(t).nodeSize;const i=Dg(s,r);if(null!=i)return i}return null}function Mg(e,t,n){const s=t.node(n),r=t.before(n),i=t.after(n),a=function(e){const t=[];for(let n=1;n<e.childCount;n++){const s=e.child(n);"bullet_list"!==s.type.name&&"ordered_list"!==s.type.name||s.forEach(e=>{"list_item"===e.type.name&&t.push(e)})}return t}(s);if(a.length>0)return{deleteFrom:r,deleteTo:i,replacement:Ve.fromArray(a),selectionPos:r+2};const o=n-1;if(o>=0){const n=t.node(o);if(("bullet_list"===n.type.name||"ordered_list"===n.type.name)&&1===n.childCount){const n=t.before(o);return{deleteFrom:n,deleteTo:t.after(o),replacement:e.schema.nodes.paragraph.create(),selectionPos:n+1}}const s=t.index(o);if(s>0){let e=t.start(o);for(let t=0;t<s;t++){const a=n.child(t),o=e;if(e+=a.nodeSize,t===s-1){const e=Dg(a,o);if(null!=e)return{deleteFrom:r,deleteTo:i,selectionPos:e,selectionBias:-1}}}}}return{deleteFrom:r,deleteTo:i}}function Ag(e,t){if(t.replacement?e.replaceWith(t.deleteFrom,t.deleteTo,t.replacement):e.delete(t.deleteFrom,t.deleteTo),null!=t.selectionPos)try{const n=e.mapping.map(t.selectionPos,t.selectionBias??1),s=Math.min(n,e.doc.content.size);e.setSelection($n.create(e.doc,s))}catch{try{e.setSelection($n.near(e.doc.resolve(Math.min(t.selectionPos,e.doc.content.size))))}catch{}}}function Ng(e){const{from:t}=e.state.selection,n=e.state.doc.resolve(t);for(let s=n.depth;s>=1;s--){const e=n.node(s);if("list_item"===e.type.name){const t=s+1;if(t<=n.depth){const r=n.node(t);if(r.isTextblock)return{listItemNode:e,listItemDepth:s,listItemPos:n.before(s),paragraphNode:r,paragraphDepth:t}}break}}return null}function Eg(e){const{selection:t}=e.state;if(!(t instanceof $n&&t.empty))return!1;const n=t.$from;let s=-1;for(let r=n.depth;r>=1;r--)if("list_item"===n.node(r).type.name){s=r;break}return!(s<0)&&n.depth===s+1&&0===n.index(s)&&(0===n.parentOffset||n.parent.isTextblock&&""===n.parent.textContent.trim()&&n.parentOffset===n.parent.content.size)}function Ig(e){const t=e.firstChild;return!(!t||!t.isTextblock)&&""===t.textContent.trim()}function Rg(e){for(let t=1;t<e.childCount;t++){const n=e.child(t);if("bullet_list"===n.type.name||"ordered_list"===n.type.name)return!0}return!1}function Lg(){const e=window.__lifeos_timestamp_config;return e?.enabled&&function(e,t,n="YYYY/[Daily]/MM/YYYY-MM-DD"){return!(!e||!t)&&function(e,t,n){if(!t)return!1;const s=function(e){return e.replace(/\\/g,"/").replace(/\/+$/g,"").replace(/\/{2,}/g,"/")}(t).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=function(e){const t=function(e){const t=[];let n=0,s="";const r=()=>{s&&(t.push({type:"literal",value:s}),s="")};for(;n<e.length;){if("["===e[n]){r();const i=e.indexOf("]",n+1);-1===i?(s+=e.slice(n),n=e.length):(t.push({type:"literal",value:e.slice(n+1,i)}),n=i+1);continue}let i=!1;for(const s of Sd)if(e.startsWith(s,n)){r(),t.push({type:"token",token:s}),n+=s.length,i=!0;break}i||(s+=e[n],n++)}return r(),t}(e),n=t.map(e=>"literal"===e.type?e.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):xd[e.token]).join("");return new RegExp(`${n}$`)}(n).source.replace(/\$$/,""),i=e.replace(/\\/g,"/"),a=i.startsWith("/")||/^[A-Za-z]:\//.test(i)?"(?:^|/)":"^";return new RegExp(`${s?`${a}${s}/`:"^"}${r}\\.md$`).test(i)}(e,t,n)}(e.filePath,e.periodicNotesPath)?e:null}Cc(()=>new Qn({key:Tg,props:{handleDOMEvents:{keydown:(e,t)=>function(e,t){if(!(navigator.userAgent.toLowerCase().includes("mac")?t.metaKey:t.ctrlKey)||t.shiftKey)return!1;if(Re(e))return!1;if("Backspace"===t.key)return t.preventDefault(),function(e){const{state:t}=e,{$from:n}=t.selection;let s=null;for(let a=n.depth;a>=0;a--)if(n.node(a).isTextblock){s=a;break}if(null==s)return!1;const r=n.start(s),i=n.pos;i<=r||e.dispatch(t.tr.delete(r,i).scrollIntoView())}(e),!0;if("x"===t.key||"X"===t.key){if(!e.state.selection.empty)return!1;const{$from:n}=e.state.selection;if(!n.parent.isTextblock)return!1;const s=Og(e),r=n.parent.textContent;return navigator.clipboard.writeText(`${s+r}\n`),function(e){const{state:t}=e,{$from:n}=t.selection;if(!n.parent.isTextblock)return!1;const s=t=>{e.dispatch(t.scrollIntoView())};for(let i=n.depth-1;i>=0;i--)if("list_item"===n.node(i).type.name){const e=t.tr;return Ag(e,Mg(t,n,i)),s(e),!0}const r=n.depth;if(r>=1&&n.node(r-1).childCount<=1){const e=n.start(),r=n.end();return e!==r&&(s(t.tr.delete(e,r)),!0)}s(t.tr.delete(n.before(r),n.after(r)))}(e),t.preventDefault(),!0}if("c"===t.key||"C"===t.key){if(!e.state.selection.empty)return!1;const{$from:n}=e.state.selection;if(!n.parent.isTextblock)return!1;const s=Og(e),r=n.parent.textContent;return navigator.clipboard.writeText(`${s+r}\n`),t.preventDefault(),!0}return!1}(e,t)}}}));const Pg=/[ \u00A0]/,$g=/^(\d{2}:\d{2})[ \u00A0](.*)/,Vg=/^(\d{2}:\d{2})([ \u00A0]?)(.*)$/;function Bg(e){const{from:t}=e.state.selection,n=e.state.doc.resolve(t),s=n.depth,r=n.node(s),i=n.start(s);if(r.isTextblock){let e=0;for(let t=s-1;t>=0;t--)"list_item"===n.node(t).type.name&&e++;return{lineText:r.textContent,lineFrom:i,lineTo:i+r.content.size,isListItem:e>0,isIndented:e>1,hasOnlyTextContent:r.content.size===r.textContent.length}}return null}function Fg(e){for(let t=e.depth;t>=1;t--)if("list_item"===e.node(t).type.name)return t;return-1}function zg(e,t){const n=e.node(t),s=e.before(t),r=function(e,t){let n=0;for(let s=t;s>=0;s--)"list_item"===e.node(s).type.name&&n++;return n}(e,t);let i=null;return n.forEach((e,t)=>{if(i||!e.isTextblock)return;const n=s+1+t+1;i={lineText:e.textContent,lineFrom:n,lineTo:n+e.content.size,listItemPos:s,listItemCount:r,isIndented:r>1}}),i}function Wg(e){const{from:t}=e.state.selection,n=e.state.doc.resolve(t),s=Fg(n);return s<0?null:zg(n,s)}function jg(e,t={}){const n=Bg(e);if(!n?.isListItem)return null;const s=Wg(e);return s?s.isIndented&&!t.allowIndentedCleanup||n.lineFrom!==s.lineFrom||n.lineTo!==s.lineTo?null:Ug(s.lineText)&&function(e){const{selection:t}=e.state;if(!t.empty)return!1;if(!Bg(e))return!1;const n=e.state.doc.resolve(t.from),s=n.node(n.depth);return!!s.isTextblock&&!!function(e){const t=e.match(Vg);return t?Pg.test(t[2])?[t[1].length,t[1].length+1]:[t[1].length]:[]}(s.textContent).includes(n.parentOffset)&&0===s.textContent.slice(n.parentOffset).trim().length}(e)?{lineText:s.lineText,nearPos:s.listItemPos,requireIndented:!0,minimumListItemCount:s.listItemCount+1}:null:null}function _g(e,t,n){const s=n.replace(/^#+\s*/,"").trim().toLowerCase();if(!s)return!1;let r=null,i=!1;return e.forEach((e,n)=>{if("heading"===e.type.name){if(i=!0,n>=t)return;r=e.textContent.trim().toLowerCase()}}),r?r===s:!i}function Ug(e){const t=e.match($g);return t?{content:t[2]}:null}function Kg(e,t={},n=Lg){if(e.isDestroyed||e.composing)return;let s=Wg(e);if(t.lineText&&(!s||s.lineText!==t.lineText||t.requireIndented&&!s.isIndented||null!=t.minimumListItemCount&&s.listItemCount<t.minimumListItemCount)&&(s=function(e,t,n,s=!1,r=0){const i=[];return e.descendants((n,a)=>{if("list_item"!==n.type.name)return!0;const o=e.resolve(a+1),l=Fg(o);if(l<0)return!0;const c=zg(o,l);return!c||c.lineText!==t||(s&&!c.isIndented||r>0&&c.listItemCount<r||i.push(c),!0)}),0===i.length?null:(null==n||i.sort((e,t)=>Math.abs(e.listItemPos-n)-Math.abs(t.listItemPos-n)),i[0])}(e.state.doc,t.lineText,t.nearPos,t.requireIndented,t.minimumListItemCount)),!s)return;if(t.requireIndented&&!s.isIndented)return;if(null!=t.minimumListItemCount&&s.listItemCount<t.minimumListItemCount)return;const r=n();if(!r)return;if(!_g(e.state.doc,s.lineFrom,r.dailyRecordHeader))return;if(!Ug(s.lineText))return;const i=e.state.tr;i.delete(s.lineFrom,s.lineFrom+6);const a=i.mapping.map(s.listItemPos),o=i.doc.resolve(Math.min(a+1,i.doc.content.size));for(let l=o.depth;l>=1;l--){const e=o.node(l);if("list_item"===e.type.name){if(null!=e.attrs.checked){const t=o.before(l);i.setNodeMarkup(t,void 0,{...e.attrs,checked:null})}break}}e.dispatch(i)}const qg=new WeakMap;function Hg(e,t){if(Re(e))return!1;const{state:n}=e,{selection:s}=n;if(!(s instanceof $n&&s.empty))return!1;const{$from:r}=s,i=r.depth-1;if(i<2||"paragraph"!==r.parent.type.name||0!==r.parent.content.size)return!1;const a=r.node(i),o=i-1,l=r.node(o);if("list_item"!==a.type.name||1!==a.childCount||null!=a.attrs.checked)return!1;if("ordered_list"!==l.type.name)return!1;if("list_item"===r.node(o-1).type.name)return t(e);const c=r.index(o),u=[],d=[];l.forEach((e,t,n)=>{n<c?u.push(e):n>c&&d.push(e)});const p=[];u.length&&p.push(l.copy(Ve.fromArray(u)));const f=p[0]?.nodeSize??0;p.push(a.firstChild),d.length&&p.push(l.type.create({...l.attrs,order:(l.attrs.order??1)+c+1},d,l.marks));const h=r.before(o),m=n.tr.replaceWith(h,r.after(o),p);return m.setSelection($n.create(m.doc,h+f+1)),e.dispatch(m.scrollIntoView()),!0}function Yg(e){return"bullet_list"===e.type.name||"ordered_list"===e.type.name}function Jg(e){const{selection:t}=e;if(!(t instanceof $n))return null;if(!t.$from.sameParent(t.$to))return{state:e,originalSelection:t,singleLine:!1};let n=-1;for(let o=t.$from.depth;o>=1;o--)if("list_item"===t.$from.node(o).type.name){n=o;break}if(n<0)return null;const s=t.$from.node(n),r=t.$from.before(n);let i=t.to;if(s.descendants((e,t)=>{e.isTextblock&&(i=Math.max(i,r+t+2+e.content.size))}),i===t.to)return{state:e,originalSelection:t,singleLine:!0};const a=$n.create(e.doc,t.from,i);return{state:e.apply(e.tr.setSelection(a)),originalSelection:t,singleLine:!0}}function Gg(e,t,n){if(t.singleLine){const e=n.mapping.map(t.originalSelection.anchor),s=n.mapping.map(t.originalSelection.head);try{n.setSelection($n.create(n.doc,e,s))}catch{}}e.dispatch(n)}function Qg(e){if(function(e){const{state:t}=e,{selection:n}=t;if(!(n instanceof $n&&n.empty))return!1;const{$from:s}=n,r=s.depth-1;if(r<4||"paragraph"!==s.parent.type.name||0!==s.parent.content.size)return!1;const i=s.node(r),a=r-1,o=s.node(a),l=a-1,c=s.node(l);if("list_item"!==i.type.name||1!==i.childCount||null!=i.attrs.checked)return!1;if("ordered_list"!==o.type.name||c.type!==i.type)return!1;const u=s.index(l);if(u===c.childCount-1)return!1;const d=[],p=[i.firstChild];for(let k=0;k<u;k++)d.push(c.child(k));const f=s.index(a);f>0&&d.push(o.copy(o.content.cut(0,s.before(r)-s.start(a)))),f<o.childCount-1&&p.push(o.copy(o.content.cut(s.after(r)-s.start(a))));for(let k=u+1;k<c.childCount;k++)p.push(c.child(k));const h=c.copy(Ve.fromArray(d)),m=i.copy(Ve.fromArray(p)),g=s.before(l),y=t.tr.replaceWith(g,s.after(l),[h,m]);return y.setSelection($n.create(y.doc,g+h.nodeSize+2)),e.dispatch(y.scrollIntoView()),!0}(e))return!0;const t=Jg(e.state);if(!t)return!1;const{state:n}=t,s=n.schema.nodes.list_item;return!!s&&Im(s)(n,n=>Gg(e,t,n))}const Zg=new WeakMap;function Xg(e){return Zg.get(e)??{armedBlockPos:null,pendingBlockPos:null}}function ey(e,t){null!=t.armedBlockPos||null!=t.pendingBlockPos?Zg.set(e,t):Zg.delete(e)}function ty(e){Zg.delete(e)}function ny(e,t){if(e.isTextblock)return t+e.nodeSize-1;for(let n=e.childCount-1;n>=0;n--){const s=e.child(n);let r=t+1;for(let t=0;t<n;t++)r+=e.child(t).nodeSize;const i=ny(s,r);if(null!=i)return i}return null}function sy(e){const{selection:t}=e.state;if(!(t instanceof $n&&t.empty))return null;const n=t.$from;let s=-1;for(let o=n.depth;o>=1;o--)if("list_item"===n.node(o).type.name){s=o;break}if(s<0)return null;const r=s+1;if(n.depth!==r)return null;const i=n.index(s);if(i<=0)return null;const a=n.node(r);return a.isTextblock?{currentParagraphStart:n.before(r),currentParagraphEnd:n.after(r),currentParagraphContentStart:n.start(r),currentParagraphContentEnd:n.start(r)+a.content.size,listItemDepth:s,paragraphDepth:r,paragraphIndex:i,paragraphNode:a,listItemPos:n.before(s),listItemNode:n.node(s)}:null}function ry(e){const{selection:t}=e.state;if(!(t instanceof $n&&t.empty))return null;const n=t.$from;if(!n.parent.isTextblock)return null;if(n.depth<1)return null;const s=n.depth,r=s-1,i=n.index(r);if(i<=0)return null;const a=n.node(r),o=a.child(i-1);if("bullet_list"!==o.type.name&&"ordered_list"!==o.type.name)return null;let l=0===r?0:n.before(r)+1;for(let u=0;u<i-1;u++)l+=a.child(u).nodeSize;const c=ny(o,l);return null==c?null:{currentBlockStart:n.before(s),currentBlockEnd:n.after(s),currentBlockContentStart:n.start(s),currentBlockContentEnd:n.start(s)+n.node(s).content.size,currentBlockNode:n.node(s),previousTextEnd:c}}const iy=new WeakMap;function ay(e){iy.delete(e)}function oy(e,t){return 0===t.length?null:e.type.create(e.attrs,t)}const ly=new WeakSet,cy=new es("list-indent-fix"),uy=new WeakSet,dy=new WeakMap,py=new WeakMap;function fy(e){if(Re(e)||!e.state.selection.empty)return!1;const t=Ng(e);return!(!t||null==t.listItemNode.attrs.checked||1!==t.listItemNode.childCount)&&!(!Ig(t.listItemNode)||!Eg(e))&&!(t.listItemDepth<3||"list_item"!==e.state.selection.$from.node(t.listItemDepth-2).type.name)&&Qg(e)}function hy(e,t){return!("Enter"!==t.key&&13!==t.keyCode||t.isComposing||229===t.keyCode||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||!Hg(e,Qg)&&!fy(e)||(t.preventDefault(),0))}function my(e,t){if(t.isComposing||229===t.keyCode)return!1;if("Backspace"!==t.key&&8!==t.keyCode)return!1;if(Re(e))return!1;if(navigator.userAgent.toLowerCase().includes("mac")?t.metaKey:t.ctrlKey)return!1;if(!e.state.selection.empty)return!1;const n=[()=>function(e,t){if(t.isComposing||229===t.keyCode)return!1;const n=function(e,t){const n=e.dom?.ownerDocument??null,s=n?.getSelection?.(),r=s?.anchorNode;if(!n||!r)return null;const i=1===r.nodeType?r:r.parentElement,a=t.target&&"function"==typeof t.target.closest?t.target:null,o=i?.closest('[contenteditable="true"]')??a?.closest('[contenteditable="true"]'),l=i?.closest("p");return o&&l&&"function"==typeof l.querySelector&&o.contains(l)?Eg(e)||""!==l.textContent?null:l.querySelector("br.ProseMirror-trailingBreak")&&Array.from(o.querySelectorAll("p")).at(-1)===l?{editorRoot:o,paragraph:l}:null:null}(e,t);if(!n)return ay(e),!1;const{editorRoot:s,paragraph:r}=n;if(iy.get(e)!==r)return iy.set(e,r),!0;const i=Array.from(s.querySelectorAll("p")),a=i.indexOf(r);if(a<=0)return ay(e),!0;const o=i[a-1];return o&&"function"==typeof o.ownerDocument?.getSelection?(function(e){const t=e.ownerDocument.getSelection();if(!t)return!1;const n=e.ownerDocument.createRange();n.selectNodeContents(e),n.collapse(!1),t.removeAllRanges(),t.addRange(n)}(o),ay(e),!0):(ay(e),!0)}(e,t),()=>function(e){const{selection:t}=e.state;if(!(t instanceof $n&&t.empty))return!1;const n=t.$from;if(!n.parent.isTextblock||0!==n.parentOffset)return!1;let s=-1;for(let d=n.depth-1;d>=1;d--)if("blockquote"===n.node(d).type.name){s=d;break}if(s<0)return!1;let r=-1;for(let d=s-1;d>=1;d--)if("list_item"===n.node(d).type.name){r=d;break}if(r<0)return!1;for(let d=s;d<n.depth;d++)if(0!==n.index(d))return!1;const i=n.node(s),a=n.before(s),o=s-1,l=n.node(o),c=n.index(o);if(!l.canReplace(c,c+1,i.content))return!1;const u=e.state.tr.replaceWith(a,a+i.nodeSize,i.content);try{u.setSelection($n.create(u.doc,t.from-1))}catch{return!1}return e.dispatch(u.scrollIntoView()),!0}(e),()=>(function(e){const t=Xg(e);if(null==t.armedBlockPos&&null==t.pendingBlockPos)return;const n=ry(e)?.currentBlockStart??sy(e)?.currentParagraphStart;(null==n||null!=t.armedBlockPos&&t.armedBlockPos!==n||null!=t.pendingBlockPos&&t.pendingBlockPos!==n)&&ty(e)}(e),!1),()=>function(e){const t=ry(e);if(!t)return!1;if(""!==t.currentBlockNode.textContent.trim())return!1;if(t.currentBlockNode.content.size>0){const{tr:n}=e.state;n.delete(t.currentBlockContentStart,t.currentBlockContentEnd);try{n.setSelection($n.create(n.doc,t.currentBlockContentStart))}catch{return!1}return ey(e,{armedBlockPos:null,pendingBlockPos:t.currentBlockStart}),e.dispatch(n.scrollIntoView()),!0}const n=Xg(e);if(n.armedBlockPos!==t.currentBlockStart&&n.pendingBlockPos!==t.currentBlockStart)return ey(e,{armedBlockPos:t.currentBlockStart,pendingBlockPos:null}),!0;const{tr:s}=e.state;s.delete(t.currentBlockStart,t.currentBlockEnd);try{s.setSelection($n.near(s.doc.resolve(t.previousTextEnd)))}catch{return!1}return ty(e),e.dispatch(s.scrollIntoView()),!0}(e),()=>function(e){const t=sy(e);if(!t)return!1;const{paragraphNode:n}=t;if(""!==n.textContent.trim())return!1;if(n.content.size>0){const{tr:n}=e.state;n.delete(t.currentParagraphContentStart,t.currentParagraphContentEnd);try{n.setSelection($n.create(n.doc,t.currentParagraphContentStart))}catch{return!1}return ey(e,{armedBlockPos:null,pendingBlockPos:t.currentParagraphStart}),e.dispatch(n.scrollIntoView()),!0}const s=Xg(e),r=t.currentParagraphStart;if(s.armedBlockPos!==r&&s.pendingBlockPos!==r)return ey(e,{armedBlockPos:r,pendingBlockPos:null}),!0;const{tr:i}=e.state,{listItemPos:a,listItemNode:o,paragraphIndex:l}=t;let c=a+1,u=-1,d=null;for(let f=0;f<o.childCount;f++){const e=o.child(f);if(f===l-1&&(u=c,d=e),f===l)break;c+=e.nodeSize}if(!d||u<0)return!1;i.delete(r,t.currentParagraphEnd);const p=ny(d,u);if(null==p)return!1;try{i.setSelection($n.near(i.doc.resolve(p)))}catch{return!1}return ty(e),e.dispatch(i.scrollIntoView()),!0}(e),()=>Hg(e,Qg),()=>function(e){if(!Eg(e))return!1;const t=Ng(e);if(!t)return!1;const{listItemNode:n,listItemDepth:s,listItemPos:r}=t;if(!Ig(n))return!1;if(null!==n.attrs.checked&&void 0!==n.attrs.checked)return!1;if(!Rg(n))return!1;const{state:i}=e,{tr:a}=i,o=i.doc.resolve(r),l=s-1;if(l<0)return!1;const c=o.node(l);if("bullet_list"!==c.type.name&&"ordered_list"!==c.type.name)return!1;const u=function(e){const t=[];for(let n=1;n<e.childCount;n++){const s=e.child(n);"bullet_list"!==s.type.name&&"ordered_list"!==s.type.name||t.push(s)}return t}(n);if(0===u.length)return!1;const d=[];for(const w of u)w.forEach(e=>{d.push(e)});if(0===d.length)return!1;const p=r,f=p+n.nodeSize,h=o.start(l);let m=-1,g=0;for(let w=0;w<c.childCount;w++){const e=c.child(w);if(h+g===p){m=w;break}g+=e.nodeSize}if(-1===m)return!1;const y=d;a.delete(p,f);let k=p;for(const w of y)a.insert(k,w),k+=w.nodeSize;try{const e=a.doc.resolve(p+2);a.setSelection($n.near(e))}catch{try{a.setSelection($n.near(a.doc.resolve(p)))}catch{}}return e.dispatch(a.scrollIntoView()),!0}(e),()=>function(e){if(!Eg(e))return!1;const t=Ng(e);if(!t)return!1;const{listItemNode:n,listItemDepth:s,listItemPos:r}=t;if(!Ig(n))return!1;if(Rg(n))return!1;if(null!==n.attrs.checked&&void 0!==n.attrs.checked)return!1;const{state:i}=e,a=i.doc.resolve(r),o=s-1;if(o<2)return!1;const l=a.node(o);if("bullet_list"!==l.type.name)return!1;const c=o-1,u=a.node(c);if("list_item"!==u.type.name)return!1;const d=c-1;if(d<0)return!1;if("bullet_list"!==a.node(d).type.name)return!1;const p=a.before(o),f=a.after(o),h=a.end(o),m=a.before(c)+u.nodeSize,g=a.index(o),y=[];for(let v=g+1;v<l.childCount;v++)y.push(l.child(v));const k=function(e,t,n){const s=[];e.forEach(e=>{s.push(e)});const r=oy(t,n);return r&&s.push(r),e.type.create(e.attrs,Ve.fromArray(s))}(n,l,y),w=i.tr;0===g?w.delete(p,f):y.length>0?w.delete(r,h):w.delete(r,r+n.nodeSize);const b=w.mapping.map(m);w.insert(b,k);try{w.setSelection($n.create(w.doc,b+2))}catch{}return ty(e),e.dispatch(w.scrollIntoView()),!0}(e),()=>function(e){if(!Eg(e))return!1;const t=Ng(e);if(!t)return!1;const{listItemNode:n,listItemDepth:s}=t;if(!Ig(n))return!1;if(Rg(n))return!1;if(null!==n.attrs.checked&&void 0!==n.attrs.checked)return!1;const{state:r}=e,i=r.selection.$from,a=s-1;if(a<0)return!1;const o=i.node(a);if("bullet_list"!==o.type.name)return!1;const l=a-1;if(l>=1){const e=i.node(l);if("list_item"===e.type.name&&null!==e.attrs.checked&&void 0!==e.attrs.checked)return!1}const c=i.index(a),u=[],d=[];for(let b=0;b<o.childCount;b++){const e=o.child(b);b<c?u.push(e):b>c&&d.push(e)}const p=[],f=oy(o,u);f&&p.push(f);const h=r.schema.nodes.paragraph.create();p.push(h);const m=oy(o,d);m&&p.push(m);const g=i.before(a),y=i.after(a),k=r.tr.replaceWith(g,y,Ve.fromArray(p)),w=g+(f?f.nodeSize:0);try{k.setSelection($n.create(k.doc,w+1))}catch{}return ey(e,{armedBlockPos:null,pendingBlockPos:w}),e.dispatch(k.scrollIntoView()),!0}(e),()=>function(e){if(!Eg(e))return!1;const t=Ng(e);if(!t)return!1;const{listItemNode:n,listItemDepth:s,listItemPos:r}=t;if(!Ig(n))return!1;if(null!==n.attrs.checked&&void 0!==n.attrs.checked)return!1;if(Rg(n))return!1;const{state:i}=e,a=i.doc.resolve(r),o=s-1;if(o<0)return!1;const l=a.node(o);if("bullet_list"!==l.type.name&&"ordered_list"!==l.type.name)return!1;const c=a.start(o),u=a.index(o);if(l.childCount<=1){const t=o-1;if(t<0)return!1;const n=a.node(t);if("list_item"!==n.type.name)return!1;const s=a.before(o),r=a.after(o),l=i.tr.delete(s,r),c=n.firstChild;if(c?.isTextblock){const e=a.before(t)+1+c.nodeSize-1;try{l.setSelection($n.near(l.doc.resolve(e)))}catch{}}return e.dispatch(l.scrollIntoView()),!0}let d=null;if(u>0){let e=c;for(let t=0;t<u;t++){const n=l.child(t),s=e;e+=n.nodeSize,t===u-1&&(d=ny(n,s))}}const p=i.tr.delete(r,r+n.nodeSize);try{null!=d?p.setSelection($n.create(p.doc,p.mapping.map(d,-1))):p.setSelection($n.near(p.doc.resolve(Math.min(r,p.doc.content.size))))}catch{}return e.dispatch(p.scrollIntoView()),!0}(e),()=>function(e){if(!Eg(e))return!1;const t=Ng(e);if(!t)return!1;const{listItemNode:n,listItemDepth:s,listItemPos:r}=t;if(Ig(n))return!1;const{state:i}=e,a=i.doc.resolve(r),o=s-1;if(o<1)return!1;const l=a.node(o);if("bullet_list"!==l.type.name&&"ordered_list"!==l.type.name)return!1;const c=o-1;if(c<0)return!1;const u=a.node(c);if("list_item"!==u.type.name)return!1;if(r!==a.start(o))return!1;const d=u.firstChild;if(!d||!d.isTextblock)return!1;const p=n.firstChild;if(!p||!p.isTextblock)return!1;const f=a.before(o),h=a.after(o),m=[];if(n.forEach(e=>{m.push(e)}),l.childCount>1){const e=[];for(let t=1;t<l.childCount;t++)e.push(l.child(t));m.push(l.type.create(l.attrs,Ve.fromArray(e),l.marks))}const g=i.tr.replaceWith(f,h,Ve.fromArray(m));try{g.setSelection($n.create(g.doc,f+1))}catch{}return e.dispatch(g.scrollIntoView()),!0}(e),()=>function(e){if(!Eg(e))return!1;const t=Ng(e);if(!t)return!1;const{listItemNode:n,listItemPos:s,listItemDepth:r}=t;if(null===n.attrs.checked||void 0===n.attrs.checked)return!1;const{state:i}=e;if(i.selection.$from.index(r)>0)return!1;const a=function(e){return function(e){return Qu(e)??" "}(e)}(n.attrs.checked),o=s+2,l=i.tr;l.setNodeMarkup(s,void 0,{...n.attrs,checked:null}),l.insertText(`[${a}]`,o);try{l.setSelection($n.create(l.doc,o+3))}catch{}return e.dispatch(l),!0}(e)];for(const i of n)if(i())return t.preventDefault(),!0;const s=ry(e);if(s&&s.currentBlockNode.content.size>0)return ey(e,{armedBlockPos:null,pendingBlockPos:s.currentBlockStart}),!1;const r=sy(e);return r&&r.paragraphNode.content.size>0?(ey(e,{armedBlockPos:null,pendingBlockPos:r.currentParagraphStart}),!1):(ty(e),!1)}Cc(()=>{let e;return new Qn({key:cy,view:t=>(e=t,function(e){const t=e.someProp("nodeViews",e=>e.list_item);if(!t||ly.has(t))return;const n=(...e)=>{let n=e[0];const s=t(...e),{contentDOM:r,dom:i,update:a}=s;return r&&a?(s.update=(...e)=>{if(!i.contains(r))return!1;const t=e[0],o=e=>{let t=0;return e.forEach(e=>{"ordered_list"!==e.type.name&&"bullet_list"!==e.type.name||t++}),t>1};if(n.childCount!==t.childCount&&(o(n)||o(t)))return!1;const l=a.apply(s,e);return l&&(n=t),l},s):s};ly.add(n),e.setProps({nodeViews:{...e.props.nodeViews,list_item:n}})}(t),{destroy(){e=void 0,dy.delete(t),py.delete(t)}}),filterTransaction(t,n){if(!e||py.get(e)!==n.doc)return!0;const[s]=t.steps;return!(1===t.steps.length&&s instanceof sn&&s.from<s.to&&0===s.slice.size)},props:{handleKeyDown:(e,t)=>function(e,t){if("Enter"!==t.key&&13!==t.keyCode)return!1;const n=uy.has(e);return uy.delete(e),!(!1!==t.isTrusted||!n)||hy(e,t)}(e,t)||my(e,t),handleDOMEvents:{beforeinput:(e,t)=>(function(e,t){dy.delete(e),py.delete(e),"deleteContentBackward"===t.inputType&&!t.isComposing&&e.state.selection.empty&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||dy.set(e,e.state))}(e,t),function(e,t){return!("insertParagraph"!==t.inputType||t.isComposing||!t.cancelable||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||!Hg(e,Qg)&&!fy(e)||(uy.add(e),t.preventDefault(),0))}(e,t)),input:(e,t)=>function(e,t){const n=dy.get(e);if(dy.delete(e),!n||"deleteContentBackward"!==t.inputType||t.isComposing)return!1;if(e.state.doc!==n.doc||!e.state.selection.eq(n.selection))return!1;const s=my(e,new KeyboardEvent("keydown",{key:"Backspace",keyCode:8}));return s&&py.set(e,e.state.doc),s}(e,t),pointerdown:e=>(py.delete(e),!1),keydown(e,t){py.delete(e);const n=t;return"Enter"!==n.key&&13!==n.keyCode||uy.delete(e),hy(e,n)||function(e,t){if("Tab"!==t.key&&9!==t.keyCode)return!1;if(t.isComposing||229===t.keyCode)return!1;if(t.ctrlKey||t.metaKey||t.altKey)return!1;if(Re(e))return!1;const n=Ng(e);if(t.shiftKey&&e.state.selection.empty&&n){const s=n.listItemDepth-1,r=e.state.selection.$from;if("ordered_list"===r.node(s).type.name&&"list_item"!==r.node(s-1).type.name)return t.preventDefault(),!0}const s=t.shiftKey?null:function(e){return(qg.get(e)??Lg)()}(e),r=s?jg(e,{allowIndentedCleanup:Boolean(s.allowIndentedTabCleanup)}):null,i=t.shiftKey?Qg(e):function(e){const{selection:t,schema:n}=e.state,{$from:s}=t;if(!t.empty||"paragraph"!==s.parent.type.name)return!1;if(s.parentOffset!==s.parent.content.size)return!1;if(s.parent.firstChild?.marks.some(e=>e.type.spec.code))return!1;if(!/^[-+*]\s*$/u.test(s.parent.textContent))return!1;const r=n.nodes.bullet_list;if(!r)return!1;const i=e.state.tr.delete(s.start(),s.pos),a=i.selection.$from.blockRange();if(!a)return!1;const o=un(a,r);return!!o&&(e.dispatch(i.wrap(a,o).scrollIntoView()),!0)}(e)||function(e){if(function(e){const{state:t}=e,{selection:n}=t;if(!(n.empty&&n instanceof $n))return!1;const{$from:s}=n;if("paragraph"!==s.parent.type.name||0!==s.parent.content.size)return!1;const r=s.depth-1;if(r<2||0!==s.index(r))return!1;const i=s.node(r),a=s.node(r-1);if("list_item"!==i.type.name||"ordered_list"!==a.type.name||null!=i.attrs.checked)return!1;if(0===s.index(r-1)||i.childCount<2)return!1;const o=[];for(let c=1;c<i.childCount;c++){const e=i.child(c);if("ordered_list"!==e.type.name&&"bullet_list"!==e.type.name)return!1;o.push(e)}const l=s.before(r);return Rm(i.type)(t,t=>{const n=t.mapping.map(l,1),s=t.doc.nodeAt(n);if(!s||s.type!==i.type)return;const r=t.doc.resolve(n),a=r.parent,c=i.copy(Ve.from(i.firstChild)),u=[];a.forEach((e,t,n)=>{u.push(n===r.index()?c:e)});const d=[a.copy(Ve.fromArray(u))];for(const e of o){const t=d.at(-1);t.type===e.type?d[d.length-1]=t.copy(t.content.append(e.content)):d.push(e)}t.replaceWith(r.before(),r.after(),Ve.fromArray(d)),t.setSelection($n.create(t.doc,n+2)),e.dispatch(t.scrollIntoView())})}(e))return!0;const t=Jg(e.state);if(!t)return!1;const{state:n}=t,s=n.schema.nodes.list_item;return!!s&&Rm(s)(n,n=>Gg(e,t,n))}(e)||function(e){const t=Jg(e.state);if(!t)return!1;const{state:n}=t,{selection:s}=n,r=Ng({state:n});if(!r)return!1;const{listItemDepth:i,listItemPos:a}=r,o=i-1,l=o-1;if(o<1||l<0)return!1;const c=s.$from,u=c.node(o);if(!Yg(u)||0!==c.index(o))return!1;const d=c.end(o);if(s.to>d)return!1;const p=[];let f=0;for(let I=0;I<u.childCount;I++){const e=u.child(I);if(p.push(e),f+=e.nodeSize,s.empty||s.to<=a+f)break}if(0===p.length||s.to>a+f)return!1;const h=c.node(l),m=c.index(l);if(m<=0)return!1;const g=h.child(m-1);if(!Yg(g)||0===g.childCount)return!1;const y=[];g.forEach(e=>{y.push(e)});const k=y.at(-1);if(!k||"list_item"!==k.type.name)return!1;const w=[];k.forEach(e=>{w.push(e)});let b=-1;for(let I=w.length-1;I>=0;I--)if(w[I].type===u.type){b=I;break}const v=b>=0?w[b].content.size:0,S=Ve.fromArray(p),x=b>=0?w[b].type.create(w[b].attrs,w[b].content.append(S),w[b].marks):u.type.create(u.attrs,S,u.marks);b>=0?w[b]=x:(b=w.length,w.push(x));const C=k.type.create(k.attrs,w,k.marks);y[y.length-1]=C;const T=[g.type.create(g.attrs,y,g.marks)];if(u.childCount>p.length){const e=[];for(let t=p.length;t<u.childCount;t++)e.push(u.child(t));T.push(u.type.create(u.attrs,e,u.marks))}const O=c.before(o),D=O-g.nodeSize,M=D+1+y.slice(0,-1).reduce((e,t)=>e+t.nodeSize,0)+1+w.slice(0,b).reduce((e,t)=>e+t.nodeSize,0)+1+v,A=n.tr.replaceWith(D,O+u.nodeSize,Ve.fromArray(T)),N=M+t.originalSelection.anchor-a,E=M+t.originalSelection.head-a;try{A.setSelection($n.create(A.doc,N,E))}catch{A.setSelection($n.near(A.doc.resolve(M+1)))}return e.dispatch(A.scrollIntoView()),!0}(e);return!!i&&(r&&Kg(e,r,()=>s),t.preventDefault(),!0)}(e,n)||my(e,n)}}}})});var gy=200,yy=function(){};yy.prototype.append=function(e){return e.length?(e=yy.from(e),!this.length&&e||e.length<gy&&this.leafAppend(e)||this.length<gy&&e.leafPrepend(this)||this.appendInner(e)):this},yy.prototype.prepend=function(e){return e.length?yy.from(e).append(this):this},yy.prototype.appendInner=function(e){return new wy(this,e)},yy.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?yy.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},yy.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},yy.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},yy.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var s=[];return this.forEach(function(t,n){return s.push(e(t,n))},t,n),s},yy.from=function(e){return e instanceof yy?e:e&&e.length?new ky(e):yy.empty};var ky=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 0==e&&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,s){for(var r=t;r<n;r++)if(!1===e(this.values[r],s+r))return!1},t.prototype.forEachInvertedInner=function(e,t,n,s){for(var r=t-1;r>=n;r--)if(!1===e(this.values[r],s+r))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=gy)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=gy)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}(yy);yy.empty=new ky([]);var wy=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,s){var r=this.left.length;return!(t<r&&!1===this.left.forEachInner(e,t,Math.min(n,r),s))&&!(n>r&&!1===this.right.forEachInner(e,Math.max(t-r,0),Math.min(this.length,n)-r,s+r))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,s){var r=this.left.length;return!(t>r&&!1===this.right.forEachInvertedInner(e,t-r,Math.max(n,r)-r,s+r))&&!(n<r&&!1===this.left.forEachInvertedInner(e,Math.min(t,r),n,s))&&void 0},t.prototype.sliceInner=function(e,t){if(0==e&&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}(yy);class by{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,s,r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}t&&(n=this.remapping(r,this.items.length),s=n.maps.length);let i,a,o=e.tr,l=[],c=[];return this.items.forEach((e,t)=>{if(!e.step)return n||(n=this.remapping(r,t+1),s=n.maps.length),s--,void c.push(e);if(n){c.push(new vy(e.map));let t,r=e.step.map(n.slice(s));r&&o.maybeStep(r).doc&&(t=o.mapping.maps[o.mapping.maps.length-1],l.push(new vy(t,void 0,void 0,l.length+c.length))),s--,t&&n.appendMap(t,s)}else o.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(s)):e.selection,a=new by(this.items.slice(0,r).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:a,transform:o,selection:i}}addTransform(e,t,n,s){let r=[],i=this.eventCount,a=this.items,o=!s&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let n,l=e.steps[c].invert(e.docs[c]),u=new vy(e.mapping.maps[c],l,t);(n=o&&o.merge(u))&&(u=n,c?r.pop():a=a.slice(0,a.length-1)),r.push(u),t&&(i++,t=void 0),s||(o=u)}let l=i-n.depth;return l>xy&&(a=function(e,t){let n;return e.forEach((e,s)=>{if(e.selection&&0==t--)return n=s,!1}),e.slice(n)}(a,l),i-=l),new by(a.append(r),i)}remapping(e,t){let n=new Yt;return this.items.forEach((t,s)=>{let r=null!=t.mirrorOffset&&s-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,r)},e,t),n}addMaps(e){return 0==this.eventCount?this:new by(this.items.append(e.map(e=>new vy(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],s=Math.max(0,this.items.length-t),r=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(e=>{e.selection&&a--},s);let o=t;this.items.forEach(t=>{let s=r.getMirror(--o);if(null==s)return;i=Math.min(i,s);let l=r.maps[s];if(t.step){let i=e.steps[s].invert(e.docs[s]),c=t.selection&&t.selection.map(r.slice(o+1,s));c&&a++,n.push(new vy(l,i,c))}else n.push(new vy(l))},s);let l=[];for(let d=t;d<i;d++)l.push(new vy(r.maps[d]));let c=this.items.slice(0,s).append(l).append(n),u=new by(c,a);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,s=[],r=0;return this.items.forEach((i,a)=>{if(a>=e)s.push(i),i.selection&&r++;else if(i.step){let e=i.step.map(t.slice(n)),a=e&&e.getMap();if(n--,a&&t.appendMap(a,n),e){let o=i.selection&&i.selection.map(t.slice(n));o&&r++;let l,c=new vy(a.invert(),e,o),u=s.length-1;(l=s.length&&s[u].merge(c))?s[u]=l:s.push(c)}}else i.map&&n--},this.items.length,0),new by(yy.from(s.reverse()),r)}}by.empty=new by(yy.empty,0);class vy{constructor(e,t,n,s){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new vy(t.getMap().invert(),t,this.selection)}}}class Sy{constructor(e,t,n,s,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=s,this.prevComposition=r}}const xy=20;function Cy(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,s,r)=>t.push(s,r));return t}function Ty(e,t){if(!e)return null;let n=[];for(let s=0;s<e.length;s+=2){let r=t.map(e[s],1),i=t.map(e[s+1],-1);r<=i&&n.push(r,i)}return n}let Oy=!1,Dy=null;function My(e){let t=e.plugins;if(Dy!=t){Oy=!1,Dy=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Oy=!0;break}}return Oy}const Ay=new es("history"),Ny=new es("closeHistory");function Ey(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Qn({key:Ay,state:{init:()=>new Sy(by.empty,by.empty,null,0,-1),apply:(t,n,s)=>function(e,t,n,s){let r,i=n.getMeta(Ay);if(i)return i.historyState;n.getMeta(Ny)&&(e=new Sy(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(Ay))return a.getMeta(Ay).redo?new Sy(e.done.addTransform(n,void 0,s,My(t)),e.undone,Cy(n.mapping.maps),e.prevTime,e.prevComposition):new Sy(e.done,e.undone.addTransform(n,void 0,s,My(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new Sy(e.done.rebased(n,r),e.undone.rebased(n,r),Ty(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Sy(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Ty(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let r=n.getMeta("composition"),i=0==e.prevTime||!a&&e.prevComposition!=r&&(e.prevTime<(n.time||0)-s.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,s)=>{for(let r=0;r<t.length;r+=2)e<=t[r+1]&&s>=t[r]&&(n=!0)}),n}(n,e.prevRanges)),o=a?Ty(e.prevRanges,n.mapping):Cy(n.mapping.maps);return new Sy(e.done.addTransform(n,i?t.selection.getBookmark():void 0,s,My(t)),by.empty,o,n.time,r??e.prevComposition)}}(n,s,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,s="historyUndo"==n?Ry:"historyRedo"==n?Ly:null;return!(!s||!e.editable)&&(t.preventDefault(),s(e.state,e.dispatch))}}}})}function Iy(e,t){return(n,s)=>{let r=Ay.getState(n);if(!r||0==(e?r.undone:r.done).eventCount)return!1;if(s){let i=function(e,t,n){let s=My(t),r=Ay.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,s);if(!i)return null;let a=i.selection.resolve(i.transform.doc),o=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),r,s),l=new Sy(n?o:i.remaining,n?i.remaining:o,null,0,-1);return i.transform.setSelection(a).setMeta(Ay,{redo:n,historyState:l})}(r,n,e);i&&s(t?i.scrollIntoView():i)}return!0}}const Ry=Iy(!1,!0),Ly=Iy(!0,!0);Cc(()=>new Qn({key:new es("list-paste-history"),view(e){const t=t=>{if(!e.editable||!function(e){if(!e||e.files?.length)return null;const t=e.getData("text/html"),n=e.getData("text/plain");return/<(?:img|table)\b/i.test(t)?null:(t?/<(?:ul|ol)\b/i.test(t):/^\s*(?:[-+*]|\d+[.)])\s/m.test(n))?{html:t,text:n}:null}(t.clipboardData))return;const n=function(e){const t=()=>{e.isDestroyed||e.dispatch(function(e){return e.setMeta(Ny,!0)}(e.state.tr).setMeta("addToHistory",!1))};return t(),t}(e);queueMicrotask(n)};return e.dom.addEventListener("paste",t,!0),{destroy:()=>e.dom.removeEventListener("paste",t,!0)}}}));const Py=new es("timestamp-auto-insert");function $y(e){try{const{from:t}=e.selection,n=e.doc.resolve(t),s=n.depth,r=n.node(s);if(!r.isTextblock)return null;let i=0;for(let e=s-1;e>=0;e--)"list_item"===n.node(e).type.name&&i++;return{lineText:r.textContent,lineFrom:n.start(s),lineTo:n.start(s)+r.content.size,isListItem:i>0,isIndented:i>1,hasOnlyTextContent:r.content.size===r.textContent.length,isTask:Array.from({length:s},(e,t)=>n.node(t)).some(e=>"list_item"===e.type.name&&null!==e.attrs.checked&&void 0!==e.attrs.checked)}}catch(t){return null}}function Vy(e,t,n){const s=$y(e),r=$y(t);if(!s||!r)return null;if(!s.isListItem||!r.isListItem)return null;if(s.isIndented||r.isIndented)return null;if(s.lineFrom!==r.lineFrom)return null;if(!s.hasOnlyTextContent)return null;if(!r.hasOnlyTextContent)return null;const i=function(e){const{previousText:t,text:n,wasTask:s,isTask:r}=e;if(!/^(?: ?|\[(?:[^\]\n])?\]? ?)$/u.test(t))return null;const i=!s&&r,a=n.match(/^\[[^\]\n]\] /u),o=a?.[0].length??0,l=n.slice(o);return/^\d{2}:\d{2}(?:[ \u00a0]|$)/u.test(l)?null:i||a||n.trim()&&!/^\[(?:[^\]\n])?\]?$/u.test(n)?o:null}({previousText:s.lineText,text:r.lineText,wasTask:s.isTask,isTask:r.isTask});if(null===i)return null;if(Ug(r.lineText))return null;if(!_g(e.doc,s.lineFrom,n.dailyRecordHeader))return null;if(!_g(t.doc,r.lineFrom,n.dailyRecordHeader))return null;const a=r.lineText.slice(i)?" ":" ",o=`${vd().format("HH:mm")}${a}`,l=t.tr.insertText(o,r.lineFrom+i);return l.setSelection($n.create(l.doc,Math.min(t.selection.from+o.length,l.doc.content.size))),l}function By(e=Lg){return Cc(()=>{const t=new WeakMap,n=new WeakMap;return new Qn({key:Py,props:{handleDOMEvents:{compositionstart:e=>(t.set(e,e.state),!1),compositionend(s){const r=t.get(s);return t.delete(s),!!r&&(clearTimeout(n.get(s)),n.set(s,setTimeout(()=>{n.delete(s);const t=e();if(!t||s.isDestroyed||s.composing)return;const i=Vy(r,s.state,t);i&&s.dispatch(i.setMeta(Py,!0))},0)),!1)},keydown:(t,n)=>function(e,t,n=Lg){if(t.isComposing||229===t.keyCode)return!1;if("Backspace"!==t.key&&8!==t.keyCode)return!1;if(Re(e))return!1;if(t.metaKey||t.ctrlKey||t.altKey)return!1;const s=n();if(!s)return!1;const r=Bg(e);if(!r||!r.isListItem)return!1;if(!_g(e.state.doc,r.lineFrom,s.dailyRecordHeader))return!1;if(" "===r.lineText){t.preventDefault();const n=e.state.tr.delete(r.lineFrom,r.lineTo);return e.dispatch(n),!0}if(""===r.lineText&&r.lineTo>r.lineFrom){t.preventDefault();const n=e.state.tr.delete(r.lineFrom,r.lineTo);return e.dispatch(n),!0}if(""===r.lineText&&r.lineFrom===r.lineTo){if(r.isIndented)return!1;const n=e.state.schema.nodes.list_item;return!(!n||!Im(n)(e.state,e.dispatch)||(t.preventDefault(),0))}return!1}(t,n,e)},handleKeyDown(t,n){if(t.composing||n.isComposing||229===n.keyCode)return!1;if(Re(t))return!1;const s=e();if(!s)return!1;const r=Bg(t);if(!r)return!1;if(!_g(t.state.doc,r.lineFrom,s.dailyRecordHeader))return!1;if(("Tab"===n.key||9===n.keyCode)&&!n.shiftKey){const n=jg(t,{allowIndentedCleanup:Boolean(s.allowIndentedTabCleanup)});return!!n&&(setTimeout(()=>{Kg(t,n,e)},0),!1)}return!1}},view(s){const r=function(e,t){return qg.set(e,t),()=>qg.delete(e)}(s,e);return{destroy(){r(),clearTimeout(n.get(s)),t.delete(s)}}},appendTransaction:(t,n,s)=>function(e,t,n,s=Lg()){if(e.some(e=>e.getMeta(Py)))return null;if(!e.some(e=>e.docChanged))return null;if(e.some(e=>void 0!==e.getMeta("composition")&&null!==e.getMeta("composition")||"paste"===e.getMeta("uiEvent")))return null;if(!s)return null;const r=Vy(t,n,s);return r?(r.setMeta(Py,!0),r):null}(t,n,s,e())})})}By(),function(e=Lg){By(e)}();const Fy=new WeakMap;let zy=0,Wy=null;function jy(e){return"mermaid"===e.trim().toLowerCase()}function _y(e,t){e.dataset.mermaidRenderStatus=t,e.setAttribute("aria-busy","loading"===t?"true":"false")}function Uy(e,t){const n=t.createElement("div");return n.className="aino-mermaid-preview",n.dataset.mermaidPreview="true",n.dataset.mermaidSource=encodeURIComponent(e),n}async function Ky(e,t){const n=Fy.get(e),s={generation:(n?.generation??0)+1,source:t};Fy.set(e,s),_y(e,"loading");try{const n=e.ownerDocument.documentElement,r=await async function(e,t){const n="aino-mermaid-"+ ++zy;Wy??(Wy=A(()=>import("./mermaid.core-BOFC-9Zd.js").then(e=>e.bn),__vite__mapDeps([0,1,2,3,4])));try{const{default:s}=await Wy;return s.initialize({htmlLabels:!1,startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:t}),{id:n,svg:(await s.render(n,e)).svg}}catch(s){throw document.getElementById(n)?.remove(),s}}(t,function(e){return"dark"===e.dataset.theme||e.classList.contains("dark-mode")?"dark":"light"===e.dataset.theme||e.classList.contains("light-mode")?"default":e.ownerDocument.defaultView?.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"default"}(n));if(Fy.get(e)?.generation!==s.generation)return;e.innerHTML=r.svg;const i=e.querySelector("svg");i&&(i.removeAttribute("height"),i.style.maxWidth="100%",i.style.height="auto"),_y(e,"ready")}catch(r){if(Fy.get(e)?.generation!==s.generation)return;!function(e,t){e.replaceChildren();const n=e.ownerDocument.createElement("span");n.className="aino-mermaid-preview-error",n.textContent="Mermaid diagram error",n.title=function(e){return(e instanceof Error?e.message:String(e)).replace(/\s+/g," ").trim().slice(0,240)||"Unknown Mermaid rendering error"}(t),e.appendChild(n),_y(e,"error")}(e,r)}}function qy(e,t=document){const n=Uy(e,t);return Ky(n,e),n}async function Hy(e,t=document){const n=Uy(e,t);return await Ky(n,e),n.outerHTML}const Yy=Cc(function(){return new Qn({key:new es("lifeos-ordered-list-numbering"),appendTransaction(e,t,n){if(!e.some(e=>e.docChanged))return null;const s=n.tr;return n.doc.descendants((e,t,n,r)=>{if("list_item"!==e.type.name||"ordered_list"!==n?.type.name)return;const i=`${(n.attrs.order??1)+r}.`;e.attrs.label===i&&"ordered"===e.attrs.listType||s.setNodeMarkup(t,void 0,{...e.attrs,label:i,listType:"ordered"})}),s.docChanged?s:null}})}),Jy=[{emoji:"🔴",name:"red",rgb:"224, 82, 82"},{emoji:"🟠",name:"orange",rgb:"235, 144, 58"},{emoji:"🟡",name:"yellow",rgb:"225, 193, 65"},{emoji:"🟢",name:"green",rgb:"91, 175, 98"},{emoji:"🔵",name:"blue",rgb:"75, 149, 222"},{emoji:"🟣",name:"purple",rgb:"169, 109, 215"}];function Gy(e){return Jy.find(t=>e.startsWith(t.emoji))}function Qy(e){const t=Gy(e);return`background-color: ${t?`rgba(${t.rgb}, 0.3)`:"var(--text-highlight-bg, rgba(225, 193, 65, 0.3))"}; color: inherit`}const Zy=Ac("obsidian_highlight",()=>({attrs:{colorEmoji:{default:""}},inclusive:!1,parseDOM:[{tag:"mark",getAttrs:e=>({colorEmoji:Gy(e.dataset.highlightEmoji??"")?.emoji??""})}],toDOM:e=>["mark",{"data-highlight-emoji":e.attrs.colorEmoji,style:Qy(e.attrs.colorEmoji)},0],parseMarkdown:{match:e=>"obsidianHighlight"===e.type,runner:(e,t,n)=>{e.openMark(n,{colorEmoji:t.colorEmoji??""}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"obsidian_highlight"===e.type.name,runner:(e,t)=>{e.withMark(t,"obsidianHighlight",void 0,{colorEmoji:t.attrs.colorEmoji})}}})),Xy=vc(e=>Sr(new RegExp("(?<![\\\\=])==(?:(🔴|🟠|🟡|🟢|🔵|🟣))?([^=\\n]+)==$","u"),Zy.type(e),{getAttr:e=>({colorEmoji:e[1]??""})})),ek=/^>\s*(\[![A-Za-z][\w-]*\][+-]?\s*[^\n]*)\n$/,tk=vc(()=>new Js(ek,(e,t,n,s)=>{const r=_c(t[1]||"");if(!r)return null;const i=e.schema.nodes.callout,a=e.schema.nodes.paragraph;if(!i||!a)return null;const o=a.create();return e.tr.delete(n,s).insert(n,i.create({kind:r.kind,title:r.title,folded:r.fold?"collapsed"===r.fold:null},o))})),nk=/(^|[^#/_\-\p{L}\p{N}])(#[\p{L}\p{N}_][^\s\uFFFC]*)( )$/u,sk=new Set(["tag","wikilink","wikiembedding","image"]);function rk(e,t,n){const[,s,r,i]=t,a=r.slice(1),o=e.schema.nodes.tag;if(!o)return null;if(!Fu(a))return null;const l=n+s.length,c=l+r.length;return function(e,t,n){const s=e.doc.content.size,r=e.doc.resolve(Math.min(Math.max(t,0),s)),i=e.doc.resolve(Math.min(Math.max(n,0),s));for(let a=r.depth;a>0;a-=1)if(sk.has(r.node(a).type.name))return!0;for(let a=i.depth;a>0;a-=1)if(sk.has(i.node(a).type.name))return!0;return!1}(e,l,c)?null:e.tr.replaceWith(l,c,[o.create({tag:a},e.schema.text(kh(a))),e.schema.text(i)])}const ik=vc(()=>new Js(nk,rk)),ak=/(!\[\[[^\]\r\n|]+(?:\|[^\]\r\n]+)?\]\])(\s)?$/,ok=vc(()=>new Js(ak,(e,t,n,s)=>{const r=ou(t[1]||"");if(!r)return null;const i=e.schema.nodes.wikiembedding;if(!i)return null;const a=t[2]?s-1:s;return e.tr.delete(n,a).insert(n,i.create({target:r.target,hash:r.hash??"",alias:r.alias??""},e.schema.text(lu(r.target,r.hash,r.alias))))})),lk=vc(()=>new Js(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\](\s)?$/,(e,t,n,s)=>{const[,r,i]=t,a=e.schema.nodes.wikilink;if(!a)return null;const o=t[3]?s-1:s,l=nu(`[[${r}${i?`|${i}`:""}]]`);return l?e.tr.delete(n,o).insert(n,a.create({target:l.target,hash:l.hash??"",alias:l.alias??null},e.schema.text(yh(l.target,l.hash??"",l.alias??null)))):null})),ck=Cc(()=>new Qn({appendTransaction(e,t,n){if(!e.some(e=>e.docChanged))return null;const s=n.schema.nodes.wikiembedding,r=n.schema.nodes.wikilink;if(!s||!r)return null;const i=new Set,a=[];for(const l of e)l.docChanged&&l.steps.forEach(e=>{e.getMap().forEach((e,t,s,r)=>{for(const o of[s,r]){const e=Math.min(Math.max(0,o),n.doc.content.size);try{const t=n.doc.resolve(e),s=t.start(t.depth);i.has(s)||(i.add(s),a.push({parent:t.parent,parentStart:s}))}catch{}}})});let o=null;for(const{parent:l,parentStart:c}of a)l.forEach((e,t,i)=>{if(!e.isText||!e.text?.endsWith("!"))return;if(i+1>=l.childCount)return;const a=l.child(i+1);if(a.type!==r)return;o||(o=n.tr);const u=c+t+e.nodeSize-1,d=c+t+e.nodeSize+a.nodeSize,p=Lh(s,lu(a.attrs.target,a.attrs.hash||"",a.attrs.alias||""));p&&o.replaceWith(u,d,p)});return o}}));function uk(e,t,n,s,r="end"){const{state:i}=e,a="wikilink"===t.type.name,o="wikiembedding"===t.type.name;if(!a&&!o)return!1;if(t.content.size>0){const t="start"===r?n+1:s-1,a=i.tr.setSelection($n.create(i.doc,t));return e.dispatch(a),!0}let l;l=Eh(t).slice(0,-2);const c=i.tr.replaceWith(n,s,i.schema.text(l));return c.setSelection($n.create(c.doc,n+l.length)),e.dispatch(c),!0}const dk=Cc(()=>new Qn({view(e){let t=e;const n=e=>{!function(e,t){if(t.isComposing||229===t.keyCode)return;if(t.metaKey||t.ctrlKey||t.altKey)return;if("Backspace"!==t.key&&"Delete"!==t.key)return;const{state:n}=e,{selection:s}=n,r=new Set(["wikilink","wikiembedding"]);if(s instanceof Bn){const i=s.node,a=e.nodeDOM?.(s.from);return"wikiembedding"===i.type.name&&a instanceof HTMLElement&&a.querySelector("img[data-editor-image-selectable]")?(e.dispatch(n.tr.deleteSelection()),t.preventDefault(),void t.stopImmediatePropagation()):void(r.has(i.type.name)&&uk(e,i,s.from,s.to)&&(t.preventDefault(),t.stopImmediatePropagation()))}if(!s.empty)return;if("Backspace"===t.key){const i=n.doc.resolve(s.$from.pos).nodeBefore;if(!i||!r.has(i.type.name))return;return void(uk(e,i,s.$from.pos-i.nodeSize,s.$from.pos,"end")&&(t.preventDefault(),t.stopImmediatePropagation()))}const i=n.doc.resolve(s.$from.pos).nodeAfter;i&&r.has(i.type.name)&&uk(e,i,s.$from.pos,s.$from.pos+i.nodeSize,"start")&&(t.preventDefault(),t.stopImmediatePropagation())}(t,e)};return e.dom.addEventListener("keydown",n,!0),{update(e){t=e},destroy(){e.dom.removeEventListener("keydown",n,!0)}}}})),pk=32,fk=62;function hk(e,t,n){return function(t){return e.enter("ofmCallout",{_container:!0}),e.enter("ofmCalloutPrefix"),e.consume(t),s};function s(t){return t===pk?(e.enter("ofmCalloutPrefixWhiteSpace"),e.consume(t),e.exit("ofmCalloutPrefixWhiteSpace"),r):91===t?(e.enter("ofmCalloutType"),e.enter("ofmCalloutTypeMarker"),e.consume(t),e.exit("ofmCalloutTypeMarker"),i):n(t)}function r(t){return 91!==t?n(t):(e.enter("ofmCalloutType"),e.enter("ofmCalloutTypeMarker"),e.consume(t),e.exit("ofmCalloutTypeMarker"),i)}function i(t){return 33!==t?n(t):(e.enter("ofmCalloutTypeMark"),e.consume(t),e.exit("ofmCalloutTypeMark"),a)}function a(t){return!t||t<pk||93===t?n(t):(e.enter("ofmCalloutTypeValue"),e.consume(t),o)}function o(t){return!t||t<pk?n(t):93===t?(e.exit("ofmCalloutTypeValue"),e.enter("ofmCalloutTypeMarker"),e.consume(t),e.exit("ofmCalloutTypeMarker"),l):(e.consume(t),o)}function l(s){return 43===s||45===s?(e.enter("ofmCalloutFoldable"),e.consume(s),e.exit("ofmCalloutFoldable"),e.exit("ofmCalloutType"),c):s===pk?(e.exit("ofmCalloutType"),e.enter("ofmCalloutPrefixWhiteSpace"),e.consume(s),e.exit("ofmCalloutPrefixWhiteSpace"),u):!s||s<pk?(e.exit("ofmCalloutType"),e.exit("ofmCalloutPrefix"),t(s)):n(s)}function c(s){return s===pk?(e.enter("ofmCalloutPrefixWhiteSpace"),e.consume(s),e.exit("ofmCalloutPrefixWhiteSpace"),u):!s||s<pk?(e.exit("ofmCalloutPrefix"),t(s)):n(s)}function u(n){return!n||n<pk?(e.exit("ofmCalloutPrefix"),t(n)):(e.enter("ofmCalloutTitle"),e.consume(n),d)}function d(n){return!n||n<pk?(e.exit("ofmCalloutTitle"),e.exit("ofmCalloutPrefix"),t(n)):(e.consume(n),d)}}function mk(e,t,n){const s=this;return function(t){return s.containerState.calloutContent||e.enter("ofmCalloutContent"),P(t)?$(e,r,G.linePrefix,s.parser.constructs.disable.null?.includes("codeIndented")?void 0:J.tabSize)(t):r(t)};function r(t){return 62===t?(e.enter("ofmCalloutContentPrefix"),e.consume(t),i):n(t)}function i(n){const r=s.containerState;return r&&(r.calloutContent=!0),e.exit("ofmCalloutContentPrefix"),t(n)}}function gk(e){const t=this.containerState;t?.calloutContent&&e.exit("ofmCalloutContent"),t&&(t.calloutContent=!1),e.exit("ofmCallout")}const yk=35;function kk(e,t,n){const s=this.previous,r=this.events;return function(t){return s&&s>32&&"ofmTag"!==r[r.length-1][1].type?n(t):(e.enter("ofmTag"),e.enter("ofmTagMarker"),e.consume(t),e.exit("ofmTagMarker"),e.enter("ofmTagContent"),i)};function i(t){return t&&t>=48&&t<=57?(e.consume(t),i):t&&(t>=65&&t<=90||t>=97&&t<=122||95===t||45===t||47===t)?(e.consume(t),a):n(t)}function a(n){return n&&(n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||95===n||45===n||47===n)?(e.consume(n),a):(e.exit("ofmTagContent"),e.exit("ofmTag"),t(n))}}const wk=32,bk=33,vk=91,Sk=93,xk=124;function Ck(e,t,n){return function(t){return 33===t?(e.enter("ofmWikilink"),e.enter("ofmWikilinkEmbeddingMarker"),e.consume(t),e.exit("ofmWikilinkEmbeddingMarker"),s):(e.enter("ofmWikilink"),e.enter("ofmWikilinkOpenMarker"),e.consume(t),r)};function s(t){return 91!==t?n(t):(e.enter("ofmWikilinkOpenMarker"),e.consume(t),r)}function r(t){return 91!==t?n(t):(e.consume(t),e.exit("ofmWikilinkOpenMarker"),i)}function i(t){return t===wk?(e.enter("ofmWikilinkWhiteSpace"),e.consume(t),a):35===t?(e.enter("ofmWikilinkHashMarker"),e.consume(t),e.exit("ofmWikilinkHashMarker"),c):t===xk?(e.enter("ofmWikilinkAliasMarker"),e.consume(t),e.exit("ofmWikilinkAliasMarker"),f):t===Sk?(e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):t&&t>wk?(e.enter("ofmWikilinkPath"),e.consume(t),o):n(t)}function a(t){return t===wk?(e.consume(t),a):35===t?(e.exit("ofmWikilinkWhiteSpace"),e.enter("ofmWikilinkHashMarker"),e.consume(t),e.exit("ofmWikilinkHashMarker"),c):t===xk?(e.exit("ofmWikilinkWhiteSpace"),e.enter("ofmWikilinkAliasMarker"),e.consume(t),e.exit("ofmWikilinkAliasMarker"),f):t===Sk?(e.exit("ofmWikilinkWhiteSpace"),e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):t&&t>wk?(e.exit("ofmWikilinkWhiteSpace"),e.enter("ofmWikilinkPath"),e.consume(t),o):n(t)}function o(t){return 35===t?(e.exit("ofmWikilinkPath"),e.enter("ofmWikilinkHashMarker"),e.consume(t),e.exit("ofmWikilinkHashMarker"),c):t===xk?(e.exit("ofmWikilinkPath"),e.enter("ofmWikilinkAliasMarker"),e.consume(t),e.exit("ofmWikilinkAliasMarker"),f):t===Sk?(e.exit("ofmWikilinkPath"),e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):t===wk?e.attempt(Tk("ofmWikilinkPath",!0,!0),l,function(t){return e.consume(t),o})(t):t&&t>wk?(e.consume(t),o):n(t)}function l(t){return 35===t?(e.enter("ofmWikilinkHashMarker"),e.consume(t),e.exit("ofmWikilinkHashMarker"),c):t===xk?(e.enter("ofmWikilinkAliasMarker"),e.consume(t),e.exit("ofmWikilinkAliasMarker"),f):t===Sk?(e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):n(t)}function c(t){return t===wk?(e.enter("ofmWikilinkWhiteSpace"),e.consume(t),u):t===xk?(e.enter("ofmWikilinkAliasMarker"),e.consume(t),e.exit("ofmWikilinkAliasMarker"),f):t===Sk?(e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):t&&t>wk?(e.enter("ofmWikilinkHash"),e.consume(t),d):n(t)}function u(t){return t===wk?(e.consume(t),u):t===xk?(e.exit("ofmWikilinkWhiteSpace"),e.enter("ofmWikilinkAliasMarker"),e.consume(t),e.exit("ofmWikilinkAliasMarker"),f):t===Sk?(e.exit("ofmWikilinkWhiteSpace"),e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):t&&t>wk?(e.exit("ofmWikilinkWhiteSpace"),e.enter("ofmWikilinkHash"),e.consume(t),d):n(t)}function d(t){return t===xk?(e.exit("ofmWikilinkHash"),e.enter("ofmWikilinkAliasMarker"),e.consume(t),e.exit("ofmWikilinkAliasMarker"),f):t===Sk?(e.exit("ofmWikilinkHash"),e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):t===wk?e.attempt(Tk("ofmWikilinkHash",!1,!0),p,function(t){return e.consume(t),d})(t):t&&t>wk?(e.consume(t),d):n(t)}function p(t){return t===xk?(e.enter("ofmWikilinkAliasMarker"),e.consume(t),e.exit("ofmWikilinkAliasMarker"),f):t===Sk?(e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):n(t)}function f(t){return t===wk?(e.enter("ofmWikilinkWhiteSpace"),e.consume(t),h):t===Sk?(e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):t&&t>wk?(e.enter("ofmWikilinkAlias"),e.consume(t),m):n(t)}function h(t){return t===wk?(e.consume(t),h):t===Sk?(e.exit("ofmWikilinkWhiteSpace"),e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):t&&t>wk?(e.exit("ofmWikilinkWhiteSpace"),e.enter("ofmWikilinkAlias"),e.consume(t),m):n(t)}function m(t){return t===Sk?(e.exit("ofmWikilinkAlias"),e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):t===wk?e.attempt(Tk("ofmWikilinkAlias",!1,!1),g,function(t){return e.consume(t),m})(t):t&&t>wk?(e.consume(t),m):n(t)}function g(t){return t===Sk?(e.enter("ofmWikilinkCloseMarker"),e.consume(t),y):n(t)}function y(s){return s!==Sk?n(s):(e.consume(s),e.exit("ofmWikilinkCloseMarker"),e.exit("ofmWikilink"),t(s))}}function Tk(e,t,n){return{tokenize:function(s,r,i){return function(t){return s.exit(e),s.enter("ofmWikilinkWhiteSpace"),s.consume(t),a};function a(e){return e===wk?(s.consume(e),a):t&&35===e||n&&e===xk||e===Sk?(s.exit("ofmWikilinkWhiteSpace"),r(e)):i(e)}}}}function Ok(){const e=this.data();e.micromarkExtensions??=[],e.fromMarkdownExtensions??=[],e.toMarkdownExtensions??=[],e.micromarkExtensions.push(V([{document:{[fk]:{name:"ofmCallout",tokenize:hk,continuation:{tokenize:mk},exit:gk,add:"before"}}},{text:{[yk]:{name:"ofmTag",tokenize:kk}}},{text:{[vk]:{name:"ofmWikilink",tokenize:Ck},[bk]:{name:"ofmWikilink",tokenize:Ck}}}])),e.fromMarkdownExtensions.push([{enter:{ofmCallout(e){this.enter({type:"ofmCallout",kind:"info",folded:void 0,title:"Info",children:[]},e)},ofmCalloutTypeValue(e){const t=this.stack[this.stack.length-1];"ofmCallout"===t.type&&(t.kind=this.sliceSerialize(e),t.title=t.kind.replace(/^\w/,e=>e.toUpperCase()))},ofmCalloutTitle(e){const t=this.stack[this.stack.length-1];"ofmCallout"===t.type&&(t.title=this.sliceSerialize(e))},ofmCalloutFoldable(e){const t=this.stack[this.stack.length-1];"ofmCallout"===t.type&&(t.folded="-"===this.sliceSerialize(e))}},exit:{ofmCallout(e){this.exit(e)}}},{enter:{ofmTag:function(e){this.enter({type:"ofmTag",value:""},e)},ofmTagContent:function(e){const t=this.stack.at(-1);"ofmTag"===t?.type&&(t.value=this.sliceSerialize(e))}},exit:{ofmTag:function(e){this.exit(e)}}},{enter:{ofmWikilink(e){this.enter({type:"ofmWikilink",url:"",hash:"",value:""},e)},ofmWikilinkEmbeddingMarker(){this.stack[this.stack.length-1].type="ofmWikiembedding"},ofmWikilinkPath(e){const t=this.stack[this.stack.length-1];if("ofmWikilink"===t.type||"ofmWikiembedding"===t.type){const n=this.sliceSerialize(e);t.url=n;const s=n.split("/"),r=s[s.length-1];r.includes(".")?t.value=r.split(".").slice(0,-1).join("."):t.value=r}},ofmWikilinkHash(e){const t=this.stack[this.stack.length-1];"ofmWikilink"!==t.type&&"ofmWikiembedding"!==t.type||(t.hash=this.sliceSerialize(e))},ofmWikilinkAlias(e){const t=this.stack[this.stack.length-1];"ofmWikilink"!==t.type&&"ofmWikiembedding"!==t.type||(t.value=this.sliceSerialize(e))}},exit:{ofmWikilink(e){this.exit(e)}}}]),e.toMarkdownExtensions.push({extensions:[{handlers:{ofmCallout(e,t,n,s){const{kind:r,title:i,folded:a}=e;let o="";!0===a&&(o="-"),!1===a&&(o="+");const l=`> [!${r}]${o} ${i}\n`;let c=n.containerFlow(e,s);return c&&(c=n.indentLines(c,(e,t,n)=>">"+(n?"":" ")+e)),l+c}}},{handlers:{ofmTag:e=>`#${e.value}`}},{handlers:{ofmWikilink(e){const t=e.url,n=t.split("/"),s=n[n.length-1],r=(s.includes(".")?s.split(".").slice(0,-1).join("."):s)===e.value?"":`|${e.value}`;return`[[${t}${e.hash?`#${e.hash}`:""}${r}]]`},ofmWikiembedding(e){const t=e.url,n=t.split("/"),s=n[n.length-1],r=(s.includes(".")?s.split(".").slice(0,-1).join("."):s)===e.value?"":`|${e.value}`;return`![[${t}${e.hash?`#${e.hash}`:""}${r}]]`}}}]})}var Dk,Mk={exports:{}};const Ak=Y((Dk||(Dk=1,function(e){!function(){var t;function n(e){for(var t,n,s,r,i=1,a=[].slice.call(arguments),o=0,l=e.length,c="",u=!1,d=!1,p=function(){return a[i++]},f=function(){for(var n="";/\d/.test(e[o]);)n+=e[o++],t=e[o];return n.length>0?parseInt(n):null};o<l;++o)if(t=e[o],u)switch(u=!1,"."==t?(d=!1,t=e[++o]):"0"==t&&"."==e[o+1]?(d=!0,t=e[o+=2]):d=!0,r=f(),t){case"b":c+=parseInt(p(),10).toString(2);break;case"c":c+="string"==typeof(n=p())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":c+=parseInt(p(),10);break;case"f":s=String(parseFloat(p()).toFixed(r||6)),c+=d?s:s.replace(/^0/,"");break;case"j":c+=JSON.stringify(p());break;case"o":c+="0"+parseInt(p(),10).toString(8);break;case"s":c+=p();break;case"x":c+="0x"+parseInt(p(),10).toString(16);break;case"X":c+="0x"+parseInt(p(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?u=!0:c+=t;return c}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(Mk)),Mk.exports)),Nk=Object.assign(Ek(Error),{eval:Ek(EvalError),range:Ek(RangeError),reference:Ek(ReferenceError),syntax:Ek(SyntaxError),type:Ek(TypeError),uri:Ek(URIError)});function Ek(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const s=t?Ak(t,...n):t;return new e(s)}}const Ik={}.hasOwnProperty,Rk={yaml:"-",toml:"+"};function Lk(e){const t=[];let n=-1;const s=Array.isArray(e)?e:e?[e]:["yaml"];for(;++n<s.length;)t[n]=Pk(s[n]);return t}function Pk(e){let t=e;if("string"==typeof t){if(!Ik.call(Rk,t))throw Nk("Missing matter definition for `%s`",t);t={type:t,marker:Rk[t]}}else if("object"!=typeof t)throw Nk("Expected matter to be an object, not `%j`",t);if(!Ik.call(t,"type"))throw Nk("Missing `type` in matter `%j`",t);if(!Ik.call(t,"fence")&&!Ik.call(t,"marker"))throw Nk("Missing `marker` or `fence` in matter `%j`",t);return t}function $k(e){const t=e.anywhere,n=e.type,s=n+"Fence",r=s+"Sequence",i=n+"Value",a={tokenize:function(e,t,n){let i=0;return function(t){return t===o.charCodeAt(i)?(e.enter(s),e.enter(r),a(t)):n(t)};function a(t){return i===o.length?(e.exit(r),P(t)?(e.enter("whitespace"),l(t)):c(t)):t===o.charCodeAt(i++)?(e.consume(t),a):n(t)}function l(t){return P(t)?(e.consume(t),l):(e.exit("whitespace"),c(t))}function c(r){return null===r||B(r)?(e.exit(s),t(r)):n(r)}},partial:!0};let o,l=0;return{tokenize:function(c,u,d){const p=this;return function(i){const a=p.now();return 1!==a.column||1!==a.line&&!t||(o=Vk(e,"open"),l=0,i!==o.charCodeAt(l))?d(i):(c.enter(n),c.enter(s),c.enter(r),f(i))};function f(e){return l===o.length?(c.exit(r),P(e)?(c.enter("whitespace"),h(e)):m(e)):e===o.charCodeAt(l++)?(c.consume(e),f):d(e)}function h(e){return P(e)?(c.consume(e),h):(c.exit("whitespace"),m(e))}function m(t){return B(t)?(c.exit(s),c.enter("lineEnding"),c.consume(t),c.exit("lineEnding"),o=Vk(e,"close"),l=0,c.attempt(a,w,g)):d(t)}function g(e){return null===e||B(e)?k(e):(c.enter(i),y(e))}function y(e){return null===e||B(e)?(c.exit(i),k(e)):(c.consume(e),y)}function k(e){return null===e?d(e):(c.enter("lineEnding"),c.consume(e),c.exit("lineEnding"),c.attempt(a,w,g))}function w(e){return c.exit(n),u(e)}},concrete:!0}}function Vk(e,t){return e.marker?Bk(e.marker,t).repeat(3):Bk(e.fence,t)}function Bk(e,t){return"string"==typeof e?e:e[t]}function Fk(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function zk(e){return function(t){this.enter({type:e.type,value:""},t),this.buffer()}}function Wk(e){const t=this.resume(),n=this.stack[this.stack.length-1];this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,"")}function jk(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function _k(e){const t=Uk(e,"open"),n=Uk(e,"close");return function(e){return t+(e.value?"\n"+e.value:"")+"\n"+n}}function Uk(e,t){return e.marker?Kk(e.marker,t).repeat(3):Kk(e.fence,t)}function Kk(e,t){return"string"==typeof e?e:e[t]}function qk(e){const t=e||"yaml",n=this.data(),s=n.micromarkExtensions||(n.micromarkExtensions=[]),r=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);s.push(function(e){const t=Lk(e),n={};let s=-1;for(;++s<t.length;){const e=t[s],r=Vk(e,"open").charCodeAt(0),i=$k(e),a=n[r];Array.isArray(a)?a.push(i):n[r]=[i]}return{flow:n}}(t)),r.push(function(e){const t=Lk(e),n={},s={};let r=-1;for(;++r<t.length;){const e=t[r];n[e.type]=zk(e),s[e.type]=Wk,s[e.type+"Value"]=jk}return{enter:n,exit:s}}(t)),i.push(function(e){const t=[],n={},s=Lk(e);let r=-1;for(;++r<s.length;){const e=s[r];n[e.type]=_k(e);const i=Uk(e,"open");t.push({atBreak:!0,character:i.charAt(0),after:Fk(i.charAt(1))})}return{unsafe:t,handlers:n}}(t))}const Hk=q().use(H).use(Cs).freeze(),Yk={tokenize:function(e,t,n){const s=this,r=s.events[s.events.length-1],i=r&&"linePrefix"===r[1].type?r[2].sliceSerialize(r[1],!0).length:0;let a=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),o(t)};function o(t){return 36===t?(e.consume(t),a++,o):a<2?n(t):(e.exit("mathFlowFenceSequence"),$(e,l,"whitespace")(t))}function l(t){return null===t||B(t)?u(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return null===t||B(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),u(t)):36===t?n(t):(e.consume(t),c)}function u(n){return e.exit("mathFlowFence"),s.interrupt?t(n):e.attempt(Jk,d,m)(n)}function d(t){return e.attempt({tokenize:g,partial:!0},m,p)(t)}function p(t){return(i?$(e,f,"linePrefix",i+1):f)(t)}function f(t){return null===t?m(t):B(t)?e.attempt(Jk,d,m)(t):(e.enter("mathFlowValue"),h(t))}function h(t){return null===t||B(t)?(e.exit("mathFlowValue"),f(t)):(e.consume(t),h)}function m(n){return e.exit("mathFlow"),t(n)}function g(e,t,n){let r=0;return $(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),i(t)},"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function i(t){return 36===t?(r++,e.consume(t),i):r<a?n(t):(e.exit("mathFlowFenceSequence"),$(e,o,"whitespace")(t))}function o(s){return null===s||B(s)?(e.exit("mathFlowFence"),t(s)):n(s)}}},concrete:!0,name:"mathFlow"},Jk={tokenize:function(e,t,n){const s=this;return function(n){return null===n?t(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),r)};function r(e){return s.parser.lazy[s.now().line]?n(e):t(e)}},partial:!0};function Gk(e){let t=(e||{}).singleDollarTextMath;return null==t&&(t=!0),{tokenize:function(e,n,s){let r,i,a=0;return function(t){return e.enter("mathText"),e.enter("mathTextSequence"),o(t)};function o(n){return 36===n?(e.consume(n),a++,o):a<2&&!t?s(n):(e.exit("mathTextSequence"),l(n))}function l(t){return null===t?s(t):36===t?(i=e.enter("mathTextSequence"),r=0,u(t)):32===t?(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"),c(t))}function c(t){return null===t||32===t||36===t||B(t)?(e.exit("mathTextData"),l(t)):(e.consume(t),c)}function u(t){return 36===t?(e.consume(t),r++,u):r===a?(e.exit("mathTextSequence"),e.exit("mathText"),n(t)):(i.type="mathTextData",c(t))}},resolve:Qk,previous:Zk,name:"mathText"}}function Qk(e){let t,n,s=e.length-4,r=3;if(!("lineEnding"!==e[r][1].type&&"space"!==e[r][1].type||"lineEnding"!==e[s][1].type&&"space"!==e[s][1].type))for(t=r;++t<s;)if("mathTextData"===e[t][1].type){e[s][1].type="mathTextPadding",e[r][1].type="mathTextPadding",r+=2,s-=2;break}for(t=r-1,s++;++t<=s;)void 0===n?t!==s&&"lineEnding"!==e[t][1].type&&(n=t):t!==s&&"lineEnding"!==e[t][1].type||(e[n][1].type="mathTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),s-=t-n-2,t=n+2),n=void 0);return e}function Zk(e){return 36!==e||"characterEscape"===this.events[this.events.length-1][1].type}const Xk={};function ew(e){const t=e||Xk,n=this.data(),s=n.micromarkExtensions||(n.micromarkExtensions=[]),r=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);s.push(function(e){return{flow:{36:Yk},text:{36:Gk(e)}}}(t)),r.push(function(){return{enter:{mathFlow:function(e){this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[{type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]}]}},e)},mathFlowFenceMeta:function(){this.buffer()},mathText:function(e){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},e),this.buffer()}},exit:{mathFlow:function(e){const t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),n=this.stack[this.stack.length-1];Q("math"===n.type),this.exit(e),n.value=t;const s=n.data.hChildren[0];Q("element"===s.type),Q("code"===s.tagName),s.children.push({type:"text",value:t}),this.data.mathFlowInside=void 0},mathFlowFence:function(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)},mathFlowFenceMeta:function(){const e=this.resume(),t=this.stack[this.stack.length-1];Q("math"===t.type),t.meta=e},mathFlowValue:e,mathText:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];Q("inlineMath"===n.type),this.exit(e),n.value=t,n.data.hChildren.push({type:"text",value:t})},mathTextData:e}};function e(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}()),i.push(function(e){let t=(e||{}).singleDollarTextMath;return null==t&&(t=!0),n.peek=function(){return"$"},{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:"\n",inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:function(e,t,n,s){const r=e.value||"",i=n.createTracker(s),a="$".repeat(Math.max(Z(r,"$")+1,2)),o=n.enter("mathFlow");let l=i.move(a);if(e.meta){const t=n.enter("mathFlowMeta");l+=i.move(n.safe(e.meta,{after:"\n",before:l,encode:["$"],...i.current()})),t()}return l+=i.move("\n"),r&&(l+=i.move(r+"\n")),l+=i.move(a),o(),l},inlineMath:n}};function n(e,n,s){let r=e.value||"",i=1;for(t||i++;new RegExp("(^|[^$])"+"\\$".repeat(i)+"([^$]|$)").test(r);)i++;const a="$".repeat(i);/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^\$|\$$/.test(r))&&(r=" "+r+" ");let o=-1;for(;++o<s.unsafe.length;){const e=s.unsafe[o];if(!e.atBreak)continue;const t=s.compilePattern(e);let n;for(;n=t.exec(r);){let e=n.index;10===r.codePointAt(e)&&13===r.codePointAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(n.index+1)}}return a+r+a}}(t))}function tw(e){const t=[];let n=0;for(;n<e.length;){const s=e.indexOf("%%",n);if(-1===s)break;const r=e.indexOf("%%",s+2);if(-1===r)break;const i=r+2;t.push({start:s,end:i}),n=i}return t}const nw=Hk().use(qk,["yaml"]).use(ew).use(Ok),sw=new Set(["code","inlineCode","html","yaml","math","inlineMath","image","definition"]);function rw(e){const t=new Set;return function e(n,s){if(("code"===n.type||"math"===n.type||"html"===n.type&&"paragraph"!==s?.type)&&n.position)for(let r=n.position.start.line-1;r<n.position.end.line;r++)t.add(r);else n.children?.forEach(t=>{e(t,n)})}(nw.parse(e)),t}function iw(e,t,n={}){let s="",r=0;for(const[i,a]of function(e,t=sw,n=!0){const s=[];!function r(i){if(t.has(i.type)&&i.position&&(n||!["image","definition"].includes(i.type))){const{start:e,end:t}=i.position;return void(null!=e.offset&&null!=t.offset&&s.push([e.offset,t.offset]))}if(n&&"link"===i.type&&i.position&&i.children?.length){const e=i.position.start.offset,t=i.position.end.offset,n=i.children[0].position?.start.offset,r=i.children.at(-1)?.position?.end.offset;null!=e&&null!=t&&null!=n&&null!=r&&s.push([e,n],[r,t])}if("ofmCallout"===i.type&&null!=i.position?.start.offset){const t=i.position.start.offset,n=e.indexOf("\n",t);s.push([t,n<0?e.length:n])}i.children?.forEach(r)}(nw.parse(e)),s.push(...tw(e).map(({start:e,end:t})=>[e,t])),s.sort((e,t)=>e[0]-t[0]);const r=[];for(const i of s){const e=r.at(-1);e&&i[0]<=e[1]?e[1]=Math.max(e[1],i[1]):r.push(i)}return r}(e,sw,n.protectLinkSyntax??!0))s+=t(e.slice(r,i))+e.slice(i,a),r=a;return s+t(e.slice(r))}const aw=` ${String.fromCharCode(57345)}`,ow=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,lw=new RegExp("\\p{P}","u");function cw(e,t){let n=0;for(let s=t-1;s>=0&&"\\"===e[s];s-=1)n+=1;return n%2==1}function uw(e,t,n){let s=t;for(;e[s]===n;)s+=1;return s-t}function dw(e,t,n){for(let s=t;s<e.length;s+=1){if("`"!==e[s])continue;const t=uw(e,s,"`");if(t===n)return s+t;s+=t-1}return e.length}function pw(e){const t=su(e,{includeEmbeds:!0,includeLinks:!0});if(0===t.length)return e;let n="",s=0;for(const r of t)n+=e.slice(s,r.from),n+=r.raw.replace(/^(!?\[\[[^\]\r\n|]*?)\^#/u,"$1#"),s=r.to;return n+e.slice(s)}function fw(e,t){for(let n=t;n<e.length-1;n+=1){if("`"===e[n]&&!cw(e,n)){const t=uw(e,n,"`");n=dw(e,n+t,t)-1;continue}if("*"===e[n]&&"*"===e[n+1]&&"*"!==e[n-1]&&"*"!==e[n+2]&&!cw(e,n))return n}return-1}const hw=/^([ \t]*)([-+*]|\d{1,9}[.)])([ \t]+|$)/;function mw(e){let t=0;for(const n of e)t+="\t"!==n?1:4-t%4;return t}function gw(e){return function(e){const t=rw(e),n=e.split("\n"),s=[];let r;const i=(e,t)=>{if(!t)return e;const n=/^[ \t]*/.exec(e)?.[0]??"";return`${" ".repeat(Math.max(0,mw(n)+t))}${e.slice(n.length)}`},a=[];let o=!1,l=null,c="---"===n[0];return n.forEach((e,n)=>{if(c)return s.push(e),void(n>0&&/^(?:---|\.\.\.)\s*$/.test(e)&&(c=!1));if(t.has(n)){const t=a[a.length-1];return void s.push(i(e,t?Math.min(0,t.markerIndent-t.sourceIndent):0))}const u=/^[ \t]*(`{3,}|~{3,})(.*)$/.exec(e);if(r)return s.push(i(e,r.indentShift)),void(u&&u[1][0]===r.character&&u[1].length>=r.length&&""===u[2].trim()&&(r=void 0));if(u){const t=a[a.length-1],n=mw(/^[ \t]*/.exec(e)?.[0]??"");o&&t&&n<t.sourceContentIndent&&(a.length=0);const l=t&&n>=t.sourceContentIndent?Math.min(0,t.markerIndent-t.sourceIndent):0;return r={character:u[1][0],length:u[1].length,indentShift:l},s.push(i(e,l)),void(o=!1)}if(""===e.trim())return o=!0,void s.push(e);const d=/^[ \t]*/.exec(e)?.[0]??"",p=mw(d);if(null!=l&&p>=l){const t=a[a.length-1];return s.push(i(e,t?Math.min(0,t.markerIndent-t.sourceIndent):0)),void(o=!1)}l=null;const f=hw.exec(e);if(!f){const t=a[a.length-1];o&&t&&p<t.sourceContentIndent&&(a.length=0);const n=t&&p>=t.sourceContentIndent?Math.min(0,t.markerIndent-t.sourceIndent):0;return s.push(i(e,n)),void(o=!1)}const h=a.length>0&&p>a[a.length-1].sourceIndent;for(;a.length>0&&p<=a[a.length-1].sourceIndent;)a.pop();const m=a[a.length-1],g=p+(m?Math.min(0,m.markerIndent-m.sourceIndent):0);if(o&&m&&g>=m.contentIndent+4)return l=m.sourceContentIndent+4,s.push(i(e,Math.min(0,m.markerIndent-m.sourceIndent))),void(o=!1);const y=m?!o&&g>=m.contentIndent+4?m.contentIndent:Math.max(m.contentIndent,g):p,k=f[2],w=""!==e.slice(f[0].length).trim();h&&m?.hasContent&&!o&&(!w||/^\d/.test(k)&&1!==parseInt(k,10))&&s.push(""),s.push(`${" ".repeat(y)}${e.slice(d.length)}`),a.push({sourceIndent:p,markerIndent:y,contentIndent:y+k.length+1,sourceContentIndent:p+k.length+1,hasContent:w}),o=!1}),s.join("\n")}(function(e,t){const n=e.split("\n"),s=rw(e),r=[];let i,a="---"===n[0];for(let o=0;o<n.length;o++){const e=n[o];if(s.has(o)){r.push(e);continue}if(a){r.push(e),o>0&&/^(?:---|\.\.\.)\s*$/.test(e)&&(a=!1);continue}const l=/^[ \t]*(`{3,}|~{3,})(.*)$/.exec(e);if(i){r.push(e),l&&l[1][0]===i.marker&&l[1].length>=i.length&&!l[2].trim()&&(i=void 0);continue}if(l){i={marker:l[1][0],length:l[1].length},r.push(e);continue}if(!/^ {0,3}> ?/.test(e)){r.push(e);continue}const c=[];let u=o;for(;u<n.length;){const e=/^ {0,3}> ?(.*)$/.exec(n[u]);if(!e)break;c.push(e[1]),u++}const d=c.join("\n"),p=t(d);r.push(...p===d?n.slice(o,u):p.split("\n").map(e=>`> ${e}`)),o=u-1}return r.join("\n")}(e,gw))}function yw(e){const t=gw(function(e){return e.replace(/\r\n/g,"\n").replace(/\n+$/,"\n")}(e));return iw(t,e=>e.split("\n").map(e=>/^(?: {4}|\t)/.test(e)?e:function(e){let t="",n=0;for(;n<e.length;){if("`"===e[n]&&!cw(e,n)){const s=uw(e,n,"`"),r=dw(e,n+s,s);t+=e.slice(n,r),n=r;continue}if("*"!==e[n]||"*"!==e[n+1]||"*"===e[n-1]||"*"===e[n+2]||cw(e,n)){t+=e[n],n+=1;continue}const s=fw(e,n+2);if(s<0){t+=e.slice(n);break}const r=e.slice(n+2,s),i=Array.from(r).at(-1)??"",a=Array.from(e.slice(s+2))[0]??"",o=r.length>0&&lw.test(i)&&ow.test(a),l=s+2;t+=e.slice(n,l),o&&(t+=aw),n=l}return t}(function(e){let t="",n=0,s=0;for(;n<e.length;){if("`"!==e[n]||cw(e,n)){n+=1;continue}t+=pw(e.slice(s,n));const r=uw(e,n,"`"),i=dw(e,n+r,r);t+=e.slice(n,i),n=i,s=n}return t+pw(e.slice(s))}(e))).join("\n"))}const kw=(e,t)=>{let n=-1;for(let s=0;s<e.length;s++){const[r,i]=e[s];if("enter"!==r||"obsidianHighlightDelimiter"!==i.type)continue;if(n<0){n=s;continue}const a=e[n][1];if(a.end.offset===i.start.offset){n=-1;continue}const o={type:"obsidianHighlight",start:a.start,end:i.end},l={type:"obsidianHighlightContent",start:a.end,end:i.start};let c=e.slice(n+2,s);const u=new Set;for(const e of t.parser.constructs.insideSpan.null??[])e.resolveAll&&!u.has(e.resolveAll)&&(u.add(e.resolveAll),c=e.resolveAll(c,t));a.type=i.type="obsidianHighlightMarker";const d=[["enter",o,t],["enter",a,t],["exit",a,t],["enter",l,t],...c,["exit",l,t],["enter",i,t],["exit",i,t],["exit",o,t]];e.splice(n,s+2-n,...d),s=n+d.length-1,n=-1}for(const[,s]of e)"obsidianHighlightDelimiter"===s.type&&(s.type="data");return e},ww=function(e,t,n){let s=0;const r=this.previous,i="characterEscape"===this.events.at(-1)?.[1].type;return t=>61!==r||i?(e.enter("obsidianHighlightDelimiter"),a(t)):n(t);function a(r){return 61===r?2===s?n(r):(e.consume(r),s++,a):2!==s?n(r):(e.exit("obsidianHighlightDelimiter"),t(r))}},bw=(e,t,n,s)=>{const r=String(e.colorEmoji??""),i=n.createTracker(s),a=n.enter("phrasing");let o=i.move(`==${r}`);return o+=n.containerPhrasing(e,{...i.current(),before:"=",after:"="}),o+="==",a(),o};function vw(e){if("listItem"===e.type&&e.children)for(let t=0;t<e.children.length;t++){const n=e.children[t];"image-block"===n.type&&(e.children[t]={type:"paragraph",children:[{type:"image",url:n.url,alt:n.alt,title:n.title}]})}if(e.children)for(const t of e.children)vw(t)}const Sw=e=>"image"===e?.type||"ofmWikiembedding"===e?.type;function xw(e){if("paragraph"===e.type&&e.children){const t=e.children;e.children=t.flatMap((e,n)=>{if("break"===e.type&&e.data?.isInline&&(Sw(t[n-1])||Sw(t[n+1])))return[{type:"break"}];if("text"!==e.type||!e.value?.includes("\n"))return[e];const s=e.value,r=Sw(t[n-1])&&s.startsWith("\n"),i=Sw(t[n+1])&&s.endsWith("\n");if(!r&&!i)return[e];const a=r?1:0,o=i?s.length-1:s.length,l=s.slice(a,Math.max(a,o));return[...r?[{type:"break"}]:[],...l?[{...e,value:l,position:void 0}]:[],...i&&o>=a?[{type:"break"}]:[]]})}e.children?.forEach(xw)}const Cw=()=>xw,Tw=Object.assign(Rc("remarkImageSoftBreaks",()=>Cw),{syntax:Cw});function Ow(e,t){return{type:"image",url:e,alt:t,title:null}}function Dw(e,t){if("number"==typeof e&&"number"==typeof t)return{start:{offset:e},end:{offset:t}}}function Mw(e,t){const n=e.position?.start?.offset,s=e.position?.end?.offset;return!("number"!=typeof n||"number"!=typeof s||s<=n)&&t.slice(n,s).includes("|")}function Aw(){const e=this.data("toMarkdownExtensions")||[];this.data("toMarkdownExtensions",[...e,{handlers:{obsidianInlineSource:e=>e.value||""}}])}function Nw(e,t){return Object.assign(Rc(e,()=>t),{syntax:t})}const Ew=Nw("remarkOfm",function(){this.use(Ok),this.use(Aw)}),Iw=Nw("remarkOfmTrailingSpaceFix",function(){return(e,t)=>{const n="string"==typeof t?.value?t.value:"";n&&function(e,t){!function e(n){if("paragraph"===n.type&&Array.isArray(n.children)&&n.children.length>0){const e=n.children[n.children.length-1],s=n.position?.end?.offset,r=e.position?.end?.offset;if("number"==typeof s&&"number"==typeof r&&s>r){const i=t.slice(r,s);/^[ \t]+$/.test(i)&&n.children.push({type:"text",value:i,position:{start:e.position?.end,end:n.position?.end}})}}if(Array.isArray(n.children))for(const t of n.children)e(t)}(e)}(e,n)}}),Rw=Nw("remarkWikiembedSoftBreakFix",function(){return e=>{!function(e){!function e(t){if("paragraph"===t.type&&Array.isArray(t.children)){const e=t.children.filter(e=>"ofmWikiembedding"===e.type).length,n=t.children.some(e=>"text"===e.type&&"string"==typeof e.value&&e.value.includes("\n"));e>1&&n&&(t.children=t.children.flatMap(e=>function(e){return"text"===e.type&&"string"==typeof e.value&&e.value.includes("\n")?e.value.split("\n").flatMap((t,n)=>{const s=[];return n>0&&s.push({type:"break"}),t&&s.push({...e,value:t,position:void 0}),s}):[e]}(e)))}if(Array.isArray(t.children))for(const n of t.children)e(n)}(e)}(e)}}),Lw=Nw("remarkWikilinkAliasFix",()=>(e,t)=>{const n="string"==typeof t?.value?t.value:"";if(!n)return;const s=e=>{if(e.children)for(const t of e.children)"ofmWikilink"!==t.type?"children"in t&&t.children&&s(t):t.explicitAlias=Mw(t,n)};s(e)}),Pw=Nw("remarkLifeOS",function(){return e=>{!function e(t){const n=t;"code"===n.type&&yu(n.lang)&&(n.type="lifeosBlock",n.value=n.value||""),n.children&&Array.isArray(n.children)&&n.children.forEach(e)}(e)}}),$w=Nw("remarkTagFix",()=>(e,t)=>{const n="string"==typeof t?.value?t.value:"",s=Yu(n),r=su(n,{includeEmbeds:!0,includeLinks:!0}),i=e=>"text"===e.type,a=(e,t)=>{if(i(t)&&0===t.value.length)return;const n=e[e.length-1];if(n&&i(n)&&i(t))return n.value+=t.value,void(t.position?.end&&(n.position={...n.position,end:t.position.end}));e.push(t)},o=e=>{const t=e.position?.start?.offset,n=e.position?.end?.offset;return"number"==typeof t&&"number"==typeof n&&s.some(e=>e.from===t&&e.to===n)},l=e=>{const t=e.position?.start?.offset;return"number"==typeof t&&Hu(n,t)},c=e=>{const t=e.position?.start?.offset;return"number"==typeof t&&r.some(e=>e.from<=t&&t<e.to)},u=e=>{const t=e.value,n=e.position?.start?.offset,r=e.position?.end?.offset;let i=0,a=n??0;const o=[],l="number"==typeof n&&"number"==typeof r?s.filter(e=>n<=e.from&&e.to<=r):Yu(t);for(const s of l){const e="number"==typeof n?t.indexOf(s.tag,i):s.from;e<0||(e>i&&o.push({type:"text",value:t.slice(i,e),position:Dw("number"==typeof n?a:void 0,"number"==typeof n?s.from:void 0)}),o.push({type:"ofmTag",value:s.value,position:Dw("number"==typeof n?s.from:void 0,"number"==typeof n?s.to:void 0)}),i=e+s.tag.length,a=s.to)}return i<t.length&&o.push({type:"text",value:t.slice(i),position:Dw("number"==typeof n?a:void 0,"number"==typeof r?r:void 0)}),o.some(e=>"ofmTag"===e.type)?o:[e]},d=e=>{if(!e.children)return;const t=[];for(const s of e.children)"ofmTag"!==s.type?"text"===s.type?a(t,s):("children"in s&&s.children&&d(s),t.push(s)):!o(s)||l(s)||c(s)?a(t,{type:"text",value:`#${s.value}`,position:s.position}):t.push(s);const n=[];for(const s of t)if(i(s))for(const e of u(s))a(n,e);else n.push(s);e.children=n};d(e)}),Vw=Nw("remarkSetextFix",function(){return e=>{!function e(t){if("listItem"===t.type&&t.children){const e=[];let n=!1;for(const s of t.children)if("heading"===s.type&&s.position&&s.position.end.line>s.position.start.line){n=!0;const r=s.children?.[0];if(r&&"text"===r.type&&"string"==typeof r.value){const e=r.value,n=Zu(e),i=n?Gu(n.marker):null;n&&null!=i&&(t.checked=i,r.value=e.slice(n.markerTextLength),""===r.value&&s.children&&s.children.length>1&&s.children.shift())}e.push({type:"paragraph",children:s.children}),e.push({type:"list",ordered:!1,spread:!1,children:[{type:"listItem",spread:!1,checked:null,children:[{type:"paragraph",children:[]}]}]})}else e.push(s);n&&(t.children=e)}if(t.children)for(const n of t.children)e(n)}(e)}}),Bw=Nw("remarkImageListItemFix",function(){return e=>{vw(e)}}),Fw=Nw("remarkLooseMarkdownImage",function(){return e=>{!function(e){!function e(t){if(Array.isArray(t.children)){"paragraph"===t.type&&(t.children=t.children.flatMap(e=>function(e){if("text"!==e.type||"string"!=typeof e.value)return[e];const t=Su(e.value);if(0===t.length)return[e];const n=[];let s=0;for(const r of t)r.from>s&&n.push({type:"text",value:e.value.slice(s,r.from)}),n.push(Ow(r.target,r.alt)),s=r.to;return s<e.value.length&&n.push({type:"text",value:e.value.slice(s)}),n}(e)));for(const n of t.children)e(n)}}(e)}(e)}}),zw=Nw("remarkExtendedTask",function(){return(e,t)=>{!function(e,t){!function e(n){if("listItem"===n.type&&null==n.checked&&n.children?.length){const e=n.children[0];if("paragraph"===e.type&&e.children?.length){const s=e.children[0];if("text"===s.type&&"string"==typeof s.value){const r=s.value,i=Zu(r),a=i?Gu(i.marker):null,o=s.position?.start?.offset,l=void 0===t?i:"number"==typeof o?Zu(t.slice(o)):null;i&&null!=a&&l?.marker===i.marker&&(n.checked=a,s.value=r.slice(i.markerTextLength),""===s.value&&e.children.shift())}}}if(n.children)for(const t of n.children)e(t)}(e)}(e,String(t.value))}}),Ww=Nw("remarkEmptyListItemFix",function(){return e=>{!function e(t){if("listItem"===t.type&&(t.children&&0!==t.children.length||(t.children=[{type:"paragraph",children:[]}])),t.children){t.children=t.children.filter(e=>!("text"===e.type&&""===e.value));for(const n of t.children)e(n)}}(e)}}),jw=Nw("remarkCjkStrongBoundaryFix",()=>e=>{!function(e){!function e(t){Array.isArray(t.children)&&(t.children=t.children.filter(t=>"text"===t.type&&"string"==typeof t.value?(t.value=t.value.replaceAll(aw,""),t.value.length>0):(e(t),!0)))}(e)}(e)}),_w=Nw("remarkFrontmatter",function(){this.use(qk)}),Uw=Nw("remarkInlineCodeWhitespace",function(){return function e(t){"inlineCode"===t.type&&"string"==typeof t.value&&(t.value=t.value.replace(/\r\n?|\n/g," ")),t.children?.forEach(e)}}),Kw=[Nw("remarkHighlight",function(){const e=this.data(),t={canContainEols:["obsidianHighlight"],enter:{obsidianHighlight(e){this.enter({type:"obsidianHighlight",children:[]},e)}},exit:{obsidianHighlight(e){const t=this.stack.at(-1),n=t.children[0],s="text"===n?.type?Gy(n.value??""):void 0;s&&(n.value.length>s.emoji.length||t.children.length>1)&&(t.colorEmoji=s.emoji,n.value=n.value.slice(s.emoji.length),n.value||t.children.shift()),this.exit(e)}}};(e.micromarkExtensions??(e.micromarkExtensions=[])).push(function(){const e={name:"obsidianHighlight",tokenize:ww,resolveAll:kw};return{text:{61:e},insideSpan:{null:[e]}}}()),(e.fromMarkdownExtensions??(e.fromMarkdownExtensions=[])).push(t),(e.toMarkdownExtensions??(e.toMarkdownExtensions=[])).push({unsafe:[{character:"=",inConstruct:"phrasing"}],handlers:{obsidianHighlight:bw}})}),Uw,Vw,Ew,Iw,Rw,Lw,$w,zw,Ww,Pw,_w,Fw,Bw,Tw,jw];Kw.map(e=>e.syntax);const qw=Mc("callout",()=>({content:"block+",group:"block",defining:!0,attrs:{kind:{default:"info"},title:{default:""},folded:{default:null}},parseDOM:[{tag:"div[data-callout]",getAttrs:e=>{const t=e;return{kind:Bc(t.getAttribute("data-callout-kind")),title:t.getAttribute("data-callout-title")||"",folded:t.hasAttribute("data-callout-folded")?"true"===t.getAttribute("data-callout-folded"):null}}}],toDOM:e=>{const t=Bc(e.attrs.kind),n="string"==typeof e.attrs.title?e.attrs.title:"";return["div",{"data-callout":"true","data-callout-kind":t,"data-callout-title":n,"data-callout-folded":null==e.attrs.folded?null:String(e.attrs.folded),class:`callout callout-${t}`},["div",{class:"callout-title"},Wc(t,n)],["div",{class:"callout-content"},0]]},parseMarkdown:{match:e=>"ofmCallout"===e.type,runner:(e,t,n)=>{const s=t,r=Bc(s.kind);e.openNode(n,{kind:r,title:s.title||"",folded:s.folded??null}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"callout"===e.type.name,runner:(e,t)=>{const n=Bc(t.attrs.kind),s="string"==typeof t.attrs.title?t.attrs.title:"",r=`[!${n}]${!0===t.attrs.folded?"-":!1===t.attrs.folded?"+":""}${s?` ${s}`:""}`;e.openNode("blockquote"),e.openNode("paragraph").addNode("html",void 0,r).closeNode(),e.next(t.content),e.closeNode()}}}));function Hw(e){return String(e||"").toUpperCase()}function Yw(){return function(e){const t=function(e){const t=new Map;if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return X(e,"definition",function(e){const n=Hw(e.identifier);n&&!t.get(n)&&t.set(n,e)}),function(e){const n=Hw(e);return t.get(n)}}(e);X(e,function(e,n,s){if("definition"===e.type&&void 0!==s&&"number"==typeof n)return s.children.splice(n,1),[ee,n];if("imageReference"===e.type||"linkReference"===e.type){const r=t(e.identifier);if(r&&s&&"number"==typeof n)return s.children[n]="imageReference"===e.type?{type:"image",url:r.url,title:r.title,alt:e.alt}:{type:"link",url:r.url,title:r.title,children:e.children},[ee,n]}})}}function Jw(e,t){if(!(t.childCount>=1&&"hardbreak"===t.lastChild?.type.name))return void e.next(t.content);const n=[];t.content.forEach((e,s,r)=>{r!==t.childCount-1&&n.push(e)}),e.next(Ve.fromArray(n))}function Gw(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-commonmark",...t}}),e}var Qw=Ic("emphasis");Gw(Qw,{displayName:"Attr<emphasis>",group:"Emphasis"});var Zw=Ac("emphasis",e=>({attrs:{marker:{default:e.get(xl).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>"italic"===e}],toDOM:t=>["em",e.get(Qw.key)(t)],parseMarkdown:{match:e=>"emphasis"===e.type,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"emphasis"===e.type.name,runner:(e,t)=>{e.withMark(t,"emphasis",void 0,{marker:t.attrs.marker})}}}));Gw(Zw.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"}),Gw(Zw.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});var Xw=bc("ToggleEmphasis",e=>()=>js(Zw.type(e)));Gw(Xw,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});var eb=vc(e=>Sr(/(?:^|[^*])\*([^*]+)\*$/,Zw.type(e),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}));Gw(eb,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});var tb=vc(e=>Sr(/\b_(?![_\s])(.*?[^_\s])_\b/,Zw.type(e),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}}));Gw(tb,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});var nb=Nc("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:e=>{const t=e.get(Pl);return()=>t.call(Xw.key)}}});Gw(nb.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"}),Gw(nb.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});var sb=Ic("strong");Gw(sb,{displayName:"Attr<strong>",group:"Strong"});var rb=Ac("strong",e=>({attrs:{marker:{default:e.get(xl).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:e=>"normal"!=e.style.fontWeight&&null},{tag:"strong"},{style:"font-style",getAttrs:e=>"bold"===e},{style:"font-weight=400",clearMark:e=>"strong"==e.type.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:t=>["strong",e.get(sb.key)(t)],parseMarkdown:{match:e=>"strong"===e.type,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strong"===e.type.name,runner:(e,t)=>{e.withMark(t,"strong",void 0,{marker:t.attrs.marker})}}}));Gw(rb.mark,{displayName:"MarkSchema<strong>",group:"Strong"}),Gw(rb.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});var ib=bc("ToggleStrong",e=>()=>js(rb.type(e)));Gw(ib,{displayName:"Command<toggleStrongCommand>",group:"Strong"});var ab=vc(e=>Sr(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),rb.type(e),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));Gw(ab,{displayName:"InputRule<strong>",group:"Strong"});var ob=Nc("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:e=>{const t=e.get(Pl);return()=>t.call(ib.key)}}});Gw(ob.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"}),Gw(ob.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});var lb=Ic("inlineCode");Gw(lb,{displayName:"Attr<inlineCode>",group:"InlineCode"});var cb=Ac("inlineCode",e=>({priority:100,code:!0,parseDOM:[{tag:"code"}],toDOM:t=>["code",e.get(lb.key)(t)],parseMarkdown:{match:e=>"inlineCode"===e.type,runner:(e,t,n)=>{e.openMark(n),e.addText(t.value),e.closeMark(n)}},toMarkdown:{match:e=>"inlineCode"===e.type.name,runner:(e,t,n)=>(e.withMark(t,"inlineCode",n.text||""),!0)}}));Gw(cb.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"}),Gw(cb.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});var ub=bc("ToggleInlineCode",e=>()=>(t,n)=>{const{selection:s,tr:r}=t;if(s.empty)return!1;const{from:i,to:a}=s;return t.doc.rangeHasMark(i,a,cb.type(e))?(n?.(r.removeMark(i,a,cb.type(e))),!0):(Object.keys(t.schema.marks).filter(e=>e!==cb.type.name).map(e=>t.schema.marks[e]).forEach(e=>{r.removeMark(i,a,e)}),n?.(r.addMark(i,a,cb.type(e).create())),!0)});Gw(ub,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});var db=vc(e=>Sr(/(?:`)([^`]+)(?:`)$/,cb.type(e)));Gw(db,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});var pb=Nc("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:e=>{const t=e.get(Pl);return()=>t.call(ub.key)}}});Gw(pb.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"}),Gw(pb.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});var fb=new Set(["http:","https:","mailto:","tel:","ftp:"]);function hb(e){return e<=32||e>=127&&e<=160||e>=8203&&e<=8205||8232===e||8233===e||65279===e}function mb(e){if("string"!=typeof e)return"";const t=e.trim();if(!t)return"";const n=function(e){let t="";for(const n of e)hb(n.codePointAt(0)??0)||(t+=n);return t}(t),s=/^([a-z][a-z0-9+.-]*):/i.exec(n)?.[1];return s?fb.has(`${s.toLowerCase()}:`)?t:"":t}var gb=Ic("link");Gw(gb,{displayName:"Attr<link>",group:"Link"});var yb=Ac("link",e=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw ls(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:t=>["a",{...e.get(gb.key)(t),...t.attrs,href:mb(t.attrs.href)}],parseMarkdown:{match:e=>"link"===e.type,runner:(e,t,n)=>{const s=t.url,r=t.title;e.openMark(n,{href:s,title:r}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"link"===e.type.name,runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}}));Gw(yb.mark,{displayName:"MarkSchema<link>",group:"Link"});var kb=bc("ToggleLink",e=>(t={})=>js(yb.type(e),t));Gw(kb,{displayName:"Command<toggleLinkCommand>",group:"Link"});var wb=bc("UpdateLink",e=>(t={})=>(n,s)=>{if(!s)return!1;let r,i=-1;const{selection:a}=n,{from:o,to:l}=a;if(n.doc.nodesBetween(o,o===l?l+1:l,(t,n)=>{if(yb.type(e).isInSet(t.marks))return r=t,i=n,!1}),!r)return!1;const c=r.marks.find(({type:t})=>t===yb.type(e));if(!c)return!1;const u=i,d=i+r.nodeSize,{tr:p}=n,f=yb.type(e).create({...c.attrs,...t});return!!f&&(s(p.removeMark(u,d,c).addMark(u,d,f).setSelection(new $n(p.selection.$anchor)).scrollIntoView()),!0)});Gw(wb,{displayName:"Command<updateLinkCommand>",group:"Link"});var bb=xc("doc",()=>({content:"block+",parseMarkdown:{match:({type:e})=>"root"===e,runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>"doc"===e.type.name,runner:(e,t)=>{e.openNode("root"),e.next(t.content)}}}));function vb(e){return te(e,e=>"html"===e.type&&["<br />","<br>","<br >","<br/>"].includes(e.value?.trim()),(e,t)=>{if(!t.length)return;const n=t[t.length-1];if(!n)return;const s=n.children.indexOf(e);-1!==s&&n.children.splice(s,1)},!0)}Gw(bb,{displayName:"NodeSchema<doc>",group:"Doc"});var Sb=Rc("remark-preserve-empty-line",()=>()=>vb);Gw(Sb.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"}),Gw(Sb.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});var xb=Ec("paragraph");Gw(xb,{displayName:"Attr<paragraph>",group:"Paragraph"});var Cb=Mc("paragraph",e=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:t=>["p",e.get(xb.key)(t),0],parseMarkdown:{match:e=>"paragraph"===e.type,runner:(e,t,n)=>{e.openNode(n),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>"paragraph"===e.type.name,runner:(t,n)=>{const s=e.get(fl).state?.doc.lastChild;t.openNode("paragraph"),n.content&&0!==n.content.size||n===s||!function(e){let t=!1;try{e.get(Sb.id),t=!0}catch{t=!1}return t}(e)?Jw(t,n):t.addNode("html",void 0,"<br />"),t.closeNode()}}}));Gw(Cb.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"}),Gw(Cb.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});var Tb=bc("TurnIntoText",e=>()=>Ws(Cb.type(e)));Gw(Tb,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});var Ob=Nc("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:e=>{const t=e.get(Pl);return()=>t.call(Tb.key)}}});Gw(Ob.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"}),Gw(Ob.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});var Db=Array(6).fill(0).map((e,t)=>t+1),Mb=Dc(function(e){return e.textContent.toLowerCase().trim().replace(/\s+/g,"-")},"headingIdGenerator");Gw(Mb,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});var Ab=Ec("heading");Gw(Ab,{displayName:"Attr<heading>",group:"Heading"});var Nb=Mc("heading",e=>{const t=e.get(Mb.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:Db.map(e=>({tag:`h${e}`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw ls(t);return{level:e,id:t.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...e.get(Ab.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:e})=>"heading"===e,runner:(e,t,n)=>{const s=t.depth;e.openNode(n,{level:s}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"heading"===e.type.name,runner:(e,t)=>{e.openNode("heading",void 0,{depth:t.attrs.level}),Jw(e,t),e.closeNode()}}}});Gw(Nb.node,{displayName:"NodeSchema<heading>",group:"Heading"}),Gw(Nb.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});var Eb=vc(e=>Zs(/^(?<hashes>#+)\s$/,Nb.type(e),t=>{const n=t.groups?.hashes?.length||0,{$from:s}=e.get(fl).state.selection,r=s.node();if("heading"===r.type.name){let e=Number(r.attrs.level)+Number(n);return e>6&&(e=6),{level:e}}return{level:n}}));Gw(Eb,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});var Ib=bc("WrapInHeading",e=>t=>(t??=1,t<1?Ws(Cb.type(e)):Ws(Nb.type(e),{level:t})));Gw(Ib,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});var Rb=bc("DowngradeHeading",e=>()=>(t,n,s)=>{const{$from:r}=t.selection,i=r.node();if(i.type!==Nb.type(e)||!t.selection.empty||0!==r.parentOffset)return!1;const a=i.attrs.level-1;return a?(n?.(t.tr.setNodeMarkup(t.selection.$from.before(),void 0,{...i.attrs,level:a})),!0):Ws(Cb.type(e))(t,n,s)});Gw(Rb,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});var Lb=Nc("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:e=>{const t=e.get(Pl);return()=>t.call(Ib.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:e=>{const t=e.get(Pl);return()=>t.call(Ib.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:e=>{const t=e.get(Pl);return()=>t.call(Ib.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:e=>{const t=e.get(Pl);return()=>t.call(Ib.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:e=>{const t=e.get(Pl);return()=>t.call(Ib.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:e=>{const t=e.get(Pl);return()=>t.call(Ib.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:e=>{const t=e.get(Pl);return()=>t.call(Rb.key)}}});Gw(Lb.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"}),Gw(Lb.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});var Pb=Ec("blockquote");Gw(Pb,{displayName:"Attr<blockquote>",group:"Blockquote"});var $b=Mc("blockquote",e=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:t=>["blockquote",e.get(Pb.key)(t),0],parseMarkdown:{match:({type:e})=>"blockquote"===e,runner:(e,t,n)=>{e.openNode(n).next(t.children).closeNode()}},toMarkdown:{match:e=>"blockquote"===e.type.name,runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}}));Gw($b.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"}),Gw($b.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});var Vb=vc(e=>Qs(/^\s*>\s$/,$b.type(e)));Gw(Vb,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});var Bb=bc("WrapInBlockquote",e=>()=>zs($b.type(e)));Gw(Bb,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});var Fb=Nc("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:e=>{const t=e.get(Pl);return()=>t.call(Bb.key)}}});Gw(Fb.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"}),Gw(Fb.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});var zb=Ec("codeBlock",()=>({pre:{},code:{}}));Gw(zb,{displayName:"Attr<codeBlock>",group:"CodeBlock"});var Wb=Mc("code_block",e=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw ls(e);return{language:e.dataset.language}}}],toDOM:t=>{const n=e.get(zb.key)(t),s=t.attrs.language,r=s&&s.length>0?{"data-language":s}:void 0;return["pre",{...n.pre,...r},["code",n.code,0]]},parseMarkdown:{match:({type:e})=>"code"===e,runner:(e,t,n)=>{const s=t.lang??"",r=t.value;e.openNode(n,{language:s}),r&&e.addText(r),e.closeNode()}},toMarkdown:{match:e=>"code_block"===e.type.name,runner:(e,t)=>{e.addNode("code",void 0,t.content.firstChild?.text||"",{lang:t.attrs.language})}}}));Gw(Wb.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"}),Gw(Wb.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});var jb=vc(e=>Zs(/^```(?<language>[a-z]*)?[\s\n]$/,Wb.type(e),e=>({language:e.groups?.language??""})));Gw(jb,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});var _b=bc("CreateCodeBlock",e=>(t="")=>Ws(Wb.type(e),{language:t}));Gw(_b,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"}),Gw(bc("UpdateCodeBlockLanguage",()=>({pos:e,language:t}={pos:-1,language:""})=>(n,s)=>e>=0&&(s?.(n.tr.setNodeAttribute(e,"language",t)),!0)),{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});var Ub=Nc("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:e=>{const t=e.get(Pl);return()=>t.call(_b.key)}}});Gw(Ub.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"}),Gw(Ub.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});var Kb=Ec("image");Gw(Kb,{displayName:"Attr<image>",group:"Image"});var qb=Mc("image",e=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw ls(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:t=>["img",{...e.get(Kb.key)(t),...t.attrs}],parseMarkdown:{match:({type:e})=>"image"===e,runner:(e,t,n)=>{const s=t.url,r=t.alt,i=t.title;e.addNode(n,{src:s,alt:r,title:i})}},toMarkdown:{match:e=>"image"===e.type.name,runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));Gw(qb.node,{displayName:"NodeSchema<image>",group:"Image"}),Gw(qb.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});var Hb=bc("InsertImage",e=>(t={})=>(n,s)=>{if(!s)return!0;const{src:r="",alt:i="",title:a=""}=t,o=qb.type(e).create({src:r,alt:i,title:a});return!o||(s(n.tr.replaceSelectionWith(o).scrollIntoView()),!0)});Gw(Hb,{displayName:"Command<insertImageCommand>",group:"Image"});var Yb=bc("UpdateImage",e=>(t={})=>(n,s)=>{const r=function(e,t){if(!(e instanceof Bn))return;const{node:n,$from:s}=e;return function(e,t){return Array.isArray(e)&&e.includes(t.type)||t.type===e}(t,n)?{node:n,pos:s.pos,start:s.start(s.depth),depth:s.depth}:void 0}(n.selection,qb.type(e));if(!r)return!1;const{node:i,pos:a}=r,o={...i.attrs},{src:l,alt:c,title:u}=t;return void 0!==l&&(o.src=l),void 0!==c&&(o.alt=c),void 0!==u&&(o.title=u),s?.(n.tr.setNodeMarkup(a,void 0,o).scrollIntoView()),!0});Gw(Yb,{displayName:"Command<updateImageCommand>",group:"Image"}),Gw(vc(e=>new Js(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(t,n,s,r)=>{const[i,a,o="",l]=n;return i?t.tr.replaceWith(s,r,qb.type(e).create({src:o,alt:a,title:l})):null})),{displayName:"InputRule<insertImageInputRule>",group:"Image"});var Jb=Ec("hardbreak",e=>({"data-type":"hardbreak","data-is-inline":e.attrs.isInline}));Gw(Jb,{displayName:"Attr<hardbreak>",group:"Hardbreak"});var Gb=Mc("hardbreak",e=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:t=>t.attrs.isInline?["span",e.get(Jb.key)(t)," "]:["br",e.get(Jb.key)(t)],parseMarkdown:{match:({type:e})=>"break"===e,runner:(e,t,n)=>{e.addNode(n,{isInline:Boolean(t.data?.isInline)})}},leafText:()=>"\n",toMarkdown:{match:e=>"hardbreak"===e.type.name,runner:(e,t)=>{t.attrs.isInline?e.addNode("text",void 0,"\n"):e.addNode("break")}}}));Gw(Gb.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"}),Gw(Gb.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});var Qb=bc("InsertHardbreak",e=>()=>(t,n)=>{const{selection:s,tr:r}=t;if(!(s instanceof $n))return!1;if(s.empty){const e=s.$from.node();if(e.childCount>0&&"hardbreak"===e.lastChild?.type.name)return n?.(r.replaceRangeWith(s.to-1,s.to,t.schema.node("paragraph")).setSelection(In.near(r.doc.resolve(s.to))).scrollIntoView()),!0}return n?.(r.setMeta("hardbreak",!0).replaceSelectionWith(Gb.type(e).create()).scrollIntoView()),!0});Gw(Qb,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});var Zb=Nc("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:e=>{const t=e.get(Pl);return()=>t.call(Qb.key)}}});Gw(Zb.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"}),Gw(Zb.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});var Xb=Ec("hr");Gw(Xb,{displayName:"Attr<hr>",group:"Hr"});var ev=Mc("hr",e=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:t=>["hr",e.get(Xb.key)(t)],parseMarkdown:{match:({type:e})=>"thematicBreak"===e,runner:(e,t,n)=>{e.addNode(n)}},toMarkdown:{match:e=>"hr"===e.type.name,runner:e=>{e.addNode("thematicBreak")}}}));Gw(ev.node,{displayName:"NodeSchema<hr>",group:"Hr"}),Gw(ev.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});var tv=vc(e=>new Js(/^(?:---|___\s|\*\*\*\s)$/,(t,n,s,r)=>{const{tr:i}=t;return n[0]&&i.replaceWith(s-1,r,ev.type(e).create()),i}));Gw(tv,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});var nv=bc("InsertHr",e=>()=>(t,n)=>{if(!n)return!0;const s=Cb.node.type(e).create(),{tr:r,selection:i}=t,{from:a}=i,o=ev.type(e).create();if(!o)return!0;const l=r.replaceSelectionWith(o).insert(a,s),c=In.findFrom(l.doc.resolve(a),1,!0);return!c||(n(l.setSelection(c).scrollIntoView()),!0)});Gw(nv,{displayName:"Command<insertHrCommand>",group:"Hr"});var sv=Ec("bulletList");Gw(sv,{displayName:"Attr<bulletList>",group:"BulletList"});var rv=Mc("bullet_list",e=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw ls(e);return{spread:"true"===e.dataset.spread}}}],toDOM:t=>["ul",{...e.get(sv.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!t,runner:(e,t,n)=>{const s=null!=t.spread?`${t.spread}`:"false";e.openNode(n,{spread:s}).next(t.children).closeNode()}},toMarkdown:{match:e=>"bullet_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!1,spread:t.attrs.spread}).next(t.content).closeNode()}}}));Gw(rv.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"}),Gw(rv.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});var iv=vc(e=>Qs(/^\s*([-+*])\s$/,rv.type(e)));Gw(iv,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});var av=bc("WrapInBulletList",e=>()=>zs(rv.type(e)));Gw(av,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});var ov=Nc("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:e=>{const t=e.get(Pl);return()=>t.call(av.key)}}});Gw(ov.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"}),Gw(ov.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});var lv=Ec("orderedList");Gw(lv,{displayName:"Attr<orderedList>",group:"OrderedList"});var cv=Mc("ordered_list",e=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw ls(e);return{spread:e.dataset.spread,order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:t=>["ol",{...e.get(lv.key)(t),...1===t.attrs.order?{}:{start:t.attrs.order},"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!!t,runner:(e,t,n)=>{const s=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{spread:s,order:t.start??1}).next(t.children).closeNode()}},toMarkdown:{match:e=>"ordered_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!0,start:t.attrs.order??1,spread:"true"===t.attrs.spread}),e.next(t.content),e.closeNode()}}}));Gw(cv.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"}),Gw(cv.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});var uv=vc(e=>Qs(/^\s*(\d+)\.\s$/,cv.type(e),e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])));Gw(uv,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});var dv=bc("WrapInOrderedList",e=>()=>zs(cv.type(e)));Gw(dv,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});var pv=Nc("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:e=>{const t=e.get(Pl);return()=>t.call(dv.key)}}});Gw(pv.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"}),Gw(pv.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});var fv=Ec("listItem");Gw(fv,{displayName:"Attr<listItem>",group:"ListItem"});var hv=Mc("list_item",e=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw ls(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:"true"===e.dataset.spread}}}],toDOM:t=>["li",{...e.get(fv.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,n)=>{const s=null!=t.label?`${t.label}.`:"•",r=null!=t.label?"ordered":"bullet",i=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{label:s,listType:r,spread:i}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{e.openNode("listItem",void 0,{spread:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));Gw(hv.node,{displayName:"NodeSchema<listItem>",group:"ListItem"}),Gw(hv.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});var mv=bc("SinkListItem",e=>()=>Rm(hv.type(e)));Gw(mv,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});var gv=bc("LiftListItem",e=>()=>Im(hv.type(e)));Gw(gv,{displayName:"Command<liftListItemCommand>",group:"ListItem"});var yv=bc("SplitListItem",e=>()=>Em(hv.type(e)));Gw(yv,{displayName:"Command<splitListItemCommand>",group:"ListItem"});var kv=bc("LiftFirstListItem",e=>()=>function(e){return(t,n,s)=>{const{selection:r}=t;if(!(r instanceof $n))return!1;const{empty:i,$from:a}=r;return!(!i||0!==a.parentOffset)&&a.node(-1).type===hv.type(e)&&Ds(t,n,s)}}(e));Gw(kv,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});var wv=Nc("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:e=>{const t=e.get(Pl);return()=>t.call(yv.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:e=>{const t=e.get(Pl);return()=>t.call(mv.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:e=>{const t=e.get(Pl);return()=>t.call(gv.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:e=>{const t=e.get(Pl);return()=>t.call(kv.key)}}});Gw(wv.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"}),Gw(wv.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});var bv=xc("text",()=>({group:"inline",parseMarkdown:{match:({type:e})=>"text"===e,runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>"text"===e.type.name,runner:(e,t)=>{e.addNode("text",void 0,t.text)}}}));Gw(bv,{displayName:"NodeSchema<text>",group:"Text"});var vv=Ec("html");Gw(vv,{displayName:"Attr<html>",group:"Html"});var Sv=Mc("html",e=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:t=>{const n=document.createElement("span"),s={...e.get(vv.key)(t),"data-value":t.attrs.value,"data-type":"html"};return n.textContent=t.attrs.value,["span",s,t.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>Boolean("html"===e),runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>"html"===e.type.name,runner:(e,t)=>{e.addNode("html",void 0,t.attrs.value)}}}));Gw(Sv.node,{displayName:"NodeSchema<html>",group:"Html"}),Gw(Sv.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});var xv=[bb,xb,Cb,Mb,Ab,Nb,Jb,Gb,Pb,$b,zb,Wb,Xb,ev,Kb,qb,sv,rv,lv,cv,fv,hv,Qw,Zw,sb,rb,lb,cb,gb,yb,vv,Sv,bv].flat(),Cv=[Vb,iv,uv,jb,tv,Eb].flat(),Tv=[eb,tb,db,ab],Ov=bc("IsMarkSelected",()=>e=>t=>{if(!e)return!1;const{doc:n,selection:s}=t;return n.rangeHasMark(s.from,s.to,e)}),Dv=bc("IsNoteSelected",()=>e=>t=>!!e&&zr(t,e).hasNode),Mv=bc("ClearTextInCurrentBlock",()=>()=>(e,t)=>{let n=e.tr;const{$from:s,$to:r}=n.selection,{pos:i}=s,{pos:a}=r,o=i-s.node().content.size;return!(o<0||(n=n.deleteRange(o,a),t?.(n),0))}),Av=bc("SetBlockType",()=>e=>(t,n)=>{const{nodeType:s,attrs:r=null}=e??{};if(!s)return!1;const i=t.tr,{from:a,to:o}=i.selection;try{i.setBlockType(a,o,s,r)}catch{return!1}return n?.(i),!0}),Nv=bc("WrapInBlockType",()=>e=>(t,n)=>{const{nodeType:s,attrs:r=null}=e??{};if(!s)return!1;let i=t.tr;try{const{$from:e,$to:t}=i.selection,n=e.blockRange(t),a=n&&un(n,s,r);if(!a)return!1;i=i.wrap(n,a)}catch{return!1}return n?.(i),!0}),Ev=bc("AddBlockType",()=>e=>(t,n)=>{const{nodeType:s,attrs:r=null}=e??{};if(!s)return!1;const i=t.tr;try{const e=s instanceof ot?s:s.createAndFill(r);if(!e)return!1;i.replaceSelectionWith(e)}catch{return!1}return n?.(i),!0}),Iv=bc("SelectTextNearPos",()=>e=>(t,n)=>{const{pos:s}=e??{};if(null==s)return!1;const r=t.tr;try{const e=t.doc.resolve(((e,t,n)=>Math.min(Math.max(e,0),n))(s,0,t.doc.content.size));r.setSelection($n.near(e))}catch{return!1}return n?.(r.scrollIntoView()),!0}),Rv=[Tb,Bb,Ib,Rb,_b,Qb,nv,Hb,Yb,dv,av,mv,yv,gv,kv,Xw,ub,ib,kb,wb,Ov,Dv,Mv,Av,Nv,Ev,Iv],Lv=[Fb,Ub,Zb,Lb,wv,pv,ov,Ob,nb,pb,ob].flat(),Pv=Rc("remarkAddOrderInList",()=>()=>e=>{X(e,"list",e=>{if(e.ordered){const t=e.start??1;e.children.forEach((e,n)=>{e.label=n+t})}})});Gw(Pv.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"}),Gw(Pv.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});var $v=Rc("remarkLineBreak",()=>()=>e=>{const t=/[\t ]*(?:\r?\n|\r)/g;X(e,"text",(e,n,s)=>{if(!e.value||"string"!=typeof e.value)return;const r=[];let i=0;t.lastIndex=0;let a=t.exec(e.value);for(;a;){const n=a.index;i!==n&&r.push({type:"text",value:e.value.slice(i,n)}),r.push({type:"break",data:{isInline:!0}}),i=n+a[0].length,a=t.exec(e.value)}return r.length>0&&s&&"number"==typeof n?(i<e.value.length&&r.push({type:"text",value:e.value.slice(i)}),s.children.splice(n,1,...r),n+r.length):void 0})});Gw($v.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"}),Gw($v.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});var Vv=Rc("remarkInlineLink",()=>Yw);Gw(Vv.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"}),Gw(Vv.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});var Bv=["root","blockquote","listItem"],Fv=Rc("remarkHTMLTransformer",()=>()=>e=>{!function(e){(function e(t,n,s){if((e=>!!e.children)(t)){const n=[];for(let s=0,r=t.children.length;s<r;s++){const r=t.children[s];if(r){const s=e(r,0,t);if(s)for(let e=0,t=s.length;e<t;e++){const t=s[e];t&&n.push(t)}}}t.children=n}return((e,t,n)=>(e=>"html"===e.type)(e)?(n&&Bv.includes(n.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]):[e])(t,0,s)})(e,0,null)[0]}(e)});Gw(Fv.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"}),Gw(Fv.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});var zv=Rc("remarkMarker",()=>()=>(e,t)=>{X(e,e=>["strong","emphasis"].includes(e.type),e=>{e.marker=(e=>t.value.charAt(e.position.start.offset))(e)})});Gw(zv.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"}),Gw(zv.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});var Wv=Cc(()=>{let e=!1;const t=new Qn({key:new es("MILKDOWN_INLINE_NODES_CURSOR"),state:{init:()=>!1,apply(e){if(!e.selection.empty)return!1;const t=e.selection.$from,n=t.nodeBefore,s=t.nodeAfter;return!(!(n&&s&&n.isInline&&!n.isText&&s.isInline)||s.isText)}},props:{handleDOMEvents:{compositionend:(n,s)=>!!e&&(e=!1,requestAnimationFrame(()=>{if(t.getState(n.state)){const e=n.state.selection.from;s.preventDefault(),n.dispatch(n.state.tr.insertText(s.data||"",e))}}),!0),compositionstart:n=>(t.getState(n.state)&&(e=!0),!1),beforeinput:(n,s)=>{if(t.getState(n.state)&&s instanceof InputEvent&&s.data&&!e){const e=n.state.selection.from;return s.preventDefault(),n.dispatch(n.state.tr.insertText(s.data||"",e)),!0}return!1}},decorations(e){if(t.getState(e)){const t=e.selection.$from.pos,n=document.createElement("span"),s=Io.widget(t,n,{side:-1}),r=document.createElement("span"),i=Io.widget(t,r);return setTimeout(()=>{n.contentEditable="true",r.contentEditable="true"}),Po.create(e.doc,[s,i])}return Po.empty}}});return t});Gw(Wv,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});var jv=Cc(e=>new Qn({key:new es("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(t,n,s)=>{if(!t.length)return;const[r]=t;if(!r)return;const[i]=r.steps;if(r.getMeta("hardbreak")){if(!(i instanceof sn))return;const{from:t}=i;return s.tr.setNodeMarkup(t,Gb.type(e),void 0,[])}if(i instanceof Xt){let t=s.tr;const{from:n,to:r}=i;return s.doc.nodesBetween(n,r,(n,s)=>{n.type===Gb.type(e)&&(t=t.setNodeMarkup(s,Gb.type(e),void 0,[]))}),t}}}));Gw(jv,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});var _v=Dc(["table","code_block"],"hardbreakFilterNodes");Gw(_v,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});var Uv=Cc(e=>{const t=e.get(_v.key);return new Qn({key:new es("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(e,n)=>{const s=e.getMeta("hardbreak"),[r]=e.steps;if(s&&r){const{from:e}=r,s=n.doc.resolve(e);let i=s.depth,a=!0;for(;i>0;)t.includes(s.node(i).type.name)&&(a=!1),i--;return a}return!0}})});Gw(Uv,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});var Kv=Cc(e=>{const t=new es("MILKDOWN_HEADING_ID"),n=n=>{if(n.composing)return;const s=e.get(Mb.key),r=n.state.tr.setMeta("addToHistory",!1);let i=!1;const a={};n.state.doc.descendants((n,o)=>{if(n.type===Nb.type(e)){if(0===n.textContent.trim().length)return;const e=n.attrs;let l=s(n);a[l]?(a[l]+=1,l+=`-#${a[l]}`):a[l]=1,e.id!==l&&(i=!0,r.setMeta(t,!0).setNodeMarkup(o,void 0,{...e,id:l}))}}),i&&n.dispatch(r)};return new Qn({key:t,view:e=>(n(e),{update:(e,t)=>{e.state.doc.eq(t.doc)||n(e)}})})});Gw(Kv,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});var qv=Cc(e=>new Qn({key:new es("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:(t,n,s)=>{if(!s.selection||t.some(e=>!1===e.getMeta("addToHistory")||!e.isGeneric))return null;const r=cv.type(e),i=rv.type(e),a=hv.type(e),o=(e,t,n=1)=>{let s=!1;const r=`${t+n}.`;return e.label!==r&&(e.label=r,s=!0),s};let l=s.tr,c=!1;return s.doc.descendants((e,t,n,s)=>{if(e.type===i){const n=e.maybeChild(0);n?.type===a&&"ordered"===n.attrs.listType&&(c=!0,l.setNodeMarkup(t,r,{spread:"true"}),e.descendants((e,t,n,s)=>{if(e.type===a){const n={...e.attrs};o(n,s)&&(l=l.setNodeMarkup(t,void 0,n))}return!1}))}else if(e.type===a&&n?.type===r){const r={...e.attrs};let i=!1;"ordered"!==r.listType&&(r.listType="ordered",i=!0),n?.maybeChild(0)&&(i=o(r,s,n?.attrs.order??1)),i&&(l=l.setNodeMarkup(t,void 0,r),c=!0)}}),c?l.setMeta("addToHistory",!1):null}}));Gw(qv,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});var Hv=[xv,Cv,Tv,Rv,Lv,[jv,_v,Uv,Wv,Pv,Vv,$v,Fv,zv,Sb,Kv,qv].flat()].flat();const Yv=Wb.extendSchema(e=>t=>{const n=e(t);return{...n,attrs:{...n.attrs,meta:{default:null}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({language:e.dataset.language??"",meta:e.dataset.codeMeta??null})}],toDOM:e=>{const n=t.get(zb.key)(e);return["pre",{...n.pre,"data-language":e.attrs.language,"data-code-meta":e.attrs.meta},["code",n.code,0]]},parseMarkdown:{...n.parseMarkdown,runner:(e,t,n)=>{e.openNode(n,{language:t.lang??"",meta:t.meta??null}),t.value&&e.addText(String(t.value)),e.closeNode()}},toMarkdown:{...n.toMarkdown,runner:(e,t)=>{"latex"!==String(t.attrs.language??"").toLowerCase()?e.addNode("code",void 0,t.textContent,{lang:t.attrs.language,meta:t.attrs.meta}):e.addNode("math",void 0,t.textContent)}}}}),Jv=Mc("frontmatter",()=>({group:"block",atom:!0,isolating:!0,marks:"",attrs:{value:{default:""}},parseDOM:[{tag:"div[data-frontmatter-panel]",getAttrs:e=>({value:e.getAttribute("data-frontmatter-value")??""})}],toDOM:e=>["div",{"data-frontmatter-panel":"true","data-frontmatter-value":e.attrs.value,class:"frontmatter-panel-host"}],parseMarkdown:{match:e=>"yaml"===e.type,runner:(e,t,n)=>{const s=t;e.addNode(n,{value:s.value??""})}},toMarkdown:{match:e=>"frontmatter"===e.type.name,runner:(e,t)=>{const n=String(t.attrs.value??"");e.addNode("html",void 0,`---\n${n}\n---`)}}})),Gv=Mc("lifeosBlock",()=>({group:"block",atom:!0,isolating:!0,marks:"",attrs:{value:{default:""},lang:{default:"LifeOS"}},parseDOM:[{tag:"div[data-lifeos-block]",getAttrs:e=>({value:e.getAttribute("data-lifeos-value")??"",lang:"LifeOS"})}],toDOM:e=>["div",{"data-lifeos-block":"true","data-lifeos-value":e.attrs.value,class:"lifeos-block-host"}],parseMarkdown:{match:e=>"lifeosBlock"===e.type,runner:(e,t,n)=>{const s=t;e.addNode(n,{value:s.value??"",lang:"LifeOS"})}},toMarkdown:{match:e=>"lifeosBlock"===e.type.name,runner:(e,t)=>{const n=String(t.attrs.value??"");e.addNode("html",void 0,function(e){return`\`\`\`LifeOS\n${e}\n\`\`\``}(n))}}}));function Qv(e){if(e.hasAttribute("data-checked"))return function(e){return null==e||""===e?null:"true"===e||"false"!==e&&e}(e.dataset.checked);const t=e.getAttribute("data-task");if(null!==t)return"x"===t||"X"===t||""!==t&&" "!==t&&t;const n=Array.from(e.querySelectorAll('input[type="checkbox"]')).find(t=>t.closest("li")===e);if(!n)return null;if(!e.classList.contains("task-list-item")&&"task"!==e.dataset.itemType){const t=e.ownerDocument.createRange();if(t.selectNodeContents(e),t.setEndBefore(n),t.toString().trim())return null}return n.checked}const Zv=Mc("ordered_list",()=>({content:"listItem+",group:"block",attrs:{order:{default:1},spread:{default:!1}},parseDOM:[{tag:"ol",getAttrs:e=>{const t=e;return{spread:"true"===t.dataset.spread,order:t.hasAttribute("start")?Number(t.getAttribute("start")):1}}}],toDOM:e=>["ol",{...1===e.attrs.order?{}:{start:e.attrs.order},"data-spread":String(e.attrs.spread)},0],parseMarkdown:{match:e=>{const t=e;return"list"===t.type&&!!t.ordered},runner:(e,t,n)=>{const s=t,r=null!=s.spread&&s.spread,i=s.start??1;e.openNode(n,{spread:r,order:i}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"ordered_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!0,start:t.attrs.order??1,spread:!0===t.attrs.spread||"true"===t.attrs.spread}),e.next(t.content),e.closeNode()}}})),Xv=Mc("list_item",()=>({group:"listItem",content:"block+",defining:!0,attrs:{label:{default:"•"},listType:{default:"bullet"},spread:{default:"false"},checked:{default:null}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:e=>{const t=e;return{label:t.dataset.label,listType:t.dataset.listType,spread:t.dataset.spread,checked:Qv(t)}}},{tag:"li",getAttrs:e=>{const t=e;return{label:t.dataset.label,listType:t.dataset.listType,spread:"true"===t.dataset.spread,checked:Qv(t)}}}],toDOM:e=>null==e.attrs.checked?["li",{"data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread},0]:["li",{"data-item-type":"task","data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":String(e.attrs.checked)},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,n)=>{const s=null!=t.label?`${t.label}.`:"•",r=null!=t.label?"ordered":"bullet",i=null!=t.spread?`${t.spread}`:"true",a=null!=t.checked?t.checked:null;e.openNode(n,{label:s,listType:r,spread:i,checked:a}),"list"===t.children?.[0]?.type&&e.next({type:"paragraph",children:[]}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{e.openNode("listItem",void 0,{label:t.attrs.label,listType:t.attrs.listType,spread:"true"===t.attrs.spread||!0===t.attrs.spread,checked:t.attrs.checked});const n=t.firstChild,s=t.childCount>1?t.child(1):null,r="paragraph"===n?.type.name&&0===n.content.size&&("ordered_list"===s?.type.name||"bullet_list"===s?.type.name);e.next(r?t.content.cut(n.nodeSize):t.content),e.closeNode()}}})),eS=qb.extendSchema(e=>t=>{const n=e(t);return{...n,content:"text*",atom:!0,attrs:{...n.attrs,src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:'span[data-inline-source-kind="image"]',getAttrs:e=>{const t=e,n=t.getAttribute("data-inline-source-raw"),s=n?Nh("image",n):null;return s?s.attrs:{src:t.getAttribute("data-image-src")||"",alt:t.getAttribute("data-image-alt")||"",title:t.getAttribute("data-image-title")||""}},getContent:(e,t)=>{const n=e,s=n.getAttribute("data-inline-source-raw")||vh(n.getAttribute("data-image-src")||"",n.getAttribute("data-image-alt")||"",n.getAttribute("data-image-title")||"");return Ve.from(t.text(s))}},...n.parseDOM||[]],toDOM:e=>{const t=Eh(e),n=Sh(String(e.attrs.alt??""));return["span",{"data-inline-source-kind":"image","data-inline-source-raw":t,"data-image-src":e.attrs.src,"data-image-alt":e.attrs.alt,"data-image-title":e.attrs.title||"",class:"inline-source-node inline-source-image"},["img",{src:e.attrs.src,alt:n.alt,title:e.attrs.title||"",...n.width?{style:`width: ${n.width}px; max-width: 100%; height: auto;`}:{}}],["span",{class:"inline-source-source"},0]]},parseMarkdown:{match:n.parseMarkdown.match,runner:(e,t,n)=>{const s=t,r={src:s.url||"",alt:s.alt||"",title:s.title||""};e.addNode(n,r,[e.schema.text(vh(r.src,r.alt,r.title))])}},toMarkdown:{match:e=>"image"===e.type.name,runner:(e,t)=>{e.addNode("obsidianInlineSource",void 0,Eh(t))}}}}),tS=Mc("tag",()=>({inline:!0,group:"inline",content:"text*",atom:!0,attrs:{tag:{default:""}},parseDOM:[{tag:"span[data-tag]",getAttrs:e=>{const t=e,n=t.getAttribute("data-inline-source-raw"),s=n?Nh("tag",n):null;return s?s.attrs:{tag:t.getAttribute("data-tag-value")||""}},getContent:(e,t)=>{const n=e,s=n.getAttribute("data-inline-source-raw")||kh(n.getAttribute("data-tag-value")||"");return Ve.from(t.text(s))}}],toDOM:e=>{const t=Eh(e);return["span",{"data-tag":"true","data-tag-value":e.attrs.tag,"data-inline-source-kind":"tag","data-inline-source-raw":t,class:"tag"},t]},parseMarkdown:{match:e=>"ofmTag"===e.type,runner:(e,t,n)=>{const s=t.value||"";e.addNode(n,{tag:s},[e.schema.text(kh(s))])}},toMarkdown:{match:e=>"tag"===e.type.name,runner:(e,t)=>{e.addNode("obsidianInlineSource",void 0,Eh(t))}}})),nS=Mc("wikiembedding",()=>({inline:!0,group:"inline",content:"text*",atom:!0,attrs:{target:{default:""},hash:{default:""},alias:{default:""}},parseDOM:[{tag:"div[data-wikiembedding]",getAttrs:e=>{const t=e,n=t.getAttribute("data-inline-source-raw"),s=n?Nh("wikiembedding",n):null;return s?s.attrs:{target:t.getAttribute("data-wikiembedding-target")||"",hash:t.getAttribute("data-wikiembedding-hash")||"",alias:t.getAttribute("data-wikiembedding-alias")||""}},getContent:(e,t)=>{const n=e,s=n.getAttribute("data-inline-source-raw")||lu(n.getAttribute("data-wikiembedding-target")||"",n.getAttribute("data-wikiembedding-hash")||"",n.getAttribute("data-wikiembedding-alias")||"");return Ve.from(t.text(s))}}],toDOM:e=>{const t=Eh(e),n=e.attrs.hash?`${e.attrs.target}#${e.attrs.hash}`:e.attrs.target;return["div",{"data-wikiembedding":"true","data-wikiembedding-target":e.attrs.target,"data-wikiembedding-hash":e.attrs.hash,"data-wikiembedding-alias":e.attrs.alias,"data-inline-source-kind":"wikiembedding","data-inline-source-raw":t,class:"wikiembedding"},`![[${n}]]`]},parseMarkdown:{match:e=>"ofmWikiembedding"===e.type,runner:(e,t,n)=>{const s=t,r=s.url||"",i=ru(r),a=s.value&&s.value!==i?s.value:"",o={target:r,hash:s.hash||"",alias:a};e.addNode(n,o,[e.schema.text(lu(o.target,o.hash,o.alias))])}},toMarkdown:{match:e=>"wikiembedding"===e.type.name,runner:(e,t)=>{e.addNode("obsidianInlineSource",void 0,Eh(t))}}}));function sS(e,t,n=!1){const s=t?.trim()||null;return s?n?s:s===ru(e)?null:s:null}const rS=Mc("wikilink",()=>({inline:!0,group:"inline",content:"text*",atom:!0,attrs:{target:{default:""},hash:{default:""},alias:{default:null}},parseDOM:[{tag:"a[data-wikilink]",getAttrs:e=>{const t=e,n=t.getAttribute("data-inline-source-raw"),s=n?Nh("wikilink",n):null;return s?s.attrs:{target:t.getAttribute("data-wikilink-target")||"",hash:t.getAttribute("data-wikilink-hash")||"",alias:t.getAttribute("data-wikilink-alias")||null}},getContent:(e,t)=>{const n=e,s=n.getAttribute("data-inline-source-raw")||yh(n.getAttribute("data-wikilink-target")||"",n.getAttribute("data-wikilink-hash")||"",n.getAttribute("data-wikilink-alias")||null);return Ve.from(t.text(s))}}],toDOM:e=>{const t=Eh(e);return["a",{"data-wikilink":"true","data-wikilink-target":e.attrs.target,"data-wikilink-hash":e.attrs.hash||"","data-wikilink-alias":e.attrs.alias||"","data-inline-source-kind":"wikilink","data-inline-source-raw":t,class:"wikilink"},Rh(e)]},parseMarkdown:{match:e=>"ofmWikilink"===e.type,runner:(e,t,n)=>{const s=t,r=tu(s.url||""),i=r.target,a={target:i,hash:s.hash||r.hash||"",alias:sS(i,s.value,Boolean(s.explicitAlias))};e.addNode(n,a,[e.schema.text(yh(a.target,a.hash,a.alias))])}},toMarkdown:{match:e=>"wikilink"===e.type.name,runner:(e,t)=>{e.addNode("obsidianInlineSource",void 0,Eh(t))}}})),iS=[...Zy,...Yv,...Zv,...Xv,...Jv,...Gv,...qw,...tS,...nS,...rS,...eS],aS=[Xy,tk,ik,ok,lk],oS=[ck,dk,Yy];new es("auto-link-title");const lS=new es("blockIdDecoration"),cS=/(\s)(\^[\w-]+)\s*$/,uS=Cc(()=>new Qn({key:lS,state:{init:(e,t)=>dS(t.doc),apply(e,t){if(!e.docChanged)return t;let n=!1;const s=e.doc.content.size;return e.mapping.maps.forEach(t=>{t.forEach((t,r,i,a)=>{const o=Math.max(0,Math.min(i,s)),l=Math.max(0,Math.min(a,s));try{const t=e.doc.resolve(o),s=t.start(t.depth),r=e.doc.resolve(l),i=r.start(r.depth)+r.parent.content.size,a=Math.min(s,o),c=Math.max(i,l),u=e.doc.textBetween(a,c," ","");(cS.test(u)||u.includes("^"))&&(n=!0)}catch{n=!0}})}),n?dS(e.doc):t.map(e.mapping,e.doc)}},props:{decorations(e){return this.getState(e)}}}));function dS(e){const t=[];return e.descendants((e,n)=>{if(!e.isText||!e.text)return;const s=e.text.match(cS);if(s&&void 0!==s.index){const e=n+s.index+s[1].length,r=e+s[2].length;t.push(Io.inline(e,r,{class:"block-id-superscript"}))}}),Po.create(e,t)}const pS=new es("frontmatter-auto-insert");Cc(()=>new Qn({key:pS,props:{handleTextInput(e,t,n,s){const r=function(e,t,n){if("-"!==n)return null;const s=e.doc.firstChild;if(!s)return null;if("paragraph"!==s.type.name)return null;const r=1+s.content.size;if(t<1||t>r)return null;const i=s.textContent,a=t-1;if("---"!==i.slice(0,a)+n+i.slice(a))return null;const o=e.schema.nodes.frontmatter;if(!o)return null;const l=e.tr,c=o.create({value:""});l.replaceWith(0,r+1,c);const u=c.nodeSize;if(l.doc.content.size<=u){const t=e.schema.nodes.paragraph.create();l.insert(u,t)}const d=l.doc.resolve(u+1);return l.setSelection($n.near(d)),l.setMeta(pS,!0),l}(e.state,t,s);return!!r&&(e.dispatch(r),e.dom.blur(),setTimeout(()=>{window.dispatchEvent(new CustomEvent("frontmatter-auto-created"))},50),!0)}}}));const fS="lifeos-heading-fold-heading",hS="lifeos-heading-fold-toggle",mS=new es("lifeosHeadingFold");function gS(e){return"heading"===e.type.name}function yS(e){const t=Number(e.attrs.level);return Number.isInteger(t)&&t>=1&&t<=6?t:1}function kS(e){const t=[];return e.forEach((e,n)=>{t.push({node:e,pos:n,end:n+e.nodeSize})}),t}function wS(e){return e.replace(/\s+/g," ").trim()}function bS(e,t,n){return`h${Number.isInteger(e)&&e>=1&&e<=6?e:1}:${Number.isInteger(n)&&n>=0?n:0}:${encodeURIComponent(wS(t))}`}function vS(e){const t=[];for(const n of e)"string"!=typeof n||0===n.length||t.includes(n)||t.push(n);return t}function SS(e){const t=kS(e),n=[],s=function(){const e=new Map;return(t,n)=>{const s=wS(n),r=`${t}\0${s}`,i=e.get(r)??0;return e.set(r,i+1),{key:bS(t,s,i),occurrence:i}}}();for(let r=0;r<t.length;r+=1){const i=t[r];if(!gS(i.node))continue;const a=yS(i.node),o=wS(i.node.textContent),{key:l,occurrence:c}=s(a,o);let u=e.content.size;for(let e=r+1;e<t.length;e+=1){const n=t[e];if(gS(n.node)&&yS(n.node)<=a){u=n.pos;break}}u<=i.end||n.push({key:l,headingPos:i.pos,headingEnd:i.end,level:a,title:o,occurrence:c,contentFrom:i.end,contentTo:u})}return n}function xS(e,t){const n=new Set(SS(e).map(e=>e.key)),s=[];for(const r of vS(t))n.has(r)&&s.push(r);return s}function CS(e,t){const n=document.createElement("button");return n.type="button",n.className=hS,n.contentEditable="false",n.dataset.headingFoldKey=e.key,n.dataset.headingFoldPos=String(e.headingPos),n.dataset.headingFoldLevel=String(e.level),n.setAttribute("aria-label","Toggle heading fold"),n.setAttribute("aria-expanded",t?"false":"true"),n.innerHTML='<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M5.25 3.75 9.5 8l-4.25 4.25" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>',n}function TS(e,t){const n=SS(e),s=kS(e),r=new Set(xS(e,t)),i=new Set,a=[];for(const o of n){const e=r.has(o.key),t=e?`${fS} lifeos-heading-fold-heading--collapsed`:fS;if(a.push(Io.node(o.headingPos,o.headingEnd,{class:t,"data-heading-fold":"true","data-heading-fold-collapsed":e?"true":"false"})),a.push(Io.widget(o.headingPos+1,()=>CS(o,e),{side:-1,key:`heading-fold-${o.key}-${e?"collapsed":"expanded"}`})),e)for(const n of s)n.pos<o.contentFrom||n.pos>=o.contentTo||i.add(n.pos)}for(const o of s)i.has(o.pos)&&a.push(Io.node(o.pos,o.end,{class:"lifeos-heading-fold-hidden","data-heading-fold-hidden":"true"}));return Po.create(e,a)}function OS(e,t){return e.ranges.some(e=>{const n=e.$from.pos,s=e.$to.pos;return n===s?n>=t.contentFrom&&n<t.contentTo:n<t.contentTo&&s>t.contentFrom})}function DS(e,t){const n=t.target;if(!(n instanceof Element))return null;const s=n.closest(`button.${hS}`);return s instanceof HTMLButtonElement&&e.dom.contains(s)?s:null}function MS(e,t){const n=xS(e,t);return{foldedHeadingKeys:n,decorations:TS(e,n)}}function AS(e){return mS.getState(e)?.foldedHeadingKeys??[]}!function(e={}){Cc(()=>function(e={}){return new Qn({key:mS,state:{init:(t,n)=>MS(n.doc,e.getInitialFoldedKeys?.()??[]),apply(e,t){let n=t.foldedHeadingKeys;const s=e.getMeta(mS);if("toggle"===s?.type)n=function(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}(n,s.headingKey);else if("setFoldedKeys"===s?.type)n=vS(s.foldedKeys);else{if(!e.docChanged&&0===n.length)return t;if(0===n.length&&function(e){if(!e.docChanged||1!==e.steps.length)return!1;const t=e.steps[0];if(!(t instanceof sn))return!1;const n=e.before,s=Math.max(0,Math.min(t.from,n.content.size)),r=Math.max(s,Math.min(t.to,n.content.size));try{const e=n.resolve(s),i=n.resolve(r);if(!e.sameParent(i)||!e.parent.isTextblock||gS(e.parent))return!1;let a=!0;return t.slice.content.forEach(e=>{e.isInline||(a=!1)}),a}catch{return!1}}(e))return{foldedHeadingKeys:n,decorations:t.decorations.map(e.mapping,e.doc)};n=function(e,t,n){const s=new Set(t);if(0===s.size)return[...t];for(const r of SS(e))s.has(r.key)&&OS(n,r)&&s.delete(r.key);return[...s]}(e.doc,n,e.selection)}return MS(e.doc,n)}},view:()=>({update(t,n){if(!e.onFoldedKeysChange)return;const s=AS(n),r=AS(t.state);(function(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])})(s,r)||e.onFoldedKeysChange([...r])}}),props:{decorations:e=>mS.getState(e)?.decorations??null,handleDOMEvents:{mousedown:(e,t)=>!!DS(e,t)&&(t.preventDefault(),!0),click(e,t){const n=DS(e,t);if(!n)return!1;const s=function(e){return e.dataset.headingFoldKey||null}(n);if(null===s)return!1;t.preventDefault();const r=function(e,t){return SS(e).find(e=>e.key===t)??null}(e.state.doc,s),i=AS(e.state).includes(s);let a=e.state.tr.setMeta(mS,{type:"toggle",headingKey:s});return r&&!i&&(a=a.setSelection($n.create(a.doc,r.headingEnd-1))),e.dispatch(a),!0}}}})}(e))}(),new es("image-paste-upload"),new es("image-path-resolve");const NS=new es("obsidianCommentDecoration");function ES(e){return Boolean(e?.type.spec.code||"code_block"===e?.type.name)}function IS(e){return e.marks.some(e=>Boolean(e.type.spec.code)||"code"===e.type.name)}function RS(e,t){const n=[];for(const s of t)e.nodesBetween(s.from,s.to,(e,t,s)=>{if(e.isText&&e.text&&!ES(s)&&!IS(e))for(const r of tw(e.text))n.push(Io.inline(t+r.start,t+r.end,{class:"obsidian-comment"}))});return n}function LS(e){const t=RS(e,[{from:0,to:e.content.size}]);return Po.create(e,t)}function PS(e,t){for(const n of[t,t-1])if(!(n<0||n>e.content.size))try{const t=e.resolve(n);for(let e=t.depth;e>0;e-=1)if(t.node(e).isTextblock)return{from:t.before(e),to:t.after(e)}}catch{}return null}const $S=Cc(()=>new Qn({key:NS,state:{init:(e,t)=>LS(t.doc),apply:(e,t)=>e.docChanged?function(e,t){if(e.mapping.maps.some(t=>{let n=!1;return t.forEach((t,s,r,i)=>{0===t&&s===e.before.content.size&&0===r&&i===e.doc.content.size&&(n=!0)}),n}))return LS(e.doc);const n=t.map(e.mapping,e.doc),s=function(e){const t=[];return e.mapping.maps.forEach(n=>{n.forEach((n,s,r,i)=>{for(const a of[r,i]){const n=PS(e.doc,a);n&&!t.some(e=>e.from===n.from&&e.to===n.to)&&t.push(n)}})}),t}(e);if(0===s.length)return n;const r=s.flatMap(e=>n.find(e.from,e.to)),i=r.length>0?n.remove(r):n,a=RS(e.doc,s);return a.length>0?i.add(e.doc,a):i}(e,t):t},props:{decorations(e){return this.getState(e)}}})),VS=new es("lifeosOptimizedHeadingId");function BS(e){return!(!e.docChanged||e.getMeta(VS))&&e.steps.some((t,n)=>{if(!(t instanceof sn))return!0;if(function(e){let t=!1;return e.descendants(e=>"heading"!==e.type.name||(t=!0,!1)),t}(t.slice.content)||function(e,t,n){if(n.from===n.to)return!1;const s=e.docs[t];if(!s)return!0;let r=!1;return s.nodesBetween(n.from,n.to,e=>"heading"!==e.type.name||(r=!0,!1)),r}(e,n,t))return!0;const s=e.docs[n];if(!s)return!0;const r=s.resolve(t.from),i=s.resolve(t.to);return r.parent!==i.parent||!r.parent.isTextblock||"heading"===r.parent.type.name})}const FS=Cc(e=>{const t=t=>{if(t.composing)return;const n=e.get(Mb.key),s=t.state.tr.setMeta("addToHistory",!1),r={};let i=!1;t.state.doc.descendants((t,a)=>{if(t.type!==Nb.type(e)||0===t.textContent.trim().length)return;let o=n(t);const l=r[o]??0;r[o]=l+1,l>0&&(o+=`-#${l+1}`),t.attrs.id!==o&&(i=!0,s.setMeta(VS,!0).setNodeMarkup(a,void 0,{...t.attrs,id:o}))}),i&&t.dispatch(s)};return new Qn({key:VS,state:{init:()=>({requiresSync:!1}),apply:e=>({requiresSync:BS(e)})},view:e=>(t(e),{update:e=>{VS.getState(e.state)?.requiresSync&&t(e)}})})}),zS="lifeos-paragraph-fold-block",WS="lifeos-paragraph-fold-hidden",jS="lifeos-paragraph-fold-toggle",_S=new es("lifeosParagraphFold");function US(e){return e.replace(/!?(?:\[([^\]]*)\]\([^)]*\)|\[\[([^\]|]*\|)?([^\]]+)\]\])/g,"$1$3").replace(/[`*_~]/g,"").replace(/\s+/g," ").trim()}function KS(e,t,n){const s=Number.isInteger(n)&&n>=0?n:0;return`${function(e){return"paragraph"===e?"p":"l"}(e)}:${s}:${function(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}(US(t))}`}function qS(e){return/^(?:p|l):\d+:[a-z0-9]+$/.test(e)}function HS(e){const t=[];for(const n of e)"string"==typeof n&&qS(n)&&!t.includes(n)&&t.push(n);return t}function YS(e){return e.length>=80&&US(e).length>=80}const JS=new WeakMap;function GS(e){let t=JS.get(e);return t||(t=function(e){const t=[],n=function(){const e=new Map;return(t,n)=>{const s=US(n),r=`${t}\0${s}`,i=e.get(r)??0;return e.set(r,i+1),KS(t,s,i)}}();return e.forEach((e,s)=>{if("paragraph"!==e.type.name||!YS(e.textContent))return;let r=null;const i=s+e.nodeSize-1;let a=!1;if(e.descendants((e,t)=>!(a||"hardbreak"===e.type.name&&(r=s+t+1,a=!0,1))),!a){const e=s+1+40;e<i&&(r=e)}t.push({key:n("paragraph",e.textContent),kind:"paragraph",nodePos:s,nodeEnd:s+e.nodeSize,togglePos:s+1,hiddenFrom:s+1,hiddenTo:s+e.nodeSize-1,hiddenTextFrom:r,hiddenTextTo:i})}),e.descendants((e,s)=>{if("list_item"!==e.type.name)return!0;let r=null,i=null,a="",o=null,l=null;return e.forEach((e,t)=>{const n=s+1+t;null===r&&"paragraph"===e.type.name&&(r=n,i=n+e.nodeSize,a=e.textContent),null===o&&function(e){return"bullet_list"===e.type.name||"ordered_list"===e.type.name}(e)&&(o=n,l=n+e.nodeSize)}),null===r||null===i||null===o||null===l||t.push({key:n("list",a),kind:"list",nodePos:s,nodeEnd:s+e.nodeSize,togglePos:r+1,hiddenFrom:o,hiddenTo:l,hiddenTextFrom:null,hiddenTextTo:0}),!0}),t}(e),JS.set(e,t)),t.map(e=>({...e}))}function QS(e,t){const n=new Set(GS(e).map(e=>e.key));return HS(t).filter(e=>n.has(e))}function ZS(e,t){const n=document.createElement("button");return n.type="button",n.className=jS,n.contentEditable="false",n.dataset.paragraphFoldKey=e.key,n.dataset.paragraphFoldKind=e.kind,n.setAttribute("aria-label","list"===e.kind?"Toggle nested list fold":"Toggle paragraph fold"),n.setAttribute("aria-expanded",t?"false":"true"),n.innerHTML='<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M5.25 3.75 9.5 8l-4.25 4.25" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>',n}function XS(e,t){const n=new Set(QS(e,t)),s=[];for(const r of GS(e)){const e=n.has(r.key),t=e?`${zS} lifeos-paragraph-fold-block--collapsed`:zS;s.push(Io.node(r.nodePos,r.nodeEnd,{class:t,"data-paragraph-fold-kind":r.kind,"data-paragraph-fold-collapsed":e?"true":"false"})),s.push(Io.widget(r.togglePos,()=>ZS(r,e),{side:-1,key:`paragraph-fold-${r.key}-${e?"collapsed":"expanded"}`})),"list"===r.kind&&e?s.push(Io.node(r.hiddenFrom,r.hiddenTo,{class:WS,"data-paragraph-fold-hidden":"true"})):"paragraph"===r.kind&&e&&null!==r.hiddenTextFrom&&r.hiddenTextFrom<r.hiddenTextTo&&s.push(Io.inline(r.hiddenTextFrom,r.hiddenTextTo,{class:WS,"data-paragraph-fold-hidden":"true"}))}return Po.create(e,s)}function ex(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function tx(e,t){return e.ranges.some(e=>{const n=e.$from.pos,s=e.$to.pos;return"paragraph"===t.kind?n===s?n>t.hiddenFrom&&n<=t.hiddenTo:n<t.hiddenTo&&s>t.hiddenFrom:n===s?n>=t.hiddenFrom&&n<t.hiddenTo:n<t.hiddenTo&&s>t.hiddenFrom})}function nx(e,t){const n=QS(e,t);return{foldedKeys:n,decorations:XS(e,n)}}function sx(e){return _S.getState(e)?.foldedKeys??[]}function rx(e,t){const n=t.target;if(!(n instanceof Element))return null;const s=n.closest(`button.${jS}`);return s instanceof HTMLButtonElement&&e.dom.contains(s)?s:null}!function(e={}){Cc(()=>function(e={}){return new Qn({key:_S,state:{init:(t,n)=>nx(n.doc,e.getInitialFoldedKeys?.()??[]),apply(e,t){let n=[...t.foldedKeys];const s=e.getMeta(_S);if("toggle"===s?.type)n=n.includes(s.foldKey)?n.filter(e=>e!==s.foldKey):[...n,s.foldKey];else if("setFoldedKeys"===s?.type)n=HS(s.foldedKeys);else{if(!e.docChanged&&!e.selectionSet)return t;if(n.length>0){const s=function(e,t,n){const s=new Set(t);for(const r of GS(e))s.has(r.key)&&tx(n,r)&&s.delete(r.key);return[...s]}(e.doc,n,e.selection);if(!e.docChanged&&ex(s,n))return t;n=s}else if(!e.docChanged)return t}return nx(e.doc,n)}},view:()=>({update(t,n){if(!e.onFoldedKeysChange)return;const s=sx(n),r=sx(t.state);ex(s,r)||e.onFoldedKeysChange([...r])}}),props:{decorations:e=>_S.getState(e)?.decorations??null,handleDOMEvents:{mousedown:(e,t)=>!!rx(e,t)&&(t.preventDefault(),!0),click(e,t){const n=rx(e,t),s=n?.dataset.paragraphFoldKey;if(!s)return!1;t.preventDefault();const r=GS(e.state.doc).find(e=>e.key===s),i=sx(e.state).includes(s);let a=e.state.tr.setMeta(_S,{type:"toggle",foldKey:s});return r&&!i&&(a=a.setSelection($n.create(a.doc,r.togglePos))),e.dispatch(a),!0}}}})}(e))}();const ix=new es("split-ordered-bullet-fix"),ax=/^\s*\d+\.\s*$/;function ox(e){if(!e.docChanged)return null;if(1!==e.steps.length)return null;const t=e.steps[0],n=t?.toJSON?.();if(!n||"replace"!==n.stepType)return null;if("number"!=typeof n.from||n.from!==n.to)return null;const s=n.slice?.content;if(!Array.isArray(s)||1!==s.length)return null;const r=s[0];return"text"!==r.type||"string"!=typeof r.text?null:ax.test(r.text)?{from:n.from}:null}Cc(()=>new Qn({key:ix,state:{init:()=>({deadline:0}),apply:(e,t)=>function(e){if(!e.docChanged)return!1;if(1!==e.steps.length)return!1;const t=e.steps[0],n=t?.toJSON?.();if(!n||"replace"!==n.stepType)return!1;if("number"!=typeof n.from||n.from!==n.to)return!1;const s=n.slice;if(!s||2!==s.openStart||2!==s.openEnd)return!1;const r=s.content;return!(!Array.isArray(r)||2!==r.length)&&"list_item"===r[0]?.type&&"list_item"===r[1]?.type}(e)?{deadline:Date.now()+500}:e.getMeta(ix)?{deadline:0}:t},appendTransaction(e,t,n){if(e.some(e=>e.getMeta(ix)))return null;const s=ix.getState(t);if(!s||0===s.deadline)return null;if(Date.now()>s.deadline)return null;let r=null;for(const u of e){const e=ox(u);if(e){r=e;break}}if(!r)return null;const i=function(e,t){try{const n=Math.max(0,Math.min(t,e.content.size)),s=e.resolve(n);for(let e=s.depth;e>=1;e--){const t=s.node(e);if("list_item"===t.type.name)return{node:t,pos:s.before(e)}}}catch{}return null}(n.doc,r.from);if(!i)return null;if("ordered"!==i.node.attrs.listType)return null;const a=i.node.firstChild;if(!a||!a.isTextblock)return null;if(!ax.test(a.textContent))return null;const o=i.pos+2,l=o+a.content.size,c=n.tr.delete(o,l);c.setMeta(ix,!0),c.setMeta("addToHistory",!1);try{c.setSelection($n.create(c.doc,o))}catch{}return c}})),new es("tagInteractionPlugin");const lx=/^\S+/u,cx=/[\u3400-\u9FFF\uF900-\uFAFF]/u,ux=new Set(["code_block"]),dx=e=>Boolean(e.marks?.some(e=>/code/i.test(e.type.name)));function px(e,t){const n=e.doc.content.size,s=e.doc.resolve(Math.min(Math.max(t,0),n));for(let r=s.depth;r>0;r-=1)if(ux.has(s.node(r).type.name))return!0;return!1}function fx(e,t){const n=`#${t}`,s=Ve.from(e.schema.text(n));return e.validContent(s)?e.create({tag:t},s):e.create({tag:t})}function hx(e,t,n){const s=[],r=(e,t)=>null!=n&&n>=e&&n<=t;return e.doc.descendants((n,i,a,o)=>{if(a?.type===t&&n.isText)return!1;if(!n.isText||!n.text||dx(n)||px(e,i)){if(n.type===t&&a&&"number"==typeof o&&!px(e,i)){const e=a.maybeChild(o+1);if(e?.isText&&e.text&&!dx(e)){const t=function(e){const t=e.match(lx)?.[0];return t?{tagText:t,textLength:t.length}:null}(e.text);if(t){const e=i,a=i+n.nodeSize+t.textLength;r(e,a)||s.push({from:e,to:a,tag:`${n.attrs.tag}${t.tagText}`})}}}}else for(const e of Yu(n.text)){const t=i+e.from,n=i+e.to;r(t,n)||s.push({from:t,to:n,tag:e.value})}}),s}function mx(e,t,n){if(0===n.length)return null;const s=[...n].sort((e,t)=>t.from-e.from);let r=e.tr,i=Number.POSITIVE_INFINITY,a=!1;for(const o of s)o.to>i||(r=r.replaceWith(o.from,o.to,fx(t,o.tag)),i=o.from,a=!0);return a?(r.setMeta("tagReify",!0),r):null}Cc(()=>{let e,t=!1,n=0;const s=e=>function({view:e,imeComposing:t,compositionEndedAt:n,now:s=Date.now()}){const r=n>0&&s-n<=1200;return Boolean(e&&function(e){return Boolean(e.composing)}(e)||t||r)}({view:e,imeComposing:t,compositionEndedAt:n})||"undefined"!=typeof document&&Boolean(document.querySelector('.tag-autosuggest-popup[data-show="true"]'));return new Qn({key:new es("tagReify"),view:()=>({destroy:()=>{clearTimeout(e),e=void 0}}),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("tagReify")))return null;if(!e.some(e=>e.selectionSet&&!e.docChanged))return null;if(s())return null;if(!n.selection.empty)return null;const r=n.schema.nodes.tag;return r?mx(n,r,hx(n,r,n.selection.empty?n.selection.from:void 0)):null},props:{handleTextInput:(e,t,n,r)=>{if(s(e))return!1;const i=function(e,t,n){const s=e.schema.nodes.tag;if(!s)return null;if(px(e,t))return null;if(!lx.test(n))return null;const r=e.doc.resolve(t).nodeBefore;if(r?.type!==s)return null;const i=t-r.nodeSize,a=fx(s,`${r.attrs.tag}${n}`),o=e.tr.replaceWith(i,t,a);return o.setSelection($n.create(o.doc,i+a.nodeSize)),o.setMeta("tagReify",!0),o}(e.state,t,r);return!!i&&(e.dispatch(i),!0)},handleDOMEvents:{beforeinput:(e,t)=>("undefined"!=typeof InputEvent&&t instanceof InputEvent&&function(e){return Boolean(e.isComposing)||"insertCompositionText"===e.inputType||"deleteCompositionText"===e.inputType||"insertReplacementText"===e.inputType||"insertFromComposition"===e.inputType||Boolean(e.data&&cx.test(e.data))}(t)&&(n=Date.now()),!1),compositionstart:()=>(t=!0,n=0,!1),compositionend:()=>(t=!1,n=Date.now(),!1),blur:t=>(clearTimeout(e),e=setTimeout(()=>{e=void 0,t.isDestroyed||t.hasFocus()||s(t)||function(e){if(e.isDestroyed)return!1;const t=e.state.schema.nodes.tag;if(!t)return!1;const n=mx(e.state,t,hx(e.state,t));n&&e.dispatch(n)}(t)},0),!1)}}})});const gx=new WeakMap,yx=Math.min,kx=Math.max,wx=Math.round,bx=Math.floor,vx=e=>({x:e,y:e}),Sx={left:"right",right:"left",bottom:"top",top:"bottom"};function xx(e,t,n){return kx(e,yx(t,n))}function Cx(e,t){return"function"==typeof e?e(t):e}function Tx(e){return e.split("-")[0]}function Ox(e){return e.split("-")[1]}function Dx(e){return"x"===e?"y":"x"}function Mx(e){return"y"===e?"height":"width"}function Ax(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Nx(e){return Dx(Ax(e))}function Ex(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ix=["left","right"],Rx=["right","left"],Lx=["top","bottom"],Px=["bottom","top"];function $x(e){const t=Tx(e);return Sx[t]+e.slice(t.length)}function Vx(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}function Bx(e,t,n){let{reference:s,floating:r}=e;const i=Ax(t),a=Nx(t),o=Mx(a),l=Tx(t),c="y"===i,u=s.x+s.width/2-r.width/2,d=s.y+s.height/2-r.height/2,p=s[o]/2-r[o]/2;let f;switch(l){case"top":f={x:u,y:s.y-r.height};break;case"bottom":f={x:u,y:s.y+s.height};break;case"right":f={x:s.x+s.width,y:d};break;case"left":f={x:s.x-r.width,y:d};break;default:f={x:s.x,y:s.y}}switch(Ox(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}async function Fx(e,t){var n;void 0===t&&(t={});const{x:s,y:r,platform:i,rects:a,elements:o,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Cx(t,e),h=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(f),m=o[p?"floating"===d?"reference":"floating":d],g=Vx(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:s,y:r,width:a.floating.width,height:a.floating.height}:a.reference,k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(o.floating)),w=await(null==i.isElement?void 0:i.isElement(k))&&await(null==i.getScale?void 0:i.getScale(k))||{x:1,y:1},b=Vx(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:y,offsetParent:k,strategy:l}):y);return{top:(g.top-b.top+h.top)/w.y,bottom:(b.bottom-g.bottom+h.bottom)/w.y,left:(g.left-b.left+h.left)/w.x,right:(b.right-g.right+h.right)/w.x}}const zx=new Set(["left","top"]);function Wx(){return"undefined"!=typeof window}function jx(e){return Kx(e)?(e.nodeName||"").toLowerCase():"#document"}function _x(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ux(e){var t;return null==(t=(Kx(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Kx(e){return!!Wx()&&(e instanceof Node||e instanceof _x(e).Node)}function qx(e){return!!Wx()&&(e instanceof Element||e instanceof _x(e).Element)}function Hx(e){return!!Wx()&&(e instanceof HTMLElement||e instanceof _x(e).HTMLElement)}function Yx(e){return!(!Wx()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof _x(e).ShadowRoot)}function Jx(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=iC(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&"inline"!==r&&"contents"!==r}function Gx(e){return/^(table|td|th)$/.test(jx(e))}function Qx(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const Zx=/transform|translate|scale|rotate|perspective|filter/,Xx=/paint|layout|strict|content/,eC=e=>!!e&&"none"!==e;let tC;function nC(e){const t=qx(e)?iC(e):e;return eC(t.transform)||eC(t.translate)||eC(t.scale)||eC(t.rotate)||eC(t.perspective)||!sC()&&(eC(t.backdropFilter)||eC(t.filter))||Zx.test(t.willChange||"")||Xx.test(t.contain||"")}function sC(){return null==tC&&(tC="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tC}function rC(e){return/^(html|body|#document)$/.test(jx(e))}function iC(e){return _x(e).getComputedStyle(e)}function aC(e){return qx(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oC(e){if("html"===jx(e))return e;const t=e.assignedSlot||e.parentNode||Yx(e)&&e.host||Ux(e);return Yx(t)?t.host:t}function lC(e){const t=oC(e);return rC(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hx(t)&&Jx(t)?t:lC(t)}function cC(e,t,n){var s;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=lC(e),i=r===(null==(s=e.ownerDocument)?void 0:s.body),a=_x(r);if(i){const e=uC(a);return t.concat(a,a.visualViewport||[],Jx(r)?r:[],e&&n?cC(e):[])}return t.concat(r,cC(r,[],n))}function uC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dC(e){const t=iC(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=Hx(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:s,o=wx(n)!==i||wx(s)!==a;return o&&(n=i,s=a),{width:n,height:s,$:o}}function pC(e){return qx(e)?e:e.contextElement}function fC(e){const t=pC(e);if(!Hx(t))return vx(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:i}=dC(t);let a=(i?wx(n.width):n.width)/s,o=(i?wx(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),o&&Number.isFinite(o)||(o=1),{x:a,y:o}}const hC=vx(0);function mC(e){const t=_x(e);return sC()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:hC}function gC(e,t,n,s){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=pC(e);let a=vx(1);t&&(s?qx(s)&&(a=fC(s)):a=fC(e));const o=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==_x(e))&&t}(i,n,s)?mC(i):vx(0);let l=(r.left+o.x)/a.x,c=(r.top+o.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(i){const e=_x(i),t=s&&qx(s)?_x(s):s;let n=e,r=uC(n);for(;r&&s&&t!==n;){const e=fC(r),t=r.getBoundingClientRect(),s=iC(r),i=t.left+(r.clientLeft+parseFloat(s.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(s.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=_x(r),r=uC(n)}}return Vx({width:u,height:d,x:l,y:c})}function yC(e,t){const n=aC(e).scrollLeft;return t?t.left+n:gC(Ux(e)).left+n}function kC(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-yC(e,n),y:n.top+t.scrollTop}}function wC(e,t,n){let s;if("viewport"===t)s=function(e,t){const n=_x(e),s=Ux(e),r=n.visualViewport;let i=s.clientWidth,a=s.clientHeight,o=0,l=0;if(r){i=r.width,a=r.height;const e=sC();(!e||e&&"fixed"===t)&&(o=r.offsetLeft,l=r.offsetTop)}const c=yC(s);if(c<=0){const e=s.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(s.clientWidth-t.clientWidth-r);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:o,y:l}}(e,n);else if("document"===t)s=function(e){const t=Ux(e),n=aC(e),s=e.ownerDocument.body,r=kx(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=kx(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let a=-n.scrollLeft+yC(e);const o=-n.scrollTop;return"rtl"===iC(s).direction&&(a+=kx(t.clientWidth,s.clientWidth)-r),{width:r,height:i,x:a,y:o}}(Ux(e));else if(qx(t))s=function(e,t){const n=gC(e,!0,"fixed"===t),s=n.top+e.clientTop,r=n.left+e.clientLeft,i=Hx(e)?fC(e):vx(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:s*i.y}}(t,n);else{const n=mC(e);s={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Vx(s)}function bC(e,t){const n=oC(e);return!(n===t||!qx(n)||rC(n))&&("fixed"===iC(n).position||bC(n,t))}function vC(e,t,n){const s=Hx(t),r=Ux(t),i="fixed"===n,a=gC(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const l=vx(0);function c(){l.x=yC(r)}if(s||!s&&!i)if(("body"!==jx(t)||Jx(r))&&(o=aC(t)),s){const e=gC(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&c();i&&!s&&r&&c();const u=!r||s||i?vx(0):kC(r,o);return{x:a.left+o.scrollLeft-l.x-u.x,y:a.top+o.scrollTop-l.y-u.y,width:a.width,height:a.height}}function SC(e){return"static"===iC(e).position}function xC(e,t){if(!Hx(e)||"fixed"===iC(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Ux(e)===n&&(n=n.ownerDocument.body),n}function CC(e,t){const n=_x(e);if(Qx(e))return n;if(!Hx(e)){let t=oC(e);for(;t&&!rC(t);){if(qx(t)&&!SC(t))return t;t=oC(t)}return n}let s=xC(e,t);for(;s&&Gx(s)&&SC(s);)s=xC(s,t);return s&&rC(s)&&SC(s)&&!nC(s)?n:s||function(e){let t=oC(e);for(;Hx(t)&&!rC(t);){if(nC(t))return t;if(Qx(t))return null;t=oC(t)}return null}(e)||n}const TC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const i="fixed"===r,a=Ux(s),o=!!t&&Qx(t.floating);if(s===a||o&&i)return n;let l={scrollLeft:0,scrollTop:0},c=vx(1);const u=vx(0),d=Hx(s);if((d||!d&&!i)&&(("body"!==jx(s)||Jx(a))&&(l=aC(s)),d)){const e=gC(s);c=fC(s),u.x=e.x+s.clientLeft,u.y=e.y+s.clientTop}const p=!a||d||i?vx(0):kC(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:Ux,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const i=[..."clippingAncestors"===n?Qx(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let s=cC(e,[],!1).filter(e=>qx(e)&&"body"!==jx(e)),r=null;const i="fixed"===iC(e).position;let a=i?oC(e):e;for(;qx(a)&&!rC(a);){const t=iC(a),n=nC(a);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&("absolute"===r.position||"fixed"===r.position)||Jx(a)&&!n&&bC(e,a))?s=s.filter(e=>e!==a):r=t,a=oC(a)}return t.set(e,s),s}(t,this._c):[].concat(n),s],a=wC(t,i[0],r);let o=a.top,l=a.right,c=a.bottom,u=a.left;for(let d=1;d<i.length;d++){const e=wC(t,i[d],r);o=kx(e.top,o),l=yx(e.right,l),c=yx(e.bottom,c),u=kx(e.left,u)}return{width:l-u,height:c-o,x:u,y:o}},getOffsetParent:CC,getElementRects:async function(e){const t=this.getOffsetParent||CC,n=this.getDimensions,s=await n(e.floating);return{reference:vC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=dC(e);return{width:t,height:n}},getScale:fC,isElement:qx,isRTL:function(e){return"rtl"===iC(e).direction}};function OC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DC(e,t,n,s){void 0===s&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:l=!1}=s,c=pC(e),u=r||i?[...c?cC(c):[],...t?cC(t):[]]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&o?function(e,t){let n,s=null;const r=Ux(e);function i(){var e;clearTimeout(n),null==(e=s)||e.disconnect(),s=null}return function a(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=c;if(o||t(),!p||!f)return;const h={rootMargin:-bx(d)+"px "+-bx(r.clientWidth-(u+p))+"px "+-bx(r.clientHeight-(d+f))+"px "+-bx(u)+"px",threshold:kx(0,yx(1,l))||1};let m=!0;function g(t){const s=t[0].intersectionRatio;if(s!==l){if(!m)return a();s?a(!1,s):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==s||OC(c,e.getBoundingClientRect())||a(),m=!1}try{s=new IntersectionObserver(g,{...h,root:r.ownerDocument})}catch(y){s=new IntersectionObserver(g,h)}s.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver(e=>{let[s]=e;s&&s.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),t&&h.observe(t));let m=l?gC(e):null;return l&&function t(){const s=gC(e);m&&!OC(m,s)&&n(),m=s,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const MC=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:i,placement:a,middlewareData:o}=t,l=await async function(e,t){const{placement:n,platform:s,elements:r}=e,i=await(null==s.isRTL?void 0:s.isRTL(r.floating)),a=Tx(n),o=Ox(n),l="y"===Ax(n),c=zx.has(a)?-1:1,u=i&&l?-1:1,d=Cx(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&"number"==typeof h&&(f="end"===o?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return a===(null==(n=o.offset)?void 0:n.placement)&&null!=(s=o.arrow)&&s.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},AC=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r,platform:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Cx(e,t),u={x:n,y:s},d=await i.detectOverflow(t,c),p=Ax(Tx(r)),f=Dx(p);let h=u[f],m=u[p];if(a){const e="y"===f?"bottom":"right";h=xx(h+d["y"===f?"top":"left"],h,h-d[e])}if(o){const e="y"===p?"bottom":"right";m=xx(m+d["y"===p?"top":"left"],m,m-d[e])}const g=l.fn({...t,[f]:h,[p]:m});return{...g,data:{x:g.x-n,y:g.y-s,enabled:{[f]:a,[p]:o}}}}}},NC=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Cx(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=Tx(r),k=Ax(o),w=Tx(o)===o,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),v=p||(w||!m?[$x(o)]:function(e){const t=$x(e);return[Ex(e),t,Ex(t)]}(o)),S="none"!==h;!p&&S&&v.push(...function(e,t,n,s){const r=Ox(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Rx:Ix:t?Ix:Rx;case"left":case"right":return t?Lx:Px;default:return[]}}(Tx(e),"start"===n,s);return r&&(i=i.map(e=>e+"-"+r),t&&(i=i.concat(i.map(Ex)))),i}(o,m,h,b));const x=[o,...v],C=await l.detectOverflow(t,g),T=[];let O=(null==(s=i.flip)?void 0:s.overflows)||[];if(u&&T.push(C[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const s=Ox(e),r=Nx(e),i=Mx(r);let a="x"===r?s===(n?"end":"start")?"right":"left":"start"===s?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=$x(a)),[a,$x(a)]}(r,a,b);T.push(C[e[0]],C[e[1]])}if(O=[...O,{placement:r,overflows:T}],!T.every(e=>e<=0)){var D,M;const e=((null==(D=i.flip)?void 0:D.index)||0)+1,t=x[e];if(t&&("alignment"!==d||k===Ax(t)||O.every(e=>Ax(e.placement)!==k||e.overflows[0]>0)))return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(M=O.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(f){case"bestFit":{var A;const e=null==(A=O.filter(e=>{if(S){const t=Ax(e.placement);return t===k||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},EC=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:r,rects:i,platform:a,elements:o}=t,{apply:l=()=>{},...c}=Cx(e,t),u=await a.detectOverflow(t,c),d=Tx(r),p=Ox(r),f="y"===Ax(r),{width:h,height:m}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=p===(await(null==a.isRTL?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(y=d,g="end"===p?"top":"bottom");const k=m-u.top-u.bottom,w=h-u.left-u.right,b=yx(m-u[g],k),v=yx(h-u[y],w),S=!t.middlewareData.shift;let x=b,C=v;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=w),null!=(s=t.middlewareData.shift)&&s.enabled.y&&(x=k),S&&!p){const e=kx(u.left,0),t=kx(u.right,0),n=kx(u.top,0),s=kx(u.bottom,0);f?C=h-2*(0!==e||0!==t?e+t:kx(u.left,u.right)):x=m-2*(0!==n||0!==s?n+s:kx(u.top,u.bottom))}await l({...t,availableWidth:C,availableHeight:x});const T=await a.getDimensions(o.floating);return h!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}},IC=(e,t,n)=>{const s=new Map,r={platform:TC,...n},i={...r.platform,_c:s};return(async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,o=a.detectOverflow?a:{...a,detectOverflow:Fx},l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=Bx(c,s,l),p=s,f=0;const h={};for(let m=0;m<i.length;m++){const n=i[m];if(!n)continue;const{name:g,fn:y}=n,{x:k,y:w,data:b,reset:v}=await y({x:u,y:d,initialPlacement:s,placement:p,strategy:r,middlewareData:h,rects:c,platform:o,elements:{reference:e,floating:t}});u=null!=k?k:u,d=null!=w?w:d,h[g]={...h[g],...b},v&&f<50&&(f++,"object"==typeof v&&(v.placement&&(p=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):v.rects),({x:u,y:d}=Bx(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:r,middlewareData:h}})(e,t,{...r,platform:i})},RC=new Set,LC=Wd;function PC(e){const{selection:t}=e.state,{$from:n}=t;if(!t.empty)return null;const s=Fr(e=>"list_item"===e.type.name&&null!=e.attrs.checked)(t);if(!s)return null;const r=s.node.textContent,i=function(e){const t=gx.get(e);if(t)return t;let n="";const s=[];e.forEach((e,t)=>{const r=function(e){return e.isText?e.text??"":Ih(e)&&!e.textContent?Eh(e):e.isLeaf?e.type.spec.leafText?.(e)??"":e.textBetween(0,e.content.size,void 0,"")}(e),i=n.length;n+=r,s.push({textFrom:i,textTo:n.length,parentFrom:t,parentTo:t+e.nodeSize,isText:e.isText})});const r={text:n,toParentOffset:e=>{if(e<0||e>n.length)return null;if(0===s.length)return 0===e?0:null;for(const t of s){if(e===t.textFrom)return t.parentFrom;if(e===t.textTo)return t.parentTo;if(t.isText&&e>t.textFrom&&e<t.textTo)return t.parentFrom+e-t.textFrom}return null},toTextOffset:t=>{if(t<0||t>e.content.size)return null;if(0===s.length)return 0===t?0:null;for(const e of s){if(t===e.parentFrom)return e.textFrom;if(t===e.parentTo)return e.textTo;if(e.isText&&t>e.parentFrom&&t<e.parentTo)return e.textFrom+t-e.parentFrom}return null}};return gx.set(e,r),r}(n.parent),a=i.toTextOffset(n.parentOffset);if(null===a)return null;const o=Ud(`- [ ] ${i.text}`,6+a);if(!o)return null;const l=n.pos-n.parentOffset,c=Math.max(0,o.fromOffset-6),u=Math.max(0,o.toOffset-6),d=i.toParentOffset(c),p=i.toParentOffset(u);return null===d||null===p?null:{textContent:r,trigger:{...o,fromOffset:d,toOffset:p},from:l+d,to:l+p}}const $C=new es("taskAutoSuggest"),VC="task-autosuggest";class BC{constructor(e){this.items=[],this.selectedIndex=0,this.isVisible=!1,this.keywordFrom=0,this.keywordTo=0,this.followUpItems=null,this.followUpAnchorPos=0,this.view=e,function(e){if("undefined"==typeof document)return;if(document.querySelector(`style[data-autosuggest="${e}"]`))return void RC.add(e);RC.delete(e),RC.add(e);const t=document.createElement("style");t.setAttribute("data-autosuggest",e),t.textContent="\n.task-autosuggest-popup {\n position: fixed;\n z-index: 100;\n width: min(260px, calc(100vw - 24px)) !important;\n min-width: min(200px, calc(100vw - 24px)) !important;\n max-width: calc(100vw - 24px) !important;\n max-height: 280px;\n overflow-y: auto;\n overflow-x: hidden;\n touch-action: none;\n contain: layout paint;\n background: var(--editor-surface-primary, #fff);\n border: 1px solid var(--border-color, #e9e9e7);\n border-radius: 10px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);\n padding: 4px;\n display: none;\n}\n.task-autosuggest-popup[data-show='true'] { display: block; }\n.task-autosuggest-item {\n touch-action: none;\n display: flex;\n align-items: center;\n min-width: 0;\n gap: 8px;\n padding: 6px 10px;\n border-radius: 6px;\n cursor: pointer;\n transition: background-color 0.1s;\n user-select: none;\n}\n.task-autosuggest-item:hover { background: var(--bg-hover, #f7f6f3); }\n.task-autosuggest-item.selected { background: color-mix(in srgb, var(--accent-primary) 10%, transparent); color: var(--accent-primary); }\n.task-autosuggest-item.selected .task-autosuggest-label { color: var(--accent-primary); }\n.task-autosuggest-icon {\n flex-shrink: 0;\n width: 22px;\n text-align: center;\n font-size: 14px;\n line-height: 1;\n}\n.task-autosuggest-label {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n color: #37352f;\n line-height: 1.4;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n@media (prefers-color-scheme: dark) {\n .task-autosuggest-popup {\n background: #2f3437;\n border-color: #4a4a4a;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);\n }\n .task-autosuggest-item:hover { background: #3a3f42; }\n .task-autosuggest-label { color: #e0e0e0; }\n}\n",document.head.appendChild(t)}("task"),this.popup=document.createElement("div"),this.popup.className="task-autosuggest-popup",this.popup.dataset.show="false",this.popup.dataset.testid="task-autosuggest-popup",this.popup.setAttribute("role","listbox"),document.body.appendChild(this.popup),this.removeTouchSelection=function(e,t,n,s=Date.now){let r=null,i=-1/0;const a=n=>{if(!(n instanceof Element))return null;const s=n.closest(t);if(!s||!e.contains(s))return null;const r=Number(s.dataset.index);return Number.isInteger(r)&&r>=0?r:null},o=e=>{e.preventDefault(),e.stopPropagation()},l=e=>{if(e.preventDefault(),e.stopPropagation(),s()-i<500)return;const t=a(e.target);null!==t&&n(t)},c=t=>{if(t.preventDefault(),t.stopPropagation(),i=s(),1!==t.touches.length)return void(r=null);const n=t.touches[0];r={identifier:n.identifier,startY:n.clientY,lastY:n.clientY,startScrollTop:e.scrollTop,moved:!1}},u=t=>{const n=r,a=Array.from(t.touches).find(e=>e.identifier===n?.identifier);n&&a&&(t.preventDefault(),t.stopPropagation(),Math.abs(a.clientY-n.startY)>=8&&(n.moved=!0),n.moved&&(e.scrollTop+=n.lastY-a.clientY),n.lastY=a.clientY,i=s())},d=t=>{const o=r,l=Array.from(t.changedTouches).find(e=>e.identifier===o?.identifier);if(!o||!l)return;if(t.preventDefault(),t.stopPropagation(),r=null,i=s(),o.moved||Math.abs(e.scrollTop-o.startScrollTop)>1)return;const c=document.elementFromPoint?.(l.clientX,l.clientY)??t.target,u=a(c);null!==u&&n(u)},p=e=>{e.preventDefault(),e.stopPropagation(),r=null,i=s()};return e.addEventListener("mousedown",o),e.addEventListener("click",l),e.addEventListener("touchstart",c,{passive:!1}),e.addEventListener("touchmove",u,{passive:!1}),e.addEventListener("touchend",d,{passive:!1}),e.addEventListener("touchcancel",p,{passive:!1}),()=>{e.removeEventListener("mousedown",o),e.removeEventListener("click",l),e.removeEventListener("touchstart",c),e.removeEventListener("touchmove",u),e.removeEventListener("touchend",d),e.removeEventListener("touchcancel",p)}}(this.popup,".task-autosuggest-item",e=>this.selectItem(e))}update(e){if(this.view=e,this.followUpItems){const{selection:t}=e.state,n=t.from,s=e.state.doc.textBetween(this.followUpAnchorPos,n,"","").toLowerCase();if(n<this.followUpAnchorPos)this.followUpItems=null;else{const e=this.followUpItems[0]?.category,t=e?_d(e,s):[];if(t.length>0)return this.items=t,this.keywordFrom=this.followUpAnchorPos,this.keywordTo=n,this.selectedIndex=Math.min(this.selectedIndex,t.length-1),this.renderItems(),this.show(),void this.positionPopup();this.followUpItems=null}}const t=PC(e);if(!t)return void this.hide();const{trigger:n}=t,s="follow-up"===n.mode?_d(n.category,n.query):LC(n.query,t.textContent);0!==s.length?(this.items=s,this.keywordFrom=t.from,this.keywordTo=t.to,this.selectedIndex=Math.min(this.selectedIndex,s.length-1),this.renderItems(),this.show(),this.positionPopup()):this.hide()}destroy(){this.hide(),this.removeTouchSelection(),this.popup.remove()}renderItems(){this.popup.innerHTML="";for(let e=0;e<this.items.length;e++){const t=this.items[e],n=document.createElement("div");n.className="task-autosuggest-item"+(e===this.selectedIndex?" selected":""),n.dataset.index=String(e),n.dataset.testid="task-autosuggest-item",n.dataset.selected=e===this.selectedIndex?"true":"false",n.setAttribute("role","option"),n.setAttribute("aria-selected",e===this.selectedIndex?"true":"false");const s=document.createElement("span");s.className="task-autosuggest-icon",s.textContent=t.icon;const r=document.createElement("span");r.className="task-autosuggest-label",r.textContent=t.label,n.appendChild(s),n.appendChild(r),this.popup.appendChild(n)}}positionPopup(){(function(e,t,n,s){return IC({getBoundingClientRect:()=>Ir(e,n,s)},t,{strategy:"fixed",placement:"bottom-start",middleware:[MC(4),NC({padding:8}),AC({padding:8}),EC({padding:8,apply({availableWidth:e,elements:n}){const s=Math.max(0,Math.floor(e));if(0===s)return;const r=function(e){return e.classList.contains("tag-autosuggest-popup")||e.classList.contains("task-autosuggest-popup")?260:300}(t),i=function(e){return e.classList.contains("tag-autosuggest-popup")?180:e.classList.contains("date-autosuggest-popup")?240:e.classList.contains("task-autosuggest-popup")?200:220}(t),a=s<i?s:Math.max(i,Math.min(r,s));n.floating.style.boxSizing="border-box",n.floating.style.width=`${a}px`,n.floating.style.maxWidth=`${s}px`}})]}).then(({x:e,y:n})=>{Object.assign(t.style,{left:`${e}px`,top:`${n}px`})})})(this.view,this.popup,this.keywordFrom,this.keywordTo).catch(console.error)}show(){this.isVisible||(this.popup.dataset.show="true",this.isVisible=!0,Ie(this.view,VC,!0))}hide(){this.isVisible&&(this.popup.dataset.show="false",this.isVisible=!1,this.selectedIndex=0,this.followUpItems=null,Ie(this.view,VC,!1))}selectItem(e){const t=this.items[e];if(!t)return;const n=null!==this.followUpItems,s=t.insertText,r=function(e,t,n){if(null!==n){const t=e.state.selection.from;return t>=n?{from:n,to:t}:null}const s=PC(e);return s&&"keyword"===s.trigger.mode&&LC(s.trigger.query,s.textContent).some(e=>e.category===t.category&&e.label===t.label&&e.insertText===t.insertText)?{from:s.from,to:s.to}:null}(this.view,t,n?this.followUpAnchorPos:null);if(!r)return void this.hide();const{from:i,to:a}=r,o=this.view.state.tr.insertText(s,i,a),l=i+s.length;o.setSelection($n.create(o.doc,l)),this.view.dispatch(o),this.view.focus(),!n&&t.followUp&&t.followUp.length>0?(this.followUpItems=t.followUp,this.followUpAnchorPos=l,this.selectedIndex=0,this.update(this.view)):(this.followUpItems=null,this.hide())}handleKeyDown(e){return function(e,t,n){if(!t.isVisible||0===t.itemCount)return!1;if(t.isComposing||e.isComposing||229===e.keyCode)return!1;switch(e.key){case"ArrowDown":return e.preventDefault(),n.setSelectedIndex((t.selectedIndex+1)%t.itemCount),n.renderItems(),n.scrollSelectedIntoView(),!0;case"ArrowUp":return e.preventDefault(),n.setSelectedIndex((t.selectedIndex-1+t.itemCount)%t.itemCount),n.renderItems(),n.scrollSelectedIntoView(),!0;case"Enter":case"Tab":return e.preventDefault(),n.selectItem(t.selectedIndex),!0;case"Escape":return e.preventDefault(),n.hide(),!0;default:return!1}}(e,{isVisible:this.isVisible,itemCount:this.items.length,selectedIndex:this.selectedIndex},{setSelectedIndex:e=>{this.selectedIndex=e},renderItems:()=>this.renderItems(),scrollSelectedIntoView:()=>this.scrollSelectedIntoView(),selectItem:e=>this.selectItem(e),hide:()=>this.hide()})}scrollSelectedIntoView(){const e=this.popup.querySelector(".task-autosuggest-item.selected");e&&e.scrollIntoView({block:"nearest"})}}Cc(()=>{let e=null;return new Qn({key:$C,view:t=>(e=new BC(t),{update:t=>e?.update(t),destroy:()=>{e?.destroy(),e=null}}),props:{handleKeyDown:(t,n)=>e?.handleKeyDown(n)??!1}})});const FC=new es("taskCheckboxRotation"),zC="taskCheckboxRotation",WC=Cc(()=>new Qn({key:FC,appendTransaction:(e,t,n)=>function(e,t,n){if(!e.some(e=>e.docChanged))return null;if(e.some(e=>e.getMeta(zC)))return null;if(!e.some(e=>e.docChanged&&e.steps.some(e=>!(e instanceof sn))))return null;let s=n.tr,r=!1;return n.doc.descendants((e,n)=>{if("list_item"!==e.type.name)return;const i=function(e,t){if(t<0||t>e.content.size)return null;try{return e.nodeAt(t)}catch{return null}}(t.doc,n);if(!i||i.type!==e.type)return;const a=i.attrs.checked,o=e.attrs.checked;if(!function(e,t){return!1===e&&!0===t||!0===e&&!1===t||"string"==typeof e&&!1===t}(a,o))return;const l=Qu(a);if(!l)return;const c=Gu(id(l,void 0));null!==c&&c!==o&&(s=s.setNodeMarkup(n,void 0,{...e.attrs,checked:c}),r=!0)}),r?s.setMeta(zC,!0):null}(e,t,n)})),jC=new es("taskCompletion"),_C="taskCompletionPlugin";function UC(e,t,n,s){if(e.every(e=>!e.docChanged))return null;if(e.some(e=>e.getMeta(_C)))return null;if(!e.some(e=>e.docChanged&&e.steps.some(e=>!(e instanceof sn))))return null;const r=[];t.doc.descendants((e,t)=>{"list_item"===e.type.name&&null!=e.attrs.checked&&r.push({pos:t,checked:e.attrs.checked,node:e})});const i=[];if(n.doc.descendants((e,t)=>{"list_item"===e.type.name&&null!=e.attrs.checked&&i.push({pos:t,checked:e.attrs.checked,node:e})}),r.length!==i.length)return null;if(0===r.length)return null;let a;const o=(e,t)=>{const n=Qu(e.checked);if(!n)return null;const s=oh(`- [${n}] ${t}`),r=s?.match(/^\s*(?:[-*+]|\d+[.)])\s+\[[^\]\r\n]\]\s+(.*)$/)?.[1];if(null==r)return null;const i=e.node.firstChild;if(!i||"paragraph"!==i.type.name)return null;const a=i.type.create(i.attrs,r?i.type.schema.text(r):null);return e.node.type.create({...e.node.attrs,checked:!1},[a])},l=e=>{let t="";return e.content.forEach(e=>{t+=e.isText?e.text??"":Eh(e)}),t},c=(e,t)=>{if("append"!==t.type)return e;if(t.trimTrailingChars<=0)return`${e}${t.appendedText}`;const n=Math.max(0,e.length-t.trimTrailingChars);return`${e.slice(0,n)}${t.appendedText}${e.slice(n)}`};for(let u=0;u<i.length;u++){const e=r[u],t=i[u];if(e.checked===t.checked)continue;const d=t.node.firstChild;if(!d||"paragraph"!==d.type.name)continue;const p=d.textContent,f=(new Date).toISOString().split("T")[0],h=ad({oldChecked:e.checked,newChecked:t.checked,textContent:p,lastTextNodeText:d.lastChild?.isText?d.lastChild.text:null,today:f}),m=!0===t.checked&&!0!==e.checked,g=l(d),y=h?c(g,h):g;if("append"===h?.type){const e=t.pos+2+(d.content.size-h.trimTrailingChars);a=(a??n.tr).insertText(h.appendedText,e)}else if("remove"===h?.type){const e=t.pos+2,s=h.matchText;let r=-1;if(d.content.forEach((e,t)=>{if(r>=0||!e.isText||!e.text)return;const n=e.text.indexOf(s);n>=0&&(r=t+n)}),r<0){const e=p.indexOf(s);if(e>=0){let t=0;d.content.forEach((n,s)=>{if(r>=0)return;const i=n.isText&&n.text?n.text.length:0;t+i>e&&(r=s+(e-t)),t+=i})}}if(r>=0){const t=e+r,i=t+s.length,o=h.preserveTimestampSpace?t+1:t;a=(a??n.tr).delete(o,i)}}if(m){const e=o(t,y);if(e){const r=!1!==s?.nextRecurringTaskOnNextLine,i=r?t.pos+t.node.nodeSize:t.pos,o=a?a.mapping.map(i,r?1:-1):i;a=(a??n.tr).insert(o,e)}}}return a&&a.setMeta(_C,!0),a??null}Cc(()=>new Qn({key:jC,appendTransaction:UC}));const KC='\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <circle cx="12" cy="12" r="4" />\n </svg>\n',qC='\n <svg class="lifeos-editor-task-icon lifeos-editor-task-icon--todo" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">\n <rect class="lifeos-editor-task-frame" x="1.5" y="1.5" width="15" height="15" rx="3.5" fill="var(--lifeos-task-checkbox-bg, transparent)" stroke="var(--lifeos-task-checkbox-border, currentColor)" stroke-width="2"/>\n </svg>\n',HC='\n <svg class="lifeos-editor-task-icon lifeos-editor-task-icon--done" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">\n <rect class="lifeos-editor-task-frame" x="1.5" y="1.5" width="15" height="15" rx="3.5" fill="var(--lifeos-task-checkbox-bg, transparent)" stroke="var(--lifeos-task-checkbox-border, currentColor)" stroke-width="2"/>\n <path class="lifeos-editor-task-glyph" d="M5.2 9.2L7.6 11.5L12.8 6.2" stroke="var(--lifeos-task-status-color, currentColor)" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n',YC='\n <svg class="lifeos-editor-task-icon lifeos-editor-task-icon--cancelled" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">\n <rect class="lifeos-editor-task-frame" x="1.5" y="1.5" width="15" height="15" rx="3.5" fill="var(--lifeos-task-checkbox-bg, transparent)" stroke="var(--lifeos-task-checkbox-border, currentColor)" stroke-width="2"/>\n <path class="lifeos-editor-task-glyph" d="M5.2 9H12.8" stroke="var(--lifeos-task-status-color, currentColor)" stroke-width="2.2" stroke-linecap="round"/>\n </svg>\n',JC='\n <svg class="lifeos-editor-task-icon lifeos-editor-task-icon--in-progress" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">\n <rect class="lifeos-editor-task-frame" x="1.5" y="1.5" width="15" height="15" rx="3.5" fill="var(--lifeos-task-checkbox-bg, transparent)" stroke="var(--lifeos-task-checkbox-border, currentColor)" stroke-width="2"/>\n <path class="lifeos-editor-task-glyph" d="M10.8 4.6L7.2 13.4" stroke="var(--lifeos-task-status-color, currentColor)" stroke-width="2.2" stroke-linecap="round"/>\n </svg>\n',GC=new es("taskSplitUncheck");function QC(e,t,n){if(!e.some(e=>e.docChanged))return null;const s=n.schema.nodes.list_item;if(!s)return null;if(n.doc.content.size<=t.doc.content.size)return null;const r=e.some(e=>e.steps?.some(e=>{const t=e.toJSON?.();return"replace"===t?.stepType&&t.from===t.to&&2===t.slice?.openStart&&2===t.slice?.openEnd&&"list_item"===t.slice?.content?.[0]?.type&&"list_item"===t.slice?.content?.[1]?.type}));if(!r)return null;const{$from:i}=n.selection;for(let a=i.depth;a>0;a--){const e=i.node(a);if(e.type!==s)continue;if(null==e.attrs.checked)break;const t=e.firstChild,o=i.before(a),l=n.tr.setNodeMarkup(o,void 0,{...e.attrs,checked:!1});let c="";t?.content.forEach(e=>{c+=e.isText?e.text??"":Eh(e)});const u=c.trim().length>0&&/^(?:\s*(?:#[\p{L}\p{N}_/-]+|(?:📅|⏳|🛫|✅|❌)\s*\d{4}-\d{2}-\d{2}))+\s*$/u.test(c),d=i.index(a-1);if(r&&u&&d>0){const e=i.node(a-1).child(d-1),n=e.firstChild;"paragraph"===n?.type.name&&(l.delete(o+2,o+2+t.content.size),l.insert(o-e.nodeSize+n.nodeSize,t.content))}return l}return null}Cc(()=>new Qn({key:GC,appendTransaction:QC}));const ZC=new es("taskStatusDom"),XC="lifeos-editor-task-state",eT={"in-progress":"lifeos-editor-task-state--in-progress",done:"lifeos-editor-task-state--done",cancelled:"lifeos-editor-task-state--cancelled",deferred:"lifeos-editor-task-state--deferred",important:"lifeos-editor-task-state--important",question:"lifeos-editor-task-state--question",commissioned:"lifeos-editor-task-state--commissioned"};function tT(e,t){if(!t)return delete e.dataset.taskStatus,void e.classList.remove(XC,...Object.values(eT));e.dataset.taskStatus=t,e.classList.add(XC);for(const[n,s]of Object.entries(eT))e.classList.toggle(s,n===t)}function nT(e,t){const n=new Set;e.state.doc.descendants((s,r)=>{if("list_item"!==s.type.name)return!0;const i=e.nodeDOM(r);return!(i instanceof HTMLElement&&(n.add(i),tT(i,function(e,t){const n=Qu(e);if(null==n)return null;const s=rd(n,t);return s.done?"done":s.cancelled?"cancelled":"IN_PROGRESS"===s.type?"in-progress":"TODO"===s.type?function(e){return">"===e?"deferred":"!"===e?"important":"?"===e?"question":"@"===e?"commissioned":null}(n):null}(s.attrs.checked,t)),0))}),function(e,t){e.dom.querySelectorAll(`.${XC}`).forEach(e=>{t.has(e)||tT(e,null)})}(e,n)}function sT(e){return!!e.docChanged&&e.steps.some(e=>!(e instanceof sn)||function(e){let t=!1;return e.slice.content.descendants(e=>"list_item"!==e.type.name||(t=!0,!1)),t}(e))}const rT=Cc(()=>function(e){return new Qn({key:ZC,state:{init:()=>({revision:0}),apply:(e,t)=>({revision:t.revision+Number(sT(e))})},view:t=>(nT(t,e?.()),{update(t,n){ZC.getState(t.state)?.revision!==ZC.getState(n)?.revision&&nT(t,e?.())},destroy(){t.dom.querySelectorAll(`.${XC}`).forEach(e=>{tT(e,null)})}})})}(void 0));new es("wikilink-existence");const iT=Symbol.for("yaml.alias"),aT=Symbol.for("yaml.document"),oT=Symbol.for("yaml.map"),lT=Symbol.for("yaml.pair"),cT=Symbol.for("yaml.scalar"),uT=Symbol.for("yaml.seq"),dT=Symbol.for("yaml.node.type"),pT=e=>!!e&&"object"==typeof e&&e[dT]===iT,fT=e=>!!e&&"object"==typeof e&&e[dT]===aT,hT=e=>!!e&&"object"==typeof e&&e[dT]===oT,mT=e=>!!e&&"object"==typeof e&&e[dT]===lT,gT=e=>!!e&&"object"==typeof e&&e[dT]===cT,yT=e=>!!e&&"object"==typeof e&&e[dT]===uT;function kT(e){if(e&&"object"==typeof e)switch(e[dT]){case oT:case uT:return!0}return!1}function wT(e){if(e&&"object"==typeof e)switch(e[dT]){case iT:case oT:case cT:case uT:return!0}return!1}const bT=e=>(gT(e)||kT(e))&&!!e.anchor,vT=Symbol("break visit"),ST=Symbol("skip children"),xT=Symbol("remove node");function CT(e,t){const n=MT(t);fT(e)?TT(null,e.contents,n,Object.freeze([e]))===xT&&(e.contents=null):TT(null,e,n,Object.freeze([]))}function TT(e,t,n,s){const r=AT(e,t,n,s);if(wT(r)||mT(r))return NT(e,s,r),TT(e,r,n,s);if("symbol"!=typeof r)if(kT(t)){s=Object.freeze(s.concat(t));for(let e=0;e<t.items.length;++e){const r=TT(e,t.items[e],n,s);if("number"==typeof r)e=r-1;else{if(r===vT)return vT;r===xT&&(t.items.splice(e,1),e-=1)}}}else if(mT(t)){s=Object.freeze(s.concat(t));const e=TT("key",t.key,n,s);if(e===vT)return vT;e===xT&&(t.key=null);const r=TT("value",t.value,n,s);if(r===vT)return vT;r===xT&&(t.value=null)}return r}async function OT(e,t){const n=MT(t);fT(e)?await DT(null,e.contents,n,Object.freeze([e]))===xT&&(e.contents=null):await DT(null,e,n,Object.freeze([]))}async function DT(e,t,n,s){const r=await AT(e,t,n,s);if(wT(r)||mT(r))return NT(e,s,r),DT(e,r,n,s);if("symbol"!=typeof r)if(kT(t)){s=Object.freeze(s.concat(t));for(let e=0;e<t.items.length;++e){const r=await DT(e,t.items[e],n,s);if("number"==typeof r)e=r-1;else{if(r===vT)return vT;r===xT&&(t.items.splice(e,1),e-=1)}}}else if(mT(t)){s=Object.freeze(s.concat(t));const e=await DT("key",t.key,n,s);if(e===vT)return vT;e===xT&&(t.key=null);const r=await DT("value",t.value,n,s);if(r===vT)return vT;r===xT&&(t.value=null)}return r}function MT(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function AT(e,t,n,s){return"function"==typeof n?n(e,t,s):hT(t)?n.Map?.(e,t,s):yT(t)?n.Seq?.(e,t,s):mT(t)?n.Pair?.(e,t,s):gT(t)?n.Scalar?.(e,t,s):pT(t)?n.Alias?.(e,t,s):void 0}function NT(e,t,n){const s=t[t.length-1];if(kT(s))s.items[e]=n;else if(mT(s))"key"===e?s.key=n:s.value=n;else{if(!fT(s)){const e=pT(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}s.contents=n}}CT.BREAK=vT,CT.SKIP=ST,CT.REMOVE=xT,OT.BREAK=vT,OT.SKIP=ST,OT.REMOVE=xT;const ET={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},IT=e=>e.replace(/[!,[\]{}]/g,e=>ET[e]);class RT{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},RT.defaultYaml,e),this.tags=Object.assign({},RT.defaultTags,t)}clone(){const e=new RT(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new RT(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:RT.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},RT.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:RT.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},RT.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[e,s]=n;return this.tags[e]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;return"1.1"===e||"1.2"===e?(this.yaml.version=e,!0):(t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1)}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(s)}catch(i){return t(String(i)),null}return"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+IT(e.substring(n.length));return"!"===e[0]?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let s;if(e&&n.length>0&&wT(e.contents)){const t={};CT(e.contents,(e,n)=>{wT(n)&&n.tag&&(t[n.tag]=!0)}),s=Object.keys(t)}else s=[];for(const[r,i]of n)"!!"===r&&"tag:yaml.org,2002:"===i||e&&!s.some(e=>e.startsWith(i))||t.push(`%TAG ${r} ${i}`);return t.join("\n")}}function LT(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function PT(e){const t=new Set;return CT(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function $T(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function VT(e,t){const n=[],s=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=PT(e));const i=$T(t,r);return r.add(i),i},setAnchors:()=>{for(const e of n){const t=s.get(e);if("object"!=typeof t||!t.anchor||!gT(t.node)&&!kT(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:s}}function BT(e,t,n,s){if(s&&"object"==typeof s)if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){const t=s[r],n=BT(e,s,String(r),t);void 0===n?delete s[r]:n!==t&&(s[r]=n)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const t=s.get(r),n=BT(e,s,r,t);void 0===n?s.delete(r):n!==t&&s.set(r,n)}else if(s instanceof Set)for(const r of Array.from(s)){const t=BT(e,s,r,r);void 0===t?s.delete(r):t!==r&&(s.delete(r),s.add(t))}else for(const[r,i]of Object.entries(s)){const t=BT(e,s,r,i);void 0===t?delete s[r]:t!==i&&(s[r]=t)}return e.call(t,n,s)}function FT(e,t,n){if(Array.isArray(e))return e.map((e,t)=>FT(e,String(t),n));if(e&&"function"==typeof e.toJSON){if(!n||!bT(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=e=>{s.res=e,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return"bigint"!=typeof e||n?.keep?e:Number(e)}RT.defaultYaml={explicit:!1,version:"1.2"},RT.defaultTags={"!!":"tag:yaml.org,2002:"};class zT{constructor(e){Object.defineProperty(this,dT,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:s,reviver:r}={}){if(!fT(e))throw new TypeError("A document argument is required");const i={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},a=FT(this,"",i);if("function"==typeof s)for(const{count:o,res:l}of i.anchors.values())s(l,o);return"function"==typeof r?BT(r,{"":a},"",a):a}}class WT extends zT{constructor(e){super(iT),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n,s;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],CT(e,{Node:(e,t)=>{(pT(t)||bT(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));for(const r of n){if(r===this)break;r.anchor===this.source&&(s=r)}return s}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:s,maxAliasCount:r}=t,i=this.resolve(s,t);if(!i){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let a=n.get(i);if(a||(FT(i,null,t),a=n.get(i)),void 0===a?.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(r>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=jT(s,i,n)),a.count*a.aliasCount>r))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return a.res}toString(e,t,n){const s=`*${this.source}`;if(e){if(LT(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${s} `}return s}}function jT(e,t,n){if(pT(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}if(kT(t)){let s=0;for(const r of t.items){const t=jT(e,r,n);t>s&&(s=t)}return s}if(mT(t)){const s=jT(e,t.key,n),r=jT(e,t.value,n);return Math.max(s,r)}return 1}const _T=e=>!e||"function"!=typeof e&&"object"!=typeof e;class UT extends zT{constructor(e){super(cT),this.value=e}toJSON(e,t){return t?.keep?this.value:FT(this.value,e,t)}toString(){return String(this.value)}}function KT(e,t,n){if(fT(e)&&(e=e.contents),wT(e))return e;if(mT(e)){const t=n.schema[oT].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:a,sourceObjects:o}=n;let l;if(s&&e&&"object"==typeof e){if(l=o.get(e),l)return l.anchor??(l.anchor=r(e)),new WT(l.anchor);l={anchor:null,node:null},o.set(e,l)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let c=function(e,t,n){if(t){const e=n.filter(e=>e.tag===t),s=e.find(e=>!e.format)??e[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(t=>t.identify?.(e)&&!t.format)}(e,t,a.tags);if(!c){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){const t=new UT(e);return l&&(l.node=t),t}c=e instanceof Map?a[oT]:Symbol.iterator in Object(e)?a[uT]:a[oT]}i&&(i(c),delete n.onTagObj);const u=c?.createNode?c.createNode(n.schema,e,n):"function"==typeof c?.nodeClass?.from?c.nodeClass.from(n.schema,e,n):new UT(e);return t?u.tag=t:c.default||(u.tag=c.tag),l&&(l.node=u),u}function qT(e,t,n){let s=n;for(let r=t.length-1;r>=0;--r){const e=t[r];if("number"==typeof e&&Number.isInteger(e)&&e>=0){const t=[];t[e]=s,s=t}else s=new Map([[e,s]])}return KT(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}UT.BLOCK_FOLDED="BLOCK_FOLDED",UT.BLOCK_LITERAL="BLOCK_LITERAL",UT.PLAIN="PLAIN",UT.QUOTE_DOUBLE="QUOTE_DOUBLE",UT.QUOTE_SINGLE="QUOTE_SINGLE";const HT=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class YT extends zT{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>wT(t)||mT(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(HT(e))this.add(t);else{const[n,...s]=e,r=this.get(n,!0);if(kT(r))r.addIn(s,t);else{if(void 0!==r||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`);this.set(n,qT(this.schema,s,t))}}}deleteIn(e){const[t,...n]=e;if(0===n.length)return this.delete(t);const s=this.get(t,!0);if(kT(s))return s.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...s]=e,r=this.get(n,!0);return 0===s.length?!t&&gT(r)?r.value:r:kT(r)?r.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!mT(t))return!1;const n=t.value;return null==n||e&&gT(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(0===n.length)return this.has(t);const s=this.get(t,!0);return!!kT(s)&&s.hasIn(n)}setIn(e,t){const[n,...s]=e;if(0===s.length)this.set(n,t);else{const e=this.get(n,!0);if(kT(e))e.setIn(s,t);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`);this.set(n,qT(this.schema,s,t))}}}}const JT=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function GT(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const QT=(e,t,n)=>e.endsWith("\n")?GT(n,t):n.includes("\n")?"\n"+GT(n,t):(e.endsWith(" ")?"":" ")+n,ZT="flow",XT="block",eO="quoted";function tO(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:a,onOverflow:o}={}){if(!r||r<0)return e;r<i&&(i=0);const l=Math.max(1+i,1+r-t.length);if(e.length<=l)return e;const c=[],u={};let d,p,f=r-t.length;"number"==typeof s&&(s>r-Math.max(2,i)?c.push(0):f=r-s);let h=!1,m=-1,g=-1,y=-1;n===XT&&(m=nO(e,m,t.length),-1!==m&&(f=m+l));for(let w;w=e[m+=1];){if(n===eO&&"\\"===w){switch(g=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if("\n"===w)n===XT&&(m=nO(e,m,t.length)),f=m+t.length+l,d=void 0;else{if(" "===w&&p&&" "!==p&&"\n"!==p&&"\t"!==p){const t=e[m+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(d=m)}if(m>=f)if(d)c.push(d),f=d+l,d=void 0;else if(n===eO){for(;" "===p||"\t"===p;)p=w,w=e[m+=1],h=!0;const t=m>y+1?m-2:g-1;if(u[t])return e;c.push(t),u[t]=!0,f=t+l,d=void 0}else h=!0}p=w}if(h&&o&&o(),0===c.length)return e;a&&a();let k=e.slice(0,c[0]);for(let w=0;w<c.length;++w){const s=c[w],r=c[w+1]||e.length;0===s?k=`\n${t}${e.slice(0,r)}`:(n===eO&&u[s]&&(k+=`${e[s]}\\`),k+=`\n${t}${e.slice(s+1,r)}`)}return k}function nO(e,t,n){let s=t,r=t+1,i=e[r];for(;" "===i||"\t"===i;)if(t<r+n)i=e[++t];else{do{i=e[++t]}while(i&&"\n"!==i);s=t,r=t+1,i=e[r]}return s}const sO=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),rO=e=>/^(%|---|\.\.\.)/m.test(e);function iO(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(rO(e)?" ":"");let a="",o=0;for(let l=0,c=n[l];c;c=n[++l])if(" "===c&&"\\"===n[l+1]&&"n"===n[l+2]&&(a+=n.slice(o,l)+"\\ ",l+=1,o=l,c="\\"),"\\"===c)switch(n[l+1]){case"u":{a+=n.slice(o,l);const e=n.substr(l+2,4);switch(e){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===e.substr(0,2)?a+="\\x"+e.substr(2):a+=n.substr(l,6)}l+=5,o=l+1}break;case"n":if(s||'"'===n[l+2]||n.length<r)l+=1;else{for(a+=n.slice(o,l)+"\n\n";"\\"===n[l+2]&&"n"===n[l+3]&&'"'!==n[l+4];)a+="\n",l+=2;a+=i," "===n[l+2]&&(a+="\\"),l+=1,o=l+1}break;default:l+=1}return a=o?a+n.slice(o):n,s?a:tO(a,i,eO,sO(t,!1))}function aO(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return iO(e,t);const n=t.indent||(rO(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${n}`)+"'";return t.implicitKey?s:tO(s,n,ZT,sO(t,!1))}function oO(e,t){const{singleQuote:n}=t.options;let s;if(!1===n)s=iO;else{const t=e.includes('"'),r=e.includes("'");s=t&&!r?aO:r&&!t?iO:n?aO:iO}return s(e,t)}let lO;try{lO=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{lO=/\n+(?!\n|$)/g}function cO({comment:e,type:t,value:n},s,r,i){const{blockQuote:a,commentString:o,lineWidth:l}=s.options;if(!a||/\n[\t ]+$/.test(n))return oO(n,s);const c=s.indent||(s.forceBlockIndent||rO(n)?" ":""),u="literal"===a||"folded"!==a&&t!==UT.BLOCK_FOLDED&&(t===UT.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const s=t-n,r=e.length;if(r<=s)return!1;for(let i=0,a=0;i<r;++i)if("\n"===e[i]){if(i-a>s)return!0;if(a=i+1,r-a<=s)return!1}return!0}(n,l,c.length));if(!n)return u?"|\n":">\n";let d,p;for(p=n.length;p>0;--p){const e=n[p-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let f=n.substring(p);const h=f.indexOf("\n");-1===h?d="-":n===f||h!==f.length-1?(d="+",i&&i()):d="",f&&(n=n.slice(0,-f.length),"\n"===f[f.length-1]&&(f=f.slice(0,-1)),f=f.replace(lO,`$&${c}`));let m,g=!1,y=-1;for(m=0;m<n.length;++m){const e=n[m];if(" "===e)g=!0;else{if("\n"!==e)break;y=m}}let k=n.substring(0,y<m?y+1:m);k&&(n=n.substring(k.length),k=k.replace(/\n+/g,`$&${c}`));let w=(g?c?"2":"1":"")+d;if(e&&(w+=" "+o(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){const e=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let r=!1;const i=sO(s,!0);"folded"!==a&&t!==UT.BLOCK_FOLDED&&(i.onOverflow=()=>{r=!0});const o=tO(`${k}${e}${f}`,c,XT,i);if(!r)return`>${w}\n${c}${o}`}return`|${w}\n${c}${k}${n=n.replace(/\n+/g,`$&${c}`)}${f}`}function uO(e,t,n,s){const{implicitKey:r,inFlow:i}=t,a="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;o!==UT.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=UT.QUOTE_DOUBLE);const l=e=>{switch(e){case UT.BLOCK_FOLDED:case UT.BLOCK_LITERAL:return r||i?oO(a.value,t):cO(a,t,n,s);case UT.QUOTE_DOUBLE:return iO(a.value,t);case UT.QUOTE_SINGLE:return aO(a.value,t);case UT.PLAIN:return function(e,t,n,s){const{type:r,value:i}=e,{actualString:a,implicitKey:o,indent:l,indentStep:c,inFlow:u}=t;if(o&&i.includes("\n")||u&&/[[\]{},]/.test(i))return oO(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||u||!i.includes("\n")?oO(i,t):cO(e,t,n,s);if(!o&&!u&&r!==UT.PLAIN&&i.includes("\n"))return cO(e,t,n,s);if(rO(i)){if(""===l)return t.forceBlockIndent=!0,cO(e,t,n,s);if(o&&l===c)return oO(i,t)}const d=i.replace(/\n+/g,`$&\n${l}`);if(a){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(d),{compat:n,tags:s}=t.doc.schema;if(s.some(e)||n?.some(e))return oO(i,t)}return o?d:tO(d,l,ZT,sO(t,!1))}(a,t,n,s);default:return null}};let c=l(o);if(null===c){const{defaultKeyType:e,defaultStringType:n}=t.options,s=r&&e||n;if(c=l(s),null===c)throw new Error(`Unsupported default string type ${s}`)}return c}function dO(e,t){const n=Object.assign({blockQuote:!0,commentString:JT,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:s,options:n}}function pO(e,t,n,s){if(mT(e))return e.toString(t,n,s);if(pT(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const i=wT(e)?e:t.doc.createNode(e,{onTagObj:e=>r=e});r??(r=function(e,t){if(t.tag){const n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,s;if(gT(t)){s=t.value;let r=e.filter(e=>e.identify?.(s));if(r.length>1){const e=r.filter(e=>e.test);e.length>0&&(r=e)}n=r.find(e=>e.format===t.format)??r.find(e=>!e.format)}else s=t,n=e.find(e=>e.nodeClass&&s instanceof e.nodeClass);if(!n)throw new Error(`Tag not resolved for ${s?.constructor?.name??(null===s?"null":typeof s)} value`);return n}(t.doc.schema.tags,i));const a=function(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],i=(gT(e)||kT(e))&&e.anchor;i&<(i)&&(n.add(i),r.push(`&${i}`));const a=e.tag??(t.default?null:t.tag);return a&&r.push(s.directives.tagString(a)),r.join(" ")}(i,r,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const o="function"==typeof r.stringify?r.stringify(i,t,n,s):gT(i)?uO(i,t,n,s):i.toString(t,n,s);return a?gT(i)||"{"===o[0]||"["===o[0]?`${a} ${o}`:`${a}\n${t.indent}${o}`:o}function fO(e,t){"debug"!==e&&"warn"!==e||console.warn(t)}const hO="<<",mO={identify:e=>e===hO||"symbol"==typeof e&&e.description===hO,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new UT(Symbol(hO)),{addToJSMap:gO}),stringify:()=>hO};function gO(e,t,n){if(n=e&&pT(n)?n.resolve(e.doc):n,yT(n))for(const s of n.items)yO(e,t,s);else if(Array.isArray(n))for(const s of n)yO(e,t,s);else yO(e,t,n)}function yO(e,t,n){const s=e&&pT(n)?n.resolve(e.doc):n;if(!hT(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,e,Map);for(const[i,a]of r)t instanceof Map?t.has(i)||t.set(i,a):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function kO(e,t,{key:n,value:s}){if(wT(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(((e,t)=>(mO.identify(t)||gT(t)&&(!t.type||t.type===UT.PLAIN)&&mO.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===mO.tag&&e.default))(e,n))gO(e,t,s);else{const r=FT(n,"",e);if(t instanceof Map)t.set(r,FT(s,r,e));else if(t instanceof Set)t.add(r);else{const i=function(e,t,n){if(null===t)return"";if("object"!=typeof t)return String(t);if(wT(e)&&n?.doc){const t=dO(n.doc,{});t.anchors=new Set;for(const e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const s=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(s);e.length>40&&(e=e.substring(0,36)+'..."'),fO(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}(n,r,e),a=FT(s,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function wO(e,t,n){const s=KT(e,void 0,n),r=KT(t,void 0,n);return new bO(s,r)}class bO{constructor(e,t=null){Object.defineProperty(this,dT,{value:lT}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return wT(t)&&(t=t.clone(e)),wT(n)&&(n=n.clone(e)),new bO(t,n)}toJSON(e,t){return kO(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?function({key:e,value:t},n,s,r){const{allNullValues:i,doc:a,indent:o,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:d}}=n;let p=wT(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(kT(e)||!wT(e)&&"object"==typeof e)throw new Error("With simple keys, collection cannot be used as a key value")}let f=!d&&(!e||p&&null==t&&!n.inFlow||kT(e)||(gT(e)?e.type===UT.BLOCK_FOLDED||e.type===UT.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(d||!i),indent:o+l});let h,m,g,y=!1,k=!1,w=pO(e,n,()=>y=!0,()=>k=!0);if(!f&&!n.inFlow&&w.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(i||null==t)return y&&s&&s(),""===w?"?":f?`? ${w}`:w}else if(i&&!d||null==t&&f)return w=`? ${w}`,p&&!y?w+=QT(w,n.indent,c(p)):k&&r&&r(),w;y&&(p=null),f?(p&&(w+=QT(w,n.indent,c(p))),w=`? ${w}\n${o}:`):(w=`${w}:`,p&&(w+=QT(w,n.indent,c(p)))),wT(t)?(h=!!t.spaceBefore,m=t.commentBefore,g=t.comment):(h=!1,m=null,g=null,t&&"object"==typeof t&&(t=a.createNode(t))),n.implicitKey=!1,f||p||!gT(t)||(n.indentAtStart=w.length+1),k=!1,u||!(l.length>=2)||n.inFlow||f||!yT(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let b=!1;const v=pO(t,n,()=>b=!0,()=>k=!0);let S=" ";if(p||h||m)S=h?"\n":"",m&&(S+=`\n${GT(c(m),n.indent)}`),""!==v||n.inFlow?S+=`\n${n.indent}`:"\n"===S&&g&&(S="\n\n");else if(!f&&kT(t)){const e=v[0],s=v.indexOf("\n"),r=-1!==s,i=n.inFlow??t.flow??0===t.items.length;if(r||!i){let t=!1;if(r&&("&"===e||"!"===e)){let n=v.indexOf(" ");"&"===e&&-1!==n&&n<s&&"!"===v[n+1]&&(n=v.indexOf(" ",n+1)),(-1===n||s<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else""!==v&&"\n"!==v[0]||(S="");return w+=S+v,n.inFlow?b&&s&&s():g&&!b?w+=QT(w,n.indent,c(g)):k&&r&&r(),w}(this,e,t,n):JSON.stringify(this)}}function vO(e,t,n){return(t.inFlow??e.flow?xO:SO)(e,t,n)}function SO({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:a,onComment:o}){const{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:i,type:null});let d=!1;const p=[];for(let h=0;h<t.length;++h){const e=t[h];let r=null;if(wT(e))!d&&e.spaceBefore&&p.push(""),CO(n,p,e.commentBefore,d),e.comment&&(r=e.comment);else if(mT(e)){const t=wT(e.key)?e.key:null;t&&(!d&&t.spaceBefore&&p.push(""),CO(n,p,t.commentBefore,d))}d=!1;let a=pO(e,u,()=>r=null,()=>d=!0);r&&(a+=QT(a,i,c(r))),d&&r&&(d=!1),p.push(s+a)}let f;if(0===p.length)f=r.start+r.end;else{f=p[0];for(let e=1;e<p.length;++e){const t=p[e];f+=t?`\n${l}${t}`:"\n"}}return e?(f+="\n"+GT(c(e),l),o&&o()):d&&a&&a(),f}function xO({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:i,flowCollectionPadding:a,options:{commentString:o}}=t;s+=i;const l=Object.assign({},t,{indent:s,inFlow:!0,type:null});let c=!1,u=0;const d=[];for(let h=0;h<e.length;++h){const n=e[h];let r=null;if(wT(n))n.spaceBefore&&d.push(""),CO(t,d,n.commentBefore,!1),n.comment&&(r=n.comment);else if(mT(n)){const e=wT(n.key)?n.key:null;e&&(e.spaceBefore&&d.push(""),CO(t,d,e.commentBefore,!1),e.comment&&(c=!0));const s=wT(n.value)?n.value:null;s?(s.comment&&(r=s.comment),s.commentBefore&&(c=!0)):null==n.value&&e?.comment&&(r=e.comment)}r&&(c=!0);let i=pO(n,l,()=>r=null);h<e.length-1&&(i+=","),r&&(i+=QT(i,s,o(r))),!c&&(d.length>u||i.includes("\n"))&&(c=!0),d.push(i),u=d.length}const{start:p,end:f}=n;if(0===d.length)return p+f;if(!c){const e=d.reduce((e,t)=>e+t.length+2,2);c=t.options.lineWidth>0&&e>t.options.lineWidth}if(c){let e=p;for(const t of d)e+=t?`\n${i}${r}${t}`:"\n";return`${e}\n${r}${f}`}return`${p}${a}${d.join(" ")}${a}${f}`}function CO({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const r=GT(t(s),e);n.push(r.trimStart())}}function TO(e,t){const n=gT(t)?t.value:t;for(const s of e)if(mT(s)){if(s.key===t||s.key===n)return s;if(gT(s.key)&&s.key.value===n)return s}}class OO extends YT{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(oT,e),this.items=[]}static from(e,t,n){const{keepUndefined:s,replacer:r}=n,i=new this(e),a=(e,a)=>{if("function"==typeof r)a=r.call(t,e,a);else if(Array.isArray(r)&&!r.includes(e))return;(void 0!==a||s)&&i.items.push(wO(e,a,n))};if(t instanceof Map)for(const[o,l]of t)a(o,l);else if(t&&"object"==typeof t)for(const o of Object.keys(t))a(o,t[o]);return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i}add(e,t){let n;n=mT(e)?e:e&&"object"==typeof e&&"key"in e?new bO(e.key,e.value):new bO(e,e?.value);const s=TO(this.items,n.key),r=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${n.key} already set`);gT(s.value)&&_T(n.value)?s.value.value=n.value:s.value=n.value}else if(r){const e=this.items.findIndex(e=>r(n,e)<0);-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=TO(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=TO(this.items,e),s=n?.value;return(!t&&gT(s)?s.value:s)??void 0}has(e){return!!TO(this.items,e)}set(e,t){this.add(new bO(e,t),!0)}toJSON(e,t,n){const s=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(const r of this.items)kO(t,s,r);return s}toString(e,t,n){if(!e)return JSON.stringify(this);for(const s of this.items)if(!mT(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),vO(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}class DO extends YT{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(uT,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=MO(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){const n=MO(e);if("number"!=typeof n)return;const s=this.items[n];return!t&&gT(s)?s.value:s}has(e){const t=MO(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=MO(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const s=this.items[n];gT(s)&&_T(t)?s.value=t:this.items[n]=t}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let s=0;for(const r of this.items)n.push(FT(r,String(s++),t));return n}toString(e,t,n){return e?vO(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:s}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let i of t){if("function"==typeof s){const n=t instanceof Set?i:String(e++);i=s.call(t,n,i)}r.items.push(KT(i,void 0,n))}}return r}}function MO(e){let t=gT(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}function AO(e,t){if(yT(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!mT(s)){if(hT(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const e=s.items[0]||new bO(new UT(null));if(s.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${s.commentBefore}\n${e.key.commentBefore}`:s.commentBefore),s.comment){const t=e.value??e.key;t.comment=t.comment?`${s.comment}\n${t.comment}`:s.comment}s=e}e.items[n]=mT(s)?s:new bO(s)}}else t("Expected a sequence for this tag");return e}function NO(e,t,n){const{replacer:s}=n,r=new DO(e);r.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let a of t){let e,o;if("function"==typeof s&&(a=s.call(t,String(i++),a)),Array.isArray(a)){if(2!==a.length)throw new TypeError(`Expected [key, value] tuple: ${a}`);e=a[0],o=a[1]}else if(a&&a instanceof Object){const t=Object.keys(a);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);e=t[0],o=a[e]}else e=a;r.items.push(wO(e,o,n))}return r}const EO={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:AO,createNode:NO};class IO extends DO{constructor(){super(),this.add=OO.prototype.add.bind(this),this.delete=OO.prototype.delete.bind(this),this.get=OO.prototype.get.bind(this),this.has=OO.prototype.has.bind(this),this.set=OO.prototype.set.bind(this),this.tag=IO.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t?.onCreate&&t.onCreate(n);for(const s of this.items){let e,r;if(mT(s)?(e=FT(s.key,"",t),r=FT(s.value,e,t)):e=FT(s,"",t),n.has(e))throw new Error("Ordered maps must not include duplicate keys");n.set(e,r)}return n}static from(e,t,n){const s=NO(e,t,n),r=new this;return r.items=s.items,r}}IO.tag="tag:yaml.org,2002:omap";const RO={collection:"seq",identify:e=>e instanceof Map,nodeClass:IO,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=AO(e,t),s=[];for(const{key:r}of n.items)gT(r)&&(s.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new IO,n)},createNode:(e,t,n)=>IO.from(e,t,n)};class LO extends OO{constructor(e){super(e),this.tag=LO.tag}add(e){let t;t=mT(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new bO(e.key,null):new bO(e,null),TO(this.items,t.key)||this.items.push(t)}get(e,t){const n=TO(this.items,e);return!t&&mT(n)?gT(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const n=TO(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new bO(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:s}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let i of t)"function"==typeof s&&(i=s.call(t,i,i)),r.items.push(wO(i,null,n));return r}}LO.tag="tag:yaml.org,2002:set";const PO={collection:"map",identify:e=>e instanceof Set,nodeClass:LO,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>LO.from(e,t,n),resolve(e,t){if(hT(e)){if(e.hasAllNullValues(!0))return Object.assign(new LO,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};class $O extends Error{constructor(e,t,n,s){super(),this.name=e,this.code=n,this.message=s,this.pos=t}}class VO extends $O{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class BO extends $O{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const FO=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map(e=>t.linePos(e));const{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let i=r-1,a=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){const e=Math.min(i-39,a.length-79);a="…"+a.substring(e),i-=e-1}if(a.length>80&&(a=a.substring(0,79)+"…"),s>1&&/^ *$/.test(a.substring(0,i))){let n=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),a=n+a}if(/[^ ]/.test(a)){let e=1;const t=n.linePos[1];t?.line===s&&t.col>r&&(e=Math.max(1,Math.min(t.col-r,80-i)));const o=" ".repeat(i)+"^".repeat(e);n.message+=`:\n\n${a}\n${o}\n`}};function zO(e,t,n,s){let r="";if(e){let i=!1,a="";for(const o of e){const{source:e,type:l}=o;switch(l){case"space":i=!0;break;case"comment":{n&&!i&&s(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";r?r+=a+t:r=t,a="";break}case"newline":r&&(a+=e),i=!0;break;default:s(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:r,offset:t}}function WO(e,t,n){const s=t.offset,r=function({offset:e,props:t},n,s){if("block-scalar-header"!==t[0].type)return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],i=r[0];let a=0,o="",l=-1;for(let p=1;p<r.length;++p){const t=r[p];if(o||"-"!==t&&"+"!==t){const n=Number(t);!a&&n?a=n:-1===l&&(l=e+p)}else o=t}-1!==l&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",d=r.length;for(let p=1;p<t.length;++p){const e=t[p];switch(e.type){case"space":c=!0;case"newline":d+=e.source.length;break;case"comment":n&&!c&&s(e,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=e.source.length,u=e.source.substring(1);break;case"error":s(e,"UNEXPECTED_TOKEN",e.message),d+=e.source.length;break;default:{s(e,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${e.type}`);const t=e.source;t&&"string"==typeof t&&(d+=t.length)}}}return{mode:i,indent:a,chomp:o,comment:u,length:d}}(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const i=">"===r.mode?UT.BLOCK_FOLDED:UT.BLOCK_LITERAL,a=t.source?function(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),r=[s?.[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let i=1;i<t.length;i+=2)r.push([t[i],t[i+1]]);return r}(t.source):[];let o=a.length;for(let m=a.length-1;m>=0;--m){const e=a[m][1];if(""!==e&&"\r"!==e)break;o=m}if(0===o){const e="+"===r.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let n=s+r.length;return t.source&&(n+=t.source.length),{value:e,type:i,comment:r.comment,range:[s,n,n]}}let l=t.indent+r.indent,c=t.offset+r.length,u=0;for(let m=0;m<o;++m){const[t,s]=a[m];if(""!==s&&"\r"!==s){if(t.length<l){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";n(c+t.length,"MISSING_CHAR",e)}0===r.indent&&(l=t.length),u=m,0!==l||e.atRoot||n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}0===r.indent&&t.length>l&&(l=t.length),c+=t.length+s.length+1}for(let m=a.length-1;m>=o;--m)a[m][0].length>l&&(o=m+1);let d="",p="",f=!1;for(let m=0;m<u;++m)d+=a[m][0].slice(l)+"\n";for(let m=u;m<o;++m){let[e,t]=a[m];c+=e.length+t.length+1;const s="\r"===t[t.length-1];if(s&&(t=t.slice(0,-1)),t&&e.length<l){const i="Block scalar lines must not be less indented than their "+(r.indent?"explicit indentation indicator":"first line");n(c-t.length-(s?2:1),"BAD_INDENT",i),e=""}i===UT.BLOCK_LITERAL?(d+=p+e.slice(l)+t,p="\n"):e.length>l||"\t"===t[0]?(" "===p?p="\n":f||"\n"!==p||(p="\n\n"),d+=p+e.slice(l)+t,p="\n",f=!0):""===t?"\n"===p?d+="\n":p="\n":(d+=p+t,p=" ",f=!1)}switch(r.chomp){case"-":break;case"+":for(let e=o;e<a.length;++e)d+="\n"+a[e][0].slice(l);"\n"!==d[d.length-1]&&(d+="\n");break;default:d+="\n"}const h=s+r.length+t.source.length;return{value:d,type:i,comment:r.comment,range:[s,h,h]}}function jO(e,t,n){const{offset:s,type:r,source:i,end:a}=e;let o,l;const c=(e,t,r)=>n(s+e,t,r);switch(r){case"scalar":o=UT.PLAIN,l=function(e,t){let n="";switch(e[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${e[0]}`;break;case"@":case"`":n=`reserved character ${e[0]}`}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),_O(e)}(i,c);break;case"single-quoted-scalar":o=UT.QUOTE_SINGLE,l=function(e,t){return"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote"),_O(e.slice(1,-1)).replace(/''/g,"'")}(i,c);break;case"double-quoted-scalar":o=UT.QUOTE_DOUBLE,l=function(e,t){let n="";for(let s=1;s<e.length-1;++s){const r=e[s];if("\r"!==r||"\n"!==e[s+1])if("\n"===r){const{fold:t,offset:r}=UO(e,s);n+=t,s=r}else if("\\"===r){let r=e[++s];const i=KO[r];if(i)n+=i;else if("\n"===r)for(r=e[s+1];" "===r||"\t"===r;)r=e[1+ ++s];else if("\r"===r&&"\n"===e[s+1])for(r=e[1+ ++s];" "===r||"\t"===r;)r=e[1+ ++s];else if("x"===r||"u"===r||"U"===r){const i={x:2,u:4,U:8}[r];n+=qO(e,s+1,i,t),s+=i}else{const r=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),n+=r}}else if(" "===r||"\t"===r){const t=s;let i=e[s+1];for(;" "===i||"\t"===i;)i=e[1+ ++s];"\n"===i||"\r"===i&&"\n"===e[s+2]||(n+=s>t?e.slice(t,s+1):r)}else n+=r}return'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}(i,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}const u=s+i.length,d=zO(a,u,t,n);return{value:l,type:o,comment:d.comment,range:[s,u,d.offset]}}function _O(e){let t,n;try{t=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy"),n=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(e);if(!s)return e;let r=s[1],i=" ",a=t.lastIndex;for(n.lastIndex=a;s=n.exec(e);)""===s[1]?"\n"===i?r+=i:i="\n":(r+=i+s[1],i=" "),a=n.lastIndex;const o=/[ \t]*(.*)/sy;return o.lastIndex=a,s=o.exec(e),r+i+(s?.[1]??"")}function UO(e,t){let n="",s=e[t+1];for(;!(" "!==s&&"\t"!==s&&"\n"!==s&&"\r"!==s||"\r"===s&&"\n"!==e[t+2]);)"\n"===s&&(n+="\n"),s=e[(t+=1)+1];return n||(n=" "),{fold:n,offset:t}}const KO={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function qO(e,t,n,s){const r=e.substr(t,n),i=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(i)){const r=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),r}return String.fromCodePoint(i)}function HO(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function YO(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let r=t.length;"block-scalar-header"===e.props[0].type&&(r-=e.props[0].source.length);for(const e of s)e.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:s});break}case"block-map":case"block-seq":{const s={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[s]});break}default:{const s="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:s,source:t,end:r})}}}function JO(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=JO(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=GO(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=GO(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=GO(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function GO({start:e,key:t,sep:n,value:s}){let r="";for(const i of e)r+=i.source;if(t&&(r+=JO(t)),n)for(const i of n)r+=i.source;return s&&(r+=JO(s)),r}const QO=Symbol("break visit"),ZO=Symbol("skip children"),XO=Symbol("remove item");function eD(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),tD(Object.freeze([]),e,t)}function tD(e,t,n){let s=n(t,e);if("symbol"==typeof s)return s;for(const r of["key","value"]){const i=t[r];if(i&&"items"in i){for(let t=0;t<i.items.length;++t){const s=tD(Object.freeze(e.concat([[r,t]])),i.items[t],n);if("number"==typeof s)t=s-1;else{if(s===QO)return QO;s===XO&&(i.items.splice(t,1),t-=1)}}"function"==typeof s&&"key"===r&&(s=s(t,e))}}return"function"==typeof s?s(t,e):s}eD.BREAK=QO,eD.SKIP=ZO,eD.REMOVE=XO,eD.itemAtPath=(e,t)=>{let n=e;for(const[s,r]of t){const e=n?.[s];if(!e||!("items"in e))return;n=e.items[r]}return n},eD.parentCollection=(e,t)=>{const n=eD.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],r=n?.[s];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};const nD="\ufeff",sD="",rD="",iD="";function aD(e){switch(e){case nD:return"byte-order-mark";case sD:return"doc-mode";case rD:return"flow-error-end";case iD:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const oD=Object.freeze(Object.defineProperty({__proto__:null,BOM:nD,DOCUMENT:sD,FLOW_END:rD,SCALAR:iD,createScalarToken:function(e,t){const{implicitKey:n=!1,indent:s,inFlow:r=!1,offset:i=-1,type:a="PLAIN"}=t,o=uO({type:a,value:e},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:s,source:"\n"}];switch(o[0]){case"|":case">":{const e=o.indexOf("\n"),t=o.substring(0,e),n=o.substring(e+1)+"\n",r=[{type:"block-scalar-header",offset:i,indent:s,source:t}];return HO(r,l)||r.push({type:"newline",offset:-1,indent:s,source:"\n"}),{type:"block-scalar",offset:i,indent:s,props:r,source:n}}case'"':return{type:"double-quoted-scalar",offset:i,indent:s,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:s,source:o,end:l};default:return{type:"scalar",offset:i,indent:s,source:o,end:l}}},isCollection:e=>!!e&&"items"in e,isScalar:e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),prettyToken:function(e){switch(e){case nD:return"<BOM>";case sD:return"<DOC>";case rD:return"<FLOW_END>";case iD:return"<SCALAR>";default:return JSON.stringify(e)}},resolveAsScalar:function(e,t=!0,n){if(e){const s=(e,t,s)=>{const r="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!n)throw new VO([r,r+1],t,s);n(r,t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jO(e,t,s);case"block-scalar":return WO({options:{strict:t}},e,s)}}return null},setScalarValue:function(e,t,n={}){let{afterKey:s=!1,implicitKey:r=!1,inFlow:i=!1,type:a}=n,o="indent"in e?e.indent:null;if(s&&"number"==typeof o&&(o+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");a=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}const l=uO({type:a,value:t},{implicitKey:r||null===o,indent:null!==o&&o>0?" ".repeat(o):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){const n=t.indexOf("\n"),s=t.substring(0,n),r=t.substring(n+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=s,e.source=r}else{const{offset:t}=e,n="indent"in e?e.indent:-1,i=[{type:"block-scalar-header",offset:t,indent:n,source:s}];HO(i,"end"in e?e.end:void 0)||i.push({type:"newline",offset:-1,indent:n,source:"\n"});for(const s of Object.keys(e))"type"!==s&&"offset"!==s&&delete e[s];Object.assign(e,{type:"block-scalar",indent:n,props:i,source:r})}}(e,l);break;case'"':YO(e,l,"double-quoted-scalar");break;case"'":YO(e,l,"single-quoted-scalar");break;default:YO(e,l,"scalar")}},stringify:e=>"type"in e?JO(e):GO(e),tokenType:aD,visit:eD},Symbol.toStringTag,{value:"Module"}));function lD(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const cD=new Set("0123456789ABCDEFabcdef"),uD=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),dD=new Set(",[]{}"),pD=new Set(" ,[]{}\n\r\t"),fD=e=>!e||pD.has(e);class hD{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;" "===t;)t=this.buffer[++n+e];if("\r"===t){const t=this.buffer[n+e+1];if("\n"===t||!t&&!this.atEnd)return e+n+1}return"\n"===t||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if("-"===t||"."===t){const t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&lD(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if(e[0]===nD&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,n=e.indexOf("#");for(;-1!==n;){const s=e[n-1];if(" "===s||"\t"===s){t=n-1;break}n=e.indexOf("#",n+1)}for(;;){const n=e[t-1];if(" "!==n&&"\t"!==n)break;t-=1}const s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield sD,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if(("---"===e||"..."===e)&&lD(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!lD(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&lD(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(fD),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(!0)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do{e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=(yield*this.pushSpaces(!0))}while(e+t>0);const s=this.getLine();if(null===s)return this.setNext("flow");if((-1!==n&&n<this.indentNext&&"#"!==s[0]||0===n&&(s.startsWith("---")||s.startsWith("..."))&&lD(s[3]))&&(n!==this.indentNext-1||1!==this.flowLevel||"]"!==s[0]&&"}"!==s[0]))return this.flowLevel=0,yield rD,yield*this.parseLineStart();let r=0;for(;","===s[r];)r+=(yield*this.pushCount(1)),r+=(yield*this.pushSpaces(!0)),this.flowKey=!1;switch(r+=(yield*this.pushIndicators()),s[r]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(fD),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const e=this.charAt(1);if(this.flowKey||lD(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let s=n.indexOf("\n",this.pos);if(-1!==s){for(;-1!==s;){const e=this.continueScalar(s+1);if(-1===e)break;s=n.indexOf("\n",e)}-1!==s&&(t=s-("\r"===n[s-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>lD(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,n=0;e:for(let r=this.pos;e=this.buffer[r];++r)switch(e){case" ":n+=1;break;case"\n":t=r,n=0;break;case"\r":{const e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t);if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(e=this.buffer[s];" "===e;)e=this.buffer[++s];if("\t"===e){for(;"\t"===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,s=this.buffer[e];"\r"===s&&(s=this.buffer[--e]);const r=e;for(;" "===s;)s=this.buffer[--e];if(!("\n"===s&&e>=this.pos&&e+1+n>r))break;t=e}return yield iD,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t,n=this.pos-1,s=this.pos-1;for(;t=this.buffer[++s];)if(":"===t){const t=this.buffer[s+1];if(lD(t)||e&&dD.has(t))break;n=s}else if(lD(t)){let r=this.buffer[s+1];if("\r"===t&&("\n"===r?(s+=1,t="\n",r=this.buffer[s+1]):n=s),"#"===r||e&&dD.has(r))break;if("\n"===t){const e=this.continueScalar(s+1);if(-1===e)break;s=Math.max(s,e-2)}}else{if(e&&dD.has(t))break;n=s}return t||this.atEnd?(yield iD,yield*this.pushToIndex(n+1,!0),e?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(fD))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(lD(t)||e&&dD.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!lD(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(uD.has(t))t=this.buffer[++e];else{if("%"!==t||!cD.has(this.buffer[e+1])||!cD.has(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n]}while(" "===t||e&&"\t"===t);const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}var mD=JSON.parse('{"version":1,"fingerprint":"39483aeec14c11f8cfe4fa0f93db5ef13b06631e61a0bb5b28b287935af9511b","targets":{"lifeos-pro":{"voiceConversationEnabled":{"key":"voiceConversationEnabled","description":"DeepAsk 桌面语音对答实验开关,默认关闭;关闭会停止当前录音、播放和语音问答。","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"voiceProvider":{"key":"voiceProvider","description":"DeepAsk 语音识别与朗读供应商;对应 API Key 仅在本设备单独配置,不随库同步。","group":"general","schema":{"enum":["doubao","deepgram"]},"defaultValue":"doubao","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"doubaoVoiceSpeaker":{"key":"doubaoVoiceSpeaker","description":"DeepAsk 豆包语音合成音色 ID;需在用户自己的火山引擎账户中具有使用权限。","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"zh_female_vv_uranus_bigtts","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"lifeOSRibbonMode":{"key":"lifeOSRibbonMode","description":"LifeOS Ribbon 图标显示方式,默认全部显示。","group":"general","schema":{"enum":["compact","all"]},"defaultValue":"all","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"lifeOSSidebarSingleTab":{"key":"lifeOSSidebarSingleTab","description":"电脑端将九宫格与内容复用在同一个侧栏标签页。","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"lifeOSLauncherItems":{"key":"lifeOSLauncherItems","description":"LifeOS 九宫格常用入口;其他可用入口通过更多功能展开。","group":"general","schema":{"type":"array","items":{"type":"string"}},"defaultValue":["home","calendar","quick-capture","filetree","tags","search","periodic","para"],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"lifeOSLauncherOrder":{"key":"lifeOSLauncherOrder","description":"LifeOS 九宫格入口顺序;未记录的新入口追加在末尾。","group":"general","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"lifeOSLauncherHiddenItems":{"key":"lifeOSLauncherHiddenItems","description":"LifeOS 九宫格完全隐藏的入口,不出现在更多功能中。","group":"general","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"accountName":{"key":"accountName","description":"产品授权账户邮箱。","group":"general","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"accountActivationCode":{"key":"accountActivationCode","description":"产品激活凭据;由授权流程管理,不通过通用配置接口修改。","group":"general","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"pluginUpdateChannel":{"key":"pluginUpdateChannel","description":"LifeOS Pro 插件更新通道。","group":"general","schema":{"enum":["stable","beta"]},"defaultValue":"stable","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"periodicNotesPath":{"key":"periodicNotesPath","description":"周期笔记的根目录,相对于当前知识库;修改只改变后续路径解析,不搬迁已有笔记。","group":"periodic","schema":{"type":"string"},"defaultValue":"PeriodicNotes","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"usePeriodicAdvanced":{"key":"usePeriodicAdvanced","description":"启用周期笔记高级路径格式和模板设置。","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"inputsPath":{"key":"inputsPath","description":"输入笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"outputsPath":{"key":"outputsPath","description":"输出笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themesPath":{"key":"themesPath","description":"主题笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themesTemplateFilePath":{"key":"themesTemplateFilePath","description":"创建主题笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"capturesPath":{"key":"capturesPath","description":"捕获笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"capturesTemplateFilePath":{"key":"capturesTemplateFilePath","description":"创建捕获笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"expressesPath":{"key":"expressesPath","description":"表达笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"expressesTemplateFilePath":{"key":"expressesTemplateFilePath","description":"创建表达笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"projectsPath":{"key":"projectsPath","description":"项目笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"type":"string"},"defaultValue":"1. Projects","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"projectsTemplateFilePath":{"key":"projectsTemplateFilePath","description":"创建项目笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"areasPath":{"key":"areasPath","description":"领域笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"type":"string"},"defaultValue":"2. Areas","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"areasTemplateFilePath":{"key":"areasTemplateFilePath","description":"创建领域笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"resourcesPath":{"key":"resourcesPath","description":"资源笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"type":"string"},"defaultValue":"3. Resources","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"resourcesTemplateFilePath":{"key":"resourcesTemplateFilePath","description":"创建资源笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"archivesPath":{"key":"archivesPath","description":"归档笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"type":"string"},"defaultValue":"4. Archives","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"archivesTemplateFilePath":{"key":"archivesTemplateFilePath","description":"创建归档笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeListHeader":{"key":"themeListHeader","description":"主题列表标题:","group":"appearance","schema":{"type":"string"},"defaultValue":"Theme List","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"projectListHeader":{"key":"projectListHeader","description":"项目列表标题:","group":"general","schema":{"type":"string"},"defaultValue":"Project List","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"areaListHeader":{"key":"areaListHeader","description":"领域列表标题:","group":"general","schema":{"type":"string"},"defaultValue":"First Things Dimension","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"habitHeader":{"key":"habitHeader","description":"习惯打卡标题:","group":"periodic","schema":{"type":"string"},"defaultValue":"Habit","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordHeader":{"key":"dailyRecordHeader","description":"日常记录标题:","group":"periodic","schema":{"type":"string"},"defaultValue":"Daily Record","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordAPI":{"key":"dailyRecordAPI","description":"每日记录服务的 API 地址。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordToken":{"key":"dailyRecordToken","description":"每日记录服务访问凭据。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordWarning":{"key":"dailyRecordWarning","description":"每日记录流程的警告状态,由运行时维护。","group":"periodic","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordCreating":{"key":"dailyRecordCreating","description":"每日记录创建中状态,由运行时维护。","group":"periodic","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordTag":{"key":"dailyRecordTag","description":"记录标签:","group":"periodic","schema":{"type":"string"},"defaultValue":"daily-record","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useDailyRecord":{"key":"useDailyRecord","description":"日常记录同步","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"usePeriodicNotes":{"key":"usePeriodicNotes","description":"启用周期笔记功能。","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useHabitStats":{"key":"useHabitStats","description":"习惯统计","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"showDailyNoteTitle":{"key":"showDailyNoteTitle","description":"显示日记文件标题","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useThemeNotes":{"key":"useThemeNotes","description":"启用主题笔记组织模式。","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"usePARANotes":{"key":"usePARANotes","description":"启用 Projects、Areas、Resources、Archives 组织模式。","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"usePARAAdvanced":{"key":"usePARAAdvanced","description":"启用 PARA 高级配置。","group":"organization","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useThemeAdvanced":{"key":"useThemeAdvanced","description":"启用主题笔记高级配置。","group":"organization","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"paraIndexFilename":{"key":"paraIndexFilename","description":"PARA 文件夹的索引笔记命名方式。","group":"general","schema":{"enum":["readme","folderName"]},"defaultValue":"readme","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeIndexFilename":{"key":"themeIndexFilename","description":"主题文件夹的索引笔记命名方式。","group":"organization","schema":{"enum":["readme","folderName"]},"defaultValue":"readme","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"weekStart":{"key":"weekStart","description":"每周第一天:-1 跟随语言习惯,0 为周日,1 为周一,依次至 6 为周六。","group":"periodic","schema":{"type":"number","minimum":-1,"maximum":6},"defaultValue":-1,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useChineseCalendar":{"key":"useChineseCalendar","description":"中国农历:","group":"periodic","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useDailyRecordTimestamp":{"key":"useDailyRecordTimestamp","description":"时间戳前缀:","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useDailyRecordFocus":{"key":"useDailyRecordFocus","description":"日常记录光标聚焦:","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useThemeNoteReveal":{"key":"useThemeNoteReveal","description":"跳转索引","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useFileTreeReveal":{"key":"useFileTreeReveal","description":"文件位置自动展开:","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCompactNoteCreate":{"key":"useCompactNoteCreate","description":"紧凑模式","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"showWeekNumbersInDayView":{"key":"showWeekNumbersInDayView","description":"在日历日视图左侧显示周数列。","group":"periodic","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"hideNoteTypeToggle":{"key":"hideNoteTypeToggle","description":"隐藏笔记类型切换","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useThemeSearch":{"key":"useThemeSearch","description":"主题搜索","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"templateSyntaxMigrationNoticeDismissed":{"key":"templateSyntaxMigrationNoticeDismissed","description":"是否已关闭旧模板语法迁移提示。","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dismissedRecommendations":{"key":"dismissedRecommendations","description":"用户点击「不再推荐」后隐藏的产品推荐 id 列表","group":"general","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendar":{"key":"useCalendar","description":"显示 LifeOS 日历视图;本地任务数据服务仍可独立运行。","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendarSidebar":{"key":"useCalendarSidebar","description":"日历侧栏","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendarAllDay":{"key":"useCalendarAllDay","description":"显示为全天事件","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendarCollapse":{"key":"useCalendarCollapse","description":"收件箱折叠","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useLocalRecurringTask":{"key":"useLocalRecurringTask","description":"本地循环任务","group":"tasks","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendar24Hour":{"key":"useCalendar24Hour","description":"24小时制","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendarSimpleTaskDisplay":{"key":"useCalendarSimpleTaskDisplay","description":"简化任务显示","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calendarTimeGridHeight":{"key":"calendarTimeGridHeight","description":"时间格高度","group":"calendar","schema":{"enum":["compact","default","comfortable"]},"defaultValue":"default","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskStatuses":{"key":"taskStatuses","description":"任务状态","group":"tasks","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string"},"name":{"type":"string"},"type":{"enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"next":{"anyOf":[{"type":"string"}]},"color":{"anyOf":[{"type":"string"}]},"icon":{"anyOf":[{"type":"string"}]}},"required":["marker","name","type"],"additionalProperties":false}}]},"defaultValue":[{"marker":" ","name":"Todo","type":"TODO","next":"x"},{"marker":"x","name":"Done","type":"DONE","next":" "}],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"hideRemoteTasksInUnfinished":{"key":"hideRemoteTasksInUnfinished","description":"隐藏远程任务","group":"tasks","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDelayDays":{"key":"taskDelayDays","description":"任务推迟操作默认延后的天数。","group":"tasks","schema":{"type":"number","minimum":0,"maximum":3650},"defaultValue":7,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useICSCalendar":{"key":"useICSCalendar","description":"ICS 日历订阅","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"icsCalendarURL":{"key":"icsCalendarURL","description":"ICS 日历地址","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"customICSConfigs":{"key":"customICSConfigs","description":"自定义 ICS 订阅列表,含订阅地址、名称及启用状态;地址可能含访问凭据。","group":"calendar","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"hiddenRemoteCalendarUrls":{"key":"hiddenRemoteCalendarUrls","description":"在视图中隐藏的远程日历地址列表。","group":"calendar","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalDavCalendar":{"key":"useCalDavCalendar","description":"CalDAV 日历订阅","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVServerURL":{"key":"calDAVServerURL","description":"服务器地址","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVUsername":{"key":"calDAVUsername","description":"用户名","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVPassword":{"key":"calDAVPassword","description":"密码","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVSelectedCalendar":{"key":"calDAVSelectedCalendar","description":"基础 CalDAV 配置选择的日历","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVAvailableCalendars":{"key":"calDAVAvailableCalendars","description":"基础 CalDAV 配置的可用日历列表","group":"calendar","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"}]},"isReadOnly":{"enum":[false,true]}},"required":["id","name","url"],"additionalProperties":false}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"customCalDAVConfigs":{"key":"customCalDAVConfigs","description":"自定义 CalDAV 账户配置列表,包含服务器、用户名、密码及所选日历。","group":"calendar","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"serverURL":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"},"selectedCalendar":{"anyOf":[{"type":"string"}]},"availableCalendars":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"}]},"isReadOnly":{"enum":[false,true]}},"required":["id","name","url"],"additionalProperties":false}}]},"enabled":{"enum":[false,true]}},"required":["id","name","serverURL","username","password"],"additionalProperties":false}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useICloudCalendar":{"key":"useICloudCalendar","description":"iCloud 日历订阅","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudCalendarPushEnabled":{"key":"iCloudCalendarPushEnabled","description":"是否启用推送功能,false时仅拉取远程任务","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudDeleteCompletedTask":{"key":"iCloudDeleteCompletedTask","description":"是否删除已完成和已取消的任务,true时删除","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudServerURL":{"key":"iCloudServerURL","description":"iCloud CalDAV 服务地址。","group":"calendar","schema":{"type":"string"},"defaultValue":"caldav.icloud.com","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudUsername":{"key":"iCloudUsername","description":"iCloud 日历账户用户名。","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudPassword":{"key":"iCloudPassword","description":"iCloud 日历的应用专用密码。","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudSelectedCalendar":{"key":"iCloudSelectedCalendar","description":"用户选择的同步日历ID","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudAvailableCalendars":{"key":"iCloudAvailableCalendars","description":"可用的日历列表","group":"calendar","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"}]},"isReadOnly":{"enum":[false,true]}},"required":["id","name","url"],"additionalProperties":false}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudAllDayReminder":{"key":"iCloudAllDayReminder","description":"是否为全天事件添加提醒","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudAllDayReminderDays":{"key":"iCloudAllDayReminderDays","description":"提前天数,0表示当天","group":"calendar","schema":{"type":"number"},"defaultValue":0,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudAllDayReminderTime":{"key":"iCloudAllDayReminderTime","description":"提醒时间,格式 \'HH:mm\'","group":"calendar","schema":{"type":"string"},"defaultValue":"09:00","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudTimedReminder":{"key":"iCloudTimedReminder","description":"是否为有时间的任务添加提醒","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudTimedReminderValue":{"key":"iCloudTimedReminderValue","description":"提醒数值","group":"calendar","schema":{"type":"number"},"defaultValue":15,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudTimedReminderUnit":{"key":"iCloudTimedReminderUnit","description":"提醒单位","group":"calendar","schema":{"enum":["minutes","hours","days","weeks"]},"defaultValue":"minutes","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useGoogleCalendar":{"key":"useGoogleCalendar","description":"是否启用 Google Calendar","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleClientId":{"key":"googleClientId","description":"Google OAuth Client ID(用户自行提供)","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleClientSecret":{"key":"googleClientSecret","description":"Google OAuth Client Secret(用户自行提供)","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAccessToken":{"key":"googleCalendarAccessToken","description":"OAuth Access Token","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarRefreshToken":{"key":"googleCalendarRefreshToken","description":"OAuth Refresh Token(用于刷新 Access Token)","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarTokenExpiry":{"key":"googleCalendarTokenExpiry","description":"Token 过期时间戳","group":"calendar","schema":{"type":"number"},"defaultValue":0,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarSelectedCalendarId":{"key":"googleCalendarSelectedCalendarId","description":"用户选择的同步日历 ID","group":"calendar","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAvailableCalendars":{"key":"googleCalendarAvailableCalendars","description":"可用的日历列表","group":"calendar","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"}]},"isReadOnly":{"enum":[false,true]}},"required":["id","name","url"],"additionalProperties":false}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleOAuthState":{"key":"googleOAuthState","description":"OAuth state 参数(用于 CSRF 防护)","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarPushEnabled":{"key":"googleCalendarPushEnabled","description":"是否启用推送功能,false 时仅拉取远程任务","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarDeleteCompletedTask":{"key":"googleCalendarDeleteCompletedTask","description":"是否删除已完成和已取消的任务","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAllDayReminder":{"key":"googleCalendarAllDayReminder","description":"是否为全天事件添加提醒","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAllDayReminderDays":{"key":"googleCalendarAllDayReminderDays","description":"提前天数,0表示当天","group":"calendar","schema":{"type":"number"},"defaultValue":0,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAllDayReminderTime":{"key":"googleCalendarAllDayReminderTime","description":"提醒时间,格式 \'HH:mm\'","group":"calendar","schema":{"type":"string"},"defaultValue":"09:00","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarTimedReminder":{"key":"googleCalendarTimedReminder","description":"是否为有时间的任务添加提醒","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarTimedReminderValue":{"key":"googleCalendarTimedReminderValue","description":"提醒数值","group":"calendar","schema":{"type":"number"},"defaultValue":15,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarTimedReminderUnit":{"key":"googleCalendarTimedReminderUnit","description":"提醒单位","group":"calendar","schema":{"enum":["minutes","hours","days","weeks"]},"defaultValue":"minutes","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"defaultWriteCalendar":{"key":"defaultWriteCalendar","description":"任务同步时默认写入的日历:\'none\' | \'icloud\' | \'google\' | \'caldav-{configId}\'","group":"calendar","schema":{"type":"string"},"defaultValue":"none","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskFilterRules":{"key":"taskFilterRules","description":"任务筛选规则;用于控制查询和视图中纳入的任务。","group":"tasks","schema":{"type":"object","properties":{"headers":{"type":"array","items":{"type":"string"}},"paths":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contents":{"type":"array","items":{"type":"string"}},"mode":{"enum":["include","exclude"]}},"required":["headers","paths","tags","contents","mode"],"additionalProperties":false},"defaultValue":{"headers":[],"paths":[],"tags":[],"contents":[],"mode":"exclude"},"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskFilterDateRange":{"key":"taskFilterDateRange","description":"任务筛选的日期范围。","group":"tasks","schema":{"type":"object","properties":{"from":{"anyOf":[{"type":"string"}]},"to":{"anyOf":[{"type":"string"}]}},"required":[],"additionalProperties":false},"defaultValue":{},"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calendarNewTaskFile":{"key":"calendarNewTaskFile","description":"新建任务所在文件","group":"calendar","schema":{"type":"string"},"defaultValue":"Task.md","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiApiKey":{"key":"aiApiKey","description":"API Key","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiBaseURL":{"key":"aiBaseURL","description":"API Base URL","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiModel":{"key":"aiModel","description":"AI 模型","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiMaxConversationTurns":{"key":"aiMaxConversationTurns","description":"最大对话轮数","group":"ai","schema":{"type":"number"},"defaultValue":10,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiTemperature":{"key":"aiTemperature","description":"温度","group":"ai","schema":{"type":"number"},"defaultValue":0.7,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepAskFontSize":{"key":"deepAskFontSize","description":"DeepAsk 字体大小覆盖,0 表示跟随 Obsidian","group":"general","schema":{"type":"number"},"defaultValue":0,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiEnableSkills":{"key":"aiEnableSkills","description":"兼容旧设置:内置 agent skills 对普通 AI 模型始终启用","group":"ai","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiEnableMcpTools":{"key":"aiEnableMcpTools","description":"兼容旧设置:内置 MCP 工具对普通 AI 模型始终启用","group":"ai","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiEnableExternalSkills":{"key":"aiEnableExternalSkills","description":"普通 AI 模型是否可读取 / 调用外部 agent skills","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiEnableExternalMcpTools":{"key":"aiEnableExternalMcpTools","description":"普通 AI 模型是否可连接外部 MCP server(桌面端)","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiEnableObsidianInterfaceTools":{"key":"aiEnableObsidianInterfaceTools","description":"Obsidian 桌面实验性界面工具;默认关闭且每次操作仍需确认","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiAllowWriteTools":{"key":"aiAllowWriteTools","description":"是否允许普通 AI 模型调用写入 / 更新类工具","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiAllowDeleteTools":{"key":"aiAllowDeleteTools","description":"是否允许普通 AI 模型调用删除类工具","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiMaxToolIterations":{"key":"aiMaxToolIterations","description":"单次 AI 请求允许的最大工具调用迭代次数。","group":"ai","schema":{"type":"number","minimum":1,"maximum":100},"defaultValue":8,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiFilterPaths":{"key":"aiFilterPaths","description":"AI 知识检索的路径筛选配置。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiAdvancedForLifeOS":{"key":"aiAdvancedForLifeOS","description":"启用 LifeOS AI 高级检索配置。","group":"ai","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiThemeFileSearchType":{"key":"aiThemeFileSearchType","description":"AI 检索主题相关文件时的搜索范围模式。","group":"organization","schema":{"type":"string"},"defaultValue":"entire_folder","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiRecursiveSubThemeSearch":{"key":"aiRecursiveSubThemeSearch","description":"AI 检索是否递归包含子主题。","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiUseCurrentFileOnly":{"key":"aiUseCurrentFileOnly","description":"仅使用当前正在查看的文件","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useGPT":{"key":"useGPT","description":"是否启用 GPT AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gptBaseURL":{"key":"gptBaseURL","description":"OpenAI服务基础地址。","group":"ai","schema":{"type":"string"},"defaultValue":"https://api.openai.com/v1/","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gptApiKey":{"key":"gptApiKey","description":"OpenAI访问密钥。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gptModel":{"key":"gptModel","description":"OpenAI可选模型列表。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useDeepSeek":{"key":"useDeepSeek","description":"是否启用 DeepSeek AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekBaseURL":{"key":"deepseekBaseURL","description":"DeepSeek服务基础地址。","group":"ai","schema":{"type":"string"},"defaultValue":"https://api.deepseek.com/v1","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekAnthropicBaseURL":{"key":"deepseekAnthropicBaseURL","description":"DeepSeekAnthropic 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekOpenaiBaseURL":{"key":"deepseekOpenaiBaseURL","description":"DeepSeekOpenAI 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekApiKey":{"key":"deepseekApiKey","description":"DeepSeek访问密钥。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekModel":{"key":"deepseekModel","description":"DeepSeek可选模型列表。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useGemini":{"key":"useGemini","description":"是否启用 Gemini AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"geminiBaseURL":{"key":"geminiBaseURL","description":"Gemini服务基础地址。","group":"ai","schema":{"type":"string"},"defaultValue":"https://generativelanguage.googleapis.com/v1beta/openai/","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"geminiApiKey":{"key":"geminiApiKey","description":"Gemini访问密钥。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"geminiModel":{"key":"geminiModel","description":"Gemini可选模型列表。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useQwen":{"key":"useQwen","description":"是否启用 Qwen AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenBaseURL":{"key":"qwenBaseURL","description":"Qwen服务基础地址。","group":"ai","schema":{"type":"string"},"defaultValue":"https://dashscope.aliyuncs.com/compatible-mode/v1","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenAnthropicBaseURL":{"key":"qwenAnthropicBaseURL","description":"QwenAnthropic 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenOpenaiBaseURL":{"key":"qwenOpenaiBaseURL","description":"QwenOpenAI 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenApiKey":{"key":"qwenApiKey","description":"Qwen访问密钥。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenModel":{"key":"qwenModel","description":"Qwen可选模型列表。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useMinimax":{"key":"useMinimax","description":"是否启用 Minimax AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxBaseURL":{"key":"minimaxBaseURL","description":"MiniMax服务基础地址。","group":"ai","schema":{"type":"string"},"defaultValue":"https://api.minimaxi.com/v1","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxAnthropicBaseURL":{"key":"minimaxAnthropicBaseURL","description":"MiniMaxAnthropic 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxOpenaiBaseURL":{"key":"minimaxOpenaiBaseURL","description":"MiniMaxOpenAI 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxApiKey":{"key":"minimaxApiKey","description":"MiniMax访问密钥。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxModel":{"key":"minimaxModel","description":"MiniMax可选模型列表。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useZhipu":{"key":"useZhipu","description":"是否启用 Zhipu AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuBaseURL":{"key":"zhipuBaseURL","description":"智谱服务基础地址。","group":"ai","schema":{"type":"string"},"defaultValue":"https://open.bigmodel.cn/api/paas/v4","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuAnthropicBaseURL":{"key":"zhipuAnthropicBaseURL","description":"智谱Anthropic 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuOpenaiBaseURL":{"key":"zhipuOpenaiBaseURL","description":"智谱OpenAI 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuApiKey":{"key":"zhipuApiKey","description":"智谱访问密钥。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuModel":{"key":"zhipuModel","description":"智谱可选模型列表。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useOllama":{"key":"useOllama","description":"是否启用 Ollama AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"ollamaBaseURL":{"key":"ollamaBaseURL","description":"Ollama服务基础地址。","group":"ai","schema":{"type":"string"},"defaultValue":"http://localhost:11434/v1","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"ollamaApiKey":{"key":"ollamaApiKey","description":"Ollama访问密钥。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"ollamaModel":{"key":"ollamaModel","description":"Ollama可选模型列表。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useKimi":{"key":"useKimi","description":"是否启用 Kimi AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiBaseURL":{"key":"kimiBaseURL","description":"Kimi服务基础地址。","group":"ai","schema":{"type":"string"},"defaultValue":"https://api.moonshot.cn/v1","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiAnthropicBaseURL":{"key":"kimiAnthropicBaseURL","description":"KimiAnthropic 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiOpenaiBaseURL":{"key":"kimiOpenaiBaseURL","description":"KimiOpenAI 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiApiKey":{"key":"kimiApiKey","description":"Kimi访问密钥。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiModel":{"key":"kimiModel","description":"Kimi可选模型列表。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useClaude":{"key":"useClaude","description":"是否启用 Claude AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeBaseURL":{"key":"claudeBaseURL","description":"Claude服务基础地址。","group":"ai","schema":{"type":"string"},"defaultValue":"https://api.anthropic.com/v1","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeAnthropicBaseURL":{"key":"claudeAnthropicBaseURL","description":"ClaudeAnthropic 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeOpenaiBaseURL":{"key":"claudeOpenaiBaseURL","description":"ClaudeOpenAI 兼容协议服务地址。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeApiKey":{"key":"claudeApiKey","description":"Claude访问密钥。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeModel":{"key":"claudeModel","description":"Claude可选模型列表。","group":"ai","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useClaudeCode":{"key":"useClaudeCode","description":"启用本机 Claude Code 作为 AI 运行方式。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeCodeBinaryPath":{"key":"claudeCodeBinaryPath","description":"本机 Claude Code 可执行文件路径。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCodex":{"key":"useCodex","description":"启用本机 Codex 作为 AI 运行方式。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"codexBinaryPath":{"key":"codexBinaryPath","description":"本机 Codex 可执行文件路径。","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"customAIModels":{"key":"customAIModels","description":"自定义 AI 模型配置列表,包含服务端点、模型和访问凭据。","group":"ai","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"apiKey":{"type":"string"},"baseURL":{"type":"string"},"model":{"type":"array","items":{"type":"string"}},"sdkType":{"enum":["anthropic","openai"]}},"required":["id","name","apiKey","baseURL","model"],"additionalProperties":false}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useTaskDefaults":{"key":"useTaskDefaults","description":"启用任务默认值","group":"tasks","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultTags":{"key":"taskDefaultTags","description":"默认标签","group":"tasks","schema":{"type":"array","items":{"type":"string"}},"defaultValue":[],"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultPriority":{"key":"taskDefaultPriority","description":"默认优先级","group":"tasks","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultDueDate":{"key":"taskDefaultDueDate","description":"可以是 \'none\', \'today\', \'tomorrow\', \'day-after-tomorrow\', \'next-week\' 等","group":"tasks","schema":{"type":"string"},"defaultValue":"none","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultStartDate":{"key":"taskDefaultStartDate","description":"可以是 \'none\', \'today\', \'tomorrow\', \'day-after-tomorrow\', \'next-week\' 等","group":"tasks","schema":{"type":"string"},"defaultValue":"none","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultStartTime":{"key":"taskDefaultStartTime","description":"格式 \'HH:mm\' 或空字符串","group":"tasks","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultDuration":{"key":"taskDefaultDuration","description":"小时数","group":"tasks","schema":{"type":"number"},"defaultValue":0.5,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskFileTemplateFilePath":{"key":"taskFileTemplateFilePath","description":"任务关联文件模板路径","group":"tasks","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"chatExportFolder":{"key":"chatExportFolder","description":"聊天导出文件夹路径","group":"ai","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"promptsPath":{"key":"promptsPath","description":"Prompt 文件夹路径","group":"ai","schema":{"type":"string"},"defaultValue":"Prompts","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCustomSystemPrompt":{"key":"useCustomSystemPrompt","description":"是否使用自定义系统提示词","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"systemPromptContent":{"key":"systemPromptContent","description":"系统提示词内容","group":"general","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiPreserveSelectedText":{"key":"aiPreserveSelectedText","description":"是否保留选中的文件和标签文本格式","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiPreserveThoughts":{"key":"aiPreserveThoughts","description":"是否保留 AI 的思考过程","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useFilePropertiesTagMatching":{"key":"useFilePropertiesTagMatching","description":"是否包含文件properties中包含指定tags的bullets和tasks","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useThemeFolderSync":{"key":"useThemeFolderSync","description":"是否启用主题文件与文件夹名称同步","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"fourQuadrantFilters":{"key":"fourQuadrantFilters","description":"四象限视图的筛选配置","group":"general","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"overdueDays":{"anyOf":[{"type":"number"}]},"futureStartDays":{"anyOf":[{"type":"number"}]},"futureDays":{"anyOf":[{"type":"number"}]},"includeNoDate":{"enum":[false,true]},"includeAllOverdue":{"enum":[false,true]},"includeAllFuture":{"enum":[false,true]},"priorities":{"type":"array","items":{"type":"string"}},"taskSources":{"anyOf":[{"type":"array","items":{"enum":["local","icloud","ics","caldav","google"]}}]}},"required":["priorities"],"additionalProperties":false}}]},"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"fourQuadrantRules":{"key":"fourQuadrantRules","description":"四象限版本化归类规则","group":"general","schema":{"anyOf":[{"type":"object","properties":{"version":{"enum":[2]},"mode":{"enum":["time-priority","priority-only"]},"urgentFutureDays":{"type":"number"},"importantPriorities":{"type":"array","items":{"type":"string"}},"priorityQuadrants":{"type":"array","prefixItems":[{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"string"}}],"minItems":4,"maxItems":4},"preserveLegacyFilters":{"enum":[false,true]}},"required":["version","mode","urgentFutureDays","importantPriorities","priorityQuadrants","preserveLegacyFilters"],"additionalProperties":false}]},"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"quadrantDropConfigs":{"key":"quadrantDropConfigs","description":"四象限拖拽配置(优先级+日期)","group":"general","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"priorityEmoji":{"type":"string"},"daysOffset":{"anyOf":[{"type":"number"}]},"clearDate":{"enum":[false,true]}},"required":["priorityEmoji"],"additionalProperties":false}}]},"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"tableCellMaxLines":{"key":"tableCellMaxLines","description":"表格单元格最大显示行数,0表示不限制","group":"general","schema":{"type":"number"},"defaultValue":0,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"pomodoroDuration":{"key":"pomodoroDuration","description":"番茄时长(分钟)","group":"calendar","schema":{"type":"number"},"defaultValue":25,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"shortBreakDuration":{"key":"shortBreakDuration","description":"短休息时长(分钟)","group":"calendar","schema":{"type":"number"},"defaultValue":5,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"longBreakDuration":{"key":"longBreakDuration","description":"长休息时长(分钟)","group":"calendar","schema":{"type":"number"},"defaultValue":15,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"longBreakInterval":{"key":"longBreakInterval","description":"长休息间隔番茄数","group":"calendar","schema":{"type":"number"},"defaultValue":4,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"autoStartNextPomodoro":{"key":"autoStartNextPomodoro","description":"自动开始下个番茄","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"autoStartBreak":{"key":"autoStartBreak","description":"自动休息","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"autoFocusCount":{"key":"autoFocusCount","description":"自动番茄专注次数,0 表示无限","group":"general","schema":{"type":"number"},"defaultValue":0,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"continueAfterComplete":{"key":"continueAfterComplete","description":"倒计时结束后继续计时,直到手动停止","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"pomodoroSound":{"key":"pomodoroSound","description":"番茄提示音","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"pomodoroAutoRecord":{"key":"pomodoroAutoRecord","description":"是否自动记录到 Daily Note","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useTagColor":{"key":"useTagColor","description":"是否启用标签颜色区分","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"tagColors":{"key":"tagColors","description":"自定义标签颜色映射 { \\"#tag\\": \\"#color\\" }","group":"general","schema":{"type":"object","properties":{},"required":[],"additionalProperties":{"type":"string"}},"defaultValue":{},"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useHTTPServer":{"key":"useHTTPServer","description":"是否启用 HTTP Server(MCP 协议)","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"httpServerPort":{"key":"httpServerPort","description":"HTTP Server 端口号(默认 1479)","group":"general","schema":{"type":"number","minimum":1024,"maximum":65535},"defaultValue":1478,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"更新本机 HTTP/MCP 服务并等待重启完成。"},"enableDebugLog":{"key":"enableDebugLog","description":"是否启用调试日志(写入 .lifeos-debug.log 文件)","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"locale":{"key":"locale","description":"用户选择的语言,空字符串表示跟随 Obsidian 设置","group":"general","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"periodicNotesTemplateFilePathYearly":{"key":"periodicNotesTemplateFilePathYearly","description":"创建年记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesTemplateFilePathQuarterly":{"key":"periodicNotesTemplateFilePathQuarterly","description":"创建季记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesTemplateFilePathMonthly":{"key":"periodicNotesTemplateFilePathMonthly","description":"创建月记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesTemplateFilePathWeekly":{"key":"periodicNotesTemplateFilePathWeekly","description":"创建周记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesTemplateFilePathDaily":{"key":"periodicNotesTemplateFilePathDaily","description":"创建日记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatYearly":{"key":"periodicNotesPathFormatYearly","description":"年记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatQuarterly":{"key":"periodicNotesPathFormatQuarterly","description":"季记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatMonthly":{"key":"periodicNotesPathFormatMonthly","description":"月记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatWeekly":{"key":"periodicNotesPathFormatWeekly","description":"周记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatDaily":{"key":"periodicNotesPathFormatDaily","description":"日记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"type":"string"},"defaultValue":"","defaultSource":"apps/obsidian-plugin/src/settings/defaults.ts","source":"packages/type/src/main.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]}},"aino-desktop":{"settingsSchemaVersion":{"key":"settingsSchemaVersion","description":"知识库配置存储结构版本,由迁移流程管理。","group":"general","schema":{"anyOf":[{"type":"number"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useGPT":{"key":"useGPT","description":"是否启用 GPT AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gptApiKey":{"key":"gptApiKey","description":"OpenAI访问密钥。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gptBaseURL":{"key":"gptBaseURL","description":"OpenAI服务基础地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"https://api.openai.com/v1","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gptModel":{"key":"gptModel","description":"OpenAI可选模型列表。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":["gpt-4o-mini","gpt-4o"],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useGemini":{"key":"useGemini","description":"是否启用 Gemini AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"geminiApiKey":{"key":"geminiApiKey","description":"Gemini访问密钥。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"geminiBaseURL":{"key":"geminiBaseURL","description":"Gemini服务基础地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"https://generativelanguage.googleapis.com/v1beta/openai","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"geminiModel":{"key":"geminiModel","description":"Gemini可选模型列表。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":["gemini-2.5-flash"],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useClaude":{"key":"useClaude","description":"是否启用 Claude AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeApiKey":{"key":"claudeApiKey","description":"Claude访问密钥。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeBaseURL":{"key":"claudeBaseURL","description":"Claude服务基础地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"https://api.anthropic.com/v1/","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeAnthropicBaseURL":{"key":"claudeAnthropicBaseURL","description":"ClaudeAnthropic 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeOpenaiBaseURL":{"key":"claudeOpenaiBaseURL","description":"ClaudeOpenAI 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeModel":{"key":"claudeModel","description":"Claude可选模型列表。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":["claude-sonnet-4-20250514"],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useDeepSeek":{"key":"useDeepSeek","description":"是否启用 DeepSeek AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekApiKey":{"key":"deepseekApiKey","description":"DeepSeek访问密钥。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekBaseURL":{"key":"deepseekBaseURL","description":"DeepSeek服务基础地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"https://api.deepseek.com/v1","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekAnthropicBaseURL":{"key":"deepseekAnthropicBaseURL","description":"DeepSeekAnthropic 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekOpenaiBaseURL":{"key":"deepseekOpenaiBaseURL","description":"DeepSeekOpenAI 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepseekModel":{"key":"deepseekModel","description":"DeepSeek可选模型列表。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":["deepseek-chat"],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useQwen":{"key":"useQwen","description":"是否启用 Qwen AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenApiKey":{"key":"qwenApiKey","description":"Qwen访问密钥。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenBaseURL":{"key":"qwenBaseURL","description":"Qwen服务基础地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"https://dashscope.aliyuncs.com/compatible-mode/v1","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenAnthropicBaseURL":{"key":"qwenAnthropicBaseURL","description":"QwenAnthropic 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenOpenaiBaseURL":{"key":"qwenOpenaiBaseURL","description":"QwenOpenAI 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"qwenModel":{"key":"qwenModel","description":"Qwen可选模型列表。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":["qwen-plus"],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useOllama":{"key":"useOllama","description":"是否启用 Ollama AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"ollamaApiKey":{"key":"ollamaApiKey","description":"Ollama访问密钥。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"ollamaBaseURL":{"key":"ollamaBaseURL","description":"Ollama服务基础地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"http://localhost:11434/v1","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"ollamaModel":{"key":"ollamaModel","description":"Ollama可选模型列表。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":["llama3.2"],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useMinimax":{"key":"useMinimax","description":"是否启用 Minimax AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxApiKey":{"key":"minimaxApiKey","description":"MiniMax访问密钥。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxBaseURL":{"key":"minimaxBaseURL","description":"MiniMax服务基础地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"https://api.minimaxi.com/v1","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxAnthropicBaseURL":{"key":"minimaxAnthropicBaseURL","description":"MiniMaxAnthropic 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxOpenaiBaseURL":{"key":"minimaxOpenaiBaseURL","description":"MiniMaxOpenAI 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"minimaxModel":{"key":"minimaxModel","description":"MiniMax可选模型列表。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":["MiniMax-M2.7"],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useZhipu":{"key":"useZhipu","description":"是否启用 Zhipu AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuApiKey":{"key":"zhipuApiKey","description":"智谱访问密钥。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuBaseURL":{"key":"zhipuBaseURL","description":"智谱服务基础地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"https://open.bigmodel.cn/api/paas/v4","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuAnthropicBaseURL":{"key":"zhipuAnthropicBaseURL","description":"智谱Anthropic 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuOpenaiBaseURL":{"key":"zhipuOpenaiBaseURL","description":"智谱OpenAI 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"zhipuModel":{"key":"zhipuModel","description":"智谱可选模型列表。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":["glm-4-plus"],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useKimi":{"key":"useKimi","description":"是否启用 Kimi AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiApiKey":{"key":"kimiApiKey","description":"Kimi访问密钥。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiBaseURL":{"key":"kimiBaseURL","description":"Kimi服务基础地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"https://api.moonshot.cn/v1","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiAnthropicBaseURL":{"key":"kimiAnthropicBaseURL","description":"KimiAnthropic 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiOpenaiBaseURL":{"key":"kimiOpenaiBaseURL","description":"KimiOpenAI 兼容协议服务地址。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"kimiModel":{"key":"kimiModel","description":"Kimi可选模型列表。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":["moonshot-v1-auto"],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCustom":{"key":"useCustom","description":"启用自定义 AI 服务。","group":"ai","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"customApiKey":{"key":"customApiKey","description":"旧版自定义 AI 服务访问凭据。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"customBaseURL":{"key":"customBaseURL","description":"旧版自定义 AI 服务端点。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"customModel":{"key":"customModel","description":"自定义","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"customAIModels":{"key":"customAIModels","description":"自定义 AI 模型配置列表,包含服务端点、模型和访问凭据。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"apiKey":{"type":"string"},"baseURL":{"type":"string"},"model":{"type":"array","items":{"type":"string"}},"sdkType":{"enum":["anthropic","openai"]}},"required":["id","name","apiKey","baseURL","model"],"additionalProperties":false}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useClaudeCode":{"key":"useClaudeCode","description":"启用本机 Claude Code 作为 AI 运行方式。","group":"ai","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"claudeCodeBinaryPath":{"key":"claudeCodeBinaryPath","description":"本机 Claude Code 可执行文件路径。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCodex":{"key":"useCodex","description":"启用本机 Codex 作为 AI 运行方式。","group":"ai","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"codexBinaryPath":{"key":"codexBinaryPath","description":"本机 Codex 可执行文件路径。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"codexHomePath":{"key":"codexHomePath","description":"本机 Codex 配置目录。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"codexApprovalMode":{"key":"codexApprovalMode","description":"Codex 执行操作时采用的审批模式。","group":"ai","schema":{"enum":["untrusted","on-request","never"]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"enableVoiceConversation":{"key":"enableVoiceConversation","description":"启用当前库的语音对话入口;默认关闭。","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"enableExperimentalMail":{"key":"enableExperimentalMail","description":"Device-local opt-in for the experimental mail application.","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"voiceGlobalShortcut":{"key":"voiceGlobalShortcut","description":"此设备开始或结束语音对话的系统全局快捷键。","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"voiceProvider":{"key":"voiceProvider","description":"语音识别与朗读服务商:豆包或 Deepgram。","group":"general","schema":{"enum":["doubao","deepgram"]},"defaultValue":"doubao","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"doubaoVoiceApiKey":{"key":"doubaoVoiceApiKey","description":"用户自行配置的豆包语音 API Key,仅保存在此设备的密钥层。","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"deepgramVoiceApiKey":{"key":"deepgramVoiceApiKey","description":"用户自行配置的 Deepgram API Key,仅保存在此设备的密钥层。","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"doubaoVoiceSpeaker":{"key":"doubaoVoiceSpeaker","description":"豆包朗读音色的 speaker 标识。","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"zh_female_vv_uranus_bigtts","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"defaultVendor":{"key":"defaultVendor","description":"新 AI 对话默认使用的服务商。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"claude","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"defaultModel":{"key":"defaultModel","description":"新 AI 对话默认使用的模型标识。","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiMaxConversationTurns":{"key":"aiMaxConversationTurns","description":"最大对话轮数","group":"ai","schema":{"anyOf":[{"type":"number"}]},"defaultValue":10,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiEnableExternalSkills":{"key":"aiEnableExternalSkills","description":"普通 AI 模型是否可读取 / 调用外部 agent skills","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiEnableExternalMcpTools":{"key":"aiEnableExternalMcpTools","description":"普通 AI 模型是否可连接外部 MCP server(桌面端)","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiAllowWriteTools":{"key":"aiAllowWriteTools","description":"是否允许普通 AI 模型调用写入 / 更新类工具","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiAllowDeleteTools":{"key":"aiAllowDeleteTools","description":"是否允许普通 AI 模型调用删除类工具","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiAllowCommandTools":{"key":"aiAllowCommandTools","description":"是否允许 AI 使用命令执行工具。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiEnableExperimentalPageControl":{"key":"aiEnableExperimentalPageControl","description":"是否开放实验性 AI 页面操作能力。","group":"ai","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"enableCustomApps":{"key":"enableCustomApps","description":"是否启用 Aino AI 小程序功能。","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"enableSmartOrganize":{"key":"enableSmartOrganize","description":"是否启用智能整理功能。","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"enableIntelligentWorkbench":{"key":"enableIntelligentWorkbench","description":"是否启用智能工作台。","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"enableAIReview":{"key":"enableAIReview","description":"是否启用 AI 回顾功能。","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"chatExportFolder":{"key":"chatExportFolder","description":"聊天导出文件夹路径","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"promptsPath":{"key":"promptsPath","description":"Prompt 文件夹路径","group":"ai","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"Prompts","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendar":{"key":"useCalendar","description":"显示 LifeOS 日历视图;本地任务数据服务仍可独立运行。","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendarSidebar":{"key":"useCalendarSidebar","description":"日历侧栏","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendarAllDay":{"key":"useCalendarAllDay","description":"显示为全天事件","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendarCollapse":{"key":"useCalendarCollapse","description":"收件箱折叠","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendar24Hour":{"key":"useCalendar24Hour","description":"24小时制","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalendarSimpleTaskDisplay":{"key":"useCalendarSimpleTaskDisplay","description":"简化任务显示","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calendarTimeGridHeight":{"key":"calendarTimeGridHeight","description":"时间格高度","group":"calendar","schema":{"enum":["compact","default","comfortable"]},"defaultValue":"default","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskStatuses":{"key":"taskStatuses","description":"任务状态","group":"tasks","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"marker":{"type":"string"},"name":{"type":"string"},"type":{"enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"next":{"anyOf":[{"type":"string"}]},"color":{"anyOf":[{"type":"string"}]},"icon":{"anyOf":[{"type":"string"}]}},"required":["marker","name","type"],"additionalProperties":false}}]},"defaultValue":[{"marker":" ","name":"Todo","type":"TODO","next":"x"},{"marker":"x","name":"Done","type":"DONE","next":" "}],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"nextRecurringTaskOnNextLine":{"key":"nextRecurringTaskOnNextLine","description":"生成下一次循环任务时是否插入当前任务下一行。","group":"tasks","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"hideRemoteTasksInUnfinished":{"key":"hideRemoteTasksInUnfinished","description":"隐藏远程任务","group":"tasks","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDelayDays":{"key":"taskDelayDays","description":"任务推迟操作默认延后的天数。","group":"tasks","schema":{"anyOf":[{"type":"number"}],"minimum":0,"maximum":3650},"defaultValue":7,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"weekStart":{"key":"weekStart","description":"每周第一天:-1 跟随语言习惯,0 为周日,1 为周一,依次至 6 为周六。","group":"periodic","schema":{"anyOf":[{"type":"number"}],"minimum":-1,"maximum":6},"defaultValue":-1,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskFilterRules":{"key":"taskFilterRules","description":"任务筛选规则;用于控制查询和视图中纳入的任务。","group":"tasks","schema":{"anyOf":[{"type":"object","properties":{"headers":{"type":"array","items":{"type":"string"}},"paths":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contents":{"type":"array","items":{"type":"string"}},"mode":{"enum":["include","exclude"]}},"required":["headers","paths","tags","contents","mode"],"additionalProperties":false}]},"defaultValue":{"headers":[],"paths":[],"tags":[],"contents":[],"mode":"exclude"},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskFilterDateRange":{"key":"taskFilterDateRange","description":"任务筛选的日期范围。","group":"tasks","schema":{"anyOf":[{"type":"object","properties":{"from":{"anyOf":[{"type":"string"}]},"to":{"anyOf":[{"type":"string"}]}},"required":[],"additionalProperties":false}]},"defaultValue":{},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"fourQuadrantFilters":{"key":"fourQuadrantFilters","description":"四象限视图的筛选配置","group":"general","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"overdueDays":{"anyOf":[{"type":"number"}]},"futureStartDays":{"anyOf":[{"type":"number"}]},"futureDays":{"anyOf":[{"type":"number"}]},"includeNoDate":{"enum":[false,true]},"includeAllOverdue":{"enum":[false,true]},"includeAllFuture":{"enum":[false,true]},"priorities":{"type":"array","items":{"type":"string"}},"taskSources":{"anyOf":[{"type":"array","items":{"enum":["local","icloud","ics","caldav","google"]}}]}},"required":["priorities"],"additionalProperties":false}}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"fourQuadrantRules":{"key":"fourQuadrantRules","description":"四象限版本化归类规则","group":"general","schema":{"anyOf":[{"type":"object","properties":{"version":{"enum":[2]},"mode":{"enum":["time-priority","priority-only"]},"urgentFutureDays":{"type":"number"},"importantPriorities":{"type":"array","items":{"type":"string"}},"priorityQuadrants":{"type":"array","prefixItems":[{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"string"}}],"minItems":4,"maxItems":4},"preserveLegacyFilters":{"enum":[false,true]}},"required":["version","mode","urgentFutureDays","importantPriorities","priorityQuadrants","preserveLegacyFilters"],"additionalProperties":false}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"quadrantDropConfigs":{"key":"quadrantDropConfigs","description":"四象限拖拽配置(优先级+日期)","group":"general","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"priorityEmoji":{"type":"string"},"daysOffset":{"anyOf":[{"type":"number"}]},"clearDate":{"enum":[false,true]}},"required":["priorityEmoji"],"additionalProperties":false}}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useTagColor":{"key":"useTagColor","description":"是否启用标签颜色区分","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"tagColors":{"key":"tagColors","description":"自定义标签颜色映射 { \\"#tag\\": \\"#color\\" }","group":"general","schema":{"anyOf":[{"type":"object","properties":{},"required":[],"additionalProperties":{"type":"string"}}]},"defaultValue":{},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"pomodoroDuration":{"key":"pomodoroDuration","description":"番茄时长(分钟)","group":"calendar","schema":{"anyOf":[{"type":"number"}]},"defaultValue":25,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"shortBreakDuration":{"key":"shortBreakDuration","description":"短休息时长(分钟)","group":"calendar","schema":{"anyOf":[{"type":"number"}]},"defaultValue":5,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"longBreakDuration":{"key":"longBreakDuration","description":"长休息时长(分钟)","group":"calendar","schema":{"anyOf":[{"type":"number"}]},"defaultValue":15,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"longBreakInterval":{"key":"longBreakInterval","description":"长休息间隔番茄数","group":"calendar","schema":{"anyOf":[{"type":"number"}]},"defaultValue":4,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"autoStartNextPomodoro":{"key":"autoStartNextPomodoro","description":"自动开始下个番茄","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"autoStartBreak":{"key":"autoStartBreak","description":"自动休息","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"autoFocusCount":{"key":"autoFocusCount","description":"自动番茄专注次数,0 表示无限","group":"general","schema":{"anyOf":[{"type":"number"}]},"defaultValue":0,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"continueAfterComplete":{"key":"continueAfterComplete","description":"倒计时结束后继续计时,直到手动停止","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"pomodoroSound":{"key":"pomodoroSound","description":"番茄提示音","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"pomodoroAutoRecord":{"key":"pomodoroAutoRecord","description":"是否自动记录到 Daily Note","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useICSCalendar":{"key":"useICSCalendar","description":"ICS 日历订阅","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"icsCalendarURL":{"key":"icsCalendarURL","description":"ICS 日历地址","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"customICSConfigs":{"key":"customICSConfigs","description":"自定义 ICS 订阅列表,含订阅地址、名称及启用状态;地址可能含访问凭据。","group":"calendar","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"enabled":{"enum":[false,true]}},"required":["id","name","url"],"additionalProperties":false}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"hiddenRemoteCalendarUrls":{"key":"hiddenRemoteCalendarUrls","description":"在视图中隐藏的远程日历地址列表。","group":"calendar","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useCalDavCalendar":{"key":"useCalDavCalendar","description":"CalDAV 日历订阅","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVServerURL":{"key":"calDAVServerURL","description":"服务器地址","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVUsername":{"key":"calDAVUsername","description":"用户名","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVPassword":{"key":"calDAVPassword","description":"密码","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVSelectedCalendar":{"key":"calDAVSelectedCalendar","description":"基础 CalDAV 配置选择的日历","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"calDAVAvailableCalendars":{"key":"calDAVAvailableCalendars","description":"基础 CalDAV 配置的可用日历列表","group":"calendar","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"}]},"name":{"anyOf":[{"type":"string"}]},"url":{"type":"string"},"displayName":{"anyOf":[{"type":"string"}]},"description":{"anyOf":[{"type":"string"}]},"isReadOnly":{"enum":[false,true]},"ctag":{"anyOf":[{"type":"string"}]},"syncToken":{"anyOf":[{"type":"string"}]}},"required":["url"],"additionalProperties":false}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"customCalDAVConfigs":{"key":"customCalDAVConfigs","description":"自定义 CalDAV 账户配置列表,包含服务器、用户名、密码及所选日历。","group":"calendar","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"serverURL":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"},"selectedCalendar":{"anyOf":[{"type":"string"}]},"availableCalendars":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"}]},"name":{"anyOf":[{"type":"string"}]},"url":{"type":"string"},"displayName":{"anyOf":[{"type":"string"}]},"description":{"anyOf":[{"type":"string"}]},"isReadOnly":{"enum":[false,true]},"ctag":{"anyOf":[{"type":"string"}]},"syncToken":{"anyOf":[{"type":"string"}]}},"required":["url"],"additionalProperties":false}}]},"enabled":{"enum":[false,true]}},"required":["id","name","serverURL","username","password"],"additionalProperties":false}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useICloudCalendar":{"key":"useICloudCalendar","description":"iCloud 日历订阅","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudCalendarPushEnabled":{"key":"iCloudCalendarPushEnabled","description":"是否启用推送功能,false时仅拉取远程任务","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudDeleteCompletedTask":{"key":"iCloudDeleteCompletedTask","description":"是否删除已完成和已取消的任务,true时删除","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudServerURL":{"key":"iCloudServerURL","description":"iCloud CalDAV 服务地址。","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"caldav.icloud.com","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudUsername":{"key":"iCloudUsername","description":"iCloud 日历账户用户名。","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudPassword":{"key":"iCloudPassword","description":"iCloud 日历的应用专用密码。","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudSelectedCalendar":{"key":"iCloudSelectedCalendar","description":"用户选择的同步日历ID","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudAvailableCalendars":{"key":"iCloudAvailableCalendars","description":"可用的日历列表","group":"calendar","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"}]},"name":{"anyOf":[{"type":"string"}]},"url":{"type":"string"},"displayName":{"anyOf":[{"type":"string"}]},"description":{"anyOf":[{"type":"string"}]},"isReadOnly":{"enum":[false,true]},"ctag":{"anyOf":[{"type":"string"}]},"syncToken":{"anyOf":[{"type":"string"}]}},"required":["url"],"additionalProperties":false}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudAllDayReminder":{"key":"iCloudAllDayReminder","description":"是否为全天事件添加提醒","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudAllDayReminderDays":{"key":"iCloudAllDayReminderDays","description":"提前天数,0表示当天","group":"calendar","schema":{"anyOf":[{"type":"number"}]},"defaultValue":0,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudAllDayReminderTime":{"key":"iCloudAllDayReminderTime","description":"提醒时间,格式 \'HH:mm\'","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"09:00","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudTimedReminder":{"key":"iCloudTimedReminder","description":"是否为有时间的任务添加提醒","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudTimedReminderValue":{"key":"iCloudTimedReminderValue","description":"提醒数值","group":"calendar","schema":{"anyOf":[{"type":"number"}]},"defaultValue":15,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"iCloudTimedReminderUnit":{"key":"iCloudTimedReminderUnit","description":"提醒单位","group":"calendar","schema":{"enum":["minutes","hours","days","weeks"]},"defaultValue":"minutes","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useGoogleCalendar":{"key":"useGoogleCalendar","description":"是否启用 Google Calendar","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleClientId":{"key":"googleClientId","description":"Google OAuth Client ID(用户自行提供)","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleClientSecret":{"key":"googleClientSecret","description":"Google OAuth Client Secret(用户自行提供)","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAccessToken":{"key":"googleCalendarAccessToken","description":"OAuth Access Token","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarRefreshToken":{"key":"googleCalendarRefreshToken","description":"OAuth Refresh Token(用于刷新 Access Token)","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarTokenExpiry":{"key":"googleCalendarTokenExpiry","description":"Token 过期时间戳","group":"calendar","schema":{"anyOf":[{"type":"number"}]},"defaultValue":0,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarSelectedCalendarId":{"key":"googleCalendarSelectedCalendarId","description":"用户选择的同步日历 ID","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAvailableCalendars":{"key":"googleCalendarAvailableCalendars","description":"可用的日历列表","group":"calendar","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"}]},"name":{"anyOf":[{"type":"string"}]},"url":{"type":"string"},"displayName":{"anyOf":[{"type":"string"}]},"description":{"anyOf":[{"type":"string"}]},"isReadOnly":{"enum":[false,true]},"ctag":{"anyOf":[{"type":"string"}]},"syncToken":{"anyOf":[{"type":"string"}]}},"required":["url"],"additionalProperties":false}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarPushEnabled":{"key":"googleCalendarPushEnabled","description":"是否启用推送功能,false 时仅拉取远程任务","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarDeleteCompletedTask":{"key":"googleCalendarDeleteCompletedTask","description":"是否删除已完成和已取消的任务","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAllDayReminder":{"key":"googleCalendarAllDayReminder","description":"是否为全天事件添加提醒","group":"calendar","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAllDayReminderDays":{"key":"googleCalendarAllDayReminderDays","description":"提前天数,0表示当天","group":"calendar","schema":{"anyOf":[{"type":"number"}]},"defaultValue":0,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarAllDayReminderTime":{"key":"googleCalendarAllDayReminderTime","description":"提醒时间,格式 \'HH:mm\'","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"09:00","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarTimedReminder":{"key":"googleCalendarTimedReminder","description":"是否为有时间的任务添加提醒","group":"calendar","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarTimedReminderValue":{"key":"googleCalendarTimedReminderValue","description":"提醒数值","group":"calendar","schema":{"anyOf":[{"type":"number"}]},"defaultValue":15,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"googleCalendarTimedReminderUnit":{"key":"googleCalendarTimedReminderUnit","description":"提醒单位","group":"calendar","schema":{"enum":["minutes","hours","days","weeks"]},"defaultValue":"minutes","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"defaultWriteCalendar":{"key":"defaultWriteCalendar","description":"任务同步时默认写入的日历:\'none\' | \'icloud\' | \'google\' | \'caldav-{configId}\'","group":"calendar","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"none","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"usePeriodicNotes":{"key":"usePeriodicNotes","description":"启用周期笔记功能。","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"periodicNotesPath":{"key":"periodicNotesPath","description":"周期笔记的根目录,相对于当前知识库;修改只改变后续路径解析,不搬迁已有笔记。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"PeriodicNotes","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordHeader":{"key":"dailyRecordHeader","description":"日常记录标题:","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"Daily Record","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"showDailyNoteTitle":{"key":"showDailyNoteTitle","description":"显示日记文件标题","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useHabitStats":{"key":"useHabitStats","description":"习惯统计","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useDailyRecord":{"key":"useDailyRecord","description":"日常记录同步","group":"general","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordAPI":{"key":"dailyRecordAPI","description":"每日记录服务的 API 地址。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordToken":{"key":"dailyRecordToken","description":"每日记录服务访问凭据。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"secret","access":"secret","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordTag":{"key":"dailyRecordTag","description":"记录标签:","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordWarning":{"key":"dailyRecordWarning","description":"每日记录流程的警告状态,由运行时维护。","group":"periodic","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dailyRecordCreating":{"key":"dailyRecordCreating","description":"每日记录创建中状态,由运行时维护。","group":"periodic","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"habitHeader":{"key":"habitHeader","description":"习惯打卡标题:","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"Habit","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"projectListHeader":{"key":"projectListHeader","description":"项目列表标题:","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"Project List","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"areaListHeader":{"key":"areaListHeader","description":"领域列表标题:","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"First Things Dimension","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeListHeader":{"key":"themeListHeader","description":"主题列表标题:","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"Theme List","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useDailyRecordTimestamp":{"key":"useDailyRecordTimestamp","description":"时间戳前缀:","group":"general","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useChineseCalendar":{"key":"useChineseCalendar","description":"中国农历:","group":"periodic","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"usePeriodicAdvanced":{"key":"usePeriodicAdvanced","description":"启用周期笔记高级路径格式和模板设置。","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"periodicNotesTemplateFilePathDaily":{"key":"periodicNotesTemplateFilePathDaily","description":"创建日记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesTemplateFilePathWeekly":{"key":"periodicNotesTemplateFilePathWeekly","description":"创建周记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesTemplateFilePathMonthly":{"key":"periodicNotesTemplateFilePathMonthly","description":"创建月记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesTemplateFilePathQuarterly":{"key":"periodicNotesTemplateFilePathQuarterly","description":"创建季记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesTemplateFilePathYearly":{"key":"periodicNotesTemplateFilePathYearly","description":"创建年记时使用的模板文件路径,相对于知识库。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatDaily":{"key":"periodicNotesPathFormatDaily","description":"日记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatWeekly":{"key":"periodicNotesPathFormatWeekly","description":"周记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatMonthly":{"key":"periodicNotesPathFormatMonthly","description":"月记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatQuarterly":{"key":"periodicNotesPathFormatQuarterly","description":"季记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"periodicNotesPathFormatYearly":{"key":"periodicNotesPathFormatYearly","description":"年记的日期路径格式;空值使用宿主默认格式。修改不重命名已有笔记。","group":"periodic","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。","requires":["usePeriodicNotes"]},"useThemeNotes":{"key":"useThemeNotes","description":"启用主题笔记组织模式。","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useThemeNoteReveal":{"key":"useThemeNoteReveal","description":"跳转索引","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useThemeFolderSync":{"key":"useThemeFolderSync","description":"是否启用主题文件与文件夹名称同步","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"usePARANotes":{"key":"usePARANotes","description":"启用 Projects、Areas、Resources、Archives 组织模式。","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"capturesPath":{"key":"capturesPath","description":"捕获笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"projectsPath":{"key":"projectsPath","description":"项目笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"1. Projects","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"areasPath":{"key":"areasPath","description":"领域笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"2. Areas","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"resourcesPath":{"key":"resourcesPath","description":"资源笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"3. Resources","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"archivesPath":{"key":"archivesPath","description":"归档笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"4. Archives","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"expressesPath":{"key":"expressesPath","description":"表达笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"usePARAAdvanced":{"key":"usePARAAdvanced","description":"启用 PARA 高级配置。","group":"organization","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"paraIndexFilename":{"key":"paraIndexFilename","description":"PARA 文件夹的索引笔记命名方式。","group":"general","schema":{"enum":["readme","folderName"]},"defaultValue":"readme","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"capturesTemplateFilePath":{"key":"capturesTemplateFilePath","description":"创建捕获笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"projectsTemplateFilePath":{"key":"projectsTemplateFilePath","description":"创建项目笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"areasTemplateFilePath":{"key":"areasTemplateFilePath","description":"创建领域笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"resourcesTemplateFilePath":{"key":"resourcesTemplateFilePath","description":"创建资源笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"archivesTemplateFilePath":{"key":"archivesTemplateFilePath","description":"创建归档笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"expressesTemplateFilePath":{"key":"expressesTemplateFilePath","description":"创建表达笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"inputsPath":{"key":"inputsPath","description":"输入笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themesPath":{"key":"themesPath","description":"主题笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"outputsPath":{"key":"outputsPath","description":"输出笔记目录,相对于当前知识库;修改不会搬迁已有文件。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useThemeAdvanced":{"key":"useThemeAdvanced","description":"启用主题笔记高级配置。","group":"organization","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeIndexFilename":{"key":"themeIndexFilename","description":"主题文件夹的索引笔记命名方式。","group":"organization","schema":{"enum":["readme","folderName"]},"defaultValue":"readme","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themesTemplateFilePath":{"key":"themesTemplateFilePath","description":"创建主题笔记时使用的模板文件路径,相对于知识库。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useThemeSearch":{"key":"useThemeSearch","description":"主题搜索","group":"organization","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useFilePropertiesTagMatching":{"key":"useFilePropertiesTagMatching","description":"是否包含文件properties中包含指定tags的bullets和tasks","group":"general","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"tableCellMaxLines":{"key":"tableCellMaxLines","description":"表格单元格最大显示行数,0表示不限制","group":"general","schema":{"anyOf":[{"type":"number"}]},"defaultValue":4,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"draftsPath":{"key":"draftsPath","description":"闪念草稿的保存目录,相对于知识库。","group":"files","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"Drafts","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"clipperSaveFolder":{"key":"clipperSaveFolder","description":"网页剪藏默认保存目录,相对于知识库。","group":"files","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"Clips","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"clipperDefaultTags":{"key":"clipperDefaultTags","description":"网页剪藏默认添加的标签列表。","group":"files","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"clipperDefaultTemplateId":{"key":"clipperDefaultTemplateId","description":"网页剪藏默认模板标识。","group":"files","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"article","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"clipperTemplates":{"key":"clipperTemplates","description":"网页剪藏模板定义列表。","group":"files","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"aiPrompt":{"type":"string"},"content":{"type":"string"},"frontmatter":{"type":"array","items":{"enum":["domain","author","description","published"]}},"id":{"type":"string"},"name":{"type":"string"}},"required":["aiPrompt","content","frontmatter","id","name"],"additionalProperties":false}}]},"defaultValue":[{"id":"article","name":"Article","content":"{{#summary}}## AI 摘要\\n\\n{{summary}}\\n\\n{{/summary}}{{content}}","aiPrompt":"You summarize web pages for durable personal notes. Use the source language. Return Markdown only: first a concise 2-3 sentence overview, then 3-5 bullet points. Do not invent facts or repeat the title.","frontmatter":["domain","author","description","published"]},{"id":"digest","name":"Digest","content":"## 摘要\\n\\n{{summaryOrDescription}}\\n\\n## 原文\\n\\n{{content}}","aiPrompt":"Create a durable reading digest in the source language. Return Markdown only: a concise overview followed by 3-5 key insights. Preserve nuance, avoid invented facts, and do not repeat the title.","frontmatter":["domain","author","description","published"]},{"id":"bookmark","name":"Bookmark","content":"{{summaryOrDescription}}\\n\\n[打开原文]({{url}})","aiPrompt":"Summarize this bookmark in the source language. Return Markdown only: one concise paragraph and up to 3 short bullets explaining why it may be useful later.","frontmatter":["domain","author","description","published"]}],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"knowledgeExcludedFolders":{"key":"knowledgeExcludedFolders","description":"知识检索排除的目录列表。","group":"files","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"locale":{"key":"locale","description":"用户选择的语言,空字符串表示跟随 Obsidian 设置","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themePresetId":{"key":"themePresetId","description":"外观主题预设标识。","group":"appearance","schema":{"enum":["aino","ocean","forest","sunset","dawn","minimal","aino-dark","ocean-dark","forest-dark","ember-dark","midnight","minimal-dark"]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeLightPresetId":{"key":"themeLightPresetId","description":"浅色模式主题预设标识。","group":"appearance","schema":{"enum":["aino","ocean","forest","sunset","dawn","minimal"]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeDarkPresetId":{"key":"themeDarkPresetId","description":"深色模式主题预设标识。","group":"appearance","schema":{"enum":["aino-dark","ocean-dark","forest-dark","ember-dark","midnight","minimal-dark"]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeMode":{"key":"themeMode","description":"应用配色模式:跟随系统、浅色或深色。","group":"appearance","schema":{"enum":["system","light","dark"]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeAccentColor":{"key":"themeAccentColor","description":"主题主强调色。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeGradientEnabled":{"key":"themeGradientEnabled","description":"是否启用主题渐变色。","group":"appearance","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeAccentSecondaryColor":{"key":"themeAccentSecondaryColor","description":"主题第二强调色。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeAccentTertiaryColor":{"key":"themeAccentTertiaryColor","description":"主题第三强调色。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeBackgroundColor":{"key":"themeBackgroundColor","description":"应用背景色覆盖值。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeEditorBackgroundColor":{"key":"themeEditorBackgroundColor","description":"编辑器背景色覆盖值。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeMarkdownBoldColor":{"key":"themeMarkdownBoldColor","description":"Markdown 粗体文字颜色覆盖值。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeTokenOverrides":{"key":"themeTokenOverrides","description":"按浅色和深色模式分别覆盖主题色彩变量。","group":"appearance","schema":{"anyOf":[{"type":"object","properties":{"light":{"anyOf":[{"type":"object","properties":{},"required":[],"additionalProperties":{"type":"string"}}]},"dark":{"anyOf":[{"type":"object","properties":{},"required":[],"additionalProperties":{"type":"string"}}]}},"required":[],"additionalProperties":false}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeCustomName":{"key":"themeCustomName","description":"自定义主题名称。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"themeCustomAuthor":{"key":"themeCustomAuthor","description":"自定义主题作者。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"limitLineWidth":{"key":"limitLineWidth","description":"是否限制编辑区正文行宽。","group":"appearance","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"editorDensity":{"key":"editorDensity","description":"编辑器内容密度。","group":"appearance","schema":{"enum":["compact","default"]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"headingFoldingEnabled":{"key":"headingFoldingEnabled","description":"是否允许折叠标题下的内容。","group":"appearance","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"paragraphFoldingEnabled":{"key":"paragraphFoldingEnabled","description":"是否允许段落折叠。","group":"appearance","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"sidebarTranslucencyEnabled":{"key":"sidebarTranslucencyEnabled","description":"是否启用侧边栏半透明效果。","group":"appearance","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"appearanceFontFamily":{"key":"appearanceFontFamily","description":"应用使用的字体族。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"editorFontFamily":{"key":"editorFontFamily","description":"笔记编辑区独立字体;未设置时沿用现有字体。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"editorFontFileName":{"key":"editorFontFileName","description":"编辑区导入字体文件的名称。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"editorFontFileDataUrl":{"key":"editorFontFileDataUrl","description":"编辑区导入字体文件的内容。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"appearanceFontFileName":{"key":"appearanceFontFileName","description":"已导入字体文件的名称,由字体导入流程维护。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"appearanceFontFileDataUrl":{"key":"appearanceFontFileDataUrl","description":"已导入字体文件内容,由字体导入流程维护。","group":"appearance","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"appearanceFontSize":{"key":"appearanceFontSize","description":"应用基础字体大小。","group":"appearance","schema":{"anyOf":[{"type":"number"}],"minimum":8,"maximum":72},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"appearanceZoomPercent":{"key":"appearanceZoomPercent","description":"应用界面缩放百分比。","group":"appearance","schema":{"anyOf":[{"type":"number"}],"minimum":50,"maximum":200},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"pinnedItems":{"key":"pinnedItems","description":"置顶项目列表。","group":"appearance","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"icon":{"type":"string"},"type":{"enum":["note","url"]},"path":{"anyOf":[{"type":"string"}]},"url":{"anyOf":[{"type":"string"}]}},"required":["id","title","icon","type"],"additionalProperties":false}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"sidebarItems":{"key":"sidebarItems","description":"侧边栏项目配置和顺序。","group":"appearance","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"icon":{"type":"string"},"customIcon":{"anyOf":[{"type":"string"}]},"label":{"type":"string"},"type":{"enum":["view","tool","sidebar","custom-app","pinned-file","pinned-directory","pinned-note","pinned-url","read-later-note","read-later-url","stack","folder"]},"area":{"enum":["icons","pinned","read-later"]},"path":{"anyOf":[{"type":"string"}]},"url":{"anyOf":[{"type":"string"}]},"appId":{"anyOf":[{"type":"string"}]},"hidden":{"enum":[false,true]},"faviconUrl":{"anyOf":[{"type":"string"}]},"children":{"$ref":"#/$defs/type0"},"stackActiveId":{"anyOf":[{"type":"string"}]}},"required":["id","icon","label","type","area"],"additionalProperties":false}}],"$defs":{"type0":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"icon":{"type":"string"},"customIcon":{"anyOf":[{"type":"string"}]},"label":{"type":"string"},"type":{"enum":["view","tool","sidebar","custom-app","pinned-file","pinned-directory","pinned-note","pinned-url","read-later-note","read-later-url","stack","folder"]},"area":{"enum":["icons","pinned","read-later"]},"path":{"anyOf":[{"type":"string"}]},"url":{"anyOf":[{"type":"string"}]},"appId":{"anyOf":[{"type":"string"}]},"hidden":{"enum":[false,true]},"faviconUrl":{"anyOf":[{"type":"string"}]},"children":{"$ref":"#/$defs/type0"},"stackActiveId":{"anyOf":[{"type":"string"}]}},"required":["id","icon","label","type","area"],"additionalProperties":false}}]}}},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"sidebarItemsSchemaVersion":{"key":"sidebarItemsSchemaVersion","description":"侧边栏项目存储结构版本,由迁移流程维护。","group":"appearance","schema":{"anyOf":[{"type":"number"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"recentFiles":{"key":"recentFiles","description":"最近打开文件列表,由应用运行时维护。","group":"general","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"sidebarSectionOrder":{"key":"sidebarSectionOrder","description":"侧边栏分区显示顺序。","group":"appearance","schema":{"anyOf":[{"type":"array","items":{"enum":["read-later","favorite","folders","ai","drafts","recent"]}}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"sidebarSectionCollapsed":{"key":"sidebarSectionCollapsed","description":"侧边栏各分区的折叠状态。","group":"appearance","schema":{"anyOf":[{"type":"object","properties":{"favorite":{"enum":[false,true]},"ai":{"enum":[false,true]},"drafts":{"enum":[false,true]},"recent":{"enum":[false,true]},"folders":{"enum":[false,true]},"readLater":{"enum":[false,true]}},"required":[],"additionalProperties":false}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"accountName":{"key":"accountName","description":"产品授权账户邮箱。","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"accountActivationCode":{"key":"accountActivationCode","description":"产品激活凭据;由授权流程管理,不通过通用配置接口修改。","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiAdvancedForLifeOS":{"key":"aiAdvancedForLifeOS","description":"启用 LifeOS AI 高级检索配置。","group":"ai","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiThemeFileSearchType":{"key":"aiThemeFileSearchType","description":"AI 检索主题相关文件时的搜索范围模式。","group":"organization","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiRecursiveSubThemeSearch":{"key":"aiRecursiveSubThemeSearch","description":"AI 检索是否递归包含子主题。","group":"organization","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"aiFilterPaths":{"key":"aiFilterPaths","description":"AI 知识检索的路径筛选配置。","group":"ai","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"openLinksInApp":{"key":"openLinksInApp","description":"是否在 Aino 内置浏览器中打开网页链接。","group":"general","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"autoDownloadUpdates":{"key":"autoDownloadUpdates","description":"是否自动下载应用更新。","group":"general","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"updateChannel":{"key":"updateChannel","description":"Aino Desktop 应用更新通道。","group":"general","schema":{"enum":["stable","beta"]},"defaultValue":"stable","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"dismissedRecommendations":{"key":"dismissedRecommendations","description":"用户点击「不再推荐」后隐藏的产品推荐 id 列表","group":"general","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"enableHTTPServer":{"key":"enableHTTPServer","description":"是否开放本机 HTTP 服务中的 MCP 端点;本机基础服务独立运行。","group":"general","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"更新本机 HTTP/MCP 服务并等待重启完成。"},"httpServerPort":{"key":"httpServerPort","description":"HTTP Server 端口号(默认 1479)","group":"general","schema":{"anyOf":[{"type":"number"}],"minimum":1024,"maximum":65535},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"更新本机 HTTP/MCP 服务并等待重启完成。"},"enableDebugLog":{"key":"enableDebugLog","description":"是否启用调试日志(写入 .lifeos-debug.log 文件)","group":"general","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"syncMode":{"key":"syncMode","description":"知识库同步模式。","group":"sync","schema":{"enum":["none","webdav"]},"defaultValue":"none","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"syncVaultId":{"key":"syncVaultId","description":"知识库同步身份标识,由同步服务维护。","group":"sync","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"syncProviderPreset":{"key":"syncProviderPreset","description":"同步存储服务商预设。","group":"sync","schema":{"enum":["nextcloud","jianguoyun","koofr","infinicloud","custom","aliyun-oss","cloudflare-r2","tencent-cos","cstcloud","minio","custom-s3"]},"defaultValue":"nextcloud","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"syncConflictPolicy":{"key":"syncConflictPolicy","description":"同步遇到冲突时采用的处理策略。","group":"sync","schema":{"enum":["auto-merge","manual-copy","latest-timestamp"]},"defaultValue":"auto-merge","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"syncAutoOnLaunch":{"key":"syncAutoOnLaunch","description":"启动应用时是否自动同步。","group":"sync","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"syncAutoOnForeground":{"key":"syncAutoOnForeground","description":"应用回到前台时是否自动同步。","group":"sync","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"syncAutoWhileActive":{"key":"syncAutoWhileActive","description":"使用应用期间是否定时自动同步。","group":"sync","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"syncActiveIntervalMinutes":{"key":"syncActiveIntervalMinutes","description":"应用活跃期间自动同步间隔,单位为分钟。","group":"sync","schema":{"anyOf":[{"type":"number"}],"minimum":1,"maximum":1440},"defaultValue":5,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"enableGitBackup":{"key":"enableGitBackup","description":"是否启用本机 Git 备份。","group":"sync","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gitBackupScheduleMode":{"key":"gitBackupScheduleMode","description":"Git 备份调度模式。","group":"sync","schema":{"enum":["custom","manual","hourly","daily"]},"defaultValue":"manual","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gitBackupCustomIntervalValue":{"key":"gitBackupCustomIntervalValue","description":"Git 备份自定义间隔数值,与间隔单位共同使用。","group":"sync","schema":{"anyOf":[{"type":"number"}]},"defaultValue":2,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gitBackupCustomIntervalUnit":{"key":"gitBackupCustomIntervalUnit","description":"Git 备份自定义间隔单位。","group":"sync","schema":{"enum":["minutes","hours"]},"defaultValue":"hours","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gitBackupDailyTime":{"key":"gitBackupDailyTime","description":"每日 Git 备份执行时间,格式为 HH:mm。","group":"sync","schema":{"anyOf":[{"type":"string"}],"pattern":"^([01]\\\\d|2[0-3]):[0-5]\\\\d$"},"defaultValue":"20:00","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gitBackupCatchUpOnLaunch":{"key":"gitBackupCatchUpOnLaunch","description":"启动时是否补执行错过的 Git 备份。","group":"sync","schema":{"enum":[false,true]},"defaultValue":true,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"gitBackupSystemNotifications":{"key":"gitBackupSystemNotifications","description":"是否显示 Git 备份系统通知。","group":"sync","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"startupOpenMode":{"key":"startupOpenMode","description":"启动时打开内容的模式。","group":"general","schema":{"enum":["daily","restore"]},"defaultValue":"restore","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"newNoteLocation":{"key":"newNoteLocation","description":"新建笔记的默认位置策略。","group":"files","schema":{"enum":["drafts","root","specified","current"]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"newNoteCustomFolder":{"key":"newNoteCustomFolder","description":"新建笔记使用自定义位置时的目标文件夹。","group":"files","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"useTaskDefaults":{"key":"useTaskDefaults","description":"启用任务默认值","group":"tasks","schema":{"enum":[false,true]},"defaultValue":false,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultTags":{"key":"taskDefaultTags","description":"默认标签","group":"tasks","schema":{"anyOf":[{"type":"array","items":{"type":"string"}}]},"defaultValue":[],"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultPriority":{"key":"taskDefaultPriority","description":"默认优先级","group":"tasks","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultDueDate":{"key":"taskDefaultDueDate","description":"可以是 \'none\', \'today\', \'tomorrow\', \'day-after-tomorrow\', \'next-week\' 等","group":"tasks","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"none","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultStartDate":{"key":"taskDefaultStartDate","description":"可以是 \'none\', \'today\', \'tomorrow\', \'day-after-tomorrow\', \'next-week\' 等","group":"tasks","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"none","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultStartTime":{"key":"taskDefaultStartTime","description":"格式 \'HH:mm\' 或空字符串","group":"tasks","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"taskDefaultDuration":{"key":"taskDefaultDuration","description":"小时数","group":"tasks","schema":{"anyOf":[{"type":"number"}]},"defaultValue":0.5,"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"attachmentLocation":{"key":"attachmentLocation","description":"附件默认保存位置策略。","group":"files","schema":{"enum":["root","specified","current","subfolder"]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"attachmentSubfolderName":{"key":"attachmentSubfolderName","description":"相对当前笔记保存附件时的子文件夹名称。","group":"files","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"attachmentSpecifiedFolder":{"key":"attachmentSpecifiedFolder","description":"附件采用指定目录策略时的保存文件夹。","group":"files","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"shortcuts":{"key":"shortcuts","description":"应用快捷键配置。","group":"general","schema":{"anyOf":[{"type":"object","properties":{},"required":[],"additionalProperties":false}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"vault","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"searchEngines":{"key":"searchEngines","description":"浏览器搜索引擎配置列表。","group":"general","schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyword":{"anyOf":[{"type":"string"}]},"type":{"enum":["url","ai-chat"]},"urlTemplate":{"anyOf":[{"type":"string"}]},"enabled":{"enum":[false,true]}},"required":["id","name","type","enabled"],"additionalProperties":false}}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"browserHomeUrl":{"key":"browserHomeUrl","description":"内置浏览器首页地址。","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultValue":"https://www.google.com","defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"lastOpenedFolder":{"key":"lastOpenedFolder","description":"最近打开的知识库,由知识库切换流程管理。","group":"general","schema":{"anyOf":[{"type":"string"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"bootstrap","access":"internal","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"rightSidebarMode":{"key":"rightSidebarMode","description":"右侧栏当前显示模式。","group":"appearance","schema":{"enum":["context","chat","tasks"]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"leftSidebarCollapsed":{"key":"leftSidebarCollapsed","description":"左侧栏是否折叠。","group":"appearance","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"rightSidebarCollapsed":{"key":"rightSidebarCollapsed","description":"右侧栏是否折叠。","group":"appearance","schema":{"enum":[false,true]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"sidebarWidth":{"key":"sidebarWidth","description":"左侧栏宽度。","group":"appearance","schema":{"anyOf":[{"type":"number"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"},"contextPanelWidth":{"key":"contextPanelWidth","description":"右侧上下文面板宽度。","group":"appearance","schema":{"anyOf":[{"type":"number"}]},"defaultSource":"apps/aino-desktop/src/main/settingsDefaults.ts","source":"apps/aino-desktop/src/shared/contextSettings.d.ts","layer":"device","access":"write","effect":"由宿主更新配置并刷新相关界面与服务;未运行时下次启动生效。"}}}}');mD.fingerprint,mD.targets,mD.version;const gD={ProjectListByTime:{itemKind:"theme",block:!0,dateContext:"periodic"},AreaListByTime:{itemKind:"theme",block:!0,dateContext:"periodic"},ThemeListByTime:{itemKind:"theme",block:!0,dateContext:"periodic"},ThemeListByTag:{itemKind:"theme",block:!0,dateContext:"none"},ThemeListByFolder:{itemKind:"theme",block:!0,dateContext:"none"},ProjectListByTag:{itemKind:"filePath",block:!0,dateContext:"none"},AreaListByTag:{itemKind:"filePath",block:!0,dateContext:"none"},ResourceListByTag:{itemKind:"filePath",block:!0,dateContext:"none"},ArchiveListByTag:{itemKind:"filePath",block:!0,dateContext:"none"},ProjectListByFolder:{itemKind:"filePath",block:!0,dateContext:"none"},AreaListByFolder:{itemKind:"filePath",block:!0,dateContext:"none"},ResourceListByFolder:{itemKind:"filePath",block:!0,dateContext:"none"},ArchiveListByFolder:{itemKind:"filePath",block:!0,dateContext:"none"},FileListByTag:{itemKind:"file",block:!0,dateContext:"none"},TaskListByTag:{itemKind:"task",block:!0,dateContext:"none"},BulletListByTag:{itemKind:"bullet",block:!0,dateContext:"none"},TaskDueListByTime:{itemKind:"task",block:!0,dateContext:"periodic"},TaskDoneListByTime:{itemKind:"task",block:!0,dateContext:"periodic"},TaskRecordListByTime:{itemKind:"task",block:!0,dateContext:"periodic"},BulletRecordListByTime:{itemKind:"bullet",block:!0,dateContext:"periodic"},CaptureRecordListByTime:{itemKind:"record",block:!1,dateContext:"periodic"},HabitTasksByDate:{itemKind:"habitGroup",block:!1,dateContext:"periodic"},HabitStatsByDate:{itemKind:"habitStats",block:!1,dateContext:"periodic"},AllTasks:{itemKind:"task",block:!1,dateContext:"none"},Tasks:{itemKind:"task",block:!1,dateContext:"none"},AllBullets:{itemKind:"bullet",block:!1,dateContext:"none"},Tags:{itemKind:"tagSummary",block:!1,dateContext:"none"},Files:{itemKind:"fileSummary",block:!1,dateContext:"none"},TaskFacets:{itemKind:"taskFacets",block:!1,dateContext:"none"},TaskBlockIds:{itemKind:"taskBlockId",block:!1,dateContext:"none"},TaskDateGroupCounts:{itemKind:"taskDateGroupCount",block:!1,dateContext:"none"},TaskPageGroupCounts:{itemKind:"taskPageGroupCount",block:!1,dateContext:"none"}};Object.keys(gD).filter(e=>gD[e].block);const yD={"zh-cn":{ProjectListByTime:"项目",TaskDueListByTime:"待办",TaskDoneListByTime:"已完成",TaskRecordListByTime:"任务记录",BulletRecordListByTime:"闪念",ThemeListByTime:"主题",AreaListByTime:"领域",FileListByTag:"文件",TaskListByTag:"任务",BulletListByTag:"闪念",ThemeListByTag:"主题",ProjectListByTag:"项目",AreaListByTag:"领域",ResourceListByTag:"资源",ArchiveListByTag:"归档",ThemeListByFolder:"主题",ProjectListByFolder:"项目",AreaListByFolder:"领域",ResourceListByFolder:"资源",ArchiveListByFolder:"归档"},"zh-tw":{ProjectListByTime:"專案",TaskDueListByTime:"待辦",TaskDoneListByTime:"已完成",TaskRecordListByTime:"任務記錄",BulletRecordListByTime:"閃念",ThemeListByTime:"主題",AreaListByTime:"領域",FileListByTag:"檔案",TaskListByTag:"任務",BulletListByTag:"閃念",ThemeListByTag:"主題",ProjectListByTag:"專案",AreaListByTag:"領域",ResourceListByTag:"資源",ArchiveListByTag:"歸檔",ThemeListByFolder:"主題",ProjectListByFolder:"專案",AreaListByFolder:"領域",ResourceListByFolder:"資源",ArchiveListByFolder:"歸檔"},en:{ProjectListByTime:"Projects",TaskDueListByTime:"Due Tasks",TaskDoneListByTime:"Done Tasks",TaskRecordListByTime:"Task Log",BulletRecordListByTime:"Notes",ThemeListByTime:"Themes",AreaListByTime:"Areas",FileListByTag:"Files",TaskListByTag:"Tasks",BulletListByTag:"Notes",ThemeListByTag:"Themes",ProjectListByTag:"Projects",AreaListByTag:"Areas",ResourceListByTag:"Resources",ArchiveListByTag:"Archives",ThemeListByFolder:"Themes",ProjectListByFolder:"Projects",AreaListByFolder:"Areas",ResourceListByFolder:"Resources",ArchiveListByFolder:"Archives"}};function kD(e,t="en"){const n=t.toLowerCase();return yD["zh-cn"===n||"zh-tw"===n?n:"en"][e]}function wD(e){const t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return[];const n=t[1],s=n.match(/tags:\s*\[(.*?)\]/);if(s)return s[1].split(",").map(e=>e.trim().replace(/['"]/g,"").replace(/^#/,"")).filter(Boolean);const r=n.match(/tags:\s*\n((?:\s*-\s*.+\n?)+)/);if(r)return r[1].split("\n").filter(e=>e.trim().startsWith("-")).map(e=>e.replace(/^\s*-\s*/,"").trim().replace(/^['"]|['"]$/g,"").replace(/^#/,"")).filter(Boolean);const i=n.match(/tags:\s*(.+)/);return i?[i[1].trim().replace(/['"]/g,"").replace(/^#/,"")].filter(Boolean):[]}function bD({content:e,fileName:t,context:n,read:s}){const[r,i]=N.useState(),[a,o]=N.useState(!1),[l,c]=N.useState(1),[u,d]=N.useState(0),[p,f]=N.useState(),h=function(e){if(!e)return null;const t=e.split("\n").map(e=>e.trim()).find(Boolean);return t&&function(e){return function(e){return"string"==typeof e&&Object.hasOwn(gD,e)}(e)&&gD[e].block}(t)?t:null}(e),m=E(I().language),g=F();return N.useEffect(()=>{let e=!0;return(async()=>{if(!h||!n.cwd||!n.client?.isConnected)throw new Error("Query unavailable");const r=t?await s(t):null;await n.client.request({action:"vault.lifeos.ensureIndex",cwd:n.cwd,id:crypto.randomUUID()});const a=await n.client.request({action:"vault.lifeos.query",cwd:n.cwd,id:crypto.randomUUID(),params:{viewMode:h,currentFilePath:t,tags:wD(r?.content??""),page:l,pageSize:20}});e&&(i(a),o(!1))})().catch(()=>{e&&o(!0)}),()=>{e=!1}},[e,t,n.client,n.cwd,l,u]),R.jsxs("section",{className:"remote-lifeos-block","data-lifeos-block":"true",children:[R.jsxs("header",{children:[h?kD(h,"zh"===m?"zh-cn":m):"LifeOS"," ",r&&`(${r.totalCount})`]}),a?R.jsx("p",{role:"alert",children:g.unavailable}):r?R.jsxs(R.Fragment,{children:[R.jsx("table",{children:R.jsx("tbody",{children:r.items.map((e,t)=>{const s="string"==typeof e?e:e.file??e.path??"";return R.jsxs("tr",{children:[R.jsxs("td",{children:["string"!=typeof e&&"boolean"==typeof e.checked&&R.jsx("input",{type:"checkbox",checked:e.checked,disabled:p===`${e.file}:${e.line}`,onChange:()=>{(async e=>{if(n.client&&n.cwd&&e.file&&void 0!==e.line){f(`${e.file}:${e.line}`);try{await n.client.request({action:"vault.lifeos.toggleTask",cwd:n.cwd,id:crypto.randomUUID(),file:e.file,line:e.line,checked:!e.checked}),d(e=>e+1)}catch{o(!0)}finally{f(void 0)}}})(e)},"aria-label":e.text}),R.jsx("button",{type:"button",onClick:()=>n.onOpenFile(s,n.cwd),children:"string"==typeof e?e:e.text??e.name??s})]}),R.jsx("td",{children:"string"!=typeof e&&e.tags?.join(" ")})]},`${s}:${t}`)})})}),r.totalPages>1&&R.jsxs("nav",{children:[R.jsx("button",{type:"button",disabled:l<=1,onClick:()=>c(l-1),children:"←"}),R.jsxs("span",{children:[l," / ",r.totalPages]}),R.jsx("button",{type:"button",disabled:l>=r.totalPages,onClick:()=>c(l+1),children:"→"})]})]}):R.jsx("p",{children:g.loading})]})}export{Dc as $,Nn as A,hv as B,Ic as C,Po as D,Ac as E,Ve as F,vc as G,Sc as H,Nc as I,Js as J,Sr as K,js as L,$r as M,Bn as N,Cb as O,Qn as P,Br as Q,sn as R,_e as S,$n as T,Rr as U,Wb as V,Ry as W,Ly as X,Ls as Y,We as Z,qb as _,Cc as a,KC as a$,yb as a0,mb as a1,Al as a2,pc as a3,Zl as a4,Vr as a5,Mt as a6,Lr as a7,Ey as a8,Tc as a9,Nb as aA,$b as aB,Nv as aC,ev as aD,Ev as aE,rv as aF,cv as aG,Iv as aH,ib as aI,Ov as aJ,rb as aK,Xw as aL,Zw as aM,ub as aN,cb as aO,Dv as aP,Gv as aQ,Jv as aR,nS as aS,bD as aT,cu as aU,fu as aV,yw as aW,jy as aX,Hy as aY,Sb as aZ,xl as a_,zn as aa,ys as ab,Tl as ac,Jl as ad,kl as ae,uc as af,us as ag,kc as ah,Lc as ai,wc as aj,fc as ak,ec as al,Hv as am,fs as an,ew as ao,xr as ap,Zs as aq,zr as ar,ps as as,il as at,Jn as au,Kr as av,Ot as aw,gl as ax,Mv as ay,Av as az,bc as b,aT as b$,HC as b0,JC as b1,YC as b2,qC as b3,Kw as b4,iS as b5,aS as b6,oS as b7,$S as b8,uS as b9,Qy as bA,Su as bB,Kc as bC,_c as bD,Fc as bE,zc as bF,qy as bG,ku as bH,OO as bI,hT as bJ,DO as bK,yT as bL,uO as bM,UT as bN,mO as bO,RO as bP,EO as bQ,PO as bR,oT as bS,cT as bT,uT as bU,dO as bV,GT as bW,wT as bX,pO as bY,QT as bZ,dT as b_,FS as ba,rT as bb,WC as bc,Pc as bd,rd as be,tw as bf,qu as bg,lu as bh,uu as bi,Sh as bj,pu as bk,kg as bl,bg as bm,yg as bn,xh as bo,ou as bp,du as bq,wg as br,vS as bs,wS as bt,bS as bu,lh as bv,ch as bw,su as bx,Yu as by,Gy as bz,Qu as c,RT as c0,PT as c1,$T as c2,WT as c3,KT as c4,kT as c5,VT as c6,bO as c7,HT as c8,gT as c9,_d as cA,Ud as cB,Wd as cC,uh as cD,qT as ca,FT as cb,BT as cc,mT as cd,zO as ce,WO as cf,jO as cg,BO as ch,VO as ci,hD as cj,aD as ck,FO as cl,fO as cm,fT as cn,oD as co,$O as cp,pT as cq,CT as cr,OT as cs,HS as ct,YS as cu,US as cv,KS as cw,iw as cx,$d as cy,Fu as cz,vd as d,es as e,Pl as f,Io as g,Bt as h,IC as i,NC as j,DC as k,Ir as l,Pr as m,fl as n,MC as o,ql as p,kr as q,Fr as r,AC as s,Rc as t,Mc as u,Oc as v,ls as w,qr as x,In as y,Rn as z};
|