mealz-components 0.2.1 → 0.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/like-button/like-button.css +7 -0
- package/dist/like-button/like-button.js +638 -0
- package/dist/like-button/like-button.min.js +28 -0
- package/dist/like-button/like-button.umd.cjs +23 -0
- package/dist/mealz-components.js +171 -132
- package/dist/mealz-components.min.js +20 -20
- package/dist/mealz-components.umd.cjs +14 -14
- package/dist/recipe-card/recipe-card.css +92 -0
- package/dist/recipe-card/recipe-card.js +622 -0
- package/dist/recipe-card/recipe-card.min.js +28 -0
- package/dist/recipe-card/recipe-card.umd.cjs +23 -0
- package/dist/store-locator/store-locator.js +62 -76
- package/dist/store-locator/store-locator.min.js +20 -20
- package/dist/store-locator/store-locator.umd.cjs +13 -13
- package/dist/style.css +1 -0
- package/package.json +7 -2
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const ot = (r) => (t, e) => {
|
|
7
|
+
e !== void 0 ? e.addInitializer(() => {
|
|
8
|
+
customElements.define(r, t);
|
|
9
|
+
}) : customElements.define(r, t);
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @license
|
|
13
|
+
* Copyright 2019 Google LLC
|
|
14
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
|
+
*/
|
|
16
|
+
const N = globalThis, j = N.ShadowRoot && (N.ShadyCSS === void 0 || N.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Y = Symbol(), B = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
let ht = class {
|
|
18
|
+
constructor(t, e, s) {
|
|
19
|
+
if (this._$cssResult$ = !0, s !== Y)
|
|
20
|
+
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
21
|
+
this.cssText = t, this.t = e;
|
|
22
|
+
}
|
|
23
|
+
get styleSheet() {
|
|
24
|
+
let t = this.o;
|
|
25
|
+
const e = this.t;
|
|
26
|
+
if (j && t === void 0) {
|
|
27
|
+
const s = e !== void 0 && e.length === 1;
|
|
28
|
+
s && (t = B.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && B.set(e, t));
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
}
|
|
32
|
+
toString() {
|
|
33
|
+
return this.cssText;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const at = (r) => new ht(typeof r == "string" ? r : r + "", void 0, Y), lt = (r, t) => {
|
|
37
|
+
if (j)
|
|
38
|
+
r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
39
|
+
else
|
|
40
|
+
for (const e of t) {
|
|
41
|
+
const s = document.createElement("style"), i = N.litNonce;
|
|
42
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
43
|
+
}
|
|
44
|
+
}, q = j ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
45
|
+
let e = "";
|
|
46
|
+
for (const s of t.cssRules)
|
|
47
|
+
e += s.cssText;
|
|
48
|
+
return at(e);
|
|
49
|
+
})(r) : r;
|
|
50
|
+
/**
|
|
51
|
+
* @license
|
|
52
|
+
* Copyright 2017 Google LLC
|
|
53
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
+
*/
|
|
55
|
+
const { is: ct, defineProperty: dt, getOwnPropertyDescriptor: pt, getOwnPropertyNames: ut, getOwnPropertySymbols: $t, getPrototypeOf: _t } = Object, f = globalThis, W = f.trustedTypes, ft = W ? W.emptyScript : "", M = f.reactiveElementPolyfillSupport, b = (r, t) => r, L = { toAttribute(r, t) {
|
|
56
|
+
switch (t) {
|
|
57
|
+
case Boolean:
|
|
58
|
+
r = r ? ft : null;
|
|
59
|
+
break;
|
|
60
|
+
case Object:
|
|
61
|
+
case Array:
|
|
62
|
+
r = r == null ? r : JSON.stringify(r);
|
|
63
|
+
}
|
|
64
|
+
return r;
|
|
65
|
+
}, fromAttribute(r, t) {
|
|
66
|
+
let e = r;
|
|
67
|
+
switch (t) {
|
|
68
|
+
case Boolean:
|
|
69
|
+
e = r !== null;
|
|
70
|
+
break;
|
|
71
|
+
case Number:
|
|
72
|
+
e = r === null ? null : Number(r);
|
|
73
|
+
break;
|
|
74
|
+
case Object:
|
|
75
|
+
case Array:
|
|
76
|
+
try {
|
|
77
|
+
e = JSON.parse(r);
|
|
78
|
+
} catch {
|
|
79
|
+
e = null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return e;
|
|
83
|
+
} }, tt = (r, t) => !ct(r, t), V = { attribute: !0, type: String, converter: L, reflect: !1, hasChanged: tt };
|
|
84
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), f.litPropertyMetadata ?? (f.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
85
|
+
class y extends HTMLElement {
|
|
86
|
+
static addInitializer(t) {
|
|
87
|
+
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
88
|
+
}
|
|
89
|
+
static get observedAttributes() {
|
|
90
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
91
|
+
}
|
|
92
|
+
static createProperty(t, e = V) {
|
|
93
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
94
|
+
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
95
|
+
i !== void 0 && dt(this.prototype, t, i);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
static getPropertyDescriptor(t, e, s) {
|
|
99
|
+
const { get: i, set: n } = pt(this.prototype, t) ?? { get() {
|
|
100
|
+
return this[e];
|
|
101
|
+
}, set(o) {
|
|
102
|
+
this[e] = o;
|
|
103
|
+
} };
|
|
104
|
+
return { get() {
|
|
105
|
+
return i == null ? void 0 : i.call(this);
|
|
106
|
+
}, set(o) {
|
|
107
|
+
const l = i == null ? void 0 : i.call(this);
|
|
108
|
+
n.call(this, o), this.requestUpdate(t, l, s);
|
|
109
|
+
}, configurable: !0, enumerable: !0 };
|
|
110
|
+
}
|
|
111
|
+
static getPropertyOptions(t) {
|
|
112
|
+
return this.elementProperties.get(t) ?? V;
|
|
113
|
+
}
|
|
114
|
+
static _$Ei() {
|
|
115
|
+
if (this.hasOwnProperty(b("elementProperties")))
|
|
116
|
+
return;
|
|
117
|
+
const t = _t(this);
|
|
118
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
119
|
+
}
|
|
120
|
+
static finalize() {
|
|
121
|
+
if (this.hasOwnProperty(b("finalized")))
|
|
122
|
+
return;
|
|
123
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(b("properties"))) {
|
|
124
|
+
const e = this.properties, s = [...ut(e), ...$t(e)];
|
|
125
|
+
for (const i of s)
|
|
126
|
+
this.createProperty(i, e[i]);
|
|
127
|
+
}
|
|
128
|
+
const t = this[Symbol.metadata];
|
|
129
|
+
if (t !== null) {
|
|
130
|
+
const e = litPropertyMetadata.get(t);
|
|
131
|
+
if (e !== void 0)
|
|
132
|
+
for (const [s, i] of e)
|
|
133
|
+
this.elementProperties.set(s, i);
|
|
134
|
+
}
|
|
135
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
136
|
+
for (const [e, s] of this.elementProperties) {
|
|
137
|
+
const i = this._$Eu(e, s);
|
|
138
|
+
i !== void 0 && this._$Eh.set(i, e);
|
|
139
|
+
}
|
|
140
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
141
|
+
}
|
|
142
|
+
static finalizeStyles(t) {
|
|
143
|
+
const e = [];
|
|
144
|
+
if (Array.isArray(t)) {
|
|
145
|
+
const s = new Set(t.flat(1 / 0).reverse());
|
|
146
|
+
for (const i of s)
|
|
147
|
+
e.unshift(q(i));
|
|
148
|
+
} else
|
|
149
|
+
t !== void 0 && e.push(q(t));
|
|
150
|
+
return e;
|
|
151
|
+
}
|
|
152
|
+
static _$Eu(t, e) {
|
|
153
|
+
const s = e.attribute;
|
|
154
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
155
|
+
}
|
|
156
|
+
constructor() {
|
|
157
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
158
|
+
}
|
|
159
|
+
_$Ev() {
|
|
160
|
+
var t;
|
|
161
|
+
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));
|
|
162
|
+
}
|
|
163
|
+
addController(t) {
|
|
164
|
+
var e;
|
|
165
|
+
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
|
|
166
|
+
}
|
|
167
|
+
removeController(t) {
|
|
168
|
+
var e;
|
|
169
|
+
(e = this._$EO) == null || e.delete(t);
|
|
170
|
+
}
|
|
171
|
+
_$E_() {
|
|
172
|
+
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
173
|
+
for (const s of e.keys())
|
|
174
|
+
this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
|
|
175
|
+
t.size > 0 && (this._$Ep = t);
|
|
176
|
+
}
|
|
177
|
+
createRenderRoot() {
|
|
178
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
179
|
+
return lt(t, this.constructor.elementStyles), t;
|
|
180
|
+
}
|
|
181
|
+
connectedCallback() {
|
|
182
|
+
var t;
|
|
183
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
184
|
+
var s;
|
|
185
|
+
return (s = e.hostConnected) == null ? void 0 : s.call(e);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
enableUpdating(t) {
|
|
189
|
+
}
|
|
190
|
+
disconnectedCallback() {
|
|
191
|
+
var t;
|
|
192
|
+
(t = this._$EO) == null || t.forEach((e) => {
|
|
193
|
+
var s;
|
|
194
|
+
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
attributeChangedCallback(t, e, s) {
|
|
198
|
+
this._$AK(t, s);
|
|
199
|
+
}
|
|
200
|
+
_$EC(t, e) {
|
|
201
|
+
var n;
|
|
202
|
+
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
203
|
+
if (i !== void 0 && s.reflect === !0) {
|
|
204
|
+
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : L).toAttribute(e, s.type);
|
|
205
|
+
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
_$AK(t, e) {
|
|
209
|
+
var n;
|
|
210
|
+
const s = this.constructor, i = s._$Eh.get(t);
|
|
211
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
212
|
+
const o = s.getPropertyOptions(i), l = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : L;
|
|
213
|
+
this._$Em = i, this[i] = l.fromAttribute(e, o.type), this._$Em = null;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
requestUpdate(t, e, s) {
|
|
217
|
+
if (t !== void 0) {
|
|
218
|
+
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? tt)(this[t], e))
|
|
219
|
+
return;
|
|
220
|
+
this.P(t, e, s);
|
|
221
|
+
}
|
|
222
|
+
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
223
|
+
}
|
|
224
|
+
P(t, e, s) {
|
|
225
|
+
this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
|
|
226
|
+
}
|
|
227
|
+
async _$ET() {
|
|
228
|
+
this.isUpdatePending = !0;
|
|
229
|
+
try {
|
|
230
|
+
await this._$ES;
|
|
231
|
+
} catch (e) {
|
|
232
|
+
Promise.reject(e);
|
|
233
|
+
}
|
|
234
|
+
const t = this.scheduleUpdate();
|
|
235
|
+
return t != null && await t, !this.isUpdatePending;
|
|
236
|
+
}
|
|
237
|
+
scheduleUpdate() {
|
|
238
|
+
return this.performUpdate();
|
|
239
|
+
}
|
|
240
|
+
performUpdate() {
|
|
241
|
+
var s;
|
|
242
|
+
if (!this.isUpdatePending)
|
|
243
|
+
return;
|
|
244
|
+
if (!this.hasUpdated) {
|
|
245
|
+
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
246
|
+
for (const [n, o] of this._$Ep)
|
|
247
|
+
this[n] = o;
|
|
248
|
+
this._$Ep = void 0;
|
|
249
|
+
}
|
|
250
|
+
const i = this.constructor.elementProperties;
|
|
251
|
+
if (i.size > 0)
|
|
252
|
+
for (const [n, o] of i)
|
|
253
|
+
o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], o);
|
|
254
|
+
}
|
|
255
|
+
let t = !1;
|
|
256
|
+
const e = this._$AL;
|
|
257
|
+
try {
|
|
258
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
|
|
259
|
+
var n;
|
|
260
|
+
return (n = i.hostUpdate) == null ? void 0 : n.call(i);
|
|
261
|
+
}), this.update(e)) : this._$EU();
|
|
262
|
+
} catch (i) {
|
|
263
|
+
throw t = !1, this._$EU(), i;
|
|
264
|
+
}
|
|
265
|
+
t && this._$AE(e);
|
|
266
|
+
}
|
|
267
|
+
willUpdate(t) {
|
|
268
|
+
}
|
|
269
|
+
_$AE(t) {
|
|
270
|
+
var e;
|
|
271
|
+
(e = this._$EO) == null || e.forEach((s) => {
|
|
272
|
+
var i;
|
|
273
|
+
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
|
|
274
|
+
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
275
|
+
}
|
|
276
|
+
_$EU() {
|
|
277
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
278
|
+
}
|
|
279
|
+
get updateComplete() {
|
|
280
|
+
return this.getUpdateComplete();
|
|
281
|
+
}
|
|
282
|
+
getUpdateComplete() {
|
|
283
|
+
return this._$ES;
|
|
284
|
+
}
|
|
285
|
+
shouldUpdate(t) {
|
|
286
|
+
return !0;
|
|
287
|
+
}
|
|
288
|
+
update(t) {
|
|
289
|
+
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
|
|
290
|
+
}
|
|
291
|
+
updated(t) {
|
|
292
|
+
}
|
|
293
|
+
firstUpdated(t) {
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[b("elementProperties")] = /* @__PURE__ */ new Map(), y[b("finalized")] = /* @__PURE__ */ new Map(), M == null || M({ ReactiveElement: y }), (f.reactiveElementVersions ?? (f.reactiveElementVersions = [])).push("2.0.4");
|
|
297
|
+
/**
|
|
298
|
+
* @license
|
|
299
|
+
* Copyright 2017 Google LLC
|
|
300
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
301
|
+
*/
|
|
302
|
+
const C = globalThis, T = C.trustedTypes, J = T ? T.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, et = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, st = "?" + _, At = `<${st}>`, g = document, P = () => g.createComment(""), x = (r) => r === null || typeof r != "object" && typeof r != "function", it = Array.isArray, mt = (r) => it(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", k = `[
|
|
303
|
+
\f\r]`, S = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, K = /-->/g, F = />/g, A = RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^
|
|
304
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Z = /'/g, G = /"/g, rt = /^(?:script|style|textarea|title)$/i, v = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), Q = /* @__PURE__ */ new WeakMap(), m = g.createTreeWalker(g, 129);
|
|
305
|
+
function nt(r, t) {
|
|
306
|
+
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
|
|
307
|
+
throw Error("invalid template strings array");
|
|
308
|
+
return J !== void 0 ? J.createHTML(t) : t;
|
|
309
|
+
}
|
|
310
|
+
const gt = (r, t) => {
|
|
311
|
+
const e = r.length - 1, s = [];
|
|
312
|
+
let i, n = t === 2 ? "<svg>" : "", o = S;
|
|
313
|
+
for (let l = 0; l < e; l++) {
|
|
314
|
+
const h = r[l];
|
|
315
|
+
let c, p, a = -1, u = 0;
|
|
316
|
+
for (; u < h.length && (o.lastIndex = u, p = o.exec(h), p !== null); )
|
|
317
|
+
u = o.lastIndex, o === S ? p[1] === "!--" ? o = K : p[1] !== void 0 ? o = F : p[2] !== void 0 ? (rt.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = A) : p[3] !== void 0 && (o = A) : o === A ? p[0] === ">" ? (o = i ?? S, a = -1) : p[1] === void 0 ? a = -2 : (a = o.lastIndex - p[2].length, c = p[1], o = p[3] === void 0 ? A : p[3] === '"' ? G : Z) : o === G || o === Z ? o = A : o === K || o === F ? o = S : (o = A, i = void 0);
|
|
318
|
+
const $ = o === A && r[l + 1].startsWith("/>") ? " " : "";
|
|
319
|
+
n += o === S ? h + At : a >= 0 ? (s.push(c), h.slice(0, a) + et + h.slice(a) + _ + $) : h + _ + (a === -2 ? l : $);
|
|
320
|
+
}
|
|
321
|
+
return [nt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s];
|
|
322
|
+
};
|
|
323
|
+
class U {
|
|
324
|
+
constructor({ strings: t, _$litType$: e }, s) {
|
|
325
|
+
let i;
|
|
326
|
+
this.parts = [];
|
|
327
|
+
let n = 0, o = 0;
|
|
328
|
+
const l = t.length - 1, h = this.parts, [c, p] = gt(t, e);
|
|
329
|
+
if (this.el = U.createElement(c, s), m.currentNode = this.el.content, e === 2) {
|
|
330
|
+
const a = this.el.content.firstChild;
|
|
331
|
+
a.replaceWith(...a.childNodes);
|
|
332
|
+
}
|
|
333
|
+
for (; (i = m.nextNode()) !== null && h.length < l; ) {
|
|
334
|
+
if (i.nodeType === 1) {
|
|
335
|
+
if (i.hasAttributes())
|
|
336
|
+
for (const a of i.getAttributeNames())
|
|
337
|
+
if (a.endsWith(et)) {
|
|
338
|
+
const u = p[o++], $ = i.getAttribute(a).split(_), R = /([.?@])?(.*)/.exec(u);
|
|
339
|
+
h.push({ type: 1, index: n, name: R[2], strings: $, ctor: R[1] === "." ? vt : R[1] === "?" ? Et : R[1] === "@" ? St : O }), i.removeAttribute(a);
|
|
340
|
+
} else
|
|
341
|
+
a.startsWith(_) && (h.push({ type: 6, index: n }), i.removeAttribute(a));
|
|
342
|
+
if (rt.test(i.tagName)) {
|
|
343
|
+
const a = i.textContent.split(_), u = a.length - 1;
|
|
344
|
+
if (u > 0) {
|
|
345
|
+
i.textContent = T ? T.emptyScript : "";
|
|
346
|
+
for (let $ = 0; $ < u; $++)
|
|
347
|
+
i.append(a[$], P()), m.nextNode(), h.push({ type: 2, index: ++n });
|
|
348
|
+
i.append(a[u], P());
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
} else if (i.nodeType === 8)
|
|
352
|
+
if (i.data === st)
|
|
353
|
+
h.push({ type: 2, index: n });
|
|
354
|
+
else {
|
|
355
|
+
let a = -1;
|
|
356
|
+
for (; (a = i.data.indexOf(_, a + 1)) !== -1; )
|
|
357
|
+
h.push({ type: 7, index: n }), a += _.length - 1;
|
|
358
|
+
}
|
|
359
|
+
n++;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
static createElement(t, e) {
|
|
363
|
+
const s = g.createElement("template");
|
|
364
|
+
return s.innerHTML = t, s;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function E(r, t, e = r, s) {
|
|
368
|
+
var o, l;
|
|
369
|
+
if (t === v)
|
|
370
|
+
return t;
|
|
371
|
+
let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
|
|
372
|
+
const n = x(t) ? void 0 : t._$litDirective$;
|
|
373
|
+
return (i == null ? void 0 : i.constructor) !== n && ((l = i == null ? void 0 : i._$AO) == null || l.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = E(r, i._$AS(r, t.values), i, s)), t;
|
|
374
|
+
}
|
|
375
|
+
class yt {
|
|
376
|
+
constructor(t, e) {
|
|
377
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
378
|
+
}
|
|
379
|
+
get parentNode() {
|
|
380
|
+
return this._$AM.parentNode;
|
|
381
|
+
}
|
|
382
|
+
get _$AU() {
|
|
383
|
+
return this._$AM._$AU;
|
|
384
|
+
}
|
|
385
|
+
u(t) {
|
|
386
|
+
const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? g).importNode(e, !0);
|
|
387
|
+
m.currentNode = i;
|
|
388
|
+
let n = m.nextNode(), o = 0, l = 0, h = s[0];
|
|
389
|
+
for (; h !== void 0; ) {
|
|
390
|
+
if (o === h.index) {
|
|
391
|
+
let c;
|
|
392
|
+
h.type === 2 ? c = new H(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new bt(n, this, t)), this._$AV.push(c), h = s[++l];
|
|
393
|
+
}
|
|
394
|
+
o !== (h == null ? void 0 : h.index) && (n = m.nextNode(), o++);
|
|
395
|
+
}
|
|
396
|
+
return m.currentNode = g, i;
|
|
397
|
+
}
|
|
398
|
+
p(t) {
|
|
399
|
+
let e = 0;
|
|
400
|
+
for (const s of this._$AV)
|
|
401
|
+
s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
class H {
|
|
405
|
+
get _$AU() {
|
|
406
|
+
var t;
|
|
407
|
+
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
408
|
+
}
|
|
409
|
+
constructor(t, e, s, i) {
|
|
410
|
+
this.type = 2, this._$AH = d, 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;
|
|
411
|
+
}
|
|
412
|
+
get parentNode() {
|
|
413
|
+
let t = this._$AA.parentNode;
|
|
414
|
+
const e = this._$AM;
|
|
415
|
+
return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
|
|
416
|
+
}
|
|
417
|
+
get startNode() {
|
|
418
|
+
return this._$AA;
|
|
419
|
+
}
|
|
420
|
+
get endNode() {
|
|
421
|
+
return this._$AB;
|
|
422
|
+
}
|
|
423
|
+
_$AI(t, e = this) {
|
|
424
|
+
t = E(this, t, e), x(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== v && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : mt(t) ? this.k(t) : this._(t);
|
|
425
|
+
}
|
|
426
|
+
S(t) {
|
|
427
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
428
|
+
}
|
|
429
|
+
T(t) {
|
|
430
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
|
|
431
|
+
}
|
|
432
|
+
_(t) {
|
|
433
|
+
this._$AH !== d && x(this._$AH) ? this._$AA.nextSibling.data = t : this.T(g.createTextNode(t)), this._$AH = t;
|
|
434
|
+
}
|
|
435
|
+
$(t) {
|
|
436
|
+
var n;
|
|
437
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = U.createElement(nt(s.h, s.h[0]), this.options)), s);
|
|
438
|
+
if (((n = this._$AH) == null ? void 0 : n._$AD) === i)
|
|
439
|
+
this._$AH.p(e);
|
|
440
|
+
else {
|
|
441
|
+
const o = new yt(i, this), l = o.u(this.options);
|
|
442
|
+
o.p(e), this.T(l), this._$AH = o;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
_$AC(t) {
|
|
446
|
+
let e = Q.get(t.strings);
|
|
447
|
+
return e === void 0 && Q.set(t.strings, e = new U(t)), e;
|
|
448
|
+
}
|
|
449
|
+
k(t) {
|
|
450
|
+
it(this._$AH) || (this._$AH = [], this._$AR());
|
|
451
|
+
const e = this._$AH;
|
|
452
|
+
let s, i = 0;
|
|
453
|
+
for (const n of t)
|
|
454
|
+
i === e.length ? e.push(s = new H(this.S(P()), this.S(P()), this, this.options)) : s = e[i], s._$AI(n), i++;
|
|
455
|
+
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
456
|
+
}
|
|
457
|
+
_$AR(t = this._$AA.nextSibling, e) {
|
|
458
|
+
var s;
|
|
459
|
+
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
460
|
+
const i = t.nextSibling;
|
|
461
|
+
t.remove(), t = i;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
setConnected(t) {
|
|
465
|
+
var e;
|
|
466
|
+
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
class O {
|
|
470
|
+
get tagName() {
|
|
471
|
+
return this.element.tagName;
|
|
472
|
+
}
|
|
473
|
+
get _$AU() {
|
|
474
|
+
return this._$AM._$AU;
|
|
475
|
+
}
|
|
476
|
+
constructor(t, e, s, i, n) {
|
|
477
|
+
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d;
|
|
478
|
+
}
|
|
479
|
+
_$AI(t, e = this, s, i) {
|
|
480
|
+
const n = this.strings;
|
|
481
|
+
let o = !1;
|
|
482
|
+
if (n === void 0)
|
|
483
|
+
t = E(this, t, e, 0), o = !x(t) || t !== this._$AH && t !== v, o && (this._$AH = t);
|
|
484
|
+
else {
|
|
485
|
+
const l = t;
|
|
486
|
+
let h, c;
|
|
487
|
+
for (t = n[0], h = 0; h < n.length - 1; h++)
|
|
488
|
+
c = E(this, l[s + h], e, h), c === v && (c = this._$AH[h]), o || (o = !x(c) || c !== this._$AH[h]), c === d ? t = d : t !== d && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c;
|
|
489
|
+
}
|
|
490
|
+
o && !i && this.j(t);
|
|
491
|
+
}
|
|
492
|
+
j(t) {
|
|
493
|
+
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
class vt extends O {
|
|
497
|
+
constructor() {
|
|
498
|
+
super(...arguments), this.type = 3;
|
|
499
|
+
}
|
|
500
|
+
j(t) {
|
|
501
|
+
this.element[this.name] = t === d ? void 0 : t;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
class Et extends O {
|
|
505
|
+
constructor() {
|
|
506
|
+
super(...arguments), this.type = 4;
|
|
507
|
+
}
|
|
508
|
+
j(t) {
|
|
509
|
+
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
class St extends O {
|
|
513
|
+
constructor(t, e, s, i, n) {
|
|
514
|
+
super(t, e, s, i, n), this.type = 5;
|
|
515
|
+
}
|
|
516
|
+
_$AI(t, e = this) {
|
|
517
|
+
if ((t = E(this, t, e, 0) ?? d) === v)
|
|
518
|
+
return;
|
|
519
|
+
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== d && (s === d || i);
|
|
520
|
+
i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
521
|
+
}
|
|
522
|
+
handleEvent(t) {
|
|
523
|
+
var e;
|
|
524
|
+
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
class bt {
|
|
528
|
+
constructor(t, e, s) {
|
|
529
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
530
|
+
}
|
|
531
|
+
get _$AU() {
|
|
532
|
+
return this._$AM._$AU;
|
|
533
|
+
}
|
|
534
|
+
_$AI(t) {
|
|
535
|
+
E(this, t);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
const z = C.litHtmlPolyfillSupport;
|
|
539
|
+
z == null || z(U, H), (C.litHtmlVersions ?? (C.litHtmlVersions = [])).push("3.1.3");
|
|
540
|
+
const Ct = (r, t, e) => {
|
|
541
|
+
const s = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
542
|
+
let i = s._$litPart$;
|
|
543
|
+
if (i === void 0) {
|
|
544
|
+
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
545
|
+
s._$litPart$ = i = new H(t.insertBefore(P(), n), n, void 0, e ?? {});
|
|
546
|
+
}
|
|
547
|
+
return i._$AI(r), i;
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
* @license
|
|
551
|
+
* Copyright 2017 Google LLC
|
|
552
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
553
|
+
*/
|
|
554
|
+
class w extends y {
|
|
555
|
+
constructor() {
|
|
556
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
557
|
+
}
|
|
558
|
+
createRenderRoot() {
|
|
559
|
+
var e;
|
|
560
|
+
const t = super.createRenderRoot();
|
|
561
|
+
return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
|
|
562
|
+
}
|
|
563
|
+
update(t) {
|
|
564
|
+
const e = this.render();
|
|
565
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ct(e, this.renderRoot, this.renderOptions);
|
|
566
|
+
}
|
|
567
|
+
connectedCallback() {
|
|
568
|
+
var t;
|
|
569
|
+
super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
|
|
570
|
+
}
|
|
571
|
+
disconnectedCallback() {
|
|
572
|
+
var t;
|
|
573
|
+
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
|
574
|
+
}
|
|
575
|
+
render() {
|
|
576
|
+
return v;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
var X;
|
|
580
|
+
w._$litElement$ = !0, w.finalized = !0, (X = globalThis.litElementHydrateSupport) == null || X.call(globalThis, { LitElement: w });
|
|
581
|
+
const I = globalThis.litElementPolyfillSupport;
|
|
582
|
+
I == null || I({ LitElement: w });
|
|
583
|
+
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5");
|
|
584
|
+
class wt extends w {
|
|
585
|
+
createRenderRoot() {
|
|
586
|
+
return this;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
var Pt = (r, t, e, s) => {
|
|
590
|
+
for (var i = t, n = r.length - 1, o; n >= 0; n--)
|
|
591
|
+
(o = r[n]) && (i = o(i) || i);
|
|
592
|
+
return i;
|
|
593
|
+
};
|
|
594
|
+
let D = class extends wt {
|
|
595
|
+
constructor() {
|
|
596
|
+
super(...arguments), this.titleRecipeCard = "", this.recipeId = "", this.requestHeaders = new Headers();
|
|
597
|
+
}
|
|
598
|
+
connectedCallback() {
|
|
599
|
+
super.connectedCallback(), console.debug("[MealzComponents] loading recipe card"), this.requestHeaders.append("Authorization", "Bearer <your-token>"), this.requestHeaders.append("miam-origin", "partners"), this.requestHeaders.append("Content-Type", "application/vnd.api+json");
|
|
600
|
+
}
|
|
601
|
+
render() {
|
|
602
|
+
this.recipeCard = this.querySelector(".mealz-recipe-card"), this.recipeCard && this.getInitialStatus();
|
|
603
|
+
}
|
|
604
|
+
getInitialStatus() {
|
|
605
|
+
var s;
|
|
606
|
+
const r = (s = this.attributes["starting-data"]) == null ? void 0 : s.value;
|
|
607
|
+
if (console.log(r), !r)
|
|
608
|
+
return;
|
|
609
|
+
const { id: t, title: e } = JSON.parse(r);
|
|
610
|
+
this.recipeId = t, this.titleRecipeCard = e, this.removeAttribute("starting-data"), this.updateDOM();
|
|
611
|
+
}
|
|
612
|
+
updateDOM() {
|
|
613
|
+
this.recipeCard.querySelectorAll("span").forEach((r) => r.textContent = this.titleRecipeCard);
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
D = Pt([
|
|
617
|
+
ot("mealz-recipe-card")
|
|
618
|
+
], D);
|
|
619
|
+
window.customElements.get("mealz-recipe-card") || window.customElements.define("mealz-recipe-card", D);
|
|
620
|
+
export {
|
|
621
|
+
D as MealzRecipeCard
|
|
622
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const N=globalThis,j=N.ShadowRoot&&(void 0===N.ShadyCSS||N.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Y=Symbol(),B=new WeakMap;
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2019 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/let ht=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Y)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(j&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=B.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&B.set(e,t))}return t}toString(){return this.cssText}};const q=j?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new ht("string"==typeof t?t:t+"",void 0,Y))(e)})(t):t
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2017 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*/,{is:ct,defineProperty:dt,getOwnPropertyDescriptor:pt,getOwnPropertyNames:ut,getOwnPropertySymbols:$t,getPrototypeOf:_t}=Object,f=globalThis,W=f.trustedTypes,ft=W?W.emptyScript:"",M=f.reactiveElementPolyfillSupport,b=(t,e)=>t,L={toAttribute(t,e){switch(e){case Boolean:t=t?ft:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},tt=(t,e)=>!ct(t,e),V={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:tt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),f.litPropertyMetadata??(f.litPropertyMetadata=new WeakMap);class y 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=V){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&dt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=pt(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return null==i?void 0:i.call(this)},set(e){const n=null==i?void 0:i.call(this);r.call(this,e),this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??V}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=_t(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...ut(t),...$t(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}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 t of s)e.unshift(q(t))}else void 0!==t&&e.push(q(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?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((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach((t=>t(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||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,e)=>{if(j)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const s of e){const e=document.createElement("style"),i=N.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var s;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const n=(void 0!==(null==(s=i.converter)?void 0:s.toAttribute)?i.converter:L).toAttribute(e,i.type);this._$Em=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){var s;const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(s=t.converter)?void 0:s.fromAttribute)?t.converter:L;this._$Em=r,this[r]=n.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],s)}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)})),this.update(s)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach((t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)})),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((t=>this._$EC(t,this[t])))),this._$EU()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[b("elementProperties")]=new Map,y[b("finalized")]=new Map,null==M||M({ReactiveElement:y}),(f.reactiveElementVersions??(f.reactiveElementVersions=[])).push("2.0.4");
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2017 Google LLC
|
|
20
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
+
*/
|
|
22
|
+
const C=globalThis,T=C.trustedTypes,J=T?T.createPolicy("lit-html",{createHTML:t=>t}):void 0,_=`lit$${Math.random().toFixed(9).slice(2)}$`,st="?"+_,At=`<${st}>`,g=document,P=()=>g.createComment(""),x=t=>null===t||"object"!=typeof t&&"function"!=typeof t,it=Array.isArray,k="[ \t\n\f\r]",S=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,K=/-->/g,F=/>/g,A=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Z=/'/g,G=/"/g,rt=/^(?:script|style|textarea|title)$/i,v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Q=new WeakMap,m=g.createTreeWalker(g,129);function nt(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==J?J.createHTML(e):e}class U{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0;const o=t.length-1,l=this.parts,[h,a]=((t,e)=>{const s=t.length-1,i=[];let r,n=2===e?"<svg>":"",o=S;for(let e=0;e<s;e++){const s=t[e];let l,h,a=-1,d=0;for(;d<s.length&&(o.lastIndex=d,h=o.exec(s),null!==h);)d=o.lastIndex,o===S?"!--"===h[1]?o=K:void 0!==h[1]?o=F:void 0!==h[2]?(rt.test(h[2])&&(r=RegExp("</"+h[2],"g")),o=A):void 0!==h[3]&&(o=A):o===A?">"===h[0]?(o=r??S,a=-1):void 0===h[1]?a=-2:(a=o.lastIndex-h[2].length,l=h[1],o=void 0===h[3]?A:'"'===h[3]?G:Z):o===G||o===Z?o=A:o===K||o===F?o=S:(o=A,r=void 0);const c=o===A&&t[e+1].startsWith("/>")?" ":"";n+=o===S?s+At:a>=0?(i.push(l),s.slice(0,a)+"$lit$"+s.slice(a)+_+c):s+_+(-2===a?e:c)}return[nt(t,n+(t[s]||"<?>")+(2===e?"</svg>":"")),i]})(t,e);if(this.el=U.createElement(h,s),m.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=m.nextNode())&&l.length<o;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith("$lit$")){const e=a[n++],s=i.getAttribute(t).split(_),o=/([.?@])?(.*)/.exec(e);l.push({type:1,index:r,name:o[2],strings:s,ctor:"."===o[1]?vt:"?"===o[1]?Et:"@"===o[1]?St:O}),i.removeAttribute(t)}else t.startsWith(_)&&(l.push({type:6,index:r}),i.removeAttribute(t));if(rt.test(i.tagName)){const t=i.textContent.split(_),e=t.length-1;if(e>0){i.textContent=T?T.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],P()),m.nextNode(),l.push({type:2,index:++r});i.append(t[e],P())}}}else if(8===i.nodeType)if(i.data===st)l.push({type:2,index:r});else{let t=-1;for(;-1!==(t=i.data.indexOf(_,t+1));)l.push({type:7,index:r}),t+=_.length-1}r++}}static createElement(t,e){const s=g.createElement("template");return s.innerHTML=t,s}}function E(t,e,s=t,i){var r,n;if(e===v)return e;let o=void 0!==i?null==(r=s._$Co)?void 0:r[i]:s._$Cl;const l=x(e)?void 0:e._$litDirective$;return(null==o?void 0:o.constructor)!==l&&(null==(n=null==o?void 0:o._$AO)||n.call(o,!1),void 0===l?o=void 0:(o=new l(t),o._$AT(t,s,i)),void 0!==i?(s._$Co??(s._$Co=[]))[i]=o:s._$Cl=o),void 0!==o&&(e=E(t,o._$AS(t,e.values),o,i)),e}class yt{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=((null==t?void 0:t.creationScope)??g).importNode(e,!0);m.currentNode=i;let r=m.nextNode(),n=0,o=0,l=s[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new H(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new bt(r,this,t)),this._$AV.push(e),l=s[++o]}n!==(null==l?void 0:l.index)&&(r=m.nextNode(),n++)}return m.currentNode=g,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class H{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(null==i?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){var s;t=E(this,t,e),x(t)?t===d||null==t||""===t?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==v&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):it(s=t)||"function"==typeof(null==s?void 0:s[Symbol.iterator])?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==d&&x(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){var e;const{values:s,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=U.createElement(nt(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===r)this._$AH.p(s);else{const t=new yt(r,this),e=t.u(this.options);t.p(s),this.T(e),this._$AH=t}}_$AC(t){let e=Q.get(t.strings);return void 0===e&&Q.set(t.strings,e=new U(t)),e}k(t){it(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new H(this.S(P()),this.S(P()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for(null==(s=this._$AP)||s.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class O{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const r=this.strings;let n=!1;if(void 0===r)t=E(this,t,e,0),n=!x(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{const i=t;let o,l;for(t=r[0],o=0;o<r.length-1;o++)l=E(this,i[s+o],e,o),l===v&&(l=this._$AH[o]),n||(n=!x(l)||l!==this._$AH[o]),l===d?t=d:t!==d&&(t+=(l??"")+r[o+1]),this._$AH[o]=l}n&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class vt extends O{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Et extends O{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class St extends O{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??d)===v)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class bt{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 z=C.litHtmlPolyfillSupport;null==z||z(U,H),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.1.3");
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2017 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/
|
|
28
|
+
class w extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=(null==s?void 0:s.renderBefore)??e;let r=i._$litPart$;if(void 0===r){const t=(null==s?void 0:s.renderBefore)??null;i._$litPart$=r=new H(e.insertBefore(P(),t),t,void 0,s??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return v}}var X;w._$litElement$=!0,w.finalized=!0,null==(X=globalThis.litElementHydrateSupport)||X.call(globalThis,{LitElement:w});const I=globalThis.litElementPolyfillSupport;null==I||I({LitElement:w}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");class wt extends w{createRenderRoot(){return this}}let D=class extends wt{constructor(){super(...arguments),this.titleRecipeCard="",this.recipeId="",this.requestHeaders=new Headers}connectedCallback(){super.connectedCallback(),console.debug("[MealzComponents] loading recipe card"),this.requestHeaders.append("Authorization","Bearer <your-token>"),this.requestHeaders.append("miam-origin","partners"),this.requestHeaders.append("Content-Type","application/vnd.api+json")}render(){this.recipeCard=this.querySelector(".mealz-recipe-card"),this.recipeCard&&this.getInitialStatus()}getInitialStatus(){var t;const e=null==(t=this.attributes["starting-data"])?void 0:t.value;if(console.log(e),!e)return;const{id:s,title:i}=JSON.parse(e);this.recipeId=s,this.titleRecipeCard=i,this.removeAttribute("starting-data"),this.updateDOM()}updateDOM(){this.recipeCard.querySelectorAll("span").forEach((t=>t.textContent=this.titleRecipeCard))}};var r;D=((t,e,s,i)=>{for(var r,n=e,o=t.length-1;o>=0;o--)(r=t[o])&&(n=r(n)||n);return n})([(r="mealz-recipe-card",(t,e)=>{void 0!==e?e.addInitializer((()=>{customElements.define(r,t)})):customElements.define(r,t)})],D),window.customElements.get("mealz-recipe-card")||window.customElements.define("mealz-recipe-card",D);export{D as MealzRecipeCard};
|