@gomusdev/web-components 1.8.3 → 1.8.5
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 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
@@ -49,6 +49,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
49
49
|
var is_extensible = Object.isExtensible;
|
|
50
50
|
const noop$1 = () => {
|
|
51
51
|
};
|
|
52
|
+
function run(fn) {
|
|
53
|
+
return fn();
|
|
54
|
+
}
|
|
52
55
|
function run_all(arr) {
|
|
53
56
|
for (var i = 0; i < arr.length; i++) {
|
|
54
57
|
arr[i]();
|
|
@@ -2350,6 +2353,49 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2350
2353
|
function set_signal_status(signal, status) {
|
|
2351
2354
|
signal.f = signal.f & STATUS_MASK | status;
|
|
2352
2355
|
}
|
|
2356
|
+
function deep_read_state(value) {
|
|
2357
|
+
if (typeof value !== "object" || !value || value instanceof EventTarget) {
|
|
2358
|
+
return;
|
|
2359
|
+
}
|
|
2360
|
+
if (STATE_SYMBOL in value) {
|
|
2361
|
+
deep_read(value);
|
|
2362
|
+
} else if (!Array.isArray(value)) {
|
|
2363
|
+
for (let key in value) {
|
|
2364
|
+
const prop2 = value[key];
|
|
2365
|
+
if (typeof prop2 === "object" && prop2 && STATE_SYMBOL in prop2) {
|
|
2366
|
+
deep_read(prop2);
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
function deep_read(value, visited = /* @__PURE__ */ new Set()) {
|
|
2372
|
+
if (typeof value === "object" && value !== null && // We don't want to traverse DOM elements
|
|
2373
|
+
!(value instanceof EventTarget) && !visited.has(value)) {
|
|
2374
|
+
visited.add(value);
|
|
2375
|
+
if (value instanceof Date) {
|
|
2376
|
+
value.getTime();
|
|
2377
|
+
}
|
|
2378
|
+
for (let key in value) {
|
|
2379
|
+
try {
|
|
2380
|
+
deep_read(value[key], visited);
|
|
2381
|
+
} catch (e) {
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
const proto = get_prototype_of(value);
|
|
2385
|
+
if (proto !== Object.prototype && proto !== Array.prototype && proto !== Map.prototype && proto !== Set.prototype && proto !== Date.prototype) {
|
|
2386
|
+
const descriptors = get_descriptors(proto);
|
|
2387
|
+
for (let key in descriptors) {
|
|
2388
|
+
const get2 = descriptors[key].get;
|
|
2389
|
+
if (get2) {
|
|
2390
|
+
try {
|
|
2391
|
+
get2.call(value);
|
|
2392
|
+
} catch (e) {
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2353
2399
|
const all_registered_events = /* @__PURE__ */ new Set();
|
|
2354
2400
|
const root_event_handles = /* @__PURE__ */ new Set();
|
|
2355
2401
|
function create_event(event_name, dom, handler, options = {}) {
|
|
@@ -4251,6 +4297,63 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4251
4297
|
});
|
|
4252
4298
|
return element_or_component;
|
|
4253
4299
|
}
|
|
4300
|
+
function init(immutable = false) {
|
|
4301
|
+
const context = (
|
|
4302
|
+
/** @type {ComponentContextLegacy} */
|
|
4303
|
+
component_context
|
|
4304
|
+
);
|
|
4305
|
+
const callbacks = context.l.u;
|
|
4306
|
+
if (!callbacks) return;
|
|
4307
|
+
let props = () => deep_read_state(context.s);
|
|
4308
|
+
if (immutable) {
|
|
4309
|
+
let version = 0;
|
|
4310
|
+
let prev = (
|
|
4311
|
+
/** @type {Record<string, any>} */
|
|
4312
|
+
{}
|
|
4313
|
+
);
|
|
4314
|
+
const d = /* @__PURE__ */ derived(() => {
|
|
4315
|
+
let changed = false;
|
|
4316
|
+
const props2 = context.s;
|
|
4317
|
+
for (const key in props2) {
|
|
4318
|
+
if (props2[key] !== prev[key]) {
|
|
4319
|
+
prev[key] = props2[key];
|
|
4320
|
+
changed = true;
|
|
4321
|
+
}
|
|
4322
|
+
}
|
|
4323
|
+
if (changed) version++;
|
|
4324
|
+
return version;
|
|
4325
|
+
});
|
|
4326
|
+
props = () => get(d);
|
|
4327
|
+
}
|
|
4328
|
+
if (callbacks.b.length) {
|
|
4329
|
+
user_pre_effect(() => {
|
|
4330
|
+
observe_all(context, props);
|
|
4331
|
+
run_all(callbacks.b);
|
|
4332
|
+
});
|
|
4333
|
+
}
|
|
4334
|
+
user_effect(() => {
|
|
4335
|
+
const fns = untrack(() => callbacks.m.map(run));
|
|
4336
|
+
return () => {
|
|
4337
|
+
for (const fn of fns) {
|
|
4338
|
+
if (typeof fn === "function") {
|
|
4339
|
+
fn();
|
|
4340
|
+
}
|
|
4341
|
+
}
|
|
4342
|
+
};
|
|
4343
|
+
});
|
|
4344
|
+
if (callbacks.a.length) {
|
|
4345
|
+
user_effect(() => {
|
|
4346
|
+
observe_all(context, props);
|
|
4347
|
+
run_all(callbacks.a);
|
|
4348
|
+
});
|
|
4349
|
+
}
|
|
4350
|
+
}
|
|
4351
|
+
function observe_all(context, props) {
|
|
4352
|
+
if (context.l.s) {
|
|
4353
|
+
for (const signal of context.l.s) get(signal);
|
|
4354
|
+
}
|
|
4355
|
+
props();
|
|
4356
|
+
}
|
|
4254
4357
|
let is_store_binding = false;
|
|
4255
4358
|
function capture_store_binding(fn) {
|
|
4256
4359
|
var previous_is_store_binding = is_store_binding;
|
|
@@ -5292,7 +5395,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5292
5395
|
querySerializer: requestQuerySerializer,
|
|
5293
5396
|
bodySerializer = globalBodySerializer ?? defaultBodySerializer,
|
|
5294
5397
|
body,
|
|
5295
|
-
...
|
|
5398
|
+
...init2
|
|
5296
5399
|
} = fetchOptions || {};
|
|
5297
5400
|
if (localBaseUrl) {
|
|
5298
5401
|
baseUrl = removeTrailingSlash(localBaseUrl);
|
|
@@ -5315,16 +5418,16 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5315
5418
|
const requestInit = {
|
|
5316
5419
|
redirect: "follow",
|
|
5317
5420
|
...baseOptions,
|
|
5318
|
-
...
|
|
5421
|
+
...init2,
|
|
5319
5422
|
body: serializedBody,
|
|
5320
5423
|
headers: mergeHeaders(defaultHeaders, baseHeaders, headers, params.header)
|
|
5321
5424
|
};
|
|
5322
5425
|
let id;
|
|
5323
5426
|
let options;
|
|
5324
5427
|
let request = new CustomRequest(createFinalURL(schemaPath, { baseUrl, params, querySerializer }), requestInit);
|
|
5325
|
-
for (const key in
|
|
5428
|
+
for (const key in init2) {
|
|
5326
5429
|
if (!(key in request)) {
|
|
5327
|
-
request[key] =
|
|
5430
|
+
request[key] = init2[key];
|
|
5328
5431
|
}
|
|
5329
5432
|
}
|
|
5330
5433
|
if (middlewares.length) {
|
|
@@ -5394,36 +5497,36 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5394
5497
|
}
|
|
5395
5498
|
return {
|
|
5396
5499
|
/** Call a GET endpoint */
|
|
5397
|
-
GET(url,
|
|
5398
|
-
return coreFetch(url, { ...
|
|
5500
|
+
GET(url, init2) {
|
|
5501
|
+
return coreFetch(url, { ...init2, method: "GET" });
|
|
5399
5502
|
},
|
|
5400
5503
|
/** Call a PUT endpoint */
|
|
5401
|
-
PUT(url,
|
|
5402
|
-
return coreFetch(url, { ...
|
|
5504
|
+
PUT(url, init2) {
|
|
5505
|
+
return coreFetch(url, { ...init2, method: "PUT" });
|
|
5403
5506
|
},
|
|
5404
5507
|
/** Call a POST endpoint */
|
|
5405
|
-
POST(url,
|
|
5406
|
-
return coreFetch(url, { ...
|
|
5508
|
+
POST(url, init2) {
|
|
5509
|
+
return coreFetch(url, { ...init2, method: "POST" });
|
|
5407
5510
|
},
|
|
5408
5511
|
/** Call a DELETE endpoint */
|
|
5409
|
-
DELETE(url,
|
|
5410
|
-
return coreFetch(url, { ...
|
|
5512
|
+
DELETE(url, init2) {
|
|
5513
|
+
return coreFetch(url, { ...init2, method: "DELETE" });
|
|
5411
5514
|
},
|
|
5412
5515
|
/** Call a OPTIONS endpoint */
|
|
5413
|
-
OPTIONS(url,
|
|
5414
|
-
return coreFetch(url, { ...
|
|
5516
|
+
OPTIONS(url, init2) {
|
|
5517
|
+
return coreFetch(url, { ...init2, method: "OPTIONS" });
|
|
5415
5518
|
},
|
|
5416
5519
|
/** Call a HEAD endpoint */
|
|
5417
|
-
HEAD(url,
|
|
5418
|
-
return coreFetch(url, { ...
|
|
5520
|
+
HEAD(url, init2) {
|
|
5521
|
+
return coreFetch(url, { ...init2, method: "HEAD" });
|
|
5419
5522
|
},
|
|
5420
5523
|
/** Call a PATCH endpoint */
|
|
5421
|
-
PATCH(url,
|
|
5422
|
-
return coreFetch(url, { ...
|
|
5524
|
+
PATCH(url, init2) {
|
|
5525
|
+
return coreFetch(url, { ...init2, method: "PATCH" });
|
|
5423
5526
|
},
|
|
5424
5527
|
/** Call a TRACE endpoint */
|
|
5425
|
-
TRACE(url,
|
|
5426
|
-
return coreFetch(url, { ...
|
|
5528
|
+
TRACE(url, init2) {
|
|
5529
|
+
return coreFetch(url, { ...init2, method: "TRACE" });
|
|
5427
5530
|
},
|
|
5428
5531
|
/** Register middleware */
|
|
5429
5532
|
use(...middleware) {
|
|
@@ -11012,7 +11115,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11012
11115
|
class Shop {
|
|
11013
11116
|
constructor(apiUrl, shopDomain, locale, type = "angular") {
|
|
11014
11117
|
__privateAdd(this, _Shop_instances);
|
|
11015
|
-
__privateAdd(this, _data2, /* @__PURE__ */ state(proxy({ customerSalutations: [], countries: [] })));
|
|
11118
|
+
__privateAdd(this, _data2, /* @__PURE__ */ state(proxy({ customerSalutations: [], countries: [], locales: [] })));
|
|
11016
11119
|
// Holds the fetch status and timestamp for data requests, tracking whether the request is ongoing or completed and when it was completed.
|
|
11017
11120
|
__privateAdd(this, _fetchStatus, {});
|
|
11018
11121
|
__privateAdd(this, _canFetch, () => {
|
|
@@ -11212,6 +11315,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11212
11315
|
get countries() {
|
|
11213
11316
|
return this.fetchAndCache("/api/v3/countries", "countries", "countries");
|
|
11214
11317
|
}
|
|
11318
|
+
get locales() {
|
|
11319
|
+
return this.fetchAndCache("/api/v4/locales", "locales", "locales_options");
|
|
11320
|
+
}
|
|
11215
11321
|
get urls() {
|
|
11216
11322
|
return get(__privateGet(this, _data2)).urls;
|
|
11217
11323
|
}
|
|
@@ -11400,10 +11506,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11400
11506
|
placeholder: "",
|
|
11401
11507
|
description: "",
|
|
11402
11508
|
autocomplete: "language",
|
|
11403
|
-
options: () =>
|
|
11404
|
-
{ value: 1, label: "German" },
|
|
11405
|
-
{ value: 5, label: "English" }
|
|
11406
|
-
]
|
|
11509
|
+
options: () => shop.locales.map((c) => ({ label: c.locale, value: c.id }))
|
|
11407
11510
|
},
|
|
11408
11511
|
acceptTerms: {
|
|
11409
11512
|
key: "acceptTerms",
|
|
@@ -11510,11 +11613,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11510
11613
|
return __privateGet(_Forms, _requiredApiKeysMap)[formId];
|
|
11511
11614
|
}
|
|
11512
11615
|
static createField(key, required) {
|
|
11513
|
-
const
|
|
11514
|
-
if (!
|
|
11616
|
+
const init2 = _Forms.getFieldInit(key);
|
|
11617
|
+
if (!init2) {
|
|
11515
11618
|
throw new Error(`(formFields) Field "${key}" not found`);
|
|
11516
11619
|
}
|
|
11517
|
-
return createField(
|
|
11620
|
+
return createField(init2, required);
|
|
11518
11621
|
}
|
|
11519
11622
|
static getFormFields(formId) {
|
|
11520
11623
|
return formFields(formId);
|
|
@@ -12191,6 +12294,17 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
12191
12294
|
}
|
|
12192
12295
|
delegate(["click"]);
|
|
12193
12296
|
customElements.define("go-cart", create_custom_element(Cart, { preview: {} }, [], [], false));
|
|
12297
|
+
enable_legacy_mode_flag();
|
|
12298
|
+
function CartCounter($$anchor, $$props) {
|
|
12299
|
+
push($$props, false);
|
|
12300
|
+
init();
|
|
12301
|
+
next();
|
|
12302
|
+
var text2 = text$1();
|
|
12303
|
+
template_effect(() => set_text(text2, cart.items.length));
|
|
12304
|
+
append($$anchor, text2);
|
|
12305
|
+
pop();
|
|
12306
|
+
}
|
|
12307
|
+
customElements.define("go-cart-counter", create_custom_element(CartCounter, {}, [], [], false));
|
|
12194
12308
|
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
|
12195
12309
|
const {
|
|
12196
12310
|
entries,
|
|
@@ -13583,7 +13697,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
13583
13697
|
pop();
|
|
13584
13698
|
}
|
|
13585
13699
|
customElements.define("go-errors-feedback", create_custom_element(ErrorsFeedback, {}, [], [], false));
|
|
13586
|
-
enable_legacy_mode_flag();
|
|
13587
13700
|
var root$4 = /* @__PURE__ */ from_html(`<div class="go-form-feedback"><!></div>`);
|
|
13588
13701
|
function FormFeedback($$anchor, $$props) {
|
|
13589
13702
|
var div = root$4();
|
|
@@ -47,6 +47,9 @@ var get_prototype_of = Object.getPrototypeOf;
|
|
|
47
47
|
var is_extensible = Object.isExtensible;
|
|
48
48
|
const noop$1 = () => {
|
|
49
49
|
};
|
|
50
|
+
function run(fn) {
|
|
51
|
+
return fn();
|
|
52
|
+
}
|
|
50
53
|
function run_all(arr) {
|
|
51
54
|
for (var i = 0; i < arr.length; i++) {
|
|
52
55
|
arr[i]();
|
|
@@ -2348,6 +2351,49 @@ const STATUS_MASK = -7169;
|
|
|
2348
2351
|
function set_signal_status(signal, status) {
|
|
2349
2352
|
signal.f = signal.f & STATUS_MASK | status;
|
|
2350
2353
|
}
|
|
2354
|
+
function deep_read_state(value) {
|
|
2355
|
+
if (typeof value !== "object" || !value || value instanceof EventTarget) {
|
|
2356
|
+
return;
|
|
2357
|
+
}
|
|
2358
|
+
if (STATE_SYMBOL in value) {
|
|
2359
|
+
deep_read(value);
|
|
2360
|
+
} else if (!Array.isArray(value)) {
|
|
2361
|
+
for (let key in value) {
|
|
2362
|
+
const prop2 = value[key];
|
|
2363
|
+
if (typeof prop2 === "object" && prop2 && STATE_SYMBOL in prop2) {
|
|
2364
|
+
deep_read(prop2);
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
function deep_read(value, visited = /* @__PURE__ */ new Set()) {
|
|
2370
|
+
if (typeof value === "object" && value !== null && // We don't want to traverse DOM elements
|
|
2371
|
+
!(value instanceof EventTarget) && !visited.has(value)) {
|
|
2372
|
+
visited.add(value);
|
|
2373
|
+
if (value instanceof Date) {
|
|
2374
|
+
value.getTime();
|
|
2375
|
+
}
|
|
2376
|
+
for (let key in value) {
|
|
2377
|
+
try {
|
|
2378
|
+
deep_read(value[key], visited);
|
|
2379
|
+
} catch (e) {
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
const proto = get_prototype_of(value);
|
|
2383
|
+
if (proto !== Object.prototype && proto !== Array.prototype && proto !== Map.prototype && proto !== Set.prototype && proto !== Date.prototype) {
|
|
2384
|
+
const descriptors = get_descriptors(proto);
|
|
2385
|
+
for (let key in descriptors) {
|
|
2386
|
+
const get2 = descriptors[key].get;
|
|
2387
|
+
if (get2) {
|
|
2388
|
+
try {
|
|
2389
|
+
get2.call(value);
|
|
2390
|
+
} catch (e) {
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2351
2397
|
const all_registered_events = /* @__PURE__ */ new Set();
|
|
2352
2398
|
const root_event_handles = /* @__PURE__ */ new Set();
|
|
2353
2399
|
function create_event(event_name, dom, handler, options = {}) {
|
|
@@ -4250,6 +4296,63 @@ function bind_this(element_or_component = {}, update, get_value, get_parts) {
|
|
|
4250
4296
|
});
|
|
4251
4297
|
return element_or_component;
|
|
4252
4298
|
}
|
|
4299
|
+
function init(immutable = false) {
|
|
4300
|
+
const context = (
|
|
4301
|
+
/** @type {ComponentContextLegacy} */
|
|
4302
|
+
component_context
|
|
4303
|
+
);
|
|
4304
|
+
const callbacks = context.l.u;
|
|
4305
|
+
if (!callbacks) return;
|
|
4306
|
+
let props = () => deep_read_state(context.s);
|
|
4307
|
+
if (immutable) {
|
|
4308
|
+
let version = 0;
|
|
4309
|
+
let prev = (
|
|
4310
|
+
/** @type {Record<string, any>} */
|
|
4311
|
+
{}
|
|
4312
|
+
);
|
|
4313
|
+
const d = /* @__PURE__ */ derived(() => {
|
|
4314
|
+
let changed = false;
|
|
4315
|
+
const props2 = context.s;
|
|
4316
|
+
for (const key in props2) {
|
|
4317
|
+
if (props2[key] !== prev[key]) {
|
|
4318
|
+
prev[key] = props2[key];
|
|
4319
|
+
changed = true;
|
|
4320
|
+
}
|
|
4321
|
+
}
|
|
4322
|
+
if (changed) version++;
|
|
4323
|
+
return version;
|
|
4324
|
+
});
|
|
4325
|
+
props = () => get(d);
|
|
4326
|
+
}
|
|
4327
|
+
if (callbacks.b.length) {
|
|
4328
|
+
user_pre_effect(() => {
|
|
4329
|
+
observe_all(context, props);
|
|
4330
|
+
run_all(callbacks.b);
|
|
4331
|
+
});
|
|
4332
|
+
}
|
|
4333
|
+
user_effect(() => {
|
|
4334
|
+
const fns = untrack(() => callbacks.m.map(run));
|
|
4335
|
+
return () => {
|
|
4336
|
+
for (const fn of fns) {
|
|
4337
|
+
if (typeof fn === "function") {
|
|
4338
|
+
fn();
|
|
4339
|
+
}
|
|
4340
|
+
}
|
|
4341
|
+
};
|
|
4342
|
+
});
|
|
4343
|
+
if (callbacks.a.length) {
|
|
4344
|
+
user_effect(() => {
|
|
4345
|
+
observe_all(context, props);
|
|
4346
|
+
run_all(callbacks.a);
|
|
4347
|
+
});
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4350
|
+
function observe_all(context, props) {
|
|
4351
|
+
if (context.l.s) {
|
|
4352
|
+
for (const signal of context.l.s) get(signal);
|
|
4353
|
+
}
|
|
4354
|
+
props();
|
|
4355
|
+
}
|
|
4253
4356
|
let is_store_binding = false;
|
|
4254
4357
|
function capture_store_binding(fn) {
|
|
4255
4358
|
var previous_is_store_binding = is_store_binding;
|
|
@@ -5292,7 +5395,7 @@ function createClient(clientOptions) {
|
|
|
5292
5395
|
querySerializer: requestQuerySerializer,
|
|
5293
5396
|
bodySerializer = globalBodySerializer ?? defaultBodySerializer,
|
|
5294
5397
|
body,
|
|
5295
|
-
...
|
|
5398
|
+
...init2
|
|
5296
5399
|
} = fetchOptions || {};
|
|
5297
5400
|
if (localBaseUrl) {
|
|
5298
5401
|
baseUrl = removeTrailingSlash(localBaseUrl);
|
|
@@ -5315,16 +5418,16 @@ function createClient(clientOptions) {
|
|
|
5315
5418
|
const requestInit = {
|
|
5316
5419
|
redirect: "follow",
|
|
5317
5420
|
...baseOptions,
|
|
5318
|
-
...
|
|
5421
|
+
...init2,
|
|
5319
5422
|
body: serializedBody,
|
|
5320
5423
|
headers: mergeHeaders(defaultHeaders, baseHeaders, headers, params.header)
|
|
5321
5424
|
};
|
|
5322
5425
|
let id;
|
|
5323
5426
|
let options;
|
|
5324
5427
|
let request = new CustomRequest(createFinalURL(schemaPath, { baseUrl, params, querySerializer }), requestInit);
|
|
5325
|
-
for (const key in
|
|
5428
|
+
for (const key in init2) {
|
|
5326
5429
|
if (!(key in request)) {
|
|
5327
|
-
request[key] =
|
|
5430
|
+
request[key] = init2[key];
|
|
5328
5431
|
}
|
|
5329
5432
|
}
|
|
5330
5433
|
if (middlewares.length) {
|
|
@@ -5394,36 +5497,36 @@ function createClient(clientOptions) {
|
|
|
5394
5497
|
}
|
|
5395
5498
|
return {
|
|
5396
5499
|
/** Call a GET endpoint */
|
|
5397
|
-
GET(url,
|
|
5398
|
-
return coreFetch(url, { ...
|
|
5500
|
+
GET(url, init2) {
|
|
5501
|
+
return coreFetch(url, { ...init2, method: "GET" });
|
|
5399
5502
|
},
|
|
5400
5503
|
/** Call a PUT endpoint */
|
|
5401
|
-
PUT(url,
|
|
5402
|
-
return coreFetch(url, { ...
|
|
5504
|
+
PUT(url, init2) {
|
|
5505
|
+
return coreFetch(url, { ...init2, method: "PUT" });
|
|
5403
5506
|
},
|
|
5404
5507
|
/** Call a POST endpoint */
|
|
5405
|
-
POST(url,
|
|
5406
|
-
return coreFetch(url, { ...
|
|
5508
|
+
POST(url, init2) {
|
|
5509
|
+
return coreFetch(url, { ...init2, method: "POST" });
|
|
5407
5510
|
},
|
|
5408
5511
|
/** Call a DELETE endpoint */
|
|
5409
|
-
DELETE(url,
|
|
5410
|
-
return coreFetch(url, { ...
|
|
5512
|
+
DELETE(url, init2) {
|
|
5513
|
+
return coreFetch(url, { ...init2, method: "DELETE" });
|
|
5411
5514
|
},
|
|
5412
5515
|
/** Call a OPTIONS endpoint */
|
|
5413
|
-
OPTIONS(url,
|
|
5414
|
-
return coreFetch(url, { ...
|
|
5516
|
+
OPTIONS(url, init2) {
|
|
5517
|
+
return coreFetch(url, { ...init2, method: "OPTIONS" });
|
|
5415
5518
|
},
|
|
5416
5519
|
/** Call a HEAD endpoint */
|
|
5417
|
-
HEAD(url,
|
|
5418
|
-
return coreFetch(url, { ...
|
|
5520
|
+
HEAD(url, init2) {
|
|
5521
|
+
return coreFetch(url, { ...init2, method: "HEAD" });
|
|
5419
5522
|
},
|
|
5420
5523
|
/** Call a PATCH endpoint */
|
|
5421
|
-
PATCH(url,
|
|
5422
|
-
return coreFetch(url, { ...
|
|
5524
|
+
PATCH(url, init2) {
|
|
5525
|
+
return coreFetch(url, { ...init2, method: "PATCH" });
|
|
5423
5526
|
},
|
|
5424
5527
|
/** Call a TRACE endpoint */
|
|
5425
|
-
TRACE(url,
|
|
5426
|
-
return coreFetch(url, { ...
|
|
5528
|
+
TRACE(url, init2) {
|
|
5529
|
+
return coreFetch(url, { ...init2, method: "TRACE" });
|
|
5427
5530
|
},
|
|
5428
5531
|
/** Register middleware */
|
|
5429
5532
|
use(...middleware) {
|
|
@@ -11012,7 +11115,7 @@ function formatDate(isoDateString, options = {
|
|
|
11012
11115
|
class Shop {
|
|
11013
11116
|
constructor(apiUrl, shopDomain, locale, type = "angular") {
|
|
11014
11117
|
__privateAdd(this, _Shop_instances);
|
|
11015
|
-
__privateAdd(this, _data2, /* @__PURE__ */ state(proxy({ customerSalutations: [], countries: [] })));
|
|
11118
|
+
__privateAdd(this, _data2, /* @__PURE__ */ state(proxy({ customerSalutations: [], countries: [], locales: [] })));
|
|
11016
11119
|
// Holds the fetch status and timestamp for data requests, tracking whether the request is ongoing or completed and when it was completed.
|
|
11017
11120
|
__privateAdd(this, _fetchStatus, {});
|
|
11018
11121
|
__privateAdd(this, _canFetch, () => {
|
|
@@ -11212,6 +11315,9 @@ class Shop {
|
|
|
11212
11315
|
get countries() {
|
|
11213
11316
|
return this.fetchAndCache("/api/v3/countries", "countries", "countries");
|
|
11214
11317
|
}
|
|
11318
|
+
get locales() {
|
|
11319
|
+
return this.fetchAndCache("/api/v4/locales", "locales", "locales_options");
|
|
11320
|
+
}
|
|
11215
11321
|
get urls() {
|
|
11216
11322
|
return get(__privateGet(this, _data2)).urls;
|
|
11217
11323
|
}
|
|
@@ -11400,10 +11506,7 @@ var allFields = {
|
|
|
11400
11506
|
placeholder: "",
|
|
11401
11507
|
description: "",
|
|
11402
11508
|
autocomplete: "language",
|
|
11403
|
-
options: () =>
|
|
11404
|
-
{ value: 1, label: "German" },
|
|
11405
|
-
{ value: 5, label: "English" }
|
|
11406
|
-
]
|
|
11509
|
+
options: () => shop.locales.map((c) => ({ label: c.locale, value: c.id }))
|
|
11407
11510
|
},
|
|
11408
11511
|
acceptTerms: {
|
|
11409
11512
|
key: "acceptTerms",
|
|
@@ -11510,11 +11613,11 @@ const _Forms = class _Forms {
|
|
|
11510
11613
|
return __privateGet(_Forms, _requiredApiKeysMap)[formId];
|
|
11511
11614
|
}
|
|
11512
11615
|
static createField(key, required) {
|
|
11513
|
-
const
|
|
11514
|
-
if (!
|
|
11616
|
+
const init2 = _Forms.getFieldInit(key);
|
|
11617
|
+
if (!init2) {
|
|
11515
11618
|
throw new Error(`(formFields) Field "${key}" not found`);
|
|
11516
11619
|
}
|
|
11517
|
-
return createField(
|
|
11620
|
+
return createField(init2, required);
|
|
11518
11621
|
}
|
|
11519
11622
|
static getFormFields(formId) {
|
|
11520
11623
|
return formFields(formId);
|
|
@@ -12191,6 +12294,17 @@ function Cart($$anchor, $$props) {
|
|
|
12191
12294
|
}
|
|
12192
12295
|
delegate(["click"]);
|
|
12193
12296
|
customElements.define("go-cart", create_custom_element(Cart, { preview: {} }, [], [], false));
|
|
12297
|
+
enable_legacy_mode_flag();
|
|
12298
|
+
function CartCounter($$anchor, $$props) {
|
|
12299
|
+
push($$props, false);
|
|
12300
|
+
init();
|
|
12301
|
+
next();
|
|
12302
|
+
var text2 = text$1();
|
|
12303
|
+
template_effect(() => set_text(text2, cart.items.length));
|
|
12304
|
+
append($$anchor, text2);
|
|
12305
|
+
pop();
|
|
12306
|
+
}
|
|
12307
|
+
customElements.define("go-cart-counter", create_custom_element(CartCounter, {}, [], [], false));
|
|
12194
12308
|
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
|
12195
12309
|
const {
|
|
12196
12310
|
entries,
|
|
@@ -13583,7 +13697,6 @@ function ErrorsFeedback($$anchor, $$props) {
|
|
|
13583
13697
|
pop();
|
|
13584
13698
|
}
|
|
13585
13699
|
customElements.define("go-errors-feedback", create_custom_element(ErrorsFeedback, {}, [], [], false));
|
|
13586
|
-
enable_legacy_mode_flag();
|
|
13587
13700
|
var root$4 = /* @__PURE__ */ from_html(`<div class="go-form-feedback"><!></div>`);
|
|
13588
13701
|
function FormFeedback($$anchor, $$props) {
|
|
13589
13702
|
var div = root$4();
|
|
@@ -3,7 +3,7 @@ import { ShopUrls } from '../helpers/urls';
|
|
|
3
3
|
import { User } from './user.svelte.ts';
|
|
4
4
|
import { OpenApiClient } from '@gomus/api';
|
|
5
5
|
import { TicketsAndQuotasParams, TicketsCalendarParams, TicketsParams } from '@gomus/api/lib/types.ts';
|
|
6
|
-
import { CheckoutParams, CheckoutResponse, Country, Event, Exhibition, Merchandise, Museum, Salutation, ShopType, SignInParams, SignInResponse, SignUpParams, SignUpResponse, Tour } from '@gomus/types';
|
|
6
|
+
import { CheckoutParams, CheckoutResponse, Country, Event, Exhibition, LocaleOptions, Merchandise, Museum, Salutation, ShopType, SignInParams, SignInResponse, SignUpParams, SignUpResponse, Tour } from '@gomus/types';
|
|
7
7
|
export type ShopKind = 'angular' | 'jmb';
|
|
8
8
|
export declare class Shop {
|
|
9
9
|
#private;
|
|
@@ -118,6 +118,7 @@ export declare class Shop {
|
|
|
118
118
|
urls?: ShopUrls;
|
|
119
119
|
customerSalutations?: Salutation[];
|
|
120
120
|
countries?: Country[];
|
|
121
|
+
locales?: LocaleOptions;
|
|
121
122
|
};
|
|
122
123
|
ticketsCalendar(params: TicketsCalendarParams): CalendarDates;
|
|
123
124
|
ticketsAndQuotas(params: TicketsAndQuotasParams): {
|
|
@@ -373,6 +374,10 @@ export declare class Shop {
|
|
|
373
374
|
id: number;
|
|
374
375
|
name: string;
|
|
375
376
|
}[];
|
|
377
|
+
get locales(): {
|
|
378
|
+
id: number;
|
|
379
|
+
locale: string;
|
|
380
|
+
}[];
|
|
376
381
|
get urls(): {
|
|
377
382
|
account: () => string;
|
|
378
383
|
annualTickets: () => string;
|