@dreamsengine/dreams-ad-engine 0.1.6 → 0.2.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.
@@ -1,34 +1,608 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function e(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=e(i);fetch(i.href,o)}})();/**
1
+ /**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const I=globalThis,V=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,at=Symbol(),G=new WeakMap;let vt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==at)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(V&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=G.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&G.set(e,t))}return t}toString(){return this.cssText}};const dt=n=>new vt(typeof n=="string"?n:n+"",void 0,at),$t=(n,t)=>{if(V)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=I.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},K=V?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return dt(e)})(n):n;/**
5
+ */
6
+ const j = globalThis, Z = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ut = Symbol(), tt = /* @__PURE__ */ new WeakMap();
7
+ let zt = class {
8
+ constructor(t, e, i) {
9
+ if (this._$cssResult$ = !0, i !== ut) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
+ this.cssText = t, this.t = e;
11
+ }
12
+ get styleSheet() {
13
+ let t = this.o;
14
+ const e = this.t;
15
+ if (Z && t === void 0) {
16
+ const i = e !== void 0 && e.length === 1;
17
+ i && (t = tt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && tt.set(e, t));
18
+ }
19
+ return t;
20
+ }
21
+ toString() {
22
+ return this.cssText;
23
+ }
24
+ };
25
+ const ft = (n) => new zt(typeof n == "string" ? n : n + "", void 0, ut), Et = (n, t) => {
26
+ if (Z) n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
27
+ else for (const e of t) {
28
+ const i = document.createElement("style"), s = j.litNonce;
29
+ s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, n.appendChild(i);
30
+ }
31
+ }, et = Z ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
32
+ let e = "";
33
+ for (const i of t.cssRules) e += i.cssText;
34
+ return ft(e);
35
+ })(n) : n;
36
+ /**
6
37
  * @license
7
38
  * Copyright 2017 Google LLC
8
39
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:yt,defineProperty:_t,getOwnPropertyDescriptor:mt,getOwnPropertyNames:bt,getOwnPropertySymbols:At,getPrototypeOf:wt}=Object,_=globalThis,Z=_.trustedTypes,St=Z?Z.emptyScript:"",B=_.reactiveElementPolyfillSupport,x=(n,t)=>n,H={toAttribute(n,t){switch(t){case Boolean:n=n?St:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},J=(n,t)=>!yt(n,t),Q={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:J};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class w extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Q){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&_t(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=mt(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i==null?void 0:i.call(this)},set(r){const d=i==null?void 0:i.call(this);o.call(this,r),this.requestUpdate(t,d,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Q}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=wt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const e=this.properties,s=[...bt(e),...At(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(K(i))}else t!==void 0&&e.push(K(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return $t(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var o;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const r=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:H).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),d=typeof r.converter=="function"?{fromAttribute:r.converter}:((o=r.converter)==null?void 0:o.fromAttribute)!==void 0?r.converter:H;this._$Em=i,this[i]=d.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??J)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,r]of i)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],r)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[x("elementProperties")]=new Map,w[x("finalized")]=new Map,B==null||B({ReactiveElement:w}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.4");/**
40
+ */
41
+ const { is: xt, defineProperty: It, getOwnPropertyDescriptor: Pt, getOwnPropertyNames: Ct, getOwnPropertySymbols: Ut, getPrototypeOf: Tt } = Object, m = globalThis, it = m.trustedTypes, kt = it ? it.emptyScript : "", q = m.reactiveElementPolyfillSupport, U = (n, t) => n, B = { toAttribute(n, t) {
42
+ switch (t) {
43
+ case Boolean:
44
+ n = n ? kt : null;
45
+ break;
46
+ case Object:
47
+ case Array:
48
+ n = n == null ? n : JSON.stringify(n);
49
+ }
50
+ return n;
51
+ }, fromAttribute(n, t) {
52
+ let e = n;
53
+ switch (t) {
54
+ case Boolean:
55
+ e = n !== null;
56
+ break;
57
+ case Number:
58
+ e = n === null ? null : Number(n);
59
+ break;
60
+ case Object:
61
+ case Array:
62
+ try {
63
+ e = JSON.parse(n);
64
+ } catch {
65
+ e = null;
66
+ }
67
+ }
68
+ return e;
69
+ } }, Y = (n, t) => !xt(n, t), st = { attribute: !0, type: String, converter: B, reflect: !1, useDefault: !1, hasChanged: Y };
70
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), m.litPropertyMetadata ?? (m.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
71
+ let z = class extends HTMLElement {
72
+ static addInitializer(t) {
73
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
74
+ }
75
+ static get observedAttributes() {
76
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
77
+ }
78
+ static createProperty(t, e = st) {
79
+ if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
80
+ const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
81
+ s !== void 0 && It(this.prototype, t, s);
82
+ }
83
+ }
84
+ static getPropertyDescriptor(t, e, i) {
85
+ const { get: s, set: o } = Pt(this.prototype, t) ?? { get() {
86
+ return this[e];
87
+ }, set(r) {
88
+ this[e] = r;
89
+ } };
90
+ return { get: s, set(r) {
91
+ const a = s == null ? void 0 : s.call(this);
92
+ o == null || o.call(this, r), this.requestUpdate(t, a, i);
93
+ }, configurable: !0, enumerable: !0 };
94
+ }
95
+ static getPropertyOptions(t) {
96
+ return this.elementProperties.get(t) ?? st;
97
+ }
98
+ static _$Ei() {
99
+ if (this.hasOwnProperty(U("elementProperties"))) return;
100
+ const t = Tt(this);
101
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
102
+ }
103
+ static finalize() {
104
+ if (this.hasOwnProperty(U("finalized"))) return;
105
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(U("properties"))) {
106
+ const e = this.properties, i = [...Ct(e), ...Ut(e)];
107
+ for (const s of i) this.createProperty(s, e[s]);
108
+ }
109
+ const t = this[Symbol.metadata];
110
+ if (t !== null) {
111
+ const e = litPropertyMetadata.get(t);
112
+ if (e !== void 0) for (const [i, s] of e) this.elementProperties.set(i, s);
113
+ }
114
+ this._$Eh = /* @__PURE__ */ new Map();
115
+ for (const [e, i] of this.elementProperties) {
116
+ const s = this._$Eu(e, i);
117
+ s !== void 0 && this._$Eh.set(s, e);
118
+ }
119
+ this.elementStyles = this.finalizeStyles(this.styles);
120
+ }
121
+ static finalizeStyles(t) {
122
+ const e = [];
123
+ if (Array.isArray(t)) {
124
+ const i = new Set(t.flat(1 / 0).reverse());
125
+ for (const s of i) e.unshift(et(s));
126
+ } else t !== void 0 && e.push(et(t));
127
+ return e;
128
+ }
129
+ static _$Eu(t, e) {
130
+ const i = e.attribute;
131
+ return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
132
+ }
133
+ constructor() {
134
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
135
+ }
136
+ _$Ev() {
137
+ var t;
138
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
139
+ }
140
+ addController(t) {
141
+ var e;
142
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
143
+ }
144
+ removeController(t) {
145
+ var e;
146
+ (e = this._$EO) == null || e.delete(t);
147
+ }
148
+ _$E_() {
149
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
150
+ for (const i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
151
+ t.size > 0 && (this._$Ep = t);
152
+ }
153
+ createRenderRoot() {
154
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
155
+ return Et(t, this.constructor.elementStyles), t;
156
+ }
157
+ connectedCallback() {
158
+ var t;
159
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
160
+ var i;
161
+ return (i = e.hostConnected) == null ? void 0 : i.call(e);
162
+ });
163
+ }
164
+ enableUpdating(t) {
165
+ }
166
+ disconnectedCallback() {
167
+ var t;
168
+ (t = this._$EO) == null || t.forEach((e) => {
169
+ var i;
170
+ return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
171
+ });
172
+ }
173
+ attributeChangedCallback(t, e, i) {
174
+ this._$AK(t, i);
175
+ }
176
+ _$ET(t, e) {
177
+ var o;
178
+ const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
179
+ if (s !== void 0 && i.reflect === !0) {
180
+ const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : B).toAttribute(e, i.type);
181
+ this._$Em = t, r == null ? this.removeAttribute(s) : this.setAttribute(s, r), this._$Em = null;
182
+ }
183
+ }
184
+ _$AK(t, e) {
185
+ var o, r;
186
+ const i = this.constructor, s = i._$Eh.get(t);
187
+ if (s !== void 0 && this._$Em !== s) {
188
+ const a = i.getPropertyOptions(s), d = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : B;
189
+ this._$Em = s;
190
+ const h = d.fromAttribute(e, a.type);
191
+ this[s] = h ?? ((r = this._$Ej) == null ? void 0 : r.get(s)) ?? h, this._$Em = null;
192
+ }
193
+ }
194
+ requestUpdate(t, e, i, s = !1, o) {
195
+ var r;
196
+ if (t !== void 0) {
197
+ const a = this.constructor;
198
+ if (s === !1 && (o = this[t]), i ?? (i = a.getPropertyOptions(t)), !((i.hasChanged ?? Y)(o, e) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(t)) && !this.hasAttribute(a._$Eu(t, i)))) return;
199
+ this.C(t, e, i);
200
+ }
201
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
202
+ }
203
+ C(t, e, { useDefault: i, reflect: s, wrapped: o }, r) {
204
+ i && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, r ?? e ?? this[t]), o !== !0 || r !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), s === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
205
+ }
206
+ async _$EP() {
207
+ this.isUpdatePending = !0;
208
+ try {
209
+ await this._$ES;
210
+ } catch (e) {
211
+ Promise.reject(e);
212
+ }
213
+ const t = this.scheduleUpdate();
214
+ return t != null && await t, !this.isUpdatePending;
215
+ }
216
+ scheduleUpdate() {
217
+ return this.performUpdate();
218
+ }
219
+ performUpdate() {
220
+ var i;
221
+ if (!this.isUpdatePending) return;
222
+ if (!this.hasUpdated) {
223
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
224
+ for (const [o, r] of this._$Ep) this[o] = r;
225
+ this._$Ep = void 0;
226
+ }
227
+ const s = this.constructor.elementProperties;
228
+ if (s.size > 0) for (const [o, r] of s) {
229
+ const { wrapped: a } = r, d = this[o];
230
+ a !== !0 || this._$AL.has(o) || d === void 0 || this.C(o, void 0, r, d);
231
+ }
232
+ }
233
+ let t = !1;
234
+ const e = this._$AL;
235
+ try {
236
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$EO) == null || i.forEach((s) => {
237
+ var o;
238
+ return (o = s.hostUpdate) == null ? void 0 : o.call(s);
239
+ }), this.update(e)) : this._$EM();
240
+ } catch (s) {
241
+ throw t = !1, this._$EM(), s;
242
+ }
243
+ t && this._$AE(e);
244
+ }
245
+ willUpdate(t) {
246
+ }
247
+ _$AE(t) {
248
+ var e;
249
+ (e = this._$EO) == null || e.forEach((i) => {
250
+ var s;
251
+ return (s = i.hostUpdated) == null ? void 0 : s.call(i);
252
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
253
+ }
254
+ _$EM() {
255
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
256
+ }
257
+ get updateComplete() {
258
+ return this.getUpdateComplete();
259
+ }
260
+ getUpdateComplete() {
261
+ return this._$ES;
262
+ }
263
+ shouldUpdate(t) {
264
+ return !0;
265
+ }
266
+ update(t) {
267
+ this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
268
+ }
269
+ updated(t) {
270
+ }
271
+ firstUpdated(t) {
272
+ }
273
+ };
274
+ z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, z[U("elementProperties")] = /* @__PURE__ */ new Map(), z[U("finalized")] = /* @__PURE__ */ new Map(), q == null || q({ ReactiveElement: z }), (m.reactiveElementVersions ?? (m.reactiveElementVersions = [])).push("2.1.2");
275
+ /**
10
276
  * @license
11
277
  * Copyright 2017 Google LLC
12
278
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const U=globalThis,R=U.trustedTypes,X=R?R.createPolicy("lit-html",{createHTML:n=>n}):void 0,lt="$lit$",y=`lit$${Math.random().toFixed(9).slice(2)}$`,ht="?"+y,Et=`<${ht}>`,A=document,O=()=>A.createComment(""),T=n=>n===null||typeof n!="object"&&typeof n!="function",F=Array.isArray,Pt=n=>F(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",j=`[
14
- \f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,tt=/>/g,m=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),et=/'/g,it=/"/g,ct=/^(?:script|style|textarea|title)$/i,Ct=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),C=Ct(1),S=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),st=new WeakMap,b=A.createTreeWalker(A,129);function pt(n,t){if(!F(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return X!==void 0?X.createHTML(t):t}const xt=(n,t)=>{const e=n.length-1,s=[];let i,o=t===2?"<svg>":t===3?"<math>":"",r=P;for(let d=0;d<e;d++){const a=n[d];let c,u,h=-1,v=0;for(;v<a.length&&(r.lastIndex=v,u=r.exec(a),u!==null);)v=r.lastIndex,r===P?u[1]==="!--"?r=Y:u[1]!==void 0?r=tt:u[2]!==void 0?(ct.test(u[2])&&(i=RegExp("</"+u[2],"g")),r=m):u[3]!==void 0&&(r=m):r===m?u[0]===">"?(r=i??P,h=-1):u[1]===void 0?h=-2:(h=r.lastIndex-u[2].length,c=u[1],r=u[3]===void 0?m:u[3]==='"'?it:et):r===it||r===et?r=m:r===Y||r===tt?r=P:(r=m,i=void 0);const $=r===m&&n[d+1].startsWith("/>")?" ":"";o+=r===P?a+Et:h>=0?(s.push(c),a.slice(0,h)+lt+a.slice(h)+y+$):a+y+(h===-2?d:$)}return[pt(n,o+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class L{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,r=0;const d=t.length-1,a=this.parts,[c,u]=xt(t,e);if(this.el=L.createElement(c,s),b.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=b.nextNode())!==null&&a.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(const h of i.getAttributeNames())if(h.endsWith(lt)){const v=u[r++],$=i.getAttribute(h).split(y),k=/([.?@])?(.*)/.exec(v);a.push({type:1,index:o,name:k[2],strings:$,ctor:k[1]==="."?zt:k[1]==="?"?Ot:k[1]==="@"?Tt:D}),i.removeAttribute(h)}else h.startsWith(y)&&(a.push({type:6,index:o}),i.removeAttribute(h));if(ct.test(i.tagName)){const h=i.textContent.split(y),v=h.length-1;if(v>0){i.textContent=R?R.emptyScript:"";for(let $=0;$<v;$++)i.append(h[$],O()),b.nextNode(),a.push({type:2,index:++o});i.append(h[v],O())}}}else if(i.nodeType===8)if(i.data===ht)a.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(y,h+1))!==-1;)a.push({type:7,index:o}),h+=y.length-1}o++}}static createElement(t,e){const s=A.createElement("template");return s.innerHTML=t,s}}function E(n,t,e=n,s){var r,d;if(t===S)return t;let i=s!==void 0?(r=e._$Co)==null?void 0:r[s]:e._$Cl;const o=T(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((d=i==null?void 0:i._$AO)==null||d.call(i,!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=E(n,i._$AS(n,t.values),i,s)),t}class Ut{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??A).importNode(e,!0);b.currentNode=i;let o=b.nextNode(),r=0,d=0,a=s[0];for(;a!==void 0;){if(r===a.index){let c;a.type===2?c=new N(o,o.nextSibling,this,t):a.type===1?c=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(c=new Lt(o,this,t)),this._$AV.push(c),a=s[++d]}r!==(a==null?void 0:a.index)&&(o=b.nextNode(),r++)}return b.currentNode=A,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class N{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=E(this,t,e),T(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==S&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Pt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=L.createElement(pt(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const r=new Ut(i,this),d=r.u(this.options);r.p(e),this.T(d),this._$AH=r}}_$AC(t){let e=st.get(t.strings);return e===void 0&&st.set(t.strings,e=new L(t)),e}k(t){F(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new N(this.O(O()),this.O(O()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class D{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,i){const o=this.strings;let r=!1;if(o===void 0)t=E(this,t,e,0),r=!T(t)||t!==this._$AH&&t!==S,r&&(this._$AH=t);else{const d=t;let a,c;for(t=o[0],a=0;a<o.length-1;a++)c=E(this,d[s+a],e,a),c===S&&(c=this._$AH[a]),r||(r=!T(c)||c!==this._$AH[a]),c===p?t=p:t!==p&&(t+=(c??"")+o[a+1]),this._$AH[a]=c}r&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class zt extends D{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class Ot extends D{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class Tt extends D{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??p)===S)return;const s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Lt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){E(this,t)}}const W=U.litHtmlPolyfillSupport;W==null||W(L,N),(U.litHtmlVersions??(U.litHtmlVersions=[])).push("3.2.1");const Nt=(n,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new N(t.insertBefore(O(),o),o,void 0,e??{})}return i._$AI(n),i};/**
279
+ */
280
+ const T = globalThis, nt = (n) => n, F = T.trustedTypes, ot = F ? F.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, vt = "$lit$", y = `lit$${Math.random().toFixed(9).slice(2)}$`, $t = "?" + y, Lt = `<${$t}>`, S = document, O = () => S.createComment(""), M = (n) => n === null || typeof n != "object" && typeof n != "function", Q = Array.isArray, Ot = (n) => Q(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", V = `[
281
+ \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, at = />/g, _ = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
282
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), dt = /'/g, lt = /"/g, yt = /^(?:script|style|textarea|title)$/i, Mt = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), C = Mt(1), x = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), ht = /* @__PURE__ */ new WeakMap(), b = S.createTreeWalker(S, 129);
283
+ function mt(n, t) {
284
+ if (!Q(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
285
+ return ot !== void 0 ? ot.createHTML(t) : t;
286
+ }
287
+ const Nt = (n, t) => {
288
+ const e = n.length - 1, i = [];
289
+ let s, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", r = P;
290
+ for (let a = 0; a < e; a++) {
291
+ const d = n[a];
292
+ let h, f, p = -1, v = 0;
293
+ for (; v < d.length && (r.lastIndex = v, f = r.exec(d), f !== null); ) v = r.lastIndex, r === P ? f[1] === "!--" ? r = rt : f[1] !== void 0 ? r = at : f[2] !== void 0 ? (yt.test(f[2]) && (s = RegExp("</" + f[2], "g")), r = _) : f[3] !== void 0 && (r = _) : r === _ ? f[0] === ">" ? (r = s ?? P, p = -1) : f[1] === void 0 ? p = -2 : (p = r.lastIndex - f[2].length, h = f[1], r = f[3] === void 0 ? _ : f[3] === '"' ? lt : dt) : r === lt || r === dt ? r = _ : r === rt || r === at ? r = P : (r = _, s = void 0);
294
+ const $ = r === _ && n[a + 1].startsWith("/>") ? " " : "";
295
+ o += r === P ? d + Lt : p >= 0 ? (i.push(h), d.slice(0, p) + vt + d.slice(p) + y + $) : d + y + (p === -2 ? a : $);
296
+ }
297
+ return [mt(n, o + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
298
+ };
299
+ class N {
300
+ constructor({ strings: t, _$litType$: e }, i) {
301
+ let s;
302
+ this.parts = [];
303
+ let o = 0, r = 0;
304
+ const a = t.length - 1, d = this.parts, [h, f] = Nt(t, e);
305
+ if (this.el = N.createElement(h, i), b.currentNode = this.el.content, e === 2 || e === 3) {
306
+ const p = this.el.content.firstChild;
307
+ p.replaceWith(...p.childNodes);
308
+ }
309
+ for (; (s = b.nextNode()) !== null && d.length < a; ) {
310
+ if (s.nodeType === 1) {
311
+ if (s.hasAttributes()) for (const p of s.getAttributeNames()) if (p.endsWith(vt)) {
312
+ const v = f[r++], $ = s.getAttribute(p).split(y), D = /([.?@])?(.*)/.exec(v);
313
+ d.push({ type: 1, index: o, name: D[2], strings: $, ctor: D[1] === "." ? Dt : D[1] === "?" ? Rt : D[1] === "@" ? jt : W }), s.removeAttribute(p);
314
+ } else p.startsWith(y) && (d.push({ type: 6, index: o }), s.removeAttribute(p));
315
+ if (yt.test(s.tagName)) {
316
+ const p = s.textContent.split(y), v = p.length - 1;
317
+ if (v > 0) {
318
+ s.textContent = F ? F.emptyScript : "";
319
+ for (let $ = 0; $ < v; $++) s.append(p[$], O()), b.nextNode(), d.push({ type: 2, index: ++o });
320
+ s.append(p[v], O());
321
+ }
322
+ }
323
+ } else if (s.nodeType === 8) if (s.data === $t) d.push({ type: 2, index: o });
324
+ else {
325
+ let p = -1;
326
+ for (; (p = s.data.indexOf(y, p + 1)) !== -1; ) d.push({ type: 7, index: o }), p += y.length - 1;
327
+ }
328
+ o++;
329
+ }
330
+ }
331
+ static createElement(t, e) {
332
+ const i = S.createElement("template");
333
+ return i.innerHTML = t, i;
334
+ }
335
+ }
336
+ function I(n, t, e = n, i) {
337
+ var r, a;
338
+ if (t === x) return t;
339
+ let s = i !== void 0 ? (r = e._$Co) == null ? void 0 : r[i] : e._$Cl;
340
+ const o = M(t) ? void 0 : t._$litDirective$;
341
+ return (s == null ? void 0 : s.constructor) !== o && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), o === void 0 ? s = void 0 : (s = new o(n), s._$AT(n, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = I(n, s._$AS(n, t.values), s, i)), t;
342
+ }
343
+ class Ht {
344
+ constructor(t, e) {
345
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
346
+ }
347
+ get parentNode() {
348
+ return this._$AM.parentNode;
349
+ }
350
+ get _$AU() {
351
+ return this._$AM._$AU;
352
+ }
353
+ u(t) {
354
+ const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? S).importNode(e, !0);
355
+ b.currentNode = s;
356
+ let o = b.nextNode(), r = 0, a = 0, d = i[0];
357
+ for (; d !== void 0; ) {
358
+ if (r === d.index) {
359
+ let h;
360
+ d.type === 2 ? h = new H(o, o.nextSibling, this, t) : d.type === 1 ? h = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (h = new Bt(o, this, t)), this._$AV.push(h), d = i[++a];
361
+ }
362
+ r !== (d == null ? void 0 : d.index) && (o = b.nextNode(), r++);
363
+ }
364
+ return b.currentNode = S, s;
365
+ }
366
+ p(t) {
367
+ let e = 0;
368
+ for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
369
+ }
370
+ }
371
+ class H {
372
+ get _$AU() {
373
+ var t;
374
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
375
+ }
376
+ constructor(t, e, i, s) {
377
+ this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
378
+ }
379
+ get parentNode() {
380
+ let t = this._$AA.parentNode;
381
+ const e = this._$AM;
382
+ return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
383
+ }
384
+ get startNode() {
385
+ return this._$AA;
386
+ }
387
+ get endNode() {
388
+ return this._$AB;
389
+ }
390
+ _$AI(t, e = this) {
391
+ t = I(this, t, e), M(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== x && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ot(t) ? this.k(t) : this._(t);
392
+ }
393
+ O(t) {
394
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
395
+ }
396
+ T(t) {
397
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
398
+ }
399
+ _(t) {
400
+ this._$AH !== u && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
401
+ }
402
+ $(t) {
403
+ var o;
404
+ const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = N.createElement(mt(i.h, i.h[0]), this.options)), i);
405
+ if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(e);
406
+ else {
407
+ const r = new Ht(s, this), a = r.u(this.options);
408
+ r.p(e), this.T(a), this._$AH = r;
409
+ }
410
+ }
411
+ _$AC(t) {
412
+ let e = ht.get(t.strings);
413
+ return e === void 0 && ht.set(t.strings, e = new N(t)), e;
414
+ }
415
+ k(t) {
416
+ Q(this._$AH) || (this._$AH = [], this._$AR());
417
+ const e = this._$AH;
418
+ let i, s = 0;
419
+ for (const o of t) s === e.length ? e.push(i = new H(this.O(O()), this.O(O()), this, this.options)) : i = e[s], i._$AI(o), s++;
420
+ s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
421
+ }
422
+ _$AR(t = this._$AA.nextSibling, e) {
423
+ var i;
424
+ for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t !== this._$AB; ) {
425
+ const s = nt(t).nextSibling;
426
+ nt(t).remove(), t = s;
427
+ }
428
+ }
429
+ setConnected(t) {
430
+ var e;
431
+ this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
432
+ }
433
+ }
434
+ class W {
435
+ get tagName() {
436
+ return this.element.tagName;
437
+ }
438
+ get _$AU() {
439
+ return this._$AM._$AU;
440
+ }
441
+ constructor(t, e, i, s, o) {
442
+ this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = u;
443
+ }
444
+ _$AI(t, e = this, i, s) {
445
+ const o = this.strings;
446
+ let r = !1;
447
+ if (o === void 0) t = I(this, t, e, 0), r = !M(t) || t !== this._$AH && t !== x, r && (this._$AH = t);
448
+ else {
449
+ const a = t;
450
+ let d, h;
451
+ for (t = o[0], d = 0; d < o.length - 1; d++) h = I(this, a[i + d], e, d), h === x && (h = this._$AH[d]), r || (r = !M(h) || h !== this._$AH[d]), h === u ? t = u : t !== u && (t += (h ?? "") + o[d + 1]), this._$AH[d] = h;
452
+ }
453
+ r && !s && this.j(t);
454
+ }
455
+ j(t) {
456
+ t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
457
+ }
458
+ }
459
+ class Dt extends W {
460
+ constructor() {
461
+ super(...arguments), this.type = 3;
462
+ }
463
+ j(t) {
464
+ this.element[this.name] = t === u ? void 0 : t;
465
+ }
466
+ }
467
+ class Rt extends W {
468
+ constructor() {
469
+ super(...arguments), this.type = 4;
470
+ }
471
+ j(t) {
472
+ this.element.toggleAttribute(this.name, !!t && t !== u);
473
+ }
474
+ }
475
+ class jt extends W {
476
+ constructor(t, e, i, s, o) {
477
+ super(t, e, i, s, o), this.type = 5;
478
+ }
479
+ _$AI(t, e = this) {
480
+ if ((t = I(this, t, e, 0) ?? u) === x) return;
481
+ const i = this._$AH, s = t === u && i !== u || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== u && (i === u || s);
482
+ s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
483
+ }
484
+ handleEvent(t) {
485
+ var e;
486
+ typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
487
+ }
488
+ }
489
+ class Bt {
490
+ constructor(t, e, i) {
491
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
492
+ }
493
+ get _$AU() {
494
+ return this._$AM._$AU;
495
+ }
496
+ _$AI(t) {
497
+ I(this, t);
498
+ }
499
+ }
500
+ const J = T.litHtmlPolyfillSupport;
501
+ J == null || J(N, H), (T.litHtmlVersions ?? (T.litHtmlVersions = [])).push("3.3.2");
502
+ const Ft = (n, t, e) => {
503
+ const i = (e == null ? void 0 : e.renderBefore) ?? t;
504
+ let s = i._$litPart$;
505
+ if (s === void 0) {
506
+ const o = (e == null ? void 0 : e.renderBefore) ?? null;
507
+ i._$litPart$ = s = new H(t.insertBefore(O(), o), o, void 0, e ?? {});
508
+ }
509
+ return s._$AI(n), s;
510
+ };
511
+ /**
512
+ * @license
513
+ * Copyright 2017 Google LLC
514
+ * SPDX-License-Identifier: BSD-3-Clause
515
+ */
516
+ const A = globalThis;
517
+ class k extends z {
518
+ constructor() {
519
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
520
+ }
521
+ createRenderRoot() {
522
+ var e;
523
+ const t = super.createRenderRoot();
524
+ return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
525
+ }
526
+ update(t) {
527
+ const e = this.render();
528
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ft(e, this.renderRoot, this.renderOptions);
529
+ }
530
+ connectedCallback() {
531
+ var t;
532
+ super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
533
+ }
534
+ disconnectedCallback() {
535
+ var t;
536
+ super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
537
+ }
538
+ render() {
539
+ return x;
540
+ }
541
+ }
542
+ var gt;
543
+ k._$litElement$ = !0, k.finalized = !0, (gt = A.litElementHydrateSupport) == null || gt.call(A, { LitElement: k });
544
+ const K = A.litElementPolyfillSupport;
545
+ K == null || K({ LitElement: k });
546
+ (A.litElementVersions ?? (A.litElementVersions = [])).push("4.2.2");
547
+ /**
16
548
  * @license
17
549
  * Copyright 2017 Google LLC
18
550
  * SPDX-License-Identifier: BSD-3-Clause
19
- */let z=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Nt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return S}};var rt;z._$litElement$=!0,z.finalized=!0,(rt=globalThis.litElementHydrateSupport)==null||rt.call(globalThis,{LitElement:z});const q=globalThis.litElementPolyfillSupport;q==null||q({LitElement:z});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
551
+ */
552
+ const Wt = (n) => (t, e) => {
553
+ e !== void 0 ? e.addInitializer(() => {
554
+ customElements.define(n, t);
555
+ }) : customElements.define(n, t);
556
+ };
557
+ /**
20
558
  * @license
21
559
  * Copyright 2017 Google LLC
22
560
  * SPDX-License-Identifier: BSD-3-Clause
23
- */const kt=n=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(n,t)}):customElements.define(n,t)};/**
561
+ */
562
+ const qt = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: Y }, Vt = (n = qt, t, e) => {
563
+ const { kind: i, metadata: s } = e;
564
+ let o = globalThis.litPropertyMetadata.get(s);
565
+ if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), i === "setter" && ((n = Object.create(n)).wrapped = !0), o.set(e.name, n), i === "accessor") {
566
+ const { name: r } = e;
567
+ return { set(a) {
568
+ const d = t.get.call(this);
569
+ t.set.call(this, a), this.requestUpdate(r, d, n, !0, a);
570
+ }, init(a) {
571
+ return a !== void 0 && this.C(r, void 0, n, a), a;
572
+ } };
573
+ }
574
+ if (i === "setter") {
575
+ const { name: r } = e;
576
+ return function(a) {
577
+ const d = this[r];
578
+ t.call(this, a), this.requestUpdate(r, d, n, !0, a);
579
+ };
580
+ }
581
+ throw Error("Unsupported decorator location: " + i);
582
+ };
583
+ function g(n) {
584
+ return (t, e) => typeof e == "object" ? Vt(n, t, e) : ((i, s, o) => {
585
+ const r = s.hasOwnProperty(o);
586
+ return s.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(s, o) : void 0;
587
+ })(n, t, e);
588
+ }
589
+ /**
24
590
  * @license
25
591
  * Copyright 2017 Google LLC
26
592
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const It={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:J},Mt=(n=It,t,e)=>{const{kind:s,metadata:i}=e;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,n),s==="accessor"){const{name:r}=e;return{set(d){const a=t.get.call(this);t.set.call(this,d),this.requestUpdate(r,a,n)},init(d){return d!==void 0&&this.P(r,void 0,n),d}}}if(s==="setter"){const{name:r}=e;return function(d){const a=this[r];t.call(this,d),this.requestUpdate(r,a,n)}}throw Error("Unsupported decorator location: "+s)};function f(n){return(t,e)=>typeof e=="object"?Mt(n,t,e):((s,i,o)=>{const r=i.hasOwnProperty(o);return i.constructor.createProperty(o,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,o):void 0})(n,t,e)}/**
593
+ */
594
+ function Jt(n) {
595
+ return g({ ...n, state: !0, attribute: !1 });
596
+ }
597
+ /**
28
598
  * @license
29
599
  * Copyright 2021 Google LLC
30
600
  * SPDX-License-Identifier: BSD-3-Clause
31
- */function nt(n,t,e){return n?t(n):e==null?void 0:e(n)}const Ht=`:host {
601
+ */
602
+ function pt(n, t, e) {
603
+ return n ? t(n) : e == null ? void 0 : e(n);
604
+ }
605
+ const Kt = `:host {
32
606
  display: var(--dae-display, block);
33
607
  contain: var(--dae-contain, content);
34
608
  min-height: var(--dae-min-heigh, 100px);
@@ -120,20 +694,408 @@
120
694
  background-position: right -40px top 0;
121
695
  }
