@dreamsengine/dreams-ad-engine 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -2
- package/README.md +457 -161
- package/dist/dreams-ad-engine.js +978 -16
- package/package.json +11 -1
- package/types/features/config/config.provider.d.ts +20 -0
- package/types/features/config/config.types.d.ts +22 -0
- package/types/features/config/default-mappings.d.ts +2 -0
- package/types/features/config/index.d.ts +3 -0
- package/types/features/dreamsAdEngine/components/ad.component.d.ts +37 -0
- package/types/features/dreamsAdEngine/index.d.ts +1 -0
- package/types/features/dreamsAdEngine/types/interfaces.d.ts +50 -0
- package/types/features/index.d.ts +3 -0
- package/types/features/targeting/index.d.ts +2 -0
- package/types/features/targeting/targeting.service.d.ts +12 -0
- package/types/features/targeting/targeting.types.d.ts +29 -0
- package/types/main.d.ts +1 -0
- package/dist/index.html +0 -60
package/dist/dreams-ad-engine.js
CHANGED
|
@@ -1,34 +1,608 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
14
|
-
|
|
15
|
-
\f\r
|
|
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), R = /([.?@])?(.*)/.exec(v);
|
|
313
|
+
d.push({ type: 1, index: o, name: R[2], strings: $, ctor: R[1] === "." ? Rt : R[1] === "?" ? Dt : R[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 Rt 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 Dt 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
|
-
*/
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
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
|
-
|
|
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), D = (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
|
+
D(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 D(this, E, bt).call(this), await D(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), D(this, E, St).call(this);
|
|
954
|
+
}
|
|
955
|
+
render() {
|
|
956
|
+
return C`
|
|
124
957
|
<div class="ad-container">
|
|
125
|
-
${
|
|
126
|
-
|
|
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>`,
|
|
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
|
-
|
|
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.pubads().enableSingleRequest(), 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
|
+
};
|