@creaditor/newsletter-starterkit 1.0.57 → 1.0.59

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 (43) hide show
  1. package/dist/1142.creaditor.bundle.js +1 -1
  2. package/dist/1142.creaditor.bundle.js.gz +0 -0
  3. package/dist/1260.creaditor.bundle.js +1 -1
  4. package/dist/1260.creaditor.bundle.js.gz +0 -0
  5. package/dist/1271.creaditor.bundle.js +1 -544
  6. package/dist/1271.creaditor.bundle.js.gz +0 -0
  7. package/dist/1529.creaditor.bundle.js +1 -1
  8. package/dist/1529.creaditor.bundle.js.gz +0 -0
  9. package/dist/170.creaditor.bundle.js +1 -1
  10. package/dist/170.creaditor.bundle.js.gz +0 -0
  11. package/dist/2765.creaditor.bundle.js +1 -1
  12. package/dist/2765.creaditor.bundle.js.gz +0 -0
  13. package/dist/3521.creaditor.bundle.js +1 -1
  14. package/dist/3521.creaditor.bundle.js.gz +0 -0
  15. package/dist/3553.creaditor.bundle.js +1 -1
  16. package/dist/3553.creaditor.bundle.js.gz +0 -0
  17. package/dist/380.creaditor.bundle.js +7 -5
  18. package/dist/380.creaditor.bundle.js.gz +0 -0
  19. package/dist/3847.creaditor.bundle.js +951 -21
  20. package/dist/3847.creaditor.bundle.js.gz +0 -0
  21. package/dist/5909.creaditor.bundle.js +6 -6
  22. package/dist/5909.creaditor.bundle.js.gz +0 -0
  23. package/dist/5926.creaditor.bundle.js +1 -1
  24. package/dist/5926.creaditor.bundle.js.gz +0 -0
  25. package/dist/7238.creaditor.bundle.js +1 -1
  26. package/dist/7238.creaditor.bundle.js.gz +0 -0
  27. package/dist/763.creaditor.bundle.js +15 -1
  28. package/dist/763.creaditor.bundle.js.gz +0 -0
  29. package/dist/7654.creaditor.bundle.js +1 -1
  30. package/dist/7654.creaditor.bundle.js.gz +0 -0
  31. package/dist/8516.creaditor.bundle.js +1 -1
  32. package/dist/8516.creaditor.bundle.js.gz +0 -0
  33. package/dist/8547.creaditor.bundle.js +3 -3
  34. package/dist/8547.creaditor.bundle.js.gz +0 -0
  35. package/dist/9041.creaditor.bundle.js +1 -1
  36. package/dist/9041.creaditor.bundle.js.gz +0 -0
  37. package/dist/9994.creaditor.bundle.js +1 -1
  38. package/dist/9994.creaditor.bundle.js.gz +0 -0
  39. package/dist/creaditor.bundle.js +511 -220
  40. package/dist/creaditor.bundle.js.gz +0 -0
  41. package/dist/service-worker.js +1 -1
  42. package/dist/service-worker.js.gz +0 -0
  43. package/package.json +1 -1
