@salla.sa/twilight-components 2.12.68 → 2.12.69

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 (60) hide show
  1. package/dist/cjs/{app-globals-537a7062.js → app-globals-36ab7ecf.js} +2 -2
  2. package/dist/cjs/{app-globals-537a7062.js.map → app-globals-36ab7ecf.js.map} +1 -1
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/salla-add-product-button_47.cjs.entry.js +12 -5
  5. package/dist/cjs/salla-add-product-button_47.cjs.entry.js.map +1 -1
  6. package/dist/cjs/salla-contacts.cjs.entry.js +2 -0
  7. package/dist/cjs/salla-contacts.cjs.entry.js.map +1 -1
  8. package/dist/cjs/twilight.cjs.js +2 -2
  9. package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +14 -5
  10. package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js.map +1 -1
  11. package/dist/collection/components/salla-contacts/salla-contacts.js +2 -0
  12. package/dist/collection/components/salla-contacts/salla-contacts.js.map +1 -1
  13. package/dist/components/index.js +1 -1
  14. package/dist/components/index.js.map +1 -1
  15. package/dist/components/salla-bottom-alert.js +14 -5
  16. package/dist/components/salla-bottom-alert.js.map +1 -1
  17. package/dist/components/salla-contacts.js +2 -0
  18. package/dist/components/salla-contacts.js.map +1 -1
  19. package/dist/esm/{app-globals-7795aa55.js → app-globals-3843d7b4.js} +2 -2
  20. package/dist/esm/{app-globals-7795aa55.js.map → app-globals-3843d7b4.js.map} +1 -1
  21. package/dist/esm/loader.js +2 -2
  22. package/dist/esm/salla-add-product-button_47.entry.js +12 -5
  23. package/dist/esm/salla-add-product-button_47.entry.js.map +1 -1
  24. package/dist/esm/salla-contacts.entry.js +2 -0
  25. package/dist/esm/salla-contacts.entry.js.map +1 -1
  26. package/dist/esm/twilight.js +2 -2
  27. package/dist/esm-es5/{app-globals-7795aa55.js → app-globals-3843d7b4.js} +2 -2
  28. package/dist/{twilight/p-14c42ca3.system.js.map → esm-es5/app-globals-3843d7b4.js.map} +1 -1
  29. package/dist/esm-es5/loader.js +1 -1
  30. package/dist/esm-es5/loader.js.map +1 -1
  31. package/dist/esm-es5/salla-add-product-button_47.entry.js +1 -1
  32. package/dist/esm-es5/salla-add-product-button_47.entry.js.map +1 -1
  33. package/dist/esm-es5/salla-contacts.entry.js +1 -1
  34. package/dist/esm-es5/salla-contacts.entry.js.map +1 -1
  35. package/dist/esm-es5/twilight.js +1 -1
  36. package/dist/esm-es5/twilight.js.map +1 -1
  37. package/dist/twilight/{p-0b684f2a.system.entry.js → p-0a6b09fa.system.entry.js} +2 -2
  38. package/dist/twilight/p-0a6b09fa.system.entry.js.map +1 -0
  39. package/dist/twilight/{p-688e0ccc.system.entry.js → p-17637111.system.entry.js} +2 -2
  40. package/dist/twilight/p-17637111.system.entry.js.map +1 -0
  41. package/dist/twilight/p-2059b78a.system.js +5 -0
  42. package/dist/twilight/{p-a8240d5d.system.js.map → p-2059b78a.system.js.map} +1 -1
  43. package/dist/twilight/{p-da02effc.js → p-66395721.js} +2 -2
  44. package/dist/twilight/{p-da02effc.js.map → p-66395721.js.map} +1 -1
  45. package/dist/twilight/{p-14c42ca3.system.js → p-75f5e4ac.system.js} +2 -2
  46. package/dist/{esm-es5/app-globals-7795aa55.js.map → twilight/p-75f5e4ac.system.js.map} +1 -1
  47. package/dist/twilight/{p-8defc948.entry.js → p-902f747a.entry.js} +2 -2
  48. package/dist/twilight/p-902f747a.entry.js.map +1 -0
  49. package/dist/twilight/{p-bd831e45.entry.js → p-ce2fd4cc.entry.js} +2 -2
  50. package/dist/twilight/p-ce2fd4cc.entry.js.map +1 -0
  51. package/dist/twilight/twilight.esm.js +1 -1
  52. package/dist/twilight/twilight.esm.js.map +1 -1
  53. package/dist/twilight/twilight.js +1 -1
  54. package/dist/types/components/salla-bottom-alert/salla-bottom-alert.d.ts +2 -0
  55. package/package.json +4 -4
  56. package/dist/twilight/p-0b684f2a.system.entry.js.map +0 -1
  57. package/dist/twilight/p-688e0ccc.system.entry.js.map +0 -1
  58. package/dist/twilight/p-8defc948.entry.js.map +0 -1
  59. package/dist/twilight/p-a8240d5d.system.js +0 -5
  60. package/dist/twilight/p-bd831e45.entry.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,H as c,g as n}from"./p-dd9b5ccb.js";import{e}from"./p-f1c8cdd7.js";const i=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n`;const o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>whatsapp2</title>\n<path d="M27.281 4.65c-2.994-3-6.975-4.65-11.219-4.65-8.738 0-15.85 7.112-15.85 15.856 0 2.794 0.731 5.525 2.119 7.925l-2.25 8.219 8.406-2.206c2.319 1.262 4.925 1.931 7.575 1.931h0.006c0 0 0 0 0 0 8.738 0 15.856-7.113 15.856-15.856 0-4.238-1.65-8.219-4.644-11.219zM16.069 29.050v0c-2.369 0-4.688-0.637-6.713-1.837l-0.481-0.288-4.987 1.306 1.331-4.863-0.313-0.5c-1.325-2.094-2.019-4.519-2.019-7.012 0-7.269 5.912-13.181 13.188-13.181 3.519 0 6.831 1.375 9.319 3.862 2.488 2.494 3.856 5.8 3.856 9.325-0.006 7.275-5.919 13.188-13.181 13.188zM23.294 19.175c-0.394-0.2-2.344-1.156-2.706-1.288s-0.625-0.2-0.894 0.2c-0.262 0.394-1.025 1.288-1.256 1.556-0.231 0.262-0.462 0.3-0.856 0.1s-1.675-0.619-3.188-1.969c-1.175-1.050-1.975-2.35-2.206-2.744s-0.025-0.613 0.175-0.806c0.181-0.175 0.394-0.463 0.594-0.694s0.262-0.394 0.394-0.662c0.131-0.262 0.069-0.494-0.031-0.694s-0.894-2.15-1.219-2.944c-0.319-0.775-0.65-0.669-0.894-0.681-0.231-0.012-0.494-0.012-0.756-0.012s-0.694 0.1-1.056 0.494c-0.363 0.394-1.387 1.356-1.387 3.306s1.419 3.831 1.619 4.1c0.2 0.262 2.794 4.269 6.769 5.981 0.944 0.406 1.681 0.65 2.256 0.837 0.95 0.3 1.813 0.256 2.494 0.156 0.762-0.113 2.344-0.956 2.675-1.881s0.331-1.719 0.231-1.881c-0.094-0.175-0.356-0.275-0.756-0.475z"></path>\n</svg>\n`;const a=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n`;const l=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n`;const h=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";const r=class{constructor(s){t(this,s);var c;this.contactsTitle=undefined;this.hideTitle=undefined;this.isHeader=undefined;this.horizontal=undefined;this.iconsOnly=undefined;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:i,whatsapp:o,phone:a,telegram:l,email:e};this.contactSlot=((c=this.host.querySelector('[slot="contact"]'))===null||c===void 0?void 0:c.innerHTML)||`<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>${!this.iconsOnly&&"<span class='unicode'>{value}</span>"}</a>`;salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((()=>{this.contactsTitle=salla.lang.get("blocks.footer.social")}))}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>s!=="")).map((([t,s])=>({type:t,value:s})))}getContactLink(t){switch(t){case"phone":return`tel:${this.contacts[t]}`;case"mobile":return`tel:${this.contacts[t]}`;case"email":return`mailto:${this.contacts[t]}`;case"telegram":return`https://t.me/${this.contacts[t]}`;default:return this.contacts[t]}}getContactIcon(t){return this.iconsList[t]}render(){const t=this.getContactsArray();if(this.isHeader&&t&&t.length>0){return s(c,{class:"s-contacts s-contacts-header"},t.filter((t=>t.type=="phone"||t.type=="email")).map(((t,c)=>s("a",{href:this.getContactLink(t.type),key:c,class:"s-contacts-topnav-link"},t.type==="email"?t.value:[s("span",null,this.contactsTitle,": "),s("a",{class:"unicode",href:this.iconsList[t.type]},t.value)]))))}return s(c,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,c)=>s("div",{key:c,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()}get host(){return n(this)}};r.style=h;export{r as salla_contacts};
