@gomusdev/web-components 4.15.0 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist-js/components/cart/components/DonationRow.svelte.d.ts +1 -0
- package/dist-js/components/donations/components/DonationCheckbox.svelte.d.ts +1 -0
- package/dist-js/gomus-webcomponents.iife.js +316 -81
- package/dist-js/gomus-webcomponents.js +316 -81
- package/dist-js/gomus-webcomponents.min.iife.js +23 -23
- package/dist-js/gomus-webcomponents.min.js +7633 -7467
- package/dist-js/src/components/donations/components/DonationCheckbox.spec.d.ts +1 -0
- package/dist-js/src/components/ticketSelection/subcomponents/tickets/subcomponents/segment/SegmentDetails.svelte.d.ts +10 -1
- package/dist-js/src/lib/models/cart/cart.svelte.d.ts +21 -3
- package/dist-js/src/lib/models/cart/types.d.ts +11 -0
- package/dist-js/src/lib/stores/shop.svelte.d.ts +10 -1
- package/package.json +1 -1
|
@@ -6383,13 +6383,17 @@ createHTML: (html) => {
|
|
|
6383
6383
|
"quantity.remove": "Remove item",
|
|
6384
6384
|
"quantity.remove.label": "✕",
|
|
6385
6385
|
"cart.item.remove": "✕",
|
|
6386
|
-
"common.table.donation": "Donation"
|
|
6386
|
+
"common.table.donation": "Donation",
|
|
6387
|
+
"cart.donation.title": "Donation",
|
|
6388
|
+
"donations.checkbox.label": "Add a {{amount}} donation to {{campaign}}"
|
|
6387
6389
|
},
|
|
6388
6390
|
de: {
|
|
6389
6391
|
"quantity.remove": "Artikel entfernen",
|
|
6390
6392
|
"quantity.remove.label": "✕",
|
|
6391
6393
|
"cart.item.remove": "✕",
|
|
6392
|
-
"common.table.donation": "Spende"
|
|
6394
|
+
"common.table.donation": "Spende",
|
|
6395
|
+
"cart.donation.title": "Spende",
|
|
6396
|
+
"donations.checkbox.label": "{{amount}} für {{campaign}} spenden"
|
|
6393
6397
|
}
|
|
6394
6398
|
};
|
|
6395
6399
|
//#endregion
|
|
@@ -12400,9 +12404,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12400
12404
|
//#endregion
|
|
12401
12405
|
//#region src/lib/models/cart/localStorage.svelte.ts
|
|
12402
12406
|
var KEY$7 = "go-cart";
|
|
12403
|
-
var persistCart = (items, coupons) => localStorage.setItem(KEY$7, JSON.stringify({
|
|
12407
|
+
var persistCart = (items, coupons, donations) => localStorage.setItem(KEY$7, JSON.stringify({
|
|
12404
12408
|
items,
|
|
12405
12409
|
coupons,
|
|
12410
|
+
donations,
|
|
12406
12411
|
savedAt: Date.now()
|
|
12407
12412
|
}));
|
|
12408
12413
|
function generateCartItem(cartItem) {
|
|
@@ -12435,6 +12440,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12435
12440
|
function loadFromLocalStorage(cart) {
|
|
12436
12441
|
let lsItems = [];
|
|
12437
12442
|
let lsCoupons = [];
|
|
12443
|
+
let lsDonations = [];
|
|
12438
12444
|
let savedAt;
|
|
12439
12445
|
try {
|
|
12440
12446
|
const content = localStorage.getItem(KEY$7);
|
|
@@ -12443,9 +12449,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12443
12449
|
if (Array.isArray(parsed)) {
|
|
12444
12450
|
lsItems = parsed;
|
|
12445
12451
|
lsCoupons = [];
|
|
12452
|
+
lsDonations = [];
|
|
12446
12453
|
} else if (typeof parsed === "object" && parsed !== null) {
|
|
12447
12454
|
lsItems = parsed.items || [];
|
|
12448
12455
|
lsCoupons = parsed.coupons || [];
|
|
12456
|
+
lsDonations = parsed.donations || [];
|
|
12449
12457
|
savedAt = parsed.savedAt;
|
|
12450
12458
|
} else {
|
|
12451
12459
|
console.dir({
|
|
@@ -12454,10 +12462,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12454
12462
|
});
|
|
12455
12463
|
throw new Error("go-cart has invalid format");
|
|
12456
12464
|
}
|
|
12457
|
-
if (
|
|
12465
|
+
if (typeof savedAt === "number" && Date.now() - savedAt > 9e5) {
|
|
12458
12466
|
cart.clearItems();
|
|
12459
12467
|
cart.clearCoupons();
|
|
12460
|
-
|
|
12468
|
+
cart.clearDonations();
|
|
12469
|
+
persistCart([], [], []);
|
|
12461
12470
|
return [];
|
|
12462
12471
|
}
|
|
12463
12472
|
if (lsItems.length === 0) cart.clearItems();
|
|
@@ -12467,10 +12476,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12467
12476
|
code: coupon,
|
|
12468
12477
|
kind: "actionToken"
|
|
12469
12478
|
} : coupon));
|
|
12479
|
+
cart.clearDonations();
|
|
12480
|
+
lsDonations.forEach((d) => {
|
|
12481
|
+
if (typeof d?.value === "number" && typeof d?.campaign_id === "number") cart.addDonation({
|
|
12482
|
+
value: d.value,
|
|
12483
|
+
campaign_id: d.campaign_id
|
|
12484
|
+
});
|
|
12485
|
+
});
|
|
12470
12486
|
return cart.items;
|
|
12471
12487
|
} catch (e) {
|
|
12472
12488
|
console.error(e);
|
|
12473
|
-
persistCart([], []);
|
|
12489
|
+
persistCart([], [], []);
|
|
12474
12490
|
return [];
|
|
12475
12491
|
}
|
|
12476
12492
|
}
|
|
@@ -12484,18 +12500,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12484
12500
|
loadFromLocalStorage(cart);
|
|
12485
12501
|
let lastWritten = JSON.stringify({
|
|
12486
12502
|
items: cart.items || [],
|
|
12487
|
-
coupons: cart.coupons || []
|
|
12503
|
+
coupons: cart.coupons || [],
|
|
12504
|
+
donations: cart.donations || []
|
|
12488
12505
|
});
|
|
12489
|
-
persistCart(cart.items || [], cart.coupons || []);
|
|
12506
|
+
persistCart(cart.items || [], cart.coupons || [], cart.donations || []);
|
|
12490
12507
|
effect_root(() => {
|
|
12491
12508
|
user_effect(() => {
|
|
12492
12509
|
const content = JSON.stringify({
|
|
12493
12510
|
items: cart.items || [],
|
|
12494
|
-
coupons: cart.coupons || []
|
|
12511
|
+
coupons: cart.coupons || [],
|
|
12512
|
+
donations: cart.donations || []
|
|
12495
12513
|
});
|
|
12496
12514
|
if (content === lastWritten) return;
|
|
12497
12515
|
lastWritten = content;
|
|
12498
|
-
persistCart(cart.items || [], cart.coupons || []);
|
|
12516
|
+
persistCart(cart.items || [], cart.coupons || [], cart.donations || []);
|
|
12499
12517
|
});
|
|
12500
12518
|
});
|
|
12501
12519
|
}
|
|
@@ -12514,10 +12532,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12514
12532
|
function createCart(products, contingent = 20) {
|
|
12515
12533
|
const items = proxy([]);
|
|
12516
12534
|
const coupons = proxy([]);
|
|
12535
|
+
const donations = proxy([]);
|
|
12517
12536
|
let paymentModeId = /* @__PURE__ */ state(void 0);
|
|
12518
12537
|
const cart = {
|
|
12519
12538
|
items,
|
|
12520
12539
|
coupons,
|
|
12540
|
+
donations,
|
|
12521
12541
|
get paymentModeId() {
|
|
12522
12542
|
return get$2(paymentModeId);
|
|
12523
12543
|
},
|
|
@@ -12529,7 +12549,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12529
12549
|
return this.items.filter((i) => i.quantity > 0);
|
|
12530
12550
|
},
|
|
12531
12551
|
get totalPriceCents() {
|
|
12532
|
-
return Math.max(0, sum(this.items, (item) => item.total_price_cents));
|
|
12552
|
+
return Math.max(0, sum(this.items, (item) => item.total_price_cents) + this.donationCents);
|
|
12553
|
+
},
|
|
12554
|
+
get donationCents() {
|
|
12555
|
+
return sum(this.donations, (d) => d.value);
|
|
12533
12556
|
},
|
|
12534
12557
|
get totalQuantity() {
|
|
12535
12558
|
return sum(this.items, (item) => item.quantity);
|
|
@@ -12538,7 +12561,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12538
12561
|
return sum(this.coupons.filter((c) => c.kind === "valueVoucher"), (c) => c.valueCents ?? 0);
|
|
12539
12562
|
},
|
|
12540
12563
|
get amountToPayCents() {
|
|
12541
|
-
|
|
12564
|
+
const itemsTotal = sum(this.items, (item) => item.total_price_cents);
|
|
12565
|
+
return Math.max(0, itemsTotal - this.valueVoucherCents) + this.donationCents;
|
|
12542
12566
|
},
|
|
12543
12567
|
/**
|
|
12544
12568
|
* Generates a formatted string representation of the current object.
|
|
@@ -12557,7 +12581,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12557
12581
|
reference: null,
|
|
12558
12582
|
payment_mode_id: this.paymentModeId ?? shop.settings?.defaultPaymentModeId,
|
|
12559
12583
|
coupons: this.coupons.map((c) => c.code),
|
|
12560
|
-
donations:
|
|
12584
|
+
donations: this.donations.map((d) => ({
|
|
12585
|
+
value: d.value,
|
|
12586
|
+
campaign_id: d.campaign_id
|
|
12587
|
+
})),
|
|
12561
12588
|
affiliate: {},
|
|
12562
12589
|
total: this.amountToPayCents
|
|
12563
12590
|
};
|
|
@@ -12598,6 +12625,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
12598
12625
|
},
|
|
12599
12626
|
clearCoupons() {
|
|
12600
12627
|
while (this.coupons.length > 0) this.coupons.pop();
|
|
12628
|
+
},
|
|
12629
|
+
hasDonation(campaignId, value) {
|
|
12630
|
+
return this.donations.some((d) => d.campaign_id === campaignId && d.value === value);
|
|
12631
|
+
},
|
|
12632
|
+
addDonation(donation) {
|
|
12633
|
+
if (!this.hasDonation(donation.campaign_id, donation.value)) this.donations.push(donation);
|
|
12634
|
+
},
|
|
12635
|
+
removeDonation(campaignId, value) {
|
|
12636
|
+
const index = this.donations.findIndex((d) => d.campaign_id === campaignId && d.value === value);
|
|
12637
|
+
if (index > -1) this.donations.splice(index, 1);
|
|
12638
|
+
},
|
|
12639
|
+
clearDonations() {
|
|
12640
|
+
while (this.donations.length > 0) this.donations.pop();
|
|
12601
12641
|
}
|
|
12602
12642
|
};
|
|
12603
12643
|
if (products) products.forEach((p) => cart.addItem(createCartItem(p)));
|
|
@@ -14319,8 +14359,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14319
14359
|
var getPersonalizationDetails = createGetDetails(KEY$5);
|
|
14320
14360
|
//#endregion
|
|
14321
14361
|
//#region src/components/annualTicketPersonalization/components/AnnualTicketPersonalization.svelte
|
|
14322
|
-
var root$
|
|
14323
|
-
var root_1$
|
|
14362
|
+
var root$63 = /* @__PURE__ */ from_html(`<li><a> </a></li>`);
|
|
14363
|
+
var root_1$23 = /* @__PURE__ */ from_html(`<ul class="go-annual-ticket"><li class="go-annual-ticket-title"> </li> <li class="go-annual-ticket-personalization-count"> </li> <!></ul>`);
|
|
14324
14364
|
function AnnualTicketPersonalization($$anchor, $$props) {
|
|
14325
14365
|
push($$props, true);
|
|
14326
14366
|
let token = prop($$props, "token", 7);
|
|
@@ -14345,7 +14385,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14345
14385
|
var consequent_1 = ($$anchor) => {
|
|
14346
14386
|
var fragment_1 = comment();
|
|
14347
14387
|
each(first_child(fragment_1), 17, () => get$2(order).ticket_sales, (ticketSale) => ticketSale.id, ($$anchor, ticketSale) => {
|
|
14348
|
-
var ul = root_1$
|
|
14388
|
+
var ul = root_1$23();
|
|
14349
14389
|
var li = child(ul);
|
|
14350
14390
|
var text = child(li, true);
|
|
14351
14391
|
reset(li);
|
|
@@ -14354,7 +14394,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14354
14394
|
reset(li_1);
|
|
14355
14395
|
var node_2 = sibling(li_1, 2);
|
|
14356
14396
|
var consequent = ($$anchor) => {
|
|
14357
|
-
var li_2 = root$
|
|
14397
|
+
var li_2 = root$63();
|
|
14358
14398
|
var a = child(li_2);
|
|
14359
14399
|
var text_2 = child(a, true);
|
|
14360
14400
|
reset(a);
|
|
@@ -15041,7 +15081,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15041
15081
|
}
|
|
15042
15082
|
//#endregion
|
|
15043
15083
|
//#region src/components/forms/ui/generic/Form.svelte
|
|
15044
|
-
var root$
|
|
15084
|
+
var root$62 = /* @__PURE__ */ from_html(`<go-all-fields></go-all-fields> <go-form-feedback><go-errors-feedback></go-errors-feedback> <go-success-feedback></go-success-feedback></go-form-feedback> <go-submit> </go-submit>`, 3);
|
|
15045
15085
|
function Form($$anchor, $$props) {
|
|
15046
15086
|
push($$props, true);
|
|
15047
15087
|
let formId = prop($$props, "formId", 7), custom = prop($$props, "custom", 7);
|
|
@@ -15087,7 +15127,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15087
15127
|
var fragment = comment();
|
|
15088
15128
|
var node = first_child(fragment);
|
|
15089
15129
|
var consequent = ($$anchor) => {
|
|
15090
|
-
var fragment_1 = root$
|
|
15130
|
+
var fragment_1 = root$62();
|
|
15091
15131
|
var go_submit = sibling(sibling(first_child(fragment_1), 2), 2);
|
|
15092
15132
|
var text = child(go_submit, true);
|
|
15093
15133
|
reset(go_submit);
|
|
@@ -15114,7 +15154,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15114
15154
|
}, [], ["details"]));
|
|
15115
15155
|
//#endregion
|
|
15116
15156
|
//#region src/components/auth/passwordReset/PasswordReset.svelte
|
|
15117
|
-
var root$
|
|
15157
|
+
var root$61 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
|
|
15118
15158
|
function PasswordReset($$anchor, $$props) {
|
|
15119
15159
|
push($$props, true);
|
|
15120
15160
|
let custom = prop($$props, "custom", 7, false), redirectUrl = prop($$props, "redirectUrl", 7, "");
|
|
@@ -15158,7 +15198,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15158
15198
|
flushSync();
|
|
15159
15199
|
}
|
|
15160
15200
|
};
|
|
15161
|
-
var go_form = root$
|
|
15201
|
+
var go_form = root$61();
|
|
15162
15202
|
set_custom_element_data(go_form, "formId", "passwordReset");
|
|
15163
15203
|
template_effect(() => set_custom_element_data(go_form, "custom", custom()));
|
|
15164
15204
|
event("submit", go_form, passwordReset);
|
|
@@ -15174,7 +15214,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15174
15214
|
}, [], []));
|
|
15175
15215
|
//#endregion
|
|
15176
15216
|
//#region src/components/auth/setPassword/SetPassword.svelte
|
|
15177
|
-
var root$
|
|
15217
|
+
var root$60 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
|
|
15178
15218
|
function SetPassword($$anchor, $$props) {
|
|
15179
15219
|
push($$props, true);
|
|
15180
15220
|
let accessToken = prop($$props, "accessToken", 7, ""), client = prop($$props, "client", 7, ""), uid = prop($$props, "uid", 7, "");
|
|
@@ -15228,7 +15268,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15228
15268
|
flushSync();
|
|
15229
15269
|
}
|
|
15230
15270
|
};
|
|
15231
|
-
var go_form = root$
|
|
15271
|
+
var go_form = root$60();
|
|
15232
15272
|
set_custom_element_data(go_form, "formId", "setPassword");
|
|
15233
15273
|
event("submit", go_form, setNewPassword);
|
|
15234
15274
|
append($$anchor, go_form);
|
|
@@ -15388,6 +15428,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15388
15428
|
...coupon,
|
|
15389
15429
|
applied: coupon.kind !== "actionToken" || echoed.has(coupon.code)
|
|
15390
15430
|
}));
|
|
15431
|
+
baseCart.donations.forEach((donation) => displayCart.addDonation(donation));
|
|
15391
15432
|
apiItems.forEach((apiItem) => {
|
|
15392
15433
|
const attrs = apiItem.attributes;
|
|
15393
15434
|
const ref = attrs.uuid;
|
|
@@ -15480,7 +15521,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15480
15521
|
var getCartDetails = createGetDetails(KEY$3);
|
|
15481
15522
|
//#endregion
|
|
15482
15523
|
//#region src/components/cart/components/itemTitles/Coupon.svelte
|
|
15483
|
-
var root$
|
|
15524
|
+
var root$59 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span>`);
|
|
15484
15525
|
function Coupon$1($$anchor, $$props) {
|
|
15485
15526
|
push($$props, true);
|
|
15486
15527
|
let cartItem = prop($$props, "cartItem", 7);
|
|
@@ -15493,7 +15534,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15493
15534
|
flushSync();
|
|
15494
15535
|
}
|
|
15495
15536
|
};
|
|
15496
|
-
var span = root$
|
|
15537
|
+
var span = root$59();
|
|
15497
15538
|
var text = child(span, true);
|
|
15498
15539
|
reset(span);
|
|
15499
15540
|
template_effect(() => set_text(text, cartItem().product.title));
|
|
@@ -15503,8 +15544,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15503
15544
|
create_custom_element(Coupon$1, { cartItem: {} }, [], [], { mode: "open" });
|
|
15504
15545
|
//#endregion
|
|
15505
15546
|
//#region src/components/cart/components/itemTitles/Event.svelte
|
|
15506
|
-
var root$
|
|
15507
|
-
var root_1$
|
|
15547
|
+
var root$58 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span><span class="go-cart-item-time" data-testid="cart-item-time"> </span>`, 1);
|
|
15548
|
+
var root_1$22 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"><span class="go-cart-item-title-event-title"> </span><span class="go-cart-item-title-ticket-title"> </span></span><!>`, 1);
|
|
15508
15549
|
function Event$2($$anchor, $$props) {
|
|
15509
15550
|
push($$props, true);
|
|
15510
15551
|
let cartItem = prop($$props, "cartItem", 7);
|
|
@@ -15519,7 +15560,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15519
15560
|
flushSync();
|
|
15520
15561
|
}
|
|
15521
15562
|
};
|
|
15522
|
-
var fragment = root_1$
|
|
15563
|
+
var fragment = root_1$22();
|
|
15523
15564
|
var span = first_child(fragment);
|
|
15524
15565
|
var span_1 = child(span);
|
|
15525
15566
|
var text = child(span_1, true);
|
|
@@ -15530,7 +15571,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15530
15571
|
reset(span);
|
|
15531
15572
|
var node = sibling(span);
|
|
15532
15573
|
var consequent = ($$anchor) => {
|
|
15533
|
-
var fragment_1 = root$
|
|
15574
|
+
var fragment_1 = root$58();
|
|
15534
15575
|
var span_3 = first_child(fragment_1);
|
|
15535
15576
|
var text_2 = child(span_3, true);
|
|
15536
15577
|
reset(span_3);
|
|
@@ -15556,9 +15597,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15556
15597
|
create_custom_element(Event$2, { cartItem: {} }, [], [], { mode: "open" });
|
|
15557
15598
|
//#endregion
|
|
15558
15599
|
//#region src/components/cart/components/itemTitles/Ticket.svelte
|
|
15559
|
-
var root$
|
|
15560
|
-
var root_1$
|
|
15561
|
-
var root_2$
|
|
15600
|
+
var root$57 = /* @__PURE__ */ from_html(`<span class="go-cart-item-subtitle" data-testid="cart-item-subtitle"> </span>`);
|
|
15601
|
+
var root_1$21 = /* @__PURE__ */ from_html(`<span class="go-cart-item-time" data-testid="cart-item-time"> </span>`);
|
|
15602
|
+
var root_2$15 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>`, 1);
|
|
15562
15603
|
var root_3$10 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span> <!> <!>`, 1);
|
|
15563
15604
|
function Ticket($$anchor, $$props) {
|
|
15564
15605
|
push($$props, true);
|
|
@@ -15578,7 +15619,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15578
15619
|
reset(span);
|
|
15579
15620
|
var node = sibling(span, 2);
|
|
15580
15621
|
var consequent = ($$anchor) => {
|
|
15581
|
-
var span_1 = root$
|
|
15622
|
+
var span_1 = root$57();
|
|
15582
15623
|
var text_1 = child(span_1, true);
|
|
15583
15624
|
reset(span_1);
|
|
15584
15625
|
template_effect(() => set_text(text_1, cartItem().product.sub_title));
|
|
@@ -15590,13 +15631,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15590
15631
|
});
|
|
15591
15632
|
var node_1 = sibling(node, 2);
|
|
15592
15633
|
var consequent_2 = ($$anchor) => {
|
|
15593
|
-
var fragment_1 = root_2$
|
|
15634
|
+
var fragment_1 = root_2$15();
|
|
15594
15635
|
var span_2 = first_child(fragment_1);
|
|
15595
15636
|
var text_2 = child(span_2, true);
|
|
15596
15637
|
reset(span_2);
|
|
15597
15638
|
var node_2 = sibling(span_2, 2);
|
|
15598
15639
|
var consequent_1 = ($$anchor) => {
|
|
15599
|
-
var span_3 = root_1$
|
|
15640
|
+
var span_3 = root_1$21();
|
|
15600
15641
|
var text_3 = child(span_3, true);
|
|
15601
15642
|
reset(span_3);
|
|
15602
15643
|
template_effect(($0) => set_text(text_3, $0), [() => shop.formatTime(cartItem().time)]);
|
|
@@ -15618,9 +15659,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15618
15659
|
create_custom_element(Ticket, { cartItem: {} }, [], [], { mode: "open" });
|
|
15619
15660
|
//#endregion
|
|
15620
15661
|
//#region src/components/cart/components/itemTitles/Tour.svelte
|
|
15621
|
-
var root$
|
|
15622
|
-
var root_1$
|
|
15623
|
-
var root_2$
|
|
15662
|
+
var root$56 = /* @__PURE__ */ from_html(`<span class="go-cart-item-time" data-testid="cart-item-time"> </span>`);
|
|
15663
|
+
var root_1$20 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>`, 1);
|
|
15664
|
+
var root_2$14 = /* @__PURE__ */ from_html(`<span class="go-cart-item-custom" data-testid="cart-item-custom"> </span>`);
|
|
15624
15665
|
var root_3$9 = /* @__PURE__ */ from_html(`<span class="go-cart-item-title" data-testid="cart-item-title"> </span> <span class="go-cart-item-participants" data-testid="cart-item-participants"> </span> <!> <!>`, 1);
|
|
15625
15666
|
function Tour$1($$anchor, $$props) {
|
|
15626
15667
|
push($$props, true);
|
|
@@ -15660,13 +15701,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15660
15701
|
reset(span_1);
|
|
15661
15702
|
var node = sibling(span_1, 2);
|
|
15662
15703
|
var consequent_1 = ($$anchor) => {
|
|
15663
|
-
var fragment_1 = root_1$
|
|
15704
|
+
var fragment_1 = root_1$20();
|
|
15664
15705
|
var span_2 = first_child(fragment_1);
|
|
15665
15706
|
var text_2 = child(span_2, true);
|
|
15666
15707
|
reset(span_2);
|
|
15667
15708
|
var node_1 = sibling(span_2, 2);
|
|
15668
15709
|
var consequent = ($$anchor) => {
|
|
15669
|
-
var span_3 = root$
|
|
15710
|
+
var span_3 = root$56();
|
|
15670
15711
|
var text_3 = child(span_3, true);
|
|
15671
15712
|
reset(span_3);
|
|
15672
15713
|
template_effect(() => set_text(text_3, get$2(slot).time));
|
|
@@ -15685,7 +15726,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15685
15726
|
var $$array = /* @__PURE__ */ user_derived(() => to_array(get$2($$item), 2));
|
|
15686
15727
|
let key = () => get$2($$array)[0];
|
|
15687
15728
|
let value = () => get$2($$array)[1];
|
|
15688
|
-
var span_4 = root_2$
|
|
15729
|
+
var span_4 = root_2$14();
|
|
15689
15730
|
var text_4 = child(span_4);
|
|
15690
15731
|
reset(span_4);
|
|
15691
15732
|
template_effect(($0) => set_text(text_4, `${key() ?? ""}: ${$0 ?? ""}`), [() => displayCustom(value())]);
|
|
@@ -15733,7 +15774,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15733
15774
|
}
|
|
15734
15775
|
//#endregion
|
|
15735
15776
|
//#region src/components/shared/quantityStepper/QuantityStepper.svelte
|
|
15736
|
-
var root$
|
|
15777
|
+
var root$55 = /* @__PURE__ */ from_html(`<div class="go-quantity-stepper" role="group"><button type="button" tabindex="-1"><span aria-hidden="true"> </span></button> <input class="go-quantity-stepper-value" type="text" role="spinbutton" inputmode="numeric" autocomplete="off"/> <button type="button" class="go-quantity-stepper-button go-quantity-stepper-increment" tabindex="-1"><span aria-hidden="true">+</span></button></div>`);
|
|
15737
15778
|
function QuantityStepper($$anchor, $$props) {
|
|
15738
15779
|
const inputId = props_id();
|
|
15739
15780
|
push($$props, true);
|
|
@@ -15887,7 +15928,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15887
15928
|
flushSync();
|
|
15888
15929
|
}
|
|
15889
15930
|
};
|
|
15890
|
-
var div = root$
|
|
15931
|
+
var div = root$55();
|
|
15891
15932
|
var button = child(div);
|
|
15892
15933
|
let classes;
|
|
15893
15934
|
var span = child(button);
|
|
@@ -15967,8 +16008,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15967
16008
|
}
|
|
15968
16009
|
//#endregion
|
|
15969
16010
|
//#region src/components/shared/quantityStepper/QuantityControl.svelte
|
|
15970
|
-
var root$
|
|
15971
|
-
var root_1$
|
|
16011
|
+
var root$54 = /* @__PURE__ */ from_html(`<option> </option>`);
|
|
16012
|
+
var root_1$19 = /* @__PURE__ */ from_html(`<select class="go-quantity-select"></select>`);
|
|
15972
16013
|
function QuantityControl($$anchor, $$props) {
|
|
15973
16014
|
push($$props, true);
|
|
15974
16015
|
/** Current committed quantity. */
|
|
@@ -16095,9 +16136,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16095
16136
|
}
|
|
16096
16137
|
};
|
|
16097
16138
|
var alternate = ($$anchor) => {
|
|
16098
|
-
var select = root_1$
|
|
16139
|
+
var select = root_1$19();
|
|
16099
16140
|
each(select, 21, () => generateQuantityOptions(min(), max(), { floor: deselectable() ? floor() : min() }), (q) => q.value, ($$anchor, q) => {
|
|
16100
|
-
var option = root$
|
|
16141
|
+
var option = root$54();
|
|
16101
16142
|
var text = child(option, true);
|
|
16102
16143
|
reset(option);
|
|
16103
16144
|
var option_value = {};
|
|
@@ -17982,9 +18023,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17982
18023
|
var purify = createDOMPurify();
|
|
17983
18024
|
//#endregion
|
|
17984
18025
|
//#region src/components/cart/components/SubRow.svelte
|
|
17985
|
-
var root$
|
|
17986
|
-
var root_1$
|
|
17987
|
-
var root_2$
|
|
18026
|
+
var root$53 = /* @__PURE__ */ from_html(`<span class="go-sub-ticket-description"></span>`);
|
|
18027
|
+
var root_1$18 = /* @__PURE__ */ from_html(`<span class="go-sub-ticket-quantity"> </span>`);
|
|
18028
|
+
var root_2$13 = /* @__PURE__ */ from_html(`<li><span class="go-sub-ticket-title"> </span> <!> <!></li>`);
|
|
17988
18029
|
function SubRow($$anchor, $$props) {
|
|
17989
18030
|
push($$props, true);
|
|
17990
18031
|
/** Capacity-aware ceiling from CapacityManager.subTicketMaxes; the combination max when absent. */
|
|
@@ -18027,13 +18068,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18027
18068
|
flushSync();
|
|
18028
18069
|
}
|
|
18029
18070
|
};
|
|
18030
|
-
var li = root_2$
|
|
18071
|
+
var li = root_2$13();
|
|
18031
18072
|
var span = child(li);
|
|
18032
18073
|
var text = child(span, true);
|
|
18033
18074
|
reset(span);
|
|
18034
18075
|
var node = sibling(span, 2);
|
|
18035
18076
|
var consequent = ($$anchor) => {
|
|
18036
|
-
var span_1 = root$
|
|
18077
|
+
var span_1 = root$53();
|
|
18037
18078
|
html$2(span_1, () => purify.sanitize(sub().description), true);
|
|
18038
18079
|
reset(span_1);
|
|
18039
18080
|
append($$anchor, span_1);
|
|
@@ -18043,7 +18084,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18043
18084
|
});
|
|
18044
18085
|
var node_1 = sibling(node, 2);
|
|
18045
18086
|
var consequent_1 = ($$anchor) => {
|
|
18046
|
-
var span_2 = root_1$
|
|
18087
|
+
var span_2 = root_1$18();
|
|
18047
18088
|
var text_1 = child(span_2, true);
|
|
18048
18089
|
reset(span_2);
|
|
18049
18090
|
template_effect(() => {
|
|
@@ -18120,9 +18161,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18120
18161
|
}
|
|
18121
18162
|
//#endregion
|
|
18122
18163
|
//#region src/components/cart/components/Item.svelte
|
|
18123
|
-
var root$
|
|
18124
|
-
var root_1$
|
|
18125
|
-
var root_2$
|
|
18164
|
+
var root$52 = /* @__PURE__ */ from_html(`<s class="go-cart-item-price-original"> </s> <span class="go-cart-item-price-discounted"> </span>`, 1);
|
|
18165
|
+
var root_1$17 = /* @__PURE__ */ from_html(`<span class="go-cart-item-price-discounted"> </span>`);
|
|
18166
|
+
var root_2$12 = /* @__PURE__ */ from_html(`<span data-testid="cart-item-participant-count"> </span>`);
|
|
18126
18167
|
var root_3$8 = /* @__PURE__ */ from_html(`<span data-testid="cart-item-voucher-quantity"> </span>`);
|
|
18127
18168
|
var root_4$4 = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
18128
18169
|
var root_5$3 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove"> </button></li>`);
|
|
@@ -18228,7 +18269,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18228
18269
|
var li_1 = sibling(li, 2);
|
|
18229
18270
|
var node_2 = child(li_1);
|
|
18230
18271
|
var consequent_4 = ($$anchor) => {
|
|
18231
|
-
var fragment_6 = root$
|
|
18272
|
+
var fragment_6 = root$52();
|
|
18232
18273
|
var s = first_child(fragment_6);
|
|
18233
18274
|
var text = child(s, true);
|
|
18234
18275
|
reset(s);
|
|
@@ -18242,7 +18283,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18242
18283
|
append($$anchor, fragment_6);
|
|
18243
18284
|
};
|
|
18244
18285
|
var alternate = ($$anchor) => {
|
|
18245
|
-
var span_1 = root_1$
|
|
18286
|
+
var span_1 = root_1$17();
|
|
18246
18287
|
var text_2 = child(span_1, true);
|
|
18247
18288
|
reset(span_1);
|
|
18248
18289
|
template_effect(($0) => set_text(text_2, $0), [() => formatCurrency(displayItem().final_price_cents)]);
|
|
@@ -18256,7 +18297,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18256
18297
|
var li_2 = sibling(li_1, 2);
|
|
18257
18298
|
var node_3 = child(li_2);
|
|
18258
18299
|
var consequent_5 = ($$anchor) => {
|
|
18259
|
-
var span_2 = root_2$
|
|
18300
|
+
var span_2 = root_2$12();
|
|
18260
18301
|
var text_3 = child(span_2, true);
|
|
18261
18302
|
reset(span_2);
|
|
18262
18303
|
template_effect(() => set_text(text_3, displayItem().product.participants));
|
|
@@ -18374,10 +18415,78 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18374
18415
|
preview: {}
|
|
18375
18416
|
}, [], [], { mode: "open" });
|
|
18376
18417
|
//#endregion
|
|
18418
|
+
//#region src/components/cart/components/DonationRow.svelte
|
|
18419
|
+
var root$51 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove"> </button></li>`);
|
|
18420
|
+
var root_1$16 = /* @__PURE__ */ from_html(`<article class="go-cart-donation" data-testid="cart-donation"><ul><li class="go-cart-item-title-container"><span class="go-cart-donation-title"> </span></li> <li class="go-cart-item-price"></li> <li class="go-cart-item-count"></li> <!> <li class="go-cart-item-sum"> </li></ul></article>`);
|
|
18421
|
+
function DonationRow($$anchor, $$props) {
|
|
18422
|
+
push($$props, true);
|
|
18423
|
+
let donation = prop($$props, "donation", 7), preview = prop($$props, "preview", 7);
|
|
18424
|
+
const campaign = /* @__PURE__ */ user_derived(() => shop.donations?.campaigns?.find((c) => c.id === donation().campaign_id));
|
|
18425
|
+
function remove() {
|
|
18426
|
+
shop.cart?.removeDonation(donation().campaign_id, donation().value);
|
|
18427
|
+
}
|
|
18428
|
+
var $$exports = {
|
|
18429
|
+
get donation() {
|
|
18430
|
+
return donation();
|
|
18431
|
+
},
|
|
18432
|
+
set donation($$value) {
|
|
18433
|
+
donation($$value);
|
|
18434
|
+
flushSync();
|
|
18435
|
+
},
|
|
18436
|
+
get preview() {
|
|
18437
|
+
return preview();
|
|
18438
|
+
},
|
|
18439
|
+
set preview($$value) {
|
|
18440
|
+
preview($$value);
|
|
18441
|
+
flushSync();
|
|
18442
|
+
}
|
|
18443
|
+
};
|
|
18444
|
+
var article = root_1$16();
|
|
18445
|
+
var ul = child(article);
|
|
18446
|
+
var li = child(ul);
|
|
18447
|
+
var span = child(li);
|
|
18448
|
+
var text = child(span, true);
|
|
18449
|
+
reset(span);
|
|
18450
|
+
reset(li);
|
|
18451
|
+
var node = sibling(li, 6);
|
|
18452
|
+
var consequent = ($$anchor) => {
|
|
18453
|
+
var li_1 = root$51();
|
|
18454
|
+
var button = child(li_1);
|
|
18455
|
+
var text_1 = child(button, true);
|
|
18456
|
+
reset(button);
|
|
18457
|
+
reset(li_1);
|
|
18458
|
+
template_effect(($0, $1) => {
|
|
18459
|
+
set_attribute(button, "aria-label", $0);
|
|
18460
|
+
set_text(text_1, $1);
|
|
18461
|
+
}, [() => shop.t("cart.item.aria.removeItem"), () => shop.t("cart.item.remove")]);
|
|
18462
|
+
delegated("click", button, remove);
|
|
18463
|
+
append($$anchor, li_1);
|
|
18464
|
+
};
|
|
18465
|
+
if_block(node, ($$render) => {
|
|
18466
|
+
if (!preview()) $$render(consequent);
|
|
18467
|
+
});
|
|
18468
|
+
var li_2 = sibling(node, 2);
|
|
18469
|
+
var text_2 = child(li_2, true);
|
|
18470
|
+
reset(li_2);
|
|
18471
|
+
reset(ul);
|
|
18472
|
+
reset(article);
|
|
18473
|
+
template_effect(($0, $1) => {
|
|
18474
|
+
set_text(text, $0);
|
|
18475
|
+
set_text(text_2, $1);
|
|
18476
|
+
}, [() => get$2(campaign)?.name ?? shop.t("cart.donation.title"), () => formatCurrency(donation().value)]);
|
|
18477
|
+
append($$anchor, article);
|
|
18478
|
+
return pop($$exports);
|
|
18479
|
+
}
|
|
18480
|
+
delegate(["click"]);
|
|
18481
|
+
create_custom_element(DonationRow, {
|
|
18482
|
+
donation: {},
|
|
18483
|
+
preview: {}
|
|
18484
|
+
}, [], [], { mode: "open" });
|
|
18485
|
+
//#endregion
|
|
18377
18486
|
//#region src/components/cart/components/CartItems.svelte
|
|
18378
|
-
var root$
|
|
18379
|
-
var root_1$
|
|
18380
|
-
var root_2$
|
|
18487
|
+
var root$50 = /* @__PURE__ */ from_html(`<li class="go-cart-header-remove"></li>`);
|
|
18488
|
+
var root_1$15 = /* @__PURE__ */ from_html(`<li class="go-cart-item"><!></li>`);
|
|
18489
|
+
var root_2$11 = /* @__PURE__ */ from_html(`<ol data-testid="cart-items"><li class="go-cart-header"><ul><li class="go-cart-header-title"> </li> <li class="go-cart-header-price"> </li> <li class="go-cart-header-count"> </li> <!> <li class="go-cart-header-sum"> </li></ul></li> <!> <!></ol>`);
|
|
18381
18490
|
function CartItems($$anchor, $$props) {
|
|
18382
18491
|
push($$props, true);
|
|
18383
18492
|
const _details = getCartDetails($$props.$$host);
|
|
@@ -18385,7 +18494,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18385
18494
|
var fragment = comment();
|
|
18386
18495
|
var node = first_child(fragment);
|
|
18387
18496
|
var consequent_1 = ($$anchor) => {
|
|
18388
|
-
var ol = root_2$
|
|
18497
|
+
var ol = root_2$11();
|
|
18389
18498
|
var li = child(ol);
|
|
18390
18499
|
var ul = child(li);
|
|
18391
18500
|
var li_1 = child(ul);
|
|
@@ -18399,7 +18508,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18399
18508
|
reset(li_3);
|
|
18400
18509
|
var node_1 = sibling(li_3, 2);
|
|
18401
18510
|
var consequent = ($$anchor) => {
|
|
18402
|
-
append($$anchor, root$
|
|
18511
|
+
append($$anchor, root$50());
|
|
18403
18512
|
};
|
|
18404
18513
|
if_block(node_1, ($$render) => {
|
|
18405
18514
|
if (!get$2(details).preview) $$render(consequent);
|
|
@@ -18409,8 +18518,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18409
18518
|
reset(li_5);
|
|
18410
18519
|
reset(ul);
|
|
18411
18520
|
reset(li);
|
|
18412
|
-
|
|
18413
|
-
|
|
18521
|
+
var node_2 = sibling(li, 2);
|
|
18522
|
+
each(node_2, 17, () => get$2(details).displayCart.items, (item) => item.uuid, ($$anchor, item) => {
|
|
18523
|
+
var li_6 = root_1$15();
|
|
18414
18524
|
Item$1(child(li_6), {
|
|
18415
18525
|
get displayItem() {
|
|
18416
18526
|
return get$2(item);
|
|
@@ -18425,6 +18535,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18425
18535
|
reset(li_6);
|
|
18426
18536
|
append($$anchor, li_6);
|
|
18427
18537
|
});
|
|
18538
|
+
each(sibling(node_2, 2), 17, () => get$2(details).displayCart.donations, (donation) => donation.campaign_id + "-" + donation.value, ($$anchor, donation) => {
|
|
18539
|
+
var li_7 = root_1$15();
|
|
18540
|
+
DonationRow(child(li_7), {
|
|
18541
|
+
get donation() {
|
|
18542
|
+
return get$2(donation);
|
|
18543
|
+
},
|
|
18544
|
+
get preview() {
|
|
18545
|
+
return get$2(details).preview;
|
|
18546
|
+
}
|
|
18547
|
+
});
|
|
18548
|
+
reset(li_7);
|
|
18549
|
+
append($$anchor, li_7);
|
|
18550
|
+
});
|
|
18428
18551
|
reset(ol);
|
|
18429
18552
|
template_effect(($0, $1, $2, $3) => {
|
|
18430
18553
|
set_text(text, $0);
|
|
@@ -18440,7 +18563,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18440
18563
|
append($$anchor, ol);
|
|
18441
18564
|
};
|
|
18442
18565
|
if_block(node, ($$render) => {
|
|
18443
|
-
if (get$2(details) && get$2(details).displayCart && get$2(details).displayCart.items.length) $$render(consequent_1);
|
|
18566
|
+
if (get$2(details) && get$2(details).displayCart && (get$2(details).displayCart.items.length || get$2(details).displayCart.donations.length)) $$render(consequent_1);
|
|
18444
18567
|
});
|
|
18445
18568
|
append($$anchor, fragment);
|
|
18446
18569
|
pop();
|
|
@@ -18448,9 +18571,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18448
18571
|
customElements.define("go-cart-items", create_custom_element(CartItems, {}, [], []));
|
|
18449
18572
|
//#endregion
|
|
18450
18573
|
//#region src/components/cart/components/CartCoupons.svelte
|
|
18451
|
-
var root$
|
|
18452
|
-
var root_1$
|
|
18453
|
-
var root_2$
|
|
18574
|
+
var root$49 = /* @__PURE__ */ from_html(`<li class="go-cart-coupon-remove-cell"><button class="go-cart-remove go-cart-coupon-remove">⨉</button></li>`);
|
|
18575
|
+
var root_1$14 = /* @__PURE__ */ from_html(`<li><article class="go-cart-coupon-content"><ul><li class="go-cart-coupon-code"> </li> <!></ul></article></li>`);
|
|
18576
|
+
var root_2$10 = /* @__PURE__ */ from_html(`<ol data-testid="cart-coupons"></ol>`);
|
|
18454
18577
|
function CartCoupons($$anchor, $$props) {
|
|
18455
18578
|
push($$props, true);
|
|
18456
18579
|
const _details = getCartDetails($$props.$$host);
|
|
@@ -18458,9 +18581,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18458
18581
|
var fragment = comment();
|
|
18459
18582
|
var node = first_child(fragment);
|
|
18460
18583
|
var consequent_1 = ($$anchor) => {
|
|
18461
|
-
var ol = root_2$
|
|
18584
|
+
var ol = root_2$10();
|
|
18462
18585
|
each(ol, 21, () => get$2(details).displayCart.coupons, (coupon) => coupon.code, ($$anchor, coupon) => {
|
|
18463
|
-
var li = root_1$
|
|
18586
|
+
var li = root_1$14();
|
|
18464
18587
|
let classes;
|
|
18465
18588
|
var article = child(li);
|
|
18466
18589
|
var ul = child(article);
|
|
@@ -18469,7 +18592,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18469
18592
|
reset(li_1);
|
|
18470
18593
|
var node_1 = sibling(li_1, 2);
|
|
18471
18594
|
var consequent = ($$anchor) => {
|
|
18472
|
-
var li_2 = root$
|
|
18595
|
+
var li_2 = root$49();
|
|
18473
18596
|
var button = child(li_2);
|
|
18474
18597
|
reset(li_2);
|
|
18475
18598
|
template_effect(($0) => set_attribute(button, "aria-label", $0), [() => shop.t("cart.coupons.remove")]);
|
|
@@ -18501,7 +18624,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18501
18624
|
customElements.define("go-cart-coupons", create_custom_element(CartCoupons, {}, [], []));
|
|
18502
18625
|
//#endregion
|
|
18503
18626
|
//#region src/components/cart/components/CartTotalAmount.svelte
|
|
18504
|
-
var root$
|
|
18627
|
+
var root$48 = /* @__PURE__ */ from_html(`<span class="go-cart-total-amount" data-testid="cart-total-amount"> </span>`);
|
|
18505
18628
|
function CartTotalAmount($$anchor, $$props) {
|
|
18506
18629
|
push($$props, true);
|
|
18507
18630
|
const _details = getCartDetails($$props.$$host);
|
|
@@ -18509,7 +18632,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18509
18632
|
var fragment = comment();
|
|
18510
18633
|
var node = first_child(fragment);
|
|
18511
18634
|
var consequent = ($$anchor) => {
|
|
18512
|
-
var span = root$
|
|
18635
|
+
var span = root$48();
|
|
18513
18636
|
var text = child(span, true);
|
|
18514
18637
|
reset(span);
|
|
18515
18638
|
template_effect(($0) => set_text(text, $0), [() => formatCurrency(get$2(details).totalPriceCents)]);
|
|
@@ -18537,6 +18660,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18537
18660
|
shop.cart.items.map((i) => i.uuid + ":" + i.quantity + ":" + i.time);
|
|
18538
18661
|
shop.cart.coupons.map((c) => c.code).join("|");
|
|
18539
18662
|
shop.cart.items.forEach((i) => i.mantle && Object.values(i.mantle.composition));
|
|
18663
|
+
shop.cart.donations.map((d) => d.campaign_id + ":" + d.value).join("|");
|
|
18540
18664
|
untrack(() => details.calculateDisplayCart());
|
|
18541
18665
|
});
|
|
18542
18666
|
async function flushCoupons() {
|
|
@@ -18578,7 +18702,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18578
18702
|
} }, [], []));
|
|
18579
18703
|
//#endregion
|
|
18580
18704
|
//#region src/components/cart/components/CartSubtotalAmount.svelte
|
|
18581
|
-
var root$
|
|
18705
|
+
var root$47 = /* @__PURE__ */ from_html(`<span class="go-cart-subtotal-amount" data-testid="cart-subtotal-amount"> </span>`);
|
|
18582
18706
|
function CartSubtotalAmount($$anchor, $$props) {
|
|
18583
18707
|
push($$props, true);
|
|
18584
18708
|
const _details = getCartDetails($$props.$$host);
|
|
@@ -18586,7 +18710,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18586
18710
|
var fragment = comment();
|
|
18587
18711
|
var node = first_child(fragment);
|
|
18588
18712
|
var consequent = ($$anchor) => {
|
|
18589
|
-
var span = root$
|
|
18713
|
+
var span = root$47();
|
|
18590
18714
|
var text = child(span, true);
|
|
18591
18715
|
reset(span);
|
|
18592
18716
|
template_effect(($0) => set_text(text, $0), [() => formatCurrency(get$2(details).subtotalPriceCents)]);
|
|
@@ -18601,7 +18725,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18601
18725
|
customElements.define("go-cart-subtotal-amount", create_custom_element(CartSubtotalAmount, {}, [], []));
|
|
18602
18726
|
//#endregion
|
|
18603
18727
|
//#region src/components/cart/components/CartDiscountedAmount.svelte
|
|
18604
|
-
var root$
|
|
18728
|
+
var root$46 = /* @__PURE__ */ from_html(`<span class="go-cart-discounted-amount" data-testid="cart-discounted-amount"><span class="go-cart-discounted-amount-sign">−</span> </span>`);
|
|
18605
18729
|
function CartDiscountedAmount($$anchor, $$props) {
|
|
18606
18730
|
push($$props, true);
|
|
18607
18731
|
const _details = getCartDetails($$props.$$host);
|
|
@@ -18609,7 +18733,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18609
18733
|
var fragment = comment();
|
|
18610
18734
|
var node = first_child(fragment);
|
|
18611
18735
|
var consequent = ($$anchor) => {
|
|
18612
|
-
var span = root$
|
|
18736
|
+
var span = root$46();
|
|
18613
18737
|
var text = sibling(child(span), 1, true);
|
|
18614
18738
|
reset(span);
|
|
18615
18739
|
template_effect(($0) => set_text(text, $0), [() => formatCurrency(get$2(details).discountedAmountCents)]);
|
|
@@ -18853,7 +18977,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18853
18977
|
}
|
|
18854
18978
|
//#endregion
|
|
18855
18979
|
//#region src/components/couponRedemption/CouponRedemption.svelte
|
|
18856
|
-
var root$
|
|
18980
|
+
var root$45 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
|
|
18857
18981
|
function CouponRedemption($$anchor, $$props) {
|
|
18858
18982
|
push($$props, true);
|
|
18859
18983
|
Forms.defineForm({
|
|
@@ -18890,7 +19014,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18890
19014
|
return runRedeem(form);
|
|
18891
19015
|
}
|
|
18892
19016
|
var $$exports = { flush };
|
|
18893
|
-
var go_form = root$
|
|
19017
|
+
var go_form = root$45();
|
|
18894
19018
|
set_custom_element_data(go_form, "formId", "couponRedemption");
|
|
18895
19019
|
event("submit", go_form, redeem$1);
|
|
18896
19020
|
append($$anchor, go_form);
|
|
@@ -18898,6 +19022,116 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18898
19022
|
}
|
|
18899
19023
|
customElements.define("go-coupon-redemption", create_custom_element(CouponRedemption, {}, [], ["flush"]));
|
|
18900
19024
|
//#endregion
|
|
19025
|
+
//#region src/components/donations/components/DonationCheckbox.svelte
|
|
19026
|
+
var root$44 = /* @__PURE__ */ from_html(`<span class="go-donation-checkbox-label"></span>`);
|
|
19027
|
+
var root_1$13 = /* @__PURE__ */ from_html(`<span class="go-donation-checkbox-label"> </span>`);
|
|
19028
|
+
var root_2$9 = /* @__PURE__ */ from_html(`<label class="go-donation-checkbox"><input type="checkbox" data-testid="donation-checkbox"/> <!></label>`);
|
|
19029
|
+
function DonationCheckbox($$anchor, $$props) {
|
|
19030
|
+
push($$props, true);
|
|
19031
|
+
let campaignId = prop($$props, "campaignId", 7), amountCents = prop($$props, "amountCents", 7), describedby = prop($$props, "describedby", 7);
|
|
19032
|
+
const adopted = document.createDocumentFragment();
|
|
19033
|
+
for (const node of Array.from($$props.$$host.childNodes)) if (!(node.nodeType === Node.TEXT_NODE && node.textContent === "") && node.nodeType !== Node.COMMENT_NODE) adopted.appendChild(node);
|
|
19034
|
+
const hasCustomLabel = Array.from(adopted.childNodes).some((n) => n.nodeType === Node.ELEMENT_NODE || !!n.textContent?.trim());
|
|
19035
|
+
let customLabelSpan = /* @__PURE__ */ state(void 0);
|
|
19036
|
+
user_effect(() => {
|
|
19037
|
+
if (!hasCustomLabel || !get$2(customLabelSpan)) return;
|
|
19038
|
+
const span = get$2(customLabelSpan);
|
|
19039
|
+
span.appendChild(adopted);
|
|
19040
|
+
return () => {
|
|
19041
|
+
while (span.firstChild) adopted.appendChild(span.firstChild);
|
|
19042
|
+
};
|
|
19043
|
+
});
|
|
19044
|
+
const campaign = /* @__PURE__ */ user_derived(() => shop.donations?.campaigns?.find((c) => c.id === campaignId()));
|
|
19045
|
+
const guest = /* @__PURE__ */ user_derived(() => !shop.currentUser?.isAuthenticated || shop.currentUser?.isGuest);
|
|
19046
|
+
const overGuestLimit = /* @__PURE__ */ user_derived(() => !!get$2(campaign) && get$2(campaign).guest_limit > 0 && (amountCents() ?? 0) > get$2(campaign).guest_limit && get$2(guest));
|
|
19047
|
+
const checked = /* @__PURE__ */ user_derived(() => !!get$2(campaign) && !!amountCents() && !!shop.cart?.hasDonation(get$2(campaign).id, amountCents()));
|
|
19048
|
+
function toggle(event) {
|
|
19049
|
+
if (!get$2(campaign) || !amountCents() || !shop.cart) return;
|
|
19050
|
+
if (event.currentTarget.checked) shop.cart.addDonation({
|
|
19051
|
+
value: amountCents(),
|
|
19052
|
+
campaign_id: get$2(campaign).id
|
|
19053
|
+
});
|
|
19054
|
+
else shop.cart.removeDonation(get$2(campaign).id, amountCents());
|
|
19055
|
+
}
|
|
19056
|
+
var $$exports = {
|
|
19057
|
+
get campaignId() {
|
|
19058
|
+
return campaignId();
|
|
19059
|
+
},
|
|
19060
|
+
set campaignId($$value) {
|
|
19061
|
+
campaignId($$value);
|
|
19062
|
+
flushSync();
|
|
19063
|
+
},
|
|
19064
|
+
get amountCents() {
|
|
19065
|
+
return amountCents();
|
|
19066
|
+
},
|
|
19067
|
+
set amountCents($$value) {
|
|
19068
|
+
amountCents($$value);
|
|
19069
|
+
flushSync();
|
|
19070
|
+
},
|
|
19071
|
+
get describedby() {
|
|
19072
|
+
return describedby();
|
|
19073
|
+
},
|
|
19074
|
+
set describedby($$value) {
|
|
19075
|
+
describedby($$value);
|
|
19076
|
+
flushSync();
|
|
19077
|
+
}
|
|
19078
|
+
};
|
|
19079
|
+
var fragment = comment();
|
|
19080
|
+
var node_1 = first_child(fragment);
|
|
19081
|
+
var consequent_1 = ($$anchor) => {
|
|
19082
|
+
var label = root_2$9();
|
|
19083
|
+
var input = child(label);
|
|
19084
|
+
remove_input_defaults(input);
|
|
19085
|
+
var node_2 = sibling(input, 2);
|
|
19086
|
+
var consequent = ($$anchor) => {
|
|
19087
|
+
var span_1 = root$44();
|
|
19088
|
+
bind_this(span_1, ($$value) => set(customLabelSpan, $$value), () => get$2(customLabelSpan));
|
|
19089
|
+
append($$anchor, span_1);
|
|
19090
|
+
};
|
|
19091
|
+
var alternate = ($$anchor) => {
|
|
19092
|
+
var span_2 = root_1$13();
|
|
19093
|
+
var text = child(span_2, true);
|
|
19094
|
+
reset(span_2);
|
|
19095
|
+
template_effect(($0) => set_text(text, $0), [() => shop.t("donations.checkbox.label", {
|
|
19096
|
+
campaign: get$2(campaign).name,
|
|
19097
|
+
amount: formatCurrency(amountCents())
|
|
19098
|
+
})]);
|
|
19099
|
+
append($$anchor, span_2);
|
|
19100
|
+
};
|
|
19101
|
+
if_block(node_2, ($$render) => {
|
|
19102
|
+
if (hasCustomLabel) $$render(consequent);
|
|
19103
|
+
else $$render(alternate, -1);
|
|
19104
|
+
});
|
|
19105
|
+
reset(label);
|
|
19106
|
+
template_effect(() => {
|
|
19107
|
+
set_checked(input, get$2(checked));
|
|
19108
|
+
set_attribute(input, "aria-describedby", describedby() || void 0);
|
|
19109
|
+
});
|
|
19110
|
+
delegated("change", input, toggle);
|
|
19111
|
+
append($$anchor, label);
|
|
19112
|
+
};
|
|
19113
|
+
if_block(node_1, ($$render) => {
|
|
19114
|
+
if (get$2(campaign) && amountCents() && amountCents() > 0 && !get$2(overGuestLimit)) $$render(consequent_1);
|
|
19115
|
+
});
|
|
19116
|
+
append($$anchor, fragment);
|
|
19117
|
+
return pop($$exports);
|
|
19118
|
+
}
|
|
19119
|
+
delegate(["change"]);
|
|
19120
|
+
customElements.define("go-donation-checkbox", create_custom_element(DonationCheckbox, {
|
|
19121
|
+
campaignId: {
|
|
19122
|
+
attribute: "campaign-id",
|
|
19123
|
+
type: "Number"
|
|
19124
|
+
},
|
|
19125
|
+
amountCents: {
|
|
19126
|
+
attribute: "amount-cents",
|
|
19127
|
+
type: "Number"
|
|
19128
|
+
},
|
|
19129
|
+
describedby: {
|
|
19130
|
+
attribute: "describedby",
|
|
19131
|
+
type: "String"
|
|
19132
|
+
}
|
|
19133
|
+
}, [], []));
|
|
19134
|
+
//#endregion
|
|
18901
19135
|
//#region ../../node_modules/.pnpm/svelte@5.56.1_@typescript-eslint+types@8.60.1/node_modules/svelte/src/internal/flags/legacy.js
|
|
18902
19136
|
enable_legacy_mode_flag();
|
|
18903
19137
|
//#endregion
|
|
@@ -36572,6 +36806,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
36572
36806
|
untrack(() => {
|
|
36573
36807
|
cart.clearItems();
|
|
36574
36808
|
cart.clearCoupons();
|
|
36809
|
+
cart.clearDonations();
|
|
36575
36810
|
if (shop.auth.isGuest()) shop.auth.signOut();
|
|
36576
36811
|
});
|
|
36577
36812
|
});
|