@orangelogic/design-system 2.162.0 → 2.164.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library/chunks/{AxisLabelRadial.lE2gKah-.js → AxisLabelRadial.fe7zjixN.js} +1 -1
- package/library/chunks/{BaseColumnSeries.B57B3iHh.js → BaseColumnSeries.8Mpxz385.js} +1 -1
- package/library/chunks/{CandlestickSeries.CmmI426l.js → CandlestickSeries.DuadaOTa.js} +19 -19
- package/library/chunks/{Circle.DAhHYhrc.js → Circle.6LomW0ej.js} +1 -1
- package/library/chunks/{ColumnSeries.DBgXk-b4.js → ColumnSeries.D1NLfRh5.js} +2 -2
- package/library/chunks/{EditableAxisLabel.C6H99qiS.js → EditableAxisLabel.Bi9vxLDV.js} +2 -2
- package/library/chunks/{EditableLabel.B7HB7Cu4.js → EditableLabel.CMR3O9E-.js} +1 -1
- package/library/chunks/{Gradient.DHhBnhFd.js → Gradient.CquE8_a4.js} +1 -1
- package/library/chunks/{LinearGradient.CGx00O8B.js → LinearGradient.CVN1VJp-.js} +9 -9
- package/library/chunks/{Picture.DYltTVSo.js → Picture.BYTZ_I8g.js} +1 -1
- package/library/chunks/{Polygon.BCrxKagx.js → Polygon.CU2sMltE.js} +1 -1
- package/library/chunks/{ProgressPie.CXksPJFv.js → ProgressPie.Dd74dbmm.js} +6 -6
- package/library/chunks/{RadialLabel.BYH69FGU.js → RadialLabel.7ka6ND-t.js} +1 -1
- package/library/chunks/{Scrollbar.DEv50o4R.js → Scrollbar.DqUnZReo.js} +1 -1
- package/library/chunks/Slice.BVI8rfHI.js +34 -0
- package/library/chunks/{Slider.BX8g2iGv.js → Slider.DtjYaJOw.js} +1 -1
- package/library/chunks/{SpriteResizer.CfIBMSp3.js → SpriteResizer.Ci2Wt2YJ.js} +11 -11
- package/library/chunks/{Triangle.CNY8-QfL.js → Triangle.C75emy3D.js} +1 -1
- package/library/chunks/{ZoomTools.6jZrzA7x.js → ZoomTools.CA9mtHI8.js} +2 -2
- package/library/chunks/_arrayEach.DU4X1H_a.js +8 -0
- package/library/chunks/_baseClone.BHNjfIdS.js +215 -0
- package/library/chunks/_baseEach.DQk0As2f.js +32 -0
- package/library/chunks/{_baseIteratee.BdKyHJ5i.js → _baseIteratee.sC2wLi2m.js} +3 -2
- package/library/chunks/{_baseUniq.je-HWbb3.js → _baseUniq.lwMgmtt2.js} +16 -15
- package/library/chunks/_baseXor.DixEm6JQ.js +35 -0
- package/library/chunks/_flatRest.D3ZVApI5.js +30 -0
- package/library/chunks/abnfDiagram-VRR7QNED.DKqYa5p7.js +89 -0
- package/library/chunks/{am-chart.CqdmTS0P.js → am-chart.Cr-vMjcY.js} +1577 -1727
- package/library/chunks/{animation.S74lUDDc.js → animation.BD-1xugN.js} +1 -1
- package/library/chunks/arc.xqNd6x9S.js +84 -0
- package/library/chunks/architectureDiagram-ZJ3FMSHR.CBIOk9Kp.js +4757 -0
- package/library/chunks/{asset-link-format.DLAzKfhk.js → asset-link-format.0q_MQOYh.js} +691 -635
- package/library/chunks/asset-link-format.ClaYu_v8.js +7 -0
- package/library/chunks/blockDiagram-677ZJIJ3.CeQxLPwj.js +2428 -0
- package/library/chunks/{button.8syoJXYs.js → button.DGyqdBou.js} +2 -2
- package/library/chunks/c4Diagram-LMCZKHZV.B73xdpNh.js +1580 -0
- package/library/chunks/{capitalize.BTYI3NfM.js → capitalize.CIBKBL10.js} +1 -1
- package/library/chunks/{cardinal.BCA_LB0u.js → cardinal.BXTAeOLk.js} +1 -0
- package/library/chunks/cardinalClosed.Mdce1x5M.js +59 -0
- package/library/chunks/channel.s_XjcUYI.js +5 -0
- package/library/chunks/chunk-2Q5K7J3B.Dy1Z-bMH.js +15 -0
- package/library/chunks/chunk-32BRIVSS.BbIrVi3j.js +71 -0
- package/library/chunks/chunk-5VM5RSS4.D0-lddDM.js +19 -0
- package/library/chunks/chunk-EX3LRPZG.L693y8d4.js +1412 -0
- package/library/chunks/chunk-JWPE2WC7.BV0i4LDu.js +8 -0
- package/library/chunks/chunk-MOJQB5TN.BZstBMYC.js +664 -0
- package/library/chunks/chunk-RYQCIY6F.BMsuG7ya.js +314 -0
- package/library/chunks/chunk-V7JOEXUC.DcJlyQO0.js +1537 -0
- package/library/chunks/chunk-VR4S4FIN.BpryBs7q.js +19 -0
- package/library/chunks/chunk-XXDRQBXY.CSOjab1V.js +11 -0
- package/library/chunks/classDiagram-OUVF2IWQ.Dvz7CNwe.js +18 -0
- package/library/chunks/classDiagram-v2-EOCWNBFH.Dvz7CNwe.js +18 -0
- package/library/chunks/cloneDeep.B-5z5SI3.js +51 -0
- package/library/chunks/{color-swatch-group.CLv1LSZy.js → color-swatch-group.ChP9amU9.js} +2576 -2723
- package/library/chunks/{color-swatch.DsWP2fd-.js → color-swatch.QsHoy_K1.js} +1 -1
- package/library/chunks/{colorPicker.GYgA76kc.js → colorPicker.Cg6Zxf8f.js} +5 -5
- package/library/chunks/{confirm-popover.C-eHPJaU.js → confirm-popover.D8mdy6KG.js} +2 -2
- package/library/chunks/constant.BQ4UJ-kW.js +12 -0
- package/library/chunks/cose-bilkent-JH36ORCC.cfzS2XsK.js +2612 -0
- package/library/chunks/cynefin-VYW2F7L2.c7H5z9nQ.js +23790 -0
- package/library/chunks/cynefinDiagram-TSTJHNR4.C8SgNXWI.js +299 -0
- package/library/chunks/cytoscape.esm.Cbrwqewp.js +18786 -0
- package/library/chunks/dagre-VKFMJZFB.D5B1cAri.js +343 -0
- package/library/chunks/debounce.Bv1rtE8D.js +55 -0
- package/library/chunks/defaultLocale.CPy_WVtp.js +171 -0
- package/library/chunks/descending.AD5n-tFs.js +10 -0
- package/library/chunks/diagram-FQU43EPY.DJukDcLl.js +466 -0
- package/library/chunks/diagram-G47NLZAW.BBOvcbcR.js +316 -0
- package/library/chunks/diagram-NH7WQ7WH.DOpRwmC2.js +142 -0
- package/library/chunks/diagram-OA4YK3LP.Dm5WJs91.js +350 -0
- package/library/chunks/diagram-WEI45ONY.COuzdmSR.js +217 -0
- package/library/chunks/{dialog.Bzf4-IgH.js → dialog.05FgdLBZ.js} +2 -2
- package/library/chunks/{document-viewer.CGyOG1yw.js → document-viewer.Cng07M-1.js} +7 -7
- package/library/chunks/{dot-pagination.BdZc-K0r.js → dot-pagination.Pg9O0nIh.js} +1 -1
- package/library/chunks/ebnfDiagram-CCIWWBDH.Dz-QBH6Y.js +111 -0
- package/library/chunks/erDiagram-Q63AITRT.sSw_w-2B.js +913 -0
- package/library/chunks/{exporting.DQhKH1BX.js → exporting.Djsoh75g.js} +11 -11
- package/library/chunks/flow.aZRVH3p1.js +1304 -0
- package/library/chunks/flowDiagram-23GEKE2U.CMMbuUHf.js +1642 -0
- package/library/chunks/{folder-select.BKAuh4GE.js → folder-select.Dw1ZKZAq.js} +160 -140
- package/library/chunks/{gantt.tu-w6fQ5.js → gantt.Bv6_3H9y.js} +22 -22
- package/library/chunks/ganttDiagram-NO4QXBWP.DZdwd0O4.js +2715 -0
- package/library/chunks/gitGraphDiagram-IHSO6WYX.F6mwS3uS.js +818 -0
- package/library/chunks/graph.XHMI5hta.js +653 -0
- package/library/chunks/{header.e1FLwywx.js → header.DDI0MfJA.js} +1 -1
- package/library/chunks/{hierarchy.CTnBzzmQ.js → hierarchy.C4LxmFxx.js} +836 -904
- package/library/chunks/{hub-connection.CA_wS_wh.js → hub-connection.BtevPWYb.js} +1 -1
- package/library/chunks/{icon-button.DbVIFgu7.js → icon-button.BwmMJ0bI.js} +1 -1
- package/library/chunks/{icon.mxNZ85k0.js → icon.D5iM9wXS.js} +1 -1
- package/library/chunks/{iframe.DcHjOcLG.js → iframe.Cc-xZIm_.js} +1 -1
- package/library/chunks/{image.5mhGPvMN.js → image.BgODrAzQ.js} +2 -2
- package/library/chunks/{image.QVlPFadX.js → image.Y5c_hFx8.js} +1 -1
- package/library/chunks/{index.BVDhdCk-.js → index.2SOQHTpX.js} +23 -23
- package/library/chunks/index.BDn1QW8J.js +167 -0
- package/library/chunks/{index.DcjJFMlq.js → index.CrhRU5m8.js} +284 -273
- package/library/chunks/index.thKLME8E.js +77 -0
- package/library/chunks/infoDiagram-FWYZ7A6U.BnktKL7i.js +24 -0
- package/library/chunks/init.DjUOC4st.js +16 -0
- package/library/chunks/{input.BcyLZUmv.js → input.DOorVTYZ.js} +2 -2
- package/library/chunks/isArrayLikeObject.D7afXo-f.js +86 -0
- package/library/chunks/isEmpty.DtTJTUcf.js +27 -0
- package/library/chunks/ishikawaDiagram-FXEZZL3T.CFp-9Kes.js +621 -0
- package/library/chunks/journeyDiagram-5HDEW3XC.BxO1aPu_.js +837 -0
- package/library/chunks/{json.D7WeFaJm.js → json.Dz5QFEi5.js} +3 -3
- package/library/chunks/kanban-definition-HUTT4EX6.Bk8vmLFK.js +724 -0
- package/library/chunks/katex.DoRnZ_sp.js +11682 -0
- package/library/chunks/layout.DZcMFKol.js +1446 -0
- package/library/chunks/line.DP-iSN_J.js +157 -0
- package/library/chunks/linear.TNHhsH1m.js +215 -0
- package/library/chunks/{map.BjtxEozr.js → map.CBcV0WVq.js} +100 -105
- package/library/chunks/map.DJnohTgl.js +18 -0
- package/library/chunks/markdown.I1AJG75v.js +4180 -0
- package/library/chunks/math.D2lKC7md.js +22 -0
- package/library/chunks/mermaid.core.Dspbw7Ig.js +13598 -0
- package/library/chunks/mindmap-definition-LN4V7U3C.DuCBBYwE.js +808 -0
- package/library/chunks/{number.CtCaI0T_.js → number.Cx2ncfJJ.js} +2 -2
- package/library/chunks/{option.qN3aaqVI.js → option.DyNR1vzy.js} +2 -2
- package/library/chunks/ordinal.bqVaUip-.js +61 -0
- package/library/chunks/{pagination.Cupa46TN.js → pagination.qFmncShC.js} +5 -5
- package/library/chunks/pegDiagram-2B236MQR.DQrkEdJr.js +97 -0
- package/library/chunks/{percent.D_CkaRGb.js → percent.D8mkiJ2G.js} +17 -17
- package/library/chunks/pieDiagram-ENE6RG2P.B6nPW8Pj.js +212 -0
- package/library/chunks/position-picker.DjnhxIKF.js +4 -0
- package/library/chunks/quadrantDiagram-ABIIQ3AL.BFy9moxz.js +1026 -0
- package/library/chunks/{radar.BMKaNvJH.js → radar.B3p5bRix.js} +78 -129
- package/library/chunks/railroadDiagram-RFXS5EU6.CSao8YZX.js +79 -0
- package/library/chunks/range.DdOGybNB.js +9 -0
- package/library/chunks/requirementDiagram-TGXJPOKE.CjpliZnF.js +882 -0
- package/library/chunks/sankey.BR94A-8L.js +294 -0
- package/library/chunks/sankeyDiagram-HTMAVEWB.D8aAxVGe.js +564 -0
- package/library/chunks/select.C6_sM3Pr.js +7 -0
- package/library/chunks/sequenceDiagram-DBY2YBRQ.Cu9MV3h-.js +2891 -0
- package/library/chunks/sizeCapture-X5ZJPWSS.BDByEFcW.js +46 -0
- package/library/chunks/{sliceGrouper.C-t5ZRrz.js → sliceGrouper.CcRqQhZX.js} +1 -1
- package/library/chunks/stateDiagram-2N3HPSRC.DvrAW9Ck.js +267 -0
- package/library/chunks/stateDiagram-v2-6OUMAXLB.CFfuaFM1.js +18 -0
- package/library/chunks/step.almIqwJ6.js +51 -0
- package/library/chunks/{stock.vF_pji1F.js → stock.CQbn6zW4.js} +9 -9
- package/library/chunks/swimlanes-5IMT3BWC.AtMD47q7.js +5332 -0
- package/library/chunks/swimlanesDiagram-G3AALYLV.26A1eX7s.js +15 -0
- package/library/chunks/{tab-group.kSg5_10g.js → tab-group.1Y71_aN8.js} +3 -3
- package/library/chunks/{time.DWfbnPnM.js → time.DYWuX2id.js} +1 -1
- package/library/chunks/timeline-definition-FHXFAJF6.CYSh6xl5.js +1058 -0
- package/library/chunks/{timeline.gWu0up6r.js → timeline.Czz_uBEd.js} +33 -32
- package/library/chunks/toNumber.MuDz8DgU.js +31 -0
- package/library/chunks/{toString.Dcbz5jVT.js → toString.B1zKIiZc.js} +1 -1
- package/library/chunks/{toast.TDU3wVhq.js → toast.CXEAfCvN.js} +1 -1
- package/library/chunks/transformation.8uLv6uwG.js +264 -0
- package/library/chunks/{tree.C2dPd6gt.js → tree.vn5sHbdt.js} +123 -117
- package/library/chunks/value.BXEGBVFV.js +44 -0
- package/library/chunks/{venn.BVBe-JXs.js → venn.B5Jl-c4i.js} +2 -2
- package/library/chunks/vennDiagram-L72KCM5P.CSk1WWlu.js +1581 -0
- package/library/chunks/wardleyDiagram-EHGQE667.C7UzXYG7.js +675 -0
- package/library/chunks/{watch.DOt4Mabe.js → watch.DJF5K-8U.js} +27 -27
- package/library/chunks/{wc.DTNpfIc1.js → wc.B2THb2Kk.js} +18 -18
- package/library/chunks/xy.BO6U5QrZ.js +294 -0
- package/library/chunks/xychartDiagram-FW5EYKEG.idiZWvYS.js +1383 -0
- package/library/components/alert.js +2 -2
- package/library/components/am-chart.js +3 -3
- package/library/components/animated-image.js +2 -2
- package/library/components/animation.js +2 -2
- package/library/components/array-line-clamp.js +1 -1
- package/library/components/asset-link-format.js +8 -7
- package/library/components/atoms.js +29 -29
- package/library/components/audio.js +3 -3
- package/library/components/avatar.js +2 -2
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb-item.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +3 -3
- package/library/components/checkbox.js +195 -18
- package/library/components/color-picker.js +4 -4
- package/library/components/color-swatch-group.js +5 -5
- package/library/components/color-swatch.js +2 -2
- package/library/components/confirm-popover.js +3 -3
- package/library/components/copy-button.js +2 -2
- package/library/components/corner-position-input-group.js +2 -2
- package/library/components/cropper.js +4 -4
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +2 -2
- package/library/components/dialog.js +3 -3
- package/library/components/diff.js +1 -1
- package/library/components/divider.js +1 -1
- package/library/components/document-viewer.js +3 -3
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +3 -3
- package/library/components/dropdown.js +2 -2
- package/library/components/dynamic-select.js +6 -6
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +2 -2
- package/library/components/file-on-demand.js +350 -374
- package/library/components/folder-select.js +5 -5
- package/library/components/format-time.js +2 -2
- package/library/components/grid-item.js +1 -1
- package/library/components/header.js +2 -2
- package/library/components/hub-connection.js +2 -2
- package/library/components/icon-button.js +2 -2
- package/library/components/icon.js +2 -2
- package/library/components/iframe.js +2 -2
- package/library/components/image-comparer.js +2 -2
- package/library/components/image.js +3 -3
- package/library/components/include.js +1 -1
- package/library/components/input.js +3 -3
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +11 -2704
- package/library/components/masonry.js +76 -73
- package/library/components/menu-item.js +2 -2
- package/library/components/molecules.js +3 -3
- package/library/components/mutation-observer.js +1 -1
- package/library/components/option.js +3 -3
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +6 -6
- package/library/components/position-picker.js +25 -25
- package/library/components/qr-code.js +1 -1
- package/library/components/radio-button.js +1 -1
- package/library/components/radio-card.js +1 -1
- package/library/components/radio-group.js +1 -1
- package/library/components/radio.js +2 -2
- package/library/components/range.js +1 -1
- package/library/components/rating.js +2 -2
- package/library/components/resize-observer.js +1 -1
- package/library/components/select.js +3 -3
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +2 -2
- package/library/components/sidebar.js +3 -3
- package/library/components/size-input-group.js +3 -3
- package/library/components/split-panel.js +1 -1
- package/library/components/step.js +1 -1
- package/library/components/stepper-wizard.js +1 -1
- package/library/components/stepper.js +1 -1
- package/library/components/switch.js +1 -1
- package/library/components/tab-group.js +4 -4
- package/library/components/tab-panel.js +1 -1
- package/library/components/tab.js +2 -2
- package/library/components/tag.js +1 -1
- package/library/components/textarea.js +1 -1
- package/library/components/timecode.js +1 -1
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +4 -4
- package/library/components/tree.js +2 -2
- package/library/components/typeface.js +2 -2
- package/library/components/types.js +122327 -120686
- package/library/components/video.js +2 -2
- package/library/package.json +2 -1
- package/library/packages/atoms/src/components/markdown/markdown.d.ts +41 -1
- package/library/packages/atoms/src/components/markdown/parser.d.ts +18 -3
- package/library/packages/atoms/src/components/markdown/styles.d.ts +17 -0
- package/library/packages/atoms/src/components/tree/tree.d.ts +7 -1
- package/library/packages/atoms/src/components/tree-item/tree-item.d.ts +11 -1
- package/library/packages/events/src/cx-folder-select-loading-change.d.ts +8 -0
- package/library/packages/events/src/events.d.ts +1 -0
- package/library/packages/hybrid/table-core/src/table/styles/table-frozen.styles.d.ts +8 -0
- package/library/packages/hybrid/table-core/src/table/table.d.ts +9 -1
- package/library/packages/hybrid/table-core/src/tabulator-tables/modules/FrozenColumns/FrozenColumns.d.ts +14 -1
- package/library/packages/hybrid/table-core/src/tabulator-tables/modules/ResizeColumns/ResizeColumns.d.ts +18 -1
- package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +7 -0
- package/library/packages/molecules/src/folder-select/folder-select.d.ts +7 -0
- package/library/packages/molecules/src/index.d.ts +1 -0
- package/library/packages/molecules/src/markdown-viewer/markdown-viewer.d.ts +124 -0
- package/library/packages/molecules/src/markdown-viewer/markdown-viewer.styles.d.ts +6 -0
- package/library/packages/molecules/src/masonry/masonry.d.ts +5 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +9 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +30 -0
- package/library/packages/tools/src/tiptap/utils/md/editor-controller.d.ts +57 -0
- package/library/packages/tools/src/tiptap/utils/md/from-markdown.d.ts +11 -0
- package/library/packages/tools/src/tiptap/utils/md/input-rules.d.ts +15 -0
- package/library/packages/tools/src/tiptap/utils/md/schema.d.ts +13 -0
- package/library/packages/tools/src/tiptap/utils/md/to-markdown.d.ts +14 -0
- package/library/packages/types/src/asset-link-format.d.ts +19 -0
- package/library/packages/types/src/markdown-viewer.d.ts +12 -0
- package/library/packages/types/src/tree-item.d.ts +12 -0
- package/library/react-web-component.d.ts +86 -8
- package/library/utils.js +64 -65
- package/package.json +2 -1
- package/library/chunks/Slice.C5lVu2g_.js +0 -120
- package/library/chunks/_baseXor.VohG8cOH.js +0 -116
- package/library/chunks/asset-link-format.QzzboHHE.js +0 -6
- package/library/chunks/checkbox.3i2j3PHc.js +0 -198
- package/library/chunks/content-builder.BU8X7I6V.js +0 -60
- package/library/chunks/debounce.C_J-9zJi.js +0 -82
- package/library/chunks/flow.hz0UDjCb.js +0 -1594
- package/library/chunks/index.DU0XUO4k.js +0 -176
- package/library/chunks/transformation.D1alV_s4.js +0 -189
- package/library/chunks/xy.BNgyrwGD.js +0 -333
|
@@ -0,0 +1,4180 @@
|
|
|
1
|
+
import { C as qn, I as Yn } from "./icon-button.BwmMJ0bI.js";
|
|
2
|
+
import { C as jn, n as de } from "./lib-cortex-element.CVMmyPMC.js";
|
|
3
|
+
import { c as Un } from "./custom-element.L4WJXn1j.js";
|
|
4
|
+
import { L as Gn } from "./i18n.Bchq8v1d.js";
|
|
5
|
+
import { w as _e } from "./watch.DJF5K-8U.js";
|
|
6
|
+
import { s as Hn } from "./string.BhJ0Zogu.js";
|
|
7
|
+
import { i as dt, x as Wn } from "./lit-element.jLBm65_O.js";
|
|
8
|
+
import { r as Kn } from "./state.CSDxrqLd.js";
|
|
9
|
+
import { o as Zn } from "./unsafe-html.Dff7-rCx.js";
|
|
10
|
+
import { c as Ot } from "./_commonjsHelpers.DQNKXVTB.js";
|
|
11
|
+
class Vn extends jn {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(), this.#e();
|
|
14
|
+
}
|
|
15
|
+
createRenderRoot() {
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* LitElement applies the styles of a component to the Shadow DOM.
|
|
20
|
+
* CortexLightElement applies the styles of a component to the Light DOM.
|
|
21
|
+
*/
|
|
22
|
+
#e() {
|
|
23
|
+
if (!Qn(this.constructor))
|
|
24
|
+
return;
|
|
25
|
+
const t = `${this.constructor.name}-styles`;
|
|
26
|
+
if (!document.getElementById(t)) {
|
|
27
|
+
const n = document.createElement("style");
|
|
28
|
+
n.id = t, n.textContent = this.constructor.styles, n.textContent = n.textContent.replace(
|
|
29
|
+
/:host/g,
|
|
30
|
+
`${this.tagName.toLowerCase()}`
|
|
31
|
+
), document.head.appendChild(n);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function Qn(e) {
|
|
36
|
+
return e.styles !== void 0;
|
|
37
|
+
}
|
|
38
|
+
/*! js-yaml 5.2.2 https://github.com/nodeca/js-yaml @license MIT */
|
|
39
|
+
var C = Symbol("NOT_RESOLVED"), mt = Symbol("MERGE_KEY");
|
|
40
|
+
function O(e, t) {
|
|
41
|
+
return {
|
|
42
|
+
tagName: e,
|
|
43
|
+
nodeKind: "scalar",
|
|
44
|
+
implicit: t.implicit ?? !1,
|
|
45
|
+
matchByTagPrefix: t.matchByTagPrefix ?? !1,
|
|
46
|
+
implicitFirstChars: t.implicitFirstChars ?? null,
|
|
47
|
+
resolve: t.resolve,
|
|
48
|
+
identify: t.identify ?? null,
|
|
49
|
+
represent: t.represent ?? ((n) => String(n)),
|
|
50
|
+
representTagName: t.representTagName ?? null
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function kt(e, t) {
|
|
54
|
+
const n = t.finalize === void 0;
|
|
55
|
+
return {
|
|
56
|
+
tagName: e,
|
|
57
|
+
nodeKind: "sequence",
|
|
58
|
+
implicit: !1,
|
|
59
|
+
matchByTagPrefix: t.matchByTagPrefix ?? !1,
|
|
60
|
+
create: t.create,
|
|
61
|
+
addItem: t.addItem,
|
|
62
|
+
finalize: t.finalize ?? ((r) => r),
|
|
63
|
+
carrierIsResult: n,
|
|
64
|
+
identify: t.identify ?? null,
|
|
65
|
+
represent: t.represent ?? ((r) => r),
|
|
66
|
+
representTagName: t.representTagName ?? null
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function Be(e, t) {
|
|
70
|
+
const n = t.finalize === void 0;
|
|
71
|
+
return {
|
|
72
|
+
tagName: e,
|
|
73
|
+
nodeKind: "mapping",
|
|
74
|
+
implicit: !1,
|
|
75
|
+
matchByTagPrefix: t.matchByTagPrefix ?? !1,
|
|
76
|
+
create: t.create,
|
|
77
|
+
addPair: t.addPair,
|
|
78
|
+
has: t.has,
|
|
79
|
+
keys: t.keys,
|
|
80
|
+
get: t.get,
|
|
81
|
+
finalize: t.finalize ?? ((r) => r),
|
|
82
|
+
carrierIsResult: n,
|
|
83
|
+
identify: t.identify ?? null,
|
|
84
|
+
represent: t.represent ?? ((r) => r),
|
|
85
|
+
representTagName: t.representTagName ?? null
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
var Xn = O("tag:yaml.org,2002:str", {
|
|
89
|
+
resolve: (e) => e,
|
|
90
|
+
identify: (e) => typeof e == "string"
|
|
91
|
+
}), Jn = [
|
|
92
|
+
"",
|
|
93
|
+
"~",
|
|
94
|
+
"null",
|
|
95
|
+
"Null",
|
|
96
|
+
"NULL"
|
|
97
|
+
], er = O("tag:yaml.org,2002:null", {
|
|
98
|
+
implicit: !0,
|
|
99
|
+
implicitFirstChars: [
|
|
100
|
+
"",
|
|
101
|
+
"~",
|
|
102
|
+
"n",
|
|
103
|
+
"N"
|
|
104
|
+
],
|
|
105
|
+
resolve: (e) => Jn.indexOf(e) !== -1 ? null : C,
|
|
106
|
+
identify: (e) => e === null,
|
|
107
|
+
represent: () => "null"
|
|
108
|
+
}), tr = O("tag:yaml.org,2002:null", {
|
|
109
|
+
implicit: !0,
|
|
110
|
+
implicitFirstChars: ["n"],
|
|
111
|
+
resolve: (e, t) => e === "null" || t && e === "" ? null : C,
|
|
112
|
+
identify: (e) => e === null,
|
|
113
|
+
represent: () => "null"
|
|
114
|
+
}), nr = [
|
|
115
|
+
"",
|
|
116
|
+
"~",
|
|
117
|
+
"null",
|
|
118
|
+
"Null",
|
|
119
|
+
"NULL"
|
|
120
|
+
], rr = O("tag:yaml.org,2002:null", {
|
|
121
|
+
implicit: !0,
|
|
122
|
+
implicitFirstChars: [
|
|
123
|
+
"",
|
|
124
|
+
"~",
|
|
125
|
+
"n",
|
|
126
|
+
"N"
|
|
127
|
+
],
|
|
128
|
+
resolve: (e) => nr.indexOf(e) !== -1 ? null : C,
|
|
129
|
+
identify: (e) => e === null,
|
|
130
|
+
represent: () => "null"
|
|
131
|
+
}), ir = [
|
|
132
|
+
"true",
|
|
133
|
+
"True",
|
|
134
|
+
"TRUE"
|
|
135
|
+
], ar = [
|
|
136
|
+
"false",
|
|
137
|
+
"False",
|
|
138
|
+
"FALSE"
|
|
139
|
+
], or = O("tag:yaml.org,2002:bool", {
|
|
140
|
+
implicit: !0,
|
|
141
|
+
implicitFirstChars: [
|
|
142
|
+
"t",
|
|
143
|
+
"T",
|
|
144
|
+
"f",
|
|
145
|
+
"F"
|
|
146
|
+
],
|
|
147
|
+
resolve: (e) => ir.indexOf(e) !== -1 ? !0 : ar.indexOf(e) !== -1 ? !1 : C,
|
|
148
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
149
|
+
represent: (e) => e ? "true" : "false"
|
|
150
|
+
}), sr = ["true"], lr = ["false"], cr = O("tag:yaml.org,2002:bool", {
|
|
151
|
+
implicit: !0,
|
|
152
|
+
implicitFirstChars: ["t", "f"],
|
|
153
|
+
resolve: (e) => sr.indexOf(e) !== -1 ? !0 : lr.indexOf(e) !== -1 ? !1 : C,
|
|
154
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
155
|
+
represent: (e) => e ? "true" : "false"
|
|
156
|
+
}), ur = [
|
|
157
|
+
"true",
|
|
158
|
+
"True",
|
|
159
|
+
"TRUE",
|
|
160
|
+
"y",
|
|
161
|
+
"Y",
|
|
162
|
+
"yes",
|
|
163
|
+
"Yes",
|
|
164
|
+
"YES",
|
|
165
|
+
"on",
|
|
166
|
+
"On",
|
|
167
|
+
"ON"
|
|
168
|
+
], pr = [
|
|
169
|
+
"false",
|
|
170
|
+
"False",
|
|
171
|
+
"FALSE",
|
|
172
|
+
"n",
|
|
173
|
+
"N",
|
|
174
|
+
"no",
|
|
175
|
+
"No",
|
|
176
|
+
"NO",
|
|
177
|
+
"off",
|
|
178
|
+
"Off",
|
|
179
|
+
"OFF"
|
|
180
|
+
], hr = O("tag:yaml.org,2002:bool", {
|
|
181
|
+
implicit: !0,
|
|
182
|
+
implicitFirstChars: [
|
|
183
|
+
"y",
|
|
184
|
+
"Y",
|
|
185
|
+
"n",
|
|
186
|
+
"N",
|
|
187
|
+
"t",
|
|
188
|
+
"T",
|
|
189
|
+
"f",
|
|
190
|
+
"F",
|
|
191
|
+
"o",
|
|
192
|
+
"O"
|
|
193
|
+
],
|
|
194
|
+
resolve: (e) => ur.indexOf(e) !== -1 ? !0 : pr.indexOf(e) !== -1 ? !1 : C,
|
|
195
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
196
|
+
represent: (e) => e ? "true" : "false"
|
|
197
|
+
}), fr = /* @__PURE__ */ new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"), gr = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
198
|
+
function dr(e) {
|
|
199
|
+
let t = e, n = 1;
|
|
200
|
+
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
201
|
+
}
|
|
202
|
+
function mr(e, t) {
|
|
203
|
+
if (t) {
|
|
204
|
+
if (!gr.test(e)) return C;
|
|
205
|
+
} else if (!fr.test(e)) return C;
|
|
206
|
+
const n = dr(e);
|
|
207
|
+
return Number.isFinite(n) ? n : C;
|
|
208
|
+
}
|
|
209
|
+
var an = O("tag:yaml.org,2002:int", {
|
|
210
|
+
implicit: !0,
|
|
211
|
+
implicitFirstChars: [
|
|
212
|
+
"-",
|
|
213
|
+
"+",
|
|
214
|
+
..."0123456789"
|
|
215
|
+
],
|
|
216
|
+
resolve: mr,
|
|
217
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
218
|
+
represent: (e) => e.toString(10)
|
|
219
|
+
}), kr = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)$"), xr = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
220
|
+
function br(e) {
|
|
221
|
+
let t = e, n = 1;
|
|
222
|
+
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
223
|
+
}
|
|
224
|
+
function yr(e, t) {
|
|
225
|
+
if (t) {
|
|
226
|
+
if (!xr.test(e)) return C;
|
|
227
|
+
} else if (!kr.test(e)) return C;
|
|
228
|
+
const n = br(e);
|
|
229
|
+
return Number.isFinite(n) ? n : C;
|
|
230
|
+
}
|
|
231
|
+
var wr = O("tag:yaml.org,2002:int", {
|
|
232
|
+
implicit: !0,
|
|
233
|
+
implicitFirstChars: ["-", ..."0123456789"],
|
|
234
|
+
resolve: yr,
|
|
235
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
236
|
+
represent: (e) => e.toString(10)
|
|
237
|
+
}), vr = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");
|
|
238
|
+
function Ar(e) {
|
|
239
|
+
let t = e.replace(/_/g, ""), n = 1;
|
|
240
|
+
if ((t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b")) return n * parseInt(t.slice(2), 2);
|
|
241
|
+
if (t.startsWith("0x")) return n * parseInt(t.slice(2), 16);
|
|
242
|
+
if (t.includes(":")) {
|
|
243
|
+
let r = 0;
|
|
244
|
+
for (const i of t.split(":")) r = r * 60 + Number(i);
|
|
245
|
+
return n * r;
|
|
246
|
+
}
|
|
247
|
+
return t !== "0" && t[0] === "0" ? n * parseInt(t, 8) : n * parseInt(t, 10);
|
|
248
|
+
}
|
|
249
|
+
function Sr(e) {
|
|
250
|
+
if (!vr.test(e)) return C;
|
|
251
|
+
const t = Ar(e);
|
|
252
|
+
return Number.isFinite(t) ? t : C;
|
|
253
|
+
}
|
|
254
|
+
var nt = O("tag:yaml.org,2002:int", {
|
|
255
|
+
implicit: !0,
|
|
256
|
+
implicitFirstChars: [
|
|
257
|
+
"-",
|
|
258
|
+
"+",
|
|
259
|
+
..."0123456789"
|
|
260
|
+
],
|
|
261
|
+
resolve: Sr,
|
|
262
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
263
|
+
represent: (e) => e.toString(10)
|
|
264
|
+
}), Tr = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), Er = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
265
|
+
function Cr(e) {
|
|
266
|
+
if (!Tr.test(e)) return C;
|
|
267
|
+
let t = e.toLowerCase();
|
|
268
|
+
const n = t[0] === "-" ? -1 : 1;
|
|
269
|
+
if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
270
|
+
if (t === ".nan") return NaN;
|
|
271
|
+
const r = n * parseFloat(t);
|
|
272
|
+
return Number.isFinite(r) || Er.test(e) ? r : C;
|
|
273
|
+
}
|
|
274
|
+
function $r(e) {
|
|
275
|
+
if (isNaN(e)) return ".nan";
|
|
276
|
+
if (e === Number.POSITIVE_INFINITY) return ".inf";
|
|
277
|
+
if (e === Number.NEGATIVE_INFINITY) return "-.inf";
|
|
278
|
+
if (Object.is(e, -0)) return "-0.0";
|
|
279
|
+
const t = e.toString(10);
|
|
280
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
281
|
+
}
|
|
282
|
+
var on = O("tag:yaml.org,2002:float", {
|
|
283
|
+
implicit: !0,
|
|
284
|
+
implicitFirstChars: [
|
|
285
|
+
"-",
|
|
286
|
+
"+",
|
|
287
|
+
".",
|
|
288
|
+
..."0123456789"
|
|
289
|
+
],
|
|
290
|
+
resolve: Cr,
|
|
291
|
+
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
292
|
+
represent: $r
|
|
293
|
+
}), Fr = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"), Ir = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
294
|
+
function _r(e, t) {
|
|
295
|
+
if (t) {
|
|
296
|
+
if (!Ir.test(e)) return C;
|
|
297
|
+
let r = e.toLowerCase();
|
|
298
|
+
const i = r[0] === "-" ? -1 : 1;
|
|
299
|
+
if ("+-".includes(r[0]) && (r = r.slice(1)), r === ".inf") return i === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
300
|
+
if (r === ".nan") return NaN;
|
|
301
|
+
const a = i * parseFloat(r);
|
|
302
|
+
return Number.isFinite(a) ? a : C;
|
|
303
|
+
}
|
|
304
|
+
if (!Fr.test(e)) return C;
|
|
305
|
+
const n = Number(e);
|
|
306
|
+
return Number.isFinite(n) ? n : C;
|
|
307
|
+
}
|
|
308
|
+
function Rr(e) {
|
|
309
|
+
if (isNaN(e)) return ".nan";
|
|
310
|
+
if (e === Number.POSITIVE_INFINITY) return ".inf";
|
|
311
|
+
if (e === Number.NEGATIVE_INFINITY) return "-.inf";
|
|
312
|
+
if (Object.is(e, -0)) return "-0.0";
|
|
313
|
+
const t = e.toString(10);
|
|
314
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
315
|
+
}
|
|
316
|
+
var Nr = O("tag:yaml.org,2002:float", {
|
|
317
|
+
implicit: !0,
|
|
318
|
+
implicitFirstChars: ["-", ..."0123456789"],
|
|
319
|
+
resolve: _r,
|
|
320
|
+
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
321
|
+
represent: Rr
|
|
322
|
+
}), Lr = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), Pr = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
323
|
+
function Or(e) {
|
|
324
|
+
if (!Lr.test(e)) return C;
|
|
325
|
+
let t = e.toLowerCase().replace(/_/g, "");
|
|
326
|
+
const n = t[0] === "-" ? -1 : 1;
|
|
327
|
+
if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
328
|
+
if (t === ".nan") return NaN;
|
|
329
|
+
let r = 0;
|
|
330
|
+
if (t.includes(":")) {
|
|
331
|
+
for (const i of t.split(":")) r = r * 60 + Number(i);
|
|
332
|
+
r *= n;
|
|
333
|
+
} else r = n * parseFloat(t);
|
|
334
|
+
return Number.isFinite(r) || Pr.test(e) ? r : C;
|
|
335
|
+
}
|
|
336
|
+
function zr(e) {
|
|
337
|
+
if (isNaN(e)) return ".nan";
|
|
338
|
+
if (e === Number.POSITIVE_INFINITY) return ".inf";
|
|
339
|
+
if (e === Number.NEGATIVE_INFINITY) return "-.inf";
|
|
340
|
+
if (Object.is(e, -0)) return "-0.0";
|
|
341
|
+
const t = e.toString(10);
|
|
342
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
343
|
+
}
|
|
344
|
+
var rt = O("tag:yaml.org,2002:float", {
|
|
345
|
+
implicit: !0,
|
|
346
|
+
implicitFirstChars: [
|
|
347
|
+
"-",
|
|
348
|
+
"+",
|
|
349
|
+
".",
|
|
350
|
+
..."0123456789"
|
|
351
|
+
],
|
|
352
|
+
resolve: Or,
|
|
353
|
+
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
354
|
+
represent: zr
|
|
355
|
+
}), Mr = O("tag:yaml.org,2002:merge", {
|
|
356
|
+
implicit: !0,
|
|
357
|
+
implicitFirstChars: ["<"],
|
|
358
|
+
resolve: (e, t) => e === "<<" || t && e === "" ? mt : C
|
|
359
|
+
}), Br = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
360
|
+
function Dr(e) {
|
|
361
|
+
const t = e.replace(/\s/g, "");
|
|
362
|
+
if (t.length % 4 !== 0 || !Br.test(t)) return C;
|
|
363
|
+
const n = atob(t), r = new Uint8Array(n.length);
|
|
364
|
+
for (let i = 0; i < n.length; i++) r[i] = n.charCodeAt(i);
|
|
365
|
+
return r;
|
|
366
|
+
}
|
|
367
|
+
function qr(e) {
|
|
368
|
+
let t = "";
|
|
369
|
+
for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
|
|
370
|
+
return btoa(t);
|
|
371
|
+
}
|
|
372
|
+
var Yr = O("tag:yaml.org,2002:binary", {
|
|
373
|
+
resolve: Dr,
|
|
374
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Uint8Array]",
|
|
375
|
+
represent: qr
|
|
376
|
+
}), jr = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), Ur = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
377
|
+
function Gr(e) {
|
|
378
|
+
let t = jr.exec(e);
|
|
379
|
+
if (t === null && (t = Ur.exec(e)), t === null) return C;
|
|
380
|
+
const n = +t[1], r = +t[2] - 1, i = +t[3];
|
|
381
|
+
if (!t[4]) {
|
|
382
|
+
const u = new Date(Date.UTC(n, r, i));
|
|
383
|
+
return u.getUTCFullYear() !== n || u.getUTCMonth() !== r || u.getUTCDate() !== i ? C : u;
|
|
384
|
+
}
|
|
385
|
+
const a = +t[4], s = +t[5], o = +t[6];
|
|
386
|
+
let l = 0;
|
|
387
|
+
if (a > 23 || s > 59 || o > 59) return C;
|
|
388
|
+
if (t[7]) {
|
|
389
|
+
let u = t[7].slice(0, 3);
|
|
390
|
+
for (; u.length < 3; ) u += "0";
|
|
391
|
+
l = +u;
|
|
392
|
+
}
|
|
393
|
+
const c = new Date(Date.UTC(n, r, i, a, s, o, l));
|
|
394
|
+
if (c.getUTCFullYear() !== n || c.getUTCMonth() !== r || c.getUTCDate() !== i) return C;
|
|
395
|
+
if (t[9]) {
|
|
396
|
+
const u = +t[10], f = +(t[11] || 0);
|
|
397
|
+
if (u > 23 || f > 59) return C;
|
|
398
|
+
const g = (u * 60 + f) * 6e4;
|
|
399
|
+
c.setTime(c.getTime() - (t[9] === "-" ? -g : g));
|
|
400
|
+
}
|
|
401
|
+
return c;
|
|
402
|
+
}
|
|
403
|
+
var Hr = O("tag:yaml.org,2002:timestamp", {
|
|
404
|
+
implicit: !0,
|
|
405
|
+
implicitFirstChars: [..."0123456789"],
|
|
406
|
+
resolve: Gr,
|
|
407
|
+
identify: (e) => e instanceof Date,
|
|
408
|
+
represent: (e) => e.toISOString()
|
|
409
|
+
}), Wr = kt("tag:yaml.org,2002:seq", {
|
|
410
|
+
create: () => [],
|
|
411
|
+
addItem: (e, t) => {
|
|
412
|
+
e.push(t);
|
|
413
|
+
},
|
|
414
|
+
identify: Array.isArray
|
|
415
|
+
});
|
|
416
|
+
function De(e) {
|
|
417
|
+
if (e === null || typeof e != "object" || Array.isArray(e)) return !1;
|
|
418
|
+
const t = Object.getPrototypeOf(e);
|
|
419
|
+
return t === null || t === Object.prototype;
|
|
420
|
+
}
|
|
421
|
+
function zt(e, t) {
|
|
422
|
+
const n = {};
|
|
423
|
+
for (const r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
424
|
+
return n;
|
|
425
|
+
}
|
|
426
|
+
var Kr = kt("tag:yaml.org,2002:omap", {
|
|
427
|
+
create: () => ({
|
|
428
|
+
list: [],
|
|
429
|
+
seen: /* @__PURE__ */ new Set()
|
|
430
|
+
}),
|
|
431
|
+
addItem: (e, t) => {
|
|
432
|
+
let n;
|
|
433
|
+
if (t instanceof Map) {
|
|
434
|
+
if (t.size !== 1) return "cannot resolve an ordered map item";
|
|
435
|
+
n = t.keys().next().value;
|
|
436
|
+
} else if (De(t)) {
|
|
437
|
+
const r = Object.keys(t);
|
|
438
|
+
if (r.length !== 1) return "cannot resolve an ordered map item";
|
|
439
|
+
n = r[0];
|
|
440
|
+
} else return "cannot resolve an ordered map item";
|
|
441
|
+
return e.seen.has(n) ? "duplicate key in ordered map" : (e.seen.add(n), e.list.push(t), "");
|
|
442
|
+
},
|
|
443
|
+
finalize: (e) => e.list
|
|
444
|
+
}), Zr = kt("tag:yaml.org,2002:pairs", {
|
|
445
|
+
create: () => [],
|
|
446
|
+
addItem: (e, t) => {
|
|
447
|
+
if (t instanceof Map)
|
|
448
|
+
return t.size !== 1 ? "cannot resolve a pairs item" : (e.push(t.entries().next().value), "");
|
|
449
|
+
if (Object.prototype.toString.call(t) !== "[object Object]") return "cannot resolve a pairs item";
|
|
450
|
+
const n = t, r = Object.keys(n);
|
|
451
|
+
return r.length !== 1 ? "cannot resolve a pairs item" : (e.push([r[0], n[r[0]]]), "");
|
|
452
|
+
}
|
|
453
|
+
}), Vr = Be("tag:yaml.org,2002:map", {
|
|
454
|
+
create: () => ({}),
|
|
455
|
+
identify: De,
|
|
456
|
+
represent: (e) => {
|
|
457
|
+
const t = /* @__PURE__ */ new Map();
|
|
458
|
+
for (const n of Object.keys(e)) t.set(n, e[n]);
|
|
459
|
+
return t;
|
|
460
|
+
},
|
|
461
|
+
addPair: (e, t, n) => {
|
|
462
|
+
if (t !== null && typeof t == "object") return "object-based map does not support complex keys";
|
|
463
|
+
const r = String(t);
|
|
464
|
+
return r === "__proto__" ? Object.defineProperty(e, r, {
|
|
465
|
+
value: n,
|
|
466
|
+
enumerable: !0,
|
|
467
|
+
configurable: !0,
|
|
468
|
+
writable: !0
|
|
469
|
+
}) : e[r] = n, "";
|
|
470
|
+
},
|
|
471
|
+
has: (e, t) => t !== null && typeof t == "object" ? !1 : Object.prototype.hasOwnProperty.call(e, String(t)),
|
|
472
|
+
keys: (e) => Object.keys(e),
|
|
473
|
+
get: (e, t) => e[String(t)]
|
|
474
|
+
}), Qr = Be("tag:yaml.org,2002:set", {
|
|
475
|
+
create: () => /* @__PURE__ */ new Set(),
|
|
476
|
+
identify: (e) => e instanceof Set,
|
|
477
|
+
represent: (e) => {
|
|
478
|
+
const t = /* @__PURE__ */ new Map();
|
|
479
|
+
for (const n of e) t.set(n, null);
|
|
480
|
+
return t;
|
|
481
|
+
},
|
|
482
|
+
addPair: (e, t, n) => n !== null ? "cannot resolve a set item" : (e.add(t), ""),
|
|
483
|
+
has: (e, t) => e.has(t),
|
|
484
|
+
keys: (e) => e.keys(),
|
|
485
|
+
get: () => null
|
|
486
|
+
});
|
|
487
|
+
function Xr() {
|
|
488
|
+
return {
|
|
489
|
+
scalar: {},
|
|
490
|
+
sequence: {},
|
|
491
|
+
mapping: {}
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
function Jr() {
|
|
495
|
+
return {
|
|
496
|
+
scalar: [],
|
|
497
|
+
sequence: [],
|
|
498
|
+
mapping: []
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
function ei(e) {
|
|
502
|
+
const t = [];
|
|
503
|
+
for (const n of e) {
|
|
504
|
+
let r = t.length;
|
|
505
|
+
for (let i = 0; i < t.length; i++) {
|
|
506
|
+
const a = t[i];
|
|
507
|
+
if (a.nodeKind === n.nodeKind && a.tagName === n.tagName && a.matchByTagPrefix === n.matchByTagPrefix) {
|
|
508
|
+
r = i;
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
t[r] = n;
|
|
513
|
+
}
|
|
514
|
+
return t;
|
|
515
|
+
}
|
|
516
|
+
var qe = class sn {
|
|
517
|
+
tags;
|
|
518
|
+
implicitScalarTags;
|
|
519
|
+
implicitScalarByFirstChar;
|
|
520
|
+
implicitScalarAnyFirstChar;
|
|
521
|
+
defaultScalarTag;
|
|
522
|
+
defaultSequenceTag;
|
|
523
|
+
defaultMappingTag;
|
|
524
|
+
exact;
|
|
525
|
+
prefix;
|
|
526
|
+
constructor(t) {
|
|
527
|
+
const n = ei(t), r = [], i = Xr(), a = Jr();
|
|
528
|
+
for (const u of n) {
|
|
529
|
+
if (u.nodeKind === "scalar" && u.implicit) {
|
|
530
|
+
if (u.matchByTagPrefix) throw new Error("Implicit scalar tags cannot match by tag prefix");
|
|
531
|
+
r.push(u);
|
|
532
|
+
}
|
|
533
|
+
switch (u.nodeKind) {
|
|
534
|
+
case "scalar":
|
|
535
|
+
u.matchByTagPrefix ? a.scalar.push(u) : i.scalar[u.tagName] = u;
|
|
536
|
+
break;
|
|
537
|
+
case "sequence":
|
|
538
|
+
u.matchByTagPrefix ? a.sequence.push(u) : i.sequence[u.tagName] = u;
|
|
539
|
+
break;
|
|
540
|
+
case "mapping":
|
|
541
|
+
u.matchByTagPrefix ? a.mapping.push(u) : i.mapping[u.tagName] = u;
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
const s = r.filter((u) => u.implicitFirstChars === null), o = /* @__PURE__ */ new Set();
|
|
546
|
+
for (const u of r) if (u.implicitFirstChars !== null) for (const f of u.implicitFirstChars) o.add(f);
|
|
547
|
+
const l = /* @__PURE__ */ new Map();
|
|
548
|
+
for (const u of o) l.set(u, r.filter((f) => f.implicitFirstChars === null || f.implicitFirstChars.indexOf(u) !== -1));
|
|
549
|
+
const c = i.scalar["tag:yaml.org,2002:str"];
|
|
550
|
+
if (!c) throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");
|
|
551
|
+
this.tags = n, this.implicitScalarTags = r, this.implicitScalarByFirstChar = l, this.implicitScalarAnyFirstChar = s, this.defaultScalarTag = c, this.defaultSequenceTag = i.sequence["tag:yaml.org,2002:seq"], this.defaultMappingTag = i.mapping["tag:yaml.org,2002:map"], this.exact = i, this.prefix = a;
|
|
552
|
+
}
|
|
553
|
+
withTags(...t) {
|
|
554
|
+
let n = [];
|
|
555
|
+
for (const r of t) n = n.concat(r);
|
|
556
|
+
return new sn([...this.tags, ...n]);
|
|
557
|
+
}
|
|
558
|
+
}, xt = new qe([
|
|
559
|
+
Xn,
|
|
560
|
+
Wr,
|
|
561
|
+
Vr
|
|
562
|
+
]);
|
|
563
|
+
new qe([
|
|
564
|
+
...xt.tags,
|
|
565
|
+
tr,
|
|
566
|
+
cr,
|
|
567
|
+
wr,
|
|
568
|
+
Nr
|
|
569
|
+
]);
|
|
570
|
+
var ti = new qe([
|
|
571
|
+
...xt.tags,
|
|
572
|
+
er,
|
|
573
|
+
or,
|
|
574
|
+
an,
|
|
575
|
+
on
|
|
576
|
+
]), ni = new qe([
|
|
577
|
+
...xt.tags,
|
|
578
|
+
rr,
|
|
579
|
+
hr,
|
|
580
|
+
nt,
|
|
581
|
+
rt,
|
|
582
|
+
Hr,
|
|
583
|
+
Mr,
|
|
584
|
+
Yr,
|
|
585
|
+
Kr,
|
|
586
|
+
Zr,
|
|
587
|
+
Qr
|
|
588
|
+
]);
|
|
589
|
+
Be("tag:yaml.org,2002:map", {
|
|
590
|
+
create: () => /* @__PURE__ */ new Map(),
|
|
591
|
+
addPair: (e, t, n) => (e.set(t, n), ""),
|
|
592
|
+
has: (e, t) => e.has(t),
|
|
593
|
+
keys: (e) => e.keys(),
|
|
594
|
+
get: (e, t) => e.get(t),
|
|
595
|
+
identify: (e) => e instanceof Map || De(e),
|
|
596
|
+
represent: (e) => {
|
|
597
|
+
if (e instanceof Map) return e;
|
|
598
|
+
const t = /* @__PURE__ */ new Map(), n = e;
|
|
599
|
+
for (const r of Object.keys(n)) t.set(r, n[r]);
|
|
600
|
+
return t;
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
function Mt(e) {
|
|
604
|
+
if (Array.isArray(e)) {
|
|
605
|
+
const t = Array.prototype.slice.call(e);
|
|
606
|
+
for (let n = 0; n < t.length; n++) {
|
|
607
|
+
if (Array.isArray(t[n])) return null;
|
|
608
|
+
typeof t[n] == "object" && Object.prototype.toString.call(t[n]) === "[object Object]" && (t[n] = "[object Object]");
|
|
609
|
+
}
|
|
610
|
+
return String(t);
|
|
611
|
+
}
|
|
612
|
+
return typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" ? "[object Object]" : String(e);
|
|
613
|
+
}
|
|
614
|
+
Be("tag:yaml.org,2002:map", {
|
|
615
|
+
create: () => ({}),
|
|
616
|
+
identify: De,
|
|
617
|
+
represent: (e) => {
|
|
618
|
+
const t = /* @__PURE__ */ new Map();
|
|
619
|
+
for (const n of Object.keys(e)) t.set(n, e[n]);
|
|
620
|
+
return t;
|
|
621
|
+
},
|
|
622
|
+
addPair: (e, t, n) => {
|
|
623
|
+
const r = Mt(t);
|
|
624
|
+
return r === null ? "nested arrays are not supported inside keys" : (r === "__proto__" ? Object.defineProperty(e, r, {
|
|
625
|
+
value: n,
|
|
626
|
+
enumerable: !0,
|
|
627
|
+
configurable: !0,
|
|
628
|
+
writable: !0
|
|
629
|
+
}) : e[r] = n, "");
|
|
630
|
+
},
|
|
631
|
+
has: (e, t) => {
|
|
632
|
+
const n = Mt(t);
|
|
633
|
+
return n !== null && Object.prototype.hasOwnProperty.call(e, n);
|
|
634
|
+
},
|
|
635
|
+
keys: (e) => Object.keys(e),
|
|
636
|
+
get: (e, t) => e[String(t)]
|
|
637
|
+
});
|
|
638
|
+
var ri = {
|
|
639
|
+
maxLength: 79,
|
|
640
|
+
indent: 1,
|
|
641
|
+
linesBefore: 3,
|
|
642
|
+
linesAfter: 2
|
|
643
|
+
};
|
|
644
|
+
function Ke(e, t, n, r, i) {
|
|
645
|
+
let a = "", s = "";
|
|
646
|
+
const o = Math.floor(i / 2) - 1;
|
|
647
|
+
return r - t > o && (a = " ... ", t = r - o + a.length), n - r > o && (s = " ...", n = r + o - s.length), {
|
|
648
|
+
str: a + e.slice(t, n).replace(/\t/g, "→") + s,
|
|
649
|
+
pos: r - t + a.length
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
function Ze(e, t) {
|
|
653
|
+
return " ".repeat(Math.max(t - e.length, 0)) + e;
|
|
654
|
+
}
|
|
655
|
+
function ii(e, t) {
|
|
656
|
+
if (!e.buffer) return null;
|
|
657
|
+
const n = {
|
|
658
|
+
...ri,
|
|
659
|
+
...t
|
|
660
|
+
}, r = /\r?\n|\r|\0/g, i = [0], a = [];
|
|
661
|
+
let s, o = -1;
|
|
662
|
+
for (; s = r.exec(e.buffer); )
|
|
663
|
+
a.push(s.index), i.push(s.index + s[0].length), e.position <= s.index && o < 0 && (o = i.length - 2);
|
|
664
|
+
o < 0 && (o = i.length - 1);
|
|
665
|
+
let l = "";
|
|
666
|
+
const c = Math.min(e.line + n.linesAfter, a.length).toString().length, u = n.maxLength - (n.indent + c + 3);
|
|
667
|
+
for (let g = 1; g <= n.linesBefore && !(o - g < 0); g++) {
|
|
668
|
+
const y = Ke(e.buffer, i[o - g], a[o - g], e.position - (i[o] - i[o - g]), u);
|
|
669
|
+
l = `${" ".repeat(n.indent)}${Ze((e.line - g + 1).toString(), c)} | ${y.str}
|
|
670
|
+
${l}`;
|
|
671
|
+
}
|
|
672
|
+
const f = Ke(e.buffer, i[o], a[o], e.position, u);
|
|
673
|
+
l += `${" ".repeat(n.indent)}${Ze((e.line + 1).toString(), c)} | ${f.str}
|
|
674
|
+
`, l += `${"-".repeat(n.indent + c + 3 + f.pos)}^
|
|
675
|
+
`;
|
|
676
|
+
for (let g = 1; g <= n.linesAfter && !(o + g >= a.length); g++) {
|
|
677
|
+
const y = Ke(e.buffer, i[o + g], a[o + g], e.position - (i[o] - i[o + g]), u);
|
|
678
|
+
l += `${" ".repeat(n.indent)}${Ze((e.line + g + 1).toString(), c)} | ${y.str}
|
|
679
|
+
`;
|
|
680
|
+
}
|
|
681
|
+
return l.replace(/\n$/, "");
|
|
682
|
+
}
|
|
683
|
+
function Bt(e, t) {
|
|
684
|
+
let n = "";
|
|
685
|
+
return e.mark ? (e.mark.name && (n += `in "${e.mark.name}" `), n += `(${e.mark.line + 1}:${e.mark.column + 1})`, !t && e.mark.snippet && (n += `
|
|
686
|
+
|
|
687
|
+
${e.mark.snippet}`), `${e.reason} ${n}`) : e.reason;
|
|
688
|
+
}
|
|
689
|
+
var Re = class extends Error {
|
|
690
|
+
reason;
|
|
691
|
+
mark;
|
|
692
|
+
constructor(e, t) {
|
|
693
|
+
super(), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = Bt(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
694
|
+
}
|
|
695
|
+
toString(e) {
|
|
696
|
+
return `${this.name}: ${Bt(this, e)}`;
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
function Ye(e, t, n, r = "") {
|
|
700
|
+
let i = 0, a = 0;
|
|
701
|
+
for (let o = 0; o < t; o++) {
|
|
702
|
+
const l = e.charCodeAt(o);
|
|
703
|
+
l === 10 ? (i++, a = o + 1) : l === 13 && (i++, e.charCodeAt(o + 1) === 10 && o++, a = o + 1);
|
|
704
|
+
}
|
|
705
|
+
const s = {
|
|
706
|
+
name: r,
|
|
707
|
+
buffer: e,
|
|
708
|
+
position: t,
|
|
709
|
+
line: i,
|
|
710
|
+
column: t - a
|
|
711
|
+
};
|
|
712
|
+
throw s.snippet = ii(s), new Re(n, s);
|
|
713
|
+
}
|
|
714
|
+
var ai = -1;
|
|
715
|
+
function Dt(e) {
|
|
716
|
+
switch (e) {
|
|
717
|
+
case 48:
|
|
718
|
+
return "\0";
|
|
719
|
+
case 97:
|
|
720
|
+
return "\x07";
|
|
721
|
+
case 98:
|
|
722
|
+
return "\b";
|
|
723
|
+
case 116:
|
|
724
|
+
return " ";
|
|
725
|
+
case 9:
|
|
726
|
+
return " ";
|
|
727
|
+
case 110:
|
|
728
|
+
return `
|
|
729
|
+
`;
|
|
730
|
+
case 118:
|
|
731
|
+
return "\v";
|
|
732
|
+
case 102:
|
|
733
|
+
return "\f";
|
|
734
|
+
case 114:
|
|
735
|
+
return "\r";
|
|
736
|
+
case 101:
|
|
737
|
+
return "\x1B";
|
|
738
|
+
case 32:
|
|
739
|
+
return " ";
|
|
740
|
+
case 34:
|
|
741
|
+
return '"';
|
|
742
|
+
case 47:
|
|
743
|
+
return "/";
|
|
744
|
+
case 92:
|
|
745
|
+
return "\\";
|
|
746
|
+
case 78:
|
|
747
|
+
return "
";
|
|
748
|
+
case 95:
|
|
749
|
+
return " ";
|
|
750
|
+
case 76:
|
|
751
|
+
return "\u2028";
|
|
752
|
+
case 80:
|
|
753
|
+
return "\u2029";
|
|
754
|
+
default:
|
|
755
|
+
return "";
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
var ln = new Array(256), cn = new Array(256);
|
|
759
|
+
for (let e = 0; e < 256; e++)
|
|
760
|
+
ln[e] = Dt(e) ? 1 : 0, cn[e] = Dt(e);
|
|
761
|
+
function oi(e) {
|
|
762
|
+
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
|
|
763
|
+
}
|
|
764
|
+
function si(e) {
|
|
765
|
+
return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
|
|
766
|
+
}
|
|
767
|
+
function li(e) {
|
|
768
|
+
return e === 120 ? 2 : e === 117 ? 4 : 8;
|
|
769
|
+
}
|
|
770
|
+
function Ne(e, t, n) {
|
|
771
|
+
let r = 0;
|
|
772
|
+
for (; t < n; ) {
|
|
773
|
+
const i = e.charCodeAt(t);
|
|
774
|
+
if (i === 10)
|
|
775
|
+
r++, t++;
|
|
776
|
+
else if (i === 13)
|
|
777
|
+
r++, t++, e.charCodeAt(t) === 10 && t++;
|
|
778
|
+
else if (i === 32 || i === 9) t++;
|
|
779
|
+
else break;
|
|
780
|
+
}
|
|
781
|
+
return {
|
|
782
|
+
position: t,
|
|
783
|
+
breaks: r
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
function bt(e) {
|
|
787
|
+
return e === 1 ? " " : `
|
|
788
|
+
`.repeat(e - 1);
|
|
789
|
+
}
|
|
790
|
+
function ci(e, t, n) {
|
|
791
|
+
let r = "", i = t, a = t, s = t;
|
|
792
|
+
for (; i < n; ) {
|
|
793
|
+
const o = e.charCodeAt(i);
|
|
794
|
+
if (o === 10 || o === 13) {
|
|
795
|
+
r += e.slice(a, s);
|
|
796
|
+
const l = Ne(e, i, n);
|
|
797
|
+
r += bt(l.breaks), i = a = s = l.position;
|
|
798
|
+
} else
|
|
799
|
+
i++, o !== 32 && o !== 9 && (s = i);
|
|
800
|
+
}
|
|
801
|
+
return r + e.slice(a, s);
|
|
802
|
+
}
|
|
803
|
+
function ui(e, t, n) {
|
|
804
|
+
let r = "", i = t, a = t, s = t;
|
|
805
|
+
for (; i < n; ) {
|
|
806
|
+
const o = e.charCodeAt(i);
|
|
807
|
+
if (o === 39)
|
|
808
|
+
r += e.slice(a, i) + "'", i += 2, a = s = i;
|
|
809
|
+
else if (o === 10 || o === 13) {
|
|
810
|
+
r += e.slice(a, s);
|
|
811
|
+
const l = Ne(e, i, n);
|
|
812
|
+
r += bt(l.breaks), i = a = s = l.position;
|
|
813
|
+
} else
|
|
814
|
+
i++, o !== 32 && o !== 9 && (s = i);
|
|
815
|
+
}
|
|
816
|
+
return r + e.slice(a, n);
|
|
817
|
+
}
|
|
818
|
+
function pi(e, t, n) {
|
|
819
|
+
let r = "", i = t, a = t, s = t;
|
|
820
|
+
for (; i < n; ) {
|
|
821
|
+
const o = e.charCodeAt(i);
|
|
822
|
+
if (o === 92) {
|
|
823
|
+
r += e.slice(a, i), i++;
|
|
824
|
+
const l = e.charCodeAt(i);
|
|
825
|
+
if (l === 10 || l === 13) i = Ne(e, i, n).position;
|
|
826
|
+
else if (l < 256 && ln[l])
|
|
827
|
+
r += cn[l], i++;
|
|
828
|
+
else {
|
|
829
|
+
let c = li(l), u = 0;
|
|
830
|
+
for (; c > 0; c--) {
|
|
831
|
+
i++;
|
|
832
|
+
const f = si(e.charCodeAt(i));
|
|
833
|
+
u = (u << 4) + f;
|
|
834
|
+
}
|
|
835
|
+
r += oi(u), i++;
|
|
836
|
+
}
|
|
837
|
+
a = s = i;
|
|
838
|
+
} else if (o === 10 || o === 13) {
|
|
839
|
+
r += e.slice(a, s);
|
|
840
|
+
const l = Ne(e, i, n);
|
|
841
|
+
r += bt(l.breaks), i = a = s = l.position;
|
|
842
|
+
} else
|
|
843
|
+
i++, o !== 32 && o !== 9 && (s = i);
|
|
844
|
+
}
|
|
845
|
+
return r + e.slice(a, n);
|
|
846
|
+
}
|
|
847
|
+
function qt(e, t, n, r, i, a) {
|
|
848
|
+
const s = r < 0 ? 0 : r, o = e.slice(t, n).replace(/\r\n?/g, `
|
|
849
|
+
`), l = o === "" ? [] : (o.endsWith(`
|
|
850
|
+
`) ? o.slice(0, -1) : o).split(`
|
|
851
|
+
`);
|
|
852
|
+
let c = "", u = !1, f = 0, g = !1;
|
|
853
|
+
for (const y of l) {
|
|
854
|
+
let x = 0;
|
|
855
|
+
for (; x < s && y.charCodeAt(x) === 32; ) x++;
|
|
856
|
+
if (r < 0 || x >= y.length) {
|
|
857
|
+
f++;
|
|
858
|
+
continue;
|
|
859
|
+
}
|
|
860
|
+
const A = y.slice(s), S = A.charCodeAt(0);
|
|
861
|
+
a ? S === 32 || S === 9 ? (g = !0, c += `
|
|
862
|
+
`.repeat(u ? 1 + f : f)) : g ? (g = !1, c += `
|
|
863
|
+
`.repeat(f + 1)) : f === 0 ? u && (c += " ") : c += `
|
|
864
|
+
`.repeat(f) : c += `
|
|
865
|
+
`.repeat(u ? 1 + f : f), c += A, u = !0, f = 0;
|
|
866
|
+
}
|
|
867
|
+
return i === 3 ? c += `
|
|
868
|
+
`.repeat(u ? 1 + f : f) : i !== 2 && u && (c += `
|
|
869
|
+
`), c;
|
|
870
|
+
}
|
|
871
|
+
function hi(e, t) {
|
|
872
|
+
if (t.valueStart === ai) return "";
|
|
873
|
+
const { valueStart: n, valueEnd: r } = t;
|
|
874
|
+
if (t.fast) return e.slice(n, r);
|
|
875
|
+
switch (t.style) {
|
|
876
|
+
case 2:
|
|
877
|
+
return ui(e, n, r);
|
|
878
|
+
case 3:
|
|
879
|
+
return pi(e, n, r);
|
|
880
|
+
case 4:
|
|
881
|
+
return qt(e, n, r, t.indent, t.chomping, !1);
|
|
882
|
+
case 5:
|
|
883
|
+
return qt(e, n, r, t.indent, t.chomping, !0);
|
|
884
|
+
default:
|
|
885
|
+
return ci(e, n, r);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
var fi = {
|
|
889
|
+
"!": "!",
|
|
890
|
+
"!!": "tag:yaml.org,2002:"
|
|
891
|
+
};
|
|
892
|
+
function un(e, t) {
|
|
893
|
+
if (e.startsWith("!<") && e.endsWith(">")) return decodeURIComponent(e.slice(2, -1));
|
|
894
|
+
const n = e.indexOf("!", 1), r = n === -1 ? "!" : e.slice(0, n + 1), i = t?.[r] ?? fi[r] ?? r;
|
|
895
|
+
return decodeURIComponent(i) + decodeURIComponent(e.slice(r.length));
|
|
896
|
+
}
|
|
897
|
+
var pe = -1, yt = {
|
|
898
|
+
filename: "",
|
|
899
|
+
schema: ti,
|
|
900
|
+
json: !1,
|
|
901
|
+
maxTotalMergeKeys: 1e4,
|
|
902
|
+
maxAliases: -1
|
|
903
|
+
};
|
|
904
|
+
function gi(e) {
|
|
905
|
+
return "tagStart" in e && e.tagStart !== pe ? e.tagStart : "anchorStart" in e && e.anchorStart !== pe ? e.anchorStart : "valueStart" in e && e.valueStart !== pe ? e.valueStart : "start" in e ? e.start : 0;
|
|
906
|
+
}
|
|
907
|
+
function B(e, t) {
|
|
908
|
+
Ye(e.source, e.position, t, e.filename);
|
|
909
|
+
}
|
|
910
|
+
function pn(e, t, n, r) {
|
|
911
|
+
try {
|
|
912
|
+
return n.finalize(r);
|
|
913
|
+
} catch (i) {
|
|
914
|
+
if (i instanceof Re) throw i;
|
|
915
|
+
Ye(e.source, t, i instanceof Error ? i.message : String(i), e.filename);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
function Ie(e, t, n) {
|
|
919
|
+
const r = e[n];
|
|
920
|
+
if (r) return r;
|
|
921
|
+
for (const i of t) if (n.startsWith(i.tagName)) return i;
|
|
922
|
+
}
|
|
923
|
+
function di(e, t, n, r, i) {
|
|
924
|
+
const a = Ie(t, n, r);
|
|
925
|
+
if (a) return a;
|
|
926
|
+
B(e, `unknown ${i} tag !<${r}>`);
|
|
927
|
+
}
|
|
928
|
+
function mi(e, t) {
|
|
929
|
+
const n = hi(e.source, t), r = t.tagStart === pe ? "" : e.source.slice(t.tagStart, t.tagEnd), i = e.schema.defaultScalarTag;
|
|
930
|
+
if (r !== "") {
|
|
931
|
+
if (r === "!") return {
|
|
932
|
+
value: n,
|
|
933
|
+
tag: i
|
|
934
|
+
};
|
|
935
|
+
const a = un(r, e.tagHandlers), s = Ie(e.schema.exact.scalar, e.schema.prefix.scalar, a);
|
|
936
|
+
if (s) {
|
|
937
|
+
const l = s.resolve(n, !0, a);
|
|
938
|
+
return l === C && B(e, `cannot resolve a node with !<${a}> explicit tag`), {
|
|
939
|
+
value: l,
|
|
940
|
+
tag: s
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
const o = Ie(e.schema.exact.mapping, e.schema.prefix.mapping, a) ?? Ie(e.schema.exact.sequence, e.schema.prefix.sequence, a);
|
|
944
|
+
if (o) {
|
|
945
|
+
n !== "" && B(e, `cannot resolve a node with !<${a}> explicit tag`);
|
|
946
|
+
const l = o.create(a);
|
|
947
|
+
return {
|
|
948
|
+
value: o.carrierIsResult ? l : pn(e, e.position, o, l),
|
|
949
|
+
tag: o
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
B(e, `unknown scalar tag !<${a}>`);
|
|
953
|
+
}
|
|
954
|
+
if (t.style === 1) {
|
|
955
|
+
const a = e.schema.implicitScalarByFirstChar.get(n.charAt(0)) ?? e.schema.implicitScalarAnyFirstChar;
|
|
956
|
+
for (const s of a) {
|
|
957
|
+
const o = s.resolve(n, !1, s.tagName);
|
|
958
|
+
if (o !== C) return {
|
|
959
|
+
value: o,
|
|
960
|
+
tag: s
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
return {
|
|
965
|
+
value: i.resolve(n, !1, i.tagName),
|
|
966
|
+
tag: i
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
function Yt(e, t, n, r, i, a) {
|
|
970
|
+
const s = t.tagStart === pe ? "" : e.source.slice(t.tagStart, t.tagEnd), o = s === "" || s === "!" ? i : un(s, e.tagHandlers);
|
|
971
|
+
return {
|
|
972
|
+
tagName: o,
|
|
973
|
+
tag: di(e, n, r, o, a)
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
function hn(e) {
|
|
977
|
+
return e.nodeKind === "mapping";
|
|
978
|
+
}
|
|
979
|
+
function jt(e, t, n, r) {
|
|
980
|
+
for (const i of r.keys(n)) {
|
|
981
|
+
if (e.maxTotalMergeKeys !== -1 && ++e.totalMergeKeys > e.maxTotalMergeKeys && B(e, `merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`), t.tag.has(t.value, i)) continue;
|
|
982
|
+
const a = t.tag.addPair(t.value, i, r.get(n, i));
|
|
983
|
+
a && B(e, a), (t.overridable ??= /* @__PURE__ */ new Set()).add(i);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
function ki(e, t, n, r) {
|
|
987
|
+
if (e.position = t.keyPosition, hn(r)) jt(e, t, n, r);
|
|
988
|
+
else if (r.nodeKind === "sequence" && Array.isArray(n)) for (const i of n) jt(e, t, i, t.tag);
|
|
989
|
+
else B(e, "cannot merge mappings; the provided source object is unacceptable");
|
|
990
|
+
}
|
|
991
|
+
function xi(e, t, n, r, i) {
|
|
992
|
+
if (e.position = t.keyPosition, n === mt) {
|
|
993
|
+
ki(e, t, r, i);
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
!e.json && t.tag.has(t.value, n) && !t.overridable?.has(n) && B(e, "duplicated mapping key");
|
|
997
|
+
const a = t.tag.addPair(t.value, n, r);
|
|
998
|
+
a && B(e, a), t.overridable?.delete(n);
|
|
999
|
+
}
|
|
1000
|
+
function Ve(e, t, n) {
|
|
1001
|
+
const r = e.frames[e.frames.length - 1];
|
|
1002
|
+
if (r.kind === "document")
|
|
1003
|
+
r.value = t, r.hasValue = !0;
|
|
1004
|
+
else if (r.kind === "sequence") {
|
|
1005
|
+
r.merge && (hn(n) || B(e, "cannot merge mappings; the provided source object is unacceptable"));
|
|
1006
|
+
const i = r.tag.addItem(r.value, t, r.index++);
|
|
1007
|
+
i && B(e, i);
|
|
1008
|
+
} else if (r.hasKey) {
|
|
1009
|
+
const i = r.key;
|
|
1010
|
+
r.key = void 0, r.hasKey = !1, xi(e, r, i, t, n);
|
|
1011
|
+
} else
|
|
1012
|
+
r.key = t, r.keyPosition = e.position, r.hasKey = !0;
|
|
1013
|
+
}
|
|
1014
|
+
function Qe(e, t, n, r, i) {
|
|
1015
|
+
if (t.anchorStart !== pe) {
|
|
1016
|
+
const a = {
|
|
1017
|
+
value: n,
|
|
1018
|
+
tag: r,
|
|
1019
|
+
isValueFinal: i
|
|
1020
|
+
};
|
|
1021
|
+
return e.anchors.set(e.source.slice(t.anchorStart, t.anchorEnd), a), a;
|
|
1022
|
+
}
|
|
1023
|
+
return null;
|
|
1024
|
+
}
|
|
1025
|
+
function bi(e, t) {
|
|
1026
|
+
const n = {
|
|
1027
|
+
...yt,
|
|
1028
|
+
...t,
|
|
1029
|
+
events: e,
|
|
1030
|
+
documents: [],
|
|
1031
|
+
eventIndex: 0,
|
|
1032
|
+
position: 0,
|
|
1033
|
+
frames: [],
|
|
1034
|
+
anchors: /* @__PURE__ */ new Map(),
|
|
1035
|
+
tagHandlers: /* @__PURE__ */ Object.create(null),
|
|
1036
|
+
totalMergeKeys: 0,
|
|
1037
|
+
aliasCount: 0
|
|
1038
|
+
};
|
|
1039
|
+
for (; n.eventIndex < n.events.length; ) {
|
|
1040
|
+
const r = n.events[n.eventIndex++];
|
|
1041
|
+
switch (n.position = gi(r), r.type) {
|
|
1042
|
+
case 1:
|
|
1043
|
+
n.anchors = /* @__PURE__ */ new Map(), n.aliasCount = 0, n.tagHandlers = /* @__PURE__ */ Object.create(null);
|
|
1044
|
+
for (const i of r.directives) i.kind === "tag" && (n.tagHandlers[i.handle] = i.prefix);
|
|
1045
|
+
n.frames.push({
|
|
1046
|
+
kind: "document",
|
|
1047
|
+
position: n.position,
|
|
1048
|
+
value: void 0,
|
|
1049
|
+
hasValue: !1
|
|
1050
|
+
});
|
|
1051
|
+
break;
|
|
1052
|
+
case 4: {
|
|
1053
|
+
const { value: i, tag: a } = mi(n, r);
|
|
1054
|
+
Qe(n, r, i, a, !0), Ve(n, i, a);
|
|
1055
|
+
break;
|
|
1056
|
+
}
|
|
1057
|
+
case 2: {
|
|
1058
|
+
const i = Yt(n, r, n.schema.exact.sequence, n.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence"), a = i.tag.create(i.tagName), s = Qe(n, r, a, i.tag, i.tag.carrierIsResult), o = n.frames[n.frames.length - 1], l = o !== void 0 && o.kind === "mapping" && o.hasKey && o.key === mt;
|
|
1059
|
+
n.frames.push({
|
|
1060
|
+
kind: "sequence",
|
|
1061
|
+
position: n.position,
|
|
1062
|
+
value: a,
|
|
1063
|
+
tag: i.tag,
|
|
1064
|
+
anchor: s,
|
|
1065
|
+
index: 0,
|
|
1066
|
+
merge: l
|
|
1067
|
+
});
|
|
1068
|
+
break;
|
|
1069
|
+
}
|
|
1070
|
+
case 3: {
|
|
1071
|
+
const i = Yt(n, r, n.schema.exact.mapping, n.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping"), a = i.tag.create(i.tagName), s = Qe(n, r, a, i.tag, i.tag.carrierIsResult);
|
|
1072
|
+
n.frames.push({
|
|
1073
|
+
kind: "mapping",
|
|
1074
|
+
position: n.position,
|
|
1075
|
+
value: a,
|
|
1076
|
+
tag: i.tag,
|
|
1077
|
+
anchor: s,
|
|
1078
|
+
key: void 0,
|
|
1079
|
+
keyPosition: n.position,
|
|
1080
|
+
hasKey: !1,
|
|
1081
|
+
overridable: null
|
|
1082
|
+
});
|
|
1083
|
+
break;
|
|
1084
|
+
}
|
|
1085
|
+
case 5: {
|
|
1086
|
+
n.maxAliases !== -1 && ++n.aliasCount > n.maxAliases && B(n, `aliases exceeded maxAliases (${n.maxAliases})`);
|
|
1087
|
+
const i = n.source.slice(r.anchorStart, r.anchorEnd), a = n.anchors.get(i);
|
|
1088
|
+
a || B(n, `unidentified alias "${i}"`), a.isValueFinal || B(n, `recursive alias "${i}" is not supported for tag ${a.tag.tagName} because it uses finalize()`), Ve(n, a.value, a.tag);
|
|
1089
|
+
break;
|
|
1090
|
+
}
|
|
1091
|
+
case 6: {
|
|
1092
|
+
const i = n.frames.pop();
|
|
1093
|
+
if (i.kind === "document") n.documents.push(i.value);
|
|
1094
|
+
else {
|
|
1095
|
+
const a = i.tag.carrierIsResult ? i.value : pn(n, i.position, i.tag, i.value);
|
|
1096
|
+
i.anchor && (i.anchor.value = a, i.anchor.isValueFinal = !0), Ve(n, a, i.tag);
|
|
1097
|
+
}
|
|
1098
|
+
break;
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
return n.documents;
|
|
1103
|
+
}
|
|
1104
|
+
var $ = -1, fn = Object.prototype.hasOwnProperty, ge = 1, it = 2, gn = 3, Le = 4, yi = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, wi = /[,\[\]{}]/, dn = /^(?:!|!!|![0-9A-Za-z-]+!)$/, at = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`, mn = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`, vi = new RegExp(`^(?:${at})*$`), Ai = new RegExp(`^(?:${mn})+$`), Si = new RegExp(`^(?:!(?:${at})*|${mn}(?:${at})*)$`), wt = {
|
|
1105
|
+
filename: "",
|
|
1106
|
+
maxDepth: 100
|
|
1107
|
+
};
|
|
1108
|
+
function Ti(e, t, n) {
|
|
1109
|
+
e.events.push({
|
|
1110
|
+
type: 1,
|
|
1111
|
+
explicitStart: t,
|
|
1112
|
+
explicitEnd: n,
|
|
1113
|
+
directives: e.directives
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
function kn(e, t, n, r, i, a, s) {
|
|
1117
|
+
e.events.push({
|
|
1118
|
+
type: 2,
|
|
1119
|
+
start: t,
|
|
1120
|
+
anchorStart: n,
|
|
1121
|
+
anchorEnd: r,
|
|
1122
|
+
tagStart: i,
|
|
1123
|
+
tagEnd: a,
|
|
1124
|
+
style: s
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
function ot(e, t, n, r, i, a, s) {
|
|
1128
|
+
e.events.push({
|
|
1129
|
+
type: 3,
|
|
1130
|
+
start: t,
|
|
1131
|
+
anchorStart: n,
|
|
1132
|
+
anchorEnd: r,
|
|
1133
|
+
tagStart: i,
|
|
1134
|
+
tagEnd: a,
|
|
1135
|
+
style: s
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
function Ut(e, t) {
|
|
1139
|
+
e.events.splice(t.eventsLength, 0, {
|
|
1140
|
+
type: 3,
|
|
1141
|
+
start: t.position,
|
|
1142
|
+
anchorStart: $,
|
|
1143
|
+
anchorEnd: $,
|
|
1144
|
+
tagStart: $,
|
|
1145
|
+
tagEnd: $,
|
|
1146
|
+
style: 2
|
|
1147
|
+
});
|
|
1148
|
+
}
|
|
1149
|
+
function me(e, t, n, r, i, a, s, o, l = 1, c = -1, u = !1) {
|
|
1150
|
+
e.events.push({
|
|
1151
|
+
type: 4,
|
|
1152
|
+
valueStart: t,
|
|
1153
|
+
valueEnd: n,
|
|
1154
|
+
anchorStart: r,
|
|
1155
|
+
anchorEnd: i,
|
|
1156
|
+
tagStart: a,
|
|
1157
|
+
tagEnd: s,
|
|
1158
|
+
style: o,
|
|
1159
|
+
chomping: l,
|
|
1160
|
+
indent: c,
|
|
1161
|
+
fast: u
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
function Ei(e, t, n) {
|
|
1165
|
+
e.events.push({
|
|
1166
|
+
type: 5,
|
|
1167
|
+
anchorStart: t,
|
|
1168
|
+
anchorEnd: n
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
function he(e) {
|
|
1172
|
+
e.events.push({ type: 6 });
|
|
1173
|
+
}
|
|
1174
|
+
function z(e) {
|
|
1175
|
+
me(e, $, $, $, $, $, $, 1);
|
|
1176
|
+
}
|
|
1177
|
+
function Gt() {
|
|
1178
|
+
return {
|
|
1179
|
+
anchorStart: $,
|
|
1180
|
+
anchorEnd: $,
|
|
1181
|
+
tagStart: $,
|
|
1182
|
+
tagEnd: $
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
function ve(e) {
|
|
1186
|
+
return {
|
|
1187
|
+
position: e.position,
|
|
1188
|
+
line: e.line,
|
|
1189
|
+
lineStart: e.lineStart,
|
|
1190
|
+
lineIndent: e.lineIndent,
|
|
1191
|
+
firstTabInLine: e.firstTabInLine,
|
|
1192
|
+
eventsLength: e.events.length
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
function fe(e, t) {
|
|
1196
|
+
e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
|
|
1197
|
+
}
|
|
1198
|
+
function b(e, t) {
|
|
1199
|
+
Ye(e.input.slice(0, e.length), e.position, t, e.filename);
|
|
1200
|
+
}
|
|
1201
|
+
function R(e) {
|
|
1202
|
+
return e === 10 || e === 13;
|
|
1203
|
+
}
|
|
1204
|
+
function ae(e) {
|
|
1205
|
+
return e === 9 || e === 32;
|
|
1206
|
+
}
|
|
1207
|
+
function G(e) {
|
|
1208
|
+
return ae(e) || R(e);
|
|
1209
|
+
}
|
|
1210
|
+
function V(e) {
|
|
1211
|
+
return e === 0 || G(e);
|
|
1212
|
+
}
|
|
1213
|
+
function oe(e) {
|
|
1214
|
+
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1215
|
+
}
|
|
1216
|
+
function Ci(e) {
|
|
1217
|
+
return e >= 48 && e <= 57 ? e - 48 : -1;
|
|
1218
|
+
}
|
|
1219
|
+
function $i(e) {
|
|
1220
|
+
if (e >= 48 && e <= 57) return e - 48;
|
|
1221
|
+
const t = e | 32;
|
|
1222
|
+
return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
|
|
1223
|
+
}
|
|
1224
|
+
function Fi(e) {
|
|
1225
|
+
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1226
|
+
}
|
|
1227
|
+
function Ii(e) {
|
|
1228
|
+
return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
|
|
1229
|
+
}
|
|
1230
|
+
function Pe(e) {
|
|
1231
|
+
e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
|
|
1232
|
+
}
|
|
1233
|
+
function M(e, t) {
|
|
1234
|
+
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || G(e.input.charCodeAt(e.position - 1));
|
|
1235
|
+
for (; r !== 0; ) {
|
|
1236
|
+
for (; ae(r); )
|
|
1237
|
+
i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1238
|
+
if (t && i && r === 35) do
|
|
1239
|
+
r = e.input.charCodeAt(++e.position);
|
|
1240
|
+
while (!R(r) && r !== 0);
|
|
1241
|
+
if (!R(r)) break;
|
|
1242
|
+
for (Pe(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32; )
|
|
1243
|
+
e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1244
|
+
}
|
|
1245
|
+
return n;
|
|
1246
|
+
}
|
|
1247
|
+
function ee(e, t = e.position) {
|
|
1248
|
+
const n = e.input.charCodeAt(t);
|
|
1249
|
+
if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
|
|
1250
|
+
const r = e.input.charCodeAt(t + 3);
|
|
1251
|
+
return r === 0 || G(r);
|
|
1252
|
+
}
|
|
1253
|
+
return !1;
|
|
1254
|
+
}
|
|
1255
|
+
function Ht(e) {
|
|
1256
|
+
let t = e.input.charCodeAt(e.position);
|
|
1257
|
+
for (; t !== 0 && !R(t); ) t = e.input.charCodeAt(++e.position);
|
|
1258
|
+
}
|
|
1259
|
+
function xn(e, t, n) {
|
|
1260
|
+
yi.test(e.input.slice(t, n)) && b(e, "the stream contains non-printable characters");
|
|
1261
|
+
}
|
|
1262
|
+
function _i(e, t, n) {
|
|
1263
|
+
if (e.input.charCodeAt(e.position) !== 33) return !1;
|
|
1264
|
+
t.tagStart !== $ && b(e, "duplication of a tag property");
|
|
1265
|
+
const r = e.position;
|
|
1266
|
+
let i = !1, a = !1, s = "!", o = e.input.charCodeAt(++e.position);
|
|
1267
|
+
o === 60 ? (i = !0, o = e.input.charCodeAt(++e.position)) : o === 33 && (a = !0, s = "!!", o = e.input.charCodeAt(++e.position));
|
|
1268
|
+
let l = e.position, c;
|
|
1269
|
+
if (i) {
|
|
1270
|
+
for (; o !== 0 && o !== 62; ) o = e.input.charCodeAt(++e.position);
|
|
1271
|
+
o !== 62 && b(e, "unexpected end of the stream within a verbatim tag"), c = e.input.slice(l, e.position), e.position++;
|
|
1272
|
+
} else {
|
|
1273
|
+
for (; o !== 0 && !G(o) && !(n && oe(o)); )
|
|
1274
|
+
o === 33 && (a ? b(e, "tag suffix cannot contain exclamation marks") : (s = e.input.slice(l - 1, e.position + 1), dn.test(s) || b(e, "named tag handle cannot contain such characters"), a = !0, l = e.position + 1)), o = e.input.charCodeAt(++e.position);
|
|
1275
|
+
c = e.input.slice(l, e.position), wi.test(c) && b(e, "tag suffix cannot contain flow indicator characters");
|
|
1276
|
+
}
|
|
1277
|
+
return c && !(i ? vi.test(c) : Ai.test(c)) && b(e, `tag name cannot contain such characters: ${c}`), !i && s !== "!" && s !== "!!" && !fn.call(e.tagHandlers, s) && b(e, `undeclared tag handle "${s}"`), t.tagStart = r, t.tagEnd = e.position, !0;
|
|
1278
|
+
}
|
|
1279
|
+
function Ri(e, t) {
|
|
1280
|
+
if (e.input.charCodeAt(e.position) !== 38) return !1;
|
|
1281
|
+
t.anchorStart !== $ && b(e, "duplication of an anchor property"), e.position++;
|
|
1282
|
+
const n = e.position;
|
|
1283
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !G(e.input.charCodeAt(e.position)) && !oe(e.input.charCodeAt(e.position)); ) e.position++;
|
|
1284
|
+
return e.position === n && b(e, "name of an anchor node must contain at least one character"), t.anchorStart = n, t.anchorEnd = e.position, !0;
|
|
1285
|
+
}
|
|
1286
|
+
function Ni(e, t) {
|
|
1287
|
+
if (e.input.charCodeAt(e.position) !== 42) return !1;
|
|
1288
|
+
(t.anchorStart !== $ || t.tagStart !== $) && b(e, "alias node should not have any properties"), e.position++;
|
|
1289
|
+
const n = e.position;
|
|
1290
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !G(e.input.charCodeAt(e.position)) && !oe(e.input.charCodeAt(e.position)); ) e.position++;
|
|
1291
|
+
return e.position === n && b(e, "name of an alias node must contain at least one character"), Ei(e, n, e.position), !0;
|
|
1292
|
+
}
|
|
1293
|
+
function st(e, t) {
|
|
1294
|
+
M(e, !1), e.lineIndent < t && b(e, "deficient indentation");
|
|
1295
|
+
}
|
|
1296
|
+
function Li(e, t, n) {
|
|
1297
|
+
if (e.input.charCodeAt(e.position) !== 39) return !1;
|
|
1298
|
+
e.position++;
|
|
1299
|
+
const r = e.position;
|
|
1300
|
+
let i = !0;
|
|
1301
|
+
for (; e.input.charCodeAt(e.position) !== 0; ) {
|
|
1302
|
+
const a = e.input.charCodeAt(e.position);
|
|
1303
|
+
if (a === 39) {
|
|
1304
|
+
if (e.input.charCodeAt(e.position + 1) === 39) {
|
|
1305
|
+
i = !1, e.position += 2;
|
|
1306
|
+
continue;
|
|
1307
|
+
}
|
|
1308
|
+
const s = e.position;
|
|
1309
|
+
return e.position++, me(e, r, s, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2, 1, -1, i), !0;
|
|
1310
|
+
}
|
|
1311
|
+
R(a) ? (i = !1, st(e, t)) : e.position === e.lineStart && ee(e) ? b(e, "unexpected end of the document within a single quoted scalar") : a !== 9 && a < 32 ? b(e, "expected valid JSON character") : e.position++;
|
|
1312
|
+
}
|
|
1313
|
+
b(e, "unexpected end of the stream within a single quoted scalar");
|
|
1314
|
+
}
|
|
1315
|
+
function Pi(e, t, n) {
|
|
1316
|
+
if (e.input.charCodeAt(e.position) !== 34) return !1;
|
|
1317
|
+
e.position++;
|
|
1318
|
+
const r = e.position;
|
|
1319
|
+
let i = !0;
|
|
1320
|
+
for (; e.input.charCodeAt(e.position) !== 0; ) {
|
|
1321
|
+
const a = e.input.charCodeAt(e.position);
|
|
1322
|
+
if (a === 34) {
|
|
1323
|
+
const s = e.position;
|
|
1324
|
+
return e.position++, me(e, r, s, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 3, 1, -1, i), !0;
|
|
1325
|
+
}
|
|
1326
|
+
if (a === 92) {
|
|
1327
|
+
i = !1;
|
|
1328
|
+
const s = e.input.charCodeAt(++e.position);
|
|
1329
|
+
if (R(s)) st(e, t);
|
|
1330
|
+
else if (Ii(s)) e.position++;
|
|
1331
|
+
else {
|
|
1332
|
+
let o = Fi(s);
|
|
1333
|
+
for (o === 0 && b(e, "unknown escape sequence"); o-- > 0; )
|
|
1334
|
+
e.position++, $i(e.input.charCodeAt(e.position)) < 0 && b(e, "expected hexadecimal character");
|
|
1335
|
+
e.position++;
|
|
1336
|
+
}
|
|
1337
|
+
} else R(a) ? (i = !1, st(e, t)) : e.position === e.lineStart && ee(e) ? b(e, "unexpected end of the document within a double quoted scalar") : a !== 9 && a < 32 ? b(e, "expected valid JSON character") : e.position++;
|
|
1338
|
+
}
|
|
1339
|
+
b(e, "unexpected end of the stream within a double quoted scalar");
|
|
1340
|
+
}
|
|
1341
|
+
function Oi(e, t, n) {
|
|
1342
|
+
const r = e.input.charCodeAt(e.position);
|
|
1343
|
+
let i = 1, a = -1, s = !1;
|
|
1344
|
+
if (r !== 124 && r !== 62) return !1;
|
|
1345
|
+
const o = r === 124 ? 4 : 5;
|
|
1346
|
+
for (e.position++; e.input.charCodeAt(e.position) !== 0; ) {
|
|
1347
|
+
const y = e.input.charCodeAt(e.position), x = Ci(y);
|
|
1348
|
+
if (y === 43 || y === 45)
|
|
1349
|
+
i !== 1 && b(e, "repeat of a chomping mode identifier"), i = y === 43 ? 3 : 2, e.position++;
|
|
1350
|
+
else if (x >= 0)
|
|
1351
|
+
x === 0 && b(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), s && b(e, "repeat of an indentation width identifier"), a = t + x - 1, s = !0, e.position++;
|
|
1352
|
+
else break;
|
|
1353
|
+
}
|
|
1354
|
+
let l = !1;
|
|
1355
|
+
for (; ae(e.input.charCodeAt(e.position)); )
|
|
1356
|
+
l = !0, e.position++;
|
|
1357
|
+
l && e.input.charCodeAt(e.position) === 35 && Ht(e), R(e.input.charCodeAt(e.position)) ? Pe(e) : e.input.charCodeAt(e.position) !== 0 && b(e, "a line break is expected");
|
|
1358
|
+
let c = s ? a : -1, u = 0;
|
|
1359
|
+
const f = e.position;
|
|
1360
|
+
let g = e.position;
|
|
1361
|
+
for (; e.input.charCodeAt(e.position) !== 0; ) {
|
|
1362
|
+
const y = e.position;
|
|
1363
|
+
let x = 0;
|
|
1364
|
+
for (; e.input.charCodeAt(y + x) === 32; ) x++;
|
|
1365
|
+
const A = e.input.charCodeAt(y + x);
|
|
1366
|
+
if (A === 0) {
|
|
1367
|
+
c >= 0 ? x > c && (g = y + x) : x > 0 && (g = y + x);
|
|
1368
|
+
break;
|
|
1369
|
+
}
|
|
1370
|
+
if (y === e.lineStart && ee(e, y)) break;
|
|
1371
|
+
if (!s && c === -1 && R(A) && (u = Math.max(u, x)), !s && c === -1 && !R(A) && (A === 9 && x < t && (e.position = y + x, b(e, "tab characters must not be used in indentation")), x < u && (e.position = y + x, b(e, "bad indentation of a mapping entry"))), c === -1 && A !== 0 && !R(A) && x < t) {
|
|
1372
|
+
e.lineIndent = x, e.position = y + x;
|
|
1373
|
+
break;
|
|
1374
|
+
}
|
|
1375
|
+
!s && A !== 0 && !R(A) && c === -1 && (c = x);
|
|
1376
|
+
const S = c === -1 ? t + 1 : c;
|
|
1377
|
+
if (A !== 0 && !R(A) && x < S) {
|
|
1378
|
+
e.lineIndent = x, e.position = y + x;
|
|
1379
|
+
break;
|
|
1380
|
+
}
|
|
1381
|
+
Ht(e), g = e.position, R(e.input.charCodeAt(e.position)) && (Pe(e), g = e.position);
|
|
1382
|
+
}
|
|
1383
|
+
return xn(e, f, g), me(e, f, g, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, o, i, c), !0;
|
|
1384
|
+
}
|
|
1385
|
+
function zi(e, t) {
|
|
1386
|
+
const n = e.input.charCodeAt(e.position), r = t === ge;
|
|
1387
|
+
if (n === 0 || G(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || r && oe(n)) return !1;
|
|
1388
|
+
if (n === 63 || n === 45) {
|
|
1389
|
+
const i = e.input.charCodeAt(e.position + 1);
|
|
1390
|
+
if (V(i) || r && oe(i)) return !1;
|
|
1391
|
+
}
|
|
1392
|
+
return !0;
|
|
1393
|
+
}
|
|
1394
|
+
function Mi(e, t, n, r) {
|
|
1395
|
+
if (!zi(e, n)) return !1;
|
|
1396
|
+
const i = e.position;
|
|
1397
|
+
let a = e.position, s = e.input.charCodeAt(e.position);
|
|
1398
|
+
const o = n === ge;
|
|
1399
|
+
let l = !1;
|
|
1400
|
+
for (; s !== 0 && !(e.position === e.lineStart && ee(e)); ) {
|
|
1401
|
+
if (s === 58) {
|
|
1402
|
+
const c = e.input.charCodeAt(e.position + 1);
|
|
1403
|
+
if (V(c) || o && oe(c)) break;
|
|
1404
|
+
} else if (s === 35) {
|
|
1405
|
+
if (G(e.input.charCodeAt(e.position - 1))) break;
|
|
1406
|
+
} else {
|
|
1407
|
+
if (o && oe(s)) break;
|
|
1408
|
+
if (R(s)) {
|
|
1409
|
+
const c = e.position, u = e.line, f = e.lineStart, g = e.lineIndent;
|
|
1410
|
+
if (M(e, !1), e.lineIndent >= t) {
|
|
1411
|
+
l = !0, s = e.input.charCodeAt(e.position);
|
|
1412
|
+
continue;
|
|
1413
|
+
}
|
|
1414
|
+
e.position = c, e.line = u, e.lineStart = f, e.lineIndent = g;
|
|
1415
|
+
break;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
ae(s) || (a = e.position + 1), s = e.input.charCodeAt(++e.position);
|
|
1419
|
+
}
|
|
1420
|
+
return a === i ? !1 : (xn(e, i, a), me(e, i, a, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1, 1, -1, !l), !0);
|
|
1421
|
+
}
|
|
1422
|
+
function be(e, t) {
|
|
1423
|
+
const n = e.line;
|
|
1424
|
+
M(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && b(e, "deficient indentation");
|
|
1425
|
+
}
|
|
1426
|
+
function Bi(e, t, n) {
|
|
1427
|
+
const r = e.input.charCodeAt(e.position), i = r === 123, a = e.position;
|
|
1428
|
+
let s = !0;
|
|
1429
|
+
if (r !== 91 && r !== 123) return !1;
|
|
1430
|
+
const o = i ? 125 : 93;
|
|
1431
|
+
for (i ? ot(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2) : kn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2), e.position++; e.input.charCodeAt(e.position) !== 0; ) {
|
|
1432
|
+
be(e, t);
|
|
1433
|
+
let l = e.input.charCodeAt(e.position);
|
|
1434
|
+
if (l === o)
|
|
1435
|
+
return e.position++, he(e), !0;
|
|
1436
|
+
s ? l === 44 && b(e, "expected the node content, but found ','") : b(e, "missed comma between flow collection entries");
|
|
1437
|
+
let c = !1, u = !1;
|
|
1438
|
+
l === 63 && G(e.input.charCodeAt(e.position + 1)) && (c = u = !0, e.position += 1, be(e, t));
|
|
1439
|
+
const f = e.line, g = ve(e), y = ne(e, t, ge, !1, !0);
|
|
1440
|
+
be(e, t), l = e.input.charCodeAt(e.position), (i || u || e.line === f) && l === 58 ? (c = !0, e.position++, be(e, t), i || Ut(e, g), y || z(e), ne(e, t, ge, !1, !0) || z(e), be(e, t), i || he(e)) : i && c ? (y || z(e), z(e)) : i ? z(e) : c && (Ut(e, g), y || z(e), z(e), he(e)), l = e.input.charCodeAt(e.position), l === 44 ? (s = !0, e.position++) : s = !1;
|
|
1441
|
+
}
|
|
1442
|
+
b(e, "unexpected end of the stream within a flow collection");
|
|
1443
|
+
}
|
|
1444
|
+
function Wt(e, t, n) {
|
|
1445
|
+
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !V(e.input.charCodeAt(e.position + 1))) return !1;
|
|
1446
|
+
for (kn(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 1); e.input.charCodeAt(e.position) === 45 && V(e.input.charCodeAt(e.position + 1)); ) {
|
|
1447
|
+
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, b(e, "tab characters must not be used in indentation"));
|
|
1448
|
+
const r = e.line;
|
|
1449
|
+
e.position++;
|
|
1450
|
+
const i = M(e, !0) > 0;
|
|
1451
|
+
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && V(e.input.charCodeAt(e.position + 1)) && b(e, "bad indentation of a sequence entry"), i && e.lineIndent <= t ? z(e) : ne(e, t, gn, !1, !0), M(e, !0), e.lineIndent < t || e.position >= e.length) break;
|
|
1452
|
+
e.lineIndent > t && b(e, "bad indentation of a sequence entry"), e.line === r && e.input.charCodeAt(e.position) === 45 && V(e.input.charCodeAt(e.position + 1)) && b(e, "bad indentation of a sequence entry");
|
|
1453
|
+
}
|
|
1454
|
+
return he(e), !0;
|
|
1455
|
+
}
|
|
1456
|
+
function Xe(e, t, n, r) {
|
|
1457
|
+
let i = !1, a = !1, s = !1, o = !1;
|
|
1458
|
+
if (e.firstTabInLine !== -1) return !1;
|
|
1459
|
+
let l = e.input.charCodeAt(e.position);
|
|
1460
|
+
for (; l !== 0; ) {
|
|
1461
|
+
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, b(e, "tab characters must not be used in indentation"));
|
|
1462
|
+
const c = e.input.charCodeAt(e.position + 1), u = e.line;
|
|
1463
|
+
if ((l === 63 || l === 58) && V(c))
|
|
1464
|
+
s || (ot(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), s = !0), l === 63 ? (i && z(e), a = !0, i = !0) : (i || (z(e), a = !0), i = !1), e.position += 1, o = !0;
|
|
1465
|
+
else {
|
|
1466
|
+
i && (z(e), i = !1);
|
|
1467
|
+
const f = ve(e);
|
|
1468
|
+
if (!ne(e, n, it, !1, !0)) break;
|
|
1469
|
+
if (e.line === u) {
|
|
1470
|
+
for (l = e.input.charCodeAt(e.position); ae(l); ) l = e.input.charCodeAt(++e.position);
|
|
1471
|
+
if (l === 58) {
|
|
1472
|
+
if (l = e.input.charCodeAt(++e.position), V(l) || b(e, "a whitespace character is expected after the key-value separator within a block mapping"), !s) {
|
|
1473
|
+
for (fe(e, f), ot(e, f.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), s = !0, ne(e, n, it, !1, !0), l = e.input.charCodeAt(e.position); ae(l); ) l = e.input.charCodeAt(++e.position);
|
|
1474
|
+
e.position++;
|
|
1475
|
+
}
|
|
1476
|
+
a = !0, i = !1, o = !1;
|
|
1477
|
+
} else if (a) b(e, "expected ':' after a mapping key");
|
|
1478
|
+
else
|
|
1479
|
+
return r.anchorStart !== $ || r.tagStart !== $ ? (fe(e, f), !1) : !0;
|
|
1480
|
+
} else if (a) b(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1481
|
+
else
|
|
1482
|
+
return r.anchorStart !== $ || r.tagStart !== $ ? (fe(e, f), !1) : !0;
|
|
1483
|
+
}
|
|
1484
|
+
if (ne(e, t, Le, !0, o) && (o = !1), i || o && (z(e), o = !1), M(e, !0), l = e.input.charCodeAt(e.position), (e.line === u || e.lineIndent > t) && l !== 0) b(e, "bad indentation of a mapping entry");
|
|
1485
|
+
else if (e.lineIndent < t) break;
|
|
1486
|
+
}
|
|
1487
|
+
return a ? (i && z(e), s && he(e), !0) : !1;
|
|
1488
|
+
}
|
|
1489
|
+
function ne(e, t, n, r, i, a = !0) {
|
|
1490
|
+
e.depth >= e.maxDepth && b(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
|
|
1491
|
+
let s = 1, o = !1, l = !1, c = null;
|
|
1492
|
+
const u = Gt();
|
|
1493
|
+
let f = n === Le || n === gn, g = f;
|
|
1494
|
+
const y = f;
|
|
1495
|
+
if (r && M(e, !0) && (o = !0, e.lineIndent > t ? s = 1 : e.lineIndent === t ? s = 0 : s = -1), e.position === e.lineStart && ee(e))
|
|
1496
|
+
return e.depth--, !1;
|
|
1497
|
+
if (s === 1) for (; ; ) {
|
|
1498
|
+
const x = e.input.charCodeAt(e.position), A = ve(e);
|
|
1499
|
+
if (o && s !== 1 && (x === 33 || x === 38)) break;
|
|
1500
|
+
if (o && y && (u.tagStart !== $ || u.anchorStart !== $) && (x === 33 || x === 38)) {
|
|
1501
|
+
const S = ve(e), I = t + 1;
|
|
1502
|
+
if (Xe(e, e.position - e.lineStart, I, u) && e.events[S.eventsLength]?.type === 3)
|
|
1503
|
+
return e.depth--, !0;
|
|
1504
|
+
fe(e, S);
|
|
1505
|
+
}
|
|
1506
|
+
if (o && (x === 33 && u.tagStart !== $ || x === 38 && u.anchorStart !== $) || !_i(e, u, n === ge) && !Ri(e, u)) break;
|
|
1507
|
+
c === null && (c = A), M(e, !0) ? (o = !0, g = y, e.lineIndent > t ? s = 1 : e.lineIndent === t ? s = 0 : s = -1) : g = !1;
|
|
1508
|
+
}
|
|
1509
|
+
if (g && (g = o || i), s === 1 || n === Le) {
|
|
1510
|
+
const x = n === ge || n === it ? t : t + 1, A = e.position - e.lineStart;
|
|
1511
|
+
if (s === 1) if (g && (Wt(e, A, u) || Xe(e, A, x, u)) || Bi(e, x, u)) l = !0;
|
|
1512
|
+
else {
|
|
1513
|
+
const S = e.input.charCodeAt(e.position);
|
|
1514
|
+
if (c !== null && a && y && !g && S !== 124 && S !== 62) {
|
|
1515
|
+
const I = ve(e), p = c.position - c.lineStart;
|
|
1516
|
+
fe(e, c), Xe(e, p, x, Gt()) && e.events[I.eventsLength]?.type === 3 ? l = !0 : fe(e, I);
|
|
1517
|
+
}
|
|
1518
|
+
!l && (f && Oi(e, x, u) || Li(e, x, u) || Pi(e, x, u) || Ni(e, u) || Mi(e, x, n, u)) && (l = !0);
|
|
1519
|
+
}
|
|
1520
|
+
else s === 0 && (l = g && Wt(e, A, u));
|
|
1521
|
+
}
|
|
1522
|
+
return f = f && !l, !l && (u.anchorStart !== $ || u.tagStart !== $ || f) && (me(e, $, $, u.anchorStart, u.anchorEnd, u.tagStart, u.tagEnd, 1), l = !0), e.depth--, l || u.anchorStart !== $ || u.tagStart !== $;
|
|
1523
|
+
}
|
|
1524
|
+
function Di(e) {
|
|
1525
|
+
if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
|
|
1526
|
+
e.position++;
|
|
1527
|
+
const t = e.position;
|
|
1528
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !G(e.input.charCodeAt(e.position)); ) e.position++;
|
|
1529
|
+
const n = e.input.slice(t, e.position), r = [];
|
|
1530
|
+
for (n.length === 0 && b(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !R(e.input.charCodeAt(e.position)); ) {
|
|
1531
|
+
for (; ae(e.input.charCodeAt(e.position)); ) e.position++;
|
|
1532
|
+
if (e.input.charCodeAt(e.position) === 35 || R(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
|
|
1533
|
+
const i = e.position;
|
|
1534
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !G(e.input.charCodeAt(e.position)); ) e.position++;
|
|
1535
|
+
r.push(e.input.slice(i, e.position));
|
|
1536
|
+
}
|
|
1537
|
+
if (R(e.input.charCodeAt(e.position)) && Pe(e), n === "YAML") {
|
|
1538
|
+
e.directives.some((a) => a.kind === "yaml") && b(e, "duplication of %YAML directive"), r.length !== 1 && b(e, "YAML directive accepts exactly one argument");
|
|
1539
|
+
const i = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
|
|
1540
|
+
i === null && b(e, "ill-formed argument of the YAML directive"), parseInt(i[1], 10) !== 1 && b(e, "unacceptable YAML version of the document"), e.directives.push({
|
|
1541
|
+
kind: "yaml",
|
|
1542
|
+
version: r[0]
|
|
1543
|
+
});
|
|
1544
|
+
} else if (n === "TAG") {
|
|
1545
|
+
r.length !== 2 && b(e, "TAG directive accepts exactly two arguments");
|
|
1546
|
+
const [i, a] = r;
|
|
1547
|
+
dn.test(i) || b(e, "ill-formed tag handle (first argument) of the TAG directive"), fn.call(e.tagHandlers, i) && b(e, `there is a previously declared suffix for "${i}" tag handle`), Si.test(a) || b(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[i] = a, e.directives.push({
|
|
1548
|
+
kind: "tag",
|
|
1549
|
+
handle: i,
|
|
1550
|
+
prefix: a
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
return !0;
|
|
1554
|
+
}
|
|
1555
|
+
function qi(e) {
|
|
1556
|
+
e.directives = [], e.tagHandlers = /* @__PURE__ */ Object.create(null);
|
|
1557
|
+
let t = !1;
|
|
1558
|
+
for (M(e, !0); Di(e); )
|
|
1559
|
+
t = !0, M(e, !0);
|
|
1560
|
+
let n = !1, r = !1, i = !0;
|
|
1561
|
+
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && V(e.input.charCodeAt(e.position + 3))) {
|
|
1562
|
+
n = !0;
|
|
1563
|
+
const o = e.line;
|
|
1564
|
+
e.position += 3, M(e, !0), i = e.line > o;
|
|
1565
|
+
} else t && b(e, "directives end mark is expected");
|
|
1566
|
+
const a = e.events.length;
|
|
1567
|
+
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && ee(e)) {
|
|
1568
|
+
e.position += 3, M(e, !0);
|
|
1569
|
+
return;
|
|
1570
|
+
}
|
|
1571
|
+
if (Ti(e, n, !1), ne(e, e.lineIndent - 1, Le, !1, i, i) || z(e), M(e, !0), e.position === e.lineStart && ee(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
|
|
1572
|
+
const o = e.line;
|
|
1573
|
+
e.position += 3, M(e, !0), e.line === o && e.position < e.length && b(e, "end of the stream or a document separator is expected");
|
|
1574
|
+
}
|
|
1575
|
+
const s = e.events[a];
|
|
1576
|
+
s?.type === 1 && (s.explicitEnd = r), he(e), !r && e.position < e.length && !(e.position === e.lineStart && ee(e)) && b(e, "end of the stream or a document separator is expected");
|
|
1577
|
+
}
|
|
1578
|
+
function Yi(e, t) {
|
|
1579
|
+
const n = e.length, r = {
|
|
1580
|
+
...wt,
|
|
1581
|
+
...t,
|
|
1582
|
+
input: `${e}\0`,
|
|
1583
|
+
length: n,
|
|
1584
|
+
position: 0,
|
|
1585
|
+
line: 0,
|
|
1586
|
+
lineStart: 0,
|
|
1587
|
+
lineIndent: 0,
|
|
1588
|
+
firstTabInLine: -1,
|
|
1589
|
+
depth: 0,
|
|
1590
|
+
directives: [],
|
|
1591
|
+
tagHandlers: /* @__PURE__ */ Object.create(null),
|
|
1592
|
+
events: []
|
|
1593
|
+
}, i = e.indexOf("\0");
|
|
1594
|
+
for (i !== -1 && Ye(e, i, "null byte is not allowed in input", r.filename), r.input.charCodeAt(r.position) === 65279 && r.position++; r.position < r.length && (M(r, !0), !(r.position >= r.length)); ) {
|
|
1595
|
+
const a = r.position;
|
|
1596
|
+
qi(r), r.position === a && b(r, "can not read a document");
|
|
1597
|
+
}
|
|
1598
|
+
return r.events;
|
|
1599
|
+
}
|
|
1600
|
+
var ji = {
|
|
1601
|
+
...wt,
|
|
1602
|
+
...yt
|
|
1603
|
+
};
|
|
1604
|
+
function Ui(e, t = {}) {
|
|
1605
|
+
const n = {
|
|
1606
|
+
...ji,
|
|
1607
|
+
...t
|
|
1608
|
+
}, r = String(e), i = Object.keys(wt), a = Object.keys(yt);
|
|
1609
|
+
return bi(Yi(r, zt(n, i)), {
|
|
1610
|
+
...zt(n, a),
|
|
1611
|
+
source: r
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
function Gi(e, t) {
|
|
1615
|
+
const n = Ui(e, t);
|
|
1616
|
+
if (n.length === 0) throw new Re("expected a document, but the input is empty");
|
|
1617
|
+
if (n.length === 1) return n[0];
|
|
1618
|
+
throw new Re("expected a single document in the stream, but found more");
|
|
1619
|
+
}
|
|
1620
|
+
ni.withTags({
|
|
1621
|
+
...nt,
|
|
1622
|
+
resolve: (e, t, n) => {
|
|
1623
|
+
const r = nt.resolve(e, t, n);
|
|
1624
|
+
return r === C ? an.resolve(e, t, n) : r;
|
|
1625
|
+
}
|
|
1626
|
+
}, {
|
|
1627
|
+
...rt,
|
|
1628
|
+
resolve: (e, t, n) => {
|
|
1629
|
+
const r = rt.resolve(e, t, n);
|
|
1630
|
+
return r === C ? on.resolve(e, t, n) : r;
|
|
1631
|
+
}
|
|
1632
|
+
});
|
|
1633
|
+
function vt() {
|
|
1634
|
+
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1635
|
+
}
|
|
1636
|
+
var le = vt();
|
|
1637
|
+
function bn(e) {
|
|
1638
|
+
le = e;
|
|
1639
|
+
}
|
|
1640
|
+
var te = { exec: () => null };
|
|
1641
|
+
function ue(e) {
|
|
1642
|
+
let t = [];
|
|
1643
|
+
return (n) => {
|
|
1644
|
+
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
1645
|
+
return i || (i = e(r), t[r] = i), i;
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
function T(e, t = "") {
|
|
1649
|
+
let n = typeof e == "string" ? e : e.source, r = { replace: (i, a) => {
|
|
1650
|
+
let s = typeof a == "string" ? a : a.source;
|
|
1651
|
+
return s = s.replace(P.caret, "$1"), n = n.replace(i, s), r;
|
|
1652
|
+
}, getRegex: () => new RegExp(n, t) };
|
|
1653
|
+
return r;
|
|
1654
|
+
}
|
|
1655
|
+
var Hi = ((e = "") => {
|
|
1656
|
+
try {
|
|
1657
|
+
return !!new RegExp("(?<=1)(?<!1)" + e);
|
|
1658
|
+
} catch {
|
|
1659
|
+
return !1;
|
|
1660
|
+
}
|
|
1661
|
+
})(), P = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (e) => new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: ue((e) => new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: ue((e) => new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: ue((e) => new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)), headingBeginRegex: ue((e) => new RegExp(`^ {0,${e}}#`)), htmlBeginRegex: ue((e) => new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: ue((e) => new RegExp(`^ {0,${e}}>`)) }, Wi = /^(?:[ \t]*(?:\n|$))+/, Ki = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Zi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Se = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Vi = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, At = / {0,3}(?:[*+-]|\d{1,9}[.)])/, yn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, wn = T(yn).replace(/bull/g, At).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Qi = T(yn).replace(/bull/g, At).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), St = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Xi = /^[^\n]+/, Tt = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ji = T(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Tt).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ea = T(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, At).getRegex(), je = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Et = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ta = T("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Et).replace("tag", je).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), vn = (e) => T(St).replace("hr", Se).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", je).getRegex(), na = vn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), ra = vn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), ia = T(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ra).getRegex(), Ct = { blockquote: ia, code: Ki, def: Ji, fences: Zi, heading: Vi, hr: Se, html: ta, lheading: wn, list: ea, newline: Wi, paragraph: na, table: te, text: Xi }, Kt = T("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Se).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", je).getRegex(), aa = { ...Ct, lheading: Qi, table: Kt, paragraph: T(St).replace("hr", Se).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Kt).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", je).getRegex() }, oa = { ...Ct, html: T(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Et).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: te, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: T(St).replace("hr", Se).replace("heading", ` *#{1,6} *[^
|
|
1662
|
+
]`).replace("lheading", wn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, sa = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, la = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, An = /^( {2,}|\\)\n(?!\s*$)/, ca = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, ke = /[\p{P}\p{S}]/u, Ue = /[\s\p{P}\p{S}]/u, $t = /[^\s\p{P}\p{S}]/u, ua = T(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Ue).getRegex(), Sn = /(?!~)[\p{P}\p{S}]/u, pa = /(?!~)[\s\p{P}\p{S}]/u, ha = /(?:[^\s\p{P}\p{S}]|~)/u, fa = T(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Hi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Tn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ga = T(Tn, "u").replace(/punct/g, ke).getRegex(), da = T(Tn, "u").replace(/punct/g, Sn).getRegex(), En = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ma = T(En, "gu").replace(/notPunctSpace/g, $t).replace(/punctSpace/g, Ue).replace(/punct/g, ke).getRegex(), ka = T(En, "gu").replace(/notPunctSpace/g, ha).replace(/punctSpace/g, pa).replace(/punct/g, Sn).getRegex(), xa = T("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, $t).replace(/punctSpace/g, Ue).replace(/punct/g, ke).getRegex(), ba = T(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, ke).getRegex(), ya = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", wa = T(ya, "gu").replace(/notPunctSpace/g, $t).replace(/punctSpace/g, Ue).replace(/punct/g, ke).getRegex(), va = T(/\\(punct)/, "gu").replace(/punct/g, ke).getRegex(), Aa = T(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Sa = T(Et).replace("(?:-->|$)", "-->").getRegex(), Ta = T("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Sa).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Oe = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Ea = T(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Oe).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Cn = T(/^!?\[(label)\]\[(ref)\]/).replace("label", Oe).replace("ref", Tt).getRegex(), $n = T(/^!?\[(ref)\](?:\[\])?/).replace("ref", Tt).getRegex(), Ca = T("reflink|nolink(?!\\()", "g").replace("reflink", Cn).replace("nolink", $n).getRegex(), Zt = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Ft = { _backpedal: te, anyPunctuation: va, autolink: Aa, blockSkip: fa, br: An, code: la, del: te, delLDelim: te, delRDelim: te, emStrongLDelim: ga, emStrongRDelimAst: ma, emStrongRDelimUnd: xa, escape: sa, link: Ea, nolink: $n, punctuation: ua, reflink: Cn, reflinkSearch: Ca, tag: Ta, text: ca, url: te }, $a = { ...Ft, link: T(/^!?\[(label)\]\((.*?)\)/).replace("label", Oe).getRegex(), reflink: T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Oe).getRegex() }, lt = { ...Ft, emStrongRDelimAst: ka, emStrongLDelim: da, delLDelim: ba, delRDelim: wa, url: T(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Zt).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: T(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Zt).getRegex() }, Fa = { ...lt, br: T(An).replace("{2,}", "*").getRegex(), text: T(lt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, Fe = { normal: Ct, gfm: aa, pedantic: oa }, ye = { normal: Ft, gfm: lt, breaks: Fa, pedantic: $a }, Ia = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Vt = (e) => Ia[e];
|
|
1663
|
+
function W(e, t) {
|
|
1664
|
+
if (t) {
|
|
1665
|
+
if (P.escapeTest.test(e)) return e.replace(P.escapeReplace, Vt);
|
|
1666
|
+
} else if (P.escapeTestNoEncode.test(e)) return e.replace(P.escapeReplaceNoEncode, Vt);
|
|
1667
|
+
return e;
|
|
1668
|
+
}
|
|
1669
|
+
function Qt(e) {
|
|
1670
|
+
try {
|
|
1671
|
+
e = encodeURI(e).replace(P.percentDecode, "%");
|
|
1672
|
+
} catch {
|
|
1673
|
+
return null;
|
|
1674
|
+
}
|
|
1675
|
+
return e;
|
|
1676
|
+
}
|
|
1677
|
+
function Xt(e, t) {
|
|
1678
|
+
let n = e.replace(P.findPipe, (a, s, o) => {
|
|
1679
|
+
let l = !1, c = s;
|
|
1680
|
+
for (; --c >= 0 && o[c] === "\\"; ) l = !l;
|
|
1681
|
+
return l ? "|" : " |";
|
|
1682
|
+
}), r = n.split(P.splitPipe), i = 0;
|
|
1683
|
+
if (r[0].trim() || r.shift(), r.length > 0 && !r.at(-1)?.trim() && r.pop(), t) if (r.length > t) r.splice(t);
|
|
1684
|
+
else for (; r.length < t; ) r.push("");
|
|
1685
|
+
for (; i < r.length; i++) r[i] = r[i].trim().replace(P.slashPipe, "|");
|
|
1686
|
+
return r;
|
|
1687
|
+
}
|
|
1688
|
+
function J(e, t, n) {
|
|
1689
|
+
let r = e.length;
|
|
1690
|
+
if (r === 0) return "";
|
|
1691
|
+
let i = 0;
|
|
1692
|
+
for (; i < r && e.charAt(r - i - 1) === t; )
|
|
1693
|
+
i++;
|
|
1694
|
+
return e.slice(0, r - i);
|
|
1695
|
+
}
|
|
1696
|
+
function Jt(e) {
|
|
1697
|
+
let t = e.split(`
|
|
1698
|
+
`), n = t.length - 1;
|
|
1699
|
+
for (; n >= 0 && P.blankLine.test(t[n]); ) n--;
|
|
1700
|
+
return t.length - n <= 2 ? e : t.slice(0, n + 1).join(`
|
|
1701
|
+
`);
|
|
1702
|
+
}
|
|
1703
|
+
function _a(e, t) {
|
|
1704
|
+
if (e.indexOf(t[1]) === -1) return -1;
|
|
1705
|
+
let n = 0;
|
|
1706
|
+
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
1707
|
+
else if (e[r] === t[0]) n++;
|
|
1708
|
+
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1709
|
+
return n > 0 ? -2 : -1;
|
|
1710
|
+
}
|
|
1711
|
+
function Ra(e, t = 0) {
|
|
1712
|
+
let n = t, r = "";
|
|
1713
|
+
for (let i of e) if (i === " ") {
|
|
1714
|
+
let a = 4 - n % 4;
|
|
1715
|
+
r += " ".repeat(a), n += a;
|
|
1716
|
+
} else r += i, n++;
|
|
1717
|
+
return r;
|
|
1718
|
+
}
|
|
1719
|
+
function en(e, t, n, r, i) {
|
|
1720
|
+
let a = t.href, s = t.title || null, o = e[1].replace(i.other.outputLinkReplace, "$1");
|
|
1721
|
+
r.state.inLink = !0;
|
|
1722
|
+
let l = { type: e[0].charAt(0) === "!" ? "image" : "link", raw: n, href: a, title: s, text: o, tokens: r.inlineTokens(o) };
|
|
1723
|
+
return r.state.inLink = !1, l;
|
|
1724
|
+
}
|
|
1725
|
+
function Na(e, t, n) {
|
|
1726
|
+
let r = e.match(n.other.indentCodeCompensation);
|
|
1727
|
+
if (r === null) return t;
|
|
1728
|
+
let i = r[1];
|
|
1729
|
+
return t.split(`
|
|
1730
|
+
`).map((a) => {
|
|
1731
|
+
let s = a.match(n.other.beginningSpace);
|
|
1732
|
+
if (s === null) return a;
|
|
1733
|
+
let [o] = s;
|
|
1734
|
+
return o.length >= i.length ? a.slice(i.length) : a;
|
|
1735
|
+
}).join(`
|
|
1736
|
+
`);
|
|
1737
|
+
}
|
|
1738
|
+
var ze = class {
|
|
1739
|
+
options;
|
|
1740
|
+
rules;
|
|
1741
|
+
lexer;
|
|
1742
|
+
constructor(e) {
|
|
1743
|
+
this.options = e || le;
|
|
1744
|
+
}
|
|
1745
|
+
space(e) {
|
|
1746
|
+
let t = this.rules.block.newline.exec(e);
|
|
1747
|
+
if (t && t[0].length > 0) return { type: "space", raw: t[0] };
|
|
1748
|
+
}
|
|
1749
|
+
code(e) {
|
|
1750
|
+
let t = this.rules.block.code.exec(e);
|
|
1751
|
+
if (t) {
|
|
1752
|
+
let n = this.options.pedantic ? t[0] : Jt(t[0]), r = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
1753
|
+
return { type: "code", raw: n, codeBlockStyle: "indented", text: r };
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
fences(e) {
|
|
1757
|
+
let t = this.rules.block.fences.exec(e);
|
|
1758
|
+
if (t) {
|
|
1759
|
+
let n = t[0], r = Na(n, t[3] || "", this.rules);
|
|
1760
|
+
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
heading(e) {
|
|
1764
|
+
let t = this.rules.block.heading.exec(e);
|
|
1765
|
+
if (t) {
|
|
1766
|
+
let n = t[2].trim();
|
|
1767
|
+
if (this.rules.other.endingHash.test(n)) {
|
|
1768
|
+
let r = J(n, "#");
|
|
1769
|
+
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
1770
|
+
}
|
|
1771
|
+
return { type: "heading", raw: J(t[0], `
|
|
1772
|
+
`), depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
hr(e) {
|
|
1776
|
+
let t = this.rules.block.hr.exec(e);
|
|
1777
|
+
if (t) return { type: "hr", raw: J(t[0], `
|
|
1778
|
+
`) };
|
|
1779
|
+
}
|
|
1780
|
+
blockquote(e) {
|
|
1781
|
+
let t = this.rules.block.blockquote.exec(e);
|
|
1782
|
+
if (t) {
|
|
1783
|
+
let n = J(t[0], `
|
|
1784
|
+
`).split(`
|
|
1785
|
+
`), r = "", i = "", a = [];
|
|
1786
|
+
for (; n.length > 0; ) {
|
|
1787
|
+
let s = !1, o = [], l;
|
|
1788
|
+
for (l = 0; l < n.length; l++) if (this.rules.other.blockquoteStart.test(n[l])) o.push(n[l]), s = !0;
|
|
1789
|
+
else if (!s) o.push(n[l]);
|
|
1790
|
+
else break;
|
|
1791
|
+
n = n.slice(l);
|
|
1792
|
+
let c = o.join(`
|
|
1793
|
+
`), u = c.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1794
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1795
|
+
r = r ? `${r}
|
|
1796
|
+
${c}` : c, i = i ? `${i}
|
|
1797
|
+
${u}` : u;
|
|
1798
|
+
let f = this.lexer.state.top;
|
|
1799
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(u, a, !0), this.lexer.state.top = f, n.length === 0) break;
|
|
1800
|
+
let g = a.at(-1);
|
|
1801
|
+
if (g?.type === "code") break;
|
|
1802
|
+
if (g?.type === "blockquote") {
|
|
1803
|
+
let y = g, x = y.raw + `
|
|
1804
|
+
` + n.join(`
|
|
1805
|
+
`), A = this.blockquote(x);
|
|
1806
|
+
a[a.length - 1] = A, r = r.substring(0, r.length - y.raw.length) + A.raw, i = i.substring(0, i.length - y.text.length) + A.text;
|
|
1807
|
+
break;
|
|
1808
|
+
} else if (g?.type === "list") {
|
|
1809
|
+
let y = g, x = y.raw + `
|
|
1810
|
+
` + n.join(`
|
|
1811
|
+
`), A = this.list(x);
|
|
1812
|
+
a[a.length - 1] = A, r = r.substring(0, r.length - g.raw.length) + A.raw, i = i.substring(0, i.length - y.raw.length) + A.raw, n = x.substring(a.at(-1).raw.length).split(`
|
|
1813
|
+
`);
|
|
1814
|
+
continue;
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
return { type: "blockquote", raw: r, tokens: a, text: i };
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
list(e) {
|
|
1821
|
+
let t = this.rules.block.list.exec(e);
|
|
1822
|
+
if (t) {
|
|
1823
|
+
let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: !1, items: [] };
|
|
1824
|
+
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
1825
|
+
let a = this.rules.other.listItemRegex(n), s = !1;
|
|
1826
|
+
for (; e; ) {
|
|
1827
|
+
let l = !1, c = "", u = "";
|
|
1828
|
+
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1829
|
+
c = t[0], e = e.substring(c.length);
|
|
1830
|
+
let f = Ra(t[2].split(`
|
|
1831
|
+
`, 1)[0], t[1].length), g = e.split(`
|
|
1832
|
+
`, 1)[0], y = !f.trim(), x = 0;
|
|
1833
|
+
if (this.options.pedantic ? (x = 2, u = f.trimStart()) : y ? x = t[1].length + 1 : (x = f.search(this.rules.other.nonSpaceChar), x = x > 4 ? 1 : x, u = f.slice(x), x += t[1].length), y && this.rules.other.blankLine.test(g) && (c += g + `
|
|
1834
|
+
`, e = e.substring(g.length + 1), l = !0), !l) {
|
|
1835
|
+
let A = this.rules.other.nextBulletRegex(x), S = this.rules.other.hrRegex(x), I = this.rules.other.fencesBeginRegex(x), p = this.rules.other.headingBeginRegex(x), h = this.rules.other.htmlBeginRegex(x), d = this.rules.other.blockquoteBeginRegex(x);
|
|
1836
|
+
for (; e; ) {
|
|
1837
|
+
let k = e.split(`
|
|
1838
|
+
`, 1)[0], m;
|
|
1839
|
+
if (g = k, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), m = g) : m = g.replace(this.rules.other.tabCharGlobal, " "), I.test(g) || p.test(g) || h.test(g) || d.test(g) || A.test(g) || S.test(g)) break;
|
|
1840
|
+
if (m.search(this.rules.other.nonSpaceChar) >= x || !g.trim()) u += `
|
|
1841
|
+
` + m.slice(x);
|
|
1842
|
+
else {
|
|
1843
|
+
if (y || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || I.test(f) || p.test(f) || S.test(f)) break;
|
|
1844
|
+
u += `
|
|
1845
|
+
` + g;
|
|
1846
|
+
}
|
|
1847
|
+
y = !g.trim(), c += k + `
|
|
1848
|
+
`, e = e.substring(k.length + 1), f = m.slice(x);
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
i.loose || (s ? i.loose = !0 : this.rules.other.doubleBlankLine.test(c) && (s = !0)), i.items.push({ type: "list_item", raw: c, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), i.raw += c;
|
|
1852
|
+
}
|
|
1853
|
+
let o = i.items.at(-1);
|
|
1854
|
+
if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
|
|
1855
|
+
else return;
|
|
1856
|
+
i.raw = i.raw.trimEnd();
|
|
1857
|
+
for (let l of i.items) {
|
|
1858
|
+
this.lexer.state.top = !1, l.tokens = this.lexer.blockTokens(l.text, []);
|
|
1859
|
+
let c = l.tokens[0];
|
|
1860
|
+
if (l.task && (c?.type === "text" || c?.type === "paragraph")) {
|
|
1861
|
+
l.text = l.text.replace(this.rules.other.listReplaceTask, ""), c.raw = c.raw.replace(this.rules.other.listReplaceTask, ""), c.text = c.text.replace(this.rules.other.listReplaceTask, "");
|
|
1862
|
+
for (let f = this.lexer.inlineQueue.length - 1; f >= 0; f--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)) {
|
|
1863
|
+
this.lexer.inlineQueue[f].src = this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask, "");
|
|
1864
|
+
break;
|
|
1865
|
+
}
|
|
1866
|
+
let u = this.rules.other.listTaskCheckbox.exec(l.raw);
|
|
1867
|
+
if (u) {
|
|
1868
|
+
let f = { type: "checkbox", raw: u[0] + " ", checked: u[0] !== "[ ]" };
|
|
1869
|
+
l.checked = f.checked, i.loose ? l.tokens[0] && ["paragraph", "text"].includes(l.tokens[0].type) && "tokens" in l.tokens[0] && l.tokens[0].tokens ? (l.tokens[0].raw = f.raw + l.tokens[0].raw, l.tokens[0].text = f.raw + l.tokens[0].text, l.tokens[0].tokens.unshift(f)) : l.tokens.unshift({ type: "paragraph", raw: f.raw, text: f.raw, tokens: [f] }) : l.tokens.unshift(f);
|
|
1870
|
+
}
|
|
1871
|
+
} else l.task && (l.task = !1);
|
|
1872
|
+
if (!i.loose) {
|
|
1873
|
+
let u = l.tokens.filter((g) => g.type === "space"), f = u.length > 0 && u.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
1874
|
+
i.loose = f;
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
if (i.loose) for (let l of i.items) {
|
|
1878
|
+
l.loose = !0;
|
|
1879
|
+
for (let c of l.tokens) c.type === "text" && (c.type = "paragraph");
|
|
1880
|
+
}
|
|
1881
|
+
return i;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
html(e) {
|
|
1885
|
+
let t = this.rules.block.html.exec(e);
|
|
1886
|
+
if (t) {
|
|
1887
|
+
let n = Jt(t[0]);
|
|
1888
|
+
return { type: "html", block: !0, raw: n, pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: n };
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
def(e) {
|
|
1892
|
+
let t = this.rules.block.def.exec(e);
|
|
1893
|
+
if (t) {
|
|
1894
|
+
let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
1895
|
+
return { type: "def", tag: n, raw: J(t[0], `
|
|
1896
|
+
`), href: r, title: i };
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
table(e) {
|
|
1900
|
+
let t = this.rules.block.table.exec(e);
|
|
1901
|
+
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1902
|
+
let n = Xt(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
1903
|
+
`) : [], a = { type: "table", raw: J(t[0], `
|
|
1904
|
+
`), header: [], align: [], rows: [] };
|
|
1905
|
+
if (n.length === r.length) {
|
|
1906
|
+
for (let s of r) this.rules.other.tableAlignRight.test(s) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? a.align.push("left") : a.align.push(null);
|
|
1907
|
+
for (let s = 0; s < n.length; s++) a.header.push({ text: n[s], tokens: this.lexer.inline(n[s]), header: !0, align: a.align[s] });
|
|
1908
|
+
for (let s of i) a.rows.push(Xt(s, a.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: !1, align: a.align[l] })));
|
|
1909
|
+
return a;
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
lheading(e) {
|
|
1913
|
+
let t = this.rules.block.lheading.exec(e);
|
|
1914
|
+
if (t) {
|
|
1915
|
+
let n = t[1].trim();
|
|
1916
|
+
return { type: "heading", raw: J(t[0], `
|
|
1917
|
+
`), depth: t[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
paragraph(e) {
|
|
1921
|
+
let t = this.rules.block.paragraph.exec(e);
|
|
1922
|
+
if (t) {
|
|
1923
|
+
let n = t[1].charAt(t[1].length - 1) === `
|
|
1924
|
+
` ? t[1].slice(0, -1) : t[1];
|
|
1925
|
+
return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
text(e) {
|
|
1929
|
+
let t = this.rules.block.text.exec(e);
|
|
1930
|
+
if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
|
|
1931
|
+
}
|
|
1932
|
+
escape(e) {
|
|
1933
|
+
let t = this.rules.inline.escape.exec(e);
|
|
1934
|
+
if (t) return { type: "escape", raw: t[0], text: t[1] };
|
|
1935
|
+
}
|
|
1936
|
+
tag(e) {
|
|
1937
|
+
let t = this.rules.inline.tag.exec(e);
|
|
1938
|
+
if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: !1, text: t[0] };
|
|
1939
|
+
}
|
|
1940
|
+
link(e) {
|
|
1941
|
+
let t = this.rules.inline.link.exec(e);
|
|
1942
|
+
if (t) {
|
|
1943
|
+
let n = t[2].trim();
|
|
1944
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
1945
|
+
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
1946
|
+
let a = J(n.slice(0, -1), "\\");
|
|
1947
|
+
if ((n.length - a.length) % 2 === 0) return;
|
|
1948
|
+
} else {
|
|
1949
|
+
let a = _a(t[2], "()");
|
|
1950
|
+
if (a === -2) return;
|
|
1951
|
+
if (a > -1) {
|
|
1952
|
+
let s = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + a;
|
|
1953
|
+
t[2] = t[2].substring(0, a), t[0] = t[0].substring(0, s).trim(), t[3] = "";
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
let r = t[2], i = "";
|
|
1957
|
+
if (this.options.pedantic) {
|
|
1958
|
+
let a = this.rules.other.pedanticHrefTitle.exec(r);
|
|
1959
|
+
a && (r = a[1], i = a[3]);
|
|
1960
|
+
} else i = t[3] ? t[3].slice(1, -1) : "";
|
|
1961
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), en(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
reflink(e, t) {
|
|
1965
|
+
let n;
|
|
1966
|
+
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1967
|
+
let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t[r.toLowerCase()];
|
|
1968
|
+
if (!i) {
|
|
1969
|
+
let a = n[0].charAt(0);
|
|
1970
|
+
return { type: "text", raw: a, text: a };
|
|
1971
|
+
}
|
|
1972
|
+
return en(n, i, n[0], this.lexer, this.rules);
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
emStrong(e, t, n = "") {
|
|
1976
|
+
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
1977
|
+
if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1978
|
+
let i = [...r[0]].length - 1, a, s, o = i, l = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1979
|
+
for (c.lastIndex = 0, t = t.slice(-1 * e.length + i); (r = c.exec(t)) !== null; ) {
|
|
1980
|
+
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
|
|
1981
|
+
if (s = [...a].length, r[3] || r[4]) {
|
|
1982
|
+
o += s;
|
|
1983
|
+
continue;
|
|
1984
|
+
} else if ((r[5] || r[6]) && i % 3 && !((i + s) % 3)) {
|
|
1985
|
+
l += s;
|
|
1986
|
+
continue;
|
|
1987
|
+
}
|
|
1988
|
+
if (o -= s, o > 0) continue;
|
|
1989
|
+
s = Math.min(s, s + o + l);
|
|
1990
|
+
let u = [...r[0]][0].length, f = e.slice(0, i + r.index + u + s);
|
|
1991
|
+
if (Math.min(i, s) % 2) {
|
|
1992
|
+
let y = f.slice(1, -1);
|
|
1993
|
+
return { type: "em", raw: f, text: y, tokens: this.lexer.inlineTokens(y) };
|
|
1994
|
+
}
|
|
1995
|
+
let g = f.slice(2, -2);
|
|
1996
|
+
return { type: "strong", raw: f, text: g, tokens: this.lexer.inlineTokens(g) };
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
codespan(e) {
|
|
2001
|
+
let t = this.rules.inline.code.exec(e);
|
|
2002
|
+
if (t) {
|
|
2003
|
+
let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
|
|
2004
|
+
return r && i && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
br(e) {
|
|
2008
|
+
let t = this.rules.inline.br.exec(e);
|
|
2009
|
+
if (t) return { type: "br", raw: t[0] };
|
|
2010
|
+
}
|
|
2011
|
+
del(e, t, n = "") {
|
|
2012
|
+
let r = this.rules.inline.delLDelim.exec(e);
|
|
2013
|
+
if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
|
|
2014
|
+
let i = [...r[0]].length - 1, a, s, o = i, l = this.rules.inline.delRDelim;
|
|
2015
|
+
for (l.lastIndex = 0, t = t.slice(-1 * e.length + i); (r = l.exec(t)) !== null; ) {
|
|
2016
|
+
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a || (s = [...a].length, s !== i)) continue;
|
|
2017
|
+
if (r[3] || r[4]) {
|
|
2018
|
+
o += s;
|
|
2019
|
+
continue;
|
|
2020
|
+
}
|
|
2021
|
+
if (o -= s, o > 0) continue;
|
|
2022
|
+
s = Math.min(s, s + o);
|
|
2023
|
+
let c = [...r[0]][0].length, u = e.slice(0, i + r.index + c + s), f = u.slice(i, -i);
|
|
2024
|
+
return { type: "del", raw: u, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
autolink(e) {
|
|
2029
|
+
let t = this.rules.inline.autolink.exec(e);
|
|
2030
|
+
if (t) {
|
|
2031
|
+
let n, r;
|
|
2032
|
+
return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
url(e) {
|
|
2036
|
+
let t;
|
|
2037
|
+
if (t = this.rules.inline.url.exec(e)) {
|
|
2038
|
+
let n, r;
|
|
2039
|
+
if (t[2] === "@") n = t[0], r = "mailto:" + n;
|
|
2040
|
+
else {
|
|
2041
|
+
let i;
|
|
2042
|
+
do
|
|
2043
|
+
i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
|
|
2044
|
+
while (i !== t[0]);
|
|
2045
|
+
n = t[0], t[1] === "www." ? r = "http://" + t[0] : r = t[0];
|
|
2046
|
+
}
|
|
2047
|
+
return { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
inlineText(e) {
|
|
2051
|
+
let t = this.rules.inline.text.exec(e);
|
|
2052
|
+
if (t) {
|
|
2053
|
+
let n = this.lexer.state.inRawBlock;
|
|
2054
|
+
return { type: "text", raw: t[0], text: t[0], escaped: n };
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
}, j = class ct {
|
|
2058
|
+
tokens;
|
|
2059
|
+
options;
|
|
2060
|
+
state;
|
|
2061
|
+
inlineQueue;
|
|
2062
|
+
tokenizer;
|
|
2063
|
+
constructor(t) {
|
|
2064
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || le, this.options.tokenizer = this.options.tokenizer || new ze(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
2065
|
+
let n = { other: P, block: Fe.normal, inline: ye.normal };
|
|
2066
|
+
this.options.pedantic ? (n.block = Fe.pedantic, n.inline = ye.pedantic) : this.options.gfm && (n.block = Fe.gfm, this.options.breaks ? n.inline = ye.breaks : n.inline = ye.gfm), this.tokenizer.rules = n;
|
|
2067
|
+
}
|
|
2068
|
+
static get rules() {
|
|
2069
|
+
return { block: Fe, inline: ye };
|
|
2070
|
+
}
|
|
2071
|
+
static lex(t, n) {
|
|
2072
|
+
return new ct(n).lex(t);
|
|
2073
|
+
}
|
|
2074
|
+
static lexInline(t, n) {
|
|
2075
|
+
return new ct(n).inlineTokens(t);
|
|
2076
|
+
}
|
|
2077
|
+
lex(t) {
|
|
2078
|
+
t = t.replace(P.carriageReturn, `
|
|
2079
|
+
`), this.blockTokens(t, this.tokens);
|
|
2080
|
+
for (let n = 0; n < this.inlineQueue.length; n++) {
|
|
2081
|
+
let r = this.inlineQueue[n];
|
|
2082
|
+
this.inlineTokens(r.src, r.tokens);
|
|
2083
|
+
}
|
|
2084
|
+
return this.inlineQueue = [], this.tokens;
|
|
2085
|
+
}
|
|
2086
|
+
blockTokens(t, n = [], r = !1) {
|
|
2087
|
+
this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(P.tabCharGlobal, " ").replace(P.spaceLine, ""));
|
|
2088
|
+
let i = 1 / 0;
|
|
2089
|
+
for (; t; ) {
|
|
2090
|
+
if (t.length < i) i = t.length;
|
|
2091
|
+
else {
|
|
2092
|
+
this.infiniteLoopError(t.charCodeAt(0));
|
|
2093
|
+
break;
|
|
2094
|
+
}
|
|
2095
|
+
let a;
|
|
2096
|
+
if (this.options.extensions?.block?.some((o) => (a = o.call({ lexer: this }, t, n)) ? (t = t.substring(a.raw.length), n.push(a), !0) : !1)) continue;
|
|
2097
|
+
if (a = this.tokenizer.space(t)) {
|
|
2098
|
+
t = t.substring(a.raw.length);
|
|
2099
|
+
let o = n.at(-1);
|
|
2100
|
+
a.raw.length === 1 && o !== void 0 ? o.raw += `
|
|
2101
|
+
` : n.push(a);
|
|
2102
|
+
continue;
|
|
2103
|
+
}
|
|
2104
|
+
if (a = this.tokenizer.code(t)) {
|
|
2105
|
+
t = t.substring(a.raw.length);
|
|
2106
|
+
let o = n.at(-1);
|
|
2107
|
+
o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
|
|
2108
|
+
`) ? "" : `
|
|
2109
|
+
`) + a.raw, o.text += `
|
|
2110
|
+
` + a.text, this.inlineQueue.at(-1).src = o.text) : n.push(a);
|
|
2111
|
+
continue;
|
|
2112
|
+
}
|
|
2113
|
+
if (a = this.tokenizer.fences(t)) {
|
|
2114
|
+
t = t.substring(a.raw.length), n.push(a);
|
|
2115
|
+
continue;
|
|
2116
|
+
}
|
|
2117
|
+
if (a = this.tokenizer.heading(t)) {
|
|
2118
|
+
t = t.substring(a.raw.length), n.push(a);
|
|
2119
|
+
continue;
|
|
2120
|
+
}
|
|
2121
|
+
if (a = this.tokenizer.hr(t)) {
|
|
2122
|
+
t = t.substring(a.raw.length), n.push(a);
|
|
2123
|
+
continue;
|
|
2124
|
+
}
|
|
2125
|
+
if (a = this.tokenizer.blockquote(t)) {
|
|
2126
|
+
t = t.substring(a.raw.length), n.push(a);
|
|
2127
|
+
continue;
|
|
2128
|
+
}
|
|
2129
|
+
if (a = this.tokenizer.list(t)) {
|
|
2130
|
+
t = t.substring(a.raw.length), n.push(a);
|
|
2131
|
+
continue;
|
|
2132
|
+
}
|
|
2133
|
+
if (a = this.tokenizer.html(t)) {
|
|
2134
|
+
t = t.substring(a.raw.length), n.push(a);
|
|
2135
|
+
continue;
|
|
2136
|
+
}
|
|
2137
|
+
if (a = this.tokenizer.def(t)) {
|
|
2138
|
+
t = t.substring(a.raw.length);
|
|
2139
|
+
let o = n.at(-1);
|
|
2140
|
+
o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
|
|
2141
|
+
`) ? "" : `
|
|
2142
|
+
`) + a.raw, o.text += `
|
|
2143
|
+
` + a.raw, this.inlineQueue.at(-1).src = o.text) : this.tokens.links[a.tag] || (this.tokens.links[a.tag] = { href: a.href, title: a.title }, n.push(a));
|
|
2144
|
+
continue;
|
|
2145
|
+
}
|
|
2146
|
+
if (a = this.tokenizer.table(t)) {
|
|
2147
|
+
t = t.substring(a.raw.length), n.push(a);
|
|
2148
|
+
continue;
|
|
2149
|
+
}
|
|
2150
|
+
if (a = this.tokenizer.lheading(t)) {
|
|
2151
|
+
t = t.substring(a.raw.length), n.push(a);
|
|
2152
|
+
continue;
|
|
2153
|
+
}
|
|
2154
|
+
let s = t;
|
|
2155
|
+
if (this.options.extensions?.startBlock) {
|
|
2156
|
+
let o = 1 / 0, l = t.slice(1), c;
|
|
2157
|
+
this.options.extensions.startBlock.forEach((u) => {
|
|
2158
|
+
c = u.call({ lexer: this }, l), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
|
|
2159
|
+
}), o < 1 / 0 && o >= 0 && (s = t.substring(0, o + 1));
|
|
2160
|
+
}
|
|
2161
|
+
if (this.state.top && (a = this.tokenizer.paragraph(s))) {
|
|
2162
|
+
let o = n.at(-1);
|
|
2163
|
+
r && o?.type === "paragraph" ? (o.raw += (o.raw.endsWith(`
|
|
2164
|
+
`) ? "" : `
|
|
2165
|
+
`) + a.raw, o.text += `
|
|
2166
|
+
` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : n.push(a), r = s.length !== t.length, t = t.substring(a.raw.length);
|
|
2167
|
+
continue;
|
|
2168
|
+
}
|
|
2169
|
+
if (a = this.tokenizer.text(t)) {
|
|
2170
|
+
t = t.substring(a.raw.length);
|
|
2171
|
+
let o = n.at(-1);
|
|
2172
|
+
o?.type === "text" ? (o.raw += (o.raw.endsWith(`
|
|
2173
|
+
`) ? "" : `
|
|
2174
|
+
`) + a.raw, o.text += `
|
|
2175
|
+
` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : n.push(a);
|
|
2176
|
+
continue;
|
|
2177
|
+
}
|
|
2178
|
+
if (t) {
|
|
2179
|
+
this.infiniteLoopError(t.charCodeAt(0));
|
|
2180
|
+
break;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
return this.state.top = !0, n;
|
|
2184
|
+
}
|
|
2185
|
+
inline(t, n = []) {
|
|
2186
|
+
return this.inlineQueue.push({ src: t, tokens: n }), n;
|
|
2187
|
+
}
|
|
2188
|
+
inlineTokens(t, n = []) {
|
|
2189
|
+
this.tokenizer.lexer = this;
|
|
2190
|
+
let r = t;
|
|
2191
|
+
if (this.tokens.links) {
|
|
2192
|
+
let o = Object.keys(this.tokens.links);
|
|
2193
|
+
o.length > 0 && (r = r.replace(this.tokenizer.rules.inline.reflinkSearch, (l) => o.includes(l.slice(l.lastIndexOf("[") + 1, -1)) ? "[" + "a".repeat(l.length - 2) + "]" : l));
|
|
2194
|
+
}
|
|
2195
|
+
r = r.replace(this.tokenizer.rules.inline.anyPunctuation, "++"), r = r.replace(this.tokenizer.rules.inline.blockSkip, (o, l, c) => {
|
|
2196
|
+
let u = c ? c.length : 0;
|
|
2197
|
+
return o.slice(0, u) + "[" + "a".repeat(o.length - u - 2) + "]";
|
|
2198
|
+
}), r = this.options.hooks?.emStrongMask?.call({ lexer: this }, r) ?? r;
|
|
2199
|
+
let i = !1, a = "", s = 1 / 0;
|
|
2200
|
+
for (; t; ) {
|
|
2201
|
+
if (t.length < s) s = t.length;
|
|
2202
|
+
else {
|
|
2203
|
+
this.infiniteLoopError(t.charCodeAt(0));
|
|
2204
|
+
break;
|
|
2205
|
+
}
|
|
2206
|
+
i || (a = ""), i = !1;
|
|
2207
|
+
let o;
|
|
2208
|
+
if (this.options.extensions?.inline?.some((c) => (o = c.call({ lexer: this }, t, n)) ? (t = t.substring(o.raw.length), n.push(o), !0) : !1)) continue;
|
|
2209
|
+
if (o = this.tokenizer.escape(t)) {
|
|
2210
|
+
t = t.substring(o.raw.length), n.push(o);
|
|
2211
|
+
continue;
|
|
2212
|
+
}
|
|
2213
|
+
if (o = this.tokenizer.tag(t)) {
|
|
2214
|
+
t = t.substring(o.raw.length), n.push(o);
|
|
2215
|
+
continue;
|
|
2216
|
+
}
|
|
2217
|
+
if (o = this.tokenizer.link(t)) {
|
|
2218
|
+
t = t.substring(o.raw.length), n.push(o);
|
|
2219
|
+
continue;
|
|
2220
|
+
}
|
|
2221
|
+
if (o = this.tokenizer.reflink(t, this.tokens.links)) {
|
|
2222
|
+
t = t.substring(o.raw.length);
|
|
2223
|
+
let c = n.at(-1);
|
|
2224
|
+
o.type === "text" && c?.type === "text" ? (c.raw += o.raw, c.text += o.text) : n.push(o);
|
|
2225
|
+
continue;
|
|
2226
|
+
}
|
|
2227
|
+
if (o = this.tokenizer.emStrong(t, r, a)) {
|
|
2228
|
+
t = t.substring(o.raw.length), n.push(o);
|
|
2229
|
+
continue;
|
|
2230
|
+
}
|
|
2231
|
+
if (o = this.tokenizer.codespan(t)) {
|
|
2232
|
+
t = t.substring(o.raw.length), n.push(o);
|
|
2233
|
+
continue;
|
|
2234
|
+
}
|
|
2235
|
+
if (o = this.tokenizer.br(t)) {
|
|
2236
|
+
t = t.substring(o.raw.length), n.push(o);
|
|
2237
|
+
continue;
|
|
2238
|
+
}
|
|
2239
|
+
if (o = this.tokenizer.del(t, r, a)) {
|
|
2240
|
+
t = t.substring(o.raw.length), n.push(o);
|
|
2241
|
+
continue;
|
|
2242
|
+
}
|
|
2243
|
+
if (o = this.tokenizer.autolink(t)) {
|
|
2244
|
+
t = t.substring(o.raw.length), n.push(o);
|
|
2245
|
+
continue;
|
|
2246
|
+
}
|
|
2247
|
+
if (!this.state.inLink && (o = this.tokenizer.url(t))) {
|
|
2248
|
+
t = t.substring(o.raw.length), n.push(o);
|
|
2249
|
+
continue;
|
|
2250
|
+
}
|
|
2251
|
+
let l = t;
|
|
2252
|
+
if (this.options.extensions?.startInline) {
|
|
2253
|
+
let c = 1 / 0, u = t.slice(1), f;
|
|
2254
|
+
this.options.extensions.startInline.forEach((g) => {
|
|
2255
|
+
f = g.call({ lexer: this }, u), typeof f == "number" && f >= 0 && (c = Math.min(c, f));
|
|
2256
|
+
}), c < 1 / 0 && c >= 0 && (l = t.substring(0, c + 1));
|
|
2257
|
+
}
|
|
2258
|
+
if (o = this.tokenizer.inlineText(l)) {
|
|
2259
|
+
t = t.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), i = !0;
|
|
2260
|
+
let c = n.at(-1);
|
|
2261
|
+
c?.type === "text" ? (c.raw += o.raw, c.text += o.text) : n.push(o);
|
|
2262
|
+
continue;
|
|
2263
|
+
}
|
|
2264
|
+
if (t) {
|
|
2265
|
+
this.infiniteLoopError(t.charCodeAt(0));
|
|
2266
|
+
break;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
return n;
|
|
2270
|
+
}
|
|
2271
|
+
infiniteLoopError(t) {
|
|
2272
|
+
let n = "Infinite loop on byte: " + t;
|
|
2273
|
+
if (this.options.silent) console.error(n);
|
|
2274
|
+
else throw new Error(n);
|
|
2275
|
+
}
|
|
2276
|
+
}, Me = class {
|
|
2277
|
+
options;
|
|
2278
|
+
parser;
|
|
2279
|
+
constructor(e) {
|
|
2280
|
+
this.options = e || le;
|
|
2281
|
+
}
|
|
2282
|
+
space(e) {
|
|
2283
|
+
return "";
|
|
2284
|
+
}
|
|
2285
|
+
code({ text: e, lang: t, escaped: n }) {
|
|
2286
|
+
let r = (t || "").match(P.notSpaceStart)?.[0], i = e.replace(P.endingNewline, "") + `
|
|
2287
|
+
`;
|
|
2288
|
+
return r ? '<pre><code class="language-' + W(r) + '">' + (n ? i : W(i, !0)) + `</code></pre>
|
|
2289
|
+
` : "<pre><code>" + (n ? i : W(i, !0)) + `</code></pre>
|
|
2290
|
+
`;
|
|
2291
|
+
}
|
|
2292
|
+
blockquote({ tokens: e }) {
|
|
2293
|
+
return `<blockquote>
|
|
2294
|
+
${this.parser.parse(e)}</blockquote>
|
|
2295
|
+
`;
|
|
2296
|
+
}
|
|
2297
|
+
html({ text: e }) {
|
|
2298
|
+
return e;
|
|
2299
|
+
}
|
|
2300
|
+
def(e) {
|
|
2301
|
+
return "";
|
|
2302
|
+
}
|
|
2303
|
+
heading({ tokens: e, depth: t }) {
|
|
2304
|
+
return `<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
2305
|
+
`;
|
|
2306
|
+
}
|
|
2307
|
+
hr(e) {
|
|
2308
|
+
return `<hr>
|
|
2309
|
+
`;
|
|
2310
|
+
}
|
|
2311
|
+
list(e) {
|
|
2312
|
+
let t = e.ordered, n = e.start, r = "";
|
|
2313
|
+
for (let s = 0; s < e.items.length; s++) {
|
|
2314
|
+
let o = e.items[s];
|
|
2315
|
+
r += this.listitem(o);
|
|
2316
|
+
}
|
|
2317
|
+
let i = t ? "ol" : "ul", a = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
2318
|
+
return "<" + i + a + `>
|
|
2319
|
+
` + r + "</" + i + `>
|
|
2320
|
+
`;
|
|
2321
|
+
}
|
|
2322
|
+
listitem(e) {
|
|
2323
|
+
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
2324
|
+
`;
|
|
2325
|
+
}
|
|
2326
|
+
checkbox({ checked: e }) {
|
|
2327
|
+
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
2328
|
+
}
|
|
2329
|
+
paragraph({ tokens: e }) {
|
|
2330
|
+
return `<p>${this.parser.parseInline(e)}</p>
|
|
2331
|
+
`;
|
|
2332
|
+
}
|
|
2333
|
+
table(e) {
|
|
2334
|
+
let t = "", n = "";
|
|
2335
|
+
for (let i = 0; i < e.header.length; i++) n += this.tablecell(e.header[i]);
|
|
2336
|
+
t += this.tablerow({ text: n });
|
|
2337
|
+
let r = "";
|
|
2338
|
+
for (let i = 0; i < e.rows.length; i++) {
|
|
2339
|
+
let a = e.rows[i];
|
|
2340
|
+
n = "";
|
|
2341
|
+
for (let s = 0; s < a.length; s++) n += this.tablecell(a[s]);
|
|
2342
|
+
r += this.tablerow({ text: n });
|
|
2343
|
+
}
|
|
2344
|
+
return r && (r = `<tbody>${r}</tbody>`), `<table>
|
|
2345
|
+
<thead>
|
|
2346
|
+
` + t + `</thead>
|
|
2347
|
+
` + r + `</table>
|
|
2348
|
+
`;
|
|
2349
|
+
}
|
|
2350
|
+
tablerow({ text: e }) {
|
|
2351
|
+
return `<tr>
|
|
2352
|
+
${e}</tr>
|
|
2353
|
+
`;
|
|
2354
|
+
}
|
|
2355
|
+
tablecell(e) {
|
|
2356
|
+
let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
|
|
2357
|
+
return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
|
|
2358
|
+
`;
|
|
2359
|
+
}
|
|
2360
|
+
strong({ tokens: e }) {
|
|
2361
|
+
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
2362
|
+
}
|
|
2363
|
+
em({ tokens: e }) {
|
|
2364
|
+
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
2365
|
+
}
|
|
2366
|
+
codespan({ text: e }) {
|
|
2367
|
+
return `<code>${W(e, !0)}</code>`;
|
|
2368
|
+
}
|
|
2369
|
+
br(e) {
|
|
2370
|
+
return "<br>";
|
|
2371
|
+
}
|
|
2372
|
+
del({ tokens: e }) {
|
|
2373
|
+
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
2374
|
+
}
|
|
2375
|
+
link({ href: e, title: t, tokens: n }) {
|
|
2376
|
+
let r = this.parser.parseInline(n), i = Qt(e);
|
|
2377
|
+
if (i === null) return r;
|
|
2378
|
+
e = i;
|
|
2379
|
+
let a = '<a href="' + e + '"';
|
|
2380
|
+
return t && (a += ' title="' + W(t) + '"'), a += ">" + r + "</a>", a;
|
|
2381
|
+
}
|
|
2382
|
+
image({ href: e, title: t, text: n, tokens: r }) {
|
|
2383
|
+
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
2384
|
+
let i = Qt(e);
|
|
2385
|
+
if (i === null) return W(n);
|
|
2386
|
+
e = i;
|
|
2387
|
+
let a = `<img src="${e}" alt="${W(n)}"`;
|
|
2388
|
+
return t && (a += ` title="${W(t)}"`), a += ">", a;
|
|
2389
|
+
}
|
|
2390
|
+
text(e) {
|
|
2391
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : W(e.text);
|
|
2392
|
+
}
|
|
2393
|
+
}, It = class {
|
|
2394
|
+
strong({ text: e }) {
|
|
2395
|
+
return e;
|
|
2396
|
+
}
|
|
2397
|
+
em({ text: e }) {
|
|
2398
|
+
return e;
|
|
2399
|
+
}
|
|
2400
|
+
codespan({ text: e }) {
|
|
2401
|
+
return e;
|
|
2402
|
+
}
|
|
2403
|
+
del({ text: e }) {
|
|
2404
|
+
return e;
|
|
2405
|
+
}
|
|
2406
|
+
html({ text: e }) {
|
|
2407
|
+
return e;
|
|
2408
|
+
}
|
|
2409
|
+
text({ text: e }) {
|
|
2410
|
+
return e;
|
|
2411
|
+
}
|
|
2412
|
+
link({ text: e }) {
|
|
2413
|
+
return "" + e;
|
|
2414
|
+
}
|
|
2415
|
+
image({ text: e }) {
|
|
2416
|
+
return "" + e;
|
|
2417
|
+
}
|
|
2418
|
+
br() {
|
|
2419
|
+
return "";
|
|
2420
|
+
}
|
|
2421
|
+
checkbox({ raw: e }) {
|
|
2422
|
+
return e;
|
|
2423
|
+
}
|
|
2424
|
+
}, U = class ut {
|
|
2425
|
+
options;
|
|
2426
|
+
renderer;
|
|
2427
|
+
textRenderer;
|
|
2428
|
+
constructor(t) {
|
|
2429
|
+
this.options = t || le, this.options.renderer = this.options.renderer || new Me(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new It();
|
|
2430
|
+
}
|
|
2431
|
+
static parse(t, n) {
|
|
2432
|
+
return new ut(n).parse(t);
|
|
2433
|
+
}
|
|
2434
|
+
static parseInline(t, n) {
|
|
2435
|
+
return new ut(n).parseInline(t);
|
|
2436
|
+
}
|
|
2437
|
+
parse(t) {
|
|
2438
|
+
this.renderer.parser = this;
|
|
2439
|
+
let n = "";
|
|
2440
|
+
for (let r = 0; r < t.length; r++) {
|
|
2441
|
+
let i = t[r];
|
|
2442
|
+
if (this.options.extensions?.renderers?.[i.type]) {
|
|
2443
|
+
let s = i, o = this.options.extensions.renderers[s.type].call({ parser: this }, s);
|
|
2444
|
+
if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
|
|
2445
|
+
n += o || "";
|
|
2446
|
+
continue;
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
let a = i;
|
|
2450
|
+
switch (a.type) {
|
|
2451
|
+
case "space": {
|
|
2452
|
+
n += this.renderer.space(a);
|
|
2453
|
+
break;
|
|
2454
|
+
}
|
|
2455
|
+
case "hr": {
|
|
2456
|
+
n += this.renderer.hr(a);
|
|
2457
|
+
break;
|
|
2458
|
+
}
|
|
2459
|
+
case "heading": {
|
|
2460
|
+
n += this.renderer.heading(a);
|
|
2461
|
+
break;
|
|
2462
|
+
}
|
|
2463
|
+
case "code": {
|
|
2464
|
+
n += this.renderer.code(a);
|
|
2465
|
+
break;
|
|
2466
|
+
}
|
|
2467
|
+
case "table": {
|
|
2468
|
+
n += this.renderer.table(a);
|
|
2469
|
+
break;
|
|
2470
|
+
}
|
|
2471
|
+
case "blockquote": {
|
|
2472
|
+
n += this.renderer.blockquote(a);
|
|
2473
|
+
break;
|
|
2474
|
+
}
|
|
2475
|
+
case "list": {
|
|
2476
|
+
n += this.renderer.list(a);
|
|
2477
|
+
break;
|
|
2478
|
+
}
|
|
2479
|
+
case "checkbox": {
|
|
2480
|
+
n += this.renderer.checkbox(a);
|
|
2481
|
+
break;
|
|
2482
|
+
}
|
|
2483
|
+
case "html": {
|
|
2484
|
+
n += this.renderer.html(a);
|
|
2485
|
+
break;
|
|
2486
|
+
}
|
|
2487
|
+
case "def": {
|
|
2488
|
+
n += this.renderer.def(a);
|
|
2489
|
+
break;
|
|
2490
|
+
}
|
|
2491
|
+
case "paragraph": {
|
|
2492
|
+
n += this.renderer.paragraph(a);
|
|
2493
|
+
break;
|
|
2494
|
+
}
|
|
2495
|
+
case "text": {
|
|
2496
|
+
n += this.renderer.text(a);
|
|
2497
|
+
break;
|
|
2498
|
+
}
|
|
2499
|
+
default: {
|
|
2500
|
+
let s = 'Token with "' + a.type + '" type was not found.';
|
|
2501
|
+
if (this.options.silent) return console.error(s), "";
|
|
2502
|
+
throw new Error(s);
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
return n;
|
|
2507
|
+
}
|
|
2508
|
+
parseInline(t, n = this.renderer) {
|
|
2509
|
+
this.renderer.parser = this;
|
|
2510
|
+
let r = "";
|
|
2511
|
+
for (let i = 0; i < t.length; i++) {
|
|
2512
|
+
let a = t[i];
|
|
2513
|
+
if (this.options.extensions?.renderers?.[a.type]) {
|
|
2514
|
+
let o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
|
|
2515
|
+
if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(a.type)) {
|
|
2516
|
+
r += o || "";
|
|
2517
|
+
continue;
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
let s = a;
|
|
2521
|
+
switch (s.type) {
|
|
2522
|
+
case "escape": {
|
|
2523
|
+
r += n.text(s);
|
|
2524
|
+
break;
|
|
2525
|
+
}
|
|
2526
|
+
case "html": {
|
|
2527
|
+
r += n.html(s);
|
|
2528
|
+
break;
|
|
2529
|
+
}
|
|
2530
|
+
case "link": {
|
|
2531
|
+
r += n.link(s);
|
|
2532
|
+
break;
|
|
2533
|
+
}
|
|
2534
|
+
case "image": {
|
|
2535
|
+
r += n.image(s);
|
|
2536
|
+
break;
|
|
2537
|
+
}
|
|
2538
|
+
case "checkbox": {
|
|
2539
|
+
r += n.checkbox(s);
|
|
2540
|
+
break;
|
|
2541
|
+
}
|
|
2542
|
+
case "strong": {
|
|
2543
|
+
r += n.strong(s);
|
|
2544
|
+
break;
|
|
2545
|
+
}
|
|
2546
|
+
case "em": {
|
|
2547
|
+
r += n.em(s);
|
|
2548
|
+
break;
|
|
2549
|
+
}
|
|
2550
|
+
case "codespan": {
|
|
2551
|
+
r += n.codespan(s);
|
|
2552
|
+
break;
|
|
2553
|
+
}
|
|
2554
|
+
case "br": {
|
|
2555
|
+
r += n.br(s);
|
|
2556
|
+
break;
|
|
2557
|
+
}
|
|
2558
|
+
case "del": {
|
|
2559
|
+
r += n.del(s);
|
|
2560
|
+
break;
|
|
2561
|
+
}
|
|
2562
|
+
case "text": {
|
|
2563
|
+
r += n.text(s);
|
|
2564
|
+
break;
|
|
2565
|
+
}
|
|
2566
|
+
default: {
|
|
2567
|
+
let o = 'Token with "' + s.type + '" type was not found.';
|
|
2568
|
+
if (this.options.silent) return console.error(o), "";
|
|
2569
|
+
throw new Error(o);
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
return r;
|
|
2574
|
+
}
|
|
2575
|
+
}, we = class {
|
|
2576
|
+
options;
|
|
2577
|
+
block;
|
|
2578
|
+
constructor(e) {
|
|
2579
|
+
this.options = e || le;
|
|
2580
|
+
}
|
|
2581
|
+
static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
2582
|
+
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
2583
|
+
preprocess(e) {
|
|
2584
|
+
return e;
|
|
2585
|
+
}
|
|
2586
|
+
postprocess(e) {
|
|
2587
|
+
return e;
|
|
2588
|
+
}
|
|
2589
|
+
processAllTokens(e) {
|
|
2590
|
+
return e;
|
|
2591
|
+
}
|
|
2592
|
+
emStrongMask(e) {
|
|
2593
|
+
return e;
|
|
2594
|
+
}
|
|
2595
|
+
provideLexer(e = this.block) {
|
|
2596
|
+
return e ? j.lex : j.lexInline;
|
|
2597
|
+
}
|
|
2598
|
+
provideParser(e = this.block) {
|
|
2599
|
+
return e ? U.parse : U.parseInline;
|
|
2600
|
+
}
|
|
2601
|
+
}, Fn = class {
|
|
2602
|
+
defaults = vt();
|
|
2603
|
+
options = this.setOptions;
|
|
2604
|
+
parse = this.parseMarkdown(!0);
|
|
2605
|
+
parseInline = this.parseMarkdown(!1);
|
|
2606
|
+
Parser = U;
|
|
2607
|
+
Renderer = Me;
|
|
2608
|
+
TextRenderer = It;
|
|
2609
|
+
Lexer = j;
|
|
2610
|
+
Tokenizer = ze;
|
|
2611
|
+
Hooks = we;
|
|
2612
|
+
constructor(...e) {
|
|
2613
|
+
this.use(...e);
|
|
2614
|
+
}
|
|
2615
|
+
walkTokens(e, t) {
|
|
2616
|
+
let n = [];
|
|
2617
|
+
for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
|
|
2618
|
+
case "table": {
|
|
2619
|
+
let i = r;
|
|
2620
|
+
for (let a of i.header) n = n.concat(this.walkTokens(a.tokens, t));
|
|
2621
|
+
for (let a of i.rows) for (let s of a) n = n.concat(this.walkTokens(s.tokens, t));
|
|
2622
|
+
break;
|
|
2623
|
+
}
|
|
2624
|
+
case "list": {
|
|
2625
|
+
let i = r;
|
|
2626
|
+
n = n.concat(this.walkTokens(i.items, t));
|
|
2627
|
+
break;
|
|
2628
|
+
}
|
|
2629
|
+
default: {
|
|
2630
|
+
let i = r;
|
|
2631
|
+
this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((a) => {
|
|
2632
|
+
let s = i[a].flat(1 / 0);
|
|
2633
|
+
n = n.concat(this.walkTokens(s, t));
|
|
2634
|
+
}) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
return n;
|
|
2638
|
+
}
|
|
2639
|
+
use(...e) {
|
|
2640
|
+
let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
2641
|
+
return e.forEach((n) => {
|
|
2642
|
+
let r = { ...n };
|
|
2643
|
+
if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((i) => {
|
|
2644
|
+
if (!i.name) throw new Error("extension name required");
|
|
2645
|
+
if ("renderer" in i) {
|
|
2646
|
+
let a = t.renderers[i.name];
|
|
2647
|
+
a ? t.renderers[i.name] = function(...s) {
|
|
2648
|
+
let o = i.renderer.apply(this, s);
|
|
2649
|
+
return o === !1 && (o = a.apply(this, s)), o;
|
|
2650
|
+
} : t.renderers[i.name] = i.renderer;
|
|
2651
|
+
}
|
|
2652
|
+
if ("tokenizer" in i) {
|
|
2653
|
+
if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
|
|
2654
|
+
let a = t[i.level];
|
|
2655
|
+
a ? a.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
|
|
2656
|
+
}
|
|
2657
|
+
"childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
|
|
2658
|
+
}), r.extensions = t), n.renderer) {
|
|
2659
|
+
let i = this.defaults.renderer || new Me(this.defaults);
|
|
2660
|
+
for (let a in n.renderer) {
|
|
2661
|
+
if (!(a in i)) throw new Error(`renderer '${a}' does not exist`);
|
|
2662
|
+
if (["options", "parser"].includes(a)) continue;
|
|
2663
|
+
let s = a, o = n.renderer[s], l = i[s];
|
|
2664
|
+
i[s] = (...c) => {
|
|
2665
|
+
let u = o.apply(i, c);
|
|
2666
|
+
return u === !1 && (u = l.apply(i, c)), u || "";
|
|
2667
|
+
};
|
|
2668
|
+
}
|
|
2669
|
+
r.renderer = i;
|
|
2670
|
+
}
|
|
2671
|
+
if (n.tokenizer) {
|
|
2672
|
+
let i = this.defaults.tokenizer || new ze(this.defaults);
|
|
2673
|
+
for (let a in n.tokenizer) {
|
|
2674
|
+
if (!(a in i)) throw new Error(`tokenizer '${a}' does not exist`);
|
|
2675
|
+
if (["options", "rules", "lexer"].includes(a)) continue;
|
|
2676
|
+
let s = a, o = n.tokenizer[s], l = i[s];
|
|
2677
|
+
i[s] = (...c) => {
|
|
2678
|
+
let u = o.apply(i, c);
|
|
2679
|
+
return u === !1 && (u = l.apply(i, c)), u;
|
|
2680
|
+
};
|
|
2681
|
+
}
|
|
2682
|
+
r.tokenizer = i;
|
|
2683
|
+
}
|
|
2684
|
+
if (n.hooks) {
|
|
2685
|
+
let i = this.defaults.hooks || new we();
|
|
2686
|
+
for (let a in n.hooks) {
|
|
2687
|
+
if (!(a in i)) throw new Error(`hook '${a}' does not exist`);
|
|
2688
|
+
if (["options", "block"].includes(a)) continue;
|
|
2689
|
+
let s = a, o = n.hooks[s], l = i[s];
|
|
2690
|
+
we.passThroughHooks.has(a) ? i[s] = (c) => {
|
|
2691
|
+
if (this.defaults.async && we.passThroughHooksRespectAsync.has(a)) return (async () => {
|
|
2692
|
+
let f = await o.call(i, c);
|
|
2693
|
+
return l.call(i, f);
|
|
2694
|
+
})();
|
|
2695
|
+
let u = o.call(i, c);
|
|
2696
|
+
return l.call(i, u);
|
|
2697
|
+
} : i[s] = (...c) => {
|
|
2698
|
+
if (this.defaults.async) return (async () => {
|
|
2699
|
+
let f = await o.apply(i, c);
|
|
2700
|
+
return f === !1 && (f = await l.apply(i, c)), f;
|
|
2701
|
+
})();
|
|
2702
|
+
let u = o.apply(i, c);
|
|
2703
|
+
return u === !1 && (u = l.apply(i, c)), u;
|
|
2704
|
+
};
|
|
2705
|
+
}
|
|
2706
|
+
r.hooks = i;
|
|
2707
|
+
}
|
|
2708
|
+
if (n.walkTokens) {
|
|
2709
|
+
let i = this.defaults.walkTokens, a = n.walkTokens;
|
|
2710
|
+
r.walkTokens = function(s) {
|
|
2711
|
+
let o = [];
|
|
2712
|
+
return o.push(a.call(this, s)), i && (o = o.concat(i.call(this, s))), o;
|
|
2713
|
+
};
|
|
2714
|
+
}
|
|
2715
|
+
this.defaults = { ...this.defaults, ...r };
|
|
2716
|
+
}), this;
|
|
2717
|
+
}
|
|
2718
|
+
setOptions(e) {
|
|
2719
|
+
return this.defaults = { ...this.defaults, ...e }, this;
|
|
2720
|
+
}
|
|
2721
|
+
lexer(e, t) {
|
|
2722
|
+
return j.lex(e, t ?? this.defaults);
|
|
2723
|
+
}
|
|
2724
|
+
parser(e, t) {
|
|
2725
|
+
return U.parse(e, t ?? this.defaults);
|
|
2726
|
+
}
|
|
2727
|
+
parseMarkdown(e) {
|
|
2728
|
+
return (t, n) => {
|
|
2729
|
+
let r = { ...n }, i = { ...this.defaults, ...r }, a = this.onError(!!i.silent, !!i.async);
|
|
2730
|
+
if (this.defaults.async === !0 && r.async === !1) return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
2731
|
+
if (typeof t > "u" || t === null) return a(new Error("marked(): input parameter is undefined or null"));
|
|
2732
|
+
if (typeof t != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
2733
|
+
if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
|
|
2734
|
+
let s = i.hooks ? await i.hooks.preprocess(t) : t, o = await (i.hooks ? await i.hooks.provideLexer(e) : e ? j.lex : j.lexInline)(s, i), l = i.hooks ? await i.hooks.processAllTokens(o) : o;
|
|
2735
|
+
i.walkTokens && await Promise.all(this.walkTokens(l, i.walkTokens));
|
|
2736
|
+
let c = await (i.hooks ? await i.hooks.provideParser(e) : e ? U.parse : U.parseInline)(l, i);
|
|
2737
|
+
return i.hooks ? await i.hooks.postprocess(c) : c;
|
|
2738
|
+
})().catch(a);
|
|
2739
|
+
try {
|
|
2740
|
+
i.hooks && (t = i.hooks.preprocess(t));
|
|
2741
|
+
let s = (i.hooks ? i.hooks.provideLexer(e) : e ? j.lex : j.lexInline)(t, i);
|
|
2742
|
+
i.hooks && (s = i.hooks.processAllTokens(s)), i.walkTokens && this.walkTokens(s, i.walkTokens);
|
|
2743
|
+
let o = (i.hooks ? i.hooks.provideParser(e) : e ? U.parse : U.parseInline)(s, i);
|
|
2744
|
+
return i.hooks && (o = i.hooks.postprocess(o)), o;
|
|
2745
|
+
} catch (s) {
|
|
2746
|
+
return a(s);
|
|
2747
|
+
}
|
|
2748
|
+
};
|
|
2749
|
+
}
|
|
2750
|
+
onError(e, t) {
|
|
2751
|
+
return (n) => {
|
|
2752
|
+
if (n.message += `
|
|
2753
|
+
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
2754
|
+
let r = "<p>An error occurred:</p><pre>" + W(n.message + "", !0) + "</pre>";
|
|
2755
|
+
return t ? Promise.resolve(r) : r;
|
|
2756
|
+
}
|
|
2757
|
+
if (t) return Promise.reject(n);
|
|
2758
|
+
throw n;
|
|
2759
|
+
};
|
|
2760
|
+
}
|
|
2761
|
+
}, se = new Fn();
|
|
2762
|
+
function F(e, t) {
|
|
2763
|
+
return se.parse(e, t);
|
|
2764
|
+
}
|
|
2765
|
+
F.options = F.setOptions = function(e) {
|
|
2766
|
+
return se.setOptions(e), F.defaults = se.defaults, bn(F.defaults), F;
|
|
2767
|
+
};
|
|
2768
|
+
F.getDefaults = vt;
|
|
2769
|
+
F.defaults = le;
|
|
2770
|
+
F.use = function(...e) {
|
|
2771
|
+
return se.use(...e), F.defaults = se.defaults, bn(F.defaults), F;
|
|
2772
|
+
};
|
|
2773
|
+
F.walkTokens = function(e, t) {
|
|
2774
|
+
return se.walkTokens(e, t);
|
|
2775
|
+
};
|
|
2776
|
+
F.parseInline = se.parseInline;
|
|
2777
|
+
F.Parser = U;
|
|
2778
|
+
F.parser = U.parse;
|
|
2779
|
+
F.Renderer = Me;
|
|
2780
|
+
F.TextRenderer = It;
|
|
2781
|
+
F.Lexer = j;
|
|
2782
|
+
F.lexer = j.lex;
|
|
2783
|
+
F.Tokenizer = ze;
|
|
2784
|
+
F.Hooks = we;
|
|
2785
|
+
F.parse = F;
|
|
2786
|
+
F.options;
|
|
2787
|
+
F.setOptions;
|
|
2788
|
+
F.use;
|
|
2789
|
+
F.walkTokens;
|
|
2790
|
+
F.parseInline;
|
|
2791
|
+
U.parse;
|
|
2792
|
+
j.lex;
|
|
2793
|
+
var Je = { exports: {} }, tn;
|
|
2794
|
+
function La() {
|
|
2795
|
+
return tn || (tn = 1, function(e) {
|
|
2796
|
+
var t = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
2797
|
+
/**
|
|
2798
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
2799
|
+
*
|
|
2800
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
2801
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
2802
|
+
* @namespace
|
|
2803
|
+
* @public
|
|
2804
|
+
*/
|
|
2805
|
+
var n = function(r) {
|
|
2806
|
+
var i = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, a = 0, s = {}, o = {
|
|
2807
|
+
/**
|
|
2808
|
+
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
2809
|
+
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
2810
|
+
* additional languages or plugins yourself.
|
|
2811
|
+
*
|
|
2812
|
+
* By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
|
|
2813
|
+
*
|
|
2814
|
+
* You obviously have to change this value before the automatic highlighting started. To do this, you can add an
|
|
2815
|
+
* empty Prism object into the global scope before loading the Prism script like this:
|
|
2816
|
+
*
|
|
2817
|
+
* ```js
|
|
2818
|
+
* window.Prism = window.Prism || {};
|
|
2819
|
+
* Prism.manual = true;
|
|
2820
|
+
* // add a new <script> to load Prism's script
|
|
2821
|
+
* ```
|
|
2822
|
+
*
|
|
2823
|
+
* @default false
|
|
2824
|
+
* @type {boolean}
|
|
2825
|
+
* @memberof Prism
|
|
2826
|
+
* @public
|
|
2827
|
+
*/
|
|
2828
|
+
manual: r.Prism && r.Prism.manual,
|
|
2829
|
+
/**
|
|
2830
|
+
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
|
|
2831
|
+
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
|
|
2832
|
+
* own worker, you don't want it to do this.
|
|
2833
|
+
*
|
|
2834
|
+
* By setting this value to `true`, Prism will not add its own listeners to the worker.
|
|
2835
|
+
*
|
|
2836
|
+
* You obviously have to change this value before Prism executes. To do this, you can add an
|
|
2837
|
+
* empty Prism object into the global scope before loading the Prism script like this:
|
|
2838
|
+
*
|
|
2839
|
+
* ```js
|
|
2840
|
+
* window.Prism = window.Prism || {};
|
|
2841
|
+
* Prism.disableWorkerMessageHandler = true;
|
|
2842
|
+
* // Load Prism's script
|
|
2843
|
+
* ```
|
|
2844
|
+
*
|
|
2845
|
+
* @default false
|
|
2846
|
+
* @type {boolean}
|
|
2847
|
+
* @memberof Prism
|
|
2848
|
+
* @public
|
|
2849
|
+
*/
|
|
2850
|
+
disableWorkerMessageHandler: r.Prism && r.Prism.disableWorkerMessageHandler,
|
|
2851
|
+
/**
|
|
2852
|
+
* A namespace for utility methods.
|
|
2853
|
+
*
|
|
2854
|
+
* All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
|
|
2855
|
+
* change or disappear at any time.
|
|
2856
|
+
*
|
|
2857
|
+
* @namespace
|
|
2858
|
+
* @memberof Prism
|
|
2859
|
+
*/
|
|
2860
|
+
util: {
|
|
2861
|
+
encode: function p(h) {
|
|
2862
|
+
return h instanceof l ? new l(h.type, p(h.content), h.alias) : Array.isArray(h) ? h.map(p) : h.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
2863
|
+
},
|
|
2864
|
+
/**
|
|
2865
|
+
* Returns the name of the type of the given value.
|
|
2866
|
+
*
|
|
2867
|
+
* @param {any} o
|
|
2868
|
+
* @returns {string}
|
|
2869
|
+
* @example
|
|
2870
|
+
* type(null) === 'Null'
|
|
2871
|
+
* type(undefined) === 'Undefined'
|
|
2872
|
+
* type(123) === 'Number'
|
|
2873
|
+
* type('foo') === 'String'
|
|
2874
|
+
* type(true) === 'Boolean'
|
|
2875
|
+
* type([1, 2]) === 'Array'
|
|
2876
|
+
* type({}) === 'Object'
|
|
2877
|
+
* type(String) === 'Function'
|
|
2878
|
+
* type(/abc+/) === 'RegExp'
|
|
2879
|
+
*/
|
|
2880
|
+
type: function(p) {
|
|
2881
|
+
return Object.prototype.toString.call(p).slice(8, -1);
|
|
2882
|
+
},
|
|
2883
|
+
/**
|
|
2884
|
+
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
2885
|
+
*
|
|
2886
|
+
* @param {Object} obj
|
|
2887
|
+
* @returns {number}
|
|
2888
|
+
*/
|
|
2889
|
+
objId: function(p) {
|
|
2890
|
+
return p.__id || Object.defineProperty(p, "__id", { value: ++a }), p.__id;
|
|
2891
|
+
},
|
|
2892
|
+
/**
|
|
2893
|
+
* Creates a deep clone of the given object.
|
|
2894
|
+
*
|
|
2895
|
+
* The main intended use of this function is to clone language definitions.
|
|
2896
|
+
*
|
|
2897
|
+
* @param {T} o
|
|
2898
|
+
* @param {Record<number, any>} [visited]
|
|
2899
|
+
* @returns {T}
|
|
2900
|
+
* @template T
|
|
2901
|
+
*/
|
|
2902
|
+
clone: function p(h, d) {
|
|
2903
|
+
d = d || {};
|
|
2904
|
+
var k, m;
|
|
2905
|
+
switch (o.util.type(h)) {
|
|
2906
|
+
case "Object":
|
|
2907
|
+
if (m = o.util.objId(h), d[m])
|
|
2908
|
+
return d[m];
|
|
2909
|
+
k = /** @type {Record<string, any>} */
|
|
2910
|
+
{}, d[m] = k;
|
|
2911
|
+
for (var v in h)
|
|
2912
|
+
h.hasOwnProperty(v) && (k[v] = p(h[v], d));
|
|
2913
|
+
return (
|
|
2914
|
+
/** @type {any} */
|
|
2915
|
+
k
|
|
2916
|
+
);
|
|
2917
|
+
case "Array":
|
|
2918
|
+
return m = o.util.objId(h), d[m] ? d[m] : (k = [], d[m] = k, /** @type {Array} */
|
|
2919
|
+
/** @type {any} */
|
|
2920
|
+
h.forEach(function(E, w) {
|
|
2921
|
+
k[w] = p(E, d);
|
|
2922
|
+
}), /** @type {any} */
|
|
2923
|
+
k);
|
|
2924
|
+
default:
|
|
2925
|
+
return h;
|
|
2926
|
+
}
|
|
2927
|
+
},
|
|
2928
|
+
/**
|
|
2929
|
+
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
|
|
2930
|
+
*
|
|
2931
|
+
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
|
|
2932
|
+
*
|
|
2933
|
+
* @param {Element} element
|
|
2934
|
+
* @returns {string}
|
|
2935
|
+
*/
|
|
2936
|
+
getLanguage: function(p) {
|
|
2937
|
+
for (; p; ) {
|
|
2938
|
+
var h = i.exec(p.className);
|
|
2939
|
+
if (h)
|
|
2940
|
+
return h[1].toLowerCase();
|
|
2941
|
+
p = p.parentElement;
|
|
2942
|
+
}
|
|
2943
|
+
return "none";
|
|
2944
|
+
},
|
|
2945
|
+
/**
|
|
2946
|
+
* Sets the Prism `language-xxxx` class of the given element.
|
|
2947
|
+
*
|
|
2948
|
+
* @param {Element} element
|
|
2949
|
+
* @param {string} language
|
|
2950
|
+
* @returns {void}
|
|
2951
|
+
*/
|
|
2952
|
+
setLanguage: function(p, h) {
|
|
2953
|
+
p.className = p.className.replace(RegExp(i, "gi"), ""), p.classList.add("language-" + h);
|
|
2954
|
+
},
|
|
2955
|
+
/**
|
|
2956
|
+
* Returns the script element that is currently executing.
|
|
2957
|
+
*
|
|
2958
|
+
* This does __not__ work for line script element.
|
|
2959
|
+
*
|
|
2960
|
+
* @returns {HTMLScriptElement | null}
|
|
2961
|
+
*/
|
|
2962
|
+
currentScript: function() {
|
|
2963
|
+
if (typeof document > "u")
|
|
2964
|
+
return null;
|
|
2965
|
+
if (document.currentScript && document.currentScript.tagName === "SCRIPT")
|
|
2966
|
+
return (
|
|
2967
|
+
/** @type {any} */
|
|
2968
|
+
document.currentScript
|
|
2969
|
+
);
|
|
2970
|
+
try {
|
|
2971
|
+
throw new Error();
|
|
2972
|
+
} catch (k) {
|
|
2973
|
+
var p = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(k.stack) || [])[1];
|
|
2974
|
+
if (p) {
|
|
2975
|
+
var h = document.getElementsByTagName("script");
|
|
2976
|
+
for (var d in h)
|
|
2977
|
+
if (h[d].src == p)
|
|
2978
|
+
return h[d];
|
|
2979
|
+
}
|
|
2980
|
+
return null;
|
|
2981
|
+
}
|
|
2982
|
+
},
|
|
2983
|
+
/**
|
|
2984
|
+
* Returns whether a given class is active for `element`.
|
|
2985
|
+
*
|
|
2986
|
+
* The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
|
|
2987
|
+
* if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
|
|
2988
|
+
* given class is just the given class with a `no-` prefix.
|
|
2989
|
+
*
|
|
2990
|
+
* Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
|
|
2991
|
+
* closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
|
|
2992
|
+
* ancestors have the given class or the negated version of it, then the default activation will be returned.
|
|
2993
|
+
*
|
|
2994
|
+
* In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
|
|
2995
|
+
* version of it, the class is considered active.
|
|
2996
|
+
*
|
|
2997
|
+
* @param {Element} element
|
|
2998
|
+
* @param {string} className
|
|
2999
|
+
* @param {boolean} [defaultActivation=false]
|
|
3000
|
+
* @returns {boolean}
|
|
3001
|
+
*/
|
|
3002
|
+
isActive: function(p, h, d) {
|
|
3003
|
+
for (var k = "no-" + h; p; ) {
|
|
3004
|
+
var m = p.classList;
|
|
3005
|
+
if (m.contains(h))
|
|
3006
|
+
return !0;
|
|
3007
|
+
if (m.contains(k))
|
|
3008
|
+
return !1;
|
|
3009
|
+
p = p.parentElement;
|
|
3010
|
+
}
|
|
3011
|
+
return !!d;
|
|
3012
|
+
}
|
|
3013
|
+
},
|
|
3014
|
+
/**
|
|
3015
|
+
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
|
|
3016
|
+
*
|
|
3017
|
+
* @namespace
|
|
3018
|
+
* @memberof Prism
|
|
3019
|
+
* @public
|
|
3020
|
+
*/
|
|
3021
|
+
languages: {
|
|
3022
|
+
/**
|
|
3023
|
+
* The grammar for plain, unformatted text.
|
|
3024
|
+
*/
|
|
3025
|
+
plain: s,
|
|
3026
|
+
plaintext: s,
|
|
3027
|
+
text: s,
|
|
3028
|
+
txt: s,
|
|
3029
|
+
/**
|
|
3030
|
+
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
3031
|
+
*
|
|
3032
|
+
* If a token in `redef` also appears in the copied language, then the existing token in the copied language
|
|
3033
|
+
* will be overwritten at its original position.
|
|
3034
|
+
*
|
|
3035
|
+
* ## Best practices
|
|
3036
|
+
*
|
|
3037
|
+
* Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
|
|
3038
|
+
* doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
|
|
3039
|
+
* understand the language definition because, normally, the order of tokens matters in Prism grammars.
|
|
3040
|
+
*
|
|
3041
|
+
* Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
|
|
3042
|
+
* Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
|
|
3043
|
+
*
|
|
3044
|
+
* @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
|
|
3045
|
+
* @param {Grammar} redef The new tokens to append.
|
|
3046
|
+
* @returns {Grammar} The new language created.
|
|
3047
|
+
* @public
|
|
3048
|
+
* @example
|
|
3049
|
+
* Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
|
|
3050
|
+
* // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
|
|
3051
|
+
* // at its original position
|
|
3052
|
+
* 'comment': { ... },
|
|
3053
|
+
* // CSS doesn't have a 'color' token, so this token will be appended
|
|
3054
|
+
* 'color': /\b(?:red|green|blue)\b/
|
|
3055
|
+
* });
|
|
3056
|
+
*/
|
|
3057
|
+
extend: function(p, h) {
|
|
3058
|
+
var d = o.util.clone(o.languages[p]);
|
|
3059
|
+
for (var k in h)
|
|
3060
|
+
d[k] = h[k];
|
|
3061
|
+
return d;
|
|
3062
|
+
},
|
|
3063
|
+
/**
|
|
3064
|
+
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
3065
|
+
*
|
|
3066
|
+
* ## Usage
|
|
3067
|
+
*
|
|
3068
|
+
* This helper method makes it easy to modify existing languages. For example, the CSS language definition
|
|
3069
|
+
* not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
|
|
3070
|
+
* in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
|
|
3071
|
+
* appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
|
|
3072
|
+
* this:
|
|
3073
|
+
*
|
|
3074
|
+
* ```js
|
|
3075
|
+
* Prism.languages.markup.style = {
|
|
3076
|
+
* // token
|
|
3077
|
+
* };
|
|
3078
|
+
* ```
|
|
3079
|
+
*
|
|
3080
|
+
* then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
|
|
3081
|
+
* before existing tokens. For the CSS example above, you would use it like this:
|
|
3082
|
+
*
|
|
3083
|
+
* ```js
|
|
3084
|
+
* Prism.languages.insertBefore('markup', 'cdata', {
|
|
3085
|
+
* 'style': {
|
|
3086
|
+
* // token
|
|
3087
|
+
* }
|
|
3088
|
+
* });
|
|
3089
|
+
* ```
|
|
3090
|
+
*
|
|
3091
|
+
* ## Special cases
|
|
3092
|
+
*
|
|
3093
|
+
* If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
|
|
3094
|
+
* will be ignored.
|
|
3095
|
+
*
|
|
3096
|
+
* This behavior can be used to insert tokens after `before`:
|
|
3097
|
+
*
|
|
3098
|
+
* ```js
|
|
3099
|
+
* Prism.languages.insertBefore('markup', 'comment', {
|
|
3100
|
+
* 'comment': Prism.languages.markup.comment,
|
|
3101
|
+
* // tokens after 'comment'
|
|
3102
|
+
* });
|
|
3103
|
+
* ```
|
|
3104
|
+
*
|
|
3105
|
+
* ## Limitations
|
|
3106
|
+
*
|
|
3107
|
+
* The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
|
|
3108
|
+
* properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
|
|
3109
|
+
* differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
|
|
3110
|
+
* deleting properties which is necessary to insert at arbitrary positions.
|
|
3111
|
+
*
|
|
3112
|
+
* To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
|
|
3113
|
+
* Instead, it will create a new object and replace all references to the target object with the new one. This
|
|
3114
|
+
* can be done without temporarily deleting properties, so the iteration order is well-defined.
|
|
3115
|
+
*
|
|
3116
|
+
* However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
|
|
3117
|
+
* you hold the target object in a variable, then the value of the variable will not change.
|
|
3118
|
+
*
|
|
3119
|
+
* ```js
|
|
3120
|
+
* var oldMarkup = Prism.languages.markup;
|
|
3121
|
+
* var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
|
|
3122
|
+
*
|
|
3123
|
+
* assert(oldMarkup !== Prism.languages.markup);
|
|
3124
|
+
* assert(newMarkup === Prism.languages.markup);
|
|
3125
|
+
* ```
|
|
3126
|
+
*
|
|
3127
|
+
* @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
|
|
3128
|
+
* object to be modified.
|
|
3129
|
+
* @param {string} before The key to insert before.
|
|
3130
|
+
* @param {Grammar} insert An object containing the key-value pairs to be inserted.
|
|
3131
|
+
* @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
|
|
3132
|
+
* object to be modified.
|
|
3133
|
+
*
|
|
3134
|
+
* Defaults to `Prism.languages`.
|
|
3135
|
+
* @returns {Grammar} The new grammar object.
|
|
3136
|
+
* @public
|
|
3137
|
+
*/
|
|
3138
|
+
insertBefore: function(p, h, d, k) {
|
|
3139
|
+
k = k || /** @type {any} */
|
|
3140
|
+
o.languages;
|
|
3141
|
+
var m = k[p], v = {};
|
|
3142
|
+
for (var E in m)
|
|
3143
|
+
if (m.hasOwnProperty(E)) {
|
|
3144
|
+
if (E == h)
|
|
3145
|
+
for (var w in d)
|
|
3146
|
+
d.hasOwnProperty(w) && (v[w] = d[w]);
|
|
3147
|
+
d.hasOwnProperty(E) || (v[E] = m[E]);
|
|
3148
|
+
}
|
|
3149
|
+
var _ = k[p];
|
|
3150
|
+
return k[p] = v, o.languages.DFS(o.languages, function(N, Q) {
|
|
3151
|
+
Q === _ && N != p && (this[N] = v);
|
|
3152
|
+
}), v;
|
|
3153
|
+
},
|
|
3154
|
+
// Traverse a language definition with Depth First Search
|
|
3155
|
+
DFS: function p(h, d, k, m) {
|
|
3156
|
+
m = m || {};
|
|
3157
|
+
var v = o.util.objId;
|
|
3158
|
+
for (var E in h)
|
|
3159
|
+
if (h.hasOwnProperty(E)) {
|
|
3160
|
+
d.call(h, E, h[E], k || E);
|
|
3161
|
+
var w = h[E], _ = o.util.type(w);
|
|
3162
|
+
_ === "Object" && !m[v(w)] ? (m[v(w)] = !0, p(w, d, null, m)) : _ === "Array" && !m[v(w)] && (m[v(w)] = !0, p(w, d, E, m));
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
},
|
|
3166
|
+
plugins: {},
|
|
3167
|
+
/**
|
|
3168
|
+
* This is the most high-level function in Prism’s API.
|
|
3169
|
+
* It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
|
|
3170
|
+
* each one of them.
|
|
3171
|
+
*
|
|
3172
|
+
* This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
|
|
3173
|
+
*
|
|
3174
|
+
* @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
|
|
3175
|
+
* @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
|
|
3176
|
+
* @memberof Prism
|
|
3177
|
+
* @public
|
|
3178
|
+
*/
|
|
3179
|
+
highlightAll: function(p, h) {
|
|
3180
|
+
o.highlightAllUnder(document, p, h);
|
|
3181
|
+
},
|
|
3182
|
+
/**
|
|
3183
|
+
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
3184
|
+
* {@link Prism.highlightElement} on each one of them.
|
|
3185
|
+
*
|
|
3186
|
+
* The following hooks will be run:
|
|
3187
|
+
* 1. `before-highlightall`
|
|
3188
|
+
* 2. `before-all-elements-highlight`
|
|
3189
|
+
* 3. All hooks of {@link Prism.highlightElement} for each element.
|
|
3190
|
+
*
|
|
3191
|
+
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
|
|
3192
|
+
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
|
|
3193
|
+
* @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
|
|
3194
|
+
* @memberof Prism
|
|
3195
|
+
* @public
|
|
3196
|
+
*/
|
|
3197
|
+
highlightAllUnder: function(p, h, d) {
|
|
3198
|
+
var k = {
|
|
3199
|
+
callback: d,
|
|
3200
|
+
container: p,
|
|
3201
|
+
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
3202
|
+
};
|
|
3203
|
+
o.hooks.run("before-highlightall", k), k.elements = Array.prototype.slice.apply(k.container.querySelectorAll(k.selector)), o.hooks.run("before-all-elements-highlight", k);
|
|
3204
|
+
for (var m = 0, v; v = k.elements[m++]; )
|
|
3205
|
+
o.highlightElement(v, h === !0, k.callback);
|
|
3206
|
+
},
|
|
3207
|
+
/**
|
|
3208
|
+
* Highlights the code inside a single element.
|
|
3209
|
+
*
|
|
3210
|
+
* The following hooks will be run:
|
|
3211
|
+
* 1. `before-sanity-check`
|
|
3212
|
+
* 2. `before-highlight`
|
|
3213
|
+
* 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
|
|
3214
|
+
* 4. `before-insert`
|
|
3215
|
+
* 5. `after-highlight`
|
|
3216
|
+
* 6. `complete`
|
|
3217
|
+
*
|
|
3218
|
+
* Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
|
|
3219
|
+
* the element's language.
|
|
3220
|
+
*
|
|
3221
|
+
* @param {Element} element The element containing the code.
|
|
3222
|
+
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
|
|
3223
|
+
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
|
|
3224
|
+
* to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
|
|
3225
|
+
* [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
|
|
3226
|
+
*
|
|
3227
|
+
* Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
|
|
3228
|
+
* asynchronous highlighting to work. You can build your own bundle on the
|
|
3229
|
+
* [Download page](https://prismjs.com/download.html).
|
|
3230
|
+
* @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
|
|
3231
|
+
* Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
|
|
3232
|
+
* @memberof Prism
|
|
3233
|
+
* @public
|
|
3234
|
+
*/
|
|
3235
|
+
highlightElement: function(p, h, d) {
|
|
3236
|
+
var k = o.util.getLanguage(p), m = o.languages[k];
|
|
3237
|
+
o.util.setLanguage(p, k);
|
|
3238
|
+
var v = p.parentElement;
|
|
3239
|
+
v && v.nodeName.toLowerCase() === "pre" && o.util.setLanguage(v, k);
|
|
3240
|
+
var E = p.textContent, w = {
|
|
3241
|
+
element: p,
|
|
3242
|
+
language: k,
|
|
3243
|
+
grammar: m,
|
|
3244
|
+
code: E
|
|
3245
|
+
};
|
|
3246
|
+
function _(Q) {
|
|
3247
|
+
w.highlightedCode = Q, o.hooks.run("before-insert", w), w.element.innerHTML = w.highlightedCode, o.hooks.run("after-highlight", w), o.hooks.run("complete", w), d && d.call(w.element);
|
|
3248
|
+
}
|
|
3249
|
+
if (o.hooks.run("before-sanity-check", w), v = w.element.parentElement, v && v.nodeName.toLowerCase() === "pre" && !v.hasAttribute("tabindex") && v.setAttribute("tabindex", "0"), !w.code) {
|
|
3250
|
+
o.hooks.run("complete", w), d && d.call(w.element);
|
|
3251
|
+
return;
|
|
3252
|
+
}
|
|
3253
|
+
if (o.hooks.run("before-highlight", w), !w.grammar) {
|
|
3254
|
+
_(o.util.encode(w.code));
|
|
3255
|
+
return;
|
|
3256
|
+
}
|
|
3257
|
+
if (h && r.Worker) {
|
|
3258
|
+
var N = new Worker(o.filename);
|
|
3259
|
+
N.onmessage = function(Q) {
|
|
3260
|
+
_(Q.data);
|
|
3261
|
+
}, N.postMessage(JSON.stringify({
|
|
3262
|
+
language: w.language,
|
|
3263
|
+
code: w.code,
|
|
3264
|
+
immediateClose: !0
|
|
3265
|
+
}));
|
|
3266
|
+
} else
|
|
3267
|
+
_(o.highlight(w.code, w.grammar, w.language));
|
|
3268
|
+
},
|
|
3269
|
+
/**
|
|
3270
|
+
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
3271
|
+
* and the language definitions to use, and returns a string with the HTML produced.
|
|
3272
|
+
*
|
|
3273
|
+
* The following hooks will be run:
|
|
3274
|
+
* 1. `before-tokenize`
|
|
3275
|
+
* 2. `after-tokenize`
|
|
3276
|
+
* 3. `wrap`: On each {@link Token}.
|
|
3277
|
+
*
|
|
3278
|
+
* @param {string} text A string with the code to be highlighted.
|
|
3279
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
|
3280
|
+
*
|
|
3281
|
+
* Usually a language definition like `Prism.languages.markup`.
|
|
3282
|
+
* @param {string} language The name of the language definition passed to `grammar`.
|
|
3283
|
+
* @returns {string} The highlighted HTML.
|
|
3284
|
+
* @memberof Prism
|
|
3285
|
+
* @public
|
|
3286
|
+
* @example
|
|
3287
|
+
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
3288
|
+
*/
|
|
3289
|
+
highlight: function(p, h, d) {
|
|
3290
|
+
var k = {
|
|
3291
|
+
code: p,
|
|
3292
|
+
grammar: h,
|
|
3293
|
+
language: d
|
|
3294
|
+
};
|
|
3295
|
+
if (o.hooks.run("before-tokenize", k), !k.grammar)
|
|
3296
|
+
throw new Error('The language "' + k.language + '" has no grammar.');
|
|
3297
|
+
return k.tokens = o.tokenize(k.code, k.grammar), o.hooks.run("after-tokenize", k), l.stringify(o.util.encode(k.tokens), k.language);
|
|
3298
|
+
},
|
|
3299
|
+
/**
|
|
3300
|
+
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
3301
|
+
* and the language definitions to use, and returns an array with the tokenized code.
|
|
3302
|
+
*
|
|
3303
|
+
* When the language definition includes nested tokens, the function is called recursively on each of these tokens.
|
|
3304
|
+
*
|
|
3305
|
+
* This method could be useful in other contexts as well, as a very crude parser.
|
|
3306
|
+
*
|
|
3307
|
+
* @param {string} text A string with the code to be highlighted.
|
|
3308
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
|
3309
|
+
*
|
|
3310
|
+
* Usually a language definition like `Prism.languages.markup`.
|
|
3311
|
+
* @returns {TokenStream} An array of strings and tokens, a token stream.
|
|
3312
|
+
* @memberof Prism
|
|
3313
|
+
* @public
|
|
3314
|
+
* @example
|
|
3315
|
+
* let code = `var foo = 0;`;
|
|
3316
|
+
* let tokens = Prism.tokenize(code, Prism.languages.javascript);
|
|
3317
|
+
* tokens.forEach(token => {
|
|
3318
|
+
* if (token instanceof Prism.Token && token.type === 'number') {
|
|
3319
|
+
* console.log(`Found numeric literal: ${token.content}`);
|
|
3320
|
+
* }
|
|
3321
|
+
* });
|
|
3322
|
+
*/
|
|
3323
|
+
tokenize: function(p, h) {
|
|
3324
|
+
var d = h.rest;
|
|
3325
|
+
if (d) {
|
|
3326
|
+
for (var k in d)
|
|
3327
|
+
h[k] = d[k];
|
|
3328
|
+
delete h.rest;
|
|
3329
|
+
}
|
|
3330
|
+
var m = new f();
|
|
3331
|
+
return g(m, m.head, p), u(p, m, h, m.head, 0), x(m);
|
|
3332
|
+
},
|
|
3333
|
+
/**
|
|
3334
|
+
* @namespace
|
|
3335
|
+
* @memberof Prism
|
|
3336
|
+
* @public
|
|
3337
|
+
*/
|
|
3338
|
+
hooks: {
|
|
3339
|
+
all: {},
|
|
3340
|
+
/**
|
|
3341
|
+
* Adds the given callback to the list of callbacks for the given hook.
|
|
3342
|
+
*
|
|
3343
|
+
* The callback will be invoked when the hook it is registered for is run.
|
|
3344
|
+
* Hooks are usually directly run by a highlight function but you can also run hooks yourself.
|
|
3345
|
+
*
|
|
3346
|
+
* One callback function can be registered to multiple hooks and the same hook multiple times.
|
|
3347
|
+
*
|
|
3348
|
+
* @param {string} name The name of the hook.
|
|
3349
|
+
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
3350
|
+
* @public
|
|
3351
|
+
*/
|
|
3352
|
+
add: function(p, h) {
|
|
3353
|
+
var d = o.hooks.all;
|
|
3354
|
+
d[p] = d[p] || [], d[p].push(h);
|
|
3355
|
+
},
|
|
3356
|
+
/**
|
|
3357
|
+
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
3358
|
+
*
|
|
3359
|
+
* Callbacks will be invoked synchronously and in the order in which they were registered.
|
|
3360
|
+
*
|
|
3361
|
+
* @param {string} name The name of the hook.
|
|
3362
|
+
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
3363
|
+
* @public
|
|
3364
|
+
*/
|
|
3365
|
+
run: function(p, h) {
|
|
3366
|
+
var d = o.hooks.all[p];
|
|
3367
|
+
if (!(!d || !d.length))
|
|
3368
|
+
for (var k = 0, m; m = d[k++]; )
|
|
3369
|
+
m(h);
|
|
3370
|
+
}
|
|
3371
|
+
},
|
|
3372
|
+
Token: l
|
|
3373
|
+
};
|
|
3374
|
+
r.Prism = o;
|
|
3375
|
+
function l(p, h, d, k) {
|
|
3376
|
+
this.type = p, this.content = h, this.alias = d, this.length = (k || "").length | 0;
|
|
3377
|
+
}
|
|
3378
|
+
l.stringify = function p(h, d) {
|
|
3379
|
+
if (typeof h == "string")
|
|
3380
|
+
return h;
|
|
3381
|
+
if (Array.isArray(h)) {
|
|
3382
|
+
var k = "";
|
|
3383
|
+
return h.forEach(function(_) {
|
|
3384
|
+
k += p(_, d);
|
|
3385
|
+
}), k;
|
|
3386
|
+
}
|
|
3387
|
+
var m = {
|
|
3388
|
+
type: h.type,
|
|
3389
|
+
content: p(h.content, d),
|
|
3390
|
+
tag: "span",
|
|
3391
|
+
classes: ["token", h.type],
|
|
3392
|
+
attributes: {},
|
|
3393
|
+
language: d
|
|
3394
|
+
}, v = h.alias;
|
|
3395
|
+
v && (Array.isArray(v) ? Array.prototype.push.apply(m.classes, v) : m.classes.push(v)), o.hooks.run("wrap", m);
|
|
3396
|
+
var E = "";
|
|
3397
|
+
for (var w in m.attributes)
|
|
3398
|
+
E += " " + w + '="' + (m.attributes[w] || "").replace(/"/g, """) + '"';
|
|
3399
|
+
return "<" + m.tag + ' class="' + m.classes.join(" ") + '"' + E + ">" + m.content + "</" + m.tag + ">";
|
|
3400
|
+
};
|
|
3401
|
+
function c(p, h, d, k) {
|
|
3402
|
+
p.lastIndex = h;
|
|
3403
|
+
var m = p.exec(d);
|
|
3404
|
+
if (m && k && m[1]) {
|
|
3405
|
+
var v = m[1].length;
|
|
3406
|
+
m.index += v, m[0] = m[0].slice(v);
|
|
3407
|
+
}
|
|
3408
|
+
return m;
|
|
3409
|
+
}
|
|
3410
|
+
function u(p, h, d, k, m, v) {
|
|
3411
|
+
for (var E in d)
|
|
3412
|
+
if (!(!d.hasOwnProperty(E) || !d[E])) {
|
|
3413
|
+
var w = d[E];
|
|
3414
|
+
w = Array.isArray(w) ? w : [w];
|
|
3415
|
+
for (var _ = 0; _ < w.length; ++_) {
|
|
3416
|
+
if (v && v.cause == E + "," + _)
|
|
3417
|
+
return;
|
|
3418
|
+
var N = w[_], Q = N.inside, Rt = !!N.lookbehind, Nt = !!N.greedy, zn = N.alias;
|
|
3419
|
+
if (Nt && !N.pattern.global) {
|
|
3420
|
+
var Mn = N.pattern.toString().match(/[imsuy]*$/)[0];
|
|
3421
|
+
N.pattern = RegExp(N.pattern.source, Mn + "g");
|
|
3422
|
+
}
|
|
3423
|
+
for (var Lt = N.pattern || N, L = k.next, H = m; L !== h.tail && !(v && H >= v.reach); H += L.value.length, L = L.next) {
|
|
3424
|
+
var ce = L.value;
|
|
3425
|
+
if (h.length > p.length)
|
|
3426
|
+
return;
|
|
3427
|
+
if (!(ce instanceof l)) {
|
|
3428
|
+
var Te = 1, q;
|
|
3429
|
+
if (Nt) {
|
|
3430
|
+
if (q = c(Lt, H, p, Rt), !q || q.index >= p.length)
|
|
3431
|
+
break;
|
|
3432
|
+
var Ee = q.index, Bn = q.index + q[0].length, X = H;
|
|
3433
|
+
for (X += L.value.length; Ee >= X; )
|
|
3434
|
+
L = L.next, X += L.value.length;
|
|
3435
|
+
if (X -= L.value.length, H = X, L.value instanceof l)
|
|
3436
|
+
continue;
|
|
3437
|
+
for (var xe = L; xe !== h.tail && (X < Bn || typeof xe.value == "string"); xe = xe.next)
|
|
3438
|
+
Te++, X += xe.value.length;
|
|
3439
|
+
Te--, ce = p.slice(H, X), q.index -= H;
|
|
3440
|
+
} else if (q = c(Lt, 0, ce, Rt), !q)
|
|
3441
|
+
continue;
|
|
3442
|
+
var Ee = q.index, Ce = q[0], Ge = ce.slice(0, Ee), Pt = ce.slice(Ee + Ce.length), He = H + ce.length;
|
|
3443
|
+
v && He > v.reach && (v.reach = He);
|
|
3444
|
+
var $e = L.prev;
|
|
3445
|
+
Ge && ($e = g(h, $e, Ge), H += Ge.length), y(h, $e, Te);
|
|
3446
|
+
var Dn = new l(E, Q ? o.tokenize(Ce, Q) : Ce, zn, Ce);
|
|
3447
|
+
if (L = g(h, $e, Dn), Pt && g(h, L, Pt), Te > 1) {
|
|
3448
|
+
var We = {
|
|
3449
|
+
cause: E + "," + _,
|
|
3450
|
+
reach: He
|
|
3451
|
+
};
|
|
3452
|
+
u(p, h, d, L.prev, H, We), v && We.reach > v.reach && (v.reach = We.reach);
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
}
|
|
3456
|
+
}
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
function f() {
|
|
3460
|
+
var p = { value: null, prev: null, next: null }, h = { value: null, prev: p, next: null };
|
|
3461
|
+
p.next = h, this.head = p, this.tail = h, this.length = 0;
|
|
3462
|
+
}
|
|
3463
|
+
function g(p, h, d) {
|
|
3464
|
+
var k = h.next, m = { value: d, prev: h, next: k };
|
|
3465
|
+
return h.next = m, k.prev = m, p.length++, m;
|
|
3466
|
+
}
|
|
3467
|
+
function y(p, h, d) {
|
|
3468
|
+
for (var k = h.next, m = 0; m < d && k !== p.tail; m++)
|
|
3469
|
+
k = k.next;
|
|
3470
|
+
h.next = k, k.prev = h, p.length -= m;
|
|
3471
|
+
}
|
|
3472
|
+
function x(p) {
|
|
3473
|
+
for (var h = [], d = p.head.next; d !== p.tail; )
|
|
3474
|
+
h.push(d.value), d = d.next;
|
|
3475
|
+
return h;
|
|
3476
|
+
}
|
|
3477
|
+
if (!r.document)
|
|
3478
|
+
return r.addEventListener && (o.disableWorkerMessageHandler || r.addEventListener("message", function(p) {
|
|
3479
|
+
var h = JSON.parse(p.data), d = h.language, k = h.code, m = h.immediateClose;
|
|
3480
|
+
r.postMessage(o.highlight(k, o.languages[d], d)), m && r.close();
|
|
3481
|
+
}, !1)), o;
|
|
3482
|
+
var A = o.util.currentScript();
|
|
3483
|
+
A && (o.filename = A.src, A.hasAttribute("data-manual") && (o.manual = !0));
|
|
3484
|
+
function S() {
|
|
3485
|
+
o.manual || o.highlightAll();
|
|
3486
|
+
}
|
|
3487
|
+
if (!o.manual) {
|
|
3488
|
+
var I = document.readyState;
|
|
3489
|
+
I === "loading" || I === "interactive" && A && A.defer ? document.addEventListener("DOMContentLoaded", S) : window.requestAnimationFrame ? window.requestAnimationFrame(S) : window.setTimeout(S, 16);
|
|
3490
|
+
}
|
|
3491
|
+
return o;
|
|
3492
|
+
}(t);
|
|
3493
|
+
e.exports && (e.exports = n), typeof Ot < "u" && (Ot.Prism = n), n.languages.markup = {
|
|
3494
|
+
comment: {
|
|
3495
|
+
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
3496
|
+
greedy: !0
|
|
3497
|
+
},
|
|
3498
|
+
prolog: {
|
|
3499
|
+
pattern: /<\?[\s\S]+?\?>/,
|
|
3500
|
+
greedy: !0
|
|
3501
|
+
},
|
|
3502
|
+
doctype: {
|
|
3503
|
+
// https://www.w3.org/TR/xml/#NT-doctypedecl
|
|
3504
|
+
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
|
3505
|
+
greedy: !0,
|
|
3506
|
+
inside: {
|
|
3507
|
+
"internal-subset": {
|
|
3508
|
+
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
|
3509
|
+
lookbehind: !0,
|
|
3510
|
+
greedy: !0,
|
|
3511
|
+
inside: null
|
|
3512
|
+
// see below
|
|
3513
|
+
},
|
|
3514
|
+
string: {
|
|
3515
|
+
pattern: /"[^"]*"|'[^']*'/,
|
|
3516
|
+
greedy: !0
|
|
3517
|
+
},
|
|
3518
|
+
punctuation: /^<!|>$|[[\]]/,
|
|
3519
|
+
"doctype-tag": /^DOCTYPE/i,
|
|
3520
|
+
name: /[^\s<>'"]+/
|
|
3521
|
+
}
|
|
3522
|
+
},
|
|
3523
|
+
cdata: {
|
|
3524
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
3525
|
+
greedy: !0
|
|
3526
|
+
},
|
|
3527
|
+
tag: {
|
|
3528
|
+
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
|
3529
|
+
greedy: !0,
|
|
3530
|
+
inside: {
|
|
3531
|
+
tag: {
|
|
3532
|
+
pattern: /^<\/?[^\s>\/]+/,
|
|
3533
|
+
inside: {
|
|
3534
|
+
punctuation: /^<\/?/,
|
|
3535
|
+
namespace: /^[^\s>\/:]+:/
|
|
3536
|
+
}
|
|
3537
|
+
},
|
|
3538
|
+
"special-attr": [],
|
|
3539
|
+
"attr-value": {
|
|
3540
|
+
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
|
3541
|
+
inside: {
|
|
3542
|
+
punctuation: [
|
|
3543
|
+
{
|
|
3544
|
+
pattern: /^=/,
|
|
3545
|
+
alias: "attr-equals"
|
|
3546
|
+
},
|
|
3547
|
+
{
|
|
3548
|
+
pattern: /^(\s*)["']|["']$/,
|
|
3549
|
+
lookbehind: !0
|
|
3550
|
+
}
|
|
3551
|
+
]
|
|
3552
|
+
}
|
|
3553
|
+
},
|
|
3554
|
+
punctuation: /\/?>/,
|
|
3555
|
+
"attr-name": {
|
|
3556
|
+
pattern: /[^\s>\/]+/,
|
|
3557
|
+
inside: {
|
|
3558
|
+
namespace: /^[^\s>\/:]+:/
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
},
|
|
3563
|
+
entity: [
|
|
3564
|
+
{
|
|
3565
|
+
pattern: /&[\da-z]{1,8};/i,
|
|
3566
|
+
alias: "named-entity"
|
|
3567
|
+
},
|
|
3568
|
+
/&#x?[\da-f]{1,8};/i
|
|
3569
|
+
]
|
|
3570
|
+
}, n.languages.markup.tag.inside["attr-value"].inside.entity = n.languages.markup.entity, n.languages.markup.doctype.inside["internal-subset"].inside = n.languages.markup, n.hooks.add("wrap", function(r) {
|
|
3571
|
+
r.type === "entity" && (r.attributes.title = r.content.replace(/&/, "&"));
|
|
3572
|
+
}), Object.defineProperty(n.languages.markup.tag, "addInlined", {
|
|
3573
|
+
/**
|
|
3574
|
+
* Adds an inlined language to markup.
|
|
3575
|
+
*
|
|
3576
|
+
* An example of an inlined language is CSS with `<style>` tags.
|
|
3577
|
+
*
|
|
3578
|
+
* @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
|
|
3579
|
+
* case insensitive.
|
|
3580
|
+
* @param {string} lang The language key.
|
|
3581
|
+
* @example
|
|
3582
|
+
* addInlined('style', 'css');
|
|
3583
|
+
*/
|
|
3584
|
+
value: function(i, a) {
|
|
3585
|
+
var s = {};
|
|
3586
|
+
s["language-" + a] = {
|
|
3587
|
+
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
3588
|
+
lookbehind: !0,
|
|
3589
|
+
inside: n.languages[a]
|
|
3590
|
+
}, s.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
3591
|
+
var o = {
|
|
3592
|
+
"included-cdata": {
|
|
3593
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
3594
|
+
inside: s
|
|
3595
|
+
}
|
|
3596
|
+
};
|
|
3597
|
+
o["language-" + a] = {
|
|
3598
|
+
pattern: /[\s\S]+/,
|
|
3599
|
+
inside: n.languages[a]
|
|
3600
|
+
};
|
|
3601
|
+
var l = {};
|
|
3602
|
+
l[i] = {
|
|
3603
|
+
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
3604
|
+
return i;
|
|
3605
|
+
}), "i"),
|
|
3606
|
+
lookbehind: !0,
|
|
3607
|
+
greedy: !0,
|
|
3608
|
+
inside: o
|
|
3609
|
+
}, n.languages.insertBefore("markup", "cdata", l);
|
|
3610
|
+
}
|
|
3611
|
+
}), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
|
|
3612
|
+
/**
|
|
3613
|
+
* Adds an pattern to highlight languages embedded in HTML attributes.
|
|
3614
|
+
*
|
|
3615
|
+
* An example of an inlined language is CSS with `style` attributes.
|
|
3616
|
+
*
|
|
3617
|
+
* @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
|
|
3618
|
+
* case insensitive.
|
|
3619
|
+
* @param {string} lang The language key.
|
|
3620
|
+
* @example
|
|
3621
|
+
* addAttribute('style', 'css');
|
|
3622
|
+
*/
|
|
3623
|
+
value: function(r, i) {
|
|
3624
|
+
n.languages.markup.tag.inside["special-attr"].push({
|
|
3625
|
+
pattern: RegExp(
|
|
3626
|
+
/(^|["'\s])/.source + "(?:" + r + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
3627
|
+
"i"
|
|
3628
|
+
),
|
|
3629
|
+
lookbehind: !0,
|
|
3630
|
+
inside: {
|
|
3631
|
+
"attr-name": /^[^\s=]+/,
|
|
3632
|
+
"attr-value": {
|
|
3633
|
+
pattern: /=[\s\S]+/,
|
|
3634
|
+
inside: {
|
|
3635
|
+
value: {
|
|
3636
|
+
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
3637
|
+
lookbehind: !0,
|
|
3638
|
+
alias: [i, "language-" + i],
|
|
3639
|
+
inside: n.languages[i]
|
|
3640
|
+
},
|
|
3641
|
+
punctuation: [
|
|
3642
|
+
{
|
|
3643
|
+
pattern: /^=/,
|
|
3644
|
+
alias: "attr-equals"
|
|
3645
|
+
},
|
|
3646
|
+
/"|'/
|
|
3647
|
+
]
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
}
|
|
3651
|
+
});
|
|
3652
|
+
}
|
|
3653
|
+
}), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, function(r) {
|
|
3654
|
+
var i = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
3655
|
+
r.languages.css = {
|
|
3656
|
+
comment: /\/\*[\s\S]*?\*\//,
|
|
3657
|
+
atrule: {
|
|
3658
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + i.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
3659
|
+
inside: {
|
|
3660
|
+
rule: /^@[\w-]+/,
|
|
3661
|
+
"selector-function-argument": {
|
|
3662
|
+
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
3663
|
+
lookbehind: !0,
|
|
3664
|
+
alias: "selector"
|
|
3665
|
+
},
|
|
3666
|
+
keyword: {
|
|
3667
|
+
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
3668
|
+
lookbehind: !0
|
|
3669
|
+
}
|
|
3670
|
+
// See rest below
|
|
3671
|
+
}
|
|
3672
|
+
},
|
|
3673
|
+
url: {
|
|
3674
|
+
// https://drafts.csswg.org/css-values-3/#urls
|
|
3675
|
+
pattern: RegExp("\\burl\\((?:" + i.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
3676
|
+
greedy: !0,
|
|
3677
|
+
inside: {
|
|
3678
|
+
function: /^url/i,
|
|
3679
|
+
punctuation: /^\(|\)$/,
|
|
3680
|
+
string: {
|
|
3681
|
+
pattern: RegExp("^" + i.source + "$"),
|
|
3682
|
+
alias: "url"
|
|
3683
|
+
}
|
|
3684
|
+
}
|
|
3685
|
+
},
|
|
3686
|
+
selector: {
|
|
3687
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + i.source + ")*(?=\\s*\\{)"),
|
|
3688
|
+
lookbehind: !0
|
|
3689
|
+
},
|
|
3690
|
+
string: {
|
|
3691
|
+
pattern: i,
|
|
3692
|
+
greedy: !0
|
|
3693
|
+
},
|
|
3694
|
+
property: {
|
|
3695
|
+
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
3696
|
+
lookbehind: !0
|
|
3697
|
+
},
|
|
3698
|
+
important: /!important\b/i,
|
|
3699
|
+
function: {
|
|
3700
|
+
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
3701
|
+
lookbehind: !0
|
|
3702
|
+
},
|
|
3703
|
+
punctuation: /[(){};:,]/
|
|
3704
|
+
}, r.languages.css.atrule.inside.rest = r.languages.css;
|
|
3705
|
+
var a = r.languages.markup;
|
|
3706
|
+
a && (a.tag.addInlined("style", "css"), a.tag.addAttribute("style", "css"));
|
|
3707
|
+
}(n), n.languages.clike = {
|
|
3708
|
+
comment: [
|
|
3709
|
+
{
|
|
3710
|
+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
3711
|
+
lookbehind: !0,
|
|
3712
|
+
greedy: !0
|
|
3713
|
+
},
|
|
3714
|
+
{
|
|
3715
|
+
pattern: /(^|[^\\:])\/\/.*/,
|
|
3716
|
+
lookbehind: !0,
|
|
3717
|
+
greedy: !0
|
|
3718
|
+
}
|
|
3719
|
+
],
|
|
3720
|
+
string: {
|
|
3721
|
+
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
3722
|
+
greedy: !0
|
|
3723
|
+
},
|
|
3724
|
+
"class-name": {
|
|
3725
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
3726
|
+
lookbehind: !0,
|
|
3727
|
+
inside: {
|
|
3728
|
+
punctuation: /[.\\]/
|
|
3729
|
+
}
|
|
3730
|
+
},
|
|
3731
|
+
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
3732
|
+
boolean: /\b(?:false|true)\b/,
|
|
3733
|
+
function: /\b\w+(?=\()/,
|
|
3734
|
+
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
3735
|
+
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
3736
|
+
punctuation: /[{}[\];(),.:]/
|
|
3737
|
+
}, n.languages.javascript = n.languages.extend("clike", {
|
|
3738
|
+
"class-name": [
|
|
3739
|
+
n.languages.clike["class-name"],
|
|
3740
|
+
{
|
|
3741
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
3742
|
+
lookbehind: !0
|
|
3743
|
+
}
|
|
3744
|
+
],
|
|
3745
|
+
keyword: [
|
|
3746
|
+
{
|
|
3747
|
+
pattern: /((?:^|\})\s*)catch\b/,
|
|
3748
|
+
lookbehind: !0
|
|
3749
|
+
},
|
|
3750
|
+
{
|
|
3751
|
+
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
|
|
3752
|
+
lookbehind: !0
|
|
3753
|
+
}
|
|
3754
|
+
],
|
|
3755
|
+
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
|
3756
|
+
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
3757
|
+
number: {
|
|
3758
|
+
pattern: RegExp(
|
|
3759
|
+
/(^|[^\w$])/.source + "(?:" + // constant
|
|
3760
|
+
(/NaN|Infinity/.source + "|" + // binary integer
|
|
3761
|
+
/0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
|
|
3762
|
+
/0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
|
|
3763
|
+
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
|
|
3764
|
+
/\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
|
|
3765
|
+
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
|
|
3766
|
+
),
|
|
3767
|
+
lookbehind: !0
|
|
3768
|
+
},
|
|
3769
|
+
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
3770
|
+
}), n.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, n.languages.insertBefore("javascript", "keyword", {
|
|
3771
|
+
regex: {
|
|
3772
|
+
pattern: RegExp(
|
|
3773
|
+
// lookbehind
|
|
3774
|
+
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
|
3775
|
+
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
|
|
3776
|
+
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
|
|
3777
|
+
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
|
|
3778
|
+
// with the only syntax, so we have to define 2 different regex patterns.
|
|
3779
|
+
/\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
|
|
3780
|
+
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
|
|
3781
|
+
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
|
|
3782
|
+
),
|
|
3783
|
+
lookbehind: !0,
|
|
3784
|
+
greedy: !0,
|
|
3785
|
+
inside: {
|
|
3786
|
+
"regex-source": {
|
|
3787
|
+
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
3788
|
+
lookbehind: !0,
|
|
3789
|
+
alias: "language-regex",
|
|
3790
|
+
inside: n.languages.regex
|
|
3791
|
+
},
|
|
3792
|
+
"regex-delimiter": /^\/|\/$/,
|
|
3793
|
+
"regex-flags": /^[a-z]+$/
|
|
3794
|
+
}
|
|
3795
|
+
},
|
|
3796
|
+
// This must be declared before keyword because we use "function" inside the look-forward
|
|
3797
|
+
"function-variable": {
|
|
3798
|
+
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
|
3799
|
+
alias: "function"
|
|
3800
|
+
},
|
|
3801
|
+
parameter: [
|
|
3802
|
+
{
|
|
3803
|
+
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
3804
|
+
lookbehind: !0,
|
|
3805
|
+
inside: n.languages.javascript
|
|
3806
|
+
},
|
|
3807
|
+
{
|
|
3808
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
3809
|
+
lookbehind: !0,
|
|
3810
|
+
inside: n.languages.javascript
|
|
3811
|
+
},
|
|
3812
|
+
{
|
|
3813
|
+
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
3814
|
+
lookbehind: !0,
|
|
3815
|
+
inside: n.languages.javascript
|
|
3816
|
+
},
|
|
3817
|
+
{
|
|
3818
|
+
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
3819
|
+
lookbehind: !0,
|
|
3820
|
+
inside: n.languages.javascript
|
|
3821
|
+
}
|
|
3822
|
+
],
|
|
3823
|
+
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
3824
|
+
}), n.languages.insertBefore("javascript", "string", {
|
|
3825
|
+
hashbang: {
|
|
3826
|
+
pattern: /^#!.*/,
|
|
3827
|
+
greedy: !0,
|
|
3828
|
+
alias: "comment"
|
|
3829
|
+
},
|
|
3830
|
+
"template-string": {
|
|
3831
|
+
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
3832
|
+
greedy: !0,
|
|
3833
|
+
inside: {
|
|
3834
|
+
"template-punctuation": {
|
|
3835
|
+
pattern: /^`|`$/,
|
|
3836
|
+
alias: "string"
|
|
3837
|
+
},
|
|
3838
|
+
interpolation: {
|
|
3839
|
+
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
3840
|
+
lookbehind: !0,
|
|
3841
|
+
inside: {
|
|
3842
|
+
"interpolation-punctuation": {
|
|
3843
|
+
pattern: /^\$\{|\}$/,
|
|
3844
|
+
alias: "punctuation"
|
|
3845
|
+
},
|
|
3846
|
+
rest: n.languages.javascript
|
|
3847
|
+
}
|
|
3848
|
+
},
|
|
3849
|
+
string: /[\s\S]+/
|
|
3850
|
+
}
|
|
3851
|
+
},
|
|
3852
|
+
"string-property": {
|
|
3853
|
+
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
3854
|
+
lookbehind: !0,
|
|
3855
|
+
greedy: !0,
|
|
3856
|
+
alias: "property"
|
|
3857
|
+
}
|
|
3858
|
+
}), n.languages.insertBefore("javascript", "operator", {
|
|
3859
|
+
"literal-property": {
|
|
3860
|
+
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
3861
|
+
lookbehind: !0,
|
|
3862
|
+
alias: "property"
|
|
3863
|
+
}
|
|
3864
|
+
}), n.languages.markup && (n.languages.markup.tag.addInlined("script", "javascript"), n.languages.markup.tag.addAttribute(
|
|
3865
|
+
/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
|
|
3866
|
+
"javascript"
|
|
3867
|
+
)), n.languages.js = n.languages.javascript, function() {
|
|
3868
|
+
if (typeof n > "u" || typeof document > "u")
|
|
3869
|
+
return;
|
|
3870
|
+
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
3871
|
+
var r = "Loading…", i = function(A, S) {
|
|
3872
|
+
return "✖ Error " + A + " while fetching file: " + S;
|
|
3873
|
+
}, a = "✖ Error: File does not exist or is empty", s = {
|
|
3874
|
+
js: "javascript",
|
|
3875
|
+
py: "python",
|
|
3876
|
+
rb: "ruby",
|
|
3877
|
+
ps1: "powershell",
|
|
3878
|
+
psm1: "powershell",
|
|
3879
|
+
sh: "bash",
|
|
3880
|
+
bat: "batch",
|
|
3881
|
+
h: "c",
|
|
3882
|
+
tex: "latex"
|
|
3883
|
+
}, o = "data-src-status", l = "loading", c = "loaded", u = "failed", f = "pre[data-src]:not([" + o + '="' + c + '"]):not([' + o + '="' + l + '"])';
|
|
3884
|
+
function g(A, S, I) {
|
|
3885
|
+
var p = new XMLHttpRequest();
|
|
3886
|
+
p.open("GET", A, !0), p.onreadystatechange = function() {
|
|
3887
|
+
p.readyState == 4 && (p.status < 400 && p.responseText ? S(p.responseText) : p.status >= 400 ? I(i(p.status, p.statusText)) : I(a));
|
|
3888
|
+
}, p.send(null);
|
|
3889
|
+
}
|
|
3890
|
+
function y(A) {
|
|
3891
|
+
var S = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(A || "");
|
|
3892
|
+
if (S) {
|
|
3893
|
+
var I = Number(S[1]), p = S[2], h = S[3];
|
|
3894
|
+
return p ? h ? [I, Number(h)] : [I, void 0] : [I, I];
|
|
3895
|
+
}
|
|
3896
|
+
}
|
|
3897
|
+
n.hooks.add("before-highlightall", function(A) {
|
|
3898
|
+
A.selector += ", " + f;
|
|
3899
|
+
}), n.hooks.add("before-sanity-check", function(A) {
|
|
3900
|
+
var S = (
|
|
3901
|
+
/** @type {HTMLPreElement} */
|
|
3902
|
+
A.element
|
|
3903
|
+
);
|
|
3904
|
+
if (S.matches(f)) {
|
|
3905
|
+
A.code = "", S.setAttribute(o, l);
|
|
3906
|
+
var I = S.appendChild(document.createElement("CODE"));
|
|
3907
|
+
I.textContent = r;
|
|
3908
|
+
var p = S.getAttribute("data-src"), h = A.language;
|
|
3909
|
+
if (h === "none") {
|
|
3910
|
+
var d = (/\.(\w+)$/.exec(p) || [, "none"])[1];
|
|
3911
|
+
h = s[d] || d;
|
|
3912
|
+
}
|
|
3913
|
+
n.util.setLanguage(I, h), n.util.setLanguage(S, h);
|
|
3914
|
+
var k = n.plugins.autoloader;
|
|
3915
|
+
k && k.loadLanguages(h), g(
|
|
3916
|
+
p,
|
|
3917
|
+
function(m) {
|
|
3918
|
+
S.setAttribute(o, c);
|
|
3919
|
+
var v = y(S.getAttribute("data-range"));
|
|
3920
|
+
if (v) {
|
|
3921
|
+
var E = m.split(/\r\n?|\n/g), w = v[0], _ = v[1] == null ? E.length : v[1];
|
|
3922
|
+
w < 0 && (w += E.length), w = Math.max(0, Math.min(w - 1, E.length)), _ < 0 && (_ += E.length), _ = Math.max(0, Math.min(_, E.length)), m = E.slice(w, _).join(`
|
|
3923
|
+
`), S.hasAttribute("data-start") || S.setAttribute("data-start", String(w + 1));
|
|
3924
|
+
}
|
|
3925
|
+
I.textContent = m, n.highlightElement(I);
|
|
3926
|
+
},
|
|
3927
|
+
function(m) {
|
|
3928
|
+
S.setAttribute(o, u), I.textContent = m;
|
|
3929
|
+
}
|
|
3930
|
+
);
|
|
3931
|
+
}
|
|
3932
|
+
}), n.plugins.fileHighlight = {
|
|
3933
|
+
/**
|
|
3934
|
+
* Executes the File Highlight plugin for all matching `pre` elements under the given container.
|
|
3935
|
+
*
|
|
3936
|
+
* Note: Elements which are already loaded or currently loading will not be touched by this method.
|
|
3937
|
+
*
|
|
3938
|
+
* @param {ParentNode} [container=document]
|
|
3939
|
+
*/
|
|
3940
|
+
highlight: function(S) {
|
|
3941
|
+
for (var I = (S || document).querySelectorAll(f), p = 0, h; h = I[p++]; )
|
|
3942
|
+
n.highlightElement(h);
|
|
3943
|
+
}
|
|
3944
|
+
};
|
|
3945
|
+
var x = !1;
|
|
3946
|
+
n.fileHighlight = function() {
|
|
3947
|
+
x || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), x = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
3948
|
+
};
|
|
3949
|
+
}();
|
|
3950
|
+
}(Je)), Je.exports;
|
|
3951
|
+
}
|
|
3952
|
+
var et = La();
|
|
3953
|
+
const pt = "mermaid", Pa = "cx-frontmatter", Oa = /^---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/;
|
|
3954
|
+
function za(e) {
|
|
3955
|
+
const t = Oa.exec(e);
|
|
3956
|
+
if (!t)
|
|
3957
|
+
return { body: e, data: {}, raw: "" };
|
|
3958
|
+
const n = t[1], r = e.slice(t[0].length);
|
|
3959
|
+
try {
|
|
3960
|
+
const i = Gi(n);
|
|
3961
|
+
if (i && typeof i == "object" && !Array.isArray(i))
|
|
3962
|
+
return { body: r, data: i, raw: n };
|
|
3963
|
+
} catch {
|
|
3964
|
+
}
|
|
3965
|
+
return { body: r, data: {}, raw: n };
|
|
3966
|
+
}
|
|
3967
|
+
function Ma(e, t) {
|
|
3968
|
+
return `<details class="${Pa}"><summary>${ht(t)}</summary><pre>${ht(e)}</pre></details>`;
|
|
3969
|
+
}
|
|
3970
|
+
function ht(e) {
|
|
3971
|
+
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
3972
|
+
}
|
|
3973
|
+
const Ba = {
|
|
3974
|
+
code({ escaped: e, lang: t, text: n }) {
|
|
3975
|
+
const r = (t || "").match(/\S*/)?.[0]?.toLowerCase(), i = e ? n : ht(n);
|
|
3976
|
+
if (r === pt)
|
|
3977
|
+
return `<pre class="${pt}">${i}</pre>`;
|
|
3978
|
+
const a = ["ts", "typescript", "js", "javascript"].includes(
|
|
3979
|
+
r ?? ""
|
|
3980
|
+
) ? "javascript" : r;
|
|
3981
|
+
if (!a || !et.languages[a])
|
|
3982
|
+
return `<pre class="language-"><code>${i}</code></pre>`;
|
|
3983
|
+
const s = et.highlight(n, et.languages[a], a);
|
|
3984
|
+
return `<pre class="language-${a}"><code>${s}</code></pre>`;
|
|
3985
|
+
}
|
|
3986
|
+
};
|
|
3987
|
+
function In() {
|
|
3988
|
+
const e = new Fn();
|
|
3989
|
+
return e.use({ renderer: Ba }), e;
|
|
3990
|
+
}
|
|
3991
|
+
const Da = dt`:host{line-height:1.6;display:block}:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{margin:var(--cx-spacing-x-large) 0 var(--cx-spacing-medium);font-weight:var(--cx-font-weight-semibold);line-height:1.3;display:block}:host p,:host ul,:host ol,:host blockquote,:host pre{display:block}:host :first-child{margin-top:0}:host h1{padding-bottom:var(--cx-spacing-x-small);border-bottom:1px solid var(--cx-color-neutral-300);font-size:var(--cx-font-size-2x-large)}:host h2{padding-bottom:var(--cx-spacing-x-small);border-bottom:1px solid var(--cx-color-neutral-300);font-size:var(--cx-font-size-x-large)}:host h3{font-size:var(--cx-font-size-large)}:host h4{font-size:var(--cx-font-size-medium-large)}:host h5{font-size:var(--cx-font-size-medium)}:host h6{color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-medium)}:host p{margin:0 0 var(--cx-spacing-medium)}:host ul,:host ol{margin:0 0 var(--cx-spacing-medium);padding-left:var(--cx-spacing-2x-large)}:host li+li{margin-top:var(--cx-spacing-2x-small)}:host li>ul,:host li>ol{margin-top:var(--cx-spacing-2x-small);margin-bottom:0}:host li>input[type=checkbox]{margin-right:var(--cx-spacing-2x-small)}:host blockquote{margin:0 0 var(--cx-spacing-medium);padding:var(--cx-spacing-small) var(--cx-spacing-medium);border-left:4px solid var(--cx-color-neutral-300);background:var(--cx-color-neutral-100);color:var(--cx-color-neutral-700)}:host blockquote blockquote{margin-top:var(--cx-spacing-small);background:0 0}:host blockquote>:last-child{margin-bottom:0}:host a{color:var(--cx-color-primary-600);text-decoration:none}:host a:hover{text-decoration:underline}:host hr{height:0;margin:var(--cx-spacing-x-large) 0;border:0;border-top:1px solid var(--cx-color-neutral-300)}:host img{max-width:100%;height:auto}:host :not(pre)>code:not([class*=language-]){border-radius:var(--cx-border-radius-small);background:var(--cx-color-neutral-100);font-family:var(--cx-font-mono);padding:.15em .35em;font-size:.9em}:host table{margin:0 0 var(--cx-spacing-medium);border-collapse:collapse;width:auto;max-width:100%}:host th,:host td{padding:var(--cx-spacing-x-small) var(--cx-spacing-medium);border-bottom:1px solid var(--cx-color-neutral-200)}:host th:not([align]),:host td:not([align]),:host th[align=left],:host td[align=left]{text-align:left}:host th[align=center],:host td[align=center]{text-align:center}:host th[align=right],:host td[align=right]{text-align:right}:host th{border-bottom:2px solid var(--cx-color-neutral-300);font-weight:var(--cx-font-weight-semibold);white-space:nowrap}:host tbody tr:last-child td{border-bottom:0}:host kbd{border:1px solid var(--cx-color-neutral-300);border-radius:var(--cx-border-radius-small);background:var(--cx-color-neutral-100);font-family:var(--cx-font-mono);padding:.1em .4em;font-size:.85em}`, qa = dt`:host code[class*=language-],:host pre[class*=language-]{color:#000;text-shadow:0 1px #fff;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;tab-size:4;hyphens:none;background:0 0;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;line-height:1.5}:host code[class*=language-] ::-moz-selection,:host code[class*=language-]::-moz-selection,:host pre[class*=language-] ::-moz-selection,:host pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}:host code[class*=language-] ::selection,:host code[class*=language-]::selection,:host pre[class*=language-] ::selection,:host pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{:host code[class*=language-],:host pre[class*=language-]{text-shadow:none}}:host pre[class*=language-]{margin:.5em 0;padding:1em;overflow:auto}:host :not(pre)>code[class*=language-],:host pre[class*=language-]{background:#f5f2f0}:host :not(pre)>code[class*=language-]{white-space:normal;border-radius:.3em;padding:.1em}:host .token.cdata,:host .token.comment,:host .token.doctype,:host .token.prolog{color:#708090}:host .token.punctuation{color:#999}:host .token.namespace{opacity:.7}:host .token.boolean,:host .token.constant,:host .token.deleted,:host .token.number,:host .token.property,:host .token.symbol,:host .token.tag{color:#905}:host .token.attr-name,:host .token.builtin,:host .token.char,:host .token.inserted,:host .token.selector,:host .token.string{color:#690}:host .language-css .token.string,:host .style .token.string,:host .token.entity,:host .token.operator,:host .token.url{color:#9a6e3a;background:#ffffff80}:host .token.atrule,:host .token.attr-value,:host .token.keyword{color:#07a}:host .token.class-name,:host .token.function{color:#dd4a68}:host .token.important,:host .token.regex,:host .token.variable{color:#e90}:host .token.bold,:host .token.important{font-weight:700}:host .token.italic{font-style:italic}:host .token.entity{cursor:help}:host details.cx-frontmatter{margin:var(--cx-spacing-medium) 0;color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-small)}:host details.cx-frontmatter summary{cursor:pointer}:host details.cx-frontmatter pre{margin:var(--cx-spacing-2x-small) 0 0;padding:var(--cx-spacing-small);border-radius:var(--cx-border-radius-medium);background:var(--cx-color-neutral-100);overflow-x:auto}:host pre.mermaid{margin:var(--cx-spacing-medium) 0;text-align:center;background:0 0;overflow-x:auto}:host pre.mermaid svg{max-width:100%;height:auto}:host .cx-code-block{position:relative}:host .cx-code-block>cx-icon-button{opacity:0;transition:opacity var(--cx-transition-fast) ease;position:absolute;inset-block-start:var(--cx-spacing-2x-small);inset-inline-end:var(--cx-spacing-2x-small)}:host .cx-code-block:hover>cx-icon-button,:host .cx-code-block:focus-within>cx-icon-button{opacity:1}`, Ya = dt`
|
|
3992
|
+
${Da}
|
|
3993
|
+
${qa}
|
|
3994
|
+
`;
|
|
3995
|
+
var ja = Object.defineProperty, Ua = Object.getOwnPropertyDescriptor, _n = (e) => {
|
|
3996
|
+
throw TypeError(e);
|
|
3997
|
+
}, K = (e, t, n, r) => {
|
|
3998
|
+
for (var i = r > 1 ? void 0 : r ? Ua(t, n) : t, a = e.length - 1, s; a >= 0; a--)
|
|
3999
|
+
(s = e[a]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
4000
|
+
return r && i && ja(t, n, i), i;
|
|
4001
|
+
}, _t = (e, t, n) => t.has(e) || _n("Cannot " + n), re = (e, t, n) => (_t(e, t, "read from private field"), n ? n.call(e) : t.get(e)), tt = (e, t, n) => t.has(e) ? _n("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Ga = (e, t, n, r) => (_t(e, t, "write to private field"), t.set(e, n), n), Z = (e, t, n) => (_t(e, t, "access private method"), n), Ae, ie, Y, ft, Rn, Nn, Ln, Pn, gt, On;
|
|
4002
|
+
const Ha = `pre.${pt}:not([data-processed])`;
|
|
4003
|
+
let nn = 0;
|
|
4004
|
+
const Wa = 'a[href], details, summary, button, cx-icon-button, input, label, [role="button"], .clickable', Ka = "pre > code", rn = "cx-code-block", Za = 1500;
|
|
4005
|
+
let D = class extends Vn {
|
|
4006
|
+
constructor() {
|
|
4007
|
+
super(...arguments), tt(this, Y), this.localize = new Gn(this), tt(this, Ae, In()), tt(this, ie, /* @__PURE__ */ new Map()), this.frontmatter = {}, this.classname = "", this.liveScript = !1, this.linkTarget = "", this.renderer = {}, this.extensions = [];
|
|
4008
|
+
}
|
|
4009
|
+
connectedCallback() {
|
|
4010
|
+
super.connectedCallback(), Z(this, Y, gt).call(this);
|
|
4011
|
+
}
|
|
4012
|
+
disconnectedCallback() {
|
|
4013
|
+
super.disconnectedCallback(), re(this, ie).forEach(clearTimeout), re(this, ie).clear();
|
|
4014
|
+
}
|
|
4015
|
+
updateRendered() {
|
|
4016
|
+
this.rendered = Z(this, Y, ft).call(this);
|
|
4017
|
+
}
|
|
4018
|
+
/**
|
|
4019
|
+
* Light DOM means every click reaches ancestors, which commonly treat one as "start editing".
|
|
4020
|
+
* Clicks the rendered markdown acts on itself stop here; inert content still bubbles. The
|
|
4021
|
+
* containment check keeps an ancestor `<a>` or `<label>` around the component from matching.
|
|
4022
|
+
*/
|
|
4023
|
+
handleClick(e) {
|
|
4024
|
+
const t = e.target?.closest(
|
|
4025
|
+
Wa
|
|
4026
|
+
);
|
|
4027
|
+
t && this.contains(t) && e.stopPropagation();
|
|
4028
|
+
}
|
|
4029
|
+
handleRenderedWithNewMarkdown() {
|
|
4030
|
+
Z(this, Y, gt).call(this), this.markdown && (this.rendered = Z(this, Y, ft).call(this));
|
|
4031
|
+
}
|
|
4032
|
+
render() {
|
|
4033
|
+
return Wn`<div class=${this.classname} @click=${this.handleClick}>${Zn(
|
|
4034
|
+
this.rendered
|
|
4035
|
+
)}</div>`;
|
|
4036
|
+
}
|
|
4037
|
+
updated() {
|
|
4038
|
+
Z(this, Y, Rn).call(this), Z(this, Y, Nn).call(this), this.liveScript && Va(this);
|
|
4039
|
+
const e = this.querySelectorAll(
|
|
4040
|
+
Ha
|
|
4041
|
+
);
|
|
4042
|
+
if (e.length === 0) {
|
|
4043
|
+
this.emit("cx-ready");
|
|
4044
|
+
return;
|
|
4045
|
+
}
|
|
4046
|
+
Z(this, Y, On).call(this, e);
|
|
4047
|
+
}
|
|
4048
|
+
};
|
|
4049
|
+
Ae = /* @__PURE__ */ new WeakMap();
|
|
4050
|
+
ie = /* @__PURE__ */ new WeakMap();
|
|
4051
|
+
Y = /* @__PURE__ */ new WeakSet();
|
|
4052
|
+
ft = function() {
|
|
4053
|
+
if (!this.markdown)
|
|
4054
|
+
return this.frontmatter = {}, "";
|
|
4055
|
+
const { body: e, data: t, raw: n } = za(this.markdown);
|
|
4056
|
+
this.frontmatter = t;
|
|
4057
|
+
const r = re(this, Ae).parse(e), i = n ? Ma(n, this.localize.term("metadata")) + r : r;
|
|
4058
|
+
return this.liveScript ? i : Hn(i);
|
|
4059
|
+
};
|
|
4060
|
+
Rn = function() {
|
|
4061
|
+
if (this.linkTarget)
|
|
4062
|
+
for (const e of this.querySelectorAll("a[href]"))
|
|
4063
|
+
e.setAttribute("target", this.linkTarget), this.linkTarget === "_blank" && e.setAttribute("rel", "noopener noreferrer");
|
|
4064
|
+
};
|
|
4065
|
+
Nn = function() {
|
|
4066
|
+
for (const e of this.querySelectorAll(Ka)) {
|
|
4067
|
+
const t = e.parentElement;
|
|
4068
|
+
if (!t || t.parentElement?.classList.contains(rn))
|
|
4069
|
+
continue;
|
|
4070
|
+
const n = document.createElement("div");
|
|
4071
|
+
n.className = rn, t.replaceWith(n), n.append(t, Z(this, Y, Ln).call(this, e));
|
|
4072
|
+
}
|
|
4073
|
+
};
|
|
4074
|
+
Ln = function(e) {
|
|
4075
|
+
const t = document.createElement("cx-icon-button");
|
|
4076
|
+
return t.name = "content_copy", t.label = this.localize.term("copy"), t.size = Yn.Small, t.addEventListener("click", () => {
|
|
4077
|
+
Z(this, Y, Pn).call(this, e.textContent ?? "", t);
|
|
4078
|
+
}), t;
|
|
4079
|
+
};
|
|
4080
|
+
Pn = async function(e, t) {
|
|
4081
|
+
try {
|
|
4082
|
+
await navigator.clipboard.writeText(e);
|
|
4083
|
+
} catch {
|
|
4084
|
+
return;
|
|
4085
|
+
}
|
|
4086
|
+
t.name = "check", t.label = this.localize.term("copied"), clearTimeout(re(this, ie).get(t)), re(this, ie).set(
|
|
4087
|
+
t,
|
|
4088
|
+
window.setTimeout(() => {
|
|
4089
|
+
t.name = "content_copy", t.label = this.localize.term("copy"), re(this, ie).delete(t);
|
|
4090
|
+
}, Za)
|
|
4091
|
+
);
|
|
4092
|
+
};
|
|
4093
|
+
gt = function() {
|
|
4094
|
+
Ga(this, Ae, In()), re(this, Ae).use({
|
|
4095
|
+
extensions: this.extensions,
|
|
4096
|
+
renderer: this.renderer
|
|
4097
|
+
});
|
|
4098
|
+
};
|
|
4099
|
+
On = async function(e) {
|
|
4100
|
+
try {
|
|
4101
|
+
const { default: t } = await import("./mermaid.core.Dspbw7Ig.js").then((n) => n.aW);
|
|
4102
|
+
t.initialize({
|
|
4103
|
+
securityLevel: "strict",
|
|
4104
|
+
startOnLoad: !1,
|
|
4105
|
+
// ponytail: read once per batch, so already-drawn diagrams keep their theme across a
|
|
4106
|
+
// light/dark toggle. Re-theming means clearing data-processed and re-running.
|
|
4107
|
+
theme: this.getTheme() === "dark" ? "dark" : "default"
|
|
4108
|
+
});
|
|
4109
|
+
for (const n of e) {
|
|
4110
|
+
const r = n.textContent ?? "";
|
|
4111
|
+
n.setAttribute("data-processed", "true");
|
|
4112
|
+
try {
|
|
4113
|
+
nn += 1;
|
|
4114
|
+
const { bindFunctions: i, svg: a } = await t.render(
|
|
4115
|
+
`cx-mermaid-${nn}`,
|
|
4116
|
+
r
|
|
4117
|
+
);
|
|
4118
|
+
n.innerHTML = a, i?.(n);
|
|
4119
|
+
} catch {
|
|
4120
|
+
n.textContent = r;
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4123
|
+
} catch {
|
|
4124
|
+
} finally {
|
|
4125
|
+
this.emit("cx-ready");
|
|
4126
|
+
}
|
|
4127
|
+
};
|
|
4128
|
+
D.styles = Ya;
|
|
4129
|
+
D.dependencies = {
|
|
4130
|
+
"cx-icon-button": qn
|
|
4131
|
+
};
|
|
4132
|
+
K([
|
|
4133
|
+
de({ type: String })
|
|
4134
|
+
], D.prototype, "classname", 2);
|
|
4135
|
+
K([
|
|
4136
|
+
de({ attribute: "live-script", reflect: !0, type: Boolean })
|
|
4137
|
+
], D.prototype, "liveScript", 2);
|
|
4138
|
+
K([
|
|
4139
|
+
de({ attribute: "link-target", type: String })
|
|
4140
|
+
], D.prototype, "linkTarget", 2);
|
|
4141
|
+
K([
|
|
4142
|
+
de({ type: String })
|
|
4143
|
+
], D.prototype, "markdown", 2);
|
|
4144
|
+
K([
|
|
4145
|
+
de({ type: Object })
|
|
4146
|
+
], D.prototype, "renderer", 2);
|
|
4147
|
+
K([
|
|
4148
|
+
de({ type: Object })
|
|
4149
|
+
], D.prototype, "extensions", 2);
|
|
4150
|
+
K([
|
|
4151
|
+
Kn()
|
|
4152
|
+
], D.prototype, "rendered", 2);
|
|
4153
|
+
K([
|
|
4154
|
+
_e("liveScript"),
|
|
4155
|
+
_e("markdown")
|
|
4156
|
+
], D.prototype, "updateRendered", 1);
|
|
4157
|
+
K([
|
|
4158
|
+
_e("renderer", { waitUntilFirstUpdate: !0 }),
|
|
4159
|
+
_e("extensions", { waitUntilFirstUpdate: !0 })
|
|
4160
|
+
], D.prototype, "handleRenderedWithNewMarkdown", 1);
|
|
4161
|
+
D = K([
|
|
4162
|
+
Un("cx-markdown")
|
|
4163
|
+
], D);
|
|
4164
|
+
function Va(e) {
|
|
4165
|
+
e.querySelectorAll("script").forEach((n) => {
|
|
4166
|
+
const r = document.createElement("script");
|
|
4167
|
+
n.src ? r.src = n.src : r.text = `(function() {
|
|
4168
|
+
${n.text}
|
|
4169
|
+
})();`, Array.from(n.attributes).forEach((i) => {
|
|
4170
|
+
i.name !== "src" && r.setAttribute(i.name, i.value);
|
|
4171
|
+
}), document.body.appendChild(r);
|
|
4172
|
+
});
|
|
4173
|
+
}
|
|
4174
|
+
export {
|
|
4175
|
+
D as C,
|
|
4176
|
+
za as e,
|
|
4177
|
+
et as p,
|
|
4178
|
+
Ya as s,
|
|
4179
|
+
j as x
|
|
4180
|
+
};
|