@covalent/components 8.0.0 → 8.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/_commonjsHelpers-2367a3a2.js +1 -0
  2. package/_commonjsHelpers-de2741aa.mjs +28 -0
  3. package/action-ribbon.mjs +2 -2
  4. package/alert.mjs +2 -2
  5. package/app-shell/app-shell.d.ts +2 -0
  6. package/app-shell/app-shell.d.ts.map +1 -1
  7. package/app-shell.js +1 -1
  8. package/app-shell.mjs +22 -12
  9. package/button.mjs +3 -3
  10. package/check-list-item.js +8 -6
  11. package/check-list-item.mjs +34 -28
  12. package/checkbox.mjs +4 -4
  13. package/chip-13877bb8.mjs +3116 -0
  14. package/chip-3c12a33d.js +493 -0
  15. package/chip-set.js +76 -0
  16. package/chip-set.mjs +532 -0
  17. package/chip.js +1 -0
  18. package/chip.mjs +12 -0
  19. package/circular-progress.mjs +1 -1
  20. package/code-snippet.js +13 -1
  21. package/code-snippet.mjs +12252 -7
  22. package/{dialog-3ca1b701.mjs → dialog-3444dd4d.mjs} +8 -8
  23. package/dialog.mjs +2 -2
  24. package/drawer.mjs +2 -2
  25. package/empty-state.js +1 -1
  26. package/empty-state.mjs +3 -3
  27. package/expansion-panel-item.js +25 -0
  28. package/expansion-panel-item.mjs +107 -0
  29. package/expansion-panel.js +7 -0
  30. package/expansion-panel.mjs +59 -0
  31. package/{form-element-ffcf59ff.mjs → form-element-7353b3c4.mjs} +1 -1
  32. package/formfield.js +80 -0
  33. package/formfield.mjs +277 -0
  34. package/{foundation-39dc72d2.mjs → foundation-eff81c1e.mjs} +1 -1
  35. package/icon-button.mjs +2 -2
  36. package/icon-check-toggle.mjs +4 -4
  37. package/icon-radio-toggle.mjs +4 -4
  38. package/icon.mjs +2 -2
  39. package/index.js +1 -568
  40. package/index.mjs +113 -3728
  41. package/linear-progress.mjs +4 -4
  42. package/list/check-list-item.d.ts.map +1 -1
  43. package/list/radio-list-item.d.ts.map +1 -1
  44. package/{mwc-list-item.css-b0009fc7.mjs → list-item-1fc0d619.mjs} +3 -1
  45. package/{mwc-list-item.css-25adc0c4.js → list-item-209613bf.js} +2 -1
  46. package/list-item.js +7 -1
  47. package/list-item.mjs +29 -8
  48. package/list.js +1 -1
  49. package/list.mjs +5 -5
  50. package/menu.mjs +5 -5
  51. package/{mwc-checkbox-base-f10fd709.mjs → mwc-checkbox-base-afeeff16.mjs} +3 -3
  52. package/{mwc-drawer-base-135de8a5.mjs → mwc-drawer-base-0c2b4060.mjs} +1 -1
  53. package/{mwc-icon-bf656cf5.mjs → mwc-icon-28b10c70.mjs} +1 -1
  54. package/{mwc-line-ripple-directive-b24a914e.mjs → mwc-line-ripple-directive-315e996d.mjs} +1 -1
  55. package/{mwc-list-base-76e37212.mjs → mwc-list-base-8aa5bfd8.mjs} +2 -2
  56. package/{mwc-list-item-base-fe4398c3.mjs → mwc-list-item-base-bf1a075b.mjs} +2 -2
  57. package/{mwc-menu-base-c4bc88ea.mjs → mwc-menu-base-872420a4.mjs} +2 -2
  58. package/{mwc-radio-base-a374fbd9.mjs → mwc-radio-base-18a887dd.mjs} +3 -3
  59. package/{mwc-slider.css-8b6f275c.mjs → mwc-slider.css-03537082.mjs} +3 -3
  60. package/{mwc-tab-base-be0c887f.mjs → mwc-tab-base-cd1570e4.mjs} +2 -2
  61. package/{mwc-top-app-bar-base-55da3fe4.mjs → mwc-top-app-bar-base-c7380903.mjs} +1 -1
  62. package/nav-list-item.js +2 -2
  63. package/nav-list-item.mjs +29 -29
  64. package/package.json +16 -1
  65. package/radio-list-item.js +8 -6
  66. package/radio-list-item.mjs +36 -30
  67. package/radio.mjs +4 -4
  68. package/{ripple-handlers-f37f21cf.mjs → ripple-handlers-38a43e50.mjs} +1 -1
  69. package/select.mjs +8 -8
  70. package/side-sheet.mjs +2 -2
  71. package/slider-range.mjs +4 -4
  72. package/slider.mjs +8 -8
  73. package/snackbar.mjs +1 -1
  74. package/style.css +1 -1
  75. package/switch.mjs +3 -3
  76. package/tab-bar.mjs +3 -3
  77. package/tab.mjs +3 -3
  78. package/textarea.mjs +4 -4
  79. package/textfield/textfield.d.ts +1 -0
  80. package/textfield/textfield.d.ts.map +1 -1
  81. package/{textfield-63d1859a.mjs → textfield-a2e37241.mjs} +3 -3
  82. package/textfield.js +1 -1
  83. package/textfield.mjs +7 -4
  84. package/toolbar.mjs +2 -2
  85. package/tooltip.mjs +1 -1
  86. package/top-app-bar-fixed.mjs +2 -2
  87. package/top-app-bar.mjs +2 -2
  88. package/tree-list-item.mjs +2 -2
  89. package/{tslib.es6-f3e988cd.mjs → tslib.es6-226581a4.mjs} +5 -5
  90. package/code-snippet-2137b11c.js +0 -13
  91. package/code-snippet-ccca324f.mjs +0 -12278
  92. package/list-item-04b6ffa1.js +0 -8
  93. package/list-item-1c4f9e23.mjs +0 -32
