@sesamy/sesamy-components 0.0.2 → 0.0.4
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.
|
@@ -0,0 +1,1257 @@
|
|
|
1
|
+
var et = Object.defineProperty;
|
|
2
|
+
var tt = (t, e, n) => e in t ? et(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var E = (t, e, n) => tt(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
function L() {
|
|
5
|
+
}
|
|
6
|
+
function A(t, e) {
|
|
7
|
+
for (const n in e) t[n] = e[n];
|
|
8
|
+
return (
|
|
9
|
+
/** @type {T & S} */
|
|
10
|
+
t
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function Be(t) {
|
|
14
|
+
return t();
|
|
15
|
+
}
|
|
16
|
+
function Ee() {
|
|
17
|
+
return /* @__PURE__ */ Object.create(null);
|
|
18
|
+
}
|
|
19
|
+
function F(t) {
|
|
20
|
+
t.forEach(Be);
|
|
21
|
+
}
|
|
22
|
+
function Te(t) {
|
|
23
|
+
return typeof t == "function";
|
|
24
|
+
}
|
|
25
|
+
function U(t, e) {
|
|
26
|
+
return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
|
|
27
|
+
}
|
|
28
|
+
let X;
|
|
29
|
+
function Ie(t, e) {
|
|
30
|
+
return t === e ? !0 : (X || (X = document.createElement("a")), X.href = e, t === X.href);
|
|
31
|
+
}
|
|
32
|
+
function nt(t) {
|
|
33
|
+
return Object.keys(t).length === 0;
|
|
34
|
+
}
|
|
35
|
+
function ze(t, e, n, s) {
|
|
36
|
+
if (t) {
|
|
37
|
+
const l = De(t, e, n, s);
|
|
38
|
+
return t[0](l);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function De(t, e, n, s) {
|
|
42
|
+
return t[1] && s ? A(n.ctx.slice(), t[1](s(e))) : n.ctx;
|
|
43
|
+
}
|
|
44
|
+
function Fe(t, e, n, s) {
|
|
45
|
+
if (t[2] && s) {
|
|
46
|
+
const l = t[2](s(n));
|
|
47
|
+
if (e.dirty === void 0)
|
|
48
|
+
return l;
|
|
49
|
+
if (typeof l == "object") {
|
|
50
|
+
const i = [], o = Math.max(e.dirty.length, l.length);
|
|
51
|
+
for (let r = 0; r < o; r += 1)
|
|
52
|
+
i[r] = e.dirty[r] | l[r];
|
|
53
|
+
return i;
|
|
54
|
+
}
|
|
55
|
+
return e.dirty | l;
|
|
56
|
+
}
|
|
57
|
+
return e.dirty;
|
|
58
|
+
}
|
|
59
|
+
function He(t, e, n, s, l, i) {
|
|
60
|
+
if (l) {
|
|
61
|
+
const o = De(e, n, s, i);
|
|
62
|
+
t.p(o, l);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function Re(t) {
|
|
66
|
+
if (t.ctx.length > 32) {
|
|
67
|
+
const e = [], n = t.ctx.length / 32;
|
|
68
|
+
for (let s = 0; s < n; s++)
|
|
69
|
+
e[s] = -1;
|
|
70
|
+
return e;
|
|
71
|
+
}
|
|
72
|
+
return -1;
|
|
73
|
+
}
|
|
74
|
+
function te(t) {
|
|
75
|
+
const e = {};
|
|
76
|
+
for (const n in t) n[0] !== "$" && (e[n] = t[n]);
|
|
77
|
+
return e;
|
|
78
|
+
}
|
|
79
|
+
function xe(t, e) {
|
|
80
|
+
const n = {};
|
|
81
|
+
e = new Set(e);
|
|
82
|
+
for (const s in t) !e.has(s) && s[0] !== "$" && (n[s] = t[s]);
|
|
83
|
+
return n;
|
|
84
|
+
}
|
|
85
|
+
function g(t, e) {
|
|
86
|
+
t.appendChild(e);
|
|
87
|
+
}
|
|
88
|
+
function st(t, e, n) {
|
|
89
|
+
const s = lt(t);
|
|
90
|
+
if (!s.getElementById(e)) {
|
|
91
|
+
const l = m("style");
|
|
92
|
+
l.id = e, l.textContent = n, it(s, l);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function lt(t) {
|
|
96
|
+
if (!t) return document;
|
|
97
|
+
const e = t.getRootNode ? t.getRootNode() : t.ownerDocument;
|
|
98
|
+
return e && /** @type {ShadowRoot} */
|
|
99
|
+
e.host ? (
|
|
100
|
+
/** @type {ShadowRoot} */
|
|
101
|
+
e
|
|
102
|
+
) : t.ownerDocument;
|
|
103
|
+
}
|
|
104
|
+
function it(t, e) {
|
|
105
|
+
return g(
|
|
106
|
+
/** @type {Document} */
|
|
107
|
+
t.head || t,
|
|
108
|
+
e
|
|
109
|
+
), e.sheet;
|
|
110
|
+
}
|
|
111
|
+
function N(t, e, n) {
|
|
112
|
+
t.insertBefore(e, n || null);
|
|
113
|
+
}
|
|
114
|
+
function x(t) {
|
|
115
|
+
t.parentNode && t.parentNode.removeChild(t);
|
|
116
|
+
}
|
|
117
|
+
function ae(t, e) {
|
|
118
|
+
for (let n = 0; n < t.length; n += 1)
|
|
119
|
+
t[n] && t[n].d(e);
|
|
120
|
+
}
|
|
121
|
+
function m(t) {
|
|
122
|
+
return document.createElement(t);
|
|
123
|
+
}
|
|
124
|
+
function Ke(t) {
|
|
125
|
+
return document.createElementNS("http://www.w3.org/2000/svg", t);
|
|
126
|
+
}
|
|
127
|
+
function Ue(t) {
|
|
128
|
+
return document.createTextNode(t);
|
|
129
|
+
}
|
|
130
|
+
function w() {
|
|
131
|
+
return Ue(" ");
|
|
132
|
+
}
|
|
133
|
+
function _e() {
|
|
134
|
+
return Ue("");
|
|
135
|
+
}
|
|
136
|
+
function ne(t, e, n, s) {
|
|
137
|
+
return t.addEventListener(e, n, s), () => t.removeEventListener(e, n, s);
|
|
138
|
+
}
|
|
139
|
+
function _(t, e, n) {
|
|
140
|
+
n == null ? t.removeAttribute(e) : t.getAttribute(e) !== n && t.setAttribute(e, n);
|
|
141
|
+
}
|
|
142
|
+
function se(t, e) {
|
|
143
|
+
for (const n in e)
|
|
144
|
+
_(t, n, e[n]);
|
|
145
|
+
}
|
|
146
|
+
function ot(t) {
|
|
147
|
+
let e;
|
|
148
|
+
return {
|
|
149
|
+
/* push */
|
|
150
|
+
p(...n) {
|
|
151
|
+
e = n, e.forEach((s) => t.push(s));
|
|
152
|
+
},
|
|
153
|
+
/* remove */
|
|
154
|
+
r() {
|
|
155
|
+
e.forEach((n) => t.splice(t.indexOf(n), 1));
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function rt(t) {
|
|
160
|
+
return Array.from(t.childNodes);
|
|
161
|
+
}
|
|
162
|
+
function Ne(t, e) {
|
|
163
|
+
t.value = e ?? "";
|
|
164
|
+
}
|
|
165
|
+
function ct(t) {
|
|
166
|
+
const e = {};
|
|
167
|
+
return t.childNodes.forEach(
|
|
168
|
+
/** @param {Element} node */
|
|
169
|
+
(n) => {
|
|
170
|
+
e[n.slot || "default"] = !0;
|
|
171
|
+
}
|
|
172
|
+
), e;
|
|
173
|
+
}
|
|
174
|
+
let ge;
|
|
175
|
+
function K(t) {
|
|
176
|
+
ge = t;
|
|
177
|
+
}
|
|
178
|
+
const T = [], Le = [];
|
|
179
|
+
let z = [];
|
|
180
|
+
const Ce = [], ut = /* @__PURE__ */ Promise.resolve();
|
|
181
|
+
let de = !1;
|
|
182
|
+
function ft() {
|
|
183
|
+
de || (de = !0, ut.then(Ve));
|
|
184
|
+
}
|
|
185
|
+
function he(t) {
|
|
186
|
+
z.push(t);
|
|
187
|
+
}
|
|
188
|
+
const ue = /* @__PURE__ */ new Set();
|
|
189
|
+
let B = 0;
|
|
190
|
+
function Ve() {
|
|
191
|
+
if (B !== 0)
|
|
192
|
+
return;
|
|
193
|
+
const t = ge;
|
|
194
|
+
do {
|
|
195
|
+
try {
|
|
196
|
+
for (; B < T.length; ) {
|
|
197
|
+
const e = T[B];
|
|
198
|
+
B++, K(e), at(e.$$);
|
|
199
|
+
}
|
|
200
|
+
} catch (e) {
|
|
201
|
+
throw T.length = 0, B = 0, e;
|
|
202
|
+
}
|
|
203
|
+
for (K(null), T.length = 0, B = 0; Le.length; ) Le.pop()();
|
|
204
|
+
for (let e = 0; e < z.length; e += 1) {
|
|
205
|
+
const n = z[e];
|
|
206
|
+
ue.has(n) || (ue.add(n), n());
|
|
207
|
+
}
|
|
208
|
+
z.length = 0;
|
|
209
|
+
} while (T.length);
|
|
210
|
+
for (; Ce.length; )
|
|
211
|
+
Ce.pop()();
|
|
212
|
+
de = !1, ue.clear(), K(t);
|
|
213
|
+
}
|
|
214
|
+
function at(t) {
|
|
215
|
+
if (t.fragment !== null) {
|
|
216
|
+
t.update(), F(t.before_update);
|
|
217
|
+
const e = t.dirty;
|
|
218
|
+
t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(he);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function dt(t) {
|
|
222
|
+
const e = [], n = [];
|
|
223
|
+
z.forEach((s) => t.indexOf(s) === -1 ? e.push(s) : n.push(s)), n.forEach((s) => s()), z = e;
|
|
224
|
+
}
|
|
225
|
+
const Z = /* @__PURE__ */ new Set();
|
|
226
|
+
let P;
|
|
227
|
+
function ht() {
|
|
228
|
+
P = {
|
|
229
|
+
r: 0,
|
|
230
|
+
c: [],
|
|
231
|
+
p: P
|
|
232
|
+
// parent group
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function _t() {
|
|
236
|
+
P.r || F(P.c), P = P.p;
|
|
237
|
+
}
|
|
238
|
+
function j(t, e) {
|
|
239
|
+
t && t.i && (Z.delete(t), t.i(e));
|
|
240
|
+
}
|
|
241
|
+
function D(t, e, n, s) {
|
|
242
|
+
if (t && t.o) {
|
|
243
|
+
if (Z.has(t)) return;
|
|
244
|
+
Z.add(t), P.c.push(() => {
|
|
245
|
+
Z.delete(t), s && (n && t.d(1), s());
|
|
246
|
+
}), t.o(e);
|
|
247
|
+
} else s && s();
|
|
248
|
+
}
|
|
249
|
+
function I(t) {
|
|
250
|
+
return (t == null ? void 0 : t.length) !== void 0 ? t : Array.from(t);
|
|
251
|
+
}
|
|
252
|
+
function me(t, e) {
|
|
253
|
+
const n = {}, s = {}, l = { $$scope: 1 };
|
|
254
|
+
let i = t.length;
|
|
255
|
+
for (; i--; ) {
|
|
256
|
+
const o = t[i], r = e[i];
|
|
257
|
+
if (r) {
|
|
258
|
+
for (const u in o)
|
|
259
|
+
u in r || (s[u] = 1);
|
|
260
|
+
for (const u in r)
|
|
261
|
+
l[u] || (n[u] = r[u], l[u] = 1);
|
|
262
|
+
t[i] = r;
|
|
263
|
+
} else
|
|
264
|
+
for (const u in o)
|
|
265
|
+
l[u] = 1;
|
|
266
|
+
}
|
|
267
|
+
for (const o in s)
|
|
268
|
+
o in n || (n[o] = void 0);
|
|
269
|
+
return n;
|
|
270
|
+
}
|
|
271
|
+
function gt(t) {
|
|
272
|
+
return typeof t == "object" && t !== null ? t : {};
|
|
273
|
+
}
|
|
274
|
+
function Je(t) {
|
|
275
|
+
t && t.c();
|
|
276
|
+
}
|
|
277
|
+
function $e(t, e, n) {
|
|
278
|
+
const { fragment: s, after_update: l } = t.$$;
|
|
279
|
+
s && s.m(e, n), he(() => {
|
|
280
|
+
const i = t.$$.on_mount.map(Be).filter(Te);
|
|
281
|
+
t.$$.on_destroy ? t.$$.on_destroy.push(...i) : F(i), t.$$.on_mount = [];
|
|
282
|
+
}), l.forEach(he);
|
|
283
|
+
}
|
|
284
|
+
function be(t, e) {
|
|
285
|
+
const n = t.$$;
|
|
286
|
+
n.fragment !== null && (dt(n.after_update), F(n.on_destroy), n.fragment && n.fragment.d(e), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
287
|
+
}
|
|
288
|
+
function mt(t, e) {
|
|
289
|
+
t.$$.dirty[0] === -1 && (T.push(t), ft(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
290
|
+
}
|
|
291
|
+
function le(t, e, n, s, l, i, o = null, r = [-1]) {
|
|
292
|
+
const u = ge;
|
|
293
|
+
K(t);
|
|
294
|
+
const a = t.$$ = {
|
|
295
|
+
fragment: null,
|
|
296
|
+
ctx: [],
|
|
297
|
+
// state
|
|
298
|
+
props: i,
|
|
299
|
+
update: L,
|
|
300
|
+
not_equal: l,
|
|
301
|
+
bound: Ee(),
|
|
302
|
+
// lifecycle
|
|
303
|
+
on_mount: [],
|
|
304
|
+
on_destroy: [],
|
|
305
|
+
on_disconnect: [],
|
|
306
|
+
before_update: [],
|
|
307
|
+
after_update: [],
|
|
308
|
+
context: new Map(e.context || (u ? u.$$.context : [])),
|
|
309
|
+
// everything else
|
|
310
|
+
callbacks: Ee(),
|
|
311
|
+
dirty: r,
|
|
312
|
+
skip_bound: !1,
|
|
313
|
+
root: e.target || u.$$.root
|
|
314
|
+
};
|
|
315
|
+
o && o(a.root);
|
|
316
|
+
let v = !1;
|
|
317
|
+
if (a.ctx = n ? n(t, e.props || {}, ($, c, ...p) => {
|
|
318
|
+
const f = p.length ? p[0] : c;
|
|
319
|
+
return a.ctx && l(a.ctx[$], a.ctx[$] = f) && (!a.skip_bound && a.bound[$] && a.bound[$](f), v && mt(t, $)), c;
|
|
320
|
+
}) : [], a.update(), v = !0, F(a.before_update), a.fragment = s ? s(a.ctx) : !1, e.target) {
|
|
321
|
+
if (e.hydrate) {
|
|
322
|
+
const $ = rt(e.target);
|
|
323
|
+
a.fragment && a.fragment.l($), $.forEach(x);
|
|
324
|
+
} else
|
|
325
|
+
a.fragment && a.fragment.c();
|
|
326
|
+
e.intro && j(t.$$.fragment), $e(t, e.target, e.anchor), Ve();
|
|
327
|
+
}
|
|
328
|
+
K(u);
|
|
329
|
+
}
|
|
330
|
+
let Ge;
|
|
331
|
+
typeof HTMLElement == "function" && (Ge = class extends HTMLElement {
|
|
332
|
+
constructor(e, n, s) {
|
|
333
|
+
super();
|
|
334
|
+
/** The Svelte component constructor */
|
|
335
|
+
E(this, "$$ctor");
|
|
336
|
+
/** Slots */
|
|
337
|
+
E(this, "$$s");
|
|
338
|
+
/** The Svelte component instance */
|
|
339
|
+
E(this, "$$c");
|
|
340
|
+
/** Whether or not the custom element is connected */
|
|
341
|
+
E(this, "$$cn", !1);
|
|
342
|
+
/** Component props data */
|
|
343
|
+
E(this, "$$d", {});
|
|
344
|
+
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
345
|
+
E(this, "$$r", !1);
|
|
346
|
+
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
347
|
+
E(this, "$$p_d", {});
|
|
348
|
+
/** @type {Record<string, Function[]>} Event listeners */
|
|
349
|
+
E(this, "$$l", {});
|
|
350
|
+
/** @type {Map<Function, Function>} Event listener unsubscribe functions */
|
|
351
|
+
E(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
352
|
+
this.$$ctor = e, this.$$s = n, s && this.attachShadow({ mode: "open" });
|
|
353
|
+
}
|
|
354
|
+
addEventListener(e, n, s) {
|
|
355
|
+
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) {
|
|
356
|
+
const l = this.$$c.$on(e, n);
|
|
357
|
+
this.$$l_u.set(n, l);
|
|
358
|
+
}
|
|
359
|
+
super.addEventListener(e, n, s);
|
|
360
|
+
}
|
|
361
|
+
removeEventListener(e, n, s) {
|
|
362
|
+
if (super.removeEventListener(e, n, s), this.$$c) {
|
|
363
|
+
const l = this.$$l_u.get(n);
|
|
364
|
+
l && (l(), this.$$l_u.delete(n));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
async connectedCallback() {
|
|
368
|
+
if (this.$$cn = !0, !this.$$c) {
|
|
369
|
+
let e = function(i) {
|
|
370
|
+
return () => {
|
|
371
|
+
let o;
|
|
372
|
+
return {
|
|
373
|
+
c: function() {
|
|
374
|
+
o = m("slot"), i !== "default" && _(o, "name", i);
|
|
375
|
+
},
|
|
376
|
+
/**
|
|
377
|
+
* @param {HTMLElement} target
|
|
378
|
+
* @param {HTMLElement} [anchor]
|
|
379
|
+
*/
|
|
380
|
+
m: function(a, v) {
|
|
381
|
+
N(a, o, v);
|
|
382
|
+
},
|
|
383
|
+
d: function(a) {
|
|
384
|
+
a && x(o);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
390
|
+
return;
|
|
391
|
+
const n = {}, s = ct(this);
|
|
392
|
+
for (const i of this.$$s)
|
|
393
|
+
i in s && (n[i] = [e(i)]);
|
|
394
|
+
for (const i of this.attributes) {
|
|
395
|
+
const o = this.$$g_p(i.name);
|
|
396
|
+
o in this.$$d || (this.$$d[o] = ee(o, i.value, this.$$p_d, "toProp"));
|
|
397
|
+
}
|
|
398
|
+
for (const i in this.$$p_d)
|
|
399
|
+
!(i in this.$$d) && this[i] !== void 0 && (this.$$d[i] = this[i], delete this[i]);
|
|
400
|
+
this.$$c = new this.$$ctor({
|
|
401
|
+
target: this.shadowRoot || this,
|
|
402
|
+
props: {
|
|
403
|
+
...this.$$d,
|
|
404
|
+
$$slots: n,
|
|
405
|
+
$$scope: {
|
|
406
|
+
ctx: []
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
const l = () => {
|
|
411
|
+
this.$$r = !0;
|
|
412
|
+
for (const i in this.$$p_d)
|
|
413
|
+
if (this.$$d[i] = this.$$c.$$.ctx[this.$$c.$$.props[i]], this.$$p_d[i].reflect) {
|
|
414
|
+
const o = ee(
|
|
415
|
+
i,
|
|
416
|
+
this.$$d[i],
|
|
417
|
+
this.$$p_d,
|
|
418
|
+
"toAttribute"
|
|
419
|
+
);
|
|
420
|
+
o == null ? this.removeAttribute(this.$$p_d[i].attribute || i) : this.setAttribute(this.$$p_d[i].attribute || i, o);
|
|
421
|
+
}
|
|
422
|
+
this.$$r = !1;
|
|
423
|
+
};
|
|
424
|
+
this.$$c.$$.after_update.push(l), l();
|
|
425
|
+
for (const i in this.$$l)
|
|
426
|
+
for (const o of this.$$l[i]) {
|
|
427
|
+
const r = this.$$c.$on(i, o);
|
|
428
|
+
this.$$l_u.set(o, r);
|
|
429
|
+
}
|
|
430
|
+
this.$$l = {};
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
434
|
+
// and setting attributes through setAttribute etc, this is helpful
|
|
435
|
+
attributeChangedCallback(e, n, s) {
|
|
436
|
+
var l;
|
|
437
|
+
this.$$r || (e = this.$$g_p(e), this.$$d[e] = ee(e, s, this.$$p_d, "toProp"), (l = this.$$c) == null || l.$set({ [e]: this.$$d[e] }));
|
|
438
|
+
}
|
|
439
|
+
disconnectedCallback() {
|
|
440
|
+
this.$$cn = !1, Promise.resolve().then(() => {
|
|
441
|
+
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$c = void 0);
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
$$g_p(e) {
|
|
445
|
+
return Object.keys(this.$$p_d).find(
|
|
446
|
+
(n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e
|
|
447
|
+
) || e;
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
function ee(t, e, n, s) {
|
|
451
|
+
var i;
|
|
452
|
+
const l = (i = n[t]) == null ? void 0 : i.type;
|
|
453
|
+
if (e = l === "Boolean" && typeof e != "boolean" ? e != null : e, !s || !n[t])
|
|
454
|
+
return e;
|
|
455
|
+
if (s === "toAttribute")
|
|
456
|
+
switch (l) {
|
|
457
|
+
case "Object":
|
|
458
|
+
case "Array":
|
|
459
|
+
return e == null ? null : JSON.stringify(e);
|
|
460
|
+
case "Boolean":
|
|
461
|
+
return e ? "" : null;
|
|
462
|
+
case "Number":
|
|
463
|
+
return e ?? null;
|
|
464
|
+
default:
|
|
465
|
+
return e;
|
|
466
|
+
}
|
|
467
|
+
else
|
|
468
|
+
switch (l) {
|
|
469
|
+
case "Object":
|
|
470
|
+
case "Array":
|
|
471
|
+
return e && JSON.parse(e);
|
|
472
|
+
case "Boolean":
|
|
473
|
+
return e;
|
|
474
|
+
case "Number":
|
|
475
|
+
return e != null ? +e : e;
|
|
476
|
+
default:
|
|
477
|
+
return e;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
function Ye(t, e, n, s, l, i) {
|
|
481
|
+
let o = class extends Ge {
|
|
482
|
+
constructor() {
|
|
483
|
+
super(t, n, l), this.$$p_d = e;
|
|
484
|
+
}
|
|
485
|
+
static get observedAttributes() {
|
|
486
|
+
return Object.keys(e).map(
|
|
487
|
+
(r) => (e[r].attribute || r).toLowerCase()
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
return Object.keys(e).forEach((r) => {
|
|
492
|
+
Object.defineProperty(o.prototype, r, {
|
|
493
|
+
get() {
|
|
494
|
+
return this.$$c && r in this.$$c ? this.$$c[r] : this.$$d[r];
|
|
495
|
+
},
|
|
496
|
+
set(u) {
|
|
497
|
+
var a;
|
|
498
|
+
u = ee(r, u, e), this.$$d[r] = u, (a = this.$$c) == null || a.$set({ [r]: u });
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
}), s.forEach((r) => {
|
|
502
|
+
Object.defineProperty(o.prototype, r, {
|
|
503
|
+
get() {
|
|
504
|
+
var u;
|
|
505
|
+
return (u = this.$$c) == null ? void 0 : u[r];
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
}), t.element = /** @type {any} */
|
|
509
|
+
o, o;
|
|
510
|
+
}
|
|
511
|
+
class ie {
|
|
512
|
+
constructor() {
|
|
513
|
+
/**
|
|
514
|
+
* ### PRIVATE API
|
|
515
|
+
*
|
|
516
|
+
* Do not use, may change at any time
|
|
517
|
+
*
|
|
518
|
+
* @type {any}
|
|
519
|
+
*/
|
|
520
|
+
E(this, "$$");
|
|
521
|
+
/**
|
|
522
|
+
* ### PRIVATE API
|
|
523
|
+
*
|
|
524
|
+
* Do not use, may change at any time
|
|
525
|
+
*
|
|
526
|
+
* @type {any}
|
|
527
|
+
*/
|
|
528
|
+
E(this, "$$set");
|
|
529
|
+
}
|
|
530
|
+
/** @returns {void} */
|
|
531
|
+
$destroy() {
|
|
532
|
+
be(this, 1), this.$destroy = L;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* @template {Extract<keyof Events, string>} K
|
|
536
|
+
* @param {K} type
|
|
537
|
+
* @param {((e: Events[K]) => void) | null | undefined} callback
|
|
538
|
+
* @returns {() => void}
|
|
539
|
+
*/
|
|
540
|
+
$on(e, n) {
|
|
541
|
+
if (!Te(n))
|
|
542
|
+
return L;
|
|
543
|
+
const s = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
544
|
+
return s.push(n), () => {
|
|
545
|
+
const l = s.indexOf(n);
|
|
546
|
+
l !== -1 && s.splice(l, 1);
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* @param {Partial<Props>} props
|
|
551
|
+
* @returns {void}
|
|
552
|
+
*/
|
|
553
|
+
$set(e) {
|
|
554
|
+
this.$$set && !nt(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
const $t = "4";
|
|
558
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add($t);
|
|
559
|
+
function bt(t) {
|
|
560
|
+
st(t, "svelte-1nq6lsq", ".login-btn.svelte-1nq6lsq.svelte-1nq6lsq,.loading-btn.svelte-1nq6lsq.svelte-1nq6lsq,.avatar-btn.svelte-1nq6lsq.svelte-1nq6lsq{display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 0.3s ease;border:none;outline:none}.login-btn.svelte-1nq6lsq.svelte-1nq6lsq{width:120px;height:40px;border-radius:5px;background-color:#007bff;color:white;font-size:16px;font-weight:bold}.login-btn.svelte-1nq6lsq.svelte-1nq6lsq:hover{background-color:#0056b3}.login-btn.svelte-1nq6lsq.svelte-1nq6lsq:focus,.avatar-btn.svelte-1nq6lsq.svelte-1nq6lsq:focus{outline:2px solid #0056b3;outline-offset:4px}.loading-btn.svelte-1nq6lsq.svelte-1nq6lsq,.avatar-btn.svelte-1nq6lsq.svelte-1nq6lsq{width:50px;height:50px;border-radius:50%}.loading-btn.svelte-1nq6lsq.svelte-1nq6lsq{background-color:#00bfff;animation:svelte-1nq6lsq-pulse 1s infinite ease-in-out}.avatar-btn.svelte-1nq6lsq img.svelte-1nq6lsq{width:100%;height:100%;object-fit:cover;border-radius:50%}@keyframes svelte-1nq6lsq-pulse{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}");
|
|
561
|
+
}
|
|
562
|
+
function pt(t) {
|
|
563
|
+
let e, n, s;
|
|
564
|
+
return {
|
|
565
|
+
c() {
|
|
566
|
+
e = m("button"), e.textContent = "Login", _(e, "class", "login-btn svelte-1nq6lsq"), _(e, "aria-label", "Log in");
|
|
567
|
+
},
|
|
568
|
+
m(l, i) {
|
|
569
|
+
N(l, e, i), n || (s = ne(
|
|
570
|
+
e,
|
|
571
|
+
"click",
|
|
572
|
+
/*login*/
|
|
573
|
+
t[2]
|
|
574
|
+
), n = !0);
|
|
575
|
+
},
|
|
576
|
+
p: L,
|
|
577
|
+
d(l) {
|
|
578
|
+
l && x(e), n = !1, s();
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
function vt(t) {
|
|
583
|
+
let e, n, s, l, i;
|
|
584
|
+
return {
|
|
585
|
+
c() {
|
|
586
|
+
e = m("button"), n = m("img"), Ie(n.src, s = qt) || _(n, "src", s), _(n, "alt", "User Avatar"), _(n, "class", "svelte-1nq6lsq"), _(e, "class", "avatar-btn svelte-1nq6lsq"), _(e, "aria-label", "Log out");
|
|
587
|
+
},
|
|
588
|
+
m(o, r) {
|
|
589
|
+
N(o, e, r), g(e, n), l || (i = ne(
|
|
590
|
+
e,
|
|
591
|
+
"click",
|
|
592
|
+
/*logout*/
|
|
593
|
+
t[3]
|
|
594
|
+
), l = !0);
|
|
595
|
+
},
|
|
596
|
+
p: L,
|
|
597
|
+
d(o) {
|
|
598
|
+
o && x(e), l = !1, i();
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
function kt(t) {
|
|
603
|
+
let e;
|
|
604
|
+
return {
|
|
605
|
+
c() {
|
|
606
|
+
e = m("button"), e.innerHTML = "", _(e, "class", "loading-btn svelte-1nq6lsq"), _(e, "aria-busy", "true"), _(e, "aria-label", "Logging in");
|
|
607
|
+
},
|
|
608
|
+
m(n, s) {
|
|
609
|
+
N(n, e, s);
|
|
610
|
+
},
|
|
611
|
+
p: L,
|
|
612
|
+
d(n) {
|
|
613
|
+
n && x(e);
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
function yt(t) {
|
|
618
|
+
let e;
|
|
619
|
+
function n(i, o) {
|
|
620
|
+
return (
|
|
621
|
+
/*loading*/
|
|
622
|
+
i[0] ? kt : (
|
|
623
|
+
/*loggedIn*/
|
|
624
|
+
i[1] ? vt : pt
|
|
625
|
+
)
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
let s = n(t), l = s(t);
|
|
629
|
+
return {
|
|
630
|
+
c() {
|
|
631
|
+
l.c(), e = _e();
|
|
632
|
+
},
|
|
633
|
+
m(i, o) {
|
|
634
|
+
l.m(i, o), N(i, e, o);
|
|
635
|
+
},
|
|
636
|
+
p(i, [o]) {
|
|
637
|
+
s === (s = n(i)) && l ? l.p(i, o) : (l.d(1), l = s(i), l && (l.c(), l.m(e.parentNode, e)));
|
|
638
|
+
},
|
|
639
|
+
i: L,
|
|
640
|
+
o: L,
|
|
641
|
+
d(i) {
|
|
642
|
+
i && x(e), l.d(i);
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
let qt = "https://via.placeholder.com/50";
|
|
647
|
+
function wt(t, e, n) {
|
|
648
|
+
let s = !1, l = !1;
|
|
649
|
+
const i = async () => {
|
|
650
|
+
n(0, s = !0), await new Promise((u) => setTimeout(u, 2e3)), n(0, s = !1), n(1, l = !0);
|
|
651
|
+
}, o = () => {
|
|
652
|
+
n(1, l = !1);
|
|
653
|
+
};
|
|
654
|
+
return l = l, [s, l, i, o];
|
|
655
|
+
}
|
|
656
|
+
class Qe extends ie {
|
|
657
|
+
constructor(e) {
|
|
658
|
+
super(), le(this, e, wt, yt, U, {}, bt);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
customElements.define("sesamy-login", Ye(Qe, {}, [], [], !0));
|
|
662
|
+
const Mt = Qe;
|
|
663
|
+
/**
|
|
664
|
+
* @license lucide-svelte v0.445.0 - ISC
|
|
665
|
+
*
|
|
666
|
+
* This source code is licensed under the ISC license.
|
|
667
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
668
|
+
*/
|
|
669
|
+
const Se = {
|
|
670
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
671
|
+
width: 24,
|
|
672
|
+
height: 24,
|
|
673
|
+
viewBox: "0 0 24 24",
|
|
674
|
+
fill: "none",
|
|
675
|
+
stroke: "currentColor",
|
|
676
|
+
"stroke-width": 2,
|
|
677
|
+
"stroke-linecap": "round",
|
|
678
|
+
"stroke-linejoin": "round"
|
|
679
|
+
};
|
|
680
|
+
function je(t, e, n) {
|
|
681
|
+
const s = t.slice();
|
|
682
|
+
return s[11] = e[n][0], s[12] = e[n][1], s;
|
|
683
|
+
}
|
|
684
|
+
function fe(t) {
|
|
685
|
+
let e, n = [
|
|
686
|
+
/*attrs*/
|
|
687
|
+
t[12]
|
|
688
|
+
], s = {};
|
|
689
|
+
for (let l = 0; l < n.length; l += 1)
|
|
690
|
+
s = A(s, n[l]);
|
|
691
|
+
return {
|
|
692
|
+
c() {
|
|
693
|
+
e = Ke(
|
|
694
|
+
/*tag*/
|
|
695
|
+
t[11]
|
|
696
|
+
), se(e, s);
|
|
697
|
+
},
|
|
698
|
+
m(l, i) {
|
|
699
|
+
N(l, e, i);
|
|
700
|
+
},
|
|
701
|
+
p(l, i) {
|
|
702
|
+
se(e, s = me(n, [i & /*iconNode*/
|
|
703
|
+
32 && /*attrs*/
|
|
704
|
+
l[12]]));
|
|
705
|
+
},
|
|
706
|
+
d(l) {
|
|
707
|
+
l && x(e);
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
function Ae(t) {
|
|
712
|
+
let e = (
|
|
713
|
+
/*tag*/
|
|
714
|
+
t[11]
|
|
715
|
+
), n, s = (
|
|
716
|
+
/*tag*/
|
|
717
|
+
t[11] && fe(t)
|
|
718
|
+
);
|
|
719
|
+
return {
|
|
720
|
+
c() {
|
|
721
|
+
s && s.c(), n = _e();
|
|
722
|
+
},
|
|
723
|
+
m(l, i) {
|
|
724
|
+
s && s.m(l, i), N(l, n, i);
|
|
725
|
+
},
|
|
726
|
+
p(l, i) {
|
|
727
|
+
/*tag*/
|
|
728
|
+
l[11] ? e ? U(
|
|
729
|
+
e,
|
|
730
|
+
/*tag*/
|
|
731
|
+
l[11]
|
|
732
|
+
) ? (s.d(1), s = fe(l), e = /*tag*/
|
|
733
|
+
l[11], s.c(), s.m(n.parentNode, n)) : s.p(l, i) : (s = fe(l), e = /*tag*/
|
|
734
|
+
l[11], s.c(), s.m(n.parentNode, n)) : e && (s.d(1), s = null, e = /*tag*/
|
|
735
|
+
l[11]);
|
|
736
|
+
},
|
|
737
|
+
d(l) {
|
|
738
|
+
l && x(n), s && s.d(l);
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
function Et(t) {
|
|
743
|
+
let e, n, s, l, i, o = I(
|
|
744
|
+
/*iconNode*/
|
|
745
|
+
t[5]
|
|
746
|
+
), r = [];
|
|
747
|
+
for (let c = 0; c < o.length; c += 1)
|
|
748
|
+
r[c] = Ae(je(t, o, c));
|
|
749
|
+
const u = (
|
|
750
|
+
/*#slots*/
|
|
751
|
+
t[10].default
|
|
752
|
+
), a = ze(
|
|
753
|
+
u,
|
|
754
|
+
t,
|
|
755
|
+
/*$$scope*/
|
|
756
|
+
t[9],
|
|
757
|
+
null
|
|
758
|
+
);
|
|
759
|
+
let v = [
|
|
760
|
+
Se,
|
|
761
|
+
/*$$restProps*/
|
|
762
|
+
t[7],
|
|
763
|
+
{ width: (
|
|
764
|
+
/*size*/
|
|
765
|
+
t[2]
|
|
766
|
+
) },
|
|
767
|
+
{ height: (
|
|
768
|
+
/*size*/
|
|
769
|
+
t[2]
|
|
770
|
+
) },
|
|
771
|
+
{ stroke: (
|
|
772
|
+
/*color*/
|
|
773
|
+
t[1]
|
|
774
|
+
) },
|
|
775
|
+
{
|
|
776
|
+
"stroke-width": s = /*absoluteStrokeWidth*/
|
|
777
|
+
t[4] ? Number(
|
|
778
|
+
/*strokeWidth*/
|
|
779
|
+
t[3]
|
|
780
|
+
) * 24 / Number(
|
|
781
|
+
/*size*/
|
|
782
|
+
t[2]
|
|
783
|
+
) : (
|
|
784
|
+
/*strokeWidth*/
|
|
785
|
+
t[3]
|
|
786
|
+
)
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
class: l = /*mergeClasses*/
|
|
790
|
+
t[6](
|
|
791
|
+
"lucide-icon",
|
|
792
|
+
"lucide",
|
|
793
|
+
/*name*/
|
|
794
|
+
t[0] ? `lucide-${/*name*/
|
|
795
|
+
t[0]}` : "",
|
|
796
|
+
/*$$props*/
|
|
797
|
+
t[8].class
|
|
798
|
+
)
|
|
799
|
+
}
|
|
800
|
+
], $ = {};
|
|
801
|
+
for (let c = 0; c < v.length; c += 1)
|
|
802
|
+
$ = A($, v[c]);
|
|
803
|
+
return {
|
|
804
|
+
c() {
|
|
805
|
+
e = Ke("svg");
|
|
806
|
+
for (let c = 0; c < r.length; c += 1)
|
|
807
|
+
r[c].c();
|
|
808
|
+
n = _e(), a && a.c(), se(e, $);
|
|
809
|
+
},
|
|
810
|
+
m(c, p) {
|
|
811
|
+
N(c, e, p);
|
|
812
|
+
for (let f = 0; f < r.length; f += 1)
|
|
813
|
+
r[f] && r[f].m(e, null);
|
|
814
|
+
g(e, n), a && a.m(e, null), i = !0;
|
|
815
|
+
},
|
|
816
|
+
p(c, [p]) {
|
|
817
|
+
if (p & /*iconNode*/
|
|
818
|
+
32) {
|
|
819
|
+
o = I(
|
|
820
|
+
/*iconNode*/
|
|
821
|
+
c[5]
|
|
822
|
+
);
|
|
823
|
+
let f;
|
|
824
|
+
for (f = 0; f < o.length; f += 1) {
|
|
825
|
+
const C = je(c, o, f);
|
|
826
|
+
r[f] ? r[f].p(C, p) : (r[f] = Ae(C), r[f].c(), r[f].m(e, n));
|
|
827
|
+
}
|
|
828
|
+
for (; f < r.length; f += 1)
|
|
829
|
+
r[f].d(1);
|
|
830
|
+
r.length = o.length;
|
|
831
|
+
}
|
|
832
|
+
a && a.p && (!i || p & /*$$scope*/
|
|
833
|
+
512) && He(
|
|
834
|
+
a,
|
|
835
|
+
u,
|
|
836
|
+
c,
|
|
837
|
+
/*$$scope*/
|
|
838
|
+
c[9],
|
|
839
|
+
i ? Fe(
|
|
840
|
+
u,
|
|
841
|
+
/*$$scope*/
|
|
842
|
+
c[9],
|
|
843
|
+
p,
|
|
844
|
+
null
|
|
845
|
+
) : Re(
|
|
846
|
+
/*$$scope*/
|
|
847
|
+
c[9]
|
|
848
|
+
),
|
|
849
|
+
null
|
|
850
|
+
), se(e, $ = me(v, [
|
|
851
|
+
Se,
|
|
852
|
+
p & /*$$restProps*/
|
|
853
|
+
128 && /*$$restProps*/
|
|
854
|
+
c[7],
|
|
855
|
+
(!i || p & /*size*/
|
|
856
|
+
4) && { width: (
|
|
857
|
+
/*size*/
|
|
858
|
+
c[2]
|
|
859
|
+
) },
|
|
860
|
+
(!i || p & /*size*/
|
|
861
|
+
4) && { height: (
|
|
862
|
+
/*size*/
|
|
863
|
+
c[2]
|
|
864
|
+
) },
|
|
865
|
+
(!i || p & /*color*/
|
|
866
|
+
2) && { stroke: (
|
|
867
|
+
/*color*/
|
|
868
|
+
c[1]
|
|
869
|
+
) },
|
|
870
|
+
(!i || p & /*absoluteStrokeWidth, strokeWidth, size*/
|
|
871
|
+
28 && s !== (s = /*absoluteStrokeWidth*/
|
|
872
|
+
c[4] ? Number(
|
|
873
|
+
/*strokeWidth*/
|
|
874
|
+
c[3]
|
|
875
|
+
) * 24 / Number(
|
|
876
|
+
/*size*/
|
|
877
|
+
c[2]
|
|
878
|
+
) : (
|
|
879
|
+
/*strokeWidth*/
|
|
880
|
+
c[3]
|
|
881
|
+
))) && { "stroke-width": s },
|
|
882
|
+
(!i || p & /*name, $$props*/
|
|
883
|
+
257 && l !== (l = /*mergeClasses*/
|
|
884
|
+
c[6](
|
|
885
|
+
"lucide-icon",
|
|
886
|
+
"lucide",
|
|
887
|
+
/*name*/
|
|
888
|
+
c[0] ? `lucide-${/*name*/
|
|
889
|
+
c[0]}` : "",
|
|
890
|
+
/*$$props*/
|
|
891
|
+
c[8].class
|
|
892
|
+
))) && { class: l }
|
|
893
|
+
]));
|
|
894
|
+
},
|
|
895
|
+
i(c) {
|
|
896
|
+
i || (j(a, c), i = !0);
|
|
897
|
+
},
|
|
898
|
+
o(c) {
|
|
899
|
+
D(a, c), i = !1;
|
|
900
|
+
},
|
|
901
|
+
d(c) {
|
|
902
|
+
c && x(e), ae(r, c), a && a.d(c);
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
function xt(t, e, n) {
|
|
907
|
+
const s = ["name", "color", "size", "strokeWidth", "absoluteStrokeWidth", "iconNode"];
|
|
908
|
+
let l = xe(e, s), { $$slots: i = {}, $$scope: o } = e, { name: r = void 0 } = e, { color: u = "currentColor" } = e, { size: a = 24 } = e, { strokeWidth: v = 2 } = e, { absoluteStrokeWidth: $ = !1 } = e, { iconNode: c = [] } = e;
|
|
909
|
+
const p = (...f) => f.filter((C, M, V) => !!C && V.indexOf(C) === M).join(" ");
|
|
910
|
+
return t.$$set = (f) => {
|
|
911
|
+
n(8, e = A(A({}, e), te(f))), n(7, l = xe(e, s)), "name" in f && n(0, r = f.name), "color" in f && n(1, u = f.color), "size" in f && n(2, a = f.size), "strokeWidth" in f && n(3, v = f.strokeWidth), "absoluteStrokeWidth" in f && n(4, $ = f.absoluteStrokeWidth), "iconNode" in f && n(5, c = f.iconNode), "$$scope" in f && n(9, o = f.$$scope);
|
|
912
|
+
}, e = te(e), [
|
|
913
|
+
r,
|
|
914
|
+
u,
|
|
915
|
+
a,
|
|
916
|
+
v,
|
|
917
|
+
$,
|
|
918
|
+
c,
|
|
919
|
+
p,
|
|
920
|
+
l,
|
|
921
|
+
e,
|
|
922
|
+
o,
|
|
923
|
+
i
|
|
924
|
+
];
|
|
925
|
+
}
|
|
926
|
+
class Nt extends ie {
|
|
927
|
+
constructor(e) {
|
|
928
|
+
super(), le(this, e, xt, Et, U, {
|
|
929
|
+
name: 0,
|
|
930
|
+
color: 1,
|
|
931
|
+
size: 2,
|
|
932
|
+
strokeWidth: 3,
|
|
933
|
+
absoluteStrokeWidth: 4,
|
|
934
|
+
iconNode: 5
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
function Lt(t) {
|
|
939
|
+
let e;
|
|
940
|
+
const n = (
|
|
941
|
+
/*#slots*/
|
|
942
|
+
t[2].default
|
|
943
|
+
), s = ze(
|
|
944
|
+
n,
|
|
945
|
+
t,
|
|
946
|
+
/*$$scope*/
|
|
947
|
+
t[3],
|
|
948
|
+
null
|
|
949
|
+
);
|
|
950
|
+
return {
|
|
951
|
+
c() {
|
|
952
|
+
s && s.c();
|
|
953
|
+
},
|
|
954
|
+
m(l, i) {
|
|
955
|
+
s && s.m(l, i), e = !0;
|
|
956
|
+
},
|
|
957
|
+
p(l, i) {
|
|
958
|
+
s && s.p && (!e || i & /*$$scope*/
|
|
959
|
+
8) && He(
|
|
960
|
+
s,
|
|
961
|
+
n,
|
|
962
|
+
l,
|
|
963
|
+
/*$$scope*/
|
|
964
|
+
l[3],
|
|
965
|
+
e ? Fe(
|
|
966
|
+
n,
|
|
967
|
+
/*$$scope*/
|
|
968
|
+
l[3],
|
|
969
|
+
i,
|
|
970
|
+
null
|
|
971
|
+
) : Re(
|
|
972
|
+
/*$$scope*/
|
|
973
|
+
l[3]
|
|
974
|
+
),
|
|
975
|
+
null
|
|
976
|
+
);
|
|
977
|
+
},
|
|
978
|
+
i(l) {
|
|
979
|
+
e || (j(s, l), e = !0);
|
|
980
|
+
},
|
|
981
|
+
o(l) {
|
|
982
|
+
D(s, l), e = !1;
|
|
983
|
+
},
|
|
984
|
+
d(l) {
|
|
985
|
+
s && s.d(l);
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
function Ct(t) {
|
|
990
|
+
let e, n;
|
|
991
|
+
const s = [
|
|
992
|
+
{ name: "circle-check" },
|
|
993
|
+
/*$$props*/
|
|
994
|
+
t[1],
|
|
995
|
+
{ iconNode: (
|
|
996
|
+
/*iconNode*/
|
|
997
|
+
t[0]
|
|
998
|
+
) }
|
|
999
|
+
];
|
|
1000
|
+
let l = {
|
|
1001
|
+
$$slots: { default: [Lt] },
|
|
1002
|
+
$$scope: { ctx: t }
|
|
1003
|
+
};
|
|
1004
|
+
for (let i = 0; i < s.length; i += 1)
|
|
1005
|
+
l = A(l, s[i]);
|
|
1006
|
+
return e = new Nt({ props: l }), {
|
|
1007
|
+
c() {
|
|
1008
|
+
Je(e.$$.fragment);
|
|
1009
|
+
},
|
|
1010
|
+
m(i, o) {
|
|
1011
|
+
$e(e, i, o), n = !0;
|
|
1012
|
+
},
|
|
1013
|
+
p(i, [o]) {
|
|
1014
|
+
const r = o & /*$$props, iconNode*/
|
|
1015
|
+
3 ? me(s, [
|
|
1016
|
+
s[0],
|
|
1017
|
+
o & /*$$props*/
|
|
1018
|
+
2 && gt(
|
|
1019
|
+
/*$$props*/
|
|
1020
|
+
i[1]
|
|
1021
|
+
),
|
|
1022
|
+
o & /*iconNode*/
|
|
1023
|
+
1 && { iconNode: (
|
|
1024
|
+
/*iconNode*/
|
|
1025
|
+
i[0]
|
|
1026
|
+
) }
|
|
1027
|
+
]) : {};
|
|
1028
|
+
o & /*$$scope*/
|
|
1029
|
+
8 && (r.$$scope = { dirty: o, ctx: i }), e.$set(r);
|
|
1030
|
+
},
|
|
1031
|
+
i(i) {
|
|
1032
|
+
n || (j(e.$$.fragment, i), n = !0);
|
|
1033
|
+
},
|
|
1034
|
+
o(i) {
|
|
1035
|
+
D(e.$$.fragment, i), n = !1;
|
|
1036
|
+
},
|
|
1037
|
+
d(i) {
|
|
1038
|
+
be(e, i);
|
|
1039
|
+
}
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
function St(t, e, n) {
|
|
1043
|
+
let { $$slots: s = {}, $$scope: l } = e;
|
|
1044
|
+
const i = [
|
|
1045
|
+
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
1046
|
+
["path", { d: "m9 12 2 2 4-4" }]
|
|
1047
|
+
];
|
|
1048
|
+
return t.$$set = (o) => {
|
|
1049
|
+
n(1, e = A(A({}, e), te(o))), "$$scope" in o && n(3, l = o.$$scope);
|
|
1050
|
+
}, e = te(e), [i, e, s, l];
|
|
1051
|
+
}
|
|
1052
|
+
class jt extends ie {
|
|
1053
|
+
constructor(e) {
|
|
1054
|
+
super(), le(this, e, St, Ct, U, {});
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
function Oe(t, e, n) {
|
|
1058
|
+
const s = t.slice();
|
|
1059
|
+
return s[6] = e[n], s;
|
|
1060
|
+
}
|
|
1061
|
+
function Pe(t, e, n) {
|
|
1062
|
+
const s = t.slice();
|
|
1063
|
+
return s[9] = e[n], s;
|
|
1064
|
+
}
|
|
1065
|
+
function Me(t) {
|
|
1066
|
+
let e, n, s, l, i, o;
|
|
1067
|
+
return n = new jt({
|
|
1068
|
+
props: { class: "text-green-500 mr-2", size: 20 }
|
|
1069
|
+
}), {
|
|
1070
|
+
c() {
|
|
1071
|
+
e = m("li"), Je(n.$$.fragment), s = w(), l = m("span"), l.textContent = `${/*feature*/
|
|
1072
|
+
t[9]}`, i = w(), _(e, "class", "flex items-center");
|
|
1073
|
+
},
|
|
1074
|
+
m(r, u) {
|
|
1075
|
+
N(r, e, u), $e(n, e, null), g(e, s), g(e, l), g(e, i), o = !0;
|
|
1076
|
+
},
|
|
1077
|
+
p: L,
|
|
1078
|
+
i(r) {
|
|
1079
|
+
o || (j(n.$$.fragment, r), o = !0);
|
|
1080
|
+
},
|
|
1081
|
+
o(r) {
|
|
1082
|
+
D(n.$$.fragment, r), o = !1;
|
|
1083
|
+
},
|
|
1084
|
+
d(r) {
|
|
1085
|
+
r && x(e), be(n);
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
function We(t) {
|
|
1090
|
+
let e, n;
|
|
1091
|
+
return {
|
|
1092
|
+
c() {
|
|
1093
|
+
e = m("img"), Ie(e.src, n = "/api/placeholder/40/25") || _(e, "src", n), _(
|
|
1094
|
+
e,
|
|
1095
|
+
"alt",
|
|
1096
|
+
/*method*/
|
|
1097
|
+
t[6]
|
|
1098
|
+
), _(e, "class", "h-6");
|
|
1099
|
+
},
|
|
1100
|
+
m(s, l) {
|
|
1101
|
+
N(s, e, l);
|
|
1102
|
+
},
|
|
1103
|
+
p: L,
|
|
1104
|
+
d(s) {
|
|
1105
|
+
s && x(e);
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
function At(t) {
|
|
1110
|
+
let e, n, s, l, i, o, r, u, a, v, $, c, p, f, C, M, V, S, q, pe, oe, ve, J, ke, G, ye, Y, qe, H, Q, re, ce, we, O = I(
|
|
1111
|
+
/*features*/
|
|
1112
|
+
t[1]
|
|
1113
|
+
), b = [];
|
|
1114
|
+
for (let h = 0; h < O.length; h += 1)
|
|
1115
|
+
b[h] = Me(Pe(t, O, h));
|
|
1116
|
+
const Ze = (h) => D(b[h], 1, 1, () => {
|
|
1117
|
+
b[h] = null;
|
|
1118
|
+
});
|
|
1119
|
+
let W = I(
|
|
1120
|
+
/*paymentMethods*/
|
|
1121
|
+
t[2]
|
|
1122
|
+
), y = [];
|
|
1123
|
+
for (let h = 0; h < W.length; h += 1)
|
|
1124
|
+
y[h] = We(Oe(t, W, h));
|
|
1125
|
+
return re = ot(
|
|
1126
|
+
/*$$binding_groups*/
|
|
1127
|
+
t[4][0]
|
|
1128
|
+
), {
|
|
1129
|
+
c() {
|
|
1130
|
+
e = m("div"), n = m("div"), n.textContent = "Redan prenumerant? Logga in", s = w(), l = m("h1"), l.textContent = "FOKUS", i = w(), o = m("h2"), o.textContent = "Läs Fokus Digital i 6 månader för bara 79 kr!", r = w(), u = m("ul");
|
|
1131
|
+
for (let h = 0; h < b.length; h += 1)
|
|
1132
|
+
b[h].c();
|
|
1133
|
+
a = w(), v = m("div"), $ = m("label"), c = m("input"), p = w(), f = m("div"), f.innerHTML = '<div class="font-semibold">Fokus Digital i 6 månader för 79kr!</div> <div class="text-sm text-gray-600">Efter kampanjperioden 149 kr/mån. Ingen bindningstid!</div>', C = w(), M = m("div"), M.textContent = "79 SEK/6 mån", V = w(), S = m("label"), q = m("input"), pe = w(), oe = m("div"), oe.innerHTML = '<div class="font-semibold">Fokus Digital i ett år för 995kr</div> <div class="text-sm text-gray-600">Du sparar 793 kr. Prenumerationen förnyas automatiskt årsvis.</div>', ve = w(), J = m("div"), J.textContent = "995 SEK/år", ke = w(), G = m("button"), G.textContent = "Fortsätt", ye = w(), Y = m("div"), Y.textContent = "Säker SSL-krypterad betalning", qe = w(), H = m("div");
|
|
1134
|
+
for (let h = 0; h < y.length; h += 1)
|
|
1135
|
+
y[h].c();
|
|
1136
|
+
_(n, "class", "text-right text-sm text-red-500 mb-4"), _(l, "class", "text-4xl font-bold text-red-500 mb-4"), _(o, "class", "text-xl font-semibold mb-6"), _(u, "class", "space-y-2 mb-6"), _(c, "type", "radio"), _(c, "name", "subscription"), c.__value = "sixMonths", Ne(c, c.__value), _(c, "class", "mr-3"), _(M, "class", "ml-auto font-semibold"), _($, "class", "flex items-center p-4 border rounded-lg"), _(q, "type", "radio"), _(q, "name", "subscription"), q.__value = "oneYear", Ne(q, q.__value), _(q, "class", "mr-3"), _(J, "class", "ml-auto font-semibold"), _(S, "class", "flex items-center p-4 border rounded-lg"), _(v, "class", "space-y-4 mb-6"), _(G, "class", "w-full bg-red-500 text-white py-3 rounded-lg font-semibold"), _(Y, "class", "text-center text-sm text-gray-600 mt-4"), _(H, "class", "flex justify-center space-x-2 mt-2"), _(e, "class", "max-w-md mx-auto bg-white p-6 rounded-lg shadow-lg"), re.p(c, q);
|
|
1137
|
+
},
|
|
1138
|
+
m(h, k) {
|
|
1139
|
+
N(h, e, k), g(e, n), g(e, s), g(e, l), g(e, i), g(e, o), g(e, r), g(e, u);
|
|
1140
|
+
for (let d = 0; d < b.length; d += 1)
|
|
1141
|
+
b[d] && b[d].m(u, null);
|
|
1142
|
+
g(e, a), g(e, v), g(v, $), g($, c), c.checked = c.__value === /*selectedPlan*/
|
|
1143
|
+
t[0], g($, p), g($, f), g($, C), g($, M), g(v, V), g(v, S), g(S, q), q.checked = q.__value === /*selectedPlan*/
|
|
1144
|
+
t[0], g(S, pe), g(S, oe), g(S, ve), g(S, J), g(e, ke), g(e, G), g(e, ye), g(e, Y), g(e, qe), g(e, H);
|
|
1145
|
+
for (let d = 0; d < y.length; d += 1)
|
|
1146
|
+
y[d] && y[d].m(H, null);
|
|
1147
|
+
Q = !0, ce || (we = [
|
|
1148
|
+
ne(
|
|
1149
|
+
c,
|
|
1150
|
+
"change",
|
|
1151
|
+
/*input0_change_handler*/
|
|
1152
|
+
t[3]
|
|
1153
|
+
),
|
|
1154
|
+
ne(
|
|
1155
|
+
q,
|
|
1156
|
+
"change",
|
|
1157
|
+
/*input1_change_handler*/
|
|
1158
|
+
t[5]
|
|
1159
|
+
)
|
|
1160
|
+
], ce = !0);
|
|
1161
|
+
},
|
|
1162
|
+
p(h, [k]) {
|
|
1163
|
+
if (k & /*features*/
|
|
1164
|
+
2) {
|
|
1165
|
+
O = I(
|
|
1166
|
+
/*features*/
|
|
1167
|
+
h[1]
|
|
1168
|
+
);
|
|
1169
|
+
let d;
|
|
1170
|
+
for (d = 0; d < O.length; d += 1) {
|
|
1171
|
+
const R = Pe(h, O, d);
|
|
1172
|
+
b[d] ? (b[d].p(R, k), j(b[d], 1)) : (b[d] = Me(R), b[d].c(), j(b[d], 1), b[d].m(u, null));
|
|
1173
|
+
}
|
|
1174
|
+
for (ht(), d = O.length; d < b.length; d += 1)
|
|
1175
|
+
Ze(d);
|
|
1176
|
+
_t();
|
|
1177
|
+
}
|
|
1178
|
+
if (k & /*selectedPlan*/
|
|
1179
|
+
1 && (c.checked = c.__value === /*selectedPlan*/
|
|
1180
|
+
h[0]), k & /*selectedPlan*/
|
|
1181
|
+
1 && (q.checked = q.__value === /*selectedPlan*/
|
|
1182
|
+
h[0]), k & /*paymentMethods*/
|
|
1183
|
+
4) {
|
|
1184
|
+
W = I(
|
|
1185
|
+
/*paymentMethods*/
|
|
1186
|
+
h[2]
|
|
1187
|
+
);
|
|
1188
|
+
let d;
|
|
1189
|
+
for (d = 0; d < W.length; d += 1) {
|
|
1190
|
+
const R = Oe(h, W, d);
|
|
1191
|
+
y[d] ? y[d].p(R, k) : (y[d] = We(R), y[d].c(), y[d].m(H, null));
|
|
1192
|
+
}
|
|
1193
|
+
for (; d < y.length; d += 1)
|
|
1194
|
+
y[d].d(1);
|
|
1195
|
+
y.length = W.length;
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1198
|
+
i(h) {
|
|
1199
|
+
if (!Q) {
|
|
1200
|
+
for (let k = 0; k < O.length; k += 1)
|
|
1201
|
+
j(b[k]);
|
|
1202
|
+
Q = !0;
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
o(h) {
|
|
1206
|
+
b = b.filter(Boolean);
|
|
1207
|
+
for (let k = 0; k < b.length; k += 1)
|
|
1208
|
+
D(b[k]);
|
|
1209
|
+
Q = !1;
|
|
1210
|
+
},
|
|
1211
|
+
d(h) {
|
|
1212
|
+
h && x(e), ae(b, h), ae(y, h), re.r(), ce = !1, F(we);
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
function Ot(t, e, n) {
|
|
1217
|
+
let s = "sixMonths";
|
|
1218
|
+
const l = [
|
|
1219
|
+
"Allt material på Fokus.se",
|
|
1220
|
+
"Tillgång till e-tidning",
|
|
1221
|
+
"Tillgång till våra podcasts",
|
|
1222
|
+
"Nyhetsbrev"
|
|
1223
|
+
], i = [
|
|
1224
|
+
"Visa",
|
|
1225
|
+
"American Express",
|
|
1226
|
+
"Mastercard",
|
|
1227
|
+
"Klarna",
|
|
1228
|
+
"Google Pay",
|
|
1229
|
+
"Apple Pay",
|
|
1230
|
+
"Swish"
|
|
1231
|
+
], o = [[]];
|
|
1232
|
+
function r() {
|
|
1233
|
+
s = this.__value, n(0, s);
|
|
1234
|
+
}
|
|
1235
|
+
function u() {
|
|
1236
|
+
s = this.__value, n(0, s);
|
|
1237
|
+
}
|
|
1238
|
+
return [
|
|
1239
|
+
s,
|
|
1240
|
+
l,
|
|
1241
|
+
i,
|
|
1242
|
+
r,
|
|
1243
|
+
o,
|
|
1244
|
+
u
|
|
1245
|
+
];
|
|
1246
|
+
}
|
|
1247
|
+
class Xe extends ie {
|
|
1248
|
+
constructor(e) {
|
|
1249
|
+
super(), le(this, e, Ot, At, U, {});
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
customElements.define("sesamy-paywall", Ye(Xe, {}, [], [], !0));
|
|
1253
|
+
const Wt = Xe;
|
|
1254
|
+
export {
|
|
1255
|
+
Mt as Login,
|
|
1256
|
+
Wt as Paywall
|
|
1257
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(x,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(x=typeof globalThis<"u"?globalThis:x||self,b(x["@sesamy/sesamy-components"]={}))})(this,function(x){"use strict";var Mt=Object.defineProperty;var Tt=(x,b,N)=>b in x?Mt(x,b,{enumerable:!0,configurable:!0,writable:!0,value:N}):x[b]=N;var S=(x,b,N)=>Tt(x,typeof b!="symbol"?b+"":b,N);function b(){}function N(t,e){for(const n in e)t[n]=e[n];return t}function ve(t){return t()}function ye(){return Object.create(null)}function T(t){t.forEach(ve)}function ke(t){return typeof t=="function"}function R(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let J;function qe(t,e){return t===e?!0:(J||(J=document.createElement("a")),J.href=e,t===J.href)}function et(t){return Object.keys(t).length===0}function we(t,e,n,s){if(t){const l=Ee(t,e,n,s);return t[0](l)}}function Ee(t,e,n,s){return t[1]&&s?N(n.ctx.slice(),t[1](s(e))):n.ctx}function xe(t,e,n,s){if(t[2]&&s){const l=t[2](s(n));if(e.dirty===void 0)return l;if(typeof l=="object"){const i=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r<o;r+=1)i[r]=e.dirty[r]|l[r];return i}return e.dirty|l}return e.dirty}function Ne(t,e,n,s,l,i){if(l){const o=Ee(e,n,s,i);t.p(o,l)}}function Le(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let s=0;s<n;s++)e[s]=-1;return e}return-1}function G(t){const e={};for(const n in t)n[0]!=="$"&&(e[n]=t[n]);return e}function Se(t,e){const n={};e=new Set(e);for(const s in t)!e.has(s)&&s[0]!=="$"&&(n[s]=t[s]);return n}function g(t,e){t.appendChild(e)}function tt(t,e,n){const s=nt(t);if(!s.getElementById(e)){const l=m("style");l.id=e,l.textContent=n,st(s,l)}}function nt(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function st(t,e){return g(t.head||t,e),e.sheet}function j(t,e,n){t.insertBefore(e,n||null)}function L(t){t.parentNode&&t.parentNode.removeChild(t)}function re(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function m(t){return document.createElement(t)}function je(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Ce(t){return document.createTextNode(t)}function w(){return Ce(" ")}function ce(){return Ce("")}function Y(t,e,n,s){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}function h(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Q(t,e){for(const n in e)h(t,n,e[n])}function lt(t){let e;return{p(...n){e=n,e.forEach(s=>t.push(s))},r(){e.forEach(n=>t.splice(t.indexOf(n),1))}}}function it(t){return Array.from(t.childNodes)}function Ae(t,e){t.value=e??""}function ot(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}let ue;function K(t){ue=t}const W=[],Oe=[];let B=[];const Pe=[],rt=Promise.resolve();let fe=!1;function ct(){fe||(fe=!0,rt.then(Me))}function ae(t){B.push(t)}const de=new Set;let I=0;function Me(){if(I!==0)return;const t=ue;do{try{for(;I<W.length;){const e=W[I];I++,K(e),ut(e.$$)}}catch(e){throw W.length=0,I=0,e}for(K(null),W.length=0,I=0;Oe.length;)Oe.pop()();for(let e=0;e<B.length;e+=1){const n=B[e];de.has(n)||(de.add(n),n())}B.length=0}while(W.length);for(;Pe.length;)Pe.pop()();fe=!1,de.clear(),K(t)}function ut(t){if(t.fragment!==null){t.update(),T(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(ae)}}function ft(t){const e=[],n=[];B.forEach(s=>t.indexOf(s)===-1?e.push(s):n.push(s)),n.forEach(s=>s()),B=e}const X=new Set;let P;function at(){P={r:0,c:[],p:P}}function dt(){P.r||T(P.c),P=P.p}function C(t,e){t&&t.i&&(X.delete(t),t.i(e))}function z(t,e,n,s){if(t&&t.o){if(X.has(t))return;X.add(t),P.c.push(()=>{X.delete(t),s&&(n&&t.d(1),s())}),t.o(e)}else s&&s()}function D(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function he(t,e){const n={},s={},l={$$scope:1};let i=t.length;for(;i--;){const o=t[i],r=e[i];if(r){for(const u in o)u in r||(s[u]=1);for(const u in r)l[u]||(n[u]=r[u],l[u]=1);t[i]=r}else for(const u in o)l[u]=1}for(const o in s)o in n||(n[o]=void 0);return n}function ht(t){return typeof t=="object"&&t!==null?t:{}}function Te(t){t&&t.c()}function _e(t,e,n){const{fragment:s,after_update:l}=t.$$;s&&s.m(e,n),ae(()=>{const i=t.$$.on_mount.map(ve).filter(ke);t.$$.on_destroy?t.$$.on_destroy.push(...i):T(i),t.$$.on_mount=[]}),l.forEach(ae)}function ge(t,e){const n=t.$$;n.fragment!==null&&(ft(n.after_update),T(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function _t(t,e){t.$$.dirty[0]===-1&&(W.push(t),ct(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Z(t,e,n,s,l,i,o=null,r=[-1]){const u=ue;K(t);const a=t.$$={fragment:null,ctx:[],props:i,update:b,not_equal:l,bound:ye(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:ye(),dirty:r,skip_bound:!1,root:e.target||u.$$.root};o&&o(a.root);let y=!1;if(a.ctx=n?n(t,e.props||{},($,c,...v)=>{const f=v.length?v[0]:c;return a.ctx&&l(a.ctx[$],a.ctx[$]=f)&&(!a.skip_bound&&a.bound[$]&&a.bound[$](f),y&&_t(t,$)),c}):[],a.update(),y=!0,T(a.before_update),a.fragment=s?s(a.ctx):!1,e.target){if(e.hydrate){const $=it(e.target);a.fragment&&a.fragment.l($),$.forEach(L)}else a.fragment&&a.fragment.c();e.intro&&C(t.$$.fragment),_e(t,e.target,e.anchor),Me()}K(u)}let We;typeof HTMLElement=="function"&&(We=class extends HTMLElement{constructor(e,n,s){super();S(this,"$$ctor");S(this,"$$s");S(this,"$$c");S(this,"$$cn",!1);S(this,"$$d",{});S(this,"$$r",!1);S(this,"$$p_d",{});S(this,"$$l",{});S(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=n,s&&this.attachShadow({mode:"open"})}addEventListener(e,n,s){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(n),this.$$c){const l=this.$$c.$on(e,n);this.$$l_u.set(n,l)}super.addEventListener(e,n,s)}removeEventListener(e,n,s){if(super.removeEventListener(e,n,s),this.$$c){const l=this.$$l_u.get(n);l&&(l(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(i){return()=>{let o;return{c:function(){o=m("slot"),i!=="default"&&h(o,"name",i)},m:function(a,y){j(a,o,y)},d:function(a){a&&L(o)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},s=ot(this);for(const i of this.$$s)i in s&&(n[i]=[e(i)]);for(const i of this.attributes){const o=this.$$g_p(i.name);o in this.$$d||(this.$$d[o]=ee(o,i.value,this.$$p_d,"toProp"))}for(const i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const l=()=>{this.$$r=!0;for(const i in this.$$p_d)if(this.$$d[i]=this.$$c.$$.ctx[this.$$c.$$.props[i]],this.$$p_d[i].reflect){const o=ee(i,this.$$d[i],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,o)}this.$$r=!1};this.$$c.$$.after_update.push(l),l();for(const i in this.$$l)for(const o of this.$$l[i]){const r=this.$$c.$on(i,o);this.$$l_u.set(o,r)}this.$$l={}}}attributeChangedCallback(e,n,s){var l;this.$$r||(e=this.$$g_p(e),this.$$d[e]=ee(e,s,this.$$p_d,"toProp"),(l=this.$$c)==null||l.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(n=>this.$$p_d[n].attribute===e||!this.$$p_d[n].attribute&&n.toLowerCase()===e)||e}});function ee(t,e,n,s){var i;const l=(i=n[t])==null?void 0:i.type;if(e=l==="Boolean"&&typeof e!="boolean"?e!=null:e,!s||!n[t])return e;if(s==="toAttribute")switch(l){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(l){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Be(t,e,n,s,l,i){let o=class extends We{constructor(){super(t,n,l),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map(r=>(e[r].attribute||r).toLowerCase())}};return Object.keys(e).forEach(r=>{Object.defineProperty(o.prototype,r,{get(){return this.$$c&&r in this.$$c?this.$$c[r]:this.$$d[r]},set(u){var a;u=ee(r,u,e),this.$$d[r]=u,(a=this.$$c)==null||a.$set({[r]:u})}})}),s.forEach(r=>{Object.defineProperty(o.prototype,r,{get(){var u;return(u=this.$$c)==null?void 0:u[r]}})}),t.element=o,o}class te{constructor(){S(this,"$$");S(this,"$$set")}$destroy(){ge(this,1),this.$destroy=b}$on(e,n){if(!ke(n))return b;const s=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return s.push(n),()=>{const l=s.indexOf(n);l!==-1&&s.splice(l,1)}}$set(e){this.$$set&&!et(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const gt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(gt);function mt(t){tt(t,"svelte-1nq6lsq",".login-btn.svelte-1nq6lsq.svelte-1nq6lsq,.loading-btn.svelte-1nq6lsq.svelte-1nq6lsq,.avatar-btn.svelte-1nq6lsq.svelte-1nq6lsq{display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 0.3s ease;border:none;outline:none}.login-btn.svelte-1nq6lsq.svelte-1nq6lsq{width:120px;height:40px;border-radius:5px;background-color:#007bff;color:white;font-size:16px;font-weight:bold}.login-btn.svelte-1nq6lsq.svelte-1nq6lsq:hover{background-color:#0056b3}.login-btn.svelte-1nq6lsq.svelte-1nq6lsq:focus,.avatar-btn.svelte-1nq6lsq.svelte-1nq6lsq:focus{outline:2px solid #0056b3;outline-offset:4px}.loading-btn.svelte-1nq6lsq.svelte-1nq6lsq,.avatar-btn.svelte-1nq6lsq.svelte-1nq6lsq{width:50px;height:50px;border-radius:50%}.loading-btn.svelte-1nq6lsq.svelte-1nq6lsq{background-color:#00bfff;animation:svelte-1nq6lsq-pulse 1s infinite ease-in-out}.avatar-btn.svelte-1nq6lsq img.svelte-1nq6lsq{width:100%;height:100%;object-fit:cover;border-radius:50%}@keyframes svelte-1nq6lsq-pulse{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}")}function $t(t){let e,n,s;return{c(){e=m("button"),e.textContent="Login",h(e,"class","login-btn svelte-1nq6lsq"),h(e,"aria-label","Log in")},m(l,i){j(l,e,i),n||(s=Y(e,"click",t[2]),n=!0)},p:b,d(l){l&&L(e),n=!1,s()}}}function bt(t){let e,n,s,l,i;return{c(){e=m("button"),n=m("img"),qe(n.src,s=yt)||h(n,"src",s),h(n,"alt","User Avatar"),h(n,"class","svelte-1nq6lsq"),h(e,"class","avatar-btn svelte-1nq6lsq"),h(e,"aria-label","Log out")},m(o,r){j(o,e,r),g(e,n),l||(i=Y(e,"click",t[3]),l=!0)},p:b,d(o){o&&L(e),l=!1,i()}}}function pt(t){let e;return{c(){e=m("button"),e.innerHTML="",h(e,"class","loading-btn svelte-1nq6lsq"),h(e,"aria-busy","true"),h(e,"aria-label","Logging in")},m(n,s){j(n,e,s)},p:b,d(n){n&&L(e)}}}function vt(t){let e;function n(i,o){return i[0]?pt:i[1]?bt:$t}let s=n(t),l=s(t);return{c(){l.c(),e=ce()},m(i,o){l.m(i,o),j(i,e,o)},p(i,[o]){s===(s=n(i))&&l?l.p(i,o):(l.d(1),l=s(i),l&&(l.c(),l.m(e.parentNode,e)))},i:b,o:b,d(i){i&&L(e),l.d(i)}}}let yt="https://via.placeholder.com/50";function kt(t,e,n){let s=!1,l=!1;const i=async()=>{n(0,s=!0),await new Promise(u=>setTimeout(u,2e3)),n(0,s=!1),n(1,l=!0)},o=()=>{n(1,l=!1)};return l=l,[s,l,i,o]}class Ie extends te{constructor(e){super(),Z(this,e,kt,vt,R,{},mt)}}customElements.define("sesamy-login",Be(Ie,{},[],[],!0));const qt=Ie;/**
|
|
2
|
+
* @license lucide-svelte v0.445.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ze={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function De(t,e,n){const s=t.slice();return s[11]=e[n][0],s[12]=e[n][1],s}function me(t){let e,n=[t[12]],s={};for(let l=0;l<n.length;l+=1)s=N(s,n[l]);return{c(){e=je(t[11]),Q(e,s)},m(l,i){j(l,e,i)},p(l,i){Q(e,s=he(n,[i&32&&l[12]]))},d(l){l&&L(e)}}}function Fe(t){let e=t[11],n,s=t[11]&&me(t);return{c(){s&&s.c(),n=ce()},m(l,i){s&&s.m(l,i),j(l,n,i)},p(l,i){l[11]?e?R(e,l[11])?(s.d(1),s=me(l),e=l[11],s.c(),s.m(n.parentNode,n)):s.p(l,i):(s=me(l),e=l[11],s.c(),s.m(n.parentNode,n)):e&&(s.d(1),s=null,e=l[11])},d(l){l&&L(n),s&&s.d(l)}}}function wt(t){let e,n,s,l,i,o=D(t[5]),r=[];for(let c=0;c<o.length;c+=1)r[c]=Fe(De(t,o,c));const u=t[10].default,a=we(u,t,t[9],null);let y=[ze,t[7],{width:t[2]},{height:t[2]},{stroke:t[1]},{"stroke-width":s=t[4]?Number(t[3])*24/Number(t[2]):t[3]},{class:l=t[6]("lucide-icon","lucide",t[0]?`lucide-${t[0]}`:"",t[8].class)}],$={};for(let c=0;c<y.length;c+=1)$=N($,y[c]);return{c(){e=je("svg");for(let c=0;c<r.length;c+=1)r[c].c();n=ce(),a&&a.c(),Q(e,$)},m(c,v){j(c,e,v);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(e,null);g(e,n),a&&a.m(e,null),i=!0},p(c,[v]){if(v&32){o=D(c[5]);let f;for(f=0;f<o.length;f+=1){const A=De(c,o,f);r[f]?r[f].p(A,v):(r[f]=Fe(A),r[f].c(),r[f].m(e,n))}for(;f<r.length;f+=1)r[f].d(1);r.length=o.length}a&&a.p&&(!i||v&512)&&Ne(a,u,c,c[9],i?xe(u,c[9],v,null):Le(c[9]),null),Q(e,$=he(y,[ze,v&128&&c[7],(!i||v&4)&&{width:c[2]},(!i||v&4)&&{height:c[2]},(!i||v&2)&&{stroke:c[1]},(!i||v&28&&s!==(s=c[4]?Number(c[3])*24/Number(c[2]):c[3]))&&{"stroke-width":s},(!i||v&257&&l!==(l=c[6]("lucide-icon","lucide",c[0]?`lucide-${c[0]}`:"",c[8].class)))&&{class:l}]))},i(c){i||(C(a,c),i=!0)},o(c){z(a,c),i=!1},d(c){c&&L(e),re(r,c),a&&a.d(c)}}}function Et(t,e,n){const s=["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"];let l=Se(e,s),{$$slots:i={},$$scope:o}=e,{name:r=void 0}=e,{color:u="currentColor"}=e,{size:a=24}=e,{strokeWidth:y=2}=e,{absoluteStrokeWidth:$=!1}=e,{iconNode:c=[]}=e;const v=(...f)=>f.filter((A,F,ne)=>!!A&&ne.indexOf(A)===F).join(" ");return t.$$set=f=>{n(8,e=N(N({},e),G(f))),n(7,l=Se(e,s)),"name"in f&&n(0,r=f.name),"color"in f&&n(1,u=f.color),"size"in f&&n(2,a=f.size),"strokeWidth"in f&&n(3,y=f.strokeWidth),"absoluteStrokeWidth"in f&&n(4,$=f.absoluteStrokeWidth),"iconNode"in f&&n(5,c=f.iconNode),"$$scope"in f&&n(9,o=f.$$scope)},e=G(e),[r,u,a,y,$,c,v,l,e,o,i]}class xt extends te{constructor(e){super(),Z(this,e,Et,wt,R,{name:0,color:1,size:2,strokeWidth:3,absoluteStrokeWidth:4,iconNode:5})}}function Nt(t){let e;const n=t[2].default,s=we(n,t,t[3],null);return{c(){s&&s.c()},m(l,i){s&&s.m(l,i),e=!0},p(l,i){s&&s.p&&(!e||i&8)&&Ne(s,n,l,l[3],e?xe(n,l[3],i,null):Le(l[3]),null)},i(l){e||(C(s,l),e=!0)},o(l){z(s,l),e=!1},d(l){s&&s.d(l)}}}function Lt(t){let e,n;const s=[{name:"circle-check"},t[1],{iconNode:t[0]}];let l={$$slots:{default:[Nt]},$$scope:{ctx:t}};for(let i=0;i<s.length;i+=1)l=N(l,s[i]);return e=new xt({props:l}),{c(){Te(e.$$.fragment)},m(i,o){_e(e,i,o),n=!0},p(i,[o]){const r=o&3?he(s,[s[0],o&2&&ht(i[1]),o&1&&{iconNode:i[0]}]):{};o&8&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){n||(C(e.$$.fragment,i),n=!0)},o(i){z(e.$$.fragment,i),n=!1},d(i){ge(e,i)}}}function St(t,e,n){let{$$slots:s={},$$scope:l}=e;const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];return t.$$set=o=>{n(1,e=N(N({},e),G(o))),"$$scope"in o&&n(3,l=o.$$scope)},e=G(e),[i,e,s,l]}class jt extends te{constructor(e){super(),Z(this,e,St,Lt,R,{})}}function He(t,e,n){const s=t.slice();return s[6]=e[n],s}function Re(t,e,n){const s=t.slice();return s[9]=e[n],s}function Ke(t){let e,n,s,l,i,o;return n=new jt({props:{class:"text-green-500 mr-2",size:20}}),{c(){e=m("li"),Te(n.$$.fragment),s=w(),l=m("span"),l.textContent=`${t[9]}`,i=w(),h(e,"class","flex items-center")},m(r,u){j(r,e,u),_e(n,e,null),g(e,s),g(e,l),g(e,i),o=!0},p:b,i(r){o||(C(n.$$.fragment,r),o=!0)},o(r){z(n.$$.fragment,r),o=!1},d(r){r&&L(e),ge(n)}}}function Ue(t){let e,n;return{c(){e=m("img"),qe(e.src,n="/api/placeholder/40/25")||h(e,"src",n),h(e,"alt",t[6]),h(e,"class","h-6")},m(s,l){j(s,e,l)},p:b,d(s){s&&L(e)}}}function Ct(t){let e,n,s,l,i,o,r,u,a,y,$,c,v,f,A,F,ne,O,E,Je,$e,Ge,se,Ye,le,Qe,ie,Xe,U,oe,be,pe,Ze,M=D(t[1]),p=[];for(let _=0;_<M.length;_+=1)p[_]=Ke(Re(t,M,_));const Pt=_=>z(p[_],1,1,()=>{p[_]=null});let H=D(t[2]),q=[];for(let _=0;_<H.length;_+=1)q[_]=Ue(He(t,H,_));return be=lt(t[4][0]),{c(){e=m("div"),n=m("div"),n.textContent="Redan prenumerant? Logga in",s=w(),l=m("h1"),l.textContent="FOKUS",i=w(),o=m("h2"),o.textContent="Läs Fokus Digital i 6 månader för bara 79 kr!",r=w(),u=m("ul");for(let _=0;_<p.length;_+=1)p[_].c();a=w(),y=m("div"),$=m("label"),c=m("input"),v=w(),f=m("div"),f.innerHTML='<div class="font-semibold">Fokus Digital i 6 månader för 79kr!</div> <div class="text-sm text-gray-600">Efter kampanjperioden 149 kr/mån. Ingen bindningstid!</div>',A=w(),F=m("div"),F.textContent="79 SEK/6 mån",ne=w(),O=m("label"),E=m("input"),Je=w(),$e=m("div"),$e.innerHTML='<div class="font-semibold">Fokus Digital i ett år för 995kr</div> <div class="text-sm text-gray-600">Du sparar 793 kr. Prenumerationen förnyas automatiskt årsvis.</div>',Ge=w(),se=m("div"),se.textContent="995 SEK/år",Ye=w(),le=m("button"),le.textContent="Fortsätt",Qe=w(),ie=m("div"),ie.textContent="Säker SSL-krypterad betalning",Xe=w(),U=m("div");for(let _=0;_<q.length;_+=1)q[_].c();h(n,"class","text-right text-sm text-red-500 mb-4"),h(l,"class","text-4xl font-bold text-red-500 mb-4"),h(o,"class","text-xl font-semibold mb-6"),h(u,"class","space-y-2 mb-6"),h(c,"type","radio"),h(c,"name","subscription"),c.__value="sixMonths",Ae(c,c.__value),h(c,"class","mr-3"),h(F,"class","ml-auto font-semibold"),h($,"class","flex items-center p-4 border rounded-lg"),h(E,"type","radio"),h(E,"name","subscription"),E.__value="oneYear",Ae(E,E.__value),h(E,"class","mr-3"),h(se,"class","ml-auto font-semibold"),h(O,"class","flex items-center p-4 border rounded-lg"),h(y,"class","space-y-4 mb-6"),h(le,"class","w-full bg-red-500 text-white py-3 rounded-lg font-semibold"),h(ie,"class","text-center text-sm text-gray-600 mt-4"),h(U,"class","flex justify-center space-x-2 mt-2"),h(e,"class","max-w-md mx-auto bg-white p-6 rounded-lg shadow-lg"),be.p(c,E)},m(_,k){j(_,e,k),g(e,n),g(e,s),g(e,l),g(e,i),g(e,o),g(e,r),g(e,u);for(let d=0;d<p.length;d+=1)p[d]&&p[d].m(u,null);g(e,a),g(e,y),g(y,$),g($,c),c.checked=c.__value===t[0],g($,v),g($,f),g($,A),g($,F),g(y,ne),g(y,O),g(O,E),E.checked=E.__value===t[0],g(O,Je),g(O,$e),g(O,Ge),g(O,se),g(e,Ye),g(e,le),g(e,Qe),g(e,ie),g(e,Xe),g(e,U);for(let d=0;d<q.length;d+=1)q[d]&&q[d].m(U,null);oe=!0,pe||(Ze=[Y(c,"change",t[3]),Y(E,"change",t[5])],pe=!0)},p(_,[k]){if(k&2){M=D(_[1]);let d;for(d=0;d<M.length;d+=1){const V=Re(_,M,d);p[d]?(p[d].p(V,k),C(p[d],1)):(p[d]=Ke(V),p[d].c(),C(p[d],1),p[d].m(u,null))}for(at(),d=M.length;d<p.length;d+=1)Pt(d);dt()}if(k&1&&(c.checked=c.__value===_[0]),k&1&&(E.checked=E.__value===_[0]),k&4){H=D(_[2]);let d;for(d=0;d<H.length;d+=1){const V=He(_,H,d);q[d]?q[d].p(V,k):(q[d]=Ue(V),q[d].c(),q[d].m(U,null))}for(;d<q.length;d+=1)q[d].d(1);q.length=H.length}},i(_){if(!oe){for(let k=0;k<M.length;k+=1)C(p[k]);oe=!0}},o(_){p=p.filter(Boolean);for(let k=0;k<p.length;k+=1)z(p[k]);oe=!1},d(_){_&&L(e),re(p,_),re(q,_),be.r(),pe=!1,T(Ze)}}}function At(t,e,n){let s="sixMonths";const l=["Allt material på Fokus.se","Tillgång till e-tidning","Tillgång till våra podcasts","Nyhetsbrev"],i=["Visa","American Express","Mastercard","Klarna","Google Pay","Apple Pay","Swish"],o=[[]];function r(){s=this.__value,n(0,s)}function u(){s=this.__value,n(0,s)}return[s,l,i,r,o,u]}class Ve extends te{constructor(e){super(),Z(this,e,At,Ct,R,{})}}customElements.define("sesamy-paywall",Be(Ve,{},[],[],!0));const Ot=Ve;x.Login=qt,x.Paywall=Ot,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,24 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sesamy/sesamy-components",
|
|
3
3
|
"description": "Ahareable web components library with Vite + Svelte",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"module": "dist/lib/sesamy-components.js",
|
|
6
|
+
"module": "dist/lib/sesamy-components.es.js",
|
|
7
7
|
"main": "dist/lib/sesamy-components.umd.js",
|
|
8
8
|
"types": "dist/lib/sesamy-components.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/lib/sesamy-components.es.js",
|
|
12
|
+
"require": "./dist/lib/sesamy-components.umd.js",
|
|
13
|
+
"types": "./dist/lib/sesamy-components.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
9
17
|
"scripts": {
|
|
10
|
-
"start": "
|
|
18
|
+
"start": "yarn run dev",
|
|
11
19
|
"dev": "vite --config vite.demo.config.ts",
|
|
12
20
|
"build": "vite build",
|
|
13
21
|
"build:demo": "vite build --config vite.demo.config.ts",
|
|
14
22
|
"preview": "vite preview --config vite.demo.config.ts",
|
|
15
23
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
16
|
-
"prepublishOnly": "
|
|
24
|
+
"prepublishOnly": "yarn run build",
|
|
25
|
+
"storybook": "yarn run build && storybook dev -p 6006",
|
|
26
|
+
"build-storybook": "yarn run build && storybook build"
|
|
17
27
|
},
|
|
18
28
|
"devDependencies": {
|
|
29
|
+
"@chromatic-com/storybook": "^1.9.0",
|
|
30
|
+
"@storybook/addon-essentials": "^8.3.2",
|
|
31
|
+
"@storybook/addon-interactions": "^8.3.2",
|
|
32
|
+
"@storybook/addon-links": "^8.3.2",
|
|
33
|
+
"@storybook/addon-svelte-csf": "^4.1.7",
|
|
34
|
+
"@storybook/blocks": "^8.3.2",
|
|
35
|
+
"@storybook/svelte": "^8.3.2",
|
|
36
|
+
"@storybook/svelte-vite": "^8.3.2",
|
|
37
|
+
"@storybook/test": "^8.3.2",
|
|
38
|
+
"@storybook/web-components": "^8.3.2",
|
|
39
|
+
"@storybook/web-components-vite": "^8.3.2",
|
|
19
40
|
"@sveltejs/vite-plugin-svelte": "^3.1.2",
|
|
20
41
|
"@tsconfig/svelte": "^5.0.4",
|
|
21
42
|
"@types/node": "^22.5.5",
|
|
43
|
+
"lit": "^3.2.0",
|
|
44
|
+
"lit-html": "^3.2.0",
|
|
45
|
+
"storybook": "^8.3.2",
|
|
22
46
|
"svelte": "^4.2.19",
|
|
23
47
|
"svelte-check": "^4.0.2",
|
|
24
48
|
"svelte-preprocess": "^6.0.2",
|