hemfixarna-web-components 1.2.6 → 1.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/dist/cjs/hemfixarna-address_20.cjs.entry.js +216 -44
- package/dist/cjs/hemfixarna-address_20.cjs.entry.js.map +1 -1
- package/dist/cjs/hemfixarna-components.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/montering.svg +15 -0
- package/dist/collection/assets/spinner.gif +0 -0
- package/dist/collection/components/hemfixarna-address/hemfixarna-address.js +6 -2
- package/dist/collection/components/hemfixarna-address/hemfixarna-address.js.map +1 -1
- package/dist/collection/components/hemfixarna-byggmax/hemfixarna-byggmax.js +80 -2
- package/dist/collection/components/hemfixarna-byggmax/hemfixarna-byggmax.js.map +1 -1
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js +53 -15
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -1
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +70 -2
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -1
- package/dist/collection/components/hemfixarna-component/hemfixarna.css +60 -3
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.css +10 -0
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js +66 -5
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -1
- package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js +9 -6
- package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js.map +1 -1
- package/dist/collection/components/hemfixarna-hornbach/hemfixarna-hornbach.js +62 -2
- package/dist/collection/components/hemfixarna-hornbach/hemfixarna-hornbach.js.map +1 -1
- package/dist/collection/components/hemfixarna-kund/hemfixarna-kund.js +62 -2
- package/dist/collection/components/hemfixarna-kund/hemfixarna-kund.js.map +1 -1
- package/dist/collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js.map +1 -1
- package/dist/collection/components/hemfixarna-skanska/hemfixarna-skanska.js +62 -2
- package/dist/collection/components/hemfixarna-skanska/hemfixarna-skanska.js.map +1 -1
- package/dist/collection/components/hemfixarna-string/hemfixarna-string-furniture.js +62 -2
- package/dist/collection/components/hemfixarna-string/hemfixarna-string-furniture.js.map +1 -1
- package/dist/collection/store/index.js +4 -0
- package/dist/collection/store/index.js.map +1 -1
- package/dist/collection/types/felixtypes.js +3 -0
- package/dist/collection/types/felixtypes.js.map +1 -0
- package/dist/collection/types/index.js +7 -0
- package/dist/collection/types/index.js.map +1 -1
- package/dist/collection/utils/api.js +21 -3
- package/dist/collection/utils/api.js.map +1 -1
- package/dist/collection/utils/creditSafe.js.map +1 -1
- package/dist/collection/utils/felixApi.js +18 -0
- package/dist/collection/utils/felixApi.js.map +1 -0
- package/dist/collection/utils/felixFunctions.js +2 -2
- package/dist/collection/utils/felixFunctions.js.map +1 -1
- package/dist/collection/utils/form.js +6 -1
- package/dist/collection/utils/form.js.map +1 -1
- package/dist/esm/hemfixarna-address_20.entry.js +216 -44
- package/dist/esm/hemfixarna-address_20.entry.js.map +1 -1
- package/dist/esm/hemfixarna-components.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hemfixarna-components/assets/montering.svg +15 -0
- package/dist/hemfixarna-components/assets/spinner.gif +0 -0
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
- package/dist/hemfixarna-components/p-58141d4b.entry.js +2 -0
- package/dist/types/components/hemfixarna-byggmax/hemfixarna-byggmax.d.ts +5 -1
- package/dist/types/components/hemfixarna-checkout/hemfixarna-checkout.d.ts +1 -0
- package/dist/types/components/hemfixarna-component/hemfixarna-component.d.ts +5 -2
- package/dist/types/components/hemfixarna-demo/hemfixarna-demo.d.ts +17 -1
- package/dist/types/components/hemfixarna-hornbach/hemfixarna-hornbach.d.ts +4 -0
- package/dist/types/components/hemfixarna-kund/hemfixarna-kund.d.ts +4 -0
- package/dist/types/components/hemfixarna-skanska/hemfixarna-skanska.d.ts +4 -0
- package/dist/types/components/hemfixarna-string/hemfixarna-string-furniture.d.ts +4 -0
- package/dist/types/components.d.ts +40 -2
- package/dist/types/store/index.d.ts +2 -0
- package/dist/types/types/felixtypes.d.ts +27 -0
- package/dist/types/types/index.d.ts +11 -5
- package/dist/types/utils/api.d.ts +6 -16
- package/dist/types/utils/creditSafe.d.ts +2 -2
- package/dist/types/utils/felixApi.d.ts +46 -0
- package/dist/types/utils/felixFunctions.d.ts +1 -1
- package/package.json +1 -1
- package/dist/hemfixarna-components/p-40402409.entry.js +0 -2
- /package/dist/hemfixarna-components/{p-40402409.entry.js.map → p-58141d4b.entry.js.map} +0 -0
|
@@ -215,6 +215,7 @@ const { state, onChange, } = createStore({
|
|
|
215
215
|
customer: null,
|
|
216
216
|
selectedCustomerCategory: null,
|
|
217
217
|
parentCategory: null,
|
|
218
|
+
creditSafeUser: null,
|
|
218
219
|
});
|
|
219
220
|
onChange('cart', cart => {
|
|
220
221
|
window.sessionStorage.setItem(`hemfixarna-${state.business}-cart`, JSON.stringify(cart));
|
|
@@ -222,6 +223,9 @@ onChange('cart', cart => {
|
|
|
222
223
|
onChange('user', user => {
|
|
223
224
|
window.sessionStorage.setItem(`hemfixarna-${state.business}-user`, JSON.stringify(user));
|
|
224
225
|
});
|
|
226
|
+
onChange('creditSafeUser', user => {
|
|
227
|
+
window.sessionStorage.setItem(`hemfixarna-${state.business}-creditSafeUser`, JSON.stringify(user));
|
|
228
|
+
});
|
|
225
229
|
onChange('selectedProduct', product => {
|
|
226
230
|
if (!state.customer || !product)
|
|
227
231
|
return;
|
|
@@ -248,7 +252,12 @@ onChange('selectedCustomerCategory', category => {
|
|
|
248
252
|
|
|
249
253
|
const hideField = (field) => {
|
|
250
254
|
return field.split(' ').reduce((acc, curr) => {
|
|
251
|
-
|
|
255
|
+
if (curr.length <= 2) {
|
|
256
|
+
return acc + curr.slice(0, 1) + '* ';
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
return acc + curr.slice(0, 1) + '*'.repeat(curr.length - 2) + curr.slice(-1) + ' ';
|
|
260
|
+
}
|
|
252
261
|
}, '');
|
|
253
262
|
};
|
|
254
263
|
|
|
@@ -271,14 +280,18 @@ const HemfixarnaAddress = class {
|
|
|
271
280
|
this.streetError = 'Ange en gatuadress';
|
|
272
281
|
}
|
|
273
282
|
const zipValid = this.zip.length > 0;
|
|
283
|
+
const zipIsNumber = /^\s*\d[\d\s]*$/.test(this.zip);
|
|
284
|
+
if (!zipIsNumber) {
|
|
285
|
+
this.zipError = 'Postnummer får endast innehålla siffror';
|
|
286
|
+
}
|
|
274
287
|
if (!zipValid) {
|
|
275
288
|
this.zipError = 'Ange ett postnummer';
|
|
276
289
|
}
|
|
277
|
-
const townValid = this.town
|
|
290
|
+
const townValid = /^[^\d\s]{2,}$/.test(this.town);
|
|
278
291
|
if (!townValid) {
|
|
279
292
|
this.townError = 'Ange en ort';
|
|
280
293
|
}
|
|
281
|
-
if (streetValid && zipValid && townValid) {
|
|
294
|
+
if (streetValid && zipValid && townValid && zipIsNumber) {
|
|
282
295
|
state.user = Object.assign(Object.assign({}, state.user), { street: this.street, zip: this.zip, town: this.town });
|
|
283
296
|
state.checkoutStep = 2;
|
|
284
297
|
state.checkoutEdit = false;
|
|
@@ -511,6 +524,13 @@ var Business;
|
|
|
511
524
|
Business["string"] = "string-furniture";
|
|
512
525
|
Business["hornbach"] = "hornbach";
|
|
513
526
|
})(Business || (Business = {}));
|
|
527
|
+
var WidgetStyle;
|
|
528
|
+
(function (WidgetStyle) {
|
|
529
|
+
WidgetStyle["standard"] = "standard";
|
|
530
|
+
WidgetStyle["alternative"] = "alternative";
|
|
531
|
+
WidgetStyle["alternative_2"] = "alternative_2";
|
|
532
|
+
WidgetStyle["alternative_3"] = "alternative_3";
|
|
533
|
+
})(WidgetStyle || (WidgetStyle = {}));
|
|
514
534
|
var TopCategory;
|
|
515
535
|
(function (TopCategory) {
|
|
516
536
|
TopCategory["byggmax"] = "category/bygg";
|
|
@@ -526,9 +546,13 @@ const MyComponent$5 = class {
|
|
|
526
546
|
this.id = undefined;
|
|
527
547
|
this.forceOldTree = false;
|
|
528
548
|
this.loadFromQuery = false;
|
|
549
|
+
this.customer = undefined;
|
|
550
|
+
this.widgetStyle = WidgetStyle.standard;
|
|
551
|
+
this.buttonColor = undefined;
|
|
552
|
+
this.buttonBg = undefined;
|
|
529
553
|
}
|
|
530
554
|
render() {
|
|
531
|
-
return (index.h("hemfixarna-component", {
|
|
555
|
+
return (index.h("hemfixarna-component", { forceOldTree: this.forceOldTree, id: this.id, slug: this.slug, business: Business.byggmax, topCategory: TopCategory.byggmax, loadFromQuery: this.loadFromQuery, widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor }));
|
|
532
556
|
}
|
|
533
557
|
};
|
|
534
558
|
MyComponent$5.style = hemfixarnaByggmaxCss;
|
|
@@ -566,7 +590,12 @@ const HemfixarnaCategory = class {
|
|
|
566
590
|
}
|
|
567
591
|
};
|
|
568
592
|
|
|
569
|
-
const base = `${"https://hemfixarna.se"}/wp-json/headless` ;
|
|
593
|
+
const base$1 = `${"https://hemfixarna.se"}/wp-json/headless` ;
|
|
594
|
+
async function fetchWithType(request, options) {
|
|
595
|
+
const response = await fetch(request, options);
|
|
596
|
+
const body = await response.json();
|
|
597
|
+
return body;
|
|
598
|
+
}
|
|
570
599
|
const getTaxonomy = async (endpoint) => {
|
|
571
600
|
if (!endpoint) {
|
|
572
601
|
return;
|
|
@@ -574,7 +603,7 @@ const getTaxonomy = async (endpoint) => {
|
|
|
574
603
|
const type = endpoint.split('/')[0];
|
|
575
604
|
const slug = endpoint.split('/')[1];
|
|
576
605
|
try {
|
|
577
|
-
const res = await fetch(`${base}/${type}/${slug}`);
|
|
606
|
+
const res = await fetch(`${base$1}/${type}/${slug}`);
|
|
578
607
|
return await res.json();
|
|
579
608
|
}
|
|
580
609
|
catch (error) {
|
|
@@ -583,7 +612,7 @@ const getTaxonomy = async (endpoint) => {
|
|
|
583
612
|
};
|
|
584
613
|
const getCustomer = async (slug) => {
|
|
585
614
|
try {
|
|
586
|
-
const res = await fetch(`${base}/customer/${slug}`);
|
|
615
|
+
const res = await fetch(`${base$1}/customer/${slug}`);
|
|
587
616
|
return await res.json();
|
|
588
617
|
}
|
|
589
618
|
catch (error) {
|
|
@@ -592,7 +621,7 @@ const getCustomer = async (slug) => {
|
|
|
592
621
|
};
|
|
593
622
|
const getOptions = async () => {
|
|
594
623
|
try {
|
|
595
|
-
const res = await fetch(`${base}/webcoptions`);
|
|
624
|
+
const res = await fetch(`${base$1}/webcoptions`);
|
|
596
625
|
return (await res.json());
|
|
597
626
|
}
|
|
598
627
|
catch (error) {
|
|
@@ -601,8 +630,8 @@ const getOptions = async () => {
|
|
|
601
630
|
};
|
|
602
631
|
const getRut = async () => {
|
|
603
632
|
try {
|
|
604
|
-
const
|
|
605
|
-
return
|
|
633
|
+
const data = await fetchWithType(`${base$1}/rut`);
|
|
634
|
+
return data;
|
|
606
635
|
}
|
|
607
636
|
catch (error) {
|
|
608
637
|
console.log(error);
|
|
@@ -610,16 +639,29 @@ const getRut = async () => {
|
|
|
610
639
|
};
|
|
611
640
|
const getRot = async () => {
|
|
612
641
|
try {
|
|
613
|
-
const res = await fetch(`${base}/rot`);
|
|
642
|
+
const res = await fetch(`${base$1}/rot`);
|
|
614
643
|
return (await res.json());
|
|
615
644
|
}
|
|
616
645
|
catch (error) {
|
|
617
646
|
console.log(error);
|
|
618
647
|
}
|
|
619
648
|
};
|
|
649
|
+
// export interface PostOrderData {
|
|
650
|
+
// name: string;
|
|
651
|
+
// customer: Business;
|
|
652
|
+
// phone: string;
|
|
653
|
+
// social_security_number: string;
|
|
654
|
+
// email: string;
|
|
655
|
+
// address: string;
|
|
656
|
+
// earliest_visit_date: string;
|
|
657
|
+
// order_items: string;
|
|
658
|
+
// start_fee: string;
|
|
659
|
+
// total: number;
|
|
660
|
+
// felixStatus: 'success' | 'error';
|
|
661
|
+
// }
|
|
620
662
|
const postOrder = async (data) => {
|
|
621
663
|
try {
|
|
622
|
-
const res = await fetch(`${base}/weborder`, {
|
|
664
|
+
const res = await fetch(`${base$1}/weborder`, {
|
|
623
665
|
method: 'POST',
|
|
624
666
|
body: JSON.stringify(data),
|
|
625
667
|
headers: {
|
|
@@ -633,6 +675,22 @@ const postOrder = async (data) => {
|
|
|
633
675
|
}
|
|
634
676
|
};
|
|
635
677
|
|
|
678
|
+
const base = `${"https://hemfixarna.se"}/wp-json/felix` ;
|
|
679
|
+
const postPerson = async (felixOrder) => {
|
|
680
|
+
try {
|
|
681
|
+
return await fetchWithType(`${base}/createperson`, {
|
|
682
|
+
method: 'POST',
|
|
683
|
+
body: JSON.stringify(felixOrder),
|
|
684
|
+
headers: {
|
|
685
|
+
'Content-Type': 'application/json',
|
|
686
|
+
},
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
catch (error) {
|
|
690
|
+
console.log(error);
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
|
|
636
694
|
const HemfixarnaCheckout = class {
|
|
637
695
|
constructor(hostRef) {
|
|
638
696
|
index.registerInstance(this, hostRef);
|
|
@@ -644,19 +702,52 @@ const HemfixarnaCheckout = class {
|
|
|
644
702
|
this.generalError = null;
|
|
645
703
|
};
|
|
646
704
|
this.sendOrder = async () => {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
705
|
+
var _a, _b;
|
|
706
|
+
if (this.loading)
|
|
707
|
+
return;
|
|
708
|
+
this.loading = true;
|
|
709
|
+
let order = {
|
|
710
|
+
firstName: state.creditSafeUser.firstName,
|
|
711
|
+
lastName: state.creditSafeUser.lastName,
|
|
712
|
+
street: state.user.street,
|
|
713
|
+
zip: state.user.zip,
|
|
714
|
+
town: state.user.town,
|
|
715
|
+
ssn: state.user.ssn,
|
|
653
716
|
email: state.user.email,
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
717
|
+
phone: state.user.phone,
|
|
718
|
+
url: `${state.business === Business.string ? 'string' : state.business}-webk`,
|
|
719
|
+
date: this.date,
|
|
720
|
+
products: [
|
|
721
|
+
...state.cart.map(item => {
|
|
722
|
+
const parts = item.parts.map(part => ({
|
|
723
|
+
id: String(part.id),
|
|
724
|
+
name: part.name,
|
|
725
|
+
quantity: part.amount,
|
|
726
|
+
rut: 0,
|
|
727
|
+
rot: 0,
|
|
728
|
+
}));
|
|
729
|
+
return [
|
|
730
|
+
{
|
|
731
|
+
id: String(item.id),
|
|
732
|
+
name: item.name,
|
|
733
|
+
quantity: item.amount,
|
|
734
|
+
rot: item.rot ? 1 : 0,
|
|
735
|
+
rut: item.rut ? 1 : 0,
|
|
736
|
+
},
|
|
737
|
+
...parts,
|
|
738
|
+
];
|
|
739
|
+
}),
|
|
740
|
+
].flat(),
|
|
741
|
+
creditSafe: state.creditSafeUser,
|
|
742
|
+
customer: state.business,
|
|
659
743
|
};
|
|
744
|
+
const felixOrder = await postPerson(order);
|
|
745
|
+
if (!felixOrder || !((_b = (_a = felixOrder.response) === null || _a === void 0 ? void 0 : _a.scriptResult) === null || _b === void 0 ? void 0 : _b.includes('OK'))) {
|
|
746
|
+
order = Object.assign(Object.assign({}, order), { felixStatus: 'error' });
|
|
747
|
+
}
|
|
748
|
+
else {
|
|
749
|
+
order = Object.assign(Object.assign({}, order), { felixStatus: 'success' });
|
|
750
|
+
}
|
|
660
751
|
try {
|
|
661
752
|
const { data: orderConfirm, status } = await postOrder(order);
|
|
662
753
|
if (orderConfirm && status && status === 200) {
|
|
@@ -668,9 +759,10 @@ const HemfixarnaCheckout = class {
|
|
|
668
759
|
this.generalError = 'Något gick fel, försök igen senare';
|
|
669
760
|
}
|
|
670
761
|
}
|
|
671
|
-
catch (
|
|
762
|
+
catch (error) {
|
|
672
763
|
this.generalError = 'Något gick fel, försök igen senare';
|
|
673
764
|
}
|
|
765
|
+
this.loading = false;
|
|
674
766
|
};
|
|
675
767
|
this.handleSubmit = (e) => {
|
|
676
768
|
e.preventDefault();
|
|
@@ -691,6 +783,7 @@ const HemfixarnaCheckout = class {
|
|
|
691
783
|
this.render = () => {
|
|
692
784
|
const dateLogo = index.getAssetPath(`./assets/date.svg`);
|
|
693
785
|
const down = index.getAssetPath(`./assets/down.svg`);
|
|
786
|
+
const loading = index.getAssetPath(`./assets/spinner.gif`);
|
|
694
787
|
if (state.checkoutEdit) {
|
|
695
788
|
return index.h("hemfixarna-address", null);
|
|
696
789
|
}
|
|
@@ -700,12 +793,13 @@ const HemfixarnaCheckout = class {
|
|
|
700
793
|
else if (state.checkoutStep === 2) {
|
|
701
794
|
return (index.h("div", { class: "mb-2" }, index.h("div", { class: "hemfixarna_addressinfo" }, index.h("div", null, index.h("p", null, hideField(state.user.firstName)), index.h("p", null, hideField(state.user.lastName)), index.h("p", null, state.user.email), index.h("p", null, state.user.phone)), index.h("div", null, index.h("p", null, hideField(state.user.street)), index.h("p", null, hideField(state.user.zip)), index.h("p", null, hideField(state.user.town))), index.h("button", { onClick: () => (state.checkoutEdit = true) }, "Beh\u00F6ver du \u00E4ndra adressen?")), index.h("form", { onSubmit: e => this.handleSubmit(e) }, index.h("div", null, index.h("img", { src: dateLogo, width: 24 }), index.h("input", { class: `${this.date.length ? 'input_active' : ''}`, min: new Date().toISOString().split('T')[0], onChange: e => this.handleChangeDate(e), type: "date", name: "date", value: this.date }), index.h("label", { htmlFor: "date" }, "Tidigaste datum f\u00F6r hembes\u00F6k"), index.h("img", { src: down, width: 24 })), this.dateError && index.h("span", null, this.dateError), index.h("label", { class: "hemfixarna_checkbox" }, index.h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), index.h("span", { innerHTML: state.options.terms })), state.cart
|
|
702
795
|
.filter(i => i.terms_checkout && i.terms_show_checkbox)
|
|
703
|
-
.map(item => (index.h(index.Fragment, null, index.h("label", { class: "hemfixarna_checkbox" }, index.h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), index.h("span", null, item.terms_checkout))))), this.generalError && index.h("span", null, this.generalError), index.h("input", { type: "submit", value:
|
|
796
|
+
.map(item => (index.h(index.Fragment, null, index.h("label", { class: "hemfixarna_checkbox" }, index.h("input", { onChange: () => this.handleChangeTerms(), type: "checkbox" }), index.h("span", null, item.terms_checkout))))), this.generalError && index.h("span", null, this.generalError), index.h("div", { class: this.loading ? 'loading' : '' }, index.h("input", { type: "submit", value: this.loading ? '' : 'Slutför Bokning' }), index.h("img", { width: 20, height: 20, src: loading, alt: "spinner" })))));
|
|
704
797
|
}
|
|
705
798
|
};
|
|
706
799
|
this.date = '';
|
|
707
800
|
this.dateError = null;
|
|
708
801
|
this.generalError = null;
|
|
802
|
+
this.loading = false;
|
|
709
803
|
}
|
|
710
804
|
componentWillLoad() {
|
|
711
805
|
if (Boolean(state.user && state.user.street)) {
|
|
@@ -715,7 +809,7 @@ const HemfixarnaCheckout = class {
|
|
|
715
809
|
get el() { return index.getElement(this); }
|
|
716
810
|
};
|
|
717
811
|
|
|
718
|
-
const hemfixarnaCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); *{box-sizing:border-box}:host{font-family:\"Inter\", sans-serif}:host .mb-2{margin-bottom:32px}:host button{color:#474444}:host form{display:flex;flex-direction:column;gap:16px}:host form img{position:absolute;top:50%;transform:translateY(-50%);pointer-events:none}:host form img:first-of-type{left:16px}:host form img:last-of-type{right:16px}:host form span{margin-top:-8px;color:#ec6632}:host form p{text-align:center}:host form p{margin:0}:host form div{position:relative}:host form div label{pointer-events:none;position:absolute;left:16px;top:50%;transform:translateY(-50%);background:#fff;padding:4px;transition:0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host form div input{padding:16px;width:100%;font-size:16px;border:1px solid #fcd9c9}:host form div input:focus~label,:host form div .input_active~label{top:0;transform:translateY(-50%);background:linear-gradient(180deg, #fffaf2 50%, #fff 50%)}:host h1{font-size:24px;font-weight:400;line-height:32px;letter-spacing:-3%;text-align:left;margin:0 0 8px}:host h2{margin:0 0 24px;font-weight:700;font-size:20px;line-height:28px;letter-spacing:-3%}:host p{font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna{width:100%;}:host .hemfixarna_nav{position:absolute;top:0;width:100dvw;left:0;height:80px;z-index:9999}:host .hemfixarna_nav--links{display:none !important}@media (min-width: 769px){:host .hemfixarna_nav--links{display:flex !important}}:host .hemfixarna_nav--links a{color:#ec6632;text-decoration:none;border:1px solid rgba(255, 255, 255, 0.3);border-radius:56px;padding:8px 32px;text-transform:capitalize}:host .hemfixarna_nav>div{position:relative;overflow:hidden;width:100%;height:100%;display:flex;justify-content:space-between;align-items:center;padding:0 16px}@media (min-width: 769px){:host .hemfixarna_nav>div{padding:0 32px}}:host .hemfixarna_nav>div>div{display:flex;gap:32px;justify-content:space-between}:host .hemfixarna_nav>div>img{position:absolute;width:100%;height:100%;top:0;left:0;z-index:-1}:host .hemfixarna_nav p{color:#fff}:host .hemfixarna_standalone .hemfixarna_backdrop{background:#fffaf2;opacity:1}:host .hemfixarna_standalone .hemfixarna_modal{top:80px;transform:translateX(-50%);border:none;height:calc(100dvh - 80px);opacity:0}:host .hemfixarna_standalone .hemfixarna_modal--open{opacity:1}:host .hemfixarna .switch{position:relative;display:inline-block;width:40px;height:20px}:host .hemfixarna .switch input{opacity:0;width:0;height:0}:host .hemfixarna .slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:0.4s;transition:0.4s;border-radius:34px}:host .hemfixarna .slider:before{position:absolute;content:\"\";height:18px;width:18px;left:2px;bottom:1px;background-color:white;-webkit-transition:0.4s;transition:0.4s;border-radius:50%}:host .hemfixarna input:checked+.slider{background-color:#fcd9c9}:host .hemfixarna input:focus+.slider{box-shadow:0 0 1px #fcd9c9}:host .hemfixarna input:checked+.slider:before{-webkit-transform:translateX(18px);-ms-transform:translateX(18px);transform:translateX(18px);background:#ec6632}:host .hemfixarna_checkbox{display:grid;grid-template-columns:40px auto;font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna_checkbox>span{transform:translateY(6px)}:host .hemfixarna_checkbox span,:host .hemfixarna_checkbox span p{color:#474444;font-size:14px}:host .hemfixarna_checkbox p{text-align:left}:host .hemfixarna_info{display:flex;flex-direction:column;gap:24px;padding:32px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);border-radius:4px;border:1px solid #fcd9c9}:host .hemfixarna_info h2{margin:0}@media (min-width: 769px){:host .hemfixarna_info{position:sticky;top:0}}:host .hemfixarna_infomodal{position:absolute;top:40%;left:50%;transform:translate(-50%, -50%);width:100%;max-width:80%;background:#fffaf2;border:1px solid #fcd9c9;padding:32px;z-index:99;border-radius:4px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;flex-direction:column;gap:16px}:host .hemfixarna_infomodal p,:host .hemfixarna_infomodal h4{margin:0}:host .hemfixarna_infomodal button{background:#ec6632;color:#fff;border-radius:60px;font-size:16px;padding:8px 16px}:host .hemfixarna_addressinfo{padding:16px 16px 64px;border:1px solid #fcd9c9;position:relative;margin-bottom:32px;display:grid;grid-template-columns:1fr;gap:8px}@media (min-width: 769px){:host .hemfixarna_addressinfo{grid-template-columns:1fr 1fr}}:host .hemfixarna_addressinfo button{position:absolute;bottom:16px;right:16px;font-weight:500;text-underline-offset:2px;text-decoration:underline}:host .hemfixarna_part{background:#fff;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:grid;padding:16px;grid-template-columns:auto 75px}:host .hemfixarna_counter{display:flex;align-items:center}:host .hemfixarna_counter span{padding:0 8px}:host .hemfixarna_counter img{cursor:pointer}:host .hemfixarna_counter img:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_description{display:grid;gap:16px}:host .hemfixarna_description ul{list-style:disc;padding-right:12px;transform:translateX(12px)}:host .hemfixarna_description--hidden{max-height:140px;overflow:hidden;position:relative;cursor:pointer}:host .hemfixarna_description--hidden::after{content:\"\";position:absolute;bottom:0;left:0;right:0;height:128px;background:linear-gradient(180deg, rgba(255, 253, 250, 0), rgba(255, 253, 250, 0.46) 50%, #fffaf2)}:host .hemfixarna_terms{font-size:14px}:host .hemfixarna_terms a{color:inherit}:host .hemfixarna_logo{height:64px}:host .hemfixarna_box{padding:16px;display:flex;align-items:center;justify-content:space-between;background:#fffaf2;border:1px solid #fcd9c9;width:100%;box-sizing:border-box;border-radius:4px;gap:16px 8px}:host .hemfixarna_box>div{display:grid;gap:8px}:host .hemfixarna_btn,:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{border:none;border-radius:60px;font-weight:600;letter-spacing:0.5px;line-height:20px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_btn:not(.disabled):hover,:host .hemfixarna_buy:not(.disabled):hover,:host .hemfixarna input[type=submit]:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_btn{font-size:14px;background:#c84e18;color:#fff;padding:16px 24px;white-space:nowrap;position:relative}:host .hemfixarna_btn span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-8px;right:-12px}:host .hemfixarna_btn span{background:#25a710;color:#fff;right:0 !important}:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{font-size:21px;background:#25a710;color:#fff;padding:16px 24px}:host .hemfixarna .disabled{opacity:0.5;cursor:default}:host .hemfixarna_modal{position:fixed;background:#fffaf2;border:1px solid #fcd9c9;border-radius:4px;top:50%;left:50%;z-index:1000;transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);transform:translate(-50%, -50%) scale(0.7);opacity:0;height:92%;width:92%;max-width:920px;display:flex;flex-direction:column;gap:8px}:host .hemfixarna_modal--open{opacity:1;transform:translate(-50%, -50%) scale(1)}:host .hemfixarna_backdrop{z-index:999;position:fixed;background:#474444;top:0;left:0;bottom:0;right:0;opacity:0;transition:transform 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946), opacity 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host .hemfixarna_backdrop--open{opacity:0.3}:host .hemfixarna_order{position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;background-repeat:no-repeat !important;background-size:cover !important;background-position:center !important;display:grid;grid-template-columns:1fr 1fr;padding:48px 32px 64px}@media (max-width: 768px){:host .hemfixarna_order{grid-template-columns:1fr;grid-template-rows:0 auto}}:host .hemfixarna_order>div:last-of-type{background:#fffaf2;padding:32px;display:flex;flex-direction:column;max-height:100%;overflow:auto}:host .hemfixarna_order img{cursor:pointer}:host .hemfixarna_order button{margin:16px 0;padding:0;text-decoration:underline;text-underline-offset:2px;font-size:14px;font-weight:600}:host .hemfixarna_cart{display:grid;grid-template-columns:1fr 1fr;gap:32px}@media (max-width: 768px){:host .hemfixarna_cart{grid-template-columns:1fr;gap:0}}:host .hemfixarna_cart--right h2,:host .hemfixarna_cart--left h2{display:flex;align-items:center}:host .hemfixarna_cart--right h2 img,:host .hemfixarna_cart--left h2 img{margin-top:3.2px}@media (min-width: 769px){:host .hemfixarna_cart--left h2 button{display:none}}@media (max-width: 768px){:host .hemfixarna_cart--right h2 button{display:none}}:host .hemfixarna_cart--startfee{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot div{display:flex;gap:16px;align-items:center}:host .hemfixarna_cart--additional{display:flex;flex-direction:column;gap:16px;padding:16px;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--additional p{font-size:14px}:host .hemfixarna_cart--additional strong{text-decoration:underline;text-underline-offset:2px;cursor:pointer;position:relative}:host .hemfixarna_cart--additional strong img{position:absolute;top:50%;transform:translateY(-50%);right:-24px}:host .hemfixarna_cart--price{border-top:1px solid #fcd9c9;padding:16px;display:flex;justify-content:space-between}:host .hemfixarna_cart--price h3{margin:0}:host .hemfixarna_cart--item{display:flex;flex-direction:column;gap:8px;padding:16px 0;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--item>div{display:flex;justify-content:space-between}:host .hemfixarna_cart--item>div>div{display:flex;align-items:center;gap:16px}:host .hemfixarna_cart--item>div button{color:#ec6632}:host .hemfixarna_categories{display:grid;gap:24px}:host .hemfixarna_categories--wrapper{gap:32px;display:grid;grid-template-columns:1fr 1fr}@media (max-width: 768px){:host .hemfixarna_categories--wrapper{grid-template-columns:1fr}}:host .hemfixarna_categories li{position:relative;background:#fff;border-radius:4px;min-height:132px;padding:24px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;align-items:center;gap:24px;cursor:pointer}:host .hemfixarna_categories li:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_categories li>button{height:100%;width:100%}:host .hemfixarna_categories li .price{font-weight:700}:host .hemfixarna_content{height:100%;overflow:auto;padding:0 32px 64px}:host .hemfixarna_content--5{padding-top:16px}:host .hemfixarna_crumbs{position:relative;padding:16px 24px;border-bottom:1px solid #fcd9c9;display:flex;justify-content:space-between}:host .hemfixarna_crumbs--back{padding:16px 24px 8px;display:flex;align-items:center;gap:8px;box-shadow:none !important}:host .hemfixarna_crumbs--back:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs img{cursor:pointer}:host .hemfixarna_crumbs .close{position:absolute;right:-16px;top:-16px;z-index:9}:host .hemfixarna_crumbs .cart{padding-left:16px;position:relative}:host .hemfixarna_crumbs .cart img{cursor:inherit}:host .hemfixarna_crumbs .cart span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-8px;right:-12px}:host .hemfixarna_crumbs .cart_active{cursor:pointer}:host .hemfixarna_crumbs .cart_active span{background:#25a710;color:#fff}:host .hemfixarna_crumbs--links{display:flex;align-items:center;gap:16px;overflow:auto}@media (min-width: 769px){:host .hemfixarna_crumbs--links{-ms-overflow-style:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar{display:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar-button{display:none}}:host .hemfixarna_crumbs button{white-space:nowrap;background:#f1ded6;border-radius:64px;padding:12px 16px;font-size:12px;font-weight:600;letter-spacing:0.3px;box-shadow:none !important}:host .hemfixarna_crumbs button:not(.active):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs .active{background:#fffaf2;cursor:default}:host .hemfixarna_features{gap:12px !important}:host .hemfixarna_features li{display:flex;gap:16px;align-items:center}:host .hemfixarna_address{margin-bottom:16px}:host .hemfixarna_product{display:grid;gap:16px}:host .hemfixarna_product--link{font-weight:700;color:#474444;text-underline-offset:4px}:host .hemfixarna_product--left{gap:32px}:host .hemfixarna_product--right{gap:32px}:host .hemfixarna_product--price{margin-top:4px;font-weight:700}:host .hemfixarna_product--total{text-align:center;margin:-16px 0;font-size:21px;line-height:28px}:host .hemfixarna_product--item{background:#fff;padding:16px;display:grid;grid-template-columns:auto 75px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_product--grid{display:grid;grid-template-columns:1fr 1fr;gap:32px}@media (max-width: 768px){:host .hemfixarna_product--grid{grid-template-columns:1fr}}:host .hemfixarna_product--grid>div{display:flex;flex-direction:column}:host .hemfixarna_product--grid ul{display:flex;flex-direction:column;gap:4px}:host .hemfixarna_product p{margin:0}:host .hemfixarna_product--top{display:flex;gap:32px}:host .hemfixarna_product--top>div{width:100%}:host .hemfixarna_product--top>div h1{max-width:80%}@media (max-width: 768px){:host .hemfixarna_product--top>div h1{max-width:100%}}:host .hemfixarna_product--top h4{margin-bottom:8px}:host h5,:host p{margin:0}:host input[type=submit]{cursor:pointer}:host input[type=date]~label{left:56px}:host input[type=date]{border:1px solid #fcd9c9;padding-left:64px}:host input[type=checkbox]{height:18px;width:18px;border:1px solid #fcd9c9}:host input[type=checkbox]:checked{background:red}:host input[type=date]::-webkit-calendar-picker-indicator{background:transparent;bottom:0;color:transparent;cursor:pointer;height:auto;left:0;position:absolute;right:0;top:0;width:auto}:host button,:host a{cursor:pointer;background:none;border:none}:host ul{list-style:none;margin:0;padding:0}";
|
|
812
|
+
const hemfixarnaCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); *{box-sizing:border-box}:host{font-family:\"Inter\", sans-serif}:host .mb-2{margin-bottom:32px}:host button{color:#474444}:host form{display:flex;flex-direction:column;gap:16px}:host form img{position:absolute;top:50%;transform:translateY(-50%);pointer-events:none}:host form img:first-of-type{left:16px}:host form img:last-of-type{right:16px}:host form span{margin-top:-8px;color:#ec6632}:host form p{text-align:center}:host form p{margin:0}:host form div{position:relative}:host form div label{pointer-events:none;position:absolute;left:16px;top:50%;transform:translateY(-50%);background:#fff;padding:4px;transition:0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host form div input{padding:16px;width:100%;font-size:16px;border:1px solid #fcd9c9}:host form div input:focus~label,:host form div .input_active~label{top:0;transform:translateY(-50%);background:linear-gradient(180deg, #fffaf2 50%, #fff 50%)}:host h1{font-size:24px;font-weight:400;line-height:32px;letter-spacing:-3%;text-align:left;margin:0 0 8px}:host h2{margin:0 0 24px;font-weight:700;font-size:20px;line-height:28px;letter-spacing:-3%}:host p{font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna{width:100%;}:host .hemfixarna_nav{position:absolute;top:0;width:100dvw;left:0;height:80px;z-index:9999}:host .hemfixarna_nav--links{display:none !important}@media (min-width: 769px){:host .hemfixarna_nav--links{display:flex !important}}:host .hemfixarna_nav--links a{color:#ec6632;text-decoration:none;border:1px solid rgba(255, 255, 255, 0.3);border-radius:56px;padding:8px 32px;text-transform:capitalize}:host .hemfixarna_nav>div{position:relative;overflow:hidden;width:100%;height:100%;display:flex;justify-content:space-between;align-items:center;padding:0 16px}@media (min-width: 769px){:host .hemfixarna_nav>div{padding:0 32px}}:host .hemfixarna_nav>div>div{display:flex;gap:32px;justify-content:space-between}:host .hemfixarna_nav>div>img{position:absolute;width:100%;height:100%;top:0;left:0;z-index:-1}:host .hemfixarna_nav p{color:#fff}:host .hemfixarna_standalone .hemfixarna_backdrop{background:#fffaf2;opacity:1}:host .hemfixarna_standalone .hemfixarna_modal{top:80px;transform:translateX(-50%);border:none;height:calc(100dvh - 80px);opacity:0}:host .hemfixarna_standalone .hemfixarna_modal--open{opacity:1}:host .hemfixarna .switch{position:relative;display:inline-block;width:40px;height:20px}:host .hemfixarna .switch input{opacity:0;width:0;height:0}:host .hemfixarna .slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:0.4s;transition:0.4s;border-radius:34px}:host .hemfixarna .slider:before{position:absolute;content:\"\";height:18px;width:18px;left:2px;bottom:1px;background-color:white;-webkit-transition:0.4s;transition:0.4s;border-radius:50%}:host .hemfixarna input:checked+.slider{background-color:#fcd9c9}:host .hemfixarna input:focus+.slider{box-shadow:0 0 1px #fcd9c9}:host .hemfixarna input:checked+.slider:before{-webkit-transform:translateX(18px);-ms-transform:translateX(18px);transform:translateX(18px);background:#ec6632}:host .hemfixarna_checkbox{display:grid;grid-template-columns:40px auto;font-size:16px;font-weight:400;line-height:24px;letter-spacing:-3%}:host .hemfixarna_checkbox>span{transform:translateY(6px)}:host .hemfixarna_checkbox span,:host .hemfixarna_checkbox span p{color:#474444;font-size:14px}:host .hemfixarna_checkbox p{text-align:left}:host .hemfixarna_info{display:flex;flex-direction:column;gap:24px;padding:32px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);border-radius:4px;border:1px solid #fcd9c9}:host .hemfixarna_info h2{margin:0}@media (min-width: 769px){:host .hemfixarna_info{position:sticky;top:0}}:host .hemfixarna_infomodal{position:absolute;top:40%;left:50%;transform:translate(-50%, -50%);width:100%;max-width:80%;background:#fffaf2;border:1px solid #fcd9c9;padding:32px;z-index:99;border-radius:4px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;flex-direction:column;gap:16px}:host .hemfixarna_infomodal p,:host .hemfixarna_infomodal h4{margin:0}:host .hemfixarna_infomodal button{background:#ec6632;color:#fff;border-radius:60px;font-size:16px;padding:8px 16px}:host .hemfixarna_addressinfo{padding:16px 16px 64px;border:1px solid #fcd9c9;position:relative;margin-bottom:32px;display:grid;grid-template-columns:1fr;gap:8px}@media (min-width: 769px){:host .hemfixarna_addressinfo{grid-template-columns:1fr 1fr}}:host .hemfixarna_addressinfo button{position:absolute;bottom:16px;right:16px;font-weight:500;text-underline-offset:2px;text-decoration:underline}:host .hemfixarna_part{background:#fff;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:grid;padding:16px;grid-template-columns:auto 75px}:host .hemfixarna_counter{display:flex;align-items:center}:host .hemfixarna_counter span{padding:0 8px}:host .hemfixarna_counter img{cursor:pointer}:host .hemfixarna_counter img:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_description{display:grid;gap:16px}:host .hemfixarna_description ul{list-style:disc;padding-right:12px;transform:translateX(12px)}:host .hemfixarna_description--hidden{max-height:140px;overflow:hidden;position:relative;cursor:pointer}:host .hemfixarna_description--hidden::after{content:\"\";position:absolute;bottom:0;left:0;right:0;height:128px;background:linear-gradient(180deg, rgba(255, 253, 250, 0), rgba(255, 253, 250, 0.46) 50%, #fffaf2)}:host .hemfixarna_terms{font-size:14px}:host .hemfixarna_terms a{color:inherit}:host .hemfixarna_logo{height:64px}:host .hemfixarna_box{padding:16px;display:flex;align-items:center;width:100%;box-sizing:border-box;border-radius:4px;gap:16px 8px;border-radius:4px;gap:16px 8px}:host .hemfixarna_box p,:host .hemfixarna_box span{font-size:15px}:host .hemfixarna_box .underline{text-decoration:underline;text-underline-offset:2px}:host .hemfixarna_box .pointer{cursor:pointer}:host .hemfixarna_box .p-s{font-size:12px}:host .hemfixarna_box>div{display:grid;gap:8px}:host .hemfixarna_box--standard{background:#fffaf2;border:1px solid #fcd9c9}:host .hemfixarna_box--alternative,:host .hemfixarna_box--alternative_2,:host .hemfixarna_box--alternative_3{background:transparent;border:1px solid #e3e3e3}:host .hemfixarna_box--alternative_2,:host .hemfixarna_box--alternative_3{box-shadow:0px 2px 16px 0px rgba(0, 0, 0, 0.0784313725)}:host .hemfixarna_box--alternative_3{justify-content:center}:host .hemfixarna_altbtn{display:flex !important;flex-direction:column;gap:8px;align-items:center;margin-left:auto}:host .hemfixarna_btn{margin-left:auto}:host .hemfixarna_btn,:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{border:none;border-radius:60px;font-weight:600;letter-spacing:0.5px;line-height:20px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_btn:not(.disabled):hover,:host .hemfixarna_buy:not(.disabled):hover,:host .hemfixarna input[type=submit]:not(.disabled):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna div:has(>input[type=submit]){position:relative}:host .hemfixarna div:has(>input[type=submit]) input{cursor:initial}:host .hemfixarna div:has(>input[type=submit]) img{display:none}:host .hemfixarna .loading{cursor:default;opacity:0.6}:host .hemfixarna .loading>img{display:initial !important;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}:host .hemfixarna_btn{font-size:14px;background:#c84e18;color:#fff;padding:16px 24px;white-space:nowrap;position:relative}:host .hemfixarna_btn span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-8px;right:-12px}:host .hemfixarna_btn span{background:#25a710;color:#fff;right:0 !important}:host .hemfixarna_buy,:host .hemfixarna input[type=submit]{font-size:21px;background:#25a710;color:#fff;padding:16px 24px}:host .hemfixarna .disabled{opacity:0.5;cursor:default}:host .hemfixarna_modal{position:fixed;background:#fffaf2;border:1px solid #fcd9c9;border-radius:4px;top:50%;left:50%;z-index:1000;transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);transform:translate(-50%, -50%) scale(0.7);opacity:0;height:92%;width:92%;max-width:920px;display:flex;flex-direction:column;gap:8px}:host .hemfixarna_modal--open{opacity:1;transform:translate(-50%, -50%) scale(1)}:host .hemfixarna_backdrop{z-index:999;position:fixed;background:#474444;top:0;left:0;bottom:0;right:0;opacity:0;transition:transform 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946), opacity 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946)}:host .hemfixarna_backdrop--open{opacity:0.3}:host .hemfixarna_order{position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;background-repeat:no-repeat !important;background-size:cover !important;background-position:center !important;display:grid;grid-template-columns:1fr 1fr;padding:48px 32px 64px}@media (max-width: 768px){:host .hemfixarna_order{grid-template-columns:1fr;grid-template-rows:0 auto}}:host .hemfixarna_order>div:last-of-type{background:#fffaf2;padding:32px;display:flex;flex-direction:column;max-height:100%;overflow:auto}:host .hemfixarna_order img{cursor:pointer}:host .hemfixarna_order button{margin:16px 0;padding:0;text-decoration:underline;text-underline-offset:2px;font-size:14px;font-weight:600}:host .hemfixarna_cart{display:grid;grid-template-columns:1fr 1fr;gap:32px}@media (max-width: 768px){:host .hemfixarna_cart{grid-template-columns:1fr;gap:0}}:host .hemfixarna_cart--right h2,:host .hemfixarna_cart--left h2{display:flex;align-items:center}:host .hemfixarna_cart--right h2 img,:host .hemfixarna_cart--left h2 img{margin-top:3.2px}@media (min-width: 769px){:host .hemfixarna_cart--left h2 button{display:none}}@media (max-width: 768px){:host .hemfixarna_cart--right h2 button{display:none}}:host .hemfixarna_cart--startfee{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot{display:flex;justify-content:space-between}:host .hemfixarna_cart--rutrot div{display:flex;gap:16px;align-items:center}:host .hemfixarna_cart--additional{display:flex;flex-direction:column;gap:16px;padding:16px;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--additional p{font-size:14px}:host .hemfixarna_cart--additional strong{text-decoration:underline;text-underline-offset:2px;cursor:pointer;position:relative}:host .hemfixarna_cart--additional strong img{position:absolute;top:50%;transform:translateY(-50%);right:-24px}:host .hemfixarna_cart--price{border-top:1px solid #fcd9c9;padding:16px;display:flex;justify-content:space-between}:host .hemfixarna_cart--price h3{margin:0}:host .hemfixarna_cart--item{display:flex;flex-direction:column;gap:8px;padding:16px 0;border-top:1px solid #fcd9c9}:host .hemfixarna_cart--item>div{display:flex;justify-content:space-between}:host .hemfixarna_cart--item>div>div{display:flex;align-items:center;gap:16px}:host .hemfixarna_cart--item>div button{color:#ec6632}:host .hemfixarna_categories{display:grid;gap:24px}:host .hemfixarna_categories--wrapper{gap:32px;display:grid;grid-template-columns:1fr 1fr}@media (max-width: 768px){:host .hemfixarna_categories--wrapper{grid-template-columns:1fr}}:host .hemfixarna_categories li{position:relative;background:#fff;border-radius:4px;min-height:132px;padding:24px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);display:flex;align-items:center;gap:24px;cursor:pointer}:host .hemfixarna_categories li:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_categories li>button{height:100%;width:100%}:host .hemfixarna_categories li .price{font-weight:700}:host .hemfixarna_content{height:100%;overflow:auto;padding:0 32px 64px}:host .hemfixarna_content--5{padding-top:16px}:host .hemfixarna_crumbs{position:relative;padding:16px 24px;border-bottom:1px solid #fcd9c9;display:flex;justify-content:space-between}:host .hemfixarna_crumbs--back{padding:16px 24px 8px;display:flex;align-items:center;gap:8px;box-shadow:none !important}:host .hemfixarna_crumbs--back:hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs img{cursor:pointer}:host .hemfixarna_crumbs .close{position:absolute;right:-16px;top:-16px;z-index:9}:host .hemfixarna_crumbs .cart{padding-left:16px;position:relative}:host .hemfixarna_crumbs .cart img{cursor:inherit}:host .hemfixarna_crumbs .cart span{position:absolute;background:#fff;border-radius:100%;width:24px;height:24px;display:flex;justify-content:center;align-items:center;font-weight:600;font-size:13px;line-height:11px;top:-8px;right:-12px}:host .hemfixarna_crumbs .cart_active{cursor:pointer}:host .hemfixarna_crumbs .cart_active span{background:#25a710;color:#fff}:host .hemfixarna_crumbs--links{display:flex;align-items:center;gap:16px;overflow:auto}@media (min-width: 769px){:host .hemfixarna_crumbs--links{-ms-overflow-style:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar{display:none}:host .hemfixarna_crumbs--links::-webkit-scrollbar-button{display:none}}:host .hemfixarna_crumbs button{white-space:nowrap;background:#f1ded6;border-radius:64px;padding:12px 16px;font-size:12px;font-weight:600;letter-spacing:0.3px;box-shadow:none !important}:host .hemfixarna_crumbs button:not(.active):hover{transition:0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);filter:brightness(1.02);transform:scale(1.01);box-shadow:0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_crumbs .active{background:#fffaf2;cursor:default}:host .hemfixarna_features{gap:12px !important}:host .hemfixarna_features li{display:flex;gap:16px;align-items:center}:host .hemfixarna_address{margin-bottom:16px}:host .hemfixarna_product{display:grid;gap:16px}:host .hemfixarna_product--link{font-weight:700;color:#474444;text-underline-offset:4px}:host .hemfixarna_product--left{gap:32px}:host .hemfixarna_product--right{gap:32px}:host .hemfixarna_product--price{margin-top:4px;font-weight:700}:host .hemfixarna_product--total{text-align:center;margin:-16px 0;font-size:21px;line-height:28px}:host .hemfixarna_product--item{background:#fff;padding:16px;display:grid;grid-template-columns:auto 75px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863)}:host .hemfixarna_product--grid{display:grid;grid-template-columns:1fr 1fr;gap:32px}@media (max-width: 768px){:host .hemfixarna_product--grid{grid-template-columns:1fr}}:host .hemfixarna_product--grid>div{display:flex;flex-direction:column}:host .hemfixarna_product--grid ul{display:flex;flex-direction:column;gap:4px}:host .hemfixarna_product p{margin:0}:host .hemfixarna_product--top{display:flex;gap:32px}:host .hemfixarna_product--top>div{width:100%}:host .hemfixarna_product--top>div h1{max-width:80%}@media (max-width: 768px){:host .hemfixarna_product--top>div h1{max-width:100%}}:host .hemfixarna_product--top h4{margin-bottom:8px}:host h5,:host p{margin:0}:host input[type=submit]{cursor:pointer}:host input[type=date]~label{left:56px}:host input[type=date]{border:1px solid #fcd9c9;padding-left:64px}:host input[type=checkbox]{height:18px;width:18px;border:1px solid #fcd9c9}:host input[type=checkbox]:checked{background:red}:host input[type=date]::-webkit-calendar-picker-indicator{background:transparent;bottom:0;color:transparent;cursor:pointer;height:auto;left:0;position:absolute;right:0;top:0;width:auto}:host button,:host a{cursor:pointer;background:none;border:none}:host ul{list-style:none;margin:0;padding:0}";
|
|
719
813
|
|
|
720
814
|
const HemfixarnaComponent = class {
|
|
721
815
|
constructor(hostRef) {
|
|
@@ -741,7 +835,10 @@ const HemfixarnaComponent = class {
|
|
|
741
835
|
this.forceOldTree = false;
|
|
742
836
|
this.loadFromQuery = false;
|
|
743
837
|
this.isDemo = false;
|
|
838
|
+
this.widgetStyle = undefined;
|
|
744
839
|
this.nav = undefined;
|
|
840
|
+
this.buttonColor = undefined;
|
|
841
|
+
this.buttonBg = undefined;
|
|
745
842
|
}
|
|
746
843
|
loadCategoryOrProduct(id) {
|
|
747
844
|
this.proppedProduct = null;
|
|
@@ -804,6 +901,10 @@ const HemfixarnaComponent = class {
|
|
|
804
901
|
if (user) {
|
|
805
902
|
state.user = JSON.parse(user);
|
|
806
903
|
}
|
|
904
|
+
const creditSafeUser = window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);
|
|
905
|
+
if (creditSafeUser) {
|
|
906
|
+
state.creditSafeUser = JSON.parse(creditSafeUser);
|
|
907
|
+
}
|
|
807
908
|
const [tree, res, options, rut, rot] = await Promise.all([
|
|
808
909
|
this.topCategory ? getTaxonomy(this.topCategory) : null,
|
|
809
910
|
this.slug ? getTaxonomy(this.slug) : Promise.resolve(null),
|
|
@@ -913,11 +1014,15 @@ const HemfixarnaComponent = class {
|
|
|
913
1014
|
return state.cart.reduce((acc, curr) => acc + curr.amount, 0);
|
|
914
1015
|
}
|
|
915
1016
|
render() {
|
|
916
|
-
var _a, _b, _c, _d, _e;
|
|
1017
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
917
1018
|
const logo = index.getAssetPath(`./assets/hemfixarna.svg`);
|
|
1019
|
+
const monteringLogo = index.getAssetPath(`./assets/montering.svg`);
|
|
918
1020
|
const navBackground = ((_a = this.nav) === null || _a === void 0 ? void 0 : _a.background) ? index.getAssetPath(this.nav.background) : '';
|
|
919
1021
|
const navLogo = ((_b = this.nav) === null || _b === void 0 ? void 0 : _b.logo) ? index.getAssetPath(this.nav.logo) : '';
|
|
920
|
-
return (index.h("div", { class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` }, this.loadFromQuery && !this.isDemo && this.nav ? (index.h("nav", { class: "hemfixarna_nav" }, index.h("div", null, index.h("div", { class: "hemfixarna_nav--logos" }, index.h("a", { href: this.nav.url, target: "_blank" }, index.h("img", { src: navLogo, alt: `${this.business} logo` })), index.h("a", { href: "https://hemfixarna.se/", target: "_blank" }, index.h("p", null, "I samarbete med:"), index.h("img", { src: logo, alt: "hemfixarna_logo", width: 104 }))), index.h("div", { class: "hemfixarna_nav--links" }, index.h("a", { href: this.nav.url, target: "_blank" }, "Till ", this.business), index.h("a", { href: "https://www.hemfixarna.se/", target: "_blank" }, "Till Hemfixarna")), index.h("img", { src: navBackground, alt: "nav_background" })))) : null, !this.loadFromQuery || this.isDemo ? (index.h("div", { class:
|
|
1022
|
+
return (index.h("div", { class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` }, this.loadFromQuery && !this.isDemo && this.nav ? (index.h("nav", { class: "hemfixarna_nav" }, index.h("div", null, index.h("div", { class: "hemfixarna_nav--logos" }, index.h("a", { href: this.nav.url, target: "_blank" }, index.h("img", { src: navLogo, alt: `${this.business} logo` })), index.h("a", { href: "https://hemfixarna.se/", target: "_blank" }, index.h("p", null, "I samarbete med:"), index.h("img", { src: logo, alt: "hemfixarna_logo", width: 104 }))), index.h("div", { class: "hemfixarna_nav--links" }, index.h("a", { href: this.nav.url, target: "_blank" }, "Till ", this.business), index.h("a", { href: "https://www.hemfixarna.se/", target: "_blank" }, "Till Hemfixarna")), index.h("img", { src: navBackground, alt: "nav_background" })))) : null, !this.loadFromQuery || this.isDemo ? (index.h("div", { class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` }, [WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? index.h("img", { src: monteringLogo, alt: "montering logo", width: 32, height: 32 }) : null, index.h("div", null, index.h("div", null, index.h("p", { onClick: () => this.openModal(), class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}` }, ((_c = this.product) === null || _c === void 0 ? void 0 : _c.post_title) || ((_d = this.proppedProduct) === null || _d === void 0 ? void 0 : _d.post_title) || (index.h("span", null, "Montering", index.h("wbr", null), "/Installation ", (_f = (_e = state.selectedCustomerCategory) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : 'på plats', " - ", index.h("strong", { class: "underline" }, "se priser h\u00E4r"))), (this.product && ((_g = this.slug) === null || _g === void 0 ? void 0 : _g.includes('product'))) || this.proppedProduct ? (index.h("span", null, ' från', " ", index.h("strong", null, getProductPriceWithRotAndRut(this.proppedProduct || this.product), "kr"))) : null)), this.widgetStyle === WidgetStyle.standard ? index.h("img", { src: logo, width: 104 }) : null, this.widgetStyle === WidgetStyle.alternative ? (index.h("span", { class: "p-s" }, "Utf\u00F6rs av ", index.h("strong", null, "Hemfixarna"))) : null), [WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (index.h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn", style: {
|
|
1023
|
+
color: this.buttonColor.startsWith('#') || !this.buttonColor.length ? this.buttonColor : `#${this.buttonColor}`,
|
|
1024
|
+
backgroundColor: this.buttonBg.startsWith('#') || !this.buttonBg.length ? this.buttonBg : `#${this.buttonBg}`,
|
|
1025
|
+
} }, "Best\u00E4ll h\u00E4r", this.getCartLength() > 0 && index.h("span", null, this.getCartLength()))) : null, WidgetStyle.alternative_2 === this.widgetStyle ? (index.h("div", { class: "hemfixarna_altbtn" }, index.h("strong", { class: "p-s" }, "Utf\u00F6rs av"), index.h("img", { src: logo, alt: "hemfixarna logo", width: 98 }))) : null)) : null, this.modal && (index.h("div", null, index.h("div", { class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` }, state.modal && (index.h("div", { class: "hemfixarna_infomodal" }, state.modal.title && index.h("h2", null, state.modal.title), state.modal.text.map((t) => (index.h("p", { innerHTML: t }))), index.h("div", null, index.h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), (this.tree || state.customer) && (index.h("hemfixarna-breadcrumbs", { isDemo: this.isDemo, loadFromQuery: this.loadFromQuery, closeModal: () => this.closeModal(), tree: this.tree })), !state.customer || this.slugIsOldFormat(this.slug) ? (index.h("div", { class: `hemfixarna_content hemfixarna_content--${state.step}` }, state.step === 1 && this.tree && index.h("hemfixarna-start", { tree: this.tree }), state.step === 2 && state.selectedCategory && index.h("hemfixarna-category", null), state.step === 3 && state.selectedService && index.h("hemfixarna-service", null), state.step === 4 && state.selectedProduct && index.h("hemfixarna-product", null), state.step === 5 && index.h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && index.h("hemfixarna-order", { tree: this.tree }))) : (index.h("div", { class: `hemfixarna_content hemfixarna_content--${state.step}` }, state.step < 4 && index.h("hemfixarna-start", null), state.step === 4 && state.selectedProduct && index.h("hemfixarna-product", null), state.step === 5 && index.h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && index.h("hemfixarna-order", { tree: this.tree })))), !this.isDemo ? index.h("div", { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` }) : null))));
|
|
921
1026
|
}
|
|
922
1027
|
static get assetsDirs() { return ["assets"]; }
|
|
923
1028
|
get el() { return index.getElement(this); }
|
|
@@ -928,26 +1033,74 @@ const HemfixarnaComponent = class {
|
|
|
928
1033
|
};
|
|
929
1034
|
HemfixarnaComponent.style = hemfixarnaCss;
|
|
930
1035
|
|
|
931
|
-
const hemfixarnaDemoCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); :host{font-family:\"Inter\", sans-serif}:host .hemfixarna_example{margin-bottom:16px;background:#000;padding:16px;color:#fff;display:flex;justify-content:space-between;cursor:pointer;max-width:500px;box-sizing:border-box;position:relative}:host .hemfixarna_example--tooltip{background:#000;top:-48px;font-size:16px;left:40%;color:white;padding:8px;position:absolute;opacity:0}:host .hemfixarna_example--tooltip::after{content:\"\";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}:host .hemfixarna_example:hover .hemfixarna_example--tooltip{opacity:1}:host .hemfixarna_example p{font-size:14px}:host .hemfixarna_example img{filter:invert(1)}:host .hemfixarna_install{display:grid;gap:8px;margin-top:16px}:host .hemfixarna_product--label{background:#e1e0f5}:host .hemfixarna_categories{max-height:100%;overflow:auto;position:relative}:host .hemfixarna_categories--label{display:flex;align-items:center;justify-content:space-between;padding:8px}:host .hemfixarna_categories--label button{background:#3f3a92;border:none;font-weight:600;padding:3.2px 9.6px;border-radius:10px;margin-right:8px;color:#ece8e8}:host .hemfixarna_categories--label button:active{transform:scale(0.95)}:host .hemfixarna_categories--label--big{font-weight:600;border-bottom:1px solid black}:host p{margin:0}:host span{color:darkolivegreen;font-size:10px}:host button{cursor:pointer}:host>div{display:grid;gap:32px;width:100%;grid-template-columns:1fr 1fr;height:100vh;place-items:center;overflow:hidden;padding:16px 32px;box-sizing:border-box}:host>div>*{width:100%}:host>div>div{max-width:500px}:host>div ul{margin:0;padding:0;list-style:none}:host>div ul ul{gap:1px;display:grid}:host>div ul li{padding-left:16px;background:#fff}";
|
|
1036
|
+
const hemfixarnaDemoCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\"); :host{font-family:\"Inter\", sans-serif}:host .hemfixarna_widgetstyles label{cursor:pointer}:host .hemfixarna_widgetstyles>div{display:flex;gap:1rem}:host .hemfixarna_widgetstyles h5{margin:1rem 0}:host .hemfixarna_example{margin-bottom:16px;background:#000;padding:16px;color:#fff;display:flex;justify-content:space-between;cursor:pointer;max-width:500px;box-sizing:border-box;position:relative}:host .hemfixarna_example--tooltip{background:#000;top:-48px;font-size:16px;left:40%;color:white;padding:8px;position:absolute;opacity:0}:host .hemfixarna_example--tooltip::after{content:\"\";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}:host .hemfixarna_example:hover .hemfixarna_example--tooltip{opacity:1}:host .hemfixarna_example p{font-size:14px}:host .hemfixarna_example img{filter:invert(1)}:host .hemfixarna_install{display:grid;gap:8px;margin-top:16px}:host .hemfixarna_product--label{background:#e1e0f5}:host .hemfixarna_categories{max-height:100%;overflow:auto;position:relative}:host .hemfixarna_categories--label{display:flex;align-items:center;justify-content:space-between;padding:8px}:host .hemfixarna_categories--label button{background:#3f3a92;border:none;font-weight:600;padding:3.2px 9.6px;border-radius:10px;margin-right:8px;color:#ece8e8}:host .hemfixarna_categories--label button:active{transform:scale(0.95)}:host .hemfixarna_categories--label--big{font-weight:600;border-bottom:1px solid black}:host p{margin:0}:host span{color:darkolivegreen;font-size:10px}:host button{cursor:pointer}:host>div{display:grid;gap:32px;width:100%;grid-template-columns:1fr 1fr;height:100vh;place-items:center;overflow:hidden;padding:16px 32px;box-sizing:border-box}:host>div>*{width:100%}:host>div>div{max-width:500px}:host>div ul{margin:0;padding:0;list-style:none}:host>div ul ul{gap:1px;display:grid}:host>div ul li{padding-left:16px;background:#fff}";
|
|
932
1037
|
|
|
933
1038
|
const MyComponent$4 = class {
|
|
934
1039
|
constructor(hostRef) {
|
|
935
1040
|
index.registerInstance(this, hostRef);
|
|
1041
|
+
this.debounce = null;
|
|
936
1042
|
this.cdnLink = '<script type="module" src="https://cdn.jsdelivr.net/npm//hemfixarna-web-components@latest/dist/hemfixarna-components/hemfixarna-components.esm.js"></script>';
|
|
937
1043
|
this.selectedSlug = undefined;
|
|
938
1044
|
this.selectedID = undefined;
|
|
939
1045
|
this.tooltipText = 'Kopiera till urklipp';
|
|
940
1046
|
this.tree = null;
|
|
941
1047
|
this.customer = null;
|
|
1048
|
+
this.widgetStyle = WidgetStyle.standard;
|
|
1049
|
+
this.buttonBg = '';
|
|
1050
|
+
this.buttonColor = '';
|
|
1051
|
+
this.colorAccessibility = undefined;
|
|
1052
|
+
}
|
|
1053
|
+
debouncedFunction() {
|
|
1054
|
+
if (this.debounce !== null) {
|
|
1055
|
+
clearTimeout(this.debounce);
|
|
1056
|
+
this.debounce = null;
|
|
1057
|
+
}
|
|
1058
|
+
this.debounce = window.setTimeout(() => {
|
|
1059
|
+
this.checkColorAccessibility();
|
|
1060
|
+
this.debounce = null;
|
|
1061
|
+
}, 1500);
|
|
1062
|
+
}
|
|
1063
|
+
async checkColorAccessibility() {
|
|
1064
|
+
const defaultTextColor = '#fff';
|
|
1065
|
+
const defaultBgColor = '#c84e18';
|
|
1066
|
+
const firstColor = this.buttonBg.length ? (this.buttonBg.startsWith('#') ? this.buttonBg : `#${this.buttonBg}`) : defaultBgColor;
|
|
1067
|
+
const secondColor = this.buttonColor.length ? (this.buttonColor.startsWith('#') ? this.buttonColor : `#${this.buttonColor}`) : defaultTextColor;
|
|
1068
|
+
fetch('https://www.aremycolorsaccessible.com/api/are-they', {
|
|
1069
|
+
mode: 'cors',
|
|
1070
|
+
method: 'POST',
|
|
1071
|
+
body: JSON.stringify({ colors: [firstColor, secondColor] }),
|
|
1072
|
+
})
|
|
1073
|
+
.then(response => response.json())
|
|
1074
|
+
.then(json => {
|
|
1075
|
+
console.log(json);
|
|
1076
|
+
if (json && (json)) {
|
|
1077
|
+
this.colorAccessibility = json;
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
// Your color accessibility logic here
|
|
942
1081
|
}
|
|
943
1082
|
getTopLevelCategory() {
|
|
944
|
-
switch ("
|
|
1083
|
+
switch ("byggmax") {
|
|
945
1084
|
case Business.byggmax:
|
|
946
1085
|
return TopCategory.byggmax;
|
|
947
1086
|
default:
|
|
948
1087
|
return '';
|
|
949
1088
|
}
|
|
950
1089
|
}
|
|
1090
|
+
getColor(rating) {
|
|
1091
|
+
switch (rating) {
|
|
1092
|
+
case 'AAA':
|
|
1093
|
+
return 'green';
|
|
1094
|
+
case 'AA':
|
|
1095
|
+
return 'orange';
|
|
1096
|
+
case 'A':
|
|
1097
|
+
return 'yellow';
|
|
1098
|
+
case 'Fail':
|
|
1099
|
+
return 'red';
|
|
1100
|
+
default:
|
|
1101
|
+
return 'black';
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
951
1104
|
async componentWillLoad() {
|
|
952
1105
|
if (process.env.FORCE_OLD_TREE) {
|
|
953
1106
|
const tree = await getTaxonomy(this.getTopLevelCategory());
|
|
@@ -957,14 +1110,14 @@ const MyComponent$4 = class {
|
|
|
957
1110
|
}
|
|
958
1111
|
}
|
|
959
1112
|
else {
|
|
960
|
-
const customer = await getCustomer("
|
|
1113
|
+
const customer = await getCustomer("byggmax");
|
|
961
1114
|
if (customer.code !== 'not_found' && customer) {
|
|
962
1115
|
this.customer = customer;
|
|
963
1116
|
}
|
|
964
1117
|
}
|
|
965
1118
|
}
|
|
966
1119
|
getExample() {
|
|
967
|
-
return `<hemfixarna-${"
|
|
1120
|
+
return `<hemfixarna-${"byggmax"}${this.selectedSlug ? ` slug="${this.selectedSlug}" ` : ''}${this.selectedID ? ` id="${this.selectedID}" ` : ''} ${this.widgetStyle === WidgetStyle.standard ? '' : `widgetStyle="${this.widgetStyle}"`} ${this.buttonColor.length ? `buttonColor="${this.buttonColor}"` : ''} ${this.buttonBg.length ? `buttonBg="${this.buttonBg}"` : ''}></hemfixarna-${"byggmax"}>`;
|
|
968
1121
|
}
|
|
969
1122
|
copyExample() {
|
|
970
1123
|
navigator.clipboard.writeText(this.getExample());
|
|
@@ -989,9 +1142,13 @@ const MyComponent$4 = class {
|
|
|
989
1142
|
}
|
|
990
1143
|
render() {
|
|
991
1144
|
const copy = index.getAssetPath(`./assets/copy.png`);
|
|
992
|
-
return (index.h("div", null, index.h("div", null, index.h("div", { onClick: () => this.copyExample(), class: "hemfixarna_example" }, index.h("p", null, this.getExample()), index.h("img", { src: copy, height: 20 }), index.h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText)), "
|
|
993
|
-
c.sub_categories.map(sc => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label" }, index.h("div", null, index.h("p", null, sc.name), index.h("span", null, `c-${sc.id}`)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(`c-${sc.id}`) }, "Kopiera ID"), index.h("button", { onClick: () => (this.selectedID = `c-${sc.id}`) }, "Ladda kategori"))), index.h("ul", null, sc.products.map(p => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, index.h("div", null, index.h("p", null, p.fields.post_title), index.h("span", null, p.fields.ID)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), index.h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt"))))))))))))))))) : (index.h("div", null, this.tree.sub_cats.map(c => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, index.h("div", null, index.h("p", null, c.name), index.h("span", null, `category/${c.slug}`)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(`category/${c.slug}`) }, "Kopiera slug"), index.h("button", { onClick: () => (this.selectedSlug = `category/${c.slug}`) }, "Ladda kategori"))), index.h("ul", null, c.services.map(sc => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label" }, index.h("div", null, index.h("p", null, sc.post_title), index.h("span", null, `service/${sc.post_name}`)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(`service/${sc.post_name}`) }, "Kopiera slug"), index.h("button", { onClick: () => (this.selectedSlug = `service/${sc.post_name}`) }, "Ladda kategori"))), index.h("ul", null, sc.products.map(sc => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label" }, index.h("div", null, index.h("p", null, sc.post_title), index.h("span", null, `product/${sc.post_name}`)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(`product/${sc.post_name}`) }, "Kopiera slug"), index.h("button", { onClick: () => (this.selectedSlug = `product/${sc.post_name}`) }, "Ladda kategori")))))))))))))))))));
|
|
1145
|
+
return (index.h("div", null, index.h("div", null, index.h("div", { onClick: () => this.copyExample(), class: "hemfixarna_example" }, index.h("p", null, this.getExample()), index.h("img", { src: copy, height: 20 }), index.h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText)), "byggmax" === Business.byggmax && (index.h("hemfixarna-byggmax", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, forceOldTree: Boolean(process.env.FORCE_OLD_TREE), slug: this.selectedSlug, id: this.selectedID })), "byggmax" === Business.skanska && (index.h("hemfixarna-skanska", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), "byggmax" === Business.string && (index.h("hemfixarna-string-furniture", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), "byggmax" === Business.hornbach && (index.h("hemfixarna-hornbach", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, isDemo: true, id: this.selectedID })), "byggmax" === Business.kund && (index.h("hemfixarna-kund", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), index.h("div", { class: "hemfixarna_install" }, index.h("div", { onClick: () => this.copyCdn(), class: "hemfixarna_example" }, index.h("p", null, this.cdnLink), index.h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText), index.h("img", { src: copy, height: 20 }))), index.h("div", { class: "hemfixarna_widgetstyles" }, index.h("h5", null, "Widget styles"), index.h("div", null, Object.values(WidgetStyle).map(style => (index.h("label", { key: style }, index.h("input", { type: "radio", value: style, checked: this.widgetStyle === style, onChange: () => (this.widgetStyle = style) }), style)))), index.h("div", null, index.h("div", null, index.h("h5", null, "Button background color"), index.h("input", { type: "text", value: this.buttonBg, onInput: e => (this.buttonBg = e.target.value) })), index.h("div", null, index.h("h5", null, "Button text color"), index.h("input", { type: "text", value: this.buttonColor, onInput: e => (this.buttonColor = e.target.value) })))), index.h("span", null, "Write an hexa code no # needed"), this.colorAccessibility ? (index.h("div", null, index.h("h5", null, "Tillg\u00E4nglighetsrapport"), index.h("div", null, index.h("strong", null, "Liten text:"), index.h("span", { style: { color: this.getColor(this.colorAccessibility.small) } }, this.colorAccessibility.small), index.h("br", null), index.h("strong", null, "Fet text:"), index.h("span", { style: { color: this.getColor(this.colorAccessibility.bold) } }, this.colorAccessibility.bold), index.h("br", null), index.h("strong", null, "Stor text:"), index.h("span", { style: { color: this.getColor(this.colorAccessibility.large) } }, this.colorAccessibility.large), index.h("br", null), index.h("strong", null, "Kontrastf\u00F6rh\u00E5llande:"), " ", this.colorAccessibility.contrast))) : null), index.h("ul", { class: "hemfixarna_categories" }, this.customer ? (index.h("div", null, this.customer.categories.map(c => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, index.h("div", null, index.h("p", null, c.name), index.h("span", null, `c-${c.id}`)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(`c-${c.id}`) }, "Kopiera ID"), index.h("button", { onClick: () => (this.selectedID = `c-${c.id}`) }, "Ladda kategori"))), c.show_products && c.products ? (index.h("ul", null, c.products.map(p => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, index.h("div", null, index.h("p", null, p.fields.post_title), index.h("span", null, p.fields.ID)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), index.h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt")))))))) : (index.h("ul", null, c.sub_categories &&
|
|
1146
|
+
c.sub_categories.map(sc => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label" }, index.h("div", null, index.h("p", null, sc.name), index.h("span", null, `c-${sc.id}`)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(`c-${sc.id}`) }, "Kopiera ID"), index.h("button", { onClick: () => (this.selectedID = `c-${sc.id}`) }, "Ladda kategori"))), index.h("ul", null, sc.products.map(p => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, index.h("div", null, index.h("p", null, p.fields.post_title), index.h("span", null, p.fields.ID)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), index.h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt"))))))))))))))))) : this.tree ? (index.h("div", null, this.tree.sub_cats.map(c => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, index.h("div", null, index.h("p", null, c.name), index.h("span", null, `category/${c.slug}`)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(`category/${c.slug}`) }, "Kopiera slug"), index.h("button", { onClick: () => (this.selectedSlug = `category/${c.slug}`) }, "Ladda kategori"))), index.h("ul", null, c.services.map(sc => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label" }, index.h("div", null, index.h("p", null, sc.post_title), index.h("span", null, `service/${sc.post_name}`)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(`service/${sc.post_name}`) }, "Kopiera slug"), index.h("button", { onClick: () => (this.selectedSlug = `service/${sc.post_name}`) }, "Ladda kategori"))), index.h("ul", null, sc.products.map(sc => (index.h("li", null, index.h("div", { class: "hemfixarna_categories--label" }, index.h("div", null, index.h("p", null, sc.post_title), index.h("span", null, `product/${sc.post_name}`)), index.h("div", null, index.h("button", { onClick: () => navigator.clipboard.writeText(`product/${sc.post_name}`) }, "Kopiera slug"), index.h("button", { onClick: () => (this.selectedSlug = `product/${sc.post_name}`) }, "Ladda kategori")))))))))))))))) : null)));
|
|
994
1147
|
}
|
|
1148
|
+
static get watchers() { return {
|
|
1149
|
+
"buttonBg": ["debouncedFunction"],
|
|
1150
|
+
"buttonColor": ["debouncedFunction"]
|
|
1151
|
+
}; }
|
|
995
1152
|
};
|
|
996
1153
|
MyComponent$4.style = hemfixarnaDemoCss;
|
|
997
1154
|
|
|
@@ -1666,7 +1823,7 @@ const HemfixarnaGetuser = class {
|
|
|
1666
1823
|
if (!validEmail) {
|
|
1667
1824
|
this.emailError = 'Ange en giltig e-postadress';
|
|
1668
1825
|
}
|
|
1669
|
-
const validPhone = this.phone
|
|
1826
|
+
const validPhone = /^[\d\s()+-]{6,}$/.test(this.phone);
|
|
1670
1827
|
if (!validPhone) {
|
|
1671
1828
|
this.phoneError = 'Ange ett giltigt telefonnummer';
|
|
1672
1829
|
}
|
|
@@ -1680,12 +1837,11 @@ const HemfixarnaGetuser = class {
|
|
|
1680
1837
|
}
|
|
1681
1838
|
if (validEmail && validPhone && validssn) {
|
|
1682
1839
|
try {
|
|
1683
|
-
const
|
|
1684
|
-
if (
|
|
1840
|
+
const creditSafeData = await apiSearch(this.ssn);
|
|
1841
|
+
if (creditSafeData) {
|
|
1842
|
+
state.creditSafeUser = creditSafeData;
|
|
1685
1843
|
state.checkoutStep = 2;
|
|
1686
|
-
state.user = Object.assign(Object.assign({},
|
|
1687
|
-
const el = this.el.closest('.hemfixarna_content');
|
|
1688
|
-
scrollToTop(el);
|
|
1844
|
+
state.user = Object.assign(Object.assign({}, creditSafeData), { email: this.email, phone: this.phone, ssn: this.ssn });
|
|
1689
1845
|
}
|
|
1690
1846
|
else {
|
|
1691
1847
|
this.ssnError = 'Vi kunde tyvärr inte hitta en address med ditt angivna personnummer';
|
|
@@ -1695,6 +1851,10 @@ const HemfixarnaGetuser = class {
|
|
|
1695
1851
|
this.ssnError = 'Vi kunde tyvärr inte hitta en address med ditt angivna personnummer';
|
|
1696
1852
|
console.log(e);
|
|
1697
1853
|
}
|
|
1854
|
+
finally {
|
|
1855
|
+
const el = this.el.closest('.hemfixarna_content');
|
|
1856
|
+
scrollToTop(el);
|
|
1857
|
+
}
|
|
1698
1858
|
}
|
|
1699
1859
|
};
|
|
1700
1860
|
this.render = () => {
|
|
@@ -1725,9 +1885,12 @@ const MyComponent$3 = class {
|
|
|
1725
1885
|
this.id = undefined;
|
|
1726
1886
|
this.loadFromQuery = true;
|
|
1727
1887
|
this.isDemo = false;
|
|
1888
|
+
this.widgetStyle = WidgetStyle.standard;
|
|
1889
|
+
this.buttonColor = undefined;
|
|
1890
|
+
this.buttonBg = undefined;
|
|
1728
1891
|
}
|
|
1729
1892
|
render() {
|
|
1730
|
-
return (index.h("hemfixarna-component", { nav: { url: 'https://www.hornbach.se/', logo: 'assets/hornbach/logo.svg', background: './assets/hornbach/nav.jpg' }, isDemo: this.isDemo, loadFromQuery: this.loadFromQuery, id: this.id, business: Business.hornbach }));
|
|
1893
|
+
return (index.h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, nav: { url: 'https://www.hornbach.se/', logo: 'assets/hornbach/logo.svg', background: './assets/hornbach/nav.jpg' }, isDemo: this.isDemo, loadFromQuery: this.loadFromQuery, id: this.id, business: Business.hornbach }));
|
|
1731
1894
|
}
|
|
1732
1895
|
};
|
|
1733
1896
|
MyComponent$3.style = hemfixarnaHornbachCss;
|
|
@@ -1756,9 +1919,12 @@ const MyComponent$2 = class {
|
|
|
1756
1919
|
index.registerInstance(this, hostRef);
|
|
1757
1920
|
this.id = undefined;
|
|
1758
1921
|
this.loadFromQuery = false;
|
|
1922
|
+
this.widgetStyle = WidgetStyle.standard;
|
|
1923
|
+
this.buttonColor = undefined;
|
|
1924
|
+
this.buttonBg = undefined;
|
|
1759
1925
|
}
|
|
1760
1926
|
render() {
|
|
1761
|
-
return index.h("hemfixarna-component", { loadFromQuery: this.loadFromQuery, id: this.id, business: Business.kund });
|
|
1927
|
+
return (index.h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, loadFromQuery: this.loadFromQuery, id: this.id, business: Business.kund }));
|
|
1762
1928
|
}
|
|
1763
1929
|
};
|
|
1764
1930
|
|
|
@@ -1979,9 +2145,12 @@ const MyComponent$1 = class {
|
|
|
1979
2145
|
this.id = undefined;
|
|
1980
2146
|
this.customer = undefined;
|
|
1981
2147
|
this.loadFromQuery = false;
|
|
2148
|
+
this.widgetStyle = WidgetStyle.standard;
|
|
2149
|
+
this.buttonColor = undefined;
|
|
2150
|
+
this.buttonBg = undefined;
|
|
1982
2151
|
}
|
|
1983
2152
|
render() {
|
|
1984
|
-
return index.h("hemfixarna-component", { loadFromQuery: this.loadFromQuery, id: this.id, business: Business.skanska });
|
|
2153
|
+
return (index.h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, loadFromQuery: this.loadFromQuery, id: this.id, business: Business.skanska }));
|
|
1985
2154
|
}
|
|
1986
2155
|
};
|
|
1987
2156
|
MyComponent$1.style = hemfixarnaSkanskaCss;
|
|
@@ -2018,9 +2187,12 @@ const MyComponent = class {
|
|
|
2018
2187
|
index.registerInstance(this, hostRef);
|
|
2019
2188
|
this.id = undefined;
|
|
2020
2189
|
this.loadFromQuery = false;
|
|
2190
|
+
this.widgetStyle = WidgetStyle.standard;
|
|
2191
|
+
this.buttonColor = undefined;
|
|
2192
|
+
this.buttonBg = undefined;
|
|
2021
2193
|
}
|
|
2022
2194
|
render() {
|
|
2023
|
-
return index.h("hemfixarna-component", { loadFromQuery: this.loadFromQuery, id: this.id, business: Business.string });
|
|
2195
|
+
return (index.h("hemfixarna-component", { widgetStyle: this.widgetStyle, buttonBg: this.buttonBg, buttonColor: this.buttonColor, loadFromQuery: this.loadFromQuery, id: this.id, business: Business.string }));
|
|
2024
2196
|
}
|
|
2025
2197
|
};
|
|
2026
2198
|
MyComponent.style = hemfixarnaStringCss;
|