@creaditor/newsletter-starterkit 1.0.43 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/112.creaditor.bundle.js +3 -3
- package/dist/112.creaditor.bundle.js.gz +0 -0
- package/dist/1260.creaditor.bundle.js +11 -11
- package/dist/1260.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js +6 -6
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1334.creaditor.bundle.js +3 -3
- package/dist/1334.creaditor.bundle.js.gz +0 -0
- package/dist/1452.creaditor.bundle.js +3 -3
- package/dist/1452.creaditor.bundle.js.gz +0 -0
- package/dist/1456.creaditor.bundle.js +3 -3
- package/dist/1456.creaditor.bundle.js.gz +0 -0
- package/dist/1529.creaditor.bundle.js +2 -2
- package/dist/1529.creaditor.bundle.js.gz +0 -0
- package/dist/1565.creaditor.bundle.js +100 -100
- package/dist/1565.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js +8 -8
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/175.creaditor.bundle.js +5 -5
- package/dist/175.creaditor.bundle.js.gz +0 -0
- package/dist/1972.creaditor.bundle.js +2 -2
- package/dist/1972.creaditor.bundle.js.gz +0 -0
- package/dist/211.creaditor.bundle.js +1 -1
- package/dist/211.creaditor.bundle.js.gz +0 -0
- package/dist/2112.creaditor.bundle.js +3 -3
- package/dist/2112.creaditor.bundle.js.gz +0 -0
- package/dist/2350.creaditor.bundle.js +3 -3
- package/dist/2350.creaditor.bundle.js.gz +0 -0
- package/dist/2377.creaditor.bundle.js +7 -7
- package/dist/2377.creaditor.bundle.js.gz +0 -0
- package/dist/2384.creaditor.bundle.js +6 -6
- package/dist/2384.creaditor.bundle.js.gz +0 -0
- package/dist/2397.creaditor.bundle.js +4 -4
- package/dist/2397.creaditor.bundle.js.gz +0 -0
- package/dist/2409.creaditor.bundle.js +4 -4
- package/dist/2409.creaditor.bundle.js.gz +0 -0
- package/dist/2438.creaditor.bundle.js +5 -5
- package/dist/2438.creaditor.bundle.js.gz +0 -0
- package/dist/2547.creaditor.bundle.js +2 -2
- package/dist/2547.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js +2 -2
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/271.creaditor.bundle.js +7 -7
- package/dist/271.creaditor.bundle.js.gz +0 -0
- package/dist/2773.creaditor.bundle.js +3 -3
- package/dist/2773.creaditor.bundle.js.gz +0 -0
- package/dist/2833.creaditor.bundle.js +3 -3
- package/dist/2833.creaditor.bundle.js.gz +0 -0
- package/dist/2834.creaditor.bundle.js +2 -2
- package/dist/2834.creaditor.bundle.js.gz +0 -0
- package/dist/2956.creaditor.bundle.js +3 -3
- package/dist/2956.creaditor.bundle.js.gz +0 -0
- package/dist/2963.creaditor.bundle.js +3 -3
- package/dist/2963.creaditor.bundle.js.gz +0 -0
- package/dist/307.creaditor.bundle.js +3 -3
- package/dist/307.creaditor.bundle.js.gz +0 -0
- package/dist/3095.creaditor.bundle.js +13 -13
- package/dist/3095.creaditor.bundle.js.gz +0 -0
- package/dist/3233.creaditor.bundle.js +2 -2
- package/dist/3233.creaditor.bundle.js.gz +0 -0
- package/dist/3521.creaditor.bundle.js +3 -3
- package/dist/3521.creaditor.bundle.js.gz +0 -0
- package/dist/353.creaditor.bundle.js +3 -3
- package/dist/353.creaditor.bundle.js.gz +0 -0
- package/dist/3553.creaditor.bundle.js +5 -5
- package/dist/3553.creaditor.bundle.js.gz +0 -0
- package/dist/3606.creaditor.bundle.js +5 -5
- package/dist/3606.creaditor.bundle.js.gz +0 -0
- package/dist/365.creaditor.bundle.js +3 -3
- package/dist/365.creaditor.bundle.js.gz +0 -0
- package/dist/3827.creaditor.bundle.js +3 -3
- package/dist/3827.creaditor.bundle.js.gz +0 -0
- package/dist/3875.creaditor.bundle.js +3 -3
- package/dist/3875.creaditor.bundle.js.gz +0 -0
- package/dist/3932.creaditor.bundle.js +3 -3
- package/dist/3932.creaditor.bundle.js.gz +0 -0
- package/dist/3971.creaditor.bundle.js +3 -3
- package/dist/3971.creaditor.bundle.js.gz +0 -0
- package/dist/407.creaditor.bundle.js +3 -3
- package/dist/407.creaditor.bundle.js.gz +0 -0
- package/dist/4074.creaditor.bundle.js +3 -3
- package/dist/4074.creaditor.bundle.js.gz +0 -0
- package/dist/4100.creaditor.bundle.js +2 -2
- package/dist/4100.creaditor.bundle.js.gz +0 -0
- package/dist/4114.creaditor.bundle.js +3 -3
- package/dist/4114.creaditor.bundle.js.gz +0 -0
- package/dist/4161.creaditor.bundle.js +3 -3
- package/dist/4161.creaditor.bundle.js.gz +0 -0
- package/dist/4217.creaditor.bundle.js +7 -7
- package/dist/4217.creaditor.bundle.js.gz +0 -0
- package/dist/4288.creaditor.bundle.js +4 -4
- package/dist/4288.creaditor.bundle.js.gz +0 -0
- package/dist/4413.creaditor.bundle.js +3 -3
- package/dist/4413.creaditor.bundle.js.gz +0 -0
- package/dist/4475.creaditor.bundle.js +3 -3
- package/dist/4475.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js +12 -12
- package/dist/453.creaditor.bundle.js.gz +0 -0
- package/dist/4569.creaditor.bundle.js +72 -72
- package/dist/4569.creaditor.bundle.js.gz +0 -0
- package/dist/4615.creaditor.bundle.js +2 -2
- package/dist/4615.creaditor.bundle.js.gz +0 -0
- package/dist/467.creaditor.bundle.js +3 -3
- package/dist/467.creaditor.bundle.js.gz +0 -0
- package/dist/4762.creaditor.bundle.js +3 -3
- package/dist/4762.creaditor.bundle.js.gz +0 -0
- package/dist/4770.creaditor.bundle.js +3 -3
- package/dist/4770.creaditor.bundle.js.gz +0 -0
- package/dist/4947.creaditor.bundle.js +3 -3
- package/dist/4947.creaditor.bundle.js.gz +0 -0
- package/dist/4988.creaditor.bundle.js +2 -2
- package/dist/4988.creaditor.bundle.js.gz +0 -0
- package/dist/5133.creaditor.bundle.js +5 -5
- package/dist/5133.creaditor.bundle.js.gz +0 -0
- package/dist/5156.creaditor.bundle.js +7 -7
- package/dist/5156.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +5 -5
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/5391.creaditor.bundle.js +3 -3
- package/dist/5391.creaditor.bundle.js.gz +0 -0
- package/dist/5411.creaditor.bundle.js +3 -3
- package/dist/5411.creaditor.bundle.js.gz +0 -0
- package/dist/5428.creaditor.bundle.js +3 -3
- package/dist/5428.creaditor.bundle.js.gz +0 -0
- package/dist/5501.creaditor.bundle.js +13 -13
- package/dist/5501.creaditor.bundle.js.gz +0 -0
- package/dist/5530.creaditor.bundle.js +4 -4
- package/dist/5530.creaditor.bundle.js.gz +0 -0
- package/dist/5666.creaditor.bundle.js +3 -3
- package/dist/5666.creaditor.bundle.js.gz +0 -0
- package/dist/567.creaditor.bundle.js +6 -6
- package/dist/567.creaditor.bundle.js.gz +0 -0
- package/dist/578.creaditor.bundle.js +4 -4
- package/dist/578.creaditor.bundle.js.gz +0 -0
- package/dist/5839.creaditor.bundle.js +2 -2
- package/dist/5839.creaditor.bundle.js.gz +0 -0
- package/dist/5849.creaditor.bundle.js +3 -3
- package/dist/5849.creaditor.bundle.js.gz +0 -0
- package/dist/5850.creaditor.bundle.js +3 -3
- package/dist/5850.creaditor.bundle.js.gz +0 -0
- package/dist/589.creaditor.bundle.js +11 -11
- package/dist/589.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +6 -6
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/6036.creaditor.bundle.js +2 -2
- package/dist/6036.creaditor.bundle.js.gz +0 -0
- package/dist/638.creaditor.bundle.js +3 -3
- package/dist/638.creaditor.bundle.js.gz +0 -0
- package/dist/6442.creaditor.bundle.js +3 -3
- package/dist/6442.creaditor.bundle.js.gz +0 -0
- package/dist/6459.creaditor.bundle.js +3 -3
- package/dist/6459.creaditor.bundle.js.gz +0 -0
- package/dist/6496.creaditor.bundle.js +3 -3
- package/dist/6496.creaditor.bundle.js.gz +0 -0
- package/dist/653.creaditor.bundle.js +3 -3
- package/dist/653.creaditor.bundle.js.gz +0 -0
- package/dist/7155.creaditor.bundle.js +3 -3
- package/dist/7155.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +26 -26
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7238.creaditor.bundle.js +6 -6
- package/dist/7238.creaditor.bundle.js.gz +0 -0
- package/dist/7255.creaditor.bundle.js +2 -2
- package/dist/7255.creaditor.bundle.js.gz +0 -0
- package/dist/7307.creaditor.bundle.js +11 -11
- package/dist/7307.creaditor.bundle.js.gz +0 -0
- package/dist/738.creaditor.bundle.js +2 -2
- package/dist/738.creaditor.bundle.js.gz +0 -0
- package/dist/7380.creaditor.bundle.js +2 -2
- package/dist/7380.creaditor.bundle.js.gz +0 -0
- package/dist/752.creaditor.bundle.js +3 -3
- package/dist/752.creaditor.bundle.js.gz +0 -0
- package/dist/7523.creaditor.bundle.js +3 -3
- package/dist/7523.creaditor.bundle.js.gz +0 -0
- package/dist/767.creaditor.bundle.js +7 -7
- package/dist/767.creaditor.bundle.js.gz +0 -0
- package/dist/7759.creaditor.bundle.js +3 -3
- package/dist/7759.creaditor.bundle.js.gz +0 -0
- package/dist/7838.creaditor.bundle.js +3 -3
- package/dist/7838.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +12 -12
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/7997.creaditor.bundle.js +3 -3
- package/dist/7997.creaditor.bundle.js.gz +0 -0
- package/dist/8042.creaditor.bundle.js +5 -5
- package/dist/8042.creaditor.bundle.js.gz +0 -0
- package/dist/8064.creaditor.bundle.js +3 -3
- package/dist/8064.creaditor.bundle.js.gz +0 -0
- package/dist/8141.creaditor.bundle.js +2 -2
- package/dist/8141.creaditor.bundle.js.gz +0 -0
- package/dist/8251.creaditor.bundle.js +3 -3
- package/dist/8251.creaditor.bundle.js.gz +0 -0
- package/dist/8305.creaditor.bundle.js +3 -3
- package/dist/8305.creaditor.bundle.js.gz +0 -0
- package/dist/8315.creaditor.bundle.js +2 -2
- package/dist/8315.creaditor.bundle.js.gz +0 -0
- package/dist/8443.creaditor.bundle.js +3 -3
- package/dist/8443.creaditor.bundle.js.gz +0 -0
- package/dist/8516.creaditor.bundle.js +2 -2
- package/dist/8516.creaditor.bundle.js.gz +0 -0
- package/dist/8570.creaditor.bundle.js +3 -3
- package/dist/8570.creaditor.bundle.js.gz +0 -0
- package/dist/8646.creaditor.bundle.js +5 -5
- package/dist/8646.creaditor.bundle.js.gz +0 -0
- package/dist/8654.creaditor.bundle.js +5 -5
- package/dist/8654.creaditor.bundle.js.gz +0 -0
- package/dist/8676.creaditor.bundle.js +3 -3
- package/dist/8676.creaditor.bundle.js.gz +0 -0
- package/dist/8854.creaditor.bundle.js +3 -3
- package/dist/8854.creaditor.bundle.js.gz +0 -0
- package/dist/8916.creaditor.bundle.js +2 -2
- package/dist/8916.creaditor.bundle.js.gz +0 -0
- package/dist/8921.creaditor.bundle.js +3 -3
- package/dist/8921.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js +8 -8
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9089.creaditor.bundle.js +3 -3
- package/dist/9089.creaditor.bundle.js.gz +0 -0
- package/dist/9162.creaditor.bundle.js +3 -3
- package/dist/9162.creaditor.bundle.js.gz +0 -0
- package/dist/9184.creaditor.bundle.js +3 -3
- package/dist/9184.creaditor.bundle.js.gz +0 -0
- package/dist/9250.creaditor.bundle.js +3 -3
- package/dist/9250.creaditor.bundle.js.gz +0 -0
- package/dist/9386.creaditor.bundle.js +3 -3
- package/dist/9386.creaditor.bundle.js.gz +0 -0
- package/dist/9453.creaditor.bundle.js +3 -3
- package/dist/9453.creaditor.bundle.js.gz +0 -0
- package/dist/9570.creaditor.bundle.js +3 -3
- package/dist/9570.creaditor.bundle.js.gz +0 -0
- package/dist/975.creaditor.bundle.js +3 -3
- package/dist/975.creaditor.bundle.js.gz +0 -0
- package/dist/976.creaditor.bundle.js +3 -3
- package/dist/976.creaditor.bundle.js.gz +0 -0
- package/dist/9986.creaditor.bundle.js +3 -3
- package/dist/9986.creaditor.bundle.js.gz +0 -0
- package/dist/9990.creaditor.bundle.js +3 -3
- package/dist/9990.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +269 -268
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3095,4569,7307],{73095(t,e,i){i.r(e),i.d(e,{default:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3095,4569,7307],{73095(t,e,i){i.r(e),i.d(e,{default:()=>r});var s=i(59929),o=i(21421),n=i(69600);class r extends s.WF{constructor(){super(),this.contentRef=(0,o._)(),this.toggle=this.toggle.bind(this),this.onEnter=this.onEnter.bind(this),this.onKeydown=this.onKeydown.bind(this),this.overflow=!0,this.maxHeight=300,this.left=0,this.top=0,this.custom=!1,this.opened=!1}close(){this.toggle()}onBouncing(t){this.searchText=t.target.value;const e=new UIEvent("search",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e)}render(){return s.qy`
|
|
2
2
|
<slot @click=${()=>this.toggle()} tabindex="0" name="trigger"></slot>
|
|
3
|
-
${this.opened?
|
|
3
|
+
${this.opened?s.qy` <div
|
|
4
4
|
@mouseup=${this.onClickOutside}
|
|
5
5
|
class="backdrop"
|
|
6
|
-
style="z-index:${(0,
|
|
6
|
+
style="z-index:${(0,n.A)()};"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
|
-
${(0,
|
|
9
|
+
${(0,o.K)(this.contentRef)}
|
|
10
10
|
@mouseup=${this.preventClosing}
|
|
11
|
-
style="z-index:${(0,
|
|
11
|
+
style="z-index:${(0,n.A)()};left:${this.left}px;top:${this.top}px;"
|
|
12
12
|
class="dropdown-content fade-in ${this.custom?"":"dropdown-background"}"
|
|
13
13
|
>
|
|
14
|
-
${this.search?
|
|
14
|
+
${this.search?s.qy`<cdtr-input
|
|
15
15
|
@input=${this.onBouncing}
|
|
16
16
|
type="search"
|
|
17
17
|
value=${this.searchText}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<slot name="content"></slot>
|
|
20
20
|
</div>
|
|
21
21
|
</div>`:null}
|
|
22
|
-
`}preventClosing(t){return t.stopPropagation(),setTimeout(()=>{this.calcRects()},0),!1}onClickOutside(){this.toggle(!1)}updated(){this.opened&&(setTimeout(()=>{this.calcRects()},0),this.contentRef.value?.classList.add("fade-in"),this.contentRef.value.style.maxHeight=`${this.maxHeight}px`)}calcRects(){let t=0,e=0;const i=this.getBoundingClientRect(),s=this.contentRef?.value?.getBoundingClientRect();s&&(t=i.left,e=i.top,t<0&&(t=0),e<0&&(e=0),t+s.width>window.innerWidth&&(t=window.innerWidth-s.width),e+s.height>window.innerHeight&&(e=window.innerHeight-s.height),this.left=t,this.top=e,this.contentRef.value.style.left=`${i.left}px`,this.contentRef.value.style.top=`${e+i.height}px`,this.contentRef.value.style.overflow=this.overflow?"hidden auto":"hidden")}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=t||!this.opened;e?(window.removeEventListener("keydown",this.onKeydown),window.addEventListener("keydown",this.onKeydown),this.opened=e,setTimeout(()=>{const t=this.focusedItem=this.querySelector("cdtr-dropdown-item[focused]")||this.querySelector("cdtr-dropdown-item");t&&t.focus()},20)):(window.removeEventListener("keydown",this.onKeydown),this.contentRef.value?.classList.add("fade-out"),setTimeout(()=>{this.opened=e},150)),this.setAttribute("aria-expanded",e)}onEnter(t){t.target===this&&13===t.keyCode&&this.toggle()}onKeydown(t){this.focusedItem&&40===t.keyCode&&this.focusedItem.nextElementSibling&&"CDTR-DROPDOWN-ITEM"===this.focusedItem.nextElementSibling.nodeName?(this.focusedItem=this.focusedItem.nextElementSibling,this.focusedItem&&this.focusedItem.focus()):this.focusedItem&&38===t.keyCode&&this.focusedItem.previousElementSibling&&"CDTR-DROPDOWN-ITEM"===this.focusedItem.previousElementSibling.nodeName?(this.focusedItem=this.focusedItem.previousElementSibling,this.focusedItem&&this.focusedItem.focus()):27===t.keyCode&&this.toggle();const e=new UIEvent("keypress",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-disabled","false"),this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",this.opened),this.addEventListener("keydown",this.onEnter),setTimeout(()=>{this.opened&&this.toggle(!0)},50)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("keydown",this.onKeydown)}patch(t){this.value=t,this.toggle(!1);const e=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e),setTimeout(()=>{this.focus()},0)}}
|
|
22
|
+
`}preventClosing(t){return t.stopPropagation(),setTimeout(()=>{this.calcRects()},0),!1}onClickOutside(){this.toggle(!1)}updated(){this.opened&&(setTimeout(()=>{this.calcRects()},0),this.contentRef.value?.classList.add("fade-in"),this.contentRef.value.style.maxHeight=`${this.maxHeight}px`)}calcRects(){let t=0,e=0;const i=this.getBoundingClientRect(),s=this.contentRef?.value?.getBoundingClientRect();s&&(t=i.left,e=i.top,t<0&&(t=0),e<0&&(e=0),t+s.width>window.innerWidth&&(t=window.innerWidth-s.width),e+s.height>window.innerHeight&&(e=window.innerHeight-s.height),this.left=t,this.top=e,this.contentRef.value.style.left=`${i.left}px`,this.contentRef.value.style.top=`${e+i.height}px`,this.contentRef.value.style.overflow=this.overflow?"hidden auto":"hidden")}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=t||!this.opened;e?(window.removeEventListener("keydown",this.onKeydown),window.addEventListener("keydown",this.onKeydown),this.opened=e,setTimeout(()=>{const t=this.focusedItem=this.querySelector("cdtr-dropdown-item[focused]")||this.querySelector("cdtr-dropdown-item");t&&t.focus()},20)):(window.removeEventListener("keydown",this.onKeydown),this.contentRef.value?.classList.add("fade-out"),setTimeout(()=>{this.opened=e},150)),this.setAttribute("aria-expanded",e)}onEnter(t){t.target===this&&13===t.keyCode&&this.toggle()}onKeydown(t){this.focusedItem&&40===t.keyCode&&this.focusedItem.nextElementSibling&&"CDTR-DROPDOWN-ITEM"===this.focusedItem.nextElementSibling.nodeName?(this.focusedItem=this.focusedItem.nextElementSibling,this.focusedItem&&this.focusedItem.focus()):this.focusedItem&&38===t.keyCode&&this.focusedItem.previousElementSibling&&"CDTR-DROPDOWN-ITEM"===this.focusedItem.previousElementSibling.nodeName?(this.focusedItem=this.focusedItem.previousElementSibling,this.focusedItem&&this.focusedItem.focus()):27===t.keyCode&&this.toggle();const e=new UIEvent("keypress",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-disabled","false"),this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",this.opened),this.addEventListener("keydown",this.onEnter),setTimeout(()=>{this.opened&&this.toggle(!0)},50)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("keydown",this.onKeydown)}patch(t){this.value=t,this.toggle(!1);const e=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e),setTimeout(()=>{this.focus()},0)}}r.styles=s.AH`
|
|
23
23
|
:host {
|
|
24
24
|
display: inline-block;
|
|
25
25
|
overflow: hidden;
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
opacity: 0;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
`,r.properties={search:{type:Boolean},searchText:{type:String},left:{type:Number},top:{type:Number},opened:{type:Boolean},maxHeight:{type:Number},overflow:{type:Boolean},value:{type:String},custom:{type:String}};class a extends s.WF{constructor(){super(),this.minWidth=50}render(){return s.qy`<paper-button style="min-width:${this.minWidth}px"
|
|
77
77
|
><slot></slot> <cdtr-dd-arrow-icon></cdtr-dd-arrow-icon
|
|
78
|
-
></paper-button>`}}
|
|
78
|
+
></paper-button>`}}a.properties={minWidth:{type:Number}},a.styles=s.AH`
|
|
79
79
|
paper-button {
|
|
80
80
|
display: flex;
|
|
81
81
|
justify-content: space-between;
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
paper-button:hover {
|
|
105
105
|
border-color: black;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
`;class l extends s.WF{constructor(){super(),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}focus(){this.shadowRoot.querySelector(".dropdown-item").focus()}onFocus(){this.focused=!0}onBlur(){this.focused=!1}onClick(t){if(this.notClickable)return;const e=this.closest("cdtr-dropdown");e&&e.patch(this.value,t,this)}onPress(t){if(13===t.keyCode){const e=new UIEvent("click",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e);const i=this.closest("cdtr-dropdown");i&&i.patch(this.value,t,this)}}connectedCallback(){super.connectedCallback(),this.selected&&this.scrollIntoView({behavior:"smooth",block:"start"})}render(){return s.qy`<div role="button"
|
|
108
108
|
@click=${this.onClick}
|
|
109
109
|
@keydown=${this.onPress}
|
|
110
110
|
@blur=${this.onBlur}
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
class="dropdown-item"
|
|
113
113
|
tabindex="0"
|
|
114
114
|
>
|
|
115
|
-
${this.selected?
|
|
115
|
+
${this.selected?s.qy` <svg
|
|
116
116
|
class="selected-svg"
|
|
117
117
|
fill="var(--primary)"
|
|
118
118
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
/>
|
|
127
127
|
</svg>`:null}
|
|
128
128
|
<slot></slot>
|
|
129
|
-
</div>`}}
|
|
129
|
+
</div>`}}l.properties={focused:{type:Boolean,reflect:!0},selected:{type:Boolean,reflect:!0},value:{type:String,reflect:!0},notClickable:{type:Boolean}},l.styles=s.AH`
|
|
130
130
|
.dropdown-item {
|
|
131
131
|
position: relative;
|
|
132
132
|
box-sizing: border-box;
|
|
@@ -158,11 +158,11 @@
|
|
|
158
158
|
transform: translate(-70%, -50%);
|
|
159
159
|
top: 50%;
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
`,customElements.get("cdtr-dropdown-item")||customElements.define("cdtr-dropdown-item",l),customElements.get("cdtr-dropdown-button")||customElements.define("cdtr-dropdown-button",a),customElements.get("cdtr-dropdown")||customElements.define("cdtr-dropdown",r)},47307(t,e,i){i.r(e),i.d(e,{default:()=>c});var s=i(59929),o=i(21421),n=i(91597),r=i(81744),a=i(86319);const l=(0,n.S)();class c extends s.WF{constructor(){super(),this.inputRef=(0,o._)(),this.min=0,this.max=100,this.step=1,this.autofocus=!1,this.type="text",this.value="number"===this.type?"0":"",this.placeholder="",this.oldValue=this.value,this.successActive=!1,this._successTimeout=null}onSubmit(t){t.preventDefault();const e=new UIEvent("submit",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e),this.oldValue=this.value}focus(){const t=this.inputRef.value;t.focus(),t.setSelectionRange(t.value.length,t.value.length)}onFocus(){const t=new UIEvent("focus",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)}onBlur(){const t=new UIEvent("blur",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t),this.oldValue=this.value}render(){this.fullWidth&&(this.style.width="100%"),this.value||"text"!==this.type||(this.value=""),this.icon&&"string"!=typeof this.inputStyle&&(this.inputStyle="");const t=a.M.get("lang",this.placeholder)||this.placeholder||"";t&&("string"!=typeof this.inputStyle&&(this.inputStyle=""),-1===this.inputStyle.indexOf("text-align")&&(this.inputStyle+=";text-align:"+("rtl"===(0,r.o)(t)?"right":"")));const e=this.multiline?s.qy` <textarea
|
|
162
162
|
row=${this.row||4}
|
|
163
163
|
.disabled=${this.disabled}
|
|
164
164
|
dir="auto"
|
|
165
|
-
${(0,
|
|
165
|
+
${(0,o.K)(this.inputRef)}
|
|
166
166
|
style="${this.inputStyle}"
|
|
167
167
|
.autofocus="${this.autofocus}"
|
|
168
168
|
.placeholder="${t}"
|
|
@@ -172,10 +172,10 @@
|
|
|
172
172
|
.max="${String(this.max)}"
|
|
173
173
|
.step="${String(this.step)}"
|
|
174
174
|
.value="${String(this.value)}"
|
|
175
|
-
/>`:
|
|
175
|
+
/>`:s.qy` <input
|
|
176
176
|
.disabled=${this.disabled}
|
|
177
177
|
dir="auto"
|
|
178
|
-
${(0,
|
|
178
|
+
${(0,o.K)(this.inputRef)}
|
|
179
179
|
style="${this.inputStyle}"
|
|
180
180
|
.autofocus="${this.autofocus}"
|
|
181
181
|
.placeholder="${t}"
|
|
@@ -186,9 +186,9 @@
|
|
|
186
186
|
.max="${String(this.max)}"
|
|
187
187
|
.step="${String(this.step)}"
|
|
188
188
|
.value="${String(this.value)}"
|
|
189
|
-
/>`;return
|
|
189
|
+
/>`;return s.qy`<form @submit=${this.onSubmit}>
|
|
190
190
|
${e}
|
|
191
|
-
${!this.icon||this.couchOnEmpty||this.successActive?null:
|
|
191
|
+
${!this.icon||this.couchOnEmpty||this.successActive?null:s.qy`<cdtr-icon
|
|
192
192
|
color="#d9d9d9"
|
|
193
193
|
width=${20}
|
|
194
194
|
height=${20}
|
|
@@ -197,19 +197,19 @@
|
|
|
197
197
|
left: 10px;"
|
|
198
198
|
icon="${this.icon}"
|
|
199
199
|
></cdtr-icon>`}
|
|
200
|
-
${this.successActive?
|
|
200
|
+
${this.successActive?s.qy`<div class="success-overlay" aria-live="polite">
|
|
201
201
|
<cdtr-couch-mark></cdtr-couch-mark>
|
|
202
202
|
<span class="success-icon">✓</span>
|
|
203
203
|
</div>`:null}
|
|
204
|
-
${!this.couchOnEmpty||this.value||this.successActive?null:
|
|
204
|
+
${!this.couchOnEmpty||this.value||this.successActive?null:s.qy`<cdtr-couch-mark
|
|
205
205
|
style="position: absolute;
|
|
206
206
|
transform: translateY(-50%);
|
|
207
207
|
left: 0;"
|
|
208
208
|
></cdtr-couch-mark>`}
|
|
209
|
-
${"text"===this.type&&this.maxLength?
|
|
209
|
+
${"text"===this.type&&this.maxLength?s.qy`<span class="counter"
|
|
210
210
|
>${this.value.length}/${this.maxLength}</span
|
|
211
211
|
> `:null}
|
|
212
|
-
</form>`}firstUpdated(){this.autofocus&&setTimeout(()=>{this.inputRef.value&&this.inputRef.value.focus()},500),void 0===this.value&&(this.value="")}focus(){super.focus(),this.inputRef.value.focus()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null)}setValue(t){if(this.selectionStart=this.inputRef.value.selectionStart,!this.inputRef.value)return;const e=this.inputRef.value;if("text"===this.type&&this.max&&e.value.length>this.max)return e.value=this.value,void this.inputRef.value.focus();this.value=e.value;const i=new UIEvent(t.type,{view:window,bubbles:!0,cancelable:!0});if(this.dispatchEvent(i),"input"===t.type){const t=()=>{const t=new UIEvent("debounce",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)};
|
|
212
|
+
</form>`}firstUpdated(){this.autofocus&&setTimeout(()=>{this.inputRef.value&&this.inputRef.value.focus()},500),void 0===this.value&&(this.value="")}focus(){super.focus(),this.inputRef.value.focus()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null)}setValue(t){if(this.selectionStart=this.inputRef.value.selectionStart,!this.inputRef.value)return;const e=this.inputRef.value;if("text"===this.type&&this.max&&e.value.length>this.max)return e.value=this.value,void this.inputRef.value.focus();this.value=e.value;const i=new UIEvent(t.type,{view:window,bubbles:!0,cancelable:!0});if(this.dispatchEvent(i),"input"===t.type){const t=()=>{const t=new UIEvent("debounce",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)};l.run(t,500)}}success(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null),this.successActive=!0;const e=Number(t);!Number.isFinite(e)||e<=0||(this._successTimeout=setTimeout(()=>{this.successActive=!1,this._successTimeout=null},e))}patch(t){this.value=t}}c.styles=s.AH`
|
|
213
213
|
:host {
|
|
214
214
|
display: inline-block;
|
|
215
215
|
--cdtr-input-height: 30px;
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
box-shadow: 0 0 10px rgba(79, 192, 111, 0.2);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
|
|
346
|
+
`,c.properties={value:{type:String,reflect:!0},step:{type:Number,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0},type:{type:String,reflect:!0},inputDir:{type:String},icon:{type:String,reflect:!0},placeholder:{type:String,reflect:!0},autofocus:{type:Boolean,reflect:!0},fullWidth:{type:Boolean,reflect:!0},selectionStart:{type:Number},inputStyle:{type:String,reflect:!0},maxLength:{type:Number},couchOnEmpty:{type:Boolean},disabled:{type:Boolean},multiline:{type:Boolean},row:{type:Number},successActive:{type:Boolean}},customElements.get("cdtr-input")||customElements.define("cdtr-input",c)},64569(t,e,i){i.r(e),i.d(e,{LinkElement:()=>x});var s=i(59929),o=i(86319),n=i(88385);const r=s.AH`
|
|
347
347
|
:host {
|
|
348
348
|
--paper-radio-button-checked-color: var(--primary);
|
|
349
349
|
box-sizing: border-box;
|
|
@@ -494,54 +494,54 @@
|
|
|
494
494
|
margin-top: 0.75rem;
|
|
495
495
|
padding-left: 1rem;
|
|
496
496
|
}
|
|
497
|
-
`;var
|
|
497
|
+
`;var a=i(21421);i(73095),i(47307);const l="260px",c=[{type:"https:",text:"link"},{type:"http:",text:"link"},{type:"mailto:",text:"sendEmail"},{type:"tel:",text:"tel"},{type:"sms:",text:"sendSms"},{type:"whatsapp:",text:"sendWhatsapp"},{type:"anchor:",text:"anchor"}],d="cdtrAdd",h="cdtrRemove",p="cdtrAutomation",u=[d,h,p];function m(t,e){t=t.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}function f(t,e){switch(t){case"anchor:":return function(t){const{url:e,anchors:i,href:o,protocol:n,onChangeLink:r,onBlur:a,onRequest:l}=t;return s.qy`
|
|
498
498
|
<cdtr-row alignItems="center" spacing="5">
|
|
499
499
|
<cdtr-dropdown
|
|
500
500
|
@change=${t=>{r({target:{value:"#"+t.target.value},anchor:!0}),a()}}
|
|
501
|
-
.opened=${i.length>0&&"anchor:"===n&&!
|
|
501
|
+
.opened=${i.length>0&&"anchor:"===n&&!o}
|
|
502
502
|
class="anchor-dd"
|
|
503
503
|
>
|
|
504
504
|
<cdtr-dropdown-button
|
|
505
505
|
minWidth=${100}
|
|
506
506
|
class=" dropdown-button"
|
|
507
507
|
slot="trigger"
|
|
508
|
-
><lang-text .text=${e.isAnchor?
|
|
508
|
+
><lang-text .text=${e.isAnchor?o:""}></lang-text>
|
|
509
509
|
</cdtr-dropdown-button>
|
|
510
510
|
<div style="min-width:150px" slot="content">
|
|
511
|
-
${i.map(t=>
|
|
511
|
+
${i.map(t=>s.qy`<cdtr-dropdown-item
|
|
512
512
|
value="${t.props.name||t.props.element_ID}"
|
|
513
513
|
>${t.props.name||t.props.element_ID}
|
|
514
514
|
</cdtr-dropdown-item>`)}
|
|
515
515
|
</div>
|
|
516
516
|
</cdtr-dropdown>
|
|
517
|
-
${0===i.length?
|
|
517
|
+
${0===i.length?s.qy`<paper-button
|
|
518
518
|
@click=${()=>{"function"===l&&l("anchor")}}
|
|
519
519
|
><cdtr-title
|
|
520
520
|
><lang-text text="create_anchor"></lang-text></cdtr-title
|
|
521
521
|
></paper-button>`:null}
|
|
522
522
|
</cdtr-row>
|
|
523
|
-
`}(e);case"mailto:":return function(t){const{href:e,body:i,subject:
|
|
523
|
+
`}(e);case"mailto:":return function(t){const{href:e,body:i,subject:o,onBlur:n,updateBody:r,updateSubject:a}=t,c="string"==typeof e?m("body",e):i||e.params.body,d="string"==typeof e?m("subject",e):o||e.params.subject;return s.qy`
|
|
524
524
|
<cdtr-row spacing="5">
|
|
525
525
|
<cdtr-title class="explain-title"
|
|
526
526
|
><lang-text text="add_catchy_subject"></lang-text
|
|
527
527
|
></cdtr-title>
|
|
528
528
|
<cdtr-input
|
|
529
529
|
inputStyle="height:${"40px"};"
|
|
530
|
-
style="width:${
|
|
530
|
+
style="width:${l};"
|
|
531
531
|
@change=${t=>{let{target:e}=t;a(e.value),n()}}
|
|
532
|
-
value=${d||
|
|
532
|
+
value=${d||o||""}
|
|
533
533
|
></cdtr-input>
|
|
534
534
|
<cdtr-title class="explain-title"
|
|
535
535
|
><lang-text text="email_body_if_needed"></lang-text
|
|
536
536
|
></cdtr-title>
|
|
537
537
|
<cdtr-input
|
|
538
538
|
.multiline=${!0}
|
|
539
|
-
value="${
|
|
540
|
-
style="width:${
|
|
539
|
+
value="${c||i||""}"
|
|
540
|
+
style="width:${l};"
|
|
541
541
|
@change=${t=>{let{target:e}=t;r(e.value),n()}}
|
|
542
542
|
></cdtr-input>
|
|
543
543
|
</cdtr-row>
|
|
544
|
-
`}(e);case"sms:":return function(t){const{href:e,body:i,onBlur:
|
|
544
|
+
`}(e);case"sms:":return function(t){const{href:e,body:i,onBlur:o,updateBody:n}=t,r="string"==typeof e?m("body",e):e.params.body;return s.qy`
|
|
545
545
|
<cdtr-row spacing="5">
|
|
546
546
|
<cdtr-title class="explain-title"
|
|
547
547
|
><lang-text text="sms_body_if_needed"></lang-text
|
|
@@ -549,11 +549,11 @@
|
|
|
549
549
|
<cdtr-input
|
|
550
550
|
.multiline=${!0}
|
|
551
551
|
value="${r||i||""}"
|
|
552
|
-
style="width:${
|
|
553
|
-
@change=${t=>{let{target:e}=t;n(e.value),
|
|
552
|
+
style="width:${l};"
|
|
553
|
+
@change=${t=>{let{target:e}=t;n(e.value),o()}}
|
|
554
554
|
></cdtr-input>
|
|
555
555
|
</cdtr-row>
|
|
556
|
-
`}(e);case"whatsapp:":return function(t){const{href:e,body:i,onBlur:
|
|
556
|
+
`}(e);case"whatsapp:":return function(t){const{href:e,body:i,onBlur:o,updateBody:n}=t,r="string"==typeof e?m("text",e)||m("body",e):e.params&&(e.params.text||e.params.body)||"";return s.qy`
|
|
557
557
|
<cdtr-row spacing="5">
|
|
558
558
|
<cdtr-title class="explain-title"
|
|
559
559
|
><lang-text text="whatsapp_body_if_needed"></lang-text
|
|
@@ -561,30 +561,30 @@
|
|
|
561
561
|
<cdtr-input
|
|
562
562
|
.multiline=${!0}
|
|
563
563
|
value="${r||i||""}"
|
|
564
|
-
style="width:${
|
|
565
|
-
@change=${t=>{let{target:e}=t;n(e.value),
|
|
564
|
+
style="width:${l};"
|
|
565
|
+
@change=${t=>{let{target:e}=t;n(e.value),o()}}
|
|
566
566
|
></cdtr-input>
|
|
567
567
|
</cdtr-row>
|
|
568
|
-
`}(e);default:return""}}function
|
|
568
|
+
`}(e);default:return""}}function g(t,e,i,s,o,r){if(!t)return null;const a="string"==typeof t?new n.A({href:t,protocol:e,params:i}):new n.A(t);return t?"whatsapp:"===e||"whatsapp:"===a.protocol?function(t,e,i,s,o){const r="string"==typeof t?new n.A({href:t,protocol:e,params:i}):new n.A(t),a=(r.params&&(r.params.phone||function(t){try{const e=/whatsapp:([^?]+)/,i=t.match(e);return i?i[1]:""}catch(t){return""}}(r.fullHref))||m("phone",r.href||"")||r.url||"").replace(/\D+/g,"");if(!a)return null;const l=s||r.params&&(r.params.text||r.params.body)||"",c=l?encodeURIComponent(l):"";let d=`https://wa.me/${a}`;c&&(d+=`?text=${c}`);const h=new n.A(d);return h.target=o||h.target||"_blank",{url:h,params:h.params,protocol:"whatsapp:"}}(t,e,i,s,r):(a.isEmail?function(t,e,i){let s=!1;e?t.addParam("subject",e):t.params&&"subject"in t.params&&(delete t.params.subject,s=!0),i?t.addParam("body",i):t.params&&"body"in t.params&&(delete t.params.body,s=!0),s&&(t.href=t.getUrlWithParams())}(a,o,s):s?a.addParam("body",s):a.params&&"body"in a.params&&(delete a.params.body,a.href=a.getUrlWithParams()),a.target=r||a.target||"_blank",{url:a,params:a.params,protocol:a.protocol}):null}function b(t,e,i){if(!t)return{href:{},protocol:null,body:"",subject:""};if(t.startsWith("http")&&!t.startsWith("http://")&&!t.startsWith("https://"))return null;const s=n.A.getProtocol(t);let o=e;s&&(o=s+":");const r=new n.A({href:t,protocol:o||null});console.log("output",r);const a=(i instanceof n.A?i:new n.A(i)).url!==r.url;return{href:r,protocol:r.protocol,shouldBlur:r.isValid,clearParams:a}}function y(t){const{value:e="",inputRef:i,autofocus:o=!1,onChange:n,onBlur:r,onFocus:c,onKeyDown:d,placeholder:h="",inputStyle:p="",style:u="width:260px;",width:m=l}=t,f=t=>{n&&n(t),r&&r()},g=(()=>{if(null==e||""===e)return"";try{return decodeURI(String(e))||""}catch{return String(e)}})();return s.qy`
|
|
569
569
|
<cdtr-row style="position:relative;" spacing="5">
|
|
570
570
|
<span style="display:none;" aria-hidden="true">${e}</span>
|
|
571
571
|
<cdtr-input
|
|
572
572
|
.couchOnEmpty=${!0}
|
|
573
|
-
${i?(0,
|
|
573
|
+
${i?(0,a.K)(i):""}
|
|
574
574
|
style="${u}"
|
|
575
575
|
inputStyle="${p}"
|
|
576
|
-
.autofocus=${
|
|
576
|
+
.autofocus=${o}
|
|
577
577
|
type="search"
|
|
578
578
|
width="${m}"
|
|
579
579
|
placeholder="${h}"
|
|
580
580
|
@input=${t=>{if(t.target.selectionStart!==t.target.value.length)return;const e=t.target.value.trim();/^[^a-zA-Z0-9]+$/.test(e)||n&&n(t)}}
|
|
581
581
|
@change=${f}
|
|
582
|
-
@focus=${
|
|
582
|
+
@focus=${c}
|
|
583
583
|
@submit=${d||f}
|
|
584
584
|
.value="${g}"
|
|
585
585
|
></cdtr-input>
|
|
586
586
|
</cdtr-row>
|
|
587
|
-
`}function
|
|
587
|
+
`}function v(t){return class extends t{initAutomations(){this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.activeTab="add",this.baseUrl="",this.showSaveSuccess=!1;const t=o.M.get("config","editor","configure","editorProps","mailingLists","items");this.mailingLists=t||[];const e=o.M.get("config","editor","configure","editorProps","automations")||{};this.automations=[],e.addAndRemoveFromMailingList&&this.automations.push({id:"addAndRemoveFromMailingList",name:"moving_from_mailing_list"})}onAutomationsClick(){if(this.showAutomations=!0,this.protocol="automation:",this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.href&&this.href.href){const t=this.href.href;if("string"==typeof t&&t.match(/^\[\[([^\]]+)\]\]\?/))this.parseAutomationLink(this.href);else{const t=new n.A(this.href);t.params&&t.params[p]?(this.baseUrl=this.extractBaseUrl(t),this.parseAutomationLink(t)):this.baseUrl=t.href||""}}else this.baseUrl="";this.requestUpdate()}extractBaseUrl(t){const e=[];t.protocol&&e.push(t.protocol),t.host&&(e.push("//"),e.push(t.host)),t.pathname&&e.push(t.pathname);const i=u,s=[];t.params&&Object.keys(t.params).forEach(e=>{if(!i.includes(e)){const i=t.params[e];s.push(`${e}=${encodeURIComponent(i)}`)}});let o=e.join("");return s.length>0&&(o+=`?${s.join("&")}`),t.href}onBackClick(){if(this.selectedAutomation)this.selectedAutomation=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null;else if(this.showAutomations=!1,this.activeAutomationId=null,"automation:"===this.protocol)if(this.baseUrl){const t=new n.A(this.baseUrl);this.href=t,this.protocol=t.protocol}else this.protocol=null,this.href={};this.requestUpdate()}onAutomationClick(t){this.selectedAutomation=t,this.activeAutomationId=t.id,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.requestUpdate()}onActionSelect(t){this.automationAction===t?this.automationAction=null:this.automationAction=t,this.requestUpdate()}onTabChange(t){this.activeTab=t,this.requestUpdate()}onMailingListToggle(t,e){("add"===e?this.selectedMailingListsForAdd:this.selectedMailingListsForRemove).indexOf(t)>-1?"add"===e?this.selectedMailingListsForAdd=this.selectedMailingListsForAdd.filter(e=>e!==t):this.selectedMailingListsForRemove=this.selectedMailingListsForRemove.filter(e=>e!==t):"add"===e?this.selectedMailingListsForAdd=[...this.selectedMailingListsForAdd,t]:this.selectedMailingListsForRemove=[...this.selectedMailingListsForRemove,t],this.requestUpdate()}createAutomationLink(){if(!this.selectedAutomation)return null;const t=[];if(this.selectedMailingListsForAdd.length>0&&t.push(`${d}=${this.selectedMailingListsForAdd.join(",")}`),this.selectedMailingListsForRemove.length>0&&t.push(`${h}=${this.selectedMailingListsForRemove.join(",")}`),0===t.length)return null;const e=this.selectedAutomation.name||this.selectedAutomation.id;if(this.baseUrl&&this.baseUrl.trim()){let e=this.baseUrl.trim();e.match(/^https?:\/\//i)||e.includes("://")||!e.includes(".")&&e.match(/^[a-zA-Z]+:/)||(e=`https://${e}`),t.push(`url=${encodeURIComponent(e)}`)}return`[[${e}]]?${t.join("&")}`}onSaveAutomation(){const t=this.createAutomationLink();if(!t)return;console.log("Saving automation link:",t);const e=t.match(/^\[\[([^\]]+)\]\]\?(.+)$/);if(!e)return void console.error("Invalid automation link format:",t);const i=e[1],s=e[2],o={};s.split("&").forEach(t=>{const[e,i]=t.split("=");e&&i&&(o[decodeURIComponent(e)]=decodeURIComponent(i))});const r=o.url;let a;if(delete o.url,a=r?new n.A(r):new n.A("https://example.com"),a.params||(a.params={}),o[d]&&(a.params[d]=o[d]),o[h]&&(a.params[h]=o[h]),a.params[p]=i,a.href=t,a.url=r||"",this.href=a,this.protocol=null,this.value=a,this.link=a,this.lastUrl=a,console.log("Set href to:",this.href),console.log("Set href.href to:",this.href?.href),this.onDispatch(),console.log("After dispatch, href:",this.href),console.log("After dispatch, href.href:",this.href?.href),console.log("After dispatch, href.params:",this.href?.params),this.href&&(!this.href.params||!this.href.params[p])){console.log("Restoring automation params after dispatch");const t=this.href.href||this.href,e=String(t).match(/^\[\[([^\]]+)\]\]\?(.+)$/);if(e){const i=e[2],s={};i.split("&").forEach(t=>{const[e,i]=t.split("=");e&&i&&(s[decodeURIComponent(e)]=decodeURIComponent(i))});const o=s.url,r=o?new n.A(o):new n.A("https://example.com");r.params||(r.params={}),s[d]&&(r.params[d]=s[d]),s[h]&&(r.params[h]=s[h]),r.params[p]=e[1],r.href=t,r.url=o||"",this.href=r,this.value=r,this.link=r,this.lastUrl=r,console.log("Restored href:",this.href?.href),console.log("Restored params:",this.href?.params)}}this.showSaveSuccess=!0,this.requestUpdate(),setTimeout(()=>{this.showSaveSuccess=!1,this.requestUpdate()},2e3)}parseAutomationLink(t){if(!t)return;let e=null,i=!1,s=t.href||t;if("string"==typeof s&&s.match(/^\[\[([^\]]+)\]\]\?/)){i=!0;e=s.match(/^\[\[([^\]]+)\]\]\?/)[1]}else t.params&&(e=t.params[p],i=e&&""!==e&&"string"==typeof e&&""!==e.trim());if(i){if("string"==typeof s&&s.match(/^\[\[([^\]]+)\]\]\?(.+)$/)){const t=s.match(/^\[\[([^\]]+)\]\]\?(.+)$/)[2],e={};if(t.split("&").forEach(t=>{const[i,s]=t.split("=");i&&s&&(e[decodeURIComponent(i)]=decodeURIComponent(s))}),e.url?this.baseUrl=e.url:this.baseUrl="",e[d]){const t="string"==typeof e[d]?e[d].split(",").filter(t=>t.trim()):Array.isArray(e[d])?e[d]:[];this.selectedMailingListsForAdd=t}if(e[h]){const t="string"==typeof e[h]?e[h].split(",").filter(t=>t.trim()):Array.isArray(e[h])?e[h]:[];this.selectedMailingListsForRemove=t}}else if(t.params){const e=this.extractBaseUrl(t);if(this.baseUrl=e,t.params[d]){const e="string"==typeof t.params[d]?t.params[d].split(",").filter(t=>t.trim()):Array.isArray(t.params[d])?t.params[d]:[];this.selectedMailingListsForAdd=e}if(t.params[h]){const e="string"==typeof t.params[h]?t.params[h].split(",").filter(t=>t.trim()):Array.isArray(t.params[h])?t.params[h]:[];this.selectedMailingListsForRemove=e}}if((this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0)&&(this.showAutomations=!0,this.automations&&this.automations.length>0)){const t=String(e).trim(),i=this.automations.find(e=>e.name&&String(e.name).trim()===t||e.id&&String(e.id).trim()===t)||this.automations[0];this.selectedAutomation=i,this.activeAutomationId=i.id}}}renderAutomationsView(){return this.selectedAutomation?this.renderAutomationDetails():s.qy`
|
|
588
588
|
<div class="automations-view">
|
|
589
589
|
<cdtr-row justify="space-between" alignItems="center" mb="1">
|
|
590
590
|
<cdtr-title
|
|
@@ -601,7 +601,7 @@
|
|
|
601
601
|
</cdtr-row>
|
|
602
602
|
<cdtr-divider></cdtr-divider>
|
|
603
603
|
<div class="automations-list" style="margin-top: 1rem;">
|
|
604
|
-
${this.automations.map(t=>{const e=this.activeAutomationId===t.id;return
|
|
604
|
+
${this.automations.map(t=>{const e=this.activeAutomationId===t.id;return s.qy`
|
|
605
605
|
<div
|
|
606
606
|
class="automation-card ${e?"active":""}"
|
|
607
607
|
@click=${()=>this.onAutomationClick(t)}
|
|
@@ -623,7 +623,7 @@
|
|
|
623
623
|
>
|
|
624
624
|
<lang-text text="${t.name}"></lang-text>
|
|
625
625
|
</cdtr-title>
|
|
626
|
-
${e?
|
|
626
|
+
${e?s.qy`
|
|
627
627
|
<span
|
|
628
628
|
style="color: var(--primary); font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
|
|
629
629
|
>✓</span
|
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
</h6>
|
|
639
639
|
</div>
|
|
640
640
|
</div>
|
|
641
|
-
`}renderAutomationDetails(){const t=this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0;return
|
|
641
|
+
`}renderAutomationDetails(){const t=this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0;return s.qy`
|
|
642
642
|
<div
|
|
643
643
|
class="automation-details-view"
|
|
644
644
|
style="display: flex; flex-direction: column; height: 100%;"
|
|
@@ -662,7 +662,7 @@
|
|
|
662
662
|
|
|
663
663
|
<div class="automation-content">
|
|
664
664
|
<!-- Success Message -->
|
|
665
|
-
${this.showSaveSuccess?
|
|
665
|
+
${this.showSaveSuccess?s.qy`
|
|
666
666
|
<style>
|
|
667
667
|
.save-success-container {
|
|
668
668
|
margin-bottom: 1rem;
|
|
@@ -782,7 +782,7 @@
|
|
|
782
782
|
>
|
|
783
783
|
<lang-text text="url"></lang-text> (Optional)
|
|
784
784
|
</cdtr-title>
|
|
785
|
-
${
|
|
785
|
+
${y({value:this.baseUrl||"",onChange:t=>{const e=t.target.value||"",i=b(e,null,this.baseUrl?new n.A(this.baseUrl):{});null===i?this.baseUrl=e:i.href?i.href instanceof n.A?this.baseUrl=i.href.href||e:"string"==typeof i.href?this.baseUrl=i.href:this.baseUrl=e:this.baseUrl=e,this.requestUpdate()},placeholder:"https://example.com",inputStyle:"height: 40px; padding: 0.5rem; border: 1px solid #e0e0e0; border-radius: 4px; width: 100%;",style:"width: 100%;"})}
|
|
786
786
|
</div>
|
|
787
787
|
|
|
788
788
|
<h6
|
|
@@ -832,10 +832,10 @@
|
|
|
832
832
|
</div>
|
|
833
833
|
|
|
834
834
|
<!-- Add to mailing list section -->
|
|
835
|
-
${"add"===this.activeTab?
|
|
835
|
+
${"add"===this.activeTab?s.qy`
|
|
836
836
|
<div class="action-section">
|
|
837
837
|
<div class="mailing-lists-list" style="padding-left: 1rem;">
|
|
838
|
-
${this.mailingLists.map(t=>{const e=this.selectedMailingListsForAdd.includes(t.id);return
|
|
838
|
+
${this.mailingLists.map(t=>{const e=this.selectedMailingListsForAdd.includes(t.id);return s.qy`
|
|
839
839
|
<div
|
|
840
840
|
class="mailing-list-item ${e?"selected":""}"
|
|
841
841
|
@click=${()=>this.onMailingListToggle(t.id,"add")}
|
|
@@ -860,12 +860,12 @@
|
|
|
860
860
|
>
|
|
861
861
|
${t.name}
|
|
862
862
|
</cdtr-title>
|
|
863
|
-
${e?
|
|
863
|
+
${e?s.qy`
|
|
864
864
|
<span
|
|
865
865
|
style="color: var(--primary); font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
|
|
866
866
|
>✓</span
|
|
867
867
|
>
|
|
868
|
-
`:
|
|
868
|
+
`:s.qy`
|
|
869
869
|
<span
|
|
870
870
|
style="color: #ddd; font-size: 18px; margin-left: 0.5rem;"
|
|
871
871
|
>○</span
|
|
@@ -879,10 +879,10 @@
|
|
|
879
879
|
`:null}
|
|
880
880
|
|
|
881
881
|
<!-- Remove from mailing list section -->
|
|
882
|
-
${"remove"===this.activeTab?
|
|
882
|
+
${"remove"===this.activeTab?s.qy`
|
|
883
883
|
<div class="action-section">
|
|
884
884
|
<div class="mailing-lists-list" style="padding-left: 1rem;">
|
|
885
|
-
${this.mailingLists.map(t=>{const e=this.selectedMailingListsForRemove.includes(t.id);return
|
|
885
|
+
${this.mailingLists.map(t=>{const e=this.selectedMailingListsForRemove.includes(t.id);return s.qy`
|
|
886
886
|
<div
|
|
887
887
|
class="mailing-list-item ${e?"selected":""}"
|
|
888
888
|
@click=${()=>this.onMailingListToggle(t.id,"remove")}
|
|
@@ -907,12 +907,12 @@
|
|
|
907
907
|
>
|
|
908
908
|
${t.name}
|
|
909
909
|
</cdtr-title>
|
|
910
|
-
${e?
|
|
910
|
+
${e?s.qy`
|
|
911
911
|
<span
|
|
912
912
|
style="color: #f44336; font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
|
|
913
913
|
>✓</span
|
|
914
914
|
>
|
|
915
|
-
`:
|
|
915
|
+
`:s.qy`
|
|
916
916
|
<span
|
|
917
917
|
style="color: #ddd; font-size: 18px; margin-left: 0.5rem;"
|
|
918
918
|
>○</span
|
|
@@ -948,8 +948,8 @@
|
|
|
948
948
|
</cdtr-row>
|
|
949
949
|
</div>
|
|
950
950
|
</div>
|
|
951
|
-
`}}}customElements.get("paper-button")||Promise.resolve().then(i.bind(i,39239)),customElements.get("cdtr-emoji-picker")||i.e(3105).then(i.t.bind(i,63105,23));class
|
|
952
|
-
${q=this.label,q?
|
|
951
|
+
`}}}customElements.get("paper-button")||Promise.resolve().then(i.bind(i,39239)),customElements.get("cdtr-emoji-picker")||i.e(3105).then(i.t.bind(i,63105,23));class x extends(v(s.WF)){constructor(){super(),this.inputRef=(0,a._)(),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.urlInputFocused=!1,this._urlInputRawValue="",this._lastSyncedMyHref=void 0,this._lastBodySyncHref=void 0,this.lastUrl=void 0,this.target="_blank",this.anchors=[],this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0}),this.options=c,this.body="",this.subject="",this.name=o.M.get("lang",c[0].text),this.initAutomations()}onDispatch(){const t=function(t){const{href:e,protocol:i,params:s,body:o,subject:n,target:r,dispatchEvent:a,event:l}=t;if(!e)return a(l),{dispatched:!0};const c=g(e,i,s,o,n,r);return c?{dispatched:!0,href:c.url,protocol:c.protocol,params:c.params,value:c.url,link:c.url,lastUrl:c.url}:{dispatched:!1}}({href:this.href,protocol:this.protocol,params:this.params,body:this.body,subject:this.subject,target:this.target,dispatchEvent:this.dispatchEvent.bind(this),event:this.event});if(t.dispatched){if(t.href){this.href=t.href,this.protocol=t.protocol,this.params=t.params?{...t.params}:{},this.value=t.value,this.link=t.link,this.lastUrl=t.lastUrl;const e="string"==typeof t.href?t.href:t.href?.href;this._urlInputRawValue=null!=e&&""!==e?String(e):""}this.dispatchEvent(this.event)}}onChangeLink(t){const e=t.target.value;this._urlInputRawValue=e;const i=b(e,this.protocol,this.href);null!==i?(this.href=i.href,this.protocol=i.protocol,i.clearParams&&(this.body="",this.subject=""),void 0!==i.body&&(this.body=i.body),void 0!==i.subject&&(this.subject=i.subject),i.shouldBlur&&this.onBlur()):this.href=e}onKeyDown(t){if("submit"===t.type){const t=this.inputRef?.value;void 0!==t?.value&&this.onChangeLink({target:{value:t.value}}),t&&"function"==typeof t.success&&t.success(),this.onDispatch()}}onUrlInputFocus(){const t=this.inputRef?.value?.value;null!=t&&(this._urlInputRawValue=t),this.urlInputFocused=!0}onUrlInputBlur(){this.urlInputFocused=!1,this.hasButton||this.onDispatch()}onBlur(){this.hasButton||this.onDispatch()}onClickOk(){this.onDispatch()}onChangeTarget(t){const e={target:t.target.value};this.target=e.target,t.stopPropagation(),!this.hasButton&&this.href&&this.onBlur()}resolveAnchors(){this.anchors=function(){const t=o.M.get("components");return t?.filter(t=>"anchor"===t.type&&t.props.name||t.props.element_ID)||[]}()}onChangeType(t){const e=function(t,e,i,s){const o=e.find(e=>e.type===t);if(!o)return{forceProtocolChange:!1};const n="anchor"===o.text,r=s!==o.type;return setTimeout(()=>{i&&i.value&&i.value.focus()},500),{protocol:o.type,forceProtocolChange:!0,shouldResolveAnchors:n,clearParams:r}}(t,this.options,this.inputRef,this.protocol);if(e.shouldResolveAnchors&&this.resolveAnchors(),this.protocol=e.protocol,this.forceProtocolChange=e.forceProtocolChange,e.clearParams&&(this.body="",this.subject=""),e.forceProtocolChange){const t=new n.A(this.href,{protocol:this.protocol});t.protocol=this.protocol,this.href=t,this.onBlur()}}connectedCallback(){super.connectedCallback(),this.href=new n.A(this.href);const t=String(this.href?.href||"").match(/^\[\[([^\]]+)\]\]\?/),e=this.href&&this.href.params&&this.href.params[p];(t||e)&&this.parseAutomationLink(this.href)}render(){const t=o.M.get("config","editor","configure","editorProps","linkPicker","savedVariables");this.resolveAnchors();const e=this.lastUrl!==this.href,i=new n.A(this.href,{protocol:e?null:this.protocol});this.protocol&&!e?i.protocol=this.protocol:i.protocol&&(this.protocol=i.protocol);const r=String(this.href?.href||this.href||"");if(this._lastBodySyncHref!==r){this._lastBodySyncHref=r,i.params?(this.body=i.params.text||i.params.body||"",this.subject=i.params.subject||""):(this.body="",this.subject="");r.match(/^\[\[([^\]]+)\]\]\?/)||i.params&&i.params[p]?(this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.showAutomations=!0,this.parseAutomationLink(this.href)):(this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null)}const l=function(t,e,i){let s=[];return t.isEmail?s=[]:t.isPhone?s=i.filter(t=>("tel:"===t.type||"sms:"===t.type||"whatsapp:"===t.type)&&t.type!==e):-1!==t.href.indexOf("http://")&&"https:"!==e&&(s=[{type:"https:",text:o.M.get("lang","is_user_wants_https"),reccomanded:!0}]),"anchor:"===e&&(s=[]),s}(i,this.protocol,this.options);let c=i.href;const d=String(i.href||""),h=d.match(/^\[\[([^\]]+)\]\]\?/),m=i.params&&i.params[p];if(h)c=d;else if(m){const t=u,e=[];i.params&&Object.keys(i.params).forEach(s=>{if(!t.includes(s)){const t=i.params[s];e.push(`${s}=${encodeURIComponent(t).replace(/%24/g,"$")}`)}});const s=i.url||"";c=i.protocol?"http:"===i.protocol||"https:"===i.protocol?`${i.protocol}//${s}`:`${i.protocol}${s}`:s,e.length>0&&(c+=`?${e.join("&")}`)}const g=function(t){switch(t){case"mailto:":return"what_the_email_address";case"tel:":return"what_the_phone_number";case"sms:":case"whatsapp:":return"what_the_phone_number_to_send_msg";case"anchor:":return"what_the_anchor_name";case"file:":return"what_the_file_name";default:return"what_the_url_address"}}(this.protocol),b=[...this.options],v=b.findIndex(t=>"http:"===t.type);v>-1&&b.splice(v,1);const x=o.M.get("config","editor","configure","editorProps","automations"),w={url:i,href:this.href,protocol:this.protocol,anchors:this.anchors,body:this.body,subject:this.subject,onChangeLink:this.onChangeLink.bind(this),onBlur:this.onBlur.bind(this),onRequest:this.onRequest,updateBody:t=>{this.body=t},updateSubject:t=>{this.subject=t}},$=null!=c&&""!==c?String(c):"",k=this._urlInputRawValue!==$,A=void 0!==this._lastSyncedMyHref&&$!==this._lastSyncedMyHref,_=this.urlInputFocused&&this._urlInputRawValue&&$&&!A;k&&!_?(this._urlInputRawValue=$,this._lastSyncedMyHref=$):k||(this._lastSyncedMyHref=$);const R=this.urlInputFocused&&void 0!==this._urlInputRawValue?this._urlInputRawValue:c,S={protocol:this.protocol,url:i,autofocus:this.autofocus,inputRef:(0,a.K)(this.inputRef),onChangeLink:this.onChangeLink.bind(this),onBlur:this.onUrlInputBlur.bind(this),onFocus:this.onUrlInputFocus.bind(this),onKeyDown:this.onKeyDown.bind(this),myHref:R};return this.showAutomations?s.qy` <div class="root">${this.renderAutomationsView()}</div>`:s.qy` <div class="root">
|
|
952
|
+
${q=this.label,q?s.qy`<cdtr-title
|
|
953
953
|
style="font-weight: 700;
|
|
954
954
|
font-size: 14.4px;
|
|
955
955
|
margin-bottom: 0.6rem;
|
|
@@ -958,7 +958,7 @@
|
|
|
958
958
|
><cdtr-divider></cdtr-divider
|
|
959
959
|
></cdtr-title>`:null}
|
|
960
960
|
<cdtr-row alignItems="center" justify="space-between" spacing="10">
|
|
961
|
-
${E=this.options,B=this.protocol,M=this.onChangeType.bind(this),
|
|
961
|
+
${E=this.options,B=this.protocol,M=this.onChangeType.bind(this),s.qy`
|
|
962
962
|
<cdtr-dropdown @change=${t=>M(t.target.value)}>
|
|
963
963
|
<cdtr-dropdown-button
|
|
964
964
|
minWidth=${100}
|
|
@@ -969,7 +969,7 @@
|
|
|
969
969
|
></lang-text>
|
|
970
970
|
</cdtr-dropdown-button>
|
|
971
971
|
<div slot="content">
|
|
972
|
-
${E.map(t=>
|
|
972
|
+
${E.map(t=>s.qy`<cdtr-dropdown-item
|
|
973
973
|
.focused=${t.type===B}
|
|
974
974
|
.selected=${t.type===B}
|
|
975
975
|
value="${t.type}"
|
|
@@ -978,7 +978,7 @@
|
|
|
978
978
|
</div>
|
|
979
979
|
</cdtr-dropdown>
|
|
980
980
|
`}
|
|
981
|
-
${L=this.target,U=this.onChangeTarget.bind(this),
|
|
981
|
+
${L=this.target,U=this.onChangeTarget.bind(this),s.qy`
|
|
982
982
|
<cdtr-dropdown @change=${t=>U(t)} style="min-width: 120px;">
|
|
983
983
|
<cdtr-dropdown-button minWidth=${120} class="dropdown-button" slot="trigger">
|
|
984
984
|
<lang-text .text=${L}></lang-text>
|
|
@@ -1001,20 +1001,20 @@
|
|
|
1001
1001
|
`}
|
|
1002
1002
|
</cdtr-row>
|
|
1003
1003
|
<cdtr-row mt="1">
|
|
1004
|
-
${function(t,e){return 0===t.length?null:
|
|
1004
|
+
${function(t,e){return 0===t.length?null:s.qy`${t.map(t=>s.qy`<paper-button
|
|
1005
1005
|
@click=${()=>e(t.type)}
|
|
1006
1006
|
style="background:rgb(233, 237, 243);color:#000;font-size:13px;margin:0;margin-right:5px;"
|
|
1007
1007
|
><lang-text text="${t.text}"></lang-text
|
|
1008
|
-
></paper-button>`)}`}(
|
|
1008
|
+
></paper-button>`)}`}(l,this.onChangeType.bind(this))}
|
|
1009
1009
|
</cdtr-row>
|
|
1010
1010
|
|
|
1011
1011
|
<div class="input-wrapper">
|
|
1012
1012
|
<cdtr-title class="explain-title"
|
|
1013
|
-
><lang-text .text="${
|
|
1013
|
+
><lang-text .text="${g}"></lang-text
|
|
1014
1014
|
></cdtr-title>
|
|
1015
|
-
${function(t){const{protocol:e,url:i,autofocus:s,inputRef:o,onChangeLink:n,onBlur:r,onFocus:a,onKeyDown:l,myHref:c}=t;return"anchor:"===e?null:
|
|
1016
|
-
${
|
|
1017
|
-
${x?
|
|
1015
|
+
${function(t){const{protocol:e,url:i,autofocus:s,inputRef:o,onChangeLink:n,onBlur:r,onFocus:a,onKeyDown:l,myHref:c}=t;return"anchor:"===e?null:y({value:c,inputRef:o,autofocus:s,onChange:n,onBlur:r,onFocus:a,onKeyDown:l})}(S)}
|
|
1016
|
+
${f(this.protocol,w)}
|
|
1017
|
+
${x?s.qy` <cdtr-divider></cdtr-divider>
|
|
1018
1018
|
<cdtr-row justify="flex-start" mt="1">
|
|
1019
1019
|
<cdtr-title class="explain-title"
|
|
1020
1020
|
><lang-text
|
|
@@ -1030,18 +1030,18 @@
|
|
|
1030
1030
|
</paper-button>
|
|
1031
1031
|
<cdtr-divider></cdtr-divider
|
|
1032
1032
|
></cdtr-row>`:null}
|
|
1033
|
-
${function(t,e,i,
|
|
1033
|
+
${function(t,e,i,o){return t&&Array.isArray(t)&&0!==t.length?s.qy`<cdtr-list-picker
|
|
1034
1034
|
.selected=${e}
|
|
1035
|
-
@change=${t=>{i({target:{value:t.target.value}}),
|
|
1035
|
+
@change=${t=>{i({target:{value:t.target.value}}),o()}}
|
|
1036
1036
|
heading="saved_links"
|
|
1037
1037
|
.list=${t}
|
|
1038
1038
|
></cdtr-list-picker>`:null}(t,c,this.onChangeLink.bind(this),this.onBlur.bind(this))}
|
|
1039
1039
|
</div>
|
|
1040
1040
|
|
|
1041
|
-
${C=this.hasButton,I=this.onClickOk.bind(this),C?
|
|
1041
|
+
${C=this.hasButton,I=this.onClickOk.bind(this),C?s.qy`<hr style="margin: 1rem 0; border: none; border-top: 1px solid #e0e0e0;">
|
|
1042
1042
|
<cdtr-row justify="flex-end" mt="1">
|
|
1043
1043
|
<paper-button fullWidth @click=${I} raised class="add-button">
|
|
1044
1044
|
<lang-text text="add_now"></lang-text>
|
|
1045
1045
|
</paper-button>
|
|
1046
1046
|
</cdtr-row>`:null}
|
|
1047
|
-
</div>`;var C,I,L,U,E,B,M,q}}
|
|
1047
|
+
</div>`;var C,I,L,U,E,B,M,q}}x.styles=r,x.properties={href:{type:String,reflect:!0},value:{type:Object},protocol:{type:String},name:{type:String},label:{type:String},target:{type:String},hasButton:{type:Boolean},params:{type:Object},explain:{type:String},anchors:{type:Array},link:{},body:{type:String},subject:{type:String},autofocus:{type:Boolean},onRequest:{type:Function}},customElements.get("cdtr-link-element")||customElements.define("cdtr-link-element",x)},88385(t,e,i){i.d(e,{A:()=>a});const s=t=>!(!t||!t.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)),o=t=>!(!t||!t.replace("-","").match(/^[+]*[(]{0,1}[0-9]{9,9}[)]{0,1}[-\s\./0-9]*$/g)&&!t.match(/[0-9]{3}-[0-9]{3}-[0-9]{4}/));function n(t){const e={},i=/([^&=]+)=?([^&]*)/g,s=t=>{try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ")}},o=t.indexOf("?");let n,r=-1!==o?t.substring(o+1):"";for(;null!==(n=i.exec(r));){const t=s(n[1]),i=s(n[2]);t&&(e[t]=i)}return e}function r(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],encodeURIComponent(e).replace(/%24/g,"$")}class a{static getProtocol(t){if(!t)return"";const e=t.indexOf(":");return e>0?t.slice(0,e):""}constructor(t,e){this.protocol="",this.href="",this.fullHref="",this.target="_self",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.url="",this.isValid=!0,this.params={},"string"==typeof t?this.href=t:t&&"object"==typeof t&&Object.assign(this,t),this.isValid=this.isValidUrl(this.href),this.protocol=e?.protocol??a.getProtocol(this.href);const i=function(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],e}(this.href);if(this.isEmail=s(i),this.isPhone=o(i),this.protocol||(this.isEmail?this.protocol="mailto:":this.isPhone?this.protocol="tel:":this.isValid&&(this.protocol="https:")),this.isAnchor=this.href.startsWith("#"),e?.target){if(!["_blank","_self","_parent","_top"].includes(e.target))throw new Error(`Url: invalid target "${e.target}"`);this.target=e.target}this.params={...this.params,...e?.params,...n(this.href)},this.url=r(this.href),this.protocol&&!this.protocol.endsWith(":")&&(this.protocol+=":");const l="http:"===this.protocol||"https:"===this.protocol;this.href=l?`${this.protocol}//${this.url}`:this.protocol+this.url,this.fullHref=this.getUrlWithParams(),this.href=this.getUrlWithParams()}addParam(t,e){this.href=this.href.replace(new RegExp(`${t}=[^&]*`),`${t}=${e}`),this.params[t]=e}getUrlWithParams(){let t,e="";try{t=decodeURIComponent(this.url)}catch(e){t=this.url}if(Object.keys(this.params).length>0){t+="?",e="?";for(const i in this.params){const s=this.params[i],o=encodeURIComponent(i).replace(/%24/g,"$");if(s){const i=encodeURIComponent(s).replace(/%24/g,"$");t+=`${o}=${i}&`,e+=`${o}=${i}&`}else t+=`${o}&`,e+=`${o}&`}t=t.slice(0,-1)}const i=t=>{try{return decodeURIComponent(t)}catch{return t}};if(this.protocol&&("http:"===this.protocol||"https:"===this.protocol))return i(this.protocol+"//"+t);if("whatsapp:"===this.protocol){const s=this.extractPhoneFromTextUsingRegex(t);return s.length>0?i("https://wa.me/"+s[0]+e):i("https://wa.me/"+e)}return i(this.protocol+t)}extractPhoneFromTextUsingRegex(t){if(!t)return[];const e=[...t.matchAll(/(?:whatsapp:([^?\s]+)|\+?[\d\s\-\(\)\.]{7,20})/g)];return Array.from(new Set(e.map(t=>t[1]||t[0]).filter(t=>{const e=t.replace(/\D/g,"");return e.length>=7&&e.length<=15}).map(t=>t.trim())))}isValidUrl(t){if(!t)return!1;return/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(t)}}a.resetURL=r}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4615],{14615(t,e,i){i.r(e),i.d(e,{UploadIcon:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4615],{14615(t,e,i){i.r(e),i.d(e,{UploadIcon:()=>h});var s=i(59929);class h extends s.WF{constructor(){super(),this.iconStyle="",this.width="24",this.height="24"}render(){return s.qy`<svg
|
|
2
2
|
stroke="currentColor"
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
stroke-width="0"
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
<path
|
|
12
12
|
d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z"
|
|
13
13
|
></path>
|
|
14
|
-
</svg>`}}
|
|
14
|
+
</svg>`}}h.styles=s.AH``,h.properties={iconStyle:{type:String},width:{type:String},height:{type:String}},customElements.define("cdtr-upload-icon",h)}}]);
|
|
Binary file
|