drizzle-cube 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/ActivityGridChart.config-BlZclX_9.js +1 -0
- package/dist/adapters/ActivityGridChart.config-D2v_XyY0.cjs +1 -0
- package/dist/adapters/AreaChart.config-2uBmxi1-.js +1 -0
- package/dist/adapters/AreaChart.config-CSusw7MI.cjs +1 -0
- package/dist/adapters/BarChart.config-CEs8zlOd.js +1 -0
- package/dist/adapters/BarChart.config-DDokCRL0.cjs +1 -0
- package/dist/adapters/BoxPlotChart.config-DGkPSj3b.js +1 -0
- package/dist/adapters/BoxPlotChart.config-DNAAV5ds.cjs +1 -0
- package/dist/adapters/BubbleChart.config-Cj2A1IL9.cjs +1 -0
- package/dist/adapters/BubbleChart.config-Hp4hDwos.js +1 -0
- package/dist/adapters/CandlestickChart.config-BfL2kxsO.js +1 -0
- package/dist/adapters/CandlestickChart.config-CyzAcJb2.cjs +1 -0
- package/dist/adapters/DataTable.config-D9Ug46tb.cjs +1 -0
- package/dist/adapters/DataTable.config-r5Fa9uae.js +1 -0
- package/dist/adapters/DotStripChart.config-BTqmxVm2.js +1 -0
- package/dist/adapters/DotStripChart.config-Bu0J9BYY.cjs +1 -0
- package/dist/adapters/FunnelChart.config-BedIayLz.cjs +1 -0
- package/dist/adapters/FunnelChart.config-dT9ymf6H.js +1 -0
- package/dist/adapters/GaugeChart.config-DJy3xApn.cjs +1 -0
- package/dist/adapters/GaugeChart.config-DZRniX9X.js +1 -0
- package/dist/adapters/HeatMapChart.config-AUCbOuee.cjs +1 -0
- package/dist/adapters/HeatMapChart.config-CCX0y6Nu.js +1 -0
- package/dist/adapters/KpiDelta.config-1fGFn_si.cjs +1 -0
- package/dist/adapters/KpiDelta.config-CMiZaD_K.js +1 -0
- package/dist/adapters/KpiNumber.config-CUXAwnLQ.js +1 -0
- package/dist/adapters/KpiNumber.config-jCFoR8UV.cjs +1 -0
- package/dist/adapters/KpiText.config-B6JsJGlt.js +1 -0
- package/dist/adapters/KpiText.config-T5Tk8B93.cjs +1 -0
- package/dist/adapters/LineChart.config-BDAVOwzV.js +1 -0
- package/dist/adapters/LineChart.config-rVRUAwRc.cjs +1 -0
- package/dist/adapters/MarkdownChart.config-C1N51S30.cjs +1 -0
- package/dist/adapters/MarkdownChart.config-DcILjPyK.js +1 -0
- package/dist/adapters/MeasureProfileChart.config-D6TDwz3r.js +1 -0
- package/dist/adapters/MeasureProfileChart.config-fMvKKyHq.cjs +1 -0
- package/dist/adapters/PieChart.config-Dlv0S8-5.cjs +1 -0
- package/dist/adapters/PieChart.config-L1EEHJAB.js +1 -0
- package/dist/adapters/ProportionBarChart.config-CaXGpruG.js +1 -0
- package/dist/adapters/ProportionBarChart.config-DGhKCGYw.cjs +1 -0
- package/dist/adapters/RadarChart.config-BIJ84MZl.cjs +1 -0
- package/dist/adapters/RadarChart.config-NJDXWxTM.js +1 -0
- package/dist/adapters/RadialBarChart.config-C2AX5IRD.js +1 -0
- package/dist/adapters/RadialBarChart.config-D_Dk3f-2.cjs +1 -0
- package/dist/adapters/RecordsTable.config-C0YqdTyB.cjs +1 -0
- package/dist/adapters/RecordsTable.config-CyYJtLoq.js +1 -0
- package/dist/adapters/RetentionCombinedChart.config-6_vW_fo0.cjs +1 -0
- package/dist/adapters/RetentionCombinedChart.config-Cth5Fvoh.js +1 -0
- package/dist/adapters/RetentionHeatmap.config-DDL2t7qk.cjs +1 -0
- package/dist/adapters/RetentionHeatmap.config-O4e7Heos.js +1 -0
- package/dist/adapters/SankeyChart.config-D36FHKUf.js +1 -0
- package/dist/adapters/SankeyChart.config-DWn_Gidq.cjs +1 -0
- package/dist/adapters/ScatterChart.config-CkUpXGjq.cjs +1 -0
- package/dist/adapters/ScatterChart.config-DHHhm4K7.js +1 -0
- package/dist/adapters/SunburstChart.config-CDqzb5xW.cjs +1 -0
- package/dist/adapters/SunburstChart.config-Dxh57sv_.js +1 -0
- package/dist/adapters/TreeMapChart.config--RHay3WA.js +1 -0
- package/dist/adapters/TreeMapChart.config-BcJ0H_xg.cjs +1 -0
- package/dist/adapters/WaterfallChart.config-DKscCBNm.cjs +1 -0
- package/dist/adapters/WaterfallChart.config-gDygj8Ko.js +1 -0
- package/dist/adapters/core/index.cjs +1 -1
- package/dist/adapters/core/index.js +1 -1
- package/dist/adapters/{core-Bb61BBaY.cjs → core-YfzziyUf.cjs} +1 -1
- package/dist/adapters/{core-DEn53hp7.js → core-wxT6B2Cm.js} +2 -2
- package/dist/adapters/{cors-headers--zwd9Fnx.js → cors-headers-BeWxPGlM.js} +1 -1
- package/dist/adapters/{cors-headers-BOUMJEnB.cjs → cors-headers-CEdKM8L_.cjs} +1 -1
- package/dist/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +5 -5
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +5 -5
- package/dist/adapters/{handler-CQhqvHnT.cjs → handler-Ch9YaC4G.cjs} +3 -3
- package/dist/adapters/{handler-CREhpjLZ.js → handler-rUTCH36J.js} +32 -32
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +4 -4
- package/dist/adapters/mcp-app-html.cjs +1 -1
- package/dist/adapters/mcp-app-html.js +1 -1
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +2 -2
- package/dist/adapters/{mcp-transport-PEmdNS4r.cjs → mcp-transport-CDSbAnfH.cjs} +1 -1
- package/dist/adapters/{mcp-transport-_oHCd2rj.js → mcp-transport-DCyksRMv.js} +1 -1
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +5 -5
- package/dist/adapters/{openai-CaxTRQ32.js → openai-B9CJ0Gw3.js} +1 -1
- package/dist/adapters/{openai-DQNzLnj1.cjs → openai-CPTovs2d.cjs} +1 -1
- package/dist/adapters/{openai-BgICnFmA.cjs → openai-CrNRNE9c.cjs} +1 -1
- package/dist/adapters/{openai-lRcjN8pG.js → openai-mmY4YK81.js} +1 -1
- package/dist/adapters/utils-D0jq702C.cjs +141 -0
- package/dist/adapters/{utils-ClqFyZ-5.js → utils-wjO1gfkH.js} +2 -0
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.js +1 -1
- package/dist/cjs/client/charts/chartConfigs.d.ts +12 -0
- package/dist/cjs/client/charts.d.ts +1 -1
- package/dist/cjs/client/components/AnalysisBuilder/AnalysisResultsHeader.d.ts +2 -0
- package/dist/cjs/client/components/DashboardPortletCard.d.ts +1 -1
- package/dist/cjs/client/components/RowManagedLayout.d.ts +3 -1
- package/dist/cjs/client/components/analyticsPortlet/PortletChart.d.ts +5 -1
- package/dist/cjs/client/components/analyticsPortlet/PortletChartView.d.ts +5 -1
- package/dist/cjs/client/components/analyticsPortlet/PortletStates.d.ts +9 -1
- package/dist/cjs/client/components/analyticsPortlet/portletRenderState.d.ts +7 -1
- package/dist/cjs/client/components/charts/MarkdownChart.d.ts +1 -1
- package/dist/cjs/client/components/charts/markdownDisclosure.d.ts +14 -0
- package/dist/cjs/client/components/dashboardPortletCard/PortletCardHeader.d.ts +1 -0
- package/dist/cjs/client/components/dashboardPortletCard/PortletFloatingActions.d.ts +1 -0
- package/dist/cjs/client/components/dashboardPortletCard/cardStyles.d.ts +2 -0
- package/dist/cjs/client/components/dashboardPortletCard/propsEqual.d.ts +2 -0
- package/dist/cjs/client/components/dashboardPortletCard/usePortletCardActions.d.ts +4 -1
- package/dist/cjs/client/hooks/dashboard/layoutUtils.d.ts +11 -0
- package/dist/cjs/client/hooks/useAnalysisQuery.d.ts +6 -0
- package/dist/cjs/client/icons/registry.d.ts +3 -1
- package/dist/cjs/client/index.d.ts +2 -2
- package/dist/cjs/client/types.d.ts +28 -0
- package/dist/cjs/client/utils/exportXlsx.d.ts +7 -0
- package/dist/cjs/client/utils/index.d.ts +1 -1
- package/dist/client/charts/chartConfigs.d.ts +12 -0
- package/dist/client/charts.d.ts +1 -1
- package/dist/client/charts.js +12 -12
- package/dist/client/chunks/{ActivityGridChart-t6JS9q1q.js → ActivityGridChart-sfYPWaLI.js} +2 -2
- package/dist/client/chunks/{ActivityGridChart-t6JS9q1q.js.map → ActivityGridChart-sfYPWaLI.js.map} +1 -1
- package/dist/client/chunks/{BubbleChart-E0IoByRb.js → BubbleChart-BgsVoVgO.js} +3 -5
- package/dist/client/chunks/BubbleChart-BgsVoVgO.js.map +1 -0
- package/dist/client/chunks/{ChartStates-BMRzDVW2.js → ChartStates-CrNiZI5S.js} +2 -2
- package/dist/client/chunks/{ChartStates-BMRzDVW2.js.map → ChartStates-CrNiZI5S.js.map} +1 -1
- package/dist/client/chunks/{ChartSummaryHeader-CIVTb1NC.js → ChartSummaryHeader-DO6M92dC.js} +2 -2
- package/dist/client/chunks/{ChartSummaryHeader-CIVTb1NC.js.map → ChartSummaryHeader-DO6M92dC.js.map} +1 -1
- package/dist/client/chunks/{DashboardEditModal-Fx3EXgIk.js → DashboardEditModal-CnQ2NR2Q.js} +1810 -1733
- package/dist/client/chunks/DashboardEditModal-CnQ2NR2Q.js.map +1 -0
- package/dist/client/chunks/{DataHistogram-omihvcZL.js → DataHistogram-CHFy7ztz.js} +2 -2
- package/dist/client/chunks/{DataHistogram-omihvcZL.js.map → DataHistogram-CHFy7ztz.js.map} +1 -1
- package/dist/client/chunks/{DotStripChart-iVRVliSr.js → DotStripChart-Bz5IC3Q1.js} +4 -4
- package/dist/client/chunks/{DotStripChart-iVRVliSr.js.map → DotStripChart-Bz5IC3Q1.js.map} +1 -1
- package/dist/client/chunks/{FunnelViews-C7joNDMs.js → FunnelViews-BLHRyHAU.js} +2 -2
- package/dist/client/chunks/{FunnelViews-C7joNDMs.js.map → FunnelViews-BLHRyHAU.js.map} +1 -1
- package/dist/client/chunks/{HeatMapChart-nPiSSTET.js → HeatMapChart-JjUF0zDX.js} +3 -3
- package/dist/client/chunks/{HeatMapChart-nPiSSTET.js.map → HeatMapChart-JjUF0zDX.js.map} +1 -1
- package/dist/client/chunks/{KpiDelta-5bl1vkTe.js → KpiDelta-B6SN3viX.js} +2 -2
- package/dist/client/chunks/{KpiDelta-5bl1vkTe.js.map → KpiDelta-B6SN3viX.js.map} +1 -1
- package/dist/client/chunks/{KpiText-l1GtL83c.js → KpiText-z_vo4xcE.js} +2 -2
- package/dist/client/chunks/{KpiText-l1GtL83c.js.map → KpiText-z_vo4xcE.js.map} +1 -1
- package/dist/client/chunks/{MarkdownChart-CO0eGGo3.js → MarkdownChart-BKQl0PAy.js} +1125 -1059
- package/dist/client/chunks/MarkdownChart-BKQl0PAy.js.map +1 -0
- package/dist/client/chunks/{PortletAnalysisModal-BNygY4TN.js → PortletAnalysisModal-XfCy-bY3.js} +5 -5
- package/dist/client/chunks/{PortletAnalysisModal-BNygY4TN.js.map → PortletAnalysisModal-XfCy-bY3.js.map} +1 -1
- package/dist/client/chunks/{ProportionBarChart-BxSBzz9F.js → ProportionBarChart-tVmEO5Xi.js} +4 -4
- package/dist/client/chunks/{ProportionBarChart-BxSBzz9F.js.map → ProportionBarChart-tVmEO5Xi.js.map} +1 -1
- package/dist/client/chunks/{RecordsTable-Ce86xEEb.js → RecordsTable-X4-iL03N.js} +4 -4
- package/dist/client/chunks/{RecordsTable-Ce86xEEb.js.map → RecordsTable-X4-iL03N.js.map} +1 -1
- package/dist/client/chunks/{RetentionCombinedChart-BX1VbJ_m.js → RetentionCombinedChart-DCgCAEa4.js} +3 -3
- package/dist/client/chunks/{RetentionCombinedChart-BX1VbJ_m.js.map → RetentionCombinedChart-DCgCAEa4.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-C6FJ-hNN.js → RetentionHeatmap-BnQng2Nc.js} +2 -2
- package/dist/client/chunks/{RetentionHeatmap-C6FJ-hNN.js.map → RetentionHeatmap-BnQng2Nc.js.map} +1 -1
- package/dist/client/chunks/{SchemaVisualization-DheR_F8J.js → SchemaVisualization-DAs91j_B.js} +1 -1
- package/dist/client/chunks/{TextPortletModal-BKJx63L7.js → TextPortletModal-MeQiEmR8.js} +3 -3
- package/dist/client/chunks/{TextPortletModal-BKJx63L7.js.map → TextPortletModal-MeQiEmR8.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-QaBFxEqT.js → analysis-builder-_JOj-PkX.js} +1508 -1492
- package/dist/client/chunks/analysis-builder-_JOj-PkX.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-CBYZC9iE.js → analysis-builder-shared-CYK5sH46.js} +829 -827
- package/dist/client/chunks/analysis-builder-shared-CYK5sH46.js.map +1 -0
- package/dist/client/chunks/{chart-activity-grid-Tma6prYa.js → chart-activity-grid-CIzCAMX9.js} +4 -4
- package/dist/client/chunks/{chart-activity-grid-Tma6prYa.js.map → chart-activity-grid-CIzCAMX9.js.map} +1 -1
- package/dist/client/chunks/{chart-area-uKNDmXki.js → chart-area-BRLlLtIX.js} +6 -6
- package/dist/client/chunks/{chart-area-uKNDmXki.js.map → chart-area-BRLlLtIX.js.map} +1 -1
- package/dist/client/chunks/{chart-bar-J-O7Fdzo.js → chart-bar-D2qp_vsO.js} +5 -5
- package/dist/client/chunks/{chart-bar-J-O7Fdzo.js.map → chart-bar-D2qp_vsO.js.map} +1 -1
- package/dist/client/chunks/{chart-box-plot-DOOxwI0S.js → chart-box-plot-Bt2dfls7.js} +2 -2
- package/dist/client/chunks/{chart-box-plot-DOOxwI0S.js.map → chart-box-plot-Bt2dfls7.js.map} +1 -1
- package/dist/client/chunks/{chart-bubble-CpFXYmcw.js → chart-bubble-BJZlm4xv.js} +4 -4
- package/dist/client/chunks/{chart-bubble-CpFXYmcw.js.map → chart-bubble-BJZlm4xv.js.map} +1 -1
- package/dist/client/chunks/{chart-candlestick-D8VjfXOL.js → chart-candlestick-DsNtTruF.js} +2 -2
- package/dist/client/chunks/{chart-candlestick-D8VjfXOL.js.map → chart-candlestick-DsNtTruF.js.map} +1 -1
- package/dist/client/chunks/{chart-data-table-CDMTU9F4.js → chart-data-table-DIghSvZN.js} +3 -3
- package/dist/client/chunks/{chart-data-table-CDMTU9F4.js.map → chart-data-table-DIghSvZN.js.map} +1 -1
- package/dist/client/chunks/{chart-funnel-C18WiJ9P.js → chart-funnel-CvVQTMej.js} +3 -3
- package/dist/client/chunks/{chart-funnel-C18WiJ9P.js.map → chart-funnel-CvVQTMej.js.map} +1 -1
- package/dist/client/chunks/{chart-gauge-seUJ08__.js → chart-gauge-DSu7U1YZ.js} +4 -4
- package/dist/client/chunks/{chart-gauge-seUJ08__.js.map → chart-gauge-DSu7U1YZ.js.map} +1 -1
- package/dist/client/chunks/{chart-heat-map-_HOw96aJ.js → chart-heat-map-Be7XsINq.js} +4 -4
- package/dist/client/chunks/{chart-heat-map-_HOw96aJ.js.map → chart-heat-map-Be7XsINq.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-dSO6l_oc.js → chart-kpi-delta-7rLLK4Bg.js} +4 -4
- package/dist/client/chunks/{chart-kpi-delta-dSO6l_oc.js.map → chart-kpi-delta-7rLLK4Bg.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-CTVVElrK.js → chart-kpi-number-CUeK8MQP.js} +4 -4
- package/dist/client/chunks/{chart-kpi-number-CTVVElrK.js.map → chart-kpi-number-CUeK8MQP.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-B8g11asF.js → chart-kpi-text-CvRv2tGg.js} +5 -5
- package/dist/client/chunks/{chart-kpi-text-B8g11asF.js.map → chart-kpi-text-CvRv2tGg.js.map} +1 -1
- package/dist/client/chunks/{chart-line-DHPFzMBk.js → chart-line-Bl-bSP0Y.js} +6 -6
- package/dist/client/chunks/{chart-line-DHPFzMBk.js.map → chart-line-Bl-bSP0Y.js.map} +1 -1
- package/dist/client/chunks/chart-markdown-5dXZ-EtR.js +96 -0
- package/dist/client/chunks/chart-markdown-5dXZ-EtR.js.map +1 -0
- package/dist/client/chunks/{chart-measure-profile-CZkMh7EU.js → chart-measure-profile-DjAV-TtG.js} +4 -4
- package/dist/client/chunks/{chart-measure-profile-CZkMh7EU.js.map → chart-measure-profile-DjAV-TtG.js.map} +1 -1
- package/dist/client/chunks/{chart-pie-CFDUrh26.js → chart-pie-3IGIOniI.js} +5 -5
- package/dist/client/chunks/{chart-pie-CFDUrh26.js.map → chart-pie-3IGIOniI.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-C9gpwnf2.js → chart-radar-Md5BwLhY.js} +4 -4
- package/dist/client/chunks/{chart-radar-C9gpwnf2.js.map → chart-radar-Md5BwLhY.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-B-CXDHTD.js → chart-radial-bar-Bfb-gGm6.js} +4 -4
- package/dist/client/chunks/{chart-radial-bar-B-CXDHTD.js.map → chart-radial-bar-Bfb-gGm6.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-B4BMcu_W.js → chart-sankey-BmQKKIZa.js} +2 -2
- package/dist/client/chunks/{chart-sankey-B4BMcu_W.js.map → chart-sankey-BmQKKIZa.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-Dy3zhJ0s.js → chart-scatter-BES9g5kG.js} +5 -5
- package/dist/client/chunks/{chart-scatter-Dy3zhJ0s.js.map → chart-scatter-BES9g5kG.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-CNkfOURe.js → chart-sunburst-BBOCkD00.js} +2 -2
- package/dist/client/chunks/{chart-sunburst-CNkfOURe.js.map → chart-sunburst-BBOCkD00.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-B_iEqAl4.js → chart-tree-map-CkvUBqNw.js} +5 -5
- package/dist/client/chunks/{chart-tree-map-B_iEqAl4.js.map → chart-tree-map-CkvUBqNw.js.map} +1 -1
- package/dist/client/chunks/{chart-waterfall-DKoas5p0.js → chart-waterfall-KeSpmPhi.js} +4 -4
- package/dist/client/chunks/{chart-waterfall-DKoas5p0.js.map → chart-waterfall-KeSpmPhi.js.map} +1 -1
- package/dist/client/chunks/{chartComponentRegistry-BVeOQaSR.js → chartComponentRegistry-B6jUklcw.js} +3 -3
- package/dist/client/chunks/chartComponentRegistry-B6jUklcw.js.map +1 -0
- package/dist/client/chunks/{chartPlugin-sgjKBVER.js → chartPlugin-DnQOiDRV.js} +2 -2
- package/dist/client/chunks/{chartPlugin-sgjKBVER.js.map → chartPlugin-DnQOiDRV.js.map} +1 -1
- package/dist/client/chunks/{charts-core-DwjBd3KN.js → charts-core-BsheHP0O.js} +2 -2
- package/dist/client/chunks/{charts-core-DwjBd3KN.js.map → charts-core-BsheHP0O.js.map} +1 -1
- package/dist/client/chunks/{charts-loader-C5E1UrqB.js → charts-loader-Bt00isFs.js} +32 -32
- package/dist/client/chunks/{charts-loader-C5E1UrqB.js.map → charts-loader-Bt00isFs.js.map} +1 -1
- package/dist/client/chunks/{dist-CiyOP0NN.js → dist-BJHNNhZr.js} +3 -3
- package/dist/client/chunks/dist-BJHNNhZr.js.map +1 -0
- package/dist/client/chunks/{exportXlsx-Dnc0ZOJW.js → exportXlsx-CAC5_NOP.js} +29 -21
- package/dist/client/chunks/exportXlsx-CAC5_NOP.js.map +1 -0
- package/dist/client/chunks/{nl-NL-puUFqQYo.js → nl-NL-Cqzg1eUq.js} +3 -1
- package/dist/client/chunks/{nl-NL-puUFqQYo.js.map → nl-NL-Cqzg1eUq.js.map} +1 -1
- package/dist/client/chunks/{providers-CPmqs1OT.js → providers-CGtqLkL5.js} +7 -7
- package/dist/client/chunks/{providers-CPmqs1OT.js.map → providers-CGtqLkL5.js.map} +1 -1
- package/dist/client/chunks/{schema-visualization-sZ-ok8Mv.js → schema-visualization-CgYgfh4e.js} +5 -5
- package/dist/client/chunks/{schema-visualization-sZ-ok8Mv.js.map → schema-visualization-CgYgfh4e.js.map} +1 -1
- package/dist/client/chunks/{useCubeFieldLabel-OShtoDli.js → useCubeFieldLabel-BaQ47OCT.js} +2 -2
- package/dist/client/chunks/{useCubeFieldLabel-OShtoDli.js.map → useCubeFieldLabel-BaQ47OCT.js.map} +1 -1
- package/dist/client/chunks/{useCubeMetaQuery-D5YmxsXc.js → useCubeMetaQuery-D736B6Jp.js} +2 -2
- package/dist/client/chunks/{useCubeMetaQuery-D5YmxsXc.js.map → useCubeMetaQuery-D736B6Jp.js.map} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-u59tjusb.js → useDirtyStateTracking-D3b4tD_b.js} +2 -2
- package/dist/client/chunks/{useDirtyStateTracking-u59tjusb.js.map → useDirtyStateTracking-D3b4tD_b.js.map} +1 -1
- package/dist/client/chunks/{useExplainAI-9AtPBHak.js → useExplainAI-BaETifYG.js} +3 -3
- package/dist/client/chunks/{useExplainAI-9AtPBHak.js.map → useExplainAI-BaETifYG.js.map} +1 -1
- package/dist/client/chunks/{useTranslation-BwieiaHa.js → useTranslation-DO5KRcwD.js} +5 -3
- package/dist/client/chunks/{useTranslation-BwieiaHa.js.map → useTranslation-DO5KRcwD.js.map} +1 -1
- package/dist/client/chunks/utils-CToHkuhU.js.map +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisResultsHeader.d.ts +2 -0
- package/dist/client/components/DashboardPortletCard.d.ts +1 -1
- package/dist/client/components/RowManagedLayout.d.ts +3 -1
- package/dist/client/components/analyticsPortlet/PortletChart.d.ts +5 -1
- package/dist/client/components/analyticsPortlet/PortletChartView.d.ts +5 -1
- package/dist/client/components/analyticsPortlet/PortletStates.d.ts +9 -1
- package/dist/client/components/analyticsPortlet/portletRenderState.d.ts +7 -1
- package/dist/client/components/charts/MarkdownChart.d.ts +1 -1
- package/dist/client/components/charts/markdownDisclosure.d.ts +14 -0
- package/dist/client/components/dashboardPortletCard/PortletCardHeader.d.ts +1 -0
- package/dist/client/components/dashboardPortletCard/PortletFloatingActions.d.ts +1 -0
- package/dist/client/components/dashboardPortletCard/cardStyles.d.ts +2 -0
- package/dist/client/components/dashboardPortletCard/propsEqual.d.ts +2 -0
- package/dist/client/components/dashboardPortletCard/usePortletCardActions.d.ts +4 -1
- package/dist/client/components.js +4 -4
- package/dist/client/hooks/dashboard/layoutUtils.d.ts +11 -0
- package/dist/client/hooks/useAnalysisQuery.d.ts +6 -0
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons/registry.d.ts +3 -1
- package/dist/client/icons.js +4 -4
- package/dist/client/icons.js.map +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +322 -322
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers.js +1 -1
- package/dist/client/schema.js +1 -1
- package/dist/client/styles.css +1 -1
- package/dist/client/types.d.ts +28 -0
- package/dist/client/utils/exportXlsx.d.ts +7 -0
- package/dist/client/utils/index.d.ts +1 -1
- package/dist/client/utils.js +14 -14
- package/dist/client/utils.js.map +1 -1
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +132 -131
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +2 -0
- package/package.json +7 -7
- package/dist/adapters/ActivityGridChart.config-3SeBVdiJ.js +0 -1
- package/dist/adapters/ActivityGridChart.config-C8d7NfCS.cjs +0 -1
- package/dist/adapters/AreaChart.config-DMLdRLt3.cjs +0 -1
- package/dist/adapters/AreaChart.config-DX_WqQQ_.js +0 -1
- package/dist/adapters/BarChart.config-2Wmv5r8P.cjs +0 -1
- package/dist/adapters/BarChart.config-BWYAI7Vg.js +0 -1
- package/dist/adapters/BoxPlotChart.config-Ceu0w8Zd.cjs +0 -1
- package/dist/adapters/BoxPlotChart.config-T-8Peh8F.js +0 -1
- package/dist/adapters/BubbleChart.config-BIcf2l3R.js +0 -1
- package/dist/adapters/BubbleChart.config-CtM5BSz6.cjs +0 -1
- package/dist/adapters/CandlestickChart.config-4S2Or5mN.cjs +0 -1
- package/dist/adapters/CandlestickChart.config-4d3lZuok.js +0 -1
- package/dist/adapters/DataTable.config-D7EycI7z.cjs +0 -1
- package/dist/adapters/DataTable.config-Gq2C0ILP.js +0 -1
- package/dist/adapters/DotStripChart.config-NHJSJBlh.js +0 -1
- package/dist/adapters/DotStripChart.config-VomEbzxR.cjs +0 -1
- package/dist/adapters/FunnelChart.config-C5pBDYFK.js +0 -1
- package/dist/adapters/FunnelChart.config-D3Mtyf28.cjs +0 -1
- package/dist/adapters/GaugeChart.config-BnFLZCC6.js +0 -1
- package/dist/adapters/GaugeChart.config-DtkFafZC.cjs +0 -1
- package/dist/adapters/HeatMapChart.config-BIqhjAFQ.js +0 -1
- package/dist/adapters/HeatMapChart.config-DseB1NfL.cjs +0 -1
- package/dist/adapters/KpiDelta.config-69-uMEyb.js +0 -1
- package/dist/adapters/KpiDelta.config-DWPjfacH.cjs +0 -1
- package/dist/adapters/KpiNumber.config-BbnUmSb-.js +0 -1
- package/dist/adapters/KpiNumber.config-C3btQia1.cjs +0 -1
- package/dist/adapters/KpiText.config-Bnmvk3lB.cjs +0 -1
- package/dist/adapters/KpiText.config-DAWQ0mAe.js +0 -1
- package/dist/adapters/LineChart.config-CKGqehVr.cjs +0 -1
- package/dist/adapters/LineChart.config-FHEbx5Qa.js +0 -1
- package/dist/adapters/MarkdownChart.config-Cj8GMNnf.cjs +0 -1
- package/dist/adapters/MarkdownChart.config-DD5nNpfK.js +0 -1
- package/dist/adapters/MeasureProfileChart.config-CM9DseTR.js +0 -1
- package/dist/adapters/MeasureProfileChart.config-sy-8lmcV.cjs +0 -1
- package/dist/adapters/PieChart.config-8THRRwga.cjs +0 -1
- package/dist/adapters/PieChart.config-m6eZbEWA.js +0 -1
- package/dist/adapters/ProportionBarChart.config-DJrjar2k.cjs +0 -1
- package/dist/adapters/ProportionBarChart.config-Sm34Lsvo.js +0 -1
- package/dist/adapters/RadarChart.config-CXLUncFQ.js +0 -1
- package/dist/adapters/RadarChart.config-Dec1u-cO.cjs +0 -1
- package/dist/adapters/RadialBarChart.config-93JNKh5g.js +0 -1
- package/dist/adapters/RadialBarChart.config-DNw07Ie4.cjs +0 -1
- package/dist/adapters/RecordsTable.config-79tOcNvK.js +0 -1
- package/dist/adapters/RecordsTable.config-DaTk-q0X.cjs +0 -1
- package/dist/adapters/RetentionCombinedChart.config-BJlyJD9K.js +0 -1
- package/dist/adapters/RetentionCombinedChart.config-BMY7kekL.cjs +0 -1
- package/dist/adapters/RetentionHeatmap.config-C6UDjFsM.cjs +0 -1
- package/dist/adapters/RetentionHeatmap.config-C7GsAXqy.js +0 -1
- package/dist/adapters/SankeyChart.config-7K9FRF5f.js +0 -1
- package/dist/adapters/SankeyChart.config-Bn8CuX7j.cjs +0 -1
- package/dist/adapters/ScatterChart.config-BwObH6wd.cjs +0 -1
- package/dist/adapters/ScatterChart.config-DdXyolWJ.js +0 -1
- package/dist/adapters/SunburstChart.config-BaWb-t_B.cjs +0 -1
- package/dist/adapters/SunburstChart.config-D-A2Wbeg.js +0 -1
- package/dist/adapters/TreeMapChart.config-2G6D7LD3.cjs +0 -1
- package/dist/adapters/TreeMapChart.config-CsQ8lmZY.js +0 -1
- package/dist/adapters/WaterfallChart.config-CG6GW5x3.js +0 -1
- package/dist/adapters/WaterfallChart.config-Dt3MgB-U.cjs +0 -1
- package/dist/adapters/utils-COscxYKM.cjs +0 -141
- package/dist/client/chunks/BubbleChart-E0IoByRb.js.map +0 -1
- package/dist/client/chunks/DashboardEditModal-Fx3EXgIk.js.map +0 -1
- package/dist/client/chunks/MarkdownChart-CO0eGGo3.js.map +0 -1
- package/dist/client/chunks/analysis-builder-QaBFxEqT.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-CBYZC9iE.js.map +0 -1
- package/dist/client/chunks/chart-markdown-Bcf21ciA.js +0 -68
- package/dist/client/chunks/chart-markdown-Bcf21ciA.js.map +0 -1
- package/dist/client/chunks/chartComponentRegistry-BVeOQaSR.js.map +0 -1
- package/dist/client/chunks/dist-CiyOP0NN.js.map +0 -1
- package/dist/client/chunks/exportXlsx-Dnc0ZOJW.js.map +0 -1
|
@@ -1,18 +1,84 @@
|
|
|
1
1
|
import { r as e, t } from "./rolldown-runtime-B0aSnxlc.js";
|
|
2
2
|
import { t as n } from "./query-shape-Dv_qf-Nn.js";
|
|
3
|
-
import { c as r } from "./providers-
|
|
4
|
-
import {
|
|
5
|
-
import { t as a } from "./chart-markdown-
|
|
3
|
+
import { c as r } from "./providers-CGtqLkL5.js";
|
|
4
|
+
import { r as i } from "./dist-BJHNNhZr.js";
|
|
5
|
+
import { t as a } from "./chart-markdown-5dXZ-EtR.js";
|
|
6
6
|
import { useContext as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
7
|
+
//#region src/client/components/charts/markdownDisclosure.ts
|
|
8
|
+
var u = /^ {0,3}<details(?:\s[^>]*)?>[ \t]*/i, d = /^ {0,3}<summary(?:\s[^>]*)?>(.*?)<\/summary>[ \t]*/i, f = /^ {0,3}<\/details>[ \t]*$/i, p = /<\/details>[ \t]*$/i, m = /^ {0,3}(`{3,}|~{3,})/;
|
|
9
|
+
function h(e, t) {
|
|
10
|
+
let n = e[e.length - 1];
|
|
11
|
+
n?.kind === "markdown" ? n.text += `\n${t}` : e.push({
|
|
12
|
+
kind: "markdown",
|
|
13
|
+
text: t
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function g(e, t) {
|
|
17
|
+
for (let n of t) n.kind === "markdown" ? h(e, n.text) : e.push(n);
|
|
18
|
+
}
|
|
19
|
+
function _(e, t, n) {
|
|
20
|
+
let r = [];
|
|
21
|
+
return t.trim() && h(r, t), g(r, n), {
|
|
22
|
+
kind: "disclosure",
|
|
23
|
+
key: "",
|
|
24
|
+
summary: e,
|
|
25
|
+
body: r
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function v(e, t = /* @__PURE__ */ new Map()) {
|
|
29
|
+
for (let n of e) {
|
|
30
|
+
if (n.kind !== "disclosure") continue;
|
|
31
|
+
let e = t.get(n.summary) ?? 0;
|
|
32
|
+
t.set(n.summary, e + 1), n.key = `${n.summary}#${e}`, v(n.body, t);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function y(e) {
|
|
36
|
+
let t = e.split(/\r?\n/), n = [], r = [], i = () => r.length > 0 ? r[r.length - 1].body : n, a = null;
|
|
37
|
+
for (let e = 0; e < t.length; e++) {
|
|
38
|
+
let n = t[e], o = m.exec(n);
|
|
39
|
+
if (a) {
|
|
40
|
+
o && o[1][0] === a[0] && o[1].length >= a.length && n.trim() === o[1] && (a = null), h(i(), n);
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (o) {
|
|
44
|
+
a = o[1], h(i(), n);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
let s = u.exec(n);
|
|
48
|
+
if (s) {
|
|
49
|
+
let a = e, o = n.slice(s[0].length);
|
|
50
|
+
if (!o) {
|
|
51
|
+
for (a = e + 1; a < t.length && !t[a].trim();) a++;
|
|
52
|
+
o = t[a] ?? "";
|
|
53
|
+
}
|
|
54
|
+
let c = d.exec(o);
|
|
55
|
+
if (c) {
|
|
56
|
+
let n = o.slice(c[0].length);
|
|
57
|
+
p.test(n) ? i().push(_(c[1].trim(), n.replace(p, ""), [])) : r.push({
|
|
58
|
+
source: t.slice(e, a + 1).join("\n"),
|
|
59
|
+
summary: c[1].trim(),
|
|
60
|
+
after: n,
|
|
61
|
+
body: []
|
|
62
|
+
}), e = a;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
let c = r[r.length - 1];
|
|
67
|
+
c && f.test(n) ? (r.pop(), i().push(_(c.summary, c.after, c.body))) : h(i(), n);
|
|
68
|
+
}
|
|
69
|
+
for (let e = r.pop(); e; e = r.pop()) h(i(), e.source), g(i(), e.body);
|
|
70
|
+
return v(n), n;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
7
73
|
//#region node_modules/knap/dist/chunk-DOF2LXGV.js
|
|
8
|
-
function
|
|
74
|
+
function b(e) {
|
|
9
75
|
let t = e.match(/^\/(.+)\/([gimsuy]*)$/);
|
|
10
76
|
return t ? {
|
|
11
77
|
pattern: t[1],
|
|
12
78
|
flags: t[2]
|
|
13
79
|
} : null;
|
|
14
80
|
}
|
|
15
|
-
function
|
|
81
|
+
function x(e) {
|
|
16
82
|
let t = e.trim();
|
|
17
83
|
if (!t.startsWith("(") || !t.endsWith(")")) return t;
|
|
18
84
|
let n = "", r = !1, i = 0;
|
|
@@ -27,10 +93,10 @@ function d(e) {
|
|
|
27
93
|
}
|
|
28
94
|
return i === 0 ? t.slice(1, -1).trim() : t;
|
|
29
95
|
}
|
|
30
|
-
function
|
|
96
|
+
function S(e) {
|
|
31
97
|
return e.trim().replace(/^(["'])([\s\S]*)\1$/, "$2");
|
|
32
98
|
}
|
|
33
|
-
function
|
|
99
|
+
function C(e) {
|
|
34
100
|
switch (e) {
|
|
35
101
|
case "n": return "\n";
|
|
36
102
|
case "t": return " ";
|
|
@@ -38,30 +104,30 @@ function p(e) {
|
|
|
38
104
|
default: return e;
|
|
39
105
|
}
|
|
40
106
|
}
|
|
41
|
-
function
|
|
107
|
+
function w(e) {
|
|
42
108
|
return e.replace(/\\([\\,:|"'])/g, "$1");
|
|
43
109
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
110
|
+
function T(e) {
|
|
111
|
+
return w(S(e));
|
|
46
112
|
}
|
|
47
|
-
function
|
|
48
|
-
if (e !== void 0) return e !== "" && e.trim() === "" ? e :
|
|
113
|
+
function E(e) {
|
|
114
|
+
if (e !== void 0) return e !== "" && e.trim() === "" ? e : S(x(e));
|
|
49
115
|
}
|
|
50
|
-
function
|
|
51
|
-
let t =
|
|
52
|
-
return t === void 0 ? void 0 :
|
|
116
|
+
function D(e) {
|
|
117
|
+
let t = E(e);
|
|
118
|
+
return t === void 0 ? void 0 : w(t);
|
|
53
119
|
}
|
|
54
|
-
function
|
|
55
|
-
let t =
|
|
56
|
-
return n !== t[0]?.trim() && n.includes(",") ?
|
|
120
|
+
function ee(e) {
|
|
121
|
+
let t = O(x(e)), n = t.length === 1 ? S(t[0]) : "";
|
|
122
|
+
return n !== t[0]?.trim() && n.includes(",") ? O(n) : t;
|
|
57
123
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
124
|
+
function te(e) {
|
|
125
|
+
return ee(e).map((e) => S(e).replace(/\\(["'])/g, "$1"));
|
|
60
126
|
}
|
|
61
|
-
function
|
|
127
|
+
function ne(e) {
|
|
62
128
|
let t = e.trim();
|
|
63
|
-
if (
|
|
64
|
-
if (t.length >= 2 && (t[0] === "\"" || t[0] === "'") && t.at(-1) === t[0]) return t.slice(1, -1).replace(/\\([\s\S])/g, (e, t) =>
|
|
129
|
+
if (ie(t)[1] !== void 0) return t;
|
|
130
|
+
if (t.length >= 2 && (t[0] === "\"" || t[0] === "'") && t.at(-1) === t[0]) return t.slice(1, -1).replace(/\\([\s\S])/g, (e, t) => C(t));
|
|
65
131
|
if (t === "true") return !0;
|
|
66
132
|
if (t === "false") return !1;
|
|
67
133
|
if (t === "null") return null;
|
|
@@ -71,10 +137,10 @@ function b(e) {
|
|
|
71
137
|
}
|
|
72
138
|
return t;
|
|
73
139
|
}
|
|
74
|
-
function
|
|
75
|
-
if (e !== void 0 && e !== "") return
|
|
140
|
+
function re(e) {
|
|
141
|
+
if (e !== void 0 && e !== "") return O(x(e)).map(ne);
|
|
76
142
|
}
|
|
77
|
-
function
|
|
143
|
+
function ie(e) {
|
|
78
144
|
let t = "", n = !1, r = 0, i = 0, a = 0;
|
|
79
145
|
for (let o = 0; o < e.length; o++) {
|
|
80
146
|
let s = e[o];
|
|
@@ -92,23 +158,23 @@ function S(e) {
|
|
|
92
158
|
}
|
|
93
159
|
return [e.trim()];
|
|
94
160
|
}
|
|
95
|
-
function
|
|
161
|
+
function O(e) {
|
|
96
162
|
let t = [], n = "", r = "", i = !1, a = 0, o = 0, s = 0;
|
|
97
163
|
for (let c of e) i ? (n += c, i = !1) : c === "\\" ? (n += c, i = !0) : r ? (n += c, c === r && (r = "")) : c === "\"" || c === "'" ? (n += c, r = c) : c === "(" ? (n += c, a++) : c === ")" ? (n += c, a--) : c === "{" ? (n += c, o++) : c === "}" ? (n += c, o--) : c === "[" ? (n += c, s++) : c === "]" ? (n += c, s--) : c === "," && a === 0 && o === 0 && s === 0 ? (t.push(n.trim()), n = "") : n += c;
|
|
98
164
|
return t.push(n.trim()), t;
|
|
99
165
|
}
|
|
100
|
-
function
|
|
166
|
+
function k(e, t, n = "FILTER_WARNING") {
|
|
101
167
|
e?.reportWarning?.({
|
|
102
168
|
message: t,
|
|
103
169
|
code: n
|
|
104
170
|
});
|
|
105
171
|
}
|
|
106
|
-
function
|
|
172
|
+
function A(e) {
|
|
107
173
|
return e instanceof Error ? e.message : String(e);
|
|
108
174
|
}
|
|
109
175
|
//#endregion
|
|
110
176
|
//#region node_modules/dayjs/dayjs.min.js
|
|
111
|
-
var
|
|
177
|
+
var ae = /* @__PURE__ */ t(((e, t) => {
|
|
112
178
|
(function(n, r) {
|
|
113
179
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
114
180
|
})(e, (function() {
|
|
@@ -382,8 +448,8 @@ var E = /* @__PURE__ */ t(((e, t) => {
|
|
|
382
448
|
}, _.toString = function() {
|
|
383
449
|
return this.$d.toUTCString();
|
|
384
450
|
}, g;
|
|
385
|
-
}(),
|
|
386
|
-
return w.prototype =
|
|
451
|
+
}(), D = E.prototype;
|
|
452
|
+
return w.prototype = D, [
|
|
387
453
|
["$ms", r],
|
|
388
454
|
["$s", i],
|
|
389
455
|
["$m", a],
|
|
@@ -393,7 +459,7 @@ var E = /* @__PURE__ */ t(((e, t) => {
|
|
|
393
459
|
["$y", d],
|
|
394
460
|
["$D", f]
|
|
395
461
|
].forEach((function(e) {
|
|
396
|
-
|
|
462
|
+
D[e[1]] = function(t) {
|
|
397
463
|
return this.$g(t, e[0], e[1]);
|
|
398
464
|
};
|
|
399
465
|
})), w.extend = function(e, t) {
|
|
@@ -402,7 +468,7 @@ var E = /* @__PURE__ */ t(((e, t) => {
|
|
|
402
468
|
return w(1e3 * e);
|
|
403
469
|
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
404
470
|
}));
|
|
405
|
-
})),
|
|
471
|
+
})), oe = /* @__PURE__ */ t(((e, t) => {
|
|
406
472
|
(function(n, r) {
|
|
407
473
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_isoWeek = r();
|
|
408
474
|
})(e, (function() {
|
|
@@ -426,7 +492,7 @@ var E = /* @__PURE__ */ t(((e, t) => {
|
|
|
426
492
|
};
|
|
427
493
|
};
|
|
428
494
|
}));
|
|
429
|
-
})),
|
|
495
|
+
})), se = /* @__PURE__ */ t(((e, t) => {
|
|
430
496
|
(function(n, r) {
|
|
431
497
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_weekOfYear = r();
|
|
432
498
|
})(e, (function() {
|
|
@@ -447,7 +513,7 @@ var E = /* @__PURE__ */ t(((e, t) => {
|
|
|
447
513
|
};
|
|
448
514
|
};
|
|
449
515
|
}));
|
|
450
|
-
})),
|
|
516
|
+
})), ce = /* @__PURE__ */ t(((e, t) => {
|
|
451
517
|
(function(n, r) {
|
|
452
518
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_customParseFormat = r();
|
|
453
519
|
})(e, (function() {
|
|
@@ -603,7 +669,7 @@ var E = /* @__PURE__ */ t(((e, t) => {
|
|
|
603
669
|
};
|
|
604
670
|
};
|
|
605
671
|
}));
|
|
606
|
-
})),
|
|
672
|
+
})), le = /* @__PURE__ */ t(((e, t) => {
|
|
607
673
|
(function(n, r) {
|
|
608
674
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_advancedFormat = r();
|
|
609
675
|
})(e, (function() {
|
|
@@ -636,7 +702,7 @@ var E = /* @__PURE__ */ t(((e, t) => {
|
|
|
636
702
|
};
|
|
637
703
|
};
|
|
638
704
|
}));
|
|
639
|
-
})),
|
|
705
|
+
})), ue = /* @__PURE__ */ t(((e, t) => {
|
|
640
706
|
(function(n, r) {
|
|
641
707
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_duration = r();
|
|
642
708
|
})(e, (function() {
|
|
@@ -796,50 +862,50 @@ var E = /* @__PURE__ */ t(((e, t) => {
|
|
|
796
862
|
};
|
|
797
863
|
};
|
|
798
864
|
}));
|
|
799
|
-
})),
|
|
865
|
+
})), j = /* @__PURE__ */ e(ae(), 1), de = /* @__PURE__ */ e(oe(), 1), fe = /* @__PURE__ */ e(se(), 1), pe = /* @__PURE__ */ e(ce(), 1), me = /* @__PURE__ */ e(le(), 1), he = /* @__PURE__ */ e(ue(), 1), M = class extends Error {
|
|
800
866
|
constructor(e, t = "RENDER_ERROR", n, r) {
|
|
801
867
|
super(e), this.code = t, this.line = n, this.column = r, this.name = "TemplateRuntimeError";
|
|
802
868
|
}
|
|
803
869
|
code;
|
|
804
870
|
line;
|
|
805
871
|
column;
|
|
806
|
-
},
|
|
872
|
+
}, ge = class extends Error {
|
|
807
873
|
constructor(e) {
|
|
808
874
|
super(e.map((e) => e.message).join("; ") || "Template rendering failed"), this.errors = e, this.name = "TemplateRenderError";
|
|
809
875
|
}
|
|
810
876
|
errors;
|
|
811
|
-
},
|
|
877
|
+
}, _e = Object.freeze({
|
|
812
878
|
maxTemplateLength: 1e6,
|
|
813
879
|
maxOutputLength: 5e6,
|
|
814
880
|
maxValueLength: 5e6,
|
|
815
881
|
maxOperations: 1e5,
|
|
816
882
|
maxDepth: 100
|
|
817
883
|
});
|
|
818
|
-
function
|
|
884
|
+
function ve(e = {}) {
|
|
819
885
|
let t = {
|
|
820
|
-
...
|
|
886
|
+
..._e,
|
|
821
887
|
...e
|
|
822
888
|
};
|
|
823
|
-
for (let [e, n] of Object.entries(t)) if (!Number.isSafeInteger(n) || n < 1 || e === "maxDepth" && n > 256) throw new
|
|
889
|
+
for (let [e, n] of Object.entries(t)) if (!Number.isSafeInteger(n) || n < 1 || e === "maxDepth" && n > 256) throw new M(`Invalid ${e} limit`, "LIMIT_EXCEEDED");
|
|
824
890
|
return t;
|
|
825
891
|
}
|
|
826
|
-
function
|
|
827
|
-
throw new
|
|
892
|
+
function N(e) {
|
|
893
|
+
throw new M(`Template exceeded ${e}`, "LIMIT_EXCEEDED");
|
|
828
894
|
}
|
|
829
|
-
var
|
|
895
|
+
var ye = class {
|
|
830
896
|
limits;
|
|
831
897
|
operations = 0;
|
|
832
898
|
constructor(e = {}) {
|
|
833
|
-
this.limits =
|
|
899
|
+
this.limits = ve(e);
|
|
834
900
|
}
|
|
835
901
|
step() {
|
|
836
|
-
++this.operations > this.limits.maxOperations &&
|
|
902
|
+
++this.operations > this.limits.maxOperations && N("maxOperations");
|
|
837
903
|
}
|
|
838
904
|
output(e) {
|
|
839
|
-
e > this.limits.maxOutputLength &&
|
|
905
|
+
e > this.limits.maxOutputLength && N("maxOutputLength");
|
|
840
906
|
}
|
|
841
907
|
length(e) {
|
|
842
|
-
e > this.limits.maxValueLength &&
|
|
908
|
+
e > this.limits.maxValueLength && N("maxValueLength");
|
|
843
909
|
}
|
|
844
910
|
value(e) {
|
|
845
911
|
let t = [{
|
|
@@ -849,9 +915,9 @@ var pe = class {
|
|
|
849
915
|
for (; t.length;) {
|
|
850
916
|
this.step();
|
|
851
917
|
let { value: e, depth: i } = t.pop();
|
|
852
|
-
if (++r > this.limits.maxOperations &&
|
|
918
|
+
if (++r > this.limits.maxOperations && N("maxOperations"), i > this.limits.maxDepth && N("maxDepth"), typeof e == "string") n += e.length;
|
|
853
919
|
else if (typeof e == "object" && e) for (let a of Object.keys(e)) {
|
|
854
|
-
n += a.length + 4, t.length + r >= this.limits.maxOperations &&
|
|
920
|
+
n += a.length + 4, t.length + r >= this.limits.maxOperations && N("maxOperations");
|
|
855
921
|
let o = Object.getOwnPropertyDescriptor(e, a);
|
|
856
922
|
"value" in o && t.push({
|
|
857
923
|
value: o.value,
|
|
@@ -859,10 +925,10 @@ var pe = class {
|
|
|
859
925
|
});
|
|
860
926
|
}
|
|
861
927
|
else n += 8;
|
|
862
|
-
n > this.limits.maxValueLength &&
|
|
928
|
+
n > this.limits.maxValueLength && N("maxValueLength");
|
|
863
929
|
}
|
|
864
930
|
}
|
|
865
|
-
},
|
|
931
|
+
}, be = {
|
|
866
932
|
if: "keyword_if",
|
|
867
933
|
elseif: "keyword_elseif",
|
|
868
934
|
else: "keyword_else",
|
|
@@ -878,8 +944,8 @@ var pe = class {
|
|
|
878
944
|
true: "boolean",
|
|
879
945
|
false: "boolean",
|
|
880
946
|
null: "null"
|
|
881
|
-
},
|
|
882
|
-
function
|
|
947
|
+
}, xe = 123, Se = 37, Ce = 35;
|
|
948
|
+
function we(e) {
|
|
883
949
|
let t = {
|
|
884
950
|
input: e,
|
|
885
951
|
pos: 0,
|
|
@@ -891,12 +957,12 @@ function ve(e) {
|
|
|
891
957
|
};
|
|
892
958
|
for (; t.pos < t.input.length;) switch (t.mode) {
|
|
893
959
|
case "text":
|
|
894
|
-
|
|
960
|
+
Te(t);
|
|
895
961
|
break;
|
|
896
962
|
case "variable":
|
|
897
|
-
|
|
963
|
+
Ee(t);
|
|
898
964
|
break;
|
|
899
|
-
case "tag":
|
|
965
|
+
case "tag": De(t);
|
|
900
966
|
}
|
|
901
967
|
return t.tokens.push({
|
|
902
968
|
type: "eof",
|
|
@@ -908,15 +974,15 @@ function ve(e) {
|
|
|
908
974
|
errors: t.errors
|
|
909
975
|
};
|
|
910
976
|
}
|
|
911
|
-
function
|
|
977
|
+
function Te(e) {
|
|
912
978
|
let t = e.pos, n = e.line, r = e.column, i = e.input;
|
|
913
979
|
for (; e.pos < i.length;) {
|
|
914
980
|
let a = i.indexOf("{", e.pos);
|
|
915
981
|
if (a === -1) break;
|
|
916
|
-
let o = i.charCodeAt(a + 1), s = o ===
|
|
917
|
-
if (!s && !c && !l)
|
|
982
|
+
let o = i.charCodeAt(a + 1), s = o === xe, c = o === Se, l = o === Ce;
|
|
983
|
+
if (!s && !c && !l) Pe(e, a + 1);
|
|
918
984
|
else {
|
|
919
|
-
if (
|
|
985
|
+
if (Pe(e, a), e.pos > t && e.tokens.push({
|
|
920
986
|
type: "text",
|
|
921
987
|
value: i.slice(t, e.pos),
|
|
922
988
|
line: n,
|
|
@@ -927,10 +993,10 @@ function ye(e) {
|
|
|
927
993
|
message: "Unclosed comment - missing '#}'",
|
|
928
994
|
line: e.line,
|
|
929
995
|
column: e.column
|
|
930
|
-
}),
|
|
996
|
+
}), Pe(e, t === -1 ? i.length : t + 2);
|
|
931
997
|
return;
|
|
932
998
|
}
|
|
933
|
-
|
|
999
|
+
F(e, 2), e.tokens.push({
|
|
934
1000
|
type: s ? "variable_start" : "tag_start",
|
|
935
1001
|
value: s ? "{{" : "{%",
|
|
936
1002
|
line: e.line,
|
|
@@ -940,22 +1006,22 @@ function ye(e) {
|
|
|
940
1006
|
return;
|
|
941
1007
|
}
|
|
942
1008
|
}
|
|
943
|
-
|
|
1009
|
+
Pe(e, i.length), e.pos > t && e.tokens.push({
|
|
944
1010
|
type: "text",
|
|
945
1011
|
value: e.input.slice(t, e.pos),
|
|
946
1012
|
line: n,
|
|
947
1013
|
column: r
|
|
948
1014
|
});
|
|
949
1015
|
}
|
|
950
|
-
function
|
|
951
|
-
if (
|
|
1016
|
+
function Ee(e) {
|
|
1017
|
+
if (Fe(e), P(e, "}}")) {
|
|
952
1018
|
e.tokens.push({
|
|
953
1019
|
type: "variable_end",
|
|
954
1020
|
value: "}}",
|
|
955
1021
|
line: e.line,
|
|
956
1022
|
column: e.column,
|
|
957
1023
|
trimRight: !1
|
|
958
|
-
}),
|
|
1024
|
+
}), F(e, 2), e.mode = "text";
|
|
959
1025
|
return;
|
|
960
1026
|
}
|
|
961
1027
|
let t = e.input[e.pos + 1];
|
|
@@ -978,31 +1044,31 @@ function be(e) {
|
|
|
978
1044
|
line: e.line,
|
|
979
1045
|
column: e.column,
|
|
980
1046
|
trimRight: !1
|
|
981
|
-
}),
|
|
982
|
-
else if (
|
|
1047
|
+
}), I(e), e.mode = "text";
|
|
1048
|
+
else if (P(e, "{%") || P(e, "{{")) {
|
|
983
1049
|
let t = [...e.tokens].reverse().findIndex((e) => e.type === "variable_start"), n = t >= 0 ? e.tokens.length - 1 - t : -1, r = n >= 0 ? e.tokens[n] : null;
|
|
984
1050
|
e.errors.push({
|
|
985
1051
|
message: "Missing closing '}}' for variable",
|
|
986
1052
|
line: r?.line || e.line,
|
|
987
1053
|
column: r?.column || e.column
|
|
988
1054
|
}), n >= 0 && e.tokens.splice(n), e.mode = "text";
|
|
989
|
-
} else
|
|
1055
|
+
} else Oe(e, "variable");
|
|
990
1056
|
}
|
|
991
|
-
function
|
|
992
|
-
if (
|
|
1057
|
+
function De(e) {
|
|
1058
|
+
if (Fe(e), P(e, "%}")) e.tokens.push({
|
|
993
1059
|
type: "tag_end",
|
|
994
1060
|
value: "%}",
|
|
995
1061
|
line: e.line,
|
|
996
1062
|
column: e.column,
|
|
997
1063
|
trimRight: !0
|
|
998
|
-
}),
|
|
999
|
-
else if (
|
|
1064
|
+
}), F(e, 2), e.mode = "text";
|
|
1065
|
+
else if (P(e, "-%}")) e.tokens.push({
|
|
1000
1066
|
type: "tag_end",
|
|
1001
1067
|
value: "-%}",
|
|
1002
1068
|
line: e.line,
|
|
1003
1069
|
column: e.column,
|
|
1004
1070
|
trimRight: !0
|
|
1005
|
-
}),
|
|
1071
|
+
}), F(e, 3), e.mode = "text";
|
|
1006
1072
|
else if (e.input[e.pos] === "}" && e.pos > 0 && e.input[e.pos - 1] !== "%") e.errors.push({
|
|
1007
1073
|
message: "Malformed tag: expected '%}' but found '}'. Did you forget the '%'?",
|
|
1008
1074
|
line: e.line,
|
|
@@ -1013,18 +1079,18 @@ function xe(e) {
|
|
|
1013
1079
|
line: e.line,
|
|
1014
1080
|
column: e.column,
|
|
1015
1081
|
trimRight: !0
|
|
1016
|
-
}),
|
|
1017
|
-
else if (
|
|
1082
|
+
}), I(e), e.mode = "text";
|
|
1083
|
+
else if (P(e, "{%") || P(e, "{{")) {
|
|
1018
1084
|
let t = [...e.tokens].reverse().findIndex((e) => e.type === "tag_start"), n = t >= 0 ? e.tokens.length - 1 - t : -1, r = n >= 0 ? e.tokens[n] : null;
|
|
1019
1085
|
e.errors.push({
|
|
1020
1086
|
message: "Missing closing '%}' for tag",
|
|
1021
1087
|
line: r?.line || e.line,
|
|
1022
1088
|
column: r?.column || e.column
|
|
1023
1089
|
}), n >= 0 && e.tokens.splice(n), e.mode = "text";
|
|
1024
|
-
} else
|
|
1090
|
+
} else Oe(e, "tag");
|
|
1025
1091
|
}
|
|
1026
|
-
function
|
|
1027
|
-
if (
|
|
1092
|
+
function Oe(e, t) {
|
|
1093
|
+
if (Fe(e), e.pos >= e.input.length) {
|
|
1028
1094
|
e.errors.push({
|
|
1029
1095
|
message: t === "variable" ? "Unclosed variable - missing '}}'" : "Unclosed tag - missing '%}'",
|
|
1030
1096
|
line: e.line,
|
|
@@ -1033,56 +1099,56 @@ function Se(e, t) {
|
|
|
1033
1099
|
return;
|
|
1034
1100
|
}
|
|
1035
1101
|
let n = e.input[e.pos], r = e.line, i = e.column;
|
|
1036
|
-
if (n === "\"" || n === "'")
|
|
1037
|
-
else if (
|
|
1038
|
-
else if (
|
|
1102
|
+
if (n === "\"" || n === "'") ke(e);
|
|
1103
|
+
else if (Le(n) || n === "-" && Le(e.input[e.pos + 1])) je(e);
|
|
1104
|
+
else if (P(e, "==")) e.tokens.push({
|
|
1039
1105
|
type: "op_eq",
|
|
1040
1106
|
value: "==",
|
|
1041
1107
|
line: r,
|
|
1042
1108
|
column: i
|
|
1043
|
-
}),
|
|
1044
|
-
else if (
|
|
1109
|
+
}), F(e, 2);
|
|
1110
|
+
else if (P(e, "!=")) e.tokens.push({
|
|
1045
1111
|
type: "op_neq",
|
|
1046
1112
|
value: "!=",
|
|
1047
1113
|
line: r,
|
|
1048
1114
|
column: i
|
|
1049
|
-
}),
|
|
1050
|
-
else if (
|
|
1115
|
+
}), F(e, 2);
|
|
1116
|
+
else if (P(e, ">=")) e.tokens.push({
|
|
1051
1117
|
type: "op_gte",
|
|
1052
1118
|
value: ">=",
|
|
1053
1119
|
line: r,
|
|
1054
1120
|
column: i
|
|
1055
|
-
}),
|
|
1056
|
-
else if (
|
|
1121
|
+
}), F(e, 2);
|
|
1122
|
+
else if (P(e, "<=")) e.tokens.push({
|
|
1057
1123
|
type: "op_lte",
|
|
1058
1124
|
value: "<=",
|
|
1059
1125
|
line: r,
|
|
1060
1126
|
column: i
|
|
1061
|
-
}),
|
|
1062
|
-
else if (
|
|
1127
|
+
}), F(e, 2);
|
|
1128
|
+
else if (P(e, "&&")) e.tokens.push({
|
|
1063
1129
|
type: "op_and",
|
|
1064
1130
|
value: "&&",
|
|
1065
1131
|
line: r,
|
|
1066
1132
|
column: i
|
|
1067
|
-
}),
|
|
1068
|
-
else if (
|
|
1133
|
+
}), F(e, 2);
|
|
1134
|
+
else if (P(e, "||")) e.tokens.push({
|
|
1069
1135
|
type: "op_or",
|
|
1070
1136
|
value: "||",
|
|
1071
1137
|
line: r,
|
|
1072
1138
|
column: i
|
|
1073
|
-
}),
|
|
1074
|
-
else if (
|
|
1139
|
+
}), F(e, 2);
|
|
1140
|
+
else if (P(e, "??")) e.tokens.push({
|
|
1075
1141
|
type: "op_nullish",
|
|
1076
1142
|
value: "??",
|
|
1077
1143
|
line: r,
|
|
1078
1144
|
column: i
|
|
1079
|
-
}),
|
|
1080
|
-
else if (
|
|
1145
|
+
}), F(e, 2);
|
|
1146
|
+
else if (P(e, "=>")) e.tokens.push({
|
|
1081
1147
|
type: "arrow",
|
|
1082
1148
|
value: "=>",
|
|
1083
1149
|
line: r,
|
|
1084
1150
|
column: i
|
|
1085
|
-
}),
|
|
1151
|
+
}), F(e, 2);
|
|
1086
1152
|
else {
|
|
1087
1153
|
switch (n) {
|
|
1088
1154
|
case ">":
|
|
@@ -1091,7 +1157,7 @@ function Se(e, t) {
|
|
|
1091
1157
|
value: ">",
|
|
1092
1158
|
line: r,
|
|
1093
1159
|
column: i
|
|
1094
|
-
}),
|
|
1160
|
+
}), I(e);
|
|
1095
1161
|
return;
|
|
1096
1162
|
case "<":
|
|
1097
1163
|
e.tokens.push({
|
|
@@ -1099,7 +1165,7 @@ function Se(e, t) {
|
|
|
1099
1165
|
value: "<",
|
|
1100
1166
|
line: r,
|
|
1101
1167
|
column: i
|
|
1102
|
-
}),
|
|
1168
|
+
}), I(e);
|
|
1103
1169
|
return;
|
|
1104
1170
|
case "!":
|
|
1105
1171
|
e.tokens.push({
|
|
@@ -1107,7 +1173,7 @@ function Se(e, t) {
|
|
|
1107
1173
|
value: "!",
|
|
1108
1174
|
line: r,
|
|
1109
1175
|
column: i
|
|
1110
|
-
}),
|
|
1176
|
+
}), I(e);
|
|
1111
1177
|
return;
|
|
1112
1178
|
case "=":
|
|
1113
1179
|
e.tokens.push({
|
|
@@ -1115,7 +1181,7 @@ function Se(e, t) {
|
|
|
1115
1181
|
value: "=",
|
|
1116
1182
|
line: r,
|
|
1117
1183
|
column: i
|
|
1118
|
-
}),
|
|
1184
|
+
}), I(e);
|
|
1119
1185
|
return;
|
|
1120
1186
|
case "|":
|
|
1121
1187
|
e.tokens.push({
|
|
@@ -1123,7 +1189,7 @@ function Se(e, t) {
|
|
|
1123
1189
|
value: "|",
|
|
1124
1190
|
line: r,
|
|
1125
1191
|
column: i
|
|
1126
|
-
}),
|
|
1192
|
+
}), I(e);
|
|
1127
1193
|
return;
|
|
1128
1194
|
case "(":
|
|
1129
1195
|
e.tokens.push({
|
|
@@ -1131,7 +1197,7 @@ function Se(e, t) {
|
|
|
1131
1197
|
value: "(",
|
|
1132
1198
|
line: r,
|
|
1133
1199
|
column: i
|
|
1134
|
-
}),
|
|
1200
|
+
}), I(e);
|
|
1135
1201
|
return;
|
|
1136
1202
|
case ")":
|
|
1137
1203
|
e.tokens.push({
|
|
@@ -1139,7 +1205,7 @@ function Se(e, t) {
|
|
|
1139
1205
|
value: ")",
|
|
1140
1206
|
line: r,
|
|
1141
1207
|
column: i
|
|
1142
|
-
}),
|
|
1208
|
+
}), I(e);
|
|
1143
1209
|
return;
|
|
1144
1210
|
case "[":
|
|
1145
1211
|
e.tokens.push({
|
|
@@ -1147,7 +1213,7 @@ function Se(e, t) {
|
|
|
1147
1213
|
value: "[",
|
|
1148
1214
|
line: r,
|
|
1149
1215
|
column: i
|
|
1150
|
-
}),
|
|
1216
|
+
}), I(e);
|
|
1151
1217
|
return;
|
|
1152
1218
|
case "]":
|
|
1153
1219
|
e.tokens.push({
|
|
@@ -1155,7 +1221,7 @@ function Se(e, t) {
|
|
|
1155
1221
|
value: "]",
|
|
1156
1222
|
line: r,
|
|
1157
1223
|
column: i
|
|
1158
|
-
}),
|
|
1224
|
+
}), I(e);
|
|
1159
1225
|
return;
|
|
1160
1226
|
case ":":
|
|
1161
1227
|
e.tokens.push({
|
|
@@ -1163,7 +1229,7 @@ function Se(e, t) {
|
|
|
1163
1229
|
value: ":",
|
|
1164
1230
|
line: r,
|
|
1165
1231
|
column: i
|
|
1166
|
-
}),
|
|
1232
|
+
}), I(e);
|
|
1167
1233
|
return;
|
|
1168
1234
|
case ",":
|
|
1169
1235
|
e.tokens.push({
|
|
@@ -1171,7 +1237,7 @@ function Se(e, t) {
|
|
|
1171
1237
|
value: ",",
|
|
1172
1238
|
line: r,
|
|
1173
1239
|
column: i
|
|
1174
|
-
}),
|
|
1240
|
+
}), I(e);
|
|
1175
1241
|
return;
|
|
1176
1242
|
case ".":
|
|
1177
1243
|
e.tokens.push({
|
|
@@ -1179,7 +1245,7 @@ function Se(e, t) {
|
|
|
1179
1245
|
value: ".",
|
|
1180
1246
|
line: r,
|
|
1181
1247
|
column: i
|
|
1182
|
-
}),
|
|
1248
|
+
}), I(e);
|
|
1183
1249
|
return;
|
|
1184
1250
|
case "*":
|
|
1185
1251
|
e.tokens.push({
|
|
@@ -1187,7 +1253,7 @@ function Se(e, t) {
|
|
|
1187
1253
|
value: "*",
|
|
1188
1254
|
line: r,
|
|
1189
1255
|
column: i
|
|
1190
|
-
}),
|
|
1256
|
+
}), I(e);
|
|
1191
1257
|
return;
|
|
1192
1258
|
case "/":
|
|
1193
1259
|
e.tokens.push({
|
|
@@ -1195,7 +1261,7 @@ function Se(e, t) {
|
|
|
1195
1261
|
value: "/",
|
|
1196
1262
|
line: r,
|
|
1197
1263
|
column: i
|
|
1198
|
-
}),
|
|
1264
|
+
}), I(e);
|
|
1199
1265
|
return;
|
|
1200
1266
|
case "+":
|
|
1201
1267
|
e.tokens.push({
|
|
@@ -1203,7 +1269,7 @@ function Se(e, t) {
|
|
|
1203
1269
|
value: "+",
|
|
1204
1270
|
line: r,
|
|
1205
1271
|
column: i
|
|
1206
|
-
}),
|
|
1272
|
+
}), I(e);
|
|
1207
1273
|
return;
|
|
1208
1274
|
case "{":
|
|
1209
1275
|
e.tokens.push({
|
|
@@ -1211,7 +1277,7 @@ function Se(e, t) {
|
|
|
1211
1277
|
value: "{",
|
|
1212
1278
|
line: r,
|
|
1213
1279
|
column: i
|
|
1214
|
-
}),
|
|
1280
|
+
}), I(e);
|
|
1215
1281
|
return;
|
|
1216
1282
|
case "}":
|
|
1217
1283
|
e.tokens.push({
|
|
@@ -1219,7 +1285,7 @@ function Se(e, t) {
|
|
|
1219
1285
|
value: "}",
|
|
1220
1286
|
line: r,
|
|
1221
1287
|
column: i
|
|
1222
|
-
}),
|
|
1288
|
+
}), I(e);
|
|
1223
1289
|
return;
|
|
1224
1290
|
case "$":
|
|
1225
1291
|
e.tokens.push({
|
|
@@ -1227,22 +1293,22 @@ function Se(e, t) {
|
|
|
1227
1293
|
value: "$",
|
|
1228
1294
|
line: r,
|
|
1229
1295
|
column: i
|
|
1230
|
-
}),
|
|
1296
|
+
}), I(e);
|
|
1231
1297
|
return;
|
|
1232
1298
|
}
|
|
1233
|
-
|
|
1299
|
+
Re(n) ? Me(e) : n === "\\" ? Ae(e) : (e.errors.push({
|
|
1234
1300
|
message: `Unexpected character '${n}' in template`,
|
|
1235
1301
|
line: e.line,
|
|
1236
1302
|
column: e.column
|
|
1237
|
-
}),
|
|
1303
|
+
}), I(e));
|
|
1238
1304
|
}
|
|
1239
1305
|
}
|
|
1240
|
-
function
|
|
1306
|
+
function ke(e) {
|
|
1241
1307
|
let t = e.input[e.pos], n = e.line, r = e.column, i = "", a = "";
|
|
1242
|
-
for (
|
|
1308
|
+
for (I(e); e.pos < e.input.length;) {
|
|
1243
1309
|
let o = e.input[e.pos], s = e.input[e.pos + 1] || "";
|
|
1244
1310
|
if (o === t) {
|
|
1245
|
-
|
|
1311
|
+
I(e), b(a) && (i = a.replace(/\\([\\"'])/g, "$1")), e.tokens.push({
|
|
1246
1312
|
type: "string",
|
|
1247
1313
|
value: i,
|
|
1248
1314
|
line: n,
|
|
@@ -1264,10 +1330,10 @@ function Ce(e) {
|
|
|
1264
1330
|
return;
|
|
1265
1331
|
}
|
|
1266
1332
|
if (o === "\\" && e.pos + 1 < e.input.length) {
|
|
1267
|
-
|
|
1333
|
+
I(e);
|
|
1268
1334
|
let t = e.input[e.pos];
|
|
1269
|
-
a += "\\" + t, i +=
|
|
1270
|
-
} else i += o, a += o,
|
|
1335
|
+
a += "\\" + t, i += C(t), I(e);
|
|
1336
|
+
} else i += o, a += o, I(e);
|
|
1271
1337
|
}
|
|
1272
1338
|
e.errors.push({
|
|
1273
1339
|
message: `Unclosed string - missing closing ${t}`,
|
|
@@ -1280,7 +1346,7 @@ function Ce(e) {
|
|
|
1280
1346
|
column: r
|
|
1281
1347
|
});
|
|
1282
1348
|
}
|
|
1283
|
-
function
|
|
1349
|
+
function Ae(e) {
|
|
1284
1350
|
let t = e.line, n = e.column, r = "";
|
|
1285
1351
|
for (; e.pos < e.input.length;) {
|
|
1286
1352
|
let t = e.input[e.pos], n = e.input[e.pos + 1] || "";
|
|
@@ -1314,8 +1380,8 @@ function we(e) {
|
|
|
1314
1380
|
break;
|
|
1315
1381
|
default: r += t;
|
|
1316
1382
|
}
|
|
1317
|
-
|
|
1318
|
-
} else r += t,
|
|
1383
|
+
I(e), I(e);
|
|
1384
|
+
} else r += t, I(e);
|
|
1319
1385
|
}
|
|
1320
1386
|
e.tokens.push({
|
|
1321
1387
|
type: "string",
|
|
@@ -1324,10 +1390,10 @@ function we(e) {
|
|
|
1324
1390
|
column: n
|
|
1325
1391
|
});
|
|
1326
1392
|
}
|
|
1327
|
-
function
|
|
1393
|
+
function je(e) {
|
|
1328
1394
|
let t = e.line, n = e.column, r = "";
|
|
1329
|
-
for (e.input[e.pos] === "-" && (r += "-",
|
|
1330
|
-
if (e.pos < e.input.length && e.input[e.pos] === ".") for (r += ".",
|
|
1395
|
+
for (e.input[e.pos] === "-" && (r += "-", I(e)); e.pos < e.input.length && Le(e.input[e.pos]);) r += e.input[e.pos], I(e);
|
|
1396
|
+
if (e.pos < e.input.length && e.input[e.pos] === ".") for (r += ".", I(e); e.pos < e.input.length && Le(e.input[e.pos]);) r += e.input[e.pos], I(e);
|
|
1331
1397
|
e.tokens.push({
|
|
1332
1398
|
type: "number",
|
|
1333
1399
|
value: r,
|
|
@@ -1335,11 +1401,11 @@ function Te(e) {
|
|
|
1335
1401
|
column: n
|
|
1336
1402
|
});
|
|
1337
1403
|
}
|
|
1338
|
-
function
|
|
1404
|
+
function Me(e) {
|
|
1339
1405
|
let t = e.line, n = e.column, r = "";
|
|
1340
|
-
for (; e.pos < e.input.length &&
|
|
1341
|
-
(r === "selector" || r === "selectorHtml") && e.pos < e.input.length && e.input[e.pos] === ":" && (r += ":",
|
|
1342
|
-
let i = r.toLowerCase(), a = Object.prototype.hasOwnProperty.call(
|
|
1406
|
+
for (; e.pos < e.input.length && ze(e.input[e.pos]);) r += e.input[e.pos], I(e);
|
|
1407
|
+
(r === "selector" || r === "selectorHtml") && e.pos < e.input.length && e.input[e.pos] === ":" && (r += ":", I(e), r = Ne(e, r));
|
|
1408
|
+
let i = r.toLowerCase(), a = Object.prototype.hasOwnProperty.call(be, i) ? be[i] : void 0;
|
|
1343
1409
|
e.tokens.push(a ? {
|
|
1344
1410
|
type: a,
|
|
1345
1411
|
value: r,
|
|
@@ -1352,7 +1418,7 @@ function Ee(e) {
|
|
|
1352
1418
|
column: n
|
|
1353
1419
|
});
|
|
1354
1420
|
}
|
|
1355
|
-
function
|
|
1421
|
+
function Ne(e, t) {
|
|
1356
1422
|
let n = 0, r = 0, i = null;
|
|
1357
1423
|
for (; e.pos < e.input.length;) {
|
|
1358
1424
|
let a = e.input[e.pos], o = e.input[e.pos + 1] || "";
|
|
@@ -1383,7 +1449,7 @@ function De(e, t) {
|
|
|
1383
1449
|
break;
|
|
1384
1450
|
}
|
|
1385
1451
|
}
|
|
1386
|
-
!i && a === "\\" && (o === "\"" || o === "'") ? (t += a,
|
|
1452
|
+
!i && a === "\\" && (o === "\"" || o === "'") ? (t += a, I(e), t += e.input[e.pos], I(e)) : !i && (a === "\"" || a === "'") ? (i = a, t += a, I(e)) : i && a === i ? (i = null, t += a, I(e)) : i && a === "\\" && e.pos + 1 < e.input.length ? (t += a, I(e), t += e.input[e.pos], I(e)) : (i || (a === "[" ? n++ : a === "]" ? (n--, n < 0 && (e.errors.push({
|
|
1387
1453
|
message: "Extra ']' in selector - no matching '['",
|
|
1388
1454
|
line: e.line,
|
|
1389
1455
|
column: e.column
|
|
@@ -1391,55 +1457,55 @@ function De(e, t) {
|
|
|
1391
1457
|
message: "Extra ')' in selector - no matching '('",
|
|
1392
1458
|
line: e.line,
|
|
1393
1459
|
column: e.column
|
|
1394
|
-
}), r = 0))), t += a,
|
|
1460
|
+
}), r = 0))), t += a, I(e));
|
|
1395
1461
|
}
|
|
1396
1462
|
return t.trimEnd();
|
|
1397
1463
|
}
|
|
1398
|
-
function
|
|
1464
|
+
function P(e, t) {
|
|
1399
1465
|
return e.input.startsWith(t, e.pos);
|
|
1400
1466
|
}
|
|
1401
|
-
function
|
|
1467
|
+
function Pe(e, t) {
|
|
1402
1468
|
if (t <= e.pos) return;
|
|
1403
1469
|
let n = e.input, r = -1, i = 0;
|
|
1404
1470
|
for (let a = n.indexOf("\n", e.pos); a !== -1 && a < t; a = n.indexOf("\n", a + 1)) r = a, i++;
|
|
1405
1471
|
i > 0 ? (e.line += i, e.column = t - r) : e.column += t - e.pos, e.pos = t;
|
|
1406
1472
|
}
|
|
1407
|
-
function
|
|
1408
|
-
for (let n = 0; n < t; n++)
|
|
1473
|
+
function F(e, t) {
|
|
1474
|
+
for (let n = 0; n < t; n++) I(e);
|
|
1409
1475
|
}
|
|
1410
|
-
function
|
|
1476
|
+
function I(e) {
|
|
1411
1477
|
e.pos < e.input.length && (e.input[e.pos] === "\n" ? (e.line++, e.column = 1) : e.column++, e.pos++);
|
|
1412
1478
|
}
|
|
1413
|
-
function
|
|
1414
|
-
for (; e.pos < e.input.length &&
|
|
1479
|
+
function Fe(e) {
|
|
1480
|
+
for (; e.pos < e.input.length && Ie(e.input[e.pos]);) I(e);
|
|
1415
1481
|
}
|
|
1416
|
-
function
|
|
1482
|
+
function Ie(e) {
|
|
1417
1483
|
return e === " " || e === " " || e === "\n" || e === "\r";
|
|
1418
1484
|
}
|
|
1419
|
-
function
|
|
1485
|
+
function Le(e) {
|
|
1420
1486
|
return e >= "0" && e <= "9";
|
|
1421
1487
|
}
|
|
1422
|
-
function
|
|
1488
|
+
function Re(e) {
|
|
1423
1489
|
return e >= "a" && e <= "z" || e >= "A" && e <= "Z" || e === "_" || e === "@";
|
|
1424
1490
|
}
|
|
1425
|
-
function
|
|
1426
|
-
return
|
|
1491
|
+
function ze(e) {
|
|
1492
|
+
return Re(e) || Le(e) || e === "-" || e === ".";
|
|
1427
1493
|
}
|
|
1428
|
-
function
|
|
1494
|
+
function Be(e, t = {}) {
|
|
1429
1495
|
try {
|
|
1430
|
-
let n =
|
|
1431
|
-
e.length > n.maxTemplateLength &&
|
|
1432
|
-
let r =
|
|
1433
|
-
return
|
|
1496
|
+
let n = ve(t);
|
|
1497
|
+
e.length > n.maxTemplateLength && N("maxTemplateLength");
|
|
1498
|
+
let r = we(e);
|
|
1499
|
+
return He(r.tokens, t, r.errors);
|
|
1434
1500
|
} catch (e) {
|
|
1435
|
-
return
|
|
1501
|
+
return Ve(e);
|
|
1436
1502
|
}
|
|
1437
1503
|
}
|
|
1438
|
-
function
|
|
1439
|
-
if (e instanceof
|
|
1504
|
+
function Ve(e) {
|
|
1505
|
+
if (e instanceof M || e instanceof RangeError) return {
|
|
1440
1506
|
ast: [],
|
|
1441
1507
|
errors: [{
|
|
1442
|
-
message: e instanceof
|
|
1508
|
+
message: e instanceof M ? e.message : "Template exceeded maxDepth",
|
|
1443
1509
|
code: "LIMIT_EXCEEDED",
|
|
1444
1510
|
line: 1,
|
|
1445
1511
|
column: 1
|
|
@@ -1447,21 +1513,21 @@ function Pe(e) {
|
|
|
1447
1513
|
};
|
|
1448
1514
|
throw e;
|
|
1449
1515
|
}
|
|
1450
|
-
function
|
|
1516
|
+
function He(e, t = {}, n = []) {
|
|
1451
1517
|
try {
|
|
1452
|
-
let r =
|
|
1518
|
+
let r = ve(t), i = {
|
|
1453
1519
|
tokens: e,
|
|
1454
1520
|
pos: 0,
|
|
1455
1521
|
errors: n,
|
|
1456
1522
|
depth: 0,
|
|
1457
1523
|
maxDepth: r.maxDepth
|
|
1458
|
-
}, a =
|
|
1524
|
+
}, a = We(i), o = a.map((e) => ({
|
|
1459
1525
|
value: e,
|
|
1460
1526
|
depth: 0
|
|
1461
1527
|
}));
|
|
1462
1528
|
for (; o.length;) {
|
|
1463
1529
|
let { value: e, depth: t } = o.pop();
|
|
1464
|
-
if (t > r.maxDepth &&
|
|
1530
|
+
if (t > r.maxDepth && N("maxDepth"), e && typeof e == "object") for (let n of Object.values(e)) n && typeof n == "object" && o.push({
|
|
1465
1531
|
value: n,
|
|
1466
1532
|
depth: t + +!Array.isArray(n)
|
|
1467
1533
|
});
|
|
@@ -1471,42 +1537,42 @@ function Fe(e, t = {}, n = []) {
|
|
|
1471
1537
|
errors: i.errors
|
|
1472
1538
|
};
|
|
1473
1539
|
} catch (e) {
|
|
1474
|
-
return
|
|
1540
|
+
return Ve(e);
|
|
1475
1541
|
}
|
|
1476
1542
|
}
|
|
1477
|
-
function
|
|
1478
|
-
++e.depth > e.maxDepth &&
|
|
1543
|
+
function Ue(e, t) {
|
|
1544
|
+
++e.depth > e.maxDepth && N("maxDepth");
|
|
1479
1545
|
try {
|
|
1480
1546
|
return t();
|
|
1481
1547
|
} finally {
|
|
1482
1548
|
e.depth--;
|
|
1483
1549
|
}
|
|
1484
1550
|
}
|
|
1485
|
-
function
|
|
1551
|
+
function We(e) {
|
|
1486
1552
|
let t = [];
|
|
1487
|
-
for (; !
|
|
1488
|
-
let n =
|
|
1553
|
+
for (; !B(e);) {
|
|
1554
|
+
let n = Ge(e);
|
|
1489
1555
|
n && t.push(n);
|
|
1490
1556
|
}
|
|
1491
1557
|
return t;
|
|
1492
1558
|
}
|
|
1493
|
-
function
|
|
1494
|
-
let t =
|
|
1559
|
+
function Ge(e) {
|
|
1560
|
+
let t = L(e);
|
|
1495
1561
|
switch (t.type) {
|
|
1496
|
-
case "text": return
|
|
1497
|
-
case "variable_start": return
|
|
1498
|
-
case "tag_start": return
|
|
1499
|
-
case "eof": return
|
|
1562
|
+
case "text": return Ke(e);
|
|
1563
|
+
case "variable_start": return qe(e);
|
|
1564
|
+
case "tag_start": return Je(e);
|
|
1565
|
+
case "eof": return R(e), null;
|
|
1500
1566
|
default: return e.errors.push({
|
|
1501
1567
|
message: `Unexpected "${t.value}" in template`,
|
|
1502
1568
|
line: t.line,
|
|
1503
1569
|
column: t.column
|
|
1504
|
-
}),
|
|
1570
|
+
}), R(e), null;
|
|
1505
1571
|
}
|
|
1506
1572
|
}
|
|
1507
|
-
function
|
|
1508
|
-
let t =
|
|
1509
|
-
for (;
|
|
1573
|
+
function Ke(e) {
|
|
1574
|
+
let t = R(e), n = [t.value];
|
|
1575
|
+
for (; z(e, "text");) n.push(R(e).value);
|
|
1510
1576
|
return {
|
|
1511
1577
|
type: "text",
|
|
1512
1578
|
value: n.join(""),
|
|
@@ -1514,9 +1580,9 @@ function ze(e) {
|
|
|
1514
1580
|
column: t.column
|
|
1515
1581
|
};
|
|
1516
1582
|
}
|
|
1517
|
-
function
|
|
1518
|
-
let t =
|
|
1519
|
-
if (
|
|
1583
|
+
function qe(e) {
|
|
1584
|
+
let t = R(e), n = t.trimLeft || !1;
|
|
1585
|
+
if (z(e, "identifier") && e.tokens[e.pos + 1]?.type === "identifier") {
|
|
1520
1586
|
let t = e.tokens[e.pos], n = e.pos + 1, r = [t.value];
|
|
1521
1587
|
for (; e.tokens[n]?.type === "identifier";) r.push(e.tokens[n].value), n++;
|
|
1522
1588
|
e.tokens.splice(e.pos, n - e.pos, {
|
|
@@ -1524,17 +1590,17 @@ function Be(e) {
|
|
|
1524
1590
|
value: r.join(" ")
|
|
1525
1591
|
});
|
|
1526
1592
|
}
|
|
1527
|
-
let r =
|
|
1593
|
+
let r = et(e);
|
|
1528
1594
|
if (!r) return e.errors.push({
|
|
1529
1595
|
message: "Empty variable - add a variable name between {{ and }}",
|
|
1530
1596
|
line: t.line,
|
|
1531
1597
|
column: t.column
|
|
1532
|
-
}),
|
|
1598
|
+
}), ht(e), null;
|
|
1533
1599
|
let i = !1;
|
|
1534
|
-
return
|
|
1600
|
+
return z(e, "variable_end") ? i = R(e).trimRight || !1 : e.errors.push({
|
|
1535
1601
|
message: "Missing closing }}",
|
|
1536
|
-
line:
|
|
1537
|
-
column:
|
|
1602
|
+
line: L(e).line,
|
|
1603
|
+
column: L(e).column
|
|
1538
1604
|
}), {
|
|
1539
1605
|
type: "variable",
|
|
1540
1606
|
expression: r,
|
|
@@ -1544,12 +1610,12 @@ function Be(e) {
|
|
|
1544
1610
|
column: t.column
|
|
1545
1611
|
};
|
|
1546
1612
|
}
|
|
1547
|
-
function
|
|
1548
|
-
let t =
|
|
1613
|
+
function Je(e) {
|
|
1614
|
+
let t = R(e), n = t.trimLeft || !1, r = L(e);
|
|
1549
1615
|
switch (r.type) {
|
|
1550
|
-
case "keyword_if": return
|
|
1551
|
-
case "keyword_for": return
|
|
1552
|
-
case "keyword_set": return
|
|
1616
|
+
case "keyword_if": return Ye(e, t, n);
|
|
1617
|
+
case "keyword_for": return Xe(e, t, n);
|
|
1618
|
+
case "keyword_set": return Ze(e, t, n);
|
|
1553
1619
|
case "keyword_else":
|
|
1554
1620
|
case "keyword_elseif":
|
|
1555
1621
|
case "keyword_endif":
|
|
@@ -1557,46 +1623,46 @@ function Ve(e) {
|
|
|
1557
1623
|
message: `Unexpected {% ${r.value} %} - no matching opening tag`,
|
|
1558
1624
|
line: r.line,
|
|
1559
1625
|
column: r.column
|
|
1560
|
-
}),
|
|
1626
|
+
}), V(e), null;
|
|
1561
1627
|
default: return e.errors.push({
|
|
1562
1628
|
message: `Unknown tag: {% ${r.value} %}`,
|
|
1563
1629
|
line: r.line,
|
|
1564
1630
|
column: r.column
|
|
1565
|
-
}),
|
|
1631
|
+
}), V(e), null;
|
|
1566
1632
|
}
|
|
1567
1633
|
}
|
|
1568
|
-
function
|
|
1569
|
-
|
|
1570
|
-
let r =
|
|
1634
|
+
function Ye(e, t, n) {
|
|
1635
|
+
R(e);
|
|
1636
|
+
let r = et(e);
|
|
1571
1637
|
if (!r) return e.errors.push({
|
|
1572
1638
|
message: "{% if %} requires a condition",
|
|
1573
1639
|
line: t.line,
|
|
1574
1640
|
column: t.column
|
|
1575
|
-
}),
|
|
1641
|
+
}), V(e), null;
|
|
1576
1642
|
let i = !1;
|
|
1577
|
-
|
|
1643
|
+
z(e, "tag_end") ? i = R(e).trimRight || !1 : e.errors.push({
|
|
1578
1644
|
message: "Missing %} to close {% if %}",
|
|
1579
|
-
line:
|
|
1580
|
-
column:
|
|
1645
|
+
line: L(e).line,
|
|
1646
|
+
column: L(e).column
|
|
1581
1647
|
});
|
|
1582
|
-
let a =
|
|
1648
|
+
let a = Qe(e, [
|
|
1583
1649
|
"keyword_elseif",
|
|
1584
1650
|
"keyword_else",
|
|
1585
1651
|
"keyword_endif"
|
|
1586
1652
|
], !0), o = [];
|
|
1587
|
-
for (;
|
|
1588
|
-
|
|
1589
|
-
let t =
|
|
1653
|
+
for (; ft(e, "keyword_elseif");) {
|
|
1654
|
+
pt(e), R(e);
|
|
1655
|
+
let t = et(e);
|
|
1590
1656
|
if (!t) {
|
|
1591
1657
|
e.errors.push({
|
|
1592
1658
|
message: "{% elseif %} requires a condition",
|
|
1593
|
-
line:
|
|
1594
|
-
column:
|
|
1595
|
-
}),
|
|
1659
|
+
line: L(e).line,
|
|
1660
|
+
column: L(e).column
|
|
1661
|
+
}), V(e);
|
|
1596
1662
|
continue;
|
|
1597
1663
|
}
|
|
1598
|
-
|
|
1599
|
-
let n =
|
|
1664
|
+
mt(e);
|
|
1665
|
+
let n = Qe(e, [
|
|
1600
1666
|
"keyword_elseif",
|
|
1601
1667
|
"keyword_else",
|
|
1602
1668
|
"keyword_endif"
|
|
@@ -1607,10 +1673,10 @@ function He(e, t, n) {
|
|
|
1607
1673
|
});
|
|
1608
1674
|
}
|
|
1609
1675
|
let s = null;
|
|
1610
|
-
return
|
|
1676
|
+
return ft(e, "keyword_else") && (pt(e), R(e), mt(e), s = Qe(e, ["keyword_endif"], !0)), ft(e, "keyword_endif") ? (pt(e), R(e), mt(e)) : e.errors.push({
|
|
1611
1677
|
message: "Missing {% endif %} to close {% if %}",
|
|
1612
|
-
line:
|
|
1613
|
-
column:
|
|
1678
|
+
line: L(e).line,
|
|
1679
|
+
column: L(e).column
|
|
1614
1680
|
}), {
|
|
1615
1681
|
type: "if",
|
|
1616
1682
|
condition: r,
|
|
@@ -1623,36 +1689,36 @@ function He(e, t, n) {
|
|
|
1623
1689
|
column: t.column
|
|
1624
1690
|
};
|
|
1625
1691
|
}
|
|
1626
|
-
function
|
|
1627
|
-
if (
|
|
1692
|
+
function Xe(e, t, n) {
|
|
1693
|
+
if (R(e), !z(e, "identifier")) return e.errors.push({
|
|
1628
1694
|
message: "{% for %} requires a variable name, e.g. {% for item in items %}",
|
|
1629
|
-
line:
|
|
1630
|
-
column:
|
|
1631
|
-
}),
|
|
1632
|
-
let r =
|
|
1633
|
-
if (!
|
|
1695
|
+
line: L(e).line,
|
|
1696
|
+
column: L(e).column
|
|
1697
|
+
}), V(e), null;
|
|
1698
|
+
let r = R(e).value;
|
|
1699
|
+
if (!z(e, "keyword_in")) return e.errors.push({
|
|
1634
1700
|
message: "{% for %} requires \"in\" keyword, e.g. {% for item in items %}",
|
|
1635
|
-
line:
|
|
1636
|
-
column:
|
|
1637
|
-
}),
|
|
1638
|
-
|
|
1639
|
-
let i =
|
|
1701
|
+
line: L(e).line,
|
|
1702
|
+
column: L(e).column
|
|
1703
|
+
}), V(e), null;
|
|
1704
|
+
R(e);
|
|
1705
|
+
let i = et(e);
|
|
1640
1706
|
if (!i) return e.errors.push({
|
|
1641
1707
|
message: "{% for %} requires something to loop over after \"in\"",
|
|
1642
|
-
line:
|
|
1643
|
-
column:
|
|
1644
|
-
}),
|
|
1708
|
+
line: L(e).line,
|
|
1709
|
+
column: L(e).column
|
|
1710
|
+
}), V(e), null;
|
|
1645
1711
|
let a = !1;
|
|
1646
|
-
|
|
1712
|
+
z(e, "tag_end") ? a = R(e).trimRight || !1 : e.errors.push({
|
|
1647
1713
|
message: "Missing %} to close {% for %}",
|
|
1648
|
-
line:
|
|
1649
|
-
column:
|
|
1714
|
+
line: L(e).line,
|
|
1715
|
+
column: L(e).column
|
|
1650
1716
|
});
|
|
1651
|
-
let o =
|
|
1652
|
-
return
|
|
1717
|
+
let o = Qe(e, ["keyword_endfor"]);
|
|
1718
|
+
return ft(e, "keyword_endfor") ? (pt(e), R(e), mt(e)) : e.errors.push({
|
|
1653
1719
|
message: "Missing {% endfor %} to close {% for %}",
|
|
1654
|
-
line:
|
|
1655
|
-
column:
|
|
1720
|
+
line: L(e).line,
|
|
1721
|
+
column: L(e).column
|
|
1656
1722
|
}), {
|
|
1657
1723
|
type: "for",
|
|
1658
1724
|
iterator: r,
|
|
@@ -1664,30 +1730,30 @@ function Ue(e, t, n) {
|
|
|
1664
1730
|
column: t.column
|
|
1665
1731
|
};
|
|
1666
1732
|
}
|
|
1667
|
-
function
|
|
1668
|
-
if (
|
|
1733
|
+
function Ze(e, t, n) {
|
|
1734
|
+
if (R(e), !z(e, "identifier")) return e.errors.push({
|
|
1669
1735
|
message: "{% set %} requires a variable name, e.g. {% set name = value %}",
|
|
1670
|
-
line:
|
|
1671
|
-
column:
|
|
1672
|
-
}),
|
|
1673
|
-
let r =
|
|
1674
|
-
if (!
|
|
1736
|
+
line: L(e).line,
|
|
1737
|
+
column: L(e).column
|
|
1738
|
+
}), V(e), null;
|
|
1739
|
+
let r = R(e).value;
|
|
1740
|
+
if (!z(e, "op_assign")) return e.errors.push({
|
|
1675
1741
|
message: "{% set %} requires \"=\" after variable name",
|
|
1676
|
-
line:
|
|
1677
|
-
column:
|
|
1678
|
-
}),
|
|
1679
|
-
|
|
1680
|
-
let i =
|
|
1742
|
+
line: L(e).line,
|
|
1743
|
+
column: L(e).column
|
|
1744
|
+
}), V(e), null;
|
|
1745
|
+
R(e);
|
|
1746
|
+
let i = et(e);
|
|
1681
1747
|
if (!i) return e.errors.push({
|
|
1682
1748
|
message: "{% set %} requires a value after \"=\"",
|
|
1683
|
-
line:
|
|
1684
|
-
column:
|
|
1685
|
-
}),
|
|
1749
|
+
line: L(e).line,
|
|
1750
|
+
column: L(e).column
|
|
1751
|
+
}), V(e), null;
|
|
1686
1752
|
let a = !1;
|
|
1687
|
-
return
|
|
1753
|
+
return z(e, "tag_end") ? a = R(e).trimRight || !1 : e.errors.push({
|
|
1688
1754
|
message: "Missing %} to close {% set %}",
|
|
1689
|
-
line:
|
|
1690
|
-
column:
|
|
1755
|
+
line: L(e).line,
|
|
1756
|
+
column: L(e).column
|
|
1691
1757
|
}), {
|
|
1692
1758
|
type: "set",
|
|
1693
1759
|
variable: r,
|
|
@@ -1698,13 +1764,13 @@ function We(e, t, n) {
|
|
|
1698
1764
|
column: t.column
|
|
1699
1765
|
};
|
|
1700
1766
|
}
|
|
1701
|
-
function
|
|
1702
|
-
return
|
|
1767
|
+
function Qe(e, t, n = !1) {
|
|
1768
|
+
return Ue(e, () => $e(e, t, n));
|
|
1703
1769
|
}
|
|
1704
|
-
function
|
|
1770
|
+
function $e(e, t, n = !1) {
|
|
1705
1771
|
let r = [];
|
|
1706
|
-
for (; !
|
|
1707
|
-
if (
|
|
1772
|
+
for (; !B(e);) {
|
|
1773
|
+
if (ft(e, ...t)) {
|
|
1708
1774
|
if (n) {
|
|
1709
1775
|
let t = e.pos;
|
|
1710
1776
|
for (; t < e.tokens.length && e.tokens[t].type !== "tag_end";) t++;
|
|
@@ -1713,19 +1779,19 @@ function Ke(e, t, n = !1) {
|
|
|
1713
1779
|
}
|
|
1714
1780
|
break;
|
|
1715
1781
|
}
|
|
1716
|
-
let i =
|
|
1782
|
+
let i = Ge(e);
|
|
1717
1783
|
i && r.push(i);
|
|
1718
1784
|
}
|
|
1719
1785
|
return r;
|
|
1720
1786
|
}
|
|
1721
|
-
function
|
|
1722
|
-
return
|
|
1787
|
+
function et(e) {
|
|
1788
|
+
return tt(e);
|
|
1723
1789
|
}
|
|
1724
|
-
function
|
|
1725
|
-
let t =
|
|
1790
|
+
function tt(e) {
|
|
1791
|
+
let t = rt(e);
|
|
1726
1792
|
if (!t) return null;
|
|
1727
|
-
for (;
|
|
1728
|
-
let n =
|
|
1793
|
+
for (; z(e, "op_nullish");) {
|
|
1794
|
+
let n = R(e), r = rt(e);
|
|
1729
1795
|
if (!r) {
|
|
1730
1796
|
e.errors.push({
|
|
1731
1797
|
message: "Missing fallback value after ??",
|
|
@@ -1745,10 +1811,10 @@ function qe(e) {
|
|
|
1745
1811
|
}
|
|
1746
1812
|
return t;
|
|
1747
1813
|
}
|
|
1748
|
-
function
|
|
1749
|
-
let t =
|
|
1750
|
-
if (
|
|
1751
|
-
let t =
|
|
1814
|
+
function nt(e) {
|
|
1815
|
+
let t = L(e);
|
|
1816
|
+
if (z(e, "slash") || z(e, "star")) {
|
|
1817
|
+
let t = R(e);
|
|
1752
1818
|
return {
|
|
1753
1819
|
type: "literal",
|
|
1754
1820
|
value: t.value,
|
|
@@ -1757,17 +1823,17 @@ function Je(e) {
|
|
|
1757
1823
|
column: t.column
|
|
1758
1824
|
};
|
|
1759
1825
|
}
|
|
1760
|
-
if (
|
|
1761
|
-
let t = "", n = 0, r =
|
|
1762
|
-
for (; !
|
|
1763
|
-
let r =
|
|
1826
|
+
if (z(e, "lbracket")) {
|
|
1827
|
+
let t = "", n = 0, r = L(e).line, i = L(e).column;
|
|
1828
|
+
for (; !B(e);) {
|
|
1829
|
+
let r = L(e);
|
|
1764
1830
|
if (r.type === "lbracket") n++;
|
|
1765
1831
|
else if (r.type === "rbracket" && (n--, n === 0)) {
|
|
1766
|
-
t += r.value,
|
|
1832
|
+
t += r.value, R(e);
|
|
1767
1833
|
break;
|
|
1768
1834
|
}
|
|
1769
1835
|
if (n === 0 && (r.type === "pipe" || r.type === "variable_end" || r.type === "comma")) break;
|
|
1770
|
-
t += r.value,
|
|
1836
|
+
t += r.value, R(e);
|
|
1771
1837
|
}
|
|
1772
1838
|
return {
|
|
1773
1839
|
type: "literal",
|
|
@@ -1777,18 +1843,18 @@ function Je(e) {
|
|
|
1777
1843
|
column: i
|
|
1778
1844
|
};
|
|
1779
1845
|
}
|
|
1780
|
-
if (
|
|
1781
|
-
let n = e.pos, r =
|
|
1782
|
-
if (
|
|
1846
|
+
if (z(e, "identifier")) {
|
|
1847
|
+
let n = e.pos, r = R(e);
|
|
1848
|
+
if (z(e, "arrow")) {
|
|
1783
1849
|
let n = r.value + " ";
|
|
1784
|
-
n +=
|
|
1850
|
+
n += R(e).value + " ";
|
|
1785
1851
|
let i = 0, a = 0;
|
|
1786
|
-
for (; !
|
|
1787
|
-
let t =
|
|
1852
|
+
for (; !B(e);) {
|
|
1853
|
+
let t = L(e);
|
|
1788
1854
|
if (i === 0 && a === 0 && (t.type === "pipe" || t.type === "variable_end" || t.type === "tag_end")) break;
|
|
1789
1855
|
if (t.type === "lbrace" || t.type === "lparen") t.type === "lbrace" ? i++ : a++;
|
|
1790
1856
|
else if ((t.type === "rbrace" || t.type === "rparen") && (t.type === "rbrace" ? i-- : a--, i < 0 || a < 0)) break;
|
|
1791
|
-
n += t.type === "string" ? `"${t.value}"` : t.value,
|
|
1857
|
+
n += t.type === "string" ? `"${t.value}"` : t.value, R(e);
|
|
1792
1858
|
}
|
|
1793
1859
|
return {
|
|
1794
1860
|
type: "literal",
|
|
@@ -1800,14 +1866,14 @@ function Je(e) {
|
|
|
1800
1866
|
}
|
|
1801
1867
|
e.pos = n;
|
|
1802
1868
|
}
|
|
1803
|
-
let n =
|
|
1869
|
+
let n = dt(e);
|
|
1804
1870
|
if (!n) return null;
|
|
1805
1871
|
if (n.type === "literal" && t.type === "string") {
|
|
1806
1872
|
let t = (e) => `"${e}"`, r = t(n.value), i = !1;
|
|
1807
|
-
for (;
|
|
1873
|
+
for (; z(e, "colon");) {
|
|
1808
1874
|
let n = e.pos;
|
|
1809
|
-
if (
|
|
1810
|
-
let n =
|
|
1875
|
+
if (R(e), z(e, "string")) {
|
|
1876
|
+
let n = dt(e);
|
|
1811
1877
|
n && n.type === "literal" && (r += ":" + t(n.value), i = !0);
|
|
1812
1878
|
} else {
|
|
1813
1879
|
e.pos = n;
|
|
@@ -1823,10 +1889,10 @@ function Je(e) {
|
|
|
1823
1889
|
column: n.column
|
|
1824
1890
|
};
|
|
1825
1891
|
}
|
|
1826
|
-
if (n.type === "identifier" &&
|
|
1892
|
+
if (n.type === "identifier" && z(e, "plus")) {
|
|
1827
1893
|
let t = e.pos;
|
|
1828
|
-
if (
|
|
1829
|
-
let t =
|
|
1894
|
+
if (R(e), z(e, "number")) {
|
|
1895
|
+
let t = R(e), r = `${n.name}+${t.value}`;
|
|
1830
1896
|
return {
|
|
1831
1897
|
type: "literal",
|
|
1832
1898
|
value: r,
|
|
@@ -1837,10 +1903,10 @@ function Je(e) {
|
|
|
1837
1903
|
}
|
|
1838
1904
|
e.pos = t;
|
|
1839
1905
|
}
|
|
1840
|
-
if (n.type === "literal" && t.type === "number" &&
|
|
1841
|
-
let t =
|
|
1906
|
+
if (n.type === "literal" && t.type === "number" && z(e, "identifier")) {
|
|
1907
|
+
let t = L(e);
|
|
1842
1908
|
if (t.value.length === 1 && /^[a-z]$/i.test(t.value)) {
|
|
1843
|
-
|
|
1909
|
+
R(e);
|
|
1844
1910
|
let r = String(n.value) + t.value;
|
|
1845
1911
|
return {
|
|
1846
1912
|
type: "literal",
|
|
@@ -1851,14 +1917,14 @@ function Je(e) {
|
|
|
1851
1917
|
};
|
|
1852
1918
|
}
|
|
1853
1919
|
}
|
|
1854
|
-
if (!
|
|
1920
|
+
if (!z(e, "colon")) return n;
|
|
1855
1921
|
let r = "";
|
|
1856
1922
|
if (n.type === "literal") r = String(n.value);
|
|
1857
1923
|
else if (n.type === "identifier") r = n.name;
|
|
1858
1924
|
else return n;
|
|
1859
|
-
for (;
|
|
1860
|
-
|
|
1861
|
-
let t =
|
|
1925
|
+
for (; z(e, "colon") && !B(e);) {
|
|
1926
|
+
R(e), r += ":";
|
|
1927
|
+
let t = dt(e);
|
|
1862
1928
|
if (t) t.type === "literal" ? r += String(t.value) : t.type === "identifier" && (r += t.name);
|
|
1863
1929
|
else break;
|
|
1864
1930
|
}
|
|
@@ -1870,29 +1936,29 @@ function Je(e) {
|
|
|
1870
1936
|
column: t.column
|
|
1871
1937
|
};
|
|
1872
1938
|
}
|
|
1873
|
-
function
|
|
1874
|
-
let t =
|
|
1939
|
+
function rt(e) {
|
|
1940
|
+
let t = it(e);
|
|
1875
1941
|
if (!t) return null;
|
|
1876
|
-
for (;
|
|
1877
|
-
if (
|
|
1942
|
+
for (; z(e, "pipe");) {
|
|
1943
|
+
if (R(e), !z(e, "identifier")) {
|
|
1878
1944
|
e.errors.push({
|
|
1879
1945
|
message: "Missing filter name after |",
|
|
1880
|
-
line:
|
|
1881
|
-
column:
|
|
1946
|
+
line: L(e).line,
|
|
1947
|
+
column: L(e).column
|
|
1882
1948
|
});
|
|
1883
1949
|
break;
|
|
1884
1950
|
}
|
|
1885
|
-
let n =
|
|
1886
|
-
if (
|
|
1887
|
-
if (
|
|
1888
|
-
for (
|
|
1889
|
-
let t =
|
|
1951
|
+
let n = R(e), r = [];
|
|
1952
|
+
if (z(e, "colon")) {
|
|
1953
|
+
if (R(e), z(e, "lparen")) {
|
|
1954
|
+
for (R(e); !z(e, "rparen") && !B(e);) {
|
|
1955
|
+
let t = it(e);
|
|
1890
1956
|
if (!t) break;
|
|
1891
|
-
if (t.type === "literal" && typeof t.value == "string" &&
|
|
1957
|
+
if (t.type === "literal" && typeof t.value == "string" && z(e, "colon")) {
|
|
1892
1958
|
let n = (e) => `"${e}"`, i = n(t.value);
|
|
1893
|
-
for (;
|
|
1894
|
-
|
|
1895
|
-
let t =
|
|
1959
|
+
for (; z(e, "colon");) {
|
|
1960
|
+
R(e);
|
|
1961
|
+
let t = it(e);
|
|
1896
1962
|
if (t && t.type === "literal" && typeof t.value == "string") i += ":" + n(t.value);
|
|
1897
1963
|
else break;
|
|
1898
1964
|
}
|
|
@@ -1904,15 +1970,15 @@ function Ye(e) {
|
|
|
1904
1970
|
column: t.column
|
|
1905
1971
|
});
|
|
1906
1972
|
} else r.push(t);
|
|
1907
|
-
if (
|
|
1973
|
+
if (z(e, "comma")) R(e);
|
|
1908
1974
|
else break;
|
|
1909
1975
|
}
|
|
1910
|
-
|
|
1976
|
+
z(e, "rparen") && R(e);
|
|
1911
1977
|
} else {
|
|
1912
|
-
let t =
|
|
1913
|
-
for (t && r.push(t);
|
|
1914
|
-
|
|
1915
|
-
let t =
|
|
1978
|
+
let t = nt(e);
|
|
1979
|
+
for (t && r.push(t); z(e, "comma");) {
|
|
1980
|
+
R(e);
|
|
1981
|
+
let t = nt(e);
|
|
1916
1982
|
t && r.push(t);
|
|
1917
1983
|
}
|
|
1918
1984
|
}
|
|
@@ -1928,14 +1994,14 @@ function Ye(e) {
|
|
|
1928
1994
|
}
|
|
1929
1995
|
return t;
|
|
1930
1996
|
}
|
|
1931
|
-
function
|
|
1932
|
-
return
|
|
1997
|
+
function it(e) {
|
|
1998
|
+
return Ue(e, () => at(e));
|
|
1933
1999
|
}
|
|
1934
|
-
function
|
|
1935
|
-
let t =
|
|
2000
|
+
function at(e) {
|
|
2001
|
+
let t = ot(e);
|
|
1936
2002
|
if (!t) return null;
|
|
1937
|
-
for (;
|
|
1938
|
-
let n =
|
|
2003
|
+
for (; z(e, "op_or");) {
|
|
2004
|
+
let n = R(e), r = ot(e);
|
|
1939
2005
|
if (!r) {
|
|
1940
2006
|
e.errors.push({
|
|
1941
2007
|
message: "Missing value after \"or\"",
|
|
@@ -1955,11 +2021,11 @@ function Xe(e) {
|
|
|
1955
2021
|
}
|
|
1956
2022
|
return t;
|
|
1957
2023
|
}
|
|
1958
|
-
function
|
|
1959
|
-
let t =
|
|
2024
|
+
function ot(e) {
|
|
2025
|
+
let t = st(e);
|
|
1960
2026
|
if (!t) return null;
|
|
1961
|
-
for (;
|
|
1962
|
-
let n =
|
|
2027
|
+
for (; z(e, "op_and");) {
|
|
2028
|
+
let n = R(e), r = st(e);
|
|
1963
2029
|
if (!r) {
|
|
1964
2030
|
e.errors.push({
|
|
1965
2031
|
message: "Missing value after \"and\"",
|
|
@@ -1979,12 +2045,12 @@ function Ze(e) {
|
|
|
1979
2045
|
}
|
|
1980
2046
|
return t;
|
|
1981
2047
|
}
|
|
1982
|
-
function
|
|
1983
|
-
return
|
|
2048
|
+
function st(e) {
|
|
2049
|
+
return Ue(e, () => ct(e));
|
|
1984
2050
|
}
|
|
1985
|
-
function
|
|
1986
|
-
if (
|
|
1987
|
-
let t =
|
|
2051
|
+
function ct(e) {
|
|
2052
|
+
if (z(e, "op_not")) {
|
|
2053
|
+
let t = R(e), n = st(e);
|
|
1988
2054
|
return n ? {
|
|
1989
2055
|
type: "unary",
|
|
1990
2056
|
operator: "not",
|
|
@@ -1997,10 +2063,10 @@ function $e(e) {
|
|
|
1997
2063
|
column: t.column
|
|
1998
2064
|
}), null);
|
|
1999
2065
|
}
|
|
2000
|
-
return
|
|
2066
|
+
return lt(e);
|
|
2001
2067
|
}
|
|
2002
|
-
function
|
|
2003
|
-
let t =
|
|
2068
|
+
function lt(e) {
|
|
2069
|
+
let t = ut(e);
|
|
2004
2070
|
if (!t) return null;
|
|
2005
2071
|
if ([
|
|
2006
2072
|
"op_eq",
|
|
@@ -2010,8 +2076,8 @@ function et(e) {
|
|
|
2010
2076
|
"op_gte",
|
|
2011
2077
|
"op_lte",
|
|
2012
2078
|
"op_contains"
|
|
2013
|
-
].some((t) =>
|
|
2014
|
-
let n =
|
|
2079
|
+
].some((t) => z(e, t))) {
|
|
2080
|
+
let n = R(e), r = ut(e);
|
|
2015
2081
|
return r ? {
|
|
2016
2082
|
type: "binary",
|
|
2017
2083
|
operator: {
|
|
@@ -2035,12 +2101,12 @@ function et(e) {
|
|
|
2035
2101
|
}
|
|
2036
2102
|
return t;
|
|
2037
2103
|
}
|
|
2038
|
-
function
|
|
2039
|
-
let t =
|
|
2104
|
+
function ut(e) {
|
|
2105
|
+
let t = dt(e);
|
|
2040
2106
|
if (!t) return null;
|
|
2041
|
-
for (;
|
|
2042
|
-
if (
|
|
2043
|
-
let n =
|
|
2107
|
+
for (; z(e, "lbracket") || z(e, "dot");) {
|
|
2108
|
+
if (z(e, "dot")) {
|
|
2109
|
+
let n = R(e), r = L(e), i = r.value.split(".");
|
|
2044
2110
|
if (r.type === "string" || !i.every((e) => /^[A-Za-z_@][A-Za-z0-9_@-]*$/.test(e))) {
|
|
2045
2111
|
e.errors.push({
|
|
2046
2112
|
message: "Expected a property name after .",
|
|
@@ -2049,7 +2115,7 @@ function tt(e) {
|
|
|
2049
2115
|
});
|
|
2050
2116
|
break;
|
|
2051
2117
|
}
|
|
2052
|
-
|
|
2118
|
+
R(e);
|
|
2053
2119
|
let a = r.column;
|
|
2054
2120
|
for (let e of i) t = {
|
|
2055
2121
|
type: "member",
|
|
@@ -2067,7 +2133,7 @@ function tt(e) {
|
|
|
2067
2133
|
}, a += e.length + 1;
|
|
2068
2134
|
continue;
|
|
2069
2135
|
}
|
|
2070
|
-
let n =
|
|
2136
|
+
let n = R(e), r = it(e);
|
|
2071
2137
|
if (!r) {
|
|
2072
2138
|
e.errors.push({
|
|
2073
2139
|
message: "Empty brackets [] - add an index or key",
|
|
@@ -2076,10 +2142,10 @@ function tt(e) {
|
|
|
2076
2142
|
});
|
|
2077
2143
|
break;
|
|
2078
2144
|
}
|
|
2079
|
-
|
|
2145
|
+
z(e, "rbracket") ? R(e) : e.errors.push({
|
|
2080
2146
|
message: "Missing closing ]",
|
|
2081
|
-
line:
|
|
2082
|
-
column:
|
|
2147
|
+
line: L(e).line,
|
|
2148
|
+
column: L(e).column
|
|
2083
2149
|
}), t = {
|
|
2084
2150
|
type: "member",
|
|
2085
2151
|
object: t,
|
|
@@ -2091,15 +2157,15 @@ function tt(e) {
|
|
|
2091
2157
|
}
|
|
2092
2158
|
return t;
|
|
2093
2159
|
}
|
|
2094
|
-
function
|
|
2095
|
-
let t =
|
|
2096
|
-
if (
|
|
2097
|
-
|
|
2098
|
-
let n =
|
|
2099
|
-
return n ? (
|
|
2160
|
+
function dt(e) {
|
|
2161
|
+
let t = L(e);
|
|
2162
|
+
if (z(e, "lparen")) {
|
|
2163
|
+
R(e);
|
|
2164
|
+
let n = it(e);
|
|
2165
|
+
return n ? (z(e, "rparen") ? R(e) : e.errors.push({
|
|
2100
2166
|
message: "Missing closing )",
|
|
2101
|
-
line:
|
|
2102
|
-
column:
|
|
2167
|
+
line: L(e).line,
|
|
2168
|
+
column: L(e).column
|
|
2103
2169
|
}), {
|
|
2104
2170
|
type: "group",
|
|
2105
2171
|
expression: n,
|
|
@@ -2111,8 +2177,8 @@ function nt(e) {
|
|
|
2111
2177
|
column: t.column
|
|
2112
2178
|
}), null);
|
|
2113
2179
|
}
|
|
2114
|
-
if (
|
|
2115
|
-
let t =
|
|
2180
|
+
if (z(e, "string")) {
|
|
2181
|
+
let t = R(e);
|
|
2116
2182
|
return {
|
|
2117
2183
|
type: "literal",
|
|
2118
2184
|
value: t.value,
|
|
@@ -2121,8 +2187,8 @@ function nt(e) {
|
|
|
2121
2187
|
column: t.column
|
|
2122
2188
|
};
|
|
2123
2189
|
}
|
|
2124
|
-
if (
|
|
2125
|
-
let t =
|
|
2190
|
+
if (z(e, "number")) {
|
|
2191
|
+
let t = R(e);
|
|
2126
2192
|
return {
|
|
2127
2193
|
type: "literal",
|
|
2128
2194
|
value: parseFloat(t.value),
|
|
@@ -2131,8 +2197,8 @@ function nt(e) {
|
|
|
2131
2197
|
column: t.column
|
|
2132
2198
|
};
|
|
2133
2199
|
}
|
|
2134
|
-
if (
|
|
2135
|
-
let t =
|
|
2200
|
+
if (z(e, "boolean")) {
|
|
2201
|
+
let t = R(e);
|
|
2136
2202
|
return {
|
|
2137
2203
|
type: "literal",
|
|
2138
2204
|
value: t.value.toLowerCase() === "true",
|
|
@@ -2141,8 +2207,8 @@ function nt(e) {
|
|
|
2141
2207
|
column: t.column
|
|
2142
2208
|
};
|
|
2143
2209
|
}
|
|
2144
|
-
if (
|
|
2145
|
-
let t =
|
|
2210
|
+
if (z(e, "null")) {
|
|
2211
|
+
let t = R(e);
|
|
2146
2212
|
return {
|
|
2147
2213
|
type: "literal",
|
|
2148
2214
|
value: null,
|
|
@@ -2151,12 +2217,12 @@ function nt(e) {
|
|
|
2151
2217
|
column: t.column
|
|
2152
2218
|
};
|
|
2153
2219
|
}
|
|
2154
|
-
if (
|
|
2155
|
-
let t =
|
|
2156
|
-
if (
|
|
2157
|
-
|
|
2220
|
+
if (z(e, "identifier")) {
|
|
2221
|
+
let t = R(e), n = t.value;
|
|
2222
|
+
if (z(e, "colon")) {
|
|
2223
|
+
R(e);
|
|
2158
2224
|
let t = "";
|
|
2159
|
-
for (;
|
|
2225
|
+
for (; z(e, "identifier") || z(e, "dot") || z(e, "colon") || z(e, "lbracket") || z(e, "rbracket") || z(e, "number") || z(e, "string") || z(e, "star");) t += R(e).value;
|
|
2160
2226
|
n = n + ":" + t;
|
|
2161
2227
|
}
|
|
2162
2228
|
return {
|
|
@@ -2169,7 +2235,7 @@ function nt(e) {
|
|
|
2169
2235
|
}
|
|
2170
2236
|
return null;
|
|
2171
2237
|
}
|
|
2172
|
-
function
|
|
2238
|
+
function L(e) {
|
|
2173
2239
|
return e.tokens[e.pos] || {
|
|
2174
2240
|
type: "eof",
|
|
2175
2241
|
value: "",
|
|
@@ -2177,75 +2243,75 @@ function I(e) {
|
|
|
2177
2243
|
column: 0
|
|
2178
2244
|
};
|
|
2179
2245
|
}
|
|
2180
|
-
function
|
|
2181
|
-
let t =
|
|
2182
|
-
return
|
|
2246
|
+
function R(e) {
|
|
2247
|
+
let t = L(e);
|
|
2248
|
+
return B(e) || e.pos++, t;
|
|
2183
2249
|
}
|
|
2184
|
-
function
|
|
2185
|
-
return
|
|
2250
|
+
function z(e, t) {
|
|
2251
|
+
return L(e).type === t;
|
|
2186
2252
|
}
|
|
2187
|
-
function
|
|
2188
|
-
return
|
|
2253
|
+
function B(e) {
|
|
2254
|
+
return L(e).type === "eof";
|
|
2189
2255
|
}
|
|
2190
|
-
function
|
|
2191
|
-
if (!
|
|
2256
|
+
function ft(e, ...t) {
|
|
2257
|
+
if (!z(e, "tag_start")) return !1;
|
|
2192
2258
|
let n = e.pos + 1;
|
|
2193
2259
|
return n >= e.tokens.length ? !1 : t.includes(e.tokens[n].type);
|
|
2194
2260
|
}
|
|
2195
|
-
function
|
|
2196
|
-
return
|
|
2261
|
+
function pt(e) {
|
|
2262
|
+
return z(e, "tag_start") ? R(e) : null;
|
|
2197
2263
|
}
|
|
2198
|
-
function
|
|
2199
|
-
return
|
|
2264
|
+
function mt(e) {
|
|
2265
|
+
return z(e, "tag_end") ? R(e) : (e.errors.push({
|
|
2200
2266
|
message: "Missing closing %}",
|
|
2201
|
-
line:
|
|
2202
|
-
column:
|
|
2267
|
+
line: L(e).line,
|
|
2268
|
+
column: L(e).column
|
|
2203
2269
|
}), null);
|
|
2204
2270
|
}
|
|
2205
|
-
function
|
|
2206
|
-
for (; !
|
|
2207
|
-
|
|
2271
|
+
function V(e) {
|
|
2272
|
+
for (; !B(e) && !z(e, "tag_end");) R(e);
|
|
2273
|
+
z(e, "tag_end") && R(e);
|
|
2208
2274
|
}
|
|
2209
|
-
function
|
|
2210
|
-
for (; !
|
|
2211
|
-
|
|
2275
|
+
function ht(e) {
|
|
2276
|
+
for (; !B(e) && !z(e, "variable_end");) R(e);
|
|
2277
|
+
z(e, "variable_end") && R(e);
|
|
2212
2278
|
}
|
|
2213
|
-
function
|
|
2279
|
+
function gt(e, t) {
|
|
2214
2280
|
let n = [];
|
|
2215
2281
|
for (let e = 0; e <= t.length; e++) n[e] = [e];
|
|
2216
2282
|
for (let t = 0; t <= e.length; t++) n[0][t] = t;
|
|
2217
2283
|
for (let r = 1; r <= t.length; r++) for (let i = 1; i <= e.length; i++) t.charAt(r - 1) === e.charAt(i - 1) ? n[r][i] = n[r - 1][i - 1] : n[r][i] = Math.min(n[r - 1][i - 1] + 1, n[r][i - 1] + 1, n[r - 1][i] + 1);
|
|
2218
2284
|
return n[t.length][e.length];
|
|
2219
2285
|
}
|
|
2220
|
-
function
|
|
2286
|
+
function H(e) {
|
|
2221
2287
|
switch (e.type) {
|
|
2222
2288
|
case "literal": return typeof e.value == "string" ? /^["'].*["']$/.test(e.value) || e.value.includes("\":\"") || e.value.includes("':'") || /\s*\w+\s*=>/.test(e.value) || /^[\w.:+\-*/]+$/.test(e.value) ? e.value : `"${e.value}"` : String(e.value);
|
|
2223
2289
|
case "identifier": return e.name;
|
|
2224
2290
|
case "filter":
|
|
2225
|
-
let t =
|
|
2291
|
+
let t = H(e.value), n = e.args.map(H).join(":");
|
|
2226
2292
|
return n ? `${t}|${e.name}:${n}` : `${t}|${e.name}`;
|
|
2227
|
-
case "binary": return `${
|
|
2228
|
-
case "unary": return `${e.operator} ${
|
|
2229
|
-
case "group": return `(${
|
|
2230
|
-
case "member": return `${
|
|
2293
|
+
case "binary": return `${H(e.left)} ${e.operator} ${H(e.right)}`;
|
|
2294
|
+
case "unary": return `${e.operator} ${H(e.argument)}`;
|
|
2295
|
+
case "group": return `(${H(e.expression)})`;
|
|
2296
|
+
case "member": return `${H(e.object)}.${H(e.property)}`;
|
|
2231
2297
|
default: return "";
|
|
2232
2298
|
}
|
|
2233
2299
|
}
|
|
2234
|
-
function
|
|
2235
|
-
if (e.length !== 0) return e.map(
|
|
2300
|
+
function _t(e) {
|
|
2301
|
+
if (e.length !== 0) return e.map(H).join(",");
|
|
2236
2302
|
}
|
|
2237
|
-
function
|
|
2238
|
-
return e.type === "literal" || e.type === "group" &&
|
|
2303
|
+
function vt(e) {
|
|
2304
|
+
return e.type === "literal" || e.type === "group" && vt(e.expression);
|
|
2239
2305
|
}
|
|
2240
|
-
function
|
|
2306
|
+
function yt(e, t) {
|
|
2241
2307
|
let n = null, r = Infinity;
|
|
2242
2308
|
for (let i of t) {
|
|
2243
|
-
let t =
|
|
2309
|
+
let t = gt(e.toLowerCase(), i.toLowerCase());
|
|
2244
2310
|
t < Math.max(e.length, i.length) / 2 && t < r && (r = t, n = i);
|
|
2245
2311
|
}
|
|
2246
2312
|
return n;
|
|
2247
2313
|
}
|
|
2248
|
-
function
|
|
2314
|
+
function U(e, t) {
|
|
2249
2315
|
switch (e.type) {
|
|
2250
2316
|
case "filter":
|
|
2251
2317
|
t.push({
|
|
@@ -2254,46 +2320,46 @@ function H(e, t) {
|
|
|
2254
2320
|
args: e.args,
|
|
2255
2321
|
line: e.line,
|
|
2256
2322
|
column: e.column
|
|
2257
|
-
}),
|
|
2258
|
-
for (let n of e.args)
|
|
2323
|
+
}), U(e.value, t);
|
|
2324
|
+
for (let n of e.args) U(n, t);
|
|
2259
2325
|
break;
|
|
2260
2326
|
case "binary":
|
|
2261
|
-
|
|
2327
|
+
U(e.left, t), U(e.right, t);
|
|
2262
2328
|
break;
|
|
2263
2329
|
case "unary":
|
|
2264
|
-
|
|
2330
|
+
U(e.argument, t);
|
|
2265
2331
|
break;
|
|
2266
2332
|
case "member":
|
|
2267
|
-
|
|
2333
|
+
U(e.object, t), U(e.property, t);
|
|
2268
2334
|
break;
|
|
2269
|
-
case "group":
|
|
2335
|
+
case "group": U(e.expression, t);
|
|
2270
2336
|
}
|
|
2271
2337
|
}
|
|
2272
|
-
function
|
|
2338
|
+
function bt(e) {
|
|
2273
2339
|
let t = [];
|
|
2274
2340
|
function n(e) {
|
|
2275
2341
|
switch (e.type) {
|
|
2276
2342
|
case "variable":
|
|
2277
|
-
|
|
2343
|
+
U(e.expression, t);
|
|
2278
2344
|
break;
|
|
2279
2345
|
case "set":
|
|
2280
|
-
|
|
2346
|
+
U(e.value, t);
|
|
2281
2347
|
break;
|
|
2282
2348
|
case "if":
|
|
2283
|
-
|
|
2284
|
-
|
|
2349
|
+
U(e.condition, t), e.consequent.forEach(n), e.elseifs.forEach((e) => {
|
|
2350
|
+
U(e.condition, t), e.body.forEach(n);
|
|
2285
2351
|
}), e.alternate?.forEach(n);
|
|
2286
2352
|
break;
|
|
2287
|
-
case "for":
|
|
2353
|
+
case "for": U(e.iterable, t), e.body.forEach(n);
|
|
2288
2354
|
}
|
|
2289
2355
|
}
|
|
2290
2356
|
return e.forEach(n), t;
|
|
2291
2357
|
}
|
|
2292
|
-
function
|
|
2293
|
-
let n = [], r =
|
|
2358
|
+
function xt(e, t) {
|
|
2359
|
+
let n = [], r = bt(e), i = new Set(Object.keys(t));
|
|
2294
2360
|
for (let e of r) {
|
|
2295
2361
|
if (!i.has(e.name)) {
|
|
2296
|
-
let t =
|
|
2362
|
+
let t = yt(e.name, i), r = `Unknown filter "${e.name}"`;
|
|
2297
2363
|
t && (r += `. Did you mean "${t}"?`), n.push({
|
|
2298
2364
|
message: r,
|
|
2299
2365
|
line: e.line,
|
|
@@ -2303,8 +2369,8 @@ function ft(e, t) {
|
|
|
2303
2369
|
continue;
|
|
2304
2370
|
}
|
|
2305
2371
|
let r = t[e.name];
|
|
2306
|
-
if (r?.validateParams && e.args.every(
|
|
2307
|
-
let t = e.hasArgs ?
|
|
2372
|
+
if (r?.validateParams && e.args.every(vt)) {
|
|
2373
|
+
let t = e.hasArgs ? _t(e.args) : void 0, i = r.validateParams(t);
|
|
2308
2374
|
!i.valid && i.error && n.push({
|
|
2309
2375
|
message: `Filter "${e.name}" ${i.error}`,
|
|
2310
2376
|
line: e.line,
|
|
@@ -2315,7 +2381,7 @@ function ft(e, t) {
|
|
|
2315
2381
|
}
|
|
2316
2382
|
return n;
|
|
2317
2383
|
}
|
|
2318
|
-
function
|
|
2384
|
+
function W(e, t) {
|
|
2319
2385
|
if (e == null || typeof e == "function" || typeof t != "string" && typeof t != "number") return {
|
|
2320
2386
|
exists: !1,
|
|
2321
2387
|
value: void 0
|
|
@@ -2329,14 +2395,14 @@ function U(e, t) {
|
|
|
2329
2395
|
value: void 0
|
|
2330
2396
|
};
|
|
2331
2397
|
}
|
|
2332
|
-
function
|
|
2398
|
+
function St(e, t) {
|
|
2333
2399
|
if (!t || t.split(".").some((e) => e === "")) return {
|
|
2334
2400
|
exists: !1,
|
|
2335
2401
|
value: void 0
|
|
2336
2402
|
};
|
|
2337
2403
|
let n = e;
|
|
2338
2404
|
for (let e of t.split(".")) {
|
|
2339
|
-
let t =
|
|
2405
|
+
let t = W(n, e);
|
|
2340
2406
|
if (!t.exists) return t;
|
|
2341
2407
|
n = t.value;
|
|
2342
2408
|
}
|
|
@@ -2345,7 +2411,7 @@ function pt(e, t) {
|
|
|
2345
2411
|
value: n
|
|
2346
2412
|
};
|
|
2347
2413
|
}
|
|
2348
|
-
async function
|
|
2414
|
+
async function Ct(e, t, n = {}, r = new ye(n.limits)) {
|
|
2349
2415
|
let i = [], a = {
|
|
2350
2416
|
context: t,
|
|
2351
2417
|
errors: i,
|
|
@@ -2355,11 +2421,11 @@ async function mt(e, t, n = {}, r = new pe(n.limits)) {
|
|
|
2355
2421
|
try {
|
|
2356
2422
|
r.value(t.variables);
|
|
2357
2423
|
for (let t = 0; t < e.length; t++) {
|
|
2358
|
-
let n = e[t], r = await
|
|
2359
|
-
o =
|
|
2424
|
+
let n = e[t], r = await wt(n, a);
|
|
2425
|
+
o = jt(o, r, n, a);
|
|
2360
2426
|
}
|
|
2361
2427
|
} catch (e) {
|
|
2362
|
-
if (!(e instanceof
|
|
2428
|
+
if (!(e instanceof M) || e.code !== "LIMIT_EXCEEDED") throw e;
|
|
2363
2429
|
return {
|
|
2364
2430
|
output: "",
|
|
2365
2431
|
errors: [...i, {
|
|
@@ -2375,13 +2441,13 @@ async function mt(e, t, n = {}, r = new pe(n.limits)) {
|
|
|
2375
2441
|
errors: i
|
|
2376
2442
|
};
|
|
2377
2443
|
}
|
|
2378
|
-
async function
|
|
2444
|
+
async function wt(e, t) {
|
|
2379
2445
|
switch (t.budget.step(), e.type) {
|
|
2380
|
-
case "text": return
|
|
2381
|
-
case "variable": return
|
|
2382
|
-
case "if": return
|
|
2383
|
-
case "for": return
|
|
2384
|
-
case "set": return
|
|
2446
|
+
case "text": return Tt(e, t);
|
|
2447
|
+
case "variable": return Et(e, t);
|
|
2448
|
+
case "if": return Dt(e, t);
|
|
2449
|
+
case "for": return Ot(e, t);
|
|
2450
|
+
case "set": return kt(e, t);
|
|
2385
2451
|
default: return t.errors.push({
|
|
2386
2452
|
message: `Unknown node type: ${e.type}`,
|
|
2387
2453
|
line: e.line ?? 0,
|
|
@@ -2390,40 +2456,40 @@ async function ht(e, t) {
|
|
|
2390
2456
|
}), "";
|
|
2391
2457
|
}
|
|
2392
2458
|
}
|
|
2393
|
-
function
|
|
2459
|
+
function Tt(e, t) {
|
|
2394
2460
|
let n = e.value;
|
|
2395
|
-
return t.pendingTrimRight &&= (n =
|
|
2461
|
+
return t.pendingTrimRight &&= (n = Ht(n), !1), n;
|
|
2396
2462
|
}
|
|
2397
|
-
async function
|
|
2463
|
+
async function Et(e, t) {
|
|
2398
2464
|
try {
|
|
2399
|
-
let n =
|
|
2465
|
+
let n = Wt(await G(e.expression, t), t);
|
|
2400
2466
|
return e.trimRight && (t.pendingTrimRight = !0), n;
|
|
2401
2467
|
} catch (n) {
|
|
2402
|
-
return t.errors.push(
|
|
2468
|
+
return t.errors.push(Gt(n, "Error evaluating variable", e.line, e.column)), "";
|
|
2403
2469
|
}
|
|
2404
2470
|
}
|
|
2405
|
-
async function
|
|
2471
|
+
async function Dt(e, t) {
|
|
2406
2472
|
try {
|
|
2407
|
-
if (
|
|
2408
|
-
let n = await
|
|
2473
|
+
if (K(await G(e.condition, t))) {
|
|
2474
|
+
let n = await At(e.consequent, t);
|
|
2409
2475
|
return e.trimRight && (t.pendingTrimRight = !0), n;
|
|
2410
2476
|
}
|
|
2411
|
-
for (let n of e.elseifs) if (
|
|
2412
|
-
let r = await
|
|
2477
|
+
for (let n of e.elseifs) if (K(await G(n.condition, t))) {
|
|
2478
|
+
let r = await At(n.body, t);
|
|
2413
2479
|
return e.trimRight && (t.pendingTrimRight = !0), r;
|
|
2414
2480
|
}
|
|
2415
2481
|
if (e.alternate) {
|
|
2416
|
-
let n = await
|
|
2482
|
+
let n = await At(e.alternate, t);
|
|
2417
2483
|
return e.trimRight && (t.pendingTrimRight = !0), n;
|
|
2418
2484
|
}
|
|
2419
2485
|
return e.trimRight && (t.pendingTrimRight = !0), "";
|
|
2420
2486
|
} catch (n) {
|
|
2421
|
-
return t.errors.push(
|
|
2487
|
+
return t.errors.push(Gt(n, "Error evaluating if condition", e.line, e.column)), "";
|
|
2422
2488
|
}
|
|
2423
2489
|
}
|
|
2424
|
-
async function
|
|
2490
|
+
async function Ot(e, t) {
|
|
2425
2491
|
try {
|
|
2426
|
-
let n = await
|
|
2492
|
+
let n = await G(e.iterable, t);
|
|
2427
2493
|
if (n == null) return e.trimRight && (t.pendingTrimRight = !0), "";
|
|
2428
2494
|
let r = n;
|
|
2429
2495
|
if (!Array.isArray(r) && typeof r == "string") try {
|
|
@@ -2453,20 +2519,20 @@ async function yt(e, t) {
|
|
|
2453
2519
|
[`${e.iterator}_index`]: n,
|
|
2454
2520
|
loop: c
|
|
2455
2521
|
}
|
|
2456
|
-
}, u =
|
|
2522
|
+
}, u = Ht(await At(e.body, {
|
|
2457
2523
|
...t,
|
|
2458
2524
|
context: l
|
|
2459
2525
|
}));
|
|
2460
2526
|
u !== "" && (o += u.length + (i.length && !i.at(-1).endsWith("\n") ? 1 : 0), t.budget.output(o), i.push(u));
|
|
2461
2527
|
}
|
|
2462
|
-
return e.trimRight && (t.pendingTrimRight = !0), i.map((e, t) => t === i.length - 1 ?
|
|
2528
|
+
return e.trimRight && (t.pendingTrimRight = !0), i.map((e, t) => t === i.length - 1 ? Vt(e) : e.endsWith("\n") ? e : e + "\n").join("");
|
|
2463
2529
|
} catch (n) {
|
|
2464
|
-
return t.errors.push(
|
|
2530
|
+
return t.errors.push(Gt(n, "Error in for loop", e.line, e.column)), "";
|
|
2465
2531
|
}
|
|
2466
2532
|
}
|
|
2467
|
-
async function
|
|
2533
|
+
async function kt(e, t) {
|
|
2468
2534
|
try {
|
|
2469
|
-
let n = await
|
|
2535
|
+
let n = await G(e.value, t);
|
|
2470
2536
|
return t.budget.value(n), Object.defineProperty(t.context.variables, e.variable, {
|
|
2471
2537
|
value: n,
|
|
2472
2538
|
writable: !0,
|
|
@@ -2474,50 +2540,50 @@ async function bt(e, t) {
|
|
|
2474
2540
|
configurable: !0
|
|
2475
2541
|
}), e.trimRight && (t.pendingTrimRight = !0), "";
|
|
2476
2542
|
} catch (n) {
|
|
2477
|
-
return t.errors.push(
|
|
2543
|
+
return t.errors.push(Gt(n, "Error in set", e.line, e.column)), "";
|
|
2478
2544
|
}
|
|
2479
2545
|
}
|
|
2480
|
-
async function
|
|
2546
|
+
async function At(e, t) {
|
|
2481
2547
|
let n = "";
|
|
2482
2548
|
for (let r of e) {
|
|
2483
|
-
let e = await
|
|
2484
|
-
n =
|
|
2549
|
+
let e = await wt(r, t);
|
|
2550
|
+
n = jt(n, e, r, t);
|
|
2485
2551
|
}
|
|
2486
2552
|
return n;
|
|
2487
2553
|
}
|
|
2488
|
-
function
|
|
2489
|
-
return r.budget.output(e.length + t.length), "trimLeft" in n && n.trimLeft && e.length > 0 && (e =
|
|
2554
|
+
function jt(e, t, n, r) {
|
|
2555
|
+
return r.budget.output(e.length + t.length), "trimLeft" in n && n.trimLeft && e.length > 0 && (e = Vt(e)), r.pendingTrimRight && t.length > 0 ? (e += Ht(t), r.pendingTrimRight = !1) : e += t, e;
|
|
2490
2556
|
}
|
|
2491
|
-
async function
|
|
2557
|
+
async function G(e, t) {
|
|
2492
2558
|
switch (t.budget.step(), e.type) {
|
|
2493
|
-
case "literal": return
|
|
2494
|
-
case "identifier": return
|
|
2495
|
-
case "binary": return
|
|
2496
|
-
case "unary": return
|
|
2497
|
-
case "filter": return
|
|
2498
|
-
case "group": return
|
|
2499
|
-
case "member": return
|
|
2559
|
+
case "literal": return Mt(e);
|
|
2560
|
+
case "identifier": return Nt(e, t);
|
|
2561
|
+
case "binary": return Ft(e, t);
|
|
2562
|
+
case "unary": return It(e, t);
|
|
2563
|
+
case "filter": return Lt(e, t);
|
|
2564
|
+
case "group": return G(e.expression, t);
|
|
2565
|
+
case "member": return Pt(e, t);
|
|
2500
2566
|
default: throw Error(`Unknown expression type: ${e.type}`);
|
|
2501
2567
|
}
|
|
2502
2568
|
}
|
|
2503
|
-
function
|
|
2569
|
+
function Mt(e) {
|
|
2504
2570
|
return e.value;
|
|
2505
2571
|
}
|
|
2506
|
-
async function
|
|
2507
|
-
let n = e.name, r =
|
|
2572
|
+
async function Nt(e, t) {
|
|
2573
|
+
let n = e.name, r = zt(n, t.context.variables, e.path);
|
|
2508
2574
|
if (r !== void 0) return r;
|
|
2509
2575
|
if (t.context.asyncResolver) return t.context.asyncResolver(n, t.context);
|
|
2510
2576
|
}
|
|
2511
|
-
async function
|
|
2512
|
-
let n = await
|
|
2513
|
-
if (n != null) return
|
|
2577
|
+
async function Pt(e, t) {
|
|
2578
|
+
let n = await G(e.object, t), r = await G(e.property, t);
|
|
2579
|
+
if (n != null) return W(n, r).value;
|
|
2514
2580
|
}
|
|
2515
|
-
async function
|
|
2581
|
+
async function Ft(e, t) {
|
|
2516
2582
|
if (e.operator === "??") {
|
|
2517
|
-
let n = await
|
|
2518
|
-
return
|
|
2583
|
+
let n = await G(e.left, t);
|
|
2584
|
+
return K(n) ? n : G(e.right, t);
|
|
2519
2585
|
}
|
|
2520
|
-
let n = await
|
|
2586
|
+
let n = await G(e.left, t), r = await G(e.right, t);
|
|
2521
2587
|
switch (e.operator) {
|
|
2522
2588
|
case "==": return n == r;
|
|
2523
2589
|
case "!=": return n != r;
|
|
@@ -2525,35 +2591,35 @@ async function Et(e, t) {
|
|
|
2525
2591
|
case "<": return n < r;
|
|
2526
2592
|
case ">=": return n >= r;
|
|
2527
2593
|
case "<=": return n <= r;
|
|
2528
|
-
case "contains": return
|
|
2529
|
-
case "and": return
|
|
2530
|
-
case "or": return
|
|
2594
|
+
case "contains": return Rt(n, r);
|
|
2595
|
+
case "and": return K(n) && K(r);
|
|
2596
|
+
case "or": return K(n) || K(r);
|
|
2531
2597
|
default: throw Error(`Unknown binary operator: ${e.operator}`);
|
|
2532
2598
|
}
|
|
2533
2599
|
}
|
|
2534
|
-
async function
|
|
2535
|
-
let n = await
|
|
2600
|
+
async function It(e, t) {
|
|
2601
|
+
let n = await G(e.argument, t);
|
|
2536
2602
|
switch (e.operator) {
|
|
2537
|
-
case "not": return !
|
|
2603
|
+
case "not": return !K(n);
|
|
2538
2604
|
default: throw Error(`Unknown unary operator: ${e.operator}`);
|
|
2539
2605
|
}
|
|
2540
2606
|
}
|
|
2541
|
-
async function
|
|
2542
|
-
let n = await
|
|
2607
|
+
async function Lt(e, t) {
|
|
2608
|
+
let n = await G(e.value, t), r = [];
|
|
2543
2609
|
for (let n of e.args) {
|
|
2544
|
-
let e = await
|
|
2610
|
+
let e = await G(n, t);
|
|
2545
2611
|
e === void 0 && n.type === "identifier" && (e = n.name), t.budget.value(e), r.push(e);
|
|
2546
2612
|
}
|
|
2547
2613
|
let i = r.map((t, n) => {
|
|
2548
2614
|
let r = e.args[n];
|
|
2549
2615
|
for (; r.type === "group";) r = r.expression;
|
|
2550
2616
|
return r.type === "literal" ? r.unquotedValue ?? t : t;
|
|
2551
|
-
}), a =
|
|
2552
|
-
r.length > 0 && (o = r.map((e) => typeof e == "string" ?
|
|
2553
|
-
let s = await t.context.applyFilter(a, e.name, o, e.line, e.column, n, i, e.args.some((e) => !
|
|
2617
|
+
}), a = Wt(n, t), o;
|
|
2618
|
+
r.length > 0 && (o = r.map((e) => typeof e == "string" ? Ut(e) || /\s*\w+\s*=>/.test(e) || /^[\w.:+\-*/]+$/.test(e) ? e : `"${e}"` : String(e)).join(",")), t.budget.value(o);
|
|
2619
|
+
let s = await t.context.applyFilter(a, e.name, o, e.line, e.column, n, i, e.args.some((e) => !vt(e)));
|
|
2554
2620
|
return t.budget.value(s), s;
|
|
2555
2621
|
}
|
|
2556
|
-
function
|
|
2622
|
+
function Rt(e, t) {
|
|
2557
2623
|
if (e == null || t == null) return !1;
|
|
2558
2624
|
if (Array.isArray(e)) return e.some((e) => typeof e == "string" && typeof t == "string" ? e.toLowerCase() === t.toLowerCase() : e == t);
|
|
2559
2625
|
if (typeof e == "string") {
|
|
@@ -2562,13 +2628,13 @@ function kt(e, t) {
|
|
|
2562
2628
|
}
|
|
2563
2629
|
return !1;
|
|
2564
2630
|
}
|
|
2565
|
-
function
|
|
2566
|
-
let r = e.trim(), i =
|
|
2631
|
+
function zt(e, t, n) {
|
|
2632
|
+
let r = e.trim(), i = W(t, `{{${r}}}`).value;
|
|
2567
2633
|
if (i !== void 0) return i;
|
|
2568
|
-
if (
|
|
2569
|
-
if (r.includes(".")) return
|
|
2634
|
+
if (W(t, r).value !== void 0) return W(t, r).value;
|
|
2635
|
+
if (r.includes(".")) return Bt(t, n ?? r.split("."));
|
|
2570
2636
|
}
|
|
2571
|
-
function
|
|
2637
|
+
function Bt(e, t) {
|
|
2572
2638
|
if (t.length === 0 || !e) return;
|
|
2573
2639
|
let n = e;
|
|
2574
2640
|
for (let e of t) {
|
|
@@ -2576,30 +2642,30 @@ function jt(e, t) {
|
|
|
2576
2642
|
if (e.includes("[") && e.includes("]")) {
|
|
2577
2643
|
let t = e.match(/^([^\[]*)\[([^\]]+)\]/);
|
|
2578
2644
|
if (t) {
|
|
2579
|
-
let [, e, r] = t, i = e ?
|
|
2580
|
-
if (Array.isArray(i)) n =
|
|
2581
|
-
else if (i && typeof i == "object") n =
|
|
2645
|
+
let [, e, r] = t, i = e ? W(n, e).value : n;
|
|
2646
|
+
if (Array.isArray(i)) n = W(i, parseInt(r, 10)).value;
|
|
2647
|
+
else if (i && typeof i == "object") n = W(i, r.replace(/^["']|["']$/g, "")).value;
|
|
2582
2648
|
else return;
|
|
2583
2649
|
continue;
|
|
2584
2650
|
}
|
|
2585
2651
|
}
|
|
2586
|
-
n =
|
|
2652
|
+
n = W(n, `{{${e}}}`).value === void 0 ? W(n, e).value : W(n, `{{${e}}}`).value;
|
|
2587
2653
|
}
|
|
2588
2654
|
return n;
|
|
2589
2655
|
}
|
|
2590
|
-
function
|
|
2656
|
+
function Vt(e) {
|
|
2591
2657
|
return e.replace(/[\t ]*\r?\n?$/, "");
|
|
2592
2658
|
}
|
|
2593
|
-
function
|
|
2659
|
+
function Ht(e) {
|
|
2594
2660
|
return e.replace(/^[\t ]*\r?\n?/, "");
|
|
2595
2661
|
}
|
|
2596
|
-
function
|
|
2662
|
+
function Ut(e) {
|
|
2597
2663
|
return /^["'][\s\S]*["']$/.test(e) || e.includes("\":\"") || e.includes("':'");
|
|
2598
2664
|
}
|
|
2599
|
-
function
|
|
2665
|
+
function K(e) {
|
|
2600
2666
|
return !(e == null || e === "" || e === 0 || e === !1 || Array.isArray(e) && e.length === 0);
|
|
2601
2667
|
}
|
|
2602
|
-
function
|
|
2668
|
+
function Wt(e, t) {
|
|
2603
2669
|
if (t.budget.value(e), e == null) return "";
|
|
2604
2670
|
if (Array.isArray(e) && e.length === 1 && typeof e[0] != "object") return String(e[0]);
|
|
2605
2671
|
if (typeof e == "object") {
|
|
@@ -2608,8 +2674,8 @@ function Ft(e, t) {
|
|
|
2608
2674
|
}
|
|
2609
2675
|
return String(e);
|
|
2610
2676
|
}
|
|
2611
|
-
function
|
|
2612
|
-
if (e instanceof
|
|
2677
|
+
function Gt(e, t, n, r) {
|
|
2678
|
+
if (e instanceof M) {
|
|
2613
2679
|
if (e.code === "LIMIT_EXCEEDED") throw e;
|
|
2614
2680
|
return {
|
|
2615
2681
|
message: e.message,
|
|
@@ -2625,7 +2691,7 @@ function It(e, t, n, r) {
|
|
|
2625
2691
|
code: "RENDER_ERROR"
|
|
2626
2692
|
};
|
|
2627
2693
|
}
|
|
2628
|
-
function
|
|
2694
|
+
function Kt(e) {
|
|
2629
2695
|
return {
|
|
2630
2696
|
message: e.message,
|
|
2631
2697
|
line: e.line,
|
|
@@ -2633,22 +2699,22 @@ function Lt(e) {
|
|
|
2633
2699
|
code: e.code ?? "PARSE_ERROR"
|
|
2634
2700
|
};
|
|
2635
2701
|
}
|
|
2636
|
-
function
|
|
2702
|
+
function qt(e) {
|
|
2637
2703
|
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t.metadata ?? {}]));
|
|
2638
2704
|
}
|
|
2639
|
-
function
|
|
2640
|
-
let t = Object.freeze({ ...e.filters ?? {} }), n =
|
|
2705
|
+
function Jt(e = {}) {
|
|
2706
|
+
let t = Object.freeze({ ...e.filters ?? {} }), n = qt(t), r = (t) => Be(t, e.limits);
|
|
2641
2707
|
function i(t) {
|
|
2642
2708
|
let i, a = [];
|
|
2643
2709
|
if (typeof t == "string") {
|
|
2644
2710
|
let e = r(t);
|
|
2645
|
-
i = e.ast, a.push(...e.errors.map(
|
|
2711
|
+
i = e.ast, a.push(...e.errors.map(Kt));
|
|
2646
2712
|
} else {
|
|
2647
2713
|
i = t;
|
|
2648
2714
|
try {
|
|
2649
|
-
new
|
|
2715
|
+
new ye(e.limits).value(i);
|
|
2650
2716
|
} catch (e) {
|
|
2651
|
-
if (!(e instanceof
|
|
2717
|
+
if (!(e instanceof M)) throw e;
|
|
2652
2718
|
return [{
|
|
2653
2719
|
message: e.message,
|
|
2654
2720
|
code: e.code,
|
|
@@ -2657,28 +2723,28 @@ function zt(e = {}) {
|
|
|
2657
2723
|
}];
|
|
2658
2724
|
}
|
|
2659
2725
|
}
|
|
2660
|
-
return a.length === 0 && a.push(...
|
|
2726
|
+
return a.length === 0 && a.push(...xt(i, n).map(Kt)), a;
|
|
2661
2727
|
}
|
|
2662
2728
|
async function a(r, i, a = {}) {
|
|
2663
2729
|
let o = {
|
|
2664
2730
|
...e.limits,
|
|
2665
2731
|
...a.limits
|
|
2666
|
-
}, s =
|
|
2732
|
+
}, s = Be(r, o), c = s.errors.map(Kt);
|
|
2667
2733
|
if (c.length > 0) return {
|
|
2668
2734
|
output: "",
|
|
2669
2735
|
errors: c,
|
|
2670
2736
|
warnings: []
|
|
2671
2737
|
};
|
|
2672
|
-
let l = new
|
|
2738
|
+
let l = new ye(o), u = xt(s.ast, n).map(Kt), d = [], f = /* @__PURE__ */ new Set(), p = {
|
|
2673
2739
|
variables: i.variables,
|
|
2674
2740
|
context: i.context
|
|
2675
|
-
}, m = await
|
|
2741
|
+
}, m = await Ct(s.ast, {
|
|
2676
2742
|
variables: i.variables,
|
|
2677
2743
|
asyncResolver: i.resolveVariable ? async (e) => {
|
|
2678
2744
|
try {
|
|
2679
2745
|
return await i.resolveVariable(e, p);
|
|
2680
2746
|
} catch (t) {
|
|
2681
|
-
throw new
|
|
2747
|
+
throw new M(`Could not resolve variable "${e}": ${t instanceof Error ? t.message : String(t)}`, "RESOLVE_ERROR");
|
|
2682
2748
|
}
|
|
2683
2749
|
} : void 0,
|
|
2684
2750
|
applyFilter: async (r, i, a, o, s, c, u, m) => {
|
|
@@ -2687,7 +2753,7 @@ function zt(e = {}) {
|
|
|
2687
2753
|
try {
|
|
2688
2754
|
if (m) {
|
|
2689
2755
|
let e = n[i]?.validateParams?.(a);
|
|
2690
|
-
if (e && !e.valid) throw new
|
|
2756
|
+
if (e && !e.valid) throw new M(`Filter "${i}" ${e.error ?? "has invalid arguments"}`, "INVALID_FILTER_ARGUMENTS");
|
|
2691
2757
|
}
|
|
2692
2758
|
let t = await h(r, a, {
|
|
2693
2759
|
allowRegex: e.allowRegex ?? !0,
|
|
@@ -2715,7 +2781,7 @@ function zt(e = {}) {
|
|
|
2715
2781
|
});
|
|
2716
2782
|
return l.value(t), t;
|
|
2717
2783
|
} catch (e) {
|
|
2718
|
-
throw e instanceof
|
|
2784
|
+
throw e instanceof M ? new M(e.message, e.code, e.line ?? o, e.column ?? s) : new M(`Filter "${i}" failed: ${e instanceof Error ? e.message : String(e)}`, "FILTER_ERROR", o, s);
|
|
2719
2785
|
}
|
|
2720
2786
|
}
|
|
2721
2787
|
}, {
|
|
@@ -2735,12 +2801,12 @@ function zt(e = {}) {
|
|
|
2735
2801
|
render: a,
|
|
2736
2802
|
async renderOrThrow(e, t, n) {
|
|
2737
2803
|
let r = await a(e, t, n);
|
|
2738
|
-
if (r.errors.length > 0) throw new
|
|
2804
|
+
if (r.errors.length > 0) throw new ge(r.errors);
|
|
2739
2805
|
return r.output;
|
|
2740
2806
|
}
|
|
2741
2807
|
};
|
|
2742
2808
|
}
|
|
2743
|
-
var
|
|
2809
|
+
var Yt = (e) => {
|
|
2744
2810
|
let t = (e, t = 1) => {
|
|
2745
2811
|
let n = "> ".repeat(t);
|
|
2746
2812
|
return e.split("\n").map((e) => `${n}${e}`).join("\n");
|
|
@@ -2752,39 +2818,39 @@ var Bt = (e) => {
|
|
|
2752
2818
|
return Array.isArray(e) ? n(e) : t(e);
|
|
2753
2819
|
}
|
|
2754
2820
|
};
|
|
2755
|
-
function
|
|
2821
|
+
function Xt(e) {
|
|
2756
2822
|
if (typeof e == "number") return Number.isFinite(e) ? e : void 0;
|
|
2757
2823
|
if (typeof e != "string" || e.trim() === "") return;
|
|
2758
2824
|
let t = Number(e.trim());
|
|
2759
2825
|
return Number.isFinite(t) ? t : void 0;
|
|
2760
2826
|
}
|
|
2761
|
-
function
|
|
2827
|
+
function q(e) {
|
|
2762
2828
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
2763
2829
|
let t = Object.getPrototypeOf(e);
|
|
2764
2830
|
return t === Object.prototype || t === null;
|
|
2765
2831
|
}
|
|
2766
|
-
function
|
|
2767
|
-
if (t && Object.prototype.hasOwnProperty.call(t, "rawValue") && (Array.isArray(t.rawValue) ||
|
|
2832
|
+
function J(e, t, n = !1) {
|
|
2833
|
+
if (t && Object.prototype.hasOwnProperty.call(t, "rawValue") && (Array.isArray(t.rawValue) || q(t.rawValue))) return t.rawValue;
|
|
2768
2834
|
let r = n ? e.trimStart() : e;
|
|
2769
2835
|
if (r.startsWith("[") || r.startsWith("{")) try {
|
|
2770
2836
|
let t = JSON.parse(e);
|
|
2771
|
-
if (Array.isArray(t) ||
|
|
2837
|
+
if (Array.isArray(t) || q(t)) return t;
|
|
2772
2838
|
} catch {}
|
|
2773
2839
|
return e;
|
|
2774
2840
|
}
|
|
2775
|
-
function
|
|
2841
|
+
function Y(e, t, n = !1) {
|
|
2776
2842
|
if (t && Object.prototype.hasOwnProperty.call(t, "rawValue")) {
|
|
2777
2843
|
let e = t.rawValue;
|
|
2778
|
-
if (Array.isArray(e) ||
|
|
2844
|
+
if (Array.isArray(e) || q(e) || typeof e != "string") return e;
|
|
2779
2845
|
}
|
|
2780
2846
|
let r = n ? e.trimStart() : e;
|
|
2781
2847
|
if (r.startsWith("[") || r.startsWith("{")) try {
|
|
2782
2848
|
let t = JSON.parse(e);
|
|
2783
|
-
if (Array.isArray(t) ||
|
|
2849
|
+
if (Array.isArray(t) || q(t)) return t;
|
|
2784
2850
|
} catch {}
|
|
2785
2851
|
return e;
|
|
2786
2852
|
}
|
|
2787
|
-
function
|
|
2853
|
+
function Zt(e, t) {
|
|
2788
2854
|
if (t && Object.prototype.hasOwnProperty.call(t, "rawValue")) {
|
|
2789
2855
|
let e = t.rawValue;
|
|
2790
2856
|
if (Array.isArray(e) || typeof e != "string") return e;
|
|
@@ -2795,18 +2861,18 @@ function Ht(e, t) {
|
|
|
2795
2861
|
} catch {}
|
|
2796
2862
|
return e;
|
|
2797
2863
|
}
|
|
2798
|
-
function
|
|
2799
|
-
return typeof e == "string" ? t(e) : Array.isArray(e) ? e.map((e) =>
|
|
2864
|
+
function X(e, t) {
|
|
2865
|
+
return typeof e == "string" ? t(e) : Array.isArray(e) ? e.map((e) => X(e, t)) : q(e) ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, X(n, t)])) : e;
|
|
2800
2866
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return (t, n, r) =>
|
|
2867
|
+
function Z(e) {
|
|
2868
|
+
return (t, n, r) => X(J(t, r), e);
|
|
2803
2869
|
}
|
|
2804
|
-
function
|
|
2870
|
+
function Q(e, t, n = t) {
|
|
2805
2871
|
if (!e.trim()) return e;
|
|
2806
2872
|
let r = e.trim(), i = e.indexOf(r);
|
|
2807
2873
|
return `${e.slice(0, i)}${t}${r}${n}${e.slice(i + r.length)}`;
|
|
2808
2874
|
}
|
|
2809
|
-
function
|
|
2875
|
+
function Qt(e) {
|
|
2810
2876
|
let t = e.match(/^(?:[\t ]*\r?\n)+/)?.[0] ?? "", n = e.slice(t.length), r = n.match(/(?:\r?\n[\t ]*)+$/)?.[0] ?? "";
|
|
2811
2877
|
return {
|
|
2812
2878
|
leading: t,
|
|
@@ -2814,29 +2880,29 @@ function Ut(e) {
|
|
|
2814
2880
|
trailing: r
|
|
2815
2881
|
};
|
|
2816
2882
|
}
|
|
2817
|
-
function
|
|
2883
|
+
function $t(e) {
|
|
2818
2884
|
return /[\r\n]/.test(e);
|
|
2819
2885
|
}
|
|
2820
|
-
function
|
|
2886
|
+
function $(e, t) {
|
|
2821
2887
|
if (t === "") return t;
|
|
2822
2888
|
let n = `${"#".repeat(e)} `;
|
|
2823
2889
|
return t.split(/(\r?\n)/).map((e) => /^(?:\r?\n)$/.test(e) || !e.trim() ? e : `${n}${e}`).join("");
|
|
2824
2890
|
}
|
|
2825
|
-
var
|
|
2826
|
-
function
|
|
2827
|
-
let n =
|
|
2891
|
+
var en = Z((e) => $(1, e)), tn = Z((e) => $(2, e)), nn = Z((e) => $(3, e)), rn = Z((e) => $(4, e)), an = Z((e) => $(5, e)), on = Z((e) => $(6, e)), sn = /[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g, cn = Z((e) => e.replace(sn, "\\$&")), ln = Z((e) => e.replace(/^([^\r\n]*\S)[\t ]*(\r?\n)(?=[^\r\n]*\S)/gm, "$1 $2"));
|
|
2892
|
+
function un(e, t) {
|
|
2893
|
+
let n = D(e);
|
|
2828
2894
|
return n === void 0 || t.includes(n) ? { valid: !0 } : {
|
|
2829
2895
|
valid: !1,
|
|
2830
2896
|
error: `invalid marker "${n}". Use ${t.map((e) => `"${e}"`).join(" or ")}`
|
|
2831
2897
|
};
|
|
2832
2898
|
}
|
|
2833
|
-
var
|
|
2834
|
-
let r =
|
|
2835
|
-
return
|
|
2836
|
-
},
|
|
2837
|
-
let r =
|
|
2838
|
-
return
|
|
2839
|
-
},
|
|
2899
|
+
var dn = (e) => un(e, ["*", "_"]), fn = (e) => un(e, ["*", "_"]), pn = (e, t, n) => {
|
|
2900
|
+
let r = D(t) ?? "*";
|
|
2901
|
+
return X(J(e, n), (e) => Q(e, r.repeat(2)));
|
|
2902
|
+
}, mn = (e, t, n) => {
|
|
2903
|
+
let r = D(t) ?? "*";
|
|
2904
|
+
return X(J(e, n), (e) => Q(e, r));
|
|
2905
|
+
}, hn = Z((e) => Q(e, "~~")), gn = {
|
|
2840
2906
|
red: "🔴",
|
|
2841
2907
|
orange: "🟠",
|
|
2842
2908
|
yellow: "🟡",
|
|
@@ -2844,35 +2910,35 @@ var tn = (e) => en(e, ["*", "_"]), nn = (e) => en(e, ["*", "_"]), rn = (e, t, n)
|
|
|
2844
2910
|
blue: "🔵",
|
|
2845
2911
|
purple: "🟣"
|
|
2846
2912
|
};
|
|
2847
|
-
function
|
|
2848
|
-
let t =
|
|
2913
|
+
function _n(e) {
|
|
2914
|
+
let t = D(e);
|
|
2849
2915
|
if (t === void 0) return "";
|
|
2850
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2916
|
+
if (Object.prototype.hasOwnProperty.call(gn, t)) return gn[t];
|
|
2851
2917
|
}
|
|
2852
|
-
var
|
|
2853
|
-
let t =
|
|
2854
|
-
return
|
|
2918
|
+
var vn = (e) => {
|
|
2919
|
+
let t = D(e);
|
|
2920
|
+
return _n(e) === void 0 ? {
|
|
2855
2921
|
valid: !1,
|
|
2856
2922
|
error: `invalid color "${t}". Use red, orange, yellow, green, blue, or purple`
|
|
2857
2923
|
} : { valid: !0 };
|
|
2858
|
-
},
|
|
2859
|
-
let r =
|
|
2860
|
-
return
|
|
2924
|
+
}, yn = (e, t, n) => {
|
|
2925
|
+
let r = _n(t) ?? "";
|
|
2926
|
+
return X(J(e, n), (e) => Q(e, `==${r}`, "=="));
|
|
2861
2927
|
};
|
|
2862
|
-
function
|
|
2928
|
+
function bn(e, t) {
|
|
2863
2929
|
return e === "" ? t : /(?:\r?\n[\t ]*){2,}$/.test(e) ? `${e}${t}` : /\r?\n[\t ]*$/.test(e) ? `${e}
|
|
2864
2930
|
${t}` : `${e}
|
|
2865
2931
|
|
|
2866
2932
|
${t}`;
|
|
2867
2933
|
}
|
|
2868
|
-
function
|
|
2934
|
+
function xn(e, t) {
|
|
2869
2935
|
return e === "" ? t : /^(?:[\t ]*\r?\n){2,}/.test(e) ? `${t}${e}` : /^[\t ]*\r?\n/.test(e) ? `${t}
|
|
2870
2936
|
${e}` : `${t}
|
|
2871
2937
|
|
|
2872
2938
|
${e}`;
|
|
2873
2939
|
}
|
|
2874
|
-
var
|
|
2875
|
-
let t =
|
|
2940
|
+
var Sn = (e) => {
|
|
2941
|
+
let t = D(e);
|
|
2876
2942
|
return t === void 0 || [
|
|
2877
2943
|
"after",
|
|
2878
2944
|
"before",
|
|
@@ -2881,60 +2947,60 @@ var pn = (e) => {
|
|
|
2881
2947
|
valid: !1,
|
|
2882
2948
|
error: `invalid position "${t}". Use "after", "before", or "both"`
|
|
2883
2949
|
};
|
|
2884
|
-
},
|
|
2885
|
-
let r =
|
|
2886
|
-
return
|
|
2950
|
+
}, Cn = (e, t, n) => {
|
|
2951
|
+
let r = D(t) ?? "after";
|
|
2952
|
+
return X(J(e, n), (e) => r === "before" ? xn(e, "---") : bn(r === "both" ? xn(e, "---") : e, "---"));
|
|
2887
2953
|
};
|
|
2888
|
-
function
|
|
2954
|
+
function wn(e) {
|
|
2889
2955
|
return Math.max(0, ...Array.from(e.matchAll(/`+/g), (e) => e[0].length));
|
|
2890
2956
|
}
|
|
2891
|
-
function
|
|
2957
|
+
function Tn(e) {
|
|
2892
2958
|
if (!e.trim()) return e;
|
|
2893
|
-
let t = e.trim(), n = e.indexOf(t), r = "`".repeat(Math.max(1,
|
|
2959
|
+
let t = e.trim(), n = e.indexOf(t), r = "`".repeat(Math.max(1, wn(t) + 1)), i = t.startsWith("`") || t.endsWith("`") ? " " : "";
|
|
2894
2960
|
return `${e.slice(0, n)}${r}${i}${t}${i}${r}${e.slice(n + t.length)}`;
|
|
2895
2961
|
}
|
|
2896
|
-
function
|
|
2962
|
+
function En(e, t = "") {
|
|
2897
2963
|
if (e === "") return e;
|
|
2898
|
-
let { leading: n, content: r, trailing: i } =
|
|
2964
|
+
let { leading: n, content: r, trailing: i } = Qt(e);
|
|
2899
2965
|
if (r === "") return e;
|
|
2900
|
-
let a = "`".repeat(Math.max(3,
|
|
2966
|
+
let a = "`".repeat(Math.max(3, wn(r) + 1));
|
|
2901
2967
|
return `${n}${a}${t}
|
|
2902
2968
|
${r}
|
|
2903
2969
|
${a}${i}`;
|
|
2904
2970
|
}
|
|
2905
|
-
var
|
|
2906
|
-
let t =
|
|
2971
|
+
var Dn = (e) => {
|
|
2972
|
+
let t = D(e);
|
|
2907
2973
|
return t === void 0 || !/[\r\n`]/.test(t) ? { valid: !0 } : {
|
|
2908
2974
|
valid: !1,
|
|
2909
2975
|
error: "language cannot contain newlines or backticks"
|
|
2910
2976
|
};
|
|
2911
|
-
},
|
|
2912
|
-
let r =
|
|
2913
|
-
return
|
|
2914
|
-
},
|
|
2915
|
-
let r =
|
|
2916
|
-
return
|
|
2977
|
+
}, On = (e, t, n) => {
|
|
2978
|
+
let r = D(t);
|
|
2979
|
+
return X(J(e, n), (e) => r !== void 0 || $t(e) ? En(e, r ?? "") : Tn(e));
|
|
2980
|
+
}, kn = (e, t, n) => {
|
|
2981
|
+
let r = D(t) ?? "";
|
|
2982
|
+
return X(J(e, n), (e) => En(e, r));
|
|
2917
2983
|
};
|
|
2918
|
-
function
|
|
2984
|
+
function An(e) {
|
|
2919
2985
|
if (e === "") return e;
|
|
2920
|
-
let { leading: t, content: n, trailing: r } =
|
|
2986
|
+
let { leading: t, content: n, trailing: r } = Qt(e);
|
|
2921
2987
|
return n === "" ? e : `${t}$$
|
|
2922
2988
|
${n}
|
|
2923
2989
|
$$${r}`;
|
|
2924
2990
|
}
|
|
2925
|
-
var
|
|
2991
|
+
var jn = Z((e) => $t(e) ? An(e) : Q(e, "$")), Mn = Z(An), Nn = Z((e) => {
|
|
2926
2992
|
if (e === "") return e;
|
|
2927
|
-
if (
|
|
2928
|
-
let { leading: t, content: n, trailing: r } =
|
|
2993
|
+
if (!$t(e)) return Q(e, "%%");
|
|
2994
|
+
let { leading: t, content: n, trailing: r } = Qt(e);
|
|
2929
2995
|
return n ? `${t}%%
|
|
2930
2996
|
${n}
|
|
2931
2997
|
%%${r}` : e;
|
|
2932
|
-
}),
|
|
2998
|
+
}), Pn = (e) => {
|
|
2933
2999
|
if (!e) return {
|
|
2934
3000
|
valid: !1,
|
|
2935
3001
|
error: "requires an operation (e.g., calc:\"+10\", calc:\"*2\")"
|
|
2936
3002
|
};
|
|
2937
|
-
let t = (
|
|
3003
|
+
let t = (D(e) ?? "").trim();
|
|
2938
3004
|
if (!t) return {
|
|
2939
3005
|
valid: !1,
|
|
2940
3006
|
error: "operation cannot be empty"
|
|
@@ -2956,13 +3022,13 @@ ${n}
|
|
|
2956
3022
|
valid: !1,
|
|
2957
3023
|
error: "requires a number after the operator (e.g., \"+10\")"
|
|
2958
3024
|
} : { valid: !0 };
|
|
2959
|
-
},
|
|
3025
|
+
}, Fn = (e, t, n) => {
|
|
2960
3026
|
let r = !!(n && Object.prototype.hasOwnProperty.call(n, "rawValue")), i = r ? n?.rawValue : e;
|
|
2961
3027
|
if (!t || r && i == null) return i;
|
|
2962
3028
|
try {
|
|
2963
|
-
let r =
|
|
2964
|
-
if (r === void 0) return
|
|
2965
|
-
let a = (
|
|
3029
|
+
let r = Xt(e);
|
|
3030
|
+
if (r === void 0) return k(n, `Could not parse "${e}" as a number`, "INVALID_FILTER_INPUT"), i;
|
|
3031
|
+
let a = (D(t) ?? "").trim(), o = a.slice(0, 2) === "**" ? "**" : a.charAt(0), s = Number(a.slice(o === "**" ? 2 : 1));
|
|
2966
3032
|
if (isNaN(s)) return i;
|
|
2967
3033
|
let c;
|
|
2968
3034
|
switch (o) {
|
|
@@ -2984,20 +3050,20 @@ ${n}
|
|
|
2984
3050
|
break;
|
|
2985
3051
|
default: return i;
|
|
2986
3052
|
}
|
|
2987
|
-
return Number.isFinite(c) ? Number(c.toFixed(10)) : (
|
|
3053
|
+
return Number.isFinite(c) ? Number(c.toFixed(10)) : (k(n, `Calculation produced a non-finite result for "${e}"`, "INVALID_FILTER_INPUT"), i);
|
|
2988
3054
|
} catch (e) {
|
|
2989
|
-
return
|
|
3055
|
+
return k(n, `Could not calculate value: ${A(e)}`), i;
|
|
2990
3056
|
}
|
|
2991
|
-
},
|
|
3057
|
+
}, In = (e, t) => {
|
|
2992
3058
|
let n = "info", r = "", i = null;
|
|
2993
3059
|
if (t) {
|
|
2994
|
-
let e =
|
|
3060
|
+
let e = O(x(t)).map(S);
|
|
2995
3061
|
e.length > 0 && (n = e[0] || n), e.length > 1 && (r = e[1] || r), e.length > 2 && (e[2].toLowerCase() === "true" ? i = "-" : e[2].toLowerCase() === "false" && (i = "+"));
|
|
2996
3062
|
}
|
|
2997
3063
|
let a = `> [!${n}]`;
|
|
2998
3064
|
return i && (a += i), r && (a += ` ${r}`), `${a}
|
|
2999
3065
|
${e.split("\n").map((e) => `> ${e}`).join("\n")}`;
|
|
3000
|
-
},
|
|
3066
|
+
}, Ln = (e) => e.replace(/(?:^\w|[A-Z]|\b\w)/g, (e, t) => t === 0 ? e.toLowerCase() : e.toUpperCase()).replace(/[\s_-]+/g, ""), Rn = (e) => {
|
|
3001
3067
|
let t = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
3002
3068
|
try {
|
|
3003
3069
|
let n = (e) => {
|
|
@@ -3015,23 +3081,23 @@ ${e.split("\n").map((e) => `> ${e}`).join("\n")}`;
|
|
|
3015
3081
|
return t(e);
|
|
3016
3082
|
}
|
|
3017
3083
|
};
|
|
3018
|
-
function
|
|
3084
|
+
function zn(e) {
|
|
3019
3085
|
return e == null || typeof e == "string" && e.trim() === "";
|
|
3020
3086
|
}
|
|
3021
|
-
var
|
|
3022
|
-
let r =
|
|
3023
|
-
return Array.isArray(r) ? r.filter((e) => !
|
|
3087
|
+
var Bn = (e, t, n) => {
|
|
3088
|
+
let r = J(e, n);
|
|
3089
|
+
return Array.isArray(r) ? r.filter((e) => !zn(e)) : q(r) ? Object.fromEntries(Object.entries(r).filter(([, e]) => !zn(e))) : r;
|
|
3024
3090
|
};
|
|
3025
|
-
|
|
3026
|
-
var
|
|
3091
|
+
j.default.extend(pe.default), j.default.extend(de.default), j.default.extend(fe.default), j.default.extend(me.default);
|
|
3092
|
+
var Vn = (e, t, n) => {
|
|
3027
3093
|
if (e === "") return e;
|
|
3028
3094
|
let r = e === "now" ? /* @__PURE__ */ new Date() : e;
|
|
3029
|
-
if (!t) return (0,
|
|
3030
|
-
let [i, a] =
|
|
3031
|
-
return o = a ? (0,
|
|
3095
|
+
if (!t) return (0, j.default)(r).format("YYYY-MM-DD");
|
|
3096
|
+
let [i, a] = O(x(t)).map(S), o;
|
|
3097
|
+
return o = a ? (0, j.default)(r, a, !0) : (0, j.default)(r), o.isValid() ? o.format(i) : (k(n, `Could not parse "${e}" as a date`, "INVALID_FILTER_INPUT"), e);
|
|
3032
3098
|
};
|
|
3033
|
-
|
|
3034
|
-
var
|
|
3099
|
+
j.default.extend(pe.default), j.default.extend(de.default), j.default.extend(fe.default), j.default.extend(me.default);
|
|
3100
|
+
var Hn = [
|
|
3035
3101
|
"year",
|
|
3036
3102
|
"years",
|
|
3037
3103
|
"month",
|
|
@@ -3046,50 +3112,50 @@ var Nn = [
|
|
|
3046
3112
|
"minutes",
|
|
3047
3113
|
"second",
|
|
3048
3114
|
"seconds"
|
|
3049
|
-
],
|
|
3115
|
+
], Un = (e) => {
|
|
3050
3116
|
if (!e) return {
|
|
3051
3117
|
valid: !1,
|
|
3052
3118
|
error: "requires a modifier (e.g., date_modify:\"+1 day\", \"-2 weeks\")"
|
|
3053
3119
|
};
|
|
3054
|
-
let t = (
|
|
3120
|
+
let t = (D(e) ?? "").trim().match(/^([+-])\s*(\d+)\s*(\w+)s?$/);
|
|
3055
3121
|
if (!t) return {
|
|
3056
3122
|
valid: !1,
|
|
3057
3123
|
error: "invalid format. Use \"+1 day\", \"-2 weeks\", etc."
|
|
3058
3124
|
};
|
|
3059
3125
|
let [, , , n] = t, r = n.toLowerCase().replace(/s$/, "");
|
|
3060
|
-
return
|
|
3126
|
+
return Hn.some((e) => e.replace(/s$/, "") === r) ? { valid: !0 } : {
|
|
3061
3127
|
valid: !1,
|
|
3062
3128
|
error: `invalid unit "${n}". Use year, month, week, day, hour, minute, or second`
|
|
3063
3129
|
};
|
|
3064
|
-
},
|
|
3130
|
+
}, Wn = (e, t, n) => {
|
|
3065
3131
|
if (!t || e === "") return e;
|
|
3066
|
-
let r = (0,
|
|
3067
|
-
if (!r.isValid()) return
|
|
3068
|
-
t = (
|
|
3132
|
+
let r = (0, j.default)(e);
|
|
3133
|
+
if (!r.isValid()) return k(n, `Could not parse "${e}" as a date`, "INVALID_FILTER_INPUT"), e;
|
|
3134
|
+
t = (D(t) ?? "").trim();
|
|
3069
3135
|
let i = t.match(/^([+-])\s*(\d+)\s*(\w+)s?$/);
|
|
3070
3136
|
if (!i) return e;
|
|
3071
3137
|
let [, a, o, s] = i, c = parseInt(o, 10);
|
|
3072
3138
|
return r = a === "+" ? r.add(c, s) : r.subtract(c, s), r.format("YYYY-MM-DD");
|
|
3073
3139
|
};
|
|
3074
|
-
function
|
|
3140
|
+
function Gn(e) {
|
|
3075
3141
|
try {
|
|
3076
3142
|
return decodeURIComponent(e);
|
|
3077
3143
|
} catch {
|
|
3078
3144
|
return e;
|
|
3079
3145
|
}
|
|
3080
3146
|
}
|
|
3081
|
-
var
|
|
3082
|
-
function
|
|
3147
|
+
var Kn = (e, t, n) => X(J(e, n), Gn);
|
|
3148
|
+
function qn(e) {
|
|
3083
3149
|
try {
|
|
3084
3150
|
return encodeURIComponent(e);
|
|
3085
3151
|
} catch {
|
|
3086
3152
|
return e;
|
|
3087
3153
|
}
|
|
3088
3154
|
}
|
|
3089
|
-
var
|
|
3090
|
-
let r =
|
|
3155
|
+
var Jn = (e, t, n) => X(J(e, n), qn), Yn = (e, t, n) => {
|
|
3156
|
+
let r = Zt(e, n);
|
|
3091
3157
|
return Array.isArray(r) ? r.length > 0 ? r[0] : null : r;
|
|
3092
|
-
},
|
|
3158
|
+
}, Xn = (e) => {
|
|
3093
3159
|
if (e === "") return e;
|
|
3094
3160
|
try {
|
|
3095
3161
|
let t = JSON.parse(e);
|
|
@@ -3097,11 +3163,11 @@ var zn = (e, t, n) => Y(q(e, n), Rn), Bn = (e, t, n) => {
|
|
|
3097
3163
|
if (typeof t == "object" && t) return Object.entries(t).map(([e, t]) => `[^${e.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase()}]: ${t}`).join("\n\n");
|
|
3098
3164
|
} catch {}
|
|
3099
3165
|
return e;
|
|
3100
|
-
},
|
|
3166
|
+
}, Zn = (e) => (e = e.replace(/!\[([^\]]*)\]\([^\)]+\)/g, ""), e = e.replace(/!\[\[([^\]]+)\]\]/g, ""), e = e.replace(/\[([^\]]+)\]\([^\)]+\)/g, "$1"), e = e.replace(/https?:\/\/\S+/g, ""), e = e.replace(/(\*\*|__)(.*?)\1/g, "$2"), e = e.replace(/(\*|_)(.*?)\1/g, "$2"), e = e.replace(/==(.*?)==/g, "$1"), e = e.replace(/^#+\s+/gm, ""), e = e.replace(/`([^`]+)`/g, "$1"), e = e.replace(/```[\s\S]*?```/g, ""), e = e.replace(/~~(.*?)~~/g, "$1"), e = e.replace(/^[-*+] (\[[x ]\] )?/gm, ""), e = e.replace(/^([-*_]){3,}\s*$/gm, ""), e = e.replace(/^>\s+/gm, ""), e = e.replace(/\|.*\|/g, ""), e = e.replace(/([~^])(\w+)\1/g, "$2"), e = e.replace(/:[a-z_]+:/g, ""), e = e.replace(/<[^>]+>/g, ""), e = e.replace(/\[\s*\]/g, ""), e = e.replace(/\[\^[^\]]+\]/g, ""), e = e.replace(/^\*\[[^\]]+\]:.+$/gm, ""), e = e.replace(/\[\[([^\]|]+)\|?([^\]]*)\]\]/g, (e, t, n) => n || t), e = e.replace(/\n{3,}/g, "\n\n"), e = e.trim(), e), Qn = (e, t) => {
|
|
3101
3167
|
if (!t || !e.trim()) return [e];
|
|
3102
3168
|
t = t.replace(/^(['"])([\s\S]*)\1$/, "$2");
|
|
3103
3169
|
let n = t.match(/^(.*?):?((https?:\/\/|file:\/\/).*$)/), r = String(n?.[1]?.trim().replace(/(['"])/g, "") || "link"), i = String(n?.[2] || t), a = (e) => {
|
|
3104
|
-
let t =
|
|
3170
|
+
let t = Zn(e).split(/\s+/).filter(Boolean);
|
|
3105
3171
|
return t.length > 10 ? {
|
|
3106
3172
|
start: t.slice(0, 5).join(" "),
|
|
3107
3173
|
end: t.slice(-5).join(" ")
|
|
@@ -3121,37 +3187,37 @@ var zn = (e, t, n) => Y(q(e, n), Rn), Bn = (e, t, n) => {
|
|
|
3121
3187
|
} catch {}
|
|
3122
3188
|
return [e];
|
|
3123
3189
|
};
|
|
3124
|
-
function
|
|
3190
|
+
function $n(e) {
|
|
3125
3191
|
return e.replaceAll("&", "&").replace(/[\\`*_[\]<>]/g, "\\$&").replace(/\r\n?|\n/g, " ");
|
|
3126
3192
|
}
|
|
3127
|
-
function
|
|
3193
|
+
function er(e) {
|
|
3128
3194
|
let t = e.replace(/[\x00-\x20\x7f]/g, "");
|
|
3129
3195
|
return /^(?:javascript|vbscript|data):/i.test(t) ? "" : e.replace(/&(?=(?:#\d+|#x[\da-f]+|[a-z][a-z\d]+);)/gi, "%26").replace(/[\x00-\x20\x7f()\[\]<>\\"`]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`);
|
|
3130
3196
|
}
|
|
3131
|
-
var
|
|
3197
|
+
var tr = (e, t) => {
|
|
3132
3198
|
if (!e.trim()) return e;
|
|
3133
3199
|
let n = "";
|
|
3134
|
-
t && (n =
|
|
3200
|
+
t && (n = E(t) ?? n), n = $n(n);
|
|
3135
3201
|
try {
|
|
3136
|
-
let t = JSON.parse(e), r = (e) => Object.entries(e).map(([e, t]) => typeof t == "object" && t ? r(t) : `, r = (e) => Object.entries(e).map(([e, t]) => typeof t == "object" && t ? r(t) : `})`).flat();
|
|
3203
|
+
if (Array.isArray(t)) return t.map((e) => typeof e == "object" && e ? r(e) : e ? `)})` : "").flat();
|
|
3138
3204
|
if (typeof t == "object" && t) return r(t);
|
|
3139
3205
|
} catch {
|
|
3140
|
-
return `})`;
|
|
3141
3207
|
}
|
|
3142
3208
|
return e;
|
|
3143
|
-
},
|
|
3209
|
+
}, nr = 1e3, rr = (e) => {
|
|
3144
3210
|
if (!e) return { valid: !0 };
|
|
3145
|
-
let t =
|
|
3146
|
-
return /^\d+$/.test(t) && Number.isSafeInteger(n) && n <=
|
|
3211
|
+
let t = D(e) ?? "", n = Number(t);
|
|
3212
|
+
return /^\d+$/.test(t) && Number.isSafeInteger(n) && n <= nr ? { valid: !0 } : {
|
|
3147
3213
|
valid: !1,
|
|
3148
|
-
error: `requires an integer from 0 to ${
|
|
3214
|
+
error: `requires an integer from 0 to ${nr} spaces (e.g., indent:2)`
|
|
3149
3215
|
};
|
|
3150
|
-
},
|
|
3151
|
-
if (!
|
|
3152
|
-
let n = t ? Number(
|
|
3216
|
+
}, ir = (e, t) => {
|
|
3217
|
+
if (!rr(t).valid) return e;
|
|
3218
|
+
let n = t ? Number(D(t)) : 2, r = " ".repeat(n);
|
|
3153
3219
|
return e.replace(/[^\r\n]+/g, (e) => r + e);
|
|
3154
|
-
},
|
|
3220
|
+
}, ar = (e, t) => {
|
|
3155
3221
|
if (!e || e === "undefined" || e === "null") return "";
|
|
3156
3222
|
let n;
|
|
3157
3223
|
try {
|
|
@@ -3161,23 +3227,23 @@ var Gn = (e, t) => {
|
|
|
3161
3227
|
}
|
|
3162
3228
|
if (!Array.isArray(n)) return e;
|
|
3163
3229
|
let r = ",";
|
|
3164
|
-
return t && (r =
|
|
3165
|
-
},
|
|
3166
|
-
let r =
|
|
3230
|
+
return t && (r = E(t) ?? r, r = r.replace(/\\n/g, "\n")), n.join(r);
|
|
3231
|
+
}, or = (e) => e.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), sr = (e, t, n) => {
|
|
3232
|
+
let r = Zt(e, n);
|
|
3167
3233
|
return Array.isArray(r) ? r.length > 0 ? r[r.length - 1] : null : r;
|
|
3168
|
-
},
|
|
3234
|
+
}, cr = [
|
|
3169
3235
|
"numbered",
|
|
3170
3236
|
"task",
|
|
3171
3237
|
"numbered-task"
|
|
3172
|
-
],
|
|
3238
|
+
], lr = (e) => {
|
|
3173
3239
|
if (!e) return { valid: !0 };
|
|
3174
|
-
let t =
|
|
3175
|
-
return !t || !
|
|
3240
|
+
let t = D(e);
|
|
3241
|
+
return !t || !cr.includes(t) ? {
|
|
3176
3242
|
valid: !1,
|
|
3177
3243
|
error: `invalid list type "${t ?? ""}". Use "numbered", "task", or "numbered-task"`
|
|
3178
3244
|
} : { valid: !0 };
|
|
3179
|
-
},
|
|
3180
|
-
let n =
|
|
3245
|
+
}, ur = (e, t) => {
|
|
3246
|
+
let n = D(t);
|
|
3181
3247
|
if (e === "") return e;
|
|
3182
3248
|
let r = (e, t, n = 0) => {
|
|
3183
3249
|
let r = " ".repeat(n), a;
|
|
@@ -3215,40 +3281,40 @@ var Gn = (e, t) => {
|
|
|
3215
3281
|
} catch {
|
|
3216
3282
|
return r(e, a(n));
|
|
3217
3283
|
}
|
|
3218
|
-
},
|
|
3284
|
+
}, dr = (e, t) => {
|
|
3219
3285
|
if (!e.trim()) return e;
|
|
3220
3286
|
let n = "link";
|
|
3221
|
-
t && (n =
|
|
3287
|
+
t && (n = E(t) ?? n), n = $n(n);
|
|
3222
3288
|
try {
|
|
3223
|
-
let t = JSON.parse(e), r = (e) => Object.entries(e).map(([e, t]) => typeof t == "object" && t ? r(t) : `[${
|
|
3224
|
-
if (Array.isArray(t)) return t.map((e) => typeof e == "object" && e ? r(e) : e ? `[${n}](${
|
|
3289
|
+
let t = JSON.parse(e), r = (e) => Object.entries(e).map(([e, t]) => typeof t == "object" && t ? r(t) : `[${$n(String(t))}](${er(e)})`).flat();
|
|
3290
|
+
if (Array.isArray(t)) return t.map((e) => typeof e == "object" && e ? r(e) : e ? `[${n}](${er(String(e))})` : "").join("\n");
|
|
3225
3291
|
if (typeof t == "object" && t) return r(t).join("\n");
|
|
3226
3292
|
} catch {
|
|
3227
|
-
return `[${n}](${
|
|
3293
|
+
return `[${n}](${er(e)})`;
|
|
3228
3294
|
}
|
|
3229
3295
|
return e;
|
|
3230
|
-
},
|
|
3231
|
-
let r =
|
|
3232
|
-
return Array.isArray(r) ? r.length :
|
|
3233
|
-
},
|
|
3296
|
+
}, fr = (e, t, n) => {
|
|
3297
|
+
let r = J(e, n, !0);
|
|
3298
|
+
return Array.isArray(r) ? r.length : q(r) ? Object.keys(r).length : e.length;
|
|
3299
|
+
}, pr = (e) => {
|
|
3234
3300
|
let t = (e) => e.toLocaleLowerCase();
|
|
3235
3301
|
return Array.isArray(e) ? e.map(t) : t(e);
|
|
3236
|
-
},
|
|
3302
|
+
}, mr = (e) => {
|
|
3237
3303
|
if (!e) return {
|
|
3238
3304
|
valid: !1,
|
|
3239
3305
|
error: "requires a property path or arrow function (e.g., map:\"name\")"
|
|
3240
3306
|
};
|
|
3241
3307
|
if (e.match(/^\s*(\w+)\s*=>\s*(.+)$/)) return { valid: !0 };
|
|
3242
|
-
let t =
|
|
3243
|
-
return t.length !== 1 ||
|
|
3308
|
+
let t = O(x(e));
|
|
3309
|
+
return t.length !== 1 || S(t[0]) === "" ? {
|
|
3244
3310
|
valid: !1,
|
|
3245
3311
|
error: "requires a property path or arrow function (e.g., map:\"name\")"
|
|
3246
|
-
} :
|
|
3312
|
+
} : S(t[0]).split(".").some((e) => e === "") ? {
|
|
3247
3313
|
valid: !1,
|
|
3248
3314
|
error: "property path cannot contain empty segments"
|
|
3249
3315
|
} : { valid: !0 };
|
|
3250
3316
|
};
|
|
3251
|
-
function
|
|
3317
|
+
function hr(e, t) {
|
|
3252
3318
|
let n;
|
|
3253
3319
|
try {
|
|
3254
3320
|
n = JSON.parse(e);
|
|
@@ -3262,40 +3328,40 @@ function ar(e, t) {
|
|
|
3262
3328
|
let t = a.trim();
|
|
3263
3329
|
if (t.startsWith("(") && t.endsWith(")") && (t = t.slice(1, -1).trim()), t.startsWith("{") && t.endsWith("}") || t.startsWith("\"") && t.endsWith("\"") || t.startsWith("'") && t.endsWith("'")) {
|
|
3264
3330
|
let n = /* @__PURE__ */ Object.create(null);
|
|
3265
|
-
if (t.startsWith("{"))
|
|
3266
|
-
let [r, a] =
|
|
3331
|
+
if (t.startsWith("{")) O(t.slice(1, -1)).forEach((t) => {
|
|
3332
|
+
let [r, a] = ie(t);
|
|
3267
3333
|
if (a === void 0) return;
|
|
3268
|
-
let o = r.replace(/^['"](.+)['"]$/, "$1"), s =
|
|
3334
|
+
let o = r.replace(/^['"](.+)['"]$/, "$1"), s = vr(a, e, i);
|
|
3269
3335
|
n[o] = s;
|
|
3270
3336
|
});
|
|
3271
3337
|
else return t.slice(1, -1).replace(RegExp(`\\$\\{${i}\\}`, "g"), e);
|
|
3272
3338
|
return n;
|
|
3273
3339
|
}
|
|
3274
|
-
return
|
|
3340
|
+
return vr(a, e, i);
|
|
3275
3341
|
});
|
|
3276
3342
|
return JSON.stringify(o);
|
|
3277
3343
|
}
|
|
3278
3344
|
return e;
|
|
3279
3345
|
}
|
|
3280
|
-
function
|
|
3346
|
+
function gr(e, t) {
|
|
3281
3347
|
let n = t?.rawArguments?.[0];
|
|
3282
|
-
return n === void 0 ?
|
|
3348
|
+
return n === void 0 ? S(x(e)) : typeof n == "string" ? n : void 0;
|
|
3283
3349
|
}
|
|
3284
|
-
var
|
|
3350
|
+
var _r = (e, t, n) => {
|
|
3285
3351
|
if (!t) return e;
|
|
3286
|
-
if (/^\s*\w+\s*=>\s*(.+)$/.test(t)) return
|
|
3287
|
-
let r =
|
|
3288
|
-
if (!r) return
|
|
3289
|
-
let i =
|
|
3352
|
+
if (/^\s*\w+\s*=>\s*(.+)$/.test(t)) return hr(e, t);
|
|
3353
|
+
let r = gr(t, n);
|
|
3354
|
+
if (!r) return Y(e, n);
|
|
3355
|
+
let i = Y(e, n);
|
|
3290
3356
|
return Array.isArray(i) ? i.map((e) => {
|
|
3291
|
-
let t =
|
|
3357
|
+
let t = St(e, r);
|
|
3292
3358
|
return t.exists ? t.value : null;
|
|
3293
3359
|
}) : i;
|
|
3294
3360
|
};
|
|
3295
|
-
function
|
|
3361
|
+
function vr(e, t, n) {
|
|
3296
3362
|
if (typeof t == "string") return t;
|
|
3297
3363
|
let r = e.replace(RegExp(`${n}\\.([\\w.\\[\\]]+)`, "g"), (e, n) => {
|
|
3298
|
-
let r =
|
|
3364
|
+
let r = yr(t, n);
|
|
3299
3365
|
return JSON.stringify(r);
|
|
3300
3366
|
});
|
|
3301
3367
|
try {
|
|
@@ -3304,10 +3370,10 @@ function cr(e, t, n) {
|
|
|
3304
3370
|
return r.replace(/^["'](.+)["']$/, "$1");
|
|
3305
3371
|
}
|
|
3306
3372
|
}
|
|
3307
|
-
function
|
|
3308
|
-
return t.split(/[.\[\]]/).filter(Boolean).reduce((e, t) =>
|
|
3373
|
+
function yr(e, t) {
|
|
3374
|
+
return t.split(/[.\[\]]/).filter(Boolean).reduce((e, t) => W(e, t).value, e);
|
|
3309
3375
|
}
|
|
3310
|
-
var
|
|
3376
|
+
var br = (e, t, n) => {
|
|
3311
3377
|
if (!e || e === "undefined" || e === "null") return "[]";
|
|
3312
3378
|
let r = n?.rawValue;
|
|
3313
3379
|
if (!Array.isArray(r)) try {
|
|
@@ -3318,12 +3384,12 @@ var ur = (e, t, n) => {
|
|
|
3318
3384
|
let i = Array.isArray(r) ? r : [e];
|
|
3319
3385
|
if (!t) return JSON.stringify(i);
|
|
3320
3386
|
try {
|
|
3321
|
-
let e = n?.rawArguments?.length === 1 ? n.rawArguments[0] : void 0, r =
|
|
3387
|
+
let e = n?.rawArguments?.length === 1 ? n.rawArguments[0] : void 0, r = ee(typeof e == "string" && e.includes(",") ? e : t).map(S);
|
|
3322
3388
|
return JSON.stringify([...i, ...r]);
|
|
3323
3389
|
} catch (e) {
|
|
3324
|
-
return
|
|
3390
|
+
return k(n, `Could not merge values: ${A(e)}`), JSON.stringify(i);
|
|
3325
3391
|
}
|
|
3326
|
-
},
|
|
3392
|
+
}, xr = (e) => {
|
|
3327
3393
|
if (!e) return { valid: !0 };
|
|
3328
3394
|
if (e.includes(":")) {
|
|
3329
3395
|
let [t, n] = e.split(":").map((e) => e.trim()), r = t.split(",").map((e) => parseInt(e.trim(), 10)), i = parseInt(n, 10);
|
|
@@ -3340,13 +3406,13 @@ var ur = (e, t, n) => {
|
|
|
3340
3406
|
valid: !1,
|
|
3341
3407
|
error: "invalid syntax. Use number (2), multiplier (5n), offset (n+7), or basis (1,2:5)"
|
|
3342
3408
|
};
|
|
3343
|
-
},
|
|
3344
|
-
let r =
|
|
3409
|
+
}, Sr = (e, t, n) => {
|
|
3410
|
+
let r = Zt(e, n);
|
|
3345
3411
|
if (!Array.isArray(r)) {
|
|
3346
3412
|
if (typeof r == "string" && r && r !== "undefined" && r !== "null") try {
|
|
3347
3413
|
JSON.parse(e);
|
|
3348
3414
|
} catch {
|
|
3349
|
-
|
|
3415
|
+
k(n, "Could not parse value as a JSON array", "INVALID_FILTER_INPUT");
|
|
3350
3416
|
}
|
|
3351
3417
|
return r;
|
|
3352
3418
|
}
|
|
@@ -3373,7 +3439,7 @@ var ur = (e, t, n) => {
|
|
|
3373
3439
|
return r.filter((t, n) => n + 1 >= e);
|
|
3374
3440
|
}
|
|
3375
3441
|
return r;
|
|
3376
|
-
},
|
|
3442
|
+
}, Cr = (e, t, n) => {
|
|
3377
3443
|
let r = (e, t, n, r) => {
|
|
3378
3444
|
let i = e.toFixed(t).split(".");
|
|
3379
3445
|
return i[0] = i[0].replace(/\B(?=(\d{3})+(?!\d))/g, r), i.join(n);
|
|
@@ -3390,7 +3456,7 @@ var ur = (e, t, n) => {
|
|
|
3390
3456
|
try {
|
|
3391
3457
|
let n = 0, r = ".", o = ",";
|
|
3392
3458
|
if (t) {
|
|
3393
|
-
let e =
|
|
3459
|
+
let e = O(x(t)).map(S);
|
|
3394
3460
|
e.length >= 1 && (n = parseInt(e[0], 10)), e.length >= 2 && (r = a(e[1])), e.length >= 3 && (o = a(e[2]));
|
|
3395
3461
|
}
|
|
3396
3462
|
isNaN(n) && (n = 0);
|
|
@@ -3403,24 +3469,24 @@ var ur = (e, t, n) => {
|
|
|
3403
3469
|
let c = i(s, n, r, o);
|
|
3404
3470
|
return typeof c == "string" ? c : JSON.stringify(c);
|
|
3405
3471
|
} catch (t) {
|
|
3406
|
-
return
|
|
3472
|
+
return k(n, `Could not format number: ${A(t)}`), e;
|
|
3407
3473
|
}
|
|
3408
|
-
},
|
|
3474
|
+
}, wr = [
|
|
3409
3475
|
"array",
|
|
3410
3476
|
"keys",
|
|
3411
3477
|
"values"
|
|
3412
|
-
],
|
|
3478
|
+
], Tr = (e) => {
|
|
3413
3479
|
if (!e) return {
|
|
3414
3480
|
valid: !1,
|
|
3415
3481
|
error: "requires a parameter: \"array\", \"keys\", or \"values\""
|
|
3416
3482
|
};
|
|
3417
|
-
let t =
|
|
3418
|
-
return !t || !
|
|
3483
|
+
let t = D(e);
|
|
3484
|
+
return !t || !wr.includes(t) ? {
|
|
3419
3485
|
valid: !1,
|
|
3420
3486
|
error: `invalid parameter "${t ?? ""}". Use "array", "keys", or "values"`
|
|
3421
3487
|
} : { valid: !0 };
|
|
3422
|
-
},
|
|
3423
|
-
let r =
|
|
3488
|
+
}, Er = (e, t, n) => {
|
|
3489
|
+
let r = D(t);
|
|
3424
3490
|
try {
|
|
3425
3491
|
let t = JSON.parse(e);
|
|
3426
3492
|
if (typeof t == "object" && t) switch (r) {
|
|
@@ -3430,17 +3496,17 @@ var ur = (e, t, n) => {
|
|
|
3430
3496
|
default: return e;
|
|
3431
3497
|
}
|
|
3432
3498
|
} catch {
|
|
3433
|
-
|
|
3499
|
+
k(n, "Could not parse value as JSON", "INVALID_FILTER_INPUT");
|
|
3434
3500
|
}
|
|
3435
3501
|
return e;
|
|
3436
|
-
},
|
|
3502
|
+
}, Dr = (e) => e.replace(/[\s_-]+(.)/g, (e, t) => t.toUpperCase()).replace(/^(.)/, (e) => e.toUpperCase()), Or = (e, t, n) => {
|
|
3437
3503
|
if (n && Object.prototype.hasOwnProperty.call(n, "rawValue") && typeof n.rawValue != "string") return n.rawValue;
|
|
3438
3504
|
try {
|
|
3439
3505
|
return JSON.parse(e);
|
|
3440
3506
|
} catch {
|
|
3441
|
-
return
|
|
3507
|
+
return k(n, "Could not parse value as JSON", "INVALID_FILTER_INPUT"), e;
|
|
3442
3508
|
}
|
|
3443
|
-
},
|
|
3509
|
+
}, kr = (e) => {
|
|
3444
3510
|
if (!e || e === "undefined" || e === "null") return "";
|
|
3445
3511
|
try {
|
|
3446
3512
|
let t = JSON.parse(e);
|
|
@@ -3453,9 +3519,9 @@ var ur = (e, t, n) => {
|
|
|
3453
3519
|
return e.split("").reverse().join("");
|
|
3454
3520
|
}
|
|
3455
3521
|
return e;
|
|
3456
|
-
},
|
|
3522
|
+
}, Ar = (e, t = "") => {
|
|
3457
3523
|
if (!t) return e;
|
|
3458
|
-
let n =
|
|
3524
|
+
let n = te(t).map((e) => e.toLowerCase()).filter(Boolean);
|
|
3459
3525
|
return n.length === 0 ? e : e.replace(/<(\w+)\s+([^>]*?)>/g, (e, t, r) => {
|
|
3460
3526
|
let i = /([a-zA-Z0-9_:-]+(?:\s*=\s*(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^'"\s>]+))?)|(\s*\/?\s*$)/g, a = /^([a-zA-Z0-9_:-]+)/, o = [], s = Array.from(r.matchAll(i));
|
|
3461
3527
|
for (let e of s) {
|
|
@@ -3468,29 +3534,29 @@ var ur = (e, t, n) => {
|
|
|
3468
3534
|
let c = o.join(" ").trim();
|
|
3469
3535
|
return c ? `<${t} ${c}>` : `<${t}>`;
|
|
3470
3536
|
});
|
|
3471
|
-
},
|
|
3537
|
+
}, jr = (e, t = "") => {
|
|
3472
3538
|
if (!t) return e;
|
|
3473
|
-
let n =
|
|
3539
|
+
let n = te(t).filter(Boolean);
|
|
3474
3540
|
if (n.length === 0) return e;
|
|
3475
3541
|
let r = n.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), i = RegExp(`<\\/?(?:${r})\\b[^>]*>`, "gi");
|
|
3476
3542
|
return e.replace(i, "");
|
|
3477
|
-
},
|
|
3543
|
+
}, Mr = (e) => {
|
|
3478
3544
|
if (!e) return {
|
|
3479
3545
|
valid: !1,
|
|
3480
3546
|
error: "requires search and replacement (e.g., replace:\"old\":\"new\")"
|
|
3481
3547
|
};
|
|
3482
|
-
let t =
|
|
3483
|
-
let t =
|
|
3548
|
+
let t = O(x(e)), n = t.length > 0 && t.every((e) => {
|
|
3549
|
+
let t = Nr(e);
|
|
3484
3550
|
if (!t) return !1;
|
|
3485
3551
|
let [n, r] = t, i = /^(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')$/.test(n.trim()), a = /^\/(?:\\.|[^/\\])+\/[gimsuy]*$/.test(n.trim()), o = r.trim() === "" || /^(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')$/.test(r.trim());
|
|
3486
3552
|
return (i || a) && o;
|
|
3487
|
-
}), r = /["'][^"']*["']\s*:\s*["'][^"']*["']/.test(
|
|
3553
|
+
}), r = /["'][^"']*["']\s*:\s*["'][^"']*["']/.test(x(e)) || /["'][^"']*["']\s*:/.test(x(e)) || /\/[^/]+\/[gimsuy]*\s*:/.test(x(e));
|
|
3488
3554
|
return !n && !r ? {
|
|
3489
3555
|
valid: !1,
|
|
3490
3556
|
error: "values must be quoted (e.g., replace:\"old\":\"new\" or replace:\"text\":\"\")"
|
|
3491
3557
|
} : { valid: !0 };
|
|
3492
3558
|
};
|
|
3493
|
-
function
|
|
3559
|
+
function Nr(e) {
|
|
3494
3560
|
let t = "", n = !1, r = !1;
|
|
3495
3561
|
for (let i = 0; i < e.length; i++) {
|
|
3496
3562
|
let a = e[i];
|
|
@@ -3504,28 +3570,28 @@ function Cr(e) {
|
|
|
3504
3570
|
}
|
|
3505
3571
|
return null;
|
|
3506
3572
|
}
|
|
3507
|
-
var
|
|
3508
|
-
let r = t.split(/(?<=[^\\]["']):(?=["'])/), i =
|
|
3573
|
+
var Pr = (e, t, n) => t ? O(x(t)).reduce((e, t) => {
|
|
3574
|
+
let r = t.split(/(?<=[^\\]["']):(?=["'])/), i = Nr(t) ?? (r.length >= 2 ? [r[0], r.slice(1).join(":")] : null);
|
|
3509
3575
|
if (!i) return e;
|
|
3510
|
-
let [a, o] = i.map(
|
|
3576
|
+
let [a, o] = i.map(S);
|
|
3511
3577
|
o ||= "";
|
|
3512
|
-
let s =
|
|
3578
|
+
let s = b(a);
|
|
3513
3579
|
if (s) {
|
|
3514
|
-
if (n?.allowRegex === !1) throw new
|
|
3580
|
+
if (n?.allowRegex === !1) throw new M("Regex replacements are disabled", "INVALID_FILTER_ARGUMENTS");
|
|
3515
3581
|
try {
|
|
3516
|
-
return o =
|
|
3582
|
+
return o = Fr(o), Ir(e, new RegExp(s.pattern, s.flags), o, n);
|
|
3517
3583
|
} catch (t) {
|
|
3518
|
-
if (t instanceof
|
|
3519
|
-
return
|
|
3584
|
+
if (t instanceof M) throw t;
|
|
3585
|
+
return k(n, `Invalid regular expression: ${A(t)}`, "INVALID_FILTER_INPUT"), e;
|
|
3520
3586
|
}
|
|
3521
3587
|
}
|
|
3522
|
-
if (a =
|
|
3588
|
+
if (a = Fr(a), o = Fr(o), a === "|" || a === ":" || a.includes("\n") || a.includes("\r") || a.includes(" ")) {
|
|
3523
3589
|
let t = e.split(a);
|
|
3524
3590
|
return n?.checkLength?.(e.length + (t.length - 1) * (o.length - a.length)), t.join(o);
|
|
3525
3591
|
}
|
|
3526
|
-
return
|
|
3592
|
+
return Ir(e, new RegExp(a.replace(/([.*+?^${}()|[\]\\])/g, "\\$1"), "g"), o, n);
|
|
3527
3593
|
}, e) : e;
|
|
3528
|
-
function
|
|
3594
|
+
function Fr(e) {
|
|
3529
3595
|
return e.replace(/\\([nrt]|[^nrt])/g, (e, t) => {
|
|
3530
3596
|
switch (t) {
|
|
3531
3597
|
case "n": return "\n";
|
|
@@ -3535,7 +3601,7 @@ function Tr(e) {
|
|
|
3535
3601
|
}
|
|
3536
3602
|
});
|
|
3537
3603
|
}
|
|
3538
|
-
function
|
|
3604
|
+
function Ir(e, t, n, r) {
|
|
3539
3605
|
if (!r?.checkLength) return e.replace(t, n);
|
|
3540
3606
|
let i = e.length;
|
|
3541
3607
|
return e.replace(t, (t, ...a) => {
|
|
@@ -3558,13 +3624,13 @@ function Er(e, t, n, r) {
|
|
|
3558
3624
|
return i += u.length - t.length, r.checkLength(i), u;
|
|
3559
3625
|
});
|
|
3560
3626
|
}
|
|
3561
|
-
var
|
|
3562
|
-
let n =
|
|
3627
|
+
var Lr = (e) => S(e).replace(/\\(.)/g, "$1"), Rr = (e, t = "") => {
|
|
3628
|
+
let n = ee(t).filter(Boolean), r = [];
|
|
3563
3629
|
for (let e of n) {
|
|
3564
|
-
let [t, n] =
|
|
3565
|
-
r.push([
|
|
3630
|
+
let [t, n] = ie(e);
|
|
3631
|
+
r.push([Lr(t), n === void 0 ? "" : Lr(n)]);
|
|
3566
3632
|
}
|
|
3567
|
-
if (r.some(([e, t]) => !/^[a-z][\w:-]*$/i.test(e) || t !== "" && !/^[a-z][\w:-]*$/i.test(t))) throw new
|
|
3633
|
+
if (r.some(([e, t]) => !/^[a-z][\w:-]*$/i.test(e) || t !== "" && !/^[a-z][\w:-]*$/i.test(t))) throw new M("replace_tags requires tag names", "INVALID_FILTER_ARGUMENTS");
|
|
3568
3634
|
if (r.length === 0) return e;
|
|
3569
3635
|
let i = e;
|
|
3570
3636
|
return r.forEach(([e, t]) => {
|
|
@@ -3572,9 +3638,9 @@ var Dr = (e) => f(e).replace(/\\(.)/g, "$1"), Or = (e, t = "") => {
|
|
|
3572
3638
|
let n = RegExp(`<${e}(\\s+[^>]*?)?>`, "g"), r = RegExp(`</${e}>`, "g");
|
|
3573
3639
|
i = i.replace(n, (e, n) => t ? `<${t}${n || ""}>` : "").replace(r, t ? `</${t}>` : "");
|
|
3574
3640
|
}), i;
|
|
3575
|
-
},
|
|
3641
|
+
}, zr = (e) => {
|
|
3576
3642
|
if (!e) return { valid: !0 };
|
|
3577
|
-
let t = parseInt(
|
|
3643
|
+
let t = parseInt(D(e) ?? "", 10);
|
|
3578
3644
|
return isNaN(t) ? {
|
|
3579
3645
|
valid: !1,
|
|
3580
3646
|
error: "decimal places must be a number (e.g., round:2)"
|
|
@@ -3582,7 +3648,7 @@ var Dr = (e) => f(e).replace(/\\(.)/g, "$1"), Or = (e, t = "") => {
|
|
|
3582
3648
|
valid: !1,
|
|
3583
3649
|
error: "decimal places must be non-negative (e.g., round:2)"
|
|
3584
3650
|
} : { valid: !0 };
|
|
3585
|
-
},
|
|
3651
|
+
}, Br = (e, t, n) => {
|
|
3586
3652
|
let r = (e, t) => {
|
|
3587
3653
|
if (t === void 0) {
|
|
3588
3654
|
let t = Math.round(e);
|
|
@@ -3597,13 +3663,13 @@ var Dr = (e) => f(e).replace(/\\(.)/g, "$1"), Or = (e, t = "") => {
|
|
|
3597
3663
|
return n === void 0 ? (i = !0, e) : n;
|
|
3598
3664
|
}
|
|
3599
3665
|
if (typeof e == "string") {
|
|
3600
|
-
let n =
|
|
3666
|
+
let n = Xt(e);
|
|
3601
3667
|
if (n === void 0) return e;
|
|
3602
3668
|
let a = r(n, t);
|
|
3603
3669
|
return a === void 0 ? (i = !0, e) : a;
|
|
3604
3670
|
}
|
|
3605
3671
|
if (Array.isArray(e)) return e.map((e) => a(e, t));
|
|
3606
|
-
if (
|
|
3672
|
+
if (q(e)) {
|
|
3607
3673
|
let n = {};
|
|
3608
3674
|
for (let [r, i] of Object.entries(e)) n[r] = a(i, t);
|
|
3609
3675
|
return n;
|
|
@@ -3611,34 +3677,34 @@ var Dr = (e) => f(e).replace(/\\(.)/g, "$1"), Or = (e, t = "") => {
|
|
|
3611
3677
|
return e;
|
|
3612
3678
|
};
|
|
3613
3679
|
try {
|
|
3614
|
-
let o =
|
|
3615
|
-
if (o !== void 0 && isNaN(Number(o))) return
|
|
3616
|
-
let c =
|
|
3680
|
+
let o = D(t), s = o ? parseInt(o, 10) : void 0;
|
|
3681
|
+
if (o !== void 0 && isNaN(Number(o))) return Y(e, n, !0);
|
|
3682
|
+
let c = Y(e, n, !0);
|
|
3617
3683
|
if (c == null) return c;
|
|
3618
|
-
if (!Array.isArray(c) && !
|
|
3619
|
-
let t =
|
|
3620
|
-
if (t === void 0) return
|
|
3684
|
+
if (!Array.isArray(c) && !q(c)) {
|
|
3685
|
+
let t = Xt(c);
|
|
3686
|
+
if (t === void 0) return k(n, `Could not parse "${e}" as a number`, "INVALID_FILTER_INPUT"), c;
|
|
3621
3687
|
let i = r(t, s);
|
|
3622
|
-
return i === void 0 ? (
|
|
3688
|
+
return i === void 0 ? (k(n, `Rounding produced a non-finite result for "${e}"`, "INVALID_FILTER_INPUT"), c) : i;
|
|
3623
3689
|
}
|
|
3624
3690
|
let l = a(c, s);
|
|
3625
|
-
return i &&
|
|
3691
|
+
return i && k(n, "Could not round one or more non-finite collection values", "INVALID_FILTER_INPUT"), l;
|
|
3626
3692
|
} catch (t) {
|
|
3627
|
-
return
|
|
3693
|
+
return k(n, `Could not round value: ${A(t)}`), Y(e, n, !0);
|
|
3628
3694
|
}
|
|
3629
|
-
},
|
|
3695
|
+
}, Vr = [
|
|
3630
3696
|
"windows",
|
|
3631
3697
|
"mac",
|
|
3632
3698
|
"linux"
|
|
3633
|
-
],
|
|
3699
|
+
], Hr = (e) => {
|
|
3634
3700
|
if (!e) return { valid: !0 };
|
|
3635
|
-
let t =
|
|
3636
|
-
return !t || !
|
|
3701
|
+
let t = D(e)?.toLowerCase();
|
|
3702
|
+
return !t || !Vr.includes(t) ? {
|
|
3637
3703
|
valid: !1,
|
|
3638
3704
|
error: `invalid OS "${t ?? ""}". Use "windows", "mac", or "linux"`
|
|
3639
3705
|
} : { valid: !0 };
|
|
3640
|
-
},
|
|
3641
|
-
let n =
|
|
3706
|
+
}, Ur = (e, t) => {
|
|
3707
|
+
let n = D(t)?.toLowerCase() ?? "default", r = e;
|
|
3642
3708
|
switch (r = r.replace(/[#|\^\[\]]/g, ""), n) {
|
|
3643
3709
|
case "windows":
|
|
3644
3710
|
r = r.replace(/[<>:"\/\\|?*\x00-\x1F]/g, "").replace(/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i, "_$1$2").replace(/[\s.]+$/, "");
|
|
@@ -3652,12 +3718,12 @@ var Dr = (e) => f(e).replace(/\\(.)/g, "$1"), Or = (e, t = "") => {
|
|
|
3652
3718
|
default: r = r.replace(/[<>:"\/\\|?*:\x00-\x1F]/g, "").replace(/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i, "_$1$2").replace(/[\s.]+$/, "").replace(/^\./, "_");
|
|
3653
3719
|
}
|
|
3654
3720
|
return r = r.replace(/^\.+/, "").slice(0, 245), r.length === 0 && (r = "Untitled"), r;
|
|
3655
|
-
},
|
|
3721
|
+
}, Wr = (e) => O(x(e)).map(T), Gr = (e) => {
|
|
3656
3722
|
if (!e) return {
|
|
3657
3723
|
valid: !1,
|
|
3658
3724
|
error: "requires at least a start index (e.g., slice:0,5)"
|
|
3659
3725
|
};
|
|
3660
|
-
let t =
|
|
3726
|
+
let t = Wr(e);
|
|
3661
3727
|
if (t.length > 2) return {
|
|
3662
3728
|
valid: !1,
|
|
3663
3729
|
error: "accepts at most 2 parameters: start and end"
|
|
@@ -3667,9 +3733,9 @@ var Dr = (e) => f(e).replace(/\\(.)/g, "$1"), Or = (e, t = "") => {
|
|
|
3667
3733
|
error: `"${e}" is not a valid number`
|
|
3668
3734
|
};
|
|
3669
3735
|
return { valid: !0 };
|
|
3670
|
-
},
|
|
3736
|
+
}, Kr = (e, t, n) => {
|
|
3671
3737
|
if (!t || e === "") return e;
|
|
3672
|
-
let [r, i] =
|
|
3738
|
+
let [r, i] = Wr(t).map((e) => {
|
|
3673
3739
|
if (e === "") return;
|
|
3674
3740
|
let t = parseInt(e, 10);
|
|
3675
3741
|
return isNaN(t) ? void 0 : t;
|
|
@@ -3677,25 +3743,25 @@ var Dr = (e) => f(e).replace(/\\(.)/g, "$1"), Or = (e, t = "") => {
|
|
|
3677
3743
|
try {
|
|
3678
3744
|
a = JSON.parse(e);
|
|
3679
3745
|
} catch {
|
|
3680
|
-
(e.startsWith("[") || e.startsWith("{")) &&
|
|
3746
|
+
(e.startsWith("[") || e.startsWith("{")) && k(n, "Could not parse structured value as JSON", "INVALID_FILTER_INPUT"), a = e;
|
|
3681
3747
|
}
|
|
3682
3748
|
if (Array.isArray(a)) {
|
|
3683
3749
|
let e = a.slice(r, i);
|
|
3684
3750
|
return e.length === 1 ? e[0] == null ? "" : e[0].toString() : JSON.stringify(e);
|
|
3685
3751
|
}
|
|
3686
3752
|
return e.slice(r, i);
|
|
3687
|
-
},
|
|
3688
|
-
function
|
|
3753
|
+
}, qr = (e) => e.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase();
|
|
3754
|
+
function Jr(e) {
|
|
3689
3755
|
if (!e) return { direction: "asc" };
|
|
3690
|
-
let t =
|
|
3756
|
+
let t = O(x(e)).map(T);
|
|
3691
3757
|
return t.length === 1 && (t[0] === "asc" || t[0] === "desc") ? { direction: t[0] } : {
|
|
3692
3758
|
property: t[0] || void 0,
|
|
3693
3759
|
direction: t[1] || "asc"
|
|
3694
3760
|
};
|
|
3695
3761
|
}
|
|
3696
|
-
var
|
|
3762
|
+
var Yr = (e) => {
|
|
3697
3763
|
if (!e) return { valid: !0 };
|
|
3698
|
-
let t =
|
|
3764
|
+
let t = O(x(e)).map(T);
|
|
3699
3765
|
if (t.length > 2) return {
|
|
3700
3766
|
valid: !1,
|
|
3701
3767
|
error: "accepts at most a property and direction"
|
|
@@ -3710,10 +3776,10 @@ var zr = (e) => {
|
|
|
3710
3776
|
error: `invalid direction "${n}". Use "asc" or "desc"`
|
|
3711
3777
|
} : { valid: !0 };
|
|
3712
3778
|
};
|
|
3713
|
-
function
|
|
3779
|
+
function Xr(e, t) {
|
|
3714
3780
|
return t ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e;
|
|
3715
3781
|
}
|
|
3716
|
-
function
|
|
3782
|
+
function Zr(e, t) {
|
|
3717
3783
|
if (e === t) return 0;
|
|
3718
3784
|
if (e == null) return 1;
|
|
3719
3785
|
if (t == null) return -1;
|
|
@@ -3721,27 +3787,27 @@ function Vr(e, t) {
|
|
|
3721
3787
|
let n = typeof e == "string" ? e : JSON.stringify(e), r = typeof t == "string" ? t : JSON.stringify(t);
|
|
3722
3788
|
return n < r ? -1 : +(n > r);
|
|
3723
3789
|
}
|
|
3724
|
-
var
|
|
3725
|
-
let r =
|
|
3790
|
+
var Qr = (e, t, n) => {
|
|
3791
|
+
let r = J(e, n);
|
|
3726
3792
|
if (!Array.isArray(r)) return r;
|
|
3727
|
-
let { property: i, direction: a } =
|
|
3793
|
+
let { property: i, direction: a } = Jr(t);
|
|
3728
3794
|
return [...r].sort((e, t) => {
|
|
3729
|
-
let n =
|
|
3795
|
+
let n = Xr(e, i), r = Xr(t, i), o = Zr(n, r);
|
|
3730
3796
|
return n == null || r == null ? o : a === "desc" ? -o : o;
|
|
3731
3797
|
});
|
|
3732
|
-
},
|
|
3798
|
+
}, $r = (e, t, n) => {
|
|
3733
3799
|
if (!t || t === "") return JSON.stringify(e.split(""));
|
|
3734
|
-
t =
|
|
3800
|
+
t = E(t) ?? "";
|
|
3735
3801
|
let r = t.length === 1 || n?.allowRegex === !1 ? t : new RegExp(t), i = e.split(r);
|
|
3736
3802
|
return JSON.stringify(i);
|
|
3737
|
-
},
|
|
3803
|
+
}, ei = (e) => {
|
|
3738
3804
|
if (!e) return { valid: !0 };
|
|
3739
|
-
let t =
|
|
3805
|
+
let t = O(x(e));
|
|
3740
3806
|
if (t.length !== 1) return {
|
|
3741
3807
|
valid: !1,
|
|
3742
3808
|
error: "accepts at most one property path"
|
|
3743
3809
|
};
|
|
3744
|
-
let n =
|
|
3810
|
+
let n = S(t[0]);
|
|
3745
3811
|
return n ? n.split(".").some((e) => e === "") ? {
|
|
3746
3812
|
valid: !1,
|
|
3747
3813
|
error: "property path cannot contain empty segments"
|
|
@@ -3749,25 +3815,25 @@ var Hr = (e, t, n) => {
|
|
|
3749
3815
|
valid: !1,
|
|
3750
3816
|
error: "property path cannot be empty"
|
|
3751
3817
|
};
|
|
3752
|
-
},
|
|
3753
|
-
let r =
|
|
3818
|
+
}, ti = (e, t, n) => {
|
|
3819
|
+
let r = Y(e, n);
|
|
3754
3820
|
if (!Array.isArray(r)) return r;
|
|
3755
|
-
let i = (n?.rawArguments ??
|
|
3821
|
+
let i = (n?.rawArguments ?? re(t) ?? [])[0];
|
|
3756
3822
|
if (i !== void 0 && (typeof i != "string" || !i)) return r;
|
|
3757
3823
|
let a = 0;
|
|
3758
3824
|
for (let e of r) {
|
|
3759
3825
|
let t = e;
|
|
3760
3826
|
if (typeof i == "string") {
|
|
3761
|
-
let n =
|
|
3827
|
+
let n = St(e, i);
|
|
3762
3828
|
if (!n.exists) continue;
|
|
3763
3829
|
t = n.value;
|
|
3764
3830
|
}
|
|
3765
|
-
let n =
|
|
3831
|
+
let n = Xt(t);
|
|
3766
3832
|
n !== void 0 && (a += n);
|
|
3767
3833
|
}
|
|
3768
3834
|
return a;
|
|
3769
|
-
},
|
|
3770
|
-
let n =
|
|
3835
|
+
}, ni = (e, t = "") => {
|
|
3836
|
+
let n = te(t).filter(Boolean);
|
|
3771
3837
|
return e.replace(/<(\w+)\s+(?:[^>]*?)>/g, (e, t) => {
|
|
3772
3838
|
if (n.length === 0) return `<${t}>`;
|
|
3773
3839
|
let r = n.map((t) => {
|
|
@@ -3776,8 +3842,8 @@ var Hr = (e, t, n) => {
|
|
|
3776
3842
|
}).filter(Boolean).join(" ");
|
|
3777
3843
|
return r ? `<${t} ${r}>` : `<${t}>`;
|
|
3778
3844
|
});
|
|
3779
|
-
},
|
|
3780
|
-
let n =
|
|
3845
|
+
}, ri = (e, t = "") => {
|
|
3846
|
+
let n = te(t).filter(Boolean), r;
|
|
3781
3847
|
if (n.length === 0) r = e.replace(/<\/?[^>]+(>|$)/g, "");
|
|
3782
3848
|
else {
|
|
3783
3849
|
let t = n.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), i = RegExp(`<(?!\\/?(?:${t})\\b)[^>]+>`, "gi");
|
|
@@ -3785,68 +3851,68 @@ var Hr = (e, t, n) => {
|
|
|
3785
3851
|
}
|
|
3786
3852
|
return r = r.replace(/ /g, " ").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/'/g, "'").replace(/“/g, "\"").replace(/”/g, "\"").replace(/‘/g, "'").replace(/’/g, "'").replace(/—/g, "—").replace(/–/g, "–").replace(/…/g, "…").replace(/&#(\d+);/g, (e, t) => String.fromCharCode(Number(t))).replace(/&#x([0-9A-Fa-f]+);/g, (e, t) => String.fromCharCode(parseInt(t, 16))), r = r.replace(/\n{3,}/g, "\n\n"), r.trim();
|
|
3787
3853
|
};
|
|
3788
|
-
function
|
|
3789
|
-
return e ?
|
|
3854
|
+
function ii(e) {
|
|
3855
|
+
return e ? O(x(e)).map(S) : [];
|
|
3790
3856
|
}
|
|
3791
|
-
var
|
|
3792
|
-
function
|
|
3857
|
+
var ai = (e) => e.replace(/\|/g, "\\|"), oi = (e) => Array.from(e).length, si = (e, t) => `${e}${" ".repeat(t - oi(e))}`;
|
|
3858
|
+
function ci(e, t, n) {
|
|
3793
3859
|
let r = n;
|
|
3794
|
-
for (let n of e) r = Math.max(r,
|
|
3860
|
+
for (let n of e) r = Math.max(r, oi(n[t]));
|
|
3795
3861
|
return r;
|
|
3796
3862
|
}
|
|
3797
|
-
function
|
|
3863
|
+
function li(e) {
|
|
3798
3864
|
let t = 0;
|
|
3799
3865
|
for (let n of e) t = Math.max(t, n.length);
|
|
3800
3866
|
return t;
|
|
3801
3867
|
}
|
|
3802
|
-
function
|
|
3803
|
-
let r = e.length, i = e.map((e) =>
|
|
3868
|
+
function ui(e, t, n) {
|
|
3869
|
+
let r = e.length, i = e.map((e) => ai(String(e))), a = t.map((e) => [...e, ...Array(Math.max(0, r - e.length)).fill("")].slice(0, r).map((e) => ai(String(e))));
|
|
3804
3870
|
if (!n) return [
|
|
3805
3871
|
`| ${i.join(" | ")} |`,
|
|
3806
3872
|
`| ${i.map(() => "-").join(" | ")} |`,
|
|
3807
3873
|
...a.map((e) => `| ${e.join(" | ")} |`)
|
|
3808
3874
|
].join("\n");
|
|
3809
|
-
let o = i.map((e, t) =>
|
|
3875
|
+
let o = i.map((e, t) => ci(a, t, Math.max(3, oi(e)))), s = (e) => `| ${e.map((e, t) => si(e, o[t])).join(" | ")} |`;
|
|
3810
3876
|
return [
|
|
3811
3877
|
s(i),
|
|
3812
3878
|
`| ${o.map((e) => "-".repeat(e)).join(" | ")} |`,
|
|
3813
3879
|
...a.map(s)
|
|
3814
3880
|
].join("\n");
|
|
3815
3881
|
}
|
|
3816
|
-
var
|
|
3882
|
+
var di = (e, t, n, r) => {
|
|
3817
3883
|
if (!e || e === "undefined" || e === "null") return e;
|
|
3818
3884
|
try {
|
|
3819
|
-
let n = JSON.parse(e), i =
|
|
3885
|
+
let n = JSON.parse(e), i = ii(t);
|
|
3820
3886
|
if (typeof n == "object" && n && !Array.isArray(n)) {
|
|
3821
3887
|
let t = Object.entries(n);
|
|
3822
|
-
return t.length === 0 ? e :
|
|
3888
|
+
return t.length === 0 ? e : ui(t[0], t.slice(1), r);
|
|
3823
3889
|
}
|
|
3824
3890
|
if (Array.isArray(n) && n.length > 0 && Array.isArray(n[0])) {
|
|
3825
|
-
let e =
|
|
3826
|
-
return
|
|
3891
|
+
let e = li(n);
|
|
3892
|
+
return ui(i.length > 0 ? [...i, ...Array(Math.max(0, e - i.length)).fill("")] : Array(e).fill(""), n, r);
|
|
3827
3893
|
}
|
|
3828
3894
|
if (Array.isArray(n) && n.length > 0 && typeof n[0] == "object" && n[0] !== null) {
|
|
3829
3895
|
let e = i.length > 0 ? i : Object.keys(n[0]);
|
|
3830
|
-
return
|
|
3896
|
+
return ui(e, n.map((t) => e.map((e) => t[e] ?? "")), r);
|
|
3831
3897
|
}
|
|
3832
3898
|
if (Array.isArray(n)) {
|
|
3833
3899
|
if (i.length > 0) {
|
|
3834
3900
|
let e = [];
|
|
3835
3901
|
for (let t = 0; t < n.length; t += i.length) e.push(n.slice(t, t + i.length));
|
|
3836
|
-
return
|
|
3902
|
+
return ui(i, e, r);
|
|
3837
3903
|
}
|
|
3838
|
-
return
|
|
3904
|
+
return ui(["Value"], n.map((e) => [e]), r);
|
|
3839
3905
|
}
|
|
3840
3906
|
return e;
|
|
3841
3907
|
} catch {
|
|
3842
|
-
return
|
|
3908
|
+
return k(n, "Could not parse value as JSON table data", "INVALID_FILTER_INPUT"), e;
|
|
3843
3909
|
}
|
|
3844
|
-
},
|
|
3910
|
+
}, fi = (e, t, n) => di(e, t, n, !1), pi = (e, t, n) => di(e, t, n, !0), mi = (e) => e ? { valid: !0 } : {
|
|
3845
3911
|
valid: !1,
|
|
3846
3912
|
error: "requires a template string (e.g., template:\"${name}\")"
|
|
3847
|
-
},
|
|
3913
|
+
}, hi = (e, t) => {
|
|
3848
3914
|
if (!t) return typeof e == "string" ? e : JSON.stringify(e);
|
|
3849
|
-
t =
|
|
3915
|
+
t = E(t) ?? "";
|
|
3850
3916
|
let n = [];
|
|
3851
3917
|
if (typeof e == "string") try {
|
|
3852
3918
|
n = JSON.parse(e);
|
|
@@ -3854,23 +3920,23 @@ var ti = (e, t, n, r) => {
|
|
|
3854
3920
|
n = [e];
|
|
3855
3921
|
}
|
|
3856
3922
|
else n = e;
|
|
3857
|
-
return n = Array.isArray(n) ? n : [n], n.map((e) =>
|
|
3923
|
+
return n = Array.isArray(n) ? n : [n], n.map((e) => gi(e, t)).join("\n\n");
|
|
3858
3924
|
};
|
|
3859
|
-
function
|
|
3925
|
+
function gi(e, t) {
|
|
3860
3926
|
if (typeof e == "string") {
|
|
3861
3927
|
let t = e;
|
|
3862
3928
|
try {
|
|
3863
|
-
e =
|
|
3929
|
+
e = _i(e);
|
|
3864
3930
|
} catch {}
|
|
3865
3931
|
e.str === void 0 && (e.str = t);
|
|
3866
3932
|
}
|
|
3867
3933
|
let n = t.replace(/\$\{([\w.]+)\}/g, (t, n) => {
|
|
3868
|
-
let r =
|
|
3934
|
+
let r = vi(e, n);
|
|
3869
3935
|
return r !== void 0 && r !== "undefined" ? r : "";
|
|
3870
3936
|
});
|
|
3871
3937
|
return n = n.replace(/\\n/g, "\n"), n = n.split("\n").filter((e) => e.trim() !== "").join("\n"), n.trim();
|
|
3872
3938
|
}
|
|
3873
|
-
function
|
|
3939
|
+
function _i(e) {
|
|
3874
3940
|
let t = /* @__PURE__ */ Object.create(null), n = /(\w+):\s*("(?:\\.|[^"\\])*"|[^,}]+)/g, r;
|
|
3875
3941
|
for (; (r = n.exec(e)) !== null;) {
|
|
3876
3942
|
let [, e, n] = r;
|
|
@@ -3878,10 +3944,10 @@ function si(e) {
|
|
|
3878
3944
|
}
|
|
3879
3945
|
return t;
|
|
3880
3946
|
}
|
|
3881
|
-
function
|
|
3882
|
-
return
|
|
3947
|
+
function vi(e, t) {
|
|
3948
|
+
return St(e, t).value;
|
|
3883
3949
|
}
|
|
3884
|
-
var
|
|
3950
|
+
var yi = [
|
|
3885
3951
|
"a",
|
|
3886
3952
|
"an",
|
|
3887
3953
|
"the",
|
|
@@ -3897,8 +3963,8 @@ var li = [
|
|
|
3897
3963
|
"by",
|
|
3898
3964
|
"in",
|
|
3899
3965
|
"of"
|
|
3900
|
-
],
|
|
3901
|
-
let n = (e) => e.split(/\s+/).map((e, t) => t !== 0 &&
|
|
3966
|
+
], bi = (e, t) => {
|
|
3967
|
+
let n = (e) => e.split(/\s+/).map((e, t) => t !== 0 && yi.includes(e.toLowerCase()) ? e.toLowerCase() : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" "), r = (e) => {
|
|
3902
3968
|
if (typeof e == "string") return n(e);
|
|
3903
3969
|
if (Array.isArray(e)) return e.map(r);
|
|
3904
3970
|
if (typeof e == "object" && e) {
|
|
@@ -3914,22 +3980,22 @@ var li = [
|
|
|
3914
3980
|
} catch {
|
|
3915
3981
|
return r(e);
|
|
3916
3982
|
}
|
|
3917
|
-
},
|
|
3918
|
-
function
|
|
3919
|
-
return [...
|
|
3983
|
+
}, xi = (e) => e.trim(), Si = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
3984
|
+
function Ci(e) {
|
|
3985
|
+
return [...Si.segment(e)].map((e) => e.segment);
|
|
3920
3986
|
}
|
|
3921
|
-
function
|
|
3922
|
-
return e ?
|
|
3987
|
+
function wi(e) {
|
|
3988
|
+
return e ? O(x(e)).map(T) : [];
|
|
3923
3989
|
}
|
|
3924
|
-
function
|
|
3925
|
-
let t =
|
|
3990
|
+
function Ti(e) {
|
|
3991
|
+
let t = wi(e);
|
|
3926
3992
|
return {
|
|
3927
3993
|
limit: Number.parseInt(t[0] ?? "0", 10),
|
|
3928
3994
|
suffix: t[1] ?? "…"
|
|
3929
3995
|
};
|
|
3930
3996
|
}
|
|
3931
|
-
function
|
|
3932
|
-
let n =
|
|
3997
|
+
function Ei(e, t) {
|
|
3998
|
+
let n = wi(e);
|
|
3933
3999
|
return n.length === 0 || n[0] === "" ? {
|
|
3934
4000
|
valid: !1,
|
|
3935
4001
|
error: `requires a non-negative limit (e.g., ${t})`
|
|
@@ -3941,26 +4007,26 @@ function gi(e, t) {
|
|
|
3941
4007
|
error: "limit must be a non-negative integer"
|
|
3942
4008
|
};
|
|
3943
4009
|
}
|
|
3944
|
-
var
|
|
3945
|
-
function
|
|
4010
|
+
var Di = (e) => Ei(e, "truncate:100"), Oi = (e) => Ei(e, "truncatewords:20");
|
|
4011
|
+
function ki(e, t) {
|
|
3946
4012
|
if (t.limit === 0) return "";
|
|
3947
|
-
let n =
|
|
4013
|
+
let n = Ci(e);
|
|
3948
4014
|
if (n.length <= t.limit) return e;
|
|
3949
|
-
let r =
|
|
4015
|
+
let r = Ci(t.suffix).slice(0, t.limit), i = Math.max(0, t.limit - r.length);
|
|
3950
4016
|
return `${n.slice(0, i).join("")}${r.join("")}`;
|
|
3951
4017
|
}
|
|
3952
|
-
function
|
|
4018
|
+
function Ai(e, t) {
|
|
3953
4019
|
if (t.limit === 0) return "";
|
|
3954
4020
|
let n = [...e.matchAll(/\S+/g)];
|
|
3955
4021
|
if (n.length <= t.limit) return e;
|
|
3956
4022
|
let r = n[t.limit - 1];
|
|
3957
4023
|
return `${e.slice(0, r.index + r[0].length)}${t.suffix}`;
|
|
3958
4024
|
}
|
|
3959
|
-
function
|
|
3960
|
-
let i =
|
|
3961
|
-
return
|
|
4025
|
+
function ji(e, t, n, r) {
|
|
4026
|
+
let i = Ti(t);
|
|
4027
|
+
return X(J(e, n), (e) => r(e, i));
|
|
3962
4028
|
}
|
|
3963
|
-
var
|
|
4029
|
+
var Mi = (e, t, n) => ji(e, t, n, ki), Ni = (e, t, n) => ji(e, t, n, Ai), Pi = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z])([A-Z][a-z])/g, "$1 $2").toLowerCase(), Fi = (e) => e.replace(/\\"/g, "\"").replace(/\\n/g, "\n"), Ii = (e) => {
|
|
3964
4030
|
try {
|
|
3965
4031
|
let t = JSON.parse(e);
|
|
3966
4032
|
if (Array.isArray(t)) {
|
|
@@ -3982,13 +4048,13 @@ var Si = (e, t, n) => xi(e, t, n, yi), Ci = (e, t, n) => xi(e, t, n, bi), wi = (
|
|
|
3982
4048
|
} catch {
|
|
3983
4049
|
return e;
|
|
3984
4050
|
}
|
|
3985
|
-
},
|
|
4051
|
+
}, Li = (e) => {
|
|
3986
4052
|
let t = (e) => e.toLocaleUpperCase();
|
|
3987
4053
|
return Array.isArray(e) ? e.map(t) : t(e);
|
|
3988
|
-
},
|
|
4054
|
+
}, Ri = (e, t, n) => {
|
|
3989
4055
|
if (!e.trim()) return e;
|
|
3990
4056
|
let r = "";
|
|
3991
|
-
t && (r =
|
|
4057
|
+
t && (r = E(t) ?? r);
|
|
3992
4058
|
try {
|
|
3993
4059
|
let t = JSON.parse(e), i = (e) => Object.entries(e).map(([e, t]) => typeof t == "object" && t ? i(t) : `${n}[[${e}|${t}]]`).flat();
|
|
3994
4060
|
if (Array.isArray(t)) {
|
|
@@ -4000,111 +4066,111 @@ var Si = (e, t, n) => xi(e, t, n, yi), Ci = (e, t, n) => xi(e, t, n, bi), wi = (
|
|
|
4000
4066
|
return r ? `${n}[[${e}|${r}]]` : `${n}[[${e}]]`;
|
|
4001
4067
|
}
|
|
4002
4068
|
return e;
|
|
4003
|
-
},
|
|
4004
|
-
|
|
4005
|
-
var
|
|
4069
|
+
}, zi = (e, t, n) => Ri(Array.isArray(n?.rawValue) ? JSON.stringify(n.rawValue) : e, t, ""), Bi = (e, t, n) => Ri(Array.isArray(n?.rawValue) ? JSON.stringify(n.rawValue) : e, t, "!");
|
|
4070
|
+
j.default.extend(he.default);
|
|
4071
|
+
var Vi = (e, t, n) => {
|
|
4006
4072
|
if (!e) return e;
|
|
4007
4073
|
try {
|
|
4008
4074
|
e = e.replace(/^["'](.*)["']$/g, "$1");
|
|
4009
4075
|
let n = e.match(/^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/);
|
|
4010
4076
|
if (!n) {
|
|
4011
4077
|
let n = parseInt(e, 10);
|
|
4012
|
-
return isNaN(n) ? e :
|
|
4078
|
+
return isNaN(n) ? e : Hi(j.default.duration(n, "seconds"), t);
|
|
4013
4079
|
}
|
|
4014
4080
|
let [, r, i, a, o, s, c] = n, l = (r ? parseInt(r) * 365 * 24 * 3600 : 0) + (i ? parseInt(i) * 30 * 24 * 3600 : 0) + (a ? parseInt(a) * 24 * 3600 : 0) + (o ? parseInt(o) * 3600 : 0) + (s ? parseInt(s) * 60 : 0) + (c ? parseInt(c) : 0);
|
|
4015
|
-
return
|
|
4081
|
+
return Hi(j.default.duration(l, "seconds"), t);
|
|
4016
4082
|
} catch (t) {
|
|
4017
|
-
return
|
|
4083
|
+
return k(n, `Could not format duration: ${A(t)}`), e;
|
|
4018
4084
|
}
|
|
4019
4085
|
};
|
|
4020
|
-
function
|
|
4086
|
+
function Hi(e, t) {
|
|
4021
4087
|
t ||= e.asHours() >= 1 ? "HH:mm:ss" : "mm:ss", t = t.replace(/^["'(](.*)["')]$/g, "$1");
|
|
4022
4088
|
let n = Math.floor(e.asHours()), r = e.minutes(), i = e.seconds(), a = {
|
|
4023
|
-
HH:
|
|
4089
|
+
HH: Ui(n),
|
|
4024
4090
|
H: n.toString(),
|
|
4025
|
-
mm:
|
|
4091
|
+
mm: Ui(r),
|
|
4026
4092
|
m: r.toString(),
|
|
4027
|
-
ss:
|
|
4093
|
+
ss: Ui(i),
|
|
4028
4094
|
s: i.toString()
|
|
4029
4095
|
};
|
|
4030
4096
|
return t.replace(/HH|H|mm|m|ss|s/g, (e) => a[e].toString());
|
|
4031
4097
|
}
|
|
4032
|
-
function
|
|
4098
|
+
function Ui(e) {
|
|
4033
4099
|
return e.toString().padStart(2, "0");
|
|
4034
4100
|
}
|
|
4035
|
-
var
|
|
4101
|
+
var Wi = (e) => !e || D(e) === "flow" ? { valid: !0 } : {
|
|
4036
4102
|
valid: !1,
|
|
4037
4103
|
error: "accepts only \"flow\"; omit the parameter for block YAML"
|
|
4038
4104
|
};
|
|
4039
|
-
function
|
|
4105
|
+
function Gi(e) {
|
|
4040
4106
|
if (!e) return;
|
|
4041
|
-
let t =
|
|
4042
|
-
return t.length === 1 ?
|
|
4107
|
+
let t = O(x(e));
|
|
4108
|
+
return t.length === 1 ? T(t[0]) : void 0;
|
|
4043
4109
|
}
|
|
4044
|
-
var
|
|
4110
|
+
var Ki = (e) => Gi(e)?.trim() ? { valid: !0 } : {
|
|
4045
4111
|
valid: !1,
|
|
4046
4112
|
error: "requires one non-empty property name (e.g., yaml_property:\"director\")"
|
|
4047
4113
|
};
|
|
4048
|
-
function
|
|
4114
|
+
function qi(e) {
|
|
4049
4115
|
return JSON.stringify(e).replace(/[\u007f-\u009f\u2028\u2029]/g, (e) => `\\u${e.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
4050
4116
|
}
|
|
4051
|
-
function
|
|
4052
|
-
return /^[a-z_][\w-]*$/i.test(e) && !/^(?:true|false|null|yes|no|on|off|y|n)$/i.test(e) ? e :
|
|
4117
|
+
function Ji(e) {
|
|
4118
|
+
return /^[a-z_][\w-]*$/i.test(e) && !/^(?:true|false|null|yes|no|on|off|y|n)$/i.test(e) ? e : qi(e);
|
|
4053
4119
|
}
|
|
4054
|
-
function
|
|
4120
|
+
function Yi(e) {
|
|
4055
4121
|
return typeof e == "object" && !!e && Object.keys(e).length > 0;
|
|
4056
4122
|
}
|
|
4057
|
-
function
|
|
4058
|
-
if (Array.isArray(e)) return e.length === 0 ? "[]" : e.map((e) => `- ${
|
|
4123
|
+
function Xi(e) {
|
|
4124
|
+
if (Array.isArray(e)) return e.length === 0 ? "[]" : e.map((e) => `- ${Xi(e).replace(/\n/g, "\n ")}`).join("\n");
|
|
4059
4125
|
if (typeof e == "object" && e) {
|
|
4060
4126
|
let t = Object.entries(e);
|
|
4061
|
-
return t.length === 0 ? "{}" : t.map(([e, t]) =>
|
|
4062
|
-
${
|
|
4127
|
+
return t.length === 0 ? "{}" : t.map(([e, t]) => Yi(t) ? `${Ji(e)}:
|
|
4128
|
+
${Xi(t).replace(/\n/g, "\n ")}` : `${Ji(e)}: ${Xi(t)}`).join("\n");
|
|
4063
4129
|
}
|
|
4064
|
-
return
|
|
4130
|
+
return qi(e);
|
|
4065
4131
|
}
|
|
4066
|
-
function
|
|
4067
|
-
return typeof e == "number" ? !Number.isFinite(e) : Array.isArray(e) ? e.some(
|
|
4132
|
+
function Zi(e) {
|
|
4133
|
+
return typeof e == "number" ? !Number.isFinite(e) : Array.isArray(e) ? e.some(Zi) : typeof e == "object" && e ? Object.values(e).some(Zi) : !1;
|
|
4068
4134
|
}
|
|
4069
|
-
function
|
|
4135
|
+
function Qi(e, t) {
|
|
4070
4136
|
try {
|
|
4071
|
-
if ((Array.isArray(t?.rawValue) ||
|
|
4072
|
-
|
|
4137
|
+
if ((Array.isArray(t?.rawValue) || q(t?.rawValue)) && Zi(t.rawValue)) {
|
|
4138
|
+
k(t, "Could not serialize a collection containing a number outside the finite JavaScript range", "INVALID_FILTER_INPUT");
|
|
4073
4139
|
return;
|
|
4074
4140
|
}
|
|
4075
4141
|
let n = JSON.parse(Array.isArray(t?.rawValue) ? JSON.stringify(t.rawValue) : e);
|
|
4076
4142
|
if (typeof n == "object" && n) {
|
|
4077
|
-
if (
|
|
4078
|
-
|
|
4143
|
+
if (Zi(n)) {
|
|
4144
|
+
k(t, "Could not serialize a JSON collection containing a number outside the finite JavaScript range", "INVALID_FILTER_INPUT");
|
|
4079
4145
|
return;
|
|
4080
4146
|
}
|
|
4081
4147
|
return n;
|
|
4082
4148
|
}
|
|
4083
4149
|
} catch {}
|
|
4084
4150
|
}
|
|
4085
|
-
function
|
|
4151
|
+
function $i(e, t) {
|
|
4086
4152
|
let n = t?.rawValue;
|
|
4087
|
-
return
|
|
4153
|
+
return qi(n === null || typeof n == "boolean" || typeof n == "number" && Number.isFinite(n) ? n : e);
|
|
4088
4154
|
}
|
|
4089
|
-
var
|
|
4090
|
-
let r =
|
|
4091
|
-
return r ?
|
|
4092
|
-
},
|
|
4093
|
-
let r =
|
|
4155
|
+
var ea = (e, t, n) => {
|
|
4156
|
+
let r = Qi(e, n);
|
|
4157
|
+
return r ? D(t) === "flow" ? qi(r) : Xi(r) : $i(e, n);
|
|
4158
|
+
}, ta = (e, t, n) => {
|
|
4159
|
+
let r = Gi(t);
|
|
4094
4160
|
if (!r?.trim()) return e;
|
|
4095
|
-
let i =
|
|
4096
|
-
return i ?
|
|
4097
|
-
},
|
|
4161
|
+
let i = Qi(e, n);
|
|
4162
|
+
return i ? Xi({ [r]: i }) : `${Ji(r)}: ${$i(e, n)}`;
|
|
4163
|
+
}, na = (e) => {
|
|
4098
4164
|
if (!e) return {
|
|
4099
4165
|
valid: !1,
|
|
4100
4166
|
error: "requires a property path and value"
|
|
4101
4167
|
};
|
|
4102
|
-
let t =
|
|
4168
|
+
let t = O(x(e));
|
|
4103
4169
|
if (t.length !== 2) return {
|
|
4104
4170
|
valid: !1,
|
|
4105
4171
|
error: "requires exactly a property path and value"
|
|
4106
4172
|
};
|
|
4107
|
-
let n =
|
|
4173
|
+
let n = S(t[0]);
|
|
4108
4174
|
return n ? n.split(".").some((e) => e === "") ? {
|
|
4109
4175
|
valid: !1,
|
|
4110
4176
|
error: "property path cannot contain empty segments"
|
|
@@ -4113,86 +4179,86 @@ var Wi = (e, t, n) => {
|
|
|
4113
4179
|
error: "property path cannot be empty"
|
|
4114
4180
|
};
|
|
4115
4181
|
};
|
|
4116
|
-
function
|
|
4182
|
+
function ra(e) {
|
|
4117
4183
|
return e === null || [
|
|
4118
4184
|
"string",
|
|
4119
4185
|
"number",
|
|
4120
4186
|
"boolean"
|
|
4121
4187
|
].includes(typeof e);
|
|
4122
4188
|
}
|
|
4123
|
-
var
|
|
4124
|
-
let r =
|
|
4189
|
+
var ia = (e, t, n) => {
|
|
4190
|
+
let r = Y(e, n);
|
|
4125
4191
|
if (!Array.isArray(r)) return r;
|
|
4126
|
-
let [i, a] = n?.rawArguments ??
|
|
4127
|
-
return typeof i != "string" || !i || !
|
|
4128
|
-
let t =
|
|
4192
|
+
let [i, a] = n?.rawArguments ?? re(t) ?? [];
|
|
4193
|
+
return typeof i != "string" || !i || !ra(a) ? r : r.filter((e) => {
|
|
4194
|
+
let t = St(e, i);
|
|
4129
4195
|
return t.exists && t.value === a;
|
|
4130
4196
|
});
|
|
4131
|
-
},
|
|
4197
|
+
}, aa = Object.freeze(Object.fromEntries(Object.entries({
|
|
4132
4198
|
calc: {
|
|
4133
4199
|
example: "calc:\"+10\"",
|
|
4134
|
-
validateParams:
|
|
4200
|
+
validateParams: Pn
|
|
4135
4201
|
},
|
|
4136
4202
|
code: {
|
|
4137
4203
|
example: "code:\"typescript\"",
|
|
4138
|
-
validateParams:
|
|
4204
|
+
validateParams: Dn
|
|
4139
4205
|
},
|
|
4140
4206
|
code_block: {
|
|
4141
4207
|
example: "code_block:\"typescript\"",
|
|
4142
|
-
validateParams:
|
|
4208
|
+
validateParams: Dn
|
|
4143
4209
|
},
|
|
4144
4210
|
date_modify: {
|
|
4145
4211
|
example: "date_modify:\"+1 day\"",
|
|
4146
|
-
validateParams:
|
|
4212
|
+
validateParams: Un
|
|
4147
4213
|
},
|
|
4148
4214
|
hr: {
|
|
4149
4215
|
example: "hr:before",
|
|
4150
|
-
validateParams:
|
|
4216
|
+
validateParams: Sn
|
|
4151
4217
|
},
|
|
4152
4218
|
highlight: {
|
|
4153
4219
|
example: "highlight:blue",
|
|
4154
|
-
validateParams:
|
|
4220
|
+
validateParams: vn
|
|
4155
4221
|
},
|
|
4156
4222
|
map: {
|
|
4157
4223
|
example: "map:x => x.name",
|
|
4158
|
-
validateParams:
|
|
4224
|
+
validateParams: mr
|
|
4159
4225
|
},
|
|
4160
4226
|
replace: {
|
|
4161
4227
|
example: "replace:\"old\":\"new\"",
|
|
4162
|
-
validateParams:
|
|
4228
|
+
validateParams: Mr
|
|
4163
4229
|
},
|
|
4164
4230
|
slice: {
|
|
4165
4231
|
example: "slice:0,5",
|
|
4166
|
-
validateParams:
|
|
4232
|
+
validateParams: Gr
|
|
4167
4233
|
},
|
|
4168
4234
|
sort: {
|
|
4169
4235
|
example: "sort:(\"name\", \"desc\")",
|
|
4170
|
-
validateParams:
|
|
4236
|
+
validateParams: Yr
|
|
4171
4237
|
},
|
|
4172
4238
|
sum: {
|
|
4173
4239
|
example: "sum:\"amount\"",
|
|
4174
|
-
validateParams:
|
|
4240
|
+
validateParams: ei
|
|
4175
4241
|
},
|
|
4176
4242
|
template: {
|
|
4177
4243
|
example: "template:\"${name}\"",
|
|
4178
|
-
validateParams:
|
|
4244
|
+
validateParams: mi
|
|
4179
4245
|
},
|
|
4180
4246
|
truncate: {
|
|
4181
4247
|
example: "truncate:(100, \"…\")",
|
|
4182
|
-
validateParams:
|
|
4248
|
+
validateParams: Di
|
|
4183
4249
|
},
|
|
4184
4250
|
truncatewords: {
|
|
4185
4251
|
example: "truncatewords:(20, \"…\")",
|
|
4186
|
-
validateParams:
|
|
4252
|
+
validateParams: Oi
|
|
4187
4253
|
},
|
|
4188
4254
|
where: {
|
|
4189
4255
|
example: "where:(\"published\", true)",
|
|
4190
|
-
validateParams:
|
|
4256
|
+
validateParams: na
|
|
4191
4257
|
},
|
|
4192
4258
|
blockquote: {},
|
|
4193
4259
|
bold: {
|
|
4194
4260
|
example: "bold:_",
|
|
4195
|
-
validateParams:
|
|
4261
|
+
validateParams: dn
|
|
4196
4262
|
},
|
|
4197
4263
|
callout: { example: "callout:info" },
|
|
4198
4264
|
camel: {},
|
|
@@ -4218,11 +4284,11 @@ var Ji = (e, t, n) => {
|
|
|
4218
4284
|
image: {},
|
|
4219
4285
|
indent: {
|
|
4220
4286
|
example: "indent:2",
|
|
4221
|
-
validateParams:
|
|
4287
|
+
validateParams: rr
|
|
4222
4288
|
},
|
|
4223
4289
|
italic: {
|
|
4224
4290
|
example: "italic:_",
|
|
4225
|
-
validateParams:
|
|
4291
|
+
validateParams: fn
|
|
4226
4292
|
},
|
|
4227
4293
|
join: { example: "join:\", \"" },
|
|
4228
4294
|
kebab: {},
|
|
@@ -4231,7 +4297,7 @@ var Ji = (e, t, n) => {
|
|
|
4231
4297
|
link: {},
|
|
4232
4298
|
list: {
|
|
4233
4299
|
example: "list:numbered",
|
|
4234
|
-
validateParams:
|
|
4300
|
+
validateParams: lr
|
|
4235
4301
|
},
|
|
4236
4302
|
lower: {},
|
|
4237
4303
|
math: {},
|
|
@@ -4239,12 +4305,12 @@ var Ji = (e, t, n) => {
|
|
|
4239
4305
|
merge: {},
|
|
4240
4306
|
nth: {
|
|
4241
4307
|
example: "nth:2",
|
|
4242
|
-
validateParams:
|
|
4308
|
+
validateParams: xr
|
|
4243
4309
|
},
|
|
4244
4310
|
number_format: {},
|
|
4245
4311
|
object: {
|
|
4246
4312
|
example: "object:\"keys\"",
|
|
4247
|
-
validateParams:
|
|
4313
|
+
validateParams: Tr
|
|
4248
4314
|
},
|
|
4249
4315
|
pascal: {},
|
|
4250
4316
|
parse_json: {},
|
|
@@ -4254,11 +4320,11 @@ var Ji = (e, t, n) => {
|
|
|
4254
4320
|
reverse: {},
|
|
4255
4321
|
round: {
|
|
4256
4322
|
example: "round:2",
|
|
4257
|
-
validateParams:
|
|
4323
|
+
validateParams: zr
|
|
4258
4324
|
},
|
|
4259
4325
|
safe_name: {
|
|
4260
4326
|
example: "safe_name:windows",
|
|
4261
|
-
validateParams:
|
|
4327
|
+
validateParams: Hr
|
|
4262
4328
|
},
|
|
4263
4329
|
snake: {},
|
|
4264
4330
|
split: { example: "split:\",\"" },
|
|
@@ -4278,125 +4344,125 @@ var Ji = (e, t, n) => {
|
|
|
4278
4344
|
wikilink: {},
|
|
4279
4345
|
yaml: {
|
|
4280
4346
|
example: "yaml:flow",
|
|
4281
|
-
validateParams:
|
|
4347
|
+
validateParams: Wi
|
|
4282
4348
|
},
|
|
4283
4349
|
yaml_property: {
|
|
4284
4350
|
example: "yaml_property:\"director\"",
|
|
4285
|
-
validateParams:
|
|
4351
|
+
validateParams: Ki
|
|
4286
4352
|
}
|
|
4287
|
-
}).map(([e, t]) => [e, Object.freeze({ ...t })]))),
|
|
4288
|
-
blockquote:
|
|
4289
|
-
bold:
|
|
4290
|
-
calc:
|
|
4291
|
-
callout:
|
|
4292
|
-
camel:
|
|
4293
|
-
capitalize:
|
|
4294
|
-
compact:
|
|
4295
|
-
code:
|
|
4296
|
-
code_block:
|
|
4297
|
-
comment:
|
|
4298
|
-
date_modify:
|
|
4299
|
-
date:
|
|
4300
|
-
decode_uri:
|
|
4301
|
-
duration:
|
|
4302
|
-
embed:
|
|
4303
|
-
encode_uri:
|
|
4304
|
-
escape_md:
|
|
4305
|
-
first:
|
|
4306
|
-
footnote:
|
|
4307
|
-
fragment_link:
|
|
4308
|
-
h1:
|
|
4309
|
-
h2:
|
|
4310
|
-
h3:
|
|
4311
|
-
h4:
|
|
4312
|
-
h5:
|
|
4313
|
-
h6:
|
|
4314
|
-
hard_break:
|
|
4315
|
-
highlight:
|
|
4316
|
-
hr:
|
|
4317
|
-
image:
|
|
4318
|
-
indent:
|
|
4319
|
-
italic:
|
|
4320
|
-
join:
|
|
4321
|
-
kebab:
|
|
4322
|
-
last:
|
|
4323
|
-
length:
|
|
4324
|
-
link:
|
|
4325
|
-
list:
|
|
4326
|
-
lower:
|
|
4327
|
-
map:
|
|
4328
|
-
math:
|
|
4329
|
-
math_block:
|
|
4330
|
-
merge:
|
|
4331
|
-
number_format:
|
|
4332
|
-
nth:
|
|
4333
|
-
object:
|
|
4334
|
-
pascal:
|
|
4335
|
-
parse_json:
|
|
4336
|
-
reverse:
|
|
4337
|
-
remove_attr:
|
|
4338
|
-
remove_tags:
|
|
4339
|
-
replace:
|
|
4340
|
-
replace_tags:
|
|
4341
|
-
round:
|
|
4342
|
-
safe_name:
|
|
4343
|
-
slice:
|
|
4344
|
-
snake:
|
|
4345
|
-
sort:
|
|
4346
|
-
split:
|
|
4347
|
-
sum:
|
|
4348
|
-
strip_attr:
|
|
4349
|
-
strip_md:
|
|
4350
|
-
strip_tags:
|
|
4351
|
-
stripmd:
|
|
4352
|
-
strike:
|
|
4353
|
-
table:
|
|
4354
|
-
table_pretty:
|
|
4355
|
-
template:
|
|
4356
|
-
title:
|
|
4357
|
-
trim:
|
|
4358
|
-
truncate:
|
|
4359
|
-
truncatewords:
|
|
4360
|
-
uncamel:
|
|
4361
|
-
unescape:
|
|
4362
|
-
unique:
|
|
4363
|
-
upper:
|
|
4364
|
-
wikilink:
|
|
4365
|
-
yaml:
|
|
4366
|
-
yaml_property:
|
|
4367
|
-
where:
|
|
4353
|
+
}).map(([e, t]) => [e, Object.freeze({ ...t })]))), oa = {
|
|
4354
|
+
blockquote: Yt,
|
|
4355
|
+
bold: pn,
|
|
4356
|
+
calc: Fn,
|
|
4357
|
+
callout: In,
|
|
4358
|
+
camel: Ln,
|
|
4359
|
+
capitalize: Rn,
|
|
4360
|
+
compact: Bn,
|
|
4361
|
+
code: On,
|
|
4362
|
+
code_block: kn,
|
|
4363
|
+
comment: Nn,
|
|
4364
|
+
date_modify: Wn,
|
|
4365
|
+
date: Vn,
|
|
4366
|
+
decode_uri: Kn,
|
|
4367
|
+
duration: Vi,
|
|
4368
|
+
embed: Bi,
|
|
4369
|
+
encode_uri: Jn,
|
|
4370
|
+
escape_md: cn,
|
|
4371
|
+
first: Yn,
|
|
4372
|
+
footnote: Xn,
|
|
4373
|
+
fragment_link: Qn,
|
|
4374
|
+
h1: en,
|
|
4375
|
+
h2: tn,
|
|
4376
|
+
h3: nn,
|
|
4377
|
+
h4: rn,
|
|
4378
|
+
h5: an,
|
|
4379
|
+
h6: on,
|
|
4380
|
+
hard_break: ln,
|
|
4381
|
+
highlight: yn,
|
|
4382
|
+
hr: Cn,
|
|
4383
|
+
image: tr,
|
|
4384
|
+
indent: ir,
|
|
4385
|
+
italic: mn,
|
|
4386
|
+
join: ar,
|
|
4387
|
+
kebab: or,
|
|
4388
|
+
last: sr,
|
|
4389
|
+
length: fr,
|
|
4390
|
+
link: dr,
|
|
4391
|
+
list: ur,
|
|
4392
|
+
lower: pr,
|
|
4393
|
+
map: _r,
|
|
4394
|
+
math: jn,
|
|
4395
|
+
math_block: Mn,
|
|
4396
|
+
merge: br,
|
|
4397
|
+
number_format: Cr,
|
|
4398
|
+
nth: Sr,
|
|
4399
|
+
object: Er,
|
|
4400
|
+
pascal: Dr,
|
|
4401
|
+
parse_json: Or,
|
|
4402
|
+
reverse: kr,
|
|
4403
|
+
remove_attr: Ar,
|
|
4404
|
+
remove_tags: jr,
|
|
4405
|
+
replace: Pr,
|
|
4406
|
+
replace_tags: Rr,
|
|
4407
|
+
round: Br,
|
|
4408
|
+
safe_name: Ur,
|
|
4409
|
+
slice: Kr,
|
|
4410
|
+
snake: qr,
|
|
4411
|
+
sort: Qr,
|
|
4412
|
+
split: $r,
|
|
4413
|
+
sum: ti,
|
|
4414
|
+
strip_attr: ni,
|
|
4415
|
+
strip_md: Zn,
|
|
4416
|
+
strip_tags: ri,
|
|
4417
|
+
stripmd: Zn,
|
|
4418
|
+
strike: hn,
|
|
4419
|
+
table: fi,
|
|
4420
|
+
table_pretty: pi,
|
|
4421
|
+
template: hi,
|
|
4422
|
+
title: bi,
|
|
4423
|
+
trim: xi,
|
|
4424
|
+
truncate: Mi,
|
|
4425
|
+
truncatewords: Ni,
|
|
4426
|
+
uncamel: Pi,
|
|
4427
|
+
unescape: Fi,
|
|
4428
|
+
unique: Ii,
|
|
4429
|
+
upper: Li,
|
|
4430
|
+
wikilink: zi,
|
|
4431
|
+
yaml: ea,
|
|
4432
|
+
yaml_property: ta,
|
|
4433
|
+
where: ia
|
|
4368
4434
|
};
|
|
4369
|
-
function
|
|
4435
|
+
function sa(e, t) {
|
|
4370
4436
|
let n = (e, n, r) => t(e, n === "" ? void 0 : n, r);
|
|
4371
|
-
return n.metadata =
|
|
4437
|
+
return n.metadata = aa[e] ?? {}, n;
|
|
4372
4438
|
}
|
|
4373
|
-
var
|
|
4439
|
+
var ca = Object.freeze(Object.fromEntries(Object.entries(oa).map(([e, t]) => [e, sa(e, t)])));
|
|
4374
4440
|
//#endregion
|
|
4375
4441
|
//#region src/client/components/charts/markdownTemplate.ts
|
|
4376
|
-
function
|
|
4442
|
+
function la(e) {
|
|
4377
4443
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").toLowerCase();
|
|
4378
4444
|
}
|
|
4379
|
-
function
|
|
4380
|
-
let t = e.split(".").map(
|
|
4445
|
+
function ua(e) {
|
|
4446
|
+
let t = e.split(".").map(la).filter(Boolean).join("_").replace(/_+/g, "_").replace(/^_|_$/g, "");
|
|
4381
4447
|
return t ? /^[0-9]/.test(t) ? `_${t}` : t : "field";
|
|
4382
4448
|
}
|
|
4383
|
-
function
|
|
4449
|
+
function da(e, t) {
|
|
4384
4450
|
if (!t.has(e)) return t.add(e), e;
|
|
4385
4451
|
let n = 2;
|
|
4386
4452
|
for (; t.has(`${e}_${n}`);) n++;
|
|
4387
4453
|
let r = `${e}_${n}`;
|
|
4388
4454
|
return t.add(r), r;
|
|
4389
4455
|
}
|
|
4390
|
-
function
|
|
4456
|
+
function fa(e) {
|
|
4391
4457
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
4392
4458
|
for (let r of e) for (let e of Object.keys(r)) n.has(e) || (n.add(e), t.push(e));
|
|
4393
4459
|
return t;
|
|
4394
4460
|
}
|
|
4395
|
-
function
|
|
4396
|
-
let n =
|
|
4461
|
+
function pa(e, t = (e) => e) {
|
|
4462
|
+
let n = fa(e), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = n.map((e) => ({
|
|
4397
4463
|
key: e,
|
|
4398
|
-
alias:
|
|
4399
|
-
label:
|
|
4464
|
+
alias: da(ua(e), r),
|
|
4465
|
+
label: da(ma(t, e), i)
|
|
4400
4466
|
})), o = (t) => e.map((e) => {
|
|
4401
4467
|
let n = {};
|
|
4402
4468
|
for (let r of a) r.key in e && (n[t(r)] = e[r.key]);
|
|
@@ -4412,14 +4478,14 @@ function ra(e, t = (e) => e) {
|
|
|
4412
4478
|
fields: a
|
|
4413
4479
|
};
|
|
4414
4480
|
}
|
|
4415
|
-
function
|
|
4481
|
+
function ma(e, t) {
|
|
4416
4482
|
try {
|
|
4417
4483
|
return e(t) || t;
|
|
4418
4484
|
} catch {
|
|
4419
4485
|
return t;
|
|
4420
4486
|
}
|
|
4421
4487
|
}
|
|
4422
|
-
var
|
|
4488
|
+
var ha = [
|
|
4423
4489
|
"rows",
|
|
4424
4490
|
"labelled",
|
|
4425
4491
|
"data",
|
|
@@ -4427,34 +4493,34 @@ var aa = [
|
|
|
4427
4493
|
"first",
|
|
4428
4494
|
"last",
|
|
4429
4495
|
"fields"
|
|
4430
|
-
],
|
|
4496
|
+
], ga = ["first", "last"], _a = [
|
|
4431
4497
|
"key",
|
|
4432
4498
|
"alias",
|
|
4433
4499
|
"label"
|
|
4434
4500
|
];
|
|
4435
|
-
function
|
|
4501
|
+
function va(e) {
|
|
4436
4502
|
return typeof e == "object" && !!e;
|
|
4437
4503
|
}
|
|
4438
|
-
function
|
|
4439
|
-
return
|
|
4504
|
+
function ya(e) {
|
|
4505
|
+
return va(e) && e.type === "identifier" && typeof e.name == "string";
|
|
4440
4506
|
}
|
|
4441
|
-
function
|
|
4442
|
-
if (Array.isArray(e)) for (let n of e)
|
|
4443
|
-
else if (
|
|
4507
|
+
function ba(e, t) {
|
|
4508
|
+
if (Array.isArray(e)) for (let n of e) ba(n, t);
|
|
4509
|
+
else if (va(e)) {
|
|
4444
4510
|
t(e);
|
|
4445
|
-
for (let n of Object.values(e))
|
|
4511
|
+
for (let n of Object.values(e)) ba(n, t);
|
|
4446
4512
|
}
|
|
4447
4513
|
}
|
|
4448
|
-
function
|
|
4514
|
+
function xa(e) {
|
|
4449
4515
|
let t = /* @__PURE__ */ new Map();
|
|
4450
|
-
return
|
|
4516
|
+
return ba(e, (e) => {
|
|
4451
4517
|
if (e.type !== "for" || typeof e.iterator != "string") return;
|
|
4452
4518
|
let n = e.iterable;
|
|
4453
|
-
t.set(e.iterator,
|
|
4519
|
+
t.set(e.iterator, ya(n) ? n.name : "");
|
|
4454
4520
|
}), t;
|
|
4455
4521
|
}
|
|
4456
|
-
function
|
|
4457
|
-
if (
|
|
4522
|
+
function Sa(e, t) {
|
|
4523
|
+
if (ga.includes(e)) return { kind: "aliased" };
|
|
4458
4524
|
switch (t.get(e)) {
|
|
4459
4525
|
case "rows": return { kind: "aliased" };
|
|
4460
4526
|
case "fields": return { kind: "metadata" };
|
|
@@ -4462,58 +4528,58 @@ function fa(e, t) {
|
|
|
4462
4528
|
default: return { kind: "skip" };
|
|
4463
4529
|
}
|
|
4464
4530
|
}
|
|
4465
|
-
function
|
|
4466
|
-
let { ast: n, errors: r } =
|
|
4531
|
+
function Ca(e, t) {
|
|
4532
|
+
let { ast: n, errors: r } = Be(e);
|
|
4467
4533
|
if (r.length > 0) return [];
|
|
4468
|
-
let i = t.fields.map((e) => e.alias), a =
|
|
4534
|
+
let i = t.fields.map((e) => e.alias), a = xa(n), o = {
|
|
4469
4535
|
aliases: i,
|
|
4470
4536
|
loopSources: a,
|
|
4471
|
-
knownRoots: /* @__PURE__ */ new Set([...
|
|
4472
|
-
available: i.length > 0 ? i.join(", ") :
|
|
4537
|
+
knownRoots: /* @__PURE__ */ new Set([...ha, ...a.keys()]),
|
|
4538
|
+
available: i.length > 0 ? i.join(", ") : ha.join(", ")
|
|
4473
4539
|
}, s = [], c = /* @__PURE__ */ new Set();
|
|
4474
|
-
return
|
|
4475
|
-
if (!
|
|
4476
|
-
let t =
|
|
4477
|
-
t &&
|
|
4540
|
+
return ba(n, (e) => {
|
|
4541
|
+
if (!ya(e)) return;
|
|
4542
|
+
let t = wa(e.path ?? [e.name], o);
|
|
4543
|
+
t && Da(s, c, e, t);
|
|
4478
4544
|
}), s;
|
|
4479
4545
|
}
|
|
4480
|
-
function
|
|
4546
|
+
function wa(e, t) {
|
|
4481
4547
|
let [n, r] = e;
|
|
4482
|
-
return t.knownRoots.has(n) ? r === void 0 ? null :
|
|
4548
|
+
return t.knownRoots.has(n) ? r === void 0 ? null : Ta(e, r, t) : `Unknown variable "${n}". Available: ${ha.join(", ")}.`;
|
|
4483
4549
|
}
|
|
4484
|
-
function
|
|
4550
|
+
function Ta(e, t, n) {
|
|
4485
4551
|
let r = e[0];
|
|
4486
|
-
switch (
|
|
4552
|
+
switch (Sa(r, n.loopSources).kind) {
|
|
4487
4553
|
case "raw": return `"${r}" holds raw rows, so dotted access does not resolve. Use ${r}["${e.slice(1).join(".")}"], or loop over rows and use ${r}.${n.aliases[0] ?? "alias"}.`;
|
|
4488
|
-
case "aliased": return
|
|
4489
|
-
case "metadata": return
|
|
4554
|
+
case "aliased": return Ea(t, n.aliases, n.available);
|
|
4555
|
+
case "metadata": return Ea(t, _a, _a.join(", "));
|
|
4490
4556
|
case "skip": return null;
|
|
4491
4557
|
}
|
|
4492
4558
|
}
|
|
4493
|
-
function
|
|
4559
|
+
function Ea(e, t, n) {
|
|
4494
4560
|
return t.includes(e) ? null : `Unknown field "${e}". Available: ${n}.`;
|
|
4495
4561
|
}
|
|
4496
|
-
function
|
|
4562
|
+
function Da(e, t, n, r) {
|
|
4497
4563
|
t.has(r) || (t.add(r), e.push({
|
|
4498
4564
|
message: r,
|
|
4499
4565
|
line: n.line,
|
|
4500
4566
|
column: n.column
|
|
4501
4567
|
}));
|
|
4502
4568
|
}
|
|
4503
|
-
var
|
|
4569
|
+
var Oa = {
|
|
4504
4570
|
maxTemplateLength: 1e5,
|
|
4505
4571
|
maxOutputLength: 5e5,
|
|
4506
4572
|
maxValueLength: 1e5,
|
|
4507
4573
|
maxOperations: 5e5,
|
|
4508
4574
|
maxDepth: 50
|
|
4509
|
-
},
|
|
4510
|
-
function
|
|
4511
|
-
return
|
|
4512
|
-
filters:
|
|
4575
|
+
}, ka = null;
|
|
4576
|
+
function Aa() {
|
|
4577
|
+
return ka ||= Jt({
|
|
4578
|
+
filters: ca,
|
|
4513
4579
|
allowRegex: !1
|
|
4514
|
-
}),
|
|
4580
|
+
}), ka;
|
|
4515
4581
|
}
|
|
4516
|
-
async function
|
|
4582
|
+
async function ja(e, t) {
|
|
4517
4583
|
try {
|
|
4518
4584
|
let n = {
|
|
4519
4585
|
rows: t.rows,
|
|
@@ -4523,7 +4589,7 @@ async function xa(e, t) {
|
|
|
4523
4589
|
first: t.first,
|
|
4524
4590
|
last: t.last,
|
|
4525
4591
|
fields: t.fields
|
|
4526
|
-
}, r = await
|
|
4592
|
+
}, r = await Aa().render(e, { variables: n }, { limits: Oa }), i = r.errors.map((e) => ({
|
|
4527
4593
|
message: e.message,
|
|
4528
4594
|
line: e.line,
|
|
4529
4595
|
column: e.column
|
|
@@ -4531,13 +4597,13 @@ async function xa(e, t) {
|
|
|
4531
4597
|
return {
|
|
4532
4598
|
output: r.output,
|
|
4533
4599
|
errors: i,
|
|
4534
|
-
warnings: i.length > 0 ? [] :
|
|
4600
|
+
warnings: i.length > 0 ? [] : Ca(e, t)
|
|
4535
4601
|
};
|
|
4536
4602
|
} catch (e) {
|
|
4537
4603
|
return {
|
|
4538
4604
|
output: "",
|
|
4539
4605
|
errors: [{
|
|
4540
|
-
message:
|
|
4606
|
+
message: Ma(e),
|
|
4541
4607
|
line: 1,
|
|
4542
4608
|
column: 1
|
|
4543
4609
|
}],
|
|
@@ -4545,12 +4611,12 @@ async function xa(e, t) {
|
|
|
4545
4611
|
};
|
|
4546
4612
|
}
|
|
4547
4613
|
}
|
|
4548
|
-
function
|
|
4614
|
+
function Ma(e) {
|
|
4549
4615
|
return e instanceof Error ? e.message : String(e);
|
|
4550
4616
|
}
|
|
4551
4617
|
//#endregion
|
|
4552
4618
|
//#region src/client/components/charts/MarkdownChart.helpers.ts
|
|
4553
|
-
var
|
|
4619
|
+
var Na = {
|
|
4554
4620
|
small: {
|
|
4555
4621
|
1: "dc:text-lg",
|
|
4556
4622
|
2: "dc:text-base",
|
|
@@ -4566,39 +4632,39 @@ var Ca = {
|
|
|
4566
4632
|
2: "dc:text-4xl",
|
|
4567
4633
|
3: "dc:text-3xl"
|
|
4568
4634
|
}
|
|
4569
|
-
},
|
|
4635
|
+
}, Pa = {
|
|
4570
4636
|
1: "dc:mb-4",
|
|
4571
4637
|
2: "dc:mb-3",
|
|
4572
4638
|
3: "dc:mb-2"
|
|
4573
|
-
},
|
|
4639
|
+
}, Fa = {
|
|
4574
4640
|
small: "dc:text-sm",
|
|
4575
4641
|
medium: "dc:text-lg",
|
|
4576
4642
|
large: "dc:text-xl"
|
|
4577
|
-
},
|
|
4643
|
+
}, Ia = {
|
|
4578
4644
|
left: "dc:text-left",
|
|
4579
4645
|
center: "dc:text-center",
|
|
4580
4646
|
right: "dc:text-right"
|
|
4581
4647
|
};
|
|
4582
|
-
function
|
|
4583
|
-
return
|
|
4648
|
+
function La(e) {
|
|
4649
|
+
return Fa[e] ?? Fa.medium;
|
|
4584
4650
|
}
|
|
4585
|
-
function
|
|
4586
|
-
return
|
|
4651
|
+
function Ra(e) {
|
|
4652
|
+
return Ia[e] ?? Ia.left;
|
|
4587
4653
|
}
|
|
4588
|
-
function
|
|
4654
|
+
function za(e, t, n) {
|
|
4589
4655
|
return { props: {
|
|
4590
|
-
className: `dc:font-bold ${
|
|
4656
|
+
className: `dc:font-bold ${Na[e]?.[t] ?? Na.medium[t]} ${Pa[t]}`,
|
|
4591
4657
|
style: { color: n }
|
|
4592
4658
|
} };
|
|
4593
4659
|
}
|
|
4594
|
-
function
|
|
4660
|
+
function Ba(e, t) {
|
|
4595
4661
|
return {
|
|
4596
4662
|
disableParsingRawHTML: !0,
|
|
4597
4663
|
sanitizer: (e) => i(e),
|
|
4598
4664
|
overrides: {
|
|
4599
|
-
h1:
|
|
4600
|
-
h2:
|
|
4601
|
-
h3:
|
|
4665
|
+
h1: za(t, 1, e),
|
|
4666
|
+
h2: za(t, 2, e),
|
|
4667
|
+
h3: za(t, 3, e),
|
|
4602
4668
|
p: { props: { className: "dc:mb-3 dc:leading-relaxed text-dc-text" } },
|
|
4603
4669
|
strong: { props: { className: "dc:font-bold text-dc-text" } },
|
|
4604
4670
|
em: { props: { className: "dc:italic text-dc-text" } },
|
|
@@ -4630,26 +4696,26 @@ function Aa(e, t) {
|
|
|
4630
4696
|
}
|
|
4631
4697
|
};
|
|
4632
4698
|
}
|
|
4633
|
-
function
|
|
4699
|
+
function Va(e, t, n) {
|
|
4634
4700
|
if (e === "none") return {};
|
|
4635
4701
|
let r = { [`border${e.charAt(0).toUpperCase() + e.slice(1)}`]: `4px solid ${t}` };
|
|
4636
4702
|
return n && e === "left" && (r.paddingLeft = "12px"), r;
|
|
4637
4703
|
}
|
|
4638
|
-
function
|
|
4704
|
+
function Ha(e, t) {
|
|
4639
4705
|
return e && t < e.length ? e[t] : "#8884d8";
|
|
4640
4706
|
}
|
|
4641
|
-
function
|
|
4707
|
+
function Ua(e) {
|
|
4642
4708
|
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && !Array.isArray(e)) : [];
|
|
4643
4709
|
}
|
|
4644
|
-
function
|
|
4645
|
-
let a = n(i), u = c(() =>
|
|
4710
|
+
function Wa(e, t, i) {
|
|
4711
|
+
let a = n(i), u = c(() => Ua(t), [t]), d = o(r)?.getFieldLabel, [f, p] = l(null);
|
|
4646
4712
|
return s(() => {
|
|
4647
4713
|
if (!a || !e.trim()) {
|
|
4648
4714
|
p(null);
|
|
4649
4715
|
return;
|
|
4650
4716
|
}
|
|
4651
4717
|
let t = !1;
|
|
4652
|
-
return
|
|
4718
|
+
return ja(e, pa(u, d)).then((e) => {
|
|
4653
4719
|
t || p(e);
|
|
4654
4720
|
}), () => {
|
|
4655
4721
|
t = !0;
|
|
@@ -4667,6 +4733,6 @@ function Pa(e, t, i) {
|
|
|
4667
4733
|
};
|
|
4668
4734
|
}
|
|
4669
4735
|
//#endregion
|
|
4670
|
-
export {
|
|
4736
|
+
export { Ha as a, a as default, Ba as i, La as n, Wa as o, Va as r, y as s, Ra as t };
|
|
4671
4737
|
|
|
4672
|
-
//# sourceMappingURL=MarkdownChart-
|
|
4738
|
+
//# sourceMappingURL=MarkdownChart-BKQl0PAy.js.map
|