@vonage/vivid 5.16.0 → 5.17.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/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +1 -1
- package/action-group/index.cjs +3 -3
- package/action-group/index.js +5 -5
- package/alert/index.cjs +3 -3
- package/alert/index.js +17 -17
- package/audio-player/index.cjs +16 -16
- package/audio-player/index.js +27 -27
- package/avatar/index.cjs +2 -2
- package/avatar/index.js +6 -6
- package/badge/index.cjs +2 -2
- package/badge/index.js +6 -6
- package/banner/index.cjs +3 -3
- package/banner/index.js +15 -15
- package/bundled/base-color-picker.cjs +2 -2
- package/bundled/base-color-picker.js +5 -5
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +2 -2
- package/bundled/calendar-picker.template.cjs +2 -2
- package/bundled/calendar-picker.template.js +498 -498
- package/bundled/definition10.cjs +18 -30
- package/bundled/definition10.js +53 -155
- package/bundled/definition11.cjs +10 -19
- package/bundled/definition11.js +25 -74
- package/bundled/definition12.cjs +72 -18
- package/bundled/definition12.js +171 -107
- package/bundled/definition13.cjs +18 -17
- package/bundled/definition13.js +45 -65
- package/bundled/definition14.cjs +5 -10
- package/bundled/definition14.js +9 -27
- package/bundled/definition15.cjs +17 -71
- package/bundled/definition15.js +64 -181
- package/bundled/definition16.cjs +12 -4
- package/bundled/definition16.js +79 -14
- package/bundled/definition17.cjs +19 -13
- package/bundled/definition17.js +119 -70
- package/bundled/definition18.cjs +87 -12
- package/bundled/definition18.js +409 -52
- package/bundled/definition19.cjs +5 -87
- package/bundled/definition19.js +14 -422
- package/bundled/definition2.cjs +3 -3
- package/bundled/definition2.js +27 -27
- package/bundled/definition20.cjs +30 -5
- package/bundled/definition20.js +159 -9
- package/bundled/definition21.cjs +28 -19
- package/bundled/definition21.js +164 -47
- package/bundled/definition22.cjs +38 -23
- package/bundled/definition22.js +64 -82
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +15 -15
- package/bundled/definition4.cjs +23 -38
- package/bundled/definition4.js +82 -64
- package/bundled/definition5.cjs +2 -2
- package/bundled/definition5.js +5 -5
- package/bundled/definition6.cjs +2 -2
- package/bundled/definition6.js +24 -24
- package/bundled/definition9.cjs +12 -30
- package/bundled/definition9.js +55 -148
- package/bundled/divider.cjs +1 -1
- package/bundled/divider.js +5 -5
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +1 -1
- package/bundled/mixins.cjs +4 -4
- package/bundled/mixins.js +43 -43
- package/bundled/picker-field.template.cjs +7 -7
- package/bundled/picker-field.template.js +14 -14
- package/bundled/slider.template.cjs +7 -7
- package/bundled/slider.template.js +12 -12
- package/bundled/slottable-request.cjs +1 -1
- package/bundled/slottable-request.js +8 -38
- package/bundled/time-selection-picker.template.cjs +4 -4
- package/bundled/time-selection-picker.template.js +35 -35
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/calendar/index.cjs +11 -11
- package/calendar/index.js +30 -237
- package/calendar-event/index.cjs +3 -3
- package/calendar-event/index.js +4 -4
- package/card/index.cjs +14 -11
- package/card/index.js +16 -13
- package/checkbox/index.cjs +1 -1
- package/checkbox/index.js +1 -1
- package/color-picker/definition.cjs +1 -1
- package/color-picker/definition.js +1 -1
- package/color-picker/index.cjs +6 -6
- package/color-picker/index.js +24 -24
- package/combobox/definition.cjs +1 -1
- package/combobox/definition.js +1 -1
- package/combobox/index.cjs +9 -8
- package/combobox/index.js +32 -28
- package/contextual-help/definition.cjs +1 -1
- package/contextual-help/definition.js +1 -1
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1027 -615
- package/data-grid/definition.js +1 -1
- package/data-grid/index.cjs +17 -17
- package/data-grid/index.js +261 -264
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +12 -12
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +7 -7
- package/date-time-picker/index.cjs +4 -4
- package/date-time-picker/index.js +24 -24
- package/dial-pad/index.cjs +3 -2
- package/dial-pad/index.js +6 -5
- package/dialog/index.cjs +4 -4
- package/dialog/index.js +5 -5
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/fab/index.cjs +3 -3
- package/fab/index.js +8 -8
- package/file-picker/index.cjs +16 -13
- package/file-picker/index.js +31 -28
- package/header/index.cjs +4 -4
- package/header/index.js +5 -5
- package/index.cjs +24 -21
- package/index.js +11 -11
- package/lib/combobox/combobox.d.ts +0 -3
- package/lib/date-time-picker/date-time-picker.d.ts +0 -4
- package/lib/dial-pad/dial-pad.d.ts +6 -2
- package/lib/dialog/dialog.d.ts +0 -1
- package/lib/menu/menu.d.ts +0 -1
- package/lib/option/option.d.ts +0 -1
- package/lib/rich-text-editor/rte/exports.d.ts +1 -0
- package/lib/rich-text-editor/rte/features/alignment.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/character-count.d.ts +21 -0
- package/lib/rich-text-editor/rte/features/font-size-picker.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/keyboard-shortcuts.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +1 -1
- package/lib/rich-text-editor/rte/public-interface.d.ts +6 -0
- package/lib/searchable-select/option-tag.d.ts +0 -1
- package/lib/table/definition.d.ts +2 -1
- package/lib/table/table-header-cell.d.ts +3 -0
- package/lib/table/table-sorting-button.d.ts +415 -0
- package/lib/table/table-sorting-button.template.d.ts +3 -0
- package/locales/de-DE.cjs +4 -178
- package/locales/de-DE.js +2 -179
- package/locales/en-GB.cjs +4 -9
- package/locales/en-GB.js +2 -10
- package/locales/en-US.cjs +268 -2
- package/locales/en-US.js +265 -1
- package/locales/ja-JP.cjs +4 -171
- package/locales/ja-JP.js +2 -172
- package/locales/zh-CN.cjs +4 -172
- package/locales/zh-CN.js +2 -173
- package/menu/index.cjs +1 -1
- package/menu/index.js +1 -1
- package/menu-item/index.cjs +1 -1
- package/menu-item/index.js +1 -1
- package/nav-disclosure/index.cjs +3 -3
- package/nav-disclosure/index.js +8 -8
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +7 -7
- package/note/index.cjs +2 -2
- package/note/index.js +6 -6
- package/number-field/index.cjs +4 -4
- package/number-field/index.js +31 -31
- package/option/definition.cjs +1 -1
- package/option/definition.js +1 -1
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +7 -8
- package/pagination/index.cjs +3 -3
- package/pagination/index.js +15 -15
- package/popover/index.cjs +4 -4
- package/popover/index.js +5 -5
- package/progress/index.cjs +2 -2
- package/progress/index.js +5 -5
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +4 -4
- package/radio-group/index.js +10 -10
- package/range-slider/index.cjs +4 -4
- package/range-slider/index.js +17 -17
- package/rich-text-editor/definition.cjs +1 -0
- package/rich-text-editor/definition.js +2 -2
- package/rich-text-editor/index.cjs +13 -13
- package/rich-text-editor/index.js +1886 -1829
- package/rich-text-view/index.cjs +1 -1
- package/rich-text-view/index.js +8 -8
- package/searchable-select/index.cjs +12 -12
- package/searchable-select/index.js +25 -25
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +7 -7
- package/selectable-box/index.js +11 -11
- package/shared/foundation/test-utilities/fixture.d.ts +1 -1
- package/shared/patterns/linkable.d.ts +1 -1
- package/simple-color-picker/index.cjs +3 -3
- package/simple-color-picker/index.js +10 -10
- package/split-button/index.cjs +5 -5
- package/split-button/index.js +10 -10
- package/status/index.cjs +2 -2
- package/status/index.js +12 -12
- package/switch/index.cjs +3 -3
- package/switch/index.js +5 -5
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/table/definition.cjs +17 -14
- package/table/definition.js +3 -2
- package/table/index.cjs +19 -10
- package/table/index.js +69 -21
- package/tabs/index.cjs +2 -2
- package/tabs/index.js +4 -4
- package/tag/index.cjs +7 -7
- package/tag/index.js +9 -9
- package/tag-group/index.cjs +3 -3
- package/tag-group/index.js +5 -5
- package/text-area/index.cjs +2 -2
- package/text-area/index.js +12 -12
- package/text-field/definition.cjs +1 -1
- package/text-field/definition.js +1 -1
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +1 -1
- package/tooltip/definition.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +3 -3
- package/tree-view/index.js +17 -17
- package/unbundled/button.cjs +2 -2
- package/unbundled/button.js +2 -2
- package/unbundled/calendar-picker.template.cjs +4347 -9
- package/unbundled/calendar-picker.template.js +4345 -7
- package/unbundled/chunk.cjs +0 -22
- package/unbundled/definition13.cjs +1 -8
- package/unbundled/definition13.js +1 -8
- package/unbundled/definition14.cjs +2 -2
- package/unbundled/definition14.js +2 -2
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +1 -1
- package/unbundled/definition21.cjs +1 -2
- package/unbundled/definition21.js +1 -2
- package/unbundled/definition22.cjs +7 -2
- package/unbundled/definition22.js +7 -2
- package/unbundled/definition24.cjs +98 -979
- package/unbundled/definition24.js +93 -974
- package/unbundled/definition25.cjs +37 -322
- package/unbundled/definition25.js +33 -318
- package/unbundled/definition26.cjs +317 -91
- package/unbundled/definition26.js +313 -87
- package/unbundled/definition27.cjs +94 -192
- package/unbundled/definition27.js +91 -183
- package/unbundled/definition28.cjs +387 -395
- package/unbundled/definition28.js +387 -395
- package/unbundled/definition29.cjs +189 -110
- package/unbundled/definition29.js +180 -107
- package/unbundled/definition30.cjs +520 -36
- package/unbundled/definition30.js +519 -35
- package/unbundled/definition32.cjs +477 -477
- package/unbundled/definition32.js +475 -475
- package/unbundled/definition33.cjs +87 -2
- package/unbundled/definition33.js +77 -4
- package/unbundled/definition35.cjs +2 -2
- package/unbundled/definition35.js +2 -2
- package/unbundled/definition36.cjs +1 -1
- package/unbundled/definition36.js +1 -1
- package/unbundled/definition37.cjs +6 -2
- package/unbundled/definition37.js +6 -2
- package/unbundled/definition38.cjs +7 -5
- package/unbundled/definition38.js +7 -5
- package/unbundled/definition39.cjs +1 -0
- package/unbundled/definition39.js +1 -0
- package/unbundled/definition42.cjs +22 -11
- package/unbundled/definition42.js +22 -11
- package/unbundled/definition49.cjs +3 -3
- package/unbundled/definition49.js +3 -3
- package/unbundled/definition56.cjs +437 -9506
- package/unbundled/definition56.js +340 -9415
- package/unbundled/definition57.cjs +5 -5
- package/unbundled/definition57.js +5 -5
- package/unbundled/definition58.cjs +4 -3
- package/unbundled/definition58.js +2 -1
- package/unbundled/definition59.cjs +4 -3
- package/unbundled/definition59.js +4 -3
- package/unbundled/definition62.cjs +2 -2
- package/unbundled/definition62.js +2 -2
- package/unbundled/definition64.cjs +1 -1
- package/unbundled/definition64.js +1 -1
- package/unbundled/definition71.cjs +2 -2
- package/unbundled/definition71.js +2 -2
- package/unbundled/definition72.cjs +1 -2
- package/unbundled/definition72.js +1 -2
- package/unbundled/definition75.cjs +3 -51711
- package/unbundled/definition75.js +1 -51711
- package/unbundled/listbox.cjs +1 -1
- package/unbundled/listbox.js +1 -1
- package/unbundled/localized.cjs +2 -2
- package/unbundled/localized.js +1 -1
- package/unbundled/picker-field.template.cjs +1 -1
- package/unbundled/picker-field.template.js +1 -1
- package/unbundled/slottable-request.cjs +2 -3168
- package/unbundled/slottable-request.js +3 -3097
- package/unbundled/time-selection-picker.template.cjs +1 -1
- package/unbundled/time-selection-picker.template.js +1 -1
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/index.cjs +3 -3
- package/video-player/index.js +9 -9
- package/vivid.api.json +220 -282
- package/unbundled/chunk.js +0 -33
- package/unbundled/en-US.cjs +0 -447
- package/unbundled/en-US.js +0 -443
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const e=require(`./vivid-element.cjs`),t=require(`./ref.cjs`),n=require(`./when.cjs`),r=require(`./aria.cjs`),i=require(`./
|
|
1
|
+
const e=require(`./vivid-element.cjs`),t=require(`./ref.cjs`),n=require(`./when.cjs`),r=require(`./delegates-aria.cjs`),i=require(`./aria.cjs`),a=require(`./class-names.cjs`),o=require(`./numbers.cjs`),s=require(`./definition8.cjs`);var c=e=>{let t=e.toString().match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0))},l=(e,t)=>{let n=10**c(t),r=Math.round(e/t)*t;return Math.round(r*n)/n},u=e=>e>0?e:1,d={fromView(e){return u(Number(e))},toView(e){return e.toString()}},f=(e,t,n)=>e+(t-e)*n,p=(e,t,n)=>o.n(0,1,(n-e)/(t-e)),m=({disabled:e,connotation:t})=>a.t(`control`,[`disabled`,!!e],[`connotation-${t}`,!!t]),h=({_focusVisible:e})=>a.t(`thumb-container`,[`focus-visible`,e]),g=(t,n)=>{let r=t?[`right`,`center`,``,`100% repeat-x`]:[`bottom`,`top`,`100%`,`repeat-y`];return e.d` <div
|
|
2
2
|
class="mark"
|
|
3
3
|
style="
|
|
4
4
|
background: linear-gradient(to ${r[0]}, currentcolor 1px, transparent 0px)
|
|
5
5
|
0px ${r[1]} / ${r[2]} calc((100% - 1px) / ${n}) ${r[3]}
|
|
6
6
|
"
|
|
7
|
-
></div>`},_=
|
|
7
|
+
></div>`},_=a=>{let o=a.tagFor(s.i);return e.d`<template
|
|
8
8
|
@focusin="${e=>e._onFocusIn()}"
|
|
9
9
|
@focusout="${e=>e._onFocusOut()}"
|
|
10
10
|
>
|
|
11
11
|
<div
|
|
12
12
|
tabindex="${e=>e.disabled?null:0}"
|
|
13
13
|
class="${m} ${e=>e.orientation}"
|
|
14
|
-
${
|
|
14
|
+
${r.n({role:`slider`,ariaValueText:e=>e.ariaValueText||e.valueTextFormatter(e.value),ariaValueNow:e=>e.value,ariaValueMin:e=>e.min,ariaValueMax:e=>e.max,ariaDisabled:e=>e.disabled?`true`:null,ariaOrientation:e=>e.orientation})}
|
|
15
15
|
>
|
|
16
16
|
<div class="positioning-region">
|
|
17
17
|
<div ${t.t(`track`)} class="track">
|
|
18
|
-
${e=>e.markers?g(e.orientation===
|
|
18
|
+
${e=>e.markers?g(e.orientation===i.t.horizontal,Math.floor((e.max-e.min)/e.step)):void 0}
|
|
19
19
|
<div class="track-start" style="${e=>e.position}"></div>
|
|
20
20
|
</div>
|
|
21
21
|
<div
|
|
@@ -23,19 +23,19 @@ const e=require(`./vivid-element.cjs`),t=require(`./ref.cjs`),n=require(`./when.
|
|
|
23
23
|
class="${e=>h(e)}"
|
|
24
24
|
style="${e=>e.position}"
|
|
25
25
|
></div>
|
|
26
|
-
${n.t(e=>e.pin,e.d`<${
|
|
26
|
+
${n.t(e=>e.pin,e.d`<${o}
|
|
27
27
|
class="popup"
|
|
28
28
|
arrow
|
|
29
29
|
alternate
|
|
30
30
|
:anchor="${e=>e.thumb}"
|
|
31
31
|
:open=${e=>e._isThumbPopupOpen}
|
|
32
|
-
:placementStrategy=${e=>e.orientation===
|
|
32
|
+
:placementStrategy=${e=>e.orientation===i.t.horizontal?s.r.AutoPlacementHorizontal:s.r.AutoPlacementVertical}
|
|
33
33
|
animation-frame
|
|
34
34
|
exportparts="vvd-theme-alternate"
|
|
35
35
|
aria-hidden="true"
|
|
36
36
|
>
|
|
37
37
|
<div class="tooltip">${e=>e.ariaValueText||e.valueTextFormatter(e.value)}</div>
|
|
38
|
-
</${
|
|
38
|
+
</${o}>`)}
|
|
39
39
|
</div>
|
|
40
40
|
</div></template
|
|
41
41
|
>`};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return _}});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { d as e } from "./vivid-element.js";
|
|
2
2
|
import { t } from "./ref.js";
|
|
3
3
|
import { t as n } from "./when.js";
|
|
4
|
-
import {
|
|
5
|
-
import { t as i } from "./
|
|
6
|
-
import {
|
|
7
|
-
import { n as o } from "./
|
|
4
|
+
import { n as r } from "./delegates-aria.js";
|
|
5
|
+
import { t as i } from "./aria.js";
|
|
6
|
+
import { t as a } from "./class-names.js";
|
|
7
|
+
import { n as o } from "./numbers.js";
|
|
8
8
|
import { i as s, r as c } from "./definition8.js";
|
|
9
9
|
//#region src/lib/range-slider/utils/roundToStepValue.ts
|
|
10
10
|
var l = (e) => {
|
|
@@ -20,7 +20,7 @@ var l = (e) => {
|
|
|
20
20
|
toView(e) {
|
|
21
21
|
return e.toString();
|
|
22
22
|
}
|
|
23
|
-
}, p = (e, t, n) => e + (t - e) * n, m = (e, t, n) =>
|
|
23
|
+
}, p = (e, t, n) => e + (t - e) * n, m = (e, t, n) => o(0, 1, (n - e) / (t - e)), h = ({ disabled: e, connotation: t }) => a("control", ["disabled", !!e], [`connotation-${t}`, !!t]), g = ({ _focusVisible: e }) => a("thumb-container", ["focus-visible", e]), _ = (t, n) => {
|
|
24
24
|
let r = t ? [
|
|
25
25
|
"right",
|
|
26
26
|
"center",
|
|
@@ -39,8 +39,8 @@ var l = (e) => {
|
|
|
39
39
|
0px ${r[1]} / ${r[2]} calc((100% - 1px) / ${n}) ${r[3]}
|
|
40
40
|
"
|
|
41
41
|
></div>`;
|
|
42
|
-
}, v = (
|
|
43
|
-
let
|
|
42
|
+
}, v = (a) => {
|
|
43
|
+
let o = a.tagFor(s);
|
|
44
44
|
return e`<template
|
|
45
45
|
@focusin="${(e) => e._onFocusIn()}"
|
|
46
46
|
@focusout="${(e) => e._onFocusOut()}"
|
|
@@ -48,7 +48,7 @@ var l = (e) => {
|
|
|
48
48
|
<div
|
|
49
49
|
tabindex="${(e) => e.disabled ? null : 0}"
|
|
50
50
|
class="${h} ${(e) => e.orientation}"
|
|
51
|
-
${
|
|
51
|
+
${r({
|
|
52
52
|
role: "slider",
|
|
53
53
|
ariaValueText: (e) => e.ariaValueText || e.valueTextFormatter(e.value),
|
|
54
54
|
ariaValueNow: (e) => e.value,
|
|
@@ -60,7 +60,7 @@ var l = (e) => {
|
|
|
60
60
|
>
|
|
61
61
|
<div class="positioning-region">
|
|
62
62
|
<div ${t("track")} class="track">
|
|
63
|
-
${(e) => e.markers ? _(e.orientation ===
|
|
63
|
+
${(e) => e.markers ? _(e.orientation === i.horizontal, Math.floor((e.max - e.min) / e.step)) : void 0}
|
|
64
64
|
<div class="track-start" style="${(e) => e.position}"></div>
|
|
65
65
|
</div>
|
|
66
66
|
<div
|
|
@@ -68,19 +68,19 @@ var l = (e) => {
|
|
|
68
68
|
class="${(e) => g(e)}"
|
|
69
69
|
style="${(e) => e.position}"
|
|
70
70
|
></div>
|
|
71
|
-
${n((e) => e.pin, e`<${
|
|
71
|
+
${n((e) => e.pin, e`<${o}
|
|
72
72
|
class="popup"
|
|
73
73
|
arrow
|
|
74
74
|
alternate
|
|
75
75
|
:anchor="${(e) => e.thumb}"
|
|
76
76
|
:open=${(e) => e._isThumbPopupOpen}
|
|
77
|
-
:placementStrategy=${(e) => e.orientation ===
|
|
77
|
+
:placementStrategy=${(e) => e.orientation === i.horizontal ? c.AutoPlacementHorizontal : c.AutoPlacementVertical}
|
|
78
78
|
animation-frame
|
|
79
79
|
exportparts="vvd-theme-alternate"
|
|
80
80
|
aria-hidden="true"
|
|
81
81
|
>
|
|
82
82
|
<div class="tooltip">${(e) => e.ariaValueText || e.valueTextFormatter(e.value)}</div>
|
|
83
|
-
</${
|
|
83
|
+
</${o}>`)}
|
|
84
84
|
</div>
|
|
85
85
|
</div></template
|
|
86
86
|
>`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
function e(e){this.content=e}e.prototype={constructor:e,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(t,n,r){var i=r&&r!=t?this.remove(r):this,a=i.find(t),o=i.content.slice();return a==-1?o.push(r||t,n):(o[a+1]=n,r&&(o[a]=r)),new e(o)},remove:function(t){var n=this.find(t);if(n==-1)return this;var r=this.content.slice();return r.splice(n,2),new e(r)},addToStart:function(t,n){return new e([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new e(r)},addBefore:function(t,n,r){var i=this.remove(n),a=i.content.slice(),o=i.find(t);return a.splice(o==-1?a.length:o,0,n,r),new e(a)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(t){return t=e.from(t),t.size?new e(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=e.from(t),t.size?new e(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=e.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},e.from=function(t){if(t instanceof e)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new e(n)};function t(e,n,r){for(let i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;let a=e.child(i),o=n.child(i);if(a==o){r+=a.nodeSize;continue}if(!a.sameMarkup(o))return r;if(a.isText&&a.text!=o.text){for(let e=0;a.text[e]==o.text[e];e++)r++;return r}if(a.content.size||o.content.size){let e=t(a.content,o.content,r+1);if(e!=null)return e}r+=a.nodeSize}}function n(e,t,r,i){for(let a=e.childCount,o=t.childCount;;){if(a==0||o==0)return a==o?null:{a:r,b:i};let s=e.child(--a),c=t.child(--o),l=s.nodeSize;if(s==c){r-=l,i-=l;continue}if(!s.sameMarkup(c))return{a:r,b:i};if(s.isText&&s.text!=c.text){let e=0,t=Math.min(s.text.length,c.text.length);for(;e<t&&s.text[s.text.length-e-1]==c.text[c.text.length-e-1];)e++,r--,i--;return{a:r,b:i}}if(s.content.size||c.content.size){let e=n(s.content,c.content,r-1,i-1);if(e)return e}r-=l,i-=l}}var r=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,n=0){return t(this,e,n)}findDiffEnd(e,t=this.size,r=e.size){return n(this,e,t,r)}findIndex(e){if(e==0)return a(0,e);if(e==this.size)return a(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?a(t+1,i):a(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};r.empty=new r([],0);var i={index:0,offset:0};function a(e,t){return i.index=e,i.offset=t,i}function o(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!o(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!o(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var s=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&o(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};s.none=[];var c=class extends Error{},l=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=d(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(u(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let i=n.openStart||0,a=n.openEnd||0;if(typeof i!=`number`||typeof a!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(r.fromJSON(t,n.content),i,a)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};l.empty=new l(r.empty,0,0);function u(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(u(a.content,t-i-1,n-i-1)))}function d(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=d(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function ee(e,t,n){if(n.openStart>e.depth)throw new c(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new c(`Inconsistent open depths`);return f(e,t,n,0)}function f(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=f(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return _(a,y(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return _(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=te(n,e);return _(a,v(e,i,o,t,r))}}function p(e,t){if(!t.type.compatibleContent(e.type))throw new c(`Cannot join `+t.type.name+` onto `+e.type.name)}function m(e,t,n){let r=e.node(n);return p(r,t.node(n)),r}function h(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function g(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(h(e.nodeAfter,r),a++));for(let e=a;e<o;e++)h(i.child(e),r);t&&t.depth==n&&t.textOffset&&h(t.nodeBefore,r)}function _(e,t){return e.type.checkContent(t),e.copy(t)}function v(e,t,n,i,a){let o=e.depth>a&&m(e,t,a+1),s=i.depth>a&&m(n,i,a+1),c=[];return g(null,e,a,c),o&&s&&t.index(a)==n.index(a)?(p(o,s),h(_(o,v(e,t,n,i,a+1)),c)):(o&&h(_(o,y(e,t,a+1)),c),g(t,n,a,c),s&&h(_(s,y(n,i,a+1)),c)),g(i,null,a,c),new r(c)}function y(e,t,n){let i=[];return g(null,e,n,i),e.depth>n&&h(_(m(e,t,n+1),y(e,t,n+1)),i),g(t,null,n,i),new r(i)}function te(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)i=t.node(e).copy(r.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}var b=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return s.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new S(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=x.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else x.set(t,r=new ne);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%re,i}},ne=class{constructor(){this.elts=[],this.i=0}},re=12,x=new WeakMap,S=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},ie=Object.create(null),C=class e{constructor(e,t,n,i=s.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||r.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&o(this.attrs,t||e.defaultAttrs||ie)&&s.sameSet(this.marks,n||s.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return l.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new l(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return ee(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return b.resolveCached(this,e)}resolveNoCache(e){return b.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),w(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=r.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=i;e<a;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=s.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!s.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let i=r.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};C.prototype.text=void 0;var ae=class e extends C{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):w(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function w(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var T=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new oe(t,n);if(r.next==null)return e.empty;let i=E(r);r.next&&r.err(`Unexpected trailing text`);let a=pe(fe(i));return me(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function a(o,s){let c=o.matchFragment(e,n);if(c&&(!t||c.validEnd))return r.from(s.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!(t.isText||t.hasRequiredAttrs())&&i.indexOf(n)==-1){i.push(n);let e=a(n,s.concat(t));if(e)return e}}return null}return a(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
2
2
|
`)}};T.empty=new T(!0);var oe=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function E(e){let t=[];do t.push(se(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function se(e){let t=[];do t.push(ce(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function ce(e){let t=de(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=le(e,t);else break;return t}function D(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function le(e,t){let n=D(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:D(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function ue(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function de(e){if(e.eat(`(`)){let t=E(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=ue(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function fe(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function O(e,t){return t-e}function k(e,t){let n=[];return r(t),n.sort(O);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function pe(e){let t=Object.create(null);return n(k(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);k(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new T(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(O);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function me(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function A(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function j(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function M(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function N(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ge(e,r,t[r]);return n}var P=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=N(e,n.attrs),this.defaultAttrs=A(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==T.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:j(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new C(this,this.computeAttrs(e),r.from(t),s.setFrom(n))}createChecked(e=null,t,n){return t=r.from(t),this.checkContent(t),new C(this,this.computeAttrs(e),t,s.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=r.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let i=this.contentMatch.matchFragment(t),a=i&&i.fillBefore(r.empty,!0);return a?new C(this,e,t.append(a),s.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){M(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:s.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function he(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var ge=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?he(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},F=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=N(e,r.attrs),this.excluded=null;let i=A(this.attrs);this.instance=i?new s(this,i):null}create(e=null){return!e&&this.instance?this.instance:new s(this,j(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){M(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},_e=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let e in t)n[e]=t[e];n.nodes=e.from(t.nodes),n.marks=e.from(t.marks||{}),this.nodes=P.compile(this.spec.nodes,this),this.marks=F.compile(this.spec.marks,this);let r=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],n=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=r[n]||(r[n]=T.parse(n,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?I(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:I(this,n.split(` `))}this.nodeFromJSON=e=>C.fromJSON(this,e),this.markFromJSON=e=>s.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof P))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ae(n,n.defaultAttrs,e,s.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function I(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function ve(e){return e.tag!=null}function ye(e){return e.style!=null}var be=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(ve(e))this.tags.push(e);else if(ye(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new W(this,t,!1);return n.addAll(e,s.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new W(this,t,!0);return n.addAll(e,s.none,t.from,t.to),l.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Ce(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=G(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=G(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},L={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},xe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},R={ol:!0,ul:!0},z=1,B=2,V=4;function H(e,t,n){return t==null?e&&e.whitespace==`pre`?z|B:n&~V:(t?z:0)|(t===`full`?B:0)}var U=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=s.none,this.match=i||(a&V?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(r.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&z)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=r.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(r.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!L.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},W=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=H(null,t.preserveWhitespace,0)|(n?V:0);i=r?new U(r.type,r.attrs,s.none,!0,t.topMatch||r.type.contentMatch,a):n?new U(null,null,s.none,!0,null,a):new U(e.schema.topNodeType,null,s.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&B?`full`:this.localPreserveWS||(r.options&z)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;R.hasOwnProperty(a)&&this.parser.normalizeLists&&Se(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:xe.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(L.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
|
-
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=s.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):K(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=H(e,i,a.options);a.options&V&&a.content.length==0&&(o|=V);let c=s.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):K(t.type,e))?(c=t.addToSet(c),!1):!0),this.nodes.push(new U(e,t,c,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=z);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Se(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&R.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Ce(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function G(e){let t={};for(let n in e)t[n]=e[n];return t}function K(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var we=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=J(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=X(J(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&X(J(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return X(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=q(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return q(e.marks)}};function q(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function J(e){return e.document||window.document}var Y=new WeakMap;function Te(e){let t=Y.get(e);return t===void 0&&Y.set(e,t=Ee(e)),t}function Ee(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function X(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Te(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=X(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var De=class{constructor(e){this.specs=e,this.attrs={};for(let t of e)this.attrs[t.name]={default:t.default}}fromDOM(e){return Object.assign({},...this.specs.map(t=>({[t.name]:t.fromDOM(e)})))}getStyle(e){return this.specs.flatMap(t=>t.toStyles(e)).join(`; `)}getDOMAttrsProperties(e){return this.specs.length?{style:this.getStyle(e)}:{}}getDOMAttrs(e){return this.specs.length?[this.getDOMAttrsProperties(e)]:[]}extractFromNode(e){return Object.assign({},...Object.keys(this.attrs).map(t=>({[t]:e.attrs[t]})))}},Oe=class{constructor(e){this.specs=e}getAllowedMarksForNode(e){return this.specs.filter(t=>!t.onNodeName||t.onNodeName===e).map(e=>e.markName)}getReferencedNodeNames(){return new Set(this.specs.map(e=>e.onNodeName).filter(Boolean))}},ke=e=>e.sort((e,t)=>{let n=e.priority-t.priority;return n===0?e.featureName===t.featureName?0:e.featureName>t.featureName?1:-1:n}).map(e=>e.value),Z={highest:-20,high:-10,default:0,low:10,lowest:20},Ae=class{},je=class{contribution(e,t){return{featureName:this.name,priority:t??Z.default,value:e}}getStyles(){return[]}getSchema(e,t){return[]}getTextblockAttrs(){return[]}getTextblockMarks(){return[]}getPlugins(e){return[]}getToolbarItems(e){return[]}getInputRules(e){return[]}getFeatures(){return[this]}getPublicInterface(e){}},Q=new WeakMap,Me=e=>Q.get(e),Ne=e=>{class t extends Ae{constructor(...t){super(),Q.set(this,new e(...t))}}return t},Pe=Symbol(`rte-internal-impl`),$=Symbol.for(`slottable-request-remove`);function Fe(e,t,n,r){let i=new CustomEvent(`slottable-request`,{bubbles:!1,composed:!1,detail:{name:t,slotName:n,data:r}});Object.defineProperties(i,{name:{value:t,enumerable:!0},slotName:{value:n,enumerable:!0},data:{value:r,enumerable:!0}}),e.dispatchEvent(i)}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return _e}});
|
|
4
|
+
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=s.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):K(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=H(e,i,a.options);a.options&V&&a.content.length==0&&(o|=V);let c=s.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):K(t.type,e))?(c=t.addToSet(c),!1):!0),this.nodes.push(new U(e,t,c,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=z);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Se(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&R.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Ce(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function G(e){let t={};for(let n in e)t[n]=e[n];return t}function K(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var we=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=J(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=X(J(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&X(J(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return X(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=q(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return q(e.marks)}};function q(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function J(e){return e.document||window.document}var Y=new WeakMap;function Te(e){let t=Y.get(e);return t===void 0&&Y.set(e,t=Ee(e)),t}function Ee(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function X(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Te(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=X(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var De=Symbol(`rte-internal-impl`),Oe=e=>e.sort((e,t)=>{let n=e.priority-t.priority;return n===0?e.featureName===t.featureName?0:e.featureName>t.featureName?1:-1:n}).map(e=>e.value),Z={highest:-20,high:-10,default:0,low:10,lowest:20},ke=class{},Ae=class{contribution(e,t){return{featureName:this.name,priority:t??Z.default,value:e}}getStyles(){return[]}getSchema(e,t){return[]}getTextblockAttrs(){return[]}getTextblockMarks(){return[]}getPlugins(e){return[]}getToolbarItems(e){return[]}getInputRules(e){return[]}getFeatures(){return[this]}getPublicInterface(e){}},Q=new WeakMap,$=e=>Q.get(e),je=e=>{class t extends ke{constructor(...t){super(),Q.set(this,new e(...t))}}return t},Me=Symbol.for(`slottable-request-remove`);function Ne(e,t,n,r){let i=new CustomEvent(`slottable-request`,{bubbles:!1,composed:!1,detail:{name:t,slotName:n,data:r}});Object.defineProperties(i,{name:{value:t,enumerable:!0},slotName:{value:n,enumerable:!0},data:{value:r,enumerable:!0}}),e.dispatchEvent(i)}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return l}});
|
|
@@ -1830,38 +1830,8 @@ function X(e, t, n, r) {
|
|
|
1830
1830
|
};
|
|
1831
1831
|
}
|
|
1832
1832
|
//#endregion
|
|
1833
|
-
//#region src/lib/rich-text-editor/rte/utils/
|
|
1834
|
-
var De =
|
|
1835
|
-
constructor(e) {
|
|
1836
|
-
this.specs = e, this.attrs = {};
|
|
1837
|
-
for (let t of e) this.attrs[t.name] = { default: t.default };
|
|
1838
|
-
}
|
|
1839
|
-
fromDOM(e) {
|
|
1840
|
-
return Object.assign({}, ...this.specs.map((t) => ({ [t.name]: t.fromDOM(e) })));
|
|
1841
|
-
}
|
|
1842
|
-
getStyle(e) {
|
|
1843
|
-
return this.specs.flatMap((t) => t.toStyles(e)).join("; ");
|
|
1844
|
-
}
|
|
1845
|
-
getDOMAttrsProperties(e) {
|
|
1846
|
-
return this.specs.length ? { style: this.getStyle(e) } : {};
|
|
1847
|
-
}
|
|
1848
|
-
getDOMAttrs(e) {
|
|
1849
|
-
return this.specs.length ? [this.getDOMAttrsProperties(e)] : [];
|
|
1850
|
-
}
|
|
1851
|
-
extractFromNode(e) {
|
|
1852
|
-
return Object.assign({}, ...Object.keys(this.attrs).map((t) => ({ [t]: e.attrs[t] })));
|
|
1853
|
-
}
|
|
1854
|
-
}, Oe = class {
|
|
1855
|
-
constructor(e) {
|
|
1856
|
-
this.specs = e;
|
|
1857
|
-
}
|
|
1858
|
-
getAllowedMarksForNode(e) {
|
|
1859
|
-
return this.specs.filter((t) => !t.onNodeName || t.onNodeName === e).map((e) => e.markName);
|
|
1860
|
-
}
|
|
1861
|
-
getReferencedNodeNames() {
|
|
1862
|
-
return new Set(this.specs.map((e) => e.onNodeName).filter(Boolean));
|
|
1863
|
-
}
|
|
1864
|
-
}, ke = (e) => e.sort((e, t) => {
|
|
1833
|
+
//#region src/lib/rich-text-editor/rte/utils/impl.ts
|
|
1834
|
+
var De = Symbol("rte-internal-impl"), Oe = (e) => e.sort((e, t) => {
|
|
1865
1835
|
let n = e.priority - t.priority;
|
|
1866
1836
|
return n === 0 ? e.featureName === t.featureName ? 0 : e.featureName > t.featureName ? 1 : -1 : n;
|
|
1867
1837
|
}).map((e) => e.value), Z = {
|
|
@@ -1870,7 +1840,7 @@ var De = class {
|
|
|
1870
1840
|
default: 0,
|
|
1871
1841
|
low: 10,
|
|
1872
1842
|
lowest: 20
|
|
1873
|
-
},
|
|
1843
|
+
}, ke = class {}, Ae = class {
|
|
1874
1844
|
contribution(e, t) {
|
|
1875
1845
|
return {
|
|
1876
1846
|
featureName: this.name,
|
|
@@ -1904,15 +1874,15 @@ var De = class {
|
|
|
1904
1874
|
}
|
|
1905
1875
|
/* v8 ignore next */
|
|
1906
1876
|
getPublicInterface(e) {}
|
|
1907
|
-
}, Q = /* @__PURE__ */ new WeakMap(),
|
|
1908
|
-
class t extends
|
|
1877
|
+
}, Q = /* @__PURE__ */ new WeakMap(), $ = (e) => Q.get(e), je = (e) => {
|
|
1878
|
+
class t extends ke {
|
|
1909
1879
|
constructor(...t) {
|
|
1910
1880
|
super(), Q.set(this, new e(...t));
|
|
1911
1881
|
}
|
|
1912
1882
|
}
|
|
1913
1883
|
return t;
|
|
1914
|
-
},
|
|
1915
|
-
function
|
|
1884
|
+
}, Me = Symbol.for("slottable-request-remove");
|
|
1885
|
+
function Ne(e, t, n, r) {
|
|
1916
1886
|
let i = new CustomEvent("slottable-request", {
|
|
1917
1887
|
bubbles: !1,
|
|
1918
1888
|
composed: !1,
|
|
@@ -1938,4 +1908,4 @@ function Fe(e, t, n, r) {
|
|
|
1938
1908
|
}), e.dispatchEvent(i);
|
|
1939
1909
|
}
|
|
1940
1910
|
//#endregion
|
|
1941
|
-
export {
|
|
1911
|
+
export { _e as _, je as a, De as c, r as d, s as f, c as g, S as h, Z as i, be as l, C as m, Me as n, $ as o, F as p, Ae as r, Oe as s, Ne as t, we as u, l as v };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`./localized.cjs`),t=require(`./vivid-element.cjs`),n=require(`./repeat.cjs`),r=require(`./ref.cjs`),i=require(`./when.cjs`),a=require(`./decorate.cjs`),o=require(`./
|
|
1
|
+
const e=require(`./localized.cjs`),t=require(`./vivid-element.cjs`),n=require(`./repeat.cjs`),r=require(`./ref.cjs`),i=require(`./when.cjs`),a=require(`./decorate.cjs`),o=require(`./trapped-focus.cjs`),s=require(`./class-names.cjs`),c=require(`./picker-field.template.cjs`),l=require(`./scrollIntoView.cjs`),u=require(`./single-value-picker.cjs`);var d=e=>{let t=e.split(`:`);if(t.length!==3)return!1;let[n,r,i]=t;if(n.length!==2||r.length!==2||i.length!==2)return!1;let a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);return!(isNaN(a)||isNaN(o)||isNaN(s)||a<0||a>23||o<0||o>59||s<0||s>59)},f=e=>Number.parseInt(e,10),p=e=>e.toString().padStart(2,`0`),m=e=>{let[t,n,r]=e.split(`:`),i=f(t);return{hourStr:t,hours:i,minuteStr:n,minutes:f(n),secondStr:r,seconds:f(r),meridiem:i<12?`AM`:`PM`}},h=(e,t)=>e>t?1:e<t?-1:0,g=e=>e%12||12,_=(e,t)=>e===`AM`&&t<12||e===`PM`&&t>=12,v=(e,t,n)=>{let r=[],i=e?m(e).hours:0,a=t?m(t).hours:23;for(let e=i;e<=a;e++)n&&!_(n,e)||r.push({value:p(e),label:p(n?g(e):e)});return r},y=(e,t,n,r)=>{let i=[],a=0,o=59;if(n){let{hourStr:e,minutes:r}=m(n);t&&m(t).hourStr===e&&(a=r)}if(r){let{hourStr:e,minutes:n}=m(r);t&&m(t).hourStr===e&&(o=n)}for(let t=a;t<=o;t+=Math.max(1,e??1)){let e=p(t);i.push({value:e,label:e})}return i},b=(e,t,n,r)=>{let i=[],a=0,o=59;if(n){let e=m(n);t&&(m(t).hourStr===e.hourStr&&m(t).minuteStr)===e.minuteStr&&(a=e.seconds)}if(r){let e=m(r);t&&(m(t).hourStr===e.hourStr&&m(t).minuteStr)===e.minuteStr&&(o=e.seconds)}for(let t=a;t<=o;t+=Math.max(1,e)){let e=p(t);i.push({value:e,label:e})}return i},x=(e,t)=>{let n=[];return e&&m(e).meridiem===`PM`||n.push({value:`AM`,label:`AM`}),t&&m(t).meridiem===`AM`||n.push({value:`PM`,label:`PM`}),n},S={id:`hours`,getLabel:e=>e.locale.timePicker.hoursLabel,getOptions:e=>v(e.min,e.max,e.clock===`12h`?T.getSelectedOptionValue(e)??T.getOptions(e)[0].value:void 0),getSelectedOptionValue:e=>e.value?m(e.value).hourStr:void 0,updatedValue:(e,t)=>{if(e.value){let{minuteStr:n,secondStr:r}=m(e.value);return`${t}:${n}:${r}`}else return`${t}:00:00`}},C={id:`minutes`,getLabel:e=>e.locale.timePicker.minutesLabel,getOptions:e=>y(e.minutesStep,e.value,e.min,e.max),getSelectedOptionValue:e=>e.value?m(e.value).minuteStr:void 0,updatedValue:(e,t)=>{if(e.value){let{hourStr:n,secondStr:r}=m(e.value);return`${n}:${t}:${r}`}else return`00:${t}:00`}},w={id:`seconds`,getLabel:e=>e.locale.timePicker.secondsLabel,getOptions:e=>b(e.secondsStep,e.value,e.min,e.max),getSelectedOptionValue:e=>e.value?m(e.value).secondStr:void 0,updatedValue:(e,t)=>{if(e.value){let{hourStr:n,minuteStr:r}=m(e.value);return`${n}:${r}:${t}`}else return`00:00:${t}`}},T={id:`meridies`,getLabel:e=>e.locale.timePicker.meridiesLabel,getOptions:e=>x(e.min,e.max),getSelectedOptionValue:e=>e.value?m(e.value).meridiem:void 0,updatedValue:(e,t)=>{if(e.value){let{hours:n,minuteStr:r,secondStr:i}=m(e.value),a=n;return t===`AM`&&n>=12?a-=12:t===`PM`&&n<12&&(a+=12),`${p(a)}:${r}:${i}`}else if(t===`AM`)return`00:00:00`;else return`12:00:00`}},E=e=>e.secondsStep!==void 0,D=e=>e.clock===`12h`,O=(e,t,n)=>{M(e,t.updatedValue(e,n)),A(e,t.id,n,`start`);let r=(e.shadowRoot.querySelector(`#${t.id}`)?.closest(`.picker-wrapper`)?.nextElementSibling)?.querySelector(`.picker`);r?r.focus():e.$emit(`last-column-selected`,void 0,{bubbles:!1})},k=(e,t,n)=>{let r=t.getOptions(e),i=t.getSelectedOptionValue(e),a={ArrowUp:-1,ArrowDown:1}[n.key];if(a){n.preventDefault();let o=r.findIndex(e=>e.value===i),s=r[((o===-1?0:o+a)+r.length)%r.length].value;M(e,t.updatedValue(e,s)),A(e,t.id,s,`nearest`),e._clearFocusedClasses()}return!0},A=(e,t,n,r)=>{let i=e.shadowRoot.querySelector(`#${t}-${n}`);i&&l.t(i,i.parentElement,r)},j=(e,t)=>{if(t.key===`Tab`){let n=e.shadowRoot.querySelectorAll(`.picker`),r=t.shiftKey?n[0]:n[n.length-1];e.shadowRoot.activeElement!==r&&o.n(t),e._applyFocusedClass()}return!0},M=(e,t)=>{e.$emit(`change`,t,{bubbles:!1,composed:!1})},N=e=>t.d`<div class="picker-wrapper">
|
|
2
2
|
<ul
|
|
3
3
|
id="${e.id}"
|
|
4
4
|
class="picker"
|
|
@@ -10,7 +10,7 @@ const e=require(`./localized.cjs`),t=require(`./vivid-element.cjs`),n=require(`.
|
|
|
10
10
|
>
|
|
11
11
|
${n.n(t=>e.getOptions(t),t.d`<li
|
|
12
12
|
id="${t=>`${e.id}-${t.value}`}"
|
|
13
|
-
class="${(t,n)=>
|
|
13
|
+
class="${(t,n)=>s.t(`option`,[`selected`,e.getSelectedOptionValue(n.parent)===t.value])}"
|
|
14
14
|
aria-selected="${(t,n)=>e.getSelectedOptionValue(n.parent)===t.value}"
|
|
15
15
|
role="option"
|
|
16
16
|
@click="${(t,n)=>O(n.parent,e,t.value)}"
|
|
@@ -27,7 +27,7 @@ const e=require(`./localized.cjs`),t=require(`./vivid-element.cjs`),n=require(`.
|
|
|
27
27
|
${N(S)} ${N(C)}
|
|
28
28
|
${i.t(E,N(w))}
|
|
29
29
|
${i.t(D,N(T))}
|
|
30
|
-
</div>`,F=class extends e.t(t.t){constructor(...e){super(...e),this.minutesStep=1,this.clock=`24h`,this.focusedPickerClass=`focused`,this._onFocusOut=()=>{this._clearFocusedClasses()},this._onPointerDown=()=>{this._clearFocusedClasses()}}valueChanged(e,t){t!==void 0&&!d(t)&&(this.value=void 0)}scrollSelectedOptionsToTop(){S.getSelectedOptionValue(this)&&A(this,`hours`,S.getSelectedOptionValue(this),`start`),C.getSelectedOptionValue(this)&&A(this,`minutes`,C.getSelectedOptionValue(this),`start`),E(this)&&w.getSelectedOptionValue(this)&&A(this,`seconds`,w.getSelectedOptionValue(this),`start`),D(this)&&T.getSelectedOptionValue(this)&&A(this,`meridies`,T.getSelectedOptionValue(this),`start`)}focus(e){this.shadowRoot.querySelector(`.picker`).focus(e),this._applyFocusedClass()}_applyFocusedClass(){let e=this.shadowRoot.querySelectorAll(`.picker`);requestAnimationFrame(()=>{let t=this.shadowRoot.activeElement;e.forEach(e=>{e===t?e.parentElement?.classList.add(this.focusedPickerClass):e.parentElement?.classList.remove(this.focusedPickerClass)})})}_clearFocusedClasses(){this.shadowRoot.querySelectorAll(`.picker`).forEach(e=>{e.parentElement?.classList.remove(this.focusedPickerClass)})}};a.t([t.T],F.prototype,`value`,void 0),a.t([t.T],F.prototype,`minutesStep`,void 0),a.t([t.T],F.prototype,`secondsStep`,void 0),a.t([t.T],F.prototype,`clock`,void 0),a.t([t.T],F.prototype,`min`,void 0),a.t([t.T],F.prototype,`max`,void 0);var I=t.o(`inline-time-picker`,F,P,[],{styles:`:host{display:inline-block}.time-pickers{block-size:calc(28px * var(--_inline-time-picker-num-options-visible) + 4px * (var(--_inline-time-picker-num-options-visible) - 1));justify-content:center;gap:4px;padding:4px;display:flex;overflow:hidden}.time-pickers .picker-wrapper{border-radius:4px;flex-direction:column;display:flex;position:relative}.time-pickers .picker-wrapper.focused:has(.picker:focus-visible){--focus-stroke-gap-color:transparent;--focus-inset:-2px;box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}.time-pickers .picker{scrollbar-width:none;border-radius:4px;flex-direction:column;gap:4px;inline-size:50px;margin:0 -4px;padding:0 4px;list-style:none;display:flex;position:relative;overflow:hidden scroll}@media (hover:hover){.time-pickers .picker:hover{scrollbar-width:auto}}.time-pickers .picker:after{block-size:calc(28px * (var(--_inline-time-picker-num-options-visible) - 1) + 4px * (var(--_inline-time-picker-num-options-visible) - 1 - 1));content:"";flex-shrink:0;display:block}.time-pickers .picker:focus-visible{outline:none}.time-pickers .option{--_connotation-color-primary:var(--vvd-time-picker-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-firm:var(--vvd-time-picker-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-faint:var(--vvd-time-picker-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-time-picker-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-dim:var(--vvd-time-picker-accent-dim,var(--vvd-color-neutral-200));--_connotation-color-pale:var(--vvd-time-picker-accent-pale,var(--vvd-color-neutral-300));--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.time-pickers .option:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.time-pickers .option.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.time-pickers .option:active:where(:not(.disabled,:disabled)),.time-pickers .option.active:where(:not(.disabled,:disabled)),.time-pickers .option.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.time-pickers .option.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.time-pickers .option.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.time-pickers .option.selected:disabled,.time-pickers .option.selected.disabled{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:var(--vvd-color-neutral-200);--_appearance-color-outline:transparent}.time-pickers .option{background-color:var(--_appearance-color-fill);block-size:28px;color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;inline-size:50px;display:flex}.time-pickers .picker-wrapper:not(.focused) .picker:focus-visible .option.selected{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}`,shadowOptions:{delegatesFocus:!0}});t.s(I);var L=
|
|
30
|
+
</div>`,F=class extends e.t(t.t){constructor(...e){super(...e),this.minutesStep=1,this.clock=`24h`,this.focusedPickerClass=`focused`,this._onFocusOut=()=>{this._clearFocusedClasses()},this._onPointerDown=()=>{this._clearFocusedClasses()}}valueChanged(e,t){t!==void 0&&!d(t)&&(this.value=void 0)}scrollSelectedOptionsToTop(){S.getSelectedOptionValue(this)&&A(this,`hours`,S.getSelectedOptionValue(this),`start`),C.getSelectedOptionValue(this)&&A(this,`minutes`,C.getSelectedOptionValue(this),`start`),E(this)&&w.getSelectedOptionValue(this)&&A(this,`seconds`,w.getSelectedOptionValue(this),`start`),D(this)&&T.getSelectedOptionValue(this)&&A(this,`meridies`,T.getSelectedOptionValue(this),`start`)}focus(e){this.shadowRoot.querySelector(`.picker`).focus(e),this._applyFocusedClass()}_applyFocusedClass(){let e=this.shadowRoot.querySelectorAll(`.picker`);requestAnimationFrame(()=>{let t=this.shadowRoot.activeElement;e.forEach(e=>{e===t?e.parentElement?.classList.add(this.focusedPickerClass):e.parentElement?.classList.remove(this.focusedPickerClass)})})}_clearFocusedClasses(){this.shadowRoot.querySelectorAll(`.picker`).forEach(e=>{e.parentElement?.classList.remove(this.focusedPickerClass)})}};a.t([t.T],F.prototype,`value`,void 0),a.t([t.T],F.prototype,`minutesStep`,void 0),a.t([t.T],F.prototype,`secondsStep`,void 0),a.t([t.T],F.prototype,`clock`,void 0),a.t([t.T],F.prototype,`min`,void 0),a.t([t.T],F.prototype,`max`,void 0);var I=t.o(`inline-time-picker`,F,P,[],{styles:`:host{display:inline-block}.time-pickers{block-size:calc(28px * var(--_inline-time-picker-num-options-visible) + 4px * (var(--_inline-time-picker-num-options-visible) - 1));justify-content:center;gap:4px;padding:4px;display:flex;overflow:hidden}.time-pickers .picker-wrapper{border-radius:4px;flex-direction:column;display:flex;position:relative}.time-pickers .picker-wrapper.focused:has(.picker:focus-visible){--focus-stroke-gap-color:transparent;--focus-inset:-2px;box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}.time-pickers .picker{scrollbar-width:none;border-radius:4px;flex-direction:column;gap:4px;inline-size:50px;margin:0 -4px;padding:0 4px;list-style:none;display:flex;position:relative;overflow:hidden scroll}@media (hover:hover){.time-pickers .picker:hover{scrollbar-width:auto}}.time-pickers .picker:after{block-size:calc(28px * (var(--_inline-time-picker-num-options-visible) - 1) + 4px * (var(--_inline-time-picker-num-options-visible) - 1 - 1));content:"";flex-shrink:0;display:block}.time-pickers .picker:focus-visible{outline:none}.time-pickers .option{--_connotation-color-primary:var(--vvd-time-picker-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-firm:var(--vvd-time-picker-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-faint:var(--vvd-time-picker-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-time-picker-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-dim:var(--vvd-time-picker-accent-dim,var(--vvd-color-neutral-200));--_connotation-color-pale:var(--vvd-time-picker-accent-pale,var(--vvd-color-neutral-300));--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.time-pickers .option:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.time-pickers .option.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.time-pickers .option:active:where(:not(.disabled,:disabled)),.time-pickers .option.active:where(:not(.disabled,:disabled)),.time-pickers .option.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.time-pickers .option.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.time-pickers .option.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.time-pickers .option.selected:disabled,.time-pickers .option.selected.disabled{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:var(--vvd-color-neutral-200);--_appearance-color-outline:transparent}.time-pickers .option{background-color:var(--_appearance-color-fill);block-size:28px;color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;inline-size:50px;display:flex}.time-pickers .picker-wrapper:not(.focused) .picker:focus-visible .option.selected{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}`,shadowOptions:{delegatesFocus:!0}});t.s(I);var L=e=>{class n extends e{constructor(...e){super(...e),this.minutesStep=null,this.secondsStep=null}get _displaySeconds(){return this.secondsStep!==null}get _use12hClock(){return this.clock?this.clock===`12h`:this.locale.timePicker.defaultTo12HourClock}get _timePlaceholder(){let e=`hh:mm`;return this._displaySeconds&&(e+=`:ss`),this._use12hClock&&(e+=` aa`),e}#e={handleChange:()=>{this.value&&(this._presentationValue=this._toPresentationValue(this.value))}};#t;#n(){this.#t=t.w.binding(()=>this._use12hClock,this.#e),this.#t.observe(this,t.C.default)}#r(){this.#t.dispose()}connectedCallback(){super.connectedCallback(),this.#n()}disconnectedCallback(){super.disconnectedCallback(),this.#r()}_onPickerButtonClick(){super._onPickerButtonClick(),this._popupOpen&&(t.O.process(),this._inlineTimePickerEl.scrollSelectedOptionsToTop())}_onInlineTimePickerChange(e){this._updateValueDueToUserInteraction(this._withUpdatedTime(e.detail),!1)}_onInlineTimePickerLastColumnSelected(){this._closePopup()}}return a.t([t.l({attribute:`minutes-step`,converter:t.u})],n.prototype,`minutesStep`,void 0),a.t([t.l({attribute:`seconds-step`,converter:t.u})],n.prototype,`secondsStep`,void 0),a.t([t.l],n.prototype,`clock`,void 0),a.t([t.E],n.prototype,`_use12hClock`,null),n},R=(e,t,n)=>{let r=m(e),i=`${p(n?g(r.hours):r.hours)}:${r.minuteStr}`;return t&&(i+=`:${r.secondStr}`),n&&(i+=` ${r.meridiem}`),i},z=e=>e>=`0`&&e<=`9`,B=(e,t)=>{let n=e.toLowerCase(),r=[],i;for(let e=0;e<n.length;e++){let t=n[e];if(t===`a`&&n[e+1]===`m`&&(e++,i=`AM`),t===`p`&&n[e+1]===`m`&&(e++,i=`PM`),z(t)){let i=t;for(;z(n[e+1]);)e++,i+=n[e];r.push(Number.parseInt(i,10))}}if(r.length===0||r.length>3||i&&(r[0]<1||r[0]>12))throw Error(`Invalid time format`);(i||t)&&r[0]===12&&(r[0]=0),i===`PM`&&(r[0]+=12);let[a,o=0,s=0]=r;if(a>23||o>59||s>59)throw Error(`Invalid value`);return[a,o,s].map(p).join(`:`)},V={fromView:e=>e&&d(e)?e:``,toView(e){return e}},H=class extends L(u.t(c.n)){_toPresentationValue(e){return R(e,this._displaySeconds,this._use12hClock)}_parsePresentationValue(e){return B(e,this._use12hClock)}get _timeValue(){return this.value}_withUpdatedTime(e){return e}get _resolvedMinTime(){return this.min||null}get _resolvedMaxTime(){return this.max||null}minChanged(e,t){this.proxy instanceof HTMLInputElement&&(this.proxy.min=t,this.validate())}maxChanged(e,t){this.proxy instanceof HTMLInputElement&&(this.proxy.max=t,this.validate())}constructor(){super(),this._isValidValue=d,this.min=``,this.max=``,this.proxy.type=`time`,this.proxy.step=`1`}get _textFieldPlaceholder(){return this._timePlaceholder}get _pickerButtonIcon(){return`clock-line`}get _pickerButtonLabel(){return this.value?this.locale.timePicker.changeTimeLabel(this._toPresentationValue(this.value)):this.locale.timePicker.chooseTimeLabel}_onPickerButtonClick(){super._onPickerButtonClick(),this._popupOpen&&(t.O.process(),this._focusableElsWithinDialog()[0]?.focus())}get _dialogLabel(){return this.locale.timePicker.chooseTimeLabel}_focusableElsWithinDialog(){return this._dialogEl.querySelectorAll(`#inline-time-picker, .vwc-button`)}_getCustomValidationError(){return this._isPresentationValueInvalid()?this.locale.timePicker.invalidTimeError:null}};a.t([t.l({converter:V})],H.prototype,`min`,void 0),a.t([t.l({converter:V})],H.prototype,`max`,void 0);var U=(e,n)=>{let i=e.tagFor(F);return t.d`
|
|
31
31
|
<${i}
|
|
32
32
|
id='inline-time-picker'
|
|
33
33
|
${r.t(`_inlineTimePickerEl`)}
|
|
@@ -43,4 +43,4 @@ const e=require(`./localized.cjs`),t=require(`./vivid-element.cjs`),n=require(`.
|
|
|
43
43
|
@last-column-selected='${e=>e._onInlineTimePickerLastColumnSelected()}'
|
|
44
44
|
>
|
|
45
45
|
</${i}>
|
|
46
|
-
`};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return
|
|
46
|
+
`};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return U}});
|
|
@@ -4,11 +4,11 @@ import { n as f } from "./repeat.js";
|
|
|
4
4
|
import { t as p } from "./ref.js";
|
|
5
5
|
import { t as m } from "./when.js";
|
|
6
6
|
import { t as h } from "./decorate.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { n as g } from "./trapped-focus.js";
|
|
8
|
+
import { t as _ } from "./class-names.js";
|
|
9
9
|
import { n as v } from "./picker-field.template.js";
|
|
10
|
-
import { t as y } from "./
|
|
11
|
-
import { t as b } from "./
|
|
10
|
+
import { t as y } from "./scrollIntoView.js";
|
|
11
|
+
import { t as b } from "./single-value-picker.js";
|
|
12
12
|
//#region src/shared/datetime/time.ts
|
|
13
13
|
var x = (e) => {
|
|
14
14
|
let t = e.split(":");
|
|
@@ -142,11 +142,11 @@ var x = (e) => {
|
|
|
142
142
|
return !0;
|
|
143
143
|
}, B = (e, t, n, r) => {
|
|
144
144
|
let i = e.shadowRoot.querySelector(`#${t}-${n}`);
|
|
145
|
-
i &&
|
|
145
|
+
i && y(i, i.parentElement, r);
|
|
146
146
|
}, V = (e, t) => {
|
|
147
147
|
if (t.key === "Tab") {
|
|
148
148
|
let n = e.shadowRoot.querySelectorAll(".picker"), r = t.shiftKey ? n[0] : n[n.length - 1];
|
|
149
|
-
e.shadowRoot.activeElement !== r &&
|
|
149
|
+
e.shadowRoot.activeElement !== r && g(t), e._applyFocusedClass();
|
|
150
150
|
}
|
|
151
151
|
return !0;
|
|
152
152
|
}, H = (e, t) => {
|
|
@@ -166,7 +166,7 @@ var x = (e) => {
|
|
|
166
166
|
>
|
|
167
167
|
${f((t) => e.getOptions(t), a`<li
|
|
168
168
|
id="${(t) => `${e.id}-${t.value}`}"
|
|
169
|
-
class="${(t, n) =>
|
|
169
|
+
class="${(t, n) => _("option", ["selected", e.getSelectedOptionValue(n.parent) === t.value])}"
|
|
170
170
|
aria-selected="${(t, n) => e.getSelectedOptionValue(n.parent) === t.value}"
|
|
171
171
|
role="option"
|
|
172
172
|
@click="${(t, n) => R(n.parent, e, t.value)}"
|
|
@@ -224,30 +224,8 @@ var K = s("inline-time-picker", G, W, [], {
|
|
|
224
224
|
});
|
|
225
225
|
c(K);
|
|
226
226
|
//#endregion
|
|
227
|
-
//#region src/shared/
|
|
228
|
-
var q = (e
|
|
229
|
-
let r = w(e), i = `${C(n ? E(r.hours) : r.hours)}:${r.minuteStr}`;
|
|
230
|
-
return t && (i += `:${r.secondStr}`), n && (i += ` ${r.meridiem}`), i;
|
|
231
|
-
}, J = (e) => e >= "0" && e <= "9", Y = (e, t) => {
|
|
232
|
-
let n = e.toLowerCase(), r = [], i;
|
|
233
|
-
for (let e = 0; e < n.length; e++) {
|
|
234
|
-
let t = n[e];
|
|
235
|
-
if (t === "a" && n[e + 1] === "m" && (e++, i = "AM"), t === "p" && n[e + 1] === "m" && (e++, i = "PM"), J(t)) {
|
|
236
|
-
let i = t;
|
|
237
|
-
for (; J(n[e + 1]);) e++, i += n[e];
|
|
238
|
-
r.push(Number.parseInt(i, 10));
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
if (r.length === 0 || r.length > 3 || i && (r[0] < 1 || r[0] > 12)) throw Error("Invalid time format");
|
|
242
|
-
(i || t) && r[0] === 12 && (r[0] = 0), i === "PM" && (r[0] += 12);
|
|
243
|
-
let [a, o = 0, s = 0] = r;
|
|
244
|
-
if (a > 23 || o > 59 || s > 59) throw Error("Invalid value");
|
|
245
|
-
return [
|
|
246
|
-
a,
|
|
247
|
-
o,
|
|
248
|
-
s
|
|
249
|
-
].map(C).join(":");
|
|
250
|
-
}, X = (e) => {
|
|
227
|
+
//#region src/shared/picker-field/mixins/time-selection-picker.ts
|
|
228
|
+
var q = (e) => {
|
|
251
229
|
class i extends e {
|
|
252
230
|
constructor(...e) {
|
|
253
231
|
super(...e), this.minutesStep = null, this.secondsStep = null;
|
|
@@ -295,17 +273,39 @@ var q = (e, t, n) => {
|
|
|
295
273
|
attribute: "seconds-step",
|
|
296
274
|
converter: u
|
|
297
275
|
})], i.prototype, "secondsStep", void 0), h([o], i.prototype, "clock", void 0), h([n], i.prototype, "_use12hClock", null), i;
|
|
276
|
+
}, J = (e, t, n) => {
|
|
277
|
+
let r = w(e), i = `${C(n ? E(r.hours) : r.hours)}:${r.minuteStr}`;
|
|
278
|
+
return t && (i += `:${r.secondStr}`), n && (i += ` ${r.meridiem}`), i;
|
|
279
|
+
}, Y = (e) => e >= "0" && e <= "9", X = (e, t) => {
|
|
280
|
+
let n = e.toLowerCase(), r = [], i;
|
|
281
|
+
for (let e = 0; e < n.length; e++) {
|
|
282
|
+
let t = n[e];
|
|
283
|
+
if (t === "a" && n[e + 1] === "m" && (e++, i = "AM"), t === "p" && n[e + 1] === "m" && (e++, i = "PM"), Y(t)) {
|
|
284
|
+
let i = t;
|
|
285
|
+
for (; Y(n[e + 1]);) e++, i += n[e];
|
|
286
|
+
r.push(Number.parseInt(i, 10));
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (r.length === 0 || r.length > 3 || i && (r[0] < 1 || r[0] > 12)) throw Error("Invalid time format");
|
|
290
|
+
(i || t) && r[0] === 12 && (r[0] = 0), i === "PM" && (r[0] += 12);
|
|
291
|
+
let [a, o = 0, s = 0] = r;
|
|
292
|
+
if (a > 23 || o > 59 || s > 59) throw Error("Invalid value");
|
|
293
|
+
return [
|
|
294
|
+
a,
|
|
295
|
+
o,
|
|
296
|
+
s
|
|
297
|
+
].map(C).join(":");
|
|
298
298
|
}, Z = {
|
|
299
299
|
fromView: (e) => e && x(e) ? e : "",
|
|
300
300
|
toView(e) {
|
|
301
301
|
return e;
|
|
302
302
|
}
|
|
303
|
-
}, Q = class extends
|
|
303
|
+
}, Q = class extends q(b(v)) {
|
|
304
304
|
_toPresentationValue(e) {
|
|
305
|
-
return
|
|
305
|
+
return J(e, this._displaySeconds, this._use12hClock);
|
|
306
306
|
}
|
|
307
307
|
_parsePresentationValue(e) {
|
|
308
|
-
return
|
|
308
|
+
return X(e, this._use12hClock);
|
|
309
309
|
}
|
|
310
310
|
get _timeValue() {
|
|
311
311
|
return this.value;
|
|
@@ -376,4 +376,4 @@ var $ = (e, t) => {
|
|
|
376
376
|
`;
|
|
377
377
|
};
|
|
378
378
|
//#endregion
|
|
379
|
-
export {
|
|
379
|
+
export { X as a, T as c, J as i, x as l, Q as n, q as o, Z as r, K as s, $ as t };
|