vibelet 1.2.248 → 1.2.249
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/remoteDirect/manifest.json +12 -12
- package/dist/runtime-version.cjs +1 -1
- package/dist/web/assets/App-CqANyaMK.css +97 -0
- package/dist/web/assets/App-gwVbOIB1.js +2 -0
- package/dist/web/assets/BrowserControlPanel-ChZyiZg8.js +1 -0
- package/dist/web/assets/{ChatPane-CzxrCqL_.css → ChatPane-CWKGXZWT.css} +1 -1
- package/dist/web/assets/ChatPane-fH0IY48w.js +1 -0
- package/dist/web/assets/{ChipGroup-7CAhvUt1.js → ChipGroup-0exv9rzn.js} +1 -1
- package/dist/web/assets/ComposerMenus-DhMX49q9.js +1 -0
- package/dist/web/assets/DiffDrawer-D4eELjEe.js +1 -0
- package/dist/web/assets/FilesControlPanel-Bz4i0bf2.js +1 -0
- package/dist/web/assets/FilesControlPanel-JMh8U1IC.css +1 -0
- package/dist/web/assets/{GlobalPendingDialog--lYE48cR.js → GlobalPendingDialog-tews3DVC.js} +1 -1
- package/dist/web/assets/ImageViewer-BojwpCb-.js +1 -0
- package/dist/web/assets/{LanguageSettingsPanel-EPESHevZ.js → LanguageSettingsPanel-C1ZHQpVG.js} +1 -1
- package/dist/web/assets/{MarkdownModePanel-CGJDuUhg.js → MarkdownModePanel-B4iVncFO.js} +1 -1
- package/dist/web/assets/NewSessionDialog-CsOHExrY.js +1 -0
- package/dist/web/assets/{NotificationSettingsPanel-CYmXEnsF.js → NotificationSettingsPanel-BA0Lj4kT.js} +1 -1
- package/dist/web/assets/{PanelFind-CQnWpcIB.js → PanelFind-D_pRPFBN.js} +1 -1
- package/dist/web/assets/RemoteLifeOSBlock-CZkQLmE5.js +2 -0
- package/dist/web/assets/{RemoteWorkspaceSettings-DzHtw75P.js → RemoteWorkspaceSettings-tDqbDqj4.js} +1 -1
- package/dist/web/assets/{SessionTerminalPanel-i2N28V0A.js → SessionTerminalPanel-B-TvX4Fz.js} +2 -2
- package/dist/web/assets/{SpeechInputSettingsPanel-Ig45GnlA.js → SpeechInputSettingsPanel-Buqwjrth.js} +1 -1
- package/dist/web/assets/{ThemeSettingsPanel-C02iFM8b.js → ThemeSettingsPanel-Bph9zVcN.js} +1 -1
- package/dist/web/assets/{__vite-browser-external-2447137e-D97de6th.js → __vite-browser-external-2447137e-Dbwxx6PZ.js} +1 -1
- package/dist/web/assets/_baseMerge-YHvLFG89.js +1 -0
- package/dist/web/assets/{_initCloneObject-BR1zWEqJ.js → _initCloneObject-CgHgrY9n.js} +1 -1
- package/dist/web/assets/abnfDiagram-VRR7QNED-dJfL32qR.js +1 -0
- package/dist/web/assets/arc-BYAxnPQ_.js +1 -0
- package/dist/web/assets/architectureDiagram-ZJ3FMSHR-LXgKoYZv.js +1 -0
- package/dist/web/assets/{arrow-left-BL56KTLD.js → arrow-left-CagvtJU8.js} +1 -1
- package/dist/web/assets/{arrow-right-BV-uA_nA.js → arrow-right-CW797wzk.js} +1 -1
- package/dist/web/assets/blockDiagram-677ZJIJ3-BOLqwY0y.js +1 -0
- package/dist/web/assets/c4Diagram-LMCZKHZV-BvwC7DIr.js +1 -0
- package/dist/web/assets/channel-DpGkajT1.js +1 -0
- package/dist/web/assets/chevron-up-DfL2d5fV.js +1 -0
- package/dist/web/assets/{chunk-2Q5K7J3B-C8JBUKrX.js → chunk-2Q5K7J3B-D2B_BdaG.js} +1 -1
- package/dist/web/assets/{chunk-32BRIVSS-DCe9Y9ii.js → chunk-32BRIVSS-B93XkYif.js} +1 -1
- package/dist/web/assets/{chunk-5VM5RSS4-CJ5XB5TH.js → chunk-5VM5RSS4-Uv1D4oA2.js} +1 -1
- package/dist/web/assets/{chunk-EX3LRPZG-DbBMJLot.js → chunk-EX3LRPZG-xZrFFOcj.js} +1 -1
- package/dist/web/assets/{chunk-JWPE2WC7-BHVdLkDM.js → chunk-JWPE2WC7-1--FpPFR.js} +1 -1
- package/dist/web/assets/{chunk-MOJQB5TN-uHzAp-k5.js → chunk-MOJQB5TN-BLOL5fhw.js} +1 -1
- package/dist/web/assets/{chunk-RYQCIY6F-Cn6aFViK.js → chunk-RYQCIY6F-z7wmcSRp.js} +1 -1
- package/dist/web/assets/{chunk-V7JOEXUC-DxPwkXTU.js → chunk-V7JOEXUC-DPvobQwd.js} +1 -1
- package/dist/web/assets/{chunk-VR4S4FIN-O5Mrjsjy.js → chunk-VR4S4FIN-DD3Gj91z.js} +1 -1
- package/dist/web/assets/{chunk-XXDRQBXY-0mC3mDJF.js → chunk-XXDRQBXY-DoVRk31D.js} +1 -1
- package/dist/web/assets/classDiagram-OUVF2IWQ-oZMIKKng.js +1 -0
- package/dist/web/assets/classDiagram-v2-EOCWNBFH-oZMIKKng.js +1 -0
- package/dist/web/assets/clsx-DoZLeicy.js +1 -0
- package/dist/web/assets/collectMessageImages-B2EAkrhU.js +1 -0
- package/dist/web/assets/cose-bilkent-JH36ORCC-BQknAy25.js +1 -0
- package/dist/web/assets/{cynefin-VYW2F7L2-CO9lWPZn.js → cynefin-VYW2F7L2-09uNSfvT.js} +1 -1
- package/dist/web/assets/cynefinDiagram-TSTJHNR4-CgKhj0m5.js +1 -0
- package/dist/web/assets/dagre-VKFMJZFB-CLCxvrOo.js +1 -0
- package/dist/web/assets/diagram-FQU43EPY-B4VfNgsF.js +1 -0
- package/dist/web/assets/diagram-G47NLZAW-CQC0I6zX.js +1 -0
- package/dist/web/assets/diagram-NH7WQ7WH-CSBbTiMh.js +1 -0
- package/dist/web/assets/diagram-OA4YK3LP-CkUx0v34.js +1 -0
- package/dist/web/assets/diagram-WEI45ONY-dlEY_W2R.js +1 -0
- package/dist/web/assets/ebnfDiagram-CCIWWBDH-BsxdwE2E.js +1 -0
- package/dist/web/assets/erDiagram-Q63AITRT-CE8BUsrY.js +1 -0
- package/dist/web/assets/{file-editor-FileCodeEditor-CkMO-zP9.js → file-editor-FileCodeEditor-HR6Wsm5I.js} +1 -1
- package/dist/web/assets/{file-editor-ObsidianCodeEditor-Ct5ku7x2.js → file-editor-ObsidianCodeEditor-BMcU5Aqo.js} +6 -6
- package/dist/web/assets/file-editor-ObsidianFileEditor-BuzsfQwA.js +2 -0
- package/dist/web/assets/{flowDiagram-23GEKE2U-DfTXu8Tf.js → flowDiagram-23GEKE2U-DUiI830l.js} +1 -1
- package/dist/web/assets/{folder-plus-DeXueDPL.js → folder-plus-Byi2WQUY.js} +1 -1
- package/dist/web/assets/ganttDiagram-NO4QXBWP-x0WR7K4r.js +1 -0
- package/dist/web/assets/gitGraphDiagram-IHSO6WYX-BJA7zQjW.js +1 -0
- package/dist/web/assets/highlighted-body-TPN3WLV5-lW0JmP5H.js +1 -0
- package/dist/web/assets/index-1M7_HtDu.js +1 -0
- package/dist/web/assets/index-76-ZfKAK.css +1 -0
- package/dist/web/assets/index-8TM1eFHE.js +1 -0
- package/dist/web/assets/index-S4bzeLfy.js +1 -0
- package/dist/web/assets/{index-BaK7b1aP.js → index-c9Eb0rEZ.js} +2 -2
- package/dist/web/assets/infoDiagram-FWYZ7A6U-BfA2fWjL.js +1 -0
- package/dist/web/assets/ishikawaDiagram-FXEZZL3T-B7WW0j7E.js +1 -0
- package/dist/web/assets/journeyDiagram-5HDEW3XC-BEMtGLhR.js +1 -0
- package/dist/web/assets/kanban-definition-HUTT4EX6-DqIkrGPA.js +1 -0
- package/dist/web/assets/{key-round-DRT2ZbDR.js → key-round-y1oxWXOB.js} +1 -1
- package/dist/web/assets/{layout-CmMX872C.js → layout-CAp4KseL.js} +1 -1
- package/dist/web/assets/{linear-Bv80xPYH.js → linear-DRFQGBEA.js} +1 -1
- package/dist/web/assets/logo-iv8HSlJj.webp +0 -0
- package/dist/web/assets/{map-Dwt0FgOz.js → map-XtUTTYLw.js} +1 -1
- package/dist/web/assets/mermaid-O7DHMXV3-9HC6mORt.js +2 -0
- package/dist/web/assets/{mermaid.core-CzqhAinL.js → mermaid.core-LEKKQwXZ.js} +2 -2
- package/dist/web/assets/{mic-DhJeizK9.js → mic-BOKcmdUn.js} +1 -1
- package/dist/web/assets/mindmap-definition-LN4V7U3C-Bt6LtGWO.js +1 -0
- package/dist/web/assets/pegDiagram-2B236MQR-DVdodUA1.js +1 -0
- package/dist/web/assets/pieDiagram-ENE6RG2P-CeQnXIl7.js +1 -0
- package/dist/web/assets/quadrantDiagram-ABIIQ3AL-DNGl4Hse.js +1 -0
- package/dist/web/assets/railroadDiagram-RFXS5EU6-BiFr0x3V.js +1 -0
- package/dist/web/assets/requirementDiagram-TGXJPOKE-DIx4dpS7.js +1 -0
- package/dist/web/assets/sankeyDiagram-HTMAVEWB-D_zRhmQ_.js +1 -0
- package/dist/web/assets/sequenceDiagram-DBY2YBRQ-ChMRMmPd.js +1 -0
- package/dist/web/assets/{shield-check-CwbnsnOe.js → shield-check-DM9poYLJ.js} +1 -1
- package/dist/web/assets/sizeCapture-X5ZJPWSS-CLVxFMDT.js +1 -0
- package/dist/web/assets/square-K9kFBDil.js +1 -0
- package/dist/web/assets/stateDiagram-2N3HPSRC-Dn7yCHtf.js +1 -0
- package/dist/web/assets/stateDiagram-v2-6OUMAXLB-DkgnQPrP.js +1 -0
- package/dist/web/assets/swimlanes-5IMT3BWC-Dhut6RY-.js +2 -0
- package/dist/web/assets/swimlanesDiagram-G3AALYLV-D62G5R34.js +1 -0
- package/dist/web/assets/timeline-definition-FHXFAJF6-D_9aY3SL.js +1 -0
- package/dist/web/assets/useComposerCompletion-DcHhaHlX.js +1 -0
- package/dist/web/assets/vennDiagram-L72KCM5P-Bxsjs1td.js +1 -0
- package/dist/web/assets/wardleyDiagram-EHGQE667-B8vO0orG.js +1 -0
- package/dist/web/assets/xychartDiagram-FW5EYKEG-CUBLdGVB.js +1 -0
- package/dist/web/assets/{zap-CJH1FjCl.js → zap-4rbaTb6R.js} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/obsidian-editor-assets.json +1 -1
- package/package.json +7 -7
- package/dist/web/assets/App-BvW36-4M.js +0 -2
- package/dist/web/assets/App-DAtZu22A.css +0 -97
- package/dist/web/assets/BrowserControlPanel-DmDwrRxu.js +0 -1
- package/dist/web/assets/ChatPane-RyWUI1bq.js +0 -2
- package/dist/web/assets/ComposerMenus-D1uWPFXr.js +0 -1
- package/dist/web/assets/DiffDrawer-BEGVqU1n.js +0 -1
- package/dist/web/assets/FilesControlPanel-BXXKMrYD.js +0 -1
- package/dist/web/assets/FilesControlPanel-DeLKfCiq.css +0 -1
- package/dist/web/assets/ImageViewer-dOitFny1.js +0 -1
- package/dist/web/assets/MessageImage-BtpNPUOG.js +0 -1
- package/dist/web/assets/MessageImage-XcPrPLDn.css +0 -1
- package/dist/web/assets/NewSessionDialog-DgmnoXsk.js +0 -1
- package/dist/web/assets/RemoteLifeOSBlock-gBVCJ1KA.js +0 -2
- package/dist/web/assets/_baseMerge-DBQbsGvS.js +0 -1
- package/dist/web/assets/abnfDiagram-VRR7QNED-DmwaYNlH.js +0 -1
- package/dist/web/assets/arc-j_Wwjf6k.js +0 -1
- package/dist/web/assets/architectureDiagram-ZJ3FMSHR-glqGay8y.js +0 -1
- package/dist/web/assets/blockDiagram-677ZJIJ3-B8c7J04C.js +0 -1
- package/dist/web/assets/c4Diagram-LMCZKHZV-CG3zztsH.js +0 -1
- package/dist/web/assets/channel-DgblqPfw.js +0 -1
- package/dist/web/assets/chevron-up-CvywgAdp.js +0 -1
- package/dist/web/assets/classDiagram-OUVF2IWQ-bsBy4PcE.js +0 -1
- package/dist/web/assets/classDiagram-v2-EOCWNBFH-bsBy4PcE.js +0 -1
- package/dist/web/assets/collectMessageImages-BjN-Gevg.js +0 -1
- package/dist/web/assets/cose-bilkent-JH36ORCC-BgHa3fCS.js +0 -1
- package/dist/web/assets/cynefinDiagram-TSTJHNR4-0Z9seUPF.js +0 -1
- package/dist/web/assets/dagre-VKFMJZFB-BTOqPL06.js +0 -1
- package/dist/web/assets/diagram-FQU43EPY-BPXD1X4G.js +0 -1
- package/dist/web/assets/diagram-G47NLZAW-DKhfIaJX.js +0 -1
- package/dist/web/assets/diagram-NH7WQ7WH-TJq_qxyk.js +0 -1
- package/dist/web/assets/diagram-OA4YK3LP-DTkDt5xm.js +0 -1
- package/dist/web/assets/diagram-WEI45ONY-CPTKbbj_.js +0 -1
- package/dist/web/assets/ebnfDiagram-CCIWWBDH-6j_AlAL7.js +0 -1
- package/dist/web/assets/erDiagram-Q63AITRT-CF7E_ZqO.js +0 -1
- package/dist/web/assets/file-editor-ObsidianFileEditor-aYLrufoa.js +0 -2
- package/dist/web/assets/ganttDiagram-NO4QXBWP-CrYbCAop.js +0 -1
- package/dist/web/assets/gitGraphDiagram-IHSO6WYX-DckwoanW.js +0 -1
- package/dist/web/assets/highlighted-body-TPN3WLV5-CxmpyVYz.js +0 -1
- package/dist/web/assets/imageViewerCopy-S5HtozB3.js +0 -1
- package/dist/web/assets/index-BNl2LlC5.js +0 -1
- package/dist/web/assets/index-C_vQZvvM.js +0 -1
- package/dist/web/assets/index-CjLh4QgJ.js +0 -1
- package/dist/web/assets/index-FQXZYOsr.js +0 -1
- package/dist/web/assets/index-xAMW1ul2.css +0 -1
- package/dist/web/assets/infoDiagram-FWYZ7A6U-DFF0Gmic.js +0 -1
- package/dist/web/assets/ishikawaDiagram-FXEZZL3T-Cv-VE1wB.js +0 -1
- package/dist/web/assets/journeyDiagram-5HDEW3XC-ByLfT2Us.js +0 -1
- package/dist/web/assets/kanban-definition-HUTT4EX6-DHBZws3R.js +0 -1
- package/dist/web/assets/logo-Caf1Fn81.webp +0 -0
- package/dist/web/assets/mermaid-O7DHMXV3-B4_lK8p1.js +0 -2
- package/dist/web/assets/mindmap-definition-LN4V7U3C-Bnyri0I2.js +0 -1
- package/dist/web/assets/pegDiagram-2B236MQR-6X6OAtrD.js +0 -1
- package/dist/web/assets/pieDiagram-ENE6RG2P-DdtY7NGx.js +0 -1
- package/dist/web/assets/quadrantDiagram-ABIIQ3AL-BDqHj-TT.js +0 -1
- package/dist/web/assets/railroadDiagram-RFXS5EU6-B5lI016a.js +0 -1
- package/dist/web/assets/requirementDiagram-TGXJPOKE-DsEgsQJj.js +0 -1
- package/dist/web/assets/sankeyDiagram-HTMAVEWB-C0ypjxpz.js +0 -1
- package/dist/web/assets/sequenceDiagram-DBY2YBRQ-CMshcz69.js +0 -1
- package/dist/web/assets/sizeCapture-X5ZJPWSS-Db9dkTnd.js +0 -1
- package/dist/web/assets/stateDiagram-2N3HPSRC-C6srGQcS.js +0 -1
- package/dist/web/assets/stateDiagram-v2-6OUMAXLB-BubiXOGD.js +0 -1
- package/dist/web/assets/swimlanes-5IMT3BWC-B1YoJvr3.js +0 -2
- package/dist/web/assets/swimlanesDiagram-G3AALYLV-B02Fdgr_.js +0 -1
- package/dist/web/assets/timeline-definition-FHXFAJF6-CRG13zHS.js +0 -1
- package/dist/web/assets/useComposerCompletion-DmtYYaK9.js +0 -1
- package/dist/web/assets/useMessageImage-D-dQN21J.js +0 -1
- package/dist/web/assets/vennDiagram-L72KCM5P-BN5Bx-tU.js +0 -1
- package/dist/web/assets/wardleyDiagram-EHGQE667-C2kiCoYR.js +0 -1
- package/dist/web/assets/xychartDiagram-FW5EYKEG-CVzHNjnj.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-editor-index-ORJkxheE.js","assets/file-editor-CodeHighlight-aQ9kP3Wv.js","assets/CodeHighlight-aMZr054w.css","assets/file-editor-index-Br9mmThB.js","assets/file-editor-index-BEhJJ-2S.js","assets/file-editor-index-24Wzz7Bl.js","assets/file-editor-index-zEnXm9gB.js","assets/file-editor-index-DX8Fwz0S.js","assets/file-editor-index-CrvkFqLZ.js","assets/file-editor-index-BXupf89-.js","assets/file-editor-index-BZTziJqM.js","assets/file-editor-index-CP7DVsyc.js","assets/file-editor-index-CjS11v2I.js","assets/file-editor-index-C6DQMoRZ.js","assets/file-editor-index-CIj8OyuX.js","assets/file-editor-index-Dc4mA3Mx.js","assets/file-editor-index-DuqNWTkz.js","assets/file-editor-index-DL4CfMoo.js","assets/file-editor-index-DOpwPD6_.js","assets/file-editor-index-7BDUBERb.js","assets/file-editor-index-sXsevL_T.js","assets/file-editor-index-_H-0XYsY.js","assets/file-editor-index-BMyBawZX.js","assets/file-editor-dockerfile-CZsZcXQt.js","assets/file-editor-simple-mode-CjHKX61j.js","assets/file-editor-factor-DXwzD_Ly.js","assets/file-editor-nsis-DeakT4dU.js","assets/file-editor-pug-C_WDC1BE.js","assets/file-editor-javascript-Ccp3-nCs.js","assets/file-editor-index-Ce_Hrot9.js","assets/file-editor-index-D3hWXNQc.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e,_ as t,r as n,j as r,h as o}from"./index-BaK7b1aP.js";import{c as i,$ as a,a as s,b as l,P as c,e as d,p as u,R as h,S as p,F as m,D as f,f as g,g as v,h as y,i as b,j as w,o as x,s as k,k as C,l as _,T as S,m as A,N as M,n as T,q as E,r as L,t as O,u as I,v as R,w as P,x as B,y as z,z as D,A as N,B as H,C as q,E as j,G as V,H as F,I as $,J as W,K as U,L as G,M as Z,O as X,Q as K,U as Y,V as J,W as Q,X as ee,Y as te,Z as ne,_ as re,a0 as oe,a1 as ie,a2 as ae,a3 as se,a4 as le,a5 as ce,a6 as de,a7 as ue,a8 as he,a9 as pe,aa as me,ab as fe,ac as ge,ad as ve,ae as ye,af as be,ag as we,ah as xe,ai as ke,aj as Ce,ak as _e,al as Se,am as Ae,an as Me,ao as Te,ap as Ee,aq as Le,ar as Oe,as as Ie,at as Re,au as Pe,av as Be,aw as ze,ax as De,ay as Ne,az as He,aA as qe,aB as je,aC as Ve,aD as Fe,aE as $e,aF as We,aG as Ue,aH as Ge,aI as Ze,aJ as Xe,aK as Ke,aL as Ye,aM as Je,aN as Qe,aO as et,aP as tt,aQ as nt,aR as rt,aS as ot,aT as it,aU as at,aV as st,aW as lt,aX as ct,aY as dt,aZ as ut,a_ as ht,a$ as pt,b0 as mt,b1 as ft,b2 as gt,b3 as vt,b4 as yt,b5 as bt,b6 as wt,b7 as xt,b8 as kt,b9 as Ct,ba as _t,bb as St,bc as At,bd as Mt}from"./RemoteLifeOSBlock-gBVCJ1KA.js";import{h as Tt,b as Et}from"./index-C_vQZvvM.js";import{Z as Lt,u as Ot,a3 as It,E as Rt,a4 as Pt,a5 as Bt,z as zt,a6 as Dt,a7 as Nt,k as Ht,X as qt,V as jt,S as Vt,a as Ft,P as $t,e as Wt,F as Ut,a8 as Gt,a9 as Zt,f as Xt,aa as Kt,c as Yt,h as Jt,j as Qt,m as en,C as tn,ab as nn,ac as rn,ad as on,ae as an,af as sn,W as ln,ag as cn,ah as dn,ai as un,aj as hn,ak as pn,al as mn,am as fn,an as gn,ao as vn,ap as yn,aq as bn,ar as wn,as as xn,at as kn,au as Cn,av as _n,aw as Sn}from"./file-editor-CodeHighlight-aQ9kP3Wv.js";import{p as An}from"./purify.es-BNLkGfTg.js";import{a as Mn,b as Tn,d as En,e as Ln}from"./file-editor-index-BEhJJ-2S.js";import{c as On,r as In}from"./index-CjLh4QgJ.js";import{t as Rn,a as Pn,d as Bn,x as zn}from"./isArrayLikeObject-C958pSF-.js";import{t as Dn,b as Nn,c as Hn}from"./_baseMerge-DBQbsGvS.js";import{a2 as qn,a3 as jn,a4 as Vn,j as Fn,k as $n,N as Wn,a5 as Un,a6 as Gn,a7 as Zn}from"./App-BvW36-4M.js";import{M as Xn}from"./MessageImage-BtpNPUOG.js";import"./index-FQXZYOsr.js";import"./chevron-up-CvywgAdp.js";import"./__vite-browser-external-2447137e-D97de6th.js";import"./_initCloneObject-BR1zWEqJ.js";import"./useMessageImage-D-dQN21J.js";function Kn(e){const t=(t,n,r,o)=>{const i=r.options[e],a=t.marker;"*"!==a&&"_"!==a||(r.options[e]=a);try{return Tt[e](t,n,r,o)}finally{r.options[e]=i}};return t.peek=(t,n,r)=>t.marker||r.options[e]||"*",t}const Yn=(e,t,n,r)=>{const o=Tt.text(e,t,n,r);return/[ \t]+$/.test(o)&&r.after.startsWith("\n")?function(e){return e.replace(/[ \t]+$/g,e=>e.replace(/ /g," ").replace(/\t/g,"	"))}(o):o};function Jn(e){return(t,n,r,o)=>(t.spread=!1,t.children&&t.children.forEach(e=>{void 0!==e.spread&&(e.spread=!1)}),(e.list??Tt.list)(t,n,r,o))}const Qn=new Set(["list","blockquote","code","table","thematicBreak"]);function er(e){const t=e.handlers||{};return{...e,bullet:"-",bulletOrdered:".",listItemIndent:"one",join:[...e.join||[],(e,t,n)=>{if("listItem"===n.type)return"list"===e.type&&"paragraph"===t.type||"paragraph"===e.type&&"list"===t.type&&function(e){if(e.ordered&&1!==(e.start??1))return!0;const t=e.children?.[0];if(null!=i(t?.checked))return!1;const n=t?.children?.[0];return!(n&&!Qn.has(n.type))||"paragraph"===n.type&&!(n.children??[]).some(e=>"text"!==e.type||e.value?.trim())}(t)?1:void 0}],handlers:{...t,strong:Kn("strong"),emphasis:Kn("emphasis"),text:Yn,list:Jn(t),listItem:(e,t,n,r)=>{e.spread=!1,t&&(t.spread=!1);let o=n.bulletCurrent||"-";if(t?.ordered){const r=t.start??1,i=t.children?t.children.indexOf(e):0,a=n.bulletCurrent||n.options.bulletOrdered||".";o=String(r+i)+a}const a=i(e.checked),s=null==a?"":`[${a}] `,l=n.enter("listItem"),c=n.containerFlow(e,r),d=e.children?.some(e=>"html"===e.type||"paragraph"===e.type&&1===e.children?.length&&"html"===e.children[0].type),u=d?o.length+1:Math.max(4,o.length+1),h=" ".repeat(u),p=e.children?.[0]?.type,m=(Qn.has(p)?`\n${c}`:c).split("\n").map((e,t)=>0===t?`${o} ${s}${e}`:""===e?"":h+e).join("\n");return l(),m}}}}const tr=new WeakMap,nr=new Map,rr=[];let or=!1;function ir(){or=!1,rr.splice(0,2).forEach(e=>{e()}),rr.length>0&&ar()}function ar(){or||(or=!0,function(e){"function"!=typeof requestAnimationFrame?setTimeout(e,0):requestAnimationFrame(e)}(ir))}function sr(e,t){const n=e.callbacks.get(t)??null;return n?(e.callbacks.delete(t),e.observer.unobserve(t),0===e.callbacks.size&&(e.observer.disconnect(),e.owner.delete(e.rootMargin)),n):null}function lr(e,t=String(e.attrs.alias??"")){return`![[${String(e.attrs.target??"")}${e.attrs.hash?`#${String(e.attrs.hash)}`:""}${t?`|${t}`:""}]]`}function cr(e){return e.some(e=>Boolean(e.spec.inlineSourceActive))}var dr=function(){return Rn.Date.now()},ur=Math.max,hr=Math.min;function pr(e,t,n){var r,o,i,a,s,l,c=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function m(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=i}function f(){var e=dr();if(m(e))return g(e);s=setTimeout(f,function(e){var n=t-(e-l);return u?hr(n,i-(e-c)):n}(e))}function g(e){return s=void 0,h&&r?p(e):(r=o=void 0,a)}function v(){var e=dr(),n=m(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(f,t),d?p(e):a}(l);if(u)return clearTimeout(s),s=setTimeout(f,t),p(l)}return void 0===s&&(s=setTimeout(f,t)),a}return t=Dn(t)||0,Pn(n)&&(d=!!n.leading,i=(u="maxWait"in n)?ur(Dn(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},v.flush=function(){return void 0===s?a:g(dr())},v}function mr(e,t,n,r,o,i){return Pn(e)&&Pn(t)&&(i.set(t,e),Nn(e,t,void 0,mr,i),i.delete(t)),e}var fr=Hn(function(e,t,n,r){Nn(e,t,n,r)}),gr=Bn(function(e){return e.push(void 0,mr),zn(fr,void 0,e)});function vr(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Pn(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),pr(e,t,{leading:r,maxWait:t,trailing:o})}function yr(e){return new Ot(It.define(e))}function br(e){return t(()=>import("./file-editor-index-ORJkxheE.js"),__vite__mapDeps([0,1,2,3,4])).then(t=>t.sql({dialect:t[e]}))}const wr=[Lt.of({name:"C",extensions:["c","h","ino"],load:()=>t(()=>import("./file-editor-index-24Wzz7Bl.js"),__vite__mapDeps([5,3,1,2])).then(e=>e.cpp())}),Lt.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:()=>t(()=>import("./file-editor-index-24Wzz7Bl.js"),__vite__mapDeps([5,3,1,2])).then(e=>e.cpp())}),Lt.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:()=>br("Cassandra")}),Lt.of({name:"CSS",extensions:["css"],load:()=>t(()=>import("./file-editor-index-zEnXm9gB.js"),__vite__mapDeps([6,3,1,2])).then(e=>e.css())}),Lt.of({name:"Go",extensions:["go"],load:()=>t(()=>import("./file-editor-index-DX8Fwz0S.js"),__vite__mapDeps([7,3,1,2,4])).then(e=>e.go())}),Lt.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:()=>t(()=>import("./file-editor-index-CrvkFqLZ.js"),__vite__mapDeps([8,3,1,2,6,9,4])).then(e=>e.html())}),Lt.of({name:"Java",extensions:["java"],load:()=>t(()=>import("./file-editor-index-BZTziJqM.js"),__vite__mapDeps([10,3,1,2])).then(e=>e.java())}),Lt.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:()=>t(()=>import("./file-editor-index-BXupf89-.js"),__vite__mapDeps([9,3,1,2,4])).then(e=>e.javascript())}),Lt.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load:()=>t(()=>import("./file-editor-index-CP7DVsyc.js"),__vite__mapDeps([11,1,2,8,3,6,9,4])).then(e=>e.jinja())}),Lt.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:()=>t(()=>import("./file-editor-index-CjS11v2I.js"),__vite__mapDeps([12,3,1,2])).then(e=>e.json())}),Lt.of({name:"JSX",extensions:["jsx"],load:()=>t(()=>import("./file-editor-index-BXupf89-.js"),__vite__mapDeps([9,3,1,2,4])).then(e=>e.javascript({jsx:!0}))}),Lt.of({name:"LESS",extensions:["less"],load:()=>t(()=>import("./file-editor-index-C6DQMoRZ.js"),__vite__mapDeps([13,1,2,6,3])).then(e=>e.less())}),Lt.of({name:"Liquid",extensions:["liquid"],load:()=>t(()=>import("./file-editor-index-CIj8OyuX.js"),__vite__mapDeps([14,1,2,8,3,6,9,4])).then(e=>e.liquid())}),Lt.of({name:"MariaDB SQL",load:()=>br("MariaSQL")}),Lt.of({name:"Markdown",extensions:["md","markdown","mkd"],load:()=>t(()=>import("./file-editor-index-Dc4mA3Mx.js"),__vite__mapDeps([15,1,2,4,8,3,6,9])).then(e=>e.markdown())}),Lt.of({name:"MS SQL",load:()=>br("MSSQL")}),Lt.of({name:"MySQL",load:()=>br("MySQL")}),Lt.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:()=>t(()=>import("./file-editor-index-DuqNWTkz.js"),__vite__mapDeps([16,3,1,2,8,6,9,4])).then(e=>e.php())}),Lt.of({name:"PLSQL",extensions:["pls"],load:()=>br("PLSQL")}),Lt.of({name:"PostgreSQL",load:()=>br("PostgreSQL")}),Lt.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:()=>t(()=>import("./file-editor-index-DL4CfMoo.js"),__vite__mapDeps([17,3,1,2,4])).then(e=>e.python())}),Lt.of({name:"Rust",extensions:["rs"],load:()=>t(()=>import("./file-editor-index-DOpwPD6_.js"),__vite__mapDeps([18,3,1,2])).then(e=>e.rust())}),Lt.of({name:"Sass",extensions:["sass"],load:()=>t(()=>import("./file-editor-index-7BDUBERb.js"),__vite__mapDeps([19,3,1,2,6])).then(e=>e.sass({indented:!0}))}),Lt.of({name:"SCSS",extensions:["scss"],load:()=>t(()=>import("./file-editor-index-7BDUBERb.js"),__vite__mapDeps([19,3,1,2,6])).then(e=>e.sass())}),Lt.of({name:"SQL",extensions:["sql"],load:()=>br("StandardSQL")}),Lt.of({name:"SQLite",load:()=>br("SQLite")}),Lt.of({name:"TSX",extensions:["tsx"],load:()=>t(()=>import("./file-editor-index-BXupf89-.js"),__vite__mapDeps([9,3,1,2,4])).then(e=>e.javascript({jsx:!0,typescript:!0}))}),Lt.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:()=>t(()=>import("./file-editor-index-BXupf89-.js"),__vite__mapDeps([9,3,1,2,4])).then(e=>e.javascript({typescript:!0}))}),Lt.of({name:"WebAssembly",extensions:["wat","wast"],load:()=>t(()=>import("./file-editor-index-sXsevL_T.js"),__vite__mapDeps([20,1,2,3])).then(e=>e.wast())}),Lt.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:()=>t(()=>import("./file-editor-index-_H-0XYsY.js"),__vite__mapDeps([21,3,1,2])).then(e=>e.xml())}),Lt.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:()=>t(()=>import("./file-editor-index-BMyBawZX.js"),__vite__mapDeps([22,3,1,2])).then(e=>e.yaml())}),Lt.of({name:"APL",extensions:["dyalog","apl"],load:()=>t(()=>import("./file-editor-apl-__TFPTXj.js"),[]).then(e=>yr(e.apl))}),Lt.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:()=>t(()=>import("./file-editor-asciiarmor-D5V0T9Cu.js"),[]).then(e=>yr(e.asciiArmor))}),Lt.of({name:"ASN.1",extensions:["asn","asn1"],load:()=>t(()=>import("./file-editor-asn1-YTasSa1m.js"),[]).then(e=>yr(e.asn1({})))}),Lt.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:()=>t(()=>import("./file-editor-asterisk-B46aRdXb.js"),[]).then(e=>yr(e.asterisk))}),Lt.of({name:"Brainfuck",extensions:["b","bf"],load:()=>t(()=>import("./file-editor-brainfuck-CtZaYBKt.js"),[]).then(e=>yr(e.brainfuck))}),Lt.of({name:"Cobol",extensions:["cob","cpy"],load:()=>t(()=>import("./file-editor-cobol-stawOqaz.js"),[]).then(e=>yr(e.cobol))}),Lt.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>yr(e.csharp))}),Lt.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:()=>t(()=>import("./file-editor-clojure-DiuoqK-z.js"),[]).then(e=>yr(e.clojure))}),Lt.of({name:"ClojureScript",extensions:["cljs"],load:()=>t(()=>import("./file-editor-clojure-DiuoqK-z.js"),[]).then(e=>yr(e.clojure))}),Lt.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:()=>t(()=>import("./file-editor-css-ZjFoif2m.js"),[]).then(e=>yr(e.gss))}),Lt.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:()=>t(()=>import("./file-editor-cmake-BF4EFB2i.js"),[]).then(e=>yr(e.cmake))}),Lt.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:()=>t(()=>import("./file-editor-coffeescript-BTDxI-eT.js"),[]).then(e=>yr(e.coffeeScript))}),Lt.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:()=>t(()=>import("./file-editor-commonlisp-vq6DHwts.js"),[]).then(e=>yr(e.commonLisp))}),Lt.of({name:"Cypher",extensions:["cyp","cypher"],load:()=>t(()=>import("./file-editor-cypher-gJDei3ni.js"),[]).then(e=>yr(e.cypher))}),Lt.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:()=>t(()=>import("./file-editor-python-BiaVA1aS.js"),[]).then(e=>yr(e.cython))}),Lt.of({name:"Crystal",extensions:["cr"],load:()=>t(()=>import("./file-editor-crystal-CRzZ78HM.js"),[]).then(e=>yr(e.crystal))}),Lt.of({name:"D",extensions:["d"],load:()=>t(()=>import("./file-editor-d-DBBFJxh-.js"),[]).then(e=>yr(e.d))}),Lt.of({name:"Dart",extensions:["dart"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>yr(e.dart))}),Lt.of({name:"diff",extensions:["diff","patch"],load:()=>t(()=>import("./file-editor-diff-UJJ5BM9S.js"),[]).then(e=>yr(e.diff))}),Lt.of({name:"Dockerfile",filename:/^Dockerfile$/,load:()=>t(()=>import("./file-editor-dockerfile-CZsZcXQt.js"),__vite__mapDeps([23,24])).then(e=>yr(e.dockerFile))}),Lt.of({name:"DTD",extensions:["dtd"],load:()=>t(()=>import("./file-editor-dtd-DTQlJHYL.js"),[]).then(e=>yr(e.dtd))}),Lt.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:()=>t(()=>import("./file-editor-dylan-DkEP81N9.js"),[]).then(e=>yr(e.dylan))}),Lt.of({name:"EBNF",load:()=>t(()=>import("./file-editor-ebnf-DdOEfpxz.js"),[]).then(e=>yr(e.ebnf))}),Lt.of({name:"ECL",extensions:["ecl"],load:()=>t(()=>import("./file-editor-ecl-BCmcI64-.js"),[]).then(e=>yr(e.ecl))}),Lt.of({name:"edn",extensions:["edn"],load:()=>t(()=>import("./file-editor-clojure-DiuoqK-z.js"),[]).then(e=>yr(e.clojure))}),Lt.of({name:"Eiffel",extensions:["e"],load:()=>t(()=>import("./file-editor-eiffel-CCu4w8r3.js"),[]).then(e=>yr(e.eiffel))}),Lt.of({name:"Elm",extensions:["elm"],load:()=>t(()=>import("./file-editor-elm-vsguYkAQ.js"),[]).then(e=>yr(e.elm))}),Lt.of({name:"Erlang",extensions:["erl"],load:()=>t(()=>import("./file-editor-erlang-DkiE79O3.js"),[]).then(e=>yr(e.erlang))}),Lt.of({name:"Esper",load:()=>t(()=>import("./file-editor-sql-B3SPsWL6.js"),[]).then(e=>yr(e.esper))}),Lt.of({name:"Factor",extensions:["factor"],load:()=>t(()=>import("./file-editor-factor-DXwzD_Ly.js"),__vite__mapDeps([25,24])).then(e=>yr(e.factor))}),Lt.of({name:"FCL",load:()=>t(()=>import("./file-editor-fcl-D8gVJOao.js"),[]).then(e=>yr(e.fcl))}),Lt.of({name:"Forth",extensions:["forth","fth","4th"],load:()=>t(()=>import("./file-editor-forth-POgR1ypr.js"),[]).then(e=>yr(e.forth))}),Lt.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:()=>t(()=>import("./file-editor-fortran-BC2PZYR6.js"),[]).then(e=>yr(e.fortran))}),Lt.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:()=>t(()=>import("./file-editor-mllike-3c2dg9RT.js"),[]).then(e=>yr(e.fSharp))}),Lt.of({name:"Gas",extensions:["s"],load:()=>t(()=>import("./file-editor-gas-D2ZU1gfd.js"),[]).then(e=>yr(e.gas))}),Lt.of({name:"Gherkin",extensions:["feature"],load:()=>t(()=>import("./file-editor-gherkin-B6X1vGSW.js"),[]).then(e=>yr(e.gherkin))}),Lt.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:()=>t(()=>import("./file-editor-groovy-DnIzCrpZ.js"),[]).then(e=>yr(e.groovy))}),Lt.of({name:"Haskell",extensions:["hs"],load:()=>t(()=>import("./file-editor-haskell-Dn099gLW.js"),[]).then(e=>yr(e.haskell))}),Lt.of({name:"Haxe",extensions:["hx"],load:()=>t(()=>import("./file-editor-haxe-80kYRvF1.js"),[]).then(e=>yr(e.haxe))}),Lt.of({name:"HXML",extensions:["hxml"],load:()=>t(()=>import("./file-editor-haxe-80kYRvF1.js"),[]).then(e=>yr(e.hxml))}),Lt.of({name:"HTTP",load:()=>t(()=>import("./file-editor-http-BKJkqRj4.js"),[]).then(e=>yr(e.http))}),Lt.of({name:"IDL",extensions:["pro"],load:()=>t(()=>import("./file-editor-idl-pcmmZuaN.js"),[]).then(e=>yr(e.idl))}),Lt.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:()=>t(()=>import("./file-editor-javascript-Ccp3-nCs.js"),[]).then(e=>yr(e.jsonld))}),Lt.of({name:"Julia",extensions:["jl"],load:()=>t(()=>import("./file-editor-julia-BqmDTk7j.js"),[]).then(e=>yr(e.julia))}),Lt.of({name:"Kotlin",extensions:["kt","kts"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>yr(e.kotlin))}),Lt.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:()=>t(()=>import("./file-editor-livescript-HO6ttBFx.js"),[]).then(e=>yr(e.liveScript))}),Lt.of({name:"Lua",extensions:["lua"],load:()=>t(()=>import("./file-editor-lua-CXU1lDR7.js"),[]).then(e=>yr(e.lua))}),Lt.of({name:"mIRC",extensions:["mrc"],load:()=>t(()=>import("./file-editor-mirc-DkvFAiy5.js"),[]).then(e=>yr(e.mirc))}),Lt.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:()=>t(()=>import("./file-editor-mathematica-IIbmv7SK.js"),[]).then(e=>yr(e.mathematica))}),Lt.of({name:"Modelica",extensions:["mo"],load:()=>t(()=>import("./file-editor-modelica-DSrSSXCg.js"),[]).then(e=>yr(e.modelica))}),Lt.of({name:"MUMPS",extensions:["mps"],load:()=>t(()=>import("./file-editor-mumps-zvxmGV4l.js"),[]).then(e=>yr(e.mumps))}),Lt.of({name:"Mbox",extensions:["mbox"],load:()=>t(()=>import("./file-editor-mbox-z_N2Mo3d.js"),[]).then(e=>yr(e.mbox))}),Lt.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:()=>t(()=>import("./file-editor-nginx-BmAbM9sR.js"),[]).then(e=>yr(e.nginx))}),Lt.of({name:"NSIS",extensions:["nsh","nsi"],load:()=>t(()=>import("./file-editor-nsis-DeakT4dU.js"),__vite__mapDeps([26,24])).then(e=>yr(e.nsis))}),Lt.of({name:"NTriples",extensions:["nt","nq"],load:()=>t(()=>import("./file-editor-ntriples-DEO2wBQg.js"),[]).then(e=>yr(e.ntriples))}),Lt.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>yr(e.objectiveC))}),Lt.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>yr(e.objectiveCpp))}),Lt.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:()=>t(()=>import("./file-editor-mllike-3c2dg9RT.js"),[]).then(e=>yr(e.oCaml))}),Lt.of({name:"Octave",extensions:["m"],load:()=>t(()=>import("./file-editor-octave-C4hdQ5Hf.js"),[]).then(e=>yr(e.octave))}),Lt.of({name:"Oz",extensions:["oz"],load:()=>t(()=>import("./file-editor-oz-DsOHt9n_.js"),[]).then(e=>yr(e.oz))}),Lt.of({name:"Pascal",extensions:["p","pas"],load:()=>t(()=>import("./file-editor-pascal-MWIkn1JH.js"),[]).then(e=>yr(e.pascal))}),Lt.of({name:"Perl",extensions:["pl","pm"],load:()=>t(()=>import("./file-editor-perl-D4U4Mn-f.js"),[]).then(e=>yr(e.perl))}),Lt.of({name:"Pig",extensions:["pig"],load:()=>t(()=>import("./file-editor-pig-DUTBITpC.js"),[]).then(e=>yr(e.pig))}),Lt.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:()=>t(()=>import("./file-editor-powershell-akC7YIf9.js"),[]).then(e=>yr(e.powerShell))}),Lt.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:()=>t(()=>import("./file-editor-properties-_nPj978X.js"),[]).then(e=>yr(e.properties))}),Lt.of({name:"ProtoBuf",extensions:["proto"],load:()=>t(()=>import("./file-editor-protobuf-B4y9do6W.js"),[]).then(e=>yr(e.protobuf))}),Lt.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:()=>t(()=>import("./file-editor-pug-C_WDC1BE.js"),__vite__mapDeps([27,28])).then(e=>yr(e.pug))}),Lt.of({name:"Puppet",extensions:["pp"],load:()=>t(()=>import("./file-editor-puppet-Dbxp0vTs.js"),[]).then(e=>yr(e.puppet))}),Lt.of({name:"Q",extensions:["q"],load:()=>t(()=>import("./file-editor-q-mUfi2b_o.js"),[]).then(e=>yr(e.q))}),Lt.of({name:"R",alias:["rscript"],extensions:["r","R"],load:()=>t(()=>import("./file-editor-r-J5UZzFYw.js"),[]).then(e=>yr(e.r))}),Lt.of({name:"RPM Changes",load:()=>t(()=>import("./file-editor-rpm-DI_rRufH.js"),[]).then(e=>yr(e.rpmChanges))}),Lt.of({name:"RPM Spec",extensions:["spec"],load:()=>t(()=>import("./file-editor-rpm-DI_rRufH.js"),[]).then(e=>yr(e.rpmSpec))}),Lt.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:()=>t(()=>import("./file-editor-ruby-SqZyEoLI.js"),[]).then(e=>yr(e.ruby))}),Lt.of({name:"SAS",extensions:["sas"],load:()=>t(()=>import("./file-editor-sas-Bqaci40L.js"),[]).then(e=>yr(e.sas))}),Lt.of({name:"Scala",extensions:["scala"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>yr(e.scala))}),Lt.of({name:"Scheme",extensions:["scm","ss"],load:()=>t(()=>import("./file-editor-scheme-Dtb5z51s.js"),[]).then(e=>yr(e.scheme))}),Lt.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:()=>t(()=>import("./file-editor-shell-D65E6JiF.js"),[]).then(e=>yr(e.shell))}),Lt.of({name:"Sieve",extensions:["siv","sieve"],load:()=>t(()=>import("./file-editor-sieve-BBCrNNIa.js"),[]).then(e=>yr(e.sieve))}),Lt.of({name:"Smalltalk",extensions:["st"],load:()=>t(()=>import("./file-editor-smalltalk-C7J3IyEP.js"),[]).then(e=>yr(e.smalltalk))}),Lt.of({name:"Solr",load:()=>t(()=>import("./file-editor-solr-CZy78n9F.js"),[]).then(e=>yr(e.solr))}),Lt.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:()=>t(()=>import("./file-editor-mllike-3c2dg9RT.js"),[]).then(e=>yr(e.sml))}),Lt.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:()=>t(()=>import("./file-editor-sparql-DItxJg31.js"),[]).then(e=>yr(e.sparql))}),Lt.of({name:"Spreadsheet",alias:["excel","formula"],load:()=>t(()=>import("./file-editor-spreadsheet-CGlWr0eM.js"),[]).then(e=>yr(e.spreadsheet))}),Lt.of({name:"Squirrel",extensions:["nut"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>yr(e.squirrel))}),Lt.of({name:"Stylus",extensions:["styl"],load:()=>t(()=>import("./file-editor-stylus-Dd_3NjJ0.js"),[]).then(e=>yr(e.stylus))}),Lt.of({name:"Swift",extensions:["swift"],load:()=>t(()=>import("./file-editor-swift-B_XXVlXX.js"),[]).then(e=>yr(e.swift))}),Lt.of({name:"sTeX",load:()=>t(()=>import("./file-editor-stex-9_wePcov.js"),[]).then(e=>yr(e.stex))}),Lt.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:()=>t(()=>import("./file-editor-stex-9_wePcov.js"),[]).then(e=>yr(e.stex))}),Lt.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:()=>t(()=>import("./file-editor-verilog-C8061G8U.js"),[]).then(e=>yr(e.verilog))}),Lt.of({name:"Tcl",extensions:["tcl"],load:()=>t(()=>import("./file-editor-tcl-DxOxgKRU.js"),[]).then(e=>yr(e.tcl))}),Lt.of({name:"Textile",extensions:["textile"],load:()=>t(()=>import("./file-editor-textile-BuVhTOzU.js"),[]).then(e=>yr(e.textile))}),Lt.of({name:"TiddlyWiki",load:()=>t(()=>import("./file-editor-tiddlywiki-BgR6AEZu.js"),[]).then(e=>yr(e.tiddlyWiki))}),Lt.of({name:"Tiki wiki",load:()=>t(()=>import("./file-editor-tiki-ru5LTfYV.js"),[]).then(e=>yr(e.tiki))}),Lt.of({name:"TOML",extensions:["toml"],load:()=>t(()=>import("./file-editor-toml-BVJm5Fzd.js"),[]).then(e=>yr(e.toml))}),Lt.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:()=>t(()=>import("./file-editor-troff-Ce85hlLp.js"),[]).then(e=>yr(e.troff))}),Lt.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:()=>t(()=>import("./file-editor-ttcn-BTO1-gcW.js"),[]).then(e=>yr(e.ttcn))}),Lt.of({name:"TTCN_CFG",extensions:["cfg"],load:()=>t(()=>import("./file-editor-ttcn-cfg-DIH_dYzw.js"),[]).then(e=>yr(e.ttcnCfg))}),Lt.of({name:"Turtle",extensions:["ttl"],load:()=>t(()=>import("./file-editor-turtle-DMr_FkeC.js"),[]).then(e=>yr(e.turtle))}),Lt.of({name:"Web IDL",extensions:["webidl"],load:()=>t(()=>import("./file-editor-webidl-CGwyPRYs.js"),[]).then(e=>yr(e.webIDL))}),Lt.of({name:"VB.NET",extensions:["vb"],load:()=>t(()=>import("./file-editor-vb-UtVLDai5.js"),[]).then(e=>yr(e.vb))}),Lt.of({name:"VBScript",extensions:["vbs"],load:()=>t(()=>import("./file-editor-vbscript-a5NhL3_u.js"),[]).then(e=>yr(e.vbScript))}),Lt.of({name:"Velocity",extensions:["vtl"],load:()=>t(()=>import("./file-editor-velocity-BdD_26Jv.js"),[]).then(e=>yr(e.velocity))}),Lt.of({name:"Verilog",extensions:["v"],load:()=>t(()=>import("./file-editor-verilog-C8061G8U.js"),[]).then(e=>yr(e.verilog))}),Lt.of({name:"VHDL",extensions:["vhd","vhdl"],load:()=>t(()=>import("./file-editor-vhdl-JqRksxx8.js"),[]).then(e=>yr(e.vhdl))}),Lt.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load:()=>t(()=>import("./file-editor-xquery-CVDBqZPY.js"),[]).then(e=>yr(e.xQuery))}),Lt.of({name:"Yacas",extensions:["ys"],load:()=>t(()=>import("./file-editor-yacas-WY0UPJfi.js"),[]).then(e=>yr(e.yacas))}),Lt.of({name:"Z80",extensions:["z80"],load:()=>t(()=>import("./file-editor-z80-D8p3gKXp.js"),[]).then(e=>yr(e.z80))}),Lt.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:()=>t(()=>import("./file-editor-mscgen-BaVD5lDT.js"),[]).then(e=>yr(e.mscgen))}),Lt.of({name:"Xù",extensions:["xu"],load:()=>t(()=>import("./file-editor-mscgen-BaVD5lDT.js"),[]).then(e=>yr(e.xu))}),Lt.of({name:"MsGenny",extensions:["msgenny"],load:()=>t(()=>import("./file-editor-mscgen-BaVD5lDT.js"),[]).then(e=>yr(e.msgenny))}),Lt.of({name:"Vue",extensions:["vue"],load:()=>t(()=>import("./file-editor-index-Ce_Hrot9.js"),__vite__mapDeps([29,1,2,8,3,6,9,4])).then(e=>e.vue())}),Lt.of({name:"Angular Template",load:()=>t(()=>import("./file-editor-index-D3hWXNQc.js"),__vite__mapDeps([30,1,2,8,3,6,9,4])).then(e=>e.angular())})],xr="#e06c75",kr="#abb2bf",Cr="#7d8799",_r="#d19a66",Sr="#2c313a",Ar="#282c34",Mr="#353a42",Tr="#528bff",Er=Rt.theme({"&":{color:kr,backgroundColor:Ar},".cm-content":{caretColor:Tr},".cm-cursor, .cm-dropCursor":{borderLeftColor:Tr},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:kr},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Ar,color:Cr,border:"none"},".cm-activeLineGutter":{backgroundColor:Sr},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Mr},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Mr,borderBottomColor:Mr},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Sr,color:kr}}},{dark:!0}),Lr=Bt.define([{tag:zt.keyword,color:"#c678dd"},{tag:[zt.name,zt.deleted,zt.character,zt.propertyName,zt.macroName],color:xr},{tag:[zt.function(zt.variableName),zt.labelName],color:"#61afef"},{tag:[zt.color,zt.constant(zt.name),zt.standard(zt.name)],color:_r},{tag:[zt.definition(zt.name),zt.separator],color:kr},{tag:[zt.typeName,zt.className,zt.number,zt.changed,zt.annotation,zt.modifier,zt.self,zt.namespace],color:"#e5c07b"},{tag:[zt.operator,zt.operatorKeyword,zt.url,zt.escape,zt.regexp,zt.link,zt.special(zt.string)],color:"#56b6c2"},{tag:[zt.meta,zt.comment],color:Cr},{tag:zt.strong,fontWeight:"bold"},{tag:zt.emphasis,fontStyle:"italic"},{tag:zt.strikethrough,textDecoration:"line-through"},{tag:zt.link,color:Cr,textDecoration:"underline"},{tag:zt.heading,fontWeight:"bold",color:xr},{tag:[zt.atom,zt.bool,zt.special(zt.variableName)],color:_r},{tag:[zt.processingInstruction,zt.string,zt.inserted],color:"#98c379"},{tag:zt.invalid,color:"#ffffff"}]),Or=[Er,Pt(Lr)],Ir={encodeCharacter:e=>e,encodeNodeStart:e=>e.type.name,encodeNodeEnd:e=>-function(e){let t=e.schema.cached.changeSetIDs||(e.schema.cached.changeSetIDs=Object.create(null)),n=t[e.name];return null==n&&(t[e.name]=n=Object.keys(e.schema.nodes).indexOf(e.name)+1),n}(e.type),compareTokens:(e,t)=>e===t};function Rr(e,t,n,r,o){for(let i=0,a=0;i<e.childCount;i++){let s=e.child(i),l=a+s.nodeSize,c=Math.max(a,n),d=Math.min(l,r);if(c<d)if(s.isText)for(let e=c;e<d;e++)o.push(t.encodeCharacter(s.text.charCodeAt(e-a),s.marks));else s.isLeaf?o.push(t.encodeNodeStart(s)):(c==a&&o.push(t.encodeNodeStart(s)),Rr(s.content,t,Math.max(a+1,c)-a-1,Math.min(l-1,d)-a-1,o),d==l&&o.push(t.encodeNodeEnd(s)));a=l}return o}function Pr(e,t){return Math.min(15,Math.max(2,Math.floor(Math.max(e,t)/10)))}function Br(e,t,n,r=Ir){let o=Rr(e,r,n.fromA,n.toA,[]),i=Rr(t,r,n.fromB,n.toB,[]),a=0,s=o.length,l=i.length,c=r.compareTokens;for(;a<o.length&&a<i.length&&c(o[a],i[a]);)a++;if(a==o.length&&a==i.length)return[];for(;s>a&&l>a&&c(o[s-1],i[l-1]);)s--,l--;if(s==a||l==a||s==l&&s==a+1)return[n.slice(a,s,a,l)];let d=s-a,u=l-a,h=Math.min(5e3,d+u),p=[],m=[];for(let f=2*(h+1),g=0;g<f;g++)m[g]=-1;for(let f=0;f<=h;f++){for(let e=-f;e<=f;e+=2){let t=m[e+1+h],r=m[e-1+h],g=t<r?r:t+1,v=g+e;for(;g<d&&v<u&&c(o[a+g],i[a+v]);)g++,v++;if(m[e+h]=g,g>=d&&v>=u){let t=[],r=Pr(s-a,l-a),o=-1,i=-1,c=-1,d=-1,u=(e,a,s,l)=>{o>-1&&o<a+r?(o=e,c=s):(o>-1&&t.push(n.slice(o,i,c,d)),o=e,i=a,c=s,d=l)};for(let n=f-1;n>=0;n--){let t=m[e+1+h],r=m[e-1+h];t<r?(e--,g=r+a,v=g+e,u(g,g,v,v+1)):(e++,g=t+a,v=g+e,u(g,g+1,v,v)),m=p[n>>1]}return o>-1&&t.push(n.slice(o,i,c,d)),t.reverse()}}f%2==0&&p.push(m.slice())}return[n.slice(a,s,a,l)]}let zr,Dr=class e{constructor(e,t){this.length=e,this.data=t}cut(t){return t==this.length?this:new e(t,this.data)}static slice(t,n,r){if(n==r)return e.none;if(0==n&&r==e.len(t))return t;let o=[];for(let e=0,i=0;i<r;e++){let a=t[e],s=i+a.length,l=Math.min(r,s)-Math.max(n,i);l>0&&o.push(a.cut(l)),i=s}return o}static join(t,n,r){if(0==t.length)return n;if(0==n.length)return t;let o=r(t[t.length-1].data,n[0].data);if(null==o)return t.concat(n);let i=t.slice(0,t.length-1);i.push(new e(t[t.length-1].length+n[0].length,o));for(let e=1;e<n.length;e++)i.push(n[e]);return i}static len(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;return t}};Dr.none=[];class Nr{constructor(e,t,n,r,o,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r,this.deleted=o,this.inserted=i}get lenA(){return this.toA-this.fromA}get lenB(){return this.toB-this.fromB}slice(e,t,n,r){return 0==e&&0==n&&t==this.toA-this.fromA&&r==this.toB-this.fromB?this:new Nr(this.fromA+e,this.fromA+t,this.fromB+n,this.fromB+r,Dr.slice(this.deleted,e,t),Dr.slice(this.inserted,n,r))}static merge(e,t,n){if(0==e.length)return t;if(0==t.length)return e;let r=[];for(let o=0,i=0,a=e[0],s=t[0];;){if(!a&&!s)return r;if(a&&(!s||a.toB<s.fromA)){let n=i?t[i-1].toB-t[i-1].toA:0;r.push(0==n?a:new Nr(a.fromA,a.toA,a.fromB+n,a.toB+n,a.deleted,a.inserted)),a=o++==e.length?null:e[o]}else if(s&&(!a||s.toA<a.fromB)){let n=o?e[o-1].toB-e[o-1].toA:0;r.push(0==n?s:new Nr(s.fromA-n,s.toA-n,s.fromB,s.toB,s.deleted,s.inserted)),s=i++==t.length?null:t[i]}else{let l=Math.min(a.fromB,s.fromA),c=Math.min(a.fromA,s.fromA-(o?e[o-1].toB-e[o-1].toA:0)),d=c,u=Math.min(s.fromB,a.fromB+(i?t[i-1].toB-t[i-1].toA:0)),h=u,p=Dr.none,m=Dr.none,f=!1,g=!1;for(;;){let r=a?l>=a.fromB?a.toB:a.fromB:2e8,c=s?l>=s.fromA?s.toA:s.fromA:2e8,u=Math.min(r,c),v=a&&l>=a.fromB,y=s&&l>=s.fromA;if(!v&&!y)break;v&&l==a.fromB&&!f&&(p=Dr.join(p,a.deleted,n),d+=a.lenA,f=!0),v&&!y&&(m=Dr.join(m,Dr.slice(a.inserted,l-a.fromB,u-a.fromB),n),h+=u-l),y&&l==s.fromA&&!g&&(m=Dr.join(m,s.inserted,n),h+=s.lenB,g=!0),y&&!v&&(p=Dr.join(p,Dr.slice(s.deleted,l-s.fromA,u-s.fromA),n),d+=u-l),v&&u==a.toB&&(a=o++==e.length?null:e[o],f=!1),y&&u==s.toA&&(s=i++==t.length?null:t[i],g=!1),l=u}(c<d||u<h)&&r.push(new Nr(c,d,u,h,p,m))}}}static fromJSON(e){return new Nr(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(e=>new Dr(e.length,e.data)),e.inserted.map(e=>new Dr(e.length,e.data)))}toJSON(){return this}}try{zr=new RegExp("[\\p{Alphabetic}_]","u")}catch(ST){}class Hr{constructor(e,t){this.config=e,this.changes=t}addSteps(e,t,n){let r=[];for(let s=0;s<t.length;s++){let e=Array.isArray(n)?n[s]:n,o=0;t[s].forEach((t,n,i,a)=>{r.push(new Nr(t+o,n+o,i,a,t==n?Dr.none:[new Dr(n-t,e)],i==a?Dr.none:[new Dr(a-i,e)])),o=a-i-(n-t)})}if(0==r.length)return this;let o=qr(r,this.config.combine),i=Nr.merge(this.changes,o,this.config.combine),a=i;for(let s=0;s<a.length;s++){let t=a[s];if(t.fromA==t.toA||t.fromB==t.toB||!o.some(e=>e.toB>t.fromB&&e.fromB<t.toB))continue;let n=Br(this.config.doc.content,e.content,t,this.config.encoder);1==n.length&&0==n[0].fromB&&n[0].toB==t.toB-t.fromB||(a==i&&(a=i.slice()),1==n.length?a[s]=n[0]:(a.splice(s,1,...n),s+=n.length-1))}return new Hr(this.config,a)}get startDoc(){return this.config.doc}map(e){let t=t=>{let n=e(t);return n===t.data?t:new Dr(t.length,n)};return new Hr(this.config,this.changes.map(e=>new Nr(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(t),e.inserted.map(t))))}changedRange(e,t){if(e==this)return null;let n=t&&function(e){let t=jr(e);if(!t)return null;let n=jr(e.map(e=>e.invert()).reverse());return{fromA:n.from,toA:n.to,fromB:t.from,toB:t.to}}(t),r=n?n.toB-n.fromB-(n.toA-n.fromA):0;function o(e){return!n||e<=n.fromA?e:e+r}let i=n?n.fromB:2e8,a=n?n.toB:-2e8;function s(e,t=e){i=Math.min(e,i),a=Math.max(t,a)}let l=this.changes,c=e.changes;for(let d=0,u=0;d<l.length&&u<c.length;){let e=l[d],t=c[u];e&&t&&Vr(e,t,o)?(d++,u++):t&&(!e||o(e.fromB)>=t.fromB)?(s(t.fromB,t.toB),u++):(s(o(e.fromB),o(e.toB)),d++)}return i<=a?{from:i,to:a}:null}static create(e,t=(e,t)=>e===t?e:null,n=Ir,r=[]){return new Hr({combine:t,doc:e,encoder:n},r)}}function qr(e,t,n=0,r=e.length){if(r==n+1)return[e[n]];let o=n+r>>1;return Nr.merge(qr(e,t,n,o),qr(e,t,o,r),t)}function jr(e){let t=2e8,n=-2e8;for(let r=0;r<e.length;r++){let o=e[r];2e8!=t&&(t=o.map(t,-1),n=o.map(n,1)),o.forEach((e,r,o,i)=>{t=Math.min(t,o),n=Math.max(n,i)})}return 2e8==t?null:{from:t,to:n}}function Vr(e,t,n){return n(e.fromB)==t.fromB&&n(e.toB)==t.toB&&Fr(e.deleted,t.deleted)&&Fr(e.inserted,t.inserted)}function Fr(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].length!=t[n].length||e[n].data!==t[n].data)return!1;return!0}function $r(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-diff",...t}}),e}function Wr(e,t,n){const r=n.get(e);if(null!=r)return r;const o=[String(t.encodeNodeStart(e))];if(e.isText){const n=e.text;for(let r=0;r<n.length;r++)o.push(":"+String(t.encodeCharacter(n.charCodeAt(r),e.marks)))}else e.content.forEach(e=>{o.push("/"+Wr(e,t,n))});o.push("\\"+String(t.encodeNodeEnd(e)));const i=o.join("");return n.set(e,i),i}function Ur(e,t,n){const r=[];let o=0;return e.content.forEach(e=>{r.push({node:e,offset:o,size:e.nodeSize,signature:Wr(e,n.encoder,n.sigCache)}),o+=e.nodeSize}),{node:e,contentStart:t,content:r}}function Gr(e,t,n){return Nr.fromJSON({fromA:e.fromA+t,toA:e.toA+t,fromB:e.fromB+n,toB:e.toB+n,deleted:e.deleted.map(e=>({length:e.length,data:e.data})),inserted:e.inserted.map(e=>({length:e.length,data:e.data}))})}function Zr(e,t){const n=e.content;if(t<n.length)return e.contentStart+n[t].offset;if(t>0){const r=n[t-1];return e.contentStart+r.offset+r.size}return e.contentStart+e.node.content.size}function Xr(e,t,n){return Nr.fromJSON({fromA:t,toA:t+e.size,fromB:n,toB:n,deleted:[{length:e.size,data:null}],inserted:[]})}function Kr(e,t,n){return Nr.fromJSON({fromA:t,toA:t,fromB:n,toB:n+e.size,deleted:[],inserted:[{length:e.size,data:null}]})}function Yr(e,t,n,r,o){if(e.childCount>500||t.childCount>500)return function(e,t,n,r,o){const i=new h(0,e.content.size,new p(t.content,0,0));return Hr.create(e,void 0,o.encoder).addSteps(t,[i.getMap()],null).changes.map(e=>Gr(e,n,r))}(e,t,n,r,o);const i=Ur(e,n,o),a=Ur(t,r,o),s=function(e,t){const n=e.length,r=t.length,o=Array.from({length:n+1},()=>Array.from({length:r+1},()=>0));for(let l=n-1;l>=0;l--)for(let n=r-1;n>=0;n--)e[l].signature===t[n].signature?o[l][n]=o[l+1][n+1]+1:o[l][n]=Math.max(o[l+1][n],o[l][n+1]);const i=[];let a=0,s=0;for(;a<n&&s<r;)e[a].signature===t[s].signature?(i.push([a,s]),a++,s++):o[a+1][s]>=o[a][s+1]?a++:s++;return i}(i.content,a.content),l=[];let c=0,d=0;for(const[u,h]of s)Jr(i,a,{oldStart:c,oldEnd:u,newStart:d,newEnd:h},o,l),c=u+1,d=h+1;return Jr(i,a,{oldStart:c,oldEnd:i.content.length,newStart:d,newEnd:a.content.length},o,l),l}function Jr(e,t,n,r,o){const i=e.content,a=t.content;let s=n.oldStart,l=n.newStart;for(;s<n.oldEnd||l<n.newEnd;){const c=s<n.oldEnd?i[s]:null,d=l<n.newEnd?a[l]:null,u=c&&d&&c.node.type===d.node.type;if(c&&d&&u)o.push(...Qr(e,t,c,d,r)),s++,l++;else{if(c&&(!d||!u)){const n=e.contentStart+c.offset;o.push(Xr(c,n,Zr(t,l))),s++;continue}if(d){const n=t.contentStart+d.offset;o.push(Kr(d,Zr(e,s),n)),l++}}}}function Qr(e,t,n,r,o){const i=e.contentStart+n.offset,a=t.contentStart+r.offset;return function(e,t){if(e.type!==t.type)return!1;const n=e.type;return!n.isTextblock&&!n.isAtom&&!0!==n.spec.code&&!!n.isBlock}(n.node,r.node)&&function(e,t,n){return n.encodeNodeStart(e)===n.encodeNodeStart(t)}(n.node,r.node,o.encoder)?Yr(n.node,r.node,i+1,a+1,o):function(e,t,n){const r=e.parent.copy(m.from(e.node)),o=t.parent.copy(m.from(t.node)),i=new h(0,r.content.size,new p(o.content,0,0));return Hr.create(r,void 0,n.encoder).addSteps(o,[i.getMap()],null).changes.map(n=>Gr(n,e.abs,t.abs))}({node:n.node,parent:e.node,abs:i},{node:r.node,parent:t.node,abs:a},o)}function eo(e,t,n){const r=function(e={}){const t=new WeakMap,n=new WeakMap;function r(e){let n=t.get(e);if(null!=n)return n;const r=e.attrs,o=r?Object.keys(r).filter(e=>null!=r[e]).sort():[];if(0===o.length)n=e.type.name;else{const t={};for(const e of o)t[e]=r[e];n=`${e.type.name}:${JSON.stringify(t)}`}return t.set(e,n),n}return{encodeCharacter:(e,t)=>{if(0===t.length)return e;let o=n.get(t);return null==o&&(o=t.map(r).join(","),n.set(t,o)),`${e}:${o}`},encodeNodeStart:t=>{const n=t.attrs;if(n&&Object.keys(n).length>0){const r=e[t.type.name]??[],o=Object.keys(n).filter(e=>{if(r.includes(e))return!1;const o=t.type.spec.attrs?.[e]?.default;return n[e]!==o});if(o.length>0){const e={};for(const t of o.sort())e[t]=n[t];return`${t.type.name}:${JSON.stringify(e)}`}}return t.type.name},encodeNodeEnd:e=>{const t=e.type.schema,n=t.cached.changeSetIDs||(t.cached.changeSetIDs=Object.create(null));let r=n[e.type.name];return null==r&&(n[e.type.name]=r=Object.keys(t.nodes).indexOf(e.type.name)+1),-r},compareTokens:(e,t)=>e===t}}(n?.ignoreAttrs),o={encoder:r,sigCache:new WeakMap},i=e.content.size,a=t.content.size,s=n?.range;if(null==s)return Yr(e,t,0,0,o);const l=Math.min(i,a),c=Math.max(0,Math.min(s.from??0,l)),d=Math.max(c,Math.min(s.to??l,l));if(c===d)return[];if(0===c&&d===l&&i===a)return Yr(e,t,0,0,o);const u=function(e,t,n,r,o){const i=e.resolve(n),a=e.resolve(r),s=t.resolve(n),l=t.resolve(r),c=i.sharedDepth(r);if(s.sharedDepth(r)!==c)throw new RangeError(`computeDocDiff: range [${n}, ${r}) resolves to different sharedDepth in old and new docs`);for(let f=0;f<=c;f++){if(o.encodeNodeStart(i.node(f))!==o.encodeNodeStart(s.node(f)))throw new RangeError(`computeDocDiff: ancestor at depth ${f} differs in type or non-ignored attrs along the path to the shared ancestor`);if(i.start(f)!==s.start(f))throw new RangeError(`computeDocDiff: ancestor at depth ${f} starts at different absolute positions in old and new docs (content before the range differs in size)`)}const d=i.node(c);if(d.isTextblock)throw new RangeError(`computeDocDiff: range [${n}, ${r}) lands inside a textblock; widen the range to a block boundary`);if(i.depth!==c||a.depth!==c||s.depth!==c||l.depth!==c)throw new RangeError(`computeDocDiff: range [${n}, ${r}) endpoints must be aligned to child boundaries of the shared ancestor`);const u=s.node(c),h=i.start(c),p=n-h,m=r-h;return{oldCut:d.copy(d.content.cut(p,m)),newCut:u.copy(u.content.cut(p,m)),cutAbsStart:n}}(e,t,c,d,r);return Yr(u.oldCut,u.newCut,u.cutAbsStart,u.cutAbsStart,o)}Hr.computeDiff=Br;var to=a({ignoreAttrs:{heading:["id"]}},"diffConfig");$r(to,{displayName:"Ctx<diffConfig>",group:"Diff"});var no=new d("MILKDOWN_DIFF");function ro(e){return e.changes.filter(t=>!function(e,t){return t.some(t=>e.fromB<t.toB&&e.toB>t.fromB)}(t,e.rejectedRanges))}var oo=s(e=>{const t=e.get(to.key);return new c({key:no,state:{init:()=>null,apply(e,n,r,o){const i=e.getMeta(no);if(!n){if("start"===i?.type){const e=eo(o.doc,i.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:i.newDoc,changes:e,rejectedRanges:[],active:!0}}return null}let a,s=n;if(e.docChanged&&s.active&&(s=function(e,t,n){const r=eo(e,t.newDoc,n);return{...t,changes:r}}(o.doc,s,{ignoreAttrs:t.ignoreAttrs})),!i)return s;switch(i.type){case"start":{const e=eo(o.doc,i.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:i.newDoc,changes:e,rejectedRanges:[],active:!0}}case"accept":case"acceptRange":a=s;break;case"reject":a={...s,rejectedRanges:[...s.rejectedRanges,{fromB:i.fromB,toB:i.toB}]};break;case"rejectRange":a={...s,rejectedRanges:[...s.rejectedRanges,{fromB:i.range.fromB,toB:i.range.toB}]};break;case"acceptAll":case"clear":return null;default:return s}return a.active&&0===ro(a).length?null:a}},filterTransaction:(e,t)=>!no.getState(t)?.active||!!e.getMeta(no)||!e.docChanged})});$r(oo,{displayName:"Prose<diff>",group:"Diff"});var io=l("StartDiffReview",e=>t=>(n,r)=>{if(null==t)return!1;const o=e.get(u)(t);return!!o&&(r&&r(n.tr.setMeta(no,{type:"start",newDoc:o})),!0)});$r(io,{displayName:"Command<startDiffReview>",group:"Diff"});var ao=l("StartDiffReviewFromDoc",()=>e=>(t,n)=>!!e&&e.type===t.doc.type&&(n&&n(t.tr.setMeta(no,{type:"start",newDoc:e})),!0));$r(ao,{displayName:"Command<startDiffReviewFromDoc>",group:"Diff"});var so=l("AcceptDiffChunk",()=>e=>(t,n)=>{if(null==e)return!1;const r=no.getState(t);if(!r)return!1;const o=ro(r)[e];if(!o)return!1;if(n){const i=r.newDoc.slice(o.fromB,o.toB);let a=t.tr.replace(o.fromA,o.toA,i);a=a.setMeta(no,{type:"accept",changeIndex:e}),n(a)}return!0});$r(so,{displayName:"Command<acceptDiffChunk>",group:"Diff"});var lo=l("RejectDiffChunk",()=>e=>(t,n)=>{if(null==e)return!1;const r=no.getState(t);if(!r)return!1;const o=ro(r)[e];return!!o&&(n&&n(t.tr.setMeta(no,{type:"reject",fromB:o.fromB,toB:o.toB})),!0)});$r(lo,{displayName:"Command<rejectDiffChunk>",group:"Diff"});var co=l("AcceptDiffRange",()=>e=>(t,n)=>{if(!e)return!1;const r=no.getState(t);if(!r)return!1;if(n){const o=r.newDoc.slice(e.fromB,e.toB);let i=t.tr.replace(e.fromA,e.toA,o);i=i.setMeta(no,{type:"acceptRange",range:e}),n(i)}return!0});$r(co,{displayName:"Command<acceptDiffRange>",group:"Diff"});var uo=l("RejectDiffRange",()=>e=>(t,n)=>!!e&&!!no.getState(t)&&(n&&n(t.tr.setMeta(no,{type:"rejectRange",range:e})),!0));$r(uo,{displayName:"Command<rejectDiffRange>",group:"Diff"});var ho=l("AcceptAllDiffs",()=>()=>(e,t)=>{const n=no.getState(e);return!!n&&(t&&t((0===n.rejectedRanges.length?e.tr.replaceWith(0,e.doc.content.size,n.newDoc.content):function(e,t){const n=ro(t);for(let r=n.length-1;r>=0;r--){const o=n[r],i=t.newDoc.slice(o.fromB,o.toB);e=e.replace(o.fromA,o.toA,i)}return e}(e.tr,n)).setMeta(no,{type:"acceptAll"})),!0)});$r(ho,{displayName:"Command<acceptAllDiffs>",group:"Diff"});var po=l("ClearDiffReview",()=>()=>(e,t)=>!!no.getState(e)&&(t&&t(e.tr.setMeta(no,{type:"clear"})),!0));$r(po,{displayName:"Command<clearDiffReview>",group:"Diff"});var mo=[to,oo,io,ao,so,co,lo,uo,ho,po],fo=Object.defineProperty,go=Object.getOwnPropertySymbols,vo=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable,bo=(e,t,n)=>t in e?fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wo=(e,t)=>{for(var n in t||(t={}))vo.call(t,n)&&bo(e,n,t[n]);if(go)for(var n of go(t))yo.call(t,n)&&bo(e,n,t[n]);return e};function xo(e,t){return Object.assign(e,{meta:wo({package:"@milkdown/components"},t)}),e}const ko="milkdown-diff",Co=a({acceptLabel:"Accept",rejectLabel:"Reject",customBlockTypes:[]},"diffComponentConfig");function _o(e,t,n){if(t===n)return!1;const r=e.resolve(t),o=e.resolve(n);return r.index(0)!==(0===o.depth?Math.max(0,o.index(0)-1):o.index(0))}function So(e,t,n){if(t>=n)return!1;const r=e.resolve(t),o=e.resolve(n);if(r.sameParent(o)&&r.parent.isTextblock)return!1;let i=!1;return e.nodesBetween(t,n,(e,r)=>{if(i)return!1;if(!e.isBlock)return!0;const o=r+e.nodeSize;return!(r>=t&&o<=n&&(i=!0,1))}),i}function Ao(e,t,n){if(n!==e.content.size)return!1;const r=e.resolve(t);if(0!==r.depth)return!1;for(let o=r.index(0);o<e.childCount;o++){const t=e.child(o);if("paragraph"!==t.type.name||t.content.size>0)return!1}return!0}function Mo(e,t){const n=e.resolve(t);for(let r=n.depth;r>=1;r--)if(n.node(r).isTextblock)return n.before(r);return t}function To(e,t,n,r){let o=0;for(let i=0;i<e.childCount;i++){const a=e.child(i),s=o+a.nodeSize;if(o>=n)break;s>t&&o<n&&r(a,o,s),o=s}}function Eo(e,t,n,r){To(e,t,n,(t,n,o)=>{o===e.content.size&&"paragraph"===t.type.name&&0===t.content.size||r.push(v.node(n,o,{class:`${ko}-removed-block`}))})}function Lo(e,t,n=!1){if(t<0||t>e.content.size)return null;const r=e.resolve(Math.min(t,e.content.size));if(r.depth>=1)return{from:r.before(1),to:r.after(1)};if(n){const e=r.nodeBefore;if(e)return{from:t-e.nodeSize,to:t};const n=r.nodeAfter;if(n)return{from:t,to:t+n.nodeSize}}else{const e=r.nodeAfter;if(e)return{from:t,to:t+e.nodeSize};const n=r.nodeBefore;if(n)return{from:t-n.nodeSize,to:t}}return null}function Oo(e,t,n){if(t<0||t>e.content.size)return null;const r=e.resolve(Math.min(t,e.content.size));for(let o=r.depth;o>=0;o--){const e=r.node(o).type.name;if(n.has(e))return e}return null}function Io(e,t,n,r=!1){const o=Oo(e,t,n);if(o)return o;const i=e.resolve(Math.min(Math.max(t,0),e.content.size)),a=r?i.nodeBefore:i.nodeAfter;return a&&n.has(a.type.name)?a.type.name:null}function Ro(e,t,n,r){return e<r&&t>n}function Po(e,t,n,r){return t===n?null!=Oo(e,t,r):null!=Io(e,t,r)||null!=Io(e,n,r,!0)}function Bo(e,t,n){const r=e.resolve(n.fromA);if(!r.parent.isTextblock||r.depth<1)return null;if(!r.node(1).isTextblock)return null;const o=r.after(1),i=t.resolve(n.fromB);let a;if(i.depth>=1&&i.node(1).isTextblock?(a=i.after(1),a>n.toB&&(a=n.toB)):a=n.fromB,o>=n.toA&&a>=n.toB)return null;const s=[];return(o>n.fromA||a>n.fromB)&&s.push({fromA:n.fromA,toA:Math.min(o,n.toA),fromB:n.fromB,toB:a,isBlock:!1}),(n.toA>o||n.toB>a)&&s.push({fromA:o,toA:Math.max(o,n.toA),fromB:a,toB:n.toB,isBlock:!0}),s.length>1?s:null}function zo(e,t,n,r){return Po(t,e.fromA,e.toA,r)||Po(n,e.fromB,e.toB,r)}function Do(e,t,n,r){return t===n?null==Oo(e,t,r)?null:Lo(e,t):null!=Io(e,t,r)?Lo(e,t):null!=Io(e,n,r,!0)?Lo(e,n,!0):null}xo(Co,{displayName:"Ctx<diffComponentConfig>",group:"DiffComponent"});const No=new d("MILKDOWN_DIFF_DECORATION"),Ho=s(e=>{const t=e.get(Co.key);return new c({key:No,state:{init:()=>f.empty,apply(n,r,o,i){const a=no.getState(i);return(null==a?void 0:a.active)?n.getMeta(no)||n.docChanged?function(e,t,n,r){const o=[],i=e.get(g),a=new Set(r.customBlockTypes),s=function(e,t,n,r){var o,i,a,s;const l=[],c=new Set;for(let d=0;d<e.length;d++){if(c.has(d))continue;const u=e[d];if(!zo(u,t,n,r)){l.push({fromA:u.fromA,toA:u.toA,fromB:u.fromB,toB:u.toB,isCustomBlock:!1});continue}const h=Do(t,u.fromA,u.toA,r),p=Do(n,u.fromB,u.toB,r),m={fromA:Math.min(null!=(o=null==h?void 0:h.from)?o:u.fromA,u.fromA),toA:Math.max(null!=(i=null==h?void 0:h.to)?i:u.toA,u.toA),fromB:Math.min(null!=(a=null==p?void 0:p.from)?a:u.fromB,u.fromB),toB:Math.max(null!=(s=null==p?void 0:p.to)?s:u.toB,u.toB),isCustomBlock:!0};c.add(d);for(let t=d+1;t<e.length;t++){if(c.has(t))continue;const n=e[t],r=h&&Ro(n.fromA,n.toA,h.from,h.to),o=p&&Ro(n.fromB,n.toB,p.from,p.to);(r||o)&&(c.add(t),m.fromA=Math.min(m.fromA,n.fromA),m.toA=Math.max(m.toA,n.toA),m.fromB=Math.min(m.fromB,n.fromB),m.toB=Math.max(m.toB,n.toB))}const f=[];for(let e=0;e<l.length;e++){const t=l[e];if(!t.isCustomBlock)continue;const n=Ro(m.fromA,m.toA,t.fromA,t.toA),r=Ro(m.fromB,m.toB,t.fromB,t.toB);(n||r)&&(m.fromA=Math.min(m.fromA,t.fromA),m.toA=Math.max(m.toA,t.toA),m.fromB=Math.min(m.fromB,t.fromB),m.toB=Math.max(m.toB,t.toB),f.push(e))}for(let e=f.length-1;e>=0;e--)l.splice(f[e],1);l.push(m)}return l}(ro(n),t,n.newDoc,a);!function(e,t){const n=function(e){let t=e.content.size;for(let n=e.childCount-1;n>=0;n--){const r=e.child(n);if("paragraph"!==r.type.name||r.content.size>0)break;t-=r.nodeSize}return t}(t);if(n!==t.content.size)for(const r of e)r.fromA===r.toA&&r.fromB<r.toB&&r.fromA>=n&&(r.fromA=n,r.toA=n)}(s,t);for(let l=0;l<s.length;l++){const e=s[l],a=e.fromA<e.toA,c=e.fromB<e.toB;if(a&&!c&&Ao(t,e.fromA,e.toA))continue;const d=a&&_o(t,e.fromA,e.toA),u=a&&So(t,e.fromA,e.toA),h=c&&So(n.newDoc,e.fromB,e.toB),p=a&&!d&&!u&&!e.isCustomBlock&&!h,m=(d||u||h)&&!p;if(m&&!e.isCustomBlock){const a=Bo(t,n.newDoc,e);if(a){qo({doc:t,newDoc:n.newDoc,segments:a,change:e,changeIndex:l,commands:i,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel,decorations:o});continue}}a&&(e.isCustomBlock||m?Eo(t,e.fromA,e.toA,o):o.push(v.inline(e.fromA,e.toA,{class:`${ko}-removed`})));const f=a?e.toA:e.fromA,g=m?Mo(t,f):f;if(c){const t=jo(n.newDoc,e,m);o.push(v.widget(g,t,{side:-1,key:`added-${l}`}))}const y=Vo({commands:i,isBlockLevel:m,change:e,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel});o.push(v.widget(g,y,{side:m?-1:1,key:`controls-${l}`}))}return f.create(t,o)}(e,i.doc,a,t):r.map(n.mapping,n.doc):f.empty}},props:{decorations(e){var t;return null!=(t=No.getState(e))?t:f.empty}}})});function qo({doc:e,newDoc:t,segments:n,change:r,changeIndex:o,commands:i,acceptLabel:a,rejectLabel:s,decorations:l}){for(let h=0;h<n.length;h++){const r=n[h],i=r.fromA<r.toA,a=r.fromB<r.toB;if(i&&(r.isBlock?Eo(e,r.fromA,r.toA,l):l.push(v.inline(r.fromA,r.toA,{class:`${ko}-removed`}))),a){const n=r.isBlock?Mo(e,i?r.toA:r.fromA):i?r.toA:r.fromA,a=jo(t,r,r.isBlock);l.push(v.widget(n,a,{side:-1,key:`added-${o}-${h}`}))}}const c=n[n.length-1],d=Mo(e,c.isBlock?c.fromA<c.toA?c.toA:c.fromA:r.toA),u=Vo({commands:i,isBlockLevel:!0,change:r,acceptLabel:a,rejectLabel:s});l.push(v.widget(d,u,{side:-1,key:`controls-${o}`}))}function jo(e,t,n){var r;const o=document.createElement(n?"div":"span");o.className=`${ko}-added`,o.contentEditable="false",n&&o.classList.add(`${ko}-added-block`);const i=y.fromSchema(e.type.schema);if(n){const n=function(e,t,n){const r=[];let o=!0,i=-1,a=-1;return To(e,t,n,(e,t,n)=>{-1===i&&(i=t),a=n,r.push(e)}),0!==r.length&&i===t&&a===n||(o=!1),o?r:[]}(e,t.fromB,t.toB);if(n.length>0){const e=document.createDocumentFragment();for(const t of n)e.appendChild(i.serializeNode(t));return o.appendChild(e),o}}const a=e.slice(t.fromB,t.toB),s=i.serializeFragment(a.content);if(o.appendChild(s),!(null==(r=o.textContent)?void 0:r.trim())&&!o.querySelector("img, video, audio, canvas, svg")){const n=e.textBetween(t.fromB,t.toB,"\n","\n");n.trim()&&(o.textContent=n)}return o}function Vo({commands:e,isBlockLevel:t,change:n,acceptLabel:r,rejectLabel:o}){const i=document.createElement(t?"div":"span");i.className=`${ko}-controls`,i.contentEditable="false",t&&i.classList.add(`${ko}-controls-block`);const a=t=>r=>{r.preventDefault(),r.stopPropagation();const o={fromA:n.fromA,toA:n.toA,fromB:n.fromB,toB:n.toB},i="accept"===t?co.key:uo.key;e.call(i,o)},s=document.createElement("button");s.className=`${ko}-accept`,s.textContent=r,s.addEventListener("click",a("accept"));const l=document.createElement("button");return l.className=`${ko}-reject`,l.textContent=o,l.addEventListener("click",a("reject")),i.appendChild(s),i.appendChild(l),i}xo(Ho,{displayName:"Prose<diffDecoration>",group:"DiffComponent"});const Fo=[Co,Ho];function $o(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-streaming",...t}}),e}var Wo=a({throttleMs:100,scrollFollow:!0,diffReviewOnEnd:!1,ignoreAttrs:{heading:["id"]}},"streamingConfig");function Uo(e){if(e.parent.type.spec.code)return{type:"plain-text",preserveNewlines:!0};for(let t=e.depth;t>0;t--)if("table"===e.node(t).type.name)return{type:"plain-text",preserveNewlines:!1};return e.depth>=1?{type:"split-block"}:{type:"block"}}function Go(e){if(0===e.childCount)return e;const t=e.lastChild;return"paragraph"===t.type.name&&0===t.content.size?e.cut(0,e.size-t.nodeSize):e}$o(Wo,{displayName:"Ctx<streamingConfig>",group:"Streaming"});var Zo=/[*_~`[\\<]/;function Xo(e,t,n){if(!n)return m.empty;if(!Zo.test(n))return m.from(t.text(n));const r=e.get(u)(n)?.firstChild;if("paragraph"!==r?.type.name||0===r.content.size)return m.from(t.text(n));let o=!1;if(r.content.forEach(e=>{(!e.isText||e.marks.length>0)&&(o=!0)}),!o)return m.from(t.text(n));let i=r.content;const a=/^\s+/.exec(n)?.[0];a&&((i.firstChild?.isText?i.firstChild.text??"":"").startsWith(a)||(i=m.from(t.text(a)).append(i)));const s=/\s+$/.exec(n)?.[0];return s&&((i.lastChild?.isText?i.lastChild.text??"":"").endsWith(s)||(i=i.append(m.from(t.text(s))))),i}function Ko(e,t,n){if(null!=n.insertPos){const r=n.insertPos,o=function(e,t,n){const{insertPos:r,currentEndPos:o}=n,i=n.buffer.replace(/\r\n?/g,"\n");if(!i)return{tr:t,applied:!1,insertEndPos:o};const a=t.doc.content.size,s=Math.max(0,Math.min(r,a)),l=Math.max(s,Math.min(o,a)),c=t.doc.resolve(s),d=(e.get(Wo.key).insertStrategy??Uo)(c),h={ctx:e,tr:t,buffer:i,from:s,to:l,resolved:c};switch(d.type){case"plain-text":return function({tr:e,buffer:t,from:n,to:r},o){const i=o?t:t.replace(/\n/g," "),a=e.doc.type.schema.text(i);return{tr:e=e.replaceWith(n,r,a),applied:!0,insertEndPos:n+i.length}}(h,d.preserveNewlines??!1);case"split-block":return function({ctx:e,tr:t,buffer:n,from:r,to:o,resolved:i}){const a=t.doc.type.schema,s=n.indexOf("\n");if(s<0){const i=Xo(e,a,n);return{tr:t=t.replaceWith(r,o,i),applied:!0,insertEndPos:r+i.size}}const l=n.substring(0,s),c=n.substring(s+1),d=e.get(u),h=c.trim()?d(c):null,f=h?Go(h.content):m.empty;if(0===f.childCount){const i=Xo(e,a,n.replace(/\n/g," "));return{tr:t=t.replaceWith(r,o,i),applied:!0,insertEndPos:r+i.size}}const g=i.depth;let v=Xo(e,a,l);for(let u=g;u>0;u--)v=m.from(i.node(u).copy(v));const y=v.append(f),b=new p(y,g,0),w=t.doc.content.size,x=t.doc.resolve(Math.min(o,w));let k=o;return g>0&&x.depth===g&&x.parentOffset===x.parent.content.size&&(k=x.after(g)),{tr:t=t.replace(r,k,b),applied:!0,insertEndPos:r+(y.size-g)}}(h);case"block":return function({ctx:e,tr:t,buffer:n,from:r,to:o}){const i=e.get(u)(n);if(!i)return{tr:t,applied:!1,insertEndPos:o};const a=Go(i.content);return 0===a.size?{tr:t,applied:!1,insertEndPos:o}:{tr:t=t.replace(r,o,new p(a,0,0)),applied:!0,insertEndPos:r+a.size}}(h)}}(e,t,{buffer:n.buffer,insertPos:r,currentEndPos:n.insertEndPos??r});return{tr:o.tr,newDoc:o.applied?o.tr.doc:null,insertEndPos:o.insertEndPos}}return function(e,t,n){const r=e.get(u)(n);if(!r)return{tr:t,newDoc:null};const o=e.get(Wo.key).ignoreAttrs,i=eo(t.doc,r,o?{ignoreAttrs:o}:void 0);for(let a=i.length-1;a>=0;a--){const e=i[a],n=r.slice(e.fromB,e.toB);t=t.replace(e.fromA,e.toA,n)}return{tr:t,newDoc:r}}(e,t,n.buffer)}var Yo=new d("MILKDOWN_STREAMING"),Jo=s(e=>{const t=e.get(Wo.key);return new c({key:Yo,state:{init:()=>null,apply:(e,t)=>function(e,t){if(!e&&"start"!==t?.type)return null;if(!t)return e;switch(t.type){case"start":return{buffer:"",originalDoc:t.originalDoc,active:!0,lastApplyTime:t.lastApplyTime,insertPos:t.insertPos??null,insertEndPos:t.insertEndPos??t.insertPos??null};case"push":return e?{...e,buffer:e.buffer+t.token}:null;case"apply":return e?{...e,lastApplyTime:t.lastApplyTime,insertEndPos:t.insertEndPos??e.insertEndPos}:null;case"end":case"abort":return null;default:return e}}(t,e.getMeta(Yo))},filterTransaction:(e,t)=>!Yo.getState(t)?.active||!!e.getMeta(Yo)||!e.docChanged,view:()=>function(e,t){let n=null,r=-1,o=null;function i(){if(!o)return;const n=Yo.getState(o.state);if(!n?.active||n.buffer.length===r)return;r=n.buffer.length;const i=Ko(e,o.state.tr,n);if(!i.newDoc)return;let a=i.tr;(a.docChanged||null!=i.insertEndPos)&&(a=a.setMeta(Yo,{type:"apply",lastApplyTime:Date.now(),insertEndPos:i.insertEndPos}),t.scrollFollow&&(a=a.scrollIntoView()),o.dispatch(a))}return{update(e){o=e;const a=Yo.getState(e.state);if(!a?.active)return null!=n&&(clearTimeout(n),n=null),void(r=-1);a.buffer.length!==r&&(Date.now()-a.lastApplyTime>=t.throttleMs?i():(null!=n&&clearTimeout(n),n=setTimeout(i,t.throttleMs)))},destroy(){null!=n&&(clearTimeout(n),n=null),o=null}}}(e,t)})});$o(Jo,{displayName:"Prose<streaming>",group:"Streaming"});var Qo=l("StartStreaming",()=>e=>(t,n)=>{if(Yo.getState(t)?.active)return!1;if(n){let r,o;if(null!=e?.insertAt)if("selection"===e.insertAt){if(r=t.selection.from,o=t.selection.to,t.selection.empty){const e=t.doc.resolve(r);e.parent.isTextblock&&!e.parent.type.spec.code&&0===e.parent.content.size&&1===e.depth&&(r=e.before(e.depth),o=e.after(e.depth))}}else{const n="cursor"===e.insertAt?t.selection.head:e.insertAt;if(!Number.isFinite(n))return!1;r=Math.max(0,Math.min(Math.round(n),t.doc.content.size));const i=t.doc.resolve(r);i.parent.isTextblock&&!i.parent.type.spec.code&&0===i.parent.content.size&&1===i.depth&&(r=i.before(i.depth),o=i.after(i.depth))}n(t.tr.setMeta(Yo,{type:"start",originalDoc:t.doc,insertPos:r,insertEndPos:o,lastApplyTime:Date.now()}))}return!0});$o(Qo,{displayName:"Command<startStreaming>",group:"Streaming"});var ei=l("PushChunk",()=>e=>(t,n)=>null!=e&&!!Yo.getState(t)?.active&&(n&&n(t.tr.setMeta(Yo,{type:"push",token:e})),!0));$o(ei,{displayName:"Command<pushChunk>",group:"Streaming"});var ti=l("EndStreaming",e=>t=>(n,r)=>{const o=Yo.getState(n);if(!o?.active)return!1;if(r){const a=e.get(Wo.key),s=t?.diffReview??a.diffReviewOnEnd,l=Ko(e,n.tr,o);let c=l.tr;if(c=c.setMeta(Yo,{type:"end"}),s&&l.newDoc){const t=c.doc;c=c.replace(0,c.doc.content.size,new p(o.originalDoc.content,0,0)),r(c);try{e.get(g).call(ao.key,t)}catch(i){console.warn("[milkdown/streaming] diff review handoff skipped:",i)}return!0}r(c)}return!0});$o(ti,{displayName:"Command<endStreaming>",group:"Streaming"});var ni=l("AbortStreaming",e=>t=>(n,r)=>{const o=Yo.getState(n);if(!o?.active)return!1;if(r){const i=t?.keep??!1;let a=n.tr;a=i?Ko(e,a,o).tr:a.replace(0,n.doc.content.size,new p(o.originalDoc.content,0,0)),a=a.setMeta(Yo,{type:"abort"}),r(a)}return!0});$o(ni,{displayName:"Command<abortStreaming>",group:"Streaming"});var ri=[Wo,Jo,Qo,ei,ti,ni],oi=class{#e;#t;#n;#r;#o;#i;#a;#s;#l;#c;constructor(e){this.#i=!1,this.onShow=()=>{},this.onHide=()=>{},this.#d=e=>{b(e,this.element,{placement:this.#r.placement??"top",middleware:[w(),x(this.#s),k(this.#l),...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error)},this.#u=e=>this.#o!==e.dom.parentElement,this.#h=(e,t)=>{const{state:n,composing:r}=e,{selection:o,doc:i}=n,{ranges:a}=o,s=Math.min(...a.map(e=>e.$from.pos)),l=Math.max(...a.map(e=>e.$to.pos)),c=t&&t.doc.eq(i)&&t.selection.eq(o);if(this.#i||((this.#o??e.dom.parentElement??document.body).appendChild(this.element),this.#i=!0),r||c)return;if(this.#a?.(),this.#a=void 0,!this.#t(e,t))return void this.hide();const d={getBoundingClientRect:()=>_(e,s,l),contextElement:e.dom};this.#u(e)?this.#a=C(d,this.element,()=>this.#d(d)):this.#d(d),this.show()},this.update=(e,t)=>{this.#c(e,t)},this.#p=e=>{const{doc:t,selection:n}=e.state,{empty:r,from:o,to:i}=n,a=!t.textBetween(o,i).length&&e.state.selection instanceof S,s=this.element.contains(document.activeElement),l=!e.hasFocus()&&!s,c=!e.editable;return!(l||r||a||c)},this.destroy=()=>{this.#a?.(),this.#c.cancel()},this.show=(e,t)=>{if(this.element.dataset.show="true",e){this.#a?.(),this.#a=void 0;const n={...e,contextElement:t?.dom};t&&this.#u(t)?this.#a=C(n,this.element,()=>this.#d(n)):this.#d(n)}this.onShow()},this.hide=()=>{"false"!==this.element.dataset.show&&(this.element.dataset.show="false",this.onHide())},this.element=e.content,this.#e=e.debounce??200,this.#t=e.shouldShow??this.#p,this.#s=e.offset,this.#l=e.shift,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#o=e.root,this.element.dataset.show="false",this.#c=vr(this.#h,this.#e)}#d;#u;#h;#p};function ii(e){const t=a({},`${e}_TOOLTIP_SPEC`),n=s(n=>{const r=n.get(t.key);return new c({key:new d(`${e}_TOOLTIP`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${e}`},n.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${e}`},r}function ai(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const si={},li=[],ci=()=>{},di=()=>!1,ui=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),hi=e=>e.startsWith("onUpdate:"),pi=Object.assign,mi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},fi=Object.prototype.hasOwnProperty,gi=(e,t)=>fi.call(e,t),vi=Array.isArray,yi=e=>"[object Map]"===Ai(e),bi=e=>"[object Date]"===Ai(e),wi=e=>"function"==typeof e,xi=e=>"string"==typeof e,ki=e=>"symbol"==typeof e,Ci=e=>null!==e&&"object"==typeof e,_i=e=>(Ci(e)||wi(e))&&wi(e.then)&&wi(e.catch),Si=Object.prototype.toString,Ai=e=>Si.call(e),Mi=e=>xi(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,Ti=ai(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ei=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Li=/-\w/g,Oi=Ei(e=>e.replace(Li,e=>e.slice(1).toUpperCase())),Ii=/\B([A-Z])/g,Ri=Ei(e=>e.replace(Ii,"-$1").toLowerCase()),Pi=Ei(e=>e.charAt(0).toUpperCase()+e.slice(1)),Bi=Ei(e=>e?`on${Pi(e)}`:""),zi=(e,t)=>!Object.is(e,t),Di=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Ni=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Hi=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let qi;const ji=()=>qi||(qi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function Vi(e){if(vi(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=xi(r)?Ui(r):Vi(r);if(o)for(const e in o)t[e]=o[e]}return t}if(xi(e)||Ci(e))return e}const Fi=/;(?![^(]*\))/g,$i=/:([^]+)/,Wi=/\/\*[^]*?\*\//g;function Ui(e){const t={};return e.replace(Wi,"").split(Fi).forEach(e=>{if(e){const n=e.split($i);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Gi(e){let t="";if(xi(e))t=e;else if(vi(e))for(let n=0;n<e.length;n++){const r=Gi(e[n]);r&&(t+=r+" ")}else if(Ci(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Zi=ai("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Xi(e){return!!e||""===e}function Ki(e,t){if(e===t)return!0;let n=bi(e),r=bi(t);if(n||r)return!(!n||!r)&&e.getTime()===t.getTime();if(n=ki(e),r=ki(t),n||r)return e===t;if(n=vi(e),r=vi(t),n||r)return!(!n||!r)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ki(e[r],t[r]);return n}(e,t);if(n=Ci(e),r=Ci(t),n||r){if(!n||!r)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const r=e.hasOwnProperty(n),o=t.hasOwnProperty(n);if(r&&!o||!r&&o||!Ki(e[n],t[n]))return!1}}return String(e)===String(t)}let Yi,Ji;class Qi{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Yi,!e&&Yi&&(this.index=(Yi.scopes||(Yi.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Yi;try{return Yi=this,e()}finally{Yi=t}}}on(){1===++this._on&&(this.prevScope=Yi,Yi=this)}off(){this._on>0&&0===--this._on&&(Yi=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const ea=new WeakSet;class ta{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Yi&&Yi.active&&Yi.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,ea.has(this)&&(ea.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||ia(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,ya(this),la(this);const e=Ji,t=ma;Ji=this,ma=!0;try{return this.fn()}finally{ca(this),Ji=e,ma=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)ha(e);this.deps=this.depsTail=void 0,ya(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?ea.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){da(this)&&this.run()}get dirty(){return da(this)}}let na,ra,oa=0;function ia(e,t=!1){if(e.flags|=8,t)return e.next=ra,void(ra=e);e.next=na,na=e}function aa(){oa++}function sa(){if(--oa>0)return;if(ra){let e=ra;for(ra=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;na;){let n=na;for(na=void 0;n;){const r=n.next;if(n.next=void 0,n.flags&=-9,1&n.flags)try{n.trigger()}catch(t){e||(e=t)}n=r}}if(e)throw e}function la(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ca(e){let t,n=e.depsTail,r=n;for(;r;){const e=r.prevDep;-1===r.version?(r===n&&(n=e),ha(r),pa(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function da(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ua(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ua(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===ba)return;if(e.globalVersion=ba,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!da(e)))return;e.flags|=2;const t=e.dep,n=Ji,r=ma;Ji=e,ma=!0;try{la(e);const n=e.fn(e._value);(0===t.version||zi(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(o){throw t.version++,o}finally{Ji=n,ma=r,ca(e),e.flags&=-3}}function ha(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)ha(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function pa(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let ma=!0;const fa=[];function ga(){fa.push(ma),ma=!1}function va(){const e=fa.pop();ma=void 0===e||e}function ya(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=Ji;Ji=void 0;try{t()}finally{Ji=e}}}let ba=0;class wa{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class xa{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Ji||!ma||Ji===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==Ji)t=this.activeLink=new wa(Ji,this),Ji.deps?(t.prevDep=Ji.depsTail,Ji.depsTail.nextDep=t,Ji.depsTail=t):Ji.deps=Ji.depsTail=t,ka(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Ji.depsTail,t.nextDep=void 0,Ji.depsTail.nextDep=t,Ji.depsTail=t,Ji.deps===t&&(Ji.deps=e)}return t}trigger(e){this.version++,ba++,this.notify(e)}notify(e){aa();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{sa()}}}function ka(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)ka(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ca=new WeakMap,_a=Symbol(""),Sa=Symbol(""),Aa=Symbol("");function Ma(e,t,n){if(ma&&Ji){let t=Ca.get(e);t||Ca.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new xa),r.map=t,r.key=n),r.track()}}function Ta(e,t,n,r,o,i){const a=Ca.get(e);if(!a)return void ba++;const s=e=>{e&&e.trigger()};if(aa(),"clear"===t)a.forEach(s);else{const o=vi(e),i=o&&Mi(n);if(o&&"length"===n){const e=Number(r);a.forEach((t,n)=>{("length"===n||n===Aa||!ki(n)&&n>=e)&&s(t)})}else switch((void 0!==n||a.has(void 0))&&s(a.get(n)),i&&s(a.get(Aa)),t){case"add":o?i&&s(a.get("length")):(s(a.get(_a)),yi(e)&&s(a.get(Sa)));break;case"delete":o||(s(a.get(_a)),yi(e)&&s(a.get(Sa)));break;case"set":yi(e)&&s(a.get(_a))}}sa()}function Ea(e){const t=ps(e);return t===e?t:(Ma(t,0,Aa),us(e)?t:t.map(ms))}function La(e){return Ma(e=ps(e),0,Aa),e}function Oa(e,t){return ds(e)?fs(cs(e)?ms(t):t):ms(t)}const Ia={__proto__:null,[Symbol.iterator](){return Ra(this,Symbol.iterator,e=>Oa(this,e))},concat(...e){return Ea(this).concat(...e.map(e=>vi(e)?Ea(e):e))},entries(){return Ra(this,"entries",e=>(e[1]=Oa(this,e[1]),e))},every(e,t){return Ba(this,"every",e,t,void 0,arguments)},filter(e,t){return Ba(this,"filter",e,t,e=>e.map(e=>Oa(this,e)),arguments)},find(e,t){return Ba(this,"find",e,t,e=>Oa(this,e),arguments)},findIndex(e,t){return Ba(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ba(this,"findLast",e,t,e=>Oa(this,e),arguments)},findLastIndex(e,t){return Ba(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ba(this,"forEach",e,t,void 0,arguments)},includes(...e){return Da(this,"includes",e)},indexOf(...e){return Da(this,"indexOf",e)},join(e){return Ea(this).join(e)},lastIndexOf(...e){return Da(this,"lastIndexOf",e)},map(e,t){return Ba(this,"map",e,t,void 0,arguments)},pop(){return Na(this,"pop")},push(...e){return Na(this,"push",e)},reduce(e,...t){return za(this,"reduce",e,t)},reduceRight(e,...t){return za(this,"reduceRight",e,t)},shift(){return Na(this,"shift")},some(e,t){return Ba(this,"some",e,t,void 0,arguments)},splice(...e){return Na(this,"splice",e)},toReversed(){return Ea(this).toReversed()},toSorted(e){return Ea(this).toSorted(e)},toSpliced(...e){return Ea(this).toSpliced(...e)},unshift(...e){return Na(this,"unshift",e)},values(){return Ra(this,"values",e=>Oa(this,e))}};function Ra(e,t,n){const r=La(e),o=r[t]();return r===e||us(e)||(o._next=o.next,o.next=()=>{const e=o._next();return e.done||(e.value=n(e.value)),e}),o}const Pa=Array.prototype;function Ba(e,t,n,r,o,i){const a=La(e),s=a!==e&&!us(e),l=a[t];if(l!==Pa[t]){const t=l.apply(e,i);return s?ms(t):t}let c=n;a!==e&&(s?c=function(t,r){return n.call(this,Oa(e,t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));const d=l.call(a,c,r);return s&&o?o(d):d}function za(e,t,n,r){const o=La(e);let i=n,a=!1;o!==e&&(o===e||us(e)?n.length>3&&(i=function(t,r,o){return n.call(this,t,r,o,e)}):(a=0===r.length,i=function(t,r,o){return a&&(a=!1,t=Oa(e,t)),n.call(this,t,Oa(e,r),o,e)}));const s=o[t](i,...r);return a?Oa(e,s):s}function Da(e,t,n){const r=ps(e);Ma(r,0,Aa);const o=r[t](...n);return-1!==o&&!1!==o||!hs(n[0])?o:(n[0]=ps(n[0]),r[t](...n))}function Na(e,t,n=[]){ga(),aa();const r=ps(e)[t].apply(e,n);return sa(),va(),r}const Ha=ai("__proto__,__v_isRef,__isVue"),qa=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(ki));function ja(e){ki(e)||(e=String(e));const t=ps(this);return Ma(t,0,e),t.hasOwnProperty(e)}class Va{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const r=this._isReadonly,o=this._isShallow;if("__v_isReactive"===t)return!r;if("__v_isReadonly"===t)return r;if("__v_isShallow"===t)return o;if("__v_raw"===t)return n===(r?o?os:rs:o?ns:ts).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=vi(e);if(!r){let e;if(i&&(e=Ia[t]))return e;if("hasOwnProperty"===t)return ja}const a=Reflect.get(e,t,gs(e)?e:n);if(ki(t)?qa.has(t):Ha(t))return a;if(r||Ma(e,0,t),o)return a;if(gs(a)){const e=i&&Mi(t)?a:a.value;return r&&Ci(e)?ss(e):e}return Ci(a)?r?ss(a):is(a):a}}class Fa extends Va{constructor(e=!1){super(!1,e)}set(e,t,n,r){let o=e[t];const i=vi(e)&&Mi(t);if(!this._isShallow){const e=ds(o);if(us(n)||ds(n)||(o=ps(o),n=ps(n)),!i&&gs(o)&&!gs(n))return e||(o.value=n),!0}const a=i?Number(t)<e.length:gi(e,t),s=Reflect.set(e,t,n,gs(e)?e:r);return e===ps(r)&&(a?zi(n,o)&&Ta(e,"set",t,n):Ta(e,"add",t,n)),s}deleteProperty(e,t){const n=gi(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&n&&Ta(e,"delete",t,void 0),r}has(e,t){const n=Reflect.has(e,t);return ki(t)&&qa.has(t)||Ma(e,0,t),n}ownKeys(e){return Ma(e,0,vi(e)?"length":_a),Reflect.ownKeys(e)}}class $a extends Va{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Wa=new Fa,Ua=new $a,Ga=new Fa(!0),Za=e=>e,Xa=e=>Reflect.getPrototypeOf(e);function Ka(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Ya(e,t){const n=function(e,t){const n={get(n){const r=this.__v_raw,o=ps(r),i=ps(n);e||(zi(n,i)&&Ma(o,0,n),Ma(o,0,i));const{has:a}=Xa(o),s=t?Za:e?fs:ms;return a.call(o,n)?s(r.get(n)):a.call(o,i)?s(r.get(i)):void(r!==o&&r.get(n))},get size(){const t=this.__v_raw;return!e&&Ma(ps(t),0,_a),t.size},has(t){const n=this.__v_raw,r=ps(n),o=ps(t);return e||(zi(t,o)&&Ma(r,0,t),Ma(r,0,o)),t===o?n.has(t):n.has(t)||n.has(o)},forEach(n,r){const o=this,i=o.__v_raw,a=t?Za:e?fs:ms;return!e&&Ma(ps(i),0,_a),i.forEach((e,t)=>n.call(r,a(e),a(t),o))}};return pi(n,e?{add:Ka("add"),set:Ka("set"),delete:Ka("delete"),clear:Ka("clear")}:{add(e){const n=ps(this),r=Xa(n),o=ps(e),i=t||us(e)||ds(e)?e:o;return r.has.call(n,i)||zi(e,i)&&r.has.call(n,e)||zi(o,i)&&r.has.call(n,o)||(n.add(i),Ta(n,"add",i,i)),this},set(e,n){t||us(n)||ds(n)||(n=ps(n));const r=ps(this),{has:o,get:i}=Xa(r);let a=o.call(r,e);a||(e=ps(e),a=o.call(r,e));const s=i.call(r,e);return r.set(e,n),a?zi(n,s)&&Ta(r,"set",e,n):Ta(r,"add",e,n),this},delete(e){const t=ps(this),{has:n,get:r}=Xa(t);let o=n.call(t,e);o||(e=ps(e),o=n.call(t,e)),r&&r.call(t,e);const i=t.delete(e);return o&&Ta(t,"delete",e,void 0),i},clear(){const e=ps(this),t=0!==e.size,n=e.clear();return t&&Ta(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=function(e,t,n){return function(...r){const o=this.__v_raw,i=ps(o),a=yi(i),s="entries"===e||e===Symbol.iterator&&a,l="keys"===e&&a,c=o[e](...r),d=n?Za:t?fs:ms;return!t&&Ma(i,0,l?Sa:_a),pi(Object.create(c),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}}})}}(r,e,t)}),n}(e,t);return(t,r,o)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(gi(n,r)&&r in t?n:t,r,o)}const Ja={get:Ya(!1,!1)},Qa={get:Ya(!1,!0)},es={get:Ya(!0,!1)},ts=new WeakMap,ns=new WeakMap,rs=new WeakMap,os=new WeakMap;function is(e){return ds(e)?e:ls(e,!1,Wa,Ja,ts)}function as(e){return ls(e,!1,Ga,Qa,ns)}function ss(e){return ls(e,!0,Ua,es,rs)}function ls(e,t,n,r,o){if(!Ci(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=function(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>Ai(e).slice(8,-1))(e))}(e);if(0===i)return e;const a=o.get(e);if(a)return a;const s=new Proxy(e,2===i?r:n);return o.set(e,s),s}function cs(e){return ds(e)?cs(e.__v_raw):!(!e||!e.__v_isReactive)}function ds(e){return!(!e||!e.__v_isReadonly)}function us(e){return!(!e||!e.__v_isShallow)}function hs(e){return!!e&&!!e.__v_raw}function ps(e){const t=e&&e.__v_raw;return t?ps(t):e}const ms=e=>Ci(e)?is(e):e,fs=e=>Ci(e)?ss(e):e;function gs(e){return!!e&&!0===e.__v_isRef}function vs(e){return bs(e,!1)}function ys(e){return bs(e,!0)}function bs(e,t){return gs(e)?e:new ws(e,t)}class ws{constructor(e,t){this.dep=new xa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ps(e),this._value=t?e:ms(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||us(e)||ds(e);zi(e=n?e:ps(e),t)&&(this._rawValue=e,this._value=n?e:ms(e),this.dep.trigger())}}const xs={get:(e,t,n)=>"__v_raw"===t?e:function(e){return gs(e)?e.value:e}(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return gs(o)&&!gs(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function ks(e){return cs(e)?e:new Proxy(e,xs)}class Cs{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new xa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ba-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&Ji!==this)return ia(this,!0),!0}get value(){const e=this.dep.track();return ua(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function _s(e,t,n=!1){let r,o;return wi(e)?r=e:(r=e.get,o=e.set),new Cs(r,o,n)}const Ss={},As=new WeakMap;let Ms;function Ts(e,t=1/0,n){if(t<=0||!Ci(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,gs(e))Ts(e.value,t,n);else if(vi(e))for(let r=0;r<e.length;r++)Ts(e[r],t,n);else if((e=>"[object Set]"===Ai(e))(e)||yi(e))e.forEach(e=>{Ts(e,t,n)});else if((e=>"[object Object]"===Ai(e))(e)){for(const r in e)Ts(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Ts(e[r],t,n)}return e}function Es(e,t,n,r){try{return r?e(...r):e()}catch(o){Os(o,t,n)}}function Ls(e,t,n,r){if(wi(e)){const o=Es(e,t,n,r);return o&&_i(o)&&o.catch(e=>{Os(e,t,n)}),o}if(vi(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Ls(e[i],t,n,r));return o}}function Os(e,t,n,r=!0){t&&t.vnode;const{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||si;if(t){let r=t.parent;const i=t.proxy,a=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){const t=r.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,i,a))return;r=r.parent}if(o)return ga(),Es(o,null,10,[e,i,a]),void va()}!function(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}(e,0,0,r,i)}const Is=[];let Rs=-1;const Ps=[];let Bs=null,zs=0;const Ds=Promise.resolve();let Ns=null;function Hs(e){const t=Ns||Ds;return e?t.then(this?e.bind(this):e):t}function qs(e){if(!(1&e.flags)){const t=$s(e),n=Is[Is.length-1];!n||!(2&e.flags)&&t>=$s(n)?Is.push(e):Is.splice(function(e){let t=Rs+1,n=Is.length;for(;t<n;){const r=t+n>>>1,o=Is[r],i=$s(o);i<e||i===e&&2&o.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,js()}}function js(){Ns||(Ns=Ds.then(Ws))}function Vs(e,t,n=Rs+1){for(;n<Is.length;n++){const t=Is[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;Is.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function Fs(e){if(Ps.length){const e=[...new Set(Ps)].sort((e,t)=>$s(e)-$s(t));if(Ps.length=0,Bs)return void Bs.push(...e);for(Bs=e,zs=0;zs<Bs.length;zs++){const e=Bs[zs];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}Bs=null,zs=0}}const $s=e=>null==e.id?2&e.flags?-1:1/0:e.id;function Ws(e){try{for(Rs=0;Rs<Is.length;Rs++){const e=Is[Rs];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),Es(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;Rs<Is.length;Rs++){const e=Is[Rs];e&&(e.flags&=-2)}Rs=-1,Is.length=0,Fs(),Ns=null,(Is.length||Ps.length)&&Ws()}}let Us,Gs=[],Zs=!1;function Xs(e,...t){Us?Us.emit(e,...t):Zs||Gs.push({event:e,args:t})}function Ks(e,t){var n,r;Us=e,Us?(Us.enabled=!0,Gs.forEach(({event:e,args:t})=>Us.emit(e,...t)),Gs=[]):"undefined"!=typeof window&&window.HTMLElement&&!(null==(r=null==(n=window.navigator)?void 0:n.userAgent)?void 0:r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{Ks(e,t)}),setTimeout(()=>{Us||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Zs=!0,Gs=[])},3e3)):(Zs=!0,Gs=[])}const Ys=el("component:added"),Js=el("component:updated"),Qs=el("component:removed");function el(e){return t=>{Xs(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let tl=null,nl=null;function rl(e){const t=tl;return tl=e,nl=e&&e.type.__scopeId||null,t}function ol(e,t,n,r){const o=e.dirs,i=t&&t.dirs;for(let a=0;a<o.length;a++){const s=o[a];i&&(s.oldValue=i[a].value);let l=s.dir[r];l&&(ga(),Ls(l,n,8,[e.el,s,e,t]),va())}}function il(e,t,n=!1){const r=nd();if(r||ic){let o=ic?ic._context.provides:r?null==r.parent||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&wi(t)?t.call(r&&r.proxy):t}}const al=Symbol.for("v-scx");function sl(e,t){return cl(e,null,t)}function ll(e,t,n){return cl(e,t,n)}function cl(e,t,n=si){const{immediate:r,deep:o,flush:i,once:a}=n,s=pi({},n),l=t&&r||!t&&"post"!==i;let c;if(ld)if("sync"===i){const e=il(al);c=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=ci,e.resume=ci,e.pause=ci,e}const d=td;s.call=(e,t,n)=>Ls(e,d,t,n);let u=!1;"post"===i?s.scheduler=e=>{Ec(e,d&&d.suspense)}:"sync"!==i&&(u=!0,s.scheduler=(e,t)=>{t?e():qs(e)}),s.augmentJob=e=>{t&&(e.flags|=4),u&&(e.flags|=2,d&&(e.id=d.uid,e.i=d))};const h=function(e,t,n=si){const{immediate:r,deep:o,once:i,scheduler:a,augmentJob:s,call:l}=n,c=e=>o?e:us(e)||!1===o||0===o?Ts(e,1):Ts(e);let d,u,h,p,m=!1,f=!1;if(gs(e)?(u=()=>e.value,m=us(e)):cs(e)?(u=()=>c(e),m=!0):vi(e)?(f=!0,m=e.some(e=>cs(e)||us(e)),u=()=>e.map(e=>gs(e)?e.value:cs(e)?c(e):wi(e)?l?l(e,2):e():void 0)):u=wi(e)?t?l?()=>l(e,2):e:()=>{if(h){ga();try{h()}finally{va()}}const t=Ms;Ms=d;try{return l?l(e,3,[p]):e(p)}finally{Ms=t}}:ci,t&&o){const e=u,t=!0===o?1/0:o;u=()=>Ts(e(),t)}const g=Yi,v=()=>{d.stop(),g&&g.active&&mi(g.effects,d)};if(i&&t){const e=t;t=(...t)=>{e(...t),v()}}let y=f?new Array(e.length).fill(Ss):Ss;const b=e=>{if(1&d.flags&&(d.dirty||e))if(t){const e=d.run();if(o||m||(f?e.some((e,t)=>zi(e,y[t])):zi(e,y))){h&&h();const n=Ms;Ms=d;try{const n=[e,y===Ss?void 0:f&&y[0]===Ss?[]:y,p];y=e,l?l(t,3,n):t(...n)}finally{Ms=n}}}else d.run()};return s&&s(b),d=new ta(u),d.scheduler=a?()=>a(b,!1):b,p=e=>function(e,t=!1,n=Ms){if(n){let t=As.get(n);t||As.set(n,t=[]),t.push(e)}}(e,!1,d),h=d.onStop=()=>{const e=As.get(d);if(e){if(l)l(e,4);else for(const t of e)t();As.delete(d)}},t?r?b(!0):y=d.run():a?a(b.bind(null,!0),!0):d.run(),v.pause=d.pause.bind(d),v.resume=d.resume.bind(d),v.stop=v,v}(e,t,s);return ld&&(c?c.push(h):l&&h()),h}function dl(e,t,n){const r=this.proxy,o=xi(e)?e.includes(".")?ul(r,e):()=>r[e]:e.bind(r,r);let i;wi(t)?i=t:(i=t.handler,n=t);const a=id(this),s=cl(o,i.bind(r),n);return a(),s}function ul(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const hl=Symbol("_vte"),pl=Symbol("_leaveCb");function ml(e,t){6&e.shapeFlag&&e.component?(e.transition=t,ml(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function fl(e,t){return wi(e)?(()=>pi({name:e.name},t,{setup:e}))():e}function gl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function vl(e,t){let n;return!(!(n=Object.getOwnPropertyDescriptor(e,t))||n.configurable)}const yl=new WeakMap;function bl(e,t,n,r,o=!1){if(vi(e))return void e.forEach((e,i)=>bl(e,t&&(vi(t)?t[i]:t),n,r,o));if(xl(r)&&!o)return void(512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&bl(e,t,n,r.component.subTree));const i=4&r.shapeFlag?hd(r.component):r.el,a=o?null:i,{i:s,r:l}=e,c=t&&t.r,d=s.refs===si?s.refs={}:s.refs,u=s.setupState,h=ps(u),p=u===si?di:e=>!vl(d,e)&&gi(h,e),m=(e,t)=>!t||!vl(d,t);if(null!=c&&c!==l)if(wl(t),xi(c))d[c]=null,p(c)&&(u[c]=null);else if(gs(c)){const e=t;m(0,e.k)&&(c.value=null),e.k&&(d[e.k]=null)}if(wi(l))Es(l,s,12,[a,d]);else{const t=xi(l),r=gs(l);if(t||r){const s=()=>{if(e.f){const n=t?p(l)?u[l]:d[l]:m()||!e.k?l.value:d[e.k];if(o)vi(n)&&mi(n,i);else if(vi(n))n.includes(i)||n.push(i);else if(t)d[l]=[i],p(l)&&(u[l]=d[l]);else{const t=[i];m(0,e.k)&&(l.value=t),e.k&&(d[e.k]=t)}}else t?(d[l]=a,p(l)&&(u[l]=a)):r&&(m(0,e.k)&&(l.value=a),e.k&&(d[e.k]=a))};if(a){const t=()=>{s(),yl.delete(e)};t.id=-1,yl.set(e,t),Ec(t,n)}else wl(e),s()}}}function wl(e){const t=yl.get(e);t&&(t.flags|=8,yl.delete(e))}ji().requestIdleCallback,ji().cancelIdleCallback;const xl=e=>!!e.type.__asyncLoader,kl=e=>e.type.__isKeepAlive;function Cl(e,t){Sl(e,"a",t)}function _l(e,t){Sl(e,"da",t)}function Sl(e,t,n=td){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Ml(t,r,n),n){let e=n.parent;for(;e&&e.parent;)kl(e.parent.vnode)&&Al(r,t,n,e),e=e.parent}}function Al(e,t,n,r){const o=Ml(t,e,r,!0);Pl(()=>{mi(r[t],o)},n)}function Ml(e,t,n=td,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{ga();const o=id(n),i=Ls(t,n,e,r);return o(),va(),i});return r?o.unshift(i):o.push(i),i}}const Tl=e=>(t,n=td)=>{ld&&"sp"!==e||Ml(e,(...e)=>t(...e),n)},El=Tl("bm"),Ll=Tl("m"),Ol=Tl("bu"),Il=Tl("u"),Rl=Tl("bum"),Pl=Tl("um"),Bl=Tl("sp"),zl=Tl("rtg"),Dl=Tl("rtc");function Nl(e,t=td){Ml("ec",e,t)}const Hl=Symbol.for("v-ndc"),ql=e=>e?sd(e)?hd(e):ql(e.parent):null,jl=pi(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ql(e.parent),$root:e=>ql(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?Zl(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{qs(e.update)}),$nextTick:e=>e.n||(e.n=Hs.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?dl.bind(e):ci}),Vl=(e,t)=>e!==si&&!e.__isScriptSetup&&gi(e,t),Fl={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:r,data:o,props:i,accessCache:a,type:s,appContext:l}=e;if("$"!==t[0]){const e=a[t];if(void 0!==e)switch(e){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(Vl(r,t))return a[t]=1,r[t];if(__VUE_OPTIONS_API__&&o!==si&&gi(o,t))return a[t]=2,o[t];if(gi(i,t))return a[t]=3,i[t];if(n!==si&&gi(n,t))return a[t]=4,n[t];__VUE_OPTIONS_API__&&!Wl||(a[t]=0)}}const c=jl[t];let d,u;return c?("$attrs"===t&&Ma(e.attrs,0,""),c(e)):(d=s.__cssModules)&&(d=d[t])?d:n!==si&&gi(n,t)?(a[t]=4,n[t]):(u=l.config.globalProperties,gi(u,t)?u[t]:void 0)},set({_:e},t,n){const{data:r,setupState:o,ctx:i}=e;return Vl(o,t)?(o[t]=n,!0):__VUE_OPTIONS_API__&&r!==si&&gi(r,t)?(r[t]=n,!0):!(gi(e.props,t)||"$"===t[0]&&t.slice(1)in e||(i[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:i,type:a}},s){let l;return!!(n[s]||__VUE_OPTIONS_API__&&e!==si&&"$"!==s[0]&&gi(e,s)||Vl(t,s)||gi(i,s)||gi(r,s)||gi(jl,s)||gi(o.config.globalProperties,s)||(l=a.__cssModules)&&l[s])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:gi(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function $l(e){return vi(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let Wl=!0;function Ul(e,t,n){Ls(vi(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Gl(e,t,n,r){let o=r.includes(".")?ul(n,r):()=>n[r];if(xi(e)){const n=t[e];wi(n)&&ll(o,n)}else if(wi(e))ll(o,e.bind(n));else if(Ci(e))if(vi(e))e.forEach(e=>Gl(e,t,n,r));else{const r=wi(e.handler)?e.handler.bind(n):t[e.handler];wi(r)&&ll(o,r,e)}}function Zl(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,s=i.get(t);let l;return s?l=s:o.length||n||r?(l={},o.length&&o.forEach(e=>Xl(l,e,a,!0)),Xl(l,t,a)):l=t,Ci(t)&&i.set(t,l),l}function Xl(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&Xl(e,i,n,!0),o&&o.forEach(t=>Xl(e,t,n,!0));for(const a in t)if(r&&"expose"===a);else{const r=Kl[a]||n&&n[a];e[a]=r?r(e[a],t[a]):t[a]}return e}const Kl={data:Yl,props:tc,emits:tc,methods:ec,computed:ec,beforeCreate:Ql,created:Ql,beforeMount:Ql,mounted:Ql,beforeUpdate:Ql,updated:Ql,beforeDestroy:Ql,beforeUnmount:Ql,destroyed:Ql,unmounted:Ql,activated:Ql,deactivated:Ql,errorCaptured:Ql,serverPrefetch:Ql,components:ec,directives:ec,watch:function(e,t){if(!e)return t;if(!t)return e;const n=pi(Object.create(null),e);for(const r in t)n[r]=Ql(e[r],t[r]);return n},provide:Yl,inject:function(e,t){return ec(Jl(e),Jl(t))}};function Yl(e,t){return t?e?function(){return pi(wi(e)?e.call(this,this):e,wi(t)?t.call(this,this):t)}:t:e}function Jl(e){if(vi(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ql(e,t){return e?[...new Set([].concat(e,t))]:t}function ec(e,t){return e?pi(Object.create(null),e,t):t}function tc(e,t){return e?vi(e)&&vi(t)?[...new Set([...e,...t])]:pi(Object.create(null),$l(e),$l(null!=t?t:{})):t}function nc(){return{app:null,config:{isNativeTag:di,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let rc=0;function oc(e,t){return function(t,n=null){wi(t)||(t=pi({},t)),null==n||Ci(n)||(n=null);const r=nc(),o=new WeakSet,i=[];let a=!1;const s=r.app={_uid:rc++,_component:t,_props:n,_container:null,_context:r,_instance:null,version:fd,get config(){return r.config},set config(e){},use:(e,...t)=>(o.has(e)||(e&&wi(e.install)?(o.add(e),e.install(s,...t)):wi(e)&&(o.add(e),e(s,...t))),s),mixin:e=>(__VUE_OPTIONS_API__&&(r.mixins.includes(e)||r.mixins.push(e)),s),component:(e,t)=>t?(r.components[e]=t,s):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,s):r.directives[e],mount(o,i,l){if(!a){const i=s._ceVNode||Uc(t,n);return i.appContext=r,!0===l?l="svg":!1===l&&(l=void 0),e(i,o,l),a=!0,s._container=o,o.__vue_app__=s,__VUE_PROD_DEVTOOLS__&&(s._instance=i.component,function(e){Xs("app:init",e,fd,{Fragment:Nc,Text:Hc,Comment:qc,Static:jc})}(s)),hd(i.component)}},onUnmount(e){i.push(e)},unmount(){a&&(Ls(i,s._instance,16),e(null,s._container),__VUE_PROD_DEVTOOLS__&&(s._instance=null,function(e){Xs("app:unmount",e)}(s)),delete s._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,s),runWithContext(e){const t=ic;ic=s;try{return e()}finally{ic=t}}};return s}}let ic=null;function ac(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||si;let o=n;const i=t.startsWith("update:"),a=i&&((e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${Oi(t)}Modifiers`]||e[`${Ri(t)}Modifiers`])(r,t.slice(7));let s;a&&(a.trim&&(o=n.map(e=>xi(e)?e.trim():e)),a.number&&(o=n.map(Hi))),__VUE_PROD_DEVTOOLS__&&function(e,t,n){Xs("component:emit",e.appContext.app,e,t,n)}(e,t,o);let l=r[s=Bi(t)]||r[s=Bi(Oi(t))];!l&&i&&(l=r[s=Bi(Ri(t))]),l&&Ls(l,e,6,o);const c=r[s+"Once"];if(c){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,Ls(c,e,6,o)}}const sc=new WeakMap;function lc(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?sc:t.emitsCache,o=r.get(e);if(void 0!==o)return o;const i=e.emits;let a={},s=!1;if(__VUE_OPTIONS_API__&&!wi(e)){const r=e=>{const n=lc(e,t,!0);n&&(s=!0,pi(a,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return i||s?(vi(i)?i.forEach(e=>a[e]=null):pi(a,i),Ci(e)&&r.set(e,a),a):(Ci(e)&&r.set(e,null),null)}function cc(e,t){return!(!e||!ui(t))&&(t=t.slice(2).replace(/Once$/,""),gi(e,t[0].toLowerCase()+t.slice(1))||gi(e,Ri(t))||gi(e,t))}function dc(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[i],slots:a,attrs:s,emit:l,render:c,renderCache:d,props:u,data:h,setupState:p,ctx:m,inheritAttrs:f}=e,g=rl(e);let v,y;try{if(4&n.shapeFlag){const e=o||r,t=e;v=Xc(c.call(t,e,d,u,p,h,m)),y=s}else{const e=t;v=Xc(e.length>1?e(u,{attrs:s,slots:a,emit:l}):e(u,null)),y=t.props?s:uc(s)}}catch(w){Os(w,e,1),v=Uc(qc)}let b=v;if(y&&!1!==f){const e=Object.keys(y),{shapeFlag:t}=b;e.length&&7&t&&(i&&e.some(hi)&&(y=hc(y,i)),b=Gc(b,y,!1,!0))}return n.dirs&&(b=Gc(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ml(b,n.transition),v=b,rl(g),v}const uc=e=>{let t;for(const n in e)("class"===n||"style"===n||ui(n))&&((t||(t={}))[n]=e[n]);return t},hc=(e,t)=>{const n={};for(const r in e)hi(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function pc(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const i=r[o];if(mc(t,e,i)&&!cc(n,i))return!0}return!1}function mc(e,t,n){const r=e[n],o=t[n];return"style"===n&&Ci(r)&&Ci(o)?!Ki(r,o):r!==o}const fc={},gc=()=>Object.create(fc),vc=e=>Object.getPrototypeOf(e)===fc;function yc(e,t,n,r){const[o,i]=e.propsOptions;let a,s=!1;if(t)for(let l in t){if(Ti(l))continue;const c=t[l];let d;o&&gi(o,d=Oi(l))?i&&i.includes(d)?(a||(a={}))[d]=c:n[d]=c:cc(e.emitsOptions,l)||l in r&&c===r[l]||(r[l]=c,s=!0)}if(i){const t=ps(n),r=a||si;for(let a=0;a<i.length;a++){const s=i[a];n[s]=bc(o,t,s,r[s],e,!gi(r,s))}}return s}function bc(e,t,n,r,o,i){const a=e[n];if(null!=a){const e=gi(a,"default");if(e&&void 0===r){const e=a.default;if(a.type!==Function&&!a.skipFactory&&wi(e)){const{propsDefaults:i}=o;if(n in i)r=i[n];else{const a=id(o);r=i[n]=e.call(null,t),a()}}else r=e;o.ce&&o.ce._setProp(n,r)}a[0]&&(i&&!e?r=!1:!a[1]||""!==r&&r!==Ri(n)||(r=!0))}return r}const wc=new WeakMap;function xc(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?wc:t.propsCache,o=r.get(e);if(o)return o;const i=e.props,a={},s=[];let l=!1;if(__VUE_OPTIONS_API__&&!wi(e)){const r=e=>{l=!0;const[n,r]=xc(e,t,!0);pi(a,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!i&&!l)return Ci(e)&&r.set(e,li),li;if(vi(i))for(let d=0;d<i.length;d++){const e=Oi(i[d]);kc(e)&&(a[e]=si)}else if(i)for(const d in i){const e=Oi(d);if(kc(e)){const t=i[d],n=a[e]=vi(t)||wi(t)?{type:t}:pi({},t),r=n.type;let o=!1,l=!0;if(vi(r))for(let e=0;e<r.length;++e){const t=r[e],n=wi(t)&&t.name;if("Boolean"===n){o=!0;break}"String"===n&&(l=!1)}else o=wi(r)&&"Boolean"===r.name;n[0]=o,n[1]=l,(o||gi(n,"default"))&&s.push(e)}}const c=[a,s];return Ci(e)&&r.set(e,c),c}function kc(e){return"$"!==e[0]&&!Ti(e)}const Cc=e=>"_"===e||"_ctx"===e||"$stable"===e,_c=e=>vi(e)?e.map(Xc):[Xc(e)],Sc=(e,t,n)=>{if(t._n)return t;const r=function(e,t=tl){if(!t)return e;if(e._n)return e;const n=(...r)=>{n._d;const o=rl(t);let i;try{i=e(...r)}finally{rl(o),n._d}return __VUE_PROD_DEVTOOLS__&&Js(t),i};return n._n=!0,n._c=!0,n._d=!0,n}((...e)=>_c(t(...e)),n);return r._c=!1,r},Ac=(e,t,n)=>{const r=e._ctx;for(const o in e){if(Cc(o))continue;const n=e[o];if(wi(n))t[o]=Sc(0,n,r);else if(null!=n){const e=_c(n);t[o]=()=>e}}},Mc=(e,t)=>{const n=_c(t);e.slots.default=()=>n},Tc=(e,t,n)=>{for(const r in t)!n&&Cc(r)||(e[r]=t[r])},Ec=function(e,t){t&&t.pendingBranch?vi(e)?t.effects.push(...e):t.effects.push(e):function(e){vi(e)?Ps.push(...e):Bs&&-1===e.id?Bs.splice(zs+1,0,e):1&e.flags||(Ps.push(e),e.flags|=1),js()}(e)};function Lc(e){return function(e){"boolean"!=typeof __VUE_OPTIONS_API__&&(ji().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&(ji().__VUE_PROD_DEVTOOLS__=!1),"boolean"!=typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&(ji().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1);const t=ji();t.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&Ks(t.__VUE_DEVTOOLS_GLOBAL_HOOK__,t);const{insert:n,remove:r,patchProp:o,createElement:i,createText:a,createComment:s,setText:l,setElementText:c,parentNode:d,nextSibling:u,setScopeId:h=ci,insertStaticContent:p}=e,m=(e,t,n,r=null,o=null,i=null,a=void 0,s=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Fc(e,t)&&(r=q(e),B(e,o,i,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case Hc:f(e,t,n,r);break;case qc:g(e,t,n,r);break;case jc:null==e&&v(t,n,r,a);break;case Nc:S(e,t,n,r,o,i,a,s,l);break;default:1&u?y(e,t,n,r,o,i,a,s,l):6&u?A(e,t,n,r,o,i,a,s,l):(64&u||128&u)&&c.process(e,t,n,r,o,i,a,s,l,F)}null!=d&&o?bl(d,e&&e.ref,i,t||e,!t):null==d&&e&&null!=e.ref&&bl(e.ref,null,i,e,!0)},f=(e,t,r,o)=>{if(null==e)n(t.el=a(t.children),r,o);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},g=(e,t,r,o)=>{null==e?n(t.el=s(t.children||""),r,o):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=p(e.children,t,n,r,e.el,e.anchor)},y=(e,t,n,r,o,i,a,s,l)=>{if("svg"===t.type?a="svg":"math"===t.type&&(a="mathml"),null==e)b(t,n,r,o,i,a,s,l);else{const n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),k(e,t,o,i,a,s,l)}finally{n&&n._endPatch()}}},b=(e,t,r,a,s,l,d,u)=>{let h,p;const{props:m,shapeFlag:f,transition:g,dirs:v}=e;if(h=e.el=i(e.type,l,m&&m.is,m),8&f?c(h,e.children):16&f&&x(e.children,h,null,a,s,Oc(e,l),d,u),v&&ol(e,null,a,"created"),w(h,e,e.scopeId,d,a),m){for(const e in m)"value"===e||Ti(e)||o(h,e,null,m[e],l,a);"value"in m&&o(h,"value",null,m.value,l),(p=m.onVnodeBeforeMount)&&Jc(p,a,e)}__VUE_PROD_DEVTOOLS__&&(Ni(h,"__vnode",e,!0),Ni(h,"__vueParentComponent",a,!0)),v&&ol(e,null,a,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(s,g);y&&g.beforeEnter(h),n(h,t,r),((p=m&&m.onVnodeMounted)||y||v)&&Ec(()=>{p&&Jc(p,a,e),y&&g.enter(h),v&&ol(e,null,a,"mounted")},s)},w=(e,t,n,r,o)=>{if(n&&h(e,n),r)for(let i=0;i<r.length;i++)h(e,r[i]);if(o){let n=o.subTree;if(t===n||Dc(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=o.vnode;w(e,t,t.scopeId,t.slotScopeIds,o.parent)}}},x=(e,t,n,r,o,i,a,s,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=s?Kc(e[c]):Xc(e[c]);m(null,l,t,n,r,o,i,a,s)}},k=(e,t,n,r,i,a,s)=>{const l=t.el=e.el;__VUE_PROD_DEVTOOLS__&&(l.__vnode=t);let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const p=e.props||si,m=t.props||si;let f;if(n&&Ic(n,!1),(f=m.onVnodeBeforeUpdate)&&Jc(f,n,t,e),h&&ol(t,e,n,"beforeUpdate"),n&&Ic(n,!0),(p.innerHTML&&null==m.innerHTML||p.textContent&&null==m.textContent)&&c(l,""),u?C(e.dynamicChildren,u,l,n,r,Oc(t,i),a):s||O(e,t,l,null,n,r,Oc(t,i),a,!1),d>0){if(16&d)_(l,p,m,n,i);else if(2&d&&p.class!==m.class&&o(l,"class",null,m.class,i),4&d&&o(l,"style",p.style,m.style,i),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const r=e[t],a=p[r],s=m[r];s===a&&"value"!==r||o(l,r,a,s,i,n)}}1&d&&e.children!==t.children&&c(l,t.children)}else s||null!=u||_(l,p,m,n,i);((f=m.onVnodeUpdated)||h)&&Ec(()=>{f&&Jc(f,n,t,e),h&&ol(t,e,n,"updated")},r)},C=(e,t,n,r,o,i,a)=>{for(let s=0;s<t.length;s++){const l=e[s],c=t[s],u=l.el&&(l.type===Nc||!Fc(l,c)||198&l.shapeFlag)?d(l.el):n;m(l,c,u,null,r,o,i,a,!0)}},_=(e,t,n,r,i)=>{if(t!==n){if(t!==si)for(const a in t)Ti(a)||a in n||o(e,a,t[a],null,i,r);for(const a in n){if(Ti(a))continue;const s=n[a],l=t[a];s!==l&&"value"!==a&&o(e,a,l,s,i,r)}"value"in n&&o(e,"value",t.value,n.value,i)}},S=(e,t,r,o,i,s,l,c,d)=>{const u=t.el=e?e.el:a(""),h=t.anchor=e?e.anchor:a("");let{patchFlag:p,dynamicChildren:m,slotScopeIds:f}=t;f&&(c=c?c.concat(f):f),null==e?(n(u,r,o),n(h,r,o),x(t.children||[],r,h,i,s,l,c,d)):p>0&&64&p&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(C(e.dynamicChildren,m,r,i,s,l,c),(null!=t.key||i&&t===i.subTree)&&Rc(e,t,!0)):O(e,t,r,h,i,s,l,c,d)},A=(e,t,n,r,o,i,a,s,l)=>{t.slotScopeIds=s,null==e?512&t.shapeFlag?o.ctx.activate(t,n,r,a,l):M(t,n,r,o,i,a,l):T(e,t,l)},M=(e,t,n,r,o,i,a)=>{const s=e.component=function(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||Qc,i={uid:ed++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Qi(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:xc(r,o),emitsOptions:lc(r,o),emit:null,emitted:null,propsDefaults:si,inheritAttrs:r.inheritAttrs,ctx:si,data:si,props:si,attrs:si,slots:si,refs:si,setupState:si,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=ac.bind(null,i),e.ce&&e.ce(i),i}(e,r,o);if(kl(e)&&(s.ctx.renderer=F),function(e,t=!1,n=!1){t&&od(t);const{props:r,children:o}=e.vnode,i=sd(e);(function(e,t,n,r=!1){const o={},i=gc();e.propsDefaults=Object.create(null),yc(e,t,o,i);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);n?e.props=r?o:as(o):e.type.props?e.props=o:e.props=i,e.attrs=i})(e,r,i,t),((e,t,n)=>{const r=e.slots=gc();if(32&e.vnode.shapeFlag){const e=t._;e?(Tc(r,t,n),n&&Ni(r,"_",e,!0)):Ac(t,r)}else t&&Mc(e,t)})(e,o,n||t),i&&function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Fl);const{setup:r}=n;if(r){ga();const n=e.setupContext=r.length>1?function(e){return{attrs:new Proxy(e.attrs,ud),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}(e):null,o=id(e),i=Es(r,e,0,[e.props,n]),a=_i(i);if(va(),o(),!a&&!e.sp||xl(e)||gl(e),a){if(i.then(ad,ad),t)return i.then(t=>{cd(e,t)}).catch(t=>{Os(t,e,0)});e.asyncDep=i}else cd(e,i)}else dd(e)}(e,t),t&&od(!1)}(s,!1,a),s.asyncDep){if(o&&o.registerDep(s,E,a),!e.el){const r=s.subTree=Uc(qc);g(null,r,t,n),e.placeholder=r.el}}else E(s,e,t,n,o,i,a)},T=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:o,component:i}=e,{props:a,children:s,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!o&&!s||s&&s.$stable)||r!==a&&(r?!a||pc(r,a,c):!!a);if(1024&l)return!0;if(16&l)return r?pc(r,a,c):!!a;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(mc(a,r,n)&&!cc(c,n))return!0}}return!1}(e,t,n)){if(r.asyncDep&&!r.asyncResolved)return void L(r,t,n);r.next=t,r.update()}else t.el=e.el,r.vnode=t},E=(e,t,n,r,o,i,a)=>{e.scope.on();const s=e.effect=new ta(()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{const n=Pc(e);if(n)return t&&(t.el=c.el,L(e,t,a)),void n.asyncDep.then(()=>{Ec(()=>{e.isUnmounted||l()},o)})}let u,h=t;Ic(e,!1),t?(t.el=c.el,L(e,t,a)):t=c,n&&Di(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Jc(u,s,t,c),Ic(e,!0);const p=dc(e),f=e.subTree;e.subTree=p,m(f,p,d(f.el),q(f),e,o,i),t.el=p.el,null===h&&function({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),r&&Ec(r,o),(u=t.props&&t.props.onVnodeUpdated)&&Ec(()=>Jc(u,s,t,c),o),__VUE_PROD_DEVTOOLS__&&Js(e)}else{let a;const{el:s,props:l}=t,{bm:c,m:d,parent:u,root:h,type:p}=e,f=xl(t);Ic(e,!1),c&&Di(c),!f&&(a=l&&l.onVnodeBeforeMount)&&Jc(a,u,t),Ic(e,!0);{h.ce&&h.ce._hasShadowRoot()&&h.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);const a=e.subTree=dc(e);m(null,a,n,r,e,o,i),t.el=a.el}if(d&&Ec(d,o),!f&&(a=l&&l.onVnodeMounted)){const e=t;Ec(()=>Jc(a,u,e),o)}(256&t.shapeFlag||u&&xl(u.vnode)&&256&u.vnode.shapeFlag)&&e.a&&Ec(e.a,o),e.isMounted=!0,__VUE_PROD_DEVTOOLS__&&Ys(e),t=n=r=null}});e.scope.off();const l=e.update=s.run.bind(s),c=e.job=s.runIfDirty.bind(s);c.i=e,c.id=e.uid,s.scheduler=()=>qs(c),Ic(e,!0),l()},L=(e,t,n)=>{t.component=e;const r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){const{props:o,attrs:i,vnode:{patchFlag:a}}=e,s=ps(o),[l]=e.propsOptions;let c=!1;if(!(r||a>0)||16&a){let r;yc(e,t,o,i)&&(c=!0);for(const i in s)t&&(gi(t,i)||(r=Ri(i))!==i&&gi(t,r))||(l?!n||void 0===n[i]&&void 0===n[r]||(o[i]=bc(l,s,i,void 0,e,!0)):delete o[i]);if(i!==s)for(const e in i)t&&gi(t,e)||(delete i[e],c=!0)}else if(8&a){const n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let a=n[r];if(cc(e.emitsOptions,a))continue;const d=t[a];if(l)if(gi(i,a))d!==i[a]&&(i[a]=d,c=!0);else{const t=Oi(a);o[t]=bc(l,s,t,d,e,!1)}else d!==i[a]&&(i[a]=d,c=!0)}}c&&Ta(e.attrs,"set","")}(e,t.props,r,n),((e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,a=si;if(32&r.shapeFlag){const e=t._;e?n&&1===e?i=!1:Tc(o,t,n):(i=!t.$stable,Ac(t,o)),a=t}else t&&(Mc(e,t),a={default:1});if(i)for(const s in o)Cc(s)||null!=a[s]||delete o[s]})(e,t.children,n),ga(),Vs(e),va()},O=(e,t,n,r,o,i,a,s,l=!1)=>{const d=e&&e.children,u=e?e.shapeFlag:0,h=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(128&p)return void R(d,h,n,r,o,i,a,s,l);if(256&p)return void I(d,h,n,r,o,i,a,s,l)}8&m?(16&u&&H(d,o,i),h!==d&&c(n,h)):16&u?16&m?R(d,h,n,r,o,i,a,s,l):H(d,o,i,!0):(8&u&&c(n,""),16&m&&x(h,n,r,o,i,a,s,l))},I=(e,t,n,r,o,i,a,s,l)=>{t=t||li;const c=(e=e||li).length,d=t.length,u=Math.min(c,d);let h;for(h=0;h<u;h++){const r=t[h]=l?Kc(t[h]):Xc(t[h]);m(e[h],r,n,null,o,i,a,s,l)}c>d?H(e,o,i,!0,!1,u):x(t,n,r,o,i,a,s,l,u)},R=(e,t,n,r,o,i,a,s,l)=>{let c=0;const d=t.length;let u=e.length-1,h=d-1;for(;c<=u&&c<=h;){const r=e[c],d=t[c]=l?Kc(t[c]):Xc(t[c]);if(!Fc(r,d))break;m(r,d,n,null,o,i,a,s,l),c++}for(;c<=u&&c<=h;){const r=e[u],c=t[h]=l?Kc(t[h]):Xc(t[h]);if(!Fc(r,c))break;m(r,c,n,null,o,i,a,s,l),u--,h--}if(c>u){if(c<=h){const e=h+1,u=e<d?t[e].el:r;for(;c<=h;)m(null,t[c]=l?Kc(t[c]):Xc(t[c]),n,u,o,i,a,s,l),c++}}else if(c>h)for(;c<=u;)B(e[c],o,i,!0),c++;else{const p=c,f=c,g=new Map;for(c=f;c<=h;c++){const e=t[c]=l?Kc(t[c]):Xc(t[c]);null!=e.key&&g.set(e.key,c)}let v,y=0;const b=h-f+1;let w=!1,x=0;const k=new Array(b);for(c=0;c<b;c++)k[c]=0;for(c=p;c<=u;c++){const r=e[c];if(y>=b){B(r,o,i,!0);continue}let d;if(null!=r.key)d=g.get(r.key);else for(v=f;v<=h;v++)if(0===k[v-f]&&Fc(r,t[v])){d=v;break}void 0===d?B(r,o,i,!0):(k[d-f]=c+1,d>=x?x=d:w=!0,m(r,t[d],n,null,o,i,a,s,l),y++)}const C=w?function(e){const t=e.slice(),n=[0];let r,o,i,a,s;const l=e.length;for(r=0;r<l;r++){const l=e[r];if(0!==l){if(o=n[n.length-1],e[o]<l){t[r]=o,n.push(r);continue}for(i=0,a=n.length-1;i<a;)s=i+a>>1,e[n[s]]<l?i=s+1:a=s;l<e[n[i]]&&(i>0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,a=n[i-1];i-- >0;)n[i]=a,a=t[a];return n}(k):li;for(v=C.length-1,c=b-1;c>=0;c--){const e=f+c,u=t[e],h=t[e+1],p=e+1<d?h.el||zc(h):r;0===k[c]?m(null,u,n,p,o,i,a,s,l):w&&(v<0||c!==C[v]?P(u,n,p,2):v--)}}},P=(e,t,o,i,a=null)=>{const{el:s,type:l,transition:c,children:d,shapeFlag:h}=e;if(6&h)P(e.component.subTree,t,o,i);else if(128&h)e.suspense.move(t,o,i);else if(64&h)l.move(e,t,o,F);else if(l!==Nc)if(l!==jc)if(2!==i&&1&h&&c)if(0===i)c.beforeEnter(s),n(s,t,o),Ec(()=>c.enter(s),a);else{const{leave:i,delayLeave:a,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?r(s):n(s,t,o)},u=()=>{s._isLeaving&&s[pl](!0),i(s,()=>{d(),l&&l()})};a?a(s,d,u):u()}else n(s,t,o);else(({el:e,anchor:t},r,o)=>{let i;for(;e&&e!==t;)i=u(e),n(e,r,o),e=i;n(t,r,o)})(e,t,o);else{n(s,t,o);for(let e=0;e<d.length;e++)P(d[e],t,o,i);n(e.anchor,t,o)}},B=(e,t,n,r=!1,o=!1)=>{const{type:i,props:a,ref:s,children:l,dynamicChildren:c,shapeFlag:d,patchFlag:u,dirs:h,cacheIndex:p}=e;if(-2===u&&(o=!1),null!=s&&(ga(),bl(s,null,n,e,!0),va()),null!=p&&(t.renderCache[p]=void 0),256&d)return void t.ctx.deactivate(e);const m=1&d&&h,f=!xl(e);let g;if(f&&(g=a&&a.onVnodeBeforeUnmount)&&Jc(g,t,e),6&d)N(e.component,n,r);else{if(128&d)return void e.suspense.unmount(n,r);m&&ol(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,F,r):c&&!c.hasOnce&&(i!==Nc||u>0&&64&u)?H(c,t,n,!1,!0):(i===Nc&&384&u||!o&&16&d)&&H(l,t,n),r&&z(e)}(f&&(g=a&&a.onVnodeUnmounted)||m)&&Ec(()=>{g&&Jc(g,t,e),m&&ol(e,null,t,"unmounted")},n)},z=e=>{const{type:t,el:n,anchor:o,transition:i}=e;if(t===Nc)return void D(n,o);if(t===jc)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=u(e),r(e),e=n;r(t)})(e);const a=()=>{r(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){const{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},D=(e,t)=>{let n;for(;e!==t;)n=u(e),r(e),e=n;r(t)},N=(e,t,n)=>{const{bum:r,scope:o,job:i,subTree:a,um:s,m:l,a:c}=e;Bc(l),Bc(c),r&&Di(r),o.stop(),i&&(i.flags|=8,B(a,e,t,n)),s&&Ec(s,t),Ec(()=>{e.isUnmounted=!0},t),__VUE_PROD_DEVTOOLS__&&(e=>{Us&&"function"==typeof Us.cleanupBuffer&&!Us.cleanupBuffer(e)&&Qs(e)})(e)},H=(e,t,n,r=!1,o=!1,i=0)=>{for(let a=i;a<e.length;a++)B(e[a],t,n,r,o)},q=e=>{if(6&e.shapeFlag)return q(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=u(e.anchor||e.el),n=t&&t[hl];return n?u(n):t};let j=!1;const V=(e,t,n)=>{let r;null==e?t._vnode&&(B(t._vnode,null,null,!0),r=t._vnode.component):m(t._vnode||null,e,t,null,null,null,n),t._vnode=e,j||(j=!0,Vs(r),Fs(),j=!1)},F={p:m,um:B,m:P,r:z,mt:M,mc:x,pc:O,pbc:C,n:q,o:e};return{render:V,hydrate:void 0,createApp:oc(V)}}(e)}function Oc({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Ic({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Rc(e,t,n=!1){const r=e.children,o=t.children;if(vi(r)&&vi(o))for(let i=0;i<r.length;i++){const e=r[i];let t=o[i];1&t.shapeFlag&&!t.dynamicChildren&&((t.patchFlag<=0||32===t.patchFlag)&&(t=o[i]=Kc(o[i]),t.el=e.el),n||-2===t.patchFlag||Rc(e,t)),t.type===Hc&&(-1===t.patchFlag&&(t=o[i]=Kc(t)),t.el=e.el),t.type!==qc||t.el||(t.el=e.el)}}function Pc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Pc(t)}function Bc(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function zc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?zc(t.subTree):null}const Dc=e=>e.__isSuspense,Nc=Symbol.for("v-fgt"),Hc=Symbol.for("v-txt"),qc=Symbol.for("v-cmt"),jc=Symbol.for("v-stc");function Vc(e){return!!e&&!0===e.__v_isVNode}function Fc(e,t){return e.type===t.type&&e.key===t.key}const $c=({key:e})=>null!=e?e:null,Wc=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?xi(e)||gs(e)||wi(e)?{i:tl,r:e,k:t,f:!!n}:e:null),Uc=function(e,t=null,n=null,r=0,o=null,i=!1){if(e&&e!==Hl||(e=qc),Vc(e)){const r=Gc(e,t,!0);return n&&Yc(r,n),r.patchFlag=-2,r}if(function(e){return wi(e)&&"__vccOpts"in e}(e)&&(e=e.__vccOpts),t){t=function(e){return e?hs(e)||vc(e)?pi({},e):e:null}(t);let{class:e,style:n}=t;e&&!xi(e)&&(t.class=Gi(e)),Ci(n)&&(hs(n)&&!vi(n)&&(n=pi({},n)),t.style=Vi(n))}return function(e,t=null,n=null,r=0,o=null,i=(e===Nc?0:1),a=!1,s=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&$c(t),ref:t&&Wc(t),scopeId:nl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:tl};return s?(Yc(l,n),128&i&&e.normalize(l)):n&&(l.shapeFlag|=xi(n)?8:16),l}(e,t,n,r,o,xi(e)?1:Dc(e)?128:(e=>e.__isTeleport)(e)?64:Ci(e)?4:wi(e)?2:0,i,!0)};function Gc(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:a,children:s,transition:l}=e,c=t?function(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)if("class"===e)t.class!==r.class&&(t.class=Gi([t.class,r.class]));else if("style"===e)t.style=Vi([t.style,r.style]);else if(ui(e)){const n=t[e],o=r[e];!o||n===o||vi(n)&&n.includes(o)||(t[e]=n?[].concat(n,o):o)}else""!==e&&(t[e]=r[e])}return t}(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&$c(c),ref:t&&t.ref?n&&i?vi(i)?i.concat(Wc(t)):[i,Wc(t)]:Wc(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Nc?-1===a?16:16|a:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Gc(e.ssContent),ssFallback:e.ssFallback&&Gc(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&ml(d,l.clone(d)),d}function Zc(e=" ",t=0){return Uc(Hc,null,e,t)}function Xc(e){return null==e||"boolean"==typeof e?Uc(qc):vi(e)?Uc(Nc,null,e.slice()):Vc(e)?Kc(e):Uc(Hc,null,String(e))}function Kc(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Gc(e)}function Yc(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if(vi(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),Yc(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||vc(t)?3===r&&tl&&(1===tl.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=tl}}else wi(t)?(t={default:t,_ctx:tl},n=32):(t=String(t),64&r?(n=16,t=[Zc(t)]):n=8);e.children=t,e.shapeFlag|=n}function Jc(e,t,n,r=null){Ls(e,t,7,[n,r])}const Qc=nc();let ed=0,td=null;const nd=()=>td||tl;let rd,od;{const e=ji(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};rd=t("__VUE_INSTANCE_SETTERS__",e=>td=e),od=t("__VUE_SSR_SETTERS__",e=>ld=e)}const id=e=>{const t=td;return rd(e),e.scope.on(),()=>{e.scope.off(),rd(t)}},ad=()=>{td&&td.scope.off(),rd(null)};function sd(e){return 4&e.vnode.shapeFlag}let ld=!1;function cd(e,t,n){wi(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ci(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=ks(t)),dd(e)}function dd(e,t,n){const r=e.type;if(e.render||(e.render=r.render||ci),__VUE_OPTIONS_API__){const t=id(e);ga();try{!function(e){const t=Zl(e),n=e.proxy,r=e.ctx;Wl=!1,t.beforeCreate&&Ul(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:a,watch:s,provide:l,inject:c,created:d,beforeMount:u,mounted:h,beforeUpdate:p,updated:m,activated:f,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:w,render:x,renderTracked:k,renderTriggered:C,errorCaptured:_,serverPrefetch:S,expose:A,inheritAttrs:M,components:T,directives:E,filters:L}=t;if(c&&function(e,t){vi(e)&&(e=Jl(e));for(const n in e){const r=e[n];let o;o=Ci(r)?"default"in r?il(r.from||n,r.default,!0):il(r.from||n):il(r),gs(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(c,r),a)for(const I in a){const e=a[I];wi(e)&&(r[I]=e.bind(n))}if(o){const t=o.call(n,n);Ci(t)&&(e.data=is(t))}if(Wl=!0,i)for(const I in i){const e=i[I],t=wi(e)?e.bind(n,n):wi(e.get)?e.get.bind(n,n):ci,o=!wi(e)&&wi(e.set)?e.set.bind(n):ci,a=pd({get:t,set:o});Object.defineProperty(r,I,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(s)for(const I in s)Gl(s[I],r,n,I);if(l){const e=wi(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if(td){let n=td.provides;const r=td.parent&&td.parent.provides;r===n&&(n=td.provides=Object.create(r)),n[e]=t}}(t,e[t])})}function O(e,t){vi(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(d&&Ul(d,e,"c"),O(El,u),O(Ll,h),O(Ol,p),O(Il,m),O(Cl,f),O(_l,g),O(Nl,_),O(Dl,k),O(zl,C),O(Rl,y),O(Pl,w),O(Bl,S),vi(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===ci&&(e.render=x),null!=M&&(e.inheritAttrs=M),T&&(e.components=T),E&&(e.directives=E),S&&gl(e)}(e)}finally{va(),t()}}}const ud={get:(e,t)=>(Ma(e,0,""),e[t])};function hd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ks(function(e){return!gi(e,"__v_skip")&&Object.isExtensible(e)&&Ni(e,"__v_skip",!0),e}(e.exposed)),{get:(t,n)=>n in t?t[n]:n in jl?jl[n](e):void 0,has:(e,t)=>t in e||t in jl})):e.proxy}const pd=(e,t)=>_s(e,0,ld);function md(e,t,n){try{const r=arguments.length;return 2===r?Ci(t)&&!vi(t)?Vc(t)?Uc(e,null,[t]):Uc(e,t):Uc(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&Vc(n)&&(n=[n]),Uc(e,t,n))}finally{}}const fd="3.5.30";let gd;const vd="undefined"!=typeof window&&window.trustedTypes;if(vd)try{gd=vd.createPolicy("vue",{createHTML:e=>e})}catch(AT){}const yd=gd?e=>gd.createHTML(e):e=>e,bd="undefined"!=typeof document?document:null,wd=bd&&bd.createElement("template"),xd={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o="svg"===t?bd.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?bd.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?bd.createElement(e,{is:n}):bd.createElement(e);return"select"===e&&r&&null!=r.multiple&&o.setAttribute("multiple",r.multiple),o},createText:e=>bd.createTextNode(e),createComment:e=>bd.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>bd.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,i){const a=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),o!==i&&(o=o.nextSibling););else{wd.innerHTML=yd("svg"===r?`<svg>${e}</svg>`:"mathml"===r?`<math>${e}</math>`:e);const o=wd.content;if("svg"===r||"mathml"===r){const e=o.firstChild;for(;e.firstChild;)o.appendChild(e.firstChild);o.removeChild(e)}t.insertBefore(o,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},kd=Symbol("_vtc"),Cd=Symbol("_vod"),_d=Symbol("_vsh"),Sd=Symbol(""),Ad=/(?:^|;)\s*display\s*:/,Md=/\s*!important$/;function Td(e,t,n){if(vi(n))n.forEach(n=>Td(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=function(e,t){const n=Ld[t];if(n)return n;let r=Oi(t);if("filter"!==r&&r in e)return Ld[t]=r;r=Pi(r);for(let o=0;o<Ed.length;o++){const n=Ed[o]+r;if(n in e)return Ld[t]=n}return t}(e,t);Md.test(n)?e.setProperty(Ri(r),n.replace(Md,""),"important"):e[r]=n}}const Ed=["Webkit","Moz","ms"],Ld={},Od="http://www.w3.org/1999/xlink";function Id(e,t,n,r,o,i=Zi(t)){r&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(Od,t.slice(6,t.length)):e.setAttributeNS(Od,t,n):null==n||i&&!Xi(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ki(n)?String(n):n)}function Rd(e,t,n,r,o){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?yd(n):n));const i=e.tagName;if("value"===t&&"PROGRESS"!==i&&!i.includes("-")){const r="OPTION"===i?e.getAttribute("value")||"":e.value,o=null==n?"checkbox"===e.type?"on":"":String(n);return r===o&&"_value"in e||(e.value=o),null==n&&e.removeAttribute(t),void(e._value=n)}let a=!1;if(""===n||null==n){const r=typeof e[t];"boolean"===r?n=Xi(n):null==n&&"string"===r?(n="",a=!0):"number"===r&&(n=0,a=!0)}try{e[t]=n}catch(AT){}a&&e.removeAttribute(o||t)}const Pd=Symbol("_vei"),Bd=/(?:Once|Passive|Capture)$/;let zd=0;const Dd=Promise.resolve(),Nd=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Hd=pi({patchProp:(e,t,n,r,o,i)=>{const a="svg"===o;"class"===t?function(e,t,n){const r=e[kd];r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,a):"style"===t?function(e,t,n){const r=e.style,o=xi(n);let i=!1;if(n&&!o){if(t)if(xi(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Td(r,t,"")}else for(const e in t)null==n[e]&&Td(r,e,"");for(const e in n)"display"===e&&(i=!0),Td(r,e,n[e])}else if(o){if(t!==n){const e=r[Sd];e&&(n+=";"+e),r.cssText=n,i=Ad.test(n)}}else t&&e.removeAttribute("style");Cd in e&&(e[Cd]=i?r.display:"",e[_d]&&(r.display="none"))}(e,n,r):ui(t)?hi(t)||function(e,t,n,r,o=null){const i=e[Pd]||(e[Pd]={}),a=i[t];if(r&&a)a.value=r;else{const[n,s]=function(e){let t;if(Bd.test(e)){let n;for(t={};n=e.match(Bd);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):Ri(e.slice(2)),t]}(t);if(r){const a=i[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Ls(function(e,t){if(vi(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=zd||(Dd.then(()=>zd=0),zd=Date.now()),n}(r,o);!function(e,t,n,r){e.addEventListener(t,n,r)}(e,n,a,s)}else a&&(function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,a,s),i[t]=void 0)}}(e,t,0,r,i):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,r){if(r)return"innerHTML"===t||"textContent"===t||!!(t in e&&Nd(t)&&wi(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("sandbox"===t&&"IFRAME"===e.tagName)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!Nd(t)||!xi(n))&&t in e}(e,t,r,a))?(Rd(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||Id(e,t,r,a,0,"value"!==t)):e._isVueCE&&(function(e,t){const n=e._def.props;if(!n)return!1;const r=Oi(t);return Array.isArray(n)?n.some(e=>Oi(e)===r):Object.keys(n).some(e=>Oi(e)===r)}(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!xi(r)))?Rd(e,Oi(t),r,0,t):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),Id(e,t,r,a))}},xd);let qd;const jd=(...e)=>{const t=(qd||(qd=Lc(Hd))).createApp(...e),{mount:n}=t;return t.mount=e=>{const r=function(e){return xi(e)?document.querySelector(e):e}(e);if(!r)return;const o=t._component;wi(o)||o.render||o.template||(o.template=r.innerHTML),1===r.nodeType&&(r.textContent="");const i=n(r,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t};function Vd({icon:e,class:t,onClick:n}){return md("span",{class:On("milkdown-icon",t),onPointerdown:n,innerHTML:e?An.sanitize(e.trim()):void 0})}function Fd(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-block",...t}}),e}Vd.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var $d=a({filterNodes:e=>!A(e=>"table"===e.type.name)(e)},"blockConfig");Fd($d,{displayName:"Ctx<blockConfig>"});var Wd=E.ie&&E.ie_version<15||E.ios&&E.webkit_version<604,Ud=class{constructor(){this.#m=()=>{if(!this.#f)return null;const e=this.#f,t=this.#g;if(t&&M.isSelectable(e.node)){const n=M.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(n)),t.focus(),this.#v=n,n}return null},this.#v=null,this.#f=null,this.#y=void 0,this.#b=!1,this.#w=()=>{this.#x?.({type:"hide"}),this.#f=null},this.#k=e=>{this.#f=e,this.#x?.({type:"show",active:e})},this.bind=(e,t)=>{this.#C=e,this.#x=t},this.addEvent=e=>{e.addEventListener("mousedown",this.#_),e.addEventListener("mouseup",this.#S),e.addEventListener("dragstart",this.#A),e.addEventListener("dragend",this.#M)},this.removeEvent=e=>{e.removeEventListener("mousedown",this.#_),e.removeEventListener("mouseup",this.#S),e.removeEventListener("dragstart",this.#A),e.removeEventListener("dragend",this.#M)},this.unBind=()=>{this.#x=void 0},this.#_=()=>{this.#y=this.#f?.el.getBoundingClientRect(),this.#m()},this.#S=()=>{this.#b?(this.#b=!1,this.#v=null):requestAnimationFrame(()=>{this.#y&&this.#g?.focus()})},this.#A=e=>{this.#b=!0;const t=this.#g;if(!t)return;t.dom.dataset.dragging="true";const n=this.#v;if(e.dataTransfer&&n){const r=n.content();e.dataTransfer.effectAllowed="copyMove";const{dom:o,text:i}=t.serializeForClipboard(r);e.dataTransfer.clearData(),e.dataTransfer.setData(Wd?"Text":"text/html",o.innerHTML),Wd||e.dataTransfer.setData("text/plain",i);const a=this.#f?.el;a&&e.dataTransfer.setDragImage(a,0,0),t.dragging={slice:r,move:!0}}},this.#M=()=>{this.#g&&this.#T(this.#g)},this.keydownCallback=e=>(this.#w(),this.#b=!1,e.dom.dataset.dragging="false",!1),this.#E=vr((e,t)=>{if(!e.editable)return;const n=e.dom.getBoundingClientRect(),r=n.left+n.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element))return void this.#w();const o=this.#L;if(!o)return;const i=function(e,t,n){if(!e.dom.parentElement)return null;try{const r=e.posAtCoords({left:t.x,top:t.y})?.inside;if(null==r||r<0)return null;let o=e.state.doc.resolve(r),i=e.state.doc.nodeAt(r),a=e.nodeDOM(r);const s=t=>{const r=o.depth>=1&&0===o.index(o.depth);if(!t&&!r)return;const l=o.before(o.depth);i=e.state.doc.nodeAt(l),a=e.nodeDOM(l),o=e.state.doc.resolve(l),n(o,i)||s(!0)};return s(!n(o,i)),a&&i?{node:i,$pos:o,el:a}:null}catch{return null}}(e,{x:r,y:t.clientY},o);i?this.#k(i):this.#w()},200),this.mousemoveCallback=(e,t)=>(e.composing||!e.editable||this.#E(e,t),!1),this.dragoverCallback=(e,t)=>{if(this.#b){const n=this.#g?.dom.parentElement;if(!n)return!1;const r=n.scrollHeight>n.clientHeight,o=n.getBoundingClientRect();if(r){if(n.scrollTop>0&&Math.abs(t.y-o.y)<20)return n.scrollTop=n.scrollTop>10?n.scrollTop-10:0,!1;const r=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(n.scrollTop+o.height)<r&&Math.abs(t.y-(o.height+o.y))<20)return n.scrollTop=n.scrollTop+10,!1}}return!1},this.dragenterCallback=e=>{e.dragging&&(this.#b=!0,e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,t)=>{const n=t.clientX,r=t.clientY;(n<0||r<0||n>window.innerWidth||r>window.innerHeight)&&(this.#f=null,this.#T(e))},this.dropCallback=e=>(this.#T(e),!1),this.dragendCallback=e=>{this.#T(e)},this.#T=e=>{this.#b=!1,e.dom.dataset.dragging="false"}}#C;#m;#v;#f;#y;#b;get#L(){try{return this.#C?.get($d.key).filterNodes}catch{return}}get#g(){return this.#C?.get(T)}#x;#w;#k;#_;#S;#A;#M;#E;#T},Gd=a(()=>new Ud,"blockService"),Zd=a({},"blockServiceInstance");Fd(Gd,{displayName:"Ctx<blockService>"}),Fd(Zd,{displayName:"Ctx<blockServiceInstance>"});var Xd=a({},"blockSpec");Fd(Xd,{displayName:"Ctx<blockSpec>"});var Kd=s(e=>{const t=new d("MILKDOWN_BLOCK"),n=e.get(Gd.key)();e.set(Zd.key,n);const r=e.get(Xd.key);return new c({key:t,...r,props:{...r.props,handleDOMEvents:{drop:e=>n.dropCallback(e),pointermove:(e,t)=>n.mousemoveCallback(e,t),keydown:e=>n.keydownCallback(e),dragover:(e,t)=>n.dragoverCallback(e,t),dragleave:(e,t)=>n.dragleaveCallback(e,t),dragenter:e=>n.dragenterCallback(e),dragend:e=>n.dragendCallback(e)}}})});Fd(Kd,{displayName:"Prose<block>"});var Yd=class{#O;#C;#I;#R;#o;#i;#n;#r;#P;#B;#z;get active(){return this.#R}constructor(e){this.#R=null,this.#i=!1,this.update=()=>{requestAnimationFrame(()=>{if(!this.#i)try{this.#D(),this.#i=!0}catch{}})},this.destroy=()=>{this.#I?.unBind(),this.#I?.removeEvent(this.#O),this.#O.remove()},this.show=e=>{const t=e.el,n=this.#C.get(T).dom,r={ctx:this.#C,active:e,editorDom:n,blockDom:this.#O},o={contextElement:t,getBoundingClientRect:()=>this.#B?this.#B(r):t.getBoundingClientRect()},i=[w()];if(this.#P){const e=x(this.#P(r));i.push(e)}b(o,this.#O,{placement:this.#z?this.#z(r):"left",middleware:[...i,...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.#O.style,{left:`${e}px`,top:`${t}px`}),this.#O.dataset.show="true"}).catch(console.error)},this.hide=()=>{this.#O.dataset.show="false"},this.#C=e.ctx,this.#O=e.content,this.#P=e.getOffset,this.#B=e.getPosition,this.#z=e.getPlacement,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#o=e.root,this.hide()}#D(){const e=this.#C.get(T);(this.#o??e.dom.parentElement??document.body).appendChild(this.#O);const t=this.#C.get(Zd.key);t.bind(this.#C,e=>{"hide"===e.type?(this.hide(),this.#R=null):"show"===e.type&&(this.show(e.active),this.#R=e.active)}),this.#I=t,this.#I.addEvent(this.#O),this.#O.draggable=!0}},Jd=[Xd,$d,Gd,Zd,Kd];Jd.key=Xd.key,Jd.pluginKey=Kd.key;var Qd=class{#i;#n;#r;#o;#e;#N;#t;#c;#s;constructor(e){this.#i=!1,this.onShow=()=>{},this.onHide=()=>{},this.#h=(e,t)=>{const{state:n,composing:r}=e,{selection:o,doc:i}=n,{ranges:a}=o,s=Math.min(...a.map(e=>e.$from.pos)),l=Math.max(...a.map(e=>e.$to.pos)),c=t&&t.doc.eq(i)&&t.selection.eq(o);this.#i||((this.#o??e.dom.parentElement??document.body).appendChild(this.element),this.#i=!0),r||c||(this.#t(e,t)?(b({getBoundingClientRect:()=>_(e,s,l)},this.element,{placement:"bottom-start",middleware:[w(),x(this.#s),...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error),this.show()):this.hide())},this.#p=e=>{const t=this.getContent(e);if(!t)return!1;const n=t.at(-1);return!!n&&(Array.isArray(this.#N)?this.#N.includes(n):this.#N===n)},this.update=(e,t)=>{this.#c(e,t)},this.getContent=(e,t=e=>"paragraph"===e.type.name)=>{const{selection:n}=e.state,{empty:r,$from:o}=n,i=e.state.selection instanceof S;if("undefined"==typeof document)return;const a=this.element.contains(document.activeElement),s=!e.hasFocus()&&!a,l=!e.editable,c=!L(t)(e.state.selection);return s||l||!r||!i||c?void 0:o.parent.textBetween(Math.max(0,o.parentOffset-500),o.parentOffset,void 0,"")},this.destroy=()=>{this.#c.cancel()},this.show=()=>{this.element.dataset.show="true",this.onShow()},this.hide=()=>{this.element.dataset.show="false",this.onHide()},this.element=e.content,this.#e=e.debounce??200,this.#t=e.shouldShow??this.#p,this.#N=e.trigger??"/",this.#s=e.offset,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#o=e.root,this.#c=pr(this.#h,this.#e)}#h;#p};let eu=e=>crypto.getRandomValues(new Uint8Array(e)),tu=(e,t=21)=>((e,t,n)=>{let r=256-256%e.length;if(256===r){let r=e.length-1;return(o=t)=>{if(!o)return"";let i="";for(;;){let t=n(o),a=o;for(;a--;)if(i+=e[t[a]&r],i.length>=o)return i}}}let o=Math.ceil(409.6*t/r);return(i=t)=>{if(!i)return"";let a="";for(;;){let t=n(o),s=o;for(;s--;)if(t[s]<r&&(a+=e[t[s]%e.length],a.length>=i))return a}}})(e,0|t,eu);var nu=Object.defineProperty,ru=Object.getOwnPropertySymbols,ou=Object.prototype.hasOwnProperty,iu=Object.prototype.propertyIsEnumerable,au=(e,t,n)=>t in e?nu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,su=(e,t)=>{for(var n in t||(t={}))ou.call(t,n)&&au(e,n,t[n]);if(ru)for(var n of ru(t))iu.call(t,n)&&au(e,n,t[n]);return e};function lu(e,t){return Object.assign(e,{meta:su({package:"@milkdown/components"},t)}),e}const cu=a({imageIcon:"🌌",captionIcon:"💬",uploadButton:"Upload file",confirmButton:"Confirm ⏎",uploadPlaceholderText:"or paste the image link ...",captionPlaceholderText:"Image caption",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},"imageBlockConfigCtx");function du(e){return Et(e,"paragraph",(e,t,n)=>{var r,o;if(1!==(null==(r=e.children)?void 0:r.length))return;const i=null==(o=e.children)?void 0:o[0];if(!i||"image"!==i.type)return;const{url:a,alt:s,title:l}=i,c={type:"image-block",url:a,alt:s,title:l};n.children.splice(t,1,c)})}lu(cu,{displayName:"Config<image-block>",group:"ImageBlock"});const uu=O("remark-image-block",()=>()=>du);lu(uu.plugin,{displayName:"Remark<remarkImageBlock>",group:"ImageBlock"}),lu(uu.options,{displayName:"RemarkConfig<remarkImageBlock>",group:"ImageBlock"});var hu=Object.defineProperty,pu=Object.getOwnPropertySymbols,mu=Object.prototype.hasOwnProperty,fu=Object.prototype.propertyIsEnumerable,gu=(e,t,n)=>t in e?hu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vu=(e,t)=>{for(var n in t||(t={}))mu.call(t,n)&&gu(e,n,t[n]);if(pu)for(var n of pu(t))fu.call(t,n)&&gu(e,n,t[n]);return e};const yu="image-block",bu=I("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:"",validate:"string"},caption:{default:"",validate:"string"},ratio:{default:1,validate:"number"}},parseDOM:[{tag:`img[data-type="${yu}"]`,getAttrs:e=>{var t;if(!(e instanceof HTMLElement))throw P(e);return{src:e.getAttribute("src")||"",caption:e.getAttribute("caption")||"",ratio:Number(null!=(t=e.getAttribute("ratio"))?t:1)}}}],toDOM:e=>["img",vu({"data-type":yu},e.attrs)],parseMarkdown:{match:({type:e})=>"image-block"===e,runner:(e,t,n)=>{const r=t.url,o=t.title;let i=Number(t.alt||1);(Number.isNaN(i)||0===i)&&(i=1),e.addNode(n,{src:r,caption:o,ratio:i})}},toMarkdown:{match:e=>"image-block"===e.type.name,runner:(e,t)=>{e.openNode("paragraph"),e.addNode("image",void 0,void 0,{title:t.attrs.caption,url:t.attrs.src,alt:`${Number.parseFloat(t.attrs.ratio).toFixed(2)}`}),e.closeNode()}}}));function wu({icon:e,class:t,onClick:n}){return md("span",{class:On("milkdown-icon",t),onPointerdown:n,innerHTML:e?An.sanitize(e.trim()):void 0})}lu(bu.node,{displayName:"NodeSchema<image-block>",group:"ImageBlock"}),wu.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const xu=tu("abcdefg",8),ku=fl({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:o,uploadButton:i,confirmButton:a,uploadPlaceholderText:s,className:l,onImageLoadError:c}){var d,u;const h=vs(!1),p=vs(),m=vs(null!=(d=t.value)?d:""),f=vs(xu()),g=vs(0!==(null==(u=t.value)?void 0:u.length)),v=e=>{const t=e.target.value;g.value=0!==t.length,m.value=t},y=e=>{var t,r;"Enter"===e.key&&n(null!=(r=null==(t=p.value)?void 0:t.value)?r:"")},b=e=>{var t;const o=null==(t=e.target.files)?void 0:t[0];o&&r(o).then(e=>{e&&(n(e),g.value=!0)}).catch(e=>{console.error("An error occurred while uploading image"),console.error(e)})};return()=>md("div",{class:On("image-edit",l)},md(wu,{icon:o,class:"image-icon"}),md("div",{class:On("link-importer",h.value&&"focus")},md("input",{ref:p,draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:"link-input-area",value:m.value,onInput:v,onKeydown:y,onFocus:()=>h.value=!0,onBlur:()=>h.value=!1}),!g.value&&md("div",{class:"placeholder"},md("input",{disabled:e.value,class:"hidden",id:f.value,type:"file",accept:"image/*",onChange:b}),md("label",{class:"uploader",for:f.value},md(wu,{icon:i})),md("span",{class:"text",onClick:()=>{var e;return null==(e=p.value)?void 0:e.focus()}},s))),m.value&&md(Nc,null,md("div",{class:"image-preview"},md("img",{src:m.value,alt:"",onError:e=>Promise.resolve(null==c?void 0:c(e)).catch(()=>{})})),md("div",{class:"confirm",onClick:()=>(()=>{var e,t;n(null!=(t=null==(e=p.value)?void 0:e.value)?t:"")})()},md(wu,{icon:a}))))}}),Cu=fl({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup({src:e,caption:t,ratio:n,readonly:r,setAttr:o,config:i}){var a;const s=vs(),l=vs(),c=vs(Boolean(null==(a=t.value)?void 0:a.length)),d=vs(0),u=()=>{var e;const t=s.value;if(!t)return;const r=t.closest(".milkdown-image-block");if(!r)return;let o=r.getBoundingClientRect().width;if(!o)return;i.maxWidth&&i.maxWidth<o&&(o=i.maxWidth);const a=t.naturalHeight,l=t.naturalWidth;let c=l<o?a:o*(a/l);i.maxHeight&&c>i.maxHeight&&(c=i.maxHeight);const d=(c*(null!=(e=n.value)?e:1)).toFixed(2);t.dataset.origin=c.toFixed(2),t.dataset.height=d,t.style.height=`${d}px`,i.maxWidth&&(t.style.maxWidth=`${i.maxWidth}px`)},h=e=>{e.preventDefault(),e.stopPropagation(),r.value||(c.value=!c.value)},p=e=>{const t=e.target.value;d.value&&window.clearTimeout(d.value),d.value=window.setTimeout(()=>{o("caption",t)},1e3)},m=e=>{const t=e.target.value;d.value&&(window.clearTimeout(d.value),d.value=0),o("caption",t)},f=e=>{e.preventDefault();const t=s.value;if(!t)return;const n=t.getBoundingClientRect().top;let r=e.clientY-n;r<100&&(r=100),i.maxHeight&&r>i.maxHeight&&(r=i.maxHeight);const o=Number(r).toFixed(2);t.dataset.height=o,t.style.height=`${o}px`},g=()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",g);const e=s.value;if(!e)return;const t=Number(e.dataset.origin),n=Number(e.dataset.height),r=Number.parseFloat(Number(n/t).toFixed(2));Number.isNaN(r)||o("ratio",r)},v=e=>{r.value||(e.preventDefault(),e.stopPropagation(),window.addEventListener("pointermove",f),window.addEventListener("pointerup",g))};return()=>md(Nc,null,md("div",{class:"image-wrapper"},md("div",{class:"operation"},md("div",{class:"operation-item",onPointerdown:h},md(wu,{icon:i.captionIcon}))),md("img",{ref:s,"data-type":yu,onLoad:u,src:e.value,alt:t.value,onError:e=>{var t;return Promise.resolve(null==(t=i.onImageLoadError)?void 0:t.call(i,e)).catch(()=>{})}}),md("div",{ref:l,class:"image-resize-handle",onPointerdown:v})),c.value&&md("input",{draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},class:"caption-input",placeholder:null==i?void 0:i.captionPlaceholderText,onInput:p,onBlur:m,value:t.value}))}});var _u=Object.defineProperty,Su=Object.getOwnPropertySymbols,Au=Object.prototype.hasOwnProperty,Mu=Object.prototype.propertyIsEnumerable,Tu=(e,t,n)=>t in e?_u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const Eu=fl({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){const{src:t}=e;return()=>{var n;return(null==(n=t.value)?void 0:n.length)?md(Cu,((e,t)=>{for(var n in t||(t={}))Au.call(t,n)&&Tu(e,n,t[n]);if(Su)for(var n of Su(t))Mu.call(t,n)&&Tu(e,n,t[n]);return e})({},e)):md(ku,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr("src",t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,onImageLoadError:e.config.onImageLoadError})}}}),Lu=R(bu.node,e=>(t,n,r)=>{const o=vs(t.attrs.src),i=vs(t.attrs.caption),a=vs(t.attrs.ratio),s=vs(!1),l=vs(!n.editable),c=e.get(cu.key),d=jd(Eu,{src:o,caption:i,ratio:a,selected:s,readonly:l,setAttr:(e,t)=>{if(!n.editable)return;const o=r();null!=o&&n.dispatch(n.state.tr.setNodeAttribute(o,e,"src"===e?An.sanitize(t):t))},config:c}),u=document.createElement("div");u.className="milkdown-image-block";const h=sl(()=>{s.value?u.classList.add("selected"):u.classList.remove("selected")}),p=c.proxyDomURL,m=e=>{if(p){const t=p(e.attrs.src);"string"==typeof t?o.value=t:t.then(e=>{o.value=e}).catch(console.error)}else o.value=e.attrs.src;a.value=e.attrs.ratio,i.value=e.attrs.caption,l.value=!n.editable};return m(t),d.mount(u),{dom:u,update:e=>e.type===t.type&&(m(e),!0),stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{h(),d.unmount(),u.remove()}}});lu(Lu,{displayName:"NodeView<image-block>",group:"ImageBlock"});const Ou=[uu,bu,Lu,cu].flat();let Iu,Ru;if("undefined"!=typeof WeakMap){let e=new WeakMap;Iu=t=>e.get(t),Ru=(t,n)=>(e.set(t,n),n)}else{const e=[],t=10;let n=0;Iu=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Ru=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}var Pu=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,o=t/this.width|0;let i=r+1,a=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;a<this.height&&this.map[t+this.width*e]==n;e++)a++;return{left:r,top:o,right:i,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:o,top:i,bottom:a}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:a==this.height)?null:this.map[r+this.width*(n<0?i-1:a)]}rectBetween(e,t){const{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:a,right:s,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,a),top:Math.min(o,l),right:Math.max(r,s),bottom:Math.max(i,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){const i=r*this.width+o,a=this.map[i];n[a]||(n[a]=!0,o==e.left&&o&&this.map[i-1]==a||r==e.top&&r&&this.map[i-this.width]==a||t.push(a))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width;const r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return Iu(e)||Ru(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);const t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const o=e.child(r);let i=0;if(n)for(let t=0;t<r;t++){const n=e.child(t);for(let e=0;e<n.childCount;e++){const o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){const t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[];let o=0,i=null;const a=[];for(let c=0,d=t*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){const s=e.child(c);d++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==s.childCount)break;const l=s.child(e),{colspan:u,rowspan:h,colwidth:p}=l.attrs;for(let e=0;e<h;e++){if(e+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:d,n:h-e});break}const s=o+e*t;for(let e=0;e<u;e++){0==r[s+e]?r[s+e]=d:(i||(i=[])).push({type:"collision",row:c,pos:d,n:u-e});const n=p&&p[e];if(n){const r=(s+e)%t*2,o=a[r];null==o||o!=n&&1==a[r+1]?(a[r]=n,a[r+1]=1):o==n&&a[r+1]++}}}o+=u,d+=l.nodeSize}const l=(c+1)*t;let u=0;for(;o<l;)0==r[o++]&&u++;u&&(i||(i=[])).push({type:"missing",row:c,n:u}),d++}0!==t&&0!==n||(i||(i=[])).push({type:"zero_sized"});const s=new Pu(t,n,r,i);let l=!1;for(let c=0;!l&&c<a.length;c+=2)null!=a[c]&&a[c+1]<n&&(l=!0);return l&&function(e,t,n){e.problems||(e.problems=[]);const r={};for(let o=0;o<e.map.length;o++){const i=e.map[o];if(r[i])continue;r[i]=!0;const a=n.nodeAt(i);if(!a)throw new RangeError(`No cell with offset ${i} found`);let s=null;const l=a.attrs;for(let n=0;n<l.colspan;n++){const r=t[(o+n)%e.width*2];null==r||l.colwidth&&l.colwidth[n]==r||((s||(s=Bu(l)))[n]=r)}s&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}(s,a,e),s}(e))}};function Bu(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function zu(e,t){if("string"==typeof e)return{};const n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(e=>Number(e)):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(const a in t){const n=t[a].getFromDOM,r=n&&n(e);null!=r&&(i[a]=r)}return i}function Du(e,t){const n={};1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(const r in t){const o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function Nu(e){if(null!==e){if(!Array.isArray(e))throw new TypeError("colwidth must be null or an array");for(const t of e)if("number"!=typeof t)throw new TypeError("colwidth must be null or an array of numbers")}}function Hu(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}const qu=new d("selectingCells");function ju(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function Vu(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function Fu(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;const n=ju(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function $u(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function Wu(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Uu(e,t,n){const r=e.node(-1),o=Pu.get(r),i=e.start(-1),a=o.nextCell(e.pos-i,t,n);return null==a?null:e.node(0).resolve(i+a)}function Gu(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Zu(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}var Xu=class e extends z{constructor(e,t=e){const n=e.node(-1),r=Pu.get(n),o=e.start(-1),i=r.rectBetween(e.pos-o,t.pos-o),a=e.node(0),s=r.cellsInRect(i).filter(e=>e!=t.pos-o);s.unshift(t.pos-o);const l=s.map(e=>{const t=n.nodeAt(e);if(!t)throw new RangeError(`No cell with offset ${e} found`);const r=o+e+1;return new D(a.resolve(r),a.resolve(r+t.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=t}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if($u(r)&&$u(o)&&Wu(r,o)){const t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,o):t&&this.isColSelection()?e.colSelection(r,o):new e(r,o)}return S.between(r,o)}content(){const e=this.$anchorCell.node(-1),t=Pu.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let s=r.top;s<r.bottom;s++){const n=[];for(let i=s*t.width+r.left,a=r.left;a<r.right;a++,i++){const a=t.map[i];if(o[a])continue;o[a]=!0;const s=t.findCell(a);let l=e.nodeAt(a);if(!l)throw new RangeError(`No cell with offset ${a} found`);const c=r.left-s.left,d=s.right-r.right;if(c>0||d>0){let e=l.attrs;if(c>0&&(e=Gu(e,0,c)),d>0&&(e=Gu(e,e.colspan-d,d)),s.left<r.left){if(l=l.type.createAndFill(e),!l)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else l=l.type.create(e,l.content)}if(s.top<r.top||s.bottom>r.bottom){const e={...l.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};l=s.top<r.top?l.type.createAndFill(e):l.type.create(e,l.content)}n.push(l)}i.push(e.child(s).copy(m.from(n)))}const a=this.isColSelection()&&this.isRowSelection()?e:i;return new p(m.from(a),1,1)}replace(e,t=p.empty){const n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){const{$from:o,$to:a}=r[i],s=e.mapping.slice(n);e.replace(s.map(o.pos),s.map(a.pos),i?p.empty:t)}const o=z.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new p(m.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=Pu.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),o=Pu.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),l=t.node(0);return a.top<=s.top?(a.top>0&&(t=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(n=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))):(s.top>0&&(n=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(t=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))),new e(t,n)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Pu.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),o=t.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;const i=r+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,a)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),o=Pu.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),l=t.node(0);return a.left<=s.left?(a.left>0&&(t=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(n=l.resolve(i+o.map[o.width*(s.top+1)-1]))):(s.left>0&&(n=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(t=l.resolve(i+o.map[o.width*(a.top+1)-1]))),new e(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Ku(this.$anchorCell.pos,this.$headCell.pos)}};Xu.prototype.visible=!1,z.jsonID("cell",Xu);var Ku=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Wu(t,n)?new Xu(t,n):z.near(n,1)}};function Yu(e){if(!(e.selection instanceof Xu))return null;const t=[];return e.selection.forEachCell((e,n)=>{t.push(v.node(n,n+e.nodeSize,{class:"selectedCell"}))}),f.create(e.doc,t)}const Ju=new d("fix-tables");function Qu(e,t,n,r){const o=e.childCount,i=t.childCount;e:for(let a=0,s=0;a<i;a++){const i=t.child(a);for(let t=s,r=Math.min(o,a+3);t<r;t++)if(e.child(t)==i){s=t+1,n+=i.nodeSize;continue e}r(i,n),s<o&&e.child(s).sameMarkup(i)?Qu(e.child(s),i,n+1,r):i.nodesBetween(0,i.content.size,r,n+1),n+=i.nodeSize}}function eh(e,t){let n;const r=(t,r)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){const o=Pu.get(t);if(!o.problems)return r;r||(r=e.tr);const i=[];for(let l=0;l<o.height;l++)i.push(0);for(let l=0;l<o.problems.length;l++){const e=o.problems[l];if("collision"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;const a=o.attrs;for(let t=0;t<a.rowspan;t++)i[e.row+t]+=e.n;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,Gu(a,a.colspan-e.n,e.n))}else if("missing"==e.type)i[e.row]+=e.n;else if("overlong_rowspan"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,{...o.attrs,rowspan:o.attrs.rowspan-e.n})}else if("colwidth mismatch"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,{...o.attrs,colwidth:e.colwidth})}else if("zero_sized"==e.type){const e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let a,s;for(let l=0;l<i.length;l++)i[l]&&(null==a&&(a=l),s=l);for(let l=0,c=n+1;l<o.height;l++){const n=t.child(l),o=c+n.nodeSize,d=i[l];if(d>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);const i=[];for(let n=0;n<d;n++){const n=Hu(e.schema)[t].createAndFill();n&&i.push(n)}const u=0!=l&&a!=l-1||s!=l?o-1:c+1;r.insert(r.mapping.map(u),i)}c=o}return r.setMeta(Ju,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&Qu(t.doc,e.doc,0,r):e.doc.descendants(r),n}function th(e){const t=Pu.get(e),n=[],r=t.height,o=t.width;for(let i=0;i<r;i++){const r=[];for(let n=0;n<o;n++){const a=i*o+n,s=t.map[a];if(i>0){const e=a-o;if(s===t.map[e]){r.push(null);continue}}if(n>0){const e=a-1;if(s===t.map[e]){r.push(null);continue}}r.push(e.nodeAt(s))}n.push(r)}return n}function nh(e,t){const n=[],r=Pu.get(e),o=r.height,i=r.width;for(let a=0;a<o;a++){const o=e.child(a),s=[];for(let n=0;n<i;n++){const o=t[a][n];if(!o)continue;const i=r.map[a*r.width+n],l=e.nodeAt(i);if(!l)continue;const c=l.type.createChecked(o.attrs,o.content,o.marks);s.push(c)}const l=o.type.createChecked(o.attrs,s,o.marks);n.push(l)}return e.type.createChecked(e.attrs,n,e.marks)}function rh(e,t,n,r){const o=t[0]>n[0]?-1:1,i=e.splice(t[0],t.length),a=i.length%2==0?1:0;let s;return s=-1===o?n[0]:n[n.length-1]-a,e.splice(s,0,...i),e}function oh(e){return function(e,t){for(let n=t.depth;n>=0;n-=1){const r=t.node(n);if(e(r))return{node:r,pos:0===n?0:t.before(n),start:t.start(n),depth:n}}return null}(e=>"table"===e.type.spec.tableRole,e)}function ih(e,t){const n=oh(t.$from);if(!n)return;const r=Pu.get(n.node);return e<0||e>r.width-1?void 0:r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map(e=>{const t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function ah(e,t){const n=oh(t.$from);if(!n)return;const r=Pu.get(n.node);return e<0||e>r.height-1?void 0:r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map(e=>{const t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function sh(e,t,n=t){let r=t,o=n;for(let d=t;d>=0;d--){const t=ih(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.colspan+d-1;t>=r&&(r=d),t>o&&(o=t)})}for(let d=t;d<=o;d++){const t=ih(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.colspan+d-1;e.node.attrs.colspan>1&&t>o&&(o=t)})}const i=[];for(let d=r;d<=o;d++){const t=ih(d,e.selection);t&&t.length>0&&i.push(d)}r=i[0],o=i[i.length-1];const a=ih(r,e.selection),s=ah(0,e.selection);if(!a||!s)return;const l=e.doc.resolve(a[a.length-1].pos);let c;for(let d=o;d>=r;d--){const t=ih(d,e.selection);if(t&&t.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===t[0].pos){c=t[0];break}if(c)break}}return c?{$anchor:l,$head:e.doc.resolve(c.pos),indexes:i}:void 0}function lh(e,t,n=t){let r=t,o=n;for(let d=t;d>=0;d--){const t=ah(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.rowspan+d-1;t>=r&&(r=d),t>o&&(o=t)})}for(let d=t;d<=o;d++){const t=ah(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.rowspan+d-1;e.node.attrs.rowspan>1&&t>o&&(o=t)})}const i=[];for(let d=r;d<=o;d++){const t=ah(d,e.selection);t&&t.length>0&&i.push(d)}r=i[0],o=i[i.length-1];const a=ah(r,e.selection),s=ih(0,e.selection);if(!a||!s)return;const l=e.doc.resolve(a[a.length-1].pos);let c;for(let d=o;d>=r;d--){const t=ah(d,e.selection);if(t&&t.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===t[0].pos){c=t[0];break}if(c)break}}return c?{$anchor:l,$head:e.doc.resolve(c.pos),indexes:i}:void 0}function ch(e){return e[0].map((t,n)=>e.map(e=>e[n]))}function dh(e){const t=e.selection,n=Fu(e),r=n.node(-1),o=n.start(-1),i=Pu.get(r);return{...t instanceof Xu?i.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function uh(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;(function(e,t,n){const r=Hu(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(t,r,o+i)&&(i=0==o||o==t.width?null:0);for(let a=0;a<t.height;a++){const s=a*t.width+o;if(o>0&&o<t.width&&t.map[s-1]==t.map[s]){const i=t.map[s],l=r.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,Zu(l.attrs,o-t.colCount(i))),a+=l.attrs.rowspan-1}else{const l=null==i?Hu(r.type.schema).cell:r.nodeAt(t.map[s+i]).type,c=t.positionAt(a,o,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function hh(e,t){if(!Vu(e))return!1;if(t){const n=dh(e);t(uh(e.tr,n,n.left))}return!0}function ph(e,t){if(!Vu(e))return!1;if(t){const n=dh(e);t(uh(e.tr,n,n.right))}return!0}function mh(e,{map:t,table:n,tableStart:r},o){const i=e.mapping.maps.length;for(let a=0;a<t.height;){const s=a*t.width+o,l=t.map[s],c=n.nodeAt(l),d=c.attrs;if(o>0&&t.map[s-1]==l||o<t.width-1&&t.map[s+1]==l)e.setNodeMarkup(e.mapping.slice(i).map(r+l),null,Gu(d,o-t.colCount(l)));else{const t=e.mapping.slice(i).map(r+l);e.delete(t,t+c.nodeSize)}a+=d.rowspan}}function fh(e,{map:t,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const a=i+n.child(o).nodeSize,s=e.mapping.maps.length;e.delete(i+r,a+r);const l=new Set;for(let c=0,d=o*t.width;c<t.width;c++,d++){const i=t.map[d];if(!l.has(i))if(l.add(i),o>0&&i==t.map[d-t.width]){const t=n.nodeAt(i).attrs;e.setNodeMarkup(e.mapping.slice(s).map(i+r),null,{...t,rowspan:t.rowspan-1}),c+=t.colspan-1}else if(o<t.height&&i==t.map[d+t.width]){const a=n.nodeAt(i),l=a.attrs,d=a.type.create({...l,rowspan:a.attrs.rowspan-1},a.content),u=t.positionAt(o+1,c,n);e.insert(e.mapping.slice(s).map(r+u),d),c+=l.colspan-1}}}function gh(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let o=0;o<r.length;o++){const e=t.table.nodeAt(r[o]);if(e&&e.type!==n.header_cell)return!1}return!0}function vh(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!Vu(t))return!1;if(n){const r=Hu(t.schema),o=dh(t),i=t.tr,a=o.map.cellsInRect("column"==e?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==e?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),s=a.map(e=>o.table.nodeAt(e));for(let e=0;e<a.length;e++)s[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[e],r.cell,s[e].attrs);if(0===i.steps.length)for(let e=0;e<a.length;e++)i.setNodeMarkup(o.tableStart+a[e],r.header_cell,s[e].attrs);n(i)}return!0}}(e):function(t,n){if(!Vu(t))return!1;if(n){const r=Hu(t.schema),o=dh(t),i=t.tr,a=gh("row",o,r),s=gh("column",o,r),l=("column"===e?a:"row"===e&&s)?1:0,c="column"==e?{left:0,top:l,right:1,bottom:o.map.height}:"row"==e?{left:l,top:0,right:o.map.width,bottom:1}:o,d="column"==e?s?r.cell:r.header_cell:"row"==e?a?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach(e=>{const t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,d,n.attrs)}),n(i)}return!0}}function yh(e){return function(t,n){if(!Vu(t))return!1;const r=function(e,t){if(t<0){const t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let n=e.index(-1)-1,r=e.before();n>=0;n--){const t=e.node(-1).child(n),o=t.lastChild;if(o)return r-1-o.nodeSize;r-=t.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){const e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}(Fu(t),e);if(null==r)return!1;if(n){const e=t.doc.resolve(r);n(t.tr.setSelection(S.between(e,function(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}(e))).scrollIntoView())}return!0}}function bh(e,t){const n=e.selection;if(!(n instanceof Xu))return!1;if(t){const r=e.tr,o=Hu(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new p(o,0,0))}),r.docChanged&&t(r)}return!0}function wh(e,t){const n=e.createAndFill();return new N(n).replace(0,n.content.size,t).doc}function xh(e,t,n,r,o,i,a,s){if(0==a||a==t.height)return!1;let l=!1;for(let c=o;c<i;c++){const o=a*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){l=!0;const o=n.nodeAt(i),{top:d,left:u}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(s).map(i+r),null,{...o.attrs,rowspan:a-d}),e.insert(e.mapping.slice(s).map(t.positionAt(a,u,n)),o.type.createAndFill({...o.attrs,rowspan:d+o.attrs.rowspan-a})),c+=o.attrs.colspan-1}}return l}function kh(e,t,n,r,o,i,a,s){if(0==a||a==t.width)return!1;let l=!1;for(let c=o;c<i;c++){const o=c*t.width+a,i=t.map[o];if(t.map[o-1]==i){l=!0;const o=n.nodeAt(i),d=t.colCount(i),u=e.mapping.slice(s).map(i+r);e.setNodeMarkup(u,null,Gu(o.attrs,a-d,o.attrs.colspan-(a-d))),e.insert(u+o.nodeSize,o.type.createAndFill(Gu(o.attrs,0,a-d))),c+=o.attrs.rowspan-1}}return l}function Ch(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw new Error("No table found");let a=Pu.get(i);const{top:s,left:l}=r,c=l+o.width,d=s+o.height,u=e.tr;let h=0;function f(){if(i=n?u.doc.nodeAt(n-1):u.doc,!i)throw new Error("No table found");a=Pu.get(i),h=u.mapping.maps.length}(function(e,t,n,r,o,i,a){const s=Hu(e.doc.type.schema);let l,c;if(o>t.width)for(let d=0,u=0;d<t.height;d++){const i=n.child(d);u+=i.nodeSize;const h=[];let p;p=null==i.lastChild||i.lastChild.type==s.cell?l||(l=s.cell.createAndFill()):c||(c=s.header_cell.createAndFill());for(let e=t.width;e<o;e++)h.push(p);e.insert(e.mapping.slice(a).map(u-1+r),h)}if(i>t.height){const d=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){const o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==s.header_cell;d.push(o?c||(c=s.header_cell.createAndFill()):l||(l=s.cell.createAndFill()))}const u=s.row.create(null,m.from(d)),h=[];for(let e=t.height;e<i;e++)h.push(u);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),h)}return!(!l&&!c)})(u,a,i,n,c,d,h)&&f(),xh(u,a,i,n,l,c,s,h)&&f(),xh(u,a,i,n,l,c,d,h)&&f(),kh(u,a,i,n,s,d,l,h)&&f(),kh(u,a,i,n,s,d,c,h)&&f();for(let m=s;m<d;m++){const e=a.positionAt(m,l,i),t=a.positionAt(m,c,i);u.replace(u.mapping.slice(h).map(e+n),u.mapping.slice(h).map(t+n),new p(o.rows[m-s],0,0))}f(),u.setSelection(new Xu(u.doc.resolve(n+a.positionAt(s,l,i)),u.doc.resolve(n+a.positionAt(d-1,c-1,i)))),t(u)}vh("row",{useDeprecatedLogic:!0}),vh("column",{useDeprecatedLogic:!0}),vh("cell",{useDeprecatedLogic:!0});const _h=B({ArrowLeft:Ah("horiz",-1),ArrowRight:Ah("horiz",1),ArrowUp:Ah("vert",-1),ArrowDown:Ah("vert",1),"Shift-ArrowLeft":Mh("horiz",-1),"Shift-ArrowRight":Mh("horiz",1),"Shift-ArrowUp":Mh("vert",-1),"Shift-ArrowDown":Mh("vert",1),Backspace:bh,"Mod-Backspace":bh,Delete:bh,"Mod-Delete":bh});function Sh(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Ah(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof Xu)return Sh(n,r,z.near(i.$headCell,t));if("horiz"!=e&&!i.empty)return!1;const a=Oh(o,e,t);if(null==a)return!1;if("horiz"==e)return Sh(n,r,z.near(n.doc.resolve(i.head+t),t));{const o=n.doc.resolve(a),i=Uu(o,e,t);let s;return s=i?z.near(i,1):t<0?z.near(n.doc.resolve(o.before(-1)),-1):z.near(n.doc.resolve(o.after(-1)),1),Sh(n,r,s)}}}function Mh(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let a;if(i instanceof Xu)a=i;else{const r=Oh(o,e,t);if(null==r)return!1;a=new Xu(n.doc.resolve(r))}const s=Uu(a.$headCell,e,t);return!!s&&Sh(n,r,new Xu(a.$anchorCell,s))}}function Th(e,t){const n=ju(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new Xu(n))),!0)}function Eh(e,t,n){if(!Vu(e.state))return!1;let r=function(e){if(0===e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.child(0).type.spec.tableRole);)n--,r--,t=t.child(0).content;const o=t.child(0),i=o.type.spec.tableRole,a=o.type.schema,s=[];if("row"==i)for(let l=0;l<t.childCount;l++){let e=t.child(l).content;const o=l?0:Math.max(0,n-1),i=l<t.childCount-1?0:Math.max(0,r-1);(o||i)&&(e=wh(Hu(a).row,new p(e,o,i)).content),s.push(e)}else{if("cell"!=i&&"header_cell"!=i)return null;s.push(n||r?wh(Hu(a).row,new p(t,n,r)).content:t)}return function(e,t){const n=[];for(let o=0;o<t.length;o++){const e=t[o];for(let t=e.childCount-1;t>=0;t--){const{rowspan:r,colspan:i}=e.child(t).attrs;for(let e=o;e<o+r;e++)n[e]=(n[e]||0)+i}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(m.empty),n[o]<r){const i=Hu(e).cell.createAndFill(),a=[];for(let e=n[o];e<r;e++)a.push(i);t[o]=t[o].append(m.from(a))}return{height:t.length,width:r,rows:t}}(a,s)}(n);const o=e.state.selection;if(o instanceof Xu){r||(r={width:1,height:1,rows:[m.from(wh(Hu(e.state.schema).cell,n))]});const t=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),a=Pu.get(t).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:e,height:t,rows:n},r,o){if(e!=r){const t=[],o=[];for(let e=0;e<n.length;e++){const i=n[e],a=[];for(let n=t[e]||0,o=0;n<r;o++){let s=i.child(o%i.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Gu(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),a.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}o.push(m.from(a))}n=o,e=r}if(t!=o){const e=[];for(let r=0,i=0;r<o;r++,i++){const a=[],s=n[i%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>o&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,o-t.attrs.rowspan)},t.content)),a.push(t)}e.push(m.from(a))}n=e,t=o}return{width:e,height:t,rows:n}}(r,a.right-a.left,a.bottom-a.top),Ch(e.state,e.dispatch,i,a,r),!0}if(r){const t=Fu(e.state),n=t.start(-1);return Ch(e.state,e.dispatch,n,Pu.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function Lh(e,t){var n;if(0!=t.button)return;if(t.ctrlKey||t.metaKey)return;const r=Ih(e,t.target);let o;if(t.shiftKey&&e.state.selection instanceof Xu)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(o=ju(e.state.selection.$anchor))&&(null===(n=Rh(e,t))||void 0===n?void 0:n.pos)!=o.pos)i(o,t),t.preventDefault();else if(!r)return;function i(t,n){let r=Rh(e,n);const o=null==qu.getState(e.state);if(!r||!Wu(t,r)){if(!o)return;r=t}const i=new Xu(t,r);if(o||!e.state.selection.eq(i)){const n=e.state.tr.setSelection(i);o&&n.setMeta(qu,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener("mouseup",a),e.root.removeEventListener("dragstart",a),e.root.removeEventListener("mousemove",s),null!=qu.getState(e.state)&&e.dispatch(e.state.tr.setMeta(qu,-1))}function s(n){const o=n,s=qu.getState(e.state);let l;if(null!=s)l=e.state.doc.resolve(s);else if(Ih(e,o.target)!=r&&(l=Rh(e,t),!l))return a();l&&i(l,o)}e.root.addEventListener("mouseup",a),e.root.addEventListener("dragstart",a),e.root.addEventListener("mousemove",s)}function Oh(e,t,n){if(!(e.state.selection instanceof S))return null;const{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){const i=r.before(o),a="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(a)?i:null}}return null}function Ih(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function Rh(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:o}=n;return r>=0&&ju(e.state.doc.resolve(r))||ju(e.state.doc.resolve(o))}var Ph=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Bh(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,Bh(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function Bh(e,t,n,r,o,i){let a=0,s=!0,l=t.firstChild;const c=e.firstChild;if(c){for(let e=0,n=0;e<c.childCount;e++){const{colspan:d,colwidth:u}=c.child(e).attrs;for(let e=0;e<d;e++,n++){const c=o==n?i:u&&u[e],d=c?c+"px":"";if(a+=c||r,c||(s=!1),l)l.style.width!=d&&(l.style.width=d),l=l.nextSibling;else{const e=document.createElement("col");e.style.width=d,t.appendChild(e)}}}for(;l;){var d;const e=l.nextSibling;null===(d=l.parentNode)||void 0===d||d.removeChild(l),l=e}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}const zh=new d("tableColumnResizing");var Dh=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){const n=this,r=t.getMeta(zh);if(r&&null!=r.setHandle)return new e(r.setHandle,!1);if(r&&void 0!==r.setDragging)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return $u(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Nh(e,t,n,r){const o="right"==n?-r:r,i=e.posAtCoords({left:t.clientX+o,top:t.clientY});if(!i)return-1;const{pos:a}=i,s=ju(e.state.doc.resolve(a));if(!s)return-1;if("right"==n)return s.pos;const l=Pu.get(s.node(-1)),c=s.start(-1),d=l.map.indexOf(s.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function Hh(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function qh(e,t){e.dispatch(e.state.tr.setMeta(zh,{setHandle:t}))}function jh(e,t,n,r){const o=e.state.doc.resolve(t),i=o.node(-1),a=o.start(-1),s=Pu.get(i).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let l=e.domAtPos(o.start(-1)).node;for(;l&&"TABLE"!=l.nodeName;)l=l.parentNode;l&&Bh(i,l.firstChild,l,r,s,n)}function Vh(e){return Array(e).fill(0)}var Fh="undefined"!=typeof navigator?navigator:null,$h=Fh&&Fh.userAgent||"",Wh=/Edge\/(\d+)/.exec($h),Uh=/MSIE \d/.exec($h),Gh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($h),Zh=!(Uh||Gh||Wh)&&!!Fh&&/Apple Computer/.test(Fh.vendor),Xh=new d("safari-ime-span"),Kh=!1;function Yh(e){const t=e.dom.ownerDocument.createElement("span");return t.className="ProseMirror-safari-ime-span",t}var Jh=new c(Zh?{key:Xh,props:{decorations:function(e){const{$from:t,$to:n,to:r}=e.selection;if(Kh&&t.sameParent(n)){const t=v.widget(r,Yh,{ignoreSelection:!0,key:"safari-ime-span"});return f.create(e.doc,[t])}},handleDOMEvents:{compositionstart:()=>{Kh=!0},compositionend:()=>{Kh=!1}}}}:{key:Xh});function Qh(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e}var ep=q("strike_through");Qh(ep,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var tp=j("strike_through",e=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>"line-through"===e}],toDOM:t=>["del",e.get(ep.key)(t)],parseMarkdown:{match:e=>"delete"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strike_through"===e.type.name,runner:(e,t)=>{e.withMark(t,"delete")}}}));Qh(tp.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"}),Qh(tp.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var np=l("ToggleStrikeThrough",e=>()=>G(tp.type(e)));Qh(np,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var rp=V(e=>U(new RegExp("(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)"),tp.type(e)));Qh(rp,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var op=$("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{const t=e.get(g);return()=>t.call(np.key)}}});Qh(op.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"}),Qh(op.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});var ip=function(e){const t=e.cellAttributes||{},n={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:Nu}};for(const r in t)n[r]={default:t[r].default,validate:t[r].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:()=>["table",["tbody",0]]},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:()=>["tr",0]},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:e=>zu(e,t)}],toDOM:e=>["td",Du(e,t),0]},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:e=>zu(e,t)}],toDOM:e=>["th",Du(e,t),0]}}}({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),ap=I("table",()=>({...ip.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:e=>"table"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map((e,t)=>({...e,align:r,isHeader:0===t}));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table"===e.type.name,runner:(e,t)=>{const n=t.content.firstChild?.content;if(!n)return;const r=[];n.forEach(e=>{r.push(e.attrs.alignment)}),e.openNode("table",void 0,{align:r}),e.next(t.content),e.closeNode()}}}));Qh(ap.node,{displayName:"NodeSchema<table>",group:"Table"}),Qh(ap.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var sp=I("table_header_row",()=>({...ip.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:e=>e instanceof HTMLElement&&!!e.querySelector("th")&&{}}],toDOM:()=>["tr",{"data-is-header":!0},0],parseMarkdown:{match:e=>Boolean("tableRow"===e.type&&e.isHeader),runner:(e,t,n)=>{const r=t.align,o=t.children.map((e,n)=>({...e,align:r[n],isHeader:t.isHeader}));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table_header_row"===e.type.name,runner:(e,t)=>{0!==t.content.size&&(e.openNode("tableRow",void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));Qh(sp.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"}),Qh(sp.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var lp=I("table_row",()=>({...ip.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:e=>"tableRow"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map((e,t)=>({...e,align:r[t]}));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table_row"===e.type.name,runner:(e,t)=>{0!==t.content.size&&(e.openNode("tableRow"),e.next(t.content),e.closeNode())}}}));Qh(lp.node,{displayName:"NodeSchema<tableRow>",group:"Table"}),Qh(lp.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var cp=I("table_cell",()=>({...ip.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>"table_cell"===e.type.name,runner:(e,t)=>{e.openNode("tableCell").next(t.content).closeNode()}}}));Qh(cp.node,{displayName:"NodeSchema<tableCell>",group:"Table"}),Qh(cp.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var dp=I("table_header",()=>({...ip.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>"table_header"===e.type.name,runner:(e,t)=>{e.openNode("tableCell"),e.next(t.content),e.closeNode()}}}));function up(e,t=3,n=3){const r=Array(n).fill(0).map(()=>cp.type(e).createAndFill()),o=Array(n).fill(0).map(()=>dp.type(e).createAndFill()),i=Array(t).fill(0).map((t,n)=>0===n?sp.type(e).create(null,o):lp.type(e).create(null,r));return ap.type(e).create(null,i)}function hp(e){return(t,n)=>r=>{n=n??r.selection.from;const o=r.doc.resolve(n),i=K(e=>"table"===e.type.name)(o),a=i?{node:i.node,from:i.start}:void 0,s="row"===e;if(a){const e=Pu.get(a.node);if(t>=0&&t<(s?e.height:e.width)){const n=e.positionAt(s?t:e.height-1,s?e.width-1:t,a.node),o=r.doc.resolve(a.from+n),i=s?Xu.rowSelection:Xu.colSelection,l=e.positionAt(s?t:0,s?0:t,a.node),c=r.doc.resolve(a.from+l);return Y(r.setSelection(i(o,c)))}}return r}}Qh(dp.node,{displayName:"NodeSchema<tableHeader>",group:"Table"}),Qh(dp.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});var pp=hp("row"),mp=hp("col");function fp(e,t,{map:n,tableStart:r,table:o},i){const a=Array(i).fill(0).reduce((e,t,n)=>e+o.child(n).nodeSize,r),s=Array(n.width).fill(0).map((t,r)=>{const i=o.nodeAt(n.map[r]);return cp.type(e).createAndFill({alignment:i?.attrs.alignment})});return t.insert(a,lp.type(e).create(null,s)),t}var gp=l("GoToPrevTableCell",()=>()=>yh(-1));Qh(gp,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var vp=l("GoToNextTableCell",()=>()=>yh(1));Qh(vp,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var yp=l("ExitTable",e=>()=>(t,n)=>{if(!Vu(t))return!1;const{$head:r}=t.selection,o=Z(r,ap.type(e));if(!o)return!1;const{to:i}=o,a=t.tr.replaceWith(i,i,X.type(e).createAndFill());return a.setSelection(z.near(a.doc.resolve(i),1)).scrollIntoView(),n?.(a),!0});Qh(yp,{displayName:"Command<breakTableCommand>",group:"Table"});var bp=l("InsertTable",e=>({row:t,col:n}={})=>(r,o)=>{const{selection:i,tr:a}=r,{from:s}=i,l=up(e,t,n),c=a.replaceSelectionWith(l),d=z.findFrom(c.doc.resolve(s),1,!0);return d&&c.setSelection(d),o?.(c),!0});Qh(bp,{displayName:"Command<insertTableCommand>",group:"Table"});var wp=l("MoveRow",()=>({from:e,to:t,pos:n}={})=>function(e){return(t,n)=>{const{from:r,to:o,select:i=!0,pos:a=t.selection.from}=e,s=t.tr;return!!function(e){var t,n;const{tr:r,originIndex:o,targetIndex:i,select:a,pos:s}=e,l=oh(r.doc.resolve(s));if(!l)return!1;const c=null===(t=lh(r,o))||void 0===t?void 0:t.indexes,d=null===(n=lh(r,i))||void 0===n?void 0:n.indexes;if(!c||!d)return!1;if(c.includes(i))return!1;const u=function(e,t,n){let r=th(e);return r=rh(r,t,n),nh(e,r)}(l.node,c,d);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,u),!a)return!0;const h=Pu.get(u),p=l.start,m=i,f=h.positionAt(m,h.width-1,u),g=r.doc.resolve(p+f),v=h.positionAt(m,0,u),y=r.doc.resolve(p+v);return r.setSelection(Xu.rowSelection(g,y)),!0}({tr:s,originIndex:r,targetIndex:o,select:i,pos:a})&&(null==n||n(s),!0)}}({from:e??0,to:t??0,pos:n}));Qh(wp,{displayName:"Command<moveRowCommand>",group:"Table"});var xp=l("MoveCol",()=>({from:e,to:t,pos:n}={})=>function(e){return(t,n)=>{const{from:r,to:o,select:i=!0,pos:a=t.selection.from}=e,s=t.tr;return!!function(e){var t,n;const{tr:r,originIndex:o,targetIndex:i,select:a,pos:s}=e,l=oh(r.doc.resolve(s));if(!l)return!1;const c=null===(t=sh(r,o))||void 0===t?void 0:t.indexes,d=null===(n=sh(r,i))||void 0===n?void 0:n.indexes;if(!c||!d)return!1;if(c.includes(i))return!1;const u=function(e,t,n){let r=ch(th(e));return r=rh(r,t,n),r=ch(r),nh(e,r)}(l.node,c,d);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,u),!a)return!0;const h=Pu.get(u),p=l.start,m=i,f=h.positionAt(h.height-1,m,u),g=r.doc.resolve(p+f),v=h.positionAt(0,m,u),y=r.doc.resolve(p+v);return r.setSelection(Xu.colSelection(g,y)),!0}({tr:s,originIndex:r,targetIndex:o,select:i,pos:a})&&(null==n||n(s),!0)}}({from:e??0,to:t??0,pos:n}));Qh(xp,{displayName:"Command<moveColCommand>",group:"Table"});var kp=l("SelectRow",()=>(e={index:0})=>(t,n)=>{const{tr:r}=t,o=n?.(pp(e.index,e.pos)(r));return Boolean(o)});Qh(kp,{displayName:"Command<selectRowCommand>",group:"Table"});var Cp=l("SelectCol",()=>(e={index:0})=>(t,n)=>{const{tr:r}=t,o=n?.(mp(e.index,e.pos)(r));return Boolean(o)});Qh(Cp,{displayName:"Command<selectColCommand>",group:"Table"});var _p=l("SelectTable",()=>()=>(e,t)=>{const{tr:n}=e,r=t?.(function(e){const t=function(e){const t=oh(e.$from);if(!t)return;const n=Pu.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(e=>{const n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}})}(e.selection);if(t&&t[0]){const n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){const t=e.doc.resolve(r.pos);return Y(e.setSelection(new Xu(t,n)))}}return e}(n));return Boolean(r)});Qh(_p,{displayName:"Command<selectTableCommand>",group:"Table"});var Sp=l("DeleteSelectedCells",()=>()=>(e,t)=>{const{selection:n}=e;if(!(n instanceof Xu))return!1;const r=n.isRowSelection(),o=n.isColSelection();return r&&o?function(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(e,t):o?function(e,t){if(!Vu(e))return!1;if(t){const n=dh(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;mh(r,n,e),e!=n.left;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw new RangeError("No table found");n.table=e,n.map=Pu.get(e)}t(r)}return!0}(e,t):function(e,t){if(!Vu(e))return!1;if(t){const n=dh(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;fh(r,n,e),e!=n.top;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw new RangeError("No table found");n.table=e,n.map=Pu.get(n.table)}t(r)}return!0}(e,t)});Qh(Sp,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var Ap=l("AddColBefore",()=>()=>hh);Qh(Ap,{displayName:"Command<addColBeforeCommand>",group:"Table"});var Mp=l("AddColAfter",()=>()=>ph);Qh(Mp,{displayName:"Command<addColAfterCommand>",group:"Table"});var Tp=l("AddRowBefore",e=>()=>(t,n)=>{if(!Vu(t))return!1;if(n){const r=dh(t);n(fp(e,t.tr,r,r.top))}return!0});Qh(Tp,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var Ep=l("AddRowAfter",e=>()=>(t,n)=>{if(!Vu(t))return!1;if(n){const r=dh(t);n(fp(e,t.tr,r,r.bottom))}return!0});Qh(Ep,{displayName:"Command<addRowAfterCommand>",group:"Table"});var Lp=l("SetAlign",()=>(e="left")=>function(e,t){return function(n,r){if(!Vu(n))return!1;const o=Fu(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){const i=n.tr;n.selection instanceof Xu?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&i.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[e]:t}),r(i)}return!0}}("alignment",e));Qh(Lp,{displayName:"Command<setAlignCommand>",group:"Table"});var Op=V(e=>new W(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,r,o)=>{const i=t.doc.resolve(r);if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),ap.type(e)))return null;const a=up(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(r,o,a);return s.setSelection(S.create(s.doc,r+3)).scrollIntoView()}));Qh(Op,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var Ip=F(e=>({run:(t,n,r)=>{if(r)return t;function o(t){const n=t.childCount,r=t.lastChild?.childCount??0;if(0===n||0===r)return X.type(e).create();const o=t.firstChild;if(!(r>0&&o&&0===o.childCount))return t;if(n>=3){const r=t.child(1),i=[];for(let t=0;t<r.childCount;t++){const n=r.child(t);i.push(dp.type(e).create(n.attrs,n.content,n.marks))}const a=o.type.create(o.attrs,i),s=[];for(let e=2;e<n;e++)s.push(t.child(e));return t.type.create(t.attrs,[a,...s])}const i=Array(r).fill(0).map(()=>dp.type(e).createAndFill()),a=new p(m.from(i),0,0),s=o.replace(0,0,a);return t.replace(0,o.nodeSize,new p(m.from(s),0,0))}let i=function t(n){let r=function(t){const n=lp.type(e),r=[];let i=[],a=!1;function s(){if(0===i.length)return;const t=sp.type(e).createAndFill(),n=ap.type(e).create(null,[t,...i]);r.push(o(n)),i=[]}return t.forEach(e=>{e.type===n?(a=!0,i.push(e)):(s(),r.push(e))}),s(),a?m.from(r):t}(n),i=r!==n;const a=[];return r.forEach(n=>{if(n.type===ap.type(e)){const e=o(n);e!==n&&(i=!0),a.push(e)}else if(n.childCount>0){const e=t(n.content);e!==n.content?(i=!0,a.push(n.copy(e))):a.push(n)}else a.push(n)}),i?m.from(a):n}(t.content);return i=function(t){const n=[],r=[];t.forEach(e=>r.push(e));for(let o=0;o<r.length;o++){const t=r[o],i=r[o+1];t.type===X.type(e)&&0===t.content.size&&i&&i.type===ap.type(e)||n.push(t)}return n.length<r.length?m.from(n):t}(i),new p(m.from(i),t.openStart,t.openEnd)}}));Qh(Ip,{displayName:"PasteRule<table>",group:"Table"});var Rp=$("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:e=>{const t=e.get(g);return()=>t.call(vp.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{const t=e.get(g);return()=>t.call(gp.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:e=>{const t=e.get(g);return()=>t.call(yp.key)}}});Qh(Rp.ctx,{displayName:"KeymapCtx<table>",group:"Table"}),Qh(Rp.shortcuts,{displayName:"Keymap<table>",group:"Table"});var Pp="footnote_definition",Bp="footnoteDefinition",zp=I("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${Pp}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw P(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{const t=e.attrs.label;return["dl",{"data-label":t,"data-type":Pp},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===Bp,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===Pp,runner:(e,t)=>{e.openNode(Bp,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));Qh(zp.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"}),Qh(zp.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var Dp="footnote_reference",Np=I("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${Dp}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw P(e);return{label:e.dataset.label}}}],toDOM:e=>{const t=e.attrs.label;return["sup",{"data-label":t,"data-type":Dp},t]},parseMarkdown:{match:({type:e})=>"footnoteReference"===e,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===Dp,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));Qh(Np.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"}),Qh(Np.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var Hp=H.extendSchema(e=>t=>{const n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:e=>{if(!(e instanceof HTMLElement))throw P(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread,checked:e.dataset.checked?"true"===e.dataset.checked:null}}},...n?.parseDOM||[]],toDOM:e=>n.toDOM&&null==e.attrs.checked?n.toDOM(e):["li",{"data-item-type":"task","data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":e.attrs.checked},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,r)=>{if(null==t.checked)return void n.parseMarkdown.runner(e,t,r);const o=null!=t.label?`${t.label}.`:"•",i=null!=t.checked?Boolean(t.checked):null,a=null!=t.label?"ordered":"bullet",s=null!=t.spread?`${t.spread}`:"true";e.openNode(r,{label:o,listType:a,spread:s,checked:i}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{if(null==t.attrs.checked)return void n.toMarkdown.runner(e,t);const r=t.attrs.label,o=t.attrs.listType,i="true"===t.attrs.spread,a=t.attrs.checked;e.openNode("listItem",void 0,{label:r,listType:o,spread:i,checked:a}),e.next(t.content),e.closeNode()}}}});Qh(Hp.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"}),Qh(Hp.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var qp=V(()=>new W(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,r)=>{const o=e.doc.resolve(n);let i=0,a=o.node(i);for(;a&&"list_item"!==a.type.name;)i--,a=o.node(i);if(!a||null!=a.attrs.checked)return null;const s=Boolean("x"===t.groups?.checked),l=o.before(i),c=e.tr;return c.deleteRange(n,r).setNodeMarkup(l,void 0,{...a.attrs,checked:s}),c}));Qh(qp,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var jp=[op,Rp].flat(),Vp=[Op,qp],Fp=[rp],$p=[Ip],Wp=s(()=>Jh);Qh(Wp,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"}),Qh(s(()=>function({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Ph,lastColumnResizable:o=!0}={}){const i=new c({key:zh,state:{init(e,t){var o;const a=null===(o=i.spec)||void 0===o||null===(o=o.props)||void 0===o?void 0:o.nodeViews,s=Hu(t.schema).table.name;return r&&a&&(a[s]=(e,t)=>new r(e,n,t)),new Dh(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>{const t=zh.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,n)=>{!function(e,t,n,r){if(!e.editable)return;const o=zh.getState(e.state);if(o&&!o.dragging){const i=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target);let a=-1;if(i){const{left:r,right:o}=i.getBoundingClientRect();t.clientX-r<=n?a=Nh(e,t,"left",n):o-t.clientX<=n&&(a=Nh(e,t,"right",n))}if(a!=o.activeHandle){if(!r&&-1!==a){const t=e.state.doc.resolve(a),n=t.node(-1),r=Pu.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}qh(e,a)}}}(t,n,e,o)},mouseleave:e=>{!function(e){if(!e.editable)return;const t=zh.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&qh(e,-1)}(e)},mousedown:(e,r)=>{!function(e,t,n,r){var o;if(!e.editable)return!1;const i=null!==(o=e.dom.ownerDocument.defaultView)&&void 0!==o?o:window,a=zh.getState(e.state);if(!a||-1==a.activeHandle||a.dragging)return!1;const s=e.state.doc.nodeAt(a.activeHandle),l=function(e,t,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=e.domAtPos(t);let a=i.node.childNodes[i.offset].offsetWidth,s=n;if(r)for(let l=0;l<n;l++)r[l]&&(a-=r[l],s--);return a/s}(e,a.activeHandle,s.attrs);function c(t){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",d);const r=zh.getState(e.state);(null==r?void 0:r.dragging)&&(function(e,t,n){const r=e.state.doc.resolve(t),o=r.node(-1),i=Pu.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let c=0;c<i.height;c++){const e=c*i.width+s;if(c&&i.map[e]==i.map[e-i.width])continue;const t=i.map[e],r=o.nodeAt(t).attrs,d=1==r.colspan?0:s-i.colCount(t);if(r.colwidth&&r.colwidth[d]==n)continue;const u=r.colwidth?r.colwidth.slice():Vh(r.colspan);u[d]=n,l.setNodeMarkup(a+t,null,{...r,colwidth:u})}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,Hh(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(zh,{setDragging:null})))}function d(t){if(!t.which)return c(t);const o=zh.getState(e.state);if(o&&o.dragging){const i=Hh(o.dragging,t,n);jh(e,o.activeHandle,i,r)}}e.dispatch(e.state.tr.setMeta(zh,{setDragging:{startX:t.clientX,startWidth:l}})),jh(e,a.activeHandle,l,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",d),t.preventDefault()}(e,r,t,n)}},decorations:e=>{const t=zh.getState(e);if(t&&t.activeHandle>-1)return function(e,t){const n=[],r=e.doc.resolve(t),o=r.node(-1);if(!o)return f.empty;const i=Pu.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1;for(let c=0;c<i.height;c++){const t=s+c*i.width;if(!(s!=i.width-1&&i.map[t]==i.map[t+1]||0!=c&&i.map[t]==i.map[t-i.width])){var l;const r=i.map[t],s=a+r+o.nodeAt(r).nodeSize-1,c=document.createElement("div");c.className="column-resize-handle",(null===(l=zh.getState(e))||void 0===l?void 0:l.dragging)&&n.push(v.node(a+r,a+r+o.nodeAt(r).nodeSize,{class:"column-resize-dragging"})),n.push(v.widget(s,c))}}return f.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return i}({})),{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var Up=s(()=>function({allowTableNodeSelection:e=!1}={}){return new c({key:qu,state:{init:()=>null,apply(e,t){const n=e.getMeta(qu);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;const{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:Yu,handleDOMEvents:{mousedown:Lh},createSelectionBetween:e=>null!=qu.getState(e.state)?e.state.selection:null,handleTripleClick:Th,handleKeyDown:_h,handlePaste:Eh},appendTransaction:(t,n,r)=>function(e,t,n){const r=(t||e).selection,o=(t||e).doc;let i,a;if(r instanceof M&&(a=r.node.type.spec.tableRole)){if("cell"==a||"header_cell"==a)i=Xu.create(o,r.from);else if("row"==a){const e=o.resolve(r.from+1);i=Xu.rowSelection(e,e)}else if(!n){const e=Pu.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];i=Xu.create(o,t+1,n)}}else r instanceof S&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let i=t.depth;i>=0&&!(t.before(i+1)>t.start(i));i--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}(r)?i=S.create(o,r.from):r instanceof S&&function({$from:e,$to:t}){let n,r;for(let o=e.depth;o>0;o--){const t=e.node(o);if("cell"===t.type.spec.tableRole||"header_cell"===t.type.spec.tableRole){n=t;break}}for(let o=t.depth;o>0;o--){const e=t.node(o);if("cell"===e.type.spec.tableRole||"header_cell"===e.type.spec.tableRole){r=e;break}}return n!==r&&0===t.parentOffset}(r)&&(i=S.create(o,r.$from.start(),r.$from.end()));return i&&(t||(t=e.tr)).setSelection(i),t}(r,eh(r,n),e)})}({allowTableNodeSelection:!0}));Qh(Up,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var Gp=O("remarkGFM",()=>In);Qh(Gp.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"}),Qh(Gp.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var Zp=new d("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN"),Xp=s(()=>new c({key:Zp,appendTransaction:(e,t,n)=>{let r;return t.doc!==n.doc&&n.doc.descendants((e,t)=>{if(r||(r=n.tr),"table_cell"!==e.type.name)return;const o=n.doc.resolve(t),i=o.node(o.depth),a=o.node(o.depth-1).firstChild;if(!a)return;const s=function(e,t){let n=0;return t.forEach((t,r,o)=>{t===e&&(n=o)}),n}(e,i),l=a.maybeChild(s);if(!l)return;const c=l.attrs.alignment;c!==e.attrs.alignment&&r.setNodeMarkup(t,void 0,{...e.attrs,alignment:c})}),r}}));Qh(Xp,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var Kp=[Xp,Wp,Gp,Up].flat(),Yp=[[Hp,ap,sp,lp,dp,cp,zp,Np,ep,tp].flat(),Vp,$p,Fp,jp,[vp,gp,yp,bp,wp,xp,kp,Cp,_p,Sp,Tp,Ep,Ap,Mp,Lp,np],Kp].flat(),Jp=Object.defineProperty,Qp=Object.getOwnPropertySymbols,em=Object.prototype.hasOwnProperty,tm=Object.prototype.propertyIsEnumerable,nm=(e,t,n)=>t in e?Jp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rm=(e,t)=>{for(var n in t||(t={}))em.call(t,n)&&nm(e,n,t[n]);if(Qp)for(var n of Qp(t))tm.call(t,n)&&nm(e,n,t[n]);return e};function om(e,t){return Object.assign(e,{meta:rm({package:"@milkdown/components"},t)}),e}const im=a({activationMode:"viewport",extensions:[],languages:[],expandIcon:"⬇",searchIcon:"🔍",clearSearchIcon:"⌫",searchPlaceholder:"Search language",noResultText:"No result",copyText:"Copy",copyIcon:"📋",onCopy:()=>{},renderLanguage:e=>e,renderPreview:()=>null,previewToggleButton:e=>e?"Edit":"Hide",previewLabel:"Preview",previewLoading:"Loading..."},"codeBlockConfigCtx");om(im,{displayName:"Config<code-block>",group:"CodeBlock"});class am{constructor(e){this.languages=e,this.map={},e.forEach(e=>{e.alias.forEach(t=>{this.map[t]=e})})}getAll(){return this.languages.map(e=>({name:e.name,alias:e.alias}))}load(e){const t=this.map[e.toLowerCase()];return t?t.support?Promise.resolve(t.support):t.load():Promise.resolve(void 0)}}function sm({icon:e,class:t,onClick:n}){return md("span",{class:On("milkdown-icon",t),onPointerdown:n,innerHTML:e?An.sanitize(e.trim()):void 0})}sm.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const lm=fl({props:{copyText:{type:String,required:!0},copyIcon:{type:String,required:!0},onCopy:{type:Function,required:!0},text:{type:String,required:!0}},setup(e){const t=()=>{(function(e){return((e,t,n)=>new Promise((t,r)=>{var o=e=>{try{a(n.next(e))}catch(AT){r(AT)}},i=e=>{try{a(n.throw(e))}catch(AT){r(AT)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(o,i);a((n=n.apply(e,null)).next())}))(this,0,function*(){try{return navigator.clipboard.writeText(e)}catch(AT){const n=document.createElement("textarea"),r=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.contain="strict",n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";const o=document.getSelection(),i=o?o.rangeCount>0&&o.getRangeAt(0):null;document.body.appendChild(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(n),i&&(o.removeAllRanges(),o.addRange(i)),r&&r.focus()}})})(e.text).then(()=>e.onCopy(e.text)).catch(console.error)};return()=>md(Nc,null,md("button",{type:"button",class:"copy-button",onClick:t},md(sm,{icon:e.copyIcon}),e.copyText))}}),cm=fl({props:{language:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},config:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0}},setup({language:e,config:t,setLanguage:n,getAllLanguages:r,getReadOnly:o}){const i=vs(),a=vs(!1),s=vs(),l=vs(),c=vs("");ll([a,i,l],()=>{c.value="";const e=i.value,t=l.value;e&&t&&b(e,t,{placement:"bottom-start"}).then(({x:e,y:n})=>{Object.assign(t.style,{left:`${e}px`,top:`${n}px`})}).catch(console.error)});const d=e=>{if(e.preventDefault(),e.stopPropagation(),o())return;const t=!a.value;a.value=t,t&&setTimeout(()=>{var e;return null==(e=s.value)?void 0:e.focus()},0)},u=e=>{const t=e.target;c.value=t.value},h=e=>{"Escape"===e.key&&(c.value="")},p=pd(()=>{var t;if(!a.value)return[];const n=null!=(t=r())?t:[],o=n.find(t=>t.name.toLowerCase()===e.value.toLowerCase()),i=n.filter(e=>{const t=c.value.toLowerCase();return(e.name.toLowerCase().includes(t)||e.alias.some(e=>e.toLowerCase().includes(t)))&&e!==o});return 0===i.length?[]:o?[o,...i]:i}),m=e=>{const t=e.target;if(i.value&&i.value.contains(t))return;const n=l.value,r=i.value;r&&n&&"true"===r.dataset.expanded&&(n.contains(t)||(a.value=!1))};return Ll(()=>{window.addEventListener("click",m)}),Pl(()=>{window.removeEventListener("click",m)}),()=>md(Nc,null,md("button",{type:"button",ref:i,class:"language-button",onClick:d,"data-expanded":String(a.value)},e.value||"Text",md("div",{class:"expand-icon"},md(sm,{icon:t.expandIcon}))),md("div",{ref:l,class:"language-picker"},a.value?md("div",{class:"list-wrapper"},md("div",{class:"search-box"},md("div",{class:"search-icon"},md(sm,{icon:t.searchIcon})),md("input",{ref:s,class:"search-input",placeholder:t.searchPlaceholder,value:c.value,onInput:u,onKeydown:h}),md("div",{class:On("clear-icon",0===c.value.length&&"hidden"),onMousedown:e=>{e.preventDefault(),c.value=""}},md(sm,{icon:t.clearSearchIcon}))),md("ul",{class:"language-list",role:"listbox",onKeydown:e=>{if("Enter"===e.key){const e=document.activeElement;e instanceof HTMLElement&&e.dataset.language&&n(e.dataset.language)}}},p.value.length?p.value.map(r=>md("li",{role:"listitem",tabindex:"0",class:"language-list-item","aria-selected":r.name.toLowerCase()===e.value.toLowerCase(),"data-language":r.name,onClick:()=>{n(r.name),a.value=!1}},t.renderLanguage(r.name,r.name.toLowerCase()===e.value.toLowerCase()))):md("li",{class:"language-list-item no-result"},t.noResultText))):null))}});let dm;const um=fl({props:{text:{type:Object,required:!0},language:{type:Object,required:!0},config:{type:Object,required:!0},previewOnlyMode:{type:Object,required:!0},preview:{type:Object,required:!0}},setup(e){const{previewOnlyMode:t,config:n,preview:r}=e,o=vs();return sl(()=>{const e=o.value;if(!e)return;for(;e.firstChild;)e.removeChild(e.firstChild);const t=r.value;("string"==typeof t||t instanceof Element)&&(e.innerHTML=function(e){return null!=dm||(dm=function(){const e=An(),t={ADD_TAGS:["foreignObject"],ADD_ATTR:["xmlns"],HTML_INTEGRATION_POINTS:{foreignobject:!0}};return e.addHook("uponSanitizeElement",(e,t)=>{var n;if("foreignobject"===t.tagName){const t=e.parentElement;t&&"http://www.w3.org/2000/svg"===t.namespaceURI||null==(n=e.parentNode)||n.removeChild(e)}}),n=>e.sanitize(n,t)}()),dm(e)}(t))}),()=>r.value?md("div",{class:"preview-panel"},!t.value&&md(Nc,null,md("div",{class:"preview-divider"}),md("div",{class:"preview-label"},n.previewLabel)),md("div",{ref:o,class:"preview"})):null}}),hm=fl({props:{text:{type:Object,required:!0},selected:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},codemirror:{type:Object,required:!0},language:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){var t;const n=vs(null!=(t=e.config.previewOnlyByDefault)?t:e.getReadOnly()),r=vs(),o=vs(null);Ll(()=>{for(var t;null==(t=r.value)?void 0:t.firstChild;)r.value.removeChild(r.value.firstChild);r.value&&r.value.appendChild(e.codemirror.dom)}),ll(()=>[e.text.value,e.language.value],()=>{const t=e.config.renderPreview(e.language.value,e.text.value,e=>o.value=e);t&&(o.value=t),void 0===t&&!o.value&&(o.value=An.sanitize(e.config.previewLoading)),null===t&&(o.value=null)},{immediate:!0});const i=()=>{};return()=>{var t;return md(Nc,null,md("div",{class:"tools"},md(cm,{language:e.language,config:e.config,setLanguage:e.setLanguage,getAllLanguages:e.getAllLanguages,getReadOnly:e.getReadOnly}),md("div",{class:"tools-button-group"},md(lm,{copyIcon:e.config.copyIcon,copyText:e.config.copyText,onCopy:null!=(t=e.config.onCopy)?t:i,text:e.text.value}),o.value?md("button",{class:"preview-toggle-button",onClick:()=>n.value=!n.value},md(sm,{icon:e.config.previewToggleButton(n.value)})):null)),md("div",{ref:r,class:On("codemirror-host",o.value&&n.value&&"hidden")}),md(um,{text:e.text,language:e.language,config:e.config,previewOnlyMode:n,preview:o}))}}}),pm=new WeakMap;let mm=null;function fm(){return mm||(mm=new IntersectionObserver(e=>{for(const t of e){const e=pm.get(t.target);null==e||e(t.isIntersecting)}},{rootMargin:"200px"})),mm}const gm=class e{constructor(e,t,n,r,o){var i;this.node=e,this.view=t,this.getPos=n,this.loader=r,this.config=o,this.selected=vs(!1),this.language=vs(""),this.text=vs(""),this.initialized=!1,this.updating=!1,this.languageName="",this.teardownTimer=null,this.forwardUpdate=e=>{var t;if(this.updating||!this.cm.hasFocus)return;let n=(null!=(t=this.getPos())?t:0)+1;const{main:r}=e.state.selection,o=n+r.from,i=n+r.to,a=this.view.state.selection;if(e.docChanged||a.from!==o||a.to!==i){const t=this.view.state.tr;e.changes.iterChanges((e,r,o,i,a)=>{a.length?t.replaceWith(n+e,n+r,this.view.state.schema.text(a.toString())):t.delete(n+e,n+r),n+=i-o-(r-e)}),t.setSelection(S.create(t.doc,o,i)),this.view.dispatch(t)}},this.activateFromPointer=e=>{var t;if(this.initialized||"interaction"!==this.config.activationMode)return;e.preventDefault(),e.stopPropagation(),this.initializeCodeMirror();const n=null!=(t=this.cm.posAtCoords({x:e.clientX,y:e.clientY}))?t:0;this.cm.focus(),this.cm.dispatch({selection:{anchor:n}})},this.createApp=()=>jd(hm,{text:this.text,selected:this.selected,codemirror:this.cm,language:this.language,getAllLanguages:this.getAllLanguages,getReadOnly:()=>!this.view.editable,setLanguage:this.setLanguage,config:this.config}),this.codeMirrorKeymap=()=>{const e=this.view;return[{key:"ArrowUp",run:()=>this.maybeEscape("line",-1)},{key:"ArrowLeft",run:()=>this.maybeEscape("char",-1)},{key:"ArrowDown",run:()=>this.maybeEscape("line",1)},{key:"ArrowRight",run:()=>this.maybeEscape("char",1)},{key:"Mod-Enter",run:()=>!!te(e.state,e.dispatch)&&(e.focus(),!0)},{key:"Mod-z",run:()=>Q(e.state,e.dispatch)},{key:"Shift-Mod-z",run:()=>ee(e.state,e.dispatch)},{key:"Mod-y",run:()=>ee(e.state,e.dispatch)},{key:"Backspace",run:()=>{var e;const t=this.cm.state.selection.ranges;if(t.length>1)return!1;const n=t[0];if(n&&(!n.empty||n.anchor>0))return!1;if(this.cm.state.doc.lines>=2)return!1;const r=this.view.state,o=null!=(e=this.getPos())?e:0,i=r.tr.replaceWith(o,o+this.node.nodeSize,r.schema.nodes.paragraph.createChecked({},this.node.content));return i.setSelection(S.near(i.doc.resolve(o))),this.view.dispatch(i),this.view.focus(),!0}}]},this.maybeEscape=(e,t)=>{var n;const{state:r}=this.cm;let o=r.selection.main;if(!o.empty)return!1;if("line"===e&&(o=r.doc.lineAt(o.head)),t<0?o.from>0:o.to<r.doc.length)return!1;const i=(null!=(n=this.getPos())?n:0)+(t<0?0:this.node.nodeSize),a=S.near(this.view.state.doc.resolve(i),t),s=this.view.state.tr.setSelection(a).scrollIntoView();return this.view.dispatch(s),this.view.focus(),!0},this.setLanguage=e=>{var t;this.view.dispatch(this.view.state.tr.setNodeAttribute(null!=(t=this.getPos())?t:0,"language",e))},this.getAllLanguages=()=>this.loader.getAll(),this.languageConf=new Dt,this.readOnlyConf=new Dt,this.text.value=this.node.textContent,this.language.value=null!=(i=this.node.attrs.language)?i:"",this.dom=document.createElement("div"),this.dom.className="milkdown-code-block",this.disposeSelectedWatcher=sl(()=>{this.selected.value?this.dom.classList.add("selected"):this.dom.classList.remove("selected")}),this.dom.addEventListener("pointerdown",this.activateFromPointer),this.renderPlaceholder(),pm.set(this.dom,e=>{e?(this.cancelTeardown(),"viewport"===this.config.activationMode&&this.initializeCodeMirror()):this.initialized&&this.scheduleTeardown()}),fm().observe(this.dom)}renderPlaceholder(){const e=document.createElement("pre");e.className="milkdown-code-block-placeholder";const t=document.createElement("code");t.textContent=this.node.textContent,e.appendChild(t),this.dom.appendChild(e)}initializeCodeMirror(){if(this.initialized)return;this.initialized=!0,this.cm=new Rt({doc:this.node.textContent,root:this.view.root,extensions:[this.readOnlyConf.of(qt.readOnly.of(!this.view.editable)),Nt(),Ht.of(this.codeMirrorKeymap()),this.languageConf.of([]),qt.changeFilter.of(()=>this.view.editable),...this.config.extensions,Rt.updateListener.of(this.forwardUpdate)]});const e=this.dom.querySelector(".milkdown-code-block-placeholder");e&&this.dom.removeChild(e),this.app=this.createApp(),this.app.mount(this.dom),this.updateLanguage()}teardownCodeMirror(){if(this.initialized&&!this.cm.hasFocus&&!this.selected.value){for(this.app.unmount(),this.cm.destroy(),this.initialized=!1,this.languageName="";this.dom.firstChild;)this.dom.removeChild(this.dom.firstChild);this.renderPlaceholder()}}scheduleTeardown(){this.cancelTeardown(),this.teardownTimer=setTimeout(()=>this.teardownCodeMirror(),e.TEARDOWN_DELAY)}cancelTeardown(){null!=this.teardownTimer&&(clearTimeout(this.teardownTimer),this.teardownTimer=null)}updateLanguage(){const e=this.node.attrs.language;e!==this.languageName&&(this.language.value=e,this.loader.load(null!=e?e:"").then(t=>{t&&(this.cm.dispatch({effects:this.languageConf.reconfigure(t)}),this.languageName=e)}).catch(console.error))}setSelection(e,t){this.initialized||this.initializeCodeMirror(),this.cm.dom.isConnected&&(this.cm.focus(),this.updating=!0,this.cm.dispatch({selection:{anchor:e,head:t}}),this.updating=!1)}update(e){var t;if(e.type!==this.node.type)return!1;if(this.updating)return!0;if(this.node=e,this.text.value=e.textContent,this.language.value=null!=(t=e.attrs.language)?t:"",!this.initialized){const t=this.dom.querySelector(".milkdown-code-block-placeholder code");return t&&(t.textContent=e.textContent),!0}this.updateLanguage(),this.view.editable===this.cm.state.readOnly&&this.cm.dispatch({effects:this.readOnlyConf.reconfigure(qt.readOnly.of(!this.view.editable))});const n=function(e,t){if(e===t)return null;let n=0,r=e.length,o=t.length;for(;n<r&&e.charCodeAt(n)===t.charCodeAt(n);)++n;for(;r>n&&o>n&&e.charCodeAt(r-1)===t.charCodeAt(o-1);)r--,o--;return{from:n,to:r,text:t.slice(n,o)}}(this.cm.state.doc.toString(),e.textContent);return n&&(this.updating=!0,this.cm.dispatch({changes:{from:n.from,to:n.to,insert:n.text},scrollIntoView:!0}),this.updating=!1),!0}selectNode(){this.initialized||this.initializeCodeMirror(),this.selected.value=!0,this.cm.focus()}deselectNode(){this.selected.value=!1}stopEvent(){return!0}destroy(){this.cancelTeardown(),this.dom.removeEventListener("pointerdown",this.activateFromPointer),fm().unobserve(this.dom),pm.delete(this.dom),this.initialized&&(this.app.unmount(),this.cm.destroy()),this.disposeSelectedWatcher()}};gm.TEARDOWN_DELAY=5e3;let vm=gm;const ym=R(J.node,e=>{const t=e.get(im.key),n=new am(t.languages);return(e,r,o)=>new vm(e,r,o,n,t)});om(ym,{displayName:"NodeView<code-block>",group:"CodeBlock"});const bm=[ym,im],wm="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class xm{constructor(e,t,n=0,r=e.length,o,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=o?e=>o(wm(e)):wm,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Jt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=en(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Qt(e);let r=this.normalize(t);if(r.length)for(let o=0,i=n;;o++){let e=r.charCodeAt(o),a=this.match(e,i,this.bufferPos+this.bufferStart);if(o==r.length-1){if(a)return this.value=a,this;break}i==n&&o<t.length&&t.charCodeAt(o)==e&&i++}}}match(e,t,n){let r=null;for(let o=0;o<this.matches.length;o+=2){let t=this.matches[o],i=!1;this.query.charCodeAt(t)==e&&(t==this.query.length-1?r={from:this.matches[o+1],to:n}:(this.matches[o]++,i=!0)),i||(this.matches.splice(o,2),o-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(xm.prototype[Symbol.iterator]=function(){return this});const km={from:-1,to:-1,match:/.*/.exec("")},Cm="gm"+(null==/x/.unicode?"":"u");class _m{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=km,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Mm(e,t,n,r,o);this.re=new RegExp(t,Cm+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let i=e.lineAt(r);this.curLineStart=i.from,this.matchPos=Tm(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Tm(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const Sm=new WeakMap;class Am{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=Sm.get(e);if(!r||r.from>=n||r.to<=t){let r=new Am(t,e.sliceString(t,n));return Sm.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:o,from:i}=r;return i>t&&(o=e.sliceString(t,i)+o,i=t),r.to<n&&(o+=e.sliceString(r.to,n)),Sm.set(e,new Am(i,o)),new Am(t,o.slice(t-i,n-i))}}class Mm{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=km,this.matchPos=Tm(e,r),this.re=new RegExp(t,Cm+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Am.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=Tm(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Am.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Tm(e,t){if(t>=e.length)return t;let n,r=e.lineAt(t);for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}"undefined"!=typeof Symbol&&(_m.prototype[Symbol.iterator]=Mm.prototype[Symbol.iterator]=function(){return this});const Em={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Lm=Ut.define({combine:e=>Yt(e,Em,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Om=Xt.mark({class:"cm-selectionMatch"}),Im=Xt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Rm(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==tn.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==tn.Word)}const Pm=jt.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Lm),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Xt.none;let o,i=r.main,a=null;if(i.empty){if(!t.highlightWordAroundCursor)return Xt.none;let e=n.wordAt(i.head);if(!e)return Xt.none;a=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Xt.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!Rm(a,n,i.from,i.to)||!function(e,t,n,r){return e(t.sliceDoc(n,n+1))==tn.Word&&e(t.sliceDoc(r-1,r))==tn.Word}(a,n,i.from,i.to))return Xt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return Xt.none}let s=[];for(let l of e.visibleRanges){let e=new xm(n.doc,o,l.from,l.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!a||Rm(a,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?s.push(Im.range(r,o)):(r>=i.to||o<=i.from)&&s.push(Om.range(r,o)),s.length>t.maxMatches))return Xt.none}}return Xt.set(s)}},{decorations:e=>e.decorations}),Bm=Rt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),zm=Ut.define({combine:e=>Yt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new hf(e),scrollToMatch:e=>Rt.scrollIntoView(e)})});class Dm{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Cm),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new $m(this):new qm(this)}getCursor(e,t=0,n){let r=e.doc?e:qt.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?jm(this,r,t,n):Hm(this,r,t,n)}}class Nm{constructor(e){this.spec=e}}function Hm(e,t,n,r){let o;return e.wholeWord&&(o=function(e,t){return(n,r,o,i)=>((i>n||i+o.length<r)&&(i=Math.max(0,n-2),o=e.sliceString(i,Math.min(e.length,r+2))),!(t(Vm(o,n-i))==tn.Word&&t(Fm(o,n-i))==tn.Word||t(Fm(o,r-i))==tn.Word&&t(Vm(o,r-i))==tn.Word))}(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(o=function(e,t,n){return(r,o,i,a)=>{if(n&&!n(r,o,i,a))return!1;let s=r>=a&&o<=a+i.length?i.slice(r-a,o-a):t.doc.sliceString(r,o);return e(s,t,r,o)}}(e.test,t,o)),new xm(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),o)}class qm extends Nm{constructor(e){super(e)}nextMatch(e,t,n){let r=Hm(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Hm(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),o=Hm(this.spec,e,n,r),i=null;for(;!o.nextOverlapping().done;)i=o.value;if(i)return i;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),!r||r.from==t&&r.to==n?null:r}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Hm(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=Hm(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}function jm(e,t,n,r){let o;return e.wholeWord&&(o=function(e){return(t,n,r)=>!r[0].length||(e(Vm(r.input,r.index))!=tn.Word||e(Fm(r.input,r.index))!=tn.Word)&&(e(Fm(r.input,r.index+r[0].length))!=tn.Word||e(Vm(r.input,r.index+r[0].length))!=tn.Word)}(t.charCategorizer(t.selection.main.head))),e.test&&(o=function(e,t,n){return(r,o,i)=>(!n||n(r,o,i))&&e(i[0],t,r,o)}(e.test,t,o)),new _m(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:o},n,r)}function Vm(e,t){return e.slice(an(e,t,!1),t)}function Fm(e,t){return e.slice(t,an(e,t))}class $m extends Nm{nextMatch(e,t,n){let r=jm(this.spec,e,n,e.doc.length).next();return r.done&&(r=jm(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let o=Math.max(t,n-1e4*r),i=jm(this.spec,e,o,n),a=null;for(;!i.next().done;)a=i.value;if(a&&(o==t||a.from>o+10))return a;if(o==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let r=n.length;r>0;r--){let t=+n.slice(0,r);if(t>0&&t<e.match.length)return e.match[t]+n.slice(r)}return t})}matchAll(e,t){let n=jm(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=jm(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}const Wm=Ft.define(),Um=Ft.define(),Gm=Vt.define({create:e=>new Zm(af(e).create(),null),update(e,t){for(let n of t.effects)n.is(Wm)?e=new Zm(n.value.create(),e.panel):n.is(Um)&&(e=new Zm(e.query,n.value?of:null));return e},provide:e=>Kt.from(e,e=>e.panel)});class Zm{constructor(e,t){this.query=e,this.panel=t}}const Xm=Xt.mark({class:"cm-searchMatch"}),Km=Xt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Ym=jt.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Gm))}update(e){let t=e.state.field(Gm);(t!=e.startState.field(Gm)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Xt.none;let{view:n}=this,r=new nn;for(let o=0,i=n.visibleRanges,a=i.length;o<a;o++){let{from:t,to:s}=i[o];for(;o<a-1&&s>i[o+1].from-500;)s=i[++o].to;e.highlight(n.state,t,s,(e,t)=>{let o=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,o?Km:Xm)})}return r.finish()}},{decorations:e=>e.decorations});function Jm(e){return t=>{let n=t.state.field(Gm,!1);return n&&n.query.spec.valid?e(t,n):cf(t)}}const Qm=Jm((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=Wt.single(r.from,r.to),i=e.state.facet(zm);return e.dispatch({selection:o,effects:[gf(e,r),i.scrollToMatch(o.main,e)],userEvent:"select.search"}),lf(e),!0}),ef=Jm((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let i=Wt.single(o.from,o.to),a=e.state.facet(zm);return e.dispatch({selection:i,effects:[gf(e,o),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),lf(e),!0}),tf=Jm((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:Wt.create(n.map(e=>Wt.range(e.from,e.to))),userEvent:"select.search.matches"}),0))}),nf=Jm((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,r,r);if(!i)return!1;let a,s,l=i,c=[],d=[];l.from==r&&l.to==o&&(s=n.toText(t.getReplacement(l)),c.push({from:l.from,to:l.to,insert:s}),l=t.nextMatch(n,l.from,l.to),d.push(Rt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let u=e.state.changes(c);return l&&(a=Wt.single(l.from,l.to).map(u),d.push(gf(e,l)),d.push(n.facet(zm).scrollToMatch(a.main,e))),e.dispatch({changes:u,selection:a,effects:d,userEvent:"input.replace"}),!0}),rf=Jm((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Rt.announce.of(r),userEvent:"input.replace.all"}),!0});function of(e){return e.state.facet(zm).createPanel(e)}function af(e,t){var n,r,o,i,a;let s=e.selection.main,l=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!l)return t;let c=e.facet(zm);return new Dm({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:c.caseSensitive,literal:null!==(o=null==t?void 0:t.literal)&&void 0!==o?o:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(a=null==t?void 0:t.wholeWord)&&void 0!==a?a:c.wholeWord})}function sf(e){let t=Gt(e,of);return t&&t.dom.querySelector("[main-field]")}function lf(e){let t=sf(e);t&&t==e.root.activeElement&&t.select()}const cf=e=>{let t=e.state.field(Gm,!1);if(t&&t.panel){let n=sf(e);if(n&&n!=e.root.activeElement){let r=af(e.state,t.query.spec);r.valid&&e.dispatch({effects:Wm.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Um.of(!0),t?Wm.of(af(e.state,t.query.spec)):Ft.appendConfig.of(yf)]});return!0},df=e=>{let t=e.state.field(Gm,!1);if(!t||!t.panel)return!1;let n=Gt(e,of);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Um.of(!1)}),!0},uf=[{key:"Mod-f",run:cf,scope:"editor search-panel"},{key:"F3",run:Qm,shift:ef,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Qm,shift:ef,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:df,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,i=[],a=0;for(let s=new xm(e.doc,e.sliceDoc(r,o));!s.next().done;){if(i.length>1e3)return!1;s.value.from==r&&(a=i.length),i.push(Wt.range(s.value.from,s.value.to))}return t(e.update({selection:Wt.create(i,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:o}=Zt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return o.then(n=>{let o=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!o)return void e.dispatch({effects:r});let i=t.doc.lineAt(t.selection.main.head),[,a,s,l,c]=o,d=l?+l.slice(1):0,u=s?+s:i.number;if(s&&c){let e=u/100;a&&(e=e*("-"==a?-1:1)+i.number/t.doc.lines),u=Math.round(t.doc.lines*e)}else s&&a&&(u=u*("-"==a?-1:1)+i.number);let h=t.doc.line(Math.max(1,Math.min(t.doc.lines,u))),p=Wt.cursor(h.from+Math.max(0,Math.min(d,h.length)));e.dispatch({effects:[r,Rt.scrollIntoView(p.from,{y:"center"})],selection:p})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=Wt.create(n.ranges.map(t=>e.wordAt(t.head)||Wt.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let o=function(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),i=o&&o.from==n.from&&o.to==n.to;for(let a=!1,s=new xm(e.doc,t,r[r.length-1].to);;){if(s.next(),!s.done){if(a&&r.some(e=>e.from==s.value.from))continue;if(i){let t=e.wordAt(s.value.from);if(!t||t.from!=s.value.from||t.to!=s.value.to)continue}return s.value}if(a)return null;s=new xm(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),a=!0}}(e,r);return!!o&&(t(e.update({selection:e.selection.addRange(Wt.range(o.from,o.to),!1),effects:Rt.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class hf{constructor(e){this.view=e;let t=this.query=e.state.field(Gm).query.spec;function n(e,t,n){return rn("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=rn("input",{value:t.search,placeholder:pf(e,"Find"),"aria-label":pf(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=rn("input",{value:t.replace,placeholder:pf(e,"Replace"),"aria-label":pf(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=rn("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=rn("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=rn("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=rn("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>Qm(e),[pf(e,"next")]),n("prev",()=>ef(e),[pf(e,"previous")]),n("select",()=>tf(e),[pf(e,"all")]),rn("label",null,[this.caseField,pf(e,"match case")]),rn("label",null,[this.reField,pf(e,"regexp")]),rn("label",null,[this.wordField,pf(e,"by word")]),...e.state.readOnly?[]:[rn("br"),this.replaceField,n("replace",()=>nf(e),[pf(e,"replace")]),n("replaceAll",()=>rf(e),[pf(e,"replace all")])],rn("button",{name:"close",onclick:()=>df(e),"aria-label":pf(e,"close"),type:"button"},["×"])])}commit(){let e=new Dm({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Wm.of(e)}))}keydown(e){on(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ef:Qm)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),nf(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Wm)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(zm).top}}function pf(e,t){return e.state.phrase(t)}const mf=30,ff=/[\s\.,:;?!]/;function gf(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,i=Math.max(r.from,t-mf),a=Math.min(o,n+mf),s=e.state.sliceDoc(i,a);if(i!=r.from)for(let l=0;l<mf;l++)if(!ff.test(s[l+1])&&ff.test(s[l])){s=s.slice(l);break}if(a!=o)for(let l=s.length-1;l>s.length-mf;l--)if(!ff.test(s[l-1])&&ff.test(s[l])){s=s.slice(0,l);break}return Rt.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`)}const vf=Rt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),yf=[Gm,$t.low(Ym),vf];class bf{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class wf{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(If).markerFilter;r&&(e=r(e,n));let o=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),i=new nn,a=[],s=0,l=n.doc.iter(),c=0,d=n.doc.length;for(let h=0;;){let e,t,n=h==o.length?null:o[h];if(!n&&!a.length)break;if(a.length)e=s,t=a.reduce((e,t)=>Math.min(e,t.to),n&&n.from>e?n.from:1e8);else{if(e=n.from,e>d)break;t=n.to,a.push(n),h++}for(;h<o.length;){let n=o[h];if(n.from!=e||!(n.to>n.from||n.to==e)){t=Math.min(n.from,t);break}a.push(n),h++,t=Math.min(n.to,t)}t=Math.min(t,d);let r=!1;if(a.some(n=>n.from==e&&(n.to==t||t==d))&&(r=e==t,!r&&t-e<10)){let n=e-(c+l.value.length);n>0&&(l.next(n),c=e);for(let o=e;;){if(o>=t){r=!0;break}if(!l.lineBreak&&c+l.value.length>o)break;o=c+l.value.length,c+=l.value.length,l.next()}}let u=Vf(a);if(r)i.add(e,e,Xt.widget({widget:new zf(u),diagnostics:a.slice()}));else{let n=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");i.add(e,t,Xt.mark({class:"cm-lintRange cm-lintRange-"+u+n,diagnostics:a.slice(),inclusiveEnd:a.some(e=>e.to>t)}))}if(s=t,s==d)break;for(let o=0;o<a.length;o++)a[o].to<=s&&a.splice(o--,1)}let u=i.finish();return new wf(u,t,xf(u))}}function xf(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:o})=>{if(!(t&&o.diagnostics.indexOf(t)<0))if(r){if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new bf(r.from,n,r.diagnostic)}else r=new bf(e,n,t||o.diagnostics[0])}),r}function kf(e,t){return e.field(Af,!1)?t:t.concat(Ft.appendConfig.of(Ff))}const Cf=Ft.define(),_f=Ft.define(),Sf=Ft.define(),Af=Vt.define({create:()=>new wf(Xt.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,o=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=xf(n,e.selected.diagnostic,o)||xf(n,null,o)}!n.size&&o&&t.state.facet(If).autoPanel&&(o=null),e=new wf(n,o,r)}for(let n of t.effects)if(n.is(Cf)){let r=t.state.facet(If).autoPanel?n.value.length?Nf.open:null:e.panel;e=wf.init(n.value,r,t.state)}else n.is(_f)?e=new wf(e.diagnostics,n.value?Nf.open:null,e.selected):n.is(Sf)&&(e=new wf(e.diagnostics,e.panel,n.value));return e},provide:e=>[Kt.from(e,e=>e.panel),Rt.decorations.from(e,e=>e.diagnostics)]}),Mf=Xt.mark({class:"cm-lintRange cm-lintRange-active"});function Tf(e,t,n){let r,{diagnostics:o}=e.state.field(Af),i=-1,a=-1;o.between(t-(n<0?1:0),t+(n>0?1:0),(e,o,{spec:s})=>{if(t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t<o||n<0)))return r=s.diagnostics,i=e,a=o,!1});let s=e.state.facet(If).tooltipFilter;return r&&s&&(r=s(r,e.state)),r?{pos:i,end:a,above:e.state.doc.lineAt(i).to<a,create:()=>({dom:Ef(e,r)})}:null}function Ef(e,t){return rn("ul",{class:"cm-tooltip-lint"},t.map(t=>Bf(e,t,!1)))}const Lf=e=>{let t=e.state.field(Af,!1);return!(!t||!t.panel||(e.dispatch({effects:_f.of(!1)}),0))},Of=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Af,!1);t&&t.panel||e.dispatch({effects:kf(e.state,[_f.of(!0)])});let n=Gt(e,Nf.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Af,!1);if(!t)return!1;let n=e.state.selection.main,r=xf(t.diagnostics,null,n.to+1);return!(!r&&(r=xf(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),0))}}],If=Ut.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...Yt(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Rf,tooltipFilter:Rf,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,o)=>e(n,r,o)||t(n,r,o):e:t,autoPanel:(e,t)=>e||t})})});function Rf(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function Pf(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function Bf(e,t,n){var r;let o=n?Pf(t.actions):[];return rn("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},rn("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(r=t.actions)||void 0===r?void 0:r.map((n,r)=>{let i=!1,a=r=>{if(r.preventDefault(),i)return;i=!0;let o=xf(e.state.field(Af).diagnostics,t);o&&n.apply(e,o.from,o.to)},{name:s}=n,l=o[r]?s.indexOf(o[r]):-1,c=l<0?s:[s.slice(0,l),rn("u",s.slice(l,l+1)),s.slice(l+1)],d=n.markClass?" "+n.markClass:"";return rn("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:a,onmousedown:a,"aria-label":` Action: ${s}${l<0?"":` (access key "${o[r]})"`}.`},c)}),t.source&&rn("div",{class:"cm-diagnosticSource"},t.source))}class zf extends ln{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return rn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Df{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Bf(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Nf{constructor(e){this.view=e,this.items=[],this.list=rn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(27==t.keyCode)Lf(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],r=Pf(n.actions);for(let o=0;o<r.length;o++)if(r[o].toUpperCase().charCodeAt(0)==t.keyCode){let t=xf(this.view.state.field(Af).diagnostics,n);t&&n.actions[o].apply(e,t.from,t.to)}}}t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=rn("div",{class:"cm-panel-lint"},this.list,rn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Lf(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Af).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Af),n=0,r=!1,o=null,i=new Set;for(e.between(0,this.view.state.doc.length,(e,a,{spec:s})=>{for(let l of s.diagnostics){if(i.has(l))continue;i.add(l);let e,a=-1;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==l){a=t;break}a<0?(e=new Df(this.view,l),this.items.splice(n,0,e),r=!0):(e=this.items[a],a>n&&(this.items.splice(n,a-n),r=!0)),t&&e.diagnostic==t.diagnostic?e.dom.hasAttribute("aria-selected")||(e.dom.setAttribute("aria-selected","true"),o=e):e.dom.hasAttribute("aria-selected")&&e.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new Df(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=xf(this.view.state.field(Af).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Sf.of(t)})}static open(e){return new Nf(e)}}function Hf(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const qf=Rt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Hf("#d11")},".cm-lintRange-warning":{backgroundImage:Hf("orange")},".cm-lintRange-info":{backgroundImage:Hf("#999")},".cm-lintRange-hint":{backgroundImage:Hf("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function jf(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function Vf(e){let t="hint",n=1;for(let r of e){let e=jf(r.severity);e>n&&(n=e,t=r.severity)}return t}const Ff=[Af,Rt.decorations.compute([Af],e=>{let{selected:t,panel:n}=e.field(Af);return t&&n&&t.from!=t.to?Xt.set([Mf.range(t.from,t.to)]):Xt.none}),sn(Tf,{hideOn:function(e,t){let n=t.pos,r=t.end||n,o=e.state.facet(If).hideOn(e,n,r);if(null!=o)return o;let i=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(Cf))&&!e.changes.touchesRange(i.from,Math.max(i.to,r)))}}),qf],$f=(()=>[cn(),dn(),un(),hn(),pn(),Nt(),mn(),qt.allowMultipleSelections.of(!0),fn(),Pt(wn,{fallback:!0}),gn(),Mn(),Tn(),vn(),yn(),bn(),[Bm,Pm],Ht.of([...En,...xn,...uf,...kn,...Cn,...Ln,...Of])])();function Wf(e){return function(e){return 1===e.nodeType}(e)&&"http://www.w3.org/1999/xhtml"===e.namespaceURI}function Uf(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function Gf(e,t){return Math.min(Uf(e,[t[0],t[1]]),Uf(e,[t[2],t[3]]))}class Zf extends z{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Zf.valid(n)?new Zf(n):z.near(n)}content(){return p.empty}eq(e){return e instanceof Zf&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Zf(e.resolve(t.pos))}getBookmark(){return new Xf(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||Kf(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||Kf(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Zf.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let a=e.doc.resolve(r);if(Zf.valid(a))return a}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!M.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let a=e.doc.resolve(r);if(Zf.valid(a))return a}return null}}}Zf.prototype.visible=!1,Zf.findFrom=Zf.findGapCursorFrom,z.jsonID("gapcursor",Zf);class Xf{constructor(e){this.pos=e}map(e){return new Xf(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Zf.valid(t)?new Zf(t):z.near(t)}}function Kf(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}const Yf=B({ArrowLeft:Jf("horiz",-1),ArrowRight:Jf("horiz",1),ArrowUp:Jf("vert",-1),ArrowDown:Jf("vert",1)});function Jf(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,a=t>0?i.$to:i.$from,s=i.empty;if(i instanceof S){if(!o.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=e.doc.resolve(t>0?a.after():a.before())}let l=Zf.findGapCursorFrom(a,t,s);return!!l&&(r&&r(e.tr.setSelection(new Zf(l))),!0)}}function Qf(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Zf.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&M.isSelectable(e.state.doc.nodeAt(o.inside))||(e.dispatch(e.state.tr.setSelection(new Zf(r))),0))}function eg(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Zf))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=m.empty;for(let a=r.length-1;a>=0;a--)o=m.from(r[a].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new p(o,0,0));return i.setSelection(S.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function tg(e){if(!(e.selection instanceof Zf))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",f.create(e.doc,[v.widget(e.selection.head,t,{key:"gapcursor"})])}function ng(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-cursor",...t}}),e}var rg=a(null,"dropIndicatorState");ng(rg,{displayName:"Ctx<dropIndicatorState>"});var og=a({width:2,color:!1,class:"milkdown-drop-indicator"},"dropIndicatorConfig");ng(og,{displayName:"Ctx<dropIndicatorConfig>"});var ig=new d("MILKDOWN_DROP_INDICATOR_DOM"),ag=s(e=>new c({key:ig,view:t=>{const n=e.get(og.key),r=document.createElement("div");Object.assign(r.style,{position:"fixed",pointerEvents:"none",display:"none",backgroundColor:n.color,top:"0",left:"0"}),r.classList.add(n.class),r.classList.add("milkdown-drop-indicator"),t.dom.parentNode?.appendChild(r);const o=e.use(rg.key),i=e=>{!function(e,t,n){if(!t)return void Object.assign(e.style,{display:"none"});const{line:r}=t,{width:o}=n,{p1:{x:i,y:a},p2:{x:s,y:l}}=r;let c,d,u=a,h=i;a===l?(c=s-i,d=o,u-=o/2):(c=o,d=l-a,h-=o/2),u=Math.round(u),h=Math.round(h),Object.assign(e.style,{display:"block",width:`${c}px`,height:`${d}px`,transform:`translate(${h}px, ${u}px)`})}(r,e,n)};return o.on(i),{destroy:()=>{o.off(i),r.remove()}}}}));ng(ag,{displayName:"Prose<dropIndicatorDOM>"});var sg=s(e=>function(e){let t;return new c({key:new d("prosekit-drop-indicator"),view:n=>(t=function(e,t){let n,r,o,i,a=[];return(s,l)=>(o&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(o,s)||(o=s,i=((o,i)=>{if(!e.editable||e.isDestroyed)return;let s=(()=>{const t=e.dom.getBoundingClientRect(),o=e.state.doc;return a&&n&&r&&t.width===r.width&&t.height===r.height&&t.x===r.x&&t.y===r.y&&n.eq(o)||(r=t,n=o,a=function(e){let t=[[-1,e.state.doc]],n=[];for(;t.length>0;){const[r,o]=t.pop();if(r>=0){let t=e.nodeDOM(r);if(t&&Wf(t)){let{top:e,bottom:i,left:a,right:s}=t.getBoundingClientRect();n.push([r,[a,e,s,e]],[r+o.nodeSize,[a,i,s,i]])}}if(o.isBlock&&!o.isTextblock){let e=r+1;for(let n of o.children)t.push([e,n]),e+=n.nodeSize}}return n}(e)),a})();s.sort((e,t)=>{const[n,r]=e,[i,a]=t;return Gf(o,r)-Gf(o,a)||n-i}),s=s.slice(0,8);const l=s.find(n=>!1!==t?.({view:e,pos:n[0],event:i}));return l&&function(e,t){const n=e.dragging;if(!n)return;const{move:r}=n;if(!r)return;const o=e.state.selection;if(!(o instanceof M))return;const{from:i,to:a}=o;return i<=t&&t<=a}(e,l[0])?void 0:l})(s,l)),i)}(n,e.onDrag),function(e,t,n){let r,o,i,a=e.dom,s=!1;const l=()=>{r&&clearTimeout(r),s=!1,r=setTimeout(()=>{s||n.onHide?.()},30)},c=r=>{s=!0;const{clientX:a,clientY:c}=r;if(o===a&&i===c)return;o=a,i=c;let d=t([a,c],r);if(d){const[t,[r,o,i,a]]=d,s={p1:{x:r,y:o},p2:{x:i,y:a}};n.onShow?.({view:e,pos:t,line:s})}else l()};return a.addEventListener("dragover",c),a.addEventListener("dragend",l),a.addEventListener("drop",l),a.addEventListener("dragleave",l),{destroy:()=>{a.removeEventListener("dragover",c),a.removeEventListener("dragend",l),a.removeEventListener("drop",l),a.removeEventListener("dragleave",l)}}}(n,t,e)),props:{handleDrop(e,n,r,o){if(!t)return!1;const i=t([n.clientX,n.clientY],n);if(!i)return!1;n.preventDefault();let a=i[0],s=e.state.tr;if(o){let{node:t}=e.dragging||{};t?t.replace(s):s.deleteSelection()}let l=s.mapping.map(a),c=0==r.openStart&&0==r.openEnd&&1==r.content.childCount,d=s.doc;if(c?s.replaceRangeWith(l,l,r.content.firstChild):s.replaceRange(l,l,r),s.doc.eq(d))return!0;let u=s.doc.resolve(l);if(c&&M.isSelectable(r.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(r.content.firstChild))s.setSelection(new M(u));else{let t=s.mapping.map(a);s.mapping.maps[s.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),s.setSelection(function(e,t,n){return e.someProp("createSelectionBetween",r=>r(e,t,n))||S.between(t,n,void 0)}(e,u,s.doc.resolve(t)))}return e.focus(),e.dispatch(s.setMeta("uiEvent","drop")),!0}}})}({onShow:t=>{e.set(rg.key,t)},onHide:()=>{e.set(rg.key,null)},onDrag:()=>!0}));ng(sg,{displayName:"Prose<dropIndicator>"});var lg=s(()=>new c({props:{decorations:tg,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&Zf.valid(n)?new Zf(n):null,handleClick:Qf,handleKeyDown:Yf,handleDOMEvents:{beforeinput:eg}}}));ng(lg,{displayName:"Prose<gapCursor>"});var cg=[lg,og,rg,ag,sg].flat(),dg=new d("prosemirror-virtual-cursor");function ug(e){const t=e.index(),n=e.parent.maybeChild(t);let r=e.textOffset?n:null;return!r&&t>0&&(r=e.parent.maybeChild(t-1)),[null==r?void 0:r.marks,null==n?void 0:n.marks]}function hg(e){return e&&"object"==typeof e&&"$cursor"in e}var pg=Object.defineProperty,mg=Object.getOwnPropertySymbols,fg=Object.prototype.hasOwnProperty,gg=Object.prototype.propertyIsEnumerable,vg=(e,t,n)=>t in e?pg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yg=(e,t)=>{for(var n in t||(t={}))fg.call(t,n)&&vg(e,n,t[n]);if(mg)for(var n of mg(t))gg.call(t,n)&&vg(e,n,t[n]);return e};function bg(e,t){return Object.assign(e,{meta:yg({package:"@milkdown/components"},t)}),e}const wg=a({imageIcon:"🌌",uploadButton:"Upload",confirmButton:"⏎",uploadPlaceholderText:"/Paste",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},"inlineImageConfigCtx");function xg({icon:e,class:t,onClick:n}){return md("span",{class:On("milkdown-icon",t),onPointerdown:n,innerHTML:e?An.sanitize(e.trim()):void 0})}bg(wg,{displayName:"Config<image-inline>",group:"ImageInline"}),xg.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const kg=tu("abcdefg",8),Cg=fl({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:o,uploadButton:i,confirmButton:a,uploadPlaceholderText:s,className:l,onImageLoadError:c}){var d,u;const h=vs(!1),p=vs(),m=vs(null!=(d=t.value)?d:""),f=vs(kg()),g=vs(0!==(null==(u=t.value)?void 0:u.length)),v=e=>{const t=e.target.value;g.value=0!==t.length,m.value=t},y=e=>{var t,r;"Enter"===e.key&&n(null!=(r=null==(t=p.value)?void 0:t.value)?r:"")},b=e=>{var t;const o=null==(t=e.target.files)?void 0:t[0];o&&r(o).then(e=>{e&&(n(e),g.value=!0)}).catch(e=>{console.error("An error occurred while uploading image"),console.error(e)})};return()=>md("div",{class:On("image-edit",l)},md(xg,{icon:o,class:"image-icon"}),md("div",{class:On("link-importer",h.value&&"focus")},md("input",{ref:p,draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:"link-input-area",value:m.value,onInput:v,onKeydown:y,onFocus:()=>h.value=!0,onBlur:()=>h.value=!1}),!g.value&&md("div",{class:"placeholder"},md("input",{disabled:e.value,class:"hidden",id:f.value,type:"file",accept:"image/*",onChange:b}),md("label",{class:"uploader",for:f.value},md(xg,{icon:i})),md("span",{class:"text",onClick:()=>{var e;return null==(e=p.value)?void 0:e.focus()}},s))),m.value&&md(Nc,null,md("div",{class:"image-preview"},md("img",{src:m.value,alt:"",onError:e=>Promise.resolve(null==c?void 0:c(e)).catch(()=>{})})),md("div",{class:"confirm",onClick:()=>(()=>{var e,t;n(null!=(t=null==(e=p.value)?void 0:e.value)?t:"")})()},md(xg,{icon:a}))))}}),_g=fl({props:{src:{type:Object,required:!0},alt:{type:Object,required:!0},title:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){const{src:t,alt:n,title:r}=e;return()=>{var o;return(null==(o=t.value)?void 0:o.length)?md("img",{class:"image-inline",src:t.value,alt:n.value,title:r.value}):md(Cg,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr("src",t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,className:"empty-image-inline"})}}}),Sg=R(re.node,e=>(t,n,r)=>{const o=vs(t.attrs.src),i=vs(t.attrs.alt),a=vs(t.attrs.title),s=vs(!1),l=vs(!n.editable),c=e.get(wg.key),d=jd(_g,{src:o,alt:i,title:a,selected:s,readonly:l,setAttr:(e,t)=>{if(!n.editable)return;const o=r();null!=o&&n.dispatch(n.state.tr.setNodeAttribute(o,e,"src"===e?An.sanitize(t):t))},config:c}),u=document.createElement("span");u.className="milkdown-image-inline";const h=sl(()=>{s.value?u.classList.add("selected"):u.classList.remove("selected")}),p=c.proxyDomURL,m=e=>{if(p){const t=p(e.attrs.src);"string"==typeof t?o.value=t:t.then(e=>{o.value=e}).catch(console.error)}else o.value=e.attrs.src;i.value=e.attrs.alt,a.value=e.attrs.title};return m(t),d.mount(u),{dom:u,update:e=>e.type===t.type&&(m(e),!0),stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{h(),d.unmount(),u.remove()}}});bg(Sg,{displayName:"NodeView<image-inline>",group:"ImageInline"});const Ag=[wg,Sg];class Mg extends Error{constructor(e,t){var n,r,o="KaTeX parse error: "+e,i=t&&t.loc;if(i&&i.start<=i.end){var a=i.lexer.input;n=i.start,r=i.end,n===a.length?o+=" at end of input: ":o+=" at position "+(n+1)+": ";var s=a.slice(n,r).replace(/[^]/g,"$&̲");o+=(n>15?"…"+a.slice(n-15,n):a.slice(0,n))+s+(r+15<a.length?a.slice(r,r+15)+"…":a.slice(r))}super(o),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Mg.prototype),this.position=n,null!=n&&null!=r&&(this.length=r-n),this.rawMessage=e}}var Tg=/([A-Z])/g,Eg=e=>e.replace(Tg,"-$1").toLowerCase(),Lg={"&":"&",">":">","<":"<",'"':""","'":"'"},Og=/[&><"']/g,Ig=e=>String(e).replace(Og,e=>Lg[e]),Rg=e=>"ordgroup"===e.type||"color"===e.type?1===e.body.length?Rg(e.body[0]):e:"font"===e.type?Rg(e.body):e,Pg=new Set(["mathord","textord","atom"]),Bg=e=>Pg.has(Rg(e).type),zg={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Dg(e,t,n,r){var o=n[t];e[t]=void 0!==o?r.processor?r.processor(o):o:function(e){return void 0!==e.default?e.default:function(e){if("string"!=typeof e)return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}(Array.isArray(e.type)?e.type[0]:e.type)}(r)}class Ng{constructor(e){for(var t of(void 0===e&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Object.keys(zg))){var n=zg[t];n&&Dg(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new Mg("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(o){r="error"}return!(!r||"ignore"===r||!0!==r&&"error"!==r&&("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),1)))}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=(e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"})(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class Hg{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return qg[jg[this.id]]}sub(){return qg[Vg[this.id]]}fracNum(){return qg[Fg[this.id]]}fracDen(){return qg[$g[this.id]]}cramp(){return qg[Wg[this.id]]}text(){return qg[Ug[this.id]]}isTight(){return this.size>=2}}var qg=[new Hg(0,0,!1),new Hg(1,0,!0),new Hg(2,1,!1),new Hg(3,1,!0),new Hg(4,2,!1),new Hg(5,2,!0),new Hg(6,3,!1),new Hg(7,3,!0)],jg=[4,5,4,5,6,7,6,7],Vg=[5,5,5,5,7,7,7,7],Fg=[2,3,4,5,6,7,6,7],$g=[3,3,5,5,7,7,7,7],Wg=[1,1,3,3,5,5,7,7],Ug=[0,1,2,3,2,3,2,3],Gg={DISPLAY:qg[0],TEXT:qg[2],SCRIPT:qg[4],SCRIPTSCRIPT:qg[6]},Zg=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],Xg=[];function Kg(e){for(var t=0;t<Xg.length;t+=2)if(e>=Xg[t]&&e<=Xg[t+1])return!0;return!1}Zg.forEach(e=>e.blocks.forEach(e=>Xg.push(...e)));var Yg=e=>e+" "+e,Jg=80,Qg={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:Yg("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Yg("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Yg("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Yg("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:Yg("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:Yg("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Yg("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Yg("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class ev{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(function(e){return"toText"in e}(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var tv={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},nv={ex:!0,em:!0,mu:!0},rv=function(e){return"string"!=typeof e&&(e=e.unit),e in tv||e in nv||"ex"===e},ov=function(e,t){var n;if(e.unit in tv)n=tv[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new Mg("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},iv=function(e){return+e.toFixed(4)+"em"},av=function(e){return e.filter(e=>e).join(" ")},sv=function(e){var t="";for(var n of Object.keys(e)){var r=e[n];void 0!==r&&(t+=Eg(n)+":"+r+";")}return t},lv=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},cv=function(e){var t=document.createElement(e);for(var n of(t.className=av(this.classes),Object.assign(t.style,this.style),Object.keys(this.attributes)))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},dv=/[\s"'>/=\x00-\x1f]/,uv=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Ig(av(this.classes))+'"');var n=sv(this.style);for(var r of(n&&(t+=' style="'+Ig(n)+'"'),Object.keys(this.attributes))){if(dv.test(r))throw new Mg("Invalid attribute name '"+r+"'");t+=" "+r+'="'+Ig(this.attributes[r])+'"'}t+=">";for(var o=0;o<this.children.length;o++)t+=this.children[o].toMarkup();return t+"</"+e+">"};class hv{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,lv.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return cv.call(this,"span")}toMarkup(){return uv.call(this,"span")}}class pv{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,lv.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return cv.call(this,"a")}toMarkup(){return uv.call(this,"a")}}class mv{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+Ig(this.src)+'" alt="'+Ig(this.alt)+'"',t=sv(this.style);return t&&(e+=' style="'+Ig(t)+'"'),e+"'/>"}}var fv={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class gv{constructor(e,t,n,r,o,i,a,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=o||0,this.width=i||0,this.classes=a||[],this.style=s||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Zg.length;t++)for(var n=Zg[t],r=0;r<n.blocks.length;r++){var o=n.blocks[r];if(e>=o[0]&&e<=o[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=fv[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&((t=document.createElement("span")).style.marginRight=iv(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=av(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Ig(av(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+iv(this.italic)+";"),(n+=sv(this.style))&&(e=!0,t+=' style="'+Ig(n)+'"');var r=Ig(this.text);return e?(t+=">",t+=r,t+="</span>"):r}}class vv{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Ig(this.attributes[t])+'"';e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class yv{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",Qg[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+Ig(this.alternate)+'"/>':'<path d="'+Ig(Qg[this.pathName])+'"/>'}}class bv{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Ig(this.attributes[t])+'"';return e+"/>"}}var wv={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},xv={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},kv={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function Cv(e,t,n){if(!wv[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=wv[t][r];if(!o&&e[0]in kv&&(r=kv[e[0]].charCodeAt(0),o=wv[t][r]),o||"text"!==n||Kg(r)&&(o=wv[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var _v={},Sv={math:{},text:{}};function Av(e,t,n,r,o,i){Sv[e][o]={font:t,group:n,replace:r},i&&r&&(Sv[e][r]=Sv[e][o])}var Mv="math",Tv="text",Ev="main",Lv="ams",Ov="accent-token",Iv="bin",Rv="close",Pv="inner",Bv="mathord",zv="op-token",Dv="open",Nv="punct",Hv="rel",qv="spacing",jv="textord";Av(Mv,Ev,Hv,"≡","\\equiv",!0),Av(Mv,Ev,Hv,"≺","\\prec",!0),Av(Mv,Ev,Hv,"≻","\\succ",!0),Av(Mv,Ev,Hv,"∼","\\sim",!0),Av(Mv,Ev,Hv,"⊥","\\perp"),Av(Mv,Ev,Hv,"⪯","\\preceq",!0),Av(Mv,Ev,Hv,"⪰","\\succeq",!0),Av(Mv,Ev,Hv,"≃","\\simeq",!0),Av(Mv,Ev,Hv,"∣","\\mid",!0),Av(Mv,Ev,Hv,"≪","\\ll",!0),Av(Mv,Ev,Hv,"≫","\\gg",!0),Av(Mv,Ev,Hv,"≍","\\asymp",!0),Av(Mv,Ev,Hv,"∥","\\parallel"),Av(Mv,Ev,Hv,"⋈","\\bowtie",!0),Av(Mv,Ev,Hv,"⌣","\\smile",!0),Av(Mv,Ev,Hv,"⊑","\\sqsubseteq",!0),Av(Mv,Ev,Hv,"⊒","\\sqsupseteq",!0),Av(Mv,Ev,Hv,"≐","\\doteq",!0),Av(Mv,Ev,Hv,"⌢","\\frown",!0),Av(Mv,Ev,Hv,"∋","\\ni",!0),Av(Mv,Ev,Hv,"∝","\\propto",!0),Av(Mv,Ev,Hv,"⊢","\\vdash",!0),Av(Mv,Ev,Hv,"⊣","\\dashv",!0),Av(Mv,Ev,Hv,"∋","\\owns"),Av(Mv,Ev,Nv,".","\\ldotp"),Av(Mv,Ev,Nv,"⋅","\\cdotp"),Av(Mv,Ev,Nv,"⋅","·"),Av(Tv,Ev,jv,"⋅","·"),Av(Mv,Ev,jv,"#","\\#"),Av(Tv,Ev,jv,"#","\\#"),Av(Mv,Ev,jv,"&","\\&"),Av(Tv,Ev,jv,"&","\\&"),Av(Mv,Ev,jv,"ℵ","\\aleph",!0),Av(Mv,Ev,jv,"∀","\\forall",!0),Av(Mv,Ev,jv,"ℏ","\\hbar",!0),Av(Mv,Ev,jv,"∃","\\exists",!0),Av(Mv,Ev,jv,"∇","\\nabla",!0),Av(Mv,Ev,jv,"♭","\\flat",!0),Av(Mv,Ev,jv,"ℓ","\\ell",!0),Av(Mv,Ev,jv,"♮","\\natural",!0),Av(Mv,Ev,jv,"♣","\\clubsuit",!0),Av(Mv,Ev,jv,"℘","\\wp",!0),Av(Mv,Ev,jv,"♯","\\sharp",!0),Av(Mv,Ev,jv,"♢","\\diamondsuit",!0),Av(Mv,Ev,jv,"ℜ","\\Re",!0),Av(Mv,Ev,jv,"♡","\\heartsuit",!0),Av(Mv,Ev,jv,"ℑ","\\Im",!0),Av(Mv,Ev,jv,"♠","\\spadesuit",!0),Av(Mv,Ev,jv,"§","\\S",!0),Av(Tv,Ev,jv,"§","\\S"),Av(Mv,Ev,jv,"¶","\\P",!0),Av(Tv,Ev,jv,"¶","\\P"),Av(Mv,Ev,jv,"†","\\dag"),Av(Tv,Ev,jv,"†","\\dag"),Av(Tv,Ev,jv,"†","\\textdagger"),Av(Mv,Ev,jv,"‡","\\ddag"),Av(Tv,Ev,jv,"‡","\\ddag"),Av(Tv,Ev,jv,"‡","\\textdaggerdbl"),Av(Mv,Ev,Rv,"⎱","\\rmoustache",!0),Av(Mv,Ev,Dv,"⎰","\\lmoustache",!0),Av(Mv,Ev,Rv,"⟯","\\rgroup",!0),Av(Mv,Ev,Dv,"⟮","\\lgroup",!0),Av(Mv,Ev,Iv,"∓","\\mp",!0),Av(Mv,Ev,Iv,"⊖","\\ominus",!0),Av(Mv,Ev,Iv,"⊎","\\uplus",!0),Av(Mv,Ev,Iv,"⊓","\\sqcap",!0),Av(Mv,Ev,Iv,"∗","\\ast"),Av(Mv,Ev,Iv,"⊔","\\sqcup",!0),Av(Mv,Ev,Iv,"◯","\\bigcirc",!0),Av(Mv,Ev,Iv,"∙","\\bullet",!0),Av(Mv,Ev,Iv,"‡","\\ddagger"),Av(Mv,Ev,Iv,"≀","\\wr",!0),Av(Mv,Ev,Iv,"⨿","\\amalg"),Av(Mv,Ev,Iv,"&","\\And"),Av(Mv,Ev,Hv,"⟵","\\longleftarrow",!0),Av(Mv,Ev,Hv,"⇐","\\Leftarrow",!0),Av(Mv,Ev,Hv,"⟸","\\Longleftarrow",!0),Av(Mv,Ev,Hv,"⟶","\\longrightarrow",!0),Av(Mv,Ev,Hv,"⇒","\\Rightarrow",!0),Av(Mv,Ev,Hv,"⟹","\\Longrightarrow",!0),Av(Mv,Ev,Hv,"↔","\\leftrightarrow",!0),Av(Mv,Ev,Hv,"⟷","\\longleftrightarrow",!0),Av(Mv,Ev,Hv,"⇔","\\Leftrightarrow",!0),Av(Mv,Ev,Hv,"⟺","\\Longleftrightarrow",!0),Av(Mv,Ev,Hv,"↦","\\mapsto",!0),Av(Mv,Ev,Hv,"⟼","\\longmapsto",!0),Av(Mv,Ev,Hv,"↗","\\nearrow",!0),Av(Mv,Ev,Hv,"↩","\\hookleftarrow",!0),Av(Mv,Ev,Hv,"↪","\\hookrightarrow",!0),Av(Mv,Ev,Hv,"↘","\\searrow",!0),Av(Mv,Ev,Hv,"↼","\\leftharpoonup",!0),Av(Mv,Ev,Hv,"⇀","\\rightharpoonup",!0),Av(Mv,Ev,Hv,"↙","\\swarrow",!0),Av(Mv,Ev,Hv,"↽","\\leftharpoondown",!0),Av(Mv,Ev,Hv,"⇁","\\rightharpoondown",!0),Av(Mv,Ev,Hv,"↖","\\nwarrow",!0),Av(Mv,Ev,Hv,"⇌","\\rightleftharpoons",!0),Av(Mv,Lv,Hv,"≮","\\nless",!0),Av(Mv,Lv,Hv,"","\\@nleqslant"),Av(Mv,Lv,Hv,"","\\@nleqq"),Av(Mv,Lv,Hv,"⪇","\\lneq",!0),Av(Mv,Lv,Hv,"≨","\\lneqq",!0),Av(Mv,Lv,Hv,"","\\@lvertneqq"),Av(Mv,Lv,Hv,"⋦","\\lnsim",!0),Av(Mv,Lv,Hv,"⪉","\\lnapprox",!0),Av(Mv,Lv,Hv,"⊀","\\nprec",!0),Av(Mv,Lv,Hv,"⋠","\\npreceq",!0),Av(Mv,Lv,Hv,"⋨","\\precnsim",!0),Av(Mv,Lv,Hv,"⪹","\\precnapprox",!0),Av(Mv,Lv,Hv,"≁","\\nsim",!0),Av(Mv,Lv,Hv,"","\\@nshortmid"),Av(Mv,Lv,Hv,"∤","\\nmid",!0),Av(Mv,Lv,Hv,"⊬","\\nvdash",!0),Av(Mv,Lv,Hv,"⊭","\\nvDash",!0),Av(Mv,Lv,Hv,"⋪","\\ntriangleleft"),Av(Mv,Lv,Hv,"⋬","\\ntrianglelefteq",!0),Av(Mv,Lv,Hv,"⊊","\\subsetneq",!0),Av(Mv,Lv,Hv,"","\\@varsubsetneq"),Av(Mv,Lv,Hv,"⫋","\\subsetneqq",!0),Av(Mv,Lv,Hv,"","\\@varsubsetneqq"),Av(Mv,Lv,Hv,"≯","\\ngtr",!0),Av(Mv,Lv,Hv,"","\\@ngeqslant"),Av(Mv,Lv,Hv,"","\\@ngeqq"),Av(Mv,Lv,Hv,"⪈","\\gneq",!0),Av(Mv,Lv,Hv,"≩","\\gneqq",!0),Av(Mv,Lv,Hv,"","\\@gvertneqq"),Av(Mv,Lv,Hv,"⋧","\\gnsim",!0),Av(Mv,Lv,Hv,"⪊","\\gnapprox",!0),Av(Mv,Lv,Hv,"⊁","\\nsucc",!0),Av(Mv,Lv,Hv,"⋡","\\nsucceq",!0),Av(Mv,Lv,Hv,"⋩","\\succnsim",!0),Av(Mv,Lv,Hv,"⪺","\\succnapprox",!0),Av(Mv,Lv,Hv,"≆","\\ncong",!0),Av(Mv,Lv,Hv,"","\\@nshortparallel"),Av(Mv,Lv,Hv,"∦","\\nparallel",!0),Av(Mv,Lv,Hv,"⊯","\\nVDash",!0),Av(Mv,Lv,Hv,"⋫","\\ntriangleright"),Av(Mv,Lv,Hv,"⋭","\\ntrianglerighteq",!0),Av(Mv,Lv,Hv,"","\\@nsupseteqq"),Av(Mv,Lv,Hv,"⊋","\\supsetneq",!0),Av(Mv,Lv,Hv,"","\\@varsupsetneq"),Av(Mv,Lv,Hv,"⫌","\\supsetneqq",!0),Av(Mv,Lv,Hv,"","\\@varsupsetneqq"),Av(Mv,Lv,Hv,"⊮","\\nVdash",!0),Av(Mv,Lv,Hv,"⪵","\\precneqq",!0),Av(Mv,Lv,Hv,"⪶","\\succneqq",!0),Av(Mv,Lv,Hv,"","\\@nsubseteqq"),Av(Mv,Lv,Iv,"⊴","\\unlhd"),Av(Mv,Lv,Iv,"⊵","\\unrhd"),Av(Mv,Lv,Hv,"↚","\\nleftarrow",!0),Av(Mv,Lv,Hv,"↛","\\nrightarrow",!0),Av(Mv,Lv,Hv,"⇍","\\nLeftarrow",!0),Av(Mv,Lv,Hv,"⇏","\\nRightarrow",!0),Av(Mv,Lv,Hv,"↮","\\nleftrightarrow",!0),Av(Mv,Lv,Hv,"⇎","\\nLeftrightarrow",!0),Av(Mv,Lv,Hv,"△","\\vartriangle"),Av(Mv,Lv,jv,"ℏ","\\hslash"),Av(Mv,Lv,jv,"▽","\\triangledown"),Av(Mv,Lv,jv,"◊","\\lozenge"),Av(Mv,Lv,jv,"Ⓢ","\\circledS"),Av(Mv,Lv,jv,"®","\\circledR"),Av(Tv,Lv,jv,"®","\\circledR"),Av(Mv,Lv,jv,"∡","\\measuredangle",!0),Av(Mv,Lv,jv,"∄","\\nexists"),Av(Mv,Lv,jv,"℧","\\mho"),Av(Mv,Lv,jv,"Ⅎ","\\Finv",!0),Av(Mv,Lv,jv,"⅁","\\Game",!0),Av(Mv,Lv,jv,"‵","\\backprime"),Av(Mv,Lv,jv,"▲","\\blacktriangle"),Av(Mv,Lv,jv,"▼","\\blacktriangledown"),Av(Mv,Lv,jv,"■","\\blacksquare"),Av(Mv,Lv,jv,"⧫","\\blacklozenge"),Av(Mv,Lv,jv,"★","\\bigstar"),Av(Mv,Lv,jv,"∢","\\sphericalangle",!0),Av(Mv,Lv,jv,"∁","\\complement",!0),Av(Mv,Lv,jv,"ð","\\eth",!0),Av(Tv,Ev,jv,"ð","ð"),Av(Mv,Lv,jv,"╱","\\diagup"),Av(Mv,Lv,jv,"╲","\\diagdown"),Av(Mv,Lv,jv,"□","\\square"),Av(Mv,Lv,jv,"□","\\Box"),Av(Mv,Lv,jv,"◊","\\Diamond"),Av(Mv,Lv,jv,"¥","\\yen",!0),Av(Tv,Lv,jv,"¥","\\yen",!0),Av(Mv,Lv,jv,"✓","\\checkmark",!0),Av(Tv,Lv,jv,"✓","\\checkmark"),Av(Mv,Lv,jv,"ℶ","\\beth",!0),Av(Mv,Lv,jv,"ℸ","\\daleth",!0),Av(Mv,Lv,jv,"ℷ","\\gimel",!0),Av(Mv,Lv,jv,"ϝ","\\digamma",!0),Av(Mv,Lv,jv,"ϰ","\\varkappa"),Av(Mv,Lv,Dv,"┌","\\@ulcorner",!0),Av(Mv,Lv,Rv,"┐","\\@urcorner",!0),Av(Mv,Lv,Dv,"└","\\@llcorner",!0),Av(Mv,Lv,Rv,"┘","\\@lrcorner",!0),Av(Mv,Lv,Hv,"≦","\\leqq",!0),Av(Mv,Lv,Hv,"⩽","\\leqslant",!0),Av(Mv,Lv,Hv,"⪕","\\eqslantless",!0),Av(Mv,Lv,Hv,"≲","\\lesssim",!0),Av(Mv,Lv,Hv,"⪅","\\lessapprox",!0),Av(Mv,Lv,Hv,"≊","\\approxeq",!0),Av(Mv,Lv,Iv,"⋖","\\lessdot"),Av(Mv,Lv,Hv,"⋘","\\lll",!0),Av(Mv,Lv,Hv,"≶","\\lessgtr",!0),Av(Mv,Lv,Hv,"⋚","\\lesseqgtr",!0),Av(Mv,Lv,Hv,"⪋","\\lesseqqgtr",!0),Av(Mv,Lv,Hv,"≑","\\doteqdot"),Av(Mv,Lv,Hv,"≓","\\risingdotseq",!0),Av(Mv,Lv,Hv,"≒","\\fallingdotseq",!0),Av(Mv,Lv,Hv,"∽","\\backsim",!0),Av(Mv,Lv,Hv,"⋍","\\backsimeq",!0),Av(Mv,Lv,Hv,"⫅","\\subseteqq",!0),Av(Mv,Lv,Hv,"⋐","\\Subset",!0),Av(Mv,Lv,Hv,"⊏","\\sqsubset",!0),Av(Mv,Lv,Hv,"≼","\\preccurlyeq",!0),Av(Mv,Lv,Hv,"⋞","\\curlyeqprec",!0),Av(Mv,Lv,Hv,"≾","\\precsim",!0),Av(Mv,Lv,Hv,"⪷","\\precapprox",!0),Av(Mv,Lv,Hv,"⊲","\\vartriangleleft"),Av(Mv,Lv,Hv,"⊴","\\trianglelefteq"),Av(Mv,Lv,Hv,"⊨","\\vDash",!0),Av(Mv,Lv,Hv,"⊪","\\Vvdash",!0),Av(Mv,Lv,Hv,"⌣","\\smallsmile"),Av(Mv,Lv,Hv,"⌢","\\smallfrown"),Av(Mv,Lv,Hv,"≏","\\bumpeq",!0),Av(Mv,Lv,Hv,"≎","\\Bumpeq",!0),Av(Mv,Lv,Hv,"≧","\\geqq",!0),Av(Mv,Lv,Hv,"⩾","\\geqslant",!0),Av(Mv,Lv,Hv,"⪖","\\eqslantgtr",!0),Av(Mv,Lv,Hv,"≳","\\gtrsim",!0),Av(Mv,Lv,Hv,"⪆","\\gtrapprox",!0),Av(Mv,Lv,Iv,"⋗","\\gtrdot"),Av(Mv,Lv,Hv,"⋙","\\ggg",!0),Av(Mv,Lv,Hv,"≷","\\gtrless",!0),Av(Mv,Lv,Hv,"⋛","\\gtreqless",!0),Av(Mv,Lv,Hv,"⪌","\\gtreqqless",!0),Av(Mv,Lv,Hv,"≖","\\eqcirc",!0),Av(Mv,Lv,Hv,"≗","\\circeq",!0),Av(Mv,Lv,Hv,"≜","\\triangleq",!0),Av(Mv,Lv,Hv,"∼","\\thicksim"),Av(Mv,Lv,Hv,"≈","\\thickapprox"),Av(Mv,Lv,Hv,"⫆","\\supseteqq",!0),Av(Mv,Lv,Hv,"⋑","\\Supset",!0),Av(Mv,Lv,Hv,"⊐","\\sqsupset",!0),Av(Mv,Lv,Hv,"≽","\\succcurlyeq",!0),Av(Mv,Lv,Hv,"⋟","\\curlyeqsucc",!0),Av(Mv,Lv,Hv,"≿","\\succsim",!0),Av(Mv,Lv,Hv,"⪸","\\succapprox",!0),Av(Mv,Lv,Hv,"⊳","\\vartriangleright"),Av(Mv,Lv,Hv,"⊵","\\trianglerighteq"),Av(Mv,Lv,Hv,"⊩","\\Vdash",!0),Av(Mv,Lv,Hv,"∣","\\shortmid"),Av(Mv,Lv,Hv,"∥","\\shortparallel"),Av(Mv,Lv,Hv,"≬","\\between",!0),Av(Mv,Lv,Hv,"⋔","\\pitchfork",!0),Av(Mv,Lv,Hv,"∝","\\varpropto"),Av(Mv,Lv,Hv,"◀","\\blacktriangleleft"),Av(Mv,Lv,Hv,"∴","\\therefore",!0),Av(Mv,Lv,Hv,"∍","\\backepsilon"),Av(Mv,Lv,Hv,"▶","\\blacktriangleright"),Av(Mv,Lv,Hv,"∵","\\because",!0),Av(Mv,Lv,Hv,"⋘","\\llless"),Av(Mv,Lv,Hv,"⋙","\\gggtr"),Av(Mv,Lv,Iv,"⊲","\\lhd"),Av(Mv,Lv,Iv,"⊳","\\rhd"),Av(Mv,Lv,Hv,"≂","\\eqsim",!0),Av(Mv,Ev,Hv,"⋈","\\Join"),Av(Mv,Lv,Hv,"≑","\\Doteq",!0),Av(Mv,Lv,Iv,"∔","\\dotplus",!0),Av(Mv,Lv,Iv,"∖","\\smallsetminus"),Av(Mv,Lv,Iv,"⋒","\\Cap",!0),Av(Mv,Lv,Iv,"⋓","\\Cup",!0),Av(Mv,Lv,Iv,"⩞","\\doublebarwedge",!0),Av(Mv,Lv,Iv,"⊟","\\boxminus",!0),Av(Mv,Lv,Iv,"⊞","\\boxplus",!0),Av(Mv,Lv,Iv,"⋇","\\divideontimes",!0),Av(Mv,Lv,Iv,"⋉","\\ltimes",!0),Av(Mv,Lv,Iv,"⋊","\\rtimes",!0),Av(Mv,Lv,Iv,"⋋","\\leftthreetimes",!0),Av(Mv,Lv,Iv,"⋌","\\rightthreetimes",!0),Av(Mv,Lv,Iv,"⋏","\\curlywedge",!0),Av(Mv,Lv,Iv,"⋎","\\curlyvee",!0),Av(Mv,Lv,Iv,"⊝","\\circleddash",!0),Av(Mv,Lv,Iv,"⊛","\\circledast",!0),Av(Mv,Lv,Iv,"⋅","\\centerdot"),Av(Mv,Lv,Iv,"⊺","\\intercal",!0),Av(Mv,Lv,Iv,"⋒","\\doublecap"),Av(Mv,Lv,Iv,"⋓","\\doublecup"),Av(Mv,Lv,Iv,"⊠","\\boxtimes",!0),Av(Mv,Lv,Hv,"⇢","\\dashrightarrow",!0),Av(Mv,Lv,Hv,"⇠","\\dashleftarrow",!0),Av(Mv,Lv,Hv,"⇇","\\leftleftarrows",!0),Av(Mv,Lv,Hv,"⇆","\\leftrightarrows",!0),Av(Mv,Lv,Hv,"⇚","\\Lleftarrow",!0),Av(Mv,Lv,Hv,"↞","\\twoheadleftarrow",!0),Av(Mv,Lv,Hv,"↢","\\leftarrowtail",!0),Av(Mv,Lv,Hv,"↫","\\looparrowleft",!0),Av(Mv,Lv,Hv,"⇋","\\leftrightharpoons",!0),Av(Mv,Lv,Hv,"↶","\\curvearrowleft",!0),Av(Mv,Lv,Hv,"↺","\\circlearrowleft",!0),Av(Mv,Lv,Hv,"↰","\\Lsh",!0),Av(Mv,Lv,Hv,"⇈","\\upuparrows",!0),Av(Mv,Lv,Hv,"↿","\\upharpoonleft",!0),Av(Mv,Lv,Hv,"⇃","\\downharpoonleft",!0),Av(Mv,Ev,Hv,"⊶","\\origof",!0),Av(Mv,Ev,Hv,"⊷","\\imageof",!0),Av(Mv,Lv,Hv,"⊸","\\multimap",!0),Av(Mv,Lv,Hv,"↭","\\leftrightsquigarrow",!0),Av(Mv,Lv,Hv,"⇉","\\rightrightarrows",!0),Av(Mv,Lv,Hv,"⇄","\\rightleftarrows",!0),Av(Mv,Lv,Hv,"↠","\\twoheadrightarrow",!0),Av(Mv,Lv,Hv,"↣","\\rightarrowtail",!0),Av(Mv,Lv,Hv,"↬","\\looparrowright",!0),Av(Mv,Lv,Hv,"↷","\\curvearrowright",!0),Av(Mv,Lv,Hv,"↻","\\circlearrowright",!0),Av(Mv,Lv,Hv,"↱","\\Rsh",!0),Av(Mv,Lv,Hv,"⇊","\\downdownarrows",!0),Av(Mv,Lv,Hv,"↾","\\upharpoonright",!0),Av(Mv,Lv,Hv,"⇂","\\downharpoonright",!0),Av(Mv,Lv,Hv,"⇝","\\rightsquigarrow",!0),Av(Mv,Lv,Hv,"⇝","\\leadsto"),Av(Mv,Lv,Hv,"⇛","\\Rrightarrow",!0),Av(Mv,Lv,Hv,"↾","\\restriction"),Av(Mv,Ev,jv,"‘","`"),Av(Mv,Ev,jv,"$","\\$"),Av(Tv,Ev,jv,"$","\\$"),Av(Tv,Ev,jv,"$","\\textdollar"),Av(Mv,Ev,jv,"%","\\%"),Av(Tv,Ev,jv,"%","\\%"),Av(Mv,Ev,jv,"_","\\_"),Av(Tv,Ev,jv,"_","\\_"),Av(Tv,Ev,jv,"_","\\textunderscore"),Av(Mv,Ev,jv,"∠","\\angle",!0),Av(Mv,Ev,jv,"∞","\\infty",!0),Av(Mv,Ev,jv,"′","\\prime"),Av(Mv,Ev,jv,"△","\\triangle"),Av(Mv,Ev,jv,"Γ","\\Gamma",!0),Av(Mv,Ev,jv,"Δ","\\Delta",!0),Av(Mv,Ev,jv,"Θ","\\Theta",!0),Av(Mv,Ev,jv,"Λ","\\Lambda",!0),Av(Mv,Ev,jv,"Ξ","\\Xi",!0),Av(Mv,Ev,jv,"Π","\\Pi",!0),Av(Mv,Ev,jv,"Σ","\\Sigma",!0),Av(Mv,Ev,jv,"Υ","\\Upsilon",!0),Av(Mv,Ev,jv,"Φ","\\Phi",!0),Av(Mv,Ev,jv,"Ψ","\\Psi",!0),Av(Mv,Ev,jv,"Ω","\\Omega",!0),Av(Mv,Ev,jv,"A","Α"),Av(Mv,Ev,jv,"B","Β"),Av(Mv,Ev,jv,"E","Ε"),Av(Mv,Ev,jv,"Z","Ζ"),Av(Mv,Ev,jv,"H","Η"),Av(Mv,Ev,jv,"I","Ι"),Av(Mv,Ev,jv,"K","Κ"),Av(Mv,Ev,jv,"M","Μ"),Av(Mv,Ev,jv,"N","Ν"),Av(Mv,Ev,jv,"O","Ο"),Av(Mv,Ev,jv,"P","Ρ"),Av(Mv,Ev,jv,"T","Τ"),Av(Mv,Ev,jv,"X","Χ"),Av(Mv,Ev,jv,"¬","\\neg",!0),Av(Mv,Ev,jv,"¬","\\lnot"),Av(Mv,Ev,jv,"⊤","\\top"),Av(Mv,Ev,jv,"⊥","\\bot"),Av(Mv,Ev,jv,"∅","\\emptyset"),Av(Mv,Lv,jv,"∅","\\varnothing"),Av(Mv,Ev,Bv,"α","\\alpha",!0),Av(Mv,Ev,Bv,"β","\\beta",!0),Av(Mv,Ev,Bv,"γ","\\gamma",!0),Av(Mv,Ev,Bv,"δ","\\delta",!0),Av(Mv,Ev,Bv,"ϵ","\\epsilon",!0),Av(Mv,Ev,Bv,"ζ","\\zeta",!0),Av(Mv,Ev,Bv,"η","\\eta",!0),Av(Mv,Ev,Bv,"θ","\\theta",!0),Av(Mv,Ev,Bv,"ι","\\iota",!0),Av(Mv,Ev,Bv,"κ","\\kappa",!0),Av(Mv,Ev,Bv,"λ","\\lambda",!0),Av(Mv,Ev,Bv,"μ","\\mu",!0),Av(Mv,Ev,Bv,"ν","\\nu",!0),Av(Mv,Ev,Bv,"ξ","\\xi",!0),Av(Mv,Ev,Bv,"ο","\\omicron",!0),Av(Mv,Ev,Bv,"π","\\pi",!0),Av(Mv,Ev,Bv,"ρ","\\rho",!0),Av(Mv,Ev,Bv,"σ","\\sigma",!0),Av(Mv,Ev,Bv,"τ","\\tau",!0),Av(Mv,Ev,Bv,"υ","\\upsilon",!0),Av(Mv,Ev,Bv,"ϕ","\\phi",!0),Av(Mv,Ev,Bv,"χ","\\chi",!0),Av(Mv,Ev,Bv,"ψ","\\psi",!0),Av(Mv,Ev,Bv,"ω","\\omega",!0),Av(Mv,Ev,Bv,"ε","\\varepsilon",!0),Av(Mv,Ev,Bv,"ϑ","\\vartheta",!0),Av(Mv,Ev,Bv,"ϖ","\\varpi",!0),Av(Mv,Ev,Bv,"ϱ","\\varrho",!0),Av(Mv,Ev,Bv,"ς","\\varsigma",!0),Av(Mv,Ev,Bv,"φ","\\varphi",!0),Av(Mv,Ev,Iv,"∗","*",!0),Av(Mv,Ev,Iv,"+","+"),Av(Mv,Ev,Iv,"−","-",!0),Av(Mv,Ev,Iv,"⋅","\\cdot",!0),Av(Mv,Ev,Iv,"∘","\\circ",!0),Av(Mv,Ev,Iv,"÷","\\div",!0),Av(Mv,Ev,Iv,"±","\\pm",!0),Av(Mv,Ev,Iv,"×","\\times",!0),Av(Mv,Ev,Iv,"∩","\\cap",!0),Av(Mv,Ev,Iv,"∪","\\cup",!0),Av(Mv,Ev,Iv,"∖","\\setminus",!0),Av(Mv,Ev,Iv,"∧","\\land"),Av(Mv,Ev,Iv,"∨","\\lor"),Av(Mv,Ev,Iv,"∧","\\wedge",!0),Av(Mv,Ev,Iv,"∨","\\vee",!0),Av(Mv,Ev,jv,"√","\\surd"),Av(Mv,Ev,Dv,"⟨","\\langle",!0),Av(Mv,Ev,Dv,"∣","\\lvert"),Av(Mv,Ev,Dv,"∥","\\lVert"),Av(Mv,Ev,Rv,"?","?"),Av(Mv,Ev,Rv,"!","!"),Av(Mv,Ev,Rv,"⟩","\\rangle",!0),Av(Mv,Ev,Rv,"∣","\\rvert"),Av(Mv,Ev,Rv,"∥","\\rVert"),Av(Mv,Ev,Hv,"=","="),Av(Mv,Ev,Hv,":",":"),Av(Mv,Ev,Hv,"≈","\\approx",!0),Av(Mv,Ev,Hv,"≅","\\cong",!0),Av(Mv,Ev,Hv,"≥","\\ge"),Av(Mv,Ev,Hv,"≥","\\geq",!0),Av(Mv,Ev,Hv,"←","\\gets"),Av(Mv,Ev,Hv,">","\\gt",!0),Av(Mv,Ev,Hv,"∈","\\in",!0),Av(Mv,Ev,Hv,"","\\@not"),Av(Mv,Ev,Hv,"⊂","\\subset",!0),Av(Mv,Ev,Hv,"⊃","\\supset",!0),Av(Mv,Ev,Hv,"⊆","\\subseteq",!0),Av(Mv,Ev,Hv,"⊇","\\supseteq",!0),Av(Mv,Lv,Hv,"⊈","\\nsubseteq",!0),Av(Mv,Lv,Hv,"⊉","\\nsupseteq",!0),Av(Mv,Ev,Hv,"⊨","\\models"),Av(Mv,Ev,Hv,"←","\\leftarrow",!0),Av(Mv,Ev,Hv,"≤","\\le"),Av(Mv,Ev,Hv,"≤","\\leq",!0),Av(Mv,Ev,Hv,"<","\\lt",!0),Av(Mv,Ev,Hv,"→","\\rightarrow",!0),Av(Mv,Ev,Hv,"→","\\to"),Av(Mv,Lv,Hv,"≱","\\ngeq",!0),Av(Mv,Lv,Hv,"≰","\\nleq",!0),Av(Mv,Ev,qv," ","\\ "),Av(Mv,Ev,qv," ","\\space"),Av(Mv,Ev,qv," ","\\nobreakspace"),Av(Tv,Ev,qv," ","\\ "),Av(Tv,Ev,qv," "," "),Av(Tv,Ev,qv," ","\\space"),Av(Tv,Ev,qv," ","\\nobreakspace"),Av(Mv,Ev,qv,"","\\nobreak"),Av(Mv,Ev,qv,"","\\allowbreak"),Av(Mv,Ev,Nv,",",","),Av(Mv,Ev,Nv,";",";"),Av(Mv,Lv,Iv,"⊼","\\barwedge",!0),Av(Mv,Lv,Iv,"⊻","\\veebar",!0),Av(Mv,Ev,Iv,"⊙","\\odot",!0),Av(Mv,Ev,Iv,"⊕","\\oplus",!0),Av(Mv,Ev,Iv,"⊗","\\otimes",!0),Av(Mv,Ev,jv,"∂","\\partial",!0),Av(Mv,Ev,Iv,"⊘","\\oslash",!0),Av(Mv,Lv,Iv,"⊚","\\circledcirc",!0),Av(Mv,Lv,Iv,"⊡","\\boxdot",!0),Av(Mv,Ev,Iv,"△","\\bigtriangleup"),Av(Mv,Ev,Iv,"▽","\\bigtriangledown"),Av(Mv,Ev,Iv,"†","\\dagger"),Av(Mv,Ev,Iv,"⋄","\\diamond"),Av(Mv,Ev,Iv,"⋆","\\star"),Av(Mv,Ev,Iv,"◃","\\triangleleft"),Av(Mv,Ev,Iv,"▹","\\triangleright"),Av(Mv,Ev,Dv,"{","\\{"),Av(Tv,Ev,jv,"{","\\{"),Av(Tv,Ev,jv,"{","\\textbraceleft"),Av(Mv,Ev,Rv,"}","\\}"),Av(Tv,Ev,jv,"}","\\}"),Av(Tv,Ev,jv,"}","\\textbraceright"),Av(Mv,Ev,Dv,"{","\\lbrace"),Av(Mv,Ev,Rv,"}","\\rbrace"),Av(Mv,Ev,Dv,"[","\\lbrack",!0),Av(Tv,Ev,jv,"[","\\lbrack",!0),Av(Mv,Ev,Rv,"]","\\rbrack",!0),Av(Tv,Ev,jv,"]","\\rbrack",!0),Av(Mv,Ev,Dv,"(","\\lparen",!0),Av(Mv,Ev,Rv,")","\\rparen",!0),Av(Tv,Ev,jv,"<","\\textless",!0),Av(Tv,Ev,jv,">","\\textgreater",!0),Av(Mv,Ev,Dv,"⌊","\\lfloor",!0),Av(Mv,Ev,Rv,"⌋","\\rfloor",!0),Av(Mv,Ev,Dv,"⌈","\\lceil",!0),Av(Mv,Ev,Rv,"⌉","\\rceil",!0),Av(Mv,Ev,jv,"\\","\\backslash"),Av(Mv,Ev,jv,"∣","|"),Av(Mv,Ev,jv,"∣","\\vert"),Av(Tv,Ev,jv,"|","\\textbar",!0),Av(Mv,Ev,jv,"∥","\\|"),Av(Mv,Ev,jv,"∥","\\Vert"),Av(Tv,Ev,jv,"∥","\\textbardbl"),Av(Tv,Ev,jv,"~","\\textasciitilde"),Av(Tv,Ev,jv,"\\","\\textbackslash"),Av(Tv,Ev,jv,"^","\\textasciicircum"),Av(Mv,Ev,Hv,"↑","\\uparrow",!0),Av(Mv,Ev,Hv,"⇑","\\Uparrow",!0),Av(Mv,Ev,Hv,"↓","\\downarrow",!0),Av(Mv,Ev,Hv,"⇓","\\Downarrow",!0),Av(Mv,Ev,Hv,"↕","\\updownarrow",!0),Av(Mv,Ev,Hv,"⇕","\\Updownarrow",!0),Av(Mv,Ev,zv,"∐","\\coprod"),Av(Mv,Ev,zv,"⋁","\\bigvee"),Av(Mv,Ev,zv,"⋀","\\bigwedge"),Av(Mv,Ev,zv,"⨄","\\biguplus"),Av(Mv,Ev,zv,"⋂","\\bigcap"),Av(Mv,Ev,zv,"⋃","\\bigcup"),Av(Mv,Ev,zv,"∫","\\int"),Av(Mv,Ev,zv,"∫","\\intop"),Av(Mv,Ev,zv,"∬","\\iint"),Av(Mv,Ev,zv,"∭","\\iiint"),Av(Mv,Ev,zv,"∏","\\prod"),Av(Mv,Ev,zv,"∑","\\sum"),Av(Mv,Ev,zv,"⨂","\\bigotimes"),Av(Mv,Ev,zv,"⨁","\\bigoplus"),Av(Mv,Ev,zv,"⨀","\\bigodot"),Av(Mv,Ev,zv,"∮","\\oint"),Av(Mv,Ev,zv,"∯","\\oiint"),Av(Mv,Ev,zv,"∰","\\oiiint"),Av(Mv,Ev,zv,"⨆","\\bigsqcup"),Av(Mv,Ev,zv,"∫","\\smallint"),Av(Tv,Ev,Pv,"…","\\textellipsis"),Av(Mv,Ev,Pv,"…","\\mathellipsis"),Av(Tv,Ev,Pv,"…","\\ldots",!0),Av(Mv,Ev,Pv,"…","\\ldots",!0),Av(Mv,Ev,Pv,"⋯","\\@cdots",!0),Av(Mv,Ev,Pv,"⋱","\\ddots",!0),Av(Mv,Ev,jv,"⋮","\\varvdots"),Av(Tv,Ev,jv,"⋮","\\varvdots"),Av(Mv,Ev,Ov,"ˊ","\\acute"),Av(Mv,Ev,Ov,"ˋ","\\grave"),Av(Mv,Ev,Ov,"¨","\\ddot"),Av(Mv,Ev,Ov,"~","\\tilde"),Av(Mv,Ev,Ov,"ˉ","\\bar"),Av(Mv,Ev,Ov,"˘","\\breve"),Av(Mv,Ev,Ov,"ˇ","\\check"),Av(Mv,Ev,Ov,"^","\\hat"),Av(Mv,Ev,Ov,"⃗","\\vec"),Av(Mv,Ev,Ov,"˙","\\dot"),Av(Mv,Ev,Ov,"˚","\\mathring"),Av(Mv,Ev,Bv,"","\\@imath"),Av(Mv,Ev,Bv,"","\\@jmath"),Av(Mv,Ev,jv,"ı","ı"),Av(Mv,Ev,jv,"ȷ","ȷ"),Av(Tv,Ev,jv,"ı","\\i",!0),Av(Tv,Ev,jv,"ȷ","\\j",!0),Av(Tv,Ev,jv,"ß","\\ss",!0),Av(Tv,Ev,jv,"æ","\\ae",!0),Av(Tv,Ev,jv,"œ","\\oe",!0),Av(Tv,Ev,jv,"ø","\\o",!0),Av(Tv,Ev,jv,"Æ","\\AE",!0),Av(Tv,Ev,jv,"Œ","\\OE",!0),Av(Tv,Ev,jv,"Ø","\\O",!0),Av(Tv,Ev,Ov,"ˊ","\\'"),Av(Tv,Ev,Ov,"ˋ","\\`"),Av(Tv,Ev,Ov,"ˆ","\\^"),Av(Tv,Ev,Ov,"˜","\\~"),Av(Tv,Ev,Ov,"ˉ","\\="),Av(Tv,Ev,Ov,"˘","\\u"),Av(Tv,Ev,Ov,"˙","\\."),Av(Tv,Ev,Ov,"¸","\\c"),Av(Tv,Ev,Ov,"˚","\\r"),Av(Tv,Ev,Ov,"ˇ","\\v"),Av(Tv,Ev,Ov,"¨",'\\"'),Av(Tv,Ev,Ov,"˝","\\H"),Av(Tv,Ev,Ov,"◯","\\textcircled");var Vv={"--":!0,"---":!0,"``":!0,"''":!0};Av(Tv,Ev,jv,"–","--",!0),Av(Tv,Ev,jv,"–","\\textendash"),Av(Tv,Ev,jv,"—","---",!0),Av(Tv,Ev,jv,"—","\\textemdash"),Av(Tv,Ev,jv,"‘","`",!0),Av(Tv,Ev,jv,"‘","\\textquoteleft"),Av(Tv,Ev,jv,"’","'",!0),Av(Tv,Ev,jv,"’","\\textquoteright"),Av(Tv,Ev,jv,"“","``",!0),Av(Tv,Ev,jv,"“","\\textquotedblleft"),Av(Tv,Ev,jv,"”","''",!0),Av(Tv,Ev,jv,"”","\\textquotedblright"),Av(Mv,Ev,jv,"°","\\degree",!0),Av(Tv,Ev,jv,"°","\\degree"),Av(Tv,Ev,jv,"°","\\textdegree",!0),Av(Mv,Ev,jv,"£","\\pounds"),Av(Mv,Ev,jv,"£","\\mathsterling",!0),Av(Tv,Ev,jv,"£","\\pounds"),Av(Tv,Ev,jv,"£","\\textsterling",!0),Av(Mv,Lv,jv,"✠","\\maltese"),Av(Tv,Lv,jv,"✠","\\maltese");for(var Fv=0;Fv<14;Fv++){var $v='0123456789/@."'.charAt(Fv);Av(Mv,Ev,jv,$v,$v)}for(var Wv=0;Wv<25;Wv++){var Uv='0123456789!@*()-=+";:?/.,'.charAt(Wv);Av(Tv,Ev,jv,Uv,Uv)}for(var Gv,Zv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Xv=0;Xv<52;Xv++){var Kv=Zv.charAt(Xv);Av(Mv,Ev,Bv,Kv,Kv),Av(Tv,Ev,jv,Kv,Kv)}Av(Mv,Lv,jv,"C","ℂ"),Av(Tv,Lv,jv,"C","ℂ"),Av(Mv,Lv,jv,"H","ℍ"),Av(Tv,Lv,jv,"H","ℍ"),Av(Mv,Lv,jv,"N","ℕ"),Av(Tv,Lv,jv,"N","ℕ"),Av(Mv,Lv,jv,"P","ℙ"),Av(Tv,Lv,jv,"P","ℙ"),Av(Mv,Lv,jv,"Q","ℚ"),Av(Tv,Lv,jv,"Q","ℚ"),Av(Mv,Lv,jv,"R","ℝ"),Av(Tv,Lv,jv,"R","ℝ"),Av(Mv,Lv,jv,"Z","ℤ"),Av(Tv,Lv,jv,"Z","ℤ"),Av(Mv,Ev,Bv,"h","ℎ"),Av(Tv,Ev,Bv,"h","ℎ");for(var Yv=0;Yv<52;Yv++){var Jv=Zv.charAt(Yv);Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56320+Yv)),Av(Tv,Ev,jv,Jv,Gv),Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56372+Yv)),Av(Tv,Ev,jv,Jv,Gv),Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56424+Yv)),Av(Tv,Ev,jv,Jv,Gv),Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56580+Yv)),Av(Tv,Ev,jv,Jv,Gv),Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56684+Yv)),Av(Tv,Ev,jv,Jv,Gv),Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56736+Yv)),Av(Tv,Ev,jv,Jv,Gv),Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56788+Yv)),Av(Tv,Ev,jv,Jv,Gv),Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56840+Yv)),Av(Tv,Ev,jv,Jv,Gv),Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56944+Yv)),Av(Tv,Ev,jv,Jv,Gv),Yv<26&&(Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56632+Yv)),Av(Tv,Ev,jv,Jv,Gv),Av(Mv,Ev,Bv,Jv,Gv=String.fromCharCode(55349,56476+Yv)),Av(Tv,Ev,jv,Jv,Gv))}Av(Mv,Ev,Bv,"k",Gv=String.fromCharCode(55349,56668)),Av(Tv,Ev,jv,"k",Gv);for(var Qv=0;Qv<10;Qv++){var ey=Qv.toString();Av(Mv,Ev,Bv,ey,Gv=String.fromCharCode(55349,57294+Qv)),Av(Tv,Ev,jv,ey,Gv),Av(Mv,Ev,Bv,ey,Gv=String.fromCharCode(55349,57314+Qv)),Av(Tv,Ev,jv,ey,Gv),Av(Mv,Ev,Bv,ey,Gv=String.fromCharCode(55349,57324+Qv)),Av(Tv,Ev,jv,ey,Gv),Av(Mv,Ev,Bv,ey,Gv=String.fromCharCode(55349,57334+Qv)),Av(Tv,Ev,jv,ey,Gv)}for(var ty=0;ty<3;ty++){var ny="ÐÞþ".charAt(ty);Av(Mv,Ev,Bv,ny,ny),Av(Tv,Ev,jv,ny,ny)}var ry={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},oy={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},iy={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},ay={mathClass:"",textClass:"",font:""},sy={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},ly={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},cy={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},dy={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},uy={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},hy={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},py={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},my=[ry,ry,oy,oy,iy,iy,{mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},ay,ay,ay,sy,sy,ly,ly,cy,cy,dy,dy,uy,uy,hy,hy,ay,ay,py,py],fy=[ry,ay,dy,uy,py],gy=function(e,t,n){if(Sv[n][e]){var r=Sv[n][e].replace;r&&(e=r)}return{value:e,metrics:Cv(e,t,n)}},vy=function(e,t,n,r,o){var i,a=gy(e,t,n),s=a.metrics;if(e=a.value,s){var l=s.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),i=new gv(e,s.height,s.depth,l,s.skew,s.width,o)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),i=new gv(e,0,0,0,0,0,o);if(r){i.maxFontSize=r.sizeMultiplier,r.style.isTight()&&i.classes.push("mtight");var c=r.getColor();c&&(i.style.color=c)}return i},yy=function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&gy(e,"Main-Bold",t).metrics?vy(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===Sv[t][e].font?vy(e,"Main-Regular",t,n,r):vy(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},by=function(e,t){var n="mathord"===e.type?"mathord":"textord",r=e.mode,o=e.text,i=["mord"],{font:a,fontFamily:s,fontWeight:l,fontShape:c}=t,d="math"===r||"text"===r&&!!a,u=d?a:s,h="",p="";if(55349===o.charCodeAt(0)){var m=(e=>{var t=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536;if(119808<=t&&t<120484){var n=Math.floor((t-119808)/26);return my[n]}if(120782<=t&&t<=120831){var r=Math.floor((t-120782)/10);return fy[r]}if(120485===t||120486===t)return my[0];if(120486<t&&t<120782)return ay;throw new Mg("Unsupported character: "+e)})(o);h=m.font,p=m[r+"Class"]}if(h)return vy(o,h,r,t,i.concat(p));if(u){var f,g;if("boldsymbol"===u){var v=function(e,t,n){return"textord"!==n&&gy(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(o,r,n);f=v.fontName,g=[v.fontClass]}else d?(f=Oy[a].fontName,g=[a]):(f=Ly(s,l,c),g=[s,l,c]);if(gy(o,f,r).metrics)return vy(o,f,r,t,i.concat(g));if(Vv.hasOwnProperty(o)&&"Typewriter"===f.slice(0,10)){for(var y=[],b=0;b<o.length;b++)y.push(vy(o[b],f,r,t,i.concat(g)));return Ay(y)}}if("mathord"===n)return vy(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var w=Sv[r][o]&&Sv[r][o].font;if("ams"===w){var x=Ly("amsrm",l,c);return vy(o,x,r,t,i.concat("amsrm",l,c))}if("main"!==w&&w){var k=Ly(w,l,c);return vy(o,k,r,t,i.concat(k,l,c))}var C=Ly("textrm",l,c);return vy(o,C,r,t,i.concat(l,c))}throw new Error("unexpected type: "+n+" in makeOrd")},wy=(e,t)=>{if(av(e.classes)!==av(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||0!==e.italic&&e.hasClass("mathnormal"))return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var o of Object.keys(t.style))if(e.style[o]!==t.style[o])return!1;return!0},xy=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof gv&&r instanceof gv&&wy(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},ky=function(e){for(var t=0,n=0,r=0,o=0;o<e.children.length;o++){var i=e.children[o];i.height>t&&(t=i.height),i.depth>n&&(n=i.depth),i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Cy=function(e,t,n,r){var o=new hv(e,t,n,r);return ky(o),o},_y=(e,t,n,r)=>new hv(e,t,n,r),Sy=function(e,t,n){var r=Cy([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=iv(r.height),r.maxFontSize=1,r},Ay=function(e){var t=new ev(e);return ky(t),t},My=function(e,t){return e instanceof ev?Cy([],[e],t):e},Ty=function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,o=r,i=1;i<t.length;i++){var a=-t[i].shift-o-t[i].elem.depth,s=a-(t[i-1].elem.height+t[i-1].elem.depth);o+=a,n.push({type:"kern",size:s}),n.push(t[i])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),o=0,i=0;i<n.length;i++){var a=n[i];if("elem"===a.type){var s=a.elem;o=Math.max(o,s.maxFontSize,s.height)}}o+=2;var l=Cy(["pstrut"],[]);l.style.height=iv(o);for(var c=[],d=r,u=r,h=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)h+=m.size;else{var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},y=Cy(g,[l,f],void 0,v);y.style.top=iv(-o-h-f.depth),m.marginLeft&&(y.style.marginLeft=m.marginLeft),m.marginRight&&(y.style.marginRight=m.marginRight),c.push(y),h+=f.height+f.depth}d=Math.min(d,h),u=Math.max(u,h)}var b,w=Cy(["vlist"],c);if(w.style.height=iv(u),d<0){var x=Cy([],[]),k=Cy(["vlist"],[x]);k.style.height=iv(-d);var C=Cy(["vlist-s"],[new gv("")]);b=[Cy(["vlist-r"],[w,C]),Cy(["vlist-r"],[k])]}else b=[Cy(["vlist-r"],[w])];var _=Cy(["vlist-t"],b);return 2===b.length&&_.classes.push("vlist-t2"),_.height=u,_.depth=-d,_},Ey=(e,t)=>{var n=Cy(["mspace"],[],t),r=ov(e,t);return n.style.marginRight=iv(r),n},Ly=(e,t,n)=>{var r;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===n?"Italic":"Regular")},Oy={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Iy={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Ry=function(e,t){var[n,r,o]=Iy[e],i=new yv(n),a=new vv([i],{width:iv(r),height:iv(o),style:"width:"+iv(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=_y(["overlay"],[a],t);return s.height=o,s.style.height=iv(o),s.style.width=iv(r),s},Py={number:3,unit:"mu"},By={number:4,unit:"mu"},zy={number:5,unit:"mu"},Dy={mord:{mop:Py,mbin:By,mrel:zy,minner:Py},mop:{mord:Py,mop:Py,mrel:zy,minner:Py},mbin:{mord:By,mop:By,mopen:By,minner:By},mrel:{mord:zy,mop:zy,mopen:zy,minner:zy},mopen:{},mclose:{mop:Py,mbin:By,mrel:zy,minner:Py},mpunct:{mord:Py,mop:Py,mrel:zy,mopen:Py,mclose:Py,mpunct:Py,minner:Py},minner:{mord:Py,mop:Py,mbin:By,mrel:zy,mopen:Py,mpunct:Py,minner:Py}},Ny={mord:{mop:Py},mop:{mord:Py,mop:Py},mbin:{},mrel:{},mopen:{},mclose:{mop:Py},mpunct:{},minner:{mop:Py}},Hy={},qy={},jy={};function Vy(e){for(var{type:t,names:n,htmlBuilder:r,mathmlBuilder:o}=e,i=0;i<n.length;++i)Hy[n[i]]=e;t&&(r&&(qy[t]=r),o&&(jy[t]=o))}function Fy(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;n&&(qy[t]=n),r&&(jy[t]=r)}var $y=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},Wy=function(e){return"ordgroup"===e.type?e.body:[e]},Uy=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),Gy=new Set(["rightmost","mrel","mclose","mpunct"]),Zy={display:Gg.DISPLAY,text:Gg.TEXT,script:Gg.SCRIPT,scriptscript:Gg.SCRIPTSCRIPT},Xy={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Ky=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=nb(e[i],t);if(a instanceof ev){var s=a.children;o.push(...s)}else o.push(a)}if(xy(o),!n)return o;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(Zy[c.style]))}var d=Cy([r[0]||"leftmost"],[],t),u=Cy([r[1]||"rightmost"],[],t),h="root"===n;return Yy(o,(e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&Gy.has(r)?t.classes[0]="mord":"mbin"===r&&Uy.has(n)&&(e.classes[0]="mord")},{node:d},u,h),Yy(o,(e,t)=>{var n,r,o=eb(t),i=eb(e),a=o&&i?e.hasClass("mtight")?null==(n=Ny[o])?void 0:n[i]:null==(r=Dy[o])?void 0:r[i]:null;if(a)return Ey(a,l)},{node:d},u,h),o},Yy=function(e,t,n,r,o){r&&e.push(r);for(var i=0;i<e.length;i++){var a=e[i],s=Jy(a);if(s)Yy(s.children,t,n,null,o);else{var l=!a.hasClass("mspace");if(l){var c=t(a,n.node);c&&(n.insertAfter?n.insertAfter(c):(e.unshift(c),i++))}l?n.node=a:o&&a.hasClass("newline")&&(n.node=Cy(["leftmost"])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),i++})(i)}}r&&e.pop()},Jy=function(e){return e instanceof ev||e instanceof pv||e instanceof hv&&e.hasClass("enclosing")?e:null},Qy=function(e,t){var n=Jy(e);if(n){var r=n.children;if(r.length){if("right"===t)return Qy(r[r.length-1],"right");if("left"===t)return Qy(r[0],"left")}}return e},eb=function(e,t){if(!e)return null;t&&(e=Qy(e,t));var n=e.classes[0];return Xy[n]||null},tb=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Cy(t.concat(n))},nb=function(e,t,n){if(!e)return Cy();if(qy[e.type]){var r=qy[e.type](e,t);if(n&&t.size!==n.size){r=Cy(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new Mg("Got group of unknown type: '"+e.type+"'")};function rb(e,t){var n=Cy(["base"],e,t),r=Cy(["strut"]);return r.style.height=iv(n.height+n.depth),n.depth&&(r.style.verticalAlign=iv(-n.depth)),n.children.unshift(r),n}function ob(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=Ky(e,t,"root");2===o.length&&o[1].hasClass("tag")&&(r=o.pop());for(var i,a=[],s=[],l=0;l<o.length;l++)if(s.push(o[l]),o[l].hasClass("mbin")||o[l].hasClass("mrel")||o[l].hasClass("allowbreak")){for(var c=!1;l<o.length-1&&o[l+1].hasClass("mspace")&&!o[l+1].hasClass("newline");)l++,s.push(o[l]),o[l].hasClass("nobreak")&&(c=!0);c||(a.push(rb(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(rb(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push(rb(s,t)),n?((i=rb(Ky(n,t,!0),t)).classes=["tag"],a.push(i)):r&&a.push(r);var d=Cy(["katex-html"],a);if(d.setAttribute("aria-hidden","true"),i){var u=i.children[0];u.style.height=iv(d.height+d.depth),d.depth&&(u.style.verticalAlign=iv(-d.depth))}return d}function ib(e){return new ev(e)}class ab{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=av(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof sb&&this.children[n+1]instanceof sb){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof sb;)r+=this.children[++n].toText();e.appendChild(new sb(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Ig(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Ig(av(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class sb{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ig(this.toText())}toText(){return this.text}}class lb{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",iv(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+iv(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var cb=new Set(["\\imath","\\jmath"]),db=new Set(["mrow","mtable"]),ub=function(e,t,n){return!Sv[t][e]||!Sv[t][e].replace||55349===e.charCodeAt(0)||Vv.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=Sv[t][e].replace),new sb(e)},hb=function(e){return 1===e.length?e[0]:new ab("mrow",e)},pb={mathit:"italic",boldsymbol:e=>"textord"===e.type?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},mb=(e,t)=>{if("text"===e.mode){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold"}var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode,o=pb[n];if(o)return"function"==typeof o?o(e):o;var i=e.text;if(cb.has(i))return null;if(Sv[r][i]){var a=Sv[r][i].replace;a&&(i=a)}return Cv(i,Oy[n].fontName,r)?Oy[n].variant:null};function fb(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof sb&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof sb&&","===n.text}return!1}var gb=function(e,t,n){if(1===e.length){var r=yb(e[0],t);return n&&r instanceof ab&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=yb(e[a],t);if(s instanceof ab&&o instanceof ab){if("mtext"===s.type&&"mtext"===o.type&&s.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...s.children);continue}if("mn"===s.type&&"mn"===o.type){o.children.push(...s.children);continue}if(fb(s)&&"mn"===o.type){o.children.push(...s.children);continue}if("mn"===s.type&&fb(o))s.children=[...o.children,...s.children],i.pop();else if(("msup"===s.type||"msub"===s.type)&&s.children.length>=1&&("mn"===o.type||fb(o))){var l=s.children[0];l instanceof ab&&"mn"===l.type&&(l.children=[...o.children,...l.children],i.pop())}else if("mi"===o.type&&1===o.children.length){var c=o.children[0];if(c instanceof sb&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var d=s.children[0];d instanceof sb&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(s),o=s}return i},vb=function(e,t,n){return hb(gb(e,t,n))},yb=function(e,t){if(!e)return new ab("mrow");if(jy[e.type])return jy[e.type](e,t);throw new Mg("Got group of unknown type: '"+e.type+"'")};function bb(e,t,n,r,o){var i,a=gb(e,n);i=1===a.length&&a[0]instanceof ab&&db.has(a[0].type)?a[0]:new ab("mrow",a);var s=new ab("annotation",[new sb(t)]);s.setAttribute("encoding","application/x-tex");var l=new ab("semantics",[i,s]),c=new ab("math",[l]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block"),Cy([o?"katex":"katex-mathml"],[c])}var wb=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],xb=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],kb=function(e,t){return t.size<2?e:wb[e-1][t.size-1]};class Cb{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Cb.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=xb[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new Cb(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:kb(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:xb[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=kb(Cb.BASESIZE,e);return this.size===t&&this.textSize===Cb.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Cb.BASESIZE?["sizing","reset-size"+this.size,"size"+Cb.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!_v[t=e>=5?0:e>=3?1:2]){var n=_v[t]={cssEmPerMu:xv.quad[t]/18};for(var r in xv)xv.hasOwnProperty(r)&&(n[r]=xv[r][t])}return _v[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Cb.BASESIZE=6;var _b=function(e){return new Cb({style:e.displayMode?Gg.DISPLAY:Gg.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Sb=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Cy(n,[e])}return e},Ab={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Mb=function(e){var t=new ab("mo",[new sb(Ab[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Tb={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Eb=new Set(["widehat","widecheck","widetilde","utilde"]),Lb=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.slice(1);if(Eb.has(r)&&"base"in e){var o,i,a,s="ordgroup"===e.base.type?e.base.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(o=420,n=2364,a=.42,i=r+"4"):(o=312,n=2340,a=.34,i="tilde4");else{var l=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],o=[0,239,300,360,420][l],a=[0,.24,.3,.3,.36,.42][l],i=r+l):(n=[0,600,1033,2339,2340][l],o=[0,260,286,306,312][l],a=[0,.26,.286,.3,.306,.34][l],i="tilde"+l)}var c=new yv(i),d=new vv([c],{width:"100%",height:iv(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:_y([],[d],t),minWidth:0,height:a}}var u=[],h=Tb[r];if(!h)throw new Error('No SVG data for "'+r+'".');var p,m,[f,g,v]=h,y=v/1e3,b=f.length;if(1===b){if(4!==h.length)throw new Error('Expected 4-tuple for single-path SVG data "'+r+'".');p=["hide-tail"],m=[h[3]]}else if(2===b)p=["halfarrow-left","halfarrow-right"],m=["xMinYMin","xMaxYMin"];else{if(3!==b)throw new Error("Correct katexImagesData or update code here to support\n "+b+" children.");p=["brace-left","brace-center","brace-right"],m=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<b;w++){var x=new yv(f[w]),k=new vv([x],{width:"400em",height:iv(y),viewBox:"0 0 "+n+" "+v,preserveAspectRatio:m[w]+" slice"}),C=_y([p[w]],[k],t);if(1===b)return{span:C,minWidth:g,height:y};C.style.height=iv(y),u.push(C)}return{span:Cy(["stretchy"],u,t),minWidth:g,height:y}}();return n.height=o,n.style.height=iv(o),r>0&&(n.style.minWidth=iv(r)),n},Ob={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ib={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Rb(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Pb(e){var t=Bb(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Bb(e){return e&&("atom"===e.type||Ib.hasOwnProperty(e.type))?e:null}var zb=e=>e instanceof gv?e:(e=>e instanceof hv||e instanceof pv||e instanceof ev)(e)&&1===e.children.length?zb(e.children[0]):void 0,Db=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=Rb(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof hv)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(nb(e,t)),e.base=r):n=(r=Rb(e,"accent")).base;var i,a,s=nb(n,t.havingCrampedStyle()),l=0;r.isShifty&&Bg(n)&&(l=null!=(i=null==(a=zb(s))?void 0:a.skew)?i:0);var c,d="\\c"===r.label,u=d?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(r.isStretchy)c=Lb(r,t),c=Ty({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:c,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+iv(2*l)+")",marginLeft:iv(2*l)}:void 0}]});else{var h,p;"\\vec"===r.label?(h=Ry("vec",t),p=Iy.vec[1]):(h=function(e){if(e instanceof gv)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}(h=by({type:"textord",mode:r.mode,text:r.label},t)),h.italic=0,p=h.width,d&&(u+=h.depth)),c=Cy(["accent-body"],[h]);var m="\\textcircled"===r.label;m&&(c.classes.push("accent-full"),u=s.height);var f=l;m||(f-=p/2),c.style.left=iv(f),"\\textcircled"===r.label&&(c.style.top=".2em"),c=Ty({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-u},{type:"elem",elem:c}]})}var g=Cy(["mord","accent"],[c],t);return o?(o.children[0]=g,o.height=Math.max(g.height,o.height),o.classes[0]="mord",o):g},Nb=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Vy({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],numArgs:1,handler:(e,t)=>{var n=$y(t[0]),r=!Nb.test(e.funcName),o=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:Db,mathmlBuilder:(e,t)=>{var n=e.isStretchy?Mb(e.label):new ab("mo",[ub(e.label,e.mode)]),r=new ab("mover",[yb(e.base,t),n]);return r.setAttribute("accent","true"),r}}),Vy({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),Vy({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:o}},htmlBuilder:(e,t)=>{var n=nb(e.base,t),r=Lb(e,t),o="\\utilde"===e.label?.12:0,i=Ty({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]});return Cy(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=Mb(e.label),r=new ab("munder",[yb(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Hb=e=>{var t=new ab("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Vy({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r,funcName:o}=e;return{type:"xArrow",mode:r.mode,label:o,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,o=t.havingStyle(r.sup()),i=My(nb(e.body,o,t),t),a="\\x"===e.label.slice(0,2)?"x":"cd";i.classes.push(a+"-arrow-pad"),e.below&&(o=t.havingStyle(r.sub()),(n=My(nb(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=Lb(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=i.depth),n){var u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=Ty({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:n,shift:u}]})}else s=Ty({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]}]});return Cy(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=Mb(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=Hb(yb(e.body,t));if(e.below){var i=Hb(yb(e.below,t));n=new ab("munderover",[r,i,o])}else n=new ab("mover",[r,o])}else if(e.below){var a=Hb(yb(e.below,t));n=new ab("munder",[r,a])}else n=Hb(),n=new ab("mover",[r,n]);return n}}),Vy({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Wy(o),isCharacterBox:Bg(o)}},htmlBuilder:function(e,t){var n=Ky(e.body,t,!0);return Cy([e.mclass],n,t)},mathmlBuilder:function(e,t){var n,r=gb(e.body,t);return"minner"===e.mclass?n=new ab("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new ab("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new ab("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"!==e.mclass&&"mclose"!==e.mclass||(n.attributes.lspace="0em",n.attributes.rspace="0em")),n}});var qb=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};Vy({type:"mclass",names:["\\@binrel"],numArgs:2,handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:qb(t[0]),body:Wy(t[1]),isCharacterBox:Bg(t[1])}}}),Vy({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?qb(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:Wy(i)},l="\\underset"===o?{type:"supsub",mode:a.mode,base:s,sub:a}:{type:"supsub",mode:a.mode,base:s,sup:a};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:Bg(l)}}}),Vy({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:qb(t[0]),body:Wy(t[0])}},htmlBuilder(e,t){var n=Ky(e.body,t,!0),r=Cy([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=gb(e.body,t),r=new ab("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var jb={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Vb=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Fb=e=>"textord"===e.type&&"@"===e.text,$b=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function Wb(e,t,n){var r=jb[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var o={type:"atom",text:r,mode:"math",family:"rel"},i={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[o],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[i],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}Vy({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=My(nb(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=iv(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new ab("mrow",[yb(e.label,t)]);return(n=new ab("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new ab("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Vy({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=My(nb(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new ab("mrow",[yb(e.fragment,t)])}),Vy({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(e,t){for(var{parser:n}=e,r=Rb(t[0],"ordgroup").body,o="",i=0;i<r.length;i++)o+=Rb(r[i],"textord").text;var a,s=parseInt(o);if(isNaN(s))throw new Mg("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new Mg("\\@char with invalid code point "+o);return s<=65535?a=String.fromCharCode(s):(s-=65536,a=String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:n.mode,text:a}}}),Vy({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(e,t){var{parser:n}=e,r=Rb(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:Wy(o)}},htmlBuilder:(e,t)=>{var n=Ky(e.body,t.withColor(e.color),!1);return Ay(n)},mathmlBuilder:(e,t)=>{var n=gb(e.body,t.withColor(e.color)),r=new ab("mstyle",n);return r.setAttribute("mathcolor",e.color),r}}),Vy({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=Rb(t[0],"color-token").color;n.gullet.macros.set("\\current@color",o);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:o,body:i}}}),Vy({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var{parser:r}=e,o="["===r.gullet.future().text?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:o&&Rb(o,"size").value}},htmlBuilder(e,t){var n=Cy(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=iv(ov(e.size,t)))),n},mathmlBuilder(e,t){var n=new ab("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",iv(ov(e.size,t)))),n}});var Ub={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Gb=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Mg("Expected a control sequence",e);return t},Zb=(e,t,n,r)=>{var o=e.gullet.macros.get(n.text);null==o&&(n.noexpand=!0,o={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,o,r)};Vy({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Ub[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=Ub[r.text]),Rb(t.parseFunction(),"internal");throw new Mg("Invalid token after macro prefix",r)}}),Vy({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),o=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new Mg("Expected a control sequence",r);for(var i,a=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){i=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Mg('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Mg('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new Mg("Expected a macro definition");s[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return i&&l.unshift(i),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(o,{tokens:l,numArgs:a,delimiters:s},n===Ub[n]),{type:"internal",mode:t.mode}}}),Vy({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Gb(t.gullet.popToken());t.gullet.consumeSpaces();var o=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return Zb(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Vy({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Gb(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return Zb(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var Xb=function(e,t,n){var r=Cv(Sv.math[e]&&Sv.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},Kb=function(e,t,n,r){var o=n.havingBaseStyle(t),i=Cy(r.concat(o.sizingClasses(n)),[e],n),a=o.sizeMultiplier/n.sizeMultiplier;return i.height*=a,i.depth*=a,i.maxFontSize=o.sizeMultiplier,i},Yb=function(e,t,n){var r=t.havingBaseStyle(n),o=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=iv(o),e.height-=o,e.depth+=o},Jb=function(e,t,n,r,o,i){var a=function(e,t,n,r){return vy(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Kb(Cy(["delimsizing","size"+t],[a],r),Gg.TEXT,r,i);return n&&Yb(s,r,Gg.TEXT),s},Qb=function(e,t,n){return{type:"elem",elem:Cy(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[Cy([],[vy(e,t,n)])])}},ew=function(e,t,n){var r=wv["Size4-Regular"][e.charCodeAt(0)]?wv["Size4-Regular"][e.charCodeAt(0)][4]:wv["Size1-Regular"][e.charCodeAt(0)][4],o=new yv("inner",function(e,t){switch(e){case"⎜":return Yg("M291 0 H417 V"+t+" H291z");case"∣":return Yg("M145 0 H188 V"+t+" H145z");case"∥":return Yg("M145 0 H188 V"+t+" H145z")+Yg("M367 0 H410 V"+t+" H367z");case"⎟":return Yg("M457 0 H583 V"+t+" H457z");case"⎢":return Yg("M319 0 H403 V"+t+" H319z");case"⎥":return Yg("M263 0 H347 V"+t+" H263z");case"⎪":return Yg("M384 0 H504 V"+t+" H384z");case"⏐":return Yg("M312 0 H355 V"+t+" H312z");case"‖":return Yg("M257 0 H300 V"+t+" H257z")+Yg("M478 0 H521 V"+t+" H478z");default:return""}}(e,Math.round(1e3*t))),i=new vv([o],{width:iv(r),height:iv(t),style:"width:"+iv(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=_y([],[i],n);return a.height=t,a.style.height=iv(t),a.style.width=iv(r),{type:"elem",elem:a}},tw={type:"kern",size:-.008},nw=new Set(["|","\\lvert","\\rvert","\\vert"]),rw=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),ow=function(e,t,n,r,o,i){var a,s,l,c,d="",u=0;a=l=c=e,s=null;var h="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?a=l="⏐":"\\Downarrow"===e?a=l="‖":"\\updownarrow"===e?(a="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(a="\\Uparrow",l="‖",c="\\Downarrow"):nw.has(e)?(l="∣",d="vert",u=333):rw.has(e)?(l="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=Xb(a,h,o),m=p.height+p.depth,f=Xb(l,h,o),g=f.height+f.depth,v=Xb(c,h,o),y=v.height+v.depth,b=0,w=1;if(null!==s){var x=Xb(s,h,o);b=x.height+x.depth,w=2}var k=m+y+b,C=k+Math.max(0,Math.ceil((t-k)/(w*g)))*w*g,_=r.fontMetrics().axisHeight;n&&(_*=r.sizeMultiplier);var S=C/2-_,A=[];if(d.length>0){var M=C-m-y,T=Math.round(1e3*C),E=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*M)),L=new yv(d,E),O=iv(u/1e3),I=iv(T/1e3),R=new vv([L],{width:O,height:I,viewBox:"0 0 "+u+" "+T}),P=_y([],[R],r);P.height=T/1e3,P.style.width=O,P.style.height=I,A.push({type:"elem",elem:P})}else{if(A.push(Qb(c,h,o)),A.push(tw),null===s){var B=C-m-y+.016;A.push(ew(l,B,r))}else{var z=(C-m-y-b)/2+.016;A.push(ew(l,z,r)),A.push(tw),A.push(Qb(s,h,o)),A.push(tw),A.push(ew(l,z,r))}A.push(tw),A.push(Qb(a,h,o))}var D=r.havingBaseStyle(Gg.TEXT),N=Ty({positionType:"bottom",positionData:S,children:A});return Kb(Cy(["delimsizing","mult"],[N],D),Gg.TEXT,r,i)},iw=.08,aw=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e){return"M95,"+(622+e+Jg)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize1":r=function(e){return"M263,"+(601+e+Jg)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize2":r=function(e){return"M983 "+(10+e+Jg)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize3":r=function(e){return"M424,"+(2398+e+Jg)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" 80\nh400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize4":r=function(e){return"M473,"+(2713+e+Jg)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" 80h400000v"+(40+e)+"H1017.7z"}(t);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+Jg)+"H400000"+(40+e)+"\nH742v"+(n-54-Jg-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v"+(40+e)+"H742z"}(t,0,n)}return r}(e,r,n),a=new yv(e,i),s=new vv([a],{width:"400em",height:iv(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return _y(["hide-tail"],[s],o)},sw=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lw=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),cw=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),dw=[0,1.2,1.8,2.4,3],uw=function(e,t,n,r,o){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),sw.has(e)||cw.has(e))return Jb(e,t,!1,n,r,o);if(lw.has(e))return ow(e,dw[t],!1,n,r,o);throw new Mg("Illegal delimiter: '"+e+"'")},hw=[{type:"small",style:Gg.SCRIPTSCRIPT},{type:"small",style:Gg.SCRIPT},{type:"small",style:Gg.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],pw=[{type:"small",style:Gg.SCRIPTSCRIPT},{type:"small",style:Gg.SCRIPT},{type:"small",style:Gg.TEXT},{type:"stack"}],mw=[{type:"small",style:Gg.SCRIPTSCRIPT},{type:"small",style:Gg.SCRIPT},{type:"small",style:Gg.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],fw=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";var t=e.type;throw new Error("Add support for delim type '"+t+"' here.")},gw=function(e,t,n,r){for(var o=Math.min(2,3-r.style.size);o<n.length;o++){var i=n[o];if("stack"===i.type)break;var a=Xb(e,fw(i),"math"),s=a.height+a.depth;if("small"===i.type&&(s*=r.havingBaseStyle(i.style).sizeMultiplier),s>t)return i}return n[n.length-1]},vw=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=cw.has(e)?hw:sw.has(e)?mw:pw;var s=gw(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=vy(e,"Main-Regular",o,r),s=Kb(a,t,r,i);return Yb(s,r,t),s}(e,s.style,0,r,o,i):"large"===s.type?Jb(e,s.size,n,r,o,i):ow(e,t,n,r,o,i)},yw=function(e,t,n,r,o,i){var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-a,n+a),c=Math.max(l/500*901,2*l-s);return vw(e,c,!0,r,o,i)},bw={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},ww=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function xw(e){return"isMiddle"in e}function kw(e,t){var n=Bb(e);if(n&&ww.has(n.text))return n;throw new Mg(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Cw(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Vy({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(e,t)=>{var n=kw(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:bw[e.funcName].size,mclass:bw[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Cy([e.mclass]):uw(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(ub(e.delim,e.mode));var n=new ab("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=iv(dw[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),Vy({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new Mg("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:kw(t[0],e).text,color:n}}}),Vy({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=kw(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Rb(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{Cw(e);for(var n,r,o=Ky(e.body,t,!0,["mopen","mclose"]),i=0,a=0,s=!1,l=0;l<o.length;l++)xw(o[l])?s=!0:(i=Math.max(o[l].height,i),a=Math.max(o[l].depth,a));if(i*=t.sizeMultiplier,a*=t.sizeMultiplier,n="."===e.left?tb(t,["mopen"]):yw(e.left,i,a,t,e.mode,["mopen"]),o.unshift(n),s)for(var c=1;c<o.length;c++){var d=o[c];if(xw(d)){var u=d.isMiddle;o[c]=yw(u.delim,i,a,u.options,e.mode,[])}}if("."===e.right)r=tb(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;r=yw(e.right,i,a,h,e.mode,["mclose"])}return o.push(r),Cy(["minner"],o,t)},mathmlBuilder:(e,t)=>{Cw(e);var n=gb(e.body,t);if("."!==e.left){var r=new ab("mo",[ub(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new ab("mo",[ub(e.right,e.mode)]);o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return hb(n)}}),Vy({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=kw(t[0],e);if(!e.parser.leftrightDepth)throw new Mg("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return"."===e.delim?n=tb(t,[]):(n=uw(e.delim,1,t,e.mode,[])).isMiddle={delim:e.delim,options:t},n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?ub("|","text"):ub(e.delim,e.mode),r=new ab("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}}),Vy({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(e,t,n){var{parser:r,funcName:o}=e,i=Rb(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:(e,t)=>{var n,r,o,i=My(nb(e.body,t),t),a=e.label.slice(1),s=t.sizeMultiplier,l=Bg(e.body);if("sout"===a)(n=Cy(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/s,r=-.5*t.fontMetrics().xHeight;else if("phase"===a){var c=ov({number:.6,unit:"pt"},t),d=ov({number:.35,unit:"ex"},t);s/=t.havingBaseSizing().sizeMultiplier;var u=i.height+i.depth+c+d;i.style.paddingLeft=iv(u/2+c);var h=Math.floor(1e3*u*s),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(h),m=new vv([new yv("phase",p)],{width:"400em",height:iv(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});(n=_y(["hide-tail"],[m],t)).style.height=iv(u),r=i.depth+c+d}else{var f,g;/cancel/.test(a)?l||i.classes.push("cancel-pad"):"angl"===a?i.classes.push("anglpad"):i.classes.push("boxpad");var v=0;/box/.test(a)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=f=t.fontMetrics().fboxsep+("colorbox"===a?0:v)):"angl"===a?(f=4*(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-i.depth)):g=f=l?.2:0,n=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=Cy(["stretchy",t],[],o),"fbox"===t){var s=o.color&&o.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new bv({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new bv({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new vv(l,{width:"100%",height:iv(a)});i=_y([],[c],o)}return i.height=a,i.style.height=iv(a),i}(i,a,f,g,t),/fbox|boxed|fcolorbox/.test(a)?(n.style.borderStyle="solid",n.style.borderWidth=iv(v)):"angl"===a&&.049!==v&&(n.style.borderTopWidth=iv(v),n.style.borderRightWidth=iv(v)),r=i.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)o=Ty({positionType:"individualShift",children:[{type:"elem",elem:n,shift:r},{type:"elem",elem:i,shift:0}]});else{var y=/cancel|phase/.test(a)?["svg-align"]:[];o=Ty({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:n,shift:r,wrapperClasses:y}]})}return/cancel/.test(a)&&(o.height=i.height,o.depth=i.depth),/cancel/.test(a)&&!l?Cy(["mord","cancel-lap"],[o],t):Cy(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var n,r=new ab(e.label.includes("colorbox")?"mpadded":"menclose",[yb(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+iv(o)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r}}),Vy({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(e,t,n){var{parser:r,funcName:o}=e,i=Rb(t[0],"color-token").color,a=Rb(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}}}),Vy({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),Vy({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}}}),Vy({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e;"math"===n.mode&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}}}),Vy({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var _w={};function Sw(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:i,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:o},l=0;l<n.length;++l)_w[n[l]]=s;i&&(qy[t]=i),a&&(jy[t]=a)}var Aw={};function Mw(e,t){Aw[e]=t}class Tw{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Tw(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Ew{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Ew(t,Tw.range(this,e))}}function Lw(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var Ow=e=>{if(!e.parser.settings.displayMode)throw new Mg("{"+e.envName+"} can be used only in display mode.")},Iw=new Set(["gather","gather*"]);function Rw(e){if(!e.includes("ed"))return!e.includes("*")}function Pw(e,t,n){var{hskipBeforeAndAfter:r,addJot:o,cols:i,arraystretch:a,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)a=1;else if(!(a=parseFloat(p))||a<0)throw new Mg("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],v=[],y=null!=l?[]:void 0;function b(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function w(){y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new Ew("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(b(),v.push(Lw(e));;){var x=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var k={type:"ordgroup",mode:e.mode,body:x};n&&(k={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[k]}),m.push(k);var C=e.fetch().text;if("&"===C){if(u&&m.length===u){if(c||s)throw new Mg("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===C){w(),1===m.length&&"styling"===k.type&&1===k.body.length&&"ordgroup"===k.body[0].type&&0===k.body[0].body.length&&(f.length>1||!d)&&f.pop(),v.length<f.length+1&&v.push([]);break}if("\\\\"!==C)throw new Mg("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var _=void 0;" "!==e.gullet.future().text&&(_=e.parseSizeGroup(!0)),g.push(_?_.value:null),w(),v.push(Lw(e)),m=[],f.push(m),b()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:o,arraystretch:a,body:f,cols:i,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:s,tags:y,leqno:h}}function Bw(e){return"d"===e.slice(0,1)?"display":"text"}var zw=function(e,t){var n,r,o=e.body.length,i=e.hLinesBeforeRow,a=0,s=new Array(o),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(Gg.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?ov({number:3,unit:"ex"},t):12*d,p=3*d,m=e.arraystretch*h,f=.7*m,g=.3*m,v=0;function y(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(y(i[0]),n=0;n<e.body.length;++n){var b=e.body[n],w=f,x=g;a<b.length&&(a=b.length);var k={cells:new Array(b.length),height:0,depth:0,pos:0};for(r=0;r<b.length;++r){var C=nb(b[r],t);x<C.depth&&(x=C.depth),w<C.height&&(w=C.height),k.cells[r]=C}var _=e.rowGaps[n],S=0;_&&(S=ov(_,t))>0&&(x<(S+=g)&&(x=S),S=0),e.addJot&&n<e.body.length-1&&(x+=p),k.height=w,k.depth=x,v+=w,k.pos=v,v+=x+S,s[n]=k,y(i[n+1])}var A,M,T=v/2+t.fontMetrics().axisHeight,E=e.cols||[],L=[],O=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<o;++n){var I=s[n],R=I.pos-T,P=e.tags[n],B=void 0;(B=!0===P?Cy(["eqn-num"],[],t):Cy([],!1===P?[]:Ky(P,t,!0),t)).depth=I.depth,B.height=I.height,O.push({type:"elem",elem:B,shift:R})}for(r=0,M=0;r<a||M<E.length;++r,++M){for(var z,D=E[M],N=!0;"separator"===(null==(H=D)?void 0:H.type);){var H;if(N||((A=Cy(["arraycolsep"],[])).style.width=iv(t.fontMetrics().doubleRuleSep),L.push(A)),"|"!==D.separator&&":"!==D.separator)throw new Mg("Invalid separator type: "+D.separator);var q="|"===D.separator?"solid":"dashed",j=Cy(["vertical-separator"],[],t);j.style.height=iv(v),j.style.borderRightWidth=iv(c),j.style.borderRightStyle=q,j.style.margin="0 "+iv(-c/2);var V=v-T;V&&(j.style.verticalAlign=iv(-V)),L.push(j),D=E[++M],N=!1}if(!(r>=a)){var F,$,W=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(W=null!=(F=null==($=D)?void 0:$.pregap)?F:u)&&((A=Cy(["arraycolsep"],[])).style.width=iv(W),L.push(A));var U=[];for(n=0;n<o;++n){var G=s[n],Z=G.cells[r];if(Z){var X=G.pos-T;Z.depth=G.depth,Z.height=G.height,U.push({type:"elem",elem:Z,shift:X})}}var K,Y,J=Ty({positionType:"individualShift",children:U}),Q=Cy(["col-align-"+((null==(z=D)?void 0:z.align)||"c")],[J]);L.push(Q),(r<a-1||e.hskipBeforeAndAfter)&&0!==(W=null!=(K=null==(Y=D)?void 0:Y.postgap)?K:u)&&((A=Cy(["arraycolsep"],[])).style.width=iv(W),L.push(A))}}var ee=Cy(["mtable"],L);if(l.length>0){for(var te=Sy("hline",t,c),ne=Sy("hdashline",t,c),re=[{type:"elem",elem:ee,shift:0}];l.length>0;){var oe=l.pop(),ie=oe.pos-T;oe.isDashed?re.push({type:"elem",elem:ne,shift:ie}):re.push({type:"elem",elem:te,shift:ie})}ee=Ty({positionType:"individualShift",children:re})}if(0===O.length)return Cy(["mord"],[ee],t);var ae=Ty({positionType:"individualShift",children:O}),se=Cy(["tag"],[ae],t);return Ay([ee,se])},Dw={c:"center ",l:"left ",r:"right "},Nw=function(e,t){for(var n=[],r=new ab("mtd",[],["mtr-glue"]),o=new ab("mtd",[],["mml-eqn-num"]),i=0;i<e.body.length;i++){for(var a=e.body[i],s=[],l=0;l<a.length;l++)s.push(new ab("mtd",[yb(a[l],t)]));e.tags&&e.tags[i]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(o):s.push(o)),n.push(new ab("mtr",s))}var c=new ab("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",iv(d));var u="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(u+="top ",g=1),"separator"===p[p.length-1].type&&(u+="bottom ",v-=1);for(var y=g;y<v;y++){var b=p[y];"align"===b.type?(h+=Dw[b.align],f&&(m+="none "),f=!0):"separator"===b.type&&f&&(m+="|"===b.separator?"solid ":"dashed ",f=!1)}c.setAttribute("columnalign",h.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){for(var w=e.cols||[],x="",k=1;k<w.length;k++)x+=k%2?"0em ":"1em ";c.setAttribute("columnspacing",x.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var C="",_=e.hLinesBeforeRow;u+=_[0].length>0?"left ":"",u+=_[_.length-1].length>0?"right ":"";for(var S=1;S<_.length-1;S++)C+=0===_[S].length?"none ":_[S][0]?"dashed ":"solid ";return/[sd]/.test(C)&&c.setAttribute("rowlines",C.trim()),""!==u&&(c=new ab("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new ab("mstyle",[c])).setAttribute("scriptlevel","1"),c},Hw=function(e,t){e.envName.includes("ed")||Ow(e);var n=[],r="split"===e.envName,o=Pw(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:Rw(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes("at")?"alignat":"align",maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},"display"),i=0,a=0,s={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var l="",c=0;c<t[0].body.length;c++)l+=Rb(t[0].body[c],"textord").text;i=Number(l),a=2*i}var d=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var n=Rb(e[t],"styling");Rb(n.body[0],"ordgroup").body.unshift(s)}if(d)a<e.length&&(a=e.length);else{var r=e.length/2;if(i<r)throw new Mg("Too many math in a row: expected "+i+", but got "+r,e[0])}});for(var u=0;u<a;++u){var h="r",p=0;u%2==1?h="l":u>0&&d&&(p=1),n[u]={type:"align",align:h,pregap:p,postgap:0}}return o.colSeparationType=d?"align":"alignat",o};Sw({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Bb(t[0])?[t[0]]:Rb(t[0],"ordgroup").body).map(function(e){var t=Pb(e).text;if("lcr".includes(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new Mg("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Pw(e.parser,r,Bw(e.envName))},htmlBuilder:zw,mathmlBuilder:Nw}),Sw({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var o=e.parser;if(o.consumeSpaces(),"["===o.fetch().text){if(o.consume(),o.consumeSpaces(),n=o.fetch().text,!"lcr".includes(n))throw new Mg("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var i=Pw(e.parser,r,Bw(e.envName)),a=Math.max(0,...i.body.map(e=>e.length));return i.cols=new Array(a).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:zw,mathmlBuilder:Nw}),Sw({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=Pw(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:zw,mathmlBuilder:Nw}),Sw({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Bb(t[0])?[t[0]]:Rb(t[0],"ordgroup").body).map(function(e){var t=Pb(e).text;if("lc".includes(t))return{type:"align",align:t};throw new Mg("Unknown column alignment: "+t,e)});if(n.length>1)throw new Mg("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},o=Pw(e.parser,r,"script");if(o.body.length>0&&o.body[0].length>1)throw new Mg("{subarray} can contain only one column");return o},htmlBuilder:zw,mathmlBuilder:Nw}),Sw({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=Pw(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Bw(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:zw,mathmlBuilder:Nw}),Sw({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Hw,htmlBuilder:zw,mathmlBuilder:Nw}),Sw({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Iw.has(e.envName)&&Ow(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Rw(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Pw(e.parser,t,"display")},htmlBuilder:zw,mathmlBuilder:Nw}),Sw({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Hw,htmlBuilder:zw,mathmlBuilder:Nw}),Sw({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ow(e);var t={autoTag:Rw(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Pw(e.parser,t,"display")},htmlBuilder:zw,mathmlBuilder:Nw}),Sw({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Ow(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new Mg("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],o=[r],i=0;i<t.length;i++){for(var a=t[i],s=Vb(),l=0;l<a.length;l++)if(Fb(a[l])){r.push(s);var c=Pb(a[l+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".includes(c));else{if(!"<>AV".includes(c))throw new Mg('Expected one of "<>AV=|." after @',a[l]);for(var u=0;u<2;u++){for(var h=!0,p=l+1;p<a.length;p++){if($b(a[p],c)){h=!1,l=p;break}if(Fb(a[p]))throw new Mg("Missing a "+c+" character to complete a CD arrow.",a[p]);d[u].body.push(a[p])}if(h)throw new Mg("Missing a "+c+" character to complete a CD arrow.",a[l])}}var m={type:"styling",body:[Wb(c,d,e)],mode:"math",style:"display",resetFont:!0};r.push(m),s=Vb()}else s.body.push(a[l]);i%2==0?r.push(s):r.shift(),r=[],o.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:o,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(o[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(o.length+1).fill([])}}(e.parser)),htmlBuilder:zw,mathmlBuilder:Nw}),Mw("\\nonumber","\\gdef\\@eqnsw{0}"),Mw("\\notag","\\nonumber"),Vy({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new Mg(e.funcName+" valid only within array environment")}});var qw=_w;Vy({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new Mg("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=Rb(o.body[a],"textord").text;if("\\begin"===r){if(!qw.hasOwnProperty(i))throw new Mg("No such environment: "+i,o);var s=qw[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",s),d={mode:n.mode,envName:i,parser:n},u=s.handler(d,l,c);n.expect("\\end",!1);var h=n.nextToken,p=Rb(n.parseFunction(),"environment");if(p.name!==i)throw new Mg("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",h);return u}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var jw={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Vy({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=$y(t[0]),i=r in jw?jw[r]:r;return{type:"font",mode:n.mode,font:i.slice(1),body:o}},htmlBuilder:(e,t)=>{var n=e.font,r=t.withFont(n);return nb(e.body,r)},mathmlBuilder:(e,t)=>{var n=e.font,r=t.withFont(n);return yb(e.body,r)}}),Vy({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:qb(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Bg(r)}}}),Vy({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:o}=e,{mode:i}=n,a=n.parseExpression(!0,o);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}}});var Vw=(e,t)=>t?{type:"styling",mode:e.mode,style:t,body:[e]}:e;Vy({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n,{parser:r,funcName:o}=e,i=t[0],a=t[1],s=null,l=null;switch(o){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var c="\\cfrac"===o,d=null;return c||o.startsWith("\\d")?d="display":o.startsWith("\\t")&&(d="text"),Vw({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:c,hasBarLine:n,leftDelim:s,rightDelim:l,barSize:null},d)},htmlBuilder:(e,t)=>{var n,r=t.style,o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=nb(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,d,u,h,p,m,f,g,v,y,b=nb(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=ov(e.barSize,t),c=Sy("frac-line",t,d)):c=Sy("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),r.size===Gg.DISPLAY.size?(h=t.fontMetrics().num1,p=d>0?3*u:7*u,m=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,p=u):(h=t.fontMetrics().num3,p=3*u),m=t.fontMetrics().denom2),c){var w=t.fontMetrics().axisHeight;h-a.depth-(w+.5*d)<p&&(h+=p-(h-a.depth-(w+.5*d))),w-.5*d-(b.height-m)<p&&(m+=p-(w-.5*d-(b.height-m))),f=Ty({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:c,shift:-(w-.5*d)},{type:"elem",elem:a,shift:-h}]})}else{var x=h-a.depth-(b.height-m);x<p&&(h+=.5*(p-x),m+=.5*(p-x)),f=Ty({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:a,shift:-h}]})}return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===Gg.DISPLAY.size?t.fontMetrics().delim1:r.size===Gg.SCRIPTSCRIPT.size?t.havingStyle(Gg.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?tb(t,["mopen"]):vw(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),y=e.continued?Cy([]):null==e.rightDelim?tb(t,["mclose"]):vw(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),Cy(["mord"].concat(n.sizingClasses(t)),[v,Cy(["mfrac"],[f]),y],t)},mathmlBuilder:(e,t)=>{var n=new ab("mfrac",[yb(e.numer,t),yb(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=ov(e.barSize,t);n.setAttribute("linethickness",iv(r))}}else n.setAttribute("linethickness","0px");if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var i=new ab("mo",[new sb(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),o.push(i)}if(o.push(n),null!=e.rightDelim){var a=new ab("mo",[new sb(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}return hb(o)}return n}}),Vy({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(e){var t,{parser:n,funcName:r,token:o}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:o}}});var Fw=["display","text","script","scriptscript"],$w=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Vy({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(e,t){var n,{parser:r}=e,o=t[4],i=t[5],a=$y(t[0]),s="atom"===a.type&&"open"===a.family?$w(a.text):null,l=$y(t[1]),c="atom"===l.type&&"close"===l.family?$w(l.text):null,d=Rb(t[2],"size"),u=null;n=!!d.isBlank||(u=d.value).number>0;var h=null,p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=Rb(p.body[0],"textord");h=Fw[Number(m.text)]}}else p=Rb(p,"textord"),h=Fw[Number(p.text)];return Vw({type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:n,barSize:u,leftDelim:s,rightDelim:c},h)}}),Vy({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(e,t){var{parser:n,funcName:r,token:o}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Rb(t[0],"size").value,token:o}}}),Vy({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0],i=Rb(t[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=t[2],s=i.number>0;return{type:"genfrac",mode:n.mode,numer:o,denom:a,continued:!1,hasBarLine:s,barSize:i,leftDelim:null,rightDelim:null}}});var Ww=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?nb(e.sup,t.havingStyle(o.sup()),t):nb(e.sub,t.havingStyle(o.sub()),t),r=Rb(e.base,"horizBrace")):r=Rb(e,"horizBrace");var i,a=nb(r.base,t.havingBaseStyle(Gg.DISPLAY)),s=Lb(r,t);if(i=r.isOver?Ty({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):Ty({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Cy(["minner",r.isOver?"mover":"munder"],[i],t);i=r.isOver?Ty({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):Ty({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Cy(["minner",r.isOver?"mover":"munder"],[i],t)};Vy({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:Ww,mathmlBuilder:(e,t)=>{var n=Mb(e.label);return new ab(e.isOver?"mover":"munder",[yb(e.base,t),n])}}),Vy({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[1],o=Rb(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:Wy(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Ky(e.body,t,!1);return function(e,t,n,r){var o=new pv(e,[],n,r);return ky(o),o}(e.href,0,n,t)},mathmlBuilder:(e,t)=>{var n=vb(e.body,t);return n instanceof ab||(n=new ab("mrow",[n])),n.setAttribute("href",e.href),n}}),Vy({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=Rb(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var o=[],i=0;i<r.length;i++){var a=r[i];"~"===a&&(a="\\textasciitilde"),o.push({type:"textord",mode:"text",text:a})}var s={type:"text",mode:n.mode,font:"\\texttt",body:o};return{type:"href",mode:n.mode,href:r,body:Wy(s)}}}),Vy({type:"hbox",names:["\\hbox"],numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0,handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Wy(t[0])}},htmlBuilder(e,t){var n=Ky(e.body,t.withFont(""),!1);return Ay(n)},mathmlBuilder:(e,t)=>new ab("mrow",gb(e.body,t.withFont("")))}),Vy({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],numArgs:2,argTypes:["raw","original"],allowedInText:!0,handler:(e,t)=>{var n,{parser:r,funcName:o,token:i}=e,a=Rb(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(o){case"\\htmlClass":l.class=a,n={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,n={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,n={command:"\\htmlStyle",style:a};break;case"\\htmlData":for(var c=a.split(","),d=0;d<c.length;d++){var u=c[d],h=u.indexOf("=");if(h<0)throw new Mg("\\htmlData key/value '"+u+"' missing equals sign");var p=u.slice(0,h),m=u.slice(h+1);l["data-"+p.trim()]=m}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:Wy(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=Ky(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=Cy(r,n,t);for(var i in e.attributes)"class"!==i&&e.attributes.hasOwnProperty(i)&&o.setAttribute(i,e.attributes[i]);return o},mathmlBuilder:(e,t)=>vb(e.body,t)}),Vy({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Wy(t[0]),mathml:Wy(t[1])}},htmlBuilder:(e,t)=>{var n=Ky(e.html,t,!1);return Ay(n)},mathmlBuilder:(e,t)=>vb(e.mathml,t)});var Uw=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Mg("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!rv(n))throw new Mg("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Vy({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(e,t,n)=>{var{parser:r}=e,o={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},s="";if(n[0])for(var l=Rb(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":s=u;break;case"width":o=Uw(u);break;case"height":i=Uw(u);break;case"totalheight":a=Uw(u);break;default:throw new Mg("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=Rb(t[0],"url").url;return""===s&&(s=(s=(s=h).replace(/^.*[\\/]/,"")).substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:s,width:o,height:i,totalheight:a,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=ov(e.height,t),r=0;e.totalheight.number>0&&(r=ov(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=ov(e.width,t));var i={height:iv(n+r)};o>0&&(i.width=iv(o)),r>0&&(i.verticalAlign=iv(-r));var a=new mv(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{var n=new ab("mglyph",[]);n.setAttribute("alt",e.alt);var r=ov(e.height,t),o=0;if(e.totalheight.number>0&&(o=ov(e.totalheight,t)-r,n.setAttribute("valign",iv(-o))),n.setAttribute("height",iv(r+o)),e.width.number>0){var i=ov(e.width,t);n.setAttribute("width",iv(i))}return n.setAttribute("src",e.src),n}}),Vy({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,o=Rb(t[0],"size");if(n.settings.strict){var i="m"===r[1],a="mu"===o.value.unit;i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+o.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:o.value}},htmlBuilder:(e,t)=>Ey(e.dimension,t),mathmlBuilder(e,t){var n=ov(e.dimension,t);return new lb(n)}}),Vy({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:o}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=Cy([],[nb(e.body,t)]),n=Cy(["inner"],[n],t)):n=Cy(["inner"],[nb(e.body,t)]);var r=Cy(["fix"],[]),o=Cy([e.alignment],[n,r],t),i=Cy(["strut"]);return i.style.height=iv(o.height+o.depth),o.depth&&(i.style.verticalAlign=iv(-o.depth)),o.children.unshift(i),o=Cy(["thinbox"],[o],t),Cy(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new ab("mpadded",[yb(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),Vy({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var{funcName:n,parser:r}=e,o=r.mode;r.switchMode("math");var i="\\("===n?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}}),Vy({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new Mg("Mismatched "+e.funcName)}});var Gw=(e,t)=>{switch(t.style.size){case Gg.DISPLAY.size:return e.display;case Gg.TEXT.size:return e.text;case Gg.SCRIPT.size:return e.script;case Gg.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Vy({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Wy(t[0]),text:Wy(t[1]),script:Wy(t[2]),scriptscript:Wy(t[3])}},htmlBuilder:(e,t)=>{var n=Gw(e,t),r=Ky(n,t,!1);return Ay(r)},mathmlBuilder:(e,t)=>{var n=Gw(e,t);return vb(n,t)}});var Zw=(e,t,n,r,o,i,a)=>{e=Cy([],[e]);var s,l,c,d=n&&Bg(n);if(t){var u=nb(t,r.havingStyle(o.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var h=nb(n,r.havingStyle(o.sub()),r);s={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+a;c=Ty({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:iv(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:iv(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(s){var m=e.height-a;c=Ty({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:iv(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]})}else{if(!l)return e;var f=e.depth+a;c=Ty({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:iv(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}var g=[c];if(s&&0!==i&&!d){var v=Cy(["mspace"],[],r);v.style.marginRight=iv(i),g.unshift(v)}return Cy(["mop","op-limits"],g,r)},Xw=new Set(["\\smallint"]),Kw=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=Rb(e.base,"op"),i=!0):o=Rb(e,"op");var a,s,l=t.style,c=!1;if(l.size===Gg.DISPLAY.size&&o.symbol&&!Xw.has(o.name)&&(c=!0),o.symbol){var d=c?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(u=o.name.slice(1),o.name="oiint"===u?"\\iint":"\\iiint"),s=(a=vy(o.name,d,"math",t,["mop","op-symbol",c?"large-op":"small-op"])).italic,u.length>0){var h=Ry(u+"Size"+(c?"2":"1"),t);a=Ty({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:h,shift:c?.08:0}]}),o.name="\\"+u,a.classes.unshift("mop"),a.italic=s}}else if(o.body){var p=Ky(o.body,t,!0);1===p.length&&p[0]instanceof gv?(a=p[0]).classes[0]="mop":a=Cy(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(yy(o.name[f],o.mode,t));a=Cy(["mop"],m,t)}var g,v=0,y=0;return(a instanceof gv||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(v=(a.height-a.depth)/2-t.fontMetrics().axisHeight,y=null!=(g=a.italic)?g:0),i?Zw(a,n,r,t,l,y,v):(v&&(a.style.position="relative",a.style.top=iv(v)),a)},Yw={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Vy({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=r;return 1===o.length&&(o=Yw[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Kw,mathmlBuilder:(e,t)=>{var n;if(e.symbol)n=new ab("mo",[ub(e.name,e.mode)]),Xw.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new ab("mo",gb(e.body,t));else{n=new ab("mi",[new sb(e.name.slice(1))]);var r=new ab("mo",[ub("","text")]);n=e.parentIsSupSub?new ab("mrow",[n,r]):ib([n,r])}return n}}),Vy({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Wy(r)}}});var Jw={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Vy({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),Vy({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),Vy({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=Jw[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}}});var Qw=(e,t)=>{var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=Rb(e.base,"operatorname"),a=!0):o=Rb(e,"operatorname"),o.body.length>0){for(var s=(o.body.map(e=>{var t="text"in e?e.text:void 0;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=Ky(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof gv&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=Cy(["mop"],l,t)}else i=Cy(["mop"],[],t);return a?Zw(i,n,r,t,t.style,0,0):i};function ex(e,t,n){for(var r=Ky(e,t,!1),o=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var a=r[i].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[a+1]==="reset-size"+t.size&&(r[i].classes[a+1]="reset-size"+n.size),r[i].height*=o,r[i].depth*=o}return Ay(r)}Vy({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"operatorname",mode:n.mode,body:Wy(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:Qw,mathmlBuilder:(e,t)=>{for(var n=gb(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof lb);else if(i instanceof ab)switch(i.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof sb?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var s=n.map(e=>e.toText()).join("");n=[new sb(s)]}var l=new ab("mi",n);l.setAttribute("mathvariant","normal");var c=new ab("mo",[ub("","text")]);return e.parentIsSupSub?new ab("mrow",[l,c]):ib([l,c])}}),Mw("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Fy({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Ay(Ky(e.body,t,!1)):Cy(["mord"],Ky(e.body,t,!0),t),mathmlBuilder:(e,t)=>vb(e.body,t,!0)}),Vy({type:"overline",names:["\\overline"],numArgs:1,handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=nb(e.body,t.havingCrampedStyle()),r=Sy("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Ty({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]});return Cy(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new ab("mo",[new sb("‾")]);n.setAttribute("stretchy","true");var r=new ab("mover",[yb(e.body,t),n]);return r.setAttribute("accent","true"),r}}),Vy({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Wy(r)}},htmlBuilder:(e,t)=>{var n=Ky(e.body,t.withPhantom(),!1);return Ay(n)},mathmlBuilder:(e,t)=>{var n=gb(e.body,t);return new ab("mphantom",n)}}),Mw("\\hphantom","\\smash{\\phantom{#1}}"),Vy({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Cy(["inner"],[nb(e.body,t.withPhantom())]),r=Cy(["fix"],[]);return Cy(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=gb(Wy(e.body),t),r=new ab("mphantom",n),o=new ab("mpadded",[r]);return o.setAttribute("width","0px"),o}}),Vy({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e,r=Rb(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=nb(e.body,t),r=ov(e.dy,t);return Ty({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new ab("mpadded",[yb(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),Vy({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Vy({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(e,t,n){var{parser:r}=e,o=n[0],i=Rb(t[0],"size"),a=Rb(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&Rb(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=Cy(["mord","rule"],[],t),r=ov(e.width,t),o=ov(e.height,t),i=e.shift?ov(e.shift,t):0;return n.style.borderRightWidth=iv(r),n.style.borderTopWidth=iv(o),n.style.bottom=iv(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=ov(e.width,t),r=ov(e.height,t),o=e.shift?ov(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new ab("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",iv(n)),a.setAttribute("height",iv(r));var s=new ab("mpadded",[a]);return o>=0?s.setAttribute("height",iv(o)):(s.setAttribute("height",iv(o)),s.setAttribute("depth",iv(-o))),s.setAttribute("voffset",iv(o)),s}});var tx=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Vy({type:"sizing",names:tx,numArgs:0,allowedInText:!0,handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!1,n);return{type:"sizing",mode:o.mode,size:tx.indexOf(r)+1,body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return ex(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=gb(e.body,n),o=new ab("mstyle",r);return o.setAttribute("mathsize",iv(n.sizeMultiplier)),o}}),Vy({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&Rb(n[0],"ordgroup");if(a)for(var s,l=0;l<a.body.length;++l)if("t"===(s=Pb(a.body[l]).text))o=!0;else{if("b"!==s){o=!1,i=!1;break}i=!0}else o=!0,i=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:o,smashDepth:i}},htmlBuilder:(e,t)=>{var n=Cy([],[nb(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Cy(["mord","smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);var o=Ty({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return Cy(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var n=new ab("mpadded",[yb(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Vy({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r}=e,o=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:o}},htmlBuilder(e,t){var n=nb(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=My(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<Gg.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=function(e,t){var n,r,o,i,a,s=t.havingBaseSizing(),l=gw("\\surd",e*s.sizeMultiplier,mw,s),c=s.sizeMultiplier,d=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness);return"small"===l.type?(e<1?c=1:e<1.4&&(c=.7),o=(1+d)/c,(n=aw("sqrtMain",r=(1+d+iw)/c,i=1e3+1e3*d+80,d,t)).style.minWidth="0.853em",a=.833/c):"large"===l.type?(i=1080*dw[l.size],o=(dw[l.size]+d)/c,r=(dw[l.size]+d+iw)/c,(n=aw("sqrtSize"+l.size,r,i,d,t)).style.minWidth="1.02em",a=1/c):(r=e+d+iw,o=e+d,i=Math.floor(1e3*e+d)+80,(n=aw("sqrtTall",r,i,d,t)).style.minWidth="0.742em",a=1.056),n.height=o,n.style.height=iv(r),{span:n,advanceWidth:a,ruleWidth:(t.fontMetrics().sqrtRuleThickness+d)*c}}(a,t),d=s.height-l;d>n.height+n.depth+i&&(i=(i+d-n.height-n.depth)/2);var u=s.height-n.height-i-l;n.style.paddingLeft=iv(c);var h=Ty({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:s},{type:"kern",size:l}]});if(e.index){var p=t.havingStyle(Gg.SCRIPTSCRIPT),m=nb(e.index,p,t),f=.6*(h.height-h.depth),g=Ty({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]}),v=Cy(["root"],[g]);return Cy(["mord","sqrt"],[v,h],t)}return Cy(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new ab("mroot",[yb(n,t),yb(r,t)]):new ab("msqrt",[yb(n,t)])}});var nx={display:Gg.DISPLAY,text:Gg.TEXT,script:Gg.SCRIPT,scriptscript:Gg.SCRIPTSCRIPT};Vy({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!0,n),a=r.slice(1,r.length-5);if(!function(e){return e in nx}(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:o.mode,style:a,body:i}},htmlBuilder(e,t){var n=nx[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),ex(e.body,r,t)},mathmlBuilder(e,t){var n=nx[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var o=gb(e.body,r),i=new ab("mstyle",o),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",a[0]),i.setAttribute("displaystyle",a[1]),i}}),Fy({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Gg.DISPLAY.size||n.alwaysHandleSupSub)?Kw:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Gg.DISPLAY.size||n.limits)?Qw:null:"accent"===n.type?Bg(n.base)?Db:null:"horizBrace"===n.type&&!e.sub===n.isOver?Ww:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=nb(a,t),d=t.fontMetrics(),u=0,h=0,p=a&&Bg(a);if(s){var m=t.havingStyle(t.style.sup());r=nb(s,m,t),p||(u=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=nb(l,f,t),p||(h=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===Gg.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var g,v=t.sizeMultiplier,y=iv(.5/d.ptPerEm/v),b=null;if(o){var w,x=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof gv||x)&&(b=iv(-(null!=(w=c.italic)?w:0)))}if(r&&o){u=Math.max(u,i,r.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var k=4*d.defaultRuleThickness;if(u-r.depth-(o.height-h)<k){h=k-(u-r.depth)+o.height;var C=.8*d.xHeight-(u-r.depth);C>0&&(u+=C,h-=C)}g=Ty({positionType:"individualShift",children:[{type:"elem",elem:o,shift:h,marginRight:y,marginLeft:b},{type:"elem",elem:r,shift:-u,marginRight:y}]})}else if(o)h=Math.max(h,d.sub1,o.height-.8*d.xHeight),g=Ty({positionType:"shift",positionData:h,children:[{type:"elem",elem:o,marginLeft:b,marginRight:y}]});else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,i,r.depth+.25*d.xHeight),g=Ty({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:y}]})}var _=eb(c,"right")||"mord";return Cy([_],[c,Cy(["msupsub"],[g])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,i=[yb(e.base,t)];if(e.sub&&i.push(yb(e.sub,t)),e.sup&&i.push(yb(e.sup,t)),r)o=n?"mover":"munder";else if(e.sub)if(e.sup){var a=e.base;o=a&&"op"===a.type&&a.limits&&t.style===Gg.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===Gg.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===Gg.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===Gg.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===Gg.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Gg.DISPLAY)?"mover":"msup"}return new ab(o,i)}}),Fy({type:"atom",htmlBuilder:(e,t)=>yy(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new ab("mo",[ub(e.text,e.mode)]);if("bin"===e.family){var r=mb(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var rx={mi:"italic",mn:"normal",mtext:"normal"};Fy({type:"mathord",htmlBuilder:(e,t)=>by(e,t),mathmlBuilder(e,t){var n=new ab("mi",[ub(e.text,e.mode,t)]),r=mb(e,t)||"italic";return r!==rx[n.type]&&n.setAttribute("mathvariant",r),n}}),Fy({type:"textord",htmlBuilder:(e,t)=>by(e,t),mathmlBuilder(e,t){var n,r=ub(e.text,e.mode,t),o=mb(e,t)||"normal";return n="text"===e.mode?new ab("mtext",[r]):/[0-9]/.test(e.text)?new ab("mn",[r]):"\\prime"===e.text?new ab("mo",[r]):new ab("mi",[r]),o!==rx[n.type]&&n.setAttribute("mathvariant",o),n}});var ox={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},ix={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Fy({type:"spacing",htmlBuilder(e,t){if(ix.hasOwnProperty(e.text)){var n=ix[e.text].className||"";if("text"===e.mode){var r=by(e,t);return r.classes.push(n),r}return Cy(["mspace",n],[yy(e.text,e.mode,t)],t)}if(ox.hasOwnProperty(e.text))return Cy(["mspace",ox[e.text]],[],t);throw new Mg('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!ix.hasOwnProperty(e.text)){if(ox.hasOwnProperty(e.text))return new ab("mspace");throw new Mg('Unknown type of space "'+e.text+'"')}return new ab("mtext",[new sb(" ")])}});var ax=()=>{var e=new ab("mtd",[]);return e.setAttribute("width","50%"),e};Fy({type:"tag",mathmlBuilder(e,t){var n=new ab("mtable",[new ab("mtr",[ax(),new ab("mtd",[vb(e.body,t)]),ax(),new ab("mtd",[vb(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var sx={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},lx={"\\textbf":"textbf","\\textmd":"textmd"},cx={"\\textit":"textit","\\textup":"textup"},dx=(e,t)=>{var n=e.font;return n?sx[n]?t.withTextFontFamily(sx[n]):lx[n]?t.withTextFontWeight(lx[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(cx[n]):t};Vy({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"text",mode:n.mode,body:Wy(o),font:r}},htmlBuilder(e,t){var n=dx(e,t),r=Ky(e.body,n,!0);return Cy(["mord","text"],r,n)},mathmlBuilder(e,t){var n=dx(e,t);return vb(e.body,n)}}),Vy({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=nb(e.body,t),r=Sy("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Ty({positionType:"top",positionData:n.height,children:[{type:"kern",size:o},{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n}]});return Cy(["mord","underline"],[i],t)},mathmlBuilder(e,t){var n=new ab("mo",[new sb("‾")]);n.setAttribute("stretchy","true");var r=new ab("munder",[yb(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),Vy({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=nb(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return Ty({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new ab("mpadded",[yb(e.body,t)],["vcenter"]);return new ab("mrow",[n])}}),Vy({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(e,t,n){throw new Mg("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=ux(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(vy(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}return Cy(["mord","text"].concat(o.sizingClasses(t)),xy(r),o)},mathmlBuilder(e,t){var n=new sb(ux(e)),r=new ab("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var ux=e=>e.body.replace(/ /g,e.star?"␣":" "),hx=Hy,px="[ \r\n\t]",mx="(\\\\[a-zA-Z@]+)"+px+"*",fx="[̀-ͯ]",gx=new RegExp(fx+"+$"),vx="("+px+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+fx+"*|[\ud800-\udbff][\udc00-\udfff]"+fx+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+mx+"|\\\\[^\ud800-\udfff])";class yx{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(vx,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Ew("EOF",new Tw(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new Mg("Unexpected character: '"+e[t]+"'",new Ew(e[t],new Tw(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var o=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new Ew(r,new Tw(this,t,this.tokenRegex.lastIndex))}}class bx{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new Mg("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(e)&&(o[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var wx=Aw;Mw("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Mw("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Mw("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Mw("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Mw("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Mw("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Mw("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var xx={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Mw("\\char",function(e){var t,n=e.popToken(),r=0;if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new Mg("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=xx[n.text])||r>=t)throw new Mg("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=xx[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"});var kx=(e,t,n,r)=>{var o=e.consumeArg().tokens;if(1!==o.length)throw new Mg("\\newcommand's first argument must be a macro name");var i=o[0].text,a=e.isDefined(i);if(a&&!t)throw new Mg("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!a&&!n)throw new Mg("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(1===(o=e.consumeArg().tokens).length&&"["===o[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Mg("Invalid number of arguments: "+l);s=parseInt(l),o=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:o,numArgs:s}),""};Mw("\\newcommand",e=>kx(e,!1,!0,!1)),Mw("\\renewcommand",e=>kx(e,!0,!1,!1)),Mw("\\providecommand",e=>kx(e,!0,!0,!0)),Mw("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Mw("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Mw("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),hx[n],Sv.math[n],Sv.text[n]),""}),Mw("\\bgroup","{"),Mw("\\egroup","}"),Mw("~","\\nobreakspace"),Mw("\\lq","`"),Mw("\\rq","'"),Mw("\\aa","\\r a"),Mw("\\AA","\\r A"),Mw("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Mw("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Mw("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Mw("ℬ","\\mathscr{B}"),Mw("ℰ","\\mathscr{E}"),Mw("ℱ","\\mathscr{F}"),Mw("ℋ","\\mathscr{H}"),Mw("ℐ","\\mathscr{I}"),Mw("ℒ","\\mathscr{L}"),Mw("ℳ","\\mathscr{M}"),Mw("ℛ","\\mathscr{R}"),Mw("ℭ","\\mathfrak{C}"),Mw("ℌ","\\mathfrak{H}"),Mw("ℨ","\\mathfrak{Z}"),Mw("\\Bbbk","\\Bbb{k}"),Mw("\\llap","\\mathllap{\\textrm{#1}}"),Mw("\\rlap","\\mathrlap{\\textrm{#1}}"),Mw("\\clap","\\mathclap{\\textrm{#1}}"),Mw("\\mathstrut","\\vphantom{(}"),Mw("\\underbar","\\underline{\\text{#1}}"),Mw("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),Mw("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Mw("\\ne","\\neq"),Mw("≠","\\neq"),Mw("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Mw("∉","\\notin"),Mw("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Mw("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Mw("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Mw("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Mw("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Mw("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Mw("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Mw("⟂","\\perp"),Mw("‼","\\mathclose{!\\mkern-0.8mu!}"),Mw("∌","\\notni"),Mw("⌜","\\ulcorner"),Mw("⌝","\\urcorner"),Mw("⌞","\\llcorner"),Mw("⌟","\\lrcorner"),Mw("©","\\copyright"),Mw("®","\\textregistered"),Mw("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Mw("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Mw("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Mw("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Mw("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Mw("⋮","\\vdots"),Mw("\\varGamma","\\mathit{\\Gamma}"),Mw("\\varDelta","\\mathit{\\Delta}"),Mw("\\varTheta","\\mathit{\\Theta}"),Mw("\\varLambda","\\mathit{\\Lambda}"),Mw("\\varXi","\\mathit{\\Xi}"),Mw("\\varPi","\\mathit{\\Pi}"),Mw("\\varSigma","\\mathit{\\Sigma}"),Mw("\\varUpsilon","\\mathit{\\Upsilon}"),Mw("\\varPhi","\\mathit{\\Phi}"),Mw("\\varPsi","\\mathit{\\Psi}"),Mw("\\varOmega","\\mathit{\\Omega}"),Mw("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Mw("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Mw("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Mw("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Mw("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Mw("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Mw("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Mw("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Cx={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},_x=new Set(["bin","rel"]);Mw("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Cx?t=Cx[n]:("\\not"===n.slice(0,4)||n in Sv.math&&_x.has(Sv.math[n].group))&&(t="\\dotsb"),t});var Sx={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Mw("\\dotso",function(e){return e.future().text in Sx?"\\ldots\\,":"\\ldots"}),Mw("\\dotsc",function(e){var t=e.future().text;return t in Sx&&","!==t?"\\ldots\\,":"\\ldots"}),Mw("\\cdots",function(e){return e.future().text in Sx?"\\@cdots\\,":"\\@cdots"}),Mw("\\dotsb","\\cdots"),Mw("\\dotsm","\\cdots"),Mw("\\dotsi","\\!\\cdots"),Mw("\\dotsx","\\ldots\\,"),Mw("\\DOTSI","\\relax"),Mw("\\DOTSB","\\relax"),Mw("\\DOTSX","\\relax"),Mw("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Mw("\\,","\\tmspace+{3mu}{.1667em}"),Mw("\\thinspace","\\,"),Mw("\\>","\\mskip{4mu}"),Mw("\\:","\\tmspace+{4mu}{.2222em}"),Mw("\\medspace","\\:"),Mw("\\;","\\tmspace+{5mu}{.2777em}"),Mw("\\thickspace","\\;"),Mw("\\!","\\tmspace-{3mu}{.1667em}"),Mw("\\negthinspace","\\!"),Mw("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Mw("\\negthickspace","\\tmspace-{5mu}{.277em}"),Mw("\\enspace","\\kern.5em "),Mw("\\enskip","\\hskip.5em\\relax"),Mw("\\quad","\\hskip1em\\relax"),Mw("\\qquad","\\hskip2em\\relax"),Mw("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Mw("\\tag@paren","\\tag@literal{({#1})}"),Mw("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Mg("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Mw("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Mw("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Mw("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Mw("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Mw("\\newline","\\\\\\relax"),Mw("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Ax=iv(wv["Main-Regular"]["T".charCodeAt(0)][1]-.7*wv["Main-Regular"]["A".charCodeAt(0)][1]);Mw("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Ax+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Mw("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Ax+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Mw("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Mw("\\@hspace","\\hskip #1\\relax"),Mw("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Mw("\\ordinarycolon",":"),Mw("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Mw("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Mw("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Mw("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Mw("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Mw("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Mw("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Mw("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Mw("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Mw("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Mw("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Mw("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Mw("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Mw("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Mw("∷","\\dblcolon"),Mw("∹","\\eqcolon"),Mw("≔","\\coloneqq"),Mw("≕","\\eqqcolon"),Mw("⩴","\\Coloneqq"),Mw("\\ratio","\\vcentcolon"),Mw("\\coloncolon","\\dblcolon"),Mw("\\colonequals","\\coloneqq"),Mw("\\coloncolonequals","\\Coloneqq"),Mw("\\equalscolon","\\eqqcolon"),Mw("\\equalscoloncolon","\\Eqqcolon"),Mw("\\colonminus","\\coloneq"),Mw("\\coloncolonminus","\\Coloneq"),Mw("\\minuscolon","\\eqcolon"),Mw("\\minuscoloncolon","\\Eqcolon"),Mw("\\coloncolonapprox","\\Colonapprox"),Mw("\\coloncolonsim","\\Colonsim"),Mw("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Mw("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Mw("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Mw("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Mw("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Mw("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Mw("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Mw("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Mw("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Mw("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Mw("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Mw("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Mw("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Mw("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Mw("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Mw("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Mw("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Mw("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Mw("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Mw("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Mw("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Mw("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Mw("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Mw("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Mw("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Mw("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Mw("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Mw("\\imath","\\html@mathml{\\@imath}{ı}"),Mw("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Mw("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Mw("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Mw("⟦","\\llbracket"),Mw("⟧","\\rrbracket"),Mw("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Mw("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Mw("⦃","\\lBrace"),Mw("⦄","\\rBrace"),Mw("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Mw("⦵","\\minuso"),Mw("\\darr","\\downarrow"),Mw("\\dArr","\\Downarrow"),Mw("\\Darr","\\Downarrow"),Mw("\\lang","\\langle"),Mw("\\rang","\\rangle"),Mw("\\uarr","\\uparrow"),Mw("\\uArr","\\Uparrow"),Mw("\\Uarr","\\Uparrow"),Mw("\\N","\\mathbb{N}"),Mw("\\R","\\mathbb{R}"),Mw("\\Z","\\mathbb{Z}"),Mw("\\alef","\\aleph"),Mw("\\alefsym","\\aleph"),Mw("\\Alpha","\\mathrm{A}"),Mw("\\Beta","\\mathrm{B}"),Mw("\\bull","\\bullet"),Mw("\\Chi","\\mathrm{X}"),Mw("\\clubs","\\clubsuit"),Mw("\\cnums","\\mathbb{C}"),Mw("\\Complex","\\mathbb{C}"),Mw("\\Dagger","\\ddagger"),Mw("\\diamonds","\\diamondsuit"),Mw("\\empty","\\emptyset"),Mw("\\Epsilon","\\mathrm{E}"),Mw("\\Eta","\\mathrm{H}"),Mw("\\exist","\\exists"),Mw("\\harr","\\leftrightarrow"),Mw("\\hArr","\\Leftrightarrow"),Mw("\\Harr","\\Leftrightarrow"),Mw("\\hearts","\\heartsuit"),Mw("\\image","\\Im"),Mw("\\infin","\\infty"),Mw("\\Iota","\\mathrm{I}"),Mw("\\isin","\\in"),Mw("\\Kappa","\\mathrm{K}"),Mw("\\larr","\\leftarrow"),Mw("\\lArr","\\Leftarrow"),Mw("\\Larr","\\Leftarrow"),Mw("\\lrarr","\\leftrightarrow"),Mw("\\lrArr","\\Leftrightarrow"),Mw("\\Lrarr","\\Leftrightarrow"),Mw("\\Mu","\\mathrm{M}"),Mw("\\natnums","\\mathbb{N}"),Mw("\\Nu","\\mathrm{N}"),Mw("\\Omicron","\\mathrm{O}"),Mw("\\plusmn","\\pm"),Mw("\\rarr","\\rightarrow"),Mw("\\rArr","\\Rightarrow"),Mw("\\Rarr","\\Rightarrow"),Mw("\\real","\\Re"),Mw("\\reals","\\mathbb{R}"),Mw("\\Reals","\\mathbb{R}"),Mw("\\Rho","\\mathrm{P}"),Mw("\\sdot","\\cdot"),Mw("\\sect","\\S"),Mw("\\spades","\\spadesuit"),Mw("\\sub","\\subset"),Mw("\\sube","\\subseteq"),Mw("\\supe","\\supseteq"),Mw("\\Tau","\\mathrm{T}"),Mw("\\thetasym","\\vartheta"),Mw("\\weierp","\\wp"),Mw("\\Zeta","\\mathrm{Z}"),Mw("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Mw("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Mw("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Mw("\\bra","\\mathinner{\\langle{#1}|}"),Mw("\\ket","\\mathinner{|{#1}\\rangle}"),Mw("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Mw("\\Bra","\\left\\langle#1\\right|"),Mw("\\Ket","\\left|#1\\right\\rangle");var Mx=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,o=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",a),o.length&&n.macros.set("\\|",s));var i=t;return!t&&o.length&&"|"===n.future().text&&(n.popToken(),i=!0),{tokens:i?o:r,numArgs:0}};t.macros.set("|",l(!1)),o.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...i,...c,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};Mw("\\bra@ket",Mx(!1)),Mw("\\bra@set",Mx(!0)),Mw("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Mw("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Mw("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Mw("\\angln","{\\angl n}"),Mw("\\blue","\\textcolor{##6495ed}{#1}"),Mw("\\orange","\\textcolor{##ffa500}{#1}"),Mw("\\pink","\\textcolor{##ff00af}{#1}"),Mw("\\red","\\textcolor{##df0030}{#1}"),Mw("\\green","\\textcolor{##28ae7b}{#1}"),Mw("\\gray","\\textcolor{gray}{#1}"),Mw("\\purple","\\textcolor{##9d38bd}{#1}"),Mw("\\blueA","\\textcolor{##ccfaff}{#1}"),Mw("\\blueB","\\textcolor{##80f6ff}{#1}"),Mw("\\blueC","\\textcolor{##63d9ea}{#1}"),Mw("\\blueD","\\textcolor{##11accd}{#1}"),Mw("\\blueE","\\textcolor{##0c7f99}{#1}"),Mw("\\tealA","\\textcolor{##94fff5}{#1}"),Mw("\\tealB","\\textcolor{##26edd5}{#1}"),Mw("\\tealC","\\textcolor{##01d1c1}{#1}"),Mw("\\tealD","\\textcolor{##01a995}{#1}"),Mw("\\tealE","\\textcolor{##208170}{#1}"),Mw("\\greenA","\\textcolor{##b6ffb0}{#1}"),Mw("\\greenB","\\textcolor{##8af281}{#1}"),Mw("\\greenC","\\textcolor{##74cf70}{#1}"),Mw("\\greenD","\\textcolor{##1fab54}{#1}"),Mw("\\greenE","\\textcolor{##0d923f}{#1}"),Mw("\\goldA","\\textcolor{##ffd0a9}{#1}"),Mw("\\goldB","\\textcolor{##ffbb71}{#1}"),Mw("\\goldC","\\textcolor{##ff9c39}{#1}"),Mw("\\goldD","\\textcolor{##e07d10}{#1}"),Mw("\\goldE","\\textcolor{##a75a05}{#1}"),Mw("\\redA","\\textcolor{##fca9a9}{#1}"),Mw("\\redB","\\textcolor{##ff8482}{#1}"),Mw("\\redC","\\textcolor{##f9685d}{#1}"),Mw("\\redD","\\textcolor{##e84d39}{#1}"),Mw("\\redE","\\textcolor{##bc2612}{#1}"),Mw("\\maroonA","\\textcolor{##ffbde0}{#1}"),Mw("\\maroonB","\\textcolor{##ff92c6}{#1}"),Mw("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Mw("\\maroonD","\\textcolor{##ca337c}{#1}"),Mw("\\maroonE","\\textcolor{##9e034e}{#1}"),Mw("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Mw("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Mw("\\purpleC","\\textcolor{##aa87ff}{#1}"),Mw("\\purpleD","\\textcolor{##7854ab}{#1}"),Mw("\\purpleE","\\textcolor{##543b78}{#1}"),Mw("\\mintA","\\textcolor{##f5f9e8}{#1}"),Mw("\\mintB","\\textcolor{##edf2df}{#1}"),Mw("\\mintC","\\textcolor{##e0e5cc}{#1}"),Mw("\\grayA","\\textcolor{##f6f7f7}{#1}"),Mw("\\grayB","\\textcolor{##f0f1f2}{#1}"),Mw("\\grayC","\\textcolor{##e3e5e6}{#1}"),Mw("\\grayD","\\textcolor{##d6d8da}{#1}"),Mw("\\grayE","\\textcolor{##babec2}{#1}"),Mw("\\grayF","\\textcolor{##888d93}{#1}"),Mw("\\grayG","\\textcolor{##626569}{#1}"),Mw("\\grayH","\\textcolor{##3b3e40}{#1}"),Mw("\\grayI","\\textcolor{##21242c}{#1}"),Mw("\\kaBlue","\\textcolor{##314453}{#1}"),Mw("\\kaGreen","\\textcolor{##71B307}{#1}");var Tx={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Ex{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new bx(wx,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new yx(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new Ew("EOF",n.loc)),this.pushTokens(r),new Ew("",Tw.range(t,n))}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,o=this.future(),i=0,a=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++i;else if("}"===r.text){if(-1===--i)throw new Mg("Extra }",r)}else if("EOF"===r.text)throw new Mg("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",r);if(e&&n)if((0===i||1===i&&"{"===e[a])&&r.text===e[a]){if(++a===e.length){t.splice(-a,a);break}}else a=0}while(0!==i||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Mg("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var o=this.popToken();if(n[r]!==o.text)throw new Mg("Use of the macro doesn't match its definition",o)}}for(var i=[],a=0;a<e;a++)i.push(this.consumeArg(t&&t[a+1]).tokens);return i}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new Mg("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new Mg("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var o=r.tokens,i=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var a=(o=o.slice()).length-1;a>=0;--a){var s=o[a];if("#"===s.text){if(0===a)throw new Mg("Incomplete placeholder at end of macro body",s);if("#"===(s=o[--a]).text)o.splice(a+1,1);else{if(!/^[1-9]$/.test(s.text))throw new Mg("Not a valid argument number",s);o.splice(a,2,...i[+s.text-1])}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Ew(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var o=0;if(r.includes("#"))for(var i=r.replace(/##/g,"");i.includes("#"+(o+1));)++o;for(var a=new yx(r,this.settings),s=[],l=a.lex();"EOF"!==l.text;)s.push(l),l=a.lex();return s.reverse(),{tokens:s,numArgs:o}}return r}isDefined(e){return this.macros.has(e)||hx.hasOwnProperty(e)||Sv.math.hasOwnProperty(e)||Sv.text.hasOwnProperty(e)||Tx.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:hx.hasOwnProperty(e)&&!hx[e].primitive}}var Lx=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Ox=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Ix={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Rx={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class Px{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Ex(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new Mg("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Ew("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(Px.endOfExpression.has(r.text))break;if(t&&r.text===t)break;if(e&&hx[r.text]&&hx[r.text].infix)break;var o=this.parseAtom(t);if(!o)break;"internal"!==o.type&&n.push(o)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++){var o=e[r];if("infix"===o.type){if(-1!==n)throw new Mg("only one infix operator per group",o.token);n=r,t=o.replaceWith}}if(-1!==n&&t){var i,a,s=e.slice(0,n),l=e.slice(n+1);return i=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},a=1===l.length&&"ordgroup"===l[0].type?l[0]:{type:"ordgroup",mode:this.mode,body:l},["\\\\abovefrac"===t?this.callFunction(t,[i,e[n],a],[]):this.callFunction(t,[i,a],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do{var o;t=this.parseGroup(e)}while("internal"===(null==(o=t)?void 0:o.type));if(!t)throw new Mg("Expected group after '"+r+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("internal"===(null==r?void 0:r.type))return r;if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type)r.limits="\\limits"===o.text,r.alwaysHandleSupSub=!0;else{if(!r||"operatorname"!==r.type)throw new Mg("Limit controls must follow a math operator",o);r.alwaysHandleSupSub&&(r.limits="\\limits"===o.text)}this.consume()}else if("^"===o.text){if(t)throw new Mg("Double superscript",o);t=this.handleSupSubscript("superscript")}else if("_"===o.text){if(n)throw new Mg("Double subscript",o);n=this.handleSupSubscript("subscript")}else if("'"===o.text){if(t)throw new Mg("Double superscript",o);var i={type:"textord",mode:this.mode,text:"\\prime"},a=[i];for(this.consume();"'"===this.fetch().text;)a.push(i),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!Ox[o.text])break;var s=Lx.test(o.text),l=[];for(l.push(new Ew(Ox[o.text])),this.consume();;){var c=this.fetch().text;if(!Ox[c])break;if(Lx.test(c)!==s)break;l.unshift(new Ew(Ox[c])),this.consume()}var d=this.subparse(l);s?n={type:"ordgroup",mode:"math",body:d}:t={type:"ordgroup",mode:"math",body:d}}}return t&&n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:t?{type:"supsub",mode:this.mode,base:r,sup:t}:n?{type:"supsub",mode:this.mode,base:r,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,o=hx[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new Mg("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!o.allowedInText)throw new Mg("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new Mg("Can't use function '"+r+"' in math mode",n);var{args:i,optArgs:a}=this.parseArguments(r,o);return this.callFunction(r,i,a,n,e)}callFunction(e,t,n,r,o){var i={funcName:e,parser:this,token:r,breakOnTokenText:o},a=hx[e];if(a&&a.handler)return a.handler(i,t,n);throw new Mg("No function handler for "+e)}parseArguments(e,t){var n,r=null!=(n=t.numOptionalArgs)?n:0,o=t.numArgs+r;if(0===o)return{args:[],optArgs:[]};for(var i=[],a=[],s=0;s<o;s++){var l,c=null==(l=t.argTypes)?void 0:l[s],d=s<r;("primitive"in t&&t.primitive&&null==c||"sqrt"===t.type&&1===s&&null==a[0])&&(c="primitive");var u=this.parseGroupOfType("argument to '"+e+"'",c,d);if(d)a.push(u);else{if(null==u)throw new Mg("Null argument, please report this as a bug");i.push(u)}}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text",resetFont:!0}:null;case"raw":var o=this.parseStringGroup(n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new Mg("A primitive argument cannot be optional");var i=this.parseGroup(e);if(null==i)throw new Mg("Expected group as "+e,this.fetch());return i;case"original":case void 0:return this.parseArgumentGroup(n);default:throw new Mg("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(null==t)return null;for(var n,r="";"EOF"!==(n=this.fetch()).text;)r+=n.text,this.consume();return this.consume(),t.text=r,t}parseRegexGroup(e,t){for(var n,r=this.fetch(),o=r,i="";"EOF"!==(n=this.fetch()).text&&e.test(i+n.text);)i+=(o=n).text,this.consume();if(""===i)throw new Mg("Invalid "+t+": '"+r.text+"'",r);return r.range(o,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(null==t)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new Mg("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup(e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new Mg("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!rv(o))throw new Mg("Invalid unit: '"+o.unit+"'",t);return{type:"size",mode:this.mode,value:o,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Tw.range(r,s),body:a,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!Tx.hasOwnProperty(o)){if(this.settings.throwOnError)throw new Mg("Undefined control sequence: "+o,r);n=this.formatUnsupportedCmd(o),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if("textord"===r.type){var o=r.text,i=e[n+1];if(i&&"textord"===i.type){if("-"===o&&"-"===i.text){var a=e[n+2];n+1<t&&a&&"textord"===a.type&&"-"===a.text?(e.splice(n,3,{type:"textord",mode:"text",loc:Tw.range(r,a),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Tw.range(r,i),text:"--"}),t-=1)}"'"!==o&&"`"!==o||i.text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:Tw.range(r,i),text:o+o}),t-=1)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Mg("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Rx.hasOwnProperty(t[0])&&!Sv[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Rx[t[0]]+t.slice(1));var o,i=gx.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),Sv[this.mode][t]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a=Sv[this.mode][t].group,s=Tw.range(e);o=function(e){return e in Ob}(a)?{type:"atom",mode:this.mode,family:a,loc:s,text:t}:{type:a,mode:this.mode,loc:s,text:t}}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Kg(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:Tw.range(e),text:t}}if(this.consume(),i)for(var l=0;l<i[0].length;l++){var c=i[0][l];if(!Ix[c])throw new Mg("Unknown accent ' "+c+"'",e);var d=Ix[c][this.mode]||Ix[c].text;if(!d)throw new Mg("Accent "+c+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Tw.range(e),label:d,isStretchy:!1,isShifty:!0,base:o}}return o}}Px.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Bx=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Px(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Mg("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new Ew("\\df@tag")])}]}return r},zx=function(e,t,n){t.textContent="";var r=Nx(e,n).toNode();t.appendChild(r)};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),zx=function(){throw new Mg("KaTeX doesn't work in quirks mode.")});var Dx=function(e,t,n){if(n.throwOnError||!(e instanceof Mg))throw e;var r=Cy(["katex-error"],[new gv(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},Nx=function(e,t){var n=new Ng(t);try{return function(e,t,n){var r,o=_b(n);if("mathml"===n.output)return bb(e,t,o,n.displayMode,!0);if("html"===n.output){var i=ob(e,o);r=Cy(["katex"],[i])}else{var a=bb(e,t,o,n.displayMode,!1),s=ob(e,o);r=Cy(["katex"],[a,s])}return Sb(r,n)}(Bx(e,n),e,n)}catch(r){return Dx(r,e,n)}},Hx={version:"0.17.0",render:zx,renderToString:function(e,t){return Nx(e,t).toMarkup()},ParseError:Mg,SETTINGS_SCHEMA:zg,__parse:function(e,t){var n=new Ng(t);return Bx(e,n)},__renderToDomTree:Nx,__renderToHTMLTree:function(e,t){var n=new Ng(t);try{return function(e,t,n){var r=ob(e,_b(n)),o=Cy(["katex"],[r]);return Sb(o,n)}(Bx(e,n),0,n)}catch(r){return Dx(r,e,n)}},__setFontMetrics:function(e,t){wv[e]=t},__defineSymbol:Av,__defineFunction:Vy,__defineMacro:Mw,__domTree:{Span:hv,Anchor:pv,SymbolNode:gv,SvgNode:vv,PathNode:yv,LineNode:bv}},qx=Object.defineProperty,jx=Object.getOwnPropertySymbols,Vx=Object.prototype.hasOwnProperty,Fx=Object.prototype.propertyIsEnumerable,$x=(e,t,n)=>t in e?qx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wx=(e,t)=>{for(var n in t||(t={}))Vx.call(t,n)&&$x(e,n,t[n]);if(jx)for(var n of jx(t))Fx.call(t,n)&&$x(e,n,t[n]);return e};function Ux(e,t){return Object.assign(e,{meta:Wx({package:"@milkdown/components"},t)}),e}var Gx=Object.defineProperty,Zx=Object.getOwnPropertySymbols,Xx=Object.prototype.hasOwnProperty,Kx=Object.prototype.propertyIsEnumerable,Yx=(e,t,n)=>t in e?Gx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jx=(e,t)=>{for(var n in t||(t={}))Xx.call(t,n)&&Yx(e,n,t[n]);if(Zx)for(var n of Zx(t))Kx.call(t,n)&&Yx(e,n,t[n]);return e};const Qx=a(Jx({},{mode:"preview"}),"linkTooltipStateCtx");Ux(Qx,{displayName:"State<link-tooltip>",group:"LinkTooltip"});const ek=a(Jx({},{addLink:()=>{},editLink:()=>{},removeLink:()=>{}}),"linkTooltipAPICtx");Ux(Qx,{displayName:"API<link-tooltip>",group:"LinkTooltip"});const tk=a(Jx({},{linkIcon:"🔗",editButton:"✎",removeButton:"⌫",confirmButton:"Confirm ⏎",onCopyLink:()=>{},inputPlaceholder:"Paste link..."}),"linkTooltipConfigCtx");Ux(Qx,{displayName:"Config<link-tooltip>",group:"LinkTooltip"});const nk=l("ToggleLink",e=>()=>t=>{const{doc:n,selection:r}=t,o=oe.type(e);return n.rangeHasMark(r.from,r.to,o)?(e.get(ek.key).removeLink(r.from,r.to),!0):(e.get(ek.key).addLink(r.from,r.to),!0)}),rk=ii("LINK_PREVIEW");Ux(rk[0],{displayName:"PreviewTooltipSpec<link-tooltip>",group:"LinkTooltip"}),Ux(rk[1],{displayName:"PreviewTooltipPlugin<link-tooltip>",group:"LinkTooltip"});const ok=ii("LINK_EDIT");function ik({icon:e,class:t,onClick:n}){return md("span",{class:On("milkdown-icon",t),onPointerdown:n,innerHTML:e?An.sanitize(e.trim()):void 0})}Ux(ok[0],{displayName:"EditTooltipSpec<link-tooltip>",group:"LinkTooltip"}),Ux(ok[1],{displayName:"EditTooltipPlugin<link-tooltip>",group:"LinkTooltip"}),ik.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const ak=fl({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({config:e,src:t,onConfirm:n,onCancel:r}){const o=vs(t);ll(t,e=>{o.value=e});const i=()=>{n(o.value)},a=e=>{e.stopPropagation(),"Enter"===e.key&&(e.preventDefault(),i()),"Escape"===e.key&&(e.preventDefault(),r())};return()=>md("div",{class:"link-edit"},md("input",{class:"input-area",placeholder:e.value.inputPlaceholder,onKeydown:a,onInput:e=>{o.value=e.target.value},value:o.value}),o.value?md(ik,{class:"button confirm",icon:e.value.confirmButton,onClick:i}):null)}});var sk,lk,ck,dk,uk,hk,pk,mk,fk,gk,vk,yk,bk=Object.defineProperty,wk=Object.defineProperties,xk=Object.getOwnPropertyDescriptors,kk=Object.getOwnPropertySymbols,Ck=Object.prototype.hasOwnProperty,_k=Object.prototype.propertyIsEnumerable,Sk=e=>{throw TypeError(e)},Ak=(e,t,n)=>t in e?bk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mk=(e,t)=>{for(var n in t||(t={}))Ck.call(t,n)&&Ak(e,n,t[n]);if(kk)for(var n of kk(t))_k.call(t,n)&&Ak(e,n,t[n]);return e},Tk=(e,t)=>wk(e,xk(t)),Ek=(e,t,n)=>t.has(e)||Sk("Cannot "+n),Lk=(e,t,n)=>(Ek(e,t,"read from private field"),n?n.call(e):t.get(e)),Ok=(e,t,n)=>t.has(e)?Sk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ik=(e,t,n,r)=>(Ek(e,t,"write to private field"),t.set(e,n),n);const Rk={from:-1,to:-1,mark:null};class Pk{constructor(e,t){this.ctx=e,Ok(this,sk),Ok(this,lk),Ok(this,ck,Mk({},Rk)),Ok(this,dk),Ok(this,uk),Ok(this,hk,vs("")),Ok(this,pk,()=>{Lk(this,gk).call(this),Lk(this,lk).hide(),this.ctx.update(Qx.key,e=>Tk(Mk({},e),{mode:"preview"})),Ik(this,ck,Mk({},Rk))}),Ok(this,mk,e=>{const t=e.target;t&&(Lk(this,sk).contains(t)||Lk(this,pk).call(this))}),Ok(this,fk,()=>{document.addEventListener("pointerdown",Lk(this,mk),!0)}),Ok(this,gk,()=>{document.removeEventListener("pointerdown",Lk(this,mk),!0)}),Ok(this,vk,e=>{const t=this.ctx.get(T),{from:n,to:r,mark:o}=Lk(this,ck),i=oe.type(this.ctx),a=ie(e);if(o&&o.attrs.href===a)return void Lk(this,pk).call(this);const s=t.state.tr;if(o&&s.removeMark(n,r,o),n===r){if(!a)return void Lk(this,pk).call(this);const e=i.create({href:a});s.insertText(a,n),s.addMark(n,n+a.length,e)}else s.addMark(n,r,i.create({href:a}));t.dispatch(s),Lk(this,pk).call(this)}),Ok(this,yk,(e,t,n)=>{const r=this.ctx.get(tk.key);Lk(this,uk).value=r,Lk(this,hk).value=e,this.ctx.update(Qx.key,e=>Tk(Mk({},e),{mode:"edit"}));const o=this.ctx.get(T);o.dispatch(o.state.tr.setSelection(S.create(o.state.doc,t,n))),Lk(this,lk).show({getBoundingClientRect:()=>_(o,t,n)},o),Lk(this,fk).call(this),requestAnimationFrame(()=>{var e;null==(e=Lk(this,sk).querySelector("input"))||e.focus()})}),this.update=e=>{const{state:t}=e,{selection:n}=t;if(!(n instanceof S))return;const{from:r,to:o}=n;r===Lk(this,ck).from&&o===Lk(this,ck).to||Lk(this,pk).call(this)},this.destroy=()=>{Lk(this,gk).call(this),Lk(this,dk).unmount(),Lk(this,lk).destroy(),Lk(this,sk).remove()},this.addLink=(e,t)=>{Ik(this,ck,{from:e,to:t,mark:null}),Lk(this,yk).call(this,"",e,t)},this.editLink=(e,t,n)=>{Ik(this,ck,{from:t,to:n,mark:e}),Lk(this,yk).call(this,e.attrs.href,t,n)},this.removeLink=(e,t)=>{const n=this.ctx.get(T),r=n.state.tr;r.removeMark(e,t,oe.type(this.ctx)),n.dispatch(r),Lk(this,pk).call(this)},Ik(this,uk,vs(this.ctx.get(tk.key)));const n=document.createElement("div");n.className="milkdown-link-edit";const r=jd(ak,{config:Lk(this,uk),src:Lk(this,hk),onConfirm:Lk(this,vk),onCancel:Lk(this,pk)});r.mount(n),Ik(this,dk,r),Ik(this,sk,n),Ik(this,lk,new oi({content:n,debounce:0,shouldShow:()=>!1})),Lk(this,lk).onHide=()=>{requestAnimationFrame(()=>{t.dom.focus({preventScroll:!0})})},Lk(this,lk).update(t)}}sk=new WeakMap,lk=new WeakMap,ck=new WeakMap,dk=new WeakMap,uk=new WeakMap,hk=new WeakMap,pk=new WeakMap,mk=new WeakMap,fk=new WeakMap,gk=new WeakMap,vk=new WeakMap,yk=new WeakMap;var Bk=Object.defineProperty,zk=Object.defineProperties,Dk=Object.getOwnPropertyDescriptors,Nk=Object.getOwnPropertySymbols,Hk=Object.prototype.hasOwnProperty,qk=Object.prototype.propertyIsEnumerable,jk=(e,t,n)=>t in e?Bk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const Vk=fl({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onEdit:{type:Object,required:!0},onRemove:{type:Object,required:!0}},setup({config:e,src:t,onEdit:n,onRemove:r}){const o=pd(()=>ie(t.value)),i=e=>{e.preventDefault(),e.stopPropagation(),n.value()},a=e=>{e.preventDefault(),e.stopPropagation(),r.value()},s=n=>{n.preventDefault();const r=t.value;navigator.clipboard&&r&&navigator.clipboard.writeText(r).then(()=>{e.value.onCopyLink(r)}).catch(e=>console.error(e))};return()=>md("div",{class:"link-preview"},md(ik,{class:"button link-icon",icon:e.value.linkIcon,onClick:s}),md("a",{href:o.value,target:"_blank",rel:"noopener noreferrer",class:"link-display"},t.value),md(ik,{class:"button link-edit-button",icon:e.value.editButton,onClick:i}),md(ik,{class:"button link-remove-button",icon:e.value.removeButton,onClick:a}))}});var Fk,$k,Wk,Uk,Gk,Zk,Xk,Kk,Yk,Jk,Qk,eC,tC,nC,rC=e=>{throw TypeError(e)},oC=(e,t,n)=>t.has(e)||rC("Cannot "+n),iC=(e,t,n)=>(oC(e,t,"read from private field"),n?n.call(e):t.get(e)),aC=(e,t,n)=>t.has(e)?rC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),sC=(e,t,n,r)=>(oC(e,t,"write to private field"),t.set(e,n),n);class lC{constructor(e,t){this.ctx=e,aC(this,Fk),aC(this,$k),aC(this,Wk),aC(this,Uk),aC(this,Gk,vs("")),aC(this,Zk,vs(()=>{})),aC(this,Xk,vs(()=>{})),aC(this,Kk),aC(this,Yk),aC(this,Jk,!1),aC(this,Qk,({mode:e})=>{"edit"===e&&iC(this,nC).call(this)}),aC(this,eC,()=>{sC(this,Jk,!0)}),aC(this,tC,()=>{sC(this,Jk,!1)}),aC(this,nC,()=>{iC(this,$k).hide(),iC(this,$k).element.removeEventListener("mouseenter",iC(this,eC)),iC(this,$k).element.removeEventListener("mouseleave",iC(this,tC))}),this.show=(e,t,n,r)=>{iC(this,Uk).value=this.ctx.get(tk.key),iC(this,Gk).value=e.attrs.href,iC(this,Zk).value=()=>{this.ctx.get(ek.key).editLink(e,t,n)},iC(this,Xk).value=()=>{this.ctx.get(ek.key).removeLink(t,n),iC(this,nC).call(this)},iC(this,$k).show({getBoundingClientRect:()=>r},iC(this,Yk)),iC(this,$k).element.addEventListener("mouseenter",iC(this,eC)),iC(this,$k).element.addEventListener("mouseleave",iC(this,tC))},this.hide=()=>{iC(this,Jk)||iC(this,nC).call(this)},this.update=()=>{},this.destroy=()=>{iC(this,Kk).unmount(),iC(this,Wk).off(iC(this,Qk)),iC(this,$k).destroy(),iC(this,Fk).remove()},sC(this,Yk,t),sC(this,Uk,vs(this.ctx.get(tk.key))),sC(this,Kk,jd(Vk,{config:iC(this,Uk),src:iC(this,Gk),onEdit:iC(this,Zk),onRemove:iC(this,Xk)})),sC(this,Fk,document.createElement("div")),iC(this,Fk).className="milkdown-link-preview",iC(this,Kk).mount(iC(this,Fk)),sC(this,$k,new oi({debounce:0,content:iC(this,Fk),shouldShow:()=>!1})),iC(this,$k).update(t),sC(this,Wk,e.use(Qx.key)),iC(this,Wk).on(iC(this,Qk))}}function cC(e){(function(e){let t;const n=pr((n,r)=>{if(!t)return;if(!n.hasFocus())return;if("edit"===e.get(Qx.key).mode)return;const o=function(e,t,n){const r=t.posAtCoords({left:n.clientX,top:n.clientY});if(!r)return;const{pos:o}=r,i=t.state.doc.nodeAt(o);if(!i)return;const a=i.marks.find(t=>t.type===oe.mark.type(e));return a&&rk.pluginKey()?{show:!0,pos:o,node:i,mark:a}:void 0}(e,n,r);if(o){const e=n.state.doc.resolve(o.pos),r=function(e,t,n,r,o){let i={start:-1,end:-1};return n.nodesBetween(r,o,(n,r)=>{if(i.start>-1)return!1;-1===i.start&&e.isInSet(n.marks)&&t===n&&(i={start:r,end:r+Math.max(n.textContent.length,1)})}),i}(o.mark,o.node,n.state.doc,e.before(),e.after()),i=r.start,a=r.end;return void t.show(o.mark,i,a,_(n,i,a))}t.hide()},50);e.set(rk.key,{props:{handleDOMEvents:{mousemove:n,mouseleave:()=>{setTimeout(()=>{null==t||t.hide()},50)}}},view:n=>(t=new lC(e,n),t)})})(e),function(e){let t;e.update(ek.key,e=>((e,t)=>zk(e,Dk(t)))(((e,t)=>{for(var n in t||(t={}))Hk.call(t,n)&&jk(e,n,t[n]);if(Nk)for(var n of Nk(t))qk.call(t,n)&&jk(e,n,t[n]);return e})({},e),{addLink:(e,n)=>{null==t||t.addLink(e,n)},editLink:(e,n,r)=>{null==t||t.editLink(e,n,r)},removeLink:(e,n)=>{null==t||t.removeLink(e,n)}})),e.set(ok.key,{view:n=>(t=new Pk(e,n),t)})}(e)}Fk=new WeakMap,$k=new WeakMap,Wk=new WeakMap,Uk=new WeakMap,Gk=new WeakMap,Zk=new WeakMap,Xk=new WeakMap,Kk=new WeakMap,Yk=new WeakMap,Jk=new WeakMap,Qk=new WeakMap,eC=new WeakMap,tC=new WeakMap,nC=new WeakMap;const dC=[Qx,ek,tk,rk,ok,nk].flat();var uC=Object.defineProperty,hC=Object.getOwnPropertySymbols,pC=Object.prototype.hasOwnProperty,mC=Object.prototype.propertyIsEnumerable,fC=(e,t,n)=>t in e?uC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gC=(e,t)=>{for(var n in t||(t={}))pC.call(t,n)&&fC(e,n,t[n]);if(hC)for(var n of hC(t))mC.call(t,n)&&fC(e,n,t[n]);return e};function vC(e,t){return Object.assign(e,{meta:gC({package:"@milkdown/components"},t)}),e}const yC=a({renderLabel:({label:e,listType:t,checked:n})=>null==n?"bullet"===t?"⦿":e:n?"☑":"□"},"listItemBlockConfigCtx");function bC({icon:e,class:t,onClick:n}){return md("span",{class:On("milkdown-icon",t),onPointerdown:n,innerHTML:e?An.sanitize(e.trim()):void 0})}vC(yC,{displayName:"Config<list-item-block>",group:"ListItemBlock"}),bC.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const wC=fl({props:{label:{type:Object,required:!0},checked:{type:Object,required:!0},listType:{type:Object,required:!0},config:{type:Object,required:!0},readonly:{type:Object,required:!0},selected:{type:Object,required:!0},setAttr:{type:Function,required:!0},onMount:{type:Function,required:!0}},setup({label:e,checked:t,listType:n,config:r,readonly:o,setAttr:i,onMount:a,selected:s}){const l=e=>{null!=e&&e instanceof Element&&a(e)},c=e=>{e.stopPropagation(),e.preventDefault(),null!=t.value&&i("checked",!t.value)},d=pd(()=>r.renderLabel({label:e.value,listType:n.value,checked:t.value,readonly:o.value})),u=pd(()=>null==t.value?"bullet"===n.value?"bullet":"ordered":t.value?"checked":"unchecked");return()=>md("li",{class:On("list-item",s.value&&"ProseMirror-selectednode")},md("div",{class:"label-wrapper",onPointerdown:c,contenteditable:!1},md(bC,{class:On("label",o.value&&"readonly",u.value),icon:d.value})),md("div",{class:"children",ref:l}))}}),xC=R(H.node,e=>(t,n,r)=>{const o=document.createElement("div");o.className="milkdown-list-item-block";const i=document.createElement("div");i.setAttribute("data-content-dom","true"),i.classList.add("content-dom");const a=vs(t.attrs.label),s=vs(t.attrs.checked),l=vs(t.attrs.listType),c=vs(!n.editable),d=e.get(yC.key),u=vs(!1),h=sl(()=>{u.value?o.classList.add("selected"):o.classList.remove("selected")});let p=0;const m=jd(wC,{label:a,checked:s,listType:l,readonly:c,config:d,selected:u,setAttr:(e,t)=>{if(!n.editable)return;const o=r();null!=o&&(n.hasFocus()||n.focus(),n.dispatch(n.state.tr.setNodeAttribute(o,e,t)))},onMount:e=>{if(i.parentNode===e)return;const{anchor:t,head:r}=n.state.selection;e.appendChild(i);const o=n.state.doc;p=requestAnimationFrame(()=>{if(p=0,n.isDestroyed)return;if(!o.eq(n.state.doc))return;if(n.state.selection.anchor!==t||n.state.selection.head!==r)return;const e=n.dom.ownerDocument.getSelection();if(e?.anchorNode&&n.dom.contains(e.anchorNode))try{if(n.posAtDOM(e.anchorNode,e.anchorOffset)!==t||e.focusNode&&n.posAtDOM(e.focusNode,e.focusOffset)!==r)return}catch{return}const i=S.create(n.state.doc,t,r);n.dispatch(n.state.tr.setSelection(i))})}});m.mount(o);const f=e=>{l.value=e.attrs.listType,a.value=e.attrs.label,s.value=e.attrs.checked,c.value=!n.editable};f(t);let g=t;return{dom:o,contentDOM:i,update:e=>e.type===t.type&&(e.sameMarkup(g)&&e.content.eq(g.content)||(g=e,f(e)),!0),ignoreMutation:e=>!o||!i||"selection"!==e.type&&(i===e.target&&"attributes"===e.type||!i.contains(e.target)),selectNode:()=>{u.value=!0},deselectNode:()=>{u.value=!1},destroy:()=>{cancelAnimationFrame(p),h(),m.unmount(),o.remove(),i.remove()}}});vC(xC,{displayName:"NodeView<list-item-block>",group:"ListItemBlock"});const kC=[yC,xC];var CC=Object.defineProperty,_C=Object.getOwnPropertySymbols,SC=Object.prototype.hasOwnProperty,AC=Object.prototype.propertyIsEnumerable,MC=(e,t,n)=>t in e?CC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TC=(e,t)=>{for(var n in t||(t={}))SC.call(t,n)&&MC(e,n,t[n]);if(_C)for(var n of _C(t))AC.call(t,n)&&MC(e,n,t[n]);return e};function EC(e,t){return Object.assign(e,{meta:TC({package:"@milkdown/components"},t)}),e}var LC=Object.defineProperty,OC=Object.getOwnPropertySymbols,IC=Object.prototype.hasOwnProperty,RC=Object.prototype.propertyIsEnumerable,PC=(e,t,n)=>t in e?LC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const BC=a(((e,t)=>{for(var n in t||(t={}))IC.call(t,n)&&PC(e,n,t[n]);if(OC)for(var n of OC(t))RC.call(t,n)&&PC(e,n,t[n]);return e})({},{renderButton:e=>{switch(e){case"add_row":case"add_col":return"+";case"delete_row":case"delete_col":return"-";case"align_col_left":return"left";case"align_col_center":return"center";case"align_col_right":return"right";case"col_drag_handle":case"row_drag_handle":return"="}}}),"tableBlockConfigCtx");function zC({icon:e,class:t,onClick:n}){return md("span",{class:On("milkdown-icon",t),onPointerdown:n,innerHTML:e?An.sanitize(e.trim()):void 0})}function DC(e){const{dragPreviewRef:t,tableWrapperRef:n,contentWrapperRef:r,yLineHandleRef:o,xLineHandleRef:i,colHandleRef:a,rowHandleRef:s}=e,l=t.value;if(!l)return;const c=n.value;if(!c)return;const d=r.value;if(!d)return;const u=d.querySelector("tbody");if(!u)return;const h=l.querySelector("tbody");if(!h)return;const p=o.value;if(!p)return;const m=i.value;if(!m)return;const f=a.value;if(!f)return;const g=s.value;return g?{preview:l,wrapper:c,content:d,contentRoot:u,previewRoot:h,yHandle:p,xHandle:m,colHandle:f,rowHandle:g}:void 0}function NC(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function HC(e,t,n,r,o){const{width:i,height:a}=r.querySelector("tbody").getBoundingClientRect();if("y"===e){const e=r.querySelectorAll("tr")[o];if(!e)return;n.appendChild(e.cloneNode(!0));const a=e.getBoundingClientRect().height;return Object.assign(t.style,{width:`${i}px`,height:`${a}px`}),void(t.dataset.show="true")}if("x"===e){const e=r.querySelectorAll("tr");let i;return Array.from(e).forEach(e=>{const t=e.children[o];if(!t)return;void 0===i&&(i=t.getBoundingClientRect().width);const r=t.parentElement.cloneNode(!1),a=t.cloneNode(!0);r.appendChild(a),n.appendChild(r)}),Object.assign(t.style,{width:`${i}px`,height:`${a}px`}),void(t.dataset.show="true")}}function qC(e,t,n,r){const{xHandle:o,yHandle:i,colHandle:a,rowHandle:s,preview:l}=n;o.dataset.displayType="y"===e?"indicator":"none",i.dataset.displayType="x"===e?"indicator":"none","y"===e?(a.dataset.show="false",VC(s)):(s.dataset.show="false",VC(a));const{hoverIndex:c,dragInfo:d}=r,[u,h]=c.value;d.value={startCoords:[t.clientX,t.clientY],startIndex:"y"===e?u:h,endIndex:"y"===e?u:h,type:"y"===e?"row":"col"},l.dataset.direction="y"===e?"vertical":"horizontal"}function jC(e,t,n,r){const o=null==n?void 0:n.get(T);if(!(null==o?void 0:o.editable))return;t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.effectAllowed="move");const i=DC(e);i&&requestAnimationFrame(()=>{r(i)})}function VC(e){var t;null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","false")}function FC(e,t){for(let n=0;n<e.childCount;n++)if(e.child(n)===t)return n;return-1}function $C(e,[t,n]){const r=e.value;if(!r)return;const o=r.querySelectorAll("tr"),i=o[t];if(!i)return;const a=o[0];if(!a)return;const s=a.children[n];if(!s)return;const l=i.children[n];return l?{row:i,col:l,headerCol:s}:void 0}function WC({refs:e,index:t,before:n,after:r}){const{contentWrapperRef:o,colHandleRef:i,hoverIndex:a}=e,s=i.value;if(!s)return;a.value=t;const l=$C(o,t);if(!l)return;const{headerCol:c}=l;s.dataset.show="true",n&&n(s),b(c,s,{placement:"top"}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function UC({refs:e,index:t,before:n,after:r}){const{contentWrapperRef:o,rowHandleRef:i,hoverIndex:a}=e,s=i.value;if(!s)return;a.value=t;const l=$C(o,t);if(!l)return;const{row:c}=l;s.dataset.show="true",n&&n(s),b(c,s,{placement:"left"}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function GC(e,t,n){const r="x"===n?"left":"top",o="x"===n?"right":"bottom",i=e.length-1,a=e.findIndex((e,n)=>{const a=e.getBoundingClientRect(),s=a[r],l=a[o];return s<=t&&t<=l||n===i&&t>l||0===n&&t<s}),s=e[a];return s?[s,a]:void 0}EC(BC,{displayName:"Config<table-block>",group:"TableBlock"}),zC.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const ZC=fl({props:{view:{type:Object,required:!0},ctx:{type:Object,required:!0},getPos:{type:Function,required:!0},config:{type:Object,required:!0},onMount:{type:Function,required:!0},node:{type:Object,required:!0}},setup({view:e,node:t,ctx:n,getPos:r,config:o,onMount:i}){const a=vs(),s=e=>{null!=e&&(e instanceof HTMLElement?(a.value=e,i(e)):a.value=void 0)},l=vs(),c=vs(),d=vs(),u=vs(),h=vs(),p=vs(),m={dragPreviewRef:p,tableWrapperRef:h,contentWrapperRef:a,yLineHandleRef:u,xLineHandleRef:d,colHandleRef:l,rowHandleRef:c,hoverIndex:vs([0,0]),lineHoverIndex:vs([-1,-1]),dragInfo:vs()},{pointerLeave:f,pointerMove:v}=function(e,t){const n=function(e,t){return vr(n=>{if(!(null==t?void 0:t.editable))return;const{contentWrapperRef:r,yLineHandleRef:o,xLineHandleRef:i,colHandleRef:a,rowHandleRef:s,hoverIndex:l,lineHoverIndex:c}=e,d=o.value;if(!d)return;const u=i.value;if(!u)return;const h=r.value;if(!h)return;const p=s.value;if(!p)return;const m=a.value;if(!m)return;const f=function(e,t){var r,o,i;if(t)try{const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return;const a=null==n?void 0:n.inside;if(null==a||a<0)return;const s=t.state.doc.resolve(a),l=t.state.doc.nodeAt(a);if(!l)return;const c=["table_cell","table_header"],d=["table_row","table_header_row"],u=c.includes(l.type.name)?l:null==(r=A(e=>c.includes(e.type.name))(s))?void 0:r.node,h=null==(o=A(e=>d.includes(e.type.name))(s))?void 0:o.node,p=null==(i=A(e=>"table"===e.type.name)(s))?void 0:i.node;if(!u||!h||!p)return;const m=FC(h,u);return[FC(p,h),m]}catch(n){return}}(n,t);if(!f)return;const g=$C(r,f);if(!g)return;const[v,y]=f,w=g.col.getBoundingClientRect(),k=Math.abs(n.clientX-w.left)<8,C=Math.abs(w.right-n.clientX)<8,_=Math.abs(n.clientY-w.top)<8,S=Math.abs(w.bottom-n.clientY)<8,M=k||C||_||S,T=p.querySelector(".button-group"),E=m.querySelector(".button-group");if(T&&(T.dataset.show="false"),E&&(E.dataset.show="false"),M){const e=h.getBoundingClientRect();p.dataset.show="false",m.dataset.show="false",u.dataset.displayType="tool",d.dataset.displayType="tool";const t=d.getBoundingClientRect().width,n=u.getBoundingClientRect().height;return k||C?(c.value[1]=k?y:y+1,b(g.col,d,{placement:k?"left":"right",middleware:[x(k?-1*t:0)]}).then(({x:t})=>{d.dataset.show="true",Object.assign(d.style,{height:`${e.height}px`,left:`${t}px`})}).catch(console.error)):d.dataset.show="false",void(0!==f[0]&&(_||S)?(c.value[0]=_?v:v+1,b(g.row,u,{placement:_?"top":"bottom",middleware:[x(_?-1*n:0)]}).then(({y:t})=>{u.dataset.show="true",Object.assign(u.style,{width:`${e.width}px`,top:`${t}px`})}).catch(console.error)):u.dataset.show="false")}c.value=[-1,-1],d.dataset.show="false",u.dataset.show="false",p.dataset.show="true",m.dataset.show="true",UC({refs:e,index:f}),WC({refs:e,index:f}),l.value=f},20)}(e,t),r=function(e){return()=>{const{rowHandleRef:t,colHandleRef:n,yLineHandleRef:r,xLineHandleRef:o}=e;setTimeout(()=>{const e=t.value;if(!e)return;const i=n.value;if(!i)return;const a=r.value;if(!a)return;const s=o.value;s&&(e.dataset.show="false",i.dataset.show="false",a.dataset.show="false",s.dataset.show="false")},200)}}(e);return{pointerMove:n,pointerLeave:r}}(m,e),{dragRow:y,dragCol:w}=function(e,t,n){const{dragPreviewRef:r,yLineHandleRef:o,xLineHandleRef:i,dragInfo:a}=e,s=function(e,t){return n=>{jC(e,n,t,t=>{qC("y",n,t,e);const{preview:r,content:o,previewRoot:i}=t;NC(i);const{hoverIndex:a}=e,[s]=a.value;HC("y",r,i,o,s)})}}(e,t),l=function(e,t){return n=>{jC(e,n,t,t=>{qC("x",n,t,e);const{preview:r,content:o,previewRoot:i}=t,{hoverIndex:a}=e,[s,l]=a.value;NC(i),HC("x",r,i,o,l)})}}(e,t),c=()=>{const e=r.value;if(!e)return;if("false"===e.dataset.show)return;const t=null==e?void 0:e.querySelector("tbody");for(;null==t?void 0:t.firstChild;)null==t||t.removeChild(t.firstChild);e&&(e.dataset.show="false")},d=()=>{var s;const l=r.value;if(!l)return;const c=o.value;if(!c)return;const d=i.value;if(!d)return;const u=a.value;if(!u)return;if(!t)return;if("false"===l.dataset.show)return;if(!e.colHandleRef.value)return;if(!e.rowHandleRef.value)return;if(c.dataset.show="false",d.dataset.show="false",u.startIndex===u.endIndex)return;const h=t.get(g),p={from:u.startIndex,to:u.endIndex,pos:(null!=(s=null==n?void 0:n())?s:0)+1};if("col"===u.type){h.call(Cp.key,{pos:p.pos,index:u.startIndex}),h.call(xp.key,p);const t=[0,u.endIndex];WC({refs:e,index:t})}else{h.call(kp.key,{pos:p.pos,index:u.startIndex}),h.call(wp.key,p);const t=[u.endIndex,0];UC({refs:e,index:t})}requestAnimationFrame(()=>{t.get(T).focus()})},u=function(e){return vr(t=>{const n=DC(e);if(!n)return;const{preview:r,content:o,contentRoot:i,xHandle:a,yHandle:s}=n,{dragInfo:l,hoverIndex:c}=e;if("false"===r.dataset.show)return;const d=$C(e.contentWrapperRef,c.value);if(!d)return;if(!i.querySelector("tr"))return;const u=l.value;if(!u)return;if(!i.offsetParent)return;const h=i.offsetParent.offsetTop,p=i.offsetParent.offsetLeft;if("col"===u.type){const e=d.col.getBoundingClientRect().width,{left:n,width:a}=i.getBoundingClientRect(),l=p-n,c=t.clientX+l-e/2,[m]=u.startCoords,f=m<t.clientX?"right":"left";r.style.top=`${h}px`;const g=c<n+l-20?n+l-20:c>n+a+l-e+20?n+a+l-e+20:c;r.style.left=`${g}px`;const v=function(e,t){const n=e.querySelector("tr");if(n)return GC(Array.from(n.children),t,"x")}(i,t.clientX);if(v){const[e,t]=v,n=s.getBoundingClientRect().width,r=o.getBoundingClientRect();u.endIndex=t,b(e,s,{placement:"left"===f?"left":"right",middleware:[x("left"===f?-1*n:0)]}).then(({x:e})=>{s.dataset.show="true",Object.assign(s.style,{height:`${r.height}px`,left:`${e}px`,top:`${h}px`})}).catch(console.error)}}else if("row"===u.type){const e=d.row.getBoundingClientRect().height,{top:n,height:s}=i.getBoundingClientRect(),l=h-n,c=t.clientY+l-e/2,[m,f]=u.startCoords,g=f<t.clientY?"down":"up",v=c<n+l-20?n+l-20:c>n+s+l-e+20?n+s+l-e+20:c;r.style.top=`${v}px`,r.style.left=`${p}px`;const y=function(e,t){return GC(Array.from(e.querySelectorAll("tr")),t,"y")}(i,t.clientY);if(y){const[e,t]=y,n=a.getBoundingClientRect().height,r=o.getBoundingClientRect();u.endIndex=t,b(e,a,{placement:"up"===g?"top":"bottom",middleware:[x("up"===g?-1*n:0)]}).then(({y:e})=>{a.dataset.show="true",Object.assign(a.style,{width:`${r.width}px`,top:`${e}px`})}).catch(console.error)}}},20)}(e);return Ll(()=>{window.addEventListener("dragover",u),window.addEventListener("dragend",c),window.addEventListener("drop",d)}),Pl(()=>{window.removeEventListener("dragover",u),window.removeEventListener("dragend",c),window.removeEventListener("drop",d)}),{dragRow:s,dragCol:l}}(m,n,r),{onAddRow:k,onAddCol:C,selectCol:_,selectRow:S,deleteSelected:M,onAlign:E}=function(e,t,n){const{xLineHandleRef:r,contentWrapperRef:o,colHandleRef:i,rowHandleRef:a,hoverIndex:s,lineHoverIndex:l}=e;return{onAddRow:()=>{var e,i,a;if(!t)return;const s=r.value;if(!s)return;const[c]=l.value;if(c<0)return;if(!t.get(T).editable)return;const d=Array.from(null!=(i=null==(e=o.value)?void 0:e.querySelectorAll("tr"))?i:[]),u=t.get(g),h=(null!=(a=null==n?void 0:n())?a:0)+1;d.length===c?(u.call(kp.key,{pos:h,index:c-1}),u.call(Ep.key)):(u.call(kp.key,{pos:h,index:c}),u.call(Tp.key)),u.call(kp.key,{pos:h,index:c}),s.dataset.show="false"},onAddCol:()=>{var e,i,a,s;if(!t)return;if(!r.value)return;const[c,d]=l.value;if(d<0)return;if(!t.get(T).editable)return;const u=Array.from(null!=(a=null==(i=null==(e=o.value)?void 0:e.querySelector("tr"))?void 0:i.children)?a:[]),h=t.get(g),p=(null!=(s=null==n?void 0:n())?s:0)+1;u.length===d?(h.call(Cp.key,{pos:p,index:d-1}),h.call(Mp.key)):(h.call(Cp.key,{pos:p,index:d}),h.call(Ap.key)),h.call(Cp.key,{pos:p,index:d})},selectCol:()=>{var e,r;if(!t)return;const[o,a]=s.value,l=t.get(g),c=(null!=(e=null==n?void 0:n())?e:0)+1;l.call(Cp.key,{pos:c,index:a});const d=null==(r=i.value)?void 0:r.querySelector(".button-group");d&&(d.dataset.show="true"===d.dataset.show?"false":"true")},selectRow:()=>{var e,r;if(!t)return;const[o,i]=s.value,l=t.get(g),c=(null!=(e=null==n?void 0:n())?e:0)+1;l.call(kp.key,{pos:c,index:o});const d=null==(r=a.value)?void 0:r.querySelector(".button-group");d&&o>0&&(d.dataset.show="true"===d.dataset.show?"false":"true")},deleteSelected:e=>{t&&t.get(T).editable&&(e.preventDefault(),e.stopPropagation(),t.get(g).call(Sp.key),requestAnimationFrame(()=>{t.get(T).focus()}))},onAlign:e=>n=>{t&&t.get(T).editable&&(n.preventDefault(),n.stopPropagation(),t.get(g).call(Lp.key,e),requestAnimationFrame(()=>{t.get(T).focus()}))}}}(m,n,r);return Ll(()=>{requestAnimationFrame(()=>{e.editable&&function(e,t,n){if(!n)return;if(!t)return;const{selection:r}=t.state;if(!(r instanceof Xu))return;const{$from:o}=r,i=oh(o);if(i&&i.node===n){if(r.isColSelection()){const{$head:t}=r;return void WC({refs:e,index:[0,t.index(t.depth-1)],before:e=>{var t;null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","true")}})}if(r.isRowSelection()){const{$head:t}=r,n=A(e=>"table_row"===e.type.name||"table_header_row"===e.type.name)(t);if(!n)return;const o=FC(i.node,n.node);UC({refs:e,index:[o,0],before:e=>{var t;o>0&&(null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","true"))}})}}}(m,e,t.value)})}),()=>md("div",{onDragstart:e=>e.preventDefault(),onDragover:e=>e.preventDefault(),onDragleave:e=>e.preventDefault(),onPointermove:v,onPointerleave:f},md("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"col-drag-handle",class:"handle cell-handle",onDragstart:w,onClick:_,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:l},md(zC,{icon:o.renderButton("col_drag_handle")}),md("div",{"data-show":"false",class:"button-group",onPointermove:e=>e.stopPropagation()},md("button",{type:"button",onPointerdown:E("left")},md(zC,{icon:o.renderButton("align_col_left")})),md("button",{type:"button",onPointerdown:E("center")},md(zC,{icon:o.renderButton("align_col_center")})),md("button",{type:"button",onPointerdown:E("right")},md(zC,{icon:o.renderButton("align_col_right")})),md("button",{type:"button",onPointerdown:M},md(zC,{icon:o.renderButton("delete_col")})))),md("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"row-drag-handle",class:"handle cell-handle",onDragstart:y,onClick:S,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:c},md(zC,{icon:o.renderButton("row_drag_handle")}),md("div",{"data-show":"false",class:"button-group",onPointermove:e=>e.stopPropagation()},md("button",{type:"button",onPointerdown:M},md(zC,{icon:o.renderButton("delete_row")})))),md("div",{class:"table-wrapper",ref:h},md("div",{"data-show":"false",class:"drag-preview","data-direction":"vertical",ref:p},md("table",null,md("tbody",null))),md("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"x-line-drag-handle",class:"handle line-handle",onPointermove:e=>e.stopPropagation(),ref:d},md("button",{type:"button",onClick:k,class:"add-button"},md(zC,{icon:o.renderButton("add_row")}))),md("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"y-line-drag-handle",class:"handle line-handle",onPointermove:e=>e.stopPropagation(),ref:u},md("button",{type:"button",onClick:C,class:"add-button"},md(zC,{icon:o.renderButton("add_col")}))),md("table",{ref:s,class:"children"})))}});var XC,KC,YC=e=>{throw TypeError(e)};class JC{constructor(e,t,n,r){this.ctx=e,this.node=t,this.view=n,this.getPos=r,((e,t)=>{t.has(e)?YC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,XC);const o=document.createElement("div");o.className="milkdown-table-block";const i=document.createElement("tbody");this.contentDOM=i,i.setAttribute("data-content-dom","true"),i.classList.add("content-dom"),this.nodeRef=ys(t);const a=jd(ZC,{view:n,ctx:e,getPos:r,config:e.get(BC.key),onMount:e=>{e.appendChild(i)},node:this.nodeRef});a.mount(o),this.app=a,this.dom=o}update(e){return!(e.type!==this.node.type||e.sameMarkup(this.node)&&e.content.eq(this.node.content)||(this.node=e,this.nodeRef.value=e,0))}stopEvent(e){if("drop"===e.type||e.type.startsWith("drag"))return!0;if("mousedown"===e.type||"pointerdown"===e.type){if(e.target instanceof Element&&e.target.closest("button"))return!0;const t=e.target;if(t instanceof HTMLElement&&(t.closest("th")||t.closest("td"))){const t=e;return((e,t,n)=>((e=>{XC.has(e)||YC("Cannot access private method")})(this),n))(0,0,KC).call(this,t)}}return!1}ignoreMutation(e){return!this.dom||!this.contentDOM||"selection"!==e.type&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target))}destroy(){this.app.unmount(),this.dom.remove(),this.contentDOM.remove()}}XC=new WeakSet,KC=function(e){const t=this.view;if(!t.editable)return!1;const{state:n,dispatch:r}=t,o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return!1;const i=n.doc.resolve(o.inside),a=A(e=>"table_cell"===e.type.name||"table_header"===e.type.name)(i);if(!a)return!1;if(n.selection instanceof S){const e=A(e=>"table_cell"===e.type.name||"table_header"===e.type.name)(n.selection.$from);if((null==e?void 0:e.node)===a.node)return!1}const{from:s}=a,l=M.create(n.doc,s+1);return!n.selection.eq(l)&&(n.selection instanceof Xu?setTimeout(()=>{r(n.tr.setSelection(l).scrollIntoView())},20):requestAnimationFrame(()=>{r(n.tr.setSelection(l).scrollIntoView())}),!0)};const QC=R(ap.node,e=>(t,n,r)=>new JC(e,t,n,r));EC(QC,{displayName:"NodeView<table-block>",group:"TableBlock"});const e_=[BC,QC];function t_(e){if(!e)return!1;if(Array.isArray(e))return!(e.length>1)&&t_(e[0]);const t=e.content;return t?t_(t):"text"===e.type}function n_(e,t){const n=ue(t);if(n)return e.dispatch(e.state.tr.replaceSelectionWith(n,!0)),!0;try{return e.dispatch(e.state.tr.replaceSelection(t)),!0}catch{return!1}}var r_=s(e=>{const t=e.get(ae);return e.update(se,e=>({...e,editable:e.editable??(()=>!0),transformPastedHTML:(t,n)=>{const r=e.transformPastedHTML;return r&&(t=r(t,n)),t.includes("docs-internal-guid")&&(t=(t=t.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,"$1")).replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,"$1")),t}})),new c({key:new d("MILKDOWN_CLIPBOARD"),props:{handlePaste:(n,r,o)=>{const i=e.get(u),a=n.props.editable?.(n.state),{clipboardData:s}=r;if(!a||!s)return!1;if(n.state.selection.$from.node().type.spec.code)return!1;const l=s.getData("text/plain"),c=s.getData("vscode-editor-data");if(c){const e=JSON.parse(c)?.mode;if(l&&e){const{tr:r}=n.state,o=ce("code_block",t);return r.replaceSelectionWith(o.create({language:e})).setSelection(S.near(r.doc.resolve(Math.max(0,r.selection.from-2)))).insertText(l.replace(/\r\n?/g,"\n")),n.dispatch(r),!0}}const d=s.getData("text/html");if(0===d.length&&0===l.length)return!1;if(d.length>0&&o)return n_(n,o);const h=de.fromSchema(t);let p;if(0===d.length){const e=i(l);if(!e||"string"==typeof e)return!1;p=y.fromSchema(t).serializeFragment(e.content)}else{const e=document.createElement("template");e.innerHTML=d,p=e.content.cloneNode(!0),e.remove()}return n_(n,h.parseSlice(p))},clipboardTextSerializer:n=>{const r=e.get(le);if(t_(n.content.toJSON()))return n.content.textBetween(0,n.content.size,"\n\n");const o=t.topNodeType.createAndFill(void 0,n.content);return o?r(o):""}}})});function o_(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-history",...t}}),e}!function(e){Object.assign(e,{meta:{package:"@milkdown/plugin-clipboard",displayName:"Prose<clipboard>"}})}(r_);var i_=l("Undo",()=>()=>Q);o_(i_,{displayName:"Command<undo>"});var a_=l("Redo",()=>()=>ee);o_(a_,{displayName:"Command<redo>"});var s_=a({},"historyProviderConfig");o_(s_,{displayName:"Ctx<historyProviderConfig>"});var l_=s(e=>he(e.get(s_.key)));o_(l_,{displayName:"Ctx<historyProviderPlugin>"});var c_=$("historyKeymap",{Undo:{shortcuts:"Mod-z",command:e=>{const t=e.get(g);return()=>t.call(i_.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:e=>{const t=e.get(g);return()=>t.call(a_.key)}}});o_(c_.ctx,{displayName:"KeymapCtx<history>"}),o_(c_.shortcuts,{displayName:"Keymap<history>"});var d_=[s_,l_,c_,i_,a_].flat(),u_=a({type:"space",size:2},"indentConfig");u_.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};var h_=pe(e=>({Tab:(t,n)=>{const r=e.get(u_.key),{tr:o}=t,i=function(e,t){const{doc:n,selection:r}=e;if(!n||!r)return e;if(!(r instanceof S||r instanceof me))return e;const{to:o}=r,i="space"===t.type?Array(t.size).fill(" ").join(""):"\t";return e.insertText(i,o)}(o,r);return!!i.docChanged&&(n?.(i),!0)}}));h_.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};var p_=[u_,h_],m_=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}},f_=fe(new m_,"listener"),g_=new d("MILKDOWN_LISTENER"),v_=e=>(e.inject(f_,new m_),async()=>{await e.wait(ge);const{listeners:t}=e.get(f_);t.beforeMount.forEach(t=>t(e)),await e.wait(ve);const n=e.get(le);let r=null,o=null,i=null,a=null;const s=pr(()=>{if(!a)return;const{doc:i}=a;if(t.updated.length>0&&r&&!r.eq(i)&&t.updated.forEach(t=>{t(e,i,r)}),t.markdownUpdated.length>0&&r&&!r.eq(i)){const r=n(i);t.markdownUpdated.forEach(t=>{t(e,r,o)}),o=r}r=i,a=null},200),l=new c({key:g_,view:()=>({destroy:()=>{s.cancel(),t.destroy.forEach(t=>t(e))}}),props:{handleDOMEvents:{focus:()=>(t.focus.forEach(t=>t(e)),!1),blur:()=>(t.blur.forEach(t=>t(e)),!1)}},state:{init:(e,t)=>{r=t.doc,o=n(t.doc)},apply:n=>{const r=n.selection;(!i&&r||i&&!r.eq(i))&&(t.selectionUpdated.forEach(t=>{t(e,r,i)}),i=r),(n.docChanged||n.storedMarksSet)&&!1!==n.getMeta("addToHistory")&&(a=n,s())}}});e.update(ye,e=>e.concat(l)),await e.wait(be),t.mounted.forEach(t=>t(e))});v_.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};var y_=a({shouldAppend:e=>!!e&&!["heading","paragraph"].includes(e.type.name),getNode:e=>e.schema.nodes.paragraph.create()},"trailingConfig");y_.meta={package:"@milkdown/plugin-trailing",displayName:"Ctx<trailingConfig>"};var b_=s(e=>{const t=new d("MILKDOWN_TRAILING"),{shouldAppend:n,getNode:r}=e.get(y_.key),o=new c({key:t,state:{init:(e,t)=>{const r=t.tr.doc.lastChild;return n(r,t)},apply:(e,t,r,o)=>{if(!e.docChanged)return t;const i=e.doc.lastChild;return n(i,o)}},appendTransaction:(e,t,n)=>{const{doc:i,tr:a}=n,s=r?.(n),l=o.getState(n),c=i.content.size;if(l&&s)return a.insert(c,s)}});return o});b_.meta={package:"@milkdown/plugin-trailing",displayName:"Prose<trailing>"};var w_=[y_,b_],x_=a({uploader:async(e,t)=>{const n=[];for(let o=0;o<e.length;o++){const t=e.item(o);t&&t.type.includes("image")&&n.push(t)}const{image:r}=t.nodes;if(!r)throw we("image");return(await Promise.all(n.map(e=>function(e){return new Promise(t=>{const n=new FileReader;n.addEventListener("load",()=>{t({alt:e.name,src:n.result})},!1),n.readAsDataURL(e)})}(e)))).map(({alt:e,src:t})=>r.createAndFill({src:t,alt:e}))},enableHtmlFileUploader:!1,uploadWidgetFactory:(e,t)=>{const n=document.createElement("span");return n.textContent="Upload in progress...",v.widget(e,n,t)}},"uploadConfig");x_.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};var k_=s(e=>{const t=new d("MILKDOWN_UPLOAD"),n=(n,r,o)=>{if(!o||o.length<=0)return!1;const i=Symbol("upload symbol"),a=e.get(ae),{uploader:s,getInsertPos:l}=e.get(x_.key),{tr:c}=n.state,d=r instanceof DragEvent?n.posAtCoords({left:r.clientX,top:r.clientY})?.pos??c.selection.from:c.selection.from,u="function"==typeof l?l(r,e,d):d;return n.dispatch(c.setMeta(t,{add:{id:i,pos:u}})),s(o,a,e,u).then(e=>{const r=((e,n)=>{const r=t.getState(e);if(!r)return-1;const o=r.find(void 0,void 0,e=>e.id===n);return o.length?o[0]?.from??-1:-1})(n.state,i);r<0||n.dispatch(n.state.tr.replaceWith(r,r,e).setMeta(t,{remove:{id:i}}))}).catch(e=>{console.error(e)}),!0};return new c({key:t,state:{init:()=>f.empty,apply(t,n){const r=n.map(t.mapping,t.doc),o=t.getMeta(this);if(!o)return r;if(o.add){const{uploadWidgetFactory:n}=e.get(x_.key),i=n(o.add.pos,{id:o.add.id});return r.add(t.doc,[i])}if(o.remove){const e=r.find(void 0,void 0,e=>e.id===o.remove.id);return r.remove(e)}return r}},props:{decorations(e){return this.getState(e)},handlePaste:(t,r)=>{const{enableHtmlFileUploader:o}=e.get(x_.key);return r instanceof ClipboardEvent&&!(!o&&r.clipboardData?.getData("text/html"))&&n(t,r,r.clipboardData?.files)},handleDrop:(e,t)=>t instanceof DragEvent&&n(e,t,t.dataTransfer?.files)}})});k_.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};var C_=[x_,k_],__=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(__||{});const S_={cursor:!0,"list-item":!0,"link-tooltip":!0,"image-block":!0,"block-edit":!0,placeholder:!0,toolbar:!0,"code-mirror":!0,table:!0,latex:!0,"top-bar":!1,ai:!1},A_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 14l1.25-2.75L23 19l-2.75-1.25L19 15l-1.25 2.75L15 19l2.75 1.25zM9 20l3-6.5L18 10l-6-3.5L9 0L6 6.5L0 10l6 3.5z"\n transform="translate(3 3) scale(0.75)"\n />\n </svg>\n',M_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M8.85758 18.625C8.4358 18.625 8.07715 18.4772 7.78163 18.1817C7.48613 17.8862 7.33838 17.5275 7.33838 17.1058V6.8942C7.33838 6.47242 7.48613 6.11377 7.78163 5.81825C8.07715 5.52275 8.4358 5.375 8.85758 5.375H12.1999C13.2191 5.375 14.1406 5.69231 14.9643 6.32693C15.788 6.96154 16.1999 7.81603 16.1999 8.89038C16.1999 9.63779 16.0194 10.2471 15.6585 10.7183C15.2976 11.1894 14.9088 11.5314 14.4922 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3157 16.6614 14.0192 16.6614 14.9038C16.6614 16.182 16.1902 17.1217 15.2479 17.723C14.3056 18.3243 13.3563 18.625 12.3999 18.625H8.85758ZM9.4883 16.6327H12.3191C13.1063 16.6327 13.6627 16.4141 13.9884 15.9769C14.314 15.5397 14.4768 15.1205 14.4768 14.7192C14.4768 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8057 12.273 12.8057H9.4883V16.6327ZM9.4883 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5278 10.3539C13.8836 10.0064 14.0615 9.59037 14.0615 9.10575C14.0615 8.59035 13.8733 8.16918 13.497 7.84225C13.1207 7.51533 12.6595 7.35188 12.1133 7.35188H9.4883V10.875Z"\n />\n </svg>\n',T_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8070)">\n <path\n d="M4 10.5C3.17 10.5 2.5 11.17 2.5 12C2.5 12.83 3.17 13.5 4 13.5C4.83 13.5 5.5 12.83 5.5 12C5.5 11.17 4.83 10.5 4 10.5ZM4 4.5C3.17 4.5 2.5 5.17 2.5 6C2.5 6.83 3.17 7.5 4 7.5C4.83 7.5 5.5 6.83 5.5 6C5.5 5.17 4.83 4.5 4 4.5ZM4 16.5C3.17 16.5 2.5 17.18 2.5 18C2.5 18.82 3.18 19.5 4 19.5C4.82 19.5 5.5 18.82 5.5 18C5.5 17.18 4.83 16.5 4 16.5ZM8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19ZM8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13ZM7 6C7 6.55 7.45 7 8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8070">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',E_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n class="w-6 h-6"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M19.5 8.25l-7.5 7.5-7.5-7.5"\n />\n </svg>\n',L_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1098_15553)">\n <path\n d="M18.3007 5.70973C17.9107 5.31973 17.2807 5.31973 16.8907 5.70973L12.0007 10.5897L7.1107 5.69973C6.7207 5.30973 6.0907 5.30973 5.7007 5.69973C5.3107 6.08973 5.3107 6.71973 5.7007 7.10973L10.5907 11.9997L5.7007 16.8897C5.3107 17.2797 5.3107 17.9097 5.7007 18.2997C6.0907 18.6897 6.7207 18.6897 7.1107 18.2997L12.0007 13.4097L16.8907 18.2997C17.2807 18.6897 17.9107 18.6897 18.3007 18.2997C18.6907 17.9097 18.6907 17.2797 18.3007 16.8897L13.4107 11.9997L18.3007 7.10973C18.6807 6.72973 18.6807 6.08973 18.3007 5.70973Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1098_15553">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',O_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8081)">\n <path\n d="M9.4 16.6L4.8 12L9.4 7.4L8 6L2 12L8 18L9.4 16.6ZM14.6 16.6L19.2 12L14.6 7.4L16 6L22 12L16 18L14.6 16.6Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8081">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',I_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n >\n <g clip-path="url(#clip0_1013_1606)">\n <path\n d="M9.00012 16.1998L5.50012 12.6998C5.11012 12.3098 4.49012 12.3098 4.10012 12.6998C3.71012 13.0898 3.71012 13.7098 4.10012 14.0998L8.29012 18.2898C8.68012 18.6798 9.31012 18.6798 9.70012 18.2898L20.3001 7.69982C20.6901 7.30982 20.6901 6.68982 20.3001 6.29982C19.9101 5.90982 19.2901 5.90982 18.9001 6.29982L9.00012 16.1998Z"\n fill="#817567"\n />\n </g>\n <defs>\n <clipPath id="clip0_1013_1606">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',R_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="none"\n >\n <path\n d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"\n />\n </svg>\n',P_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7900)">\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M19 13H5C4.45 13 4 12.55 4 12C4 11.45 4.45 11 5 11H19C19.55 11 20 11.45 20 12C20 12.55 19.55 13 19 13Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7900">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',B_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="16"\n height="16"\n viewBox="0 0 16 16"\n >\n <path\n d="M3.5 9.83366C3.35833 9.83366 3.23961 9.78571 3.14383 9.68983C3.04794 9.59394 3 9.47516 3 9.33349C3 9.19171 3.04794 9.07299 3.14383 8.97733C3.23961 8.88155 3.35833 8.83366 3.5 8.83366H12.5C12.6417 8.83366 12.7604 8.8816 12.8562 8.97749C12.9521 9.07338 13 9.19216 13 9.33383C13 9.4756 12.9521 9.59433 12.8562 9.68999C12.7604 9.78577 12.6417 9.83366 12.5 9.83366H3.5ZM3.5 7.16699C3.35833 7.16699 3.23961 7.11905 3.14383 7.02316C3.04794 6.92727 3 6.80849 3 6.66683C3 6.52505 3.04794 6.40633 3.14383 6.31066C3.23961 6.21488 3.35833 6.16699 3.5 6.16699H12.5C12.6417 6.16699 12.7604 6.21494 12.8562 6.31083C12.9521 6.40671 13 6.52549 13 6.66716C13 6.80894 12.9521 6.92766 12.8562 7.02333C12.7604 7.1191 12.6417 7.16699 12.5 7.16699H3.5Z"\n />\n </svg>\n',z_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1013_1585)">\n <path\n d="M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.09 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1013_1585">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',D_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M9 16l-5-5l5-5l1.4 1.4L7.825 10H18V6h2v6H7.825l2.575 2.6z"\n />\n </svg>\n',N_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8075)">\n <path\n d="M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM14.14 11.86L11.14 15.73L9 13.14L6 17H18L14.14 11.86Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8075">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',H_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M6.29811 18.625C6.04505 18.625 5.83115 18.5375 5.65641 18.3626C5.48166 18.1877 5.39429 17.9736 5.39429 17.7203C5.39429 17.467 5.48166 17.2532 5.65641 17.0788C5.83115 16.9045 6.04505 16.8173 6.29811 16.8173H9.21159L12.452 7.18265H9.53851C9.28545 7.18265 9.07155 7.0952 8.89681 6.9203C8.72206 6.7454 8.63469 6.5313 8.63469 6.278C8.63469 6.02472 8.72206 5.81089 8.89681 5.63652C9.07155 5.46217 9.28545 5.375 9.53851 5.375H16.8847C17.1377 5.375 17.3516 5.46245 17.5264 5.63735C17.7011 5.81225 17.7885 6.02634 17.7885 6.27962C17.7885 6.53293 17.7011 6.74676 17.5264 6.92113C17.3516 7.09548 17.1377 7.18265 16.8847 7.18265H14.2789L11.0385 16.8173H13.6443C13.8973 16.8173 14.1112 16.9048 14.286 17.0797C14.4607 17.2546 14.5481 17.4687 14.5481 17.722C14.5481 17.9752 14.4607 18.1891 14.286 18.3634C14.1112 18.5378 13.8973 18.625 13.6443 18.625H6.29811Z"\n />\n </svg>\n',q_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M17.0385 19.5003V16.5388H14.0769V15.0388H17.0385V12.0773H18.5384V15.0388H21.5V16.5388H18.5384V19.5003H17.0385ZM10.8077 16.5388H7.03845C5.78282 16.5388 4.7125 16.0963 3.8275 15.2114C2.9425 14.3266 2.5 13.2564 2.5 12.0009C2.5 10.7454 2.9425 9.67504 3.8275 8.78979C4.7125 7.90454 5.78282 7.46191 7.03845 7.46191H10.8077V8.96186H7.03845C6.1987 8.96186 5.48235 9.25834 4.8894 9.85129C4.29645 10.4442 3.99998 11.1606 3.99998 12.0003C3.99998 12.8401 4.29645 13.5564 4.8894 14.1494C5.48235 14.7423 6.1987 15.0388 7.03845 15.0388H10.8077V16.5388ZM8.25 12.7503V11.2504H15.75V12.7503H8.25ZM21.5 12.0003H20C20 11.1606 19.7035 10.4442 19.1106 9.85129C18.5176 9.25834 17.8013 8.96186 16.9615 8.96186H13.1923V7.46191H16.9615C18.2171 7.46191 19.2875 7.90441 20.1725 8.78939C21.0575 9.67439 21.5 10.7447 21.5 12.0003Z"\n />\n </svg>\n',j_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8067)">\n <path\n d="M8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6C7 6.55 7.45 7 8 7ZM20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17ZM20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11ZM4.5 16H2.5C2.22 16 2 16.22 2 16.5C2 16.78 2.22 17 2.5 17H4V17.5H3.5C3.22 17.5 3 17.72 3 18C3 18.28 3.22 18.5 3.5 18.5H4V19H2.5C2.22 19 2 19.22 2 19.5C2 19.78 2.22 20 2.5 20H4.5C4.78 20 5 19.78 5 19.5V16.5C5 16.22 4.78 16 4.5 16ZM2.5 5H3V7.5C3 7.78 3.22 8 3.5 8C3.78 8 4 7.78 4 7.5V4.5C4 4.22 3.78 4 3.5 4H2.5C2.22 4 2 4.22 2 4.5C2 4.78 2.22 5 2.5 5ZM4.5 10H2.5C2.22 10 2 10.22 2 10.5C2 10.78 2.22 11 2.5 11H3.8L2.12 12.96C2.04 13.05 2 13.17 2 13.28V13.5C2 13.78 2.22 14 2.5 14H4.5C4.78 14 5 13.78 5 13.5C5 13.22 4.78 13 4.5 13H3.2L4.88 11.04C4.96 10.95 5 10.83 5 10.72V10.5C5 10.22 4.78 10 4.5 10Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8067">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',V_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_971_7676)">\n <path\n d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_971_7676">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',F_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7897)">\n <path\n d="M7.17 17C7.68 17 8.15 16.71 8.37 16.26L9.79 13.42C9.93 13.14 10 12.84 10 12.53V8C10 7.45 9.55 7 9 7H5C4.45 7 4 7.45 4 8V12C4 12.55 4.45 13 5 13H7L5.97 15.06C5.52 15.95 6.17 17 7.17 17ZM17.17 17C17.68 17 18.15 16.71 18.37 16.26L19.79 13.42C19.93 13.14 20 12.84 20 12.53V8C20 7.45 19.55 7 19 7H15C14.45 7 14 7.45 14 8V12C14 12.55 14.45 13 15 13H17L15.97 15.06C15.52 15.95 16.17 17 17.17 17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7897">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',$_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M7.30775 20.4997C6.81058 20.4997 6.385 20.3227 6.031 19.9687C5.677 19.6147 5.5 19.1892 5.5 18.692V5.99973H5.25C5.0375 5.99973 4.85942 5.92782 4.71575 5.78398C4.57192 5.64015 4.5 5.46198 4.5 5.24948C4.5 5.03682 4.57192 4.85873 4.71575 4.71523C4.85942 4.57157 5.0375 4.49973 5.25 4.49973H9C9 4.2549 9.08625 4.04624 9.25875 3.87374C9.43108 3.7014 9.63967 3.61523 9.8845 3.61523H14.1155C14.3603 3.61523 14.5689 3.7014 14.7413 3.87374C14.9138 4.04624 15 4.2549 15 4.49973H18.75C18.9625 4.49973 19.1406 4.57165 19.2843 4.71548C19.4281 4.85932 19.5 5.03748 19.5 5.24998C19.5 5.46265 19.4281 5.64073 19.2843 5.78423C19.1406 5.9279 18.9625 5.99973 18.75 5.99973H18.5V18.692C18.5 19.1892 18.323 19.6147 17.969 19.9687C17.615 20.3227 17.1894 20.4997 16.6923 20.4997H7.30775ZM17 5.99973H7V18.692C7 18.7818 7.02883 18.8556 7.0865 18.9132C7.14417 18.9709 7.21792 18.9997 7.30775 18.9997H16.6923C16.7821 18.9997 16.8558 18.9709 16.9135 18.9132C16.9712 18.8556 17 18.7818 17 18.692V5.99973ZM10.1543 16.9997C10.3668 16.9997 10.5448 16.9279 10.6885 16.7842C10.832 16.6404 10.9037 16.4622 10.9037 16.2497V8.74973C10.9037 8.53723 10.8318 8.35907 10.688 8.21523C10.5443 8.07157 10.3662 7.99973 10.1535 7.99973C9.941 7.99973 9.76292 8.07157 9.61925 8.21523C9.47575 8.35907 9.404 8.53723 9.404 8.74973V16.2497C9.404 16.4622 9.47583 16.6404 9.6195 16.7842C9.76333 16.9279 9.94158 16.9997 10.1543 16.9997ZM13.8465 16.9997C14.059 16.9997 14.2371 16.9279 14.3807 16.7842C14.5243 16.6404 14.596 16.4622 14.596 16.2497V8.74973C14.596 8.53723 14.5242 8.35907 14.3805 8.21523C14.2367 8.07157 14.0584 7.99973 13.8458 7.99973C13.6333 7.99973 13.4552 8.07157 13.3115 8.21523C13.168 8.35907 13.0962 8.53723 13.0962 8.74973V16.2497C13.0962 16.4622 13.1682 16.6404 13.312 16.7842C13.4557 16.9279 13.6338 16.9997 13.8465 16.9997Z"\n />\n </svg>\n',W_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n class="w-6 h-6"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"\n />\n </svg>\n',U_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M3.25 13.7404C3.0375 13.7404 2.85938 13.6684 2.71563 13.5246C2.57188 13.3808 2.5 13.2026 2.5 12.99C2.5 12.7774 2.57188 12.5993 2.71563 12.4558C2.85938 12.3122 3.0375 12.2404 3.25 12.2404H20.75C20.9625 12.2404 21.1406 12.3123 21.2843 12.4561C21.4281 12.5999 21.5 12.7781 21.5 12.9907C21.5 13.2033 21.4281 13.3814 21.2843 13.525C21.1406 13.6686 20.9625 13.7404 20.75 13.7404H3.25ZM10.9423 10.2596V6.62495H6.5673C6.2735 6.62495 6.02377 6.52201 5.8181 6.31613C5.61245 6.11026 5.50963 5.86027 5.50963 5.56615C5.50963 5.27205 5.61245 5.02083 5.8181 4.8125C6.02377 4.60417 6.2735 4.5 6.5673 4.5H17.4423C17.7361 4.5 17.9858 4.60294 18.1915 4.80883C18.3971 5.01471 18.5 5.2647 18.5 5.5588C18.5 5.85292 18.3971 6.10413 18.1915 6.31245C17.9858 6.52078 17.7361 6.62495 17.4423 6.62495H13.0673V10.2596H10.9423ZM10.9423 15.7211H13.0673V18.4423C13.0673 18.7361 12.9643 18.9858 12.7584 19.1915C12.5526 19.3971 12.3026 19.5 12.0085 19.5C11.7144 19.5 11.4631 19.3962 11.2548 19.1887C11.0465 18.9811 10.9423 18.7291 10.9423 18.4327V15.7211Z"\n />\n </svg>\n',G_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8078)">\n <path\n d="M20 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3ZM20 5V8H5V5H20ZM15 19H10V10H15V19ZM5 10H8V19H5V10ZM17 19V10H20V19H17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8078">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',Z_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M5.66936 16.3389L9.39244 12.6158C9.54115 12.4671 9.71679 12.3937 9.91936 12.3957C10.1219 12.3976 10.2975 12.4761 10.4463 12.6312C10.5847 12.7823 10.654 12.9585 10.654 13.1599C10.654 13.3613 10.5847 13.5363 10.4463 13.6851L6.32704 17.8197C6.14627 18.0004 5.93538 18.0908 5.69436 18.0908C5.45333 18.0908 5.24243 18.0004 5.06166 17.8197L3.01744 15.7754C2.87899 15.637 2.81136 15.4629 2.81456 15.2533C2.81776 15.0437 2.88859 14.8697 3.02706 14.7312C3.16551 14.5928 3.34008 14.5235 3.55076 14.5235C3.76144 14.5235 3.93494 14.5928 4.07126 14.7312L5.66936 16.3389ZM5.66936 8.72359L9.39244 5.00049C9.54115 4.85177 9.71679 4.77838 9.91936 4.78031C10.1219 4.78223 10.2975 4.86075 10.4463 5.01586C10.5847 5.16691 10.654 5.34314 10.654 5.54454C10.654 5.74592 10.5847 5.92097 10.4463 6.06969L6.32704 10.2043C6.14627 10.3851 5.93538 10.4755 5.69436 10.4755C5.45333 10.4755 5.24243 10.3851 5.06166 10.2043L3.01744 8.16009C2.87899 8.02162 2.81136 7.84759 2.81456 7.63799C2.81776 7.42837 2.88859 7.25433 3.02706 7.11586C3.16551 6.97741 3.34008 6.90819 3.55076 6.90819C3.76144 6.90819 3.93494 6.97741 4.07126 7.11586L5.66936 8.72359ZM13.7597 16.5581C13.5472 16.5581 13.3691 16.4862 13.2253 16.3424C13.0816 16.1986 13.0097 16.0204 13.0097 15.8078C13.0097 15.5952 13.0816 15.4171 13.2253 15.2735C13.3691 15.13 13.5472 15.0582 13.7597 15.0582H20.7597C20.9722 15.0582 21.1503 15.1301 21.2941 15.2739C21.4378 15.4177 21.5097 15.5959 21.5097 15.8085C21.5097 16.0211 21.4378 16.1992 21.2941 16.3427C21.1503 16.4863 20.9722 16.5581 20.7597 16.5581H13.7597ZM13.7597 8.94276C13.5472 8.94276 13.3691 8.87085 13.2253 8.72704C13.0816 8.58324 13.0097 8.40504 13.0097 8.19244C13.0097 7.97985 13.0816 7.80177 13.2253 7.65819C13.3691 7.5146 13.5472 7.44281 13.7597 7.44281H20.7597C20.9722 7.44281 21.1503 7.51471 21.2941 7.65851C21.4378 7.80233 21.5097 7.98053 21.5097 8.19311C21.5097 8.40571 21.4378 8.5838 21.2941 8.72739C21.1503 8.87097 20.9722 8.94276 20.7597 8.94276H13.7597Z"\n />\n </svg>\n',X_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="m12.9 16l-2.55-2.5l.05-.05q1.45-1.6 2.262-3.117T13.95 7H16V5h-6V3H8v2H2v2h9.1q-.5 1.2-1.225 2.387T8 11.7q-.6-.6-1.187-1.412T5.85 8.6H3.85q.5 1.4 1.3 2.7T6.95 13.7L2.85 17.75L4.25 19.15L8 15.4L10.55 17.95zM18.5 22h-2L21 10h2l4.5 12h-2l-1.05-3h-4.9zm1.6-5h3.6l-1.8-5.1z"\n />\n </svg>\n',K_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="32"\n height="32"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M7 19v-.808L13.096 12L7 5.808V5h10v1.25H9.102L14.727 12l-5.625 5.77H17V19z"\n />\n </svg>\n',Y_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n >\n <path\n d="m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"\n />\n </svg>\n',J_={[__.CodeMirror]:{theme:Or,languages:wr,expandIcon:E_,searchIcon:W_,clearSearchIcon:L_,searchPlaceholder:"Search language",noResultText:"No result",previewToggleIcon:e=>e?z_:Y_}},Q_=fe([],"FeaturesCtx"),eS=fe({},"CrepeCtx");function tS(e){return e.use("FeaturesCtx")}function nS(e){return t=>{tS(t).update(t=>t.includes(e)?t:[...t,e])}}function rS(e,t){var n;const r=e.get(T),o=e.get(le),{state:i}=r,a=o(i.doc);let s="";if(!i.selection.empty){const{from:e,to:t}=i.selection,r=i.doc.slice(e,t),{schema:a}=i.doc.type;let l=a.topNodeType.createAndFill(null,r.content);if(!l){const e=null==(n=a.nodes.paragraph)?void 0:n.createAndFill(null,r.content);e&&(l=a.topNodeType.createAndFill(null,e))}s=l?o(l):i.doc.textBetween(e,t)}return{document:a,selection:s,instruction:t}}const oS=a({provider:void 0,buildContext:void 0,diffReviewOnEnd:!0,onError:e=>{console.error(`[milkdown/ai] [${e.code}]`,e)},aiIcon:void 0},"aiProviderConfig"),iS=a({abortController:null,label:"",lastInstruction:"",lastLabel:void 0,lastFrom:-1,lastTo:-1,diffOwnedByAI:!1},"aiSession");function aS(e,t){const n=e.get(oS.key);try{n.onError(t)}catch(r){console.error("[milkdown/ai] onError handler failed:",r)}}function sS(e){const t=e.get(iS.key);e.set(iS.key,{...t,abortController:null,label:""})}const lS=l("RunAI",e=>t=>(n,r)=>{var o,i,a,s;if(!(null==t?void 0:t.instruction))return!1;const l=e.get(oS.key);if(!l.provider)return!1;if(e.get(iS.key).abortController)return!1;if(null==(o=Yo.getState(n))?void 0:o.active)return!1;if(null==(i=no.getState(n))?void 0:i.active)return!1;if(!r)return!0;const c=new AbortController,{from:d,to:u}=n.selection;e.set(iS.key,{abortController:c,label:null!=(a=t.label)?a:"",lastInstruction:t.instruction,lastLabel:t.label,lastFrom:d,lastTo:u,diffOwnedByAI:!1});const h=e.get(g),p=n.selection.empty?"cursor":"selection";if(!h.call(Qo.key,{insertAt:p}))return sS(e),!1;let m;try{m=(null!=(s=l.buildContext)?s:rS)(e,t.instruction)}catch(f){const t=Me(f);return aS(e,t),h.call(ni.key,{keep:!1}),sS(e),!1}return async function(e,t,n,r){try{const o=t(n,r.signal),i=e.get(g);for await(const e of o){if(r.signal.aborted)break;i.call(ei.key,e)}if(r.signal.aborted)return;const a=e.get(oS.key);if(a.diffReviewOnEnd){const t=e.get(iS.key);e.set(iS.key,{...t,diffOwnedByAI:!0})}const s=i.call(ti.key,{diffReview:a.diffReviewOnEnd});if(a.diffReviewOnEnd&&!s){const t=e.get(iS.key);e.set(iS.key,{...t,diffOwnedByAI:!1})}}catch(f){if(r.signal.aborted)return;aS(e,Ie(f)),e.get(g).call(ni.key,{keep:!1})}finally{e.get(iS.key).abortController===r&&sS(e)}}(e,l.provider,m,c),!0}),cS=l("AbortAI",e=>t=>(n,r)=>{var o;const i=e.get(iS.key);return r?!!i.abortController&&(i.abortController.abort(),sS(e),(null==(o=Yo.getState(n))?void 0:o.active)&&e.get(g).call(ni.key,t),!0):!!i.abortController});var dS,uS,hS,pS,mS,fS,gS,vS,yS,bS,wS,xS,kS,CS,_S,SS,AS=e=>{throw TypeError(e)},MS=(e,t,n)=>t.has(e)||AS("Cannot "+n),TS=(e,t,n)=>(MS(e,t,"read from private field"),n?n.call(e):t.get(e)),ES=(e,t,n)=>t.has(e)?AS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),LS=(e,t,n,r)=>(MS(e,t,"write to private field"),t.set(e,n),n),OS=(e,t,n)=>(MS(e,t,"access private method"),n);const IS="milkdown-ai-diff-actions";function RS(e,t){e.innerHTML=An.sanitize(t.trim())}class PS{constructor(e,t,n){this.ctx=e,ES(this,yS),ES(this,dS),ES(this,uS),ES(this,hS),ES(this,pS),ES(this,mS,!1),ES(this,fS,!1),ES(this,gS,null),ES(this,vS,!1),ES(this,kS,()=>{const e=this.ctx.get(iS.key);if(!e.lastInstruction)return;if(!TS(this,vS)||!OS(this,yS,CS).call(this))return;const t=this.ctx.get(g);t.call(po.key);const n=this.ctx.get(T),{doc:r}=n.state,o=Math.min(Math.max(e.lastFrom,0),r.content.size),i=Math.min(Math.max(e.lastTo,0),r.content.size);n.dispatch(n.state.tr.setSelection(S.create(n.state.doc,o,i))),t.call(lS.key,{instruction:e.lastInstruction,label:e.lastLabel})}),ES(this,_S,()=>{this.ctx.get(g).call(po.key)}),ES(this,SS,()=>{this.ctx.get(g).call(ho.key)}),LS(this,pS,n),LS(this,uS,OS(this,yS,bS).call(this,t));const r=document.createElement("div");r.className=IS,r.dataset.show="false",LS(this,hS,OS(this,yS,wS).call(this,"retry",n.retryIcon,n.retryLabel,TS(this,kS))),r.appendChild(TS(this,hS)),r.appendChild(OS(this,yS,wS).call(this,"reject",n.rejectIcon,n.rejectAllLabel,TS(this,_S)));const o=OS(this,yS,wS).call(this,"accept",n.acceptIcon,n.acceptAllLabel,TS(this,SS));o.appendChild(OS(this,yS,xS).call(this)),r.appendChild(o),LS(this,dS,r),TS(this,uS).appendChild(r),this.update(t)}update(e){var t;const n=!!(null==(t=no.getState(e.state))?void 0:t.active);if(n!==TS(this,fS))if(LS(this,fS,n),n){const t=this.ctx.get(iS.key);LS(this,vS,t.diffOwnedByAI),LS(this,gS,e.state.doc)}else{LS(this,vS,!1),LS(this,gS,null);const e=this.ctx.get(iS.key);e.diffOwnedByAI&&this.ctx.set(iS.key,{...e,diffOwnedByAI:!1})}const r=n&&TS(this,vS);if(r!==TS(this,mS)&&(LS(this,mS,r),TS(this,dS).dataset.show=r?"true":"false"),r){const t=this.ctx.get(iS.key),n=!!TS(this,gS)&&e.state.doc.eq(TS(this,gS));TS(this,hS).disabled=!t.lastInstruction||!n}}destroy(){TS(this,dS).remove()}}dS=new WeakMap,uS=new WeakMap,hS=new WeakMap,pS=new WeakMap,mS=new WeakMap,fS=new WeakMap,gS=new WeakMap,vS=new WeakMap,yS=new WeakSet,bS=function(e){var t;return null!=(t=e.dom.closest(".milkdown"))?t:document.body},wS=function(e,t,n,r){const o=document.createElement("button");o.type="button",o.className=`${IS}-btn ${IS}-btn-${e}`,o.appendChild(function(e){const t=document.createElement("span");return t.className=`${IS}-icon`,RS(t,e),t}(t));const i=document.createElement("span");return i.textContent=n,o.appendChild(i),o.addEventListener("mousedown",e=>e.preventDefault()),o.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),r()}),o},xS=function(){const e=document.createElement("span");e.className=`${IS}-shortcut`;const t=document.createElement("span");t.textContent=TS(this,pS).modSymbol;const n=document.createElement("span");return n.className=`${IS}-shortcut-icon`,RS(n,TS(this,pS).enterKeyIcon),e.append(t,n),e},kS=new WeakMap,CS=function(){return!!TS(this,gS)&&this.ctx.get(T).state.doc.eq(TS(this,gS))},_S=new WeakMap,SS=new WeakMap;const BS=new d("CREPE_AI_DIFF_ACTIONS_PANEL"),zS=function(){var e,t,n,r;if("undefined"==typeof navigator)return"⌘";const o=navigator,i=null!=(r=null!=(n=null!=(t=null==(e=o.userAgentData)?void 0:e.platform)?t:o.platform)?n:o.userAgent)?r:"";return/mac|iphone|ipad|ipod/i.test(i)?"⌘":"Ctrl"}();var DS,NS,HS=e=>{throw TypeError(e)},qS=(e,t,n)=>t.has(e)||HS("Cannot "+n),jS=(e,t,n)=>(qS(e,t,"read from private field"),n?n.call(e):t.get(e)),VS=(e,t,n)=>t.has(e)?HS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),FS=(e,t,n,r)=>(qS(e,t,"write to private field"),t.set(e,n),n);function $S(e){const t={addItem:(n,r)=>(e.items.set(n,r),t),removeItem:n=>(e.items.delete(n),t),getItem:t=>e.items.get(t),clear:()=>(e.items.clear(),t)};return t}class WS{constructor(){VS(this,DS,[]),this.addItem=(e,t)=>(jS(this,NS).call(this,e),jS(this,DS).push({kind:"item",id:e,item:t}),this),this.addSubmenu=(e,t,n)=>{jS(this,NS).call(this,e);const r={def:t,items:new Map};return n&&n($S(r)),jS(this,DS).push({kind:"submenu",id:e,node:r}),this},this.removeItem=e=>(jS(this,NS).call(this,e),this),this.getItem=e=>{const t=jS(this,DS).find(t=>"item"===t.kind&&t.id===e);return"item"===(null==t?void 0:t.kind)?t.item:void 0},this.getSubmenu=e=>{const t=jS(this,DS).find(t=>"submenu"===t.kind&&t.id===e);return"submenu"===(null==t?void 0:t.kind)?$S(t.node):void 0},this.clear=()=>(FS(this,DS,[]),this),this.build=()=>{const e=[],t={};for(const n of jS(this,DS))"item"===n.kind?e.push({kind:"item",id:n.id,item:n.item}):(e.push({kind:"submenu",id:n.id,def:n.node.def}),t[n.id]={def:n.node.def,items:Array.from(n.node.items.entries()).map(([e,t])=>({id:e,item:t}))});return{main:e,submenus:t}},VS(this,NS,e=>{FS(this,DS,jS(this,DS).filter(t=>t.id!==e))})}}DS=new WeakMap,NS=new WeakMap;const US=fl({props:{placeholder:{type:Object,required:!0},resetSignal:{type:Object,required:!0},suggestions:{type:Object,required:!0},chrome:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({placeholder:e,resetSignal:t,suggestions:n,chrome:r,onConfirm:o,onCancel:i}){const a=vs(""),s=vs({kind:"main"}),l=vs(0),c=vs(null),d=vs(null),u=`ai-instruction-list-${Math.random().toString(36).slice(2,9)}`,h=e=>`${u}-opt-${e}`;ll(t,()=>{a.value="",s.value={kind:"main"},l.value=0});const p=pd(()=>{if("submenu"===s.value.kind){const e=n.submenus[s.value.id];return e?e.items.map(({id:e,item:t})=>({id:e,icon:t.icon,label:t.label,hasSubmenu:!1,prompt:{text:t.prompt,streamingLabel:t.streamingLabel}})):[]}return n.main.map(e=>"item"===e.kind?{id:e.id,icon:e.item.icon,label:e.item.label,hasSubmenu:!1,prompt:{text:e.item.prompt,streamingLabel:e.item.streamingLabel}}:{id:e.id,icon:e.def.icon,label:e.def.label,hasSubmenu:!0})}),m=pd(()=>{var e,t;return"submenu"!==s.value.kind?null:null!=(t=null==(e=n.submenus[s.value.id])?void 0:e.def)?t:null}),f=pd(()=>{const e=a.value.trim().toLowerCase();return e?p.value.filter(t=>t.label.toLowerCase().includes(e)):p.value}),g=pd(()=>a.value.trim().length>0),v=pd(()=>f.value.length+(g.value?1:0));ll([f,s,g],()=>{l.value=g.value?f.value.length:0});const y=()=>{Hs(()=>{var e;return null==(e=c.value)?void 0:e.focus()})},b=()=>{s.value={kind:"main"},a.value="",l.value=0,y()},w=e=>{e.hasSubmenu?(e=>{s.value={kind:"submenu",id:e},a.value="",l.value=0,y()})(e.id):e.prompt&&(o(e.prompt.text,e.prompt.streamingLabel),a.value="")},x=()=>{const e=a.value.trim();e&&(o(e),a.value="")},k=()=>{Hs(()=>{const e=d.value;if(!e)return;const t=e.querySelector(`[data-index="${l.value}"]`);null==t||t.scrollIntoView({block:"nearest"})})},C=e=>{if(e.stopPropagation(),"ArrowDown"===e.key){if(e.preventDefault(),0===v.value)return;return l.value=(l.value+1)%v.value,void k()}if("ArrowUp"===e.key){if(e.preventDefault(),0===v.value)return;return l.value=(l.value-1+v.value)%v.value,void k()}return"Enter"===e.key?(e.preventDefault(),void(()=>{const e=l.value,t=f.value;e<t.length?w(t[e]):g.value&&x()})()):"Escape"===e.key?(e.preventDefault(),void("submenu"===s.value.kind?b():i())):void("Backspace"===e.key&&""===a.value&&"submenu"===s.value.kind&&(e.preventDefault(),b()))},_=e=>{e.preventDefault()};return()=>{const t=f.value,n=g.value,o=m.value;return md("div",{class:"ai-instruction"},md("div",{class:"ai-instruction-input"},md("span",{class:"ai-instruction-input-prefix"},md(Vd,{icon:r.aiIcon})),md("input",{ref:c,class:"ai-instruction-input-field",role:"combobox","aria-expanded":"true","aria-autocomplete":"list","aria-controls":u,"aria-activedescendant":v.value>0?h(l.value):void 0,placeholder:o?o.searchPlaceholder:e.value,value:a.value,onInput:e=>{a.value=e.target.value},onKeydown:C}),md("button",{type:"button",class:"ai-instruction-submit","aria-label":r.submitButtonLabel,disabled:!n,onMousedown:_,onClick:x},md(Vd,{icon:r.sendIcon}))),md("div",{class:"ai-instruction-list",ref:d,id:u,role:"listbox","aria-label":r.listboxLabel},o&&md("button",{type:"button",class:"ai-instruction-back",onMousedown:_,onClick:b},md("span",{class:"ai-instruction-back-icon","aria-hidden":"true"},md(Vd,{icon:r.chevronLeftIcon})),md("span",null,o.title)),t.length>0&&md("div",{class:"ai-instruction-section"},md("div",{class:"ai-instruction-section-header"},r.suggestionsHeaderLabel),t.map((e,t)=>md("div",{key:e.id,id:h(t),"data-index":t,role:"option","aria-selected":t===l.value,class:["ai-instruction-item",t===l.value?"active":""],onMousedown:_,onClick:()=>w(e),onPointerenter:()=>{l.value=t}},md("span",{class:"ai-instruction-item-icon"},md(Vd,{icon:e.icon})),md("span",{class:"ai-instruction-item-label"},function(e,t){const n=t.trim();if(!n)return[e];const r=e.toLowerCase(),o=n.toLowerCase(),i=r.indexOf(o);return-1===i?[e]:[e.slice(0,i),md("mark",null,e.slice(i,i+n.length)),e.slice(i+n.length)]}(e.label,a.value)),e.hasSubmenu&&md("span",{class:"ai-instruction-item-arrow"},md(Vd,{icon:r.chevronRightIcon}))))),n&&md("div",{class:"ai-instruction-section"},md("div",{class:"ai-instruction-section-header"},r.sendAsPromptHeaderLabel),md("div",{id:h(t.length),"data-index":t.length,role:"option","aria-selected":l.value===t.length,class:["ai-instruction-item","ai-instruction-item-prompt",l.value===t.length?"active":""],onMousedown:_,onClick:x,onPointerenter:()=>{l.value=t.length}},md("span",{class:"ai-instruction-item-icon"},md(Vd,{icon:r.sendPromptIcon})),md("span",{class:"ai-instruction-item-label"},r.sendAsPromptLabel," ",md("span",{class:"ai-instruction-item-quote"},'"',a.value,'"')),md("span",{class:"ai-instruction-item-shortcut"},md(Vd,{icon:r.enterKeyIcon}))))))}}});var GS,ZS,XS,KS,YS,JS,QS,eA,tA,nA,rA=e=>{throw TypeError(e)},oA=(e,t,n)=>t.has(e)||rA("Cannot "+n),iA=(e,t,n)=>(oA(e,t,"read from private field"),n?n.call(e):t.get(e)),aA=(e,t,n)=>t.has(e)?rA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),sA=(e,t,n,r)=>(oA(e,t,"write to private field"),t.set(e,n),n);class lA{constructor(e,t,n){this.ctx=e,aA(this,GS),aA(this,ZS),aA(this,XS),aA(this,KS),aA(this,YS),aA(this,JS,-1),aA(this,QS,-1),aA(this,eA,!1),aA(this,tA,(e,t)=>{e.trim()&&this.ctx.get(g).call(lS.key,{instruction:e,label:t})&&(sA(this,eA,!1),iA(this,ZS).hide())}),aA(this,nA,()=>{sA(this,eA,!1),iA(this,ZS).hide()}),this.show=(e,t)=>{sA(this,JS,e),sA(this,QS,t),iA(this,YS).value++,sA(this,eA,!0);const n=this.ctx.get(T);iA(this,ZS).show({getBoundingClientRect:()=>_(n,e,t)},n),requestAnimationFrame(()=>{var e;null==(e=iA(this,GS).querySelector("input"))||e.focus()})},this.update=(e,t)=>{const{selection:n}=e.state,r=n instanceof S,o=n.from!==iA(this,JS)||n.to!==iA(this,QS);if(!r||o)return sA(this,eA,!1),void iA(this,ZS).hide();iA(this,ZS).update(e,t)},this.destroy=()=>{iA(this,XS).unmount(),iA(this,ZS).destroy(),iA(this,GS).remove()},sA(this,KS,vs(n.placeholder)),sA(this,YS,vs(0));const r=document.createElement("div");r.className="milkdown-ai-instruction";const o=jd(US,{placeholder:iA(this,KS),resetSignal:iA(this,YS),suggestions:n.suggestions,chrome:n.chrome,onConfirm:iA(this,tA),onCancel:iA(this,nA)});o.mount(r),sA(this,XS,o),sA(this,GS,r),sA(this,ZS,new oi({content:r,debounce:0,offset:10,shouldShow:()=>iA(this,eA),floatingUIOptions:{placement:"bottom"}})),iA(this,ZS).onHide=()=>{sA(this,eA,!1),requestAnimationFrame(()=>{try{const e=iA(this,GS).getRootNode().activeElement;if(!e||!iA(this,GS).contains(e))return;this.ctx.get(T).dom.focus({preventScroll:!0})}catch(AT){}})},iA(this,ZS).update(t)}}GS=new WeakMap,ZS=new WeakMap,XS=new WeakMap,KS=new WeakMap,YS=new WeakMap,JS=new WeakMap,QS=new WeakMap,eA=new WeakMap,tA=new WeakMap,nA=new WeakMap;const cA=a({show:()=>{}},"aiInstructionTooltipAPI"),dA=ii("CREPE_AI_INSTRUCTION");function uA(e){var t,n,r,o,i,a,s,l,c,d,u;return{aiIcon:null!=(t=null==e?void 0:e.aiIcon)?t:A_,sendIcon:null!=(n=null==e?void 0:e.sendIcon)?n:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M11 20V7.825l-5.6 5.6L4 12l8-8l8 8l-1.4 1.425l-5.6-5.6V20z"\n />\n </svg>\n',sendPromptIcon:null!=(r=null==e?void 0:e.sendPromptIcon)?r:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M3 20v-6l8-2l-8-2V4l19 8z"\n />\n </svg>\n',enterKeyIcon:null!=(o=null==e?void 0:e.enterKeyIcon)?o:D_,chevronLeftIcon:null!=(i=null==e?void 0:e.chevronLeftIcon)?i:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M15.75 19.5L8.25 12l7.5-7.5"\n />\n </svg>\n',chevronRightIcon:null!=(a=null==e?void 0:e.chevronRightIcon)?a:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M8.25 4.5l7.5 7.5-7.5 7.5"\n />\n </svg>\n',suggestionsHeaderLabel:null!=(s=null==e?void 0:e.suggestionsHeaderLabel)?s:"SUGGESTIONS",sendAsPromptHeaderLabel:null!=(l=null==e?void 0:e.sendAsPromptHeaderLabel)?l:"SEND AS PROMPT",sendAsPromptLabel:null!=(c=null==e?void 0:e.sendAsPromptLabel)?c:"Ask AI:",submitButtonLabel:null!=(d=null==e?void 0:e.submitButtonLabel)?d:"Send prompt",listboxLabel:null!=(u=null==e?void 0:e.listboxLabel)?u:"AI suggestions"}}var hA,pA,mA,fA,gA,vA,yA,bA=e=>{throw TypeError(e)},wA=(e,t,n)=>t.has(e)||bA("Cannot "+n),xA=(e,t,n)=>(wA(e,t,"read from private field"),n?n.call(e):t.get(e)),kA=(e,t,n)=>t.has(e)?bA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),CA=(e,t,n,r)=>(wA(e,t,"write to private field"),t.set(e,n),n);const _A="milkdown-ai-streaming",SA=new d("CREPE_AI_STREAMING_INDICATOR");class AA{constructor(e,t,n){kA(this,hA),kA(this,pA),kA(this,mA),kA(this,fA,performance.now()),kA(this,gA,""),kA(this,vA,0),kA(this,yA,()=>{const e=(performance.now()-xA(this,fA))/800*360;xA(this,hA).style.transform=`rotate(${e}deg)`,CA(this,vA,requestAnimationFrame(xA(this,yA)))}),CA(this,mA,t);const r=document.createElement("span");r.className=`${_A}-indicator`,r.contentEditable="false",r.setAttribute("role","status"),r.setAttribute("aria-live","polite");const o=document.createElement("span");o.className=`${_A}-spinner`,o.setAttribute("aria-hidden","true"),r.appendChild(o);const i=document.createElement("span");i.className=`${_A}-label`,r.appendChild(i);const a=document.createElement("span");a.className=`${_A}-esc`,a.textContent=n,r.appendChild(a),this.dom=r,CA(this,hA,o),CA(this,pA,i),this.setLabel(e),xA(this,yA).call(this)}setLabel(e){const t=`${e.get(iS.key).label||xA(this,mA)}…`;t!==xA(this,gA)&&(CA(this,gA,t),xA(this,pA).textContent=t)}destroy(){xA(this,vA)&&cancelAnimationFrame(xA(this,vA)),CA(this,vA,0)}}hA=new WeakMap,pA=new WeakMap,mA=new WeakMap,fA=new WeakMap,gA=new WeakMap,vA=new WeakMap,yA=new WeakMap;const MA=["table","image-block","code_block"],TA={heading:["id"]};function EA(e){return"code_block"===e.$from.parent.type.name}function LA(e){var t;const n=null==(t=e.$from.node(e.$from.depth-1))?void 0:t.type;return"list_item"===(null==n?void 0:n.name)}var OA,IA,RA=e=>{throw TypeError(e)},PA=(e,t,n)=>t.has(e)||RA("Cannot "+n),BA=(e,t,n)=>(PA(e,t,"read from private field"),n?n.call(e):t.get(e)),zA=(e,t,n)=>t.has(e)?RA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);class DA{constructor(){zA(this,OA,[]),this.clear=()=>(((e,t)=>{PA(e,t,"write to private field"),t.set(e,[])})(this,OA),this),zA(this,IA,e=>{const t={group:e,addItem:(n,r)=>{const o={...r,key:n};return e.items.push(o),t},clear:()=>(e.items=[],t)};return t}),this.addGroup=(e,t)=>{const n={key:e,label:t,items:[]};return BA(this,OA).push(n),BA(this,IA).call(this,n)},this.getGroup=e=>{const t=BA(this,OA).find(t=>t.key===e);if(!t)throw new Error(`Group with key ${e} not found`);return BA(this,IA).call(this,t)},this.build=()=>BA(this,OA)}}OA=new WeakMap,IA=new WeakMap;const NA=fl({props:{ctx:{type:Object,required:!0},show:{type:Object,required:!0},filter:{type:Object,required:!0},hide:{type:Function,required:!0},config:{type:Object,required:!1}},setup({ctx:e,show:t,filter:n,hide:r,config:o}){const i=vs(),a=pd(()=>function(e,t,n){var r,o,i,a,s,l,c,d,u,h,p,m,f,v,y,b,w,x,k,C,_,S,A,M,E,L,O,I,R,P,B,z,D,N,q,j,V,F,$,W,U,G,Z,K,Y,Q,ee,te,ne,re,oe,ie,ae,se,le,ce,de,ue,he,pe,me,fe,ge,ve,ye,be,we,xe,ke,Ce,_e,Se,Ae,Me,Te,Ee,Le,Oe,Ie,Re,Pe,Be,ze,De,Ze,Xe,Ke,Ye,Je,Qe,et,tt,nt,rt,ot,it,at,st,lt,ct,dt,ut,ht,pt,mt,ft,gt,vt,yt,bt,wt,xt,kt,Ct,_t,St,At,Mt,Tt;const Et=n&&tS(n).get(),Lt=null==Et?void 0:Et.includes(__.Latex),Ot=null==Et?void 0:Et.includes(__.ImageBlock),It=null==Et?void 0:Et.includes(__.Table),Rt=new DA;if(null!==(null==t?void 0:t.textGroup)){const e=Rt.addGroup("text",null!=(o=null==(r=null==t?void 0:t.textGroup)?void 0:r.label)?o:"Text");null!==(null==(i=null==t?void 0:t.textGroup)?void 0:i.text)&&e.addItem("text",{label:null!=(l=null==(s=null==(a=null==t?void 0:t.textGroup)?void 0:a.text)?void 0:s.label)?l:"Text",icon:null!=(u=null==(d=null==(c=null==t?void 0:t.textGroup)?void 0:c.text)?void 0:d.icon)?u:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5547)">\n <path\n d="M5 5.5C5 6.33 5.67 7 6.5 7H10.5V17.5C10.5 18.33 11.17 19 12 19C12.83 19 13.5 18.33 13.5 17.5V7H17.5C18.33 7 19 6.33 19 5.5C19 4.67 18.33 4 17.5 4H6.5C5.67 4 5 4.67 5 5.5Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5547">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=X.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n})}}),null!==(null==(h=null==t?void 0:t.textGroup)?void 0:h.h1)&&e.addItem("h1",{label:null!=(f=null==(m=null==(p=null==t?void 0:t.textGroup)?void 0:p.h1)?void 0:m.label)?f:"Heading 1",icon:null!=(b=null==(y=null==(v=null==t?void 0:t.textGroup)?void 0:v.h1)?void 0:y.icon)?b:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5553)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM12 17H14V7H10V9H12V17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5553">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:1}})}}),null!==(null==(w=null==t?void 0:t.textGroup)?void 0:w.h2)&&e.addItem("h2",{label:null!=(C=null==(k=null==(x=null==t?void 0:t.textGroup)?void 0:x.h2)?void 0:k.label)?C:"Heading 2",icon:null!=(A=null==(S=null==(_=null==t?void 0:t.textGroup)?void 0:_.h2)?void 0:S.icon)?A:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5559)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15H11V13H13C14.1 13 15 12.11 15 11V9C15 7.89 14.1 7 13 7H9V9H13V11H11C9.9 11 9 11.89 9 13V17H15V15Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5559">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:2}})}}),null!==(null==(M=null==t?void 0:t.textGroup)?void 0:M.h3)&&e.addItem("h3",{label:null!=(O=null==(L=null==(E=null==t?void 0:t.textGroup)?void 0:E.h3)?void 0:L.label)?O:"Heading 3",icon:null!=(P=null==(R=null==(I=null==t?void 0:t.textGroup)?void 0:I.h3)?void 0:R.icon)?P:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5565)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13.5C15 12.67 14.33 12 13.5 12C14.33 12 15 11.33 15 10.5V9C15 7.89 14.1 7 13 7H9V9H13V11H11V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5565">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:3}})}}),null!==(null==(B=null==t?void 0:t.textGroup)?void 0:B.h4)&&e.addItem("h4",{label:null!=(N=null==(D=null==(z=null==t?void 0:t.textGroup)?void 0:z.h4)?void 0:D.label)?N:"Heading 4",icon:null!=(V=null==(j=null==(q=null==t?void 0:t.textGroup)?void 0:q.h4)?void 0:j.icon)?V:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7757)">\n <path\n d="M19.04 3H5.04004C3.94004 3 3.04004 3.9 3.04004 5V19C3.04004 20.1 3.94004 21 5.04004 21H19.04C20.14 21 21.04 20.1 21.04 19V5C21.04 3.9 20.14 3 19.04 3ZM19.04 19H5.04004V5H19.04V19ZM13.04 17H15.04V7H13.04V11H11.04V7H9.04004V13H13.04V17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7757">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:4}})}}),null!==(null==(F=null==t?void 0:t.textGroup)?void 0:F.h5)&&e.addItem("h5",{label:null!=(U=null==(W=null==($=null==t?void 0:t.textGroup)?void 0:$.h5)?void 0:W.label)?U:"Heading 5",icon:null!=(K=null==(Z=null==(G=null==t?void 0:t.textGroup)?void 0:G.h5)?void 0:Z.icon)?K:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7760)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H9V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7760">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:5}})}}),null!==(null==(Y=null==t?void 0:t.textGroup)?void 0:Y.h6)&&e.addItem("h6",{label:null!=(te=null==(ee=null==(Q=null==t?void 0:t.textGroup)?void 0:Q.h6)?void 0:ee.label)?te:"Heading 6",icon:null!=(oe=null==(re=null==(ne=null==t?void 0:t.textGroup)?void 0:ne.h6)?void 0:re.icon)?oe:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7763)">\n <path\n d="M11 17H13C14.1 17 15 16.11 15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H11C9.9 7 9 7.89 9 9V15C9 16.11 9.9 17 11 17ZM11 13H13V15H11V13ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7763">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:6}})}}),null!==(null==(ie=null==t?void 0:t.textGroup)?void 0:ie.quote)&&e.addItem("quote",{label:null!=(le=null==(se=null==(ae=null==t?void 0:t.textGroup)?void 0:ae.quote)?void 0:se.label)?le:"Quote",icon:null!=(ue=null==(de=null==(ce=null==t?void 0:t.textGroup)?void 0:ce.quote)?void 0:de.icon)?ue:F_,onRun:e=>{const t=e.get(g),n=je.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n})}}),null!==(null==(he=null==t?void 0:t.textGroup)?void 0:he.divider)&&e.addItem("divider",{label:null!=(fe=null==(me=null==(pe=null==t?void 0:t.textGroup)?void 0:pe.divider)?void 0:me.label)?fe:"Divider",icon:null!=(ye=null==(ve=null==(ge=null==t?void 0:t.textGroup)?void 0:ge.divider)?void 0:ve.icon)?ye:P_,onRun:e=>{const t=e.get(g),n=Fe.type(e);t.call(Ne.key),t.call($e.key,{nodeType:n})}})}if(null!==(null==t?void 0:t.listGroup)){const e=Rt.addGroup("list",null!=(we=null==(be=null==t?void 0:t.listGroup)?void 0:be.label)?we:"List");null!==(null==(xe=null==t?void 0:t.listGroup)?void 0:xe.bulletList)&&e.addItem("bullet-list",{label:null!=(_e=null==(Ce=null==(ke=null==t?void 0:t.listGroup)?void 0:ke.bulletList)?void 0:Ce.label)?_e:"Bullet List",icon:null!=(Me=null==(Ae=null==(Se=null==t?void 0:t.listGroup)?void 0:Se.bulletList)?void 0:Ae.icon)?Me:T_,onRun:e=>{const t=e.get(g),n=We.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n})}}),null!==(null==(Te=null==t?void 0:t.listGroup)?void 0:Te.orderedList)&&e.addItem("ordered-list",{label:null!=(Oe=null==(Le=null==(Ee=null==t?void 0:t.listGroup)?void 0:Ee.orderedList)?void 0:Le.label)?Oe:"Ordered List",icon:null!=(Pe=null==(Re=null==(Ie=null==t?void 0:t.listGroup)?void 0:Ie.orderedList)?void 0:Re.icon)?Pe:j_,onRun:e=>{const t=e.get(g),n=Ue.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n})}}),null!==(null==(Be=null==t?void 0:t.listGroup)?void 0:Be.taskList)&&e.addItem("task-list",{label:null!=(Ze=null==(De=null==(ze=null==t?void 0:t.listGroup)?void 0:ze.taskList)?void 0:De.label)?Ze:"Task List",icon:null!=(Ye=null==(Ke=null==(Xe=null==t?void 0:t.listGroup)?void 0:Xe.taskList)?void 0:Ke.icon)?Ye:Z_,onRun:e=>{const t=e.get(g),n=H.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n,attrs:{checked:!1}})}})}if(null!==(null==t?void 0:t.advancedGroup)){const e=Rt.addGroup("advanced",null!=(Qe=null==(Je=null==t?void 0:t.advancedGroup)?void 0:Je.label)?Qe:"Advanced");null!==(null==(et=null==t?void 0:t.advancedGroup)?void 0:et.image)&&Ot&&e.addItem("image",{label:null!=(rt=null==(nt=null==(tt=null==t?void 0:t.advancedGroup)?void 0:tt.image)?void 0:nt.label)?rt:"Image",icon:null!=(at=null==(it=null==(ot=null==t?void 0:t.advancedGroup)?void 0:ot.image)?void 0:it.icon)?at:N_,onRun:e=>{const t=e.get(g),n=bu.type(e);t.call(Ne.key),t.call($e.key,{nodeType:n})}}),null!==(null==(st=null==t?void 0:t.advancedGroup)?void 0:st.codeBlock)&&e.addItem("code",{label:null!=(dt=null==(ct=null==(lt=null==t?void 0:t.advancedGroup)?void 0:lt.codeBlock)?void 0:ct.label)?dt:"Code",icon:null!=(pt=null==(ht=null==(ut=null==t?void 0:t.advancedGroup)?void 0:ut.codeBlock)?void 0:ht.icon)?pt:O_,onRun:e=>{const t=e.get(g),n=J.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n})}}),null!==(null==(mt=null==t?void 0:t.advancedGroup)?void 0:mt.table)&&It&&e.addItem("table",{label:null!=(vt=null==(gt=null==(ft=null==t?void 0:t.advancedGroup)?void 0:ft.table)?void 0:gt.label)?vt:"Table",icon:null!=(wt=null==(bt=null==(yt=null==t?void 0:t.advancedGroup)?void 0:yt.table)?void 0:bt.icon)?wt:G_,onRun:e=>{const t=e.get(g),n=e.get(T);t.call(Ne.key);const{from:r}=n.state.selection;t.call($e.key,{nodeType:up(e,3,3)}),t.call(Ge.key,{pos:r})}}),null!==(null==(xt=null==t?void 0:t.advancedGroup)?void 0:xt.math)&&Lt&&e.addItem("math",{label:null!=(_t=null==(Ct=null==(kt=null==t?void 0:t.advancedGroup)?void 0:kt.math)?void 0:Ct.label)?_t:"Math",icon:null!=(Mt=null==(At=null==(St=null==t?void 0:t.advancedGroup)?void 0:St.math)?void 0:At.icon)?Mt:K_,onRun:e=>{const t=e.get(g),n=J.type(e);t.call(Ne.key),t.call($e.key,{nodeType:n,attrs:{language:"LaTeX"}})}})}null==(Tt=null==t?void 0:t.buildMenu)||Tt.call(t,Rt);let Pt=Rt.build();e&&(Pt=Pt.map(t=>{const n=t.items.filter(t=>t.label.toLowerCase().includes(e.toLowerCase()));return{...t,items:n}}).filter(e=>e.items.length>0));const Bt=Pt.flatMap(e=>e.items);return Bt.forEach((e,t)=>{Object.assign(e,{index:t})}),Pt.reduce((e,t)=>{const n=e+t.items.length;return Object.assign(t,{range:[e,n]}),n},0),{groups:Pt,size:Bt.length}}(n.value,o,e)),s=vs(0),l=vs({x:-999,y:-999}),c=e=>{const{x:t,y:n}=e;l.value={x:t,y:n}};ll([a,t],()=>{const{size:e}=a.value;0===e&&t.value?r():s.value>=e&&(s.value=0)});const d=(e,t)=>{const n=s.value,r="function"==typeof e?e(n):e;null==t||t(r),s.value=r},u=e=>{var t,n;const r=null==(t=i.value)?void 0:t.querySelector(`[data-index="${e}"]`),o=null==(n=i.value)?void 0:n.querySelector(".menu-groups");r&&o&&(o.scrollTop=r.offsetTop-o.offsetTop)},h=t=>{const n=a.value.groups.flatMap(e=>e.items).at(t);(null==n?void 0:n.onRun)&&e&&n.onRun(e),r()},p=e=>{const{size:t,groups:n}=a.value;return"Escape"===e.key?(e.preventDefault(),void(null==r||r())):"ArrowDown"===e.key?(e.preventDefault(),d(e=>e<t-1?e+1:e,u)):"ArrowUp"===e.key?(e.preventDefault(),d(e=>e<=0?e:e-1,u)):"ArrowLeft"===e.key?(e.preventDefault(),d(e=>{const t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;const r=n[n.indexOf(t)-1];return r?r.range[1]-1:e},u)):"ArrowRight"===e.key?(e.preventDefault(),d(e=>{const t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;const r=n[n.indexOf(t)+1];return r?r.range[0]:e},u)):void("Enter"===e.key&&(e.preventDefault(),h(s.value)))},m=e=>t=>{const n=l.value;if(!n)return;const{x:r,y:o}=t;r===n.x&&o===n.y||d(e)};return sl(()=>{t.value?window.addEventListener("keydown",p,{capture:!0}):window.removeEventListener("keydown",p,{capture:!0})}),Pl(()=>{window.removeEventListener("keydown",p,{capture:!0})}),()=>md("div",{ref:i,onPointerdown:e=>e.preventDefault()},md("nav",{class:"tab-group"},md("ul",null,a.value.groups.map(e=>md("li",{key:e.key,onPointerdown:()=>d(e.range[0],u),class:s.value>=e.range[0]&&s.value<e.range[1]?"selected":""},e.label)))),md("div",{class:"menu-groups",onPointermove:c},a.value.groups.map(e=>md("div",{key:e.key,class:"menu-group"},md("h6",null,e.label),md("ul",null,e.items.map(e=>md("li",{key:e.key,"data-index":e.index,class:s.value===e.index?"hover":"",onPointerenter:m(e.index),onPointerdown:()=>{var t,n;null==(n=null==(t=i.value)?void 0:t.querySelector(`[data-index="${e.index}"]`))||n.classList.add("active")},onPointerup:()=>{var t,n;null==(n=null==(t=i.value)?void 0:t.querySelector(`[data-index="${e.index}"]`))||n.classList.remove("active"),h(e.index)}},md(Vd,{icon:e.icon}),md("span",null,e.label))))))))}});var HA,qA,jA,VA,FA,$A=e=>{throw TypeError(e)},WA=(e,t,n)=>t.has(e)||$A("Cannot "+n),UA=(e,t,n)=>(WA(e,t,"read from private field"),n?n.call(e):t.get(e)),GA=(e,t,n)=>t.has(e)?$A("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ZA=(e,t,n,r)=>(WA(e,t,"write to private field"),t.set(e,n),n);const XA=function(e){const t=a({},`${e}_SLASH_SPEC`),n=s(n=>{const r=n.get(t.key);return new c({key:new d(`${e}_SLASH`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-slash",displayName:`Ctx<slashSpec>|${e}`},n.meta={package:"@milkdown/plugin-slash",displayName:`Prose<slash>|${e}`},r}("CREPE_MENU"),KA=a({show:()=>{},hide:()=>{}},"menuAPICtx");class YA{constructor(e,t,n){GA(this,HA),GA(this,qA),GA(this,jA),GA(this,VA),GA(this,FA,null),this.update=e=>{UA(this,VA).update(e)},this.show=e=>{ZA(this,FA,e),UA(this,jA).value="",UA(this,VA).show()},this.hide=()=>{ZA(this,FA,null),UA(this,VA).hide()},this.destroy=()=>{UA(this,VA).destroy(),UA(this,qA).unmount(),UA(this,HA).remove()};const r=document.createElement("div");r.classList.add("milkdown-slash-menu");const o=vs(!1),i=vs("");ZA(this,jA,i);const a=this.hide,s=jd(NA,{ctx:e,config:n,show:o,filter:i,hide:a});ZA(this,qA,s),s.mount(r),ZA(this,HA,r);const l=this;ZA(this,VA,new Qd({content:UA(this,HA),debounce:20,shouldShow(e){if(EA(e.state.selection)||LA(e.state.selection))return!1;const t=this.getContent(e,e=>["paragraph","heading"].includes(e.type.name));if(null==t)return!1;if(!function(e){if(!(e instanceof S))return!1;const{$head:t}=e,n=t.parent;return t.parentOffset===n.content.size}(e.state.selection))return!1;const n=UA(l,FA);if(i.value=t.startsWith("/")?t.slice(1):t,"number"==typeof n){const t=e.state.doc.nodeSize-2,r=Math.min(n,t);return e.state.doc.resolve(r).node()===e.state.doc.resolve(e.state.selection.from).node()||(ZA(l,FA,null),!1)}return!!t.startsWith("/")},offset:10})),UA(this,VA).onShow=()=>{o.value=!0},UA(this,VA).onHide=()=>{o.value=!1},this.update(t),e.set(KA.key,{show:e=>this.show(e),hide:()=>this.hide()})}}HA=new WeakMap,qA=new WeakMap,jA=new WeakMap,VA=new WeakMap,FA=new WeakMap;const JA=fl({props:{onAdd:{type:Function,required:!0},addIcon:{type:String,required:!0},handleIcon:{type:String,required:!0}},setup(e){const t=vs();return()=>md(Nc,null,md("div",{ref:t,class:"operation-item",onPointerdown:e=>{var n;e.preventDefault(),e.stopPropagation(),null==(n=t.value)||n.classList.add("active")},onPointerup:n=>{var r;n.preventDefault(),n.stopPropagation(),null==(r=t.value)||r.classList.remove("active"),e.onAdd()}},md(Vd,{icon:e.addIcon})),md("div",{class:"operation-item"},md(Vd,{icon:e.handleIcon})))}});var QA,eM,tM,nM,rM=e=>{throw TypeError(e)},oM=(e,t,n)=>t.has(e)||rM("Cannot "+n),iM=(e,t,n)=>(oM(e,t,"read from private field"),n?n.call(e):t.get(e)),aM=(e,t,n)=>t.has(e)?rM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),sM=(e,t,n,r)=>(oM(e,t,"write to private field"),t.set(e,n),n);class lM{constructor(e,t){var n,r,o;aM(this,QA),aM(this,eM),aM(this,tM),aM(this,nM),this.update=()=>{iM(this,eM).update()},this.destroy=()=>{iM(this,eM).destroy(),iM(this,QA).remove(),iM(this,tM).unmount()},this.onAdd=()=>{const e=iM(this,nM),t=e.get(T);t.hasFocus()||t.focus();const{state:n,dispatch:r}=t,o=iM(this,eM).active;if(!o)return;const i=o.$pos.pos+o.node.nodeSize;let a=n.tr.insert(i,X.type(e).create());a=a.setSelection(S.near(a.doc.resolve(i))),r(a.scrollIntoView()),iM(this,eM).hide(),e.get(KA.key).show(a.selection.from)},sM(this,nM,e);const i=document.createElement("div");i.classList.add("milkdown-block-handle");const a=jd(JA,{onAdd:this.onAdd,addIcon:null!=(n=null==t?void 0:t.handleAddIcon)?n:V_,handleIcon:null!=(r=null==t?void 0:t.handleDragIcon)?r:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_971_7680)">\n <path\n d="M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_971_7680">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n'});a.mount(i),sM(this,tM,a),sM(this,QA,i);const s=null!=(o=null==t?void 0:t.blockHandle)?o:{};sM(this,eM,new Yd({ctx:e,content:i,getOffset:()=>16,getPlacement:({active:e,blockDom:t})=>{if("heading"===e.node.type.name)return"left";let n=0;e.node.descendants(e=>{n+=e.childCount});const r=e.el,o=r.getBoundingClientRect(),i=t.getBoundingClientRect(),a=window.getComputedStyle(r),s=Number.parseInt(a.paddingTop,10)||0,l=Number.parseInt(a.paddingBottom,10)||0,c=o.height-s-l,d=i.height;return n>2||d<c?"left-start":"left"},...s})),this.update()}}QA=new WeakMap,eM=new WeakMap,tM=new WeakMap,nM=new WeakMap;const cM=J.extendSchema(e=>t=>{const n=e(t);return{...n,toMarkdown:{match:n.toMarkdown.match,runner:(e,t)=>{var r,o;if("latex"!==(null!=(r=t.attrs.language)?r:"").toLowerCase())return n.toMarkdown.runner(e,t);e.addNode("math",void 0,(null==(o=t.content.firstChild)?void 0:o.text)||"")}}}}),dM="math_inline",uM=I(dM,()=>({group:"inline",inline:!0,draggable:!0,atom:!0,attrs:{value:{default:""}},parseDOM:[{tag:`span[data-type="${dM}"]`,getAttrs:e=>{var t;return{value:null!=(t=e.dataset.value)?t:""}}}],toDOM:e=>{const t=e.attrs.value,n=document.createElement("span");return n.dataset.type=dM,n.dataset.value=t,Hx.render(t,n,{throwOnError:!1}),n},parseMarkdown:{match:e=>"inlineMath"===e.type,runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>e.type.name===dM,runner:(e,t)=>{e.addNode("inlineMath",void 0,t.attrs.value)}}})),hM=l("ToggleLatex",e=>()=>(t,n)=>{const{hasNode:r,pos:o,target:i}=Oe(t,uM.type(e)),{selection:a,doc:s,tr:l}=t;if(!r){const t=s.textBetween(a.from,a.to);let r=l.replaceSelectionWith(uM.type(e).create({value:t}));return n&&n(r.setSelection(M.create(r.doc,a.from))),!0}const{from:c,to:d}=a;if(!i||o<0)return!1;let u=l.delete(o,o+1);const h=i.attrs.value;return u=u.insertText(h,o),n&&n(u.setSelection(S.create(u.doc,c,d+h.length-1))),!0}),pM=ii("INLINE_LATEX"),mM=fl({props:{config:{type:Object,required:!0},innerView:{type:Object,required:!0},updateValue:{type:Object,required:!0}},setup(e){const t=t=>{if(t&&t instanceof HTMLElement){for(;t.firstChild;)t.removeChild(t.firstChild);e.innerView.value&&t.appendChild(e.innerView.value.dom)}},n=t=>{t.preventDefault(),e.updateValue.value()};return()=>md("div",{class:"container"},e.innerView&&md("div",{ref:t}),md("button",{type:"button",onPointerdown:n},md(Vd,{icon:e.config.inlineEditConfirm})))}});var fM,gM,vM,yM,bM,wM,xM,kM,CM=e=>{throw TypeError(e)},_M=(e,t,n)=>t.has(e)||CM("Cannot "+n),SM=(e,t,n)=>(_M(e,t,"read from private field"),n?n.call(e):t.get(e)),AM=(e,t,n)=>t.has(e)?CM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),MM=(e,t,n,r)=>(_M(e,t,"write to private field"),t.set(e,n),n);class TM{constructor(e,t,n){this.ctx=e,AM(this,fM),AM(this,gM),AM(this,vM),AM(this,yM,ys(null)),AM(this,bM,ys(()=>{})),AM(this,wM),AM(this,xM,()=>{SM(this,yM).value&&(SM(this,yM).value.destroy(),SM(this,yM).value=null)}),AM(this,kM,e=>{const t=(()=>{if(!e.editable)return!1;const{selection:t,schema:n}=e.state;if(t.empty)return!1;if(!(t instanceof M))return!1;const r=t.node;if(r.type.name!==dM)return!1;const o=t.from,i=n.nodes.paragraph.create(null,n.text(r.attrs.value)),a=new Re(SM(this,vM),{state:Pe.create({doc:i,schema:new ze({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},text:{group:"inline"}}}),plugins:[Be({"Mod-z":Q,"Mod-Z":ee,"Mod-y":ee,Enter:()=>(SM(this,bM).value(),!0)})]})});return SM(this,yM).value=a,SM(this,bM).value=()=>{const{tr:t}=e.state;t.setNodeAttribute(o,"value",a.state.doc.textContent),e.dispatch(t),requestAnimationFrame(()=>{e.focus()})},!0})();return t||SM(this,xM).call(this),t}),this.update=(e,t)=>{SM(this,gM).update(e,t)},this.destroy=()=>{SM(this,wM).unmount(),SM(this,gM).destroy(),SM(this,fM).remove()};const r=document.createElement("div");r.className="milkdown-latex-inline-edit",MM(this,fM,r),MM(this,wM,jd(mM,{config:n,innerView:SM(this,yM),updateValue:SM(this,bM)})),SM(this,wM).mount(r),MM(this,gM,new oi({debounce:0,content:SM(this,fM),shouldShow:SM(this,kM),offset:10,floatingUIOptions:{placement:"bottom"}})),SM(this,gM).update(t),MM(this,vM,document.createElement("div"))}}fM=new WeakMap,gM=new WeakMap,vM=new WeakMap,yM=new WeakMap,bM=new WeakMap,wM=new WeakMap,xM=new WeakMap,kM=new WeakMap;const EM=V(e=>Ee(/(?:\$)([^$]+)(?:\$)$/,uM.type(e),{getAttr:e=>{var t;return{value:null!=(t=e[1])?t:""}}})),LM=V(e=>Le(/^\$\$[\s\n]$/,J.type(e),()=>({language:"LaTeX"}))),OM=O("remarkMath",()=>Te);function IM(e){return Et(e,"math",(e,t,n)=>{const{value:r}=e,o={type:"code",lang:"LaTeX",value:r};n.children.splice(t,1,o)})}const RM=O("remarkMathBlock",()=>()=>IM),PM=a({text:"Please enter...",mode:"block"},"placeholderConfigCtx"),BM=s(e=>new c({key:new d("CREPE_PLACEHOLDER"),props:{decorations:t=>{var n;const r=function(e){return e.get("CrepeCtx")}(e);if(r.readonly)return null;const o=e.get(PM.key);if("doc"===o.mode&&!function(e){var t;return e.childCount<=1&&!(null==(t=e.firstChild)?void 0:t.content.size)}(t.doc))return null;if(EA(t.selection)||LA(t.selection))return null;const i=function(e,t){const{selection:n}=e;if(!n.empty)return null;const r=n.$anchor,o=r.parent;if(o.content.size>0)return null;if(A(e=>"table"===e.type.name)(r))return null;const i=r.before();return v.node(i,i+o.nodeSize,{class:"crepe-placeholder","data-placeholder":t})}(t,null!=(n=o.text)?n:"Please enter...");return i?f.create(t.doc,[i]):null}}})),zM=fl({props:{ctx:{type:Object,required:!0},hide:{type:Function,required:!0},show:{type:Object,required:!0},selection:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){const{ctx:t,config:n}=e,r=e=>n=>{n.preventDefault(),t&&(null==e||e(t))};function o(n){return e.selection.value,t.get(De).status===xe.Created&&n(t)}const i=pd(()=>function(e,t){var n,r,o,i,a,s,l,c,d;const u=new DA;u.addGroup("formatting","Formatting").addItem("bold",{icon:null!=(n=null==e?void 0:e.boldIcon)?n:M_,active:e=>e.get(g).call(Xe.key,Ke.type(e)),onRun:e=>{e.get(g).call(Ze.key)}}).addItem("italic",{icon:null!=(r=null==e?void 0:e.italicIcon)?r:H_,active:e=>e.get(g).call(Xe.key,Je.type(e)),onRun:e=>{e.get(g).call(Ye.key)}}).addItem("strikethrough",{icon:null!=(o=null==e?void 0:e.strikethroughIcon)?o:U_,active:e=>e.get(g).call(Xe.key,tp.type(e)),onRun:e=>{e.get(g).call(np.key)}});const h=u.addGroup("function","Function");h.addItem("code",{icon:null!=(i=null==e?void 0:e.codeIcon)?i:O_,active:e=>e.get(g).call(Xe.key,et.type(e)),onRun:e=>{e.get(g).call(Qe.key)}});const p=t&&tS(t).get();if((null==p?void 0:p.includes(__.Latex))&&h.addItem("latex",{icon:null!=(a=null==e?void 0:e.latexIcon)?a:K_,active:e=>{const t=e.get(g),n=e.get(ae).nodes[dM];return t.call(tt.key,n)},onRun:e=>{e.get(g).call("ToggleLatex")}}),h.addItem("link",{icon:null!=(s=null==e?void 0:e.linkIcon)?s:q_,active:e=>e.get(g).call(Xe.key,oe.type(e)),onRun:e=>{e.get(g).call(nk.key)}}),t&&(null==p?void 0:p.includes(__.AI))){const n=t.get(oS.key);n.provider&&h.addItem("ai",{icon:null!=(c=null!=(l=null==e?void 0:e.aiIcon)?l:n.aiIcon)?c:A_,active:()=>!1,onRun:e=>{const t=e.get(cA.key),n=e.get(T),{from:r,to:o}=n.state.selection;t.show(r,o)}})}return null==(d=null==e?void 0:e.buildToolbar)||d.call(e,u),u.build()}(n,t));return()=>md(Nc,null,i.value.map(e=>e.items.map(e=>md("button",{type:"button",class:On("toolbar-item",t&&o(e.active)&&"active"),onPointerdown:r(e.onRun)},md(Vd,{icon:e.icon})))).reduce((e,t,n)=>(0===n?e.push(...t):e.push(md("div",{class:"divider"}),...t),e),[]))}});var DM,NM,HM,qM,jM,VM=e=>{throw TypeError(e)},FM=(e,t,n)=>t.has(e)||VM("Cannot "+n),$M=(e,t,n)=>(FM(e,t,"read from private field"),n?n.call(e):t.get(e)),WM=(e,t,n)=>t.has(e)?VM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),UM=(e,t,n,r)=>(FM(e,t,"write to private field"),t.set(e,n),n);const GM=ii("CREPE_TOOLBAR");class ZM{constructor(e,t,n){WM(this,DM),WM(this,NM),WM(this,HM),WM(this,qM),WM(this,jM,vs(!1)),this.update=(e,t)=>{$M(this,DM).update(e,t),$M(this,qM).value=e.state.selection},this.destroy=()=>{$M(this,DM).destroy(),$M(this,HM).unmount(),$M(this,NM).remove()},this.hide=()=>{$M(this,DM).hide()};const r=document.createElement("div");r.className="milkdown-toolbar",UM(this,qM,ys(t.state.selection));const o=jd(zM,{ctx:e,hide:this.hide,config:n,selection:$M(this,qM),show:$M(this,jM)});o.mount(r),UM(this,NM,r),UM(this,HM,o),UM(this,DM,new oi({content:$M(this,NM),debounce:20,offset:10,shouldShow(e){const{doc:t,selection:n}=e.state,{empty:o,from:i,to:a}=n,s=!t.textBetween(i,a).length&&n instanceof S,l=!(n instanceof S),c=e.dom.getRootNode().activeElement,d=r.contains(c),u=!e.hasFocus()&&!d,h=!e.editable;return!(u||l||o||s||h)}})),$M(this,DM).onShow=()=>{$M(this,jM).value=!0},$M(this,DM).onHide=()=>{$M(this,jM).value=!1},this.update(t)}}DM=new WeakMap,NM=new WeakMap,HM=new WeakMap,qM=new WeakMap,jM=new WeakMap;const XM=[{label:"Paragraph",level:null},{label:"Heading 1",level:1},{label:"Heading 2",level:2},{label:"Heading 3",level:3},{label:"Heading 4",level:4},{label:"Heading 5",level:5},{label:"Heading 6",level:6}];function KM(e,t){if(e.get(g).call(Xe.key,t))return!0;const n=e.get(T),{state:r}=n;if(r.storedMarks)return r.storedMarks.some(e=>e.type===t);if(r.selection instanceof S){const{$cursor:e}=r.selection;if(e)return e.marks().some(e=>e.type===t)}return!1}function YM(e,t){const n=null!=e?e:XM;return{icon:"",active:()=>!1,selector:{chevronIcon:null!=t?t:E_,activeLabel:e=>function(e,t){var n,r;const o=null!=t?t:XM,i=e.get(T),{$from:a}=i.state.selection,s=a.parent,l=null!=(n=o.find(e=>null===e.level))?n:o[0];if(s.type===qe.type(e)){const e=s.attrs.level;return null!=(r=o.find(t=>t.level===e))?r:l}return l}(e,n).label,options:n.map(e=>({label:e.label,onSelect:t=>function(e,t){const n=e.get(g);if(null==t){const t=X.type(e);n.call(He.key,{nodeType:t})}else{const r=qe.type(e);n.call(He.key,{nodeType:r,attrs:{level:t}})}}(t,e.level)}))}}}const JM=fl({props:{ctx:{type:Object,required:!0},version:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){const{ctx:t,config:n}=e,r=vs(null),o=e=>n=>{n.preventDefault(),t&&e(t)};function i(){return t.get(De).status===xe.Created}function a(){e.version.value}function s(e){return a(),!!i()&&e(t)}const l=e=>{e.target.closest(".top-bar-heading-selector")||(r.value=null)};Ll(()=>{window.addEventListener("pointerdown",l)}),Pl(()=>{window.removeEventListener("pointerdown",l)});const c=pd(()=>function(e,t){var n,r,o,i,a,s,l,c,d,u,h,p,m,f,v;const y=t&&tS(t).get(),b=null==y?void 0:y.includes(__.Latex),w=null==y?void 0:y.includes(__.ImageBlock),x=null==y?void 0:y.includes(__.Table),k=new DA;k.addGroup("heading","Heading").addItem("heading-selector",{...YM(null==e?void 0:e.headingOptions,null==e?void 0:e.chevronDownIcon)}),k.addGroup("formatting","Formatting").addItem("bold",{icon:null!=(n=null==e?void 0:e.boldIcon)?n:M_,active:e=>KM(e,Ke.type(e)),onRun:e=>{e.get(g).call(Ze.key)}}).addItem("italic",{icon:null!=(r=null==e?void 0:e.italicIcon)?r:H_,active:e=>KM(e,Je.type(e)),onRun:e=>{e.get(g).call(Ye.key)}}).addItem("strikethrough",{icon:null!=(o=null==e?void 0:e.strikethroughIcon)?o:U_,active:e=>KM(e,tp.type(e)),onRun:e=>{e.get(g).call(np.key)}}).addItem("code",{icon:null!=(i=null==e?void 0:e.codeIcon)?i:O_,active:e=>KM(e,et.type(e)),onRun:e=>{const t=e.get(T),{state:n}=t;if(n.selection.empty){const r=et.type(e);KM(e,r)?t.dispatch(n.tr.removeStoredMark(r)):t.dispatch(n.tr.addStoredMark(r.create()))}else e.get(g).call(Qe.key)}}),k.addGroup("list","List").addItem("bullet-list",{icon:null!=(a=null==e?void 0:e.bulletListIcon)?a:T_,active:()=>!1,onRun:e=>{const t=e.get(g),n=We.type(e);t.call(Ve.key,{nodeType:n})}}).addItem("ordered-list",{icon:null!=(s=null==e?void 0:e.orderedListIcon)?s:j_,active:()=>!1,onRun:e=>{const t=e.get(g),n=Ue.type(e);t.call(Ve.key,{nodeType:n})}}).addItem("task-list",{icon:null!=(l=null==e?void 0:e.taskListIcon)?l:Z_,active:()=>!1,onRun:e=>{const t=e.get(g),n=H.type(e);t.call(Ve.key,{nodeType:n,attrs:{checked:!1}})}});const C=k.addGroup("insert","Insert");C.addItem("link",{icon:null!=(c=null==e?void 0:e.linkIcon)?c:q_,active:e=>KM(e,oe.type(e)),onRun:e=>{const t=e.get(T),{state:n}=t,r=oe.type(e);n.selection.empty&&KM(e,r)?t.dispatch(n.tr.removeStoredMark(r)):e.get(g).call(nk.key)}}),w&&C.addItem("image",{icon:null!=(d=null==e?void 0:e.imageIcon)?d:N_,active:()=>!1,onRun:e=>{const t=e.get(g),n=bu.type(e);t.call($e.key,{nodeType:n})}}),x&&C.addItem("table",{icon:null!=(u=null==e?void 0:e.tableIcon)?u:G_,active:()=>!1,onRun:e=>{const t=e.get(g),n=e.get(T),{from:r}=n.state.selection;t.call($e.key,{nodeType:up(e,3,3)}),t.call(Ge.key,{pos:r})}});const _=k.addGroup("block","Block");return _.addItem("code-block",{icon:null!=(h=null==e?void 0:e.codeBlockIcon)?h:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm8 10h6v2h-6v-2zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243-1.415-1.415L8.667 12z"\n />\n </svg>\n',active:()=>!1,onRun:e=>{const t=e.get(g),n=J.type(e);t.call(He.key,{nodeType:n})}}),b&&_.addItem("math",{icon:null!=(p=null==e?void 0:e.mathIcon)?p:K_,active:()=>!1,onRun:e=>{const t=e.get(g),n=J.type(e);t.call($e.key,{nodeType:n,attrs:{language:"LaTeX"}})}}),k.addGroup("more","More").addItem("quote",{icon:null!=(m=null==e?void 0:e.quoteIcon)?m:F_,active:()=>!1,onRun:e=>{const t=e.get(g),n=je.type(e);t.call(Ve.key,{nodeType:n})}}).addItem("hr",{icon:null!=(f=null==e?void 0:e.hrIcon)?f:P_,active:()=>!1,onRun:e=>{const t=e.get(g),n=Fe.type(e);t.call($e.key,{nodeType:n})}}),null==(v=null==e?void 0:e.buildTopBar)||v.call(e,k),k.build()}(n,t));return()=>{const e=i()?t.get(T):null;return e&&!e.editable?null:md("div",{class:"top-bar-inner"},c.value.map(e=>e.items.map(e=>e.selector?function(e,n){const o=r.value===e,s=function(e){var n,r;return a(),i()?e.activeLabel(t):null!=(r=null==(n=e.options[0])?void 0:n.label)?r:""}(n);return md("div",{key:e,class:"top-bar-heading-selector"},md("button",{type:"button",class:"top-bar-heading-button",onPointerdown:t=>function(e,t){t.preventDefault(),t.stopPropagation(),r.value=r.value===e?null:e}(e,t)},md("span",{class:"top-bar-heading-label"},s),n.chevronIcon&&md("span",{class:"top-bar-chevron"},md(Vd,{icon:n.chevronIcon}))),o&&md("div",{class:"top-bar-heading-dropdown"},n.options.map((n,o)=>md("button",{key:`${e}-${o}`,type:"button",class:On("top-bar-heading-option",s===n.label&&"active"),onPointerdown:e=>{e.preventDefault(),e.stopPropagation(),r.value=null,n.onSelect(t)}},n.label))))}(e.key,e.selector):e.onRun?function(e){return md("button",{key:e.key,type:"button",class:On("top-bar-item",s(e.active)&&"active"),onPointerdown:o(e.onRun)},md(Vd,{icon:e.icon}))}(e):null)).reduce((e,t,n)=>{var r,o;if(0===n)e.push(...t);else{const i=null!=(o=null==(r=c.value[n])?void 0:r.key)?o:n;e.push(md("div",{key:`divider-${i}`,class:"top-bar-divider"}),...t)}return e},[]))}}});var QM,eT,tT,nT=e=>{throw TypeError(e)},rT=(e,t,n)=>t.has(e)||nT("Cannot "+n),oT=(e,t,n)=>(rT(e,t,"read from private field"),n?n.call(e):t.get(e)),iT=(e,t,n)=>t.has(e)?nT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),aT=(e,t,n,r)=>(rT(e,t,"write to private field"),t.set(e,n),n);const sT=new d("CREPE_TOP_BAR");class lT{constructor(e,t,n){iT(this,QM),iT(this,eT),iT(this,tT),this.update=(e,t)=>{oT(this,QM).style.display=e.editable?"":"none",oT(this,tT).value++},this.destroy=()=>{oT(this,eT).unmount(),oT(this,QM).remove()},aT(this,tT,vs(0));const r=document.createElement("div");r.className="milkdown-top-bar";const o=jd(JM,{ctx:e,config:n,version:oT(this,tT)});o.mount(r),aT(this,QM,r),aT(this,eT,o);const i=t.dom.parentElement;i&&i.insertBefore(r,i.firstChild),this.update(t)}}QM=new WeakMap,eT=new WeakMap,tT=new WeakMap;const cT=a({view:()=>({update:()=>{},destroy:()=>{}})},"topBarConfig"),dT=s(e=>{const t=e.get(cT.key);return new c({key:sT,view:t.view})});var uT,hT,pT,mT=e=>{throw TypeError(e)},fT=(e,t,n)=>t.has(e)||mT("Cannot "+n),gT=(e,t,n)=>(fT(e,t,"read from private field"),n?n.call(e):t.get(e)),vT=(e,t,n)=>t.has(e)?mT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),yT=(e,t,n,r)=>(fT(e,t,"write to private field"),t.set(e,n),n);class bT{constructor({root:e,defaultValue:t=""}={}){var n;vT(this,uT),vT(this,hT),vT(this,pT,!0),this.addFeature=(e,t)=>(e(gT(this,uT),t),this),this.create=()=>gT(this,uT).create(),this.destroy=()=>gT(this,uT).destroy(),this.setReadonly=e=>(yT(this,pT,!e),gT(this,uT).action(t=>{gT(this,uT).status===xe.Created&&t.get(T).setProps({editable:()=>!e})}),this),this.getMarkdown=()=>gT(this,uT).action(ke()),this.on=e=>gT(this,uT).status!==xe.Created?(gT(this,uT).config(t=>{const n=t.get(f_);e(n)}),this):(gT(this,uT).action(t=>{const n=t.get(f_);e(n)}),this),yT(this,hT,null!=(n="string"==typeof e?document.querySelector(e):e)?n:document.body),yT(this,uT,Ce.make().config(e=>{e.inject(eS,this),e.inject(Q_,[])}).config(e=>{e.set(_e,gT(this,hT)),e.set(Se,t),e.set(se,{editable:()=>gT(this,pT)}),e.update(u_.key,e=>({...e,size:4})),e.update(x_.key,e=>({...e,uploader:async(e,t,n)=>{const r=tS(n).get().includes(__.ImageBlock),o=r?t.nodes["image-block"]:t.nodes.image;if(!o)return[];const i=r?n.get(cu.key).onUpload:void 0,a=[];for(let s=0;s<e.length;s++){const t=e.item(s);t&&t.type.includes("image")&&a.push(t)}return await Promise.all(a.map(async e=>{const t=i?await i(e):URL.createObjectURL(e);return o.createAndFill({src:t})}))}}))}).use(Ae).use(v_).use(d_).use(p_).use(w_).use(r_).use(C_).use(Yp))}get editor(){return gT(this,uT)}get readonly(){return!gT(this,pT)}}uT=new WeakMap,hT=new WeakMap,pT=new WeakMap;class wT extends bT{constructor({features:e={},featureConfigs:t={},...n}={}){super(n);const r=gr(t,J_);Object.entries({...S_,...e}).filter(([,e])=>e).map(([e])=>e).forEach(e=>{const t=r[e];!function(e,t,n){switch(e){case __.CodeMirror:return((e,t={})=>{e.config(nS(__.CodeMirror)).config(e=>{const{languages:n=[],theme:r}=t,o=[Ht.of(xn.concat(_n)),$f];r&&o.push(r),t.extensions&&o.push(...t.extensions),e.update(im.key,e=>{var r;return{extensions:o,languages:n,expandIcon:t.expandIcon||E_,searchIcon:t.searchIcon||W_,clearSearchIcon:t.clearSearchIcon||L_,searchPlaceholder:t.searchPlaceholder||"Search language",copyText:t.copyText||"Copy",copyIcon:t.copyIcon||R_,onCopy:t.onCopy||(()=>{}),noResultText:t.noResultText||"No result",renderLanguage:t.renderLanguage||e.renderLanguage,renderPreview:t.renderPreview||e.renderPreview,previewToggleButton:e=>{var n,r;return[(null==(n=t.previewToggleIcon)?void 0:n.call(t,e))||(e?z_:Y_),(null==(r=t.previewToggleText)?void 0:r.call(t,e))||(e?"Edit":"Hide")].map(e=>e.trim()).join(" ")},previewLabel:t.previewLabel||e.previewLabel,previewLoading:t.previewLoading||e.previewLoading,previewOnlyByDefault:null!=(r=t.previewOnlyByDefault)?r:e.previewOnlyByDefault}})}).use(bm)})(t,n);case __.ListItem:return((e,t)=>{e.config(nS(__.ListItem)).config(e=>function(e,t){e.set(yC.key,{renderLabel:({label:e,listType:n,checked:r})=>{var o,i,a;return null==r?"bullet"===n?null!=(o=null==t?void 0:t.bulletIcon)?o:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_952_6527)">\n <circle cx="12" cy="12" r="3" />\n </g>\n <defs>\n <clipPath id="clip0_952_6527">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n':e:r?null!=(i=null==t?void 0:t.checkBoxCheckedIcon)?i:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1803_1151)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM10.71 16.29C10.32 16.68 9.69 16.68 9.3 16.29L5.71 12.7C5.32 12.31 5.32 11.68 5.71 11.29C6.1 10.9 6.73 10.9 7.12 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.71 16.29Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1803_1151">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n':null!=(a=null==t?void 0:t.checkBoxUncheckedIcon)?a:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1803_535)">\n <path\n d="M18 19H6C5.45 19 5 18.55 5 18V6C5 5.45 5.45 5 6 5H18C18.55 5 19 5.45 19 6V18C19 18.55 18.55 19 18 19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1803_535">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n'}})}(e,t)).use(kC)})(t,n);case __.LinkTooltip:return((e,t)=>{e.config(nS(__.LinkTooltip)).config(cC).config(e=>{e.update(tk.key,e=>{var n,r,o,i,a,s;return{...e,linkIcon:null!=(n=null==t?void 0:t.linkIcon)?n:R_,editButton:null!=(r=null==t?void 0:t.editButton)?r:z_,removeButton:null!=(o=null==t?void 0:t.removeButton)?o:$_,confirmButton:null!=(i=null==t?void 0:t.confirmButton)?i:I_,inputPlaceholder:null!=(a=null==t?void 0:t.inputPlaceholder)?a:"Paste link...",onCopyLink:null!=(s=null==t?void 0:t.onCopyLink)?s:()=>{}}})}).use(dC)})(t,n);case __.ImageBlock:return((e,t)=>{e.config(nS(__.ImageBlock)).config(e=>{e.update(wg.key,e=>{var n,r,o,i,a,s;return{uploadButton:null!=(n=null==t?void 0:t.inlineUploadButton)?n:"Upload",imageIcon:null!=(r=null==t?void 0:t.inlineImageIcon)?r:N_,confirmButton:null!=(o=null==t?void 0:t.inlineConfirmButton)?o:I_,uploadPlaceholderText:null!=(i=null==t?void 0:t.inlineUploadPlaceholderText)?i:"or paste link",onUpload:null!=(s=null!=(a=null==t?void 0:t.inlineOnUpload)?a:null==t?void 0:t.onUpload)?s:e.onUpload,proxyDomURL:null==t?void 0:t.proxyDomURL}}),e.update(cu.key,e=>{var n,r,o,i,a,s,l,c,d;return{uploadButton:null!=(n=null==t?void 0:t.blockUploadButton)?n:"Upload file",imageIcon:null!=(r=null==t?void 0:t.blockImageIcon)?r:N_,captionIcon:null!=(o=null==t?void 0:t.blockCaptionIcon)?o:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="32"\n height="32"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M9 22a1 1 0 0 1-1-1v-3H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6.1l-3.7 3.71c-.2.19-.45.29-.7.29zm1-6v3.08L13.08 16H20V4H4v12z"\n />\n </svg>\n',confirmButton:null!=(i=null==t?void 0:t.blockConfirmButton)?i:"Confirm",captionPlaceholderText:null!=(a=null==t?void 0:t.blockCaptionPlaceholderText)?a:"Write Image Caption",uploadPlaceholderText:null!=(s=null==t?void 0:t.blockUploadPlaceholderText)?s:"or paste link",onUpload:null!=(c=null!=(l=null==t?void 0:t.blockOnUpload)?l:null==t?void 0:t.onUpload)?c:e.onUpload,proxyDomURL:null==t?void 0:t.proxyDomURL,onImageLoadError:null!=(d=null==t?void 0:t.onImageLoadError)?d:e.onImageLoadError,maxWidth:null==t?void 0:t.maxWidth,maxHeight:null==t?void 0:t.maxHeight}})}).use(Ou).use(Ag)})(t,n);case __.Cursor:return((e,t)=>{if(e.config(nS(__.Cursor)).config(e=>{e.update(og.key,()=>{var e,n;return{class:"crepe-drop-cursor",width:null!=(e=null==t?void 0:t.width)?e:4,color:null!=(n=null==t?void 0:t.color)&&n}})}).use(cg),!1===(null==t?void 0:t.virtual))return;const n=function(){let e="undefined"==typeof document?null:document.createElement("div");return new c({key:dg,view:t=>{!function(e,t){for(const[n,r]of Object.entries(e.marks))!1!==r.spec.inclusive||t.includes(n)||console.warn(`[prosemirror-virtual-cursor] Virtual cursor does not work well with marks that have inclusive set to false. Please consider removing the inclusive option from the "${n}" mark or adding it to the "skipWarning" option.`)}(t.state.schema,[]);const n=t.dom.ownerDocument;e=e||document.createElement("div");const r=e,o=()=>{!function(e,t){if(!e||!e.dom||e.isDestroyed||!t)return;const{state:n,dom:r}=e,{selection:o}=n;if(!hg(o))return;const i=function(e,t){var n;const r=window.getSelection();if(!r||!r.rangeCount)return null;const o=null==(n=null==r?void 0:r.getRangeAt(0))?void 0:n.cloneRange();if(!o)return null;o.collapse(t);const i=o.getClientRects(),a=(null==i?void 0:i.length)?i[i.length-1]:null;return(null==a?void 0:a.height)?a:e.coordsAtPos(e.state.selection.head)}(e,o.$head===o.$from);if(!i)return t;const a=r.getBoundingClientRect();let s="prosemirror-virtual-cursor";const l=n.selection.$head,[c,d]=ug(l),u=n.storedMarks||l.marks();o.$cursor&&c&&d&&u&&!ne.sameSet(c,d)&&(ne.sameSet(c,u)?s+=" prosemirror-virtual-cursor-left":ne.sameSet(d,u)&&(s+=" prosemirror-virtual-cursor-right")),t.className=s,function(e,t){e.classList.remove(t),e.offsetWidth,e.classList.add(t)}(t,"prosemirror-virtual-cursor-animation"),t.style.height=i.bottom-i.top+"px",t.style.left=i.left-a.left+"px",t.style.top=i.top-a.top+"px"}(t,r)};let i;return window.ResizeObserver&&(i=new window.ResizeObserver(()=>o()),i.observe(t.dom)),n.addEventListener("selectionchange",o),{update:()=>{o()},destroy:()=>{n.removeEventListener("selectionchange",o),i&&i.unobserve(t.dom)}}},props:{handleKeyDown:(e,t)=>{var n;const{selection:r}=e.state;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.isComposing||!["ArrowLeft","ArrowRight"].includes(t.key)||!hg(r)||!r.empty)return!1;const o=r.$head,[i,a]=ug(o),s=e.state.storedMarks||o.marks();if(i&&a&&!ne.sameSet(i,a)){if("ArrowLeft"===t.key&&!ne.sameSet(i,s))return e.dispatch(e.state.tr.setStoredMarks(i)),!0;if("ArrowRight"===t.key&&!ne.sameSet(a,s))return e.dispatch(e.state.tr.setStoredMarks(a)),!0}return"ArrowLeft"===t.key&&1===o.textOffset?(e.dispatch(e.state.tr.setSelection(S.create(e.state.doc,o.pos-1)).setStoredMarks(o.marks())),!0):"ArrowRight"===t.key&&o.textOffset+1===(null==(n=o.parent.maybeChild(o.index()))?void 0:n.nodeSize)&&(e.dispatch(e.state.tr.setSelection(S.create(e.state.doc,o.pos+1)).setStoredMarks(o.marks())),!0)},decorations:t=>{if(e&&hg(t.selection)&&t.selection.empty)return f.create(t.doc,[v.widget(0,e,{key:"prosemirror-virtual-cursor"})])},attributes:{class:"virtual-cursor-enabled"}}})}();e.use(s(()=>n))})(t,n);case __.BlockEdit:return((e,t)=>{e.config(nS(__.BlockEdit)).config(e=>function(e,t){e.set($d.key,{filterNodes:e=>!A(e=>["table","blockquote","math_inline"].includes(e.type.name))(e)}),e.set(Jd.key,{view:()=>new lM(e,t)})}(e,t)).config(e=>function(e,t){e.set(XA.key,{view:n=>new YA(e,n,t)})}(e,t)).use(KA).use(Jd).use(XA)})(t,n);case __.Placeholder:return((e,t)=>{e.config(nS(__.Placeholder)).config(e=>{t&&e.update(PM.key,e=>({...e,...t}))}).use(BM).use(PM)})(t,n);case __.Toolbar:return((e,t)=>{e.config(nS(__.Toolbar)).config(e=>{e.set(GM.key,{view:n=>new ZM(e,n,t)})}).use(GM)})(t,n);case __.Table:return((e,t)=>{e.config(nS(__.Table)).config(e=>{e.update(BC.key,e=>({...e,renderButton:e=>{var n,r,o,i,a,s,l,c,d;switch(e){case"add_row":return null!=(n=null==t?void 0:t.addRowIcon)?n:V_;case"add_col":return null!=(r=null==t?void 0:t.addColIcon)?r:V_;case"delete_row":return null!=(o=null==t?void 0:t.deleteRowIcon)?o:$_;case"delete_col":return null!=(i=null==t?void 0:t.deleteColIcon)?i:$_;case"align_col_left":return null!=(a=null==t?void 0:t.alignLeftIcon)?a:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM4.25 16.625C4.0375 16.625 3.85942 16.5531 3.71575 16.4093C3.57192 16.2654 3.5 16.0872 3.5 15.8748C3.5 15.6621 3.57192 15.484 3.71575 15.3405C3.85942 15.1968 4.0375 15.125 4.25 15.125H13.75C13.9625 15.125 14.1406 15.1969 14.2843 15.3408C14.4281 15.4846 14.5 15.6628 14.5 15.8753C14.5 16.0879 14.4281 16.266 14.2843 16.4095C14.1406 16.5532 13.9625 16.625 13.75 16.625H4.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM4.25 8.875C4.0375 8.875 3.85942 8.80308 3.71575 8.65925C3.57192 8.51542 3.5 8.33725 3.5 8.12475C3.5 7.91208 3.57192 7.734 3.71575 7.5905C3.85942 7.44683 4.0375 7.375 4.25 7.375H13.75C13.9625 7.375 14.1406 7.44692 14.2843 7.59075C14.4281 7.73458 14.5 7.91275 14.5 8.12525C14.5 8.33792 14.4281 8.516 14.2843 8.6595C14.1406 8.80317 13.9625 8.875 13.75 8.875H4.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"\n />\n </svg>\n';case"align_col_center":return null!=(s=null==t?void 0:t.alignCenterIcon)?s:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM8.25 16.625C8.0375 16.625 7.85942 16.5531 7.71575 16.4093C7.57192 16.2654 7.5 16.0872 7.5 15.8748C7.5 15.6621 7.57192 15.484 7.71575 15.3405C7.85942 15.1968 8.0375 15.125 8.25 15.125H15.75C15.9625 15.125 16.1406 15.1969 16.2843 15.3408C16.4281 15.4846 16.5 15.6628 16.5 15.8753C16.5 16.0879 16.4281 16.266 16.2843 16.4095C16.1406 16.5532 15.9625 16.625 15.75 16.625H8.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM8.25 8.875C8.0375 8.875 7.85942 8.80308 7.71575 8.65925C7.57192 8.51542 7.5 8.33725 7.5 8.12475C7.5 7.91208 7.57192 7.734 7.71575 7.5905C7.85942 7.44683 8.0375 7.375 8.25 7.375H15.75C15.9625 7.375 16.1406 7.44692 16.2843 7.59075C16.4281 7.73458 16.5 7.91275 16.5 8.12525C16.5 8.33792 16.4281 8.516 16.2843 8.6595C16.1406 8.80317 15.9625 8.875 15.75 8.875H8.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"\n />\n </svg>\n';case"align_col_right":return null!=(l=null==t?void 0:t.alignRightIcon)?l:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25ZM10.25 8.875C10.0375 8.875 9.85942 8.80308 9.71575 8.65925C9.57192 8.51542 9.5 8.33725 9.5 8.12475C9.5 7.91208 9.57192 7.734 9.71575 7.5905C9.85942 7.44683 10.0375 7.375 10.25 7.375H19.75C19.9625 7.375 20.1406 7.44692 20.2843 7.59075C20.4281 7.73458 20.5 7.91275 20.5 8.12525C20.5 8.33792 20.4281 8.516 20.2843 8.6595C20.1406 8.80317 19.9625 8.875 19.75 8.875H10.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM10.25 16.625C10.0375 16.625 9.85942 16.5531 9.71575 16.4093C9.57192 16.2654 9.5 16.0872 9.5 15.8748C9.5 15.6621 9.57192 15.484 9.71575 15.3405C9.85942 15.1968 10.0375 15.125 10.25 15.125H19.75C19.9625 15.125 20.1406 15.1969 20.2843 15.3408C20.4281 15.4846 20.5 15.6628 20.5 15.8753C20.5 16.0879 20.4281 16.266 20.2843 16.4095C20.1406 16.5532 19.9625 16.625 19.75 16.625H10.25ZM4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25Z"\n />\n </svg>\n';case"col_drag_handle":return null!=(c=null==t?void 0:t.colDragHandleIcon)?c:B_;case"row_drag_handle":return null!=(d=null==t?void 0:t.rowDragHandleIcon)?d:B_}}}))}).use(e_)})(t,n);case __.Latex:return((e,t)=>{e.config(nS(__.Latex)).config(e=>{if(!tS(e).get().includes(__.CodeMirror))throw new Error("You need to enable CodeMirror to use LaTeX feature");e.update(im.key,e=>({...e,renderPreview:(n,r,o)=>"latex"===n.toLowerCase()&&r.length>0?function(e,t){return Hx.renderToString(e,{...t,throwOnError:!1,displayMode:!0})}(r,null==t?void 0:t.katexOptions):(0,e.renderPreview)(n,r,o)})),e.set(pM.key,{view:n=>{var r;return new TM(e,n,{inlineEditConfirm:null!=(r=null==t?void 0:t.inlineEditConfirm)?r:I_,...t})}})}).use(OM).use(RM).use(uM).use(pM).use(EM).use(LM).use(cM).use(hM)})(t,n);case __.TopBar:return((e,t)=>{e.config(nS(__.TopBar)).config(e=>{e.set(cT.key,{view:n=>new lT(e,n,t)})}).use(cT).use(dT)})(t,n);case __.AI:((e,t)=>{var n,r;const o=null!=(n=null==t?void 0:t.diff)?n:{},i=null!=(r=null==t?void 0:t.streaming)?r:{};e.config(nS(__.AI)).config(e=>{e.update(to.key,e=>{var t;return{...e,ignoreAttrs:null!=(t=o.ignoreAttrs)?t:TA}});const{ignoreAttrs:t,...n}=o;e.update(Co.key,e=>{var t;return{...e,customBlockTypes:null!=(t=n.customBlockTypes)?t:MA,...n}})}).use(mo).use(Fo).config(e=>{e.update(Wo.key,e=>{var n;return{...e,...i,ignoreAttrs:null!=(n=i.ignoreAttrs)?n:TA,...void 0!==(null==t?void 0:t.diffReviewOnEnd)?{diffReviewOnEnd:t.diffReviewOnEnd}:{}}})}).use(ri).config(e=>{e.update(oS.key,e=>{var n;return{...e,...void 0!==(null==t?void 0:t.provider)?{provider:t.provider}:{},...void 0!==(null==t?void 0:t.buildContext)?{buildContext:t.buildContext}:{},diffReviewOnEnd:null!=(n=null==t?void 0:t.diffReviewOnEnd)?n:e.diffReviewOnEnd,...void 0!==(null==t?void 0:t.onError)?{onError:t.onError}:{},...void 0!==(null==t?void 0:t.aiIcon)?{aiIcon:t.aiIcon}:{}}})}).use(oS).use(iS).use(lS).use(cS).config(function(e){return t=>{const n=function(e){var t,n;const r=new WS;return function(e){e.addItem("improve",{icon:A_,label:"Improve writing",streamingLabel:"Improving writing",prompt:"Improve the writing while preserving the original meaning."}).addItem("grammar",{icon:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M9.55 17.575L4.225 12.25l1.4-1.425L9.55 14.75l8.825-8.825l1.4 1.425z"\n />\n </svg>\n',label:"Fix grammar & spelling",streamingLabel:"Fixing grammar & spelling",prompt:"Fix any grammar and spelling errors without changing the meaning."}).addItem("shorter",{icon:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M5 13v-2h14v2z"\n />\n </svg>\n',label:"Make shorter",streamingLabel:"Making shorter",prompt:"Make this shorter while preserving the key information."}).addItem("longer",{icon:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M3 18v-2h13v2zm0-5v-2h18v2zm0-5V6h18v2zm15 13v-3h-3v-2h3v-3h2v3h3v2h-3v3z"\n />\n </svg>\n',label:"Make longer",streamingLabel:"Expanding",prompt:"Expand this with more detail and examples."}),e.addSubmenu("tone",{icon:z_,label:"Change tone…",title:"Change tone",searchPlaceholder:"Search tones…"},e=>{const t=[["professional","Professional"],["casual","Casual"],["confident","Confident"],["friendly","Friendly"],["direct","Direct"],["formal","Formal"]];for(const[n,r]of t)e.addItem(n,{icon:z_,label:r,streamingLabel:"Adjusting tone",prompt:`Rewrite this in a ${r.toLowerCase()} tone.`})}),e.addSubmenu("translate",{icon:X_,label:"Translate…",title:"Translate",searchPlaceholder:"Search languages…"},e=>{const t=[["english","English","English"],["chinese","Chinese","Chinese (Simplified)"],["japanese","Japanese","Japanese"],["korean","Korean","Korean"],["spanish","Spanish","Spanish"],["french","French","French"],["german","German","German"]];for(const[n,r,o]of t)e.addItem(n,{icon:X_,label:r,streamingLabel:`Translating to ${r}`,prompt:`Translate this to ${o}.`})})}(r),null==(t=null==e?void 0:e.buildAISuggestions)||t.call(e,r),{placeholder:null!=(n=null==e?void 0:e.instructionPlaceholder)?n:"Tell AI what to do with the selection…",chrome:uA(e),suggestions:r.build()}}(e);let r=null;t.update(cA.key,e=>({...e,show:(e,t)=>{null==r||r.show(e,t)}})),t.set(dA.key,{view:e=>(r=new lA(t,e,n),r)})}}(t)).use(cA).use(dA).use(function(e={}){var t,n;const{config:r}=e,o=null!=(t=null==r?void 0:r.fallbackLabel)?t:"Generating",i=null!=(n=null==r?void 0:r.cancelHint)?n:"Esc to cancel";return s(e=>{let t=null;function n(){t&&(t.destroy(),t=null)}return new c({key:SA,state:{init:()=>f.empty,apply(r,a,s,l){const c=Yo.getState(l);return(null==c?void 0:c.active)&&null!=c.insertEndPos?r.getMeta(Yo)||r.docChanged?function(n,r){const a=Math.min(r,n.content.size),s=v.widget(a,(t?t.setLabel(e):t=new AA(e,o,i),t).dom,{side:1,key:"ai-streaming-indicator"});return f.create(n,[s])}(l.doc,c.insertEndPos):a.map(r.mapping,r.doc):(n(),f.empty)}},view:()=>({destroy(){n()}}),props:{decorations(e){var t;return null!=(t=SA.getState(e))?t:f.empty},handleKeyDown(t,n){var r;if("Escape"!==n.key)return!1;const o=e.get(g);return e.get(iS.key).abortController?(n.preventDefault(),o.call(cS.key,{keep:!0}),!0):!!(null==(r=Yo.getState(t.state))?void 0:r.active)&&(n.preventDefault(),o.call(ni.key,{keep:!0}),!0)}}})})}({config:null==t?void 0:t.streamingIndicator})).use(function(e={}){const t=function(e){var t,n,r,o,i,a,s;const{config:l,enterKeyIcon:c}=e;return{retryLabel:null!=(t=null==l?void 0:l.retryLabel)?t:"Retry",rejectAllLabel:null!=(n=null==l?void 0:l.rejectAllLabel)?n:"Reject all",acceptAllLabel:null!=(r=null==l?void 0:l.acceptAllLabel)?r:"Accept all",retryIcon:null!=(o=null==l?void 0:l.retryIcon)?o:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M12 20q-3.35 0-5.675-2.325T4 12q0-3.35 2.325-5.675T12 4q1.725 0 3.3.713T18 6.75V4h2v7h-7V9h4.2q-.8-1.4-2.187-2.2T12 6Q9.5 6 7.75 7.75T6 12q0 2.5 1.75 4.25T12 18q1.925 0 3.475-1.1T17.65 14h2.1q-.7 2.65-2.85 4.325T12 20"\n />\n </svg>\n',rejectIcon:null!=(i=null==l?void 0:l.rejectIcon)?i:L_,acceptIcon:null!=(a=null==l?void 0:l.acceptIcon)?a:I_,enterKeyIcon:null!=c?c:D_,modSymbol:null!=(s=null==l?void 0:l.modSymbol)?s:zS}}(e);return s(e=>new c({key:BS,view:n=>new PS(e,n,t),props:{handleKeyDown(t,n){var r;return!("Enter"!==n.key||!n.metaKey&&!n.ctrlKey||!(null==(r=no.getState(t.state))?void 0:r.active)||!e.get(iS.key).diffOwnedByAI||(n.preventDefault(),e.get(g).call(ho.key),0))}}}))}({config:null==t?void 0:t.diffActions,enterKeyIcon:null==t?void 0:t.enterKeyIcon}))})(t,n)}}(e,this.editor,t)})}}wT.Feature=__;const xT=[Rt.theme({"&":{color:"var(--text)",backgroundColor:"var(--code-bg)"},".cm-content":{caretColor:"var(--text)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--text)"},".cm-gutters":{color:"var(--text-secondary)",backgroundColor:"var(--code-bg)",border:"none"},".cm-activeLine, .cm-activeLineGutter":{backgroundColor:"var(--sidebar-selection)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--accent-soft-strong)"},".cm-selectionMatch, .cm-searchMatch, &.cm-focused .cm-matchingBracket":{backgroundColor:"var(--sidebar-selection)"},".cm-tooltip":{color:"var(--text)",backgroundColor:"var(--card)",border:"1px solid var(--border)"},".cm-tooltip-autocomplete > ul > li[aria-selected]":{color:"var(--text)",backgroundColor:"var(--sidebar-selection)"}}),Pt(Sn)];function kT(e){const{path:t,readOnly:o=!1}=e,a=n.useRef(null),l=n.useRef(e);l.current=e;const d=n.useRef(null),u=n.useRef(new Set),h=n.useRef(!1),[p,m]=n.useState(!1);return n.useEffect(()=>{if(!a.current)return;let t=!1,n=!1;m(!1),u.current.clear();const r=document.createElement("div");a.current.append(r);const p=l.current.text,f=new wT({root:r,defaultValue:nt(p),featureConfigs:{[wT.Feature.CodeMirror]:{theme:xT,previewOnlyByDefault:!0,renderPreview:(e,t,n)=>{if(!rt(e))return null;ot(t).then(n)}}},features:{[wT.Feature.Cursor]:!1,[wT.Feature.ImageBlock]:!1,[wT.Feature.BlockEdit]:!1,[wT.Feature.Toolbar]:!0,[wT.Feature.Placeholder]:!1}});f.editor.remove(it),f.editor.config(e=>e.update(im.key,e=>({...e,activationMode:"viewport"}))),f.editor.config(e=>e.update(at,er)),f.editor.config(e=>e.update(yC.key,e=>({...e,renderLabel:({label:e,listType:t,checked:n})=>{if(null==n)return"bullet"===t?st:e;if(!0===n)return lt;if("in-progress"===n)return ct;if("cancelled"===n)return dt;const r=i(n);return r&&" "!==r?r:ut}})));for(const e of ht)f.editor.use(e);f.editor.use(pt).use(mt);for(const e of ft)f.editor.use(e);f.editor.use(gt).use(vt).use(yt).use(bt).use(wt);for(const o of e.createNodeViews?.(f)??[])f.editor.use(o);return f.editor.use(s(e=>new c({view:()=>({update(r,o){if(!n||t||h.current||l.current.readOnly||r.state.doc.eq(o.doc))return;const i=e.get(le)(r.state.doc);u.current.add(i),l.current.onChange?.(i)}})}))),f.setReadonly(o),f.create().then(()=>{t?f.destroy():(d.current=f,f.setReadonly(l.current.readOnly??!1),l.current.text!==p&&f.editor.action(xt(nt(l.current.text))),n=!0,f.editor.action(e=>e.get(T).dom.setAttribute("aria-label",l.current.path)),a.current&&l.current.onReady?.(a.current))}).catch(()=>{t||m(!0)}),()=>{t=!0,d.current=null,n&&f.destroy(),r.remove()}},[e.documentId??t,e.createNodeViews]),n.useEffect(()=>{e.documentId&&d.current?.editor.action(e=>e.get(T).dom.setAttribute("aria-label",t))},[t,e.documentId]),n.useEffect(()=>{d.current?.setReadonly(o)},[o]),n.useEffect(()=>{const t=d.current;if(t)if(t.getMarkdown()!==e.text){if(!u.current.delete(e.text)){u.current.clear(),h.current=!0;try{t.editor.action(xt(nt(e.text)))}finally{h.current=!1}}}else u.current.clear()},[e.text]),r.jsxs("div",{className:"obsidian-file-editor remote-editor","data-readonly":o,onClick:e=>{if(e.defaultPrevented)return;const t=e.target instanceof Element?e.target:null,n=t?.closest(".callout-title")?.parentElement;if(n?.hasAttribute("data-callout-folded"))return e.stopPropagation(),void(n.dataset.calloutFolded=String("true"!==n.dataset.calloutFolded));a.current&&l.current.onClick?.(e,a.current)},children:[p&&r.jsx("p",{role:"alert",children:e.errorText}),r.jsx("div",{ref:a})]})}function CT({target:e,hash:t,host:o}){const[i,a]=n.useState({}),s=jn(),{path:l,cwd:c}=Vn(e,o.path,o.cwd);return n.useEffect(()=>{const n=new AbortController;a({});const r=Fn();if(r&&!(o.depth>=3))return(o.resolveFile?.(e,o.path)??Promise.resolve({path:l,cwd:c})).then(async e=>{const o=await fetch($n(e.path,e.cwd),{headers:{authorization:`Bearer ${r.pairToken}`},signal:n.signal});if(!o.ok)throw new Error("Unable to load embedded note");const i=Mt(await o.text(),t);if(i.error||null===i.content)throw new Error("Missing section");n.signal.aborted||a({text:i.content,...e})}).catch(()=>{n.signal.aborted||a({error:!0})}),()=>n.abort()},[l,c,t,o.depth]),r.jsxs("div",{className:"remote-note-embed",children:[r.jsxs("button",{type:"button",onClick:()=>o.onOpenFile(i.path??l,i.cwd??c),children:[e||o.path,t?`#${t}`:""," ↗"]}),i.error?r.jsx("p",{children:s.unavailable}):void 0!==i.text?r.jsx(_T,{client:o.client,path:Wn(i.path??l,i.cwd??c),cwd:o.cwd,resolveFile:o.resolveFile,text:i.text,readOnly:!0,depth:o.depth+1,onOpenFile:o.onOpenFile}):o.depth<3&&r.jsx("p",{children:s.loading})]})}function _T(t){const{path:i,cwd:a,depth:s=0}=t,l=n.useRef(t);l.current=t;const c=n.useCallback(n=>function(t){const n=qn(t.path,t.cwd);return[R(kt.node,()=>function(t){return(n,r,o)=>{const i=document.createElement("div");i.className="lifeos-block-nodeview",i.contentEditable="false",i.dataset.lifeosBlockNodeview="true",i.dataset.lifeosHydrationStatus="pending",i.dataset.lifeosExportStatus="loading",i.setAttribute("aria-busy","true"),i.style.minHeight="72px";const a=e=>{(e=>e instanceof HTMLElement&&!(e=>e instanceof HTMLElement&&Boolean(e.closest('[data-mobile-text-entry="true"]')))(e)&&Boolean(e.closest(["button",'input[type="checkbox"]','input[type="radio"]',"label","select",'[role="button"]','[role="dialog"]',".advanced-table-toolbar-action",".advanced-table-page-size-option",".advanced-table-pagination-btn",".advanced-table-col-modal",".advanced-table-col-item",".advanced-table-filter-dropdown","[data-lifeos-action-rail]","[data-lifeos-action-button]"].join(", "))))(e.target)&&((()=>{const e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&(e.isContentEditable||e.closest('[contenteditable="true"]'))&&e.blur()})(),e.stopPropagation())},s=["pointerdown","pointerup","mousedown","mouseup","click","touchstart","touchend","focusin"];s.forEach(e=>{i.addEventListener(e,a)});let l=null,c=t.render??null,d=null,u=!1,h=null;const p=()=>{if(!c||u)return;l||(l=e.createRoot(i));const a=t.resolveFileName?.(r,i)??function(e,t){try{const n=e.dom.closest(".editor-pane");if(n){const e=n.getAttribute("data-current-file");if(e)return e}const r=t.closest(".editor-pane");if(r){const e=r.getAttribute("data-current-file");if(e)return e}}catch{}}(r,i);l.render(c({content:String(n.attrs.value??""),fileName:a,onContentChange:e=>{const t=o();if("number"!=typeof t)return;const i=r.state.tr.setNodeMarkup(t,void 0,{...n.attrs,value:e});r.dispatch(i)}})),i.dataset.lifeosHydrationStatus="rendered",delete i.dataset.lifeosExportStatus,i.removeAttribute("aria-busy")},m=()=>h||(d?.disconnect(),d=null,i.dataset.lifeosHydrationStatus="loading",h=(c?Promise.resolve(c):t.loadRenderer?t.loadRenderer():Promise.reject(new Error("A LifeOSBlock renderer or loader is required."))).then(e=>{u||(c=e,p())}).catch(()=>{u||(i.dataset.lifeosHydrationStatus="error",i.dataset.lifeosExportStatus="error",i.removeAttribute("aria-busy"))}),h),f=()=>{m()};return i.addEventListener("pointerdown",f,{once:!0,capture:!0}),(t.shouldActivateImmediately?.(r,i)??Boolean(r.dom.closest?.('[data-lifeos-block-hydration="eager"]')))||c||"undefined"==typeof IntersectionObserver?m():(d=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&m()},{rootMargin:t.intersectionRootMargin??"200px 0px"}),d.observe(i)),{dom:i,update:e=>e.type===n.type&&(n=e,c&&p(),!0),destroy:()=>{u=!0,d?.disconnect(),d=null,i.removeEventListener("pointerdown",f,!0),s.forEach(e=>{i.removeEventListener(e,a)}),l?.unmount(),l=null},stopEvent:()=>!0,ignoreMutation:()=>!0}}}({resolveFileName:()=>t.path,render:e=>r.jsx(St,{content:e.content??"",fileName:t.path,context:{...t,resolveFile:t.resolveFile??(async(e,n)=>Vn(e,n,t.cwd))},read:async e=>{const n=Fn();if(!n)return null;const r=await fetch($n(e,t.cwd),{headers:{authorization:`Bearer ${n.pairToken}`}});return r.ok?{content:await r.text()}:null}})})),R(Ct.node,()=>e=>{const t=document.createElement("details");t.className="remote-frontmatter",t.contentEditable="false";const n=document.createElement("summary");n.textContent=jn().properties;const r=document.createElement("pre");return r.textContent=e.attrs.value,t.append(n,r),{dom:t,update:t=>t.type===e.type&&(r.textContent=t.attrs.value,!0)}}),R(_t.node,()=>function(t){return(n,r,o,i=[])=>{const a=document.createElement("div");a.className="wiki-embedding-nodeview",a.dataset.wikiembeddingNodeview="true";const s=document.createElement("div");s.className="wiki-embedding-nodeview-preview",s.contentEditable="false";const l=document.createElement("span");l.className="inline-source-source wiki-embedding-nodeview-source",l.spellcheck=!1,a.append(s,l);let c=null,d=null,u=!1,h=!1;const p=()=>({target:String(n.attrs.target??""),hash:String(n.attrs.hash??""),size:String(n.attrs.alias??"")}),m=()=>{h||(s.style.minHeight="",a.dataset.wikiembeddingRenderStatus="rendered")},f=()=>{if(h)return;const{target:i,hash:a,size:l}=p();c||(c=e.createRoot(s)),c.render(t.render({target:i,hash:a,size:l,onResourceSettled:m,onResize:e=>{const t=Math.round(e);if(!Number.isFinite(t)||t<=0)return;const i=o();if("number"!=typeof i)return;const a=r.state.doc.nodeAt(i);if(!a||a.type!==n.type)return;const s=String(t),l=lr(a,s);if(a.attrs.alias===s&&a.textContent===l)return;const c=a.type.create({...a.attrs,alias:s},r.state.schema.text(l),a.marks);r.dispatch(r.state.tr.replaceWith(i,i+a.nodeSize,c))}}))},g=()=>{u||h||(u=!0,d?.(),d=null,a.dataset.wikiembeddingRenderStatus="loading",f())},v=e=>{const t=function(e){return e.textContent?e.textContent:lr(e)}(n);a.dataset.inlineSourceKind="wikiembedding",a.dataset.inlineSourceRaw=t,a.dataset.wikiembeddingTarget=String(n.attrs.target??""),a.dataset.wikiembeddingHash=String(n.attrs.hash??""),a.dataset.wikiembeddingAlias=String(n.attrs.alias??""),a.dataset.inlineSourceActive=e?"true":"false",a.classList.toggle("inline-source-node-active",e);const r=e?"true":"false";a.contentEditable!==r&&(a.contentEditable=r),s.style.display="",l.style.display=e?"":"none"};return v(cr(i)),(()=>{if(u||h)return;const e=p();if(!t.shouldDeferRender?.(e)||"undefined"==typeof IntersectionObserver)return void g();const n=t.getDeferredMinHeight?.(e)??t.deferredMinHeight??"240px";a.dataset.wikiembeddingRenderStatus="pending",s.style.minHeight=n,s.style.contentVisibility="auto",s.style.containIntrinsicBlockSize=`auto ${n}`,d=function(e){const t=function(e,t){const n=function(e){if(!e)return nr;const t=tr.get(e);if(t)return t;const n=new Map;return tr.set(e,n),n}(e),r=n.get(t);if(r)return r;let o;const i=new IntersectionObserver(e=>{e.forEach(e=>{if(!e.isIntersecting)return;const t=sr(o,e.target);t&&function(e){rr.push(e),ar()}(t)})},{root:e,rootMargin:t});return o={callbacks:new Map,observer:i,owner:n,rootMargin:t},n.set(t,o),o}(e.root,e.rootMargin);return t.callbacks.set(e.target,e.onIntersect),t.observer.observe(e.target),()=>{sr(t,e.target)}}({target:a,root:t.resolveIntersectionRoot?.(r,a)??null,rootMargin:t.intersectionRootMargin??"600px 0px",onIntersect:g})})(),{dom:a,contentDOM:l,update:(e,r=[])=>e.type===n.type&&(n=e,v(cr(r)),u?f():t.shouldDeferRender?.(p())||g(),!0),destroy:()=>{h=!0,d?.(),d=null,c?.unmount(),c=null},stopEvent:e=>!l.contains(e.target),ignoreMutation:e=>!l.contains(e.target)}}}({render:({target:e,hash:o,size:i})=>At(e)?r.jsx("div",{style:{maxWidth:/^\d+$/.test(i??"")?`${i}px`:void 0},children:r.jsx(Xn,{gallery:t.gallery,src:e,cwd:Vn(e,t.path,t.cwd).cwd,onOpen:t.onOpenFile})}):/\.[^/.]+$/.test(e)&&!/\.(md|markdown)$/i.test(e)?r.jsxs("button",{type:"button",onClick:()=>t.onOpenFile(e,n),children:[e," ↗"]}):r.jsx(CT,{target:e,hash:o,host:t})})),R(re.node,()=>o=>{const i=document.createElement("span");i.contentEditable="false";const a=e.createRoot(i),s=()=>a.render(r.jsx(Xn,{gallery:t.gallery,src:o.attrs.src,alt:o.attrs.alt,cwd:n,onOpen:t.onOpenFile}));return s(),{dom:i,update:e=>e.type===o.type&&(o=e,s(),!0),destroy(){queueMicrotask(()=>a.unmount())}}})]}({client:t.client,path:i,cwd:a,depth:s,resolveFile:t.resolveFile,gallery:()=>{const e=[];return n.editor.action(t=>t.get(T).state.doc.descendants(t=>{"image"===t.type.name&&e.push({src:t.attrs.src,alt:t.attrs.alt,cwd:qn(i,a)}),"wikiembedding"===t.type.name&&At(t.attrs.target)&&e.push({src:t.attrs.target,cwd:Vn(t.attrs.target,i,a).cwd})})),e},onOpenFile:(e,t)=>l.current.onOpenFile(e,t)}),[i,a,s,t.client,t.resolveFile]);return r.jsx(kT,{path:i,text:t.text,readOnly:t.readOnly,onChange:t.onChange,createNodeViews:c,errorText:jn().editorError,onReady:e=>{const t=0===s?Zn(i,a):"";t&&requestAnimationFrame(()=>Un(e,t))},onClick:(e,t)=>{const n=e.target instanceof Element?e.target:null,r=n?.closest("a");if(!r)return;const s=r.getAttribute("data-wikilink-target"),c=r.getAttribute("href");if(e.preventDefault(),e.stopPropagation(),null!==s){const e=r.getAttribute("data-wikilink-hash")??"";!s&&t?Un(t,e):(l.current.resolveFile?.(s,i)??Promise.resolve(Vn(s,i,a))).then(n=>{t&&Wn(n.path,n.cwd)===Wn(i,a)?Un(t,e):(Gn(n.path,n.cwd,e),l.current.onOpenFile(n.path,n.cwd))})}else if(c&&/^https?:\/\//i.test(c)){const e=o().openExternal;e?e(c):window.open(c,"_blank","noopener,noreferrer")}else c&&!/^(?:[a-z][\w+.-]*:|\/\/)/i.test(c)&&(c.startsWith("#")&&t?Un(t,c):l.current.onOpenFile(c.split("#")[0]||i,qn(i,a)))}})}export{_T as ObsidianFileEditor};
|