hemfixarna-web-components 1.4.6 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/cjs/{hemfixarna-address_32.cjs.entry.js → hemfixarna-address_34.cjs.entry.js} +148 -62
  2. package/dist/cjs/{hemfixarna-address_32.cjs.entry.js.map → hemfixarna-address_34.cjs.entry.js.map} +1 -1
  3. package/dist/cjs/hemfixarna-components.cjs.js +2 -2
  4. package/dist/cjs/{index-83c1daf2.js → index-b83343b9.js} +33 -2
  5. package/dist/{esm/index-1fd61928.js.map → cjs/index-b83343b9.js.map} +1 -1
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/collection/collection-manifest.json +2 -0
  8. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js +131 -0
  9. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js.map +1 -0
  10. package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js +7 -2
  11. package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js.map +1 -1
  12. package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js +1 -1
  13. package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js.map +1 -1
  14. package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js +60 -5
  15. package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -1
  16. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +2 -2
  17. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -1
  18. package/dist/collection/components/hemfixarna-component/hemfixarna.css +46 -2
  19. package/dist/collection/components/hemfixarna-contact/hemfixarna-contact.js +33 -0
  20. package/dist/collection/components/hemfixarna-contact/hemfixarna-contact.js.map +1 -0
  21. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.css +6 -1
  22. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js +4 -2
  23. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -1
  24. package/dist/collection/components/hemfixarna-info/hemfixarna-info.js +2 -29
  25. package/dist/collection/components/hemfixarna-info/hemfixarna-info.js.map +1 -1
  26. package/dist/collection/components/hemfixarna-order/hemfixarna-order.js +1 -4
  27. package/dist/collection/components/hemfixarna-order/hemfixarna-order.js.map +1 -1
  28. package/dist/collection/components/hemfixarna-product/hemfixarna-product.js +1 -1
  29. package/dist/collection/components/hemfixarna-product/hemfixarna-product.js.map +1 -1
  30. package/dist/collection/components/hemfixarna-service/hemfixarna-service.js +1 -1
  31. package/dist/collection/components/hemfixarna-service/hemfixarna-service.js.map +1 -1
  32. package/dist/collection/components/hemfixarna-start/hemfixarna-start.js +2 -2
  33. package/dist/collection/components/hemfixarna-start/hemfixarna-start.js.map +1 -1
  34. package/dist/collection/store/index.js +1 -0
  35. package/dist/collection/store/index.js.map +1 -1
  36. package/dist/collection/types/index.js +1 -0
  37. package/dist/collection/types/index.js.map +1 -1
  38. package/dist/collection/utils/api.js +11 -1
  39. package/dist/collection/utils/api.js.map +1 -1
  40. package/dist/esm/{hemfixarna-address_32.entry.js → hemfixarna-address_34.entry.js} +135 -51
  41. package/dist/esm/{hemfixarna-address_32.entry.js.map → hemfixarna-address_34.entry.js.map} +1 -1
  42. package/dist/esm/hemfixarna-components.js +3 -3
  43. package/dist/esm/{index-1fd61928.js → index-8c417125.js} +33 -2
  44. package/dist/{cjs/index-83c1daf2.js.map → esm/index-8c417125.js.map} +1 -1
  45. package/dist/esm/loader.js +3 -3
  46. package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
  47. package/dist/hemfixarna-components/p-852e7173.js +3 -0
  48. package/dist/hemfixarna-components/p-9a7694f6.entry.js +2 -0
  49. package/dist/types/components/customers/hemfixarna-power/hemfixarna-power.d.ts +10 -0
  50. package/dist/types/components/hemfixarna-checkout/hemfixarna-checkout.d.ts +10 -0
  51. package/dist/types/components/hemfixarna-contact/hemfixarna-contact.d.ts +4 -0
  52. package/dist/types/components/hemfixarna-info/hemfixarna-info.d.ts +0 -9
  53. package/dist/types/components.d.ts +40 -2
  54. package/dist/types/store/index.d.ts +2 -1
  55. package/dist/types/types/index.d.ts +59 -2
  56. package/dist/types/utils/api.d.ts +2 -1
  57. package/package.json +1 -1
  58. package/dist/hemfixarna-components/p-33d37833.js +0 -3
  59. package/dist/hemfixarna-components/p-3b2da615.entry.js +0 -2
  60. /package/dist/hemfixarna-components/{p-33d37833.js.map → p-852e7173.js.map} +0 -0
  61. /package/dist/hemfixarna-components/{p-3b2da615.entry.js.map → p-9a7694f6.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"hemfixarna-checkout.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-checkout/hemfixarna-checkout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAc,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,kBAAkB;;IAO7B,qBAAgB,GAAG,CAAC,CAAQ,EAAE,EAAE;MAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;MACtB,IAAI,CAAC,IAAI,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC;IACnD,CAAC,CAAC;IAEF,sBAAiB,GAAG,GAAG,EAAE;MACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC,CAAC;IAEF,cAA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UAAU,GAAG;cACnE,YAAM,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,GAAI,CAClC;YACP,KAAK,CAAC,IAAI;eACR,MAAM,CAAC,CAAC,CAAC,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,cAAc,0CAAE,MAAM,CAAA,EAAA,CAAC;eACrC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACX,EAAC,QAAQ;cACP,aAAO,KAAK,EAAC,qBAAqB;gBAChC,aAAO,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAC,UAAU,GAAG;gBACnE,gBAAO,IAAI,CAAC,cAAc,CAAQ,CAC5B,CACC,CACZ,CAAC;YACH,IAAI,CAAC,YAAY,IAAI,gBAAO,IAAI,CAAC,YAAY,CAAQ;YACtD,WAAK,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;cACvC,aAAO,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,GAAI;cACpE,WAAK,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,SAAS,GAAG,CACtD,CACD,CACH,CACP,CAAC;OACH;IACH,CAAC,CAAC;gBAnKsB,EAAE;qBACU,IAAI;wBACD,IAAI;mBACxB,KAAK;;EA0FxB,iBAAiB;IACf,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;MAC5C,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;KACxB;EACH,CAAC;;;;;;;;;CAmEF","sourcesContent":["import { Component, Element, Fragment, State, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business } from '../../types';\nimport { postOrder } from '../../utils/api';\nimport { FelixOrder, postPerson } from '../../utils/felixApi';\nimport { hideField } from '../../utils/form';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-checkout',\n shadow: false,\n})\nexport class HemfixarnaCheckout {\n @State() date: string = '';\n @State() dateError: string | null = null;\n @State() generalError: string | null = null;\n @State() loading = false;\n @Element() private el: HTMLElement;\n\n handleChangeDate = (e: Event) => {\n this.dateError = null;\n this.date = (e.target as HTMLInputElement).value;\n };\n\n handleChangeTerms = () => {\n this.generalError = null;\n };\n\n sendOrder = async () => {\n if (this.loading) return;\n this.loading = true;\n let order: FelixOrder = {\n firstName: state.creditSafeUser.firstName,\n lastName: state.creditSafeUser.lastName,\n street: state.user.street,\n zip: state.user.zip,\n town: state.user.town,\n ssn: state.user.ssn,\n email: state.user.email,\n phone: state.user.phone,\n url: `${state.business === Business.string ? 'string' : state.business}-webk`,\n date: this.date,\n products: [\n ...state.cart.map(item => {\n const parts = item.parts.map(part => ({\n id: String(part.id),\n name: part.name,\n quantity: part.amount,\n rut: 0,\n rot: 0,\n }));\n return [\n {\n id: String(item.id),\n name: item.name,\n quantity: item.amount,\n rot: item.rot ? 1 : 0,\n rut: item.rut ? 1 : 0,\n },\n ...parts,\n ];\n }),\n ].flat(),\n creditSafe: state.creditSafeUser,\n customer: state.business,\n };\n\n const felixOrder = await postPerson(order);\n if (!felixOrder || !felixOrder.response?.scriptResult?.includes('OK')) {\n order = { ...order, felixStatus: 'error' };\n } else {\n order = { ...order, felixStatus: 'success' };\n }\n\n try {\n const { data: orderConfirm, status } = await postOrder(order);\n if (orderConfirm && status && status === 200) {\n state.step = 6;\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n } else {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n } catch (error) {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n this.loading = false;\n };\n\n handleSubmit = (e: Event) => {\n e.preventDefault();\n this.generalError = null;\n const validDate = this.date.length > 0;\n if (!validDate) {\n this.dateError = 'Ange ett giltigt datum';\n }\n const checkBoxes = Array.from(this.el.querySelectorAll('input[type=\"checkbox\"]'));\n const notValidTerms = checkBoxes.find(i => !(i as HTMLInputElement).checked);\n if (notValidTerms) {\n this.generalError = 'Du måste godkänna villkoren';\n }\n if (validDate && !notValidTerms) {\n this.sendOrder();\n }\n };\n\n componentWillLoad() {\n if (Boolean(state.user && state.user.street)) {\n state.checkoutStep = 2;\n }\n }\n\n render = () => {\n const dateLogo = getAssetPath(`./assets/date.svg`);\n const down = getAssetPath(`./assets/down.svg`);\n const loading = getAssetPath(`./assets/spinner.gif`);\n\n if (state.checkoutEdit) {\n return <hemfixarna-address />;\n } else if (state.checkoutStep === 1) {\n return <hemfixarna-getuser />;\n } else if (state.checkoutStep === 2) {\n return (\n <div class=\"mb-2\">\n <div class=\"hemfixarna_addressinfo\">\n <div>\n <p>{hideField(state.user.firstName)}</p>\n <p>{hideField(state.user.lastName)}</p>\n <p>{state.user.email}</p>\n <p>{state.user.phone}</p>\n </div>\n <div>\n <p>{hideField(state.user.street)}</p>\n <p>{hideField(state.user.zip)}</p>\n <p>{hideField(state.user.town)}</p>\n </div>\n <button onClick={() => (state.checkoutEdit = true)}>Behöver du ändra adressen?</button>\n </div>\n <form onSubmit={e => this.handleSubmit(e)}>\n <div>\n <img src={dateLogo} width={24} />\n <input\n class={`${this.date.length ? 'input_active' : ''}`}\n min={new Date().toISOString().split('T')[0]}\n onChange={e => this.handleChangeDate(e)}\n type=\"date\"\n name=\"date\"\n value={this.date}\n />\n <label htmlFor=\"date\">Tidigaste datum för hembesök</label>\n <img src={down} width={24} />\n </div>\n {this.dateError && <span>{this.dateError}</span>}\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span innerHTML={state.options.terms} />\n </label>\n {state.cart\n .filter(i => i.terms_checkout?.length)\n .map(item => (\n <Fragment>\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span>{item.terms_checkout}</span>\n </label>\n </Fragment>\n ))}\n {this.generalError && <span>{this.generalError}</span>}\n <div class={this.loading ? 'loading' : ''}>\n <input type=\"submit\" value={this.loading ? '' : 'Skicka bokning'} />\n <img width={20} height={20} src={loading} alt=\"spinner\" />\n </div>\n </form>\n </div>\n );\n }\n };\n}\n"]}