5
- //# sourceMappingURL=p-8defc948.entry.js.map
4
+ import{r as t,h as s,H as c,g as n}from"./p-dd9b5ccb.js";import{e}from"./p-f1c8cdd7.js";const i=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n`;const a=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>whatsapp2</title>\n<path d="M27.281 4.65c-2.994-3-6.975-4.65-11.219-4.65-8.738 0-15.85 7.112-15.85 15.856 0 2.794 0.731 5.525 2.119 7.925l-2.25 8.219 8.406-2.206c2.319 1.262 4.925 1.931 7.575 1.931h0.006c0 0 0 0 0 0 8.738 0 15.856-7.113 15.856-15.856 0-4.238-1.65-8.219-4.644-11.219zM16.069 29.050v0c-2.369 0-4.688-0.637-6.713-1.837l-0.481-0.288-4.987 1.306 1.331-4.863-0.313-0.5c-1.325-2.094-2.019-4.519-2.019-7.012 0-7.269 5.912-13.181 13.188-13.181 3.519 0 6.831 1.375 9.319 3.862 2.488 2.494 3.856 5.8 3.856 9.325-0.006 7.275-5.919 13.188-13.181 13.188zM23.294 19.175c-0.394-0.2-2.344-1.156-2.706-1.288s-0.625-0.2-0.894 0.2c-0.262 0.394-1.025 1.288-1.256 1.556-0.231 0.262-0.462 0.3-0.856 0.1s-1.675-0.619-3.188-1.969c-1.175-1.050-1.975-2.35-2.206-2.744s-0.025-0.613 0.175-0.806c0.181-0.175 0.394-0.463 0.594-0.694s0.262-0.394 0.394-0.662c0.131-0.262 0.069-0.494-0.031-0.694s-0.894-2.15-1.219-2.944c-0.319-0.775-0.65-0.669-0.894-0.681-0.231-0.012-0.494-0.012-0.756-0.012s-0.694 0.1-1.056 0.494c-0.363 0.394-1.387 1.356-1.387 3.306s1.419 3.831 1.619 4.1c0.2 0.262 2.794 4.269 6.769 5.981 0.944 0.406 1.681 0.65 2.256 0.837 0.95 0.3 1.813 0.256 2.494 0.156 0.762-0.113 2.344-0.956 2.675-1.881s0.331-1.719 0.231-1.881c-0.094-0.175-0.356-0.275-0.756-0.475z"></path>\n</svg>\n`;const o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n`;const l=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n`;const h=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";const r=class{constructor(s){t(this,s);var c;this.contactsTitle=undefined;this.hideTitle=undefined;this.isHeader=undefined;this.horizontal=undefined;this.iconsOnly=undefined;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:i,whatsapp:a,phone:o,telegram:l,email:e};this.contactSlot=((c=this.host.querySelector('[slot="contact"]'))===null||c===void 0?void 0:c.innerHTML)||`<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>${!this.iconsOnly&&"<span class='unicode'>{value}</span>"}</a>`;salla.onReady((()=>{this.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((()=>{this.contactsTitle=salla.lang.get("blocks.footer.social")}))}getContactsArray(){return Object.entries(this.contacts).filter((([t,s])=>s!=="")).map((([t,s])=>({type:t,value:s})))}getContactLink(t){switch(t){case"phone":return`tel:${this.contacts[t]}`;case"mobile":return`tel:${this.contacts[t]}`;case"whatsapp":return salla.url.get("whatsapp/send");case"email":return`mailto:${this.contacts[t]}`;case"telegram":return`https://t.me/${this.contacts[t]}`;default:return this.contacts[t]}}getContactIcon(t){return this.iconsList[t]}render(){const t=this.getContactsArray();if(this.isHeader&&t&&t.length>0){return s(c,{class:"s-contacts s-contacts-header"},t.filter((t=>t.type=="phone"||t.type=="email")).map(((t,c)=>s("a",{href:this.getContactLink(t.type),key:c,class:"s-contacts-topnav-link"},t.type==="email"?t.value:[s("span",null,this.contactsTitle,": "),s("a",{class:"unicode",href:this.iconsList[t.type]},t.value)]))))}return s(c,{class:"s-contacts"},!this.hideTitle&&s("h3",{class:"s-contacts-title"},this.contactsTitle),s("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},t.map(((t,c)=>s("div",{key:c,id:"contact-slot",innerHTML:this.contactSlot.replace(/\{icon\}/g,this.getContactIcon(t.type)).replace(/\{value\}/g,t.value.toString()).replace(/\{link\}/g,this.getContactLink(t.type))})))))}componentDidRender(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()}get host(){return n(this)}};r.style=h;export{r as salla_contacts};
5
+ //# sourceMappingURL=p-902f747a.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sallaContactsCss","SallaContacts","constructor","hostRef","salla","config","get","mobile","whatsapp","phone","telegram","email","this","contactSlot","_a","host","querySelector","innerHTML","iconsOnly","onReady","contacts","lang","onLoaded","contactsTitle","getContactsArray","Object","entries","filter","_key","value","map","type","getContactLink","url","getContactIcon","iconsList","render","contactsArray","isHeader","length","h","Host","class","contact","index","href","key","hideTitle","horizontal","id","replace","toString","componentDidRender","remove"],"sources":["src/components/salla-contacts/salla-contacts.scss?tag=salla-contacts","src/components/salla-contacts/salla-contacts.tsx"],"sourcesContent":[".unicode {\n unicode-bidi: plaintext;\n}","import { Component, Host, h, Prop, State, Element } from '@stencil/core';\nimport mobile from '../../assets/svg/iphone.svg';\nimport whatsapp from '../../assets/svg/whatsapp2.svg';\nimport phone from '../../assets/svg/phone.svg';\nimport telegram from '../../assets/svg/paper-plane-o.svg';\nimport email from '../../assets/svg/mail.svg';\n/**\n * @slot contact - Replaces contact item, has replaceable props `{icon}`, `{value}`.\n */\n@Component({\n tag: 'salla-contacts',\n styleUrl: 'salla-contacts.scss',\n})\nexport class SallaContacts {\n constructor() {\n this.contactSlot = this.host.querySelector('[slot=\"contact\"]')?.innerHTML || `<a href={link} class=\"s-contacts-item\"><span class=\"s-contacts-icon\">{icon}</span>${!this.iconsOnly && \"<span class='unicode'>{value}</span>\"}</a>`;\n\n salla.onReady(() => {\n this.contacts = salla.config.get('store.contacts');\n });\n\n salla.lang.onLoaded(() => {\n this.contactsTitle = salla.lang.get('blocks.footer.social');\n });\n }\n private readonly contactSlot: string;\n @Prop() contactsTitle: string;\n @Prop() hideTitle: boolean;\n @Prop() isHeader: boolean;\n @Prop() horizontal: boolean;\n @Prop() iconsOnly: boolean;\n @Element() host: HTMLElement;\n @State() contacts: any = salla.config.get('store.contacts');\n @State() iconsList: any = { mobile, whatsapp, phone, telegram, email }\n\n private getContactsArray() {\n return Object.entries(this.contacts)\n .filter(([_key, value]) => value !== '')\n .map(([type, value]) => ({ type, value }));\n }\n\n private getContactLink(type) {\n switch (type) {\n case 'phone':\n return `tel:${this.contacts[type]}`; \n case 'mobile':\n return `tel:${this.contacts[type]}`;\n case 'whatsapp':\n return salla.url.get('whatsapp/send');\n case 'email':\n return `mailto:${this.contacts[type]}`;\n case 'telegram':\n return `https://t.me/${this.contacts[type]}`;\n default:\n return this.contacts[type];\n }\n }\n\n private getContactIcon(type) {\n return this.iconsList[type];\n }\n render() {\n const contactsArray = this.getContactsArray();\n if (this.isHeader && contactsArray && contactsArray.length > 0) {\n return (\n <Host class=\"s-contacts s-contacts-header\">\n {contactsArray.filter((contact) => contact.type == 'phone' || contact.type == 'email').map((contact, index) => (\n <a href={this.getContactLink(contact.type)} key={index} class=\"s-contacts-topnav-link\">\n {contact.type === 'email' ? (\n contact.value\n ) : (\n [\n <span>{this.contactsTitle}: </span>,\n <a class=\"unicode\" href={this.iconsList[contact.type]}>{contact.value}</a>\n ]\n )}\n </a>\n ))}\n </Host>\n );\n }\n return (\n <Host class=\"s-contacts\">\n {!this.hideTitle && <h3 class=\"s-contacts-title\">{this.contactsTitle}</h3>}\n <div class={{\n 's-contacts-list': true,\n 's-contacts-list-horizontal': this.horizontal,\n 's-contacts-list-vertical': !this.horizontal,\n 's-contacts-list-icons-only': this.iconsOnly\n }\n }>\n {contactsArray.map((contact, index) => (\n <div key={index} id=\"contact-slot\" innerHTML={this.contactSlot\n .replace(/\\{icon\\}/g, this.getContactIcon(contact.type))\n .replace(/\\{value\\}/g, contact.value.toString())\n .replace(/\\{link\\}/g, this.getContactLink(contact.type))}>\n </div>\n ))}\n </div>\n </Host>\n );\n }\n componentDidRender() {\n // this.host.querySelectorAll('#contact-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"contact\"]')?.remove();\n }\n}\n\n"],"mappings":";;;smIAAA,MAAMA,EAAmB,kE,MCaZC,EAAa,MACxB,WAAAC,CAAAC,G,+JAkByBC,MAAMC,OAAOC,IAAI,kB,eAChB,CAAEC,SAAQC,WAAUC,QAAOC,WAAUC,SAlB7DC,KAAKC,cAAcC,EAAAF,KAAKG,KAAKC,cAAc,uBAAmB,MAAAF,SAAA,SAAAA,EAAEG,YAAa,sFAAsFL,KAAKM,WAAa,6CAErLd,MAAMe,SAAQ,KACZP,KAAKQ,SAAWhB,MAAMC,OAAOC,IAAI,iBAAiB,IAGpDF,MAAMiB,KAAKC,UAAS,KAClBV,KAAKW,cAAgBnB,MAAMiB,KAAKf,IAAI,uBAAuB,G,CAavD,gBAAAkB,GACN,OAAOC,OAAOC,QAAQd,KAAKQ,UACxBO,QAAO,EAAEC,EAAMC,KAAWA,IAAU,KACpCC,KAAI,EAAEC,EAAMF,MAAM,CAAQE,OAAMF,W,CAG7B,cAAAG,CAAeD,GACrB,OAAQA,GACN,IAAK,QACH,MAAO,OAAOnB,KAAKQ,SAASW,KAC9B,IAAK,SACH,MAAO,OAAOnB,KAAKQ,SAASW,KAC9B,IAAK,WACH,OAAO3B,MAAM6B,IAAI3B,IAAI,iBACvB,IAAK,QACH,MAAO,UAAUM,KAAKQ,SAASW,KACjC,IAAK,WACH,MAAO,gBAAgBnB,KAAKQ,SAASW,KACvC,QACE,OAAOnB,KAAKQ,SAASW,G,CAInB,cAAAG,CAAeH,GACrB,OAAOnB,KAAKuB,UAAUJ,E,CAExB,MAAAK,GACE,MAAMC,EAAgBzB,KAAKY,mBAC3B,GAAIZ,KAAK0B,UAAYD,GAAiBA,EAAcE,OAAS,EAAG,CAC9D,OACEC,EAACC,EAAI,CAACC,MAAM,gCACTL,EAAcV,QAAQgB,GAAYA,EAAQZ,MAAQ,SAAWY,EAAQZ,MAAQ,UAASD,KAAI,CAACa,EAASC,IACnGJ,EAAA,KAAGK,KAAMjC,KAAKoB,eAAeW,EAAQZ,MAAOe,IAAKF,EAAOF,MAAM,0BAC3DC,EAAQZ,OAAS,QAChBY,EAAa,OAGXH,EAAA,YAAO5B,KAAKW,cAAa,MACzBiB,EAAA,KAAGE,MAAM,UAAUG,KAAMjC,KAAKuB,UAAUQ,EAAQZ,OAAQY,EAAQd,W,CAQ9E,OACEW,EAACC,EAAI,CAACC,MAAM,eACR9B,KAAKmC,WAAaP,EAAA,MAAIE,MAAM,oBAAoB9B,KAAKW,eACvDiB,EAAA,OAAKE,MAAO,CACV,kBAAmB,KACnB,6BAA8B9B,KAAKoC,WACnC,4BAA6BpC,KAAKoC,WAClC,6BAA8BpC,KAAKM,YAGlCmB,EAAcP,KAAI,CAACa,EAASC,IAC3BJ,EAAA,OAAKM,IAAKF,EAAOK,GAAG,eAAehC,UAAWL,KAAKC,YAChDqC,QAAQ,YAAatC,KAAKsB,eAAeS,EAAQZ,OACjDmB,QAAQ,aAAcP,EAAQd,MAAMsB,YACpCD,QAAQ,YAAatC,KAAKoB,eAAeW,EAAQZ,Y,CAO9D,kBAAAqB,G,OAEEtC,EAAAF,KAAKG,KAAKC,cAAc,uBAAmB,MAAAF,SAAA,SAAAA,EAAEuC,Q"}