v-code-diff 1.4.0 → 1.5.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/README.md +2 -110
- package/dist/v2/index.cjs.js +12 -12
- package/dist/v2/index.es.js +497 -425
- package/dist/v2/index.umd.js +13 -13
- package/dist/v2.7/index.cjs.js +15 -15
- package/dist/v2.7/index.es.js +703 -662
- package/dist/v2.7/index.umd.js +15 -15
- package/dist/v3/index.cjs.js +13 -13
- package/dist/v3/index.es.js +559 -512
- package/dist/v3/index.umd.js +13 -13
- package/package.json +1 -1
- package/src/CodeDiff.vue +9 -7
- package/src/split/SplitLine.vue +21 -26
- package/src/split/SplitViewer.vue +11 -2
- package/src/types.ts +17 -0
- package/src/unified/UnifiedLine.vue +7 -6
- package/src/unified/UnifiedViewer.vue +12 -3
- package/src/utils.ts +50 -10
package/dist/v2.7/index.es.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode(".code-diff-view{--color-canvas-default-transparent: rgba(255,255,255,0);--color-page-header-bg: #f6f8fa;--color-marketing-icon-primary: #218bff;--color-marketing-icon-secondary: #54aeff;--color-diff-blob-addition-num-text: #24292f;--color-diff-blob-addition-fg: #24292f;--color-diff-blob-addition-num-bg: #ccffd8;--color-diff-blob-addition-line-bg: #e6ffec;--color-diff-blob-addition-word-bg: #abf2bc;--color-diff-blob-deletion-num-text: #24292f;--color-diff-blob-deletion-fg: #24292f;--color-diff-blob-deletion-num-bg: #ffd7d5;--color-diff-blob-deletion-line-bg: #ffebe9;--color-diff-blob-deletion-word-bg: rgba(255,129,130,.4);--color-diff-blob-hunk-num-bg: rgba(84,174,255,.4);--color-diff-blob-expander-icon: #57606a;--color-diff-blob-selected-line-highlight-mix-blend-mode: multiply;--color-diffstat-deletion-border: rgba(27,31,36,.15);--color-diffstat-addition-border: rgba(27,31,36,.15);--color-diffstat-addition-bg: #2da44e;--color-search-keyword-hl: #fff8c5;--color-prettylights-syntax-comment: #6e7781;--color-prettylights-syntax-constant: #0550ae;--color-prettylights-syntax-entity: #8250df;--color-prettylights-syntax-storage-modifier-import: #24292f;--color-prettylights-syntax-entity-tag: #116329;--color-prettylights-syntax-keyword: #cf222e;--color-prettylights-syntax-string: #0a3069;--color-prettylights-syntax-variable: #953800;--color-prettylights-syntax-brackethighlighter-unmatched: #82071e;--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;--color-prettylights-syntax-invalid-illegal-bg: #82071e;--color-prettylights-syntax-carriage-return-text: #f6f8fa;--color-prettylights-syntax-carriage-return-bg: #cf222e;--color-prettylights-syntax-string-regexp: #116329;--color-prettylights-syntax-markup-list: #3b2300;--color-prettylights-syntax-markup-heading: #0550ae;--color-prettylights-syntax-markup-italic: #24292f;--color-prettylights-syntax-markup-bold: #24292f;--color-prettylights-syntax-markup-deleted-text: #82071e;--color-prettylights-syntax-markup-deleted-bg: #ffebe9;--color-prettylights-syntax-markup-inserted-text: #116329;--color-prettylights-syntax-markup-inserted-bg: #dafbe1;--color-prettylights-syntax-markup-changed-text: #953800;--color-prettylights-syntax-markup-changed-bg: #ffd8b5;--color-prettylights-syntax-markup-ignored-text: #eaeef2;--color-prettylights-syntax-markup-ignored-bg: #0550ae;--color-prettylights-syntax-meta-diff-range: #8250df;--color-prettylights-syntax-brackethighlighter-angle: #57606a;--color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;--color-prettylights-syntax-constant-other-reference-link: #0a3069;--color-codemirror-text: #24292f;--color-codemirror-bg: #ffffff;--color-codemirror-gutters-bg: #ffffff;--color-codemirror-guttermarker-text: #ffffff;--color-codemirror-guttermarker-subtle-text: #6e7781;--color-codemirror-linenumber-text: #57606a;--color-codemirror-cursor: #24292f;--color-codemirror-selection-bg: rgba(84,174,255,.4);--color-codemirror-activeline-bg: rgba(234,238,242,.5);--color-codemirror-matchingbracket-text: #24292f;--color-codemirror-lines-bg: #ffffff;--color-codemirror-syntax-comment: #24292f;--color-codemirror-syntax-constant: #0550ae;--color-codemirror-syntax-entity: #8250df;--color-codemirror-syntax-keyword: #cf222e;--color-codemirror-syntax-storage: #cf222e;--color-codemirror-syntax-string: #0a3069;--color-codemirror-syntax-support: #0550ae;--color-codemirror-syntax-variable: #953800;--color-checks-bg: #24292f;--color-checks-run-border-width: 0px;--color-checks-container-border-width: 0px;--color-checks-text-primary: #f6f8fa;--color-checks-text-secondary: #8c959f;--color-checks-text-link: #54aeff;--color-checks-btn-icon: #afb8c1;--color-checks-btn-hover-icon: #f6f8fa;--color-checks-btn-hover-bg: rgba(255,255,255,.125);--color-checks-input-text: #eaeef2;--color-checks-input-placeholder-text: #8c959f;--color-checks-input-focus-text: #8c959f;--color-checks-input-bg: #32383f;--color-checks-input-shadow: none;--color-checks-donut-error: #fa4549;--color-checks-donut-pending: #bf8700;--color-checks-donut-success: #2da44e;--color-checks-donut-neutral: #afb8c1;--color-checks-dropdown-text: #afb8c1;--color-checks-dropdown-bg: #32383f;--color-checks-dropdown-border: #424a53;--color-checks-dropdown-shadow: rgba(27,31,36,.3);--color-checks-dropdown-hover-text: #f6f8fa;--color-checks-dropdown-hover-bg: #424a53;--color-checks-dropdown-btn-hover-text: #f6f8fa;--color-checks-dropdown-btn-hover-bg: #32383f;--color-checks-scrollbar-thumb-bg: #57606a;--color-checks-header-label-text: #d0d7de;--color-checks-header-label-open-text: #f6f8fa;--color-checks-header-border: #32383f;--color-checks-header-icon: #8c959f;--color-checks-line-text: #d0d7de;--color-checks-line-num-text: rgba(140,149,159,.75);--color-checks-line-timestamp-text: #8c959f;--color-checks-line-hover-bg: #32383f;--color-checks-line-selected-bg: rgba(33,139,255,.15);--color-checks-line-selected-num-text: #54aeff;--color-checks-line-dt-fm-text: #24292f;--color-checks-line-dt-fm-bg: #9a6700;--color-checks-gate-bg: rgba(125,78,0,.15);--color-checks-gate-text: #d0d7de;--color-checks-gate-waiting-text: #d4a72c;--color-checks-step-header-open-bg: #32383f;--color-checks-step-error-text: #ff8182;--color-checks-step-warning-text: #d4a72c;--color-checks-logline-text: #8c959f;--color-checks-logline-num-text: rgba(140,149,159,.75);--color-checks-logline-debug-text: #c297ff;--color-checks-logline-error-text: #d0d7de;--color-checks-logline-error-num-text: #ff8182;--color-checks-logline-error-bg: rgba(164,14,38,.15);--color-checks-logline-warning-text: #d0d7de;--color-checks-logline-warning-num-text: #d4a72c;--color-checks-logline-warning-bg: rgba(125,78,0,.15);--color-checks-logline-command-text: #54aeff;--color-checks-logline-section-text: #4ac26b;--color-checks-ansi-black: #24292f;--color-checks-ansi-black-bright: #32383f;--color-checks-ansi-white: #d0d7de;--color-checks-ansi-white-bright: #d0d7de;--color-checks-ansi-gray: #8c959f;--color-checks-ansi-red: #ff8182;--color-checks-ansi-red-bright: #ffaba8;--color-checks-ansi-green: #4ac26b;--color-checks-ansi-green-bright: #6fdd8b;--color-checks-ansi-yellow: #d4a72c;--color-checks-ansi-yellow-bright: #eac54f;--color-checks-ansi-blue: #54aeff;--color-checks-ansi-blue-bright: #80ccff;--color-checks-ansi-magenta: #c297ff;--color-checks-ansi-magenta-bright: #d8b9ff;--color-checks-ansi-cyan: #76e3ea;--color-checks-ansi-cyan-bright: #b3f0ff;--color-project-header-bg: #24292f;--color-project-sidebar-bg: #ffffff;--color-project-gradient-in: #ffffff;--color-project-gradient-out: rgba(255,255,255,0);--color-mktg-btn-bg: #1b1f23;--color-mktg-btn-shadow-outline: rgb(0 0 0 / 15%) 0 0 0 1px inset;--color-mktg-btn-shadow-focus: rgb(0 0 0 / 15%) 0 0 0 4px;--color-mktg-btn-shadow-hover: 0 3px 2px rgba(0, 0, 0, .07), 0 7px 5px rgba(0, 0, 0, .04), 0 12px 10px rgba(0, 0, 0, .03), 0 22px 18px rgba(0, 0, 0, .03), 0 42px 33px rgba(0, 0, 0, .02), 0 100px 80px rgba(0, 0, 0, .02);--color-mktg-btn-shadow-hover-muted: rgb(0 0 0 / 70%) 0 0 0 2px inset;--color-avatar-bg: #ffffff;--color-avatar-border: rgba(27,31,36,.15);--color-avatar-stack-fade: #afb8c1;--color-avatar-stack-fade-more: #d0d7de;--color-avatar-child-shadow: -2px -2px 0 rgba(255,255,255,.8);--color-topic-tag-border: rgba(0,0,0,0);--color-counter-border: rgba(0,0,0,0);--color-select-menu-backdrop-border: rgba(0,0,0,0);--color-select-menu-tap-highlight: rgba(175,184,193,.5);--color-select-menu-tap-focus-bg: #b6e3ff;--color-overlay-shadow: 0 1px 3px rgba(27,31,36,.12), 0 8px 24px rgba(66,74,83,.12);--color-header-text: rgba(255,255,255,.7);--color-header-bg: #24292f;--color-header-divider: #57606a;--color-header-logo: #ffffff;--color-header-search-bg: #24292f;--color-header-search-border: #57606a;--color-sidenav-selected-bg: #ffffff;--color-menu-bg-active: rgba(0,0,0,0);--color-input-disabled-bg: rgba(175,184,193,.2);--color-timeline-badge-bg: #eaeef2;--color-ansi-black: #24292f;--color-ansi-black-bright: #57606a;--color-ansi-white: #6e7781;--color-ansi-white-bright: #8c959f;--color-ansi-gray: #6e7781;--color-ansi-red: #cf222e;--color-ansi-red-bright: #a40e26;--color-ansi-green: #116329;--color-ansi-green-bright: #1a7f37;--color-ansi-yellow: #4d2d00;--color-ansi-yellow-bright: #633c01;--color-ansi-blue: #0969da;--color-ansi-blue-bright: #218bff;--color-ansi-magenta: #8250df;--color-ansi-magenta-bright: #a475f9;--color-ansi-cyan: #1b7c83;--color-ansi-cyan-bright: #3192aa;--color-btn-text: #24292f;--color-btn-bg: #f6f8fa;--color-btn-border: rgba(27,31,36,.15);--color-btn-shadow: 0 1px 0 rgba(27,31,36,.04);--color-btn-inset-shadow: inset 0 1px 0 rgba(255,255,255,.25);--color-btn-hover-bg: #f3f4f6;--color-btn-hover-border: rgba(27,31,36,.15);--color-btn-active-bg: hsla(220,14%,93%,1);--color-btn-active-border: rgba(27,31,36,.15);--color-btn-selected-bg: hsla(220,14%,94%,1);--color-btn-focus-bg: #f6f8fa;--color-btn-focus-border: rgba(27,31,36,.15);--color-btn-focus-shadow: 0 0 0 3px rgba(9,105,218,.3);--color-btn-shadow-active: inset 0 .15em .3em rgba(27,31,36,.15);--color-btn-shadow-input-focus: 0 0 0 .2em rgba(9,105,218,.3);--color-btn-counter-bg: rgba(27,31,36,.08);--color-btn-primary-text: #ffffff;--color-btn-primary-bg: #2da44e;--color-btn-primary-border: rgba(27,31,36,.15);--color-btn-primary-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-primary-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-primary-hover-bg: #2c974b;--color-btn-primary-hover-border: rgba(27,31,36,.15);--color-btn-primary-selected-bg: hsla(137,55%,36%,1);--color-btn-primary-selected-shadow: inset 0 1px 0 rgba(0,45,17,.2);--color-btn-primary-disabled-text: rgba(255,255,255,.8);--color-btn-primary-disabled-bg: #94d3a2;--color-btn-primary-disabled-border: rgba(27,31,36,.15);--color-btn-primary-focus-bg: #2da44e;--color-btn-primary-focus-border: rgba(27,31,36,.15);--color-btn-primary-focus-shadow: 0 0 0 3px rgba(45,164,78,.4);--color-btn-primary-icon: rgba(255,255,255,.8);--color-btn-primary-counter-bg: rgba(255,255,255,.2);--color-btn-outline-text: #0969da;--color-btn-outline-hover-text: #ffffff;--color-btn-outline-hover-bg: #0969da;--color-btn-outline-hover-border: rgba(27,31,36,.15);--color-btn-outline-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-outline-hover-counter-bg: rgba(255,255,255,.2);--color-btn-outline-selected-text: #ffffff;--color-btn-outline-selected-bg: hsla(212,92%,42%,1);--color-btn-outline-selected-border: rgba(27,31,36,.15);--color-btn-outline-selected-shadow: inset 0 1px 0 rgba(0,33,85,.2);--color-btn-outline-disabled-text: rgba(9,105,218,.5);--color-btn-outline-disabled-bg: #f6f8fa;--color-btn-outline-disabled-counter-bg: rgba(9,105,218,.05);--color-btn-outline-focus-border: rgba(27,31,36,.15);--color-btn-outline-focus-shadow: 0 0 0 3px rgba(5,80,174,.4);--color-btn-outline-counter-bg: rgba(9,105,218,.1);--color-btn-danger-text: #cf222e;--color-btn-danger-hover-text: #ffffff;--color-btn-danger-hover-bg: #a40e26;--color-btn-danger-hover-border: rgba(27,31,36,.15);--color-btn-danger-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-danger-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-danger-hover-counter-bg: rgba(255,255,255,.2);--color-btn-danger-selected-text: #ffffff;--color-btn-danger-selected-bg: hsla(356,72%,44%,1);--color-btn-danger-selected-border: rgba(27,31,36,.15);--color-btn-danger-selected-shadow: inset 0 1px 0 rgba(76,0,20,.2);--color-btn-danger-disabled-text: rgba(207,34,46,.5);--color-btn-danger-disabled-bg: #f6f8fa;--color-btn-danger-disabled-counter-bg: rgba(207,34,46,.05);--color-btn-danger-focus-border: rgba(27,31,36,.15);--color-btn-danger-focus-shadow: 0 0 0 3px rgba(164,14,38,.4);--color-btn-danger-counter-bg: rgba(207,34,46,.1);--color-btn-danger-icon: #cf222e;--color-btn-danger-hover-icon: #ffffff;--color-underlinenav-icon: #6e7781;--color-underlinenav-border-hover: rgba(175,184,193,.2);--color-action-list-item-inline-divider: rgba(208,215,222,.48);--color-action-list-item-default-hover-bg: rgba(208,215,222,.32);--color-action-list-item-default-hover-border: rgba(0,0,0,0);--color-action-list-item-default-active-bg: rgba(208,215,222,.48);--color-action-list-item-default-active-border: rgba(0,0,0,0);--color-action-list-item-default-selected-bg: rgba(208,215,222,.24);--color-action-list-item-danger-hover-bg: rgba(255,235,233,.64);--color-action-list-item-danger-active-bg: #ffebe9;--color-action-list-item-danger-hover-text: #cf222e;--color-switch-track-bg: #eaeef2;--color-switch-track-border: #afb8c1;--color-switch-track-checked-bg: #ddf4ff;--color-switch-track-checked-hover-bg: #b6e3ff;--color-switch-track-checked-active-bg: #80ccff;--color-switch-track-checked-border: #54aeff;--color-switch-knob-checked-bg: #0969da;--color-switch-knob-checked-disabled-bg: #6e7781;--color-segmented-control-bg: #eaeef2;--color-segmented-control-button-hover-bg: rgba(175,184,193,.2);--color-segmented-control-button-active-bg: rgba(175,184,193,.4);--color-segmented-control-button-selected-border: #6e7781;--color-fg-default: #24292f;--color-fg-muted: #57606a;--color-fg-subtle: #6e7781;--color-fg-on-emphasis: #ffffff;--color-canvas-default: #ffffff;--color-canvas-overlay: #ffffff;--color-canvas-inset: #f6f8fa;--color-canvas-subtle: #f6f8fa;--color-border-default: #d0d7de;--color-border-muted: hsla(210,18%,87%,1);--color-border-subtle: rgba(27,31,36,.15);--color-shadow-small: 0 1px 0 rgba(27,31,36,.04);--color-shadow-medium: 0 3px 6px rgba(140,149,159,.15);--color-shadow-large: 0 8px 24px rgba(140,149,159,.2);--color-shadow-extra-large: 0 12px 28px rgba(140,149,159,.3);--color-neutral-emphasis-plus: #24292f;--color-neutral-emphasis: #6e7781;--color-neutral-muted: rgba(175,184,193,.2);--color-neutral-subtle: rgba(234,238,242,.5);--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-accent-muted: rgba(84,174,255,.4);--color-accent-subtle: #ddf4ff;--color-success-fg: #1a7f37;--color-success-emphasis: #2da44e;--color-success-muted: rgba(74,194,107,.4);--color-success-subtle: #dafbe1;--color-attention-fg: #9a6700;--color-attention-emphasis: #bf8700;--color-attention-muted: rgba(212,167,44,.4);--color-attention-subtle: #fff8c5;--color-severe-fg: #bc4c00;--color-severe-emphasis: #bc4c00;--color-severe-muted: rgba(251,143,68,.4);--color-severe-subtle: #fff1e5;--color-danger-fg: #cf222e;--color-danger-emphasis: #cf222e;--color-danger-muted: rgba(255,129,130,.4);--color-danger-subtle: #ffebe9;--color-open-fg: #1a7f37;--color-open-emphasis: #2da44e;--color-open-muted: rgba(74,194,107,.4);--color-open-subtle: #dafbe1;--color-closed-fg: #cf222e;--color-closed-emphasis: #cf222e;--color-closed-muted: rgba(255,129,130,.4);--color-closed-subtle: #ffebe9;--color-done-fg: #8250df;--color-done-emphasis: #8250df;--color-done-muted: rgba(194,151,255,.4);--color-done-subtle: #fbefff;--color-sponsors-fg: #bf3989;--color-sponsors-emphasis: #bf3989;--color-sponsors-muted: rgba(255,128,200,.4);--color-sponsors-subtle: #ffeff7;--color-primer-fg-disabled: #8c959f;--color-primer-canvas-backdrop: rgba(27,31,36,.5);--color-primer-canvas-sticky: rgba(255,255,255,.95);--color-primer-border-active: #fd8c73;--color-primer-border-contrast: rgba(27,31,36,.1);--color-primer-shadow-highlight: inset 0 1px 0 rgba(255,255,255,.25);--color-primer-shadow-inset: inset 0 1px 0 rgba(208,215,222,.2);--color-primer-shadow-focus: 0 0 0 3px rgba(9,105,218,.3);--color-scale-black: #1b1f24;--color-scale-white: #ffffff;--color-scale-gray-0: #f6f8fa;--color-scale-gray-1: #eaeef2;--color-scale-gray-2: #d0d7de;--color-scale-gray-3: #afb8c1;--color-scale-gray-4: #8c959f;--color-scale-gray-5: #6e7781;--color-scale-gray-6: #57606a;--color-scale-gray-7: #424a53;--color-scale-gray-8: #32383f;--color-scale-gray-9: #24292f;--color-scale-blue-0: #ddf4ff;--color-scale-blue-1: #b6e3ff;--color-scale-blue-2: #80ccff;--color-scale-blue-3: #54aeff;--color-scale-blue-4: #218bff;--color-scale-blue-5: #0969da;--color-scale-blue-6: #0550ae;--color-scale-blue-7: #033d8b;--color-scale-blue-8: #0a3069;--color-scale-blue-9: #002155;--color-scale-green-0: #dafbe1;--color-scale-green-1: #aceebb;--color-scale-green-2: #6fdd8b;--color-scale-green-3: #4ac26b;--color-scale-green-4: #2da44e;--color-scale-green-5: #1a7f37;--color-scale-green-6: #116329;--color-scale-green-7: #044f1e;--color-scale-green-8: #003d16;--color-scale-green-9: #002d11;--color-scale-yellow-0: #fff8c5;--color-scale-yellow-1: #fae17d;--color-scale-yellow-2: #eac54f;--color-scale-yellow-3: #d4a72c;--color-scale-yellow-4: #bf8700;--color-scale-yellow-5: #9a6700;--color-scale-yellow-6: #7d4e00;--color-scale-yellow-7: #633c01;--color-scale-yellow-8: #4d2d00;--color-scale-yellow-9: #3b2300;--color-scale-orange-0: #fff1e5;--color-scale-orange-1: #ffd8b5;--color-scale-orange-2: #ffb77c;--color-scale-orange-3: #fb8f44;--color-scale-orange-4: #e16f24;--color-scale-orange-5: #bc4c00;--color-scale-orange-6: #953800;--color-scale-orange-7: #762c00;--color-scale-orange-8: #5c2200;--color-scale-orange-9: #471700;--color-scale-red-0: #ffebe9;--color-scale-red-1: #ffcecb;--color-scale-red-2: #ffaba8;--color-scale-red-3: #ff8182;--color-scale-red-4: #fa4549;--color-scale-red-5: #cf222e;--color-scale-red-6: #a40e26;--color-scale-red-7: #82071e;--color-scale-red-8: #660018;--color-scale-red-9: #4c0014;--color-scale-purple-0: #fbefff;--color-scale-purple-1: #ecd8ff;--color-scale-purple-2: #d8b9ff;--color-scale-purple-3: #c297ff;--color-scale-purple-4: #a475f9;--color-scale-purple-5: #8250df;--color-scale-purple-6: #6639ba;--color-scale-purple-7: #512a97;--color-scale-purple-8: #3e1f79;--color-scale-purple-9: #2e1461;--color-scale-pink-0: #ffeff7;--color-scale-pink-1: #ffd3eb;--color-scale-pink-2: #ffadda;--color-scale-pink-3: #ff80c8;--color-scale-pink-4: #e85aad;--color-scale-pink-5: #bf3989;--color-scale-pink-6: #99286e;--color-scale-pink-7: #772057;--color-scale-pink-8: #611347;--color-scale-pink-9: #4d0336;--color-scale-coral-0: #fff0eb;--color-scale-coral-1: #ffd6cc;--color-scale-coral-2: #ffb4a1;--color-scale-coral-3: #fd8c73;--color-scale-coral-4: #ec6547;--color-scale-coral-5: #c4432b;--color-scale-coral-6: #9e2f1c;--color-scale-coral-7: #801f0f;--color-scale-coral-8: #691105;--color-scale-coral-9: #510901}.code-diff-view{position:relative;margin-top:16px;margin-bottom:16px;border:1px solid var(--color-border-default, #ddd);border-radius:6px;overflow-y:auto}.code-diff-view *{position:static;box-sizing:border-box}.code-diff-view .file-header{background-color:var(--color-canvas-subtle);border-bottom:1px solid var(--color-border-default);padding:8px 16px;font-size:12px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.code-diff-view .file-header .file-info{display:flex;justify-content:space-between;align-items:center;margin-left:8px;height:24px}.code-diff-view .file-header .file-info .filename{font-size:13px;color:var(--color-fg-default)}.code-diff-view .file-header .file-info .diff-stat .diff-stat-added{color:var(--color-diffstat-addition-bg)}.code-diff-view .file-header .file-info .diff-stat .diff-stat-deleted{color:var(--color-danger-emphasis)}.code-diff-view table{border-spacing:0}.code-diff-view .diff-table{width:100%}.code-diff-view .diff-table .blob-num{position:relative;width:1%;min-width:50px;padding-right:10px;padding-left:10px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;white-space:nowrap;vertical-align:top;cursor:pointer;-webkit-user-select:none;user-select:none}.code-diff-view .diff-table .blob-num-deletion{color:var(--color-diff-blob-deletion-num-text);background-color:var(--color-diff-blob-deletion-num-bg);border-color:var(--color-danger-emphasis)}.code-diff-view .diff-table .blob-num-addition{color:var(--color-diff-blob-addition-num-text);background-color:var(--color-diff-blob-addition-num-bg);border-color:var(--color-success-emphasis)}.code-diff-view .diff-table .blob-code{position:relative;padding-right:10px;padding-left:10px;line-height:20px;vertical-align:top}.code-diff-view .diff-table .blob-code .blob-code-inner{display:table-cell;overflow:visible;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;color:var(--color-fg-default);word-wrap:anywhere;white-space:pre-wrap}.code-diff-view .diff-table .blob-code-deletion{background-color:var(--color-diff-blob-deletion-line-bg);outline:1px dashed transparent}.code-diff-view .diff-table .blob-code-deletion .x{color:var(--color-diff-blob-deletion-fg);background-color:var(--color-diff-blob-deletion-word-bg)}.code-diff-view .diff-table .blob-code-addition{background-color:var(--color-diff-blob-addition-line-bg);outline:1px dotted transparent}.code-diff-view .diff-table .blob-code-addition .x{color:var(--color-diff-blob-addition-fg);background-color:var(--color-diff-blob-addition-word-bg)}.code-diff-view .diff-table .blob-code-context,.code-diff-view .diff-table .blob-code-addition,.code-diff-view .diff-table .blob-code-deletion{padding-left:22px!important}.code-diff-view .diff-table .blob-code-marker:before{position:absolute;top:1px;left:8px;padding-right:8px;content:attr(data-code-marker)}.code-diff-view .diff-table .blob-num-hunk{background-color:var(--color-diff-blob-hunk-num-bg)}.code-diff-view .diff-table .blob-code-hunk{background-color:var(--color-accent-subtle)}.code-diff-view .file-diff-split{table-layout:fixed}.code-diff-view .file-diff-split .blob-code+.blob-num{border-left:1px solid var(--color-border-muted)}.code-diff-view .empty-cell{cursor:default;background-color:var(--color-neutral-subtle);border-right-color:var(--color-border-muted)}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.hljs-comment,.hljs-quote,.hljs-variable{color:green}.hljs-built_in,.hljs-keyword,.hljs-name,.hljs-selector-tag,.hljs-tag{color:#00f}.hljs-addition,.hljs-attribute,.hljs-literal,.hljs-section,.hljs-string,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type{color:#a31515}.hljs-deletion,.hljs-meta,.hljs-selector-attr,.hljs-selector-pseudo{color:#2b91af}.hljs-doctag{color:gray}.hljs-attr{color:red}.hljs-bullet,.hljs-link,.hljs-symbol{color:#00b0e8}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import Dn, { defineComponent as de, computed as me } from "vue";
|
|
2
|
+
import Dn, { defineComponent as de, computed as me, ref as Sn, watch as Rn } from "vue";
|
|
3
3
|
Dn.util.warn;
|
|
4
4
|
function q() {
|
|
5
5
|
}
|
|
6
6
|
q.prototype = {
|
|
7
7
|
diff: function(e, o) {
|
|
8
|
-
var u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {},
|
|
9
|
-
typeof u == "function" && (
|
|
8
|
+
var u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, g = u.callback;
|
|
9
|
+
typeof u == "function" && (g = u, u = {}), this.options = u;
|
|
10
10
|
var t = this;
|
|
11
|
-
function r(
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
}, 0), !0) :
|
|
11
|
+
function r(p) {
|
|
12
|
+
return g ? (setTimeout(function() {
|
|
13
|
+
g(void 0, p);
|
|
14
|
+
}, 0), !0) : p;
|
|
15
15
|
}
|
|
16
16
|
e = this.castInput(e), o = this.castInput(o), e = this.removeEmpty(this.tokenize(e)), o = this.removeEmpty(this.tokenize(o));
|
|
17
17
|
var i = o.length, s = e.length, a = 1, l = i + s;
|
|
@@ -25,40 +25,40 @@ q.prototype = {
|
|
|
25
25
|
value: this.join(o),
|
|
26
26
|
count: o.length
|
|
27
27
|
}]);
|
|
28
|
-
function
|
|
29
|
-
for (var
|
|
30
|
-
var
|
|
31
|
-
v && (c[
|
|
28
|
+
function h() {
|
|
29
|
+
for (var p = -1 * a; p <= a; p += 2) {
|
|
30
|
+
var _ = void 0, v = c[p - 1], E = c[p + 1], w = (E ? E.newPos : 0) - p;
|
|
31
|
+
v && (c[p - 1] = void 0);
|
|
32
32
|
var m = v && v.newPos + 1 < i, T = E && 0 <= w && w < s;
|
|
33
33
|
if (!m && !T) {
|
|
34
|
-
c[
|
|
34
|
+
c[p] = void 0;
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
37
|
-
if (!m || T && v.newPos < E.newPos ? (
|
|
38
|
-
return r(
|
|
39
|
-
c[
|
|
37
|
+
if (!m || T && v.newPos < E.newPos ? (_ = On(E), t.pushComponent(_.components, void 0, !0)) : (_ = v, _.newPos++, t.pushComponent(_.components, !0, void 0)), w = t.extractCommon(_, o, e, p), _.newPos + 1 >= i && w + 1 >= s)
|
|
38
|
+
return r(Ln(t, _.components, o, e, t.useLongestToken));
|
|
39
|
+
c[p] = _;
|
|
40
40
|
}
|
|
41
41
|
a++;
|
|
42
42
|
}
|
|
43
|
-
if (
|
|
44
|
-
(function
|
|
43
|
+
if (g)
|
|
44
|
+
(function p() {
|
|
45
45
|
setTimeout(function() {
|
|
46
46
|
if (a > l)
|
|
47
|
-
return
|
|
48
|
-
|
|
47
|
+
return g();
|
|
48
|
+
h() || p();
|
|
49
49
|
}, 0);
|
|
50
50
|
})();
|
|
51
51
|
else
|
|
52
52
|
for (; a <= l; ) {
|
|
53
|
-
var
|
|
54
|
-
if (
|
|
55
|
-
return
|
|
53
|
+
var d = h();
|
|
54
|
+
if (d)
|
|
55
|
+
return d;
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
pushComponent: function(e, o, u) {
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
count:
|
|
59
|
+
var g = e[e.length - 1];
|
|
60
|
+
g && g.added === o && g.removed === u ? e[e.length - 1] = {
|
|
61
|
+
count: g.count + 1,
|
|
62
62
|
added: o,
|
|
63
63
|
removed: u
|
|
64
64
|
} : e.push({
|
|
@@ -67,8 +67,8 @@ q.prototype = {
|
|
|
67
67
|
removed: u
|
|
68
68
|
});
|
|
69
69
|
},
|
|
70
|
-
extractCommon: function(e, o, u,
|
|
71
|
-
for (var t = o.length, r = u.length, i = e.newPos, s = i -
|
|
70
|
+
extractCommon: function(e, o, u, g) {
|
|
71
|
+
for (var t = o.length, r = u.length, i = e.newPos, s = i - g, a = 0; i + 1 < t && s + 1 < r && this.equals(o[i + 1], u[s + 1]); )
|
|
72
72
|
i++, s++, a++;
|
|
73
73
|
return a && e.components.push({
|
|
74
74
|
count: a
|
|
@@ -92,7 +92,7 @@ q.prototype = {
|
|
|
92
92
|
return e.join("");
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
function
|
|
95
|
+
function Ln(n, e, o, u, g) {
|
|
96
96
|
for (var t = 0, r = e.length, i = 0, s = 0; t < r; t++) {
|
|
97
97
|
var a = e[t];
|
|
98
98
|
if (a.removed) {
|
|
@@ -101,11 +101,11 @@ function Sn(n, e, o, u, h) {
|
|
|
101
101
|
e[t - 1] = e[t], e[t] = c;
|
|
102
102
|
}
|
|
103
103
|
} else {
|
|
104
|
-
if (!a.added &&
|
|
104
|
+
if (!a.added && g) {
|
|
105
105
|
var l = o.slice(i, i + a.count);
|
|
106
|
-
l = l.map(function(
|
|
107
|
-
var
|
|
108
|
-
return
|
|
106
|
+
l = l.map(function(h, d) {
|
|
107
|
+
var p = u[s + d];
|
|
108
|
+
return p.length > h.length ? p : h;
|
|
109
109
|
}), a.value = n.join(l);
|
|
110
110
|
} else
|
|
111
111
|
a.value = n.join(o.slice(i, i + a.count));
|
|
@@ -115,17 +115,17 @@ function Sn(n, e, o, u, h) {
|
|
|
115
115
|
var f = e[r - 1];
|
|
116
116
|
return r > 1 && typeof f.value == "string" && (f.added || f.removed) && n.equals("", f.value) && (e[r - 2].value += f.value, e.pop()), e;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function On(n) {
|
|
119
119
|
return {
|
|
120
120
|
newPos: n.newPos,
|
|
121
121
|
components: n.components.slice(0)
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
var
|
|
125
|
-
function
|
|
126
|
-
return
|
|
124
|
+
var Cn = new q();
|
|
125
|
+
function In(n, e, o) {
|
|
126
|
+
return Cn.diff(n, e, o);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function kn(n, e) {
|
|
129
129
|
if (typeof n == "function")
|
|
130
130
|
e.callback = n;
|
|
131
131
|
else if (n)
|
|
@@ -142,8 +142,8 @@ ke.tokenize = function(n) {
|
|
|
142
142
|
!e[o + 1] && e[o + 2] && We.test(e[o]) && We.test(e[o + 2]) && (e[o] += e[o + 2], e.splice(o + 1, 2), o--);
|
|
143
143
|
return e;
|
|
144
144
|
};
|
|
145
|
-
function
|
|
146
|
-
return o =
|
|
145
|
+
function Bn(n, e, o) {
|
|
146
|
+
return o = kn(o, {
|
|
147
147
|
ignoreWhitespace: !0
|
|
148
148
|
}), ke.diff(n, e, o);
|
|
149
149
|
}
|
|
@@ -152,17 +152,17 @@ tn.tokenize = function(n) {
|
|
|
152
152
|
var e = [], o = n.split(/(\n|\r\n)/);
|
|
153
153
|
o[o.length - 1] || o.pop();
|
|
154
154
|
for (var u = 0; u < o.length; u++) {
|
|
155
|
-
var
|
|
156
|
-
u % 2 && !this.options.newlineIsToken ? e[e.length - 1] +=
|
|
155
|
+
var g = o[u];
|
|
156
|
+
u % 2 && !this.options.newlineIsToken ? e[e.length - 1] += g : (this.options.ignoreWhitespace && (g = g.trim()), e.push(g));
|
|
157
157
|
}
|
|
158
158
|
return e;
|
|
159
159
|
};
|
|
160
|
-
var
|
|
161
|
-
|
|
160
|
+
var $n = new q();
|
|
161
|
+
$n.tokenize = function(n) {
|
|
162
162
|
return n.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
163
163
|
};
|
|
164
|
-
var
|
|
165
|
-
|
|
164
|
+
var Un = new q();
|
|
165
|
+
Un.tokenize = function(n) {
|
|
166
166
|
return n.split(/([{}:;,]|\s+)/);
|
|
167
167
|
};
|
|
168
168
|
function Me(n) {
|
|
@@ -172,28 +172,28 @@ function Me(n) {
|
|
|
172
172
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
173
173
|
}, Me(n);
|
|
174
174
|
}
|
|
175
|
-
var
|
|
175
|
+
var Pn = Object.prototype.toString, ue = new q();
|
|
176
176
|
ue.useLongestToken = !0;
|
|
177
177
|
ue.tokenize = tn.tokenize;
|
|
178
178
|
ue.castInput = function(n) {
|
|
179
|
-
var e = this.options, o = e.undefinedReplacement, u = e.stringifyReplacer,
|
|
179
|
+
var e = this.options, o = e.undefinedReplacement, u = e.stringifyReplacer, g = u === void 0 ? function(t, r) {
|
|
180
180
|
return typeof r == "undefined" ? o : r;
|
|
181
181
|
} : u;
|
|
182
|
-
return typeof n == "string" ? n : JSON.stringify(
|
|
182
|
+
return typeof n == "string" ? n : JSON.stringify(Ce(n, null, null, g), g, " ");
|
|
183
183
|
};
|
|
184
184
|
ue.equals = function(n, e) {
|
|
185
185
|
return q.prototype.equals.call(ue, n.replace(/,([\r\n])/g, "$1"), e.replace(/,([\r\n])/g, "$1"));
|
|
186
186
|
};
|
|
187
|
-
function
|
|
188
|
-
e = e || [], o = o || [], u && (n = u(
|
|
187
|
+
function Ce(n, e, o, u, g) {
|
|
188
|
+
e = e || [], o = o || [], u && (n = u(g, n));
|
|
189
189
|
var t;
|
|
190
190
|
for (t = 0; t < e.length; t += 1)
|
|
191
191
|
if (e[t] === n)
|
|
192
192
|
return o[t];
|
|
193
193
|
var r;
|
|
194
|
-
if (
|
|
194
|
+
if (Pn.call(n) === "[object Array]") {
|
|
195
195
|
for (e.push(n), r = new Array(n.length), o.push(r), t = 0; t < n.length; t += 1)
|
|
196
|
-
r[t] =
|
|
196
|
+
r[t] = Ce(n[t], e, o, u, g);
|
|
197
197
|
return e.pop(), o.pop(), r;
|
|
198
198
|
}
|
|
199
199
|
if (n && n.toJSON && (n = n.toJSON()), Me(n) === "object" && n !== null) {
|
|
@@ -202,7 +202,7 @@ function Le(n, e, o, u, h) {
|
|
|
202
202
|
for (s in n)
|
|
203
203
|
n.hasOwnProperty(s) && i.push(s);
|
|
204
204
|
for (i.sort(), t = 0; t < i.length; t += 1)
|
|
205
|
-
s = i[t], r[s] =
|
|
205
|
+
s = i[t], r[s] = Ce(n[s], e, o, u, s);
|
|
206
206
|
e.pop(), o.pop();
|
|
207
207
|
} else
|
|
208
208
|
r = n;
|
|
@@ -215,7 +215,7 @@ Ie.tokenize = function(n) {
|
|
|
215
215
|
Ie.join = Ie.removeEmpty = function(n) {
|
|
216
216
|
return n;
|
|
217
217
|
};
|
|
218
|
-
var ce = {},
|
|
218
|
+
var ce = {}, xn = {
|
|
219
219
|
get exports() {
|
|
220
220
|
return ce;
|
|
221
221
|
},
|
|
@@ -226,7 +226,7 @@ var ce = {}, Un = {
|
|
|
226
226
|
(function(n) {
|
|
227
227
|
var e = function() {
|
|
228
228
|
this.Diff_Timeout = 1, this.Diff_EditCost = 4, this.Match_Threshold = 0.5, this.Match_Distance = 1e3, this.Patch_DeleteThreshold = 0.5, this.Patch_Margin = 4, this.Match_MaxBits = 32;
|
|
229
|
-
}, o = -1, u = 1,
|
|
229
|
+
}, o = -1, u = 1, g = 0;
|
|
230
230
|
e.Diff = function(t, r) {
|
|
231
231
|
return [t, r];
|
|
232
232
|
}, e.prototype.diff_main = function(t, r, i, s) {
|
|
@@ -235,14 +235,14 @@ var ce = {}, Un = {
|
|
|
235
235
|
if (t == null || r == null)
|
|
236
236
|
throw new Error("Null input. (diff_main)");
|
|
237
237
|
if (t == r)
|
|
238
|
-
return t ? [new e.Diff(
|
|
238
|
+
return t ? [new e.Diff(g, t)] : [];
|
|
239
239
|
typeof i == "undefined" && (i = !0);
|
|
240
240
|
var l = i, c = this.diff_commonPrefix(t, r), f = t.substring(0, c);
|
|
241
241
|
t = t.substring(c), r = r.substring(c), c = this.diff_commonSuffix(t, r);
|
|
242
|
-
var
|
|
242
|
+
var h = t.substring(t.length - c);
|
|
243
243
|
t = t.substring(0, t.length - c), r = r.substring(0, r.length - c);
|
|
244
|
-
var
|
|
245
|
-
return f &&
|
|
244
|
+
var d = this.diff_compute_(t, r, l, a);
|
|
245
|
+
return f && d.unshift(new e.Diff(g, f)), h && d.push(new e.Diff(g, h)), this.diff_cleanupMerge(d), d;
|
|
246
246
|
}, e.prototype.diff_compute_ = function(t, r, i, s) {
|
|
247
247
|
var a;
|
|
248
248
|
if (!t)
|
|
@@ -253,7 +253,7 @@ var ce = {}, Un = {
|
|
|
253
253
|
if (f != -1)
|
|
254
254
|
return a = [
|
|
255
255
|
new e.Diff(u, l.substring(0, f)),
|
|
256
|
-
new e.Diff(
|
|
256
|
+
new e.Diff(g, c),
|
|
257
257
|
new e.Diff(
|
|
258
258
|
u,
|
|
259
259
|
l.substring(f + c.length)
|
|
@@ -264,11 +264,11 @@ var ce = {}, Un = {
|
|
|
264
264
|
new e.Diff(o, t),
|
|
265
265
|
new e.Diff(u, r)
|
|
266
266
|
];
|
|
267
|
-
var
|
|
268
|
-
if (
|
|
269
|
-
var
|
|
267
|
+
var h = this.diff_halfMatch_(t, r);
|
|
268
|
+
if (h) {
|
|
269
|
+
var d = h[0], p = h[1], _ = h[2], v = h[3], E = h[4], w = this.diff_main(d, _, i, s), m = this.diff_main(p, v, i, s);
|
|
270
270
|
return w.concat(
|
|
271
|
-
[new e.Diff(
|
|
271
|
+
[new e.Diff(g, E)],
|
|
272
272
|
m
|
|
273
273
|
);
|
|
274
274
|
}
|
|
@@ -277,69 +277,69 @@ var ce = {}, Un = {
|
|
|
277
277
|
var s = this.diff_linesToChars_(t, r);
|
|
278
278
|
t = s.chars1, r = s.chars2;
|
|
279
279
|
var a = s.lineArray, l = this.diff_main(t, r, !1, i);
|
|
280
|
-
this.diff_charsToLines_(l, a), this.diff_cleanupSemantic(l), l.push(new e.Diff(
|
|
281
|
-
for (var c = 0, f = 0,
|
|
280
|
+
this.diff_charsToLines_(l, a), this.diff_cleanupSemantic(l), l.push(new e.Diff(g, ""));
|
|
281
|
+
for (var c = 0, f = 0, h = 0, d = "", p = ""; c < l.length; ) {
|
|
282
282
|
switch (l[c][0]) {
|
|
283
283
|
case u:
|
|
284
|
-
|
|
284
|
+
h++, p += l[c][1];
|
|
285
285
|
break;
|
|
286
286
|
case o:
|
|
287
|
-
f++,
|
|
287
|
+
f++, d += l[c][1];
|
|
288
288
|
break;
|
|
289
|
-
case
|
|
290
|
-
if (f >= 1 &&
|
|
289
|
+
case g:
|
|
290
|
+
if (f >= 1 && h >= 1) {
|
|
291
291
|
l.splice(
|
|
292
|
-
c - f -
|
|
293
|
-
f +
|
|
294
|
-
), c = c - f -
|
|
295
|
-
for (var
|
|
296
|
-
l.splice(c, 0,
|
|
297
|
-
c = c +
|
|
292
|
+
c - f - h,
|
|
293
|
+
f + h
|
|
294
|
+
), c = c - f - h;
|
|
295
|
+
for (var _ = this.diff_main(d, p, !1, i), v = _.length - 1; v >= 0; v--)
|
|
296
|
+
l.splice(c, 0, _[v]);
|
|
297
|
+
c = c + _.length;
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
h = 0, f = 0, d = "", p = "";
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
302
302
|
c++;
|
|
303
303
|
}
|
|
304
304
|
return l.pop(), l;
|
|
305
305
|
}, e.prototype.diff_bisect_ = function(t, r, i) {
|
|
306
|
-
for (var s = t.length, a = r.length, l = Math.ceil((s + a) / 2), c = l, f = 2 * l,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
for (var
|
|
306
|
+
for (var s = t.length, a = r.length, l = Math.ceil((s + a) / 2), c = l, f = 2 * l, h = new Array(f), d = new Array(f), p = 0; p < f; p++)
|
|
307
|
+
h[p] = -1, d[p] = -1;
|
|
308
|
+
h[c + 1] = 0, d[c + 1] = 0;
|
|
309
|
+
for (var _ = s - a, v = _ % 2 != 0, E = 0, w = 0, m = 0, T = 0, D = 0; D < l && !(new Date().getTime() > i); D++) {
|
|
310
310
|
for (var M = -D + E; M <= D - w; M += 2) {
|
|
311
311
|
var I = c + M, R;
|
|
312
|
-
M == -D || M != D &&
|
|
313
|
-
for (var
|
|
314
|
-
R++,
|
|
315
|
-
if (
|
|
312
|
+
M == -D || M != D && h[I - 1] < h[I + 1] ? R = h[I + 1] : R = h[I - 1] + 1;
|
|
313
|
+
for (var H = R - M; R < s && H < a && t.charAt(R) == r.charAt(H); )
|
|
314
|
+
R++, H++;
|
|
315
|
+
if (h[I] = R, R > s)
|
|
316
316
|
w += 2;
|
|
317
|
-
else if (
|
|
317
|
+
else if (H > a)
|
|
318
318
|
E += 2;
|
|
319
319
|
else if (v) {
|
|
320
|
-
var U = c +
|
|
321
|
-
if (U >= 0 && U < f &&
|
|
322
|
-
var $ = s -
|
|
320
|
+
var U = c + _ - M;
|
|
321
|
+
if (U >= 0 && U < f && d[U] != -1) {
|
|
322
|
+
var $ = s - d[U];
|
|
323
323
|
if (R >= $)
|
|
324
|
-
return this.diff_bisectSplit_(t, r, R,
|
|
324
|
+
return this.diff_bisectSplit_(t, r, R, H, i);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
for (var
|
|
329
|
-
var U = c +
|
|
330
|
-
|
|
331
|
-
for (var G = $ -
|
|
328
|
+
for (var F = -D + m; F <= D - T; F += 2) {
|
|
329
|
+
var U = c + F, $;
|
|
330
|
+
F == -D || F != D && d[U - 1] < d[U + 1] ? $ = d[U + 1] : $ = d[U - 1] + 1;
|
|
331
|
+
for (var G = $ - F; $ < s && G < a && t.charAt(s - $ - 1) == r.charAt(a - G - 1); )
|
|
332
332
|
$++, G++;
|
|
333
|
-
if (
|
|
333
|
+
if (d[U] = $, $ > s)
|
|
334
334
|
T += 2;
|
|
335
335
|
else if (G > a)
|
|
336
336
|
m += 2;
|
|
337
337
|
else if (!v) {
|
|
338
|
-
var I = c +
|
|
339
|
-
if (I >= 0 && I < f &&
|
|
340
|
-
var R =
|
|
338
|
+
var I = c + _ - F;
|
|
339
|
+
if (I >= 0 && I < f && h[I] != -1) {
|
|
340
|
+
var R = h[I], H = c + R - I;
|
|
341
341
|
if ($ = s - $, R >= $)
|
|
342
|
-
return this.diff_bisectSplit_(t, r, R,
|
|
342
|
+
return this.diff_bisectSplit_(t, r, R, H, i);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
}
|
|
@@ -349,19 +349,19 @@ var ce = {}, Un = {
|
|
|
349
349
|
new e.Diff(u, r)
|
|
350
350
|
];
|
|
351
351
|
}, e.prototype.diff_bisectSplit_ = function(t, r, i, s, a) {
|
|
352
|
-
var l = t.substring(0, i), c = r.substring(0, s), f = t.substring(i),
|
|
353
|
-
return
|
|
352
|
+
var l = t.substring(0, i), c = r.substring(0, s), f = t.substring(i), h = r.substring(s), d = this.diff_main(l, c, !1, a), p = this.diff_main(f, h, !1, a);
|
|
353
|
+
return d.concat(p);
|
|
354
354
|
}, e.prototype.diff_linesToChars_ = function(t, r) {
|
|
355
355
|
var i = [], s = {};
|
|
356
356
|
i[0] = "";
|
|
357
|
-
function a(
|
|
358
|
-
for (var
|
|
359
|
-
|
|
360
|
-
`,
|
|
361
|
-
var E =
|
|
362
|
-
(s.hasOwnProperty ? s.hasOwnProperty(E) : s[E] !== void 0) ?
|
|
357
|
+
function a(h) {
|
|
358
|
+
for (var d = "", p = 0, _ = -1, v = i.length; _ < h.length - 1; ) {
|
|
359
|
+
_ = h.indexOf(`
|
|
360
|
+
`, p), _ == -1 && (_ = h.length - 1);
|
|
361
|
+
var E = h.substring(p, _ + 1);
|
|
362
|
+
(s.hasOwnProperty ? s.hasOwnProperty(E) : s[E] !== void 0) ? d += String.fromCharCode(s[E]) : (v == l && (E = h.substring(p), _ = h.length), d += String.fromCharCode(v), s[E] = v, i[v++] = E), p = _ + 1;
|
|
363
363
|
}
|
|
364
|
-
return
|
|
364
|
+
return d;
|
|
365
365
|
}
|
|
366
366
|
var l = 4e4, c = a(t);
|
|
367
367
|
l = 65535;
|
|
@@ -394,10 +394,10 @@ var ce = {}, Un = {
|
|
|
394
394
|
if (t == r)
|
|
395
395
|
return a;
|
|
396
396
|
for (var l = 0, c = 1; ; ) {
|
|
397
|
-
var f = t.substring(a - c),
|
|
398
|
-
if (
|
|
397
|
+
var f = t.substring(a - c), h = r.indexOf(f);
|
|
398
|
+
if (h == -1)
|
|
399
399
|
return l;
|
|
400
|
-
c +=
|
|
400
|
+
c += h, (h == 0 || t.substring(a - c) == r.substring(0, c)) && (l = c, c++);
|
|
401
401
|
}
|
|
402
402
|
}, e.prototype.diff_halfMatch_ = function(t, r) {
|
|
403
403
|
if (this.Diff_Timeout <= 0)
|
|
@@ -407,19 +407,19 @@ var ce = {}, Un = {
|
|
|
407
407
|
return null;
|
|
408
408
|
var a = this;
|
|
409
409
|
function l(w, m, T) {
|
|
410
|
-
for (var D = w.substring(T, T + Math.floor(w.length / 4)), M = -1, I = "", R,
|
|
411
|
-
var
|
|
410
|
+
for (var D = w.substring(T, T + Math.floor(w.length / 4)), M = -1, I = "", R, H, U, $; (M = m.indexOf(D, M + 1)) != -1; ) {
|
|
411
|
+
var F = a.diff_commonPrefix(
|
|
412
412
|
w.substring(T),
|
|
413
413
|
m.substring(M)
|
|
414
414
|
), G = a.diff_commonSuffix(
|
|
415
415
|
w.substring(0, T),
|
|
416
416
|
m.substring(0, M)
|
|
417
417
|
);
|
|
418
|
-
I.length < G +
|
|
418
|
+
I.length < G + F && (I = m.substring(M - G, M) + m.substring(M, M + F), R = w.substring(0, T - G), H = w.substring(T + F), U = m.substring(0, M - G), $ = m.substring(M + F));
|
|
419
419
|
}
|
|
420
420
|
return I.length * 2 >= w.length ? [
|
|
421
421
|
R,
|
|
422
|
-
|
|
422
|
+
H,
|
|
423
423
|
U,
|
|
424
424
|
$,
|
|
425
425
|
I
|
|
@@ -433,34 +433,34 @@ var ce = {}, Un = {
|
|
|
433
433
|
i,
|
|
434
434
|
s,
|
|
435
435
|
Math.ceil(i.length / 2)
|
|
436
|
-
),
|
|
436
|
+
), h;
|
|
437
437
|
if (!c && !f)
|
|
438
438
|
return null;
|
|
439
|
-
f ? c ?
|
|
440
|
-
var
|
|
441
|
-
t.length > r.length ? (
|
|
442
|
-
var E =
|
|
443
|
-
return [
|
|
439
|
+
f ? c ? h = c[4].length > f[4].length ? c : f : h = f : h = c;
|
|
440
|
+
var d, p, _, v;
|
|
441
|
+
t.length > r.length ? (d = h[0], p = h[1], _ = h[2], v = h[3]) : (_ = h[0], v = h[1], d = h[2], p = h[3]);
|
|
442
|
+
var E = h[4];
|
|
443
|
+
return [d, p, _, v, E];
|
|
444
444
|
}, e.prototype.diff_cleanupSemantic = function(t) {
|
|
445
|
-
for (var r = !1, i = [], s = 0, a = null, l = 0, c = 0, f = 0,
|
|
446
|
-
t[l][0] ==
|
|
447
|
-
|
|
448
|
-
|
|
445
|
+
for (var r = !1, i = [], s = 0, a = null, l = 0, c = 0, f = 0, h = 0, d = 0; l < t.length; )
|
|
446
|
+
t[l][0] == g ? (i[s++] = l, c = h, f = d, h = 0, d = 0, a = t[l][1]) : (t[l][0] == u ? h += t[l][1].length : d += t[l][1].length, a && a.length <= Math.max(c, f) && a.length <= Math.max(
|
|
447
|
+
h,
|
|
448
|
+
d
|
|
449
449
|
) && (t.splice(
|
|
450
450
|
i[s - 1],
|
|
451
451
|
0,
|
|
452
452
|
new e.Diff(o, a)
|
|
453
|
-
), t[i[s - 1] + 1][0] = u, s--, s--, l = s > 0 ? i[s - 1] : -1, c = 0, f = 0,
|
|
453
|
+
), t[i[s - 1] + 1][0] = u, s--, s--, l = s > 0 ? i[s - 1] : -1, c = 0, f = 0, h = 0, d = 0, a = null, r = !0)), l++;
|
|
454
454
|
for (r && this.diff_cleanupMerge(t), this.diff_cleanupSemanticLossless(t), l = 1; l < t.length; ) {
|
|
455
455
|
if (t[l - 1][0] == o && t[l][0] == u) {
|
|
456
|
-
var
|
|
457
|
-
v >= E ? (v >=
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
)), t[l - 1][1] =
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
)), t[l - 1][0] = u, t[l - 1][1] =
|
|
456
|
+
var p = t[l - 1][1], _ = t[l][1], v = this.diff_commonOverlap_(p, _), E = this.diff_commonOverlap_(_, p);
|
|
457
|
+
v >= E ? (v >= p.length / 2 || v >= _.length / 2) && (t.splice(l, 0, new e.Diff(
|
|
458
|
+
g,
|
|
459
|
+
_.substring(0, v)
|
|
460
|
+
)), t[l - 1][1] = p.substring(0, p.length - v), t[l + 1][1] = _.substring(v), l++) : (E >= p.length / 2 || E >= _.length / 2) && (t.splice(l, 0, new e.Diff(
|
|
461
|
+
g,
|
|
462
|
+
p.substring(0, E)
|
|
463
|
+
)), t[l - 1][0] = u, t[l - 1][1] = _.substring(0, _.length - E), t[l + 1][0] = o, t[l + 1][1] = p.substring(E), l++), l++;
|
|
464
464
|
}
|
|
465
465
|
l++;
|
|
466
466
|
}
|
|
@@ -468,35 +468,35 @@ var ce = {}, Un = {
|
|
|
468
468
|
function r(E, w) {
|
|
469
469
|
if (!E || !w)
|
|
470
470
|
return 6;
|
|
471
|
-
var m = E.charAt(E.length - 1), T = w.charAt(0), D = m.match(e.nonAlphaNumericRegex_), M = T.match(e.nonAlphaNumericRegex_), I = D && m.match(e.whitespaceRegex_), R = M && T.match(e.whitespaceRegex_),
|
|
472
|
-
return $ ||
|
|
471
|
+
var m = E.charAt(E.length - 1), T = w.charAt(0), D = m.match(e.nonAlphaNumericRegex_), M = T.match(e.nonAlphaNumericRegex_), I = D && m.match(e.whitespaceRegex_), R = M && T.match(e.whitespaceRegex_), H = I && m.match(e.linebreakRegex_), U = R && T.match(e.linebreakRegex_), $ = H && E.match(e.blanklineEndRegex_), F = U && w.match(e.blanklineStartRegex_);
|
|
472
|
+
return $ || F ? 5 : H || U ? 4 : D && !I && R ? 3 : I || R ? 2 : D || M ? 1 : 0;
|
|
473
473
|
}
|
|
474
474
|
for (var i = 1; i < t.length - 1; ) {
|
|
475
|
-
if (t[i - 1][0] ==
|
|
475
|
+
if (t[i - 1][0] == g && t[i + 1][0] == g) {
|
|
476
476
|
var s = t[i - 1][1], a = t[i][1], l = t[i + 1][1], c = this.diff_commonSuffix(s, a);
|
|
477
477
|
if (c) {
|
|
478
478
|
var f = a.substring(a.length - c);
|
|
479
479
|
s = s.substring(0, s.length - c), a = f + a.substring(0, a.length - c), l = f + l;
|
|
480
480
|
}
|
|
481
|
-
for (var
|
|
481
|
+
for (var h = s, d = a, p = l, _ = r(s, a) + r(a, l); a.charAt(0) === l.charAt(0); ) {
|
|
482
482
|
s += a.charAt(0), a = a.substring(1) + l.charAt(0), l = l.substring(1);
|
|
483
483
|
var v = r(s, a) + r(a, l);
|
|
484
|
-
v >=
|
|
484
|
+
v >= _ && (_ = v, h = s, d = a, p = l);
|
|
485
485
|
}
|
|
486
|
-
t[i - 1][1] !=
|
|
486
|
+
t[i - 1][1] != h && (h ? t[i - 1][1] = h : (t.splice(i - 1, 1), i--), t[i][1] = d, p ? t[i + 1][1] = p : (t.splice(i + 1, 1), i--));
|
|
487
487
|
}
|
|
488
488
|
i++;
|
|
489
489
|
}
|
|
490
490
|
}, e.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/, e.whitespaceRegex_ = /\s/, e.linebreakRegex_ = /[\r\n]/, e.blanklineEndRegex_ = /\n\r?\n$/, e.blanklineStartRegex_ = /^\r?\n\r?\n/, e.prototype.diff_cleanupEfficiency = function(t) {
|
|
491
|
-
for (var r = !1, i = [], s = 0, a = null, l = 0, c = !1, f = !1,
|
|
492
|
-
t[l][0] ==
|
|
491
|
+
for (var r = !1, i = [], s = 0, a = null, l = 0, c = !1, f = !1, h = !1, d = !1; l < t.length; )
|
|
492
|
+
t[l][0] == g ? (t[l][1].length < this.Diff_EditCost && (h || d) ? (i[s++] = l, c = h, f = d, a = t[l][1]) : (s = 0, a = null), h = d = !1) : (t[l][0] == o ? d = !0 : h = !0, a && (c && f && h && d || a.length < this.Diff_EditCost / 2 && c + f + h + d == 3) && (t.splice(
|
|
493
493
|
i[s - 1],
|
|
494
494
|
0,
|
|
495
495
|
new e.Diff(o, a)
|
|
496
|
-
), t[i[s - 1] + 1][0] = u, s--, a = null, c && f ? (
|
|
496
|
+
), t[i[s - 1] + 1][0] = u, s--, a = null, c && f ? (h = d = !0, s = 0) : (s--, l = s > 0 ? i[s - 1] : -1, h = d = !1), r = !0)), l++;
|
|
497
497
|
r && this.diff_cleanupMerge(t);
|
|
498
498
|
}, e.prototype.diff_cleanupMerge = function(t) {
|
|
499
|
-
t.push(new e.Diff(
|
|
499
|
+
t.push(new e.Diff(g, ""));
|
|
500
500
|
for (var r = 0, i = 0, s = 0, a = "", l = "", c; r < t.length; )
|
|
501
501
|
switch (t[r][0]) {
|
|
502
502
|
case u:
|
|
@@ -505,9 +505,9 @@ var ce = {}, Un = {
|
|
|
505
505
|
case o:
|
|
506
506
|
i++, a += t[r][1], r++;
|
|
507
507
|
break;
|
|
508
|
-
case
|
|
509
|
-
i + s > 1 ? (i !== 0 && s !== 0 && (c = this.diff_commonPrefix(l, a), c !== 0 && (r - i - s > 0 && t[r - i - s - 1][0] ==
|
|
510
|
-
|
|
508
|
+
case g:
|
|
509
|
+
i + s > 1 ? (i !== 0 && s !== 0 && (c = this.diff_commonPrefix(l, a), c !== 0 && (r - i - s > 0 && t[r - i - s - 1][0] == g ? t[r - i - s - 1][1] += l.substring(0, c) : (t.splice(0, 0, new e.Diff(
|
|
510
|
+
g,
|
|
511
511
|
l.substring(0, c)
|
|
512
512
|
)), r++), l = l.substring(c), a = a.substring(c)), c = this.diff_commonSuffix(l, a), c !== 0 && (t[r][1] = l.substring(l.length - c) + t[r][1], l = l.substring(0, l.length - c), a = a.substring(0, a.length - c))), r -= i + s, t.splice(r, i + s), a.length && (t.splice(
|
|
513
513
|
r,
|
|
@@ -517,13 +517,13 @@ var ce = {}, Un = {
|
|
|
517
517
|
r,
|
|
518
518
|
0,
|
|
519
519
|
new e.Diff(u, l)
|
|
520
|
-
), r++), r++) : r !== 0 && t[r - 1][0] ==
|
|
520
|
+
), r++), r++) : r !== 0 && t[r - 1][0] == g ? (t[r - 1][1] += t[r][1], t.splice(r, 1)) : r++, s = 0, i = 0, a = "", l = "";
|
|
521
521
|
break;
|
|
522
522
|
}
|
|
523
523
|
t[t.length - 1][1] === "" && t.pop();
|
|
524
524
|
var f = !1;
|
|
525
525
|
for (r = 1; r < t.length - 1; )
|
|
526
|
-
t[r - 1][0] ==
|
|
526
|
+
t[r - 1][0] == g && t[r + 1][0] == g && (t[r][1].substring(t[r][1].length - t[r - 1][1].length) == t[r - 1][1] ? (t[r][1] = t[r - 1][1] + t[r][1].substring(0, t[r][1].length - t[r - 1][1].length), t[r + 1][1] = t[r - 1][1] + t[r + 1][1], t.splice(r - 1, 1), f = !0) : t[r][1].substring(0, t[r + 1][1].length) == t[r + 1][1] && (t[r - 1][1] += t[r + 1][1], t[r][1] = t[r][1].substring(t[r + 1][1].length) + t[r + 1][1], t.splice(r + 1, 1), f = !0)), r++;
|
|
527
527
|
f && this.diff_cleanupMerge(t);
|
|
528
528
|
}, e.prototype.diff_xIndex = function(t, r) {
|
|
529
529
|
var i = 0, s = 0, a = 0, l = 0, c;
|
|
@@ -532,16 +532,16 @@ var ce = {}, Un = {
|
|
|
532
532
|
return t.length != c && t[c][0] === o ? l : l + (r - a);
|
|
533
533
|
}, e.prototype.diff_prettyHtml = function(t) {
|
|
534
534
|
for (var r = [], i = /&/g, s = /</g, a = />/g, l = /\n/g, c = 0; c < t.length; c++) {
|
|
535
|
-
var f = t[c][0],
|
|
535
|
+
var f = t[c][0], h = t[c][1], d = h.replace(i, "&").replace(s, "<").replace(a, ">").replace(l, "¶<br>");
|
|
536
536
|
switch (f) {
|
|
537
537
|
case u:
|
|
538
|
-
r[c] = '<ins style="background:#e6ffe6;">' +
|
|
538
|
+
r[c] = '<ins style="background:#e6ffe6;">' + d + "</ins>";
|
|
539
539
|
break;
|
|
540
540
|
case o:
|
|
541
|
-
r[c] = '<del style="background:#ffe6e6;">' +
|
|
541
|
+
r[c] = '<del style="background:#ffe6e6;">' + d + "</del>";
|
|
542
542
|
break;
|
|
543
|
-
case
|
|
544
|
-
r[c] = "<span>" +
|
|
543
|
+
case g:
|
|
544
|
+
r[c] = "<span>" + d + "</span>";
|
|
545
545
|
break;
|
|
546
546
|
}
|
|
547
547
|
}
|
|
@@ -564,7 +564,7 @@ var ce = {}, Un = {
|
|
|
564
564
|
case o:
|
|
565
565
|
s += c.length;
|
|
566
566
|
break;
|
|
567
|
-
case
|
|
567
|
+
case g:
|
|
568
568
|
r += Math.max(i, s), i = 0, s = 0;
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
@@ -579,7 +579,7 @@ var ce = {}, Un = {
|
|
|
579
579
|
case o:
|
|
580
580
|
r[i] = "-" + t[i][1].length;
|
|
581
581
|
break;
|
|
582
|
-
case
|
|
582
|
+
case g:
|
|
583
583
|
r[i] = "=" + t[i][1].length;
|
|
584
584
|
break;
|
|
585
585
|
}
|
|
@@ -591,17 +591,17 @@ var ce = {}, Un = {
|
|
|
591
591
|
case "+":
|
|
592
592
|
try {
|
|
593
593
|
i[s++] = new e.Diff(u, decodeURI(f));
|
|
594
|
-
} catch (
|
|
594
|
+
} catch (p) {
|
|
595
595
|
throw new Error("Illegal escape in diff_fromDelta: " + f);
|
|
596
596
|
}
|
|
597
597
|
break;
|
|
598
598
|
case "-":
|
|
599
599
|
case "=":
|
|
600
|
-
var
|
|
601
|
-
if (isNaN(
|
|
600
|
+
var h = parseInt(f, 10);
|
|
601
|
+
if (isNaN(h) || h < 0)
|
|
602
602
|
throw new Error("Invalid number in diff_fromDelta: " + f);
|
|
603
|
-
var
|
|
604
|
-
l[c].charAt(0) == "=" ? i[s++] = new e.Diff(
|
|
603
|
+
var d = t.substring(a, a += h);
|
|
604
|
+
l[c].charAt(0) == "=" ? i[s++] = new e.Diff(g, d) : i[s++] = new e.Diff(o, d);
|
|
605
605
|
break;
|
|
606
606
|
default:
|
|
607
607
|
if (l[c])
|
|
@@ -619,23 +619,23 @@ var ce = {}, Un = {
|
|
|
619
619
|
if (r.length > this.Match_MaxBits)
|
|
620
620
|
throw new Error("Pattern too long for this browser.");
|
|
621
621
|
var s = this.match_alphabet_(r), a = this;
|
|
622
|
-
function l(R,
|
|
623
|
-
var U = R / r.length, $ = Math.abs(i -
|
|
622
|
+
function l(R, H) {
|
|
623
|
+
var U = R / r.length, $ = Math.abs(i - H);
|
|
624
624
|
return a.Match_Distance ? U + $ / a.Match_Distance : $ ? 1 : U;
|
|
625
625
|
}
|
|
626
626
|
var c = this.Match_Threshold, f = t.indexOf(r, i);
|
|
627
627
|
f != -1 && (c = Math.min(l(0, f), c), f = t.lastIndexOf(r, i + r.length), f != -1 && (c = Math.min(l(0, f), c)));
|
|
628
|
-
var
|
|
628
|
+
var h = 1 << r.length - 1;
|
|
629
629
|
f = -1;
|
|
630
|
-
for (var
|
|
631
|
-
for (
|
|
632
|
-
l(E, i +
|
|
633
|
-
|
|
634
|
-
var w = Math.max(1, i -
|
|
630
|
+
for (var d, p, _ = r.length + t.length, v, E = 0; E < r.length; E++) {
|
|
631
|
+
for (d = 0, p = _; d < p; )
|
|
632
|
+
l(E, i + p) <= c ? d = p : _ = p, p = Math.floor((_ - d) / 2 + d);
|
|
633
|
+
_ = p;
|
|
634
|
+
var w = Math.max(1, i - p + 1), m = Math.min(i + p, t.length) + r.length, T = Array(m + 2);
|
|
635
635
|
T[m + 1] = (1 << E) - 1;
|
|
636
636
|
for (var D = m; D >= w; D--) {
|
|
637
637
|
var M = s[t.charAt(D - 1)];
|
|
638
|
-
if (E === 0 ? T[D] = (T[D + 1] << 1 | 1) & M : T[D] = (T[D + 1] << 1 | 1) & M | ((v[D + 1] | v[D]) << 1 | 1) | v[D + 1], T[D] &
|
|
638
|
+
if (E === 0 ? T[D] = (T[D + 1] << 1 | 1) & M : T[D] = (T[D + 1] << 1 | 1) & M | ((v[D + 1] | v[D]) << 1 | 1) | v[D + 1], T[D] & h) {
|
|
639
639
|
var I = l(E, D - 1);
|
|
640
640
|
if (I <= c)
|
|
641
641
|
if (c = I, f = D - 1, f > i)
|
|
@@ -666,12 +666,12 @@ var ce = {}, Un = {
|
|
|
666
666
|
);
|
|
667
667
|
s += this.Patch_Margin;
|
|
668
668
|
var a = r.substring(t.start2 - s, t.start2);
|
|
669
|
-
a && t.diffs.unshift(new e.Diff(
|
|
669
|
+
a && t.diffs.unshift(new e.Diff(g, a));
|
|
670
670
|
var l = r.substring(
|
|
671
671
|
t.start2 + t.length1,
|
|
672
672
|
t.start2 + t.length1 + s
|
|
673
673
|
);
|
|
674
|
-
l && t.diffs.push(new e.Diff(
|
|
674
|
+
l && t.diffs.push(new e.Diff(g, l)), t.start1 -= a.length, t.start2 -= a.length, t.length1 += a.length + l.length, t.length2 += a.length + l.length;
|
|
675
675
|
}
|
|
676
676
|
}, e.prototype.patch_make = function(t, r, i) {
|
|
677
677
|
var s, a;
|
|
@@ -698,22 +698,22 @@ var ce = {}, Un = {
|
|
|
698
698
|
throw new Error("Unknown call format to patch_make.");
|
|
699
699
|
if (a.length === 0)
|
|
700
700
|
return [];
|
|
701
|
-
for (var l = [], c = new e.patch_obj(), f = 0,
|
|
701
|
+
for (var l = [], c = new e.patch_obj(), f = 0, h = 0, d = 0, p = s, _ = s, v = 0; v < a.length; v++) {
|
|
702
702
|
var E = a[v][0], w = a[v][1];
|
|
703
|
-
switch (!f && E !==
|
|
703
|
+
switch (!f && E !== g && (c.start1 = h, c.start2 = d), E) {
|
|
704
704
|
case u:
|
|
705
|
-
c.diffs[f++] = a[v], c.length2 += w.length,
|
|
705
|
+
c.diffs[f++] = a[v], c.length2 += w.length, _ = _.substring(0, d) + w + _.substring(d);
|
|
706
706
|
break;
|
|
707
707
|
case o:
|
|
708
|
-
c.length1 += w.length, c.diffs[f++] = a[v],
|
|
708
|
+
c.length1 += w.length, c.diffs[f++] = a[v], _ = _.substring(0, d) + _.substring(d + w.length);
|
|
709
709
|
break;
|
|
710
|
-
case
|
|
711
|
-
w.length <= 2 * this.Patch_Margin && f && a.length != v + 1 ? (c.diffs[f++] = a[v], c.length1 += w.length, c.length2 += w.length) : w.length >= 2 * this.Patch_Margin && f && (this.patch_addContext_(c,
|
|
710
|
+
case g:
|
|
711
|
+
w.length <= 2 * this.Patch_Margin && f && a.length != v + 1 ? (c.diffs[f++] = a[v], c.length1 += w.length, c.length2 += w.length) : w.length >= 2 * this.Patch_Margin && f && (this.patch_addContext_(c, p), l.push(c), c = new e.patch_obj(), f = 0, p = _, h = d);
|
|
712
712
|
break;
|
|
713
713
|
}
|
|
714
|
-
E !== u && (
|
|
714
|
+
E !== u && (h += w.length), E !== o && (d += w.length);
|
|
715
715
|
}
|
|
716
|
-
return f && (this.patch_addContext_(c,
|
|
716
|
+
return f && (this.patch_addContext_(c, p), l.push(c)), l;
|
|
717
717
|
}, e.prototype.patch_deepCopy = function(t) {
|
|
718
718
|
for (var r = [], i = 0; i < t.length; i++) {
|
|
719
719
|
var s = t[i], a = new e.patch_obj();
|
|
@@ -730,32 +730,32 @@ var ce = {}, Un = {
|
|
|
730
730
|
var i = this.patch_addPadding(t);
|
|
731
731
|
r = i + r + i, this.patch_splitMax(t);
|
|
732
732
|
for (var s = 0, a = [], l = 0; l < t.length; l++) {
|
|
733
|
-
var c = t[l].start2 + s, f = this.diff_text1(t[l].diffs),
|
|
734
|
-
if (f.length > this.Match_MaxBits ? (
|
|
733
|
+
var c = t[l].start2 + s, f = this.diff_text1(t[l].diffs), h, d = -1;
|
|
734
|
+
if (f.length > this.Match_MaxBits ? (h = this.match_main(
|
|
735
735
|
r,
|
|
736
736
|
f.substring(0, this.Match_MaxBits),
|
|
737
737
|
c
|
|
738
|
-
),
|
|
738
|
+
), h != -1 && (d = this.match_main(
|
|
739
739
|
r,
|
|
740
740
|
f.substring(f.length - this.Match_MaxBits),
|
|
741
741
|
c + f.length - this.Match_MaxBits
|
|
742
|
-
), (
|
|
742
|
+
), (d == -1 || h >= d) && (h = -1))) : h = this.match_main(r, f, c), h == -1)
|
|
743
743
|
a[l] = !1, s -= t[l].length2 - t[l].length1;
|
|
744
744
|
else {
|
|
745
|
-
a[l] = !0, s =
|
|
746
|
-
var
|
|
747
|
-
if (
|
|
748
|
-
r = r.substring(0,
|
|
745
|
+
a[l] = !0, s = h - c;
|
|
746
|
+
var p;
|
|
747
|
+
if (d == -1 ? p = r.substring(h, h + f.length) : p = r.substring(h, d + this.Match_MaxBits), f == p)
|
|
748
|
+
r = r.substring(0, h) + this.diff_text2(t[l].diffs) + r.substring(h + f.length);
|
|
749
749
|
else {
|
|
750
|
-
var
|
|
751
|
-
if (f.length > this.Match_MaxBits && this.diff_levenshtein(
|
|
750
|
+
var _ = this.diff_main(f, p, !1);
|
|
751
|
+
if (f.length > this.Match_MaxBits && this.diff_levenshtein(_) / f.length > this.Patch_DeleteThreshold)
|
|
752
752
|
a[l] = !1;
|
|
753
753
|
else {
|
|
754
|
-
this.diff_cleanupSemanticLossless(
|
|
754
|
+
this.diff_cleanupSemanticLossless(_);
|
|
755
755
|
for (var v = 0, E, w = 0; w < t[l].diffs.length; w++) {
|
|
756
756
|
var m = t[l].diffs[w];
|
|
757
|
-
m[0] !==
|
|
758
|
-
|
|
757
|
+
m[0] !== g && (E = this.diff_xIndex(_, v)), m[0] === u ? r = r.substring(0, h + E) + m[1] + r.substring(h + E) : m[0] === o && (r = r.substring(0, h + E) + r.substring(h + this.diff_xIndex(
|
|
758
|
+
_,
|
|
759
759
|
v + m[1].length
|
|
760
760
|
))), m[0] !== o && (v += m[1].length);
|
|
761
761
|
}
|
|
@@ -770,14 +770,14 @@ var ce = {}, Un = {
|
|
|
770
770
|
for (var s = 0; s < t.length; s++)
|
|
771
771
|
t[s].start1 += r, t[s].start2 += r;
|
|
772
772
|
var a = t[0], l = a.diffs;
|
|
773
|
-
if (l.length == 0 || l[0][0] !=
|
|
774
|
-
l.unshift(new e.Diff(
|
|
773
|
+
if (l.length == 0 || l[0][0] != g)
|
|
774
|
+
l.unshift(new e.Diff(g, i)), a.start1 -= r, a.start2 -= r, a.length1 += r, a.length2 += r;
|
|
775
775
|
else if (r > l[0][1].length) {
|
|
776
776
|
var c = r - l[0][1].length;
|
|
777
777
|
l[0][1] = i.substring(l[0][1].length) + l[0][1], a.start1 -= c, a.start2 -= c, a.length1 += c, a.length2 += c;
|
|
778
778
|
}
|
|
779
|
-
if (a = t[t.length - 1], l = a.diffs, l.length == 0 || l[l.length - 1][0] !=
|
|
780
|
-
l.push(new e.Diff(
|
|
779
|
+
if (a = t[t.length - 1], l = a.diffs, l.length == 0 || l[l.length - 1][0] != g)
|
|
780
|
+
l.push(new e.Diff(g, i)), a.length1 += r, a.length2 += r;
|
|
781
781
|
else if (r > l[l.length - 1][1].length) {
|
|
782
782
|
var c = r - l[l.length - 1][1].length;
|
|
783
783
|
l[l.length - 1][1] += i.substring(0, c), a.length1 += c, a.length2 += c;
|
|
@@ -789,17 +789,17 @@ var ce = {}, Un = {
|
|
|
789
789
|
var s = t[i];
|
|
790
790
|
t.splice(i--, 1);
|
|
791
791
|
for (var a = s.start1, l = s.start2, c = ""; s.diffs.length !== 0; ) {
|
|
792
|
-
var f = new e.patch_obj(),
|
|
793
|
-
for (f.start1 = a - c.length, f.start2 = l - c.length, c !== "" && (f.length1 = f.length2 = c.length, f.diffs.push(new e.Diff(
|
|
794
|
-
var
|
|
795
|
-
|
|
792
|
+
var f = new e.patch_obj(), h = !0;
|
|
793
|
+
for (f.start1 = a - c.length, f.start2 = l - c.length, c !== "" && (f.length1 = f.length2 = c.length, f.diffs.push(new e.Diff(g, c))); s.diffs.length !== 0 && f.length1 < r - this.Patch_Margin; ) {
|
|
794
|
+
var d = s.diffs[0][0], p = s.diffs[0][1];
|
|
795
|
+
d === u ? (f.length2 += p.length, l += p.length, f.diffs.push(s.diffs.shift()), h = !1) : d === o && f.diffs.length == 1 && f.diffs[0][0] == g && p.length > 2 * r ? (f.length1 += p.length, a += p.length, h = !1, f.diffs.push(new e.Diff(d, p)), s.diffs.shift()) : (p = p.substring(
|
|
796
796
|
0,
|
|
797
797
|
r - f.length1 - this.Patch_Margin
|
|
798
|
-
), f.length1 +=
|
|
798
|
+
), f.length1 += p.length, a += p.length, d === g ? (f.length2 += p.length, l += p.length) : h = !1, f.diffs.push(new e.Diff(d, p)), p == s.diffs[0][1] ? s.diffs.shift() : s.diffs[0][1] = s.diffs[0][1].substring(p.length));
|
|
799
799
|
}
|
|
800
800
|
c = this.diff_text2(f.diffs), c = c.substring(c.length - this.Patch_Margin);
|
|
801
|
-
var
|
|
802
|
-
|
|
801
|
+
var _ = this.diff_text1(s.diffs).substring(0, this.Patch_Margin);
|
|
802
|
+
_ !== "" && (f.length1 += _.length, f.length2 += _.length, f.diffs.length !== 0 && f.diffs[f.diffs.length - 1][0] === g ? f.diffs[f.diffs.length - 1][1] += _ : f.diffs.push(new e.Diff(g, _))), h || t.splice(++i, 0, f);
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
805
|
}, e.prototype.patch_toText = function(t) {
|
|
@@ -819,21 +819,21 @@ var ce = {}, Un = {
|
|
|
819
819
|
for (r.push(c), c.start1 = parseInt(l[1], 10), l[2] === "" ? (c.start1--, c.length1 = 1) : l[2] == "0" ? c.length1 = 0 : (c.start1--, c.length1 = parseInt(l[2], 10)), c.start2 = parseInt(l[3], 10), l[4] === "" ? (c.start2--, c.length2 = 1) : l[4] == "0" ? c.length2 = 0 : (c.start2--, c.length2 = parseInt(l[4], 10)), s++; s < i.length; ) {
|
|
820
820
|
var f = i[s].charAt(0);
|
|
821
821
|
try {
|
|
822
|
-
var
|
|
823
|
-
} catch (
|
|
824
|
-
throw new Error("Illegal escape in patch_fromText: " +
|
|
822
|
+
var h = decodeURI(i[s].substring(1));
|
|
823
|
+
} catch (d) {
|
|
824
|
+
throw new Error("Illegal escape in patch_fromText: " + h);
|
|
825
825
|
}
|
|
826
826
|
if (f == "-")
|
|
827
|
-
c.diffs.push(new e.Diff(o,
|
|
827
|
+
c.diffs.push(new e.Diff(o, h));
|
|
828
828
|
else if (f == "+")
|
|
829
|
-
c.diffs.push(new e.Diff(u,
|
|
829
|
+
c.diffs.push(new e.Diff(u, h));
|
|
830
830
|
else if (f == " ")
|
|
831
|
-
c.diffs.push(new e.Diff(
|
|
831
|
+
c.diffs.push(new e.Diff(g, h));
|
|
832
832
|
else {
|
|
833
833
|
if (f == "@")
|
|
834
834
|
break;
|
|
835
835
|
if (f !== "")
|
|
836
|
-
throw new Error('Invalid patch mode "' + f + '" in: ' +
|
|
836
|
+
throw new Error('Invalid patch mode "' + f + '" in: ' + h);
|
|
837
837
|
}
|
|
838
838
|
s++;
|
|
839
839
|
}
|
|
@@ -853,7 +853,7 @@ var ce = {}, Un = {
|
|
|
853
853
|
case o:
|
|
854
854
|
s = "-";
|
|
855
855
|
break;
|
|
856
|
-
case
|
|
856
|
+
case g:
|
|
857
857
|
s = " ";
|
|
858
858
|
break;
|
|
859
859
|
}
|
|
@@ -861,8 +861,8 @@ var ce = {}, Un = {
|
|
|
861
861
|
`;
|
|
862
862
|
}
|
|
863
863
|
return i.join("").replace(/%20/g, " ");
|
|
864
|
-
}, n.exports = e, n.exports.diff_match_patch = e, n.exports.DIFF_DELETE = o, n.exports.DIFF_INSERT = u, n.exports.DIFF_EQUAL =
|
|
865
|
-
})(
|
|
864
|
+
}, n.exports = e, n.exports.diff_match_patch = e, n.exports.DIFF_DELETE = o, n.exports.DIFF_INSERT = u, n.exports.DIFF_EQUAL = g;
|
|
865
|
+
})(xn);
|
|
866
866
|
var Be = { exports: {} };
|
|
867
867
|
function $e(n) {
|
|
868
868
|
return n instanceof Map ? n.clear = n.delete = n.set = function() {
|
|
@@ -895,22 +895,22 @@ function te(n, ...e) {
|
|
|
895
895
|
for (const u in n)
|
|
896
896
|
o[u] = n[u];
|
|
897
897
|
return e.forEach(function(u) {
|
|
898
|
-
for (const
|
|
899
|
-
o[
|
|
898
|
+
for (const g in u)
|
|
899
|
+
o[g] = u[g];
|
|
900
900
|
}), /** @type {T} */
|
|
901
901
|
o;
|
|
902
902
|
}
|
|
903
|
-
const
|
|
903
|
+
const Hn = "</span>", Ze = (n) => !!n.scope || n.sublanguage && n.language, Fn = (n, { prefix: e }) => {
|
|
904
904
|
if (n.includes(".")) {
|
|
905
905
|
const o = n.split(".");
|
|
906
906
|
return [
|
|
907
907
|
`${e}${o.shift()}`,
|
|
908
|
-
...o.map((u,
|
|
908
|
+
...o.map((u, g) => `${u}${"_".repeat(g + 1)}`)
|
|
909
909
|
].join(" ");
|
|
910
910
|
}
|
|
911
911
|
return `${e}${n}`;
|
|
912
912
|
};
|
|
913
|
-
class
|
|
913
|
+
class zn {
|
|
914
914
|
/**
|
|
915
915
|
* Creates a new HTMLRenderer
|
|
916
916
|
*
|
|
@@ -935,14 +935,14 @@ class Fn {
|
|
|
935
935
|
if (!Ze(e))
|
|
936
936
|
return;
|
|
937
937
|
let o = "";
|
|
938
|
-
e.sublanguage ? o = `language-${e.language}` : o =
|
|
938
|
+
e.sublanguage ? o = `language-${e.language}` : o = Fn(e.scope, { prefix: this.classPrefix }), this.span(o);
|
|
939
939
|
}
|
|
940
940
|
/**
|
|
941
941
|
* Adds a node close to the output stream (if needed)
|
|
942
942
|
*
|
|
943
943
|
* @param {Node} node */
|
|
944
944
|
closeNode(e) {
|
|
945
|
-
Ze(e) && (this.buffer +=
|
|
945
|
+
Ze(e) && (this.buffer += Hn);
|
|
946
946
|
}
|
|
947
947
|
/**
|
|
948
948
|
* returns the accumulated buffer
|
|
@@ -1016,7 +1016,7 @@ class Ue {
|
|
|
1016
1016
|
}));
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
|
-
class
|
|
1019
|
+
class Gn extends Ue {
|
|
1020
1020
|
/**
|
|
1021
1021
|
* @param {*} options
|
|
1022
1022
|
*/
|
|
@@ -1045,7 +1045,7 @@ class Hn extends Ue {
|
|
|
1045
1045
|
u.sublanguage = !0, u.language = o, this.add(u);
|
|
1046
1046
|
}
|
|
1047
1047
|
toHTML() {
|
|
1048
|
-
return new
|
|
1048
|
+
return new zn(this, this.options).value();
|
|
1049
1049
|
}
|
|
1050
1050
|
finalize() {
|
|
1051
1051
|
return !0;
|
|
@@ -1057,48 +1057,48 @@ function fe(n) {
|
|
|
1057
1057
|
function sn(n) {
|
|
1058
1058
|
return se("(?=", n, ")");
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function Kn(n) {
|
|
1061
1061
|
return se("(?:", n, ")*");
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function Wn(n) {
|
|
1064
1064
|
return se("(?:", n, ")?");
|
|
1065
1065
|
}
|
|
1066
1066
|
function se(...n) {
|
|
1067
1067
|
return n.map((o) => fe(o)).join("");
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1069
|
+
function Qn(n) {
|
|
1070
1070
|
const e = n[n.length - 1];
|
|
1071
1071
|
return typeof e == "object" && e.constructor === Object ? (n.splice(n.length - 1, 1), e) : {};
|
|
1072
1072
|
}
|
|
1073
1073
|
function Pe(...n) {
|
|
1074
|
-
return "(" + (
|
|
1074
|
+
return "(" + (Qn(n).capture ? "" : "?:") + n.map((u) => fe(u)).join("|") + ")";
|
|
1075
1075
|
}
|
|
1076
1076
|
function an(n) {
|
|
1077
1077
|
return new RegExp(n.toString() + "|").exec("").length - 1;
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function Vn(n, e) {
|
|
1080
1080
|
const o = n && n.exec(e);
|
|
1081
1081
|
return o && o.index === 0;
|
|
1082
1082
|
}
|
|
1083
|
-
const
|
|
1083
|
+
const Zn = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
1084
1084
|
function xe(n, { joinWith: e }) {
|
|
1085
1085
|
let o = 0;
|
|
1086
1086
|
return n.map((u) => {
|
|
1087
1087
|
o += 1;
|
|
1088
|
-
const
|
|
1088
|
+
const g = o;
|
|
1089
1089
|
let t = fe(u), r = "";
|
|
1090
1090
|
for (; t.length > 0; ) {
|
|
1091
|
-
const i =
|
|
1091
|
+
const i = Zn.exec(t);
|
|
1092
1092
|
if (!i) {
|
|
1093
1093
|
r += t;
|
|
1094
1094
|
break;
|
|
1095
1095
|
}
|
|
1096
|
-
r += t.substring(0, i.index), t = t.substring(i.index + i[0].length), i[0][0] === "\\" && i[1] ? r += "\\" + String(Number(i[1]) +
|
|
1096
|
+
r += t.substring(0, i.index), t = t.substring(i.index + i[0].length), i[0][0] === "\\" && i[1] ? r += "\\" + String(Number(i[1]) + g) : (r += i[0], i[0] === "(" && o++);
|
|
1097
1097
|
}
|
|
1098
1098
|
return r;
|
|
1099
1099
|
}).map((u) => `(${u})`).join(e);
|
|
1100
1100
|
}
|
|
1101
|
-
const
|
|
1101
|
+
const Yn = /\b\B/, on = "[a-zA-Z]\\w*", He = "[a-zA-Z_]\\w*", ln = "\\b\\d+(\\.\\d+)?", cn = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", un = "\\b(0b[01]+)", Xn = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", jn = (n = {}) => {
|
|
1102
1102
|
const e = /^#![ ]*\//;
|
|
1103
1103
|
return n.binary && (n.begin = se(
|
|
1104
1104
|
e,
|
|
@@ -1118,19 +1118,19 @@ const Vn = /\b\B/, on = "[a-zA-Z]\\w*", Fe = "[a-zA-Z_]\\w*", ln = "\\b\\d+(\\.\
|
|
|
1118
1118
|
}, ge = {
|
|
1119
1119
|
begin: "\\\\[\\s\\S]",
|
|
1120
1120
|
relevance: 0
|
|
1121
|
-
},
|
|
1121
|
+
}, Jn = {
|
|
1122
1122
|
scope: "string",
|
|
1123
1123
|
begin: "'",
|
|
1124
1124
|
end: "'",
|
|
1125
1125
|
illegal: "\\n",
|
|
1126
1126
|
contains: [ge]
|
|
1127
|
-
},
|
|
1127
|
+
}, qn = {
|
|
1128
1128
|
scope: "string",
|
|
1129
1129
|
begin: '"',
|
|
1130
1130
|
end: '"',
|
|
1131
1131
|
illegal: "\\n",
|
|
1132
1132
|
contains: [ge]
|
|
1133
|
-
},
|
|
1133
|
+
}, et = {
|
|
1134
1134
|
begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
|
|
1135
1135
|
}, De = function(n, e, o = {}) {
|
|
1136
1136
|
const u = te(
|
|
@@ -1151,7 +1151,7 @@ const Vn = /\b\B/, on = "[a-zA-Z]\\w*", Fe = "[a-zA-Z_]\\w*", ln = "\\b\\d+(\\.\
|
|
|
1151
1151
|
excludeBegin: !0,
|
|
1152
1152
|
relevance: 0
|
|
1153
1153
|
});
|
|
1154
|
-
const
|
|
1154
|
+
const g = Pe(
|
|
1155
1155
|
// list of common 1 and 2 letter words in English
|
|
1156
1156
|
"I",
|
|
1157
1157
|
"a",
|
|
@@ -1191,26 +1191,26 @@ const Vn = /\b\B/, on = "[a-zA-Z]\\w*", Fe = "[a-zA-Z_]\\w*", ln = "\\b\\d+(\\.\
|
|
|
1191
1191
|
/[ ]+/,
|
|
1192
1192
|
// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
|
|
1193
1193
|
"(",
|
|
1194
|
-
|
|
1194
|
+
g,
|
|
1195
1195
|
/[.]?[:]?([.][ ]|[ ])/,
|
|
1196
1196
|
"){3}"
|
|
1197
1197
|
)
|
|
1198
1198
|
// look for 3 words in a row
|
|
1199
1199
|
}
|
|
1200
1200
|
), u;
|
|
1201
|
-
},
|
|
1201
|
+
}, nt = De("//", "$"), tt = De("/\\*", "\\*/"), rt = De("#", "$"), it = {
|
|
1202
1202
|
scope: "number",
|
|
1203
1203
|
begin: ln,
|
|
1204
1204
|
relevance: 0
|
|
1205
|
-
},
|
|
1205
|
+
}, st = {
|
|
1206
1206
|
scope: "number",
|
|
1207
1207
|
begin: cn,
|
|
1208
1208
|
relevance: 0
|
|
1209
|
-
},
|
|
1209
|
+
}, at = {
|
|
1210
1210
|
scope: "number",
|
|
1211
1211
|
begin: un,
|
|
1212
1212
|
relevance: 0
|
|
1213
|
-
},
|
|
1213
|
+
}, ot = {
|
|
1214
1214
|
// this outer rule makes sure we actually have a WHOLE regex and not simply
|
|
1215
1215
|
// an expression such as:
|
|
1216
1216
|
//
|
|
@@ -1233,19 +1233,19 @@ const Vn = /\b\B/, on = "[a-zA-Z]\\w*", Fe = "[a-zA-Z_]\\w*", ln = "\\b\\d+(\\.\
|
|
|
1233
1233
|
}
|
|
1234
1234
|
]
|
|
1235
1235
|
}]
|
|
1236
|
-
},
|
|
1236
|
+
}, lt = {
|
|
1237
1237
|
scope: "title",
|
|
1238
1238
|
begin: on,
|
|
1239
1239
|
relevance: 0
|
|
1240
|
-
},
|
|
1240
|
+
}, ct = {
|
|
1241
1241
|
scope: "title",
|
|
1242
|
-
begin:
|
|
1242
|
+
begin: He,
|
|
1243
1243
|
relevance: 0
|
|
1244
|
-
},
|
|
1244
|
+
}, ut = {
|
|
1245
1245
|
// excludes method names from keyword processing
|
|
1246
|
-
begin: "\\.\\s*" +
|
|
1246
|
+
begin: "\\.\\s*" + He,
|
|
1247
1247
|
relevance: 0
|
|
1248
|
-
},
|
|
1248
|
+
}, ft = function(n) {
|
|
1249
1249
|
return Object.assign(
|
|
1250
1250
|
n,
|
|
1251
1251
|
{
|
|
@@ -1262,54 +1262,54 @@ const Vn = /\b\B/, on = "[a-zA-Z]\\w*", Fe = "[a-zA-Z_]\\w*", ln = "\\b\\d+(\\.\
|
|
|
1262
1262
|
};
|
|
1263
1263
|
var ye = /* @__PURE__ */ Object.freeze({
|
|
1264
1264
|
__proto__: null,
|
|
1265
|
-
MATCH_NOTHING_RE:
|
|
1265
|
+
MATCH_NOTHING_RE: Yn,
|
|
1266
1266
|
IDENT_RE: on,
|
|
1267
|
-
UNDERSCORE_IDENT_RE:
|
|
1267
|
+
UNDERSCORE_IDENT_RE: He,
|
|
1268
1268
|
NUMBER_RE: ln,
|
|
1269
1269
|
C_NUMBER_RE: cn,
|
|
1270
1270
|
BINARY_NUMBER_RE: un,
|
|
1271
|
-
RE_STARTERS_RE:
|
|
1272
|
-
SHEBANG:
|
|
1271
|
+
RE_STARTERS_RE: Xn,
|
|
1272
|
+
SHEBANG: jn,
|
|
1273
1273
|
BACKSLASH_ESCAPE: ge,
|
|
1274
|
-
APOS_STRING_MODE:
|
|
1275
|
-
QUOTE_STRING_MODE:
|
|
1276
|
-
PHRASAL_WORDS_MODE:
|
|
1274
|
+
APOS_STRING_MODE: Jn,
|
|
1275
|
+
QUOTE_STRING_MODE: qn,
|
|
1276
|
+
PHRASAL_WORDS_MODE: et,
|
|
1277
1277
|
COMMENT: De,
|
|
1278
|
-
C_LINE_COMMENT_MODE:
|
|
1279
|
-
C_BLOCK_COMMENT_MODE:
|
|
1280
|
-
HASH_COMMENT_MODE:
|
|
1281
|
-
NUMBER_MODE:
|
|
1282
|
-
C_NUMBER_MODE:
|
|
1283
|
-
BINARY_NUMBER_MODE:
|
|
1284
|
-
REGEXP_MODE:
|
|
1285
|
-
TITLE_MODE:
|
|
1286
|
-
UNDERSCORE_TITLE_MODE:
|
|
1287
|
-
METHOD_GUARD:
|
|
1288
|
-
END_SAME_AS_BEGIN:
|
|
1278
|
+
C_LINE_COMMENT_MODE: nt,
|
|
1279
|
+
C_BLOCK_COMMENT_MODE: tt,
|
|
1280
|
+
HASH_COMMENT_MODE: rt,
|
|
1281
|
+
NUMBER_MODE: it,
|
|
1282
|
+
C_NUMBER_MODE: st,
|
|
1283
|
+
BINARY_NUMBER_MODE: at,
|
|
1284
|
+
REGEXP_MODE: ot,
|
|
1285
|
+
TITLE_MODE: lt,
|
|
1286
|
+
UNDERSCORE_TITLE_MODE: ct,
|
|
1287
|
+
METHOD_GUARD: ut,
|
|
1288
|
+
END_SAME_AS_BEGIN: ft
|
|
1289
1289
|
});
|
|
1290
|
-
function
|
|
1290
|
+
function gt(n, e) {
|
|
1291
1291
|
n.input[n.index - 1] === "." && e.ignoreMatch();
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1293
|
+
function ht(n, e) {
|
|
1294
1294
|
n.className !== void 0 && (n.scope = n.className, delete n.className);
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1297
|
-
e && n.beginKeywords && (n.begin = "\\b(" + n.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", n.__beforeBegin =
|
|
1296
|
+
function dt(n, e) {
|
|
1297
|
+
e && n.beginKeywords && (n.begin = "\\b(" + n.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", n.__beforeBegin = gt, n.keywords = n.keywords || n.beginKeywords, delete n.beginKeywords, n.relevance === void 0 && (n.relevance = 0));
|
|
1298
1298
|
}
|
|
1299
|
-
function
|
|
1299
|
+
function pt(n, e) {
|
|
1300
1300
|
Array.isArray(n.illegal) && (n.illegal = Pe(...n.illegal));
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1302
|
+
function _t(n, e) {
|
|
1303
1303
|
if (n.match) {
|
|
1304
1304
|
if (n.begin || n.end)
|
|
1305
1305
|
throw new Error("begin & end are not supported with match");
|
|
1306
1306
|
n.begin = n.match, delete n.match;
|
|
1307
1307
|
}
|
|
1308
1308
|
}
|
|
1309
|
-
function
|
|
1309
|
+
function bt(n, e) {
|
|
1310
1310
|
n.relevance === void 0 && (n.relevance = 1);
|
|
1311
1311
|
}
|
|
1312
|
-
const
|
|
1312
|
+
const vt = (n, e) => {
|
|
1313
1313
|
if (!n.beforeMatch)
|
|
1314
1314
|
return;
|
|
1315
1315
|
if (n.starts)
|
|
@@ -1323,7 +1323,7 @@ const pt = (n, e) => {
|
|
|
1323
1323
|
Object.assign(o, { endsParent: !0 })
|
|
1324
1324
|
]
|
|
1325
1325
|
}, n.relevance = 0, delete o.beforeMatch;
|
|
1326
|
-
},
|
|
1326
|
+
}, Et = [
|
|
1327
1327
|
"of",
|
|
1328
1328
|
"and",
|
|
1329
1329
|
"for",
|
|
@@ -1338,27 +1338,27 @@ const pt = (n, e) => {
|
|
|
1338
1338
|
// common variable name
|
|
1339
1339
|
"value"
|
|
1340
1340
|
// common variable name
|
|
1341
|
-
],
|
|
1342
|
-
function fn(n, e, o =
|
|
1341
|
+
], mt = "keyword";
|
|
1342
|
+
function fn(n, e, o = mt) {
|
|
1343
1343
|
const u = /* @__PURE__ */ Object.create(null);
|
|
1344
|
-
return typeof n == "string" ?
|
|
1344
|
+
return typeof n == "string" ? g(o, n.split(" ")) : Array.isArray(n) ? g(o, n) : Object.keys(n).forEach(function(t) {
|
|
1345
1345
|
Object.assign(
|
|
1346
1346
|
u,
|
|
1347
1347
|
fn(n[t], e, t)
|
|
1348
1348
|
);
|
|
1349
1349
|
}), u;
|
|
1350
|
-
function
|
|
1350
|
+
function g(t, r) {
|
|
1351
1351
|
e && (r = r.map((i) => i.toLowerCase())), r.forEach(function(i) {
|
|
1352
1352
|
const s = i.split("|");
|
|
1353
|
-
u[s[0]] = [t,
|
|
1353
|
+
u[s[0]] = [t, yt(s[0], s[1])];
|
|
1354
1354
|
});
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1358
|
-
return e ? Number(e) :
|
|
1357
|
+
function yt(n, e) {
|
|
1358
|
+
return e ? Number(e) : wt(n) ? 0 : 1;
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1361
|
-
return
|
|
1360
|
+
function wt(n) {
|
|
1361
|
+
return Et.includes(n.toLowerCase());
|
|
1362
1362
|
}
|
|
1363
1363
|
const Xe = {}, ie = (n) => {
|
|
1364
1364
|
console.error(n);
|
|
@@ -1369,12 +1369,12 @@ const Xe = {}, ie = (n) => {
|
|
|
1369
1369
|
}, Ae = new Error();
|
|
1370
1370
|
function gn(n, e, { key: o }) {
|
|
1371
1371
|
let u = 0;
|
|
1372
|
-
const
|
|
1372
|
+
const g = n[o], t = {}, r = {};
|
|
1373
1373
|
for (let i = 1; i <= e.length; i++)
|
|
1374
|
-
r[i + u] =
|
|
1374
|
+
r[i + u] = g[i], t[i + u] = !0, u += an(e[i - 1]);
|
|
1375
1375
|
n[o] = r, n[o]._emit = t, n[o]._multi = !0;
|
|
1376
1376
|
}
|
|
1377
|
-
function
|
|
1377
|
+
function Nt(n) {
|
|
1378
1378
|
if (Array.isArray(n.begin)) {
|
|
1379
1379
|
if (n.skip || n.excludeBegin || n.returnBegin)
|
|
1380
1380
|
throw ie("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), Ae;
|
|
@@ -1383,7 +1383,7 @@ function yt(n) {
|
|
|
1383
1383
|
gn(n, n.begin, { key: "beginScope" }), n.begin = xe(n.begin, { joinWith: "" });
|
|
1384
1384
|
}
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1386
|
+
function Mt(n) {
|
|
1387
1387
|
if (Array.isArray(n.end)) {
|
|
1388
1388
|
if (n.skip || n.excludeEnd || n.returnEnd)
|
|
1389
1389
|
throw ie("skip, excludeEnd, returnEnd not compatible with endScope: {}"), Ae;
|
|
@@ -1392,13 +1392,13 @@ function wt(n) {
|
|
|
1392
1392
|
gn(n, n.end, { key: "endScope" }), n.end = xe(n.end, { joinWith: "" });
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
|
-
function
|
|
1395
|
+
function At(n) {
|
|
1396
1396
|
n.scope && typeof n.scope == "object" && n.scope !== null && (n.beginScope = n.scope, delete n.scope);
|
|
1397
1397
|
}
|
|
1398
|
-
function
|
|
1399
|
-
|
|
1398
|
+
function Tt(n) {
|
|
1399
|
+
At(n), typeof n.beginScope == "string" && (n.beginScope = { _wrap: n.beginScope }), typeof n.endScope == "string" && (n.endScope = { _wrap: n.endScope }), Nt(n), Mt(n);
|
|
1400
1400
|
}
|
|
1401
|
-
function
|
|
1401
|
+
function Dt(n) {
|
|
1402
1402
|
function e(r, i) {
|
|
1403
1403
|
return new RegExp(
|
|
1404
1404
|
fe(r),
|
|
@@ -1461,7 +1461,7 @@ function At(n) {
|
|
|
1461
1461
|
return a && (this.regexIndex += a.position + 1, this.regexIndex === this.count && this.considerAll()), a;
|
|
1462
1462
|
}
|
|
1463
1463
|
}
|
|
1464
|
-
function
|
|
1464
|
+
function g(r) {
|
|
1465
1465
|
const i = new u();
|
|
1466
1466
|
return r.contains.forEach((s) => i.addRule(s.begin, { rule: s, type: "begin" })), r.terminatorEnd && i.addRule(r.terminatorEnd, { type: "end" }), r.illegal && i.addRule(r.illegal, { type: "illegal" }), i;
|
|
1467
1467
|
}
|
|
@@ -1473,33 +1473,33 @@ function At(n) {
|
|
|
1473
1473
|
if (r.isCompiled)
|
|
1474
1474
|
return s;
|
|
1475
1475
|
[
|
|
1476
|
-
|
|
1476
|
+
ht,
|
|
1477
1477
|
// do this early so compiler extensions generally don't have to worry about
|
|
1478
1478
|
// the distinction between match/begin
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1479
|
+
_t,
|
|
1480
|
+
Tt,
|
|
1481
|
+
vt
|
|
1482
1482
|
].forEach((l) => l(r, i)), n.compilerExtensions.forEach((l) => l(r, i)), r.__beforeBegin = null, [
|
|
1483
|
-
|
|
1483
|
+
dt,
|
|
1484
1484
|
// do this later so compiler extensions that come earlier have access to the
|
|
1485
1485
|
// raw array if they wanted to perhaps manipulate it, etc.
|
|
1486
|
-
|
|
1486
|
+
pt,
|
|
1487
1487
|
// default to 1 relevance if not specified
|
|
1488
|
-
|
|
1488
|
+
bt
|
|
1489
1489
|
].forEach((l) => l(r, i)), r.isCompiled = !0;
|
|
1490
1490
|
let a = null;
|
|
1491
1491
|
return typeof r.keywords == "object" && r.keywords.$pattern && (r.keywords = Object.assign({}, r.keywords), a = r.keywords.$pattern, delete r.keywords.$pattern), a = a || /\w+/, r.keywords && (r.keywords = fn(r.keywords, n.case_insensitive)), s.keywordPatternRe = e(a, !0), i && (r.begin || (r.begin = /\B|\b/), s.beginRe = e(s.begin), !r.end && !r.endsWithParent && (r.end = /\B|\b/), r.end && (s.endRe = e(s.end)), s.terminatorEnd = fe(s.end) || "", r.endsWithParent && i.terminatorEnd && (s.terminatorEnd += (r.end ? "|" : "") + i.terminatorEnd)), r.illegal && (s.illegalRe = e(
|
|
1492
1492
|
/** @type {RegExp | string} */
|
|
1493
1493
|
r.illegal
|
|
1494
1494
|
)), r.contains || (r.contains = []), r.contains = [].concat(...r.contains.map(function(l) {
|
|
1495
|
-
return
|
|
1495
|
+
return St(l === "self" ? r : l);
|
|
1496
1496
|
})), r.contains.forEach(function(l) {
|
|
1497
1497
|
t(
|
|
1498
1498
|
/** @type Mode */
|
|
1499
1499
|
l,
|
|
1500
1500
|
s
|
|
1501
1501
|
);
|
|
1502
|
-
}), r.starts && t(r.starts, i), s.matcher =
|
|
1502
|
+
}), r.starts && t(r.starts, i), s.matcher = g(s), s;
|
|
1503
1503
|
}
|
|
1504
1504
|
if (n.compilerExtensions || (n.compilerExtensions = []), n.contains && n.contains.includes("self"))
|
|
1505
1505
|
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
@@ -1511,20 +1511,20 @@ function At(n) {
|
|
|
1511
1511
|
function hn(n) {
|
|
1512
1512
|
return n ? n.endsWithParent || hn(n.starts) : !1;
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1514
|
+
function St(n) {
|
|
1515
1515
|
return n.variants && !n.cachedVariants && (n.cachedVariants = n.variants.map(function(e) {
|
|
1516
1516
|
return te(n, { variants: null }, e);
|
|
1517
1517
|
})), n.cachedVariants ? n.cachedVariants : hn(n) ? te(n, { starts: n.starts ? te(n.starts) : null }) : Object.isFrozen(n) ? te(n) : n;
|
|
1518
1518
|
}
|
|
1519
|
-
var
|
|
1520
|
-
class
|
|
1519
|
+
var Rt = "11.7.0";
|
|
1520
|
+
class Lt extends Error {
|
|
1521
1521
|
constructor(e, o) {
|
|
1522
1522
|
super(e), this.name = "HTMLInjectionError", this.html = o;
|
|
1523
1523
|
}
|
|
1524
1524
|
}
|
|
1525
|
-
const
|
|
1525
|
+
const Oe = rn, Je = te, qe = Symbol("nomatch"), Ot = 7, Ct = function(n) {
|
|
1526
1526
|
const e = /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null), u = [];
|
|
1527
|
-
let
|
|
1527
|
+
let g = !0;
|
|
1528
1528
|
const t = "Could not find the language '{}', did you forget to load/include a language module?", r = { disableAutodetect: !0, name: "Plain text", contains: [] };
|
|
1529
1529
|
let i = {
|
|
1530
1530
|
ignoreUnescapedHTML: !1,
|
|
@@ -1536,7 +1536,7 @@ const Ce = rn, Je = te, qe = Symbol("nomatch"), Rt = 7, Ot = function(n) {
|
|
|
1536
1536
|
languages: null,
|
|
1537
1537
|
// beta configuration options, subject to change, welcome to discuss
|
|
1538
1538
|
// https://github.com/highlightjs/highlight.js/issues/1086
|
|
1539
|
-
__emitter:
|
|
1539
|
+
__emitter: Gn
|
|
1540
1540
|
};
|
|
1541
1541
|
function s(b) {
|
|
1542
1542
|
return i.noHighlightRe.test(b);
|
|
@@ -1544,90 +1544,90 @@ const Ce = rn, Je = te, qe = Symbol("nomatch"), Rt = 7, Ot = function(n) {
|
|
|
1544
1544
|
function a(b) {
|
|
1545
1545
|
let N = b.className + " ";
|
|
1546
1546
|
N += b.parentNode ? b.parentNode.className : "";
|
|
1547
|
-
const
|
|
1548
|
-
if (
|
|
1549
|
-
const k = R(
|
|
1550
|
-
return k || (je(t.replace("{}",
|
|
1547
|
+
const O = i.languageDetectRe.exec(N);
|
|
1548
|
+
if (O) {
|
|
1549
|
+
const k = R(O[1]);
|
|
1550
|
+
return k || (je(t.replace("{}", O[1])), je("Falling back to no-highlight mode for this block.", b)), k ? O[1] : "no-highlight";
|
|
1551
1551
|
}
|
|
1552
1552
|
return N.split(/\s+/).find((k) => s(k) || R(k));
|
|
1553
1553
|
}
|
|
1554
|
-
function l(b, N,
|
|
1554
|
+
function l(b, N, O) {
|
|
1555
1555
|
let k = "", x = "";
|
|
1556
|
-
typeof N == "object" ? (k = b,
|
|
1557
|
-
https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N),
|
|
1556
|
+
typeof N == "object" ? (k = b, O = N.ignoreIllegals, x = N.language) : (ae("10.7.0", "highlight(lang, code, ...args) has been deprecated."), ae("10.7.0", `Please use highlight(code, options) instead.
|
|
1557
|
+
https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), O === void 0 && (O = !0);
|
|
1558
1558
|
const W = {
|
|
1559
1559
|
code: k,
|
|
1560
1560
|
language: x
|
|
1561
1561
|
};
|
|
1562
1562
|
G("before:highlight", W);
|
|
1563
|
-
const Y = W.result ? W.result : c(W.language, W.code,
|
|
1563
|
+
const Y = W.result ? W.result : c(W.language, W.code, O);
|
|
1564
1564
|
return Y.code = W.code, G("after:highlight", Y), Y;
|
|
1565
1565
|
}
|
|
1566
|
-
function c(b, N,
|
|
1566
|
+
function c(b, N, O, k) {
|
|
1567
1567
|
const x = /* @__PURE__ */ Object.create(null);
|
|
1568
1568
|
function W(y, A) {
|
|
1569
1569
|
return y.keywords[A];
|
|
1570
1570
|
}
|
|
1571
1571
|
function Y() {
|
|
1572
|
-
if (!
|
|
1572
|
+
if (!L.keywords) {
|
|
1573
1573
|
z.addText(P);
|
|
1574
1574
|
return;
|
|
1575
1575
|
}
|
|
1576
1576
|
let y = 0;
|
|
1577
|
-
|
|
1578
|
-
let A =
|
|
1577
|
+
L.keywordPatternRe.lastIndex = 0;
|
|
1578
|
+
let A = L.keywordPatternRe.exec(P), C = "";
|
|
1579
1579
|
for (; A; ) {
|
|
1580
|
-
|
|
1581
|
-
const B = ne.case_insensitive ? A[0].toLowerCase() : A[0], K = W(
|
|
1580
|
+
C += P.substring(y, A.index);
|
|
1581
|
+
const B = ne.case_insensitive ? A[0].toLowerCase() : A[0], K = W(L, B);
|
|
1582
1582
|
if (K) {
|
|
1583
1583
|
const [X, An] = K;
|
|
1584
|
-
if (z.addText(
|
|
1585
|
-
|
|
1584
|
+
if (z.addText(C), C = "", x[B] = (x[B] || 0) + 1, x[B] <= Ot && (Ee += An), X.startsWith("_"))
|
|
1585
|
+
C += A[0];
|
|
1586
1586
|
else {
|
|
1587
1587
|
const Tn = ne.classNameAliases[X] || X;
|
|
1588
1588
|
z.addKeyword(A[0], Tn);
|
|
1589
1589
|
}
|
|
1590
1590
|
} else
|
|
1591
|
-
|
|
1592
|
-
y =
|
|
1591
|
+
C += A[0];
|
|
1592
|
+
y = L.keywordPatternRe.lastIndex, A = L.keywordPatternRe.exec(P);
|
|
1593
1593
|
}
|
|
1594
|
-
|
|
1594
|
+
C += P.substring(y), z.addText(C);
|
|
1595
1595
|
}
|
|
1596
1596
|
function be() {
|
|
1597
1597
|
if (P === "")
|
|
1598
1598
|
return;
|
|
1599
1599
|
let y = null;
|
|
1600
|
-
if (typeof
|
|
1601
|
-
if (!e[
|
|
1600
|
+
if (typeof L.subLanguage == "string") {
|
|
1601
|
+
if (!e[L.subLanguage]) {
|
|
1602
1602
|
z.addText(P);
|
|
1603
1603
|
return;
|
|
1604
1604
|
}
|
|
1605
|
-
y = c(
|
|
1605
|
+
y = c(L.subLanguage, P, !0, Ke[L.subLanguage]), Ke[L.subLanguage] = /** @type {CompiledMode} */
|
|
1606
1606
|
y._top;
|
|
1607
1607
|
} else
|
|
1608
|
-
y =
|
|
1609
|
-
|
|
1608
|
+
y = h(P, L.subLanguage.length ? L.subLanguage : null);
|
|
1609
|
+
L.relevance > 0 && (Ee += y.relevance), z.addSublanguage(y._emitter, y.language);
|
|
1610
1610
|
}
|
|
1611
1611
|
function Q() {
|
|
1612
|
-
|
|
1612
|
+
L.subLanguage != null ? be() : Y(), P = "";
|
|
1613
1613
|
}
|
|
1614
1614
|
function ee(y, A) {
|
|
1615
|
-
let
|
|
1615
|
+
let C = 1;
|
|
1616
1616
|
const B = A.length - 1;
|
|
1617
|
-
for (;
|
|
1618
|
-
if (!y._emit[
|
|
1619
|
-
|
|
1617
|
+
for (; C <= B; ) {
|
|
1618
|
+
if (!y._emit[C]) {
|
|
1619
|
+
C++;
|
|
1620
1620
|
continue;
|
|
1621
1621
|
}
|
|
1622
|
-
const K = ne.classNameAliases[y[
|
|
1623
|
-
K ? z.addKeyword(X, K) : (P = X, Y(), P = ""),
|
|
1622
|
+
const K = ne.classNameAliases[y[C]] || y[C], X = A[C];
|
|
1623
|
+
K ? z.addKeyword(X, K) : (P = X, Y(), P = ""), C++;
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1627
|
-
return y.scope && typeof y.scope == "string" && z.openNode(ne.classNameAliases[y.scope] || y.scope), y.beginScope && (y.beginScope._wrap ? (z.addKeyword(P, ne.classNameAliases[y.beginScope._wrap] || y.beginScope._wrap), P = "") : y.beginScope._multi && (ee(y.beginScope, A), P = "")),
|
|
1626
|
+
function Fe(y, A) {
|
|
1627
|
+
return y.scope && typeof y.scope == "string" && z.openNode(ne.classNameAliases[y.scope] || y.scope), y.beginScope && (y.beginScope._wrap ? (z.addKeyword(P, ne.classNameAliases[y.beginScope._wrap] || y.beginScope._wrap), P = "") : y.beginScope._multi && (ee(y.beginScope, A), P = "")), L = Object.create(y, { parent: { value: L } }), L;
|
|
1628
1628
|
}
|
|
1629
|
-
function ze(y, A,
|
|
1630
|
-
let B =
|
|
1629
|
+
function ze(y, A, C) {
|
|
1630
|
+
let B = Vn(y.endRe, C);
|
|
1631
1631
|
if (B) {
|
|
1632
1632
|
if (y["on:end"]) {
|
|
1633
1633
|
const K = new Ve(y);
|
|
@@ -1640,42 +1640,42 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1640
1640
|
}
|
|
1641
1641
|
}
|
|
1642
1642
|
if (y.endsWithParent)
|
|
1643
|
-
return ze(y.parent, A,
|
|
1643
|
+
return ze(y.parent, A, C);
|
|
1644
1644
|
}
|
|
1645
1645
|
function mn(y) {
|
|
1646
|
-
return
|
|
1646
|
+
return L.matcher.regexIndex === 0 ? (P += y[0], 1) : (Le = !0, 0);
|
|
1647
1647
|
}
|
|
1648
1648
|
function yn(y) {
|
|
1649
|
-
const A = y[0],
|
|
1649
|
+
const A = y[0], C = y.rule, B = new Ve(C), K = [C.__beforeBegin, C["on:begin"]];
|
|
1650
1650
|
for (const X of K)
|
|
1651
1651
|
if (X && (X(y, B), B.isMatchIgnored))
|
|
1652
1652
|
return mn(A);
|
|
1653
|
-
return
|
|
1653
|
+
return C.skip ? P += A : (C.excludeBegin && (P += A), Q(), !C.returnBegin && !C.excludeBegin && (P = A)), Fe(C, y), C.returnBegin ? 0 : A.length;
|
|
1654
1654
|
}
|
|
1655
1655
|
function wn(y) {
|
|
1656
|
-
const A = y[0],
|
|
1656
|
+
const A = y[0], C = N.substring(y.index), B = ze(L, y, C);
|
|
1657
1657
|
if (!B)
|
|
1658
1658
|
return qe;
|
|
1659
|
-
const K =
|
|
1660
|
-
|
|
1659
|
+
const K = L;
|
|
1660
|
+
L.endScope && L.endScope._wrap ? (Q(), z.addKeyword(A, L.endScope._wrap)) : L.endScope && L.endScope._multi ? (Q(), ee(L.endScope, y)) : K.skip ? P += A : (K.returnEnd || K.excludeEnd || (P += A), Q(), K.excludeEnd && (P = A));
|
|
1661
1661
|
do
|
|
1662
|
-
|
|
1663
|
-
while (
|
|
1664
|
-
return B.starts &&
|
|
1662
|
+
L.scope && z.closeNode(), !L.skip && !L.subLanguage && (Ee += L.relevance), L = L.parent;
|
|
1663
|
+
while (L !== B.parent);
|
|
1664
|
+
return B.starts && Fe(B.starts, y), K.returnEnd ? 0 : A.length;
|
|
1665
1665
|
}
|
|
1666
1666
|
function Nn() {
|
|
1667
1667
|
const y = [];
|
|
1668
|
-
for (let A =
|
|
1668
|
+
for (let A = L; A !== ne; A = A.parent)
|
|
1669
1669
|
A.scope && y.unshift(A.scope);
|
|
1670
1670
|
y.forEach((A) => z.openNode(A));
|
|
1671
1671
|
}
|
|
1672
1672
|
let ve = {};
|
|
1673
1673
|
function Ge(y, A) {
|
|
1674
|
-
const
|
|
1675
|
-
if (P += y,
|
|
1674
|
+
const C = A && A[0];
|
|
1675
|
+
if (P += y, C == null)
|
|
1676
1676
|
return Q(), 0;
|
|
1677
|
-
if (ve.type === "begin" && A.type === "end" && ve.index === A.index &&
|
|
1678
|
-
if (P += N.slice(A.index, A.index + 1), !
|
|
1677
|
+
if (ve.type === "begin" && A.type === "end" && ve.index === A.index && C === "") {
|
|
1678
|
+
if (P += N.slice(A.index, A.index + 1), !g) {
|
|
1679
1679
|
const B = new Error(`0 width match regex (${b})`);
|
|
1680
1680
|
throw B.languageName = b, B.badRule = ve.rule, B;
|
|
1681
1681
|
}
|
|
@@ -1683,36 +1683,36 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1683
1683
|
}
|
|
1684
1684
|
if (ve = A, A.type === "begin")
|
|
1685
1685
|
return yn(A);
|
|
1686
|
-
if (A.type === "illegal" && !
|
|
1687
|
-
const B = new Error('Illegal lexeme "' +
|
|
1688
|
-
throw B.mode =
|
|
1686
|
+
if (A.type === "illegal" && !O) {
|
|
1687
|
+
const B = new Error('Illegal lexeme "' + C + '" for mode "' + (L.scope || "<unnamed>") + '"');
|
|
1688
|
+
throw B.mode = L, B;
|
|
1689
1689
|
} else if (A.type === "end") {
|
|
1690
1690
|
const B = wn(A);
|
|
1691
1691
|
if (B !== qe)
|
|
1692
1692
|
return B;
|
|
1693
1693
|
}
|
|
1694
|
-
if (A.type === "illegal" &&
|
|
1694
|
+
if (A.type === "illegal" && C === "")
|
|
1695
1695
|
return 1;
|
|
1696
1696
|
if (Re > 1e5 && Re > A.index * 3)
|
|
1697
1697
|
throw new Error("potential infinite loop, way more iterations than matches");
|
|
1698
|
-
return P +=
|
|
1698
|
+
return P += C, C.length;
|
|
1699
1699
|
}
|
|
1700
1700
|
const ne = R(b);
|
|
1701
1701
|
if (!ne)
|
|
1702
1702
|
throw ie(t.replace("{}", b)), new Error('Unknown language: "' + b + '"');
|
|
1703
|
-
const Mn =
|
|
1704
|
-
let Se = "",
|
|
1703
|
+
const Mn = Dt(ne);
|
|
1704
|
+
let Se = "", L = k || Mn;
|
|
1705
1705
|
const Ke = {}, z = new i.__emitter(i);
|
|
1706
1706
|
Nn();
|
|
1707
|
-
let P = "", Ee = 0, re = 0, Re = 0,
|
|
1707
|
+
let P = "", Ee = 0, re = 0, Re = 0, Le = !1;
|
|
1708
1708
|
try {
|
|
1709
|
-
for (
|
|
1710
|
-
Re++,
|
|
1711
|
-
const y =
|
|
1709
|
+
for (L.matcher.considerAll(); ; ) {
|
|
1710
|
+
Re++, Le ? Le = !1 : L.matcher.considerAll(), L.matcher.lastIndex = re;
|
|
1711
|
+
const y = L.matcher.exec(N);
|
|
1712
1712
|
if (!y)
|
|
1713
1713
|
break;
|
|
1714
|
-
const A = N.substring(re, y.index),
|
|
1715
|
-
re = y.index +
|
|
1714
|
+
const A = N.substring(re, y.index), C = Ge(A, y);
|
|
1715
|
+
re = y.index + C;
|
|
1716
1716
|
}
|
|
1717
1717
|
return Ge(N.substring(re)), z.closeAllNodes(), z.finalize(), Se = z.toHTML(), {
|
|
1718
1718
|
language: b,
|
|
@@ -1720,13 +1720,13 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1720
1720
|
relevance: Ee,
|
|
1721
1721
|
illegal: !1,
|
|
1722
1722
|
_emitter: z,
|
|
1723
|
-
_top:
|
|
1723
|
+
_top: L
|
|
1724
1724
|
};
|
|
1725
1725
|
} catch (y) {
|
|
1726
1726
|
if (y.message && y.message.includes("Illegal"))
|
|
1727
1727
|
return {
|
|
1728
1728
|
language: b,
|
|
1729
|
-
value:
|
|
1729
|
+
value: Oe(N),
|
|
1730
1730
|
illegal: !0,
|
|
1731
1731
|
relevance: 0,
|
|
1732
1732
|
_illegalBy: {
|
|
@@ -1738,22 +1738,22 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1738
1738
|
},
|
|
1739
1739
|
_emitter: z
|
|
1740
1740
|
};
|
|
1741
|
-
if (
|
|
1741
|
+
if (g)
|
|
1742
1742
|
return {
|
|
1743
1743
|
language: b,
|
|
1744
|
-
value:
|
|
1744
|
+
value: Oe(N),
|
|
1745
1745
|
illegal: !1,
|
|
1746
1746
|
relevance: 0,
|
|
1747
1747
|
errorRaised: y,
|
|
1748
1748
|
_emitter: z,
|
|
1749
|
-
_top:
|
|
1749
|
+
_top: L
|
|
1750
1750
|
};
|
|
1751
1751
|
throw y;
|
|
1752
1752
|
}
|
|
1753
1753
|
}
|
|
1754
1754
|
function f(b) {
|
|
1755
1755
|
const N = {
|
|
1756
|
-
value:
|
|
1756
|
+
value: Oe(b),
|
|
1757
1757
|
illegal: !1,
|
|
1758
1758
|
relevance: 0,
|
|
1759
1759
|
_top: r,
|
|
@@ -1761,12 +1761,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1761
1761
|
};
|
|
1762
1762
|
return N._emitter.addText(b), N;
|
|
1763
1763
|
}
|
|
1764
|
-
function
|
|
1764
|
+
function h(b, N) {
|
|
1765
1765
|
N = N || i.languages || Object.keys(e);
|
|
1766
|
-
const
|
|
1766
|
+
const O = f(b), k = N.filter(R).filter(U).map(
|
|
1767
1767
|
(Q) => c(Q, b, !1)
|
|
1768
1768
|
);
|
|
1769
|
-
k.unshift(
|
|
1769
|
+
k.unshift(O);
|
|
1770
1770
|
const x = k.sort((Q, ee) => {
|
|
1771
1771
|
if (Q.relevance !== ee.relevance)
|
|
1772
1772
|
return ee.relevance - Q.relevance;
|
|
@@ -1780,26 +1780,26 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1780
1780
|
}), [W, Y] = x, be = W;
|
|
1781
1781
|
return be.secondBest = Y, be;
|
|
1782
1782
|
}
|
|
1783
|
-
function
|
|
1784
|
-
const k = N && o[N] ||
|
|
1783
|
+
function d(b, N, O) {
|
|
1784
|
+
const k = N && o[N] || O;
|
|
1785
1785
|
b.classList.add("hljs"), b.classList.add(`language-${k}`);
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1787
|
+
function p(b) {
|
|
1788
1788
|
let N = null;
|
|
1789
|
-
const
|
|
1790
|
-
if (s(
|
|
1789
|
+
const O = a(b);
|
|
1790
|
+
if (s(O))
|
|
1791
1791
|
return;
|
|
1792
1792
|
if (G(
|
|
1793
1793
|
"before:highlightElement",
|
|
1794
|
-
{ el: b, language:
|
|
1794
|
+
{ el: b, language: O }
|
|
1795
1795
|
), b.children.length > 0 && (i.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(b)), i.throwUnescapedHTML))
|
|
1796
|
-
throw new
|
|
1796
|
+
throw new Lt(
|
|
1797
1797
|
"One of your code blocks includes unescaped HTML.",
|
|
1798
1798
|
b.innerHTML
|
|
1799
1799
|
);
|
|
1800
1800
|
N = b;
|
|
1801
|
-
const k = N.textContent, x =
|
|
1802
|
-
b.innerHTML = x.value,
|
|
1801
|
+
const k = N.textContent, x = O ? l(k, { language: O, ignoreIllegals: !0 }) : h(k);
|
|
1802
|
+
b.innerHTML = x.value, d(b, O, x.language), b.result = {
|
|
1803
1803
|
language: x.language,
|
|
1804
1804
|
// TODO: remove with version 11.0
|
|
1805
1805
|
re: x.relevance,
|
|
@@ -1809,7 +1809,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1809
1809
|
relevance: x.secondBest.relevance
|
|
1810
1810
|
}), G("after:highlightElement", { el: b, result: x, text: k });
|
|
1811
1811
|
}
|
|
1812
|
-
function
|
|
1812
|
+
function _(b) {
|
|
1813
1813
|
i = Je(i, b);
|
|
1814
1814
|
}
|
|
1815
1815
|
const v = () => {
|
|
@@ -1824,24 +1824,24 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1824
1824
|
w = !0;
|
|
1825
1825
|
return;
|
|
1826
1826
|
}
|
|
1827
|
-
document.querySelectorAll(i.cssSelector).forEach(
|
|
1827
|
+
document.querySelectorAll(i.cssSelector).forEach(p);
|
|
1828
1828
|
}
|
|
1829
1829
|
function T() {
|
|
1830
1830
|
w && m();
|
|
1831
1831
|
}
|
|
1832
1832
|
typeof window != "undefined" && window.addEventListener && window.addEventListener("DOMContentLoaded", T, !1);
|
|
1833
1833
|
function D(b, N) {
|
|
1834
|
-
let
|
|
1834
|
+
let O = null;
|
|
1835
1835
|
try {
|
|
1836
|
-
|
|
1836
|
+
O = N(n);
|
|
1837
1837
|
} catch (k) {
|
|
1838
|
-
if (ie("Language definition for '{}' could not be registered.".replace("{}", b)),
|
|
1838
|
+
if (ie("Language definition for '{}' could not be registered.".replace("{}", b)), g)
|
|
1839
1839
|
ie(k);
|
|
1840
1840
|
else
|
|
1841
1841
|
throw k;
|
|
1842
|
-
|
|
1842
|
+
O = r;
|
|
1843
1843
|
}
|
|
1844
|
-
|
|
1844
|
+
O.name || (O.name = b), e[b] = O, O.rawDefinition = N.bind(null, n), O.aliases && H(O.aliases, { languageName: b });
|
|
1845
1845
|
}
|
|
1846
1846
|
function M(b) {
|
|
1847
1847
|
delete e[b];
|
|
@@ -1854,9 +1854,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1854
1854
|
function R(b) {
|
|
1855
1855
|
return b = (b || "").toLowerCase(), e[b] || e[o[b]];
|
|
1856
1856
|
}
|
|
1857
|
-
function
|
|
1858
|
-
typeof b == "string" && (b = [b]), b.forEach((
|
|
1859
|
-
o[
|
|
1857
|
+
function H(b, { languageName: N }) {
|
|
1858
|
+
typeof b == "string" && (b = [b]), b.forEach((O) => {
|
|
1859
|
+
o[O.toLowerCase()] = N;
|
|
1860
1860
|
});
|
|
1861
1861
|
}
|
|
1862
1862
|
function U(b) {
|
|
@@ -1874,57 +1874,57 @@ https://github.com/highlightjs/highlight.js/issues/2277`), x = b, k = N), C ===
|
|
|
1874
1874
|
);
|
|
1875
1875
|
});
|
|
1876
1876
|
}
|
|
1877
|
-
function
|
|
1877
|
+
function F(b) {
|
|
1878
1878
|
$(b), u.push(b);
|
|
1879
1879
|
}
|
|
1880
1880
|
function G(b, N) {
|
|
1881
|
-
const
|
|
1881
|
+
const O = b;
|
|
1882
1882
|
u.forEach(function(k) {
|
|
1883
|
-
k[
|
|
1883
|
+
k[O] && k[O](N);
|
|
1884
1884
|
});
|
|
1885
1885
|
}
|
|
1886
|
-
function
|
|
1887
|
-
return ae("10.7.0", "highlightBlock will be removed entirely in v12.0"), ae("10.7.0", "Please use highlightElement now."),
|
|
1886
|
+
function _e(b) {
|
|
1887
|
+
return ae("10.7.0", "highlightBlock will be removed entirely in v12.0"), ae("10.7.0", "Please use highlightElement now."), p(b);
|
|
1888
1888
|
}
|
|
1889
1889
|
Object.assign(n, {
|
|
1890
1890
|
highlight: l,
|
|
1891
|
-
highlightAuto:
|
|
1891
|
+
highlightAuto: h,
|
|
1892
1892
|
highlightAll: m,
|
|
1893
|
-
highlightElement:
|
|
1893
|
+
highlightElement: p,
|
|
1894
1894
|
// TODO: Remove with v12 API
|
|
1895
|
-
highlightBlock:
|
|
1896
|
-
configure:
|
|
1895
|
+
highlightBlock: _e,
|
|
1896
|
+
configure: _,
|
|
1897
1897
|
initHighlighting: v,
|
|
1898
1898
|
initHighlightingOnLoad: E,
|
|
1899
1899
|
registerLanguage: D,
|
|
1900
1900
|
unregisterLanguage: M,
|
|
1901
1901
|
listLanguages: I,
|
|
1902
1902
|
getLanguage: R,
|
|
1903
|
-
registerAliases:
|
|
1903
|
+
registerAliases: H,
|
|
1904
1904
|
autoDetection: U,
|
|
1905
1905
|
inherit: Je,
|
|
1906
|
-
addPlugin:
|
|
1906
|
+
addPlugin: F
|
|
1907
1907
|
}), n.debugMode = function() {
|
|
1908
|
-
|
|
1908
|
+
g = !1;
|
|
1909
1909
|
}, n.safeMode = function() {
|
|
1910
|
-
|
|
1911
|
-
}, n.versionString =
|
|
1910
|
+
g = !0;
|
|
1911
|
+
}, n.versionString = Rt, n.regex = {
|
|
1912
1912
|
concat: se,
|
|
1913
1913
|
lookahead: sn,
|
|
1914
1914
|
either: Pe,
|
|
1915
|
-
optional:
|
|
1916
|
-
anyNumberOfTimes:
|
|
1915
|
+
optional: Wn,
|
|
1916
|
+
anyNumberOfTimes: Kn
|
|
1917
1917
|
};
|
|
1918
1918
|
for (const b in ye)
|
|
1919
1919
|
typeof ye[b] == "object" && Be.exports(ye[b]);
|
|
1920
1920
|
return Object.assign(n, ye), n;
|
|
1921
1921
|
};
|
|
1922
|
-
var he =
|
|
1922
|
+
var he = Ct({}), It = he;
|
|
1923
1923
|
he.HighlightJS = he;
|
|
1924
1924
|
he.default = he;
|
|
1925
|
-
const Z =
|
|
1926
|
-
function
|
|
1927
|
-
const e = n.regex, o = e.concat(/[\p{L}_]/u, e.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), u = /[\p{L}0-9._:-]+/u,
|
|
1925
|
+
const Z = It;
|
|
1926
|
+
function kt(n) {
|
|
1927
|
+
const e = n.regex, o = e.concat(/[\p{L}_]/u, e.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), u = /[\p{L}0-9._:-]+/u, g = {
|
|
1928
1928
|
className: "symbol",
|
|
1929
1929
|
begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
|
|
1930
1930
|
}, t = {
|
|
@@ -1960,12 +1960,12 @@ function Lt(n) {
|
|
|
1960
1960
|
{
|
|
1961
1961
|
begin: /"/,
|
|
1962
1962
|
end: /"/,
|
|
1963
|
-
contains: [
|
|
1963
|
+
contains: [g]
|
|
1964
1964
|
},
|
|
1965
1965
|
{
|
|
1966
1966
|
begin: /'/,
|
|
1967
1967
|
end: /'/,
|
|
1968
|
-
contains: [
|
|
1968
|
+
contains: [g]
|
|
1969
1969
|
},
|
|
1970
1970
|
{ begin: /[^\s"'=<>`]+/ }
|
|
1971
1971
|
]
|
|
@@ -2030,7 +2030,7 @@ function Lt(n) {
|
|
|
2030
2030
|
end: /\]\]>/,
|
|
2031
2031
|
relevance: 10
|
|
2032
2032
|
},
|
|
2033
|
-
|
|
2033
|
+
g,
|
|
2034
2034
|
// xml processing instructions
|
|
2035
2035
|
{
|
|
2036
2036
|
className: "meta",
|
|
@@ -2139,7 +2139,7 @@ function Lt(n) {
|
|
|
2139
2139
|
]
|
|
2140
2140
|
};
|
|
2141
2141
|
}
|
|
2142
|
-
const en = "[A-Za-z$_][0-9A-Za-z$_]*",
|
|
2142
|
+
const en = "[A-Za-z$_][0-9A-Za-z$_]*", Bt = [
|
|
2143
2143
|
"as",
|
|
2144
2144
|
// for exports
|
|
2145
2145
|
"in",
|
|
@@ -2182,7 +2182,7 @@ const en = "[A-Za-z$_][0-9A-Za-z$_]*", It = [
|
|
|
2182
2182
|
"from",
|
|
2183
2183
|
"export",
|
|
2184
2184
|
"extends"
|
|
2185
|
-
],
|
|
2185
|
+
], $t = [
|
|
2186
2186
|
"true",
|
|
2187
2187
|
"false",
|
|
2188
2188
|
"null",
|
|
@@ -2239,7 +2239,7 @@ const en = "[A-Za-z$_][0-9A-Za-z$_]*", It = [
|
|
|
2239
2239
|
"Intl",
|
|
2240
2240
|
// WebAssembly
|
|
2241
2241
|
"WebAssembly"
|
|
2242
|
-
],
|
|
2242
|
+
], pn = [
|
|
2243
2243
|
"Error",
|
|
2244
2244
|
"EvalError",
|
|
2245
2245
|
"InternalError",
|
|
@@ -2248,7 +2248,7 @@ const en = "[A-Za-z$_][0-9A-Za-z$_]*", It = [
|
|
|
2248
2248
|
"SyntaxError",
|
|
2249
2249
|
"TypeError",
|
|
2250
2250
|
"URIError"
|
|
2251
|
-
],
|
|
2251
|
+
], _n = [
|
|
2252
2252
|
"setInterval",
|
|
2253
2253
|
"setTimeout",
|
|
2254
2254
|
"clearInterval",
|
|
@@ -2266,7 +2266,7 @@ const en = "[A-Za-z$_][0-9A-Za-z$_]*", It = [
|
|
|
2266
2266
|
"encodeURIComponent",
|
|
2267
2267
|
"escape",
|
|
2268
2268
|
"unescape"
|
|
2269
|
-
],
|
|
2269
|
+
], Ut = [
|
|
2270
2270
|
"arguments",
|
|
2271
2271
|
"this",
|
|
2272
2272
|
"super",
|
|
@@ -2277,16 +2277,16 @@ const en = "[A-Za-z$_][0-9A-Za-z$_]*", It = [
|
|
|
2277
2277
|
"module",
|
|
2278
2278
|
"global"
|
|
2279
2279
|
// Node.js
|
|
2280
|
-
],
|
|
2281
|
-
|
|
2280
|
+
], Pt = [].concat(
|
|
2281
|
+
_n,
|
|
2282
2282
|
dn,
|
|
2283
|
-
|
|
2283
|
+
pn
|
|
2284
2284
|
);
|
|
2285
|
-
function
|
|
2286
|
-
const e = n.regex, o = (N, { after:
|
|
2285
|
+
function xt(n) {
|
|
2286
|
+
const e = n.regex, o = (N, { after: O }) => {
|
|
2287
2287
|
const k = "</" + N[0].slice(1);
|
|
2288
|
-
return N.input.indexOf(k,
|
|
2289
|
-
}, u = en,
|
|
2288
|
+
return N.input.indexOf(k, O) !== -1;
|
|
2289
|
+
}, u = en, g = {
|
|
2290
2290
|
begin: "<>",
|
|
2291
2291
|
end: "</>"
|
|
2292
2292
|
}, t = /<[A-Za-z0-9\\._:-]+\s*\/>/, r = {
|
|
@@ -2296,7 +2296,7 @@ function Ut(n) {
|
|
|
2296
2296
|
* @param {RegExpMatchArray} match
|
|
2297
2297
|
* @param {CallbackResponse} response
|
|
2298
2298
|
*/
|
|
2299
|
-
isTrulyOpeningTag: (N,
|
|
2299
|
+
isTrulyOpeningTag: (N, O) => {
|
|
2300
2300
|
const k = N[0].length + N.index, x = N.input[k];
|
|
2301
2301
|
if (
|
|
2302
2302
|
// HTML should not include another raw `<` inside a tag
|
|
@@ -2306,27 +2306,27 @@ function Ut(n) {
|
|
|
2306
2306
|
// `<T, A extends keyof T, V>`
|
|
2307
2307
|
x === ","
|
|
2308
2308
|
) {
|
|
2309
|
-
|
|
2309
|
+
O.ignoreMatch();
|
|
2310
2310
|
return;
|
|
2311
2311
|
}
|
|
2312
|
-
x === ">" && (o(N, { after: k }) ||
|
|
2312
|
+
x === ">" && (o(N, { after: k }) || O.ignoreMatch());
|
|
2313
2313
|
let W;
|
|
2314
2314
|
const Y = N.input.substring(k);
|
|
2315
2315
|
if (W = Y.match(/^\s*=/)) {
|
|
2316
|
-
|
|
2316
|
+
O.ignoreMatch();
|
|
2317
2317
|
return;
|
|
2318
2318
|
}
|
|
2319
2319
|
if ((W = Y.match(/^\s+extends\s+/)) && W.index === 0) {
|
|
2320
|
-
|
|
2320
|
+
O.ignoreMatch();
|
|
2321
2321
|
return;
|
|
2322
2322
|
}
|
|
2323
2323
|
}
|
|
2324
2324
|
}, i = {
|
|
2325
2325
|
$pattern: en,
|
|
2326
|
-
keyword:
|
|
2327
|
-
literal:
|
|
2328
|
-
built_in:
|
|
2329
|
-
"variable.language":
|
|
2326
|
+
keyword: Bt,
|
|
2327
|
+
literal: $t,
|
|
2328
|
+
built_in: Pt,
|
|
2329
|
+
"variable.language": Ut
|
|
2330
2330
|
}, s = "[0-9](_?[0-9])*", a = `\\.(${s})`, l = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", c = {
|
|
2331
2331
|
className: "number",
|
|
2332
2332
|
variants: [
|
|
@@ -2351,7 +2351,7 @@ function Ut(n) {
|
|
|
2351
2351
|
keywords: i,
|
|
2352
2352
|
contains: []
|
|
2353
2353
|
// defined later
|
|
2354
|
-
},
|
|
2354
|
+
}, h = {
|
|
2355
2355
|
begin: "html`",
|
|
2356
2356
|
end: "",
|
|
2357
2357
|
starts: {
|
|
@@ -2363,7 +2363,7 @@ function Ut(n) {
|
|
|
2363
2363
|
],
|
|
2364
2364
|
subLanguage: "xml"
|
|
2365
2365
|
}
|
|
2366
|
-
},
|
|
2366
|
+
}, d = {
|
|
2367
2367
|
begin: "css`",
|
|
2368
2368
|
end: "",
|
|
2369
2369
|
starts: {
|
|
@@ -2375,7 +2375,7 @@ function Ut(n) {
|
|
|
2375
2375
|
],
|
|
2376
2376
|
subLanguage: "css"
|
|
2377
2377
|
}
|
|
2378
|
-
},
|
|
2378
|
+
}, p = {
|
|
2379
2379
|
className: "string",
|
|
2380
2380
|
begin: "`",
|
|
2381
2381
|
end: "`",
|
|
@@ -2431,9 +2431,9 @@ function Ut(n) {
|
|
|
2431
2431
|
}, E = [
|
|
2432
2432
|
n.APOS_STRING_MODE,
|
|
2433
2433
|
n.QUOTE_STRING_MODE,
|
|
2434
|
-
|
|
2435
|
-
_,
|
|
2434
|
+
h,
|
|
2436
2435
|
d,
|
|
2436
|
+
p,
|
|
2437
2437
|
// Skip numbers when they are part of a variable name
|
|
2438
2438
|
{ match: /\$\d+/ },
|
|
2439
2439
|
c
|
|
@@ -2521,7 +2521,7 @@ function Ut(n) {
|
|
|
2521
2521
|
_: [
|
|
2522
2522
|
// se we still get relevance credit for JS library classes
|
|
2523
2523
|
...dn,
|
|
2524
|
-
...
|
|
2524
|
+
...pn
|
|
2525
2525
|
]
|
|
2526
2526
|
}
|
|
2527
2527
|
}, I = {
|
|
@@ -2554,7 +2554,7 @@ function Ut(n) {
|
|
|
2554
2554
|
label: "func.def",
|
|
2555
2555
|
contains: [T],
|
|
2556
2556
|
illegal: /%/
|
|
2557
|
-
},
|
|
2557
|
+
}, H = {
|
|
2558
2558
|
relevance: 0,
|
|
2559
2559
|
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
2560
2560
|
className: "variable.constant"
|
|
@@ -2566,7 +2566,7 @@ function Ut(n) {
|
|
|
2566
2566
|
match: e.concat(
|
|
2567
2567
|
/\b/,
|
|
2568
2568
|
U([
|
|
2569
|
-
...
|
|
2569
|
+
..._n,
|
|
2570
2570
|
"super",
|
|
2571
2571
|
"import"
|
|
2572
2572
|
]),
|
|
@@ -2575,7 +2575,7 @@ function Ut(n) {
|
|
|
2575
2575
|
),
|
|
2576
2576
|
className: "title.function",
|
|
2577
2577
|
relevance: 0
|
|
2578
|
-
},
|
|
2578
|
+
}, F = {
|
|
2579
2579
|
begin: e.concat(/\./, e.lookahead(
|
|
2580
2580
|
e.concat(u, /(?![0-9A-Za-z$_(])/)
|
|
2581
2581
|
)),
|
|
@@ -2602,7 +2602,7 @@ function Ut(n) {
|
|
|
2602
2602
|
},
|
|
2603
2603
|
T
|
|
2604
2604
|
]
|
|
2605
|
-
},
|
|
2605
|
+
}, _e = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + n.UNDERSCORE_IDENT_RE + ")\\s*=>", b = {
|
|
2606
2606
|
match: [
|
|
2607
2607
|
/const|var|let/,
|
|
2608
2608
|
/\s+/,
|
|
@@ -2611,7 +2611,7 @@ function Ut(n) {
|
|
|
2611
2611
|
/=\s*/,
|
|
2612
2612
|
/(async\s*)?/,
|
|
2613
2613
|
// async is optional
|
|
2614
|
-
e.lookahead(
|
|
2614
|
+
e.lookahead(_e)
|
|
2615
2615
|
],
|
|
2616
2616
|
keywords: "async",
|
|
2617
2617
|
className: {
|
|
@@ -2638,9 +2638,9 @@ function Ut(n) {
|
|
|
2638
2638
|
I,
|
|
2639
2639
|
n.APOS_STRING_MODE,
|
|
2640
2640
|
n.QUOTE_STRING_MODE,
|
|
2641
|
-
|
|
2642
|
-
_,
|
|
2641
|
+
h,
|
|
2643
2642
|
d,
|
|
2643
|
+
p,
|
|
2644
2644
|
v,
|
|
2645
2645
|
// Skip numbers when they are part of a variable name
|
|
2646
2646
|
{ match: /\$\d+/ },
|
|
@@ -2665,7 +2665,7 @@ function Ut(n) {
|
|
|
2665
2665
|
// we have to count the parens to make sure we actually have the
|
|
2666
2666
|
// correct bounding ( ) before the =>. There could be any number of
|
|
2667
2667
|
// sub-expressions inside also surrounded by parens.
|
|
2668
|
-
begin:
|
|
2668
|
+
begin: _e,
|
|
2669
2669
|
returnBegin: !0,
|
|
2670
2670
|
end: "\\s*=>",
|
|
2671
2671
|
contains: [
|
|
@@ -2705,7 +2705,7 @@ function Ut(n) {
|
|
|
2705
2705
|
{
|
|
2706
2706
|
// JSX
|
|
2707
2707
|
variants: [
|
|
2708
|
-
{ begin:
|
|
2708
|
+
{ begin: g.begin, end: g.end },
|
|
2709
2709
|
{ match: t },
|
|
2710
2710
|
{
|
|
2711
2711
|
begin: r.begin,
|
|
@@ -2751,7 +2751,7 @@ function Ut(n) {
|
|
|
2751
2751
|
match: /\.\.\./,
|
|
2752
2752
|
relevance: 0
|
|
2753
2753
|
},
|
|
2754
|
-
|
|
2754
|
+
F,
|
|
2755
2755
|
// hack: prevents detection of keywords in some circumstances
|
|
2756
2756
|
// .keyword()
|
|
2757
2757
|
// $keyword = x
|
|
@@ -2765,7 +2765,7 @@ function Ut(n) {
|
|
|
2765
2765
|
contains: [T]
|
|
2766
2766
|
},
|
|
2767
2767
|
$,
|
|
2768
|
-
|
|
2768
|
+
H,
|
|
2769
2769
|
D,
|
|
2770
2770
|
G,
|
|
2771
2771
|
{
|
|
@@ -2775,7 +2775,7 @@ function Ut(n) {
|
|
|
2775
2775
|
]
|
|
2776
2776
|
};
|
|
2777
2777
|
}
|
|
2778
|
-
function
|
|
2778
|
+
function Ht(n) {
|
|
2779
2779
|
const e = {
|
|
2780
2780
|
className: "attr",
|
|
2781
2781
|
begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
@@ -2788,7 +2788,7 @@ function Pt(n) {
|
|
|
2788
2788
|
"true",
|
|
2789
2789
|
"false",
|
|
2790
2790
|
"null"
|
|
2791
|
-
],
|
|
2791
|
+
], g = {
|
|
2792
2792
|
scope: "literal",
|
|
2793
2793
|
beginKeywords: u.join(" ")
|
|
2794
2794
|
};
|
|
@@ -2801,7 +2801,7 @@ function Pt(n) {
|
|
|
2801
2801
|
e,
|
|
2802
2802
|
o,
|
|
2803
2803
|
n.QUOTE_STRING_MODE,
|
|
2804
|
-
|
|
2804
|
+
g,
|
|
2805
2805
|
n.C_NUMBER_MODE,
|
|
2806
2806
|
n.C_LINE_COMMENT_MODE,
|
|
2807
2807
|
n.C_BLOCK_COMMENT_MODE
|
|
@@ -2809,7 +2809,7 @@ function Pt(n) {
|
|
|
2809
2809
|
illegal: "\\S"
|
|
2810
2810
|
};
|
|
2811
2811
|
}
|
|
2812
|
-
function
|
|
2812
|
+
function Ft(n) {
|
|
2813
2813
|
const e = "true false yes no null", o = "[\\w#;/?:@&=+$,.~*'()[\\]]+", u = {
|
|
2814
2814
|
className: "attr",
|
|
2815
2815
|
variants: [
|
|
@@ -2823,7 +2823,7 @@ function xt(n) {
|
|
|
2823
2823
|
begin: "'\\w[\\w :\\/.-]*':(?=[ ]|$)"
|
|
2824
2824
|
}
|
|
2825
2825
|
]
|
|
2826
|
-
},
|
|
2826
|
+
}, g = {
|
|
2827
2827
|
className: "template-variable",
|
|
2828
2828
|
variants: [
|
|
2829
2829
|
{
|
|
@@ -2853,7 +2853,7 @@ function xt(n) {
|
|
|
2853
2853
|
],
|
|
2854
2854
|
contains: [
|
|
2855
2855
|
n.BACKSLASH_ESCAPE,
|
|
2856
|
-
|
|
2856
|
+
g
|
|
2857
2857
|
]
|
|
2858
2858
|
}, r = n.inherit(t, { variants: [
|
|
2859
2859
|
{
|
|
@@ -2874,19 +2874,19 @@ function xt(n) {
|
|
|
2874
2874
|
excludeEnd: !0,
|
|
2875
2875
|
keywords: e,
|
|
2876
2876
|
relevance: 0
|
|
2877
|
-
},
|
|
2877
|
+
}, h = {
|
|
2878
2878
|
begin: /\{/,
|
|
2879
2879
|
end: /\}/,
|
|
2880
2880
|
contains: [f],
|
|
2881
2881
|
illegal: "\\n",
|
|
2882
2882
|
relevance: 0
|
|
2883
|
-
},
|
|
2883
|
+
}, d = {
|
|
2884
2884
|
begin: "\\[",
|
|
2885
2885
|
end: "\\]",
|
|
2886
2886
|
contains: [f],
|
|
2887
2887
|
illegal: "\\n",
|
|
2888
2888
|
relevance: 0
|
|
2889
|
-
},
|
|
2889
|
+
}, p = [
|
|
2890
2890
|
u,
|
|
2891
2891
|
{
|
|
2892
2892
|
className: "meta",
|
|
@@ -2962,18 +2962,18 @@ function xt(n) {
|
|
|
2962
2962
|
begin: n.C_NUMBER_RE + "\\b",
|
|
2963
2963
|
relevance: 0
|
|
2964
2964
|
},
|
|
2965
|
-
|
|
2966
|
-
|
|
2965
|
+
h,
|
|
2966
|
+
d,
|
|
2967
2967
|
t
|
|
2968
|
-
],
|
|
2969
|
-
return
|
|
2968
|
+
], _ = [...p];
|
|
2969
|
+
return _.pop(), _.push(r), f.contains = _, {
|
|
2970
2970
|
name: "YAML",
|
|
2971
2971
|
case_insensitive: !0,
|
|
2972
2972
|
aliases: ["yml"],
|
|
2973
|
-
contains:
|
|
2973
|
+
contains: p
|
|
2974
2974
|
};
|
|
2975
2975
|
}
|
|
2976
|
-
function
|
|
2976
|
+
function zt(n) {
|
|
2977
2977
|
return {
|
|
2978
2978
|
name: "Plain text",
|
|
2979
2979
|
aliases: [
|
|
@@ -2983,7 +2983,7 @@ function Ft(n) {
|
|
|
2983
2983
|
disableAutodetect: !0
|
|
2984
2984
|
};
|
|
2985
2985
|
}
|
|
2986
|
-
function
|
|
2986
|
+
function Gt(n) {
|
|
2987
2987
|
const e = n.regex, o = /[\p{XID_Start}_]\p{XID_Continue}*/u, u = [
|
|
2988
2988
|
"and",
|
|
2989
2989
|
"as",
|
|
@@ -3209,7 +3209,7 @@ function Ht(n) {
|
|
|
3209
3209
|
n.APOS_STRING_MODE,
|
|
3210
3210
|
n.QUOTE_STRING_MODE
|
|
3211
3211
|
]
|
|
3212
|
-
}, f = "[0-9](_?[0-9])*",
|
|
3212
|
+
}, f = "[0-9](_?[0-9])*", h = `(\\b(${f}))?\\.(${f})|\\b(${f})\\.`, d = `\\b|${u.join("|")}`, p = {
|
|
3213
3213
|
className: "number",
|
|
3214
3214
|
relevance: 0,
|
|
3215
3215
|
variants: [
|
|
@@ -3224,10 +3224,10 @@ function Ht(n) {
|
|
|
3224
3224
|
// because both MUST contain a decimal point and so cannot be confused with
|
|
3225
3225
|
// the interior part of an identifier
|
|
3226
3226
|
{
|
|
3227
|
-
begin: `(\\b(${f})|(${
|
|
3227
|
+
begin: `(\\b(${f})|(${h}))[eE][+-]?(${f})[jJ]?(?=${d})`
|
|
3228
3228
|
},
|
|
3229
3229
|
{
|
|
3230
|
-
begin: `(${
|
|
3230
|
+
begin: `(${h})[jJ]?`
|
|
3231
3231
|
},
|
|
3232
3232
|
// decinteger, bininteger, octinteger, hexinteger
|
|
3233
3233
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals
|
|
@@ -3236,24 +3236,24 @@ function Ht(n) {
|
|
|
3236
3236
|
// decinteger is optionally imaginary
|
|
3237
3237
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
|
|
3238
3238
|
{
|
|
3239
|
-
begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${
|
|
3239
|
+
begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`
|
|
3240
3240
|
},
|
|
3241
3241
|
{
|
|
3242
|
-
begin: `\\b0[bB](_?[01])+[lL]?(?=${
|
|
3242
|
+
begin: `\\b0[bB](_?[01])+[lL]?(?=${d})`
|
|
3243
3243
|
},
|
|
3244
3244
|
{
|
|
3245
|
-
begin: `\\b0[oO](_?[0-7])+[lL]?(?=${
|
|
3245
|
+
begin: `\\b0[oO](_?[0-7])+[lL]?(?=${d})`
|
|
3246
3246
|
},
|
|
3247
3247
|
{
|
|
3248
|
-
begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${
|
|
3248
|
+
begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`
|
|
3249
3249
|
},
|
|
3250
3250
|
// imagnumber (digitpart-based)
|
|
3251
3251
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
|
|
3252
3252
|
{
|
|
3253
|
-
begin: `\\b(${f})[jJ](?=${
|
|
3253
|
+
begin: `\\b(${f})[jJ](?=${d})`
|
|
3254
3254
|
}
|
|
3255
3255
|
]
|
|
3256
|
-
},
|
|
3256
|
+
}, _ = {
|
|
3257
3257
|
className: "comment",
|
|
3258
3258
|
begin: e.lookahead(/# type:/),
|
|
3259
3259
|
end: /$/,
|
|
@@ -3288,7 +3288,7 @@ function Ht(n) {
|
|
|
3288
3288
|
contains: [
|
|
3289
3289
|
"self",
|
|
3290
3290
|
s,
|
|
3291
|
-
|
|
3291
|
+
p,
|
|
3292
3292
|
c,
|
|
3293
3293
|
n.HASH_COMMENT_MODE
|
|
3294
3294
|
]
|
|
@@ -3297,7 +3297,7 @@ function Ht(n) {
|
|
|
3297
3297
|
};
|
|
3298
3298
|
return a.contains = [
|
|
3299
3299
|
c,
|
|
3300
|
-
|
|
3300
|
+
p,
|
|
3301
3301
|
s
|
|
3302
3302
|
], {
|
|
3303
3303
|
name: "Python",
|
|
@@ -3311,7 +3311,7 @@ function Ht(n) {
|
|
|
3311
3311
|
illegal: /(<\/|->|\?)|=>/,
|
|
3312
3312
|
contains: [
|
|
3313
3313
|
s,
|
|
3314
|
-
|
|
3314
|
+
p,
|
|
3315
3315
|
{
|
|
3316
3316
|
// very common convention
|
|
3317
3317
|
begin: /\bself\b/
|
|
@@ -3323,7 +3323,7 @@ function Ht(n) {
|
|
|
3323
3323
|
relevance: 0
|
|
3324
3324
|
},
|
|
3325
3325
|
c,
|
|
3326
|
-
|
|
3326
|
+
_,
|
|
3327
3327
|
n.HASH_COMMENT_MODE,
|
|
3328
3328
|
{
|
|
3329
3329
|
match: [
|
|
@@ -3369,7 +3369,7 @@ function Ht(n) {
|
|
|
3369
3369
|
begin: /^[\t ]*@/,
|
|
3370
3370
|
end: /(?=#)|$/,
|
|
3371
3371
|
contains: [
|
|
3372
|
-
|
|
3372
|
+
p,
|
|
3373
3373
|
v,
|
|
3374
3374
|
c
|
|
3375
3375
|
]
|
|
@@ -3403,7 +3403,7 @@ var oe = "[0-9](_*[0-9])*", we = `\\.(${oe})`, Ne = "[0-9a-fA-F](_*[0-9a-fA-F])*
|
|
|
3403
3403
|
function bn(n, e, o) {
|
|
3404
3404
|
return o === -1 ? "" : n.replace(e, (u) => bn(n, e, o - 1));
|
|
3405
3405
|
}
|
|
3406
|
-
function
|
|
3406
|
+
function Kt(n) {
|
|
3407
3407
|
const e = n.regex, o = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", u = o + bn("(?:<" + o + "~~~(?:\\s*,\\s*" + o + "~~~)*>)?", /~~~/g, 2), s = {
|
|
3408
3408
|
keyword: [
|
|
3409
3409
|
"synchronized",
|
|
@@ -3612,7 +3612,7 @@ function zt(n) {
|
|
|
3612
3612
|
]
|
|
3613
3613
|
};
|
|
3614
3614
|
}
|
|
3615
|
-
function
|
|
3615
|
+
function Wt(n) {
|
|
3616
3616
|
const e = n.regex, o = {}, u = {
|
|
3617
3617
|
begin: /\$\{/,
|
|
3618
3618
|
end: /\}/,
|
|
@@ -3637,7 +3637,7 @@ function Gt(n) {
|
|
|
3637
3637
|
u
|
|
3638
3638
|
]
|
|
3639
3639
|
});
|
|
3640
|
-
const
|
|
3640
|
+
const g = {
|
|
3641
3641
|
className: "subst",
|
|
3642
3642
|
begin: /\$\(/,
|
|
3643
3643
|
end: /\)/,
|
|
@@ -3658,10 +3658,10 @@ function Gt(n) {
|
|
|
3658
3658
|
contains: [
|
|
3659
3659
|
n.BACKSLASH_ESCAPE,
|
|
3660
3660
|
o,
|
|
3661
|
-
|
|
3661
|
+
g
|
|
3662
3662
|
]
|
|
3663
3663
|
};
|
|
3664
|
-
|
|
3664
|
+
g.contains.push(r);
|
|
3665
3665
|
const i = {
|
|
3666
3666
|
className: "",
|
|
3667
3667
|
begin: /\\"/
|
|
@@ -3699,7 +3699,7 @@ function Gt(n) {
|
|
|
3699
3699
|
returnBegin: !0,
|
|
3700
3700
|
contains: [n.inherit(n.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
|
|
3701
3701
|
relevance: 0
|
|
3702
|
-
},
|
|
3702
|
+
}, h = [
|
|
3703
3703
|
"if",
|
|
3704
3704
|
"then",
|
|
3705
3705
|
"else",
|
|
@@ -3713,10 +3713,10 @@ function Gt(n) {
|
|
|
3713
3713
|
"case",
|
|
3714
3714
|
"esac",
|
|
3715
3715
|
"function"
|
|
3716
|
-
],
|
|
3716
|
+
], d = [
|
|
3717
3717
|
"true",
|
|
3718
3718
|
"false"
|
|
3719
|
-
],
|
|
3719
|
+
], p = { match: /(\/[a-z._-]+)+/ }, _ = [
|
|
3720
3720
|
"break",
|
|
3721
3721
|
"cd",
|
|
3722
3722
|
"continue",
|
|
@@ -3936,10 +3936,10 @@ function Gt(n) {
|
|
|
3936
3936
|
aliases: ["sh"],
|
|
3937
3937
|
keywords: {
|
|
3938
3938
|
$pattern: /\b[a-z][a-z0-9._-]+\b/,
|
|
3939
|
-
keyword:
|
|
3940
|
-
literal:
|
|
3939
|
+
keyword: h,
|
|
3940
|
+
literal: d,
|
|
3941
3941
|
built_in: [
|
|
3942
|
-
...
|
|
3942
|
+
..._,
|
|
3943
3943
|
...v,
|
|
3944
3944
|
// Shell modifiers
|
|
3945
3945
|
"set",
|
|
@@ -3957,7 +3957,7 @@ function Gt(n) {
|
|
|
3957
3957
|
a,
|
|
3958
3958
|
n.HASH_COMMENT_MODE,
|
|
3959
3959
|
t,
|
|
3960
|
-
|
|
3960
|
+
p,
|
|
3961
3961
|
r,
|
|
3962
3962
|
i,
|
|
3963
3963
|
s,
|
|
@@ -3965,7 +3965,7 @@ function Gt(n) {
|
|
|
3965
3965
|
]
|
|
3966
3966
|
};
|
|
3967
3967
|
}
|
|
3968
|
-
function
|
|
3968
|
+
function Qt(n) {
|
|
3969
3969
|
const e = n.regex, o = n.COMMENT("--", "$"), u = {
|
|
3970
3970
|
className: "string",
|
|
3971
3971
|
variants: [
|
|
@@ -3975,7 +3975,7 @@ function Kt(n) {
|
|
|
3975
3975
|
contains: [{ begin: /''/ }]
|
|
3976
3976
|
}
|
|
3977
3977
|
]
|
|
3978
|
-
},
|
|
3978
|
+
}, g = {
|
|
3979
3979
|
begin: /"/,
|
|
3980
3980
|
end: /"/,
|
|
3981
3981
|
contains: [{ begin: /""/ }]
|
|
@@ -4514,20 +4514,20 @@ function Kt(n) {
|
|
|
4514
4514
|
"nulls last",
|
|
4515
4515
|
"depth first",
|
|
4516
4516
|
"breadth first"
|
|
4517
|
-
],
|
|
4517
|
+
], h = l, d = [
|
|
4518
4518
|
...a,
|
|
4519
4519
|
...s
|
|
4520
|
-
].filter((w) => !l.includes(w)),
|
|
4520
|
+
].filter((w) => !l.includes(w)), p = {
|
|
4521
4521
|
className: "variable",
|
|
4522
4522
|
begin: /@[a-z0-9]+/
|
|
4523
|
-
},
|
|
4523
|
+
}, _ = {
|
|
4524
4524
|
className: "operator",
|
|
4525
4525
|
begin: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
|
|
4526
4526
|
relevance: 0
|
|
4527
4527
|
}, v = {
|
|
4528
|
-
begin: e.concat(/\b/, e.either(...
|
|
4528
|
+
begin: e.concat(/\b/, e.either(...h), /\s*\(/),
|
|
4529
4529
|
relevance: 0,
|
|
4530
|
-
keywords: { built_in:
|
|
4530
|
+
keywords: { built_in: h }
|
|
4531
4531
|
};
|
|
4532
4532
|
function E(w, {
|
|
4533
4533
|
exceptions: m,
|
|
@@ -4543,7 +4543,7 @@ function Kt(n) {
|
|
|
4543
4543
|
illegal: /[{}]|<\//,
|
|
4544
4544
|
keywords: {
|
|
4545
4545
|
$pattern: /\b[\w\.]+/,
|
|
4546
|
-
keyword: E(
|
|
4546
|
+
keyword: E(d, { when: (w) => w.length < 3 }),
|
|
4547
4547
|
literal: t,
|
|
4548
4548
|
type: i,
|
|
4549
4549
|
built_in: c
|
|
@@ -4554,7 +4554,7 @@ function Kt(n) {
|
|
|
4554
4554
|
relevance: 0,
|
|
4555
4555
|
keywords: {
|
|
4556
4556
|
$pattern: /[\w\.]+/,
|
|
4557
|
-
keyword:
|
|
4557
|
+
keyword: d.concat(f),
|
|
4558
4558
|
literal: t,
|
|
4559
4559
|
type: i
|
|
4560
4560
|
}
|
|
@@ -4564,31 +4564,31 @@ function Kt(n) {
|
|
|
4564
4564
|
begin: e.either(...r)
|
|
4565
4565
|
},
|
|
4566
4566
|
v,
|
|
4567
|
-
|
|
4567
|
+
p,
|
|
4568
4568
|
u,
|
|
4569
|
-
|
|
4569
|
+
g,
|
|
4570
4570
|
n.C_NUMBER_MODE,
|
|
4571
4571
|
n.C_BLOCK_COMMENT_MODE,
|
|
4572
4572
|
o,
|
|
4573
|
-
|
|
4573
|
+
_
|
|
4574
4574
|
]
|
|
4575
4575
|
};
|
|
4576
4576
|
}
|
|
4577
|
-
Z.registerLanguage("xml",
|
|
4578
|
-
Z.registerLanguage("javascript",
|
|
4579
|
-
Z.registerLanguage("json",
|
|
4580
|
-
Z.registerLanguage("yaml",
|
|
4581
|
-
Z.registerLanguage("plaintext",
|
|
4582
|
-
Z.registerLanguage("python",
|
|
4583
|
-
Z.registerLanguage("java",
|
|
4584
|
-
Z.registerLanguage("bash",
|
|
4585
|
-
Z.registerLanguage("sql",
|
|
4577
|
+
Z.registerLanguage("xml", kt);
|
|
4578
|
+
Z.registerLanguage("javascript", xt);
|
|
4579
|
+
Z.registerLanguage("json", Ht);
|
|
4580
|
+
Z.registerLanguage("yaml", Ft);
|
|
4581
|
+
Z.registerLanguage("plaintext", zt);
|
|
4582
|
+
Z.registerLanguage("python", Gt);
|
|
4583
|
+
Z.registerLanguage("java", Kt);
|
|
4584
|
+
Z.registerLanguage("bash", Wt);
|
|
4585
|
+
Z.registerLanguage("sql", Qt);
|
|
4586
4586
|
var S = /* @__PURE__ */ ((n) => (n.EQUAL = "equal", n.DELETE = "removed", n.ADD = "added", n.EMPTY = "empty", n))(S || {});
|
|
4587
|
-
const j = "<code-diff-modified>", J = "</code-diff-modified>",
|
|
4588
|
-
(
|
|
4587
|
+
const j = "<code-diff-modified>", J = "</code-diff-modified>", Vt = j.replace("<", "<").replace(">", ">"), Zt = J.replace("<", "<").replace(">", ">"), le = (n) => n === void 0 ? S.EQUAL : n.added ? S.ADD : n.removed ? S.DELETE : S.EQUAL, Te = (n, e, o = "word") => typeof n == "undefined" ? e : typeof e == "undefined" ? n : (o === "char" ? In : Bn)(n, e).filter((g) => le(g) !== S.DELETE).map(
|
|
4588
|
+
(g) => le(g) === S.ADD ? `${j}${g.value}${J}` : g.value
|
|
4589
4589
|
).join("");
|
|
4590
4590
|
function vn(n, e) {
|
|
4591
|
-
const o = new ce.diff_match_patch(), u = o.diff_linesToChars_(n, e),
|
|
4591
|
+
const o = new ce.diff_match_patch(), u = o.diff_linesToChars_(n, e), g = u.chars1, t = u.chars2, r = u.lineArray, i = o.diff_main(g, t, !1);
|
|
4592
4592
|
return o.diff_charsToLines_(i, r), i.map((s) => {
|
|
4593
4593
|
const [a, l] = s;
|
|
4594
4594
|
return {
|
|
@@ -4604,8 +4604,8 @@ const V = (n, e) => {
|
|
|
4604
4604
|
if (!e.match(new RegExp(`(${j}|${J})`, "g")))
|
|
4605
4605
|
return Z.highlight(e, { language: n }).value;
|
|
4606
4606
|
let u = e;
|
|
4607
|
-
const
|
|
4608
|
-
t.innerHTML = Z.highlight(
|
|
4607
|
+
const g = e.replace(new RegExp(`(${j}|${J})`, "g"), ""), t = document.createElement("div");
|
|
4608
|
+
t.innerHTML = Z.highlight(g, { language: n }).value;
|
|
4609
4609
|
let r = !1;
|
|
4610
4610
|
const i = (s) => {
|
|
4611
4611
|
s.childNodes.forEach((a) => {
|
|
@@ -4622,38 +4622,38 @@ const V = (n, e) => {
|
|
|
4622
4622
|
u = u.slice(J.length), c = c + J, r = !1;
|
|
4623
4623
|
continue;
|
|
4624
4624
|
}
|
|
4625
|
-
const f = u.match(new RegExp(`(${j}|${J})`)),
|
|
4626
|
-
c = c + u.substring(0,
|
|
4625
|
+
const f = u.match(new RegExp(`(${j}|${J})`)), h = f && f.index ? f.index : u.length, d = Math.min(h, l.length);
|
|
4626
|
+
c = c + u.substring(0, d), u = u.slice(d), l = l.slice(d);
|
|
4627
4627
|
}
|
|
4628
4628
|
r && (c = c + J), a.textContent = c;
|
|
4629
4629
|
}
|
|
4630
4630
|
});
|
|
4631
4631
|
};
|
|
4632
|
-
return i(t), t.innerHTML.replace(new RegExp(
|
|
4632
|
+
return i(t), t.innerHTML.replace(new RegExp(Vt, "g"), '<span class="x">').replace(new RegExp(Zt, "g"), "</span>");
|
|
4633
4633
|
};
|
|
4634
4634
|
function En(n) {
|
|
4635
|
-
const e = (
|
|
4635
|
+
const e = (g, t) => (g.match(new RegExp(t, "g")) || []).length;
|
|
4636
4636
|
let o = 0, u = 0;
|
|
4637
|
-
for (const
|
|
4638
|
-
|
|
4639
|
-
`) + 1),
|
|
4637
|
+
for (const g of n)
|
|
4638
|
+
g.added && (o += e(g.value.trim(), `
|
|
4639
|
+
`) + 1), g.removed && (u += e(g.value.trim(), `
|
|
4640
4640
|
`) + 1);
|
|
4641
4641
|
return { additionsNum: o, deletionsNum: u };
|
|
4642
4642
|
}
|
|
4643
|
-
function
|
|
4644
|
-
|
|
4645
|
-
const t = () => ({ type: S.EMPTY }), r = (d, p, v) => ({ type: d, num: p, code: v }), i = vn(n, e);
|
|
4643
|
+
function Yt(n, e, o = "plaintext", u = "word", g = 10) {
|
|
4644
|
+
const t = () => ({ type: S.EMPTY }), r = (p, _, v) => ({ type: p, num: _, code: v }), i = vn(n, e);
|
|
4646
4645
|
let s = 0, a = 0, l = !1;
|
|
4647
4646
|
const c = [], f = {
|
|
4648
4647
|
changes: c,
|
|
4648
|
+
collector: [],
|
|
4649
4649
|
stat: En(i)
|
|
4650
4650
|
};
|
|
4651
|
-
for (let
|
|
4651
|
+
for (let p = 0; p < i.length; p++) {
|
|
4652
4652
|
if (l) {
|
|
4653
4653
|
l = !1;
|
|
4654
4654
|
continue;
|
|
4655
4655
|
}
|
|
4656
|
-
const [
|
|
4656
|
+
const [_, v] = [i[p], i[p + 1]], [E, w] = [le(_), le(v)], m = _.value.replace(/\n$/, "").split(`
|
|
4657
4657
|
`);
|
|
4658
4658
|
if (v === void 0) {
|
|
4659
4659
|
for (const D of m) {
|
|
@@ -4683,11 +4683,11 @@ function Vt(n, e, o = "plaintext", u = "word", h = 10) {
|
|
|
4683
4683
|
});
|
|
4684
4684
|
if (w === S.ADD) {
|
|
4685
4685
|
l = !0;
|
|
4686
|
-
const D = Math.max(
|
|
4686
|
+
const D = Math.max(_.count, v.count);
|
|
4687
4687
|
for (let M = 0; M < D; M++) {
|
|
4688
|
-
M <
|
|
4689
|
-
const [I, R] = [m[M], T[M]],
|
|
4690
|
-
c.push({ left: $, right:
|
|
4688
|
+
M < _.count && s++, M < v.count && a++;
|
|
4689
|
+
const [I, R] = [m[M], T[M]], H = m.length === T.length ? Te(R, I, u) : I, U = m.length === T.length ? Te(I, R, u) : R, $ = M < _.count ? r(S.DELETE, s, V(o, H)) : t(), F = M < v.count ? r(S.ADD, a, V(o, U)) : t();
|
|
4690
|
+
c.push({ left: $, right: F });
|
|
4691
4691
|
}
|
|
4692
4692
|
}
|
|
4693
4693
|
}
|
|
@@ -4699,67 +4699,74 @@ function Vt(n, e, o = "plaintext", u = "word", h = 10) {
|
|
|
4699
4699
|
});
|
|
4700
4700
|
}
|
|
4701
4701
|
if (n === e) {
|
|
4702
|
-
for (let
|
|
4703
|
-
c[
|
|
4702
|
+
for (let p = 0; p < c.length; p++)
|
|
4703
|
+
c[p].fold = !1;
|
|
4704
4704
|
return f;
|
|
4705
4705
|
}
|
|
4706
|
-
for (let
|
|
4707
|
-
const
|
|
4708
|
-
if (
|
|
4709
|
-
const [v, E] = [Math.max(
|
|
4706
|
+
for (let p = 0; p < c.length; p++) {
|
|
4707
|
+
const _ = c[p];
|
|
4708
|
+
if (_.left.type === S.DELETE || _.right.type === S.ADD) {
|
|
4709
|
+
const [v, E] = [Math.max(p - g, 0), Math.min(p + g + 1, c.length)];
|
|
4710
4710
|
for (let w = v; w < E; w++)
|
|
4711
4711
|
c[w].fold = !1;
|
|
4712
4712
|
}
|
|
4713
|
-
|
|
4713
|
+
_.fold === void 0 && (_.fold = !0);
|
|
4714
4714
|
}
|
|
4715
|
-
const
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4715
|
+
const h = [];
|
|
4716
|
+
let d = [];
|
|
4717
|
+
for (let p = 0; p < c.length; p++) {
|
|
4718
|
+
const _ = c[p];
|
|
4719
|
+
if (_.fold === !1) {
|
|
4720
|
+
d.length && (d[0].hideIndex = f.collector.length, f.collector.push({
|
|
4721
|
+
lines: d,
|
|
4722
|
+
fold: !0
|
|
4723
|
+
}), d = []), h.push(_);
|
|
4720
4724
|
continue;
|
|
4721
4725
|
}
|
|
4722
|
-
|
|
4726
|
+
_.hide = !0, d.push(_), h.push(_);
|
|
4723
4727
|
}
|
|
4724
|
-
return
|
|
4728
|
+
return d.length && (d[0].hideIndex = f.collector.length, f.collector.push({
|
|
4729
|
+
lines: d,
|
|
4730
|
+
fold: !0
|
|
4731
|
+
}), d = []), f.changes = h, f;
|
|
4725
4732
|
}
|
|
4726
|
-
function
|
|
4727
|
-
var f;
|
|
4733
|
+
function Xt(n, e, o = "plaintext", u = "word", g = 10) {
|
|
4728
4734
|
const t = vn(n, e);
|
|
4729
4735
|
let r = 0, i = 0, s = !1;
|
|
4730
4736
|
const a = [], l = {
|
|
4731
4737
|
changes: a,
|
|
4738
|
+
collector: [],
|
|
4732
4739
|
stat: En(t)
|
|
4733
4740
|
};
|
|
4734
|
-
for (let
|
|
4741
|
+
for (let h = 0; h < t.length; h++) {
|
|
4735
4742
|
if (s) {
|
|
4736
4743
|
s = !1;
|
|
4737
4744
|
continue;
|
|
4738
4745
|
}
|
|
4739
|
-
const [
|
|
4746
|
+
const [d, p] = [t[h], t[h + 1]], [_, v] = [le(d), le(p)], E = d.value.replace(/\n$/, "").split(`
|
|
4740
4747
|
`);
|
|
4741
|
-
if (
|
|
4748
|
+
if (p === void 0) {
|
|
4742
4749
|
for (const m of E) {
|
|
4743
|
-
|
|
4750
|
+
_ === S.EQUAL && (r++, i++), _ === S.DELETE && r++, _ === S.ADD && i++;
|
|
4744
4751
|
const T = V(o, m);
|
|
4745
4752
|
a.push({
|
|
4746
|
-
type:
|
|
4753
|
+
type: _,
|
|
4747
4754
|
code: T,
|
|
4748
|
-
addNum:
|
|
4749
|
-
delNum:
|
|
4755
|
+
addNum: _ === S.DELETE ? void 0 : i,
|
|
4756
|
+
delNum: _ === S.ADD ? void 0 : r
|
|
4750
4757
|
});
|
|
4751
4758
|
}
|
|
4752
4759
|
break;
|
|
4753
4760
|
}
|
|
4754
|
-
if (
|
|
4761
|
+
if (_ === S.EQUAL)
|
|
4755
4762
|
for (const m of E) {
|
|
4756
4763
|
r++, i++;
|
|
4757
4764
|
const T = V(o, m);
|
|
4758
4765
|
a.push({ type: S.EQUAL, code: T, delNum: r, addNum: i });
|
|
4759
4766
|
}
|
|
4760
|
-
const w =
|
|
4767
|
+
const w = p.value.replace(/\n$/, "").split(`
|
|
4761
4768
|
`);
|
|
4762
|
-
if (
|
|
4769
|
+
if (_ === S.DELETE)
|
|
4763
4770
|
if (v === S.ADD && E.length === w.length) {
|
|
4764
4771
|
for (let m = 0; m < E.length; m++) {
|
|
4765
4772
|
const T = E[m], D = w[m];
|
|
@@ -4780,66 +4787,74 @@ function Zt(n, e, o = "plaintext", u = "word", h = 10) {
|
|
|
4780
4787
|
const T = V(o, m);
|
|
4781
4788
|
a.push({ type: S.DELETE, code: T, delNum: r });
|
|
4782
4789
|
}
|
|
4783
|
-
if (
|
|
4790
|
+
if (_ === S.ADD)
|
|
4784
4791
|
for (const m of E) {
|
|
4785
4792
|
i++;
|
|
4786
4793
|
const T = V(o, m);
|
|
4787
4794
|
a.push({ type: S.ADD, code: T, addNum: i });
|
|
4788
4795
|
}
|
|
4789
4796
|
}
|
|
4790
|
-
for (let
|
|
4791
|
-
const
|
|
4792
|
-
if (
|
|
4793
|
-
const [
|
|
4794
|
-
for (let v =
|
|
4797
|
+
for (let h = 0; h < a.length; h++) {
|
|
4798
|
+
const d = a[h];
|
|
4799
|
+
if (d.type === S.DELETE || d.type === S.ADD) {
|
|
4800
|
+
const [p, _] = [Math.max(h - g, 0), Math.min(h + g + 1, a.length)];
|
|
4801
|
+
for (let v = p; v < _; v++)
|
|
4795
4802
|
a[v].fold = !1;
|
|
4796
4803
|
}
|
|
4797
|
-
|
|
4804
|
+
d.fold === void 0 && (d.fold = !0);
|
|
4798
4805
|
}
|
|
4799
4806
|
if (n === e) {
|
|
4800
|
-
for (let
|
|
4801
|
-
a[
|
|
4807
|
+
for (let h = 0; h < a.length; h++)
|
|
4808
|
+
a[h].fold = !1;
|
|
4802
4809
|
return l;
|
|
4803
4810
|
}
|
|
4804
4811
|
const c = [];
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4812
|
+
let f = [];
|
|
4813
|
+
for (let h = 0; h < a.length; h++) {
|
|
4814
|
+
const d = a[h];
|
|
4815
|
+
if (d.fold === !1) {
|
|
4816
|
+
f.length && (f[0].hideIndex = l.collector.length, l.collector.push({
|
|
4817
|
+
lines: f,
|
|
4818
|
+
fold: !0
|
|
4819
|
+
}), f = []), c.push(d);
|
|
4809
4820
|
continue;
|
|
4810
4821
|
}
|
|
4811
|
-
|
|
4822
|
+
d.type === "equal" && (d.hide = !0, f.push(d)), c.push(d);
|
|
4812
4823
|
}
|
|
4813
|
-
return
|
|
4824
|
+
return f.length && (f[0].hideIndex = l.collector.length, l.collector.push({
|
|
4825
|
+
lines: f,
|
|
4826
|
+
fold: !0
|
|
4827
|
+
}), f = []), l.changes = c, l;
|
|
4814
4828
|
}
|
|
4815
|
-
const
|
|
4829
|
+
const jt = /* @__PURE__ */ de({
|
|
4816
4830
|
__name: "UnifiedLine",
|
|
4817
4831
|
props: {
|
|
4818
4832
|
line: null
|
|
4819
4833
|
},
|
|
4820
|
-
|
|
4821
|
-
|
|
4834
|
+
emits: ["expand"],
|
|
4835
|
+
setup(n, { emit: e }) {
|
|
4836
|
+
return { __sfc: !0, props: n, emit: e, getCodeMarker: (g) => g === S.DELETE ? "-" : g === S.ADD ? "+" : "", DiffType: S };
|
|
4822
4837
|
}
|
|
4823
4838
|
});
|
|
4824
|
-
function
|
|
4839
|
+
function pe(n, e, o, u, g, t, r, i) {
|
|
4825
4840
|
var s = typeof n == "function" ? n.options : n;
|
|
4826
4841
|
e && (s.render = e, s.staticRenderFns = o, s._compiled = !0), u && (s.functional = !0), t && (s._scopeId = "data-v-" + t);
|
|
4827
4842
|
var a;
|
|
4828
4843
|
if (r ? (a = function(f) {
|
|
4829
4844
|
f = f || // cached call
|
|
4830
4845
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
4831
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !f && typeof __VUE_SSR_CONTEXT__ != "undefined" && (f = __VUE_SSR_CONTEXT__),
|
|
4832
|
-
}, s._ssrRegister = a) :
|
|
4833
|
-
|
|
4846
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !f && typeof __VUE_SSR_CONTEXT__ != "undefined" && (f = __VUE_SSR_CONTEXT__), g && g.call(this, f), f && f._registeredComponents && f._registeredComponents.add(r);
|
|
4847
|
+
}, s._ssrRegister = a) : g && (a = i ? function() {
|
|
4848
|
+
g.call(
|
|
4834
4849
|
this,
|
|
4835
4850
|
(s.functional ? this.parent : this).$root.$options.shadowRoot
|
|
4836
4851
|
);
|
|
4837
|
-
} :
|
|
4852
|
+
} : g), a)
|
|
4838
4853
|
if (s.functional) {
|
|
4839
4854
|
s._injectStyles = a;
|
|
4840
4855
|
var l = s.render;
|
|
4841
|
-
s.render = function(
|
|
4842
|
-
return a.call(
|
|
4856
|
+
s.render = function(h, d) {
|
|
4857
|
+
return a.call(d), l(h, d);
|
|
4843
4858
|
};
|
|
4844
4859
|
} else {
|
|
4845
4860
|
var c = s.beforeCreate;
|
|
@@ -4850,116 +4865,140 @@ function _e(n, e, o, u, h, t, r, i) {
|
|
|
4850
4865
|
options: s
|
|
4851
4866
|
};
|
|
4852
4867
|
}
|
|
4853
|
-
var
|
|
4868
|
+
var Jt = function() {
|
|
4854
4869
|
var e = this, o = e._self._c, u = e._self._setupProxy;
|
|
4855
|
-
return e.line.
|
|
4870
|
+
return e.line.hideIndex !== void 0 && e.line.hide ? o("tr", [o("td", { staticClass: "blob-num blob-num-hunk text-center", attrs: { colspan: "2" }, on: { click: function(g) {
|
|
4871
|
+
return u.emit("expand", e.line);
|
|
4872
|
+
} } }, [e._v(" > ")]), o("td", { staticClass: "blob-code blob-code-hunk", attrs: { align: "left" } }, [e._v(" ⋯ ")])]) : e.line.hide ? e._e() : o("tr", [o("td", { staticClass: "blob-num", class: {
|
|
4856
4873
|
"blob-num-deletion": e.line.type === u.DiffType.DELETE,
|
|
4857
4874
|
"blob-num-addition": e.line.type === u.DiffType.ADD,
|
|
4858
|
-
"blob-num-context": e.line.type === u.DiffType.EQUAL
|
|
4875
|
+
"blob-num-context": e.line.type === u.DiffType.EQUAL,
|
|
4876
|
+
"blob-num-hunk": e.line.hide !== void 0
|
|
4859
4877
|
} }, [e._v(" " + e._s(e.line.delNum) + " ")]), o("td", { staticClass: "blob-num", class: {
|
|
4860
4878
|
"blob-num-deletion": e.line.type === u.DiffType.DELETE,
|
|
4861
4879
|
"blob-num-addition": e.line.type === u.DiffType.ADD,
|
|
4862
|
-
"blob-num-context": e.line.type === u.DiffType.EQUAL
|
|
4880
|
+
"blob-num-context": e.line.type === u.DiffType.EQUAL,
|
|
4881
|
+
"blob-num-hunk": e.line.hide !== void 0
|
|
4863
4882
|
} }, [e._v(" " + e._s(e.line.addNum) + " ")]), o("td", { staticClass: "blob-code", class: {
|
|
4864
4883
|
"blob-code-deletion": e.line.type === u.DiffType.DELETE,
|
|
4865
4884
|
"blob-code-addition": e.line.type === u.DiffType.ADD,
|
|
4866
|
-
"blob-code-context": e.line.type === u.DiffType.EQUAL
|
|
4885
|
+
"blob-code-context": e.line.type === u.DiffType.EQUAL,
|
|
4886
|
+
"blob-code-hunk": e.line.hide !== void 0
|
|
4867
4887
|
} }, [o("span", { staticClass: "blob-code-inner blob-code-marker", attrs: { "data-code-marker": u.getCodeMarker(e.line.type) }, domProps: { innerHTML: e._s(e.line.code) } })])]);
|
|
4868
|
-
},
|
|
4869
|
-
Yt,
|
|
4870
|
-
Xt,
|
|
4888
|
+
}, qt = [], er = /* @__PURE__ */ pe(
|
|
4871
4889
|
jt,
|
|
4890
|
+
Jt,
|
|
4891
|
+
qt,
|
|
4872
4892
|
!1,
|
|
4873
4893
|
null,
|
|
4874
4894
|
null,
|
|
4875
4895
|
null,
|
|
4876
4896
|
null
|
|
4877
4897
|
);
|
|
4878
|
-
const
|
|
4898
|
+
const nr = er.exports, tr = /* @__PURE__ */ de({
|
|
4879
4899
|
__name: "UnifiedViewer",
|
|
4880
4900
|
props: {
|
|
4881
4901
|
diffChange: null
|
|
4882
4902
|
},
|
|
4883
4903
|
setup(n) {
|
|
4884
|
-
|
|
4904
|
+
const e = n;
|
|
4905
|
+
function o({ hideIndex: u }) {
|
|
4906
|
+
u !== void 0 && e.diffChange.collector[u].lines.forEach((g) => {
|
|
4907
|
+
g.hide = !1, g.fold = !1;
|
|
4908
|
+
});
|
|
4909
|
+
}
|
|
4910
|
+
return { __sfc: !0, props: e, expandHandler: o, UnifiedLine: nr };
|
|
4885
4911
|
}
|
|
4886
4912
|
});
|
|
4887
|
-
var
|
|
4913
|
+
var rr = function() {
|
|
4914
|
+
var g;
|
|
4888
4915
|
var e = this, o = e._self._c, u = e._self._setupProxy;
|
|
4889
|
-
return o("table", { staticClass: "diff-table" }, [o("tbody", e._l(e.diffChange, function(
|
|
4890
|
-
return o(u.UnifiedLine, { key:
|
|
4916
|
+
return o("table", { staticClass: "diff-table" }, [o("tbody", e._l((g = e.diffChange) == null ? void 0 : g.changes, function(t, r) {
|
|
4917
|
+
return o(u.UnifiedLine, { key: r, attrs: { line: t }, on: { expand: u.expandHandler } });
|
|
4891
4918
|
}), 1)]);
|
|
4892
|
-
},
|
|
4893
|
-
er,
|
|
4894
|
-
nr,
|
|
4919
|
+
}, ir = [], sr = /* @__PURE__ */ pe(
|
|
4895
4920
|
tr,
|
|
4921
|
+
rr,
|
|
4922
|
+
ir,
|
|
4896
4923
|
!1,
|
|
4897
4924
|
null,
|
|
4898
|
-
"
|
|
4925
|
+
"238e1326",
|
|
4899
4926
|
null,
|
|
4900
4927
|
null
|
|
4901
4928
|
);
|
|
4902
|
-
const
|
|
4929
|
+
const ar = sr.exports, or = /* @__PURE__ */ de({
|
|
4903
4930
|
__name: "SplitLine",
|
|
4904
4931
|
props: {
|
|
4905
4932
|
splitLine: null
|
|
4906
4933
|
},
|
|
4907
|
-
|
|
4908
|
-
|
|
4934
|
+
emits: ["expand"],
|
|
4935
|
+
setup(n, { emit: e }) {
|
|
4936
|
+
return { __sfc: !0, props: n, emit: e, getCodeMarker: (g) => g === S.DELETE ? "-" : g === S.ADD ? "+" : "", DiffType: S };
|
|
4909
4937
|
}
|
|
4910
4938
|
});
|
|
4911
|
-
var
|
|
4939
|
+
var lr = function() {
|
|
4912
4940
|
var e = this, o = e._self._c, u = e._self._setupProxy;
|
|
4913
|
-
return e.splitLine.
|
|
4914
|
-
return
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
"blob-num-
|
|
4918
|
-
|
|
4919
|
-
"blob-
|
|
4920
|
-
"blob-
|
|
4921
|
-
|
|
4922
|
-
|
|
4941
|
+
return e.splitLine.hideIndex !== void 0 && e.splitLine.hide ? o("tr", [o("td", { staticClass: "blob-num blob-num-hunk", attrs: { colspan: "1" }, on: { click: function(g) {
|
|
4942
|
+
return u.emit("expand", e.splitLine);
|
|
4943
|
+
} } }, [e._v(" > ")]), o("td", { staticClass: "blob-code blob-code-inner blob-code-hunk", attrs: { colspan: "3", align: "left" } }, [e._v(" ⋯ ")])]) : e.splitLine.hide ? e._e() : o("tr", [e._l([e.splitLine.left, e.splitLine.right], function(g) {
|
|
4944
|
+
return [g.type === u.DiffType.EMPTY ? [o("td", { staticClass: "blob-num blob-num-empty empty-cell" }), o("td", { staticClass: "blob-code blob-code-empty empty-cell" })] : [o("td", { staticClass: "blob-num", class: {
|
|
4945
|
+
"blob-num-deletion": g.type === u.DiffType.DELETE,
|
|
4946
|
+
"blob-num-addition": g.type === u.DiffType.ADD,
|
|
4947
|
+
"blob-num-context": g.type === u.DiffType.EQUAL,
|
|
4948
|
+
"blob-num-hunk": e.splitLine.hide !== void 0
|
|
4949
|
+
} }, [e._v(" " + e._s(g.num) + " ")]), o("td", { staticClass: "blob-code", class: {
|
|
4950
|
+
"blob-code-deletion": g.type === u.DiffType.DELETE,
|
|
4951
|
+
"blob-code-addition": g.type === u.DiffType.ADD,
|
|
4952
|
+
"blob-code-context": g.type === u.DiffType.EQUAL,
|
|
4953
|
+
"blob-code-hunk": e.splitLine.hide !== void 0
|
|
4954
|
+
} }, [o("span", { staticClass: "blob-code-inner blob-code-marker", attrs: { "data-code-marker": u.getCodeMarker(g.type) }, domProps: { innerHTML: e._s(g.code) } })])]];
|
|
4923
4955
|
})], 2);
|
|
4924
|
-
},
|
|
4925
|
-
sr,
|
|
4926
|
-
ar,
|
|
4956
|
+
}, cr = [], ur = /* @__PURE__ */ pe(
|
|
4927
4957
|
or,
|
|
4958
|
+
lr,
|
|
4959
|
+
cr,
|
|
4928
4960
|
!1,
|
|
4929
4961
|
null,
|
|
4930
4962
|
null,
|
|
4931
4963
|
null,
|
|
4932
4964
|
null
|
|
4933
4965
|
);
|
|
4934
|
-
const
|
|
4966
|
+
const fr = ur.exports, gr = /* @__PURE__ */ de({
|
|
4935
4967
|
__name: "SplitViewer",
|
|
4936
4968
|
props: {
|
|
4937
4969
|
diffChange: null
|
|
4938
4970
|
},
|
|
4939
4971
|
setup(n) {
|
|
4940
|
-
|
|
4972
|
+
const e = n;
|
|
4973
|
+
function o({ hideIndex: u }) {
|
|
4974
|
+
u !== void 0 && e.diffChange.collector[u].lines.forEach((g) => {
|
|
4975
|
+
g.hide = !1, g.fold = !1;
|
|
4976
|
+
});
|
|
4977
|
+
}
|
|
4978
|
+
return { __sfc: !0, props: e, expandHandler: o, SplitLine: fr };
|
|
4941
4979
|
}
|
|
4942
4980
|
});
|
|
4943
|
-
var
|
|
4981
|
+
var hr = function() {
|
|
4982
|
+
var g;
|
|
4944
4983
|
var e = this, o = e._self._c, u = e._self._setupProxy;
|
|
4945
|
-
return o("table", { staticClass: "file-diff-split diff-table" }, [e._m(0), o("tbody", e._l(e.diffChange, function(
|
|
4946
|
-
return o(u.SplitLine, { key:
|
|
4984
|
+
return o("table", { staticClass: "file-diff-split diff-table" }, [e._m(0), o("tbody", e._l((g = e.diffChange) == null ? void 0 : g.changes, function(t, r) {
|
|
4985
|
+
return o(u.SplitLine, { key: r, attrs: { "split-line": t }, on: { expand: u.expandHandler } });
|
|
4947
4986
|
}), 1)]);
|
|
4948
|
-
},
|
|
4987
|
+
}, dr = [function() {
|
|
4949
4988
|
var n = this, e = n._self._c;
|
|
4950
4989
|
return n._self._setupProxy, e("colgroup", [e("col", { attrs: { width: "44" } }), e("col"), e("col", { attrs: { width: "44" } }), e("col")]);
|
|
4951
|
-
}],
|
|
4952
|
-
ur,
|
|
4953
|
-
fr,
|
|
4990
|
+
}], pr = /* @__PURE__ */ pe(
|
|
4954
4991
|
gr,
|
|
4992
|
+
hr,
|
|
4993
|
+
dr,
|
|
4955
4994
|
!1,
|
|
4956
4995
|
null,
|
|
4957
|
-
"
|
|
4996
|
+
"829edc33",
|
|
4958
4997
|
null,
|
|
4959
4998
|
null
|
|
4960
4999
|
);
|
|
4961
|
-
const
|
|
4962
|
-
const
|
|
5000
|
+
const _r = pr.exports;
|
|
5001
|
+
const br = /* @__PURE__ */ de({
|
|
4963
5002
|
__name: "CodeDiff",
|
|
4964
5003
|
props: {
|
|
4965
5004
|
newString: null,
|
|
@@ -4975,39 +5014,41 @@ const _r = /* @__PURE__ */ de({
|
|
|
4975
5014
|
},
|
|
4976
5015
|
setup(n) {
|
|
4977
5016
|
const e = n, o = me(() => e.outputFormat === "line-by-line"), u = me(() => {
|
|
4978
|
-
const
|
|
4979
|
-
return e.noDiffLineFeed ?
|
|
4980
|
-
`) :
|
|
4981
|
-
}),
|
|
4982
|
-
const
|
|
4983
|
-
return e.noDiffLineFeed ?
|
|
4984
|
-
`) :
|
|
5017
|
+
const i = e.trim ? e.oldString.trim() : e.oldString;
|
|
5018
|
+
return e.noDiffLineFeed ? i.replace(/(\r\n)/g, `
|
|
5019
|
+
`) : i;
|
|
5020
|
+
}), g = me(() => {
|
|
5021
|
+
const i = e.trim ? e.newString.trim() : e.newString;
|
|
5022
|
+
return e.noDiffLineFeed ? i.replace(/(\r\n)/g, `
|
|
5023
|
+
`) : i;
|
|
4985
5024
|
}), t = me(
|
|
4986
|
-
() => o.value ?
|
|
4987
|
-
);
|
|
4988
|
-
return
|
|
5025
|
+
() => o.value ? Xt(u.value, g.value, e.language, e.diffStyle, e.context) : Yt(u.value, g.value, e.language, e.diffStyle, e.context)
|
|
5026
|
+
), r = Sn(t.value);
|
|
5027
|
+
return Rn(() => e, () => {
|
|
5028
|
+
r.value = t.value;
|
|
5029
|
+
}, { deep: !0 }), { __sfc: !0, props: e, isUnifiedViewer: o, oldString: u, newString: g, raw: t, diffChange: r, UnifiedViewer: ar, SplitViewer: _r };
|
|
4989
5030
|
}
|
|
4990
5031
|
});
|
|
4991
|
-
var
|
|
5032
|
+
var vr = function() {
|
|
4992
5033
|
var e = this, o = e._self._c, u = e._self._setupProxy;
|
|
4993
|
-
return o("div", { staticClass: "code-diff-view", style: { maxHeight: e.maxHeight } }, [o("div", { staticClass: "file-header" }, [o("div", { staticClass: "file-info" }, [o("span", { staticClass: "filename" }, [e._v(e._s(e.filename))]), o("span", { staticClass: "diff-stat" }, [o("span", { staticClass: "diff-stat-added" }, [e._v("+" + e._s(u.diffChange.stat.additionsNum) + " additions")]), o("span", { staticClass: "diff-stat-deleted", staticStyle: { "margin-left": "8px" } }, [e._v("-" + e._s(u.diffChange.stat.deletionsNum) + " deletions")])])])]), u.isUnifiedViewer ? o(u.UnifiedViewer, { attrs: { "diff-change": u.diffChange
|
|
4994
|
-
},
|
|
4995
|
-
_r,
|
|
4996
|
-
pr,
|
|
5034
|
+
return o("div", { staticClass: "code-diff-view", style: { maxHeight: e.maxHeight } }, [o("div", { staticClass: "file-header" }, [o("div", { staticClass: "file-info" }, [o("span", { staticClass: "filename" }, [e._v(e._s(e.filename))]), o("span", { staticClass: "diff-stat" }, [o("span", { staticClass: "diff-stat-added" }, [e._v("+" + e._s(u.diffChange.stat.additionsNum) + " additions")]), o("span", { staticClass: "diff-stat-deleted", staticStyle: { "margin-left": "8px" } }, [e._v("-" + e._s(u.diffChange.stat.deletionsNum) + " deletions")])])])]), u.isUnifiedViewer ? o(u.UnifiedViewer, { attrs: { "diff-change": u.diffChange } }) : o(u.SplitViewer, { attrs: { "diff-change": u.diffChange } })], 1);
|
|
5035
|
+
}, Er = [], mr = /* @__PURE__ */ pe(
|
|
4997
5036
|
br,
|
|
5037
|
+
vr,
|
|
5038
|
+
Er,
|
|
4998
5039
|
!1,
|
|
4999
5040
|
null,
|
|
5000
5041
|
null,
|
|
5001
5042
|
null,
|
|
5002
5043
|
null
|
|
5003
5044
|
);
|
|
5004
|
-
const
|
|
5005
|
-
n.component("CodeDiff",
|
|
5006
|
-
},
|
|
5007
|
-
install:
|
|
5045
|
+
const yr = mr.exports, wr = (n) => {
|
|
5046
|
+
n.component("CodeDiff", yr);
|
|
5047
|
+
}, Mr = {
|
|
5048
|
+
install: wr,
|
|
5008
5049
|
hljs: Z
|
|
5009
5050
|
};
|
|
5010
5051
|
export {
|
|
5011
|
-
|
|
5012
|
-
|
|
5052
|
+
yr as CodeDiff,
|
|
5053
|
+
Mr as default
|
|
5013
5054
|
};
|