hemfixarna-web-components 1.6.2 → 1.6.3
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_36.cjs.entry.js +2763 -0
- package/dist/{hemfixarna-components/index-f1a87cf1.js.map → cjs/hemfixarna-address_36.cjs.entry.js.map} +1 -1
- package/dist/cjs/hemfixarna-components.cjs.js +28 -0
- package/dist/cjs/hemfixarna-components.cjs.js.map +1 -0
- package/dist/cjs/index-b83343b9.js +1687 -0
- package/dist/cjs/index-b83343b9.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +24 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/assets/back.svg +3 -0
- package/dist/collection/assets/cart.svg +10 -0
- package/dist/collection/assets/checked.svg +10 -0
- package/dist/collection/assets/close.svg +5 -0
- package/dist/collection/assets/copy.png +0 -0
- package/dist/collection/assets/date.svg +6 -0
- package/dist/collection/assets/down.svg +3 -0
- package/dist/collection/assets/drag-drop.svg +3 -0
- package/dist/collection/assets/elfa.png +0 -0
- package/dist/collection/assets/gubbe-pensel.svg +1 -0
- package/dist/collection/assets/hemfixarna.svg +11 -0
- package/dist/collection/assets/hornbach/logo.svg +42 -0
- package/dist/collection/assets/hornbach/nav.jpg +0 -0
- package/dist/collection/assets/info.svg +5 -0
- package/dist/collection/assets/kbygg.svg +29 -0
- package/dist/collection/assets/minus.svg +4 -0
- package/dist/collection/assets/montering.svg +15 -0
- package/dist/collection/assets/norrgavel.svg +1 -0
- package/dist/collection/assets/pensel.svg +1 -0
- package/dist/collection/assets/plus.svg +5 -0
- package/dist/collection/assets/spinner.gif +0 -0
- package/dist/collection/assets/tesla.svg +1 -0
- package/dist/collection/assets/zaptec.svg +1 -0
- package/dist/collection/collection-manifest.json +47 -0
- package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.css +0 -0
- package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js +184 -0
- package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.css +0 -0
- package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js +123 -0
- package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.css +0 -0
- package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js +142 -0
- package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js +132 -0
- package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js +132 -0
- package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.css +0 -0
- package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js +123 -0
- package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.css +0 -0
- package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js +142 -0
- package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js +132 -0
- package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js +113 -0
- package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js +113 -0
- package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js +132 -0
- package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js +131 -0
- package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.css +0 -0
- package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js +141 -0
- package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js +131 -0
- package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js +123 -0
- package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string.css +0 -0
- package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js +113 -0
- package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js +132 -0
- package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js +113 -0
- package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js.map +1 -0
- package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js +132 -0
- package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-address.entry.js → collection/components/hemfixarna-address/hemfixarna-address.js} +20 -14
- package/dist/collection/components/hemfixarna-address/hemfixarna-address.js.map +1 -0
- package/dist/collection/components/hemfixarna-box/hemfixarna-box.js +138 -0
- package/dist/collection/components/hemfixarna-box/hemfixarna-box.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-breadcrumbs.entry.js → collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js} +84 -13
- package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-cart.entry.js → collection/components/hemfixarna-cart/hemfixarna-cart.js} +31 -11
- package/dist/collection/components/hemfixarna-cart/hemfixarna-cart.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-category.entry.js → collection/components/hemfixarna-category.tsx/hemfixarna-category.js} +6 -12
- package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-checkout.entry.js → collection/components/hemfixarna-checkout/hemfixarna-checkout.js} +27 -32
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +483 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -0
- package/dist/collection/components/hemfixarna-component/hemfixarna.css +1031 -0
- package/dist/{hemfixarna-components/hemfixarna-contact.entry.js → collection/components/hemfixarna-contact/hemfixarna-contact.js} +28 -10
- package/dist/collection/components/hemfixarna-contact/hemfixarna-contact.js.map +1 -0
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.css +135 -0
- package/dist/{hemfixarna-components/hemfixarna-demo.entry.js → collection/components/hemfixarna-demo/hemfixarna-demo.js} +46 -23
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -0
- package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js +91 -0
- package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-info.entry.js → collection/components/hemfixarna-info/hemfixarna-info.js} +7 -11
- package/dist/collection/components/hemfixarna-info/hemfixarna-info.js.map +1 -0
- package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.css +76 -0
- package/dist/{hemfixarna-components/hemfixarna-invoice.entry.js → collection/components/hemfixarna-invoice/hemfixarna-invoice.js} +27 -16
- package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-order.entry.js → collection/components/hemfixarna-order/hemfixarna-order.js} +31 -11
- package/dist/collection/components/hemfixarna-order/hemfixarna-order.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-orderrows.entry.js → collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js} +50 -12
- package/dist/collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js.map +1 -0
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.css +0 -0
- package/dist/{hemfixarna-components/hemfixarna-product.entry.js → collection/components/hemfixarna-product/hemfixarna-product.js} +27 -18
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-service.entry.js → collection/components/hemfixarna-service/hemfixarna-service.js} +6 -12
- package/dist/collection/components/hemfixarna-service/hemfixarna-service.js.map +1 -0
- package/dist/{hemfixarna-components/hemfixarna-start.entry.js → collection/components/hemfixarna-start/hemfixarna-start.js} +48 -11
- package/dist/collection/components/hemfixarna-start/hemfixarna-start.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/store/index.js +62 -0
- package/dist/collection/store/index.js.map +1 -0
- package/dist/collection/types/felixtypes.js +3 -0
- package/dist/collection/types/felixtypes.js.map +1 -0
- package/dist/{hemfixarna-components/index-d90ad11b.js → collection/types/index.js} +4 -7
- package/dist/collection/types/index.js.map +1 -0
- package/dist/{hemfixarna-components/api-36f73d0d.js → collection/utils/api.js} +4 -6
- package/dist/collection/utils/api.js.map +1 -0
- package/dist/{hemfixarna-components/calc-4c79b798.js → collection/utils/calc.js} +3 -6
- package/dist/collection/utils/calc.js.map +1 -0
- package/dist/collection/utils/creditSafe.js +18 -0
- package/dist/collection/utils/creditSafe.js.map +1 -0
- package/dist/collection/utils/felixApi.js +18 -0
- package/dist/collection/utils/felixApi.js.map +1 -0
- package/dist/collection/utils/felixFunctions.js +189 -0
- package/dist/collection/utils/felixFunctions.js.map +1 -0
- package/dist/{hemfixarna-components/form-c53dca29.js → collection/utils/form.js} +2 -4
- package/dist/collection/utils/form.js.map +1 -0
- package/dist/{hemfixarna-components/scroll-6c26b5da.js → collection/utils/scroll.js} +2 -4
- package/dist/collection/utils/scroll.js.map +1 -0
- package/dist/{hemfixarna-components/types-641c9a1c.js → collection/utils/types.js} +3 -6
- package/dist/collection/utils/types.js.map +1 -0
- package/dist/esm/hemfixarna-address_36.entry.js +2724 -0
- package/dist/esm/hemfixarna-address_36.entry.js.map +1 -0
- package/dist/esm/hemfixarna-components.js +23 -0
- package/dist/esm/hemfixarna-components.js.map +1 -0
- package/dist/esm/index-8c417125.js +1656 -0
- package/dist/esm/index-8c417125.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +20 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -162
- package/dist/hemfixarna-components/hemfixarna-components.esm.js.map +1 -1
- package/dist/hemfixarna-components/index.esm.js +0 -1
- package/dist/hemfixarna-components/index.esm.js.map +1 -1
- package/dist/hemfixarna-components/p-852e7173.js +3 -0
- package/dist/hemfixarna-components/p-852e7173.js.map +1 -0
- package/dist/hemfixarna-components/p-97461831.entry.js +2 -0
- package/dist/hemfixarna-components/p-97461831.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/dist/hemfixarna-components/api-36f73d0d.js.map +0 -1
- package/dist/hemfixarna-components/app-globals-0f993ce5.js +0 -5
- package/dist/hemfixarna-components/app-globals-0f993ce5.js.map +0 -1
- package/dist/hemfixarna-components/calc-4c79b798.js.map +0 -1
- package/dist/hemfixarna-components/css-shim-62d2171c.js +0 -6
- package/dist/hemfixarna-components/css-shim-62d2171c.js.map +0 -1
- package/dist/hemfixarna-components/dom-46a68c9b.js +0 -75
- package/dist/hemfixarna-components/dom-46a68c9b.js.map +0 -1
- package/dist/hemfixarna-components/form-c53dca29.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-address.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-box.entry.js +0 -49
- package/dist/hemfixarna-components/hemfixarna-box.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js +0 -27
- package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-cart.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-category.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-checkout.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-component.entry.js +0 -248
- package/dist/hemfixarna-components/hemfixarna-component.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-contact.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-demo.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-doro.entry.js +0 -23
- package/dist/hemfixarna-components/hemfixarna-doro.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-elfa.entry.js +0 -24
- package/dist/hemfixarna-components/hemfixarna-elfa.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-fargvaruhuset.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-fargvaruhuset.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-flyttsmart.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-flyttsmart.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-forebygg.entry.js +0 -23
- package/dist/hemfixarna-components/hemfixarna-forebygg.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-getuser.entry.js +0 -770
- package/dist/hemfixarna-components/hemfixarna-getuser.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-hornbach.entry.js +0 -24
- package/dist/hemfixarna-components/hemfixarna-hornbach.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-info.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-invoice.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-kbygg.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-kbygg.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-klint.entry.js +0 -20
- package/dist/hemfixarna-components/hemfixarna-klint.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-kund.entry.js +0 -20
- package/dist/hemfixarna-components/hemfixarna-kund.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-norrgavel.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-norrgavel.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-order.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-orderrows.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-power.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-power.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-product.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-service.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-skanska.entry.js +0 -24
- package/dist/hemfixarna-components/hemfixarna-skanska.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-sparfonster.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-sparfonster.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-start.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-string-furniture.entry.js +0 -23
- package/dist/hemfixarna-components/hemfixarna-string-furniture.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-superfront.entry.js +0 -20
- package/dist/hemfixarna-components/hemfixarna-superfront.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-tesla.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-tesla.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-traningspartner.entry.js +0 -20
- package/dist/hemfixarna-components/hemfixarna-traningspartner.entry.js.map +0 -1
- package/dist/hemfixarna-components/hemfixarna-zaptec.entry.js +0 -21
- package/dist/hemfixarna-components/hemfixarna-zaptec.entry.js.map +0 -1
- package/dist/hemfixarna-components/index-b6a6e994.js +0 -256
- package/dist/hemfixarna-components/index-b6a6e994.js.map +0 -1
- package/dist/hemfixarna-components/index-d90ad11b.js.map +0 -1
- package/dist/hemfixarna-components/index-f1a87cf1.js +0 -3397
- package/dist/hemfixarna-components/scroll-6c26b5da.js.map +0 -1
- package/dist/hemfixarna-components/shadow-css-05e0c1f4.js +0 -389
- package/dist/hemfixarna-components/shadow-css-05e0c1f4.js.map +0 -1
- package/dist/hemfixarna-components/types-641c9a1c.js.map +0 -1
@@ -1,163 +1,2 @@
|
|
1
|
-
import
|
2
|
-
export { s as setNonce } from './index-f1a87cf1.js';
|
3
|
-
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
4
|
-
|
5
|
-
/*
|
6
|
-
Stencil Client Patch Browser v3.2.1 | MIT Licensed | https://stenciljs.com
|
7
|
-
*/
|
8
|
-
/**
|
9
|
-
* Helper method for querying a `meta` tag that contains a nonce value
|
10
|
-
* out of a DOM's head.
|
11
|
-
*
|
12
|
-
* @param doc The DOM containing the `head` to query against
|
13
|
-
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
14
|
-
* exists or the tag has no content.
|
15
|
-
*/
|
16
|
-
function queryNonceMetaTagContent(doc) {
|
17
|
-
var _a, _b, _c;
|
18
|
-
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
19
|
-
}
|
20
|
-
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
21
|
-
const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
|
22
|
-
const patchBrowser = () => {
|
23
|
-
// NOTE!! This fn cannot use async/await!
|
24
|
-
if (BUILD.isDev && !BUILD.isTesting) {
|
25
|
-
consoleDevInfo('Running in development mode.');
|
26
|
-
}
|
27
|
-
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
28
|
-
if (BUILD.cssVarShim) {
|
29
|
-
// shim css vars
|
30
|
-
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
31
|
-
plt.$cssShim$ = win.__cssshim;
|
32
|
-
}
|
33
|
-
if (BUILD.cloneNodeFix) {
|
34
|
-
// opted-in to polyfill cloneNode() for slot polyfilled components
|
35
|
-
patchCloneNodeFix(H.prototype);
|
36
|
-
}
|
37
|
-
if (BUILD.profile && !performance.mark) {
|
38
|
-
// not all browsers support performance.mark/measure (Safari 10)
|
39
|
-
// because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,
|
40
|
-
// simply stub the implementations out.
|
41
|
-
// TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)
|
42
|
-
// @ts-ignore
|
43
|
-
performance.mark = performance.measure = () => {
|
44
|
-
/*noop*/
|
45
|
-
};
|
46
|
-
performance.getEntriesByName = () => [];
|
47
|
-
}
|
48
|
-
// @ts-ignore
|
49
|
-
const scriptElm =
|
50
|
-
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
51
|
-
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
52
|
-
BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim
|
53
|
-
? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
|
54
|
-
s.getAttribute('data-stencil-namespace') === NAMESPACE)
|
55
|
-
: null;
|
56
|
-
const importMeta = import.meta.url;
|
57
|
-
const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};
|
58
|
-
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
59
|
-
if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {
|
60
|
-
// Safari < v11 support: This IF is true if it's Safari below v11.
|
61
|
-
// This fn cannot use async/await since Safari didn't support it until v11,
|
62
|
-
// however, Safari 10 did support modules. Safari 10 also didn't support "nomodule",
|
63
|
-
// so both the ESM file and nomodule file would get downloaded. Only Safari
|
64
|
-
// has 'onbeforeload' in the script, and "history.scrollRestoration" was added
|
65
|
-
// to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.
|
66
|
-
// IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.
|
67
|
-
return {
|
68
|
-
then() {
|
69
|
-
/* promise noop */
|
70
|
-
},
|
71
|
-
};
|
72
|
-
}
|
73
|
-
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
74
|
-
if (!BUILD.safari10 && importMeta !== '') {
|
75
|
-
opts.resourcesUrl = new URL('.', importMeta).href;
|
76
|
-
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
77
|
-
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
78
|
-
}
|
79
|
-
else if (BUILD.dynamicImportShim || BUILD.safari10) {
|
80
|
-
opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;
|
81
|
-
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
82
|
-
if (BUILD.dynamicImportShim) {
|
83
|
-
patchDynamicImport(opts.resourcesUrl, scriptElm);
|
84
|
-
}
|
85
|
-
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
86
|
-
if (BUILD.dynamicImportShim && !win.customElements) {
|
87
|
-
// module support, but no custom elements support (Old Edge)
|
88
|
-
// @ts-ignore
|
89
|
-
return import(/* webpackChunkName: "polyfills-dom" */ './dom-46a68c9b.js').then(() => opts);
|
90
|
-
}
|
91
|
-
}
|
92
|
-
return promiseResolve(opts);
|
93
|
-
};
|
94
|
-
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
95
|
-
const patchDynamicImport = (base, orgScriptElm) => {
|
96
|
-
const importFunctionName = getDynamicImportFunction(NAMESPACE);
|
97
|
-
try {
|
98
|
-
// test if this browser supports dynamic imports
|
99
|
-
// There is a caching issue in V8, that breaks using import() in Function
|
100
|
-
// By generating a random string, we can workaround it
|
101
|
-
// Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info
|
102
|
-
win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);
|
103
|
-
}
|
104
|
-
catch (e) {
|
105
|
-
// this shim is specifically for browsers that do support "esm" imports
|
106
|
-
// however, they do NOT support "dynamic" imports
|
107
|
-
// basically this code is for old Edge, v18 and below
|
108
|
-
const moduleMap = new Map();
|
109
|
-
win[importFunctionName] = (src) => {
|
110
|
-
var _a;
|
111
|
-
const url = new URL(src, base).href;
|
112
|
-
let mod = moduleMap.get(url);
|
113
|
-
if (!mod) {
|
114
|
-
const script = doc.createElement('script');
|
115
|
-
script.type = 'module';
|
116
|
-
script.crossOrigin = orgScriptElm.crossOrigin;
|
117
|
-
script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {
|
118
|
-
type: 'application/javascript',
|
119
|
-
}));
|
120
|
-
// Apply CSP nonce to the script tag if it exists
|
121
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
122
|
-
if (nonce != null) {
|
123
|
-
script.setAttribute('nonce', nonce);
|
124
|
-
}
|
125
|
-
mod = new Promise((resolve) => {
|
126
|
-
script.onload = () => {
|
127
|
-
resolve(win[importFunctionName].m);
|
128
|
-
script.remove();
|
129
|
-
};
|
130
|
-
});
|
131
|
-
moduleMap.set(url, mod);
|
132
|
-
doc.head.appendChild(script);
|
133
|
-
}
|
134
|
-
return mod;
|
135
|
-
};
|
136
|
-
}
|
137
|
-
};
|
138
|
-
const patchCloneNodeFix = (HTMLElementPrototype) => {
|
139
|
-
const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
|
140
|
-
HTMLElementPrototype.cloneNode = function (deep) {
|
141
|
-
if (this.nodeName === 'TEMPLATE') {
|
142
|
-
return nativeCloneNodeFn.call(this, deep);
|
143
|
-
}
|
144
|
-
const clonedNode = nativeCloneNodeFn.call(this, false);
|
145
|
-
const srcChildNodes = this.childNodes;
|
146
|
-
if (deep) {
|
147
|
-
for (let i = 0; i < srcChildNodes.length; i++) {
|
148
|
-
// Node.ATTRIBUTE_NODE === 2, and checking because IE11
|
149
|
-
if (srcChildNodes[i].nodeType !== 2) {
|
150
|
-
clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
|
151
|
-
}
|
152
|
-
}
|
153
|
-
}
|
154
|
-
return clonedNode;
|
155
|
-
};
|
156
|
-
};
|
157
|
-
|
158
|
-
patchBrowser().then(options => {
|
159
|
-
globalScripts();
|
160
|
-
return bootstrapLazy([["hemfixarna-cart",[[0,"hemfixarna-cart",{"tree":[16]}]]],["hemfixarna-category",[[0,"hemfixarna-category"]]],["hemfixarna-order",[[0,"hemfixarna-order",{"tree":[16]}]]],["hemfixarna-product",[[0,"hemfixarna-product",{"amount":[32],"hideDescription":[32]}]]],["hemfixarna-service",[[0,"hemfixarna-service"]]],["hemfixarna-start",[[0,"hemfixarna-start",{"tree":[16],"slug":[1]}]]],["hemfixarna-breadcrumbs",[[0,"hemfixarna-breadcrumbs",{"tree":[16],"closeModal":[16],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"]}]]],["hemfixarna-address",[[0,"hemfixarna-address",{"street":[32],"streetError":[32],"zip":[32],"zipError":[32],"town":[32],"townError":[32]}]]],["hemfixarna-getuser",[[0,"hemfixarna-getuser",{"email":[32],"emailError":[32],"phone":[32],"phoneError":[32],"ssn":[32],"ssnError":[32]}]]],["hemfixarna-checkout",[[0,"hemfixarna-checkout",{"date":[32],"dateError":[32],"generalError":[32],"loading":[32],"enteredPin":[32],"selectedSubSource":[32],"partnerOrderId":[32],"showSources":[32],"sellerID":[32],"RefferalID":[32]}]]],["hemfixarna-contact",[[0,"hemfixarna-contact",{"vertical":[4]}]]],["hemfixarna-invoice",[[0,"hemfixarna-invoice",{"formError":[32],"displayImages":[32],"formImages":[32],"formState":[32]}]]],["hemfixarna-orderrows",[[0,"hemfixarna-orderrows",{"cart":[4],"tree":[16]}]]],["hemfixarna-box",[[0,"hemfixarna-box",{"post":[16],"category":[16],"icon":[1],"postTitle":[1,"post-title"]}]]],["hemfixarna-info",[[0,"hemfixarna-info"]]],["hemfixarna-component",[[1,"hemfixarna-component",{"slug":[1],"id":[1],"business":[1],"topCategory":[1,"top-category"],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[4,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"nav":[16],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"modal":[32],"showModal":[32],"tree":[32],"product":[32],"proppedProduct":[32]},[[0,"click","handleClick"]]]]],["hemfixarna-byggmax",[[1,"hemfixarna-byggmax",{"slug":[1],"id":[1],"forceOldTree":[4,"force-old-tree"],"loadFromQuery":[1,"load-from-query"],"customer":[1],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"tree":[32]}]]],["hemfixarna-doro",[[1,"hemfixarna-doro",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-elfa",[[1,"hemfixarna-elfa",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}]]],["hemfixarna-fargvaruhuset",[[1,"hemfixarna-fargvaruhuset",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}]]],["hemfixarna-flyttsmart",[[1,"hemfixarna-flyttsmart",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}]]],["hemfixarna-forebygg",[[1,"hemfixarna-forebygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-hornbach",[[1,"hemfixarna-hornbach",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-kbygg",[[1,"hemfixarna-kbygg",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}]]],["hemfixarna-klint",[[1,"hemfixarna-klint",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-kund",[[1,"hemfixarna-kund",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-norrgavel",[[1,"hemfixarna-norrgavel",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"],"isDemo":[4,"is-demo"]}]]],["hemfixarna-power",[[1,"hemfixarna-power",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-skanska",[[1,"hemfixarna-skanska",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-sparfonster",[[1,"hemfixarna-sparfonster",{"id":[1],"customer":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-string-furniture",[[1,"hemfixarna-string-furniture",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-superfront",[[1,"hemfixarna-superfront",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-tesla",[[1,"hemfixarna-tesla",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-traningspartner",[[1,"hemfixarna-traningspartner",{"id":[1],"loadFromQuery":[1,"load-from-query"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-zaptec",[[1,"hemfixarna-zaptec",{"id":[1],"loadFromQuery":[1,"load-from-query"],"isDemo":[4,"is-demo"],"widgetStyle":[1,"widget-style"],"buttonColor":[1,"button-color"],"buttonBg":[1,"button-bg"]}]]],["hemfixarna-demo",[[1,"hemfixarna-demo",{"selectedSlug":[32],"selectedID":[32],"tooltipText":[32],"tree":[32],"customer":[32],"widgetStyle":[32],"buttonBg":[32],"buttonColor":[32],"partner":[32],"colorAccessibility":[32]}]]]], options);
|
161
|
-
});
|
162
|
-
|
1
|
+
import{p as o,b as t}from"./p-852e7173.js";export{s as setNonce}from"./p-852e7173.js";const e=()=>{const t=import.meta.url;const e={};if(t!==""){e.resourcesUrl=new URL(".",t).href}return o(e)};e().then((o=>t([["p-97461831",[[1,"hemfixarna-demo",{selectedSlug:[32],selectedID:[32],tooltipText:[32],tree:[32],customer:[32],widgetStyle:[32],buttonBg:[32],buttonColor:[32],partner:[32],colorAccessibility:[32]}],[1,"hemfixarna-byggmax",{slug:[1],id:[1],forceOldTree:[4,"force-old-tree"],loadFromQuery:[1,"load-from-query"],customer:[1],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"],tree:[32]}],[1,"hemfixarna-doro",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-elfa",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"],isDemo:[4,"is-demo"]}],[1,"hemfixarna-fargvaruhuset",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"],isDemo:[4,"is-demo"]}],[1,"hemfixarna-flyttsmart",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"],isDemo:[4,"is-demo"]}],[1,"hemfixarna-forebygg",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-hornbach",{id:[1],loadFromQuery:[1,"load-from-query"],isDemo:[4,"is-demo"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-kbygg",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"],isDemo:[4,"is-demo"]}],[1,"hemfixarna-klint",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-kund",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-norrgavel",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"],isDemo:[4,"is-demo"]}],[1,"hemfixarna-power",{id:[1],customer:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-skanska",{id:[1],customer:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-sparfonster",{id:[1],customer:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-string-furniture",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-superfront",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-tesla",{id:[1],loadFromQuery:[1,"load-from-query"],isDemo:[4,"is-demo"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-traningspartner",{id:[1],loadFromQuery:[1,"load-from-query"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-zaptec",{id:[1],loadFromQuery:[1,"load-from-query"],isDemo:[4,"is-demo"],widgetStyle:[1,"widget-style"],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"]}],[1,"hemfixarna-component",{slug:[1],id:[1],business:[1],topCategory:[1,"top-category"],forceOldTree:[4,"force-old-tree"],loadFromQuery:[4,"load-from-query"],isDemo:[4,"is-demo"],widgetStyle:[1,"widget-style"],nav:[16],buttonColor:[1,"button-color"],buttonBg:[1,"button-bg"],modal:[32],showModal:[32],tree:[32],product:[32],proppedProduct:[32]},[[0,"click","handleClick"]]],[0,"hemfixarna-cart",{tree:[16]}],[0,"hemfixarna-category"],[0,"hemfixarna-order",{tree:[16]}],[0,"hemfixarna-product",{amount:[32],hideDescription:[32]}],[0,"hemfixarna-service"],[0,"hemfixarna-start",{tree:[16],slug:[1]}],[0,"hemfixarna-breadcrumbs",{tree:[16],closeModal:[16],loadFromQuery:[4,"load-from-query"],isDemo:[4,"is-demo"]}],[0,"hemfixarna-checkout",{date:[32],dateError:[32],generalError:[32],loading:[32],enteredPin:[32],selectedSubSource:[32],partnerOrderId:[32],showSources:[32],sellerID:[32],RefferalID:[32]}],[0,"hemfixarna-contact",{vertical:[4]}],[0,"hemfixarna-invoice",{formError:[32],displayImages:[32],formImages:[32],formState:[32]}],[0,"hemfixarna-address",{street:[32],streetError:[32],zip:[32],zipError:[32],town:[32],townError:[32]}],[0,"hemfixarna-getuser",{email:[32],emailError:[32],phone:[32],phoneError:[32],ssn:[32],ssnError:[32]}],[0,"hemfixarna-orderrows",{cart:[4],tree:[16]}],[0,"hemfixarna-box",{post:[16],category:[16],icon:[1],postTitle:[1,"post-title"]}],[0,"hemfixarna-info"]]]],o)));
|
163
2
|
//# sourceMappingURL=hemfixarna-components.esm.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"version":3,"names":[],"sources":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"version":3,"names":[],"sources":[],"mappings":""}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
const t="hemfixarna-components";let n;let e;let s=false;let o=null;let l=false;const c=t=>{const n=new URL(t,jt.t);return n.origin!==vt.location.origin?n.href:n.pathname};const i=(t,n="")=>{{return()=>{}}};const f=(t,n)=>{{return()=>{}}};const r="{visibility:hidden}.hydrated{visibility:inherit}";const u={};const a="http://www.w3.org/2000/svg";const d="http://www.w3.org/1999/xhtml";const h=t=>t!=null;const p=t=>{t=typeof t;return t==="object"||t==="function"};function y(t){var n,e,s;return(s=(e=(n=t.head)===null||n===void 0?void 0:n.querySelector('meta[name="csp-nonce"]'))===null||e===void 0?void 0:e.getAttribute("content"))!==null&&s!==void 0?s:undefined}const m=(t,n,...e)=>{let s=null;let o=null;let l=false;let c=false;const i=[];const f=n=>{for(let e=0;e<n.length;e++){s=n[e];if(Array.isArray(s)){f(s)}else if(s!=null&&typeof s!=="boolean"){if(l=typeof t!=="function"&&!p(s)){s=String(s)}if(l&&c){i[i.length-1].o+=s}else{i.push(l?$(null,s):s)}c=l}}};f(e);if(n){if(n.key){o=n.key}{const t=n.className||n.class;if(t){n.class=typeof t!=="object"?t:Object.keys(t).filter((n=>t[n])).join(" ")}}}if(typeof t==="function"){return t(n===null?{}:n,i,g)}const r=$(t,null);r.l=n;if(i.length>0){r.i=i}{r.u=o}return r};const $=(t,n)=>{const e={h:0,p:t,o:n,m:null,i:null};{e.l=null}{e.u=null}return e};const w={};const b=t=>t&&t.p===w;const g={forEach:(t,n)=>t.map(v).forEach(n),map:(t,n)=>t.map(v).map(n).map(S)};const v=t=>({vattrs:t.l,vchildren:t.i,vkey:t.u,vname:t.$,vtag:t.p,vtext:t.o});const S=t=>{if(typeof t.vtag==="function"){const n=Object.assign({},t.vattrs);if(t.vkey){n.key=t.vkey}if(t.vname){n.name=t.vname}return m(t.vtag,n,...t.vchildren||[])}const n=$(t.vtag,t.vtext);n.l=t.vattrs;n.i=t.vchildren;n.u=t.vkey;n.$=t.vname;return n};const j=(t,n)=>{if(t!=null&&!p(t)){if(n&4){return t==="false"?false:t===""||!!t}if(n&1){return String(t)}return t}return t};const k=t=>ht(t).g;const O=(t,n,e)=>{const s=jt.ce(n,e);t.dispatchEvent(s);return s};const C=new WeakMap;const M=(t,n,e)=>{let s=gt.get(t);if(Ot&&e){s=s||new CSSStyleSheet;if(typeof s==="string"){s=n}else{s.replaceSync(n)}}else{s=n}gt.set(t,s)};const x=(t,n,e,s)=>{var o;let l=E(n);const c=gt.get(l);t=t.nodeType===11?t:St;if(c){if(typeof c==="string"){t=t.head||t;let n=C.get(t);let e;if(!n){C.set(t,n=new Set)}if(!n.has(l)){{{e=St.createElement("style");e.innerHTML=c}const n=(o=jt.v)!==null&&o!==void 0?o:y(St);if(n!=null){e.setAttribute("nonce",n)}t.insertBefore(e,t.querySelector("link"))}if(n){n.add(l)}}}else if(!t.adoptedStyleSheets.includes(c)){t.adoptedStyleSheets=[...t.adoptedStyleSheets,c]}}return l};const U=t=>{const n=t.S;const e=t.g;const s=n.h;const o=i("attachStyles",n.j);const l=x(e.shadowRoot?e.shadowRoot:e.getRootNode(),n);if(s&10){e["s-sc"]=l;e.classList.add(l+"-h")}o()};const E=(t,n)=>"sc-"+t.j;const L=(t,n,e,s,o,l)=>{if(e!==s){let c=mt(t,n);let i=n.toLowerCase();if(n==="class"){const n=t.classList;const o=R(e);const l=R(s);n.remove(...o.filter((t=>t&&!l.includes(t))));n.add(...l.filter((t=>t&&!o.includes(t))))}else if(n==="style"){{for(const n in e){if(!s||s[n]==null){if(n.includes("-")){t.style.removeProperty(n)}else{t.style[n]=""}}}}for(const n in s){if(!e||s[n]!==e[n]){if(n.includes("-")){t.style.setProperty(n,s[n])}else{t.style[n]=s[n]}}}}else if(n==="key");else if(!c&&n[0]==="o"&&n[1]==="n"){if(n[2]==="-"){n=n.slice(3)}else if(mt(vt,i)){n=i.slice(2)}else{n=i[2]+n.slice(3)}if(e){jt.rel(t,n,e,false)}if(s){jt.ael(t,n,s,false)}}else{const i=p(s);if((c||i&&s!==null)&&!o){try{if(!t.tagName.includes("-")){const o=s==null?"":s;if(n==="list"){c=false}else if(e==null||t[n]!=o){t[n]=o}}else{t[n]=s}}catch(t){}}if(s==null||s===false){if(s!==false||t.getAttribute(n)===""){{t.removeAttribute(n)}}}else if((!c||l&4||o)&&!i){s=s===true?"":s;{t.setAttribute(n,s)}}}}};const P=/\s/;const R=t=>!t?[]:t.split(P);const N=(t,n,e,s)=>{const o=n.m.nodeType===11&&n.m.host?n.m.host:n.m;const l=t&&t.l||u;const c=n.l||u;{for(s in l){if(!(s in c)){L(o,s,l[s],undefined,e,n.h)}}}for(s in c){L(o,s,l[s],c[s],e,n.h)}};const T=(t,e,o,l)=>{const c=e.i[o];let i=0;let f;let r;if(c.o!==null){f=c.m=St.createTextNode(c.o)}else{if(!s){s=c.p==="svg"}f=c.m=St.createElementNS(s?a:d,c.p);if(s&&c.p==="foreignObject"){s=false}{N(null,c,s)}if(h(n)&&f["s-si"]!==n){f.classList.add(f["s-si"]=n)}if(c.i){for(i=0;i<c.i.length;++i){r=T(t,c,i);if(r){f.appendChild(r)}}}{if(c.p==="svg"){s=false}else if(f.tagName==="foreignObject"){s=true}}}return f};const W=(t,n,s,o,l,c)=>{let i=t;let f;if(i.shadowRoot&&i.tagName===e){i=i.shadowRoot}for(;l<=c;++l){if(o[l]){f=T(null,s,l);if(f){o[l].m=f;i.insertBefore(f,n)}}}};const A=(t,n,e,s,o)=>{for(;n<=e;++n){if(s=t[n]){o=s.m;o.remove()}}};const F=(t,n,e,s)=>{let o=0;let l=0;let c=0;let i=0;let f=n.length-1;let r=n[0];let u=n[f];let a=s.length-1;let d=s[0];let h=s[a];let p;let y;while(o<=f&&l<=a){if(r==null){r=n[++o]}else if(u==null){u=n[--f]}else if(d==null){d=s[++l]}else if(h==null){h=s[--a]}else if(q(r,d)){D(r,d);r=n[++o];d=s[++l]}else if(q(u,h)){D(u,h);u=n[--f];h=s[--a]}else if(q(r,h)){D(r,h);t.insertBefore(r.m,u.m.nextSibling);r=n[++o];h=s[--a]}else if(q(u,d)){D(u,d);t.insertBefore(u.m,r.m);u=n[--f];d=s[++l]}else{c=-1;{for(i=o;i<=f;++i){if(n[i]&&n[i].u!==null&&n[i].u===d.u){c=i;break}}}if(c>=0){y=n[c];if(y.p!==d.p){p=T(n&&n[l],e,c)}else{D(y,d);n[c]=undefined;p=y.m}d=s[++l]}else{p=T(n&&n[l],e,l);d=s[++l]}if(p){{r.m.parentNode.insertBefore(p,r.m)}}}}if(o>f){W(t,s[a+1]==null?null:s[a+1].m,e,s,l,a)}else if(l>a){A(n,o,f)}};const q=(t,n)=>{if(t.p===n.p){{return t.u===n.u}}return false};const D=(t,n)=>{const e=n.m=t.m;const o=t.i;const l=n.i;const c=n.p;const i=n.o;if(i===null){{s=c==="svg"?true:c==="foreignObject"?false:s}{{N(t,n,s)}}if(o!==null&&l!==null){F(e,o,n,l)}else if(l!==null){if(t.o!==null){e.textContent=""}W(e,null,n,l,0,l.length-1)}else if(o!==null){A(o,0,o.length-1)}if(s&&c==="svg"){s=false}}else if(t.o!==i){e.data=i}};const H=(t,s)=>{const o=t.g;const l=t.k||$(null,null);const c=b(s)?s:m(null,null,s);e=o.tagName;c.p=null;c.h|=4;t.k=c;c.m=l.m=o.shadowRoot||o;{n=o["s-sc"]}D(l,c)};const I=(t,n)=>{if(n&&!t.O&&n["s-p"]){n["s-p"].push(new Promise((n=>t.O=n)))}};const V=(t,n)=>{{t.h|=16}if(t.h&4){t.h|=512;return}I(t,t.C);const e=()=>_(t,n);return Pt(e)};const _=(t,n)=>{const e=i("scheduleUpdate",t.S.j);const s=t.M;let o;if(n){{t.h|=256;if(t.U){t.U.map((([t,n])=>X(s,t,n)));t.U=null}}{o=X(s,"componentWillLoad")}}e();return Y(o,(()=>z(t,s,n)))};const z=async(t,n,e)=>{const s=t.g;const o=i("update",t.S.j);const l=s["s-rc"];if(e){U(t)}const c=i("render",t.S.j);{B(t,n)}if(l){l.map((t=>t()));s["s-rc"]=undefined}c();o();{const n=s["s-p"];const e=()=>J(t);if(n.length===0){e()}else{Promise.all(n).then(e);t.h|=4;n.length=0}}};const B=(t,n,e)=>{try{o=n;n=n.render&&n.render();{t.h&=~16}{t.h|=2}{{{H(t,n)}}}}catch(n){$t(n,t.g)}o=null;return null};const G=()=>o;const J=t=>{const n=t.S.j;const e=t.g;const s=i("postUpdate",n);const o=t.M;const l=t.C;{X(o,"componentDidRender")}if(!(t.h&64)){t.h|=64;{Z(e)}s();{t.L(e);if(!l){Q()}}}else{s()}{if(t.O){t.O();t.O=undefined}if(t.h&512){Lt((()=>V(t,false)))}t.h&=~(4|512)}};const K=t=>{{const n=ht(t);const e=n.g.isConnected;if(e&&(n.h&(2|16))===2){V(n,false)}return e}};const Q=n=>{{Z(St.documentElement)}Lt((()=>O(vt,"appload",{detail:{namespace:t}})))};const X=(t,n,e)=>{if(t&&t[n]){try{return t[n](e)}catch(t){$t(t)}}return undefined};const Y=(t,n)=>t&&t.then?t.then(n):n();const Z=t=>t.classList.add("hydrated");const tt=(t,n)=>ht(t).P.get(n);const nt=(t,n,e,s)=>{const o=ht(t);const l=o.g;const c=o.P.get(n);const i=o.h;const f=o.M;e=j(e,s.R[n][0]);const r=Number.isNaN(c)&&Number.isNaN(e);const u=e!==c&&!r;if((!(i&8)||c===undefined)&&u){o.P.set(n,e);if(f){if(s.N&&i&128){const t=s.N[n];if(t){t.map((t=>{try{f[t](e,c,n)}catch(t){$t(t,l)}}))}}if((i&(2|16))===2){V(o,false)}}}};const et=(t,n,e)=>{if(n.R){if(t.watchers){n.N=t.watchers}const s=Object.entries(n.R);const o=t.prototype;s.map((([t,[s]])=>{if(s&31||e&2&&s&32){Object.defineProperty(o,t,{get(){return tt(this,t)},set(e){nt(this,t,e,n)},configurable:true,enumerable:true})}}));if(e&1){const n=new Map;o.attributeChangedCallback=function(t,e,s){jt.jmp((()=>{const e=n.get(t);if(this.hasOwnProperty(e)){s=this[e];delete this[e]}else if(o.hasOwnProperty(e)&&typeof this[e]==="number"&&this[e]==s){return}this[e]=s===null&&typeof this[e]==="boolean"?false:s}))};t.observedAttributes=s.filter((([t,n])=>n[0]&15)).map((([t,e])=>{const s=e[1]||t;n.set(s,t);return s}))}}return t};const st=async(t,n,e,s,o)=>{if((n.h&32)===0){{n.h|=32;o=bt(e);if(o.then){const t=f();o=await o;t()}if(!o.isProxied){{e.N=o.watchers}et(o,e,2);o.isProxied=true}const t=i("createInstance",e.j);{n.h|=8}try{new o(n)}catch(t){$t(t)}{n.h&=~8}{n.h|=128}t()}if(o.style){let t=o.style;const n=E(e);if(!gt.has(n)){const s=i("registerStyles",e.j);M(n,t,!!(e.h&1));s()}}}const l=n.C;const c=()=>V(n,true);if(l&&l["s-rc"]){l["s-rc"].push(c)}else{c()}};const ot=t=>{if((jt.h&1)===0){const n=ht(t);const e=n.S;const s=i("connectedCallback",e.j);if(!(n.h&1)){n.h|=1;{let e=t;while(e=e.parentNode||e.host){if(e["s-p"]){I(n,n.C=e);break}}}if(e.R){Object.entries(e.R).map((([n,[e]])=>{if(e&31&&t.hasOwnProperty(n)){const e=t[n];delete t[n];t[n]=e}}))}{st(t,n,e)}}else{ft(t,n,e.T)}s()}};const lt=t=>{if((jt.h&1)===0){const n=ht(t);const e=n.M;{if(n.W){n.W.map((t=>t()));n.W=undefined}}{X(e,"disconnectedCallback")}}};const ct=(t,n={})=>{var e;const s=i();const o=[];const l=n.exclude||[];const c=vt.customElements;const f=St.head;const u=f.querySelector("meta[charset]");const a=St.createElement("style");const d=[];let h;let p=true;Object.assign(jt,n);jt.t=new URL(n.resourcesUrl||"./",St.baseURI).href;t.map((t=>{t[1].map((n=>{const e={h:n[0],j:n[1],R:n[2],T:n[3]};{e.R=n[2]}{e.T=n[3]}{e.N={}}const s=e.j;const i=class extends HTMLElement{constructor(t){super(t);t=this;yt(t,e);if(e.h&1){{{t.attachShadow({mode:"open"})}}}}connectedCallback(){if(h){clearTimeout(h);h=null}if(p){d.push(this)}else{jt.jmp((()=>ot(this)))}}disconnectedCallback(){jt.jmp((()=>lt(this)))}componentOnReady(){return ht(this).A}};e.F=t[0];if(!l.includes(s)&&!c.get(s)){o.push(s);c.define(s,et(i,e,1))}}))}));{a.innerHTML=o+r;a.setAttribute("data-styles","");const t=(e=jt.v)!==null&&e!==void 0?e:y(St);if(t!=null){a.setAttribute("nonce",t)}f.insertBefore(a,u?u.nextSibling:f.firstChild)}p=false;if(d.length){d.map((t=>t.connectedCallback()))}else{{jt.jmp((()=>h=setTimeout(Q,30)))}}s()};const it=(t,n)=>n;const ft=(t,n,e,s)=>{if(e){e.map((([e,s,o])=>{const l=t;const c=rt(n,o);const i=ut(e);jt.ael(l,s,c,i);(n.W=n.W||[]).push((()=>jt.rel(l,s,c,i)))}))}};const rt=(t,n)=>e=>{try{{if(t.h&256){t.M[n](e)}else{(t.U=t.U||[]).push([n,e])}}}catch(t){$t(t)}};const ut=t=>(t&2)!==0;const at=t=>jt.v=t;const dt=new WeakMap;const ht=t=>dt.get(t);const pt=(t,n)=>dt.set(n.M=t,n);const yt=(t,n)=>{const e={h:0,g:t,S:n,P:new Map};{e.A=new Promise((t=>e.L=t));t["s-p"]=[];t["s-rc"]=[]}ft(t,e,n.T);return dt.set(t,e)};const mt=(t,n)=>n in t;const $t=(t,n)=>(0,console.error)(t,n);const wt=new Map;const bt=(t,n,e)=>{const s=t.j.replace(/-/g,"_");const o=t.F;const l=wt.get(o);if(l){return l[s]}
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${o}.entry.js${""}`).then((t=>{{wt.set(o,t)}return t[s]}),$t)};const gt=new Map;const vt=typeof window!=="undefined"?window:{};const St=vt.document||{head:{}};const jt={h:0,t:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,n,e,s)=>t.addEventListener(n,e,s),rel:(t,n,e,s)=>t.removeEventListener(n,e,s),ce:(t,n)=>new CustomEvent(t,n)};const kt=t=>Promise.resolve(t);const Ot=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(t){}return false})();const Ct=[];const Mt=[];const xt=(t,n)=>e=>{t.push(e);if(!l){l=true;if(n&&jt.h&4){Lt(Et)}else{jt.raf(Et)}}};const Ut=t=>{for(let n=0;n<t.length;n++){try{t[n](performance.now())}catch(t){$t(t)}}t.length=0};const Et=()=>{Ut(Ct);{Ut(Mt);if(l=Ct.length>0){jt.raf(Et)}}};const Lt=t=>kt().then(t);const Pt=xt(Mt,true);export{it as F,k as a,ct as b,c,K as f,G as g,m as h,kt as p,pt as r,at as s};
|
3
|
+
//# sourceMappingURL=p-852e7173.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sources":[],"mappings":""}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{g as n,f as t,r as i,h as e,a as s,F as a,c as r}from"./p-852e7173.js";const o=(n,t,i)=>{const e=n.get(t);if(!e){n.set(t,[i])}else if(!e.includes(i)){e.push(i)}};const l=(n,t)=>{let i;return(...e)=>{if(i){clearTimeout(i)}i=setTimeout((()=>{i=0;n(...e)}),t)}};const h=n=>!("isConnected"in n)||n.isConnected;const c=l((n=>{for(let t of n.keys()){n.set(t,n.get(t).filter(h))}}),2e3);const d=()=>{if(typeof n!=="function"){return{}}const i=new Map;return{dispose:()=>i.clear(),get:t=>{const e=n();if(e){o(i,t,e)}},set:n=>{const e=i.get(n);if(e){i.set(n,e.filter(t))}c(i)},reset:()=>{i.forEach((n=>n.forEach(t)));c(i)}}};const u=n=>typeof n==="function"?n():n;const p=(n,t=((n,t)=>n!==t))=>{const i=u(n);let e=new Map(Object.entries(i!==null&&i!==void 0?i:{}));const s={dispose:[],get:[],set:[],reset:[]};const a=()=>{var t;e=new Map(Object.entries((t=u(n))!==null&&t!==void 0?t:{}));s.reset.forEach((n=>n()))};const r=()=>{s.dispose.forEach((n=>n()));a()};const o=n=>{s.get.forEach((t=>t(n)));return e.get(n)};const l=(n,i)=>{const a=e.get(n);if(t(i,a,n)){e.set(n,i);s.set.forEach((t=>t(n,i,a)))}};const h=typeof Proxy==="undefined"?{}:new Proxy(i,{get(n,t){return o(t)},ownKeys(n){return Array.from(e.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(n,t){return e.has(t)},set(n,t,i){l(t,i);return true}});const c=(n,t)=>{s[n].push(t);return()=>{f(s[n],t)}};const d=(t,i)=>{const e=c("set",((n,e)=>{if(n===t){i(e)}}));const s=c("reset",(()=>i(u(n)[t])));return()=>{e();s()}};const p=(...n)=>{const t=n.reduce(((n,t)=>{if(t.set){n.push(c("set",t.set))}if(t.get){n.push(c("get",t.get))}if(t.reset){n.push(c("reset",t.reset))}if(t.dispose){n.push(c("dispose",t.dispose))}return n}),[]);return()=>t.forEach((n=>n()))};const m=n=>{const t=e.get(n);s.set.forEach((i=>i(n,t,t)))};return{state:h,get:o,set:l,on:c,onChange:d,use:p,dispose:r,reset:a,forceUpdate:m}};const f=(n,t)=>{const i=n.indexOf(t);if(i>=0){n[i]=n[n.length-1];n.length--}};const m=(n,t)=>{const i=p(n,t);i.use(d());return i};const{state:x,onChange:g}=m({step:1,checkoutStep:1,checkoutEdit:false,selectedCategory:null,selectedService:null,selectedProduct:null,cart:[],business:"undefined",options:null,rut:true,rot:true,green:true,token:null,user:null,modal:null,rutOptions:null,rotOptions:null,greenOptions:null,customer:null,selectedCustomerCategory:null,parentCategory:null,creditSafeUser:null,checkoutInvoice:false,maleri:false,sources:null});g("cart",(n=>{window.sessionStorage.setItem(`hemfixarna-${x.business}-cart`,JSON.stringify(n))}));g("user",(n=>{window.sessionStorage.setItem(`hemfixarna-${x.business}-user`,JSON.stringify(n))}));g("creditSafeUser",(n=>{window.sessionStorage.setItem(`hemfixarna-${x.business}-creditSafeUser`,JSON.stringify(n))}));g("selectedProduct",(n=>{if(!x.customer||!n)return;const t=[...x.customer.categories,...x.customer.categories.map((n=>{var t;return(t=n.sub_categories)!==null&&t!==void 0?t:[]}))].flat();const i=t.find((t=>t&&t.id===n.category));if(i){x.parentCategory=i;return}x.parentCategory=null}));g("selectedCustomerCategory",(n=>{if(!x.customer||!n)return;if(n.parent){const t=x.customer.categories.find((t=>t.id===n.parent));if(t){x.parentCategory=t;return}}x.parentCategory=null}));const b=n=>n.split(" ").reduce(((n,t)=>{if(t.length<=2){return n+t.slice(0,1)+"* "}else{return n+t.slice(0,1)+"*".repeat(t.length-2)+t.slice(-1)+" "}}),"");const v=n=>{if(!n)return;n.scrollTo({top:0,behavior:"smooth"})};const _=class{constructor(n){i(this,n);this.handleSubmit=n=>{n.preventDefault();const t=this.street.length>0;if(!t){this.streetError="Ange en gatuadress"}const i=this.zip.length>0;const e=/^\s*\d[\d\s]*$/.test(this.zip);if(!e){this.zipError="Postnummer får endast innehålla siffror"}if(!i){this.zipError="Ange ett postnummer"}const s=/^[^\d\s]{2,}$/.test(this.town);if(!s){this.townError="Ange en ort"}if(t&&i&&s&&e){x.user=Object.assign(Object.assign({},x.user),{street:this.street,zip:this.zip,town:this.town});x.checkoutStep=2;x.checkoutEdit=false;const n=this.el.closest(".hemfixarna_content");v(n)}};this.handleChangeStreet=n=>{this.streetError=null;this.street=this.street===x.user.street?"":n.target.value};this.handleChangeZip=n=>{this.zipError=null;this.zip=this.zip===x.user.zip?"":n.target.value};this.handleChangeTown=n=>{this.townError=null;this.town=this.town===x.user.town?"":n.target.value};this.render=()=>e("form",{class:"hemfixarna_address",onSubmit:n=>this.handleSubmit(n)},e("div",null,e("input",{class:`${this.street.length?"input_active":""}`,onInput:this.handleChangeStreet,type:"text",name:"street",value:this.street===x.user.street?b(this.street):this.street}),e("label",{htmlFor:"street"},"Gatuaddress ")),this.streetError&&e("span",null,this.streetError),e("div",null,e("input",{class:`${this.zip.length?"input_active":""}`,onInput:this.handleChangeZip,type:"tel",name:"zip",value:this.zip===x.user.zip?b(this.zip):this.zip}),e("label",{htmlFor:"zip"},"Postnummer ")),this.zipError&&e("span",null,this.zipError),e("div",null,e("input",{class:`${this.town.length?"input_active":""}`,onInput:this.handleChangeTown,type:"text",name:"town",value:this.town===x.user.town?b(this.town):this.town}),e("label",{htmlFor:"town"},"Ort ")),this.townError&&e("span",null,this.townError),e("input",{type:"submit",value:"Fortsätt"}));this.street="";this.streetError=null;this.zip="";this.zipError=null;this.town="";this.townError=null}componentWillLoad(){if(x.user){this.street=x.user.street;this.zip=x.user.zip;this.town=x.user.town}}get el(){return s(this)}};const y=n=>Math.ceil(n/2);const w=n=>Math.ceil(n*.7);const k=n=>Math.ceil(n*.5);const C=(n,t,i=1)=>{if(n.rot&&x.rot){return w((t||n.price)*i)}else if(n.rut&&x.rut){return y((t||n.price)*i)}else if(n.green&&x.green){return k((t||n.price)*i)}else{return(t||n.price)*i}};const $=n=>{if(n.rot){return w(n.price)}else if(n.rut&&x.rut){return y(n.price)}else{return n.price}};const S=(n,t,i=1)=>{if(t.rot&&x.rot){return w(n.price*i)}else if(t.rut&&x.rut){return y(n.price*i)}else{return n.price*i}};const B=()=>{if(!x.cart)return{rut:0,rot:0,green:0};const n=x.cart.some((n=>n.rut&&n.start_fee));const t=x.cart.some((n=>n.rot&&n.start_fee));const i=x.cart.some((n=>n.green&&n.start_fee));const e=x.rut?y(x.options.start_fee):x.options.start_fee*1;const s=x.rot?w(x.options.start_fee):x.options.start_fee*1;const a=x.green?k(x.options.start_fee):x.options.start_fee*1;return{rut:n?e:0,rot:t?s:0,green:i?a:0,length:[n,t,i].filter((n=>n)).length}};const z=n=>{const t=n.parts.reduce(((n,t)=>n+t.price*t.amount),0);return C(n,n.price*n.amount+t)};const j=()=>{const n=x.cart.reduce(((n,t)=>t.rot?n+z(t):n),0)+B().rot;const t=x.cart.reduce(((n,t)=>{const i=t.parts.reduce(((n,t)=>n+t.price*t.amount),0);return t.rot?n+t.price*t.amount+i:n}),0)+Number(x.options.start_fee);return t-n};const T=()=>{const n=x.cart.reduce(((n,t)=>t.rut?n+z(t):n),0)+B().rut;const t=x.cart.reduce(((n,t)=>{const i=t.parts.reduce(((n,t)=>n+t.price*t.amount),0);return t.rut?n+t.price*t.amount+i:n}),0)+Number(x.options.start_fee);return t-n};const I=()=>{const n=x.cart.reduce(((n,t)=>t.green?n+z(t):n),0)+B().green;const t=x.cart.reduce(((n,t)=>{const i=t.parts.reduce(((n,t)=>n+t.price*t.amount),0);return t.green?n+t.price*t.amount+i:n}),0)+Number(x.options.start_fee);return t-n};const D=()=>x.cart.reduce(((n,t)=>n+z(t)),0)+B().rot+B().rut;var O;(function(n){n["kund"]="kund";n["byggmax"]="byggmax";n["skanska"]="skanska";n["string"]="string-furniture";n["hornbach"]="hornbach";n["forebygg"]="forebygg";n["doro"]="doro";n["elfa"]="elfa";n["kbygg"]="k-bygg";n["norrgavel"]="norrgavel";n["fargvaruhuset"]="fargvaruhuset";n["zaptec"]="zaptec";n["tesla"]="tesla";n["klint"]="klint";n["flyttsmart"]="flyttsmart";n["lg"]="lg";n["sparfonster"]="sparfonster";n["power"]="power";n["traningspartner"]="traningspartner";n["superfront"]="superfront"})(O||(O={}));var F;(function(n){n["standard"]="standard";n["alternative"]="alternative";n["alternative_2"]="alternative_2";n["alternative_3"]="alternative_3"})(F||(F={}));var M;(function(n){n["byggmax"]="category/bygg"})(M||(M={}));const L=n=>n.post_name!==undefined;const N=n=>Object.values(O).includes(n);const P=class{constructor(n){i(this,n);this.post=undefined;this.category=undefined;this.icon=undefined;this.postTitle=undefined}setTaxonomy(n){if(n){if((n===null||n===void 0?void 0:n.taxonomy)==="service_cat"){x.selectedCategory=n;x.step=2}else if((n===null||n===void 0?void 0:n.post_type)==="service"){x.selectedService=n;x.step=3}else if((n===null||n===void 0?void 0:n.post_type)==="ikea_product"){x.selectedProduct=n;x.step=4}const t=this.el.closest(".hemfixarna_content");v(t)}}setProduct(){x.selectedProduct=this.category;x.step=4;x.selectedCustomerCategory=null;const n=this.el.closest(".hemfixarna_content");v(n)}render(){return this.category?e(a,null,L(this.category)?e("li",{onClick:()=>this.setProduct()},e("img",{class:"hemfixarna_logo",height:82,src:this.category.icon,alt:this.category.post_name}),e("div",null,e("p",null,this.category.title),!this.category.invoice?e("p",{class:"price"},"Från ",C(this.category),"kr"):null)):e("li",{onClick:()=>x.selectedCustomerCategory=this.category},e("img",{class:"hemfixarna_logo",height:82,src:this.category.icon,alt:this.category.name}),e("div",null,e("p",null,this.category.name)))):e("li",{onClick:()=>this.setTaxonomy(this.post)},this.post.icon&&e("img",{class:"hemfixarna_logo",height:82,src:this.icon,alt:this.postTitle}),e("div",null,e("p",null,this.postTitle),x.step===3&&e("p",{class:"price"},"Från ",C(this.post),"kr")))}get el(){return s(this)}};const A=class{constructor(n){i(this,n);this.triggerScrollTotop=()=>{const n=this.el.nextSibling;v(n)};this.tree=undefined;this.closeModal=undefined;this.loadFromQuery=false;this.isDemo=false}getCartLength(){return x.cart.reduce(((n,t)=>n+t.amount),0)}handleCartClick(){var n;if((n=x.cart)===null||n===void 0?void 0:n.length){x.step=5;this.triggerScrollTotop()}}handleHomePageClick(){x.step=1;x.parentCategory=null;x.selectedCustomerCategory=null;this.triggerScrollTotop();setTimeout((()=>{x.selectedCategory=null;x.selectedProduct=null;x.maleri=null;x.selectedService=null}),200)}render(){const n=r(`./assets/hemfixarna.svg`);const t=r(`./assets/close.svg`);const i=r(`./assets/cart.svg`);const s=r(`./assets/back.svg`);return e("div",null,e("div",{class:"hemfixarna_crumbs"},e("div",{class:"hemfixarna_crumbs--links"},e("img",{onClick:()=>this.handleHomePageClick(),src:n,width:110}),!this.loadFromQuery||this.isDemo?e("img",{onClick:()=>this.closeModal(),class:"close",src:t,width:32}):null,e("div",null,e("button",{onClick:()=>this.handleHomePageClick()},"Alla tjänster"))),e("div",{class:"hemfixarna_crumbs--right"},e("hemfixarna-contact",null),e("div",{onClick:()=>this.handleCartClick(),class:`cart ${this.getCartLength()>0?"cart_active":""}`},e("img",{src:i,width:24}),e("span",null,this.getCartLength())))),[3,4].includes(x.step)&&!x.customer&&e("button",{class:"hemfixarna_crumbs--back",onClick:()=>{x.step=x.step===4?3:2}},e("img",{width:24,src:s,alt:"back arrow"}),e("span",null,"Se allt ",x.step===4?x.selectedService.post_title:x.selectedCategory.name)),!x.parentCategory&&x.step&&x.selectedCustomerCategory&&e("button",{class:"hemfixarna_crumbs--back",onClick:()=>{x.step=1;x.selectedCustomerCategory=null;x.selectedProduct=null;x.maleri=null}},e("img",{width:24,src:s,alt:"back arrow"}),e("span",null,"Se alla tjänster")),x.parentCategory&&x.step<5&&e("button",{class:"hemfixarna_crumbs--back",onClick:()=>{x.step=1;x.selectedCustomerCategory=x.parentCategory;x.selectedProduct=null;x.maleri=null}},e("img",{width:24,src:s,alt:"back arrow"}),e("span",null,"Se allt ",x.parentCategory.name)))}get el(){return s(this)}};const K="";const V=class{constructor(n){i(this,n);this.tree=null;this.slug=undefined;this.id=undefined;this.forceOldTree=false;this.loadFromQuery=undefined;this.customer=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{forceOldTree:this.forceOldTree,id:this.id,slug:this.slug,business:O.byggmax,topCategory:M.byggmax,loadFromQuery:Boolean(this.loadFromQuery),widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor})}};V.style=K;const R=class{constructor(n){i(this,n);this.tree=undefined}render(){const n=r(`./assets/back.svg`);return e("div",{class:"hemfixarna_cart"},e("div",{class:"hemfixarna_cart--left"},e("h2",null,x.checkoutStep===2&&!x.checkoutEdit&&e("button",{onClick:()=>{x.checkoutStep=1}},e("img",{width:24,src:n,alt:"back arrow"})),"Din bokning"),e("hemfixarna-orderrows",{tree:this.tree})),e("div",{class:"hemfixarna_cart--right"},e("h2",null,x.checkoutStep===2&&!x.checkoutEdit&&e("button",{onClick:()=>{x.checkoutStep=1}},e("img",{width:24,src:n,alt:"back arrow"})),"Dina uppgifter"),e("hemfixarna-checkout",null),e("hemfixarna-info",null)))}};const Q=class{constructor(n){i(this,n)}setSelectedService(n){x.selectedService=n;x.step=3}render(){return e("div",null,e("h2",null,x.selectedCategory.name),e("div",{class:"hemfixarna_categories--wrapper"},e("div",null,e("ul",{class:"hemfixarna_categories"},x.selectedCategory.services.sort(((n,t)=>n.post_title<t.post_title?-1:1)).map((n=>{var t;return e("hemfixarna-box",{post:n,icon:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,postTitle:n.post_title})})))),e("hemfixarna-info",null)))}};const U=`${"https://hemfixarna.se"}/wp-json/headless`;async function H(n,t){const i=await fetch(n,t);const e=await i.json();return e}const E=async n=>{if(!n){return}const t=n.split("/")[0];const i=n.split("/")[1];try{const n=await fetch(`${U}/${t}/${i}`);return await n.json()}catch(n){console.log(n)}};const J=async n=>{try{const t=await fetch(`${U}/customer/${n}`);return await t.json()}catch(n){console.log(n)}};const W=async()=>{try{const n=await fetch(`${U}/webcoptions`);return await n.json()}catch(n){console.log(n)}};const Z=async()=>{try{const n=await H(`${U}/rut`);return n}catch(n){console.log(n)}};const X=async()=>{try{const n=await fetch(`${U}/rot`);return await n.json()}catch(n){console.log(n)}};const Y=async()=>{try{const n=await fetch(`${U}/green-discount`);return await n.json()}catch(n){console.log(n)}};const q=async n=>{try{const t=await fetch(`${U}/weborder`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}});return await t.json()}catch(n){console.log(n)}};const G=`${"https://hemfixarna.se"}/wp-json/felix`;const nn=async n=>{try{return await H(`${G}/createperson`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}catch(n){console.log(n)}};const tn=class{constructor(n){i(this,n);this.handleChangeDate=n=>{this.dateError=null;this.date=n.target.value};this.handleChangeTerms=()=>{this.generalError=null};this.sendOrder=async()=>{var n,t,i,e;if(this.loading)return;this.loading=true;let s={firstName:x.creditSafeUser.firstName,lastName:x.creditSafeUser.lastName,street:x.user.street,zip:x.user.zip,town:x.user.town,ssn:x.user.ssn,email:x.user.email,phone:x.user.phone,url:`${x.business===O.string?"string":x.business}-webk`,date:this.date,products:[...x.cart.map((n=>{const t=n.parts.map((n=>({id:String(n.id),name:n.name,quantity:n.amount,rut:0,rot:0})));return[{id:String(n.id),name:n.name,quantity:n.amount,rot:n.rot?1:0,rut:n.rut?1:0},...t]}))].flat(),creditSafe:x.creditSafeUser,customer:x.business,id_source:"",id_sub_source:"",seller_id:(n=this.sellerID)!==null&&n!==void 0?n:"",referral_id:(t=this.RefferalID)!==null&&t!==void 0?t:""};const a=await nn(s);if(!a||!((e=(i=a.response)===null||i===void 0?void 0:i.scriptResult)===null||e===void 0?void 0:e.includes("OK"))){s=Object.assign(Object.assign({},s),{felixStatus:"error"})}else{s=Object.assign(Object.assign({},s),{felixStatus:"success"})}try{const{data:n,status:t}=await q(s);if(n&&t&&t===200){x.step=6;const n=this.el.closest(".hemfixarna_content");v(n)}else{this.generalError="Något gick fel, försök igen senare"}}catch(n){this.generalError="Något gick fel, försök igen senare"}this.loading=false};this.handleSubmit=n=>{n.preventDefault();this.generalError=null;const t=this.date.length>0;if(!t){this.dateError="Ange ett giltigt datum"}const i=Array.from(this.el.querySelectorAll('input[type="checkbox"]'));const e=i.find((n=>!n.checked));if(e){this.generalError="Du måste godkänna villkoren"}if(t&&!e){this.sendOrder()}};this.handleKeyDown=n=>{this.enteredPin+=n.key;const t="+0033";if(this.enteredPin.length===t.length){if(this.enteredPin===t){localStorage.setItem("show_sources","true");this.showSources=true;window.removeEventListener("keydown",this.handleKeyDown)}this.enteredPin=""}clearTimeout(this.pinTimeout);this.pinTimeout=setTimeout((()=>this.enteredPin=""),5e3)};this.render=()=>{var n;const t=r(`./assets/date.svg`);const i=r(`./assets/down.svg`);const s=r(`./assets/spinner.gif`);if(x.checkoutEdit){return e("hemfixarna-address",null)}else if(x.checkoutStep===1){return e("hemfixarna-getuser",null)}else if(x.checkoutStep===2){return e("div",{class:"mb-2"},e("div",{class:"hemfixarna_addressinfo"},e("div",null,e("p",null,b(x.user.firstName)),e("p",null,b(x.user.lastName)),e("p",null,x.user.email),e("p",null,x.user.phone)),e("div",null,e("p",null,b(x.user.street)),e("p",null,b(x.user.zip)),e("p",null,b(x.user.town))),e("button",{onClick:()=>x.checkoutEdit=true},"Behöver du ändra adressen?")),e("form",{onSubmit:n=>this.handleSubmit(n)},e("div",null,e("img",{src:t,width:24}),e("input",{class:`${this.date.length?"input_active":""}`,min:(new Date).toISOString().split("T")[0],onChange:n=>this.handleChangeDate(n),type:"date",name:"date",value:this.date}),e("label",{htmlFor:"date"},"Tidigaste datum för hembesök"),e("img",{src:i,width:24})),this.dateError&&e("span",null,this.dateError),x.customer.source&&this.showSources?e(a,null,e("p",null,"Inloggad som:",e("strong",null," ",x.customer.source.fieldData.So01_Name)),e("label",null,"Säljare (SäljarId)",e("input",{type:"text",value:this.sellerID,onChange:n=>this.sellerID=n.target.value})),e("label",null,"PartnerOrderID (RefferalID)",e("input",{type:"text",value:this.RefferalID,onChange:n=>this.RefferalID=n.target.value})),((n=x.customer.source.sub_sources)===null||n===void 0?void 0:n.length)?e("div",null,e("select",{onChange:n=>this.selectedSubSource=n.target.value},e("option",{disabled:true,selected:true,value:"null"},"Välj underkälla"),x.customer.source.sub_sources.map((n=>e("option",{value:n["So_SubSource::_id"]},n["So_SubSource::Sus01_Name"]))))):e("h4",null,"Det finns inga underkällor att välja")):null,e("label",{class:"hemfixarna_checkbox"},e("input",{onChange:()=>this.handleChangeTerms(),type:"checkbox"}),e("span",{innerHTML:x.options.terms})),x.cart.filter((n=>{var t;return(t=n.terms_checkout)===null||t===void 0?void 0:t.length})).map((n=>e(a,null,e("label",{class:"hemfixarna_checkbox"},e("input",{onChange:()=>this.handleChangeTerms(),type:"checkbox"}),e("span",null,n.terms_checkout))))),this.generalError&&e("span",null,this.generalError),e("div",{class:this.loading?"loading":""},e("input",{type:"submit",value:this.loading?"":"Skicka bokning"}),e("img",{width:20,height:20,src:s,alt:"spinner"}))))}};this.date="";this.dateError=null;this.generalError=null;this.loading=false;this.enteredPin="";this.selectedSubSource=null;this.partnerOrderId=null;this.showSources=false;this.sellerID=null;this.RefferalID=null}componentWillLoad(){if(Boolean(x.user&&x.user.street)){x.checkoutStep=2}if(x.customer&&x.customer.source){window.addEventListener("keydown",this.handleKeyDown)}const n=localStorage.getItem("show_sources");if(n){this.showSources=true}}disconnectedCallback(){window.removeEventListener("keydown",this.handleKeyDown)}get el(){return s(this)}};const en='@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap");\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n* {\n box-sizing: border-box;\n}\n\n:host {\n font-family: "Inter", sans-serif;\n}\n:host input[type=text] {\n padding: 16px;\n width: 100%;\n font-size: 16px;\n border: 1px solid #fcd9c9;\n}\n:host .mb-2 {\n margin-bottom: 32px;\n}\n:host button {\n color: #474444;\n}\n:host form {\n display: flex;\n flex-direction: column;\n gap: 16px;\n position: relative;\n}\n:host form button {\n position: absolute;\n right: 0;\n top: -1rem;\n}\n:host form img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n pointer-events: none;\n}\n:host form img:first-of-type {\n left: 16px;\n}\n:host form img:last-of-type {\n right: 16px;\n}\n:host form span {\n margin-top: -8px;\n color: #ec6632;\n}\n:host form p {\n text-align: center;\n}\n:host form p {\n margin: 0;\n}\n:host form div {\n position: relative;\n}\n:host form div label {\n pointer-events: none;\n position: absolute;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n background: #fff;\n padding: 4px;\n transition: 0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n}\n:host form div input {\n padding: 16px;\n width: 100%;\n font-size: 16px;\n border: 1px solid #fcd9c9;\n}\n:host form div input:focus ~ label,\n:host form div .input_active ~ label {\n top: 0;\n transform: translateY(-50%);\n background: linear-gradient(180deg, #fffaf2 50%, #fff 50%);\n}\n:host form select {\n padding: 0.75rem 1rem;\n width: 100%;\n}\n:host h1 {\n font-size: 24px;\n font-weight: 400;\n line-height: 32px;\n letter-spacing: -3%;\n text-align: left;\n margin: 0 0 8px;\n}\n:host h2 {\n margin: 0 0 24px;\n font-weight: 700;\n font-size: 20px;\n line-height: 28px;\n letter-spacing: -3%;\n}\n:host p {\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna {\n width: 100%;\n /* Hide default HTML checkbox */\n /* The slider */\n}\n:host .hemfixarna_contact {\n display: flex;\n gap: 16px;\n}\n:host .hemfixarna_contact a {\n display: flex;\n align-items: center;\n gap: 8px;\n color: #474444;\n text-decoration: none;\n font-weight: 600;\n font-size: 13px;\n}\n:host .hemfixarna_contact a:hover {\n text-decoration: underline;\n}\n:host .hemfixarna_contact--horizontal span {\n display: none;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_contact--horizontal span {\n display: initial;\n }\n}\n:host .hemfixarna_painting {\n opacity: 0;\n padding: 0 1rem;\n animation: fadeIn 0.5s forwards 0.3s;\n}\n:host .hemfixarna_painting > h2,\n:host .hemfixarna_painting p {\n text-align: center;\n padding: 0 16px;\n}\n:host .hemfixarna_painting > h2 {\n margin: 0 0 8px;\n}\n:host .hemfixarna_partnerlogo {\n max-height: 50px;\n min-height: 45px;\n object-fit: contain;\n max-width: 150px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_partnerlogo {\n max-width: 200px;\n }\n}\n:host .hemfixarna_nav {\n position: absolute;\n top: 0;\n width: 100dvw;\n left: 0;\n height: 80px;\n z-index: 9999;\n}\n:host .hemfixarna_nav--links {\n display: none !important;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav--links {\n display: flex !important;\n }\n}\n:host .hemfixarna_nav--links a {\n color: #ec6632;\n text-decoration: none;\n border: 1px solid rgba(255, 255, 255, 0.3);\n border-radius: 56px;\n padding: 8px 32px;\n text-transform: capitalize;\n}\n:host .hemfixarna_nav > div {\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 16px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav > div {\n padding: 0 32px;\n }\n}\n:host .hemfixarna_nav > div > div {\n display: flex;\n gap: 32px;\n justify-content: space-between;\n}\n:host .hemfixarna_nav > div > img {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: -1;\n}\n:host .hemfixarna_nav a {\n text-decoration: none;\n}\n:host .hemfixarna_nav p {\n color: #474444;\n}\n:host .hemfixarna_nav p.with-bg {\n color: #fff;\n}\n:host .hemfixarna_standalone .hemfixarna_backdrop {\n background: #fffaf2;\n opacity: 1;\n}\n:host .hemfixarna_standalone .hemfixarna_modal {\n top: 80px;\n transform: translateX(-50%);\n border: none;\n height: calc(100dvh - 80px);\n opacity: 0;\n}\n:host .hemfixarna_standalone .hemfixarna_modal--open {\n opacity: 1;\n}\n:host .hemfixarna .switch {\n position: relative;\n display: inline-block;\n width: 40px;\n height: 20px;\n}\n:host .hemfixarna .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n}\n:host .hemfixarna .slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 34px;\n}\n:host .hemfixarna .slider:before {\n position: absolute;\n content: "";\n height: 18px;\n width: 18px;\n left: 2px;\n bottom: 1px;\n background-color: white;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 50%;\n}\n:host .hemfixarna input:checked + .slider {\n background-color: #fcd9c9;\n}\n:host .hemfixarna input:focus + .slider {\n box-shadow: 0 0 1px #fcd9c9;\n}\n:host .hemfixarna input:checked + .slider:before {\n -webkit-transform: translateX(18px);\n -ms-transform: translateX(18px);\n transform: translateX(18px);\n background: #ec6632;\n}\n:host .hemfixarna_maleribox {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n width: 100%;\n min-height: 132px;\n padding: 24px;\n display: flex;\n align-items: center;\n gap: 24px;\n text-align: left;\n}\n:host .hemfixarna_maleribox:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_checkbox {\n display: grid;\n grid-template-columns: 40px auto;\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna_checkbox > span {\n transform: translateY(6px);\n}\n:host .hemfixarna_checkbox span,\n:host .hemfixarna_checkbox span p {\n color: #474444;\n font-size: 14px;\n}\n:host .hemfixarna_checkbox p {\n text-align: left;\n}\n:host .hemfixarna_info {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 32px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n border-radius: 4px;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_info h2 {\n margin: 0;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_info {\n position: sticky;\n top: 0;\n }\n}\n:host .hemfixarna_infomodal {\n position: absolute;\n top: 40%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n max-width: 80%;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n padding: 32px;\n z-index: 99;\n border-radius: 4px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n:host .hemfixarna_infomodal p,\n:host .hemfixarna_infomodal h4 {\n margin: 0;\n}\n:host .hemfixarna_infomodal button {\n background: #ec6632;\n color: #fff;\n border-radius: 60px;\n font-size: 16px;\n padding: 8px 16px;\n}\n:host .hemfixarna_addressinfo {\n padding: 16px 16px 64px;\n border: 1px solid #fcd9c9;\n position: relative;\n margin-bottom: 32px;\n display: grid;\n grid-template-columns: 1fr;\n gap: 8px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_addressinfo {\n grid-template-columns: 1fr 1fr;\n }\n}\n:host .hemfixarna_addressinfo button {\n position: absolute;\n bottom: 16px;\n right: 16px;\n font-weight: 500;\n text-underline-offset: 2px;\n text-decoration: underline;\n}\n:host .hemfixarna_part {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: grid;\n padding: 16px;\n grid-template-columns: auto 75px;\n}\n:host .hemfixarna_counter {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_counter span {\n padding: 0 8px;\n}\n:host .hemfixarna_counter img {\n cursor: pointer;\n}\n:host .hemfixarna_counter img:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_description {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_description ul {\n list-style: disc;\n padding-right: 12px;\n transform: translateX(12px);\n}\n:host .hemfixarna_description--hidden {\n max-height: 140px;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n}\n:host .hemfixarna_description--hidden::after {\n content: "";\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 128px;\n background: linear-gradient(180deg, rgba(255, 253, 250, 0), rgba(255, 253, 250, 0.46) 50%, #fffaf2);\n}\n:host .hemfixarna_terms {\n font-size: 14px;\n}\n:host .hemfixarna_terms a {\n color: inherit;\n}\n:host .hemfixarna_logo {\n height: 64px;\n}\n:host .hemfixarna_box {\n padding: 16px;\n display: flex;\n align-items: center;\n width: 100%;\n box-sizing: border-box;\n border-radius: 4px;\n gap: 16px 8px;\n border-radius: 4px;\n gap: 16px 8px;\n}\n:host .hemfixarna_box p,\n:host .hemfixarna_box span {\n font-size: 15px;\n}\n:host .hemfixarna_box .underline {\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n:host .hemfixarna_box .pointer {\n cursor: pointer;\n}\n:host .hemfixarna_box .p-s {\n font-size: 12px;\n}\n:host .hemfixarna_box > div {\n display: grid;\n gap: 8px;\n}\n:host .hemfixarna_box--standard {\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_box--alternative, :host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n background: transparent;\n border: 1px solid #e3e3e3;\n}\n:host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n box-shadow: 0px 2px 16px 0px rgba(0, 0, 0, 0.0784313725);\n}\n:host .hemfixarna_box--alternative_3 {\n justify-content: center;\n}\n:host .hemfixarna_altbtn {\n display: flex !important;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n margin-left: auto;\n}\n:host .hemfixarna_btn {\n margin-left: auto;\n}\n:host .hemfixarna_btn, :host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n border: none;\n border-radius: 60px;\n font-weight: 600;\n letter-spacing: 0.5px;\n line-height: 20px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_btn:not(.disabled):hover, :host .hemfixarna_buy:not(.disabled):hover,\n:host .hemfixarna input[type=submit]:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna div:has(> input[type=submit]) {\n position: relative;\n}\n:host .hemfixarna div:has(> input[type=submit]) input {\n cursor: pointer;\n}\n:host .hemfixarna div:has(> input[type=submit]) img {\n display: none;\n}\n:host .hemfixarna .loading {\n cursor: default;\n opacity: 0.6;\n}\n:host .hemfixarna .loading > img {\n display: initial !important;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n:host .hemfixarna_btn {\n font-size: 14px;\n background: #c84e18;\n color: #fff;\n padding: 16px 24px;\n white-space: nowrap;\n position: relative;\n}\n:host .hemfixarna_btn span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -6px;\n right: -12px;\n}\n:host .hemfixarna_btn span {\n background: #25a710;\n color: #fff;\n right: 0 !important;\n}\n:host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n font-size: 21px;\n background: #25a710;\n color: #fff;\n padding: 16px 24px;\n}\n:host .hemfixarna .disabled {\n opacity: 0.5;\n cursor: default;\n}\n:host .hemfixarna_modal {\n position: fixed;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n border-radius: 4px;\n top: 50%;\n left: 50%;\n z-index: 1000;\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n transform: translate(-50%, -50%) scale(0.7);\n opacity: 0;\n height: 92%;\n width: 92%;\n max-width: 920px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n:host .hemfixarna_modal--open {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n}\n:host .hemfixarna_backdrop {\n z-index: 999;\n position: fixed;\n background: #474444;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n 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);\n}\n:host .hemfixarna_backdrop--open {\n opacity: 0.3;\n}\n:host .hemfixarna_order {\n position: absolute;\n top: -1px;\n left: -1px;\n right: -1px;\n bottom: -1px;\n background-repeat: no-repeat !important;\n background-size: cover !important;\n background-position: center !important;\n display: grid;\n grid-template-columns: 1fr 1fr;\n padding: 48px 32px 64px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_order {\n grid-template-columns: 1fr;\n grid-template-rows: 0 auto;\n }\n}\n:host .hemfixarna_order > div:last-of-type {\n background: #fffaf2;\n padding: 32px;\n display: flex;\n flex-direction: column;\n max-height: 100%;\n overflow: auto;\n}\n:host .hemfixarna_order img {\n cursor: pointer;\n}\n:host .hemfixarna_order button {\n margin: 16px 0;\n padding: 0;\n text-decoration: underline;\n text-underline-offset: 2px;\n font-size: 14px;\n font-weight: 600;\n}\n:host .hemfixarna_cart {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart {\n grid-template-columns: 1fr;\n gap: 0;\n }\n}\n:host .hemfixarna_cart--right h2, :host .hemfixarna_cart--left h2 {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_cart--right h2 img, :host .hemfixarna_cart--left h2 img {\n margin-top: 3.2px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_cart--left h2 button {\n display: none;\n }\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart--right h2 button {\n display: none;\n }\n}\n:host .hemfixarna_cart--startfee {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot div {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_cart--additional {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 16px;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--additional p {\n font-size: 14px;\n}\n:host .hemfixarna_cart--additional strong {\n text-decoration: underline;\n text-underline-offset: 2px;\n cursor: pointer;\n position: relative;\n}\n:host .hemfixarna_cart--additional strong img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: -24px;\n}\n:host .hemfixarna_cart--price {\n border-top: 1px solid #fcd9c9;\n padding: 16px;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--price h3 {\n margin: 0;\n}\n:host .hemfixarna_cart--item {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 16px 0;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--item span {\n font-size: 12px;\n}\n:host .hemfixarna_cart--item > div {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--item > div > div {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n:host .hemfixarna_cart--item > div button {\n color: #ec6632;\n}\n:host .hemfixarna_categories {\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n:host .hemfixarna_categories--wrapper {\n gap: 32px;\n display: grid;\n grid-template-columns: 1fr 1fr;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_categories--wrapper {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_categories li {\n position: relative;\n background: #fff;\n border-radius: 4px;\n min-height: 132px;\n padding: 24px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n align-items: center;\n gap: 24px;\n cursor: pointer;\n}\n:host .hemfixarna_categories li:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_categories li > button {\n height: 100%;\n width: 100%;\n}\n:host .hemfixarna_categories li .price {\n font-weight: 700;\n}\n:host .hemfixarna_content {\n height: 100%;\n overflow: auto;\n padding: 0 32px 64px;\n}\n:host .hemfixarna_content--5 {\n padding-top: 16px;\n}\n:host .hemfixarna_content--painting {\n padding: 0;\n overflow: initial;\n}\n:host .hemfixarna_crumbs {\n position: relative;\n padding: 16px 24px;\n border-bottom: 1px solid #fcd9c9;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_crumbs--back {\n padding: 16px 24px 8px;\n display: flex;\n align-items: center;\n gap: 8px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs--back:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_crumbs img {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .close {\n position: absolute;\n right: -16px;\n top: -16px;\n z-index: 9;\n -webkit-transform: translate3d(0, 0, 0);\n}\n:host .hemfixarna_crumbs .cart {\n display: flex;\n padding-left: 16px;\n position: relative;\n}\n:host .hemfixarna_crumbs .cart img {\n cursor: inherit;\n}\n:host .hemfixarna_crumbs .cart span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -6px;\n right: -12px;\n}\n:host .hemfixarna_crumbs .cart_active {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .cart_active span {\n background: #25a710;\n color: #fff;\n}\n:host .hemfixarna_crumbs--links {\n display: flex;\n align-items: center;\n gap: 16px;\n overflow: auto;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_crumbs--links {\n -ms-overflow-style: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar {\n display: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar-button {\n display: none;\n }\n}\n:host .hemfixarna_crumbs--right {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_crumbs button {\n white-space: nowrap;\n background: #f1ded6;\n border-radius: 64px;\n padding: 12px 16px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.3px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs button:not(.active):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n@media (max-width: 768px) {\n :host .hemfixarna_crumbs button {\n display: none;\n }\n}\n:host .hemfixarna_crumbs .active {\n background: #fffaf2;\n cursor: default;\n}\n:host .hemfixarna_features {\n gap: 12px !important;\n}\n:host .hemfixarna_features li {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_address {\n margin-bottom: 16px;\n}\n:host .hemfixarna_product {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_product--link {\n font-weight: 700;\n color: #474444;\n text-underline-offset: 4px;\n}\n:host .hemfixarna_product--left {\n gap: 32px;\n}\n:host .hemfixarna_product--right {\n gap: 32px;\n}\n:host .hemfixarna_product--price {\n margin-top: 4px;\n font-weight: 700;\n}\n:host .hemfixarna_product--total {\n text-align: center;\n margin: -16px 0;\n font-size: 21px;\n line-height: 28px;\n}\n:host .hemfixarna_product--item {\n background: #fff;\n padding: 16px;\n display: grid;\n grid-template-columns: auto 75px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_product--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--grid {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_product--grid > div {\n display: flex;\n flex-direction: column;\n}\n:host .hemfixarna_product--grid ul {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n:host .hemfixarna_product p {\n margin: 0;\n}\n:host .hemfixarna_product--top {\n display: flex;\n gap: 32px;\n}\n:host .hemfixarna_product--top img {\n object-fit: contain;\n}\n:host .hemfixarna_product--top > div {\n width: 100%;\n}\n:host .hemfixarna_product--top > div h1 {\n max-width: 80%;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--top > div h1 {\n max-width: 100%;\n }\n}\n:host .hemfixarna_product--top h4 {\n margin-bottom: 8px;\n}\n:host h5,\n:host p {\n margin: 0;\n}\n:host input[type=submit] {\n cursor: pointer;\n}\n:host input[type=date] ~ label {\n left: 56px;\n}\n:host input[type=date] {\n border: 1px solid #fcd9c9;\n padding-left: 64px;\n}\n:host input[type=checkbox] {\n height: 18px;\n width: 18px;\n border: 1px solid #fcd9c9;\n}\n:host input[type=checkbox]:checked {\n background: red;\n}\n:host input[type=date]::-webkit-calendar-picker-indicator {\n background: transparent;\n bottom: 0;\n color: transparent;\n cursor: pointer;\n height: auto;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n width: auto;\n}\n:host button,\n:host a {\n cursor: pointer;\n background: none;\n border: none;\n}\n:host ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}';const sn=class{constructor(n){i(this,n);this.slugIsOldFormat=n=>{if(!n)return false;return["product","service","category"].some((t=>n.includes(t)))};this.triggerScrollTotop=()=>{const n=this.el.shadowRoot.querySelector(".hemfixarna_content");v(n)};this.modal=false;this.showModal=false;this.tree=null;this.product=null;this.proppedProduct=null;this.slug=undefined;this.id=undefined;this.business=undefined;this.topCategory=undefined;this.forceOldTree=false;this.loadFromQuery=false;this.isDemo=false;this.widgetStyle=undefined;this.nav=undefined;this.buttonColor=undefined;this.buttonBg=undefined}loadCategoryOrProduct(n){this.proppedProduct=null;if(n.startsWith("c-")){const t=[...x.customer.categories,...x.customer.categories.map((n=>{var t;return(t=n.sub_categories)!==null&&t!==void 0?t:[]}))].flat();const i=t.find((t=>t&&t.id===n.replace("c-","")));if(i){x.selectedCustomerCategory=i;x.step=2}}else{const t=x.customer.categories.map((n=>n.show_products?n.products:n.sub_categories?n.sub_categories.map((n=>n.products)):[])).flat().flat();const i=t.find((t=>t&&t.fields.ID===parseInt(n)));if(i){x.selectedProduct=i.fields;x.step=4;this.proppedProduct=i.fields}}}async watchSlugChange(n){if(this.slugIsOldFormat(n)){this.fetchNewTaxonomy(n)}else if(x.customer&&n){this.loadCategoryOrProduct(n)}}async watchIdChange(n){if(n&&x.customer){if(n==="maleri"){x.maleri=true;x.step=4}else{this.loadCategoryOrProduct(n)}}}async fetchNewTaxonomy(n){x.selectedCategory=null;x.selectedProduct=null;x.selectedService=null;x.maleri=null;const t=await E(n);if((t===null||t===void 0?void 0:t.code)==="not_found"||(t===null||t===void 0?void 0:t.code)==="rest_no_route"){console.log("taxonomy not found")}else if(t){this.setTaxonomy(t);if((t===null||t===void 0?void 0:t.post_type)==="ikea_product"){this.product=t}}}async componentWillLoad(){x.business=this.business;const n=window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);if(n){x.cart=JSON.parse(n)}const t=window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);if(t){x.user=JSON.parse(t)}const i=window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);if(i){x.creditSafeUser=JSON.parse(i)}const[e,s,a,r,o,l]=await Promise.all([this.topCategory?E(this.topCategory):null,this.slug?E(this.slug):Promise.resolve(null),W(),Z(),X(),Y()]);if((!this.slug||!this.slugIsOldFormat(this.slug))&&!this.forceOldTree){try{const n=await J(this.business);if((n===null||n===void 0?void 0:n.code)==="not_found"){console.warn("customer not found")}else if(n){x.customer=n;if(this.id){if(this.id==="maleri"){x.maleri=true;x.step=4}else{this.loadCategoryOrProduct(this.id)}}else if(this.slug&&!this.slugIsOldFormat(this.slug)){this.loadCategoryOrProduct(this.slug)}}}catch(n){console.warn("customer not found")}}if((e===null||e===void 0?void 0:e.code)==="not_found");else if(e){this.tree=e}if((s===null||s===void 0?void 0:s.code)==="not_found"){console.log("taxonomy not found")}else if(s){this.setTaxonomy(s);if((s===null||s===void 0?void 0:s.post_type)==="ikea_product"){this.product=s}}if(this.loadFromQuery){const n=new URL(document.location.toString()).searchParams;this.id=n.get("id");if(!this.isDemo){this.openModal()}}x.rotOptions=o;x.rutOptions=r;x.greenOptions=l;x.options=a}setTaxonomy(n){if(n){if((n===null||n===void 0?void 0:n.taxonomy)==="service_cat"){x.selectedCategory=n;x.step=2}else if((n===null||n===void 0?void 0:n.post_type)==="service"){x.selectedService=n;x.selectedCategory=this.tree.sub_cats.find((t=>t.services.find((t=>t.ID===n.ID))));x.step=3}else if((n===null||n===void 0?void 0:n.post_type)==="ikea_product"){x.selectedProduct=n;x.selectedService=this.tree.sub_cats.map((n=>n.services)).flat().find((n=>n.products.find((n=>n.ID===x.selectedProduct.ID))));x.selectedCategory=this.tree.sub_cats.find((n=>n.services.find((n=>n.ID===x.selectedService.ID))));x.step=4}this.triggerScrollTotop()}}openModal(){this.modal=true;setTimeout((()=>{this.showModal=true}),50)}closeModal(){this.showModal=false;setTimeout((()=>{this.modal=false}),200)}handleClick(n){if(this.loadFromQuery&&!this.isDemo)return;if((n===null||n===void 0?void 0:n.composedPath()[0]).classList.contains("hemfixarna_backdrop")){this.closeModal()}const t=this.el.shadowRoot.querySelector(".hemfixarna_infomodal");if(t){const i=t.contains(n.composedPath()[0]);if(!i){x.modal=null}}}getCartLength(){return x.cart.reduce(((n,t)=>n+t.amount),0)}render(){var n,t,i,s,o,l,h,c,d,u,p,f,m,g,b,v;const _=r(`./assets/hemfixarna.svg`);const y=r(`./assets/pensel.svg`);const w=r(`./assets/montering.svg`);const k=((n=this.nav)===null||n===void 0?void 0:n.background)?r(this.nav.background):"";const C=((t=this.nav)===null||t===void 0?void 0:t.logo)?r(this.nav.logo):"";return e("div",{class:`hemfixarna ${this.loadFromQuery?"hemfixarna_standalone":""}`},this.loadFromQuery&&!this.isDemo&&this.nav?e("nav",{class:"hemfixarna_nav",style:{backgroundColor:(i=this.nav.backgroundColor)!==null&&i!==void 0?i:""}},e("div",null,e("div",{class:"hemfixarna_nav--logos"},e("a",{href:this.nav.url,target:"_blank"},e("img",{class:"hemfixarna_partnerlogo",src:C,alt:`${this.business} logo`})),e("a",{href:"https://hemfixarna.se/",target:"_blank"},e("p",{class:k||this.nav.backgroundColor?"with-bg":""},"I samarbete med:"),e("img",{src:_,alt:"hemfixarna_logo",width:104}))),e("div",{class:"hemfixarna_nav--links"},e("a",{href:this.nav.url,target:"_blank"},"Till ",this.business),e("a",{href:"https://www.hemfixarna.se/",target:"_blank"},"Till Hemfixarna")),k?e("img",{src:k,class:"nav_background",alt:"nav_background"}):null)):null,!this.loadFromQuery||this.isDemo?e("div",{class:`hemfixarna_box hemfixarna_box--${this.widgetStyle}`},[F.alternative_2,F.alternative_3].includes(this.widgetStyle)?e("img",{src:this.id==="maleri"?y:w,alt:"montering logo",width:32,height:32}):null,e("div",null,e("div",null,e("p",{onClick:()=>this.openModal(),class:`pointer ${[F.alternative_2,F.alternative_3].includes(this.widgetStyle)&&x.selectedProduct?"underline":""}`},this.id==="maleri"?e("span",null,"Beräkna fast pris på måleri & tapetsering här"):e(a,null,!x.selectedCustomerCategory&&!this.product&&!this.proppedProduct?e(a,null,((s=x.customer)===null||s===void 0?void 0:s.widget_title)?e("span",null,x.customer.widget_title):e("span",null,"Montering/Installation - ",e("strong",{class:"underline"},"se priser här"))):e(a,null,((o=this.product)===null||o===void 0?void 0:o.title)||((l=this.proppedProduct)===null||l===void 0?void 0:l.title)||((h=x.selectedCustomerCategory)===null||h===void 0?void 0:h.widget_title)||e("span",null,"Montering",e("wbr",null),"/Installation ",(d=(c=x.selectedCustomerCategory)===null||c===void 0?void 0:c.name)!==null&&d!==void 0?d:"på plats"," - ",e("strong",{class:"underline"},"se priser här")),this.product&&((u=this.slug)===null||u===void 0?void 0:u.includes("product"))||this.proppedProduct&&!((p=this.product)===null||p===void 0?void 0:p.invoice)&&!((f=this.proppedProduct)===null||f===void 0?void 0:f.invoice)?e("span",null," från"," ",e("strong",null,$(this.proppedProduct||this.product),"kr")):null)))),this.widgetStyle===F.standard?e("img",{src:_,width:104}):null,this.widgetStyle===F.alternative?e("span",{class:"p-s"},"Utförs av ",e("strong",null,"Hemfixarna")):null),[F.standard,F.alternative].includes(this.widgetStyle)?e("button",{onClick:()=>this.openModal(),class:"hemfixarna_btn",style:{color:((m=this.buttonColor)===null||m===void 0?void 0:m.startsWith("#"))||!((g=this.buttonColor)===null||g===void 0?void 0:g.length)?this.buttonColor:`#${this.buttonColor}`,backgroundColor:((b=this.buttonBg)===null||b===void 0?void 0:b.startsWith("#"))||!((v=this.buttonBg)===null||v===void 0?void 0:v.length)?this.buttonBg:`#${this.buttonBg}`}},"Beställ här",this.getCartLength()>0&&e("span",null,this.getCartLength())):null,F.alternative_2===this.widgetStyle?e("div",{class:"hemfixarna_altbtn"},e("strong",{class:"p-s"},"Utförs av"),e("img",{src:_,alt:"hemfixarna logo",width:98})):null):null,this.modal&&e("div",null,e("div",{class:`hemfixarna_modal ${this.showModal?"hemfixarna_modal--open":""}`},x.modal&&e("div",{class:"hemfixarna_infomodal"},x.modal.title&&e("h2",null,x.modal.title),x.modal.text.map((n=>e("p",{innerHTML:n}))),e("div",null,e("button",{onClick:()=>x.modal=null},"Stäng"))),(this.tree||x.customer)&&e("hemfixarna-breadcrumbs",{isDemo:this.isDemo,loadFromQuery:this.loadFromQuery,closeModal:()=>this.closeModal(),tree:this.tree}),!x.customer||this.slugIsOldFormat(this.slug)?e("div",{class:`hemfixarna_content hemfixarna_content--${x.step}`},x.step===1&&this.tree&&e("hemfixarna-start",{tree:this.tree}),x.step===2&&x.selectedCategory&&e("hemfixarna-category",null),x.step===3&&x.selectedService&&e("hemfixarna-service",null),x.step===4&&x.selectedProduct&&e("hemfixarna-product",null),x.step===5&&e("hemfixarna-cart",{tree:this.tree}),x.step===6&&e("hemfixarna-order",{tree:this.tree})):e("div",{class:`hemfixarna_content hemfixarna_content--${x.step} ${x.step===4&&x.maleri?"hemfixarna_content--painting":""}`},x.step<4&&e("hemfixarna-start",null),x.step===4&&e("hemfixarna-product",null),x.step===5&&e("hemfixarna-cart",{tree:this.tree}),x.step===6&&e("hemfixarna-order",{tree:this.tree}))),!this.isDemo?e("div",{class:`hemfixarna_backdrop ${this.showModal?"hemfixarna_backdrop--open":""}`}):null))}static get assetsDirs(){return["assets"]}get el(){return s(this)}static get watchers(){return{slug:["watchSlugChange"],id:["watchIdChange"]}}};sn.style=en;const an=class{constructor(n){i(this,n);this.vertical=false}render(){return e("div",{class:`hemfixarna_contact ${this.vertical?"hemfixarna_contact--vertical":"hemfixarna_contact--horizontal"}`},e("a",{href:"tel:0770-220 720"},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M7 4V20H17V4H7ZM6 2H18C18.5523 2 19 2.44772 19 3V21C19 21.5523 18.5523 22 18 22H6C5.44772 22 5 21.5523 5 21V3C5 2.44772 5.44772 2 6 2ZM12 17C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18C11 17.4477 11.4477 17 12 17Z",fill:"#C84E18"})),e("span",null,"0770-220 720")),e("a",{href:"https://hemfixarna.se/kundservice/",target:"_blank"},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{"clip-path":"url(#clip0_1001_894)"},e("path",{d:"M21 12.22C21 6.73 16.74 3 12 3C7.31 3 3 6.65 3 12.28C2.4 12.62 2 13.26 2 14V16C2 17.1 2.9 18 4 18H5V11.9C5 8.03 8.13 4.9 12 4.9C15.87 4.9 19 8.03 19 11.9V19H11V21H19C20.1 21 21 20.1 21 19V17.78C21.59 17.47 22 16.86 22 16.14V13.84C22 13.14 21.59 12.53 21 12.22Z",fill:"#C84E18"}),e("path",{d:"M9 14C9.55228 14 10 13.5523 10 13C10 12.4477 9.55228 12 9 12C8.44772 12 8 12.4477 8 13C8 13.5523 8.44772 14 9 14Z",fill:"#C84E18"}),e("path",{d:"M15 14C15.5523 14 16 13.5523 16 13C16 12.4477 15.5523 12 15 12C14.4477 12 14 12.4477 14 13C14 13.5523 14.4477 14 15 14Z",fill:"#C84E18"}),e("path",{d:"M18 11.03C17.52 8.18 15.04 6 12.05 6C9.01997 6 5.75997 8.51 6.01997 12.45C8.48997 11.44 10.35 9.24 10.88 6.56C12.19 9.19 14.88 11 18 11.03Z",fill:"#C84E18"})),e("defs",null,e("clipPath",{id:"clip0_1001_894"},e("rect",{width:"24",height:"24",fill:"white"})))),e("span",null,"Kundservice")))}};const rn='@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:not(.hemfixarna_hosted){grid-template-columns:1fr 1fr}:host .hemfixarna_hosted .hemfixarna_scripts{display:none}:host>div{display:grid;gap:32px;width:100%;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}';const on=class{constructor(n){i(this,n);this.debounce=null;this.cdnLink='<script type="module" src="https://cdn.jsdelivr.net/npm//hemfixarna-web-components@latest/dist/hemfixarna-components/hemfixarna-components.esm.js"><\/script>';this.selectedSlug=undefined;this.selectedID=undefined;this.tooltipText="Kopiera till urklipp";this.tree=null;this.customer=null;this.widgetStyle=F.standard;this.buttonBg="";this.buttonColor="";this.partner=undefined;this.colorAccessibility=undefined}debouncedFunction(){if(this.debounce!==null){clearTimeout(this.debounce);this.debounce=null}this.debounce=window.setTimeout((()=>{this.checkColorAccessibility();this.debounce=null}),1500)}async checkColorAccessibility(){const n="#fff";const t="#c84e18";const i=this.buttonBg.length?this.buttonBg.startsWith("#")?this.buttonBg:`#${this.buttonBg}`:t;const e=this.buttonColor.length?this.buttonColor.startsWith("#")?this.buttonColor:`#${this.buttonColor}`:n;fetch("https://www.aremycolorsaccessible.com/api/are-they",{mode:"cors",method:"POST",body:JSON.stringify({colors:[i,e]})}).then((n=>n.json())).then((n=>{if(n&&n){this.colorAccessibility=n}}))}getTopLevelCategory(){switch(process.env.BUSINESS){case O.byggmax:return M.byggmax;default:return""}}getColor(n){switch(n){case"AAA":return"green";case"AA":return"orange";case"A":return"yellow";case"Fail":return"red";default:return"black"}}async componentWillLoad(){var n;if(process.env.FORCE_OLD_TREE){const n=await E(this.getTopLevelCategory());if((n===null||n===void 0?void 0:n.code)==="not_found");else if(n){this.tree=n}}else{const t=window.location.pathname.replace("/","");this.partner=N(t)?t:(n=process.env.BUSINESS)!==null&&n!==void 0?n:O.kund;const i=await J(this.partner);if(i.code!=="not_found"&&i){this.customer=i}}}getExample(){return`<hemfixarna-${this.partner}${this.selectedSlug?` slug="${this.selectedSlug}" `:""}${this.selectedID?` id="${this.selectedID}" `:""} ${this.widgetStyle===F.standard?"":`widget-style="${this.widgetStyle}"`} ${this.buttonColor.length?`button-color="${this.buttonColor}"`:""} ${this.buttonBg.length?`button-bg="${this.buttonBg}"`:""}></hemfixarna-${this.partner}>`}copyExample(){navigator.clipboard.writeText(this.getExample());this.tooltipText="Snippet kopierad";setTimeout((()=>{this.tooltipText="Kopiera till urklipp"}),2e3)}copyCdn(){navigator.clipboard.writeText(this.cdnLink);this.tooltipText="Text kopierad";setTimeout((()=>{this.tooltipText="Kopiera till urklipp"}),2e3)}copyNpmInstall(){navigator.clipboard.writeText("npm i hemfixarna-web-components");this.tooltipText="Text kopierad";setTimeout((()=>{this.tooltipText="Kopiera till urklipp"}),2e3)}showMaleri(){var n;const t=(n=this.customer)===null||n===void 0?void 0:n.categories.map((n=>n.sub_categories?n.sub_categories:n)).flat();return t===null||t===void 0?void 0:t.some((n=>n.add_painting))}render(){var n;const t=r(`./assets/copy.png`);return e("div",{class:((n=this.customer)===null||n===void 0?void 0:n.at_hemfixarna)?"hemfixarna_hosted":""},e("div",{class:"hemfixarna_scripts"},e("div",{onClick:()=>this.copyExample(),class:"hemfixarna_example"},e("p",null,this.getExample()),e("img",{src:t,height:20}),e("span",{class:"hemfixarna_example--tooltip"},this.tooltipText)),this.partner===O.byggmax&&e("hemfixarna-byggmax",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,forceOldTree:Boolean(process.env.FORCE_OLD_TREE),slug:this.selectedSlug,id:this.selectedID}),this.partner===O.skanska&&e("hemfixarna-skanska",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.sparfonster&&e("hemfixarna-sparfonster",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.string&&e("hemfixarna-string-furniture",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.hornbach&&e("hemfixarna-hornbach",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.traningspartner&&e("hemfixarna-traningspartner",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.superfront&&e("hemfixarna-superfront",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.zaptec&&e("hemfixarna-zaptec",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.tesla&&e("hemfixarna-tesla",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.forebygg&&e("hemfixarna-forebygg",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.doro&&e("hemfixarna-doro",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.elfa&&e("hemfixarna-elfa",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.kbygg&&e("hemfixarna-kbygg",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.fargvaruhuset&&e("hemfixarna-fargvaruhuset",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.norrgavel&&e("hemfixarna-norrgavel",{isDemo:true,buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.klint&&e("hemfixarna-klint",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.flyttsmart&&e("hemfixarna-flyttsmart",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.power&&e("hemfixarna-power",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),this.partner===O.kund&&e("hemfixarna-kund",{buttonColor:this.buttonColor,buttonBg:this.buttonBg,widgetStyle:this.widgetStyle,id:this.selectedID}),e("div",{class:"hemfixarna_install"},e("div",{onClick:()=>this.copyCdn(),class:"hemfixarna_example"},e("p",null,this.cdnLink),e("span",{class:"hemfixarna_example--tooltip"},this.tooltipText),e("img",{src:t,height:20}))),e("div",{class:"hemfixarna_widgetstyles"},e("h5",null,"Widget styles"),e("div",null,Object.values(F).map((n=>e("label",{key:n},e("input",{type:"radio",value:n,checked:this.widgetStyle===n,onChange:()=>this.widgetStyle=n}),n)))),e("div",null,e("div",null,e("h5",null,"Button background color"),e("input",{type:"text",value:this.buttonBg,onInput:n=>this.buttonBg=n.target.value})),e("div",null,e("h5",null,"Button text color"),e("input",{type:"text",value:this.buttonColor,onInput:n=>this.buttonColor=n.target.value})))),e("span",null,"Write an hexa code no # needed"),this.colorAccessibility?e("div",null,e("h5",null,"Tillgänglighetsrapport"),e("div",null,e("strong",null,"Liten text:"),e("span",{style:{color:this.getColor(this.colorAccessibility.small)}},this.colorAccessibility.small),e("br",null),e("strong",null,"Fet text:"),e("span",{style:{color:this.getColor(this.colorAccessibility.bold)}},this.colorAccessibility.bold),e("br",null),e("strong",null,"Stor text:"),e("span",{style:{color:this.getColor(this.colorAccessibility.large)}},this.colorAccessibility.large),e("br",null),e("strong",null,"Kontrastförhållande:")," ",this.colorAccessibility.contrast)):null),e("ul",{class:"hemfixarna_categories"},this.customer?e("div",null,this.customer.logo?e("div",{style:{width:"100%",display:"flex",justifyContent:"center"}},e("img",{style:{maxWidth:"250px",height:"auto",margin:"0 auto 2rem"},src:this.customer.logo.url,alt:this.customer.post_title})):null,this.showMaleri()?e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_categories--label--big"},e("div",null,e("p",null,"Måleriverktyget"),e("span",null,"maleri")),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText("maleri")},"Kopiera ID"),this.customer.at_hemfixarna?e("button",{onClick:()=>{var n;return navigator.clipboard.writeText(`${(n="https://hemfixarna.se")!==null&&n!==void 0?n:"https://hemfixarna.se"}/partner/${this.customer.post_name}?id=maleri`)}},"Kopiera URL"):e("button",{onClick:()=>this.selectedID="maleri"},"Ladda måleri")))):null,this.customer.categories.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_categories--label--big"},e("div",null,e("p",null,n.name),e("span",null,`c-${n.id}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`c-${n.id}`)},"Kopiera ID"),this.customer.at_hemfixarna?e("button",{onClick:()=>{var t;return navigator.clipboard.writeText(`${(t="https://hemfixarna.se")!==null&&t!==void 0?t:"https://hemfixarna.se"}/partner/${this.customer.post_name}?id=c-${n.id}`)}},"Kopiera URL"):e("button",{onClick:()=>this.selectedID=`c-${n.id}`},"Ladda kategori"))),n.show_products&&n.products?e("ul",null,n.products.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_product--label"},e("div",null,e("p",null,n.fields.title),e("span",null,n.fields.ID)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(String(n.fields.ID))},"Kopiera ID"),this.customer.at_hemfixarna?e("button",{onClick:()=>{var t;return navigator.clipboard.writeText(`${(t="https://hemfixarna.se")!==null&&t!==void 0?t:"https://hemfixarna.se"}/partner/${this.customer.post_name}?id=${n.fields.ID}`)}},"Kopiera URL"):e("button",{onClick:()=>this.selectedID=String(n.fields.ID)},"Ladda produkt"))))))):e("ul",null,n.sub_categories&&n.sub_categories.map((t=>e("li",null,e("div",{class:"hemfixarna_categories--label"},e("div",null,e("p",null,t.name),e("span",null,`c-${t.id}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`c-${t.id}`)},"Kopiera ID"),this.customer.at_hemfixarna?e("button",{onClick:()=>{var t;return navigator.clipboard.writeText(`${(t="https://hemfixarna.se")!==null&&t!==void 0?t:"https://hemfixarna.se"}/partner/${this.customer.post_name}?id=c-${n.id}`)}},"Kopiera URL"):e("button",{onClick:()=>this.selectedID=`c-${t.id}`},"Ladda kategori"))),e("ul",null,t.products.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_product--label"},e("div",null,e("p",null,n.fields.title),e("span",null,n.fields.ID)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(String(n.fields.ID))},"Kopiera ID"),this.customer.at_hemfixarna?e("button",{onClick:()=>{var t;return navigator.clipboard.writeText(`${(t="https://hemfixarna.se")!==null&&t!==void 0?t:"https://hemfixarna.se"}/partner/${this.customer.post_name}?id=${n.fields.ID}`)}},"Kopiera URL"):e("button",{onClick:()=>this.selectedID=String(n.fields.ID)},"Ladda produkt"))))))))))))))):this.tree?e("div",null,this.tree.sub_cats.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label hemfixarna_categories--label--big"},e("div",null,e("p",null,n.name),e("span",null,`category/${n.slug}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`category/${n.slug}`)},"Kopiera slug"),e("button",{onClick:()=>this.selectedSlug=`category/${n.slug}`},"Ladda kategori"))),e("ul",null,n.services.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label"},e("div",null,e("p",null,n.post_title),e("span",null,`service/${n.post_name}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`service/${n.post_name}`)},"Kopiera slug"),e("button",{onClick:()=>this.selectedSlug=`service/${n.post_name}`},"Ladda kategori"))),e("ul",null,n.products.map((n=>e("li",null,e("div",{class:"hemfixarna_categories--label"},e("div",null,e("p",null,n.post_title),e("span",null,`product/${n.post_name}`)),e("div",null,e("button",{onClick:()=>navigator.clipboard.writeText(`product/${n.post_name}`)},"Kopiera slug"),e("button",{onClick:()=>this.selectedSlug=`product/${n.post_name}`},"Ladda produkt"))))))))))))))):null))}static get watchers(){return{buttonBg:["debouncedFunction"],buttonColor:["debouncedFunction"]}}};on.style=rn;const ln="";const hn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.doro})}};hn.style=ln;const cn="";const dn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://elfa.com",logo:"assets/elfa.png"},loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.elfa,isDemo:this.isDemo})}};dn.style=cn;const un=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.fargvaruhuset,isDemo:this.isDemo})}};const pn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.flyttsmart,isDemo:this.isDemo})}};const fn="";const mn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.forebygg})}};mn.style=fn;var xn=class extends Error{constructor(){super("Invalid swedish personal identity number")}};var gn=(n,t)=>{const i=n.getTime()-t.getTime();return i<0?-1:i>0?1:i};var bn=(n,t)=>{const i=gn(n,t);const e=Math.abs(n.getFullYear()-t.getFullYear());n.setFullYear(n.getFullYear()-i*e);const s=gn(n,t)===-i;const a=i*(e-+s);return a===0?0:a};var vn=n=>{let t=0;n+="";for(let i=0,e=n.length;i<e;i++){let e=parseInt(n[i]);e*=2-i%2;if(e>9){e-=9}t+=e}return Math.ceil(t/10)*10-t};var _n=(n,t,i)=>{t-=1;const e=new Date(n,t,i);return!(e.getFullYear()!==n||e.getMonth()!==t||e.getDate()!==i)};var yn=class{constructor(n,t){this._century="";this._fullYear="";this._year="";this._month="";this._day="";this._sep="";this._num="";this._check="";this.parse(n,{allowCoordinationNumber:true,allowInterimNumber:false,...t})}get century(){return this._century}get fullYear(){return this._fullYear}get year(){return this._year}get month(){return this._month}get day(){return this._day}get sep(){return this._sep}get num(){return this._num}get check(){return this._check}static parse(n,t){return new yn(n,t)}static valid(n,t){try{yn.parse(n,t);return true}catch(n){return false}}parse(n,t){if(n.length<10||n.length>13){throw new xn}const i=/^(\d{2}){0,1}(\d{2})(\d{2})(\d{2})([+-]?)((?!000)\d{3}|[TRSUWXJKLMN]\d{2})(\d)$/;const e=i.exec(n);if(!e){throw new xn}const s=e[1];const a=e[2];const r=e[3];const o=e[4];const l=e[5];const h=e[6];const c=e[7];if(typeof s==="undefined"||!s.length){const n=new Date;let t=0;if(l==="+"){this._sep="+";t=n.getFullYear()-100}else{this._sep="-";t=n.getFullYear()}this._century=(""+(t-(t-parseInt(a))%100)).substr(0,2)}else{this._century=s;if((new Date).getFullYear()-parseInt(s+a,10)<100){this._sep="-"}else{this._sep="+"}}this._year=a;this._fullYear=this._century+a;this._month=r;this._day=o;this._num=h;this._check=c;if(!this.valid()){throw new xn}if(!(t==null?void 0:t.allowCoordinationNumber)&&this.isCoordinationNumber()){throw new xn}if(!(t==null?void 0:t.allowInterimNumber)&&this.isInterimNumber()){throw new xn}}valid(){const n=vn(this.year+this.month+this.day+this.num.replace(/[TRSUWXJKLMN]/,"1"))===+this.check&&!!this.check;if(n&&_n(parseInt(this.century+this.year),+this.month,+this.day)){return n}return n&&_n(parseInt(this.century+this.year),+this.month,+this.day-60)}format(n=false){if(n){return`${this.century}${this.year}${this.month}${this.day}${this.num}${this.check}`}return`${this.year}${this.month}${this.day}${this.sep}${this.num}${this.check}`}getAge(){const n=this.getDate();return bn(new Date(Date.now()),n)}getDate(){let n=+this.day;if(this.isCoordinationNumber()){n-=60}const t=this.century+this.year+"-"+this.month+"-"+(n<10?"0"+n:n);return new Date(t)}isInterimNumber(){return/[TRSUWXJKLMN]/.test(this.num[0])}isCoordinationNumber(){return _n(parseInt(this.century+this.year),+this.month,+this.day-60)}isFemale(){return!this.isMale()}isMale(){const n=parseInt(this.num.substr(-1));return n%2===1}};var wn=yn;function kn(n,t,i){return i={path:t,exports:{},require:function(n,t){return Cn()}},n(i,i.exports),i.exports}function Cn(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var $n=kn((function(n,t){Object.defineProperty(t,"__esModule",{value:true});t.utf8=void 0;t.utf8={encode:i,decode:e};function i(n){n=n.replace(/\r\n/g,"\n");var t="";for(var i=0;i<n.length;i++){var e=n.charCodeAt(i);if(e<128){t+=String.fromCharCode(e)}else if(e>127&&e<2048){t+=String.fromCharCode(e>>6|192);t+=String.fromCharCode(e&63|128)}else{t+=String.fromCharCode(e>>12|224);t+=String.fromCharCode(e>>6&63|128);t+=String.fromCharCode(e&63|128)}}return t}function e(n){var t="";var i=0;var e=0;var s=0;var a=0;while(i<n.length){e=n.charCodeAt(i);if(e<128){t+=String.fromCharCode(e);i++}else if(e>191&&e<224){s=n.charCodeAt(i+1);t+=String.fromCharCode((e&31)<<6|s&63);i+=2}else{s=n.charCodeAt(i+1);a=n.charCodeAt(i+2);t+=String.fromCharCode((e&15)<<12|(s&63)<<6|a&63);i+=3}}return t}}));var Sn=kn((function(n,t){Object.defineProperty(t,"__esModule",{value:true});t.generate=void 0;function i(n){var t=[];var i;var e;var a;var r;var o;var l;var m;var x;var g;var b=7;var v=12;var _=17;var y=22;var w=5;var k=9;var C=14;var $=20;var S=4;var B=11;var z=16;var j=23;var T=6;var I=10;var D=15;var O=21;var F=$n.utf8.encode(n);t=p(F);l=1732584193;m=4023233417;x=2562383102;g=271733878;for(i=0;i<t.length;i+=16){e=l;a=m;r=x;o=g;l=h(l,m,x,g,t[i+0],b,3614090360);g=h(g,l,m,x,t[i+1],v,3905402710);x=h(x,g,l,m,t[i+2],_,606105819);m=h(m,x,g,l,t[i+3],y,3250441966);l=h(l,m,x,g,t[i+4],b,4118548399);g=h(g,l,m,x,t[i+5],v,1200080426);x=h(x,g,l,m,t[i+6],_,2821735955);m=h(m,x,g,l,t[i+7],y,4249261313);l=h(l,m,x,g,t[i+8],b,1770035416);g=h(g,l,m,x,t[i+9],v,2336552879);x=h(x,g,l,m,t[i+10],_,4294925233);m=h(m,x,g,l,t[i+11],y,2304563134);l=h(l,m,x,g,t[i+12],b,1804603682);g=h(g,l,m,x,t[i+13],v,4254626195);x=h(x,g,l,m,t[i+14],_,2792965006);m=h(m,x,g,l,t[i+15],y,1236535329);l=c(l,m,x,g,t[i+1],w,4129170786);g=c(g,l,m,x,t[i+6],k,3225465664);x=c(x,g,l,m,t[i+11],C,643717713);m=c(m,x,g,l,t[i+0],$,3921069994);l=c(l,m,x,g,t[i+5],w,3593408605);g=c(g,l,m,x,t[i+10],k,38016083);x=c(x,g,l,m,t[i+15],C,3634488961);m=c(m,x,g,l,t[i+4],$,3889429448);l=c(l,m,x,g,t[i+9],w,568446438);g=c(g,l,m,x,t[i+14],k,3275163606);x=c(x,g,l,m,t[i+3],C,4107603335);m=c(m,x,g,l,t[i+8],$,1163531501);l=c(l,m,x,g,t[i+13],w,2850285829);g=c(g,l,m,x,t[i+2],k,4243563512);x=c(x,g,l,m,t[i+7],C,1735328473);m=c(m,x,g,l,t[i+12],$,2368359562);l=d(l,m,x,g,t[i+5],S,4294588738);g=d(g,l,m,x,t[i+8],B,2272392833);x=d(x,g,l,m,t[i+11],z,1839030562);m=d(m,x,g,l,t[i+14],j,4259657740);l=d(l,m,x,g,t[i+1],S,2763975236);g=d(g,l,m,x,t[i+4],B,1272893353);x=d(x,g,l,m,t[i+7],z,4139469664);m=d(m,x,g,l,t[i+10],j,3200236656);l=d(l,m,x,g,t[i+13],S,681279174);g=d(g,l,m,x,t[i+0],B,3936430074);x=d(x,g,l,m,t[i+3],z,3572445317);m=d(m,x,g,l,t[i+6],j,76029189);l=d(l,m,x,g,t[i+9],S,3654602809);g=d(g,l,m,x,t[i+12],B,3873151461);x=d(x,g,l,m,t[i+15],z,530742520);m=d(m,x,g,l,t[i+2],j,3299628645);l=u(l,m,x,g,t[i+0],T,4096336452);g=u(g,l,m,x,t[i+7],I,1126891415);x=u(x,g,l,m,t[i+14],D,2878612391);m=u(m,x,g,l,t[i+5],O,4237533241);l=u(l,m,x,g,t[i+12],T,1700485571);g=u(g,l,m,x,t[i+3],I,2399980690);x=u(x,g,l,m,t[i+10],D,4293915773);m=u(m,x,g,l,t[i+1],O,2240044497);l=u(l,m,x,g,t[i+8],T,1873313359);g=u(g,l,m,x,t[i+15],I,4264355552);x=u(x,g,l,m,t[i+6],D,2734768916);m=u(m,x,g,l,t[i+13],O,1309151649);l=u(l,m,x,g,t[i+4],T,4149444226);g=u(g,l,m,x,t[i+11],I,3174756917);x=u(x,g,l,m,t[i+2],D,718787259);m=u(m,x,g,l,t[i+9],O,3951481745);l=s(l,e);m=s(m,a);x=s(x,r);g=s(g,o)}return f(l)+f(m)+f(x)+f(g)}t.generate=i;function e(n,t){return n<<t|n>>>32-t}function s(n,t){var i;var e;var s;var a;var r;s=n&2147483648;a=t&2147483648;i=n&1073741824;e=t&1073741824;r=(n&1073741823)+(t&1073741823);if(i&e){return r^2147483648^s^a}if(i|e){if(r&1073741824){return r^3221225472^s^a}else{return r^1073741824^s^a}}else{return r^s^a}}function a(n,t,i){return n&t|~n&i}function r(n,t,i){return n&i|t&~i}function o(n,t,i){return n^t^i}function l(n,t,i){return t^(n|~i)}function h(n,t,i,r,o,l,h){n=s(n,s(s(a(t,i,r),o),h));return s(e(n,l),t)}function c(n,t,i,a,o,l,h){n=s(n,s(s(r(t,i,a),o),h));return s(e(n,l),t)}function d(n,t,i,a,r,l,h){n=s(n,s(s(o(t,i,a),r),h));return s(e(n,l),t)}function u(n,t,i,a,r,o,h){n=s(n,s(s(l(t,i,a),r),h));return s(e(n,o),t)}function p(n){var t;var i=n.length;var e=i+8;var s=(e-e%64)/64;var a=(s+1)*16;var r=Array(a-1);var o=0;var l=0;while(l<i){t=(l-l%4)/4;o=l%4*8;r[t]=r[t]|n.charCodeAt(l)<<o;l++}t=(l-l%4)/4;o=l%4*8;r[t]=r[t]|128<<o;r[a-2]=i<<3;r[a-1]=i>>>29;return r}function f(n){var t="";var i="";var e;var s;for(s=0;s<=3;s++){e=n>>>s*8&255;i="0"+e.toString(16);t=t+i.substr(i.length-2,2)}return t}}));var Bn=kn((function(n,t){Object.defineProperty(t,"__esModule",{value:true});t.MD5=t.generate=void 0;var i=Sn;Object.defineProperty(t,"generate",{enumerable:true,get:function(){return i.generate}});t.MD5={generate:Sn.generate}}));const zn=async n=>{var t;const i=await fetch((t="https://hemfixare-lookup.vercel.app/api")!==null&&t!==void 0?t:"https://hemfixare-lookup.vercel.app/api",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n,hash:Bn.MD5.generate(String.fromCharCode(83,101,67,82,101,116)+n)})});const e=await i.json();return e};const jn=class{constructor(n){i(this,n);this.handleChangeEmail=n=>{this.emailError=null;this.email=n.target.value};this.handleChangePhone=n=>{this.phoneError=null;this.phone=n.target.value};this.handleChangessn=n=>{this.ssnError=null;this.ssn=n.target.value};this.handleSubmit=async n=>{n.preventDefault();const t=new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);const i=t.test(this.email);if(!i){this.emailError="Ange en giltig e-postadress"}const e=/^[\d\s()+-]{6,}$/.test(this.phone);if(!e){this.phoneError="Ange ett giltigt telefonnummer"}const s=wn.valid(this.ssn);if(!s){this.ssnError="Ange ett giltigt personnummer"}else if(s){const n=wn.parse(this.ssn).format(true);this.ssn=[n.slice(0,8),"-",n.slice(8)].join("")}if(i&&e&&s){try{const n=await zn(this.ssn);if(n){x.creditSafeUser=n;x.checkoutStep=2;x.user=Object.assign(Object.assign({},n),{email:this.email,phone:this.phone,ssn:this.ssn})}else{this.ssnError="Vi kunde tyvärr inte hitta en address med ditt angivna personnummer"}}catch(n){this.ssnError="Vi kunde tyvärr inte hitta en address med ditt angivna personnummer";console.log(n)}finally{const n=this.el.closest(".hemfixarna_content");v(n)}}};this.render=()=>e("form",{class:"mb-2",onSubmit:n=>this.handleSubmit(n)},e("div",null,e("input",{class:`${this.email.length?"input_active":""}`,onChange:n=>this.handleChangeEmail(n),type:"email",name:"email",value:this.email}),e("label",{htmlFor:"email"},"E-post ")),this.emailError&&e("span",null,this.emailError),e("div",null,e("input",{class:`${this.phone.length?"input_active":""}`,onChange:n=>this.handleChangePhone(n),type:"tel",name:"phone",value:this.phone}),e("label",{htmlFor:"phone"},"Mobiltelefon ")),this.phoneError&&e("span",null,this.phoneError),e("div",null,e("input",{class:`${this.ssn.length?"input_active":""}`,onChange:n=>this.handleChangessn(n),type:"tel",name:"ssn",value:this.ssn}),e("label",{htmlFor:"phone"},"Personnummer*")),this.ssnError&&e("span",null,this.ssnError),e("input",{type:"submit",value:"Fortsätt*"}),e("p",null,"*Vi hämtar din adress"));this.email="";this.emailError=null;this.phone="";this.phoneError=null;this.ssn="";this.ssnError=null}componentWillLoad(){if(x.user){this.email=x.user.email;this.phone=x.user.phone;this.ssn=x.user.ssn}}get el(){return s(this)}};const Tn="";const In=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.isDemo=false;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("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:Boolean(this.loadFromQuery),id:this.id,business:O.hornbach})}};In.style=Tn;const Dn=class{constructor(n){i(this,n);this.logo=r(`./assets/hemfixarna.svg`)}render(){var n;const t=r(`./assets/checked.svg`);return e("div",{class:"hemfixarna_info"},x.step<5?e(a,null,e("h2",null,x.customer.info_title),e("p",null,x.customer.info_text)):e("h2",null,x.customer.checkout_title),e("ul",{class:"hemfixarna_features"},x.step<5?e(a,null,((n=x.customer.trust_badges)===null||n===void 0?void 0:n.length)?e(a,null,x.customer.trust_badges.map((n=>e("li",{key:n.text},e("img",{src:t,alt:"checked"}),e("p",null,n.text))))):e(a,null,x.options.trust.map((n=>e("li",{key:n.trust_badge},e("img",{src:t,alt:"checked"}),e("p",null,n.trust_badge)))))):e(a,null,x.customer.checkout_trust_badges.map((n=>e("li",{key:n.text},e("img",{src:t,alt:"checked"}),e("p",null,n.text)))))),e("img",{src:this.logo,width:200,alt:"hemfixarna"}),e("a",{class:"hemfixarna_product--link",target:"_blank",href:x.options.link.url},x.options.link.title))}};const On=':host .invoice{gap:16px;display:grid}:host .invoice form>span{text-align:center;padding:16px 0}:host .invoice img{right:unset;left:unset;position:initial;transform:none}:host .invoice label{cursor:pointer;font-size:14px;display:flex;align-items:flex-start;padding:16px 0}:host .invoice label input{margin:0 5px 0 0;accent-color:#ea662c}:host .invoice-preview{display:flex;gap:4px}:host .invoice-preview div{position:relative}:host .invoice-preview div button{position:absolute;top:0;right:0;padding:0}:host .invoice-preview div button img{width:24px;height:24px}:host .invoice-preview div>img{width:100px;height:80px;object-fit:cover}:host .invoice input[type=email],:host .invoice input[type=tel],:host .invoice textarea{padding:16px;border:1px solid #fcd9c9;font-size:16px}:host .invoice textarea{resize:none;height:200px;font-family:"Inter", sans-serif}:host .invoice div:has(>input[type=file]){display:flex;align-items:center;justify-content:center;cursor:pointer;background:#fff;border:1px solid #fcd9c9;padding:32px 16px;gap:16px}:host .invoice div:has(>input[type=file]) span{color:#000;font-size:12px}:host .invoice input[type=file]{display:none}';const Fn=`${"https://hemfixarna.se"}/wp-json/headless`;const Mn=class{constructor(n){i(this,n);this.formError=null;this.displayImages=[];this.formImages=[];this.formState="initial"}isValidEmail(n){const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return t.test(n)}componentDidRender(){const n=this.el.querySelector("form");if(n){n.addEventListener("input",(()=>{this.formError=null}))}}disconnectedCallback(){const n=this.el.querySelector("form");if(n){n.removeEventListener("input",(()=>{this.formError=null}))}}async submit(n){var t;n.preventDefault();this.formState="loading";this.formError=null;const i=n.currentTarget.elements;const e={description:i.descriptionInput.value.length?i.descriptionInput.value:null,email:i.emailInput.value.length?i.emailInput.value:null,tel:i.telInput.value.length?i.telInput.value:null,terms:(t=i.termsInput)===null||t===void 0?void 0:t.checked};if(!e.description){this.formError="Vänligen fyll i formulärtexten";this.formState="initial";return}if(!e.email||!this.isValidEmail(e.email)){this.formError="Vänligen ange en giltig e-postadress";this.formState="initial";return}if(!e.tel){this.formError="Vänligen ange ditt telefonnummer";this.formState="initial";return}if(x.selectedProduct.terms_show_checkbox&&!e.terms){this.formError="Vänligen acceptera villkoren";this.formState="initial";return}const s=new FormData;s.append("text",e.description);s.append("email",e.email);s.append("phone",e.tel);s.append("customer",x.business);this.formImages.forEach((n=>{s.append("images[]",n)}));s.append("product",JSON.stringify({title:x.selectedProduct.title,amount:1,has_rut:x.selectedProduct.rut,has_rot:x.selectedProduct.rot,has_green:x.selectedProduct.green,ID:x.selectedProduct.ID,parts:[]}));try{const n=await fetch(`${Fn}/saveinvoiceproduct`,{method:"POST",body:s});const{response:t}=await n.json();if(t.code===200){x.checkoutInvoice=true;x.step=6}else{this.formError="Vi kan inte ta emot din beställning just nu";this.formState="initial"}}catch(n){this.formError="Vi kan inte ta emot din beställning just nu";this.formState="initial"}}handleImageDrop(n){n.preventDefault();const t=n.dataTransfer.files;for(let n=0;n<t.length;n++){const i=t[n];if(i.type.startsWith("image/")){const n=new FileReader;n.onload=()=>{this.displayImages=[...this.displayImages,n.result];this.formImages=[...this.formImages,i]};n.readAsDataURL(i)}}}handleFileInputChange(n){n.preventDefault();const t=n.target.files;for(let n=0;n<t.length;n++){const i=t[n];if(i.type.startsWith("image/")){const n=new FileReader;n.onload=()=>{this.displayImages=[...this.displayImages,n.result];this.formImages=[...this.formImages,i]};n.readAsDataURL(i)}}}handleImageClick(){this.el.querySelector(".hemfixarna-file-upload").click()}preventDragOver(n){n.preventDefault()}removeImage(n){this.displayImages=this.displayImages.filter(((t,i)=>i!==n));this.formImages=this.formImages.filter(((t,i)=>i!==n))}render(){const n=r(`./assets/drag-drop.svg`);return e("div",{class:"invoice"},e("p",null,x.selectedProduct.invoice_description),e("form",{onSubmit:n=>this.submit(n)},e("textarea",{name:"descriptionInput",placeholder:"Beskriv ditt ärende"}),e("div",{role:"button","aria-label":"upload image",onDragOver:n=>this.preventDragOver(n),onDrop:n=>this.handleImageDrop(n),onClick:()=>this.handleImageClick()},e("img",{src:n,alt:"hemfixarna_logo",width:24}),e("div",null,e("p",null,"Bifoga ev bilder"),e("span",null,"(dra bilder hit)")),e("input",{onChange:n=>this.handleFileInputChange(n),class:"hemfixarna-file-upload",accept:"image/*",type:"file",multiple:true,name:"fileInput"})),e("div",{class:"invoice-preview"},this.displayImages.map(((n,t)=>e("div",{key:t},e("img",{src:n,alt:"uploaded image"}),e("button",{onClick:()=>this.removeImage(t)},e("img",{src:r(`./assets/close.svg`),alt:"close"})))))),e("input",{placeholder:"E-post",type:"email",name:"emailInput"}),e("input",{placeholder:"Telefonnummer",type:"tel",name:"telInput"}),x.selectedProduct.terms_show_checkbox?e("label",null,e("input",{type:"checkbox",name:"termsInput"}),x.selectedProduct.terms):null,this.formError?e("span",null,this.formError):null,e("input",{type:"submit",value:this.formState==="loading"?"Skickar":"Kontakta mig"})))}get el(){return s(this)}};Mn.style=On;const Ln=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://k-bygg.se",logo:"assets/kbygg.svg",backgroundColor:"#651d32"},loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.kbygg,isDemo:this.isDemo})}};const Nn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.klint})}};const Pn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.kund})}};const An=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined;this.isDemo=false}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://norrgavel.se",logo:"assets/norrgavel.svg"},loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.norrgavel,isDemo:this.isDemo})}};const Kn=class{constructor(n){i(this,n);this.render=()=>e("div",{style:{background:`url(${x.options.thank_you_image})`},class:"hemfixarna_order"},e("div",null),e("div",null,e("h2",null,x.checkoutInvoice?"Tack för din förfrågan":"Tack för din bokning"),x.checkoutInvoice?e("p",null,"Vi återkommer inom kort till dig på angivet telefonnummer eller epost"):null,x.checkoutInvoice?e("div",null):e("hemfixarna-orderrows",{tree:this.tree,cart:false}),e("span",{onClick:()=>this.resetShop()},e("button",null,"Gör en ny bokning")),e("hemfixarna-info",null)));this.tree=undefined}resetShop(){x.step=1;x.cart=[];x.selectedCategory=null;x.selectedService=null;x.selectedProduct=null;x.maleri=null;x.checkoutStep=1}disconnectedCallback(){this.resetShop()}};const Vn=class{constructor(n){i(this,n);this.cart=true;this.tree=undefined}goToProduct(n){if(x.customer){const t=x.customer.categories.map((n=>n.show_products?n.products:n.sub_categories?n.sub_categories.map((n=>n.products)):[])).flat().flat();const i=t.find((t=>t&&t.fields.ID===n));if(i){x.selectedProduct=i.fields;x.step=4}}else{const t=this.tree.sub_cats.map((n=>n.services)).flat();const i=t.map((n=>n.products)).flat();const e=i.find((t=>t.ID===n));const s=t.find((t=>t.products.find((t=>t.ID===n))));const a=this.tree.sub_cats.find((t=>t.services.find((t=>t.products.find((t=>t.ID===n))))));x.selectedCategory=a;x.selectedService=s;x.selectedProduct=e;x.step=4}}openRot(){x.modal={title:x.rotOptions.rot_start_fee_heading,text:[x.rotOptions.rot_start_fee_text,x.rotOptions.rot_start_fee_text_secondary]}}openRut(){x.modal={title:x.rutOptions.rut_start_fee_heading,text:[x.rutOptions.rut_start_fee_text,x.rutOptions.rut_start_fee_text_secondary]}}openGreen(){x.modal={title:x.greenOptions.green_start_fee_heading,text:[x.greenOptions.green_start_fee_text,x.greenOptions.green_start_fee_text_secondary]}}getDiscountedInfo(n){if(n.rut&&x.rut){return" (efter RUT-avdrag)"}else if(n.rot&&x.rot){return" (efter ROT-avdrag)"}else if(n.green&&x.green){return" (efter Grön teknik avdrag)"}else{return""}}render(){const n=r(`./assets/info.svg`);return e(a,null,e("ul",{class:"hemfixarna_cart--items"},x.cart.map((n=>{var t;return e("li",{class:"hemfixarna_cart--item"},e("div",null,e("div",null,n.icon&&e("img",{width:30,src:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,alt:n.name}),e("p",null,e("strong",null,n.amount,"x "),n.name)),this.cart&&e("button",{onClick:()=>this.goToProduct(n.id)},"Ändra")),e("p",null,e("strong",null,C(n,n.price,n.amount),"kr"),e("span",null,this.getDiscountedInfo(n))),n.parts.length>0&&e("ul",null,n.parts.map((t=>e("li",null,e("p",null,e("strong",null,t.amount,"x "),t.name),e("p",null,e("strong",null,S(t,n,t.amount),"kr")))))))}))),e("div",{class:"hemfixarna_cart--additional"},e("div",null,B().rot>0&&e("div",{class:"hemfixarna_cart--startfee"},e("p",null,e("strong",{onClick:()=>this.openRot()},x.rotOptions.rot_start_fee_heading,e("img",{height:16,src:n,alt:"info monteringsavgift"}))),e("p",null,B().rot,"kr")),B().rut>0&&e("div",{class:"hemfixarna_cart--startfee"},e("p",null,e("strong",{onClick:()=>this.openRut()},x.rutOptions.rut_start_fee_heading,e("img",{height:16,src:n,alt:"info monteringsavgift"}))),e("p",null,B().rut,"kr")),B().green>0&&e("div",{class:"hemfixarna_cart--startfee"},e("p",null,e("strong",{onClick:()=>this.openGreen()},x.greenOptions.green_start_fee_heading,e("img",{height:16,src:n,alt:"info monteringsavgift"}))),e("p",null,B().green,"kr"))),x.cart.find((n=>n.rot))&&e("div",{class:"hemfixarna_cart--rutrot"},e("div",null,this.cart&&e("label",{class:"switch"},e("input",{checked:x.rot,onChange:()=>x.rot=!x.rot,type:"checkbox"}),e("span",{class:"slider"})),e("p",null,"ROT-avdrag")),e("p",null,"(-",x.rot?j():0,"kr)")),x.cart.find((n=>n.rut))&&e("div",{class:"hemfixarna_cart--rutrot"},e("div",null,e("label",{class:"switch"},e("input",{onChange:()=>x.rut=!x.rut,checked:x.rut,type:"checkbox"}),e("span",{class:"slider"})),e("p",null,"RUT-avdrag")),e("p",null,"(-",x.rut?T():0,"kr)")),x.cart.find((n=>n.green))&&e("div",{class:"hemfixarna_cart--rutrot"},e("div",null,e("label",{class:"switch"},e("input",{onChange:()=>x.green=!x.green,checked:x.green,type:"checkbox"}),e("span",{class:"slider"})),e("p",null,"Grön teknik avdrag")),e("p",null,"(-",x.green?I():0,"kr)"))),e("div",{class:"hemfixarna_cart--price"},e("h2",null,"Totalbelopp: "),e("h2",null,D(),"kr")))}};const Rn=class{constructor(n){i(this,n);this.id=undefined;this.customer=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.power})}};const Qn="";const Un=class{constructor(n){i(this,n);this.amount=0;this.hideDescription=true}addProduct(){const n=x.cart.find((n=>n.id===x.selectedProduct.ID));if(n){n.amount++;x.cart=[...x.cart]}else{x.cart=[...x.cart,{id:x.selectedProduct.ID,rut:x.selectedProduct.rut,rot:x.selectedProduct.rot,green:x.selectedProduct.green,amount:1,parts:[],price:x.selectedProduct.price,name:x.selectedProduct.title,start_fee:!x.selectedProduct.hide_start_fee,terms_checkout:x.selectedProduct.terms_checkout,icon:x.selectedProduct.icon}]}}removeProduct(){const n=x.cart.find((n=>n.id===x.selectedProduct.ID));if(n&&n.amount>1){n.amount--;x.cart=[...x.cart]}else{x.cart=x.cart.filter((n=>n.id!==x.selectedProduct.ID))}}addPart(n){var t;const i=x.cart.find((n=>n.id===x.selectedProduct.ID));if(i){const e=i.parts.find((t=>t.id===n.ID));if(e){e.amount++;i.parts=[...i.parts]}else{i.parts=[...i.parts,{id:n.ID,amount:1,price:n.price,name:(t=n.title)!==null&&t!==void 0?t:n.title}]}x.cart=[...x.cart.filter((n=>n.id!==i.id)),i]}}removePart(n){const t=x.cart.find((n=>n.id===x.selectedProduct.ID));if(t){const i=t.parts.find((t=>t.id===n.ID));if(i&&i.amount>1){i.amount--;t.parts=[...t.parts]}else{t.parts=t.parts.filter((t=>t.id!==n.ID))}x.cart=[...x.cart.filter((n=>n.id!==t.id)),t]}}goToCart(){const n=x.cart.find((n=>n.id===x.selectedProduct.ID));if(n){x.step=5;const n=this.el.closest(".hemfixarna_content");v(n)}}getAmount(){var n;return((n=x.cart.find((n=>n.id===x.selectedProduct.ID)))===null||n===void 0?void 0:n.amount)||0}getPartAmount(n){var t;const i=x.cart.find((n=>n.id===x.selectedProduct.ID));return((t=i===null||i===void 0?void 0:i.parts.find((t=>t.id===n)))===null||t===void 0?void 0:t.amount)||0}getTotalPrice(){let n=0;const t=x.cart.find((n=>n.id===x.selectedProduct.ID));if(t){const i=t.parts.reduce(((n,t)=>{const i=x.selectedProduct.parts.find((n=>n.ID===t.id));if(i){return n+i.price*t.amount}return n}),0);n=x.selectedProduct.price*t.amount+i}else{n=x.selectedProduct.price}return C(x.selectedProduct,n)}componentDidRender(){const n=document.createElement("link");n.setAttribute("rel","stylesheet");n.setAttribute("href","https://painting-frontend.vercel.app/static/css/main.css");const t=document.createElement("link");t.setAttribute("rel","stylesheet");t.setAttribute("href","https://painting-frontend.vercel.app/fonts.css");const i=()=>{const e=this.el.getElementsByTagName("hemfixare-calculator");if(e.length>0&&e[0].shadowRoot!==null){e[0].shadowRoot.appendChild(n);e[0].shadowRoot.appendChild(t)}else{setTimeout(i,1)}};i()}render(){var n,t,i;const s=r(`./assets/checked.svg`);const o=r(`./assets/plus.svg`);const l=r(`./assets/minus.svg`);if(x.maleri){return e("div",{class:"hemfixarna_painting"},e("script",{type:"text/javascript",src:["localhost","vercel"].some((n=>window.location.href.includes(n)))?"https://painting-dev.vercel.app/static/js/main.js":"https://painting-frontend.vercel.app/static/js/main.js",defer:true,async:true}),e("hemfixare-calculator",{title:x.options.maleri_title,subtitle:x.options.maleri_text,modal:"true",customer:x.business===O.string?"string":x.business}))}return x.selectedProduct?e("div",{class:"hemfixarna_product"},e("div",{class:"hemfixarna_product--top"},x.selectedProduct.icon&&e("img",{width:80,src:(n=x.selectedProduct.icon.url)!==null&&n!==void 0?n:x.selectedProduct.icon,alt:x.selectedProduct.title}),e("div",null,e("h1",null,x.selectedProduct.title),!x.selectedProduct.invoice?e("h2",null,C(x.selectedProduct)," kr/st"):e("h2",null,x.selectedProduct.invoice_price))),e("div",{class:"hemfixarna_product--grid"},e("div",{class:"hemfixarna_product--left"},((t=x.selectedProduct.list)===null||t===void 0?void 0:t.length)&&e("ul",{class:"hemfixarna_features"},x.selectedProduct.list.map((n=>e("li",{key:n.bullet},e("img",{src:s,alt:"checked"}),e("p",null,n.bullet))))),x.selectedProduct.description&&e("p",{onClick:()=>this.hideDescription=false,class:`hemfixarna_description ${this.hideDescription?"hemfixarna_description--hidden":""}`,innerHTML:x.selectedProduct.description})),e("div",{class:"hemfixarna_product--right"},x.selectedProduct.invoice?e("hemfixarna-invoice",null):e(a,null,e("ul",null,e("li",{class:"hemfixarna_product--item"},e("div",null,e("p",null,x.selectedProduct.title),e("p",{class:"hemfixarna_product--price"},C(x.selectedProduct),"kr/st")),e("div",{class:"hemfixarna_counter"},e("img",{class:`${this.getAmount()===0?"disabled":""}`,src:l,onClick:()=>this.removeProduct()}),e("span",null,this.getAmount()),e("img",{src:o,onClick:()=>this.addProduct()}))),((i=x.selectedProduct.parts)===null||i===void 0?void 0:i.length)&&x.selectedProduct.parts.map((n=>{var t;return e("li",{class:"hemfixarna_part"},e("div",null,e("p",null,(t=n.title)!==null&&t!==void 0?t:n.title),e("p",{class:"hemfixarna_product--price"},S(n,x.selectedProduct),"kr/st")),e("div",{class:"hemfixarna_counter"},e("img",{class:`${this.getPartAmount(n.ID)===0?"disabled":""}`,src:l,onClick:()=>this.removePart(n)}),e("span",null,this.getPartAmount(n.ID)),e("img",{class:`${this.getAmount()===0?"disabled":""}`,src:o,onClick:()=>this.addPart(n)})))}))),e("h4",{class:"hemfixarna_product--total"},"Totalt ",this.getTotalPrice()," kr"),e("button",{onClick:()=>this.goToCart(),class:`hemfixarna_buy ${this.getAmount()===0?"disabled":""}`},"Fortsätt")),!x.selectedProduct.hide_start_fee&&(x.selectedProduct.rot||x.selectedProduct.rut)&&x.rutOptions&&x.rotOptions&&e("p",{class:"hemfixarna_terms"},e("strong",null,x.selectedProduct.rot?x.rotOptions.rot_start_fee_heading:x.rutOptions.rut_start_fee_heading),e("br",null),e("span",{innerHTML:x.selectedProduct.rot?x.rotOptions.rot_start_fee_text:x.rutOptions.rut_start_fee_text})),x.options&&e("hemfixarna-info",null)))):null}get el(){return s(this)}};Un.style=Qn;const Hn=class{constructor(n){i(this,n)}render(){return e("div",null,e("h2",null,x.selectedService.post_title),e("div",{class:"hemfixarna_categories--wrapper"},e("div",null,e("ul",{class:"hemfixarna_categories"},x.selectedService.products.sort(((n,t)=>n.post_title<t.post_title?-1:1)).map((n=>{var t;return e("hemfixarna-box",{post:n,icon:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,postTitle:n.title})})))),e("hemfixarna-info",null)))}};const En="";const Jn=class{constructor(n){i(this,n);this.id=undefined;this.customer=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.skanska})}};Jn.style=En;const Wn=class{constructor(n){i(this,n);this.id=undefined;this.customer=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.sparfonster})}};const Zn=class{constructor(n){i(this,n);this.tree=undefined;this.slug=undefined}isMainCategory(n){return n.show_products!==undefined}handleMaleriClick(){x.step=4;x.maleri=true}render(){var n;const t=r("./assets/gubbe-pensel.svg");return x.customer?e("div",null,e("h2",null,x.selectedCustomerCategory?x.selectedCustomerCategory.name:"Alla tjänster"),e("div",{class:"hemfixarna_categories--wrapper"},e("ul",{class:"hemfixarna_categories"},((n=x.selectedCustomerCategory)===null||n===void 0?void 0:n.add_painting)?e("button",{onClick:()=>this.handleMaleriClick(),class:"hemfixarna_maleribox"},e("img",{height:64,src:t,alt:"Måleri Logotyp"}),e("p",null,"Beräkna fast pris på måleri & tapetsering här")):null,x.selectedCustomerCategory?this.isMainCategory(x.selectedCustomerCategory)&&x.selectedCustomerCategory.sub_categories&&!x.selectedCustomerCategory.show_products?x.selectedCustomerCategory.sub_categories.map((n=>e("hemfixarna-box",{category:n}))):x.selectedCustomerCategory.products?x.selectedCustomerCategory.products.map((n=>e("hemfixarna-box",{category:n.fields}))):null:x.customer.categories.map((n=>e("hemfixarna-box",{category:n})))),e("hemfixarna-info",null))):e("div",null,e("h2",null,"Alla tjänster"),e("div",{class:"hemfixarna_categories--wrapper"},e("ul",{class:"hemfixarna_categories"},this.tree.sub_cats.sort(((n,t)=>n.name<t.name?-1:1)).map((n=>{var t;return e("hemfixarna-box",{post:n,icon:(t=n.icon.url)!==null&&t!==void 0?t:n.icon,postTitle:n.name})}))),e("hemfixarna-info",null)))}};const Xn="";const Yn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.string})}};Yn.style=Xn;const qn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.superfront})}};const Gn=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.isDemo=false;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://www.tesla.com/sv_se/home-charging",logo:"assets/tesla.svg"},isDemo:this.isDemo,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.tesla})}};const nt=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery=undefined;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.traningspartner})}};const tt=class{constructor(n){i(this,n);this.id=undefined;this.loadFromQuery="true";this.isDemo=false;this.widgetStyle=F.standard;this.buttonColor=undefined;this.buttonBg=undefined}render(){return e("hemfixarna-component",{widgetStyle:this.widgetStyle,buttonBg:this.buttonBg,buttonColor:this.buttonColor,nav:{url:"https://www.zaptec.com/sv/laddningslosningar/zaptec-go",logo:"assets/zaptec.svg"},isDemo:this.isDemo,loadFromQuery:Boolean(this.loadFromQuery),id:this.id,business:O.zaptec})}};export{_ as hemfixarna_address,P as hemfixarna_box,A as hemfixarna_breadcrumbs,V as hemfixarna_byggmax,R as hemfixarna_cart,Q as hemfixarna_category,tn as hemfixarna_checkout,sn as hemfixarna_component,an as hemfixarna_contact,on as hemfixarna_demo,hn as hemfixarna_doro,dn as hemfixarna_elfa,un as hemfixarna_fargvaruhuset,pn as hemfixarna_flyttsmart,mn as hemfixarna_forebygg,jn as hemfixarna_getuser,In as hemfixarna_hornbach,Dn as hemfixarna_info,Mn as hemfixarna_invoice,Ln as hemfixarna_kbygg,Nn as hemfixarna_klint,Pn as hemfixarna_kund,An as hemfixarna_norrgavel,Kn as hemfixarna_order,Vn as hemfixarna_orderrows,Rn as hemfixarna_power,Un as hemfixarna_product,Hn as hemfixarna_service,Jn as hemfixarna_skanska,Wn as hemfixarna_sparfonster,Zn as hemfixarna_start,Yn as hemfixarna_string_furniture,qn as hemfixarna_superfront,Gn as hemfixarna_tesla,nt as hemfixarna_traningspartner,tt as hemfixarna_zaptec};
|
2
|
+
//# sourceMappingURL=p-97461831.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sources":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './esm/index.js';
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"api-36f73d0d.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"app-globals-0f993ce5.js","mappings":";;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"calc-4c79b798.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Stencil Client Patch Esm v3.2.1 | MIT Licensed | https://stenciljs.com
|
3
|
-
*/
|
4
|
-
var __assign=undefined&&undefined.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector="";};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r);}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE;}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return "\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return {start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return {start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t);}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else {if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s);}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value;}));}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0);})),!t)return "break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return [];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t});})),t++;})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o});}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement;}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors);})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return ":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return {original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return !1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t));}));}function reScope(e,t){var r=e.template.map((function(r){return "string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t);}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t);})).observe(document.head,{childList:!0});}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove();}})).catch((function(e){console.error(e);}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1;}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}));}));})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal();}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal();},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e);},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n);}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes);},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document));}("undefined"!=typeof window&&window);
|
5
|
-
|
6
|
-
//# sourceMappingURL=css-shim-62d2171c.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"css-shim-62d2171c.js","mappings":";;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|