n8n-editor-ui 1.103.1 → 1.104.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActionDropdown-BhU4vCrE.js → ActionDropdown-DkHCqhLi.js} +1 -1
- package/dist/assets/{AnimatedSpinner-Du5eXSIY.js → AnimatedSpinner-D6j3zAN7.js} +1 -1
- package/dist/assets/{AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-DEQTwSbx.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-CeptN1qB.js} +1 -1
- package/dist/assets/{AuthView-BJ-YTYTN.js → AuthView-DdzGr3if.js} +2 -2
- package/dist/assets/{ChangePasswordView-B-OkU_yr.js → ChangePasswordView-CLbLuldY.js} +3 -3
- package/dist/assets/CollectionParameter-C3JIvBsy.js +4 -0
- package/dist/assets/ConsumedTokensDetails.vue_vue_type_script_setup_true_lang-DwQ0BmLY.js +44 -0
- package/dist/assets/{CredentialsView-BjUZvEdd.js → CredentialsView-Cbm8N2D-.js} +8 -8
- package/dist/assets/{DemoFooter-9WRPL1Nd.js → DemoFooter-DlHqx3Wb.js} +9 -8
- package/dist/assets/{EmptySharedSectionActionBox.vue_vue_type_script_setup_true_lang-D3Zaxt4S.js → EmptySharedSectionActionBox.vue_vue_type_script_setup_true_lang-Dymz7mm-.js} +1 -1
- package/dist/assets/{EntityNotFound-DvAk0XOf.js → EntityNotFound-CmBDOsai.js} +1 -1
- package/dist/assets/{EntityUnAuthorised-BTLaJBAA.js → EntityUnAuthorised-CNPmvmZu.js} +1 -1
- package/dist/assets/{ErrorView-KDDRlAEN.js → ErrorView-BqgIhqko.js} +1 -1
- package/dist/assets/{EvaluationsRootView-BViIGqmh.js → EvaluationsRootView-B6RDbMu9.js} +5 -3
- package/dist/assets/{EvaluationsView-6l_Invxt.css → EvaluationsView-BTyYfInB.css} +6 -6
- package/dist/assets/{EvaluationsView-BY0HmUSo.js → EvaluationsView-nr07_JFX.js} +53 -40
- package/dist/assets/{ExecutionsTime-DkME6I3E.css → ExecutionsTime-Bo7IOE5K.css} +6 -6
- package/dist/assets/{ExecutionsTime.vue_vue_type_script_setup_true_lang-Dz1TldYs.js → ExecutionsTime.vue_vue_type_script_setup_true_lang-Ci1SWv1r.js} +15 -12
- package/dist/assets/{ExecutionsView-z5GL4TFM.js → ExecutionsView-L8QB4qb-.js} +21 -18
- package/dist/assets/{FileSaver.min-BRpMoNCX.js → FileSaver.min-CiFUM_59.js} +1 -1
- package/dist/assets/{FixedCollectionParameter-BW_7bc6a.js → FixedCollectionParameter-BMsoLNRT.js} +1 -1
- package/dist/assets/{ForgotMyPasswordView-C3yPX8Sm.js → ForgotMyPasswordView-BYKQXHHe.js} +3 -3
- package/dist/assets/{InfoAccordion-B3ebdljQ.js → InfoAccordion-DN17_QNh.js} +1 -1
- package/dist/assets/{InsightsChartAverageRuntime-B07vNUKi.js → InsightsChartAverageRuntime-DX6MWomC.js} +5 -4
- package/dist/assets/{InsightsChartFailed-vwVIlrMM.js → InsightsChartFailed-D1ITW7ip.js} +5 -4
- package/dist/assets/{InsightsChartFailureRate-3R9NR__K.js → InsightsChartFailureRate-DsoCFhrx.js} +5 -4
- package/dist/assets/{InsightsChartTimeSaved-0XAZRsQL.js → InsightsChartTimeSaved-Cwb0-EZ1.js} +5 -4
- package/dist/assets/{InsightsChartTotal-QtHpPQPx.js → InsightsChartTotal-B-SjjDG4.js} +5 -4
- package/dist/assets/{InsightsDashboard-CXbI-Jyg.css → InsightsDashboard-C27Avzrv.css} +2 -2
- package/dist/assets/{InsightsDashboard-jAR8co6U.js → InsightsDashboard-DEaMMGfn.js} +19 -19
- package/dist/assets/{InsightsPaywall-CqlSj87d.js → InsightsPaywall-BsiLaxNd.js} +3 -3
- package/dist/assets/{InsightsSummary-1EyHgtD2.js → InsightsSummary-hBcY77J_.js} +9 -4
- package/dist/assets/{InsightsTableWorkflows-RGpSnp7n.css → InsightsTableWorkflows-BTHSCwX8.css} +27 -3
- package/dist/assets/{InsightsTableWorkflows-CMfER3Lz.js → InsightsTableWorkflows-D9vFPmUm.js} +80 -26
- package/dist/assets/{Logo-BAbynr3J.js → Logo-D-nqGbZ-.js} +1 -1
- package/dist/assets/{LogsPanel-C4P2jfja.js → LogsPanel-D0QGW50a.js} +16 -11
- package/dist/assets/{LogsPanel-Bvy4ANV7.css → LogsPanel-D0xdq4fV.css} +21 -21
- package/dist/assets/{MainHeader-2VAdoAN3.js → MainHeader-QpSmh7DV.js} +17 -16
- package/dist/assets/{MainHeader-DYYEm7nF.css → MainHeader-qSHM1Rvp.css} +12 -12
- package/dist/assets/{MainSidebar-CaLHZgDB.css → MainSidebar-D74VZmM5.css} +7 -8
- package/dist/assets/{MainSidebar-ChT_fvtq.js → MainSidebar-Dndr9Vcx.js} +26 -25
- package/dist/assets/{N8nDataTableServer-CUJVgPuN.js → N8nDataTableServer-B4Gq_Urn.js} +20 -10
- package/dist/assets/{NodeCreation-B0_VqZl0.js → NodeCreation-CRGHu2mV.js} +11 -9
- package/dist/assets/{NodeCreator-Dudc-sld.js → NodeCreator-BvleRmX-.js} +114 -197
- package/dist/assets/{NodeCreator-DWE25utr.css → NodeCreator-CkvY2niF.css} +0 -128
- package/dist/assets/{NodeDetailsView-D3jGDk45.js → NodeDetailsView-xvbRzTfv.js} +21 -16
- package/dist/assets/{NodeDetailsViewV2-B0iyvHRQ.js → NodeDetailsViewV2-CBY4UJcE.js} +21 -16
- package/dist/assets/{NodeView-CX3GlUP1.js → NodeView-Dm74W6kN.js} +2068 -746
- package/dist/assets/{NodeView-hst6fesm.css → NodeView-G2qfXaOy.css} +755 -71
- package/dist/assets/{ProjectHeader-CBBQ32Nc.js → ProjectHeader-0NxiEwQl.js} +2 -2
- package/dist/assets/{ProjectSettings-D7CCWy0v.js → ProjectSettings-ClM6Y9uS.js} +7 -5
- package/dist/assets/{PushConnectionTracker.vue_vue_type_script_setup_true_lang-aTaPuBRW.js → PushConnectionTracker.vue_vue_type_script_setup_true_lang-D5JeFl_d.js} +1 -1
- package/dist/assets/{ResourcesListLayout-CR6jD0wL.js → ResourcesListLayout-BRro9C-1.js} +3 -3
- package/dist/assets/{RunDataJson-PZfvyEtF.js → RunDataJson-12Py20Rs.js} +6 -7
- package/dist/assets/{RunDataJsonActions-BmrxonyU.js → RunDataJsonActions-BGl8YYU0.js} +1 -1
- package/dist/assets/{RunDataParsedAiContent-b0irqoyM.js → RunDataParsedAiContent-DYz5OPxJ.js} +2 -2
- package/dist/assets/{RunDataSearch-DS17rPDS.js → RunDataSearch-NmwtxOjZ.js} +1 -1
- package/dist/assets/{RunDataTable-DgBV9mGl.js → RunDataTable-DJu8Ut0r.js} +17 -17
- package/dist/assets/{SamlOnboarding-COuXHYGq.js → SamlOnboarding-B5vqtns9.js} +3 -3
- package/dist/assets/{SettingsApiView-Bjmx5RKa.js → SettingsApiView-DmOvPlm6.js} +5 -4
- package/dist/assets/{SettingsCommunityNodesView-JkmQWaRv.js → SettingsCommunityNodesView-DEgzWHlF.js} +4 -3
- package/dist/assets/{SettingsExternalSecrets-unJLQHhU.js → SettingsExternalSecrets-4VNCsQKo.js} +5 -3
- package/dist/assets/{SettingsLdapView-DvZbXhb2.js → SettingsLdapView-BSQe5yy-.js} +1 -1
- package/dist/assets/{SettingsLogStreamingView-DT_BpBbv.js → SettingsLogStreamingView-Y-ve-MUB.js} +1 -1
- package/dist/assets/{SettingsPersonalView-D0VCYPEd.js → SettingsPersonalView-DTWO2GIc.js} +1 -1
- package/dist/assets/{SettingsSourceControl-CatnTfFf.js → SettingsSourceControl-D14mBzgS.js} +10 -8
- package/dist/assets/{SettingsSso-CxWN7WTJ.js → SettingsSso-Beon1K6u.js} +1 -1
- package/dist/assets/{SettingsUsageAndPlan-D6TiPwUx.css → SettingsUsageAndPlan-ZZQpCmyQ.css} +3 -3
- package/dist/assets/{SettingsUsageAndPlan-BMsLzUeh.js → SettingsUsageAndPlan-hc6EFbHM.js} +15 -10
- package/dist/assets/{SettingsUsersView-hbKTH9np.js → SettingsUsersView-CIzwxl6-.js} +105 -44
- package/dist/assets/{SettingsUsersView-B81cHl3f.css → SettingsUsersView-RQTdLxyb.css} +11 -7
- package/dist/assets/{SettingsView-C3FWxmaD.js → SettingsView-Bv-AL-MH.js} +1 -1
- package/dist/assets/{SetupView-DdjBoiKa.js → SetupView-BCKg0AbF.js} +3 -3
- package/dist/assets/{SetupWorkflowCredentialsButton-BX8a8Tuq.js → SetupWorkflowCredentialsButton-djsoNbvZ.js} +1 -1
- package/dist/assets/{SetupWorkflowFromTemplateView-D9BTRma8.js → SetupWorkflowFromTemplateView-CZhYUSco.js} +3 -3
- package/dist/assets/{SigninView-D8iOgwLO.js → SigninView-BPl0jjB0.js} +3 -3
- package/dist/assets/{SignoutView-DXt0Sdaq.js → SignoutView-BHPz3HFX.js} +1 -1
- package/dist/assets/{SignupView-D6pEOFGY.js → SignupView-Cel8_b46.js} +3 -3
- package/dist/assets/{TableBase-6tpR_KYY.js → TableBase-BIT7ArUw.js} +1 -1
- package/dist/assets/{Tags-3OtmQZg1.js → Tags-CQIEP_IZ.js} +1 -1
- package/dist/assets/{TemplateDetails-Bvec_Syb.js → TemplateDetails-B8u34j2l.js} +2 -2
- package/dist/assets/{TemplateList-B0_W0uvx.js → TemplateList-BJSJYiHs.js} +1 -1
- package/dist/assets/{TemplatesCollectionView-ChXD8R-e.js → TemplatesCollectionView-BCAAV1n9.js} +6 -6
- package/dist/assets/{TemplatesSearchView-B_cMlFlv.js → TemplatesSearchView-CXOrNnyk.js} +3 -3
- package/dist/assets/{TemplatesView-CziYbcJq.js → TemplatesView-1HunP4nN.js} +1 -1
- package/dist/assets/{TemplatesWorkflowView-Hb4zWBu5.js → TemplatesWorkflowView-0enp4pR7.js} +6 -6
- package/dist/assets/{TriggerPanel-BsmQ9v2s.js → TriggerPanel-B-Jt4r3F.js} +133 -981
- package/dist/assets/{TriggerPanel-DRpKKKun.css → TriggerPanel-DJv04feX.css} +1 -354
- package/dist/assets/{VariablesView-WOzl2JBK.js → VariablesView-mSWZzDyf.js} +5 -5
- package/dist/assets/VueMarkdown-Dxf59_T_.js +1570 -0
- package/dist/assets/{WorkerView-C0gI6gbP.js → WorkerView-DbqNyqok.js} +6 -5
- package/dist/assets/{WorkflowActivator-B96_pQnb.js → WorkflowActivator-C33REd8m.js} +2 -2
- package/dist/assets/{WorkflowExecutionsInfoAccordion-DFCLkh95.js → WorkflowExecutionsInfoAccordion-CCe9jbiT.js} +2 -2
- package/dist/assets/{WorkflowExecutionsLandingPage-B3aM2Zsk.js → WorkflowExecutionsLandingPage-DMXVsIHS.js} +3 -3
- package/dist/assets/{WorkflowExecutionsPreview-D6oMyJtk.js → WorkflowExecutionsPreview-Dit3_l9q.js} +5 -5
- package/dist/assets/{WorkflowExecutionsView-BiKDjD1D.js → WorkflowExecutionsView-BwLTPvQ7.js} +8 -8
- package/dist/assets/{WorkflowHistory-CgxAK62K.js → WorkflowHistory-BgNzJgze.js} +6 -6
- package/dist/assets/{WorkflowOnboardingView-tKN781CD.js → WorkflowOnboardingView-Bnvmd6lJ.js} +1 -1
- package/dist/assets/{WorkflowPreview-CDgvgZcr.js → WorkflowPreview-DIDMhnNP.js} +1 -1
- package/dist/assets/{WorkflowsView-zxJZKrLk.js → WorkflowsView-DxtULRby.js} +125 -17
- package/dist/assets/aiTemplatesStarterCollection.store-DrHWcqtc.js +795 -0
- package/dist/assets/{chartjs.utils-EXdTT15A.js → chartjs.utils-DQHNgzzp.js} +2 -2
- package/dist/assets/{en-FjyeYndD.js → en-BX7CKkqE.js} +22 -6
- package/dist/assets/{global-link-actions-NNtNk_7A.js → global-link-actions-DzXrk-LO.js} +1 -1
- package/dist/assets/{import-curl-DcVVML3m.js → import-curl-BrVSOGQW.js} +1 -1
- package/dist/assets/{index-C6LoGNAx.css → index-BWpYwmXd.css} +548 -948
- package/dist/assets/{index-BEC9W_3K.js → index-BmZCxv8-.js} +48318 -42852
- package/dist/assets/{index-CFNl0R-J.js → index-x7t8iCsI.js} +1 -1
- package/dist/assets/{pickBy-BXP1QU1C.js → pickBy-oHD63WOf.js} +1 -1
- package/dist/assets/{templateActions-DWb-SuCl.js → templateActions-_QLqrCsm.js} +1 -1
- package/dist/assets/{typescript.worker-CUj0Nj-S.js → typescript.worker-KwUz68Jx.js} +2499 -157
- package/dist/assets/{useBeforeUnload-uH0nIAM3.js → useBeforeUnload-CBmJdmlS.js} +1 -1
- package/dist/assets/{useExecutionDebugging-bE32iQtx.js → useExecutionDebugging-B22Oj62X.js} +1 -1
- package/dist/assets/{useExecutionHelpers-CXZC4OGe.js → useExecutionHelpers-C6meisqx.js} +1 -1
- package/dist/assets/{useImportCurlCommand-Bxi0W0ub.js → useImportCurlCommand-CCUM_iVn.js} +9 -9
- package/dist/assets/{RunData-D0dKnadD.css → useKeybindings-2A271Jke.css} +134 -2
- package/dist/assets/{RunData-CY2AnQ-5.js → useKeybindings-CcHEvN6i.js} +223 -1644
- package/dist/assets/{useProjectPages-BKkEKuqG.js → useProjectPages-CrI3xlbd.js} +1 -1
- package/dist/assets/{usePushConnection-TyXi_EKD.js → usePushConnection-EYkv1Xyg.js} +10 -2
- package/dist/assets/{useWorkflowActivate-BRxfn_zV.js → useWorkflowActivate-BiorS_mB.js} +1 -1
- package/dist/index.html +3 -7
- package/index.html +1 -5
- package/package.json +1 -1
- package/vite.config.mts +23 -3
- package/dist/assets/CollectionParameter-BHthTTpD.js +0 -4
- package/dist/assets/useKeybindings-BUK7Ngh6.css +0 -133
- package/dist/assets/useKeybindings-D5pwrTFM.js +0 -188
|
@@ -1,8 +1,40 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RunDataTable-
|
|
2
|
-
import {
|
|
3
|
-
import { F as FileSaver_minExports } from "./FileSaver.min-
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RunDataTable-DJu8Ut0r.js","assets/index-BmZCxv8-.js","assets/index-BWpYwmXd.css","assets/useExecutionHelpers-C6meisqx.js","assets/RunDataTable-n918b-Qv.css","assets/RunDataJson-12Py20Rs.js","assets/FileSaver.min-CiFUM_59.js","assets/RunDataJson-BH9HLoGC.css","assets/RunDataParsedAiContent-DYz5OPxJ.js","assets/VueMarkdown-Dxf59_T_.js","assets/RunDataParsedAiContent-wfIiKsq7.css","assets/RunDataSearch-NmwtxOjZ.js","assets/RunDataSearch-2eEalFoi.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { d as defineComponent, e as createBlock, g as openBlock, dK as Transition, w as withCtx, aT as withDirectives, aU as vShow, j as createBaseVNode, n as normalizeClass, _ as _export_sfc, f4 as hasKey, f5 as requireVue, bK as getDefaultExportFromCjs, f6 as sanitizeHtml, f7 as sanitizeHtmlExports, h as createElementBlock, r as ref, a5 as useWorkflowsStore, x as computed, o as onMounted, eQ as jsonParse, f8 as base64DecodeUTF8, k as createTextVNode, t as toDisplayString, l as unref, c as useI18n, bC as useNodeHelpers, f as createCommentVNode, i as createVNode, q as N8nButton, bP as withModifiers, b as useRouter, c2 as useClipboard, a as useToast, f9 as useAIAssistantHelpers, bH as useNodeTypesStore, aN as useNDVStore, ad as useRootStore, fa as useAssistantStore, T as useUIStore, fb as MAX_DISPLAY_DATA_SIZE, dd as isCommunityPackageName, c4 as resolveDirective, fc as InlineAskAssistantButton, $ as N8nTooltip, a0 as _sfc_main$b, N as N8nIcon, F as Fragment, y as renderList, V as VIEWS, fd as NEW_ASSISTANT_SESSION_MODAL, ea as sanitizeHtml$1, p as N8nText, a2 as N8nLink, ab as watch, H as N8nRadioButtons, bg as createSlots, O as resolveComponent, cW as N8nSelect, cX as _sfc_main$c, af as useSourceControlStore, fe as useSchemaPreviewStore, c_ as usePostHog, a6 as useRoute, bT as toRef, bA as usePinnedData, ff as useNodeType, fg as storeToRefs, fh as TRIMMED_TASK_DATA_CONNECTIONS_KEY, bp as NodeConnectionTypes, fi as executionDataToJson, fj as NODE_TYPES_EXCLUDED_FROM_OUTPUT_NAME_APPEND, fk as CORE_NODES_CATEGORY, d5 as NDV_UI_OVERHAUL_EXPERIMENT, fl as computedAsync, fm as parseAiContent, cm as ndvEventBus, az as useTelemetry, I as onBeforeUnmount, b5 as useStorage, fn as LOCAL_STORAGE_PIN_DATA_DISCOVERY_NDV_FLAG, fo as dataPinningEventBus, fp as LOCAL_STORAGE_PIN_DATA_DISCOVERY_CANVAS_FLAG, fq as searchInObject, fr as getConnectionTypes, fs as RUN_DATA_DEFAULT_PAGE_SIZE, ft as isObject, fu as MAX_DISPLAY_DATA_SIZE_SCHEMA_VIEW, fv as HTML_NODE_TYPE, J as renderSlot, dw as N8nCallout, fw as DATA_PINNING_DOCS_URL, e4 as Suspense, eW as defineAsyncComponent, bW as normalizeProps, D as mergeProps, dh as N8nTabs, bX as guardReactiveProps, fx as _sfc_main$d, ez as __unplugin_components_9, er as InfoTip, fy as DATA_EDITING_DOCS_URL, a1 as I18nT, aJ as __vitePreload, d3 as getNodeOutputs, fz as getGenericHints, fA as clearJsonKey, fB as TEST_PIN_DATA, be as useExternalHooks, cy as isPresent, fC as isEmpty, d$ as isEqual, Q as createEventBus, a3 as defineStore, v as useSettingsStore, cd as shallowRef, co as useVueFlow, dM as calculateNodeSize, bU as inject, c3 as PiPWindowSymbol, cl as useActiveElement, e0 as useDeviceSupport, dc as toValue, fD as useEventListener } from "./index-BmZCxv8-.js";
|
|
3
|
+
import { F as FileSaver_minExports } from "./FileSaver.min-CiFUM_59.js";
|
|
4
|
+
import { u as useExecutionHelpers } from "./useExecutionHelpers-C6meisqx.js";
|
|
5
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "BlockUi",
|
|
7
|
+
props: {
|
|
8
|
+
show: { type: Boolean, default: false }
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
return (_ctx, _cache) => {
|
|
12
|
+
return openBlock(), createBlock(Transition, {
|
|
13
|
+
name: "fade",
|
|
14
|
+
mode: "out-in"
|
|
15
|
+
}, {
|
|
16
|
+
default: withCtx(() => [
|
|
17
|
+
withDirectives(createBaseVNode("div", {
|
|
18
|
+
class: normalizeClass(["n8n-block-ui", _ctx.$style.uiBlocker]),
|
|
19
|
+
role: "dialog",
|
|
20
|
+
"aria-hidden": true
|
|
21
|
+
}, null, 2), [
|
|
22
|
+
[vShow, _ctx.show]
|
|
23
|
+
])
|
|
24
|
+
]),
|
|
25
|
+
_: 1
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const uiBlocker$1 = "_uiBlocker_j0zl4_123";
|
|
31
|
+
const style0$5 = {
|
|
32
|
+
uiBlocker: uiBlocker$1
|
|
33
|
+
};
|
|
34
|
+
const cssModules$5 = {
|
|
35
|
+
"$style": style0$5
|
|
36
|
+
};
|
|
37
|
+
const N8nBlockUi = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__cssModules", cssModules$5], ["__scopeId", "data-v-76a59b58"]]);
|
|
6
38
|
function responseHasSubworkflowData(response) {
|
|
7
39
|
return ["executionId", "workflowId"].every((x) => hasKey(response, x) && typeof response[x] === "string");
|
|
8
40
|
}
|
|
@@ -43,1611 +75,6 @@ const ViewableMimeTypes = [
|
|
|
43
75
|
"video/ogg",
|
|
44
76
|
"video/webm"
|
|
45
77
|
];
|
|
46
|
-
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
47
|
-
__name: "ConsumedTokensDetails",
|
|
48
|
-
props: {
|
|
49
|
-
consumedTokens: {}
|
|
50
|
-
},
|
|
51
|
-
setup(__props) {
|
|
52
|
-
const i18n = useI18n();
|
|
53
|
-
return (_ctx, _cache) => {
|
|
54
|
-
return openBlock(), createElementBlock("div", null, [
|
|
55
|
-
createVNode(unref(N8nText), {
|
|
56
|
-
bold: true,
|
|
57
|
-
size: "small"
|
|
58
|
-
}, {
|
|
59
|
-
default: withCtx(() => [
|
|
60
|
-
createTextVNode(toDisplayString(unref(i18n).baseText("runData.aiContentBlock.tokens.prompt")) + " " + toDisplayString(unref(i18n).baseText("runData.aiContentBlock.tokens", {
|
|
61
|
-
interpolate: {
|
|
62
|
-
count: unref(formatTokenUsageCount)(_ctx.consumedTokens, "prompt")
|
|
63
|
-
}
|
|
64
|
-
})), 1)
|
|
65
|
-
]),
|
|
66
|
-
_: 1
|
|
67
|
-
}),
|
|
68
|
-
_cache[0] || (_cache[0] = createBaseVNode("br", null, null, -1)),
|
|
69
|
-
createVNode(unref(N8nText), {
|
|
70
|
-
bold: true,
|
|
71
|
-
size: "small"
|
|
72
|
-
}, {
|
|
73
|
-
default: withCtx(() => [
|
|
74
|
-
createTextVNode(toDisplayString(unref(i18n).baseText("runData.aiContentBlock.tokens.completion")) + " " + toDisplayString(unref(i18n).baseText("runData.aiContentBlock.tokens", {
|
|
75
|
-
interpolate: {
|
|
76
|
-
count: unref(formatTokenUsageCount)(_ctx.consumedTokens, "completion")
|
|
77
|
-
}
|
|
78
|
-
})), 1)
|
|
79
|
-
]),
|
|
80
|
-
_: 1
|
|
81
|
-
})
|
|
82
|
-
]);
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
var core;
|
|
87
|
-
var hasRequiredCore;
|
|
88
|
-
function requireCore() {
|
|
89
|
-
if (hasRequiredCore) return core;
|
|
90
|
-
hasRequiredCore = 1;
|
|
91
|
-
function deepFreeze(obj) {
|
|
92
|
-
if (obj instanceof Map) {
|
|
93
|
-
obj.clear = obj.delete = obj.set = function() {
|
|
94
|
-
throw new Error("map is read-only");
|
|
95
|
-
};
|
|
96
|
-
} else if (obj instanceof Set) {
|
|
97
|
-
obj.add = obj.clear = obj.delete = function() {
|
|
98
|
-
throw new Error("set is read-only");
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
Object.freeze(obj);
|
|
102
|
-
Object.getOwnPropertyNames(obj).forEach((name) => {
|
|
103
|
-
const prop = obj[name];
|
|
104
|
-
const type = typeof prop;
|
|
105
|
-
if ((type === "object" || type === "function") && !Object.isFrozen(prop)) {
|
|
106
|
-
deepFreeze(prop);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
return obj;
|
|
110
|
-
}
|
|
111
|
-
class Response {
|
|
112
|
-
/**
|
|
113
|
-
* @param {CompiledMode} mode
|
|
114
|
-
*/
|
|
115
|
-
constructor(mode) {
|
|
116
|
-
if (mode.data === void 0) mode.data = {};
|
|
117
|
-
this.data = mode.data;
|
|
118
|
-
this.isMatchIgnored = false;
|
|
119
|
-
}
|
|
120
|
-
ignoreMatch() {
|
|
121
|
-
this.isMatchIgnored = true;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function escapeHTML(value) {
|
|
125
|
-
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
126
|
-
}
|
|
127
|
-
function inherit$1(original, ...objects) {
|
|
128
|
-
const result = /* @__PURE__ */ Object.create(null);
|
|
129
|
-
for (const key in original) {
|
|
130
|
-
result[key] = original[key];
|
|
131
|
-
}
|
|
132
|
-
objects.forEach(function(obj) {
|
|
133
|
-
for (const key in obj) {
|
|
134
|
-
result[key] = obj[key];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
return (
|
|
138
|
-
/** @type {T} */
|
|
139
|
-
result
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
const SPAN_CLOSE = "</span>";
|
|
143
|
-
const emitsWrappingTags = (node) => {
|
|
144
|
-
return !!node.scope;
|
|
145
|
-
};
|
|
146
|
-
const scopeToCSSClass = (name, { prefix }) => {
|
|
147
|
-
if (name.startsWith("language:")) {
|
|
148
|
-
return name.replace("language:", "language-");
|
|
149
|
-
}
|
|
150
|
-
if (name.includes(".")) {
|
|
151
|
-
const pieces = name.split(".");
|
|
152
|
-
return [
|
|
153
|
-
`${prefix}${pieces.shift()}`,
|
|
154
|
-
...pieces.map((x, i) => `${x}${"_".repeat(i + 1)}`)
|
|
155
|
-
].join(" ");
|
|
156
|
-
}
|
|
157
|
-
return `${prefix}${name}`;
|
|
158
|
-
};
|
|
159
|
-
class HTMLRenderer {
|
|
160
|
-
/**
|
|
161
|
-
* Creates a new HTMLRenderer
|
|
162
|
-
*
|
|
163
|
-
* @param {Tree} parseTree - the parse tree (must support `walk` API)
|
|
164
|
-
* @param {{classPrefix: string}} options
|
|
165
|
-
*/
|
|
166
|
-
constructor(parseTree, options) {
|
|
167
|
-
this.buffer = "";
|
|
168
|
-
this.classPrefix = options.classPrefix;
|
|
169
|
-
parseTree.walk(this);
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Adds texts to the output stream
|
|
173
|
-
*
|
|
174
|
-
* @param {string} text */
|
|
175
|
-
addText(text) {
|
|
176
|
-
this.buffer += escapeHTML(text);
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Adds a node open to the output stream (if needed)
|
|
180
|
-
*
|
|
181
|
-
* @param {Node} node */
|
|
182
|
-
openNode(node) {
|
|
183
|
-
if (!emitsWrappingTags(node)) return;
|
|
184
|
-
const className = scopeToCSSClass(
|
|
185
|
-
node.scope,
|
|
186
|
-
{ prefix: this.classPrefix }
|
|
187
|
-
);
|
|
188
|
-
this.span(className);
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Adds a node close to the output stream (if needed)
|
|
192
|
-
*
|
|
193
|
-
* @param {Node} node */
|
|
194
|
-
closeNode(node) {
|
|
195
|
-
if (!emitsWrappingTags(node)) return;
|
|
196
|
-
this.buffer += SPAN_CLOSE;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* returns the accumulated buffer
|
|
200
|
-
*/
|
|
201
|
-
value() {
|
|
202
|
-
return this.buffer;
|
|
203
|
-
}
|
|
204
|
-
// helpers
|
|
205
|
-
/**
|
|
206
|
-
* Builds a span element
|
|
207
|
-
*
|
|
208
|
-
* @param {string} className */
|
|
209
|
-
span(className) {
|
|
210
|
-
this.buffer += `<span class="${className}">`;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
const newNode = (opts = {}) => {
|
|
214
|
-
const result = { children: [] };
|
|
215
|
-
Object.assign(result, opts);
|
|
216
|
-
return result;
|
|
217
|
-
};
|
|
218
|
-
class TokenTree {
|
|
219
|
-
constructor() {
|
|
220
|
-
this.rootNode = newNode();
|
|
221
|
-
this.stack = [this.rootNode];
|
|
222
|
-
}
|
|
223
|
-
get top() {
|
|
224
|
-
return this.stack[this.stack.length - 1];
|
|
225
|
-
}
|
|
226
|
-
get root() {
|
|
227
|
-
return this.rootNode;
|
|
228
|
-
}
|
|
229
|
-
/** @param {Node} node */
|
|
230
|
-
add(node) {
|
|
231
|
-
this.top.children.push(node);
|
|
232
|
-
}
|
|
233
|
-
/** @param {string} scope */
|
|
234
|
-
openNode(scope) {
|
|
235
|
-
const node = newNode({ scope });
|
|
236
|
-
this.add(node);
|
|
237
|
-
this.stack.push(node);
|
|
238
|
-
}
|
|
239
|
-
closeNode() {
|
|
240
|
-
if (this.stack.length > 1) {
|
|
241
|
-
return this.stack.pop();
|
|
242
|
-
}
|
|
243
|
-
return void 0;
|
|
244
|
-
}
|
|
245
|
-
closeAllNodes() {
|
|
246
|
-
while (this.closeNode()) ;
|
|
247
|
-
}
|
|
248
|
-
toJSON() {
|
|
249
|
-
return JSON.stringify(this.rootNode, null, 4);
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* @typedef { import("./html_renderer").Renderer } Renderer
|
|
253
|
-
* @param {Renderer} builder
|
|
254
|
-
*/
|
|
255
|
-
walk(builder) {
|
|
256
|
-
return this.constructor._walk(builder, this.rootNode);
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* @param {Renderer} builder
|
|
260
|
-
* @param {Node} node
|
|
261
|
-
*/
|
|
262
|
-
static _walk(builder, node) {
|
|
263
|
-
if (typeof node === "string") {
|
|
264
|
-
builder.addText(node);
|
|
265
|
-
} else if (node.children) {
|
|
266
|
-
builder.openNode(node);
|
|
267
|
-
node.children.forEach((child) => this._walk(builder, child));
|
|
268
|
-
builder.closeNode(node);
|
|
269
|
-
}
|
|
270
|
-
return builder;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* @param {Node} node
|
|
274
|
-
*/
|
|
275
|
-
static _collapse(node) {
|
|
276
|
-
if (typeof node === "string") return;
|
|
277
|
-
if (!node.children) return;
|
|
278
|
-
if (node.children.every((el) => typeof el === "string")) {
|
|
279
|
-
node.children = [node.children.join("")];
|
|
280
|
-
} else {
|
|
281
|
-
node.children.forEach((child) => {
|
|
282
|
-
TokenTree._collapse(child);
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
class TokenTreeEmitter extends TokenTree {
|
|
288
|
-
/**
|
|
289
|
-
* @param {*} options
|
|
290
|
-
*/
|
|
291
|
-
constructor(options) {
|
|
292
|
-
super();
|
|
293
|
-
this.options = options;
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* @param {string} text
|
|
297
|
-
*/
|
|
298
|
-
addText(text) {
|
|
299
|
-
if (text === "") {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
this.add(text);
|
|
303
|
-
}
|
|
304
|
-
/** @param {string} scope */
|
|
305
|
-
startScope(scope) {
|
|
306
|
-
this.openNode(scope);
|
|
307
|
-
}
|
|
308
|
-
endScope() {
|
|
309
|
-
this.closeNode();
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* @param {Emitter & {root: DataNode}} emitter
|
|
313
|
-
* @param {string} name
|
|
314
|
-
*/
|
|
315
|
-
__addSublanguage(emitter, name) {
|
|
316
|
-
const node = emitter.root;
|
|
317
|
-
if (name) node.scope = `language:${name}`;
|
|
318
|
-
this.add(node);
|
|
319
|
-
}
|
|
320
|
-
toHTML() {
|
|
321
|
-
const renderer = new HTMLRenderer(this, this.options);
|
|
322
|
-
return renderer.value();
|
|
323
|
-
}
|
|
324
|
-
finalize() {
|
|
325
|
-
this.closeAllNodes();
|
|
326
|
-
return true;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
function source(re) {
|
|
330
|
-
if (!re) return null;
|
|
331
|
-
if (typeof re === "string") return re;
|
|
332
|
-
return re.source;
|
|
333
|
-
}
|
|
334
|
-
function lookahead(re) {
|
|
335
|
-
return concat("(?=", re, ")");
|
|
336
|
-
}
|
|
337
|
-
function anyNumberOfTimes(re) {
|
|
338
|
-
return concat("(?:", re, ")*");
|
|
339
|
-
}
|
|
340
|
-
function optional(re) {
|
|
341
|
-
return concat("(?:", re, ")?");
|
|
342
|
-
}
|
|
343
|
-
function concat(...args) {
|
|
344
|
-
const joined = args.map((x) => source(x)).join("");
|
|
345
|
-
return joined;
|
|
346
|
-
}
|
|
347
|
-
function stripOptionsFromArgs(args) {
|
|
348
|
-
const opts = args[args.length - 1];
|
|
349
|
-
if (typeof opts === "object" && opts.constructor === Object) {
|
|
350
|
-
args.splice(args.length - 1, 1);
|
|
351
|
-
return opts;
|
|
352
|
-
} else {
|
|
353
|
-
return {};
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
function either(...args) {
|
|
357
|
-
const opts = stripOptionsFromArgs(args);
|
|
358
|
-
const joined = "(" + (opts.capture ? "" : "?:") + args.map((x) => source(x)).join("|") + ")";
|
|
359
|
-
return joined;
|
|
360
|
-
}
|
|
361
|
-
function countMatchGroups(re) {
|
|
362
|
-
return new RegExp(re.toString() + "|").exec("").length - 1;
|
|
363
|
-
}
|
|
364
|
-
function startsWith(re, lexeme) {
|
|
365
|
-
const match = re && re.exec(lexeme);
|
|
366
|
-
return match && match.index === 0;
|
|
367
|
-
}
|
|
368
|
-
const BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
369
|
-
function _rewriteBackreferences(regexps, { joinWith }) {
|
|
370
|
-
let numCaptures = 0;
|
|
371
|
-
return regexps.map((regex) => {
|
|
372
|
-
numCaptures += 1;
|
|
373
|
-
const offset = numCaptures;
|
|
374
|
-
let re = source(regex);
|
|
375
|
-
let out = "";
|
|
376
|
-
while (re.length > 0) {
|
|
377
|
-
const match = BACKREF_RE.exec(re);
|
|
378
|
-
if (!match) {
|
|
379
|
-
out += re;
|
|
380
|
-
break;
|
|
381
|
-
}
|
|
382
|
-
out += re.substring(0, match.index);
|
|
383
|
-
re = re.substring(match.index + match[0].length);
|
|
384
|
-
if (match[0][0] === "\\" && match[1]) {
|
|
385
|
-
out += "\\" + String(Number(match[1]) + offset);
|
|
386
|
-
} else {
|
|
387
|
-
out += match[0];
|
|
388
|
-
if (match[0] === "(") {
|
|
389
|
-
numCaptures++;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
return out;
|
|
394
|
-
}).map((re) => `(${re})`).join(joinWith);
|
|
395
|
-
}
|
|
396
|
-
const MATCH_NOTHING_RE = /\b\B/;
|
|
397
|
-
const IDENT_RE = "[a-zA-Z]\\w*";
|
|
398
|
-
const UNDERSCORE_IDENT_RE = "[a-zA-Z_]\\w*";
|
|
399
|
-
const NUMBER_RE = "\\b\\d+(\\.\\d+)?";
|
|
400
|
-
const C_NUMBER_RE = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";
|
|
401
|
-
const BINARY_NUMBER_RE = "\\b(0b[01]+)";
|
|
402
|
-
const RE_STARTERS_RE = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";
|
|
403
|
-
const SHEBANG = (opts = {}) => {
|
|
404
|
-
const beginShebang = /^#![ ]*\//;
|
|
405
|
-
if (opts.binary) {
|
|
406
|
-
opts.begin = concat(
|
|
407
|
-
beginShebang,
|
|
408
|
-
/.*\b/,
|
|
409
|
-
opts.binary,
|
|
410
|
-
/\b.*/
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
return inherit$1({
|
|
414
|
-
scope: "meta",
|
|
415
|
-
begin: beginShebang,
|
|
416
|
-
end: /$/,
|
|
417
|
-
relevance: 0,
|
|
418
|
-
/** @type {ModeCallback} */
|
|
419
|
-
"on:begin": (m, resp) => {
|
|
420
|
-
if (m.index !== 0) resp.ignoreMatch();
|
|
421
|
-
}
|
|
422
|
-
}, opts);
|
|
423
|
-
};
|
|
424
|
-
const BACKSLASH_ESCAPE = {
|
|
425
|
-
begin: "\\\\[\\s\\S]",
|
|
426
|
-
relevance: 0
|
|
427
|
-
};
|
|
428
|
-
const APOS_STRING_MODE = {
|
|
429
|
-
scope: "string",
|
|
430
|
-
begin: "'",
|
|
431
|
-
end: "'",
|
|
432
|
-
illegal: "\\n",
|
|
433
|
-
contains: [BACKSLASH_ESCAPE]
|
|
434
|
-
};
|
|
435
|
-
const QUOTE_STRING_MODE = {
|
|
436
|
-
scope: "string",
|
|
437
|
-
begin: '"',
|
|
438
|
-
end: '"',
|
|
439
|
-
illegal: "\\n",
|
|
440
|
-
contains: [BACKSLASH_ESCAPE]
|
|
441
|
-
};
|
|
442
|
-
const PHRASAL_WORDS_MODE = {
|
|
443
|
-
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/
|
|
444
|
-
};
|
|
445
|
-
const COMMENT = function(begin, end, modeOptions = {}) {
|
|
446
|
-
const mode = inherit$1(
|
|
447
|
-
{
|
|
448
|
-
scope: "comment",
|
|
449
|
-
begin,
|
|
450
|
-
end,
|
|
451
|
-
contains: []
|
|
452
|
-
},
|
|
453
|
-
modeOptions
|
|
454
|
-
);
|
|
455
|
-
mode.contains.push({
|
|
456
|
-
scope: "doctag",
|
|
457
|
-
// hack to avoid the space from being included. the space is necessary to
|
|
458
|
-
// match here to prevent the plain text rule below from gobbling up doctags
|
|
459
|
-
begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
|
|
460
|
-
end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
|
|
461
|
-
excludeBegin: true,
|
|
462
|
-
relevance: 0
|
|
463
|
-
});
|
|
464
|
-
const ENGLISH_WORD = either(
|
|
465
|
-
// list of common 1 and 2 letter words in English
|
|
466
|
-
"I",
|
|
467
|
-
"a",
|
|
468
|
-
"is",
|
|
469
|
-
"so",
|
|
470
|
-
"us",
|
|
471
|
-
"to",
|
|
472
|
-
"at",
|
|
473
|
-
"if",
|
|
474
|
-
"in",
|
|
475
|
-
"it",
|
|
476
|
-
"on",
|
|
477
|
-
// note: this is not an exhaustive list of contractions, just popular ones
|
|
478
|
-
/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,
|
|
479
|
-
// contractions - can't we'd they're let's, etc
|
|
480
|
-
/[A-Za-z]+[-][a-z]+/,
|
|
481
|
-
// `no-way`, etc.
|
|
482
|
-
/[A-Za-z][a-z]{2,}/
|
|
483
|
-
// allow capitalized words at beginning of sentences
|
|
484
|
-
);
|
|
485
|
-
mode.contains.push(
|
|
486
|
-
{
|
|
487
|
-
// TODO: how to include ", (, ) without breaking grammars that use these for
|
|
488
|
-
// comment delimiters?
|
|
489
|
-
// begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
|
|
490
|
-
// ---
|
|
491
|
-
// this tries to find sequences of 3 english words in a row (without any
|
|
492
|
-
// "programming" type syntax) this gives us a strong signal that we've
|
|
493
|
-
// TRULY found a comment - vs perhaps scanning with the wrong language.
|
|
494
|
-
// It's possible to find something that LOOKS like the start of the
|
|
495
|
-
// comment - but then if there is no readable text - good chance it is a
|
|
496
|
-
// false match and not a comment.
|
|
497
|
-
//
|
|
498
|
-
// for a visual example please see:
|
|
499
|
-
// https://github.com/highlightjs/highlight.js/issues/2827
|
|
500
|
-
begin: concat(
|
|
501
|
-
/[ ]+/,
|
|
502
|
-
// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
|
|
503
|
-
"(",
|
|
504
|
-
ENGLISH_WORD,
|
|
505
|
-
/[.]?[:]?([.][ ]|[ ])/,
|
|
506
|
-
"){3}"
|
|
507
|
-
)
|
|
508
|
-
// look for 3 words in a row
|
|
509
|
-
}
|
|
510
|
-
);
|
|
511
|
-
return mode;
|
|
512
|
-
};
|
|
513
|
-
const C_LINE_COMMENT_MODE = COMMENT("//", "$");
|
|
514
|
-
const C_BLOCK_COMMENT_MODE = COMMENT("/\\*", "\\*/");
|
|
515
|
-
const HASH_COMMENT_MODE = COMMENT("#", "$");
|
|
516
|
-
const NUMBER_MODE = {
|
|
517
|
-
scope: "number",
|
|
518
|
-
begin: NUMBER_RE,
|
|
519
|
-
relevance: 0
|
|
520
|
-
};
|
|
521
|
-
const C_NUMBER_MODE = {
|
|
522
|
-
scope: "number",
|
|
523
|
-
begin: C_NUMBER_RE,
|
|
524
|
-
relevance: 0
|
|
525
|
-
};
|
|
526
|
-
const BINARY_NUMBER_MODE = {
|
|
527
|
-
scope: "number",
|
|
528
|
-
begin: BINARY_NUMBER_RE,
|
|
529
|
-
relevance: 0
|
|
530
|
-
};
|
|
531
|
-
const REGEXP_MODE = {
|
|
532
|
-
scope: "regexp",
|
|
533
|
-
begin: /\/(?=[^/\n]*\/)/,
|
|
534
|
-
end: /\/[gimuy]*/,
|
|
535
|
-
contains: [
|
|
536
|
-
BACKSLASH_ESCAPE,
|
|
537
|
-
{
|
|
538
|
-
begin: /\[/,
|
|
539
|
-
end: /\]/,
|
|
540
|
-
relevance: 0,
|
|
541
|
-
contains: [BACKSLASH_ESCAPE]
|
|
542
|
-
}
|
|
543
|
-
]
|
|
544
|
-
};
|
|
545
|
-
const TITLE_MODE = {
|
|
546
|
-
scope: "title",
|
|
547
|
-
begin: IDENT_RE,
|
|
548
|
-
relevance: 0
|
|
549
|
-
};
|
|
550
|
-
const UNDERSCORE_TITLE_MODE = {
|
|
551
|
-
scope: "title",
|
|
552
|
-
begin: UNDERSCORE_IDENT_RE,
|
|
553
|
-
relevance: 0
|
|
554
|
-
};
|
|
555
|
-
const METHOD_GUARD = {
|
|
556
|
-
// excludes method names from keyword processing
|
|
557
|
-
begin: "\\.\\s*" + UNDERSCORE_IDENT_RE,
|
|
558
|
-
relevance: 0
|
|
559
|
-
};
|
|
560
|
-
const END_SAME_AS_BEGIN = function(mode) {
|
|
561
|
-
return Object.assign(
|
|
562
|
-
mode,
|
|
563
|
-
{
|
|
564
|
-
/** @type {ModeCallback} */
|
|
565
|
-
"on:begin": (m, resp) => {
|
|
566
|
-
resp.data._beginMatch = m[1];
|
|
567
|
-
},
|
|
568
|
-
/** @type {ModeCallback} */
|
|
569
|
-
"on:end": (m, resp) => {
|
|
570
|
-
if (resp.data._beginMatch !== m[1]) resp.ignoreMatch();
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
);
|
|
574
|
-
};
|
|
575
|
-
var MODES = /* @__PURE__ */ Object.freeze({
|
|
576
|
-
__proto__: null,
|
|
577
|
-
APOS_STRING_MODE,
|
|
578
|
-
BACKSLASH_ESCAPE,
|
|
579
|
-
BINARY_NUMBER_MODE,
|
|
580
|
-
BINARY_NUMBER_RE,
|
|
581
|
-
COMMENT,
|
|
582
|
-
C_BLOCK_COMMENT_MODE,
|
|
583
|
-
C_LINE_COMMENT_MODE,
|
|
584
|
-
C_NUMBER_MODE,
|
|
585
|
-
C_NUMBER_RE,
|
|
586
|
-
END_SAME_AS_BEGIN,
|
|
587
|
-
HASH_COMMENT_MODE,
|
|
588
|
-
IDENT_RE,
|
|
589
|
-
MATCH_NOTHING_RE,
|
|
590
|
-
METHOD_GUARD,
|
|
591
|
-
NUMBER_MODE,
|
|
592
|
-
NUMBER_RE,
|
|
593
|
-
PHRASAL_WORDS_MODE,
|
|
594
|
-
QUOTE_STRING_MODE,
|
|
595
|
-
REGEXP_MODE,
|
|
596
|
-
RE_STARTERS_RE,
|
|
597
|
-
SHEBANG,
|
|
598
|
-
TITLE_MODE,
|
|
599
|
-
UNDERSCORE_IDENT_RE,
|
|
600
|
-
UNDERSCORE_TITLE_MODE
|
|
601
|
-
});
|
|
602
|
-
function skipIfHasPrecedingDot(match, response) {
|
|
603
|
-
const before = match.input[match.index - 1];
|
|
604
|
-
if (before === ".") {
|
|
605
|
-
response.ignoreMatch();
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
function scopeClassName(mode, _parent) {
|
|
609
|
-
if (mode.className !== void 0) {
|
|
610
|
-
mode.scope = mode.className;
|
|
611
|
-
delete mode.className;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
function beginKeywords(mode, parent) {
|
|
615
|
-
if (!parent) return;
|
|
616
|
-
if (!mode.beginKeywords) return;
|
|
617
|
-
mode.begin = "\\b(" + mode.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)";
|
|
618
|
-
mode.__beforeBegin = skipIfHasPrecedingDot;
|
|
619
|
-
mode.keywords = mode.keywords || mode.beginKeywords;
|
|
620
|
-
delete mode.beginKeywords;
|
|
621
|
-
if (mode.relevance === void 0) mode.relevance = 0;
|
|
622
|
-
}
|
|
623
|
-
function compileIllegal(mode, _parent) {
|
|
624
|
-
if (!Array.isArray(mode.illegal)) return;
|
|
625
|
-
mode.illegal = either(...mode.illegal);
|
|
626
|
-
}
|
|
627
|
-
function compileMatch(mode, _parent) {
|
|
628
|
-
if (!mode.match) return;
|
|
629
|
-
if (mode.begin || mode.end) throw new Error("begin & end are not supported with match");
|
|
630
|
-
mode.begin = mode.match;
|
|
631
|
-
delete mode.match;
|
|
632
|
-
}
|
|
633
|
-
function compileRelevance(mode, _parent) {
|
|
634
|
-
if (mode.relevance === void 0) mode.relevance = 1;
|
|
635
|
-
}
|
|
636
|
-
const beforeMatchExt = (mode, parent) => {
|
|
637
|
-
if (!mode.beforeMatch) return;
|
|
638
|
-
if (mode.starts) throw new Error("beforeMatch cannot be used with starts");
|
|
639
|
-
const originalMode = Object.assign({}, mode);
|
|
640
|
-
Object.keys(mode).forEach((key) => {
|
|
641
|
-
delete mode[key];
|
|
642
|
-
});
|
|
643
|
-
mode.keywords = originalMode.keywords;
|
|
644
|
-
mode.begin = concat(originalMode.beforeMatch, lookahead(originalMode.begin));
|
|
645
|
-
mode.starts = {
|
|
646
|
-
relevance: 0,
|
|
647
|
-
contains: [
|
|
648
|
-
Object.assign(originalMode, { endsParent: true })
|
|
649
|
-
]
|
|
650
|
-
};
|
|
651
|
-
mode.relevance = 0;
|
|
652
|
-
delete originalMode.beforeMatch;
|
|
653
|
-
};
|
|
654
|
-
const COMMON_KEYWORDS = [
|
|
655
|
-
"of",
|
|
656
|
-
"and",
|
|
657
|
-
"for",
|
|
658
|
-
"in",
|
|
659
|
-
"not",
|
|
660
|
-
"or",
|
|
661
|
-
"if",
|
|
662
|
-
"then",
|
|
663
|
-
"parent",
|
|
664
|
-
// common variable name
|
|
665
|
-
"list",
|
|
666
|
-
// common variable name
|
|
667
|
-
"value"
|
|
668
|
-
// common variable name
|
|
669
|
-
];
|
|
670
|
-
const DEFAULT_KEYWORD_SCOPE = "keyword";
|
|
671
|
-
function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) {
|
|
672
|
-
const compiledKeywords = /* @__PURE__ */ Object.create(null);
|
|
673
|
-
if (typeof rawKeywords === "string") {
|
|
674
|
-
compileList(scopeName, rawKeywords.split(" "));
|
|
675
|
-
} else if (Array.isArray(rawKeywords)) {
|
|
676
|
-
compileList(scopeName, rawKeywords);
|
|
677
|
-
} else {
|
|
678
|
-
Object.keys(rawKeywords).forEach(function(scopeName2) {
|
|
679
|
-
Object.assign(
|
|
680
|
-
compiledKeywords,
|
|
681
|
-
compileKeywords(rawKeywords[scopeName2], caseInsensitive, scopeName2)
|
|
682
|
-
);
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
return compiledKeywords;
|
|
686
|
-
function compileList(scopeName2, keywordList) {
|
|
687
|
-
if (caseInsensitive) {
|
|
688
|
-
keywordList = keywordList.map((x) => x.toLowerCase());
|
|
689
|
-
}
|
|
690
|
-
keywordList.forEach(function(keyword) {
|
|
691
|
-
const pair = keyword.split("|");
|
|
692
|
-
compiledKeywords[pair[0]] = [scopeName2, scoreForKeyword(pair[0], pair[1])];
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
function scoreForKeyword(keyword, providedScore) {
|
|
697
|
-
if (providedScore) {
|
|
698
|
-
return Number(providedScore);
|
|
699
|
-
}
|
|
700
|
-
return commonKeyword(keyword) ? 0 : 1;
|
|
701
|
-
}
|
|
702
|
-
function commonKeyword(keyword) {
|
|
703
|
-
return COMMON_KEYWORDS.includes(keyword.toLowerCase());
|
|
704
|
-
}
|
|
705
|
-
const seenDeprecations = {};
|
|
706
|
-
const error = (message) => {
|
|
707
|
-
console.error(message);
|
|
708
|
-
};
|
|
709
|
-
const warn = (message, ...args) => {
|
|
710
|
-
console.log(`WARN: ${message}`, ...args);
|
|
711
|
-
};
|
|
712
|
-
const deprecated = (version2, message) => {
|
|
713
|
-
if (seenDeprecations[`${version2}/${message}`]) return;
|
|
714
|
-
console.log(`Deprecated as of ${version2}. ${message}`);
|
|
715
|
-
seenDeprecations[`${version2}/${message}`] = true;
|
|
716
|
-
};
|
|
717
|
-
const MultiClassError = new Error();
|
|
718
|
-
function remapScopeNames(mode, regexes, { key }) {
|
|
719
|
-
let offset = 0;
|
|
720
|
-
const scopeNames = mode[key];
|
|
721
|
-
const emit = {};
|
|
722
|
-
const positions = {};
|
|
723
|
-
for (let i = 1; i <= regexes.length; i++) {
|
|
724
|
-
positions[i + offset] = scopeNames[i];
|
|
725
|
-
emit[i + offset] = true;
|
|
726
|
-
offset += countMatchGroups(regexes[i - 1]);
|
|
727
|
-
}
|
|
728
|
-
mode[key] = positions;
|
|
729
|
-
mode[key]._emit = emit;
|
|
730
|
-
mode[key]._multi = true;
|
|
731
|
-
}
|
|
732
|
-
function beginMultiClass(mode) {
|
|
733
|
-
if (!Array.isArray(mode.begin)) return;
|
|
734
|
-
if (mode.skip || mode.excludeBegin || mode.returnBegin) {
|
|
735
|
-
error("skip, excludeBegin, returnBegin not compatible with beginScope: {}");
|
|
736
|
-
throw MultiClassError;
|
|
737
|
-
}
|
|
738
|
-
if (typeof mode.beginScope !== "object" || mode.beginScope === null) {
|
|
739
|
-
error("beginScope must be object");
|
|
740
|
-
throw MultiClassError;
|
|
741
|
-
}
|
|
742
|
-
remapScopeNames(mode, mode.begin, { key: "beginScope" });
|
|
743
|
-
mode.begin = _rewriteBackreferences(mode.begin, { joinWith: "" });
|
|
744
|
-
}
|
|
745
|
-
function endMultiClass(mode) {
|
|
746
|
-
if (!Array.isArray(mode.end)) return;
|
|
747
|
-
if (mode.skip || mode.excludeEnd || mode.returnEnd) {
|
|
748
|
-
error("skip, excludeEnd, returnEnd not compatible with endScope: {}");
|
|
749
|
-
throw MultiClassError;
|
|
750
|
-
}
|
|
751
|
-
if (typeof mode.endScope !== "object" || mode.endScope === null) {
|
|
752
|
-
error("endScope must be object");
|
|
753
|
-
throw MultiClassError;
|
|
754
|
-
}
|
|
755
|
-
remapScopeNames(mode, mode.end, { key: "endScope" });
|
|
756
|
-
mode.end = _rewriteBackreferences(mode.end, { joinWith: "" });
|
|
757
|
-
}
|
|
758
|
-
function scopeSugar(mode) {
|
|
759
|
-
if (mode.scope && typeof mode.scope === "object" && mode.scope !== null) {
|
|
760
|
-
mode.beginScope = mode.scope;
|
|
761
|
-
delete mode.scope;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
function MultiClass(mode) {
|
|
765
|
-
scopeSugar(mode);
|
|
766
|
-
if (typeof mode.beginScope === "string") {
|
|
767
|
-
mode.beginScope = { _wrap: mode.beginScope };
|
|
768
|
-
}
|
|
769
|
-
if (typeof mode.endScope === "string") {
|
|
770
|
-
mode.endScope = { _wrap: mode.endScope };
|
|
771
|
-
}
|
|
772
|
-
beginMultiClass(mode);
|
|
773
|
-
endMultiClass(mode);
|
|
774
|
-
}
|
|
775
|
-
function compileLanguage(language) {
|
|
776
|
-
function langRe(value, global) {
|
|
777
|
-
return new RegExp(
|
|
778
|
-
source(value),
|
|
779
|
-
"m" + (language.case_insensitive ? "i" : "") + (language.unicodeRegex ? "u" : "") + (global ? "g" : "")
|
|
780
|
-
);
|
|
781
|
-
}
|
|
782
|
-
class MultiRegex {
|
|
783
|
-
constructor() {
|
|
784
|
-
this.matchIndexes = {};
|
|
785
|
-
this.regexes = [];
|
|
786
|
-
this.matchAt = 1;
|
|
787
|
-
this.position = 0;
|
|
788
|
-
}
|
|
789
|
-
// @ts-ignore
|
|
790
|
-
addRule(re, opts) {
|
|
791
|
-
opts.position = this.position++;
|
|
792
|
-
this.matchIndexes[this.matchAt] = opts;
|
|
793
|
-
this.regexes.push([opts, re]);
|
|
794
|
-
this.matchAt += countMatchGroups(re) + 1;
|
|
795
|
-
}
|
|
796
|
-
compile() {
|
|
797
|
-
if (this.regexes.length === 0) {
|
|
798
|
-
this.exec = () => null;
|
|
799
|
-
}
|
|
800
|
-
const terminators = this.regexes.map((el) => el[1]);
|
|
801
|
-
this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: "|" }), true);
|
|
802
|
-
this.lastIndex = 0;
|
|
803
|
-
}
|
|
804
|
-
/** @param {string} s */
|
|
805
|
-
exec(s) {
|
|
806
|
-
this.matcherRe.lastIndex = this.lastIndex;
|
|
807
|
-
const match = this.matcherRe.exec(s);
|
|
808
|
-
if (!match) {
|
|
809
|
-
return null;
|
|
810
|
-
}
|
|
811
|
-
const i = match.findIndex((el, i2) => i2 > 0 && el !== void 0);
|
|
812
|
-
const matchData = this.matchIndexes[i];
|
|
813
|
-
match.splice(0, i);
|
|
814
|
-
return Object.assign(match, matchData);
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
class ResumableMultiRegex {
|
|
818
|
-
constructor() {
|
|
819
|
-
this.rules = [];
|
|
820
|
-
this.multiRegexes = [];
|
|
821
|
-
this.count = 0;
|
|
822
|
-
this.lastIndex = 0;
|
|
823
|
-
this.regexIndex = 0;
|
|
824
|
-
}
|
|
825
|
-
// @ts-ignore
|
|
826
|
-
getMatcher(index) {
|
|
827
|
-
if (this.multiRegexes[index]) return this.multiRegexes[index];
|
|
828
|
-
const matcher = new MultiRegex();
|
|
829
|
-
this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts));
|
|
830
|
-
matcher.compile();
|
|
831
|
-
this.multiRegexes[index] = matcher;
|
|
832
|
-
return matcher;
|
|
833
|
-
}
|
|
834
|
-
resumingScanAtSamePosition() {
|
|
835
|
-
return this.regexIndex !== 0;
|
|
836
|
-
}
|
|
837
|
-
considerAll() {
|
|
838
|
-
this.regexIndex = 0;
|
|
839
|
-
}
|
|
840
|
-
// @ts-ignore
|
|
841
|
-
addRule(re, opts) {
|
|
842
|
-
this.rules.push([re, opts]);
|
|
843
|
-
if (opts.type === "begin") this.count++;
|
|
844
|
-
}
|
|
845
|
-
/** @param {string} s */
|
|
846
|
-
exec(s) {
|
|
847
|
-
const m = this.getMatcher(this.regexIndex);
|
|
848
|
-
m.lastIndex = this.lastIndex;
|
|
849
|
-
let result = m.exec(s);
|
|
850
|
-
if (this.resumingScanAtSamePosition()) {
|
|
851
|
-
if (result && result.index === this.lastIndex) ;
|
|
852
|
-
else {
|
|
853
|
-
const m2 = this.getMatcher(0);
|
|
854
|
-
m2.lastIndex = this.lastIndex + 1;
|
|
855
|
-
result = m2.exec(s);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
if (result) {
|
|
859
|
-
this.regexIndex += result.position + 1;
|
|
860
|
-
if (this.regexIndex === this.count) {
|
|
861
|
-
this.considerAll();
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
return result;
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
function buildModeRegex(mode) {
|
|
868
|
-
const mm = new ResumableMultiRegex();
|
|
869
|
-
mode.contains.forEach((term) => mm.addRule(term.begin, { rule: term, type: "begin" }));
|
|
870
|
-
if (mode.terminatorEnd) {
|
|
871
|
-
mm.addRule(mode.terminatorEnd, { type: "end" });
|
|
872
|
-
}
|
|
873
|
-
if (mode.illegal) {
|
|
874
|
-
mm.addRule(mode.illegal, { type: "illegal" });
|
|
875
|
-
}
|
|
876
|
-
return mm;
|
|
877
|
-
}
|
|
878
|
-
function compileMode(mode, parent) {
|
|
879
|
-
const cmode = (
|
|
880
|
-
/** @type CompiledMode */
|
|
881
|
-
mode
|
|
882
|
-
);
|
|
883
|
-
if (mode.isCompiled) return cmode;
|
|
884
|
-
[
|
|
885
|
-
scopeClassName,
|
|
886
|
-
// do this early so compiler extensions generally don't have to worry about
|
|
887
|
-
// the distinction between match/begin
|
|
888
|
-
compileMatch,
|
|
889
|
-
MultiClass,
|
|
890
|
-
beforeMatchExt
|
|
891
|
-
].forEach((ext) => ext(mode, parent));
|
|
892
|
-
language.compilerExtensions.forEach((ext) => ext(mode, parent));
|
|
893
|
-
mode.__beforeBegin = null;
|
|
894
|
-
[
|
|
895
|
-
beginKeywords,
|
|
896
|
-
// do this later so compiler extensions that come earlier have access to the
|
|
897
|
-
// raw array if they wanted to perhaps manipulate it, etc.
|
|
898
|
-
compileIllegal,
|
|
899
|
-
// default to 1 relevance if not specified
|
|
900
|
-
compileRelevance
|
|
901
|
-
].forEach((ext) => ext(mode, parent));
|
|
902
|
-
mode.isCompiled = true;
|
|
903
|
-
let keywordPattern = null;
|
|
904
|
-
if (typeof mode.keywords === "object" && mode.keywords.$pattern) {
|
|
905
|
-
mode.keywords = Object.assign({}, mode.keywords);
|
|
906
|
-
keywordPattern = mode.keywords.$pattern;
|
|
907
|
-
delete mode.keywords.$pattern;
|
|
908
|
-
}
|
|
909
|
-
keywordPattern = keywordPattern || /\w+/;
|
|
910
|
-
if (mode.keywords) {
|
|
911
|
-
mode.keywords = compileKeywords(mode.keywords, language.case_insensitive);
|
|
912
|
-
}
|
|
913
|
-
cmode.keywordPatternRe = langRe(keywordPattern, true);
|
|
914
|
-
if (parent) {
|
|
915
|
-
if (!mode.begin) mode.begin = /\B|\b/;
|
|
916
|
-
cmode.beginRe = langRe(cmode.begin);
|
|
917
|
-
if (!mode.end && !mode.endsWithParent) mode.end = /\B|\b/;
|
|
918
|
-
if (mode.end) cmode.endRe = langRe(cmode.end);
|
|
919
|
-
cmode.terminatorEnd = source(cmode.end) || "";
|
|
920
|
-
if (mode.endsWithParent && parent.terminatorEnd) {
|
|
921
|
-
cmode.terminatorEnd += (mode.end ? "|" : "") + parent.terminatorEnd;
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
if (mode.illegal) cmode.illegalRe = langRe(
|
|
925
|
-
/** @type {RegExp | string} */
|
|
926
|
-
mode.illegal
|
|
927
|
-
);
|
|
928
|
-
if (!mode.contains) mode.contains = [];
|
|
929
|
-
mode.contains = [].concat(...mode.contains.map(function(c) {
|
|
930
|
-
return expandOrCloneMode(c === "self" ? mode : c);
|
|
931
|
-
}));
|
|
932
|
-
mode.contains.forEach(function(c) {
|
|
933
|
-
compileMode(
|
|
934
|
-
/** @type Mode */
|
|
935
|
-
c,
|
|
936
|
-
cmode
|
|
937
|
-
);
|
|
938
|
-
});
|
|
939
|
-
if (mode.starts) {
|
|
940
|
-
compileMode(mode.starts, parent);
|
|
941
|
-
}
|
|
942
|
-
cmode.matcher = buildModeRegex(cmode);
|
|
943
|
-
return cmode;
|
|
944
|
-
}
|
|
945
|
-
if (!language.compilerExtensions) language.compilerExtensions = [];
|
|
946
|
-
if (language.contains && language.contains.includes("self")) {
|
|
947
|
-
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
948
|
-
}
|
|
949
|
-
language.classNameAliases = inherit$1(language.classNameAliases || {});
|
|
950
|
-
return compileMode(
|
|
951
|
-
/** @type Mode */
|
|
952
|
-
language
|
|
953
|
-
);
|
|
954
|
-
}
|
|
955
|
-
function dependencyOnParent(mode) {
|
|
956
|
-
if (!mode) return false;
|
|
957
|
-
return mode.endsWithParent || dependencyOnParent(mode.starts);
|
|
958
|
-
}
|
|
959
|
-
function expandOrCloneMode(mode) {
|
|
960
|
-
if (mode.variants && !mode.cachedVariants) {
|
|
961
|
-
mode.cachedVariants = mode.variants.map(function(variant) {
|
|
962
|
-
return inherit$1(mode, { variants: null }, variant);
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
if (mode.cachedVariants) {
|
|
966
|
-
return mode.cachedVariants;
|
|
967
|
-
}
|
|
968
|
-
if (dependencyOnParent(mode)) {
|
|
969
|
-
return inherit$1(mode, { starts: mode.starts ? inherit$1(mode.starts) : null });
|
|
970
|
-
}
|
|
971
|
-
if (Object.isFrozen(mode)) {
|
|
972
|
-
return inherit$1(mode);
|
|
973
|
-
}
|
|
974
|
-
return mode;
|
|
975
|
-
}
|
|
976
|
-
var version = "11.9.0";
|
|
977
|
-
class HTMLInjectionError extends Error {
|
|
978
|
-
constructor(reason, html) {
|
|
979
|
-
super(reason);
|
|
980
|
-
this.name = "HTMLInjectionError";
|
|
981
|
-
this.html = html;
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
const escape = escapeHTML;
|
|
985
|
-
const inherit = inherit$1;
|
|
986
|
-
const NO_MATCH = Symbol("nomatch");
|
|
987
|
-
const MAX_KEYWORD_HITS = 7;
|
|
988
|
-
const HLJS = function(hljs) {
|
|
989
|
-
const languages = /* @__PURE__ */ Object.create(null);
|
|
990
|
-
const aliases = /* @__PURE__ */ Object.create(null);
|
|
991
|
-
const plugins = [];
|
|
992
|
-
let SAFE_MODE = true;
|
|
993
|
-
const LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?";
|
|
994
|
-
const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: "Plain text", contains: [] };
|
|
995
|
-
let options = {
|
|
996
|
-
ignoreUnescapedHTML: false,
|
|
997
|
-
throwUnescapedHTML: false,
|
|
998
|
-
noHighlightRe: /^(no-?highlight)$/i,
|
|
999
|
-
languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
|
|
1000
|
-
classPrefix: "hljs-",
|
|
1001
|
-
cssSelector: "pre code",
|
|
1002
|
-
languages: null,
|
|
1003
|
-
// beta configuration options, subject to change, welcome to discuss
|
|
1004
|
-
// https://github.com/highlightjs/highlight.js/issues/1086
|
|
1005
|
-
__emitter: TokenTreeEmitter
|
|
1006
|
-
};
|
|
1007
|
-
function shouldNotHighlight(languageName) {
|
|
1008
|
-
return options.noHighlightRe.test(languageName);
|
|
1009
|
-
}
|
|
1010
|
-
function blockLanguage(block) {
|
|
1011
|
-
let classes = block.className + " ";
|
|
1012
|
-
classes += block.parentNode ? block.parentNode.className : "";
|
|
1013
|
-
const match = options.languageDetectRe.exec(classes);
|
|
1014
|
-
if (match) {
|
|
1015
|
-
const language = getLanguage(match[1]);
|
|
1016
|
-
if (!language) {
|
|
1017
|
-
warn(LANGUAGE_NOT_FOUND.replace("{}", match[1]));
|
|
1018
|
-
warn("Falling back to no-highlight mode for this block.", block);
|
|
1019
|
-
}
|
|
1020
|
-
return language ? match[1] : "no-highlight";
|
|
1021
|
-
}
|
|
1022
|
-
return classes.split(/\s+/).find((_class) => shouldNotHighlight(_class) || getLanguage(_class));
|
|
1023
|
-
}
|
|
1024
|
-
function highlight2(codeOrLanguageName, optionsOrCode, ignoreIllegals) {
|
|
1025
|
-
let code = "";
|
|
1026
|
-
let languageName = "";
|
|
1027
|
-
if (typeof optionsOrCode === "object") {
|
|
1028
|
-
code = codeOrLanguageName;
|
|
1029
|
-
ignoreIllegals = optionsOrCode.ignoreIllegals;
|
|
1030
|
-
languageName = optionsOrCode.language;
|
|
1031
|
-
} else {
|
|
1032
|
-
deprecated("10.7.0", "highlight(lang, code, ...args) has been deprecated.");
|
|
1033
|
-
deprecated("10.7.0", "Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277");
|
|
1034
|
-
languageName = codeOrLanguageName;
|
|
1035
|
-
code = optionsOrCode;
|
|
1036
|
-
}
|
|
1037
|
-
if (ignoreIllegals === void 0) {
|
|
1038
|
-
ignoreIllegals = true;
|
|
1039
|
-
}
|
|
1040
|
-
const context = {
|
|
1041
|
-
code,
|
|
1042
|
-
language: languageName
|
|
1043
|
-
};
|
|
1044
|
-
fire("before:highlight", context);
|
|
1045
|
-
const result = context.result ? context.result : _highlight(context.language, context.code, ignoreIllegals);
|
|
1046
|
-
result.code = context.code;
|
|
1047
|
-
fire("after:highlight", result);
|
|
1048
|
-
return result;
|
|
1049
|
-
}
|
|
1050
|
-
function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) {
|
|
1051
|
-
const keywordHits = /* @__PURE__ */ Object.create(null);
|
|
1052
|
-
function keywordData(mode, matchText) {
|
|
1053
|
-
return mode.keywords[matchText];
|
|
1054
|
-
}
|
|
1055
|
-
function processKeywords() {
|
|
1056
|
-
if (!top.keywords) {
|
|
1057
|
-
emitter.addText(modeBuffer);
|
|
1058
|
-
return;
|
|
1059
|
-
}
|
|
1060
|
-
let lastIndex = 0;
|
|
1061
|
-
top.keywordPatternRe.lastIndex = 0;
|
|
1062
|
-
let match = top.keywordPatternRe.exec(modeBuffer);
|
|
1063
|
-
let buf = "";
|
|
1064
|
-
while (match) {
|
|
1065
|
-
buf += modeBuffer.substring(lastIndex, match.index);
|
|
1066
|
-
const word = language.case_insensitive ? match[0].toLowerCase() : match[0];
|
|
1067
|
-
const data = keywordData(top, word);
|
|
1068
|
-
if (data) {
|
|
1069
|
-
const [kind, keywordRelevance] = data;
|
|
1070
|
-
emitter.addText(buf);
|
|
1071
|
-
buf = "";
|
|
1072
|
-
keywordHits[word] = (keywordHits[word] || 0) + 1;
|
|
1073
|
-
if (keywordHits[word] <= MAX_KEYWORD_HITS) relevance += keywordRelevance;
|
|
1074
|
-
if (kind.startsWith("_")) {
|
|
1075
|
-
buf += match[0];
|
|
1076
|
-
} else {
|
|
1077
|
-
const cssClass = language.classNameAliases[kind] || kind;
|
|
1078
|
-
emitKeyword(match[0], cssClass);
|
|
1079
|
-
}
|
|
1080
|
-
} else {
|
|
1081
|
-
buf += match[0];
|
|
1082
|
-
}
|
|
1083
|
-
lastIndex = top.keywordPatternRe.lastIndex;
|
|
1084
|
-
match = top.keywordPatternRe.exec(modeBuffer);
|
|
1085
|
-
}
|
|
1086
|
-
buf += modeBuffer.substring(lastIndex);
|
|
1087
|
-
emitter.addText(buf);
|
|
1088
|
-
}
|
|
1089
|
-
function processSubLanguage() {
|
|
1090
|
-
if (modeBuffer === "") return;
|
|
1091
|
-
let result2 = null;
|
|
1092
|
-
if (typeof top.subLanguage === "string") {
|
|
1093
|
-
if (!languages[top.subLanguage]) {
|
|
1094
|
-
emitter.addText(modeBuffer);
|
|
1095
|
-
return;
|
|
1096
|
-
}
|
|
1097
|
-
result2 = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]);
|
|
1098
|
-
continuations[top.subLanguage] = /** @type {CompiledMode} */
|
|
1099
|
-
result2._top;
|
|
1100
|
-
} else {
|
|
1101
|
-
result2 = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null);
|
|
1102
|
-
}
|
|
1103
|
-
if (top.relevance > 0) {
|
|
1104
|
-
relevance += result2.relevance;
|
|
1105
|
-
}
|
|
1106
|
-
emitter.__addSublanguage(result2._emitter, result2.language);
|
|
1107
|
-
}
|
|
1108
|
-
function processBuffer() {
|
|
1109
|
-
if (top.subLanguage != null) {
|
|
1110
|
-
processSubLanguage();
|
|
1111
|
-
} else {
|
|
1112
|
-
processKeywords();
|
|
1113
|
-
}
|
|
1114
|
-
modeBuffer = "";
|
|
1115
|
-
}
|
|
1116
|
-
function emitKeyword(keyword, scope) {
|
|
1117
|
-
if (keyword === "") return;
|
|
1118
|
-
emitter.startScope(scope);
|
|
1119
|
-
emitter.addText(keyword);
|
|
1120
|
-
emitter.endScope();
|
|
1121
|
-
}
|
|
1122
|
-
function emitMultiClass(scope, match) {
|
|
1123
|
-
let i = 1;
|
|
1124
|
-
const max = match.length - 1;
|
|
1125
|
-
while (i <= max) {
|
|
1126
|
-
if (!scope._emit[i]) {
|
|
1127
|
-
i++;
|
|
1128
|
-
continue;
|
|
1129
|
-
}
|
|
1130
|
-
const klass = language.classNameAliases[scope[i]] || scope[i];
|
|
1131
|
-
const text = match[i];
|
|
1132
|
-
if (klass) {
|
|
1133
|
-
emitKeyword(text, klass);
|
|
1134
|
-
} else {
|
|
1135
|
-
modeBuffer = text;
|
|
1136
|
-
processKeywords();
|
|
1137
|
-
modeBuffer = "";
|
|
1138
|
-
}
|
|
1139
|
-
i++;
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
function startNewMode(mode, match) {
|
|
1143
|
-
if (mode.scope && typeof mode.scope === "string") {
|
|
1144
|
-
emitter.openNode(language.classNameAliases[mode.scope] || mode.scope);
|
|
1145
|
-
}
|
|
1146
|
-
if (mode.beginScope) {
|
|
1147
|
-
if (mode.beginScope._wrap) {
|
|
1148
|
-
emitKeyword(modeBuffer, language.classNameAliases[mode.beginScope._wrap] || mode.beginScope._wrap);
|
|
1149
|
-
modeBuffer = "";
|
|
1150
|
-
} else if (mode.beginScope._multi) {
|
|
1151
|
-
emitMultiClass(mode.beginScope, match);
|
|
1152
|
-
modeBuffer = "";
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
top = Object.create(mode, { parent: { value: top } });
|
|
1156
|
-
return top;
|
|
1157
|
-
}
|
|
1158
|
-
function endOfMode(mode, match, matchPlusRemainder) {
|
|
1159
|
-
let matched = startsWith(mode.endRe, matchPlusRemainder);
|
|
1160
|
-
if (matched) {
|
|
1161
|
-
if (mode["on:end"]) {
|
|
1162
|
-
const resp = new Response(mode);
|
|
1163
|
-
mode["on:end"](match, resp);
|
|
1164
|
-
if (resp.isMatchIgnored) matched = false;
|
|
1165
|
-
}
|
|
1166
|
-
if (matched) {
|
|
1167
|
-
while (mode.endsParent && mode.parent) {
|
|
1168
|
-
mode = mode.parent;
|
|
1169
|
-
}
|
|
1170
|
-
return mode;
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
if (mode.endsWithParent) {
|
|
1174
|
-
return endOfMode(mode.parent, match, matchPlusRemainder);
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
function doIgnore(lexeme) {
|
|
1178
|
-
if (top.matcher.regexIndex === 0) {
|
|
1179
|
-
modeBuffer += lexeme[0];
|
|
1180
|
-
return 1;
|
|
1181
|
-
} else {
|
|
1182
|
-
resumeScanAtSamePosition = true;
|
|
1183
|
-
return 0;
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
function doBeginMatch(match) {
|
|
1187
|
-
const lexeme = match[0];
|
|
1188
|
-
const newMode = match.rule;
|
|
1189
|
-
const resp = new Response(newMode);
|
|
1190
|
-
const beforeCallbacks = [newMode.__beforeBegin, newMode["on:begin"]];
|
|
1191
|
-
for (const cb of beforeCallbacks) {
|
|
1192
|
-
if (!cb) continue;
|
|
1193
|
-
cb(match, resp);
|
|
1194
|
-
if (resp.isMatchIgnored) return doIgnore(lexeme);
|
|
1195
|
-
}
|
|
1196
|
-
if (newMode.skip) {
|
|
1197
|
-
modeBuffer += lexeme;
|
|
1198
|
-
} else {
|
|
1199
|
-
if (newMode.excludeBegin) {
|
|
1200
|
-
modeBuffer += lexeme;
|
|
1201
|
-
}
|
|
1202
|
-
processBuffer();
|
|
1203
|
-
if (!newMode.returnBegin && !newMode.excludeBegin) {
|
|
1204
|
-
modeBuffer = lexeme;
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
startNewMode(newMode, match);
|
|
1208
|
-
return newMode.returnBegin ? 0 : lexeme.length;
|
|
1209
|
-
}
|
|
1210
|
-
function doEndMatch(match) {
|
|
1211
|
-
const lexeme = match[0];
|
|
1212
|
-
const matchPlusRemainder = codeToHighlight.substring(match.index);
|
|
1213
|
-
const endMode = endOfMode(top, match, matchPlusRemainder);
|
|
1214
|
-
if (!endMode) {
|
|
1215
|
-
return NO_MATCH;
|
|
1216
|
-
}
|
|
1217
|
-
const origin = top;
|
|
1218
|
-
if (top.endScope && top.endScope._wrap) {
|
|
1219
|
-
processBuffer();
|
|
1220
|
-
emitKeyword(lexeme, top.endScope._wrap);
|
|
1221
|
-
} else if (top.endScope && top.endScope._multi) {
|
|
1222
|
-
processBuffer();
|
|
1223
|
-
emitMultiClass(top.endScope, match);
|
|
1224
|
-
} else if (origin.skip) {
|
|
1225
|
-
modeBuffer += lexeme;
|
|
1226
|
-
} else {
|
|
1227
|
-
if (!(origin.returnEnd || origin.excludeEnd)) {
|
|
1228
|
-
modeBuffer += lexeme;
|
|
1229
|
-
}
|
|
1230
|
-
processBuffer();
|
|
1231
|
-
if (origin.excludeEnd) {
|
|
1232
|
-
modeBuffer = lexeme;
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
do {
|
|
1236
|
-
if (top.scope) {
|
|
1237
|
-
emitter.closeNode();
|
|
1238
|
-
}
|
|
1239
|
-
if (!top.skip && !top.subLanguage) {
|
|
1240
|
-
relevance += top.relevance;
|
|
1241
|
-
}
|
|
1242
|
-
top = top.parent;
|
|
1243
|
-
} while (top !== endMode.parent);
|
|
1244
|
-
if (endMode.starts) {
|
|
1245
|
-
startNewMode(endMode.starts, match);
|
|
1246
|
-
}
|
|
1247
|
-
return origin.returnEnd ? 0 : lexeme.length;
|
|
1248
|
-
}
|
|
1249
|
-
function processContinuations() {
|
|
1250
|
-
const list = [];
|
|
1251
|
-
for (let current = top; current !== language; current = current.parent) {
|
|
1252
|
-
if (current.scope) {
|
|
1253
|
-
list.unshift(current.scope);
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
list.forEach((item) => emitter.openNode(item));
|
|
1257
|
-
}
|
|
1258
|
-
let lastMatch = {};
|
|
1259
|
-
function processLexeme(textBeforeMatch, match) {
|
|
1260
|
-
const lexeme = match && match[0];
|
|
1261
|
-
modeBuffer += textBeforeMatch;
|
|
1262
|
-
if (lexeme == null) {
|
|
1263
|
-
processBuffer();
|
|
1264
|
-
return 0;
|
|
1265
|
-
}
|
|
1266
|
-
if (lastMatch.type === "begin" && match.type === "end" && lastMatch.index === match.index && lexeme === "") {
|
|
1267
|
-
modeBuffer += codeToHighlight.slice(match.index, match.index + 1);
|
|
1268
|
-
if (!SAFE_MODE) {
|
|
1269
|
-
const err = new Error(`0 width match regex (${languageName})`);
|
|
1270
|
-
err.languageName = languageName;
|
|
1271
|
-
err.badRule = lastMatch.rule;
|
|
1272
|
-
throw err;
|
|
1273
|
-
}
|
|
1274
|
-
return 1;
|
|
1275
|
-
}
|
|
1276
|
-
lastMatch = match;
|
|
1277
|
-
if (match.type === "begin") {
|
|
1278
|
-
return doBeginMatch(match);
|
|
1279
|
-
} else if (match.type === "illegal" && !ignoreIllegals) {
|
|
1280
|
-
const err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.scope || "<unnamed>") + '"');
|
|
1281
|
-
err.mode = top;
|
|
1282
|
-
throw err;
|
|
1283
|
-
} else if (match.type === "end") {
|
|
1284
|
-
const processed = doEndMatch(match);
|
|
1285
|
-
if (processed !== NO_MATCH) {
|
|
1286
|
-
return processed;
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
if (match.type === "illegal" && lexeme === "") {
|
|
1290
|
-
return 1;
|
|
1291
|
-
}
|
|
1292
|
-
if (iterations > 1e5 && iterations > match.index * 3) {
|
|
1293
|
-
const err = new Error("potential infinite loop, way more iterations than matches");
|
|
1294
|
-
throw err;
|
|
1295
|
-
}
|
|
1296
|
-
modeBuffer += lexeme;
|
|
1297
|
-
return lexeme.length;
|
|
1298
|
-
}
|
|
1299
|
-
const language = getLanguage(languageName);
|
|
1300
|
-
if (!language) {
|
|
1301
|
-
error(LANGUAGE_NOT_FOUND.replace("{}", languageName));
|
|
1302
|
-
throw new Error('Unknown language: "' + languageName + '"');
|
|
1303
|
-
}
|
|
1304
|
-
const md = compileLanguage(language);
|
|
1305
|
-
let result = "";
|
|
1306
|
-
let top = continuation || md;
|
|
1307
|
-
const continuations = {};
|
|
1308
|
-
const emitter = new options.__emitter(options);
|
|
1309
|
-
processContinuations();
|
|
1310
|
-
let modeBuffer = "";
|
|
1311
|
-
let relevance = 0;
|
|
1312
|
-
let index = 0;
|
|
1313
|
-
let iterations = 0;
|
|
1314
|
-
let resumeScanAtSamePosition = false;
|
|
1315
|
-
try {
|
|
1316
|
-
if (!language.__emitTokens) {
|
|
1317
|
-
top.matcher.considerAll();
|
|
1318
|
-
for (; ; ) {
|
|
1319
|
-
iterations++;
|
|
1320
|
-
if (resumeScanAtSamePosition) {
|
|
1321
|
-
resumeScanAtSamePosition = false;
|
|
1322
|
-
} else {
|
|
1323
|
-
top.matcher.considerAll();
|
|
1324
|
-
}
|
|
1325
|
-
top.matcher.lastIndex = index;
|
|
1326
|
-
const match = top.matcher.exec(codeToHighlight);
|
|
1327
|
-
if (!match) break;
|
|
1328
|
-
const beforeMatch = codeToHighlight.substring(index, match.index);
|
|
1329
|
-
const processedCount = processLexeme(beforeMatch, match);
|
|
1330
|
-
index = match.index + processedCount;
|
|
1331
|
-
}
|
|
1332
|
-
processLexeme(codeToHighlight.substring(index));
|
|
1333
|
-
} else {
|
|
1334
|
-
language.__emitTokens(codeToHighlight, emitter);
|
|
1335
|
-
}
|
|
1336
|
-
emitter.finalize();
|
|
1337
|
-
result = emitter.toHTML();
|
|
1338
|
-
return {
|
|
1339
|
-
language: languageName,
|
|
1340
|
-
value: result,
|
|
1341
|
-
relevance,
|
|
1342
|
-
illegal: false,
|
|
1343
|
-
_emitter: emitter,
|
|
1344
|
-
_top: top
|
|
1345
|
-
};
|
|
1346
|
-
} catch (err) {
|
|
1347
|
-
if (err.message && err.message.includes("Illegal")) {
|
|
1348
|
-
return {
|
|
1349
|
-
language: languageName,
|
|
1350
|
-
value: escape(codeToHighlight),
|
|
1351
|
-
illegal: true,
|
|
1352
|
-
relevance: 0,
|
|
1353
|
-
_illegalBy: {
|
|
1354
|
-
message: err.message,
|
|
1355
|
-
index,
|
|
1356
|
-
context: codeToHighlight.slice(index - 100, index + 100),
|
|
1357
|
-
mode: err.mode,
|
|
1358
|
-
resultSoFar: result
|
|
1359
|
-
},
|
|
1360
|
-
_emitter: emitter
|
|
1361
|
-
};
|
|
1362
|
-
} else if (SAFE_MODE) {
|
|
1363
|
-
return {
|
|
1364
|
-
language: languageName,
|
|
1365
|
-
value: escape(codeToHighlight),
|
|
1366
|
-
illegal: false,
|
|
1367
|
-
relevance: 0,
|
|
1368
|
-
errorRaised: err,
|
|
1369
|
-
_emitter: emitter,
|
|
1370
|
-
_top: top
|
|
1371
|
-
};
|
|
1372
|
-
} else {
|
|
1373
|
-
throw err;
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
function justTextHighlightResult(code) {
|
|
1378
|
-
const result = {
|
|
1379
|
-
value: escape(code),
|
|
1380
|
-
illegal: false,
|
|
1381
|
-
relevance: 0,
|
|
1382
|
-
_top: PLAINTEXT_LANGUAGE,
|
|
1383
|
-
_emitter: new options.__emitter(options)
|
|
1384
|
-
};
|
|
1385
|
-
result._emitter.addText(code);
|
|
1386
|
-
return result;
|
|
1387
|
-
}
|
|
1388
|
-
function highlightAuto(code, languageSubset) {
|
|
1389
|
-
languageSubset = languageSubset || options.languages || Object.keys(languages);
|
|
1390
|
-
const plaintext = justTextHighlightResult(code);
|
|
1391
|
-
const results = languageSubset.filter(getLanguage).filter(autoDetection).map(
|
|
1392
|
-
(name) => _highlight(name, code, false)
|
|
1393
|
-
);
|
|
1394
|
-
results.unshift(plaintext);
|
|
1395
|
-
const sorted = results.sort((a, b) => {
|
|
1396
|
-
if (a.relevance !== b.relevance) return b.relevance - a.relevance;
|
|
1397
|
-
if (a.language && b.language) {
|
|
1398
|
-
if (getLanguage(a.language).supersetOf === b.language) {
|
|
1399
|
-
return 1;
|
|
1400
|
-
} else if (getLanguage(b.language).supersetOf === a.language) {
|
|
1401
|
-
return -1;
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
return 0;
|
|
1405
|
-
});
|
|
1406
|
-
const [best, secondBest] = sorted;
|
|
1407
|
-
const result = best;
|
|
1408
|
-
result.secondBest = secondBest;
|
|
1409
|
-
return result;
|
|
1410
|
-
}
|
|
1411
|
-
function updateClassName(element, currentLang, resultLang) {
|
|
1412
|
-
const language = currentLang && aliases[currentLang] || resultLang;
|
|
1413
|
-
element.classList.add("hljs");
|
|
1414
|
-
element.classList.add(`language-${language}`);
|
|
1415
|
-
}
|
|
1416
|
-
function highlightElement(element) {
|
|
1417
|
-
let node = null;
|
|
1418
|
-
const language = blockLanguage(element);
|
|
1419
|
-
if (shouldNotHighlight(language)) return;
|
|
1420
|
-
fire(
|
|
1421
|
-
"before:highlightElement",
|
|
1422
|
-
{ el: element, language }
|
|
1423
|
-
);
|
|
1424
|
-
if (element.dataset.highlighted) {
|
|
1425
|
-
console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", element);
|
|
1426
|
-
return;
|
|
1427
|
-
}
|
|
1428
|
-
if (element.children.length > 0) {
|
|
1429
|
-
if (!options.ignoreUnescapedHTML) {
|
|
1430
|
-
console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk.");
|
|
1431
|
-
console.warn("https://github.com/highlightjs/highlight.js/wiki/security");
|
|
1432
|
-
console.warn("The element with unescaped HTML:");
|
|
1433
|
-
console.warn(element);
|
|
1434
|
-
}
|
|
1435
|
-
if (options.throwUnescapedHTML) {
|
|
1436
|
-
const err = new HTMLInjectionError(
|
|
1437
|
-
"One of your code blocks includes unescaped HTML.",
|
|
1438
|
-
element.innerHTML
|
|
1439
|
-
);
|
|
1440
|
-
throw err;
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
node = element;
|
|
1444
|
-
const text = node.textContent;
|
|
1445
|
-
const result = language ? highlight2(text, { language, ignoreIllegals: true }) : highlightAuto(text);
|
|
1446
|
-
element.innerHTML = result.value;
|
|
1447
|
-
element.dataset.highlighted = "yes";
|
|
1448
|
-
updateClassName(element, language, result.language);
|
|
1449
|
-
element.result = {
|
|
1450
|
-
language: result.language,
|
|
1451
|
-
// TODO: remove with version 11.0
|
|
1452
|
-
re: result.relevance,
|
|
1453
|
-
relevance: result.relevance
|
|
1454
|
-
};
|
|
1455
|
-
if (result.secondBest) {
|
|
1456
|
-
element.secondBest = {
|
|
1457
|
-
language: result.secondBest.language,
|
|
1458
|
-
relevance: result.secondBest.relevance
|
|
1459
|
-
};
|
|
1460
|
-
}
|
|
1461
|
-
fire("after:highlightElement", { el: element, result, text });
|
|
1462
|
-
}
|
|
1463
|
-
function configure(userOptions) {
|
|
1464
|
-
options = inherit(options, userOptions);
|
|
1465
|
-
}
|
|
1466
|
-
const initHighlighting = () => {
|
|
1467
|
-
highlightAll();
|
|
1468
|
-
deprecated("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
|
|
1469
|
-
};
|
|
1470
|
-
function initHighlightingOnLoad() {
|
|
1471
|
-
highlightAll();
|
|
1472
|
-
deprecated("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
1473
|
-
}
|
|
1474
|
-
let wantsHighlight = false;
|
|
1475
|
-
function highlightAll() {
|
|
1476
|
-
if (document.readyState === "loading") {
|
|
1477
|
-
wantsHighlight = true;
|
|
1478
|
-
return;
|
|
1479
|
-
}
|
|
1480
|
-
const blocks = document.querySelectorAll(options.cssSelector);
|
|
1481
|
-
blocks.forEach(highlightElement);
|
|
1482
|
-
}
|
|
1483
|
-
function boot() {
|
|
1484
|
-
if (wantsHighlight) highlightAll();
|
|
1485
|
-
}
|
|
1486
|
-
if (typeof window !== "undefined" && window.addEventListener) {
|
|
1487
|
-
window.addEventListener("DOMContentLoaded", boot, false);
|
|
1488
|
-
}
|
|
1489
|
-
function registerLanguage(languageName, languageDefinition) {
|
|
1490
|
-
let lang = null;
|
|
1491
|
-
try {
|
|
1492
|
-
lang = languageDefinition(hljs);
|
|
1493
|
-
} catch (error$1) {
|
|
1494
|
-
error("Language definition for '{}' could not be registered.".replace("{}", languageName));
|
|
1495
|
-
if (!SAFE_MODE) {
|
|
1496
|
-
throw error$1;
|
|
1497
|
-
} else {
|
|
1498
|
-
error(error$1);
|
|
1499
|
-
}
|
|
1500
|
-
lang = PLAINTEXT_LANGUAGE;
|
|
1501
|
-
}
|
|
1502
|
-
if (!lang.name) lang.name = languageName;
|
|
1503
|
-
languages[languageName] = lang;
|
|
1504
|
-
lang.rawDefinition = languageDefinition.bind(null, hljs);
|
|
1505
|
-
if (lang.aliases) {
|
|
1506
|
-
registerAliases(lang.aliases, { languageName });
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
function unregisterLanguage(languageName) {
|
|
1510
|
-
delete languages[languageName];
|
|
1511
|
-
for (const alias of Object.keys(aliases)) {
|
|
1512
|
-
if (aliases[alias] === languageName) {
|
|
1513
|
-
delete aliases[alias];
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
function listLanguages() {
|
|
1518
|
-
return Object.keys(languages);
|
|
1519
|
-
}
|
|
1520
|
-
function getLanguage(name) {
|
|
1521
|
-
name = (name || "").toLowerCase();
|
|
1522
|
-
return languages[name] || languages[aliases[name]];
|
|
1523
|
-
}
|
|
1524
|
-
function registerAliases(aliasList, { languageName }) {
|
|
1525
|
-
if (typeof aliasList === "string") {
|
|
1526
|
-
aliasList = [aliasList];
|
|
1527
|
-
}
|
|
1528
|
-
aliasList.forEach((alias) => {
|
|
1529
|
-
aliases[alias.toLowerCase()] = languageName;
|
|
1530
|
-
});
|
|
1531
|
-
}
|
|
1532
|
-
function autoDetection(name) {
|
|
1533
|
-
const lang = getLanguage(name);
|
|
1534
|
-
return lang && !lang.disableAutodetect;
|
|
1535
|
-
}
|
|
1536
|
-
function upgradePluginAPI(plugin) {
|
|
1537
|
-
if (plugin["before:highlightBlock"] && !plugin["before:highlightElement"]) {
|
|
1538
|
-
plugin["before:highlightElement"] = (data) => {
|
|
1539
|
-
plugin["before:highlightBlock"](
|
|
1540
|
-
Object.assign({ block: data.el }, data)
|
|
1541
|
-
);
|
|
1542
|
-
};
|
|
1543
|
-
}
|
|
1544
|
-
if (plugin["after:highlightBlock"] && !plugin["after:highlightElement"]) {
|
|
1545
|
-
plugin["after:highlightElement"] = (data) => {
|
|
1546
|
-
plugin["after:highlightBlock"](
|
|
1547
|
-
Object.assign({ block: data.el }, data)
|
|
1548
|
-
);
|
|
1549
|
-
};
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
function addPlugin(plugin) {
|
|
1553
|
-
upgradePluginAPI(plugin);
|
|
1554
|
-
plugins.push(plugin);
|
|
1555
|
-
}
|
|
1556
|
-
function removePlugin(plugin) {
|
|
1557
|
-
const index = plugins.indexOf(plugin);
|
|
1558
|
-
if (index !== -1) {
|
|
1559
|
-
plugins.splice(index, 1);
|
|
1560
|
-
}
|
|
1561
|
-
}
|
|
1562
|
-
function fire(event, args) {
|
|
1563
|
-
const cb = event;
|
|
1564
|
-
plugins.forEach(function(plugin) {
|
|
1565
|
-
if (plugin[cb]) {
|
|
1566
|
-
plugin[cb](args);
|
|
1567
|
-
}
|
|
1568
|
-
});
|
|
1569
|
-
}
|
|
1570
|
-
function deprecateHighlightBlock(el) {
|
|
1571
|
-
deprecated("10.7.0", "highlightBlock will be removed entirely in v12.0");
|
|
1572
|
-
deprecated("10.7.0", "Please use highlightElement now.");
|
|
1573
|
-
return highlightElement(el);
|
|
1574
|
-
}
|
|
1575
|
-
Object.assign(hljs, {
|
|
1576
|
-
highlight: highlight2,
|
|
1577
|
-
highlightAuto,
|
|
1578
|
-
highlightAll,
|
|
1579
|
-
highlightElement,
|
|
1580
|
-
// TODO: Remove with v12 API
|
|
1581
|
-
highlightBlock: deprecateHighlightBlock,
|
|
1582
|
-
configure,
|
|
1583
|
-
initHighlighting,
|
|
1584
|
-
initHighlightingOnLoad,
|
|
1585
|
-
registerLanguage,
|
|
1586
|
-
unregisterLanguage,
|
|
1587
|
-
listLanguages,
|
|
1588
|
-
getLanguage,
|
|
1589
|
-
registerAliases,
|
|
1590
|
-
autoDetection,
|
|
1591
|
-
inherit,
|
|
1592
|
-
addPlugin,
|
|
1593
|
-
removePlugin
|
|
1594
|
-
});
|
|
1595
|
-
hljs.debugMode = function() {
|
|
1596
|
-
SAFE_MODE = false;
|
|
1597
|
-
};
|
|
1598
|
-
hljs.safeMode = function() {
|
|
1599
|
-
SAFE_MODE = true;
|
|
1600
|
-
};
|
|
1601
|
-
hljs.versionString = version;
|
|
1602
|
-
hljs.regex = {
|
|
1603
|
-
concat,
|
|
1604
|
-
lookahead,
|
|
1605
|
-
either,
|
|
1606
|
-
optional,
|
|
1607
|
-
anyNumberOfTimes
|
|
1608
|
-
};
|
|
1609
|
-
for (const key in MODES) {
|
|
1610
|
-
if (typeof MODES[key] === "object") {
|
|
1611
|
-
deepFreeze(MODES[key]);
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
Object.assign(hljs, MODES);
|
|
1615
|
-
return hljs;
|
|
1616
|
-
};
|
|
1617
|
-
const highlight = HLJS({});
|
|
1618
|
-
highlight.newInstance = () => HLJS({});
|
|
1619
|
-
core = highlight;
|
|
1620
|
-
highlight.HighlightJS = highlight;
|
|
1621
|
-
highlight.default = highlight;
|
|
1622
|
-
return core;
|
|
1623
|
-
}
|
|
1624
|
-
var coreExports = /* @__PURE__ */ requireCore();
|
|
1625
|
-
const HighlightJS = /* @__PURE__ */ getDefaultExportFromCjs(coreExports);
|
|
1626
|
-
const VueMarkdown = defineComponent({
|
|
1627
|
-
name: "VueMarkdown",
|
|
1628
|
-
props: {
|
|
1629
|
-
source: {
|
|
1630
|
-
type: String,
|
|
1631
|
-
required: true
|
|
1632
|
-
},
|
|
1633
|
-
options: {
|
|
1634
|
-
type: Object,
|
|
1635
|
-
required: false
|
|
1636
|
-
},
|
|
1637
|
-
plugins: {
|
|
1638
|
-
type: Array,
|
|
1639
|
-
required: false
|
|
1640
|
-
}
|
|
1641
|
-
},
|
|
1642
|
-
setup(props) {
|
|
1643
|
-
const md = ref(new MarkdownIt(props.options ?? {}));
|
|
1644
|
-
for (const plugin of props.plugins ?? []) {
|
|
1645
|
-
md.value.use(plugin);
|
|
1646
|
-
}
|
|
1647
|
-
const content = computed(() => md.value.render(props.source));
|
|
1648
|
-
return () => h("div", { innerHTML: content.value });
|
|
1649
|
-
}
|
|
1650
|
-
});
|
|
1651
78
|
var vueJsonPretty$1 = { exports: {} };
|
|
1652
79
|
var vueJsonPretty = vueJsonPretty$1.exports;
|
|
1653
80
|
var hasRequiredVueJsonPretty;
|
|
@@ -1740,20 +167,20 @@ function requireVueJsonPretty() {
|
|
|
1740
167
|
function p(e3) {
|
|
1741
168
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "root", n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, o2 = arguments.length > 3 ? arguments[3] : void 0, r2 = o2 || {}, l2 = r2.key, a2 = r2.index, c2 = r2.type, i2 = void 0 === c2 ? "content" : c2, u2 = r2.showComma, d2 = void 0 !== u2 && u2, f2 = r2.length, y2 = void 0 === f2 ? 1 : f2, v2 = s(e3);
|
|
1742
169
|
if ("array" === v2) {
|
|
1743
|
-
var b2 =
|
|
170
|
+
var b2 = h(e3.map(function(e4, o3, r3) {
|
|
1744
171
|
return p(e4, "".concat(t3, "[").concat(o3, "]"), n3 + 1, { index: o3, showComma: o3 !== r3.length - 1, length: y2, type: i2 });
|
|
1745
172
|
}));
|
|
1746
173
|
return [p("[", t3, n3, { showComma: false, key: l2, length: e3.length, type: "arrayStart" })[0]].concat(b2, p("]", t3, n3, { showComma: d2, length: e3.length, type: "arrayEnd" })[0]);
|
|
1747
174
|
}
|
|
1748
175
|
if ("object" === v2) {
|
|
1749
|
-
var g2 = Object.keys(e3), m2 =
|
|
176
|
+
var g2 = Object.keys(e3), m2 = h(g2.map(function(o3, r3, l3) {
|
|
1750
177
|
return p(e3[o3], /^[a-zA-Z_]\w*$/.test(o3) ? "".concat(t3, ".").concat(o3) : "".concat(t3, '["').concat(o3, '"]'), n3 + 1, { key: o3, showComma: r3 !== l3.length - 1, length: y2, type: i2 });
|
|
1751
178
|
}));
|
|
1752
179
|
return [p("{", t3, n3, { showComma: false, key: l2, index: a2, length: g2.length, type: "objectStart" })[0]].concat(m2, p("}", t3, n3, { showComma: d2, length: g2.length, type: "objectEnd" })[0]);
|
|
1753
180
|
}
|
|
1754
181
|
return [{ content: e3, level: n3, key: l2, index: a2, path: t3, showComma: d2, length: y2, type: i2 }];
|
|
1755
182
|
}
|
|
1756
|
-
function
|
|
183
|
+
function h(e3) {
|
|
1757
184
|
if ("function" == typeof Array.prototype.flat) return e3.flat();
|
|
1758
185
|
for (var t3 = n2(e3), o2 = []; t3.length; ) {
|
|
1759
186
|
var r2 = t3.shift();
|
|
@@ -1812,7 +239,7 @@ function requireVueJsonPretty() {
|
|
|
1812
239
|
return "multiple" === e3.selectableType;
|
|
1813
240
|
}), p2 = (0, a.computed)(function() {
|
|
1814
241
|
return "single" === e3.selectableType;
|
|
1815
|
-
}),
|
|
242
|
+
}), h2 = (0, a.computed)(function() {
|
|
1816
243
|
return e3.nodeSelectable(e3.node) && (d2.value || p2.value);
|
|
1817
244
|
}), f2 = (0, a.reactive)({ editing: false }), y2 = function(t4) {
|
|
1818
245
|
var o3, r3, l3 = "null" === (r3 = null === (o3 = t4.target) || void 0 === o3 ? void 0 : o3.value) ? null : "undefined" === r3 ? void 0 : "true" === r3 || "false" !== r3 && (r3[0] + r3[r3.length - 1] === '""' || r3[0] + r3[r3.length - 1] === "''" ? r3.slice(1, -1) : "number" == typeof Number(r3) && !isNaN(Number(r3)) || "NaN" === r3 ? Number(r3) : r3);
|
|
@@ -1830,7 +257,7 @@ function requireVueJsonPretty() {
|
|
|
1830
257
|
}, C2 = function() {
|
|
1831
258
|
n3("selectedChange", e3.node);
|
|
1832
259
|
}, k2 = function() {
|
|
1833
|
-
n3("nodeClick", e3.node),
|
|
260
|
+
n3("nodeClick", e3.node), h2.value && e3.selectOnClickNode && n3("selectedChange", e3.node);
|
|
1834
261
|
}, w = function(t4) {
|
|
1835
262
|
if (e3.editable && !f2.editing) {
|
|
1836
263
|
f2.editing = true;
|
|
@@ -1843,7 +270,7 @@ function requireVueJsonPretty() {
|
|
|
1843
270
|
};
|
|
1844
271
|
return function() {
|
|
1845
272
|
var t4, n4 = e3.node;
|
|
1846
|
-
return (0, a.createVNode)("div", { class: { "vjs-tree-node": true, "has-selector": e3.showSelectController, "has-carets": e3.showIcon, "is-highlight": e3.highlightSelectedNode && e3.checked }, onClick: k2, style: e3.style }, [e3.showLineNumber && (0, a.createVNode)("span", { class: "vjs-node-index" }, [n4.id + 1]), e3.showSelectController &&
|
|
273
|
+
return (0, a.createVNode)("div", { class: { "vjs-tree-node": true, "has-selector": e3.showSelectController, "has-carets": e3.showIcon, "is-highlight": e3.highlightSelectedNode && e3.checked }, onClick: k2, style: e3.style }, [e3.showLineNumber && (0, a.createVNode)("span", { class: "vjs-node-index" }, [n4.id + 1]), e3.showSelectController && h2.value && "objectEnd" !== n4.type && "arrayEnd" !== n4.type && (0, a.createVNode)(i, { isMultiple: d2.value, checked: e3.checked, onChange: C2 }, null), (0, a.createVNode)("div", { class: "vjs-indent" }, [Array.from(Array(n4.level)).map(function(t5, n5) {
|
|
1847
274
|
return (0, a.createVNode)("div", { key: n5, class: { "vjs-indent-unit": true, "has-line": e3.showLine } }, null);
|
|
1848
275
|
}), e3.showIcon && (0, a.createVNode)(u, { nodeType: n4.type, onClick: m2 }, null)]), n4.key && (0, a.createVNode)("span", { class: "vjs-key" }, [(t4 = e3.renderNodeKey, t4 ? t4({ node: e3.node, defaultKey: l2.value || "" }) : l2.value), (0, a.createVNode)("span", { class: "vjs-colon" }, [":".concat(e3.showKeyValueSpace ? " " : "")])]), (0, a.createVNode)("span", null, ["content" !== n4.type && n4.content ? (0, a.createVNode)(c, { data: n4.content.toString(), onClick: g2 }, null) : (0, a.createVNode)("span", { class: r2.value, onClick: !e3.editable || e3.editableTrigger && "click" !== e3.editableTrigger ? void 0 : w, onDblclick: e3.editable && "dblclick" === e3.editableTrigger ? w : void 0 }, [e3.editable && f2.editing ? (0, a.createVNode)("input", { value: v2.value, onChange: y2, style: { padding: "3px 8px", border: "1px solid #eee", boxShadow: "none", boxSizing: "border-box", borderRadius: 5, fontFamily: "inherit" } }, null) : b2()]), n4.showComma && (0, a.createVNode)("span", null, [","]), e3.showLength && e3.collapsed && (0, a.createVNode)("span", { class: "vjs-comment" }, [(0, a.createTextVNode)(" // "), n4.length, (0, a.createTextVNode)(" items ")])])]);
|
|
1849
276
|
};
|
|
@@ -1881,7 +308,7 @@ function requireVueJsonPretty() {
|
|
|
1881
308
|
var r3, a2 = o3.level >= t3, c3 = null === (r3 = e3.pathCollapsible) || void 0 === r3 ? void 0 : r3.call(e3, o3);
|
|
1882
309
|
return "objectStart" !== o3.type && "arrayStart" !== o3.type || !a2 && !c3 ? n3 : C(C({}, n3), {}, l({}, o3.path, 1));
|
|
1883
310
|
}, {});
|
|
1884
|
-
}, s2 = (0, a.reactive)({ translateY: 0, visibleData: null, hiddenPaths: d2(e3.deep) }),
|
|
311
|
+
}, s2 = (0, a.reactive)({ translateY: 0, visibleData: null, hiddenPaths: d2(e3.deep) }), h2 = (0, a.computed)(function() {
|
|
1885
312
|
for (var e4 = null, t3 = [], n3 = u2.value.length, o3 = 0; o3 < n3; o3++) {
|
|
1886
313
|
var r3 = C(C({}, u2.value[o3]), {}, { id: o3 }), l2 = s2.hiddenPaths[r3.path];
|
|
1887
314
|
if (e4 && e4.path === r3.path) {
|
|
@@ -1903,7 +330,7 @@ function requireVueJsonPretty() {
|
|
|
1903
330
|
}), v2 = (0, a.computed)(function() {
|
|
1904
331
|
return !e3.selectableType || e3.selectOnClickNode || e3.showSelectController ? "" : "When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail.";
|
|
1905
332
|
}), b2 = function() {
|
|
1906
|
-
var t3 =
|
|
333
|
+
var t3 = h2.value;
|
|
1907
334
|
if (e3.virtual) {
|
|
1908
335
|
var n3, o3 = e3.height / e3.itemHeight, r3 = (null === (n3 = i2.value) || void 0 === n3 ? void 0 : n3.scrollTop) || 0, l2 = Math.floor(r3 / e3.itemHeight), a2 = l2 < 0 ? 0 : l2 + o3 > t3.length ? t3.length - o3 : l2;
|
|
1909
336
|
a2 < 0 && (a2 = 0);
|
|
@@ -1967,7 +394,7 @@ function requireVueJsonPretty() {
|
|
|
1967
394
|
throw new Error("[VueJSONPretty] ".concat(e4));
|
|
1968
395
|
}(v2.value);
|
|
1969
396
|
}), (0, a.watchEffect)(function() {
|
|
1970
|
-
|
|
397
|
+
h2.value && b2();
|
|
1971
398
|
}), (0, a.watch)(function() {
|
|
1972
399
|
return e3.deep;
|
|
1973
400
|
}, function(e4) {
|
|
@@ -1976,7 +403,7 @@ function requireVueJsonPretty() {
|
|
|
1976
403
|
var t3, n3, o3 = null !== (t3 = e3.renderNodeKey) && void 0 !== t3 ? t3 : c2.renderNodeKey, r3 = null !== (n3 = e3.renderNodeValue) && void 0 !== n3 ? n3 : c2.renderNodeValue, l2 = s2.visibleData && s2.visibleData.map(function(t4) {
|
|
1977
404
|
return (0, a.createVNode)(g, { key: t4.id, node: t4, collapsed: !!s2.hiddenPaths[t4.path], showDoubleQuotes: e3.showDoubleQuotes, showLength: e3.showLength, checked: y2.value.includes(t4.path), selectableType: e3.selectableType, showLine: e3.showLine, showLineNumber: e3.showLineNumber, showSelectController: e3.showSelectController, selectOnClickNode: e3.selectOnClickNode, nodeSelectable: e3.nodeSelectable, highlightSelectedNode: e3.highlightSelectedNode, editable: e3.editable, editableTrigger: e3.editableTrigger, showIcon: e3.showIcon, showKeyValueSpace: e3.showKeyValueSpace, renderNodeKey: o3, renderNodeValue: r3, onNodeClick: w, onBracketsClick: j, onIconClick: S, onSelectedChange: k2, onValueChange: O, style: e3.itemHeight && 20 !== e3.itemHeight ? { lineHeight: "".concat(e3.itemHeight, "px") } : {} }, null);
|
|
1978
405
|
});
|
|
1979
|
-
return (0, a.createVNode)("div", { ref: i2, class: { "vjs-tree": true, "is-virtual": e3.virtual }, onScroll: e3.virtual ? m2 : void 0, style: e3.showLineNumber ? C({ paddingLeft: "".concat(12 * Number(u2.value.length.toString().length), "px") }, e3.style) : e3.style }, [e3.virtual ? (0, a.createVNode)("div", { class: "vjs-tree-list", style: { height: "".concat(e3.height, "px") } }, [(0, a.createVNode)("div", { class: "vjs-tree-list-holder", style: { height: "".concat(
|
|
406
|
+
return (0, a.createVNode)("div", { ref: i2, class: { "vjs-tree": true, "is-virtual": e3.virtual }, onScroll: e3.virtual ? m2 : void 0, style: e3.showLineNumber ? C({ paddingLeft: "".concat(12 * Number(u2.value.length.toString().length), "px") }, e3.style) : e3.style }, [e3.virtual ? (0, a.createVNode)("div", { class: "vjs-tree-list", style: { height: "".concat(e3.height, "px") } }, [(0, a.createVNode)("div", { class: "vjs-tree-list-holder", style: { height: "".concat(h2.value.length * e3.itemHeight, "px") } }, [(0, a.createVNode)("div", { class: "vjs-tree-list-holder-inner", style: { transform: "translateY(".concat(s2.translateY, "px)") } }, [l2])])]) : l2]);
|
|
1980
407
|
};
|
|
1981
408
|
} });
|
|
1982
409
|
}(), r;
|
|
@@ -3202,6 +1629,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3202
1629
|
hidePagination: { type: Boolean, default: false },
|
|
3203
1630
|
calloutMessage: { default: void 0 },
|
|
3204
1631
|
disableRunIndexSelection: { type: Boolean, default: false },
|
|
1632
|
+
disableDisplayModeSelection: { type: Boolean, default: false },
|
|
3205
1633
|
disableEdit: { type: Boolean, default: false },
|
|
3206
1634
|
disablePin: { type: Boolean, default: false },
|
|
3207
1635
|
compact: { type: Boolean, default: false },
|
|
@@ -3213,22 +1641,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3213
1641
|
emits: ["search", "runChange", "itemHover", "linkRun", "unlinkRun", "activatePane", "tableMounted", "displayModeChange", "collapsingTableColumnChanged"],
|
|
3214
1642
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
3215
1643
|
const LazyRunDataTable = defineAsyncComponent(
|
|
3216
|
-
async () => await __vitePreload(() => import("./RunDataTable-
|
|
1644
|
+
async () => await __vitePreload(() => import("./RunDataTable-DJu8Ut0r.js"), true ? __vite__mapDeps([0,1,2,3,4]) : void 0)
|
|
3217
1645
|
);
|
|
3218
1646
|
const LazyRunDataJson = defineAsyncComponent(
|
|
3219
|
-
async () => await __vitePreload(() => import("./RunDataJson-
|
|
1647
|
+
async () => await __vitePreload(() => import("./RunDataJson-12Py20Rs.js"), true ? __vite__mapDeps([5,1,2,6,3,7]) : void 0)
|
|
3220
1648
|
);
|
|
3221
1649
|
const LazyRunDataSchema = defineAsyncComponent(
|
|
3222
|
-
async () => await __vitePreload(() => import("./index-
|
|
1650
|
+
async () => await __vitePreload(() => import("./index-BmZCxv8-.js").then((n) => n.jr), true ? __vite__mapDeps([1,2]) : void 0)
|
|
3223
1651
|
);
|
|
3224
1652
|
const LazyRunDataHtml = defineAsyncComponent(
|
|
3225
1653
|
async () => await __vitePreload(() => Promise.resolve().then(() => RunDataHtml$1), true ? void 0 : void 0)
|
|
3226
1654
|
);
|
|
3227
1655
|
const LazyRunDataAi = defineAsyncComponent(
|
|
3228
|
-
async () => await __vitePreload(() => import("./RunDataParsedAiContent-
|
|
1656
|
+
async () => await __vitePreload(() => import("./RunDataParsedAiContent-DYz5OPxJ.js").then((n) => n.d), true ? __vite__mapDeps([8,1,2,9,10]) : void 0)
|
|
3229
1657
|
);
|
|
3230
1658
|
const LazyRunDataSearch = defineAsyncComponent(
|
|
3231
|
-
async () => await __vitePreload(() => import("./RunDataSearch-
|
|
1659
|
+
async () => await __vitePreload(() => import("./RunDataSearch-NmwtxOjZ.js"), true ? __vite__mapDeps([11,1,2,12]) : void 0)
|
|
3232
1660
|
);
|
|
3233
1661
|
const props = __props;
|
|
3234
1662
|
const emit = __emit;
|
|
@@ -4122,7 +2550,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4122
2550
|
}
|
|
4123
2551
|
__expose({ enterEditMode });
|
|
4124
2552
|
return (_ctx, _cache) => {
|
|
4125
|
-
const _component_i18n_t = resolveComponent("i18n-t");
|
|
4126
2553
|
const _directive_n8n_html = resolveDirective("n8n-html");
|
|
4127
2554
|
return openBlock(), createElementBlock("div", {
|
|
4128
2555
|
class: normalizeClass([
|
|
@@ -4218,7 +2645,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4218
2645
|
type: "tertiary",
|
|
4219
2646
|
onClick: _cache[2] || (_cache[2] = ($event) => emit("collapsingTableColumnChanged", null))
|
|
4220
2647
|
}, null, 8, ["class"])) : createCommentVNode("", true),
|
|
4221
|
-
withDirectives(
|
|
2648
|
+
!_ctx.disableDisplayModeSelection ? withDirectives((openBlock(), createBlock(_sfc_main$2, {
|
|
2649
|
+
key: 1,
|
|
4222
2650
|
compact: props.compact,
|
|
4223
2651
|
value: _ctx.displayMode,
|
|
4224
2652
|
"has-binary-data": binaryData.value.length > 0,
|
|
@@ -4226,14 +2654,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4226
2654
|
"node-generates-html": unref(activeNode)?.type === unref(HTML_NODE_TYPE) && unref(activeNode).parameters.operation === "generateHtmlTemplate",
|
|
4227
2655
|
"has-renderable-data": hasParsedAiContent.value,
|
|
4228
2656
|
onChange: onDisplayModeChange
|
|
4229
|
-
}, null, 8, ["compact", "value", "has-binary-data", "pane-type", "node-generates-html", "has-renderable-data"]), [
|
|
2657
|
+
}, null, 8, ["compact", "value", "has-binary-data", "pane-type", "node-generates-html", "has-renderable-data"])), [
|
|
4230
2658
|
[
|
|
4231
2659
|
vShow,
|
|
4232
2660
|
unref(hasPreviewSchema) || hasNodeRun.value && (inputData.value.length || binaryData.value.length || search2.value || hasMultipleInputNodes.value) && !editMode2.value.enabled
|
|
4233
2661
|
]
|
|
4234
|
-
]),
|
|
2662
|
+
]) : createCommentVNode("", true),
|
|
4235
2663
|
!props.disableEdit && canPinData.value && !isReadOnlyRoute.value && !readOnlyEnv.value ? withDirectives((openBlock(), createBlock(unref(_sfc_main$b), {
|
|
4236
|
-
key:
|
|
2664
|
+
key: 2,
|
|
4237
2665
|
title: unref(i18n).baseText("runData.editOutput"),
|
|
4238
2666
|
circle: false,
|
|
4239
2667
|
disabled: node.value?.disabled,
|
|
@@ -4245,7 +2673,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4245
2673
|
[vShow, !editMode2.value.enabled]
|
|
4246
2674
|
]) : createCommentVNode("", true),
|
|
4247
2675
|
showPinButton.value ? (openBlock(), createBlock(RunDataPinButton, {
|
|
4248
|
-
key:
|
|
2676
|
+
key: 3,
|
|
4249
2677
|
disabled: pinButtonDisabled.value,
|
|
4250
2678
|
"tooltip-contents-visibility": {
|
|
4251
2679
|
binaryDataTooltipContent: !!binaryData.value?.length,
|
|
@@ -4256,7 +2684,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4256
2684
|
onTogglePinData: _cache[4] || (_cache[4] = ($event) => onTogglePinData({ source: "pin-icon-click" }))
|
|
4257
2685
|
}, null, 8, ["disabled", "tooltip-contents-visibility", "data-pinning-docs-url", "pinned-data"])) : createCommentVNode("", true),
|
|
4258
2686
|
!props.disableEdit ? withDirectives((openBlock(), createElementBlock("div", {
|
|
4259
|
-
key:
|
|
2687
|
+
key: 4,
|
|
4260
2688
|
class: normalizeClass(_ctx.$style.editModeActions)
|
|
4261
2689
|
}, [
|
|
4262
2690
|
createVNode(unref(N8nButton), {
|
|
@@ -4603,9 +3031,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4603
3031
|
}),
|
|
4604
3032
|
createVNode(unref(N8nText), null, {
|
|
4605
3033
|
default: withCtx(() => [
|
|
4606
|
-
createVNode(
|
|
3034
|
+
createVNode(unref(I18nT), {
|
|
4607
3035
|
keypath: "ndv.search.noMatch.description",
|
|
4608
|
-
tag: "span"
|
|
3036
|
+
tag: "span",
|
|
3037
|
+
scope: "global"
|
|
4609
3038
|
}, {
|
|
4610
3039
|
link: withCtx(() => [
|
|
4611
3040
|
createBaseVNode("a", {
|
|
@@ -4696,9 +3125,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4696
3125
|
}),
|
|
4697
3126
|
createVNode(unref(N8nText), null, {
|
|
4698
3127
|
default: withCtx(() => [
|
|
4699
|
-
createVNode(
|
|
3128
|
+
createVNode(unref(I18nT), {
|
|
4700
3129
|
keypath: "ndv.search.noMatch.description",
|
|
4701
|
-
tag: "span"
|
|
3130
|
+
tag: "span",
|
|
3131
|
+
scope: "global"
|
|
4702
3132
|
}, {
|
|
4703
3133
|
link: withCtx(() => [
|
|
4704
3134
|
createBaseVNode("a", {
|
|
@@ -5035,14 +3465,163 @@ const style0 = {
|
|
|
5035
3465
|
const cssModules = {
|
|
5036
3466
|
"$style": style0
|
|
5037
3467
|
};
|
|
5038
|
-
const RunData = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-
|
|
3468
|
+
const RunData = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-d4a2273f"]]);
|
|
3469
|
+
const canvasEventBus = createEventBus();
|
|
3470
|
+
const useExperimentalNdvStore = defineStore("experimentalNdv", () => {
|
|
3471
|
+
const workflowStore = useWorkflowsStore();
|
|
3472
|
+
const settingsStore = useSettingsStore();
|
|
3473
|
+
const isEnabled = computed(
|
|
3474
|
+
() => !Number.isNaN(settingsStore.experimental__minZoomNodeSettingsInCanvas) && settingsStore.experimental__minZoomNodeSettingsInCanvas > 0
|
|
3475
|
+
);
|
|
3476
|
+
const maxCanvasZoom = computed(
|
|
3477
|
+
() => isEnabled.value ? settingsStore.experimental__minZoomNodeSettingsInCanvas : 4
|
|
3478
|
+
);
|
|
3479
|
+
const collapsedNodes = shallowRef({});
|
|
3480
|
+
function setNodeExpanded(nodeId, isExpanded) {
|
|
3481
|
+
collapsedNodes.value = {
|
|
3482
|
+
...collapsedNodes.value,
|
|
3483
|
+
[nodeId]: isExpanded === void 0 ? !collapsedNodes.value[nodeId] : !isExpanded
|
|
3484
|
+
};
|
|
3485
|
+
}
|
|
3486
|
+
function collapseAllNodes() {
|
|
3487
|
+
collapsedNodes.value = workflowStore.allNodes.reduce(
|
|
3488
|
+
(acc, node) => {
|
|
3489
|
+
acc[node.id] = true;
|
|
3490
|
+
return acc;
|
|
3491
|
+
},
|
|
3492
|
+
{}
|
|
3493
|
+
);
|
|
3494
|
+
}
|
|
3495
|
+
function expandAllNodes() {
|
|
3496
|
+
collapsedNodes.value = {};
|
|
3497
|
+
}
|
|
3498
|
+
function isActive(canvasZoom) {
|
|
3499
|
+
return isEnabled.value && canvasZoom === maxCanvasZoom.value;
|
|
3500
|
+
}
|
|
3501
|
+
function focusNode(nodeId) {
|
|
3502
|
+
const nodeToFocus = workflowStore.getNodeById(nodeId);
|
|
3503
|
+
if (!nodeToFocus) {
|
|
3504
|
+
return;
|
|
3505
|
+
}
|
|
3506
|
+
const vueFlow = useVueFlow(workflowStore.workflow.id);
|
|
3507
|
+
collapsedNodes.value = workflowStore.allNodes.reduce(
|
|
3508
|
+
(acc, node) => {
|
|
3509
|
+
acc[node.id] = node.id !== nodeId;
|
|
3510
|
+
return acc;
|
|
3511
|
+
},
|
|
3512
|
+
{}
|
|
3513
|
+
);
|
|
3514
|
+
const workflow = workflowStore.getCurrentWorkflow();
|
|
3515
|
+
const nodeSize = calculateNodeSize(
|
|
3516
|
+
workflow.getChildNodes(nodeToFocus.name, "ALL_NON_MAIN").length > 0,
|
|
3517
|
+
workflow.getParentNodes(nodeToFocus.name, "ALL_NON_MAIN").length > 0,
|
|
3518
|
+
workflow.getParentNodes(nodeToFocus.name, "main").length,
|
|
3519
|
+
workflow.getChildNodes(nodeToFocus.name, "main").length,
|
|
3520
|
+
workflow.getParentNodes(nodeToFocus.name, "ALL_NON_MAIN").length
|
|
3521
|
+
);
|
|
3522
|
+
void vueFlow.setCenter(
|
|
3523
|
+
nodeToFocus.position[0] + nodeSize.width * 1.5 / 2,
|
|
3524
|
+
nodeToFocus.position[1] + 80,
|
|
3525
|
+
{ duration: 200, zoom: maxCanvasZoom.value }
|
|
3526
|
+
);
|
|
3527
|
+
}
|
|
3528
|
+
return {
|
|
3529
|
+
isEnabled,
|
|
3530
|
+
maxCanvasZoom,
|
|
3531
|
+
collapsedNodes: computed(() => collapsedNodes.value),
|
|
3532
|
+
isActive,
|
|
3533
|
+
setNodeExpanded,
|
|
3534
|
+
expandAllNodes,
|
|
3535
|
+
collapseAllNodes,
|
|
3536
|
+
focusNode
|
|
3537
|
+
};
|
|
3538
|
+
});
|
|
3539
|
+
const useKeybindings = (keymap, options) => {
|
|
3540
|
+
const pipWindow = inject(PiPWindowSymbol, ref());
|
|
3541
|
+
const activeElement = useActiveElement({ window: pipWindow?.value });
|
|
3542
|
+
const { isCtrlKeyPressed } = useDeviceSupport();
|
|
3543
|
+
const isDisabled = computed(() => toValue(options?.disabled));
|
|
3544
|
+
const ignoreKeyPresses = computed(() => {
|
|
3545
|
+
if (!activeElement.value) return false;
|
|
3546
|
+
const active = activeElement.value;
|
|
3547
|
+
const isInput = ["INPUT", "TEXTAREA"].includes(active.tagName);
|
|
3548
|
+
const isContentEditable = active.closest("[contenteditable]") !== null;
|
|
3549
|
+
const isIgnoreClass = active.closest(".ignore-key-press-canvas") !== null;
|
|
3550
|
+
return isInput || isContentEditable || isIgnoreClass;
|
|
3551
|
+
});
|
|
3552
|
+
const normalizedKeymap = computed(
|
|
3553
|
+
() => Object.fromEntries(
|
|
3554
|
+
Object.entries(toValue(keymap)).flatMap(([shortcut, handler]) => {
|
|
3555
|
+
const shortcuts = shortcut.split("|");
|
|
3556
|
+
return shortcuts.map((s) => [normalizeShortcutString(s), handler]);
|
|
3557
|
+
})
|
|
3558
|
+
)
|
|
3559
|
+
);
|
|
3560
|
+
function shortcutPartsToString(parts) {
|
|
3561
|
+
return parts.map((key) => key.toLowerCase()).sort((a, b) => a.localeCompare(b)).join("+");
|
|
3562
|
+
}
|
|
3563
|
+
function normalizeShortcutString(shortcut) {
|
|
3564
|
+
if (shortcut.length === 1) {
|
|
3565
|
+
return shortcut.toLowerCase();
|
|
3566
|
+
}
|
|
3567
|
+
const splitChars = ["+", "_", "-"];
|
|
3568
|
+
const splitCharsRegEx = splitChars.reduce((acc, char) => {
|
|
3569
|
+
if (shortcut.startsWith(char) || shortcut.endsWith(char)) {
|
|
3570
|
+
return acc;
|
|
3571
|
+
}
|
|
3572
|
+
return char + acc;
|
|
3573
|
+
}, "");
|
|
3574
|
+
return shortcutPartsToString(shortcut.split(new RegExp(`[${splitCharsRegEx}]`)));
|
|
3575
|
+
}
|
|
3576
|
+
function keyboardEventCodeToKey(code) {
|
|
3577
|
+
if (code.startsWith("Digit")) {
|
|
3578
|
+
return code.replace("Digit", "").toLowerCase();
|
|
3579
|
+
} else if (code.startsWith("Key")) {
|
|
3580
|
+
return code.replace("Key", "").toLowerCase();
|
|
3581
|
+
}
|
|
3582
|
+
return code.toLowerCase();
|
|
3583
|
+
}
|
|
3584
|
+
function toShortcutString(event) {
|
|
3585
|
+
const { shiftKey, altKey } = event;
|
|
3586
|
+
const ctrlKey = isCtrlKeyPressed(event);
|
|
3587
|
+
const keys = "key" in event ? [event.key] : [];
|
|
3588
|
+
const codes = "code" in event ? [keyboardEventCodeToKey(event.code)] : [];
|
|
3589
|
+
const modifiers = [];
|
|
3590
|
+
if (shiftKey) {
|
|
3591
|
+
modifiers.push("shift");
|
|
3592
|
+
}
|
|
3593
|
+
if (ctrlKey) {
|
|
3594
|
+
modifiers.push("ctrl");
|
|
3595
|
+
}
|
|
3596
|
+
if (altKey) {
|
|
3597
|
+
modifiers.push("alt");
|
|
3598
|
+
}
|
|
3599
|
+
return {
|
|
3600
|
+
byKey: shortcutPartsToString([...modifiers, ...keys]),
|
|
3601
|
+
byCode: shortcutPartsToString([...modifiers, ...codes])
|
|
3602
|
+
};
|
|
3603
|
+
}
|
|
3604
|
+
function onKeyDown(event) {
|
|
3605
|
+
if (ignoreKeyPresses.value || isDisabled.value) return;
|
|
3606
|
+
const { byKey, byCode } = toShortcutString(event);
|
|
3607
|
+
const handler = normalizedKeymap.value[byKey] ?? normalizedKeymap.value[byCode];
|
|
3608
|
+
const run = typeof handler === "function" ? handler : handler?.disabled() ? void 0 : handler?.run;
|
|
3609
|
+
if (run) {
|
|
3610
|
+
event.preventDefault();
|
|
3611
|
+
event.stopPropagation();
|
|
3612
|
+
run(event);
|
|
3613
|
+
}
|
|
3614
|
+
}
|
|
3615
|
+
useEventListener(pipWindow?.value?.document ?? document, "keydown", onKeyDown);
|
|
3616
|
+
};
|
|
5039
3617
|
export {
|
|
5040
|
-
|
|
3618
|
+
N8nBlockUi as N,
|
|
5041
3619
|
RunData as R,
|
|
5042
|
-
|
|
5043
|
-
_sfc_main$
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
parseErrorMetadata as p
|
|
3620
|
+
VueJsonPretty as V,
|
|
3621
|
+
_sfc_main$6 as _,
|
|
3622
|
+
useKeybindings as a,
|
|
3623
|
+
ViewSubExecution as b,
|
|
3624
|
+
canvasEventBus as c,
|
|
3625
|
+
parseErrorMetadata as p,
|
|
3626
|
+
useExperimentalNdvStore as u
|
|
5048
3627
|
};
|