@vtex/ads-stories 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +14 -6
- package/dist/cdn/vtex-ads-stories.js +246 -19
- package/dist/cdn/vtex-ads-stories.js.map +1 -1
- package/dist/cjs/index.cjs +1952 -162
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +9 -7
- package/dist/cjs/react.d.cts +1 -0
- package/dist/esm/index.d.ts +9 -7
- package/dist/esm/index.js +504 -162
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react.d.ts +1 -0
- package/package.json +4 -1
- package/src/components/card/card.ts +95 -48
- package/src/components/card/index.ts +1 -1
- package/src/components/icons/assets/pause-fill.svg +1 -0
- package/src/components/icons/assets/speaker-high-fill.svg +1 -0
- package/src/components/icons/assets/speaker-x-fill.svg +1 -0
- package/src/components/icons/index.ts +36 -10
- package/src/components/media/index.ts +2 -0
- package/src/components/media/media.ts +66 -0
- package/src/components/media/video-controller.ts +78 -0
- package/src/components/player/index.ts +1 -1
- package/src/components/player/player.ts +253 -65
- package/src/story/story.ts +73 -68
- package/src/types.ts +5 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -26,6 +26,1320 @@ __export(index_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
|
|
29
|
+
// ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.6.0/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js
|
|
30
|
+
var ElementInternalsShim = class ElementInternals {
|
|
31
|
+
get shadowRoot() {
|
|
32
|
+
return this.__host.__shadowRoot;
|
|
33
|
+
}
|
|
34
|
+
constructor(_host) {
|
|
35
|
+
this.ariaActiveDescendantElement = null;
|
|
36
|
+
this.ariaAtomic = "";
|
|
37
|
+
this.ariaAutoComplete = "";
|
|
38
|
+
this.ariaBrailleLabel = "";
|
|
39
|
+
this.ariaBrailleRoleDescription = "";
|
|
40
|
+
this.ariaBusy = "";
|
|
41
|
+
this.ariaChecked = "";
|
|
42
|
+
this.ariaColCount = "";
|
|
43
|
+
this.ariaColIndex = "";
|
|
44
|
+
this.ariaColIndexText = "";
|
|
45
|
+
this.ariaColSpan = "";
|
|
46
|
+
this.ariaControlsElements = null;
|
|
47
|
+
this.ariaCurrent = "";
|
|
48
|
+
this.ariaDescribedByElements = null;
|
|
49
|
+
this.ariaDescription = "";
|
|
50
|
+
this.ariaDetailsElements = null;
|
|
51
|
+
this.ariaDisabled = "";
|
|
52
|
+
this.ariaErrorMessageElements = null;
|
|
53
|
+
this.ariaExpanded = "";
|
|
54
|
+
this.ariaFlowToElements = null;
|
|
55
|
+
this.ariaHasPopup = "";
|
|
56
|
+
this.ariaHidden = "";
|
|
57
|
+
this.ariaInvalid = "";
|
|
58
|
+
this.ariaKeyShortcuts = "";
|
|
59
|
+
this.ariaLabel = "";
|
|
60
|
+
this.ariaLabelledByElements = null;
|
|
61
|
+
this.ariaLevel = "";
|
|
62
|
+
this.ariaLive = "";
|
|
63
|
+
this.ariaModal = "";
|
|
64
|
+
this.ariaMultiLine = "";
|
|
65
|
+
this.ariaMultiSelectable = "";
|
|
66
|
+
this.ariaOrientation = "";
|
|
67
|
+
this.ariaOwnsElements = null;
|
|
68
|
+
this.ariaPlaceholder = "";
|
|
69
|
+
this.ariaPosInSet = "";
|
|
70
|
+
this.ariaPressed = "";
|
|
71
|
+
this.ariaReadOnly = "";
|
|
72
|
+
this.ariaRelevant = "";
|
|
73
|
+
this.ariaRequired = "";
|
|
74
|
+
this.ariaRoleDescription = "";
|
|
75
|
+
this.ariaRowCount = "";
|
|
76
|
+
this.ariaRowIndex = "";
|
|
77
|
+
this.ariaRowIndexText = "";
|
|
78
|
+
this.ariaRowSpan = "";
|
|
79
|
+
this.ariaSelected = "";
|
|
80
|
+
this.ariaSetSize = "";
|
|
81
|
+
this.ariaSort = "";
|
|
82
|
+
this.ariaValueMax = "";
|
|
83
|
+
this.ariaValueMin = "";
|
|
84
|
+
this.ariaValueNow = "";
|
|
85
|
+
this.ariaValueText = "";
|
|
86
|
+
this.role = "";
|
|
87
|
+
this.form = null;
|
|
88
|
+
this.labels = [];
|
|
89
|
+
this.states = /* @__PURE__ */ new Set();
|
|
90
|
+
this.validationMessage = "";
|
|
91
|
+
this.validity = {};
|
|
92
|
+
this.willValidate = true;
|
|
93
|
+
this.__host = _host;
|
|
94
|
+
}
|
|
95
|
+
checkValidity() {
|
|
96
|
+
console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true.");
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
reportValidity() {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
setFormValue() {
|
|
103
|
+
}
|
|
104
|
+
setValidity() {
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.6.0/node_modules/@lit-labs/ssr-dom-shim/lib/events.js
|
|
109
|
+
var __classPrivateFieldSet = function(receiver, state, value, kind, f4) {
|
|
110
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
111
|
+
if (kind === "a" && !f4) throw new TypeError("Private accessor was defined without a setter");
|
|
112
|
+
if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
113
|
+
return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state.set(receiver, value), value;
|
|
114
|
+
};
|
|
115
|
+
var __classPrivateFieldGet = function(receiver, state, kind, f4) {
|
|
116
|
+
if (kind === "a" && !f4) throw new TypeError("Private accessor was defined without a getter");
|
|
117
|
+
if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
118
|
+
return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver);
|
|
119
|
+
};
|
|
120
|
+
var _Event_cancelable;
|
|
121
|
+
var _Event_bubbles;
|
|
122
|
+
var _Event_composed;
|
|
123
|
+
var _Event_defaultPrevented;
|
|
124
|
+
var _Event_timestamp;
|
|
125
|
+
var _Event_propagationStopped;
|
|
126
|
+
var _Event_type;
|
|
127
|
+
var _Event_target;
|
|
128
|
+
var _Event_isBeingDispatched;
|
|
129
|
+
var _a;
|
|
130
|
+
var _CustomEvent_detail;
|
|
131
|
+
var _b;
|
|
132
|
+
var NONE = 0;
|
|
133
|
+
var CAPTURING_PHASE = 1;
|
|
134
|
+
var AT_TARGET = 2;
|
|
135
|
+
var BUBBLING_PHASE = 3;
|
|
136
|
+
var enumerableProperty = { __proto__: null };
|
|
137
|
+
enumerableProperty.enumerable = true;
|
|
138
|
+
Object.freeze(enumerableProperty);
|
|
139
|
+
var EventShim = (_a = class Event {
|
|
140
|
+
constructor(type, options = {}) {
|
|
141
|
+
_Event_cancelable.set(this, false);
|
|
142
|
+
_Event_bubbles.set(this, false);
|
|
143
|
+
_Event_composed.set(this, false);
|
|
144
|
+
_Event_defaultPrevented.set(this, false);
|
|
145
|
+
_Event_timestamp.set(this, Date.now());
|
|
146
|
+
_Event_propagationStopped.set(this, false);
|
|
147
|
+
_Event_type.set(this, void 0);
|
|
148
|
+
_Event_target.set(this, void 0);
|
|
149
|
+
_Event_isBeingDispatched.set(this, void 0);
|
|
150
|
+
this.NONE = NONE;
|
|
151
|
+
this.CAPTURING_PHASE = CAPTURING_PHASE;
|
|
152
|
+
this.AT_TARGET = AT_TARGET;
|
|
153
|
+
this.BUBBLING_PHASE = BUBBLING_PHASE;
|
|
154
|
+
if (arguments.length === 0)
|
|
155
|
+
throw new Error(`The type argument must be specified`);
|
|
156
|
+
if (typeof options !== "object" || !options) {
|
|
157
|
+
throw new Error(`The "options" argument must be an object`);
|
|
158
|
+
}
|
|
159
|
+
const { bubbles, cancelable, composed } = options;
|
|
160
|
+
__classPrivateFieldSet(this, _Event_cancelable, !!cancelable, "f");
|
|
161
|
+
__classPrivateFieldSet(this, _Event_bubbles, !!bubbles, "f");
|
|
162
|
+
__classPrivateFieldSet(this, _Event_composed, !!composed, "f");
|
|
163
|
+
__classPrivateFieldSet(this, _Event_type, `${type}`, "f");
|
|
164
|
+
__classPrivateFieldSet(this, _Event_target, null, "f");
|
|
165
|
+
__classPrivateFieldSet(this, _Event_isBeingDispatched, false, "f");
|
|
166
|
+
}
|
|
167
|
+
initEvent(_type, _bubbles, _cancelable) {
|
|
168
|
+
throw new Error("Method not implemented.");
|
|
169
|
+
}
|
|
170
|
+
stopImmediatePropagation() {
|
|
171
|
+
this.stopPropagation();
|
|
172
|
+
}
|
|
173
|
+
preventDefault() {
|
|
174
|
+
__classPrivateFieldSet(this, _Event_defaultPrevented, true, "f");
|
|
175
|
+
}
|
|
176
|
+
get target() {
|
|
177
|
+
return __classPrivateFieldGet(this, _Event_target, "f");
|
|
178
|
+
}
|
|
179
|
+
get currentTarget() {
|
|
180
|
+
return __classPrivateFieldGet(this, _Event_target, "f");
|
|
181
|
+
}
|
|
182
|
+
get srcElement() {
|
|
183
|
+
return __classPrivateFieldGet(this, _Event_target, "f");
|
|
184
|
+
}
|
|
185
|
+
get type() {
|
|
186
|
+
return __classPrivateFieldGet(this, _Event_type, "f");
|
|
187
|
+
}
|
|
188
|
+
get cancelable() {
|
|
189
|
+
return __classPrivateFieldGet(this, _Event_cancelable, "f");
|
|
190
|
+
}
|
|
191
|
+
get defaultPrevented() {
|
|
192
|
+
return __classPrivateFieldGet(this, _Event_cancelable, "f") && __classPrivateFieldGet(this, _Event_defaultPrevented, "f");
|
|
193
|
+
}
|
|
194
|
+
get timeStamp() {
|
|
195
|
+
return __classPrivateFieldGet(this, _Event_timestamp, "f");
|
|
196
|
+
}
|
|
197
|
+
composedPath() {
|
|
198
|
+
return __classPrivateFieldGet(this, _Event_isBeingDispatched, "f") ? [__classPrivateFieldGet(this, _Event_target, "f")] : [];
|
|
199
|
+
}
|
|
200
|
+
get returnValue() {
|
|
201
|
+
return !__classPrivateFieldGet(this, _Event_cancelable, "f") || !__classPrivateFieldGet(this, _Event_defaultPrevented, "f");
|
|
202
|
+
}
|
|
203
|
+
get bubbles() {
|
|
204
|
+
return __classPrivateFieldGet(this, _Event_bubbles, "f");
|
|
205
|
+
}
|
|
206
|
+
get composed() {
|
|
207
|
+
return __classPrivateFieldGet(this, _Event_composed, "f");
|
|
208
|
+
}
|
|
209
|
+
get eventPhase() {
|
|
210
|
+
return __classPrivateFieldGet(this, _Event_isBeingDispatched, "f") ? _a.AT_TARGET : _a.NONE;
|
|
211
|
+
}
|
|
212
|
+
get cancelBubble() {
|
|
213
|
+
return __classPrivateFieldGet(this, _Event_propagationStopped, "f");
|
|
214
|
+
}
|
|
215
|
+
set cancelBubble(value) {
|
|
216
|
+
if (value) {
|
|
217
|
+
__classPrivateFieldSet(this, _Event_propagationStopped, true, "f");
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
stopPropagation() {
|
|
221
|
+
__classPrivateFieldSet(this, _Event_propagationStopped, true, "f");
|
|
222
|
+
}
|
|
223
|
+
get isTrusted() {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
}, _Event_cancelable = /* @__PURE__ */ new WeakMap(), _Event_bubbles = /* @__PURE__ */ new WeakMap(), _Event_composed = /* @__PURE__ */ new WeakMap(), _Event_defaultPrevented = /* @__PURE__ */ new WeakMap(), _Event_timestamp = /* @__PURE__ */ new WeakMap(), _Event_propagationStopped = /* @__PURE__ */ new WeakMap(), _Event_type = /* @__PURE__ */ new WeakMap(), _Event_target = /* @__PURE__ */ new WeakMap(), _Event_isBeingDispatched = /* @__PURE__ */ new WeakMap(), _a.NONE = NONE, _a.CAPTURING_PHASE = CAPTURING_PHASE, _a.AT_TARGET = AT_TARGET, _a.BUBBLING_PHASE = BUBBLING_PHASE, _a);
|
|
227
|
+
Object.defineProperties(EventShim.prototype, {
|
|
228
|
+
initEvent: enumerableProperty,
|
|
229
|
+
stopImmediatePropagation: enumerableProperty,
|
|
230
|
+
preventDefault: enumerableProperty,
|
|
231
|
+
target: enumerableProperty,
|
|
232
|
+
currentTarget: enumerableProperty,
|
|
233
|
+
srcElement: enumerableProperty,
|
|
234
|
+
type: enumerableProperty,
|
|
235
|
+
cancelable: enumerableProperty,
|
|
236
|
+
defaultPrevented: enumerableProperty,
|
|
237
|
+
timeStamp: enumerableProperty,
|
|
238
|
+
composedPath: enumerableProperty,
|
|
239
|
+
returnValue: enumerableProperty,
|
|
240
|
+
bubbles: enumerableProperty,
|
|
241
|
+
composed: enumerableProperty,
|
|
242
|
+
eventPhase: enumerableProperty,
|
|
243
|
+
cancelBubble: enumerableProperty,
|
|
244
|
+
stopPropagation: enumerableProperty,
|
|
245
|
+
isTrusted: enumerableProperty
|
|
246
|
+
});
|
|
247
|
+
var CustomEventShim = (_b = class CustomEvent extends EventShim {
|
|
248
|
+
constructor(type, options = {}) {
|
|
249
|
+
var _a13;
|
|
250
|
+
super(type, options);
|
|
251
|
+
_CustomEvent_detail.set(this, void 0);
|
|
252
|
+
__classPrivateFieldSet(this, _CustomEvent_detail, (_a13 = options == null ? void 0 : options.detail) != null ? _a13 : null, "f");
|
|
253
|
+
}
|
|
254
|
+
initCustomEvent(_type, _bubbles, _cancelable, _detail) {
|
|
255
|
+
throw new Error("Method not implemented.");
|
|
256
|
+
}
|
|
257
|
+
get detail() {
|
|
258
|
+
return __classPrivateFieldGet(this, _CustomEvent_detail, "f");
|
|
259
|
+
}
|
|
260
|
+
}, _CustomEvent_detail = /* @__PURE__ */ new WeakMap(), _b);
|
|
261
|
+
Object.defineProperties(CustomEventShim.prototype, {
|
|
262
|
+
detail: enumerableProperty
|
|
263
|
+
});
|
|
264
|
+
var EventShimWithRealType = EventShim;
|
|
265
|
+
var CustomEventShimWithRealType = CustomEventShim;
|
|
266
|
+
|
|
267
|
+
// ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.6.0/node_modules/@lit-labs/ssr-dom-shim/lib/css.js
|
|
268
|
+
var _a2;
|
|
269
|
+
var CSSRuleShim = (_a2 = class CSSRule {
|
|
270
|
+
constructor() {
|
|
271
|
+
this.STYLE_RULE = 1;
|
|
272
|
+
this.CHARSET_RULE = 2;
|
|
273
|
+
this.IMPORT_RULE = 3;
|
|
274
|
+
this.MEDIA_RULE = 4;
|
|
275
|
+
this.FONT_FACE_RULE = 5;
|
|
276
|
+
this.PAGE_RULE = 6;
|
|
277
|
+
this.NAMESPACE_RULE = 10;
|
|
278
|
+
this.KEYFRAMES_RULE = 7;
|
|
279
|
+
this.KEYFRAME_RULE = 8;
|
|
280
|
+
this.SUPPORTS_RULE = 12;
|
|
281
|
+
this.COUNTER_STYLE_RULE = 11;
|
|
282
|
+
this.FONT_FEATURE_VALUES_RULE = 14;
|
|
283
|
+
this.MARGIN_RULE = 9;
|
|
284
|
+
this.__parentStyleSheet = null;
|
|
285
|
+
this.cssText = "";
|
|
286
|
+
}
|
|
287
|
+
get parentRule() {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
get parentStyleSheet() {
|
|
291
|
+
return this.__parentStyleSheet;
|
|
292
|
+
}
|
|
293
|
+
get type() {
|
|
294
|
+
return 0;
|
|
295
|
+
}
|
|
296
|
+
}, _a2.STYLE_RULE = 1, _a2.CHARSET_RULE = 2, _a2.IMPORT_RULE = 3, _a2.MEDIA_RULE = 4, _a2.FONT_FACE_RULE = 5, _a2.PAGE_RULE = 6, _a2.NAMESPACE_RULE = 10, _a2.KEYFRAMES_RULE = 7, _a2.KEYFRAME_RULE = 8, _a2.SUPPORTS_RULE = 12, _a2.COUNTER_STYLE_RULE = 11, _a2.FONT_FEATURE_VALUES_RULE = 14, _a2.MARGIN_RULE = 9, _a2);
|
|
297
|
+
|
|
298
|
+
// ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.6.0/node_modules/@lit-labs/ssr-dom-shim/index.js
|
|
299
|
+
var _a3;
|
|
300
|
+
(_a3 = globalThis.Event) != null ? _a3 : globalThis.Event = EventShimWithRealType;
|
|
301
|
+
var _a4;
|
|
302
|
+
(_a4 = globalThis.CustomEvent) != null ? _a4 : globalThis.CustomEvent = CustomEventShimWithRealType;
|
|
303
|
+
var constructionToken = Symbol();
|
|
304
|
+
var isCaptureEventListener = (options) => {
|
|
305
|
+
var _a13;
|
|
306
|
+
return typeof options === "boolean" ? options : (_a13 = options == null ? void 0 : options.capture) != null ? _a13 : false;
|
|
307
|
+
};
|
|
308
|
+
var enumerableProperty2 = { __proto__: null };
|
|
309
|
+
enumerableProperty2.enumerable = true;
|
|
310
|
+
Object.freeze(enumerableProperty2);
|
|
311
|
+
var EventTarget = class {
|
|
312
|
+
constructor() {
|
|
313
|
+
this.__eventListeners = /* @__PURE__ */ new Map();
|
|
314
|
+
this.__captureEventListeners = /* @__PURE__ */ new Map();
|
|
315
|
+
}
|
|
316
|
+
addEventListener(type, callback, options) {
|
|
317
|
+
var _a13;
|
|
318
|
+
if (callback === void 0 || callback === null) {
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
const eventListenersMap = isCaptureEventListener(options) ? this.__captureEventListeners : this.__eventListeners;
|
|
322
|
+
let eventListeners = eventListenersMap.get(type);
|
|
323
|
+
if (eventListeners === void 0) {
|
|
324
|
+
eventListeners = /* @__PURE__ */ new Map();
|
|
325
|
+
eventListenersMap.set(type, eventListeners);
|
|
326
|
+
} else if (eventListeners.has(callback)) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
const normalizedOptions = typeof options === "object" && options ? options : {};
|
|
330
|
+
(_a13 = normalizedOptions.signal) == null ? void 0 : _a13.addEventListener("abort", () => this.removeEventListener(type, callback, options));
|
|
331
|
+
eventListeners.set(callback, normalizedOptions != null ? normalizedOptions : {});
|
|
332
|
+
}
|
|
333
|
+
removeEventListener(type, callback, options) {
|
|
334
|
+
if (callback === void 0 || callback === null) {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
const eventListenersMap = isCaptureEventListener(options) ? this.__captureEventListeners : this.__eventListeners;
|
|
338
|
+
const eventListeners = eventListenersMap.get(type);
|
|
339
|
+
if (eventListeners !== void 0) {
|
|
340
|
+
eventListeners.delete(callback);
|
|
341
|
+
if (!eventListeners.size) {
|
|
342
|
+
eventListenersMap.delete(type);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
dispatchEvent(event) {
|
|
347
|
+
let composedPath = this.__resolveFullEventPath();
|
|
348
|
+
if (!event.composed && this.__host) {
|
|
349
|
+
composedPath = composedPath.slice(0, composedPath.indexOf(this.__host));
|
|
350
|
+
}
|
|
351
|
+
let stopPropagation = false;
|
|
352
|
+
let stopImmediatePropagation = false;
|
|
353
|
+
let eventPhase = EventShimWithRealType.NONE;
|
|
354
|
+
let target = null;
|
|
355
|
+
let tmpTarget = null;
|
|
356
|
+
let currentTarget = null;
|
|
357
|
+
const originalStopPropagation = event.stopPropagation;
|
|
358
|
+
const originalStopImmediatePropagation = event.stopImmediatePropagation;
|
|
359
|
+
Object.defineProperties(event, {
|
|
360
|
+
target: {
|
|
361
|
+
get() {
|
|
362
|
+
return target != null ? target : tmpTarget;
|
|
363
|
+
},
|
|
364
|
+
...enumerableProperty2
|
|
365
|
+
},
|
|
366
|
+
srcElement: {
|
|
367
|
+
get() {
|
|
368
|
+
return event.target;
|
|
369
|
+
},
|
|
370
|
+
...enumerableProperty2
|
|
371
|
+
},
|
|
372
|
+
currentTarget: {
|
|
373
|
+
get() {
|
|
374
|
+
return currentTarget;
|
|
375
|
+
},
|
|
376
|
+
...enumerableProperty2
|
|
377
|
+
},
|
|
378
|
+
eventPhase: {
|
|
379
|
+
get() {
|
|
380
|
+
return eventPhase;
|
|
381
|
+
},
|
|
382
|
+
...enumerableProperty2
|
|
383
|
+
},
|
|
384
|
+
composedPath: {
|
|
385
|
+
value: () => composedPath,
|
|
386
|
+
...enumerableProperty2
|
|
387
|
+
},
|
|
388
|
+
stopPropagation: {
|
|
389
|
+
value: () => {
|
|
390
|
+
stopPropagation = true;
|
|
391
|
+
originalStopPropagation.call(event);
|
|
392
|
+
},
|
|
393
|
+
...enumerableProperty2
|
|
394
|
+
},
|
|
395
|
+
stopImmediatePropagation: {
|
|
396
|
+
value: () => {
|
|
397
|
+
stopImmediatePropagation = true;
|
|
398
|
+
originalStopImmediatePropagation.call(event);
|
|
399
|
+
},
|
|
400
|
+
...enumerableProperty2
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
const invokeEventListener = (listener, options, eventListenerMap) => {
|
|
404
|
+
if (typeof listener === "function") {
|
|
405
|
+
listener(event);
|
|
406
|
+
} else if (typeof (listener == null ? void 0 : listener.handleEvent) === "function") {
|
|
407
|
+
listener.handleEvent(event);
|
|
408
|
+
}
|
|
409
|
+
if (options.once) {
|
|
410
|
+
eventListenerMap.delete(listener);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
const finishDispatch = () => {
|
|
414
|
+
currentTarget = null;
|
|
415
|
+
eventPhase = EventShimWithRealType.NONE;
|
|
416
|
+
return !event.defaultPrevented;
|
|
417
|
+
};
|
|
418
|
+
const captureEventPath = composedPath.slice().reverse();
|
|
419
|
+
target = !this.__host || !event.composed ? this : null;
|
|
420
|
+
const retarget = (eventTargets) => {
|
|
421
|
+
tmpTarget = this;
|
|
422
|
+
while (tmpTarget.__host && eventTargets.includes(tmpTarget.__host)) {
|
|
423
|
+
tmpTarget = tmpTarget.__host;
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
for (const eventTarget of captureEventPath) {
|
|
427
|
+
if (!target && (!tmpTarget || tmpTarget === eventTarget.__host)) {
|
|
428
|
+
retarget(captureEventPath.slice(captureEventPath.indexOf(eventTarget)));
|
|
429
|
+
}
|
|
430
|
+
currentTarget = eventTarget;
|
|
431
|
+
eventPhase = eventTarget === event.target ? EventShimWithRealType.AT_TARGET : EventShimWithRealType.CAPTURING_PHASE;
|
|
432
|
+
const captureEventListeners = eventTarget.__captureEventListeners.get(event.type);
|
|
433
|
+
if (captureEventListeners) {
|
|
434
|
+
for (const [listener, options] of captureEventListeners) {
|
|
435
|
+
invokeEventListener(listener, options, captureEventListeners);
|
|
436
|
+
if (stopImmediatePropagation) {
|
|
437
|
+
return finishDispatch();
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
if (stopPropagation) {
|
|
442
|
+
return finishDispatch();
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
const bubbleEventPath = event.bubbles ? composedPath : [this];
|
|
446
|
+
tmpTarget = null;
|
|
447
|
+
for (const eventTarget of bubbleEventPath) {
|
|
448
|
+
if (!target && (!tmpTarget || eventTarget === tmpTarget.__host)) {
|
|
449
|
+
retarget(bubbleEventPath.slice(0, bubbleEventPath.indexOf(eventTarget) + 1));
|
|
450
|
+
}
|
|
451
|
+
currentTarget = eventTarget;
|
|
452
|
+
eventPhase = eventTarget === event.target ? EventShimWithRealType.AT_TARGET : EventShimWithRealType.BUBBLING_PHASE;
|
|
453
|
+
const eventListeners = eventTarget.__eventListeners.get(event.type);
|
|
454
|
+
if (eventListeners) {
|
|
455
|
+
for (const [listener, options] of eventListeners) {
|
|
456
|
+
invokeEventListener(listener, options, eventListeners);
|
|
457
|
+
if (stopImmediatePropagation) {
|
|
458
|
+
return finishDispatch();
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (stopPropagation) {
|
|
463
|
+
return finishDispatch();
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return finishDispatch();
|
|
467
|
+
}
|
|
468
|
+
__resolveFullEventPath() {
|
|
469
|
+
if (this.__eventPathCache) {
|
|
470
|
+
return this.__eventPathCache;
|
|
471
|
+
} else if (!this.__eventTargetParent) {
|
|
472
|
+
return this.__eventPathCache = [this, documentShim, windowShim];
|
|
473
|
+
} else {
|
|
474
|
+
return this.__eventPathCache = [
|
|
475
|
+
this,
|
|
476
|
+
...this.__eventTargetParent.__resolveFullEventPath()
|
|
477
|
+
];
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
var attributes = /* @__PURE__ */ new WeakMap();
|
|
482
|
+
var attributesForElement = (element) => {
|
|
483
|
+
let attrs = attributes.get(element);
|
|
484
|
+
if (attrs === void 0) {
|
|
485
|
+
attributes.set(element, attrs = /* @__PURE__ */ new Map());
|
|
486
|
+
}
|
|
487
|
+
return attrs;
|
|
488
|
+
};
|
|
489
|
+
var NodeShim = class Node extends EventTarget {
|
|
490
|
+
getRootNode(options) {
|
|
491
|
+
var _a13;
|
|
492
|
+
if (options == null ? void 0 : options.composed) {
|
|
493
|
+
return document2;
|
|
494
|
+
}
|
|
495
|
+
const host = this.__host;
|
|
496
|
+
return (_a13 = host == null ? void 0 : host.__shadowRoot) != null ? _a13 : document2;
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
var DocumentShim = class Document2 extends NodeShim {
|
|
500
|
+
get adoptedStyleSheets() {
|
|
501
|
+
return [];
|
|
502
|
+
}
|
|
503
|
+
createTreeWalker() {
|
|
504
|
+
return {};
|
|
505
|
+
}
|
|
506
|
+
createTextNode() {
|
|
507
|
+
return {};
|
|
508
|
+
}
|
|
509
|
+
createElement() {
|
|
510
|
+
return {};
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
var documentShim = new DocumentShim();
|
|
514
|
+
var document2 = documentShim;
|
|
515
|
+
var WindowShim = class Window extends NodeShim {
|
|
516
|
+
constructor(token) {
|
|
517
|
+
super();
|
|
518
|
+
if (token !== constructionToken) {
|
|
519
|
+
throw new TypeError("Illegal constructor");
|
|
520
|
+
}
|
|
521
|
+
Object.assign(this, globalThis, {
|
|
522
|
+
CustomElementRegistry,
|
|
523
|
+
customElements: customElements2,
|
|
524
|
+
document: document2,
|
|
525
|
+
Document: DocumentShim,
|
|
526
|
+
Element: ElementShim,
|
|
527
|
+
EventTarget,
|
|
528
|
+
HTMLElement: HTMLElementShim,
|
|
529
|
+
Node: NodeShim,
|
|
530
|
+
ShadowRoot: ShadowRootShim,
|
|
531
|
+
window: this,
|
|
532
|
+
Window: WindowShim
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
var ElementShim = class Element extends NodeShim {
|
|
537
|
+
constructor() {
|
|
538
|
+
super(...arguments);
|
|
539
|
+
this.__shadowRootMode = null;
|
|
540
|
+
this.__shadowRoot = null;
|
|
541
|
+
this.__internals = null;
|
|
542
|
+
}
|
|
543
|
+
get attributes() {
|
|
544
|
+
return Array.from(attributesForElement(this)).map(([name, value]) => ({
|
|
545
|
+
name,
|
|
546
|
+
value
|
|
547
|
+
}));
|
|
548
|
+
}
|
|
549
|
+
get shadowRoot() {
|
|
550
|
+
if (this.__shadowRootMode === "closed") {
|
|
551
|
+
return null;
|
|
552
|
+
}
|
|
553
|
+
return this.__shadowRoot;
|
|
554
|
+
}
|
|
555
|
+
get localName() {
|
|
556
|
+
return this.constructor.__localName;
|
|
557
|
+
}
|
|
558
|
+
get tagName() {
|
|
559
|
+
var _a13;
|
|
560
|
+
return (_a13 = this.localName) == null ? void 0 : _a13.toUpperCase();
|
|
561
|
+
}
|
|
562
|
+
setAttribute(name, value) {
|
|
563
|
+
attributesForElement(this).set(name, String(value));
|
|
564
|
+
}
|
|
565
|
+
removeAttribute(name) {
|
|
566
|
+
attributesForElement(this).delete(name);
|
|
567
|
+
}
|
|
568
|
+
toggleAttribute(name, force) {
|
|
569
|
+
if (this.hasAttribute(name)) {
|
|
570
|
+
if (force === void 0 || !force) {
|
|
571
|
+
this.removeAttribute(name);
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
} else {
|
|
575
|
+
if (force === void 0 || force) {
|
|
576
|
+
this.setAttribute(name, "");
|
|
577
|
+
return true;
|
|
578
|
+
} else {
|
|
579
|
+
return false;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
return true;
|
|
583
|
+
}
|
|
584
|
+
hasAttribute(name) {
|
|
585
|
+
return attributesForElement(this).has(name);
|
|
586
|
+
}
|
|
587
|
+
attachShadow(init) {
|
|
588
|
+
this.__shadowRootMode = init.mode;
|
|
589
|
+
const shadowRoot = new ShadowRootShim(constructionToken, init);
|
|
590
|
+
shadowRoot.__eventTargetParent = this;
|
|
591
|
+
shadowRoot.__host = this;
|
|
592
|
+
return this.__shadowRoot = shadowRoot;
|
|
593
|
+
}
|
|
594
|
+
attachInternals() {
|
|
595
|
+
if (this.__internals !== null) {
|
|
596
|
+
throw new Error(`Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);
|
|
597
|
+
}
|
|
598
|
+
const internals = new ElementInternalsShim(this);
|
|
599
|
+
this.__internals = internals;
|
|
600
|
+
return internals;
|
|
601
|
+
}
|
|
602
|
+
getAttribute(name) {
|
|
603
|
+
const value = attributesForElement(this).get(name);
|
|
604
|
+
return value != null ? value : null;
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
var HTMLElementShim = class HTMLElement extends ElementShim {
|
|
608
|
+
};
|
|
609
|
+
var HTMLElementShimWithRealType = HTMLElementShim;
|
|
610
|
+
var ShadowRootShim = class ShadowRoot extends NodeShim {
|
|
611
|
+
get host() {
|
|
612
|
+
return this.__host;
|
|
613
|
+
}
|
|
614
|
+
constructor(constructionToken2, init) {
|
|
615
|
+
super();
|
|
616
|
+
if (constructionToken2 !== constructionToken2) {
|
|
617
|
+
throw new TypeError("Illegal constructor");
|
|
618
|
+
}
|
|
619
|
+
this.mode = init.mode;
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
var _a5;
|
|
623
|
+
(_a5 = globalThis.litServerRoot) != null ? _a5 : globalThis.litServerRoot = Object.defineProperty(new HTMLElementShimWithRealType(), "localName", {
|
|
624
|
+
// Patch localName (and tagName) to return a unique name.
|
|
625
|
+
get() {
|
|
626
|
+
return "lit-server-root";
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
function promiseWithResolvers() {
|
|
630
|
+
let resolve;
|
|
631
|
+
let reject;
|
|
632
|
+
const promise = new Promise((res, rej) => {
|
|
633
|
+
resolve = res;
|
|
634
|
+
reject = rej;
|
|
635
|
+
});
|
|
636
|
+
return { promise, resolve, reject };
|
|
637
|
+
}
|
|
638
|
+
var CustomElementRegistry = class {
|
|
639
|
+
constructor() {
|
|
640
|
+
this.__definitions = /* @__PURE__ */ new Map();
|
|
641
|
+
this.__reverseDefinitions = /* @__PURE__ */ new Map();
|
|
642
|
+
this.__pendingWhenDefineds = /* @__PURE__ */ new Map();
|
|
643
|
+
}
|
|
644
|
+
define(name, ctor) {
|
|
645
|
+
var _a13, _b3;
|
|
646
|
+
if (this.__definitions.has(name)) {
|
|
647
|
+
if (process.env.NODE_ENV === "development") {
|
|
648
|
+
console.warn(`'CustomElementRegistry' already has "${name}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
|
|
649
|
+
Make sure to test your application with a production build as repeat registrations will throw in production.`);
|
|
650
|
+
} else {
|
|
651
|
+
throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${name}" has already been used with this registry`);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
if (this.__reverseDefinitions.has(ctor)) {
|
|
655
|
+
throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(ctor)}`);
|
|
656
|
+
}
|
|
657
|
+
ctor.__localName = name;
|
|
658
|
+
this.__definitions.set(name, {
|
|
659
|
+
ctor,
|
|
660
|
+
// Note it's important we read `observedAttributes` in case it is a getter
|
|
661
|
+
// with side-effects, as is the case in Lit, where it triggers class
|
|
662
|
+
// finalization.
|
|
663
|
+
//
|
|
664
|
+
// TODO(aomarks) To be spec compliant, we should also capture the
|
|
665
|
+
// registration-time lifecycle methods like `connectedCallback`. For them
|
|
666
|
+
// to be actually accessible to e.g. the Lit SSR element renderer, though,
|
|
667
|
+
// we'd need to introduce a new API for accessing them (since `get` only
|
|
668
|
+
// returns the constructor).
|
|
669
|
+
observedAttributes: (_a13 = ctor.observedAttributes) != null ? _a13 : []
|
|
670
|
+
});
|
|
671
|
+
this.__reverseDefinitions.set(ctor, name);
|
|
672
|
+
(_b3 = this.__pendingWhenDefineds.get(name)) == null ? void 0 : _b3.resolve(ctor);
|
|
673
|
+
this.__pendingWhenDefineds.delete(name);
|
|
674
|
+
}
|
|
675
|
+
get(name) {
|
|
676
|
+
const definition = this.__definitions.get(name);
|
|
677
|
+
return definition == null ? void 0 : definition.ctor;
|
|
678
|
+
}
|
|
679
|
+
getName(ctor) {
|
|
680
|
+
var _a13;
|
|
681
|
+
return (_a13 = this.__reverseDefinitions.get(ctor)) != null ? _a13 : null;
|
|
682
|
+
}
|
|
683
|
+
initialize(_root) {
|
|
684
|
+
throw new Error(`customElements.initialize is not currently supported in SSR. Please file a bug if you need it.`);
|
|
685
|
+
}
|
|
686
|
+
upgrade(_element) {
|
|
687
|
+
throw new Error(`customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.`);
|
|
688
|
+
}
|
|
689
|
+
async whenDefined(name) {
|
|
690
|
+
const definition = this.__definitions.get(name);
|
|
691
|
+
if (definition) {
|
|
692
|
+
return definition.ctor;
|
|
693
|
+
}
|
|
694
|
+
let withResolvers = this.__pendingWhenDefineds.get(name);
|
|
695
|
+
if (!withResolvers) {
|
|
696
|
+
withResolvers = promiseWithResolvers();
|
|
697
|
+
this.__pendingWhenDefineds.set(name, withResolvers);
|
|
698
|
+
}
|
|
699
|
+
return withResolvers.promise;
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
var CustomElementRegistryShimWithRealType = CustomElementRegistry;
|
|
703
|
+
var customElements2 = new CustomElementRegistryShimWithRealType();
|
|
704
|
+
var windowShim = new WindowShim(constructionToken);
|
|
705
|
+
|
|
706
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/css-tag.js
|
|
707
|
+
var t = globalThis;
|
|
708
|
+
var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
|
|
709
|
+
var s = Symbol();
|
|
710
|
+
var o = /* @__PURE__ */ new WeakMap();
|
|
711
|
+
var n = class {
|
|
712
|
+
constructor(t5, e6, o8) {
|
|
713
|
+
if (this._$cssResult$ = true, o8 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
714
|
+
this.cssText = t5, this.t = e6;
|
|
715
|
+
}
|
|
716
|
+
get styleSheet() {
|
|
717
|
+
let t5 = this.o;
|
|
718
|
+
const s5 = this.t;
|
|
719
|
+
if (e && void 0 === t5) {
|
|
720
|
+
const e6 = void 0 !== s5 && 1 === s5.length;
|
|
721
|
+
e6 && (t5 = o.get(s5)), void 0 === t5 && ((this.o = t5 = new CSSStyleSheet()).replaceSync(this.cssText), e6 && o.set(s5, t5));
|
|
722
|
+
}
|
|
723
|
+
return t5;
|
|
724
|
+
}
|
|
725
|
+
toString() {
|
|
726
|
+
return this.cssText;
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
var r = (t5) => new n("string" == typeof t5 ? t5 : t5 + "", void 0, s);
|
|
730
|
+
var i = (t5, ...e6) => {
|
|
731
|
+
const o8 = 1 === t5.length ? t5[0] : e6.reduce((e7, s5, o9) => e7 + ((t6) => {
|
|
732
|
+
if (true === t6._$cssResult$) return t6.cssText;
|
|
733
|
+
if ("number" == typeof t6) return t6;
|
|
734
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + t6 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
735
|
+
})(s5) + t5[o9 + 1], t5[0]);
|
|
736
|
+
return new n(o8, t5, s);
|
|
737
|
+
};
|
|
738
|
+
var S = (s5, o8) => {
|
|
739
|
+
if (e) s5.adoptedStyleSheets = o8.map((t5) => t5 instanceof CSSStyleSheet ? t5 : t5.styleSheet);
|
|
740
|
+
else for (const e6 of o8) {
|
|
741
|
+
const o9 = document.createElement("style"), n6 = t.litNonce;
|
|
742
|
+
void 0 !== n6 && o9.setAttribute("nonce", n6), o9.textContent = e6.cssText, s5.appendChild(o9);
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
var c = e || void 0 === t.CSSStyleSheet ? (t5) => t5 : (t5) => t5 instanceof CSSStyleSheet ? ((t6) => {
|
|
746
|
+
let e6 = "";
|
|
747
|
+
for (const s5 of t6.cssRules) e6 += s5.cssText;
|
|
748
|
+
return r(e6);
|
|
749
|
+
})(t5) : t5;
|
|
750
|
+
|
|
751
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/reactive-element.js
|
|
752
|
+
var { is: h, defineProperty: r2, getOwnPropertyDescriptor: o2, getOwnPropertyNames: n2, getOwnPropertySymbols: a, getPrototypeOf: c2 } = Object;
|
|
753
|
+
var l = globalThis;
|
|
754
|
+
var _a6;
|
|
755
|
+
(_a6 = l.customElements) != null ? _a6 : l.customElements = customElements2;
|
|
756
|
+
var p = l.trustedTypes;
|
|
757
|
+
var d = p ? p.emptyScript : "";
|
|
758
|
+
var u = l.reactiveElementPolyfillSupport;
|
|
759
|
+
var f = (t5, s5) => t5;
|
|
760
|
+
var b = { toAttribute(t5, s5) {
|
|
761
|
+
switch (s5) {
|
|
762
|
+
case Boolean:
|
|
763
|
+
t5 = t5 ? d : null;
|
|
764
|
+
break;
|
|
765
|
+
case Object:
|
|
766
|
+
case Array:
|
|
767
|
+
t5 = null == t5 ? t5 : JSON.stringify(t5);
|
|
768
|
+
}
|
|
769
|
+
return t5;
|
|
770
|
+
}, fromAttribute(t5, s5) {
|
|
771
|
+
let i5 = t5;
|
|
772
|
+
switch (s5) {
|
|
773
|
+
case Boolean:
|
|
774
|
+
i5 = null !== t5;
|
|
775
|
+
break;
|
|
776
|
+
case Number:
|
|
777
|
+
i5 = null === t5 ? null : Number(t5);
|
|
778
|
+
break;
|
|
779
|
+
case Object:
|
|
780
|
+
case Array:
|
|
781
|
+
try {
|
|
782
|
+
i5 = JSON.parse(t5);
|
|
783
|
+
} catch (t6) {
|
|
784
|
+
i5 = null;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
return i5;
|
|
788
|
+
} };
|
|
789
|
+
var m = (t5, s5) => !h(t5, s5);
|
|
790
|
+
var y = { attribute: true, type: String, converter: b, reflect: false, useDefault: false, hasChanged: m };
|
|
791
|
+
var _a7, _b2;
|
|
792
|
+
(_a7 = Symbol.metadata) != null ? _a7 : Symbol.metadata = Symbol("metadata"), (_b2 = l.litPropertyMetadata) != null ? _b2 : l.litPropertyMetadata = /* @__PURE__ */ new WeakMap();
|
|
793
|
+
var _a8;
|
|
794
|
+
var g = class extends ((_a8 = globalThis.HTMLElement) != null ? _a8 : HTMLElementShimWithRealType) {
|
|
795
|
+
static addInitializer(t5) {
|
|
796
|
+
var _a13;
|
|
797
|
+
this._$Ei(), ((_a13 = this.l) != null ? _a13 : this.l = []).push(t5);
|
|
798
|
+
}
|
|
799
|
+
static get observedAttributes() {
|
|
800
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
801
|
+
}
|
|
802
|
+
static createProperty(t5, s5 = y) {
|
|
803
|
+
if (s5.state && (s5.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t5) && ((s5 = Object.create(s5)).wrapped = true), this.elementProperties.set(t5, s5), !s5.noAccessor) {
|
|
804
|
+
const i5 = Symbol(), e6 = this.getPropertyDescriptor(t5, i5, s5);
|
|
805
|
+
void 0 !== e6 && r2(this.prototype, t5, e6);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
static getPropertyDescriptor(t5, s5, i5) {
|
|
809
|
+
var _a13;
|
|
810
|
+
const { get: e6, set: h5 } = (_a13 = o2(this.prototype, t5)) != null ? _a13 : { get() {
|
|
811
|
+
return this[s5];
|
|
812
|
+
}, set(t6) {
|
|
813
|
+
this[s5] = t6;
|
|
814
|
+
} };
|
|
815
|
+
return { get: e6, set(s6) {
|
|
816
|
+
const r6 = e6 == null ? void 0 : e6.call(this);
|
|
817
|
+
h5 == null ? void 0 : h5.call(this, s6), this.requestUpdate(t5, r6, i5);
|
|
818
|
+
}, configurable: true, enumerable: true };
|
|
819
|
+
}
|
|
820
|
+
static getPropertyOptions(t5) {
|
|
821
|
+
var _a13;
|
|
822
|
+
return (_a13 = this.elementProperties.get(t5)) != null ? _a13 : y;
|
|
823
|
+
}
|
|
824
|
+
static _$Ei() {
|
|
825
|
+
if (this.hasOwnProperty(f("elementProperties"))) return;
|
|
826
|
+
const t5 = c2(this);
|
|
827
|
+
t5.finalize(), void 0 !== t5.l && (this.l = [...t5.l]), this.elementProperties = new Map(t5.elementProperties);
|
|
828
|
+
}
|
|
829
|
+
static finalize() {
|
|
830
|
+
if (this.hasOwnProperty(f("finalized"))) return;
|
|
831
|
+
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(f("properties"))) {
|
|
832
|
+
const t6 = this.properties, s5 = [...n2(t6), ...a(t6)];
|
|
833
|
+
for (const i5 of s5) this.createProperty(i5, t6[i5]);
|
|
834
|
+
}
|
|
835
|
+
const t5 = this[Symbol.metadata];
|
|
836
|
+
if (null !== t5) {
|
|
837
|
+
const s5 = litPropertyMetadata.get(t5);
|
|
838
|
+
if (void 0 !== s5) for (const [t6, i5] of s5) this.elementProperties.set(t6, i5);
|
|
839
|
+
}
|
|
840
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
841
|
+
for (const [t6, s5] of this.elementProperties) {
|
|
842
|
+
const i5 = this._$Eu(t6, s5);
|
|
843
|
+
void 0 !== i5 && this._$Eh.set(i5, t6);
|
|
844
|
+
}
|
|
845
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
846
|
+
}
|
|
847
|
+
static finalizeStyles(t5) {
|
|
848
|
+
const s5 = [];
|
|
849
|
+
if (Array.isArray(t5)) {
|
|
850
|
+
const e6 = new Set(t5.flat(1 / 0).reverse());
|
|
851
|
+
for (const t6 of e6) s5.unshift(c(t6));
|
|
852
|
+
} else void 0 !== t5 && s5.push(c(t5));
|
|
853
|
+
return s5;
|
|
854
|
+
}
|
|
855
|
+
static _$Eu(t5, s5) {
|
|
856
|
+
const i5 = s5.attribute;
|
|
857
|
+
return false === i5 ? void 0 : "string" == typeof i5 ? i5 : "string" == typeof t5 ? t5.toLowerCase() : void 0;
|
|
858
|
+
}
|
|
859
|
+
constructor() {
|
|
860
|
+
super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
|
|
861
|
+
}
|
|
862
|
+
_$Ev() {
|
|
863
|
+
var _a13;
|
|
864
|
+
this._$ES = new Promise((t5) => this.enableUpdating = t5), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (_a13 = this.constructor.l) == null ? void 0 : _a13.forEach((t5) => t5(this));
|
|
865
|
+
}
|
|
866
|
+
addController(t5) {
|
|
867
|
+
var _a13, _b3;
|
|
868
|
+
((_a13 = this._$EO) != null ? _a13 : this._$EO = /* @__PURE__ */ new Set()).add(t5), void 0 !== this.renderRoot && this.isConnected && ((_b3 = t5.hostConnected) == null ? void 0 : _b3.call(t5));
|
|
869
|
+
}
|
|
870
|
+
removeController(t5) {
|
|
871
|
+
var _a13;
|
|
872
|
+
(_a13 = this._$EO) == null ? void 0 : _a13.delete(t5);
|
|
873
|
+
}
|
|
874
|
+
_$E_() {
|
|
875
|
+
const t5 = /* @__PURE__ */ new Map(), s5 = this.constructor.elementProperties;
|
|
876
|
+
for (const i5 of s5.keys()) this.hasOwnProperty(i5) && (t5.set(i5, this[i5]), delete this[i5]);
|
|
877
|
+
t5.size > 0 && (this._$Ep = t5);
|
|
878
|
+
}
|
|
879
|
+
createRenderRoot() {
|
|
880
|
+
var _a13;
|
|
881
|
+
const t5 = (_a13 = this.shadowRoot) != null ? _a13 : this.attachShadow(this.constructor.shadowRootOptions);
|
|
882
|
+
return S(t5, this.constructor.elementStyles), t5;
|
|
883
|
+
}
|
|
884
|
+
connectedCallback() {
|
|
885
|
+
var _a13, _b3;
|
|
886
|
+
(_a13 = this.renderRoot) != null ? _a13 : this.renderRoot = this.createRenderRoot(), this.enableUpdating(true), (_b3 = this._$EO) == null ? void 0 : _b3.forEach((t5) => {
|
|
887
|
+
var _a14;
|
|
888
|
+
return (_a14 = t5.hostConnected) == null ? void 0 : _a14.call(t5);
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
enableUpdating(t5) {
|
|
892
|
+
}
|
|
893
|
+
disconnectedCallback() {
|
|
894
|
+
var _a13;
|
|
895
|
+
(_a13 = this._$EO) == null ? void 0 : _a13.forEach((t5) => {
|
|
896
|
+
var _a14;
|
|
897
|
+
return (_a14 = t5.hostDisconnected) == null ? void 0 : _a14.call(t5);
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
attributeChangedCallback(t5, s5, i5) {
|
|
901
|
+
this._$AK(t5, i5);
|
|
902
|
+
}
|
|
903
|
+
_$ET(t5, s5) {
|
|
904
|
+
var _a13;
|
|
905
|
+
const i5 = this.constructor.elementProperties.get(t5), e6 = this.constructor._$Eu(t5, i5);
|
|
906
|
+
if (void 0 !== e6 && true === i5.reflect) {
|
|
907
|
+
const h5 = (void 0 !== ((_a13 = i5.converter) == null ? void 0 : _a13.toAttribute) ? i5.converter : b).toAttribute(s5, i5.type);
|
|
908
|
+
this._$Em = t5, null == h5 ? this.removeAttribute(e6) : this.setAttribute(e6, h5), this._$Em = null;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
_$AK(t5, s5) {
|
|
912
|
+
var _a13, _b3, _c;
|
|
913
|
+
const i5 = this.constructor, e6 = i5._$Eh.get(t5);
|
|
914
|
+
if (void 0 !== e6 && this._$Em !== e6) {
|
|
915
|
+
const t6 = i5.getPropertyOptions(e6), h5 = "function" == typeof t6.converter ? { fromAttribute: t6.converter } : void 0 !== ((_a13 = t6.converter) == null ? void 0 : _a13.fromAttribute) ? t6.converter : b;
|
|
916
|
+
this._$Em = e6;
|
|
917
|
+
const r6 = h5.fromAttribute(s5, t6.type);
|
|
918
|
+
this[e6] = (_c = r6 != null ? r6 : (_b3 = this._$Ej) == null ? void 0 : _b3.get(e6)) != null ? _c : r6, this._$Em = null;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
requestUpdate(t5, s5, i5, e6 = false, h5) {
|
|
922
|
+
var _a13, _b3;
|
|
923
|
+
if (void 0 !== t5) {
|
|
924
|
+
const r6 = this.constructor;
|
|
925
|
+
if (false === e6 && (h5 = this[t5]), i5 != null ? i5 : i5 = r6.getPropertyOptions(t5), !(((_a13 = i5.hasChanged) != null ? _a13 : m)(h5, s5) || i5.useDefault && i5.reflect && h5 === ((_b3 = this._$Ej) == null ? void 0 : _b3.get(t5)) && !this.hasAttribute(r6._$Eu(t5, i5)))) return;
|
|
926
|
+
this.C(t5, s5, i5);
|
|
927
|
+
}
|
|
928
|
+
false === this.isUpdatePending && (this._$ES = this._$EP());
|
|
929
|
+
}
|
|
930
|
+
C(t5, s5, { useDefault: i5, reflect: e6, wrapped: h5 }, r6) {
|
|
931
|
+
var _a13, _b3, _c;
|
|
932
|
+
i5 && !((_a13 = this._$Ej) != null ? _a13 : this._$Ej = /* @__PURE__ */ new Map()).has(t5) && (this._$Ej.set(t5, (_b3 = r6 != null ? r6 : s5) != null ? _b3 : this[t5]), true !== h5 || void 0 !== r6) || (this._$AL.has(t5) || (this.hasUpdated || i5 || (s5 = void 0), this._$AL.set(t5, s5)), true === e6 && this._$Em !== t5 && ((_c = this._$Eq) != null ? _c : this._$Eq = /* @__PURE__ */ new Set()).add(t5));
|
|
933
|
+
}
|
|
934
|
+
async _$EP() {
|
|
935
|
+
this.isUpdatePending = true;
|
|
936
|
+
try {
|
|
937
|
+
await this._$ES;
|
|
938
|
+
} catch (t6) {
|
|
939
|
+
Promise.reject(t6);
|
|
940
|
+
}
|
|
941
|
+
const t5 = this.scheduleUpdate();
|
|
942
|
+
return null != t5 && await t5, !this.isUpdatePending;
|
|
943
|
+
}
|
|
944
|
+
scheduleUpdate() {
|
|
945
|
+
return this.performUpdate();
|
|
946
|
+
}
|
|
947
|
+
performUpdate() {
|
|
948
|
+
var _a13, _b3;
|
|
949
|
+
if (!this.isUpdatePending) return;
|
|
950
|
+
if (!this.hasUpdated) {
|
|
951
|
+
if ((_a13 = this.renderRoot) != null ? _a13 : this.renderRoot = this.createRenderRoot(), this._$Ep) {
|
|
952
|
+
for (const [t7, s6] of this._$Ep) this[t7] = s6;
|
|
953
|
+
this._$Ep = void 0;
|
|
954
|
+
}
|
|
955
|
+
const t6 = this.constructor.elementProperties;
|
|
956
|
+
if (t6.size > 0) for (const [s6, i5] of t6) {
|
|
957
|
+
const { wrapped: t7 } = i5, e6 = this[s6];
|
|
958
|
+
true !== t7 || this._$AL.has(s6) || void 0 === e6 || this.C(s6, void 0, i5, e6);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
let t5 = false;
|
|
962
|
+
const s5 = this._$AL;
|
|
963
|
+
try {
|
|
964
|
+
t5 = this.shouldUpdate(s5), t5 ? (this.willUpdate(s5), (_b3 = this._$EO) == null ? void 0 : _b3.forEach((t6) => {
|
|
965
|
+
var _a14;
|
|
966
|
+
return (_a14 = t6.hostUpdate) == null ? void 0 : _a14.call(t6);
|
|
967
|
+
}), this.update(s5)) : this._$EM();
|
|
968
|
+
} catch (s6) {
|
|
969
|
+
throw t5 = false, this._$EM(), s6;
|
|
970
|
+
}
|
|
971
|
+
t5 && this._$AE(s5);
|
|
972
|
+
}
|
|
973
|
+
willUpdate(t5) {
|
|
974
|
+
}
|
|
975
|
+
_$AE(t5) {
|
|
976
|
+
var _a13;
|
|
977
|
+
(_a13 = this._$EO) == null ? void 0 : _a13.forEach((t6) => {
|
|
978
|
+
var _a14;
|
|
979
|
+
return (_a14 = t6.hostUpdated) == null ? void 0 : _a14.call(t6);
|
|
980
|
+
}), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t5)), this.updated(t5);
|
|
981
|
+
}
|
|
982
|
+
_$EM() {
|
|
983
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
|
|
984
|
+
}
|
|
985
|
+
get updateComplete() {
|
|
986
|
+
return this.getUpdateComplete();
|
|
987
|
+
}
|
|
988
|
+
getUpdateComplete() {
|
|
989
|
+
return this._$ES;
|
|
990
|
+
}
|
|
991
|
+
shouldUpdate(t5) {
|
|
992
|
+
return true;
|
|
993
|
+
}
|
|
994
|
+
update(t5) {
|
|
995
|
+
this._$Eq && (this._$Eq = this._$Eq.forEach((t6) => this._$ET(t6, this[t6]))), this._$EM();
|
|
996
|
+
}
|
|
997
|
+
updated(t5) {
|
|
998
|
+
}
|
|
999
|
+
firstUpdated(t5) {
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
var _a9;
|
|
1003
|
+
g.elementStyles = [], g.shadowRootOptions = { mode: "open" }, g[f("elementProperties")] = /* @__PURE__ */ new Map(), g[f("finalized")] = /* @__PURE__ */ new Map(), u == null ? void 0 : u({ ReactiveElement: g }), ((_a9 = l.reactiveElementVersions) != null ? _a9 : l.reactiveElementVersions = []).push("2.1.2");
|
|
1004
|
+
|
|
1005
|
+
// ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/node/lit-html.js
|
|
1006
|
+
var t2 = globalThis;
|
|
1007
|
+
var i2 = (t5) => t5;
|
|
1008
|
+
var s2 = t2.trustedTypes;
|
|
1009
|
+
var e2 = s2 ? s2.createPolicy("lit-html", { createHTML: (t5) => t5 }) : void 0;
|
|
1010
|
+
var h2 = "$lit$";
|
|
1011
|
+
var o3 = `lit$${Math.random().toFixed(9).slice(2)}$`;
|
|
1012
|
+
var n3 = "?" + o3;
|
|
1013
|
+
var r3 = `<${n3}>`;
|
|
1014
|
+
var l2 = void 0 === t2.document ? { createTreeWalker: () => ({}) } : document;
|
|
1015
|
+
var c3 = () => l2.createComment("");
|
|
1016
|
+
var a2 = (t5) => null === t5 || "object" != typeof t5 && "function" != typeof t5;
|
|
1017
|
+
var u2 = Array.isArray;
|
|
1018
|
+
var d2 = (t5) => u2(t5) || "function" == typeof (t5 == null ? void 0 : t5[Symbol.iterator]);
|
|
1019
|
+
var f2 = "[ \n\f\r]";
|
|
1020
|
+
var v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
|
|
1021
|
+
var _ = /-->/g;
|
|
1022
|
+
var m2 = />/g;
|
|
1023
|
+
var p2 = RegExp(`>|${f2}(?:([^\\s"'>=/]+)(${f2}*=${f2}*(?:[^
|
|
1024
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g");
|
|
1025
|
+
var g2 = /'/g;
|
|
1026
|
+
var $ = /"/g;
|
|
1027
|
+
var y2 = /^(?:script|style|textarea|title)$/i;
|
|
1028
|
+
var x = (t5) => (i5, ...s5) => ({ _$litType$: t5, strings: i5, values: s5 });
|
|
1029
|
+
var T = x(1);
|
|
1030
|
+
var b2 = x(2);
|
|
1031
|
+
var w = x(3);
|
|
1032
|
+
var E = Symbol.for("lit-noChange");
|
|
1033
|
+
var A = Symbol.for("lit-nothing");
|
|
1034
|
+
var C = /* @__PURE__ */ new WeakMap();
|
|
1035
|
+
var P = l2.createTreeWalker(l2, 129);
|
|
1036
|
+
function V(t5, i5) {
|
|
1037
|
+
if (!u2(t5) || !t5.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
1038
|
+
return void 0 !== e2 ? e2.createHTML(i5) : i5;
|
|
1039
|
+
}
|
|
1040
|
+
var N = (t5, i5) => {
|
|
1041
|
+
const s5 = t5.length - 1, e6 = [];
|
|
1042
|
+
let n6, l3 = 2 === i5 ? "<svg>" : 3 === i5 ? "<math>" : "", c5 = v;
|
|
1043
|
+
for (let i6 = 0; i6 < s5; i6++) {
|
|
1044
|
+
const s6 = t5[i6];
|
|
1045
|
+
let a3, u3, d3 = -1, f4 = 0;
|
|
1046
|
+
for (; f4 < s6.length && (c5.lastIndex = f4, u3 = c5.exec(s6), null !== u3); ) f4 = c5.lastIndex, c5 === v ? "!--" === u3[1] ? c5 = _ : void 0 !== u3[1] ? c5 = m2 : void 0 !== u3[2] ? (y2.test(u3[2]) && (n6 = RegExp("</" + u3[2], "g")), c5 = p2) : void 0 !== u3[3] && (c5 = p2) : c5 === p2 ? ">" === u3[0] ? (c5 = n6 != null ? n6 : v, d3 = -1) : void 0 === u3[1] ? d3 = -2 : (d3 = c5.lastIndex - u3[2].length, a3 = u3[1], c5 = void 0 === u3[3] ? p2 : '"' === u3[3] ? $ : g2) : c5 === $ || c5 === g2 ? c5 = p2 : c5 === _ || c5 === m2 ? c5 = v : (c5 = p2, n6 = void 0);
|
|
1047
|
+
const x2 = c5 === p2 && t5[i6 + 1].startsWith("/>") ? " " : "";
|
|
1048
|
+
l3 += c5 === v ? s6 + r3 : d3 >= 0 ? (e6.push(a3), s6.slice(0, d3) + h2 + s6.slice(d3) + o3 + x2) : s6 + o3 + (-2 === d3 ? i6 : x2);
|
|
1049
|
+
}
|
|
1050
|
+
return [V(t5, l3 + (t5[s5] || "<?>") + (2 === i5 ? "</svg>" : 3 === i5 ? "</math>" : "")), e6];
|
|
1051
|
+
};
|
|
1052
|
+
var S2 = class _S {
|
|
1053
|
+
constructor({ strings: t5, _$litType$: i5 }, e6) {
|
|
1054
|
+
let r6;
|
|
1055
|
+
this.parts = [];
|
|
1056
|
+
let l3 = 0, a3 = 0;
|
|
1057
|
+
const u3 = t5.length - 1, d3 = this.parts, [f4, v2] = N(t5, i5);
|
|
1058
|
+
if (this.el = _S.createElement(f4, e6), P.currentNode = this.el.content, 2 === i5 || 3 === i5) {
|
|
1059
|
+
const t6 = this.el.content.firstChild;
|
|
1060
|
+
t6.replaceWith(...t6.childNodes);
|
|
1061
|
+
}
|
|
1062
|
+
for (; null !== (r6 = P.nextNode()) && d3.length < u3; ) {
|
|
1063
|
+
if (1 === r6.nodeType) {
|
|
1064
|
+
if (r6.hasAttributes()) for (const t6 of r6.getAttributeNames()) if (t6.endsWith(h2)) {
|
|
1065
|
+
const i6 = v2[a3++], s5 = r6.getAttribute(t6).split(o3), e7 = /([.?@])?(.*)/.exec(i6);
|
|
1066
|
+
d3.push({ type: 1, index: l3, name: e7[2], strings: s5, ctor: "." === e7[1] ? I : "?" === e7[1] ? L : "@" === e7[1] ? z : H }), r6.removeAttribute(t6);
|
|
1067
|
+
} else t6.startsWith(o3) && (d3.push({ type: 6, index: l3 }), r6.removeAttribute(t6));
|
|
1068
|
+
if (y2.test(r6.tagName)) {
|
|
1069
|
+
const t6 = r6.textContent.split(o3), i6 = t6.length - 1;
|
|
1070
|
+
if (i6 > 0) {
|
|
1071
|
+
r6.textContent = s2 ? s2.emptyScript : "";
|
|
1072
|
+
for (let s5 = 0; s5 < i6; s5++) r6.append(t6[s5], c3()), P.nextNode(), d3.push({ type: 2, index: ++l3 });
|
|
1073
|
+
r6.append(t6[i6], c3());
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
} else if (8 === r6.nodeType) if (r6.data === n3) d3.push({ type: 2, index: l3 });
|
|
1077
|
+
else {
|
|
1078
|
+
let t6 = -1;
|
|
1079
|
+
for (; -1 !== (t6 = r6.data.indexOf(o3, t6 + 1)); ) d3.push({ type: 7, index: l3 }), t6 += o3.length - 1;
|
|
1080
|
+
}
|
|
1081
|
+
l3++;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
static createElement(t5, i5) {
|
|
1085
|
+
const s5 = l2.createElement("template");
|
|
1086
|
+
return s5.innerHTML = t5, s5;
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
1089
|
+
function M(t5, i5, s5 = t5, e6) {
|
|
1090
|
+
var _a13, _b3, _c;
|
|
1091
|
+
if (i5 === E) return i5;
|
|
1092
|
+
let h5 = void 0 !== e6 ? (_a13 = s5._$Co) == null ? void 0 : _a13[e6] : s5._$Cl;
|
|
1093
|
+
const o8 = a2(i5) ? void 0 : i5._$litDirective$;
|
|
1094
|
+
return (h5 == null ? void 0 : h5.constructor) !== o8 && ((_b3 = h5 == null ? void 0 : h5._$AO) == null ? void 0 : _b3.call(h5, false), void 0 === o8 ? h5 = void 0 : (h5 = new o8(t5), h5._$AT(t5, s5, e6)), void 0 !== e6 ? ((_c = s5._$Co) != null ? _c : s5._$Co = [])[e6] = h5 : s5._$Cl = h5), void 0 !== h5 && (i5 = M(t5, h5._$AS(t5, i5.values), h5, e6)), i5;
|
|
1095
|
+
}
|
|
1096
|
+
var k = class {
|
|
1097
|
+
constructor(t5, i5) {
|
|
1098
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t5, this._$AM = i5;
|
|
1099
|
+
}
|
|
1100
|
+
get parentNode() {
|
|
1101
|
+
return this._$AM.parentNode;
|
|
1102
|
+
}
|
|
1103
|
+
get _$AU() {
|
|
1104
|
+
return this._$AM._$AU;
|
|
1105
|
+
}
|
|
1106
|
+
u(t5) {
|
|
1107
|
+
var _a13;
|
|
1108
|
+
const { el: { content: i5 }, parts: s5 } = this._$AD, e6 = ((_a13 = t5 == null ? void 0 : t5.creationScope) != null ? _a13 : l2).importNode(i5, true);
|
|
1109
|
+
P.currentNode = e6;
|
|
1110
|
+
let h5 = P.nextNode(), o8 = 0, n6 = 0, r6 = s5[0];
|
|
1111
|
+
for (; void 0 !== r6; ) {
|
|
1112
|
+
if (o8 === r6.index) {
|
|
1113
|
+
let i6;
|
|
1114
|
+
2 === r6.type ? i6 = new R(h5, h5.nextSibling, this, t5) : 1 === r6.type ? i6 = new r6.ctor(h5, r6.name, r6.strings, this, t5) : 6 === r6.type && (i6 = new W(h5, this, t5)), this._$AV.push(i6), r6 = s5[++n6];
|
|
1115
|
+
}
|
|
1116
|
+
o8 !== (r6 == null ? void 0 : r6.index) && (h5 = P.nextNode(), o8++);
|
|
1117
|
+
}
|
|
1118
|
+
return P.currentNode = l2, e6;
|
|
1119
|
+
}
|
|
1120
|
+
p(t5) {
|
|
1121
|
+
let i5 = 0;
|
|
1122
|
+
for (const s5 of this._$AV) void 0 !== s5 && (void 0 !== s5.strings ? (s5._$AI(t5, s5, i5), i5 += s5.strings.length - 2) : s5._$AI(t5[i5])), i5++;
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1125
|
+
var R = class _R {
|
|
1126
|
+
get _$AU() {
|
|
1127
|
+
var _a13, _b3;
|
|
1128
|
+
return (_b3 = (_a13 = this._$AM) == null ? void 0 : _a13._$AU) != null ? _b3 : this._$Cv;
|
|
1129
|
+
}
|
|
1130
|
+
constructor(t5, i5, s5, e6) {
|
|
1131
|
+
var _a13;
|
|
1132
|
+
this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = t5, this._$AB = i5, this._$AM = s5, this.options = e6, this._$Cv = (_a13 = e6 == null ? void 0 : e6.isConnected) != null ? _a13 : true;
|
|
1133
|
+
}
|
|
1134
|
+
get parentNode() {
|
|
1135
|
+
let t5 = this._$AA.parentNode;
|
|
1136
|
+
const i5 = this._$AM;
|
|
1137
|
+
return void 0 !== i5 && 11 === (t5 == null ? void 0 : t5.nodeType) && (t5 = i5.parentNode), t5;
|
|
1138
|
+
}
|
|
1139
|
+
get startNode() {
|
|
1140
|
+
return this._$AA;
|
|
1141
|
+
}
|
|
1142
|
+
get endNode() {
|
|
1143
|
+
return this._$AB;
|
|
1144
|
+
}
|
|
1145
|
+
_$AI(t5, i5 = this) {
|
|
1146
|
+
t5 = M(this, t5, i5), a2(t5) ? t5 === A || null == t5 || "" === t5 ? (this._$AH !== A && this._$AR(), this._$AH = A) : t5 !== this._$AH && t5 !== E && this._(t5) : void 0 !== t5._$litType$ ? this.$(t5) : void 0 !== t5.nodeType ? this.T(t5) : d2(t5) ? this.k(t5) : this._(t5);
|
|
1147
|
+
}
|
|
1148
|
+
O(t5) {
|
|
1149
|
+
return this._$AA.parentNode.insertBefore(t5, this._$AB);
|
|
1150
|
+
}
|
|
1151
|
+
T(t5) {
|
|
1152
|
+
this._$AH !== t5 && (this._$AR(), this._$AH = this.O(t5));
|
|
1153
|
+
}
|
|
1154
|
+
_(t5) {
|
|
1155
|
+
this._$AH !== A && a2(this._$AH) ? this._$AA.nextSibling.data = t5 : this.T(l2.createTextNode(t5)), this._$AH = t5;
|
|
1156
|
+
}
|
|
1157
|
+
$(t5) {
|
|
1158
|
+
var _a13;
|
|
1159
|
+
const { values: i5, _$litType$: s5 } = t5, e6 = "number" == typeof s5 ? this._$AC(t5) : (void 0 === s5.el && (s5.el = S2.createElement(V(s5.h, s5.h[0]), this.options)), s5);
|
|
1160
|
+
if (((_a13 = this._$AH) == null ? void 0 : _a13._$AD) === e6) this._$AH.p(i5);
|
|
1161
|
+
else {
|
|
1162
|
+
const t6 = new k(e6, this), s6 = t6.u(this.options);
|
|
1163
|
+
t6.p(i5), this.T(s6), this._$AH = t6;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
_$AC(t5) {
|
|
1167
|
+
let i5 = C.get(t5.strings);
|
|
1168
|
+
return void 0 === i5 && C.set(t5.strings, i5 = new S2(t5)), i5;
|
|
1169
|
+
}
|
|
1170
|
+
k(t5) {
|
|
1171
|
+
u2(this._$AH) || (this._$AH = [], this._$AR());
|
|
1172
|
+
const i5 = this._$AH;
|
|
1173
|
+
let s5, e6 = 0;
|
|
1174
|
+
for (const h5 of t5) e6 === i5.length ? i5.push(s5 = new _R(this.O(c3()), this.O(c3()), this, this.options)) : s5 = i5[e6], s5._$AI(h5), e6++;
|
|
1175
|
+
e6 < i5.length && (this._$AR(s5 && s5._$AB.nextSibling, e6), i5.length = e6);
|
|
1176
|
+
}
|
|
1177
|
+
_$AR(t5 = this._$AA.nextSibling, s5) {
|
|
1178
|
+
var _a13;
|
|
1179
|
+
for ((_a13 = this._$AP) == null ? void 0 : _a13.call(this, false, true, s5); t5 !== this._$AB; ) {
|
|
1180
|
+
const s6 = i2(t5).nextSibling;
|
|
1181
|
+
i2(t5).remove(), t5 = s6;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
setConnected(t5) {
|
|
1185
|
+
var _a13;
|
|
1186
|
+
void 0 === this._$AM && (this._$Cv = t5, (_a13 = this._$AP) == null ? void 0 : _a13.call(this, t5));
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
var H = class {
|
|
1190
|
+
get tagName() {
|
|
1191
|
+
return this.element.tagName;
|
|
1192
|
+
}
|
|
1193
|
+
get _$AU() {
|
|
1194
|
+
return this._$AM._$AU;
|
|
1195
|
+
}
|
|
1196
|
+
constructor(t5, i5, s5, e6, h5) {
|
|
1197
|
+
this.type = 1, this._$AH = A, this._$AN = void 0, this.element = t5, this.name = i5, this._$AM = e6, this.options = h5, s5.length > 2 || "" !== s5[0] || "" !== s5[1] ? (this._$AH = Array(s5.length - 1).fill(new String()), this.strings = s5) : this._$AH = A;
|
|
1198
|
+
}
|
|
1199
|
+
_$AI(t5, i5 = this, s5, e6) {
|
|
1200
|
+
const h5 = this.strings;
|
|
1201
|
+
let o8 = false;
|
|
1202
|
+
if (void 0 === h5) t5 = M(this, t5, i5, 0), o8 = !a2(t5) || t5 !== this._$AH && t5 !== E, o8 && (this._$AH = t5);
|
|
1203
|
+
else {
|
|
1204
|
+
const e7 = t5;
|
|
1205
|
+
let n6, r6;
|
|
1206
|
+
for (t5 = h5[0], n6 = 0; n6 < h5.length - 1; n6++) r6 = M(this, e7[s5 + n6], i5, n6), r6 === E && (r6 = this._$AH[n6]), o8 || (o8 = !a2(r6) || r6 !== this._$AH[n6]), r6 === A ? t5 = A : t5 !== A && (t5 += (r6 != null ? r6 : "") + h5[n6 + 1]), this._$AH[n6] = r6;
|
|
1207
|
+
}
|
|
1208
|
+
o8 && !e6 && this.j(t5);
|
|
1209
|
+
}
|
|
1210
|
+
j(t5) {
|
|
1211
|
+
t5 === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t5 != null ? t5 : "");
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
var I = class extends H {
|
|
1215
|
+
constructor() {
|
|
1216
|
+
super(...arguments), this.type = 3;
|
|
1217
|
+
}
|
|
1218
|
+
j(t5) {
|
|
1219
|
+
this.element[this.name] = t5 === A ? void 0 : t5;
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
var L = class extends H {
|
|
1223
|
+
constructor() {
|
|
1224
|
+
super(...arguments), this.type = 4;
|
|
1225
|
+
}
|
|
1226
|
+
j(t5) {
|
|
1227
|
+
this.element.toggleAttribute(this.name, !!t5 && t5 !== A);
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
1230
|
+
var z = class extends H {
|
|
1231
|
+
constructor(t5, i5, s5, e6, h5) {
|
|
1232
|
+
super(t5, i5, s5, e6, h5), this.type = 5;
|
|
1233
|
+
}
|
|
1234
|
+
_$AI(t5, i5 = this) {
|
|
1235
|
+
var _a13;
|
|
1236
|
+
if ((t5 = (_a13 = M(this, t5, i5, 0)) != null ? _a13 : A) === E) return;
|
|
1237
|
+
const s5 = this._$AH, e6 = t5 === A && s5 !== A || t5.capture !== s5.capture || t5.once !== s5.once || t5.passive !== s5.passive, h5 = t5 !== A && (s5 === A || e6);
|
|
1238
|
+
e6 && this.element.removeEventListener(this.name, this, s5), h5 && this.element.addEventListener(this.name, this, t5), this._$AH = t5;
|
|
1239
|
+
}
|
|
1240
|
+
handleEvent(t5) {
|
|
1241
|
+
var _a13, _b3;
|
|
1242
|
+
"function" == typeof this._$AH ? this._$AH.call((_b3 = (_a13 = this.options) == null ? void 0 : _a13.host) != null ? _b3 : this.element, t5) : this._$AH.handleEvent(t5);
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
var W = class {
|
|
1246
|
+
constructor(t5, i5, s5) {
|
|
1247
|
+
this.element = t5, this.type = 6, this._$AN = void 0, this._$AM = i5, this.options = s5;
|
|
1248
|
+
}
|
|
1249
|
+
get _$AU() {
|
|
1250
|
+
return this._$AM._$AU;
|
|
1251
|
+
}
|
|
1252
|
+
_$AI(t5) {
|
|
1253
|
+
M(this, t5);
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
var Z = { M: h2, P: o3, A: n3, C: 1, L: N, R: k, D: d2, V: M, I: R, H, N: L, U: z, B: I, F: W };
|
|
1257
|
+
var j = t2.litHtmlPolyfillSupport;
|
|
1258
|
+
var _a10;
|
|
1259
|
+
j == null ? void 0 : j(S2, R), ((_a10 = t2.litHtmlVersions) != null ? _a10 : t2.litHtmlVersions = []).push("3.3.3");
|
|
1260
|
+
var B = (t5, i5, s5) => {
|
|
1261
|
+
var _a13, _b3;
|
|
1262
|
+
const e6 = (_a13 = s5 == null ? void 0 : s5.renderBefore) != null ? _a13 : i5;
|
|
1263
|
+
let h5 = e6._$litPart$;
|
|
1264
|
+
if (void 0 === h5) {
|
|
1265
|
+
const t6 = (_b3 = s5 == null ? void 0 : s5.renderBefore) != null ? _b3 : null;
|
|
1266
|
+
e6._$litPart$ = h5 = new R(i5.insertBefore(c3(), t6), t6, void 0, s5 != null ? s5 : {});
|
|
1267
|
+
}
|
|
1268
|
+
return h5._$AI(t5), h5;
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
// ../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js
|
|
1272
|
+
var s3 = globalThis;
|
|
1273
|
+
var i3 = class extends g {
|
|
1274
|
+
constructor() {
|
|
1275
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1276
|
+
}
|
|
1277
|
+
createRenderRoot() {
|
|
1278
|
+
var _a13, _b3;
|
|
1279
|
+
const t5 = super.createRenderRoot();
|
|
1280
|
+
return (_b3 = (_a13 = this.renderOptions).renderBefore) != null ? _b3 : _a13.renderBefore = t5.firstChild, t5;
|
|
1281
|
+
}
|
|
1282
|
+
update(t5) {
|
|
1283
|
+
const r6 = this.render();
|
|
1284
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t5), this._$Do = B(r6, this.renderRoot, this.renderOptions);
|
|
1285
|
+
}
|
|
1286
|
+
connectedCallback() {
|
|
1287
|
+
var _a13;
|
|
1288
|
+
super.connectedCallback(), (_a13 = this._$Do) == null ? void 0 : _a13.setConnected(true);
|
|
1289
|
+
}
|
|
1290
|
+
disconnectedCallback() {
|
|
1291
|
+
var _a13;
|
|
1292
|
+
super.disconnectedCallback(), (_a13 = this._$Do) == null ? void 0 : _a13.setConnected(false);
|
|
1293
|
+
}
|
|
1294
|
+
render() {
|
|
1295
|
+
return E;
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
var _a11;
|
|
1299
|
+
i3._$litElement$ = true, i3["finalized"] = true, (_a11 = s3.litElementHydrateSupport) == null ? void 0 : _a11.call(s3, { LitElement: i3 });
|
|
1300
|
+
var o4 = s3.litElementPolyfillSupport;
|
|
1301
|
+
o4 == null ? void 0 : o4({ LitElement: i3 });
|
|
1302
|
+
var _a12;
|
|
1303
|
+
((_a12 = s3.litElementVersions) != null ? _a12 : s3.litElementVersions = []).push("4.2.2");
|
|
1304
|
+
|
|
1305
|
+
// ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/node/directive.js
|
|
1306
|
+
var t3 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
1307
|
+
var e3 = (t5) => (...e6) => ({ _$litDirective$: t5, values: e6 });
|
|
1308
|
+
var i4 = class {
|
|
1309
|
+
constructor(t5) {
|
|
1310
|
+
}
|
|
1311
|
+
get _$AU() {
|
|
1312
|
+
return this._$AM._$AU;
|
|
1313
|
+
}
|
|
1314
|
+
_$AT(t5, e6, i5) {
|
|
1315
|
+
this._$Ct = t5, this._$AM = e6, this._$Ci = i5;
|
|
1316
|
+
}
|
|
1317
|
+
_$AS(t5, e6) {
|
|
1318
|
+
return this.update(t5, e6);
|
|
1319
|
+
}
|
|
1320
|
+
update(t5, e6) {
|
|
1321
|
+
return this.render(...e6);
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
|
|
1325
|
+
// ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/node/directives/unsafe-html.js
|
|
1326
|
+
var e4 = class extends i4 {
|
|
1327
|
+
constructor(i5) {
|
|
1328
|
+
if (super(i5), this.it = A, i5.type !== t3.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
1329
|
+
}
|
|
1330
|
+
render(r6) {
|
|
1331
|
+
if (r6 === A || null == r6) return this._t = void 0, this.it = r6;
|
|
1332
|
+
if (r6 === E) return r6;
|
|
1333
|
+
if ("string" != typeof r6) throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
1334
|
+
if (r6 === this.it) return this._t;
|
|
1335
|
+
this.it = r6;
|
|
1336
|
+
const s5 = [r6];
|
|
1337
|
+
return s5.raw = s5, this._t = { _$litType$: this.constructor.resultType, strings: s5, values: [] };
|
|
1338
|
+
}
|
|
1339
|
+
};
|
|
1340
|
+
e4.directiveName = "unsafeHTML", e4.resultType = 1;
|
|
1341
|
+
var o5 = e3(e4);
|
|
1342
|
+
|
|
29
1343
|
// raw:/workspace/source/ads-js/packages/ads-stories/src/components/icons/assets/close.svg
|
|
30
1344
|
var close_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>\n';
|
|
31
1345
|
|
|
@@ -35,23 +1349,244 @@ var collapse_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256
|
|
|
35
1349
|
// raw:/workspace/source/ads-js/packages/ads-stories/src/components/icons/assets/expand.svg
|
|
36
1350
|
var expand_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48V88a8,8,0,0,1-16,0V56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48ZM88,200H56V168a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H88a8,8,0,0,0,0-16Zm120-40a8,8,0,0,0-8,8v32H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM88,40H48a8,8,0,0,0-8,8V88a8,8,0,0,0,16,0V56H88a8,8,0,0,0,0-16Z"/></svg>\n';
|
|
37
1351
|
|
|
1352
|
+
// raw:/workspace/source/ads-js/packages/ads-stories/src/components/icons/assets/pause-fill.svg
|
|
1353
|
+
var pause_fill_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48V208a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V48a16,16,0,0,1,16-16h40A16,16,0,0,1,216,48ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Z"/></svg>\n';
|
|
1354
|
+
|
|
38
1355
|
// raw:/workspace/source/ads-js/packages/ads-stories/src/components/icons/assets/play-fill.svg
|
|
39
1356
|
var play_fill_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z"/></svg>\n';
|
|
40
1357
|
|
|
1358
|
+
// raw:/workspace/source/ads-js/packages/ads-stories/src/components/icons/assets/speaker-x-fill.svg
|
|
1359
|
+
var speaker_x_fill_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M245.66,146.34a8,8,0,0,1-11.32,11.32L216,139.31l-18.34,18.35a8,8,0,0,1-11.32-11.32L204.69,128l-18.35-18.34a8,8,0,0,1,11.32-11.32L216,116.69l18.34-18.35a8,8,0,0,1,11.32,11.32L227.31,128ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Zm97.15-54.15a8,8,0,0,0-10-.16l-65.57,51A4,4,0,0,0,80,79.84v96.32a4,4,0,0,0,1.55,3.15l65.57,51a8,8,0,0,0,9,.56,8.29,8.29,0,0,0,3.91-7.18V32.25A8.27,8.27,0,0,0,157.12,25.85Z"/></svg>\n';
|
|
1360
|
+
|
|
1361
|
+
// raw:/workspace/source/ads-js/packages/ads-stories/src/components/icons/assets/speaker-high-fill.svg
|
|
1362
|
+
var speaker_high_fill_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M160,32.25V223.69a8.29,8.29,0,0,1-3.91,7.18,8,8,0,0,1-9-.56l-65.57-51A4,4,0,0,1,80,176.16V79.84a4,4,0,0,1,1.55-3.15l65.57-51a8,8,0,0,1,10,.16A8.27,8.27,0,0,1,160,32.25ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Zm126.77,20.84a8,8,0,0,0-.72,11.3,24,24,0,0,1,0,31.72,8,8,0,1,0,12,10.58,40,40,0,0,0,0-52.88A8,8,0,0,0,186.74,100.84Zm40.89-26.17a8,8,0,1,0-11.92,10.66,64,64,0,0,1,0,85.34,8,8,0,1,0,11.92,10.66,80,80,0,0,0,0-106.66Z"/></svg>\n';
|
|
1363
|
+
|
|
41
1364
|
// src/components/icons/index.ts
|
|
42
|
-
var icons = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1365
|
+
var icons = {
|
|
1366
|
+
close: close_default,
|
|
1367
|
+
collapse: collapse_default,
|
|
1368
|
+
expand: expand_default,
|
|
1369
|
+
pause: pause_fill_default,
|
|
1370
|
+
play: play_fill_default,
|
|
1371
|
+
soundOff: speaker_x_fill_default,
|
|
1372
|
+
soundOn: speaker_high_fill_default
|
|
1373
|
+
};
|
|
1374
|
+
var markup = Object.fromEntries(
|
|
1375
|
+
Object.entries(icons).map(([name, svg]) => [
|
|
1376
|
+
name,
|
|
1377
|
+
svg.replace(
|
|
1378
|
+
"<svg",
|
|
1379
|
+
'<svg class="icon" aria-hidden="true" focusable="false"'
|
|
1380
|
+
)
|
|
1381
|
+
])
|
|
1382
|
+
);
|
|
1383
|
+
function icon(name) {
|
|
1384
|
+
return o5(markup[name]);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
// ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/node/directive-helpers.js
|
|
1388
|
+
var { I: t4 } = Z;
|
|
1389
|
+
var r4 = (o8) => void 0 === o8.strings;
|
|
1390
|
+
|
|
1391
|
+
// ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/node/async-directive.js
|
|
1392
|
+
var s4 = (i5, t5) => {
|
|
1393
|
+
var _a13;
|
|
1394
|
+
const e6 = i5._$AN;
|
|
1395
|
+
if (void 0 === e6) return false;
|
|
1396
|
+
for (const i6 of e6) (_a13 = i6._$AO) == null ? void 0 : _a13.call(i6, t5, false), s4(i6, t5);
|
|
1397
|
+
return true;
|
|
1398
|
+
};
|
|
1399
|
+
var o6 = (i5) => {
|
|
1400
|
+
let t5, e6;
|
|
1401
|
+
do {
|
|
1402
|
+
if (void 0 === (t5 = i5._$AM)) break;
|
|
1403
|
+
e6 = t5._$AN, e6.delete(i5), i5 = t5;
|
|
1404
|
+
} while (0 === (e6 == null ? void 0 : e6.size));
|
|
1405
|
+
};
|
|
1406
|
+
var r5 = (i5) => {
|
|
1407
|
+
for (let t5; t5 = i5._$AM; i5 = t5) {
|
|
1408
|
+
let e6 = t5._$AN;
|
|
1409
|
+
if (void 0 === e6) t5._$AN = e6 = /* @__PURE__ */ new Set();
|
|
1410
|
+
else if (e6.has(i5)) break;
|
|
1411
|
+
e6.add(i5), c4(t5);
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
function h3(i5) {
|
|
1415
|
+
void 0 !== this._$AN ? (o6(this), this._$AM = i5, r5(this)) : this._$AM = i5;
|
|
1416
|
+
}
|
|
1417
|
+
function n4(i5, t5 = false, e6 = 0) {
|
|
1418
|
+
const r6 = this._$AH, h5 = this._$AN;
|
|
1419
|
+
if (void 0 !== h5 && 0 !== h5.size) if (t5) if (Array.isArray(r6)) for (let i6 = e6; i6 < r6.length; i6++) s4(r6[i6], false), o6(r6[i6]);
|
|
1420
|
+
else null != r6 && (s4(r6, false), o6(r6));
|
|
1421
|
+
else s4(this, i5);
|
|
51
1422
|
}
|
|
1423
|
+
var c4 = (i5) => {
|
|
1424
|
+
var _a13, _b3;
|
|
1425
|
+
i5.type == t3.CHILD && ((_a13 = i5._$AP) != null ? _a13 : i5._$AP = n4, (_b3 = i5._$AQ) != null ? _b3 : i5._$AQ = h3);
|
|
1426
|
+
};
|
|
1427
|
+
var f3 = class extends i4 {
|
|
1428
|
+
constructor() {
|
|
1429
|
+
super(...arguments), this._$AN = void 0;
|
|
1430
|
+
}
|
|
1431
|
+
_$AT(i5, t5, e6) {
|
|
1432
|
+
super._$AT(i5, t5, e6), r5(this), this.isConnected = i5._$AU;
|
|
1433
|
+
}
|
|
1434
|
+
_$AO(i5, t5 = true) {
|
|
1435
|
+
var _a13, _b3;
|
|
1436
|
+
i5 !== this.isConnected && (this.isConnected = i5, i5 ? (_a13 = this.reconnected) == null ? void 0 : _a13.call(this) : (_b3 = this.disconnected) == null ? void 0 : _b3.call(this)), t5 && (s4(this, i5), o6(this));
|
|
1437
|
+
}
|
|
1438
|
+
setValue(t5) {
|
|
1439
|
+
if (r4(this._$Ct)) this._$Ct._$AI(t5, this);
|
|
1440
|
+
else {
|
|
1441
|
+
const i5 = [...this._$Ct._$AH];
|
|
1442
|
+
i5[this._$Ci] = t5, this._$Ct._$AI(i5, this, 0);
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
disconnected() {
|
|
1446
|
+
}
|
|
1447
|
+
reconnected() {
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1451
|
+
// ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/node/directives/ref.js
|
|
1452
|
+
var e5 = () => new h4();
|
|
1453
|
+
var h4 = class {
|
|
1454
|
+
};
|
|
1455
|
+
var o7 = /* @__PURE__ */ new WeakMap();
|
|
1456
|
+
var n5 = e3(class extends f3 {
|
|
1457
|
+
render(i5) {
|
|
1458
|
+
return A;
|
|
1459
|
+
}
|
|
1460
|
+
update(i5, [s5]) {
|
|
1461
|
+
var _a13;
|
|
1462
|
+
const e6 = s5 !== this.G;
|
|
1463
|
+
return e6 && this.rt(void 0), (e6 || this.lt !== this.ct) && (this.G = s5, this.ht = (_a13 = i5.options) == null ? void 0 : _a13.host, this.rt(this.ct = i5.element)), A;
|
|
1464
|
+
}
|
|
1465
|
+
rt(t5) {
|
|
1466
|
+
var _a13;
|
|
1467
|
+
if (void 0 !== this.G) if (this.isConnected || (t5 = void 0), "function" == typeof this.G) {
|
|
1468
|
+
const i5 = (_a13 = this.ht) != null ? _a13 : globalThis;
|
|
1469
|
+
let s5 = o7.get(i5);
|
|
1470
|
+
void 0 === s5 && (s5 = /* @__PURE__ */ new WeakMap(), o7.set(i5, s5)), void 0 !== s5.get(this.G) && this.G.call(this.ht, void 0), s5.set(this.G, t5), void 0 !== t5 && this.G.call(this.ht, t5);
|
|
1471
|
+
} else this.G.value = t5;
|
|
1472
|
+
}
|
|
1473
|
+
get lt() {
|
|
1474
|
+
var _a13, _b3, _c;
|
|
1475
|
+
return "function" == typeof this.G ? (_b3 = o7.get((_a13 = this.ht) != null ? _a13 : globalThis)) == null ? void 0 : _b3.get(this.G) : (_c = this.G) == null ? void 0 : _c.value;
|
|
1476
|
+
}
|
|
1477
|
+
disconnected() {
|
|
1478
|
+
this.lt === this.ct && this.rt(void 0);
|
|
1479
|
+
}
|
|
1480
|
+
reconnected() {
|
|
1481
|
+
this.rt(this.ct);
|
|
1482
|
+
}
|
|
1483
|
+
});
|
|
1484
|
+
|
|
1485
|
+
// src/components/media/media.ts
|
|
1486
|
+
function httpUrl(value) {
|
|
1487
|
+
if (!value) return null;
|
|
1488
|
+
try {
|
|
1489
|
+
const { protocol } = new URL(value);
|
|
1490
|
+
return protocol === "https:" || protocol === "http:" ? value : null;
|
|
1491
|
+
} catch (e6) {
|
|
1492
|
+
return null;
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
function prefersReducedMotion() {
|
|
1496
|
+
var _a13, _b3;
|
|
1497
|
+
return (_b3 = (_a13 = globalThis.matchMedia) == null ? void 0 : _a13.call(globalThis, "(prefers-reduced-motion: reduce)").matches) != null ? _b3 : false;
|
|
1498
|
+
}
|
|
1499
|
+
function hasVideo(story, video) {
|
|
1500
|
+
return !video.failed && httpUrl(story.media_url) !== null;
|
|
1501
|
+
}
|
|
1502
|
+
function renderMedia(story, video) {
|
|
1503
|
+
const posterUrl = httpUrl(story.poster_url);
|
|
1504
|
+
const mediaUrl = httpUrl(story.media_url);
|
|
1505
|
+
return T`
|
|
1506
|
+
${posterUrl ? T`<img class="poster" alt="" src=${posterUrl} />` : A}
|
|
1507
|
+
${mediaUrl && !video.failed ? T`
|
|
1508
|
+
<video
|
|
1509
|
+
class="video"
|
|
1510
|
+
muted
|
|
1511
|
+
playsinline
|
|
1512
|
+
loop
|
|
1513
|
+
preload="metadata"
|
|
1514
|
+
.muted=${true}
|
|
1515
|
+
?autoplay=${!prefersReducedMotion()}
|
|
1516
|
+
poster=${posterUrl != null ? posterUrl : A}
|
|
1517
|
+
src=${mediaUrl}
|
|
1518
|
+
${n5(video.ref)}
|
|
1519
|
+
@play=${video.sync}
|
|
1520
|
+
@pause=${video.sync}
|
|
1521
|
+
@volumechange=${video.sync}
|
|
1522
|
+
@error=${video.fail}
|
|
1523
|
+
></video>
|
|
1524
|
+
` : A}
|
|
1525
|
+
`;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
// src/components/media/video-controller.ts
|
|
1529
|
+
function playVideo(video) {
|
|
1530
|
+
var _a13;
|
|
1531
|
+
(_a13 = video.play()) == null ? void 0 : _a13.catch(() => void 0);
|
|
1532
|
+
}
|
|
1533
|
+
var VideoController = class {
|
|
1534
|
+
constructor(host) {
|
|
1535
|
+
this.host = host;
|
|
1536
|
+
/** Bound to the <video> by renderMedia. */
|
|
1537
|
+
this.ref = e5();
|
|
1538
|
+
this.paused = true;
|
|
1539
|
+
// The video always starts muted: that is what browsers allow to autoplay.
|
|
1540
|
+
this.muted = true;
|
|
1541
|
+
/** The video could not load: only the cover is shown. */
|
|
1542
|
+
this.failed = false;
|
|
1543
|
+
/** Listener for the video's play, pause and volumechange events. */
|
|
1544
|
+
this.sync = () => {
|
|
1545
|
+
const video = this.ref.value;
|
|
1546
|
+
if (!video) return;
|
|
1547
|
+
this.paused = video.paused;
|
|
1548
|
+
this.muted = video.muted;
|
|
1549
|
+
this.host.requestUpdate();
|
|
1550
|
+
};
|
|
1551
|
+
/** Listener for the video's error event. */
|
|
1552
|
+
this.fail = () => {
|
|
1553
|
+
this.failed = true;
|
|
1554
|
+
this.host.requestUpdate();
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
/** For a new <video>, such as each time the player opens. */
|
|
1558
|
+
reset() {
|
|
1559
|
+
this.paused = true;
|
|
1560
|
+
this.muted = true;
|
|
1561
|
+
this.failed = false;
|
|
1562
|
+
}
|
|
1563
|
+
play() {
|
|
1564
|
+
const video = this.ref.value;
|
|
1565
|
+
if (video) playVideo(video);
|
|
1566
|
+
}
|
|
1567
|
+
pause() {
|
|
1568
|
+
var _a13;
|
|
1569
|
+
(_a13 = this.ref.value) == null ? void 0 : _a13.pause();
|
|
1570
|
+
}
|
|
1571
|
+
/** Plays again if the video plays on its own (see renderMedia). */
|
|
1572
|
+
resume() {
|
|
1573
|
+
const video = this.ref.value;
|
|
1574
|
+
if (video == null ? void 0 : video.autoplay) playVideo(video);
|
|
1575
|
+
}
|
|
1576
|
+
togglePlayback() {
|
|
1577
|
+
const video = this.ref.value;
|
|
1578
|
+
if (!video) return;
|
|
1579
|
+
if (video.paused) playVideo(video);
|
|
1580
|
+
else video.pause();
|
|
1581
|
+
}
|
|
1582
|
+
toggleMuted() {
|
|
1583
|
+
const video = this.ref.value;
|
|
1584
|
+
if (video) video.muted = !video.muted;
|
|
1585
|
+
}
|
|
1586
|
+
};
|
|
52
1587
|
|
|
53
1588
|
// src/components/card/card.ts
|
|
54
|
-
var cardStyles = `
|
|
1589
|
+
var cardStyles = i`
|
|
55
1590
|
.card {
|
|
56
1591
|
position: relative;
|
|
57
1592
|
box-sizing: border-box;
|
|
@@ -62,11 +1597,29 @@ var cardStyles = `
|
|
|
62
1597
|
background: #000;
|
|
63
1598
|
}
|
|
64
1599
|
|
|
65
|
-
|
|
1600
|
+
/* The card's button covers it. The focus ring goes on the card, since the
|
|
1601
|
+
card's overflow would clip the button's own. */
|
|
1602
|
+
.card-open {
|
|
1603
|
+
position: absolute;
|
|
1604
|
+
inset: 0;
|
|
1605
|
+
width: 100%;
|
|
1606
|
+
height: 100%;
|
|
1607
|
+
padding: 0;
|
|
1608
|
+
border: 0;
|
|
1609
|
+
background: transparent;
|
|
66
1610
|
cursor: pointer;
|
|
67
1611
|
}
|
|
68
1612
|
|
|
69
|
-
.
|
|
1613
|
+
.card-open:focus-visible {
|
|
1614
|
+
outline: none;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
.card:has(> .card-open:focus-visible) {
|
|
1618
|
+
outline: auto;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
.poster,
|
|
1622
|
+
.video {
|
|
70
1623
|
position: absolute;
|
|
71
1624
|
inset: 0;
|
|
72
1625
|
width: 100%;
|
|
@@ -102,6 +1655,29 @@ var cardStyles = `
|
|
|
102
1655
|
color: #fff;
|
|
103
1656
|
}
|
|
104
1657
|
|
|
1658
|
+
/* Sound on/off, at the top right of the card (as in the prototype). */
|
|
1659
|
+
.card-sound {
|
|
1660
|
+
position: absolute;
|
|
1661
|
+
top: 22px;
|
|
1662
|
+
right: 12px;
|
|
1663
|
+
z-index: 1;
|
|
1664
|
+
display: grid;
|
|
1665
|
+
width: 28px;
|
|
1666
|
+
height: 28px;
|
|
1667
|
+
place-items: center;
|
|
1668
|
+
padding: 0;
|
|
1669
|
+
border: 0;
|
|
1670
|
+
background: transparent;
|
|
1671
|
+
color: #fff;
|
|
1672
|
+
cursor: pointer;
|
|
1673
|
+
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
.card-sound .icon {
|
|
1677
|
+
width: 20px;
|
|
1678
|
+
height: 20px;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
105
1681
|
/* With a mouse, the play button shows only on hover or keyboard focus.
|
|
106
1682
|
Touch screens have no hover, so it stays visible there. */
|
|
107
1683
|
@media (hover: hover) and (pointer: fine) {
|
|
@@ -111,51 +1687,43 @@ var cardStyles = `
|
|
|
111
1687
|
}
|
|
112
1688
|
|
|
113
1689
|
.card:hover .play,
|
|
114
|
-
.card:focus-visible .play {
|
|
1690
|
+
.card-open:focus-visible .play {
|
|
115
1691
|
opacity: 1;
|
|
116
1692
|
transform: translate(-50%, -50%);
|
|
117
1693
|
}
|
|
118
1694
|
}
|
|
119
1695
|
`;
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
1696
|
+
function renderSoundButton(video, options) {
|
|
1697
|
+
return T`
|
|
1698
|
+
<button
|
|
1699
|
+
type="button"
|
|
1700
|
+
class="card-sound"
|
|
1701
|
+
aria-label=${video.muted ? options.soundOnLabel : options.soundOffLabel}
|
|
1702
|
+
@click=${() => video.toggleMuted()}
|
|
1703
|
+
>
|
|
1704
|
+
${icon(video.muted ? "soundOff" : "soundOn")}
|
|
1705
|
+
</button>
|
|
1706
|
+
`;
|
|
127
1707
|
}
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
play.className = "play";
|
|
144
|
-
play.setAttribute("aria-hidden", "true");
|
|
145
|
-
play.append(createIcon("play"));
|
|
146
|
-
card.append(play);
|
|
147
|
-
card.addEventListener("click", options.onSelect);
|
|
148
|
-
card.addEventListener("keydown", (event) => {
|
|
149
|
-
if (event.key !== "Enter" && event.key !== " ") return;
|
|
150
|
-
event.preventDefault();
|
|
151
|
-
options.onSelect();
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
return card;
|
|
1708
|
+
function renderCard(story, video, options) {
|
|
1709
|
+
return T`
|
|
1710
|
+
<div class="card">
|
|
1711
|
+
${renderMedia(story, video)}
|
|
1712
|
+
<button
|
|
1713
|
+
type="button"
|
|
1714
|
+
class="card-open"
|
|
1715
|
+
aria-label=${options.label}
|
|
1716
|
+
@click=${options.onSelect}
|
|
1717
|
+
>
|
|
1718
|
+
<span class="play" aria-hidden="true">${icon("play")}</span>
|
|
1719
|
+
</button>
|
|
1720
|
+
${hasVideo(story, video) && !video.paused ? renderSoundButton(video, options) : A}
|
|
1721
|
+
</div>
|
|
1722
|
+
`;
|
|
155
1723
|
}
|
|
156
1724
|
|
|
157
1725
|
// src/components/player/player.ts
|
|
158
|
-
var playerStyles = `
|
|
1726
|
+
var playerStyles = i`
|
|
159
1727
|
.player {
|
|
160
1728
|
position: fixed;
|
|
161
1729
|
inset: auto 16px 16px auto;
|
|
@@ -200,6 +1768,46 @@ var playerStyles = `
|
|
|
200
1768
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
|
|
201
1769
|
}
|
|
202
1770
|
|
|
1771
|
+
.player .card:has(.video) {
|
|
1772
|
+
cursor: pointer;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
/* Play/pause reuses the card's glass .play button, as a real button. */
|
|
1776
|
+
.player-toggle {
|
|
1777
|
+
padding: 0;
|
|
1778
|
+
border: 0;
|
|
1779
|
+
color: #fff;
|
|
1780
|
+
font: inherit;
|
|
1781
|
+
cursor: pointer;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
.player[data-paused] .player-toggle,
|
|
1785
|
+
.player-toggle:focus-visible {
|
|
1786
|
+
opacity: 1;
|
|
1787
|
+
transform: translate(-50%, -50%);
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
/* On touch, tapping the video pauses it; the button shows while paused. */
|
|
1791
|
+
@media (hover: none) {
|
|
1792
|
+
.player:not([data-paused]) .player-toggle {
|
|
1793
|
+
opacity: 0;
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
.player-sound {
|
|
1798
|
+
position: absolute;
|
|
1799
|
+
top: 12px;
|
|
1800
|
+
right: 12px;
|
|
1801
|
+
z-index: 1;
|
|
1802
|
+
border-color: transparent;
|
|
1803
|
+
background: rgba(0, 0, 0, 0.3);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
.player-sound .icon {
|
|
1807
|
+
width: 20px;
|
|
1808
|
+
height: 20px;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
203
1811
|
/* Above the card: on narrow screens the expanded card can cover them. */
|
|
204
1812
|
.player-controls {
|
|
205
1813
|
position: absolute;
|
|
@@ -284,8 +1892,12 @@ var playerStyles = `
|
|
|
284
1892
|
border-radius: 0;
|
|
285
1893
|
}
|
|
286
1894
|
|
|
1895
|
+
/* Below the sound button, at the top right of the video. Placed in the
|
|
1896
|
+
video frame, not the screen: the frame is centered, so on screens
|
|
1897
|
+
taller than 9:16 its top is below the screen's. */
|
|
287
1898
|
.player[data-expanded] .player-controls {
|
|
288
|
-
|
|
1899
|
+
position: absolute;
|
|
1900
|
+
top: 60px;
|
|
289
1901
|
right: 12px;
|
|
290
1902
|
}
|
|
291
1903
|
}
|
|
@@ -303,144 +1915,270 @@ var playerStyles = `
|
|
|
303
1915
|
}
|
|
304
1916
|
}
|
|
305
1917
|
`;
|
|
306
|
-
function
|
|
307
|
-
|
|
308
|
-
button.type = "button";
|
|
309
|
-
button.className = `player-button ${className}`;
|
|
310
|
-
button.setAttribute("aria-label", label);
|
|
311
|
-
button.append(createIcon(icon));
|
|
312
|
-
return button;
|
|
313
|
-
}
|
|
314
|
-
function supportsPopover(player) {
|
|
315
|
-
return typeof player.showPopover === "function";
|
|
316
|
-
}
|
|
317
|
-
function showPlayer(player) {
|
|
318
|
-
if (supportsPopover(player)) player.showPopover();
|
|
319
|
-
else player.show();
|
|
320
|
-
}
|
|
321
|
-
function createPlayer(story, options) {
|
|
322
|
-
const player = document.createElement("dialog");
|
|
323
|
-
player.className = "player";
|
|
324
|
-
player.setAttribute("popover", "manual");
|
|
325
|
-
player.setAttribute("aria-label", options.label);
|
|
326
|
-
const frame = document.createElement("div");
|
|
327
|
-
frame.className = "player-frame";
|
|
328
|
-
const controls = document.createElement("div");
|
|
329
|
-
controls.className = "player-controls";
|
|
330
|
-
const expand = createButton("player-expand", options.expandLabel, "expand");
|
|
331
|
-
const close = createButton("player-close", options.closeLabel, "close");
|
|
332
|
-
controls.append(expand, close);
|
|
333
|
-
let expanded = false;
|
|
334
|
-
function hide() {
|
|
335
|
-
if (!expanded && supportsPopover(player)) player.hidePopover();
|
|
336
|
-
else player.close();
|
|
337
|
-
}
|
|
338
|
-
expand.addEventListener("click", () => {
|
|
339
|
-
hide();
|
|
340
|
-
expanded = !expanded;
|
|
341
|
-
player.toggleAttribute("data-expanded", expanded);
|
|
342
|
-
player.dataset.switched = "";
|
|
343
|
-
expand.setAttribute(
|
|
344
|
-
"aria-label",
|
|
345
|
-
expanded ? options.collapseLabel : options.expandLabel
|
|
346
|
-
);
|
|
347
|
-
expand.replaceChildren(createIcon(expanded ? "collapse" : "expand"));
|
|
348
|
-
if (expanded) player.showModal();
|
|
349
|
-
else showPlayer(player);
|
|
350
|
-
expand.focus();
|
|
351
|
-
});
|
|
352
|
-
close.addEventListener("click", options.onClose);
|
|
353
|
-
player.addEventListener("click", (event) => {
|
|
354
|
-
if (expanded && event.target === player) options.onClose();
|
|
355
|
-
});
|
|
356
|
-
player.addEventListener("cancel", (event) => {
|
|
357
|
-
event.preventDefault();
|
|
358
|
-
options.onClose();
|
|
359
|
-
});
|
|
360
|
-
frame.append(controls, createCard(story));
|
|
361
|
-
player.append(frame);
|
|
362
|
-
return player;
|
|
1918
|
+
function supportsPopover(dialog) {
|
|
1919
|
+
return typeof dialog.showPopover === "function";
|
|
363
1920
|
}
|
|
1921
|
+
var PlayerController = class {
|
|
1922
|
+
constructor(host, options) {
|
|
1923
|
+
this.host = host;
|
|
1924
|
+
this.options = options;
|
|
1925
|
+
/** Rendered and, once the host has updated, shown. */
|
|
1926
|
+
this.isOpen = false;
|
|
1927
|
+
this.expanded = false;
|
|
1928
|
+
/** Switched modes at least once: only the first opening fades in. */
|
|
1929
|
+
this.switched = false;
|
|
1930
|
+
/** The dialog is showing, in the mode `expanded` says. */
|
|
1931
|
+
this.shown = false;
|
|
1932
|
+
this.dialog = e5();
|
|
1933
|
+
this.expandButton = e5();
|
|
1934
|
+
this.closeButton = e5();
|
|
1935
|
+
this.toggleExpanded = async () => {
|
|
1936
|
+
var _a13;
|
|
1937
|
+
const dialog = this.dialog.value;
|
|
1938
|
+
if (!dialog) return;
|
|
1939
|
+
this.hide(dialog);
|
|
1940
|
+
this.expanded = !this.expanded;
|
|
1941
|
+
this.switched = true;
|
|
1942
|
+
this.host.requestUpdate();
|
|
1943
|
+
await this.host.updateComplete;
|
|
1944
|
+
if (!this.isOpen) return;
|
|
1945
|
+
this.show(dialog);
|
|
1946
|
+
(_a13 = this.expandButton.value) == null ? void 0 : _a13.focus();
|
|
1947
|
+
};
|
|
1948
|
+
// Escape anywhere on the page, also in the mini player, which is not modal.
|
|
1949
|
+
this.onKeyDown = (event) => {
|
|
1950
|
+
if (event.key === "Escape") this.options.onClose();
|
|
1951
|
+
};
|
|
1952
|
+
// Clicks on the backdrop of the expanded view reach the dialog itself.
|
|
1953
|
+
this.onDialogClick = (event) => {
|
|
1954
|
+
if (this.expanded && event.target === event.currentTarget) {
|
|
1955
|
+
this.options.onClose();
|
|
1956
|
+
}
|
|
1957
|
+
};
|
|
1958
|
+
// Escape on a modal dialog would only hide it: close the player instead.
|
|
1959
|
+
this.onCancel = (event) => {
|
|
1960
|
+
event.preventDefault();
|
|
1961
|
+
this.options.onClose();
|
|
1962
|
+
};
|
|
1963
|
+
host.addController(this);
|
|
1964
|
+
this.video = new VideoController(host);
|
|
1965
|
+
}
|
|
1966
|
+
hostDisconnected() {
|
|
1967
|
+
this.close();
|
|
1968
|
+
}
|
|
1969
|
+
/** Opens the mini player, plays the video and focuses the close button. */
|
|
1970
|
+
async open() {
|
|
1971
|
+
var _a13;
|
|
1972
|
+
if (this.isOpen) return;
|
|
1973
|
+
document.addEventListener("keydown", this.onKeyDown);
|
|
1974
|
+
this.isOpen = true;
|
|
1975
|
+
this.expanded = false;
|
|
1976
|
+
this.switched = false;
|
|
1977
|
+
this.video.reset();
|
|
1978
|
+
this.host.requestUpdate();
|
|
1979
|
+
await this.host.updateComplete;
|
|
1980
|
+
const dialog = this.dialog.value;
|
|
1981
|
+
if (!this.isOpen || !dialog) return;
|
|
1982
|
+
this.show(dialog);
|
|
1983
|
+
this.video.play();
|
|
1984
|
+
(_a13 = this.closeButton.value) == null ? void 0 : _a13.focus();
|
|
1985
|
+
}
|
|
1986
|
+
/** Hides the player now; the host removes it on its next update. */
|
|
1987
|
+
close() {
|
|
1988
|
+
if (!this.isOpen) return;
|
|
1989
|
+
document.removeEventListener("keydown", this.onKeyDown);
|
|
1990
|
+
const dialog = this.dialog.value;
|
|
1991
|
+
if (dialog) this.hide(dialog);
|
|
1992
|
+
this.isOpen = false;
|
|
1993
|
+
this.host.requestUpdate();
|
|
1994
|
+
}
|
|
1995
|
+
// Mini: a manual popover, or a non-modal dialog without popover support.
|
|
1996
|
+
// Expanded: a modal dialog.
|
|
1997
|
+
// Already showing: a second expand click in the same task resumes after the
|
|
1998
|
+
// first one has shown the dialog, and showing it again would throw.
|
|
1999
|
+
show(dialog) {
|
|
2000
|
+
if (this.shown) return;
|
|
2001
|
+
if (this.expanded) dialog.showModal();
|
|
2002
|
+
else if (supportsPopover(dialog)) dialog.showPopover();
|
|
2003
|
+
else dialog.show();
|
|
2004
|
+
this.shown = true;
|
|
2005
|
+
}
|
|
2006
|
+
// A dialog can't be shown as a popover and as a modal at the same time, so
|
|
2007
|
+
// switching modes hides it first, the same way it was shown.
|
|
2008
|
+
hide(dialog) {
|
|
2009
|
+
if (!this.shown) return;
|
|
2010
|
+
if (!this.expanded && supportsPopover(dialog)) dialog.hidePopover();
|
|
2011
|
+
else dialog.close();
|
|
2012
|
+
this.shown = false;
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* Play/pause in the middle of the video and sound on/off at its top right.
|
|
2016
|
+
* They follow the video's own events, so a blocked autoplay shows as
|
|
2017
|
+
* paused.
|
|
2018
|
+
*/
|
|
2019
|
+
renderVideoControls() {
|
|
2020
|
+
const { video, options } = this;
|
|
2021
|
+
const onToggle = (event) => {
|
|
2022
|
+
event.stopPropagation();
|
|
2023
|
+
video.togglePlayback();
|
|
2024
|
+
};
|
|
2025
|
+
const onSound = (event) => {
|
|
2026
|
+
event.stopPropagation();
|
|
2027
|
+
video.toggleMuted();
|
|
2028
|
+
};
|
|
2029
|
+
return T`
|
|
2030
|
+
<button
|
|
2031
|
+
type="button"
|
|
2032
|
+
class="play player-toggle"
|
|
2033
|
+
aria-label=${video.paused ? options.playLabel : options.pauseLabel}
|
|
2034
|
+
@click=${onToggle}
|
|
2035
|
+
>
|
|
2036
|
+
${icon(video.paused ? "play" : "pause")}
|
|
2037
|
+
</button>
|
|
2038
|
+
<button
|
|
2039
|
+
type="button"
|
|
2040
|
+
class="player-button player-sound"
|
|
2041
|
+
aria-label=${video.muted ? options.soundOnLabel : options.soundOffLabel}
|
|
2042
|
+
@click=${onSound}
|
|
2043
|
+
>
|
|
2044
|
+
${icon(video.muted ? "soundOff" : "soundOn")}
|
|
2045
|
+
</button>
|
|
2046
|
+
`;
|
|
2047
|
+
}
|
|
2048
|
+
/**
|
|
2049
|
+
* The player <dialog> while it is open. Clicking the video also plays or
|
|
2050
|
+
* pauses it.
|
|
2051
|
+
*/
|
|
2052
|
+
render(story) {
|
|
2053
|
+
if (!this.isOpen) return A;
|
|
2054
|
+
const { video, options, expanded } = this;
|
|
2055
|
+
const withVideo = hasVideo(story, video);
|
|
2056
|
+
return T`
|
|
2057
|
+
<dialog
|
|
2058
|
+
class="player"
|
|
2059
|
+
popover="manual"
|
|
2060
|
+
aria-label=${options.label}
|
|
2061
|
+
?data-expanded=${expanded}
|
|
2062
|
+
?data-switched=${this.switched}
|
|
2063
|
+
?data-paused=${withVideo && video.paused}
|
|
2064
|
+
${n5(this.dialog)}
|
|
2065
|
+
@click=${this.onDialogClick}
|
|
2066
|
+
@cancel=${this.onCancel}
|
|
2067
|
+
>
|
|
2068
|
+
<div class="player-frame">
|
|
2069
|
+
<div class="player-controls">
|
|
2070
|
+
<button
|
|
2071
|
+
type="button"
|
|
2072
|
+
class="player-button player-expand"
|
|
2073
|
+
aria-label=${expanded ? options.collapseLabel : options.expandLabel}
|
|
2074
|
+
${n5(this.expandButton)}
|
|
2075
|
+
@click=${this.toggleExpanded}
|
|
2076
|
+
>
|
|
2077
|
+
${icon(expanded ? "collapse" : "expand")}
|
|
2078
|
+
</button>
|
|
2079
|
+
<button
|
|
2080
|
+
type="button"
|
|
2081
|
+
class="player-button player-close"
|
|
2082
|
+
aria-label=${options.closeLabel}
|
|
2083
|
+
${n5(this.closeButton)}
|
|
2084
|
+
@click=${options.onClose}
|
|
2085
|
+
>
|
|
2086
|
+
${icon("close")}
|
|
2087
|
+
</button>
|
|
2088
|
+
</div>
|
|
2089
|
+
<div class="card" @click=${() => video.togglePlayback()}>
|
|
2090
|
+
${renderMedia(story, video)}
|
|
2091
|
+
${withVideo ? this.renderVideoControls() : A}
|
|
2092
|
+
</div>
|
|
2093
|
+
</div>
|
|
2094
|
+
</dialog>
|
|
2095
|
+
`;
|
|
2096
|
+
}
|
|
2097
|
+
};
|
|
364
2098
|
|
|
365
2099
|
// src/story/story.ts
|
|
366
2100
|
var TAG_NAME = "vtex-ads-story";
|
|
367
|
-
var _a;
|
|
368
|
-
var BaseElement = (_a = globalThis.HTMLElement) != null ? _a : Object;
|
|
369
|
-
var styles = `
|
|
370
|
-
:host {
|
|
371
|
-
display: block;
|
|
372
|
-
font-family: var(--vtex-ads-story-font-family, inherit);
|
|
373
|
-
color: var(--vtex-ads-story-color-text, inherit);
|
|
374
|
-
}
|
|
375
|
-
${cardStyles}
|
|
376
|
-
${playerStyles}
|
|
377
|
-
`;
|
|
378
2101
|
var PLACEHOLDER_STORY = {
|
|
379
|
-
|
|
380
|
-
|
|
2102
|
+
poster_url: "https://dummyimage.com/1080x1920/e31c57/fff",
|
|
2103
|
+
media_url: "https://samplelib.com/mp4/sample-10s-vp9.mp4"
|
|
381
2104
|
};
|
|
382
2105
|
var LABELS = {
|
|
383
2106
|
watch: "Assistir v\xEDdeo",
|
|
384
2107
|
player: "V\xEDdeo",
|
|
385
2108
|
expand: "Expandir v\xEDdeo",
|
|
386
2109
|
collapse: "Reduzir v\xEDdeo",
|
|
387
|
-
close: "Fechar v\xEDdeo"
|
|
2110
|
+
close: "Fechar v\xEDdeo",
|
|
2111
|
+
play: "Reproduzir v\xEDdeo",
|
|
2112
|
+
pause: "Pausar v\xEDdeo",
|
|
2113
|
+
soundOn: "Ativar som",
|
|
2114
|
+
soundOff: "Desativar som"
|
|
388
2115
|
};
|
|
389
|
-
var VtexAdsStoryElement = class extends
|
|
2116
|
+
var VtexAdsStoryElement = class extends i3 {
|
|
390
2117
|
constructor() {
|
|
391
2118
|
super(...arguments);
|
|
392
|
-
this.
|
|
393
|
-
this.
|
|
394
|
-
if (event.key === "Escape") this.closePlayer();
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
render() {
|
|
398
|
-
var _a2;
|
|
399
|
-
const container = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(".root");
|
|
400
|
-
if (!container) return;
|
|
401
|
-
container.replaceChildren(
|
|
402
|
-
createCard(PLACEHOLDER_STORY, {
|
|
403
|
-
label: LABELS.watch,
|
|
404
|
-
onSelect: () => this.openPlayer()
|
|
405
|
-
})
|
|
406
|
-
);
|
|
407
|
-
}
|
|
408
|
-
openPlayer() {
|
|
409
|
-
var _a2;
|
|
410
|
-
if (this.player || !this.shadowRoot) return;
|
|
411
|
-
this.player = createPlayer(PLACEHOLDER_STORY, {
|
|
2119
|
+
this.cardVideo = new VideoController(this);
|
|
2120
|
+
this.player = new PlayerController(this, {
|
|
412
2121
|
label: LABELS.player,
|
|
413
2122
|
expandLabel: LABELS.expand,
|
|
414
2123
|
collapseLabel: LABELS.collapse,
|
|
415
2124
|
closeLabel: LABELS.close,
|
|
2125
|
+
playLabel: LABELS.play,
|
|
2126
|
+
pauseLabel: LABELS.pause,
|
|
2127
|
+
soundOnLabel: LABELS.soundOn,
|
|
2128
|
+
soundOffLabel: LABELS.soundOff,
|
|
416
2129
|
onClose: () => this.closePlayer()
|
|
417
2130
|
});
|
|
418
|
-
this.shadowRoot.append(this.player);
|
|
419
|
-
showPlayer(this.player);
|
|
420
|
-
document.addEventListener("keydown", this.onKeyDown);
|
|
421
|
-
(_a2 = this.player.querySelector(".player-close")) == null ? void 0 : _a2.focus();
|
|
422
|
-
}
|
|
423
|
-
closePlayer({ restoreFocus = true } = {}) {
|
|
424
|
-
var _a2, _b;
|
|
425
|
-
if (!this.player) return;
|
|
426
|
-
document.removeEventListener("keydown", this.onKeyDown);
|
|
427
|
-
this.player.remove();
|
|
428
|
-
this.player = null;
|
|
429
|
-
if (restoreFocus) {
|
|
430
|
-
(_b = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(".root .card")) == null ? void 0 : _b.focus();
|
|
431
|
-
}
|
|
432
2131
|
}
|
|
2132
|
+
// Lit keeps the card's DOM when the element is moved (removed and appended
|
|
2133
|
+
// again), but the browser pauses a removed video and doesn't autoplay it
|
|
2134
|
+
// again. resume() only plays a video that autoplays (not with reduced
|
|
2135
|
+
// motion), and does nothing on the first connection, before the render.
|
|
2136
|
+
// Not in VideoController.hostConnected: there, the player's video is still
|
|
2137
|
+
// in the DOM until the next update and would play for a moment.
|
|
433
2138
|
connectedCallback() {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
root.innerHTML = `<style>${styles}</style><div class="root"></div>`;
|
|
437
|
-
}
|
|
438
|
-
this.render();
|
|
2139
|
+
super.connectedCallback();
|
|
2140
|
+
this.cardVideo.resume();
|
|
439
2141
|
}
|
|
440
|
-
|
|
441
|
-
this.
|
|
2142
|
+
openPlayer() {
|
|
2143
|
+
if (this.player.isOpen) return;
|
|
2144
|
+
this.cardVideo.pause();
|
|
2145
|
+
void this.player.open();
|
|
2146
|
+
}
|
|
2147
|
+
// The player also closes on its own when the element leaves the page,
|
|
2148
|
+
// without this: there is no card to give focus back to or to resume playing
|
|
2149
|
+
// (it would play out of sight).
|
|
2150
|
+
closePlayer() {
|
|
2151
|
+
var _a13;
|
|
2152
|
+
if (!this.player.isOpen) return;
|
|
2153
|
+
this.player.close();
|
|
2154
|
+
this.cardVideo.resume();
|
|
2155
|
+
(_a13 = this.renderRoot.querySelector(".root .card-open")) == null ? void 0 : _a13.focus();
|
|
2156
|
+
}
|
|
2157
|
+
render() {
|
|
2158
|
+
return T`
|
|
2159
|
+
<div class="root">
|
|
2160
|
+
${renderCard(PLACEHOLDER_STORY, this.cardVideo, {
|
|
2161
|
+
label: LABELS.watch,
|
|
2162
|
+
soundOnLabel: LABELS.soundOn,
|
|
2163
|
+
soundOffLabel: LABELS.soundOff,
|
|
2164
|
+
onSelect: () => this.openPlayer()
|
|
2165
|
+
})}
|
|
2166
|
+
</div>
|
|
2167
|
+
${this.player.render(PLACEHOLDER_STORY)}
|
|
2168
|
+
`;
|
|
442
2169
|
}
|
|
443
2170
|
};
|
|
2171
|
+
VtexAdsStoryElement.styles = [
|
|
2172
|
+
i`
|
|
2173
|
+
:host {
|
|
2174
|
+
display: block;
|
|
2175
|
+
font-family: var(--vtex-ads-story-font-family, inherit);
|
|
2176
|
+
color: var(--vtex-ads-story-color-text, inherit);
|
|
2177
|
+
}
|
|
2178
|
+
`,
|
|
2179
|
+
cardStyles,
|
|
2180
|
+
playerStyles
|
|
2181
|
+
];
|
|
444
2182
|
function defineVtexAdsStories() {
|
|
445
2183
|
if (typeof customElements === "undefined") return;
|
|
446
2184
|
if (customElements.get(TAG_NAME)) return;
|
|
@@ -453,4 +2191,56 @@ function defineVtexAdsStories() {
|
|
|
453
2191
|
defineVtexAdsStories
|
|
454
2192
|
});
|
|
455
2193
|
/*! Icons from Phosphor Icons (https://phosphoricons.com), MIT License, Copyright (c) 2023 Phosphor Icons */
|
|
2194
|
+
/*! Bundled license information:
|
|
2195
|
+
|
|
2196
|
+
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|
|
2197
|
+
@lit-labs/ssr-dom-shim/lib/events.js:
|
|
2198
|
+
(**
|
|
2199
|
+
* @license
|
|
2200
|
+
* Copyright 2023 Google LLC
|
|
2201
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2202
|
+
*)
|
|
2203
|
+
|
|
2204
|
+
@lit-labs/ssr-dom-shim/lib/css.js:
|
|
2205
|
+
@lit-labs/ssr-dom-shim/lib/observers.js:
|
|
2206
|
+
(**
|
|
2207
|
+
* @license
|
|
2208
|
+
* Copyright 2024 Google LLC
|
|
2209
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2210
|
+
*)
|
|
2211
|
+
|
|
2212
|
+
@lit-labs/ssr-dom-shim/index.js:
|
|
2213
|
+
@lit/reactive-element/node/css-tag.js:
|
|
2214
|
+
(**
|
|
2215
|
+
* @license
|
|
2216
|
+
* Copyright 2019 Google LLC
|
|
2217
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2218
|
+
*)
|
|
2219
|
+
|
|
2220
|
+
lit-html/node/lit-html.js:
|
|
2221
|
+
lit-element/lit-element.js:
|
|
2222
|
+
lit-html/node/directive.js:
|
|
2223
|
+
lit-html/node/directives/unsafe-html.js:
|
|
2224
|
+
lit-html/node/async-directive.js:
|
|
2225
|
+
(**
|
|
2226
|
+
* @license
|
|
2227
|
+
* Copyright 2017 Google LLC
|
|
2228
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2229
|
+
*)
|
|
2230
|
+
|
|
2231
|
+
lit-html/node/is-server.js:
|
|
2232
|
+
(**
|
|
2233
|
+
* @license
|
|
2234
|
+
* Copyright 2022 Google LLC
|
|
2235
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2236
|
+
*)
|
|
2237
|
+
|
|
2238
|
+
lit-html/node/directive-helpers.js:
|
|
2239
|
+
lit-html/node/directives/ref.js:
|
|
2240
|
+
(**
|
|
2241
|
+
* @license
|
|
2242
|
+
* Copyright 2020 Google LLC
|
|
2243
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2244
|
+
*)
|
|
2245
|
+
*/
|
|
456
2246
|
//# sourceMappingURL=index.cjs.map
|