@gomusdev/web-components 3.2.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist-js/components/withdrawal/Withdrawal.svelte.d.ts +1 -0
- package/dist-js/gomus-webcomponents.iife.js +217 -92
- package/dist-js/gomus-webcomponents.js +217 -92
- package/dist-js/gomus-webcomponents.min.iife.js +13 -13
- package/dist-js/gomus-webcomponents.min.js +6058 -5955
- package/dist-js/src/components/cart/mocks/gomusTicketMocks.d.ts +27 -0
- package/dist-js/src/components/withdrawal/entry.d.ts +0 -0
- package/dist-js/src/components/withdrawal/specs/Withdrawal.spec.d.ts +1 -0
- package/dist-js/src/lib/models/ticket/UITicket.svelte.d.ts +27 -0
- package/dist-js/src/lib/stores/shop.svelte.d.ts +15 -1
- package/dist-js/src/lib/stores/shop.withdrawal.spec.d.ts +1 -0
- package/dist-js/src/mocks/ShopMocks.d.ts +18 -0
- package/package.json +1 -1
|
@@ -2057,6 +2057,11 @@ function autofocus(dom, value) {
|
|
|
2057
2057
|
});
|
|
2058
2058
|
}
|
|
2059
2059
|
}
|
|
2060
|
+
function remove_textarea_child(dom) {
|
|
2061
|
+
if (hydrating && /* @__PURE__ */ get_first_child(dom) !== null) {
|
|
2062
|
+
clear_text_content(dom);
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2060
2065
|
let listening_to_form_reset = false;
|
|
2061
2066
|
function add_form_reset_listener() {
|
|
2062
2067
|
if (!listening_to_form_reset) {
|
|
@@ -12450,6 +12455,7 @@ const TICKET_AND_QUOTAS_ENDPOINT = "/api/v4/tickets/list_and_quotas";
|
|
|
12450
12455
|
const TICKETS_ENDPOINT = "/api/v4/tickets";
|
|
12451
12456
|
const SIGN_IN_ENDPOINT = "/api/v4/auth/sign_in";
|
|
12452
12457
|
const SIGN_UP_ENDPOINT = "/api/v4/auth";
|
|
12458
|
+
const WITHDRAWAL_ENDPOINT = "/api/v4/orders/withdrawals";
|
|
12453
12459
|
const CustomerLevels = {
|
|
12454
12460
|
// NORMAL: 0,
|
|
12455
12461
|
// WIDGET: 5,
|
|
@@ -12601,6 +12607,16 @@ class Shop {
|
|
|
12601
12607
|
if (!asGuest) requiredFields.push("password", "password_confirmation");
|
|
12602
12608
|
return this.apiPost(SIGN_UP_ENDPOINT, { body: params, requiredFields });
|
|
12603
12609
|
}
|
|
12610
|
+
withdrawal(params) {
|
|
12611
|
+
const body = { ...params, order_id: String(params.order_id) };
|
|
12612
|
+
if (!body.note) delete body.note;
|
|
12613
|
+
return this.apiPost(WITHDRAWAL_ENDPOINT, {
|
|
12614
|
+
body,
|
|
12615
|
+
requiredFields: ["order_id", "first_name", "last_name", "email"],
|
|
12616
|
+
// Success is 201 with an empty body; skip JSON parsing (see apiCall).
|
|
12617
|
+
parseAs: "text"
|
|
12618
|
+
});
|
|
12619
|
+
}
|
|
12604
12620
|
getDates(query) {
|
|
12605
12621
|
return this.fetchAndCache("/api/v4/dates", `dates-${JSON.stringify(query)}`, "dates", { query, cache: 60 });
|
|
12606
12622
|
}
|
|
@@ -12756,7 +12772,7 @@ class Shop {
|
|
|
12756
12772
|
}
|
|
12757
12773
|
async apiCall(path, options) {
|
|
12758
12774
|
this.#ensureApi();
|
|
12759
|
-
const { body, params = {}, requiredFields } = options;
|
|
12775
|
+
const { body, params = {}, requiredFields, parseAs } = options;
|
|
12760
12776
|
const validationErrors = validateApiPostBody(body, requiredFields);
|
|
12761
12777
|
if (Object.keys(validationErrors).length > 0) {
|
|
12762
12778
|
return { error: { errors: validationErrors } };
|
|
@@ -12764,7 +12780,12 @@ class Shop {
|
|
|
12764
12780
|
const httpMethod = this.client[options.method];
|
|
12765
12781
|
const ret = await httpMethod(path, {
|
|
12766
12782
|
body,
|
|
12767
|
-
params: assign(this.#defaultApiParams, { params }).params
|
|
12783
|
+
params: assign(this.#defaultApiParams, { params }).params,
|
|
12784
|
+
// `parseAs` lets callers opt out of openapi-fetch's default JSON parsing.
|
|
12785
|
+
// Endpoints that answer 2xx with an empty body (e.g. withdrawal's
|
|
12786
|
+
// `head :created`) must use 'text', otherwise coreFetch's unconditional
|
|
12787
|
+
// response.json() throws on the empty body. undefined => default 'json'.
|
|
12788
|
+
parseAs
|
|
12768
12789
|
});
|
|
12769
12790
|
return ret;
|
|
12770
12791
|
}
|
|
@@ -16253,6 +16274,42 @@ var allFields = {
|
|
|
16253
16274
|
autocomplete: "off",
|
|
16254
16275
|
validator: _instanceof(File)
|
|
16255
16276
|
},
|
|
16277
|
+
withdrawalFirstName: {
|
|
16278
|
+
key: "withdrawalFirstName",
|
|
16279
|
+
apiKey: "first_name",
|
|
16280
|
+
type: "text",
|
|
16281
|
+
label: "user.registration.form.name",
|
|
16282
|
+
placeholder: "",
|
|
16283
|
+
description: "",
|
|
16284
|
+
autocomplete: "given-name"
|
|
16285
|
+
},
|
|
16286
|
+
withdrawalLastName: {
|
|
16287
|
+
key: "withdrawalLastName",
|
|
16288
|
+
apiKey: "last_name",
|
|
16289
|
+
type: "text",
|
|
16290
|
+
label: "user.registration.form.surname",
|
|
16291
|
+
placeholder: "",
|
|
16292
|
+
description: "",
|
|
16293
|
+
autocomplete: "family-name"
|
|
16294
|
+
},
|
|
16295
|
+
orderNumber: {
|
|
16296
|
+
key: "orderNumber",
|
|
16297
|
+
apiKey: "order_id",
|
|
16298
|
+
type: "text",
|
|
16299
|
+
label: "withdrawal.form.orderNumber",
|
|
16300
|
+
placeholder: "",
|
|
16301
|
+
description: "",
|
|
16302
|
+
autocomplete: "off"
|
|
16303
|
+
},
|
|
16304
|
+
withdrawalNote: {
|
|
16305
|
+
key: "withdrawalNote",
|
|
16306
|
+
apiKey: "note",
|
|
16307
|
+
type: "textarea",
|
|
16308
|
+
label: "withdrawal.form.note",
|
|
16309
|
+
placeholder: "",
|
|
16310
|
+
description: "",
|
|
16311
|
+
autocomplete: "off"
|
|
16312
|
+
},
|
|
16256
16313
|
paymentMode: {
|
|
16257
16314
|
key: "paymentMode",
|
|
16258
16315
|
apiKey: "payment_mode_id",
|
|
@@ -17151,7 +17208,7 @@ var root_6$2 = /* @__PURE__ */ from_html(`<span class="go-cart-item-price-discou
|
|
|
17151
17208
|
var root_7$3 = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
17152
17209
|
var root_9$4 = /* @__PURE__ */ from_html(`<option> </option>`);
|
|
17153
17210
|
var root_8$3 = /* @__PURE__ */ from_html(`<select class="go-cart-item-select"></select>`);
|
|
17154
|
-
var root_10$
|
|
17211
|
+
var root_10$2 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove">⨉</button></li>`);
|
|
17155
17212
|
var root_1$m = /* @__PURE__ */ from_html(`<article class="go-cart-item-content"><ul><li class="go-cart-item-title-container"><!></li> <li class="go-cart-item-price"><!></li> <li class="go-cart-item-count"><!></li> <!> <li class="go-cart-item-sum"> </li></ul></article>`);
|
|
17156
17213
|
function Item$1($$anchor, $$props) {
|
|
17157
17214
|
push($$props, true);
|
|
@@ -17328,7 +17385,7 @@ function Item$1($$anchor, $$props) {
|
|
|
17328
17385
|
var node_5 = sibling(li_2, 2);
|
|
17329
17386
|
{
|
|
17330
17387
|
var consequent_4 = ($$anchor3) => {
|
|
17331
|
-
var li_3 = root_10$
|
|
17388
|
+
var li_3 = root_10$2();
|
|
17332
17389
|
var button = child(li_3);
|
|
17333
17390
|
button.__click = del;
|
|
17334
17391
|
reset(li_3);
|
|
@@ -31332,7 +31389,7 @@ function Date_picker_trigger($$anchor, $$props) {
|
|
|
31332
31389
|
create_custom_element(Date_picker_trigger, { ref: {}, onkeydown: {} }, [], [], { mode: "open" });
|
|
31333
31390
|
var root_4$4 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
31334
31391
|
var root_9$2 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
|
|
31335
|
-
var root_11$
|
|
31392
|
+
var root_11$2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
31336
31393
|
var root_8$2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
31337
31394
|
var root_1$b = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
|
|
31338
31395
|
function DatePicker_1($$anchor, $$props) {
|
|
@@ -31508,7 +31565,7 @@ function DatePicker_1($$anchor, $$props) {
|
|
|
31508
31565
|
component(node_15, () => Calendar_grid, ($$anchor8, DatePicker_Grid) => {
|
|
31509
31566
|
DatePicker_Grid($$anchor8, {
|
|
31510
31567
|
children: ($$anchor9, $$slotProps3) => {
|
|
31511
|
-
var fragment_11 = root_11$
|
|
31568
|
+
var fragment_11 = root_11$2();
|
|
31512
31569
|
var node_16 = first_child(fragment_11);
|
|
31513
31570
|
component(node_16, () => Calendar_grid_head, ($$anchor10, DatePicker_GridHead) => {
|
|
31514
31571
|
DatePicker_GridHead($$anchor10, {
|
|
@@ -31638,19 +31695,20 @@ create_custom_element(
|
|
|
31638
31695
|
var root_2$6 = /* @__PURE__ */ from_html(`<span class="go-field-star" aria-hidden="true">*</span>`);
|
|
31639
31696
|
var root_1$a = /* @__PURE__ */ from_html(` <!>`, 1);
|
|
31640
31697
|
var root_3$6 = /* @__PURE__ */ from_html(`<label><!></label> <input/>`, 1);
|
|
31641
|
-
var
|
|
31642
|
-
var
|
|
31643
|
-
var
|
|
31644
|
-
var
|
|
31645
|
-
var
|
|
31698
|
+
var root_4$3 = /* @__PURE__ */ from_html(`<label><!></label> <textarea></textarea>`, 1);
|
|
31699
|
+
var root_6$1 = /* @__PURE__ */ from_html(`<figure role="status" aria-live="polite"><img class="go-file-preview"/> <figcaption class="go-file-preview-caption"> </figcaption></figure>`);
|
|
31700
|
+
var root_5 = /* @__PURE__ */ from_html(`<label><!></label> <input/> <!>`, 1);
|
|
31701
|
+
var root_7$2 = /* @__PURE__ */ from_html(`<label><input/> <span class="go-checkbox-label"><!></span></label>`);
|
|
31702
|
+
var root_10$1 = /* @__PURE__ */ from_html(`<img src="" alt=""/> <option> </option>`, 1);
|
|
31703
|
+
var root_9$1 = /* @__PURE__ */ from_html(`<option disabled hidden="" selected> </option> <!>`, 1);
|
|
31646
31704
|
var select_content = /* @__PURE__ */ from_html(`<!>`, 1);
|
|
31647
|
-
var
|
|
31648
|
-
var
|
|
31649
|
-
var
|
|
31650
|
-
var
|
|
31651
|
-
var
|
|
31652
|
-
var
|
|
31653
|
-
var
|
|
31705
|
+
var root_8$1 = /* @__PURE__ */ from_html(`<label><!></label> <select><!></select>`, 1);
|
|
31706
|
+
var root_15 = /* @__PURE__ */ from_html(`<img style="width: 60px" aria-hidden="true"/>`);
|
|
31707
|
+
var root_14 = /* @__PURE__ */ from_html(`<span class="go-payment-mode-icons"></span>`);
|
|
31708
|
+
var root_13 = /* @__PURE__ */ from_html(`<label><input type="radio"/> <!></label>`);
|
|
31709
|
+
var root_12$1 = /* @__PURE__ */ from_html(`<fieldset role="radiogroup"><legend><!></legend> <!></fieldset>`);
|
|
31710
|
+
var root_18 = /* @__PURE__ */ from_html(`<label> <input/></label>`);
|
|
31711
|
+
var root_16 = /* @__PURE__ */ from_html(`<fieldset><legend><!></legend> <!></fieldset>`);
|
|
31654
31712
|
function InputAndLabel($$anchor, $$props) {
|
|
31655
31713
|
push($$props, true);
|
|
31656
31714
|
const labelText = ($$anchor2) => {
|
|
@@ -31700,13 +31758,35 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31700
31758
|
bind_value(input_1, () => field().value, ($$value) => field(field().value = $$value, true));
|
|
31701
31759
|
append($$anchor2, fragment_1);
|
|
31702
31760
|
};
|
|
31703
|
-
const
|
|
31761
|
+
const textarea = ($$anchor2) => {
|
|
31704
31762
|
var fragment_2 = root_4$3();
|
|
31705
31763
|
var label_2 = first_child(fragment_2);
|
|
31706
31764
|
var node_2 = child(label_2);
|
|
31707
31765
|
labelText(node_2);
|
|
31708
31766
|
reset(label_2);
|
|
31709
|
-
var
|
|
31767
|
+
var textarea_1 = sibling(label_2, 2);
|
|
31768
|
+
remove_textarea_child(textarea_1);
|
|
31769
|
+
attribute_effect(textarea_1, () => ({
|
|
31770
|
+
...get$2(fieldAttributes),
|
|
31771
|
+
...restProps,
|
|
31772
|
+
class: inputClass(),
|
|
31773
|
+
placeholder: field().placeholder,
|
|
31774
|
+
name: field().key
|
|
31775
|
+
}));
|
|
31776
|
+
template_effect(() => {
|
|
31777
|
+
set_class(label_2, 1, clsx(labelClass()));
|
|
31778
|
+
set_attribute(label_2, "for", get$2(inputId));
|
|
31779
|
+
});
|
|
31780
|
+
bind_value(textarea_1, () => field().value, ($$value) => field(field().value = $$value, true));
|
|
31781
|
+
append($$anchor2, fragment_2);
|
|
31782
|
+
};
|
|
31783
|
+
const file = ($$anchor2) => {
|
|
31784
|
+
var fragment_3 = root_5();
|
|
31785
|
+
var label_3 = first_child(fragment_3);
|
|
31786
|
+
var node_3 = child(label_3);
|
|
31787
|
+
labelText(node_3);
|
|
31788
|
+
reset(label_3);
|
|
31789
|
+
var input_2 = sibling(label_3, 2);
|
|
31710
31790
|
var event_handler = (e) => {
|
|
31711
31791
|
const files = e.currentTarget.files;
|
|
31712
31792
|
field(field().value = files && files[0] ? files[0] : null, true);
|
|
@@ -31730,10 +31810,10 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31730
31810
|
void 0,
|
|
31731
31811
|
true
|
|
31732
31812
|
);
|
|
31733
|
-
var
|
|
31813
|
+
var node_4 = sibling(input_2, 2);
|
|
31734
31814
|
{
|
|
31735
31815
|
var consequent_1 = ($$anchor3) => {
|
|
31736
|
-
var figure =
|
|
31816
|
+
var figure = root_6$1();
|
|
31737
31817
|
var img = child(figure);
|
|
31738
31818
|
var figcaption = sibling(img, 2);
|
|
31739
31819
|
var text_1 = child(figcaption, true);
|
|
@@ -31752,19 +31832,19 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31752
31832
|
);
|
|
31753
31833
|
append($$anchor3, figure);
|
|
31754
31834
|
};
|
|
31755
|
-
if_block(
|
|
31835
|
+
if_block(node_4, ($$render) => {
|
|
31756
31836
|
if (get$2(filePreviewUrl) && field().value instanceof File) $$render(consequent_1);
|
|
31757
31837
|
});
|
|
31758
31838
|
}
|
|
31759
31839
|
template_effect(() => {
|
|
31760
|
-
set_class(
|
|
31761
|
-
set_attribute(
|
|
31840
|
+
set_class(label_3, 1, clsx(labelClass()));
|
|
31841
|
+
set_attribute(label_3, "for", get$2(inputId));
|
|
31762
31842
|
});
|
|
31763
|
-
append($$anchor2,
|
|
31843
|
+
append($$anchor2, fragment_3);
|
|
31764
31844
|
};
|
|
31765
31845
|
const checkbox = ($$anchor2) => {
|
|
31766
|
-
var
|
|
31767
|
-
var input_3 = child(
|
|
31846
|
+
var label_4 = root_7$2();
|
|
31847
|
+
var input_3 = child(label_4);
|
|
31768
31848
|
attribute_effect(
|
|
31769
31849
|
input_3,
|
|
31770
31850
|
() => ({
|
|
@@ -31781,13 +31861,13 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31781
31861
|
true
|
|
31782
31862
|
);
|
|
31783
31863
|
var span_1 = sibling(input_3, 2);
|
|
31784
|
-
var
|
|
31785
|
-
labelText(
|
|
31864
|
+
var node_5 = child(span_1);
|
|
31865
|
+
labelText(node_5);
|
|
31786
31866
|
reset(span_1);
|
|
31787
|
-
reset(
|
|
31867
|
+
reset(label_4);
|
|
31788
31868
|
template_effect(() => {
|
|
31789
|
-
set_class(
|
|
31790
|
-
set_attribute(
|
|
31869
|
+
set_class(label_4, 1, clsx(labelClass()));
|
|
31870
|
+
set_attribute(label_4, "for", get$2(inputId));
|
|
31791
31871
|
});
|
|
31792
31872
|
bind_checked(
|
|
31793
31873
|
input_3,
|
|
@@ -31798,15 +31878,15 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31798
31878
|
field(field().value = value, true);
|
|
31799
31879
|
}
|
|
31800
31880
|
);
|
|
31801
|
-
append($$anchor2,
|
|
31881
|
+
append($$anchor2, label_4);
|
|
31802
31882
|
};
|
|
31803
31883
|
const select = ($$anchor2) => {
|
|
31804
|
-
var
|
|
31805
|
-
var
|
|
31806
|
-
var
|
|
31807
|
-
labelText(
|
|
31808
|
-
reset(
|
|
31809
|
-
var select_1 = sibling(
|
|
31884
|
+
var fragment_4 = root_8$1();
|
|
31885
|
+
var label_5 = first_child(fragment_4);
|
|
31886
|
+
var node_6 = child(label_5);
|
|
31887
|
+
labelText(node_6);
|
|
31888
|
+
reset(label_5);
|
|
31889
|
+
var select_1 = sibling(label_5, 2);
|
|
31810
31890
|
attribute_effect(select_1, () => ({
|
|
31811
31891
|
...get$2(fieldAttributes),
|
|
31812
31892
|
...restProps,
|
|
@@ -31815,19 +31895,19 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31815
31895
|
}));
|
|
31816
31896
|
customizable_select(select_1, () => {
|
|
31817
31897
|
var anchor = child(select_1);
|
|
31818
|
-
var
|
|
31819
|
-
var
|
|
31898
|
+
var fragment_5 = select_content();
|
|
31899
|
+
var node_7 = first_child(fragment_5);
|
|
31820
31900
|
{
|
|
31821
31901
|
var consequent_2 = ($$anchor3) => {
|
|
31822
|
-
var
|
|
31823
|
-
var option_1 = first_child(
|
|
31902
|
+
var fragment_6 = root_9$1();
|
|
31903
|
+
var option_1 = first_child(fragment_6);
|
|
31824
31904
|
var text_2 = child(option_1, true);
|
|
31825
31905
|
reset(option_1);
|
|
31826
31906
|
option_1.value = option_1.__value = "";
|
|
31827
|
-
var
|
|
31828
|
-
each(
|
|
31829
|
-
var
|
|
31830
|
-
var option_2 = sibling(first_child(
|
|
31907
|
+
var node_8 = sibling(option_1, 2);
|
|
31908
|
+
each(node_8, 17, () => field().options(), (option2) => option2.value, ($$anchor4, option2) => {
|
|
31909
|
+
var fragment_7 = root_10$1();
|
|
31910
|
+
var option_2 = sibling(first_child(fragment_7), 2);
|
|
31831
31911
|
var text_3 = child(option_2, true);
|
|
31832
31912
|
reset(option_2);
|
|
31833
31913
|
var option_2_value = {};
|
|
@@ -31837,23 +31917,23 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31837
31917
|
option_2.value = (option_2.__value = get$2(option2).value) ?? "";
|
|
31838
31918
|
}
|
|
31839
31919
|
});
|
|
31840
|
-
append($$anchor4,
|
|
31920
|
+
append($$anchor4, fragment_7);
|
|
31841
31921
|
});
|
|
31842
31922
|
template_effect(($0) => set_text(text_2, $0), [() => shop.t("common.choose")]);
|
|
31843
|
-
append($$anchor3,
|
|
31923
|
+
append($$anchor3, fragment_6);
|
|
31844
31924
|
};
|
|
31845
|
-
if_block(
|
|
31925
|
+
if_block(node_7, ($$render) => {
|
|
31846
31926
|
if (field().options) $$render(consequent_2);
|
|
31847
31927
|
});
|
|
31848
31928
|
}
|
|
31849
|
-
append(anchor,
|
|
31929
|
+
append(anchor, fragment_5);
|
|
31850
31930
|
});
|
|
31851
31931
|
template_effect(() => {
|
|
31852
|
-
set_class(
|
|
31853
|
-
set_attribute(
|
|
31932
|
+
set_class(label_5, 1, clsx(labelClass()));
|
|
31933
|
+
set_attribute(label_5, "for", get$2(inputId));
|
|
31854
31934
|
});
|
|
31855
31935
|
bind_select_value(select_1, () => field().value, ($$value) => field(field().value = $$value, true));
|
|
31856
|
-
append($$anchor2,
|
|
31936
|
+
append($$anchor2, fragment_4);
|
|
31857
31937
|
};
|
|
31858
31938
|
const date2 = ($$anchor2) => {
|
|
31859
31939
|
DatePicker_1($$anchor2, {
|
|
@@ -31876,26 +31956,26 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31876
31956
|
};
|
|
31877
31957
|
const paymentMode = ($$anchor2) => {
|
|
31878
31958
|
const modes = /* @__PURE__ */ user_derived(() => shop.payment_modes ? Object.values(shop.payment_modes) : []);
|
|
31879
|
-
var fieldset =
|
|
31959
|
+
var fieldset = root_12$1();
|
|
31880
31960
|
var legend = child(fieldset);
|
|
31881
|
-
var
|
|
31882
|
-
labelText(
|
|
31961
|
+
var node_9 = child(legend);
|
|
31962
|
+
labelText(node_9);
|
|
31883
31963
|
reset(legend);
|
|
31884
|
-
var
|
|
31885
|
-
each(
|
|
31886
|
-
var
|
|
31887
|
-
var input_4 = child(
|
|
31964
|
+
var node_10 = sibling(legend, 2);
|
|
31965
|
+
each(node_10, 17, () => get$2(modes), (mode) => mode.id, ($$anchor3, mode) => {
|
|
31966
|
+
var label_6 = root_13();
|
|
31967
|
+
var input_4 = child(label_6);
|
|
31888
31968
|
remove_input_defaults(input_4);
|
|
31889
31969
|
input_4.__change = () => {
|
|
31890
31970
|
field(field().value = String(get$2(mode).id), true);
|
|
31891
31971
|
};
|
|
31892
|
-
var
|
|
31972
|
+
var node_11 = sibling(input_4, 2);
|
|
31893
31973
|
{
|
|
31894
31974
|
var consequent_3 = ($$anchor4) => {
|
|
31895
|
-
var span_2 =
|
|
31975
|
+
var span_2 = root_14();
|
|
31896
31976
|
each(span_2, 20, () => get$2(mode).icons, (icon) => icon, ($$anchor5, icon) => {
|
|
31897
31977
|
const url = /* @__PURE__ */ user_derived(() => CDN_PATH + icon + ".svg");
|
|
31898
|
-
var img_1 =
|
|
31978
|
+
var img_1 = root_15();
|
|
31899
31979
|
template_effect(() => {
|
|
31900
31980
|
set_class(img_1, 1, clsx(icon));
|
|
31901
31981
|
set_attribute(img_1, "src", get$2(url));
|
|
@@ -31906,11 +31986,11 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31906
31986
|
reset(span_2);
|
|
31907
31987
|
append($$anchor4, span_2);
|
|
31908
31988
|
};
|
|
31909
|
-
if_block(
|
|
31989
|
+
if_block(node_11, ($$render) => {
|
|
31910
31990
|
if (get$2(mode).icons.length > 0) $$render(consequent_3);
|
|
31911
31991
|
});
|
|
31912
31992
|
}
|
|
31913
|
-
reset(
|
|
31993
|
+
reset(label_6);
|
|
31914
31994
|
template_effect(
|
|
31915
31995
|
($0, $1, $2) => {
|
|
31916
31996
|
set_attribute(input_4, "name", field().key);
|
|
@@ -31925,7 +32005,7 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31925
32005
|
() => shop.t(`cart.paymentMode.ariaLabel.${get$2(mode).name.toLowerCase()}`)
|
|
31926
32006
|
]
|
|
31927
32007
|
);
|
|
31928
|
-
append($$anchor3,
|
|
32008
|
+
append($$anchor3, label_6);
|
|
31929
32009
|
});
|
|
31930
32010
|
reset(fieldset);
|
|
31931
32011
|
template_effect(() => {
|
|
@@ -31935,19 +32015,19 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31935
32015
|
append($$anchor2, fieldset);
|
|
31936
32016
|
};
|
|
31937
32017
|
const radio = ($$anchor2) => {
|
|
31938
|
-
var fieldset_1 =
|
|
32018
|
+
var fieldset_1 = root_16();
|
|
31939
32019
|
var legend_1 = child(fieldset_1);
|
|
31940
|
-
var
|
|
31941
|
-
labelText(
|
|
32020
|
+
var node_12 = child(legend_1);
|
|
32021
|
+
labelText(node_12);
|
|
31942
32022
|
reset(legend_1);
|
|
31943
|
-
var
|
|
32023
|
+
var node_13 = sibling(legend_1, 2);
|
|
31944
32024
|
{
|
|
31945
32025
|
var consequent_4 = ($$anchor3) => {
|
|
31946
|
-
var
|
|
31947
|
-
var
|
|
31948
|
-
each(
|
|
31949
|
-
var
|
|
31950
|
-
var text_4 = child(
|
|
32026
|
+
var fragment_9 = comment();
|
|
32027
|
+
var node_14 = first_child(fragment_9);
|
|
32028
|
+
each(node_14, 17, () => field().options, index$1, ($$anchor4, option2) => {
|
|
32029
|
+
var label_7 = root_18();
|
|
32030
|
+
var text_4 = child(label_7);
|
|
31951
32031
|
var input_5 = sibling(text_4);
|
|
31952
32032
|
attribute_effect(
|
|
31953
32033
|
input_5,
|
|
@@ -31963,18 +32043,18 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
31963
32043
|
void 0,
|
|
31964
32044
|
true
|
|
31965
32045
|
);
|
|
31966
|
-
reset(
|
|
32046
|
+
reset(label_7);
|
|
31967
32047
|
template_effect(() => {
|
|
31968
|
-
set_class(
|
|
31969
|
-
set_attribute(
|
|
32048
|
+
set_class(label_7, 1, clsx(labelClass()));
|
|
32049
|
+
set_attribute(label_7, "for", get$2(inputId) + get$2(option2));
|
|
31970
32050
|
set_text(text_4, `${get$2(option2) ?? ""} `);
|
|
31971
32051
|
});
|
|
31972
32052
|
bind_value(input_5, () => field().value, ($$value) => field(field().value = $$value, true));
|
|
31973
|
-
append($$anchor4,
|
|
32053
|
+
append($$anchor4, label_7);
|
|
31974
32054
|
});
|
|
31975
|
-
append($$anchor3,
|
|
32055
|
+
append($$anchor3, fragment_9);
|
|
31976
32056
|
};
|
|
31977
|
-
if_block(
|
|
32057
|
+
if_block(node_13, ($$render) => {
|
|
31978
32058
|
if (field().options) $$render(consequent_4);
|
|
31979
32059
|
});
|
|
31980
32060
|
}
|
|
@@ -32008,7 +32088,7 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
32008
32088
|
radio,
|
|
32009
32089
|
date: date2,
|
|
32010
32090
|
file,
|
|
32011
|
-
textarea
|
|
32091
|
+
textarea,
|
|
32012
32092
|
paymentMode
|
|
32013
32093
|
};
|
|
32014
32094
|
const snippet$1 = /* @__PURE__ */ user_derived(() => map[field().type]);
|
|
@@ -32079,20 +32159,20 @@ function InputAndLabel($$anchor, $$props) {
|
|
|
32079
32159
|
flushSync();
|
|
32080
32160
|
}
|
|
32081
32161
|
};
|
|
32082
|
-
var
|
|
32083
|
-
var
|
|
32162
|
+
var fragment_10 = comment();
|
|
32163
|
+
var node_15 = first_child(fragment_10);
|
|
32084
32164
|
{
|
|
32085
32165
|
var consequent_5 = ($$anchor2) => {
|
|
32086
|
-
var
|
|
32087
|
-
var
|
|
32088
|
-
snippet(
|
|
32089
|
-
append($$anchor2,
|
|
32166
|
+
var fragment_11 = comment();
|
|
32167
|
+
var node_16 = first_child(fragment_11);
|
|
32168
|
+
snippet(node_16, () => get$2(snippet$1));
|
|
32169
|
+
append($$anchor2, fragment_11);
|
|
32090
32170
|
};
|
|
32091
|
-
if_block(
|
|
32171
|
+
if_block(node_15, ($$render) => {
|
|
32092
32172
|
if (get$2(snippet$1)) $$render(consequent_5);
|
|
32093
32173
|
});
|
|
32094
32174
|
}
|
|
32095
|
-
append($$anchor,
|
|
32175
|
+
append($$anchor, fragment_10);
|
|
32096
32176
|
return pop($$exports);
|
|
32097
32177
|
}
|
|
32098
32178
|
delegate(["change"]);
|
|
@@ -37702,6 +37782,51 @@ function AddToCartButton($$anchor, $$props) {
|
|
|
37702
37782
|
}
|
|
37703
37783
|
delegate(["click"]);
|
|
37704
37784
|
customElements.define("go-add-to-cart-button", create_custom_element(AddToCartButton, {}, [], ["details"]));
|
|
37785
|
+
function Withdrawal($$anchor, $$props) {
|
|
37786
|
+
push($$props, true);
|
|
37787
|
+
let custom2 = prop($$props, "custom", 7, false);
|
|
37788
|
+
Forms.defineForm({
|
|
37789
|
+
id: "withdrawal",
|
|
37790
|
+
submitLabel: "withdrawal.actions.submit",
|
|
37791
|
+
fields: [
|
|
37792
|
+
{ key: "withdrawalFirstName", required: true },
|
|
37793
|
+
{ key: "withdrawalLastName", required: true },
|
|
37794
|
+
{ key: "email", required: true },
|
|
37795
|
+
{ key: "orderNumber", required: true },
|
|
37796
|
+
{ key: "withdrawalNote", required: false }
|
|
37797
|
+
]
|
|
37798
|
+
});
|
|
37799
|
+
async function onSubmit(event2) {
|
|
37800
|
+
const form = event2.target;
|
|
37801
|
+
const details = form.details;
|
|
37802
|
+
const result = await shop.withdrawal(details.formData);
|
|
37803
|
+
if (result.response?.ok) {
|
|
37804
|
+
$$props.$$host.dispatchEvent(new Event("go-success", { bubbles: true, composed: true }));
|
|
37805
|
+
} else {
|
|
37806
|
+
details.apiErrors = result.error?.errors ?? [shop.t("withdrawal.form.errors.requestFailed")];
|
|
37807
|
+
}
|
|
37808
|
+
}
|
|
37809
|
+
wrapInElement($$props.$$host, "go-form", { "form-id": "withdrawal", custom: custom2() });
|
|
37810
|
+
$$props.$$host.addEventListener("submit", onSubmit);
|
|
37811
|
+
var $$exports = {
|
|
37812
|
+
get custom() {
|
|
37813
|
+
return custom2();
|
|
37814
|
+
},
|
|
37815
|
+
set custom($$value = false) {
|
|
37816
|
+
custom2($$value);
|
|
37817
|
+
flushSync();
|
|
37818
|
+
}
|
|
37819
|
+
};
|
|
37820
|
+
return pop($$exports);
|
|
37821
|
+
}
|
|
37822
|
+
customElements.define("go-withdrawal-form", create_custom_element(
|
|
37823
|
+
Withdrawal,
|
|
37824
|
+
{
|
|
37825
|
+
custom: { attribute: "custom", reflect: true, type: "Boolean" }
|
|
37826
|
+
},
|
|
37827
|
+
[],
|
|
37828
|
+
[]
|
|
37829
|
+
));
|
|
37705
37830
|
async function initGo(window2) {
|
|
37706
37831
|
const stub = window2.go;
|
|
37707
37832
|
let q = stub && stub._queue || [];
|