122
696
  }
123
- `;var Rt=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,gt=n=>{throw TypeError(n)},g=(n,t,e,s)=>{for(var i=s>1?void 0:s?Dt(t,e):t,o=n.length-1,r;o>=0;o--)(r=n[o])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&Rt(t,e,i),i},Bt=(n,t,e)=>t.has(n)||gt("Cannot "+e),jt=(n,t,e)=>t.has(n)?gt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),ot=(n,t,e)=>(Bt(n,t,"access private method"),e),M,ut,ft;let l=class extends z{constructor(){super(...arguments),jt(this,M),this.networkId="",this.adUnit="",this.divId="",this.mapping=[],this.sizing=[],this.targeting=[],this.setCentering=!1,this.enableLazyLoad=!1,this.configLazyLoad={fetchMarginPercent:500,renderMarginPercent:200,mobileScaling:2},this.refresh=!1,this.enableTitle=!1,this.apstag=!1,this.pubId="",this.bidTimeout=2e3,this.title="Publicidad",this.adLoaded=!1}connectedCallback(){if(super.connectedCallback(),!l.initialized)ot(this,M,ut).call(this),l.initialized=!0,l.old_url=location.href;else{const n=location.href;l.old_url!==n&&(window.googletag.destroySlots(window.dreamsAllSlots),l.old_url=n,window.dreamsAllSlots=[],window.dreamsSlotsToUpdate=[])}}firstUpdated(){this.divId=`div-gpt-ad-${this.adUnit}-${crypto.randomUUID()}`,typeof this.mapping=="string"&&(this.mapping=JSON.parse(this.mapping)),typeof this.sizing=="string"&&(this.sizing=JSON.parse(this.sizing)),this.targeting&&typeof this.targeting=="string"&&(this.targeting=JSON.parse(this.targeting)),this.configLazyLoad&&typeof this.configLazyLoad=="string"&&(this.configLazyLoad=JSON.parse(this.configLazyLoad)),this.apstag&&this.pubId&&!l.initialized_aps&&(window.apstag.init({pubID:this.pubId,adServer:"googletag",bidTimeout:this.bidTimeout}),l.initialized_aps=!0),ot(this,M,ft).call(this)}render(){return C`
697
+ `, Gt = {
698
+ "top-1": {
699
+ mapping: [
700
+ { viewport: [320, 0], sizing: [[320, 50], [320, 100]] },
701
+ { viewport: [720, 0], sizing: [[728, 90]] },
702
+ { viewport: [970, 0], sizing: [[920, 250], [970, 90], [728, 90]] },
703
+ { viewport: [1280, 0], sizing: [[920, 250], [970, 250], [970, 90], [728, 90]] }
704
+ ],
705
+ sizing: [[320, 50], [320, 100], [728, 90], [970, 90], [920, 250], [970, 250]],
706
+ position: "top"
707
+ },
708
+ "top-2": {
709
+ mapping: [
710
+ { viewport: [320, 0], sizing: [[300, 250], [320, 50]] },
711
+ { viewport: [760, 0], sizing: [[728, 90]] },
712
+ { viewport: [970, 90], sizing: [[970, 90], [728, 90]] }
713
+ ],
714
+ sizing: [[300, 250], [320, 50], [728, 90], [970, 90]],
715
+ position: "top"
716
+ },
717
+ "top-3": {
718
+ mapping: [
719
+ { viewport: [320, 0], sizing: [[300, 250], [320, 50]] },
720
+ { viewport: [760, 0], sizing: [[728, 90]] },
721
+ { viewport: [970, 90], sizing: [[970, 90], [728, 90]] }
722
+ ],
723
+ sizing: [[300, 250], [320, 50], [728, 90], [970, 90]],
724
+ position: "top"
725
+ },
726
+ "top-4": {
727
+ mapping: [
728
+ { viewport: [320, 0], sizing: [[300, 250], [320, 50]] },
729
+ { viewport: [760, 0], sizing: [[728, 90]] },
730
+ { viewport: [970, 90], sizing: [[970, 90], [728, 90]] }
731
+ ],
732
+ sizing: [[300, 250], [320, 50], [728, 90], [970, 90]],
733
+ position: "top"
734
+ },
735
+ "top-5": {
736
+ mapping: [
737
+ { viewport: [320, 0], sizing: [[300, 250]] },
738
+ { viewport: [760, 0], sizing: [[728, 90]] }
739
+ ],
740
+ sizing: [[300, 250], [320, 50], [728, 90]],
741
+ position: "top"
742
+ },
743
+ "box-1": {
744
+ mapping: [{ viewport: [320, 0], sizing: [[300, 250]] }],
745
+ sizing: [[300, 250], [300, 600]],
746
+ position: "box"
747
+ },
748
+ "box-2": {
749
+ mapping: [{ viewport: [320, 0], sizing: [[1, 1], [300, 250], [300, 600]] }],
750
+ sizing: [[300, 250], [300, 600], [1, 1]],
751
+ position: "box"
752
+ },
753
+ "box-3": {
754
+ mapping: [{ viewport: [320, 0], sizing: [[1, 1], [300, 250], [300, 600]] }],
755
+ sizing: [[300, 250], [300, 600], [1, 1]],
756
+ position: "box"
757
+ },
758
+ "box-4": {
759
+ mapping: [{ viewport: [320, 0], sizing: [[1, 1], [300, 250], [300, 600]] }],
760
+ sizing: [[300, 250], [300, 600], [1, 1]],
761
+ position: "box"
762
+ },
763
+ "box-5": {
764
+ mapping: [{ viewport: [320, 0], sizing: [[1, 1], [300, 250], [300, 600]] }],
765
+ sizing: [[1, 1], [300, 250], [300, 600]],
766
+ position: "box"
767
+ },
768
+ footer: {
769
+ mapping: [{ viewport: [0, 0], sizing: [[320, 50], [320, 100]] }],
770
+ sizing: [[320, 50], [320, 100]],
771
+ position: "footer"
772
+ },
773
+ interstitial: {
774
+ mapping: [{ viewport: [320, 0], sizing: [[1, 1]] }],
775
+ sizing: [[1, 1]],
776
+ position: "interstitial"
777
+ }
778
+ }, Zt = {
779
+ fetchMarginPercent: 500,
780
+ renderMarginPercent: 200,
781
+ mobileScaling: 2
782
+ }, X = class X {
783
+ static init(t) {
784
+ this.instance = {
785
+ networkId: t.networkId,
786
+ sitePrefix: t.sitePrefix,
787
+ pubId: t.pubId || "",
788
+ bidTimeout: t.bidTimeout || 2e3,
789
+ defaultLazyLoad: t.defaultLazyLoad || Zt,
790
+ slots: {
791
+ ...Gt,
792
+ ...t.slots
793
+ }
794
+ };
795
+ }
796
+ static isInitialized() {
797
+ return this.instance !== null;
798
+ }
799
+ static getNetworkId() {
800
+ return this.assertInitialized(), this.instance.networkId;
801
+ }
802
+ static getSitePrefix() {
803
+ return this.assertInitialized(), this.instance.sitePrefix;
804
+ }
805
+ static getPubId() {
806
+ return this.assertInitialized(), this.instance.pubId || void 0;
807
+ }
808
+ static getBidTimeout() {
809
+ return this.assertInitialized(), this.instance.bidTimeout;
810
+ }
811
+ static getDefaultLazyLoad() {
812
+ return this.assertInitialized(), this.instance.defaultLazyLoad;
813
+ }
814
+ static getSlot(t) {
815
+ return this.assertInitialized(), this.instance.slots[t];
816
+ }
817
+ static getSlotMapping(t) {
818
+ const e = this.getSlot(t);
819
+ if (!e)
820
+ throw new Error(`Unknown ad slot: ${t}`);
821
+ return e.mapping;
822
+ }
823
+ static getSlotSizing(t) {
824
+ const e = this.getSlot(t);
825
+ if (!e)
826
+ throw new Error(`Unknown ad slot: ${t}`);
827
+ return e.sizing;
828
+ }
829
+ static getSlotPosition(t) {
830
+ const e = this.getSlot(t);
831
+ return (e == null ? void 0 : e.position) || "top";
832
+ }
833
+ static buildAdUnit(t) {
834
+ this.assertInitialized();
835
+ const e = this.instance.sitePrefix, s = {
836
+ "top-1": "is-t-01",
837
+ "top-2": "is-t-02",
838
+ "top-3": "is-t-03",
839
+ "top-4": "is-t-04",
840
+ "top-5": "is-t-05",
841
+ "box-1": "is-b-01",
842
+ "box-2": "is-b-02",
843
+ "box-3": "is-b-03",
844
+ "box-4": "is-b-04",
845
+ "box-5": "is-b-05",
846
+ footer: "is-f-01",
847
+ interstitial: "is-i"
848
+ }[t];
849
+ return s ? `${e}-${s}` : `${e}-${t}`;
850
+ }
851
+ static registerSlot(t, e) {
852
+ this.assertInitialized(), this.instance.slots[t] = e;
853
+ }
854
+ static reset() {
855
+ this.instance = null;
856
+ }
857
+ static assertInitialized() {
858
+ if (!this.instance)
859
+ throw new Error(
860
+ "DreamsAdConfig not initialized. Call DreamsAdConfig.init() first."
861
+ );
862
+ }
863
+ };
864
+ X.instance = null;
865
+ let w = X;
866
+ const ct = {
867
+ contextKey: "@context",
868
+ maxRetries: 20,
869
+ retryInterval: 100,
870
+ includeUrl: !0,
871
+ customSegmentFn: "_rl_gen_sg"
872
+ }, L = class L {
873
+ static async getTargeting(t) {
874
+ const e = { ...ct, ...t }, i = typeof window < "u" ? window.location.href : "";
875
+ if (this.cache && this.cacheUrl === i)
876
+ return { targeting: this.cache, source: "cache" };
877
+ if (this.pendingPromise)
878
+ return this.pendingPromise;
879
+ this.pendingPromise = this.pollForContext(e, i);
880
+ const s = await this.pendingPromise;
881
+ return this.pendingPromise = null, s;
882
+ }
883
+ static pollForContext(t, e) {
884
+ return new Promise((i) => {
885
+ let s = 0;
886
+ const o = () => {
887
+ if (typeof window > "u") return !1;
888
+ const a = window.dfp;
889
+ if (!(a != null && a[t.contextKey])) return !1;
890
+ const d = a[t.contextKey], h = this.buildFromContext(d, t);
891
+ return this.cache = h, this.cacheUrl = e, i({ targeting: h, source: "context" }), !0;
892
+ };
893
+ if (o()) return;
894
+ const r = setInterval(() => {
895
+ if (s++, o()) {
896
+ clearInterval(r);
897
+ return;
898
+ }
899
+ s >= t.maxRetries && (clearInterval(r), i({ targeting: [], source: "timeout" }));
900
+ }, t.retryInterval);
901
+ });
902
+ }
903
+ static buildFromContext(t, e) {
904
+ var o, r;
905
+ const i = { ...ct, ...e }, s = [];
906
+ if (i.includeUrl && typeof window < "u" && s.push({ key: "url", value: window.location.pathname }), (o = t.dataSection) != null && o.catName && s.push({ key: "catName", value: t.dataSection.catName }), t.postId && s.push({ key: "postId", value: t.postId }), t.catId && s.push({ key: "catId", value: t.catId }), t.tagId && s.push({ key: "tag", value: t.tagId }), t.typeId && s.push({ key: "type", value: t.typeId }), t.taxId && s.push({ key: "taxId", value: t.taxId }), (r = t.dataSection) != null && r.author && s.push({ key: "author", value: t.dataSection.author }), typeof window < "u" && i.customSegmentFn) {
907
+ const a = window[i.customSegmentFn];
908
+ if (typeof a == "function") {
909
+ const d = a();
910
+ d && s.push({ key: "_rl", value: d });
911
+ }
912
+ }
913
+ return s;
914
+ }
915
+ static clearCache() {
916
+ this.cache = null, this.cacheUrl = "", this.pendingPromise = null;
917
+ }
918
+ static getTargetingSync() {
919
+ const t = typeof window < "u" ? window.location.href : "";
920
+ return this.cache && this.cacheUrl === t ? this.cache : null;
921
+ }
922
+ };
923
+ L.cache = null, L.cacheUrl = "", L.pendingPromise = null;
924
+ let G = L;
925
+ var Yt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, _t = (n) => {
926
+ throw TypeError(n);
927
+ }, c = (n, t, e, i) => {
928
+ for (var s = i > 1 ? void 0 : i ? Qt(t, e) : t, o = n.length - 1, r; o >= 0; o--)
929
+ (r = n[o]) && (s = (i ? r(t, e, s) : r(s)) || s);
930
+ return i && s && Yt(t, e, s), s;
931
+ }, Xt = (n, t, e) => t.has(n) || _t("Cannot " + e), te = (n, t, e) => t.has(n) ? _t("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), R = (n, t, e) => (Xt(n, t, "access private method"), e), E, wt, bt, At, St;
932
+ let l = class extends k {
933
+ constructor() {
934
+ super(...arguments), te(this, E), this.networkId = "", this.adUnit = "", this.divId = "", this.slot = "", this.mapping = [], this.sizing = [], this.targeting = [], this.autoTargeting = !1, this.resolvedTargeting = [], this.setCentering = !1, this.enableLazyLoad = !1, this.configLazyLoad = {
935
+ fetchMarginPercent: 500,
936
+ renderMarginPercent: 200,
937
+ mobileScaling: 2
938
+ }, this.refresh = !1, this.enableTitle = !1, this.apstag = !1, this.pubId = "", this.bidTimeout = 2e3, this.title = "Publicidad", this.adLoaded = !1;
939
+ }
940
+ connectedCallback() {
941
+ if (super.connectedCallback(), !l.initialized)
942
+ R(this, E, wt).call(this), l.initialized = !0, l.old_url = location.href;
943
+ else {
944
+ const n = location.href;
945
+ l.old_url !== n && (window.googletag.destroySlots(window.dreamsAllSlots), l.old_url = n, window.dreamsAllSlots = [], window.dreamsSlotsToUpdate = []);
946
+ }
947
+ }
948
+ async firstUpdated() {
949
+ await R(this, E, bt).call(this), await R(this, E, At).call(this), this.divId = `div-gpt-ad-${this.adUnit}-${crypto.randomUUID()}`, this.apstag && this.pubId && !l.initialized_aps && (window.apstag.init({
950
+ pubID: this.pubId,
951
+ adServer: "googletag",
952
+ bidTimeout: this.bidTimeout
953
+ }), l.initialized_aps = !0), R(this, E, St).call(this);
954
+ }
955
+ render() {
956
+ return C`
124
957
  <div class="ad-container">