package/index.mjs CHANGED
@@ -1,3743 +1,128 @@
1
- var me = Object.defineProperty;
2
- var fe = (i, e, t) => e in i ? me(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var f = (i, e, t) => (fe(i, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { CovalentActionRibbon as nr } from "./action-ribbon.mjs";
5
- import { CovalentAlert as or } from "./alert.mjs";
6
- import { CovalentAppShell as cr } from "./app-shell.mjs";
7
- import { CovalentButton as lr } from "./button.mjs";
8
- import { CovalentCheckbox as dr } from "./checkbox.mjs";
9
- import { CovalentCard as hr } from "./card.mjs";
10
- import { s as Bt, x as $, i as Gt, r as Wt, e as jt } from "./query-assigned-elements-4a39219d.mjs";
11
- import { a as ve } from "./utils-2932417c.mjs";
12
- import { _ as U, a as T, b as I, c as H, d as ge, e as _e } from "./tslib.es6-f3e988cd.mjs";
13
- import { n as R } from "./property-9b6ea53b.mjs";
14
- import { i as $t } from "./query-d843aa92.mjs";
15
- import { o as ye } from "./class-map-4b94b017.mjs";
16
- import { g as y } from "./code-snippet-ccca324f.mjs";
17
- import { C as fr } from "./code-snippet-ccca324f.mjs";
18
- import { CovalentCircularProgress as gr } from "./circular-progress.mjs";
19
- import { C as yr } from "./dialog-3ca1b701.mjs";
20
- import { CovalentDrawer as br } from "./drawer.mjs";
21
- import { CovalentEmptyState as Sr } from "./empty-state.mjs";
22
- import { CovalentIcon as Cr } from "./icon.mjs";
23
- import { CovalentIconButton as Tr } from "./icon-button.mjs";
24
- import { CovalentIconCheckToggle as Nr } from "./icon-check-toggle.mjs";
25
- import { CovalentIconRadioToggle as Dr } from "./icon-radio-toggle.mjs";
26
- import { CovalentLinearProgress as Pr } from "./linear-progress.mjs";
27
- import { CovalentCheckListItem as Fr } from "./check-list-item.mjs";
28
- import { CovalentList as Mr } from "./list.mjs";
29
- import { C as Hr } from "./list-item-1c4f9e23.mjs";
30
- import { CovalentNavRailListItem as Br } from "./nav-list-item.mjs";
31
- import { CovalentRadioListItem as Wr } from "./radio-list-item.mjs";
32
- import { CovalentMenu as $r } from "./menu.mjs";
33
- import { CovalentRadio as Vr } from "./radio.mjs";
34
- import { CovalentSelect as Xr } from "./select.mjs";
35
- import { CovalentSideSheet as Zr } from "./side-sheet.mjs";
36
- import { CovalentSlider as Qr } from "./slider.mjs";
37
- import { CovalentSliderRange as eo } from "./slider-range.mjs";
38
- import { CovalentSnackbar as no } from "./snackbar.mjs";
39
- import { CovalentStatusHeader as oo } from "./status-header.mjs";
40
- import { CovalentStatusHeaderItem as co } from "./status-header-item.mjs";
41
- import { CovalentSwitch as lo } from "./switch.mjs";
42
- import { CovalentTab as uo } from "./tab.mjs";
43
- import { CovalentTabBar as mo } from "./tab-bar.mjs";
44
- import { CovalentTextArea as vo } from "./textarea.mjs";
45
- import { CovalentTextField as _o } from "./textfield.mjs";
46
- import { CovalentTextLockup as Ao } from "./text-lockup.mjs";
47
- import { CovalentToolbar as Eo } from "./toolbar.mjs";
48
- import { CovalentTooltip as wo } from "./tooltip.mjs";
49
- import { CovalentTopAppBar as Io } from "./top-app-bar.mjs";
50
- import { CovalentTopAppBarFixed as Ro } from "./top-app-bar-fixed.mjs";
51
- import { CovalentTreeList as Oo } from "./tree-list.mjs";
52
- import { CovalentTreeListItem as xo } from "./tree-list-item.mjs";
53
- import { CovalentTypography as Lo } from "./typography.mjs";
1
+ import { CovalentActionRibbon as j } from "./action-ribbon.mjs";
2
+ import { CovalentAlert as z } from "./alert.mjs";
3
+ import { CovalentAppShell as J } from "./app-shell.mjs";
4
+ import { CovalentButton as O } from "./button.mjs";
5
+ import { CovalentCheckbox as U } from "./checkbox.mjs";
6
+ import { CovalentCard as W } from "./card.mjs";
7
+ import { C as Y } from "./chip-13877bb8.mjs";
8
+ import { CovalentChipSet as _ } from "./chip-set.mjs";
9
+ import { CovalentCircularProgress as oo } from "./circular-progress.mjs";
10
+ import { CovalentCodeSnippet as ro } from "./code-snippet.mjs";
11
+ import { C as po } from "./dialog-3444dd4d.mjs";
12
+ import { CovalentDrawer as ao } from "./drawer.mjs";
13
+ import { CovalentEmptyState as lo } from "./empty-state.mjs";
14
+ import { CovalentIcon as Co } from "./icon.mjs";
15
+ import { CovalentIconButton as vo } from "./icon-button.mjs";
16
+ import { CovalentIconCheckToggle as so } from "./icon-check-toggle.mjs";
17
+ import { CovalentIconRadioToggle as To } from "./icon-radio-toggle.mjs";
18
+ import { CovalentLinearProgress as ho } from "./linear-progress.mjs";
19
+ import { CovalentCheckListItem as go } from "./check-list-item.mjs";
20
+ import { CovalentList as bo } from "./list.mjs";
21
+ import { CovalentListItem as Ao } from "./list-item.mjs";
22
+ import { CovalentNavRailListItem as ko } from "./nav-list-item.mjs";
23
+ import { CovalentRadioListItem as yo } from "./radio-list-item.mjs";
24
+ import { CovalentMenu as Do } from "./menu.mjs";
25
+ import { CovalentRadio as Ho } from "./radio.mjs";
26
+ import { CovalentSelect as Eo } from "./select.mjs";
27
+ import { CovalentSideSheet as No } from "./side-sheet.mjs";
28
+ import { CovalentSlider as qo } from "./slider.mjs";
29
+ import { CovalentSliderRange as Go } from "./slider-range.mjs";
30
+ import { CovalentSnackbar as Ko } from "./snackbar.mjs";
31
+ import { CovalentStatusHeader as Qo } from "./status-header.mjs";
32
+ import { CovalentStatusHeaderItem as Vo } from "./status-header-item.mjs";
33
+ import { CovalentSwitch as Xo } from "./switch.mjs";
34
+ import { CovalentTab as Zo } from "./tab.mjs";
35
+ import { CovalentTabBar as $o } from "./tab-bar.mjs";
36
+ import { CovalentTextArea as tt } from "./textarea.mjs";
37
+ import { CovalentTextField as et } from "./textfield.mjs";
38
+ import { CovalentTextLockup as mt } from "./text-lockup.mjs";
39
+ import { CovalentToolbar as it } from "./toolbar.mjs";
40
+ import { CovalentTooltip as nt } from "./tooltip.mjs";
41
+ import { CovalentTopAppBar as xt } from "./top-app-bar.mjs";
42
+ import { CovalentTopAppBarFixed as ft } from "./top-app-bar-fixed.mjs";
43
+ import { CovalentTreeList as ct } from "./tree-list.mjs";
44
+ import { CovalentTreeListItem as St } from "./tree-list-item.mjs";
45
+ import { CovalentTypography as ht } from "./typography.mjs";
46
+ import "./query-assigned-elements-4a39219d.mjs";
47
+ import "./utils-2932417c.mjs";
54
48
  import "./observer-be7b92e2.mjs";
55
- import "./foundation-39dc72d2.mjs";
56
- import "./mwc-drawer-base-135de8a5.mjs";
49
+ import "./foundation-eff81c1e.mjs";
50
+ import "./tslib.es6-226581a4.mjs";
51
+ import "./class-map-4b94b017.mjs";
52
+ import "./property-9b6ea53b.mjs";
53
+ import "./query-d843aa92.mjs";
54
+ import "./mwc-drawer-base-0c2b4060.mjs";
57
55
  import "./inert.esm-359d4581.mjs";
58
56
  import "./base-element-67ae173f.mjs";
59
- import "./mwc-icon-bf656cf5.mjs";
60
- import "./ripple-handlers-f37f21cf.mjs";
57
+ import "./mwc-icon-28b10c70.mjs";
58
+ import "./ripple-handlers-38a43e50.mjs";
61
59
  import "./state-b5e865db.mjs";
62
60
  import "./style-map-bc3ed3e0.mjs";
63
61
  import "./aria-property-fa2717fe.mjs";
64
62
  import "./event-options-78d6cf94.mjs";
65
63
  import "./if-defined-c367f208.mjs";
66
- import "./mwc-checkbox-base-f10fd709.mjs";
67
- import "./form-element-ffcf59ff.mjs";
64
+ import "./mwc-checkbox-base-afeeff16.mjs";
65
+ import "./form-element-7353b3c4.mjs";
68
66
  import "./mwc-checkbox.css-8f4f1a9b.mjs";
67
+ import "./_commonjsHelpers-de2741aa.mjs";
69
68
  import "./query-assigned-nodes-df691e78.mjs";
70
- import "./mwc-radio-base-a374fbd9.mjs";
69
+ import "./mwc-radio-base-18a887dd.mjs";
71
70
  import "./mwc-radio.css-7454bb11.mjs";
72
- import "./mwc-list-item-base-fe4398c3.mjs";
73
- import "./mwc-list-item.css-b0009fc7.mjs";
74
- import "./mwc-list-base-76e37212.mjs";
75
- import "./mwc-menu-base-c4bc88ea.mjs";
76
- import "./mwc-line-ripple-directive-b24a914e.mjs";
77
- import "./mwc-slider.css-8b6f275c.mjs";
71
+ import "./mwc-list-item-base-bf1a075b.mjs";
72
+ import "./list-item-1fc0d619.mjs";
73
+ import "./mwc-list-base-8aa5bfd8.mjs";
74
+ import "./mwc-menu-base-872420a4.mjs";
75
+ import "./mwc-line-ripple-directive-315e996d.mjs";
76
+ import "./mwc-slider.css-03537082.mjs";
78
77
  import "./directive-helpers-e3ea6592.mjs";
79
- import "./mwc-tab-base-be0c887f.mjs";
80
- import "./textfield-63d1859a.mjs";
81
- import "./mwc-top-app-bar-base-55da3fe4.mjs";
78
+ import "./mwc-tab-base-cd1570e4.mjs";
79
+ import "./textfield-a2e37241.mjs";
80
+ import "./mwc-top-app-bar-base-c7380903.mjs";
82
81
  import "./top-app-bar-f83386e0.mjs";
83
- var F = {};
84
- /**
85
- * @license
86
- * SPDX-License-Identifier: Apache-2.0
87
- */
88
- const x = {};
89
- function G(i) {
90
- if (i !== x)
91
- throw new Error("Bad secret");
92
- }
93
- /**
94
- * @license
95
- * SPDX-License-Identifier: Apache-2.0
96
- */
97
- class Kt {
98
- constructor() {
99
- // @ts-ignore: error TS6133: 'brand' is declared but its value is never read.
100
- f(this, "brand");
101
- }
102
- // To prevent structural typing.
103
- }
104
- class Vt extends Kt {
105
- constructor(t, n) {
106
- super();
107
- f(this, "privateDoNotAccessOrElseWrappedAttrPrefix");
108
- process.env.NODE_ENV !== "production" && G(n), this.privateDoNotAccessOrElseWrappedAttrPrefix = t;
109
- }
110
- toString() {
111
- return this.privateDoNotAccessOrElseWrappedAttrPrefix;
112
- }
113
- }
114
- function qt(i) {
115
- return new Vt(i, x);
116
- }
117
- function Xt(i) {
118
- if (i instanceof Vt)
119
- return i.privateDoNotAccessOrElseWrappedAttrPrefix;
120
- {
121
- let e = "";
122
- throw process.env.NODE_ENV !== "production" && (e = "Unexpected type when unwrapping SafeAttributePrefix"), new Error(e);
123
- }
124
- }
125
- const Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
126
- __proto__: null,
127
- SafeAttributePrefix: Kt,
128
- createAttributePrefix: qt,
129
- unwrapAttributePrefix: Xt
130
- }, Symbol.toStringTag, { value: "Module" }));
131
- /**
132
- * @license
133
- * SPDX-License-Identifier: Apache-2.0
134
- */
135
- function Y(i, e, t) {
136
- if (!Array.isArray(i) || !Array.isArray(i.raw) || !e && i.length !== 1)
137
- throw new TypeError(t);
138
- }
139
- /**
140
- * @license
141
- * SPDX-License-Identifier: Apache-2.0
142
- */
143
- const be = [
144
- "href",
145
- "rel",
146
- "src",
147
- "srcdoc",
148
- "action",
149
- "formaction",
150
- "sandbox",
151
- "cite",
152
- "poster",
153
- "icon"
154
- ];
155
- /**
156
- * @license
157
- * SPDX-License-Identifier: Apache-2.0
158
- */
159
- function Ee(i) {
160
- process.env.NODE_ENV !== "production" && Y(i, !0, "safeAttr is a template literal tag function and should be called using the tagged template syntax. For example, safeAttr`foo`;");
161
- const e = i[0].toLowerCase();
162
- if (process.env.NODE_ENV !== "production") {
163
- if (e.indexOf("on") === 0 || "on".indexOf(e) === 0)
164
- throw new Error(`Prefix '${i[0]}' does not guarantee the attribute to be safe as it is also a prefix for event handler attributesPlease use 'addEventListener' to set event handlers.`);
165
- be.forEach((t) => {
166
- if (t.indexOf(e) === 0)
167
- throw new Error(`Prefix '${i[0]}' does not guarantee the attribute to be safe as it is also a prefix for the security sensitive attribute '${t}'. Please use native or safe DOM APIs to set the attribute.`);
168
- });
169
- }
170
- return qt(e);
171
- }
172
- const Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
173
- __proto__: null,
174
- safeAttrPrefix: Ee
175
- }, Symbol.toStringTag, { value: "Module" })), we = /* @__PURE__ */ y(Se);
176
- /**
177
- * @license
178
- * SPDX-License-Identifier: Apache-2.0
179
- */
180
- let Yt = "google#safe";
181
- function Ce() {
182
- if (typeof window < "u")
183
- return window.trustedTypes;
184
- }
185
- function Z() {
186
- return Yt !== "" ? Ce() ?? null : null;
187
- }
188
- let rt;
189
- function ft() {
190
- var i;
191
- if (rt === void 0)
192
- try {
193
- rt = ((i = Z()) == null ? void 0 : i.createPolicy(Yt, {
194
- createHTML: (e) => e,
195
- createScript: (e) => e,
196
- createScriptURL: (e) => e
197
- })) ?? null;
198
- } catch {
199
- rt = null;
200
- }
201
- return rt;
202
- }
203
- /**
204
- * @license
205
- * SPDX-License-Identifier: Apache-2.0
206
- */
207
- class vt {
208
- constructor(e, t) {
209
- f(this, "privateDoNotAccessOrElseWrappedHtml");
210
- process.env.NODE_ENV !== "production" && G(t), this.privateDoNotAccessOrElseWrappedHtml = e;
211
- }
212
- toString() {
213
- return this.privateDoNotAccessOrElseWrappedHtml.toString();
214
- }
215
- }
216
- function Zt(i, e) {
217
- return e ?? new vt(i, x);
218
- }
219
- const Ie = typeof window !== void 0 ? window.TrustedHTML : void 0, Jt = Ie ?? vt;
220
- function W(i) {
221
- var t;
222
- const e = i;
223
- return Zt(e, (t = ft()) == null ? void 0 : t.createHTML(e));
224
- }
225
- const Te = /* @__PURE__ */ (() => {
226
- var i;
227
- return Zt("", (i = Z()) == null ? void 0 : i.emptyHTML);
228
- })();
229
- function Re(i) {
230
- return i instanceof Jt;
231
- }
232
- function gt(i) {
233
- var e;
234
- if ((e = Z()) != null && e.isHTML(i))
235
- return i;
236
- if (i instanceof vt)
237
- return i.privateDoNotAccessOrElseWrappedHtml;
238
- {
239
- let t = "";
240
- throw process.env.NODE_ENV !== "production" && (t = "Unexpected type when unwrapping SafeHtml"), new Error(t);
241
- }
242
- }
243
- const Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
244
- __proto__: null,
245
- EMPTY_HTML: Te,
246
- SafeHtml: Jt,
247
- createHtml: W,
248
- isHtml: Re,
249
- unwrapHtml: gt
250
- }, Symbol.toStringTag, { value: "Module" }));
251
- /**
252
- * @license
253
- * SPDX-License-Identifier: Apache-2.0
254
- */
255
- class _t {
256
- constructor(e, t) {
257
- f(this, "privateDoNotAccessOrElseWrappedResourceUrl");
258
- process.env.NODE_ENV !== "production" && G(t), this.privateDoNotAccessOrElseWrappedResourceUrl = e;
259
- }
260
- toString() {
261
- return this.privateDoNotAccessOrElseWrappedResourceUrl.toString();
262
- }
263
- }
264
- const Oe = typeof window !== void 0 ? window.TrustedScriptURL : void 0, Qt = Oe ?? _t;
265
- function q(i) {
266
- var n;
267
- const e = i;
268
- return ((n = ft()) == null ? void 0 : n.createScriptURL(e)) ?? new _t(e, x);
269
- }
270
- function De(i) {
271
- return i instanceof Qt;
272
- }
273
- function pt(i) {
274
- var e;
275
- if ((e = Z()) != null && e.isScriptURL(i))
276
- return i;
277
- if (i instanceof _t)
278
- return i.privateDoNotAccessOrElseWrappedResourceUrl;
279
- {
280
- let t = "";
281
- throw process.env.NODE_ENV !== "production" && (t = "Unexpected type when unwrapping TrustedResourceUrl"), new Error(t);
282
- }
283
- }
284
- const xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
285
- __proto__: null,
286
- TrustedResourceUrl: Qt,
287
- createResourceUrl: q,
288
- isResourceUrl: De,
289
- unwrapResourceUrl: pt
290
- }, Symbol.toStringTag, { value: "Module" }));
291
- /**
292
- * @license
293
- * SPDX-License-Identifier: Apache-2.0
294
- */
295
- class yt {
296
- constructor(e, t) {
297
- f(this, "privateDoNotAccessOrElseWrappedScript");
298
- process.env.NODE_ENV !== "production" && G(t), this.privateDoNotAccessOrElseWrappedScript = e;
299
- }
300
- toString() {
301
- return this.privateDoNotAccessOrElseWrappedScript.toString();
302
- }
303
- }
304
- function te(i, e) {
305
- return e ?? new yt(i, x);
306
- }
307
- const Pe = typeof window !== void 0 ? window.TrustedScript : void 0, ee = Pe ?? yt;
308
- function tt(i) {
309
- var t;
310
- const e = i;
311
- return te(e, (t = ft()) == null ? void 0 : t.createScript(e));
312
- }
313
- const Le = /* @__PURE__ */ (() => {
314
- var i;
315
- return te("", (i = Z()) == null ? void 0 : i.emptyScript);
316
- })();
317
- function Fe(i) {
318
- return i instanceof ee;
319
- }
320
- function dt(i) {
321
- var e;
322
- if ((e = Z()) != null && e.isScript(i))
323
- return i;
324
- if (i instanceof yt)
325
- return i.privateDoNotAccessOrElseWrappedScript;
326
- {
327
- let t = "";
328
- throw process.env.NODE_ENV !== "production" && (t = "Unexpected type when unwrapping SafeScript"), new Error(t);
329
- }
330
- }
331
- const Ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
332
- __proto__: null,
333
- EMPTY_SCRIPT: Le,
334
- SafeScript: ee,
335
- createScript: tt,
336
- isScript: Fe,
337
- unwrapScript: dt
338
- }, Symbol.toStringTag, { value: "Module" }));
339
- /**
340
- * @license
341
- * SPDX-License-Identifier: Apache-2.0
342
- */
343
- function Me(i, e = {}) {
344
- let t = V(i);
345
- return e.preserveSpaces && (t = t.replace(/(^|[\r\n\t ]) /g, "$1&#160;")), e.preserveNewlines && (t = t.replace(/(\r\n|\n|\r)/g, "<br>")), e.preserveTabs && (t = t.replace(/(\t+)/g, '<span style="white-space:pre">$1</span>')), W(t);
346
- }
347
- function ze(i, e = {}) {
348
- const t = dt(i).toString();
349
- let n = "<script";
350
- return e.id && (n += ` id="${V(e.id)}"`), e.nonce && (n += ` nonce="${V(e.nonce)}"`), e.type && (n += ` type="${V(e.type)}"`), n += `>${t}<\/script>`, W(n);
351
- }
352
- function He(i, e, t) {
353
- const n = pt(i).toString();
354
- let r = `<script src="${V(n)}"`;
355
- return e && (r += " async"), t && (r += ` nonce="${V(t)}"`), r += "><\/script>", W(r);
356
- }
357
- function V(i) {
358
- return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
359
- }
360
- function ke(i) {
361
- return W(i.map(gt).join(""));
362
- }
363
- const Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
364
- __proto__: null,
365
- concatHtmls: ke,
366
- createScript: ze,
367
- createScriptSrc: He,
368
- htmlEscape: Me
369
- }, Symbol.toStringTag, { value: "Module" })), Ge = /* @__PURE__ */ y(Be);
370
- /**
371
- * @license
372
- * SPDX-License-Identifier: Apache-2.0
373
- */
374
- function We(i) {
375
- let e;
376
- try {
377
- e = new URL(i);
378
- } catch {
379
- return "https:";
380
- }
381
- return e.protocol;
382
- }
383
- const je = ["data:", "http:", "https:", "mailto:", "ftp:"];
384
- function $e(i) {
385
- const e = We(i);
386
- return e !== void 0 && je.indexOf(e.toLowerCase()) !== -1 ? i : "about:invalid#zClosurez";
387
- }
388
- /**
389
- * @license
390
- * SPDX-License-Identifier: Apache-2.0
391
- */
392
- class ie {
393
- constructor() {
394
- // @ts-ignore: error TS6133: 'brand' is declared but its value is never read.
395
- f(this, "brand");
396
- }
397
- // To prevent structural typing.
398
- }
399
- class At extends ie {
400
- constructor(t, n) {
401
- super();
402
- f(this, "privateDoNotAccessOrElseWrappedStyle");
403
- process.env.NODE_ENV !== "production" && G(n), this.privateDoNotAccessOrElseWrappedStyle = t;
404
- }
405
- toString() {
406
- return this.privateDoNotAccessOrElseWrappedStyle;
407
- }
408
- }
409
- function bt(i) {
410
- return new At(i, x);
411
- }
412
- function Ke(i) {
413
- return i instanceof At;
414
- }
415
- function ne(i) {
416
- if (i instanceof At)
417
- return i.privateDoNotAccessOrElseWrappedStyle;
418
- {
419
- let e = "";
420
- throw process.env.NODE_ENV !== "production" && (e = "Unexpected type when unwrapping SafeStyle"), new Error(e);
421
- }
422
- }
423
- const Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
424
- __proto__: null,
425
- SafeStyle: ie,
426
- createStyle: bt,
427
- isStyle: Ke,
428
- unwrapStyle: ne
429
- }, Symbol.toStringTag, { value: "Module" }));
430
- /**
431
- * @license
432
- * SPDX-License-Identifier: Apache-2.0
433
- */
434
- function qe(i, e) {
435
- Ye(i) && Xe(i), i.innerHTML = gt(e);
436
- }
437
- function re(i, e, t, n) {
438
- if (i.length === 0)
439
- throw new Error("No prefixes are provided");
440
- const r = i.map((a) => Xt(a)), o = t.toLowerCase();
441
- if (r.every((a) => o.indexOf(a) !== 0))
442
- throw new Error(`Attribute "${t}" does not match any of the allowed prefixes.`);
443
- e.setAttribute(t, n);
444
- }
445
- function Xe(i) {
446
- if (i.tagName.toLowerCase() === "script")
447
- throw new Error("Use setTextContent with a SafeScript.");
448
- if (i.tagName.toLowerCase() === "style")
449
- throw new Error("Use setTextContent with a SafeStyleSheet.");
450
- }
451
- function Ye(i) {
452
- return i.tagName !== void 0;
453
- }
454
- /**
455
- * @license
456
- * SPDX-License-Identifier: Apache-2.0
457
- */
458
- function Ze(i) {
459
- const e = document.createElement("template"), t = W(i);
460
- return qe(e, t), e.content;
461
- }
462
- /**
463
- * @license
464
- * SPDX-License-Identifier: Apache-2.0
465
- */
466
- function It(i) {
467
- const e = i.nodeName;
468
- return typeof e == "string" ? e : "FORM";
469
- }
470
- function Tt(i) {
471
- return i.nodeType === Node.TEXT_NODE;
472
- }
473
- function Rt(i) {
474
- const e = i.nodeType;
475
- return e === Node.ELEMENT_NODE || typeof e != "number";
476
- }
477
- /**
478
- * @license
479
- * SPDX-License-Identifier: Apache-2.0
480
- */
481
- class z {
482
- constructor(e, t, n, r) {
483
- f(this, "allowedElements");
484
- f(this, "elementPolicies");
485
- f(this, "allowedGlobalAttributes");
486
- f(this, "globalAttributePolicies");
487
- this.allowedElements = e, this.elementPolicies = t, this.allowedGlobalAttributes = n, this.globalAttributePolicies = r;
488
- }
489
- isAllowedElement(e) {
490
- return e.toLowerCase() !== "form" && (this.allowedElements.has(e) || this.elementPolicies.has(e));
491
- }
492
- getAttributePolicy(e, t) {
493
- const n = this.elementPolicies.get(t);
494
- return n != null && n.has(e) ? n.get(e) : this.allowedGlobalAttributes.has(e) ? { policyAction: u.KEEP } : this.globalAttributePolicies.get(e) || { policyAction: u.DROP };
495
- }
496
- }
497
- var u;
498
- (function(i) {
499
- i[i.DROP = 0] = "DROP", i[i.KEEP = 1] = "KEEP", i[i.KEEP_AND_SANITIZE_URL = 2] = "KEEP_AND_SANITIZE_URL", i[i.KEEP_AND_NORMALIZE = 3] = "KEEP_AND_NORMALIZE", i[i.KEEP_AND_SANITIZE_STYLE = 4] = "KEEP_AND_SANITIZE_STYLE";
500
- })(u || (u = {}));
501
- /**
502
- * @license
503
- * SPDX-License-Identifier: Apache-2.0
504
- */
505
- const oe = new z(/* @__PURE__ */ new Set([
506
- "ARTICLE",
507
- "SECTION",
508
- "NAV",
509
- "ASIDE",
510
- "H1",
511
- "H2",
512
- "H3",
513
- "H4",
514
- "H5",
515
- "H6",
516
- "HEADER",
517
- "FOOTER",
518
- "ADDRESS",
519
- "P",
520
- "HR",
521
- "PRE",
522
- "BLOCKQUOTE",
523
- "OL",
524
- "UL",
525
- "LH",
526
- "LI",
527
- "DL",
528
- "DT",
529
- "DD",
530
- "FIGURE",
531
- "FIGCAPTION",
532
- "MAIN",
533
- "DIV",
534
- "EM",
535
- "STRONG",
536
- "SMALL",
537
- "S",
538
- "CITE",
539
- "Q",
540
- "DFN",
541
- "ABBR",
542
- "RUBY",
543
- "RB",
544
- "RT",
545
- "RTC",
546
- "RP",
547
- "DATA",
548
- "TIME",
549
- "CODE",
550
- "VAR",
551
- "SAMP",
552
- "KBD",
553
- "SUB",
554
- "SUP",
555
- "I",
556
- "B",
557
- "U",
558
- "MARK",
559
- "BDI",
560
- "BDO",
561
- "SPAN",
562
- "BR",
563
- "WBR",
564
- "INS",
565
- "DEL",
566
- "PICTURE",
567
- "PARAM",
568
- "TRACK",
569
- "MAP",
570
- "TABLE",
571
- "CAPTION",
572
- "COLGROUP",
573
- "COL",
574
- "TBODY",
575
- "THEAD",
576
- "TFOOT",
577
- "TR",
578
- "TD",
579
- "TH",
580
- "SELECT",
581
- "DATALIST",
582
- "OPTGROUP",
583
- "OPTION",
584
- "OUTPUT",
585
- "PROGRESS",
586
- "METER",
587
- "FIELDSET",
588
- "LEGEND",
589
- "DETAILS",
590
- "SUMMARY",
591
- "MENU",
592
- "DIALOG",
593
- "SLOT",
594
- "CANVAS",
595
- "FONT",
596
- "CENTER"
597
- ]), /* @__PURE__ */ new Map([
598
- [
599
- "A",
600
- /* @__PURE__ */ new Map([
601
- ["href", { policyAction: u.KEEP_AND_SANITIZE_URL }]
602
- ])
603
- ],
604
- [
605
- "AREA",
606
- /* @__PURE__ */ new Map([
607
- ["href", { policyAction: u.KEEP_AND_SANITIZE_URL }]
608
- ])
609
- ],
610
- [
611
- "LINK",
612
- /* @__PURE__ */ new Map([
613
- [
614
- "href",
615
- {
616
- policyAction: u.KEEP_AND_SANITIZE_URL,
617
- conditions: /* @__PURE__ */ new Map([[
618
- "rel",
619
- /* @__PURE__ */ new Set([
620
- "alternate",
621
- "author",
622
- "bookmark",
623
- "canonical",
624
- "cite",
625
- "help",
626
- "icon",
627
- "license",
628
- "next",
629
- "prefetch",
630
- "dns-prefetch",
631
- "prerender",
632
- "preconnect",
633
- "preload",
634
- "prev",
635
- "search",
636
- "subresource"
637
- ])
638
- ]])
639
- }
640
- ]
641
- ])
642
- ],
643
- [
644
- "SOURCE",
645
- /* @__PURE__ */ new Map([
646
- ["src", { policyAction: u.KEEP_AND_SANITIZE_URL }]
647
- ])
648
- ],
649
- [
650
- "IMG",
651
- /* @__PURE__ */ new Map([
652
- ["src", { policyAction: u.KEEP_AND_SANITIZE_URL }]
653
- ])
654
- ],
655
- [
656
- "VIDEO",
657
- /* @__PURE__ */ new Map([
658
- ["src", { policyAction: u.KEEP_AND_SANITIZE_URL }]
659
- ])
660
- ],
661
- [
662
- "AUDIO",
663
- /* @__PURE__ */ new Map([
664
- ["src", { policyAction: u.KEEP_AND_SANITIZE_URL }]
665
- ])
666
- ]
667
- ]), /* @__PURE__ */ new Set([
668
- "title",
669
- "aria-atomic",
670
- "aria-autocomplete",
671
- "aria-busy",
672
- "aria-checked",
673
- "aria-current",
674
- "aria-disabled",
675
- "aria-dropeffect",
676
- "aria-expanded",
677
- "aria-haspopup",
678
- "aria-hidden",
679
- "aria-invalid",
680
- "aria-label",
681
- "aria-level",
682
- "aria-live",
683
- "aria-multiline",
684
- "aria-multiselectable",
685
- "aria-orientation",
686
- "aria-posinset",
687
- "aria-pressed",
688
- "aria-readonly",
689
- "aria-relevant",
690
- "aria-required",
691
- "aria-selected",
692
- "aria-setsize",
693
- "aria-sort",
694
- "aria-valuemax",
695
- "aria-valuemin",
696
- "aria-valuenow",
697
- "aria-valuetext",
698
- "alt",
699
- "align",
700
- "autocapitalize",
701
- "autocomplete",
702
- "autocorrect",
703
- "autofocus",
704
- "autoplay",
705
- "bgcolor",
706
- "border",
707
- "cellpadding",
708
- "cellspacing",
709
- "checked",
710
- "color",
711
- "cols",
712
- "colspan",
713
- "controls",
714
- "datetime",
715
- "disabled",
716
- "download",
717
- "draggable",
718
- "enctype",
719
- "face",
720
- "formenctype",
721
- "frameborder",
722
- "height",
723
- "hreflang",
724
- "hidden",
725
- "ismap",
726
- "label",
727
- "lang",
728
- "loop",
729
- "max",
730
- "maxlength",
731
- "media",
732
- "minlength",
733
- "min",
734
- "multiple",
735
- "muted",
736
- "nonce",
737
- "open",
738
- "placeholder",
739
- "preload",
740
- "rel",
741
- "required",
742
- "reversed",
743
- "role",
744
- "rows",
745
- "rowspan",
746
- "selected",
747
- "shape",
748
- "size",
749
- "sizes",
750
- "slot",
751
- "span",
752
- "spellcheck",
753
- "start",
754
- "step",
755
- "summary",
756
- "translate",
757
- "type",
758
- "valign",
759
- "value",
760
- "width",
761
- "wrap",
762
- "itemscope",
763
- "itemtype",
764
- "itemid",
765
- "itemprop",
766
- "itemref"
767
- ]), /* @__PURE__ */ new Map([
768
- [
769
- "dir",
770
- {
771
- policyAction: u.KEEP_AND_NORMALIZE,
772
- conditions: /* @__PURE__ */ new Map([[
773
- "dir",
774
- /* @__PURE__ */ new Set([
775
- "auto",
776
- "ltr",
777
- "rtl"
778
- ])
779
- ]])
780
- }
781
- ],
782
- [
783
- "async",
784
- {
785
- policyAction: u.KEEP_AND_NORMALIZE,
786
- conditions: /* @__PURE__ */ new Map([[
787
- "async",
788
- /* @__PURE__ */ new Set([
789
- "async"
790
- ])
791
- ]])
792
- }
793
- ],
794
- ["cite", { policyAction: u.KEEP_AND_SANITIZE_URL }],
795
- [
796
- "loading",
797
- {
798
- policyAction: u.KEEP_AND_NORMALIZE,
799
- conditions: /* @__PURE__ */ new Map([[
800
- "loading",
801
- /* @__PURE__ */ new Set([
802
- "eager",
803
- "lazy"
804
- ])
805
- ]])
806
- }
807
- ],
808
- ["poster", { policyAction: u.KEEP_AND_SANITIZE_URL }],
809
- [
810
- "target",
811
- {
812
- policyAction: u.KEEP_AND_NORMALIZE,
813
- conditions: /* @__PURE__ */ new Map([[
814
- "target",
815
- /* @__PURE__ */ new Set([
816
- "_self",
817
- "_blank"
818
- ])
819
- ]])
820
- }
821
- ]
822
- ]));
823
- /**
824
- * @license
825
- * SPDX-License-Identifier: Apache-2.0
826
- */
827
- class Et {
828
- constructor(e, t) {
829
- f(this, "sanitizerTable");
830
- f(this, "changes", []);
831
- this.sanitizerTable = e, G(t);
832
- }
833
- sanitizeAssertUnchanged(e) {
834
- this.changes = [];
835
- const t = this.sanitize(e);
836
- if (this.changes.length !== 0) {
837
- let n = "";
838
- throw process.env.NODE_ENV !== "production" && (n = `Unexpected change to HTML value as a result of sanitization. Input: "${e}", sanitized output: "${t}"
839
- List of changes:${this.changes.join(`
840
- `)}`), new Error(n);
841
- }
842
- return t;
843
- }
844
- sanitize(e) {
845
- const t = document.createElement("span");
846
- t.appendChild(this.sanitizeToFragment(e));
847
- let n = new XMLSerializer().serializeToString(t);
848
- return n = n.slice(n.indexOf(">") + 1, n.lastIndexOf("</")), W(n);
849
- }
850
- sanitizeToFragment(e) {
851
- const t = Ze(e), n = document.createTreeWalker(
852
- t,
853
- NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,
854
- // IE10 and IE11 won't accept a proper `NodeFilter` interface, and
855
- // expect the filtering function to be passed directly. It seems that
856
- // other browsers also do not mind getting the function directly. see
857
- // https://stackoverflow.com/q/38245898
858
- (c) => this.nodeFilter(c),
859
- // @ts-ignore: error TS2554: Expected 1-3 arguments, but got 4.
860
- !1
861
- );
862
- let r = n.nextNode();
863
- const o = document.createDocumentFragment();
864
- let a = o;
865
- for (; r !== null; ) {
866
- let c;
867
- if (Tt(r))
868
- c = this.sanitizeTextNode(r);
869
- else if (Rt(r))
870
- c = this.sanitizeElementNode(r);
871
- else
872
- throw new Error("Node is not of type text or element");
873
- if (a.appendChild(c), r = n.firstChild(), r)
874
- a = c;
875
- else
876
- for (; !(r = n.nextSibling()) && (r = n.parentNode()); )
877
- a = a.parentNode;
878
- }
879
- return o;
880
- }
881
- sanitizeTextNode(e) {
882
- return document.createTextNode(e.data);
883
- }
884
- sanitizeElementNode(e) {
885
- const t = It(e), n = document.createElement(t), r = e.attributes;
886
- for (const { name: o, value: a } of r) {
887
- const c = this.sanitizerTable.getAttributePolicy(o, t);
888
- if (!this.satisfiesAllConditions(c.conditions, r)) {
889
- this.recordChange(`Not all conditions satisfied for attribute: ${o}.`);
890
- continue;
891
- }
892
- switch (c.policyAction) {
893
- case u.KEEP:
894
- n.setAttribute(o, a);
895
- break;
896
- case u.KEEP_AND_SANITIZE_URL:
897
- const s = $e(a);
898
- s !== a && this.recordChange(`Url in attribute ${o} was modified during sanitization. Original url:"${a}" was sanitized to: "${s}"`), n.setAttribute(o, s);
899
- break;
900
- case u.KEEP_AND_NORMALIZE:
901
- n.setAttribute(o, a.toLowerCase());
902
- break;
903
- case u.KEEP_AND_SANITIZE_STYLE:
904
- n.setAttribute(o, a);
905
- break;
906
- case u.DROP:
907
- this.recordChange(`Attribute: ${o} was dropped`);
908
- break;
909
- default:
910
- ei(c.policyAction, "Unhandled AttributePolicyAction case");
911
- }
912
- }
913
- return n;
914
- }
915
- nodeFilter(e) {
916
- if (Tt(e))
917
- return NodeFilter.FILTER_ACCEPT;
918
- if (!Rt(e))
919
- return NodeFilter.FILTER_REJECT;
920
- const t = It(e);
921
- return t === null ? (this.recordChange(`Node name was null for node: ${e}`), NodeFilter.FILTER_REJECT) : this.sanitizerTable.isAllowedElement(t) ? NodeFilter.FILTER_ACCEPT : (this.recordChange(`Element: ${t} was dropped`), NodeFilter.FILTER_REJECT);
922
- }
923
- recordChange(e) {
924
- process.env.NODE_ENV !== "production" ? this.changes.push(e) : this.changes.length === 0 && this.changes.push("");
925
- }
926
- satisfiesAllConditions(e, t) {
927
- var n;
928
- if (!e)
929
- return !0;
930
- for (const [r, o] of e) {
931
- const a = (n = t.getNamedItem(r)) == null ? void 0 : n.value;
932
- if (a && !o.has(a))
933
- return !1;
934
- }
935
- return !0;
936
- }
937
- }
938
- const St = /* @__PURE__ */ (() => new Et(oe, x))();
939
- function Je(i) {
940
- return St.sanitize(i);
941
- }
942
- function Qe(i) {
943
- return St.sanitizeAssertUnchanged(i);
944
- }
945
- function ti(i) {
946
- return St.sanitizeToFragment(i);
947
- }
948
- function ei(i, e = `unexpected value ${i}!`) {
949
- throw new Error(e);
950
- }
951
- const ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
952
- __proto__: null,
953
- HtmlSanitizerImpl: Et,
954
- sanitizeHtml: Je,
955
- sanitizeHtmlAssertUnchanged: Qe,
956
- sanitizeHtmlToFragment: ti
957
- }, Symbol.toStringTag, { value: "Module" })), ni = /* @__PURE__ */ y(ii);
958
- /**
959
- * @license
960
- * SPDX-License-Identifier: Apache-2.0
961
- */
962
- class ri {
963
- constructor() {
964
- f(this, "sanitizerTable");
965
- // To denote if the builder has called build() and therefore should make no
966
- // further changes to the sanitizer table.
967
- f(this, "calledBuild", !1);
968
- this.sanitizerTable = oe;
969
- }
970
- /** Builder option to restrict allowed elements to a smaller subset. */
971
- onlyAllowElements(e) {
972
- const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
973
- for (let r of e) {
974
- if (r = r.toUpperCase(), !this.sanitizerTable.isAllowedElement(r))
975
- throw new Error(`Element: ${r}, is not allowed by html5_contract.textpb`);
976
- const o = this.sanitizerTable.elementPolicies.get(r);
977
- o !== void 0 ? n.set(r, o) : t.add(r);
978
- }
979
- return this.sanitizerTable = new z(t, n, this.sanitizerTable.allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies), this;
980
- }
981
- /**
982
- * Builder option to restrict allowed attributes to a smaller subset.
983
- *
984
- * If the attribute isn't currently allowed then it won't be added.
985
- */
986
- onlyAllowAttributes(e) {
987
- const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
988
- for (const o of e)
989
- this.sanitizerTable.allowedGlobalAttributes.has(o) && t.add(o), this.sanitizerTable.globalAttributePolicies.has(o) && n.set(o, this.sanitizerTable.globalAttributePolicies.get(o));
990
- for (const [o, a] of this.sanitizerTable.elementPolicies.entries()) {
991
- const c = /* @__PURE__ */ new Map();
992
- for (const [s, p] of a.entries())
993
- e.has(s) && c.set(s, p);
994
- r.set(o, c);
995
- }
996
- return this.sanitizerTable = new z(this.sanitizerTable.allowedElements, r, t, n), this;
997
- }
998
- /**
999
- * Allows the set of data attributes passed.
1000
- *
1001
- * These values must be prefixed with "data-"
1002
- *
1003
- * If called with onlyAllowElements or onlyAllowAttributes, those methods must
1004
- * be called first.
1005
- */
1006
- allowDataAttributes(e) {
1007
- const t = new Set(this.sanitizerTable.allowedGlobalAttributes);
1008
- for (const n of e) {
1009
- if (n.indexOf("data-") !== 0)
1010
- throw new Error(`data attribute: ${n} does not begin with the prefix "data-"`);
1011
- t.add(n);
1012
- }
1013
- return this.sanitizerTable = new z(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, t, this.sanitizerTable.globalAttributePolicies), this;
1014
- }
1015
- /**
1016
- * Preserves style attributes. Note that the sanitizer won't parse and
1017
- * sanitize the values but keep them as they are. In particular this means
1018
- * that the code will be able to call functions that could do undesirable
1019
- * things (e.g. `url` to trigger a network request), as well as any custom
1020
- * properties or functions defined by the application.
1021
- */
1022
- allowStyleAttributes() {
1023
- const e = new Map(this.sanitizerTable.globalAttributePolicies);
1024
- return e.set("style", { policyAction: u.KEEP_AND_SANITIZE_STYLE }), this.sanitizerTable = new z(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, e), this;
1025
- }
1026
- /**
1027
- * Preserves the class attribute on all elements. This means contents can
1028
- * adopt CSS styles from other page elements and possibly mask themselves as
1029
- * legitimate UI elements, which can lead to phishing.
1030
- */
1031
- allowClassAttributes() {
1032
- const e = new Map(this.sanitizerTable.globalAttributePolicies);
1033
- return e.set("class", { policyAction: u.KEEP }), this.sanitizerTable = new z(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, e), this;
1034
- }
1035
- /**
1036
- * Preserves id attributes. This carries moderate risk as it allows an
1037
- * element to override other elements with the same ID.
1038
- */
1039
- allowIdAttributes() {
1040
- const e = new Map(this.sanitizerTable.globalAttributePolicies);
1041
- return e.set("id", { policyAction: u.KEEP }), this.sanitizerTable = new z(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, e), this;
1042
- }
1043
- build() {
1044
- if (this.calledBuild)
1045
- throw new Error("this sanitizer has already called build");
1046
- return this.calledBuild = !0, new Et(this.sanitizerTable, x);
1047
- }
1048
- }
1049
- const oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1050
- __proto__: null,
1051
- HtmlSanitizerBuilder: ri
1052
- }, Symbol.toStringTag, { value: "Module" })), ai = /* @__PURE__ */ y(oi);
1053
- /**
1054
- * @license
1055
- * SPDX-License-Identifier: Apache-2.0
1056
- */
1057
- function ci(i) {
1058
- if (!(/^https:\/\//.test(i) || /^\/\//.test(i)))
1059
- return !1;
1060
- const e = i.indexOf("//") + 2, t = i.indexOf("/", e);
1061
- if (t <= e)
1062
- throw new Error("Can't interpolate data in a url's origin, Please make sure to fully specify the origin, terminated with '/'.");
1063
- const n = i.substring(e, t);
1064
- if (!/^[0-9a-z.:-]+$/i.test(n))
1065
- throw new Error("The origin contains unsupported characters.");
1066
- if (!/^[^:]*(:[0-9]+)?$/i.test(n))
1067
- throw new Error("Invalid port number.");
1068
- if (!/(^|\.)[a-z][^.]*$/i.test(n))
1069
- throw new Error("The top-level domain must start with a letter.");
1070
- return !0;
1071
- }
1072
- function si(i) {
1073
- if (!/^about:blank/.test(i))
1074
- return !1;
1075
- if (i !== "about:blank" && !/^about:blank#/.test(i))
1076
- throw new Error("The about url is invalid.");
1077
- return !0;
1078
- }
1079
- function li(i) {
1080
- if (!/^\//.test(i))
1081
- return !1;
1082
- if (i === "/" || i.length > 1 && i[1] !== "/" && i[1] !== "\\")
1083
- return !0;
1084
- throw new Error("The path start in the url is invalid.");
1085
- }
1086
- function pi(i, ...e) {
1087
- if (process.env.NODE_ENV !== "production" && Y(i, !0, "trustedResourceUrl is a template literal tag function and can only be called as such (e.g. trustedResourceUrl`/somepath.js`)"), e.length === 0)
1088
- return q(i[0]);
1089
- const t = i[0].toLowerCase();
1090
- if (process.env.NODE_ENV !== "production") {
1091
- if (/^data:/.test(t))
1092
- throw new Error("Data URLs cannot have expressions in the template literal input.");
1093
- if (!ci(t) && !li(t) && !si(t))
1094
- throw new Error("Trying to interpolate expressions in an unsupported url format.");
1095
- }
1096
- const n = [i[0]];
1097
- for (let r = 0; r < e.length; r++)
1098
- n.push(encodeURIComponent(e[r])), n.push(i[r + 1]);
1099
- return q(n.join(""));
1100
- }
1101
- function di(i, e) {
1102
- let t = pt(i).toString();
1103
- if (/#/.test(t)) {
1104
- let r = "";
1105
- throw process.env.NODE_ENV !== "production" && (r = `Found a hash in url (${t}), appending not supported`), new Error(r);
1106
- }
1107
- let n = /\?/.test(t) ? "&" : "?";
1108
- return e.forEach((r, o) => {
1109
- const a = r instanceof Array ? r : [r];
1110
- for (let c = 0; c < a.length; c++) {
1111
- const s = a[c];
1112
- s != null && (t += n + encodeURIComponent(o) + "=" + encodeURIComponent(String(s)), n = "&");
1113
- }
1114
- }), q(t);
1115
- }
1116
- const ui = /[^#]*/;
1117
- function hi(i, e) {
1118
- const t = pt(i).toString();
1119
- return q(ui.exec(t)[0] + "#" + e);
1120
- }
1121
- function mi(i) {
1122
- const e = dt(i).toString(), t = new Blob([e], { type: "text/javascript" });
1123
- return q(URL.createObjectURL(t));
1124
- }
1125
- const fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1126
- __proto__: null,
1127
- appendParams: di,
1128
- blobUrlFromScript: mi,
1129
- replaceFragment: hi,
1130
- trustedResourceUrl: pi
1131
- }, Symbol.toStringTag, { value: "Module" })), vi = /* @__PURE__ */ y(fi);
1132
- /**
1133
- * @license
1134
- * SPDX-License-Identifier: Apache-2.0
1135
- */
1136
- function gi(i) {
1137
- return process.env.NODE_ENV !== "production" && Y(i, !1, "safeScript is a template literal tag function that only accepts template literals without expressions. For example, safeScript`foo`;"), tt(i[0]);
1138
- }
1139
- function _i(i) {
1140
- return tt(i.map(dt).join(""));
1141
- }
1142
- function ae(i) {
1143
- return tt(JSON.stringify(i).replace(/</g, "\\x3c"));
1144
- }
1145
- function yi(i, ...e) {
1146
- if (process.env.NODE_ENV !== "production") {
1147
- if (e.some((t) => t !== ""))
1148
- throw new Error("safeScriptWithArgs only allows empty string expressions to enable inline comments.");
1149
- Y(i, !0, "safeScriptWithArgs is a template literal tag function that only accepts template literals. For example, safeScriptWithArgs`foo`;");
1150
- }
1151
- return (...t) => {
1152
- const n = t.map((r) => ae(r).toString());
1153
- return tt(`(${i.join("")})(${n.join(",")})`);
1154
- };
1155
- }
1156
- const Ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1157
- __proto__: null,
1158
- concatScripts: _i,
1159
- safeScript: gi,
1160
- safeScriptWithArgs: yi,
1161
- scriptFromJson: ae
1162
- }, Symbol.toStringTag, { value: "Module" })), bi = /* @__PURE__ */ y(Ai);
1163
- /**
1164
- * @license
1165
- * SPDX-License-Identifier: Apache-2.0
1166
- */
1167
- function Ei(i) {
1168
- process.env.NODE_ENV !== "production" && Y(i, !1, "safeStyle is a template literal tag function that only accepts template literals without expressions. For example, safeStyle`foo`;");
1169
- const e = i[0];
1170
- if (process.env.NODE_ENV !== "production") {
1171
- if (/[<>]/.test(e))
1172
- throw new Error("Forbidden characters in style string: " + e);
1173
- if (!/;$/.test(e))
1174
- throw new Error('Style string does not end with ";": ' + e);
1175
- if (!/:/.test(e))
1176
- throw new Error('Style string should contain one or more ":": ' + e);
1177
- }
1178
- return bt(e);
1179
- }
1180
- function Si(i) {
1181
- return bt(i.map(ne).join(""));
1182
- }
1183
- const wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1184
- __proto__: null,
1185
- concatStyles: Si,
1186
- safeStyle: Ei
1187
- }, Symbol.toStringTag, { value: "Module" })), Ci = /* @__PURE__ */ y(wi);
1188
- /**
1189
- * @license
1190
- * SPDX-License-Identifier: Apache-2.0
1191
- */
1192
- class ce {
1193
- constructor() {
1194
- // @ts-ignore: error TS6133: 'brand' is declared but its value is never read.
1195
- f(this, "brand");
1196
- }
1197
- // To prevent structural typing.
1198
- }
1199
- class wt extends ce {
1200
- constructor(t, n) {
1201
- super();
1202
- f(this, "privateDoNotAccessOrElseWrappedStyleSheet");
1203
- process.env.NODE_ENV !== "production" && G(n), this.privateDoNotAccessOrElseWrappedStyleSheet = t;
1204
- }
1205
- toString() {
1206
- return this.privateDoNotAccessOrElseWrappedStyleSheet;
1207
- }
1208
- }
1209
- function Ct(i) {
1210
- return new wt(i, x);
1211
- }
1212
- function Ii(i) {
1213
- return i instanceof wt;
1214
- }
1215
- function se(i) {
1216
- if (i instanceof wt)
1217
- return i.privateDoNotAccessOrElseWrappedStyleSheet;
1218
- {
1219
- let e = "";
1220
- throw process.env.NODE_ENV !== "production" && (e = "Unexpected type when unwrapping SafeStyleSheet"), new Error(e);
1221
- }
1222
- }
1223
- const Ti = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1224
- __proto__: null,
1225
- SafeStyleSheet: ce,
1226
- createStyleSheet: Ct,
1227
- isStyleSheet: Ii,
1228
- unwrapStyleSheet: se
1229
- }, Symbol.toStringTag, { value: "Module" }));
1230
- /**
1231
- * @license
1232
- * SPDX-License-Identifier: Apache-2.0
1233
- */
1234
- function Ri(i) {
1235
- process.env.NODE_ENV !== "production" && Y(i, !1, "safeStyleSheet is a template literal tag function that only accepts template literals without expressions. For example, safeStyleSheet`foo`;");
1236
- const e = i[0];
1237
- if (process.env.NODE_ENV !== "production" && /[<>]/.test(e))
1238
- throw new Error("Forbidden characters in styleSheet string: " + e);
1239
- return Ct(e);
1240
- }
1241
- function Ni(i) {
1242
- return Ct(i.map(se).join(""));
1243
- }
1244
- const Oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1245
- __proto__: null,
1246
- concatStyleSheets: Ni,
1247
- safeStyleSheet: Ri
1248
- }, Symbol.toStringTag, { value: "Module" })), Di = /* @__PURE__ */ y(Oi), xi = /* @__PURE__ */ y(Ae), Pi = /* @__PURE__ */ y(Ne), Li = /* @__PURE__ */ y(xe), Fi = /* @__PURE__ */ y(Ue), Ui = /* @__PURE__ */ y(Ve), Mi = /* @__PURE__ */ y(Ti);
1249
- (function(i) {
1250
- /**
1251
- * @license
1252
- * SPDX-License-Identifier: Apache-2.0
1253
- */
1254
- Object.defineProperty(i, "__esModule", { value: !0 }), i.unwrapStyleSheet = i.SafeStyleSheet = i.isStyleSheet = i.unwrapStyle = i.SafeStyle = i.isStyle = i.unwrapScript = i.SafeScript = i.isScript = i.EMPTY_SCRIPT = i.unwrapResourceUrl = i.TrustedResourceUrl = i.isResourceUrl = i.unwrapHtml = i.SafeHtml = i.isHtml = i.EMPTY_HTML = i.unwrapAttributePrefix = i.SafeAttributePrefix = i.safeStyleSheet = i.concatStyleSheets = i.safeStyle = i.concatStyles = i.scriptFromJson = i.safeScriptWithArgs = i.safeScript = i.concatScripts = i.trustedResourceUrl = i.replaceFragment = i.blobUrlFromScript = i.appendParams = i.HtmlSanitizerBuilder = i.sanitizeHtmlToFragment = i.sanitizeHtmlAssertUnchanged = i.sanitizeHtml = i.htmlEscape = i.createScriptSrc = i.createScript = i.concatHtmls = i.safeAttrPrefix = void 0;
1255
- var e = we;
1256
- Object.defineProperty(i, "safeAttrPrefix", { enumerable: !0, get: function() {
1257
- return e.safeAttrPrefix;
1258
- } });
1259
- var t = Ge;
1260
- Object.defineProperty(i, "concatHtmls", { enumerable: !0, get: function() {
1261
- return t.concatHtmls;
1262
- } }), Object.defineProperty(i, "createScript", { enumerable: !0, get: function() {
1263
- return t.createScript;
1264
- } }), Object.defineProperty(i, "createScriptSrc", { enumerable: !0, get: function() {
1265
- return t.createScriptSrc;
1266
- } }), Object.defineProperty(i, "htmlEscape", { enumerable: !0, get: function() {
1267
- return t.htmlEscape;
1268
- } });
1269
- var n = ni;
1270
- Object.defineProperty(i, "sanitizeHtml", { enumerable: !0, get: function() {
1271
- return n.sanitizeHtml;
1272
- } }), Object.defineProperty(i, "sanitizeHtmlAssertUnchanged", { enumerable: !0, get: function() {
1273
- return n.sanitizeHtmlAssertUnchanged;
1274
- } }), Object.defineProperty(i, "sanitizeHtmlToFragment", { enumerable: !0, get: function() {
1275
- return n.sanitizeHtmlToFragment;
1276
- } });
1277
- var r = ai;
1278
- Object.defineProperty(i, "HtmlSanitizerBuilder", { enumerable: !0, get: function() {
1279
- return r.HtmlSanitizerBuilder;
1280
- } });
1281
- var o = vi;
1282
- Object.defineProperty(i, "appendParams", { enumerable: !0, get: function() {
1283
- return o.appendParams;
1284
- } }), Object.defineProperty(i, "blobUrlFromScript", { enumerable: !0, get: function() {
1285
- return o.blobUrlFromScript;
1286
- } }), Object.defineProperty(i, "replaceFragment", { enumerable: !0, get: function() {
1287
- return o.replaceFragment;
1288
- } }), Object.defineProperty(i, "trustedResourceUrl", { enumerable: !0, get: function() {
1289
- return o.trustedResourceUrl;
1290
- } });
1291
- var a = bi;
1292
- Object.defineProperty(i, "concatScripts", { enumerable: !0, get: function() {
1293
- return a.concatScripts;
1294
- } }), Object.defineProperty(i, "safeScript", { enumerable: !0, get: function() {
1295
- return a.safeScript;
1296
- } }), Object.defineProperty(i, "safeScriptWithArgs", { enumerable: !0, get: function() {
1297
- return a.safeScriptWithArgs;
1298
- } }), Object.defineProperty(i, "scriptFromJson", { enumerable: !0, get: function() {
1299
- return a.scriptFromJson;
1300
- } });
1301
- var c = Ci;
1302
- Object.defineProperty(i, "concatStyles", { enumerable: !0, get: function() {
1303
- return c.concatStyles;
1304
- } }), Object.defineProperty(i, "safeStyle", { enumerable: !0, get: function() {
1305
- return c.safeStyle;
1306
- } });
1307
- var s = Di;
1308
- Object.defineProperty(i, "concatStyleSheets", { enumerable: !0, get: function() {
1309
- return s.concatStyleSheets;
1310
- } }), Object.defineProperty(i, "safeStyleSheet", { enumerable: !0, get: function() {
1311
- return s.safeStyleSheet;
1312
- } });
1313
- var p = xi;
1314
- Object.defineProperty(i, "SafeAttributePrefix", { enumerable: !0, get: function() {
1315
- return p.SafeAttributePrefix;
1316
- } }), Object.defineProperty(i, "unwrapAttributePrefix", { enumerable: !0, get: function() {
1317
- return p.unwrapAttributePrefix;
1318
- } });
1319
- var d = Pi;
1320
- Object.defineProperty(i, "EMPTY_HTML", { enumerable: !0, get: function() {
1321
- return d.EMPTY_HTML;
1322
- } }), Object.defineProperty(i, "isHtml", { enumerable: !0, get: function() {
1323
- return d.isHtml;
1324
- } }), Object.defineProperty(i, "SafeHtml", { enumerable: !0, get: function() {
1325
- return d.SafeHtml;
1326
- } }), Object.defineProperty(i, "unwrapHtml", { enumerable: !0, get: function() {
1327
- return d.unwrapHtml;
1328
- } });
1329
- var h = Li;
1330
- Object.defineProperty(i, "isResourceUrl", { enumerable: !0, get: function() {
1331
- return h.isResourceUrl;
1332
- } }), Object.defineProperty(i, "TrustedResourceUrl", { enumerable: !0, get: function() {
1333
- return h.TrustedResourceUrl;
1334
- } }), Object.defineProperty(i, "unwrapResourceUrl", { enumerable: !0, get: function() {
1335
- return h.unwrapResourceUrl;
1336
- } });
1337
- var b = Fi;
1338
- Object.defineProperty(i, "EMPTY_SCRIPT", { enumerable: !0, get: function() {
1339
- return b.EMPTY_SCRIPT;
1340
- } }), Object.defineProperty(i, "isScript", { enumerable: !0, get: function() {
1341
- return b.isScript;
1342
- } }), Object.defineProperty(i, "SafeScript", { enumerable: !0, get: function() {
1343
- return b.SafeScript;
1344
- } }), Object.defineProperty(i, "unwrapScript", { enumerable: !0, get: function() {
1345
- return b.unwrapScript;
1346
- } });
1347
- var N = Ui;
1348
- Object.defineProperty(i, "isStyle", { enumerable: !0, get: function() {
1349
- return N.isStyle;
1350
- } }), Object.defineProperty(i, "SafeStyle", { enumerable: !0, get: function() {
1351
- return N.SafeStyle;
1352
- } }), Object.defineProperty(i, "unwrapStyle", { enumerable: !0, get: function() {
1353
- return N.unwrapStyle;
1354
- } });
1355
- var j = Mi;
1356
- Object.defineProperty(i, "isStyleSheet", { enumerable: !0, get: function() {
1357
- return j.isStyleSheet;
1358
- } }), Object.defineProperty(i, "SafeStyleSheet", { enumerable: !0, get: function() {
1359
- return j.SafeStyleSheet;
1360
- } }), Object.defineProperty(i, "unwrapStyleSheet", { enumerable: !0, get: function() {
1361
- return j.unwrapStyleSheet;
1362
- } });
1363
- })(F);
1364
- /**
1365
- * @license
1366
- * Copyright 2020 Google Inc.
1367
- *
1368
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1369
- * of this software and associated documentation files (the "Software"), to deal
1370
- * in the Software without restriction, including without limitation the rights
1371
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1372
- * copies of the Software, and to permit persons to whom the Software is
1373
- * furnished to do so, subject to the following conditions:
1374
- *
1375
- * The above copyright notice and this permission notice shall be included in
1376
- * all copies or substantial portions of the Software.
1377
- *
1378
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1379
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1380
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1381
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1382
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1383
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1384
- * THE SOFTWARE.
1385
- */
1386
- var zi = (
1387
- /** @class */
1388
- function() {
1389
- function i() {
1390
- this.rafIDs = /* @__PURE__ */ new Map();
1391
- }
1392
- return i.prototype.request = function(e, t) {
1393
- var n = this;
1394
- this.cancel(e);
1395
- var r = requestAnimationFrame(function(o) {
1396
- n.rafIDs.delete(e), t(o);
1397
- });
1398
- this.rafIDs.set(e, r);
1399
- }, i.prototype.cancel = function(e) {
1400
- var t = this.rafIDs.get(e);
1401
- t && (cancelAnimationFrame(t), this.rafIDs.delete(e));
1402
- }, i.prototype.cancelAll = function() {
1403
- var e = this;
1404
- this.rafIDs.forEach(function(t, n) {
1405
- e.cancel(n);
1406
- });
1407
- }, i.prototype.getQueue = function() {
1408
- var e = [];
1409
- return this.rafIDs.forEach(function(t, n) {
1410
- e.push(n);
1411
- }), e;
1412
- }, i;
1413
- }()
1414
- );
1415
- /**
1416
- * @license
1417
- * Copyright 2016 Google Inc.
1418
- *
1419
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1420
- * of this software and associated documentation files (the "Software"), to deal
1421
- * in the Software without restriction, including without limitation the rights
1422
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1423
- * copies of the Software, and to permit persons to whom the Software is
1424
- * furnished to do so, subject to the following conditions:
1425
- *
1426
- * The above copyright notice and this permission notice shall be included in
1427
- * all copies or substantial portions of the Software.
1428
- *
1429
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1430
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1431
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1432
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1433
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1434
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1435
- * THE SOFTWARE.
1436
- */
1437
- var et = (
1438
- /** @class */
1439
- function() {
1440
- function i(e) {
1441
- e === void 0 && (e = {}), this.adapter = e;
1442
- }
1443
- return Object.defineProperty(i, "cssClasses", {
1444
- get: function() {
1445
- return {};
1446
- },
1447
- enumerable: !1,
1448
- configurable: !0
1449
- }), Object.defineProperty(i, "strings", {
1450
- get: function() {
1451
- return {};
1452
- },
1453
- enumerable: !1,
1454
- configurable: !0
1455
- }), Object.defineProperty(i, "numbers", {
1456
- get: function() {
1457
- return {};
1458
- },
1459
- enumerable: !1,
1460
- configurable: !0
1461
- }), Object.defineProperty(i, "defaultAdapter", {
1462
- get: function() {
1463
- return {};
1464
- },
1465
- enumerable: !1,
1466
- configurable: !0
1467
- }), i.prototype.init = function() {
1468
- }, i.prototype.destroy = function() {
1469
- }, i;
1470
- }()
1471
- );
1472
- /**
1473
- * @license
1474
- * Copyright 2020 Google Inc.
1475
- *
1476
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1477
- * of this software and associated documentation files (the "Software"), to deal
1478
- * in the Software without restriction, including without limitation the rights
1479
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1480
- * copies of the Software, and to permit persons to whom the Software is
1481
- * furnished to do so, subject to the following conditions:
1482
- *
1483
- * The above copyright notice and this permission notice shall be included in
1484
- * all copies or substantial portions of the Software.
1485
- *
1486
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1487
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1488
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1489
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1490
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1491
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1492
- * THE SOFTWARE.
1493
- */
1494
- var l = {
1495
- UNKNOWN: "Unknown",
1496
- BACKSPACE: "Backspace",
1497
- ENTER: "Enter",
1498
- SPACEBAR: "Spacebar",
1499
- PAGE_UP: "PageUp",
1500
- PAGE_DOWN: "PageDown",
1501
- END: "End",
1502
- HOME: "Home",
1503
- ARROW_LEFT: "ArrowLeft",
1504
- ARROW_UP: "ArrowUp",
1505
- ARROW_RIGHT: "ArrowRight",
1506
- ARROW_DOWN: "ArrowDown",
1507
- DELETE: "Delete",
1508
- ESCAPE: "Escape",
1509
- TAB: "Tab"
1510
- }, g = /* @__PURE__ */ new Set();
1511
- g.add(l.BACKSPACE);
1512
- g.add(l.ENTER);
1513
- g.add(l.SPACEBAR);
1514
- g.add(l.PAGE_UP);
1515
- g.add(l.PAGE_DOWN);
1516
- g.add(l.END);
1517
- g.add(l.HOME);
1518
- g.add(l.ARROW_LEFT);
1519
- g.add(l.ARROW_UP);
1520
- g.add(l.ARROW_RIGHT);
1521
- g.add(l.ARROW_DOWN);
1522
- g.add(l.DELETE);
1523
- g.add(l.ESCAPE);
1524
- g.add(l.TAB);
1525
- var A = {
1526
- BACKSPACE: 8,
1527
- ENTER: 13,
1528
- SPACEBAR: 32,
1529
- PAGE_UP: 33,
1530
- PAGE_DOWN: 34,
1531
- END: 35,
1532
- HOME: 36,
1533
- ARROW_LEFT: 37,
1534
- ARROW_UP: 38,
1535
- ARROW_RIGHT: 39,
1536
- ARROW_DOWN: 40,
1537
- DELETE: 46,
1538
- ESCAPE: 27,
1539
- TAB: 9
1540
- }, _ = /* @__PURE__ */ new Map();
1541
- _.set(A.BACKSPACE, l.BACKSPACE);
1542
- _.set(A.ENTER, l.ENTER);
1543
- _.set(A.SPACEBAR, l.SPACEBAR);
1544
- _.set(A.PAGE_UP, l.PAGE_UP);
1545
- _.set(A.PAGE_DOWN, l.PAGE_DOWN);
1546
- _.set(A.END, l.END);
1547
- _.set(A.HOME, l.HOME);
1548
- _.set(A.ARROW_LEFT, l.ARROW_LEFT);
1549
- _.set(A.ARROW_UP, l.ARROW_UP);
1550
- _.set(A.ARROW_RIGHT, l.ARROW_RIGHT);
1551
- _.set(A.ARROW_DOWN, l.ARROW_DOWN);
1552
- _.set(A.DELETE, l.DELETE);
1553
- _.set(A.ESCAPE, l.ESCAPE);
1554
- _.set(A.TAB, l.TAB);
1555
- var P = /* @__PURE__ */ new Set();
1556
- P.add(l.PAGE_UP);
1557
- P.add(l.PAGE_DOWN);
1558
- P.add(l.END);
1559
- P.add(l.HOME);
1560
- P.add(l.ARROW_LEFT);
1561
- P.add(l.ARROW_UP);
1562
- P.add(l.ARROW_RIGHT);
1563
- P.add(l.ARROW_DOWN);
1564
- function le(i) {
1565
- var e = i.key;
1566
- if (g.has(e))
1567
- return e;
1568
- var t = _.get(i.keyCode);
1569
- return t || l.UNKNOWN;
1570
- }
1571
- function Hi(i) {
1572
- return P.has(le(i));
1573
- }
1574
- /**
1575
- * @license
1576
- * Copyright 2020 Google Inc.
1577
- *
1578
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1579
- * of this software and associated documentation files (the "Software"), to deal
1580
- * in the Software without restriction, including without limitation the rights
1581
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1582
- * copies of the Software, and to permit persons to whom the Software is
1583
- * furnished to do so, subject to the following conditions:
1584
- *
1585
- * The above copyright notice and this permission notice shall be included in
1586
- * all copies or substantial portions of the Software.
1587
- *
1588
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1589
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1590
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1591
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1592
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1593
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1594
- * THE SOFTWARE.
1595
- */
1596
- var Q;
1597
- (function(i) {
1598
- i.PRIMARY_ACTION = "mdc-evolution-chip__action--primary", i.TRAILING_ACTION = "mdc-evolution-chip__action--trailing", i.CHIP_ROOT = "mdc-evolution-chip";
1599
- })(Q || (Q = {}));
1600
- var D;
1601
- (function(i) {
1602
- i[i.UNSPECIFIED = 0] = "UNSPECIFIED", i[i.CLICK = 1] = "CLICK", i[i.BACKSPACE_KEY = 2] = "BACKSPACE_KEY", i[i.DELETE_KEY = 3] = "DELETE_KEY", i[i.SPACEBAR_KEY = 4] = "SPACEBAR_KEY", i[i.ENTER_KEY = 5] = "ENTER_KEY";
1603
- })(D || (D = {}));
1604
- var E;
1605
- (function(i) {
1606
- i[i.UNSPECIFIED = 0] = "UNSPECIFIED", i[i.PRIMARY = 1] = "PRIMARY", i[i.TRAILING = 2] = "TRAILING";
1607
- })(E || (E = {}));
1608
- var X;
1609
- (function(i) {
1610
- i.INTERACTION = "MDCChipAction:interaction", i.NAVIGATION = "MDCChipAction:navigation";
1611
- })(X || (X = {}));
1612
- var C;
1613
- (function(i) {
1614
- i[i.FOCUSABLE = 0] = "FOCUSABLE", i[i.FOCUSABLE_AND_FOCUSED = 1] = "FOCUSABLE_AND_FOCUSED", i[i.NOT_FOCUSABLE = 2] = "NOT_FOCUSABLE";
1615
- })(C || (C = {}));
1616
- var v;
1617
- (function(i) {
1618
- i.ARIA_DISABLED = "aria-disabled", i.ARIA_HIDDEN = "aria-hidden", i.ARIA_SELECTED = "aria-selected", i.DATA_DELETABLE = "data-mdc-deletable", i.DISABLED = "disabled", i.ROLE = "role", i.TAB_INDEX = "tabindex";
1619
- })(v || (v = {}));
1620
- /**
1621
- * @license
1622
- * Copyright 2016 Google Inc.
1623
- *
1624
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1625
- * of this software and associated documentation files (the "Software"), to deal
1626
- * in the Software without restriction, including without limitation the rights
1627
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1628
- * copies of the Software, and to permit persons to whom the Software is
1629
- * furnished to do so, subject to the following conditions:
1630
- *
1631
- * The above copyright notice and this permission notice shall be included in
1632
- * all copies or substantial portions of the Software.
1633
- *
1634
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1635
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1636
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1637
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1638
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1639
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1640
- * THE SOFTWARE.
1641
- */
1642
- var m;
1643
- (function(i) {
1644
- i.SELECTING = "mdc-evolution-chip--selecting", i.DESELECTING = "mdc-evolution-chip--deselecting", i.SELECTING_WITH_PRIMARY_ICON = "mdc-evolution-chip--selecting-with-primary-icon", i.DESELECTING_WITH_PRIMARY_ICON = "mdc-evolution-chip--deselecting-with-primary-icon", i.DISABLED = "mdc-evolution-chip--disabled", i.ENTER = "mdc-evolution-chip--enter", i.EXIT = "mdc-evolution-chip--exit", i.SELECTED = "mdc-evolution-chip--selected", i.HIDDEN = "mdc-evolution-chip--hidden", i.WITH_PRIMARY_ICON = "mdc-evolution-chip--with-primary-icon";
1645
- })(m || (m = {}));
1646
- var S;
1647
- (function(i) {
1648
- i.INTERACTION = "MDCChip:interaction", i.NAVIGATION = "MDCChip:navigation", i.ANIMATION = "MDCChip:animation";
1649
- })(S || (S = {}));
1650
- var st;
1651
- (function(i) {
1652
- i.DATA_REMOVED_ANNOUNCEMENT = "data-mdc-removed-announcement", i.DATA_ADDED_ANNOUNCEMENT = "data-mdc-added-announcement";
1653
- })(st || (st = {}));
1654
- var w;
1655
- (function(i) {
1656
- i.ENTER = "mdc-evolution-chip-enter", i.EXIT = "mdc-evolution-chip-exit";
1657
- })(w || (w = {}));
1658
- /**
1659
- * @license
1660
- * Copyright 2020 Google Inc.
1661
- *
1662
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1663
- * of this software and associated documentation files (the "Software"), to deal
1664
- * in the Software without restriction, including without limitation the rights
1665
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1666
- * copies of the Software, and to permit persons to whom the Software is
1667
- * furnished to do so, subject to the following conditions:
1668
- *
1669
- * The above copyright notice and this permission notice shall be included in
1670
- * all copies or substantial portions of the Software.
1671
- *
1672
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1673
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1674
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1675
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1676
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1677
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1678
- * THE SOFTWARE.
1679
- */
1680
- var k;
1681
- (function(i) {
1682
- i[i.UNSPECIFIED = 0] = "UNSPECIFIED", i[i.LEFT = 1] = "LEFT", i[i.RIGHT = 2] = "RIGHT";
1683
- })(k || (k = {}));
1684
- var O;
1685
- (function(i) {
1686
- i.SELECTION = "selection", i.EXIT = "exit";
1687
- })(O || (O = {}));
1688
- var ki = (
1689
- /** @class */
1690
- function(i) {
1691
- U(e, i);
1692
- function e(t) {
1693
- var n = i.call(this, T(T({}, e.defaultAdapter), t)) || this;
1694
- return n.animFrame = new zi(), n;
1695
- }
1696
- return Object.defineProperty(e, "defaultAdapter", {
1697
- get: function() {
1698
- return {
1699
- addClass: function() {
1700
- },
1701
- emitEvent: function() {
1702
- },
1703
- getActions: function() {
1704
- return [];
1705
- },
1706
- getAttribute: function() {
1707
- return null;
1708
- },
1709
- getElementID: function() {
1710
- return "";
1711
- },
1712
- getOffsetWidth: function() {
1713
- return 0;
1714
- },
1715
- hasClass: function() {
1716
- return !1;
1717
- },
1718
- isActionDisabled: function() {
1719
- return !1;
1720
- },
1721
- isActionFocusable: function() {
1722
- return !1;
1723
- },
1724
- isActionSelectable: function() {
1725
- return !1;
1726
- },
1727
- isActionSelected: function() {
1728
- return !1;
1729
- },
1730
- isRTL: function() {
1731
- return !1;
1732
- },
1733
- removeClass: function() {
1734
- },
1735
- setActionDisabled: function() {
1736
- },
1737
- setActionFocus: function() {
1738
- },
1739
- setActionSelected: function() {
1740
- },
1741
- setStyleProperty: function() {
1742
- }
1743
- };
1744
- },
1745
- enumerable: !1,
1746
- configurable: !0
1747
- }), e.prototype.destroy = function() {
1748
- this.animFrame.cancelAll();
1749
- }, e.prototype.getElementID = function() {
1750
- return this.adapter.getElementID();
1751
- }, e.prototype.setDisabled = function(t) {
1752
- var n, r, o = this.getActions();
1753
- try {
1754
- for (var a = I(o), c = a.next(); !c.done; c = a.next()) {
1755
- var s = c.value;
1756
- this.adapter.setActionDisabled(s, t);
1757
- }
1758
- } catch (p) {
1759
- n = { error: p };
1760
- } finally {
1761
- try {
1762
- c && !c.done && (r = a.return) && r.call(a);
1763
- } finally {
1764
- if (n)
1765
- throw n.error;
1766
- }
1767
- }
1768
- t ? this.adapter.addClass(m.DISABLED) : this.adapter.removeClass(m.DISABLED);
1769
- }, e.prototype.isDisabled = function() {
1770
- var t, n, r = this.getActions();
1771
- try {
1772
- for (var o = I(r), a = o.next(); !a.done; a = o.next()) {
1773
- var c = a.value;
1774
- if (this.adapter.isActionDisabled(c))
1775
- return !0;
1776
- }
1777
- } catch (s) {
1778
- t = { error: s };
1779
- } finally {
1780
- try {
1781
- a && !a.done && (n = o.return) && n.call(o);
1782
- } finally {
1783
- if (t)
1784
- throw t.error;
1785
- }
1786
- }
1787
- return !1;
1788
- }, e.prototype.getActions = function() {
1789
- return this.adapter.getActions();
1790
- }, e.prototype.isActionFocusable = function(t) {
1791
- return this.adapter.isActionFocusable(t);
1792
- }, e.prototype.isActionSelectable = function(t) {
1793
- return this.adapter.isActionSelectable(t);
1794
- }, e.prototype.isActionSelected = function(t) {
1795
- return this.adapter.isActionSelected(t);
1796
- }, e.prototype.setActionFocus = function(t, n) {
1797
- this.adapter.setActionFocus(t, n);
1798
- }, e.prototype.setActionSelected = function(t, n) {
1799
- this.adapter.setActionSelected(t, n), this.animateSelection(n);
1800
- }, e.prototype.startAnimation = function(t) {
1801
- if (t === w.ENTER) {
1802
- this.adapter.addClass(m.ENTER);
1803
- return;
1804
- }
1805
- if (t === w.EXIT) {
1806
- this.adapter.addClass(m.EXIT);
1807
- return;
1808
- }
1809
- }, e.prototype.handleAnimationEnd = function(t) {
1810
- var n = this, r = t.animationName;
1811
- if (r === w.ENTER) {
1812
- this.adapter.removeClass(m.ENTER), this.adapter.emitEvent(S.ANIMATION, {
1813
- chipID: this.getElementID(),
1814
- animation: w.ENTER,
1815
- addedAnnouncement: this.getAddedAnnouncement(),
1816
- isComplete: !0
1817
- });
1818
- return;
1819
- }
1820
- if (r === w.EXIT) {
1821
- this.adapter.removeClass(m.EXIT), this.adapter.addClass(m.HIDDEN);
1822
- var o = this.adapter.getOffsetWidth();
1823
- this.adapter.setStyleProperty("width", o + "px"), this.animFrame.request(O.EXIT, function() {
1824
- n.animFrame.request(O.EXIT, function() {
1825
- n.adapter.setStyleProperty("width", "0");
1826
- });
1827
- });
1828
- }
1829
- }, e.prototype.handleTransitionEnd = function() {
1830
- this.adapter.hasClass(m.HIDDEN) && this.adapter.emitEvent(S.ANIMATION, {
1831
- chipID: this.getElementID(),
1832
- animation: w.EXIT,
1833
- removedAnnouncement: this.getRemovedAnnouncement(),
1834
- isComplete: !0
1835
- });
1836
- }, e.prototype.handleActionInteraction = function(t) {
1837
- var n = t.detail, r = n.source, o = n.actionID, a = this.adapter.isActionSelectable(r), c = this.adapter.isActionSelected(r);
1838
- this.adapter.emitEvent(S.INTERACTION, {
1839
- chipID: this.getElementID(),
1840
- shouldRemove: this.shouldRemove(n),
1841
- actionID: o,
1842
- isSelectable: a,
1843
- isSelected: c,
1844
- source: r
1845
- });
1846
- }, e.prototype.handleActionNavigation = function(t) {
1847
- var n = t.detail, r = n.source, o = n.key, a = this.adapter.isRTL(), c = this.adapter.isActionFocusable(E.TRAILING), s = this.adapter.isActionFocusable(E.PRIMARY), p = this.directionFromKey(o, a), d = r === E.PRIMARY && p === k.RIGHT && c, h = r === E.TRAILING && p === k.LEFT && s;
1848
- if (d) {
1849
- this.navigateActions({ from: r, to: E.TRAILING });
1850
- return;
1851
- }
1852
- if (h) {
1853
- this.navigateActions({ from: r, to: E.PRIMARY });
1854
- return;
1855
- }
1856
- this.adapter.emitEvent(S.NAVIGATION, {
1857
- chipID: this.getElementID(),
1858
- isRTL: a,
1859
- source: r,
1860
- key: o
1861
- });
1862
- }, e.prototype.directionFromKey = function(t, n) {
1863
- var r = t === l.ARROW_LEFT, o = t === l.ARROW_RIGHT;
1864
- return !n && r || n && o ? k.LEFT : !n && o || n && r ? k.RIGHT : k.UNSPECIFIED;
1865
- }, e.prototype.navigateActions = function(t) {
1866
- this.adapter.setActionFocus(t.from, C.NOT_FOCUSABLE), this.adapter.setActionFocus(t.to, C.FOCUSABLE_AND_FOCUSED);
1867
- }, e.prototype.shouldRemove = function(t) {
1868
- var n = t.source, r = t.trigger;
1869
- return r === D.BACKSPACE_KEY || r === D.DELETE_KEY ? !0 : n === E.TRAILING;
1870
- }, e.prototype.getRemovedAnnouncement = function() {
1871
- var t = this.adapter.getAttribute(st.DATA_REMOVED_ANNOUNCEMENT);
1872
- return t || void 0;
1873
- }, e.prototype.getAddedAnnouncement = function() {
1874
- var t = this.adapter.getAttribute(st.DATA_ADDED_ANNOUNCEMENT);
1875
- return t || void 0;
1876
- }, e.prototype.animateSelection = function(t) {
1877
- var n = this;
1878
- this.resetAnimationStyles(), this.animFrame.request(O.SELECTION, function() {
1879
- n.animFrame.request(O.SELECTION, function() {
1880
- n.updateSelectionStyles(t);
1881
- });
1882
- });
1883
- }, e.prototype.resetAnimationStyles = function() {
1884
- this.adapter.removeClass(m.SELECTING), this.adapter.removeClass(m.DESELECTING), this.adapter.removeClass(m.SELECTING_WITH_PRIMARY_ICON), this.adapter.removeClass(m.DESELECTING_WITH_PRIMARY_ICON);
1885
- }, e.prototype.updateSelectionStyles = function(t) {
1886
- var n = this, r = this.adapter.hasClass(m.WITH_PRIMARY_ICON);
1887
- if (r && t) {
1888
- this.adapter.addClass(m.SELECTING_WITH_PRIMARY_ICON), this.animFrame.request(O.SELECTION, function() {
1889
- n.adapter.addClass(m.SELECTED);
1890
- });
1891
- return;
1892
- }
1893
- if (r && !t) {
1894
- this.adapter.addClass(m.DESELECTING_WITH_PRIMARY_ICON), this.animFrame.request(O.SELECTION, function() {
1895
- n.adapter.removeClass(m.SELECTED);
1896
- });
1897
- return;
1898
- }
1899
- if (t) {
1900
- this.adapter.addClass(m.SELECTING), this.animFrame.request(O.SELECTION, function() {
1901
- n.adapter.addClass(m.SELECTED);
1902
- });
1903
- return;
1904
- }
1905
- if (!t) {
1906
- this.adapter.addClass(m.DESELECTING), this.animFrame.request(O.SELECTION, function() {
1907
- n.adapter.removeClass(m.SELECTED);
1908
- });
1909
- return;
1910
- }
1911
- }, e;
1912
- }(et)
1913
- );
1914
- /**
1915
- * @license
1916
- * Copyright 2016 Google Inc.
1917
- *
1918
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1919
- * of this software and associated documentation files (the "Software"), to deal
1920
- * in the Software without restriction, including without limitation the rights
1921
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1922
- * copies of the Software, and to permit persons to whom the Software is
1923
- * furnished to do so, subject to the following conditions:
1924
- *
1925
- * The above copyright notice and this permission notice shall be included in
1926
- * all copies or substantial portions of the Software.
1927
- *
1928
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1929
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1930
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1931
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1932
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1933
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1934
- * THE SOFTWARE.
1935
- */
1936
- function Bi(i) {
1937
- return String(i).replace(/\-([a-z])/g, function(e, t) {
1938
- return t.toUpperCase();
1939
- });
1940
- }
1941
- var pe = (
1942
- /** @class */
1943
- function() {
1944
- function i(e, t) {
1945
- for (var n = [], r = 2; r < arguments.length; r++)
1946
- n[r - 2] = arguments[r];
1947
- this.root = e, this.initialize.apply(this, ge([], _e(n))), this.foundation = t === void 0 ? this.getDefaultFoundation() : t, this.foundation.init(), this.initialSyncWithDOM();
1948
- }
1949
- return i.attachTo = function(e) {
1950
- return new i(e, new et({}));
1951
- }, i.prototype.initialize = function() {
1952
- }, i.prototype.getDefaultFoundation = function() {
1953
- throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class");
1954
- }, i.prototype.initialSyncWithDOM = function() {
1955
- }, i.prototype.destroy = function() {
1956
- this.foundation.destroy();
1957
- }, i.prototype.listen = function(e, t, n) {
1958
- this.root.addEventListener(e, t, n);
1959
- }, i.prototype.unlisten = function(e, t, n) {
1960
- this.root.removeEventListener(e, t, n);
1961
- }, i.prototype.emit = function(e, t, n) {
1962
- n === void 0 && (n = !1);
1963
- var r;
1964
- typeof CustomEvent == "function" ? r = new CustomEvent(e, {
1965
- bubbles: n,
1966
- detail: t
1967
- }) : (r = document.createEvent("CustomEvent"), r.initCustomEvent(e, n, !1, t)), this.root.dispatchEvent(r);
1968
- }, i.prototype.safeSetAttribute = function(e, t, n) {
1969
- if (t.toLowerCase() === "tabindex")
1970
- e.tabIndex = Number(n);
1971
- else if (t.indexOf("data-") === 0) {
1972
- var r = Bi(t.replace(/^data-/, ""));
1973
- e.dataset[r] = n;
1974
- } else
1975
- re([F.safeAttrPrefix(Nt || (Nt = H(["aria-"], ["aria-"]))), F.safeAttrPrefix(Ot || (Ot = H(["role"], ["role"])))], e, t, n);
1976
- }, i;
1977
- }()
1978
- ), Nt, Ot;
1979
- /**
1980
- * @license
1981
- * Copyright 2018 Google Inc.
1982
- *
1983
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1984
- * of this software and associated documentation files (the "Software"), to deal
1985
- * in the Software without restriction, including without limitation the rights
1986
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1987
- * copies of the Software, and to permit persons to whom the Software is
1988
- * furnished to do so, subject to the following conditions:
1989
- *
1990
- * The above copyright notice and this permission notice shall be included in
1991
- * all copies or substantial portions of the Software.
1992
- *
1993
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1994
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1995
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1996
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1997
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1998
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1999
- * THE SOFTWARE.
2000
- */
2001
- function Gi(i, e) {
2002
- if (i.closest)
2003
- return i.closest(e);
2004
- for (var t = i; t; ) {
2005
- if (de(t, e))
2006
- return t;
2007
- t = t.parentElement;
2008
- }
2009
- return null;
2010
- }
2011
- function de(i, e) {
2012
- var t = i.matches || i.webkitMatchesSelector || i.msMatchesSelector;
2013
- return t.call(i, e);
2014
- }
2015
- /**
2016
- * @license
2017
- * Copyright 2019 Google Inc.
2018
- *
2019
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2020
- * of this software and associated documentation files (the "Software"), to deal
2021
- * in the Software without restriction, including without limitation the rights
2022
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2023
- * copies of the Software, and to permit persons to whom the Software is
2024
- * furnished to do so, subject to the following conditions:
2025
- *
2026
- * The above copyright notice and this permission notice shall be included in
2027
- * all copies or substantial portions of the Software.
2028
- *
2029
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2030
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2031
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2032
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2033
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2034
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2035
- * THE SOFTWARE.
2036
- */
2037
- function ot(i) {
2038
- return i === void 0 && (i = window), Wi(i) ? { passive: !0 } : !1;
2039
- }
2040
- function Wi(i) {
2041
- i === void 0 && (i = window);
2042
- var e = !1;
2043
- try {
2044
- var t = {
2045
- // This function will be called when the browser
2046
- // attempts to access the passive property.
2047
- get passive() {
2048
- return e = !0, !1;
2049
- }
2050
- }, n = function() {
2051
- };
2052
- i.document.addEventListener("test", n, t), i.document.removeEventListener("test", n, t);
2053
- } catch {
2054
- e = !1;
2055
- }
2056
- return e;
2057
- }
2058
- /**
2059
- * @license
2060
- * Copyright 2016 Google Inc.
2061
- *
2062
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2063
- * of this software and associated documentation files (the "Software"), to deal
2064
- * in the Software without restriction, including without limitation the rights
2065
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2066
- * copies of the Software, and to permit persons to whom the Software is
2067
- * furnished to do so, subject to the following conditions:
2068
- *
2069
- * The above copyright notice and this permission notice shall be included in
2070
- * all copies or substantial portions of the Software.
2071
- *
2072
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2073
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2074
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2075
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2076
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2077
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2078
- * THE SOFTWARE.
2079
- */
2080
- var ji = {
2081
- // Ripple is a special case where the "root" component is really a "mixin" of
2082
- // sorts,
2083
- // given that it's an 'upgrade' to an existing component. That being said it
2084
- // is the root
2085
- // CSS class that all other CSS classes derive from.
2086
- BG_FOCUSED: "mdc-ripple-upgraded--background-focused",
2087
- FG_ACTIVATION: "mdc-ripple-upgraded--foreground-activation",
2088
- FG_DEACTIVATION: "mdc-ripple-upgraded--foreground-deactivation",
2089
- ROOT: "mdc-ripple-upgraded",
2090
- UNBOUNDED: "mdc-ripple-upgraded--unbounded"
2091
- }, $i = {
2092
- VAR_FG_SCALE: "--mdc-ripple-fg-scale",
2093
- VAR_FG_SIZE: "--mdc-ripple-fg-size",
2094
- VAR_FG_TRANSLATE_END: "--mdc-ripple-fg-translate-end",
2095
- VAR_FG_TRANSLATE_START: "--mdc-ripple-fg-translate-start",
2096
- VAR_LEFT: "--mdc-ripple-left",
2097
- VAR_TOP: "--mdc-ripple-top"
2098
- }, Dt = {
2099
- DEACTIVATION_TIMEOUT_MS: 225,
2100
- // animation duration)
2101
- FG_DEACTIVATION_MS: 150,
2102
- // (i.e. deactivation animation duration)
2103
- INITIAL_ORIGIN_SCALE: 0.6,
2104
- PADDING: 10,
2105
- TAP_DELAY_MS: 300
2106
- // Delay between touch and simulated mouse events on touch devices
2107
- }, at;
2108
- function Ki(i, e) {
2109
- e === void 0 && (e = !1);
2110
- var t = i.CSS, n = at;
2111
- if (typeof at == "boolean" && !e)
2112
- return at;
2113
- var r = t && typeof t.supports == "function";
2114
- if (!r)
2115
- return !1;
2116
- var o = t.supports("--css-vars", "yes"), a = t.supports("(--css-vars: yes)") && t.supports("color", "#00000000");
2117
- return n = o || a, e || (at = n), n;
2118
- }
2119
- function Vi(i, e, t) {
2120
- if (!i)
2121
- return { x: 0, y: 0 };
2122
- var n = e.x, r = e.y, o = n + t.left, a = r + t.top, c, s;
2123
- if (i.type === "touchstart") {
2124
- var p = i;
2125
- c = p.changedTouches[0].pageX - o, s = p.changedTouches[0].pageY - a;
2126
- } else {
2127
- var d = i;
2128
- c = d.pageX - o, s = d.pageY - a;
2129
- }
2130
- return { x: c, y: s };
2131
- }
2132
- /**
2133
- * @license
2134
- * Copyright 2016 Google Inc.
2135
- *
2136
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2137
- * of this software and associated documentation files (the "Software"), to deal
2138
- * in the Software without restriction, including without limitation the rights
2139
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2140
- * copies of the Software, and to permit persons to whom the Software is
2141
- * furnished to do so, subject to the following conditions:
2142
- *
2143
- * The above copyright notice and this permission notice shall be included in
2144
- * all copies or substantial portions of the Software.
2145
- *
2146
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2147
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2148
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2149
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2150
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2151
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2152
- * THE SOFTWARE.
2153
- */
2154
- var xt = [
2155
- "touchstart",
2156
- "pointerdown",
2157
- "mousedown",
2158
- "keydown"
2159
- ], Pt = [
2160
- "touchend",
2161
- "pointerup",
2162
- "mouseup",
2163
- "contextmenu"
2164
- ], ct = [], ue = (
2165
- /** @class */
2166
- function(i) {
2167
- U(e, i);
2168
- function e(t) {
2169
- var n = i.call(this, T(T({}, e.defaultAdapter), t)) || this;
2170
- return n.activationAnimationHasEnded = !1, n.activationTimer = 0, n.fgDeactivationRemovalTimer = 0, n.fgScale = "0", n.frame = { width: 0, height: 0 }, n.initialSize = 0, n.layoutFrame = 0, n.maxRadius = 0, n.unboundedCoords = { left: 0, top: 0 }, n.activationState = n.defaultActivationState(), n.activationTimerCallback = function() {
2171
- n.activationAnimationHasEnded = !0, n.runDeactivationUXLogicIfReady();
2172
- }, n.activateHandler = function(r) {
2173
- n.activateImpl(r);
2174
- }, n.deactivateHandler = function() {
2175
- n.deactivateImpl();
2176
- }, n.focusHandler = function() {
2177
- n.handleFocus();
2178
- }, n.blurHandler = function() {
2179
- n.handleBlur();
2180
- }, n.resizeHandler = function() {
2181
- n.layout();
2182
- }, n;
2183
- }
2184
- return Object.defineProperty(e, "cssClasses", {
2185
- get: function() {
2186
- return ji;
2187
- },
2188
- enumerable: !1,
2189
- configurable: !0
2190
- }), Object.defineProperty(e, "strings", {
2191
- get: function() {
2192
- return $i;
2193
- },
2194
- enumerable: !1,
2195
- configurable: !0
2196
- }), Object.defineProperty(e, "numbers", {
2197
- get: function() {
2198
- return Dt;
2199
- },
2200
- enumerable: !1,
2201
- configurable: !0
2202
- }), Object.defineProperty(e, "defaultAdapter", {
2203
- get: function() {
2204
- return {
2205
- addClass: function() {
2206
- },
2207
- browserSupportsCssVars: function() {
2208
- return !0;
2209
- },
2210
- computeBoundingRect: function() {
2211
- return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
2212
- },
2213
- containsEventTarget: function() {
2214
- return !0;
2215
- },
2216
- deregisterDocumentInteractionHandler: function() {
2217
- },
2218
- deregisterInteractionHandler: function() {
2219
- },
2220
- deregisterResizeHandler: function() {
2221
- },
2222
- getWindowPageOffset: function() {
2223
- return { x: 0, y: 0 };
2224
- },
2225
- isSurfaceActive: function() {
2226
- return !0;
2227
- },
2228
- isSurfaceDisabled: function() {
2229
- return !0;
2230
- },
2231
- isUnbounded: function() {
2232
- return !0;
2233
- },
2234
- registerDocumentInteractionHandler: function() {
2235
- },
2236
- registerInteractionHandler: function() {
2237
- },
2238
- registerResizeHandler: function() {
2239
- },
2240
- removeClass: function() {
2241
- },
2242
- updateCssVariable: function() {
2243
- }
2244
- };
2245
- },
2246
- enumerable: !1,
2247
- configurable: !0
2248
- }), e.prototype.init = function() {
2249
- var t = this, n = this.supportsPressRipple();
2250
- if (this.registerRootHandlers(n), n) {
2251
- var r = e.cssClasses, o = r.ROOT, a = r.UNBOUNDED;
2252
- requestAnimationFrame(function() {
2253
- t.adapter.addClass(o), t.adapter.isUnbounded() && (t.adapter.addClass(a), t.layoutInternal());
2254
- });
2255
- }
2256
- }, e.prototype.destroy = function() {
2257
- var t = this;
2258
- if (this.supportsPressRipple()) {
2259
- this.activationTimer && (clearTimeout(this.activationTimer), this.activationTimer = 0, this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)), this.fgDeactivationRemovalTimer && (clearTimeout(this.fgDeactivationRemovalTimer), this.fgDeactivationRemovalTimer = 0, this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));
2260
- var n = e.cssClasses, r = n.ROOT, o = n.UNBOUNDED;
2261
- requestAnimationFrame(function() {
2262
- t.adapter.removeClass(r), t.adapter.removeClass(o), t.removeCssVars();
2263
- });
2264
- }
2265
- this.deregisterRootHandlers(), this.deregisterDeactivationHandlers();
2266
- }, e.prototype.activate = function(t) {
2267
- this.activateImpl(t);
2268
- }, e.prototype.deactivate = function() {
2269
- this.deactivateImpl();
2270
- }, e.prototype.layout = function() {
2271
- var t = this;
2272
- this.layoutFrame && cancelAnimationFrame(this.layoutFrame), this.layoutFrame = requestAnimationFrame(function() {
2273
- t.layoutInternal(), t.layoutFrame = 0;
2274
- });
2275
- }, e.prototype.setUnbounded = function(t) {
2276
- var n = e.cssClasses.UNBOUNDED;
2277
- t ? this.adapter.addClass(n) : this.adapter.removeClass(n);
2278
- }, e.prototype.handleFocus = function() {
2279
- var t = this;
2280
- requestAnimationFrame(function() {
2281
- t.adapter.addClass(e.cssClasses.BG_FOCUSED);
2282
- });
2283
- }, e.prototype.handleBlur = function() {
2284
- var t = this;
2285
- requestAnimationFrame(function() {
2286
- t.adapter.removeClass(e.cssClasses.BG_FOCUSED);
2287
- });
2288
- }, e.prototype.supportsPressRipple = function() {
2289
- return this.adapter.browserSupportsCssVars();
2290
- }, e.prototype.defaultActivationState = function() {
2291
- return {
2292
- activationEvent: void 0,
2293
- hasDeactivationUXRun: !1,
2294
- isActivated: !1,
2295
- isProgrammatic: !1,
2296
- wasActivatedByPointer: !1,
2297
- wasElementMadeActive: !1
2298
- };
2299
- }, e.prototype.registerRootHandlers = function(t) {
2300
- var n, r;
2301
- if (t) {
2302
- try {
2303
- for (var o = I(xt), a = o.next(); !a.done; a = o.next()) {
2304
- var c = a.value;
2305
- this.adapter.registerInteractionHandler(c, this.activateHandler);
2306
- }
2307
- } catch (s) {
2308
- n = { error: s };
2309
- } finally {
2310
- try {
2311
- a && !a.done && (r = o.return) && r.call(o);
2312
- } finally {
2313
- if (n)
2314
- throw n.error;
2315
- }
2316
- }
2317
- this.adapter.isUnbounded() && this.adapter.registerResizeHandler(this.resizeHandler);
2318
- }
2319
- this.adapter.registerInteractionHandler("focus", this.focusHandler), this.adapter.registerInteractionHandler("blur", this.blurHandler);
2320
- }, e.prototype.registerDeactivationHandlers = function(t) {
2321
- var n, r;
2322
- if (t.type === "keydown")
2323
- this.adapter.registerInteractionHandler("keyup", this.deactivateHandler);
2324
- else
2325
- try {
2326
- for (var o = I(Pt), a = o.next(); !a.done; a = o.next()) {
2327
- var c = a.value;
2328
- this.adapter.registerDocumentInteractionHandler(c, this.deactivateHandler);
2329
- }
2330
- } catch (s) {
2331
- n = { error: s };
2332
- } finally {
2333
- try {
2334
- a && !a.done && (r = o.return) && r.call(o);
2335
- } finally {
2336
- if (n)
2337
- throw n.error;
2338
- }
2339
- }
2340
- }, e.prototype.deregisterRootHandlers = function() {
2341
- var t, n;
2342
- try {
2343
- for (var r = I(xt), o = r.next(); !o.done; o = r.next()) {
2344
- var a = o.value;
2345
- this.adapter.deregisterInteractionHandler(a, this.activateHandler);
2346
- }
2347
- } catch (c) {
2348
- t = { error: c };
2349
- } finally {
2350
- try {
2351
- o && !o.done && (n = r.return) && n.call(r);
2352
- } finally {
2353
- if (t)
2354
- throw t.error;
2355
- }
2356
- }
2357
- this.adapter.deregisterInteractionHandler("focus", this.focusHandler), this.adapter.deregisterInteractionHandler("blur", this.blurHandler), this.adapter.isUnbounded() && this.adapter.deregisterResizeHandler(this.resizeHandler);
2358
- }, e.prototype.deregisterDeactivationHandlers = function() {
2359
- var t, n;
2360
- this.adapter.deregisterInteractionHandler("keyup", this.deactivateHandler);
2361
- try {
2362
- for (var r = I(Pt), o = r.next(); !o.done; o = r.next()) {
2363
- var a = o.value;
2364
- this.adapter.deregisterDocumentInteractionHandler(a, this.deactivateHandler);
2365
- }
2366
- } catch (c) {
2367
- t = { error: c };
2368
- } finally {
2369
- try {
2370
- o && !o.done && (n = r.return) && n.call(r);
2371
- } finally {
2372
- if (t)
2373
- throw t.error;
2374
- }
2375
- }
2376
- }, e.prototype.removeCssVars = function() {
2377
- var t = this, n = e.strings, r = Object.keys(n);
2378
- r.forEach(function(o) {
2379
- o.indexOf("VAR_") === 0 && t.adapter.updateCssVariable(n[o], null);
2380
- });
2381
- }, e.prototype.activateImpl = function(t) {
2382
- var n = this;
2383
- if (!this.adapter.isSurfaceDisabled()) {
2384
- var r = this.activationState;
2385
- if (!r.isActivated) {
2386
- var o = this.previousActivationEvent, a = o && t !== void 0 && o.type !== t.type;
2387
- if (!a) {
2388
- r.isActivated = !0, r.isProgrammatic = t === void 0, r.activationEvent = t, r.wasActivatedByPointer = r.isProgrammatic ? !1 : t !== void 0 && (t.type === "mousedown" || t.type === "touchstart" || t.type === "pointerdown");
2389
- var c = t !== void 0 && ct.length > 0 && ct.some(function(s) {
2390
- return n.adapter.containsEventTarget(s);
2391
- });
2392
- if (c) {
2393
- this.resetActivationState();
2394
- return;
2395
- }
2396
- t !== void 0 && (ct.push(t.target), this.registerDeactivationHandlers(t)), r.wasElementMadeActive = this.checkElementMadeActive(t), r.wasElementMadeActive && this.animateActivation(), requestAnimationFrame(function() {
2397
- ct = [], !r.wasElementMadeActive && t !== void 0 && (t.key === " " || t.keyCode === 32) && (r.wasElementMadeActive = n.checkElementMadeActive(t), r.wasElementMadeActive && n.animateActivation()), r.wasElementMadeActive || (n.activationState = n.defaultActivationState());
2398
- });
2399
- }
2400
- }
2401
- }
2402
- }, e.prototype.checkElementMadeActive = function(t) {
2403
- return t !== void 0 && t.type === "keydown" ? this.adapter.isSurfaceActive() : !0;
2404
- }, e.prototype.animateActivation = function() {
2405
- var t = this, n = e.strings, r = n.VAR_FG_TRANSLATE_START, o = n.VAR_FG_TRANSLATE_END, a = e.cssClasses, c = a.FG_DEACTIVATION, s = a.FG_ACTIVATION, p = e.numbers.DEACTIVATION_TIMEOUT_MS;
2406
- this.layoutInternal();
2407
- var d = "", h = "";
2408
- if (!this.adapter.isUnbounded()) {
2409
- var b = this.getFgTranslationCoordinates(), N = b.startPoint, j = b.endPoint;
2410
- d = N.x + "px, " + N.y + "px", h = j.x + "px, " + j.y + "px";
2411
- }
2412
- this.adapter.updateCssVariable(r, d), this.adapter.updateCssVariable(o, h), clearTimeout(this.activationTimer), clearTimeout(this.fgDeactivationRemovalTimer), this.rmBoundedActivationClasses(), this.adapter.removeClass(c), this.adapter.computeBoundingRect(), this.adapter.addClass(s), this.activationTimer = setTimeout(function() {
2413
- t.activationTimerCallback();
2414
- }, p);
2415
- }, e.prototype.getFgTranslationCoordinates = function() {
2416
- var t = this.activationState, n = t.activationEvent, r = t.wasActivatedByPointer, o;
2417
- r ? o = Vi(n, this.adapter.getWindowPageOffset(), this.adapter.computeBoundingRect()) : o = {
2418
- x: this.frame.width / 2,
2419
- y: this.frame.height / 2
2420
- }, o = {
2421
- x: o.x - this.initialSize / 2,
2422
- y: o.y - this.initialSize / 2
2423
- };
2424
- var a = {
2425
- x: this.frame.width / 2 - this.initialSize / 2,
2426
- y: this.frame.height / 2 - this.initialSize / 2
2427
- };
2428
- return { startPoint: o, endPoint: a };
2429
- }, e.prototype.runDeactivationUXLogicIfReady = function() {
2430
- var t = this, n = e.cssClasses.FG_DEACTIVATION, r = this.activationState, o = r.hasDeactivationUXRun, a = r.isActivated, c = o || !a;
2431
- c && this.activationAnimationHasEnded && (this.rmBoundedActivationClasses(), this.adapter.addClass(n), this.fgDeactivationRemovalTimer = setTimeout(function() {
2432
- t.adapter.removeClass(n);
2433
- }, Dt.FG_DEACTIVATION_MS));
2434
- }, e.prototype.rmBoundedActivationClasses = function() {
2435
- var t = e.cssClasses.FG_ACTIVATION;
2436
- this.adapter.removeClass(t), this.activationAnimationHasEnded = !1, this.adapter.computeBoundingRect();
2437
- }, e.prototype.resetActivationState = function() {
2438
- var t = this;
2439
- this.previousActivationEvent = this.activationState.activationEvent, this.activationState = this.defaultActivationState(), setTimeout(function() {
2440
- return t.previousActivationEvent = void 0;
2441
- }, e.numbers.TAP_DELAY_MS);
2442
- }, e.prototype.deactivateImpl = function() {
2443
- var t = this, n = this.activationState;
2444
- if (n.isActivated) {
2445
- var r = T({}, n);
2446
- n.isProgrammatic ? (requestAnimationFrame(function() {
2447
- t.animateDeactivation(r);
2448
- }), this.resetActivationState()) : (this.deregisterDeactivationHandlers(), requestAnimationFrame(function() {
2449
- t.activationState.hasDeactivationUXRun = !0, t.animateDeactivation(r), t.resetActivationState();
2450
- }));
2451
- }
2452
- }, e.prototype.animateDeactivation = function(t) {
2453
- var n = t.wasActivatedByPointer, r = t.wasElementMadeActive;
2454
- (n || r) && this.runDeactivationUXLogicIfReady();
2455
- }, e.prototype.layoutInternal = function() {
2456
- var t = this;
2457
- this.frame = this.adapter.computeBoundingRect();
2458
- var n = Math.max(this.frame.height, this.frame.width), r = function() {
2459
- var a = Math.sqrt(Math.pow(t.frame.width, 2) + Math.pow(t.frame.height, 2));
2460
- return a + e.numbers.PADDING;
2461
- };
2462
- this.maxRadius = this.adapter.isUnbounded() ? n : r();
2463
- var o = Math.floor(n * e.numbers.INITIAL_ORIGIN_SCALE);
2464
- this.adapter.isUnbounded() && o % 2 !== 0 ? this.initialSize = o - 1 : this.initialSize = o, this.fgScale = "" + this.maxRadius / this.initialSize, this.updateLayoutCssVars();
2465
- }, e.prototype.updateLayoutCssVars = function() {
2466
- var t = e.strings, n = t.VAR_FG_SIZE, r = t.VAR_LEFT, o = t.VAR_TOP, a = t.VAR_FG_SCALE;
2467
- this.adapter.updateCssVariable(n, this.initialSize + "px"), this.adapter.updateCssVariable(a, this.fgScale), this.adapter.isUnbounded() && (this.unboundedCoords = {
2468
- left: Math.round(this.frame.width / 2 - this.initialSize / 2),
2469
- top: Math.round(this.frame.height / 2 - this.initialSize / 2)
2470
- }, this.adapter.updateCssVariable(r, this.unboundedCoords.left + "px"), this.adapter.updateCssVariable(o, this.unboundedCoords.top + "px"));
2471
- }, e;
2472
- }(et)
2473
- );
2474
- /**
2475
- * @license
2476
- * Copyright 2016 Google Inc.
2477
- *
2478
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2479
- * of this software and associated documentation files (the "Software"), to deal
2480
- * in the Software without restriction, including without limitation the rights
2481
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2482
- * copies of the Software, and to permit persons to whom the Software is
2483
- * furnished to do so, subject to the following conditions:
2484
- *
2485
- * The above copyright notice and this permission notice shall be included in
2486
- * all copies or substantial portions of the Software.
2487
- *
2488
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2489
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2490
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2491
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2492
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2493
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2494
- * THE SOFTWARE.
2495
- */
2496
- var Lt = (
2497
- /** @class */
2498
- function(i) {
2499
- U(e, i);
2500
- function e() {
2501
- var t = i !== null && i.apply(this, arguments) || this;
2502
- return t.disabled = !1, t;
2503
- }
2504
- return e.attachTo = function(t, n) {
2505
- n === void 0 && (n = {
2506
- isUnbounded: void 0
2507
- });
2508
- var r = new e(t);
2509
- return n.isUnbounded !== void 0 && (r.unbounded = n.isUnbounded), r;
2510
- }, e.createAdapter = function(t) {
2511
- return {
2512
- addClass: function(n) {
2513
- t.root.classList.add(n);
2514
- },
2515
- browserSupportsCssVars: function() {
2516
- return Ki(window);
2517
- },
2518
- computeBoundingRect: function() {
2519
- return t.root.getBoundingClientRect();
2520
- },
2521
- containsEventTarget: function(n) {
2522
- return t.root.contains(n);
2523
- },
2524
- deregisterDocumentInteractionHandler: function(n, r) {
2525
- document.documentElement.removeEventListener(n, r, ot());
2526
- },
2527
- deregisterInteractionHandler: function(n, r) {
2528
- t.root.removeEventListener(n, r, ot());
2529
- },
2530
- deregisterResizeHandler: function(n) {
2531
- window.removeEventListener("resize", n);
2532
- },
2533
- getWindowPageOffset: function() {
2534
- return { x: window.pageXOffset, y: window.pageYOffset };
2535
- },
2536
- isSurfaceActive: function() {
2537
- return de(t.root, ":active");
2538
- },
2539
- isSurfaceDisabled: function() {
2540
- return !!t.disabled;
2541
- },
2542
- isUnbounded: function() {
2543
- return !!t.unbounded;
2544
- },
2545
- registerDocumentInteractionHandler: function(n, r) {
2546
- document.documentElement.addEventListener(n, r, ot());
2547
- },
2548
- registerInteractionHandler: function(n, r) {
2549
- t.root.addEventListener(n, r, ot());
2550
- },
2551
- registerResizeHandler: function(n) {
2552
- window.addEventListener("resize", n);
2553
- },
2554
- removeClass: function(n) {
2555
- t.root.classList.remove(n);
2556
- },
2557
- updateCssVariable: function(n, r) {
2558
- t.root.style.setProperty(n, r);
2559
- }
2560
- };
2561
- }, Object.defineProperty(e.prototype, "unbounded", {
2562
- get: function() {
2563
- return !!this.isUnbounded;
2564
- },
2565
- set: function(t) {
2566
- this.isUnbounded = !!t, this.setUnbounded();
2567
- },
2568
- enumerable: !1,
2569
- configurable: !0
2570
- }), e.prototype.activate = function() {
2571
- this.foundation.activate();
2572
- }, e.prototype.deactivate = function() {
2573
- this.foundation.deactivate();
2574
- }, e.prototype.layout = function() {
2575
- this.foundation.layout();
2576
- }, e.prototype.getDefaultFoundation = function() {
2577
- return new ue(e.createAdapter(this));
2578
- }, e.prototype.initialSyncWithDOM = function() {
2579
- var t = this.root;
2580
- this.isUnbounded = "mdcRippleIsUnbounded" in t.dataset;
2581
- }, e.prototype.setUnbounded = function() {
2582
- this.foundation.setUnbounded(!!this.isUnbounded);
2583
- }, e;
2584
- }(pe)
2585
- );
2586
- /**
2587
- * @license
2588
- * Copyright 2020 Google Inc.
2589
- *
2590
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2591
- * of this software and associated documentation files (the "Software"), to deal
2592
- * in the Software without restriction, including without limitation the rights
2593
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2594
- * copies of the Software, and to permit persons to whom the Software is
2595
- * furnished to do so, subject to the following conditions:
2596
- *
2597
- * The above copyright notice and this permission notice shall be included in
2598
- * all copies or substantial portions of the Software.
2599
- *
2600
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2601
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2602
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2603
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2604
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2605
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2606
- * THE SOFTWARE.
2607
- */
2608
- function qi(i, e) {
2609
- var t = Number(e.replace("px", ""));
2610
- return Number.isNaN(t) ? i : {
2611
- width: i.width + t,
2612
- height: i.height,
2613
- top: i.top,
2614
- right: i.right,
2615
- bottom: i.bottom,
2616
- left: i.left
2617
- };
2618
- }
2619
- var Xi = "--mdc-chip-graphic-selected-width";
2620
- /**
2621
- * @license
2622
- * Copyright 2020 Google Inc.
2623
- *
2624
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2625
- * of this software and associated documentation files (the "Software"), to deal
2626
- * in the Software without restriction, including without limitation the rights
2627
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2628
- * copies of the Software, and to permit persons to whom the Software is
2629
- * furnished to do so, subject to the following conditions:
2630
- *
2631
- * The above copyright notice and this permission notice shall be included in
2632
- * all copies or substantial portions of the Software.
2633
- *
2634
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2635
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2636
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2637
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2638
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2639
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2640
- * THE SOFTWARE.
2641
- */
2642
- var it = /* @__PURE__ */ new Map();
2643
- it.set(l.SPACEBAR, D.SPACEBAR_KEY);
2644
- it.set(l.ENTER, D.ENTER_KEY);
2645
- it.set(l.DELETE, D.DELETE_KEY);
2646
- it.set(l.BACKSPACE, D.BACKSPACE_KEY);
2647
- var he = (
2648
- /** @class */
2649
- function(i) {
2650
- U(e, i);
2651
- function e(t) {
2652
- return i.call(this, T(T({}, e.defaultAdapter), t)) || this;
2653
- }
2654
- return Object.defineProperty(e, "defaultAdapter", {
2655
- get: function() {
2656
- return {
2657
- emitEvent: function() {
2658
- },
2659
- focus: function() {
2660
- },
2661
- getAttribute: function() {
2662
- return null;
2663
- },
2664
- getElementID: function() {
2665
- return "";
2666
- },
2667
- removeAttribute: function() {
2668
- },
2669
- setAttribute: function() {
2670
- }
2671
- };
2672
- },
2673
- enumerable: !1,
2674
- configurable: !0
2675
- }), e.prototype.handleClick = function() {
2676
- this.isDisabled() || this.emitInteraction(D.CLICK);
2677
- }, e.prototype.handleKeydown = function(t) {
2678
- var n = le(t);
2679
- if (this.shouldNotifyInteractionFromKey(n)) {
2680
- t.preventDefault(), this.emitInteraction(this.getTriggerFromKey(n));
2681
- return;
2682
- }
2683
- if (Hi(t)) {
2684
- t.preventDefault(), this.emitNavigation(n);
2685
- return;
2686
- }
2687
- return !0;
2688
- }, e.prototype.setDisabled = function(t) {
2689
- if (this.isSelectable()) {
2690
- this.adapter.setAttribute(v.ARIA_DISABLED, "" + t);
2691
- return;
2692
- }
2693
- t ? this.adapter.setAttribute(v.DISABLED, "true") : this.adapter.removeAttribute(v.DISABLED);
2694
- }, e.prototype.isDisabled = function() {
2695
- return this.adapter.getAttribute(v.ARIA_DISABLED) === "true" || this.adapter.getAttribute(v.DISABLED) !== null;
2696
- }, e.prototype.setFocus = function(t) {
2697
- if (this.isFocusable()) {
2698
- if (t === C.FOCUSABLE_AND_FOCUSED) {
2699
- this.adapter.setAttribute(v.TAB_INDEX, "0"), this.adapter.focus();
2700
- return;
2701
- }
2702
- if (t === C.FOCUSABLE) {
2703
- this.adapter.setAttribute(v.TAB_INDEX, "0");
2704
- return;
2705
- }
2706
- if (t === C.NOT_FOCUSABLE) {
2707
- this.adapter.setAttribute(v.TAB_INDEX, "-1");
2708
- return;
2709
- }
2710
- }
2711
- }, e.prototype.isFocusable = function() {
2712
- return !(this.isDisabled() || this.adapter.getAttribute(v.ARIA_HIDDEN) === "true");
2713
- }, e.prototype.setSelected = function(t) {
2714
- this.isSelectable() && this.adapter.setAttribute(v.ARIA_SELECTED, "" + t);
2715
- }, e.prototype.isSelected = function() {
2716
- return this.adapter.getAttribute(v.ARIA_SELECTED) === "true";
2717
- }, e.prototype.emitInteraction = function(t) {
2718
- this.adapter.emitEvent(X.INTERACTION, {
2719
- actionID: this.adapter.getElementID(),
2720
- source: this.actionType(),
2721
- trigger: t
2722
- });
2723
- }, e.prototype.emitNavigation = function(t) {
2724
- this.adapter.emitEvent(X.NAVIGATION, {
2725
- source: this.actionType(),
2726
- key: t
2727
- });
2728
- }, e.prototype.shouldNotifyInteractionFromKey = function(t) {
2729
- var n = t === l.ENTER || t === l.SPACEBAR, r = t === l.BACKSPACE || t === l.DELETE;
2730
- return !!(n || r && this.shouldEmitInteractionOnRemoveKey());
2731
- }, e.prototype.getTriggerFromKey = function(t) {
2732
- var n = it.get(t);
2733
- return n || D.UNSPECIFIED;
2734
- }, e;
2735
- }(et)
2736
- );
2737
- /**
2738
- * @license
2739
- * Copyright 2020 Google Inc.
2740
- *
2741
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2742
- * of this software and associated documentation files (the "Software"), to deal
2743
- * in the Software without restriction, including without limitation the rights
2744
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2745
- * copies of the Software, and to permit persons to whom the Software is
2746
- * furnished to do so, subject to the following conditions:
2747
- *
2748
- * The above copyright notice and this permission notice shall be included in
2749
- * all copies or substantial portions of the Software.
2750
- *
2751
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2752
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2753
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2754
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2755
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2756
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2757
- * THE SOFTWARE.
2758
- */
2759
- var Yi = (
2760
- /** @class */
2761
- function(i) {
2762
- U(e, i);
2763
- function e() {
2764
- return i !== null && i.apply(this, arguments) || this;
2765
- }
2766
- return e.prototype.isSelectable = function() {
2767
- return this.adapter.getAttribute(v.ROLE) === "option";
2768
- }, e.prototype.actionType = function() {
2769
- return E.PRIMARY;
2770
- }, e.prototype.shouldEmitInteractionOnRemoveKey = function() {
2771
- return this.adapter.getAttribute(v.DATA_DELETABLE) === "true";
2772
- }, e;
2773
- }(he)
2774
- );
2775
- /**
2776
- * @license
2777
- * Copyright 2020 Google Inc.
2778
- *
2779
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2780
- * of this software and associated documentation files (the "Software"), to deal
2781
- * in the Software without restriction, including without limitation the rights
2782
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2783
- * copies of the Software, and to permit persons to whom the Software is
2784
- * furnished to do so, subject to the following conditions:
2785
- *
2786
- * The above copyright notice and this permission notice shall be included in
2787
- * all copies or substantial portions of the Software.
2788
- *
2789
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2790
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2791
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2792
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2793
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2794
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2795
- * THE SOFTWARE.
2796
- */
2797
- var Zi = (
2798
- /** @class */
2799
- function(i) {
2800
- U(e, i);
2801
- function e() {
2802
- return i !== null && i.apply(this, arguments) || this;
2803
- }
2804
- return e.prototype.isSelectable = function() {
2805
- return !1;
2806
- }, e.prototype.actionType = function() {
2807
- return E.TRAILING;
2808
- }, e.prototype.shouldEmitInteractionOnRemoveKey = function() {
2809
- return !0;
2810
- }, e;
2811
- }(he)
2812
- );
2813
- /**
2814
- * @license
2815
- * Copyright 2020 Google Inc.
2816
- *
2817
- * Permission is hereby granted, free of charge, to any person obtaining a copy
2818
- * of this software and associated documentation files (the "Software"), to deal
2819
- * in the Software without restriction, including without limitation the rights
2820
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2821
- * copies of the Software, and to permit persons to whom the Software is
2822
- * furnished to do so, subject to the following conditions:
2823
- *
2824
- * The above copyright notice and this permission notice shall be included in
2825
- * all copies or substantial portions of the Software.
2826
- *
2827
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2828
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2829
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2830
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2831
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2832
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2833
- * THE SOFTWARE.
2834
- */
2835
- var Ji = [
2836
- F.safeAttrPrefix(Ft || (Ft = H(["aria-"], ["aria-"]))),
2837
- F.safeAttrPrefix(Ut || (Ut = H(["data-"], ["data-"]))),
2838
- F.safeAttrPrefix(Mt || (Mt = H(["disabled"], ["disabled"]))),
2839
- F.safeAttrPrefix(zt || (zt = H(["role"], ["role"]))),
2840
- F.safeAttrPrefix(Ht || (Ht = H(["tabindex"], ["tabindex"])))
2841
- ], Qi = (
2842
- /** @class */
2843
- function(i) {
2844
- U(e, i);
2845
- function e() {
2846
- var t = i !== null && i.apply(this, arguments) || this;
2847
- return t.rootHTML = t.root, t;
2848
- }
2849
- return e.attachTo = function(t) {
2850
- return new e(t);
2851
- }, Object.defineProperty(e.prototype, "ripple", {
2852
- get: function() {
2853
- return this.rippleInstance;
2854
- },
2855
- enumerable: !1,
2856
- configurable: !0
2857
- }), e.prototype.initialize = function(t) {
2858
- var n = this;
2859
- t === void 0 && (t = function(o, a) {
2860
- return new Lt(o, a);
2861
- });
2862
- var r = T(T({}, Lt.createAdapter(this)), { computeBoundingRect: function() {
2863
- return n.computeRippleClientRect();
2864
- } });
2865
- this.rippleInstance = t(this.root, new ue(r));
2866
- }, e.prototype.initialSyncWithDOM = function() {
2867
- var t = this;
2868
- this.handleClick = function() {
2869
- t.foundation.handleClick();
2870
- }, this.handleKeydown = function(n) {
2871
- t.foundation.handleKeydown(n);
2872
- }, this.listen("click", this.handleClick), this.listen("keydown", this.handleKeydown);
2873
- }, e.prototype.destroy = function() {
2874
- this.ripple.destroy(), this.unlisten("click", this.handleClick), this.unlisten("keydown", this.handleKeydown), i.prototype.destroy.call(this);
2875
- }, e.prototype.getDefaultFoundation = function() {
2876
- var t = this, n = {
2877
- emitEvent: function(r, o) {
2878
- t.emit(
2879
- r,
2880
- o,
2881
- !0
2882
- /* shouldBubble */
2883
- );
2884
- },
2885
- focus: function() {
2886
- t.rootHTML.focus();
2887
- },
2888
- getAttribute: function(r) {
2889
- return t.root.getAttribute(r);
2890
- },
2891
- getElementID: function() {
2892
- return t.root.id;
2893
- },
2894
- removeAttribute: function(r) {
2895
- t.root.removeAttribute(r);
2896
- },
2897
- setAttribute: function(r, o) {
2898
- re(Ji, t.root, r, o);
2899
- }
2900
- };
2901
- return this.root.classList.contains(Q.TRAILING_ACTION) ? new Zi(n) : new Yi(n);
2902
- }, e.prototype.setDisabled = function(t) {
2903
- this.foundation.setDisabled(t);
2904
- }, e.prototype.isDisabled = function() {
2905
- return this.foundation.isDisabled();
2906
- }, e.prototype.setFocus = function(t) {
2907
- this.foundation.setFocus(t);
2908
- }, e.prototype.isFocusable = function() {
2909
- return this.foundation.isFocusable();
2910
- }, e.prototype.setSelected = function(t) {
2911
- this.foundation.setSelected(t);
2912
- }, e.prototype.isSelected = function() {
2913
- return this.foundation.isSelected();
2914
- }, e.prototype.isSelectable = function() {
2915
- return this.foundation.isSelectable();
2916
- }, e.prototype.actionType = function() {
2917
- return this.foundation.actionType();
2918
- }, e.prototype.computeRippleClientRect = function() {
2919
- if (this.root.classList.contains(Q.PRIMARY_ACTION)) {
2920
- var t = Gi(this.root, "." + Q.CHIP_ROOT);
2921
- if (!t)
2922
- return this.root.getBoundingClientRect();
2923
- var n = window.getComputedStyle(t).getPropertyValue(Xi);
2924
- return qi(t.getBoundingClientRect(), n);
2925
- }
2926
- return this.root.getBoundingClientRect();
2927
- }, e;
2928
- }(pe)
2929
- ), Ft, Ut, Mt, zt, Ht, tn = Object.defineProperty, en = Object.getOwnPropertyDescriptor, M = (i, e, t, n) => {
2930
- for (var r = n > 1 ? void 0 : n ? en(e, t) : e, o = i.length - 1, a; o >= 0; o--)
2931
- (a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
2932
- return n && r && tn(e, t, r), r;
2933
- };
2934
- let nn = 0;
2935
- class L extends Bt {
2936
- constructor() {
2937
- super(), this.mdcFoundationClass = ki, this.label = "", this.icon = "", this.trailingIcon = !1, this.avatar = !1, this.disabled = !1, this.filter = !1, this.chipId = nn++;
2938
- }
2939
- render() {
2940
- const e = {
2941
- "mdc-evolution-chip": !0,
2942
- "mdc-evolution-chip--disabled": this.disabled,
2943
- "mdc-evolution-chip--with-trailing-action": this.trailingIcon,
2944
- "mdc-evolution-chip--with-primary-graphic": !this.trailingIcon && this.icon,
2945
- "mdc-evolution-chip--with-primary-icon": this.icon && !this.filter,
2946
- "mdc-evolution-chip--filter": this.filter,
2947
- "mdc-evolution-chip--selectable": this.filter,
2948
- "mdc-evolution-chip--with-avatar": this.avatar,
2949
- secondary: this.state === "secondary",
2950
- negative: this.state === "negative",
2951
- caution: this.state === "caution"
2952
- };
2953
- return $`
2954
- <span
2955
- class="${ye(e)}"
2956
- role="${this.filter ? "presentation" : "row"}"
2957
- id="cv-chip-${this.chipId}"
2958
- >
2959
- <span
2960
- class="mdc-evolution-chip__cell mdc-evolution-chip__cell--primary"
2961
- role="${this.filter ? "presentation" : "gridcell"}"
2962
- >
2963
- <button
2964
- class="mdc-evolution-chip__action mdc-evolution-chip__action--primary"
2965
- role="${this.filter ? "option" : ""}"
2966
- type="button"
2967
- tabindex="-1"
2968
- >
2969
- <span
2970
- class="mdc-evolution-chip__ripple mdc-evolution-chip__ripple--primary"
2971
- ></span>
2972
- ${!this.trailingIcon && this.icon || this.filter ? this.renderGraphic() : ""}
2973
- <span class="mdc-evolution-chip__text-label">${this.label}</span>
2974
- </button>
2975
- </span>
2976
- ${this.trailingIcon ? this.renderTrailing() : ""}
2977
- </span>
2978
- `;
2979
- }
2980
- async firstUpdated() {
2981
- this.mdcFoundation !== void 0 && this.mdcFoundation.destroy(), this.mdcFoundation = new this.mdcFoundationClass(this.createAdapter()), this.actions = /* @__PURE__ */ new Map();
2982
- const e = this.mdcRoot.querySelectorAll(
2983
- ".mdc-evolution-chip__action"
2984
- );
2985
- for (let t = 0; t < e.length; t++) {
2986
- const n = new Qi(e[t]);
2987
- this.actions.set(n.actionType(), n), e[t].addEventListener(
2988
- X.INTERACTION,
2989
- (r) => {
2990
- var o;
2991
- (o = this.mdcFoundation) == null || o.handleActionInteraction(r);
2992
- }
2993
- ), e[t].addEventListener(X.NAVIGATION, (r) => {
2994
- var o;
2995
- (o = this.mdcFoundation) == null || o.handleActionNavigation(r);
2996
- });
2997
- }
2998
- }
2999
- renderGraphic() {
3000
- const e = this.filter ? this.renderCheckMark() : this.renderIcon();
3001
- return $`<span class="mdc-evolution-chip__graphic">
3002
- ${e}
3003
- </span>`;
3004
- }
3005
- renderCheckMark() {
3006
- return $` <span class="mdc-evolution-chip__checkmark">
3007
- <svg class="mdc-evolution-chip__checkmark-svg" viewBox="-2 -3 30 30">
3008
- <path
3009
- class="mdc-evolution-chip__checkmark-path"
3010
- fill="none"
3011
- d="M1.73,12.91 8.1,19.28 22.79,4.59"
3012
- />
3013
- </svg>
3014
- </span>`;
3015
- }
3016
- renderIcon(e = !1) {
3017
- return $` <span
3018
- class="mdc-evolution-chip__icon mdc-evolution-chip__icon--${e ? "trailing" : "primary"}"
3019
- >
3020
- ${this.icon}
3021
- </span>`;
3022
- }
3023
- renderTrailing() {
3024
- return $` <span
3025
- class="mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing"
3026
- role="gridcell"
3027
- >
3028
- <button
3029
- class="mdc-evolution-chip__action mdc-evolution-chip__action--trailing"
3030
- type="button"
3031
- tabindex="-1"
3032
- data-mdc-deletable="true"
3033
- aria-label="Remove ${this.label}"
3034
- >
3035
- <span
3036
- class="mdc-evolution-chip__ripple mdc-evolution-chip__ripple--trailing"
3037
- ></span>
3038
- ${this.renderIcon(!0)}
3039
- </button>
3040
- </span>`;
3041
- }
3042
- createAdapter() {
3043
- return {
3044
- ...ve(this.mdcRoot),
3045
- emitEvent: (e, t) => this.dispatchEvent(
3046
- new CustomEvent(e, { bubbles: !0, detail: t })
3047
- ),
3048
- /** Returns the child actions provided by the chip. */
3049
- getActions: () => {
3050
- const e = [];
3051
- for (const [t] of this.actions)
3052
- e.push(t);
3053
- return e;
3054
- },
3055
- /** Returns the value for the given attribute, if it exists. */
3056
- getAttribute: (e) => this.mdcRoot.getAttribute(e),
3057
- /** Returns the ID of the root element. */
3058
- getElementID: () => this.mdcRoot.getAttribute("id") ?? "",
3059
- /** Returns the offset width of the root element. */
3060
- getOffsetWidth: () => this.mdcRoot.offsetWidth,
3061
- /** Returns true if the root element has the given class. */
3062
- hasClass: (e) => this.mdcRoot.classList.contains(e),
3063
- /** Proxies to the MDCChipAction#isSelectable method. */
3064
- isActionSelectable: (e) => {
3065
- var t;
3066
- return ((t = this.actions.get(e)) == null ? void 0 : t.isSelectable()) ?? !0;
3067
- },
3068
- /** Proxies to the MDCChipAction#isSelected method. */
3069
- isActionSelected: (e) => {
3070
- var t;
3071
- return ((t = this.actions.get(e)) == null ? void 0 : t.isSelected()) ?? !1;
3072
- },
3073
- /** Proxies to the MDCChipAction#isFocusable method. */
3074
- isActionFocusable: (e) => {
3075
- var t;
3076
- return ((t = this.actions.get(e)) == null ? void 0 : t.isFocusable()) ?? !0;
3077
- },
3078
- /** Proxies to the MDCChipAction#isDisabled method. */
3079
- isActionDisabled: (e) => {
3080
- var t;
3081
- return ((t = this.actions.get(e)) == null ? void 0 : t.isDisabled()) ?? !1;
3082
- },
3083
- /** Returns true if the text direction is right-to-left. */
3084
- isRTL: () => window.getComputedStyle(this.mdcRoot).getPropertyValue("direction") === "rtl",
3085
- /** Proxies to the MDCChipAction#setDisabled method. */
3086
- setActionDisabled: (e, t) => {
3087
- var n;
3088
- return (n = this.actions.get(e)) == null ? void 0 : n.setDisabled(t);
3089
- },
3090
- /** Proxies to the MDCChipAction#setFocus method. */
3091
- setActionFocus: (e, t) => {
3092
- var n;
3093
- return (n = this.actions.get(e)) == null ? void 0 : n.setFocus(t);
3094
- },
3095
- /** Proxies to the MDCChipAction#setSelected method. */
3096
- setActionSelected: (e, t) => {
3097
- var n;
3098
- return (n = this.actions.get(e)) == null ? void 0 : n.setSelected(t);
3099
- },
3100
- /** Sets the style property to the given value. */
3101
- setStyleProperty: (e, t) => this.mdcRoot.style.setProperty(e, t)
3102
- };
3103
- }
3104
- getActions() {
3105
- var e;
3106
- return ((e = this.mdcFoundation) == null ? void 0 : e.getActions()) ?? [];
3107
- }
3108
- getElementID() {
3109
- var e;
3110
- return ((e = this.mdcFoundation) == null ? void 0 : e.getElementID()) ?? "";
3111
- }
3112
- isActionFocusable(e) {
3113
- var t;
3114
- return ((t = this.mdcFoundation) == null ? void 0 : t.isActionFocusable(e)) ?? !1;
3115
- }
3116
- isActionSelectable(e) {
3117
- var t;
3118
- return ((t = this.mdcFoundation) == null ? void 0 : t.isActionSelectable(e)) ?? !1;
3119
- }
3120
- isActionSelected(e) {
3121
- var t;
3122
- return ((t = this.mdcFoundation) == null ? void 0 : t.isActionSelected(e)) ?? !1;
3123
- }
3124
- setActionFocus(e, t) {
3125
- var n;
3126
- return (n = this.mdcFoundation) == null ? void 0 : n.setActionFocus(e, t);
3127
- }
3128
- setActionSelected(e, t) {
3129
- var n;
3130
- return (n = this.mdcFoundation) == null ? void 0 : n.setActionSelected(e, t);
3131
- }
3132
- startAnimation(e) {
3133
- var t;
3134
- return (t = this.mdcFoundation) == null ? void 0 : t.startAnimation(e);
3135
- }
3136
- }
3137
- M([
3138
- $t(".mdc-evolution-chip")
3139
- ], L.prototype, "mdcRoot", 2);
3140
- M([
3141
- R()
3142
- ], L.prototype, "label", 2);
3143
- M([
3144
- R({ type: String })
3145
- ], L.prototype, "icon", 2);
3146
- M([
3147
- R({ type: Boolean, reflect: !0 })
3148
- ], L.prototype, "trailingIcon", 2);
3149
- M([
3150
- R({ type: Boolean, reflect: !0 })
3151
- ], L.prototype, "avatar", 2);
3152
- M([
3153
- R({ type: Boolean, reflect: !0 })
3154
- ], L.prototype, "disabled", 2);
3155
- M([
3156
- R({ type: Boolean, reflect: !0 })
3157
- ], L.prototype, "filter", 2);
3158
- M([
3159
- R()
3160
- ], L.prototype, "state", 2);
3161
- const rn = `.mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}.mdc-evolution-chip__action--primary{overflow-x:hidden}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mdc-evolution-chip__action--primary:before{box-sizing:border-box;content:"";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1}.mdc-evolution-chip--touch{margin-top:8px;margin-bottom:8px}.mdc-evolution-chip__action-touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}.mdc-evolution-chip__text-label{white-space:nowrap;-webkit-user-select:none;user-select:none;text-overflow:ellipsis;overflow:hidden}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mdc-evolution-chip__checkmark-background{opacity:0}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width .15s 0ms cubic-bezier(.4,0,.2,1)}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform .15s 0ms cubic-bezier(.4,0,.2,1);transform:translate(-75%,-50%)}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset .15s 45ms cubic-bezier(.4,0,.2,1)}.mdc-evolution-chip--deselecting .mdc-evolution-chip__graphic{transition:width .1s 0ms cubic-bezier(.4,0,.2,1)}.mdc-evolution-chip--deselecting .mdc-evolution-chip__checkmark{transition:opacity 50ms 0ms linear,transform .1s 0ms cubic-bezier(.4,0,.2,1);transform:translate(-75%,-50%)}.mdc-evolution-chip--deselecting .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}.mdc-evolution-chip--selecting-with-primary-icon .mdc-evolution-chip__icon--primary{transition:opacity 75ms 0ms cubic-bezier(.4,0,.2,1)}.mdc-evolution-chip--selecting-with-primary-icon .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset .15s 75ms cubic-bezier(.4,0,.2,1)}.mdc-evolution-chip--deselecting-with-primary-icon .mdc-evolution-chip__icon--primary{transition:opacity .15s 75ms cubic-bezier(.4,0,.2,1)}.mdc-evolution-chip--deselecting-with-primary-icon .mdc-evolution-chip__checkmark{transition:opacity 75ms 0ms cubic-bezier(.4,0,.2,1);transform:translate(-50%,-50%)}.mdc-evolution-chip--deselecting-with-primary-icon .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%,-50%);opacity:1}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@keyframes mdc-evolution-chip-enter{0%{transform:scale(.8);opacity:.4}to{transform:scale(1);opacity:1}}.mdc-evolution-chip--enter{animation:mdc-evolution-chip-enter .1s 0ms cubic-bezier(0,0,.2,1)}@keyframes mdc-evolution-chip-exit{0%{opacity:1}to{opacity:0}}.mdc-evolution-chip--exit{animation:mdc-evolution-chip-exit 75ms 0ms cubic-bezier(.4,0,1,1)}.mdc-evolution-chip--hidden{opacity:0;pointer-events:none;transition:width .15s 0ms cubic-bezier(.4,0,1,1)}.mdc-evolution-chip{height:32px;border-radius:16px;background-color:#e0e0e0}.mdc-evolution-chip .mdc-evolution-chip__ripple{border-radius:16px}.mdc-evolution-chip .mdc-evolution-chip__action--primary:before{border-radius:16px}.mdc-evolution-chip .mdc-evolution-chip__icon--primary{border-radius:16px}.mdc-evolution-chip .mdc-evolution-chip__action--primary,[dir=rtl] .mdc-evolution-chip .mdc-evolution-chip__action--primary,.mdc-evolution-chip .mdc-evolution-chip__action--primary[dir=rtl]{padding-left:12px;padding-right:12px}.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic,[dir=rtl] .mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic,.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic[dir=rtl]{padding-left:6px;padding-right:6px}.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary,.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary[dir=rtl]{padding-left:12px;padding-right:0}.mdc-evolution-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing,[dir=rtl] .mdc-evolution-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing,.mdc-evolution-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing[dir=rtl]{padding-left:8px;padding-right:8px}.mdc-evolution-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__ripple--trailing{left:8px;right:initial}[dir=rtl] .mdc-evolution-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__ripple--trailing,.mdc-evolution-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__ripple--trailing[dir=rtl]{left:initial;right:8px}.mdc-evolution-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mdc-evolution-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary,.mdc-evolution-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary[dir=rtl]{padding-left:0;padding-right:12px}.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic,[dir=rtl] .mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic,.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic[dir=rtl]{padding-left:6px;padding-right:6px}.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing,[dir=rtl] .mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing,.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing[dir=rtl]{padding-left:8px;padding-right:8px}.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__ripple--trailing{left:8px;right:initial}[dir=rtl] .mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__ripple--trailing,.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__ripple--trailing[dir=rtl]{left:initial;right:8px}.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary,[dir=rtl] .mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary,.mdc-evolution-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary[dir=rtl]{padding-left:0;padding-right:0}.mdc-evolution-chip .mdc-evolution-chip__text-label,.mdc-evolution-chip .mdc-evolution-chip__icon--primary,.mdc-evolution-chip .mdc-evolution-chip__checkmark,.mdc-evolution-chip .mdc-evolution-chip__icon--trailing{color:#000000de}.mdc-evolution-chip .mdc-evolution-chip__text-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit)}.mdc-evolution-chip.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--with-primary-icon){--mdc-chip-graphic-selected-width: 20px}.mdc-evolution-chip .mdc-evolution-chip__graphic,.mdc-evolution-chip .mdc-evolution-chip__icon--primary{height:20px;width:20px;font-size:20px}.mdc-evolution-chip .mdc-evolution-chip__checkmark{height:20px;width:20px}.mdc-evolution-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-evolution-chip.mdc-evolution-chip .mdc-evolution-chip__action--primary:before{border-color:CanvasText}.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary:before{border-color:GrayText}.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary:before{border-color:CanvasText}.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary:before{border-color:GrayText}.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary,.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark,.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:GrayText}.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--disabled,.mdc-evolution-chip.mdc-evolution-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:Canvas}}.mdc-evolution-chip .mdc-evolution-chip__focus-ring{display:none}.mdc-evolution-chip .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational).mdc-ripple-upgraded--background-focused .mdc-evolution-chip__focus-ring,.mdc-evolution-chip .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__focus-ring{z-index:1;display:block;pointer-events:none;border:2px solid transparent;border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-evolution-chip .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational).mdc-ripple-upgraded--background-focused .mdc-evolution-chip__focus-ring,.mdc-evolution-chip .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__focus-ring{border-color:CanvasText}}.mdc-evolution-chip .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational).mdc-ripple-upgraded--background-focused .mdc-evolution-chip__focus-ring:after,.mdc-evolution-chip .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__focus-ring:after{content:"";border:2px solid transparent;border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-evolution-chip .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational).mdc-ripple-upgraded--background-focused .mdc-evolution-chip__focus-ring:after,.mdc-evolution-chip .mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__focus-ring:after{border-color:CanvasText}}.mdc-evolution-chip .mdc-evolution-chip__action--trailing:not(.mdc-evolution-chip__action--presentational).mdc-ripple-upgraded--background-focused .mdc-evolution-chip__focus-ring,.mdc-evolution-chip .mdc-evolution-chip__action--trailing:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__focus-ring{z-index:1;display:block;pointer-events:none;border:2px solid transparent;border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:calc(100% + 4px);width:calc(100% - 4px)}@media screen and (forced-colors: active){.mdc-evolution-chip .mdc-evolution-chip__action--trailing:not(.mdc-evolution-chip__action--presentational).mdc-ripple-upgraded--background-focused .mdc-evolution-chip__focus-ring,.mdc-evolution-chip .mdc-evolution-chip__action--trailing:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__focus-ring{border-color:CanvasText}}.mdc-evolution-chip .mdc-evolution-chip__action--trailing:not(.mdc-evolution-chip__action--presentational).mdc-ripple-upgraded--background-focused .mdc-evolution-chip__focus-ring:after,.mdc-evolution-chip .mdc-evolution-chip__action--trailing:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__focus-ring:after{content:"";border:2px solid transparent;border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-evolution-chip .mdc-evolution-chip__action--trailing:not(.mdc-evolution-chip__action--presentational).mdc-ripple-upgraded--background-focused .mdc-evolution-chip__focus-ring:after,.mdc-evolution-chip .mdc-evolution-chip__action--trailing:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__focus-ring:after{border-color:CanvasText}}.mdc-evolution-chip--filter.mdc-evolution-chip--selected{background-color:#cecece}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic,.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic[dir=rtl]{padding-left:8px;padding-right:4px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary,.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary[dir=rtl]{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic,.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic[dir=rtl]{padding-left:8px;padding-right:4px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing,[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing,.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing[dir=rtl]{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__ripple--trailing{left:8px;right:initial}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__ripple--trailing,.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__ripple--trailing[dir=rtl]{left:initial;right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary,[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary,.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary[dir=rtl]{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--with-primary-icon){--mdc-chip-graphic-selected-width: 24px}.mdc-evolution-chip--with-avatar .mdc-evolution-chip__graphic,.mdc-evolution-chip--with-avatar .mdc-evolution-chip__icon--primary{height:24px;width:24px;font-size:24px}.mdc-evolution-chip__action--primary .mdc-evolution-chip__ripple:before,.mdc-evolution-chip__action--primary .mdc-evolution-chip__ripple:after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-evolution-chip__action--primary:hover .mdc-evolution-chip__ripple:before,.mdc-evolution-chip__action--primary.mdc-ripple-surface--hover .mdc-evolution-chip__ripple:before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-evolution-chip__action--primary.mdc-ripple-upgraded--background-focused .mdc-evolution-chip__ripple:before,.mdc-evolution-chip__action--primary:not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__ripple:before{transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-evolution-chip__action--primary:not(.mdc-ripple-upgraded) .mdc-evolution-chip__ripple:after{transition:opacity .15s linear}.mdc-evolution-chip__action--primary:not(.mdc-ripple-upgraded):active .mdc-evolution-chip__ripple:after{transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-evolution-chip__action--primary.mdc-ripple-upgraded{--mdc-ripple-fg-opacity: var(--mdc-ripple-press-opacity, .12)}.mdc-evolution-chip__action--trailing .mdc-evolution-chip__ripple:before,.mdc-evolution-chip__action--trailing .mdc-evolution-chip__ripple:after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-evolution-chip__action--trailing:hover .mdc-evolution-chip__ripple:before,.mdc-evolution-chip__action--trailing.mdc-ripple-surface--hover .mdc-evolution-chip__ripple:before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-evolution-chip__action--trailing.mdc-ripple-upgraded--background-focused .mdc-evolution-chip__ripple:before,.mdc-evolution-chip__action--trailing:not(.mdc-ripple-upgraded):focus .mdc-evolution-chip__ripple:before{transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-evolution-chip__action--trailing:not(.mdc-ripple-upgraded) .mdc-evolution-chip__ripple:after{transition:opacity .15s linear}.mdc-evolution-chip__action--trailing:not(.mdc-ripple-upgraded):active .mdc-evolution-chip__ripple:after{transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-evolution-chip__action--trailing.mdc-ripple-upgraded{--mdc-ripple-fg-opacity: var(--mdc-ripple-press-opacity, .12)}.mdc-evolution-chip__ripple--trailing{height:18px;width:18px}.mdc-evolution-chip__action{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mdc-evolution-chip__action .mdc-evolution-chip__ripple:before,.mdc-evolution-chip__action .mdc-evolution-chip__ripple:after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-evolution-chip__action .mdc-evolution-chip__ripple:before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-evolution-chip__action .mdc-evolution-chip__ripple:after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-evolution-chip__action.mdc-ripple-upgraded .mdc-evolution-chip__ripple:before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-evolution-chip__action.mdc-ripple-upgraded .mdc-evolution-chip__ripple:after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-evolution-chip__action.mdc-ripple-upgraded--unbounded .mdc-evolution-chip__ripple:after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-evolution-chip__action.mdc-ripple-upgraded--foreground-activation .mdc-evolution-chip__ripple:after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-evolution-chip__action.mdc-ripple-upgraded--foreground-deactivation .mdc-evolution-chip__ripple:after{animation:mdc-ripple-fg-opacity-out .15s;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-evolution-chip__action .mdc-evolution-chip__ripple:before,.mdc-evolution-chip__action .mdc-evolution-chip__ripple:after{top:-50%;left:-50%;width:200%;height:200%}.mdc-evolution-chip__action.mdc-ripple-upgraded .mdc-evolution-chip__ripple:after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-evolution-chip__ripple{position:absolute;box-sizing:content-box;overflow:hidden;pointer-events:none}.mdc-evolution-chip__ripple--primary{height:100%;width:100%;top:0;left:0}.mdc-evolution-chip__ripple--trailing{top:50%;transform:translateY(-50%)}.mdc-evolution-chip{background-color:var(--mdc-theme-surface-neutral)}.mdc-evolution-chip .mdc-evolution-chip__text-label{color:var(--mdc-theme-text-primary-on-background)}.mdc-evolution-chip .mdc-evolution-chip__icon{font-family:var(--mdc-icon-font, "Material Symbols Rounded");color:var(--mdc-theme-text-icon-on-background)}.mdc-evolution-chip .mdc-evolution-chip__checkmark-path{stroke:var(--mdc-theme-text-icon-on-background)}.mdc-evolution-chip.mdc-evolution-chip--selected{background-color:var(--mdc-theme-surface-primary)}.mdc-evolution-chip.negative{background-color:var(--mdc-theme-surface-negative)}.mdc-evolution-chip.caution{background-color:var(--mdc-theme-surface-caution)}.mdc-evolution-chip.secondary{background-color:var(--mdc-theme-surface-secondary)}
3162
- `;
3163
- var on = Object.defineProperty, an = Object.getOwnPropertyDescriptor, cn = (i, e, t, n) => {
3164
- for (var r = n > 1 ? void 0 : n ? an(e, t) : e, o = i.length - 1, a; o >= 0; o--)
3165
- (a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
3166
- return n && r && on(e, t, r), r;
3167
- };
3168
- let lt = class extends L {
3169
- };
3170
- lt.styles = [
3171
- Gt`
3172
- ${Wt(rn)}
3173
- `
3174
- ];
3175
- lt = cn([
3176
- jt("cv-chip")
3177
- ], lt);
3178
- /**
3179
- * @license
3180
- * Copyright 2016 Google Inc.
3181
- *
3182
- * Permission is hereby granted, free of charge, to any person obtaining a copy
3183
- * of this software and associated documentation files (the "Software"), to deal
3184
- * in the Software without restriction, including without limitation the rights
3185
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3186
- * copies of the Software, and to permit persons to whom the Software is
3187
- * furnished to do so, subject to the following conditions:
3188
- *
3189
- * The above copyright notice and this permission notice shall be included in
3190
- * all copies or substantial portions of the Software.
3191
- *
3192
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3193
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3194
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3195
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3196
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3197
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3198
- * THE SOFTWARE.
3199
- */
3200
- var ut;
3201
- (function(i) {
3202
- i.ARIA_MULTISELECTABLE = "aria-multiselectable";
3203
- })(ut || (ut = {}));
3204
- var kt;
3205
- (function(i) {
3206
- i.CHIP = "mdc-evolution-chip";
3207
- })(kt || (kt = {}));
3208
- var K;
3209
- (function(i) {
3210
- i.INTERACTION = "MDCChipSet:interaction", i.REMOVAL = "MDCChipSet:removal", i.SELECTION = "MDCChipSet:selection";
3211
- })(K || (K = {}));
3212
- /**
3213
- * @license
3214
- * Copyright 2020 Google Inc.
3215
- *
3216
- * Permission is hereby granted, free of charge, to any person obtaining a copy
3217
- * of this software and associated documentation files (the "Software"), to deal
3218
- * in the Software without restriction, including without limitation the rights
3219
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3220
- * copies of the Software, and to permit persons to whom the Software is
3221
- * furnished to do so, subject to the following conditions:
3222
- *
3223
- * The above copyright notice and this permission notice shall be included in
3224
- * all copies or substantial portions of the Software.
3225
- *
3226
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3227
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3228
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3229
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3230
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3231
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3232
- * THE SOFTWARE.
3233
- */
3234
- var B;
3235
- (function(i) {
3236
- i[i.INCREMENT = 0] = "INCREMENT", i[i.DECREMENT = 1] = "DECREMENT";
3237
- })(B || (B = {}));
3238
- var sn = (
3239
- /** @class */
3240
- function(i) {
3241
- U(e, i);
3242
- function e(t) {
3243
- return i.call(this, T(T({}, e.defaultAdapter), t)) || this;
3244
- }
3245
- return Object.defineProperty(e, "defaultAdapter", {
3246
- get: function() {
3247
- return {
3248
- announceMessage: function() {
3249
- },
3250
- emitEvent: function() {
3251
- },
3252
- getAttribute: function() {
3253
- return null;
3254
- },
3255
- getChipActionsAtIndex: function() {
3256
- return [];
3257
- },
3258
- getChipCount: function() {
3259
- return 0;
3260
- },
3261
- getChipIdAtIndex: function() {
3262
- return "";
3263
- },
3264
- getChipIndexById: function() {
3265
- return 0;
3266
- },
3267
- isChipFocusableAtIndex: function() {
3268
- return !1;
3269
- },
3270
- isChipSelectableAtIndex: function() {
3271
- return !1;
3272
- },
3273
- isChipSelectedAtIndex: function() {
3274
- return !1;
3275
- },
3276
- removeChipAtIndex: function() {
3277
- },
3278
- setChipFocusAtIndex: function() {
3279
- },
3280
- setChipSelectedAtIndex: function() {
3281
- },
3282
- startChipAnimationAtIndex: function() {
3283
- }
3284
- };
3285
- },
3286
- enumerable: !1,
3287
- configurable: !0
3288
- }), e.prototype.handleChipAnimation = function(t) {
3289
- var n = t.detail, r = n.chipID, o = n.animation, a = n.isComplete, c = n.addedAnnouncement, s = n.removedAnnouncement, p = this.adapter.getChipIndexById(r);
3290
- if (o === w.EXIT && a) {
3291
- s && this.adapter.announceMessage(s), this.removeAfterAnimation(p, r);
3292
- return;
3293
- }
3294
- if (o === w.ENTER && a && c) {
3295
- this.adapter.announceMessage(c);
3296
- return;
3297
- }
3298
- }, e.prototype.handleChipInteraction = function(t) {
3299
- var n = t.detail, r = n.source, o = n.chipID, a = n.isSelectable, c = n.isSelected, s = n.shouldRemove, p = this.adapter.getChipIndexById(o);
3300
- if (s) {
3301
- this.removeChip(p);
3302
- return;
3303
- }
3304
- this.focusChip(p, r, C.FOCUSABLE), this.adapter.emitEvent(K.INTERACTION, {
3305
- chipIndex: p,
3306
- chipID: o
3307
- }), a && this.setSelection(p, r, !c);
3308
- }, e.prototype.handleChipNavigation = function(t) {
3309
- var n = t.detail, r = n.chipID, o = n.key, a = n.isRTL, c = n.source, s = this.adapter.getChipIndexById(r), p = o === l.ARROW_RIGHT && !a || o === l.ARROW_LEFT && a;
3310
- if (p) {
3311
- this.focusNextChipFrom(s + 1);
3312
- return;
3313
- }
3314
- var d = o === l.ARROW_LEFT && !a || o === l.ARROW_RIGHT && a;
3315
- if (d) {
3316
- this.focusPrevChipFrom(s - 1);
3317
- return;
3318
- }
3319
- if (o === l.ARROW_DOWN) {
3320
- this.focusNextChipFrom(s + 1, c);
3321
- return;
3322
- }
3323
- if (o === l.ARROW_UP) {
3324
- this.focusPrevChipFrom(s - 1, c);
3325
- return;
3326
- }
3327
- if (o === l.HOME) {
3328
- this.focusNextChipFrom(0, c);
3329
- return;
3330
- }
3331
- if (o === l.END) {
3332
- this.focusPrevChipFrom(this.adapter.getChipCount() - 1, c);
3333
- return;
3334
- }
3335
- }, e.prototype.getSelectedChipIndexes = function() {
3336
- for (var t, n, r = /* @__PURE__ */ new Set(), o = this.adapter.getChipCount(), a = 0; a < o; a++) {
3337
- var c = this.adapter.getChipActionsAtIndex(a);
3338
- try {
3339
- for (var s = (t = void 0, I(c)), p = s.next(); !p.done; p = s.next()) {
3340
- var d = p.value;
3341
- this.adapter.isChipSelectedAtIndex(a, d) && r.add(a);
3342
- }
3343
- } catch (h) {
3344
- t = { error: h };
3345
- } finally {
3346
- try {
3347
- p && !p.done && (n = s.return) && n.call(s);
3348
- } finally {
3349
- if (t)
3350
- throw t.error;
3351
- }
3352
- }
3353
- }
3354
- return r;
3355
- }, e.prototype.setChipSelected = function(t, n, r) {
3356
- this.adapter.isChipSelectableAtIndex(t, n) && this.setSelection(t, n, r);
3357
- }, e.prototype.isChipSelected = function(t, n) {
3358
- return this.adapter.isChipSelectedAtIndex(t, n);
3359
- }, e.prototype.removeChip = function(t) {
3360
- t >= this.adapter.getChipCount() || t < 0 || (this.adapter.startChipAnimationAtIndex(t, w.EXIT), this.adapter.emitEvent(K.REMOVAL, {
3361
- chipID: this.adapter.getChipIdAtIndex(t),
3362
- chipIndex: t,
3363
- isComplete: !1
3364
- }));
3365
- }, e.prototype.addChip = function(t) {
3366
- t >= this.adapter.getChipCount() || t < 0 || this.adapter.startChipAnimationAtIndex(t, w.ENTER);
3367
- }, e.prototype.focusNextChipFrom = function(t, n) {
3368
- for (var r = this.adapter.getChipCount(), o = t; o < r; o++) {
3369
- var a = this.getFocusableAction(o, B.INCREMENT, n);
3370
- if (a) {
3371
- this.focusChip(o, a, C.FOCUSABLE_AND_FOCUSED);
3372
- return;
3373
- }
3374
- }
3375
- }, e.prototype.focusPrevChipFrom = function(t, n) {
3376
- for (var r = t; r > -1; r--) {
3377
- var o = this.getFocusableAction(r, B.DECREMENT, n);
3378
- if (o) {
3379
- this.focusChip(r, o, C.FOCUSABLE_AND_FOCUSED);
3380
- return;
3381
- }
3382
- }
3383
- }, e.prototype.getFocusableAction = function(t, n, r) {
3384
- var o = this.adapter.getChipActionsAtIndex(t);
3385
- return n === B.DECREMENT && o.reverse(), r ? this.getMatchingFocusableAction(t, o, r) : this.getFirstFocusableAction(t, o);
3386
- }, e.prototype.getFirstFocusableAction = function(t, n) {
3387
- var r, o;
3388
- try {
3389
- for (var a = I(n), c = a.next(); !c.done; c = a.next()) {
3390
- var s = c.value;
3391
- if (this.adapter.isChipFocusableAtIndex(t, s))
3392
- return s;
3393
- }
3394
- } catch (p) {
3395
- r = { error: p };
3396
- } finally {
3397
- try {
3398
- c && !c.done && (o = a.return) && o.call(a);
3399
- } finally {
3400
- if (r)
3401
- throw r.error;
3402
- }
3403
- }
3404
- return null;
3405
- }, e.prototype.getMatchingFocusableAction = function(t, n, r) {
3406
- var o, a, c = null;
3407
- try {
3408
- for (var s = I(n), p = s.next(); !p.done; p = s.next()) {
3409
- var d = p.value;
3410
- if (this.adapter.isChipFocusableAtIndex(t, d) && (c = d), c === r)
3411
- return c;
3412
- }
3413
- } catch (h) {
3414
- o = { error: h };
3415
- } finally {
3416
- try {
3417
- p && !p.done && (a = s.return) && a.call(s);
3418
- } finally {
3419
- if (o)
3420
- throw o.error;
3421
- }
3422
- }
3423
- return c;
3424
- }, e.prototype.focusChip = function(t, n, r) {
3425
- var o, a;
3426
- this.adapter.setChipFocusAtIndex(t, n, r);
3427
- for (var c = this.adapter.getChipCount(), s = 0; s < c; s++) {
3428
- var p = this.adapter.getChipActionsAtIndex(s);
3429
- try {
3430
- for (var d = (o = void 0, I(p)), h = d.next(); !h.done; h = d.next()) {
3431
- var b = h.value;
3432
- b === n && s === t || this.adapter.setChipFocusAtIndex(s, b, C.NOT_FOCUSABLE);
3433
- }
3434
- } catch (N) {
3435
- o = { error: N };
3436
- } finally {
3437
- try {
3438
- h && !h.done && (a = d.return) && a.call(d);
3439
- } finally {
3440
- if (o)
3441
- throw o.error;
3442
- }
3443
- }
3444
- }
3445
- }, e.prototype.supportsMultiSelect = function() {
3446
- return this.adapter.getAttribute(ut.ARIA_MULTISELECTABLE) === "true";
3447
- }, e.prototype.setSelection = function(t, n, r) {
3448
- var o, a;
3449
- if (this.adapter.setChipSelectedAtIndex(t, n, r), this.adapter.emitEvent(K.SELECTION, {
3450
- chipID: this.adapter.getChipIdAtIndex(t),
3451
- chipIndex: t,
3452
- isSelected: r
3453
- }), !this.supportsMultiSelect())
3454
- for (var c = this.adapter.getChipCount(), s = 0; s < c; s++) {
3455
- var p = this.adapter.getChipActionsAtIndex(s);
3456
- try {
3457
- for (var d = (o = void 0, I(p)), h = d.next(); !h.done; h = d.next()) {
3458
- var b = h.value;
3459
- b === n && s === t || this.adapter.setChipSelectedAtIndex(s, b, !1);
3460
- }
3461
- } catch (N) {
3462
- o = { error: N };
3463
- } finally {
3464
- try {
3465
- h && !h.done && (a = d.return) && a.call(d);
3466
- } finally {
3467
- if (o)
3468
- throw o.error;
3469
- }
3470
- }
3471
- }
3472
- }, e.prototype.removeAfterAnimation = function(t, n) {
3473
- this.adapter.removeChipAtIndex(t), this.adapter.emitEvent(K.REMOVAL, {
3474
- chipIndex: t,
3475
- isComplete: !0,
3476
- chipID: n
3477
- });
3478
- var r = this.adapter.getChipCount();
3479
- r <= 0 || this.focusNearestFocusableAction(t);
3480
- }, e.prototype.focusNearestFocusableAction = function(t) {
3481
- for (var n = this.adapter.getChipCount(), r = t, o = t; r > -1 || o < n; ) {
3482
- var a = this.getNearestFocusableAction(r, o, E.TRAILING);
3483
- if (a) {
3484
- this.focusChip(a.index, a.action, C.FOCUSABLE_AND_FOCUSED);
3485
- return;
3486
- }
3487
- r--, o++;
3488
- }
3489
- }, e.prototype.getNearestFocusableAction = function(t, n, r) {
3490
- var o = this.getFocusableAction(t, B.DECREMENT, r);
3491
- if (o)
3492
- return {
3493
- index: t,
3494
- action: o
3495
- };
3496
- if (n === t)
3497
- return null;
3498
- var a = this.getFocusableAction(n, B.INCREMENT, r);
3499
- return a ? {
3500
- index: n,
3501
- action: a
3502
- } : null;
3503
- }, e;
3504
- }(et)
3505
- );
3506
- /**
3507
- * @license
3508
- * Copyright 2020 Google Inc.
3509
- *
3510
- * Permission is hereby granted, free of charge, to any person obtaining a copy
3511
- * of this software and associated documentation files (the "Software"), to deal
3512
- * in the Software without restriction, including without limitation the rights
3513
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3514
- * copies of the Software, and to permit persons to whom the Software is
3515
- * furnished to do so, subject to the following conditions:
3516
- *
3517
- * The above copyright notice and this permission notice shall be included in
3518
- * all copies or substantial portions of the Software.
3519
- *
3520
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3521
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3522
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3523
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3524
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3525
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3526
- * THE SOFTWARE.
3527
- */
3528
- var ht;
3529
- (function(i) {
3530
- i.POLITE = "polite", i.ASSERTIVE = "assertive";
3531
- })(ht || (ht = {}));
3532
- var ln = "data-mdc-dom-announce";
3533
- function pn(i, e) {
3534
- dn.getInstance().say(i, e);
3535
- }
3536
- var dn = (
3537
- /** @class */
3538
- function() {
3539
- function i() {
3540
- this.liveRegions = /* @__PURE__ */ new Map();
3541
- }
3542
- return i.getInstance = function() {
3543
- return i.instance || (i.instance = new i()), i.instance;
3544
- }, i.prototype.say = function(e, t) {
3545
- var n, r, o = (n = t == null ? void 0 : t.priority) !== null && n !== void 0 ? n : ht.POLITE, a = (r = t == null ? void 0 : t.ownerDocument) !== null && r !== void 0 ? r : document, c = this.getLiveRegion(o, a);
3546
- c.textContent = "", setTimeout(function() {
3547
- c.textContent = e, a.addEventListener("click", s);
3548
- }, 1);
3549
- function s() {
3550
- c.textContent = "", a.removeEventListener("click", s);
3551
- }
3552
- }, i.prototype.getLiveRegion = function(e, t) {
3553
- var n = this.liveRegions.get(t);
3554
- n || (n = /* @__PURE__ */ new Map(), this.liveRegions.set(t, n));
3555
- var r = n.get(e);
3556
- if (r && t.body.contains(r))
3557
- return r;
3558
- var o = this.createLiveRegion(e, t);
3559
- return n.set(e, o), o;
3560
- }, i.prototype.createLiveRegion = function(e, t) {
3561
- var n = t.createElement("div");
3562
- return n.style.position = "absolute", n.style.top = "-9999px", n.style.left = "-9999px", n.style.height = "1px", n.style.overflow = "hidden", n.setAttribute("aria-atomic", "true"), n.setAttribute("aria-live", e), n.setAttribute(ln, "true"), t.body.appendChild(n), n;
3563
- }, i;
3564
- }()
3565
- ), un = Object.defineProperty, hn = Object.getOwnPropertyDescriptor, nt = (i, e, t, n) => {
3566
- for (var r = n > 1 ? void 0 : n ? hn(e, t) : e, o = i.length - 1, a; o >= 0; o--)
3567
- (a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
3568
- return n && r && un(e, t, r), r;
3569
- };
3570
- class J extends Bt {
3571
- constructor() {
3572
- super(...arguments), this.selectable = !1, this.multi = !1, this.label = "", this.activeIndex = 0, this._previousActiveIndex = -1, this.chips = [];
3573
- }
3574
- render() {
3575
- return $`<span
3576
- class="mdc-evolution-chip-set"
3577
- role="${this.selectable || this.multi ? "listbox" : "grid"}"
3578
- aria-label="${this.label}"
3579
- aria-multiselectable="${this.multi}"
3580
- >
3581
- <span class="mdc-evolution-chip-set__chips" role="presentation">
3582
- <slot></slot>
3583
- </span>
3584
- </span>`;
3585
- }
3586
- async updated(e) {
3587
- super.updated(e), await this.updateComplete, this.activeIndex != this._previousActiveIndex && this.mdcFoundation.setChipSelected(
3588
- this.activeIndex,
3589
- E.PRIMARY,
3590
- !0
3591
- );
3592
- }
3593
- firstUpdated(e) {
3594
- var r;
3595
- super.firstUpdated(e);
3596
- const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector("slot"), n = (t == null ? void 0 : t.assignedElements().filter((o) => o instanceof lt)) ?? [];
3597
- for (let o = 0; o < n.length; o++) {
3598
- const a = n[o];
3599
- this.chips.push(a);
3600
- }
3601
- this.mdcFoundation !== void 0 && this.mdcFoundation.destroy(), this.mdcFoundation = new sn(this.createAdapter()), this.mdcFoundation.init();
3602
- }
3603
- connectedCallback() {
3604
- super.connectedCallback(), this.addEventListener(S.ANIMATION, this._handleChipAnimation), this.addEventListener(
3605
- S.INTERACTION,
3606
- this._handleChipInteraction
3607
- ), this.addEventListener(S.NAVIGATION, this._handleChipNavigation);
3608
- }
3609
- disconnectedCallback() {
3610
- super.disconnectedCallback(), this.removeEventListener(
3611
- S.ANIMATION,
3612
- this._handleChipAnimation
3613
- ), this.removeEventListener(
3614
- S.INTERACTION,
3615
- this._handleChipInteraction
3616
- ), this.removeEventListener(
3617
- S.NAVIGATION,
3618
- this._handleChipNavigation
3619
- );
3620
- }
3621
- createAdapter() {
3622
- return {
3623
- /** Announces the message via an aria-live region */
3624
- announceMessage: pn,
3625
- /** Emits the given event with the given detail. */
3626
- emitEvent: (e, t) => this.dispatchEvent(
3627
- new CustomEvent(e, { bubbles: !0, detail: t })
3628
- ),
3629
- /** Returns the value for the given attribute, if it exists. */
3630
- getAttribute: (e) => this.mdcRoot.getAttribute(e),
3631
- /** Returns the actions provided by the child chip at the given index. */
3632
- getChipActionsAtIndex: (e) => this.chips[e].getActions(),
3633
- /** Returns the number of child chips. */
3634
- getChipCount: () => this.chips.length,
3635
- /** Returns the ID of the chip at the given index. */
3636
- getChipIdAtIndex: (e) => this.chips[e].getElementID(),
3637
- /** Returns the index of the child chip with the matching ID. */
3638
- getChipIndexById: (e) => this.chips.findIndex((t) => t.getElementID() === e),
3639
- /** Proxies to the MDCChip#isActionFocusable method. */
3640
- isChipFocusableAtIndex: (e, t) => this.chips[e].isActionFocusable(t),
3641
- /** Proxies to the MDCChip#isActionSelectable method. */
3642
- isChipSelectableAtIndex: (e, t) => this.chips[e].isActionSelectable(t),
3643
- /** Proxies to the MDCChip#isActionSelected method. */
3644
- isChipSelectedAtIndex: (e, t) => this.chips[e].isActionSelected(t),
3645
- /** Removes the chip at the given index. */
3646
- removeChipAtIndex: (e) => this.chips[e].remove(),
3647
- /** Proxies to the MDCChip#setActionFocus method. */
3648
- setChipFocusAtIndex: (e, t, n) => this.chips[e].setActionFocus(t, n),
3649
- /** Proxies to the MDCChip#setActionSelected method. */
3650
- setChipSelectedAtIndex: (e, t, n) => this.chips[e].setActionSelected(t, n),
3651
- /** Starts the chip animation at the given index. */
3652
- startChipAnimationAtIndex: (e, t) => this.chips[e].startAnimation(t)
3653
- };
3654
- }
3655
- _handleChipAnimation(e) {
3656
- this.mdcFoundation.handleChipAnimation(e);
3657
- }
3658
- _handleChipInteraction(e) {
3659
- this.mdcFoundation.handleChipInteraction(e);
3660
- }
3661
- _handleChipNavigation(e) {
3662
- this.mdcFoundation.handleChipNavigation(e);
3663
- }
3664
- }
3665
- nt([
3666
- $t(".mdc-evolution-chip-set")
3667
- ], J.prototype, "mdcRoot", 2);
3668
- nt([
3669
- R({ type: Boolean, reflect: !0 })
3670
- ], J.prototype, "selectable", 2);
3671
- nt([
3672
- R({ type: Boolean, reflect: !0 })
3673
- ], J.prototype, "multi", 2);
3674
- nt([
3675
- R()
3676
- ], J.prototype, "label", 2);
3677
- nt([
3678
- R({ type: Number })
3679
- ], J.prototype, "activeIndex", 2);
3680
- const mn = `.mdc-evolution-chip-set{display:flex}.mdc-evolution-chip-set:focus{outline:none}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mdc-evolution-chip-set--overflow .mdc-evolution-chip-set__chips{flex-flow:nowrap}.mdc-evolution-chip-set .mdc-evolution-chip-set__chips{margin-left:-8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip-set__chips,.mdc-evolution-chip-set .mdc-evolution-chip-set__chips[dir=rtl]{margin-left:0;margin-right:-8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-left:8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip,.mdc-evolution-chip-set .mdc-evolution-chip[dir=rtl]{margin-left:0;margin-right:8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-top:4px;margin-bottom:4px}::slotted(cv-chip){margin:4px 0 4px 8px}[dir=rtl] ::slotted(cv-chip),::slotted(cv-chip[dir=rtl]){margin-left:0;margin-right:8px}
3681
- `;
3682
- var fn = Object.defineProperty, vn = Object.getOwnPropertyDescriptor, gn = (i, e, t, n) => {
3683
- for (var r = n > 1 ? void 0 : n ? vn(e, t) : e, o = i.length - 1, a; o >= 0; o--)
3684
- (a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
3685
- return n && r && fn(e, t, r), r;
3686
- };
3687
- let mt = class extends J {
3688
- };
3689
- mt.styles = [
3690
- Gt`
3691
- ${Wt(mn)}
3692
- `
3693
- ];
3694
- mt = gn([
3695
- jt("cv-chip-set")
3696
- ], mt);
3697
82
  export {
3698
- nr as CovalentActionRibbon,
3699
- or as CovalentAlert,
3700
- cr as CovalentAppShell,
3701
- lr as CovalentButton,
3702
- hr as CovalentCard,
3703
- Fr as CovalentCheckListItem,
3704
- dr as CovalentCheckbox,
3705
- lt as CovalentChip,
3706
- mt as CovalentChipSet,
3707
- gr as CovalentCircularProgress,
3708
- fr as CovalentCodeSnippet,
3709
- yr as CovalentDialog,
3710
- br as CovalentDrawer,
3711
- Sr as CovalentEmptyState,
3712
- Cr as CovalentIcon,
3713
- Tr as CovalentIconButton,
3714
- Nr as CovalentIconCheckToggle,
3715
- Dr as CovalentIconRadioToggle,
3716
- Pr as CovalentLinearProgress,
3717
- Mr as CovalentList,
3718
- Hr as CovalentListItem,
3719
- $r as CovalentMenu,
3720
- Br as CovalentNavRailListItem,
3721
- Vr as CovalentRadio,
3722
- Wr as CovalentRadioListItem,
3723
- Xr as CovalentSelect,
3724
- Zr as CovalentSideSheet,
3725
- Qr as CovalentSlider,
3726
- eo as CovalentSliderRange,
3727
- no as CovalentSnackbar,
3728
- oo as CovalentStatusHeader,
3729
- co as CovalentStatusHeaderItem,
3730
- lo as CovalentSwitch,
3731
- uo as CovalentTab,
3732
- mo as CovalentTabBar,
3733
- vo as CovalentTextArea,
3734
- _o as CovalentTextField,
3735
- Ao as CovalentTextLockup,
3736
- Eo as CovalentToolbar,
3737
- wo as CovalentTooltip,
3738
- Io as CovalentTopAppBar,
3739
- Ro as CovalentTopAppBarFixed,
3740
- Oo as CovalentTreeList,
3741
- xo as CovalentTreeListItem,
3742
- Lo as CovalentTypography
83
+ j as CovalentActionRibbon,
84
+ z as CovalentAlert,
85
+ J as CovalentAppShell,
86
+ O as CovalentButton,
87
+ W as CovalentCard,
88
+ go as CovalentCheckListItem,
89
+ U as CovalentCheckbox,
90
+ Y as CovalentChip,
91
+ _ as CovalentChipSet,
92
+ oo as CovalentCircularProgress,
93
+ ro as CovalentCodeSnippet,
94
+ po as CovalentDialog,
95
+ ao as CovalentDrawer,
96
+ lo as CovalentEmptyState,
97
+ Co as CovalentIcon,
98
+ vo as CovalentIconButton,
99
+ so as CovalentIconCheckToggle,
100
+ To as CovalentIconRadioToggle,
101
+ ho as CovalentLinearProgress,
102
+ bo as CovalentList,
103
+ Ao as CovalentListItem,
104
+ Do as CovalentMenu,
105
+ ko as CovalentNavRailListItem,
106
+ Ho as CovalentRadio,
107
+ yo as CovalentRadioListItem,
108
+ Eo as CovalentSelect,
109
+ No as CovalentSideSheet,
110
+ qo as CovalentSlider,
111
+ Go as CovalentSliderRange,
112
+ Ko as CovalentSnackbar,
113
+ Qo as CovalentStatusHeader,
114
+ Vo as CovalentStatusHeaderItem,
115
+ Xo as CovalentSwitch,
116
+ Zo as CovalentTab,
117
+ $o as CovalentTabBar,
118
+ tt as CovalentTextArea,
119
+ et as CovalentTextField,
120
+ mt as CovalentTextLockup,
121
+ it as CovalentToolbar,
122
+ nt as CovalentTooltip,
123
+ xt as CovalentTopAppBar,
124
+ ft as CovalentTopAppBarFixed,
125
+ ct as CovalentTreeList,
126
+ St as CovalentTreeListItem,
127
+ ht as CovalentTypography
3743
128
  };