@@ -1,34 +1,964 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3847],{13847:(e,t,s)=>{s.r(t),s.d(t,{ImageSkeleton:()=>r});var i=s(56666),n=s(21293);class r extends n.oi{constructor(){super()}render(){return n.dy` <div class="skeleton-item skeleton-image"></div>`}}(0,i.Z)(r,"styles",n.iv`
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[380,3847],{70380(t,e,i){i.r(e),i.d(e,{default:()=>p});var s=i(59929),o=i(21421),r=i(91597);const n="֑-߿יִ-﷽ﹰ-ﻼ",a="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",l=new RegExp("^[^"+a+"]*["+n+"]"),c=new RegExp("^[^"+n+"]*["+a+"]");var h=i(86319);const d=(0,r.S)();class p 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=h.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"===function(t){const e=String(t||"");return l.test(e)?"rtl":c.test(e)?"ltr":"neutral"}(t)?"right":"")));const e=this.multiline?s.qy` <textarea
2
+ rows=${this.row||4}
3
+ .disabled=${this.disabled}
4
+ dir="auto"
5
+ ${(0,o.K)(this.inputRef)}
6
+ style="${this.inputStyle}"
7
+ .autofocus="${this.autofocus}"
8
+ .placeholder="${t}"
9
+ @input="${this.setValue}"
10
+ @change="${this.setValue}"
11
+ .min="${String(this.min)}"
12
+ .max="${String(this.max)}"
13
+ .step="${String(this.step)}"
14
+ .value="${String(this.value)}"
15
+ />`:s.qy` <input
16
+ .disabled=${this.disabled}
17
+ dir="auto"
18
+ ${(0,o.K)(this.inputRef)}
19
+ style="${this.inputStyle}"
20
+ .autofocus="${this.autofocus}"
21
+ .placeholder="${t}"
22
+ @input="${this.setValue}"
23
+ @change="${this.setValue}"
24
+ .min="${String(this.min)}"
25
+ .type="${this.type}"
26
+ .max="${String(this.max)}"
27
+ .step="${String(this.step)}"
28
+ .value="${String(this.value)}"
29
+ />`;return s.qy`<form @submit=${this.onSubmit}>
30
+ ${e}
31
+ ${!this.icon||this.couchOnEmpty||this.successActive?null:s.qy`<cdtr-icon
32
+ color="#d9d9d9"
33
+ width=${20}
34
+ height=${20}
35
+ style="position: absolute;
36
+ transform: translateY(-50%);top:50%;z-index:1;
37
+ left: 10px;"
38
+ icon="${this.icon}"
39
+ ></cdtr-icon>`}
40
+ ${this.successActive?s.qy`<div class="success-overlay" aria-live="polite">
41
+ <cdtr-couch-mark></cdtr-couch-mark>
42
+ <span class="success-icon">✓</span>
43
+ </div>`:null}
44
+ ${!this.couchOnEmpty||this.value||this.successActive?null:s.qy`<cdtr-couch-mark
45
+ style="position: absolute;
46
+ transform: translateY(-50%);
47
+ left: 0;"
48
+ ></cdtr-couch-mark>`}
49
+ ${"text"===this.type&&this.maxLength?s.qy`<span class="counter"
50
+ >${this.value.length}/${this.maxLength}</span
51
+ > `:null}
52
+ </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)};d.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}}p.styles=s.AH`
2
53
  :host {
3
- display: block;
4
- width: 100%;
5
- height: 100%;
54
+ display: inline-block;
55
+ --cdtr-input-height: 30px;
56
+ --cdtr-input-padding: 0.105rem 0.45rem;
6
57
  }
7
- .skeleton-item {
8
- background: #e8e4f0;
9
- border-radius: 4px;
58
+
59
+ form {
10
60
  position: relative;
11
- overflow: hidden;
61
+ }
62
+ .counter {
63
+ font-size: 10px;
64
+ }
65
+ input,
66
+ textarea {
67
+ height: var(--cdtr-input-height);
68
+ display: inline-block;
12
69
  width: 100%;
13
- height: 100%;
70
+ padding: var(--cdtr-input-padding);
71
+ font-size: 14px;
72
+ font-weight: 400;
73
+ line-height: 1.5;
74
+ color: #212529;
75
+ background: #fff;
76
+ background-clip: padding-box;
77
+ border: 1px solid #ced4da;
78
+ -webkit-appearance: none;
79
+ -moz-appearance: none;
80
+ appearance: none;
81
+ border-radius: 0.25rem;
82
+ transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
83
+ margin: 0;
84
+ font-family: var(--font-family);
85
+ border-color: var(--input-border-color);
86
+ outline: var(--input-border-color);
87
+ box-sizing: border-box;
88
+ }
89
+ textarea {
90
+ height: auto;
91
+ /* Vertical only — horizontal resizing would break out of the sidebar. */
92
+ resize: vertical;
93
+ min-height: 80px;
94
+ }
95
+ input:disabled,
96
+ textrea:disabled,
97
+ textareap[readonly],
98
+ input[readonly] {
99
+ background-color: #e9ecef;
100
+ opacity: 0.5;
101
+ }
102
+ input:hover,
103
+ textarea:hover {
104
+ border-color: black;
105
+ }
106
+ input::placeholder,
107
+ textarea::placeholder {
108
+ font-family: var(--font-family);
109
+ }
110
+ input:focus,
111
+ textarea:focus {
112
+ border-color: var(--primary);
113
+ }
114
+ input[type="number"] {
115
+ padding-right: 0px;
116
+ padding-left: 4px;
117
+ }
118
+
119
+ input[type="number"] {
120
+ -moz-appearance: textfield;
14
121
  }
15
- .skeleton-item::after {
16
- content: "";
122
+
123
+ .success-overlay {
17
124
  position: absolute;
18
- top: 0;
19
- left: 0;
20
- width: 100%;
21
- height: 100%;
22
- background: linear-gradient(90deg, #e8e4f0, #f0ecf8, #e8e4f0);
23
- animation: skeleton-shimmer 1.6s ease-in-out infinite;
125
+ top: 50%;
126
+ left: 4px;
127
+ transform: translateY(-50%);
128
+ width: 28px;
129
+ height: 28px;
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ pointer-events: none;
134
+ z-index: 2;
135
+ }
136
+
137
+ .success-overlay cdtr-couch-mark {
138
+ position: absolute;
139
+ top: 50%;
140
+ left: 50%;
141
+ transform: translate(-50%, -50%) scale(0.75);
142
+ opacity: 0.85;
143
+ }
144
+
145
+ .success-overlay .success-icon {
146
+ position: absolute;
147
+ top: 50%;
148
+ left: 50%;
149
+ width: 20px;
150
+ height: 20px;
151
+ border-radius: 999px;
152
+ display: flex;
153
+ align-items: center;
154
+ justify-content: center;
155
+ background: var(--primary);
156
+ color: #f6fff9;
157
+ font-size: 14px;
158
+ font-weight: 600;
159
+ transform: translate(-50%, -50%) scale(0.85);
160
+ opacity: 0;
161
+ animation: successPop 0.32s ease-out forwards;
162
+ box-shadow: 0 0 6px rgba(79, 192, 111, 0.25);
163
+ }
164
+
165
+ @keyframes successPop {
166
+ 0% {
167
+ transform: translate(-50%, -50%) scale(0.85);
168
+ opacity: 0;
169
+ }
170
+ 50% {
171
+ transform: translate(-50%, -50%) scale(1.05);
172
+ opacity: 1;
173
+ }
174
+ 100% {
175
+ transform: translate(-50%, -50%) scale(1);
176
+ opacity: 1;
177
+ }
24
178
  }
25
179
 
26
- @keyframes skeleton-shimmer {
180
+ @keyframes successGlow {
27
181
  0% {
28
- transform: translate3d(-100%, 0, 0);
182
+ box-shadow: 0 0 6px rgba(79, 192, 111, 0.25);
29
183
  }
30
184
  100% {
31
- transform: translate3d(100%, 0, 0);
185
+ box-shadow: 0 0 10px rgba(79, 192, 111, 0.2);
32
186
  }
33
187
  }
34
- `),(0,i.Z)(r,"properties",{}),customElements.define("cdtr-image-skeleton",r)}}]);
188
+ `,p.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",p)},73847(t,e,i){i.r(e),i.d(e,{LinkElement:()=>C});var s=i(59929),o=i(86319),r=i(88385);const n=s.AH`
189
+ :host {
190
+ --paper-radio-button-checked-color: var(--primary);
191
+ box-sizing: border-box;
192
+ }
193
+ .anchor-dd {
194
+ width: 100%;
195
+ }
196
+ /* The picked anchor's name — a document value, so never text-transformed. */
197
+ .anchor-dd-value {
198
+ font-size: 13px;
199
+ text-transform: none;
200
+ direction: ltr;
201
+ unicode-bidi: isolate;
202
+ }
203
+ .anchor-create {
204
+ width: 100%;
205
+ margin-top: 10px;
206
+ text-align: var(--text-align-locale);
207
+ direction: var(--direction-locale);
208
+ }
209
+ /* Drag source for the anchor element — grabbed by the editor DnD engine. */
210
+ .anchor-drag {
211
+ display: flex;
212
+ align-items: center;
213
+ gap: 8px;
214
+ padding: 10px;
215
+ border: 1px dashed var(--primary, #484553);
216
+ border-radius: 6px;
217
+ background: rgba(0, 0, 0, 0.02);
218
+ color: var(--primary, #484553);
219
+ cursor: grab;
220
+ user-select: none;
221
+ transition: background 0.2s, box-shadow 0.2s;
222
+ }
223
+ .anchor-drag:hover {
224
+ background: rgba(0, 0, 0, 0.05);
225
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
226
+ }
227
+ .anchor-drag:active {
228
+ cursor: grabbing;
229
+ }
230
+ .anchor-drag svg {
231
+ width: 20px;
232
+ height: 20px;
233
+ flex: 0 0 auto;
234
+ pointer-events: none;
235
+ }
236
+ .anchor-drag-label {
237
+ font-size: 13px;
238
+ line-height: 1.3;
239
+ pointer-events: none;
240
+ }
241
+ .anchor-drag-hint {
242
+ display: block;
243
+ margin-top: 6px;
244
+ font-size: 11px;
245
+ line-height: 1.4;
246
+ color: var(--micro-info-color, #00000080);
247
+ }
248
+ cdtr-add-icon {
249
+ --cdtr-icon-width: 16px;
250
+ --cdtr-icon-height: 16px;
251
+ --cdtr-icon-color: var(--dark);
252
+ }
253
+ cdtr-row {
254
+ direction: var(--direction-locale);
255
+ }
256
+ paper-radio-button {
257
+ padding: 0;
258
+ display: flex;
259
+ gap: 5px;
260
+ margin-top: 8px;
261
+ }
262
+ .add-button {
263
+ background: var(--primary);
264
+ color: #fff;
265
+ min-width:0;
266
+ padding:6px;
267
+ width:100%;
268
+ }
269
+ paper-item {
270
+ width: 130px;
271
+ cursor: pointer;
272
+ }
273
+ paper-item:hover {
274
+ color: var(--primary);
275
+ }
276
+ .input-wrapper {
277
+ width: 100%;
278
+ position: relative;
279
+ }
280
+
281
+ paper-button {
282
+ padding: 0.4em;
283
+ color: var(--primary);
284
+ }
285
+ paper-button.indigo {
286
+ background: var(--primary);
287
+ color: white;
288
+ }
289
+
290
+ .input-wrapper cdtr-input {
291
+ display: block;
292
+ }
293
+ .explain-title {
294
+ margin: 20px 0 6px;
295
+ }
296
+ paper-item {
297
+ text-align: var(--text-align-locale);
298
+ direction: var(--direction-locale);
299
+ }
300
+ .link-type-dropdown {
301
+ text-align: var(--text-align-locale);
302
+ direction: var(--direction-locale);
303
+ width: 50%;
304
+ }
305
+ .trigger-wrapper svg {
306
+ width: 20px;
307
+ cursor: pointer;
308
+ fill: var(--dark);
309
+ }
310
+ .trigger-wrapper svg:hover {
311
+ fill: var(--primary);
312
+ }
313
+ .demo-icon {
314
+ position: absolute;
315
+ left: 100%;
316
+ transform: translate(-100%, -50%);
317
+ top: 55%;
318
+ }
319
+ .automations-view {
320
+ width: 100%;
321
+ }
322
+ .automation-card {
323
+ padding: 1rem;
324
+ border: 1px solid #e0e0e0;
325
+ border-radius: 4px;
326
+ margin-bottom: 0.5rem;
327
+ cursor: pointer;
328
+ transition: all 0.2s;
329
+ }
330
+ .automation-card:hover {
331
+ border-color: var(--primary);
332
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
333
+ }
334
+ .automation-card.active {
335
+ border-color: var(--primary);
336
+ background: #e3f2fd;
337
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
338
+ }
339
+ .automation-card.active:hover {
340
+ border-color: var(--primary);
341
+ box-shadow: 0 2px 6px rgba(0,0,0,0.15);
342
+ }
343
+ .automation-details-view {
344
+ width: 100%;
345
+ min-height: 400px;
346
+ display: flex;
347
+ flex-direction: column;
348
+ }
349
+ .automation-content {
350
+ overflow-y: auto;
351
+ flex: 1 1 auto;
352
+ min-height: 0;
353
+ }
354
+ .automation-footer {
355
+ flex: 0 0 auto;
356
+ position: sticky;
357
+ bottom: 0;
358
+ z-index: 10;
359
+ background: #fff;
360
+ }
361
+ .mailing-lists-container {
362
+ max-height: 300px;
363
+ overflow-y: auto;
364
+ }
365
+ .mailing-list-item {
366
+ padding: 0.5rem 0.75rem;
367
+ border-radius: 4px;
368
+ margin-bottom: 0.5rem;
369
+ cursor: pointer;
370
+ transition: all 0.2s;
371
+ }
372
+ .mailing-list-item:hover {
373
+ background: rgba(0, 0, 0, 0.03);
374
+ }
375
+ .action-section {
376
+ margin-bottom: 1.5rem;
377
+ }
378
+ .action-question {
379
+ padding: 0.75rem 0;
380
+ cursor: pointer;
381
+ border-bottom: 1px solid #e0e0e0;
382
+ transition: all 0.2s;
383
+ }
384
+ .action-question:hover {
385
+ border-bottom-color: var(--primary);
386
+ }
387
+ .mailing-lists-list {
388
+ margin-top: 0.75rem;
389
+ padding-left: 1rem;
390
+ }
391
+ `;var a=i(21421);i(73095),i(70380);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"}],h="cdtrAdd",d="cdtrRemove",p="cdtrAutomation",u=[h,d,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}const f="anchor",g="linkpicker:anchor";function y(){const t=new Set;return function(){const t=o.M.get("components");return Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t).filter(t=>t&&"object"==typeof t):[]}().forEach(e=>{const i=e&&e.props;i&&(i.anchor&&i.anchor.name&&t.add(String(i.anchor.name)),e.type===f&&i.name&&t.add(String(i.name)))}),t}let b=null,v=null;const x="cdtr:anchor-attached";function w(){let{onCreated:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$();const e=function(){const t=y();let e=1;for(;t.has(`${f}-${e}`);)e++;return`${f}-${e}`}(),i={id:g,name:f,group:"elements",body:{type:f,props:{name:e,color:"#6b7280"}}},s=document.createElement("div");return s.setAttribute("data-id",g),s.setAttribute("data-group","elements"),s.setAttribute("data-placement",""),s.setAttribute("draggable-element","create:element"),s.setAttribute("draggable-direction","top,bottom,left,right"),s.classList.add("draggable-element-handle"),s.__template=i,window.__dragoned_selected_element=s,b=s,"function"==typeof t&&(v=function(t){let e=!1;const i=i=>{const s=i&&i.detail&&i.detail.name;!e&&s&&(e=!0,o(),v=null,t(s))},s=()=>{setTimeout(()=>{e||(o(),v=null)},0)};function o(){window.removeEventListener(x,i),document.removeEventListener("mouseup",s,!0)}return window.addEventListener(x,i),document.addEventListener("mouseup",s,!0),o}(t)),s}function $(){b&&window.__dragoned_selected_element===b&&delete window.__dragoned_selected_element,b=null,v&&(v(),v=null)}function A(t){let{onRequest:e,onChangeLink:i,onBlur:r}=t;return function(){const t=o.M.get("config","editor","configure","plugins");return!!Array.isArray(t)&&t.some(t=>t&&t.name===f)}()?s.qy`
392
+ <div class="anchor-create">
393
+ <div
394
+ class="anchor-drag draggable-element-handle"
395
+ role="button"
396
+ @mousedown=${()=>w({onCreated:t=>{i({target:{value:`#${t}`},anchor:!0}),r()}})}
397
+ @mouseup=${()=>{$(),"function"==typeof e&&e("anchor")}}
398
+ >
399
+ <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
400
+ <path d="${"M2.05 11H7v2H4.062A8.004 8.004 0 0 0 11 19.938V9.874A4.002 4.002 0 0 1 12 2a4 4 0 0 1 1 7.874v10.064A8.004 8.004 0 0 0 19.938 13H17v-2h4.95c.033.329.05.663.05 1 0 5.523-4.477 10-10 10S2 17.523 2 12c0-.337.017-.671.05-1zM12 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}"></path>
401
+ </svg>
402
+ <span class="anchor-drag-label">
403
+ <lang-text text="drag_anchor_to_canvas"></lang-text>
404
+ </span>
405
+ </div>
406
+ <span class="anchor-drag-hint">
407
+ <lang-text
408
+ whiteSpace="break-spaces"
409
+ text="drag_anchor_hint"
410
+ ></lang-text>
411
+ </span>
412
+ </div>
413
+ `:null}function k(t,e){switch(t){case"anchor:":return function(t){const{url:e,anchors:i,protocol:o,onChangeLink:r,onBlur:n,onRequest:a}=t,l=e.isAnchor?String(e.href||"").replace(/^#/,""):"";return s.qy`
414
+ <cdtr-row alignItems="center" spacing="5">
415
+ <cdtr-dropdown
416
+ @change=${t=>{r({target:{value:"#"+t.target.value},anchor:!0}),n()}}
417
+ .opened=${i.length>0&&"anchor:"===o&&!l}
418
+ class="anchor-dd"
419
+ >
420
+ <cdtr-dropdown-button
421
+ minWidth=${100}
422
+ class=" dropdown-button"
423
+ slot="trigger"
424
+ >
425
+ ${l?s.qy`<span class="anchor-dd-value">${l}</span>`:s.qy`<lang-text
426
+ text=${i.length?"select_anchor":"no_anchors_yet"}
427
+ ></lang-text>`}
428
+ </cdtr-dropdown-button>
429
+ <div style="min-width:150px" slot="content">
430
+ ${i.map(t=>s.qy`<cdtr-dropdown-item
431
+ value="${t.name}"
432
+ .selected=${t.name===l}
433
+ .focused=${t.name===l}
434
+ >${t.name}
435
+ </cdtr-dropdown-item>`)}
436
+ </div>
437
+ </cdtr-dropdown>
438
+ ${A({onRequest:a,onChangeLink:r,onBlur:n})}
439
+ </cdtr-row>
440
+ `}(e);case"mailto:":return function(t){const{href:e,body:i,subject:o,onBlur:r,updateBody:n,updateSubject:a}=t,c="string"==typeof e?m("body",e):i||e.params.body,h="string"==typeof e?m("subject",e):o||e.params.subject;return s.qy`
441
+ <cdtr-row spacing="5">
442
+ <cdtr-title class="explain-title"
443
+ ><lang-text text="add_catchy_subject"></lang-text
444
+ ></cdtr-title>
445
+ <cdtr-input
446
+ inputStyle="height:${"40px"};"
447
+ style="width:${l};"
448
+ @change=${t=>{let{target:e}=t;a(e.value),r()}}
449
+ value=${h||o||""}
450
+ ></cdtr-input>
451
+ <cdtr-title class="explain-title"
452
+ ><lang-text text="email_body_if_needed"></lang-text
453
+ ></cdtr-title>
454
+ <cdtr-input
455
+ .multiline=${!0}
456
+ value="${c||i||""}"
457
+ style="width:${l};"
458
+ @change=${t=>{let{target:e}=t;n(e.value),r()}}
459
+ ></cdtr-input>
460
+ </cdtr-row>
461
+ `}(e);case"sms:":return function(t){const{href:e,body:i,onBlur:o,updateBody:r}=t,n="string"==typeof e?m("body",e):e.params.body;return s.qy`
462
+ <cdtr-row spacing="5">
463
+ <cdtr-title class="explain-title"
464
+ ><lang-text text="sms_body_if_needed"></lang-text
465
+ ></cdtr-title>
466
+ <cdtr-input
467
+ .multiline=${!0}
468
+ value="${n||i||""}"
469
+ style="width:${l};"
470
+ @change=${t=>{let{target:e}=t;r(e.value),o()}}
471
+ ></cdtr-input>
472
+ </cdtr-row>
473
+ `}(e);case"whatsapp:":return function(t){const{href:e,body:i,onBlur:o,updateBody:r}=t,n="string"==typeof e?m("text",e)||m("body",e):e.params&&(e.params.text||e.params.body)||"";return s.qy`
474
+ <cdtr-row spacing="5">
475
+ <cdtr-title class="explain-title"
476
+ ><lang-text text="whatsapp_body_if_needed"></lang-text
477
+ ></cdtr-title>
478
+ <cdtr-input
479
+ .multiline=${!0}
480
+ value="${n||i||""}"
481
+ style="width:${l};"
482
+ @change=${t=>{let{target:e}=t;r(e.value),o()}}
483
+ ></cdtr-input>
484
+ </cdtr-row>
485
+ `}(e);default:return""}}function _(t,e,i,s,o,n){if(!t)return null;const a="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t);return t?"whatsapp:"===e||"whatsapp:"===a.protocol?function(t,e,i,s,o){const n="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t),a=(n.params&&(n.params.phone||function(t){try{const e=/whatsapp:([^?]+)/,i=t.match(e);return i?i[1]:""}catch(t){return""}}(n.fullHref))||m("phone",n.href||"")||n.url||"").replace(/\D+/g,"");if(!a)return null;const l=s||n.params&&(n.params.text||n.params.body)||"",c=l?encodeURIComponent(l):"";let h=`https://wa.me/${a}`;c&&(h+=`?text=${c}`);const d=new r.A(h);return d.target=o||d.target||"_blank",{url:d,params:d.params,protocol:"whatsapp:"}}(t,e,i,s,n):(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=n||a.target||"_blank",{url:a,params:a.params,protocol:a.protocol}):null}function S(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=r.A.getProtocol(t);let o=e;s&&(o=s+":");const n=new r.A({href:t,protocol:o||null});console.log("output",n);const a=(i instanceof r.A?i:new r.A(i)).url!==n.url;return{href:n,protocol:n.protocol,shouldBlur:n.isValid,clearParams:a}}function R(){const t=o.M.get("components"),e=Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t):[],i=function(t){const e=new Map;t.forEach(t=>{const i=t&&(t.id||t._id);i&&e.set(i,t)});const i=t.find(t=>t&&"root"===t.type),s=i&&(i.id||i._id);if(!s)return null;const o=new Set,r=t=>{if(!t||o.has(t))return;o.add(t);const i=e.get(t);i&&[].concat(Array.isArray(i.children)?i.children:[]).concat(Array.isArray(i.elements)?i.elements:[]).forEach(t=>r((t=>t?"string"==typeof t?t:t.id||t.dataset&&t.dataset.id||null:null)(t)))};return r(s),o}(e),s=i?e.filter(t=>t&&i.has(t.id||t._id)):e,r=new Set,n=[],a=(t,e)=>{e&&!r.has(e)&&(r.add(e),n.push({id:t,name:e}))};return s.forEach(t=>{const e=t&&t.props;e&&(e.anchor&&e.anchor.name?a(t.id,e.anchor.name):"anchor"===t.type&&e.name?a(t.id,e.name):e.element_ID&&a(t.id,e.element_ID))}),n}function L(t){const{value:e="",inputRef:i,autofocus:o=!1,onChange:r,onBlur:n,onFocus:c,onKeyDown:h,placeholder:d="",inputStyle:p="",style:u="width:260px;",width:m=l}=t,f=t=>{r&&r(t),n&&n()},g=(()=>{if(null==e||""===e)return"";try{return decodeURI(String(e))||""}catch{return String(e)}})();return s.qy`
486
+ <cdtr-row style="position:relative;" spacing="5">
487
+ <span style="display:none;" aria-hidden="true">${e}</span>
488
+ <cdtr-input
489
+ .couchOnEmpty=${!0}
490
+ ${i?(0,a.K)(i):""}
491
+ style="${u}"
492
+ inputStyle="${p}"
493
+ .autofocus=${o}
494
+ type="search"
495
+ width="${m}"
496
+ placeholder="${d}"
497
+ @input=${t=>{if(t.target.selectionStart!==t.target.value.length)return;const e=t.target.value.trim();/^[^a-zA-Z0-9]+$/.test(e)||r&&r(t)}}
498
+ @change=${f}
499
+ @focus=${c}
500
+ @submit=${h||f}
501
+ .value="${g}"
502
+ ></cdtr-input>
503
+ </cdtr-row>
504
+ `}function U(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 r.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 r.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(`${h}=${this.selectedMailingListsForAdd.join(",")}`),this.selectedMailingListsForRemove.length>0&&t.push(`${d}=${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 n=o.url;let a;if(delete o.url,a=n?new r.A(n):new r.A("https://example.com"),a.params||(a.params={}),o[h]&&(a.params[h]=o[h]),o[d]&&(a.params[d]=o[d]),a.params[p]=i,a.href=t,a.url=n||"",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,n=o?new r.A(o):new r.A("https://example.com");n.params||(n.params={}),s[h]&&(n.params[h]=s[h]),s[d]&&(n.params[d]=s[d]),n.params[p]=e[1],n.href=t,n.url=o||"",this.href=n,this.value=n,this.link=n,this.lastUrl=n,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[h]){const t="string"==typeof e[h]?e[h].split(",").filter(t=>t.trim()):Array.isArray(e[h])?e[h]:[];this.selectedMailingListsForAdd=t}if(e[d]){const t="string"==typeof e[d]?e[d].split(",").filter(t=>t.trim()):Array.isArray(e[d])?e[d]:[];this.selectedMailingListsForRemove=t}}else if(t.params){const e=this.extractBaseUrl(t);if(this.baseUrl=e,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.selectedMailingListsForAdd=e}if(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.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`
505
+ <div class="automations-view">
506
+ <cdtr-row justify="space-between" alignItems="center" mb="1">
507
+ <cdtr-title
508
+ style="font-weight: 700; font-size: 14.4px; color: #000000b0;"
509
+ >
510
+ <lang-text text="automations"></lang-text>
511
+ </cdtr-title>
512
+ <paper-button
513
+ @click=${this.onBackClick}
514
+ style="padding: 0.4em; color: var(--primary); background: none; box-shadow: none;"
515
+ >
516
+ <lang-text text="back"></lang-text>
517
+ </paper-button>
518
+ </cdtr-row>
519
+ <cdtr-divider></cdtr-divider>
520
+ <div class="automations-list" style="margin-top: 1rem;">
521
+ ${this.automations.map(t=>{const e=this.activeAutomationId===t.id;return s.qy`
522
+ <div
523
+ class="automation-card ${e?"active":""}"
524
+ @click=${()=>this.onAutomationClick(t)}
525
+ style="
526
+ padding: 1rem;
527
+ border: 2px solid ${e?"var(--primary)":"#e0e0e0"};
528
+ border-radius: 4px;
529
+ margin-bottom: 0.5rem;
530
+ cursor: pointer;
531
+ transition: all 0.2s;
532
+ background: ${e?"#e3f2fd":"#fff"};
533
+ "
534
+ @mouseenter=${t=>{e||(t.currentTarget.style.borderColor="var(--primary)",t.currentTarget.style.boxShadow="0 2px 4px rgba(0,0,0,0.1)")}}
535
+ @mouseleave=${t=>{e||(t.currentTarget.style.borderColor="#e0e0e0",t.currentTarget.style.boxShadow="none")}}
536
+ >
537
+ <cdtr-row justify="space-between" alignItems="center">
538
+ <cdtr-title
539
+ style="font-size: 14px; color: ${e?"var(--primary)":"#000"}; font-weight: ${e?"600":"400"};"
540
+ >
541
+ <lang-text text="${t.name}"></lang-text>
542
+ </cdtr-title>
543
+ ${e?s.qy`
544
+ <span
545
+ style="color: var(--primary); font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
546
+ >✓</span
547
+ >
548
+ `:null}
549
+ </cdtr-row>
550
+ </div>
551
+ `})}
552
+ <!-- coming soon -->
553
+ <h6 align="center">
554
+ <lang-text whiteSpace="break-spaces" text="coming_soon_automations"></lang-text>
555
+ </h6>
556
+ </div>
557
+ </div>
558
+ `}renderAutomationDetails(){const t=this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0;return s.qy`
559
+ <div
560
+ class="automation-details-view"
561
+ style="display: flex; flex-direction: column; height: 100%;"
562
+ >
563
+ <div style="flex: 0 0 auto;">
564
+ <cdtr-row justify="space-between" alignItems="center" mb="1">
565
+ <cdtr-title
566
+ style="font-weight: 700; font-size: 14.4px; color: #000000b0;"
567
+ >
568
+ <lang-text text="automation_settings"></lang-text>
569
+ </cdtr-title>
570
+ <paper-button
571
+ @click=${this.onBackClick}
572
+ style="padding: 0.4em; color: var(--primary); background: none; box-shadow: none;"
573
+ >
574
+ <lang-text text="back"></lang-text>
575
+ </paper-button>
576
+ </cdtr-row>
577
+ <cdtr-divider></cdtr-divider>
578
+ </div>
579
+
580
+ <div class="automation-content">
581
+ <!-- Success Message -->
582
+ ${this.showSaveSuccess?s.qy`
583
+ <style>
584
+ .save-success-container {
585
+ margin-bottom: 1rem;
586
+ animation: slideDown 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards;
587
+ }
588
+
589
+ .save-success-content {
590
+ display: flex;
591
+ align-items: center;
592
+ gap: 12px;
593
+ background: #e8f5e9;
594
+ border: 1px solid #4caf50;
595
+ color: #2e7d32;
596
+ padding: 12px 16px;
597
+ border-radius: 6px;
598
+ animation: scaleIn 0.3s ease-out;
599
+ }
600
+
601
+ .success-icon {
602
+ display: flex;
603
+ align-items: center;
604
+ justify-content: center;
605
+ width: 20px;
606
+ height: 20px;
607
+ background: #4caf50;
608
+ border-radius: 50%;
609
+ flex-shrink: 0;
610
+ animation: iconBounce 0.5s ease-out 0.2s both;
611
+ }
612
+
613
+ .success-icon svg {
614
+ width: 14px;
615
+ height: 14px;
616
+ color: white;
617
+ }
618
+
619
+ .success-text {
620
+ font-size: 13px;
621
+ font-weight: 500;
622
+ flex: 1;
623
+ }
624
+
625
+ @keyframes slideDown {
626
+ from {
627
+ transform: translateY(-10px);
628
+ opacity: 0;
629
+ }
630
+ to {
631
+ transform: translateY(0);
632
+ opacity: 1;
633
+ }
634
+ }
635
+
636
+ @keyframes fadeOut {
637
+ from {
638
+ opacity: 1;
639
+ transform: translateY(0);
640
+ }
641
+ to {
642
+ opacity: 0;
643
+ transform: translateY(-10px);
644
+ }
645
+ }
646
+
647
+ @keyframes scaleIn {
648
+ from {
649
+ transform: scale(0.95);
650
+ opacity: 0;
651
+ }
652
+ to {
653
+ transform: scale(1);
654
+ opacity: 1;
655
+ }
656
+ }
657
+
658
+ @keyframes iconBounce {
659
+ 0% {
660
+ transform: scale(0);
661
+ opacity: 0;
662
+ }
663
+ 50% {
664
+ transform: scale(1.2);
665
+ }
666
+ 100% {
667
+ transform: scale(1);
668
+ opacity: 1;
669
+ }
670
+ }
671
+ </style>
672
+ <div class="save-success-container">
673
+ <div class="save-success-content">
674
+ <div class="success-icon">
675
+ <svg
676
+ width="24"
677
+ height="24"
678
+ viewBox="0 0 24 24"
679
+ fill="none"
680
+ xmlns="http://www.w3.org/2000/svg"
681
+ >
682
+ <path
683
+ d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"
684
+ fill="currentColor"
685
+ />
686
+ </svg>
687
+ </div>
688
+ <span class="success-text">
689
+ <lang-text text="saved_successfully"></lang-text>
690
+ </span>
691
+ </div>
692
+ </div>
693
+ `:null}
694
+
695
+ <!-- URL Input (Optional) -->
696
+ <div style="margin-bottom: 1.5rem;">
697
+ <cdtr-title
698
+ style="font-size: 13px; color: #666; margin-bottom: 0.5rem; font-weight: 500;"
699
+ >
700
+ <lang-text text="url"></lang-text> (Optional)
701
+ </cdtr-title>
702
+ ${L({value:this.baseUrl||"",onChange:t=>{const e=t.target.value||"",i=S(e,null,this.baseUrl?new r.A(this.baseUrl):{});null===i?this.baseUrl=e:i.href?i.href instanceof r.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%;"})}
703
+ </div>
704
+
705
+ <h6
706
+ class="explain-title"
707
+ style="margin-bottom: 1rem; font-size: 14px; color: #666;"
708
+ >
709
+ <lang-text whiteSpace="break-spaces" text="what_should_happen"></lang-text>
710
+ </h6>
711
+
712
+ <!-- Tabs -->
713
+ <div
714
+ style="margin-bottom: 1.5rem; border-bottom: 1px solid #e0e0e0;"
715
+ >
716
+ <cdtr-row spacing="0">
717
+ <paper-button
718
+ @click=${()=>this.onTabChange("add")}
719
+ style="
720
+ background: ${"add"===this.activeTab?"var(--primary)":"transparent"};
721
+ color: ${"add"===this.activeTab?"#fff":"var(--primary)"};
722
+ padding: 0.6em 1.5em;
723
+ font-size: 14px;
724
+ text-transform: none;
725
+ border-radius: 4px 4px 0 0;
726
+ margin-right: 0.5rem;
727
+ box-shadow: none;
728
+ "
729
+ >
730
+ <lang-text text="add_to_mailing_list_question"></lang-text>
731
+ </paper-button>
732
+ <paper-button
733
+ @click=${()=>this.onTabChange("remove")}
734
+ style="
735
+ background: ${"remove"===this.activeTab?"#f44336":"transparent"};
736
+ color: ${"remove"===this.activeTab?"#fff":"#f44336"};
737
+ padding: 0.6em 1.5em;
738
+ font-size: 14px;
739
+ text-transform: none;
740
+ border-radius: 4px 4px 0 0;
741
+ box-shadow: none;
742
+ "
743
+ >
744
+ <lang-text
745
+ text="remove_from_mailing_list_question"
746
+ ></lang-text>
747
+ </paper-button>
748
+ </cdtr-row>
749
+ </div>
750
+
751
+ <!-- Add to mailing list section -->
752
+ ${"add"===this.activeTab?s.qy`
753
+ <div class="action-section">
754
+ <div class="mailing-lists-list" style="padding-left: 1rem;">
755
+ ${this.mailingLists.map(t=>{const e=this.selectedMailingListsForAdd.includes(t.id);return s.qy`
756
+ <div
757
+ class="mailing-list-item ${e?"selected":""}"
758
+ @click=${()=>this.onMailingListToggle(t.id,"add")}
759
+ style="
760
+ padding: 0.75rem;
761
+ margin-bottom: 0.5rem;
762
+ cursor: pointer;
763
+ border-radius: 4px;
764
+ transition: all 0.2s;
765
+ border: 2px solid ${e?"var(--primary)":"#e0e0e0"};
766
+ background: ${e?"#e3f2fd":"#fff"};
767
+ "
768
+ @mouseenter=${t=>{e||(t.currentTarget.style.borderColor="var(--primary)",t.currentTarget.style.background="#f5f5f5")}}
769
+ @mouseleave=${t=>{e||(t.currentTarget.style.borderColor="#e0e0e0",t.currentTarget.style.background="#fff")}}
770
+ >
771
+ <cdtr-row
772
+ justify="space-between"
773
+ alignItems="center"
774
+ >
775
+ <cdtr-title
776
+ style="font-size: 13px; color: ${e?"var(--primary)":"#333"}; font-weight: ${e?"600":"400"};"
777
+ >
778
+ ${t.name}
779
+ </cdtr-title>
780
+ ${e?s.qy`
781
+ <span
782
+ style="color: var(--primary); font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
783
+ >✓</span
784
+ >
785
+ `:s.qy`
786
+ <span
787
+ style="color: #ddd; font-size: 18px; margin-left: 0.5rem;"
788
+ >○</span
789
+ >
790
+ `}
791
+ </cdtr-row>
792
+ </div>
793
+ `})}
794
+ </div>
795
+ </div>
796
+ `:null}
797
+
798
+ <!-- Remove from mailing list section -->
799
+ ${"remove"===this.activeTab?s.qy`
800
+ <div class="action-section">
801
+ <div class="mailing-lists-list" style="padding-left: 1rem;">
802
+ ${this.mailingLists.map(t=>{const e=this.selectedMailingListsForRemove.includes(t.id);return s.qy`
803
+ <div
804
+ class="mailing-list-item ${e?"selected":""}"
805
+ @click=${()=>this.onMailingListToggle(t.id,"remove")}
806
+ style="
807
+ padding: 0.75rem;
808
+ margin-bottom: 0.5rem;
809
+ cursor: pointer;
810
+ border-radius: 4px;
811
+ transition: all 0.2s;
812
+ border: 2px solid ${e?"#f44336":"#e0e0e0"};
813
+ background: ${e?"#ffebee":"#fff"};
814
+ "
815
+ @mouseenter=${t=>{e||(t.currentTarget.style.borderColor="#f44336",t.currentTarget.style.background="#f5f5f5")}}
816
+ @mouseleave=${t=>{e||(t.currentTarget.style.borderColor="#e0e0e0",t.currentTarget.style.background="#fff")}}
817
+ >
818
+ <cdtr-row
819
+ justify="space-between"
820
+ alignItems="center"
821
+ >
822
+ <cdtr-title
823
+ style="font-size: 13px; color: ${e?"#f44336":"#333"}; font-weight: ${e?"600":"400"};"
824
+ >
825
+ ${t.name}
826
+ </cdtr-title>
827
+ ${e?s.qy`
828
+ <span
829
+ style="color: #f44336; font-weight: bold; font-size: 18px; margin-left: 0.5rem;"
830
+ >✓</span
831
+ >
832
+ `:s.qy`
833
+ <span
834
+ style="color: #ddd; font-size: 18px; margin-left: 0.5rem;"
835
+ >○</span
836
+ >
837
+ `}
838
+ </cdtr-row>
839
+ </div>
840
+ `})}
841
+ </div>
842
+ </div>
843
+ `:null}
844
+ </div>
845
+
846
+ <div
847
+ class="automation-footer"
848
+ style="flex: 0 0 auto; padding: 10px; border-top: 1px solid #e0e0e0; background: #fff;"
849
+ >
850
+ <cdtr-row justify="flex-end">
851
+ <paper-button
852
+ @click=${this.onSaveAutomation}
853
+ ?disabled=${!t}
854
+ style="
855
+ background: ${t?"var(--primary)":"#ccc"};
856
+ color: #fff;
857
+ padding: 0.6em 1.5em;
858
+ font-size: 14px;
859
+ text-transform: none;
860
+ cursor: ${t?"pointer":"not-allowed"};
861
+ "
862
+ >
863
+ <lang-text text="save"></lang-text>
864
+ </paper-button>
865
+ </cdtr-row>
866
+ </div>
867
+ </div>
868
+ `}}}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 C extends(U(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:r,target:n,dispatchEvent:a,event:l}=t;if(!e)return a(l),{dispatched:!0};const c=_(e,i,s,o,r,n);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=S(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=R()}onChangeType(t){const e=function(t,e,i,s){const o=e.find(e=>e.type===t);if(!o)return{forceProtocolChange:!1};const r="anchor"===o.text,n=s!==o.type;return setTimeout(()=>{i&&i.value&&i.value.focus()},500),{protocol:o.type,forceProtocolChange:!0,shouldResolveAnchors:r,clearParams:n}}(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 r.A(this.href,{protocol:this.protocol});t.protocol=this.protocol,this.href=t,this.onBlur()}}connectedCallback(){super.connectedCallback(),this.href=new r.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 r.A(this.href,{protocol:e?null:this.protocol});this.protocol&&!e?i.protocol=this.protocol:i.protocol&&(this.protocol=i.protocol);const n=String(this.href?.href||this.href||"");if(this._lastBodySyncHref!==n){this._lastBodySyncHref=n,i.params?(this.body=i.params.text||i.params.body||"",this.subject=i.params.subject||""):(this.body="",this.subject="");n.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 h=String(i.href||""),d=h.match(/^\[\[([^\]]+)\]\]\?/),m=i.params&&i.params[p];if(d)c=h;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 f=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),g=[...this.options],y=g.findIndex(t=>"http:"===t.type);y>-1&&g.splice(y,1);const b=o.M.get("config","editor","configure","editorProps","automations"),v={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}},x=null!=c&&""!==c?String(c):"",w=this._urlInputRawValue!==x,$=void 0!==this._lastSyncedMyHref&&x!==this._lastSyncedMyHref,A=this.urlInputFocused&&this._urlInputRawValue&&x&&!$;w&&!A?(this._urlInputRawValue=x,this._lastSyncedMyHref=x):w||(this._lastSyncedMyHref=x);const _=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:_};return this.showAutomations?s.qy` <div class="root">${this.renderAutomationsView()}</div>`:s.qy` <div class="root">
869
+ ${F=this.label,F?s.qy`<cdtr-title
870
+ style="font-weight: 700;
871
+ font-size: 14.4px;
872
+ margin-bottom: 0.6rem;
873
+ color: #000000b0;"
874
+ ><lang-text text=${F}></lang-text
875
+ ><cdtr-divider></cdtr-divider
876
+ ></cdtr-title>`:null}
877
+ <cdtr-row alignItems="center" justify="space-between" spacing="10">
878
+ ${I=this.options,q=this.protocol,j=this.onChangeType.bind(this),s.qy`
879
+ <cdtr-dropdown @change=${t=>j(t.target.value)}>
880
+ <cdtr-dropdown-button
881
+ minWidth=${100}
882
+ class=" dropdown-button"
883
+ slot="trigger"
884
+ ><lang-text
885
+ .text="${I.find(t=>t.type===q)?.text||"link"}"
886
+ ></lang-text>
887
+ </cdtr-dropdown-button>
888
+ <div slot="content">
889
+ ${I.map(t=>s.qy`<cdtr-dropdown-item
890
+ .focused=${t.type===q}
891
+ .selected=${t.type===q}
892
+ value="${t.type}"
893
+ ><lang-text text="${t.text}"></lang-text>
894
+ </cdtr-dropdown-item>`)}
895
+ </div>
896
+ </cdtr-dropdown>
897
+ `}
898
+ ${C=this.target,M=this.onChangeTarget.bind(this),s.qy`
899
+ <cdtr-dropdown @change=${t=>M(t)} style="min-width: 120px;">
900
+ <cdtr-dropdown-button minWidth=${120} class="dropdown-button" slot="trigger">
901
+ <lang-text .text=${C}></lang-text>
902
+ </cdtr-dropdown-button>
903
+ <div slot="content">
904
+ <cdtr-dropdown-item value="_blank" .selected=${"_blank"===C}>
905
+ <lang-text text="open_in_new_tab"></lang-text>
906
+ </cdtr-dropdown-item>
907
+ <cdtr-dropdown-item value="_self" .selected=${"_self"===C}>
908
+ <lang-text text="open_in_same_tab"></lang-text>
909
+ </cdtr-dropdown-item>
910
+ <cdtr-dropdown-item value="_parent" .selected=${"_parent"===C}>
911
+ <lang-text text="open_in_parent_frame"></lang-text>
912
+ </cdtr-dropdown-item>
913
+ <cdtr-dropdown-item value="_top" .selected=${"_top"===C}>
914
+ <lang-text text="open_in_top_frame"></lang-text>
915
+ </cdtr-dropdown-item>
916
+ </div>
917
+ </cdtr-dropdown>
918
+ `}
919
+ </cdtr-row>
920
+ <cdtr-row mt="1">
921
+ ${function(t,e){return 0===t.length?null:s.qy`${t.map(t=>s.qy`<paper-button
922
+ @click=${()=>e(t.type)}
923
+ style="background:rgb(233, 237, 243);color:#000;font-size:13px;margin:0;margin-right:5px;"
924
+ ><lang-text text="${t.text}"></lang-text
925
+ ></paper-button>`)}`}(l,this.onChangeType.bind(this))}
926
+ </cdtr-row>
927
+
928
+ <div class="input-wrapper">
929
+ <cdtr-title class="explain-title"
930
+ ><lang-text .text="${f}"></lang-text
931
+ ></cdtr-title>
932
+ ${function(t){const{protocol:e,url:i,autofocus:s,inputRef:o,onChangeLink:r,onBlur:n,onFocus:a,onKeyDown:l,myHref:c}=t;return"anchor:"===e?null:L({value:c,inputRef:o,autofocus:s,onChange:r,onBlur:n,onFocus:a,onKeyDown:l})}(S)}
933
+ ${k(this.protocol,v)}
934
+ ${b?s.qy` <cdtr-divider></cdtr-divider>
935
+ <cdtr-row justify="flex-start" mt="1">
936
+ <cdtr-title class="explain-title"
937
+ ><lang-text
938
+ whiteSpace="break-spaces"
939
+ text="need_automations"
940
+ ></lang-text>
941
+ </cdtr-title>
942
+ <paper-button
943
+ @click=${this.onAutomationsClick.bind(this)}
944
+ style="background:#000;color:#fff;font-size:13px;margin:0;width:100%;"
945
+ >
946
+ <lang-text text="menu_automations"></lang-text>
947
+ </paper-button>
948
+ <cdtr-divider></cdtr-divider
949
+ ></cdtr-row>`:null}
950
+ ${function(t,e,i,o){return t&&Array.isArray(t)&&0!==t.length?s.qy`<cdtr-list-picker
951
+ .selected=${e}
952
+ @change=${t=>{i({target:{value:t.target.value}}),o()}}
953
+ heading="saved_links"
954
+ .list=${t}
955
+ ></cdtr-list-picker>`:null}(t,c,this.onChangeLink.bind(this),this.onBlur.bind(this))}
956
+ </div>
957
+
958
+ ${R=this.hasButton,U=this.onClickOk.bind(this),R?s.qy`<hr style="margin: 1rem 0; border: none; border-top: 1px solid #e0e0e0;">
959
+ <cdtr-row justify="flex-end" mt="1">
960
+ <paper-button fullWidth @click=${U} raised class="add-button">
961
+ <lang-text text="add_now"></lang-text>
962
+ </paper-button>
963
+ </cdtr-row>`:null}
964
+ </div>`;var R,U,C,M,I,q,j,F}}C.styles=n,C.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",C)},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 r(t){const e={},i=/([^&=]+)=?([^&]*)/g,s=t=>{try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ")}},o=t.indexOf("?");let r,n=-1!==o?t.substring(o+1):"";for(;null!==(r=i.exec(n));){const t=s(r[1]),i=s(r[2]);t&&(e[t]=i)}return e}function n(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){if(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),/^\[\[[^\]]+\]\]\?/.test(this.href)){const t=this.href;this.isValid=!1,this.protocol=e?.protocol??"",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.params={...this.params,...e?.params,...r(t)};const i=t.indexOf("?");return this.url=i>-1?t.slice(0,i):t,this.href=t,void(this.fullHref=t)}this.isValid=this.isValidUrl(this.href),this.protocol=e?.protocol||this.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,...r(this.href)},this.url=n(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(),this.isAnchor="anchor:"===this.protocol||this.href.startsWith("#")}addParam(t,e){this.params[t]=e,this.href=this.getUrlWithParams()}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(this.isAnchor||"anchor:"===this.protocol)return t?i(t.startsWith("#")?t:`#${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=n}}]);