1
+ {"version":3,"file":"hemfixarna-checkout.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-checkout/hemfixarna-checkout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAU,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAc,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,OAAO,kBAAkB;;IAa7B,qBAAgB,GAAG,CAAC,CAAQ,EAAE,EAAE;MAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;MACtB,IAAI,CAAC,IAAI,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC;IACnD,CAAC,CAAC;IAEF,sBAAiB,GAAG,GAAG,EAAE;MACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC,CAAC;IAEF,cAAS,GAAG,KAAK,IAAI,EAAE;;MACrB,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO;MACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;MACpB,IAAI,KAAK,GAAe;QACtB,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS;QACzC,Q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;oBACb,IAAI;0BACE,IAAI;;EAyG7C,KAAK,CAAC,aAAa;IACjB,MAAM,OAAO,GAAG,MAAM,UAAU,EAAE,CAAC;IACnC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE;MACnB,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC;KAC3G;EACH,CAAC;EAmBD,iBAAiB;IACf,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;MAC5C,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;KACxB;IACD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;EACzD,CAAC;EAED,oBAAoB;IAClB,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;EAC5D,CAAC;;;;;;;;;;;;;;CAyGF","sourcesContent":["import { Component, Element, Fragment, State, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Source } from '../../types';\nimport { getSources, postOrder } from '../../utils/api';\nimport { FelixOrder, postPerson } from '../../utils/felixApi';\nimport { hideField } from '../../utils/form';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-checkout',\n shadow: false,\n})\nexport class HemfixarnaCheckout {\n @State() date: string = '';\n @State() dateError: string | null = null;\n @State() generalError: string | null = null;\n @State() loading = false;\n @State() enteredPin: string = '';\n @Element() private el: HTMLElement;\n private pinTimeout: any;\n @State() selectedSource: Source | null = null;\n @State() selectedSubSource: string | null = null;\n @State() sellerId: string | null = null;\n @State() partnerOrderId: string | null = null;\n\n handleChangeDate = (e: Event) => {\n this.dateError = null;\n this.date = (e.target as HTMLInputElement).value;\n };\n\n handleChangeTerms = () => {\n this.generalError = null;\n };\n\n sendOrder = async () => {\n if (this.loading) return;\n this.loading = true;\n let order: FelixOrder = {\n firstName: state.creditSafeUser.firstName,\n lastName: state.creditSafeUser.lastName,\n street: state.user.street,\n zip: state.user.zip,\n town: state.user.town,\n ssn: state.user.ssn,\n email: state.user.email,\n phone: state.user.phone,\n url: `${state.business === Business.string ? 'string' : state.business}-webk`,\n date: this.date,\n products: [\n ...state.cart.map(item => {\n const parts = item.parts.map(part => ({\n id: String(part.id),\n name: part.name,\n quantity: part.amount,\n rut: 0,\n rot: 0,\n }));\n return [\n {\n id: String(item.id),\n name: item.name,\n quantity: item.amount,\n rot: item.rot ? 1 : 0,\n rut: item.rut ? 1 : 0,\n },\n ...parts,\n ];\n }),\n ].flat(),\n creditSafe: state.creditSafeUser,\n customer: state.business,\n id_source: this.selectedSource?.fieldData._id ?? '',\n id_sub_source: this.selectedSubSource ?? '',\n };\n\n const felixOrder = await postPerson(order);\n if (!felixOrder || !felixOrder.response?.scriptResult?.includes('OK')) {\n order = { ...order, felixStatus: 'error' };\n } else {\n order = { ...order, felixStatus: 'success' };\n }\n\n try {\n const { data: orderConfirm, status } = await postOrder(order);\n if (orderConfirm && status && status === 200) {\n state.step = 6;\n const el = this.el.closest('.hemfixarna_content');\n scrollToTop(el);\n } else {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n } catch (error) {\n this.generalError = 'Något gick fel, försök igen senare';\n }\n this.loading = false;\n };\n\n handleSubmit = (e: Event) => {\n e.preventDefault();\n this.generalError = null;\n const validDate = this.date.length > 0;\n if (!validDate) {\n this.dateError = 'Ange ett giltigt datum';\n }\n const checkBoxes = Array.from(this.el.querySelectorAll('input[type=\"checkbox\"]'));\n const notValidTerms = checkBoxes.find(i => !(i as HTMLInputElement).checked);\n if (notValidTerms) {\n this.generalError = 'Du måste godkänna villkoren';\n }\n if (state.sources) {\n if (!this.sellerId) {\n this.generalError = 'Ange säljar id';\n return;\n }\n if (!this.selectedSource) {\n this.generalError = 'Välj källa';\n return;\n }\n if (this.selectedSource && this.selectedSource.portalData?.So_SubSource?.length && !this.selectedSubSource) {\n this.generalError = 'Välj underkälla';\n return;\n }\n }\n if (validDate && !notValidTerms) {\n this.sendOrder();\n }\n };\n\n async handleSources() {\n const sources = await getSources();\n if (sources?.length) {\n state.sources = sources.filter(s => s.fieldData.So457_Aktiv_ac === 1 && s.fieldData.So39_WebSource === 1);\n }\n }\n\n handleKeyDown = (event: KeyboardEvent) => {\n this.enteredPin += event.key;\n\n const correctPin = '+0000frfrfr';\n\n if (this.enteredPin.length === correctPin.length) {\n if (this.enteredPin === correctPin) {\n this.handleSources();\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n this.enteredPin = '';\n }\n\n clearTimeout(this.pinTimeout);\n this.pinTimeout = setTimeout(() => (this.enteredPin = ''), 5000);\n };\n\n componentWillLoad() {\n if (Boolean(state.user && state.user.street)) {\n state.checkoutStep = 2;\n }\n window.addEventListener('keydown', this.handleKeyDown);\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n\n render = () => {\n const dateLogo = getAssetPath(`./assets/date.svg`);\n const down = getAssetPath(`./assets/down.svg`);\n const loading = getAssetPath(`./assets/spinner.gif`);\n\n if (state.checkoutEdit) {\n return <hemfixarna-address />;\n } else if (state.checkoutStep === 1) {\n return <hemfixarna-getuser />;\n } else if (state.checkoutStep === 2) {\n return (\n <div class=\"mb-2\">\n <div class=\"hemfixarna_addressinfo\">\n <div>\n <p>{hideField(state.user.firstName)}</p>\n <p>{hideField(state.user.lastName)}</p>\n <p>{state.user.email}</p>\n <p>{state.user.phone}</p>\n </div>\n <div>\n <p>{hideField(state.user.street)}</p>\n <p>{hideField(state.user.zip)}</p>\n <p>{hideField(state.user.town)}</p>\n </div>\n <button onClick={() => (state.checkoutEdit = true)}>Behöver du ändra adressen?</button>\n </div>\n <form onSubmit={e => this.handleSubmit(e)}>\n <div>\n <img src={dateLogo} width={24} />\n <input\n class={`${this.date.length ? 'input_active' : ''}`}\n min={new Date().toISOString().split('T')[0]}\n onChange={e => this.handleChangeDate(e)}\n type=\"date\"\n name=\"date\"\n value={this.date}\n />\n <label htmlFor=\"date\">Tidigaste datum för hembesök</label>\n <img src={down} width={24} />\n </div>\n {state.sources ? (\n <Fragment>\n <div>\n <input type=\"text\" placeholder=\"Ange säljar id\" onChange={e => (this.sellerId = (e.target as HTMLInputElement).value)} />\n </div>\n <div>\n <input type=\"text\" placeholder=\"Ange partner order id\" onChange={e => (this.partnerOrderId = (e.target as HTMLInputElement).value)} />\n </div>\n <div>\n <select\n onChange={e => {\n this.selectedSource = state.sources.find(s => s.fieldData._id === (e.target as HTMLSelectElement).value);\n this.selectedSubSource = null;\n console.log(this.selectedSource.portalData.So_SubSource);\n }}\n >\n <option disabled selected value=\"null\">\n Välj källa\n </option>\n {state.sources.map(source => (\n <option value={source.fieldData._id}>{source.fieldData.So01_Name}</option>\n ))}\n </select>\n </div>\n {this.selectedSource && this.selectedSource.portalData?.So_SubSource?.length ? (\n <div>\n <select key={this.selectedSource.fieldData._id} onChange={e => (this.selectedSubSource = (e.target as HTMLSelectElement).value)}>\n <option disabled selected value=\"null\">\n Välj underkälla\n </option>\n {this.selectedSource.portalData.So_SubSource.map(sub => (\n <option value={sub['So_SubSource::_id']}>{sub['So_SubSource::Sus01_Name']}</option>\n ))}\n </select>\n </div>\n ) : null}\n </Fragment>\n ) : null}\n {this.dateError && <span>{this.dateError}</span>}\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span innerHTML={state.options.terms} />\n </label>\n {state.cart\n .filter(i => i.terms_checkout?.length)\n .map(item => (\n <Fragment>\n <label class=\"hemfixarna_checkbox\">\n <input onChange={() => this.handleChangeTerms()} type=\"checkbox\" />\n <span>{item.terms_checkout}</span>\n </label>\n </Fragment>\n ))}\n {this.generalError && <span>{this.generalError}</span>}\n <div class={this.loading ? 'loading' : ''}>\n <input type=\"submit\" value={this.loading ? '' : 'Skicka bokning'} />\n <img width={20} height={20} src={loading} alt=\"spinner\" />\n </div>\n </form>\n </div>\n );\n }\n };\n}\n"]}
@@ -225,7 +225,7 @@ export class HemfixarnaComponent {
225
225
  const monteringLogo = getAssetPath(`./assets/montering.svg`);
226
226
  const navBackground = ((_a = this.nav) === null || _a === void 0 ? void 0 : _a.background) ? getAssetPath(this.nav.background) : '';
227
227
  const navLogo = ((_b = this.nav) === null || _b === void 0 ? void 0 : _b.logo) ? getAssetPath(this.nav.logo) : '';
228
- return (h("div", { class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` }, this.loadFromQuery && !this.isDemo && this.nav ? (h("nav", { class: "hemfixarna_nav", style: { backgroundColor: (_c = this.nav.backgroundColor) !== null && _c !== void 0 ? _c : '' } }, h("div", null, h("div", { class: "hemfixarna_nav--logos" }, h("a", { href: this.nav.url, target: "_blank" }, h("img", { class: "hemfixarna_partnerlogo", src: navLogo, alt: `${this.business} logo` })), h("a", { href: "https://hemfixarna.se/", target: "_blank" }, h("p", { class: navBackground || this.nav.backgroundColor ? 'with-bg' : '' }, "I samarbete med:"), h("img", { src: logo, alt: "hemfixarna_logo", width: 104 }))), h("div", { class: "hemfixarna_nav--links" }, h("a", { href: this.nav.url, target: "_blank" }, "Till ", this.business), h("a", { href: "https://www.hemfixarna.se/", target: "_blank" }, "Till Hemfixarna")), navBackground ? h("img", { src: navBackground, class: "nav_background", alt: "nav_background" }) : null))) : null, !this.loadFromQuery || this.isDemo ? (h("div", { class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` }, [WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (h("img", { src: this.id === 'maleri' ? pensel : monteringLogo, alt: "montering logo", width: 32, height: 32 })) : null, h("div", null, h("div", null, h("p", { onClick: () => this.openModal(), class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}` }, this.id === 'maleri' ? (h("span", null, "Ber\u00E4kna fast pris p\u00E5 m\u00E5leri & tapetsering h\u00E4r")) : (h(Fragment, null, ((_d = this.product) === null || _d === void 0 ? void 0 : _d.title) || ((_e = this.proppedProduct) === null || _e === void 0 ? void 0 : _e.title) || (h("span", null, "Montering", h("wbr", null), "/Installation ", (_g = (_f = state.selectedCustomerCategory) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : 'på plats', " - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))), (this.product && ((_h = this.slug) === null || _h === void 0 ? void 0 : _h.includes('product'))) || (this.proppedProduct && !((_j = this.product) === null || _j === void 0 ? void 0 : _j.invoice) && !((_k = this.proppedProduct) === null || _k === void 0 ? void 0 : _k.invoice)) ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.proppedProduct || this.product), "kr"))) : null, ((_l = this.product) === null || _l === void 0 ? void 0 : _l.invoice) || ((_m = this.proppedProduct) === null || _m === void 0 ? void 0 : _m.invoice) ? (h("span", null, ' - ', h("strong", { class: "underling" }, "se priser h\u00E4r"))) : null)))), this.widgetStyle === WidgetStyle.standard ? h("img", { src: logo, width: 104 }) : null, this.widgetStyle === WidgetStyle.alternative ? (h("span", { class: "p-s" }, "Utf\u00F6rs av ", h("strong", null, "Hemfixarna"))) : null), [WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn", style: {
228
+ return (h("div", { class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` }, this.loadFromQuery && !this.isDemo && this.nav ? (h("nav", { class: "hemfixarna_nav", style: { backgroundColor: (_c = this.nav.backgroundColor) !== null && _c !== void 0 ? _c : '' } }, h("div", null, h("div", { class: "hemfixarna_nav--logos" }, h("a", { href: this.nav.url, target: "_blank" }, h("img", { class: "hemfixarna_partnerlogo", src: navLogo, alt: `${this.business} logo` })), h("a", { href: "https://hemfixarna.se/", target: "_blank" }, h("p", { class: navBackground || this.nav.backgroundColor ? 'with-bg' : '' }, "I samarbete med:"), h("img", { src: logo, alt: "hemfixarna_logo", width: 104 }))), h("div", { class: "hemfixarna_nav--links" }, h("a", { href: this.nav.url, target: "_blank" }, "Till ", this.business), h("a", { href: "https://www.hemfixarna.se/", target: "_blank" }, "Till Hemfixarna")), navBackground ? h("img", { src: navBackground, class: "nav_background", alt: "nav_background" }) : null))) : null, !this.loadFromQuery || this.isDemo ? (h("div", { class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` }, [WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (h("img", { src: this.id === 'maleri' ? pensel : monteringLogo, alt: "montering logo", width: 32, height: 32 })) : null, h("div", null, h("div", null, h("p", { onClick: () => this.openModal(), class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}` }, this.id === 'maleri' ? (h("span", null, "Ber\u00E4kna fast pris p\u00E5 m\u00E5leri & tapetsering h\u00E4r")) : (h(Fragment, null, !state.selectedCustomerCategory && !this.product && !this.proppedProduct ? (h(Fragment, null, ((_d = state.customer) === null || _d === void 0 ? void 0 : _d.widget_title) ? (h("span", null, state.customer.widget_title)) : (h("span", null, "Montering/Installation - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))))) : (h(Fragment, null, ((_e = this.product) === null || _e === void 0 ? void 0 : _e.title) || ((_f = this.proppedProduct) === null || _f === void 0 ? void 0 : _f.title) || ((_g = state.selectedCustomerCategory) === null || _g === void 0 ? void 0 : _g.widget_title) || (h("span", null, "Montering", h("wbr", null), "/Installation ", (_j = (_h = state.selectedCustomerCategory) === null || _h === void 0 ? void 0 : _h.name) !== null && _j !== void 0 ? _j : 'på plats', " - ", h("strong", { class: "underline" }, "se priser h\u00E4r"))), (this.product && ((_k = this.slug) === null || _k === void 0 ? void 0 : _k.includes('product'))) || (this.proppedProduct && !((_l = this.product) === null || _l === void 0 ? void 0 : _l.invoice) && !((_m = this.proppedProduct) === null || _m === void 0 ? void 0 : _m.invoice)) ? (h("span", null, ' från', " ", h("strong", null, getProductPriceWithRotAndRut(this.proppedProduct || this.product), "kr"))) : null)))))), this.widgetStyle === WidgetStyle.standard ? h("img", { src: logo, width: 104 }) : null, this.widgetStyle === WidgetStyle.alternative ? (h("span", { class: "p-s" }, "Utf\u00F6rs av ", h("strong", null, "Hemfixarna"))) : null), [WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (h("button", { onClick: () => this.openModal(), class: "hemfixarna_btn", style: {
229
229
  color: ((_o = this.buttonColor) === null || _o === void 0 ? void 0 : _o.startsWith('#')) || !((_p = this.buttonColor) === null || _p === void 0 ? void 0 : _p.length) ? this.buttonColor : `#${this.buttonColor}`,
230
230
  backgroundColor: ((_q = this.buttonBg) === null || _q === void 0 ? void 0 : _q.startsWith('#')) || !((_r = this.buttonBg) === null || _r === void 0 ? void 0 : _r.length) ? this.buttonBg : `#${this.buttonBg}`,
231
231
  } }, "Best\u00E4ll h\u00E4r", this.getCartLength() > 0 && h("span", null, this.getCartLength()))) : null, WidgetStyle.alternative_2 === this.widgetStyle ? (h("div", { class: "hemfixarna_altbtn" }, h("strong", { class: "p-s" }, "Utf\u00F6rs av"), h("img", { src: logo, alt: "hemfixarna logo", width: 98 }))) : null)) : null, this.modal && (h("div", null, h("div", { class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` }, state.modal && (h("div", { class: "hemfixarna_infomodal" }, state.modal.title && h("h2", null, state.modal.title), state.modal.text.map((t) => (h("p", { innerHTML: t }))), h("div", null, h("button", { onClick: () => (state.modal = null) }, "St\u00E4ng")))), (this.tree || state.customer) && (h("hemfixarna-breadcrumbs", { isDemo: this.isDemo, loadFromQuery: this.loadFromQuery, closeModal: () => this.closeModal(), tree: this.tree })), !state.customer || this.slugIsOldFormat(this.slug) ? (h("div", { class: `hemfixarna_content hemfixarna_content--${state.step}` }, state.step === 1 && this.tree && h("hemfixarna-start", { tree: this.tree }), state.step === 2 && state.selectedCategory && h("hemfixarna-category", null), state.step === 3 && state.selectedService && h("hemfixarna-service", null), state.step === 4 && state.selectedProduct && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", { tree: this.tree }))) : (h("div", { class: `hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}` }, state.step < 4 && h("hemfixarna-start", null), state.step === 4 && h("hemfixarna-product", null), state.step === 5 && h("hemfixarna-cart", { tree: this.tree }), state.step === 6 && h("hemfixarna-order", { tree: this.tree })))), !this.isDemo ? h("div", { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` }) : null))));
@@ -284,7 +284,7 @@ export class HemfixarnaComponent {
284
284
  "mutable": false,
285
285
  "complexType": {
286
286
  "original": "Business",
287
- "resolved": "Business.byggmax | Business.doro | Business.elfa | Business.fargvaruhuset | Business.flyttsmart | Business.forebygg | Business.hornbach | Business.kbygg | Business.klint | Business.kund | Business.lg | Business.norrgavel | Business.skanska | Business.sparfonster | Business.string | Business.tesla | Business.zaptec",
287
+ "resolved": "Business.byggmax | Business.doro | Business.elfa | Business.fargvaruhuset | Business.flyttsmart | Business.forebygg | Business.hornbach | Business.kbygg | Business.klint | Business.kund | Business.lg | Business.norrgavel | Business.power | Business.skanska | Business.sparfonster | Business.string | Business.tesla | Business.zaptec",
288
288
  "references": {
289
289
  "Business": {
290
290
  "location": "import",
@@ -1 +1 @@
1
- {"version":3,"file":"hemfixarna-component.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-component/hemfixarna-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC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AAE,IAAI,CAAC,IAAI,GAAI,CACtD,CACP,CACG;QACL,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,WAAK,KAAK,EAAE,uBAAuB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,EAAE,GAAQ,CAAC,CAAC,CAAC,IAAI,CACjH,CACP,CACG,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, Listen, Prop, State, Watch, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Category, Product, Service, TopCategory, WidgetStyle } from '../../types';\nimport { getCustomer, getGreenDiscount, getOptions, getRot, getRut, getTaxonomy } from '../../utils/api';\nimport { getProductPriceWithRotAndRut } from '../../utils/calc';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-component',\n styleUrl: 'hemfixarna.scss',\n shadow: true,\n assetsDirs: ['assets'],\n})\nexport class HemfixarnaComponent {\n @State() modal: boolean = false;\n @State() showModal: boolean = false;\n @State() tree: Category | null = null;\n @State() product: Product | null = null;\n @State() proppedProduct: Product | null = null;\n @Prop() slug?: string;\n @Prop() id?: string;\n @Prop() business: Business;\n @Prop() topCategory?: TopCategory;\n @Prop() forceOldTree?: boolean = false;\n @Prop() loadFromQuery?: boolean = false;\n @Prop() isDemo?: boolean = false;\n @Prop() widgetStyle: WidgetStyle;\n @Prop() nav?: {\n url: string;\n logo: string;\n background?: string;\n backgroundColor?: string;\n } = undefined;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n\n @Element() private el: HTMLElement;\n\n loadCategoryOrProduct(id: string) {\n this.proppedProduct = null;\n if (id.startsWith('c-')) {\n const categories = [...state.customer.categories, ...state.customer.categories.map(c => c.sub_categories ?? [])].flat();\n const category = categories.find(c => c && c.id === id.replace('c-', ''));\n if (category) {\n state.selectedCustomerCategory = category;\n state.step = 2;\n }\n } else {\n const products = state.customer.categories\n .map(c => (c.show_products ? c.products : c.sub_categories ? c.sub_categories.map(c => c.products) : []))\n .flat()\n .flat();\n const product = products.find(p => p && p.fields.ID === parseInt(id));\n if (product) {\n state.selectedProduct = product.fields;\n state.step = 4;\n this.proppedProduct = product.fields;\n }\n }\n }\n\n @Watch('slug')\n async watchSlugChange(newValue: string) {\n if (this.slugIsOldFormat(newValue)) {\n this.fetchNewTaxonomy(newValue);\n } else if (state.customer && newValue) {\n this.loadCategoryOrProduct(newValue);\n }\n }\n\n @Watch('id')\n async watchIdChange(id: string) {\n if (id && state.customer) {\n if (id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(id);\n }\n }\n }\n\n async fetchNewTaxonomy(slug: string) {\n state.selectedCategory = null;\n state.selectedProduct = null;\n state.selectedService = null;\n state.maleri = null;\n\n const res = await getTaxonomy(slug);\n if (res?.code === 'not_found' || res?.code === 'rest_no_route') {\n console.log('taxonomy not found');\n } else if (res) {\n this.setTaxonomy(res);\n if ((res as Product)?.post_type === 'ikea_product') {\n this.product = res as Product;\n }\n }\n }\n\n slugIsOldFormat = (slug?: string) => {\n if (!slug) return false;\n return ['product', 'service', 'category'].some(str => slug.includes(str));\n };\n\n async componentWillLoad() {\n state.business = this.business;\n const cart = window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);\n if (cart) {\n state.cart = JSON.parse(cart);\n }\n const user = window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);\n if (user) {\n state.user = JSON.parse(user);\n }\n const creditSafeUser = window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);\n if (creditSafeUser) {\n state.creditSafeUser = JSON.parse(creditSafeUser);\n }\n\n const [tree, res, options, rut, rot, greenDiscount] = await Promise.all([\n this.topCategory ? getTaxonomy(this.topCategory) : null,\n this.slug ? getTaxonomy(this.slug) : Promise.resolve(null),\n getOptions(),\n getRut(),\n getRot(),\n getGreenDiscount(),\n ]);\n\n if ((!this.slug || !this.slugIsOldFormat(this.slug)) && !this.forceOldTree) {\n try {\n const customer = await getCustomer(this.business);\n if (customer?.code === 'not_found') {\n console.warn('customer not found');\n } else if (customer) {\n state.customer = customer;\n if (this.id) {\n if (this.id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(this.id);\n }\n } else if (this.slug && !this.slugIsOldFormat(this.slug)) {\n this.loadCategoryOrProduct(this.slug);\n }\n }\n } catch (error) {\n console.warn('customer not found');\n }\n }\n\n if (tree?.code === 'not_found') {\n // console.warn('tree not found');\n } else if (tree) {\n this.tree = tree;\n }\n\n if (res?.code === 'not_found') {\n console.log('taxonomy not found');\n } else if (res) {\n this.setTaxonomy(res);\n if ((res as Product)?.post_type === 'ikea_product') {\n this.product = res as Product;\n }\n }\n\n if (this.loadFromQuery) {\n const params = new URL(document.location.toString()).searchParams;\n this.id = params.get('id');\n if (!this.isDemo) {\n this.openModal();\n }\n }\n\n state.rotOptions = rot;\n state.rutOptions = rut;\n state.greenOptions = greenDiscount;\n state.options = options;\n }\n\n triggerScrollTotop = () => {\n const el = this.el.shadowRoot.querySelector('.hemfixarna_content');\n scrollToTop(el);\n };\n\n setTaxonomy(taxonomy: Category | Service | Product) {\n if (taxonomy) {\n if ((taxonomy as Category)?.taxonomy === 'service_cat') {\n state.selectedCategory = taxonomy as Category;\n state.step = 2;\n } else if ((taxonomy as Service)?.post_type === 'service') {\n state.selectedService = taxonomy as Service;\n state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === (taxonomy as Service).ID));\n state.step = 3;\n } else if ((taxonomy as Product)?.post_type === 'ikea_product') {\n state.selectedProduct = taxonomy as Product;\n state.selectedService = this.tree.sub_cats\n .map(c => c.services)\n .flat()\n .find(s => s.products.find(p => p.ID === state.selectedProduct.ID));\n state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === state.selectedService.ID));\n state.step = 4;\n }\n this.triggerScrollTotop();\n }\n }\n\n // Open close modal && click outside event\n openModal() {\n this.modal = true;\n setTimeout(() => {\n this.showModal = true;\n }, 50);\n }\n closeModal() {\n this.showModal = false;\n setTimeout(() => {\n this.modal = false;\n }, 200);\n }\n @Listen('click')\n handleClick(e: Event) {\n if (this.loadFromQuery && !this.isDemo) return;\n if ((e?.composedPath()[0] as HTMLElement).classList.contains('hemfixarna_backdrop')) {\n this.closeModal();\n }\n const infomodal = this.el.shadowRoot.querySelector('.hemfixarna_infomodal');\n if (infomodal) {\n const isClickInside = infomodal.contains(e.composedPath()[0] as HTMLInputElement);\n if (!isClickInside) {\n state.modal = null;\n }\n }\n }\n\n getCartLength() {\n return state.cart.reduce((acc, curr) => acc + curr.amount, 0);\n }\n\n render() {\n const logo = getAssetPath(`./assets/hemfixarna.svg`);\n const pensel = getAssetPath(`./assets/pensel.svg`);\n const monteringLogo = getAssetPath(`./assets/montering.svg`);\n const navBackground = this.nav?.background ? getAssetPath(this.nav.background) : '';\n const navLogo = this.nav?.logo ? getAssetPath(this.nav.logo) : '';\n\n return (\n <div class={`hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}`}>\n {this.loadFromQuery && !this.isDemo && this.nav ? (\n <nav class=\"hemfixarna_nav\" style={{ backgroundColor: this.nav.backgroundColor ?? '' }}>\n <div>\n <div class=\"hemfixarna_nav--logos\">\n <a href={this.nav.url} target=\"_blank\">\n <img class=\"hemfixarna_partnerlogo\" src={navLogo} alt={`${this.business} logo`} />\n </a>\n <a href=\"https://hemfixarna.se/\" target=\"_blank\">\n <p class={navBackground || this.nav.backgroundColor ? 'with-bg' : ''}>I samarbete med:</p>\n <img src={logo} alt=\"hemfixarna_logo\" width={104} />\n </a>\n </div>\n\n <div class=\"hemfixarna_nav--links\">\n <a href={this.nav.url} target=\"_blank\">\n Till {this.business}\n </a>\n <a href=\"https://www.hemfixarna.se/\" target=\"_blank\">\n Till Hemfixarna\n </a>\n </div>\n {navBackground ? <img src={navBackground} class=\"nav_background\" alt=\"nav_background\" /> : null}\n </div>\n </nav>\n ) : null}\n {!this.loadFromQuery || this.isDemo ? (\n <div class={`hemfixarna_box hemfixarna_box--${this.widgetStyle}`}>\n {[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (\n <img src={this.id === 'maleri' ? pensel : monteringLogo} alt=\"montering logo\" width={32} height={32} />\n ) : null}\n <div>\n <div>\n <p\n onClick={() => this.openModal()}\n class={`pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}`}\n >\n {this.id === 'maleri' ? (\n <span>Beräkna fast pris på måleri & tapetsering här</span>\n ) : (\n <Fragment>\n {this.product?.title || this.proppedProduct?.title || (\n <span>\n Montering\n <wbr />\n /Installation {state.selectedCustomerCategory?.name ?? 'på plats'} - <strong class=\"underline\">se priser här</strong>\n </span>\n )}\n {(this.product && this.slug?.includes('product')) || (this.proppedProduct && !this.product?.invoice && !this.proppedProduct?.invoice) ? (\n <span>\n {' från'} <strong>{getProductPriceWithRotAndRut(this.proppedProduct || this.product)}kr</strong>\n </span>\n ) : null}\n {this.product?.invoice || this.proppedProduct?.invoice ? (\n <span>\n {' - '}\n <strong class=\"underling\">se priser här</strong>\n </span>\n ) : null}\n </Fragment>\n )}\n </p>\n </div>\n {this.widgetStyle === WidgetStyle.standard ? <img src={logo} width={104} /> : null}\n {this.widgetStyle === WidgetStyle.alternative ? (\n <span class=\"p-s\">\n Utförs av <strong>Hemfixarna</strong>\n </span>\n ) : null}\n </div>\n {[WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (\n <button\n onClick={() => this.openModal()}\n class=\"hemfixarna_btn\"\n style={{\n color: this.buttonColor?.startsWith('#') || !this.buttonColor?.length ? this.buttonColor : `#${this.buttonColor}`,\n backgroundColor: this.buttonBg?.startsWith('#') || !this.buttonBg?.length ? this.buttonBg : `#${this.buttonBg}`,\n }}\n >\n Beställ här\n {this.getCartLength() > 0 && <span>{this.getCartLength()}</span>}\n </button>\n ) : null}\n {WidgetStyle.alternative_2 === this.widgetStyle ? (\n <div class=\"hemfixarna_altbtn\">\n <strong class=\"p-s\">Utförs av</strong>\n <img src={logo} alt=\"hemfixarna logo\" width={98} />\n </div>\n ) : null}\n </div>\n ) : null}\n {this.modal && (\n <div>\n <div class={`hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}`}>\n {state.modal && (\n <div class=\"hemfixarna_infomodal\">\n {state.modal.title && <h2>{state.modal.title}</h2>}\n {state.modal.text.map((t: string) => (\n <p innerHTML={t}></p>\n ))}\n <div>\n <button onClick={() => (state.modal = null)}>Stäng</button>\n </div>\n </div>\n )}\n {(this.tree || state.customer) && (\n <hemfixarna-breadcrumbs isDemo={this.isDemo} loadFromQuery={this.loadFromQuery} closeModal={() => this.closeModal()} tree={this.tree} />\n )}\n {!state.customer || this.slugIsOldFormat(this.slug) ? (\n <div class={`hemfixarna_content hemfixarna_content--${state.step}`}>\n {/* // IF AT TOP LEVEL (step 1) */}\n {state.step === 1 && this.tree && <hemfixarna-start tree={this.tree} />}\n {/* // IF SELECTED CATEGORY (step 2) */}\n {state.step === 2 && state.selectedCategory && <hemfixarna-category />}\n {/* // IF SELECTED SERVICE (step 3) */}\n {state.step === 3 && state.selectedService && <hemfixarna-service />}\n {/* // IF SELECTED PRODUCT (step 4) */}\n {state.step === 4 && state.selectedProduct && <hemfixarna-product />}\n {/* // IF CHECKOUT (step 5) */}\n {state.step === 5 && <hemfixarna-cart tree={this.tree} />}\n {/* // IF ORDER CONFIRM (step 6) */}\n {state.step === 6 && <hemfixarna-order tree={this.tree} />}\n </div>\n ) : (\n <div class={`hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}`}>\n {state.step < 4 && <hemfixarna-start />}\n {/* // IF SELECTED PRODUCT (step 4) */}\n {state.step === 4 && <hemfixarna-product />}\n {/* // IF CHECKOUT (step 5) */}\n {state.step === 5 && <hemfixarna-cart tree={this.tree} />}\n {/* // IF ORDER CONFIRM (step 6) */}\n {state.step === 6 && <hemfixarna-order tree={this.tree} />}\n </div>\n )}\n </div>\n {!this.isDemo ? <div class={`hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}`}></div> : null}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"hemfixarna-component.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-component/hemfixarna-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAqD,WAAW,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAQjD,MAAM,OAAO,mBAAmB;;IAsF9B,oBAAe,GAAG,CAAC,IAAa,EAAE,EAAE;MAClC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;MACxB,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Fragment, Listen, Prop, State, Watch, getAssetPath, h } from '@stencil/core';\nimport state from '../../store';\nimport { Business, Category, Product, Service, TopCategory, WidgetStyle } from '../../types';\nimport { getCustomer, getGreenDiscount, getOptions, getRot, getRut, getTaxonomy } from '../../utils/api';\nimport { getProductPriceWithRotAndRut } from '../../utils/calc';\nimport { scrollToTop } from '../../utils/scroll';\n\n@Component({\n tag: 'hemfixarna-component',\n styleUrl: 'hemfixarna.scss',\n shadow: true,\n assetsDirs: ['assets'],\n})\nexport class HemfixarnaComponent {\n @State() modal: boolean = false;\n @State() showModal: boolean = false;\n @State() tree: Category | null = null;\n @State() product: Product | null = null;\n @State() proppedProduct: Product | null = null;\n @Prop() slug?: string;\n @Prop() id?: string;\n @Prop() business: Business;\n @Prop() topCategory?: TopCategory;\n @Prop() forceOldTree?: boolean = false;\n @Prop() loadFromQuery?: boolean = false;\n @Prop() isDemo?: boolean = false;\n @Prop() widgetStyle: WidgetStyle;\n @Prop() nav?: {\n url: string;\n logo: string;\n background?: string;\n backgroundColor?: string;\n } = undefined;\n @Prop() buttonColor?: string;\n @Prop() buttonBg?: string;\n\n @Element() private el: HTMLElement;\n\n loadCategoryOrProduct(id: string) {\n this.proppedProduct = null;\n if (id.startsWith('c-')) {\n const categories = [...state.customer.categories, ...state.customer.categories.map(c => c.sub_categories ?? [])].flat();\n const category = categories.find(c => c && c.id === id.replace('c-', ''));\n if (category) {\n state.selectedCustomerCategory = category;\n state.step = 2;\n }\n } else {\n const products = state.customer.categories\n .map(c => (c.show_products ? c.products : c.sub_categories ? c.sub_categories.map(c => c.products) : []))\n .flat()\n .flat();\n const product = products.find(p => p && p.fields.ID === parseInt(id));\n if (product) {\n state.selectedProduct = product.fields;\n state.step = 4;\n this.proppedProduct = product.fields;\n }\n }\n }\n\n @Watch('slug')\n async watchSlugChange(newValue: string) {\n if (this.slugIsOldFormat(newValue)) {\n this.fetchNewTaxonomy(newValue);\n } else if (state.customer && newValue) {\n this.loadCategoryOrProduct(newValue);\n }\n }\n\n @Watch('id')\n async watchIdChange(id: string) {\n if (id && state.customer) {\n if (id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(id);\n }\n }\n }\n\n async fetchNewTaxonomy(slug: string) {\n state.selectedCategory = null;\n state.selectedProduct = null;\n state.selectedService = null;\n state.maleri = null;\n\n const res = await getTaxonomy(slug);\n if (res?.code === 'not_found' || res?.code === 'rest_no_route') {\n console.log('taxonomy not found');\n } else if (res) {\n this.setTaxonomy(res);\n if ((res as Product)?.post_type === 'ikea_product') {\n this.product = res as Product;\n }\n }\n }\n\n slugIsOldFormat = (slug?: string) => {\n if (!slug) return false;\n return ['product', 'service', 'category'].some(str => slug.includes(str));\n };\n\n async componentWillLoad() {\n state.business = this.business;\n const cart = window.sessionStorage.getItem(`hemfixarna-${this.business}-cart`);\n if (cart) {\n state.cart = JSON.parse(cart);\n }\n const user = window.sessionStorage.getItem(`hemfixarna-${this.business}-user`);\n if (user) {\n state.user = JSON.parse(user);\n }\n const creditSafeUser = window.sessionStorage.getItem(`hemfixarna-${this.business}-creditSafeUser`);\n if (creditSafeUser) {\n state.creditSafeUser = JSON.parse(creditSafeUser);\n }\n\n const [tree, res, options, rut, rot, greenDiscount] = await Promise.all([\n this.topCategory ? getTaxonomy(this.topCategory) : null,\n this.slug ? getTaxonomy(this.slug) : Promise.resolve(null),\n getOptions(),\n getRut(),\n getRot(),\n getGreenDiscount(),\n ]);\n\n if ((!this.slug || !this.slugIsOldFormat(this.slug)) && !this.forceOldTree) {\n try {\n const customer = await getCustomer(this.business);\n if (customer?.code === 'not_found') {\n console.warn('customer not found');\n } else if (customer) {\n state.customer = customer;\n if (this.id) {\n if (this.id === 'maleri') {\n state.maleri = true;\n state.step = 4;\n } else {\n this.loadCategoryOrProduct(this.id);\n }\n } else if (this.slug && !this.slugIsOldFormat(this.slug)) {\n this.loadCategoryOrProduct(this.slug);\n }\n }\n } catch (error) {\n console.warn('customer not found');\n }\n }\n\n if (tree?.code === 'not_found') {\n // console.warn('tree not found');\n } else if (tree) {\n this.tree = tree;\n }\n\n if (res?.code === 'not_found') {\n console.log('taxonomy not found');\n } else if (res) {\n this.setTaxonomy(res);\n if ((res as Product)?.post_type === 'ikea_product') {\n this.product = res as Product;\n }\n }\n\n if (this.loadFromQuery) {\n const params = new URL(document.location.toString()).searchParams;\n this.id = params.get('id');\n if (!this.isDemo) {\n this.openModal();\n }\n }\n\n state.rotOptions = rot;\n state.rutOptions = rut;\n state.greenOptions = greenDiscount;\n state.options = options;\n }\n\n triggerScrollTotop = () => {\n const el = this.el.shadowRoot.querySelector('.hemfixarna_content');\n scrollToTop(el);\n };\n\n setTaxonomy(taxonomy: Category | Service | Product) {\n if (taxonomy) {\n if ((taxonomy as Category)?.taxonomy === 'service_cat') {\n state.selectedCategory = taxonomy as Category;\n state.step = 2;\n } else if ((taxonomy as Service)?.post_type === 'service') {\n state.selectedService = taxonomy as Service;\n state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === (taxonomy as Service).ID));\n state.step = 3;\n } else if ((taxonomy as Product)?.post_type === 'ikea_product') {\n state.selectedProduct = taxonomy as Product;\n state.selectedService = this.tree.sub_cats\n .map(c => c.services)\n .flat()\n .find(s => s.products.find(p => p.ID === state.selectedProduct.ID));\n state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === state.selectedService.ID));\n state.step = 4;\n }\n this.triggerScrollTotop();\n }\n }\n\n // Open close modal && click outside event\n openModal() {\n this.modal = true;\n setTimeout(() => {\n this.showModal = true;\n }, 50);\n }\n closeModal() {\n this.showModal = false;\n setTimeout(() => {\n this.modal = false;\n }, 200);\n }\n @Listen('click')\n handleClick(e: Event) {\n if (this.loadFromQuery && !this.isDemo) return;\n if ((e?.composedPath()[0] as HTMLElement).classList.contains('hemfixarna_backdrop')) {\n this.closeModal();\n }\n const infomodal = this.el.shadowRoot.querySelector('.hemfixarna_infomodal');\n if (infomodal) {\n const isClickInside = infomodal.contains(e.composedPath()[0] as HTMLInputElement);\n if (!isClickInside) {\n state.modal = null;\n }\n }\n }\n\n getCartLength() {\n return state.cart.reduce((acc, curr) => acc + curr.amount, 0);\n }\n\n render() {\n const logo = getAssetPath(`./assets/hemfixarna.svg`);\n const pensel = getAssetPath(`./assets/pensel.svg`);\n const monteringLogo = getAssetPath(`./assets/montering.svg`);\n const navBackground = this.nav?.background ? getAssetPath(this.nav.background) : '';\n const navLogo = this.nav?.logo ? getAssetPath(this.nav.logo) : '';\n\n return (\n <div class={`hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}`}>\n {this.loadFromQuery && !this.isDemo && this.nav ? (\n <nav class=\"hemfixarna_nav\" style={{ backgroundColor: this.nav.backgroundColor ?? '' }}>\n <div>\n <div class=\"hemfixarna_nav--logos\">\n <a href={this.nav.url} target=\"_blank\">\n <img class=\"hemfixarna_partnerlogo\" src={navLogo} alt={`${this.business} logo`} />\n </a>\n <a href=\"https://hemfixarna.se/\" target=\"_blank\">\n <p class={navBackground || this.nav.backgroundColor ? 'with-bg' : ''}>I samarbete med:</p>\n <img src={logo} alt=\"hemfixarna_logo\" width={104} />\n </a>\n </div>\n\n <div class=\"hemfixarna_nav--links\">\n <a href={this.nav.url} target=\"_blank\">\n Till {this.business}\n </a>\n <a href=\"https://www.hemfixarna.se/\" target=\"_blank\">\n Till Hemfixarna\n </a>\n </div>\n {navBackground ? <img src={navBackground} class=\"nav_background\" alt=\"nav_background\" /> : null}\n </div>\n </nav>\n ) : null}\n {!this.loadFromQuery || this.isDemo ? (\n <div class={`hemfixarna_box hemfixarna_box--${this.widgetStyle}`}>\n {[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) ? (\n <img src={this.id === 'maleri' ? pensel : monteringLogo} alt=\"montering logo\" width={32} height={32} />\n ) : null}\n <div>\n <div>\n <p\n onClick={() => this.openModal()}\n class={`pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}`}\n >\n {this.id === 'maleri' ? (\n <span>Beräkna fast pris på måleri & tapetsering här</span>\n ) : (\n <Fragment>\n {!state.selectedCustomerCategory && !this.product && !this.proppedProduct ? (\n <Fragment>\n {state.customer?.widget_title ? (\n <span>{state.customer.widget_title}</span>\n ) : (\n <span>\n Montering/Installation - <strong class=\"underline\">se priser här</strong>\n </span>\n )}\n </Fragment>\n ) : (\n <Fragment>\n {this.product?.title || this.proppedProduct?.title || state.selectedCustomerCategory?.widget_title || (\n <span>\n Montering\n <wbr />\n /Installation {state.selectedCustomerCategory?.name ?? 'på plats'} - <strong class=\"underline\">se priser här</strong>\n </span>\n )}\n {(this.product && this.slug?.includes('product')) || (this.proppedProduct && !this.product?.invoice && !this.proppedProduct?.invoice) ? (\n <span>\n {' från'} <strong>{getProductPriceWithRotAndRut(this.proppedProduct || this.product)}kr</strong>\n </span>\n ) : null}\n </Fragment>\n )}\n </Fragment>\n )}\n </p>\n </div>\n {this.widgetStyle === WidgetStyle.standard ? <img src={logo} width={104} /> : null}\n {this.widgetStyle === WidgetStyle.alternative ? (\n <span class=\"p-s\">\n Utförs av <strong>Hemfixarna</strong>\n </span>\n ) : null}\n </div>\n {[WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle) ? (\n <button\n onClick={() => this.openModal()}\n class=\"hemfixarna_btn\"\n style={{\n color: this.buttonColor?.startsWith('#') || !this.buttonColor?.length ? this.buttonColor : `#${this.buttonColor}`,\n backgroundColor: this.buttonBg?.startsWith('#') || !this.buttonBg?.length ? this.buttonBg : `#${this.buttonBg}`,\n }}\n >\n Beställ här\n {this.getCartLength() > 0 && <span>{this.getCartLength()}</span>}\n </button>\n ) : null}\n {WidgetStyle.alternative_2 === this.widgetStyle ? (\n <div class=\"hemfixarna_altbtn\">\n <strong class=\"p-s\">Utförs av</strong>\n <img src={logo} alt=\"hemfixarna logo\" width={98} />\n </div>\n ) : null}\n </div>\n ) : null}\n {this.modal && (\n <div>\n <div class={`hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}`}>\n {state.modal && (\n <div class=\"hemfixarna_infomodal\">\n {state.modal.title && <h2>{state.modal.title}</h2>}\n {state.modal.text.map((t: string) => (\n <p innerHTML={t}></p>\n ))}\n <div>\n <button onClick={() => (state.modal = null)}>Stäng</button>\n </div>\n </div>\n )}\n {(this.tree || state.customer) && (\n <hemfixarna-breadcrumbs isDemo={this.isDemo} loadFromQuery={this.loadFromQuery} closeModal={() => this.closeModal()} tree={this.tree} />\n )}\n {!state.customer || this.slugIsOldFormat(this.slug) ? (\n <div class={`hemfixarna_content hemfixarna_content--${state.step}`}>\n {/* // IF AT TOP LEVEL (step 1) */}\n {state.step === 1 && this.tree && <hemfixarna-start tree={this.tree} />}\n {/* // IF SELECTED CATEGORY (step 2) */}\n {state.step === 2 && state.selectedCategory && <hemfixarna-category />}\n {/* // IF SELECTED SERVICE (step 3) */}\n {state.step === 3 && state.selectedService && <hemfixarna-service />}\n {/* // IF SELECTED PRODUCT (step 4) */}\n {state.step === 4 && state.selectedProduct && <hemfixarna-product />}\n {/* // IF CHECKOUT (step 5) */}\n {state.step === 5 && <hemfixarna-cart tree={this.tree} />}\n {/* // IF ORDER CONFIRM (step 6) */}\n {state.step === 6 && <hemfixarna-order tree={this.tree} />}\n </div>\n ) : (\n <div class={`hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}`}>\n {state.step < 4 && <hemfixarna-start />}\n {/* // IF SELECTED PRODUCT (step 4) */}\n {state.step === 4 && <hemfixarna-product />}\n {/* // IF CHECKOUT (step 5) */}\n {state.step === 5 && <hemfixarna-cart tree={this.tree} />}\n {/* // IF ORDER CONFIRM (step 6) */}\n {state.step === 6 && <hemfixarna-order tree={this.tree} />}\n </div>\n )}\n </div>\n {!this.isDemo ? <div class={`hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}`}></div> : null}\n </div>\n )}\n </div>\n );\n }\n}\n"]}
@@ -24,6 +24,12 @@
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 16px;
27
+ position: relative;
28
+ }
29
+ :host form button {
30
+ position: absolute;
31
+ right: 0;
32
+ top: -1rem;
27
33
  }
28
34
  :host form img {
29
35
  position: absolute;
@@ -72,6 +78,10 @@
72
78
  transform: translateY(-50%);
73
79
  background: linear-gradient(180deg, #fffaf2 50%, #fff 50%);
74
80
  }
81
+ :host form select {
82
+ padding: 0.75rem 1rem;
83
+ width: 100%;
84
+ }
75
85
  :host h1 {
76
86
  font-size: 24px;
77
87
  font-weight: 400;
@@ -98,6 +108,30 @@
98
108
  /* Hide default HTML checkbox */
99
109
  /* The slider */
100
110
  }
111
+ :host .hemfixarna_contact {
112
+ display: flex;
113
+ gap: 16px;
114
+ }
115
+ :host .hemfixarna_contact a {
116
+ display: flex;
117
+ align-items: center;
118
+ gap: 8px;
119
+ color: #474444;
120
+ text-decoration: none;
121
+ font-weight: 600;
122
+ font-size: 13px;
123
+ }
124
+ :host .hemfixarna_contact a:hover {
125
+ text-decoration: underline;
126
+ }
127
+ :host .hemfixarna_contact--horizontal span {
128
+ display: none;
129
+ }
130
+ @media (min-width: 769px) {
131
+ :host .hemfixarna_contact--horizontal span {
132
+ display: initial;
133
+ }
134
+ }
101
135
  :host .hemfixarna_painting {
102
136
  opacity: 0;
103
137
  padding: 0 1rem;
@@ -513,7 +547,7 @@
513
547
  font-weight: 600;
514
548
  font-size: 13px;
515
549
  line-height: 11px;
516
- top: -8px;
550
+ top: -6px;
517
551
  right: -12px;
518
552
  }
519
553
  :host .hemfixarna_btn span {
@@ -782,6 +816,7 @@
782
816
  z-index: 9;
783
817
  }
784
818
  :host .hemfixarna_crumbs .cart {
819
+ display: flex;
785
820
  padding-left: 16px;
786
821
  position: relative;
787
822
  }
@@ -800,7 +835,7 @@
800
835
  font-weight: 600;
801
836
  font-size: 13px;
802
837
  line-height: 11px;
803
- top: -8px;
838
+ top: -6px;
804
839
  right: -12px;
805
840
  }
806
841
  :host .hemfixarna_crumbs .cart_active {
@@ -827,6 +862,10 @@
827
862
  display: none;
828
863
  }
829
864
  }
865
+ :host .hemfixarna_crumbs--right {
866
+ display: flex;
867
+ align-items: center;
868
+ }
830
869
  :host .hemfixarna_crumbs button {
831
870
  white-space: nowrap;
832
871
  background: #f1ded6;
@@ -843,6 +882,11 @@
843
882
  transform: scale(1.01);
844
883
  box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);
845
884
  }
885
+ @media (max-width: 768px) {
886
+ :host .hemfixarna_crumbs button {
887
+ display: none;
888
+ }
889
+ }
846
890
  :host .hemfixarna_crumbs .active {
847
891
  background: #fffaf2;
848
892
  cursor: default;
@@ -0,0 +1,33 @@
1
+ import { h } from '@stencil/core';
2
+ export class HemfixarnaInfo {
3
+ constructor() {
4
+ this.vertical = false;
5
+ }
6
+ render() {
7
+ return (h("div", { class: `hemfixarna_contact ${this.vertical ? 'hemfixarna_contact--vertical' : 'hemfixarna_contact--horizontal'}` }, h("a", { href: "tel:0770-220 720" }, h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("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" })), h("span", null, "0770-220 720")), h("a", { href: "https://hemfixarna.se/kundservice/", target: "_blank" }, h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { "clip-path": "url(#clip0_1001_894)" }, h("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" }), h("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" }), h("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" }), h("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" })), h("defs", null, h("clipPath", { id: "clip0_1001_894" }, h("rect", { width: "24", height: "24", fill: "white" })))), h("span", null, "Kundservice"))));
8
+ }
9
+ static get is() { return "hemfixarna-contact"; }
10
+ static get properties() {
11
+ return {
12
+ "vertical": {
13
+ "type": "boolean",
14
+ "mutable": false,
15
+ "complexType": {
16
+ "original": "boolean",
17
+ "resolved": "boolean",
18
+ "references": {}
19
+ },
20
+ "required": false,
21
+ "optional": true,
22
+ "docs": {
23
+ "tags": [],
24
+ "text": ""
25
+ },
26
+ "attribute": "vertical",
27
+ "reflect": false,
28
+ "defaultValue": "false"
29
+ }
30
+ };
31
+ }
32
+ }
33
+ //# sourceMappingURL=hemfixarna-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemfixarna-contact.js","sourceRoot":"","sources":["../../../src/components/hemfixarna-contact/hemfixarna-contact.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAMnD,MAAM,OAAO,cAAc;;oBACI,KAAK;;EAElC,MAAM;IACJ,OAAO,CACL,WAAK,KAAK,EAAE,sBAAsB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,gCAAgC,EAAE;MACnH,SAAG,IAAI,EAAC,kBAAkB;QACxB,WAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;UAC5F,YACE,CAAC,EAAC,+PAA+P,EACjQ,IAAI,EAAC,SAAS,GACd,CACE;QACN,+BAAyB,CACvB;MACJ,SAAG,IAAI,EAAC,oCAAoC,EAAC,MAAM,EAAC,QAAQ;QAC1D,WAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;UAC5F,sBAAa,sBAAsB;YACjC,YACE,CAAC,EAAC,sQAAsQ,EACxQ,IAAI,EAAC,SAAS,GACd;YACF,YAAM,CAAC,EAAC,mHAAmH,EAAC,IAAI,EAAC,SAAS,GAAG;YAC7I,YAAM,CAAC,EAAC,yHAAyH,EAAC,IAAI,EAAC,SAAS,GAAG;YACnJ,YACE,CAAC,EAAC,6IAA6I,EAC/I,IAAI,EAAC,SAAS,GACd,CACA;UACJ;YACE,gBAAU,EAAE,EAAC,gBAAgB;cAC3B,YAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,GAAG,CACnC,CACN,CACH;QACN,8BAAwB,CACtB,CACA,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'hemfixarna-contact',\n shadow: false,\n})\nexport class HemfixarnaInfo {\n @Prop() vertical?: boolean = false;\n\n render() {\n return (\n <div class={`hemfixarna_contact ${this.vertical ? 'hemfixarna_contact--vertical' : 'hemfixarna_contact--horizontal'}`}>\n <a href=\"tel:0770-220 720\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n 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\"\n fill=\"#C84E18\"\n />\n </svg>\n <span>0770-220 720</span>\n </a>\n <a href=\"https://hemfixarna.se/kundservice/\" target=\"_blank\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_1001_894)\">\n <path\n 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\"\n fill=\"#C84E18\"\n />\n <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\" />\n <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\" />\n <path\n 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\"\n fill=\"#C84E18\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_1001_894\">\n <rect width=\"24\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n <span>Kundservice</span>\n </a>\n </div>\n );\n }\n}\n"]}
@@ -98,11 +98,16 @@
98
98
  :host button {
99
99
  cursor: pointer;
100
100
  }
101
+ :host > div:not(.hemfixarna_hosted) {
102
+ grid-template-columns: 1fr 1fr;
103
+ }
104
+ :host .hemfixarna_hosted .hemfixarna_scripts {
105
+ display: none;
106
+ }
101
107
  :host > div {
102
108
  display: grid;
103
109
  gap: 32px;
104
110
  width: 100%;
105
- grid-template-columns: 1fr 1fr;
106
111
  height: 100vh;
107
112
  place-items: center;
108
113
  overflow: hidden;
@@ -80,6 +80,7 @@ export class MyComponent {
80
80
  }
81
81
  else {
82
82
  const partner = window.location.pathname.replace('/', '');
83
+ console.log(partner);
83
84
  this.partner = isBusiness(partner) ? partner : (_a = process.env.BUSINESS) !== null && _a !== void 0 ? _a : Business.kund;
84
85
  const customer = await getCustomer(this.partner);
85
86
  if (customer.code !== 'not_found' && customer) {
@@ -117,9 +118,10 @@ export class MyComponent {
117
118
  return allCategories === null || allCategories === void 0 ? void 0 : allCategories.some(c => c.add_painting);
118
119
  }
119
120
  render() {
121
+ var _a;
120
122
  const copy = getAssetPath(`./assets/copy.png`);
121
- return (h("div", null, h("div", null, h("div", { onClick: () => this.copyExample(), class: "hemfixarna_example" }, h("p", null, this.getExample()), h("img", { src: copy, height: 20 }), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText)), this.partner === Business.byggmax && (h("hemfixarna-byggmax", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, forceOldTree: Boolean(process.env.FORCE_OLD_TREE), slug: this.selectedSlug, id: this.selectedID })), this.partner === Business.skanska && h("hemfixarna-skanska", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.sparfonster && (h("hemfixarna-sparfonster", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.string && (h("hemfixarna-string-furniture", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.hornbach && (h("hemfixarna-hornbach", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.zaptec && (h("hemfixarna-zaptec", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.tesla && (h("hemfixarna-tesla", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.forebygg && (h("hemfixarna-forebygg", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.doro && h("hemfixarna-doro", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.elfa && h("hemfixarna-elfa", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.kbygg && (h("hemfixarna-kbygg", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.fargvaruhuset && (h("hemfixarna-fargvaruhuset", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.norrgavel && (h("hemfixarna-norrgavel", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.klint && h("hemfixarna-klint", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.flyttsmart && (h("hemfixarna-flyttsmart", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.kund && h("hemfixarna-kund", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), h("div", { class: "hemfixarna_install" }, h("div", { onClick: () => this.copyCdn(), class: "hemfixarna_example" }, h("p", null, this.cdnLink), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText), h("img", { src: copy, height: 20 }))), h("div", { class: "hemfixarna_widgetstyles" }, h("h5", null, "Widget styles"), h("div", null, Object.values(WidgetStyle).map(style => (h("label", { key: style }, h("input", { type: "radio", value: style, checked: this.widgetStyle === style, onChange: () => (this.widgetStyle = style) }), style)))), h("div", null, h("div", null, h("h5", null, "Button background color"), h("input", { type: "text", value: this.buttonBg, onInput: e => (this.buttonBg = e.target.value) })), h("div", null, h("h5", null, "Button text color"), h("input", { type: "text", value: this.buttonColor, onInput: e => (this.buttonColor = e.target.value) })))), h("span", null, "Write an hexa code no # needed"), this.colorAccessibility ? (h("div", null, h("h5", null, "Tillg\u00E4nglighetsrapport"), h("div", null, h("strong", null, "Liten text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.small) } }, this.colorAccessibility.small), h("br", null), h("strong", null, "Fet text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.bold) } }, this.colorAccessibility.bold), h("br", null), h("strong", null, "Stor text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.large) } }, this.colorAccessibility.large), h("br", null), h("strong", null, "Kontrastf\u00F6rh\u00E5llande:"), " ", this.colorAccessibility.contrast))) : null), h("ul", { class: "hemfixarna_categories" }, this.customer ? (h("div", null, this.showMaleri() ? (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, "M\u00E5leriverktyget"), h("span", null, "maleri")), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText('maleri') }, "Kopiera slug"), h("button", { onClick: () => (this.selectedID = 'maleri') }, "Ladda m\u00E5leri"))))) : null, this.customer.categories.map(c => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, c.name), h("span", null, `c-${c.id}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`c-${c.id}`) }, "Kopiera ID"), h("button", { onClick: () => (this.selectedID = `c-${c.id}`) }, "Ladda kategori"))), c.show_products && c.products ? (h("ul", null, c.products.map(p => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, h("div", null, h("p", null, p.fields.title), h("span", null, p.fields.ID)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt")))))))) : (h("ul", null, c.sub_categories &&
122
- c.sub_categories.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.name), h("span", null, `c-${sc.id}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`c-${sc.id}`) }, "Kopiera ID"), h("button", { onClick: () => (this.selectedID = `c-${sc.id}`) }, "Ladda kategori"))), h("ul", null, sc.products.map(p => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, h("div", null, h("p", null, p.fields.title), h("span", null, p.fields.ID)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt"))))))))))))))))) : this.tree ? (h("div", null, this.tree.sub_cats.map(c => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, c.name), h("span", null, `category/${c.slug}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`category/${c.slug}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `category/${c.slug}`) }, "Ladda kategori"))), h("ul", null, c.services.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.post_title), h("span", null, `service/${sc.post_name}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`service/${sc.post_name}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `service/${sc.post_name}`) }, "Ladda kategori"))), h("ul", null, sc.products.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.post_title), h("span", null, `product/${sc.post_name}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`product/${sc.post_name}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `product/${sc.post_name}`) }, "Ladda produkt")))))))))))))))) : null)));
123
+ return (h("div", { class: ((_a = this.customer) === null || _a === void 0 ? void 0 : _a.at_hemfixarna) ? 'hemfixarna_hosted' : '' }, h("div", { class: "hemfixarna_scripts" }, h("div", { onClick: () => this.copyExample(), class: "hemfixarna_example" }, h("p", null, this.getExample()), h("img", { src: copy, height: 20 }), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText)), this.partner === Business.byggmax && (h("hemfixarna-byggmax", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, forceOldTree: Boolean(process.env.FORCE_OLD_TREE), slug: this.selectedSlug, id: this.selectedID })), this.partner === Business.skanska && h("hemfixarna-skanska", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.sparfonster && (h("hemfixarna-sparfonster", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.string && (h("hemfixarna-string-furniture", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.hornbach && (h("hemfixarna-hornbach", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.zaptec && (h("hemfixarna-zaptec", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.tesla && (h("hemfixarna-tesla", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.forebygg && (h("hemfixarna-forebygg", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.doro && h("hemfixarna-doro", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.elfa && h("hemfixarna-elfa", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.kbygg && (h("hemfixarna-kbygg", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.fargvaruhuset && (h("hemfixarna-fargvaruhuset", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.norrgavel && (h("hemfixarna-norrgavel", { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.klint && h("hemfixarna-klint", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.flyttsmart && (h("hemfixarna-flyttsmart", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID })), this.partner === Business.power && h("hemfixarna-power", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), this.partner === Business.kund && h("hemfixarna-kund", { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }), h("div", { class: "hemfixarna_install" }, h("div", { onClick: () => this.copyCdn(), class: "hemfixarna_example" }, h("p", null, this.cdnLink), h("span", { class: "hemfixarna_example--tooltip" }, this.tooltipText), h("img", { src: copy, height: 20 }))), h("div", { class: "hemfixarna_widgetstyles" }, h("h5", null, "Widget styles"), h("div", null, Object.values(WidgetStyle).map(style => (h("label", { key: style }, h("input", { type: "radio", value: style, checked: this.widgetStyle === style, onChange: () => (this.widgetStyle = style) }), style)))), h("div", null, h("div", null, h("h5", null, "Button background color"), h("input", { type: "text", value: this.buttonBg, onInput: e => (this.buttonBg = e.target.value) })), h("div", null, h("h5", null, "Button text color"), h("input", { type: "text", value: this.buttonColor, onInput: e => (this.buttonColor = e.target.value) })))), h("span", null, "Write an hexa code no # needed"), this.colorAccessibility ? (h("div", null, h("h5", null, "Tillg\u00E4nglighetsrapport"), h("div", null, h("strong", null, "Liten text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.small) } }, this.colorAccessibility.small), h("br", null), h("strong", null, "Fet text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.bold) } }, this.colorAccessibility.bold), h("br", null), h("strong", null, "Stor text:"), h("span", { style: { color: this.getColor(this.colorAccessibility.large) } }, this.colorAccessibility.large), h("br", null), h("strong", null, "Kontrastf\u00F6rh\u00E5llande:"), " ", this.colorAccessibility.contrast))) : null), h("ul", { class: "hemfixarna_categories" }, this.customer ? (h("div", null, this.customer.logo ? (h("div", { style: { width: '100%', display: 'flex', justifyContent: 'center' } }, h("img", { style: { maxWidth: '250px', height: 'auto', margin: '0 auto 2rem' }, src: this.customer.logo.url, alt: this.customer.post_title }))) : null, this.showMaleri() ? (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, "M\u00E5leriverktyget"), h("span", null, "maleri")), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText('maleri') }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=maleri`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = 'maleri') }, "Ladda m\u00E5leri")))))) : null, this.customer.categories.map(c => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, c.name), h("span", null, `c-${c.id}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`c-${c.id}`) }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=c-${c.id}`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = `c-${c.id}`) }, "Ladda kategori")))), c.show_products && c.products ? (h("ul", null, c.products.map(p => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, h("div", null, h("p", null, p.fields.title), h("span", null, p.fields.ID)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=${p.fields.ID}`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt"))))))))) : (h("ul", null, c.sub_categories &&
124
+ c.sub_categories.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.name), h("span", null, `c-${sc.id}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`c-${sc.id}`) }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=c-${c.id}`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = `c-${sc.id}`) }, "Ladda kategori")))), h("ul", null, sc.products.map(p => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_product--label" }, h("div", null, h("p", null, p.fields.title), h("span", null, p.fields.ID)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, "Kopiera ID"), this.customer.at_hemfixarna ? (h("button", { onClick: () => { var _a; return navigator.clipboard.writeText(`${(_a = process.env.API_URL) !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=${p.fields.ID}`); } }, "Kopiera URL")) : (h("button", { onClick: () => (this.selectedID = String(p.fields.ID)) }, "Ladda produkt")))))))))))))))))) : this.tree ? (h("div", null, this.tree.sub_cats.map(c => (h("li", null, h("div", { class: "hemfixarna_categories--label hemfixarna_categories--label--big" }, h("div", null, h("p", null, c.name), h("span", null, `category/${c.slug}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`category/${c.slug}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `category/${c.slug}`) }, "Ladda kategori"))), h("ul", null, c.services.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.post_title), h("span", null, `service/${sc.post_name}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`service/${sc.post_name}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `service/${sc.post_name}`) }, "Ladda kategori"))), h("ul", null, sc.products.map(sc => (h("li", null, h("div", { class: "hemfixarna_categories--label" }, h("div", null, h("p", null, sc.post_title), h("span", null, `product/${sc.post_name}`)), h("div", null, h("button", { onClick: () => navigator.clipboard.writeText(`product/${sc.post_name}`) }, "Kopiera slug"), h("button", { onClick: () => (this.selectedSlug = `product/${sc.post_name}`) }, "Ladda produkt")))))))))))))))) : null)));
123
125
  }
124
126
  static get is() { return "hemfixarna-demo"; }
125
127
  static get encapsulation() { return "shadow"; }