125
- ${nt(this.enableTitle,()=>C`<span class="ad-label">${this.title}</span>`,()=>C``)}
126
- ${nt(!this.adLoaded,()=>C`<div
958
+ ${pt(
959
+ this.enableTitle,
960
+ () => C`<span class="ad-label">${this.title}</span>`,
961
+ () => C``
962
+ )}
963
+ ${pt(
964
+ !this.adLoaded,
965
+ () => C`<div
127
966
  class="ad-loader"
128
967
  data-ad-loader="${this.divId}"
129
- ></div>`,()=>C``)}
968
+ ></div>`,
969
+ () => C``
970
+ )}
130
971
  <div
131
972
  class="ad-serving"
132
973
  data-post-id="${this.divId}"
133
974
  data-tag="${this.adUnit}"
134
- data-refresh="${this.refresh?"true":"false"}"
975
+ data-refresh="${this.refresh ? "true" : "false"}"
135
976
  >
136
977
  <slot name="ad-slot"></slot>
137
978
  </div>
138
979
  </div>
139
- `}};M=new WeakSet;ut=function(){window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push(()=>{window.dreamsAllSlots=window.dreamsAllSlots||[],window.dreamsSlotsToUpdate=window.dreamsSlotsToUpdate||[],window.googletag.pubads().enableSingleRequest(),window.googletag.enableServices()})};ft=function(){const n=`/${this.networkId}/${this.adUnit}`,t=this.divId,e=document.createElement("div");e.id=t,e.setAttribute("data-ad",this.divId),e.setAttribute("slot","ad-slot"),e.classList.add("ad-serving-rendered"),e.parentElement||this.appendChild(e),window.googletag.cmd.push(()=>{window.googletag.pubads().setCentering(this.setCentering),this.enableLazyLoad&&window.googletag.pubads().enableLazyLoad(this.configLazyLoad);const s=window.googletag.defineSlot(n,this.sizing,t).addService(window.googletag.pubads());this.targeting.map(d=>{s.setTargeting(d.key,d.value)}),window.googletag.pubads().addEventListener("slotRenderEnded",d=>{d.slot.getSlotElementId()===t&&(this.adLoaded=!0)});const i=window.googletag.sizeMapping();this.mapping.forEach(d=>{i.addSize(d.viewport,d.sizing)});const o=i.build(),r=s.defineSizeMapping(o).addService(window.googletag.pubads());this.refresh&&window.dreamsSlotsToUpdate.push(s),window.dreamsAllSlots.push(r),!this.apstag&&!this.pubId&&window.googletag.display(t),this.apstag&&this.pubId&&window.apstag.fetchBids({slots:[{slotID:t,slotName:n,sizes:this.sizing}]},()=>{window.googletag.cmd.push(()=>{window.apstag.setDisplayBids(),window.googletag.pubads().refresh([r])})})})};l.styles=dt(Ht);l.initialized=!1;l.old_url="";l.initialized_aps=!1;g([f({type:String})],l.prototype,"networkId",2);g([f({type:String})],l.prototype,"adUnit",2);g([f({type:String})],l.prototype,"divId",2);g([f({type:Array})],l.prototype,"mapping",2);g([f({type:Array})],l.prototype,"sizing",2);g([f({type:Array})],l.prototype,"targeting",2);g([f({type:Boolean,reflect:!0})],l.prototype,"setCentering",2);g([f({type:Boolean,reflect:!0})],l.prototype,"enableLazyLoad",2);g([f({type:Object})],l.prototype,"configLazyLoad",2);g([f({type:Boolean,reflect:!0})],l.prototype,"refresh",2);g([f({type:Boolean,reflect:!0})],l.prototype,"enableTitle",2);g([f({type:Boolean,reflect:!0})],l.prototype,"apstag",2);g([f({type:String})],l.prototype,"pubId",2);g([f({type:Number})],l.prototype,"bidTimeout",2);g([f({type:String})],l.prototype,"title",2);g([f({type:Boolean})],l.prototype,"adLoaded",2);l=g([kt("dreams-ad-engine")],l);
980
+ `;
981
+ }
982
+ };
983
+ E = /* @__PURE__ */ new WeakSet();
984
+ wt = function() {
985
+ window.googletag = window.googletag || { cmd: [] }, window.googletag.cmd.push(() => {
986
+ window.dreamsAllSlots = window.dreamsAllSlots || [], window.dreamsSlotsToUpdate = window.dreamsSlotsToUpdate || [], window.googletag.enableServices();
987
+ });
988
+ };
989
+ bt = async function() {
990
+ if (this.slot && w.isInitialized()) {
991
+ const n = w.getSlot(this.slot);
992
+ n && (this.networkId || (this.networkId = w.getNetworkId()), this.adUnit || (this.adUnit = w.buildAdUnit(this.slot)), (!this.mapping || this.mapping.length === 0) && (this.mapping = n.mapping), (!this.sizing || this.sizing.length === 0) && (this.sizing = n.sizing), this.pubId || (this.pubId = w.getPubId() || ""), this.pubId && (this.apstag = !0));
993
+ }
994
+ typeof this.mapping == "string" && (this.mapping = JSON.parse(this.mapping)), typeof this.sizing == "string" && (this.sizing = JSON.parse(this.sizing)), this.targeting && typeof this.targeting == "string" && (this.targeting = JSON.parse(this.targeting)), this.configLazyLoad && typeof this.configLazyLoad == "string" && (this.configLazyLoad = JSON.parse(this.configLazyLoad));
995
+ };
996
+ At = async function() {
997
+ if (this.autoTargeting) {
998
+ const n = await G.getTargeting();
999
+ this.resolvedTargeting = n.targeting;
1000
+ } else this.targeting && this.targeting.length > 0 && (this.resolvedTargeting = this.targeting);
1001
+ };
1002
+ St = function() {
1003
+ const n = `/${this.networkId}/${this.adUnit}`, t = this.divId, e = document.createElement("div");
1004
+ e.id = t, e.setAttribute("data-ad", this.divId), e.setAttribute("slot", "ad-slot"), e.classList.add("ad-serving-rendered"), e.parentElement || this.appendChild(e), window.googletag.cmd.push(() => {
1005
+ window.googletag.pubads().setCentering(this.setCentering), this.enableLazyLoad && window.googletag.pubads().enableLazyLoad(this.configLazyLoad);
1006
+ const i = window.googletag.defineSlot(n, this.sizing, t).addService(window.googletag.pubads());
1007
+ this.resolvedTargeting.forEach((a) => {
1008
+ i.setTargeting(a.key, a.value);
1009
+ }), window.googletag.pubads().addEventListener("slotRenderEnded", (a) => {
1010
+ a.slot.getSlotElementId() === t && (this.adLoaded = !0);
1011
+ });
1012
+ const s = window.googletag.sizeMapping();
1013
+ this.mapping.forEach((a) => {
1014
+ s.addSize(a.viewport, a.sizing);
1015
+ });
1016
+ const o = s.build(), r = i.defineSizeMapping(o).addService(window.googletag.pubads());
1017
+ this.refresh && window.dreamsSlotsToUpdate.push(i), window.dreamsAllSlots.push(r), !this.apstag && !this.pubId && window.googletag.display(t), this.apstag && this.pubId && window.apstag.fetchBids({
1018
+ slots: [
1019
+ {
1020
+ slotID: t,
1021
+ slotName: n,
1022
+ sizes: this.sizing
1023
+ }
1024
+ ]
1025
+ }, () => {
1026
+ window.googletag.cmd.push(() => {
1027
+ window.apstag.setDisplayBids(), window.googletag.pubads().refresh([r]);
1028
+ });
1029
+ });
1030
+ });
1031
+ };
1032
+ l.styles = ft(Kt);
1033
+ l.initialized = !1;
1034
+ l.old_url = "";
1035
+ l.initialized_aps = !1;
1036
+ c([
1037
+ g({ type: String })
1038
+ ], l.prototype, "networkId", 2);
1039
+ c([
1040
+ g({ type: String })
1041
+ ], l.prototype, "adUnit", 2);
1042
+ c([
1043
+ g({ type: String })
1044
+ ], l.prototype, "divId", 2);
1045
+ c([
1046
+ g({ type: String })
1047
+ ], l.prototype, "slot", 2);
1048
+ c([
1049
+ g({ type: Array })
1050
+ ], l.prototype, "mapping", 2);
1051
+ c([
1052
+ g({ type: Array })
1053
+ ], l.prototype, "sizing", 2);
1054
+ c([
1055
+ g({ type: Array })
1056
+ ], l.prototype, "targeting", 2);
1057
+ c([
1058
+ g({ type: Boolean, reflect: !0 })
1059
+ ], l.prototype, "autoTargeting", 2);
1060
+ c([
1061
+ Jt()
1062
+ ], l.prototype, "resolvedTargeting", 2);
1063
+ c([
1064
+ g({ type: Boolean, reflect: !0 })
1065
+ ], l.prototype, "setCentering", 2);
1066
+ c([
1067
+ g({ type: Boolean, reflect: !0 })
1068
+ ], l.prototype, "enableLazyLoad", 2);
1069
+ c([
1070
+ g({ type: Object })
1071
+ ], l.prototype, "configLazyLoad", 2);
1072
+ c([
1073
+ g({ type: Boolean, reflect: !0 })
1074
+ ], l.prototype, "refresh", 2);
1075
+ c([
1076
+ g({ type: Boolean, reflect: !0 })
1077
+ ], l.prototype, "enableTitle", 2);
1078
+ c([
1079
+ g({ type: Boolean, reflect: !0 })
1080
+ ], l.prototype, "apstag", 2);
1081
+ c([
1082
+ g({ type: String })
1083
+ ], l.prototype, "pubId", 2);
1084
+ c([
1085
+ g({ type: Number })
1086
+ ], l.prototype, "bidTimeout", 2);
1087
+ c([
1088
+ g({ type: String })
1089
+ ], l.prototype, "title", 2);
1090
+ c([
1091
+ g({ type: Boolean })
1092
+ ], l.prototype, "adLoaded", 2);
1093
+ l = c([
1094
+ Wt("dreams-ad-engine")
1095
+ ], l);
1096
+ export {
1097
+ Gt as DEFAULT_SLOTS,
1098
+ l as DreamsAdComponent,
1099
+ w as DreamsAdConfig,
1100
+ G as DreamsTargetingService
1101
+ };