@templatical/editor 0.0.1

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.
@@ -0,0 +1,600 @@
1
+ (function(ln,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("@templatical/core"),require("@templatical/types"),require("@templatical/core/cloud")):typeof define=="function"&&define.amd?define(["exports","vue","@templatical/core","@templatical/types","@templatical/core/cloud"],l):(ln=typeof globalThis<"u"?globalThis:ln||self,l(ln.TemplaticalEditor={},ln.Vue,ln.TemplaticalCore,ln.TemplaticalTypes,ln.TemplaticalCoreCloud))})(this,(function(ln,l,Rn,yt,ye){"use strict";function Lc(n,t){return l.getCurrentScope()?(l.onScopeDispose(n,t),!0):!1}const va=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Xb=Object.prototype.toString,Zb=n=>Xb.call(n)==="[object Object]",Ql=()=>{};function Qb(n,t){function e(...o){return new Promise((s,r)=>{Promise.resolve(n(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(s).catch(r)})}return e}function qb(n,t={}){let e,o,s=Ql;const r=c=>{clearTimeout(c),s(),s=Ql};let a;return c=>{const d=l.toValue(n),p=l.toValue(t.maxWait);return e&&r(e),d<=0||p!==void 0&&p<=0?(o&&(r(o),o=void 0),Promise.resolve(c())):new Promise((u,f)=>{s=t.rejectOnCancel?f:u,a=c,p&&!o&&(o=setTimeout(()=>{e&&r(e),o=void 0,u(a())},p)),e=setTimeout(()=>{o&&r(o),o=void 0,u(c())},d)})}}function Fc(n){return Array.isArray(n)?n:[n]}function $b(n,t=200,e={}){return Qb(qb(t,e),n)}function tk(n,t=1e3,e={}){const{immediate:o=!0,immediateCallback:s=!1}=e;let r=null;const a=l.shallowRef(!1);function i(){r&&(clearInterval(r),r=null)}function c(){a.value=!1,i()}function d(){const p=l.toValue(t);p<=0||(a.value=!0,s&&n(),i(),a.value&&(r=setInterval(n,p)))}return o&&va&&d(),(l.isRef(t)||typeof t=="function")&&Lc(l.watch(t,()=>{a.value&&va&&d()})),Lc(c),{isActive:l.shallowReadonly(a),pause:c,resume:d}}function jc(n,t,e={}){const{immediate:o=!0,immediateCallback:s=!1}=e,r=l.shallowRef(!1);let a;function i(){a&&(clearTimeout(a),a=void 0)}function c(){r.value=!1,i()}function d(...p){s&&n(),i(),r.value=!0,a=setTimeout(()=>{r.value=!1,a=void 0,n(...p)},l.toValue(t))}return o&&(r.value=!0,va&&d()),Lc(c),{isPending:l.shallowReadonly(r),start:d,stop:c}}function ek(n=!1,t={}){const{truthyValue:e=!0,falsyValue:o=!1}=t,s=l.isRef(n),r=l.shallowRef(n);function a(i){if(arguments.length)return r.value=i,r.value;{const c=l.toValue(e);return r.value=r.value===c?l.toValue(o):c,r.value}}return s?a:[r,a]}function nk(n,t,e){return l.watch(n,t,{...e,immediate:!0})}const ff=va?window:void 0;function _s(n){var t;const e=l.toValue(n);return(t=e==null?void 0:e.$el)!==null&&t!==void 0?t:e}function Ro(...n){const t=(o,s,r,a)=>(o.addEventListener(s,r,a),()=>o.removeEventListener(s,r,a)),e=l.computed(()=>{const o=Fc(l.toValue(n[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return nk(()=>{var o,s;return[(o=(s=e.value)===null||s===void 0?void 0:s.map(r=>_s(r)))!==null&&o!==void 0?o:[ff].filter(r=>r!=null),Fc(l.toValue(e.value?n[1]:n[0])),Fc(l.unref(e.value?n[2]:n[1])),l.toValue(e.value?n[3]:n[2])]},([o,s,r,a],i,c)=>{if(!(o!=null&&o.length)||!(s!=null&&s.length)||!(r!=null&&r.length))return;const d=Zb(a)?{...a}:a,p=o.flatMap(u=>s.flatMap(f=>r.map(h=>t(u,f,h,d))));c(()=>{p.forEach(u=>u())})},{flush:"post"})}function Hc(n,t,e={}){const{window:o=ff,ignore:s=[],capture:r=!0,detectIframe:a=!1,controls:i=!1}=e;if(!o)return i?{stop:Ql,cancel:Ql,trigger:Ql}:Ql;let c=!0;const d=v=>l.toValue(s).some(y=>{if(typeof y=="string")return Array.from(o.document.querySelectorAll(y)).some(k=>k===v.target||v.composedPath().includes(k));{const k=_s(y);return k&&(v.target===k||v.composedPath().includes(k))}});function p(v){const y=l.toValue(v);return y&&y.$.subTree.shapeFlag===16}function u(v,y){const k=l.toValue(v),S=k.$.subTree&&k.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(b=>b.el===y.target||y.composedPath().includes(b.el))}const f=v=>{const y=_s(n);if(v.target!=null&&!(!(y instanceof Element)&&p(n)&&u(n,v))&&!(!y||y===v.target||v.composedPath().includes(y))){if("detail"in v&&v.detail===0&&(c=!d(v)),!c){c=!0;return}t(v)}};let h=!1;const m=[Ro(o,"click",v=>{h||(h=!0,setTimeout(()=>{h=!1},0),f(v))},{passive:!0,capture:r}),Ro(o,"pointerdown",v=>{const y=_s(n);c=!d(v)&&!!(y&&!v.composedPath().includes(y))},{passive:!0}),a&&Ro(o,"blur",v=>{setTimeout(()=>{var y;const k=_s(n);((y=o.document.activeElement)===null||y===void 0?void 0:y.tagName)==="IFRAME"&&!(k!=null&&k.contains(o.document.activeElement))&&t(v)},0)},{passive:!0})].filter(Boolean),g=()=>m.forEach(v=>v());return i?{stop:g,cancel:()=>{c=!1},trigger:v=>{c=!0,f(v),c=!1}}:g}/**
2
+ * @license lucide-vue-next v0.475.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ok=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
7
+ * @license lucide-vue-next v0.475.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */var ya={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
12
+ * @license lucide-vue-next v0.475.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const lk=({size:n,strokeWidth:t=2,absoluteStrokeWidth:e,color:o,iconNode:s,name:r,class:a,...i},{slots:c})=>l.h("svg",{...ya,width:n||ya.width,height:n||ya.height,stroke:o||ya.stroke,"stroke-width":e?Number(t)*24/Number(n):t,class:["lucide",`lucide-${ok(r??"icon")}`],...i},[...s.map(d=>l.h(...d)),...c.default?[c.default()]:[]]);/**
17
+ * @license lucide-vue-next v0.475.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const tt=(n,t)=>(e,{slots:o})=>l.h(lk,{...e,iconNode:t,name:n},o);/**
22
+ * @license lucide-vue-next v0.475.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Gs=tt("AlignCenterIcon",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/**
27
+ * @license lucide-vue-next v0.475.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Js=tt("AlignLeftIcon",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/**
32
+ * @license lucide-vue-next v0.475.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Ys=tt("AlignRightIcon",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/**
37
+ * @license lucide-vue-next v0.475.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const sk=tt("BoldIcon",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
42
+ * @license lucide-vue-next v0.475.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const rk=tt("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
47
+ * @license lucide-vue-next v0.475.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const ak=tt("BoxIcon",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
52
+ * @license lucide-vue-next v0.475.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const ik=tt("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
57
+ * @license lucide-vue-next v0.475.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const zo=tt("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
62
+ * @license lucide-vue-next v0.475.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const ck=tt("ChevronLeftIcon",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
67
+ * @license lucide-vue-next v0.475.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const dk=tt("ChevronRightIcon",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
72
+ * @license lucide-vue-next v0.475.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const pk=tt("ChevronUpIcon",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
77
+ * @license lucide-vue-next v0.475.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const ml=tt("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
82
+ * @license lucide-vue-next v0.475.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const uk=tt("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
87
+ * @license lucide-vue-next v0.475.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const fk=tt("CircleIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
92
+ * @license lucide-vue-next v0.475.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const hf=tt("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
97
+ * @license lucide-vue-next v0.475.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const Xs=tt("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
102
+ * @license lucide-vue-next v0.475.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const Uc=tt("Columns3Icon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
107
+ * @license lucide-vue-next v0.475.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const mf=tt("CopyIcon",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
112
+ * @license lucide-vue-next v0.475.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const gf=tt("EyeOffIcon",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
117
+ * @license lucide-vue-next v0.475.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const Wc=tt("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
122
+ * @license lucide-vue-next v0.475.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const hk=tt("FileImageIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
127
+ * @license lucide-vue-next v0.475.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const vf=tt("FileTextIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
132
+ * @license lucide-vue-next v0.475.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const mk=tt("FilterIcon",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
137
+ * @license lucide-vue-next v0.475.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const gk=tt("GripVerticalIcon",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
142
+ * @license lucide-vue-next v0.475.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const ba=tt("ImageUpIcon",[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
147
+ * @license lucide-vue-next v0.475.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const gl=tt("ImageIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
152
+ * @license lucide-vue-next v0.475.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const Kc=tt("InfoIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
157
+ * @license lucide-vue-next v0.475.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const vk=tt("ItalicIcon",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
162
+ * @license lucide-vue-next v0.475.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const yk=tt("LayoutTemplateIcon",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
167
+ * @license lucide-vue-next v0.475.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const bk=tt("LinkIcon",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
172
+ * @license lucide-vue-next v0.475.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const kk=tt("ListOrderedIcon",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
177
+ * @license lucide-vue-next v0.475.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const xk=tt("ListIcon",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
182
+ * @license lucide-vue-next v0.475.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const Kn=tt("LoaderCircleIcon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
187
+ * @license lucide-vue-next v0.475.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const wk=tt("LockOpenIcon",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
192
+ * @license lucide-vue-next v0.475.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const co=tt("LockIcon",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
197
+ * @license lucide-vue-next v0.475.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const ka=tt("MessageCircleIcon",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
202
+ * @license lucide-vue-next v0.475.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const po=tt("MinusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
207
+ * @license lucide-vue-next v0.475.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const yf=tt("MonitorIcon",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
212
+ * @license lucide-vue-next v0.475.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const Sk=tt("MoonIcon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
217
+ * @license lucide-vue-next v0.475.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const _c=tt("MoveVerticalIcon",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]]);/**
222
+ * @license lucide-vue-next v0.475.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const xa=tt("NavigationIcon",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
227
+ * @license lucide-vue-next v0.475.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const Gc=tt("PackageIcon",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
232
+ * @license lucide-vue-next v0.475.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const Ek=tt("PanelTopIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]);/**
237
+ * @license lucide-vue-next v0.475.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const bf=tt("PencilIcon",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
242
+ * @license lucide-vue-next v0.475.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const kf=tt("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
247
+ * @license lucide-vue-next v0.475.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const uo=tt("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
252
+ * @license lucide-vue-next v0.475.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const Ck=tt("PuzzleIcon",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
257
+ * @license lucide-vue-next v0.475.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const Jc=tt("RectangleHorizontalIcon",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]);/**
262
+ * @license lucide-vue-next v0.475.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const Tk=tt("Redo2Icon",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
267
+ * @license lucide-vue-next v0.475.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const Yc=tt("RefreshCwIcon",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
272
+ * @license lucide-vue-next v0.475.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const Nk=tt("RemoveFormattingIcon",[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]]);/**
277
+ * @license lucide-vue-next v0.475.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const Mk=tt("ReplyIcon",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
282
+ * @license lucide-vue-next v0.475.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const xf=tt("RotateCcwIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
287
+ * @license lucide-vue-next v0.475.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const Bk=tt("SaveIcon",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
292
+ * @license lucide-vue-next v0.475.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const Zs=tt("ScanLineIcon",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]]);/**
297
+ * @license lucide-vue-next v0.475.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const Ok=tt("SearchIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
302
+ * @license lucide-vue-next v0.475.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const wa=tt("SendIcon",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
307
+ * @license lucide-vue-next v0.475.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const Dk=tt("SettingsIcon",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
312
+ * @license lucide-vue-next v0.475.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const Sa=tt("Share2Icon",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
317
+ * @license lucide-vue-next v0.475.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const Xc=tt("ShieldCheckIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
322
+ * @license lucide-vue-next v0.475.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const Vk=tt("ShieldXIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);/**
327
+ * @license lucide-vue-next v0.475.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const wf=tt("SmartphoneIcon",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
332
+ * @license lucide-vue-next v0.475.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const Ak=tt("SmileIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
337
+ * @license lucide-vue-next v0.475.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const vl=tt("SparklesIcon",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
342
+ * @license lucide-vue-next v0.475.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const Ik=tt("SquarePlusIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
347
+ * @license lucide-vue-next v0.475.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const Rk=tt("SquareIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
352
+ * @license lucide-vue-next v0.475.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const zk=tt("StrikethroughIcon",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
357
+ * @license lucide-vue-next v0.475.0 - ISC
358
+ *
359
+ * This source code is licensed under the ISC license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */const Pk=tt("SubscriptIcon",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]);/**
362
+ * @license lucide-vue-next v0.475.0 - ISC
363
+ *
364
+ * This source code is licensed under the ISC license.
365
+ * See the LICENSE file in the root directory of this source tree.
366
+ */const Lk=tt("SunIcon",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
367
+ * @license lucide-vue-next v0.475.0 - ISC
368
+ *
369
+ * This source code is licensed under the ISC license.
370
+ * See the LICENSE file in the root directory of this source tree.
371
+ */const Fk=tt("SuperscriptIcon",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]);/**
372
+ * @license lucide-vue-next v0.475.0 - ISC
373
+ *
374
+ * This source code is licensed under the ISC license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */const Ea=tt("TableIcon",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
377
+ * @license lucide-vue-next v0.475.0 - ISC
378
+ *
379
+ * This source code is licensed under the ISC license.
380
+ * See the LICENSE file in the root directory of this source tree.
381
+ */const Sf=tt("TabletIcon",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
382
+ * @license lucide-vue-next v0.475.0 - ISC
383
+ *
384
+ * This source code is licensed under the ISC license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */const jk=tt("TimerIcon",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
387
+ * @license lucide-vue-next v0.475.0 - ISC
388
+ *
389
+ * This source code is licensed under the ISC license.
390
+ * See the LICENSE file in the root directory of this source tree.
391
+ */const yl=tt("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
392
+ * @license lucide-vue-next v0.475.0 - ISC
393
+ *
394
+ * This source code is licensed under the ISC license.
395
+ * See the LICENSE file in the root directory of this source tree.
396
+ */const Ef=tt("TriangleAlertIcon",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
397
+ * @license lucide-vue-next v0.475.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */const Zc=tt("TypeIcon",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
402
+ * @license lucide-vue-next v0.475.0 - ISC
403
+ *
404
+ * This source code is licensed under the ISC license.
405
+ * See the LICENSE file in the root directory of this source tree.
406
+ */const Hk=tt("UnderlineIcon",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
407
+ * @license lucide-vue-next v0.475.0 - ISC
408
+ *
409
+ * This source code is licensed under the ISC license.
410
+ * See the LICENSE file in the root directory of this source tree.
411
+ */const Uk=tt("Undo2Icon",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
412
+ * @license lucide-vue-next v0.475.0 - ISC
413
+ *
414
+ * This source code is licensed under the ISC license.
415
+ * See the LICENSE file in the root directory of this source tree.
416
+ */const Wk=tt("UploadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
417
+ * @license lucide-vue-next v0.475.0 - ISC
418
+ *
419
+ * This source code is licensed under the ISC license.
420
+ * See the LICENSE file in the root directory of this source tree.
421
+ */const Cf=tt("VideoIcon",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
422
+ * @license lucide-vue-next v0.475.0 - ISC
423
+ *
424
+ * This source code is licensed under the ISC license.
425
+ * See the LICENSE file in the root directory of this source tree.
426
+ */const Kk=tt("WifiOffIcon",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
427
+ * @license lucide-vue-next v0.475.0 - ISC
428
+ *
429
+ * This source code is licensed under the ISC license.
430
+ * See the LICENSE file in the root directory of this source tree.
431
+ */const _k=tt("WifiIcon",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
432
+ * @license lucide-vue-next v0.475.0 - ISC
433
+ *
434
+ * This source code is licensed under the ISC license.
435
+ * See the LICENSE file in the root directory of this source tree.
436
+ */const hn=tt("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
437
+ * @license lucide-vue-next v0.475.0 - ISC
438
+ *
439
+ * This source code is licensed under the ISC license.
440
+ * See the LICENSE file in the root directory of this source tree.
441
+ */const Gk=tt("ZapIcon",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function jt(n){const t=n??l.inject("translations"),e=l.isRef(t)?t.value:t;function o(s,r){return s.replace(/\{(\w+)\}/g,(a,i)=>i in r?String(r[i]):`{${i}}`)}return{t:e,format:o}}function Jk(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Yk(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var t=n.default;if(typeof t=="function"){var e=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(n).forEach(function(o){var s=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:function(){return n[o]}})}),e}var Ca={exports:{}};/**!
442
+ * Sortable 1.14.0
443
+ * @author RubaXa <trash@rubaxa.org>
444
+ * @author owenm <owen23355@gmail.com>
445
+ * @license MIT
446
+ */function Tf(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),e.push.apply(e,o)}return e}function _n(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Tf(Object(e),!0).forEach(function(o){Xk(n,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):Tf(Object(e)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))})}return n}function Ta(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ta=function(t){return typeof t}:Ta=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(n)}function Xk(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function mn(){return mn=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},mn.apply(this,arguments)}function Zk(n,t){if(n==null)return{};var e={},o=Object.keys(n),s,r;for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&(e[s]=n[s]);return e}function Qk(n,t){if(n==null)return{};var e=Zk(n,t),o,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(n,o)&&(e[o]=n[o])}return e}function qk(n){return $k(n)||tx(n)||ex(n)||nx()}function $k(n){if(Array.isArray(n))return Qc(n)}function tx(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ex(n,t){if(n){if(typeof n=="string")return Qc(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Qc(n,t)}}function Qc(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,o=new Array(t);e<t;e++)o[e]=n[e];return o}function nx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
447
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ox="1.14.0";function fo(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var ho=fo(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Qs=fo(/Edge/i),Nf=fo(/firefox/i),qs=fo(/safari/i)&&!fo(/chrome/i)&&!fo(/android/i),Mf=fo(/iP(ad|od|hone)/i),lx=fo(/chrome/i)&&fo(/android/i),Bf={capture:!1,passive:!1};function Ht(n,t,e){n.addEventListener(t,e,!ho&&Bf)}function Ft(n,t,e){n.removeEventListener(t,e,!ho&&Bf)}function Na(n,t){if(t){if(t[0]===">"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function sx(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function zn(n,t,e,o){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&Na(n,t):Na(n,t))||o&&n===e)return n;if(n===e)break}while(n=sx(n))}return null}var Of=/\s+/g;function te(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var o=(" "+n.className+" ").replace(Of," ").replace(" "+t+" "," ");n.className=(o+(e?" "+t:"")).replace(Of," ")}}function ft(n,t,e){var o=n&&n.style;if(o){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=e+(typeof e=="string"?"":"px")}}function bl(n,t){var e="";if(typeof n=="string")e=n;else do{var o=ft(n,"transform");o&&o!=="none"&&(e=o+" "+e)}while(!t&&(n=n.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(e)}function Df(n,t,e){if(n){var o=n.getElementsByTagName(t),s=0,r=o.length;if(e)for(;s<r;s++)e(o[s],s);return o}return[]}function Gn(){var n=document.scrollingElement;return n||document.documentElement}function Zt(n,t,e,o,s){if(!(!n.getBoundingClientRect&&n!==window)){var r,a,i,c,d,p,u;if(n!==window&&n.parentNode&&n!==Gn()?(r=n.getBoundingClientRect(),a=r.top,i=r.left,c=r.bottom,d=r.right,p=r.height,u=r.width):(a=0,i=0,c=window.innerHeight,d=window.innerWidth,p=window.innerHeight,u=window.innerWidth),(t||e)&&n!==window&&(s=s||n.parentNode,!ho))do if(s&&s.getBoundingClientRect&&(ft(s,"transform")!=="none"||e&&ft(s,"position")!=="static")){var f=s.getBoundingClientRect();a-=f.top+parseInt(ft(s,"border-top-width")),i-=f.left+parseInt(ft(s,"border-left-width")),c=a+r.height,d=i+r.width;break}while(s=s.parentNode);if(o&&n!==window){var h=bl(s||n),m=h&&h.a,g=h&&h.d;h&&(a/=g,i/=m,u/=m,p/=g,c=a+p,d=i+u)}return{top:a,left:i,bottom:c,right:d,width:u,height:p}}}function Vf(n,t,e){for(var o=Po(n,!0),s=Zt(n)[t];o;){var r=Zt(o)[e],a=void 0;if(a=s>=r,!a)return o;if(o===Gn())break;o=Po(o,!1)}return!1}function ql(n,t,e,o){for(var s=0,r=0,a=n.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==kt.ghost&&(o||a[r]!==kt.dragged)&&zn(a[r],e.draggable,n,!1)){if(s===t)return a[r];s++}r++}return null}function qc(n,t){for(var e=n.lastElementChild;e&&(e===kt.ghost||ft(e,"display")==="none"||t&&!Na(e,t));)e=e.previousElementSibling;return e||null}function ne(n,t){var e=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==kt.clone&&(!t||Na(n,t))&&e++;return e}function Af(n){var t=0,e=0,o=Gn();if(n)do{var s=bl(n),r=s.a,a=s.d;t+=n.scrollLeft*r,e+=n.scrollTop*a}while(n!==o&&(n=n.parentNode));return[t,e]}function rx(n,t){for(var e in n)if(n.hasOwnProperty(e)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===n[e][o])return Number(e)}return-1}function Po(n,t){if(!n||!n.getBoundingClientRect)return Gn();var e=n,o=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var s=ft(e);if(e.clientWidth<e.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return Gn();if(o||t)return e;o=!0}}while(e=e.parentNode);return Gn()}function ax(n,t){if(n&&t)for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}function $c(n,t){return Math.round(n.top)===Math.round(t.top)&&Math.round(n.left)===Math.round(t.left)&&Math.round(n.height)===Math.round(t.height)&&Math.round(n.width)===Math.round(t.width)}var $s;function If(n,t){return function(){if(!$s){var e=arguments,o=this;e.length===1?n.call(o,e[0]):n.apply(o,e),$s=setTimeout(function(){$s=void 0},t)}}}function ix(){clearTimeout($s),$s=void 0}function Rf(n,t,e){n.scrollLeft+=t,n.scrollTop+=e}function td(n){var t=window.Polymer,e=window.jQuery||window.Zepto;return t&&t.dom?t.dom(n).cloneNode(!0):e?e(n).clone(!0)[0]:n.cloneNode(!0)}function zf(n,t){ft(n,"position","absolute"),ft(n,"top",t.top),ft(n,"left",t.left),ft(n,"width",t.width),ft(n,"height",t.height)}function ed(n){ft(n,"position",""),ft(n,"top",""),ft(n,"left",""),ft(n,"width",""),ft(n,"height","")}var Ae="Sortable"+new Date().getTime();function cx(){var n=[],t;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(s){if(!(ft(s,"display")==="none"||s===kt.ghost)){n.push({target:s,rect:Zt(s)});var r=_n({},n[n.length-1].rect);if(s.thisAnimationDuration){var a=bl(s,!0);a&&(r.top-=a.f,r.left-=a.e)}s.fromRect=r}})}},addAnimationState:function(o){n.push(o)},removeAnimationState:function(o){n.splice(rx(n,{target:o}),1)},animateAll:function(o){var s=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var r=!1,a=0;n.forEach(function(i){var c=0,d=i.target,p=d.fromRect,u=Zt(d),f=d.prevFromRect,h=d.prevToRect,m=i.rect,g=bl(d,!0);g&&(u.top-=g.f,u.left-=g.e),d.toRect=u,d.thisAnimationDuration&&$c(f,u)&&!$c(p,u)&&(m.top-u.top)/(m.left-u.left)===(p.top-u.top)/(p.left-u.left)&&(c=px(m,f,h,s.options)),$c(u,p)||(d.prevFromRect=p,d.prevToRect=u,c||(c=s.options.animation),s.animate(d,m,u,c)),c&&(r=!0,a=Math.max(a,c),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},c),d.thisAnimationDuration=c)}),clearTimeout(t),r?t=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),n=[]},animate:function(o,s,r,a){if(a){ft(o,"transition",""),ft(o,"transform","");var i=bl(this.el),c=i&&i.a,d=i&&i.d,p=(s.left-r.left)/(c||1),u=(s.top-r.top)/(d||1);o.animatingX=!!p,o.animatingY=!!u,ft(o,"transform","translate3d("+p+"px,"+u+"px,0)"),this.forRepaintDummy=dx(o),ft(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),ft(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){ft(o,"transition",""),ft(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function dx(n){return n.offsetWidth}function px(n,t,e,o){return Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))/Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))*o.animation}var $l=[],nd={initializeByDefault:!0},tr={mount:function(t){for(var e in nd)nd.hasOwnProperty(e)&&!(e in t)&&(t[e]=nd[e]);$l.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),$l.push(t)},pluginEvent:function(t,e,o){var s=this;this.eventCanceled=!1,o.cancel=function(){s.eventCanceled=!0};var r=t+"Global";$l.forEach(function(a){e[a.pluginName]&&(e[a.pluginName][r]&&e[a.pluginName][r](_n({sortable:e},o)),e.options[a.pluginName]&&e[a.pluginName][t]&&e[a.pluginName][t](_n({sortable:e},o)))})},initializePlugins:function(t,e,o,s){$l.forEach(function(i){var c=i.pluginName;if(!(!t.options[c]&&!i.initializeByDefault)){var d=new i(t,e,t.options);d.sortable=t,d.options=t.options,t[c]=d,mn(o,d.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var a=this.modifyOption(t,r,t.options[r]);typeof a<"u"&&(t.options[r]=a)}},getEventProperties:function(t,e){var o={};return $l.forEach(function(s){typeof s.eventProperties=="function"&&mn(o,s.eventProperties.call(e[s.pluginName],t))}),o},modifyOption:function(t,e,o){var s;return $l.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[e]=="function"&&(s=r.optionListeners[e].call(t[r.pluginName],o))}),s}};function er(n){var t=n.sortable,e=n.rootEl,o=n.name,s=n.targetEl,r=n.cloneEl,a=n.toEl,i=n.fromEl,c=n.oldIndex,d=n.newIndex,p=n.oldDraggableIndex,u=n.newDraggableIndex,f=n.originalEvent,h=n.putSortable,m=n.extraEventProperties;if(t=t||e&&e[Ae],!!t){var g,v=t.options,y="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!ho&&!Qs?g=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(o,!0,!0)),g.to=a||e,g.from=i||e,g.item=s||e,g.clone=r,g.oldIndex=c,g.newIndex=d,g.oldDraggableIndex=p,g.newDraggableIndex=u,g.originalEvent=f,g.pullMode=h?h.lastPutMode:void 0;var k=_n(_n({},m),tr.getEventProperties(o,t));for(var S in k)g[S]=k[S];e&&e.dispatchEvent(g),v[y]&&v[y].call(t,g)}}var ux=["evt"],Je=function(t,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.evt,r=Qk(o,ux);tr.pluginEvent.bind(kt)(t,e,_n({dragEl:et,parentEl:oe,ghostEl:Dt,rootEl:Qt,nextEl:kl,lastDownEl:Ma,cloneEl:le,cloneHidden:Lo,dragStarted:or,putSortable:Se,activeSortable:kt.active,originalEvent:s,oldIndex:ts,oldDraggableIndex:nr,newIndex:sn,newDraggableIndex:Fo,hideGhostForTarget:Wf,unhideGhostForTarget:Kf,cloneNowHidden:function(){Lo=!0},cloneNowShown:function(){Lo=!1},dispatchSortableEvent:function(i){je({sortable:e,name:i,originalEvent:s})}},r))};function je(n){er(_n({putSortable:Se,cloneEl:le,targetEl:et,rootEl:Qt,oldIndex:ts,oldDraggableIndex:nr,newIndex:sn,newDraggableIndex:Fo},n))}var et,oe,Dt,Qt,kl,Ma,le,Lo,ts,sn,nr,Fo,Ba,Se,es=!1,Oa=!1,Da=[],xl,Pn,od,ld,Pf,Lf,or,ns,lr,sr=!1,Va=!1,Aa,Ie,sd=[],rd=!1,Ia=[],Ra=typeof document<"u",za=Mf,Ff=Qs||ho?"cssFloat":"float",fx=Ra&&!lx&&!Mf&&"draggable"in document.createElement("div"),jf=(function(){if(Ra){if(ho)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}})(),Hf=function(t,e){var o=ft(t),s=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=ql(t,0,e),a=ql(t,1,e),i=r&&ft(r),c=a&&ft(a),d=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+Zt(r).width,p=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+Zt(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&i.float&&i.float!=="none"){var u=i.float==="left"?"left":"right";return a&&(c.clear==="both"||c.clear===u)?"vertical":"horizontal"}return r&&(i.display==="block"||i.display==="flex"||i.display==="table"||i.display==="grid"||d>=s&&o[Ff]==="none"||a&&o[Ff]==="none"&&d+p>s)?"vertical":"horizontal"},hx=function(t,e,o){var s=o?t.left:t.top,r=o?t.right:t.bottom,a=o?t.width:t.height,i=o?e.left:e.top,c=o?e.right:e.bottom,d=o?e.width:e.height;return s===i||r===c||s+a/2===i+d/2},mx=function(t,e){var o;return Da.some(function(s){var r=s[Ae].options.emptyInsertThreshold;if(!(!r||qc(s))){var a=Zt(s),i=t>=a.left-r&&t<=a.right+r,c=e>=a.top-r&&e<=a.bottom+r;if(i&&c)return o=s}}),o},Uf=function(t){function e(r,a){return function(i,c,d,p){var u=i.options.group.name&&c.options.group.name&&i.options.group.name===c.options.group.name;if(r==null&&(a||u))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return e(r(i,c,d,p),a)(i,c,d,p);var f=(a?i:c).options.group.name;return r===!0||typeof r=="string"&&r===f||r.join&&r.indexOf(f)>-1}}var o={},s=t.group;(!s||Ta(s)!="object")&&(s={name:s}),o.name=s.name,o.checkPull=e(s.pull,!0),o.checkPut=e(s.put),o.revertClone=s.revertClone,t.group=o},Wf=function(){!jf&&Dt&&ft(Dt,"display","none")},Kf=function(){!jf&&Dt&&ft(Dt,"display","")};Ra&&document.addEventListener("click",function(n){if(Oa)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Oa=!1,!1},!0);var wl=function(t){if(et){t=t.touches?t.touches[0]:t;var e=mx(t.clientX,t.clientY);if(e){var o={};for(var s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);o.target=o.rootEl=e,o.preventDefault=void 0,o.stopPropagation=void 0,e[Ae]._onDragOver(o)}}},gx=function(t){et&&et.parentNode[Ae]._isOutsideThisEl(t.target)};function kt(n,t){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=t=mn({},t),n[Ae]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Hf(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,i){a.setData("Text",i.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:kt.supportPointer!==!1&&"PointerEvent"in window&&!qs,emptyInsertThreshold:5};tr.initializePlugins(this,n,e);for(var o in e)!(o in t)&&(t[o]=e[o]);Uf(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:fx,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Ht(n,"pointerdown",this._onTapStart):(Ht(n,"mousedown",this._onTapStart),Ht(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ht(n,"dragover",this),Ht(n,"dragenter",this)),Da.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),mn(this,cx())}kt.prototype={constructor:kt,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ns=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,et):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,o=this.el,s=this.options,r=s.preventOnFilter,a=t.type,i=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,c=(i||t).target,d=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||c,p=s.filter;if(Ex(o),!et&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||s.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&qs&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=zn(c,s.draggable,o,!1),!(c&&c.animated)&&Ma!==c)){if(ts=ne(c),nr=ne(c,s.draggable),typeof p=="function"){if(p.call(this,t,c,this)){je({sortable:e,rootEl:d,name:"filter",targetEl:c,toEl:o,fromEl:o}),Je("filter",e,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(p&&(p=p.split(",").some(function(u){if(u=zn(d,u.trim(),o,!1),u)return je({sortable:e,rootEl:u,name:"filter",targetEl:c,fromEl:o,toEl:o}),Je("filter",e,{evt:t}),!0}),p)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!zn(d,s.handle,o,!1)||this._prepareDragStart(t,i,c)}}},_prepareDragStart:function(t,e,o){var s=this,r=s.el,a=s.options,i=r.ownerDocument,c;if(o&&!et&&o.parentNode===r){var d=Zt(o);if(Qt=r,et=o,oe=et.parentNode,kl=et.nextSibling,Ma=o,Ba=a.group,kt.dragged=et,xl={target:et,clientX:(e||t).clientX,clientY:(e||t).clientY},Pf=xl.clientX-d.left,Lf=xl.clientY-d.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,et.style["will-change"]="all",c=function(){if(Je("delayEnded",s,{evt:t}),kt.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!Nf&&s.nativeDraggable&&(et.draggable=!0),s._triggerDragStart(t,e),je({sortable:s,name:"choose",originalEvent:t}),te(et,a.chosenClass,!0)},a.ignore.split(",").forEach(function(p){Df(et,p.trim(),ad)}),Ht(i,"dragover",wl),Ht(i,"mousemove",wl),Ht(i,"touchmove",wl),Ht(i,"mouseup",s._onDrop),Ht(i,"touchend",s._onDrop),Ht(i,"touchcancel",s._onDrop),Nf&&this.nativeDraggable&&(this.options.touchStartThreshold=4,et.draggable=!0),Je("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Qs||ho))){if(kt.eventCanceled){this._onDrop();return}Ht(i,"mouseup",s._disableDelayedDrag),Ht(i,"touchend",s._disableDelayedDrag),Ht(i,"touchcancel",s._disableDelayedDrag),Ht(i,"mousemove",s._delayedDragTouchMoveHandler),Ht(i,"touchmove",s._delayedDragTouchMoveHandler),a.supportPointer&&Ht(i,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(c,a.delay)}else c()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){et&&ad(et),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Ft(t,"mouseup",this._disableDelayedDrag),Ft(t,"touchend",this._disableDelayedDrag),Ft(t,"touchcancel",this._disableDelayedDrag),Ft(t,"mousemove",this._delayedDragTouchMoveHandler),Ft(t,"touchmove",this._delayedDragTouchMoveHandler),Ft(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?Ht(document,"pointermove",this._onTouchMove):e?Ht(document,"touchmove",this._onTouchMove):Ht(document,"mousemove",this._onTouchMove):(Ht(et,"dragend",this),Ht(Qt,"dragstart",this._onDragStart));try{document.selection?La(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(es=!1,Qt&&et){Je("dragStarted",this,{evt:e}),this.nativeDraggable&&Ht(document,"dragover",gx);var o=this.options;!t&&te(et,o.dragClass,!1),te(et,o.ghostClass,!0),kt.active=this,t&&this._appendGhost(),je({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Pn){this._lastX=Pn.clientX,this._lastY=Pn.clientY,Wf();for(var t=document.elementFromPoint(Pn.clientX,Pn.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Pn.clientX,Pn.clientY),t!==e);)e=t;if(et.parentNode[Ae]._isOutsideThisEl(t),e)do{if(e[Ae]){var o=void 0;if(o=e[Ae]._onDragOver({clientX:Pn.clientX,clientY:Pn.clientY,target:t,rootEl:e}),o&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Kf()}},_onTouchMove:function(t){if(xl){var e=this.options,o=e.fallbackTolerance,s=e.fallbackOffset,r=t.touches?t.touches[0]:t,a=Dt&&bl(Dt,!0),i=Dt&&a&&a.a,c=Dt&&a&&a.d,d=za&&Ie&&Af(Ie),p=(r.clientX-xl.clientX+s.x)/(i||1)+(d?d[0]-sd[0]:0)/(i||1),u=(r.clientY-xl.clientY+s.y)/(c||1)+(d?d[1]-sd[1]:0)/(c||1);if(!kt.active&&!es){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(Dt){a?(a.e+=p-(od||0),a.f+=u-(ld||0)):a={a:1,b:0,c:0,d:1,e:p,f:u};var f="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");ft(Dt,"webkitTransform",f),ft(Dt,"mozTransform",f),ft(Dt,"msTransform",f),ft(Dt,"transform",f),od=p,ld=u,Pn=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Dt){var t=this.options.fallbackOnBody?document.body:Qt,e=Zt(et,!0,za,!0,t),o=this.options;if(za){for(Ie=t;ft(Ie,"position")==="static"&&ft(Ie,"transform")==="none"&&Ie!==document;)Ie=Ie.parentNode;Ie!==document.body&&Ie!==document.documentElement?(Ie===document&&(Ie=Gn()),e.top+=Ie.scrollTop,e.left+=Ie.scrollLeft):Ie=Gn(),sd=Af(Ie)}Dt=et.cloneNode(!0),te(Dt,o.ghostClass,!1),te(Dt,o.fallbackClass,!0),te(Dt,o.dragClass,!0),ft(Dt,"transition",""),ft(Dt,"transform",""),ft(Dt,"box-sizing","border-box"),ft(Dt,"margin",0),ft(Dt,"top",e.top),ft(Dt,"left",e.left),ft(Dt,"width",e.width),ft(Dt,"height",e.height),ft(Dt,"opacity","0.8"),ft(Dt,"position",za?"absolute":"fixed"),ft(Dt,"zIndex","100000"),ft(Dt,"pointerEvents","none"),kt.ghost=Dt,t.appendChild(Dt),ft(Dt,"transform-origin",Pf/parseInt(Dt.style.width)*100+"% "+Lf/parseInt(Dt.style.height)*100+"%")}},_onDragStart:function(t,e){var o=this,s=t.dataTransfer,r=o.options;if(Je("dragStart",this,{evt:t}),kt.eventCanceled){this._onDrop();return}Je("setupClone",this),kt.eventCanceled||(le=td(et),le.draggable=!1,le.style["will-change"]="",this._hideClone(),te(le,this.options.chosenClass,!1),kt.clone=le),o.cloneId=La(function(){Je("clone",o),!kt.eventCanceled&&(o.options.removeCloneOnHide||Qt.insertBefore(le,et),o._hideClone(),je({sortable:o,name:"clone"}))}),!e&&te(et,r.dragClass,!0),e?(Oa=!0,o._loopId=setInterval(o._emulateDragOver,50)):(Ft(document,"mouseup",o._onDrop),Ft(document,"touchend",o._onDrop),Ft(document,"touchcancel",o._onDrop),s&&(s.effectAllowed="move",r.setData&&r.setData.call(o,s,et)),Ht(document,"drop",o),ft(et,"transform","translateZ(0)")),es=!0,o._dragStartId=La(o._dragStarted.bind(o,e,t)),Ht(document,"selectstart",o),or=!0,qs&&ft(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,o=t.target,s,r,a,i=this.options,c=i.group,d=kt.active,p=Ba===c,u=i.sort,f=Se||d,h,m=this,g=!1;if(rd)return;function v(W,lt){Je(W,m,_n({evt:t,isOwner:p,axis:h?"vertical":"horizontal",revert:a,dragRect:s,targetRect:r,canSort:u,fromSortable:f,target:o,completed:k,onMove:function(gt,bt){return Pa(Qt,e,et,s,gt,Zt(gt),t,bt)},changed:S},lt))}function y(){v("dragOverAnimationCapture"),m.captureAnimationState(),m!==f&&f.captureAnimationState()}function k(W){return v("dragOverCompleted",{insertion:W}),W&&(p?d._hideClone():d._showClone(m),m!==f&&(te(et,Se?Se.options.ghostClass:d.options.ghostClass,!1),te(et,i.ghostClass,!0)),Se!==m&&m!==kt.active?Se=m:m===kt.active&&Se&&(Se=null),f===m&&(m._ignoreWhileAnimating=o),m.animateAll(function(){v("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(o===et&&!et.animated||o===e&&!o.animated)&&(ns=null),!i.dragoverBubble&&!t.rootEl&&o!==document&&(et.parentNode[Ae]._isOutsideThisEl(t.target),!W&&wl(t)),!i.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function S(){sn=ne(et),Fo=ne(et,i.draggable),je({sortable:m,name:"change",toEl:e,newIndex:sn,newDraggableIndex:Fo,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=zn(o,i.draggable,e,!0),v("dragOver"),kt.eventCanceled)return g;if(et.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||m._ignoreWhileAnimating===o)return k(!1);if(Oa=!1,d&&!i.disabled&&(p?u||(a=oe!==Qt):Se===this||(this.lastPutMode=Ba.checkPull(this,d,et,t))&&c.checkPut(this,d,et,t))){if(h=this._getDirection(t,o)==="vertical",s=Zt(et),v("dragOverValid"),kt.eventCanceled)return g;if(a)return oe=Qt,y(),this._hideClone(),v("revert"),kt.eventCanceled||(kl?Qt.insertBefore(et,kl):Qt.appendChild(et)),k(!0);var b=qc(e,i.draggable);if(!b||kx(t,h,this)&&!b.animated){if(b===et)return k(!1);if(b&&e===t.target&&(o=b),o&&(r=Zt(o)),Pa(Qt,e,et,s,o,r,t,!!o)!==!1)return y(),e.appendChild(et),oe=e,S(),k(!0)}else if(b&&bx(t,h,this)){var w=ql(e,0,i,!0);if(w===et)return k(!1);if(o=w,r=Zt(o),Pa(Qt,e,et,s,o,r,t,!1)!==!1)return y(),e.insertBefore(et,w),oe=e,S(),k(!0)}else if(o.parentNode===e){r=Zt(o);var x=0,E,B=et.parentNode!==e,C=!hx(et.animated&&et.toRect||s,o.animated&&o.toRect||r,h),D=h?"top":"left",R=Vf(o,"top","top")||Vf(et,"top","top"),N=R?R.scrollTop:void 0;ns!==o&&(E=r[D],sr=!1,Va=!C&&i.invertSwap||B),x=xx(t,o,r,h,C?1:i.swapThreshold,i.invertedSwapThreshold==null?i.swapThreshold:i.invertedSwapThreshold,Va,ns===o);var L;if(x!==0){var z=ne(et);do z-=x,L=oe.children[z];while(L&&(ft(L,"display")==="none"||L===Dt))}if(x===0||L===o)return k(!1);ns=o,lr=x;var P=o.nextElementSibling,U=!1;U=x===1;var O=Pa(Qt,e,et,s,o,r,t,U);if(O!==!1)return(O===1||O===-1)&&(U=O===1),rd=!0,setTimeout(yx,30),y(),U&&!P?e.appendChild(et):o.parentNode.insertBefore(et,U?P:o),R&&Rf(R,0,N-R.scrollTop),oe=et.parentNode,E!==void 0&&!Va&&(Aa=Math.abs(E-Zt(o)[D])),S(),k(!0)}if(e.contains(et))return k(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ft(document,"mousemove",this._onTouchMove),Ft(document,"touchmove",this._onTouchMove),Ft(document,"pointermove",this._onTouchMove),Ft(document,"dragover",wl),Ft(document,"mousemove",wl),Ft(document,"touchmove",wl)},_offUpEvents:function(){var t=this.el.ownerDocument;Ft(t,"mouseup",this._onDrop),Ft(t,"touchend",this._onDrop),Ft(t,"pointerup",this._onDrop),Ft(t,"touchcancel",this._onDrop),Ft(document,"selectstart",this)},_onDrop:function(t){var e=this.el,o=this.options;if(sn=ne(et),Fo=ne(et,o.draggable),Je("drop",this,{evt:t}),oe=et&&et.parentNode,sn=ne(et),Fo=ne(et,o.draggable),kt.eventCanceled){this._nulling();return}es=!1,Va=!1,sr=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),id(this.cloneId),id(this._dragStartId),this.nativeDraggable&&(Ft(document,"drop",this),Ft(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),qs&&ft(document.body,"user-select",""),ft(et,"transform",""),t&&(or&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),Dt&&Dt.parentNode&&Dt.parentNode.removeChild(Dt),(Qt===oe||Se&&Se.lastPutMode!=="clone")&&le&&le.parentNode&&le.parentNode.removeChild(le),et&&(this.nativeDraggable&&Ft(et,"dragend",this),ad(et),et.style["will-change"]="",or&&!es&&te(et,Se?Se.options.ghostClass:this.options.ghostClass,!1),te(et,this.options.chosenClass,!1),je({sortable:this,name:"unchoose",toEl:oe,newIndex:null,newDraggableIndex:null,originalEvent:t}),Qt!==oe?(sn>=0&&(je({rootEl:oe,name:"add",toEl:oe,fromEl:Qt,originalEvent:t}),je({sortable:this,name:"remove",toEl:oe,originalEvent:t}),je({rootEl:oe,name:"sort",toEl:oe,fromEl:Qt,originalEvent:t}),je({sortable:this,name:"sort",toEl:oe,originalEvent:t})),Se&&Se.save()):sn!==ts&&sn>=0&&(je({sortable:this,name:"update",toEl:oe,originalEvent:t}),je({sortable:this,name:"sort",toEl:oe,originalEvent:t})),kt.active&&((sn==null||sn===-1)&&(sn=ts,Fo=nr),je({sortable:this,name:"end",toEl:oe,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Je("nulling",this),Qt=et=oe=Dt=kl=le=Ma=Lo=xl=Pn=or=sn=Fo=ts=nr=ns=lr=Se=Ba=kt.dragged=kt.ghost=kt.clone=kt.active=null,Ia.forEach(function(t){t.checked=!0}),Ia.length=od=ld=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":et&&(this._onDragOver(t),vx(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,o=this.el.children,s=0,r=o.length,a=this.options;s<r;s++)e=o[s],zn(e,a.draggable,this.el,!1)&&t.push(e.getAttribute(a.dataIdAttr)||Sx(e));return t},sort:function(t,e){var o={},s=this.el;this.toArray().forEach(function(r,a){var i=s.children[a];zn(i,this.options.draggable,s,!1)&&(o[r]=i)},this),e&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(s.removeChild(o[r]),s.appendChild(o[r]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return zn(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var o=this.options;if(e===void 0)return o[t];var s=tr.modifyOption(this,t,e);typeof s<"u"?o[t]=s:o[t]=e,t==="group"&&Uf(o)},destroy:function(){Je("destroy",this);var t=this.el;t[Ae]=null,Ft(t,"mousedown",this._onTapStart),Ft(t,"touchstart",this._onTapStart),Ft(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ft(t,"dragover",this),Ft(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Da.splice(Da.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Lo){if(Je("hideClone",this),kt.eventCanceled)return;ft(le,"display","none"),this.options.removeCloneOnHide&&le.parentNode&&le.parentNode.removeChild(le),Lo=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Lo){if(Je("showClone",this),kt.eventCanceled)return;et.parentNode==Qt&&!this.options.group.revertClone?Qt.insertBefore(le,et):kl?Qt.insertBefore(le,kl):Qt.appendChild(le),this.options.group.revertClone&&this.animate(et,le),ft(le,"display",""),Lo=!1}}};function vx(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function Pa(n,t,e,o,s,r,a,i){var c,d=n[Ae],p=d.options.onMove,u;return window.CustomEvent&&!ho&&!Qs?c=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(c=document.createEvent("Event"),c.initEvent("move",!0,!0)),c.to=t,c.from=n,c.dragged=e,c.draggedRect=o,c.related=s||t,c.relatedRect=r||Zt(t),c.willInsertAfter=i,c.originalEvent=a,n.dispatchEvent(c),p&&(u=p.call(d,c,a)),u}function ad(n){n.draggable=!1}function yx(){rd=!1}function bx(n,t,e){var o=Zt(ql(e.el,0,e.options,!0)),s=10;return t?n.clientX<o.left-s||n.clientY<o.top&&n.clientX<o.right:n.clientY<o.top-s||n.clientY<o.bottom&&n.clientX<o.left}function kx(n,t,e){var o=Zt(qc(e.el,e.options.draggable)),s=10;return t?n.clientX>o.right+s||n.clientX<=o.right&&n.clientY>o.bottom&&n.clientX>=o.left:n.clientX>o.right&&n.clientY>o.top||n.clientX<=o.right&&n.clientY>o.bottom+s}function xx(n,t,e,o,s,r,a,i){var c=o?n.clientY:n.clientX,d=o?e.height:e.width,p=o?e.top:e.left,u=o?e.bottom:e.right,f=!1;if(!a){if(i&&Aa<d*s){if(!sr&&(lr===1?c>p+d*r/2:c<u-d*r/2)&&(sr=!0),sr)f=!0;else if(lr===1?c<p+Aa:c>u-Aa)return-lr}else if(c>p+d*(1-s)/2&&c<u-d*(1-s)/2)return wx(t)}return f=f||a,f&&(c<p+d*r/2||c>u-d*r/2)?c>p+d/2?1:-1:0}function wx(n){return ne(et)<ne(n)?1:-1}function Sx(n){for(var t=n.tagName+n.className+n.src+n.href+n.textContent,e=t.length,o=0;e--;)o+=t.charCodeAt(e);return o.toString(36)}function Ex(n){Ia.length=0;for(var t=n.getElementsByTagName("input"),e=t.length;e--;){var o=t[e];o.checked&&Ia.push(o)}}function La(n){return setTimeout(n,0)}function id(n){return clearTimeout(n)}Ra&&Ht(document,"touchmove",function(n){(kt.active||es)&&n.cancelable&&n.preventDefault()}),kt.utils={on:Ht,off:Ft,css:ft,find:Df,is:function(t,e){return!!zn(t,e,t,!1)},extend:ax,throttle:If,closest:zn,toggleClass:te,clone:td,index:ne,nextTick:La,cancelNextTick:id,detectDirection:Hf,getChild:ql},kt.get=function(n){return n[Ae]},kt.mount=function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(kt.utils=_n(_n({},kt.utils),o.utils)),tr.mount(o)})},kt.create=function(n,t){return new kt(n,t)},kt.version=ox;var ie=[],rr,cd,dd=!1,pd,ud,Fa,ar;function Cx(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return n.prototype={dragStarted:function(e){var o=e.originalEvent;this.sortable.nativeDraggable?Ht(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ht(document,"pointermove",this._handleFallbackAutoScroll):o.touches?Ht(document,"touchmove",this._handleFallbackAutoScroll):Ht(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var o=e.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?Ft(document,"dragover",this._handleAutoScroll):(Ft(document,"pointermove",this._handleFallbackAutoScroll),Ft(document,"touchmove",this._handleFallbackAutoScroll),Ft(document,"mousemove",this._handleFallbackAutoScroll)),_f(),ja(),ix()},nulling:function(){Fa=cd=rr=dd=ar=pd=ud=null,ie.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,o){var s=this,r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,i=document.elementFromPoint(r,a);if(Fa=e,o||this.options.forceAutoScrollFallback||Qs||ho||qs){fd(e,this.options,i,o);var c=Po(i,!0);dd&&(!ar||r!==pd||a!==ud)&&(ar&&_f(),ar=setInterval(function(){var d=Po(document.elementFromPoint(r,a),!0);d!==c&&(c=d,ja()),fd(e,s.options,d,o)},10),pd=r,ud=a)}else{if(!this.options.bubbleScroll||Po(i,!0)===Gn()){ja();return}fd(e,this.options,Po(i,!1),!1)}}},mn(n,{pluginName:"scroll",initializeByDefault:!0})}function ja(){ie.forEach(function(n){clearInterval(n.pid)}),ie=[]}function _f(){clearInterval(ar)}var fd=If(function(n,t,e,o){if(t.scroll){var s=(n.touches?n.touches[0]:n).clientX,r=(n.touches?n.touches[0]:n).clientY,a=t.scrollSensitivity,i=t.scrollSpeed,c=Gn(),d=!1,p;cd!==e&&(cd=e,ja(),rr=t.scroll,p=t.scrollFn,rr===!0&&(rr=Po(e,!0)));var u=0,f=rr;do{var h=f,m=Zt(h),g=m.top,v=m.bottom,y=m.left,k=m.right,S=m.width,b=m.height,w=void 0,x=void 0,E=h.scrollWidth,B=h.scrollHeight,C=ft(h),D=h.scrollLeft,R=h.scrollTop;h===c?(w=S<E&&(C.overflowX==="auto"||C.overflowX==="scroll"||C.overflowX==="visible"),x=b<B&&(C.overflowY==="auto"||C.overflowY==="scroll"||C.overflowY==="visible")):(w=S<E&&(C.overflowX==="auto"||C.overflowX==="scroll"),x=b<B&&(C.overflowY==="auto"||C.overflowY==="scroll"));var N=w&&(Math.abs(k-s)<=a&&D+S<E)-(Math.abs(y-s)<=a&&!!D),L=x&&(Math.abs(v-r)<=a&&R+b<B)-(Math.abs(g-r)<=a&&!!R);if(!ie[u])for(var z=0;z<=u;z++)ie[z]||(ie[z]={});(ie[u].vx!=N||ie[u].vy!=L||ie[u].el!==h)&&(ie[u].el=h,ie[u].vx=N,ie[u].vy=L,clearInterval(ie[u].pid),(N!=0||L!=0)&&(d=!0,ie[u].pid=setInterval((function(){o&&this.layer===0&&kt.active._onTouchMove(Fa);var P=ie[this.layer].vy?ie[this.layer].vy*i:0,U=ie[this.layer].vx?ie[this.layer].vx*i:0;typeof p=="function"&&p.call(kt.dragged.parentNode[Ae],U,P,n,Fa,ie[this.layer].el)!=="continue"||Rf(ie[this.layer].el,U,P)}).bind({layer:u}),24))),u++}while(t.bubbleScroll&&f!==c&&(f=Po(f,!1)));dd=d}},30),Gf=function(t){var e=t.originalEvent,o=t.putSortable,s=t.dragEl,r=t.activeSortable,a=t.dispatchSortableEvent,i=t.hideGhostForTarget,c=t.unhideGhostForTarget;if(e){var d=o||r;i();var p=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(p.clientX,p.clientY);c(),d&&!d.el.contains(u)&&(a("spill"),this.onSpill({dragEl:s,putSortable:o}))}};function hd(){}hd.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var s=ql(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(e,s):this.sortable.el.appendChild(e),this.sortable.animateAll(),o&&o.animateAll()},drop:Gf},mn(hd,{pluginName:"revertOnSpill"});function md(){}md.prototype={onSpill:function(t){var e=t.dragEl,o=t.putSortable,s=o||this.sortable;s.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),s.animateAll()},drop:Gf},mn(md,{pluginName:"removeOnSpill"});var gn;function Tx(){function n(){this.defaults={swapClass:"sortable-swap-highlight"}}return n.prototype={dragStart:function(e){var o=e.dragEl;gn=o},dragOverValid:function(e){var o=e.completed,s=e.target,r=e.onMove,a=e.activeSortable,i=e.changed,c=e.cancel;if(a.options.swap){var d=this.sortable.el,p=this.options;if(s&&s!==d){var u=gn;r(s)!==!1?(te(s,p.swapClass,!0),gn=s):gn=null,u&&u!==gn&&te(u,p.swapClass,!1)}i(),o(!0),c()}},drop:function(e){var o=e.activeSortable,s=e.putSortable,r=e.dragEl,a=s||this.sortable,i=this.options;gn&&te(gn,i.swapClass,!1),gn&&(i.swap||s&&s.options.swap)&&r!==gn&&(a.captureAnimationState(),a!==o&&o.captureAnimationState(),Nx(r,gn),a.animateAll(),a!==o&&o.animateAll())},nulling:function(){gn=null}},mn(n,{pluginName:"swap",eventProperties:function(){return{swapItem:gn}}})}function Nx(n,t){var e=n.parentNode,o=t.parentNode,s,r;!e||!o||e.isEqualNode(t)||o.isEqualNode(n)||(s=ne(n),r=ne(t),e.isEqualNode(o)&&s<r&&r++,e.insertBefore(t,e.children[s]),o.insertBefore(n,o.children[r]))}var Tt=[],rn=[],ir,Ln,cr=!1,Ye=!1,ls=!1,Jt,dr,Ha;function Mx(){function n(t){for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this));t.options.supportPointer?Ht(document,"pointerup",this._deselectMultiDrag):(Ht(document,"mouseup",this._deselectMultiDrag),Ht(document,"touchend",this._deselectMultiDrag)),Ht(document,"keydown",this._checkKeyDown),Ht(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(s,r){var a="";Tt.length&&Ln===t?Tt.forEach(function(i,c){a+=(c?", ":"")+i.textContent}):a=r.textContent,s.setData("Text",a)}}}return n.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){var o=e.dragEl;Jt=o},delayEnded:function(){this.isMultiDrag=~Tt.indexOf(Jt)},setupClone:function(e){var o=e.sortable,s=e.cancel;if(this.isMultiDrag){for(var r=0;r<Tt.length;r++)rn.push(td(Tt[r])),rn[r].sortableIndex=Tt[r].sortableIndex,rn[r].draggable=!1,rn[r].style["will-change"]="",te(rn[r],this.options.selectedClass,!1),Tt[r]===Jt&&te(rn[r],this.options.chosenClass,!1);o._hideClone(),s()}},clone:function(e){var o=e.sortable,s=e.rootEl,r=e.dispatchSortableEvent,a=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||Tt.length&&Ln===o&&(Jf(!0,s),r("clone"),a()))},showClone:function(e){var o=e.cloneNowShown,s=e.rootEl,r=e.cancel;this.isMultiDrag&&(Jf(!1,s),rn.forEach(function(a){ft(a,"display","")}),o(),Ha=!1,r())},hideClone:function(e){var o=this;e.sortable;var s=e.cloneNowHidden,r=e.cancel;this.isMultiDrag&&(rn.forEach(function(a){ft(a,"display","none"),o.options.removeCloneOnHide&&a.parentNode&&a.parentNode.removeChild(a)}),s(),Ha=!0,r())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&Ln&&Ln.multiDrag._deselectMultiDrag(),Tt.forEach(function(o){o.sortableIndex=ne(o)}),Tt=Tt.sort(function(o,s){return o.sortableIndex-s.sortableIndex}),ls=!0},dragStarted:function(e){var o=this,s=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(s.captureAnimationState(),this.options.animation)){Tt.forEach(function(a){a!==Jt&&ft(a,"position","absolute")});var r=Zt(Jt,!1,!0,!0);Tt.forEach(function(a){a!==Jt&&zf(a,r)}),Ye=!0,cr=!0}s.animateAll(function(){Ye=!1,cr=!1,o.options.animation&&Tt.forEach(function(a){ed(a)}),o.options.sort&&Ua()})}},dragOver:function(e){var o=e.target,s=e.completed,r=e.cancel;Ye&&~Tt.indexOf(o)&&(s(!1),r())},revert:function(e){var o=e.fromSortable,s=e.rootEl,r=e.sortable,a=e.dragRect;Tt.length>1&&(Tt.forEach(function(i){r.addAnimationState({target:i,rect:Ye?Zt(i):a}),ed(i),i.fromRect=a,o.removeAnimationState(i)}),Ye=!1,Bx(!this.options.removeCloneOnHide,s))},dragOverCompleted:function(e){var o=e.sortable,s=e.isOwner,r=e.insertion,a=e.activeSortable,i=e.parentEl,c=e.putSortable,d=this.options;if(r){if(s&&a._hideClone(),cr=!1,d.animation&&Tt.length>1&&(Ye||!s&&!a.options.sort&&!c)){var p=Zt(Jt,!1,!0,!0);Tt.forEach(function(f){f!==Jt&&(zf(f,p),i.appendChild(f))}),Ye=!0}if(!s)if(Ye||Ua(),Tt.length>1){var u=Ha;a._showClone(o),a.options.animation&&!Ha&&u&&rn.forEach(function(f){a.addAnimationState({target:f,rect:dr}),f.fromRect=dr,f.thisAnimationDuration=null})}else a._showClone(o)}},dragOverAnimationCapture:function(e){var o=e.dragRect,s=e.isOwner,r=e.activeSortable;if(Tt.forEach(function(i){i.thisAnimationDuration=null}),r.options.animation&&!s&&r.multiDrag.isMultiDrag){dr=mn({},o);var a=bl(Jt,!0);dr.top-=a.f,dr.left-=a.e}},dragOverAnimationComplete:function(){Ye&&(Ye=!1,Ua())},drop:function(e){var o=e.originalEvent,s=e.rootEl,r=e.parentEl,a=e.sortable,i=e.dispatchSortableEvent,c=e.oldIndex,d=e.putSortable,p=d||this.sortable;if(o){var u=this.options,f=r.children;if(!ls)if(u.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),te(Jt,u.selectedClass,!~Tt.indexOf(Jt)),~Tt.indexOf(Jt))Tt.splice(Tt.indexOf(Jt),1),ir=null,er({sortable:a,rootEl:s,name:"deselect",targetEl:Jt});else{if(Tt.push(Jt),er({sortable:a,rootEl:s,name:"select",targetEl:Jt}),o.shiftKey&&ir&&a.el.contains(ir)){var h=ne(ir),m=ne(Jt);if(~h&&~m&&h!==m){var g,v;for(m>h?(v=h,g=m):(v=m,g=h+1);v<g;v++)~Tt.indexOf(f[v])||(te(f[v],u.selectedClass,!0),Tt.push(f[v]),er({sortable:a,rootEl:s,name:"select",targetEl:f[v]}))}}else ir=Jt;Ln=p}if(ls&&this.isMultiDrag){if(Ye=!1,(r[Ae].options.sort||r!==s)&&Tt.length>1){var y=Zt(Jt),k=ne(Jt,":not(."+this.options.selectedClass+")");if(!cr&&u.animation&&(Jt.thisAnimationDuration=null),p.captureAnimationState(),!cr&&(u.animation&&(Jt.fromRect=y,Tt.forEach(function(b){if(b.thisAnimationDuration=null,b!==Jt){var w=Ye?Zt(b):y;b.fromRect=w,p.addAnimationState({target:b,rect:w})}})),Ua(),Tt.forEach(function(b){f[k]?r.insertBefore(b,f[k]):r.appendChild(b),k++}),c===ne(Jt))){var S=!1;Tt.forEach(function(b){if(b.sortableIndex!==ne(b)){S=!0;return}}),S&&i("update")}Tt.forEach(function(b){ed(b)}),p.animateAll()}Ln=p}(s===r||d&&d.lastPutMode!=="clone")&&rn.forEach(function(b){b.parentNode&&b.parentNode.removeChild(b)})}},nullingGlobal:function(){this.isMultiDrag=ls=!1,rn.length=0},destroyGlobal:function(){this._deselectMultiDrag(),Ft(document,"pointerup",this._deselectMultiDrag),Ft(document,"mouseup",this._deselectMultiDrag),Ft(document,"touchend",this._deselectMultiDrag),Ft(document,"keydown",this._checkKeyDown),Ft(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof ls<"u"&&ls)&&Ln===this.sortable&&!(e&&zn(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;Tt.length;){var o=Tt[0];te(o,this.options.selectedClass,!1),Tt.shift(),er({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:o})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},mn(n,{pluginName:"multiDrag",utils:{select:function(e){var o=e.parentNode[Ae];!o||!o.options.multiDrag||~Tt.indexOf(e)||(Ln&&Ln!==o&&(Ln.multiDrag._deselectMultiDrag(),Ln=o),te(e,o.options.selectedClass,!0),Tt.push(e))},deselect:function(e){var o=e.parentNode[Ae],s=Tt.indexOf(e);!o||!o.options.multiDrag||!~s||(te(e,o.options.selectedClass,!1),Tt.splice(s,1))}},eventProperties:function(){var e=this,o=[],s=[];return Tt.forEach(function(r){o.push({multiDragElement:r,index:r.sortableIndex});var a;Ye&&r!==Jt?a=-1:Ye?a=ne(r,":not(."+e.options.selectedClass+")"):a=ne(r),s.push({multiDragElement:r,index:a})}),{items:qk(Tt),clones:[].concat(rn),oldIndicies:o,newIndicies:s}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e==="ctrl"?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function Bx(n,t){Tt.forEach(function(e,o){var s=t.children[e.sortableIndex+(n?Number(o):0)];s?t.insertBefore(e,s):t.appendChild(e)})}function Jf(n,t){rn.forEach(function(e,o){var s=t.children[e.sortableIndex+(n?Number(o):0)];s?t.insertBefore(e,s):t.appendChild(e)})}function Ua(){Tt.forEach(function(n){n!==Jt&&n.parentNode&&n.parentNode.removeChild(n)})}kt.mount(new Cx),kt.mount(md,hd);const Ox=Yk(Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:Mx,Sortable:kt,Swap:Tx,default:kt},Symbol.toStringTag,{value:"Module"})));var Dx=Ca.exports,Yf;function Vx(){return Yf||(Yf=1,(function(n,t){(function(o,s){n.exports=s(l,Ox)})(typeof self<"u"?self:Dx,function(e,o){return(function(s){var r={};function a(i){if(r[i])return r[i].exports;var c=r[i]={i,l:!1,exports:{}};return s[i].call(c.exports,c,c.exports,a),c.l=!0,c.exports}return a.m=s,a.c=r,a.d=function(i,c,d){a.o(i,c)||Object.defineProperty(i,c,{enumerable:!0,get:d})},a.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},a.t=function(i,c){if(c&1&&(i=a(i)),c&8||c&4&&typeof i=="object"&&i&&i.__esModule)return i;var d=Object.create(null);if(a.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:i}),c&2&&typeof i!="string")for(var p in i)a.d(d,p,(function(u){return i[u]}).bind(null,p));return d},a.n=function(i){var c=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(c,"a",c),c},a.o=function(i,c){return Object.prototype.hasOwnProperty.call(i,c)},a.p="",a(a.s="fb15")})({"00ee":(function(s,r,a){var i=a("b622"),c=i("toStringTag"),d={};d[c]="z",s.exports=String(d)==="[object z]"}),"0366":(function(s,r,a){var i=a("1c0b");s.exports=function(c,d,p){if(i(c),d===void 0)return c;switch(p){case 0:return function(){return c.call(d)};case 1:return function(u){return c.call(d,u)};case 2:return function(u,f){return c.call(d,u,f)};case 3:return function(u,f,h){return c.call(d,u,f,h)}}return function(){return c.apply(d,arguments)}}}),"057f":(function(s,r,a){var i=a("fc6a"),c=a("241c").f,d={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(f){try{return c(f)}catch{return p.slice()}};s.exports.f=function(h){return p&&d.call(h)=="[object Window]"?u(h):c(i(h))}}),"06cf":(function(s,r,a){var i=a("83ab"),c=a("d1e7"),d=a("5c6c"),p=a("fc6a"),u=a("c04e"),f=a("5135"),h=a("0cfb"),m=Object.getOwnPropertyDescriptor;r.f=i?m:function(v,y){if(v=p(v),y=u(y,!0),h)try{return m(v,y)}catch{}if(f(v,y))return d(!c.f.call(v,y),v[y])}}),"0cfb":(function(s,r,a){var i=a("83ab"),c=a("d039"),d=a("cc12");s.exports=!i&&!c(function(){return Object.defineProperty(d("div"),"a",{get:function(){return 7}}).a!=7})}),"13d5":(function(s,r,a){var i=a("23e7"),c=a("d58f").left,d=a("a640"),p=a("ae40"),u=d("reduce"),f=p("reduce",{1:0});i({target:"Array",proto:!0,forced:!u||!f},{reduce:function(m){return c(this,m,arguments.length,arguments.length>1?arguments[1]:void 0)}})}),"14c3":(function(s,r,a){var i=a("c6b6"),c=a("9263");s.exports=function(d,p){var u=d.exec;if(typeof u=="function"){var f=u.call(d,p);if(typeof f!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return f}if(i(d)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return c.call(d,p)}}),"159b":(function(s,r,a){var i=a("da84"),c=a("fdbc"),d=a("17c2"),p=a("9112");for(var u in c){var f=i[u],h=f&&f.prototype;if(h&&h.forEach!==d)try{p(h,"forEach",d)}catch{h.forEach=d}}}),"17c2":(function(s,r,a){var i=a("b727").forEach,c=a("a640"),d=a("ae40"),p=c("forEach"),u=d("forEach");s.exports=!p||!u?function(h){return i(this,h,arguments.length>1?arguments[1]:void 0)}:[].forEach}),"1be4":(function(s,r,a){var i=a("d066");s.exports=i("document","documentElement")}),"1c0b":(function(s,r){s.exports=function(a){if(typeof a!="function")throw TypeError(String(a)+" is not a function");return a}}),"1c7e":(function(s,r,a){var i=a("b622"),c=i("iterator"),d=!1;try{var p=0,u={next:function(){return{done:!!p++}},return:function(){d=!0}};u[c]=function(){return this},Array.from(u,function(){throw 2})}catch{}s.exports=function(f,h){if(!h&&!d)return!1;var m=!1;try{var g={};g[c]=function(){return{next:function(){return{done:m=!0}}}},f(g)}catch{}return m}}),"1d80":(function(s,r){s.exports=function(a){if(a==null)throw TypeError("Can't call method on "+a);return a}}),"1dde":(function(s,r,a){var i=a("d039"),c=a("b622"),d=a("2d00"),p=c("species");s.exports=function(u){return d>=51||!i(function(){var f=[],h=f.constructor={};return h[p]=function(){return{foo:1}},f[u](Boolean).foo!==1})}}),"23cb":(function(s,r,a){var i=a("a691"),c=Math.max,d=Math.min;s.exports=function(p,u){var f=i(p);return f<0?c(f+u,0):d(f,u)}}),"23e7":(function(s,r,a){var i=a("da84"),c=a("06cf").f,d=a("9112"),p=a("6eeb"),u=a("ce4e"),f=a("e893"),h=a("94ca");s.exports=function(m,g){var v=m.target,y=m.global,k=m.stat,S,b,w,x,E,B;if(y?b=i:k?b=i[v]||u(v,{}):b=(i[v]||{}).prototype,b)for(w in g){if(E=g[w],m.noTargetGet?(B=c(b,w),x=B&&B.value):x=b[w],S=h(y?w:v+(k?".":"#")+w,m.forced),!S&&x!==void 0){if(typeof E==typeof x)continue;f(E,x)}(m.sham||x&&x.sham)&&d(E,"sham",!0),p(b,w,E,m)}}}),"241c":(function(s,r,a){var i=a("ca84"),c=a("7839"),d=c.concat("length","prototype");r.f=Object.getOwnPropertyNames||function(u){return i(u,d)}}),"25f0":(function(s,r,a){var i=a("6eeb"),c=a("825a"),d=a("d039"),p=a("ad6d"),u="toString",f=RegExp.prototype,h=f[u],m=d(function(){return h.call({source:"a",flags:"b"})!="/a/b"}),g=h.name!=u;(m||g)&&i(RegExp.prototype,u,function(){var y=c(this),k=String(y.source),S=y.flags,b=String(S===void 0&&y instanceof RegExp&&!("flags"in f)?p.call(y):S);return"/"+k+"/"+b},{unsafe:!0})}),"2ca0":(function(s,r,a){var i=a("23e7"),c=a("06cf").f,d=a("50c4"),p=a("5a34"),u=a("1d80"),f=a("ab13"),h=a("c430"),m="".startsWith,g=Math.min,v=f("startsWith"),y=!h&&!v&&!!(function(){var k=c(String.prototype,"startsWith");return k&&!k.writable})();i({target:"String",proto:!0,forced:!y&&!v},{startsWith:function(S){var b=String(u(this));p(S);var w=d(g(arguments.length>1?arguments[1]:void 0,b.length)),x=String(S);return m?m.call(b,x,w):b.slice(w,w+x.length)===x}})}),"2d00":(function(s,r,a){var i=a("da84"),c=a("342f"),d=i.process,p=d&&d.versions,u=p&&p.v8,f,h;u?(f=u.split("."),h=f[0]+f[1]):c&&(f=c.match(/Edge\/(\d+)/),(!f||f[1]>=74)&&(f=c.match(/Chrome\/(\d+)/),f&&(h=f[1]))),s.exports=h&&+h}),"342f":(function(s,r,a){var i=a("d066");s.exports=i("navigator","userAgent")||""}),"35a1":(function(s,r,a){var i=a("f5df"),c=a("3f8c"),d=a("b622"),p=d("iterator");s.exports=function(u){if(u!=null)return u[p]||u["@@iterator"]||c[i(u)]}}),"37e8":(function(s,r,a){var i=a("83ab"),c=a("9bf2"),d=a("825a"),p=a("df75");s.exports=i?Object.defineProperties:function(f,h){d(f);for(var m=p(h),g=m.length,v=0,y;g>v;)c.f(f,y=m[v++],h[y]);return f}}),"3bbe":(function(s,r,a){var i=a("861d");s.exports=function(c){if(!i(c)&&c!==null)throw TypeError("Can't set "+String(c)+" as a prototype");return c}}),"3ca3":(function(s,r,a){var i=a("6547").charAt,c=a("69f3"),d=a("7dd0"),p="String Iterator",u=c.set,f=c.getterFor(p);d(String,"String",function(h){u(this,{type:p,string:String(h),index:0})},function(){var m=f(this),g=m.string,v=m.index,y;return v>=g.length?{value:void 0,done:!0}:(y=i(g,v),m.index+=y.length,{value:y,done:!1})})}),"3f8c":(function(s,r){s.exports={}}),4160:(function(s,r,a){var i=a("23e7"),c=a("17c2");i({target:"Array",proto:!0,forced:[].forEach!=c},{forEach:c})}),"428f":(function(s,r,a){var i=a("da84");s.exports=i}),"44ad":(function(s,r,a){var i=a("d039"),c=a("c6b6"),d="".split;s.exports=i(function(){return!Object("z").propertyIsEnumerable(0)})?function(p){return c(p)=="String"?d.call(p,""):Object(p)}:Object}),"44d2":(function(s,r,a){var i=a("b622"),c=a("7c73"),d=a("9bf2"),p=i("unscopables"),u=Array.prototype;u[p]==null&&d.f(u,p,{configurable:!0,value:c(null)}),s.exports=function(f){u[p][f]=!0}}),"44e7":(function(s,r,a){var i=a("861d"),c=a("c6b6"),d=a("b622"),p=d("match");s.exports=function(u){var f;return i(u)&&((f=u[p])!==void 0?!!f:c(u)=="RegExp")}}),4930:(function(s,r,a){var i=a("d039");s.exports=!!Object.getOwnPropertySymbols&&!i(function(){return!String(Symbol())})}),"4d64":(function(s,r,a){var i=a("fc6a"),c=a("50c4"),d=a("23cb"),p=function(u){return function(f,h,m){var g=i(f),v=c(g.length),y=d(m,v),k;if(u&&h!=h){for(;v>y;)if(k=g[y++],k!=k)return!0}else for(;v>y;y++)if((u||y in g)&&g[y]===h)return u||y||0;return!u&&-1}};s.exports={includes:p(!0),indexOf:p(!1)}}),"4de4":(function(s,r,a){var i=a("23e7"),c=a("b727").filter,d=a("1dde"),p=a("ae40"),u=d("filter"),f=p("filter");i({target:"Array",proto:!0,forced:!u||!f},{filter:function(m){return c(this,m,arguments.length>1?arguments[1]:void 0)}})}),"4df4":(function(s,r,a){var i=a("0366"),c=a("7b0b"),d=a("9bdd"),p=a("e95a"),u=a("50c4"),f=a("8418"),h=a("35a1");s.exports=function(g){var v=c(g),y=typeof this=="function"?this:Array,k=arguments.length,S=k>1?arguments[1]:void 0,b=S!==void 0,w=h(v),x=0,E,B,C,D,R,N;if(b&&(S=i(S,k>2?arguments[2]:void 0,2)),w!=null&&!(y==Array&&p(w)))for(D=w.call(v),R=D.next,B=new y;!(C=R.call(D)).done;x++)N=b?d(D,S,[C.value,x],!0):C.value,f(B,x,N);else for(E=u(v.length),B=new y(E);E>x;x++)N=b?S(v[x],x):v[x],f(B,x,N);return B.length=x,B}}),"4fad":(function(s,r,a){var i=a("23e7"),c=a("6f53").entries;i({target:"Object",stat:!0},{entries:function(p){return c(p)}})}),"50c4":(function(s,r,a){var i=a("a691"),c=Math.min;s.exports=function(d){return d>0?c(i(d),9007199254740991):0}}),5135:(function(s,r){var a={}.hasOwnProperty;s.exports=function(i,c){return a.call(i,c)}}),5319:(function(s,r,a){var i=a("d784"),c=a("825a"),d=a("7b0b"),p=a("50c4"),u=a("a691"),f=a("1d80"),h=a("8aa5"),m=a("14c3"),g=Math.max,v=Math.min,y=Math.floor,k=/\$([$&'`]|\d\d?|<[^>]*>)/g,S=/\$([$&'`]|\d\d?)/g,b=function(w){return w===void 0?w:String(w)};i("replace",2,function(w,x,E,B){var C=B.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,D=B.REPLACE_KEEPS_$0,R=C?"$":"$0";return[function(z,P){var U=f(this),O=z==null?void 0:z[w];return O!==void 0?O.call(z,U,P):x.call(String(U),z,P)},function(L,z){if(!C&&D||typeof z=="string"&&z.indexOf(R)===-1){var P=E(x,L,this,z);if(P.done)return P.value}var U=c(L),O=String(this),W=typeof z=="function";W||(z=String(z));var lt=U.global;if(lt){var ht=U.unicode;U.lastIndex=0}for(var gt=[];;){var bt=m(U,O);if(bt===null||(gt.push(bt),!lt))break;var Pt=String(bt[0]);Pt===""&&(U.lastIndex=h(O,p(U.lastIndex),ht))}for(var Ct="",Nt=0,St=0;St<gt.length;St++){bt=gt[St];for(var xt=String(bt[0]),K=g(v(u(bt.index),O.length),0),nt=[],F=1;F<bt.length;F++)nt.push(b(bt[F]));var T=bt.groups;if(W){var Y=[xt].concat(nt,K,O);T!==void 0&&Y.push(T);var Bt=String(z.apply(void 0,Y))}else Bt=N(xt,O,K,nt,T,z);K>=Nt&&(Ct+=O.slice(Nt,K)+Bt,Nt=K+xt.length)}return Ct+O.slice(Nt)}];function N(L,z,P,U,O,W){var lt=P+L.length,ht=U.length,gt=S;return O!==void 0&&(O=d(O),gt=k),x.call(W,gt,function(bt,Pt){var Ct;switch(Pt.charAt(0)){case"$":return"$";case"&":return L;case"`":return z.slice(0,P);case"'":return z.slice(lt);case"<":Ct=O[Pt.slice(1,-1)];break;default:var Nt=+Pt;if(Nt===0)return bt;if(Nt>ht){var St=y(Nt/10);return St===0?bt:St<=ht?U[St-1]===void 0?Pt.charAt(1):U[St-1]+Pt.charAt(1):bt}Ct=U[Nt-1]}return Ct===void 0?"":Ct})}})}),5692:(function(s,r,a){var i=a("c430"),c=a("c6cd");(s.exports=function(d,p){return c[d]||(c[d]=p!==void 0?p:{})})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})}),"56ef":(function(s,r,a){var i=a("d066"),c=a("241c"),d=a("7418"),p=a("825a");s.exports=i("Reflect","ownKeys")||function(f){var h=c.f(p(f)),m=d.f;return m?h.concat(m(f)):h}}),"5a34":(function(s,r,a){var i=a("44e7");s.exports=function(c){if(i(c))throw TypeError("The method doesn't accept regular expressions");return c}}),"5c6c":(function(s,r){s.exports=function(a,i){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:i}}}),"5db7":(function(s,r,a){var i=a("23e7"),c=a("a2bf"),d=a("7b0b"),p=a("50c4"),u=a("1c0b"),f=a("65f0");i({target:"Array",proto:!0},{flatMap:function(m){var g=d(this),v=p(g.length),y;return u(m),y=f(g,0),y.length=c(y,g,g,v,0,1,m,arguments.length>1?arguments[1]:void 0),y}})}),6547:(function(s,r,a){var i=a("a691"),c=a("1d80"),d=function(p){return function(u,f){var h=String(c(u)),m=i(f),g=h.length,v,y;return m<0||m>=g?p?"":void 0:(v=h.charCodeAt(m),v<55296||v>56319||m+1===g||(y=h.charCodeAt(m+1))<56320||y>57343?p?h.charAt(m):v:p?h.slice(m,m+2):(v-55296<<10)+(y-56320)+65536)}};s.exports={codeAt:d(!1),charAt:d(!0)}}),"65f0":(function(s,r,a){var i=a("861d"),c=a("e8b5"),d=a("b622"),p=d("species");s.exports=function(u,f){var h;return c(u)&&(h=u.constructor,typeof h=="function"&&(h===Array||c(h.prototype))?h=void 0:i(h)&&(h=h[p],h===null&&(h=void 0))),new(h===void 0?Array:h)(f===0?0:f)}}),"69f3":(function(s,r,a){var i=a("7f9a"),c=a("da84"),d=a("861d"),p=a("9112"),u=a("5135"),f=a("f772"),h=a("d012"),m=c.WeakMap,g,v,y,k=function(C){return y(C)?v(C):g(C,{})},S=function(C){return function(D){var R;if(!d(D)||(R=v(D)).type!==C)throw TypeError("Incompatible receiver, "+C+" required");return R}};if(i){var b=new m,w=b.get,x=b.has,E=b.set;g=function(C,D){return E.call(b,C,D),D},v=function(C){return w.call(b,C)||{}},y=function(C){return x.call(b,C)}}else{var B=f("state");h[B]=!0,g=function(C,D){return p(C,B,D),D},v=function(C){return u(C,B)?C[B]:{}},y=function(C){return u(C,B)}}s.exports={set:g,get:v,has:y,enforce:k,getterFor:S}}),"6eeb":(function(s,r,a){var i=a("da84"),c=a("9112"),d=a("5135"),p=a("ce4e"),u=a("8925"),f=a("69f3"),h=f.get,m=f.enforce,g=String(String).split("String");(s.exports=function(v,y,k,S){var b=S?!!S.unsafe:!1,w=S?!!S.enumerable:!1,x=S?!!S.noTargetGet:!1;if(typeof k=="function"&&(typeof y=="string"&&!d(k,"name")&&c(k,"name",y),m(k).source=g.join(typeof y=="string"?y:"")),v===i){w?v[y]=k:p(y,k);return}else b?!x&&v[y]&&(w=!0):delete v[y];w?v[y]=k:c(v,y,k)})(Function.prototype,"toString",function(){return typeof this=="function"&&h(this).source||u(this)})}),"6f53":(function(s,r,a){var i=a("83ab"),c=a("df75"),d=a("fc6a"),p=a("d1e7").f,u=function(f){return function(h){for(var m=d(h),g=c(m),v=g.length,y=0,k=[],S;v>y;)S=g[y++],(!i||p.call(m,S))&&k.push(f?[S,m[S]]:m[S]);return k}};s.exports={entries:u(!0),values:u(!1)}}),"73d9":(function(s,r,a){var i=a("44d2");i("flatMap")}),7418:(function(s,r){r.f=Object.getOwnPropertySymbols}),"746f":(function(s,r,a){var i=a("428f"),c=a("5135"),d=a("e538"),p=a("9bf2").f;s.exports=function(u){var f=i.Symbol||(i.Symbol={});c(f,u)||p(f,u,{value:d.f(u)})}}),7839:(function(s,r){s.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),"7b0b":(function(s,r,a){var i=a("1d80");s.exports=function(c){return Object(i(c))}}),"7c73":(function(s,r,a){var i=a("825a"),c=a("37e8"),d=a("7839"),p=a("d012"),u=a("1be4"),f=a("cc12"),h=a("f772"),m=">",g="<",v="prototype",y="script",k=h("IE_PROTO"),S=function(){},b=function(C){return g+y+m+C+g+"/"+y+m},w=function(C){C.write(b("")),C.close();var D=C.parentWindow.Object;return C=null,D},x=function(){var C=f("iframe"),D="java"+y+":",R;return C.style.display="none",u.appendChild(C),C.src=String(D),R=C.contentWindow.document,R.open(),R.write(b("document.F=Object")),R.close(),R.F},E,B=function(){try{E=document.domain&&new ActiveXObject("htmlfile")}catch{}B=E?w(E):x();for(var C=d.length;C--;)delete B[v][d[C]];return B()};p[k]=!0,s.exports=Object.create||function(D,R){var N;return D!==null?(S[v]=i(D),N=new S,S[v]=null,N[k]=D):N=B(),R===void 0?N:c(N,R)}}),"7dd0":(function(s,r,a){var i=a("23e7"),c=a("9ed3"),d=a("e163"),p=a("d2bb"),u=a("d44e"),f=a("9112"),h=a("6eeb"),m=a("b622"),g=a("c430"),v=a("3f8c"),y=a("ae93"),k=y.IteratorPrototype,S=y.BUGGY_SAFARI_ITERATORS,b=m("iterator"),w="keys",x="values",E="entries",B=function(){return this};s.exports=function(C,D,R,N,L,z,P){c(R,D,N);var U=function(St){if(St===L&&gt)return gt;if(!S&&St in lt)return lt[St];switch(St){case w:return function(){return new R(this,St)};case x:return function(){return new R(this,St)};case E:return function(){return new R(this,St)}}return function(){return new R(this)}},O=D+" Iterator",W=!1,lt=C.prototype,ht=lt[b]||lt["@@iterator"]||L&&lt[L],gt=!S&&ht||U(L),bt=D=="Array"&&lt.entries||ht,Pt,Ct,Nt;if(bt&&(Pt=d(bt.call(new C)),k!==Object.prototype&&Pt.next&&(!g&&d(Pt)!==k&&(p?p(Pt,k):typeof Pt[b]!="function"&&f(Pt,b,B)),u(Pt,O,!0,!0),g&&(v[O]=B))),L==x&&ht&&ht.name!==x&&(W=!0,gt=function(){return ht.call(this)}),(!g||P)&&lt[b]!==gt&&f(lt,b,gt),v[D]=gt,L)if(Ct={values:U(x),keys:z?gt:U(w),entries:U(E)},P)for(Nt in Ct)(S||W||!(Nt in lt))&&h(lt,Nt,Ct[Nt]);else i({target:D,proto:!0,forced:S||W},Ct);return Ct}}),"7f9a":(function(s,r,a){var i=a("da84"),c=a("8925"),d=i.WeakMap;s.exports=typeof d=="function"&&/native code/.test(c(d))}),"825a":(function(s,r,a){var i=a("861d");s.exports=function(c){if(!i(c))throw TypeError(String(c)+" is not an object");return c}}),"83ab":(function(s,r,a){var i=a("d039");s.exports=!i(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})}),8418:(function(s,r,a){var i=a("c04e"),c=a("9bf2"),d=a("5c6c");s.exports=function(p,u,f){var h=i(u);h in p?c.f(p,h,d(0,f)):p[h]=f}}),"861d":(function(s,r){s.exports=function(a){return typeof a=="object"?a!==null:typeof a=="function"}}),8875:(function(s,r,a){var i,c,d;(function(p,u){c=[],i=u,d=typeof i=="function"?i.apply(r,c):i,d!==void 0&&(s.exports=d)})(typeof self<"u"?self:this,function(){function p(){var u=Object.getOwnPropertyDescriptor(document,"currentScript");if(!u&&"currentScript"in document&&document.currentScript||u&&u.get!==p&&document.currentScript)return document.currentScript;try{throw new Error}catch(E){var f=/.*at [^(]*\((.*):(.+):(.+)\)$/ig,h=/@([^@]*):(\d+):(\d+)\s*$/ig,m=f.exec(E.stack)||h.exec(E.stack),g=m&&m[1]||!1,v=m&&m[2]||!1,y=document.location.href.replace(document.location.hash,""),k,S,b,w=document.getElementsByTagName("script");g===y&&(k=document.documentElement.outerHTML,S=new RegExp("(?:[^\\n]+?\\n){0,"+(v-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),b=k.replace(S,"$1").trim());for(var x=0;x<w.length;x++)if(w[x].readyState==="interactive"||w[x].src===g||g===y&&w[x].innerHTML&&w[x].innerHTML.trim()===b)return w[x];return null}}return p})}),8925:(function(s,r,a){var i=a("c6cd"),c=Function.toString;typeof i.inspectSource!="function"&&(i.inspectSource=function(d){return c.call(d)}),s.exports=i.inspectSource}),"8aa5":(function(s,r,a){var i=a("6547").charAt;s.exports=function(c,d,p){return d+(p?i(c,d).length:1)}}),"8bbf":(function(s,r){s.exports=e}),"90e3":(function(s,r){var a=0,i=Math.random();s.exports=function(c){return"Symbol("+String(c===void 0?"":c)+")_"+(++a+i).toString(36)}}),9112:(function(s,r,a){var i=a("83ab"),c=a("9bf2"),d=a("5c6c");s.exports=i?function(p,u,f){return c.f(p,u,d(1,f))}:function(p,u,f){return p[u]=f,p}}),9263:(function(s,r,a){var i=a("ad6d"),c=a("9f7f"),d=RegExp.prototype.exec,p=String.prototype.replace,u=d,f=(function(){var v=/a/,y=/b*/g;return d.call(v,"a"),d.call(y,"a"),v.lastIndex!==0||y.lastIndex!==0})(),h=c.UNSUPPORTED_Y||c.BROKEN_CARET,m=/()??/.exec("")[1]!==void 0,g=f||m||h;g&&(u=function(y){var k=this,S,b,w,x,E=h&&k.sticky,B=i.call(k),C=k.source,D=0,R=y;return E&&(B=B.replace("y",""),B.indexOf("g")===-1&&(B+="g"),R=String(y).slice(k.lastIndex),k.lastIndex>0&&(!k.multiline||k.multiline&&y[k.lastIndex-1]!==`
448
+ `)&&(C="(?: "+C+")",R=" "+R,D++),b=new RegExp("^(?:"+C+")",B)),m&&(b=new RegExp("^"+C+"$(?!\\s)",B)),f&&(S=k.lastIndex),w=d.call(E?b:k,R),E?w?(w.input=w.input.slice(D),w[0]=w[0].slice(D),w.index=k.lastIndex,k.lastIndex+=w[0].length):k.lastIndex=0:f&&w&&(k.lastIndex=k.global?w.index+w[0].length:S),m&&w&&w.length>1&&p.call(w[0],b,function(){for(x=1;x<arguments.length-2;x++)arguments[x]===void 0&&(w[x]=void 0)}),w}),s.exports=u}),"94ca":(function(s,r,a){var i=a("d039"),c=/#|\.prototype\./,d=function(m,g){var v=u[p(m)];return v==h?!0:v==f?!1:typeof g=="function"?i(g):!!g},p=d.normalize=function(m){return String(m).replace(c,".").toLowerCase()},u=d.data={},f=d.NATIVE="N",h=d.POLYFILL="P";s.exports=d}),"99af":(function(s,r,a){var i=a("23e7"),c=a("d039"),d=a("e8b5"),p=a("861d"),u=a("7b0b"),f=a("50c4"),h=a("8418"),m=a("65f0"),g=a("1dde"),v=a("b622"),y=a("2d00"),k=v("isConcatSpreadable"),S=9007199254740991,b="Maximum allowed index exceeded",w=y>=51||!c(function(){var C=[];return C[k]=!1,C.concat()[0]!==C}),x=g("concat"),E=function(C){if(!p(C))return!1;var D=C[k];return D!==void 0?!!D:d(C)},B=!w||!x;i({target:"Array",proto:!0,forced:B},{concat:function(D){var R=u(this),N=m(R,0),L=0,z,P,U,O,W;for(z=-1,U=arguments.length;z<U;z++)if(W=z===-1?R:arguments[z],E(W)){if(O=f(W.length),L+O>S)throw TypeError(b);for(P=0;P<O;P++,L++)P in W&&h(N,L,W[P])}else{if(L>=S)throw TypeError(b);h(N,L++,W)}return N.length=L,N}})}),"9bdd":(function(s,r,a){var i=a("825a");s.exports=function(c,d,p,u){try{return u?d(i(p)[0],p[1]):d(p)}catch(h){var f=c.return;throw f!==void 0&&i(f.call(c)),h}}}),"9bf2":(function(s,r,a){var i=a("83ab"),c=a("0cfb"),d=a("825a"),p=a("c04e"),u=Object.defineProperty;r.f=i?u:function(h,m,g){if(d(h),m=p(m,!0),d(g),c)try{return u(h,m,g)}catch{}if("get"in g||"set"in g)throw TypeError("Accessors not supported");return"value"in g&&(h[m]=g.value),h}}),"9ed3":(function(s,r,a){var i=a("ae93").IteratorPrototype,c=a("7c73"),d=a("5c6c"),p=a("d44e"),u=a("3f8c"),f=function(){return this};s.exports=function(h,m,g){var v=m+" Iterator";return h.prototype=c(i,{next:d(1,g)}),p(h,v,!1,!0),u[v]=f,h}}),"9f7f":(function(s,r,a){var i=a("d039");function c(d,p){return RegExp(d,p)}r.UNSUPPORTED_Y=i(function(){var d=c("a","y");return d.lastIndex=2,d.exec("abcd")!=null}),r.BROKEN_CARET=i(function(){var d=c("^r","gy");return d.lastIndex=2,d.exec("str")!=null})}),a2bf:(function(s,r,a){var i=a("e8b5"),c=a("50c4"),d=a("0366"),p=function(u,f,h,m,g,v,y,k){for(var S=g,b=0,w=y?d(y,k,3):!1,x;b<m;){if(b in h){if(x=w?w(h[b],b,f):h[b],v>0&&i(x))S=p(u,f,x,c(x.length),S,v-1)-1;else{if(S>=9007199254740991)throw TypeError("Exceed the acceptable array length");u[S]=x}S++}b++}return S};s.exports=p}),a352:(function(s,r){s.exports=o}),a434:(function(s,r,a){var i=a("23e7"),c=a("23cb"),d=a("a691"),p=a("50c4"),u=a("7b0b"),f=a("65f0"),h=a("8418"),m=a("1dde"),g=a("ae40"),v=m("splice"),y=g("splice",{ACCESSORS:!0,0:0,1:2}),k=Math.max,S=Math.min,b=9007199254740991,w="Maximum allowed length exceeded";i({target:"Array",proto:!0,forced:!v||!y},{splice:function(E,B){var C=u(this),D=p(C.length),R=c(E,D),N=arguments.length,L,z,P,U,O,W;if(N===0?L=z=0:N===1?(L=0,z=D-R):(L=N-2,z=S(k(d(B),0),D-R)),D+L-z>b)throw TypeError(w);for(P=f(C,z),U=0;U<z;U++)O=R+U,O in C&&h(P,U,C[O]);if(P.length=z,L<z){for(U=R;U<D-z;U++)O=U+z,W=U+L,O in C?C[W]=C[O]:delete C[W];for(U=D;U>D-z+L;U--)delete C[U-1]}else if(L>z)for(U=D-z;U>R;U--)O=U+z-1,W=U+L-1,O in C?C[W]=C[O]:delete C[W];for(U=0;U<L;U++)C[U+R]=arguments[U+2];return C.length=D-z+L,P}})}),a4d3:(function(s,r,a){var i=a("23e7"),c=a("da84"),d=a("d066"),p=a("c430"),u=a("83ab"),f=a("4930"),h=a("fdbf"),m=a("d039"),g=a("5135"),v=a("e8b5"),y=a("861d"),k=a("825a"),S=a("7b0b"),b=a("fc6a"),w=a("c04e"),x=a("5c6c"),E=a("7c73"),B=a("df75"),C=a("241c"),D=a("057f"),R=a("7418"),N=a("06cf"),L=a("9bf2"),z=a("d1e7"),P=a("9112"),U=a("6eeb"),O=a("5692"),W=a("f772"),lt=a("d012"),ht=a("90e3"),gt=a("b622"),bt=a("e538"),Pt=a("746f"),Ct=a("d44e"),Nt=a("69f3"),St=a("b727").forEach,xt=W("hidden"),K="Symbol",nt="prototype",F=gt("toPrimitive"),T=Nt.set,Y=Nt.getterFor(K),Bt=Object[nt],Ot=c.Symbol,pt=d("JSON","stringify"),M=N.f,st=L.f,Vt=D.f,Wt=z.f,$t=O("symbols"),ge=O("op-symbols"),nn=O("string-to-symbol-registry"),Ke=O("symbol-to-string-registry"),_e=O("wks"),Dn=c.QObject,Vn=!Dn||!Dn[nt]||!Dn[nt].findChild,An=u&&m(function(){return E(st({},"a",{get:function(){return st(this,"a",{value:7}).a}})).a!=7})?function(Z,Q,ot){var wt=M(Bt,Q);wt&&delete Bt[Q],st(Z,Q,ot),wt&&Z!==Bt&&st(Bt,Q,wt)}:st,In=function(Z,Q){var ot=$t[Z]=E(Ot[nt]);return T(ot,{type:K,tag:Z,description:Q}),u||(ot.description=Q),ot},I=h?function(Z){return typeof Z=="symbol"}:function(Z){return Object(Z)instanceof Ot},A=function(Q,ot,wt){Q===Bt&&A(ge,ot,wt),k(Q);var At=w(ot,!0);return k(wt),g($t,At)?(wt.enumerable?(g(Q,xt)&&Q[xt][At]&&(Q[xt][At]=!1),wt=E(wt,{enumerable:x(0,!1)})):(g(Q,xt)||st(Q,xt,x(1,{})),Q[xt][At]=!0),An(Q,At,wt)):st(Q,At,wt)},j=function(Q,ot){k(Q);var wt=b(ot),At=B(wt).concat(q(wt));return St(At,function(Xt){(!u||it.call(wt,Xt))&&A(Q,Xt,wt[Xt])}),Q},J=function(Q,ot){return ot===void 0?E(Q):j(E(Q),ot)},it=function(Q){var ot=w(Q,!0),wt=Wt.call(this,ot);return this===Bt&&g($t,ot)&&!g(ge,ot)?!1:wt||!g(this,ot)||!g($t,ot)||g(this,xt)&&this[xt][ot]?wt:!0},V=function(Q,ot){var wt=b(Q),At=w(ot,!0);if(!(wt===Bt&&g($t,At)&&!g(ge,At))){var Xt=M(wt,At);return Xt&&g($t,At)&&!(g(wt,xt)&&wt[xt][At])&&(Xt.enumerable=!0),Xt}},_=function(Q){var ot=Vt(b(Q)),wt=[];return St(ot,function(At){!g($t,At)&&!g(lt,At)&&wt.push(At)}),wt},q=function(Q){var ot=Q===Bt,wt=Vt(ot?ge:b(Q)),At=[];return St(wt,function(Xt){g($t,Xt)&&(!ot||g(Bt,Xt))&&At.push($t[Xt])}),At};if(f||(Ot=function(){if(this instanceof Ot)throw TypeError("Symbol is not a constructor");var Q=!arguments.length||arguments[0]===void 0?void 0:String(arguments[0]),ot=ht(Q),wt=function(At){this===Bt&&wt.call(ge,At),g(this,xt)&&g(this[xt],ot)&&(this[xt][ot]=!1),An(this,ot,x(1,At))};return u&&Vn&&An(Bt,ot,{configurable:!0,set:wt}),In(ot,Q)},U(Ot[nt],"toString",function(){return Y(this).tag}),U(Ot,"withoutSetter",function(Z){return In(ht(Z),Z)}),z.f=it,L.f=A,N.f=V,C.f=D.f=_,R.f=q,bt.f=function(Z){return In(gt(Z),Z)},u&&(st(Ot[nt],"description",{configurable:!0,get:function(){return Y(this).description}}),p||U(Bt,"propertyIsEnumerable",it,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!f,sham:!f},{Symbol:Ot}),St(B(_e),function(Z){Pt(Z)}),i({target:K,stat:!0,forced:!f},{for:function(Z){var Q=String(Z);if(g(nn,Q))return nn[Q];var ot=Ot(Q);return nn[Q]=ot,Ke[ot]=Q,ot},keyFor:function(Q){if(!I(Q))throw TypeError(Q+" is not a symbol");if(g(Ke,Q))return Ke[Q]},useSetter:function(){Vn=!0},useSimple:function(){Vn=!1}}),i({target:"Object",stat:!0,forced:!f,sham:!u},{create:J,defineProperty:A,defineProperties:j,getOwnPropertyDescriptor:V}),i({target:"Object",stat:!0,forced:!f},{getOwnPropertyNames:_,getOwnPropertySymbols:q}),i({target:"Object",stat:!0,forced:m(function(){R.f(1)})},{getOwnPropertySymbols:function(Q){return R.f(S(Q))}}),pt){var dt=!f||m(function(){var Z=Ot();return pt([Z])!="[null]"||pt({a:Z})!="{}"||pt(Object(Z))!="{}"});i({target:"JSON",stat:!0,forced:dt},{stringify:function(Q,ot,wt){for(var At=[Q],Xt=1,Ge;arguments.length>Xt;)At.push(arguments[Xt++]);if(Ge=ot,!(!y(ot)&&Q===void 0||I(Q)))return v(ot)||(ot=function(Ao,on){if(typeof Ge=="function"&&(on=Ge.call(this,Ao,on)),!I(on))return on}),At[1]=ot,pt.apply(null,At)}})}Ot[nt][F]||P(Ot[nt],F,Ot[nt].valueOf),Ct(Ot,K),lt[xt]=!0}),a630:(function(s,r,a){var i=a("23e7"),c=a("4df4"),d=a("1c7e"),p=!d(function(u){Array.from(u)});i({target:"Array",stat:!0,forced:p},{from:c})}),a640:(function(s,r,a){var i=a("d039");s.exports=function(c,d){var p=[][c];return!!p&&i(function(){p.call(null,d||function(){throw 1},1)})}}),a691:(function(s,r){var a=Math.ceil,i=Math.floor;s.exports=function(c){return isNaN(c=+c)?0:(c>0?i:a)(c)}}),ab13:(function(s,r,a){var i=a("b622"),c=i("match");s.exports=function(d){var p=/./;try{"/./"[d](p)}catch{try{return p[c]=!1,"/./"[d](p)}catch{}}return!1}}),ac1f:(function(s,r,a){var i=a("23e7"),c=a("9263");i({target:"RegExp",proto:!0,forced:/./.exec!==c},{exec:c})}),ad6d:(function(s,r,a){var i=a("825a");s.exports=function(){var c=i(this),d="";return c.global&&(d+="g"),c.ignoreCase&&(d+="i"),c.multiline&&(d+="m"),c.dotAll&&(d+="s"),c.unicode&&(d+="u"),c.sticky&&(d+="y"),d}}),ae40:(function(s,r,a){var i=a("83ab"),c=a("d039"),d=a("5135"),p=Object.defineProperty,u={},f=function(h){throw h};s.exports=function(h,m){if(d(u,h))return u[h];m||(m={});var g=[][h],v=d(m,"ACCESSORS")?m.ACCESSORS:!1,y=d(m,0)?m[0]:f,k=d(m,1)?m[1]:void 0;return u[h]=!!g&&!c(function(){if(v&&!i)return!0;var S={length:-1};v?p(S,1,{enumerable:!0,get:f}):S[1]=1,g.call(S,y,k)})}}),ae93:(function(s,r,a){var i=a("e163"),c=a("9112"),d=a("5135"),p=a("b622"),u=a("c430"),f=p("iterator"),h=!1,m=function(){return this},g,v,y;[].keys&&(y=[].keys(),"next"in y?(v=i(i(y)),v!==Object.prototype&&(g=v)):h=!0),g==null&&(g={}),!u&&!d(g,f)&&c(g,f,m),s.exports={IteratorPrototype:g,BUGGY_SAFARI_ITERATORS:h}}),b041:(function(s,r,a){var i=a("00ee"),c=a("f5df");s.exports=i?{}.toString:function(){return"[object "+c(this)+"]"}}),b0c0:(function(s,r,a){var i=a("83ab"),c=a("9bf2").f,d=Function.prototype,p=d.toString,u=/^\s*function ([^ (]*)/,f="name";i&&!(f in d)&&c(d,f,{configurable:!0,get:function(){try{return p.call(this).match(u)[1]}catch{return""}}})}),b622:(function(s,r,a){var i=a("da84"),c=a("5692"),d=a("5135"),p=a("90e3"),u=a("4930"),f=a("fdbf"),h=c("wks"),m=i.Symbol,g=f?m:m&&m.withoutSetter||p;s.exports=function(v){return d(h,v)||(u&&d(m,v)?h[v]=m[v]:h[v]=g("Symbol."+v)),h[v]}}),b64b:(function(s,r,a){var i=a("23e7"),c=a("7b0b"),d=a("df75"),p=a("d039"),u=p(function(){d(1)});i({target:"Object",stat:!0,forced:u},{keys:function(h){return d(c(h))}})}),b727:(function(s,r,a){var i=a("0366"),c=a("44ad"),d=a("7b0b"),p=a("50c4"),u=a("65f0"),f=[].push,h=function(m){var g=m==1,v=m==2,y=m==3,k=m==4,S=m==6,b=m==5||S;return function(w,x,E,B){for(var C=d(w),D=c(C),R=i(x,E,3),N=p(D.length),L=0,z=B||u,P=g?z(w,N):v?z(w,0):void 0,U,O;N>L;L++)if((b||L in D)&&(U=D[L],O=R(U,L,C),m)){if(g)P[L]=O;else if(O)switch(m){case 3:return!0;case 5:return U;case 6:return L;case 2:f.call(P,U)}else if(k)return!1}return S?-1:y||k?k:P}};s.exports={forEach:h(0),map:h(1),filter:h(2),some:h(3),every:h(4),find:h(5),findIndex:h(6)}}),c04e:(function(s,r,a){var i=a("861d");s.exports=function(c,d){if(!i(c))return c;var p,u;if(d&&typeof(p=c.toString)=="function"&&!i(u=p.call(c))||typeof(p=c.valueOf)=="function"&&!i(u=p.call(c))||!d&&typeof(p=c.toString)=="function"&&!i(u=p.call(c)))return u;throw TypeError("Can't convert object to primitive value")}}),c430:(function(s,r){s.exports=!1}),c6b6:(function(s,r){var a={}.toString;s.exports=function(i){return a.call(i).slice(8,-1)}}),c6cd:(function(s,r,a){var i=a("da84"),c=a("ce4e"),d="__core-js_shared__",p=i[d]||c(d,{});s.exports=p}),c740:(function(s,r,a){var i=a("23e7"),c=a("b727").findIndex,d=a("44d2"),p=a("ae40"),u="findIndex",f=!0,h=p(u);u in[]&&Array(1)[u](function(){f=!1}),i({target:"Array",proto:!0,forced:f||!h},{findIndex:function(g){return c(this,g,arguments.length>1?arguments[1]:void 0)}}),d(u)}),c8ba:(function(s,r){var a;a=(function(){return this})();try{a=a||new Function("return this")()}catch{typeof window=="object"&&(a=window)}s.exports=a}),c975:(function(s,r,a){var i=a("23e7"),c=a("4d64").indexOf,d=a("a640"),p=a("ae40"),u=[].indexOf,f=!!u&&1/[1].indexOf(1,-0)<0,h=d("indexOf"),m=p("indexOf",{ACCESSORS:!0,1:0});i({target:"Array",proto:!0,forced:f||!h||!m},{indexOf:function(v){return f?u.apply(this,arguments)||0:c(this,v,arguments.length>1?arguments[1]:void 0)}})}),ca84:(function(s,r,a){var i=a("5135"),c=a("fc6a"),d=a("4d64").indexOf,p=a("d012");s.exports=function(u,f){var h=c(u),m=0,g=[],v;for(v in h)!i(p,v)&&i(h,v)&&g.push(v);for(;f.length>m;)i(h,v=f[m++])&&(~d(g,v)||g.push(v));return g}}),caad:(function(s,r,a){var i=a("23e7"),c=a("4d64").includes,d=a("44d2"),p=a("ae40"),u=p("indexOf",{ACCESSORS:!0,1:0});i({target:"Array",proto:!0,forced:!u},{includes:function(h){return c(this,h,arguments.length>1?arguments[1]:void 0)}}),d("includes")}),cc12:(function(s,r,a){var i=a("da84"),c=a("861d"),d=i.document,p=c(d)&&c(d.createElement);s.exports=function(u){return p?d.createElement(u):{}}}),ce4e:(function(s,r,a){var i=a("da84"),c=a("9112");s.exports=function(d,p){try{c(i,d,p)}catch{i[d]=p}return p}}),d012:(function(s,r){s.exports={}}),d039:(function(s,r){s.exports=function(a){try{return!!a()}catch{return!0}}}),d066:(function(s,r,a){var i=a("428f"),c=a("da84"),d=function(p){return typeof p=="function"?p:void 0};s.exports=function(p,u){return arguments.length<2?d(i[p])||d(c[p]):i[p]&&i[p][u]||c[p]&&c[p][u]}}),d1e7:(function(s,r,a){var i={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,d=c&&!i.call({1:2},1);r.f=d?function(u){var f=c(this,u);return!!f&&f.enumerable}:i}),d28b:(function(s,r,a){var i=a("746f");i("iterator")}),d2bb:(function(s,r,a){var i=a("825a"),c=a("3bbe");s.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var d=!1,p={},u;try{u=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,u.call(p,[]),d=p instanceof Array}catch{}return function(h,m){return i(h),c(m),d?u.call(h,m):h.__proto__=m,h}})():void 0)}),d3b7:(function(s,r,a){var i=a("00ee"),c=a("6eeb"),d=a("b041");i||c(Object.prototype,"toString",d,{unsafe:!0})}),d44e:(function(s,r,a){var i=a("9bf2").f,c=a("5135"),d=a("b622"),p=d("toStringTag");s.exports=function(u,f,h){u&&!c(u=h?u:u.prototype,p)&&i(u,p,{configurable:!0,value:f})}}),d58f:(function(s,r,a){var i=a("1c0b"),c=a("7b0b"),d=a("44ad"),p=a("50c4"),u=function(f){return function(h,m,g,v){i(m);var y=c(h),k=d(y),S=p(y.length),b=f?S-1:0,w=f?-1:1;if(g<2)for(;;){if(b in k){v=k[b],b+=w;break}if(b+=w,f?b<0:S<=b)throw TypeError("Reduce of empty array with no initial value")}for(;f?b>=0:S>b;b+=w)b in k&&(v=m(v,k[b],b,y));return v}};s.exports={left:u(!1),right:u(!0)}}),d784:(function(s,r,a){a("ac1f");var i=a("6eeb"),c=a("d039"),d=a("b622"),p=a("9263"),u=a("9112"),f=d("species"),h=!c(function(){var k=/./;return k.exec=function(){var S=[];return S.groups={a:"7"},S},"".replace(k,"$<a>")!=="7"}),m=(function(){return"a".replace(/./,"$0")==="$0"})(),g=d("replace"),v=(function(){return/./[g]?/./[g]("a","$0")==="":!1})(),y=!c(function(){var k=/(?:)/,S=k.exec;k.exec=function(){return S.apply(this,arguments)};var b="ab".split(k);return b.length!==2||b[0]!=="a"||b[1]!=="b"});s.exports=function(k,S,b,w){var x=d(k),E=!c(function(){var L={};return L[x]=function(){return 7},""[k](L)!=7}),B=E&&!c(function(){var L=!1,z=/a/;return k==="split"&&(z={},z.constructor={},z.constructor[f]=function(){return z},z.flags="",z[x]=/./[x]),z.exec=function(){return L=!0,null},z[x](""),!L});if(!E||!B||k==="replace"&&!(h&&m&&!v)||k==="split"&&!y){var C=/./[x],D=b(x,""[k],function(L,z,P,U,O){return z.exec===p?E&&!O?{done:!0,value:C.call(z,P,U)}:{done:!0,value:L.call(P,z,U)}:{done:!1}},{REPLACE_KEEPS_$0:m,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:v}),R=D[0],N=D[1];i(String.prototype,k,R),i(RegExp.prototype,x,S==2?function(L,z){return N.call(L,this,z)}:function(L){return N.call(L,this)})}w&&u(RegExp.prototype[x],"sham",!0)}}),d81d:(function(s,r,a){var i=a("23e7"),c=a("b727").map,d=a("1dde"),p=a("ae40"),u=d("map"),f=p("map");i({target:"Array",proto:!0,forced:!u||!f},{map:function(m){return c(this,m,arguments.length>1?arguments[1]:void 0)}})}),da84:(function(s,r,a){(function(i){var c=function(d){return d&&d.Math==Math&&d};s.exports=c(typeof globalThis=="object"&&globalThis)||c(typeof window=="object"&&window)||c(typeof self=="object"&&self)||c(typeof i=="object"&&i)||Function("return this")()}).call(this,a("c8ba"))}),dbb4:(function(s,r,a){var i=a("23e7"),c=a("83ab"),d=a("56ef"),p=a("fc6a"),u=a("06cf"),f=a("8418");i({target:"Object",stat:!0,sham:!c},{getOwnPropertyDescriptors:function(m){for(var g=p(m),v=u.f,y=d(g),k={},S=0,b,w;y.length>S;)w=v(g,b=y[S++]),w!==void 0&&f(k,b,w);return k}})}),dbf1:(function(s,r,a){(function(i){a.d(r,"a",function(){return d});function c(){return typeof window<"u"?window.console:i.console}var d=c()}).call(this,a("c8ba"))}),ddb0:(function(s,r,a){var i=a("da84"),c=a("fdbc"),d=a("e260"),p=a("9112"),u=a("b622"),f=u("iterator"),h=u("toStringTag"),m=d.values;for(var g in c){var v=i[g],y=v&&v.prototype;if(y){if(y[f]!==m)try{p(y,f,m)}catch{y[f]=m}if(y[h]||p(y,h,g),c[g]){for(var k in d)if(y[k]!==d[k])try{p(y,k,d[k])}catch{y[k]=d[k]}}}}}),df75:(function(s,r,a){var i=a("ca84"),c=a("7839");s.exports=Object.keys||function(p){return i(p,c)}}),e01a:(function(s,r,a){var i=a("23e7"),c=a("83ab"),d=a("da84"),p=a("5135"),u=a("861d"),f=a("9bf2").f,h=a("e893"),m=d.Symbol;if(c&&typeof m=="function"&&(!("description"in m.prototype)||m().description!==void 0)){var g={},v=function(){var x=arguments.length<1||arguments[0]===void 0?void 0:String(arguments[0]),E=this instanceof v?new m(x):x===void 0?m():m(x);return x===""&&(g[E]=!0),E};h(v,m);var y=v.prototype=m.prototype;y.constructor=v;var k=y.toString,S=String(m("test"))=="Symbol(test)",b=/^Symbol\((.*)\)[^)]+$/;f(y,"description",{configurable:!0,get:function(){var x=u(this)?this.valueOf():this,E=k.call(x);if(p(g,x))return"";var B=S?E.slice(7,-1):E.replace(b,"$1");return B===""?void 0:B}}),i({global:!0,forced:!0},{Symbol:v})}}),e163:(function(s,r,a){var i=a("5135"),c=a("7b0b"),d=a("f772"),p=a("e177"),u=d("IE_PROTO"),f=Object.prototype;s.exports=p?Object.getPrototypeOf:function(h){return h=c(h),i(h,u)?h[u]:typeof h.constructor=="function"&&h instanceof h.constructor?h.constructor.prototype:h instanceof Object?f:null}}),e177:(function(s,r,a){var i=a("d039");s.exports=!i(function(){function c(){}return c.prototype.constructor=null,Object.getPrototypeOf(new c)!==c.prototype})}),e260:(function(s,r,a){var i=a("fc6a"),c=a("44d2"),d=a("3f8c"),p=a("69f3"),u=a("7dd0"),f="Array Iterator",h=p.set,m=p.getterFor(f);s.exports=u(Array,"Array",function(g,v){h(this,{type:f,target:i(g),index:0,kind:v})},function(){var g=m(this),v=g.target,y=g.kind,k=g.index++;return!v||k>=v.length?(g.target=void 0,{value:void 0,done:!0}):y=="keys"?{value:k,done:!1}:y=="values"?{value:v[k],done:!1}:{value:[k,v[k]],done:!1}},"values"),d.Arguments=d.Array,c("keys"),c("values"),c("entries")}),e439:(function(s,r,a){var i=a("23e7"),c=a("d039"),d=a("fc6a"),p=a("06cf").f,u=a("83ab"),f=c(function(){p(1)}),h=!u||f;i({target:"Object",stat:!0,forced:h,sham:!u},{getOwnPropertyDescriptor:function(g,v){return p(d(g),v)}})}),e538:(function(s,r,a){var i=a("b622");r.f=i}),e893:(function(s,r,a){var i=a("5135"),c=a("56ef"),d=a("06cf"),p=a("9bf2");s.exports=function(u,f){for(var h=c(f),m=p.f,g=d.f,v=0;v<h.length;v++){var y=h[v];i(u,y)||m(u,y,g(f,y))}}}),e8b5:(function(s,r,a){var i=a("c6b6");s.exports=Array.isArray||function(d){return i(d)=="Array"}}),e95a:(function(s,r,a){var i=a("b622"),c=a("3f8c"),d=i("iterator"),p=Array.prototype;s.exports=function(u){return u!==void 0&&(c.Array===u||p[d]===u)}}),f5df:(function(s,r,a){var i=a("00ee"),c=a("c6b6"),d=a("b622"),p=d("toStringTag"),u=c((function(){return arguments})())=="Arguments",f=function(h,m){try{return h[m]}catch{}};s.exports=i?c:function(h){var m,g,v;return h===void 0?"Undefined":h===null?"Null":typeof(g=f(m=Object(h),p))=="string"?g:u?c(m):(v=c(m))=="Object"&&typeof m.callee=="function"?"Arguments":v}}),f772:(function(s,r,a){var i=a("5692"),c=a("90e3"),d=i("keys");s.exports=function(p){return d[p]||(d[p]=c(p))}}),fb15:(function(s,r,a){if(a.r(r),typeof window<"u"){var i=window.document.currentScript;{var c=a("8875");i=c(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:c})}var d=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);d&&(a.p=d[1])}a("99af"),a("4de4"),a("4160"),a("c975"),a("d81d"),a("a434"),a("159b"),a("a4d3"),a("e439"),a("dbb4"),a("b64b");function p(I,A,j){return A in I?Object.defineProperty(I,A,{value:j,enumerable:!0,configurable:!0,writable:!0}):I[A]=j,I}function u(I,A){var j=Object.keys(I);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(I);A&&(J=J.filter(function(it){return Object.getOwnPropertyDescriptor(I,it).enumerable})),j.push.apply(j,J)}return j}function f(I){for(var A=1;A<arguments.length;A++){var j=arguments[A]!=null?arguments[A]:{};A%2?u(Object(j),!0).forEach(function(J){p(I,J,j[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(j)):u(Object(j)).forEach(function(J){Object.defineProperty(I,J,Object.getOwnPropertyDescriptor(j,J))})}return I}function h(I){if(Array.isArray(I))return I}a("e01a"),a("d28b"),a("e260"),a("d3b7"),a("3ca3"),a("ddb0");function m(I,A){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(I)))){var j=[],J=!0,it=!1,V=void 0;try{for(var _=I[Symbol.iterator](),q;!(J=(q=_.next()).done)&&(j.push(q.value),!(A&&j.length===A));J=!0);}catch(dt){it=!0,V=dt}finally{try{!J&&_.return!=null&&_.return()}finally{if(it)throw V}}return j}}a("a630"),a("fb6a"),a("b0c0"),a("25f0");function g(I,A){(A==null||A>I.length)&&(A=I.length);for(var j=0,J=new Array(A);j<A;j++)J[j]=I[j];return J}function v(I,A){if(I){if(typeof I=="string")return g(I,A);var j=Object.prototype.toString.call(I).slice(8,-1);if(j==="Object"&&I.constructor&&(j=I.constructor.name),j==="Map"||j==="Set")return Array.from(I);if(j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j))return g(I,A)}}function y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
449
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k(I,A){return h(I)||m(I,A)||v(I,A)||y()}function S(I){if(Array.isArray(I))return g(I)}function b(I){if(typeof Symbol<"u"&&Symbol.iterator in Object(I))return Array.from(I)}function w(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
450
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(I){return S(I)||b(I)||v(I)||w()}var E=a("a352"),B=a.n(E);function C(I){I.parentElement!==null&&I.parentElement.removeChild(I)}function D(I,A,j){var J=j===0?I.children[0]:I.children[j-1].nextSibling;I.insertBefore(A,J)}var R=a("dbf1");a("13d5"),a("4fad"),a("ac1f"),a("5319");function N(I){var A=Object.create(null);return function(J){var it=A[J];return it||(A[J]=I(J))}}var L=/-(\w)/g,z=N(function(I){return I.replace(L,function(A,j){return j.toUpperCase()})});a("5db7"),a("73d9");var P=["Start","Add","Remove","Update","End"],U=["Choose","Unchoose","Sort","Filter","Clone"],O=["Move"],W=[O,P,U].flatMap(function(I){return I}).map(function(I){return"on".concat(I)}),lt={manage:O,manageAndEmit:P,emit:U};function ht(I){return W.indexOf(I)!==-1}a("caad"),a("2ca0");var gt=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function bt(I){return gt.includes(I)}function Pt(I){return["transition-group","TransitionGroup"].includes(I)}function Ct(I){return["id","class","role","style"].includes(I)||I.startsWith("data-")||I.startsWith("aria-")||I.startsWith("on")}function Nt(I){return I.reduce(function(A,j){var J=k(j,2),it=J[0],V=J[1];return A[it]=V,A},{})}function St(I){var A=I.$attrs,j=I.componentData,J=j===void 0?{}:j,it=Nt(Object.entries(A).filter(function(V){var _=k(V,2),q=_[0];return _[1],Ct(q)}));return f(f({},it),J)}function xt(I){var A=I.$attrs,j=I.callBackBuilder,J=Nt(K(A));Object.entries(j).forEach(function(V){var _=k(V,2),q=_[0],dt=_[1];lt[q].forEach(function(Z){J["on".concat(Z)]=dt(Z)})});var it="[data-draggable]".concat(J.draggable||"");return f(f({},J),{},{draggable:it})}function K(I){return Object.entries(I).filter(function(A){var j=k(A,2),J=j[0];return j[1],!Ct(J)}).map(function(A){var j=k(A,2),J=j[0],it=j[1];return[z(J),it]}).filter(function(A){var j=k(A,2),J=j[0];return j[1],!ht(J)})}a("c740");function nt(I,A){if(!(I instanceof A))throw new TypeError("Cannot call a class as a function")}function F(I,A){for(var j=0;j<A.length;j++){var J=A[j];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(I,J.key,J)}}function T(I,A,j){return A&&F(I.prototype,A),I}var Y=function(A){var j=A.el;return j},Bt=function(A,j){return A.__draggable_context=j},Ot=function(A){return A.__draggable_context},pt=(function(){function I(A){var j=A.nodes,J=j.header,it=j.default,V=j.footer,_=A.root,q=A.realList;nt(this,I),this.defaultNodes=it,this.children=[].concat(x(J),x(it),x(V)),this.externalComponent=_.externalComponent,this.rootTransition=_.transition,this.tag=_.tag,this.realList=q}return T(I,[{key:"render",value:function(j,J){var it=this.tag,V=this.children,_=this._isRootComponent,q=_?{default:function(){return V}}:V;return j(it,J,q)}},{key:"updated",value:function(){var j=this.defaultNodes,J=this.realList;j.forEach(function(it,V){Bt(Y(it),{element:J[V],index:V})})}},{key:"getUnderlyingVm",value:function(j){return Ot(j)}},{key:"getVmIndexFromDomIndex",value:function(j,J){var it=this.defaultNodes,V=it.length,_=J.children,q=_.item(j);if(q===null)return V;var dt=Ot(q);if(dt)return dt.index;if(V===0)return 0;var Z=Y(it[0]),Q=x(_).findIndex(function(ot){return ot===Z});return j<Q?0:V}},{key:"_isRootComponent",get:function(){return this.externalComponent||this.rootTransition}}]),I})(),M=a("8bbf");function st(I,A){var j=I[A];return j?j():[]}function Vt(I){var A=I.$slots,j=I.realList,J=I.getKey,it=j||[],V=["header","footer"].map(function(ot){return st(A,ot)}),_=k(V,2),q=_[0],dt=_[1],Z=A.item;if(!Z)throw new Error("draggable element must have an item slot");var Q=it.flatMap(function(ot,wt){return Z({element:ot,index:wt}).map(function(At){return At.key=J(ot),At.props=f(f({},At.props||{}),{},{"data-draggable":!0}),At})});if(Q.length!==it.length)throw new Error("Item slot must have only one child");return{header:q,footer:dt,default:Q}}function Wt(I){var A=Pt(I),j=!bt(I)&&!A;return{transition:A,externalComponent:j,tag:j?Object(M.resolveComponent)(I):A?M.TransitionGroup:I}}function $t(I){var A=I.$slots,j=I.tag,J=I.realList,it=I.getKey,V=Vt({$slots:A,realList:J,getKey:it}),_=Wt(j);return new pt({nodes:V,root:_,realList:J})}function ge(I,A){var j=this;Object(M.nextTick)(function(){return j.$emit(I.toLowerCase(),A)})}function nn(I){var A=this;return function(j,J){if(A.realList!==null)return A["onDrag".concat(I)](j,J)}}function Ke(I){var A=this,j=nn.call(this,I);return function(J,it){j.call(A,J,it),ge.call(A,I,J)}}var _e=null,Dn={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:function(A){return A}},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},Vn=["update:modelValue","change"].concat(x([].concat(x(lt.manageAndEmit),x(lt.emit)).map(function(I){return I.toLowerCase()}))),An=Object(M.defineComponent)({name:"draggable",inheritAttrs:!1,props:Dn,emits:Vn,data:function(){return{error:!1}},render:function(){try{this.error=!1;var A=this.$slots,j=this.$attrs,J=this.tag,it=this.componentData,V=this.realList,_=this.getKey,q=$t({$slots:A,tag:J,realList:V,getKey:_});this.componentStructure=q;var dt=St({$attrs:j,componentData:it});return q.render(M.h,dt)}catch(Z){return this.error=!0,Object(M.h)("pre",{style:{color:"red"}},Z.stack)}},created:function(){this.list!==null&&this.modelValue!==null&&R.a.error("modelValue and list props are mutually exclusive! Please set one or another.")},mounted:function(){var A=this;if(!this.error){var j=this.$attrs,J=this.$el,it=this.componentStructure;it.updated();var V=xt({$attrs:j,callBackBuilder:{manageAndEmit:function(dt){return Ke.call(A,dt)},emit:function(dt){return ge.bind(A,dt)},manage:function(dt){return nn.call(A,dt)}}}),_=J.nodeType===1?J:J.parentElement;this._sortable=new B.a(_,V),this.targetDomElement=_,_.__draggable_component__=this}},updated:function(){this.componentStructure.updated()},beforeUnmount:function(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList:function(){var A=this.list;return A||this.modelValue},getKey:function(){var A=this.itemKey;return typeof A=="function"?A:function(j){return j[A]}}},watch:{$attrs:{handler:function(A){var j=this._sortable;j&&K(A).forEach(function(J){var it=k(J,2),V=it[0],_=it[1];j.option(V,_)})},deep:!0}},methods:{getUnderlyingVm:function(A){return this.componentStructure.getUnderlyingVm(A)||null},getUnderlyingPotencialDraggableComponent:function(A){return A.__draggable_component__},emitChanges:function(A){var j=this;Object(M.nextTick)(function(){return j.$emit("change",A)})},alterList:function(A){if(this.list){A(this.list);return}var j=x(this.modelValue);A(j),this.$emit("update:modelValue",j)},spliceList:function(){var A=arguments,j=function(it){return it.splice.apply(it,x(A))};this.alterList(j)},updatePosition:function(A,j){var J=function(V){return V.splice(j,0,V.splice(A,1)[0])};this.alterList(J)},getRelatedContextFromMoveEvent:function(A){var j=A.to,J=A.related,it=this.getUnderlyingPotencialDraggableComponent(j);if(!it)return{component:it};var V=it.realList,_={list:V,component:it};if(j!==J&&V){var q=it.getUnderlyingVm(J)||{};return f(f({},q),_)}return _},getVmIndexFromDomIndex:function(A){return this.componentStructure.getVmIndexFromDomIndex(A,this.targetDomElement)},onDragStart:function(A){this.context=this.getUnderlyingVm(A.item),A.item._underlying_vm_=this.clone(this.context.element),_e=A.item},onDragAdd:function(A){var j=A.item._underlying_vm_;if(j!==void 0){C(A.item);var J=this.getVmIndexFromDomIndex(A.newIndex);this.spliceList(J,0,j);var it={element:j,newIndex:J};this.emitChanges({added:it})}},onDragRemove:function(A){if(D(this.$el,A.item,A.oldIndex),A.pullMode==="clone"){C(A.clone);return}var j=this.context,J=j.index,it=j.element;this.spliceList(J,1);var V={element:it,oldIndex:J};this.emitChanges({removed:V})},onDragUpdate:function(A){C(A.item),D(A.from,A.item,A.oldIndex);var j=this.context.index,J=this.getVmIndexFromDomIndex(A.newIndex);this.updatePosition(j,J);var it={element:this.context.element,oldIndex:j,newIndex:J};this.emitChanges({moved:it})},computeFutureIndex:function(A,j){if(!A.element)return 0;var J=x(j.to.children).filter(function(q){return q.style.display!=="none"}),it=J.indexOf(j.related),V=A.component.getVmIndexFromDomIndex(it),_=J.indexOf(_e)!==-1;return _||!j.willInsertAfter?V:V+1},onDragMove:function(A,j){var J=this.move,it=this.realList;if(!J||!it)return!0;var V=this.getRelatedContextFromMoveEvent(A),_=this.computeFutureIndex(V,A),q=f(f({},this.context),{},{futureIndex:_}),dt=f(f({},A),{},{relatedContext:V,draggedContext:q});return J(dt,j)},onDragEnd:function(){_e=null}}}),In=An;r.default=In}),fb6a:(function(s,r,a){var i=a("23e7"),c=a("861d"),d=a("e8b5"),p=a("23cb"),u=a("50c4"),f=a("fc6a"),h=a("8418"),m=a("b622"),g=a("1dde"),v=a("ae40"),y=g("slice"),k=v("slice",{ACCESSORS:!0,0:0,1:2}),S=m("species"),b=[].slice,w=Math.max;i({target:"Array",proto:!0,forced:!y||!k},{slice:function(E,B){var C=f(this),D=u(C.length),R=p(E,D),N=p(B===void 0?D:B,D),L,z,P;if(d(C)&&(L=C.constructor,typeof L=="function"&&(L===Array||d(L.prototype))?L=void 0:c(L)&&(L=L[S],L===null&&(L=void 0)),L===Array||L===void 0))return b.call(C,R,N);for(z=new(L===void 0?Array:L)(w(N-R,0)),P=0;R<N;R++,P++)R in C&&h(z,P,C[R]);return z.length=P,z}})}),fc6a:(function(s,r,a){var i=a("44ad"),c=a("1d80");s.exports=function(d){return i(c(d))}}),fdbc:(function(s,r){s.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),fdbf:(function(s,r,a){var i=a("4930");s.exports=i&&!Symbol.sham&&typeof Symbol.iterator=="symbol"})}).default})})(Ca)),Ca.exports}var Ax=Vx();const gd=Jk(Ax),Ix=["data-block-id","data-block-type"],Rx={key:0,class:"tpl-block-actions tpl-fade-in tpl:absolute tpl:-right-2 tpl:top-1/2 tpl:z-10 tpl:flex tpl:-translate-y-1/2 tpl:translate-x-full tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",style:{"background-color":"var(--tpl-bg-elevated)","box-shadow":"var(--tpl-shadow-md)",border:"1px solid var(--tpl-border)"}},zx=["aria-label","title"],Px=["aria-label","title"],Lx=["aria-label","title"],Fx=["aria-label","title"],jx={key:1,class:"tpl-block-hidden-overlay tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[5] tpl:flex tpl:items-center tpl:justify-center tpl:rounded-sm"},Hx={class:"tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-2 tpl:py-1 tpl:text-[10px] tpl:font-medium",style:{"background-color":"var(--tpl-bg-elevated)",color:"var(--tpl-text-muted)","box-shadow":"var(--tpl-shadow-sm)"}},Ux={key:2,class:"tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"},Wx=["title"],Kx={key:3,class:"tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"},_x=l.defineComponent({__name:"BlockWrapper",props:{block:{},isSelected:{type:Boolean},viewport:{},previewMode:{type:Boolean}},emits:["select"],setup(n,{emit:t}){const e=n,o=t,{t:s,format:r}=jt(),a=l.computed(()=>!e.viewport||!e.block.visibility?!1:e.block.visibility[e.viewport]===!1),i=l.computed(()=>e.viewport?{desktop:s.viewport.desktop,tablet:s.viewport.tablet,mobile:s.viewport.mobile}[e.viewport]??e.viewport:""),c=l.computed(()=>!!e.block.displayCondition),d=l.inject("blockActions"),p=l.inject("conditionPreview"),u=l.inject("comments",null),f=l.inject("openCommentsForBlock",void 0),h=l.inject("savedModules",null),m=l.inject("planConfig",null),g=l.computed(()=>!!h&&!!(m!=null&&m.hasFeature("saved_modules"))),v=l.computed(()=>u?u.commentCountByBlock.value.get(e.block.id)??0:0),y=l.computed(()=>{const{padding:E,margin:B,backgroundColor:C}=e.block.styles;return{padding:`${E.top}px ${E.right}px ${E.bottom}px ${E.left}px`,margin:`${B.top}px ${B.right}px ${B.bottom}px ${B.left}px`,backgroundColor:C||"transparent"}});function k(E){e.previewMode||(E.stopPropagation(),o("select"))}function S(){d==null||d.deleteBlock(e.block.id)}function b(){d==null||d.duplicateBlock(e.block)}function w(){h==null||h.openSaveDialog(e.block.id)}function x(){p==null||p.toggleBlock(e.block.id)}return(E,B)=>{var C;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow tpl:duration-150",{"tpl-block--selected":n.isSelected,"tpl-block--idle":!n.isSelected}]),style:l.normalizeStyle(y.value),"data-block-id":n.block.id,"data-block-type":n.block.type,draggable:"false",onClick:k},[n.isSelected?(l.openBlock(),l.createElementBlock("div",Rx,[l.createElementVNode("button",{class:"tpl-block-btn tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-grab tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150 tpl:active:cursor-grabbing","aria-label":l.unref(s).blockActions.drag,title:l.unref(s).blockActions.drag},[l.createVNode(l.unref(gk),{size:14,"stroke-width":1.5})],8,zx),l.createElementVNode("button",{class:"tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150","aria-label":l.unref(s).blockActions.duplicate,title:l.unref(s).blockActions.duplicate,onClick:l.withModifiers(b,["stop"])},[l.createVNode(l.unref(mf),{size:14,"stroke-width":1.5})],8,Px),g.value?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150","aria-label":l.unref(s).blockActions.saveAsModule,title:l.unref(s).blockActions.saveAsModule,onClick:l.withModifiers(w,["stop"])},[l.createVNode(l.unref(rk),{size:14,"stroke-width":1.5})],8,Lx)):l.createCommentVNode("",!0),l.createElementVNode("button",{class:"tpl-block-action-btn tpl-block-delete-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150","aria-label":l.unref(s).blockActions.delete,title:l.unref(s).blockActions.delete,onClick:l.withModifiers(S,["stop"])},[l.createVNode(l.unref(yl),{size:14,"stroke-width":1.5})],8,Fx)])):l.createCommentVNode("",!0),a.value?(l.openBlock(),l.createElementBlock("div",jx,[l.createElementVNode("span",Hx,[l.createVNode(l.unref(gf),{size:12,"stroke-width":1.5}),l.createTextVNode(" "+l.toDisplayString(l.unref(r)(l.unref(s).blockActions.hiddenOnViewport,{viewport:i.value})),1)])])):l.createCommentVNode("",!0),c.value&&!a.value?(l.openBlock(),l.createElementBlock("div",Ux,[l.createElementVNode("button",{class:"tpl-condition-toggle tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1 tpl:transition-colors tpl:duration-150",style:{"background-color":"var(--tpl-bg-elevated)",color:"var(--tpl-primary)",border:"1px solid var(--tpl-border)"},title:(C=n.block.displayCondition)==null?void 0:C.label,onClick:l.withModifiers(x,["stop"])},[l.createVNode(l.unref(mk),{size:12,"stroke-width":2})],8,Wx)])):l.createCommentVNode("",!0),v.value>0&&!a.value?(l.openBlock(),l.createElementBlock("div",Kx,[l.createElementVNode("button",{class:"tpl-comment-indicator tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:duration-150",style:{"background-color":"var(--tpl-primary-light)",color:"var(--tpl-primary)"},onClick:B[0]||(B[0]=l.withModifiers(D=>{var R;return(R=l.unref(f))==null?void 0:R(n.block.id)},["stop"]))},[l.createVNode(l.unref(ka),{size:10,"stroke-width":2.5}),l.createTextVNode(" "+l.toDisplayString(v.value),1)])])):l.createCommentVNode("",!0),l.renderSlot(E.$slots,"default",{},void 0,!0)],14,Ix)}}}),Re=(n,t)=>{const e=n.__vccOpts||n;for(const[o,s]of t)e[o]=s;return e},Xf=Re(_x,[["__scopeId","data-v-476978bc"]]),Gx={class:"tpl:text-center"},Jx=["href"],pr=l.defineComponent({__name:"ButtonBlock",props:{block:{},viewport:{}},setup(n){const t=n,e=l.computed(()=>{const o={display:"inline-block",padding:`${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,backgroundColor:t.block.backgroundColor,color:t.block.textColor,fontSize:`${t.block.fontSize}px`,fontWeight:"bold",textDecoration:"none",borderRadius:`${t.block.borderRadius}px`,textAlign:"center"};return t.block.fontFamily&&(o.fontFamily=t.block.fontFamily),o});return(o,s)=>(l.openBlock(),l.createElementBlock("div",Gx,[l.createElementVNode("a",{href:n.block.url||"#",style:l.normalizeStyle(e.value),class:"tpl:cursor-default",onClick:s[0]||(s[0]=l.withModifiers(()=>{},["prevent"]))},l.toDisplayString(n.block.text),13,Jx)]))}}),Yx=["innerHTML"],Xx=["src","width","height"],Zf=l.defineComponent({__name:"CustomBlockIcon",props:{icon:{},size:{}},setup(n){const t=n,e=l.computed(()=>t.size??20),o=l.computed(()=>t.icon&&(t.icon.trimStart().startsWith("<svg")||t.icon.trimStart().startsWith("<SVG"))),s=l.computed(()=>t.icon&&!o.value&&(t.icon.startsWith("http")||t.icon.startsWith("/")));return(r,a)=>o.value?(l.openBlock(),l.createElementBlock("span",{key:0,class:"tpl:inline-flex tpl:items-center tpl:justify-center",style:l.normalizeStyle({width:`${e.value}px`,height:`${e.value}px`}),innerHTML:n.icon},null,12,Yx)):s.value?(l.openBlock(),l.createElementBlock("img",{key:1,src:n.icon,width:e.value,height:e.value,class:"tpl:inline-block",alt:""},null,8,Xx)):(l.openBlock(),l.createBlock(l.unref(ak),{key:2,size:e.value,"stroke-width":1.5},null,8,["size"]))}}),Zx={},Qx={class:"tpl-loading-track"};function qx(n,t){return l.openBlock(),l.createElementBlock("div",Qx)}const Wa=Re(Zx,[["render",qx],["__scopeId","data-v-1ed538ec"]]);function jo(){const n=l.inject("mergeTags",[]),t=l.inject("mergeTagSyntax",yt.SYNTAX_PRESETS.liquid),e=l.inject("onRequestMergeTag"),o=l.ref(!1);function s(c){return yt.isMergeTagValue(c,t)}function r(c){return yt.getMergeTagLabel(c,n)}async function a(){if(!e)return null;o.value=!0;try{return await e()}finally{o.value=!1}}const i=n.length>0||!!e;return{mergeTags:n,isRequesting:o,isEnabled:i,syntax:t,isMergeTagValue:s,getMergeTagLabel:r,requestMergeTag:a}}const $x=[{key:"smileys",emojis:["😀","😃","😄","😁","😅","😂","🤣","😊","😇","🙂","😉","😍","🥰","😘","😋","😎","🤩","🥳","😏","😢","😭","😤","😡","🤯","😱","🤔","🤫","🤗","🫡","👋"]},{key:"gestures",emojis:["👍","👎","👏","🙌","🤝","✌️","🤞","🫶","❤️","🧡","💛","💚","💙","💜","🖤","💯","✨","⭐","🌟","💫","🔥","💥","💪","👀","👁️","🎉","🎊","🎁","🏆","🥇"]},{key:"objects",emojis:["📧","✉️","📨","📩","📬","📱","💻","🖥️","📊","📈","📉","📅","🗓️","⏰","⏳","💡","🔔","📢","🎯","✅","❌","⚠️","💲","💵","💰","🛒","🛍️","📦","🚀","✈️"]}];function t2(){const[n,t]=ek(!1);function e(){t()}function o(){n.value=!1}return{categories:$x,isOpen:n,toggle:e,close:o}}function Qf(){const n=l.shallowRef(new Map);function t(d,p){const u=new Map(n.value);u.set(d,p),n.value=u}function e(d,p){const u=`custom:${d.type}`,f={component:p,createBlock:()=>yt.createCustomBlock(d),sidebarItem:{type:u,label:d.name,icon:d.icon,description:d.description,isCustom:!0},definition:d},h=new Map(n.value);h.set(u,f),n.value=h}function o(d){var p,u;if(d.type==="custom"){const f=`custom:${d.customType}`;return(p=n.value.get(f))==null?void 0:p.component}return(u=n.value.get(d.type))==null?void 0:u.component}function s(d){var p;return(p=n.value.get(d))==null?void 0:p.createBlock()}function r(){const d=[],p=[];for(const u of n.value.values())u.sidebarItem.isCustom?p.push(u.sidebarItem):d.push(u.sidebarItem);return[...d,...p]}function a(d){var u;const p=`custom:${d}`;return(u=n.value.get(p))==null?void 0:u.definition}async function i(d){const p=a(d.customType);if(!p)return'<div style="color: #6c757d; padding: 16px; text-align: center; border: 1px dashed #dee2e6; border-radius: 4px; font-family: sans-serif; font-size: 14px;">Block definition not found</div>';const{Liquid:u}=await Promise.resolve().then(()=>OB);return await new u({strictVariables:!1,strictFilters:!1}).parseAndRender(p.template,d.fieldValues)}function c(d){return n.value.has(d)}return{registerBuiltIn:t,registerCustom:e,getComponent:o,createBlock:s,getSidebarItems:r,getDefinition:a,renderCustomBlock:i,isRegistered:c}}function e2(n){const{onBlockMove:t,onBlockAdd:e}=n,o=l.ref(!1),s=l.ref(null),r=l.ref(null);function a(u){o.value=!0,s.value=u}function i(){o.value=!1,s.value=null,r.value=null}function c(u){r.value=u}function d(u,f,h,m){if(!s.value)return;u.findIndex(v=>v.id===s.value.id)===-1?e(s.value,h,m):t(s.value.id,f,h,m),i()}function p(u,f,h){return{group:u,animation:150,ghostClass:"tpl-ghost",dragClass:"tpl-drag",handle:".tpl-drag-handle",onStart:m=>{m.item.dataset.blockId&&(o.value=!0)},onEnd:()=>{i()},onAdd:m=>{const g=m.item.dataset.blockId;g&&t(g,m.newIndex,f,h)},onUpdate:m=>{const g=m.item.dataset.blockId;g&&t(g,m.newIndex,f,h)}}}return{isDragging:o,draggedBlock:s,dropTargetId:r,startDrag:a,endDrag:i,setDropTarget:c,handleDrop:d,getSortableOptions:p}}const vd=[{value:"Arial, sans-serif",label:"Arial"},{value:"Helvetica, sans-serif",label:"Helvetica"},{value:"Georgia, serif",label:"Georgia"},{value:"Times New Roman, serif",label:"Times New Roman"},{value:"Verdana, sans-serif",label:"Verdana"},{value:"Trebuchet MS, sans-serif",label:"Trebuchet MS"},{value:"Courier New, monospace",label:"Courier New"}],yd="Arial, sans-serif";function bd(n){const t=l.ref((n==null?void 0:n.customFonts)??[]),e=l.ref(!0),o=l.ref(!1),s=l.computed(()=>(n==null?void 0:n.defaultFallback)??yd);function r(h){e.value=h}const a=l.computed(()=>{const h=[...vd];if(!e.value)return h.sort((v,y)=>v.label.localeCompare(y.label));const m=t.value.map(v=>({value:v.name,label:v.name,isCustom:!0})),g=[...h,...m];return g.sort((v,y)=>v.label.localeCompare(y.label)),g});function i(h){return a.value.some(m=>m.label.toLowerCase()===h.toLowerCase()||m.value.toLowerCase().startsWith(h.toLowerCase()))}function c(h){return vd.some(m=>m.label.toLowerCase()===h.toLowerCase()||m.value.toLowerCase().startsWith(h.toLowerCase()))}function d(){if(n!=null&&n.defaultFont){if(!e.value&&!c(n.defaultFont))return yd;if(i(n.defaultFont)){const h=a.value.find(m=>m.label.toLowerCase()===n.defaultFont.toLowerCase()||m.value.toLowerCase().startsWith(n.defaultFont.toLowerCase()));if(h)return h.value}}return yd}const p=l.computed(()=>d());function u(h){const m=t.value.find(v=>v.name.toLowerCase()===h.toLowerCase());if(m){const v=m.fallback??s.value;return`'${m.name}', ${v}`}const g=vd.find(v=>v.label.toLowerCase()===h.toLowerCase()||v.value.toLowerCase().startsWith(h.toLowerCase()));return g?g.value:h.includes(",")?h:`${h}, ${s.value}`}async function f(){if(t.value.length===0){o.value=!0;return}const h=t.value.map(async m=>{try{if(document.querySelector(`link[href="${m.url}"]`))return;const v=document.createElement("link");v.rel="stylesheet",v.href=m.url,v.setAttribute("data-custom-font",m.name),await new Promise((y,k)=>{v.onload=()=>y(),v.onerror=()=>k(new Error(`Failed to load font: ${m.name}`)),document.head.appendChild(v)})}catch(g){console.warn(`Failed to load custom font "${m.name}":`,g)}});await Promise.allSettled(h),o.value=!0}return{fonts:a,defaultFont:p,defaultFallback:s,customFonts:t,customFontsEnabled:e,isLoaded:o,setCustomFontsEnabled:r,loadCustomFonts:f,getFontWithFallback:u,getDefaultFont:d}}const n2={class:"tpl:w-full"},o2={key:0,class:"tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4",style:{"border-color":"var(--tpl-warning)","background-color":"var(--tpl-warning-light)"}},l2={class:"tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},s2={key:1,class:"tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4",style:{"border-color":"var(--tpl-danger)","background-color":"var(--tpl-danger-light)"}},r2={class:"tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},a2={key:2,class:"tpl:relative"},i2=["innerHTML"],c2={key:0,class:"tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:rounded tpl:backdrop-blur-[2px]",style:{"background-color":"color-mix(in srgb, var(--tpl-bg) 80%, transparent)"}},ss=l.defineComponent({__name:"CustomBlock",props:{block:{},viewport:{}},emits:["fetchData"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.inject("blockRegistry"),a=l.ref(""),i=l.ref(!1),c=l.computed(()=>r==null?void 0:r.getDefinition(e.block.customType)),d=l.computed(()=>!!c.value),p=l.computed(()=>e.block),{isFetching:u,fetch:f,needsFetch:h,hasDataSource:m}=Rn.useDataSourceFetch({definition:c,block:p,onUpdate:(y,k)=>{o("fetchData",{fieldValues:y,dataSourceFetched:k})}});async function g(){if(r){i.value=!1;try{const y=await r.renderCustomBlock(e.block);y.includes("Template render error:")&&(i.value=!0),a.value=y}catch{i.value=!0,a.value=""}}}const v=$b(g,150);return l.onMounted(()=>{g()}),l.watch(()=>e.block.fieldValues,()=>{v()},{deep:!0}),(y,k)=>{var S,b,w;return l.openBlock(),l.createElementBlock("div",n2,[d.value?i.value?(l.openBlock(),l.createElementBlock("div",s2,[l.createVNode(l.unref(Ef),{size:24,style:{color:"var(--tpl-danger)"}}),l.createElementVNode("span",r2,l.toDisplayString(l.unref(s).customBlocks.renderError),1)])):(l.openBlock(),l.createElementBlock("div",a2,[l.createElementVNode("div",{innerHTML:a.value},null,8,i2),l.unref(m)&&l.unref(h)?(l.openBlock(),l.createElementBlock("div",c2,[l.unref(u)?(l.openBlock(),l.createBlock(Wa,{key:1,class:"tpl:w-48"})):(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:shadow-sm tpl:transition-all tpl:duration-150 hover:tpl:border-[var(--tpl-primary)] hover:tpl:shadow-md",style:{"background-color":"var(--tpl-primary-light)",color:"var(--tpl-primary-hover)"},onClick:k[0]||(k[0]=l.withModifiers((...x)=>l.unref(f)&&l.unref(f)(...x),["stop"]))},[(S=c.value)!=null&&S.icon?(l.openBlock(),l.createBlock(Zf,{key:0,icon:c.value.icon,size:16},null,8,["icon"])):l.createCommentVNode("",!0),l.createTextVNode(" "+l.toDisplayString(((w=(b=c.value)==null?void 0:b.dataSource)==null?void 0:w.label)||l.unref(s).customBlocks.dataSource.fetchButton),1)]))])):l.createCommentVNode("",!0)])):(l.openBlock(),l.createElementBlock("div",o2,[l.createVNode(l.unref(Ck),{size:24,style:{color:"var(--tpl-warning)"}}),l.createElementVNode("span",l2,l.toDisplayString(l.unref(s).customBlocks.definitionNotFound),1)]))])}}}),d2={class:"tpl:w-full"},ur=l.defineComponent({__name:"DividerBlock",props:{block:{},viewport:{}},setup(n){const t=n,e=l.computed(()=>({borderTop:`${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,width:t.block.width==="full"?"100%":`${t.block.width}px`,margin:t.block.width==="full"?"0":"0 auto"}));return(o,s)=>(l.openBlock(),l.createElementBlock("div",d2,[l.createElementVNode("hr",{class:"tpl:m-0 tpl:border-none",style:l.normalizeStyle(e.value)},null,4)]))}}),p2=["href"],u2=["src","alt"],f2=["src","alt"],h2={class:"tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium",style:{color:"var(--tpl-primary)",opacity:"0.7"}},m2=["href"],g2=["src","alt"],v2=["src","alt"],y2={key:3,class:"tpl:flex tpl:min-h-[100px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm",style:{"border-color":"var(--tpl-border-light)","background-color":"var(--tpl-bg-hover)",color:"var(--tpl-text-dim)"}},b2={key:1},fr=l.defineComponent({__name:"ImageBlock",props:{block:{},viewport:{}},emits:["update"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),{syntax:r}=jo(),a=l.inject("config"),i=l.computed(()=>!!(a!=null&&a.onRequestMedia));async function c(){var h;const f=await((h=a==null?void 0:a.onRequestMedia)==null?void 0:h.call(a));if(f){const m={src:f.url};f.alt&&(m.alt=f.alt),o("update",m)}}const d=l.computed(()=>({textAlign:e.block.align})),p=l.computed(()=>({maxWidth:"100%",width:e.block.width==="full"?"100%":`${e.block.width}px`,display:"block",margin:e.block.align==="center"?"0 auto":void 0,marginLeft:e.block.align==="right"?"auto":void 0})),u=l.computed(()=>yt.containsMergeTag(e.block.src,r));return(f,h)=>(l.openBlock(),l.createElementBlock("div",{class:"tpl:w-full",style:l.normalizeStyle(d.value)},[n.block.src&&u.value&&n.block.placeholderUrl?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[n.block.linkUrl?(l.openBlock(),l.createElementBlock("a",{key:0,href:n.block.linkUrl,target:"_blank",rel:"noopener noreferrer",onClick:h[0]||(h[0]=l.withModifiers(()=>{},["prevent"]))},[l.createElementVNode("img",{class:"tpl:border-0",src:n.block.placeholderUrl,alt:n.block.alt,style:l.normalizeStyle(p.value)},null,12,u2)],8,p2)):(l.openBlock(),l.createElementBlock("img",{key:1,class:"tpl:border-0",src:n.block.placeholderUrl,alt:n.block.alt,style:l.normalizeStyle(p.value)},null,12,f2))],64)):n.block.src&&u.value?(l.openBlock(),l.createElementBlock("div",{key:1,class:"tpl:!flex tpl:min-h-[120px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center",style:l.normalizeStyle([{"background-color":"var(--tpl-bg-elevated)","border-color":"color-mix(in srgb, var(--tpl-primary) 40%, transparent)"},p.value])},[l.createVNode(l.unref(gl),{size:32,"stroke-width":1.5,style:{color:"var(--tpl-primary)",opacity:"0.5"}}),l.createElementVNode("span",h2,l.toDisplayString(n.block.src),1)],4)):n.block.src?(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[n.block.linkUrl?(l.openBlock(),l.createElementBlock("a",{key:0,href:n.block.linkUrl,target:"_blank",rel:"noopener noreferrer",onClick:h[1]||(h[1]=l.withModifiers(()=>{},["prevent"]))},[l.createElementVNode("img",{class:"tpl:border-0",src:n.block.src,alt:n.block.alt,style:l.normalizeStyle(p.value)},null,12,g2)],8,m2)):(l.openBlock(),l.createElementBlock("img",{key:1,class:"tpl:border-0",src:n.block.src,alt:n.block.alt,style:l.normalizeStyle(p.value)},null,12,v2))],64)):(l.openBlock(),l.createElementBlock("div",y2,[i.value?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:cursor-pointer",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-primary)","background-color":"var(--tpl-bg)"},onClick:l.withModifiers(c,["stop"])},[l.createVNode(l.unref(gl),{size:14,"stroke-width":1.5}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).image.browseMedia),1)])):(l.openBlock(),l.createElementBlock("span",b2,l.toDisplayString(l.unref(s).image.clickToAdd),1))]))],4))}}),k2=["innerHTML"],hr=l.defineComponent({__name:"TextBlock",props:{block:{},viewport:{}},setup(n){const t=n,e=l.defineAsyncComponent(()=>Promise.resolve().then(()=>dO)),o=l.inject("mergeTags",[]),{syntax:s}=jo(),r=l.computed(()=>yt.resolveHtmlLogicMergeTagLabels(yt.resolveHtmlMergeTagLabels(t.block.content,o),s)),a=l.ref(!1),i=l.ref(null),c=l.ref({top:0,left:0});function d(){if(!i.value)return;const h=i.value.getBoundingClientRect();c.value={top:h.top-8,left:h.left}}const p=l.computed(()=>{const h={fontSize:`${t.block.fontSize}px`,color:t.block.color,textAlign:t.block.textAlign,fontWeight:t.block.fontWeight};return t.block.fontFamily&&(h.fontFamily=t.block.fontFamily),h});function u(){d(),a.value=!0}function f(){a.value=!1}return l.watchEffect(h=>{if(!a.value)return;const m=Ro(window,"scroll",d,!0),g=Ro(window,"resize",d);h(()=>{m(),g()})}),(h,m)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"textBlockRef",ref:i,class:"tpl:min-h-[1em] tpl:w-full",style:l.normalizeStyle(p.value),onDblclick:u},[a.value?(l.openBlock(),l.createBlock(l.unref(e),{key:0,block:n.block,"toolbar-position":c.value,onDone:f},null,8,["block","toolbar-position"])):(l.openBlock(),l.createElementBlock("div",{key:1,class:"tpl-text-content tpl:outline-none [&_a]:tpl:underline [&_li]:tpl:my-1 [&_ol]:tpl:my-2 [&_ol]:tpl:pl-6 [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0 [&_s]:tpl:line-through [&_sub]:tpl:align-sub [&_sub]:tpl:text-[0.75em] [&_sup]:tpl:align-super [&_sup]:tpl:text-[0.75em] [&_ul]:tpl:my-2 [&_ul]:tpl:pl-6",innerHTML:r.value},null,8,k2))],36))}}),x2={class:"tpl:w-full"},w2={class:"tpl:flex tpl:gap-0"},S2={key:0,class:"tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:text-xs",style:{color:"var(--tpl-text-dim)"}},qf=l.defineComponent({__name:"SectionBlock",props:{block:{},viewport:{}},setup(n){const t=n,{t:e}=jt(),o=l.inject("editor"),s=l.inject("conditionPreview"),r=l.inject("blockRegistry"),a=l.computed(()=>{switch(t.block.columns){case"2":return["50%","50%"];case"3":return["33.33%","33.33%","33.33%"];case"1-2":return["33.33%","66.67%"];case"2-1":return["66.67%","33.33%"];default:return["100%"]}}),i=l.computed(()=>{const f=a.value.length,h=[...t.block.children];for(;h.length<f;)h.push([]);return h.slice(0,f)});function c(f){return i.value[f]||[]}function d(f,h){const m=[...t.block.children];for(;m.length<=f;)m.push([]);m[f]=h,o.updateBlock(t.block.id,{children:m})}function p(f){if(r){const h=r.getComponent(f);if(h)return h}switch(f.type){case"text":return hr;case"image":return fr;case"button":return pr;case"divider":return ur;case"custom":return ss;default:return null}}function u(f,h){f.type==="custom"&&o.updateBlock(f.id,{fieldValues:h.fieldValues,dataSourceFetched:h.dataSourceFetched})}return(f,h)=>(l.openBlock(),l.createElementBlock("div",x2,[l.createElementVNode("div",w2,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(m,g)=>(l.openBlock(),l.createElementBlock("div",{key:g,class:l.normalizeClass(["tpl:relative tpl:min-h-[60px] tpl:rounded",c(g).length===0?"tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]":""]),style:l.normalizeStyle({width:a.value[g]})},[l.createVNode(l.unref(gd),{"model-value":c(g),group:{name:"blocks",pull:!0,put:(v,y,k)=>k.dataset.blockType!=="section"},"item-key":"id",animation:150,"ghost-class":"tpl-ghost","empty-insert-threshold":20,class:"tpl:min-h-[60px]","onUpdate:modelValue":v=>d(g,v)},{item:l.withCtx(({element:v})=>{var y;return[l.withDirectives(l.createElementVNode("div",null,[l.createVNode(Xf,{block:v,"is-selected":l.unref(o).state.selectedBlockId===v.id,viewport:n.viewport,onSelect:k=>l.unref(o).selectBlock(v.id)},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(p(v)),{block:v,viewport:n.viewport,onFetchData:k=>u(v,k)},null,40,["block","viewport","onFetchData"]))]),_:2},1032,["block","is-selected","viewport","onSelect"])],512),[[l.vShow,!((y=l.unref(s))!=null&&y.isHidden(v.id))]])]}),_:1},8,["model-value","group","onUpdate:modelValue"]),c(g).length===0?(l.openBlock(),l.createElementBlock("div",S2,[l.createElementVNode("span",null,l.toDisplayString(l.unref(e).section.dropHere),1)])):l.createCommentVNode("",!0)],6))),128))])]))}}),E2={class:"tpl:w-full"},C2={key:0,class:"tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",style:{"background-color":"var(--tpl-bg-hover)",color:"var(--tpl-text-dim)"}},Ka=l.defineComponent({__name:"SpacerBlock",props:{block:{},viewport:{}},setup(n){const t=n,e=l.inject("editor"),o=l.computed(()=>({height:`${t.block.height}px`,minHeight:`${t.block.height}px`,...e.state.previewMode?{}:{borderColor:"var(--tpl-border)"}}));return(s,r)=>(l.openBlock(),l.createElementBlock("div",E2,[l.createElementVNode("div",{style:l.normalizeStyle(o.value),class:l.normalizeClass(["tpl:relative tpl:flex tpl:items-center tpl:justify-center",{"tpl:border-y tpl:border-dashed":!l.unref(e).state.previewMode}])},[l.unref(e).state.previewMode?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",C2,l.toDisplayString(n.block.height)+"px ",1))],6)]))}}),T2={class:"tpl:w-full"},N2={class:"tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg-hover)"}},M2={key:0,class:"tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},B2={key:1,class:"tpl:text-sm",style:{color:"var(--tpl-text-dim)"}},_a=l.defineComponent({__name:"HtmlBlock",props:{block:{},viewport:{}},setup(n){const t=n,{t:e}=jt(),o=l.computed(()=>t.block.content.trim().length>0);return(s,r)=>(l.openBlock(),l.createElementBlock("div",T2,[l.createElementVNode("div",N2,[l.createVNode(l.unref(Xs),{size:24,style:{color:"var(--tpl-text-dim)"}}),o.value?(l.openBlock(),l.createElementBlock("span",M2,l.toDisplayString(l.unref(e).html.preview),1)):(l.openBlock(),l.createElementBlock("span",B2,l.toDisplayString(l.unref(e).html.empty),1))])]))}}),$f={facebook:{name:"Facebook",color:"#1877F2",path:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"},twitter:{name:"X",color:"#000000",path:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"},instagram:{name:"Instagram",color:"#E4405F",path:"M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"},linkedin:{name:"LinkedIn",color:"#0A66C2",path:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"},youtube:{name:"YouTube",color:"#FF0000",path:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},tiktok:{name:"TikTok",color:"#000000",path:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"},pinterest:{name:"Pinterest",color:"#BD081C",path:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738.098.119.112.224.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z"},email:{name:"Email",color:"#6B7280",path:"M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z"},whatsapp:{name:"WhatsApp",color:"#25D366",path:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"},telegram:{name:"Telegram",color:"#26A5E4",path:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"},discord:{name:"Discord",color:"#5865F2",path:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"},snapchat:{name:"Snapchat",color:"#FFFC00",path:"M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146 1.124.347 2.317.535 3.554.535 6.627 0 12.017-5.373 12.017-12.001C24.034 5.367 18.644 0 12.017 0z"},reddit:{name:"Reddit",color:"#FF4500",path:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"},github:{name:"GitHub",color:"#181717",path:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},dribbble:{name:"Dribbble",color:"#EA4C89",path:"M12 24C5.385 24 0 18.615 0 12S5.385 0 12 0s12 5.385 12 12-5.385 12-12 12zm10.12-10.358c-.35-.11-3.17-.953-6.384-.438 1.34 3.684 1.887 6.684 1.992 7.308 2.3-1.555 3.936-4.02 4.392-6.87zm-6.115 7.808c-.153-.9-.75-4.032-2.19-7.77l-.066.02c-5.79 2.015-7.86 6.025-8.04 6.4 1.73 1.358 3.92 2.166 6.29 2.166 1.42 0 2.77-.29 4-.814zm-11.62-2.58c.232-.4 3.045-5.055 8.332-6.765.135-.045.27-.084.405-.12-.26-.585-.54-1.167-.832-1.74C7.17 11.775 2.206 11.71 1.756 11.7l-.004.312c0 2.633.998 5.037 2.634 6.855zm-2.42-8.955c.46.008 4.683.026 9.477-1.248-1.698-3.018-3.53-5.558-3.8-5.928-2.868 1.35-5.01 3.99-5.676 7.17zM9.6 2.052c.282.38 2.145 2.914 3.822 6 3.645-1.365 5.19-3.44 5.373-3.702-1.81-1.61-4.19-2.586-6.795-2.586-.825 0-1.63.1-2.4.285zm10.335 3.483c-.218.29-1.935 2.493-5.724 4.04.24.49.47.985.68 1.486.08.18.15.36.22.53 3.41-.43 6.8.26 7.14.33-.02-2.42-.88-4.64-2.31-6.38z"},behance:{name:"Behance",color:"#1769FF",path:"M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"}},O2={small:24,medium:32,large:48},D2=["facebook","twitter","instagram","linkedin","youtube","tiktok","pinterest","email","whatsapp","telegram","discord","snapchat","reddit","github","dribbble","behance"],V2=["width","height","fill"],A2=["d"],I2=l.defineComponent({__name:"SocialIconSvg",props:{platform:{},iconStyle:{},iconSize:{}},setup(n){const t=n,e=l.computed(()=>$f[t.platform]),o=l.computed(()=>O2[t.iconSize]),s=l.computed(()=>{const i={display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${o.value}px`,height:`${o.value}px`};switch(t.iconStyle){case"solid":return{...i,backgroundColor:e.value.color,borderRadius:"4px"};case"outlined":return{...i,backgroundColor:"transparent",border:`2px solid ${e.value.color}`,borderRadius:"4px"};case"rounded":return{...i,backgroundColor:e.value.color,borderRadius:"8px"};case"square":return{...i,backgroundColor:e.value.color,borderRadius:"0"};case"circle":return{...i,backgroundColor:e.value.color,borderRadius:"50%"};default:return i}}),r=l.computed(()=>Math.floor(o.value*.6)),a=l.computed(()=>t.iconStyle==="outlined"?e.value.color:"#ffffff");return(i,c)=>(l.openBlock(),l.createElementBlock("span",{style:l.normalizeStyle(s.value)},[(l.openBlock(),l.createElementBlock("svg",{width:r.value,height:r.value,viewBox:"0 0 24 24",fill:a.value,xmlns:"http://www.w3.org/2000/svg"},[l.createElementVNode("path",{d:e.value.path},null,8,A2)],8,V2))],4))}}),R2={class:"tpl:w-full"},z2=["href"],P2={key:1,class:"tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-text-dim)"}},Ga=l.defineComponent({__name:"SocialIconsBlock",props:{block:{},viewport:{}},setup(n){const t=n,{t:e}=jt(),o=l.computed(()=>({display:"flex",flexWrap:"wrap",gap:`${t.block.spacing}px`,justifyContent:t.block.align==="left"?"flex-start":t.block.align==="right"?"flex-end":"center"})),s=l.computed(()=>t.block.icons.length>0);return(r,a)=>(l.openBlock(),l.createElementBlock("div",R2,[s.value?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle(o.value)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.block.icons,i=>(l.openBlock(),l.createElementBlock("a",{key:i.id,href:i.url||"#",class:"tpl:cursor-default",onClick:a[0]||(a[0]=l.withModifiers(()=>{},["prevent"]))},[l.createVNode(I2,{platform:i.platform,"icon-style":n.block.iconStyle,"icon-size":n.block.iconSize},null,8,["platform","icon-style","icon-size"])],8,z2))),128))],4)):(l.openBlock(),l.createElementBlock("div",P2,[l.createVNode(l.unref(Sa),{size:16}),l.createElementVNode("span",null,l.toDisplayString(l.unref(e).social.addIcons),1)]))]))}}),L2={class:"tpl:w-full"},F2=["href"],j2={key:1,class:"tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-text-dim)"}},Ja=l.defineComponent({__name:"MenuBlock",props:{block:{},viewport:{}},setup(n){const t=n,{t:e}=jt(),o=l.computed(()=>({display:"flex",flexWrap:"wrap",gap:`0 ${t.block.spacing}px`,justifyContent:t.block.textAlign==="left"?"flex-start":t.block.textAlign==="right"?"flex-end":"center",fontSize:`${t.block.fontSize}px`,fontFamily:t.block.fontFamily||"inherit",alignItems:"center"})),s=l.computed(()=>t.block.items.length>0);function r(a){return a||t.block.linkColor||t.block.color}return(a,i)=>(l.openBlock(),l.createElementBlock("div",L2,[s.value?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle(o.value)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.block.items,(c,d)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:c.id},[l.createElementVNode("a",{href:c.url||"#",class:"tpl:cursor-default tpl:no-underline",style:l.normalizeStyle({color:r(c.color),fontWeight:c.bold?"bold":"normal",textDecoration:c.underline?"underline":"none"}),onClick:i[0]||(i[0]=l.withModifiers(()=>{},["prevent"]))},l.toDisplayString(c.text||"..."),13,F2),d<n.block.items.length-1?(l.openBlock(),l.createElementBlock("span",{key:0,style:l.normalizeStyle({color:n.block.separatorColor,padding:`0 ${n.block.spacing}px`})},l.toDisplayString(n.block.separator),5)):l.createCommentVNode("",!0)],64))),128))],4)):(l.openBlock(),l.createElementBlock("div",j2,[l.createVNode(l.unref(xa),{size:16}),l.createElementVNode("span",null,l.toDisplayString(l.unref(e).menu.addLinks),1)]))]))}}),H2={class:"tpl:w-full"},U2={key:0},W2=["data-placeholder","onBlur","textContent"],K2=["data-placeholder","onBlur","textContent"],_2={key:1,class:"tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-text-dim)"}},Ya=Re(l.defineComponent({__name:"TableBlock",props:{block:{},viewport:{}},setup(n){const t=n,{t:e}=jt(),o=l.inject("editor"),s=l.computed(()=>t.block.rows.length>0),r=l.computed(()=>({width:"100%",borderCollapse:"collapse",fontSize:`${t.block.fontSize}px`,color:t.block.color,textAlign:t.block.textAlign,fontFamily:t.block.fontFamily||"inherit"})),a=l.computed(()=>({border:`${t.block.borderWidth}px solid ${t.block.borderColor}`,padding:`${t.block.cellPadding}px`,textAlign:t.block.textAlign})),i=l.computed(()=>({...a.value,fontWeight:"bold",backgroundColor:t.block.headerBackgroundColor||"transparent"})),c=l.computed(()=>t.block.hasHeaderRow&&t.block.rows.length>0?t.block.rows[0]:null),d=l.computed(()=>t.block.hasHeaderRow?t.block.rows.slice(1):t.block.rows);function p(){o.selectBlock(t.block.id)}function u(f,h,m){const v=m.target.innerText.trim(),y=t.block.rows.map(k=>k.id!==f?k:{...k,cells:k.cells.map(S=>S.id===h?{...S,content:v}:S)});o.updateBlock(t.block.id,{rows:y})}return(f,h)=>(l.openBlock(),l.createElementBlock("div",H2,[s.value?(l.openBlock(),l.createElementBlock("table",{key:0,style:l.normalizeStyle(r.value),class:"tpl-table-editable"},[c.value?(l.openBlock(),l.createElementBlock("thead",U2,[l.createElementVNode("tr",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value.cells,m=>(l.openBlock(),l.createElementBlock("th",{key:m.id,style:l.normalizeStyle(i.value),contenteditable:"true","data-placeholder":l.unref(e).table.cellPlaceholder,onBlur:g=>u(c.value.id,m.id,g),onKeydown:h[0]||(h[0]=l.withKeys(l.withModifiers(g=>g.target.blur(),["prevent"]),["enter"])),onClick:l.withModifiers(p,["stop"]),textContent:l.toDisplayString(m.content)},null,44,W2))),128))])])):l.createCommentVNode("",!0),l.createElementVNode("tbody",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.value,m=>(l.openBlock(),l.createElementBlock("tr",{key:m.id},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.cells,g=>(l.openBlock(),l.createElementBlock("td",{key:g.id,style:l.normalizeStyle(a.value),contenteditable:"true","data-placeholder":l.unref(e).table.cellPlaceholder,onBlur:v=>u(m.id,g.id,v),onKeydown:h[1]||(h[1]=l.withKeys(l.withModifiers(v=>v.target.blur(),["prevent"]),["enter"])),onClick:l.withModifiers(p,["stop"]),textContent:l.toDisplayString(g.content)},null,44,K2))),128))]))),128))])],4)):(l.openBlock(),l.createElementBlock("div",_2,[l.createVNode(l.unref(Ea),{size:16}),l.createElementVNode("span",null,l.toDisplayString(l.unref(e).table.empty),1)]))]))}}),[["__scopeId","data-v-6afc698d"]]);function G2(n){if(!n)return{platform:"unknown",videoId:null,thumbnailUrl:null};const t=[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/,/youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/];for(const s of t){const r=n.match(s);if(r){const a=r[1];return{platform:"youtube",videoId:a,thumbnailUrl:`https://img.youtube.com/vi/${a}/maxresdefault.jpg`}}}const e=/vimeo\.com\/(?:video\/)?(\d+)/,o=n.match(e);if(o){const s=o[1];return{platform:"vimeo",videoId:s,thumbnailUrl:`https://vumbnail.com/${s}.jpg`}}return{platform:"unknown",videoId:null,thumbnailUrl:null}}function J2(n,t){return t||G2(n).thumbnailUrl}const Y2=["src","alt"],X2={class:"tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30"},Z2={class:"tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-white/90 tpl:shadow-lg"},Q2={class:"tpl:ml-1",style:{color:"var(--tpl-danger)"},width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor"},q2={class:"tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium",style:{color:"var(--tpl-primary)",opacity:"0.7"}},$2=["href"],tw=["src","alt"],ew={class:"tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30 tpl:transition-opacity tpl:group-hover:bg-black/40"},nw={class:"tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-white/90 tpl:shadow-lg"},ow={class:"tpl:ml-1",style:{color:"var(--tpl-danger)"},width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor"},lw=["src","alt"],sw={class:"tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30"},rw={class:"tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-white/90 tpl:shadow-lg"},aw={class:"tpl:ml-1",style:{color:"var(--tpl-danger)"},width:"28",height:"28",viewBox:"0 0 24 24",fill:"currentColor"},iw={key:3,class:"tpl:flex tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm",style:{"border-color":"var(--tpl-border-light)","background-color":"var(--tpl-bg-hover)",color:"var(--tpl-text-dim)"}},Xa=l.defineComponent({__name:"VideoBlock",props:{block:{},viewport:{}},setup(n){const t=n,{t:e}=jt(),{syntax:o}=jo(),s=l.computed(()=>yt.containsMergeTag(t.block.url,o)||yt.containsMergeTag(t.block.thumbnailUrl,o)),r=l.computed(()=>s.value?null:J2(t.block.url,t.block.thumbnailUrl)),a=l.computed(()=>({textAlign:t.block.align})),i=l.computed(()=>({maxWidth:"100%",width:t.block.width==="full"?"100%":`${t.block.width}px`,display:"block",margin:t.block.align==="center"?"0 auto":void 0,marginLeft:t.block.align==="right"?"auto":void 0})),c=l.computed(()=>yt.containsMergeTag(t.block.url,o)?t.block.url:t.block.thumbnailUrl);return(d,p)=>(l.openBlock(),l.createElementBlock("div",{class:"tpl:w-full",style:l.normalizeStyle(a.value)},[s.value&&n.block.placeholderUrl?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tpl:relative tpl:inline-block",style:l.normalizeStyle(i.value)},[l.createElementVNode("img",{class:"tpl:w-full tpl:border-0",src:n.block.placeholderUrl,alt:n.block.alt},null,8,Y2),l.createElementVNode("div",X2,[l.createElementVNode("div",Z2,[(l.openBlock(),l.createElementBlock("svg",Q2,[...p[1]||(p[1]=[l.createElementVNode("polygon",{points:"5,3 19,12 5,21"},null,-1)])]))])])],4)):s.value?(l.openBlock(),l.createElementBlock("div",{key:1,class:"tpl:relative tpl:!flex tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center",style:l.normalizeStyle([{"background-color":"var(--tpl-bg-elevated)","border-color":"color-mix(in srgb, var(--tpl-primary) 40%, transparent)"},i.value])},[l.createVNode(l.unref(Cf),{size:36,"stroke-width":1.5,style:{color:"var(--tpl-primary)",opacity:"0.5"}}),l.createElementVNode("span",q2,l.toDisplayString(c.value),1)],4)):r.value?(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[n.block.url?(l.openBlock(),l.createElementBlock("a",{key:0,href:n.block.url,target:"_blank",rel:"noopener noreferrer",class:"tpl:group tpl:relative tpl:inline-block",style:l.normalizeStyle(i.value),onClick:p[0]||(p[0]=l.withModifiers(()=>{},["prevent"]))},[l.createElementVNode("img",{class:"tpl:w-full tpl:border-0",src:r.value,alt:n.block.alt},null,8,tw),l.createElementVNode("div",ew,[l.createElementVNode("div",nw,[(l.openBlock(),l.createElementBlock("svg",ow,[...p[2]||(p[2]=[l.createElementVNode("polygon",{points:"5,3 19,12 5,21"},null,-1)])]))])])],12,$2)):(l.openBlock(),l.createElementBlock("div",{key:1,class:"tpl:relative tpl:inline-block",style:l.normalizeStyle(i.value)},[l.createElementVNode("img",{class:"tpl:w-full tpl:border-0",src:r.value,alt:n.block.alt},null,8,lw),l.createElementVNode("div",sw,[l.createElementVNode("div",rw,[(l.openBlock(),l.createElementBlock("svg",aw,[...p[3]||(p[3]=[l.createElementVNode("polygon",{points:"5,3 19,12 5,21"},null,-1)])]))])])],4))],64)):(l.openBlock(),l.createElementBlock("div",iw,[l.createVNode(l.unref(Cf),{size:40,"stroke-width":1.5,style:{color:"var(--tpl-border-light)"}}),l.createElementVNode("span",null,l.toDisplayString(l.unref(e).video.addVideo),1)]))],4))}}),cw={class:"tpl:relative"},dw={class:"tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold",style:{"background-color":"rgba(255, 255, 255, 0.3)"}},pw={key:0,class:"tpl-canvas-empty tpl:m-6 tpl:flex tpl:min-h-[400px] tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-xl tpl:border-2 tpl:border-dashed tpl:px-10 tpl:py-12 tpl:text-center",style:{"border-color":"var(--tpl-border-light)","background-color":"var(--tpl-bg-elevated)","font-family":"var(--tpl-font-family)"}},uw={class:"tpl-canvas-empty-icon tpl:mb-4",style:{color:"var(--tpl-border-light)"}},fw={class:"tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold",style:{color:"var(--tpl-text-muted)"}},hw={class:"tpl-canvas-empty-text tpl:m-0 tpl:text-sm",style:{color:"var(--tpl-text-dim)"}},mw={key:0,class:"tpl:m-0 tpl:mt-2 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm",style:{color:"var(--tpl-text-dim)"}},gw={key:1,class:"tpl:m-0 tpl:mt-4 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm",style:{color:"var(--tpl-text-dim)"}},th=Re(l.defineComponent({__name:"Canvas",props:{viewport:{},content:{},selectedBlockId:{},darkMode:{type:Boolean},previewMode:{type:Boolean},lockedBlocks:{}},emits:["select-block","open-ai-chat","open-design-reference"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.inject("editor"),a=l.inject("conditionPreview"),i=l.inject("blockRegistry",void 0),c=l.inject("planConfig",null),d=l.inject("aiConfig",null),p=l.computed(()=>(c==null?void 0:c.hasFeature("ai_generation"))??!1),u=l.computed(()=>p.value&&(d==null?void 0:d.isFeatureEnabled("chat"))),f=l.computed(()=>p.value&&(d==null?void 0:d.isFeatureEnabled("designToTemplate"))),h=l.computed({get:()=>e.content.blocks,set:w=>{r.setContent({...e.content,blocks:w})}}),m=l.computed(()=>{switch(e.viewport){case"mobile":return 375;case"tablet":return 768;default:return e.content.settings.width}}),g=l.computed(()=>({backgroundColor:e.content.settings.backgroundColor,fontFamily:e.content.settings.fontFamily,filter:e.darkMode?"invert(1) hue-rotate(180deg)":"none",transition:"filter 300ms ease"}));function v(w){e.previewMode||w.target===w.currentTarget&&o("select-block",null)}function y(w){if(i){const x=i.getComponent(w);if(x)return x}switch(w.type){case"section":return qf;case"text":return hr;case"image":return fr;case"button":return pr;case"divider":return ur;case"spacer":return Ka;case"html":return _a;case"social":return Ga;case"menu":return Ja;case"table":return Ya;case"video":return Xa;case"custom":return ss;default:return null}}function k(w){var x;return(x=e.lockedBlocks)==null?void 0:x.get(w)}function S(w){var x;return((x=e.lockedBlocks)==null?void 0:x.has(w))??!1}function b(w,x){w.type==="custom"&&r.updateBlock(w.id,{fieldValues:x.fieldValues,dataSourceFetched:x.dataSourceFetched})}return(w,x)=>(l.openBlock(),l.createElementBlock("div",{class:"tpl-canvas-wrapper tpl:rounded-lg tpl:bg-white tpl:transition-[width] tpl:duration-300",style:l.normalizeStyle([{"box-shadow":"var(--tpl-shadow-xl)","transition-timing-function":"cubic-bezier(0.34, 1.56, 0.64, 1)"},{width:`${m.value}px`}])},[l.createElementVNode("div",{class:l.normalizeClass(["tpl-canvas tpl:min-h-[500px] tpl:rounded-lg",{"tpl-canvas--dark-mode":n.darkMode,"tpl-preview-mode":n.previewMode}]),style:l.normalizeStyle(g.value),onClick:v},[l.createVNode(l.unref(gd),{modelValue:h.value,"onUpdate:modelValue":x[2]||(x[2]=E=>h.value=E),group:"blocks","item-key":"id",animation:150,"ghost-class":"tpl-ghost","drag-class":"tpl-dragging",handle:".tpl-block-btn","invert-swap":!0,"inverted-swap-threshold":.65,disabled:n.previewMode,class:"tpl-canvas-blocks tpl:min-h-[500px]"},{item:l.withCtx(({element:E})=>{var B;return[l.withDirectives(l.createElementVNode("div",null,[l.createElementVNode("div",cw,[S(E.id)?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",style:l.normalizeStyle({outline:`2px solid ${k(E.id).color}`,outlineOffset:"-1px"})},[l.createElementVNode("span",{class:"tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:flex tpl:-translate-x-1/2 tpl:-translate-y-full tpl:items-center tpl:gap-1 tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:text-white tpl:whitespace-nowrap",style:l.normalizeStyle({backgroundColor:k(E.id).color})},[l.createElementVNode("span",dw,l.toDisplayString(k(E.id).name.charAt(0)),1),l.createTextVNode(" "+l.toDisplayString(k(E.id).name),1)],4)],4)):l.createCommentVNode("",!0),l.createVNode(Xf,{block:E,"is-selected":!n.previewMode&&n.selectedBlockId===E.id&&!S(E.id),viewport:n.viewport,"preview-mode":n.previewMode,onSelect:C=>n.previewMode||S(E.id)?void 0:o("select-block",E.id)},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(y(E)),{block:E,viewport:n.viewport,onFetchData:C=>b(E,C),onUpdate:C=>l.unref(r).updateBlock(E.id,C)},null,40,["block","viewport","onFetchData","onUpdate"]))]),_:2},1032,["block","is-selected","viewport","preview-mode","onSelect"])])],512),[[l.vShow,!((B=l.unref(a))!=null&&B.isHidden(E.id))]])]}),footer:l.withCtx(()=>[h.value.length===0&&!n.previewMode?(l.openBlock(),l.createElementBlock("div",pw,[l.createElementVNode("div",uw,[l.createVNode(l.unref(Ik),{size:48,"stroke-width":1})]),l.createElementVNode("p",fw,l.toDisplayString(l.unref(s).canvas.noBlocks),1),l.createElementVNode("p",hw,l.toDisplayString(l.unref(s).canvas.dragHint),1),u.value?(l.openBlock(),l.createElementBlock("p",mw,[l.createTextVNode(l.toDisplayString(l.unref(s).canvas.aiHintChat)+" ",1),l.createElementVNode("button",{class:"tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150",style:{"background-color":"var(--tpl-primary-light)",color:"var(--tpl-primary-hover)"},onClick:x[0]||(x[0]=E=>o("open-ai-chat"))},[l.createVNode(l.unref(vl),{size:14,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).aiMenu.aiAssistant),1)]),l.createTextVNode(" "+l.toDisplayString(l.unref(s).canvas.aiHintChatSuffix),1)])):l.createCommentVNode("",!0),f.value?(l.openBlock(),l.createElementBlock("p",gw,[l.createTextVNode(l.toDisplayString(l.unref(s).canvas.aiHintDesign)+" ",1),l.createElementVNode("button",{class:"tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150",style:{"background-color":"var(--tpl-primary-light)",color:"var(--tpl-primary-hover)"},onClick:x[1]||(x[1]=E=>o("open-design-reference"))},[l.createVNode(l.unref(ba),{size:14,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).aiMenu.designToTemplate),1)]),l.createTextVNode(" "+l.toDisplayString(l.unref(s).canvas.aiHintDesignSuffix),1)])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","disabled"])],6)],4))}}),[["__scopeId","data-v-f2b97c8b"]]),vw={key:0,class:"tpl:border-b tpl:px-1 tpl:pb-1",style:{"border-color":"var(--tpl-border)"}},yw={key:0,class:"tpl:flex-1 tpl:truncate tpl:text-sm tpl:font-medium"},bw={key:1,class:"tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",style:{"background-color":"var(--tpl-bg-hover)",color:"var(--tpl-text-muted)"}},kw={class:"tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:scale-105"},xw={key:0,class:"tpl:truncate tpl:text-sm tpl:font-medium"},eh=l.defineComponent({__name:"Sidebar",setup(n){const{t}=jt(),e=l.inject("customBlockDefinitions",[]),o=l.inject("blockDefaults",void 0),s=l.inject("savedModules",null),r=l.inject("planConfig",null),a=l.computed(()=>!!s&&!!(r!=null&&r.hasFeature("saved_modules"))),i=l.ref(!1),c=l.computed(()=>[{type:"section",label:t.blocks.section},{type:"image",label:t.blocks.image},{type:"text",label:t.blocks.text},{type:"button",label:t.blocks.button},{type:"divider",label:t.blocks.divider},{type:"video",label:t.blocks.video},{type:"social",label:t.blocks.social},{type:"menu",label:t.blocks.menu},{type:"table",label:t.blocks.table},{type:"spacer",label:t.blocks.spacer},{type:"html",label:t.blocks.html}]),d=l.computed(()=>e.map(f=>({type:`custom:${f.type}`,label:f.name,isCustom:!0,icon:f.icon}))),p=l.computed(()=>[...c.value,...d.value]);function u(f){if(f.isCustom){const h=f.type.replace("custom:",""),m=e.find(g=>g.type===h);if(m)return yt.createCustomBlock(m)}return yt.createBlock(f.type,o)}return(f,h)=>(l.openBlock(),l.createElementBlock("aside",{class:"tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:overflow-hidden",style:l.normalizeStyle({width:i.value?"200px":"48px",backgroundColor:"var(--tpl-bg-elevated)",borderRight:"1px solid var(--tpl-border)",boxShadow:i.value?"var(--tpl-shadow-lg)":"none",transition:"width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)"}),onMouseenter:h[1]||(h[1]=m=>i.value=!0),onMouseleave:h[2]||(h[2]=m=>i.value=!1),onFocusin:h[3]||(h[3]=m=>i.value=!0),onFocusout:h[4]||(h[4]=m=>i.value=!1)},[a.value&&l.unref(s).headless.modules.value.length>0?(l.openBlock(),l.createElementBlock("div",vw,[l.createElementVNode("div",{class:"tpl:flex tpl:h-10 tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)]",style:l.normalizeStyle({justifyContent:i.value?"flex-start":"center"}),onClick:h[0]||(h[0]=m=>l.unref(s).openBrowserModal())},[l.createVNode(l.unref(Gc),{size:20,"stroke-width":1.5,class:"tpl:shrink-0"}),i.value?(l.openBlock(),l.createElementBlock("span",yw,l.toDisplayString(l.unref(t).modules.title),1)):l.createCommentVNode("",!0),i.value?(l.openBlock(),l.createElementBlock("span",bw,l.toDisplayString(l.unref(s).headless.modules.value.length),1)):l.createCommentVNode("",!0)],4)])):l.createCommentVNode("",!0),l.createVNode(l.unref(gd),{list:p.value,group:{name:"blocks",pull:"clone",put:!1},clone:u,sort:!1,"item-key":"type",animation:150,"ghost-class":"tpl-ghost",class:"tpl:flex tpl:flex-col tpl:gap-0.5 tpl:p-1"},{item:l.withCtx(({element:m})=>[l.createElementVNode("div",{class:"tpl:flex tpl:h-10 tpl:cursor-grab tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] active:tpl:cursor-grabbing",style:l.normalizeStyle({justifyContent:i.value?"flex-start":"center"})},[l.createElementVNode("div",kw,[m.type==="image"?(l.openBlock(),l.createBlock(l.unref(gl),{key:0,size:20,"stroke-width":1.5})):m.type==="text"?(l.openBlock(),l.createBlock(l.unref(Zc),{key:1,size:20,"stroke-width":1.5})):m.type==="button"?(l.openBlock(),l.createBlock(l.unref(Jc),{key:2,size:20,"stroke-width":1.5})):m.type==="divider"?(l.openBlock(),l.createBlock(l.unref(po),{key:3,size:20,"stroke-width":1.5})):m.type==="video"?(l.openBlock(),l.createBlock(l.unref(kf),{key:4,size:20,"stroke-width":1.5})):m.type==="section"?(l.openBlock(),l.createBlock(l.unref(Uc),{key:5,size:20,"stroke-width":1.5})):m.type==="social"?(l.openBlock(),l.createBlock(l.unref(Sa),{key:6,size:20,"stroke-width":1.5})):m.type==="menu"?(l.openBlock(),l.createBlock(l.unref(xa),{key:7,size:20,"stroke-width":1.5})):m.type==="table"?(l.openBlock(),l.createBlock(l.unref(Ea),{key:8,size:20,"stroke-width":1.5})):m.type==="spacer"?(l.openBlock(),l.createBlock(l.unref(_c),{key:9,size:20,"stroke-width":1.5})):m.type==="html"?(l.openBlock(),l.createBlock(l.unref(Xs),{key:10,size:20,"stroke-width":1.5})):m.isCustom?(l.openBlock(),l.createBlock(Zf,{key:11,icon:m.icon,size:20},null,8,["icon"])):l.createCommentVNode("",!0)]),i.value?(l.openBlock(),l.createElementBlock("span",xw,l.toDisplayString(m.label),1)):l.createCommentVNode("",!0)],4)]),_:1},8,["list"])],36))}}),mt="tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",Ee="tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)] placeholder:tpl:text-[var(--tpl-text-dim)]",vn="tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-l-[var(--tpl-radius-sm)] tpl:rounded-r-none tpl:border-r-0 tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)] placeholder:tpl:text-[var(--tpl-text-dim)]",yn="tpl:flex tpl:items-center tpl:px-2.5 tpl:text-xs tpl:border tpl:border-l-0 tpl:text-[var(--tpl-text-dim)] tpl:bg-[var(--tpl-bg-hover)] tpl:border-[var(--tpl-border)] tpl:rounded-r-[var(--tpl-radius-sm)]",ww="tpl:flex-1 tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-mono tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]",kd="tpl:rounded-[var(--tpl-radius)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-4 tpl:border tpl:border-[var(--tpl-border)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)]",mr=(n,t=0,e=1)=>n>e?e:n<t?t:n,Ce=(n,t=0,e=Math.pow(10,t))=>Math.round(e*n)/e,Sw=n=>Mw(xd(n)),xd=n=>(n[0]==="#"&&(n=n.substring(1)),n.length<6?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?Ce(parseInt(n[3]+n[3],16)/255,2):1}:{r:parseInt(n.substring(0,2),16),g:parseInt(n.substring(2,4),16),b:parseInt(n.substring(4,6),16),a:n.length===8?Ce(parseInt(n.substring(6,8),16)/255,2):1}),Ew=n=>Nw(Tw(n)),Cw=({h:n,s:t,v:e,a:o})=>{const s=(200-t)*e/100;return{h:Ce(n),s:Ce(s>0&&s<200?t*e/100/(s<=100?s:200-s)*100:0),l:Ce(s/2),a:Ce(o,2)}},wd=n=>{const{h:t,s:e,l:o}=Cw(n);return`hsl(${t}, ${e}%, ${o}%)`},Tw=({h:n,s:t,v:e,a:o})=>{n=n/360*6,t=t/100,e=e/100;const s=Math.floor(n),r=e*(1-t),a=e*(1-(n-s)*t),i=e*(1-(1-n+s)*t),c=s%6;return{r:Ce([e,a,r,r,i,e][c]*255),g:Ce([i,e,e,a,r,r][c]*255),b:Ce([r,r,i,e,e,a][c]*255),a:Ce(o,2)}},Za=n=>{const t=n.toString(16);return t.length<2?"0"+t:t},Nw=({r:n,g:t,b:e,a:o})=>{const s=o<1?Za(Ce(o*255)):"";return"#"+Za(n)+Za(t)+Za(e)+s},Mw=({r:n,g:t,b:e,a:o})=>{const s=Math.max(n,t,e),r=s-Math.min(n,t,e),a=r?s===n?(t-e)/r:s===t?2+(e-n)/r:4+(n-t)/r:0;return{h:Ce(60*(a<0?a+6:a)),s:Ce(s?r/s*100:0),v:Ce(s/255*100),a:o}},nh=(n,t)=>{if(n===t)return!0;for(const e in n)if(n[e]!==t[e])return!1;return!0},Bw=(n,t)=>n.toLowerCase()===t.toLowerCase()?!0:nh(xd(n),xd(t)),oh={},lh=n=>{let t=oh[n];return t||(t=document.createElement("template"),t.innerHTML=n,oh[n]=t),t},Sd=(n,t,e)=>{n.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))};let rs=!1;const Ed=n=>"touches"in n,Ow=n=>rs&&!Ed(n)?!1:(rs||(rs=Ed(n)),!0),sh=(n,t)=>{const e=Ed(t)?t.touches[0]:t,o=n.el.getBoundingClientRect();Sd(n.el,"move",n.getMove({x:mr((e.pageX-(o.left+window.pageXOffset))/o.width),y:mr((e.pageY-(o.top+window.pageYOffset))/o.height)}))},Dw=(n,t)=>{const e=t.keyCode;e>40||n.xy&&e<37||e<33||(t.preventDefault(),Sd(n.el,"move",n.getMove({x:e===39?.01:e===37?-.01:e===34?.05:e===33?-.05:e===35?1:e===36?-1:0,y:e===40?.01:e===38?-.01:0},!0)))};class rh{constructor(t,e,o,s){const r=lh(`<div role="slider" tabindex="0" part="${e}" ${o}><div part="${e}-pointer"></div></div>`);t.appendChild(r.content.cloneNode(!0));const a=t.querySelector(`[part=${e}]`);a.addEventListener("mousedown",this),a.addEventListener("touchstart",this),a.addEventListener("keydown",this),this.el=a,this.xy=s,this.nodes=[a.firstChild,a]}set dragging(t){const e=t?document.addEventListener:document.removeEventListener;e(rs?"touchmove":"mousemove",this),e(rs?"touchend":"mouseup",this)}handleEvent(t){switch(t.type){case"mousedown":case"touchstart":if(t.preventDefault(),!Ow(t)||!rs&&t.button!=0)return;this.el.focus(),sh(this,t),this.dragging=!0;break;case"mousemove":case"touchmove":t.preventDefault(),sh(this,t);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":Dw(this,t);break}}style(t){t.forEach((e,o)=>{for(const s in e)this.nodes[o].style.setProperty(s,e[s])})}}class Vw extends rh{constructor(t){super(t,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:t}){this.h=t,this.style([{left:`${t/360*100}%`,color:wd({h:t,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Ce(t)}`)}getMove(t,e){return{h:e?mr(this.h+t.x*360,0,360):360*t.x}}}class Aw extends rh{constructor(t){super(t,"saturation",'aria-label="Color"',!0)}update(t){this.hsva=t,this.style([{top:`${100-t.v}%`,left:`${t.s}%`,color:wd(t)},{"background-color":wd({h:t.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Ce(t.s)}%, Brightness ${Ce(t.v)}%`)}getMove(t,e){return{s:e?mr(this.hsva.s+t.x*100,0,100):t.x*100,v:e?mr(this.hsva.v-t.y*100,0,100):Math.round(100-t.y*100)}}}const Iw=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',Rw="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}",zw="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}",Qa=Symbol("same"),Cd=Symbol("color"),ah=Symbol("hsva"),Td=Symbol("update"),ih=Symbol("parts"),ch=Symbol("css"),dh=Symbol("sliders");class Pw extends HTMLElement{static get observedAttributes(){return["color"]}get[ch](){return[Iw,Rw,zw]}get[dh](){return[Aw,Vw]}get color(){return this[Cd]}set color(t){if(!this[Qa](t)){const e=this.colorModel.toHsva(t);this[Td](e),this[Cd]=t}}constructor(){super();const t=lh(`<style>${this[ch].join("")}</style>`),e=this.attachShadow({mode:"open"});e.appendChild(t.content.cloneNode(!0)),e.addEventListener("move",this),this[ih]=this[dh].map(o=>new o(e))}connectedCallback(){if(this.hasOwnProperty("color")){const t=this.color;delete this.color,this.color=t}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(t,e,o){const s=this.colorModel.fromAttr(o);this[Qa](s)||(this.color=s)}handleEvent(t){const e=this[ah],o={...e,...t.detail};this[Td](o);let s;!nh(o,e)&&!this[Qa](s=this.colorModel.fromHsva(o))&&(this[Cd]=s,Sd(this,"color-changed",{value:s}))}[Qa](t){return this.color&&this.colorModel.equal(t,this.color)}[Td](t){this[ah]=t,this[ih].forEach(e=>e.update(t))}}const Lw={defaultColor:"#000",toHsva:Sw,fromHsva:({h:n,s:t,v:e})=>Ew({h:n,s:t,v:e,a:1}),equal:Bw,fromAttr:n=>n};class Fw extends Pw{get colorModel(){return Lw}}class jw extends Fw{}customElements.define("hex-color-picker",jw);const Hw=["disabled"],Uw=["value","placeholder","disabled"],Xe=l.defineComponent({__name:"ColorPicker",props:{modelValue:{},placeholder:{default:"#000000"},size:{default:"default"},swatchOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,o=t,s=l.ref(!1),r=l.ref(),a=l.ref();Hc(r,()=>{s.value=!1},{ignore:[a]});const i=l.ref(e.modelValue||"#000000");l.watch(()=>e.modelValue,p=>{i.value=p||"#000000"});function c(p){const u=p.detail.value;i.value=u,o("update:modelValue",u)}function d(p){const u=p.target.value;i.value=u,o("update:modelValue",u)}return(p,u)=>{const f=l.resolveComponent("hex-color-picker");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["tpl:flex tpl:gap-2 tpl:relative",n.disabled&&"tpl:opacity-60 tpl:cursor-not-allowed"])},[l.createElementVNode("button",{ref_key:"swatchRef",ref:a,type:"button",disabled:n.disabled,class:l.normalizeClass(["tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",n.disabled?"tpl:cursor-not-allowed":"tpl:cursor-pointer",s.value?"tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]":!n.disabled&&"hover:tpl:border-[var(--tpl-text-dim)]",n.size==="large"?"tpl:size-12":"tpl:size-10"]),onClick:u[0]||(u[0]=h=>!n.disabled&&(s.value=!s.value))},[l.createElementVNode("span",{class:"tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]",style:l.normalizeStyle({backgroundColor:i.value})},null,4)],10,Hw),n.swatchOnly?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",{key:0,type:"text",class:l.normalizeClass(l.unref(ww)),value:n.modelValue,placeholder:n.placeholder,disabled:n.disabled,onInput:d},null,42,Uw)),l.createVNode(l.Transition,{"enter-active-class":"tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]","enter-from-class":"tpl:opacity-0 tpl:scale-95 tpl:translate-y-1","enter-to-class":"tpl:opacity-100 tpl:scale-100 tpl:translate-y-0","leave-active-class":"tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]","leave-from-class":"tpl:opacity-100 tpl:scale-100 tpl:translate-y-0","leave-to-class":"tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"},{default:l.withCtx(()=>[s.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:r,class:"tpl:absolute tpl:left-0 tpl:top-full tpl:z-50 tpl:mt-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg"},[l.createVNode(f,{color:i.value,onColorChanged:c},null,8,["color"])],512)):l.createCommentVNode("",!0)]),_:1})],2)}}}),Ww={key:0},Kw=["data-tooltip"],_w=["data-tooltip"],Gw={key:2,class:"tpl:text-sm tpl:text-[var(--tpl-text)]"},Jw=["title"],Yw=["title","disabled"],Xw={key:1},Zw=["value","placeholder","rows"],Qw=["title","disabled"],qw="tpl:w-full tpl:resize-y tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]",$w="tpl:flex tpl:w-full tpl:min-h-[5rem] tpl:cursor-pointer tpl:items-start tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",ph="tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]",uh=l.defineComponent({__name:"MergeTagTextarea",props:{modelValue:{},placeholder:{default:""},rows:{default:3}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),{isEnabled:r,isRequesting:a,isMergeTagValue:i,getMergeTagLabel:c,requestMergeTag:d,syntax:p}=jo(),u=l.ref(!1),f=l.ref(null);let h=!1;const m=l.computed(()=>{const w=e.modelValue;if(!w)return[];const x=[],E=`(${p.value.source}|${p.logic.source})`,B=new RegExp(E,"g");let C=0,D;for(;(D=B.exec(w))!==null;){D.index>C&&x.push({type:"text",value:w.slice(C,D.index)});const R=D[0];i(R)?x.push({type:"mergeTag",value:R,label:c(R)}):yt.isLogicMergeTagValue(R,p)?x.push({type:"logicMergeTag",value:R,keyword:yt.getLogicMergeTagKeyword(R,p)}):x.push({type:"text",value:R}),C=D.index+R.length}return C<w.length&&x.push({type:"text",value:w.slice(C)}),x}),g=l.computed(()=>m.value.some(w=>w.type==="mergeTag"||w.type==="logicMergeTag"));function v(){u.value=!0,l.nextTick(()=>{var x,E,B;(x=f.value)==null||x.focus();const w=((E=e.modelValue)==null?void 0:E.length)||0;(B=f.value)==null||B.setSelectionRange(w,w)})}function y(){h||(u.value=!1)}function k(w){o("update:modelValue",w.target.value)}function S(){o("update:modelValue","")}async function b(){const w=u.value&&f.value?f.value.selectionStart??e.modelValue.length:e.modelValue.length;h=!0;const x=await d();if(h=!1,x){const E=e.modelValue.slice(0,w),B=e.modelValue.slice(w),C=E+x.value+B;o("update:modelValue",C),u.value=!0,l.nextTick(()=>{var R,N;const D=w+x.value.length;(R=f.value)==null||R.focus(),(N=f.value)==null||N.setSelectionRange(D,D)})}}return(w,x)=>g.value&&!u.value?(l.openBlock(),l.createElementBlock("div",Ww,[l.createElementVNode("div",{class:l.normalizeClass($w),onClick:v},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.value,(E,B)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:B},[E.type==="mergeTag"?(l.openBlock(),l.createElementBlock("span",{key:0,class:"tpl-tooltip tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium","data-tooltip":E.value,style:{"background-color":`color-mix(
451
+ in srgb,
452
+ var(--tpl-primary) 20%,
453
+ transparent
454
+ )`,color:"var(--tpl-primary)"}},l.toDisplayString(E.label),9,Kw)):E.type==="logicMergeTag"?(l.openBlock(),l.createElementBlock("span",{key:1,class:"tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase","data-tooltip":E.value,style:{"background-color":"transparent",border:`1.5px solid
455
+ color-mix(in srgb, var(--tpl-primary) 50%, transparent)`,color:"var(--tpl-primary)"}},l.toDisplayString(E.keyword),9,_w)):(l.openBlock(),l.createElementBlock("span",Gw,l.toDisplayString(E.value),1))],64))),128)),l.createElementVNode("button",{type:"button",class:"tpl:ml-auto tpl:flex tpl:size-4 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all hover:tpl:text-[var(--tpl-danger)] hover:tpl:opacity-100",title:l.unref(s).mergeTag.remove,onClick:l.withModifiers(S,["stop"])},[l.createVNode(l.unref(hn),{size:10,"stroke-width":3})],8,Jw)]),l.unref(r)?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass([ph,"tpl:mt-1.5"]),title:l.unref(s).mergeTag.insert,disabled:l.unref(a),onClick:b},[l.createVNode(l.unref(Zs),{size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).mergeTag.insert),1)],8,Yw)):l.createCommentVNode("",!0)])):(l.openBlock(),l.createElementBlock("div",Xw,[l.createElementVNode("textarea",{ref_key:"textareaRef",ref:f,class:l.normalizeClass(qw),value:n.modelValue,placeholder:n.placeholder,rows:n.rows,onInput:k,onBlur:y},null,40,Zw),l.unref(r)?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass([ph,"tpl:mt-1.5"]),title:l.unref(s).mergeTag.insert,disabled:l.unref(a),onClick:b},[l.createVNode(l.unref(Zs),{size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).mergeTag.insert),1)],8,Qw)):l.createCommentVNode("",!0)]))}}),tS={class:"tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"},eS={class:"tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4"},nS={class:"tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"},oS={class:"tpl:mb-3.5"},lS={class:"tpl:grid tpl:grid-cols-4 tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",style:{"background-color":"var(--tpl-bg-hover)"}},sS=["onClick"],rS={class:"tpl:flex tpl:items-stretch"},aS=["value"],iS={class:"tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"},cS={class:"tpl:mb-3.5"},dS=["value"],pS=["value"],uS={class:"tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"},fS={class:"tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2"},hS={class:"tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]"},mS={class:"tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]"},gS={class:"tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3"},vS={class:"tpl:mb-2.5 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text-muted)]"},yS={class:"tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]"},bS={class:"tpl:mb-1 tpl:last:mb-0"},kS={class:"tpl:mb-1 tpl:last:mb-0"},xS={class:"tpl:mb-1 tpl:last:mb-0"},wS=150,SS=l.defineComponent({__name:"TemplateSettings",props:{settings:{}},emits:["update"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.inject("fontsManager"),a=l.computed(()=>r.fonts.value),i=l.computed(()=>a.value.some(p=>p.value===e.settings.fontFamily)?e.settings.fontFamily:r.defaultFont.value),c=[{value:480,label:"480px"},{value:600,label:"600px"},{value:700,label:"700px"},{value:800,label:"800px"}];return(d,p)=>(l.openBlock(),l.createElementBlock("aside",tS,[l.createElementVNode("div",eS,[l.createElementVNode("div",{class:l.normalizeClass(l.unref(kd))},[l.createElementVNode("div",nS,[l.createVNode(l.unref(Rk),{class:"tpl:text-[var(--tpl-text-muted)]",size:14,"stroke-width":2}),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).templateSettings.layout),1)]),l.createElementVNode("div",oS,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).templateSettings.widthPreset),3),l.createElementVNode("div",lS,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(c,u=>l.createElementVNode("button",{key:u.value,class:"tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",style:l.normalizeStyle({backgroundColor:n.settings.width===u.value?"var(--tpl-bg)":"transparent",color:n.settings.width===u.value?"var(--tpl-primary)":"var(--tpl-text-muted)",boxShadow:n.settings.width===u.value?"var(--tpl-shadow)":"none"}),onClick:f=>o("update",{width:u.value})},l.toDisplayString(u.label),13,sS)),64))])]),l.createElementVNode("div",null,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).templateSettings.customWidth),3),l.createElementVNode("div",rS,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.settings.width,min:"300",max:"900",onInput:p[0]||(p[0]=u=>o("update",{width:Number(u.target.value)}))},null,42,aS),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])])],2),l.createElementVNode("div",{class:l.normalizeClass(l.unref(kd))},[l.createElementVNode("div",iS,[l.createVNode(l.unref(fk),{class:"tpl:text-[var(--tpl-text-muted)]",size:14,"stroke-width":2}),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).templateSettings.appearance),1)]),l.createElementVNode("div",cS,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).templateSettings.backgroundColor),3),l.createVNode(Xe,{"model-value":n.settings.backgroundColor,placeholder:"#ffffff","onUpdate:modelValue":p[1]||(p[1]=u=>o("update",{backgroundColor:u}))},null,8,["model-value"])]),l.createElementVNode("div",null,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).templateSettings.fontFamily),3),l.createElementVNode("select",{class:l.normalizeClass(l.unref(Ee)),value:i.value,onChange:p[2]||(p[2]=u=>o("update",{fontFamily:u.target.value}))},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,u=>(l.openBlock(),l.createElementBlock("option",{key:u.value,value:u.value},l.toDisplayString(u.label),9,pS))),128))],42,dS)])],2),l.createElementVNode("div",{class:l.normalizeClass(l.unref(kd))},[l.createElementVNode("div",uS,[l.createVNode(l.unref(Wc),{class:"tpl:text-[var(--tpl-text-muted)]",size:14,"stroke-width":2}),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).templateSettings.preheaderText),1)]),l.createElementVNode("div",null,[l.createVNode(uh,{"model-value":n.settings.preheaderText??"",placeholder:l.unref(s).templateSettings.preheaderTextPlaceholder,rows:2,"onUpdate:modelValue":p[3]||(p[3]=u=>o("update",{preheaderText:u.replace(/[\r\n]/g," ")||void 0}))},null,8,["model-value","placeholder"]),l.createElementVNode("div",fS,[l.createElementVNode("span",hS,l.toDisplayString(l.unref(s).templateSettings.preheaderTextHint),1),l.createElementVNode("span",mS,l.toDisplayString((n.settings.preheaderText??"").length)+"/"+l.toDisplayString(wS),1)])])],2),l.createElementVNode("div",gS,[l.createElementVNode("div",vS,[l.createVNode(l.unref(Kc),{size:14,"stroke-width":2}),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).templateSettings.tips),1)]),l.createElementVNode("ul",yS,[l.createElementVNode("li",bS,l.toDisplayString(l.unref(s).templateSettings.tip1),1),l.createElementVNode("li",kS,l.toDisplayString(l.unref(s).templateSettings.tip2),1),l.createElementVNode("li",xS,l.toDisplayString(l.unref(s).templateSettings.tip3),1)])])])]))}}),ES=["title"],CS={class:"tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]"},TS={key:1,class:"tpl:text-[var(--tpl-danger)]"},NS=["aria-checked","disabled"],MS=l.defineComponent({__name:"BooleanField",props:{field:{},modelValue:{type:Boolean},readOnly:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:t}){const e=t,{t:o}=jt();return(s,r)=>(l.openBlock(),l.createElementBlock("div",{class:"tpl:mb-3.5",title:n.readOnly?l.unref(o).customBlocks.dataSource.readOnlyTooltip:void 0},[l.createElementVNode("label",{class:l.normalizeClass(["tpl:flex tpl:items-center tpl:justify-between tpl:gap-2",n.readOnly?"tpl:cursor-not-allowed":"tpl:cursor-pointer"])},[l.createElementVNode("span",CS,[l.createTextVNode(l.toDisplayString(n.field.label)+" ",1),n.readOnly?(l.openBlock(),l.createBlock(l.unref(co),{key:0,size:12,class:"tpl:inline tpl:text-[var(--tpl-text-dim)]"})):l.createCommentVNode("",!0),n.field.required?(l.openBlock(),l.createElementBlock("span",TS," * ")):l.createCommentVNode("",!0)]),l.createElementVNode("button",{type:"button",role:"switch","aria-checked":n.modelValue,class:l.normalizeClass(["tpl:relative tpl:inline-flex tpl:h-5 tpl:w-9 tpl:shrink-0 tpl:rounded-full tpl:border-2 tpl:border-transparent tpl:transition-colors tpl:duration-200",n.modelValue?"tpl:bg-[var(--tpl-primary)]":"tpl:bg-[var(--tpl-border)]",n.readOnly?"tpl:opacity-60 tpl:cursor-not-allowed":"tpl:cursor-pointer"]),disabled:n.readOnly,onClick:r[0]||(r[0]=a=>!n.readOnly&&e("update:modelValue",!n.modelValue))},[l.createElementVNode("span",{class:l.normalizeClass(["tpl:pointer-events-none tpl:inline-block tpl:size-4 tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:shadow tpl:transition-transform tpl:duration-200",n.modelValue?"tpl:translate-x-4":"tpl:translate-x-0"])},null,2)],10,NS)],2)],8,ES))}}),BS={class:"tpl:mb-3.5"},OS={key:1,class:"tpl:text-[var(--tpl-danger)]"},DS=l.defineComponent({__name:"ColorField",props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:t}){const e=t,{t:o}=jt();return(s,r)=>(l.openBlock(),l.createElementBlock("div",BS,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},[l.createTextVNode(l.toDisplayString(n.field.label)+" ",1),n.readOnly?(l.openBlock(),l.createBlock(l.unref(co),{key:0,size:12,class:"tpl:inline tpl:text-[var(--tpl-text-dim)]"})):l.createCommentVNode("",!0),n.field.required?(l.openBlock(),l.createElementBlock("span",OS," * ")):l.createCommentVNode("",!0)],2),l.createVNode(Xe,{"model-value":n.modelValue||"#000000",placeholder:n.field.placeholder||"#000000",disabled:n.readOnly,title:n.readOnly?l.unref(o).customBlocks.dataSource.readOnlyTooltip:void 0,"onUpdate:modelValue":r[0]||(r[0]=a=>e("update:modelValue",a))},null,8,["model-value","placeholder","disabled","title"])]))}}),VS={class:"tpl:mb-3.5"},AS={key:1,class:"tpl:text-[var(--tpl-danger)]"},IS=["value","placeholder","title"],RS=["value","placeholder"],zS=l.defineComponent({__name:"ImageField",props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:t}){const e=t,{t:o}=jt(),s=l.inject("config"),r=l.computed(()=>!!(s!=null&&s.onRequestMedia));async function a(){var c;const i=await((c=s==null?void 0:s.onRequestMedia)==null?void 0:c.call(s));i&&e("update:modelValue",i.url)}return(i,c)=>(l.openBlock(),l.createElementBlock("div",VS,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},[l.createTextVNode(l.toDisplayString(n.field.label)+" ",1),n.readOnly?(l.openBlock(),l.createBlock(l.unref(co),{key:0,size:12,class:"tpl:inline tpl:text-[var(--tpl-text-dim)]"})):l.createCommentVNode("",!0),n.field.required?(l.openBlock(),l.createElementBlock("span",AS," * ")):l.createCommentVNode("",!0)],2),n.readOnly?(l.openBlock(),l.createElementBlock("input",{key:0,type:"url",class:l.normalizeClass([l.unref(Ee),"tpl:opacity-60 tpl:cursor-not-allowed"]),value:n.modelValue,placeholder:n.field.placeholder||"https://...",disabled:"",title:l.unref(o).customBlocks.dataSource.readOnlyTooltip},null,10,IS)):(l.openBlock(),l.createElementBlock("input",{key:1,type:"url",class:l.normalizeClass(l.unref(Ee)),value:n.modelValue,placeholder:n.field.placeholder||"https://...",onInput:c[0]||(c[0]=d=>e("update:modelValue",d.target.value))},null,42,RS)),r.value&&!n.readOnly?(l.openBlock(),l.createElementBlock("button",{key:2,class:"tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-primary)","background-color":"var(--tpl-bg)"},onClick:c[1]||(c[1]=d=>a())},[l.createVNode(l.unref(gl),{size:14,"stroke-width":1.5}),l.createTextVNode(" "+l.toDisplayString(l.unref(o).image.browseMedia),1)])):l.createCommentVNode("",!0)]))}}),PS={class:"tpl:mb-3.5"},LS={key:1,class:"tpl:text-[var(--tpl-danger)]"},FS=["value","placeholder","min","max","step","disabled","title"],jS=l.defineComponent({__name:"NumberField",props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:t}){const e=t,{t:o}=jt();return(s,r)=>(l.openBlock(),l.createElementBlock("div",PS,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},[l.createTextVNode(l.toDisplayString(n.field.label)+" ",1),n.readOnly?(l.openBlock(),l.createBlock(l.unref(co),{key:0,size:12,class:"tpl:inline tpl:text-[var(--tpl-text-dim)]"})):l.createCommentVNode("",!0),n.field.required?(l.openBlock(),l.createElementBlock("span",LS," * ")):l.createCommentVNode("",!0)],2),l.createElementVNode("input",{type:"number",class:l.normalizeClass([l.unref(Ee),n.readOnly&&"tpl:opacity-60 tpl:cursor-not-allowed"]),value:n.modelValue,placeholder:n.field.placeholder,min:n.field.min,max:n.field.max,step:n.field.step,disabled:n.readOnly,title:n.readOnly?l.unref(o).customBlocks.dataSource.readOnlyTooltip:void 0,onInput:r[0]||(r[0]=a=>!n.readOnly&&e("update:modelValue",Number(a.target.value)))},null,42,FS)]))}}),HS={class:"tpl:mb-3.5"},US={key:1,class:"tpl:text-[var(--tpl-danger)]"},WS={class:"tpl:flex tpl:flex-col tpl:gap-2"},KS={class:"tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between"},_S={class:"tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]"},GS=["title","onClick"],JS={key:1,class:"tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"},YS=l.defineComponent({__name:"RepeatableField",props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.computed(()=>e.modelValue||[]),a=l.computed(()=>!e.field.maxItems||r.value.length<e.field.maxItems),i=l.computed(()=>!e.field.minItems||r.value.length>e.field.minItems);function c(){if(!a.value||e.readOnly)return;const u={};for(const f of e.field.fields)u[f.key]=f.default??"";o("update:modelValue",[...r.value,u])}function d(u){if(!i.value||e.readOnly)return;const f=[...r.value];f.splice(u,1),o("update:modelValue",f)}function p(u,f,h){const m=r.value.map((g,v)=>v===u?{...g,[f]:h}:g);o("update:modelValue",m)}return(u,f)=>(l.openBlock(),l.createElementBlock("div",HS,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},[l.createTextVNode(l.toDisplayString(n.field.label)+" ",1),n.readOnly?(l.openBlock(),l.createBlock(l.unref(co),{key:0,size:12,class:"tpl:inline tpl:text-[var(--tpl-text-dim)]"})):l.createCommentVNode("",!0),n.field.required?(l.openBlock(),l.createElementBlock("span",US," * ")):l.createCommentVNode("",!0)],2),l.createElementVNode("div",WS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,(h,m)=>(l.openBlock(),l.createElementBlock("div",{key:m,class:"tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"},[l.createElementVNode("div",KS,[l.createElementVNode("span",_S," #"+l.toDisplayString(m+1),1),i.value&&!n.readOnly?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:"tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",title:l.unref(s).customBlocks.fields.removeItem,onClick:g=>d(m)},[l.createVNode(l.unref(yl),{size:12,"stroke-width":2})],8,GS)):l.createCommentVNode("",!0)]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.field.fields,g=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(mh)(g.type)),{key:g.key,field:g,"model-value":h[g.key],"read-only":n.readOnly,"onUpdate:modelValue":v=>p(m,g.key,v)},null,8,["field","model-value","read-only","onUpdate:modelValue"]))),128))]))),128)),a.value&&!n.readOnly?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:"tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",onClick:c},[l.createVNode(l.unref(uo),{size:14,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).customBlocks.fields.addItem),1)])):l.createCommentVNode("",!0),!a.value&&!n.readOnly?(l.openBlock(),l.createElementBlock("p",JS,l.toDisplayString(l.unref(s).customBlocks.fields.maxItemsReached),1)):l.createCommentVNode("",!0)])]))}}),XS={class:"tpl:mb-3.5"},ZS={key:1,class:"tpl:text-[var(--tpl-danger)]"},QS=["value","disabled","title"],qS=["value"],$S=l.defineComponent({__name:"SelectField",props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:t}){const e=t,{t:o}=jt();return(s,r)=>(l.openBlock(),l.createElementBlock("div",XS,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},[l.createTextVNode(l.toDisplayString(n.field.label)+" ",1),n.readOnly?(l.openBlock(),l.createBlock(l.unref(co),{key:0,size:12,class:"tpl:inline tpl:text-[var(--tpl-text-dim)]"})):l.createCommentVNode("",!0),n.field.required?(l.openBlock(),l.createElementBlock("span",ZS," * ")):l.createCommentVNode("",!0)],2),l.createElementVNode("select",{class:l.normalizeClass([l.unref(Ee),n.readOnly&&"tpl:opacity-60 tpl:cursor-not-allowed"]),value:n.modelValue,disabled:n.readOnly,title:n.readOnly?l.unref(o).customBlocks.dataSource.readOnlyTooltip:void 0,onChange:r[0]||(r[0]=a=>!n.readOnly&&e("update:modelValue",a.target.value))},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.field.options,a=>(l.openBlock(),l.createElementBlock("option",{key:a.value,value:a.value},l.toDisplayString(a.label),9,qS))),128))],42,QS)]))}}),tE={key:0},eE=["data-tooltip"],nE=["data-tooltip"],oE={key:2,class:"tpl:text-sm tpl:text-[var(--tpl-text)]"},lE=["title"],sE=["title","disabled"],rE={key:1},aE=["type","value","placeholder"],iE=["title","disabled"],cE="tpl:flex tpl:w-full tpl:min-h-10 tpl:cursor-pointer tpl:items-center tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3.5 tpl:py-1.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",fh="tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]",Ho=Re(l.defineComponent({__name:"MergeTagInput",props:{modelValue:{},type:{default:"text"},placeholder:{default:""},pulse:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),{isEnabled:r,isRequesting:a,isMergeTagValue:i,getMergeTagLabel:c,requestMergeTag:d,syntax:p}=jo(),u=l.ref(!1),f=l.ref(null);let h=!1;const m=l.computed(()=>{const w=e.modelValue;if(!w)return[];const x=[],E=`(${p.value.source}|${p.logic.source})`,B=new RegExp(E,"g");let C=0,D;for(;(D=B.exec(w))!==null;){D.index>C&&x.push({type:"text",value:w.slice(C,D.index)});const R=D[0];i(R)?x.push({type:"mergeTag",value:R,label:c(R)}):yt.isLogicMergeTagValue(R,p)?x.push({type:"logicMergeTag",value:R,keyword:yt.getLogicMergeTagKeyword(R,p)}):x.push({type:"text",value:R}),C=D.index+R.length}return C<w.length&&x.push({type:"text",value:w.slice(C)}),x}),g=l.computed(()=>m.value.some(w=>w.type==="mergeTag"||w.type==="logicMergeTag"));function v(){u.value=!0,l.nextTick(()=>{var x,E,B;(x=f.value)==null||x.focus();const w=((E=e.modelValue)==null?void 0:E.length)||0;(B=f.value)==null||B.setSelectionRange(w,w)})}function y(){h||(u.value=!1)}function k(w){o("update:modelValue",w.target.value)}function S(){o("update:modelValue","")}async function b(){const w=u.value&&f.value?f.value.selectionStart??e.modelValue.length:e.modelValue.length;h=!0;const x=await d();if(h=!1,x){const E=e.modelValue.slice(0,w),B=e.modelValue.slice(w),C=E+x.value+B;o("update:modelValue",C),u.value=!0,l.nextTick(()=>{var R,N;const D=w+x.value.length;(R=f.value)==null||R.focus(),(N=f.value)==null||N.setSelectionRange(D,D)})}}return(w,x)=>g.value&&!u.value?(l.openBlock(),l.createElementBlock("div",tE,[l.createElementVNode("div",{class:l.normalizeClass([cE,{"tpl-pulse-fill":n.pulse}]),onClick:v},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.value,(E,B)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:B},[E.type==="mergeTag"?(l.openBlock(),l.createElementBlock("span",{key:0,class:"tpl-tooltip tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium","data-tooltip":E.value,style:{"background-color":`color-mix(
456
+ in srgb,
457
+ var(--tpl-primary) 20%,
458
+ transparent
459
+ )`,color:"var(--tpl-primary)"}},l.toDisplayString(E.label),9,eE)):E.type==="logicMergeTag"?(l.openBlock(),l.createElementBlock("span",{key:1,class:"tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase","data-tooltip":E.value,style:{"background-color":"transparent",border:`1.5px solid
460
+ color-mix(in srgb, var(--tpl-primary) 50%, transparent)`,color:"var(--tpl-primary)"}},l.toDisplayString(E.keyword),9,nE)):(l.openBlock(),l.createElementBlock("span",oE,l.toDisplayString(E.value),1))],64))),128)),l.createElementVNode("button",{type:"button",class:"tpl:ml-auto tpl:flex tpl:size-4 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all hover:tpl:text-[var(--tpl-danger)] hover:tpl:opacity-100",title:l.unref(s).mergeTag.remove,onClick:l.withModifiers(S,["stop"])},[l.createVNode(l.unref(hn),{size:10,"stroke-width":3})],8,lE)],2),l.unref(r)?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass([fh,"tpl:mt-1.5"]),title:l.unref(s).mergeTag.insert,disabled:l.unref(a),onClick:b},[l.createVNode(l.unref(Zs),{size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).mergeTag.insert),1)],8,sE)):l.createCommentVNode("",!0)])):(l.openBlock(),l.createElementBlock("div",rE,[l.createElementVNode("input",{ref_key:"inputRef",ref:f,type:n.type,class:l.normalizeClass([l.unref(Ee),{"tpl-pulse-fill":n.pulse}]),value:n.modelValue,placeholder:n.placeholder,onInput:k,onBlur:y},null,42,aE),l.unref(r)?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass([fh,"tpl:mt-1.5"]),title:l.unref(s).mergeTag.insert,disabled:l.unref(a),onClick:b},[l.createVNode(l.unref(Zs),{size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).mergeTag.insert),1)],8,iE)):l.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-093940a8"]]),dE={class:"tpl:mb-3.5"},pE={key:1,class:"tpl:text-[var(--tpl-danger)]"},uE=["value","placeholder","title"],hh=l.defineComponent({__name:"TextField",props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:t}){const e=t,{t:o}=jt();return(s,r)=>(l.openBlock(),l.createElementBlock("div",dE,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},[l.createTextVNode(l.toDisplayString(n.field.label)+" ",1),n.readOnly?(l.openBlock(),l.createBlock(l.unref(co),{key:0,size:12,class:"tpl:inline tpl:text-[var(--tpl-text-dim)]"})):l.createCommentVNode("",!0),n.field.required?(l.openBlock(),l.createElementBlock("span",pE," * ")):l.createCommentVNode("",!0)],2),n.readOnly?(l.openBlock(),l.createElementBlock("input",{key:0,type:"text",class:l.normalizeClass([l.unref(Ee),"tpl:opacity-60 tpl:cursor-not-allowed"]),value:n.modelValue,placeholder:n.field.placeholder,disabled:"",title:l.unref(o).customBlocks.dataSource.readOnlyTooltip},null,10,uE)):(l.openBlock(),l.createBlock(Ho,{key:1,"model-value":n.modelValue,placeholder:n.field.placeholder,"onUpdate:modelValue":r[0]||(r[0]=a=>e("update:modelValue",a))},null,8,["model-value","placeholder"]))]))}}),fE={class:"tpl:mb-3.5"},hE={key:1,class:"tpl:text-[var(--tpl-danger)]"},mE=["value","placeholder","title"],gE="tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:opacity-60 tpl:cursor-not-allowed",vE={text:hh,textarea:l.defineComponent({__name:"TextareaField",props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:t}){const e=t,{t:o}=jt();return(s,r)=>(l.openBlock(),l.createElementBlock("div",fE,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},[l.createTextVNode(l.toDisplayString(n.field.label)+" ",1),n.readOnly?(l.openBlock(),l.createBlock(l.unref(co),{key:0,size:12,class:"tpl:inline tpl:text-[var(--tpl-text-dim)]"})):l.createCommentVNode("",!0),n.field.required?(l.openBlock(),l.createElementBlock("span",hE," * ")):l.createCommentVNode("",!0)],2),n.readOnly?(l.openBlock(),l.createElementBlock("textarea",{key:0,value:n.modelValue,placeholder:n.field.placeholder,rows:"3",disabled:"",title:l.unref(o).customBlocks.dataSource.readOnlyTooltip,class:l.normalizeClass(gE)},null,8,mE)):(l.openBlock(),l.createBlock(uh,{key:1,"model-value":n.modelValue,placeholder:n.field.placeholder,"onUpdate:modelValue":r[0]||(r[0]=a=>e("update:modelValue",a))},null,8,["model-value","placeholder"]))]))}}),image:zS,color:DS,number:jS,select:$S,boolean:MS,repeatable:YS};function mh(n){return vE[n]??hh}const yE={key:0,class:"tpl:p-4"},bE={class:"tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]"},kE={key:1},xE={key:0,class:"tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"},wE={key:1,class:"tpl:mb-4"},SE={key:1,class:"tpl:flex tpl:h-[32px] tpl:items-center"},EE={key:0,class:"tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"},CE={key:2,class:"tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"},TE=l.defineComponent({__name:"CustomBlockToolbar",props:{block:{}},emits:["updateFieldValues","updateDataSourceFetched"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.inject("customBlockDefinitions",[]),a=l.computed(()=>r.find(g=>g.type===e.block.customType)),i=l.computed(()=>e.block),{isFetching:c,fetchError:d,fetch:p,hasDataSource:u,needsFetch:f}=Rn.useDataSourceFetch({definition:a,block:i,onUpdate:(g,v)=>{o("updateFieldValues",g),o("updateDataSourceFetched",v)}});function h(g){return g.readOnly===!0&&u.value&&!!e.block.dataSourceFetched}function m(g,v){o("updateFieldValues",{...e.block.fieldValues,[g]:v})}return(g,v)=>{var y,k;return a.value?(l.openBlock(),l.createElementBlock("div",kE,[a.value.description?(l.openBlock(),l.createElementBlock("p",xE,l.toDisplayString(a.value.description),1)):l.createCommentVNode("",!0),l.unref(u)?(l.openBlock(),l.createElementBlock("div",wE,[l.unref(f)&&!l.unref(c)?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:"tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-md tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150",style:{"background-color":"var(--tpl-primary)"},onClick:v[0]||(v[0]=(...S)=>l.unref(p)&&l.unref(p)(...S))},l.toDisplayString(((k=(y=a.value)==null?void 0:y.dataSource)==null?void 0:k.label)||l.unref(s).customBlocks.dataSource.fetchButton),1)):(l.openBlock(),l.createElementBlock("div",SE,[l.unref(c)?(l.openBlock(),l.createElementBlock("div",EE,l.toDisplayString(l.unref(s).customBlocks.dataSource.fetching),1)):(l.openBlock(),l.createElementBlock("button",{key:1,type:"button",class:"tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",onClick:v[1]||(v[1]=(...S)=>l.unref(p)&&l.unref(p)(...S))},[l.createVNode(l.unref(Yc),{size:12}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).customBlocks.dataSource.changeButton),1)]))])),l.unref(d)?(l.openBlock(),l.createElementBlock("p",CE,[l.createVNode(l.unref(ml),{size:14,class:"tpl:shrink-0"}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).customBlocks.dataSource.fetchError),1)])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value.fields,S=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(mh)(S.type)),{key:S.key,field:S,"model-value":n.block.fieldValues[S.key],"read-only":h(S),"onUpdate:modelValue":b=>m(S.key,b)},null,8,["field","model-value","read-only","onUpdate:modelValue"]))),128))])):(l.openBlock(),l.createElementBlock("div",yE,[l.createElementVNode("p",bE,l.toDisplayString(l.unref(s).customBlocks.toolbar.noDefinition),1)]))}}}),NE=["title","onClick"],ME={key:1},mo=l.defineComponent({__name:"SlidingPillSelect",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,o=t,s=l.computed(()=>{const r=e.options.findIndex(a=>a.value===e.modelValue);return`translateX(${Math.max(r,0)*100}%)`});return(r,a)=>(l.openBlock(),l.createElementBlock("div",{class:"tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",style:l.normalizeStyle({gridTemplateColumns:`repeat(${n.options.length}, 1fr)`,backgroundColor:"var(--tpl-bg-hover)"})},[l.createElementVNode("div",{class:"tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",style:l.normalizeStyle({left:"4px",width:`calc((100% - 8px) / ${n.options.length})`,transform:s.value,backgroundColor:"var(--tpl-bg)",boxShadow:"var(--tpl-shadow)",transition:"transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"})},null,4),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.options,i=>(l.openBlock(),l.createElementBlock("button",{key:i.value,class:"tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:py-[5px] tpl:text-xs tpl:font-medium",style:l.normalizeStyle({color:n.modelValue===i.value?"var(--tpl-primary)":"var(--tpl-text-muted)",transition:"color 120ms cubic-bezier(0.16, 1, 0.3, 1)"}),title:i.label,onClick:c=>o("update:modelValue",i.value)},[i.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.icon),{key:0,size:14,"stroke-width":2})):(l.openBlock(),l.createElementBlock("span",ME,l.toDisplayString(i.label),1))],12,NE))),128))],4))}}),BE={class:"spacing-control"},OE={class:"tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]"},DE={class:"tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5"},VE={class:"tpl:flex tpl:items-center"},AE=["value"],IE={class:"tpl:flex tpl:items-center tpl:gap-2"},RE={class:"tpl:flex tpl:items-center"},zE=["value"],PE=["title"],LE={class:"tpl:flex tpl:items-center"},FE=["value"],jE={class:"tpl:flex tpl:items-center"},HE=["value"],Uo="tpl:flex tpl:items-center tpl:justify-center tpl:w-8 tpl:h-8 tpl:text-[var(--tpl-text-muted)] tpl:bg-[var(--tpl-bg)] tpl:border tpl:border-[var(--tpl-border)] tpl:cursor-pointer tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)] active:tpl:bg-[var(--tpl-bg-active)]",qa="tpl:w-10 tpl:h-8 tpl:text-center tpl:text-xs tpl:font-medium tpl:border-y tpl:border-x-0 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]",gh=Re(l.defineComponent({__name:"SpacingControl",props:{modelValue:{},label:{}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.ref(e.modelValue.top===e.modelValue.right&&e.modelValue.right===e.modelValue.bottom&&e.modelValue.bottom===e.modelValue.left);l.watch(()=>e.modelValue,d=>{r.value&&(d.top===d.right&&d.right===d.bottom&&d.bottom===d.left||(r.value=!1))},{deep:!0});function a(d,p){const u=e.modelValue[d],f=Math.max(0,u+p);r.value?o("update:modelValue",{top:f,right:f,bottom:f,left:f}):o("update:modelValue",{...e.modelValue,[d]:f})}function i(d,p){const u=Math.max(0,p);r.value?o("update:modelValue",{top:u,right:u,bottom:u,left:u}):o("update:modelValue",{...e.modelValue,[d]:u})}function c(){if(r.value=!r.value,r.value){const d=e.modelValue.top;o("update:modelValue",{top:d,right:d,bottom:d,left:d})}}return(d,p)=>(l.openBlock(),l.createElementBlock("div",BE,[l.createElementVNode("label",OE,l.toDisplayString(n.label),1),l.createElementVNode("div",DE,[l.createElementVNode("div",VE,[l.createElementVNode("button",{class:l.normalizeClass([Uo,"tpl:rounded-l-[var(--tpl-radius-sm)]"]),onClick:p[0]||(p[0]=u=>a("top",-1))},[l.createVNode(l.unref(po),{size:12,"stroke-width":2})],2),l.createElementVNode("input",{type:"number",class:l.normalizeClass(qa),value:n.modelValue.top,min:"0",onInput:p[1]||(p[1]=u=>i("top",Number(u.target.value)))},null,40,AE),l.createElementVNode("button",{class:l.normalizeClass([Uo,"tpl:rounded-r-[var(--tpl-radius-sm)]"]),onClick:p[2]||(p[2]=u=>a("top",1))},[l.createVNode(l.unref(uo),{size:12,"stroke-width":2})],2)]),l.createElementVNode("div",IE,[l.createElementVNode("div",RE,[l.createElementVNode("button",{class:l.normalizeClass([Uo,"tpl:rounded-l-[var(--tpl-radius-sm)]"]),onClick:p[3]||(p[3]=u=>a("left",-1))},[l.createVNode(l.unref(po),{size:12,"stroke-width":2})],2),l.createElementVNode("input",{type:"number",class:l.normalizeClass(qa),value:n.modelValue.left,min:"0",onInput:p[4]||(p[4]=u=>i("left",Number(u.target.value)))},null,40,zE),l.createElementVNode("button",{class:l.normalizeClass([Uo,"tpl:rounded-r-[var(--tpl-radius-sm)]"]),onClick:p[5]||(p[5]=u=>a("left",1))},[l.createVNode(l.unref(uo),{size:12,"stroke-width":2})],2)]),l.createElementVNode("button",{class:l.normalizeClass(["tpl:flex tpl:h-8 tpl:w-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",r.value?"tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]":"tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] hover:tpl:bg-[var(--tpl-bg-hover)]"]),title:r.value?l.unref(s).spacingControl.unlock:l.unref(s).spacingControl.lockAll,onClick:c},[r.value?(l.openBlock(),l.createBlock(l.unref(co),{key:0,size:14,"stroke-width":2})):(l.openBlock(),l.createBlock(l.unref(wk),{key:1,size:14,"stroke-width":2}))],10,PE),l.createElementVNode("div",LE,[l.createElementVNode("button",{class:l.normalizeClass([Uo,"tpl:rounded-l-[var(--tpl-radius-sm)]"]),onClick:p[6]||(p[6]=u=>a("right",-1))},[l.createVNode(l.unref(po),{size:12,"stroke-width":2})],2),l.createElementVNode("input",{type:"number",class:l.normalizeClass(qa),value:n.modelValue.right,min:"0",onInput:p[7]||(p[7]=u=>i("right",Number(u.target.value)))},null,40,FE),l.createElementVNode("button",{class:l.normalizeClass([Uo,"tpl:rounded-r-[var(--tpl-radius-sm)]"]),onClick:p[8]||(p[8]=u=>a("right",1))},[l.createVNode(l.unref(uo),{size:12,"stroke-width":2})],2)])]),l.createElementVNode("div",jE,[l.createElementVNode("button",{class:l.normalizeClass([Uo,"tpl:rounded-l-[var(--tpl-radius-sm)]"]),onClick:p[9]||(p[9]=u=>a("bottom",-1))},[l.createVNode(l.unref(po),{size:12,"stroke-width":2})],2),l.createElementVNode("input",{type:"number",class:l.normalizeClass(qa),value:n.modelValue.bottom,min:"0",onInput:p[10]||(p[10]=u=>i("bottom",Number(u.target.value)))},null,40,HE),l.createElementVNode("button",{class:l.normalizeClass([Uo,"tpl:rounded-r-[var(--tpl-radius-sm)]"]),onClick:p[11]||(p[11]=u=>a("bottom",1))},[l.createVNode(l.unref(uo),{size:12,"stroke-width":2})],2)])])]))}}),[["__scopeId","data-v-8c3c7dc0"]]),UE={class:"tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"},WE={class:"tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5"},KE={class:"tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]"},_E={class:"tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"},GE={class:"tpl:flex tpl:gap-1"},JE=["title"],YE=["title"],XE={class:"tpl:flex-1 tpl:overflow-y-auto tpl:p-4"},ZE={key:1,class:"tpl:mb-3.5"},QE=["value"],qE=["value"],$E={class:"tpl:mb-3.5"},tC=["value"],eC={value:""},nC=["value"],oC={class:"tpl:mb-3.5"},lC={class:"tpl:flex tpl:items-stretch"},sC=["value"],rC={class:"tpl:mb-3.5"},aC={class:"tpl:mb-3.5"},iC={class:"tpl:mb-3.5"},cC={class:"tpl:mb-3.5"},dC={key:0,class:"tpl:mb-3.5"},pC=["value","placeholder"],uC={class:"tpl:mb-3.5"},fC={class:"tpl:mb-3.5"},hC=["value"],mC={value:"full"},gC={class:"tpl:mb-3.5"},vC={class:"tpl:mb-3.5"},yC={key:0,class:"tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"},bC=["checked"],kC={class:"tpl:mb-3.5"},xC=["value"],wC={value:""},SC=["value"],EC={class:"tpl:mb-3.5"},CC={class:"tpl:mb-3.5"},TC={key:0,class:"tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"},NC=["checked"],MC={class:"tpl:grid tpl:grid-cols-2 tpl:gap-3"},BC={class:"tpl:mb-3.5"},OC={class:"tpl:mb-3.5"},DC={class:"tpl:grid tpl:grid-cols-2 tpl:gap-3"},VC={class:"tpl:mb-3.5"},AC={class:"tpl:flex tpl:items-stretch"},IC=["value"],RC={class:"tpl:mb-3.5"},zC={class:"tpl:flex tpl:items-stretch"},PC=["value"],LC={class:"tpl:mb-3.5"},FC={class:"tpl:mb-3.5"},jC={class:"tpl:mb-3.5"},HC={class:"tpl:flex tpl:items-stretch"},UC=["value"],WC={class:"tpl:mb-3.5"},KC={class:"tpl:flex tpl:flex-col tpl:gap-2"},_C={class:"tpl:flex tpl:items-center tpl:gap-2"},GC=["value","onChange"],JC=["value"],YC=["title","onClick"],XC={class:"tpl:mb-3.5"},ZC={class:"tpl:mb-3.5"},QC={class:"tpl:mb-3.5"},qC={class:"tpl:flex tpl:items-stretch"},$C=["value"],tT={class:"tpl:mb-3.5"},eT={class:"tpl:mb-3.5"},nT={class:"tpl:flex tpl:flex-col tpl:gap-2"},oT={class:"tpl:flex tpl:items-center tpl:gap-2"},lT=["value","placeholder","onInput"],sT=["title","onClick"],rT={class:"tpl:flex tpl:items-center tpl:gap-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"},aT={class:"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1"},iT=["checked","onChange"],cT={class:"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1"},dT=["checked","onChange"],pT={class:"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1"},uT=["checked","onChange"],fT={class:"tpl:flex tpl:items-center tpl:gap-2"},hT={class:"tpl:text-xs tpl:text-[var(--tpl-text-muted)]"},mT={class:"tpl:mb-3.5"},gT=["value"],vT={value:""},yT=["value"],bT={class:"tpl:mb-3.5"},kT={class:"tpl:flex tpl:items-stretch"},xT=["value"],wT={class:"tpl:mb-3.5"},ST={class:"tpl:mb-3.5"},ET={class:"tpl:mb-3.5"},CT={class:"tpl:mb-3.5"},TT=["value"],NT={class:"tpl:mb-3.5"},MT={class:"tpl:mb-3.5"},BT={class:"tpl:flex tpl:items-stretch"},OT=["value"],DT={class:"tpl:mb-3.5"},VT={class:"tpl:flex tpl:items-center tpl:gap-3"},AT={class:"tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5"},IT={class:"tpl:text-xs tpl:text-[var(--tpl-text-muted)]"},RT={class:"tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]"},zT=["disabled"],PT={class:"tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]"},LT={class:"tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5"},FT={class:"tpl:text-xs tpl:text-[var(--tpl-text-muted)]"},jT={class:"tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]"},HT=["disabled"],UT={class:"tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]"},WT={class:"tpl:mb-3.5"},KT={class:"tpl:mb-1.5 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]"},_T=["checked"],GT={key:0,class:"tpl:mb-3.5"},JT={class:"tpl:mb-3.5"},YT={class:"tpl:mb-3.5"},XT={class:"tpl:flex tpl:items-stretch"},ZT=["value"],QT={class:"tpl:mb-3.5"},qT={class:"tpl:flex tpl:items-stretch"},$T=["value"],tN={class:"tpl:mb-3.5"},eN=["value"],nN={value:""},oN=["value"],lN={class:"tpl:mb-3.5"},sN={class:"tpl:flex tpl:items-stretch"},rN=["value"],aN={class:"tpl:mb-3.5"},iN={class:"tpl:mb-3.5"},cN={key:9,class:"tpl:mb-3.5"},dN={class:"tpl:flex tpl:items-stretch"},pN=["value"],uN=["value"],fN={key:10,class:"tpl:mb-3.5"},hN=["value"],mN={class:"tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]"},gN={class:"tpl:mt-4 tpl:flex tpl:flex-col"},vN={class:"tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3"},yN={class:"tpl:mt-3"},bN={class:"tpl:mt-4"},kN={class:"tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3"},xN={class:"tpl:mt-3"},wN={class:"tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3"},SN={class:"tpl:mt-3 tpl:space-y-2"},EN={class:"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]"},CN=["checked"],TN={class:"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]"},NN=["checked"],MN={class:"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]"},BN=["checked"],ON={class:"tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3"},DN={class:"tpl:mt-3"},VN=["value","placeholder"],AN={key:0,class:"tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3"},IN={class:"tpl:mt-3 tpl:space-y-2"},RN=["value"],zN={value:""},PN=["label"],LN=["value"],FN=["value"],jN={key:0,value:"__custom__"},HN={key:0,class:"tpl:space-y-2"},UN={class:"tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]"},WN={class:"tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]"},KN={class:"tpl:flex tpl:justify-end"},_N=["disabled"],GN={key:0,class:"tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]"},JN={class:"tpl:space-y-1"},YN={class:"tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]"},XN={key:0,class:"tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]"},ZN=Re(l.defineComponent({__name:"Toolbar",props:{block:{}},emits:["update","delete","duplicate"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt();l.inject("editor");const r=l.inject("config");l.inject("mergeTags",[]);const a=l.inject("mergeTagSyntax",yt.SYNTAX_PRESETS.liquid),i=l.inject("displayConditions",[]),c=l.inject("allowCustomConditions",!1),d=l.inject("customBlockDefinitions",[]),p=l.computed(()=>{var T;const F=(T=r==null?void 0:r.theme)==null?void 0:T.fonts;return F&&F.length>0?F.map(Y=>({value:typeof Y=="string"?Y:Y.name,label:typeof Y=="string"?Y:Y.name})):[{value:"Arial",label:"Arial"},{value:"Helvetica",label:"Helvetica"},{value:"Georgia",label:"Georgia"},{value:"Times New Roman",label:"Times New Roman"},{value:"Courier New",label:"Courier New"},{value:"Verdana",label:"Verdana"},{value:"Trebuchet MS",label:"Trebuchet MS"}]}),u=l.computed(()=>!!(r!=null&&r.onRequestMedia)),f=l.ref(!1),h=l.ref(!1),m=l.ref(!1),g=l.ref(!1),v=l.ref(!1),y=l.ref(!1),k=l.ref(!1),S=l.computed(()=>i.length>0||c),b=l.ref(!1),w=l.ref(""),x=l.ref(""),E=l.computed(()=>e.block.displayCondition?!i.some(F=>{var T;return F.label===((T=e.block.displayCondition)==null?void 0:T.label)}):!1);function B(){b.value=!0,E.value&&e.block.displayCondition?(w.value=e.block.displayCondition.before,x.value=e.block.displayCondition.after??""):(w.value="",x.value="")}function C(){w.value.trim()&&(o("update",{displayCondition:{label:s.blockSettings.customCondition,before:w.value.trim(),after:x.value.trim()}}),b.value=!1,w.value="",x.value="")}l.watch(()=>e.block.displayCondition,F=>{if(!F){b.value=!1,w.value="",x.value="";return}E.value&&(w.value=F.before,x.value=F.after??"")},{immediate:!0});const D=l.computed(()=>{const F={};for(const T of i){const Y=T.group??"";F[Y]||(F[Y]=[]),F[Y].push(T)}return F});async function R(){var T;const F=await((T=r==null?void 0:r.onRequestMedia)==null?void 0:T.call(r));F&&(O("src",F.url),F.alt&&O("alt",F.alt),f.value=!0,jc(()=>{f.value=!1},1e3))}const N=l.computed(()=>e.block.type),L=l.computed(()=>yt.isCustomBlock(e.block)),z=l.computed(()=>{if(L.value)return d.find(F=>F.type===e.block.customType)}),P=l.computed(()=>{var T;return L.value?((T=z.value)==null?void 0:T.name)??e.block.customType:{section:s.blocks.section,image:s.blocks.image,text:s.blocks.text,button:s.blocks.button,divider:s.blocks.divider,social:s.blocks.social,menu:s.blocks.menu,table:s.blocks.table,spacer:s.blocks.spacer,html:s.blocks.html}[N.value]||N.value}),U=l.computed(()=>{const F=e.block.rows;return F.length>0?F[0].cells.length:0});function O(F,T){o("update",{[F]:T})}function W(F,T){o("update",{styles:{...e.block.styles,[F]:T}})}const lt=l.computed(()=>[{value:"1",label:s.section.column1},{value:"2",label:s.section.column2},{value:"3",label:s.section.column3},{value:"1-2",label:s.section.ratio12},{value:"2-1",label:s.section.ratio21}]);function ht(){const F=e.block.icons,T={id:yt.generateId(),platform:"facebook",url:""};o("update",{icons:[...F,T]})}function gt(F,T,Y){const Ot=e.block.icons.map(pt=>pt.id===F?{...pt,[T]:Y}:pt);o("update",{icons:Ot})}function bt(F){const T=e.block.icons;o("update",{icons:T.filter(Y=>Y.id!==F)})}function Pt(){const F=e.block.items,T={id:yt.generateId(),text:"",url:"",openInNewTab:!1,bold:!1,underline:!1};o("update",{items:[...F,T]})}function Ct(F,T,Y){const Ot=e.block.items.map(pt=>pt.id===F?{...pt,[T]:Y}:pt);o("update",{items:Ot})}function Nt(F){const T=e.block.items;o("update",{items:T.filter(Y=>Y.id!==F)})}function St(){const F=e.block.rows,T=F.length>0?F[0].cells.length:3,Y={id:yt.generateId(),cells:Array.from({length:T},()=>({id:yt.generateId(),content:""}))};o("update",{rows:[...F,Y]})}function xt(F){const T=e.block.rows;o("update",{rows:T.filter(Y=>Y.id!==F)})}function K(){const T=e.block.rows.map(Y=>({...Y,cells:[...Y.cells,{id:yt.generateId(),content:""}]}));o("update",{rows:T})}function nt(F){const Y=e.block.rows.map(Bt=>({...Bt,cells:Bt.cells.filter((Ot,pt)=>pt!==F)}));o("update",{rows:Y})}return(F,T)=>{var Y,Bt,Ot,pt;return l.openBlock(),l.createElementBlock("aside",UE,[l.createElementVNode("div",WE,[l.createElementVNode("div",KE,[N.value==="section"?(l.openBlock(),l.createBlock(l.unref(Uc),{key:0,size:16,"stroke-width":1.5})):N.value==="text"?(l.openBlock(),l.createBlock(l.unref(Zc),{key:1,size:16,"stroke-width":1.5})):N.value==="image"?(l.openBlock(),l.createBlock(l.unref(gl),{key:2,size:16,"stroke-width":1.5})):N.value==="button"?(l.openBlock(),l.createBlock(l.unref(Jc),{key:3,size:16,"stroke-width":1.5})):N.value==="divider"?(l.openBlock(),l.createBlock(l.unref(po),{key:4,size:16,"stroke-width":1.5})):N.value==="social"?(l.openBlock(),l.createBlock(l.unref(Sa),{key:5,size:16,"stroke-width":1.5})):N.value==="menu"?(l.openBlock(),l.createBlock(l.unref(xa),{key:6,size:16,"stroke-width":1.5})):N.value==="table"?(l.openBlock(),l.createBlock(l.unref(Ea),{key:7,size:16,"stroke-width":1.5})):N.value==="spacer"?(l.openBlock(),l.createBlock(l.unref(_c),{key:8,size:16,"stroke-width":1.5})):N.value==="html"?(l.openBlock(),l.createBlock(l.unref(Xs),{key:9,size:16,"stroke-width":1.5})):L.value?(l.openBlock(),l.createBlock(l.unref(Xs),{key:10,size:16,"stroke-width":1.5})):l.createCommentVNode("",!0),l.createElementVNode("h3",_E,l.toDisplayString(P.value),1)]),l.createElementVNode("div",GE,[l.createElementVNode("button",{class:"tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)] tpl:hover:text-[var(--tpl-text)]",title:l.unref(s).toolbar.duplicate,onClick:T[0]||(T[0]=M=>o("duplicate"))},[l.createVNode(l.unref(mf),{size:14,"stroke-width":2})],8,JE),l.createElementVNode("button",{class:"tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",title:l.unref(s).toolbar.delete,onClick:T[1]||(T[1]=M=>o("delete"))},[l.createVNode(l.unref(yl),{size:14,"stroke-width":2})],8,YE)])]),l.createElementVNode("div",XE,[L.value?(l.openBlock(),l.createBlock(TE,{key:0,block:n.block,onUpdateFieldValues:T[2]||(T[2]=M=>o("update",{fieldValues:M})),onUpdateDataSourceFetched:T[3]||(T[3]=M=>o("update",{dataSourceFetched:M}))},null,8,["block"])):N.value==="section"?(l.openBlock(),l.createElementBlock("div",ZE,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).section.columns),3),l.createElementVNode("select",{class:l.normalizeClass(l.unref(Ee)),value:n.block.columns,onChange:T[4]||(T[4]=M=>O("columns",M.target.value))},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(lt.value,M=>(l.openBlock(),l.createElementBlock("option",{key:M.value,value:M.value},l.toDisplayString(M.label),9,qE))),128))],42,QE)])):N.value==="text"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[l.createElementVNode("div",$E,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).text.fontFamily),3),l.createElementVNode("select",{class:l.normalizeClass(l.unref(Ee)),value:n.block.fontFamily||"",onChange:T[5]||(T[5]=M=>O("fontFamily",M.target.value||void 0))},[l.createElementVNode("option",eC,l.toDisplayString(l.unref(s).text.inheritFont),1),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,M=>(l.openBlock(),l.createElementBlock("option",{key:M.value,value:M.value},l.toDisplayString(M.label),9,nC))),128))],42,tC)]),l.createElementVNode("div",oC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).text.fontSize),3),l.createElementVNode("div",lC,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.fontSize,min:"10",max:"72",onInput:T[6]||(T[6]=M=>O("fontSize",Number(M.target.value)))},null,42,sC),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])]),l.createElementVNode("div",rC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).text.color),3),l.createVNode(Xe,{"model-value":n.block.color,"onUpdate:modelValue":T[7]||(T[7]=M=>O("color",M))},null,8,["model-value"])]),l.createElementVNode("div",aC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).text.align),3),l.createVNode(mo,{options:[{value:"left",label:l.unref(s).text.alignLeft,icon:l.unref(Js)},{value:"center",label:l.unref(s).text.alignCenter,icon:l.unref(Gs)},{value:"right",label:l.unref(s).text.alignRight,icon:l.unref(Ys)}],"model-value":n.block.textAlign,"onUpdate:modelValue":T[8]||(T[8]=M=>O("textAlign",M))},null,8,["options","model-value"])]),l.createElementVNode("div",iC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).text.weight),3),l.createVNode(mo,{options:[{value:"normal",label:l.unref(s).text.normal},{value:"bold",label:l.unref(s).text.bold}],"model-value":n.block.fontWeight,"onUpdate:modelValue":T[9]||(T[9]=M=>O("fontWeight",M))},null,8,["options","model-value"])])],64)):N.value==="image"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:3},[l.createElementVNode("div",cC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).image.imageUrl),3),l.createVNode(Ho,{"model-value":n.block.src,type:"url",placeholder:l.unref(s).image.imageUrlPlaceholder,pulse:f.value,"onUpdate:modelValue":T[10]||(T[10]=M=>O("src",M))},null,8,["model-value","placeholder","pulse"]),u.value?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-primary)","background-color":"var(--tpl-bg)"},onClick:R},[l.createVNode(l.unref(gl),{size:14,"stroke-width":1.5}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).image.browseMedia),1)])):l.createCommentVNode("",!0)]),l.unref(yt.containsMergeTag)(n.block.src,l.unref(a))?(l.openBlock(),l.createElementBlock("div",dC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},[l.createTextVNode(l.toDisplayString(l.unref(s).image.placeholderUrl)+" ",1),T[69]||(T[69]=l.createElementVNode("span",{class:"tpl:font-normal tpl:text-[var(--tpl-text-dim)]"},l.toDisplayString("(optional)"),-1))],2),l.createElementVNode("input",{type:"url",class:l.normalizeClass(l.unref(Ee)),value:n.block.placeholderUrl||"",placeholder:l.unref(s).image.placeholderUrlPlaceholder,onInput:T[11]||(T[11]=M=>O("placeholderUrl",M.target.value))},null,42,pC)])):l.createCommentVNode("",!0),l.createElementVNode("div",uC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).image.altText),3),l.createVNode(Ho,{"model-value":n.block.alt,type:"text",placeholder:l.unref(s).image.altTextPlaceholder,pulse:h.value,"onUpdate:modelValue":T[12]||(T[12]=M=>O("alt",M))},null,8,["model-value","placeholder","pulse"])]),l.createElementVNode("div",fC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).image.width),3),l.createElementVNode("select",{class:l.normalizeClass(l.unref(Ee)),value:n.block.width,onChange:T[13]||(T[13]=M=>O("width",M.target.value==="full"?"full":Number(M.target.value)))},[l.createElementVNode("option",mC,l.toDisplayString(l.unref(s).image.fullWidth),1),T[70]||(T[70]=l.createElementVNode("option",{value:"300"},"300px",-1)),T[71]||(T[71]=l.createElementVNode("option",{value:"400"},"400px",-1)),T[72]||(T[72]=l.createElementVNode("option",{value:"500"},"500px",-1))],42,hC)]),l.createElementVNode("div",gC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).text.align),3),l.createVNode(mo,{options:[{value:"left",label:l.unref(s).text.alignLeft},{value:"center",label:l.unref(s).text.alignCenter},{value:"right",label:l.unref(s).text.alignRight}],"model-value":n.block.align,"onUpdate:modelValue":T[14]||(T[14]=M=>O("align",M))},null,8,["options","model-value"])]),l.createElementVNode("div",vC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).image.linkUrl),3),l.createVNode(Ho,{"model-value":n.block.linkUrl||"",type:"url",placeholder:l.unref(s).image.imageUrlPlaceholder,"onUpdate:modelValue":T[15]||(T[15]=M=>O("linkUrl",M))},null,8,["model-value","placeholder"]),n.block.linkUrl?(l.openBlock(),l.createElementBlock("label",yC,[l.createElementVNode("input",{type:"checkbox",class:"tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",checked:n.block.linkOpenInNewTab??!1,onChange:T[16]||(T[16]=M=>O("linkOpenInNewTab",M.target.checked))},null,40,bC),l.createTextVNode(" "+l.toDisplayString(l.unref(s).image.openInNewTab),1)])):l.createCommentVNode("",!0)])],64)):N.value==="button"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:4},[l.createElementVNode("div",kC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).button.fontFamily),3),l.createElementVNode("select",{class:l.normalizeClass(l.unref(Ee)),value:n.block.fontFamily||"",onChange:T[17]||(T[17]=M=>O("fontFamily",M.target.value||void 0))},[l.createElementVNode("option",wC,l.toDisplayString(l.unref(s).button.inheritFont),1),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,M=>(l.openBlock(),l.createElementBlock("option",{key:M.value,value:M.value},l.toDisplayString(M.label),9,SC))),128))],42,xC)]),l.createElementVNode("div",EC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).button.text),3),l.createVNode(Ho,{"model-value":n.block.text,type:"text","onUpdate:modelValue":T[18]||(T[18]=M=>O("text",M))},null,8,["model-value"])]),l.createElementVNode("div",CC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).button.url),3),l.createVNode(Ho,{"model-value":n.block.url,type:"url",placeholder:l.unref(s).button.urlPlaceholder,"onUpdate:modelValue":T[19]||(T[19]=M=>O("url",M))},null,8,["model-value","placeholder"]),n.block.url?(l.openBlock(),l.createElementBlock("label",TC,[l.createElementVNode("input",{type:"checkbox",class:"tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",checked:n.block.openInNewTab??!1,onChange:T[20]||(T[20]=M=>O("openInNewTab",M.target.checked))},null,40,NC),l.createTextVNode(" "+l.toDisplayString(l.unref(s).button.openInNewTab),1)])):l.createCommentVNode("",!0)]),l.createElementVNode("div",MC,[l.createElementVNode("div",BC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).button.background),3),l.createVNode(Xe,{"model-value":n.block.backgroundColor,"onUpdate:modelValue":T[21]||(T[21]=M=>O("backgroundColor",M))},null,8,["model-value"])]),l.createElementVNode("div",OC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).button.textColor),3),l.createVNode(Xe,{"model-value":n.block.textColor,"onUpdate:modelValue":T[22]||(T[22]=M=>O("textColor",M))},null,8,["model-value"])])]),l.createElementVNode("div",DC,[l.createElementVNode("div",VC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).button.borderRadius),3),l.createElementVNode("div",AC,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.borderRadius,min:"0",max:"50",onInput:T[23]||(T[23]=M=>O("borderRadius",Number(M.target.value)))},null,42,IC),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])]),l.createElementVNode("div",RC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).button.fontSize),3),l.createElementVNode("div",zC,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.fontSize,min:"10",max:"36",onInput:T[24]||(T[24]=M=>O("fontSize",Number(M.target.value)))},null,42,PC),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])])])],64)):N.value==="divider"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:5},[l.createElementVNode("div",LC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).divider.style),3),l.createVNode(mo,{options:[{value:"solid",label:l.unref(s).divider.solid},{value:"dashed",label:l.unref(s).divider.dashed},{value:"dotted",label:l.unref(s).divider.dotted}],"model-value":n.block.lineStyle,"onUpdate:modelValue":T[25]||(T[25]=M=>O("lineStyle",M))},null,8,["options","model-value"])]),l.createElementVNode("div",FC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).divider.color),3),l.createVNode(Xe,{"model-value":n.block.color,"onUpdate:modelValue":T[26]||(T[26]=M=>O("color",M))},null,8,["model-value"])]),l.createElementVNode("div",jC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).divider.thickness),3),l.createElementVNode("div",HC,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.thickness,min:"1",max:"10",onInput:T[27]||(T[27]=M=>O("thickness",Number(M.target.value)))},null,42,UC),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])])],64)):N.value==="social"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:6},[l.createElementVNode("div",WC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).social.icons),3),l.createElementVNode("div",KC,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.block.icons,M=>(l.openBlock(),l.createElementBlock("div",{key:M.id,class:"tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"},[l.createElementVNode("div",_C,[l.createElementVNode("select",{class:l.normalizeClass([l.unref(Ee),"tpl:flex-1"]),value:M.platform,onChange:st=>gt(M.id,"platform",st.target.value)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(D2),st=>(l.openBlock(),l.createElementBlock("option",{key:st,value:st},l.toDisplayString(l.unref($f)[st].name),9,JC))),128))],42,GC),l.createElementVNode("button",{class:"tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",title:l.unref(s).social.removeIcon,onClick:st=>bt(M.id)},[l.createVNode(l.unref(hn),{size:14,"stroke-width":2})],8,YC)]),l.createVNode(Ho,{"model-value":M.url,type:"url",placeholder:l.unref(s).social.urlPlaceholder,"onUpdate:modelValue":st=>gt(M.id,"url",st)},null,8,["model-value","placeholder","onUpdate:modelValue"])]))),128)),l.createElementVNode("button",{class:"tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",onClick:ht},[l.createVNode(l.unref(uo),{size:14,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).social.addIcon),1)])])]),l.createElementVNode("div",XC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).social.style),3),l.createVNode(mo,{options:[{value:"solid",label:l.unref(s).social.styleSolid},{value:"outlined",label:l.unref(s).social.styleOutlined},{value:"rounded",label:l.unref(s).social.styleRounded},{value:"square",label:l.unref(s).social.styleSquare},{value:"circle",label:l.unref(s).social.styleCircle}],"model-value":n.block.iconStyle,"onUpdate:modelValue":T[28]||(T[28]=M=>O("iconStyle",M))},null,8,["options","model-value"])]),l.createElementVNode("div",ZC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).social.size),3),l.createVNode(mo,{options:[{value:"small",label:l.unref(s).social.sizeSmall},{value:"medium",label:l.unref(s).social.sizeMedium},{value:"large",label:l.unref(s).social.sizeLarge}],"model-value":n.block.iconSize,"onUpdate:modelValue":T[29]||(T[29]=M=>O("iconSize",M))},null,8,["options","model-value"])]),l.createElementVNode("div",QC,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).social.spacing),3),l.createElementVNode("div",qC,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.spacing,min:"0",max:"50",onInput:T[30]||(T[30]=M=>O("spacing",Number(M.target.value)))},null,42,$C),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])]),l.createElementVNode("div",tT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).social.align),3),l.createVNode(mo,{options:[{value:"left",label:l.unref(s).text.alignLeft,icon:l.unref(Js)},{value:"center",label:l.unref(s).text.alignCenter,icon:l.unref(Gs)},{value:"right",label:l.unref(s).text.alignRight,icon:l.unref(Ys)}],"model-value":n.block.align,"onUpdate:modelValue":T[31]||(T[31]=M=>O("align",M))},null,8,["options","model-value"])])],64)):N.value==="menu"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:7},[l.createElementVNode("div",eT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).menu.items),3),l.createElementVNode("div",nT,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.block.items,M=>(l.openBlock(),l.createElementBlock("div",{key:M.id,class:"tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"},[l.createElementVNode("div",oT,[l.createElementVNode("input",{type:"text",class:l.normalizeClass([l.unref(Ee),"tpl:flex-1"]),value:M.text,placeholder:l.unref(s).menu.text,onInput:st=>Ct(M.id,"text",st.target.value)},null,42,lT),l.createElementVNode("button",{class:"tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",title:l.unref(s).menu.removeItem,onClick:st=>Nt(M.id)},[l.createVNode(l.unref(hn),{size:14,"stroke-width":2})],8,sT)]),l.createVNode(Ho,{"model-value":M.url,type:"url",placeholder:l.unref(s).menu.urlPlaceholder,"onUpdate:modelValue":st=>Ct(M.id,"url",st)},null,8,["model-value","placeholder","onUpdate:modelValue"]),l.createElementVNode("div",rT,[l.createElementVNode("label",aT,[l.createElementVNode("input",{type:"checkbox",checked:M.openInNewTab,class:"tpl:accent-[var(--tpl-primary)]",onChange:st=>Ct(M.id,"openInNewTab",st.target.checked)},null,40,iT),l.createTextVNode(" "+l.toDisplayString(l.unref(s).menu.openInNewTab),1)]),l.createElementVNode("label",cT,[l.createElementVNode("input",{type:"checkbox",checked:M.bold,class:"tpl:accent-[var(--tpl-primary)]",onChange:st=>Ct(M.id,"bold",st.target.checked)},null,40,dT),l.createTextVNode(" "+l.toDisplayString(l.unref(s).menu.bold),1)]),l.createElementVNode("label",pT,[l.createElementVNode("input",{type:"checkbox",checked:M.underline,class:"tpl:accent-[var(--tpl-primary)]",onChange:st=>Ct(M.id,"underline",st.target.checked)},null,40,uT),l.createTextVNode(" "+l.toDisplayString(l.unref(s).menu.underline),1)])]),l.createElementVNode("div",fT,[l.createElementVNode("label",hT,l.toDisplayString(l.unref(s).menu.color),1),l.createVNode(Xe,{"swatch-only":"","model-value":M.color||n.block.linkColor||n.block.color,"onUpdate:modelValue":st=>Ct(M.id,"color",st)},null,8,["model-value","onUpdate:modelValue"])])]))),128)),l.createElementVNode("button",{class:"tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",onClick:Pt},[l.createVNode(l.unref(uo),{size:14,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).menu.addItem),1)])])]),l.createElementVNode("div",mT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).menu.fontFamily),3),l.createElementVNode("select",{class:l.normalizeClass(l.unref(Ee)),value:n.block.fontFamily||"",onChange:T[32]||(T[32]=M=>O("fontFamily",M.target.value||void 0))},[l.createElementVNode("option",vT,l.toDisplayString(l.unref(s).text.inheritFont),1),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,M=>(l.openBlock(),l.createElementBlock("option",{key:M.value,value:M.value},l.toDisplayString(M.label),9,yT))),128))],42,gT)]),l.createElementVNode("div",bT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).menu.fontSize),3),l.createElementVNode("div",kT,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.fontSize,min:"8",max:"48",onInput:T[33]||(T[33]=M=>O("fontSize",Number(M.target.value)))},null,42,xT),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])]),l.createElementVNode("div",wT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).menu.color),3),l.createVNode(Xe,{"model-value":n.block.color,"onUpdate:modelValue":T[34]||(T[34]=M=>O("color",M))},null,8,["model-value"])]),l.createElementVNode("div",ST,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).menu.linkColor),3),l.createVNode(Xe,{"model-value":n.block.linkColor||n.block.color,"onUpdate:modelValue":T[35]||(T[35]=M=>O("linkColor",M||void 0))},null,8,["model-value"])]),l.createElementVNode("div",ET,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).menu.textAlign),3),l.createVNode(mo,{options:[{value:"left",label:l.unref(s).text.alignLeft,icon:l.unref(Js)},{value:"center",label:l.unref(s).text.alignCenter,icon:l.unref(Gs)},{value:"right",label:l.unref(s).text.alignRight,icon:l.unref(Ys)}],"model-value":n.block.textAlign,"onUpdate:modelValue":T[36]||(T[36]=M=>O("textAlign",M))},null,8,["options","model-value"])]),l.createElementVNode("div",CT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).menu.separator),3),l.createElementVNode("input",{type:"text",class:l.normalizeClass(l.unref(Ee)),value:n.block.separator,onInput:T[37]||(T[37]=M=>O("separator",M.target.value))},null,42,TT)]),l.createElementVNode("div",NT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).menu.separatorColor),3),l.createVNode(Xe,{"model-value":n.block.separatorColor,"onUpdate:modelValue":T[38]||(T[38]=M=>O("separatorColor",M))},null,8,["model-value"])]),l.createElementVNode("div",MT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).menu.spacing),3),l.createElementVNode("div",BT,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.spacing,min:"0",max:"50",onInput:T[39]||(T[39]=M=>O("spacing",Number(M.target.value)))},null,42,OT),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])])],64)):N.value==="table"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:8},[l.createElementVNode("div",DT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).table.dimensions),3),l.createElementVNode("div",VT,[l.createElementVNode("div",AT,[l.createElementVNode("span",IT,l.toDisplayString(l.unref(s).table.rows),1),l.createElementVNode("div",RT,[l.createElementVNode("button",{class:"tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",disabled:n.block.rows.length<=1,onClick:T[40]||(T[40]=M=>xt(n.block.rows[n.block.rows.length-1].id))},[l.createVNode(l.unref(po),{size:12,"stroke-width":2})],8,zT),l.createElementVNode("span",PT,l.toDisplayString(n.block.rows.length),1),l.createElementVNode("button",{class:"tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",onClick:St},[l.createVNode(l.unref(uo),{size:12,"stroke-width":2})])])]),l.createElementVNode("div",LT,[l.createElementVNode("span",FT,l.toDisplayString(l.unref(s).table.columns),1),l.createElementVNode("div",jT,[l.createElementVNode("button",{class:"tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",disabled:U.value<=1,onClick:T[41]||(T[41]=M=>nt(U.value-1))},[l.createVNode(l.unref(po),{size:12,"stroke-width":2})],8,HT),l.createElementVNode("span",UT,l.toDisplayString(U.value),1),l.createElementVNode("button",{class:"tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",onClick:K},[l.createVNode(l.unref(uo),{size:12,"stroke-width":2})])])])])]),l.createElementVNode("div",WT,[l.createElementVNode("label",KT,[l.createElementVNode("input",{type:"checkbox",checked:n.block.hasHeaderRow,class:"tpl:accent-[var(--tpl-primary)]",onChange:T[42]||(T[42]=M=>O("hasHeaderRow",M.target.checked))},null,40,_T),l.createTextVNode(" "+l.toDisplayString(l.unref(s).table.hasHeaderRow),1)])]),n.block.hasHeaderRow?(l.openBlock(),l.createElementBlock("div",GT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).table.headerBackgroundColor),3),l.createVNode(Xe,{"model-value":n.block.headerBackgroundColor||"#f2f2f2",placeholder:l.unref(s).table.noHeaderBg,"onUpdate:modelValue":T[43]||(T[43]=M=>O("headerBackgroundColor",M||null))},null,8,["model-value","placeholder"])])):l.createCommentVNode("",!0),l.createElementVNode("div",JT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).table.borderColor),3),l.createVNode(Xe,{"model-value":n.block.borderColor,"onUpdate:modelValue":T[44]||(T[44]=M=>O("borderColor",M))},null,8,["model-value"])]),l.createElementVNode("div",YT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).table.borderWidth),3),l.createElementVNode("div",XT,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.borderWidth,min:"0",max:"10",onInput:T[45]||(T[45]=M=>O("borderWidth",Number(M.target.value)))},null,42,ZT),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])]),l.createElementVNode("div",QT,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).table.cellPadding),3),l.createElementVNode("div",qT,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.cellPadding,min:"0",max:"30",onInput:T[46]||(T[46]=M=>O("cellPadding",Number(M.target.value)))},null,42,$T),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])]),l.createElementVNode("div",tN,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).table.fontFamily),3),l.createElementVNode("select",{class:l.normalizeClass(l.unref(Ee)),value:n.block.fontFamily||"",onChange:T[47]||(T[47]=M=>O("fontFamily",M.target.value||void 0))},[l.createElementVNode("option",nN,l.toDisplayString(l.unref(s).text.inheritFont),1),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,M=>(l.openBlock(),l.createElementBlock("option",{key:M.value,value:M.value},l.toDisplayString(M.label),9,oN))),128))],42,eN)]),l.createElementVNode("div",lN,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).table.fontSize),3),l.createElementVNode("div",sN,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.fontSize,min:"10",max:"32",onInput:T[48]||(T[48]=M=>O("fontSize",Number(M.target.value)))},null,42,rN),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)])]),l.createElementVNode("div",aN,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).table.color),3),l.createVNode(Xe,{"model-value":n.block.color,"onUpdate:modelValue":T[49]||(T[49]=M=>O("color",M))},null,8,["model-value"])]),l.createElementVNode("div",iN,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).table.textAlign),3),l.createVNode(mo,{options:[{value:"left",label:l.unref(s).text.alignLeft,icon:l.unref(Js)},{value:"center",label:l.unref(s).text.alignCenter,icon:l.unref(Gs)},{value:"right",label:l.unref(s).text.alignRight,icon:l.unref(Ys)}],"model-value":n.block.textAlign,"onUpdate:modelValue":T[50]||(T[50]=M=>O("textAlign",M))},null,8,["options","model-value"])])],64)):N.value==="spacer"?(l.openBlock(),l.createElementBlock("div",cN,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).spacer.height),3),l.createElementVNode("div",dN,[l.createElementVNode("input",{type:"number",class:l.normalizeClass(l.unref(vn)),value:n.block.height,min:"10",max:"100",onInput:T[51]||(T[51]=M=>O("height",Number(M.target.value)))},null,42,pN),l.createElementVNode("span",{class:l.normalizeClass(l.unref(yn))},"px",2)]),l.createElementVNode("input",{type:"range",class:"tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",value:n.block.height,min:"10",max:"100",onInput:T[52]||(T[52]=M=>O("height",Number(M.target.value)))},null,40,uN)])):N.value==="html"?(l.openBlock(),l.createElementBlock("div",fN,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).html.content),3),l.createElementVNode("textarea",{value:n.block.content,placeholder:"<div>...</div>",rows:"10",class:"tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",onInput:T[53]||(T[53]=M=>O("content",M.target.value))},null,40,hN),l.createElementVNode("p",mN,[l.createVNode(l.unref(Kc),{size:12,class:"tpl:mt-0.5 tpl:shrink-0"}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).html.sanitizationHint),1)])])):l.createCommentVNode("",!0),l.createElementVNode("div",gN,[l.createElementVNode("div",vN,[l.createElementVNode("button",{type:"button",class:"tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",onClick:T[54]||(T[54]=M=>m.value=!m.value)},[l.createVNode(l.unref(zo),{class:l.normalizeClass(["tpl:transition-transform tpl:duration-200",m.value?"tpl:rotate-0":"tpl:-rotate-90"]),size:12,"stroke-width":2},null,8,["class"]),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).blockSettings.spacing),1)]),l.withDirectives(l.createElementVNode("div",yN,[l.createVNode(gh,{label:l.unref(s).blockSettings.padding,"model-value":n.block.styles.padding,"onUpdate:modelValue":T[55]||(T[55]=M=>W("padding",M))},null,8,["label","model-value"]),l.createElementVNode("div",bN,[l.createVNode(gh,{label:l.unref(s).blockSettings.margin,"model-value":n.block.styles.margin,"onUpdate:modelValue":T[56]||(T[56]=M=>W("margin",M))},null,8,["label","model-value"])])],512),[[l.vShow,m.value]])]),l.createElementVNode("div",kN,[l.createElementVNode("button",{type:"button",class:"tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",onClick:T[57]||(T[57]=M=>g.value=!g.value)},[l.createVNode(l.unref(zo),{class:l.normalizeClass(["tpl:transition-transform tpl:duration-200",g.value?"tpl:rotate-0":"tpl:-rotate-90"]),size:12,"stroke-width":2},null,8,["class"]),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).blockSettings.background),1)]),l.withDirectives(l.createElementVNode("div",xN,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).blockSettings.color),3),l.createVNode(Xe,{size:"large","model-value":n.block.styles.backgroundColor||"#ffffff","onUpdate:modelValue":T[58]||(T[58]=M=>W("backgroundColor",M))},null,8,["model-value"])],512),[[l.vShow,g.value]])]),l.createElementVNode("div",wN,[l.createElementVNode("button",{type:"button",class:"tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",onClick:T[59]||(T[59]=M=>v.value=!v.value)},[l.createVNode(l.unref(zo),{class:l.normalizeClass(["tpl:transition-transform tpl:duration-200",v.value?"tpl:rotate-0":"tpl:-rotate-90"]),size:12,"stroke-width":2},null,8,["class"]),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).blockSettings.display),1)]),l.withDirectives(l.createElementVNode("div",SN,[l.createElementVNode("label",EN,[l.createElementVNode("input",{type:"checkbox",class:"tpl:accent-[var(--tpl-primary)]",checked:((Y=n.block.visibility)==null?void 0:Y.desktop)!==!1,onChange:T[60]||(T[60]=M=>{var st,Vt,Wt;return o("update",{visibility:{desktop:((st=n.block.visibility)==null?void 0:st.desktop)===!1,tablet:((Vt=n.block.visibility)==null?void 0:Vt.tablet)!==!1,mobile:((Wt=n.block.visibility)==null?void 0:Wt.mobile)!==!1}})})},null,40,CN),l.createVNode(l.unref(yf),{size:14,"stroke-width":1.5}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).blockSettings.showOnDesktop),1)]),l.createElementVNode("label",TN,[l.createElementVNode("input",{type:"checkbox",class:"tpl:accent-[var(--tpl-primary)]",checked:((Bt=n.block.visibility)==null?void 0:Bt.tablet)!==!1,onChange:T[61]||(T[61]=M=>{var st,Vt,Wt;return o("update",{visibility:{desktop:((st=n.block.visibility)==null?void 0:st.desktop)!==!1,tablet:((Vt=n.block.visibility)==null?void 0:Vt.tablet)===!1,mobile:((Wt=n.block.visibility)==null?void 0:Wt.mobile)!==!1}})})},null,40,NN),l.createVNode(l.unref(Sf),{size:14,"stroke-width":1.5}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).blockSettings.showOnTablet),1)]),l.createElementVNode("label",MN,[l.createElementVNode("input",{type:"checkbox",class:"tpl:accent-[var(--tpl-primary)]",checked:((Ot=n.block.visibility)==null?void 0:Ot.mobile)!==!1,onChange:T[62]||(T[62]=M=>{var st,Vt,Wt;return o("update",{visibility:{desktop:((st=n.block.visibility)==null?void 0:st.desktop)!==!1,tablet:((Vt=n.block.visibility)==null?void 0:Vt.tablet)!==!1,mobile:((Wt=n.block.visibility)==null?void 0:Wt.mobile)===!1}})})},null,40,BN),l.createVNode(l.unref(wf),{size:14,"stroke-width":1.5}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).blockSettings.showOnMobile),1)])],512),[[l.vShow,v.value]])]),l.createElementVNode("div",ON,[l.createElementVNode("button",{type:"button",class:"tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",onClick:T[63]||(T[63]=M=>y.value=!y.value)},[l.createVNode(l.unref(zo),{class:l.normalizeClass(["tpl:transition-transform tpl:duration-200",y.value?"tpl:rotate-0":"tpl:-rotate-90"]),size:12,"stroke-width":2},null,8,["class"]),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).blockSettings.customCss),1)]),l.withDirectives(l.createElementVNode("div",DN,[l.createElementVNode("label",{class:l.normalizeClass(l.unref(mt))},l.toDisplayString(l.unref(s).blockSettings.css),3),l.createElementVNode("textarea",{value:n.block.customCss||"",placeholder:l.unref(s).blockSettings.cssPlaceholder,rows:"3",class:"tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",onInput:T[64]||(T[64]=M=>o("update",{customCss:M.target.value}))},null,40,VN)],512),[[l.vShow,y.value]])]),S.value?(l.openBlock(),l.createElementBlock("div",AN,[l.createElementVNode("button",{type:"button",class:"tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",onClick:T[65]||(T[65]=M=>k.value=!k.value)},[l.createVNode(l.unref(zo),{class:l.normalizeClass(["tpl:transition-transform tpl:duration-200",k.value?"tpl:rotate-0":"tpl:-rotate-90"]),size:12,"stroke-width":2},null,8,["class"]),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).blockSettings.displayCondition),1)]),l.withDirectives(l.createElementVNode("div",IN,[l.createElementVNode("select",{class:l.normalizeClass(["tpl:w-full tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:outline-none tpl:transition-all tpl:duration-150 tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",n.block.displayCondition?"tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-text)]":"tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"]),value:b.value||E.value?"__custom__":((pt=n.block.displayCondition)==null?void 0:pt.label)??"",onChange:T[66]||(T[66]=M=>{const st=M.target.value;if(st==="__custom__"){B();return}if(b.value=!1,!st){o("update",{displayCondition:void 0});return}const Vt=l.unref(i).find(Wt=>Wt.label===st);Vt&&o("update",{displayCondition:Vt})})},[l.createElementVNode("option",zN,l.toDisplayString(l.unref(s).blockSettings.noCondition),1),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(D.value,(M,st)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:st},[st?(l.openBlock(),l.createElementBlock("optgroup",{key:0,label:String(st)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(M,Vt=>(l.openBlock(),l.createElementBlock("option",{key:Vt.label,value:Vt.label},l.toDisplayString(Vt.label),9,LN))),128))],8,PN)):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(M,Vt=>(l.openBlock(),l.createElementBlock("option",{key:Vt.label,value:Vt.label},l.toDisplayString(Vt.label),9,FN))),128))],64))),128)),l.unref(c)?(l.openBlock(),l.createElementBlock("option",jN,l.toDisplayString(l.unref(s).blockSettings.customCondition),1)):l.createCommentVNode("",!0)],42,RN),b.value||E.value?(l.openBlock(),l.createElementBlock("div",HN,[l.createElementVNode("div",null,[l.createElementVNode("label",UN,l.toDisplayString(l.unref(s).blockSettings.customConditionBefore),1),l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":T[67]||(T[67]=M=>w.value=M),rows:"2",class:"tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-150 tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]"},null,512),[[l.vModelText,w.value]])]),l.createElementVNode("div",null,[l.createElementVNode("label",WN,l.toDisplayString(l.unref(s).blockSettings.customConditionAfter),1),l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":T[68]||(T[68]=M=>x.value=M),rows:"2",class:"tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-150 tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]"},null,512),[[l.vModelText,x.value]])]),l.createElementVNode("div",KN,[l.createElementVNode("button",{type:"button",class:"tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:opacity-50",disabled:!w.value.trim(),onClick:C},l.toDisplayString(l.unref(s).blockSettings.applyCondition),9,_N)])])):n.block.displayCondition&&!E.value?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[n.block.displayCondition.description?(l.openBlock(),l.createElementBlock("p",GN,l.toDisplayString(n.block.displayCondition.description),1)):l.createCommentVNode("",!0),l.createElementVNode("div",JN,[l.createElementVNode("pre",YN,l.toDisplayString(n.block.displayCondition.before),1),n.block.displayCondition.after?(l.openBlock(),l.createElementBlock("pre",XN,l.toDisplayString(n.block.displayCondition.after),1)):l.createCommentVNode("",!0)])],64)):l.createCommentVNode("",!0)],512),[[l.vShow,k.value]])])):l.createCommentVNode("",!0)])])])}}}),[["__scopeId","data-v-bf54b340"]]),QN={role:"tablist",class:"tpl:relative tpl:flex tpl:border-b tpl:border-[var(--tpl-border)]",style:{"background-color":"var(--tpl-bg-hover)"}},qN=["aria-selected"],$N=["aria-selected"],t3={key:0,id:"tpl-tabpanel-content",role:"tabpanel","aria-labelledby":"tpl-tab-content",class:"tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"},e3={key:1,class:"tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:px-6 tpl:py-10 tpl:text-center tpl:text-[var(--tpl-text-muted)]"},n3={class:"tpl:mb-4 tpl:text-[var(--tpl-text-dim)]"},o3={class:"tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"},l3={class:"tpl:m-0 tpl:text-sm tpl:leading-normal"},s3={key:1,id:"tpl-tabpanel-settings",role:"tabpanel","aria-labelledby":"tpl-tab-settings",class:"tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"},vh=l.defineComponent({__name:"RightSidebar",props:{selectedBlock:{},settings:{},shiftedLeft:{type:Boolean}},emits:["update-block","delete-block","duplicate-block","update-settings"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.ref("content"),a=l.computed(()=>r.value==="content"?"tpl:translate-x-0":"tpl:translate-x-full");return l.watch(()=>e.selectedBlock,i=>{i&&(r.value="content")}),(i,c)=>(l.openBlock(),l.createElementBlock("aside",{class:l.normalizeClass(["tpl:absolute tpl:top-14 tpl:bottom-0 tpl:z-40 tpl:flex tpl:w-[320px] tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)] tpl:transition-all tpl:duration-200",n.shiftedLeft?"tpl:right-[360px]":"tpl:right-0"]),style:{"border-left":"1px solid var(--tpl-border)"}},[l.createElementVNode("div",QN,[l.createElementVNode("div",{class:l.normalizeClass(["tpl:absolute tpl:bottom-0 tpl:left-0 tpl:h-full tpl:w-1/2 tpl:p-1.5 tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",a.value])},[...c[6]||(c[6]=[l.createElementVNode("div",{class:"tpl:h-full tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:bg-[var(--tpl-bg)]",style:{"box-shadow":"var(--tpl-shadow)"}},null,-1)])],2),l.createElementVNode("button",{id:"tpl-tab-content",role:"tab","aria-selected":r.value==="content","aria-controls":"tpl-tabpanel-content",class:l.normalizeClass(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]",r.value==="content"?"tpl:text-[var(--tpl-primary)]":"tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),onClick:c[0]||(c[0]=d=>r.value="content")},[l.createVNode(l.unref(Ek),{size:14,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).sidebar.content),1)],10,qN),l.createElementVNode("button",{id:"tpl-tab-settings",role:"tab","aria-selected":r.value==="settings","aria-controls":"tpl-tabpanel-settings",class:l.normalizeClass(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]",r.value==="settings"?"tpl:text-[var(--tpl-primary)]":"tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),onClick:c[1]||(c[1]=d=>r.value="settings")},[l.createVNode(l.unref(Dk),{size:14,"stroke-width":1.5}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).sidebar.settings),1)],10,$N)]),r.value==="content"?(l.openBlock(),l.createElementBlock("div",t3,[n.selectedBlock?(l.openBlock(),l.createBlock(ZN,{key:0,block:n.selectedBlock,onUpdate:c[2]||(c[2]=d=>o("update-block",d)),onDelete:c[3]||(c[3]=d=>o("delete-block")),onDuplicate:c[4]||(c[4]=d=>o("duplicate-block"))},null,8,["block"])):(l.openBlock(),l.createElementBlock("div",e3,[l.createElementVNode("div",n3,[l.createVNode(l.unref(yk),{size:40,"stroke-width":1.5})]),l.createElementVNode("h4",o3,l.toDisplayString(l.unref(s).sidebar.noSelection),1),l.createElementVNode("p",l3,l.toDisplayString(l.unref(s).sidebar.noSelectionHint),1)]))])):l.createCommentVNode("",!0),r.value==="settings"?(l.openBlock(),l.createElementBlock("div",s3,[l.createVNode(SS,{settings:n.settings,onUpdate:c[5]||(c[5]=d=>o("update-settings",d))},null,8,["settings"])])):l.createCommentVNode("",!0)],2))}}),r3=["aria-checked","aria-label","title","onClick"],yh=l.defineComponent({__name:"ViewportToggle",props:{viewport:{}},emits:["change"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.computed(()=>[{value:"desktop",label:s.viewport.desktop},{value:"tablet",label:s.viewport.tablet},{value:"mobile",label:s.viewport.mobile}]),a=l.computed(()=>`translateX(${r.value.findIndex(c=>c.value===e.viewport)*100}%)`);return(i,c)=>(l.openBlock(),l.createElementBlock("div",{role:"radiogroup","aria-label":"Viewport",class:"tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",style:l.normalizeStyle({gridTemplateColumns:`repeat(${r.value.length}, 1fr)`,backgroundColor:"var(--tpl-bg-hover)"})},[l.createElementVNode("div",{class:"tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",style:l.normalizeStyle({left:"4px",width:`calc((100% - 8px) / ${r.value.length})`,transform:a.value,backgroundColor:"var(--tpl-bg)",boxShadow:"var(--tpl-shadow)",transition:"transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"})},null,4),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,d=>(l.openBlock(),l.createElementBlock("button",{key:d.value,role:"radio","aria-checked":n.viewport===d.value,"aria-label":d.label,class:"tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium",style:l.normalizeStyle({color:n.viewport===d.value?"var(--tpl-primary)":"var(--tpl-text-muted)",transition:"color 120ms cubic-bezier(0.16, 1, 0.3, 1)"}),title:d.label,onClick:p=>o("change",d.value)},[d.value==="desktop"?(l.openBlock(),l.createBlock(l.unref(yf),{key:0,size:18,"stroke-width":1.5})):d.value==="tablet"?(l.openBlock(),l.createBlock(l.unref(Sf),{key:1,size:18,"stroke-width":1.5})):(l.openBlock(),l.createBlock(l.unref(wf),{key:2,size:18,"stroke-width":1.5})),l.createElementVNode("span",null,l.toDisplayString(d.label),1)],12,r3))),128))],4))}}),a3=["title"],bh=Re(l.defineComponent({__name:"PreviewToggle",props:{previewMode:{type:Boolean}},emits:["change"],setup(n,{emit:t}){const e=t,{t:o}=jt();return(s,r)=>(l.openBlock(),l.createElementBlock("button",{class:"tpl-preview-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",style:l.normalizeStyle({color:n.previewMode?"var(--tpl-primary)":"var(--tpl-text-muted)",backgroundColor:n.previewMode?"var(--tpl-primary-light)":"transparent"}),title:n.previewMode?l.unref(o).previewMode.disable:l.unref(o).previewMode.enable,onClick:r[0]||(r[0]=a=>e("change",!n.previewMode))},[l.createVNode(l.Transition,{"enter-active-class":"tpl-icon-enter-active","leave-active-class":"tpl-icon-leave-active","enter-from-class":"tpl-icon-enter-from","leave-to-class":"tpl-icon-leave-to",mode:"out-in"},{default:l.withCtx(()=>[n.previewMode?(l.openBlock(),l.createBlock(l.unref(Wc),{key:"eye",size:18,"stroke-width":1.5})):(l.openBlock(),l.createBlock(l.unref(gf),{key:"eye-off",size:18,"stroke-width":1.5}))]),_:1})],12,a3))}}),[["__scopeId","data-v-232d82b4"]]),i3=["title"],kh=Re(l.defineComponent({__name:"DarkModeToggle",props:{darkMode:{type:Boolean}},emits:["change"],setup(n,{emit:t}){const e=t,{t:o}=jt();return(s,r)=>(l.openBlock(),l.createElementBlock("button",{class:"tpl-dark-mode-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",style:l.normalizeStyle({color:n.darkMode?"var(--tpl-primary)":"var(--tpl-text-muted)",backgroundColor:n.darkMode?"var(--tpl-primary-light)":"transparent"}),title:n.darkMode?l.unref(o).darkMode.disable:l.unref(o).darkMode.enable,onClick:r[0]||(r[0]=a=>e("change",!n.darkMode))},[l.createVNode(l.Transition,{"enter-active-class":"tpl-icon-enter-active","leave-active-class":"tpl-icon-leave-active","enter-from-class":"tpl-icon-enter-from","leave-to-class":"tpl-icon-leave-to",mode:"out-in"},{default:l.withCtx(()=>[n.darkMode?(l.openBlock(),l.createBlock(l.unref(Sk),{key:"moon",size:18,"stroke-width":1.5})):(l.openBlock(),l.createBlock(l.unref(Lk),{key:"sun",size:18,"stroke-width":1.5}))]),_:1})],12,i3))}}),[["__scopeId","data-v-94d26253"]]),c3=(n,t,e)=>{const o=n[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((s,r)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(r.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==e?". Note that variables only represent file names one level deep.":""))))})},d3=["en","de"];function xh(n){return n.split("-")[0].toLowerCase()}async function wh(n){const t=xh(n),e=d3.includes(t)?t:"en";return(await c3(Object.assign({"./locales/de.ts":()=>Promise.resolve().then(()=>pO),"./locales/en.ts":()=>Promise.resolve().then(()=>uO)}),`./locales/${e}.ts`,3)).default}const p3=Object.freeze(Object.defineProperty({__proto__:null,getBaseLocale:xh,loadTranslations:wh},Symbol.toStringTag,{value:"Module"})),u3={key:0,class:"tpl:flex tpl:h-full tpl:items-center tpl:justify-center",style:{"background-color":"var(--tpl-bg)"}},f3={class:"tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4",style:{"background-color":"color-mix(in srgb, var(--tpl-bg) 80%, transparent)","backdrop-filter":"blur(12px)","-webkit-backdrop-filter":"blur(12px)","box-shadow":"var(--tpl-shadow-md)"}},h3={class:"tpl:flex tpl:items-center tpl:gap-2.5"},m3={class:"tpl:text-sm tpl:font-semibold",style:{color:"var(--tpl-text)","letter-spacing":"-0.01em"}},g3={class:"tpl:flex tpl:items-center tpl:justify-center tpl:gap-10"},v3={class:"tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0"},y3={class:"tpl:flex tpl:min-h-full tpl:justify-center tpl:p-8"},b3={class:"tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1",style:{"background-color":`color-mix(
461
+ in srgb,
462
+ var(--tpl-canvas-bg) 85%,
463
+ transparent
464
+ )`,"backdrop-filter":"blur(8px)","-webkit-backdrop-filter":"blur(8px)"}},k3={href:"https://github.com/templatical/sdk",target:"_blank",rel:"noopener noreferrer",class:"tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80",style:{color:"var(--tpl-text-dim)","text-decoration":"none"}},x3=Re(l.defineComponent({__name:"Editor",props:{config:{}},setup(n,{expose:t}){var R,N,L,z,P,U;const e=n,o=l.shallowRef(null),s=l.ref(!1);async function r(){o.value=await wh(e.config.locale??"en")}function a(O,W){let lt=o.value;for(const gt of O.split("."))if(lt&&typeof lt=="object")lt=lt[gt];else{lt=void 0;break}let ht=typeof lt=="string"?lt:O;if(W)for(const[gt,bt]of Object.entries(W))ht=ht.replace(`{${gt}}`,bt);return ht}const i=bd(e.config.fonts),c=Rn.useEditor({content:e.config.content,templateDefaults:e.config.templateDefaults}),d=Rn.useHistory({content:c.content,setContent:c.setContent}),p=c.addBlock,u=c.removeBlock,f=c.moveBlock,h=c.updateBlock,m=c.updateSettings;c.addBlock=(O,W,lt,ht)=>{d.record(),p(O,W,lt,ht)},c.removeBlock=O=>{d.record(),u(O)},c.moveBlock=(O,W,lt,ht)=>{d.record(),f(O,W,lt,ht)},c.updateBlock=(O,W)=>{d.recordDebounced(O),h(O,W)},c.updateSettings=O=>{d.record(),m(O)};const g=Rn.useBlockActions({addBlock:c.addBlock,removeBlock:c.removeBlock,updateBlock:c.updateBlock,selectBlock:c.selectBlock,blockDefaults:e.config.blockDefaults}),v=e.config.onChange?Rn.useAutoSave({content:c.content,isDirty:()=>c.state.isDirty,onChange:e.config.onChange}):null,y=Rn.useConditionPreview(c),k=l.ref(e.config.theme??{}),S={bg:"--tpl-bg",bgElevated:"--tpl-bg-elevated",bgHover:"--tpl-bg-hover",bgActive:"--tpl-bg-active",border:"--tpl-border",borderLight:"--tpl-border-light",text:"--tpl-text",textMuted:"--tpl-text-muted",textDim:"--tpl-text-dim",primary:"--tpl-primary",primaryHover:"--tpl-primary-hover",primaryLight:"--tpl-primary-light",secondary:"--tpl-secondary",secondaryHover:"--tpl-secondary-hover",secondaryLight:"--tpl-secondary-light",success:"--tpl-success",successLight:"--tpl-success-light",warning:"--tpl-warning",warningLight:"--tpl-warning-light",danger:"--tpl-danger",dangerLight:"--tpl-danger-light",canvasBg:"--tpl-canvas-bg"},b=l.computed(()=>{const O={};for(const[W,lt]of Object.entries(S)){const ht=k.value[W];ht&&(O[lt]=ht)}return O});function w(O){var lt,ht;const W=O.metaKey||O.ctrlKey;W&&O.key==="z"&&!O.shiftKey&&(O.preventDefault(),d.undo()),W&&O.key==="z"&&O.shiftKey&&(O.preventDefault(),d.redo()),W&&O.key==="s"&&(O.preventDefault(),(ht=(lt=e.config).onSave)==null||ht.call(lt,JSON.parse(JSON.stringify(c.state.content)))),O.key==="Escape"&&c.selectBlock(null),(O.key==="Delete"||O.key==="Backspace")&&c.state.selectedBlockId&&!x(O)&&(O.preventDefault(),d.record(),c.removeBlock(c.state.selectedBlockId))}function x(O){const W=O.target;return W.isContentEditable||W.tagName==="INPUT"||W.tagName==="TEXTAREA"||W.tagName==="SELECT"}const E=[];function B(){const O=e.config.plugins??[],W={state:c.state,content:c.content,selectedBlockId:c.state.selectedBlockId,viewport:c.state.viewport,addBlock:c.addBlock,updateBlock:c.updateBlock,removeBlock:c.removeBlock,moveBlock:c.moveBlock,updateSettings:c.updateSettings,selectBlock:c.selectBlock,registerToolbarAction:()=>{},registerSidebarPanel:()=>{},registerBlockAction:()=>{}};for(const lt of O)lt.install(W),E.push(lt)}l.provide("editor",c),l.provide("history",d),l.provide("blockActions",g),l.provide("conditionPreview",y),l.provide("config",e.config),l.provide("t",a),l.provide("translations",o),l.provide("fontsManager",i),l.provide("themeStyles",b),l.provide("blockDefaults",e.config.blockDefaults);const C=Qf();if((R=e.config.customBlocks)!=null&&R.length)for(const O of e.config.customBlocks)C.registerCustom(O,ss);l.provide("blockRegistry",C),l.provide("customBlockDefinitions",e.config.customBlocks??[]);const D=yt.resolveSyntax((N=e.config.mergeTags)==null?void 0:N.syntax);return l.provide("mergeTags",((L=e.config.mergeTags)==null?void 0:L.tags)??[]),l.provide("mergeTagSyntax",D),l.provide("onRequestMergeTag",((z=e.config.mergeTags)==null?void 0:z.onRequest)??null),l.provide("onRequestMedia",e.config.onRequestMedia??null),l.provide("displayConditions",((P=e.config.displayConditions)==null?void 0:P.conditions)??[]),l.provide("allowCustomConditions",((U=e.config.displayConditions)==null?void 0:U.allowCustom)??!1),Ro(document,"keydown",w),l.onMounted(async()=>{await r(),s.value=!0,B(),await i.loadCustomFonts()}),l.onUnmounted(()=>{var O;v==null||v.destroy(),d.destroy();for(const W of E)(O=W.destroy)==null||O.call(W)}),t({getContent:()=>c.content.value,setContent:O=>c.setContent(O)}),(O,W)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["tpl tpl:relative tpl:h-full tpl:overflow-hidden",{"tpl:dark":l.unref(c).state.darkMode}]),style:l.normalizeStyle(b.value)},[s.value?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("header",f3,[l.createElementVNode("div",h3,[W[6]||(W[6]=l.createElementVNode("img",{width:"24",height:"24",src:"https://templatical.com/logo.svg",alt:"Templatical"},null,-1)),l.createElementVNode("span",m3,l.toDisplayString(a("header.title")),1)]),l.createElementVNode("div",g3,[l.createVNode(yh,{viewport:l.unref(c).state.viewport,onChange:l.unref(c).setViewport},null,8,["viewport","onChange"]),l.createVNode(kh,{"dark-mode":l.unref(c).state.darkMode,onChange:l.unref(c).setDarkMode},null,8,["dark-mode","onChange"]),l.createVNode(bh,{"preview-mode":l.unref(c).state.previewMode,onChange:l.unref(c).setPreviewMode},null,8,["preview-mode","onChange"])]),W[7]||(W[7]=l.createElementVNode("div",{class:"tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3"},null,-1))]),l.withDirectives(l.createVNode(eh,null,null,512),[[l.vShow,!l.unref(c).state.previewMode]]),l.createElementVNode("div",{class:l.normalizeClass(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto tpl:transition-all tpl:duration-300",[l.unref(c).state.previewMode?"tpl:left-0 tpl:right-0":"tpl:left-12 tpl:right-[320px]","tpl:top-14"]]),style:{"transition-timing-function":"cubic-bezier(0.34, 1.56, 0.64, 1)","background-color":"var(--tpl-canvas-bg)"}},[l.createElementVNode("div",v3,[l.createVNode(l.Transition,{name:"tpl-restore-btn"},{default:l.withCtx(()=>[l.unref(y).hasHiddenBlocks.value?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80",style:{"background-color":"var(--tpl-warning-light)",color:"var(--tpl-warning)","border-color":"var(--tpl-warning)","backdrop-filter":"blur(8px)"},onClick:W[0]||(W[0]=lt=>l.unref(y).reset())},[l.createVNode(l.unref(xf),{size:13,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(a("blockSettings.restoreHiddenBlocks")),1)])):l.createCommentVNode("",!0)]),_:1})]),l.createElementVNode("div",y3,[l.createVNode(th,{viewport:l.unref(c).state.viewport,content:l.unref(c).content.value,"selected-block-id":l.unref(c).state.selectedBlockId,"dark-mode":l.unref(c).state.darkMode,"preview-mode":l.unref(c).state.previewMode,onSelectBlock:l.unref(c).selectBlock},null,8,["viewport","content","selected-block-id","dark-mode","preview-mode","onSelectBlock"])])],2),l.createElementVNode("footer",{class:l.normalizeClass(["tpl:pointer-events-none tpl:absolute tpl:bottom-0 tpl:z-50 tpl:flex tpl:h-8 tpl:items-center tpl:justify-end tpl:pr-4 tpl:text-[9px] tpl:opacity-90 tpl:transition-all tpl:duration-300",[l.unref(c).state.previewMode?"tpl:left-0 tpl:right-0":"tpl:left-12 tpl:right-[320px]"]]),style:{color:"var(--tpl-text-dim)"}},[l.createElementVNode("div",b3,[l.createElementVNode("span",null,l.toDisplayString(a("footer.poweredBy")),1),W[8]||(W[8]=l.createElementVNode("a",{href:"https://templatical.com",target:"_blank",rel:"noopener noreferrer",class:"tpl:inline-flex tpl:items-center tpl:gap-1 tpl:font-medium tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80",style:{color:"var(--tpl-text-muted)","text-decoration":"none"}},[l.createElementVNode("img",{width:"14",height:"14",src:"https://templatical.com/logo.svg",alt:""}),l.createTextVNode(" Templatical ")],-1)),W[9]||(W[9]=l.createElementVNode("span",{style:{color:"var(--tpl-border)"}},"·",-1)),l.createElementVNode("a",k3,l.toDisplayString(a("footer.openSource")),1)])],2),l.unref(c).state.previewMode?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(vh,{key:0,"selected-block":l.unref(c).selectedBlock.value,settings:l.unref(c).content.value.settings,onUpdateBlock:W[1]||(W[1]=lt=>l.unref(c).updateBlock(l.unref(c).state.selectedBlockId,lt)),onDeleteBlock:W[2]||(W[2]=()=>{l.unref(c).state.selectedBlockId&&(l.unref(d).record(),l.unref(g).deleteBlock(l.unref(c).state.selectedBlockId))}),onDuplicateBlock:W[3]||(W[3]=()=>{l.unref(c).selectedBlock.value&&(l.unref(d).record(),l.unref(g).duplicateBlock(l.unref(c).selectedBlock.value))}),onUpdateSettings:W[4]||(W[4]=lt=>l.unref(c).updateSettings(lt))},null,8,["selected-block","settings"]))],64)):(l.openBlock(),l.createElementBlock("div",u3,[...W[5]||(W[5]=[l.createElementVNode("span",{class:"tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},"Loading...",-1)])]))],6))}}),[["__scopeId","data-v-c68d54f0"]]);let as=null;const is=l.ref(null);function w3(n){const t=typeof n.container=="string"?document.querySelector(n.container):n.container;if(!t)throw new Error(`[Templatical] Container element not found: ${n.container}`);as&&Nd(),as=l.createApp({setup(){return()=>l.h(x3,{config:n,ref:is})}}),as.mount(t);const e={getContent(){return is.value?JSON.parse(JSON.stringify(is.value.getContent())):JSON.parse(JSON.stringify(n.content))},setContent(o){is.value&&is.value.setContent(o),n.content=o},unmount:Nd};return Eh(e),e}let cs=null;const bn=l.ref(null);async function S3(n){const t=typeof n.container=="string"?document.querySelector(n.container):n.container;if(!t)throw new Error(`[Templatical] Container element not found: ${n.container}`);cs&&Sh();const{default:e}=await Promise.resolve().then(()=>WO),{loadTranslations:o}=await Promise.resolve().then(()=>p3),s=await o(n.locale??"en"),r=bd(n.fonts);await new Promise((c,d)=>{const p=setTimeout(()=>{d(new Error("[Templatical] Cloud editor initialization timed out"))},3e4);cs=l.createApp({setup(){return()=>l.h(e,{config:n,translations:s,fontsManager:r,ref:bn,onReady:()=>{clearTimeout(p),c()}})}}),cs.mount(t)});const i={getContent(){return bn.value?JSON.parse(JSON.stringify(bn.value.getContent())):JSON.parse(JSON.stringify(n.content))},setContent(c){bn.value&&bn.value.setContent(c)},unmount:Sh,create(c){return bn.value?bn.value.create(c):Promise.reject(new Error("[Templatical] Cloud editor not ready"))},load(c){return bn.value?bn.value.load(c):Promise.reject(new Error("[Templatical] Cloud editor not ready"))},save(){return bn.value?bn.value.save():Promise.reject(new Error("[Templatical] Cloud editor not ready"))}};return Eh(i),i}function Nd(){as&&(as.unmount(),as=null,is.value=null)}function Sh(){cs&&(cs.unmount(),cs=null,bn.value=null)}function Eh(n){import("@templatical/renderer").then(t=>{n.toMjml=()=>t.renderToMjml(n.getContent())}).catch(()=>{})}class an{constructor(t,e,o,s,r){this.kind=t,this.input=e,this.begin=o,this.end=s,this.file=r}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[t,e]=[1,1];for(let o=0;o<this.begin;o++)this.input[o]===`
465
+ `?(t++,e=1):e++;return[t,e]}size(){return this.end-this.begin}}let Wo=class{liquidMethodMissing(t,e){}};const E3=Object.prototype.toString,Ch=String.prototype.toLowerCase,Md=Object.hasOwnProperty;function It(n){return typeof n=="string"}function ue(n){return typeof n=="function"}function C3(n){return n&&ue(n.then)}function $a(n){return n&&ue(n.next)&&ue(n.throw)&&ue(n.return)}function at(n){return n=Ut(n),It(n)?n:kn(n)?"":Ne(n)?n.map(t=>at(t)).join(""):String(n)}function gr(n){return n=Ut(n),Ne(n)?n:It(n)&&n.length>0?[n]:N3(n)?Array.from(n):ei(n)?Object.keys(n).map(t=>[t,n[t]]):[]}function Te(n){return n=Ut(n),kn(n)?[]:Ne(n)?n:[n]}function Ut(n){return n instanceof Wo&&ue(n.valueOf)?n.valueOf():n}function Bd(n){return+Ut(n)||0}function ti(n){return typeof n=="number"}function Th(n){return n&&ue(n.toLiquid)?Th(n.toLiquid()):n}function kn(n){return n==null}function T3(n){return n===void 0}function Ne(n){return E3.call(n)==="[object Array]"}function Nh(n){return n&&ti(n.length)}function N3(n){return ei(n)&&Symbol.iterator in n}function Mh(n,t){n=n||{};for(const e in n)if(Md.call(n,e)&&t(n[e],e,n)===!1)break;return n}function Bh(n){return n[n.length-1]}function ei(n){const t=typeof n;return n!==null&&(t==="object"||t==="function")}function Oh(n,t,e=1){const o=[];for(let s=n;s<t;s+=e)o.push(s);return o}function vr(n,t,e=" "){return Dh(n,t,e,(o,s)=>s+o)}function M3(n,t,e=" "){return Dh(n,t,e,(o,s)=>o+s)}function Dh(n,t,e,o){n=String(n);let s=t-n.length;for(;s-- >0;)n=o(n,e);return n}function Vh(n){return n}function B3(n){return[...n].some(e=>e>="a"&&e<="z")?n.toUpperCase():n.toLowerCase()}function O3(n,t){return n.length>t?n.slice(0,t-3)+"...":n}function Ah(n,t){return n==null&&t==null?0:n==null?1:t==null||(n=Ch.call(n),t=Ch.call(t),n<t)?-1:n>t?1:0}function ni(n){return function(...t){return n.call(this,...t.map(Ut))}}function Jn(n){return function(...t){return n.call(this,...t.map(Bd))}}function*oi(n){const t=new Set;for(const e of n){const o=JSON.stringify(e);t.has(o)||(t.add(o),yield e)}}const Ih="__liquidClass__";class Ko extends Error{constructor(t,e){super(typeof t=="string"?t:t.message),this.context="",typeof t!="string"&&Object.defineProperty(this,"originalError",{value:t,enumerable:!1}),Object.defineProperty(this,"token",{value:e,enumerable:!1}),Object.defineProperty(this,Ih,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:V3(this.token),enumerable:!1}),this.message=A3(this.message,this.token),this.stack=this.message+`
466
+ `+this.context+`
467
+ `+this.stack,this.originalError&&(this.stack+=`
468
+ From `+this.originalError.stack)}static is(t){return(t==null?void 0:t[Ih])==="LiquidError"}}class Rh extends Ko{constructor(t,e){super(t,e),this.name="TokenizationError",super.update()}}class zh extends Ko{constructor(t,e){super(t,e),this.name="ParseError",this.message=t.message,super.update()}}class Ph extends Ko{constructor(t,e){super(t,e.token),this.name="RenderError",this.message=t.message,super.update()}static is(t){return t.name==="RenderError"}}class Lh extends Ko{constructor(t){super(t[0],t[0].token),this.errors=t,this.name="LiquidErrors";const e=t.length>1?"s":"";this.message=`${t.length} error${e} found`,super.update()}static is(t){return t.name==="LiquidErrors"}}class Fh extends Ko{constructor(t,e){super(t,e),this.name="UndefinedVariableError",this.message=t.message,super.update()}}class D3 extends Error{constructor(t){super(`undefined variable: ${t}`),this.name="InternalUndefinedVariableError",this.variableName=t}}class jh extends Error{constructor(t){super(t),this.name="AssertionError",this.message=t+""}}function V3(n){const[t,e]=n.getPosition(),o=n.input.split(`
469
+ `),s=Math.max(t-2,1),r=Math.min(t+3,o.length);return Oh(s,r+1).map(i=>{const c=i===t?">> ":" ",d=vr(String(i),String(r).length);let p=`${c}${d}| `;const u=i===t?`
470
+ `+vr("^",e+p.length):"";return p+=o[i-1],p+=u,p}).join(`
471
+ `)}function A3(n,t){t.file&&(n+=`, file:${t.file}`);const[e,o]=t.getPosition();return n+=`, line:${e}, col:${o}`,n}const Kt=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],I3=1,ds=4,Hh=8,Uh=16,R3=32,z3=64,P3=128;function li(n){const t=n.charCodeAt(0);return t>=128?!Kt[t]:!!(Kt[t]&I3)}Kt[160]=Kt[5760]=Kt[6158]=Kt[8192]=Kt[8193]=Kt[8194]=Kt[8195]=Kt[8196]=Kt[8197]=Kt[8198]=Kt[8199]=Kt[8200]=Kt[8201]=Kt[8202]=Kt[8232]=Kt[8233]=Kt[8239]=Kt[8287]=Kt[12288]=ds,Kt[8220]=Kt[8221]=P3;function Me(n,t){if(!n){const e=typeof t=="function"?t():t||`expect ${n} to be true`;throw new jh(e)}}function si(n,t=`unexpected ${JSON.stringify(n)}`){Me(!n,t)}class L3 extends Wo{equals(t){return kn(Ut(t))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}}class ps extends Wo{equals(t){return t instanceof ps?!1:(t=Ut(t),It(t)||Ne(t)?t.length===0:ei(t)?Object.keys(t).length===0:!1)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return""}static is(t){return t instanceof ps}}class Od extends ps{equals(t){return t===!1||kn(Ut(t))?!0:It(t)?/^\s*$/.test(t):super.equals(t)}static is(t){return t instanceof Od}}class Dd extends Wo{constructor(t,e,o){super(),this.i=0,this.length=t,this.name=`${o}-${e}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return this.i===0}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}}class Wh{constructor(){this.buffer=""}write(t){this.buffer+=at(t)}}class F3{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}}class j3{constructor(){this.buffer=""}write(t){t=Ut(t),typeof t!="string"&&this.buffer===""?this.buffer=t:this.buffer=at(this.buffer)+at(t)}}class Kh extends Wo{constructor(t=()=>""){super(),this.superBlockRender=t}*super(){const t=new Wh;return yield this.superBlockRender(t),t.buffer}}function Yn(n){return n&&ue(n.equals)&&ue(n.gt)&&ue(n.geq)&&ue(n.lt)&&ue(n.leq)}const _h=new L3,Gh={true:!0,false:!1,nil:_h,null:_h,empty:new ps,blank:new Od};function Vd(n){const t={};for(const[e,o]of Object.entries(n)){let s=t;for(let r=0;r<e.length;r++){const a=e[r];s[a]=s[a]||{},r===e.length-1&&li(e[r])&&(s[a].needBoundary=!0),s=s[a]}s.data=o,s.end=!0}return t}var ri=function(){return ri=Object.assign||function(t){for(var e,o=1,s=arguments.length;o<s;o++){e=arguments[o];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},ri.apply(this,arguments)};function fe(n,t,e,o){function s(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function i(p){try{d(o.next(p))}catch(u){a(u)}}function c(p){try{d(o.throw(p))}catch(u){a(u)}}function d(p){p.done?r(p.value):s(p.value).then(i,c)}d((o=o.apply(n,[])).next())})}function Xn(n){return fe(this,void 0,void 0,function*(){if(!$a(n))return n;let t,e=!1,o="next";do{const s=n[o](t);e=s.done,t=s.value,o="next";try{$a(t)&&(t=Xn(t)),C3(t)&&(t=yield t)}catch(r){o="throw",t=r}}while(!e);return t})}function Zn(n){if(!$a(n))return n;let t,e=!1,o="next";do{const s=n[o](t);if(e=s.done,t=s.value,o="next",$a(t))try{t=Zn(t)}catch(r){o="throw",t=r}}while(!e);return t}const H3=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function U3(n){return[31,W3(n)?29:28,31,30,31,30,31,31,30,31,30,31]}function Jh(n){let t=0;for(let e=0;e<n.getMonth();++e)t+=U3(n)[e];return t+n.getDate()}function Yh(n,t){const e=Jh(n)+(t-n.getDay()),s=7-new Date(n.getFullYear(),0,1).getDay()+t;return String(Math.floor((e-s)/7)+1)}function W3(n){const t=n.getFullYear();return!!((t&3)===0&&(t%100||t%400===0&&t))}function K3(n){const t=n.getDate();if([11,12,13].includes(t))return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}function _3(n){return parseInt(n.getFullYear().toString().substring(0,2),10)}const G3={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},J3=new Set("aAbBceklpP");function Xh(n,t){const e=Math.abs(n.getTimezoneOffset()),o=Math.floor(e/60),s=e%60;return(n.getTimezoneOffset()>0?"-":"+")+vr(o,2,"0")+(t.flags[":"]?":":"")+vr(s,2,"0")}const Ad={a:n=>n.getShortWeekdayName(),A:n=>n.getLongWeekdayName(),b:n=>n.getShortMonthName(),B:n=>n.getLongMonthName(),c:n=>n.toLocaleString(),C:n=>_3(n),d:n=>n.getDate(),e:n=>n.getDate(),H:n=>n.getHours(),I:n=>String(n.getHours()%12||12),j:n=>Jh(n),k:n=>n.getHours(),l:n=>String(n.getHours()%12||12),L:n=>n.getMilliseconds(),m:n=>n.getMonth()+1,M:n=>n.getMinutes(),N:(n,t)=>{const e=Number(t.width)||9,o=String(n.getMilliseconds()).slice(0,e);return M3(o,e,"0")},p:n=>n.getHours()<12?"AM":"PM",P:n=>n.getHours()<12?"am":"pm",q:n=>K3(n),s:n=>Math.round(n.getTime()/1e3),S:n=>n.getSeconds(),u:n=>n.getDay()||7,U:n=>Yh(n,0),w:n=>n.getDay(),W:n=>Yh(n,1),x:n=>n.toLocaleDateString(),X:n=>n.toLocaleTimeString(),y:n=>n.getFullYear().toString().slice(2,4),Y:n=>n.getFullYear(),z:Xh,Z:(n,t)=>n.getTimeZoneName()||Xh(n,t),t:()=>" ",n:()=>`
472
+ `,"%":()=>"%"};Ad.h=Ad.b;function ai(n,t){let e="",o=t,s;for(;s=H3.exec(o);)e+=o.slice(0,s.index),o=o.slice(s.index+s[0].length),e+=Y3(n,s);return e+o}function Y3(n,t){const[e,o="",s,r,a]=t,i=Ad[a];if(!i)return e;const c={};for(const f of o)c[f]=!0;let d=String(i(n,{flags:c,width:s,modifier:r})),p=J3.has(a)?" ":"0",u=s||G3[a]||0;return c["^"]?d=d.toUpperCase():c["#"]&&(d=B3(d)),c._?p=" ":c[0]&&(p="0"),c["-"]&&(u=0),vr(d,u,p)}function Zh(){return typeof Intl<"u"?Intl.DateTimeFormat:void 0}const X3=6e4,Z3=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,Qh=["January","February","March","April","May","June","July","August","September","October","November","December"],Q3=Qh.map(n=>n.slice(0,3)),qh=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],q3=qh.map(n=>n.slice(0,3));class Fn{constructor(t,e,o){this.locale=e,this.DateTimeFormat=Zh(),this.date=new Date(t),this.timezoneFixed=o!==void 0,o===void 0&&(o=this.date.getTimezoneOffset()),this.timezoneOffset=It(o)?Fn.getTimezoneOffset(o,this.date):o,this.timezoneName=It(o)?o:"";const s=(this.date.getTimezoneOffset()-this.timezoneOffset)*X3,r=this.date.getTime()+s;this.displayDate=new Date(r)}getTime(){return this.displayDate.getTime()}getMilliseconds(){return this.displayDate.getMilliseconds()}getSeconds(){return this.displayDate.getSeconds()}getMinutes(){return this.displayDate.getMinutes()}getHours(){return this.displayDate.getHours()}getDay(){return this.displayDate.getDay()}getDate(){return this.displayDate.getDate()}getMonth(){return this.displayDate.getMonth()}getFullYear(){return this.displayDate.getFullYear()}toLocaleString(t,e){return e!=null&&e.timeZone?this.date.toLocaleString(t,e):this.displayDate.toLocaleString(t,e)}toLocaleTimeString(t){return this.displayDate.toLocaleTimeString(t)}toLocaleDateString(t){return this.displayDate.toLocaleDateString(t)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){if(this.timezoneFixed)return this.timezoneName;if(this.DateTimeFormat)return this.DateTimeFormat().resolvedOptions().timeZone}getLongMonthName(){var t;return(t=this.format({month:"long"}))!==null&&t!==void 0?t:Qh[this.getMonth()]}getShortMonthName(){var t;return(t=this.format({month:"short"}))!==null&&t!==void 0?t:Q3[this.getMonth()]}getLongWeekdayName(){var t;return(t=this.format({weekday:"long"}))!==null&&t!==void 0?t:qh[this.displayDate.getDay()]}getShortWeekdayName(){var t;return(t=this.format({weekday:"short"}))!==null&&t!==void 0?t:q3[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(t){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,t).format(this.displayDate)}static createDateFixedToTimezone(t,e){const o=t.match(Z3);if(o&&o[1]==="Z")return new Fn(+new Date(t),e,0);if(o&&o[2]&&o[3]&&o[4]){const[,,s,r,a]=o,i=(s==="+"?-1:1)*(parseInt(r,10)*60+parseInt(a,10));return new Fn(+new Date(t),e,i)}return new Fn(t,e)}static getTimezoneOffset(t,e){const o=e.toLocaleString("en-US",{timeZone:t}),s=e.toLocaleString("en-US",{timeZone:"UTC"}),r=new Date(o);return(+new Date(s)-+r)/(60*1e3)}}class Id{constructor(t,e){this.base=0,this.message=`${t} limit exceeded`,this.limit=e}use(t){+t>0&&(Me(this.base+ +t<=this.limit,this.message),this.base+=+t)}check(t){+t>0&&Me(+t<=this.limit,this.message)}}class Rd extends an{constructor(t,[e,o],s,r,a,i,c,d){super(t,s,r,a,d),this.trimLeft=!1,this.trimRight=!1;const p=s[e]==="-",u=s[o-1]==="-";let f=p?e+1:e,h=u?o-1:o;for(;f<h&&Kt[s.charCodeAt(f)]&ds;)f++;for(;h>f&&Kt[s.charCodeAt(h-1)]&ds;)h--;this.contentRange=[f,h],this.trimLeft=p||i,this.trimRight=u||c}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class zd extends Rd{constructor(t,e,o,s,r){const{trimTagLeft:a,trimTagRight:i,tagDelimiterLeft:c,tagDelimiterRight:d}=s,[p,u]=[e+c.length,o-d.length];super(_t.Tag,[p,u],t,e,o,a,i,r),this.tokenizer=new jn(t,s.operators,r,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal tag syntax, tag name expected"),this.tokenizer.skipBlank(),this.args=this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class $3 extends Rd{constructor(t,e,o,s,r){const{trimOutputLeft:a,trimOutputRight:i,outputDelimiterLeft:c,outputDelimiterRight:d}=s,p=[e+c.length,o-d.length];super(_t.Output,p,t,e,o,a,i,r)}}class $h extends an{constructor(t,e,o,s){super(_t.HTML,t,e,o,s),this.input=t,this.begin=e,this.end=o,this.file=s,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class tM extends an{constructor(t,e,o,s){super(_t.Number,t,e,o,s),this.input=t,this.begin=e,this.end=o,this.file=s,this.content=Number(this.getText())}}class Pd extends an{constructor(t,e,o,s){super(_t.Word,t,e,o,s),this.input=t,this.begin=e,this.end=o,this.file=s,this.content=this.getText()}}class eM extends an{constructor(t,e,o,s){super(_t.Literal,t,e,o,s),this.input=t,this.begin=e,this.end=o,this.file=s,this.literal=this.getText(),this.content=Gh[this.literal]}}const tm={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},nM={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class oM extends an{constructor(t,e,o,s){super(_t.Operator,t,e,o,s),this.input=t,this.begin=e,this.end=o,this.file=s,this.operator=this.getText()}getPrecedence(){const t=this.getText();return t in tm?tm[t]:1}}class em extends an{constructor(t,e,o,s,r,a){super(_t.PropertyAccess,o,s,r,a),this.variable=t,this.props=e}}class nm extends an{constructor(t,e,o,s,r,a){super(_t.Filter,o,s,r,a),this.name=t,this.args=e}}class lM extends an{constructor(t,e,o,s,r,a){super(_t.Hash,t,e,o,a),this.input=t,this.begin=e,this.end=o,this.name=s,this.value=r,this.file=a}}const sM=/[\da-fA-F]/,om=/[0-7]/,lm={b:"\b",f:"\f",n:`
473
+ `,r:"\r",t:" ",v:"\v"};function sm(n){const t=n.charCodeAt(0);return t>=97?t-87:t>=65?t-55:t-48}function rM(n){let t="";for(let e=1;e<n.length-1;e++){if(n[e]!=="\\"){t+=n[e];continue}if(lm[n[e+1]]!==void 0)t+=lm[n[++e]];else if(n[e+1]==="u"){let o=0,s=e+2;for(;s<=e+5&&sM.test(n[s]);)o=o*16+sm(n[s++]);e=s-1,t+=String.fromCharCode(o)}else if(!om.test(n[e+1]))t+=n[++e];else{let o=e+1,s=0;for(;o<=e+3&&om.test(n[o]);)s=s*8+sm(n[o++]);e=o-1,t+=String.fromCharCode(s)}}return t}class aM extends an{constructor(t,e,o,s){super(_t.Quoted,t,e,o,s),this.input=t,this.begin=e,this.end=o,this.file=s,this.content=rM(this.getText())}}class iM extends an{constructor(t,e,o,s,r,a){super(_t.Range,t,e,o,a),this.input=t,this.begin=e,this.end=o,this.lhs=s,this.rhs=r,this.file=a}}class cM extends Rd{constructor(t,e,o,s,r){super(_t.Tag,[e,o],t,e,o,!1,!1,r),this.tokenizer=new jn(t,s.operators,r,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,"illegal liquid tag syntax"),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class dM extends an{constructor(t,e,o,s,r,a){super(_t.FilteredValue,o,s,r,a),this.initial=t,this.filters=e,this.input=o,this.begin=s,this.end=r,this.file=a}}const pM={now:()=>Date.now()};function rm(){return typeof global=="object"&&global.performance||typeof window=="object"&&window.performance||pM}class uM{renderTemplatesToNodeStream(t,e){const o=new F3;return Promise.resolve().then(()=>Xn(this.renderTemplates(t,e,o))).then(()=>o.end(),s=>o.error(s)),o.stream}*renderTemplates(t,e,o){o||(o=e.opts.keepOutputType?new j3:new Wh);const s=[];for(const r of t){e.renderLimit.check(rm().now());try{const a=yield r.render(e,o);if(a&&o.write(a),e.breakCalled||e.continueCalled)break}catch(a){const i=Ko.is(a)?a:new Ph(a,r);if(e.opts.catchAllErrors)s.push(i);else throw i}}if(s.length)throw new Lh(s);return o.buffer}}class am{constructor(t){this.postfix=[...mM(t)]}*evaluate(t,e){Me(t,"unable to evaluate: context not defined");const o=[];for(const s of this.postfix)if(wm(s)){const r=o.pop();let a;if(nM[s.operator]===1)a=yield t.opts.operators[s.operator](r,t);else{const i=o.pop();a=yield t.opts.operators[s.operator](i,r,t)}o.push(a)}else o.push(yield ae(s,t,e));return o[0]}valid(){return!!this.postfix.length}}function*ae(n,t,e=!1){if(n){if("content"in n)return n.content;if(pi(n))return yield fM(n,t,e);if(Cm(n))return yield hM(n,t)}}function*fM(n,t,e){const o=[];for(const s of n.props)o.push(yield ae(s,t,!1));try{if(n.variable){const s=yield ae(n.variable,t,e);return yield t._getFromScope(s,o)}else return yield t._get(o)}catch(s){if(e&&s.name==="InternalUndefinedVariableError")return null;throw new Fh(s,n)}}function im(n){return n.content}function*hM(n,t){const e=yield ae(n.lhs,t),o=yield ae(n.rhs,t);return t.memoryLimit.use(o-e+1),Oh(+e,+o+1)}function*mM(n){const t=[];for(const e of n)if(wm(e)){for(;t.length&&t[t.length-1].getPrecedence()>e.getPrecedence();)yield t.pop();t.push(e)}else yield e;for(;t.length;)yield t.pop()}function _o(n,t){return!yr(n,t)}function yr(n,t){return n=Ut(n),t.opts.jsTruthy?!n:n===!1||n===void 0||n===null}const cm={"==":go,"!=":(n,t)=>!go(n,t),">":(n,t)=>Yn(n)?n.gt(t):Yn(t)?t.lt(n):Ut(n)>Ut(t),"<":(n,t)=>Yn(n)?n.lt(t):Yn(t)?t.gt(n):Ut(n)<Ut(t),">=":(n,t)=>Yn(n)?n.geq(t):Yn(t)?t.leq(n):Ut(n)>=Ut(t),"<=":(n,t)=>Yn(n)?n.leq(t):Yn(t)?t.geq(n):Ut(n)<=Ut(t),contains:(n,t)=>(n=Ut(n),Ne(n)?n.some(e=>go(e,t)):ue(n==null?void 0:n.indexOf)?n.indexOf(Ut(t))>-1:!1),not:(n,t)=>yr(Ut(n),t),and:(n,t,e)=>_o(Ut(n),e)&&_o(Ut(t),e),or:(n,t,e)=>_o(Ut(n),e)||_o(Ut(t),e)};function go(n,t){return Yn(n)?n.equals(t):Yn(t)?t.equals(n):(n=Ut(n),t=Ut(t),Ne(n)?Ne(t)&&gM(n,t):n===t)}function gM(n,t){return n.length!==t.length?!1:!n.some((e,o)=>!go(e,t[o]))}function vM(n,t){return n.some(e=>go(e,t))}let Ld=class{constructor(t,e,o,s){this.key=t,this.value=e,this.next=o,this.prev=s}};class dm{constructor(t,e=0){this.limit=t,this.size=e,this.cache={},this.head=new Ld("HEAD",null,null,null),this.tail=new Ld("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(t,e){if(this.cache[t])this.cache[t].value=e;else{const o=new Ld(t,e,this.head.next,this.head);this.head.next.prev=o,this.head.next=o,this.cache[t]=o,this.size++,this.ensureLimit()}}read(t){if(!this.cache[t])return;const{value:e}=this.cache[t];return this.remove(t),this.write(t,e),e}remove(t){const e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--}clear(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}}ensureLimit(){this.size>this.limit&&this.remove(this.tail.prev.key)}}function pm(n,t){const e=document.createElement("base");e.href=n;const o=document.getElementsByTagName("head")[0];o.insertBefore(e,o.firstChild);const s=document.createElement("a");s.href=t;const r=s.href;return o.removeChild(e),r}function yM(n,t,e){return n.length&&Bh(n)!=="/"&&(n+="/"),pm(n,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,(s,r,a)=>{const i=a.split("/").pop();return/\.\w+$/.test(i)?s:r+a+e})}function bM(n){return fe(this,void 0,void 0,function*(){return new Promise((t,e)=>{const o=new XMLHttpRequest;o.onload=()=>{o.status>=200&&o.status<300?t(o.responseText):e(new Error(o.statusText))},o.onerror=()=>{e(new Error("An error occurred whilst receiving the response."))},o.open("GET",n),o.send()})})}function kM(n){const t=new XMLHttpRequest;if(t.open("GET",n,!1),t.send(),t.status<200||t.status>=300)throw new Error(t.statusText);return t.responseText}function xM(n){return fe(this,void 0,void 0,function*(){return!0})}function wM(n){return!0}function SM(n){return pm(n,".")}var EM=Object.freeze({__proto__:null,resolve:yM,readFile:bM,readFileSync:kM,exists:xM,existsSync:wM,dirname:SM,sep:"/"});function CM(n,t,...e){return n=Ut(n),Ne(n)||It(n)?n.length?n:t:n===!1&&new Map(e).get("allow_false")?!1:yr(n,this.context)?t:n}function um(n,t=0){return JSON.stringify(n,null,t)}function TM(n,t=0){const e=[];return JSON.stringify(n,function(o,s){if(typeof s!="object"||s===null)return s;for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(s)?"[Circular]":(e.push(s),s)},t)}function NM(n){return Number(n)}var fm={default:CM,raw:{raw:!0,handler:Vh},jsonify:um,to_integer:NM,json:um,inspect:TM};const MM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},BM={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function ii(n){return n=at(n),this.context.memoryLimit.use(n.length),n.replace(/&|<|>|"|'/g,t=>MM[t])}function OM(n){return ii.call(this,n)}function DM(n){return n=at(n),this.context.memoryLimit.use(n.length),n.replace(/&(amp|lt|gt|#34|#39);/g,t=>BM[t])}function VM(n){return ii.call(this,DM.call(this,n))}function AM(n){const t=at(n);return this.context.memoryLimit.use(t.length),t.replace(/\r?\n/gm,`<br />
474
+ `)}function IM(n){const t=at(n);return this.context.memoryLimit.use(t.length),t.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}var RM=Object.freeze({__proto__:null,escape:ii,xml_escape:OM,escape_once:VM,newline_to_br:AM,strip_html:IM});class zM{constructor(t){this.mapping=t,this.sep="/"}exists(t){return fe(this,void 0,void 0,function*(){return this.existsSync(t)})}existsSync(t){return!kn(this.mapping[t])}readFile(t){return fe(this,void 0,void 0,function*(){return this.readFileSync(t)})}readFileSync(t){const e=this.mapping[t];if(kn(e))throw new Error(`ENOENT: ${t}`);return e}dirname(t){const e=t.split(this.sep);return e.pop(),e.join(this.sep)}resolve(t,e,o){if(e+=o,t===".")return e;const s=t.split(/\/+/);for(const r of e.split(this.sep))r==="."||r===""||(r===".."?(s.length>1||s[0]!=="")&&s.pop():s.push(r));return s.join(this.sep)}}const Sl={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:":",cache:void 0,extname:"",fs:EM,dynamicPartials:!0,jsTruthy:!1,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",locale:"",trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!0,lenientIf:!1,globals:{},keepOutputType:!1,operators:cm,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0};function PM(n){var t,e;if(n.hasOwnProperty("root")&&(n.hasOwnProperty("partials")||(n.partials=n.root),n.hasOwnProperty("layouts")||(n.layouts=n.root)),n.hasOwnProperty("cache")){let o;typeof n.cache=="number"?o=n.cache>0?new dm(n.cache):void 0:typeof n.cache=="object"?o=n.cache:o=n.cache?new dm(1024):void 0,n.cache=o}return n=Object.assign(Object.assign(Object.assign({},Sl),n.jekyllInclude?{dynamicPartials:!1}:{}),n),(!n.fs.dirname||!n.fs.sep)&&n.relativeReference&&(console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"),n.relativeReference=!1),n.root=ci(n.root),n.partials=ci(n.partials),n.layouts=ci(n.layouts),n.outputEscape=n.outputEscape&&LM(n.outputEscape),n.locale||(n.locale=(e=(t=Zh())===null||t===void 0?void 0:t().resolvedOptions().locale)!==null&&e!==void 0?e:"en-US"),n.templates&&(n.fs=new zM(n.templates),n.relativeReference=!0,n.root=n.partials=n.layouts="."),n}function LM(n){return n==="escape"?ii:n==="json"?fm.json:(Me(ue(n),"`outputEscape` need to be of type string or function"),n)}function ci(n){let t=[];return Ne(n)&&(t=n),It(n)&&(t=[n]),t}function FM(n,t){let e=!1;for(let o=0;o<n.length;o++){const s=n[o];GM(s)&&(!e&&s.trimLeft&&jM(n[o-1],t.greedy),Cl(s)&&(s.name==="raw"?e=!0:s.name==="endraw"&&(e=!1)),!e&&s.trimRight&&HM(n[o+1],t.greedy))}}function jM(n,t){if(!n||!Wd(n))return;const e=t?ds:Uh;for(;Kt[n.input.charCodeAt(n.end-1-n.trimRight)]&e;)n.trimRight++}function HM(n,t){if(!n||!Wd(n))return;const e=t?ds:Uh;for(;Kt[n.input.charCodeAt(n.begin+n.trimLeft)]&e;)n.trimLeft++;n.input.charAt(n.begin+n.trimLeft)===`
475
+ `&&n.trimLeft++}class jn{constructor(t,e=Sl.operators,o,s){this.input=t,this.file=o,this.rawBeginAt=-1,this.p=s?s[0]:0,this.N=s?s[1]:t.length,this.opTrie=Vd(e),this.literalTrie=Vd(Gh)}readExpression(){return new am(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){const t=this.readOperator();if(t){yield t;continue}const e=this.readValue();if(e){yield e;continue}return}}readOperator(){this.skipBlank();const t=this.matchTrie(this.opTrie);if(t!==-1)return new oM(this.input,this.p,this.p=t,this.file)}matchTrie(t){let e=t,o=this.p,s;for(;e[this.input[o]]&&o<this.N;)e=e[this.input[o++]],e.end&&(s=e);return!s||s.needBoundary&&li(this.peek(o-this.p))?-1:o}readFilteredValue(){const t=this.p,e=this.readExpression();this.assert(e.valid(),`invalid value expression: ${this.snapshot()}`);const o=this.readFilters();return new dM(e,o,this.input,t,this.p,this.file)}readFilters(){const t=[];for(;;){const e=this.readFilter();if(!e)return t;t.push(e)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert(this.read()==="|",'expected "|" before filter');const t=this.readIdentifier();if(!t.size())return this.assert(this.end(),"expected filter name"),null;const e=[];if(this.skipBlank(),this.peek()===":")do{++this.p;const o=this.readFilterArg();o&&e.push(o),this.skipBlank(),this.assert(this.end()||this.peek()===","||this.peek()==="|",()=>`unexpected character ${this.snapshot()}`)}while(this.peek()===",");else if(!(this.peek()==="|"||this.end()))throw this.error('expected ":" after filter name');return new nm(t.getText(),e,this.input,t.begin,this.p,this.file)}readFilterArg(){const t=this.readValue();if(!t)return;if(this.skipBlank(),this.peek()!==":")return t;++this.p;const e=this.readValue();return[t.getText(),e]}readTopLevelTokens(t=Sl){const e=[];for(;this.p<this.N;){const o=this.readTopLevelToken(t);e.push(o)}return FM(e,t),e}readTopLevelToken(t){const{tagDelimiterLeft:e,outputDelimiterLeft:o}=t;return this.rawBeginAt>-1?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(o)?this.readOutputToken(t):this.readHTMLToken([e,o])}readHTMLToken(t){const e=this.p;for(;this.p<this.N&&!t.some(o=>this.match(o));)++this.p;return new $h(this.input,e,this.p,this.file)}readTagToken(t){const{file:e,input:o}=this,s=this.p;if(this.readToDelimiter(t.tagDelimiterRight)===-1)throw this.error(`tag ${this.snapshot(s)} not closed`,s);const r=new zd(o,s,this.p,t,e);return r.name==="raw"&&(this.rawBeginAt=s),r}readToDelimiter(t,e=!1){for(this.skipBlank();this.p<this.N;){if(e&&this.peekType()&Hh){this.readQuoted();continue}if(++this.p,this.rmatch(t))return this.p}return-1}readOutputToken(t=Sl){const{file:e,input:o}=this,{outputDelimiterRight:s}=t,r=this.p;if(this.readToDelimiter(s,!0)===-1)throw this.error(`output ${this.snapshot(r)} not closed`,r);return new $3(o,r,this.p,t,e)}readEndrawOrRawContent(t){const{tagDelimiterLeft:e,tagDelimiterRight:o}=t,s=this.p;let r=this.readTo(e)-e.length;for(;this.p<this.N;){if(this.readIdentifier().getText()!=="endraw"){r=this.readTo(e)-e.length;continue}for(;this.p<=this.N;){if(this.rmatch(o)){const a=this.p;return s===r?(this.rawBeginAt=-1,new zd(this.input,s,a,t,this.file)):(this.p=r,new $h(this.input,s,r,this.file))}if(this.rmatch(e))break;this.p++}}throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,s)}readLiquidTagTokens(t=Sl){const e=[];for(;this.p<this.N;){const o=this.readLiquidTagToken(t);o&&e.push(o)}return e}readLiquidTagToken(t){if(this.skipBlank(),this.end())return;const e=this.p;this.readToDelimiter(`
476
+ `);const o=this.p;return new cM(this.input,e,o,t,this.file)}error(t,e=this.p){return new Rh(t,new Pd(this.input,e,this.N,this.file))}assert(t,e,o){if(!t)throw this.error(typeof e=="function"?e():e,o)}snapshot(t=this.p){return JSON.stringify(O3(this.input.slice(t,this.N),32))}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const t=this.p;for(;!this.end()&&li(this.peek());)++this.p;return new Pd(this.input,t,this.p,this.file)}readNonEmptyIdentifier(){const t=this.readIdentifier();return t.size()?t:void 0}readTagName(){return this.skipBlank(),this.input[this.p]==="#"?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(t){const e=[];for(;;){const o=this.readHash(t);if(!o)return e;e.push(o)}}readHash(t){this.skipBlank(),this.peek()===","&&++this.p;const e=this.p,o=this.readNonEmptyIdentifier();if(!o)return;let s;this.skipBlank();const r=It(t)?t:t?"=":":";return this.peek()===r&&(++this.p,s=this.readValue()),new lM(this.input,e,this.p,o,s,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(t=1){this.p+=t}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1}readValue(){this.skipBlank();const t=this.p,e=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),o=this.readProperties(!e);return o.length?new em(e,o,this.input,t,this.p):e}readScopeValue(){this.skipBlank();const t=this.p,e=this.readProperties();if(e.length)return new em(void 0,e,this.input,t,this.p)}readProperties(t=!0){const e=[];for(;;){if(this.peek()==="["){this.p++;const o=this.readValue()||new Pd(this.input,this.p,this.p,this.file);this.assert(this.readTo("]")!==-1,"[ not closed"),e.push(o);continue}if(t&&!e.length){const o=this.readNonEmptyIdentifier();if(o){e.push(o);continue}}if(this.peek()==="."&&this.peek(1)!=="."){this.p++;const o=this.readNonEmptyIdentifier();if(!o)break;e.push(o);continue}break}return e}readNumber(){this.skipBlank();let t=!1,e=!1,o=0;for(this.peekType()&z3&&o++;this.p+o<=this.N;)if(this.peekType(o)&R3)e=!0,o++;else if(this.peek(o)==="."&&this.peek(o+1)!=="."){if(t||!e)return;t=!0,o++}else break;if(e&&!li(this.peek(o))){const s=new tM(this.input,this.p,this.p+o,this.file);return this.advance(o),s}}readLiteral(){this.skipBlank();const t=this.matchTrie(this.literalTrie);if(t===-1)return;const e=new eM(this.input,this.p,t,this.file);return this.p=t,e}readRange(){this.skipBlank();const t=this.p;if(this.peek()!=="(")return;++this.p;const e=this.readValueOrThrow();this.skipBlank(),this.assert(this.read()==="."&&this.read()===".","invalid range syntax");const o=this.readValueOrThrow();return this.skipBlank(),this.assert(this.read()===")","invalid range syntax"),new iM(this.input,t,this.p,e,o,this.file)}readValueOrThrow(){const t=this.readValue();return this.assert(t,()=>`unexpected token ${this.snapshot()}, value expected`),t}readQuoted(){this.skipBlank();const t=this.p;if(!(this.peekType()&Hh))return;++this.p;let e=!1;for(;this.p<this.N&&(++this.p,!(this.input[this.p-1]===this.input[t]&&!e));)e?e=!1:this.input[this.p-1]==="\\"&&(e=!0);return new aM(this.input,t,this.p,this.file)}*readFileNameTemplate(t){const{outputDelimiterLeft:e}=t,o=[","," ","\r",`
477
+ `," ",e],s=new Set(o);for(;this.p<this.N&&!s.has(this.peek());)yield this.match(e)?this.readOutputToken(t):this.readHTMLToken(o)}match(t){for(let e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0}rmatch(t){for(let e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0}peekType(t=0){return this.p+t>=this.N?0:Kt[this.input.charCodeAt(this.p+t)]}peek(t=0){return this.p+t>=this.N?"":this.input[this.p+t]}skipBlank(){for(;this.peekType()&ds;)++this.p}}class hm{constructor(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}on(t,e){return this.handlers[t]=e,this}trigger(t,e){const o=this.handlers[t];return o?(o.call(this,e),!0):!1}start(){this.trigger("start");let t;for(;!this.stopRequested&&(t=this.tokens.shift());){if(this.trigger("token",t)||Cl(t)&&this.trigger(`tag:${t.name}`,t))continue;const e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}}class Fd{constructor(t){this.token=t}}class ee extends Fd{constructor(t,e,o){super(t),this.name=t.name,this.liquid=o,this.tokenizer=t.tokenizer}}class El{constructor(t,e){this.hash={};const o=t instanceof jn?t:new jn(t,{});for(const s of o.readHashes(e))this.hash[s.name.content]=s.value}*render(t){const e={};for(const o of Object.keys(this.hash))e[o]=this.hash[o]===void 0?!0:yield ae(this.hash[o],t);return e}}function UM(n){return class extends ee{constructor(t,e,o){super(t,e,o),ue(n.parse)&&n.parse.call(this,t,e)}*render(t,e){const o=yield new El(this.token.args,t.opts.keyValueSeparator).render(t);return yield n.render.call(this,t,e,o)}}}function mm(n){return Ne(n)}class jd{constructor(t,e,o){this.token=t,this.name=t.name,this.handler=ue(e)?e:ue(e==null?void 0:e.handler)?e.handler:Vh,this.raw=!ue(e)&&!!(e!=null&&e.raw),this.args=t.args,this.liquid=o}*render(t,e){const o=[];for(const s of this.args)mm(s)?o.push([s[0],yield ae(s[1],e)]):o.push(yield ae(s,e));return yield this.handler.apply({context:e,token:this.token,liquid:this.liquid},[t,...o])}}class Ze{constructor(t,e){this.filters=[];const o=typeof t=="string"?new jn(t,e.options.operators).readFilteredValue():t;this.initial=o.initial,this.filters=o.filters.map(s=>new jd(s,this.getFilter(e,s.name),e))}*value(t,e){e=e||t.opts.lenientIf&&this.filters.length>0&&this.filters[0].name==="default";let o=yield this.initial.evaluate(t,e);for(const s of this.filters)o=yield s.render(o,t);return o}getFilter(t,e){const o=t.filters[e];return Me(o||!t.options.strictFilters,()=>`undefined filter: ${e}`),o}}class gm extends Fd{constructor(t,e){var o;super(t);const s=new jn(t.input,e.options.operators,t.file,t.contentRange);this.value=new Ze(s.readFilteredValue(),e);const r=this.value.filters,a=e.options.outputEscape;if(!(!((o=r[r.length-1])===null||o===void 0)&&o.raw)&&a){const i=new nm(toString.call(a),[],"",0,0);r.push(new jd(i,a,e))}}*render(t,e){const o=yield this.value.value(t,!1);e.write(o)}*arguments(){yield this.value}}class WM extends Fd{constructor(t){super(t),this.str=t.getContent()}*render(t,e){e.write(this.str)}}class Go{constructor(t,e){this.segments=t,this.location=e}toString(){return di(this.segments,!0)}toArray(){function*t(...e){for(const o of e)o instanceof Go?yield Array.from(t(...o.segments)):yield o}return Array.from(t(...this.segments))}}class Hd{constructor(){this.map=new Map}get(t){const e=di([t.segments[0]]);return this.map.has(e)||this.map.set(e,[]),this.map.get(e)}has(t){return this.map.has(di([t.segments[0]]))}push(t){this.get(t).push(t)}asObject(){return Object.fromEntries(this.map)}}const vm={partials:!0};function*ym(n,t,e){const o=new Hd,s=new Hd,r=new Hd,a=new bm(new Set),i=new Set;function c(p,u){o.push(p);const f=u.alias(p);if(f!==void 0){const h=f.segments[0];It(h)&&!a.has(h)&&s.push(f)}else{const h=p.segments[0];It(h)&&!u.has(h)&&s.push(p)}for(const h of p.segments)h instanceof Go&&c(h,u)}function*d(p,u){if(p.arguments)for(const f of p.arguments())for(const h of km(f))c(h,u);if(p.localScope)for(const f of p.localScope()){u.add(f.content),u.deleteAlias(f.content);const[h,m]=f.getPosition();r.push(new Go([f.content],{row:h,col:m,file:f.file}))}if(p.children)if(p.partialScope){const f=p.partialScope();if(f===void 0){for(const g of yield p.children(t,e))yield d(g,u);return}if(i.has(f.name))return;const h=new Set,m=f.isolated?new bm(h):u.push(h);for(const g of f.scope)if(It(g))h.add(g);else{const[v,y]=g;h.add(v);const k=Array.from(km(y));k.length&&m.setAlias(v,k[0].segments)}for(const g of yield p.children(t,e))yield d(g,m),i.add(f.name);m.pop()}else{p.blockScope&&u.push(new Set(p.blockScope()));for(const f of yield p.children(t,e))yield d(f,u);p.blockScope&&u.pop()}}for(const p of n)yield d(p,a);return{variables:o.asObject(),globals:s.asObject(),locals:r.asObject()}}function vo(n,t={}){const e=Object.assign(Object.assign({},vm),t);return Xn(ym(n,e.partials,!1))}function yo(n,t={}){const e=Object.assign(Object.assign({},vm),t);return Zn(ym(n,e.partials,!0))}class bm{constructor(t){this.stack=[{names:t,aliases:new Map}]}has(t){for(const e of this.stack)if(e.names.has(t))return!0;return!1}push(t){return this.stack.push({names:t,aliases:new Map}),this}pop(){var t;return(t=this.stack.pop())===null||t===void 0?void 0:t.names}add(t){this.stack[0].names.add(t)}alias(t){const e=t.segments[0];if(!It(e))return;const o=this.getAlias(e);if(o!==void 0)return new Go([...o,...t.segments.slice(1)],t.location)}setAlias(t,e){this.stack[this.stack.length-1].aliases.set(t,e)}deleteAlias(t){this.stack[this.stack.length-1].aliases.delete(t)}getAlias(t){for(const e of this.stack){if(e.aliases.has(t))return e.aliases.get(t);if(e.names.has(t))return}}}function*km(n){cn(n)?yield*us(n):n instanceof Ze&&(yield*KM(n))}function*KM(n){for(const t of n.initial.postfix)cn(t)&&(yield*us(t));for(const t of n.filters)for(const e of t.args)mm(e)&&e[1]?yield*us(e[1]):cn(e)&&(yield*us(e))}function*us(n){Cm(n)?(yield*us(n.lhs),yield*us(n.rhs)):pi(n)&&(yield Ud(n))}function Ud(n){const t=[];let e=n.file;const o=n.props[0];e=e||o.file,Kd(o)||Sm(o)||Em(o)?t.push(o.content):pi(o)&&t.push(...Ud(o).segments);for(const a of n.props.slice(1))e=e||a.file,Kd(a)||Sm(a)||Em(a)?t.push(a.content):pi(a)&&t.push(Ud(a));const[s,r]=n.getPosition();return new Go(t,{row:s,col:r,file:e})}const xm=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function di(n,t=!1){const e=[],o=n[0];It(o)&&(!t||o.match(xm)?e.push(`${o}`):e.push(`['${o}']`));for(const s of n.slice(1))s instanceof Go?e.push(`[${di(s.segments)}]`):It(s)?s.match(xm)?e.push(`.${s}`):e.push(`['${s}']`):e.push(`[${s}]`);return e.join("")}var Jo;(function(n){n.Partials="partials",n.Layouts="layouts",n.Root="root"})(Jo||(Jo={}));class _M{constructor(t){if(this.options=t,t.relativeReference){const e=t.fs.sep;Me(e,"`fs.sep` is required for relative reference");const o=["."+e,".."+e,"./","../"];this.shouldLoadRelative=s=>o.some(r=>s.startsWith(r))}else this.shouldLoadRelative=e=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(t,e,o,s){const{fs:r}=this.options,a=this.options[e];for(const i of this.candidates(t,a,s,e!==Jo.Root))if(o?r.existsSync(i):yield r.exists(i))return i;throw this.lookupError(t,a)}*candidates(t,e,o,s){const{fs:r,extname:a}=this.options,i=c=>{if(!s)return!0;for(const d of e)if(this.contains(d,c))return!0;return!1};if(this.shouldLoadRelative(t)&&o){const c=r.resolve(this.dirname(o),t,a);i(c)&&(yield c)}for(const c of e){const d=r.resolve(c,t,a);i(d)&&(yield d)}if(r.fallback!==void 0){const c=r.fallback(t);c!==void 0&&i(c)&&(yield c)}}dirname(t){const e=this.options.fs;return Me(e.dirname,"`fs.dirname` is required for relative reference"),e.dirname(t)}lookupError(t,e){const o=new Error("ENOENT");return o.message=`ENOENT: Failed to lookup "${t}" in "${e}"`,o.code="ENOENT",o}}class Yo{constructor(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new _M(this.liquid.options),this.parseLimit=new Id("parse length",t.options.parseLimit)}parse(t,e){t=String(t),this.parseLimit.use(t.length);const s=new jn(t,this.liquid.options.operators,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(s)}parseTokens(t){let e;const o=[],s=[];for(;e=t.shift();)try{o.push(this.parseToken(e,t))}catch(r){if(this.liquid.options.catchAllErrors)s.push(r);else throw r}if(s.length)throw new Lh(s);return o}parseToken(t,e){try{if(Cl(t)){const o=this.liquid.tags[t.name];return Me(o,`tag "${t.name}" not found`),new o(t,e,this.liquid,this)}return JM(t)?new gm(t,this.liquid):new WM(t)}catch(o){throw Ko.is(o)?o:new zh(o,t)}}parseStream(t){return new hm(t,(e,o)=>this.parseToken(e,o))}*_parseFileCached(t,e,o=Jo.Root,s){const r=this.cache,a=this.loader.shouldLoadRelative(t)?s+","+t:o+":"+t,i=yield r.read(a);if(i)return i;const c=this._parseFile(t,e,o,s),d=e?yield c:Xn(c);r.write(a,d);try{return yield d}catch(p){throw r.remove(a),p}}*_parseFile(t,e,o=Jo.Root,s){const r=yield this.loader.lookup(t,o,e,s);return this.parse(e?this.fs.readFileSync(r):yield this.fs.readFile(r),r)}}var _t;(function(n){n[n.Number=1]="Number",n[n.Literal=2]="Literal",n[n.Tag=4]="Tag",n[n.Output=8]="Output",n[n.HTML=16]="HTML",n[n.Filter=32]="Filter",n[n.Hash=64]="Hash",n[n.PropertyAccess=128]="PropertyAccess",n[n.Word=256]="Word",n[n.Range=512]="Range",n[n.Quoted=1024]="Quoted",n[n.Operator=2048]="Operator",n[n.FilteredValue=4096]="FilteredValue",n[n.Delimited=12]="Delimited"})(_t||(_t={}));function GM(n){return!!(Hn(n)&_t.Delimited)}function wm(n){return Hn(n)===_t.Operator}function Wd(n){return Hn(n)===_t.HTML}function JM(n){return Hn(n)===_t.Output}function Cl(n){return Hn(n)===_t.Tag}function Kd(n){return Hn(n)===_t.Quoted}function Sm(n){return Hn(n)===_t.Number}function pi(n){return Hn(n)===_t.PropertyAccess}function Em(n){return Hn(n)===_t.Word}function Cm(n){return Hn(n)===_t.Range}function cn(n){return(Hn(n)&1667)>0}function Hn(n){return n?n.kind:-1}class Xo{constructor(t={},e=Sl,o={},{memoryLimit:s,renderLimit:r}={}){var a,i,c,d,p;this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!o.sync,this.opts=e,this.globals=(a=o.globals)!==null&&a!==void 0?a:e.globals,this.environments=ei(t)?t:Object(t),this.strictVariables=(i=o.strictVariables)!==null&&i!==void 0?i:this.opts.strictVariables,this.ownPropertyOnly=(c=o.ownPropertyOnly)!==null&&c!==void 0?c:e.ownPropertyOnly,this.memoryLimit=s??new Id("memory alloc",(d=o.memoryLimit)!==null&&d!==void 0?d:e.memoryLimit),this.renderLimit=r??new Id("template render",rm().now()+((p=o.renderLimit)!==null&&p!==void 0?p:e.renderLimit))}getRegister(t){return this.registers[t]=this.registers[t]||{}}setRegister(t,e){return this.registers[t]=e}saveRegister(...t){return t.map(e=>[e,this.getRegister(e)])}restoreRegister(t){return t.forEach(([e,o])=>this.setRegister(e,o))}getAll(){return[this.globals,this.environments,...this.scopes].reduce((t,e)=>ri(t,e),{})}get(t){return this.getSync(t)}getSync(t){return Zn(this._get(t))}*_get(t){const e=this.findScope(t[0]);return yield this._getFromScope(e,t)}getFromScope(t,e){return Zn(this._getFromScope(t,e))}*_getFromScope(t,e,o=this.strictVariables){It(e)&&(e=e.split("."));for(let s=0;s<e.length;s++)if(t=yield this.readProperty(t,e[s]),o&&T3(t))throw new D3(e.slice(0,s+1).join("."));return t}push(t){return this.scopes.push(t)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(t={}){return new Xo(t,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(t){for(let e=this.scopes.length-1;e>=0;e--){const o=this.scopes[e];if(t in o)return o}return t in this.environments?this.environments:this.globals}readProperty(t,e){if(t=Th(t),e=Ut(e),kn(t))return t;if(Ne(t)&&e<0)return t[t.length+ +e];const o=YM(t,e,this.ownPropertyOnly);return o===void 0&&t instanceof Wo?t.liquidMethodMissing(e,this):ue(o)?o.call(t):e==="size"?QM(t):e==="first"?XM(t):e==="last"?ZM(t):o}}function YM(n,t,e){if(!(e&&!Md.call(n,t)&&!(n instanceof Wo)))return n[t]}function XM(n){return Ne(n)?n[0]:n.first}function ZM(n){return Ne(n)?n[n.length-1]:n.last}function QM(n){if(Md.call(n,"size")||n.size!==void 0)return n.size;if(Ne(n)||It(n))return n.length;if(typeof n=="object")return Object.keys(n).length}var Tl;(function(n){n[n.OUTPUT=0]="OUTPUT",n[n.STORE=1]="STORE"})(Tl||(Tl={}));const qM=Jn(Math.abs),$M=Jn(Math.max),t5=Jn(Math.min),e5=Jn(Math.ceil),n5=Jn((n,t,e=!1)=>e?Math.floor(n/t):n/t),o5=Jn(Math.floor),l5=Jn((n,t)=>n-t),s5=Jn((n,t)=>n+t),r5=Jn((n,t)=>n%t),a5=Jn((n,t)=>n*t);function i5(n,t=0){n=Bd(n),t=Bd(t);const e=Math.pow(10,t);return Math.round(n*e)/e}var c5=Object.freeze({__proto__:null,abs:qM,at_least:$M,at_most:t5,ceil:e5,divided_by:n5,floor:o5,minus:l5,plus:s5,modulo:r5,times:a5,round:i5});const d5=n=>decodeURIComponent(at(n)).replace(/\+/g," "),p5=n=>encodeURIComponent(at(n)).replace(/%20/g,"+"),u5=n=>encodeURIComponent(at(n)).replace(/%20/g,"+").replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase()),f5=n=>encodeURI(at(n)).replace(/%5B/g,"[").replace(/%5D/g,"]"),Tm=/[^\p{M}\p{L}\p{Nd}]+/ug,h5={raw:/\s+/g,default:Tm,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/ug,ascii:/[^A-Za-z0-9]+/g,latin:Tm,none:null};function m5(n,t="default",e=!1){n=at(n);const o=h5[t];return o&&(t==="latin"&&(n=g5(n)),n=n.replace(o,"-").replace(/^-|-$/g,"")),e?n:n.toLowerCase()}function g5(n){return n.replace(/[àáâãäå]/g,"a").replace(/[æ]/g,"ae").replace(/[ç]/g,"c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[ð]/g,"d").replace(/[ñ]/g,"n").replace(/[òóôõöø]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ß]/g,"ss").replace(/[œ]/g,"oe").replace(/[þ]/g,"th").replace(/[ẞ]/g,"SS").replace(/[Œ]/g,"OE").replace(/[Þ]/g,"TH")}var v5=Object.freeze({__proto__:null,url_decode:d5,url_encode:p5,cgi_escape:u5,uri_escape:f5,slugify:m5});const y5=ni(function(n,t){const e=Te(n),o=kn(t)?" ":at(t),s=e.length*(1+o.length);return this.context.memoryLimit.use(s),e.join(o)}),b5=ni(n=>Nh(n)?Bh(n):""),k5=ni(n=>Nh(n)?n[0]:""),x5=ni(function(n){const t=Te(n);return this.context.memoryLimit.use(t.length),[...t].reverse()});function*w5(n,t){const e=[],o=Te(n);this.context.memoryLimit.use(o.length);for(const s of o)e.push([s,t?yield this.context._getFromScope(s,at(t).split("."),!1):s]);return e.sort((s,r)=>{const a=s[1],i=r[1];return a<i?-1:a>i?1:0}).map(s=>s[0])}function S5(n,t){const e=at(t),o=t===void 0?Ah:(r,a)=>Ah(r[e],a[e]),s=Te(n);return this.context.memoryLimit.use(s.length),[...s].sort(o)}const E5=n=>n&&n.length||0;function*C5(n,t){const e=[],o=Te(n);this.context.memoryLimit.use(o.length);for(const s of o)e.push(yield this.context._getFromScope(s,at(t),!1));return e}function*T5(n,t){let e=0;const o=Te(n);for(const s of o){const r=Number(t?yield this.context._getFromScope(s,at(t),!1):s);e+=Number.isNaN(r)?0:r}return e}function N5(n){const t=Te(n);return this.context.memoryLimit.use(t.length),t.filter(e=>!kn(Ut(e)))}function Nm(n,t=[]){const e=Te(n),o=Te(t);return this.context.memoryLimit.use(e.length+o.length),e.concat(o)}function M5(n,t){return Nm.call(this,n,[t])}function B5(n,t){const e=Te(n);this.context.memoryLimit.use(e.length);const o=[...e];return o.unshift(t),o}function O5(n){const t=[...Te(n)];return t.pop(),t}function D5(n){const t=Te(n);this.context.memoryLimit.use(t.length);const e=[...t];return e.shift(),e}function V5(n,t,e=1){return n=Ut(n),kn(n)?[]:(Ne(n)||(n=at(n)),t=t<0?n.length+t:t,this.context.memoryLimit.use(e),n.slice(t,t+e))}function Mm(n){return this.context.opts.jekyllWhere?t=>ps.is(n)?go(t,n):Ne(t)?vM(t,n):go(t,n):n===void 0?t=>_o(t,this.context):t=>go(t,n)}function*Bm(n,t,e,o){const s=[];t=Te(t),this.context.memoryLimit.use(t.length);const r=new jn(at(e)).readScopeValue();for(const i of t)s.push(yield ae(r,this.context.spawn(i)));const a=Mm.call(this,o);return t.filter((i,c)=>a(s[c])===n)}function*Om(n,t,e,o){const s=[],r=new Ze(at(o),this.liquid),a=Te(t);this.context.memoryLimit.use(a.length);for(const i of a){this.context.push({[e]:i});const c=yield r.value(this.context);this.context.pop(),c===n&&s.push(i)}return s}function*A5(n,t,e){return yield*Bm.call(this,!0,n,t,e)}function*I5(n,t,e){return yield*Bm.call(this,!1,n,t,e)}function*R5(n,t,e){return yield*Om.call(this,!0,n,t,e)}function*z5(n,t,e){return yield*Om.call(this,!1,n,t,e)}function*P5(n,t){const e=new Map;n=gr(n);const o=new jn(at(t)).readScopeValue();this.context.memoryLimit.use(n.length);for(const s of n){const r=yield ae(o,this.context.spawn(s));e.has(r)||e.set(r,[]),e.get(r).push(s)}return[...e.entries()].map(([s,r])=>({name:s,items:r}))}function*L5(n,t,e){const o=new Map,s=new Ze(at(e),this.liquid);n=gr(n),this.context.memoryLimit.use(n.length);for(const r of n){this.context.push({[t]:r});const a=yield s.value(this.context);this.context.pop(),o.has(a)||o.set(a,[]),o.get(a).push(r)}return[...o.entries()].map(([r,a])=>({name:r,items:a}))}function*_d(n,t,e){const o=new jn(at(t)).readScopeValue(),s=Te(n),r=Mm.call(this,e);for(let a=0;a<s.length;a++){const i=yield ae(o,this.context.spawn(s[a]));if(r(i))return[a,s[a]]}}function*Gd(n,t,e){const o=new Ze(at(e),this.liquid),s=Te(n);for(let r=0;r<s.length;r++){this.context.push({[t]:s[r]});const a=yield o.value(this.context);if(this.context.pop(),a)return[r,s[r]]}}function*F5(n,t,e){return!!(yield*_d.call(this,n,t,e))}function*j5(n,t,e){return!!(yield*Gd.call(this,n,t,e))}function*H5(n,t,e){const o=yield*_d.call(this,n,t,e);return o?o[0]:void 0}function*U5(n,t,e){const o=yield*Gd.call(this,n,t,e);return o?o[0]:void 0}function*W5(n,t,e){const o=yield*_d.call(this,n,t,e);return o?o[1]:void 0}function*K5(n,t,e){const o=yield*Gd.call(this,n,t,e);return o?o[1]:void 0}function _5(n){return n=Te(n),this.context.memoryLimit.use(n.length),[...new Set(n)]}function G5(n,t=1){if(n=Ut(n),kn(n))return[];Ne(n)||(n=at(n)),this.context.memoryLimit.use(t);const e=[...n].sort(()=>Math.random()-.5);return t===1?e[0]:e.slice(0,t)}var J5=Object.freeze({__proto__:null,join:y5,last:b5,first:k5,reverse:x5,sort:w5,sort_natural:S5,size:E5,map:C5,sum:T5,compact:N5,concat:Nm,push:M5,unshift:B5,pop:O5,shift:D5,slice:V5,where:A5,reject:I5,where_exp:R5,reject_exp:z5,group_by:P5,group_by_exp:L5,has:F5,has_exp:j5,find_index:H5,find_index_exp:U5,find:W5,find_exp:K5,uniq:_5,sample:G5});function Jd(n,t,e){var o,s,r;const a=((o=n==null?void 0:n.length)!==null&&o!==void 0?o:0)+((s=t==null?void 0:t.length)!==null&&s!==void 0?s:0)+((r=e==null?void 0:e.length)!==null&&r!==void 0?r:0);this.context.memoryLimit.use(a);const i=Vm(n,this.context.opts,e);return i?(t=Ut(t),t=kn(t)?this.context.opts.dateFormat:at(t),ai(i,t)):n}function Y5(n){return Jd.call(this,n,"%Y-%m-%dT%H:%M:%S%:z")}function X5(n){return Jd.call(this,n,"%a, %d %b %Y %H:%M:%S %z")}function Z5(n,t,e){return Dm.call(this,n,"%b",t,e)}function Q5(n,t,e){return Dm.call(this,n,"%B",t,e)}function Dm(n,t,e,o){const s=Vm(n,this.context.opts);if(!s)return n;if(e==="ordinal"){const r=s.getDate();return o==="US"?ai(s,`${t} ${r}%q, %Y`):ai(s,`${r}%q ${t} %Y`)}return ai(s,`%d ${t} %Y`)}function Vm(n,t,e){let o;const s=e??t.timezoneOffset,r=t.locale;return n=Ut(n),n==="now"||n==="today"?o=new Fn(Date.now(),r,s):ti(n)?o=new Fn(n*1e3,r,s):It(n)?/^\d+$/.test(n)?o=new Fn(+n*1e3,r,s):t.preserveTimezones&&e===void 0?o=Fn.createDateFixedToTimezone(n,r):o=new Fn(n,r,s):o=new Fn(n,r,s),o.valid()?o:void 0}var q5=Object.freeze({__proto__:null,date:Jd,date_to_xmlschema:Y5,date_to_rfc822:X5,date_to_string:Z5,date_to_long_string:Q5});const Yd=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,Am=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;function $5(n,t){Me(arguments.length===2,"append expect 2 arguments");const e=at(n),o=at(t);return this.context.memoryLimit.use(e.length+o.length),e+o}function tB(n,t){Me(arguments.length===2,"prepend expect 2 arguments");const e=at(n),o=at(t);return this.context.memoryLimit.use(e.length+o.length),o+e}function eB(n,t){const e=at(n);if(this.context.memoryLimit.use(e.length),t){t=at(t),this.context.memoryLimit.use(t.length);for(let o=0,s=new Set(t);o<e.length;o++)if(!s.has(e[o]))return e.slice(o);return""}return e.trimStart()}function nB(n){const t=at(n);return this.context.memoryLimit.use(t.length),t.toLowerCase()}function oB(n){const t=at(n);return this.context.memoryLimit.use(t.length),at(t).toUpperCase()}function lB(n,t){const e=at(n);return t=at(t),this.context.memoryLimit.use(e.length+t.length),e.split(t).join("")}function sB(n,t){const e=at(n);return t=at(t),this.context.memoryLimit.use(e.length+t.length),e.replace(t,"")}function rB(n,t){const e=at(n),o=at(t);this.context.memoryLimit.use(e.length+o.length);const s=e.lastIndexOf(o);return s===-1?e:e.substring(0,s)+e.substring(s+o.length)}function aB(n,t){if(n=at(n),this.context.memoryLimit.use(n.length),t){t=at(t),this.context.memoryLimit.use(t.length);for(let e=n.length-1,o=new Set(t);e>=0;e--)if(!o.has(n[e]))return n.slice(0,e+1);return""}return n.trimEnd()}function iB(n,t){const e=at(n);this.context.memoryLimit.use(e.length);const o=e.split(at(t));for(;o.length&&o[o.length-1]==="";)o.pop();return o}function cB(n,t){const e=at(n);if(this.context.memoryLimit.use(e.length),t){const o=new Set(at(t));this.context.memoryLimit.use(o.size);let s=0,r=e.length-1;for(;o.has(e[s]);)s++;for(;r>=s&&o.has(e[r]);)r--;return e.slice(s,r+1)}return e.trim()}function dB(n){const t=at(n);return this.context.memoryLimit.use(t.length),t.replace(/\r?\n/gm,"")}function pB(n){return n=at(n),this.context.memoryLimit.use(n.length),n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()}function uB(n,t,e){const o=at(n);return t=at(t),this.context.memoryLimit.use(o.length+t.length+e.length),o.split(t).join(e)}function fB(n,t,e){const o=at(n);return t=at(t),e=at(e),this.context.memoryLimit.use(o.length+t.length+e.length),o.replace(t,()=>e)}function hB(n,t,e){const o=at(n),s=at(t),r=at(e);this.context.memoryLimit.use(o.length+s.length+r.length);const a=o.lastIndexOf(s);return a===-1?o:o.substring(0,a)+r+o.substring(a+s.length)}function mB(n,t=50,e="..."){const o=at(n);return e=at(e),this.context.memoryLimit.use(o.length+e.length),o.length<=t?n:o.substring(0,t-e.length)+e}function gB(n,t=15,e="..."){const o=at(n);e=at(e),this.context.memoryLimit.use(o.length+e.length);const s=o.split(/\s+/);t<=0&&(t=1);let r=s.slice(0,t).join(" ");return s.length>=t&&(r+=e),r}function vB(n){const t=at(n);return this.context.memoryLimit.use(t.length),t.replace(/\s+/g," ")}function yB(n,t){const e=at(n);if(this.context.memoryLimit.use(e.length),n=e.trim(),!n)return 0;switch(t){case"cjk":return(n.match(Yd)||[]).length+(n.match(Am)||[]).length;case"auto":return Yd.test(n)?n.match(Yd).length+(n.match(Am)||[]).length:n.split(/\s+/).length;default:return n.split(/\s+/).length}}function bB(n,t="and"){switch(t=at(t),this.context.memoryLimit.use(n.length+t.length),n.length){case 0:return"";case 1:return n[0];case 2:return`${n[0]} ${t} ${n[1]}`;default:return`${n.slice(0,-1).join(", ")}, ${t} ${n[n.length-1]}`}}var kB=Object.freeze({__proto__:null,append:$5,prepend:tB,lstrip:eB,downcase:nB,upcase:oB,remove:lB,remove_first:sB,remove_last:rB,rstrip:aB,split:iB,strip:cB,strip_newlines:dB,capitalize:pB,replace:uB,replace_first:fB,replace_last:hB,truncate:mB,truncatewords:gB,normalize_whitespace:vB,number_of_words:yB,array_to_sentence_string:bB});function xB(n){return btoa(String.fromCharCode(...new TextEncoder().encode(n)))}function wB(n){return new TextDecoder().decode(Uint8Array.from(atob(n),t=>t.charCodeAt(0)))}function SB(n){const t=at(n);return this.context.memoryLimit.use(t.length),xB(t)}function EB(n){const t=at(n);return this.context.memoryLimit.use(t.length),wB(t)}var CB=Object.freeze({__proto__:null,base64_encode:SB,base64_decode:EB});const Im=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},RM),c5),v5),J5),q5),kB),CB),fm);class Rm extends ee{constructor(t,e,o){super(t,e,o),this.identifier=this.tokenizer.readIdentifier(),this.key=this.identifier.content,this.tokenizer.assert(this.key,"expected variable name"),this.tokenizer.skipBlank(),this.tokenizer.assert(this.tokenizer.peek()==="=",'expected "="'),this.tokenizer.advance(),this.value=new Ze(this.tokenizer.readFilteredValue(),this.liquid)}*render(t){t.bottom()[this.key]=yield this.value.value(t,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}}const zm=["offset","limit","reversed"];class Pm extends ee{constructor(t,e,o,s){super(t,e,o);const r=this.tokenizer.readIdentifier(),a=this.tokenizer.readIdentifier(),i=this.tokenizer.readValue();if(!r.size()||a.content!=="in"||!i)throw new Error(`illegal tag: ${t.getText()}`);this.variable=r.content,this.collection=i,this.hash=new El(this.tokenizer,o.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];let c;const d=s.parseStream(e).on("start",()=>c=this.templates).on("tag:else",p=>{si(p.args),c=this.elseTemplates}).on("tag:endfor",p=>{si(p.args),d.stop()}).on("template",p=>c.push(p)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});d.start()}*render(t,e){const o=this.liquid.renderer;let s=gr(yield ae(this.collection,t));if(!s.length){yield o.renderTemplates(this.elseTemplates,t,e);return}const r="continue-"+this.variable+"-"+this.collection.getText();t.push({continue:t.getRegister(r)});const a=yield this.hash.render(t);t.pop(),s=(this.liquid.options.orderedFilterParameters?Object.keys(a).filter(d=>zm.includes(d)):zm.filter(d=>a[d]!==void 0)).reduce((d,p)=>p==="offset"?NB(d,a.offset):p==="limit"?MB(d,a.limit):TB(d),s),t.setRegister(r,(a.offset||0)+s.length);const c={forloop:new Dd(s.length,this.collection.getText(),this.variable)};t.push(c);for(const d of s){if(c[this.variable]=d,t.continueCalled=t.breakCalled=!1,yield o.renderTemplates(this.templates,t,e),t.breakCalled)break;c.forloop.next()}t.continueCalled=t.breakCalled=!1,t.pop()}*children(){const t=this.templates.slice();return this.elseTemplates&&t.push(...this.elseTemplates),t}*arguments(){yield this.collection;for(const t of Object.values(this.hash.hash))cn(t)&&(yield t)}blockScope(){return[this.variable,"forloop"]}}function TB(n){return[...n].reverse()}function NB(n,t){return n.slice(t)}function MB(n,t){return n.slice(0,t)}class Lm extends ee{constructor(t,e,o,s){for(super(t,e,o),this.templates=[],this.identifier=this.readVariable(),this.variable=this.identifier.content;e.length;){const r=e.shift();if(Cl(r)&&r.name==="endcapture")return;this.templates.push(s.parseToken(r,e))}throw new Error(`tag ${t.getText()} not closed`)}readVariable(){let t=this.tokenizer.readIdentifier();if(t.content||(t=this.tokenizer.readQuoted(),t))return t;throw this.tokenizer.error("invalid capture name")}*render(t){const o=yield this.liquid.renderer.renderTemplates(this.templates,t);t.bottom()[this.variable]=o}*children(){return this.templates}*localScope(){yield this.identifier}}class Fm extends ee{constructor(t,e,o,s){super(t,e,o),this.branches=[],this.elseTemplates=[],this.value=new Ze(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let r=[],a=0;const i=s.parseStream(e).on("tag:when",c=>{if(a>0)return;r=[];const d=[];for(;!c.tokenizer.end();)d.push(c.tokenizer.readValueOrThrow()),c.tokenizer.skipBlank(),c.tokenizer.peek()===","?c.tokenizer.readTo(","):c.tokenizer.readTo("or");this.branches.push({values:d,templates:r})}).on("tag:else",()=>{a++,r=this.elseTemplates}).on("tag:endcase",()=>i.stop()).on("template",c=>{(r!==this.elseTemplates||a===1)&&r.push(c)}).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});i.start()}*render(t,e){const o=this.liquid.renderer,s=Ut(yield this.value.value(t,t.opts.lenientIf));let r=!1;for(const a of this.branches)for(const i of a.values){const c=yield ae(i,t,t.opts.lenientIf);if(go(s,c)){yield o.renderTemplates(a.templates,t,e),r=!0;break}}r||(yield o.renderTemplates(this.elseTemplates,t,e))}*arguments(){yield this.value,yield*this.branches.flatMap(t=>t.values)}*children(){const t=this.branches.flatMap(e=>e.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}}class jm extends ee{constructor(t,e,o){for(super(t,e,o);e.length;){const s=e.shift();if(Cl(s)&&s.name==="endcomment")return}throw new Error(`tag ${t.getText()} not closed`)}render(){}}class Hm extends ee{constructor(t,e,o,s){super(t,e,o);const r=this.tokenizer;for(this.file=Xd(r,this.liquid,s),this.currentFile=t.file;!r.end();){r.skipBlank();const a=r.p,i=r.readIdentifier();if((i.content==="with"||i.content==="for")&&(r.skipBlank(),r.peek()!==":")){const c=r.readValue();if(c){const d=r.p,p=r.readIdentifier();let u;p.content==="as"?u=r.readIdentifier():r.p=d,this[i.content]={value:c,alias:u&&u.content},r.skipBlank(),r.peek()===","&&r.advance();continue}}r.p=a;break}this.hash=new El(r,o.options.keyValueSeparator)}*render(t,e){const{liquid:o,hash:s}=this,r=yield Zd(this.file,t,o);Me(r,()=>`illegal file path "${r}"`);const a=t.spawn(),i=a.bottom();if(ri(i,yield s.render(t)),this.with){const{value:c,alias:d}=this.with;i[d||r]=yield ae(c,t)}if(this.for){const{value:c,alias:d}=this.for,p=gr(yield ae(c,t));i.forloop=new Dd(p.length,c.getText(),d);for(const u of p){i[d]=u;const f=yield o._parsePartialFile(r,a.sync,this.currentFile);yield o.renderer.renderTemplates(f,a,e),i.forloop.next()}}else{const c=yield o._parsePartialFile(r,a.sync,this.currentFile);yield o.renderer.renderTemplates(c,a,e)}}*children(t,e){return t&&It(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(It(this.file)){const t=Object.keys(this.hash.hash);if(this.with){const{value:e,alias:o}=this.with;It(o)?t.push([o,e]):It(this.file)&&t.push([this.file,e])}if(this.for){const{value:e,alias:o}=this.for;It(o)?t.push([o,e]):It(this.file)&&t.push([this.file,e])}return{name:this.file,isolated:!0,scope:t}}}*arguments(){for(const t of Object.values(this.hash.hash))cn(t)&&(yield t);if(this.with){const{value:t}=this.with;cn(t)&&(yield t)}if(this.for){const{value:t}=this.for;cn(t)&&(yield t)}}}function Xd(n,t,e){if(t.options.dynamicPartials){const r=n.readValue();if(n.assert(r,"illegal file path"),r.getText()==="none")return;if(Kd(r)){const a=e.parse(im(r));return Um(a)}return r}const o=[...n.readFileNameTemplate(t.options)],s=Um(e.parseTokens(o));return s==="none"?void 0:s}function Um(n){return n.length===1&&Wd(n[0].token)?n[0].token.getContent():n}function*Zd(n,t,e){return typeof n=="string"?n:Array.isArray(n)?e.renderer.renderTemplates(n,t):yield ae(n,t)}class Wm extends ee{constructor(t,e,o,s){super(t,e,o);const{tokenizer:r}=t;this.file=Xd(r,this.liquid,s),this.currentFile=t.file;const a=r.p;r.readIdentifier().content==="with"?(r.skipBlank(),r.peek()!==":"?this.withVar=r.readValue():r.p=a):r.p=a,this.hash=new El(r,o.options.jekyllInclude||o.options.keyValueSeparator)}*render(t,e){const{liquid:o,hash:s,withVar:r}=this,{renderer:a}=o,i=yield Zd(this.file,t,o);Me(i,()=>`illegal file path "${i}"`);const c=t.saveRegister("blocks","blockMode");t.setRegister("blocks",{}),t.setRegister("blockMode",Tl.OUTPUT);const d=yield s.render(t);r&&(d[i]=yield ae(r,t));const p=yield o._parsePartialFile(i,t.sync,this.currentFile);t.push(t.opts.jekyllInclude?{include:d}:d),yield a.renderTemplates(p,t,e),t.pop(),t.restoreRegister(c)}*children(t,e){return t&&It(this.file)?yield this.liquid._parsePartialFile(this.file,e,this.currentFile):[]}partialScope(){if(It(this.file)){let t;return this.liquid.options.jekyllInclude?t=["include"]:(t=Object.keys(this.hash.hash),this.withVar&&t.push([this.file,this.withVar])),{name:this.file,isolated:!1,scope:t}}}*arguments(){yield*Object.values(this.hash.hash).filter(cn),cn(this.file)&&(yield this.file),cn(this.withVar)&&(yield this.withVar)}}class Km extends ee{constructor(t,e,o){super(t,e,o),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const o=t.environments;ti(o[this.variable])||(o[this.variable]=0),e.write(at(--o[this.variable]))}*localScope(){yield this.identifier}}class _m extends ee{constructor(t,e,o){super(t,e,o),this.candidates=[];const s=this.tokenizer.readValue();for(this.tokenizer.skipBlank(),s&&(this.tokenizer.peek()===":"?(this.group=s,this.tokenizer.advance()):this.candidates.push(s));!this.tokenizer.end();){const r=this.tokenizer.readValue();r&&this.candidates.push(r),this.tokenizer.readTo(",")}this.tokenizer.assert(this.candidates.length,()=>`empty candidates: "${t.getText()}"`)}*render(t,e){const s=`cycle:${yield ae(this.group,t)}:`+this.candidates.join(","),r=t.getRegister("cycle");let a=r[s];a===void 0&&(a=r[s]=0);const i=this.candidates[a];return a=(a+1)%this.candidates.length,r[s]=a,yield ae(i,t)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}}class Gm extends ee{constructor(t,e,o,s){super(t,e,o),this.branches=[];let r=[];s.parseStream(e).on("start",()=>this.branches.push({value:new Ze(t.tokenizer.readFilteredValue(),this.liquid),templates:r=[]})).on("tag:elsif",a=>{Me(!this.elseTemplates,"unexpected elsif after else"),this.branches.push({value:new Ze(a.tokenizer.readFilteredValue(),this.liquid),templates:r=[]})}).on("tag:else",a=>{si(a.args),Me(!this.elseTemplates,"duplicated else"),r=this.elseTemplates=[]}).on("tag:endif",function(a){si(a.args),this.stop()}).on("template",a=>r.push(a)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)}).start()}*render(t,e){const o=this.liquid.renderer;for(const{value:s,templates:r}of this.branches){const a=yield s.value(t,t.opts.lenientIf);if(_o(a,t)){yield o.renderTemplates(r,t,e);return}}yield o.renderTemplates(this.elseTemplates||[],t,e)}*children(){const t=this.branches.flatMap(e=>e.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map(t=>t.value)}}class Jm extends ee{constructor(t,e,o){super(t,e,o),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(t,e){const o=t.environments;ti(o[this.variable])||(o[this.variable]=0);const s=o[this.variable];o[this.variable]++,e.write(at(s))}*localScope(){yield this.identifier}}class Ym extends ee{constructor(t,e,o,s){super(t,e,o),this.file=Xd(this.tokenizer,this.liquid,s),this.currentFile=t.file,this.args=new El(this.tokenizer,o.options.keyValueSeparator),this.templates=s.parseTokens(e)}*render(t,e){const{liquid:o,args:s,file:r}=this,{renderer:a}=o;if(r===void 0){t.setRegister("blockMode",Tl.OUTPUT),yield a.renderTemplates(this.templates,t,e);return}const i=yield Zd(this.file,t,o);Me(i,()=>`illegal file path "${i}"`);const c=yield o._parseLayoutFile(i,t.sync,this.currentFile);t.setRegister("blockMode",Tl.STORE);const d=yield a.renderTemplates(this.templates,t),p=t.getRegister("blocks");p[""]===void 0&&(p[""]=(u,f)=>f.write(d)),t.setRegister("blockMode",Tl.OUTPUT),t.push(yield s.render(t)),yield a.renderTemplates(c,t,e),t.pop()}*children(t){const e=this.templates.slice();return t&&It(this.file)&&e.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),e}*arguments(){for(const t of Object.values(this.args.hash))cn(t)&&(yield t);cn(this.file)&&(yield this.file)}partialScope(){if(It(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}}class Xm extends ee{constructor(t,e,o,s){super(t,e,o),this.templates=[];const r=/\w+/.exec(t.args);for(this.block=r?r[0]:"";e.length;){const a=e.shift();if(Cl(a)&&a.name==="endblock")return;const i=s.parseToken(a,e);this.templates.push(i)}throw new Error(`tag ${t.getText()} not closed`)}*render(t,e){const o=this.getBlockRender(t);t.getRegister("blockMode")===Tl.STORE?t.getRegister("blocks")[this.block]=o:yield o(new Kh,e)}getBlockRender(t){const{liquid:e,templates:o}=this,s=t.getRegister("blocks")[this.block],r=function*(a,i){t.push({block:a}),yield e.renderer.renderTemplates(o,t,i),t.pop()};return s?(a,i)=>s(new Kh(c=>r(a,c)),i):r}*children(){return this.templates}blockScope(){return["block"]}}class Zm extends ee{constructor(t,e,o){for(super(t,e,o),this.tokens=[];e.length;){const s=e.shift();if(Cl(s)&&s.name==="endraw")return;this.tokens.push(s)}throw new Error(`tag ${t.getText()} not closed`)}render(){return this.tokens.map(t=>t.getText()).join("")}}class BB extends Dd{constructor(t,e,o,s){super(t,o,s),this.length=t,this.cols=e}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return this.col0()===0}col_last(){return this.col()===this.cols}}class Qm extends ee{constructor(t,e,o,s){super(t,e,o);const r=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();const a=this.tokenizer.readIdentifier(),i=this.tokenizer.readValue();if(a.content!=="in"||!i)throw new Error(`illegal tag: ${t.getText()}`);this.variable=r.content,this.collection=i,this.args=new El(this.tokenizer,o.options.keyValueSeparator),this.templates=[];let c;const d=s.parseStream(e).on("start",()=>c=this.templates).on("tag:endtablerow",()=>d.stop()).on("template",p=>c.push(p)).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)});d.start()}*render(t,e){let o=gr(yield ae(this.collection,t));const s=yield this.args.render(t),r=s.offset||0,a=s.limit===void 0?o.length:s.limit;o=o.slice(r,r+a);const i=s.cols||o.length,c=this.liquid.renderer,d=new BB(o.length,i,this.collection.getText(),this.variable),p={tablerowloop:d};t.push(p);for(let u=0;u<o.length;u++,d.next())p[this.variable]=o[u],d.col0()===0&&(d.row()!==1&&e.write("</tr>"),e.write(`<tr class="row${d.row()}">`)),e.write(`<td class="col${d.col()}">`),yield c.renderTemplates(this.templates,t,e),e.write("</td>");o.length&&e.write("</tr>"),t.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(const t of Object.values(this.args.hash))cn(t)&&(yield t)}blockScope(){return[this.variable,"tablerowloop"]}}class qm extends ee{constructor(t,e,o,s){super(t,e,o),this.branches=[],this.elseTemplates=[];let r=[],a=0;s.parseStream(e).on("start",()=>this.branches.push({value:new Ze(t.tokenizer.readFilteredValue(),this.liquid),test:yr,templates:r=[]})).on("tag:elsif",i=>{if(a>0){r=[];return}this.branches.push({value:new Ze(i.tokenizer.readFilteredValue(),this.liquid),test:_o,templates:r=[]})}).on("tag:else",()=>{a++,r=this.elseTemplates}).on("tag:endunless",function(){this.stop()}).on("template",i=>{(r!==this.elseTemplates||a===1)&&r.push(i)}).on("end",()=>{throw new Error(`tag ${t.getText()} not closed`)}).start()}*render(t,e){const o=this.liquid.renderer;for(const{value:s,test:r,templates:a}of this.branches){const i=yield s.value(t,t.opts.lenientIf);if(r(i,t)){yield o.renderTemplates(a,t,e);return}}yield o.renderTemplates(this.elseTemplates,t,e)}*children(){const t=this.branches.flatMap(e=>e.templates);return this.elseTemplates&&t.push(...this.elseTemplates),t}arguments(){return this.branches.map(t=>t.value)}}class $m extends ee{render(t,e){t.breakCalled=!0}}class tg extends ee{render(t,e){t.continueCalled=!0}}class eg extends ee{constructor(t,e,o){super(t,e,o),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new Ze(this.tokenizer.readFilteredValue(),this.liquid))}*render(t,e){if(!this.value)return;const o=yield this.value.value(t,!1);e.write(o)}*arguments(){this.value&&(yield this.value)}}class ng extends ee{constructor(t,e,o,s){super(t,e,o);const r=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=s.parseTokens(r)}*render(t,e){yield this.liquid.renderer.renderTemplates(this.templates,t,e)}*children(){return this.templates}}class og extends ee{constructor(t,e,o){if(super(t,e,o),t.args.search(/\n\s*[^#\s]/g)!==-1)throw new Error("every line of an inline comment must start with a '#' character")}render(){}}const lg={assign:Rm,for:Pm,capture:Lm,case:Fm,comment:jm,include:Wm,render:Hm,decrement:Km,increment:Jm,cycle:_m,if:Gm,layout:Ym,block:Xm,raw:Zm,tablerow:Qm,unless:qm,break:$m,continue:tg,echo:eg,liquid:ng,"#":og};class Qd{constructor(t={}){this.renderer=new uM,this.filters={},this.tags={},this.options=PM(t),this.parser=new Yo(this),Mh(lg,(e,o)=>this.registerTag(o,e)),Mh(Im,(e,o)=>this.registerFilter(o,e))}parse(t,e){return new Yo(this).parse(t,e)}_render(t,e,o){const s=e instanceof Xo?e:new Xo(e,this.options,o);return this.renderer.renderTemplates(t,s)}render(t,e,o){return fe(this,void 0,void 0,function*(){return Xn(this._render(t,e,Object.assign(Object.assign({},o),{sync:!1})))})}renderSync(t,e,o){return Zn(this._render(t,e,Object.assign(Object.assign({},o),{sync:!0})))}renderToNodeStream(t,e,o={}){const s=new Xo(e,this.options,o);return this.renderer.renderTemplatesToNodeStream(t,s)}_parseAndRender(t,e,o){const s=this.parse(t);return this._render(s,e,o)}parseAndRender(t,e,o){return fe(this,void 0,void 0,function*(){return Xn(this._parseAndRender(t,e,Object.assign(Object.assign({},o),{sync:!1})))})}parseAndRenderSync(t,e,o){return Zn(this._parseAndRender(t,e,Object.assign(Object.assign({},o),{sync:!0})))}_parsePartialFile(t,e,o){return new Yo(this).parseFile(t,e,Jo.Partials,o)}_parseLayoutFile(t,e,o){return new Yo(this).parseFile(t,e,Jo.Layouts,o)}_parseFile(t,e,o,s){return new Yo(this).parseFile(t,e,o,s)}parseFile(t,e){return fe(this,void 0,void 0,function*(){return Xn(new Yo(this).parseFile(t,!1,e))})}parseFileSync(t,e){return Zn(new Yo(this).parseFile(t,!0,e))}*_renderFile(t,e,o){const s=yield this._parseFile(t,o.sync,o.lookupType);return yield this._render(s,e,o)}renderFile(t,e,o){return fe(this,void 0,void 0,function*(){return Xn(this._renderFile(t,e,Object.assign(Object.assign({},o),{sync:!1})))})}renderFileSync(t,e,o){return Zn(this._renderFile(t,e,Object.assign(Object.assign({},o),{sync:!0})))}renderFileToNodeStream(t,e,o){return fe(this,void 0,void 0,function*(){const s=yield this.parseFile(t);return this.renderToNodeStream(s,e,o)})}_evalValue(t,e){const o=new Ze(t,this),s=e instanceof Xo?e:new Xo(e,this.options);return o.value(s)}evalValue(t,e){return fe(this,void 0,void 0,function*(){return Xn(this._evalValue(t,e))})}evalValueSync(t,e){return Zn(this._evalValue(t,e))}registerFilter(t,e){this.filters[t]=e}registerTag(t,e){this.tags[t]=ue(e)?e:UM(e)}plugin(t){return t.call(this,Qd)}express(){const t=this;let e=!0;return function(o,s,r){if(e){e=!1;const a=ci(this.root);t.options.root.unshift(...a),t.options.layouts.unshift(...a),t.options.partials.unshift(...a)}t.renderFile(o,s).then(a=>r(null,a),r)}}analyze(t,e={}){return fe(this,void 0,void 0,function*(){return vo(t,e)})}analyzeSync(t,e={}){return yo(t,e)}parseAndAnalyze(t,e,o={}){return fe(this,void 0,void 0,function*(){return vo(this.parse(t,e),o)})}parseAndAnalyzeSync(t,e,o={}){return yo(this.parse(t,e),o)}variables(t,e={}){return fe(this,void 0,void 0,function*(){const o=yield vo(It(t)?this.parse(t):t,e);return Object.keys(o.variables)})}variablesSync(t,e={}){const o=yo(It(t)?this.parse(t):t,e);return Object.keys(o.variables)}fullVariables(t,e={}){return fe(this,void 0,void 0,function*(){const o=yield vo(It(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(o.variables).flatMap(s=>s.map(r=>String(r)))))})}fullVariablesSync(t,e={}){const o=yo(It(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(o.variables).flatMap(s=>s.map(r=>String(r)))))}variableSegments(t,e={}){return fe(this,void 0,void 0,function*(){const o=yield vo(It(t)?this.parse(t):t,e);return Array.from(oi(Object.values(o.variables).flatMap(s=>s.map(r=>r.toArray()))))})}variableSegmentsSync(t,e={}){const o=yo(It(t)?this.parse(t):t,e);return Array.from(oi(Object.values(o.variables).flatMap(s=>s.map(r=>r.toArray()))))}globalVariables(t,e={}){return fe(this,void 0,void 0,function*(){const o=yield vo(It(t)?this.parse(t):t,e);return Object.keys(o.globals)})}globalVariablesSync(t,e={}){const o=yo(It(t)?this.parse(t):t,e);return Object.keys(o.globals)}globalFullVariables(t,e={}){return fe(this,void 0,void 0,function*(){const o=yield vo(It(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(o.globals).flatMap(s=>s.map(r=>String(r)))))})}globalFullVariablesSync(t,e={}){const o=yo(It(t)?this.parse(t):t,e);return Array.from(new Set(Object.values(o.globals).flatMap(s=>s.map(r=>String(r)))))}globalVariableSegments(t,e={}){return fe(this,void 0,void 0,function*(){const o=yield vo(It(t)?this.parse(t):t,e);return Array.from(oi(Object.values(o.globals).flatMap(s=>s.map(r=>r.toArray()))))})}globalVariableSegmentsSync(t,e={}){const o=yo(It(t)?this.parse(t):t,e);return Array.from(oi(Object.values(o.globals).flatMap(s=>s.map(r=>r.toArray()))))}}const OB=Object.freeze(Object.defineProperty({__proto__:null,AssertionError:jh,AssignTag:Rm,BlockTag:Xm,BreakTag:$m,CaptureTag:Lm,CaseTag:Fm,CommentTag:jm,Context:Xo,ContinueTag:tg,CycleTag:_m,DecrementTag:Km,Drop:Wo,EchoTag:eg,Expression:am,Filter:jd,ForTag:Pm,Hash:El,IfTag:Gm,IncludeTag:Wm,IncrementTag:Jm,InlineCommentTag:og,LayoutTag:Ym,Liquid:Qd,LiquidError:Ko,LiquidTag:ng,get LookupType(){return Jo},Output:gm,ParseError:zh,ParseStream:hm,Parser:Yo,RawTag:Zm,RenderError:Ph,RenderTag:Hm,TablerowTag:Qm,Tag:ee,TagToken:zd,Token:an,get TokenKind(){return _t},TokenizationError:Rh,Tokenizer:jn,UndefinedVariableError:Fh,UnlessTag:qm,Value:Ze,Variable:Go,analyze:vo,analyzeSync:yo,assert:Me,createTrie:Vd,defaultOperators:cm,defaultOptions:Sl,evalQuotedToken:im,evalToken:ae,filters:Im,isFalsy:yr,isTruthy:_o,tags:lg,toPromise:Xn,toValue:Ut,toValueSync:Zn},Symbol.toStringTag,{value:"Module"})),DB={class:"tpl-text-editor-wrapper tpl:relative"},VB=["title"],AB=["title"],IB=["title"],RB=["title"],zB=["title"],PB=["title"],LB=["title"],FB=["title"],jB=["title"],HB=["title"],UB=["title"],WB=["title"],KB=["title"],_B={class:"tpl:relative"},GB=["title"],JB={key:0,class:"tpl-emoji-picker tpl:absolute tpl:top-full tpl:left-0 tpl:z-10 tpl:mt-2 tpl:w-72 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:shadow-lg"},YB={class:"tpl:mb-1.5 tpl:text-[10px] tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase"},XB={class:"tpl:grid tpl:grid-cols-10 tpl:gap-0.5"},ZB=["onClick"],QB={key:0,class:"tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"},qB=["title"],$B={key:1,class:"tpl:flex tpl:items-center tpl:gap-2 tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"},tO={key:0,class:"tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-indigo-500 tpl:p-2"},eO={class:"tpl:w-[400px] tpl:overflow-hidden tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:shadow-lg"},nO={class:"tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-5 tpl:py-4"},oO={class:"tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"},lO={class:"tpl:p-5"},sO={class:"tpl:mb-4 tpl:last:mb-0"},rO={class:"tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase"},aO=["placeholder"],iO={class:"tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:px-5 tpl:py-4"},cO={class:"tpl:ml-auto tpl:flex tpl:gap-2"},dO=Object.freeze(Object.defineProperty({__proto__:null,default:l.defineComponent({__name:"TextEditor",props:{block:{},toolbarPosition:{}},emits:["done"],setup(n,{emit:t}){const e=n,o=t,s=l.inject("editor"),r=l.inject("themeStyles"),{mergeTags:a,isEnabled:i,isRequesting:c,requestMergeTag:d,syntax:p}=jo(),u=l.ref(!1),f=l.ref(""),{categories:h,isOpen:m,toggle:g,close:v}=t2(),{t:y}=jt();function k(z){var P;(P=S.value)==null||P.chain().focus().insertContent(z).run(),v()}const S=l.shallowRef(null),b=l.shallowRef(null),w=l.ref(!0);async function x(){try{const[{Editor:z},{EditorContent:P},{default:U},{default:O},{default:W},{default:lt},{default:ht},{default:gt},{MergeTagNode:bt,LogicMergeTagNode:Pt}]=await Promise.all([Promise.resolve().then(()=>e0),Promise.resolve().then(()=>KI),Promise.resolve().then(()=>K6),Promise.resolve().then(()=>g8),Promise.resolve().then(()=>v8),Promise.resolve().then(()=>y8),Promise.resolve().then(()=>b8),Promise.resolve().then(()=>k8),Promise.resolve().then(()=>N8)]);b.value=P;const Ct=[U.configure({heading:!1,codeBlock:!1,blockquote:!1,horizontalRule:!1}),W,lt,ht,O.configure({openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),gt.configure({types:["paragraph","heading"]}),bt.configure({mergeTags:a,syntax:p}),Pt.configure({syntax:p})],Nt=new Map;Ct.forEach((xt,K)=>Nt.set(xt.name,K));const St=Ct.filter((xt,K)=>Nt.get(xt.name)===K);S.value=new z({extensions:St,content:e.block.content,editable:!0,onUpdate:({editor:xt})=>{s&&s.updateBlock(e.block.id,{content:xt.getHTML()})}}),w.value=!1,setTimeout(()=>{var xt;(xt=S.value)==null||xt.commands.focus("end")},0)}catch(z){console.error("[TextEditor] Failed to initialize TipTap editor:",z),w.value=!1}}x(),l.watch(()=>e.block.content,z=>{S.value&&S.value.getHTML()!==z&&S.value.commands.setContent(z,!1)});function E(z){if(c.value)return;const P=z.target;m.value&&!P.closest(".tpl-emoji-picker")&&v(),!(P.closest(".tpl-text-editor-wrapper")||P.closest(".tpl-text-toolbar")||P.closest(".tpl-link-dialog"))&&o("done")}Ro(document,"mousedown",E),l.onBeforeUnmount(()=>{var z;(z=S.value)==null||z.destroy()});function B(){var P;const z=((P=S.value)==null?void 0:P.getAttributes("link").href)||"";f.value=z,u.value=!0}function C(){var z;if(f.value){const P=f.value.startsWith("http")?f.value:`https://${f.value}`;(z=S.value)==null||z.chain().focus().extendMarkRange("link").setLink({href:P}).run()}R()}function D(){var z;(z=S.value)==null||z.chain().focus().extendMarkRange("link").unsetLink().run(),R()}function R(){u.value=!1,f.value=""}function N(z){z.key==="Enter"?(z.preventDefault(),C()):z.key==="Escape"&&R()}async function L(){var P;const z=await d();z&&S.value?S.value.chain().focus().insertMergeTag({label:z.label,value:z.value}).run():(P=S.value)==null||P.commands.focus()}return(z,P)=>{var U,O,W,lt,ht,gt,bt,Pt,Ct,Nt,St,xt,K,nt,F;return l.openBlock(),l.createElementBlock("div",DB,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createElementVNode("div",{class:"tpl tpl-text-toolbar tpl:fixed tpl:z-[9999] tpl:flex tpl:items-center tpl:gap-1 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:shadow-lg",style:l.normalizeStyle({...l.unref(r),top:`${n.toolbarPosition.top}px`,left:`${n.toolbarPosition.left}px`,transform:"translateY(-100%)"})},[!w.value&&S.value?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(U=S.value)==null?void 0:U.isActive("bold")}]),title:l.unref(y).textEditor.bold,onClick:P[0]||(P[0]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().toggleBold().run()})},[l.createVNode(l.unref(sk),{size:16,"stroke-width":2.5})],10,VB),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(O=S.value)==null?void 0:O.isActive("italic")}]),title:l.unref(y).textEditor.italic,onClick:P[1]||(P[1]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().toggleItalic().run()})},[l.createVNode(l.unref(vk),{size:16,"stroke-width":2})],10,AB),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(W=S.value)==null?void 0:W.isActive("underline")}]),title:l.unref(y).textEditor.underline,onClick:P[2]||(P[2]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().toggleUnderline().run()})},[l.createVNode(l.unref(Hk),{size:16,"stroke-width":2})],10,IB),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(lt=S.value)==null?void 0:lt.isActive("strike")}]),title:l.unref(y).textEditor.strikethrough,onClick:P[3]||(P[3]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().toggleStrike().run()})},[l.createVNode(l.unref(zk),{size:16,"stroke-width":2})],10,RB),P[14]||(P[14]=l.createElementVNode("span",{class:"tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"},null,-1)),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(ht=S.value)==null?void 0:ht.isActive("subscript")}]),title:l.unref(y).textEditor.subscript,onClick:P[4]||(P[4]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().toggleSubscript().run()})},[l.createVNode(l.unref(Pk),{size:16,"stroke-width":2})],10,zB),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(gt=S.value)==null?void 0:gt.isActive("superscript")}]),title:l.unref(y).textEditor.superscript,onClick:P[5]||(P[5]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().toggleSuperscript().run()})},[l.createVNode(l.unref(Fk),{size:16,"stroke-width":2})],10,PB),P[15]||(P[15]=l.createElementVNode("span",{class:"tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"},null,-1)),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(bt=S.value)==null?void 0:bt.isActive("link")}]),title:l.unref(y).textEditor.addLink,onClick:B},[l.createVNode(l.unref(bk),{size:16,"stroke-width":2})],10,LB),P[16]||(P[16]=l.createElementVNode("span",{class:"tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"},null,-1)),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(Pt=S.value)==null?void 0:Pt.isActive("bulletList")}]),title:l.unref(y).textEditor.bulletList,onClick:P[6]||(P[6]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().toggleBulletList().run()})},[l.createVNode(l.unref(xk),{size:16,"stroke-width":2})],10,FB),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(Ct=S.value)==null?void 0:Ct.isActive("orderedList")}]),title:l.unref(y).textEditor.numberedList,onClick:P[7]||(P[7]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().toggleOrderedList().run()})},[l.createVNode(l.unref(kk),{size:16,"stroke-width":2})],10,jB),P[17]||(P[17]=l.createElementVNode("span",{class:"tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"},null,-1)),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(Nt=S.value)==null?void 0:Nt.isActive({textAlign:"left"})}]),title:l.unref(y).textEditor.alignLeft,onClick:P[8]||(P[8]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().setTextAlign("left").run()})},[l.createVNode(l.unref(Js),{size:16,"stroke-width":2})],10,HB),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(St=S.value)==null?void 0:St.isActive({textAlign:"center"})}]),title:l.unref(y).textEditor.alignCenter,onClick:P[9]||(P[9]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().setTextAlign("center").run()})},[l.createVNode(l.unref(Gs),{size:16,"stroke-width":2})],10,UB),l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":(xt=S.value)==null?void 0:xt.isActive({textAlign:"right"})}]),title:l.unref(y).textEditor.alignRight,onClick:P[10]||(P[10]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().setTextAlign("right").run()})},[l.createVNode(l.unref(Ys),{size:16,"stroke-width":2})],10,WB),P[18]||(P[18]=l.createElementVNode("span",{class:"tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"},null,-1)),l.createElementVNode("button",{type:"button",class:"tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",title:l.unref(y).textEditor.clearFormatting,onClick:P[11]||(P[11]=T=>{var Y;return(Y=S.value)==null?void 0:Y.chain().focus().clearNodes().unsetAllMarks().run()})},[l.createVNode(l.unref(Nk),{size:16,"stroke-width":2})],8,KB),P[19]||(P[19]=l.createElementVNode("span",{class:"tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"},null,-1)),l.createElementVNode("div",_B,[l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",{"tpl:!bg-[var(--tpl-primary)] tpl:!text-white":l.unref(m)}]),title:l.unref(y).textEditor.insertEmoji,onClick:P[12]||(P[12]=(...T)=>l.unref(g)&&l.unref(g)(...T))},[l.createVNode(l.unref(Ak),{size:16,"stroke-width":2})],10,GB),l.unref(m)?(l.openBlock(),l.createElementBlock("div",JB,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(h),T=>(l.openBlock(),l.createElementBlock("div",{key:T.key,class:"tpl:mb-2 tpl:last:mb-0"},[l.createElementVNode("div",YB,l.toDisplayString(l.unref(y).emoji[T.key]),1),l.createElementVNode("div",XB,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(T.emojis,Y=>(l.openBlock(),l.createElementBlock("button",{key:Y,type:"button",class:"tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:text-base tpl:transition-all tpl:duration-100 tpl:hover:scale-125 tpl:hover:bg-[var(--tpl-bg-active)]",onClick:Bt=>k(Y)},l.toDisplayString(Y),9,ZB))),128))])]))),128))])):l.createCommentVNode("",!0)]),l.unref(i)?(l.openBlock(),l.createElementBlock("span",QB)):l.createCommentVNode("",!0),l.unref(i)?(l.openBlock(),l.createElementBlock("button",{key:1,type:"button",class:"tpl:flex tpl:h-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",title:l.unref(y).mergeTag.add,onClick:L},[l.createVNode(l.unref(Zs),{size:16,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(y).mergeTag.add),1)],8,qB)):l.createCommentVNode("",!0)],64)):(l.openBlock(),l.createElementBlock("div",$B,[l.createVNode(l.unref(Kn),{class:"tpl-spinner",size:14,"stroke-width":2}),P[20]||(P[20]=l.createTextVNode(" Loading editor... ",-1))]))],4)])),w.value?(l.openBlock(),l.createElementBlock("div",tO,[...P[21]||(P[21]=[l.createElementVNode("div",{class:"tpl:animate-pulse tpl:text-zinc-400"},"Loading...",-1)])])):b.value&&S.value?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(b.value),{key:1,editor:S.value,class:"tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-indigo-500 tpl:p-2"},null,8,["editor"])):l.createCommentVNode("",!0),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[u.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tpl tpl-link-dialog tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/50",style:l.normalizeStyle(l.unref(r)),onClick:l.withModifiers(R,["self"])},[l.createElementVNode("div",eO,[l.createElementVNode("div",nO,[l.createElementVNode("h4",oO,l.toDisplayString((K=S.value)!=null&&K.isActive("link")?l.unref(y).linkDialog.editLink:l.unref(y).linkDialog.insertLink),1),l.createElementVNode("button",{type:"button",class:"tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",onClick:R},[l.createVNode(l.unref(hn),{size:16,"stroke-width":2})])]),l.createElementVNode("div",lO,[l.createElementVNode("div",sO,[l.createElementVNode("label",rO,l.toDisplayString(l.unref(y).linkDialog.urlLabel),1),l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":P[13]||(P[13]=T=>f.value=T),type:"url",class:"tpl:w-full tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",placeholder:l.unref(y).linkDialog.urlPlaceholder,autofocus:"",onKeydown:N},null,40,aO),[[l.vModelText,f.value]])])]),l.createElementVNode("div",iO,[(nt=S.value)!=null&&nt.isActive("link")?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:"tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-danger)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-danger)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-danger-light)]",onClick:D},l.toDisplayString(l.unref(y).linkDialog.removeLink),1)):l.createCommentVNode("",!0),l.createElementVNode("div",cO,[l.createElementVNode("button",{type:"button",class:"tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",onClick:R},l.toDisplayString(l.unref(y).linkDialog.cancel),1),l.createElementVNode("button",{type:"button",class:"tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)]",onClick:C},l.toDisplayString((F=S.value)!=null&&F.isActive("link")?l.unref(y).linkDialog.updateLink:l.unref(y).linkDialog.insertLink),1)])])])],4)):l.createCommentVNode("",!0)]))])}}})},Symbol.toStringTag,{value:"Module"})),pO=Object.freeze(Object.defineProperty({__proto__:null,default:{loading:{initializing:"Initialisieren..."},error:{title:"Etwas ist schiefgelaufen",defaultMessage:"Der Editor konnte keine Verbindung zu Templatical herstellen. Überprüfen Sie Ihre Netzwerkverbindung und versuchen Sie es erneut.",authFailed:"Authentifizierung fehlgeschlagen. Bitte überprüfen Sie Ihre Anmeldedaten.",templateNotFound:"Die angeforderte Vorlage konnte nicht gefunden werden. Bitte überprüfen Sie die Vorlagen-ID.",retry:"Erneut versuchen"},header:{title:"Templatical",unsaved:"Nicht gespeichert",saving:"Speichern...",save:"Speichern",templatesUsed:"{used}/{max} Vorlagen verwendet"},footer:{poweredBy:"Erstellt mit",openSource:"Open Source"},snapshotPreview:{message:"Sie sehen einen früheren Snapshot dieser Vorlage.",cancel:"Abbrechen",restore:"Diesen Snapshot wiederherstellen"},history:{undo:"Rückgängig",redo:"Wiederholen",collabWarning:"Rückgängig machen kann die Änderungen anderer Mitarbeiter beeinflussen"},viewport:{desktop:"Desktop",tablet:"Tablet",mobile:"Mobil"},darkMode:{enable:"Dunkelmodus-Vorschau",disable:"Hellmodus-Vorschau"},previewMode:{enable:"Vorschaumodus",disable:"Vorschau beenden"},blocks:{section:"Abschnitt",image:"Bild",text:"Text",button:"Schaltfläche",divider:"Trennlinie",video:"Video",social:"Sozial",spacer:"Abstand",html:"HTML",menu:"Menü",table:"Tabelle",countdown:"Countdown"},sidebar:{content:"Inhalt",settings:"Einstellungen",noSelection:"Kein Element ausgewählt",noSelectionHint:"Wählen Sie einen Block auf der Leinwand aus, um ihn zu bearbeiten"},toolbar:{duplicate:"Duplizieren",delete:"Löschen"},textEditor:{bold:"Fett (Strg+B)",italic:"Kursiv (Strg+I)",underline:"Unterstrichen (Strg+U)",strikethrough:"Durchgestrichen",subscript:"Tiefgestellt",superscript:"Hochgestellt",addLink:"Link hinzufügen",bulletList:"Aufzählungsliste",numberedList:"Nummerierte Liste",alignLeft:"Linksbündig",alignCenter:"Zentriert",alignRight:"Rechtsbündig",clearFormatting:"Formatierung entfernen",insertEmoji:"Emoji einfügen"},blockActions:{drag:"Zum Sortieren ziehen",duplicate:"Block duplizieren",delete:"Block löschen",hiddenOnViewport:"Ausgeblendet auf {viewport}",saveAsModule:"Als Modul speichern"},section:{dropHere:"Blöcke hierher ziehen",columns:"Spalten",column1:"1 Spalte",column2:"2 Spalten",column3:"3 Spalten",ratio12:"1:2 Verhältnis",ratio21:"2:1 Verhältnis"},linkDialog:{editLink:"Link bearbeiten",insertLink:"Link einfügen",updateLink:"Link aktualisieren",removeLink:"Link entfernen",cancel:"Abbrechen",urlPlaceholder:"https://beispiel.de",urlLabel:"URL"},text:{fontFamily:"Schriftart",inheritFont:"Vorlagenschrift verwenden",fontSize:"Schriftgröße",color:"Farbe",align:"Ausrichtung",alignLeft:"Links",alignCenter:"Zentriert",alignRight:"Rechts",weight:"Schriftstärke",normal:"Normal",bold:"Fett"},emoji:{smileys:"Smileys",gestures:"Gesten",objects:"Objekte"},image:{imageUrl:"Bild-URL",imageUrlPlaceholder:"https://...",altText:"Alternativtext",altTextPlaceholder:"Bildbeschreibung",width:"Breite",fullWidth:"Volle Breite",linkUrl:"Link-URL",openInNewTab:"In neuem Tab öffnen",placeholderUrl:"Platzhalterbild",placeholderUrlPlaceholder:"https://... (nur zur Gestaltung)",placeholderUrlTooltip:"Da die Bild-URL einen Platzhalter verwendet, können Sie hier ein echtes Bild angeben, um das Layout während der Gestaltung in der Vorschau anzuzeigen. Dies wird nicht in die endgültige Ausgabe aufgenommen.",clickToAdd:"Klicken Sie, um eine Bild-URL hinzuzufügen",browseMedia:"Medien durchsuchen"},video:{videoUrl:"Video-URL",videoUrlPlaceholder:"https://youtube.com/...",youtube:"YouTube",vimeo:"Vimeo",detected:"Video erkannt — Vorschaubild wird automatisch generiert",openInNewTab:"In neuem Tab öffnen",customThumbnail:"Eigenes Vorschaubild",optional:"(optional)",thumbnailPlaceholder:"Automatisch aus Video-URL generiert",altText:"Alternativtext",altTextPlaceholder:"Videobeschreibung",width:"Breite",fullWidth:"Volle Breite",placeholderUrl:"Platzhalter-Thumbnail",placeholderUrlPlaceholder:"https://... (nur zur Gestaltung)",placeholderUrlTooltip:"Da die Video-URL einen Platzhalter verwendet, können Sie hier ein echtes Thumbnail angeben, um das Layout während der Gestaltung in der Vorschau anzuzeigen. Dies wird nicht in die endgültige Ausgabe aufgenommen.",addVideo:"Video-URL hinzufügen"},button:{fontFamily:"Schriftart",inheritFont:"Vorlagenschrift verwenden",text:"Text",url:"URL",urlPlaceholder:"https://...",openInNewTab:"In neuem Tab öffnen",background:"Hintergrund",textColor:"Textfarbe",borderRadius:"Eckenradius",fontSize:"Schriftgröße"},divider:{style:"Stil",solid:"Durchgehend",dashed:"Gestrichelt",dotted:"Gepunktet",color:"Farbe",thickness:"Stärke"},social:{icons:"Symbole",addIcon:"Symbol hinzufügen",addIcons:"Soziale Symbole hinzufügen",removeIcon:"Entfernen",platform:"Plattform",url:"URL",urlPlaceholder:"https://...",style:"Stil",styleSolid:"Gefüllt",styleOutlined:"Umrandet",styleRounded:"Abgerundet",styleSquare:"Eckig",styleCircle:"Rund",size:"Größe",sizeSmall:"K",sizeMedium:"M",sizeLarge:"G",spacing:"Abstand",align:"Ausrichtung",platforms:{facebook:"Facebook",twitter:"X (Twitter)",instagram:"Instagram",linkedin:"LinkedIn",youtube:"YouTube",tiktok:"TikTok",pinterest:"Pinterest",email:"E-Mail",whatsapp:"WhatsApp",telegram:"Telegram",discord:"Discord",snapchat:"Snapchat",reddit:"Reddit",github:"GitHub",dribbble:"Dribbble",behance:"Behance"}},menu:{items:"Menüpunkte",addItem:"Punkt hinzufügen",removeItem:"Entfernen",text:"Text",url:"URL",urlPlaceholder:"https://beispiel.de",openInNewTab:"In neuem Tab öffnen",bold:"Fett",underline:"Unterstrichen",color:"Farbe",linkColor:"Linkfarbe",fontSize:"Schriftgröße",fontFamily:"Schriftfamilie",separator:"Trennzeichen",separatorColor:"Trennzeichenfarbe",spacing:"Abstand",textAlign:"Ausrichtung",addLinks:"Menülinks hinzufügen"},table:{dimensions:"Abmessungen",rows:"Zeilen",columns:"Spalten",addRow:"Zeile hinzufügen",removeRow:"Zeile entfernen",addColumn:"Spalte hinzufügen",removeColumn:"Spalte entfernen",hasHeaderRow:"Kopfzeile",headerBackgroundColor:"Kopfzeilen-Hintergrund",noHeaderBg:"Kein Hintergrund",borderColor:"Rahmenfarbe",borderWidth:"Rahmenbreite",cellPadding:"Zellenabstand",fontFamily:"Schriftart",fontSize:"Schriftgröße",color:"Textfarbe",textAlign:"Ausrichtung",cellPlaceholder:"Text eingeben...",empty:"Tabelle hinzufügen"},spacer:{height:"Höhe"},countdown:{targetDate:"Zieldatum",timezone:"Zeitzone",display:"Anzeige",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden",separator:"Trennzeichen",fontFamily:"Schriftart",inheritFont:"Standard",digitFontSize:"Zifferngröße",digitColor:"Ziffernfarbe",labelColor:"Beschriftungsfarbe",labelFontSize:"Beschriftungsgröße",background:"Hintergrund",labels:"Beschriftungen",expiry:"Ablaufnachricht",expiredMessagePlaceholder:"Dieses Angebot ist abgelaufen",expiredImageUrl:"Ablaufbild-URL",hideOnExpiry:"Bei Ablauf ausblenden",setDate:"Legen Sie ein Zieldatum im Einstellungsbereich fest",hidden:"Ausgeblendet (abgelaufen)"},customBlocks:{definitionNotFound:"Unbekannter Blocktyp — dieser Block ist nicht registriert",renderError:"Dieser Block konnte nicht gerendert werden. Überprüfen Sie die Block-Vorlage auf Fehler.",fields:{required:"Pflichtfeld",addItem:"Element hinzufügen",removeItem:"Entfernen",maxItemsReached:"Maximale Anzahl erreicht",minItemsRequired:"Mindestens {count} Elemente erforderlich"},toolbar:{noDefinition:"Registrieren Sie diesen Blocktyp in Ihrer SDK-Konfiguration, um seine Eigenschaften zu bearbeiten"},dataSource:{fetchButton:"Inhalt laden",changeButton:"Ändern",fetching:"Wird geladen...",readOnlyTooltip:"Dieser Wert wird aus Ihrer Datenquelle geladen",fetchError:"Inhalt konnte nicht geladen werden"}},html:{content:"HTML-Inhalt",preview:"Benutzerdefinierter HTML-Block",empty:"HTML-Inhalt im Bereich hinzufügen",sanitizationHint:"Skripte und unsichere Elemente werden beim Export entfernt."},blockSettings:{spacing:"Abstände",padding:"Innenabstand",margin:"Außenabstand",background:"Hintergrund",color:"Farbe",display:"Anzeige",showOnDesktop:"Auf Desktop anzeigen",showOnTablet:"Auf Tablet anzeigen",showOnMobile:"Auf Mobilgerät anzeigen",hiddenOnDevice:"Ausgeblendet auf {device}",customCss:"Benutzerdefiniertes CSS",css:"CSS",cssPlaceholder:"/* Benutzerdefinierte Stile */",displayCondition:"Anzeigebedingung",selectCondition:"Bedingung auswählen",removeCondition:"Bedingung entfernen",noCondition:"Immer sichtbar",conditionApplied:"Bedingung angewendet",customCondition:"Eigene Bedingung",customConditionLabel:"Bedingungsname",customConditionBefore:"Vorher (öffnende Logik)",customConditionAfter:"Nachher (schließende Logik)",applyCondition:"Anwenden",cancelCondition:"Abbrechen",customBadge:"Eigene",restoreHiddenBlocks:"Alle ausgeblendeten Blöcke anzeigen"},templateSettings:{layout:"Layout",widthPreset:"Breitenvoreinstellung",customWidth:"Benutzerdefinierte Breite",appearance:"Erscheinungsbild",backgroundColor:"Hintergrundfarbe",fontFamily:"Schriftfamilie",preheaderText:"Preheader-Text",preheaderTextPlaceholder:"Vorschautext, der nach der Betreffzeile im Posteingang angezeigt wird...",preheaderTextHint:"Dieser Text erscheint nach der Betreffzeile in der E-Mail-Vorschau. Unterstützt Platzhalter.",tips:"Tipps",tip1:"600px ist die Standardbreite für E-Mail-Vorlagen",tip2:"Verwenden Sie websichere Schriften für beste Kompatibilität",tip3:"Helle Hintergründe eignen sich am besten für die Lesbarkeit"},spacingControl:{lockAll:"Alle Seiten sperren",unlock:"Seiten entsperren"},mergeTag:{clickToEdit:"Zum Bearbeiten klicken",remove:"Merge-Tag entfernen",insert:"Merge-Tag einfügen",add:"Merge-Tag hinzufügen"},snapshotHistory:{tooltip:"Versionsverlauf",dropdownTitle:"Versionsverlauf",noSnapshots:"Noch keine Versionen",auto:"auto",justNow:"Gerade eben",minutesAgo:"vor {minutes} Min.",hoursAgo:"vor {hours} Std.",daysAgo:"vor {days} Tagen",olderSnapshot:"Ältere Version",newerSnapshot:"Neuere Version"},canvas:{noBlocks:"Noch keine Blöcke",dragHint:"Beginnen Sie von Grund auf, indem Sie Blöcke aus der Seitenleiste ziehen",dropHere:"Hier ablegen",aiHintChat:"oder lassen Sie",aiHintChatSuffix:"in Sekunden eine komplette Vorlage für Sie erstellen",aiHintDesign:"Haben Sie ein bestehendes Design? Laden Sie einen Screenshot, ein Bild oder PDF hoch und",aiHintDesignSuffix:"erstellt es sofort nach"},mediaLibrary:{title:"Medienbibliothek",searchPlaceholder:"Dateien suchen...",allFiles:"Alle Dateien",filterAll:"Alle Typen",filterImages:"Bilder",filterDocuments:"Dokumente",filterVideos:"Videos",filterAudio:"Audio",newFolder:"Neuer Ordner",folderName:"Ordnername",noFiles:"Keine Dateien gefunden",dropOrClick:"Dateien hierher ziehen oder klicken zum Hochladen",acceptedFormats:"Bilder, PDF, Video, Audio, Dokumente (max. 10 MB)",uploading:"Wird hochgeladen...",uploadingProgress:"{current} von {total} wird hochgeladen...",selectImage:"Bild auswählen",selectFile:"Datei auswählen",deleteSelected:"Löschen",copyUrl:"URL kopieren",copied:"Kopiert!",browseMedia:"Medienbibliothek durchsuchen",renameFolder:"Ordner umbenennen",addSubfolder:"Unterordner hinzufügen",subfolderName:"Unterordnername",sortNewest:"Neueste zuerst",sortOldest:"Älteste zuerst",sortNameAsc:"Name A-Z",sortNameDesc:"Name Z-A",sortSizeAsc:"Kleinste zuerst",sortSizeDesc:"Größte zuerst",moveSelected:"Verschieben",moveToRoot:"Alle Dateien",currentFolder:"(aktuell)",confirmDelete:"Diese Datei löschen?",renameFile:"Umbenennen",editFile:"Datei bearbeiten",fileName:"Dateiname",altText:"Alternativtext",altTextPlaceholder:"Bildbeschreibung für Barrierefreiheit",saveChanges:"Speichern",cancel:"Abbrechen",frequentlyUsed:"Häufig verwendet",deleteWarningTitle:"Datei löschen",deleteWarningMessage:"Diese Datei wird dauerhaft gelöscht und kann nicht wiederhergestellt werden.",deleteWarningUsageNote:"Die folgenden Dateien werden in Vorlagen verwendet. Das Löschen kann diese Vorlagen beschädigen.",deleteAnyway:"Datei löschen",usedInTemplates:"In {count} Vorlage(n) verwendet",viewGrid:"Rasteransicht",viewList:"Listenansicht",showFolders:"Ordner anzeigen",hideFolders:"Ordner ausblenden",importFromUrl:"Von URL importieren",importUrlPlaceholder:"https://example.com/image.jpg",import:"Importieren",importing:"Wird importiert...",importError:"Import von URL fehlgeschlagen",conversionLabel:"Groesse",conversionOriginal:"Original",conversionSmall:"Klein (150px)",conversionMedium:"Mittel (600px)",conversionLarge:"Gross (1200px)",replaceFile:"Datei ersetzen",replaceWarningTitle:"Datei ersetzen",replaceWarningMessage:"Sie sind dabei, diese Datei zu ersetzen. Die Ersatzdatei muss dieselbe Dateierweiterung haben ({extension}).",replaceWarningUsageNote:"Diese Datei wird in {count} Vorlage(n) verwendet. Das Ersetzen aktualisiert alle Verweise.",replaceSelectFile:"Ersatzdatei auswählen",replace:"Ersetzen",replacing:"Wird ersetzt...",replaceError:"Ersetzen der Datei fehlgeschlagen",saving:"Wird gespeichert...",cropAspectRatio:"Seitenverhältnis",cropFree:"Frei",cropSquare:"1:1",cropLandscape43:"4:3",cropLandscape169:"16:9",cropOriginal:"Original",cropMaxWidth:"Max. Breite",cropMaxHeight:"Max. Höhe",cropOutputSize:"Ausgabegröße",cropPixels:"px",cropOptional:"(optional)",storageTooltip:"{used} von {total} verwendet ({remaining} verfügbar)"},testEmail:{title:"Test-E-Mail senden",recipientLabel:"Empfänger",send:"Senden",sending:"Wird gesendet...",cancel:"Abbrechen",success:"Test-E-Mail erfolgreich gesendet",button:"Test"},aiRewrite:{title:"KI-Umschreibung",tone:"Tonalität",length:"Länge",clarity:"Klarheit",professional:"Professionell",casual:"Locker",friendly:"Freundlich",urgent:"Dringend",persuasive:"Überzeugend",shorter:"Kürzer",longer:"Länger",summarize:"Zusammenfassen",simplify:"Vereinfachen",fixGrammar:"Grammatik korrigieren",improveReadability:"Lesbarkeit verbessern",customInstruction:"Eigene Anweisung",customPlaceholder:"Beschreiben Sie die gewünschte Umschreibung...",rewrite:"Umschreiben",rewriting:"Wird umgeschrieben...",undo:"Rückgängig",redo:"Wiederholen",refine:"Weiter verfeinern",error:"Text konnte nicht umgeschrieben werden"},aiChat:{title:"KI-Assistent",button:"KI",inputPlaceholder:"Beschreiben Sie Ihre E-Mail-Vorlage...",send:"Senden",generating:"Wird generiert...",applied:"Änderungen auf Vorlage angewendet.",applyFailed:"Änderungen konnten nicht auf die Vorlage angewendet werden. Bitte versuchen Sie es erneut.",revert:"Änderungen rückgängig",reapply:"Änderungen erneut anwenden",error:"Vorlage konnte nicht generiert werden",clear:"Chat leeren",placeholder:"Beschreiben Sie die E-Mail-Vorlage, die Sie erstellen möchten, oder bitten Sie um Änderungen an der aktuellen.",loadingHistory:"Konversation wird geladen..."},scoring:{button:"Bewertung",title:"Vorlagenbewertung",rescore:"Neu bewerten",scoring:"Vorlage wird analysiert...",overallScore:"Gesamtbewertung",categories:{spam:"Spam-Risiko",readability:"Lesbarkeit",accessibility:"Barrierefreiheit",bestPractices:"Best Practices"},severity:{high:"Hoch",medium:"Mittel",low:"Niedrig"},fix:"Mit KI beheben",fixing:"Wird behoben...",fixed:"Behoben",findings:"Ergebnisse",noFindings:"Keine Probleme gefunden",error:"Vorlage konnte nicht analysiert werden",fixError:"Korrektur konnte nicht angewendet werden",emptyState:"Bewerten Sie Ihre Vorlage, um umsetzbare Rückmeldungen zu Spam-Risiko, Lesbarkeit, Barrierefreiheit und Best Practices zu erhalten."},aiMenu:{aiAssistant:"KI-Assistent",aiAssistantDesc:"Mit KI chatten, um Ihre Vorlage zu erstellen oder zu ändern",designToTemplate:"Design zu Vorlage",designToTemplateDesc:"Vorlage aus einem Bild oder PDF generieren",templateScore:"Vorlagenbewertung",templateScoreDesc:"Qualität, Spam-Risiko und Barrierefreiheit analysieren",disclaimer:"KI kann Fehler machen. Bitte überprüfen Sie die Ergebnisse vor der Genehmigung."},comments:{title:"Kommentare",placeholder:"Kommentar schreiben...",replyPlaceholder:"Antwort schreiben...",reply:"Antworten",resolve:"Lösen",unresolve:"Wiedereröffnen",resolved:"Gelöst",delete:"Löschen",edit:"Bearbeiten",cancel:"Abbrechen",save:"Speichern",noComments:"Noch keine Kommentare",noCommentsHint:"Starten Sie eine Konversation, indem Sie einen Kommentar zur Vorlage oder einem bestimmten Block hinzufügen.",addComment:"Kommentar hinzufügen",deleteConfirm:"Diesen Kommentar löschen?",filterAll:"Alle",filterUnresolved:"Ungelöst",filterBlock:"Dieser Block",ownedByYou:"Sie",edited:"bearbeitet",resolvedBy:"Gelöst von {name}",replyOne:"{count} Antwort",replyMany:"{count} Antworten",missingBlock:"Fehlender Block",saveTemplateFirst:"Speichern Sie die Vorlage, bevor Sie diesen Block kommentieren.",button:"Kommentare"},collaboration:{connected:"Zusammenarbeit aktiv",disconnected:"Zusammenarbeit getrennt",reconnecting:"Verbindung wird wiederhergestellt...",blockLockedBy:"Wird bearbeitet von {name}",usersOnline:"{count} Benutzer online"},modules:{title:"Gespeicherte Module",saveAsModule:"Als Modul speichern",moduleName:"Modulname",moduleNamePlaceholder:"z.B. Header, Footer, CTA...",selectBlocks:"Blöcke auswählen",save:"Modul speichern",saving:"Wird gespeichert...",cancel:"Abbrechen",noModules:"Noch keine gespeicherten Module",noModulesHint:"Speichern Sie Blöcke aus Ihren Vorlagen, um sie später wiederzuverwenden.",search:"Module suchen...",insert:"Einfügen",delete:"Löschen",deleteConfirm:"Dieses Modul löschen?",blockCount:"{count} Block/Blöcke",browse:"Module durchsuchen",selectToPreview:"Modul auswählen für Vorschau",insertAtBeginning:"Am Anfang",insertAfterBlock:"Nach {block}",insertAtEnd:"Am Ende",insertPosition:"Einfügeposition",close:"Schließen"},designReference:{title:"Designvorlage",button:"Design",uploadImage:"Bild",uploadPdf:"PDF",dropHint:"Datei hierher ziehen oder klicken zum Durchsuchen",acceptedImages:"PNG, JPG, WebP (max. 10 MB)",acceptedPdf:"PDF (max. 10 MB)",promptLabel:"Anweisungen (optional)",promptPlaceholder:"Beschreiben Sie Anpassungen oder Wünsche für die generierte Vorlage...",generate:"Aus Design generieren",generating:"Design wird analysiert und Vorlage generiert...",replaceWarning:"Die Generierung aus einer Designvorlage ersetzt den vorhandenen Vorlageninhalt.",replaceConfirm:"Ersetzen und generieren",replaceCancel:"Abbrechen",error:"Vorlage konnte nicht aus Design generiert werden",fileTooLarge:"Datei ist zu groß. Maximale Größe ist 10 MB.",invalidFileType:"Dieser Dateityp wird nicht unterstützt. Laden Sie eine PNG-, JPG-, WebP- oder PDF-Datei hoch."}}},Symbol.toStringTag,{value:"Module"})),uO=Object.freeze(Object.defineProperty({__proto__:null,default:{loading:{initializing:"Initializing..."},error:{title:"Something went wrong",defaultMessage:"The editor could not connect to Templatical. Check your network connection and try again.",authFailed:"Authentication failed. Please check your credentials.",templateNotFound:"The requested template could not be found. Please verify the template ID is correct.",retry:"Try Again"},header:{title:"Templatical",unsaved:"Unsaved",saving:"Saving...",save:"Save",templatesUsed:"{used}/{max} templates used"},footer:{poweredBy:"Powered by",openSource:"Open Source"},snapshotPreview:{message:"You are previewing a previous snapshot of this template.",cancel:"Cancel",restore:"Restore this snapshot"},history:{undo:"Undo",redo:"Redo",collabWarning:"Undo may affect collaborators' recent changes"},viewport:{desktop:"Desktop",tablet:"Tablet",mobile:"Mobile"},darkMode:{enable:"Dark Mode Preview",disable:"Light Mode Preview"},previewMode:{enable:"Preview Mode",disable:"Exit Preview"},blocks:{section:"Section",image:"Image",text:"Text",button:"Button",divider:"Divider",video:"Video",social:"Social",spacer:"Spacer",html:"HTML",menu:"Menu",table:"Table",countdown:"Countdown"},sidebar:{content:"Content",settings:"Settings",noSelection:"No element selected",noSelectionHint:"Select a block on the canvas to edit it"},toolbar:{duplicate:"Duplicate",delete:"Delete"},textEditor:{bold:"Bold (Ctrl+B)",italic:"Italic (Ctrl+I)",underline:"Underline (Ctrl+U)",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",addLink:"Add Link",bulletList:"Bullet List",numberedList:"Numbered List",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",clearFormatting:"Clear Formatting",insertEmoji:"Insert Emoji"},blockActions:{drag:"Drag to reorder",duplicate:"Duplicate block",delete:"Delete block",hiddenOnViewport:"Hidden on {viewport}",saveAsModule:"Save as Module"},section:{dropHere:"Drop blocks here",columns:"Columns",column1:"1 Column",column2:"2 Columns",column3:"3 Columns",ratio12:"1:2 Ratio",ratio21:"2:1 Ratio"},linkDialog:{editLink:"Edit Link",insertLink:"Insert Link",updateLink:"Update Link",removeLink:"Remove Link",cancel:"Cancel",urlPlaceholder:"https://example.com",urlLabel:"URL"},text:{fontFamily:"Font Family",inheritFont:"Use template font",fontSize:"Font Size",color:"Color",align:"Align",alignLeft:"Left",alignCenter:"Center",alignRight:"Right",weight:"Weight",normal:"Normal",bold:"Bold"},emoji:{smileys:"Smileys",gestures:"Gestures",objects:"Objects"},image:{imageUrl:"Image URL",imageUrlPlaceholder:"https://...",altText:"Alt Text",altTextPlaceholder:"Image description",width:"Width",fullWidth:"Full Width",linkUrl:"Link URL",openInNewTab:"Open in new tab",placeholderUrl:"Placeholder Image",placeholderUrlPlaceholder:"https://... (design-time only)",placeholderUrlTooltip:"Since the image URL uses a placeholder, you can provide a real image here to preview the layout while designing. This is not included in the final output.",clickToAdd:"Click to add image URL",browseMedia:"Browse Media"},video:{videoUrl:"Video URL",videoUrlPlaceholder:"https://youtube.com/...",youtube:"YouTube",vimeo:"Vimeo",detected:"Video detected — thumbnail will be generated automatically",openInNewTab:"Open in new tab",customThumbnail:"Custom Thumbnail",optional:"(optional)",thumbnailPlaceholder:"Auto-generated from video URL",altText:"Alt Text",altTextPlaceholder:"Video description",width:"Width",fullWidth:"Full Width",placeholderUrl:"Placeholder Thumbnail",placeholderUrlPlaceholder:"https://... (design-time only)",placeholderUrlTooltip:"Since the video URL uses a placeholder, you can provide a real thumbnail here to preview the layout while designing. This is not included in the final output.",addVideo:"Add a video URL"},button:{fontFamily:"Font Family",inheritFont:"Use template font",text:"Text",url:"URL",urlPlaceholder:"https://...",openInNewTab:"Open in new tab",background:"Background",textColor:"Text Color",borderRadius:"Border Radius",fontSize:"Font Size"},divider:{style:"Style",solid:"Solid",dashed:"Dashed",dotted:"Dotted",color:"Color",thickness:"Thickness"},social:{icons:"Icons",addIcon:"Add Icon",addIcons:"Add social icons",removeIcon:"Remove",platform:"Platform",url:"URL",urlPlaceholder:"https://...",style:"Style",styleSolid:"Solid",styleOutlined:"Outlined",styleRounded:"Rounded",styleSquare:"Square",styleCircle:"Circle",size:"Size",sizeSmall:"S",sizeMedium:"M",sizeLarge:"L",spacing:"Spacing",align:"Alignment",platforms:{facebook:"Facebook",twitter:"X (Twitter)",instagram:"Instagram",linkedin:"LinkedIn",youtube:"YouTube",tiktok:"TikTok",pinterest:"Pinterest",email:"Email",whatsapp:"WhatsApp",telegram:"Telegram",discord:"Discord",snapchat:"Snapchat",reddit:"Reddit",github:"GitHub",dribbble:"Dribbble",behance:"Behance"}},menu:{items:"Menu Items",addItem:"Add Item",removeItem:"Remove",text:"Text",url:"URL",urlPlaceholder:"https://example.com",openInNewTab:"Open in new tab",bold:"Bold",underline:"Underline",color:"Color",linkColor:"Link Color",fontSize:"Font Size",fontFamily:"Font Family",separator:"Separator",separatorColor:"Separator Color",spacing:"Spacing",textAlign:"Alignment",addLinks:"Add menu links"},table:{dimensions:"Dimensions",rows:"Rows",columns:"Columns",addRow:"Add Row",removeRow:"Remove Row",addColumn:"Add Column",removeColumn:"Remove Column",hasHeaderRow:"Header row",headerBackgroundColor:"Header Background",noHeaderBg:"No background",borderColor:"Border Color",borderWidth:"Border Width",cellPadding:"Cell Padding",fontFamily:"Font Family",fontSize:"Font Size",color:"Text Color",textAlign:"Alignment",cellPlaceholder:"Enter text...",empty:"Add a table"},spacer:{height:"Height"},countdown:{targetDate:"Target Date",timezone:"Timezone",display:"Display",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds",separator:"Separator",fontFamily:"Font Family",inheritFont:"Default",digitFontSize:"Digit Size",digitColor:"Digit Color",labelColor:"Label Color",labelFontSize:"Label Size",background:"Background",labels:"Labels",expiry:"Expired Message",expiredMessagePlaceholder:"This offer has expired",expiredImageUrl:"Expired Image URL",hideOnExpiry:"Hide when expired",setDate:"Set a target date in the settings panel",hidden:"Hidden (expired)"},customBlocks:{definitionNotFound:"Unknown block type — this block is not registered",renderError:"This block could not be rendered. Check the block template for errors.",fields:{required:"Required",addItem:"Add item",removeItem:"Remove",maxItemsReached:"Maximum items reached",minItemsRequired:"Minimum {count} items required"},toolbar:{noDefinition:"Register this block type in your SDK configuration to edit its properties"},dataSource:{fetchButton:"Load content",changeButton:"Change",fetching:"Loading...",readOnlyTooltip:"This value is loaded from your data source",fetchError:"Failed to load content"}},html:{content:"HTML Content",preview:"Custom HTML block",empty:"Add HTML content in the panel",sanitizationHint:"Scripts and unsafe elements are removed on export."},blockSettings:{spacing:"Spacing",padding:"Padding",margin:"Margin",background:"Background",color:"Color",display:"Display",showOnDesktop:"Show on desktop",showOnTablet:"Show on tablet",showOnMobile:"Show on mobile",hiddenOnDevice:"Hidden on {device}",customCss:"Custom CSS",css:"CSS",cssPlaceholder:"/* Custom styles */",displayCondition:"Display Condition",selectCondition:"Select condition",removeCondition:"Remove condition",noCondition:"Always visible",conditionApplied:"Condition applied",customCondition:"Custom condition",customConditionLabel:"Condition name",customConditionBefore:"Before (opening logic)",customConditionAfter:"After (closing logic)",applyCondition:"Apply",cancelCondition:"Cancel",customBadge:"Custom",restoreHiddenBlocks:"Show all hidden blocks"},templateSettings:{layout:"Layout",widthPreset:"Width Preset",customWidth:"Custom Width",appearance:"Appearance",backgroundColor:"Background Color",fontFamily:"Font Family",preheaderText:"Preheader Text",preheaderTextPlaceholder:"Preview text shown after subject line in inbox...",preheaderTextHint:"This text appears after the subject line in email client previews. Supports placeholders.",tips:"Tips",tip1:"600px is the standard width for email templates",tip2:"Use web-safe fonts for best compatibility",tip3:"Light backgrounds work best for readability"},spacingControl:{lockAll:"Lock all sides",unlock:"Unlock sides"},mergeTag:{clickToEdit:"Click to edit",remove:"Remove merge tag",insert:"Insert merge tag",add:"Add merge tag"},snapshotHistory:{tooltip:"Version history",dropdownTitle:"Version History",noSnapshots:"No versions yet",auto:"auto",justNow:"Just now",minutesAgo:"{minutes}m ago",hoursAgo:"{hours}h ago",daysAgo:"{days}d ago",olderSnapshot:"Older version",newerSnapshot:"Newer version"},canvas:{noBlocks:"No blocks yet",dragHint:"Start from scratch by dragging blocks from the sidebar",dropHere:"Drop here",aiHintChat:"or let",aiHintChatSuffix:"generate a complete template for you in seconds",aiHintDesign:"Have an existing design? Upload a screenshot, image, or PDF and",aiHintDesignSuffix:"will instantly recreate it"},mediaLibrary:{title:"Media Library",searchPlaceholder:"Search files...",allFiles:"All Files",filterAll:"All Types",filterImages:"Images",filterDocuments:"Documents",filterVideos:"Videos",filterAudio:"Audio",newFolder:"New Folder",folderName:"Folder name",noFiles:"No files found",dropOrClick:"Drop files here or click to upload",acceptedFormats:"Images, PDF, Video, Audio, Documents (max 10MB)",uploading:"Uploading...",uploadingProgress:"Uploading {current} of {total}...",selectImage:"Select Image",selectFile:"Select File",deleteSelected:"Delete",copyUrl:"Copy URL",copied:"Copied!",browseMedia:"Browse Media Library",renameFolder:"Rename folder",addSubfolder:"Add subfolder",subfolderName:"Subfolder name",sortNewest:"Newest First",sortOldest:"Oldest First",sortNameAsc:"Name A-Z",sortNameDesc:"Name Z-A",sortSizeAsc:"Smallest First",sortSizeDesc:"Largest First",moveSelected:"Move",moveToRoot:"All Files",currentFolder:"(current)",confirmDelete:"Delete this file?",renameFile:"Rename",editFile:"Edit File",fileName:"Filename",altText:"Alt Text",altTextPlaceholder:"Describe this image for accessibility",saveChanges:"Save",cancel:"Cancel",frequentlyUsed:"Frequently Used",deleteWarningTitle:"Delete File",deleteWarningMessage:"This file will be permanently deleted and cannot be recovered.",deleteWarningUsageNote:"The following files are used in templates. Deleting them may break those templates.",deleteAnyway:"Delete file",usedInTemplates:"Used in {count} template(s)",viewGrid:"Grid view",viewList:"List view",showFolders:"Show folders",hideFolders:"Hide folders",importFromUrl:"Import from URL",importUrlPlaceholder:"https://example.com/image.jpg",import:"Import",importing:"Importing...",importError:"Failed to import from URL",conversionLabel:"Size",conversionOriginal:"Original",conversionSmall:"Small (150px)",conversionMedium:"Medium (600px)",conversionLarge:"Large (1200px)",replaceFile:"Replace File",replaceWarningTitle:"Replace File",replaceWarningMessage:"You are about to replace this file. The replacement must have the same file extension ({extension}).",replaceWarningUsageNote:"This file is used in {count} template(s). Replacing it will update all references.",replaceSelectFile:"Select replacement file",replace:"Replace",replacing:"Replacing...",replaceError:"Failed to replace file",saving:"Saving...",cropAspectRatio:"Aspect Ratio",cropFree:"Free",cropSquare:"1:1",cropLandscape43:"4:3",cropLandscape169:"16:9",cropOriginal:"Original",cropMaxWidth:"Max Width",cropMaxHeight:"Max Height",cropOutputSize:"Output Size",cropPixels:"px",cropOptional:"(optional)",storageTooltip:"{used} of {total} used ({remaining} remaining)"},testEmail:{title:"Send Test Email",recipientLabel:"Recipient",send:"Send",sending:"Sending...",cancel:"Cancel",success:"Test email sent successfully",button:"Test"},aiRewrite:{title:"AI Rewrite",tone:"Tone",length:"Length",clarity:"Clarity",professional:"Professional",casual:"Casual",friendly:"Friendly",urgent:"Urgent",persuasive:"Persuasive",shorter:"Shorter",longer:"Longer",summarize:"Summarize",simplify:"Simplify",fixGrammar:"Fix grammar",improveReadability:"Improve readability",customInstruction:"Custom instruction",customPlaceholder:"Describe how to rewrite...",rewrite:"Rewrite",rewriting:"Rewriting...",undo:"Undo",redo:"Redo",refine:"Refine further",error:"Failed to rewrite text"},aiChat:{title:"AI Assistant",button:"AI",inputPlaceholder:"Describe your email template...",send:"Send",generating:"Generating...",applied:"Changes applied to template.",applyFailed:"Could not apply changes to template. Please try again.",revert:"Revert changes",reapply:"Re-apply changes",error:"Failed to generate template",clear:"Clear chat",placeholder:"Describe the email template you want to create, or ask to modify the current one.",loadingHistory:"Loading conversation..."},scoring:{button:"Score",title:"Template Score",rescore:"Re-score",scoring:"Analyzing template...",overallScore:"Overall Score",categories:{spam:"Spam Risk",readability:"Readability",accessibility:"Accessibility",bestPractices:"Best Practices"},severity:{high:"High",medium:"Medium",low:"Low"},fix:"Fix with AI",fixing:"Fixing...",fixed:"Fixed",findings:"findings",noFindings:"No issues found",error:"Failed to analyze template",fixError:"Failed to apply fix",emptyState:"Score your template to get actionable feedback on spam risk, readability, accessibility, and best practices."},aiMenu:{aiAssistant:"AI Assistant",aiAssistantDesc:"Chat with AI to create or modify your template",designToTemplate:"Design to Template",designToTemplateDesc:"Generate a template from an image or PDF",templateScore:"Template Score",templateScoreDesc:"Analyze quality, spam risk, and accessibility",disclaimer:"AI can make mistakes. Please verify before approving."},comments:{title:"Comments",placeholder:"Write a comment...",replyPlaceholder:"Write a reply...",reply:"Reply",resolve:"Resolve",unresolve:"Unresolve",resolved:"Resolved",delete:"Delete",edit:"Edit",cancel:"Cancel",save:"Save",noComments:"No comments yet",noCommentsHint:"Start a conversation by adding a comment to the template or a specific block.",addComment:"Add comment",deleteConfirm:"Delete this comment?",filterAll:"All",filterUnresolved:"Unresolved",filterBlock:"This block",ownedByYou:"You",edited:"edited",resolvedBy:"Resolved by {name}",replyOne:"{count} Reply",replyMany:"{count} Replies",missingBlock:"Missing block",saveTemplateFirst:"Save the template before commenting on this block.",button:"Comments"},collaboration:{connected:"Collaboration mode active",disconnected:"Collaboration disconnected",reconnecting:"Reconnecting...",blockLockedBy:"Editing by {name}",usersOnline:"{count} users online"},modules:{title:"Saved Modules",saveAsModule:"Save as Module",moduleName:"Module Name",moduleNamePlaceholder:"e.g. Header, Footer, CTA...",selectBlocks:"Select Blocks",save:"Save Module",saving:"Saving...",cancel:"Cancel",noModules:"No saved modules yet",noModulesHint:"Save blocks from your templates to reuse them later.",search:"Search modules...",insert:"Insert",delete:"Delete",deleteConfirm:"Delete this module?",blockCount:"{count} block(s)",browse:"Browse Modules",selectToPreview:"Select a module to preview",insertAtBeginning:"At beginning",insertAfterBlock:"After {block}",insertAtEnd:"At end",insertPosition:"Insert position",close:"Close"},designReference:{title:"Design Reference",button:"Design",uploadImage:"Image",uploadPdf:"PDF",dropHint:"Drop a file here or click to browse",acceptedImages:"PNG, JPG, WebP (max 10MB)",acceptedPdf:"PDF (max 10MB)",promptLabel:"Instructions (optional)",promptPlaceholder:"Describe any adjustments or preferences for the generated template...",generate:"Generate from design",generating:"Analyzing design and generating template...",replaceWarning:"Generating from a design reference will replace the existing template content.",replaceConfirm:"Replace and generate",replaceCancel:"Cancel",error:"Failed to generate template from design",fileTooLarge:"File is too large. Maximum size is 10MB.",invalidFileType:"This file type is not supported. Upload a PNG, JPG, WebP, or PDF."}}},Symbol.toStringTag,{value:"Module"}));function fO(n){const t=l.ref(!1),e=l.ref(null),o=l.ref(!1);function s(c){e.value=c??null,t.value=!0}function r(){t.value=!1,e.value=null}function a(){o.value=!0}function i(){o.value=!1}return{headless:n,showSaveDialog:t,preSelectedBlockId:e,openSaveDialog:s,closeSaveDialog:r,showBrowserModal:o,openBrowserModal:a,closeBrowserModal:i}}const hO={key:0,class:"tpl-loading tpl:absolute tpl:inset-0 tpl:z-[100] tpl:flex tpl:flex-col",style:{"background-color":"var(--tpl-bg)"}},mO={class:"tpl:flex tpl:flex-1 tpl:overflow-hidden"},gO={class:"tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5",style:{"border-right":"1px solid var(--tpl-border)"}},vO={key:0,role:"alert",class:"tpl-error tpl:absolute tpl:inset-0 tpl:z-[100] tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8",style:{"background-color":"var(--tpl-bg)"}},yO={class:"tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full",style:{"background-color":"var(--tpl-danger-light)"}},bO={class:"tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center"},kO={class:"tpl:text-lg tpl:font-semibold",style:{color:"var(--tpl-text)"}},xO={class:"tpl:max-w-md tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},wO={class:"tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:flex tpl:h-14 tpl:items-center tpl:justify-between tpl:px-4",style:{"background-color":"color-mix(in srgb, var(--tpl-bg) 80%, transparent)","backdrop-filter":"blur(12px)","-webkit-backdrop-filter":"blur(12px)","box-shadow":"var(--tpl-shadow-md)"}},SO={class:"tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3"},EO={key:0,class:"tpl-logo tpl:flex tpl:items-center tpl:gap-2.5 tpl:text-sm tpl:font-semibold",style:{color:"var(--tpl-text)"}},CO=["src"],TO={style:{"letter-spacing":"-0.01em"}},NO={key:1,class:"tpl:text-xs tpl:opacity-60",style:{color:"var(--tpl-text-muted)"}},MO={class:"tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10"},BO={class:"tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3"},OO={key:0,"aria-live":"polite",class:"tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs",style:{color:"var(--tpl-text-muted)"}},DO=["aria-label","aria-expanded"],VO={key:0,class:"tpl:inline-flex tpl:size-4.5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"}},AO=["aria-expanded"],IO={key:0,class:"tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right"},RO=["disabled"],zO=["disabled"],PO={key:0,class:"tpl-preview-banner tpl:absolute tpl:top-14 tpl:right-0 tpl:left-0 tpl:z-40 tpl:flex tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-4 tpl:py-3",style:{"background-color":"var(--tpl-primary-light)","border-bottom":"1px solid var(--tpl-primary)"}},LO={class:"tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm",style:{color:"var(--tpl-text)"}},FO={class:"tpl:flex tpl:items-center tpl:gap-2"},jO={key:0,role:"status","aria-live":"polite",class:"tpl:absolute tpl:top-16 tpl:left-1/2 tpl:z-[60] tpl:-translate-x-1/2 tpl:rounded-[var(--tpl-radius)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:shadow-lg",style:{"background-color":"var(--tpl-warning-light)",color:"var(--tpl-text)",border:"1px solid var(--tpl-warning)"}},HO={class:"tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0"},UO={class:"tpl-main tpl:flex tpl:min-h-full tpl:justify-center tpl:p-8"},WO=Object.freeze(Object.defineProperty({__proto__:null,default:Re(l.defineComponent({__name:"CloudEditor",props:{config:{},translations:{},fontsManager:{}},emits:["ready"],setup(n,{expose:t,emit:e}){var Fb,jb,Hb,Ub,Wb,Kb,_b,Gb;const o=l.defineAsyncComponent(()=>Promise.resolve().then(()=>Q8)),s=l.defineAsyncComponent(()=>Promise.resolve().then(()=>sz)),r=l.defineAsyncComponent(()=>Promise.resolve().then(()=>Vz)),a=l.defineAsyncComponent(()=>Promise.resolve().then(()=>iP)),i=l.defineAsyncComponent(()=>Promise.resolve().then(()=>wP)),c=l.defineAsyncComponent(()=>Promise.resolve().then(()=>LP)),d=l.defineAsyncComponent(()=>Promise.resolve().then(()=>gL)),p=l.defineAsyncComponent(()=>Promise.resolve().then(()=>BL)),u=l.defineAsyncComponent(()=>Promise.resolve().then(()=>RL)),f=l.defineAsyncComponent(()=>Promise.resolve().then(()=>HL)),h=l.defineAsyncComponent(async()=>(await import("@templatical/media-library")).MediaLibraryModal),m=n,g=e;l.provide("translations",m.translations);const{t:v,format:y}=jt(m.translations),k=l.ref({}),S={bg:"--tpl-bg",bgElevated:"--tpl-bg-elevated",bgHover:"--tpl-bg-hover",bgActive:"--tpl-bg-active",border:"--tpl-border",borderLight:"--tpl-border-light",text:"--tpl-text",textMuted:"--tpl-text-muted",textDim:"--tpl-text-dim",primary:"--tpl-primary",primaryHover:"--tpl-primary-hover",primaryLight:"--tpl-primary-light",secondary:"--tpl-secondary",secondaryHover:"--tpl-secondary-hover",secondaryLight:"--tpl-secondary-light",success:"--tpl-success",successLight:"--tpl-success-light",warning:"--tpl-warning",warningLight:"--tpl-warning-light",danger:"--tpl-danger",dangerLight:"--tpl-danger-light",canvasBg:"--tpl-canvas-bg"},b=l.computed(()=>{const H={};for(const[$,Lt]of Object.entries(S)){const ut=k.value[$];ut&&(H[Lt]=ut)}return H["--tpl-drop-text"]=`"${m.translations.canvas.dropHere}"`,H});function w(H){D.hasFeature("theme_customization")&&(k.value=H)}const x=l.ref(!0),E=l.ref(!1),B=l.ref(null),C=new ye.AuthManager({...m.config.auth,onError:m.config.onError}),D=ye.usePlanConfig({authManager:C,onError:m.config.onError}),R=l.ref(new Map),N=ye.useEditor({authManager:C,defaultFontFamily:(Fb=m.config.fonts)==null?void 0:Fb.defaultFont,templateDefaults:m.config.templateDefaults,onError:m.config.onError,lockedBlocks:R});let L=null;const z=ye.useWebSocket({authManager:C,onError:m.config.onError});if((jb=m.config.mcp)!=null&&jb.enabled&&ye.useMcpListener({editor:N,channel:z.channel,onOperation:m.config.mcp.onOperation}),(Hb=m.config.collaboration)!=null&&Hb.enabled){L=ye.useCollaboration({authManager:C,editor:N,channel:z.channel,onError:m.config.onError,onCollaboratorJoined:m.config.collaboration.onCollaboratorJoined,onCollaboratorLeft:m.config.collaboration.onCollaboratorLeft,onBlockLocked:m.config.collaboration.onBlockLocked,onBlockUnlocked:m.config.collaboration.onBlockUnlocked}),l.watch(()=>L.lockedBlocks.value,ve=>{R.value=ve},{immediate:!0});const H=N.addBlock,$=N.updateBlock,Lt=N.removeBlock,ut=N.moveBlock,Fe=N.updateSettings,df=N.setContent;N.addBlock=(ve,io,ga)=>{H(ve,io,ga),L._broadcastOperation({operation:"add_block",data:{block:ve,section_id:io,column_index:ga},timestamp:Date.now()})},N.updateBlock=(ve,io)=>{$(ve,io),L._broadcastOperation({operation:"update_block",data:{block_id:ve,updates:io},timestamp:Date.now()})},N.removeBlock=ve=>{Lt(ve),L._broadcastOperation({operation:"delete_block",data:{block_id:ve},timestamp:Date.now()})},N.moveBlock=(ve,io,ga,Jb)=>{ut(ve,io,ga,Jb),L._broadcastOperation({operation:"move_block",data:{block_id:ve,index:io,section_id:ga,column_index:Jb},timestamp:Date.now()})},N.updateSettings=ve=>{Fe(ve),L._broadcastOperation({operation:"update_settings",data:{updates:ve},timestamp:Date.now()})},N.setContent=(ve,io)=>{df(ve,io),L._broadcastOperation({operation:"set_content",data:{content:ve},timestamp:Date.now()})}}const P=l.computed(()=>{var H;return!!((H=m.config.collaboration)!=null&&H.enabled)&&D.hasFeature("collaboration")}),U=Rn.useConditionPreview(N),O=Rn.useBlockActions({addBlock:N.addBlock,removeBlock:N.removeBlock,updateBlock:N.updateBlock,selectBlock:N.selectBlock,blockDefaults:m.config.blockDefaults}),W=e2({onBlockMove:N.moveBlock,onBlockAdd:N.addBlock}),lt=ye.useExport({authManager:C,getFontsConfig:()=>m.config.fonts,canUseCustomFonts:()=>D.hasFeature("custom_fonts")}),ht=ye.useTestEmail({authManager:C,getTemplateId:()=>{var H;return((H=N.state.template)==null?void 0:H.id)??null},save:()=>N.save(),exportHtml:H=>lt.exportHtml(H),onError:m.config.onError,isAuthReady:E,onBeforeTestEmail:m.config.onBeforeTestEmail}),gt=Rn.useHistory({content:N.content,setContent:(H,$)=>N.setContent(H,$),isRemoteOperation:L?()=>L._isProcessingRemoteOperation():void 0}),bt=N.addBlock,Pt=N.removeBlock,Ct=N.moveBlock,Nt=N.updateBlock,St=N.updateSettings;N.addBlock=(H,$,Lt,ut)=>{gt.record(),bt(H,$,Lt,ut)},N.removeBlock=H=>{gt.record(),Pt(H)},N.moveBlock=(H,$,Lt,ut)=>{gt.record(),Ct(H,$,Lt,ut)},N.updateBlock=(H,$)=>{gt.recordDebounced(H),Nt(H,$)},N.updateSettings=H=>{gt.record(),St(H)};let xt=!1;const K=l.ref(!1);function nt(){xt||!L||!P.value||L.collaborators.value.length===0||!gt.canUndo.value||(xt=!0,K.value=!0,jc(()=>{K.value=!1},4e3))}const F=Rn.useAutoSave({content:N.content,isDirty:()=>N.state.isDirty,onChange:async()=>{N.hasTemplate()&&(await N.createSnapshot(),st.value&&st.value.loadSnapshots())},debounce:m.config.autoSaveDebounce??5e3,enabled:()=>m.config.autoSave!==!1&&D.hasFeature("auto_save")});l.watch(gt.isNavigating,H=>{H?F.pause():F.resume()});const T=ye.useAiConfig(m.config.ai),Y=ye.useComments({authManager:C,getTemplateId:()=>{var H;return((H=N.state.template)==null?void 0:H.id)??null},getSocketId:()=>z.getSocketId(),onComment:m.config.onComment,onError:m.config.onError,isAuthReady:E,hasCommentingFeature:()=>m.config.commenting!==!1&&D.hasFeature("commenting")});ye.useCommentListener({comments:Y,channel:z.channel});const Bt=ye.useSavedModules({authManager:C,onError:m.config.onError}),Ot=fO(Bt),pt=Qf();pt.registerBuiltIn("section",{component:qf,createBlock:()=>yt.createSectionBlock(),sidebarItem:{type:"section",label:"Section",isCustom:!1}}),pt.registerBuiltIn("text",{component:hr,createBlock:()=>yt.createTextBlock(),sidebarItem:{type:"text",label:"Text",isCustom:!1}}),pt.registerBuiltIn("image",{component:fr,createBlock:()=>yt.createImageBlock(),sidebarItem:{type:"image",label:"Image",isCustom:!1}}),pt.registerBuiltIn("button",{component:pr,createBlock:()=>yt.createButtonBlock(),sidebarItem:{type:"button",label:"Button",isCustom:!1}}),pt.registerBuiltIn("divider",{component:ur,createBlock:()=>yt.createDividerBlock(),sidebarItem:{type:"divider",label:"Divider",isCustom:!1}}),pt.registerBuiltIn("video",{component:Xa,createBlock:()=>yt.createVideoBlock(),sidebarItem:{type:"video",label:"Video",isCustom:!1}}),pt.registerBuiltIn("social",{component:Ga,createBlock:()=>yt.createSocialIconsBlock(),sidebarItem:{type:"social",label:"Social",isCustom:!1}}),pt.registerBuiltIn("menu",{component:Ja,createBlock:()=>yt.createMenuBlock(),sidebarItem:{type:"menu",label:"Menu",isCustom:!1}}),pt.registerBuiltIn("table",{component:Ya,createBlock:()=>yt.createTableBlock(),sidebarItem:{type:"table",label:"Table",isCustom:!1}}),pt.registerBuiltIn("spacer",{component:Ka,createBlock:()=>yt.createSpacerBlock(),sidebarItem:{type:"spacer",label:"Spacer",isCustom:!1}}),pt.registerBuiltIn("html",{component:_a,createBlock:()=>yt.createHtmlBlock(),sidebarItem:{type:"html",label:"HTML",isCustom:!1}}),l.provide("editor",N),l.provide("history",gt),l.provide("blockActions",O),l.provide("dragDrop",W),l.provide("conditionPreview",U),l.provide("fontsManager",m.fontsManager),l.provide("themeStyles",b),l.provide("blockDefaults",m.config.blockDefaults),l.provide("blockRegistry",pt),l.provide("customBlockDefinitions",m.config.customBlocks??[]);const M=yt.resolveSyntax((Ub=m.config.mergeTags)==null?void 0:Ub.syntax);l.provide("mergeTags",((Wb=m.config.mergeTags)==null?void 0:Wb.tags)??[]),l.provide("mergeTagSyntax",M),l.provide("onRequestMergeTag",((Kb=m.config.mergeTags)==null?void 0:Kb.onRequest)??null),l.provide("displayConditions",((_b=m.config.displayConditions)==null?void 0:_b.conditions)??[]),l.provide("allowCustomConditions",((Gb=m.config.displayConditions)==null?void 0:Gb.allowCustom)??!1),l.provide("onRequestMedia",zb),l.provide("config",{onRequestMedia:zb}),l.provide("authManager",C),l.provide("projectId",l.computed(()=>C.projectId)),l.provide("planConfig",D),l.provide("aiConfig",T),l.provide("comments",Y),l.provide("openCommentsForBlock",ZL),l.provide("savedModules",Ot),l.provide("savedModulesHeadless",Bt);const st=l.shallowRef(null),Vt=l.ref(null),Wt=l.ref(null),$t=l.computed(()=>Vt.value!==null),ge=l.computed(()=>{var H;return((H=st.value)==null?void 0:H.snapshots.value)??[]}),nn=l.computed(()=>{var H;return((H=st.value)==null?void 0:H.isLoading.value)??!1}),Ke=l.computed(()=>{var H;return((H=st.value)==null?void 0:H.isRestoring.value)??!1});function _e(){var H;(H=N.state.template)!=null&&H.id&&!st.value&&(st.value=ye.useSnapshotHistory({authManager:C,templateId:N.state.template.id,onRestore:Dn,onError:m.config.onError}),st.value.loadSnapshots())}function Dn(H){N.setContent(H.content,!1),gt.clear(),U.reset()}async function Vn(H){if(Vt.value){Vt.value=H,N.setContent(H.content,!1);return}N.state.isDirty&&N.hasTemplate()&&await N.createSnapshot(),Wt.value=JSON.parse(JSON.stringify(N.content.value)),F.pause(),Vt.value=H,N.setContent(H.content,!1)}async function An(){!Vt.value||!st.value||(await st.value.restoreSnapshot(Vt.value.id),await st.value.loadSnapshots(),Vt.value=null,Wt.value=null,F.resume())}function In(){!Vt.value||!Wt.value||(N.setContent(Wt.value,!1),Vt.value=null,Wt.value=null,F.resume())}async function I(){st.value&&await st.value.loadSnapshots()}const A=l.computed(()=>D.hasFeature("ai_generation")&&T.hasAnyMenuFeature.value),j=l.computed(()=>D.hasFeature("test_email")),J=l.computed(()=>{var H;return!!((H=N.state.template)!=null&&H.id)}),it=l.computed(()=>D.hasFeature("white_label")),V=l.computed(()=>{var H;return((H=D.config.value)==null?void 0:H.limits.max_templates)??null}),_=l.computed(()=>{var H;return((H=D.config.value)==null?void 0:H.template_count)??0}),q=l.ref(!1),dt=l.ref(!1),Z=l.ref(!1),Q=l.ref(!1),ot=l.ref(!1),wt=l.ref(!1),At=l.ref(!1),Xt=l.ref(void 0),Ge=l.ref(!1),Ao=l.ref(null),on=l.computed(()=>dt.value||Z.value||Q.value||ot.value);l.watch(Z,H=>{H&&(dt.value=!1,Q.value=!1,ot.value=!1)}),l.watch(dt,H=>{H&&(Z.value=!1,Q.value=!1,ot.value=!1)}),l.watch(Q,H=>{H&&(dt.value=!1,Z.value=!1,ot.value=!1)}),l.watch(ot,H=>{H&&(dt.value=!1,Z.value=!1,Q.value=!1)});const af=l.computed(()=>dt.value?"ai-chat":Q.value?"design-reference":Z.value?"scoring":null),ma=l.computed(()=>Ge.value||dt.value||Q.value||Z.value);function Ks(){Ge.value=!Ge.value}function JL(H){Ge.value=!1,H==="ai-chat"?dt.value=!dt.value:H==="design-reference"?Q.value=!Q.value:H==="scoring"&&(Z.value=!Z.value)}Hc(Ao,()=>{Ge.value=!1});async function YL(H){try{await ht.sendTestEmail(H),wt.value=!1}catch{}}function XL(H,$){for(let Lt=0;Lt<H.content.length;Lt++){const ut=yt.cloneBlock(H.content[Lt]),Fe=$!==void 0?$+Lt:void 0;N.addBlock(ut,void 0,void 0,Fe)}Ot.closeBrowserModal()}const Ib=l.ref(null);function ZL(H){ot.value=!0,l.nextTick(()=>{var $;($=Ib.value)==null||$.filterByBlock(H)})}const Rb=l.ref(!1);function QL(H){if(Rb.value?H.metaKey:H.ctrlKey){if(H.key==="s"){H.preventDefault(),cf().catch(Lt=>{var ut,Fe;return(Fe=(ut=m.config).onError)==null?void 0:Fe.call(ut,Lt)});return}if(H.key.toLowerCase()==="z"){if(H.target.closest(".tpl-text-editable"))return;H.preventDefault(),H.shiftKey?gt.redo():(nt(),gt.undo())}}}let Io=null;async function zb(){if(m.config.onRequestMedia){const H=await m.config.onRequestMedia({accept:["images"]});return H?{url:H.url,alt:H.alt_text||void 0}:null}return Xt.value=["images"],At.value=!0,new Promise(H=>{Io=$=>{H($)}})}function qL(H){At.value=!1,Io==null||Io({url:H.url,alt:H.alt_text||void 0}),Io=null}function $L(){At.value=!1,Io==null||Io(null),Io=null}async function Pb(){var H,$,Lt;x.value=!0,B.value=null;try{await C.initialize(),E.value=!0;const ut=await ye.performHealthCheck({authManager:C});if(!ut.api.ok)throw new Error("Health check failed: API is not reachable");if(!ut.auth.ok)throw new Error(`Health check failed: authentication error${ut.auth.error?` - ${ut.auth.error}`:""}`);if(ut.websocket.ok||console.warn("[Templatical] WebSocket health check failed:",ut.websocket.error??"unknown error","— real-time features will be disabled."),await D.fetchConfig(),m.fontsManager.setCustomFontsEnabled(D.hasFeature("custom_fonts")),(H=m.config.customBlocks)!=null&&H.length&&D.hasFeature("custom_blocks"))for(const Fe of m.config.customBlocks)pt.registerCustom(Fe,ss);m.config.theme&&D.hasFeature("theme_customization")&&(k.value=m.config.theme),m.config.modules!==!1&&D.hasFeature("saved_modules")&&Bt.loadModules(),g("ready")}catch(ut){const Fe=ut instanceof Error?ut:new Error("Initialization failed");B.value=Fe,(Lt=($=m.config).onError)==null||Lt.call($,Fe)}finally{x.value=!1}}function t7(H){return"isUnauthorized"in H&&H.isUnauthorized?v.error.authFailed:"isNotFound"in H&&H.isNotFound?v.error.templateNotFound:v.error.defaultMessage}function e7(H){return"isNotFound"in H&&!!H.isNotFound}function Lb(){return ye.resolveWebSocketConfig(D.config.value.websocket)}async function n7(H){var Lt,ut;const $=await N.create(H);return(ut=(Lt=m.config).onCreate)==null||ut.call(Lt,$),_e(),z.connect($.id,Lb()),$}async function o7(H){var Lt,ut;const $=await N.load(H);return(ut=(Lt=m.config).onLoad)==null||ut.call(Lt,$),_e(),z.connect($.id,Lb()),$}async function l7(H){const $=async Lt=>{if(yt.isCustomBlock(Lt)){const ut=Lt;try{ut.renderedHtml=await pt.renderCustomBlock(ut)}catch{ut.renderedHtml=`<!-- Custom block render error: ${ut.customType} -->`}}if(Lt.type==="section"&&"children"in Lt){const ut=Lt;for(const Fe of ut.children)for(const df of Fe)await $(df)}};for(const Lt of H.blocks)await $(Lt)}async function cf(){var H,$;q.value=!0;try{await l7(N.content.value);const Lt=await N.save();_e(),st.value&&st.value.loadSnapshots();const ut=await lt.exportHtml(Lt.id),Fe={templateId:Lt.id,html:ut.html,mjml:ut.mjml,content:Lt.content};return($=(H=m.config).onSave)==null||$.call(H,Fe),Fe}finally{q.value=!1}}return Ro(document,"keydown",QL),l.onMounted(()=>{Rb.value=navigator.platform.toUpperCase().includes("MAC"),Pb()}),l.onUnmounted(()=>{var H,$;z.disconnect(),gt.destroy(),F.destroy(),($=(H=m.config).onUnmount)==null||$.call(H)}),t({getContent:()=>N.content.value,setContent:H=>N.setContent(H),setTheme:w,create:n7,load:o7,save:cf,sendTestEmail:ht.sendTestEmail}),(H,$)=>{var Lt;return l.openBlock(),l.createElementBlock("div",{class:"tpl tpl:relative tpl:h-full tpl:overflow-hidden",style:l.normalizeStyle(b.value)},[l.createVNode(l.Transition,{"enter-active-class":"tpl:transition-opacity tpl:duration-200","enter-from-class":"tpl:opacity-100","enter-to-class":"tpl:opacity-100","leave-active-class":"tpl:transition-opacity tpl:duration-300","leave-from-class":"tpl:opacity-100","leave-to-class":"tpl:opacity-0"},{default:l.withCtx(()=>[x.value||l.unref(N).state.isLoading?(l.openBlock(),l.createElementBlock("div",hO,[$[20]||($[20]=l.createElementVNode("div",{class:"tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4",style:{"border-bottom":"1px solid var(--tpl-border)"}},[l.createElementVNode("div",{class:"tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]"}),l.createElementVNode("div",{class:"tpl:flex tpl:gap-3"},[l.createElementVNode("div",{class:"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]"}),l.createElementVNode("div",{class:"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]"})])],-1)),l.createElementVNode("div",mO,[l.createElementVNode("div",gO,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(5,ut=>l.createElementVNode("div",{key:ut,class:"tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]"})),64))]),$[18]||($[18]=l.createElementVNode("div",{class:"tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8",style:{"background-color":"var(--tpl-canvas-bg)"}},[l.createElementVNode("div",{class:"tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6",style:{"background-color":"var(--tpl-bg)","box-shadow":"var(--tpl-shadow-sm)"}},[l.createElementVNode("div",{class:"tpl:space-y-2 tpl:py-4"},[l.createElementVNode("div",{class:"tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded"}),l.createElementVNode("div",{class:"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded"}),l.createElementVNode("div",{class:"tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded"})]),l.createElementVNode("div",{class:"tpl:py-4"},[l.createElementVNode("div",{class:"tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]"})]),l.createElementVNode("div",{class:"tpl:space-y-2 tpl:py-4"},[l.createElementVNode("div",{class:"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded"}),l.createElementVNode("div",{class:"tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded"})]),l.createElementVNode("div",{class:"tpl:flex tpl:justify-center tpl:py-4"},[l.createElementVNode("div",{class:"tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]"})]),l.createElementVNode("div",{class:"tpl:space-y-2 tpl:py-4"},[l.createElementVNode("div",{class:"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded"}),l.createElementVNode("div",{class:"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded"})])])],-1)),$[19]||($[19]=l.createElementVNode("div",{class:"tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4",style:{"border-left":"1px solid var(--tpl-border)"}},[l.createElementVNode("div",{class:"tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]"}),l.createElementVNode("div",{class:"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]"}),l.createElementVNode("div",{class:"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]"})],-1))])])):l.createCommentVNode("",!0)]),_:1}),l.createVNode(l.Transition,{"enter-active-class":"tpl:transition-opacity tpl:duration-200","enter-from-class":"tpl:opacity-0","enter-to-class":"tpl:opacity-100","leave-active-class":"tpl:transition-opacity tpl:duration-300","leave-from-class":"tpl:opacity-100","leave-to-class":"tpl:opacity-0"},{default:l.withCtx(()=>[B.value&&!x.value?(l.openBlock(),l.createElementBlock("div",vO,[l.createElementVNode("div",yO,[l.createVNode(l.unref(ml),{size:32,"stroke-width":1.5,style:{color:"var(--tpl-danger)"}})]),l.createElementVNode("div",bO,[l.createElementVNode("h2",kO,l.toDisplayString(l.unref(v).error.title),1),l.createElementVNode("p",xO,l.toDisplayString(t7(B.value)),1)]),e7(B.value)?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl-btn tpl-btn-primary tpl:inline-flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"},onClick:Pb},l.toDisplayString(l.unref(v).error.retry),1))])):l.createCommentVNode("",!0)]),_:1}),l.createElementVNode("header",wO,[l.createElementVNode("div",SO,[it.value?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",EO,[l.createElementVNode("img",{src:l.unref(C).resolveUrl("/logo.svg"),alt:"Templatical",width:"24",height:"24",class:"tpl:shrink-0"},null,8,CO),l.createElementVNode("span",TO,l.toDisplayString(l.unref(v).header.title),1)])),V.value!==null?(l.openBlock(),l.createElementBlock("span",NO,l.toDisplayString(l.unref(y)(l.unref(v).header.templatesUsed,{used:_.value,max:V.value})),1)):l.createCommentVNode("",!0)]),l.createElementVNode("div",MO,[l.createVNode(yh,{viewport:l.unref(N).state.viewport,onChange:l.unref(N).setViewport},null,8,["viewport","onChange"]),l.createVNode(kh,{"dark-mode":l.unref(N).state.darkMode,onChange:l.unref(N).setDarkMode},null,8,["dark-mode","onChange"]),l.createVNode(bh,{"preview-mode":l.unref(N).state.previewMode,onChange:l.unref(N).setPreviewMode},null,8,["preview-mode","onChange"]),l.unref(L)&&P.value?(l.openBlock(),l.createBlock(l.unref(u),{key:0,collaborators:l.unref(L).collaborators.value,"is-connected":l.unref(z).isConnected.value},null,8,["collaborators","is-connected"])):l.createCommentVNode("",!0),st.value?(l.openBlock(),l.createBlock(l.unref(p),{key:1,snapshots:ge.value,"is-loading":nn.value,"is-restoring":Ke.value,onLoad:I,onNavigate:Vn},null,8,["snapshots","is-loading","is-restoring"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",BO,[l.unref(N).state.isDirty?(l.openBlock(),l.createElementBlock("div",OO,[$[21]||($[21]=l.createElementVNode("span",{class:"tpl-pulse tpl:size-1.5 tpl:rounded-full",style:{"background-color":"var(--tpl-primary)"}},null,-1)),l.createTextVNode(" "+l.toDisplayString(l.unref(v).header.unsaved),1)])):l.createCommentVNode("",!0),l.unref(Y).isEnabled.value&&J.value?(l.openBlock(),l.createElementBlock("button",{key:1,"aria-label":l.unref(Y).unresolvedCount.value>0?`${l.unref(v).comments.button} (${l.unref(Y).unresolvedCount.value})`:l.unref(v).comments.button,"aria-expanded":ot.value,class:"tpl-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3.5 tpl:py-2 tpl:text-sm tpl:font-medium tpl:whitespace-nowrap tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary)] hover:tpl:text-white tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",style:l.normalizeStyle({backgroundColor:ot.value?"var(--tpl-primary)":"transparent",color:ot.value?"var(--tpl-bg)":"var(--tpl-primary)",borderColor:"var(--tpl-primary)"}),onClick:$[0]||($[0]=ut=>ot.value=!ot.value)},[l.createVNode(l.unref(ka),{size:16,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(v).comments.button)+" ",1),l.unref(Y).unresolvedCount.value>0&&!ot.value?(l.openBlock(),l.createElementBlock("span",VO,l.toDisplayString(l.unref(Y).unresolvedCount.value),1)):l.createCommentVNode("",!0)],12,DO)):l.createCommentVNode("",!0),A.value&&J.value?(l.openBlock(),l.createElementBlock("div",{key:2,ref_key:"aiMenuRef",ref:Ao,class:"tpl:relative"},[l.createElementVNode("button",{"aria-expanded":Ge.value,class:l.normalizeClass(["tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200",ma.value?"tpl-ai-btn--active":"tpl-ai-btn--idle"]),onClick:l.withModifiers(Ks,["stop"])},[l.createVNode(l.unref(vl),{size:16,"stroke-width":2,class:"tpl-ai-btn-icon"}),l.createTextVNode(" "+l.toDisplayString(l.unref(v).aiChat.button),1)],10,AO),l.createVNode(l.Transition,{"enter-active-class":"tpl:transition-all tpl:duration-150 tpl:ease-out","enter-from-class":"tpl:scale-95 tpl:opacity-0","enter-to-class":"tpl:scale-100 tpl:opacity-100","leave-active-class":"tpl:transition-all tpl:duration-100 tpl:ease-in","leave-from-class":"tpl:scale-100 tpl:opacity-100","leave-to-class":"tpl:scale-95 tpl:opacity-0"},{default:l.withCtx(()=>[Ge.value?(l.openBlock(),l.createElementBlock("div",IO,[l.createVNode(l.unref(f),{"active-feature":af.value,onSelect:JL},null,8,["active-feature"])])):l.createCommentVNode("",!0)]),_:1})],512)):l.createCommentVNode("",!0),l.unref(ht).isEnabled.value&&j.value?(l.openBlock(),l.createElementBlock("button",{key:3,class:"tpl-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3.5 tpl:py-2 tpl:text-sm tpl:font-medium tpl:whitespace-nowrap tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary)] hover:tpl:text-white tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",style:{"background-color":"transparent",color:"var(--tpl-primary)","border-color":"var(--tpl-primary)"},disabled:l.unref(ht).isSending.value||!J.value,onClick:$[1]||($[1]=ut=>wt.value=!0)},[l.unref(ht).isSending.value?(l.openBlock(),l.createBlock(l.unref(Kn),{key:1,class:"tpl-spinner",size:16,"stroke-width":2})):(l.openBlock(),l.createBlock(l.unref(wa),{key:0,size:16,"stroke-width":2})),l.createTextVNode(" "+l.toDisplayString(l.unref(v).testEmail.button),1)],8,RO)):l.createCommentVNode("",!0),l.createElementVNode("button",{class:"tpl-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3.5 tpl:py-2 tpl:text-sm tpl:font-medium tpl:whitespace-nowrap tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary)] hover:tpl:text-white tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",style:{"background-color":"transparent",color:"var(--tpl-primary)","border-color":"var(--tpl-primary)"},disabled:l.unref(N).state.isSaving||q.value||!l.unref(N).state.isDirty,onClick:$[2]||($[2]=ut=>cf())},[!l.unref(N).state.isSaving&&!q.value?(l.openBlock(),l.createBlock(l.unref(Bk),{key:0,size:16,"stroke-width":2})):(l.openBlock(),l.createBlock(l.unref(Kn),{key:1,class:"tpl-spinner",size:16,"stroke-width":2})),l.createTextVNode(" "+l.toDisplayString(l.unref(N).state.isSaving||q.value?l.unref(v).header.saving:l.unref(v).header.save),1)],8,zO)])]),$t.value?(l.openBlock(),l.createElementBlock("div",PO,[l.createElementVNode("div",LO,[l.createVNode(l.unref(hf),{size:18,"stroke-width":2,style:{color:"var(--tpl-primary)"}}),l.createElementVNode("span",null,l.toDisplayString(l.unref(v).snapshotPreview.message),1)]),l.createElementVNode("div",FO,[l.createElementVNode("button",{class:"tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150",style:{"background-color":"transparent",color:"var(--tpl-text-muted)",border:"1px solid var(--tpl-border)"},onClick:In},l.toDisplayString(l.unref(v).snapshotPreview.cancel),1),l.createElementVNode("button",{class:"tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"},onClick:An},l.toDisplayString(l.unref(v).snapshotPreview.restore),1)])])):l.createCommentVNode("",!0),l.createVNode(l.Transition,{"enter-active-class":"tpl:transition-all tpl:duration-200 tpl:ease-out","enter-from-class":"tpl:translate-y-[-8px] tpl:opacity-0","enter-to-class":"tpl:translate-y-0 tpl:opacity-100","leave-active-class":"tpl:transition-all tpl:duration-300 tpl:ease-in","leave-from-class":"tpl:translate-y-0 tpl:opacity-100","leave-to-class":"tpl:translate-y-[-8px] tpl:opacity-0"},{default:l.withCtx(()=>[K.value?(l.openBlock(),l.createElementBlock("div",jO,l.toDisplayString(l.unref(v).history.collabWarning),1)):l.createCommentVNode("",!0)]),_:1}),l.withDirectives(l.createVNode(eh,null,null,512),[[l.vShow,!l.unref(N).state.previewMode]]),l.createElementVNode("div",{class:l.normalizeClass(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto tpl:transition-all tpl:duration-300",[l.unref(N).state.previewMode?"tpl:left-0 tpl:right-0":on.value?"tpl:left-12 tpl:right-[680px]":"tpl:left-12 tpl:right-[320px]",$t.value?"tpl:top-[104px]":"tpl:top-14"]]),style:{"transition-timing-function":"cubic-bezier(0.34, 1.56, 0.64, 1)","background-color":"var(--tpl-canvas-bg)"}},[l.createElementVNode("div",HO,[l.createVNode(l.Transition,{name:"tpl-restore-btn"},{default:l.withCtx(()=>[l.unref(U).hasHiddenBlocks.value?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80",style:{"background-color":"var(--tpl-warning-light)",color:"var(--tpl-warning)","border-color":"var(--tpl-warning)","backdrop-filter":"blur(8px)"},onClick:$[3]||($[3]=ut=>l.unref(U).reset())},[l.createVNode(l.unref(xf),{size:13,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(v).blockSettings.restoreHiddenBlocks),1)])):l.createCommentVNode("",!0)]),_:1})]),l.createElementVNode("main",UO,[l.createVNode(th,{viewport:l.unref(N).state.viewport,content:l.unref(N).content.value,"selected-block-id":l.unref(N).state.selectedBlockId,"dark-mode":l.unref(N).state.darkMode,"preview-mode":l.unref(N).state.previewMode,"locked-blocks":((Lt=l.unref(L))==null?void 0:Lt.lockedBlocks.value)??void 0,onSelectBlock:l.unref(N).selectBlock,onOpenAiChat:$[4]||($[4]=ut=>dt.value=!0),onOpenDesignReference:$[5]||($[5]=ut=>Q.value=!0)},null,8,["viewport","content","selected-block-id","dark-mode","preview-mode","locked-blocks","onSelectBlock"])])],2),l.withDirectives(l.createVNode(vh,{"selected-block":l.unref(N).selectedBlock.value,settings:l.unref(N).content.value.settings,"shifted-left":on.value,onUpdateBlock:$[6]||($[6]=ut=>l.unref(N).updateBlock(l.unref(N).selectedBlock.value.id,ut)),onDeleteBlock:$[7]||($[7]=ut=>l.unref(O).deleteBlock(l.unref(N).selectedBlock.value.id)),onDuplicateBlock:$[8]||($[8]=ut=>l.unref(O).duplicateBlock(l.unref(N).selectedBlock.value)),onUpdateSettings:l.unref(N).updateSettings},null,8,["selected-block","settings","shifted-left","onUpdateSettings"]),[[l.vShow,!l.unref(N).state.previewMode]]),!x.value&&E.value?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createVNode(l.unref(o),{visible:dt.value,"on-apply":ut=>{l.unref(gt).record(),l.unref(N).setContent(ut),l.unref(U).reset()},onClose:$[9]||($[9]=ut=>dt.value=!1)},null,8,["visible","on-apply"]),l.createVNode(l.unref(a),{visible:Z.value,onClose:$[10]||($[10]=ut=>Z.value=!1)},null,8,["visible"]),l.createVNode(l.unref(r),{visible:Q.value,"has-existing-blocks":l.unref(N).content.value.blocks.length>0,onClose:$[11]||($[11]=ut=>Q.value=!1),onApply:$[12]||($[12]=ut=>{l.unref(gt).record(),l.unref(N).setContent(ut),l.unref(U).reset()})},null,8,["visible","has-existing-blocks"]),l.createVNode(l.unref(s),{ref_key:"commentsSidebarRef",ref:Ib,visible:ot.value,onClose:$[13]||($[13]=ut=>ot.value=!1)},null,8,["visible"]),l.createVNode(l.unref(i),{visible:wt.value,"allowed-emails":l.unref(ht).allowedEmails.value,"is-sending":l.unref(ht).isSending.value,error:l.unref(ht).error.value,onSend:YL,onClose:$[14]||($[14]=ut=>wt.value=!1)},null,8,["visible","allowed-emails","is-sending","error"]),l.unref(D).hasFeature("saved_modules")&&m.config.modules!==!1?(l.openBlock(),l.createBlock(l.unref(c),{key:0,visible:l.unref(Ot).showSaveDialog.value??!1,"pre-selected-block-id":l.unref(Ot).preSelectedBlockId.value??null,onClose:$[15]||($[15]=ut=>l.unref(Ot).closeSaveDialog()),onSaved:$[16]||($[16]=ut=>l.unref(Bt).loadModules())},null,8,["visible","pre-selected-block-id"])):l.createCommentVNode("",!0),l.unref(D).hasFeature("saved_modules")&&m.config.modules!==!1?(l.openBlock(),l.createBlock(l.unref(d),{key:1,visible:l.unref(Ot).showBrowserModal.value??!1,onClose:$[17]||($[17]=ut=>l.unref(Ot).closeBrowserModal()),onInsert:XL},null,8,["visible"])):l.createCommentVNode("",!0),l.createVNode(l.unref(h),{visible:At.value,accept:Xt.value,onSelect:qL,onClose:$L},null,8,["visible","accept"])],64)):l.createCommentVNode("",!0)],4)}}}),[["__scopeId","data-v-c9ad0762"]])},Symbol.toStringTag,{value:"Module"}));function Be(n){this.content=n}Be.prototype={constructor:Be,find:function(n){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===n)return t;return-1},get:function(n){var t=this.find(n);return t==-1?void 0:this.content[t+1]},update:function(n,t,e){var o=e&&e!=n?this.remove(e):this,s=o.find(n),r=o.content.slice();return s==-1?r.push(e||n,t):(r[s+1]=t,e&&(r[s]=e)),new Be(r)},remove:function(n){var t=this.find(n);if(t==-1)return this;var e=this.content.slice();return e.splice(t,2),new Be(e)},addToStart:function(n,t){return new Be([n,t].concat(this.remove(n).content))},addToEnd:function(n,t){var e=this.remove(n).content.slice();return e.push(n,t),new Be(e)},addBefore:function(n,t,e){var o=this.remove(t),s=o.content.slice(),r=o.find(n);return s.splice(r==-1?s.length:r,0,t,e),new Be(s)},forEach:function(n){for(var t=0;t<this.content.length;t+=2)n(this.content[t],this.content[t+1])},prepend:function(n){return n=Be.from(n),n.size?new Be(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Be.from(n),n.size?new Be(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var t=this;n=Be.from(n);for(var e=0;e<n.content.length;e+=2)t=t.remove(n.content[e]);return t},toObject:function(){var n={};return this.forEach(function(t,e){n[t]=e}),n},get size(){return this.content.length>>1}},Be.from=function(n){if(n instanceof Be)return n;var t=[];if(n)for(var e in n)t.push(e,n[e]);return new Be(t)};function sg(n,t,e){for(let o=0;;o++){if(o==n.childCount||o==t.childCount)return n.childCount==t.childCount?null:e;let s=n.child(o),r=t.child(o);if(s==r){e+=s.nodeSize;continue}if(!s.sameMarkup(r))return e;if(s.isText&&s.text!=r.text){for(let a=0;s.text[a]==r.text[a];a++)e++;return e}if(s.content.size||r.content.size){let a=sg(s.content,r.content,e+1);if(a!=null)return a}e+=s.nodeSize}}function rg(n,t,e,o){for(let s=n.childCount,r=t.childCount;;){if(s==0||r==0)return s==r?null:{a:e,b:o};let a=n.child(--s),i=t.child(--r),c=a.nodeSize;if(a==i){e-=c,o-=c;continue}if(!a.sameMarkup(i))return{a:e,b:o};if(a.isText&&a.text!=i.text){let d=0,p=Math.min(a.text.length,i.text.length);for(;d<p&&a.text[a.text.length-d-1]==i.text[i.text.length-d-1];)d++,e--,o--;return{a:e,b:o}}if(a.content.size||i.content.size){let d=rg(a.content,i.content,e-1,o-1);if(d)return d}e-=c,o-=c}}class G{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let o=0;o<t.length;o++)this.size+=t[o].nodeSize}nodesBetween(t,e,o,s=0,r){for(let a=0,i=0;i<e;a++){let c=this.content[a],d=i+c.nodeSize;if(d>t&&o(c,s+i,r||null,a)!==!1&&c.content.size){let p=i+1;c.nodesBetween(Math.max(0,t-p),Math.min(c.content.size,e-p),o,s+p)}i=d}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,o,s){let r="",a=!0;return this.nodesBetween(t,e,(i,c)=>{let d=i.isText?i.text.slice(Math.max(t,c)-c,e-c):i.isLeaf?s?typeof s=="function"?s(i):s:i.type.spec.leafText?i.type.spec.leafText(i):"":"";i.isBlock&&(i.isLeaf&&d||i.isTextblock)&&o&&(a?a=!1:r+=o),r+=d},0),r}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,o=t.firstChild,s=this.content.slice(),r=0;for(e.isText&&e.sameMarkup(o)&&(s[s.length-1]=e.withText(e.text+o.text),r=1);r<t.content.length;r++)s.push(t.content[r]);return new G(s,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let o=[],s=0;if(e>t)for(let r=0,a=0;a<e;r++){let i=this.content[r],c=a+i.nodeSize;c>t&&((a<t||c>e)&&(i.isText?i=i.cut(Math.max(0,t-a),Math.min(i.text.length,e-a)):i=i.cut(Math.max(0,t-a-1),Math.min(i.content.size,e-a-1))),o.push(i),s+=i.nodeSize),a=c}return new G(o,s)}cutByIndex(t,e){return t==e?G.empty:t==0&&e==this.content.length?this:new G(this.content.slice(t,e))}replaceChild(t,e){let o=this.content[t];if(o==e)return this;let s=this.content.slice(),r=this.size+e.nodeSize-o.nodeSize;return s[t]=e,new G(s,r)}addToStart(t){return new G([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new G(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,o=0;e<this.content.length;e++){let s=this.content[e];t(s,o,e),o+=s.nodeSize}}findDiffStart(t,e=0){return sg(this,t,e)}findDiffEnd(t,e=this.size,o=t.size){return rg(this,t,e,o)}findIndex(t){if(t==0)return ui(0,t);if(t==this.size)return ui(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,o=0;;e++){let s=this.child(e),r=o+s.nodeSize;if(r>=t)return r==t?ui(e+1,r):ui(e,o);o=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return G.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new G(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return G.empty;let e,o=0;for(let s=0;s<t.length;s++){let r=t[s];o+=r.nodeSize,s&&r.isText&&t[s-1].sameMarkup(r)?(e||(e=t.slice(0,s)),e[e.length-1]=r.withText(e[e.length-1].text+r.text)):e&&e.push(r)}return new G(e||t,o)}static from(t){if(!t)return G.empty;if(t instanceof G)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new G([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}G.empty=new G([],0);const qd={index:0,offset:0};function ui(n,t){return qd.index=n,qd.offset=t,qd}function fi(n,t){if(n===t)return!0;if(!(n&&typeof n=="object")||!(t&&typeof t=="object"))return!1;let e=Array.isArray(n);if(Array.isArray(t)!=e)return!1;if(e){if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(!fi(n[o],t[o]))return!1}else{for(let o in n)if(!(o in t)||!fi(n[o],t[o]))return!1;for(let o in t)if(!(o in n))return!1}return!0}let Gt=class pf{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,o=!1;for(let s=0;s<t.length;s++){let r=t[s];if(this.eq(r))return t;if(this.type.excludes(r.type))e||(e=t.slice(0,s));else{if(r.type.excludes(this.type))return t;!o&&r.type.rank>this.type.rank&&(e||(e=t.slice(0,s)),e.push(this),o=!0),e&&e.push(r)}}return e||(e=t.slice()),o||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&fi(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let o=t.marks[e.type];if(!o)throw new RangeError(`There is no mark type ${e.type} in this schema`);let s=o.create(e.attrs);return o.checkAttrs(s.attrs),s}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let o=0;o<t.length;o++)if(!t[o].eq(e[o]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return pf.none;if(t instanceof pf)return[t];let e=t.slice();return e.sort((o,s)=>o.type.rank-s.type.rank),e}};Gt.none=[];class hi extends Error{}class rt{constructor(t,e,o){this.content=t,this.openStart=e,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let o=ig(this.content,t+this.openStart,e);return o&&new rt(o,this.openStart,this.openEnd)}removeBetween(t,e){return new rt(ag(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return rt.empty;let o=e.openStart||0,s=e.openEnd||0;if(typeof o!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new rt(G.fromJSON(t,e.content),o,s)}static maxOpen(t,e=!0){let o=0,s=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)o++;for(let r=t.lastChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.lastChild)s++;return new rt(t,o,s)}}rt.empty=new rt(G.empty,0,0);function ag(n,t,e){let{index:o,offset:s}=n.findIndex(t),r=n.maybeChild(o),{index:a,offset:i}=n.findIndex(e);if(s==t||r.isText){if(i!=e&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(o!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(o,r.copy(ag(r.content,t-s-1,e-s-1)))}function ig(n,t,e,o){let{index:s,offset:r}=n.findIndex(t),a=n.maybeChild(s);if(r==t||a.isText)return o&&!o.canReplace(s,s,e)?null:n.cut(0,t).append(e).append(n.cut(t));let i=ig(a.content,t-r-1,e,a);return i&&n.replaceChild(s,a.copy(i))}function KO(n,t,e){if(e.openStart>n.depth)throw new hi("Inserted content deeper than insertion position");if(n.depth-e.openStart!=t.depth-e.openEnd)throw new hi("Inconsistent open depths");return cg(n,t,e,0)}function cg(n,t,e,o){let s=n.index(o),r=n.node(o);if(s==t.index(o)&&o<n.depth-e.openStart){let a=cg(n,t,e,o+1);return r.copy(r.content.replaceChild(s,a))}else if(e.content.size)if(!e.openStart&&!e.openEnd&&n.depth==o&&t.depth==o){let a=n.parent,i=a.content;return Ml(a,i.cut(0,n.parentOffset).append(e.content).append(i.cut(t.parentOffset)))}else{let{start:a,end:i}=_O(e,n);return Ml(r,pg(n,a,i,t,o))}else return Ml(r,mi(n,t,o))}function dg(n,t){if(!t.type.compatibleContent(n.type))throw new hi("Cannot join "+t.type.name+" onto "+n.type.name)}function $d(n,t,e){let o=n.node(e);return dg(o,t.node(e)),o}function Nl(n,t){let e=t.length-1;e>=0&&n.isText&&n.sameMarkup(t[e])?t[e]=n.withText(t[e].text+n.text):t.push(n)}function br(n,t,e,o){let s=(t||n).node(e),r=0,a=t?t.index(e):s.childCount;n&&(r=n.index(e),n.depth>e?r++:n.textOffset&&(Nl(n.nodeAfter,o),r++));for(let i=r;i<a;i++)Nl(s.child(i),o);t&&t.depth==e&&t.textOffset&&Nl(t.nodeBefore,o)}function Ml(n,t){return n.type.checkContent(t),n.copy(t)}function pg(n,t,e,o,s){let r=n.depth>s&&$d(n,t,s+1),a=o.depth>s&&$d(e,o,s+1),i=[];return br(null,n,s,i),r&&a&&t.index(s)==e.index(s)?(dg(r,a),Nl(Ml(r,pg(n,t,e,o,s+1)),i)):(r&&Nl(Ml(r,mi(n,t,s+1)),i),br(t,e,s,i),a&&Nl(Ml(a,mi(e,o,s+1)),i)),br(o,null,s,i),new G(i)}function mi(n,t,e){let o=[];if(br(null,n,e,o),n.depth>e){let s=$d(n,t,e+1);Nl(Ml(s,mi(n,t,e+1)),o)}return br(t,null,e,o),new G(o)}function _O(n,t){let e=t.depth-n.openStart,s=t.node(e).copy(n.content);for(let r=e-1;r>=0;r--)s=t.node(r).copy(G.from(s));return{start:s.resolveNoCache(n.openStart+e),end:s.resolveNoCache(s.content.size-n.openEnd-e)}}class kr{constructor(t,e,o){this.pos=t,this.path=e,this.parentOffset=o,this.depth=e.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let o=this.pos-this.path[this.path.length-1],s=t.child(e);return o?t.child(e).cut(o):s}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):t==0?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let o=this.path[e*3],s=e==0?0:this.path[e*3-1]+1;for(let r=0;r<t;r++)s+=o.child(r).nodeSize;return s}marks(){let t=this.parent,e=this.index();if(t.content.size==0)return Gt.none;if(this.textOffset)return t.child(e).marks;let o=t.maybeChild(e-1),s=t.maybeChild(e);if(!o){let i=o;o=s,s=i}let r=o.marks;for(var a=0;a<r.length;a++)r[a].type.spec.inclusive===!1&&(!s||!r[a].isInSet(s.marks))&&(r=r[a--].removeFromSet(r));return r}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let o=e.marks,s=t.parent.maybeChild(t.index());for(var r=0;r<o.length;r++)o[r].type.spec.inclusive===!1&&(!s||!o[r].isInSet(s.marks))&&(o=o[r--].removeFromSet(o));return o}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let o=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);o>=0;o--)if(t.pos<=this.end(o)&&(!e||e(this.node(o))))return new gi(this,t,o);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let o=[],s=0,r=e;for(let a=t;;){let{index:i,offset:c}=a.content.findIndex(r),d=r-c;if(o.push(a,i,s+c),!d||(a=a.child(i),a.isText))break;r=d-1,s+=c+1}return new kr(e,o,r)}static resolveCached(t,e){let o=ug.get(t);if(o)for(let r=0;r<o.elts.length;r++){let a=o.elts[r];if(a.pos==e)return a}else ug.set(t,o=new GO);let s=o.elts[o.i]=kr.resolve(t,e);return o.i=(o.i+1)%JO,s}}class GO{constructor(){this.elts=[],this.i=0}}const JO=12,ug=new WeakMap;class gi{constructor(t,e,o){this.$from=t,this.$to=e,this.depth=o}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const YO=Object.create(null);let Qn=class uf{constructor(t,e,o,s=Gt.none){this.type=t,this.attrs=e,this.marks=s,this.content=o||G.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,o,s=0){this.content.nodesBetween(t,e,o,s,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,o,s){return this.content.textBetween(t,e,o,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,o){return this.type==t&&fi(this.attrs,e||t.defaultAttrs||YO)&&Gt.sameSet(this.marks,o||Gt.none)}copy(t=null){return t==this.content?this:new uf(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new uf(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return t==0&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,o=!1){if(t==e)return rt.empty;let s=this.resolve(t),r=this.resolve(e),a=o?0:s.sharedDepth(e),i=s.start(a),d=s.node(a).content.cut(s.pos-i,r.pos-i);return new rt(d,s.depth-a,r.depth-a)}replace(t,e,o){return KO(this.resolve(t),this.resolve(e),o)}nodeAt(t){for(let e=this;;){let{index:o,offset:s}=e.content.findIndex(t);if(e=e.maybeChild(o),!e)return null;if(s==t||e.isText)return e;t-=s+1}}childAfter(t){let{index:e,offset:o}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:o}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:e,offset:o}=this.content.findIndex(t);if(o<t)return{node:this.content.child(e),index:e,offset:o};let s=this.content.child(e-1);return{node:s,index:e-1,offset:o-s.nodeSize}}resolve(t){return kr.resolveCached(this,t)}resolveNoCache(t){return kr.resolve(this,t)}rangeHasMark(t,e,o){let s=!1;return e>t&&this.nodesBetween(t,e,r=>(o.isInSet(r.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),fg(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,o=G.empty,s=0,r=o.childCount){let a=this.contentMatchAt(t).matchFragment(o,s,r),i=a&&a.matchFragment(this.content,e);if(!i||!i.validEnd)return!1;for(let c=s;c<r;c++)if(!this.type.allowsMarks(o.child(c).marks))return!1;return!0}canReplaceWith(t,e,o,s){if(s&&!this.type.allowsMarks(s))return!1;let r=this.contentMatchAt(t).matchType(o),a=r&&r.matchFragment(this.content,e);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Gt.none;for(let e=0;e<this.marks.length;e++){let o=this.marks[e];o.type.checkAttrs(o.attrs),t=o.addToSet(t)}if(!Gt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(e=>e.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let o;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=e.marks.map(t.markFromJSON)}if(e.type=="text"){if(typeof e.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(e.text,o)}let s=G.fromJSON(t,e.content),r=t.nodeType(e.type).create(e.attrs,s,o);return r.type.checkAttrs(r.attrs),r}};Qn.prototype.text=void 0;class vi extends Qn{constructor(t,e,o,s){if(super(t,e,null,s),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):fg(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new vi(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new vi(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return t==0&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function fg(n,t){for(let e=n.length-1;e>=0;e--)t=n[e].type.name+"("+t+")";return t}class Bl{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let o=new XO(t,e);if(o.next==null)return Bl.empty;let s=hg(o);o.next&&o.err("Unexpected trailing text");let r=n4(e4(s));return o4(r,o),r}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,o=t.childCount){let s=this;for(let r=e;s&&r<o;r++)s=s.matchType(t.child(r).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let o=0;o<t.next.length;o++)if(this.next[e].type==t.next[o].type)return!0;return!1}fillBefore(t,e=!1,o=0){let s=[this];function r(a,i){let c=a.matchFragment(t,o);if(c&&(!e||c.validEnd))return G.from(i.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:p,next:u}=a.next[d];if(!(p.isText||p.hasRequiredAttrs())&&s.indexOf(u)==-1){s.push(u);let f=r(u,i.concat(p));if(f)return f}}return null}return r(this,[])}findWrapping(t){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==t)return this.wrapCache[o+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let s=o.shift(),r=s.match;if(r.matchType(t)){let a=[];for(let i=s;i.type;i=i.via)a.push(i.type);return a.reverse()}for(let a=0;a<r.next.length;a++){let{type:i,next:c}=r.next[a];!i.isLeaf&&!i.hasRequiredAttrs()&&!(i.name in e)&&(!s.type||c.validEnd)&&(o.push({match:i.contentMatch,type:i,via:s}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function e(o){t.push(o);for(let s=0;s<o.next.length;s++)t.indexOf(o.next[s].next)==-1&&e(o.next[s].next)}return e(this),t.map((o,s)=>{let r=s+(o.validEnd?"*":" ")+" ";for(let a=0;a<o.next.length;a++)r+=(a?", ":"")+o.next[a].type.name+"->"+t.indexOf(o.next[a].next);return r}).join(`
478
+ `)}}Bl.empty=new Bl(!0);class XO{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function hg(n){let t=[];do t.push(ZO(n));while(n.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function ZO(n){let t=[];do t.push(QO(n));while(n.next&&n.next!=")"&&n.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function QO(n){let t=t4(n);for(;;)if(n.eat("+"))t={type:"plus",expr:t};else if(n.eat("*"))t={type:"star",expr:t};else if(n.eat("?"))t={type:"opt",expr:t};else if(n.eat("{"))t=qO(n,t);else break;return t}function mg(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let t=Number(n.next);return n.pos++,t}function qO(n,t){let e=mg(n),o=e;return n.eat(",")&&(n.next!="}"?o=mg(n):o=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:e,max:o,expr:t}}function $O(n,t){let e=n.nodeTypes,o=e[t];if(o)return[o];let s=[];for(let r in e){let a=e[r];a.isInGroup(t)&&s.push(a)}return s.length==0&&n.err("No node type or group '"+t+"' found"),s}function t4(n){if(n.eat("(")){let t=hg(n);return n.eat(")")||n.err("Missing closing paren"),t}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let t=$O(n,n.next).map(e=>(n.inline==null?n.inline=e.isInline:n.inline!=e.isInline&&n.err("Mixing inline and block content"),{type:"name",value:e}));return n.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function e4(n){let t=[[]];return s(r(n,0),e()),t;function e(){return t.push([])-1}function o(a,i,c){let d={term:c,to:i};return t[a].push(d),d}function s(a,i){a.forEach(c=>c.to=i)}function r(a,i){if(a.type=="choice")return a.exprs.reduce((c,d)=>c.concat(r(d,i)),[]);if(a.type=="seq")for(let c=0;;c++){let d=r(a.exprs[c],i);if(c==a.exprs.length-1)return d;s(d,i=e())}else if(a.type=="star"){let c=e();return o(i,c),s(r(a.expr,c),c),[o(c)]}else if(a.type=="plus"){let c=e();return s(r(a.expr,i),c),s(r(a.expr,c),c),[o(c)]}else{if(a.type=="opt")return[o(i)].concat(r(a.expr,i));if(a.type=="range"){let c=i;for(let d=0;d<a.min;d++){let p=e();s(r(a.expr,c),p),c=p}if(a.max==-1)s(r(a.expr,c),c);else for(let d=a.min;d<a.max;d++){let p=e();o(c,p),s(r(a.expr,c),p),c=p}return[o(c)]}else{if(a.type=="name")return[o(i,void 0,a.value)];throw new Error("Unknown expr type")}}}}function gg(n,t){return t-n}function vg(n,t){let e=[];return o(t),e.sort(gg);function o(s){let r=n[s];if(r.length==1&&!r[0].term)return o(r[0].to);e.push(s);for(let a=0;a<r.length;a++){let{term:i,to:c}=r[a];!i&&e.indexOf(c)==-1&&o(c)}}}function n4(n){let t=Object.create(null);return e(vg(n,0));function e(o){let s=[];o.forEach(a=>{n[a].forEach(({term:i,to:c})=>{if(!i)return;let d;for(let p=0;p<s.length;p++)s[p][0]==i&&(d=s[p][1]);vg(n,c).forEach(p=>{d||s.push([i,d=[]]),d.indexOf(p)==-1&&d.push(p)})})});let r=t[o.join(",")]=new Bl(o.indexOf(n.length-1)>-1);for(let a=0;a<s.length;a++){let i=s[a][1].sort(gg);r.next.push({type:s[a][0],next:t[i.join(",")]||e(i)})}return r}}function o4(n,t){for(let e=0,o=[n];e<o.length;e++){let s=o[e],r=!s.validEnd,a=[];for(let i=0;i<s.next.length;i++){let{type:c,next:d}=s.next[i];a.push(c.name),r&&!(c.isText||c.hasRequiredAttrs())&&(r=!1),o.indexOf(d)==-1&&o.push(d)}r&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function yg(n){let t=Object.create(null);for(let e in n){let o=n[e];if(!o.hasDefault)return null;t[e]=o.default}return t}function bg(n,t){let e=Object.create(null);for(let o in n){let s=t&&t[o];if(s===void 0){let r=n[o];if(r.hasDefault)s=r.default;else throw new RangeError("No value supplied for attribute "+o)}e[o]=s}return e}function kg(n,t,e,o){for(let s in t)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${e} of type ${s}`);for(let s in n){let r=n[s];r.validate&&r.validate(t[s])}}function xg(n,t){let e=Object.create(null);if(t)for(let o in t)e[o]=new s4(n,o,t[o]);return e}let wg=class Yb{constructor(t,e,o){this.name=t,this.schema=e,this.spec=o,this.markSet=null,this.groups=o.group?o.group.split(" "):[],this.attrs=xg(t,o.attrs),this.defaultAttrs=yg(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(o.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Bl.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:bg(this.attrs,t)}create(t=null,e,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Qn(this,this.computeAttrs(t),G.from(e),Gt.setFrom(o))}createChecked(t=null,e,o){return e=G.from(e),this.checkContent(e),new Qn(this,this.computeAttrs(t),e,Gt.setFrom(o))}createAndFill(t=null,e,o){if(t=this.computeAttrs(t),e=G.from(e),e.size){let a=this.contentMatch.fillBefore(e);if(!a)return null;e=a.append(e)}let s=this.contentMatch.matchFragment(e),r=s&&s.fillBefore(G.empty,!0);return r?new Qn(this,t,e.append(r),Gt.setFrom(o)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let o=0;o<t.childCount;o++)if(!this.allowsMarks(t.child(o).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){kg(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let e;for(let o=0;o<t.length;o++)this.allowsMarkType(t[o].type)?e&&e.push(t[o]):e||(e=t.slice(0,o));return e?e.length?e:Gt.none:t}static compile(t,e){let o=Object.create(null);t.forEach((r,a)=>o[r]=new Yb(r,e,a));let s=e.spec.topNode||"doc";if(!o[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!o.text)throw new RangeError("Every schema needs a 'text' type");for(let r in o.text.attrs)throw new RangeError("The text node type should not have attributes");return o}};function l4(n,t,e){let o=e.split("|");return s=>{let r=s===null?"null":typeof s;if(o.indexOf(r)<0)throw new RangeError(`Expected value of type ${o} for attribute ${t} on type ${n}, got ${r}`)}}class s4{constructor(t,e,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?l4(t,e,o.validate):o.validate}get isRequired(){return!this.hasDefault}}class yi{constructor(t,e,o,s){this.name=t,this.rank=e,this.schema=o,this.spec=s,this.attrs=xg(t,s.attrs),this.excluded=null;let r=yg(this.attrs);this.instance=r?new Gt(this,r):null}create(t=null){return!t&&this.instance?this.instance:new Gt(this,bg(this.attrs,t))}static compile(t,e){let o=Object.create(null),s=0;return t.forEach((r,a)=>o[r]=new yi(r,s++,e,a)),o}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){kg(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Sg{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let s in t)e[s]=t[s];e.nodes=Be.from(t.nodes),e.marks=Be.from(t.marks||{}),this.nodes=wg.compile(this.spec.nodes,this),this.marks=yi.compile(this.spec.marks,this);let o=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let r=this.nodes[s],a=r.spec.content||"",i=r.spec.marks;if(r.contentMatch=o[a]||(o[a]=Bl.parse(a,this.nodes)),r.inlineContent=r.contentMatch.inlineContent,r.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!r.isInline||!r.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=r}r.markSet=i=="_"?null:i?Eg(this,i.split(" ")):i==""||!r.inlineContent?[]:null}for(let s in this.marks){let r=this.marks[s],a=r.spec.excludes;r.excluded=a==null?[r]:a==""?[]:Eg(this,a.split(" "))}this.nodeFromJSON=s=>Qn.fromJSON(this,s),this.markFromJSON=s=>Gt.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,o,s){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof wg){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(e,o,s)}text(t,e){let o=this.nodes.text;return new vi(o,o.defaultAttrs,t,Gt.setFrom(e))}mark(t,e){return typeof t=="string"&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Eg(n,t){let e=[];for(let o=0;o<t.length;o++){let s=t[o],r=n.marks[s],a=r;if(r)e.push(r);else for(let i in n.marks){let c=n.marks[i];(s=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(s)>-1)&&e.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[o]+"'")}return e}function r4(n){return n.tag!=null}function a4(n){return n.style!=null}class bo{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let o=this.matchedStyles=[];e.forEach(s=>{if(r4(s))this.tags.push(s);else if(a4(s)){let r=/[^=]*/.exec(s.style)[0];o.indexOf(r)<0&&o.push(r),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let r=t.nodes[s.node];return r.contentMatch.matchType(r)})}parse(t,e={}){let o=new Mg(this,e,!1);return o.addAll(t,Gt.none,e.from,e.to),o.finish()}parseSlice(t,e={}){let o=new Mg(this,e,!0);return o.addAll(t,Gt.none,e.from,e.to),rt.maxOpen(o.finish())}matchTag(t,e,o){for(let s=o?this.tags.indexOf(o)+1:0;s<this.tags.length;s++){let r=this.tags[s];if(d4(t,r.tag)&&(r.namespace===void 0||t.namespaceURI==r.namespace)&&(!r.context||e.matchesContext(r.context))){if(r.getAttrs){let a=r.getAttrs(t);if(a===!1)continue;r.attrs=a||void 0}return r}}}matchStyle(t,e,o,s){for(let r=s?this.styles.indexOf(s)+1:0;r<this.styles.length;r++){let a=this.styles[r],i=a.style;if(!(i.indexOf(t)!=0||a.context&&!o.matchesContext(a.context)||i.length>t.length&&(i.charCodeAt(t.length)!=61||i.slice(t.length+1)!=e))){if(a.getAttrs){let c=a.getAttrs(e);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(t){let e=[];function o(s){let r=s.priority==null?50:s.priority,a=0;for(;a<e.length;a++){let i=e[a];if((i.priority==null?50:i.priority)<r)break}e.splice(a,0,s)}for(let s in t.marks){let r=t.marks[s].spec.parseDOM;r&&r.forEach(a=>{o(a=Bg(a)),a.mark||a.ignore||a.clearMark||(a.mark=s)})}for(let s in t.nodes){let r=t.nodes[s].spec.parseDOM;r&&r.forEach(a=>{o(a=Bg(a)),a.node||a.ignore||a.mark||(a.node=s)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new bo(t,bo.schemaRules(t)))}}const Cg={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},i4={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tg={ol:!0,ul:!0},xr=1,tp=2,wr=4;function Ng(n,t,e){return t!=null?(t?xr:0)|(t==="full"?tp:0):n&&n.whitespace=="pre"?xr|tp:e&~wr}class bi{constructor(t,e,o,s,r,a){this.type=t,this.attrs=e,this.marks=o,this.solid=s,this.options=a,this.content=[],this.activeMarks=Gt.none,this.match=r||(a&wr?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(G.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let o=this.type.contentMatch,s;return(s=o.findWrapping(t.type))?(this.match=o,s):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&xr)){let o=this.content[this.content.length-1],s;if(o&&o.isText&&(s=/[ \t\r\n\u000c]+$/.exec(o.text))){let r=o;o.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-s[0].length))}}let e=G.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(G.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Cg.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Mg{constructor(t,e,o){this.parser=t,this.options=e,this.isOpen=o,this.open=0,this.localPreserveWS=!1;let s=e.topNode,r,a=Ng(null,e.preserveWhitespace,0)|(o?wr:0);s?r=new bi(s.type,s.attrs,Gt.none,!0,e.topMatch||s.type.contentMatch,a):o?r=new bi(null,null,Gt.none,!0,null,a):r=new bi(t.schema.topNodeType,null,Gt.none,!0,null,a),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){t.nodeType==3?this.addTextNode(t,e):t.nodeType==1&&this.addElement(t,e)}addTextNode(t,e){let o=t.nodeValue,s=this.top,r=s.options&tp?"full":this.localPreserveWS||(s.options&xr)>0,{schema:a}=this.parser;if(r==="full"||s.inlineContext(t)||/[^ \t\r\n\u000c]/.test(o)){if(r)if(r==="full")o=o.replace(/\r\n?/g,`
479
+ `);else if(a.linebreakReplacement&&/[\r\n]/.test(o)&&this.top.findWrapping(a.linebreakReplacement.create())){let i=o.split(/\r?\n|\r/);for(let c=0;c<i.length;c++)c&&this.insertNode(a.linebreakReplacement.create(),e,!0),i[c]&&this.insertNode(a.text(i[c]),e,!/\S/.test(i[c]));o=""}else o=o.replace(/\r?\n|\r/g," ");else if(o=o.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(o)&&this.open==this.nodes.length-1){let i=s.content[s.content.length-1],c=t.previousSibling;(!i||c&&c.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(o=o.slice(1))}o&&this.insertNode(a.text(o),e,!/\S/.test(o)),this.findInText(t)}else this.findInside(t)}addElement(t,e,o){let s=this.localPreserveWS,r=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let a=t.nodeName.toLowerCase(),i;Tg.hasOwnProperty(a)&&this.parser.normalizeLists&&c4(t);let c=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,o));t:if(c?c.ignore:i4.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,e);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(t=c.skip);let d,p=this.needsBlock;if(Cg.hasOwnProperty(a))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),d=!0,r.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}let u=c&&c.skip?e:this.readStyles(t,e);u&&this.addAll(t,u),d&&this.sync(r),this.needsBlock=p}else{let d=this.readStyles(t,e);d&&this.addElementByRule(t,c,d,c.consuming===!1?i:void 0)}this.localPreserveWS=s}leafFallback(t,e){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
480
+ `),e)}ignoreFallback(t,e){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let o=t.style;if(o&&o.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let r=this.parser.matchedStyles[s],a=o.getPropertyValue(r);if(a)for(let i=void 0;;){let c=this.parser.matchStyle(r,a,this,i);if(!c)break;if(c.ignore)return null;if(c.clearMark?e=e.filter(d=>!c.clearMark(d)):e=e.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)i=c;else break}}return e}addElementByRule(t,e,o,s){let r,a;if(e.node)if(a=this.parser.schema.nodes[e.node],a.isLeaf)this.insertNode(a.create(e.attrs),o,t.nodeName=="BR")||this.leafFallback(t,o);else{let c=this.enter(a,e.attrs||null,o,e.preserveWhitespace);c&&(r=!0,o=c)}else{let c=this.parser.schema.marks[e.mark];o=o.concat(c.create(e.attrs))}let i=this.top;if(a&&a.isLeaf)this.findInside(t);else if(s)this.addElement(t,o,s);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,o,!1));else{let c=t;typeof e.contentElement=="string"?c=t.querySelector(e.contentElement):typeof e.contentElement=="function"?c=e.contentElement(t):e.contentElement&&(c=e.contentElement),this.findAround(t,c,!0),this.addAll(c,o),this.findAround(t,c,!1)}r&&this.sync(i)&&this.open--}addAll(t,e,o,s){let r=o||0;for(let a=o?t.childNodes[o]:t.firstChild,i=s==null?null:t.childNodes[s];a!=i;a=a.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(a,e);this.findAtPoint(t,r)}findPlace(t,e,o){let s,r;for(let a=this.open,i=0;a>=0;a--){let c=this.nodes[a],d=c.findWrapping(t);if(d&&(!s||s.length>d.length+i)&&(s=d,r=c,!d.length))break;if(c.solid){if(o)break;i+=2}}if(!s)return null;this.sync(r);for(let a=0;a<s.length;a++)e=this.enterInner(s[a],null,e,!1);return e}insertNode(t,e,o){if(t.isInline&&this.needsBlock&&!this.top.type){let r=this.textblockFromContext();r&&(e=this.enterInner(r,null,e))}let s=this.findPlace(t,e,o);if(s){this.closeExtra();let r=this.top;r.match&&(r.match=r.match.matchType(t.type));let a=Gt.none;for(let i of s.concat(t.marks))(r.type?r.type.allowsMarkType(i.type):Og(i.type,t.type))&&(a=i.addToSet(a));return r.content.push(t.mark(a)),!0}return!1}enter(t,e,o,s){let r=this.findPlace(t.create(e),o,!1);return r&&(r=this.enterInner(t,e,o,!0,s)),r}enterInner(t,e,o,s=!1,r){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(t);let i=Ng(t,r,a.options);a.options&wr&&a.content.length==0&&(i|=wr);let c=Gt.none;return o=o.filter(d=>(a.type?a.type.allowsMarkType(d.type):Og(d.type,t))?(c=d.addToSet(c),!1):!0),this.nodes.push(new bi(t,e,c,s,null,i)),this.open++,o}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=xr)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let o=this.nodes[e].content;for(let s=o.length-1;s>=0;s--)t+=o[s].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let o=0;o<this.find.length;o++)this.find[o].node==t&&this.find[o].offset==e&&(this.find[o].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].pos==null&&t.nodeType==1&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,o){if(t!=e&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&t.nodeType==1&&t.contains(this.find[s].node)&&e.compareDocumentPosition(this.find[s].node)&(o?2:4)&&(this.find[s].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),o=this.options.context,s=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),r=-(o?o.depth+1:0)+(s?0:1),a=(i,c)=>{for(;i>=0;i--){let d=e[i];if(d==""){if(i==e.length-1||i==0)continue;for(;c>=r;c--)if(a(i-1,c))return!0;return!1}else{let p=c>0||c==0&&s?this.nodes[c].type:o&&c>=r?o.node(c-r).type:null;if(!p||p.name!=d&&!p.isInGroup(d))return!1;c--}}return!0};return a(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let o=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(o&&o.isTextblock&&o.defaultAttrs)return o}for(let e in this.parser.schema.nodes){let o=this.parser.schema.nodes[e];if(o.isTextblock&&o.defaultAttrs)return o}}}function c4(n){for(let t=n.firstChild,e=null;t;t=t.nextSibling){let o=t.nodeType==1?t.nodeName.toLowerCase():null;o&&Tg.hasOwnProperty(o)&&e?(e.appendChild(t),t=e):o=="li"?e=t:o&&(e=null)}}function d4(n,t){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,t)}function Bg(n){let t={};for(let e in n)t[e]=n[e];return t}function Og(n,t){let e=t.schema.nodes;for(let o in e){let s=e[o];if(!s.allowsMarkType(n))continue;let r=[],a=i=>{r.push(i);for(let c=0;c<i.edgeCount;c++){let{type:d,next:p}=i.edge(c);if(d==t||r.indexOf(p)<0&&a(p))return!0}};if(a(s.contentMatch))return!0}}class Ol{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},o){o||(o=ep(e).createDocumentFragment());let s=o,r=[];return t.forEach(a=>{if(r.length||a.marks.length){let i=0,c=0;for(;i<r.length&&c<a.marks.length;){let d=a.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(r[i][0])||d.type.spec.spanning===!1)break;i++,c++}for(;i<r.length;)s=r.pop()[1];for(;c<a.marks.length;){let d=a.marks[c++],p=this.serializeMark(d,a.isInline,e);p&&(r.push([d,s]),s.appendChild(p.dom),s=p.contentDOM||p.dom)}}s.appendChild(this.serializeNodeInner(a,e))}),o}serializeNodeInner(t,e){let{dom:o,contentDOM:s}=ki(ep(e),this.nodes[t.type.name](t),null,t.attrs);if(s){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,s)}return o}serializeNode(t,e={}){let o=this.serializeNodeInner(t,e);for(let s=t.marks.length-1;s>=0;s--){let r=this.serializeMark(t.marks[s],t.isInline,e);r&&((r.contentDOM||r.dom).appendChild(o),o=r.dom)}return o}serializeMark(t,e,o={}){let s=this.marks[t.type.name];return s&&ki(ep(o),s(t,e),null,t.attrs)}static renderSpec(t,e,o=null,s){return ki(t,e,o,s)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ol(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Dg(t.nodes);return e.text||(e.text=o=>o.text),e}static marksFromSchema(t){return Dg(t.marks)}}function Dg(n){let t={};for(let e in n){let o=n[e].spec.toDOM;o&&(t[e]=o)}return t}function ep(n){return n.document||window.document}const Vg=new WeakMap;function p4(n){let t=Vg.get(n);return t===void 0&&Vg.set(n,t=u4(n)),t}function u4(n){let t=null;function e(o){if(o&&typeof o=="object")if(Array.isArray(o))if(typeof o[0]=="string")t||(t=[]),t.push(o);else for(let s=0;s<o.length;s++)e(o[s]);else for(let s in o)e(o[s])}return e(n),t}function ki(n,t,e,o){if(typeof t=="string")return{dom:n.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let s=t[0],r;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(o&&(r=p4(o))&&r.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=s.indexOf(" ");a>0&&(e=s.slice(0,a),s=s.slice(a+1));let i,c=e?n.createElementNS(e,s):n.createElement(s),d=t[1],p=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){p=2;for(let u in d)if(d[u]!=null){let f=u.indexOf(" ");f>0?c.setAttributeNS(u.slice(0,f),u.slice(f+1),d[u]):u=="style"&&c.style?c.style.cssText=d[u]:c.setAttribute(u,d[u])}}for(let u=p;u<t.length;u++){let f=t[u];if(f===0){if(u<t.length-1||u>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:h,contentDOM:m}=ki(n,f,e,o);if(c.appendChild(h),m){if(i)throw new RangeError("Multiple content holes");i=m}}}return{dom:c,contentDOM:i}}const Ag=65535,Ig=Math.pow(2,16);function f4(n,t){return n+t*Ig}function Rg(n){return n&Ag}function h4(n){return(n-(n&Ag))/Ig}const zg=1,Pg=2,xi=4,Lg=8;class np{constructor(t,e,o){this.pos=t,this.delInfo=e,this.recover=o}get deleted(){return(this.delInfo&Lg)>0}get deletedBefore(){return(this.delInfo&(zg|xi))>0}get deletedAfter(){return(this.delInfo&(Pg|xi))>0}get deletedAcross(){return(this.delInfo&xi)>0}}class dn{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&dn.empty)return dn.empty}recover(t){let e=0,o=Rg(t);if(!this.inverted)for(let s=0;s<o;s++)e+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[o*3]+e+h4(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,o){let s=0,r=this.inverted?2:1,a=this.inverted?1:2;for(let i=0;i<this.ranges.length;i+=3){let c=this.ranges[i]-(this.inverted?s:0);if(c>t)break;let d=this.ranges[i+r],p=this.ranges[i+a],u=c+d;if(t<=u){let f=d?t==c?-1:t==u?1:e:e,h=c+s+(f<0?0:p);if(o)return h;let m=t==(e<0?c:u)?null:f4(i/3,t-c),g=t==c?Pg:t==u?zg:xi;return(e<0?t!=c:t!=u)&&(g|=Lg),new np(h,g,m)}s+=p-d}return o?t+s:new np(t+s,0,null)}touches(t,e){let o=0,s=Rg(e),r=this.inverted?2:1,a=this.inverted?1:2;for(let i=0;i<this.ranges.length;i+=3){let c=this.ranges[i]-(this.inverted?o:0);if(c>t)break;let d=this.ranges[i+r],p=c+d;if(t<=p&&i==s*3)return!0;o+=this.ranges[i+a]-d}return!1}forEach(t){let e=this.inverted?2:1,o=this.inverted?1:2;for(let s=0,r=0;s<this.ranges.length;s+=3){let a=this.ranges[s],i=a-(this.inverted?r:0),c=a+(this.inverted?0:r),d=this.ranges[s+e],p=this.ranges[s+o];t(i,i+d,c,c+p),r+=p-d}}invert(){return new dn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?dn.empty:new dn(t<0?[0,-t,0]:[0,0,t])}}dn.empty=new dn([]);class Sr{constructor(t,e,o=0,s=t?t.length:0){this.mirror=e,this.from=o,this.to=s,this._maps=t||[],this.ownData=!(t||e)}get maps(){return this._maps}slice(t=0,e=this.maps.length){return new Sr(this._maps,this.mirror,t,e)}appendMap(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),e!=null&&this.setMirror(this._maps.length-1,e)}appendMapping(t){for(let e=0,o=this._maps.length;e<t._maps.length;e++){let s=t.getMirror(e);this.appendMap(t._maps[e],s!=null&&s<e?o+s:void 0)}}getMirror(t){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,o=this._maps.length+t._maps.length;e>=0;e--){let s=t.getMirror(e);this.appendMap(t._maps[e].invert(),s!=null&&s>e?o-s-1:void 0)}}invert(){let t=new Sr;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let o=this.from;o<this.to;o++)t=this._maps[o].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,o){let s=0;for(let r=this.from;r<this.to;r++){let a=this._maps[r],i=a.mapResult(t,e);if(i.recover!=null){let c=this.getMirror(r);if(c!=null&&c>r&&c<this.to){r=c,t=this._maps[c].recover(i.recover);continue}}s|=i.delInfo,t=i.pos}return o?t:new np(t,s,null)}}const op=Object.create(null);class ze{getMap(){return dn.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=op[e.stepType];if(!o)throw new RangeError(`No step type ${e.stepType} defined`);return o.fromJSON(t,e)}static jsonID(t,e){if(t in op)throw new RangeError("Duplicate use of step JSON ID "+t);return op[t]=e,e.prototype.jsonID=t,e}}class ce{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new ce(t,null)}static fail(t){return new ce(null,t)}static fromReplace(t,e,o,s){try{return ce.ok(t.replace(e,o,s))}catch(r){if(r instanceof hi)return ce.fail(r.message);throw r}}}function lp(n,t,e){let o=[];for(let s=0;s<n.childCount;s++){let r=n.child(s);r.content.size&&(r=r.copy(lp(r.content,t,r))),r.isInline&&(r=t(r,e,s)),o.push(r)}return G.fromArray(o)}class Zo extends ze{constructor(t,e,o){super(),this.from=t,this.to=e,this.mark=o}apply(t){let e=t.slice(this.from,this.to),o=t.resolve(this.from),s=o.node(o.sharedDepth(this.to)),r=new rt(lp(e.content,(a,i)=>!a.isAtom||!i.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),s),e.openStart,e.openEnd);return ce.fromReplace(t,this.from,this.to,r)}invert(){return new qn(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return e.deleted&&o.deleted||e.pos>=o.pos?null:new Zo(e.pos,o.pos,this.mark)}merge(t){return t instanceof Zo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Zo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Zo(e.from,e.to,t.markFromJSON(e.mark))}}ze.jsonID("addMark",Zo);class qn extends ze{constructor(t,e,o){super(),this.from=t,this.to=e,this.mark=o}apply(t){let e=t.slice(this.from,this.to),o=new rt(lp(e.content,s=>s.mark(this.mark.removeFromSet(s.marks)),t),e.openStart,e.openEnd);return ce.fromReplace(t,this.from,this.to,o)}invert(){return new Zo(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return e.deleted&&o.deleted||e.pos>=o.pos?null:new qn(e.pos,o.pos,this.mark)}merge(t){return t instanceof qn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new qn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new qn(e.from,e.to,t.markFromJSON(e.mark))}}ze.jsonID("removeMark",qn);class Qo extends ze{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return ce.fail("No node at mark step's position");let o=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return ce.fromReplace(t,this.pos,this.pos+1,new rt(G.from(o),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let o=this.mark.addToSet(e.marks);if(o.length==e.marks.length){for(let s=0;s<e.marks.length;s++)if(!e.marks[s].isInSet(o))return new Qo(this.pos,e.marks[s]);return new Qo(this.pos,this.mark)}}return new Dl(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Qo(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Qo(e.pos,t.markFromJSON(e.mark))}}ze.jsonID("addNodeMark",Qo);class Dl extends ze{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return ce.fail("No node at mark step's position");let o=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return ce.fromReplace(t,this.pos,this.pos+1,new rt(G.from(o),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new Qo(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Dl(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Dl(e.pos,t.markFromJSON(e.mark))}}ze.jsonID("removeNodeMark",Dl);class be extends ze{constructor(t,e,o,s=!1){super(),this.from=t,this.to=e,this.slice=o,this.structure=s}apply(t){return this.structure&&sp(t,this.from,this.to)?ce.fail("Structure replace would overwrite content"):ce.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new dn([this.from,this.to-this.from,this.slice.size])}invert(t){return new be(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return e.deletedAcross&&o.deletedAcross?null:new be(e.pos,Math.max(e.pos,o.pos),this.slice,this.structure)}merge(t){if(!(t instanceof be)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let e=this.slice.size+t.slice.size==0?rt.empty:new rt(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new be(this.from,this.to+(t.to-t.from),e,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let e=this.slice.size+t.slice.size==0?rt.empty:new rt(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new be(t.from,this.to,e,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new be(e.from,e.to,rt.fromJSON(t,e.slice),!!e.structure)}}ze.jsonID("replace",be);class ke extends ze{constructor(t,e,o,s,r,a,i=!1){super(),this.from=t,this.to=e,this.gapFrom=o,this.gapTo=s,this.slice=r,this.insert=a,this.structure=i}apply(t){if(this.structure&&(sp(t,this.from,this.gapFrom)||sp(t,this.gapTo,this.to)))return ce.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return ce.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,e.content);return o?ce.fromReplace(t,this.from,this.to,o):ce.fail("Content does not fit in gap")}getMap(){return new dn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new ke(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),o=t.mapResult(this.to,-1),s=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),r=this.to==this.gapTo?o.pos:t.map(this.gapTo,1);return e.deletedAcross&&o.deletedAcross||s<e.pos||r>o.pos?null:new ke(e.pos,o.pos,s,r,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number"||typeof e.gapFrom!="number"||typeof e.gapTo!="number"||typeof e.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ke(e.from,e.to,e.gapFrom,e.gapTo,rt.fromJSON(t,e.slice),e.insert,!!e.structure)}}ze.jsonID("replaceAround",ke);function sp(n,t,e){let o=n.resolve(t),s=e-t,r=o.depth;for(;s>0&&r>0&&o.indexAfter(r)==o.node(r).childCount;)r--,s--;if(s>0){let a=o.node(r).maybeChild(o.indexAfter(r));for(;s>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,s--}}return!1}function m4(n,t,e,o){let s=[],r=[],a,i;n.doc.nodesBetween(t,e,(c,d,p)=>{if(!c.isInline)return;let u=c.marks;if(!o.isInSet(u)&&p.type.allowsMarkType(o.type)){let f=Math.max(d,t),h=Math.min(d+c.nodeSize,e),m=o.addToSet(u);for(let g=0;g<u.length;g++)u[g].isInSet(m)||(a&&a.to==f&&a.mark.eq(u[g])?a.to=h:s.push(a=new qn(f,h,u[g])));i&&i.to==f?i.to=h:r.push(i=new Zo(f,h,o))}}),s.forEach(c=>n.step(c)),r.forEach(c=>n.step(c))}function g4(n,t,e,o){let s=[],r=0;n.doc.nodesBetween(t,e,(a,i)=>{if(!a.isInline)return;r++;let c=null;if(o instanceof yi){let d=a.marks,p;for(;p=o.isInSet(d);)(c||(c=[])).push(p),d=p.removeFromSet(d)}else o?o.isInSet(a.marks)&&(c=[o]):c=a.marks;if(c&&c.length){let d=Math.min(i+a.nodeSize,e);for(let p=0;p<c.length;p++){let u=c[p],f;for(let h=0;h<s.length;h++){let m=s[h];m.step==r-1&&u.eq(s[h].style)&&(f=m)}f?(f.to=d,f.step=r):s.push({style:u,from:Math.max(i,t),to:d,step:r})}}}),s.forEach(a=>n.step(new qn(a.from,a.to,a.style)))}function rp(n,t,e,o=e.contentMatch,s=!0){let r=n.doc.nodeAt(t),a=[],i=t+1;for(let c=0;c<r.childCount;c++){let d=r.child(c),p=i+d.nodeSize,u=o.matchType(d.type);if(!u)a.push(new be(i,p,rt.empty));else{o=u;for(let f=0;f<d.marks.length;f++)e.allowsMarkType(d.marks[f].type)||n.step(new qn(i,p,d.marks[f]));if(s&&d.isText&&e.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(d.text);)m||(m=new rt(G.from(e.schema.text(" ",e.allowedMarks(d.marks))),0,0)),a.push(new be(i+f.index,i+f.index+f[0].length,m))}}i=p}if(!o.validEnd){let c=o.fillBefore(G.empty,!0);n.replace(i,i,new rt(c,0,0))}for(let c=a.length-1;c>=0;c--)n.step(a[c])}function v4(n,t,e){return(t==0||n.canReplace(t,n.childCount))&&(e==n.childCount||n.canReplace(0,e))}function fs(n){let e=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let o=n.depth,s=0,r=0;;--o){let a=n.$from.node(o),i=n.$from.index(o)+s,c=n.$to.indexAfter(o)-r;if(o<n.depth&&a.canReplace(i,c,e))return o;if(o==0||a.type.spec.isolating||!v4(a,i,c))break;i&&(s=1),c<a.childCount&&(r=1)}return null}function y4(n,t,e){let{$from:o,$to:s,depth:r}=t,a=o.before(r+1),i=s.after(r+1),c=a,d=i,p=G.empty,u=0;for(let m=r,g=!1;m>e;m--)g||o.index(m)>0?(g=!0,p=G.from(o.node(m).copy(p)),u++):c--;let f=G.empty,h=0;for(let m=r,g=!1;m>e;m--)g||s.after(m+1)<s.end(m)?(g=!0,f=G.from(s.node(m).copy(f)),h++):d++;n.step(new ke(c,d,a,i,new rt(p.append(f),u,h),p.size-u,!0))}function ap(n,t,e=null,o=n){let s=b4(n,t),r=s&&k4(o,t);return r?s.map(Fg).concat({type:t,attrs:e}).concat(r.map(Fg)):null}function Fg(n){return{type:n,attrs:null}}function b4(n,t){let{parent:e,startIndex:o,endIndex:s}=n,r=e.contentMatchAt(o).findWrapping(t);if(!r)return null;let a=r.length?r[0]:t;return e.canReplaceWith(o,s,a)?r:null}function k4(n,t){let{parent:e,startIndex:o,endIndex:s}=n,r=e.child(o),a=t.contentMatch.findWrapping(r.type);if(!a)return null;let c=(a.length?a[a.length-1]:t).contentMatch;for(let d=o;c&&d<s;d++)c=c.matchType(e.child(d).type);return!c||!c.validEnd?null:a}function x4(n,t,e){let o=G.empty;for(let a=e.length-1;a>=0;a--){if(o.size){let i=e[a].type.contentMatch.matchFragment(o);if(!i||!i.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=G.from(e[a].type.create(e[a].attrs,o))}let s=t.start,r=t.end;n.step(new ke(s,r,s,r,new rt(o,0,0),e.length,!0))}function w4(n,t,e,o,s){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let r=n.steps.length;n.doc.nodesBetween(t,e,(a,i)=>{let c=typeof s=="function"?s(a):s;if(a.isTextblock&&!a.hasMarkup(o,c)&&S4(n.doc,n.mapping.slice(r).map(i),o)){let d=null;if(o.schema.linebreakReplacement){let h=o.whitespace=="pre",m=!!o.contentMatch.matchType(o.schema.linebreakReplacement);h&&!m?d=!1:!h&&m&&(d=!0)}d===!1&&Hg(n,a,i,r),rp(n,n.mapping.slice(r).map(i,1),o,void 0,d===null);let p=n.mapping.slice(r),u=p.map(i,1),f=p.map(i+a.nodeSize,1);return n.step(new ke(u,f,u+1,f-1,new rt(G.from(o.create(c,null,a.marks)),0,0),1,!0)),d===!0&&jg(n,a,i,r),!1}})}function jg(n,t,e,o){t.forEach((s,r)=>{if(s.isText){let a,i=/\r?\n|\r/g;for(;a=i.exec(s.text);){let c=n.mapping.slice(o).map(e+1+r+a.index);n.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function Hg(n,t,e,o){t.forEach((s,r)=>{if(s.type==s.type.schema.linebreakReplacement){let a=n.mapping.slice(o).map(e+1+r);n.replaceWith(a,a+1,t.type.schema.text(`
481
+ `))}})}function S4(n,t,e){let o=n.resolve(t),s=o.index();return o.parent.canReplaceWith(s,s+1,e)}function E4(n,t,e,o,s){let r=n.doc.nodeAt(t);if(!r)throw new RangeError("No node at given position");e||(e=r.type);let a=e.create(o,null,s||r.marks);if(r.isLeaf)return n.replaceWith(t,t+r.nodeSize,a);if(!e.validContent(r.content))throw new RangeError("Invalid content for node type "+e.name);n.step(new ke(t,t+r.nodeSize,t+1,t+r.nodeSize-1,new rt(G.from(a),0,0),1,!0))}function ko(n,t,e=1,o){let s=n.resolve(t),r=s.depth-e,a=o&&o[o.length-1]||s.parent;if(r<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!a.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let d=s.depth-1,p=e-2;d>r;d--,p--){let u=s.node(d),f=s.index(d);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(f,u.childCount),m=o&&o[p+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=o&&o[p]||u;if(!u.canReplace(f+1,u.childCount)||!g.type.validContent(h))return!1}let i=s.indexAfter(r),c=o&&o[0];return s.node(r).canReplaceWith(i,i,c?c.type:s.node(r+1).type)}function C4(n,t,e=1,o){let s=n.doc.resolve(t),r=G.empty,a=G.empty;for(let i=s.depth,c=s.depth-e,d=e-1;i>c;i--,d--){r=G.from(s.node(i).copy(r));let p=o&&o[d];a=G.from(p?p.type.create(p.attrs,a):s.node(i).copy(a))}n.step(new be(t,t,new rt(r.append(a),e,e),!0))}function qo(n,t){let e=n.resolve(t),o=e.index();return Ug(e.nodeBefore,e.nodeAfter)&&e.parent.canReplace(o,o+1)}function T4(n,t){t.content.size||n.type.compatibleContent(t.type);let e=n.contentMatchAt(n.childCount),{linebreakReplacement:o}=n.type.schema;for(let s=0;s<t.childCount;s++){let r=t.child(s),a=r.type==o?n.type.schema.nodes.text:r.type;if(e=e.matchType(a),!e||!n.type.allowsMarks(r.marks))return!1}return e.validEnd}function Ug(n,t){return!!(n&&t&&!n.isLeaf&&T4(n,t))}function wi(n,t,e=-1){let o=n.resolve(t);for(let s=o.depth;;s--){let r,a,i=o.index(s);if(s==o.depth?(r=o.nodeBefore,a=o.nodeAfter):e>0?(r=o.node(s+1),i++,a=o.node(s).maybeChild(i)):(r=o.node(s).maybeChild(i-1),a=o.node(s+1)),r&&!r.isTextblock&&Ug(r,a)&&o.node(s).canReplace(i,i+1))return t;if(s==0)break;t=e<0?o.before(s):o.after(s)}}function N4(n,t,e){let o=null,{linebreakReplacement:s}=n.doc.type.schema,r=n.doc.resolve(t-e),a=r.node().type;if(s&&a.inlineContent){let p=a.whitespace=="pre",u=!!a.contentMatch.matchType(s);p&&!u?o=!1:!p&&u&&(o=!0)}let i=n.steps.length;if(o===!1){let p=n.doc.resolve(t+e);Hg(n,p.node(),p.before(),i)}a.inlineContent&&rp(n,t+e-1,a,r.node().contentMatchAt(r.index()),o==null);let c=n.mapping.slice(i),d=c.map(t-e);if(n.step(new be(d,c.map(t+e,-1),rt.empty,!0)),o===!0){let p=n.doc.resolve(d);jg(n,p.node(),p.before(),n.steps.length)}return n}function M4(n,t,e){let o=n.resolve(t);if(o.parent.canReplaceWith(o.index(),o.index(),e))return t;if(o.parentOffset==0)for(let s=o.depth-1;s>=0;s--){let r=o.index(s);if(o.node(s).canReplaceWith(r,r,e))return o.before(s+1);if(r>0)return null}if(o.parentOffset==o.parent.content.size)for(let s=o.depth-1;s>=0;s--){let r=o.indexAfter(s);if(o.node(s).canReplaceWith(r,r,e))return o.after(s+1);if(r<o.node(s).childCount)return null}return null}function Wg(n,t,e){let o=n.resolve(t);if(!e.content.size)return t;let s=e.content;for(let r=0;r<e.openStart;r++)s=s.firstChild.content;for(let r=1;r<=(e.openStart==0&&e.size?2:1);r++)for(let a=o.depth;a>=0;a--){let i=a==o.depth?0:o.pos<=(o.start(a+1)+o.end(a+1))/2?-1:1,c=o.index(a)+(i>0?1:0),d=o.node(a),p=!1;if(r==1)p=d.canReplace(c,c,s);else{let u=d.contentMatchAt(c).findWrapping(s.firstChild.type);p=u&&d.canReplaceWith(c,c,u[0])}if(p)return i==0?o.pos:i<0?o.before(a+1):o.after(a+1)}return null}function Si(n,t,e=t,o=rt.empty){if(t==e&&!o.size)return null;let s=n.resolve(t),r=n.resolve(e);return Kg(s,r,o)?new be(t,e,o):new B4(s,r,o).fit()}function Kg(n,t,e){return!e.openStart&&!e.openEnd&&n.start()==t.start()&&n.parent.canReplace(n.index(),t.index(),e.content)}class B4{constructor(t,e,o){this.$from=t,this.$to=e,this.unplaced=o,this.frontier=[],this.placed=G.empty;for(let s=0;s<=t.depth;s++){let r=t.node(s);this.frontier.push({type:r.type,match:r.contentMatchAt(t.indexAfter(s))})}for(let s=t.depth;s>0;s--)this.placed=G.from(t.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,o=this.$from,s=this.close(t<0?this.$to:o.doc.resolve(t));if(!s)return null;let r=this.placed,a=o.depth,i=s.depth;for(;a&&i&&r.childCount==1;)r=r.firstChild.content,a--,i--;let c=new rt(r,a,i);return t>-1?new ke(o.pos,t,this.$to.pos,this.$to.end(),c,e):c.size||o.pos!=this.$to.pos?new be(o.pos,s.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,o=0,s=this.unplaced.openEnd;o<t;o++){let r=e.firstChild;if(e.childCount>1&&(s=0),r.type.spec.isolating&&s<=o){t=o;break}e=r.content}for(let e=1;e<=2;e++)for(let o=e==1?t:this.unplaced.openStart;o>=0;o--){let s,r=null;o?(r=ip(this.unplaced.content,o-1).firstChild,s=r.content):s=this.unplaced.content;let a=s.firstChild;for(let i=this.depth;i>=0;i--){let{type:c,match:d}=this.frontier[i],p,u=null;if(e==1&&(a?d.matchType(a.type)||(u=d.fillBefore(G.from(a),!1)):r&&c.compatibleContent(r.type)))return{sliceDepth:o,frontierDepth:i,parent:r,inject:u};if(e==2&&a&&(p=d.findWrapping(a.type)))return{sliceDepth:o,frontierDepth:i,parent:r,wrap:p};if(r&&d.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:o}=this.unplaced,s=ip(t,e);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new rt(t,e+1,Math.max(o,s.size+e>=t.size-o?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:o}=this.unplaced,s=ip(t,e);if(s.childCount<=1&&e>0){let r=t.size-e<=e+s.size;this.unplaced=new rt(Er(t,e-1,1),e-1,r?e-1:o)}else this.unplaced=new rt(Er(t,e,1),e,o)}placeNodes({sliceDepth:t,frontierDepth:e,parent:o,inject:s,wrap:r}){for(;this.depth>e;)this.closeFrontierNode();if(r)for(let g=0;g<r.length;g++)this.openFrontierNode(r[g]);let a=this.unplaced,i=o?o.content:a.content,c=a.openStart-t,d=0,p=[],{match:u,type:f}=this.frontier[e];if(s){for(let g=0;g<s.childCount;g++)p.push(s.child(g));u=u.matchFragment(s)}let h=i.size+t-(a.content.size-a.openEnd);for(;d<i.childCount;){let g=i.child(d),v=u.matchType(g.type);if(!v)break;d++,(d>1||c==0||g.content.size)&&(u=v,p.push(_g(g.mark(f.allowedMarks(g.marks)),d==1?c:0,d==i.childCount?h:-1)))}let m=d==i.childCount;m||(h=-1),this.placed=Cr(this.placed,e,G.from(p)),this.frontier[e].match=u,m&&h<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=i;g<h;g++){let y=v.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),v=y.content}this.unplaced=m?t==0?rt.empty:new rt(Er(a.content,t-1,1),t-1,h<0?a.openEnd:t-1):new rt(Er(a.content,t,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!cp(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:o}=this.$to,s=this.$to.after(o);for(;o>1&&s==this.$to.end(--o);)++s;return s}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:o,type:s}=this.frontier[e],r=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),a=cp(t,e,s,o,r);if(a){for(let i=e-1;i>=0;i--){let{match:c,type:d}=this.frontier[i],p=cp(t,i,d,c,!0);if(!p||p.childCount)continue t}return{depth:e,fit:a,move:r?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Cr(this.placed,e.depth,e.fit)),t=e.move;for(let o=e.depth+1;o<=t.depth;o++){let s=t.node(o),r=s.type.contentMatch.fillBefore(s.content,!0,t.index(o));this.openFrontierNode(s.type,s.attrs,r)}return t}openFrontierNode(t,e=null,o){let s=this.frontier[this.depth];s.match=s.match.matchType(t),this.placed=Cr(this.placed,this.depth,G.from(t.create(e,o))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(G.empty,!0);e.childCount&&(this.placed=Cr(this.placed,this.frontier.length,e))}}function Er(n,t,e){return t==0?n.cutByIndex(e,n.childCount):n.replaceChild(0,n.firstChild.copy(Er(n.firstChild.content,t-1,e)))}function Cr(n,t,e){return t==0?n.append(e):n.replaceChild(n.childCount-1,n.lastChild.copy(Cr(n.lastChild.content,t-1,e)))}function ip(n,t){for(let e=0;e<t;e++)n=n.firstChild.content;return n}function _g(n,t,e){if(t<=0)return n;let o=n.content;return t>1&&(o=o.replaceChild(0,_g(o.firstChild,t-1,o.childCount==1?e-1:0))),t>0&&(o=n.type.contentMatch.fillBefore(o).append(o),e<=0&&(o=o.append(n.type.contentMatch.matchFragment(o).fillBefore(G.empty,!0)))),n.copy(o)}function cp(n,t,e,o,s){let r=n.node(t),a=s?n.indexAfter(t):n.index(t);if(a==r.childCount&&!e.compatibleContent(r.type))return null;let i=o.fillBefore(r.content,!0,a);return i&&!O4(e,r.content,a)?i:null}function O4(n,t,e){for(let o=e;o<t.childCount;o++)if(!n.allowsMarks(t.child(o).marks))return!0;return!1}function D4(n){return n.spec.defining||n.spec.definingForContent}function V4(n,t,e,o){if(!o.size)return n.deleteRange(t,e);let s=n.doc.resolve(t),r=n.doc.resolve(e);if(Kg(s,r,o))return n.step(new be(t,e,o));let a=Jg(s,r);a[a.length-1]==0&&a.pop();let i=-(s.depth+1);a.unshift(i);for(let f=s.depth,h=s.pos-1;f>0;f--,h--){let m=s.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(f)>-1?i=f:s.before(f)==h&&a.splice(1,0,-f)}let c=a.indexOf(i),d=[],p=o.openStart;for(let f=o.content,h=0;;h++){let m=f.firstChild;if(d.push(m),h==o.openStart)break;f=m.content}for(let f=p-1;f>=0;f--){let h=d[f],m=D4(h.type);if(m&&!h.sameMarkup(s.node(Math.abs(i)-1)))p=f;else if(m||!h.type.isTextblock)break}for(let f=o.openStart;f>=0;f--){let h=(f+p+1)%(o.openStart+1),m=d[h];if(m)for(let g=0;g<a.length;g++){let v=a[(g+c)%a.length],y=!0;v<0&&(y=!1,v=-v);let k=s.node(v-1),S=s.index(v-1);if(k.canReplaceWith(S,S,m.type,m.marks))return n.replace(s.before(v),y?r.after(v):e,new rt(Gg(o.content,0,o.openStart,h),h,o.openEnd))}}let u=n.steps.length;for(let f=a.length-1;f>=0&&(n.replace(t,e,o),!(n.steps.length>u));f--){let h=a[f];h<0||(t=s.before(h),e=r.after(h))}}function Gg(n,t,e,o,s){if(t<e){let r=n.firstChild;n=n.replaceChild(0,r.copy(Gg(r.content,t+1,e,o,r)))}if(t>o){let r=s.contentMatchAt(0),a=r.fillBefore(n).append(n);n=a.append(r.matchFragment(a).fillBefore(G.empty,!0))}return n}function A4(n,t,e,o){if(!o.isInline&&t==e&&n.doc.resolve(t).parent.content.size){let s=M4(n.doc,t,o.type);s!=null&&(t=e=s)}n.replaceRange(t,e,new rt(G.from(o),0,0))}function I4(n,t,e){let o=n.doc.resolve(t),s=n.doc.resolve(e),r=Jg(o,s);for(let a=0;a<r.length;a++){let i=r[a],c=a==r.length-1;if(c&&i==0||o.node(i).type.contentMatch.validEnd)return n.delete(o.start(i),s.end(i));if(i>0&&(c||o.node(i-1).canReplace(o.index(i-1),s.indexAfter(i-1))))return n.delete(o.before(i),s.after(i))}for(let a=1;a<=o.depth&&a<=s.depth;a++)if(t-o.start(a)==o.depth-a&&e>o.end(a)&&s.end(a)-e!=s.depth-a&&o.start(a-1)==s.start(a-1)&&o.node(a-1).canReplace(o.index(a-1),s.index(a-1)))return n.delete(o.before(a),e);n.delete(t,e)}function Jg(n,t){let e=[],o=Math.min(n.depth,t.depth);for(let s=o;s>=0;s--){let r=n.start(s);if(r<n.pos-(n.depth-s)||t.end(s)>t.pos+(t.depth-s)||n.node(s).type.spec.isolating||t.node(s).type.spec.isolating)break;(r==t.start(s)||s==n.depth&&s==t.depth&&n.parent.inlineContent&&t.parent.inlineContent&&s&&t.start(s-1)==r-1)&&e.push(s)}return e}class hs extends ze{constructor(t,e,o){super(),this.pos=t,this.attr=e,this.value=o}apply(t){let e=t.nodeAt(this.pos);if(!e)return ce.fail("No node at attribute step's position");let o=Object.create(null);for(let r in e.attrs)o[r]=e.attrs[r];o[this.attr]=this.value;let s=e.type.create(o,null,e.marks);return ce.fromReplace(t,this.pos,this.pos+1,new rt(G.from(s),0,e.isLeaf?0:1))}getMap(){return dn.empty}invert(t){return new hs(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new hs(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.pos!="number"||typeof e.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new hs(e.pos,e.attr,e.value)}}ze.jsonID("attr",hs);class Tr extends ze{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let s in t.attrs)e[s]=t.attrs[s];e[this.attr]=this.value;let o=t.type.create(e,t.content,t.marks);return ce.ok(o)}getMap(){return dn.empty}invert(t){return new Tr(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Tr(e.attr,e.value)}}ze.jsonID("docAttr",Tr);let ms=class extends Error{};ms=function n(t){let e=Error.call(this,t);return e.__proto__=n.prototype,e},ms.prototype=Object.create(Error.prototype),ms.prototype.constructor=ms,ms.prototype.name="TransformError";class Yg{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Sr}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new ms(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,e=-1e9;for(let o=0;o<this.mapping.maps.length;o++){let s=this.mapping.maps[o];o&&(t=s.map(t,1),e=s.map(e,-1)),s.forEach((r,a,i,c)=>{t=Math.min(t,i),e=Math.max(e,c)})}return t==1e9?null:{from:t,to:e}}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,o=rt.empty){let s=Si(this.doc,t,e,o);return s&&this.step(s),this}replaceWith(t,e,o){return this.replace(t,e,new rt(G.from(o),0,0))}delete(t,e){return this.replace(t,e,rt.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,o){return V4(this,t,e,o),this}replaceRangeWith(t,e,o){return A4(this,t,e,o),this}deleteRange(t,e){return I4(this,t,e),this}lift(t,e){return y4(this,t,e),this}join(t,e=1){return N4(this,t,e),this}wrap(t,e){return x4(this,t,e),this}setBlockType(t,e=t,o,s=null){return w4(this,t,e,o,s),this}setNodeMarkup(t,e,o=null,s){return E4(this,t,e,o,s),this}setNodeAttribute(t,e,o){return this.step(new hs(t,e,o)),this}setDocAttribute(t,e){return this.step(new Tr(t,e)),this}addNodeMark(t,e){return this.step(new Qo(t,e)),this}removeNodeMark(t,e){let o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at position "+t);if(e instanceof Gt)e.isInSet(o.marks)&&this.step(new Dl(t,e));else{let s=o.marks,r,a=[];for(;r=e.isInSet(s);)a.push(new Dl(t,r)),s=r.removeFromSet(s);for(let i=a.length-1;i>=0;i--)this.step(a[i])}return this}split(t,e=1,o){return C4(this,t,e,o),this}addMark(t,e,o){return m4(this,t,e,o),this}removeMark(t,e,o){return g4(this,t,e,o),this}clearIncompatible(t,e,o){return rp(this,t,e,o),this}}const dp=Object.create(null);class Rt{constructor(t,e,o){this.$anchor=t,this.$head=e,this.ranges=o||[new R4(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=rt.empty){let o=e.content.lastChild,s=null;for(let i=0;i<e.openEnd;i++)s=o,o=o.lastChild;let r=t.steps.length,a=this.ranges;for(let i=0;i<a.length;i++){let{$from:c,$to:d}=a[i],p=t.mapping.slice(r);t.replaceRange(p.map(c.pos),p.map(d.pos),i?rt.empty:e),i==0&&Qg(t,r,(o?o.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(t,e){let o=t.steps.length,s=this.ranges;for(let r=0;r<s.length;r++){let{$from:a,$to:i}=s[r],c=t.mapping.slice(o),d=c.map(a.pos),p=c.map(i.pos);r?t.deleteRange(d,p):(t.replaceRangeWith(d,p,e),Qg(t,o,e.isInline?-1:1))}}static findFrom(t,e,o=!1){let s=t.parent.inlineContent?new Et(t):gs(t.node(0),t.parent,t.pos,t.index(),e,o);if(s)return s;for(let r=t.depth-1;r>=0;r--){let a=e<0?gs(t.node(0),t.node(r),t.before(r+1),t.index(r),e,o):gs(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,o);if(a)return a}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new pn(t.node(0))}static atStart(t){return gs(t,t,0,0,1)||new pn(t)}static atEnd(t){return gs(t,t,t.content.size,t.childCount,-1)||new pn(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let o=dp[e.type];if(!o)throw new RangeError(`No selection type ${e.type} defined`);return o.fromJSON(t,e)}static jsonID(t,e){if(t in dp)throw new RangeError("Duplicate use of selection JSON ID "+t);return dp[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Et.between(this.$anchor,this.$head).getBookmark()}}Rt.prototype.visible=!0;class R4{constructor(t,e){this.$from=t,this.$to=e}}let Xg=!1;function Zg(n){!Xg&&!n.parent.inlineContent&&(Xg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Et extends Rt{constructor(t,e=t){Zg(t),Zg(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let o=t.resolve(e.map(this.head));if(!o.parent.inlineContent)return Rt.near(o);let s=t.resolve(e.map(this.anchor));return new Et(s.parent.inlineContent?s:o,o)}replace(t,e=rt.empty){if(super.replace(t,e),e==rt.empty){let o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}}eq(t){return t instanceof Et&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ei(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if(typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Et(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,o=e){let s=t.resolve(e);return new this(s,o==e?s:t.resolve(o))}static between(t,e,o){let s=t.pos-e.pos;if((!o||s)&&(o=s>=0?1:-1),!e.parent.inlineContent){let r=Rt.findFrom(e,o,!0)||Rt.findFrom(e,-o,!0);if(r)e=r.$head;else return Rt.near(e,o)}return t.parent.inlineContent||(s==0?t=e:(t=(Rt.findFrom(t,-o,!0)||Rt.findFrom(t,o,!0)).$anchor,t.pos<e.pos!=s<0&&(t=e))),new Et(t,e)}}Rt.jsonID("text",Et);class Ei{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Ei(t.map(this.anchor),t.map(this.head))}resolve(t){return Et.between(t.resolve(this.anchor),t.resolve(this.head))}}class vt extends Rt{constructor(t){let e=t.nodeAfter,o=t.node(0).resolve(t.pos+e.nodeSize);super(t,o),this.node=e}map(t,e){let{deleted:o,pos:s}=e.mapResult(this.anchor),r=t.resolve(s);return o?Rt.near(r):new vt(r)}content(){return new rt(G.from(this.node),0,0)}eq(t){return t instanceof vt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new pp(this.anchor)}static fromJSON(t,e){if(typeof e.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new vt(t.resolve(e.anchor))}static create(t,e){return new vt(t.resolve(e))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}vt.prototype.visible=!1,Rt.jsonID("node",vt);class pp{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:o}=t.mapResult(this.anchor);return e?new Ei(o,o):new pp(o)}resolve(t){let e=t.resolve(this.anchor),o=e.nodeAfter;return o&&vt.isSelectable(o)?new vt(e):Rt.near(e)}}class pn extends Rt{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=rt.empty){if(e==rt.empty){t.delete(0,t.doc.content.size);let o=Rt.atStart(t.doc);o.eq(t.selection)||t.setSelection(o)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new pn(t)}map(t){return new pn(t)}eq(t){return t instanceof pn}getBookmark(){return z4}}Rt.jsonID("all",pn);const z4={map(){return this},resolve(n){return new pn(n)}};function gs(n,t,e,o,s,r=!1){if(t.inlineContent)return Et.create(n,e);for(let a=o-(s>0?0:1);s>0?a<t.childCount:a>=0;a+=s){let i=t.child(a);if(i.isAtom){if(!r&&vt.isSelectable(i))return vt.create(n,e-(s<0?i.nodeSize:0))}else{let c=gs(n,i,e+s,s<0?i.childCount:0,s,r);if(c)return c}e+=i.nodeSize*s}return null}function Qg(n,t,e){let o=n.steps.length-1;if(o<t)return;let s=n.steps[o];if(!(s instanceof be||s instanceof ke))return;let r=n.mapping.maps[o],a;r.forEach((i,c,d,p)=>{a==null&&(a=p)}),n.setSelection(Rt.near(n.doc.resolve(a),e))}const qg=1,Ci=2,$g=4;class P4 extends Yg{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|qg)&~Ci,this.storedMarks=null,this}get selectionSet(){return(this.updated&qg)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Ci,this}ensureMarks(t){return Gt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ci)>0}addStep(t,e){super.addStep(t,e),this.updated=this.updated&~Ci,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let o=this.selection;return e&&(t=t.mark(this.storedMarks||(o.empty?o.$from.marks():o.$from.marksAcross(o.$to)||Gt.none))),o.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,o){let s=this.doc.type.schema;if(e==null)return t?this.replaceSelectionWith(s.text(t),!0):this.deleteSelection();{if(o==null&&(o=e),!t)return this.deleteRange(e,o);let r=this.storedMarks;if(!r){let a=this.doc.resolve(e);r=o==e?a.marks():a.marksAcross(this.doc.resolve(o))}return this.replaceRangeWith(e,o,s.text(t,r)),!this.selection.empty&&this.selection.to==e+t.length&&this.setSelection(Rt.near(this.selection.$to)),this}}setMeta(t,e){return this.meta[typeof t=="string"?t:t.key]=e,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=$g,this}get scrolledIntoView(){return(this.updated&$g)>0}}function tv(n,t){return!t||!n?n:n.bind(t)}class Nr{constructor(t,e,o){this.name=t,this.init=tv(e.init,o),this.apply=tv(e.apply,o)}}const L4=[new Nr("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Nr("selection",{init(n,t){return n.selection||Rt.atStart(t.doc)},apply(n){return n.selection}}),new Nr("storedMarks",{init(n){return n.storedMarks||null},apply(n,t,e,o){return o.selection.$cursor?n.storedMarks:null}}),new Nr("scrollToSelection",{init(){return 0},apply(n,t){return n.scrolledIntoView?t+1:t}})];class up{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=L4.slice(),e&&e.forEach(o=>{if(this.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");this.plugins.push(o),this.pluginsByKey[o.key]=o,o.spec.state&&this.fields.push(new Nr(o.key,o.spec.state,o))})}}class vs{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let o=0;o<this.config.plugins.length;o++)if(o!=e){let s=this.config.plugins[o];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],o=this.applyInner(t),s=null;for(;;){let r=!1;for(let a=0;a<this.config.plugins.length;a++){let i=this.config.plugins[a];if(i.spec.appendTransaction){let c=s?s[a].n:0,d=s?s[a].state:this,p=c<e.length&&i.spec.appendTransaction.call(i,c?e.slice(c):e,d,o);if(p&&o.filterTransaction(p,a)){if(p.setMeta("appendedTransaction",t),!s){s=[];for(let u=0;u<this.config.plugins.length;u++)s.push(u<a?{state:o,n:e.length}:{state:this,n:0})}e.push(p),o=o.applyInner(p),r=!0}s&&(s[a]={state:o,n:e.length})}}if(!r)return{state:o,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new vs(this.config),o=this.config.fields;for(let s=0;s<o.length;s++){let r=o[s];e[r.name]=r.apply(t,this[r.name],this,e)}return e}get tr(){return new P4(this)}static create(t){let e=new up(t.doc?t.doc.type.schema:t.schema,t.plugins),o=new vs(e);for(let s=0;s<e.fields.length;s++)o[e.fields[s].name]=e.fields[s].init(t,o);return o}reconfigure(t){let e=new up(this.schema,t.plugins),o=e.fields,s=new vs(e);for(let r=0;r<o.length;r++){let a=o[r].name;s[a]=this.hasOwnProperty(a)?this[a]:o[r].init(t,s)}return s}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(o=>o.toJSON())),t&&typeof t=="object")for(let o in t){if(o=="doc"||o=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=t[o],r=s.spec.state;r&&r.toJSON&&(e[o]=r.toJSON.call(s,this[s.key]))}return e}static fromJSON(t,e,o){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let s=new up(t.schema,t.plugins),r=new vs(s);return s.fields.forEach(a=>{if(a.name=="doc")r.doc=Qn.fromJSON(t.schema,e.doc);else if(a.name=="selection")r.selection=Rt.fromJSON(r.doc,e.selection);else if(a.name=="storedMarks")e.storedMarks&&(r.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(o)for(let i in o){let c=o[i],d=c.spec.state;if(c.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(e,i)){r[a.name]=d.fromJSON.call(c,t,e[i],r);return}}r[a.name]=a.init(t,r)}}),r}}function ev(n,t,e){for(let o in n){let s=n[o];s instanceof Function?s=s.bind(t):o=="handleDOMEvents"&&(s=ev(s,t,{})),e[o]=s}return e}class he{constructor(t){this.spec=t,this.props={},t.props&&ev(t.props,this,this.props),this.key=t.key?t.key.key:nv("plugin")}getState(t){return t[this.key]}}const fp=Object.create(null);function nv(n){return n in fp?n+"$"+ ++fp[n]:(fp[n]=0,n+"$")}class He{constructor(t="key"){this.key=nv(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Oe=function(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t},ys=function(n){let t=n.assignedSlot||n.parentNode;return t&&t.nodeType==11?t.host:t};let hp=null;const xo=function(n,t,e){let o=hp||(hp=document.createRange());return o.setEnd(n,e??n.nodeValue.length),o.setStart(n,t||0),o},F4=function(){hp=null},Vl=function(n,t,e,o){return e&&(ov(n,t,e,o,-1)||ov(n,t,e,o,1))},j4=/^(img|br|input|textarea|hr)$/i;function ov(n,t,e,o,s){for(var r;;){if(n==e&&t==o)return!0;if(t==(s<0?0:xn(n))){let a=n.parentNode;if(!a||a.nodeType!=1||Mr(n)||j4.test(n.nodeName)||n.contentEditable=="false")return!1;t=Oe(n)+(s<0?0:1),n=a}else if(n.nodeType==1){let a=n.childNodes[t+(s<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((r=a.pmViewDesc)===null||r===void 0)&&r.ignoreForSelection)t+=s;else return!1;else n=a,t=s<0?xn(n):0}else return!1}}function xn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function H4(n,t){for(;;){if(n.nodeType==3&&t)return n;if(n.nodeType==1&&t>0){if(n.contentEditable=="false")return null;n=n.childNodes[t-1],t=xn(n)}else if(n.parentNode&&!Mr(n))t=Oe(n),n=n.parentNode;else return null}}function U4(n,t){for(;;){if(n.nodeType==3&&t<n.nodeValue.length)return n;if(n.nodeType==1&&t<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[t],t=0}else if(n.parentNode&&!Mr(n))t=Oe(n)+1,n=n.parentNode;else return null}}function W4(n,t,e){for(let o=t==0,s=t==xn(n);o||s;){if(n==e)return!0;let r=Oe(n);if(n=n.parentNode,!n)return!1;o=o&&r==0,s=s&&r==xn(n)}}function Mr(n){let t;for(let e=n;e&&!(t=e.pmViewDesc);e=e.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==n||t.contentDOM==n)}const Ti=function(n){return n.focusNode&&Vl(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Al(n,t){let e=document.createEvent("Event");return e.initEvent("keydown",!0,!0),e.keyCode=n,e.key=e.code=t,e}function K4(n){let t=n.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function _4(n,t,e){if(n.caretPositionFromPoint)try{let o=n.caretPositionFromPoint(t,e);if(o)return{node:o.offsetNode,offset:Math.min(xn(o.offsetNode),o.offset)}}catch{}if(n.caretRangeFromPoint){let o=n.caretRangeFromPoint(t,e);if(o)return{node:o.startContainer,offset:Math.min(xn(o.startContainer),o.startOffset)}}}const $n=typeof navigator<"u"?navigator:null,lv=typeof document<"u"?document:null,$o=$n&&$n.userAgent||"",mp=/Edge\/(\d+)/.exec($o),sv=/MSIE \d/.exec($o),gp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($o),Qe=!!(sv||gp||mp),tl=sv?document.documentMode:gp?+gp[1]:mp?+mp[1]:0,wn=!Qe&&/gecko\/(\d+)/i.test($o);wn&&+(/Firefox\/(\d+)/.exec($o)||[0,0])[1];const vp=!Qe&&/Chrome\/(\d+)/.exec($o),De=!!vp,rv=vp?+vp[1]:0,Pe=!Qe&&!!$n&&/Apple Computer/.test($n.vendor),bs=Pe&&(/Mobile\/\w+/.test($o)||!!$n&&$n.maxTouchPoints>2),Sn=bs||($n?/Mac/.test($n.platform):!1),av=$n?/Win/.test($n.platform):!1,wo=/Android \d/.test($o),Br=!!lv&&"webkitFontSmoothing"in lv.documentElement.style,G4=Br?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function J4(n){let t=n.defaultView&&n.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function So(n,t){return typeof n=="number"?n:n[t]}function Y4(n){let t=n.getBoundingClientRect(),e=t.width/n.offsetWidth||1,o=t.height/n.offsetHeight||1;return{left:t.left,right:t.left+n.clientWidth*e,top:t.top,bottom:t.top+n.clientHeight*o}}function iv(n,t,e){let o=n.someProp("scrollThreshold")||0,s=n.someProp("scrollMargin")||5,r=n.dom.ownerDocument;for(let a=e||n.dom;a;){if(a.nodeType!=1){a=ys(a);continue}let i=a,c=i==r.body,d=c?J4(r):Y4(i),p=0,u=0;if(t.top<d.top+So(o,"top")?u=-(d.top-t.top+So(s,"top")):t.bottom>d.bottom-So(o,"bottom")&&(u=t.bottom-t.top>d.bottom-d.top?t.top+So(s,"top")-d.top:t.bottom-d.bottom+So(s,"bottom")),t.left<d.left+So(o,"left")?p=-(d.left-t.left+So(s,"left")):t.right>d.right-So(o,"right")&&(p=t.right-d.right+So(s,"right")),p||u)if(c)r.defaultView.scrollBy(p,u);else{let h=i.scrollLeft,m=i.scrollTop;u&&(i.scrollTop+=u),p&&(i.scrollLeft+=p);let g=i.scrollLeft-h,v=i.scrollTop-m;t={left:t.left-g,top:t.top-v,right:t.right-g,bottom:t.bottom-v}}let f=c?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(f))break;a=f=="absolute"?a.offsetParent:ys(a)}}function X4(n){let t=n.dom.getBoundingClientRect(),e=Math.max(0,t.top),o,s;for(let r=(t.left+t.right)/2,a=e+1;a<Math.min(innerHeight,t.bottom);a+=5){let i=n.root.elementFromPoint(r,a);if(!i||i==n.dom||!n.dom.contains(i))continue;let c=i.getBoundingClientRect();if(c.top>=e-20){o=i,s=c.top;break}}return{refDOM:o,refTop:s,stack:cv(n.dom)}}function cv(n){let t=[],e=n.ownerDocument;for(let o=n;o&&(t.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),n!=e);o=ys(o));return t}function Z4({refDOM:n,refTop:t,stack:e}){let o=n?n.getBoundingClientRect().top:0;dv(e,o==0?0:o-t)}function dv(n,t){for(let e=0;e<n.length;e++){let{dom:o,top:s,left:r}=n[e];o.scrollTop!=s+t&&(o.scrollTop=s+t),o.scrollLeft!=r&&(o.scrollLeft=r)}}let ks=null;function Q4(n){if(n.setActive)return n.setActive();if(ks)return n.focus(ks);let t=cv(n);n.focus(ks==null?{get preventScroll(){return ks={preventScroll:!0},!0}}:void 0),ks||(ks=!1,dv(t,0))}function pv(n,t){let e,o=2e8,s,r=0,a=t.top,i=t.top,c,d;for(let p=n.firstChild,u=0;p;p=p.nextSibling,u++){let f;if(p.nodeType==1)f=p.getClientRects();else if(p.nodeType==3)f=xo(p).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=a&&m.bottom>=i){a=Math.max(m.bottom,a),i=Math.min(m.top,i);let g=m.left>t.left?m.left-t.left:m.right<t.left?t.left-m.right:0;if(g<o){e=p,o=g,s=g&&e.nodeType==3?{left:m.right<t.left?m.right:m.left,top:t.top}:t,p.nodeType==1&&g&&(r=u+(t.left>=(m.left+m.right)/2?1:0));continue}}else m.top>t.top&&!c&&m.left<=t.left&&m.right>=t.left&&(c=p,d={left:Math.max(m.left,Math.min(m.right,t.left)),top:m.top});!e&&(t.left>=m.right&&t.top>=m.top||t.left>=m.left&&t.top>=m.bottom)&&(r=u+1)}}return!e&&c&&(e=c,s=d,o=0),e&&e.nodeType==3?q4(e,s):!e||o&&e.nodeType==1?{node:n,offset:r}:pv(e,s)}function q4(n,t){let e=n.nodeValue.length,o=document.createRange(),s;for(let r=0;r<e;r++){o.setEnd(n,r+1),o.setStart(n,r);let a=el(o,1);if(a.top!=a.bottom&&yp(t,a)){s={node:n,offset:r+(t.left>=(a.left+a.right)/2?1:0)};break}}return o.detach(),s||{node:n,offset:0}}function yp(n,t){return n.left>=t.left-1&&n.left<=t.right+1&&n.top>=t.top-1&&n.top<=t.bottom+1}function $4(n,t){let e=n.parentNode;return e&&/^li$/i.test(e.nodeName)&&t.left<n.getBoundingClientRect().left?e:n}function tD(n,t,e){let{node:o,offset:s}=pv(t,e),r=-1;if(o.nodeType==1&&!o.firstChild){let a=o.getBoundingClientRect();r=a.left!=a.right&&e.left>(a.left+a.right)/2?1:-1}return n.docView.posFromDOM(o,s,r)}function eD(n,t,e,o){let s=-1;for(let r=t,a=!1;r!=n.dom;){let i=n.docView.nearestDesc(r,!0),c;if(!i)return null;if(i.dom.nodeType==1&&(i.node.isBlock&&i.parent||!i.contentDOM)&&((c=i.dom.getBoundingClientRect()).width||c.height)&&(i.node.isBlock&&i.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(i.dom.nodeName)&&(!a&&c.left>o.left||c.top>o.top?s=i.posBefore:(!a&&c.right<o.left||c.bottom<o.top)&&(s=i.posAfter),a=!0),!i.contentDOM&&s<0&&!i.node.isText))return(i.node.isBlock?o.top<(c.top+c.bottom)/2:o.left<(c.left+c.right)/2)?i.posBefore:i.posAfter;r=i.dom.parentNode}return s>-1?s:n.docView.posFromDOM(t,e,-1)}function uv(n,t,e){let o=n.childNodes.length;if(o&&e.top<e.bottom)for(let s=Math.max(0,Math.min(o-1,Math.floor(o*(t.top-e.top)/(e.bottom-e.top))-2)),r=s;;){let a=n.childNodes[r];if(a.nodeType==1){let i=a.getClientRects();for(let c=0;c<i.length;c++){let d=i[c];if(yp(t,d))return uv(a,t,d)}}if((r=(r+1)%o)==s)break}return n}function nD(n,t){let e=n.dom.ownerDocument,o,s=0,r=_4(e,t.left,t.top);r&&({node:o,offset:s}=r);let a=(n.root.elementFromPoint?n.root:e).elementFromPoint(t.left,t.top),i;if(!a||!n.dom.contains(a.nodeType!=1?a.parentNode:a)){let d=n.dom.getBoundingClientRect();if(!yp(t,d)||(a=uv(n.dom,t,d),!a))return null}if(Pe)for(let d=a;o&&d;d=ys(d))d.draggable&&(o=void 0);if(a=$4(a,t),o){if(wn&&o.nodeType==1&&(s=Math.min(s,o.childNodes.length),s<o.childNodes.length)){let p=o.childNodes[s],u;p.nodeName=="IMG"&&(u=p.getBoundingClientRect()).right<=t.left&&u.bottom>t.top&&s++}let d;Br&&s&&o.nodeType==1&&(d=o.childNodes[s-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=t.top&&s--,o==n.dom&&s==o.childNodes.length-1&&o.lastChild.nodeType==1&&t.top>o.lastChild.getBoundingClientRect().bottom?i=n.state.doc.content.size:(s==0||o.nodeType!=1||o.childNodes[s-1].nodeName!="BR")&&(i=eD(n,o,s,t))}i==null&&(i=tD(n,a,t));let c=n.docView.nearestDesc(a,!0);return{pos:i,inside:c?c.posAtStart-c.border:-1}}function fv(n){return n.top<n.bottom||n.left<n.right}function el(n,t){let e=n.getClientRects();if(e.length){let o=e[t<0?0:e.length-1];if(fv(o))return o}return Array.prototype.find.call(e,fv)||n.getBoundingClientRect()}const oD=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function hv(n,t,e){let{node:o,offset:s,atom:r}=n.docView.domFromPos(t,e<0?-1:1),a=Br||wn;if(o.nodeType==3)if(a&&(oD.test(o.nodeValue)||(e<0?!s:s==o.nodeValue.length))){let c=el(xo(o,s,s),e);if(wn&&s&&/\s/.test(o.nodeValue[s-1])&&s<o.nodeValue.length){let d=el(xo(o,s-1,s-1),-1);if(d.top==c.top){let p=el(xo(o,s,s+1),-1);if(p.top!=c.top)return Or(p,p.left<d.left)}}return c}else{let c=s,d=s,p=e<0?1:-1;return e<0&&!s?(d++,p=-1):e>=0&&s==o.nodeValue.length?(c--,p=1):e<0?c--:d++,Or(el(xo(o,c,d),p),p<0)}if(!n.state.doc.resolve(t-(r||0)).parent.inlineContent){if(r==null&&s&&(e<0||s==xn(o))){let c=o.childNodes[s-1];if(c.nodeType==1)return bp(c.getBoundingClientRect(),!1)}if(r==null&&s<xn(o)){let c=o.childNodes[s];if(c.nodeType==1)return bp(c.getBoundingClientRect(),!0)}return bp(o.getBoundingClientRect(),e>=0)}if(r==null&&s&&(e<0||s==xn(o))){let c=o.childNodes[s-1],d=c.nodeType==3?xo(c,xn(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return Or(el(d,1),!1)}if(r==null&&s<xn(o)){let c=o.childNodes[s];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?xo(c,0,a?0:1):c.nodeType==1?c:null:null;if(d)return Or(el(d,-1),!0)}return Or(el(o.nodeType==3?xo(o):o,-e),e>=0)}function Or(n,t){if(n.width==0)return n;let e=t?n.left:n.right;return{top:n.top,bottom:n.bottom,left:e,right:e}}function bp(n,t){if(n.height==0)return n;let e=t?n.top:n.bottom;return{top:e,bottom:e,left:n.left,right:n.right}}function mv(n,t,e){let o=n.state,s=n.root.activeElement;o!=t&&n.updateState(t),s!=n.dom&&n.focus();try{return e()}finally{o!=t&&n.updateState(o),s!=n.dom&&s&&s.focus()}}function lD(n,t,e){let o=t.selection,s=e=="up"?o.$from:o.$to;return mv(n,t,()=>{let{node:r}=n.docView.domFromPos(s.pos,e=="up"?-1:1);for(;;){let i=n.docView.nearestDesc(r,!0);if(!i)break;if(i.node.isBlock){r=i.contentDOM||i.dom;break}r=i.dom.parentNode}let a=hv(n,s.pos,1);for(let i=r.firstChild;i;i=i.nextSibling){let c;if(i.nodeType==1)c=i.getClientRects();else if(i.nodeType==3)c=xo(i,0,i.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let p=c[d];if(p.bottom>p.top+1&&(e=="up"?a.top-p.top>(p.bottom-a.top)*2:p.bottom-a.bottom>(a.bottom-p.top)*2))return!1}}return!0})}const sD=/[\u0590-\u08ac]/;function rD(n,t,e){let{$head:o}=t.selection;if(!o.parent.isTextblock)return!1;let s=o.parentOffset,r=!s,a=s==o.parent.content.size,i=n.domSelection();return i?!sD.test(o.parent.textContent)||!i.modify?e=="left"||e=="backward"?r:a:mv(n,t,()=>{let{focusNode:c,focusOffset:d,anchorNode:p,anchorOffset:u}=n.domSelectionRange(),f=i.caretBidiLevel;i.modify("move",e,"character");let h=o.depth?n.docView.domAfterPos(o.before()):n.dom,{focusNode:m,focusOffset:g}=n.domSelectionRange(),v=m&&!h.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{i.collapse(p,u),c&&(c!=p||d!=u)&&i.extend&&i.extend(c,d)}catch{}return f!=null&&(i.caretBidiLevel=f),v}):o.pos==o.start()||o.pos==o.end()}let gv=null,vv=null,yv=!1;function aD(n,t,e){return gv==t&&vv==e?yv:(gv=t,vv=e,yv=e=="up"||e=="down"?lD(n,t,e):rD(n,t,e))}const En=0,bv=1,Il=2,to=3;class Dr{constructor(t,e,o,s){this.parent=t,this.children=e,this.dom=o,this.contentDOM=s,this.dirty=En,o.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,o){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,o=this.posAtStart;;e++){let s=this.children[e];if(s==t)return o;o+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,o){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(o<0){let r,a;if(t==this.contentDOM)r=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;r=t.previousSibling}for(;r&&!((a=r.pmViewDesc)&&a.parent==this);)r=r.previousSibling;return r?this.posBeforeChild(a)+a.size:this.posAtStart}else{let r,a;if(t==this.contentDOM)r=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;r=t.nextSibling}for(;r&&!((a=r.pmViewDesc)&&a.parent==this);)r=r.nextSibling;return r?this.posBeforeChild(a):this.posAtEnd}let s;if(t==this.dom&&this.contentDOM)s=e>Oe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(e==0)for(let r=t;;r=r.parentNode){if(r==this.dom){s=!1;break}if(r.previousSibling)break}if(s==null&&e==t.childNodes.length)for(let r=t;;r=r.parentNode){if(r==this.dom){s=!0;break}if(r.nextSibling)break}}return s??o>0?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let o=!0,s=t;s;s=s.parentNode){let r=this.getDesc(s),a;if(r&&(!e||r.node))if(o&&(a=r.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))o=!1;else return r}}getDesc(t){let e=t.pmViewDesc;for(let o=e;o;o=o.parent)if(o==this)return e}posFromDOM(t,e,o){for(let s=t;s;s=s.parentNode){let r=this.getDesc(s);if(r)return r.localPosFromDOM(t,e,o)}return-1}descAt(t){for(let e=0,o=0;e<this.children.length;e++){let s=this.children[e],r=o+s.size;if(o==t&&r!=o){for(;!s.border&&s.children.length;)for(let a=0;a<s.children.length;a++){let i=s.children[a];if(i.size){s=i;break}}return s}if(t<r)return s.descAt(t-o-s.border);o=r}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let o=0,s=0;for(let r=0;o<this.children.length;o++){let a=this.children[o],i=r+a.size;if(i>t||a instanceof wv){s=t-r;break}r=i}if(s)return this.children[o].domFromPos(s-this.children[o].border,e);for(let r;o&&!(r=this.children[o-1]).size&&r instanceof kv&&r.side>=0;o--);if(e<=0){let r,a=!0;for(;r=o?this.children[o-1]:null,!(!r||r.dom.parentNode==this.contentDOM);o--,a=!1);return r&&e&&a&&!r.border&&!r.domAtom?r.domFromPos(r.size,e):{node:this.contentDOM,offset:r?Oe(r.dom)+1:0}}else{let r,a=!0;for(;r=o<this.children.length?this.children[o]:null,!(!r||r.dom.parentNode==this.contentDOM);o++,a=!1);return r&&a&&!r.border&&!r.domAtom?r.domFromPos(0,e):{node:this.contentDOM,offset:r?Oe(r.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,o=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,r=-1;for(let a=o,i=0;;i++){let c=this.children[i],d=a+c.size;if(s==-1&&t<=d){let p=a+c.border;if(t>=p&&e<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,e,p);t=a;for(let u=i;u>0;u--){let f=this.children[u-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){s=Oe(f.dom)+1;break}t-=f.size}s==-1&&(s=0)}if(s>-1&&(d>e||i==this.children.length-1)){e=d;for(let p=i+1;p<this.children.length;p++){let u=this.children[p];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){r=Oe(u.dom);break}e+=u.size}r==-1&&(r=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:t,to:e,fromOffset:s,toOffset:r}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return e.size==0||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:o}=this.domFromPos(t,0);if(e.nodeType!=1||o==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[o]}setSelection(t,e,o,s=!1){let r=Math.min(t,e),a=Math.max(t,e);for(let h=0,m=0;h<this.children.length;h++){let g=this.children[h],v=m+g.size;if(r>m&&a<v)return g.setSelection(t-m-g.border,e-m-g.border,o,s);m=v}let i=this.domFromPos(t,t?-1:1),c=e==t?i:this.domFromPos(e,e?-1:1),d=o.root.getSelection(),p=o.domSelectionRange(),u=!1;if((wn||Pe)&&t==e){let{node:h,offset:m}=i;if(h.nodeType==3){if(u=!!(m&&h.nodeValue[m-1]==`
482
+ `),u&&m==h.nodeValue.length)for(let g=h,v;g;g=g.parentNode){if(v=g.nextSibling){v.nodeName=="BR"&&(i=c={node:v.parentNode,offset:Oe(v)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=h.childNodes[m-1];u=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(wn&&p.focusNode&&p.focusNode!=c.node&&p.focusNode.nodeType==1){let h=p.focusNode.childNodes[p.focusOffset];h&&h.contentEditable=="false"&&(s=!0)}if(!(s||u&&Pe)&&Vl(i.node,i.offset,p.anchorNode,p.anchorOffset)&&Vl(c.node,c.offset,p.focusNode,p.focusOffset))return;let f=!1;if((d.extend||t==e)&&!(u&&wn)){d.collapse(i.node,i.offset);try{t!=e&&d.extend(c.node,c.offset),f=!0}catch{}}if(!f){if(t>e){let m=i;i=c,c=m}let h=document.createRange();h.setEnd(c.node,c.offset),h.setStart(i.node,i.offset),d.removeAllRanges(),d.addRange(h)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let o=0,s=0;s<this.children.length;s++){let r=this.children[s],a=o+r.size;if(o==a?t<=a&&e>=o:t<a&&e>o){let i=o+r.border,c=a-r.border;if(t>=i&&e<=c){this.dirty=t==o||e==a?Il:bv,t==i&&e==c&&(r.contentLost||r.dom.parentNode!=this.contentDOM)?r.dirty=to:r.markDirty(t-i,e-i);return}else r.dirty=r.dom==r.contentDOM&&r.dom.parentNode==this.contentDOM&&!r.children.length?Il:to}o=a}this.dirty=Il}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let o=t==1?Il:bv;e.dirty<o&&(e.dirty=o)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class kv extends Dr{constructor(t,e,o,s){let r,a=e.type.toDOM;if(typeof a=="function"&&(a=a(o,()=>{if(!r)return s;if(r.parent)return r.parent.posBeforeChild(r)})),!e.type.spec.raw){if(a.nodeType!=1){let i=document.createElement("span");i.appendChild(a),a=i}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=e,this.widget=e,r=this}matchesWidget(t){return this.dirty==En&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return e?e(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class iD extends Dr{constructor(t,e,o,s){super(t,[],e,null),this.textDOM=o,this.text=s}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Rl extends Dr{constructor(t,e,o,s,r){super(t,[],o,s),this.mark=e,this.spec=r}static create(t,e,o,s){let r=s.nodeViews[e.type.name],a=r&&r(e,s,o);return(!a||!a.dom)&&(a=Ol.renderSpec(document,e.type.spec.toDOM(e,o),null,e.attrs)),new Rl(t,e,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&to||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=to&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),this.dirty!=En){let o=this.parent;for(;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=En}}slice(t,e,o){let s=Rl.create(this.parent,this.mark,!0,o),r=this.children,a=this.size;e<a&&(r=xp(r,e,a,o)),t>0&&(r=xp(r,0,t,o));for(let i=0;i<r.length;i++)r[i].parent=s;return s.children=r,s}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class nl extends Dr{constructor(t,e,o,s,r,a,i,c,d){super(t,[],r,a),this.node=e,this.outerDeco=o,this.innerDeco=s,this.nodeDOM=i}static create(t,e,o,s,r,a){let i=r.nodeViews[e.type.name],c,d=i&&i(e,r,()=>{if(!c)return a;if(c.parent)return c.parent.posBeforeChild(c)},o,s),p=d&&d.dom,u=d&&d.contentDOM;if(e.isText){if(!p)p=document.createTextNode(e.text);else if(p.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else p||({dom:p,contentDOM:u}=Ol.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs));!u&&!e.isText&&p.nodeName!="BR"&&(p.hasAttribute("contenteditable")||(p.contentEditable="false"),e.type.spec.draggable&&(p.draggable=!0));let f=p;return p=Cv(p,o,e),d?c=new cD(t,e,o,s,p,u||null,f,d,r,a+1):e.isText?new Ni(t,e,o,s,p,f,r):new nl(t,e,o,s,p,u||null,f,r,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let o=this.children[e];if(this.dom.contains(o.dom.parentNode)){t.contentElement=o.dom.parentNode;break}}t.contentElement||(t.getContent=()=>G.empty)}return t}matchesNode(t,e,o){return this.dirty==En&&t.eq(this.node)&&Mi(e,this.outerDeco)&&o.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let o=this.node.inlineContent,s=e,r=t.composing?this.localCompositionInfo(t,e):null,a=r&&r.pos>-1?r:null,i=r&&r.pos<0,c=new pD(this,a&&a.node,t);hD(this.node,this.innerDeco,(d,p,u)=>{d.spec.marks?c.syncToMarks(d.spec.marks,o,t,p):d.type.side>=0&&!u&&c.syncToMarks(p==this.node.childCount?Gt.none:this.node.child(p).marks,o,t,p),c.placeWidget(d,t,s)},(d,p,u,f)=>{c.syncToMarks(d.marks,o,t,f);let h;c.findNodeMatch(d,p,u,f)||i&&t.state.selection.from>s&&t.state.selection.to<s+d.nodeSize&&(h=c.findIndexWithChild(r.node))>-1&&c.updateNodeAt(d,p,u,h,t)||c.updateNextNode(d,p,u,t,f,s)||c.addNode(d,p,u,t,s),s+=d.nodeSize}),c.syncToMarks([],o,t,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Il)&&(a&&this.protectLocalComposition(t,a),Sv(this.contentDOM,this.children,t),bs&&mD(this.dom))}localCompositionInfo(t,e){let{from:o,to:s}=t.state.selection;if(!(t.state.selection instanceof Et)||o<e||s>e+this.node.content.size)return null;let r=t.input.compositionNode;if(!r||!this.dom.contains(r.parentNode))return null;if(this.node.inlineContent){let a=r.nodeValue,i=gD(this.node.content,a,o-e,s-e);return i<0?null:{node:r,pos:i,text:a}}else return{node:r,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:o,text:s}){if(this.getDesc(e))return;let r=e;for(;r.parentNode!=this.contentDOM;r=r.parentNode){for(;r.previousSibling;)r.parentNode.removeChild(r.previousSibling);for(;r.nextSibling;)r.parentNode.removeChild(r.nextSibling);r.pmViewDesc&&(r.pmViewDesc=void 0)}let a=new iD(this,r,e,s);t.input.compositionNodes.push(a),this.children=xp(this.children,o,o+s.length,t,a)}update(t,e,o,s){return this.dirty==to||!t.sameMarkup(this.node)?!1:(this.updateInner(t,e,o,s),!0)}updateInner(t,e,o,s){this.updateOuterDeco(e),this.node=t,this.innerDeco=o,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=En}updateOuterDeco(t){if(Mi(t,this.outerDeco))return;let e=this.nodeDOM.nodeType!=1,o=this.dom;this.dom=Ev(this.dom,this.nodeDOM,kp(this.outerDeco,this.node,e),kp(t,this.node,e)),this.dom!=o&&(o.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function xv(n,t,e,o,s){Cv(o,t,n);let r=new nl(void 0,n,t,e,o,o,o,s,0);return r.contentDOM&&r.updateChildren(s,0),r}class Ni extends nl{constructor(t,e,o,s,r,a,i){super(t,e,o,s,r,null,a,i,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,o,s){return this.dirty==to||this.dirty!=En&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(e),(this.dirty!=En||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=t,this.dirty=En,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,o){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,o)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,e,o){let s=this.node.cut(t,e),r=document.createTextNode(s.text);return new Ni(this.parent,s,this.outerDeco,this.innerDeco,r,r,o)}markDirty(t,e){super.markDirty(t,e),this.dom!=this.nodeDOM&&(t==0||e==this.nodeDOM.nodeValue.length)&&(this.dirty=to)}get domAtom(){return!1}isText(t){return this.node.text==t}}class wv extends Dr{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==En&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class cD extends nl{constructor(t,e,o,s,r,a,i,c,d,p){super(t,e,o,s,r,a,i,d,p),this.spec=c}update(t,e,o,s){if(this.dirty==to)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let r=this.spec.update(t,e,o);return r&&this.updateInner(t,e,o,s),r}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,e,o,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,o,s){this.spec.setSelection?this.spec.setSelection(t,e,o.root):super.setSelection(t,e,o,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Sv(n,t,e){let o=n.firstChild,s=!1;for(let r=0;r<t.length;r++){let a=t[r],i=a.dom;if(i.parentNode==n){for(;i!=o;)o=Tv(o),s=!0;o=o.nextSibling}else s=!0,n.insertBefore(i,o);if(a instanceof Rl){let c=o?o.previousSibling:n.lastChild;Sv(a.contentDOM,a.children,e),o=c?c.nextSibling:n.firstChild}}for(;o;)o=Tv(o),s=!0;s&&e.trackWrites==n&&(e.trackWrites=null)}const Vr=function(n){n&&(this.nodeName=n)};Vr.prototype=Object.create(null);const zl=[new Vr];function kp(n,t,e){if(n.length==0)return zl;let o=e?zl[0]:new Vr,s=[o];for(let r=0;r<n.length;r++){let a=n[r].type.attrs;if(a){a.nodeName&&s.push(o=new Vr(a.nodeName));for(let i in a){let c=a[i];c!=null&&(e&&s.length==1&&s.push(o=new Vr(t.isInline?"span":"div")),i=="class"?o.class=(o.class?o.class+" ":"")+c:i=="style"?o.style=(o.style?o.style+";":"")+c:i!="nodeName"&&(o[i]=c))}}}return s}function Ev(n,t,e,o){if(e==zl&&o==zl)return t;let s=t;for(let r=0;r<o.length;r++){let a=o[r],i=e[r];if(r){let c;i&&i.nodeName==a.nodeName&&s!=n&&(c=s.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(s),i=zl[0]),s=c}dD(s,i||zl[0],a)}return s}function dD(n,t,e){for(let o in t)o!="class"&&o!="style"&&o!="nodeName"&&!(o in e)&&n.removeAttribute(o);for(let o in e)o!="class"&&o!="style"&&o!="nodeName"&&e[o]!=t[o]&&n.setAttribute(o,e[o]);if(t.class!=e.class){let o=t.class?t.class.split(" ").filter(Boolean):[],s=e.class?e.class.split(" ").filter(Boolean):[];for(let r=0;r<o.length;r++)s.indexOf(o[r])==-1&&n.classList.remove(o[r]);for(let r=0;r<s.length;r++)o.indexOf(s[r])==-1&&n.classList.add(s[r]);n.classList.length==0&&n.removeAttribute("class")}if(t.style!=e.style){if(t.style){let o=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=o.exec(t.style);)n.style.removeProperty(s[1])}e.style&&(n.style.cssText+=e.style)}}function Cv(n,t,e){return Ev(n,n,zl,kp(t,e,n.nodeType!=1))}function Mi(n,t){if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(!n[e].type.eq(t[e].type))return!1;return!0}function Tv(n){let t=n.nextSibling;return n.parentNode.removeChild(n),t}class pD{constructor(t,e,o){this.lock=e,this.view=o,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=uD(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let o=t;o<e;o++)this.top.children[o].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,o,s){let r=0,a=this.stack.length>>1,i=Math.min(a,t.length);for(;r<i&&(r==a-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&t[r].type.spec.spanning!==!1;)r++;for(;r<a;)this.destroyRest(),this.top.dirty=En,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<t.length;){this.stack.push(this.top,this.index+1);let c=-1,d=this.top.children.length;s<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let p=this.index;p<d;p++){let u=this.top.children[p];if(u.matchesMark(t[a])&&!this.isLocked(u.dom)){c=p;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let p=Rl.create(this.top,t[a],e,o);this.top.children.splice(this.index,0,p),this.top=p,this.changed=!0}this.index=0,a++}}findNodeMatch(t,e,o,s){let r=-1,a;if(s>=this.preMatch.index&&(a=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&a.matchesNode(t,e,o))r=this.top.children.indexOf(a,this.index);else for(let i=this.index,c=Math.min(this.top.children.length,i+5);i<c;i++){let d=this.top.children[i];if(d.matchesNode(t,e,o)&&!this.preMatch.matched.has(d)){r=i;break}}return r<0?!1:(this.destroyBetween(this.index,r),this.index++,!0)}updateNodeAt(t,e,o,s,r){let a=this.top.children[s];return a.dirty==to&&a.dom==a.contentDOM&&(a.dirty=Il),a.update(t,e,o,r)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let o=t.pmViewDesc;if(o){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==o)return s}return-1}t=e}}updateNextNode(t,e,o,s,r,a){for(let i=this.index;i<this.top.children.length;i++){let c=this.top.children[i];if(c instanceof nl){let d=this.preMatch.matched.get(c);if(d!=null&&d!=r)return!1;let p=c.dom,u,f=this.isLocked(p)&&!(t.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==t.text&&c.dirty!=to&&Mi(e,c.outerDeco));if(!f&&c.update(t,e,o,s))return this.destroyBetween(this.index,i),c.dom!=p&&(this.changed=!0),this.index++,!0;if(!f&&(u=this.recreateWrapper(c,t,e,o,s,a)))return this.destroyBetween(this.index,i),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Il,u.updateChildren(s,a+1),u.dirty=En),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,o,s,r,a){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!Mi(o,t.outerDeco)||!s.eq(t.innerDeco))return null;let i=nl.create(this.top,e,o,s,r,a);if(i.contentDOM){i.children=t.children,t.children=[];for(let c of i.children)c.parent=i}return t.destroy(),i}addNode(t,e,o,s,r){let a=nl.create(this.top,t,e,o,s,r);a.contentDOM&&a.updateChildren(s,r+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(t,e,o){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(t)&&(t==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let r=new kv(this.top,t,e,o);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;for(;t instanceof Rl;)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof Ni)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Pe||De)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let o=document.createElement(t);t=="IMG"&&(o.className="ProseMirror-separator",o.alt=""),t=="BR"&&(o.className="ProseMirror-trailingBreak");let s=new wv(this.top,[],o,null);e!=this.top?e.children.push(s):e.children.splice(this.index++,0,s),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function uD(n,t){let e=t,o=e.children.length,s=n.childCount,r=new Map,a=[];t:for(;s>0;){let i;for(;;)if(o){let d=e.children[o-1];if(d instanceof Rl)e=d,o=d.children.length;else{i=d,o--;break}}else{if(e==t)break t;o=e.parent.children.indexOf(e),e=e.parent}let c=i.node;if(c){if(c!=n.child(s-1))break;--s,r.set(i,s),a.push(i)}}return{index:s,matched:r,matches:a.reverse()}}function fD(n,t){return n.type.side-t.type.side}function hD(n,t,e,o){let s=t.locals(n),r=0;if(s.length==0){for(let d=0;d<n.childCount;d++){let p=n.child(d);o(p,s,t.forChild(r,p),d),r+=p.nodeSize}return}let a=0,i=[],c=null;for(let d=0;;){let p,u;for(;a<s.length&&s[a].to==r;){let v=s[a++];v.widget&&(p?(u||(u=[p])).push(v):p=v)}if(p)if(u){u.sort(fD);for(let v=0;v<u.length;v++)e(u[v],d,!!c)}else e(p,d,!!c);let f,h;if(c)h=-1,f=c,c=null;else if(d<n.childCount)h=d,f=n.child(d++);else break;for(let v=0;v<i.length;v++)i[v].to<=r&&i.splice(v--,1);for(;a<s.length&&s[a].from<=r&&s[a].to>r;)i.push(s[a++]);let m=r+f.nodeSize;if(f.isText){let v=m;a<s.length&&s[a].from<v&&(v=s[a].from);for(let y=0;y<i.length;y++)i[y].to<v&&(v=i[y].to);v<m&&(c=f.cut(v-r),f=f.cut(0,v-r),m=v,h=-1)}else for(;a<s.length&&s[a].to<m;)a++;let g=f.isInline&&!f.isLeaf?i.filter(v=>!v.inline):i.slice();o(f,g,t.forChild(r,f),h),r=m}}function mD(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let t=n.style.cssText;n.style.cssText=t+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=t}}function gD(n,t,e,o){for(let s=0,r=0;s<n.childCount&&r<=o;){let a=n.child(s++),i=r;if(r+=a.nodeSize,!a.isText)continue;let c=a.text;for(;s<n.childCount;){let d=n.child(s++);if(r+=d.nodeSize,!d.isText)break;c+=d.text}if(r>=e){if(r>=o&&c.slice(o-t.length-i,o-i)==t)return o-t.length;let d=i<o?c.lastIndexOf(t,o-i-1):-1;if(d>=0&&d+t.length+i>=e)return i+d;if(e==o&&c.length>=o+t.length-i&&c.slice(o-i,o-i+t.length)==t)return o}}return-1}function xp(n,t,e,o,s){let r=[];for(let a=0,i=0;a<n.length;a++){let c=n[a],d=i,p=i+=c.size;d>=e||p<=t?r.push(c):(d<t&&r.push(c.slice(0,t-d,o)),s&&(r.push(s),s=void 0),p>e&&r.push(c.slice(e-d,c.size,o)))}return r}function wp(n,t=null){let e=n.domSelectionRange(),o=n.state.doc;if(!e.focusNode)return null;let s=n.docView.nearestDesc(e.focusNode),r=s&&s.size==0,a=n.docView.posFromDOM(e.focusNode,e.focusOffset,1);if(a<0)return null;let i=o.resolve(a),c,d;if(Ti(e)){for(c=a;s&&!s.node;)s=s.parent;let u=s.node;if(s&&u.isAtom&&vt.isSelectable(u)&&s.parent&&!(u.isInline&&W4(e.focusNode,e.focusOffset,s.dom))){let f=s.posBefore;d=new vt(a==f?i:o.resolve(f))}}else{if(e instanceof n.dom.ownerDocument.defaultView.Selection&&e.rangeCount>1){let u=a,f=a;for(let h=0;h<e.rangeCount;h++){let m=e.getRangeAt(h);u=Math.min(u,n.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,n.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(u<0)return null;[c,a]=f==n.state.selection.anchor?[f,u]:[u,f],i=o.resolve(a)}else c=n.docView.posFromDOM(e.anchorNode,e.anchorOffset,1);if(c<0)return null}let p=o.resolve(c);if(!d){let u=t=="pointer"||n.state.selection.head<i.pos&&!r?1:-1;d=Ep(n,p,i,u)}return d}function Nv(n){return n.editable?n.hasFocus():Iv(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Eo(n,t=!1){let e=n.state.selection;if(Dv(n,e),!!Nv(n)){if(!t&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&De){let o=n.domSelectionRange(),s=n.domObserver.currentSelection;if(o.anchorNode&&s.anchorNode&&Vl(o.anchorNode,o.anchorOffset,s.anchorNode,s.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)yD(n);else{let{anchor:o,head:s}=e,r,a;Mv&&!(e instanceof Et)&&(e.$from.parent.inlineContent||(r=Bv(n,e.from)),!e.empty&&!e.$from.parent.inlineContent&&(a=Bv(n,e.to))),n.docView.setSelection(o,s,n,t),Mv&&(r&&Ov(r),a&&Ov(a)),e.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vD(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Mv=Pe||De&&rv<63;function Bv(n,t){let{node:e,offset:o}=n.docView.domFromPos(t,0),s=o<e.childNodes.length?e.childNodes[o]:null,r=o?e.childNodes[o-1]:null;if(Pe&&s&&s.contentEditable=="false")return Sp(s);if((!s||s.contentEditable=="false")&&(!r||r.contentEditable=="false")){if(s)return Sp(s);if(r)return Sp(r)}}function Sp(n){return n.contentEditable="true",Pe&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Ov(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function vD(n){let t=n.dom.ownerDocument;t.removeEventListener("selectionchange",n.input.hideSelectionGuard);let e=n.domSelectionRange(),o=e.anchorNode,s=e.anchorOffset;t.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(e.anchorNode!=o||e.anchorOffset!=s)&&(t.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Nv(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function yD(n){let t=n.domSelection();if(!t)return;let e=n.cursorWrapper.dom,o=e.nodeName=="IMG";o?t.collapse(e.parentNode,Oe(e)+1):t.collapse(e,0),!o&&!n.state.selection.visible&&Qe&&tl<=11&&(e.disabled=!0,e.disabled=!1)}function Dv(n,t){if(t instanceof vt){let e=n.docView.descAt(t.from);e!=n.lastSelectedViewDesc&&(Vv(n),e&&e.selectNode(),n.lastSelectedViewDesc=e)}else Vv(n)}function Vv(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Ep(n,t,e,o){return n.someProp("createSelectionBetween",s=>s(n,t,e))||Et.between(t,e,o)}function Av(n){return n.editable&&!n.hasFocus()?!1:Iv(n)}function Iv(n){let t=n.domSelectionRange();if(!t.anchorNode)return!1;try{return n.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(n.editable||n.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function bD(n){let t=n.docView.domFromPos(n.state.selection.anchor,0),e=n.domSelectionRange();return Vl(t.node,t.offset,e.anchorNode,e.anchorOffset)}function Cp(n,t){let{$anchor:e,$head:o}=n.selection,s=t>0?e.max(o):e.min(o),r=s.parent.inlineContent?s.depth?n.doc.resolve(t>0?s.after():s.before()):null:s;return r&&Rt.findFrom(r,t)}function ol(n,t){return n.dispatch(n.state.tr.setSelection(t).scrollIntoView()),!0}function Rv(n,t,e){let o=n.state.selection;if(o instanceof Et)if(e.indexOf("s")>-1){let{$head:s}=o,r=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!r||r.isText||!r.isLeaf)return!1;let a=n.state.doc.resolve(s.pos+r.nodeSize*(t<0?-1:1));return ol(n,new Et(o.$anchor,a))}else if(o.empty){if(n.endOfTextblock(t>0?"forward":"backward")){let s=Cp(n.state,t);return s&&s instanceof vt?ol(n,s):!1}else if(!(Sn&&e.indexOf("m")>-1)){let s=o.$head,r=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter,a;if(!r||r.isText)return!1;let i=t<0?s.pos-r.nodeSize:s.pos;return r.isAtom||(a=n.docView.descAt(i))&&!a.contentDOM?vt.isSelectable(r)?ol(n,new vt(t<0?n.state.doc.resolve(s.pos-r.nodeSize):s)):Br?ol(n,new Et(n.state.doc.resolve(t<0?i:i+r.nodeSize))):!1:!1}}else return!1;else{if(o instanceof vt&&o.node.isInline)return ol(n,new Et(t>0?o.$to:o.$from));{let s=Cp(n.state,t);return s?ol(n,s):!1}}}function Bi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ar(n,t){let e=n.pmViewDesc;return e&&e.size==0&&(t<0||n.nextSibling||n.nodeName!="BR")}function xs(n,t){return t<0?kD(n):xD(n)}function kD(n){let t=n.domSelectionRange(),e=t.focusNode,o=t.focusOffset;if(!e)return;let s,r,a=!1;for(wn&&e.nodeType==1&&o<Bi(e)&&Ar(e.childNodes[o],-1)&&(a=!0);;)if(o>0){if(e.nodeType!=1)break;{let i=e.childNodes[o-1];if(Ar(i,-1))s=e,r=--o;else if(i.nodeType==3)e=i,o=e.nodeValue.length;else break}}else{if(zv(e))break;{let i=e.previousSibling;for(;i&&Ar(i,-1);)s=e.parentNode,r=Oe(i),i=i.previousSibling;if(i)e=i,o=Bi(e);else{if(e=e.parentNode,e==n.dom)break;o=0}}}a?Tp(n,e,o):s&&Tp(n,s,r)}function xD(n){let t=n.domSelectionRange(),e=t.focusNode,o=t.focusOffset;if(!e)return;let s=Bi(e),r,a;for(;;)if(o<s){if(e.nodeType!=1)break;let i=e.childNodes[o];if(Ar(i,1))r=e,a=++o;else break}else{if(zv(e))break;{let i=e.nextSibling;for(;i&&Ar(i,1);)r=i.parentNode,a=Oe(i)+1,i=i.nextSibling;if(i)e=i,o=0,s=Bi(e);else{if(e=e.parentNode,e==n.dom)break;o=s=0}}}r&&Tp(n,r,a)}function zv(n){let t=n.pmViewDesc;return t&&t.node&&t.node.isBlock}function wD(n,t){for(;n&&t==n.childNodes.length&&!Mr(n);)t=Oe(n)+1,n=n.parentNode;for(;n&&t<n.childNodes.length;){let e=n.childNodes[t];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;n=e,t=0}}function SD(n,t){for(;n&&!t&&!Mr(n);)t=Oe(n),n=n.parentNode;for(;n&&t;){let e=n.childNodes[t-1];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;n=e,t=n.childNodes.length}}function Tp(n,t,e){if(t.nodeType!=3){let r,a;(a=wD(t,e))?(t=a,e=0):(r=SD(t,e))&&(t=r,e=r.nodeValue.length)}let o=n.domSelection();if(!o)return;if(Ti(o)){let r=document.createRange();r.setEnd(t,e),r.setStart(t,e),o.removeAllRanges(),o.addRange(r)}else o.extend&&o.extend(t,e);n.domObserver.setCurSelection();let{state:s}=n;setTimeout(()=>{n.state==s&&Eo(n)},50)}function Pv(n,t){let e=n.state.doc.resolve(t);if(!(De||av)&&e.parent.inlineContent){let s=n.coordsAtPos(t);if(t>e.start()){let r=n.coordsAtPos(t-1),a=(r.top+r.bottom)/2;if(a>s.top&&a<s.bottom&&Math.abs(r.left-s.left)>1)return r.left<s.left?"ltr":"rtl"}if(t<e.end()){let r=n.coordsAtPos(t+1),a=(r.top+r.bottom)/2;if(a>s.top&&a<s.bottom&&Math.abs(r.left-s.left)>1)return r.left>s.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Lv(n,t,e){let o=n.state.selection;if(o instanceof Et&&!o.empty||e.indexOf("s")>-1||Sn&&e.indexOf("m")>-1)return!1;let{$from:s,$to:r}=o;if(!s.parent.inlineContent||n.endOfTextblock(t<0?"up":"down")){let a=Cp(n.state,t);if(a&&a instanceof vt)return ol(n,a)}if(!s.parent.inlineContent){let a=t<0?s:r,i=o instanceof pn?Rt.near(a,t):Rt.findFrom(a,t);return i?ol(n,i):!1}return!1}function Fv(n,t){if(!(n.state.selection instanceof Et))return!0;let{$head:e,$anchor:o,empty:s}=n.state.selection;if(!e.sameParent(o))return!0;if(!s)return!1;if(n.endOfTextblock(t>0?"forward":"backward"))return!0;let r=!e.textOffset&&(t<0?e.nodeBefore:e.nodeAfter);if(r&&!r.isText){let a=n.state.tr;return t<0?a.delete(e.pos-r.nodeSize,e.pos):a.delete(e.pos,e.pos+r.nodeSize),n.dispatch(a),!0}return!1}function jv(n,t,e){n.domObserver.stop(),t.contentEditable=e,n.domObserver.start()}function ED(n){if(!Pe||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:e}=n.domSelectionRange();if(t&&t.nodeType==1&&e==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let o=t.firstChild;jv(n,o,"true"),setTimeout(()=>jv(n,o,"false"),20)}return!1}function CD(n){let t="";return n.ctrlKey&&(t+="c"),n.metaKey&&(t+="m"),n.altKey&&(t+="a"),n.shiftKey&&(t+="s"),t}function TD(n,t){let e=t.keyCode,o=CD(t);if(e==8||Sn&&e==72&&o=="c")return Fv(n,-1)||xs(n,-1);if(e==46&&!t.shiftKey||Sn&&e==68&&o=="c")return Fv(n,1)||xs(n,1);if(e==13||e==27)return!0;if(e==37||Sn&&e==66&&o=="c"){let s=e==37?Pv(n,n.state.selection.from)=="ltr"?-1:1:-1;return Rv(n,s,o)||xs(n,s)}else if(e==39||Sn&&e==70&&o=="c"){let s=e==39?Pv(n,n.state.selection.from)=="ltr"?1:-1:1;return Rv(n,s,o)||xs(n,s)}else{if(e==38||Sn&&e==80&&o=="c")return Lv(n,-1,o)||xs(n,-1);if(e==40||Sn&&e==78&&o=="c")return ED(n)||Lv(n,1,o)||xs(n,1);if(o==(Sn?"m":"c")&&(e==66||e==73||e==89||e==90))return!0}return!1}function Np(n,t){n.someProp("transformCopied",h=>{t=h(t,n)});let e=[],{content:o,openStart:s,openEnd:r}=t;for(;s>1&&r>1&&o.childCount==1&&o.firstChild.childCount==1;){s--,r--;let h=o.firstChild;e.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),o=h.content}let a=n.someProp("clipboardSerializer")||Ol.fromSchema(n.state.schema),i=Yv(),c=i.createElement("div");c.appendChild(a.serializeFragment(o,{document:i}));let d=c.firstChild,p,u=0;for(;d&&d.nodeType==1&&(p=Gv[d.nodeName.toLowerCase()]);){for(let h=p.length-1;h>=0;h--){let m=i.createElement(p[h]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),u++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${s} ${r}${u?` -${u}`:""} ${JSON.stringify(e)}`);let f=n.someProp("clipboardTextSerializer",h=>h(t,n))||t.content.textBetween(0,t.content.size,`
483
+
484
+ `);return{dom:c,text:f,slice:t}}function Hv(n,t,e,o,s){let r=s.parent.type.spec.code,a,i;if(!e&&!t)return null;let c=!!t&&(o||r||!e);if(c){if(n.someProp("transformPastedText",f=>{t=f(t,r||o,n)}),r)return i=new rt(G.from(n.state.schema.text(t.replace(/\r\n?/g,`
485
+ `))),0,0),n.someProp("transformPasted",f=>{i=f(i,n,!0)}),i;let u=n.someProp("clipboardTextParser",f=>f(t,s,o,n));if(u)i=u;else{let f=s.marks(),{schema:h}=n.state,m=Ol.fromSchema(h);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let v=a.appendChild(document.createElement("p"));g&&v.appendChild(m.serializeNode(h.text(g,f)))})}}else n.someProp("transformPastedHTML",u=>{e=u(e,n)}),a=OD(e),Br&&DD(a);let d=a&&a.querySelector("[data-pm-slice]"),p=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let u=+p[3];u>0;u--){let f=a.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;a=f}if(i||(i=(n.someProp("clipboardParser")||n.someProp("domParser")||bo.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||p),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!ND.test(f.parentNode.nodeName)?{ignore:!0}:null}})),p)i=VD(_v(i,+p[1],+p[2]),p[4]);else if(i=rt.maxOpen(MD(i.content,s),!0),i.openStart||i.openEnd){let u=0,f=0;for(let h=i.content.firstChild;u<i.openStart&&!h.type.spec.isolating;u++,h=h.firstChild);for(let h=i.content.lastChild;f<i.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);i=_v(i,u,f)}return n.someProp("transformPasted",u=>{i=u(i,n,c)}),i}const ND=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function MD(n,t){if(n.childCount<2)return n;for(let e=t.depth;e>=0;e--){let s=t.node(e).contentMatchAt(t.index(e)),r,a=[];if(n.forEach(i=>{if(!a)return;let c=s.findWrapping(i.type),d;if(!c)return a=null;if(d=a.length&&r.length&&Wv(c,r,i,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=Kv(a[a.length-1],r.length));let p=Uv(i,c);a.push(p),s=s.matchType(p.type),r=c}}),a)return G.from(a)}return n}function Uv(n,t,e=0){for(let o=t.length-1;o>=e;o--)n=t[o].create(null,G.from(n));return n}function Wv(n,t,e,o,s){if(s<n.length&&s<t.length&&n[s]==t[s]){let r=Wv(n,t,e,o.lastChild,s+1);if(r)return o.copy(o.content.replaceChild(o.childCount-1,r));if(o.contentMatchAt(o.childCount).matchType(s==n.length-1?e.type:n[s+1]))return o.copy(o.content.append(G.from(Uv(e,n,s+1))))}}function Kv(n,t){if(t==0)return n;let e=n.content.replaceChild(n.childCount-1,Kv(n.lastChild,t-1)),o=n.contentMatchAt(n.childCount).fillBefore(G.empty,!0);return n.copy(e.append(o))}function Mp(n,t,e,o,s,r){let a=t<0?n.firstChild:n.lastChild,i=a.content;return n.childCount>1&&(r=0),s<o-1&&(i=Mp(i,t,e,o,s+1,r)),s>=e&&(i=t<0?a.contentMatchAt(0).fillBefore(i,r<=s).append(i):i.append(a.contentMatchAt(a.childCount).fillBefore(G.empty,!0))),n.replaceChild(t<0?0:n.childCount-1,a.copy(i))}function _v(n,t,e){return t<n.openStart&&(n=new rt(Mp(n.content,-1,t,n.openStart,0,n.openEnd),t,n.openEnd)),e<n.openEnd&&(n=new rt(Mp(n.content,1,e,n.openEnd,0,0),n.openStart,e)),n}const Gv={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Jv=null;function Yv(){return Jv||(Jv=document.implementation.createHTMLDocument("title"))}let Bp=null;function BD(n){let t=window.trustedTypes;return t?(Bp||(Bp=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),Bp.createHTML(n)):n}function OD(n){let t=/^(\s*<meta [^>]*>)*/.exec(n);t&&(n=n.slice(t[0].length));let e=Yv().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(n),s;if((s=o&&Gv[o[1].toLowerCase()])&&(n=s.map(r=>"<"+r+">").join("")+n+s.map(r=>"</"+r+">").reverse().join("")),e.innerHTML=BD(n),s)for(let r=0;r<s.length;r++)e=e.querySelector(s[r])||e;return e}function DD(n){let t=n.querySelectorAll(De?"span:not([class]):not([style])":"span.Apple-converted-space");for(let e=0;e<t.length;e++){let o=t[e];o.childNodes.length==1&&o.textContent==" "&&o.parentNode&&o.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),o)}}function VD(n,t){if(!n.size)return n;let e=n.content.firstChild.type.schema,o;try{o=JSON.parse(t)}catch{return n}let{content:s,openStart:r,openEnd:a}=n;for(let i=o.length-2;i>=0;i-=2){let c=e.nodes[o[i]];if(!c||c.hasRequiredAttrs())break;s=G.from(c.create(o[i+1],s)),r++,a++}return new rt(s,r,a)}const Ue={},We={},AD={touchstart:!0,touchmove:!0};class ID{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function RD(n){for(let t in Ue){let e=Ue[t];n.dom.addEventListener(t,n.input.eventHandlers[t]=o=>{PD(n,o)&&!Dp(n,o)&&(n.editable||!(o.type in We))&&e(n,o)},AD[t]?{passive:!0}:void 0)}Pe&&n.dom.addEventListener("input",()=>null),Op(n)}function ll(n,t){n.input.lastSelectionOrigin=t,n.input.lastSelectionTime=Date.now()}function zD(n){n.domObserver.stop();for(let t in n.input.eventHandlers)n.dom.removeEventListener(t,n.input.eventHandlers[t]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Op(n){n.someProp("handleDOMEvents",t=>{for(let e in t)n.input.eventHandlers[e]||n.dom.addEventListener(e,n.input.eventHandlers[e]=o=>Dp(n,o))})}function Dp(n,t){return n.someProp("handleDOMEvents",e=>{let o=e[t.type];return o?o(n,t)||t.defaultPrevented:!1})}function PD(n,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target;e!=n.dom;e=e.parentNode)if(!e||e.nodeType==11||e.pmViewDesc&&e.pmViewDesc.stopEvent(t))return!1;return!0}function LD(n,t){!Dp(n,t)&&Ue[t.type]&&(n.editable||!(t.type in We))&&Ue[t.type](n,t)}We.keydown=(n,t)=>{let e=t;if(n.input.shiftKey=e.keyCode==16||e.shiftKey,!Zv(n,e)&&(n.input.lastKeyCode=e.keyCode,n.input.lastKeyCodeTime=Date.now(),!(wo&&De&&e.keyCode==13)))if(e.keyCode!=229&&n.domObserver.forceFlush(),bs&&e.keyCode==13&&!e.ctrlKey&&!e.altKey&&!e.metaKey){let o=Date.now();n.input.lastIOSEnter=o,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==o&&(n.someProp("handleKeyDown",s=>s(n,Al(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",o=>o(n,e))||TD(n,e)?e.preventDefault():ll(n,"key")},We.keyup=(n,t)=>{t.keyCode==16&&(n.input.shiftKey=!1)},We.keypress=(n,t)=>{let e=t;if(Zv(n,e)||!e.charCode||e.ctrlKey&&!e.altKey||Sn&&e.metaKey)return;if(n.someProp("handleKeyPress",s=>s(n,e))){e.preventDefault();return}let o=n.state.selection;if(!(o instanceof Et)||!o.$from.sameParent(o.$to)){let s=String.fromCharCode(e.charCode),r=()=>n.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!n.someProp("handleTextInput",a=>a(n,o.$from.pos,o.$to.pos,s,r))&&n.dispatch(r()),e.preventDefault()}};function Oi(n){return{left:n.clientX,top:n.clientY}}function FD(n,t){let e=t.x-n.clientX,o=t.y-n.clientY;return e*e+o*o<100}function Vp(n,t,e,o,s){if(o==-1)return!1;let r=n.state.doc.resolve(o);for(let a=r.depth+1;a>0;a--)if(n.someProp(t,i=>a>r.depth?i(n,e,r.nodeAfter,r.before(a),s,!0):i(n,e,r.node(a),r.before(a),s,!1)))return!0;return!1}function ws(n,t,e){if(n.focused||n.focus(),n.state.selection.eq(t))return;let o=n.state.tr.setSelection(t);o.setMeta("pointer",!0),n.dispatch(o)}function jD(n,t){if(t==-1)return!1;let e=n.state.doc.resolve(t),o=e.nodeAfter;return o&&o.isAtom&&vt.isSelectable(o)?(ws(n,new vt(e)),!0):!1}function HD(n,t){if(t==-1)return!1;let e=n.state.selection,o,s;e instanceof vt&&(o=e.node);let r=n.state.doc.resolve(t);for(let a=r.depth+1;a>0;a--){let i=a>r.depth?r.nodeAfter:r.node(a);if(vt.isSelectable(i)){o&&e.$from.depth>0&&a>=e.$from.depth&&r.before(e.$from.depth+1)==e.$from.pos?s=r.before(e.$from.depth):s=r.before(a);break}}return s!=null?(ws(n,vt.create(n.state.doc,s)),!0):!1}function UD(n,t,e,o,s){return Vp(n,"handleClickOn",t,e,o)||n.someProp("handleClick",r=>r(n,t,o))||(s?HD(n,e):jD(n,e))}function WD(n,t,e,o){return Vp(n,"handleDoubleClickOn",t,e,o)||n.someProp("handleDoubleClick",s=>s(n,t,o))}function KD(n,t,e,o){return Vp(n,"handleTripleClickOn",t,e,o)||n.someProp("handleTripleClick",s=>s(n,t,o))||_D(n,e,o)}function _D(n,t,e){if(e.button!=0)return!1;let o=n.state.doc;if(t==-1)return o.inlineContent?(ws(n,Et.create(o,0,o.content.size)),!0):!1;let s=o.resolve(t);for(let r=s.depth+1;r>0;r--){let a=r>s.depth?s.nodeAfter:s.node(r),i=s.before(r);if(a.inlineContent)ws(n,Et.create(o,i+1,i+1+a.content.size));else if(vt.isSelectable(a))ws(n,vt.create(o,i));else continue;return!0}}function Ap(n){return Di(n)}const Xv=Sn?"metaKey":"ctrlKey";Ue.mousedown=(n,t)=>{let e=t;n.input.shiftKey=e.shiftKey;let o=Ap(n),s=Date.now(),r="singleClick";s-n.input.lastClick.time<500&&FD(e,n.input.lastClick)&&!e[Xv]&&n.input.lastClick.button==e.button&&(n.input.lastClick.type=="singleClick"?r="doubleClick":n.input.lastClick.type=="doubleClick"&&(r="tripleClick")),n.input.lastClick={time:s,x:e.clientX,y:e.clientY,type:r,button:e.button};let a=n.posAtCoords(Oi(e));a&&(r=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new GD(n,a,e,!!o)):(r=="doubleClick"?WD:KD)(n,a.pos,a.inside,e)?e.preventDefault():ll(n,"pointer"))};class GD{constructor(t,e,o,s){this.view=t,this.pos=e,this.event=o,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!o[Xv],this.allowDefault=o.shiftKey;let r,a;if(e.inside>-1)r=t.state.doc.nodeAt(e.inside),a=e.inside;else{let p=t.state.doc.resolve(e.pos);r=p.parent,a=p.depth?p.before():0}const i=s?null:o.target,c=i?t.docView.nearestDesc(i,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=t.state;(o.button==0&&r.type.spec.draggable&&r.type.spec.selectable!==!1||d instanceof vt&&d.from<=a&&d.to>a)&&(this.mightDrag={node:r,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&wn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),ll(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Eo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Oi(t))),this.updateAllowDefault(t),this.allowDefault||!e?ll(this.view,"pointer"):UD(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Pe&&this.mightDrag&&!this.mightDrag.node.isAtom||De&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(ws(this.view,Rt.near(this.view.state.doc.resolve(e.pos))),t.preventDefault()):ll(this.view,"pointer")}move(t){this.updateAllowDefault(t),ll(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Ue.touchstart=n=>{n.input.lastTouch=Date.now(),Ap(n),ll(n,"pointer")},Ue.touchmove=n=>{n.input.lastTouch=Date.now(),ll(n,"pointer")},Ue.contextmenu=n=>Ap(n);function Zv(n,t){return n.composing?!0:Pe&&Math.abs(t.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const JD=wo?5e3:-1;We.compositionstart=We.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:t}=n,e=t.selection.$to;if(t.selection instanceof Et&&(t.storedMarks||!e.textOffset&&e.parentOffset&&e.nodeBefore.marks.some(o=>o.type.spec.inclusive===!1)||De&&av&&YD(n)))n.markCursor=n.state.storedMarks||e.marks(),Di(n,!0),n.markCursor=null;else if(Di(n,!t.selection.empty),wn&&t.selection.empty&&e.parentOffset&&!e.textOffset&&e.nodeBefore.marks.length){let o=n.domSelectionRange();for(let s=o.focusNode,r=o.focusOffset;s&&s.nodeType==1&&r!=0;){let a=r<0?s.lastChild:s.childNodes[r-1];if(!a)break;if(a.nodeType==3){let i=n.domSelection();i&&i.collapse(a,a.nodeValue.length);break}else s=a,r=-1}}n.input.composing=!0}Qv(n,JD)};function YD(n){let{focusNode:t,focusOffset:e}=n.domSelectionRange();if(!t||t.nodeType!=1||e>=t.childNodes.length)return!1;let o=t.childNodes[e];return o.nodeType==1&&o.contentEditable=="false"}We.compositionend=(n,t)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=t.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Qv(n,20))};function Qv(n,t){clearTimeout(n.input.composingTimeout),t>-1&&(n.input.composingTimeout=setTimeout(()=>Di(n),t))}function qv(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=ZD());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function XD(n){let t=n.domSelectionRange();if(!t.focusNode)return null;let e=H4(t.focusNode,t.focusOffset),o=U4(t.focusNode,t.focusOffset);if(e&&o&&e!=o){let s=o.pmViewDesc,r=n.domObserver.lastChangedTextNode;if(e==r||o==r)return r;if(!s||!s.isText(o.nodeValue))return o;if(n.input.compositionNode==o){let a=e.pmViewDesc;if(!(!a||!a.isText(e.nodeValue)))return o}}return e||o}function ZD(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Di(n,t=!1){if(!(wo&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),qv(n),t||n.docView&&n.docView.dirty){let e=wp(n),o=n.state.selection;return e&&!e.eq(o)?n.dispatch(n.state.tr.setSelection(e)):(n.markCursor||t)&&!o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function QD(n,t){if(!n.dom.parentNode)return;let e=n.dom.parentNode.appendChild(document.createElement("div"));e.appendChild(t),e.style.cssText="position: fixed; left: -10000px; top: 10px";let o=getSelection(),s=document.createRange();s.selectNodeContents(t),n.dom.blur(),o.removeAllRanges(),o.addRange(s),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e),n.focus()},50)}const Ir=Qe&&tl<15||bs&&G4<604;Ue.copy=We.cut=(n,t)=>{let e=t,o=n.state.selection,s=e.type=="cut";if(o.empty)return;let r=Ir?null:e.clipboardData,a=o.content(),{dom:i,text:c}=Np(n,a);r?(e.preventDefault(),r.clearData(),r.setData("text/html",i.innerHTML),r.setData("text/plain",c)):QD(n,i),s&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function qD(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function $D(n,t){if(!n.dom.parentNode)return;let e=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,o=n.dom.parentNode.appendChild(document.createElement(e?"textarea":"div"));e||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus();let s=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),o.parentNode&&o.parentNode.removeChild(o),e?Rr(n,o.value,null,s,t):Rr(n,o.textContent,o.innerHTML,s,t)},50)}function Rr(n,t,e,o,s){let r=Hv(n,t,e,o,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,s,r||rt.empty)))return!0;if(!r)return!1;let a=qD(r),i=a?n.state.tr.replaceSelectionWith(a,o):n.state.tr.replaceSelection(r);return n.dispatch(i.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function $v(n){let t=n.getData("text/plain")||n.getData("Text");if(t)return t;let e=n.getData("text/uri-list");return e?e.replace(/\r?\n/g," "):""}We.paste=(n,t)=>{let e=t;if(n.composing&&!wo)return;let o=Ir?null:e.clipboardData,s=n.input.shiftKey&&n.input.lastKeyCode!=45;o&&Rr(n,$v(o),o.getData("text/html"),s,e)?e.preventDefault():$D(n,e)};class ty{constructor(t,e,o){this.slice=t,this.move=e,this.node=o}}const tV=Sn?"altKey":"ctrlKey";function ey(n,t){let e=n.someProp("dragCopies",o=>!o(t));return e??!t[tV]}Ue.dragstart=(n,t)=>{let e=t,o=n.input.mouseDown;if(o&&o.done(),!e.dataTransfer)return;let s=n.state.selection,r=s.empty?null:n.posAtCoords(Oi(e)),a;if(!(r&&r.pos>=s.from&&r.pos<=(s instanceof vt?s.to-1:s.to))){if(o&&o.mightDrag)a=vt.create(n.state.doc,o.mightDrag.pos);else if(e.target&&e.target.nodeType==1){let u=n.docView.nearestDesc(e.target,!0);u&&u.node.type.spec.draggable&&u!=n.docView&&(a=vt.create(n.state.doc,u.posBefore))}}let i=(a||n.state.selection).content(),{dom:c,text:d,slice:p}=Np(n,i);(!e.dataTransfer.files.length||!De||rv>120)&&e.dataTransfer.clearData(),e.dataTransfer.setData(Ir?"Text":"text/html",c.innerHTML),e.dataTransfer.effectAllowed="copyMove",Ir||e.dataTransfer.setData("text/plain",d),n.dragging=new ty(p,ey(n,e),a)},Ue.dragend=n=>{let t=n.dragging;window.setTimeout(()=>{n.dragging==t&&(n.dragging=null)},50)},We.dragover=We.dragenter=(n,t)=>t.preventDefault(),We.drop=(n,t)=>{try{eV(n,t,n.dragging)}finally{n.dragging=null}};function eV(n,t,e){if(!t.dataTransfer)return;let o=n.posAtCoords(Oi(t));if(!o)return;let s=n.state.doc.resolve(o.pos),r=e&&e.slice;r?n.someProp("transformPasted",h=>{r=h(r,n,!1)}):r=Hv(n,$v(t.dataTransfer),Ir?null:t.dataTransfer.getData("text/html"),!1,s);let a=!!(e&&ey(n,t));if(n.someProp("handleDrop",h=>h(n,t,r||rt.empty,a))){t.preventDefault();return}if(!r)return;t.preventDefault();let i=r?Wg(n.state.doc,s.pos,r):s.pos;i==null&&(i=s.pos);let c=n.state.tr;if(a){let{node:h}=e;h?h.replace(c):c.deleteSelection()}let d=c.mapping.map(i),p=r.openStart==0&&r.openEnd==0&&r.content.childCount==1,u=c.doc;if(p?c.replaceRangeWith(d,d,r.content.firstChild):c.replaceRange(d,d,r),c.doc.eq(u))return;let f=c.doc.resolve(d);if(p&&vt.isSelectable(r.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(r.content.firstChild))c.setSelection(new vt(f));else{let h=c.mapping.map(i);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,v,y)=>h=y),c.setSelection(Ep(n,f,c.doc.resolve(h)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))}Ue.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Eo(n)},20))},Ue.blur=(n,t)=>{let e=t;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),e.relatedTarget&&n.dom.contains(e.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},Ue.beforeinput=(n,t)=>{if(De&&wo&&t.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:o}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=o||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",r=>r(n,Al(8,"Backspace")))))return;let{$cursor:s}=n.state.selection;s&&s.pos>0&&n.dispatch(n.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let n in We)Ue[n]=We[n];function zr(n,t){if(n==t)return!0;for(let e in n)if(n[e]!==t[e])return!1;for(let e in t)if(!(e in n))return!1;return!0}class Vi{constructor(t,e){this.toDOM=t,this.spec=e||Pl,this.side=this.spec.side||0}map(t,e,o,s){let{pos:r,deleted:a}=t.mapResult(e.from+s,this.side<0?-1:1);return a?null:new Cn(r-o,r-o,this)}valid(){return!0}eq(t){return this==t||t instanceof Vi&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&zr(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class sl{constructor(t,e){this.attrs=t,this.spec=e||Pl}map(t,e,o,s){let r=t.map(e.from+s,this.spec.inclusiveStart?-1:1)-o,a=t.map(e.to+s,this.spec.inclusiveEnd?1:-1)-o;return r>=a?null:new Cn(r,a,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof sl&&zr(this.attrs,t.attrs)&&zr(this.spec,t.spec)}static is(t){return t.type instanceof sl}destroy(){}}class Ip{constructor(t,e){this.attrs=t,this.spec=e||Pl}map(t,e,o,s){let r=t.mapResult(e.from+s,1);if(r.deleted)return null;let a=t.mapResult(e.to+s,-1);return a.deleted||a.pos<=r.pos?null:new Cn(r.pos-o,a.pos-o,this)}valid(t,e){let{index:o,offset:s}=t.content.findIndex(e.from),r;return s==e.from&&!(r=t.child(o)).isText&&s+r.nodeSize==e.to}eq(t){return this==t||t instanceof Ip&&zr(this.attrs,t.attrs)&&zr(this.spec,t.spec)}destroy(){}}class Cn{constructor(t,e,o){this.from=t,this.to=e,this.type=o}copy(t,e){return new Cn(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,o){return this.type.map(t,this,e,o)}static widget(t,e,o){return new Cn(t,t,new Vi(e,o))}static inline(t,e,o,s){return new Cn(t,e,new sl(o,s))}static node(t,e,o,s){return new Cn(t,e,new Ip(o,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof sl}get widget(){return this.type instanceof Vi}}const Ss=[],Pl={};class me{constructor(t,e){this.local=t.length?t:Ss,this.children=e.length?e:Ss}static create(t,e){return e.length?Ai(e,t,0,Pl):Le}find(t,e,o){let s=[];return this.findInner(t??0,e??1e9,s,0,o),s}findInner(t,e,o,s,r){for(let a=0;a<this.local.length;a++){let i=this.local[a];i.from<=e&&i.to>=t&&(!r||r(i.spec))&&o.push(i.copy(i.from+s,i.to+s))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<e&&this.children[a+1]>t){let i=this.children[a]+1;this.children[a+2].findInner(t-i,e-i,o,s+i,r)}}map(t,e,o){return this==Le||t.maps.length==0?this:this.mapInner(t,e,0,0,o||Pl)}mapInner(t,e,o,s,r){let a;for(let i=0;i<this.local.length;i++){let c=this.local[i].map(t,o,s);c&&c.type.valid(e,c)?(a||(a=[])).push(c):r.onRemove&&r.onRemove(this.local[i].spec)}return this.children.length?nV(this.children,a||[],t,e,o,s,r):a?new me(a.sort(Ll),Ss):Le}add(t,e){return e.length?this==Le?me.create(t,e):this.addInner(t,e,0):this}addInner(t,e,o){let s,r=0;t.forEach((i,c)=>{let d=c+o,p;if(p=oy(e,i,d)){for(s||(s=this.children.slice());r<s.length&&s[r]<c;)r+=3;s[r]==c?s[r+2]=s[r+2].addInner(i,p,d+1):s.splice(r,0,c,c+i.nodeSize,Ai(p,i,d+1,Pl)),r+=3}});let a=ny(r?ly(e):e,-o);for(let i=0;i<a.length;i++)a[i].type.valid(t,a[i])||a.splice(i--,1);return new me(a.length?this.local.concat(a).sort(Ll):this.local,s||this.children)}remove(t){return t.length==0||this==Le?this:this.removeInner(t,0)}removeInner(t,e){let o=this.children,s=this.local;for(let r=0;r<o.length;r+=3){let a,i=o[r]+e,c=o[r+1]+e;for(let p=0,u;p<t.length;p++)(u=t[p])&&u.from>i&&u.to<c&&(t[p]=null,(a||(a=[])).push(u));if(!a)continue;o==this.children&&(o=this.children.slice());let d=o[r+2].removeInner(a,i+1);d!=Le?o[r+2]=d:(o.splice(r,3),r-=3)}if(s.length){for(let r=0,a;r<t.length;r++)if(a=t[r])for(let i=0;i<s.length;i++)s[i].eq(a,e)&&(s==this.local&&(s=this.local.slice()),s.splice(i--,1))}return o==this.children&&s==this.local?this:s.length||o.length?new me(s,o):Le}forChild(t,e){if(this==Le)return this;if(e.isLeaf)return me.empty;let o,s;for(let i=0;i<this.children.length;i+=3)if(this.children[i]>=t){this.children[i]==t&&(o=this.children[i+2]);break}let r=t+1,a=r+e.content.size;for(let i=0;i<this.local.length;i++){let c=this.local[i];if(c.from<a&&c.to>r&&c.type instanceof sl){let d=Math.max(r,c.from)-r,p=Math.min(a,c.to)-r;d<p&&(s||(s=[])).push(c.copy(d,p))}}if(s){let i=new me(s.sort(Ll),Ss);return o?new rl([i,o]):i}return o||Le}eq(t){if(this==t)return!0;if(!(t instanceof me)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Rp(this.localsInner(t))}localsInner(t){if(this==Le)return Ss;if(t.inlineContent||!this.local.some(sl.is))return this.local;let e=[];for(let o=0;o<this.local.length;o++)this.local[o].type instanceof sl||e.push(this.local[o]);return e}forEachSet(t){t(this)}}me.empty=new me([],[]),me.removeOverlap=Rp;const Le=me.empty;class rl{constructor(t){this.members=t}map(t,e){const o=this.members.map(s=>s.map(t,e,Pl));return rl.from(o)}forChild(t,e){if(e.isLeaf)return me.empty;let o=[];for(let s=0;s<this.members.length;s++){let r=this.members[s].forChild(t,e);r!=Le&&(r instanceof rl?o=o.concat(r.members):o.push(r))}return rl.from(o)}eq(t){if(!(t instanceof rl)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,o=!0;for(let s=0;s<this.members.length;s++){let r=this.members[s].localsInner(t);if(r.length)if(!e)e=r;else{o&&(e=e.slice(),o=!1);for(let a=0;a<r.length;a++)e.push(r[a])}}return e?Rp(o?e:e.sort(Ll)):Ss}static from(t){switch(t.length){case 0:return Le;case 1:return t[0];default:return new rl(t.every(e=>e instanceof me)?t:t.reduce((e,o)=>e.concat(o instanceof me?o:o.members),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function nV(n,t,e,o,s,r,a){let i=n.slice();for(let d=0,p=r;d<e.maps.length;d++){let u=0;e.maps[d].forEach((f,h,m,g)=>{let v=g-m-(h-f);for(let y=0;y<i.length;y+=3){let k=i[y+1];if(k<0||f>k+p-u)continue;let S=i[y]+p-u;h>=S?i[y+1]=f<=S?-2:-1:f>=p&&v&&(i[y]+=v,i[y+1]+=v)}u+=v}),p=e.maps[d].map(p,-1)}let c=!1;for(let d=0;d<i.length;d+=3)if(i[d+1]<0){if(i[d+1]==-2){c=!0,i[d+1]=-1;continue}let p=e.map(n[d]+r),u=p-s;if(u<0||u>=o.content.size){c=!0;continue}let f=e.map(n[d+1]+r,-1),h=f-s,{index:m,offset:g}=o.content.findIndex(u),v=o.maybeChild(m);if(v&&g==u&&g+v.nodeSize==h){let y=i[d+2].mapInner(e,v,p+1,n[d]+r+1,a);y!=Le?(i[d]=u,i[d+1]=h,i[d+2]=y):(i[d+1]=-2,c=!0)}else c=!0}if(c){let d=oV(i,n,t,e,s,r,a),p=Ai(d,o,0,a);t=p.local;for(let u=0;u<i.length;u+=3)i[u+1]<0&&(i.splice(u,3),u-=3);for(let u=0,f=0;u<p.children.length;u+=3){let h=p.children[u];for(;f<i.length&&i[f]<h;)f+=3;i.splice(f,0,p.children[u],p.children[u+1],p.children[u+2])}}return new me(t.sort(Ll),i)}function ny(n,t){if(!t||!n.length)return n;let e=[];for(let o=0;o<n.length;o++){let s=n[o];e.push(new Cn(s.from+t,s.to+t,s.type))}return e}function oV(n,t,e,o,s,r,a){function i(c,d){for(let p=0;p<c.local.length;p++){let u=c.local[p].map(o,s,d);u?e.push(u):a.onRemove&&a.onRemove(c.local[p].spec)}for(let p=0;p<c.children.length;p+=3)i(c.children[p+2],c.children[p]+d+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&i(n[c+2],t[c]+r+1);return e}function oy(n,t,e){if(t.isLeaf)return null;let o=e+t.nodeSize,s=null;for(let r=0,a;r<n.length;r++)(a=n[r])&&a.from>e&&a.to<o&&((s||(s=[])).push(a),n[r]=null);return s}function ly(n){let t=[];for(let e=0;e<n.length;e++)n[e]!=null&&t.push(n[e]);return t}function Ai(n,t,e,o){let s=[],r=!1;t.forEach((i,c)=>{let d=oy(n,i,c+e);if(d){r=!0;let p=Ai(d,i,e+c+1,o);p!=Le&&s.push(c,c+i.nodeSize,p)}});let a=ny(r?ly(n):n,-e).sort(Ll);for(let i=0;i<a.length;i++)a[i].type.valid(t,a[i])||(o.onRemove&&o.onRemove(a[i].spec),a.splice(i--,1));return a.length||s.length?new me(a,s):Le}function Ll(n,t){return n.from-t.from||n.to-t.to}function Rp(n){let t=n;for(let e=0;e<t.length-1;e++){let o=t[e];if(o.from!=o.to)for(let s=e+1;s<t.length;s++){let r=t[s];if(r.from==o.from){r.to!=o.to&&(t==n&&(t=n.slice()),t[s]=r.copy(r.from,o.to),sy(t,s+1,r.copy(o.to,r.to)));continue}else{r.from<o.to&&(t==n&&(t=n.slice()),t[e]=o.copy(o.from,r.from),sy(t,s,o.copy(r.from,o.to)));break}}}return t}function sy(n,t,e){for(;t<n.length&&Ll(e,n[t])>0;)t++;n.splice(t,0,e)}function zp(n){let t=[];return n.someProp("decorations",e=>{let o=e(n.state);o&&o!=Le&&t.push(o)}),n.cursorWrapper&&t.push(me.create(n.state.doc,[n.cursorWrapper.deco])),rl.from(t)}const lV={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},sV=Qe&&tl<=11;class rV{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class aV{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rV,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(o=>{for(let s=0;s<o.length;s++)this.queue.push(o[s]);Qe&&tl<=11&&o.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():Pe&&t.composing&&o.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),sV&&(this.onCharData=o=>{this.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,lV)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Av(this.view)){if(this.suppressingSelectionUpdates)return Eo(this.view);if(Qe&&tl<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Vl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e=new Set,o;for(let r=t.focusNode;r;r=ys(r))e.add(r);for(let r=t.anchorNode;r;r=ys(r))if(e.has(r)){o=r;break}let s=o&&this.view.docView.nearestDesc(o);if(s&&s.ignoreMutation({type:"selection",target:o.nodeType==3?o.parentNode:o}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let o=t.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&Av(t)&&!this.ignoreSelectionChange(o),r=-1,a=-1,i=!1,c=[];if(t.editable)for(let p=0;p<e.length;p++){let u=this.registerMutation(e[p],c);u&&(r=r<0?u.from:Math.min(u.from,r),a=a<0?u.to:Math.max(u.to,a),u.typeOver&&(i=!0))}if(c.some(p=>p.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let p of c)if(p.nodeName=="BR"&&p.parentNode){let u=p.nextSibling;for(;u&&u.nodeType==1;){if(u.contentEditable=="false"){p.parentNode.removeChild(p);break}u=u.firstChild}}}else if(wn&&c.length){let p=c.filter(u=>u.nodeName=="BR");if(p.length==2){let[u,f]=p;u.parentNode&&u.parentNode.parentNode==f.parentNode?f.remove():u.remove()}else{let{focusNode:u}=this.currentSelection;for(let f of p){let h=f.parentNode;h&&h.nodeName=="LI"&&(!u||dV(t,u)!=h)&&f.remove()}}}let d=null;r<0&&s&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Ti(o)&&(d=wp(t))&&d.eq(Rt.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Eo(t),this.currentSelection.set(o),t.scrollToSelection()):(r>-1||s)&&(r>-1&&(t.docView.markDirty(r,a),iV(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,pV(t,c)),this.handleDOMChange(r,a,i,c),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(o)||Eo(t),this.currentSelection.set(o))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let o=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(o==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!o||o.ignoreMutation(t))return null;if(t.type=="childList"){for(let p=0;p<t.addedNodes.length;p++){let u=t.addedNodes[p];e.push(u),u.nodeType==3&&(this.lastChangedTextNode=u)}if(o.contentDOM&&o.contentDOM!=o.dom&&!o.contentDOM.contains(t.target))return{from:o.posBefore,to:o.posAfter};let s=t.previousSibling,r=t.nextSibling;if(Qe&&tl<=11&&t.addedNodes.length)for(let p=0;p<t.addedNodes.length;p++){let{previousSibling:u,nextSibling:f}=t.addedNodes[p];(!u||Array.prototype.indexOf.call(t.addedNodes,u)<0)&&(s=u),(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(r=f)}let a=s&&s.parentNode==t.target?Oe(s)+1:0,i=o.localPosFromDOM(t.target,a,-1),c=r&&r.parentNode==t.target?Oe(r):t.target.childNodes.length,d=o.localPosFromDOM(t.target,c,1);return{from:i,to:d}}else return t.type=="attributes"?{from:o.posAtStart-o.border,to:o.posAtEnd+o.border}:(this.lastChangedTextNode=t.target,{from:o.posAtStart,to:o.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let ry=new WeakMap,ay=!1;function iV(n){if(!ry.has(n)&&(ry.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=wn,ay)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),ay=!0}}function iy(n,t){let e=t.startContainer,o=t.startOffset,s=t.endContainer,r=t.endOffset,a=n.domAtPos(n.state.selection.anchor);return Vl(a.node,a.offset,s,r)&&([e,o,s,r]=[s,r,e,o]),{anchorNode:e,anchorOffset:o,focusNode:s,focusOffset:r}}function cV(n,t){if(t.getComposedRanges){let s=t.getComposedRanges(n.root)[0];if(s)return iy(n,s)}let e;function o(s){s.preventDefault(),s.stopImmediatePropagation(),e=s.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",o,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",o,!0),e?iy(n,e):null}function dV(n,t){for(let e=t.parentNode;e&&e!=n.dom;e=e.parentNode){let o=n.docView.nearestDesc(e,!0);if(o&&o.node.isBlock)return e}return null}function pV(n,t){var e;let{focusNode:o,focusOffset:s}=n.domSelectionRange();for(let r of t)if(((e=r.parentNode)===null||e===void 0?void 0:e.nodeName)=="TR"){let a=r.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let i=a;for(;;){let c=i.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;i=c}i.insertBefore(r,i.firstChild),o==r&&n.domSelection().collapse(r,s)}else r.parentNode.removeChild(r)}}function uV(n,t,e){let{node:o,fromOffset:s,toOffset:r,from:a,to:i}=n.docView.parseRange(t,e),c=n.domSelectionRange(),d,p=c.anchorNode;if(p&&n.dom.contains(p.nodeType==1?p:p.parentNode)&&(d=[{node:p,offset:c.anchorOffset}],Ti(c)||d.push({node:c.focusNode,offset:c.focusOffset})),De&&n.input.lastKeyCode===8)for(let v=r;v>s;v--){let y=o.childNodes[v-1],k=y.pmViewDesc;if(y.nodeName=="BR"&&!k){r=v;break}if(!k||k.size)break}let u=n.state.doc,f=n.someProp("domParser")||bo.fromSchema(n.state.schema),h=u.resolve(a),m=null,g=f.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:s,to:r,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:fV,context:h});if(d&&d[0].pos!=null){let v=d[0].pos,y=d[1]&&d[1].pos;y==null&&(y=v),m={anchor:v+a,head:y+a}}return{doc:g,sel:m,from:a,to:i}}function fV(n){let t=n.pmViewDesc;if(t)return t.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Pe&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(n.parentNode.lastChild==n||Pe&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const hV=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function mV(n,t,e,o,s){let r=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,t<0){let E=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,B=wp(n,E);if(B&&!n.state.selection.eq(B)){if(De&&wo&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",D=>D(n,Al(13,"Enter"))))return;let C=n.state.tr.setSelection(B);E=="pointer"?C.setMeta("pointer",!0):E=="key"&&C.scrollIntoView(),r&&C.setMeta("composition",r),n.dispatch(C)}return}let a=n.state.doc.resolve(t),i=a.sharedDepth(e);t=a.before(i+1),e=n.state.doc.resolve(e).after(i+1);let c=n.state.selection,d=uV(n,t,e),p=n.state.doc,u=p.slice(d.from,d.to),f,h;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(f=n.state.selection.to,h="end"):(f=n.state.selection.from,h="start"),n.input.lastKeyCode=null;let m=yV(u.content,d.doc.content,d.from,f,h);if(m&&n.input.domChangeCount++,(bs&&n.input.lastIOSEnter>Date.now()-225||wo)&&s.some(E=>E.nodeType==1&&!hV.test(E.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",E=>E(n,Al(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(o&&c instanceof Et&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let E=cy(n,n.state.doc,d.sel);if(E&&!E.eq(n.state.selection)){let B=n.state.tr.setSelection(E);r&&B.setMeta("composition",r),n.dispatch(B)}}return}n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof Et&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),Qe&&tl<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),v=d.doc.resolveNoCache(m.endB-d.from),y=p.resolve(m.start),k=g.sameParent(v)&&g.parent.inlineContent&&y.end()>=m.endA;if((bs&&n.input.lastIOSEnter>Date.now()-225&&(!k||s.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!k&&g.pos<d.doc.content.size&&(!g.sameParent(v)||!g.parent.inlineContent)&&g.pos<v.pos&&!/\S/.test(d.doc.textBetween(g.pos,v.pos,"","")))&&n.someProp("handleKeyDown",E=>E(n,Al(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&vV(p,m.start,m.endA,g,v)&&n.someProp("handleKeyDown",E=>E(n,Al(8,"Backspace")))){wo&&De&&n.domObserver.suppressSelectionUpdates();return}De&&m.endB==m.start&&(n.input.lastChromeDelete=Date.now()),wo&&!k&&g.start()!=v.start()&&v.parentOffset==0&&g.depth==v.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,v=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(E){return E(n,Al(13,"Enter"))})},20));let S=m.start,b=m.endA,w=E=>{let B=E||n.state.tr.replace(S,b,d.doc.slice(m.start-d.from,m.endB-d.from));if(d.sel){let C=cy(n,B.doc,d.sel);C&&!(De&&n.composing&&C.empty&&(m.start!=m.endB||n.input.lastChromeDelete<Date.now()-100)&&(C.head==S||C.head==B.mapping.map(b)-1)||Qe&&C.empty&&C.head==S)&&B.setSelection(C)}return r&&B.setMeta("composition",r),B.scrollIntoView()},x;if(k)if(g.pos==v.pos){Qe&&tl<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Eo(n),20));let E=w(n.state.tr.delete(S,b)),B=p.resolve(m.start).marksAcross(p.resolve(m.endA));B&&E.ensureMarks(B),n.dispatch(E)}else if(m.endA==m.endB&&(x=gV(g.parent.content.cut(g.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let E=w(n.state.tr);x.type=="add"?E.addMark(S,b,x.mark):E.removeMark(S,b,x.mark),n.dispatch(E)}else if(g.parent.child(g.index()).isText&&g.index()==v.index()-(v.textOffset?0:1)){let E=g.parent.textBetween(g.parentOffset,v.parentOffset),B=()=>w(n.state.tr.insertText(E,S,b));n.someProp("handleTextInput",C=>C(n,S,b,E,B))||n.dispatch(B())}else n.dispatch(w());else n.dispatch(w())}function cy(n,t,e){return Math.max(e.anchor,e.head)>t.content.size?null:Ep(n,t.resolve(e.anchor),t.resolve(e.head))}function gV(n,t){let e=n.firstChild.marks,o=t.firstChild.marks,s=e,r=o,a,i,c;for(let p=0;p<o.length;p++)s=o[p].removeFromSet(s);for(let p=0;p<e.length;p++)r=e[p].removeFromSet(r);if(s.length==1&&r.length==0)i=s[0],a="add",c=p=>p.mark(i.addToSet(p.marks));else if(s.length==0&&r.length==1)i=r[0],a="remove",c=p=>p.mark(i.removeFromSet(p.marks));else return null;let d=[];for(let p=0;p<t.childCount;p++)d.push(c(t.child(p)));if(G.from(d).eq(n))return{mark:i,type:a}}function vV(n,t,e,o,s){if(e-t<=s.pos-o.pos||Pp(o,!0,!1)<s.pos)return!1;let r=n.resolve(t);if(!o.parent.isTextblock){let i=r.nodeAfter;return i!=null&&e==t+i.nodeSize}if(r.parentOffset<r.parent.content.size||!r.parent.isTextblock)return!1;let a=n.resolve(Pp(r,!0,!0));return!a.parent.isTextblock||a.pos>e||Pp(a,!0,!1)<e?!1:o.parent.content.cut(o.parentOffset).eq(a.parent.content)}function Pp(n,t,e){let o=n.depth,s=t?n.end():n.pos;for(;o>0&&(t||n.indexAfter(o)==n.node(o).childCount);)o--,s++,t=!1;if(e){let r=n.node(o).maybeChild(n.indexAfter(o));for(;r&&!r.isLeaf;)r=r.firstChild,s++}return s}function yV(n,t,e,o,s){let r=n.findDiffStart(t,e);if(r==null)return null;let{a,b:i}=n.findDiffEnd(t,e+n.size,e+t.size);if(s=="end"){let c=Math.max(0,r-Math.min(a,i));o-=a+c-r}if(a<r&&n.size<t.size){let c=o<=r&&o>=a?r-o:0;r-=c,r&&r<t.size&&dy(t.textBetween(r-1,r+1))&&(r+=c?1:-1),i=r+(i-a),a=r}else if(i<r){let c=o<=r&&o>=i?r-o:0;r-=c,r&&r<n.size&&dy(n.textBetween(r-1,r+1))&&(r+=c?1:-1),a=r+(a-i),i=r}return{start:r,endA:a,endB:i}}function dy(n){if(n.length!=2)return!1;let t=n.charCodeAt(0),e=n.charCodeAt(1);return t>=56320&&t<=57343&&e>=55296&&e<=56319}class py{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ID,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(gy),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=hy(this),fy(this),this.nodeViews=my(this),this.docView=xv(this.state.doc,uy(this),zp(this),this.dom,this),this.domObserver=new aV(this,(o,s,r,a)=>mV(this,o,s,r,a)),this.domObserver.start(),RD(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Op(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(gy),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let o in this._props)e[o]=this._props[o];e.state=this.state;for(let o in t)e[o]=t[o];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var o;let s=this.state,r=!1,a=!1;t.storedMarks&&this.composing&&(qv(this),a=!0),this.state=t;let i=s.plugins!=t.plugins||this._props.plugins!=e.plugins;if(i||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let h=my(this);kV(h,this.nodeViews)&&(this.nodeViews=h,r=!0)}(i||e.handleDOMEvents!=this._props.handleDOMEvents)&&Op(this),this.editable=hy(this),fy(this);let c=zp(this),d=uy(this),p=s.plugins!=t.plugins&&!s.doc.eq(t.doc)?"reset":t.scrollToSelection>s.scrollToSelection?"to selection":"preserve",u=r||!this.docView.matchesNode(t.doc,d,c);(u||!t.selection.eq(s.selection))&&(a=!0);let f=p=="preserve"&&a&&this.dom.style.overflowAnchor==null&&X4(this);if(a){this.domObserver.stop();let h=u&&(Qe||De)&&!this.composing&&!s.selection.empty&&!t.selection.empty&&bV(s.selection,t.selection);if(u){let m=De?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=XD(this)),(r||!this.docView.update(t.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=xv(t.doc,d,c,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&bD(this))?Eo(this,h):(Dv(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((o=this.dragging)===null||o===void 0)&&o.node&&!s.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,s),p=="reset"?this.dom.scrollTop=0:p=="to selection"?this.scrollToSelection():f&&Z4(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",e=>e(this)))if(this.state.selection instanceof vt){let e=this.docView.domAfterPos(this.state.selection.from);e.nodeType==1&&iv(this,e.getBoundingClientRect(),t)}else iv(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let o=this.directPlugins[e];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let o=this.state.plugins[e];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}else for(let e=0;e<this.pluginViews.length;e++){let o=this.pluginViews[e];o.update&&o.update(this,t)}}updateDraggedNode(t,e){let o=t.node,s=-1;if(o.from<this.state.doc.content.size&&this.state.doc.nodeAt(o.from)==o.node)s=o.from;else{let r=o.from+(this.state.doc.content.size-e.doc.content.size);(r>0&&r<this.state.doc.content.size&&this.state.doc.nodeAt(r))==o.node&&(s=r)}this.dragging=new ty(t.slice,t.move,s<0?void 0:vt.create(this.state.doc,s))}someProp(t,e){let o=this._props&&this._props[t],s;if(o!=null&&(s=e?e(o):o))return s;for(let a=0;a<this.directPlugins.length;a++){let i=this.directPlugins[a].props[t];if(i!=null&&(s=e?e(i):i))return s}let r=this.state.plugins;if(r)for(let a=0;a<r.length;a++){let i=r[a].props[t];if(i!=null&&(s=e?e(i):i))return s}}hasFocus(){if(Qe){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Q4(this.dom),Eo(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return t||document}updateRoot(){this._root=null}posAtCoords(t){return nD(this,t)}coordsAtPos(t,e=1){return hv(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,o=-1){let s=this.docView.posFromDOM(t,e,o);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(t,e){return aD(this,e||this.state,t)}pasteHTML(t,e){return Rr(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Rr(this,t,null,!0,e||new ClipboardEvent("paste"))}serializeForClipboard(t){return Np(this,t)}destroy(){this.docView&&(zD(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],zp(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,F4())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return LD(this,t)}domSelectionRange(){let t=this.domSelection();return t?Pe&&this.root.nodeType===11&&K4(this.dom.ownerDocument)==this.dom&&cV(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}py.prototype.dispatch=function(n){let t=this._props.dispatchTransaction;t?t.call(this,n):this.updateState(this.state.apply(n))};function uy(n){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(n.editable),n.someProp("attributes",e=>{if(typeof e=="function"&&(e=e(n.state)),e)for(let o in e)o=="class"?t.class+=" "+e[o]:o=="style"?t.style=(t.style?t.style+";":"")+e[o]:!t[o]&&o!="contenteditable"&&o!="nodeName"&&(t[o]=String(e[o]))}),t.translate||(t.translate="no"),[Cn.node(0,n.state.doc.content.size,t)]}function fy(n){if(n.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),n.cursorWrapper={dom:t,deco:Cn.widget(n.state.selection.from,t,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function hy(n){return!n.someProp("editable",t=>t(n.state)===!1)}function bV(n,t){let e=Math.min(n.$anchor.sharedDepth(n.head),t.$anchor.sharedDepth(t.head));return n.$anchor.start(e)!=t.$anchor.start(e)}function my(n){let t=Object.create(null);function e(o){for(let s in o)Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o[s])}return n.someProp("nodeViews",e),n.someProp("markViews",e),t}function kV(n,t){let e=0,o=0;for(let s in n){if(n[s]!=t[s])return!0;e++}for(let s in t)o++;return e!=o}function gy(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var al={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ii={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xV=typeof navigator<"u"&&/Mac/.test(navigator.platform),wV=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ve=0;Ve<10;Ve++)al[48+Ve]=al[96+Ve]=String(Ve);for(var Ve=1;Ve<=24;Ve++)al[Ve+111]="F"+Ve;for(var Ve=65;Ve<=90;Ve++)al[Ve]=String.fromCharCode(Ve+32),Ii[Ve]=String.fromCharCode(Ve);for(var Lp in al)Ii.hasOwnProperty(Lp)||(Ii[Lp]=al[Lp]);function SV(n){var t=xV&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||wV&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",e=!t&&n.key||(n.shiftKey?Ii:al)[n.keyCode]||n.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}const EV=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),CV=typeof navigator<"u"&&/Win/.test(navigator.platform);function TV(n){let t=n.split(/-(?!$)/),e=t[t.length-1];e=="Space"&&(e=" ");let o,s,r,a;for(let i=0;i<t.length-1;i++){let c=t[i];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))o=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))r=!0;else if(/^mod$/i.test(c))EV?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return o&&(e="Alt-"+e),s&&(e="Ctrl-"+e),a&&(e="Meta-"+e),r&&(e="Shift-"+e),e}function NV(n){let t=Object.create(null);for(let e in n)t[TV(e)]=n[e];return t}function Fp(n,t,e=!0){return t.altKey&&(n="Alt-"+n),t.ctrlKey&&(n="Ctrl-"+n),t.metaKey&&(n="Meta-"+n),e&&t.shiftKey&&(n="Shift-"+n),n}function MV(n){return new he({props:{handleKeyDown:vy(n)}})}function vy(n){let t=NV(n);return function(e,o){let s=SV(o),r,a=t[Fp(s,o)];if(a&&a(e.state,e.dispatch,e))return!0;if(s.length==1&&s!=" "){if(o.shiftKey){let i=t[Fp(s,o,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((o.altKey||o.metaKey||o.ctrlKey)&&!(CV&&o.ctrlKey&&o.altKey)&&(r=al[o.keyCode])&&r!=s){let i=t[Fp(r,o)];if(i&&i(e.state,e.dispatch,e))return!0}}return!1}}const jp=(n,t)=>n.selection.empty?!1:(t&&t(n.tr.deleteSelection().scrollIntoView()),!0);function yy(n,t){let{$cursor:e}=n.selection;return!e||(t?!t.endOfTextblock("backward",n):e.parentOffset>0)?null:e}const by=(n,t,e)=>{let o=yy(n,e);if(!o)return!1;let s=Hp(o);if(!s){let a=o.blockRange(),i=a&&fs(a);return i==null?!1:(t&&t(n.tr.lift(a,i).scrollIntoView()),!0)}let r=s.nodeBefore;if(My(n,s,t,-1))return!0;if(o.parent.content.size==0&&(Es(r,"end")||vt.isSelectable(r)))for(let a=o.depth;;a--){let i=Si(n.doc,o.before(a),o.after(a),rt.empty);if(i&&i.slice.size<i.to-i.from){if(t){let c=n.tr.step(i);c.setSelection(Es(r,"end")?Rt.findFrom(c.doc.resolve(c.mapping.map(s.pos,-1)),-1):vt.create(c.doc,s.pos-r.nodeSize)),t(c.scrollIntoView())}return!0}if(a==1||o.node(a-1).childCount>1)break}return r.isAtom&&s.depth==o.depth-1?(t&&t(n.tr.delete(s.pos-r.nodeSize,s.pos).scrollIntoView()),!0):!1},BV=(n,t,e)=>{let o=yy(n,e);if(!o)return!1;let s=Hp(o);return s?ky(n,s,t):!1},OV=(n,t,e)=>{let o=wy(n,e);if(!o)return!1;let s=Up(o);return s?ky(n,s,t):!1};function ky(n,t,e){let o=t.nodeBefore,s=o,r=t.pos-1;for(;!s.isTextblock;r--){if(s.type.spec.isolating)return!1;let p=s.lastChild;if(!p)return!1;s=p}let a=t.nodeAfter,i=a,c=t.pos+1;for(;!i.isTextblock;c++){if(i.type.spec.isolating)return!1;let p=i.firstChild;if(!p)return!1;i=p}let d=Si(n.doc,r,c,rt.empty);if(!d||d.from!=r||d instanceof be&&d.slice.size>=c-r)return!1;if(e){let p=n.tr.step(d);p.setSelection(Et.create(p.doc,r)),e(p.scrollIntoView())}return!0}function Es(n,t,e=!1){for(let o=n;o;o=t=="start"?o.firstChild:o.lastChild){if(o.isTextblock)return!0;if(e&&o.childCount!=1)return!1}return!1}const xy=(n,t,e)=>{let{$head:o,empty:s}=n.selection,r=o;if(!s)return!1;if(o.parent.isTextblock){if(e?!e.endOfTextblock("backward",n):o.parentOffset>0)return!1;r=Hp(o)}let a=r&&r.nodeBefore;return!a||!vt.isSelectable(a)?!1:(t&&t(n.tr.setSelection(vt.create(n.doc,r.pos-a.nodeSize)).scrollIntoView()),!0)};function Hp(n){if(!n.parent.type.spec.isolating)for(let t=n.depth-1;t>=0;t--){if(n.index(t)>0)return n.doc.resolve(n.before(t+1));if(n.node(t).type.spec.isolating)break}return null}function wy(n,t){let{$cursor:e}=n.selection;return!e||(t?!t.endOfTextblock("forward",n):e.parentOffset<e.parent.content.size)?null:e}const Sy=(n,t,e)=>{let o=wy(n,e);if(!o)return!1;let s=Up(o);if(!s)return!1;let r=s.nodeAfter;if(My(n,s,t,1))return!0;if(o.parent.content.size==0&&(Es(r,"start")||vt.isSelectable(r))){let a=Si(n.doc,o.before(),o.after(),rt.empty);if(a&&a.slice.size<a.to-a.from){if(t){let i=n.tr.step(a);i.setSelection(Es(r,"start")?Rt.findFrom(i.doc.resolve(i.mapping.map(s.pos)),1):vt.create(i.doc,i.mapping.map(s.pos))),t(i.scrollIntoView())}return!0}}return r.isAtom&&s.depth==o.depth-1?(t&&t(n.tr.delete(s.pos,s.pos+r.nodeSize).scrollIntoView()),!0):!1},Ey=(n,t,e)=>{let{$head:o,empty:s}=n.selection,r=o;if(!s)return!1;if(o.parent.isTextblock){if(e?!e.endOfTextblock("forward",n):o.parentOffset<o.parent.content.size)return!1;r=Up(o)}let a=r&&r.nodeAfter;return!a||!vt.isSelectable(a)?!1:(t&&t(n.tr.setSelection(vt.create(n.doc,r.pos)).scrollIntoView()),!0)};function Up(n){if(!n.parent.type.spec.isolating)for(let t=n.depth-1;t>=0;t--){let e=n.node(t);if(n.index(t)+1<e.childCount)return n.doc.resolve(n.after(t+1));if(e.type.spec.isolating)break}return null}const DV=(n,t)=>{let e=n.selection,o=e instanceof vt,s;if(o){if(e.node.isTextblock||!qo(n.doc,e.from))return!1;s=e.from}else if(s=wi(n.doc,e.from,-1),s==null)return!1;if(t){let r=n.tr.join(s);o&&r.setSelection(vt.create(r.doc,s-n.doc.resolve(s).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0},VV=(n,t)=>{let e=n.selection,o;if(e instanceof vt){if(e.node.isTextblock||!qo(n.doc,e.to))return!1;o=e.to}else if(o=wi(n.doc,e.to,1),o==null)return!1;return t&&t(n.tr.join(o).scrollIntoView()),!0},AV=(n,t)=>{let{$from:e,$to:o}=n.selection,s=e.blockRange(o),r=s&&fs(s);return r==null?!1:(t&&t(n.tr.lift(s,r).scrollIntoView()),!0)},Cy=(n,t)=>{let{$head:e,$anchor:o}=n.selection;return!e.parent.type.spec.code||!e.sameParent(o)?!1:(t&&t(n.tr.insertText(`
486
+ `).scrollIntoView()),!0)};function Wp(n){for(let t=0;t<n.edgeCount;t++){let{type:e}=n.edge(t);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}const IV=(n,t)=>{let{$head:e,$anchor:o}=n.selection;if(!e.parent.type.spec.code||!e.sameParent(o))return!1;let s=e.node(-1),r=e.indexAfter(-1),a=Wp(s.contentMatchAt(r));if(!a||!s.canReplaceWith(r,r,a))return!1;if(t){let i=e.after(),c=n.tr.replaceWith(i,i,a.createAndFill());c.setSelection(Rt.near(c.doc.resolve(i),1)),t(c.scrollIntoView())}return!0},Ty=(n,t)=>{let e=n.selection,{$from:o,$to:s}=e;if(e instanceof pn||o.parent.inlineContent||s.parent.inlineContent)return!1;let r=Wp(s.parent.contentMatchAt(s.indexAfter()));if(!r||!r.isTextblock)return!1;if(t){let a=(!o.parentOffset&&s.index()<s.parent.childCount?o:s).pos,i=n.tr.insert(a,r.createAndFill());i.setSelection(Et.create(i.doc,a+1)),t(i.scrollIntoView())}return!0},Ny=(n,t)=>{let{$cursor:e}=n.selection;if(!e||e.parent.content.size)return!1;if(e.depth>1&&e.after()!=e.end(-1)){let r=e.before();if(ko(n.doc,r))return t&&t(n.tr.split(r).scrollIntoView()),!0}let o=e.blockRange(),s=o&&fs(o);return s==null?!1:(t&&t(n.tr.lift(o,s).scrollIntoView()),!0)};function RV(n){return(t,e)=>{let{$from:o,$to:s}=t.selection;if(t.selection instanceof vt&&t.selection.node.isBlock)return!o.parentOffset||!ko(t.doc,o.pos)?!1:(e&&e(t.tr.split(o.pos).scrollIntoView()),!0);if(!o.depth)return!1;let r=[],a,i,c=!1,d=!1;for(let h=o.depth;;h--)if(o.node(h).isBlock){c=o.end(h)==o.pos+(o.depth-h),d=o.start(h)==o.pos-(o.depth-h),i=Wp(o.node(h-1).contentMatchAt(o.indexAfter(h-1))),r.unshift(c&&i?{type:i}:null),a=h;break}else{if(h==1)return!1;r.unshift(null)}let p=t.tr;(t.selection instanceof Et||t.selection instanceof pn)&&p.deleteSelection();let u=p.mapping.map(o.pos),f=ko(p.doc,u,r.length,r);if(f||(r[0]=i?{type:i}:null,f=ko(p.doc,u,r.length,r)),!f)return!1;if(p.split(u,r.length,r),!c&&d&&o.node(a).type!=i){let h=p.mapping.map(o.before(a)),m=p.doc.resolve(h);i&&o.node(a-1).canReplaceWith(m.index(),m.index()+1,i)&&p.setNodeMarkup(p.mapping.map(o.before(a)),i)}return e&&e(p.scrollIntoView()),!0}}const zV=RV(),PV=(n,t)=>{let{$from:e,to:o}=n.selection,s,r=e.sharedDepth(o);return r==0?!1:(s=e.before(r),t&&t(n.tr.setSelection(vt.create(n.doc,s))),!0)};function LV(n,t,e){let o=t.nodeBefore,s=t.nodeAfter,r=t.index();return!o||!s||!o.type.compatibleContent(s.type)?!1:!o.content.size&&t.parent.canReplace(r-1,r)?(e&&e(n.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(r,r+1)||!(s.isTextblock||qo(n.doc,t.pos))?!1:(e&&e(n.tr.join(t.pos).scrollIntoView()),!0)}function My(n,t,e,o){let s=t.nodeBefore,r=t.nodeAfter,a,i,c=s.type.spec.isolating||r.type.spec.isolating;if(!c&&LV(n,t,e))return!0;let d=!c&&t.parent.canReplace(t.index(),t.index()+1);if(d&&(a=(i=s.contentMatchAt(s.childCount)).findWrapping(r.type))&&i.matchType(a[0]||r.type).validEnd){if(e){let h=t.pos+r.nodeSize,m=G.empty;for(let y=a.length-1;y>=0;y--)m=G.from(a[y].create(null,m));m=G.from(s.copy(m));let g=n.tr.step(new ke(t.pos-1,h,t.pos,h,new rt(m,1,0),a.length,!0)),v=g.doc.resolve(h+2*a.length);v.nodeAfter&&v.nodeAfter.type==s.type&&qo(g.doc,v.pos)&&g.join(v.pos),e(g.scrollIntoView())}return!0}let p=r.type.spec.isolating||o>0&&c?null:Rt.findFrom(t,1),u=p&&p.$from.blockRange(p.$to),f=u&&fs(u);if(f!=null&&f>=t.depth)return e&&e(n.tr.lift(u,f).scrollIntoView()),!0;if(d&&Es(r,"start",!0)&&Es(s,"end")){let h=s,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let g=r,v=1;for(;!g.isTextblock;g=g.firstChild)v++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(e){let y=G.empty;for(let S=m.length-1;S>=0;S--)y=G.from(m[S].copy(y));let k=n.tr.step(new ke(t.pos-m.length,t.pos+r.nodeSize,t.pos+v,t.pos+r.nodeSize-v,new rt(y,m.length,0),0,!0));e(k.scrollIntoView())}return!0}}return!1}function By(n){return function(t,e){let o=t.selection,s=n<0?o.$from:o.$to,r=s.depth;for(;s.node(r).isInline;){if(!r)return!1;r--}return s.node(r).isTextblock?(e&&e(t.tr.setSelection(Et.create(t.doc,n<0?s.start(r):s.end(r)))),!0):!1}}const FV=By(-1),jV=By(1);function HV(n,t=null){return function(e,o){let{$from:s,$to:r}=e.selection,a=s.blockRange(r),i=a&&ap(a,n,t);return i?(o&&o(e.tr.wrap(a,i).scrollIntoView()),!0):!1}}function Oy(n,t=null){return function(e,o){let s=!1;for(let r=0;r<e.selection.ranges.length&&!s;r++){let{$from:{pos:a},$to:{pos:i}}=e.selection.ranges[r];e.doc.nodesBetween(a,i,(c,d)=>{if(s)return!1;if(!(!c.isTextblock||c.hasMarkup(n,t)))if(c.type==n)s=!0;else{let p=e.doc.resolve(d),u=p.index();s=p.parent.canReplaceWith(u,u+1,n)}})}if(!s)return!1;if(o){let r=e.tr;for(let a=0;a<e.selection.ranges.length;a++){let{$from:{pos:i},$to:{pos:c}}=e.selection.ranges[a];r.setBlockType(i,c,n,t)}o(r.scrollIntoView())}return!0}}function Kp(...n){return function(t,e,o){for(let s=0;s<n.length;s++)if(n[s](t,e,o))return!0;return!1}}Kp(jp,by,xy),Kp(jp,Sy,Ey),Kp(Cy,Ty,Ny,zV),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function UV(n,t=null){return function(e,o){let{$from:s,$to:r}=e.selection,a=s.blockRange(r);if(!a)return!1;let i=o?e.tr:null;return WV(i,a,n,t)?(o&&o(i.scrollIntoView()),!0):!1}}function WV(n,t,e,o=null){let s=!1,r=t,a=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(e)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=a.resolve(t.start-2);r=new gi(c,c,t.depth),t.endIndex<t.parent.childCount&&(t=new gi(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),s=!0}let i=ap(r,e,o,t);return i?(n&&KV(n,t,i,s,e),!0):!1}function KV(n,t,e,o,s){let r=G.empty;for(let p=e.length-1;p>=0;p--)r=G.from(e[p].type.create(e[p].attrs,r));n.step(new ke(t.start-(o?2:0),t.end,t.start,t.end,new rt(r,0,0),e.length,!0));let a=0;for(let p=0;p<e.length;p++)e[p].type==s&&(a=p+1);let i=e.length-a,c=t.start+e.length-(o?2:0),d=t.parent;for(let p=t.startIndex,u=t.endIndex,f=!0;p<u;p++,f=!1)!f&&ko(n.doc,c,i)&&(n.split(c,i),c+=2*i),c+=d.child(p).nodeSize;return n}function _V(n){return function(t,e){let{$from:o,$to:s}=t.selection,r=o.blockRange(s,a=>a.childCount>0&&a.firstChild.type==n);return r?e?o.node(r.depth-1).type==n?GV(t,e,n,r):JV(t,e,r):!0:!1}}function GV(n,t,e,o){let s=n.tr,r=o.end,a=o.$to.end(o.depth);r<a&&(s.step(new ke(r-1,a,r,a,new rt(G.from(e.create(null,o.parent.copy())),1,0),1,!0)),o=new gi(s.doc.resolve(o.$from.pos),s.doc.resolve(a),o.depth));const i=fs(o);if(i==null)return!1;s.lift(o,i);let c=s.doc.resolve(s.mapping.map(r,-1)-1);return qo(s.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&s.join(c.pos),t(s.scrollIntoView()),!0}function JV(n,t,e){let o=n.tr,s=e.parent;for(let h=e.end,m=e.endIndex-1,g=e.startIndex;m>g;m--)h-=s.child(m).nodeSize,o.delete(h-1,h+1);let r=o.doc.resolve(e.start),a=r.nodeAfter;if(o.mapping.map(e.end)!=e.start+r.nodeAfter.nodeSize)return!1;let i=e.startIndex==0,c=e.endIndex==s.childCount,d=r.node(-1),p=r.index(-1);if(!d.canReplace(p+(i?0:1),p+1,a.content.append(c?G.empty:G.from(s))))return!1;let u=r.pos,f=u+a.nodeSize;return o.step(new ke(u-(i?1:0),f+(c?1:0),u+1,f-1,new rt((i?G.empty:G.from(s.copy(G.empty))).append(c?G.empty:G.from(s.copy(G.empty))),i?0:1,c?0:1),i?0:1)),t(o.scrollIntoView()),!0}function YV(n){return function(t,e){let{$from:o,$to:s}=t.selection,r=o.blockRange(s,d=>d.childCount>0&&d.firstChild.type==n);if(!r)return!1;let a=r.startIndex;if(a==0)return!1;let i=r.parent,c=i.child(a-1);if(c.type!=n)return!1;if(e){let d=c.lastChild&&c.lastChild.type==i.type,p=G.from(d?n.create():null),u=new rt(G.from(n.create(null,G.from(i.type.create(null,p)))),d?3:1,0),f=r.start,h=r.end;e(t.tr.step(new ke(f-(d?3:1),h,f,h,u,1,!0)).scrollIntoView())}return!0}}function Cs(n){const{state:t,transaction:e}=n;let{selection:o}=e,{doc:s}=e,{storedMarks:r}=e;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return r},get selection(){return o},get doc(){return s},get tr(){return o=e.selection,s=e.doc,r=e.storedMarks,e}}}class Ts{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:o}=this,{view:s}=e,{tr:r}=o,a=this.buildProps(r);return Object.fromEntries(Object.entries(t).map(([i,c])=>[i,(...p)=>{const u=c(...p)(a);return!r.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(r),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:o,editor:s,state:r}=this,{view:a}=s,i=[],c=!!t,d=t||r.tr,p=()=>(!c&&e&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(d),i.every(f=>f===!0)),u={...Object.fromEntries(Object.entries(o).map(([f,h])=>[f,(...g)=>{const v=this.buildProps(d,e),y=h(...g)(v);return i.push(y),u}])),run:p};return u}createCan(t){const{rawCommands:e,state:o}=this,s=!1,r=t||o.tr,a=this.buildProps(r,s);return{...Object.fromEntries(Object.entries(e).map(([c,d])=>[c,(...p)=>d(...p)({...a,dispatch:void 0})])),chain:()=>this.createChain(r,s)}}buildProps(t,e=!0){const{rawCommands:o,editor:s,state:r}=this,{view:a}=s,i={tr:t,editor:s,view:a,state:Cs({state:r,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(o).map(([c,d])=>[c,(...p)=>d(...p)(i)]))}};return i}}class XV{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const o=this.callbacks[t];return o&&o.forEach(s=>s.apply(this,e)),this}off(t,e){const o=this.callbacks[t];return o&&(e?this.callbacks[t]=o.filter(s=>s!==e):delete this.callbacks[t]),this}once(t,e){const o=(...s)=>{this.off(t,o),e.apply(this,s)};return this.on(t,o)}removeAllListeners(){this.callbacks={}}}function ct(n,t,e){return n.config[t]===void 0&&n.parent?ct(n.parent,t,e):typeof n.config[t]=="function"?n.config[t].bind({...e,parent:n.parent?ct(n.parent,t,e):null}):n.config[t]}function Ns(n){const t=n.filter(s=>s.type==="extension"),e=n.filter(s=>s.type==="node"),o=n.filter(s=>s.type==="mark");return{baseExtensions:t,nodeExtensions:e,markExtensions:o}}function Ri(n){const t=[],{nodeExtensions:e,markExtensions:o}=Ns(n),s=[...e,...o],r={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const i={name:a.name,options:a.options,storage:a.storage,extensions:s},c=ct(a,"addGlobalAttributes",i);if(!c)return;c().forEach(p=>{p.types.forEach(u=>{Object.entries(p.attributes).forEach(([f,h])=>{t.push({type:u,name:f,attribute:{...r,...h}})})})})}),s.forEach(a=>{const i={name:a.name,options:a.options,storage:a.storage},c=ct(a,"addAttributes",i);if(!c)return;const d=c();Object.entries(d).forEach(([p,u])=>{const f={...r,...u};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,t.push({type:a.name,name:p,attribute:f})})}),t}function de(n,t){if(typeof n=="string"){if(!t.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return t.nodes[n]}return n}function qt(...n){return n.filter(t=>!!t).reduce((t,e)=>{const o={...t};return Object.entries(e).forEach(([s,r])=>{if(!o[s]){o[s]=r;return}if(s==="class"){const i=r?String(r).split(" "):[],c=o[s]?o[s].split(" "):[],d=i.filter(p=>!c.includes(p));o[s]=[...c,...d].join(" ")}else if(s==="style"){const i=r?r.split(";").map(p=>p.trim()).filter(Boolean):[],c=o[s]?o[s].split(";").map(p=>p.trim()).filter(Boolean):[],d=new Map;c.forEach(p=>{const[u,f]=p.split(":").map(h=>h.trim());d.set(u,f)}),i.forEach(p=>{const[u,f]=p.split(":").map(h=>h.trim());d.set(u,f)}),o[s]=Array.from(d.entries()).map(([p,u])=>`${p}: ${u}`).join("; ")}else o[s]=r}),o},{})}function Pr(n,t){return t.filter(e=>e.type===n.type.name).filter(e=>e.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(n.attrs)||{}:{[e.name]:n.attrs[e.name]}).reduce((e,o)=>qt(e,o),{})}function zi(n){return typeof n=="function"}function Mt(n,t=void 0,...e){return zi(n)?t?n.bind(t)(...e):n(...e):n}function _p(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Gp(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Pi(n,t){return"style"in n?n:{...n,getAttrs:e=>{const o=n.getAttrs?n.getAttrs(e):n.attrs;if(o===!1)return!1;const s=t.reduce((r,a)=>{const i=a.attribute.parseHTML?a.attribute.parseHTML(e):Gp(e.getAttribute(a.name));return i==null?r:{...r,[a.name]:i}},{});return{...o,...s}}}}function Dy(n){return Object.fromEntries(Object.entries(n).filter(([t,e])=>t==="attrs"&&_p(e)?!1:e!=null))}function Li(n,t){var e;const o=Ri(n),{nodeExtensions:s,markExtensions:r}=Ns(n),a=(e=s.find(d=>ct(d,"topNode")))===null||e===void 0?void 0:e.name,i=Object.fromEntries(s.map(d=>{const p=o.filter(y=>y.type===d.name),u={name:d.name,options:d.options,storage:d.storage,editor:t},f=n.reduce((y,k)=>{const S=ct(k,"extendNodeSchema",u);return{...y,...S?S(d):{}}},{}),h=Dy({...f,content:Mt(ct(d,"content",u)),marks:Mt(ct(d,"marks",u)),group:Mt(ct(d,"group",u)),inline:Mt(ct(d,"inline",u)),atom:Mt(ct(d,"atom",u)),selectable:Mt(ct(d,"selectable",u)),draggable:Mt(ct(d,"draggable",u)),code:Mt(ct(d,"code",u)),whitespace:Mt(ct(d,"whitespace",u)),linebreakReplacement:Mt(ct(d,"linebreakReplacement",u)),defining:Mt(ct(d,"defining",u)),isolating:Mt(ct(d,"isolating",u)),attrs:Object.fromEntries(p.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))}),m=Mt(ct(d,"parseHTML",u));m&&(h.parseDOM=m.map(y=>Pi(y,p)));const g=ct(d,"renderHTML",u);g&&(h.toDOM=y=>g({node:y,HTMLAttributes:Pr(y,p)}));const v=ct(d,"renderText",u);return v&&(h.toText=v),[d.name,h]})),c=Object.fromEntries(r.map(d=>{const p=o.filter(v=>v.type===d.name),u={name:d.name,options:d.options,storage:d.storage,editor:t},f=n.reduce((v,y)=>{const k=ct(y,"extendMarkSchema",u);return{...v,...k?k(d):{}}},{}),h=Dy({...f,inclusive:Mt(ct(d,"inclusive",u)),excludes:Mt(ct(d,"excludes",u)),group:Mt(ct(d,"group",u)),spanning:Mt(ct(d,"spanning",u)),code:Mt(ct(d,"code",u)),attrs:Object.fromEntries(p.map(v=>{var y;return[v.name,{default:(y=v==null?void 0:v.attribute)===null||y===void 0?void 0:y.default}]}))}),m=Mt(ct(d,"parseHTML",u));m&&(h.parseDOM=m.map(v=>Pi(v,p)));const g=ct(d,"renderHTML",u);return g&&(h.toDOM=v=>g({mark:v,HTMLAttributes:Pr(v,p)})),[d.name,h]}));return new Sg({topNode:a,nodes:i,marks:c})}function Lr(n,t){return t.nodes[n]||t.marks[n]||null}function Fi(n,t){return Array.isArray(t)?t.some(e=>(typeof e=="string"?e:e.name)===n.name):t}function Ms(n,t){const e=Ol.fromSchema(t).serializeFragment(n),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(e),s.innerHTML}const Jp=(n,t=500)=>{let e="";const o=n.parentOffset;return n.parent.nodesBetween(Math.max(0,o-t),o,(s,r,a,i)=>{var c,d;const p=((d=(c=s.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:s,pos:r,parent:a,index:i}))||s.textContent||"%leaf%";e+=s.isAtom&&!s.isText?p:p.slice(0,Math.max(0,o-r))}),e};function Fr(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Co{constructor(t){this.find=t.find,this.handler=t.handler}}const ZV=(n,t)=>{if(Fr(t))return t.exec(n);const e=t(n);if(!e)return null;const o=[e.text];return o.index=e.index,o.input=n,o.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),o.push(e.replaceWith)),o};function ji(n){var t;const{editor:e,from:o,to:s,text:r,rules:a,plugin:i}=n,{view:c}=e;if(c.composing)return!1;const d=c.state.doc.resolve(o);if(d.parent.type.spec.code||!((t=d.nodeBefore||d.nodeAfter)===null||t===void 0)&&t.marks.find(f=>f.type.spec.code))return!1;let p=!1;const u=Jp(d)+r;return a.forEach(f=>{if(p)return;const h=ZV(u,f.find);if(!h)return;const m=c.state.tr,g=Cs({state:c.state,transaction:m}),v={from:o-(h[0].length-r.length),to:s},{commands:y,chain:k,can:S}=new Ts({editor:e,state:g});f.handler({state:g,range:v,match:h,commands:y,chain:k,can:S})===null||!m.steps.length||(m.setMeta(i,{transform:m,from:o,to:s,text:r}),c.dispatch(m),p=!0)}),p}function Yp(n){const{editor:t,rules:e}=n,o=new he({state:{init(){return null},apply(s,r,a){const i=s.getMeta(o);if(i)return i;const c=s.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:p}=c;typeof p=="string"?p=p:p=Ms(G.from(p),a.schema);const{from:u}=c,f=u+p.length;ji({editor:t,from:u,to:f,text:p,rules:e,plugin:o})}),s.selectionSet||s.docChanged?null:r}},props:{handleTextInput(s,r,a,i){return ji({editor:t,from:r,to:a,text:i,rules:e,plugin:o})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:r}=s.state.selection;r&&ji({editor:t,from:r.pos,to:r.pos,text:"",rules:e,plugin:o})}),!1)},handleKeyDown(s,r){if(r.key!=="Enter")return!1;const{$cursor:a}=s.state.selection;return a?ji({editor:t,from:a.pos,to:a.pos,text:`
487
+ `,rules:e,plugin:o}):!1}},isInputRules:!0});return o}function QV(n){return Object.prototype.toString.call(n).slice(8,-1)}function Bs(n){return QV(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Os(n,t){const e={...n};return Bs(n)&&Bs(t)&&Object.keys(t).forEach(o=>{Bs(t[o])&&Bs(n[o])?e[o]=Os(n[o],t[o]):e[o]=t[o]}),e}class qe{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Mt(ct(this,"addOptions",{name:this.name}))),this.storage=Mt(ct(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new qe(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>Os(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new qe(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Mt(ct(e,"addOptions",{name:e.name})),e.storage=Mt(ct(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:o}=t.state,s=t.state.selection.$from;if(s.pos===s.end()){const a=s.marks();if(!!!a.find(d=>(d==null?void 0:d.type.name)===e.name))return!1;const c=a.find(d=>(d==null?void 0:d.type.name)===e.name);return c&&o.removeStoredMark(c),o.insertText(" ",s.pos),t.view.dispatch(o),!0}return!1}}function Xp(n){return typeof n=="number"}class Fl{constructor(t){this.find=t.find,this.handler=t.handler}}const qV=(n,t,e)=>{if(Fr(t))return[...n.matchAll(t)];const o=t(n,e);return o?o.map(s=>{const r=[s.text];return r.index=s.index,r.input=n,r.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),r.push(s.replaceWith)),r}):[]};function $V(n){const{editor:t,state:e,from:o,to:s,rule:r,pasteEvent:a,dropEvent:i}=n,{commands:c,chain:d,can:p}=new Ts({editor:t,state:e}),u=[];return e.doc.nodesBetween(o,s,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(o,m),v=Math.min(s,m+h.content.size),y=h.textBetween(g-m,v-m,void 0,"");qV(y,r.find,a).forEach(S=>{if(S.index===void 0)return;const b=g+S.index+1,w=b+S[0].length,x={from:e.tr.mapping.map(b),to:e.tr.mapping.map(w)},E=r.handler({state:e,range:x,match:S,commands:c,chain:d,can:p,pasteEvent:a,dropEvent:i});u.push(E)})}),u.every(h=>h!==null)}let Hi=null;const tA=n=>{var t;const e=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=e.clipboardData)===null||t===void 0||t.setData("text/html",n),e};function Zp(n){const{editor:t,rules:e}=n;let o=null,s=!1,r=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,i;try{i=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{i=null}const c=({state:p,from:u,to:f,rule:h,pasteEvt:m})=>{const g=p.tr,v=Cs({state:p,transaction:g});if(!(!$V({editor:t,state:v,from:Math.max(u-1,0),to:f.b-1,rule:h,pasteEvent:m,dropEvent:i})||!g.steps.length)){try{i=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{i=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return e.map(p=>new he({view(u){const f=m=>{var g;o=!((g=u.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?u.dom.parentElement:null,o&&(Hi=t)},h=()=>{Hi&&(Hi=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(u,f)=>{if(r=o===u.dom.parentElement,i=f,!r){const h=Hi;h!=null&&h.isEditable&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(u,f)=>{var h;const m=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return a=f,s=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(u,f,h)=>{const m=u[0],g=m.getMeta("uiEvent")==="paste"&&!s,v=m.getMeta("uiEvent")==="drop"&&!r,y=m.getMeta("applyPasteRules"),k=!!y;if(!g&&!v&&!k)return;if(k){let{text:w}=y;typeof w=="string"?w=w:w=Ms(G.from(w),h.schema);const{from:x}=y,E=x+w.length,B=tA(w);return c({rule:p,state:h,from:x,to:{b:E},pasteEvt:B})}const S=f.doc.content.findDiffStart(h.doc.content),b=f.doc.content.findDiffEnd(h.doc.content);if(!(!Xp(S)||!b||S===b.b))return c({rule:p,state:h,from:S,to:b,pasteEvt:a})}}))}function Qp(n){const t=n.filter((e,o)=>n.indexOf(e)!==o);return Array.from(new Set(t))}class jl{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=jl.resolve(t),this.schema=Li(this.extensions,e),this.setupExtensions()}static resolve(t){const e=jl.sort(jl.flatten(t)),o=Qp(e.map(s=>s.name));return o.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${o.map(s=>`'${s}'`).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map(e=>{const o={name:e.name,options:e.options,storage:e.storage},s=ct(e,"addExtensions",o);return s?[e,...this.flatten(s())]:e}).flat(10)}static sort(t){return t.sort((o,s)=>{const r=ct(o,"priority")||100,a=ct(s,"priority")||100;return r>a?-1:r<a?1:0})}get commands(){return this.extensions.reduce((t,e)=>{const o={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Lr(e.name,this.schema)},s=ct(e,"addCommands",o);return s?{...t,...s()}:t},{})}get plugins(){const{editor:t}=this,e=jl.sort([...this.extensions].reverse()),o=[],s=[],r=e.map(a=>{const i={name:a.name,options:a.options,storage:a.storage,editor:t,type:Lr(a.name,this.schema)},c=[],d=ct(a,"addKeyboardShortcuts",i);let p={};if(a.type==="mark"&&ct(a,"exitable",i)&&(p.ArrowRight=()=>qe.handleExit({editor:t,mark:a})),d){const g=Object.fromEntries(Object.entries(d()).map(([v,y])=>[v,()=>y({editor:t})]));p={...p,...g}}const u=MV(p);c.push(u);const f=ct(a,"addInputRules",i);Fi(a,t.options.enableInputRules)&&f&&o.push(...f());const h=ct(a,"addPasteRules",i);Fi(a,t.options.enablePasteRules)&&h&&s.push(...h());const m=ct(a,"addProseMirrorPlugins",i);if(m){const g=m();c.push(...g)}return c}).flat();return[Yp({editor:t,rules:o}),...Zp({editor:t,rules:s}),...r]}get attributes(){return Ri(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Ns(this.extensions);return Object.fromEntries(e.filter(o=>!!ct(o,"addNodeView")).map(o=>{const s=this.attributes.filter(c=>c.type===o.name),r={name:o.name,options:o.options,storage:o.storage,editor:t,type:de(o.name,this.schema)},a=ct(o,"addNodeView",r);if(!a)return[];const i=(c,d,p,u,f)=>{const h=Pr(c,s);return a()({node:c,view:d,getPos:p,decorations:u,innerDecorations:f,editor:t,extension:o,HTMLAttributes:h})};return[o.name,i]}))}setupExtensions(){this.extensions.forEach(t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const o={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Lr(t.name,this.schema)};t.type==="mark"&&(!((e=Mt(ct(t,"keepOnSplit",o)))!==null&&e!==void 0)||e)&&this.splittableMarks.push(t.name);const s=ct(t,"onBeforeCreate",o),r=ct(t,"onCreate",o),a=ct(t,"onUpdate",o),i=ct(t,"onSelectionUpdate",o),c=ct(t,"onTransaction",o),d=ct(t,"onFocus",o),p=ct(t,"onBlur",o),u=ct(t,"onDestroy",o);s&&this.editor.on("beforeCreate",s),r&&this.editor.on("create",r),a&&this.editor.on("update",a),i&&this.editor.on("selectionUpdate",i),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),p&&this.editor.on("blur",p),u&&this.editor.on("destroy",u)})}}class pe{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Mt(ct(this,"addOptions",{name:this.name}))),this.storage=Mt(ct(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new pe(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>Os(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new pe({...this.config,...t});return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Mt(ct(e,"addOptions",{name:e.name})),e.storage=Mt(ct(e,"addStorage",{name:e.name,options:e.options})),e}}function Ui(n,t,e){const{from:o,to:s}=t,{blockSeparator:r=`
488
+
489
+ `,textSerializers:a={}}=e||{};let i="";return n.nodesBetween(o,s,(c,d,p,u)=>{var f;c.isBlock&&d>o&&(i+=r);const h=a==null?void 0:a[c.type.name];if(h)return p&&(i+=h({node:c,pos:d,parent:p,index:u,range:t})),!1;c.isText&&(i+=(f=c==null?void 0:c.text)===null||f===void 0?void 0:f.slice(Math.max(o,d)-d,s-d))}),i}function Ds(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,t])=>t.spec.toText).map(([t,e])=>[t,e.spec.toText]))}const Vy=pe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new he({key:new He("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:t,schema:e}=n,{doc:o,selection:s}=t,{ranges:r}=s,a=Math.min(...r.map(p=>p.$from.pos)),i=Math.max(...r.map(p=>p.$to.pos)),c=Ds(e);return Ui(o,{from:a,to:i},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),eA=()=>({editor:n,view:t})=>(requestAnimationFrame(()=>{var e;n.isDestroyed||(t.dom.blur(),(e=window==null?void 0:window.getSelection())===null||e===void 0||e.removeAllRanges())}),!0),nA=(n=!1)=>({commands:t})=>t.setContent("",n),oA=()=>({state:n,tr:t,dispatch:e})=>{const{selection:o}=t,{ranges:s}=o;return e&&s.forEach(({$from:r,$to:a})=>{n.doc.nodesBetween(r.pos,a.pos,(i,c)=>{if(i.type.isText)return;const{doc:d,mapping:p}=t,u=d.resolve(p.map(c)),f=d.resolve(p.map(c+i.nodeSize)),h=u.blockRange(f);if(!h)return;const m=fs(h);if(i.type.isTextblock){const{defaultType:g}=u.parent.contentMatchAt(u.index());t.setNodeMarkup(h.start,g)}(m||m===0)&&t.lift(h,m)})}),!0},lA=n=>t=>n(t),sA=()=>({state:n,dispatch:t})=>Ty(n,t),rA=(n,t)=>({editor:e,tr:o})=>{const{state:s}=e,r=s.doc.slice(n.from,n.to);o.deleteRange(n.from,n.to);const a=o.mapping.map(t);return o.insert(a,r.content),o.setSelection(new Et(o.doc.resolve(Math.max(a-1,0)))),!0},aA=()=>({tr:n,dispatch:t})=>{const{selection:e}=n,o=e.$anchor.node();if(o.content.size>0)return!1;const s=n.selection.$anchor;for(let r=s.depth;r>0;r-=1)if(s.node(r).type===o.type){if(t){const i=s.before(r),c=s.after(r);n.delete(i,c).scrollIntoView()}return!0}return!1},iA=n=>({tr:t,state:e,dispatch:o})=>{const s=de(n,e.schema),r=t.selection.$anchor;for(let a=r.depth;a>0;a-=1)if(r.node(a).type===s){if(o){const c=r.before(a),d=r.after(a);t.delete(c,d).scrollIntoView()}return!0}return!1},cA=n=>({tr:t,dispatch:e})=>{const{from:o,to:s}=n;return e&&t.delete(o,s),!0},dA=()=>({state:n,dispatch:t})=>jp(n,t),pA=()=>({commands:n})=>n.keyboardShortcut("Enter"),uA=()=>({state:n,dispatch:t})=>IV(n,t);function Vs(n,t,e={strict:!0}){const o=Object.keys(t);return o.length?o.every(s=>e.strict?t[s]===n[s]:Fr(t[s])?t[s].test(n[s]):t[s]===n[s]):!0}function Ay(n,t,e={}){return n.find(o=>o.type===t&&Vs(Object.fromEntries(Object.keys(e).map(s=>[s,o.attrs[s]])),e))}function Iy(n,t,e={}){return!!Ay(n,t,e)}function jr(n,t,e){var o;if(!n||!t)return;let s=n.parent.childAfter(n.parentOffset);if((!s.node||!s.node.marks.some(p=>p.type===t))&&(s=n.parent.childBefore(n.parentOffset)),!s.node||!s.node.marks.some(p=>p.type===t)||(e=e||((o=s.node.marks[0])===null||o===void 0?void 0:o.attrs),!Ay([...s.node.marks],t,e)))return;let a=s.index,i=n.start()+s.offset,c=a+1,d=i+s.node.nodeSize;for(;a>0&&Iy([...n.parent.child(a-1).marks],t,e);)a-=1,i-=n.parent.child(a).nodeSize;for(;c<n.parent.childCount&&Iy([...n.parent.child(c).marks],t,e);)d+=n.parent.child(c).nodeSize,c+=1;return{from:i,to:d}}function eo(n,t){if(typeof n=="string"){if(!t.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return t.marks[n]}return n}const fA=(n,t={})=>({tr:e,state:o,dispatch:s})=>{const r=eo(n,o.schema),{doc:a,selection:i}=e,{$from:c,from:d,to:p}=i;if(s){const u=jr(c,r,t);if(u&&u.from<=d&&u.to>=p){const f=Et.create(a,u.from,u.to);e.setSelection(f)}}return!0},hA=n=>t=>{const e=typeof n=="function"?n(t):n;for(let o=0;o<e.length;o+=1)if(e[o](t))return!0;return!1};function Hr(n){return n instanceof Et}function Un(n=0,t=0,e=0){return Math.min(Math.max(n,t),e)}function Wi(n,t=null){if(!t)return null;const e=Rt.atStart(n),o=Rt.atEnd(n);if(t==="start"||t===!0)return e;if(t==="end")return o;const s=e.from,r=o.to;return t==="all"?Et.create(n,Un(0,s,r),Un(n.content.size,s,r)):Et.create(n,Un(t,s,r),Un(t,s,r))}function qp(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Hl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function $p(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const mA=(n=null,t={})=>({editor:e,view:o,tr:s,dispatch:r})=>{t={scrollIntoView:!0,...t};const a=()=>{(Hl()||qp())&&o.dom.focus(),requestAnimationFrame(()=>{e.isDestroyed||(o.focus(),$p()&&!Hl()&&!qp()&&o.dom.focus({preventScroll:!0}))})};if(o.hasFocus()&&n===null||n===!1)return!0;if(r&&n===null&&!Hr(e.state.selection))return a(),!0;const i=Wi(s.doc,n)||e.state.selection,c=e.state.selection.eq(i);return r&&(c||s.setSelection(i),c&&s.storedMarks&&s.setStoredMarks(s.storedMarks),a()),!0},gA=(n,t)=>e=>n.every((o,s)=>t(o,{...e,index:s})),vA=(n,t)=>({tr:e,commands:o})=>o.insertContentAt({from:e.selection.from,to:e.selection.to},n,t),Ry=n=>{const t=n.childNodes;for(let e=t.length-1;e>=0;e-=1){const o=t[e];o.nodeType===3&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?n.removeChild(o):o.nodeType===1&&Ry(o)}return n};function Ul(n){const t=`<body>${n}</body>`,e=new window.DOMParser().parseFromString(t,"text/html").body;return Ry(e)}function Wl(n,t,e){if(n instanceof Qn||n instanceof G)return n;e={slice:!0,parseOptions:{},...e};const o=typeof n=="object"&&n!==null,s=typeof n=="string";if(o)try{if(Array.isArray(n)&&n.length>0)return G.fromArray(n.map(i=>t.nodeFromJSON(i)));const a=t.nodeFromJSON(n);return e.errorOnInvalidContent&&a.check(),a}catch(r){if(e.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),Wl("",t,e)}if(s){if(e.errorOnInvalidContent){let a=!1,i="";const c=new Sg({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(a=!0,i=typeof d=="string"?d:d.outerHTML,null)}]}})});if(e.slice?bo.fromSchema(c).parseSlice(Ul(n),e.parseOptions):bo.fromSchema(c).parse(Ul(n),e.parseOptions),e.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${i}`)})}const r=bo.fromSchema(t);return e.slice?r.parseSlice(Ul(n),e.parseOptions).content:r.parse(Ul(n),e.parseOptions)}return Wl("",t,e)}function tu(n,t,e){const o=n.steps.length-1;if(o<t)return;const s=n.steps[o];if(!(s instanceof be||s instanceof ke))return;const r=n.mapping.maps[o];let a=0;r.forEach((i,c,d,p)=>{a===0&&(a=p)}),n.setSelection(Rt.near(n.doc.resolve(a),e))}const yA=n=>!("type"in n),bA=(n,t,e)=>({tr:o,dispatch:s,editor:r})=>{var a;if(s){e={parseOptions:r.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...e};let i;const c=v=>{r.emit("contentError",{editor:r,error:v,disableCollaboration:()=>{r.storage.collaboration&&(r.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...e.parseOptions};if(!e.errorOnInvalidContent&&!r.options.enableContentCheck&&r.options.emitContentError)try{Wl(t,r.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(v){c(v)}try{i=Wl(t,r.schema,{parseOptions:d,errorOnInvalidContent:(a=e.errorOnInvalidContent)!==null&&a!==void 0?a:r.options.enableContentCheck})}catch(v){return c(v),!1}let{from:p,to:u}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},f=!0,h=!0;if((yA(i)?i:[i]).forEach(v=>{v.check(),f=f?v.isText&&v.marks.length===0:!1,h=h?v.isBlock:!1}),p===u&&h){const{parent:v}=o.doc.resolve(p);v.isTextblock&&!v.type.spec.code&&!v.childCount&&(p-=1,u+=1)}let g;if(f){if(Array.isArray(t))g=t.map(v=>v.text||"").join("");else if(t instanceof G){let v="";t.forEach(y=>{y.text&&(v+=y.text)}),g=v}else typeof t=="object"&&t&&t.text?g=t.text:g=t;o.insertText(g,p,u)}else g=i,o.replaceWith(p,u,g);e.updateSelection&&tu(o,o.steps.length-1,-1),e.applyInputRules&&o.setMeta("applyInputRules",{from:p,text:g}),e.applyPasteRules&&o.setMeta("applyPasteRules",{from:p,text:g})}return!0},kA=()=>({state:n,dispatch:t})=>DV(n,t),xA=()=>({state:n,dispatch:t})=>VV(n,t),wA=()=>({state:n,dispatch:t})=>by(n,t),SA=()=>({state:n,dispatch:t})=>Sy(n,t),EA=()=>({state:n,dispatch:t,tr:e})=>{try{const o=wi(n.doc,n.selection.$from.pos,-1);return o==null?!1:(e.join(o,2),t&&t(e),!0)}catch{return!1}},CA=()=>({state:n,dispatch:t,tr:e})=>{try{const o=wi(n.doc,n.selection.$from.pos,1);return o==null?!1:(e.join(o,2),t&&t(e),!0)}catch{return!1}},TA=()=>({state:n,dispatch:t})=>BV(n,t),NA=()=>({state:n,dispatch:t})=>OV(n,t);function Ki(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function MA(n){const t=n.split(/-(?!$)/);let e=t[t.length-1];e==="Space"&&(e=" ");let o,s,r,a;for(let i=0;i<t.length-1;i+=1){const c=t[i];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))o=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))r=!0;else if(/^mod$/i.test(c))Hl()||Ki()?a=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return o&&(e=`Alt-${e}`),s&&(e=`Ctrl-${e}`),a&&(e=`Meta-${e}`),r&&(e=`Shift-${e}`),e}const BA=n=>({editor:t,view:e,tr:o,dispatch:s})=>{const r=MA(n).split(/-(?!$)/),a=r.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),i=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{e.someProp("handleKeyDown",d=>d(e,i))});return c==null||c.steps.forEach(d=>{const p=d.map(o.mapping);p&&s&&o.maybeStep(p)}),!0};function Kl(n,t,e={}){const{from:o,to:s,empty:r}=n.selection,a=t?de(t,n.schema):null,i=[];n.doc.nodesBetween(o,s,(u,f)=>{if(u.isText)return;const h=Math.max(o,f),m=Math.min(s,f+u.nodeSize);i.push({node:u,from:h,to:m})});const c=s-o,d=i.filter(u=>a?a.name===u.node.type.name:!0).filter(u=>Vs(u.node.attrs,e,{strict:!1}));return r?!!d.length:d.reduce((u,f)=>u+f.to-f.from,0)>=c}const OA=(n,t={})=>({state:e,dispatch:o})=>{const s=de(n,e.schema);return Kl(e,s,t)?AV(e,o):!1},DA=()=>({state:n,dispatch:t})=>Ny(n,t),VA=n=>({state:t,dispatch:e})=>{const o=de(n,t.schema);return _V(o)(t,e)},AA=()=>({state:n,dispatch:t})=>Cy(n,t);function As(n,t){return t.nodes[n]?"node":t.marks[n]?"mark":null}function _i(n,t){const e=typeof t=="string"?[t]:t;return Object.keys(n).reduce((o,s)=>(e.includes(s)||(o[s]=n[s]),o),{})}const IA=(n,t)=>({tr:e,state:o,dispatch:s})=>{let r=null,a=null;const i=As(typeof n=="string"?n:n.name,o.schema);return i?(i==="node"&&(r=de(n,o.schema)),i==="mark"&&(a=eo(n,o.schema)),s&&e.selection.ranges.forEach(c=>{o.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,p)=>{r&&r===d.type&&e.setNodeMarkup(p,void 0,_i(d.attrs,t)),a&&d.marks.length&&d.marks.forEach(u=>{a===u.type&&e.addMark(p,p+d.nodeSize,a.create(_i(u.attrs,t)))})})}),!0):!1},RA=()=>({tr:n,dispatch:t})=>(t&&n.scrollIntoView(),!0),zA=()=>({tr:n,dispatch:t})=>{if(t){const e=new pn(n.doc);n.setSelection(e)}return!0},PA=()=>({state:n,dispatch:t})=>xy(n,t),LA=()=>({state:n,dispatch:t})=>Ey(n,t),FA=()=>({state:n,dispatch:t})=>PV(n,t),jA=()=>({state:n,dispatch:t})=>jV(n,t),HA=()=>({state:n,dispatch:t})=>FV(n,t);function Ur(n,t,e={},o={}){return Wl(n,t,{slice:!1,parseOptions:e,errorOnInvalidContent:o.errorOnInvalidContent})}const UA=(n,t=!1,e={},o={})=>({editor:s,tr:r,dispatch:a,commands:i})=>{var c,d;const{doc:p}=r;if(e.preserveWhitespace!=="full"){const u=Ur(n,s.schema,e,{errorOnInvalidContent:(c=o.errorOnInvalidContent)!==null&&c!==void 0?c:s.options.enableContentCheck});return a&&r.replaceWith(0,p.content.size,u).setMeta("preventUpdate",!t),!0}return a&&r.setMeta("preventUpdate",!t),i.insertContentAt({from:0,to:p.content.size},n,{parseOptions:e,errorOnInvalidContent:(d=o.errorOnInvalidContent)!==null&&d!==void 0?d:s.options.enableContentCheck})};function Gi(n,t){const e=eo(t,n.schema),{from:o,to:s,empty:r}=n.selection,a=[];r?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(o,s,c=>{a.push(...c.marks)});const i=a.find(c=>c.type.name===e.name);return i?{...i.attrs}:{}}function eu(n,t){const e=new Yg(n);return t.forEach(o=>{o.steps.forEach(s=>{e.step(s)})}),e}function nu(n){for(let t=0;t<n.edgeCount;t+=1){const{type:e}=n.edge(t);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}function zy(n,t){const e=[];return n.descendants((o,s)=>{t(o)&&e.push({node:o,pos:s})}),e}function ou(n,t,e){const o=[];return n.nodesBetween(t.from,t.to,(s,r)=>{e(s)&&o.push({node:s,pos:r})}),o}function lu(n,t){for(let e=n.depth;e>0;e-=1){const o=n.node(e);if(t(o))return{pos:e>0?n.before(e):0,start:n.start(e),depth:e,node:o}}}function Is(n){return t=>lu(t.$from,n)}function Wr(n,t){const e=jl.resolve(n);return Li(e,t)}function Py(n,t){const e=Wr(t),o=Qn.fromJSON(e,n);return Ms(o.content,e)}function Ly(n,t){const e=Wr(t),o=Ul(n);return bo.fromSchema(e).parse(o).toJSON()}function Kr(n,t){const e={from:0,to:n.content.size};return Ui(n,e,t)}function Fy(n,t,e){const{blockSeparator:o=`
490
+
491
+ `,textSerializers:s={}}=e||{},r=Wr(t),a=Qn.fromJSON(r,n);return Kr(a,{blockSeparator:o,textSerializers:{...Ds(r),...s}})}function su(n,t){const e=de(t,n.schema),{from:o,to:s}=n.selection,r=[];n.doc.nodesBetween(o,s,i=>{r.push(i)});const a=r.reverse().find(i=>i.type.name===e.name);return a?{...a.attrs}:{}}function Ji(n,t){const e=As(typeof t=="string"?t:t.name,n.schema);return e==="node"?su(n,t):e==="mark"?Gi(n,t):{}}function ru(n,t=JSON.stringify){const e={};return n.filter(o=>{const s=t(o);return Object.prototype.hasOwnProperty.call(e,s)?!1:e[s]=!0})}function WA(n){const t=ru(n);return t.length===1?t:t.filter((e,o)=>!t.filter((r,a)=>a!==o).some(r=>e.oldRange.from>=r.oldRange.from&&e.oldRange.to<=r.oldRange.to&&e.newRange.from>=r.newRange.from&&e.newRange.to<=r.newRange.to))}function au(n){const{mapping:t,steps:e}=n,o=[];return t.maps.forEach((s,r)=>{const a=[];if(s.ranges.length)s.forEach((i,c)=>{a.push({from:i,to:c})});else{const{from:i,to:c}=e[r];if(i===void 0||c===void 0)return;a.push({from:i,to:c})}a.forEach(({from:i,to:c})=>{const d=t.slice(r).map(i,-1),p=t.slice(r).map(c),u=t.invert().map(d,-1),f=t.invert().map(p);o.push({oldRange:{from:u,to:f},newRange:{from:d,to:p}})})}),WA(o)}function iu(n,t=0){const o=n.type===n.type.schema.topNodeType?0:1,s=t,r=s+n.nodeSize,a=n.marks.map(d=>{const p={type:d.type.name};return Object.keys(d.attrs).length&&(p.attrs={...d.attrs}),p}),i={...n.attrs},c={type:n.type.name,from:s,to:r};return Object.keys(i).length&&(c.attrs=i),a.length&&(c.marks=a),n.content.childCount&&(c.content=[],n.forEach((d,p)=>{var u;(u=c.content)===null||u===void 0||u.push(iu(d,t+p+o))})),n.text&&(c.text=n.text),c}function _r(n,t,e){const o=[];return n===t?e.resolve(n).marks().forEach(s=>{const r=e.resolve(n),a=jr(r,s.type);a&&o.push({mark:s,...a})}):e.nodesBetween(n,t,(s,r)=>{!s||(s==null?void 0:s.nodeSize)===void 0||o.push(...s.marks.map(a=>({from:r,to:r+s.nodeSize,mark:a})))}),o}const jy=(n,t,e,o=20)=>{const s=n.doc.resolve(e);let r=o,a=null;for(;r>0&&a===null;){const i=s.node(r);(i==null?void 0:i.type.name)===t?a=i:r-=1}return[a,r]};function Rs(n,t,e){return Object.fromEntries(Object.entries(e).filter(([o])=>{const s=n.find(r=>r.type===t&&r.name===o);return s?s.attribute.keepOnSplit:!1}))}function Gr(n,t,e={}){const{empty:o,ranges:s}=n.selection,r=t?eo(t,n.schema):null;if(o)return!!(n.storedMarks||n.selection.$from.marks()).filter(u=>r?r.name===u.type.name:!0).find(u=>Vs(u.attrs,e,{strict:!1}));let a=0;const i=[];if(s.forEach(({$from:u,$to:f})=>{const h=u.pos,m=f.pos;n.doc.nodesBetween(h,m,(g,v)=>{if(!g.isText&&!g.marks.length)return;const y=Math.max(h,v),k=Math.min(m,v+g.nodeSize),S=k-y;a+=S,i.push(...g.marks.map(b=>({mark:b,from:y,to:k})))})}),a===0)return!1;const c=i.filter(u=>r?r.name===u.mark.type.name:!0).filter(u=>Vs(u.mark.attrs,e,{strict:!1})).reduce((u,f)=>u+f.to-f.from,0),d=i.filter(u=>r?u.mark.type!==r&&u.mark.type.excludes(r):!0).reduce((u,f)=>u+f.to-f.from,0);return(c>0?c+d:c)>=a}function cu(n,t,e={}){if(!t)return Kl(n,null,e)||Gr(n,null,e);const o=As(t,n.schema);return o==="node"?Kl(n,t,e):o==="mark"?Gr(n,t,e):!1}const Hy=(n,t)=>{const{$from:e,$to:o,$anchor:s}=n.selection;if(t){const r=Is(i=>i.type.name===t)(n.selection);if(!r)return!1;const a=n.doc.resolve(r.pos+1);return s.pos+1===a.end()}return!(o.parentOffset<o.parent.nodeSize-2||e.pos!==o.pos)},Uy=n=>{const{$from:t,$to:e}=n.selection;return!(t.parentOffset>0||t.pos!==e.pos)};function Yi(n,t){const{nodeExtensions:e}=Ns(t),o=e.find(a=>a.name===n);if(!o)return!1;const s={name:o.name,options:o.options,storage:o.storage},r=Mt(ct(o,"group",s));return typeof r!="string"?!1:r.split(" ").includes("list")}function Jr(n,{checkChildren:t=!0,ignoreWhitespace:e=!1}={}){var o;if(e){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((o=n.text)!==null&&o!==void 0?o:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(t){let s=!0;return n.content.forEach(r=>{s!==!1&&(Jr(r,{ignoreWhitespace:e,checkChildren:t})||(s=!1))}),s}return!1}function Xi(n){return n instanceof vt}function Zi(n,t,e){const s=n.state.doc.content.size,r=Un(t,0,s),a=Un(e,0,s),i=n.coordsAtPos(r),c=n.coordsAtPos(a,-1),d=Math.min(i.top,c.top),p=Math.max(i.bottom,c.bottom),u=Math.min(i.left,c.left),f=Math.max(i.right,c.right),h=f-u,m=p-d,y={top:d,bottom:p,left:u,right:f,width:h,height:m,x:u,y:d};return{...y,toJSON:()=>y}}function Wy({json:n,validMarks:t,validNodes:e,options:o,rewrittenContent:s=[]}){return n.marks&&Array.isArray(n.marks)&&(n.marks=n.marks.filter(r=>{const a=typeof r=="string"?r:r.type;return t.has(a)?!0:(s.push({original:JSON.parse(JSON.stringify(r)),unsupported:a}),!1)})),n.content&&Array.isArray(n.content)&&(n.content=n.content.map(r=>Wy({json:r,validMarks:t,validNodes:e,options:o,rewrittenContent:s}).json).filter(r=>r!=null)),n.type&&!e.has(n.type)?(s.push({original:JSON.parse(JSON.stringify(n)),unsupported:n.type}),n.content&&Array.isArray(n.content)&&(o==null?void 0:o.fallbackToParagraph)!==!1?(n.type="paragraph",{json:n,rewrittenContent:s}):{json:null,rewrittenContent:s}):{json:n,rewrittenContent:s}}function Ky(n,t,e){return Wy({json:n,validNodes:new Set(Object.keys(t.nodes)),validMarks:new Set(Object.keys(t.marks)),options:e})}function KA(n,t,e){var o;const{selection:s}=t;let r=null;if(Hr(s)&&(r=s.$cursor),r){const i=(o=n.storedMarks)!==null&&o!==void 0?o:r.marks();return!!e.isInSet(i)||!i.some(c=>c.type.excludes(e))}const{ranges:a}=s;return a.some(({$from:i,$to:c})=>{let d=i.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(e):!1;return n.doc.nodesBetween(i.pos,c.pos,(p,u,f)=>{if(d)return!1;if(p.isInline){const h=!f||f.type.allowsMarkType(e),m=!!e.isInSet(p.marks)||!p.marks.some(g=>g.type.excludes(e));d=h&&m}return!d}),d})}const _A=(n,t={})=>({tr:e,state:o,dispatch:s})=>{const{selection:r}=e,{empty:a,ranges:i}=r,c=eo(n,o.schema);if(s)if(a){const d=Gi(o,c);e.addStoredMark(c.create({...d,...t}))}else i.forEach(d=>{const p=d.$from.pos,u=d.$to.pos;o.doc.nodesBetween(p,u,(f,h)=>{const m=Math.max(h,p),g=Math.min(h+f.nodeSize,u);f.marks.find(y=>y.type===c)?f.marks.forEach(y=>{c===y.type&&e.addMark(m,g,c.create({...y.attrs,...t}))}):e.addMark(m,g,c.create(t))})});return KA(o,e,c)},GA=(n,t)=>({tr:e})=>(e.setMeta(n,t),!0),JA=(n,t={})=>({state:e,dispatch:o,chain:s})=>{const r=de(n,e.schema);let a;return e.selection.$anchor.sameParent(e.selection.$head)&&(a=e.selection.$anchor.parent.attrs),r.isTextblock?s().command(({commands:i})=>Oy(r,{...a,...t})(e)?!0:i.clearNodes()).command(({state:i})=>Oy(r,{...a,...t})(i,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},YA=n=>({tr:t,dispatch:e})=>{if(e){const{doc:o}=t,s=Un(n,0,o.content.size),r=vt.create(o,s);t.setSelection(r)}return!0},XA=n=>({tr:t,dispatch:e})=>{if(e){const{doc:o}=t,{from:s,to:r}=typeof n=="number"?{from:n,to:n}:n,a=Et.atStart(o).from,i=Et.atEnd(o).to,c=Un(s,a,i),d=Un(r,a,i),p=Et.create(o,c,d);t.setSelection(p)}return!0},ZA=n=>({state:t,dispatch:e})=>{const o=de(n,t.schema);return YV(o)(t,e)};function _y(n,t){const e=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(e){const o=e.filter(s=>t==null?void 0:t.includes(s.type.name));n.tr.ensureMarks(o)}}const QA=({keepMarks:n=!0}={})=>({tr:t,state:e,dispatch:o,editor:s})=>{const{selection:r,doc:a}=t,{$from:i,$to:c}=r,d=s.extensionManager.attributes,p=Rs(d,i.node().type.name,i.node().attrs);if(r instanceof vt&&r.node.isBlock)return!i.parentOffset||!ko(a,i.pos)?!1:(o&&(n&&_y(e,s.extensionManager.splittableMarks),t.split(i.pos).scrollIntoView()),!0);if(!i.parent.isBlock)return!1;const u=c.parentOffset===c.parent.content.size,f=i.depth===0?void 0:nu(i.node(-1).contentMatchAt(i.indexAfter(-1)));let h=u&&f?[{type:f,attrs:p}]:void 0,m=ko(t.doc,t.mapping.map(i.pos),1,h);if(!h&&!m&&ko(t.doc,t.mapping.map(i.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:p}]:void 0),o){if(m&&(r instanceof Et&&t.deleteSelection(),t.split(t.mapping.map(i.pos),1,h),f&&!u&&!i.parentOffset&&i.parent.type!==f)){const g=t.mapping.map(i.before()),v=t.doc.resolve(g);i.node(-1).canReplaceWith(v.index(),v.index()+1,f)&&t.setNodeMarkup(t.mapping.map(i.before()),f)}n&&_y(e,s.extensionManager.splittableMarks),t.scrollIntoView()}return m},qA=(n,t={})=>({tr:e,state:o,dispatch:s,editor:r})=>{var a;const i=de(n,o.schema),{$from:c,$to:d}=o.selection,p=o.selection.node;if(p&&p.isBlock||c.depth<2||!c.sameParent(d))return!1;const u=c.node(-1);if(u.type!==i)return!1;const f=r.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==i||c.index(-2)!==c.node(-2).childCount-1)return!1;if(s){let y=G.empty;const k=c.index(-1)?1:c.index(-2)?2:3;for(let B=c.depth-k;B>=c.depth-3;B-=1)y=G.from(c.node(B).copy(y));const S=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,b={...Rs(f,c.node().type.name,c.node().attrs),...t},w=((a=i.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(b))||void 0;y=y.append(G.from(i.createAndFill(null,w)||void 0));const x=c.before(c.depth-(k-1));e.replace(x,c.after(-S),new rt(y,4-k,0));let E=-1;e.doc.nodesBetween(x,e.doc.content.size,(B,C)=>{if(E>-1)return!1;B.isTextblock&&B.content.size===0&&(E=C+1)}),E>-1&&e.setSelection(Et.near(e.doc.resolve(E))),e.scrollIntoView()}return!0}const h=d.pos===c.end()?u.contentMatchAt(0).defaultType:null,m={...Rs(f,u.type.name,u.attrs),...t},g={...Rs(f,c.node().type.name,c.node().attrs),...t};e.delete(c.pos,d.pos);const v=h?[{type:i,attrs:m},{type:h,attrs:g}]:[{type:i,attrs:m}];if(!ko(e.doc,c.pos,2))return!1;if(s){const{selection:y,storedMarks:k}=o,{splittableMarks:S}=r.extensionManager,b=k||y.$to.parentOffset&&y.$from.marks();if(e.split(c.pos,2,v).scrollIntoView(),!b||!s)return!0;const w=b.filter(x=>S.includes(x.type.name));e.ensureMarks(w)}return!0},du=(n,t)=>{const e=Is(a=>a.type===t)(n.selection);if(!e)return!0;const o=n.doc.resolve(Math.max(0,e.pos-1)).before(e.depth);if(o===void 0)return!0;const s=n.doc.nodeAt(o);return e.node.type===(s==null?void 0:s.type)&&qo(n.doc,e.pos)&&n.join(e.pos),!0},pu=(n,t)=>{const e=Is(a=>a.type===t)(n.selection);if(!e)return!0;const o=n.doc.resolve(e.start).after(e.depth);if(o===void 0)return!0;const s=n.doc.nodeAt(o);return e.node.type===(s==null?void 0:s.type)&&qo(n.doc,o)&&n.join(o),!0};var $A=Object.freeze({__proto__:null,blur:eA,clearContent:nA,clearNodes:oA,command:lA,createParagraphNear:sA,cut:rA,deleteCurrentNode:aA,deleteNode:iA,deleteRange:cA,deleteSelection:dA,enter:pA,exitCode:uA,extendMarkRange:fA,first:hA,focus:mA,forEach:gA,insertContent:vA,insertContentAt:bA,joinBackward:wA,joinDown:xA,joinForward:SA,joinItemBackward:EA,joinItemForward:CA,joinTextblockBackward:TA,joinTextblockForward:NA,joinUp:kA,keyboardShortcut:BA,lift:OA,liftEmptyBlock:DA,liftListItem:VA,newlineInCode:AA,resetAttributes:IA,scrollIntoView:RA,selectAll:zA,selectNodeBackward:PA,selectNodeForward:LA,selectParentNode:FA,selectTextblockEnd:jA,selectTextblockStart:HA,setContent:UA,setMark:_A,setMeta:GA,setNode:JA,setNodeSelection:YA,setTextSelection:XA,sinkListItem:ZA,splitBlock:QA,splitListItem:qA,toggleList:(n,t,e,o={})=>({editor:s,tr:r,state:a,dispatch:i,chain:c,commands:d,can:p})=>{const{extensions:u,splittableMarks:f}=s.extensionManager,h=de(n,a.schema),m=de(t,a.schema),{selection:g,storedMarks:v}=a,{$from:y,$to:k}=g,S=y.blockRange(k),b=v||g.$to.parentOffset&&g.$from.marks();if(!S)return!1;const w=Is(x=>Yi(x.type.name,u))(g);if(S.depth>=1&&w&&S.depth-w.depth<=1){if(w.node.type===h)return d.liftListItem(m);if(Yi(w.node.type.name,u)&&h.validContent(w.node.content)&&i)return c().command(()=>(r.setNodeMarkup(w.pos,h),!0)).command(()=>du(r,h)).command(()=>pu(r,h)).run()}return!e||!b||!i?c().command(()=>p().wrapInList(h,o)?!0:d.clearNodes()).wrapInList(h,o).command(()=>du(r,h)).command(()=>pu(r,h)).run():c().command(()=>{const x=p().wrapInList(h,o),E=b.filter(B=>f.includes(B.type.name));return r.ensureMarks(E),x?!0:d.clearNodes()}).wrapInList(h,o).command(()=>du(r,h)).command(()=>pu(r,h)).run()},toggleMark:(n,t={},e={})=>({state:o,commands:s})=>{const{extendEmptyMarkRange:r=!1}=e,a=eo(n,o.schema);return Gr(o,a,t)?s.unsetMark(a,{extendEmptyMarkRange:r}):s.setMark(a,t)},toggleNode:(n,t,e={})=>({state:o,commands:s})=>{const r=de(n,o.schema),a=de(t,o.schema),i=Kl(o,r,e);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),i?s.setNode(a,c):s.setNode(r,{...c,...e})},toggleWrap:(n,t={})=>({state:e,commands:o})=>{const s=de(n,e.schema);return Kl(e,s,t)?o.lift(s):o.wrapIn(s,t)},undoInputRule:()=>({state:n,dispatch:t})=>{const e=n.plugins;for(let o=0;o<e.length;o+=1){const s=e[o];let r;if(s.spec.isInputRules&&(r=s.getState(n))){if(t){const a=n.tr,i=r.transform;for(let c=i.steps.length-1;c>=0;c-=1)a.step(i.steps[c].invert(i.docs[c]));if(r.text){const c=a.doc.resolve(r.from).marks();a.replaceWith(r.from,r.to,n.schema.text(r.text,c))}else a.delete(r.from,r.to)}return!0}}return!1},unsetAllMarks:()=>({tr:n,dispatch:t})=>{const{selection:e}=n,{empty:o,ranges:s}=e;return o||t&&s.forEach(r=>{n.removeMark(r.$from.pos,r.$to.pos)}),!0},unsetMark:(n,t={})=>({tr:e,state:o,dispatch:s})=>{var r;const{extendEmptyMarkRange:a=!1}=t,{selection:i}=e,c=eo(n,o.schema),{$from:d,empty:p,ranges:u}=i;if(!s)return!0;if(p&&a){let{from:f,to:h}=i;const m=(r=d.marks().find(v=>v.type===c))===null||r===void 0?void 0:r.attrs,g=jr(d,c,m);g&&(f=g.from,h=g.to),e.removeMark(f,h,c)}else u.forEach(f=>{e.removeMark(f.$from.pos,f.$to.pos,c)});return e.removeStoredMark(c),!0},updateAttributes:(n,t={})=>({tr:e,state:o,dispatch:s})=>{let r=null,a=null;const i=As(typeof n=="string"?n:n.name,o.schema);return i?(i==="node"&&(r=de(n,o.schema)),i==="mark"&&(a=eo(n,o.schema)),s&&e.selection.ranges.forEach(c=>{const d=c.$from.pos,p=c.$to.pos;let u,f,h,m;e.selection.empty?o.doc.nodesBetween(d,p,(g,v)=>{r&&r===g.type&&(h=Math.max(v,d),m=Math.min(v+g.nodeSize,p),u=v,f=g)}):o.doc.nodesBetween(d,p,(g,v)=>{v<d&&r&&r===g.type&&(h=Math.max(v,d),m=Math.min(v+g.nodeSize,p),u=v,f=g),v>=d&&v<=p&&(r&&r===g.type&&e.setNodeMarkup(v,void 0,{...g.attrs,...t}),a&&g.marks.length&&g.marks.forEach(y=>{if(a===y.type){const k=Math.max(v,d),S=Math.min(v+g.nodeSize,p);e.addMark(k,S,a.create({...y.attrs,...t}))}}))}),f&&(u!==void 0&&e.setNodeMarkup(u,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(g=>{a===g.type&&e.addMark(h,m,a.create({...g.attrs,...t}))}))}),!0):!1},wrapIn:(n,t={})=>({state:e,dispatch:o})=>{const s=de(n,e.schema);return HV(s,t)(e,o)},wrapInList:(n,t={})=>({state:e,dispatch:o})=>{const s=de(n,e.schema);return UV(s,t)(e,o)}});const Gy=pe.create({name:"commands",addCommands(){return{...$A}}}),Jy=pe.create({name:"drop",addProseMirrorPlugins(){return[new he({key:new He("tiptapDrop"),props:{handleDrop:(n,t,e,o)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:e,moved:o})}}})]}}),Yy=pe.create({name:"editable",addProseMirrorPlugins(){return[new he({key:new He("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Xy=new He("focusEvents"),Zy=pe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new he({key:Xy,props:{handleDOMEvents:{focus:(t,e)=>{n.isFocused=!0;const o=n.state.tr.setMeta("focus",{event:e}).setMeta("addToHistory",!1);return t.dispatch(o),!1},blur:(t,e)=>{n.isFocused=!1;const o=n.state.tr.setMeta("blur",{event:e}).setMeta("addToHistory",!1);return t.dispatch(o),!1}}}})]}}),Qy=pe.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:i})=>{const{selection:c,doc:d}=i,{empty:p,$anchor:u}=c,{pos:f,parent:h}=u,m=u.parent.isTextblock&&f>0?i.doc.resolve(f-1):u,g=m.parent.type.spec.isolating,v=u.pos-u.parentOffset,y=g&&m.parent.childCount===1?v===u.pos:Rt.atStart(d).from===f;return!p||!h.type.isTextblock||h.textContent.length||!y||y&&u.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),o={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},s={...o},r={...o,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Hl()||Ki()?r:s},addProseMirrorPlugins(){return[new he({key:new He("clearDocument"),appendTransaction:(n,t,e)=>{if(n.some(g=>g.getMeta("composition")))return;const o=n.some(g=>g.docChanged)&&!t.doc.eq(e.doc),s=n.some(g=>g.getMeta("preventClearDocument"));if(!o||s)return;const{empty:r,from:a,to:i}=t.selection,c=Rt.atStart(t.doc).from,d=Rt.atEnd(t.doc).to;if(r||!(a===c&&i===d)||!Jr(e.doc))return;const f=e.tr,h=Cs({state:e,transaction:f}),{commands:m}=new Ts({editor:this.editor,state:h});if(m.clearNodes(),!!f.steps.length)return f}})]}}),qy=pe.create({name:"paste",addProseMirrorPlugins(){return[new he({key:new He("tiptapPaste"),props:{handlePaste:(n,t,e)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:e})}}})]}}),$y=pe.create({name:"tabindex",addProseMirrorPlugins(){return[new he({key:new He("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var t1=Object.freeze({__proto__:null,ClipboardTextSerializer:Vy,Commands:Gy,Drop:Jy,Editable:Yy,FocusEvents:Zy,Keymap:Qy,Paste:qy,Tabindex:$y,focusEventsPluginKey:Xy});class To{get name(){return this.node.type.name}constructor(t,e,o=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=o,this.resolvedPos=t,this.editor=e,this.currentNode=s}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,o=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}e=this.from+1,o=this.to-1}this.editor.commands.insertContentAt({from:e,to:o},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.resolve(t);return new To(e,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new To(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new To(t,this.editor)}get children(){const t=[];return this.node.content.forEach((e,o)=>{const s=e.isBlock&&!e.isTextblock,r=e.isAtom&&!e.isText,a=this.pos+o+(r?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const i=this.resolvedPos.doc.resolve(a);if(!s&&i.depth<=this.depth)return;const c=new To(i,this.editor,s,s?e:null);s&&(c.actualDepth=this.depth+1),t.push(new To(i,this.editor,s,s?e:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,e={}){let o=null,s=this.parent;for(;s&&!o;){if(s.node.type.name===t)if(Object.keys(e).length>0){const r=s.node.attrs,a=Object.keys(e);for(let i=0;i<a.length;i+=1){const c=a[i];if(r[c]!==e[c])break}}else o=s;s=s.parent}return o}querySelector(t,e={}){return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t,e={},o=!1){let s=[];if(!this.children||this.children.length===0)return s;const r=Object.keys(e);return this.children.forEach(a=>{o&&s.length>0||(a.node.type.name===t&&r.every(c=>e[c]===a.node.attrs[c])&&s.push(a),!(o&&s.length>0)&&(s=s.concat(a.querySelectorAll(t,e,o))))}),s}setAttribute(t){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}}const t0=`.ProseMirror {
492
+ position: relative;
493
+ }
494
+
495
+ .ProseMirror {
496
+ word-wrap: break-word;
497
+ white-space: pre-wrap;
498
+ white-space: break-spaces;
499
+ -webkit-font-variant-ligatures: none;
500
+ font-variant-ligatures: none;
501
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
502
+ }
503
+
504
+ .ProseMirror [contenteditable="false"] {
505
+ white-space: normal;
506
+ }
507
+
508
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
509
+ white-space: pre-wrap;
510
+ }
511
+
512
+ .ProseMirror pre {
513
+ white-space: pre-wrap;
514
+ }
515
+
516
+ img.ProseMirror-separator {
517
+ display: inline !important;
518
+ border: none !important;
519
+ margin: 0 !important;
520
+ width: 0 !important;
521
+ height: 0 !important;
522
+ }
523
+
524
+ .ProseMirror-gapcursor {
525
+ display: none;
526
+ pointer-events: none;
527
+ position: absolute;
528
+ margin: 0;
529
+ }
530
+
531
+ .ProseMirror-gapcursor:after {
532
+ content: "";
533
+ display: block;
534
+ position: absolute;
535
+ top: -2px;
536
+ width: 20px;
537
+ border-top: 1px solid black;
538
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
539
+ }
540
+
541
+ @keyframes ProseMirror-cursor-blink {
542
+ to {
543
+ visibility: hidden;
544
+ }
545
+ }
546
+
547
+ .ProseMirror-hideselection *::selection {
548
+ background: transparent;
549
+ }
550
+
551
+ .ProseMirror-hideselection *::-moz-selection {
552
+ background: transparent;
553
+ }
554
+
555
+ .ProseMirror-hideselection * {
556
+ caret-color: transparent;
557
+ }
558
+
559
+ .ProseMirror-focused .ProseMirror-gapcursor {
560
+ display: block;
561
+ }
562
+
563
+ .tippy-box[data-animation=fade][data-state=hidden] {
564
+ opacity: 0
565
+ }`;function uu(n,t,e){const o=document.querySelector(`style[data-tiptap-style${e?`-${e}`:""}]`);if(o!==null)return o;const s=document.createElement("style");return t&&s.setAttribute("nonce",t),s.setAttribute(`data-tiptap-style${e?`-${e}`:""}`,""),s.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(s),s}let e1=class extends XV{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:o,moved:s})=>this.options.onDrop(e,o,s)),this.on("paste",({event:e,slice:o})=>this.options.onPaste(e,o)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=uu(t0,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const o=zi(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],s=this.state.reconfigure({plugins:o});return this.view.updateState(s),s}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let o=e;if([].concat(t).forEach(r=>{const a=typeof r=="string"?`${r}$`:r.key;o=o.filter(i=>!i.key.startsWith(a))}),e.length===o.length)return;const s=this.state.reconfigure({plugins:o});return this.view.updateState(s),s}createExtensionManager(){var t,e;const s=[...this.options.enableCoreExtensions?[Yy,Vy.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)===null||t===void 0?void 0:t.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),Gy,Zy,Qy,$y,Jy,qy].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new jl(s,this)}createCommandManager(){this.commandManager=new Ts({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let e;try{e=Ur(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(a){if(!(a instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(a.message))throw a;this.emit("contentError",{editor:this,error:a,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(i=>i.name!=="collaboration"),this.createExtensionManager()}}),e=Ur(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const o=Wi(e,this.options.autofocus);this.view=new py(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:vs.create({doc:e,selection:o||void 0})});const s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.createNodeViews(),this.prependClass();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(a=>{var i;return(i=this.capturedTransaction)===null||i===void 0?void 0:i.step(a)});return}const e=this.state.apply(t),o=!this.state.selection.eq(e.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),o&&this.emit("selectionUpdate",{editor:this,transaction:t});const s=t.getMeta("focus"),r=t.getMeta("blur");s&&this.emit("focus",{editor:this,event:s.event,transaction:t}),r&&this.emit("blur",{editor:this,event:r.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return Ji(this.state,t)}isActive(t,e){const o=typeof t=="string"?t:null,s=typeof t=="string"?e:t;return cu(this.state,o,s)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Ms(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
566
+
567
+ `,textSerializers:o={}}=t||{};return Kr(this.state.doc,{blockSeparator:e,textSerializers:{...Ds(this.schema),...o}})}get isEmpty(){return Jr(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,e){var o;return((o=this.$doc)===null||o===void 0?void 0:o.querySelector(t,e))||null}$nodes(t,e){var o;return((o=this.$doc)===null||o===void 0?void 0:o.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new To(e,this)}get $doc(){return this.$pos(0)}};function il(n){return new Co({find:n.find,handler:({state:t,range:e,match:o})=>{const s=Mt(n.getAttributes,void 0,o);if(s===!1||s===null)return null;const{tr:r}=t,a=o[o.length-1],i=o[0];if(a){const c=i.search(/\S/),d=e.from+i.indexOf(a),p=d+a.length;if(_r(e.from,e.to,t.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>d).length)return null;p<e.to&&r.delete(p,e.to),d>e.from&&r.delete(e.from+c,d);const f=e.from+c+a.length;r.addMark(e.from+c,f,n.type.create(s||{})),r.removeStoredMark(n.type)}}})}function fu(n){return new Co({find:n.find,handler:({state:t,range:e,match:o})=>{const s=Mt(n.getAttributes,void 0,o)||{},{tr:r}=t,a=e.from;let i=e.to;const c=n.type.create(s);if(o[1]){const d=o[0].lastIndexOf(o[1]);let p=a+d;p>i?p=i:i=p+o[1].length;const u=o[0][o[0].length-1];r.insertText(u,a+o[0].length-1),r.replaceWith(p,i,c)}else if(o[0]){const d=n.type.isInline?a:a-1;r.insert(d,n.type.create(s)).delete(r.mapping.map(a),r.mapping.map(i))}r.scrollIntoView()}})}function Yr(n){return new Co({find:n.find,handler:({state:t,range:e,match:o})=>{const s=t.doc.resolve(e.from),r=Mt(n.getAttributes,void 0,o)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),n.type))return null;t.tr.delete(e.from,e.to).setBlockType(e.from,e.from,n.type,r)}})}function n1(n){return new Co({find:n.find,handler:({state:t,range:e,match:o})=>{let s=n.replace,r=e.from;const a=e.to;if(o[1]){const i=o[0].lastIndexOf(o[1]);s+=o[0].slice(i+o[1].length),r+=i;const c=r-a;c>0&&(s=o[0].slice(i-c,i)+s,r=a)}t.tr.insertText(s,r,a)}})}function _l(n){return new Co({find:n.find,handler:({state:t,range:e,match:o,chain:s})=>{const r=Mt(n.getAttributes,void 0,o)||{},a=t.tr.delete(e.from,e.to),c=a.doc.resolve(e.from).blockRange(),d=c&&ap(c,n.type,r);if(!d)return null;if(a.wrap(c,d),n.keepMarks&&n.editor){const{selection:u,storedMarks:f}=t,{splittableMarks:h}=n.editor.extensionManager,m=f||u.$to.parentOffset&&u.$from.marks();if(m){const g=m.filter(v=>h.includes(v.type.name));a.ensureMarks(g)}}if(n.keepAttributes){const u=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(u,r).run()}const p=a.doc.resolve(e.from-1).nodeBefore;p&&p.type===n.type&&qo(a.doc,e.from-1)&&(!n.joinPredicate||n.joinPredicate(o,p))&&a.join(e.from-1)}})}class xe{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Mt(ct(this,"addOptions",{name:this.name}))),this.storage=Mt(ct(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new xe(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>Os(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new xe(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Mt(ct(e,"addOptions",{name:e.name})),e.storage=Mt(ct(e,"addStorage",{name:e.name,options:e.options})),e}}class hu{constructor(t,e,o){this.isDragging=!1,this.component=t,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...o},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var e,o,s,r,a,i,c;const{view:d}=this.editor,p=t.target,u=p.nodeType===3?(e=p.parentElement)===null||e===void 0?void 0:e.closest("[data-drag-handle]"):p.closest("[data-drag-handle]");if(!this.dom||!((o=this.contentDOM)===null||o===void 0)&&o.contains(p)||!u)return;let f=0,h=0;if(this.dom!==u){const k=this.dom.getBoundingClientRect(),S=u.getBoundingClientRect(),b=(s=t.offsetX)!==null&&s!==void 0?s:(r=t.nativeEvent)===null||r===void 0?void 0:r.offsetX,w=(a=t.offsetY)!==null&&a!==void 0?a:(i=t.nativeEvent)===null||i===void 0?void 0:i.offsetY;f=S.x-k.x+b,h=S.y-k.y+w}const m=this.dom.cloneNode(!0);(c=t.dataTransfer)===null||c===void 0||c.setDragImage(m,f,h);const g=this.getPos();if(typeof g!="number")return;const v=vt.create(d.state.doc,g),y=d.state.tr.setSelection(v);d.dispatch(y)}stopEvent(t){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const o=t.target;if(!(this.dom.contains(o)&&!(!((e=this.contentDOM)===null||e===void 0)&&e.contains(o))))return!1;const r=t.type.startsWith("drag"),a=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(o.tagName)||o.isContentEditable)&&!a&&!r)return!0;const{isEditable:c}=this.editor,{isDragging:d}=this,p=!!this.node.type.spec.draggable,u=vt.isSelectable(this.node),f=t.type==="copy",h=t.type==="paste",m=t.type==="cut",g=t.type==="mousedown";if(!p&&u&&r&&t.target===this.dom&&t.preventDefault(),p&&r&&!d&&t.target===this.dom)return t.preventDefault(),!1;if(p&&c&&!d&&g){const v=o.closest("[data-drag-handle]");v&&(this.dom===v||this.dom.contains(v))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(d||a||f||h||m||g&&u)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(Hl()||qp())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(o=>o.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:e})=>{const o=this.getPos();return typeof o!="number"?!1:(e.setNodeMarkup(o,void 0,{...this.node.attrs,...t}),!0)})}deleteNode(){const t=this.getPos();if(typeof t!="number")return;const e=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:e})}}function No(n){return new Fl({find:n.find,handler:({state:t,range:e,match:o,pasteEvent:s})=>{const r=Mt(n.getAttributes,void 0,o,s);if(r===!1||r===null)return null;const{tr:a}=t,i=o[o.length-1],c=o[0];let d=e.to;if(i){const p=c.search(/\S/),u=e.from+c.indexOf(i),f=u+i.length;if(_r(e.from,e.to,t.doc).filter(m=>m.mark.type.excluded.find(v=>v===n.type&&v!==m.mark.type)).filter(m=>m.to>u).length)return null;f<e.to&&a.delete(f,e.to),u>e.from&&a.delete(e.from+p,u),d=e.from+p+i.length,a.addMark(e.from+p,d,n.type.create(r||{})),a.removeStoredMark(n.type)}}})}function mu(n,t){const{selection:e}=n,{$from:o}=e;if(e instanceof vt){const r=o.index();return o.parent.canReplaceWith(r,r+1,t)}let s=o.depth;for(;s>=0;){const r=o.index(s);if(o.node(s).contentMatchAt(r).matchType(t))return!0;s-=1}return!1}function o1(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function l1(n){return typeof n=="string"}function s1(n){return new Fl({find:n.find,handler({match:t,chain:e,range:o,pasteEvent:s}){const r=Mt(n.getAttributes,void 0,t,s),a=Mt(n.getContent,void 0,r);if(r===!1||r===null)return null;const i={type:n.type.name,attrs:r};a&&(i.content=a),t.input&&e().deleteRange(o).insertContentAt(o.from,i)}})}function r1(n){return new Fl({find:n.find,handler:({state:t,range:e,match:o})=>{let s=n.replace,r=e.from;const a=e.to;if(o[1]){const i=o[0].lastIndexOf(o[1]);s+=o[0].slice(i+o[1].length),r+=i;const c=r-a;c>0&&(s=o[0].slice(i-c,i)+s,r=a)}t.tr.insertText(s,r,a)}})}class a1{constructor(t){this.transaction=t,this.currentStep=this.transaction.steps.length}map(t){let e=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((s,r)=>{const a=r.getMap().mapResult(s);return a.deleted&&(e=!0),a.pos},t),deleted:e}}}const e0=Object.freeze(Object.defineProperty({__proto__:null,CommandManager:Ts,Editor:e1,Extension:pe,InputRule:Co,Mark:qe,Node:xe,NodePos:To,NodeView:hu,PasteRule:Fl,Tracker:a1,callOrReturn:Mt,canInsertNode:mu,combineTransactionSteps:eu,createChainableState:Cs,createDocument:Ur,createNodeFromContent:Wl,createStyleTag:uu,defaultBlockAt:nu,deleteProps:_i,elementFromString:Ul,escapeForRegEx:o1,extensions:t1,findChildren:zy,findChildrenInRange:ou,findDuplicates:Qp,findParentNode:Is,findParentNodeClosestToPos:lu,fromString:Gp,generateHTML:Py,generateJSON:Ly,generateText:Fy,getAttributes:Ji,getAttributesFromExtensions:Ri,getChangedRanges:au,getDebugJSON:iu,getExtensionField:ct,getHTMLFromFragment:Ms,getMarkAttributes:Gi,getMarkRange:jr,getMarkType:eo,getMarksBetween:_r,getNodeAtPosition:jy,getNodeAttributes:su,getNodeType:de,getRenderedAttributes:Pr,getSchema:Wr,getSchemaByResolvedExtensions:Li,getSchemaTypeByName:Lr,getSchemaTypeNameByName:As,getSplittedAttributes:Rs,getText:Kr,getTextBetween:Ui,getTextContentFromNodes:Jp,getTextSerializersFromSchema:Ds,injectExtensionAttributesToParseRule:Pi,inputRulesPlugin:Yp,isActive:cu,isAtEndOfNode:Hy,isAtStartOfNode:Uy,isEmptyObject:_p,isExtensionRulesEnabled:Fi,isFunction:zi,isList:Yi,isMacOS:Ki,isMarkActive:Gr,isNodeActive:Kl,isNodeEmpty:Jr,isNodeSelection:Xi,isNumber:Xp,isPlainObject:Bs,isRegExp:Fr,isSafari:$p,isString:l1,isTextSelection:Hr,isiOS:Hl,markInputRule:il,markPasteRule:No,mergeAttributes:qt,mergeDeep:Os,minMax:Un,nodeInputRule:fu,nodePasteRule:s1,objectIncludes:Vs,pasteRulesPlugin:Zp,posToDOMRect:Zi,removeDuplicates:ru,resolveFocusPosition:Wi,rewriteUnknownContent:Ky,selectionToInsertionEnd:tu,splitExtensions:Ns,textInputRule:n1,textPasteRule:r1,textblockTypeInputRule:Yr,wrappingInputRule:_l},Symbol.toStringTag,{value:"Module"}));var $e="top",Tn="bottom",Nn="right",tn="left",gu="auto",Xr=[$e,Tn,Nn,tn],zs="start",Zr="end",n0="clippingParents",i1="viewport",Qr="popper",o0="reference",c1=Xr.reduce(function(n,t){return n.concat([t+"-"+zs,t+"-"+Zr])},[]),d1=[].concat(Xr,[gu]).reduce(function(n,t){return n.concat([t,t+"-"+zs,t+"-"+Zr])},[]),l0="beforeRead",s0="read",r0="afterRead",a0="beforeMain",i0="main",c0="afterMain",d0="beforeWrite",p0="write",u0="afterWrite",f0=[l0,s0,r0,a0,i0,c0,d0,p0,u0];function no(n){return n?(n.nodeName||"").toLowerCase():null}function un(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function Gl(n){var t=un(n).Element;return n instanceof t||n instanceof Element}function Mn(n){var t=un(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function vu(n){if(typeof ShadowRoot>"u")return!1;var t=un(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function h0(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var o=t.styles[e]||{},s=t.attributes[e]||{},r=t.elements[e];!Mn(r)||!no(r)||(Object.assign(r.style,o),Object.keys(s).forEach(function(a){var i=s[a];i===!1?r.removeAttribute(a):r.setAttribute(a,i===!0?"":i)}))})}function m0(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(o){var s=t.elements[o],r=t.attributes[o]||{},a=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:e[o]),i=a.reduce(function(c,d){return c[d]="",c},{});!Mn(s)||!no(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(c){s.removeAttribute(c)}))})}}const p1={name:"applyStyles",enabled:!0,phase:"write",fn:h0,effect:m0,requires:["computeStyles"]};function oo(n){return n.split("-")[0]}var Jl=Math.max,Qi=Math.min,Ps=Math.round;function yu(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function u1(){return!/^((?!chrome|android).)*safari/i.test(yu())}function Ls(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var o=n.getBoundingClientRect(),s=1,r=1;t&&Mn(n)&&(s=n.offsetWidth>0&&Ps(o.width)/n.offsetWidth||1,r=n.offsetHeight>0&&Ps(o.height)/n.offsetHeight||1);var a=Gl(n)?un(n):window,i=a.visualViewport,c=!u1()&&e,d=(o.left+(c&&i?i.offsetLeft:0))/s,p=(o.top+(c&&i?i.offsetTop:0))/r,u=o.width/s,f=o.height/r;return{width:u,height:f,top:p,right:d+u,bottom:p+f,left:d,x:d,y:p}}function bu(n){var t=Ls(n),e=n.offsetWidth,o=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:o}}function f1(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&vu(e)){var o=t;do{if(o&&n.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function Mo(n){return un(n).getComputedStyle(n)}function g0(n){return["table","td","th"].indexOf(no(n))>=0}function cl(n){return((Gl(n)?n.ownerDocument:n.document)||window.document).documentElement}function qi(n){return no(n)==="html"?n:n.assignedSlot||n.parentNode||(vu(n)?n.host:null)||cl(n)}function h1(n){return!Mn(n)||Mo(n).position==="fixed"?null:n.offsetParent}function v0(n){var t=/firefox/i.test(yu()),e=/Trident/i.test(yu());if(e&&Mn(n)){var o=Mo(n);if(o.position==="fixed")return null}var s=qi(n);for(vu(s)&&(s=s.host);Mn(s)&&["html","body"].indexOf(no(s))<0;){var r=Mo(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function qr(n){for(var t=un(n),e=h1(n);e&&g0(e)&&Mo(e).position==="static";)e=h1(e);return e&&(no(e)==="html"||no(e)==="body"&&Mo(e).position==="static")?t:e||v0(n)||t}function ku(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function $r(n,t,e){return Jl(n,Qi(t,e))}function y0(n,t,e){var o=$r(n,t,e);return o>e?e:o}function m1(){return{top:0,right:0,bottom:0,left:0}}function g1(n){return Object.assign({},m1(),n)}function v1(n,t){return t.reduce(function(e,o){return e[o]=n,e},{})}var b0=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,g1(typeof t!="number"?t:v1(t,Xr))};function k0(n){var t,e=n.state,o=n.name,s=n.options,r=e.elements.arrow,a=e.modifiersData.popperOffsets,i=oo(e.placement),c=ku(i),d=[tn,Nn].indexOf(i)>=0,p=d?"height":"width";if(!(!r||!a)){var u=b0(s.padding,e),f=bu(r),h=c==="y"?$e:tn,m=c==="y"?Tn:Nn,g=e.rects.reference[p]+e.rects.reference[c]-a[c]-e.rects.popper[p],v=a[c]-e.rects.reference[c],y=qr(r),k=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,S=g/2-v/2,b=u[h],w=k-f[p]-u[m],x=k/2-f[p]/2+S,E=$r(b,x,w),B=c;e.modifiersData[o]=(t={},t[B]=E,t.centerOffset=E-x,t)}}function x0(n){var t=n.state,e=n.options,o=e.element,s=o===void 0?"[data-popper-arrow]":o;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||f1(t.elements.popper,s)&&(t.elements.arrow=s))}const w0={name:"arrow",enabled:!0,phase:"main",fn:k0,effect:x0,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Fs(n){return n.split("-")[1]}var S0={top:"auto",right:"auto",bottom:"auto",left:"auto"};function E0(n,t){var e=n.x,o=n.y,s=t.devicePixelRatio||1;return{x:Ps(e*s)/s||0,y:Ps(o*s)/s||0}}function y1(n){var t,e=n.popper,o=n.popperRect,s=n.placement,r=n.variation,a=n.offsets,i=n.position,c=n.gpuAcceleration,d=n.adaptive,p=n.roundOffsets,u=n.isFixed,f=a.x,h=f===void 0?0:f,m=a.y,g=m===void 0?0:m,v=typeof p=="function"?p({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var y=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),S=tn,b=$e,w=window;if(d){var x=qr(e),E="clientHeight",B="clientWidth";if(x===un(e)&&(x=cl(e),Mo(x).position!=="static"&&i==="absolute"&&(E="scrollHeight",B="scrollWidth")),x=x,s===$e||(s===tn||s===Nn)&&r===Zr){b=Tn;var C=u&&x===w&&w.visualViewport?w.visualViewport.height:x[E];g-=C-o.height,g*=c?1:-1}if(s===tn||(s===$e||s===Tn)&&r===Zr){S=Nn;var D=u&&x===w&&w.visualViewport?w.visualViewport.width:x[B];h-=D-o.width,h*=c?1:-1}}var R=Object.assign({position:i},d&&S0),N=p===!0?E0({x:h,y:g},un(e)):{x:h,y:g};if(h=N.x,g=N.y,c){var L;return Object.assign({},R,(L={},L[b]=k?"0":"",L[S]=y?"0":"",L.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",L))}return Object.assign({},R,(t={},t[b]=k?g+"px":"",t[S]=y?h+"px":"",t.transform="",t))}function C0(n){var t=n.state,e=n.options,o=e.gpuAcceleration,s=o===void 0?!0:o,r=e.adaptive,a=r===void 0?!0:r,i=e.roundOffsets,c=i===void 0?!0:i,d={placement:oo(t.placement),variation:Fs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,y1(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,y1(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const T0={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:C0,data:{}};var $i={passive:!0};function N0(n){var t=n.state,e=n.instance,o=n.options,s=o.scroll,r=s===void 0?!0:s,a=o.resize,i=a===void 0?!0:a,c=un(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&d.forEach(function(p){p.addEventListener("scroll",e.update,$i)}),i&&c.addEventListener("resize",e.update,$i),function(){r&&d.forEach(function(p){p.removeEventListener("scroll",e.update,$i)}),i&&c.removeEventListener("resize",e.update,$i)}}const M0={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:N0,data:{}};var B0={left:"right",right:"left",bottom:"top",top:"bottom"};function tc(n){return n.replace(/left|right|bottom|top/g,function(t){return B0[t]})}var O0={start:"end",end:"start"};function b1(n){return n.replace(/start|end/g,function(t){return O0[t]})}function xu(n){var t=un(n),e=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:e,scrollTop:o}}function wu(n){return Ls(cl(n)).left+xu(n).scrollLeft}function D0(n,t){var e=un(n),o=cl(n),s=e.visualViewport,r=o.clientWidth,a=o.clientHeight,i=0,c=0;if(s){r=s.width,a=s.height;var d=u1();(d||!d&&t==="fixed")&&(i=s.offsetLeft,c=s.offsetTop)}return{width:r,height:a,x:i+wu(n),y:c}}function V0(n){var t,e=cl(n),o=xu(n),s=(t=n.ownerDocument)==null?void 0:t.body,r=Jl(e.scrollWidth,e.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=Jl(e.scrollHeight,e.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),i=-o.scrollLeft+wu(n),c=-o.scrollTop;return Mo(s||e).direction==="rtl"&&(i+=Jl(e.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:i,y:c}}function Su(n){var t=Mo(n),e=t.overflow,o=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+s+o)}function k1(n){return["html","body","#document"].indexOf(no(n))>=0?n.ownerDocument.body:Mn(n)&&Su(n)?n:k1(qi(n))}function ta(n,t){var e;t===void 0&&(t=[]);var o=k1(n),s=o===((e=n.ownerDocument)==null?void 0:e.body),r=un(o),a=s?[r].concat(r.visualViewport||[],Su(o)?o:[]):o,i=t.concat(a);return s?i:i.concat(ta(qi(a)))}function Eu(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function A0(n,t){var e=Ls(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function x1(n,t,e){return t===i1?Eu(D0(n,e)):Gl(t)?A0(t,e):Eu(V0(cl(n)))}function I0(n){var t=ta(qi(n)),e=["absolute","fixed"].indexOf(Mo(n).position)>=0,o=e&&Mn(n)?qr(n):n;return Gl(o)?t.filter(function(s){return Gl(s)&&f1(s,o)&&no(s)!=="body"}):[]}function R0(n,t,e,o){var s=t==="clippingParents"?I0(n):[].concat(t),r=[].concat(s,[e]),a=r[0],i=r.reduce(function(c,d){var p=x1(n,d,o);return c.top=Jl(p.top,c.top),c.right=Qi(p.right,c.right),c.bottom=Qi(p.bottom,c.bottom),c.left=Jl(p.left,c.left),c},x1(n,a,o));return i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}function w1(n){var t=n.reference,e=n.element,o=n.placement,s=o?oo(o):null,r=o?Fs(o):null,a=t.x+t.width/2-e.width/2,i=t.y+t.height/2-e.height/2,c;switch(s){case $e:c={x:a,y:t.y-e.height};break;case Tn:c={x:a,y:t.y+t.height};break;case Nn:c={x:t.x+t.width,y:i};break;case tn:c={x:t.x-e.width,y:i};break;default:c={x:t.x,y:t.y}}var d=s?ku(s):null;if(d!=null){var p=d==="y"?"height":"width";switch(r){case zs:c[d]=c[d]-(t[p]/2-e[p]/2);break;case Zr:c[d]=c[d]+(t[p]/2-e[p]/2);break}}return c}function ea(n,t){t===void 0&&(t={});var e=t,o=e.placement,s=o===void 0?n.placement:o,r=e.strategy,a=r===void 0?n.strategy:r,i=e.boundary,c=i===void 0?n0:i,d=e.rootBoundary,p=d===void 0?i1:d,u=e.elementContext,f=u===void 0?Qr:u,h=e.altBoundary,m=h===void 0?!1:h,g=e.padding,v=g===void 0?0:g,y=g1(typeof v!="number"?v:v1(v,Xr)),k=f===Qr?o0:Qr,S=n.rects.popper,b=n.elements[m?k:f],w=R0(Gl(b)?b:b.contextElement||cl(n.elements.popper),c,p,a),x=Ls(n.elements.reference),E=w1({reference:x,element:S,placement:s}),B=Eu(Object.assign({},S,E)),C=f===Qr?B:x,D={top:w.top-C.top+y.top,bottom:C.bottom-w.bottom+y.bottom,left:w.left-C.left+y.left,right:C.right-w.right+y.right},R=n.modifiersData.offset;if(f===Qr&&R){var N=R[s];Object.keys(D).forEach(function(L){var z=[Nn,Tn].indexOf(L)>=0?1:-1,P=[$e,Tn].indexOf(L)>=0?"y":"x";D[L]+=N[P]*z})}return D}function z0(n,t){t===void 0&&(t={});var e=t,o=e.placement,s=e.boundary,r=e.rootBoundary,a=e.padding,i=e.flipVariations,c=e.allowedAutoPlacements,d=c===void 0?d1:c,p=Fs(o),u=p?i?c1:c1.filter(function(m){return Fs(m)===p}):Xr,f=u.filter(function(m){return d.indexOf(m)>=0});f.length===0&&(f=u);var h=f.reduce(function(m,g){return m[g]=ea(n,{placement:g,boundary:s,rootBoundary:r,padding:a})[oo(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function P0(n){if(oo(n)===gu)return[];var t=tc(n);return[b1(n),t,b1(t)]}function L0(n){var t=n.state,e=n.options,o=n.name;if(!t.modifiersData[o]._skip){for(var s=e.mainAxis,r=s===void 0?!0:s,a=e.altAxis,i=a===void 0?!0:a,c=e.fallbackPlacements,d=e.padding,p=e.boundary,u=e.rootBoundary,f=e.altBoundary,h=e.flipVariations,m=h===void 0?!0:h,g=e.allowedAutoPlacements,v=t.options.placement,y=oo(v),k=y===v,S=c||(k||!m?[tc(v)]:P0(v)),b=[v].concat(S).reduce(function(Ct,Nt){return Ct.concat(oo(Nt)===gu?z0(t,{placement:Nt,boundary:p,rootBoundary:u,padding:d,flipVariations:m,allowedAutoPlacements:g}):Nt)},[]),w=t.rects.reference,x=t.rects.popper,E=new Map,B=!0,C=b[0],D=0;D<b.length;D++){var R=b[D],N=oo(R),L=Fs(R)===zs,z=[$e,Tn].indexOf(N)>=0,P=z?"width":"height",U=ea(t,{placement:R,boundary:p,rootBoundary:u,altBoundary:f,padding:d}),O=z?L?Nn:tn:L?Tn:$e;w[P]>x[P]&&(O=tc(O));var W=tc(O),lt=[];if(r&&lt.push(U[N]<=0),i&&lt.push(U[O]<=0,U[W]<=0),lt.every(function(Ct){return Ct})){C=R,B=!1;break}E.set(R,lt)}if(B)for(var ht=m?3:1,gt=function(Nt){var St=b.find(function(xt){var K=E.get(xt);if(K)return K.slice(0,Nt).every(function(nt){return nt})});if(St)return C=St,"break"},bt=ht;bt>0;bt--){var Pt=gt(bt);if(Pt==="break")break}t.placement!==C&&(t.modifiersData[o]._skip=!0,t.placement=C,t.reset=!0)}}const F0={name:"flip",enabled:!0,phase:"main",fn:L0,requiresIfExists:["offset"],data:{_skip:!1}};function S1(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function E1(n){return[$e,Nn,Tn,tn].some(function(t){return n[t]>=0})}function j0(n){var t=n.state,e=n.name,o=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,a=ea(t,{elementContext:"reference"}),i=ea(t,{altBoundary:!0}),c=S1(a,o),d=S1(i,s,r),p=E1(c),u=E1(d);t.modifiersData[e]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}const H0={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:j0};function U0(n,t,e){var o=oo(n),s=[tn,$e].indexOf(o)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,a=r[0],i=r[1];return a=a||0,i=(i||0)*s,[tn,Nn].indexOf(o)>=0?{x:i,y:a}:{x:a,y:i}}function W0(n){var t=n.state,e=n.options,o=n.name,s=e.offset,r=s===void 0?[0,0]:s,a=d1.reduce(function(p,u){return p[u]=U0(u,t.rects,r),p},{}),i=a[t.placement],c=i.x,d=i.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[o]=a}const K0={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:W0};function _0(n){var t=n.state,e=n.name;t.modifiersData[e]=w1({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const G0={name:"popperOffsets",enabled:!0,phase:"read",fn:_0,data:{}};function J0(n){return n==="x"?"y":"x"}function Y0(n){var t=n.state,e=n.options,o=n.name,s=e.mainAxis,r=s===void 0?!0:s,a=e.altAxis,i=a===void 0?!1:a,c=e.boundary,d=e.rootBoundary,p=e.altBoundary,u=e.padding,f=e.tether,h=f===void 0?!0:f,m=e.tetherOffset,g=m===void 0?0:m,v=ea(t,{boundary:c,rootBoundary:d,padding:u,altBoundary:p}),y=oo(t.placement),k=Fs(t.placement),S=!k,b=ku(y),w=J0(b),x=t.modifiersData.popperOffsets,E=t.rects.reference,B=t.rects.popper,C=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,D=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,N={x:0,y:0};if(x){if(r){var L,z=b==="y"?$e:tn,P=b==="y"?Tn:Nn,U=b==="y"?"height":"width",O=x[b],W=O+v[z],lt=O-v[P],ht=h?-B[U]/2:0,gt=k===zs?E[U]:B[U],bt=k===zs?-B[U]:-E[U],Pt=t.elements.arrow,Ct=h&&Pt?bu(Pt):{width:0,height:0},Nt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:m1(),St=Nt[z],xt=Nt[P],K=$r(0,E[U],Ct[U]),nt=S?E[U]/2-ht-K-St-D.mainAxis:gt-K-St-D.mainAxis,F=S?-E[U]/2+ht+K+xt+D.mainAxis:bt+K+xt+D.mainAxis,T=t.elements.arrow&&qr(t.elements.arrow),Y=T?b==="y"?T.clientTop||0:T.clientLeft||0:0,Bt=(L=R==null?void 0:R[b])!=null?L:0,Ot=O+nt-Bt-Y,pt=O+F-Bt,M=$r(h?Qi(W,Ot):W,O,h?Jl(lt,pt):lt);x[b]=M,N[b]=M-O}if(i){var st,Vt=b==="x"?$e:tn,Wt=b==="x"?Tn:Nn,$t=x[w],ge=w==="y"?"height":"width",nn=$t+v[Vt],Ke=$t-v[Wt],_e=[$e,tn].indexOf(y)!==-1,Dn=(st=R==null?void 0:R[w])!=null?st:0,Vn=_e?nn:$t-E[ge]-B[ge]-Dn+D.altAxis,An=_e?$t+E[ge]+B[ge]-Dn-D.altAxis:Ke,In=h&&_e?y0(Vn,$t,An):$r(h?Vn:nn,$t,h?An:Ke);x[w]=In,N[w]=In-$t}t.modifiersData[o]=N}}const X0={name:"preventOverflow",enabled:!0,phase:"main",fn:Y0,requiresIfExists:["offset"]};function Z0(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Q0(n){return n===un(n)||!Mn(n)?xu(n):Z0(n)}function q0(n){var t=n.getBoundingClientRect(),e=Ps(t.width)/n.offsetWidth||1,o=Ps(t.height)/n.offsetHeight||1;return e!==1||o!==1}function $0(n,t,e){e===void 0&&(e=!1);var o=Mn(t),s=Mn(t)&&q0(t),r=cl(t),a=Ls(n,s,e),i={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!e)&&((no(t)!=="body"||Su(r))&&(i=Q0(t)),Mn(t)?(c=Ls(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):r&&(c.x=wu(r))),{x:a.left+i.scrollLeft-c.x,y:a.top+i.scrollTop-c.y,width:a.width,height:a.height}}function tI(n){var t=new Map,e=new Set,o=[];n.forEach(function(r){t.set(r.name,r)});function s(r){e.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(i){if(!e.has(i)){var c=t.get(i);c&&s(c)}}),o.push(r)}return n.forEach(function(r){e.has(r.name)||s(r)}),o}function eI(n){var t=tI(n);return f0.reduce(function(e,o){return e.concat(t.filter(function(s){return s.phase===o}))},[])}function nI(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function oI(n){var t=n.reduce(function(e,o){var s=e[o.name];return e[o.name]=s?Object.assign({},s,o,{options:Object.assign({},s.options,o.options),data:Object.assign({},s.data,o.data)}):o,e},{});return Object.keys(t).map(function(e){return t[e]})}var C1={placement:"bottom",modifiers:[],strategy:"absolute"};function T1(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function lI(n){n===void 0&&(n={});var t=n,e=t.defaultModifiers,o=e===void 0?[]:e,s=t.defaultOptions,r=s===void 0?C1:s;return function(i,c,d){d===void 0&&(d=r);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},C1,r),modifiersData:{},elements:{reference:i,popper:c},attributes:{},styles:{}},u=[],f=!1,h={state:p,setOptions:function(y){var k=typeof y=="function"?y(p.options):y;g(),p.options=Object.assign({},r,p.options,k),p.scrollParents={reference:Gl(i)?ta(i):i.contextElement?ta(i.contextElement):[],popper:ta(c)};var S=eI(oI([].concat(o,p.options.modifiers)));return p.orderedModifiers=S.filter(function(b){return b.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var y=p.elements,k=y.reference,S=y.popper;if(T1(k,S)){p.rects={reference:$0(k,qr(S),p.options.strategy==="fixed"),popper:bu(S)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(D){return p.modifiersData[D.name]=Object.assign({},D.data)});for(var b=0;b<p.orderedModifiers.length;b++){if(p.reset===!0){p.reset=!1,b=-1;continue}var w=p.orderedModifiers[b],x=w.fn,E=w.options,B=E===void 0?{}:E,C=w.name;typeof x=="function"&&(p=x({state:p,options:B,name:C,instance:h})||p)}}}},update:nI(function(){return new Promise(function(v){h.forceUpdate(),v(p)})}),destroy:function(){g(),f=!0}};if(!T1(i,c))return h;h.setOptions(d).then(function(v){!f&&d.onFirstUpdate&&d.onFirstUpdate(v)});function m(){p.orderedModifiers.forEach(function(v){var y=v.name,k=v.options,S=k===void 0?{}:k,b=v.effect;if(typeof b=="function"){var w=b({state:p,name:y,instance:h,options:S}),x=function(){};u.push(w||x)}})}function g(){u.forEach(function(v){return v()}),u=[]}return h}}var sI=[M0,G0,T0,p1,K0,F0,X0,w0,H0],rI=lI({defaultModifiers:sI}),aI="tippy-box",N1="tippy-content",iI="tippy-backdrop",M1="tippy-arrow",B1="tippy-svg-arrow",Yl={passive:!0,capture:!0},O1=function(){return document.body};function cI(n,t){return{}.hasOwnProperty.call(n,t)}function Cu(n,t,e){if(Array.isArray(n)){var o=n[t];return o??(Array.isArray(e)?e[t]:e)}return n}function Tu(n,t){var e={}.toString.call(n);return e.indexOf("[object")===0&&e.indexOf(t+"]")>-1}function D1(n,t){return typeof n=="function"?n.apply(void 0,t):n}function V1(n,t){if(t===0)return n;var e;return function(o){clearTimeout(e),e=setTimeout(function(){n(o)},t)}}function dI(n,t){var e=Object.assign({},n);return t.forEach(function(o){delete e[o]}),e}function pI(n){return n.split(/\s+/).filter(Boolean)}function js(n){return[].concat(n)}function A1(n,t){n.indexOf(t)===-1&&n.push(t)}function uI(n){return n.filter(function(t,e){return n.indexOf(t)===e})}function fI(n){return n.split("-")[0]}function ec(n){return[].slice.call(n)}function I1(n){return Object.keys(n).reduce(function(t,e){return n[e]!==void 0&&(t[e]=n[e]),t},{})}function na(){return document.createElement("div")}function oa(n){return["Element","Fragment"].some(function(t){return Tu(n,t)})}function hI(n){return Tu(n,"NodeList")}function mI(n){return Tu(n,"MouseEvent")}function gI(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function vI(n){return oa(n)?[n]:hI(n)?ec(n):Array.isArray(n)?n:ec(document.querySelectorAll(n))}function Nu(n,t){n.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function R1(n,t){n.forEach(function(e){e&&e.setAttribute("data-state",t)})}function yI(n){var t,e=js(n),o=e[0];return o!=null&&(t=o.ownerDocument)!=null&&t.body?o.ownerDocument:document}function bI(n,t){var e=t.clientX,o=t.clientY;return n.every(function(s){var r=s.popperRect,a=s.popperState,i=s.props,c=i.interactiveBorder,d=fI(a.placement),p=a.modifiersData.offset;if(!p)return!0;var u=d==="bottom"?p.top.y:0,f=d==="top"?p.bottom.y:0,h=d==="right"?p.left.x:0,m=d==="left"?p.right.x:0,g=r.top-o+u>c,v=o-r.bottom-f>c,y=r.left-e+h>c,k=e-r.right-m>c;return g||v||y||k})}function Mu(n,t,e){var o=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(s){n[o](s,e)})}function z1(n,t){for(var e=t;e;){var o;if(n.contains(e))return!0;e=e.getRootNode==null||(o=e.getRootNode())==null?void 0:o.host}return!1}var lo={isTouch:!1},P1=0;function kI(){lo.isTouch||(lo.isTouch=!0,window.performance&&document.addEventListener("mousemove",L1))}function L1(){var n=performance.now();n-P1<20&&(lo.isTouch=!1,document.removeEventListener("mousemove",L1)),P1=n}function xI(){var n=document.activeElement;if(gI(n)){var t=n._tippy;n.blur&&!t.state.isVisible&&n.blur()}}function wI(){document.addEventListener("touchstart",kI,Yl),window.addEventListener("blur",xI)}var SI=typeof window<"u"&&typeof document<"u",EI=SI?!!window.msCrypto:!1;function Hs(n){var t=n==="destroy"?"n already-":" ";return[n+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function F1(n){var t=/[ \t]{2,}/g,e=/^[ \t]*/gm;return n.replace(t," ").replace(e,"").trim()}function CI(n){return F1(`
568
+ %ctippy.js
569
+
570
+ %c`+F1(n)+`
571
+
572
+ %c👷‍ This is a development-only message. It will be removed in production.
573
+ `)}function j1(n){return[CI(n),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var la;process.env.NODE_ENV!=="production"&&TI();function TI(){la=new Set}function Bo(n,t){if(n&&!la.has(t)){var e;la.add(t),(e=console).warn.apply(e,j1(t))}}function Bu(n,t){if(n&&!la.has(t)){var e;la.add(t),(e=console).error.apply(e,j1(t))}}function NI(n){var t=!n,e=Object.prototype.toString.call(n)==="[object Object]"&&!n.addEventListener;Bu(t,["tippy() was passed","`"+String(n)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Bu(e,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var H1={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},MI={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},fn=Object.assign({appendTo:O1,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},H1,MI),BI=Object.keys(fn),OI=function(t){process.env.NODE_ENV!=="production"&&K1(t,[]);var e=Object.keys(t);e.forEach(function(o){fn[o]=t[o]})};function U1(n){var t=n.plugins||[],e=t.reduce(function(o,s){var r=s.name,a=s.defaultValue;if(r){var i;o[r]=n[r]!==void 0?n[r]:(i=fn[r])!=null?i:a}return o},{});return Object.assign({},n,e)}function DI(n,t){var e=t?Object.keys(U1(Object.assign({},fn,{plugins:t}))):BI,o=e.reduce(function(s,r){var a=(n.getAttribute("data-tippy-"+r)||"").trim();if(!a)return s;if(r==="content")s[r]=a;else try{s[r]=JSON.parse(a)}catch{s[r]=a}return s},{});return o}function W1(n,t){var e=Object.assign({},t,{content:D1(t.content,[n])},t.ignoreAttributes?{}:DI(n,t.plugins));return e.aria=Object.assign({},fn.aria,e.aria),e.aria={expanded:e.aria.expanded==="auto"?t.interactive:e.aria.expanded,content:e.aria.content==="auto"?t.interactive?null:"describedby":e.aria.content},e}function K1(n,t){n===void 0&&(n={}),t===void 0&&(t=[]);var e=Object.keys(n);e.forEach(function(o){var s=dI(fn,Object.keys(H1)),r=!cI(s,o);r&&(r=t.filter(function(a){return a.name===o}).length===0),Bo(r,["`"+o+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
574
+
575
+ `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
576
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var VI=function(){return"innerHTML"};function Ou(n,t){n[VI()]=t}function _1(n){var t=na();return n===!0?t.className=M1:(t.className=B1,oa(n)?t.appendChild(n):Ou(t,n)),t}function G1(n,t){oa(t.content)?(Ou(n,""),n.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Ou(n,t.content):n.textContent=t.content)}function Du(n){var t=n.firstElementChild,e=ec(t.children);return{box:t,content:e.find(function(o){return o.classList.contains(N1)}),arrow:e.find(function(o){return o.classList.contains(M1)||o.classList.contains(B1)}),backdrop:e.find(function(o){return o.classList.contains(iI)})}}function J1(n){var t=na(),e=na();e.className=aI,e.setAttribute("data-state","hidden"),e.setAttribute("tabindex","-1");var o=na();o.className=N1,o.setAttribute("data-state","hidden"),G1(o,n.props),t.appendChild(e),e.appendChild(o),s(n.props,n.props);function s(r,a){var i=Du(t),c=i.box,d=i.content,p=i.arrow;a.theme?c.setAttribute("data-theme",a.theme):c.removeAttribute("data-theme"),typeof a.animation=="string"?c.setAttribute("data-animation",a.animation):c.removeAttribute("data-animation"),a.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?c.setAttribute("role",a.role):c.removeAttribute("role"),(r.content!==a.content||r.allowHTML!==a.allowHTML)&&G1(d,n.props),a.arrow?p?r.arrow!==a.arrow&&(c.removeChild(p),c.appendChild(_1(a.arrow))):c.appendChild(_1(a.arrow)):p&&c.removeChild(p)}return{popper:t,onUpdate:s}}J1.$$tippy=!0;var AI=1,nc=[],Vu=[];function II(n,t){var e=W1(n,Object.assign({},fn,U1(I1(t)))),o,s,r,a=!1,i=!1,c=!1,d=!1,p,u,f,h=[],m=V1(Ot,e.interactiveDebounce),g,v=AI++,y=null,k=uI(e.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:v,reference:n,popper:na(),popperInstance:y,props:e,state:S,plugins:k,clearDelayTimeouts:Vn,setProps:An,setContent:In,show:I,hide:A,hideWithInteractivity:j,enable:_e,disable:Dn,unmount:J,destroy:it};if(!e.render)return process.env.NODE_ENV!=="production"&&Bu(!0,"render() function has not been supplied."),b;var w=e.render(b),x=w.popper,E=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,n._tippy=b,x._tippy=b;var B=k.map(function(V){return V.fn(b)}),C=n.hasAttribute("aria-expanded");return T(),ht(),O(),W("onCreate",[b]),e.showOnCreate&&nn(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&z().addEventListener("mousemove",m)}),b;function D(){var V=b.props.touch;return Array.isArray(V)?V:[V,0]}function R(){return D()[0]==="hold"}function N(){var V;return!!((V=b.props.render)!=null&&V.$$tippy)}function L(){return g||n}function z(){var V=L().parentNode;return V?yI(V):document}function P(){return Du(x)}function U(V){return b.state.isMounted&&!b.state.isVisible||lo.isTouch||p&&p.type==="focus"?0:Cu(b.props.delay,V?0:1,fn.delay)}function O(V){V===void 0&&(V=!1),x.style.pointerEvents=b.props.interactive&&!V?"":"none",x.style.zIndex=""+b.props.zIndex}function W(V,_,q){if(q===void 0&&(q=!0),B.forEach(function(Z){Z[V]&&Z[V].apply(Z,_)}),q){var dt;(dt=b.props)[V].apply(dt,_)}}function lt(){var V=b.props.aria;if(V.content){var _="aria-"+V.content,q=x.id,dt=js(b.props.triggerTarget||n);dt.forEach(function(Z){var Q=Z.getAttribute(_);if(b.state.isVisible)Z.setAttribute(_,Q?Q+" "+q:q);else{var ot=Q&&Q.replace(q,"").trim();ot?Z.setAttribute(_,ot):Z.removeAttribute(_)}})}}function ht(){if(!(C||!b.props.aria.expanded)){var V=js(b.props.triggerTarget||n);V.forEach(function(_){b.props.interactive?_.setAttribute("aria-expanded",b.state.isVisible&&_===L()?"true":"false"):_.removeAttribute("aria-expanded")})}}function gt(){z().removeEventListener("mousemove",m),nc=nc.filter(function(V){return V!==m})}function bt(V){if(!(lo.isTouch&&(c||V.type==="mousedown"))){var _=V.composedPath&&V.composedPath()[0]||V.target;if(!(b.props.interactive&&z1(x,_))){if(js(b.props.triggerTarget||n).some(function(q){return z1(q,_)})){if(lo.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else W("onClickOutside",[b,V]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),i=!0,setTimeout(function(){i=!1}),b.state.isMounted||St())}}}function Pt(){c=!0}function Ct(){c=!1}function Nt(){var V=z();V.addEventListener("mousedown",bt,!0),V.addEventListener("touchend",bt,Yl),V.addEventListener("touchstart",Ct,Yl),V.addEventListener("touchmove",Pt,Yl)}function St(){var V=z();V.removeEventListener("mousedown",bt,!0),V.removeEventListener("touchend",bt,Yl),V.removeEventListener("touchstart",Ct,Yl),V.removeEventListener("touchmove",Pt,Yl)}function xt(V,_){nt(V,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&_()})}function K(V,_){nt(V,_)}function nt(V,_){var q=P().box;function dt(Z){Z.target===q&&(Mu(q,"remove",dt),_())}if(V===0)return _();Mu(q,"remove",u),Mu(q,"add",dt),u=dt}function F(V,_,q){q===void 0&&(q=!1);var dt=js(b.props.triggerTarget||n);dt.forEach(function(Z){Z.addEventListener(V,_,q),h.push({node:Z,eventType:V,handler:_,options:q})})}function T(){R()&&(F("touchstart",Bt,{passive:!0}),F("touchend",pt,{passive:!0})),pI(b.props.trigger).forEach(function(V){if(V!=="manual")switch(F(V,Bt),V){case"mouseenter":F("mouseleave",pt);break;case"focus":F(EI?"focusout":"blur",M);break;case"focusin":F("focusout",M);break}})}function Y(){h.forEach(function(V){var _=V.node,q=V.eventType,dt=V.handler,Z=V.options;_.removeEventListener(q,dt,Z)}),h=[]}function Bt(V){var _,q=!1;if(!(!b.state.isEnabled||st(V)||i)){var dt=((_=p)==null?void 0:_.type)==="focus";p=V,g=V.currentTarget,ht(),!b.state.isVisible&&mI(V)&&nc.forEach(function(Z){return Z(V)}),V.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||a)&&b.props.hideOnClick!==!1&&b.state.isVisible?q=!0:nn(V),V.type==="click"&&(a=!q),q&&!dt&&Ke(V)}}function Ot(V){var _=V.target,q=L().contains(_)||x.contains(_);if(!(V.type==="mousemove"&&q)){var dt=ge().concat(x).map(function(Z){var Q,ot=Z._tippy,wt=(Q=ot.popperInstance)==null?void 0:Q.state;return wt?{popperRect:Z.getBoundingClientRect(),popperState:wt,props:e}:null}).filter(Boolean);bI(dt,V)&&(gt(),Ke(V))}}function pt(V){var _=st(V)||b.props.trigger.indexOf("click")>=0&&a;if(!_){if(b.props.interactive){b.hideWithInteractivity(V);return}Ke(V)}}function M(V){b.props.trigger.indexOf("focusin")<0&&V.target!==L()||b.props.interactive&&V.relatedTarget&&x.contains(V.relatedTarget)||Ke(V)}function st(V){return lo.isTouch?R()!==V.type.indexOf("touch")>=0:!1}function Vt(){Wt();var V=b.props,_=V.popperOptions,q=V.placement,dt=V.offset,Z=V.getReferenceClientRect,Q=V.moveTransition,ot=N()?Du(x).arrow:null,wt=Z?{getBoundingClientRect:Z,contextElement:Z.contextElement||L()}:n,At={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ao){var on=Ao.state;if(N()){var af=P(),ma=af.box;["placement","reference-hidden","escaped"].forEach(function(Ks){Ks==="placement"?ma.setAttribute("data-placement",on.placement):on.attributes.popper["data-popper-"+Ks]?ma.setAttribute("data-"+Ks,""):ma.removeAttribute("data-"+Ks)}),on.attributes.popper={}}}},Xt=[{name:"offset",options:{offset:dt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Q}},At];N()&&ot&&Xt.push({name:"arrow",options:{element:ot,padding:3}}),Xt.push.apply(Xt,(_==null?void 0:_.modifiers)||[]),b.popperInstance=rI(wt,x,Object.assign({},_,{placement:q,onFirstUpdate:f,modifiers:Xt}))}function Wt(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function $t(){var V=b.props.appendTo,_,q=L();b.props.interactive&&V===O1||V==="parent"?_=q.parentNode:_=D1(V,[q]),_.contains(x)||_.appendChild(x),b.state.isMounted=!0,Vt(),process.env.NODE_ENV!=="production"&&Bo(b.props.interactive&&V===fn.appendTo&&q.nextElementSibling!==x,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
577
+
578
+ `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
579
+
580
+ `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
581
+
582
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function ge(){return ec(x.querySelectorAll("[data-tippy-root]"))}function nn(V){b.clearDelayTimeouts(),V&&W("onTrigger",[b,V]),Nt();var _=U(!0),q=D(),dt=q[0],Z=q[1];lo.isTouch&&dt==="hold"&&Z&&(_=Z),_?o=setTimeout(function(){b.show()},_):b.show()}function Ke(V){if(b.clearDelayTimeouts(),W("onUntrigger",[b,V]),!b.state.isVisible){St();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(V.type)>=0&&a)){var _=U(!1);_?s=setTimeout(function(){b.state.isVisible&&b.hide()},_):r=requestAnimationFrame(function(){b.hide()})}}function _e(){b.state.isEnabled=!0}function Dn(){b.hide(),b.state.isEnabled=!1}function Vn(){clearTimeout(o),clearTimeout(s),cancelAnimationFrame(r)}function An(V){if(process.env.NODE_ENV!=="production"&&Bo(b.state.isDestroyed,Hs("setProps")),!b.state.isDestroyed){W("onBeforeUpdate",[b,V]),Y();var _=b.props,q=W1(n,Object.assign({},_,I1(V),{ignoreAttributes:!0}));b.props=q,T(),_.interactiveDebounce!==q.interactiveDebounce&&(gt(),m=V1(Ot,q.interactiveDebounce)),_.triggerTarget&&!q.triggerTarget?js(_.triggerTarget).forEach(function(dt){dt.removeAttribute("aria-expanded")}):q.triggerTarget&&n.removeAttribute("aria-expanded"),ht(),O(),E&&E(_,q),b.popperInstance&&(Vt(),ge().forEach(function(dt){requestAnimationFrame(dt._tippy.popperInstance.forceUpdate)})),W("onAfterUpdate",[b,V])}}function In(V){b.setProps({content:V})}function I(){process.env.NODE_ENV!=="production"&&Bo(b.state.isDestroyed,Hs("show"));var V=b.state.isVisible,_=b.state.isDestroyed,q=!b.state.isEnabled,dt=lo.isTouch&&!b.props.touch,Z=Cu(b.props.duration,0,fn.duration);if(!(V||_||q||dt)&&!L().hasAttribute("disabled")&&(W("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,N()&&(x.style.visibility="visible"),O(),Nt(),b.state.isMounted||(x.style.transition="none"),N()){var Q=P(),ot=Q.box,wt=Q.content;Nu([ot,wt],0)}f=function(){var Xt;if(!(!b.state.isVisible||d)){if(d=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,N()&&b.props.animation){var Ge=P(),Ao=Ge.box,on=Ge.content;Nu([Ao,on],Z),R1([Ao,on],"visible")}lt(),ht(),A1(Vu,b),(Xt=b.popperInstance)==null||Xt.forceUpdate(),W("onMount",[b]),b.props.animation&&N()&&K(Z,function(){b.state.isShown=!0,W("onShown",[b])})}},$t()}}function A(){process.env.NODE_ENV!=="production"&&Bo(b.state.isDestroyed,Hs("hide"));var V=!b.state.isVisible,_=b.state.isDestroyed,q=!b.state.isEnabled,dt=Cu(b.props.duration,1,fn.duration);if(!(V||_||q)&&(W("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,a=!1,N()&&(x.style.visibility="hidden"),gt(),St(),O(!0),N()){var Z=P(),Q=Z.box,ot=Z.content;b.props.animation&&(Nu([Q,ot],dt),R1([Q,ot],"hidden"))}lt(),ht(),b.props.animation?N()&&xt(dt,b.unmount):b.unmount()}}function j(V){process.env.NODE_ENV!=="production"&&Bo(b.state.isDestroyed,Hs("hideWithInteractivity")),z().addEventListener("mousemove",m),A1(nc,m),m(V)}function J(){process.env.NODE_ENV!=="production"&&Bo(b.state.isDestroyed,Hs("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(Wt(),ge().forEach(function(V){V._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),Vu=Vu.filter(function(V){return V!==b}),b.state.isMounted=!1,W("onHidden",[b]))}function it(){process.env.NODE_ENV!=="production"&&Bo(b.state.isDestroyed,Hs("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),Y(),delete n._tippy,b.state.isDestroyed=!0,W("onDestroy",[b]))}}function Us(n,t){t===void 0&&(t={});var e=fn.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(NI(n),K1(t,e)),wI();var o=Object.assign({},t,{plugins:e}),s=vI(n);if(process.env.NODE_ENV!=="production"){var r=oa(o.content),a=s.length>1;Bo(r&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
583
+
584
+ `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
585
+
586
+ `,`1) content: element.innerHTML
587
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var i=s.reduce(function(c,d){var p=d&&II(d,o);return p&&c.push(p),c},[]);return oa(n)?i[0]:i}Us.defaultProps=fn,Us.setDefaultProps=OI,Us.currentInput=lo,Object.assign({},p1,{effect:function(t){var e=t.state,o={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,o.popper),e.styles=o,e.elements.arrow&&Object.assign(e.elements.arrow.style,o.arrow)}}),Us.setDefaultProps({render:J1});class RI{constructor({editor:t,element:e,view:o,tippyOptions:s={},updateDelay:r=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:i,state:c,from:d,to:p})=>{const{doc:u,selection:f}=c,{empty:h}=f,m=!u.textBetween(d,p).length&&Hr(c.selection),g=this.element.contains(document.activeElement);return!(!(i.hasFocus()||g)||h||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:i})=>{var c;if(this.preventHide){this.preventHide=!1;return}i!=null&&i.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(i.relatedTarget))||(i==null?void 0:i.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=i=>{this.blurHandler({event:i})},this.handleDebouncedUpdate=(i,c)=>{const d=!(c!=null&&c.selection.eq(i.state.selection)),p=!(c!=null&&c.doc.eq(i.state.doc));!d&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(i,d,p,c)},this.updateDelay))},this.updateHandler=(i,c,d,p)=>{var u,f,h;const{state:m,composing:g}=i,{selection:v}=m;if(g||!c&&!d)return;this.createTooltip();const{ranges:k}=v,S=Math.min(...k.map(x=>x.$from.pos)),b=Math.max(...k.map(x=>x.$to.pos));if(!((u=this.shouldShow)===null||u===void 0?void 0:u.call(this,{editor:this.editor,element:this.element,view:i,state:m,oldState:p,from:S,to:b}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(Xi(m.selection)){let x=i.nodeDOM(S);if(x){const E=x.dataset.nodeViewWrapper?x:x.querySelector("[data-node-view-wrapper]");if(E&&(x=E.firstChild),x)return x.getBoundingClientRect()}}return Zi(i,S,b)})}),this.show()},this.editor=t,this.element=e,this.view=o,this.updateDelay=r,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=s,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;this.element.tabIndex=0,!(this.tippy||!e)&&(this.tippy=Us(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,e){const{state:o}=t,s=o.selection.from!==o.selection.to;if(this.updateDelay>0&&s){this.handleDebouncedUpdate(t,e);return}const r=!(e!=null&&e.selection.eq(t.state.selection)),a=!(e!=null&&e.doc.eq(t.state.doc));this.updateHandler(t,r,a,e)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,e;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(e=this.tippy)===null||e===void 0||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Y1=n=>new he({key:typeof n.pluginKey=="string"?new He(n.pluginKey):n.pluginKey,view:t=>new RI({view:t,...n})});pe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Y1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class zI{getTextContent(t){return Kr(t,{textSerializers:Ds(this.editor.schema)})}constructor({editor:t,element:e,view:o,tippyOptions:s={},shouldShow:r}){this.preventHide=!1,this.shouldShow=({view:a,state:i})=>{const{selection:c}=i,{$anchor:d,empty:p}=c,u=d.depth===1,f=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent&&d.parent.childCount===0&&!this.getTextContent(d.parent);return!(!a.hasFocus()||!p||!u||!f||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var i;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((i=this.element.parentNode)===null||i===void 0)&&i.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.editor=t,this.element=e,this.view=o,r&&(this.shouldShow=r),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=s,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;this.element.tabIndex=0,!(this.tippy||!e)&&(this.tippy=Us(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,e){var o,s,r;const{state:a}=t,{doc:i,selection:c}=a,{from:d,to:p}=c;if(e&&e.doc.eq(i)&&e.selection.eq(c))return;if(this.createTooltip(),!((o=this.shouldShow)===null||o===void 0?void 0:o.call(this,{editor:this.editor,view:t,state:a,oldState:e}))){this.hide();return}(s=this.tippy)===null||s===void 0||s.setProps({getReferenceClientRect:((r=this.tippyOptions)===null||r===void 0?void 0:r.getReferenceClientRect)||(()=>Zi(t,d,p))}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,e;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(e=this.tippy)===null||e===void 0||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const X1=n=>new he({key:typeof n.pluginKey=="string"?new He(n.pluginKey):n.pluginKey,view:t=>new zI({view:t,...n})});pe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[X1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const PI=l.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:t}){const e=l.ref(null);return l.onMounted(()=>{const{updateDelay:o,editor:s,pluginKey:r,shouldShow:a,tippyOptions:i}=n;s.registerPlugin(Y1({updateDelay:o,editor:s,element:e.value,pluginKey:r,shouldShow:a,tippyOptions:i}))}),l.onBeforeUnmount(()=>{const{pluginKey:o,editor:s}=n;s.unregisterPlugin(o)}),()=>{var o;return l.h("div",{ref:e},(o=t.default)===null||o===void 0?void 0:o.call(t))}}});function Z1(n){return l.customRef((t,e)=>({get(){return t(),n},set(o){n=o,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e()})})}}))}class Q1 extends e1{constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=Z1(this.view.state),this.reactiveExtensionStorage=Z1(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),l.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,e){const o=super.registerPlugin(t,e);return this.reactiveState&&(this.reactiveState.value=o),o}unregisterPlugin(t){const e=super.unregisterPlugin(t);return this.reactiveState&&e&&(this.reactiveState.value=e),e}}const LI=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const t=l.ref(),e=l.getCurrentInstance();return l.watchEffect(()=>{const o=n.editor;o&&o.options.element&&t.value&&l.nextTick(()=>{if(!t.value||!o.options.element.firstChild)return;const s=l.unref(t.value);t.value.append(...o.options.element.childNodes),o.contentComponent=e.ctx._,e&&(o.appContext={...e.appContext,provides:e.provides}),o.setOptions({element:s}),o.createNodeViews()})}),l.onBeforeUnmount(()=>{const o=n.editor;o&&(o.contentComponent=null,o.appContext=null)}),{rootEl:t}},render(){return l.h("div",{ref:n=>{this.rootEl=n}})}}),FI=l.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:t}){const e=l.ref(null);return l.onMounted(()=>{const{pluginKey:o,editor:s,tippyOptions:r,shouldShow:a}=n;s.registerPlugin(X1({pluginKey:o,editor:s,element:e.value,tippyOptions:r,shouldShow:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:o,editor:s}=n;s.unregisterPlugin(o)}),()=>{var o;return l.h("div",{ref:e},(o=t.default)===null||o===void 0?void 0:o.call(t))}}}),jI=l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),Au=l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,t;return l.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(t=(n=this.$slots).default)===null||t===void 0?void 0:t.call(n))}}),HI=(n={})=>{const t=l.shallowRef();return l.onMounted(()=>{t.value=new Q1(n)}),l.onBeforeUnmount(()=>{var e,o,s;const r=(e=t.value)===null||e===void 0?void 0:e.options.element,a=r==null?void 0:r.cloneNode(!0);(o=r==null?void 0:r.parentNode)===null||o===void 0||o.replaceChild(a,r),(s=t.value)===null||s===void 0||s.destroy()}),t};class q1{constructor(t,{props:e={},editor:o}){this.editor=o,this.component=l.markRaw(t),this.el=document.createElement("div"),this.props=l.reactive(e),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var t,e,o,s;return!((e=(t=this.renderedComponent.vNode)===null||t===void 0?void 0:t.component)===null||e===void 0)&&e.exposed?this.renderedComponent.vNode.component.exposed:(s=(o=this.renderedComponent.vNode)===null||o===void 0?void 0:o.component)===null||s===void 0?void 0:s.proxy}renderComponent(){let t=l.h(this.component,this.props);return this.editor.appContext&&(t.appContext=this.editor.appContext),typeof document<"u"&&this.el&&l.render(t,this.el),{vNode:t,destroy:()=>{this.el&&l.render(null,this.el),this.el=null,t=null},el:this.el?this.el.firstElementChild:null}}updateProps(t={}){Object.entries(t).forEach(([e,o])=>{this.props[e]=o}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const UI={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}};class WI extends hu{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(s={})=>this.updateAttributes(s),deleteNode:()=>this.deleteNode()},e=this.onDragStart.bind(this);this.decorationClasses=l.ref(this.getDecorationClasses());const o=l.defineComponent({extends:{...this.component},props:Object.keys(t),template:this.component.template,setup:s=>{var r,a;return l.provide("onDragStart",e),l.provide("decorationClasses",this.decorationClasses),(a=(r=this.component).setup)===null||a===void 0?void 0:a.call(r,s,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new q1(o,{editor:this.editor,props:t})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:t,to:e}=this.editor.state.selection,o=this.getPos();if(typeof o=="number")if(t<=o&&e>=o+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(t,e,o){const s=r=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(r)};if(typeof this.options.update=="function"){const r=this.node,a=this.decorations,i=this.innerDecorations;return this.node=t,this.decorations=e,this.innerDecorations=o,this.options.update({oldNode:r,oldDecorations:a,newNode:t,newDecorations:e,oldInnerDecorations:i,innerDecorations:o,updateProps:()=>s({node:t,decorations:e,innerDecorations:o})})}return t.type!==this.node.type?!1:(t===this.node&&this.decorations===e&&this.innerDecorations===o||(this.node=t,this.decorations=e,this.innerDecorations=o,s({node:t,decorations:e,innerDecorations:o})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(t=>t.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function Iu(n,t){return e=>{if(!e.editor.contentComponent)return{};const o=typeof n=="function"&&"__vccOpts"in n?n.__vccOpts:n;return new WI(o,e,t)}}const KI=Object.freeze(Object.defineProperty({__proto__:null,BubbleMenu:PI,CommandManager:Ts,Editor:Q1,EditorContent:LI,Extension:pe,FloatingMenu:FI,InputRule:Co,Mark:qe,Node:xe,NodePos:To,NodeView:hu,NodeViewContent:jI,NodeViewWrapper:Au,PasteRule:Fl,Tracker:a1,VueNodeViewRenderer:Iu,VueRenderer:q1,callOrReturn:Mt,canInsertNode:mu,combineTransactionSteps:eu,createChainableState:Cs,createDocument:Ur,createNodeFromContent:Wl,createStyleTag:uu,defaultBlockAt:nu,deleteProps:_i,elementFromString:Ul,escapeForRegEx:o1,extensions:t1,findChildren:zy,findChildrenInRange:ou,findDuplicates:Qp,findParentNode:Is,findParentNodeClosestToPos:lu,fromString:Gp,generateHTML:Py,generateJSON:Ly,generateText:Fy,getAttributes:Ji,getAttributesFromExtensions:Ri,getChangedRanges:au,getDebugJSON:iu,getExtensionField:ct,getHTMLFromFragment:Ms,getMarkAttributes:Gi,getMarkRange:jr,getMarkType:eo,getMarksBetween:_r,getNodeAtPosition:jy,getNodeAttributes:su,getNodeType:de,getRenderedAttributes:Pr,getSchema:Wr,getSchemaByResolvedExtensions:Li,getSchemaTypeByName:Lr,getSchemaTypeNameByName:As,getSplittedAttributes:Rs,getText:Kr,getTextBetween:Ui,getTextContentFromNodes:Jp,getTextSerializersFromSchema:Ds,injectExtensionAttributesToParseRule:Pi,inputRulesPlugin:Yp,isActive:cu,isAtEndOfNode:Hy,isAtStartOfNode:Uy,isEmptyObject:_p,isExtensionRulesEnabled:Fi,isFunction:zi,isList:Yi,isMacOS:Ki,isMarkActive:Gr,isNodeActive:Kl,isNodeEmpty:Jr,isNodeSelection:Xi,isNumber:Xp,isPlainObject:Bs,isRegExp:Fr,isSafari:$p,isString:l1,isTextSelection:Hr,isiOS:Hl,markInputRule:il,markPasteRule:No,mergeAttributes:qt,mergeDeep:Os,minMax:Un,nodeInputRule:fu,nodePasteRule:s1,nodeViewProps:UI,objectIncludes:Vs,pasteRulesPlugin:Zp,posToDOMRect:Zi,removeDuplicates:ru,resolveFocusPosition:Wi,rewriteUnknownContent:Ky,selectionToInsertionEnd:tu,splitExtensions:Ns,textInputRule:n1,textPasteRule:r1,textblockTypeInputRule:Yr,useEditor:HI,wrappingInputRule:_l},Symbol.toStringTag,{value:"Module"})),_I=/^\s*>\s$/,GI=xe.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[_l({find:_I,type:this.type})]}}),JI=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,YI=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,XI=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,ZI=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,QI=qe.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[il({find:JI,type:this.type}),il({find:XI,type:this.type})]},addPasteRules(){return[No({find:YI,type:this.type}),No({find:ZI,type:this.type})]}}),qI="listItem",$1="textStyle",tb=/^\s*([-+*])\s$/,$I=xe.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(qI,this.editor.getAttributes($1)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=_l({find:tb,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=_l({find:tb,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes($1),editor:this.editor})),[n]}}),t6=/(^|[^`])`([^`]+)`(?!`)/,e6=/(^|[^`])`([^`]+)`(?!`)/g,n6=qe.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[il({find:t6,type:this.type})]},addPasteRules(){return[No({find:e6,type:this.type})]}}),o6=/^```([a-z]+)?[\s\n]$/,l6=/^~~~([a-z]+)?[\s\n]$/,s6=xe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var t;const{languageClassPrefix:e}=this.options,r=[...((t=n.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(e)).map(a=>a.replace(e,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:t}){return["pre",qt(this.options.HTMLAttributes,t),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:t})=>t.setNode(this.name,n),toggleCodeBlock:n=>({commands:t})=>t.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:t}=this.editor.state.selection,e=t.pos===1;return!n||t.parent.type.name!==this.name?!1:e||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=n,{selection:e}=t,{$from:o,empty:s}=e;if(!s||o.parent.type!==this.type)return!1;const r=o.parentOffset===o.parent.nodeSize-2,a=o.parent.textContent.endsWith(`
588
+
589
+ `);return!r||!a?!1:n.chain().command(({tr:i})=>(i.delete(o.pos-2,o.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=n,{selection:e,doc:o}=t,{$from:s,empty:r}=e;if(!r||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const i=s.after();return i===void 0?!1:o.nodeAt(i)?n.commands.command(({tr:d})=>(d.setSelection(Rt.near(o.resolve(i))),!0)):n.commands.exitCode()}}},addInputRules(){return[Yr({find:o6,type:this.type,getAttributes:n=>({language:n[1]})}),Yr({find:l6,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new he({key:new He("codeBlockVSCodeHandler"),props:{handlePaste:(n,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const e=t.clipboardData.getData("text/plain"),o=t.clipboardData.getData("vscode-editor-data"),s=o?JSON.parse(o):void 0,r=s==null?void 0:s.mode;if(!e||!r)return!1;const{tr:a,schema:i}=n.state,c=i.text(e.replace(/\r\n?/g,`
590
+ `));return a.replaceSelectionWith(this.type.create({language:r},c)),a.selection.$from.parent.type!==this.type&&a.setSelection(Et.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),n.dispatch(a),!0}}})]}}),r6=xe.create({name:"doc",topNode:!0,content:"block+"});function a6(n={}){return new he({view(t){return new i6(t,n)}})}class i6{constructor(t,e){var o;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=e.width)!==null&&o!==void 0?o:1,this.color=e.color===!1?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let r=a=>{this[s](a)};return t.dom.addEventListener(s,r),{name:s,handler:r}})}destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){this.cursorPos!=null&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),e=!t.parent.inlineContent,o,s=this.editorView.dom,r=s.getBoundingClientRect(),a=r.width/s.offsetWidth,i=r.height/s.offsetHeight;if(e){let u=t.nodeBefore,f=t.nodeAfter;if(u||f){let h=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(h){let m=h.getBoundingClientRect(),g=u?m.bottom:m.top;u&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*i;o={left:m.left,right:m.right,top:g-v,bottom:g+v}}}}if(!o){let u=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*a;o={left:u.left-f,right:u.left+f,top:u.top,bottom:u.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",e),this.element.classList.toggle("prosemirror-dropcursor-inline",!e);let d,p;if(!c||c==document.body&&getComputedStyle(c).position=="static")d=-pageXOffset,p=-pageYOffset;else{let u=c.getBoundingClientRect(),f=u.width/c.offsetWidth,h=u.height/c.offsetHeight;d=u.left-c.scrollLeft*f,p=u.top-c.scrollTop*h}this.element.style.left=(o.left-d)/a+"px",this.element.style.top=(o.top-p)/i+"px",this.element.style.width=(o.right-o.left)/a+"px",this.element.style.height=(o.bottom-o.top)/i+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),o=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),s=o&&o.type.spec.disableDropCursor,r=typeof s=="function"?s(this.editorView,e,t):s;if(e&&!r){let a=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let i=Wg(this.editorView.state.doc,a,this.editorView.dragging.slice);i!=null&&(a=i)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const c6=pe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[a6(this.options)]}});class se extends Rt{constructor(t){super(t,t)}map(t,e){let o=t.resolve(e.map(this.head));return se.valid(o)?new se(o):Rt.near(o)}content(){return rt.empty}eq(t){return t instanceof se&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new se(t.resolve(e.pos))}getBookmark(){return new Ru(this.anchor)}static valid(t){let e=t.parent;if(e.inlineContent||!d6(t)||!p6(t))return!1;let o=e.type.spec.allowGapCursor;if(o!=null)return o;let s=e.contentMatchAt(t.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(t,e,o=!1){t:for(;;){if(!o&&se.valid(t))return t;let s=t.pos,r=null;for(let a=t.depth;;a--){let i=t.node(a);if(e>0?t.indexAfter(a)<i.childCount:t.index(a)>0){r=i.child(e>0?t.indexAfter(a):t.index(a)-1);break}else if(a==0)return null;s+=e;let c=t.doc.resolve(s);if(se.valid(c))return c}for(;;){let a=e>0?r.firstChild:r.lastChild;if(!a){if(r.isAtom&&!r.isText&&!vt.isSelectable(r)){t=t.doc.resolve(s+r.nodeSize*e),o=!1;continue t}break}r=a,s+=e;let i=t.doc.resolve(s);if(se.valid(i))return i}return null}}}se.prototype.visible=!1,se.findFrom=se.findGapCursorFrom,Rt.jsonID("gapcursor",se);class Ru{constructor(t){this.pos=t}map(t){return new Ru(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return se.valid(e)?new se(e):Rt.near(e)}}function eb(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function d6(n){for(let t=n.depth;t>=0;t--){let e=n.index(t),o=n.node(t);if(e==0){if(o.type.spec.isolating)return!0;continue}for(let s=o.child(e-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||eb(s.type))return!0;if(s.inlineContent)return!1}}return!0}function p6(n){for(let t=n.depth;t>=0;t--){let e=n.indexAfter(t),o=n.node(t);if(e==o.childCount){if(o.type.spec.isolating)return!0;continue}for(let s=o.child(e);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||eb(s.type))return!0;if(s.inlineContent)return!1}}return!0}function u6(){return new he({props:{decorations:g6,createSelectionBetween(n,t,e){return t.pos==e.pos&&se.valid(e)?new se(e):null},handleClick:h6,handleKeyDown:f6,handleDOMEvents:{beforeinput:m6}}})}const f6=vy({ArrowLeft:oc("horiz",-1),ArrowRight:oc("horiz",1),ArrowUp:oc("vert",-1),ArrowDown:oc("vert",1)});function oc(n,t){const e=n=="vert"?t>0?"down":"up":t>0?"right":"left";return function(o,s,r){let a=o.selection,i=t>0?a.$to:a.$from,c=a.empty;if(a instanceof Et){if(!r.endOfTextblock(e)||i.depth==0)return!1;c=!1,i=o.doc.resolve(t>0?i.after():i.before())}let d=se.findGapCursorFrom(i,t,c);return d?(s&&s(o.tr.setSelection(new se(d))),!0):!1}}function h6(n,t,e){if(!n||!n.editable)return!1;let o=n.state.doc.resolve(t);if(!se.valid(o))return!1;let s=n.posAtCoords({left:e.clientX,top:e.clientY});return s&&s.inside>-1&&vt.isSelectable(n.state.doc.nodeAt(s.inside))?!1:(n.dispatch(n.state.tr.setSelection(new se(o))),!0)}function m6(n,t){if(t.inputType!="insertCompositionText"||!(n.state.selection instanceof se))return!1;let{$from:e}=n.state.selection,o=e.parent.contentMatchAt(e.index()).findWrapping(n.state.schema.nodes.text);if(!o)return!1;let s=G.empty;for(let a=o.length-1;a>=0;a--)s=G.from(o[a].createAndFill(null,s));let r=n.state.tr.replace(e.pos,e.pos,new rt(s,0,0));return r.setSelection(Et.near(r.doc.resolve(e.pos+1))),n.dispatch(r),!1}function g6(n){if(!(n.selection instanceof se))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",me.create(n.doc,[Cn.widget(n.selection.head,t,{key:"gapcursor"})])}const v6=pe.create({name:"gapCursor",addProseMirrorPlugins(){return[u6()]},extendNodeSchema(n){var t;const e={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(t=Mt(ct(n,"allowGapCursor",e)))!==null&&t!==void 0?t:null}}}),y6=xe.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",qt(this.options.HTMLAttributes,n)]},renderText(){return`
591
+ `},addCommands(){return{setHardBreak:()=>({commands:n,chain:t,state:e,editor:o})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:s,storedMarks:r}=e;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:i}=o.extensionManager,c=r||s.$to.parentOffset&&s.$from.marks();return t().insertContent({type:this.name}).command(({tr:d,dispatch:p})=>{if(p&&c&&a){const u=c.filter(f=>i.includes(f.type.name));d.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),b6=xe.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:t}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.setNode(this.name,n):!1,toggleHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,t)=>({...n,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(n=>Yr({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var lc=200,we=function(){};we.prototype.append=function(t){return t.length?(t=we.from(t),!this.length&&t||t.length<lc&&this.leafAppend(t)||this.length<lc&&t.leafPrepend(this)||this.appendInner(t)):this},we.prototype.prepend=function(t){return t.length?we.from(t).append(this):this},we.prototype.appendInner=function(t){return new k6(this,t)},we.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?we.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},we.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},we.prototype.forEach=function(t,e,o){e===void 0&&(e=0),o===void 0&&(o=this.length),e<=o?this.forEachInner(t,e,o,0):this.forEachInvertedInner(t,e,o,0)},we.prototype.map=function(t,e,o){e===void 0&&(e=0),o===void 0&&(o=this.length);var s=[];return this.forEach(function(r,a){return s.push(t(r,a))},e,o),s},we.from=function(t){return t instanceof we?t:t&&t.length?new nb(t):we.empty};var nb=(function(n){function t(o){n.call(this),this.values=o}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(s,r){return s==0&&r==this.length?this:new t(this.values.slice(s,r))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,r,a,i){for(var c=r;c<a;c++)if(s(this.values[c],i+c)===!1)return!1},t.prototype.forEachInvertedInner=function(s,r,a,i){for(var c=r-1;c>=a;c--)if(s(this.values[c],i+c)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=lc)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=lc)return new t(s.flatten().concat(this.values))},e.length.get=function(){return this.values.length},e.depth.get=function(){return 0},Object.defineProperties(t.prototype,e),t})(we);we.empty=new nb([]);var k6=(function(n){function t(e,o){n.call(this),this.left=e,this.right=o,this.length=e.length+o.length,this.depth=Math.max(e.depth,o.depth)+1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(o){return o<this.left.length?this.left.get(o):this.right.get(o-this.left.length)},t.prototype.forEachInner=function(o,s,r,a){var i=this.left.length;if(s<i&&this.left.forEachInner(o,s,Math.min(r,i),a)===!1||r>i&&this.right.forEachInner(o,Math.max(s-i,0),Math.min(this.length,r)-i,a+i)===!1)return!1},t.prototype.forEachInvertedInner=function(o,s,r,a){var i=this.left.length;if(s>i&&this.right.forEachInvertedInner(o,s-i,Math.max(r,i)-i,a+i)===!1||r<i&&this.left.forEachInvertedInner(o,Math.min(s,i),r,a)===!1)return!1},t.prototype.sliceInner=function(o,s){if(o==0&&s==this.length)return this;var r=this.left.length;return s<=r?this.left.slice(o,s):o>=r?this.right.slice(o-r,s-r):this.left.slice(o,r).append(this.right.slice(0,s-r))},t.prototype.leafAppend=function(o){var s=this.right.leafAppend(o);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(o){var s=this.left.leafPrepend(o);if(s)return new t(s,this.right)},t.prototype.appendInner=function(o){return this.left.depth>=Math.max(this.right.depth,o.depth)+1?new t(this.left,new t(this.right,o)):new t(this,o)},t})(we);const x6=500;class Wn{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(this.eventCount==0)return null;let o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}let s,r;e&&(s=this.remapping(o,this.items.length),r=s.maps.length);let a=t.tr,i,c,d=[],p=[];return this.items.forEach((u,f)=>{if(!u.step){s||(s=this.remapping(o,f+1),r=s.maps.length),r--,p.push(u);return}if(s){p.push(new so(u.map));let h=u.step.map(s.slice(r)),m;h&&a.maybeStep(h).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],d.push(new so(m,void 0,void 0,d.length+p.length))),r--,m&&s.appendMap(m,r)}else a.maybeStep(u.step);if(u.selection)return i=s?u.selection.map(s.slice(r)):u.selection,c=new Wn(this.items.slice(0,o).append(p.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:i}}addTransform(t,e,o,s){let r=[],a=this.eventCount,i=this.items,c=!s&&i.length?i.get(i.length-1):null;for(let p=0;p<t.steps.length;p++){let u=t.steps[p].invert(t.docs[p]),f=new so(t.mapping.maps[p],u,e),h;(h=c&&c.merge(f))&&(f=h,p?r.pop():i=i.slice(0,i.length-1)),r.push(f),e&&(a++,e=void 0),s||(c=f)}let d=a-o.depth;return d>S6&&(i=w6(i,d),a-=d),new Wn(i.append(r),a)}remapping(t,e){let o=new Sr;return this.items.forEach((s,r)=>{let a=s.mirrorOffset!=null&&r-s.mirrorOffset>=t?o.maps.length-s.mirrorOffset:void 0;o.appendMap(s.map,a)},t,e),o}addMaps(t){return this.eventCount==0?this:new Wn(this.items.append(t.map(e=>new so(e))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let o=[],s=Math.max(0,this.items.length-e),r=t.mapping,a=t.steps.length,i=this.eventCount;this.items.forEach(f=>{f.selection&&i--},s);let c=e;this.items.forEach(f=>{let h=r.getMirror(--c);if(h==null)return;a=Math.min(a,h);let m=r.maps[h];if(f.step){let g=t.steps[h].invert(t.docs[h]),v=f.selection&&f.selection.map(r.slice(c+1,h));v&&i++,o.push(new so(m,g,v))}else o.push(new so(m))},s);let d=[];for(let f=e;f<a;f++)d.push(new so(r.maps[f]));let p=this.items.slice(0,s).append(d).append(o),u=new Wn(p,i);return u.emptyItemCount()>x6&&(u=u.compress(this.items.length-o.length)),u}emptyItemCount(){let t=0;return this.items.forEach(e=>{e.step||t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),o=e.maps.length,s=[],r=0;return this.items.forEach((a,i)=>{if(i>=t)s.push(a),a.selection&&r++;else if(a.step){let c=a.step.map(e.slice(o)),d=c&&c.getMap();if(o--,d&&e.appendMap(d,o),c){let p=a.selection&&a.selection.map(e.slice(o));p&&r++;let u=new so(d.invert(),c,p),f,h=s.length-1;(f=s.length&&s[h].merge(u))?s[h]=f:s.push(u)}}else a.map&&o--},this.items.length,0),new Wn(we.from(s.reverse()),r)}}Wn.empty=new Wn(we.empty,0);function w6(n,t){let e;return n.forEach((o,s)=>{if(o.selection&&t--==0)return e=s,!1}),n.slice(e)}class so{constructor(t,e,o,s){this.map=t,this.step=e,this.selection=o,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new so(e.getMap().invert(),e,this.selection)}}}class dl{constructor(t,e,o,s,r){this.done=t,this.undone=e,this.prevRanges=o,this.prevTime=s,this.prevComposition=r}}const S6=20;function E6(n,t,e,o){let s=e.getMeta(Xl),r;if(s)return s.historyState;e.getMeta(N6)&&(n=new dl(n.done,n.undone,null,0,-1));let a=e.getMeta("appendedTransaction");if(e.steps.length==0)return n;if(a&&a.getMeta(Xl))return a.getMeta(Xl).redo?new dl(n.done.addTransform(e,void 0,o,sc(t)),n.undone,ob(e.mapping.maps),n.prevTime,n.prevComposition):new dl(n.done,n.undone.addTransform(e,void 0,o,sc(t)),null,n.prevTime,n.prevComposition);if(e.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let i=e.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=i&&(n.prevTime<(e.time||0)-o.newGroupDelay||!C6(e,n.prevRanges)),d=a?zu(n.prevRanges,e.mapping):ob(e.mapping.maps);return new dl(n.done.addTransform(e,c?t.selection.getBookmark():void 0,o,sc(t)),Wn.empty,d,e.time,i??n.prevComposition)}else return(r=e.getMeta("rebased"))?new dl(n.done.rebased(e,r),n.undone.rebased(e,r),zu(n.prevRanges,e.mapping),n.prevTime,n.prevComposition):new dl(n.done.addMaps(e.mapping.maps),n.undone.addMaps(e.mapping.maps),zu(n.prevRanges,e.mapping),n.prevTime,n.prevComposition)}function C6(n,t){if(!t)return!1;if(!n.docChanged)return!0;let e=!1;return n.mapping.maps[0].forEach((o,s)=>{for(let r=0;r<t.length;r+=2)o<=t[r+1]&&s>=t[r]&&(e=!0)}),e}function ob(n){let t=[];for(let e=n.length-1;e>=0&&t.length==0;e--)n[e].forEach((o,s,r,a)=>t.push(r,a));return t}function zu(n,t){if(!n)return null;let e=[];for(let o=0;o<n.length;o+=2){let s=t.map(n[o],1),r=t.map(n[o+1],-1);s<=r&&e.push(s,r)}return e}function T6(n,t,e){let o=sc(t),s=Xl.get(t).spec.config,r=(e?n.undone:n.done).popEvent(t,o);if(!r)return null;let a=r.selection.resolve(r.transform.doc),i=(e?n.done:n.undone).addTransform(r.transform,t.selection.getBookmark(),s,o),c=new dl(e?i:r.remaining,e?r.remaining:i,null,0,-1);return r.transform.setSelection(a).setMeta(Xl,{redo:e,historyState:c})}let Pu=!1,lb=null;function sc(n){let t=n.plugins;if(lb!=t){Pu=!1,lb=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Pu=!0;break}}return Pu}const Xl=new He("history"),N6=new He("closeHistory");function M6(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new he({key:Xl,state:{init(){return new dl(Wn.empty,Wn.empty,null,0,-1)},apply(t,e,o){return E6(e,o,t,n)}},config:n,props:{handleDOMEvents:{beforeinput(t,e){let o=e.inputType,s=o=="historyUndo"?rb:o=="historyRedo"?ab:null;return!s||!t.editable?!1:(e.preventDefault(),s(t.state,t.dispatch))}}}})}function sb(n,t){return(e,o)=>{let s=Xl.getState(e);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(o){let r=T6(s,e,n);r&&o(t?r.scrollIntoView():r)}return!0}}const rb=sb(!1,!0),ab=sb(!0,!0),B6=pe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:t})=>rb(n,t),redo:()=>({state:n,dispatch:t})=>ab(n,t)}},addProseMirrorPlugins(){return[M6(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),O6=xe.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",qt(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:t})=>{if(!mu(t,t.schema.nodes[this.name]))return!1;const{selection:e}=t,{$from:o,$to:s}=e,r=n();return o.parentOffset===0?r.insertContentAt({from:Math.max(o.pos-1,0),to:s.pos},{type:this.name}):Xi(e)?r.insertContentAt(s.pos,{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:a,dispatch:i})=>{var c;if(i){const{$to:d}=a.selection,p=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?a.setSelection(Et.create(a.doc,d.pos+1)):d.nodeAfter.isBlock?a.setSelection(vt.create(a.doc,d.pos)):a.setSelection(Et.create(a.doc,d.pos));else{const u=(c=d.parent.type.contentMatch.defaultType)===null||c===void 0?void 0:c.create();u&&(a.insert(p,u),a.setSelection(Et.create(a.doc,p+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[fu({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),D6=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,V6=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,A6=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,I6=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,R6=qe.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[il({find:D6,type:this.type}),il({find:A6,type:this.type})]},addPasteRules(){return[No({find:V6,type:this.type}),No({find:I6,type:this.type})]}}),z6=xe.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",qt(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),P6="listItem",ib="textStyle",cb=/^(\d+)\.\s$/,L6=xe.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:t,...e}=n;return t===1?["ol",qt(this.options.HTMLAttributes,e),0]:["ol",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(P6,this.editor.getAttributes(ib)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=_l({find:cb,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=_l({find:cb,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(ib)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[n]}}),F6=xe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),j6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,H6=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,U6=qe.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[il({find:j6,type:this.type})]},addPasteRules(){return[No({find:H6,type:this.type})]}}),W6=xe.create({name:"text",group:"inline"}),db=pe.create({name:"starterKit",addExtensions(){const n=[];return this.options.bold!==!1&&n.push(QI.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(GI.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push($I.configure(this.options.bulletList)),this.options.code!==!1&&n.push(n6.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(s6.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(r6.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(c6.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(v6.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(y6.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(b6.configure(this.options.heading)),this.options.history!==!1&&n.push(B6.configure(this.options.history)),this.options.horizontalRule!==!1&&n.push(O6.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(R6.configure(this.options.italic)),this.options.listItem!==!1&&n.push(z6.configure(this.options.listItem)),this.options.orderedList!==!1&&n.push(L6.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push(F6.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(U6.configure(this.options.strike)),this.options.text!==!1&&n.push(W6.configure(this.options.text)),n}}),K6=Object.freeze(Object.defineProperty({__proto__:null,StarterKit:db,default:db},Symbol.toStringTag,{value:"Module"})),_6="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",G6="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Lu="numeric",Fu="ascii",ju="alpha",sa="asciinumeric",ra="alphanumeric",Hu="domain",pb="emoji",J6="scheme",Y6="slashscheme",Uu="whitespace";function X6(n,t){return n in t||(t[n]=[]),t[n]}function Zl(n,t,e){t[Lu]&&(t[sa]=!0,t[ra]=!0),t[Fu]&&(t[sa]=!0,t[ju]=!0),t[sa]&&(t[ra]=!0),t[ju]&&(t[ra]=!0),t[ra]&&(t[Hu]=!0),t[pb]&&(t[Hu]=!0);for(const o in t){const s=X6(o,e);s.indexOf(n)<0&&s.push(n)}}function Z6(n,t){const e={};for(const o in t)t[o].indexOf(n)>=0&&(e[o]=!0);return e}function en(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}en.groups={},en.prototype={accepts(){return!!this.t},go(n){const t=this,e=t.j[n];if(e)return e;for(let o=0;o<t.jr.length;o++){const s=t.jr[o][0],r=t.jr[o][1];if(r&&s.test(n))return r}return t.jd},has(n,t=!1){return t?n in this.j:!!this.go(n)},ta(n,t,e,o){for(let s=0;s<n.length;s++)this.tt(n[s],t,e,o)},tr(n,t,e,o){o=o||en.groups;let s;return t&&t.j?s=t:(s=new en(t),e&&o&&Zl(t,e,o)),this.jr.push([n,s]),s},ts(n,t,e,o){let s=this;const r=n.length;if(!r)return s;for(let a=0;a<r-1;a++)s=s.tt(n[a]);return s.tt(n[r-1],t,e,o)},tt(n,t,e,o){o=o||en.groups;const s=this;if(t&&t.j)return s.j[n]=t,t;const r=t;let a,i=s.go(n);if(i?(a=new en,Object.assign(a.j,i.j),a.jr.push.apply(a.jr,i.jr),a.jd=i.jd,a.t=i.t):a=new en,r){if(o)if(a.t&&typeof a.t=="string"){const c=Object.assign(Z6(a.t,o),e);Zl(r,c,o)}else e&&Zl(r,e,o);a.t=r}return s.j[n]=a,a}};const zt=(n,t,e,o,s)=>n.ta(t,e,o,s),re=(n,t,e,o,s)=>n.tr(t,e,o,s),ub=(n,t,e,o,s)=>n.ts(t,e,o,s),X=(n,t,e,o,s)=>n.tt(t,e,o,s),Oo="WORD",Wu="UWORD",fb="ASCIINUMERICAL",hb="ALPHANUMERICAL",aa="LOCALHOST",Ku="TLD",_u="UTLD",rc="SCHEME",Ws="SLASH_SCHEME",Gu="NUM",Ju="WS",Yu="NL",ia="OPENBRACE",ca="CLOSEBRACE",ac="OPENBRACKET",ic="CLOSEBRACKET",cc="OPENPAREN",dc="CLOSEPAREN",pc="OPENANGLEBRACKET",uc="CLOSEANGLEBRACKET",fc="FULLWIDTHLEFTPAREN",hc="FULLWIDTHRIGHTPAREN",mc="LEFTCORNERBRACKET",gc="RIGHTCORNERBRACKET",vc="LEFTWHITECORNERBRACKET",yc="RIGHTWHITECORNERBRACKET",bc="FULLWIDTHLESSTHAN",kc="FULLWIDTHGREATERTHAN",xc="AMPERSAND",wc="APOSTROPHE",Sc="ASTERISK",pl="AT",Ec="BACKSLASH",Cc="BACKTICK",Tc="CARET",ul="COLON",Xu="COMMA",Nc="DOLLAR",ro="DOT",Mc="EQUALS",Zu="EXCLAMATION",Bn="HYPHEN",da="PERCENT",Bc="PIPE",Oc="PLUS",Dc="POUND",pa="QUERY",Qu="QUOTE",mb="FULLWIDTHMIDDLEDOT",qu="SEMI",ao="SLASH",ua="TILDE",Vc="UNDERSCORE",gb="EMOJI",Ac="SYM";var vb=Object.freeze({__proto__:null,ALPHANUMERICAL:hb,AMPERSAND:xc,APOSTROPHE:wc,ASCIINUMERICAL:fb,ASTERISK:Sc,AT:pl,BACKSLASH:Ec,BACKTICK:Cc,CARET:Tc,CLOSEANGLEBRACKET:uc,CLOSEBRACE:ca,CLOSEBRACKET:ic,CLOSEPAREN:dc,COLON:ul,COMMA:Xu,DOLLAR:Nc,DOT:ro,EMOJI:gb,EQUALS:Mc,EXCLAMATION:Zu,FULLWIDTHGREATERTHAN:kc,FULLWIDTHLEFTPAREN:fc,FULLWIDTHLESSTHAN:bc,FULLWIDTHMIDDLEDOT:mb,FULLWIDTHRIGHTPAREN:hc,HYPHEN:Bn,LEFTCORNERBRACKET:mc,LEFTWHITECORNERBRACKET:vc,LOCALHOST:aa,NL:Yu,NUM:Gu,OPENANGLEBRACKET:pc,OPENBRACE:ia,OPENBRACKET:ac,OPENPAREN:cc,PERCENT:da,PIPE:Bc,PLUS:Oc,POUND:Dc,QUERY:pa,QUOTE:Qu,RIGHTCORNERBRACKET:gc,RIGHTWHITECORNERBRACKET:yc,SCHEME:rc,SEMI:qu,SLASH:ao,SLASH_SCHEME:Ws,SYM:Ac,TILDE:ua,TLD:Ku,UNDERSCORE:Vc,UTLD:_u,UWORD:Wu,WORD:Oo,WS:Ju});const Do=/[a-z]/,fa=new RegExp("\\p{L}","u"),$u=new RegExp("\\p{Emoji}","u"),Vo=/\d/,tf=/\s/,yb="\r",ef=`
592
+ `,Q6="️",q6="‍",nf="";let Ic=null,Rc=null;function $6(n=[]){const t={};en.groups=t;const e=new en;Ic==null&&(Ic=kb(_6)),Rc==null&&(Rc=kb(G6)),X(e,"'",wc),X(e,"{",ia),X(e,"}",ca),X(e,"[",ac),X(e,"]",ic),X(e,"(",cc),X(e,")",dc),X(e,"<",pc),X(e,">",uc),X(e,"(",fc),X(e,")",hc),X(e,"「",mc),X(e,"」",gc),X(e,"『",vc),X(e,"』",yc),X(e,"<",bc),X(e,">",kc),X(e,"&",xc),X(e,"*",Sc),X(e,"@",pl),X(e,"`",Cc),X(e,"^",Tc),X(e,":",ul),X(e,",",Xu),X(e,"$",Nc),X(e,".",ro),X(e,"=",Mc),X(e,"!",Zu),X(e,"-",Bn),X(e,"%",da),X(e,"|",Bc),X(e,"+",Oc),X(e,"#",Dc),X(e,"?",pa),X(e,'"',Qu),X(e,"/",ao),X(e,";",qu),X(e,"~",ua),X(e,"_",Vc),X(e,"\\",Ec),X(e,"・",mb);const o=re(e,Vo,Gu,{[Lu]:!0});re(o,Vo,o);const s=re(o,Do,fb,{[sa]:!0}),r=re(o,fa,hb,{[ra]:!0}),a=re(e,Do,Oo,{[Fu]:!0});re(a,Vo,s),re(a,Do,a),re(s,Vo,s),re(s,Do,s);const i=re(e,fa,Wu,{[ju]:!0});re(i,Do),re(i,Vo,r),re(i,fa,i),re(r,Vo,r),re(r,Do),re(r,fa,r);const c=X(e,ef,Yu,{[Uu]:!0}),d=X(e,yb,Ju,{[Uu]:!0}),p=re(e,tf,Ju,{[Uu]:!0});X(e,nf,p),X(d,ef,c),X(d,nf,p),re(d,tf,p),X(p,yb),X(p,ef),re(p,tf,p),X(p,nf,p);const u=re(e,$u,gb,{[pb]:!0});X(u,"#"),re(u,$u,u),X(u,Q6,u);const f=X(u,q6);X(f,"#"),re(f,$u,u);const h=[[Do,a],[Vo,s]],m=[[Do,null],[fa,i],[Vo,r]];for(let g=0;g<Ic.length;g++)fl(e,Ic[g],Ku,Oo,h);for(let g=0;g<Rc.length;g++)fl(e,Rc[g],_u,Wu,m);Zl(Ku,{tld:!0,ascii:!0},t),Zl(_u,{utld:!0,alpha:!0},t),fl(e,"file",rc,Oo,h),fl(e,"mailto",rc,Oo,h),fl(e,"http",Ws,Oo,h),fl(e,"https",Ws,Oo,h),fl(e,"ftp",Ws,Oo,h),fl(e,"ftps",Ws,Oo,h),Zl(rc,{scheme:!0,ascii:!0},t),Zl(Ws,{slashscheme:!0,ascii:!0},t),n=n.sort((g,v)=>g[0]>v[0]?1:-1);for(let g=0;g<n.length;g++){const v=n[g][0],k=n[g][1]?{[J6]:!0}:{[Y6]:!0};v.indexOf("-")>=0?k[Hu]=!0:Do.test(v)?Vo.test(v)?k[sa]=!0:k[Fu]=!0:k[Lu]=!0,ub(e,v,v,k)}return ub(e,"localhost",aa,{ascii:!0}),e.jd=new en(Ac),{start:e,tokens:Object.assign({groups:t},vb)}}function bb(n,t){const e=t8(t.replace(/[A-Z]/g,i=>i.toLowerCase())),o=e.length,s=[];let r=0,a=0;for(;a<o;){let i=n,c=null,d=0,p=null,u=-1,f=-1;for(;a<o&&(c=i.go(e[a]));)i=c,i.accepts()?(u=0,f=0,p=i):u>=0&&(u+=e[a].length,f++),d+=e[a].length,r+=e[a].length,a++;r-=u,a-=f,d-=u,s.push({t:p.t,v:t.slice(r-d,r),s:r-d,e:r})}return s}function t8(n){const t=[],e=n.length;let o=0;for(;o<e;){let s=n.charCodeAt(o),r,a=s<55296||s>56319||o+1===e||(r=n.charCodeAt(o+1))<56320||r>57343?n[o]:n.slice(o,o+2);t.push(a),o+=a.length}return t}function fl(n,t,e,o,s){let r;const a=t.length;for(let i=0;i<a-1;i++){const c=t[i];n.j[c]?r=n.j[c]:(r=new en(o),r.jr=s.slice(),n.j[c]=r),n=r}return r=new en(e),r.jr=s.slice(),n.j[t[a-1]]=r,r}function kb(n){const t=[],e=[];let o=0,s="0123456789";for(;o<n.length;){let r=0;for(;s.indexOf(n[o+r])>=0;)r++;if(r>0){t.push(e.join(""));for(let a=parseInt(n.substring(o,o+r),10);a>0;a--)e.pop();o+=r}else e.push(n[o]),o++}return t}const ha={defaultProtocol:"http",events:null,format:xb,formatHref:xb,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function of(n,t=null){let e=Object.assign({},ha);n&&(e=Object.assign(e,n instanceof of?n.o:n));const o=e.ignoreTags,s=[];for(let r=0;r<o.length;r++)s.push(o[r].toUpperCase());this.o=e,t&&(this.defaultRender=t),this.ignoreTags=s}of.prototype={o:ha,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,t,e){const o=t!=null;let s=this.o[n];return s&&(typeof s=="object"?(s=e.t in s?s[e.t]:ha[n],typeof s=="function"&&o&&(s=s(t,e))):typeof s=="function"&&o&&(s=s(t,e.t,e)),s)},getObj(n,t,e){let o=this.o[n];return typeof o=="function"&&t!=null&&(o=o(t,e.t,e)),o},render(n){const t=n.render(this);return(this.get("render",null,n)||this.defaultRender)(t,n.t,n)}};function xb(n){return n}function wb(n,t){this.t="token",this.v=n,this.tk=t}wb.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const t=this.toString(),e=n.get("truncate",t,this),o=n.get("format",t,this);return e&&o.length>e?o.substring(0,e)+"…":o},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=ha.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const t=this,e=this.toHref(n.get("defaultProtocol")),o=n.get("formatHref",e,this),s=n.get("tagName",e,t),r=this.toFormattedString(n),a={},i=n.get("className",e,t),c=n.get("target",e,t),d=n.get("rel",e,t),p=n.getObj("attributes",e,t),u=n.getObj("events",e,t);return a.href=o,i&&(a.class=i),c&&(a.target=c),d&&(a.rel=d),p&&Object.assign(a,p),{tagName:s,attributes:a,content:r,eventListeners:u}}};function zc(n,t){class e extends wb{constructor(s,r){super(s,r),this.t=n}}for(const o in t)e.prototype[o]=t[o];return e.t=n,e}const Sb=zc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Eb=zc("text"),e8=zc("nl"),Pc=zc("url",{isLink:!0,toHref(n=ha.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==aa&&n[1].t===ul}}),On=n=>new en(n);function n8({groups:n}){const t=n.domain.concat([xc,Sc,pl,Ec,Cc,Tc,Nc,Mc,Bn,Gu,da,Bc,Oc,Dc,ao,Ac,ua,Vc]),e=[wc,ul,Xu,ro,Zu,da,pa,Qu,qu,pc,uc,ia,ca,ic,ac,cc,dc,fc,hc,mc,gc,vc,yc,bc,kc],o=[xc,wc,Sc,Ec,Cc,Tc,Nc,Mc,Bn,ia,ca,da,Bc,Oc,Dc,pa,ao,Ac,ua,Vc],s=On(),r=X(s,ua);zt(r,o,r),zt(r,n.domain,r);const a=On(),i=On(),c=On();zt(s,n.domain,a),zt(s,n.scheme,i),zt(s,n.slashscheme,c),zt(a,o,r),zt(a,n.domain,a);const d=X(a,pl);X(r,pl,d),X(i,pl,d),X(c,pl,d);const p=X(r,ro);zt(p,o,r),zt(p,n.domain,r);const u=On();zt(d,n.domain,u),zt(u,n.domain,u);const f=X(u,ro);zt(f,n.domain,u);const h=On(Sb);zt(f,n.tld,h),zt(f,n.utld,h),X(d,aa,h);const m=X(u,Bn);X(m,Bn,m),zt(m,n.domain,u),zt(h,n.domain,u),X(h,ro,f),X(h,Bn,m);const g=X(h,ul);zt(g,n.numeric,Sb);const v=X(a,Bn),y=X(a,ro);X(v,Bn,v),zt(v,n.domain,a),zt(y,o,r),zt(y,n.domain,a);const k=On(Pc);zt(y,n.tld,k),zt(y,n.utld,k),zt(k,n.domain,a),zt(k,o,r),X(k,ro,y),X(k,Bn,v),X(k,pl,d);const S=X(k,ul),b=On(Pc);zt(S,n.numeric,b);const w=On(Pc),x=On();zt(w,t,w),zt(w,e,x),zt(x,t,w),zt(x,e,x),X(k,ao,w),X(b,ao,w);const E=X(i,ul),B=X(c,ul),C=X(B,ao),D=X(C,ao);zt(i,n.domain,a),X(i,ro,y),X(i,Bn,v),zt(c,n.domain,a),X(c,ro,y),X(c,Bn,v),zt(E,n.domain,w),X(E,ao,w),X(E,pa,w),zt(D,n.domain,w),zt(D,t,w),X(D,ao,w);const R=[[ia,ca],[ac,ic],[cc,dc],[pc,uc],[fc,hc],[mc,gc],[vc,yc],[bc,kc]];for(let N=0;N<R.length;N++){const[L,z]=R[N],P=X(w,L);X(x,L,P),X(P,z,w);const U=On(Pc);zt(P,t,U);const O=On();zt(P,e),zt(U,t,U),zt(U,e,O),zt(O,t,U),zt(O,e,O),X(U,z,w),X(O,z,w)}return X(s,aa,k),X(s,Yu,e8),{start:s,tokens:vb}}function o8(n,t,e){let o=e.length,s=0,r=[],a=[];for(;s<o;){let i=n,c=null,d=null,p=0,u=null,f=-1;for(;s<o&&!(c=i.go(e[s].t));)a.push(e[s++]);for(;s<o&&(d=c||i.go(e[s].t));)c=null,i=d,i.accepts()?(f=0,u=i):f>=0&&f++,s++,p++;if(f<0)s-=p,s<o&&(a.push(e[s]),s++);else{a.length>0&&(r.push(lf(Eb,t,a)),a=[]),s-=f,p-=f;const h=u.t,m=e.slice(s-p,s);r.push(lf(h,t,m))}}return a.length>0&&r.push(lf(Eb,t,a)),r}function lf(n,t,e){const o=e[0].s,s=e[e.length-1].e,r=t.slice(o,s);return new n(r,e)}const l8=typeof console<"u"&&console&&console.warn||(()=>{}),s8="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Yt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function r8(){return en.groups={},Yt.scanner=null,Yt.parser=null,Yt.tokenQueue=[],Yt.pluginQueue=[],Yt.customSchemes=[],Yt.initialized=!1,Yt}function Cb(n,t=!1){if(Yt.initialized&&l8(`linkifyjs: already initialized - will not register custom scheme "${n}" ${s8}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
593
+ 1. Must only contain digits, lowercase ASCII letters or "-"
594
+ 2. Cannot start or end with "-"
595
+ 3. "-" cannot repeat`);Yt.customSchemes.push([n,t])}function a8(){Yt.scanner=$6(Yt.customSchemes);for(let n=0;n<Yt.tokenQueue.length;n++)Yt.tokenQueue[n][1]({scanner:Yt.scanner});Yt.parser=n8(Yt.scanner.tokens);for(let n=0;n<Yt.pluginQueue.length;n++)Yt.pluginQueue[n][1]({scanner:Yt.scanner,parser:Yt.parser});return Yt.initialized=!0,Yt}function sf(n){return Yt.initialized||a8(),o8(Yt.parser.start,n,bb(Yt.scanner.start,n))}sf.scan=bb;function Tb(n,t=null,e=null){if(t&&typeof t=="object"){if(e)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);e=t,t=null}const o=new of(e),s=sf(n),r=[];for(let a=0;a<s.length;a++){const i=s[a];i.isLink&&(!t||i.t===t)&&o.check(i)&&r.push(i.toFormattedObject(o))}return r}const rf="[\0-   ᠎ -\u2029  ]",i8=new RegExp(rf),c8=new RegExp(`${rf}$`),d8=new RegExp(rf,"g");function p8(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function u8(n){return new he({key:new He("autolink"),appendTransaction:(t,e,o)=>{const s=t.some(d=>d.docChanged)&&!e.doc.eq(o.doc),r=t.some(d=>d.getMeta("preventAutolink"));if(!s||r)return;const{tr:a}=o,i=eu(e.doc,[...t]);if(au(i).forEach(({newRange:d})=>{const p=ou(o.doc,d,h=>h.isTextblock);let u,f;if(p.length>1)u=p[0],f=o.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(p.length){const h=o.doc.textBetween(d.from,d.to," "," ");if(!c8.test(h))return;u=p[0],f=o.doc.textBetween(u.pos,d.to,void 0," ")}if(u&&f){const h=f.split(i8).filter(Boolean);if(h.length<=0)return!1;const m=h[h.length-1],g=u.pos+f.lastIndexOf(m);if(!m)return!1;const v=sf(m).map(y=>y.toObject(n.defaultProtocol));if(!p8(v))return!1;v.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>o.schema.marks.code?!o.doc.rangeHasMark(y.from,y.to,o.schema.marks.code):!0).filter(y=>n.validate(y.value)).filter(y=>n.shouldAutoLink(y.value)).forEach(y=>{_r(y.from,y.to,o.doc).some(k=>k.mark.type===n.type)||a.addMark(y.from,y.to,n.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function f8(n){return new he({key:new He("handleClickLink"),props:{handleClick:(t,e,o)=>{var s,r;if(o.button!==0||!t.editable)return!1;let a=o.target;const i=[];for(;a.nodeName!=="DIV";)i.push(a),a=a.parentNode;if(!i.find(f=>f.nodeName==="A"))return!1;const c=Ji(t.state,n.type.name),d=o.target,p=(s=d==null?void 0:d.href)!==null&&s!==void 0?s:c.href,u=(r=d==null?void 0:d.target)!==null&&r!==void 0?r:c.target;return d&&p?(window.open(p,u),!0):!1}}})}function h8(n){return new he({key:new He("handlePasteLink"),props:{handlePaste:(t,e,o)=>{const{state:s}=t,{selection:r}=s,{empty:a}=r;if(a)return!1;let i="";o.content.forEach(d=>{i+=d.textContent});const c=Tb(i,{defaultProtocol:n.defaultProtocol}).find(d=>d.isLink&&d.value===i);return!i||!c?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}const m8=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi;function hl(n,t){const e=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(o=>{const s=typeof o=="string"?o:o.scheme;s&&e.push(s)}),!n||n.replace(d8,"").match(new RegExp(`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Nb=qe.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){Cb(n);return}Cb(n.scheme,n.optionalSlashes)})},onDestroy(){r8()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,t)=>!!hl(n,t.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const t=n.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!hl(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:t=>!!hl(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",qt(this.options.HTMLAttributes,n),0]:["a",qt(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:t})=>{const{href:e}=n;return this.options.isAllowedUri(e,{defaultValidate:o=>!!hl(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:t})=>{const{href:e}=n;return this.options.isAllowedUri(e,{defaultValidate:o=>!!hl(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[No({find:n=>{const t=[];if(n){const{protocols:e,defaultProtocol:o}=this.options,s=Tb(n).filter(r=>r.isLink&&this.options.isAllowedUri(r.value,{defaultValidate:a=>!!hl(a,e),protocols:e,defaultProtocol:o}));s.length&&s.forEach(r=>t.push({text:r.value,data:{href:r.href},index:r.start}))}return t},type:this.type,getAttributes:n=>{var t;return{href:(t=n.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:t,defaultProtocol:e}=this.options;return this.options.autolink&&n.push(u8({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:o=>this.options.isAllowedUri(o,{defaultValidate:s=>!!hl(s,t),protocols:t,defaultProtocol:e}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(f8({type:this.type})),this.options.linkOnPaste&&n.push(h8({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),g8=Object.freeze(Object.defineProperty({__proto__:null,Link:Nb,default:Nb,isAllowedUri:hl,pasteRegex:m8},Symbol.toStringTag,{value:"Module"})),Mb=qe.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),v8=Object.freeze(Object.defineProperty({__proto__:null,Underline:Mb,default:Mb},Symbol.toStringTag,{value:"Module"})),Bb=qe.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(n){return n!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sub",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{setSubscript:()=>({commands:n})=>n.setMark(this.name),toggleSubscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSubscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),y8=Object.freeze(Object.defineProperty({__proto__:null,Subscript:Bb,default:Bb},Symbol.toStringTag,{value:"Module"})),Ob=qe.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(n){return n!=="super"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sup",qt(this.options.HTMLAttributes,n),0]},addCommands(){return{setSuperscript:()=>({commands:n})=>n.setMark(this.name),toggleSuperscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSuperscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),b8=Object.freeze(Object.defineProperty({__proto__:null,Superscript:Ob,default:Ob},Symbol.toStringTag,{value:"Module"})),Db=pe.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const t=n.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:t})=>this.options.alignments.includes(n)?this.options.types.map(e=>t.updateAttributes(e,{textAlign:n})).every(e=>e):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(t=>n.resetAttributes(t,"textAlign")).every(t=>t),toggleTextAlign:n=>({editor:t,commands:e})=>this.options.alignments.includes(n)?t.isActive({textAlign:n})?e.unsetTextAlign():e.setTextAlign(n):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),k8=Object.freeze(Object.defineProperty({__proto__:null,TextAlign:Db,default:Db},Symbol.toStringTag,{value:"Module"})),x8=["data-tooltip"],w8=l.defineComponent({__name:"LogicMergeTagNodeView",props:{node:{},editor:{},getPos:{type:Function},deleteNode:{type:Function},updateAttributes:{type:Function}},setup(n){const t=n,{syntax:e}=jo(),o=l.computed(()=>yt.isLogicMergeTagValue(t.node.attrs.value,e)),s=l.computed(()=>yt.getLogicMergeTagKeyword(t.node.attrs.value,e)),r=l.ref(!1),a=l.ref(""),i=l.ref(null);let c=!1;function d(){a.value=t.node.attrs.value,c=!1,r.value=!0,l.nextTick(()=>{var f,h;(f=i.value)==null||f.focus(),(h=i.value)==null||h.select()})}function p(){if(c)return;c=!0;const f=a.value.trim();if(!f){r.value=!1;return}f!==t.node.attrs.value&&t.updateAttributes({value:f,keyword:yt.isLogicMergeTagValue(f,e)?yt.getLogicMergeTagKeyword(f,e):""}),r.value=!1}function u(f){f.key==="Enter"?(f.preventDefault(),p()):f.key==="Escape"&&(r.value=!1)}return(f,h)=>(l.openBlock(),l.createBlock(l.unref(Au),{as:"span",class:l.normalizeClass(o.value?"tpl-logic-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase tpl:select-none":""),style:l.normalizeStyle(o.value?"background-color: transparent; border: 1.5px solid color-mix(in srgb, var(--tpl-primary) 50%, transparent); color: var(--tpl-primary);":""),contenteditable:"false"},{default:l.withCtx(()=>[r.value?l.withDirectives((l.openBlock(),l.createElementBlock("input",{key:0,ref_key:"inputRef",ref:i,"onUpdate:modelValue":h[0]||(h[0]=m=>a.value=m),type:"text",class:"tpl:w-40 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:normal-case tpl:outline-none",style:{color:"var(--tpl-primary)"},onBlur:p,onKeydown:u},null,544)),[[l.vModelText,a.value]]):o.value?(l.openBlock(),l.createElementBlock("span",{key:1,class:"tpl-tooltip tpl:cursor-pointer","data-tooltip":n.node.attrs.value,onClick:l.withModifiers(d,["stop"])},l.toDisplayString(s.value),9,x8)):(l.openBlock(),l.createElementBlock("span",{key:2,onClick:l.withModifiers(d,["stop"])},l.toDisplayString(n.node.attrs.value),1)),o.value?(l.openBlock(),l.createElementBlock("button",{key:3,type:"button",class:"tpl:flex tpl:size-4 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100",style:{color:"var(--tpl-primary)"},contenteditable:"false",onClick:h[1]||(h[1]=l.withModifiers((...m)=>n.deleteNode&&n.deleteNode(...m),["stop","prevent"])),onMouseenter:h[2]||(h[2]=m=>m.target.style.color="var(--tpl-danger)"),onMouseleave:h[3]||(h[3]=m=>m.target.style.color="var(--tpl-primary)")},[...h[4]||(h[4]=[l.createElementVNode("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3"},[l.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],32)):l.createCommentVNode("",!0)]),_:1},8,["class","style"]))}}),S8=xe.create({name:"logicMergeTagNode",group:"inline",inline:!0,atom:!0,addOptions(){return{syntax:yt.SYNTAX_PRESETS.liquid}},addAttributes(){return{value:{default:""},keyword:{default:""}}},parseHTML(){return[{tag:"span[data-logic-merge-tag]"}]},renderHTML({node:n,HTMLAttributes:t}){if(!yt.isLogicMergeTagValue(n.attrs.value,this.options.syntax))return["span",{},n.attrs.value];const e=yt.getLogicMergeTagKeyword(n.attrs.value,this.options.syntax);return["span",qt(t,{"data-logic-merge-tag":n.attrs.value,"data-keyword":e}),e]},addNodeView(){return Iu(w8)},addKeyboardShortcuts(){const n=()=>{const{selection:t}=this.editor.state,{$from:e,$to:o}=t;let s=!1;if(this.editor.state.doc.nodesBetween(e.pos,o.pos,a=>{if(a.type.name===this.name)return s=!0,!1}),s)return!0;if(e.pos>0){const a=e.nodeBefore;if((a==null?void 0:a.type.name)===this.name)return!0}const r=e.nodeAfter;return(r==null?void 0:r.type.name)===this.name};return{Backspace:()=>n(),Delete:()=>n()}},addInputRules(){const n=new RegExp(this.options.syntax.logic.source+"$","");return[new Co({find:n,handler:({state:t,range:e,match:o})=>{const s=o[0];if(!yt.isLogicMergeTagValue(s,this.options.syntax))return;const r=yt.getLogicMergeTagKeyword(s,this.options.syntax),a=this.type.create({value:s,keyword:r});t.tr.replaceWith(e.from,e.to,a)}})]},addPasteRules(){const n=new RegExp(this.options.syntax.logic.source,"g");return[new Fl({find:n,handler:({state:t,range:e,match:o})=>{const s=o[0];if(!yt.isLogicMergeTagValue(s,this.options.syntax))return;const r=yt.getLogicMergeTagKeyword(s,this.options.syntax),a=this.type.create({value:s,keyword:r});t.tr.replaceWith(e.from,e.to,a)}})]}}),E8=["data-tooltip"],C8=l.defineComponent({__name:"MergeTagNodeView",props:{node:{},deleteNode:{type:Function},updateAttributes:{type:Function}},setup(n){const t=n,{getMergeTagLabel:e}=jo(),o=l.computed(()=>e(t.node.attrs.value)),s=l.ref(!1),r=l.ref(""),a=l.ref(null);function i(){r.value=t.node.attrs.value,s.value=!0,l.nextTick(()=>{var p,u;(p=a.value)==null||p.focus(),(u=a.value)==null||u.select()})}function c(){const p=r.value.trim();p&&p!==t.node.attrs.value&&t.updateAttributes({value:p,label:e(p)}),s.value=!1}function d(p){p.key==="Enter"?(p.preventDefault(),c()):p.key==="Escape"&&(s.value=!1)}return(p,u)=>(l.openBlock(),l.createBlock(l.unref(Au),{as:"span",class:"tpl-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium tpl:select-none",style:{"background-color":"color-mix(in srgb, var(--tpl-primary) 20%, transparent)",color:"var(--tpl-primary)"},contenteditable:"false"},{default:l.withCtx(()=>[s.value?l.withDirectives((l.openBlock(),l.createElementBlock("input",{key:0,ref_key:"inputRef",ref:a,"onUpdate:modelValue":u[0]||(u[0]=f=>r.value=f),type:"text",class:"tpl:w-32 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:outline-none",style:{color:"var(--tpl-primary)"},onBlur:c,onKeydown:d},null,544)),[[l.vModelText,r.value]]):(l.openBlock(),l.createElementBlock("span",{key:1,class:"tpl-tooltip tpl:cursor-pointer","data-tooltip":n.node.attrs.value,onClick:l.withModifiers(i,["stop"])},l.toDisplayString(o.value),9,E8)),l.createElementVNode("button",{type:"button",class:"tpl:flex tpl:size-4 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100",style:{color:"var(--tpl-primary)"},contenteditable:"false",onClick:u[1]||(u[1]=l.withModifiers((...f)=>n.deleteNode&&n.deleteNode(...f),["stop","prevent"])),onMouseenter:u[2]||(u[2]=f=>f.target.style.color="var(--tpl-danger)"),onMouseleave:u[3]||(u[3]=f=>f.target.style.color="var(--tpl-primary)")},[...u[4]||(u[4]=[l.createElementVNode("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3"},[l.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],32)]),_:1}))}}),T8=xe.create({name:"mergeTagNode",group:"inline",inline:!0,atom:!0,addOptions(){return{mergeTags:[],syntax:yt.SYNTAX_PRESETS.liquid}},addAttributes(){return{label:{default:""},value:{default:""}}},parseHTML(){return[{tag:"span[data-merge-tag]"}]},renderHTML({node:n,HTMLAttributes:t}){const e=yt.getMergeTagLabel(n.attrs.value,this.options.mergeTags);return["span",qt(t,{"data-merge-tag":n.attrs.value,"data-label":e}),e]},addNodeView(){return Iu(C8)},addCommands(){return{insertMergeTag:n=>({commands:t})=>t.insertContent({type:this.name,attrs:n})}},addKeyboardShortcuts(){const n=()=>{const{selection:t}=this.editor.state,{$from:e,$to:o}=t;let s=!1;if(this.editor.state.doc.nodesBetween(e.pos,o.pos,a=>{if(a.type.name===this.name)return s=!0,!1}),s)return!0;if(e.pos>0){const a=e.nodeBefore;if((a==null?void 0:a.type.name)===this.name)return!0}const r=e.nodeAfter;return(r==null?void 0:r.type.name)===this.name};return{Backspace:()=>n(),Delete:()=>n()}},addInputRules(){const n=new RegExp(this.options.syntax.value.source+"$","");return[new Co({find:n,handler:({state:t,range:e,match:o})=>{const s=o[0],r=yt.getMergeTagLabel(s,this.options.mergeTags),a=this.type.create({label:r,value:s});t.tr.replaceWith(e.from,e.to,a)}})]},addPasteRules(){const n=new RegExp(this.options.syntax.value.source,"g");return[new Fl({find:n,handler:({state:t,range:e,match:o})=>{const s=o[0],r=yt.getMergeTagLabel(s,this.options.mergeTags),a=this.type.create({label:r,value:s});t.tr.replaceWith(e.from,e.to,a)}})]}}),N8=Object.freeze(Object.defineProperty({__proto__:null,LogicMergeTagNode:S8,MergeTagNode:T8},Symbol.toStringTag,{value:"Module"})),M8={key:0,class:"tpl-ai-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-[45] tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"},B8={class:"tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3"},O8={class:"tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]"},D8={class:"tpl:flex tpl:items-center tpl:gap-1"},V8=["title"],A8={class:"tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col"},I8={key:0,class:"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"},R8={class:"tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},z8={key:1,class:"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"},P8={class:"tpl:max-w-[240px] tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},L8={key:2,class:"tpl:flex tpl:flex-col tpl:gap-4"},F8={key:0,class:"tpl:self-end tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm",style:{"background-color":"var(--tpl-primary-light)",color:"var(--tpl-text)","max-width":"85%","box-shadow":"var(--tpl-shadow)"}},j8={key:1,class:"tpl:flex tpl:flex-col tpl:gap-2"},H8={key:1,class:"tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap",style:{"max-width":"85%","background-color":"white",color:"var(--tpl-text)","box-shadow":"var(--tpl-shadow)"}},U8={key:0,class:"tpl:mx-3 tpl:mb-2 tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs",style:{"background-color":"var(--tpl-danger-light)",color:"var(--tpl-danger)"}},W8={key:1,class:"tpl:absolute tpl:right-0 tpl:bottom-0 tpl:left-0 tpl:z-10 tpl:px-3 tpl:pb-3",style:{"background-color":`color-mix(
596
+ in srgb,
597
+ var(--tpl-bg) 50%,
598
+ transparent
599
+ )`,"backdrop-filter":"blur(2px)"}},K8={class:"tpl:flex tpl:flex-col tpl:gap-1.5"},_8=["onClick"],G8={class:"tpl:border-t tpl:p-3",style:{"border-color":"var(--tpl-border)"}},J8={class:"tpl-ai-input-wrapper tpl:flex tpl:items-end tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)"}},Y8=["placeholder","disabled"],X8=["disabled"],Z8={class:"tpl:m-0 tpl:px-1 tpl:pt-2 tpl:text-center tpl:text-[11px]",style:{color:"var(--tpl-text-dim)"}},Q8=Object.freeze(Object.defineProperty({__proto__:null,default:Re(l.defineComponent({__name:"AiChatSidebar",props:{visible:{type:Boolean},onApply:{type:Function}},emits:["close"],setup(n,{emit:t}){const e=n,o=t,s=l.inject("translations"),r=l.inject("editor"),a=l.inject("authManager"),i=l.inject("mergeTags",[]),c=ye.useAiChat({authManager:a,getTemplateId:()=>{var b;return((b=r.state.template)==null?void 0:b.id)??null},onApply:e.onApply,onError:void 0}),d=l.ref(""),p=l.ref(null),u=l.ref(!1),f=l.ref(0),{pause:h,resume:m}=tk(()=>{var w;const b=((w=c.suggestions.value)==null?void 0:w.length)??0;f.value<b?f.value++:h()},150,{immediate:!1});l.watch(()=>{var b;return((b=c.suggestions.value)==null?void 0:b.length)??0},b=>{if(h(),b===0){f.value=0;return}f.value=0,jc(()=>m(),100)});function g(){l.nextTick(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})}l.watch(()=>{var b;return((b=c.messages.value)==null?void 0:b.length)??0},()=>g()),l.watch(()=>e.visible,async b=>{var w;b&&!u.value&&(u.value=!0,await c.loadConversation(),(((w=c.messages.value)==null?void 0:w.length)??0)===0&&r.content.value.blocks.length===0&&c.loadSuggestions(r.content.value,i))});async function v(){const b=d.value.trim();!b||c.isGenerating.value||(d.value="",c.error.value=null,c.failedPrompt.value=null,g(),await c.sendPrompt(b,r.content.value,i),c.failedPrompt.value&&(d.value=c.failedPrompt.value),g())}function y(b){return b.replace(/```json[\s\S]*?```/g,"").replace(/```json[\s\S]*/g,"").trim()}function k(b){h(),d.value=b,v()}function S(b){b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),v())}return(b,w)=>(l.openBlock(),l.createBlock(l.Transition,{"enter-active-class":"tpl-ai-slide-enter-active","enter-from-class":"tpl:translate-x-full","enter-to-class":"tpl:translate-x-0","leave-active-class":"tpl-ai-slide-leave-active","leave-from-class":"tpl:translate-x-0","leave-to-class":"tpl:translate-x-full"},{default:l.withCtx(()=>{var x,E,B;return[n.visible?(l.openBlock(),l.createElementBlock("div",M8,[l.createElementVNode("div",B8,[l.createElementVNode("div",O8,[l.createVNode(l.unref(vl),{size:13,"stroke-width":2}),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).aiChat.title),1)]),l.createElementVNode("div",D8,[(((x=l.unref(c).messages.value)==null?void 0:x.length)??0)>0?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",style:{color:"var(--tpl-text-muted)"},title:l.unref(s).aiChat.clear,onClick:w[0]||(w[0]=C=>l.unref(c).clearChat())},[l.createVNode(l.unref(yl),{size:14,"stroke-width":2})],8,V8)):l.createCommentVNode("",!0),l.createElementVNode("button",{class:"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",style:{color:"var(--tpl-text-muted)"},onClick:w[1]||(w[1]=C=>o("close"))},[l.createVNode(l.unref(hn),{size:14,"stroke-width":2})])])]),l.createElementVNode("div",A8,[l.createElementVNode("div",{ref_key:"messagesContainer",ref:p,class:"tpl:flex-1 tpl:overflow-y-auto tpl:p-4"},[l.unref(c).isLoadingHistory.value?(l.openBlock(),l.createElementBlock("div",I8,[l.createVNode(l.unref(Kn),{class:"tpl-spinner",size:24,"stroke-width":2,style:{color:"var(--tpl-text-muted)"}}),l.createElementVNode("p",R8,l.toDisplayString(l.unref(s).aiChat.loadingHistory),1)])):(((E=l.unref(c).messages.value)==null?void 0:E.length)??0)===0?(l.openBlock(),l.createElementBlock("div",z8,[l.createVNode(l.unref(vl),{size:32,"stroke-width":1.5,style:{color:"var(--tpl-text-dim)"}}),l.createElementVNode("p",P8,l.toDisplayString(l.unref(s).aiChat.placeholder),1)])):(l.openBlock(),l.createElementBlock("div",L8,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(c).messages.value,(C,D)=>{var R;return l.openBlock(),l.createElementBlock("div",{key:C.id,class:"tpl:flex tpl:flex-col tpl:gap-2"},[C.role==="user"?(l.openBlock(),l.createElementBlock("div",F8,l.toDisplayString(C.content),1)):(l.openBlock(),l.createElementBlock("div",j8,[!y(C.content)&&l.unref(c).isGenerating.value&&D===(((R=l.unref(c).messages.value)==null?void 0:R.length)??0)-1?(l.openBlock(),l.createBlock(Wa,{key:0})):(l.openBlock(),l.createElementBlock("div",H8,l.toDisplayString(y(C.content)||l.unref(s).aiChat.applied),1)),C.id===l.unref(c).lastApplyMessageId.value&&!l.unref(c).isGenerating.value?(l.openBlock(),l.createElementBlock("button",{key:2,class:"tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:self-start tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-text-muted)","background-color":"transparent"},onClick:w[2]||(w[2]=N=>l.unref(c).toggleLastRevert())},[l.unref(c).isLastChangeReverted.value?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(l.unref(Tk),{size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).aiChat.reapply),1)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createVNode(l.unref(Uk),{size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).aiChat.revert),1)],64))])):l.createCommentVNode("",!0)]))])}),128))]))],512),l.unref(c).error.value?(l.openBlock(),l.createElementBlock("div",U8,[l.createVNode(l.unref(ml),{size:14,"stroke-width":2,class:"tpl:mt-0.5 tpl:shrink-0"}),l.createElementVNode("span",null,l.toDisplayString(l.unref(c).error.value==="ai_apply_failed"?l.unref(s).aiChat.applyFailed:l.unref(s).aiChat.error),1)])):l.createCommentVNode("",!0),(((B=l.unref(c).suggestions.value)==null?void 0:B.length)??0)>0?(l.openBlock(),l.createElementBlock("div",W8,[l.createElementVNode("div",K8,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(c).suggestions.value??[],(C,D)=>{var R;return l.openBlock(),l.createElementBlock("button",{key:D,class:l.normalizeClass(["tpl-suggestion-btn tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:leading-snug tpl:transition-all tpl:duration-300 tpl:ease-out",(((R=l.unref(c).suggestions.value)==null?void 0:R.length)??0)-1-D<f.value?"tpl:translate-y-0 tpl:opacity-100":"tpl:pointer-events-none tpl:-translate-y-2 tpl:opacity-0"]),style:{"border-color":"var(--tpl-border)",color:"var(--tpl-primary)","background-color":"white","box-shadow":"var(--tpl-shadow)"},onClick:N=>k(C)},l.toDisplayString(C),11,_8)}),128))])])):l.createCommentVNode("",!0)]),l.createElementVNode("div",G8,[l.createElementVNode("div",J8,[l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":w[3]||(w[3]=C=>d.value=C),class:"tpl:max-h-32 tpl:min-h-[64px] tpl:flex-1 tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-sm tpl:outline-none",style:{color:"var(--tpl-text)"},placeholder:l.unref(s).aiChat.inputPlaceholder,disabled:l.unref(c).isGenerating.value,rows:"3",onKeydown:S},null,40,Y8),[[l.vModelText,d.value]]),l.createElementVNode("button",{class:"tpl-ai-send-btn tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:duration-150 tpl:disabled:opacity-40",style:{color:"var(--tpl-primary)"},disabled:!d.value.trim()||l.unref(c).isGenerating.value,onClick:v},[l.createVNode(l.unref(wa),{size:16,"stroke-width":2})],8,X8)]),l.createElementVNode("p",Z8,l.toDisplayString(l.unref(s).aiMenu.disclaimer),1)])])):l.createCommentVNode("",!0)]}),_:1}))}}),[["__scopeId","data-v-3d9d0cf5"]])},Symbol.toStringTag,{value:"Module"})),q8={key:0,class:"tpl-comments-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-[45] tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"},$8={class:"tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3"},tR={class:"tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium",style:{color:"var(--tpl-text)"}},eR={key:0,class:"tpl:ml-1 tpl:inline-flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"}},nR={class:"tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2"},oR={class:"tpl:flex-1 tpl:overflow-y-auto"},lR={key:0,class:"tpl:flex tpl:h-full tpl:items-center tpl:justify-center"},sR={key:1,class:"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:px-6 tpl:text-center"},rR={class:"tpl:max-w-[240px] tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},aR={key:2,class:"tpl:flex tpl:flex-col tpl:gap-3 tpl:p-3"},iR={class:"tpl-comment-card tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-3"},cR={class:"tpl:flex tpl:items-start tpl:justify-between tpl:gap-2"},dR={class:"tpl:flex tpl:items-center tpl:gap-1.5"},pR={class:"tpl:text-xs tpl:font-semibold",style:{color:"var(--tpl-text)"}},uR={class:"tpl:text-[10px]",style:{color:"var(--tpl-text-dim)"}},fR={key:0,class:"tpl:text-[10px] tpl:italic",style:{color:"var(--tpl-text-dim)"}},hR={class:"tpl:flex tpl:items-center tpl:gap-0.5"},mR=["title","onClick"],gR=["title","onClick"],vR=["title","onClick"],yR={key:0,class:"tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1 tpl:text-[10px]",style:{color:"var(--tpl-primary)"}},bR={key:0,class:"tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",style:{"background-color":"var(--tpl-warning-light)",color:"var(--tpl-warning)"}},kR=["onClick"],xR={key:2,class:"tpl:mt-2"},wR=["onKeydown"],SR={class:"tpl:mt-1.5 tpl:flex tpl:gap-1.5"},ER=["disabled","onClick"],CR={key:3,class:"tpl:mt-1.5 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap",style:{color:"var(--tpl-text)"}},TR={key:4,class:"tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs",style:{"background-color":"var(--tpl-danger-light)",color:"var(--tpl-danger)"}},NR={class:"tpl:flex-1"},MR=["onClick"],BR={key:5,class:"tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2"},OR=["title","onClick"],DR=["onClick"],VR={key:0,class:"tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"},AR={class:"tpl:flex tpl:items-start tpl:justify-between tpl:gap-2"},IR={class:"tpl:flex tpl:items-center tpl:gap-1.5"},RR={class:"tpl:text-xs tpl:font-semibold",style:{color:"var(--tpl-text)"}},zR={class:"tpl:text-[10px]",style:{color:"var(--tpl-text-dim)"}},PR={key:0,class:"tpl:text-[10px] tpl:italic",style:{color:"var(--tpl-text-dim)"}},LR={class:"tpl:flex tpl:items-center tpl:gap-0.5"},FR=["title","onClick"],jR=["title","onClick"],HR={key:0,class:"tpl:mt-1.5"},UR=["onKeydown"],WR={class:"tpl:mt-1.5 tpl:flex tpl:gap-1.5"},KR=["disabled","onClick"],_R={key:1,class:"tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap",style:{color:"var(--tpl-text)"}},GR={key:2,class:"tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs",style:{"background-color":"var(--tpl-danger-light)",color:"var(--tpl-danger)"}},JR={class:"tpl:flex-1"},YR=["onClick"],XR={key:0,class:"tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"},ZR={class:"tpl:flex tpl:items-end tpl:gap-2"},QR=["placeholder","onKeydown"],qR={class:"tpl:flex tpl:shrink-0 tpl:flex-col tpl:gap-1"},$R=["disabled","onClick"],tz={class:"tpl:border-t tpl:p-3",style:{"border-color":"var(--tpl-border)"}},ez={key:0,class:"tpl:flex tpl:min-h-[68px] tpl:items-center tpl:rounded-md tpl:px-3 tpl:py-2 tpl:text-xs",style:{"background-color":"var(--tpl-warning-light)",color:"var(--tpl-warning)"}},nz={key:1,class:"tpl-comments-input-wrapper tpl:flex tpl:min-h-[68px] tpl:items-end tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)"}},oz=["placeholder","disabled"],lz=["disabled"],sz=Object.freeze(Object.defineProperty({__proto__:null,default:Re(l.defineComponent({__name:"CommentsSidebar",props:{visible:{type:Boolean}},emits:["close","filterBlock"],setup(n,{expose:t,emit:e}){const o=n,s=e,r=l.inject("translations"),a=l.inject("editor"),i=l.inject("authManager"),c=l.inject("comments"),d=l.ref("unresolved"),p=l.ref(null),u=l.ref(""),f=l.ref(null),h=l.ref(""),m=l.ref(null),g=l.ref(""),v=l.ref(new Set),y=l.ref(null),k=l.ref(null),S=l.computed(()=>{var K;return((K=i.userConfig)==null?void 0:K.id)??null}),b=l.computed(()=>{const K=new Set;for(const nt of a.content.value.blocks)if(K.add(nt.id),nt.type==="section")for(const F of nt.children)for(const T of F)K.add(T.id);return K});function w(K){return K?!b.value.has(K):!1}const x=l.computed(()=>d.value!=="block"||!p.value?!1:!a.savedBlockIds.value.has(p.value)),E=l.computed(()=>{let K=c.comments.value;return d.value==="unresolved"?K=K.filter(nt=>!nt.resolved_at):d.value==="block"&&p.value&&(K=K.filter(nt=>nt.block_id===p.value)),K});l.watch(()=>o.visible,K=>{K&&c.loadComments()}),l.watch(()=>a.state.selectedBlockId,K=>{d.value==="block"&&K&&(p.value=K)});function B(K,nt){d.value=K,p.value=K==="block"?nt??null:null}function C(K){B("block",K),s("filterBlock",K)}function D(K){v.value.has(K)?v.value.delete(K):v.value.add(K)}function R(K){f.value=K,h.value="",m.value=null,v.value.has(K)||v.value.add(K)}function N(){f.value=null,h.value=""}function L(K){m.value=K.id,g.value=K.body,f.value=null}function z(){m.value=null,g.value=""}function P(K){y.value=K}function U(){y.value=null}async function O(){const K=u.value.trim();if(!K)return;const nt=d.value==="block"?p.value:void 0;await c.addComment(K,nt??void 0),u.value=""}async function W(K){const nt=h.value.trim();if(!nt)return;const F=c.comments.value.find(T=>T.id===K);await c.addComment(nt,(F==null?void 0:F.block_id)??void 0,K),f.value=null,h.value=""}async function lt(K){const nt=g.value.trim();nt&&(await c.editComment(K,nt),m.value=null,g.value="")}async function ht(K){await c.removeComment(K),y.value=null}async function gt(K){await c.toggleResolve(K)}function bt(K){return K.author_identifier===S.value}function Pt(K){const nt=new Date(K),T=new Date().getTime()-nt.getTime(),Y=Math.floor(T/6e4),Bt=Math.floor(T/36e5),Ot=Math.floor(T/864e5);return Y<1?r.snapshotHistory.justNow:Y<60?r.snapshotHistory.minutesAgo.replace("{minutes}",String(Y)):Bt<24?r.snapshotHistory.hoursAgo.replace("{hours}",String(Bt)):r.snapshotHistory.daysAgo.replace("{days}",String(Ot))}function Ct(K){K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),O())}function Nt(K,nt){K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),W(nt))}function St(K,nt){K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),lt(nt)),K.key==="Escape"&&z()}function xt(){l.nextTick(()=>{var K;(K=k.value)==null||K.focus()})}return t({filterByBlock:C,focusNewComment:xt}),(K,nt)=>(l.openBlock(),l.createBlock(l.Transition,{"enter-active-class":"tpl-comments-slide-enter-active","enter-from-class":"tpl:translate-x-full","enter-to-class":"tpl:translate-x-0","leave-active-class":"tpl-comments-slide-leave-active","leave-from-class":"tpl:translate-x-0","leave-to-class":"tpl:translate-x-full"},{default:l.withCtx(()=>[n.visible?(l.openBlock(),l.createElementBlock("div",q8,[l.createElementVNode("div",$8,[l.createElementVNode("div",tR,[l.createVNode(l.unref(ka),{size:13,"stroke-width":2}),l.createElementVNode("span",null,l.toDisplayString(l.unref(r).comments.title),1),l.unref(c).unresolvedCount.value>0?(l.openBlock(),l.createElementBlock("span",eR,l.toDisplayString(l.unref(c).unresolvedCount.value),1)):l.createCommentVNode("",!0)]),l.createElementVNode("button",{class:"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",style:{color:"var(--tpl-text-muted)"},onClick:nt[0]||(nt[0]=F=>s("close"))},[l.createVNode(l.unref(hn),{size:14,"stroke-width":2})])]),l.createElementVNode("div",nR,[l.createElementVNode("button",{class:l.normalizeClass(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150",d.value==="unresolved"?"tpl-comment-filter--active":""]),onClick:nt[1]||(nt[1]=F=>B("unresolved"))},l.toDisplayString(l.unref(r).comments.filterUnresolved),3),l.createElementVNode("button",{class:l.normalizeClass(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150",d.value==="all"?"tpl-comment-filter--active":""]),onClick:nt[2]||(nt[2]=F=>B("all"))},l.toDisplayString(l.unref(r).comments.filterAll),3),l.unref(a).state.selectedBlockId?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150",d.value==="block"?"tpl-comment-filter--active":""]),onClick:nt[3]||(nt[3]=F=>B("block",l.unref(a).state.selectedBlockId??void 0))},l.toDisplayString(l.unref(r).comments.filterBlock),3)):l.createCommentVNode("",!0)]),l.createElementVNode("div",oR,[l.unref(c).isLoading.value?(l.openBlock(),l.createElementBlock("div",lR,[l.createVNode(l.unref(Kn),{class:"tpl-spinner",size:24,"stroke-width":2,style:{color:"var(--tpl-text-muted)"}})])):E.value.length===0?(l.openBlock(),l.createElementBlock("div",sR,[l.createVNode(l.unref(ka),{size:32,"stroke-width":1.5,style:{color:"var(--tpl-text-dim)"}}),l.createElementVNode("p",rR,l.toDisplayString(d.value==="all"?l.unref(r).comments.noCommentsHint:l.unref(r).comments.noComments),1)])):(l.openBlock(),l.createElementBlock("div",aR,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(E.value,F=>{var T,Y,Bt,Ot;return l.openBlock(),l.createElementBlock("div",{key:F.id,class:"tpl-comment-thread"},[l.createElementVNode("div",iR,[l.createElementVNode("div",cR,[l.createElementVNode("div",dR,[l.createElementVNode("span",pR,l.toDisplayString(bt(F)?l.unref(r).comments.ownedByYou:F.author_name),1),l.createElementVNode("span",uR,l.toDisplayString(Pt(F.created_at)),1),F.updated_at!==F.created_at?(l.openBlock(),l.createElementBlock("span",fR," ("+l.toDisplayString(l.unref(r).comments.edited)+") ",1)):l.createCommentVNode("",!0)]),l.createElementVNode("div",hR,[l.createElementVNode("button",{class:"tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",title:F.resolved_at?l.unref(r).comments.unresolve:l.unref(r).comments.resolve,onClick:pt=>gt(F.id)},[l.createVNode(l.unref(uk),{size:13,"stroke-width":2,class:"tpl-resolve-icon",style:l.normalizeStyle({color:F.resolved_at?"var(--tpl-primary)":void 0})},null,8,["style"])],8,mR),bt(F)?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",title:l.unref(r).comments.edit,onClick:pt=>L(F)},[l.createVNode(l.unref(bf),{size:12,"stroke-width":2})],8,gR)):l.createCommentVNode("",!0),bt(F)?(l.openBlock(),l.createElementBlock("button",{key:1,class:"tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",title:l.unref(r).comments.delete,onClick:pt=>P(F.id)},[l.createVNode(l.unref(yl),{size:12,"stroke-width":2})],8,vR)):l.createCommentVNode("",!0)])]),l.createVNode(l.Transition,{name:"tpl-resolve"},{default:l.withCtx(()=>[F.resolved_at?(l.openBlock(),l.createElementBlock("div",yR,[l.createVNode(l.unref(ik),{size:10,"stroke-width":2.5}),l.createElementVNode("span",null,l.toDisplayString(l.unref(r).comments.resolvedBy.replace("{name}",F.resolved_by_name??"")),1)])):l.createCommentVNode("",!0)]),_:2},1024),F.block_id&&w(F.block_id)?(l.openBlock(),l.createElementBlock("span",bR,l.toDisplayString(l.unref(r).comments.missingBlock),1)):F.block_id?(l.openBlock(),l.createElementBlock("button",{key:1,class:"tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-150",style:{"background-color":"var(--tpl-bg-hover)",color:"var(--tpl-text-muted)"},onClick:pt=>l.unref(a).selectBlock(F.block_id??"")}," Block ",8,kR)):l.createCommentVNode("",!0),m.value===F.id?(l.openBlock(),l.createElementBlock("div",xR,[l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":nt[4]||(nt[4]=pt=>g.value=pt),class:"tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)",color:"var(--tpl-text)"},rows:"3",onKeydown:pt=>St(pt,F.id)},null,40,wR),[[l.vModelText,g.value]]),l.createElementVNode("div",SR,[l.createElementVNode("button",{class:"tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"},disabled:!g.value.trim()||l.unref(c).isSubmitting.value,onClick:pt=>lt(F.id)},l.toDisplayString(l.unref(r).comments.save),9,ER),l.createElementVNode("button",{class:"tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150",style:{color:"var(--tpl-text-muted)"},onClick:nt[5]||(nt[5]=pt=>z())},l.toDisplayString(l.unref(r).comments.cancel),1)])])):(l.openBlock(),l.createElementBlock("p",CR,l.toDisplayString(F.body),1)),y.value===F.id?(l.openBlock(),l.createElementBlock("div",TR,[l.createElementVNode("span",NR,l.toDisplayString(l.unref(r).comments.deleteConfirm),1),l.createElementVNode("button",{class:"tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium",style:{"background-color":"var(--tpl-danger)",color:"white"},onClick:pt=>ht(F.id)},l.toDisplayString(l.unref(r).comments.delete),9,MR),l.createElementVNode("button",{class:"tpl:text-xs tpl:font-medium",style:{color:"var(--tpl-text-muted)"},onClick:nt[6]||(nt[6]=pt=>U())},l.toDisplayString(l.unref(r).comments.cancel),1)])):l.createCommentVNode("",!0),m.value!==F.id&&y.value!==F.id?(l.openBlock(),l.createElementBlock("div",BR,[l.createElementVNode("button",{class:"tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",title:l.unref(r).comments.reply,onClick:pt=>R(F.id)},[l.createVNode(l.unref(Mk),{size:13,"stroke-width":2,style:{color:"var(--tpl-primary)"}})],8,OR),(((T=F.replies)==null?void 0:T.length)??0)>0?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl:flex tpl:items-center tpl:gap-0.5 tpl:text-[11px] tpl:font-medium tpl:transition-colors tpl:duration-150",style:{color:"var(--tpl-text-muted)"},onClick:pt=>D(F.id)},[v.value.has(F.id)?(l.openBlock(),l.createBlock(l.unref(pk),{key:0,size:11,"stroke-width":2})):(l.openBlock(),l.createBlock(l.unref(zo),{key:1,size:11,"stroke-width":2})),l.createTextVNode(" "+l.toDisplayString((((Y=F.replies)==null?void 0:Y.length)??0)===1?l.unref(r).comments.replyOne.replace("{count}",String(((Bt=F.replies)==null?void 0:Bt.length)??0)):l.unref(r).comments.replyMany.replace("{count}",String(((Ot=F.replies)==null?void 0:Ot.length)??0))),1)],8,DR)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]),l.createVNode(l.Transition,{name:"tpl-replies"},{default:l.withCtx(()=>{var pt;return[v.value.has(F.id)&&(((pt=F.replies)==null?void 0:pt.length)??0)>0?(l.openBlock(),l.createElementBlock("div",VR,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(F.replies,(M,st)=>{var Vt;return l.openBlock(),l.createElementBlock("div",{key:M.id,class:l.normalizeClass(["tpl-comment-reply-card tpl:relative tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-2.5",st<(((Vt=F.replies)==null?void 0:Vt.length)??0)-1?"tpl:mb-2":""])},[l.createElementVNode("div",AR,[l.createElementVNode("div",IR,[l.createElementVNode("span",RR,l.toDisplayString(bt(M)?l.unref(r).comments.ownedByYou:M.author_name),1),l.createElementVNode("span",zR,l.toDisplayString(Pt(M.created_at)),1),M.updated_at!==M.created_at?(l.openBlock(),l.createElementBlock("span",PR," ("+l.toDisplayString(l.unref(r).comments.edited)+") ",1)):l.createCommentVNode("",!0)]),l.createElementVNode("div",LR,[bt(M)?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",title:l.unref(r).comments.edit,onClick:Wt=>L(M)},[l.createVNode(l.unref(bf),{size:11,"stroke-width":2})],8,FR)):l.createCommentVNode("",!0),bt(M)?(l.openBlock(),l.createElementBlock("button",{key:1,class:"tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",title:l.unref(r).comments.delete,onClick:Wt=>P(M.id)},[l.createVNode(l.unref(yl),{size:11,"stroke-width":2})],8,jR)):l.createCommentVNode("",!0)])]),m.value===M.id?(l.openBlock(),l.createElementBlock("div",HR,[l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":nt[7]||(nt[7]=Wt=>g.value=Wt),class:"tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)",color:"var(--tpl-text)"},rows:"2",onKeydown:Wt=>St(Wt,M.id)},null,40,UR),[[l.vModelText,g.value]]),l.createElementVNode("div",WR,[l.createElementVNode("button",{class:"tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"},disabled:!g.value.trim()||l.unref(c).isSubmitting.value,onClick:Wt=>lt(M.id)},l.toDisplayString(l.unref(r).comments.save),9,KR),l.createElementVNode("button",{class:"tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium",style:{color:"var(--tpl-text-muted)"},onClick:nt[8]||(nt[8]=Wt=>z())},l.toDisplayString(l.unref(r).comments.cancel),1)])])):(l.openBlock(),l.createElementBlock("p",_R,l.toDisplayString(M.body),1)),y.value===M.id?(l.openBlock(),l.createElementBlock("div",GR,[l.createElementVNode("span",JR,l.toDisplayString(l.unref(r).comments.deleteConfirm),1),l.createElementVNode("button",{class:"tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium",style:{"background-color":"var(--tpl-danger)",color:"white"},onClick:Wt=>ht(M.id)},l.toDisplayString(l.unref(r).comments.delete),9,YR),l.createElementVNode("button",{class:"tpl:text-xs tpl:font-medium",style:{color:"var(--tpl-text-muted)"},onClick:nt[9]||(nt[9]=Wt=>U())},l.toDisplayString(l.unref(r).comments.cancel),1)])):l.createCommentVNode("",!0)],2)}),128))])):l.createCommentVNode("",!0)]}),_:2},1024),l.createVNode(l.Transition,{name:"tpl-replies"},{default:l.withCtx(()=>[f.value===F.id?(l.openBlock(),l.createElementBlock("div",XR,[l.createElementVNode("div",ZR,[l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":nt[10]||(nt[10]=pt=>h.value=pt),class:"tpl:flex-1 tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)",color:"var(--tpl-text)"},placeholder:l.unref(r).comments.replyPlaceholder,rows:"2",onKeydown:pt=>Nt(pt,F.id)},null,40,QR),[[l.vModelText,h.value]]),l.createElementVNode("div",qR,[l.createElementVNode("button",{class:"tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150 tpl:disabled:opacity-40",style:{color:"var(--tpl-primary)"},disabled:!h.value.trim()||l.unref(c).isSubmitting.value,onClick:pt=>W(F.id)},[l.createVNode(l.unref(wa),{size:14,"stroke-width":2})],8,$R),l.createElementVNode("button",{class:"tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150",style:{color:"var(--tpl-text-muted)"},onClick:nt[11]||(nt[11]=pt=>N())},[l.createVNode(l.unref(hn),{size:14,"stroke-width":2})])])])])):l.createCommentVNode("",!0)]),_:2},1024)])}),128))]))]),l.createElementVNode("div",tz,[x.value?(l.openBlock(),l.createElementBlock("div",ez,l.toDisplayString(l.unref(r).comments.saveTemplateFirst),1)):(l.openBlock(),l.createElementBlock("div",nz,[l.withDirectives(l.createElementVNode("textarea",{ref_key:"newCommentInput",ref:k,"onUpdate:modelValue":nt[12]||(nt[12]=F=>u.value=F),class:"tpl:max-h-24 tpl:min-h-[48px] tpl:flex-1 tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-xs tpl:outline-none",style:{color:"var(--tpl-text)"},placeholder:l.unref(r).comments.placeholder,disabled:l.unref(c).isSubmitting.value,rows:"2",onKeydown:Ct},null,40,oz),[[l.vModelText,u.value]]),l.createElementVNode("button",{class:"tpl-comments-send-btn tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:duration-150 tpl:disabled:opacity-40",style:{color:"var(--tpl-primary)"},disabled:!u.value.trim()||l.unref(c).isSubmitting.value,onClick:O},[l.unref(c).isSubmitting.value?(l.openBlock(),l.createBlock(l.unref(Kn),{key:0,class:"tpl-spinner",size:16,"stroke-width":2})):(l.openBlock(),l.createBlock(l.unref(wa),{key:1,size:16,"stroke-width":2}))],8,lz)]))])])):l.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-7cf62c4b"]])},Symbol.toStringTag,{value:"Module"})),rz={key:0,class:"tpl-design-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-[45] tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"},az={class:"tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3"},iz={class:"tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium",style:{color:"var(--tpl-primary)"}},cz={class:"tpl:flex-1 tpl:overflow-y-auto tpl:p-4"},dz={key:0,class:"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"},pz={class:"tpl:flex tpl:w-full tpl:flex-col tpl:items-center tpl:gap-3"},uz={class:"tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},fz={key:1,class:"tpl:flex tpl:flex-col tpl:gap-4"},hz={class:"tpl:flex tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",style:{"background-color":"var(--tpl-bg-hover)"}},mz={key:0,class:"tpl:flex tpl:flex-col tpl:gap-2"},gz={class:"tpl:relative tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)]",style:{border:"1px solid var(--tpl-border)","background-color":"var(--tpl-bg)"}},vz=["src","alt"],yz={key:1,class:"tpl:flex tpl:h-32 tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2"},bz={class:"tpl:text-xs",style:{color:"var(--tpl-text-muted)"}},kz={class:"tpl:text-center tpl:text-xs",style:{color:"var(--tpl-text-muted)"}},xz={class:"tpl:text-center tpl:text-[11px]",style:{color:"var(--tpl-text-dim)"}},wz=["accept"],Sz={class:"tpl:flex tpl:flex-col tpl:gap-1.5"},Ez={class:"tpl:text-xs tpl:font-medium",style:{color:"var(--tpl-text-muted)"}},Cz=["placeholder"],Tz={key:0,class:"tpl:flex tpl:flex-col tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:px-3 tpl:py-3",style:{"background-color":"var(--tpl-warning-light)",border:"1px solid var(--tpl-warning)"}},Nz={class:"tpl:text-xs tpl:leading-snug",style:{color:"var(--tpl-text)"}},Mz={class:"tpl:flex tpl:gap-2"},Bz={key:1,class:"tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs",style:{"background-color":"var(--tpl-danger-light)",color:"var(--tpl-danger)"}},Oz=["disabled"],Dz={class:"tpl:m-0 tpl:pt-1 tpl:text-center tpl:text-[11px]",style:{color:"var(--tpl-text-dim)"}},Vz=Object.freeze(Object.defineProperty({__proto__:null,default:Re(l.defineComponent({__name:"DesignReferenceSidebar",props:{visible:{type:Boolean},hasExistingBlocks:{type:Boolean}},emits:["close","apply"],setup(n,{emit:t}){const e=n,o=t,s=l.inject("translations"),r=l.inject("editor"),a=l.inject("authManager"),i=ye.useDesignReference({authManager:a,getTemplateId:()=>{var C;return((C=r.state.template)==null?void 0:C.id)??null},onApply:C=>o("apply",C)}),c=l.ref("image"),d=l.ref(null),p=l.ref(""),u=l.ref(null),f=l.ref(!1),h=l.ref(!1),m=l.computed(()=>s.designReference),g=l.computed(()=>i.isGenerating.value?!1:d.value!==null);function v(C){c.value=C,S()}function y(C){var N;const D=C.target,R=(N=D.files)==null?void 0:N[0];R&&k(R),D.value=""}function k(C){if(C.size>10*1024*1024){i.error.value=m.value.fileTooLarge;return}if(c.value==="image"){if(!["image/png","image/jpeg","image/jpg","image/webp"].includes(C.type)){i.error.value=m.value.invalidFileType;return}}else if(c.value==="pdf"&&C.type!=="application/pdf"){i.error.value=m.value.invalidFileType;return}d.value=C,i.error.value=null,u.value&&URL.revokeObjectURL(u.value),C.type.startsWith("image/")?u.value=URL.createObjectURL(C):u.value=null}function S(){u.value&&(URL.revokeObjectURL(u.value),u.value=null),d.value=null}function b(C){C.preventDefault(),h.value=!0}function w(){h.value=!1}function x(C){var R,N;C.preventDefault(),h.value=!1;const D=(N=(R=C.dataTransfer)==null?void 0:R.files)==null?void 0:N[0];D&&k(D)}function E(){if(!g.value)return;if(e.hasExistingBlocks&&!f.value){f.value=!0;return}f.value=!1;const C={};p.value.trim()&&(C.prompt=p.value.trim()),c.value==="image"&&d.value?C.imageUpload=d.value:c.value==="pdf"&&d.value&&(C.pdfUpload=d.value),i.generate(C)}function B(){f.value=!1}return l.watch(()=>e.visible,C=>{C||(f.value=!1)}),(C,D)=>(l.openBlock(),l.createBlock(l.Transition,{"enter-active-class":"tpl-design-slide-enter-active","enter-from-class":"tpl:translate-x-full","enter-to-class":"tpl:translate-x-0","leave-active-class":"tpl-design-slide-leave-active","leave-from-class":"tpl:translate-x-0","leave-to-class":"tpl:translate-x-full"},{default:l.withCtx(()=>[n.visible?(l.openBlock(),l.createElementBlock("div",rz,[l.createElementVNode("div",az,[l.createElementVNode("div",iz,[l.createVNode(l.unref(ba),{size:13,"stroke-width":2}),l.createElementVNode("span",null,l.toDisplayString(m.value.title),1)]),l.createElementVNode("button",{class:"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",style:{color:"var(--tpl-text-muted)"},onClick:D[0]||(D[0]=R=>o("close"))},[l.createVNode(l.unref(hn),{size:14,"stroke-width":2})])]),l.createElementVNode("div",cz,[l.unref(i).isGenerating.value?(l.openBlock(),l.createElementBlock("div",dz,[l.createElementVNode("div",pz,[l.createVNode(Wa),l.createElementVNode("p",uz,l.toDisplayString(m.value.generating),1)])])):(l.openBlock(),l.createElementBlock("div",fz,[l.createElementVNode("div",hz,[l.createElementVNode("button",{class:"tpl:flex tpl:flex-1 tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-2 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",style:l.normalizeStyle({backgroundColor:c.value==="image"?"var(--tpl-bg)":"transparent",color:c.value==="image"?"var(--tpl-primary)":"var(--tpl-text-muted)",boxShadow:c.value==="image"?"var(--tpl-shadow)":"none"}),onClick:D[1]||(D[1]=R=>v("image"))},[l.createVNode(l.unref(hk),{size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(m.value.uploadImage),1)],4),l.createElementVNode("button",{class:"tpl:flex tpl:flex-1 tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-2 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",style:l.normalizeStyle({backgroundColor:c.value==="pdf"?"var(--tpl-bg)":"transparent",color:c.value==="pdf"?"var(--tpl-primary)":"var(--tpl-text-muted)",boxShadow:c.value==="pdf"?"var(--tpl-shadow)":"none"}),onClick:D[2]||(D[2]=R=>v("pdf"))},[l.createVNode(l.unref(vf),{size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(m.value.uploadPdf),1)],4)]),l.createElementVNode("div",null,[d.value?(l.openBlock(),l.createElementBlock("div",mz,[l.createElementVNode("div",gz,[u.value?(l.openBlock(),l.createElementBlock("img",{key:0,src:u.value,alt:d.value.name,class:"tpl:h-auto tpl:max-h-48 tpl:w-full tpl:object-contain"},null,8,vz)):(l.openBlock(),l.createElementBlock("div",yz,[l.createVNode(l.unref(vf),{size:32,"stroke-width":1.5,style:{color:"var(--tpl-text-dim)"}}),l.createElementVNode("span",bz,l.toDisplayString(d.value.name),1)])),l.createElementVNode("button",{class:"tpl:absolute tpl:top-2 tpl:right-2 tpl:rounded-full tpl:p-1 tpl:transition-colors tpl:duration-150",style:{"background-color":"var(--tpl-bg)",color:"var(--tpl-text-muted)","box-shadow":"var(--tpl-shadow)"},onClick:S},[l.createVNode(l.unref(hn),{size:12,"stroke-width":2})])])])):(l.openBlock(),l.createElementBlock("div",{key:1,class:"tpl-design-dropzone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border-2 tpl:border-dashed tpl:px-4 tpl:py-8 tpl:transition-colors tpl:duration-150",style:l.normalizeStyle({borderColor:h.value?"var(--tpl-primary)":"var(--tpl-border-light)",backgroundColor:h.value?"var(--tpl-primary-light)":"var(--tpl-bg)"}),onClick:D[3]||(D[3]=R=>{var N;return(N=C.$refs.fileInput)==null?void 0:N.click()}),onDragover:b,onDragleave:w,onDrop:x},[l.createVNode(l.unref(Wk),{size:24,"stroke-width":1.5,style:{color:"var(--tpl-text-dim)"}}),l.createElementVNode("span",kz,l.toDisplayString(m.value.dropHint),1),l.createElementVNode("span",xz,l.toDisplayString(c.value==="image"?m.value.acceptedImages:m.value.acceptedPdf),1)],36)),l.createElementVNode("input",{ref:"fileInput",type:"file",class:"tpl:hidden",accept:c.value==="image"?"image/png,image/jpeg,image/webp":"application/pdf",onChange:y},null,40,wz)]),l.createElementVNode("div",Sz,[l.createElementVNode("label",Ez,l.toDisplayString(m.value.promptLabel),1),l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":D[4]||(D[4]=R=>p.value=R),class:l.normalizeClass(["tpl:min-h-[72px] tpl:w-full tpl:resize-none tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:font-sans tpl:text-sm tpl:outline-none tpl:transition-colors tpl:duration-150",["tpl-design-prompt-input"]]),style:{"border-color":"var(--tpl-border)",color:"var(--tpl-text)","background-color":"var(--tpl-bg)"},placeholder:m.value.promptPlaceholder,rows:"3"},null,8,Cz),[[l.vModelText,p.value]])]),f.value?(l.openBlock(),l.createElementBlock("div",Tz,[l.createElementVNode("p",Nz,l.toDisplayString(m.value.replaceWarning),1),l.createElementVNode("div",Mz,[l.createElementVNode("button",{class:"tpl:flex-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",style:{"background-color":"transparent",color:"var(--tpl-text-muted)",border:"1px solid var(--tpl-border)"},onClick:B},l.toDisplayString(m.value.replaceCancel),1),l.createElementVNode("button",{class:"tpl:flex-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"},onClick:E},l.toDisplayString(m.value.replaceConfirm),1)])])):l.createCommentVNode("",!0),l.unref(i).error.value?(l.openBlock(),l.createElementBlock("div",Bz,[l.createVNode(l.unref(ml),{size:14,"stroke-width":2,class:"tpl:mt-0.5 tpl:shrink-0"}),l.createElementVNode("span",null,l.toDisplayString(m.value.error),1)])):l.createCommentVNode("",!0),f.value?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("button",{key:2,class:"tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"},disabled:!g.value,onClick:E},[l.createVNode(l.unref(ba),{size:16,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(m.value.generate),1)],8,Oz)),l.createElementVNode("p",Dz,l.toDisplayString(l.unref(s).aiMenu.disclaimer),1)]))])])):l.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-c47a124b"]])},Symbol.toStringTag,{value:"Module"})),Az={key:0,class:"tpl-scoring-panel tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-[45] tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"},Iz={class:"tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3"},Rz={class:"tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium",style:{color:"var(--tpl-primary)"}},zz={class:"tpl:flex tpl:items-center tpl:gap-1"},Pz=["title"],Lz={class:"tpl:flex-1 tpl:overflow-y-auto tpl:p-4"},Fz={key:0,class:"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"},jz={class:"tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},Hz={key:1,class:"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"},Uz={class:"tpl:max-w-[240px] tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},Wz={key:2,class:"tpl:flex tpl:flex-col tpl:gap-4"},Kz={class:"tpl:text-xs tpl:font-medium tpl:uppercase tpl:tracking-wider",style:{color:"var(--tpl-text-muted)"}},_z={key:0,class:"tpl:text-xs",style:{color:"var(--tpl-text-dim)"}},Gz={key:0,class:"tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs",style:{"background-color":"var(--tpl-danger-light)",color:"var(--tpl-danger)"}},Jz=["onClick"],Yz={class:"tpl:flex-1 tpl:text-xs tpl:font-medium",style:{color:"var(--tpl-text)"}},Xz={key:0,class:"tpl:text-[10px]",style:{color:"var(--tpl-text-dim)"}},Zz={key:0,class:"tpl:border-t",style:{"border-color":"var(--tpl-border)"}},Qz={key:0,class:"tpl:px-3 tpl:py-3 tpl:text-center tpl:text-xs",style:{color:"var(--tpl-text-dim)"}},qz={class:"tpl:flex tpl:items-start tpl:gap-2"},$z={class:"tpl:flex-1 tpl:min-w-0"},tP={class:"tpl:flex tpl:items-start tpl:gap-1.5"},eP={class:"tpl:text-xs tpl:leading-snug",style:{color:"var(--tpl-text)"}},nP={key:0,class:"tpl:mt-1 tpl:text-[11px] tpl:leading-snug",style:{color:"var(--tpl-text-dim)"}},oP={key:1,class:"tpl:mt-2 tpl:flex tpl:justify-center"},lP=["disabled","onClick"],sP={key:3,class:"tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"},rP={class:"tpl:max-w-[240px] tpl:text-sm",style:{color:"var(--tpl-text-muted)"}},aP={class:"tpl:m-0 tpl:px-4 tpl:pb-2 tpl:pt-2 tpl:text-center tpl:text-[11px]",style:{color:"var(--tpl-text-dim)"}},iP=Object.freeze(Object.defineProperty({__proto__:null,default:Re(l.defineComponent({__name:"TemplateScoringPanel",props:{visible:{type:Boolean}},emits:["close"],setup(n,{emit:t}){const e=n,o=t,s=l.inject("translations"),r=l.inject("editor"),a=l.inject("authManager"),i=l.inject("mergeTags",[]),c=ye.useTemplateScoring({authManager:a,getTemplateId:()=>{var b;return((b=r.state.template)==null?void 0:b.id)??null}}),d=l.ref({spam:!0,readability:!0,accessibility:!0,bestPractices:!0});function p(b){d.value[b]=!d.value[b]}const u=["spam","readability","accessibility","bestPractices"],f={spam:Vk,readability:Wc,accessibility:vl,bestPractices:Gk};function h(b){return b>=80?"var(--tpl-success)":b>=60?"var(--tpl-warning)":"var(--tpl-danger)"}function m(b){return b>=80?"var(--tpl-success-light)":b>=60?"var(--tpl-warning-light)":"var(--tpl-danger-light)"}function g(b){return b==="high"?"var(--tpl-danger)":b==="medium"?"var(--tpl-warning)":"var(--tpl-text-muted)"}function v(b){return b==="high"?"var(--tpl-danger-light)":b==="medium"?"var(--tpl-warning-light)":"var(--tpl-bg-hover)"}function y(){c.score(r.content.value,i)}l.watch(()=>e.visible,b=>{b&&!c.scoringResult.value&&!c.isScoring.value&&y()});async function k(b){if(!b.blockId)return;const w=r.content.value.blocks.find(B=>B.id===b.blockId);if(!w)return;const x=w.content;if(!x)return;const E=await c.fixFinding(x,b,i);E&&(r.updateBlock(b.blockId,{content:E}),c.removeFinding(b.category,b.id))}function S(){return c.scoringResult.value?u.reduce((b,w)=>{var x,E;return b+(((E=(x=c.scoringResult.value)==null?void 0:x.categories[w])==null?void 0:E.findings.length)??0)},0):0}return(b,w)=>(l.openBlock(),l.createBlock(l.Transition,{"enter-active-class":"tpl-scoring-slide-enter-active","enter-from-class":"tpl:translate-x-full","enter-to-class":"tpl:translate-x-0","leave-active-class":"tpl-scoring-slide-leave-active","leave-from-class":"tpl:translate-x-0","leave-to-class":"tpl:translate-x-full"},{default:l.withCtx(()=>[n.visible?(l.openBlock(),l.createElementBlock("div",Az,[l.createElementVNode("div",Iz,[l.createElementVNode("div",Rz,[l.createVNode(l.unref(Xc),{size:13,"stroke-width":2}),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).scoring.title),1)]),l.createElementVNode("div",zz,[l.unref(c).scoringResult.value&&!l.unref(c).isScoring.value?(l.openBlock(),l.createElementBlock("button",{key:0,class:"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",style:{color:"var(--tpl-text-muted)"},title:l.unref(s).scoring.rescore,onClick:w[0]||(w[0]=x=>y())},[l.createVNode(l.unref(Yc),{size:14,"stroke-width":2})],8,Pz)):l.createCommentVNode("",!0),l.createElementVNode("button",{class:"tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",style:{color:"var(--tpl-text-muted)"},onClick:w[1]||(w[1]=x=>o("close"))},[l.createVNode(l.unref(hn),{size:14,"stroke-width":2})])])]),l.createElementVNode("div",Lz,[l.unref(c).isScoring.value?(l.openBlock(),l.createElementBlock("div",Fz,[l.createElementVNode("p",jz,l.toDisplayString(l.unref(s).scoring.scoring),1),l.createVNode(Wa,{class:"tpl:w-3/4"})])):l.unref(c).error.value&&!l.unref(c).scoringResult.value?(l.openBlock(),l.createElementBlock("div",Hz,[l.createVNode(l.unref(ml),{size:32,"stroke-width":1.5,style:{color:"var(--tpl-danger)"}}),l.createElementVNode("p",Uz,l.toDisplayString(l.unref(s).scoring.error),1),l.createElementVNode("button",{class:"tpl:mt-2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-text-muted)"},onClick:w[2]||(w[2]=x=>y())},[l.createVNode(l.unref(Yc),{size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).scoring.rescore),1)])])):l.unref(c).scoringResult.value?(l.openBlock(),l.createElementBlock("div",Wz,[l.createElementVNode("div",{class:"tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:p-5",style:l.normalizeStyle({backgroundColor:m(l.unref(c).scoringResult.value.score)})},[l.createElementVNode("span",{class:"tpl:text-4xl tpl:font-bold tpl:tabular-nums",style:l.normalizeStyle({color:h(l.unref(c).scoringResult.value.score)})},l.toDisplayString(l.unref(c).scoringResult.value.score),5),l.createElementVNode("span",Kz,l.toDisplayString(l.unref(s).scoring.overallScore),1),S()>0?(l.openBlock(),l.createElementBlock("span",_z,l.toDisplayString(S())+" "+l.toDisplayString(l.unref(s).scoring.findings),1)):l.createCommentVNode("",!0)],4),l.unref(c).fixError.value?(l.openBlock(),l.createElementBlock("div",Gz,[l.createVNode(l.unref(ml),{size:14,"stroke-width":2,class:"tpl:mt-0.5 tpl:shrink-0"}),l.createElementVNode("span",null,l.toDisplayString(l.unref(s).scoring.fixError),1)])):l.createCommentVNode("",!0),(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(u,x=>l.createElementVNode("div",{key:x,class:"tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:border",style:{"border-color":"var(--tpl-border)"}},[l.createElementVNode("button",{class:"tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-2.5 tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-colors tpl:duration-100",style:{"background-color":"var(--tpl-bg)"},onClick:E=>p(x)},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(f[x]),{size:14,"stroke-width":2,style:l.normalizeStyle({color:h(l.unref(c).scoringResult.value.categories[x].score)})},null,8,["style"])),l.createElementVNode("span",Yz,l.toDisplayString(l.unref(s).scoring.categories[x]),1),l.createElementVNode("span",{class:"tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-semibold tpl:tabular-nums",style:l.normalizeStyle({color:h(l.unref(c).scoringResult.value.categories[x].score),backgroundColor:m(l.unref(c).scoringResult.value.categories[x].score)})},l.toDisplayString(l.unref(c).scoringResult.value.categories[x].score),5),l.unref(c).scoringResult.value.categories[x].findings.length>0?(l.openBlock(),l.createElementBlock("span",Xz,l.toDisplayString(l.unref(c).scoringResult.value.categories[x].findings.length),1)):l.createCommentVNode("",!0),l.createVNode(l.unref(zo),{size:12,"stroke-width":2,class:l.normalizeClass(["tpl:transition-transform tpl:duration-200",d.value[x]?"tpl:rotate-0":"tpl:-rotate-90"]),style:{color:"var(--tpl-text-dim)"}},null,8,["class"])],8,Jz),d.value[x]?(l.openBlock(),l.createElementBlock("div",Zz,[l.unref(c).scoringResult.value.categories[x].findings.length===0?(l.openBlock(),l.createElementBlock("div",Qz,l.toDisplayString(l.unref(s).scoring.noFindings),1)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(c).scoringResult.value.categories[x].findings,E=>(l.openBlock(),l.createElementBlock("div",{key:E.id,class:"tpl:border-t tpl:px-3 tpl:py-2.5 first:tpl:border-t-0",style:{"border-color":"var(--tpl-border-light)"}},[l.createElementVNode("div",qz,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(E.severity==="high"?l.unref(ml):E.severity==="medium"?l.unref(Ef):l.unref(Kc)),{size:13,"stroke-width":2,class:"tpl:mt-0.5 tpl:shrink-0",style:l.normalizeStyle({color:g(E.severity)})},null,8,["style"])),l.createElementVNode("div",$z,[l.createElementVNode("div",tP,[l.createElementVNode("span",{class:"tpl:mt-0.5 tpl:shrink-0 tpl:rounded tpl:px-1 tpl:py-px tpl:text-[10px] tpl:font-medium tpl:leading-tight",style:l.normalizeStyle({color:g(E.severity),backgroundColor:v(E.severity)})},l.toDisplayString(l.unref(s).scoring.severity[E.severity]),5),l.createElementVNode("span",eP,l.toDisplayString(E.message),1)]),E.suggestion?(l.openBlock(),l.createElementBlock("p",nP,l.toDisplayString(E.suggestion),1)):l.createCommentVNode("",!0),E.blockId?(l.openBlock(),l.createElementBlock("div",oP,[l.createElementVNode("button",{class:"tpl-scoring-fix-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded tpl:border tpl:px-3 tpl:py-1.5 tpl:text-[11px] tpl:font-medium tpl:transition-all tpl:duration-150 tpl:disabled:opacity-50",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-primary)","background-color":"transparent"},disabled:l.unref(c).fixingFindingId.value!==null,onClick:B=>k(E)},[l.unref(c).fixingFindingId.value===E.id?(l.openBlock(),l.createBlock(l.unref(Kn),{key:0,class:"tpl-spinner",size:11,"stroke-width":2})):(l.openBlock(),l.createBlock(l.unref(vl),{key:1,size:11,"stroke-width":2})),l.createTextVNode(" "+l.toDisplayString(l.unref(c).fixingFindingId.value===E.id?l.unref(s).scoring.fixing:l.unref(s).scoring.fix),1)],8,lP)])):l.createCommentVNode("",!0)])])]))),128))])):l.createCommentVNode("",!0)])),64))])):(l.openBlock(),l.createElementBlock("div",sP,[l.createVNode(l.unref(Xc),{size:32,"stroke-width":1.5,style:{color:"var(--tpl-text-dim)"}}),l.createElementVNode("p",rP,l.toDisplayString(l.unref(s).scoring.emptyState),1)])),l.createElementVNode("p",aP,l.toDisplayString(l.unref(s).aiMenu.disclaimer),1)])])):l.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-3532ba3d"]])},Symbol.toStringTag,{value:"Module"})),cP={class:"tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",style:{"background-color":"var(--tpl-bg-elevated)","box-shadow":"var(--tpl-shadow-xl)"}},dP={class:"tpl:mb-4 tpl:text-sm tpl:font-semibold",style:{color:"var(--tpl-text)"}},pP={class:"tpl:mb-3"},uP={class:"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium",style:{color:"var(--tpl-text-muted)"}},fP=["value"],hP=["disabled"],mP=["value"],gP={key:0,class:"tpl:mb-3 tpl:text-xs",style:{color:"var(--tpl-danger)"}},vP={class:"tpl:flex tpl:justify-end tpl:gap-2"},yP=["disabled"],bP=["disabled"],kP={key:0,class:"tpl:flex tpl:items-center tpl:gap-1.5"},xP={key:1},wP=Object.freeze(Object.defineProperty({__proto__:null,default:l.defineComponent({__name:"TestEmailModal",props:{visible:{type:Boolean},allowedEmails:{},isSending:{type:Boolean},error:{}},emits:["send","close"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.ref("");l.watch(()=>e.visible,d=>{d&&(r.value=e.allowedEmails[0]??"")});function a(){!r.value||e.isSending||o("send",r.value)}function i(){e.isSending||o("close")}function c(d){d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),a()),d.key==="Escape"&&i()}return(d,p)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(l.Transition,{"enter-active-class":"tpl:transition tpl:duration-150","enter-from-class":"tpl:opacity-0","enter-to-class":"tpl:opacity-100","leave-active-class":"tpl:transition tpl:duration-100","leave-from-class":"tpl:opacity-100","leave-to-class":"tpl:opacity-0"},{default:l.withCtx(()=>[n.visible?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",style:{"background-color":"var(--tpl-overlay)","backdrop-filter":"blur(8px)","-webkit-backdrop-filter":"blur(8px)"},onClick:l.withModifiers(i,["self"]),onKeydown:c},[l.createElementVNode("div",cP,[l.createElementVNode("h3",dP,l.toDisplayString(l.unref(s).testEmail.title),1),l.createElementVNode("div",pP,[l.createElementVNode("label",uP,l.toDisplayString(l.unref(s).testEmail.recipientLabel),1),n.allowedEmails.length===1?(l.openBlock(),l.createElementBlock("input",{key:0,type:"text",value:r.value,disabled:"",class:"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:opacity-70 tpl:shadow-xs tpl:outline-none",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)",color:"var(--tpl-text)"}},null,8,fP)):l.withDirectives((l.openBlock(),l.createElementBlock("select",{key:1,"onUpdate:modelValue":p[0]||(p[0]=u=>r.value=u),class:"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)",color:"var(--tpl-text)"},disabled:n.isSending},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.allowedEmails,u=>(l.openBlock(),l.createElementBlock("option",{key:u,value:u},l.toDisplayString(u),9,mP))),128))],8,hP)),[[l.vModelSelect,r.value]])]),n.error?(l.openBlock(),l.createElementBlock("p",gP,l.toDisplayString(n.error),1)):l.createCommentVNode("",!0),l.createElementVNode("div",vP,[l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150",{"tpl:cursor-not-allowed tpl:opacity-50":n.isSending}]),style:{"border-color":"var(--tpl-border)",color:"var(--tpl-text)","background-color":"var(--tpl-bg)"},disabled:n.isSending,onClick:i},l.toDisplayString(l.unref(s).testEmail.cancel),11,yP),l.createElementVNode("button",{type:"button",class:"tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"},disabled:!r.value||n.isSending,onClick:a},[n.isSending?(l.openBlock(),l.createElementBlock("span",kP,[l.createVNode(l.unref(Kn),{class:"tpl:animate-spin",size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).testEmail.sending),1)])):(l.openBlock(),l.createElementBlock("span",xP,l.toDisplayString(l.unref(s).testEmail.send),1))],8,bP)])])],32)):l.createCommentVNode("",!0)]),_:1})]))}})},Symbol.toStringTag,{value:"Module"})),SP={class:"tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",style:{"background-color":"var(--tpl-bg-elevated)","box-shadow":"var(--tpl-shadow-xl)"}},EP={class:"tpl:mb-4 tpl:text-sm tpl:font-semibold",style:{color:"var(--tpl-text)"}},CP={class:"tpl:mb-3"},TP={class:"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium",style:{color:"var(--tpl-text-muted)"}},NP=["placeholder","disabled"],MP={class:"tpl:mb-3"},BP={class:"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium",style:{color:"var(--tpl-text-muted)"}},OP={class:"tpl:max-h-40 tpl:space-y-1 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:p-2",style:{"border-color":"var(--tpl-border)"}},DP=["checked","disabled","onChange"],VP={key:0,class:"tpl:mb-3 tpl:text-xs",style:{color:"var(--tpl-danger)"}},AP={class:"tpl:flex tpl:justify-end tpl:gap-2"},IP=["disabled"],RP=["disabled"],zP={key:0,class:"tpl:flex tpl:items-center tpl:gap-1.5"},PP={key:1},LP=Object.freeze(Object.defineProperty({__proto__:null,default:l.defineComponent({__name:"SaveModuleDialog",props:{visible:{type:Boolean},preSelectedBlockId:{}},emits:["close","saved"],setup(n,{emit:t}){const e=n,o=t,{t:s}=jt(),r=l.inject("editor"),a=l.inject("savedModulesHeadless"),i=l.ref(""),c=l.ref(new Set),d=l.ref(!1),p=l.ref(null),u=l.computed(()=>r.content.value.blocks);function f(k,S){const b=k.type;return`${s.blocks[b]??k.type} ${S+1}`}l.watch(()=>e.visible,k=>{k&&(i.value="",p.value=null,c.value=new Set(e.preSelectedBlockId?[e.preSelectedBlockId]:[]))});function h(k){const S=new Set(c.value);S.has(k)?S.delete(k):S.add(k),c.value=S}const m=l.computed(()=>i.value.trim().length>0&&c.value.size>0&&!d.value);async function g(){if(m.value){d.value=!0,p.value=null;try{const k=u.value.filter(S=>c.value.has(S.id));await a.createModule(i.value.trim(),k),o("saved"),o("close")}catch(k){p.value=k.message}finally{d.value=!1}}}function v(){d.value||o("close")}function y(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),g()),k.key==="Escape"&&v()}return(k,S)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(l.Transition,{"enter-active-class":"tpl:transition tpl:duration-150","enter-from-class":"tpl:opacity-0","enter-to-class":"tpl:opacity-100","leave-active-class":"tpl:transition tpl:duration-100","leave-from-class":"tpl:opacity-100","leave-to-class":"tpl:opacity-0"},{default:l.withCtx(()=>[n.visible?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",style:{"background-color":"var(--tpl-overlay)","backdrop-filter":"blur(8px)","-webkit-backdrop-filter":"blur(8px)"},onClick:l.withModifiers(v,["self"]),onKeydown:y},[l.createElementVNode("div",SP,[l.createElementVNode("h3",EP,l.toDisplayString(l.unref(s).modules.saveAsModule),1),l.createElementVNode("div",CP,[l.createElementVNode("label",TP,l.toDisplayString(l.unref(s).modules.moduleName),1),l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":S[0]||(S[0]=b=>i.value=b),type:"text",placeholder:l.unref(s).modules.moduleNamePlaceholder,class:"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)",color:"var(--tpl-text)"},disabled:d.value},null,8,NP),[[l.vModelText,i.value]])]),l.createElementVNode("div",MP,[l.createElementVNode("label",BP,l.toDisplayString(l.unref(s).modules.selectBlocks),1),l.createElementVNode("div",OP,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.value,(b,w)=>(l.openBlock(),l.createElementBlock("label",{key:b.id,class:"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-sm tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:transition-colors tpl:duration-100",style:l.normalizeStyle({color:"var(--tpl-text)",backgroundColor:c.value.has(b.id)?"var(--tpl-primary-light)":"transparent"})},[l.createElementVNode("input",{type:"checkbox",checked:c.value.has(b.id),class:"tpl:accent-[var(--tpl-primary)]",disabled:d.value,onChange:x=>h(b.id)},null,40,DP),l.createTextVNode(" "+l.toDisplayString(f(b,w)),1)],4))),128))])]),p.value?(l.openBlock(),l.createElementBlock("p",VP,l.toDisplayString(p.value),1)):l.createCommentVNode("",!0),l.createElementVNode("div",AP,[l.createElementVNode("button",{type:"button",class:l.normalizeClass(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150",{"tpl:cursor-not-allowed tpl:opacity-50":d.value}]),style:{"border-color":"var(--tpl-border)",color:"var(--tpl-text)","background-color":"var(--tpl-bg)"},disabled:d.value,onClick:v},l.toDisplayString(l.unref(s).modules.cancel),11,IP),l.createElementVNode("button",{type:"button",class:"tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"},disabled:!m.value,onClick:g},[d.value?(l.openBlock(),l.createElementBlock("span",zP,[l.createVNode(l.unref(Kn),{class:"tpl:animate-spin",size:12,"stroke-width":2}),l.createTextVNode(" "+l.toDisplayString(l.unref(s).modules.saving),1)])):(l.openBlock(),l.createElementBlock("span",PP,l.toDisplayString(l.unref(s).modules.save),1))],8,RP)])])],32)):l.createCommentVNode("",!0)]),_:1})]))}})},Symbol.toStringTag,{value:"Module"})),Vb={section:Uc,image:gl,text:Zc,button:Jc,divider:po,video:kf,social:Sa,menu:xa,table:Ea,spacer:_c,countdown:jk,html:Xs},FP={class:"tpl-scale-in tpl:mx-4 tpl:flex tpl:w-full tpl:max-w-[1000px] tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]",style:{"background-color":"var(--tpl-bg-elevated)","box-shadow":"var(--tpl-shadow-xl)","max-height":"90vh"}},jP={class:"tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4",style:{"border-color":"var(--tpl-border)"}},HP={class:"tpl:text-sm tpl:font-semibold",style:{color:"var(--tpl-text)"}},UP={class:"tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden"},WP={class:"tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden"},KP={class:"tpl:px-4 tpl:pt-4 tpl:pb-3"},_P={class:"tpl:relative"},GP=["placeholder"],JP={class:"tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4"},YP={key:0,class:"tpl:flex tpl:flex-col tpl:gap-1"},XP=["onClick"],ZP={class:"tpl:flex tpl:items-center tpl:gap-2"},QP={class:"tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold",style:{color:"var(--tpl-text)"}},qP={class:"tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",style:{"background-color":"var(--tpl-bg-hover)",color:"var(--tpl-text-muted)"}},$P={class:"tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1"},tL={key:0,class:"tpl:text-[10px]",style:{color:"var(--tpl-text-dim)"}},eL=["onClick"],nL=["title","onClick"],oL={key:1,class:"tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"},lL={class:"tpl:mt-2 tpl:text-xs",style:{color:"var(--tpl-text-dim)"}},sL={class:"tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l",style:{"border-color":"var(--tpl-border)"}},rL={key:0,class:"tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"},aL={class:"tpl:flex-1 tpl:overflow-y-auto tpl:p-4"},iL={key:1,class:"tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"},cL={class:"tpl:mt-2 tpl:text-center tpl:text-xs",style:{color:"var(--tpl-text-dim)"}},dL={class:"tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",style:{"border-color":"var(--tpl-border)"}},pL={class:"tpl:flex tpl:items-center tpl:gap-2"},uL={class:"tpl:shrink-0 tpl:text-xs",style:{color:"var(--tpl-text-dim)"}},fL=["value"],hL={class:"tpl:flex tpl:gap-2"},mL=["disabled"],gL=Object.freeze(Object.defineProperty({__proto__:null,default:l.defineComponent({__name:"ModuleBrowserModal",props:{visible:{type:Boolean}},emits:["close","insert"],setup(n,{emit:t}){const e=n,o=t,s=l.defineAsyncComponent(()=>Promise.resolve().then(()=>GL)),{t:r}=jt(),a=l.inject("savedModulesHeadless"),i=l.inject("editor"),c=l.ref(""),d=l.ref(null),p=l.ref(null),u=l.ref("end"),f=l.computed(()=>{const x=a.modules.value;if(!c.value)return x;const E=c.value.toLowerCase();return x.filter(B=>B.name.toLowerCase().includes(E))}),h=l.computed(()=>d.value?a.modules.value.find(x=>x.id===d.value)??null:null),m=l.computed(()=>{const x=[{value:"beginning",label:r.modules.insertAtBeginning}],E=i.content.value.blocks;for(let B=0;B<E.length;B++){const C=E[B],D=C.type,R=r.blocks[D]??C.type;x.push({value:C.id,label:r.modules.insertAfterBlock.replace("{block}",`${R} ${B+1}`)})}return x.push({value:"end",label:r.modules.insertAtEnd}),x}),g=l.computed(()=>{if(u.value==="end")return;if(u.value==="beginning")return 0;const E=i.content.value.blocks.findIndex(B=>B.id===u.value);if(E!==-1)return E+1});l.watch(()=>e.visible,x=>{if(x){c.value="",d.value=null,p.value=null;const E=i.state.selectedBlockId;if(E){const B=i.content.value.blocks.findIndex(C=>C.id===E);u.value=B!==-1?E:"end"}else u.value="end"}});function v(x){const E=[],B=new Set;for(const C of x.content)if(!B.has(C.type)&&Vb[C.type]&&(B.add(C.type),E.push({type:C.type,icon:Vb[C.type]})),E.length>=5)break;return E}function y(x){const E=new Set(x.content.map(B=>B.type));return Math.max(0,E.size-5)}async function k(x){try{await a.deleteModule(x),d.value===x&&(d.value=null)}finally{p.value=null}}function S(){h.value&&o("insert",h.value,g.value)}function b(){o("close")}function w(x){x.key==="Escape"&&b(),x.key==="Enter"&&h.value&&(x.preventDefault(),S())}return(x,E)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(l.Transition,{"enter-active-class":"tpl:transition tpl:duration-150","enter-from-class":"tpl:opacity-0","enter-to-class":"tpl:opacity-100","leave-active-class":"tpl:transition tpl:duration-100","leave-from-class":"tpl:opacity-100","leave-to-class":"tpl:opacity-0"},{default:l.withCtx(()=>[n.visible?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",style:{"background-color":"var(--tpl-overlay)","backdrop-filter":"blur(8px)","-webkit-backdrop-filter":"blur(8px)"},onClick:l.withModifiers(b,["self"]),onKeydown:w},[l.createElementVNode("div",FP,[l.createElementVNode("div",jP,[l.createElementVNode("h3",HP,l.toDisplayString(l.unref(r).modules.browse),1),l.createElementVNode("button",{class:"tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-1 tpl:transition-colors tpl:duration-100",style:{color:"var(--tpl-text-dim)"},onClick:b},[l.createVNode(l.unref(hn),{size:16,"stroke-width":2})])]),l.createElementVNode("div",UP,[l.createElementVNode("div",WP,[l.createElementVNode("div",KP,[l.createElementVNode("div",_P,[l.createVNode(l.unref(Ok),{size:14,"stroke-width":2,class:"tpl:pointer-events-none tpl:absolute tpl:left-3 tpl:top-1/2 tpl:-translate-y-1/2",style:{color:"var(--tpl-text-dim)"}}),l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":E[0]||(E[0]=B=>c.value=B),type:"text",placeholder:l.unref(r).modules.search,class:"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:pl-9 tpl:pr-3 tpl:text-sm tpl:outline-none",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)",color:"var(--tpl-text)"}},null,8,GP),[[l.vModelText,c.value]])])]),l.createElementVNode("div",JP,[f.value.length>0?(l.openBlock(),l.createElementBlock("div",YP,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.value,B=>(l.openBlock(),l.createElementBlock("div",{key:B.id,class:"tpl:group/card tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms]",style:l.normalizeStyle({borderColor:d.value===B.id?"var(--tpl-primary)":"var(--tpl-border)",backgroundColor:d.value===B.id?"var(--tpl-primary-light)":"transparent"}),onClick:C=>d.value=B.id},[l.createElementVNode("div",ZP,[l.createElementVNode("span",QP,l.toDisplayString(B.name),1),l.createElementVNode("span",qP,l.toDisplayString(l.unref(r).modules.blockCount.replace("{count}",String(B.content.length))),1)]),l.createElementVNode("div",$P,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(v(B),C=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(C.icon),{key:C.type,size:14,"stroke-width":1.5,style:{color:"var(--tpl-text-dim)"}}))),128)),y(B)>0?(l.openBlock(),l.createElementBlock("span",tL," +"+l.toDisplayString(y(B)),1)):l.createCommentVNode("",!0),p.value===B.id?(l.openBlock(),l.createElementBlock("button",{key:1,class:"tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-100",style:{"border-color":"var(--tpl-danger)",color:"var(--tpl-danger)","background-color":"transparent"},onClick:l.withModifiers(C=>k(B.id),["stop"])},l.toDisplayString(l.unref(r).modules.deleteConfirm),9,eL)):(l.openBlock(),l.createElementBlock("button",{key:2,class:"tpl-module-delete-btn tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:duration-100",style:{color:"var(--tpl-text-dim)"},title:l.unref(r).modules.delete,onClick:l.withModifiers(C=>p.value=B.id,["stop"])},[l.createVNode(l.unref(yl),{size:12,"stroke-width":1.5})],8,nL))])],12,XP))),128))])):(l.openBlock(),l.createElementBlock("div",oL,[l.createVNode(l.unref(Gc),{size:32,"stroke-width":1,style:{color:"var(--tpl-text-dim)"}}),l.createElementVNode("p",lL,l.toDisplayString(c.value?l.unref(r).modules.noModules:l.unref(r).modules.noModulesHint),1)]))])]),l.createElementVNode("div",sL,[h.value?(l.openBlock(),l.createElementBlock("div",rL,[l.createElementVNode("div",aL,[l.createVNode(l.unref(s),{blocks:h.value.content},null,8,["blocks"])])])):(l.openBlock(),l.createElementBlock("div",iL,[l.createVNode(l.unref(Gc),{size:32,"stroke-width":1,style:{color:"var(--tpl-text-dim)"}}),l.createElementVNode("p",cL,l.toDisplayString(l.unref(r).modules.selectToPreview),1)]))])]),l.createElementVNode("div",dL,[l.createElementVNode("div",pL,[l.createElementVNode("label",uL,l.toDisplayString(l.unref(r).modules.insertPosition),1),l.withDirectives(l.createElementVNode("select",{"onUpdate:modelValue":E[1]||(E[1]=B=>u.value=B),class:"tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none",style:{"border-color":"var(--tpl-border)","background-color":"var(--tpl-bg)",color:"var(--tpl-text)"}},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.value,B=>(l.openBlock(),l.createElementBlock("option",{key:B.value,value:B.value},l.toDisplayString(B.label),9,fL))),128))],512),[[l.vModelSelect,u.value]])]),l.createElementVNode("div",hL,[l.createElementVNode("button",{type:"button",class:"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150",style:{"border-color":"var(--tpl-border)",color:"var(--tpl-text)","background-color":"var(--tpl-bg)"},onClick:b},l.toDisplayString(l.unref(r).modules.close),1),l.createElementVNode("button",{type:"button",class:"tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",style:{"background-color":"var(--tpl-primary)",color:"var(--tpl-bg)"},disabled:!h.value,onClick:S},l.toDisplayString(l.unref(r).modules.insert),9,mL)])])])],32)):l.createCommentVNode("",!0)]),_:1})]))}})},Symbol.toStringTag,{value:"Module"})),vL=["disabled","title"],yL=["title"],bL={key:0,class:"tpl-scale-in tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:w-72 tpl:-translate-x-1/2 tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)]",style:{"background-color":"var(--tpl-bg-elevated)",border:"1px solid var(--tpl-border)","box-shadow":"var(--tpl-shadow-lg)","backdrop-filter":"blur(8px)","-webkit-backdrop-filter":"blur(8px)"}},kL={class:"tpl:border-b tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-semibold",style:{color:"var(--tpl-text)","border-color":"var(--tpl-border)"}},xL={key:0,class:"tpl:flex tpl:items-center tpl:justify-center tpl:py-8"},wL={key:1,class:"tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs",style:{color:"var(--tpl-text-muted)"}},SL={key:2,class:"tpl:max-h-64 tpl:overflow-y-auto"},EL=["disabled","onClick"],CL={class:"tpl:flex tpl:flex-col tpl:gap-0.5"},TL={class:"tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:font-medium",style:{color:"var(--tpl-text)"}},NL={key:0,class:"tpl:rounded tpl:px-1 tpl:py-0.5 tpl:text-[10px] tpl:font-normal",style:{"background-color":"var(--tpl-bg-active)",color:"var(--tpl-text-muted)"}},ML=["disabled","title"],BL=Object.freeze(Object.defineProperty({__proto__:null,default:l.defineComponent({__name:"SnapshotHistory",props:{snapshots:{},isLoading:{type:Boolean},isRestoring:{type:Boolean}},emits:["load","navigate"],setup(n,{emit:t}){const e=n,o=t,{t:s,format:r}=jt(),a=l.ref(!1),i=l.ref(null),c=l.ref(-1);l.watch(()=>e.snapshots.length,()=>{c.value=-1});const d=l.computed(()=>c.value>0&&e.snapshots.length>0&&!e.isRestoring),p=l.computed(()=>c.value<e.snapshots.length-1&&e.snapshots.length>0&&!e.isRestoring);function u(){d.value&&(c.value--,o("navigate",e.snapshots[c.value]))}function f(){p.value&&(c.value++,o("navigate",e.snapshots[c.value]))}function h(){a.value=!a.value,a.value&&e.snapshots.length===0&&o("load")}function m(v){const y=e.snapshots.findIndex(k=>k.id===v);y!==-1&&(c.value=y,o("navigate",e.snapshots[y])),a.value=!1}function g(v){const y=new Date(v),S=new Date().getTime()-y.getTime(),b=Math.floor(S/6e4),w=Math.floor(S/36e5),x=Math.floor(S/864e5);return b<1?s.snapshotHistory.justNow:b<60?r(s.snapshotHistory.minutesAgo,{minutes:b}):w<24?r(s.snapshotHistory.hoursAgo,{hours:w}):x<7?r(s.snapshotHistory.daysAgo,{days:x}):y.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}return Hc(i,()=>{a.value=!1}),(v,y)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"dropdownRef",ref:i,class:"tpl:relative tpl:flex tpl:items-center tpl:gap-0.5"},[l.createElementVNode("button",{class:"tpl:flex tpl:size-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] disabled:tpl:cursor-not-allowed disabled:tpl:opacity-30 disabled:hover:tpl:bg-transparent",style:{color:"var(--tpl-text-muted)"},disabled:!p.value,title:l.unref(s).snapshotHistory.olderSnapshot,onClick:l.withModifiers(f,["stop"])},[l.createVNode(l.unref(ck),{size:14,"stroke-width":2})],8,vL),l.createElementVNode("button",{class:"tpl:flex tpl:h-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-1.5 tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)]",style:{color:"var(--tpl-text-muted)"},title:l.unref(s).snapshotHistory.tooltip,onClick:l.withModifiers(h,["stop"])},[l.createVNode(l.unref(hf),{size:16,"stroke-width":1.5}),l.createVNode(l.unref(zo),{class:l.normalizeClass(["tpl:transition-transform tpl:duration-150",{"tpl:rotate-180":a.value}]),size:10,"stroke-width":2},null,8,["class"])],8,yL),l.createVNode(l.Transition,{name:"tpl-dropdown"},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createElementBlock("div",bL,[l.createElementVNode("div",kL,l.toDisplayString(l.unref(s).snapshotHistory.dropdownTitle),1),n.isLoading?(l.openBlock(),l.createElementBlock("div",xL,[l.createVNode(l.unref(Kn),{class:"tpl:animate-spin",size:20,"stroke-width":2,style:{color:"var(--tpl-primary)"}})])):n.snapshots.length===0?(l.openBlock(),l.createElementBlock("div",wL,l.toDisplayString(l.unref(s).snapshotHistory.noSnapshots),1)):(l.openBlock(),l.createElementBlock("div",SL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.snapshots,k=>(l.openBlock(),l.createElementBlock("button",{key:k.id,class:"tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:border-b tpl:border-l-2 tpl:border-l-transparent tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-all tpl:duration-150 last:tpl:border-b-0 hover:tpl:border-l-[var(--tpl-primary)] hover:tpl:bg-[var(--tpl-bg-hover)]",style:{"background-color":"transparent","border-bottom-color":"var(--tpl-border-light)"},disabled:n.isRestoring,onClick:S=>m(k.id)},[l.createElementVNode("div",CL,[l.createElementVNode("div",TL,[l.createElementVNode("span",null,l.toDisplayString(g(k.created_at)),1),k.is_autosave?(l.openBlock(),l.createElementBlock("span",NL,l.toDisplayString(l.unref(s).snapshotHistory.auto),1)):l.createCommentVNode("",!0)])])],8,EL))),128))]))])):l.createCommentVNode("",!0)]),_:1}),l.createElementVNode("button",{class:"tpl:flex tpl:size-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] disabled:tpl:cursor-not-allowed disabled:tpl:opacity-30 disabled:hover:tpl:bg-transparent",style:{color:"var(--tpl-text-muted)"},disabled:!d.value,title:l.unref(s).snapshotHistory.newerSnapshot,onClick:l.withModifiers(u,["stop"])},[l.createVNode(l.unref(dk),{size:14,"stroke-width":2})],8,ML)],512))}})},Symbol.toStringTag,{value:"Module"})),OL={class:"tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2"},DL=["title"],VL={key:0,class:"tpl:flex tpl:items-center tpl:-space-x-1.5"},AL=["title"],IL=["title"],Ab=3,RL=Object.freeze(Object.defineProperty({__proto__:null,default:l.defineComponent({__name:"CollaboratorBar",props:{collaborators:{},isConnected:{type:Boolean}},setup(n){const t=n,{t:e}=jt(),o=l.computed(()=>t.collaborators.slice(0,Ab)),s=l.computed(()=>t.collaborators.slice(Ab)),r=l.computed(()=>s.value.length),a=l.computed(()=>s.value.map(c=>c.name).join(`
600
+ `));function i(c){const d=c.trim().split(/\s+/);return d.length>=2?(d[0].charAt(0)+d[d.length-1].charAt(0)).toUpperCase():c.charAt(0).toUpperCase()}return(c,d)=>(l.openBlock(),l.createElementBlock("div",OL,[l.createElementVNode("div",{class:"tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]",style:l.normalizeStyle({color:n.isConnected?"var(--tpl-success)":"var(--tpl-text-muted)"}),title:n.isConnected?l.unref(e).collaboration.connected:l.unref(e).collaboration.disconnected},[n.isConnected?(l.openBlock(),l.createBlock(l.unref(_k),{key:0,size:12,"stroke-width":2})):(l.openBlock(),l.createBlock(l.unref(Kk),{key:1,size:12,"stroke-width":2}))],12,DL),n.collaborators.length>0?(l.openBlock(),l.createElementBlock("div",VL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,p=>(l.openBlock(),l.createElementBlock("div",{key:p.id,class:"tpl-collaborator-avatar tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[10px] tpl:font-bold tpl:text-white tpl:transition-transform tpl:duration-150 tpl:hover:z-10 tpl:hover:scale-110",style:l.normalizeStyle([{"border-color":"var(--tpl-bg)"},{backgroundColor:p.color}]),title:p.name},l.toDisplayString(i(p.name)),13,AL))),128)),r.value>0?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[9px] tpl:font-bold",style:{"border-color":"var(--tpl-bg)","background-color":"var(--tpl-bg-hover)",color:"var(--tpl-text-muted)"},title:a.value}," +"+l.toDisplayString(r.value),9,IL)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]))}})},Symbol.toStringTag,{value:"Module"})),zL={class:"tpl-ai-feature-menu tpl:w-[280px] tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:py-1",style:{"background-color":"var(--tpl-bg-elevated)",border:"1px solid var(--tpl-border)","box-shadow":"var(--tpl-shadow-lg)","backdrop-filter":"blur(8px)","-webkit-backdrop-filter":"blur(8px)"}},PL=["onClick"],LL={class:"tpl:flex tpl:min-w-0 tpl:flex-col tpl:gap-0.5"},FL={class:"tpl:text-sm tpl:font-medium",style:{color:"var(--tpl-text)"}},jL={class:"tpl:text-xs tpl:leading-snug",style:{color:"var(--tpl-text-muted)"}},HL=Object.freeze(Object.defineProperty({__proto__:null,default:Re(l.defineComponent({__name:"AiFeatureMenu",props:{activeFeature:{}},emits:["select"],setup(n,{emit:t}){const e=t,{t:o}=jt(),s=l.inject("aiConfig"),r={"ai-chat":"chat","design-reference":"designToTemplate",scoring:"scoring"},a=[{key:"ai-chat",icon:vl},{key:"design-reference",icon:ba},{key:"scoring",icon:Xc}],i=l.computed(()=>a.filter(p=>s.isFeatureEnabled(r[p.key])));function c(p){return p==="ai-chat"?o.aiMenu.aiAssistant:p==="design-reference"?o.aiMenu.designToTemplate:o.aiMenu.templateScore}function d(p){return p==="ai-chat"?o.aiMenu.aiAssistantDesc:p==="design-reference"?o.aiMenu.designToTemplateDesc:o.aiMenu.templateScoreDesc}return(p,u)=>(l.openBlock(),l.createElementBlock("div",zL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,f=>(l.openBlock(),l.createElementBlock("button",{key:f.key,class:"tpl-ai-feature-menu-item tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-start tpl:gap-3 tpl:border-none tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-colors tpl:duration-100",style:l.normalizeStyle({backgroundColor:n.activeFeature===f.key?"var(--tpl-primary-light)":"transparent"}),onClick:h=>e("select",f.key)},[l.createElementVNode("div",{class:"tpl:mt-0.5 tpl:flex tpl:size-7 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)]",style:l.normalizeStyle({backgroundColor:n.activeFeature===f.key?"var(--tpl-primary)":"var(--tpl-bg-active)",color:n.activeFeature===f.key?"white":"var(--tpl-text-muted)"})},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(f.icon),{size:15,"stroke-width":2}))],4),l.createElementVNode("div",LL,[l.createElementVNode("span",FL,l.toDisplayString(c(f.key)),1),l.createElementVNode("span",jL,l.toDisplayString(d(f.key)),1)])],12,PL))),128))]))}}),[["__scopeId","data-v-5200b3b6"]])},Symbol.toStringTag,{value:"Module"})),UL={class:"tpl:w-full"},WL={class:"tpl:flex tpl:gap-0"},KL=l.defineComponent({name:"PreviewSectionBlock",__name:"PreviewSectionBlock",props:{block:{},viewport:{}},setup(n){const t=n,e=l.inject("blockRegistry"),o=l.computed(()=>{switch(t.block.columns){case"2":return["50%","50%"];case"3":return["33.33%","33.33%","33.33%"];case"1-2":return["33.33%","66.67%"];case"2-1":return["66.67%","33.33%"];default:return["100%"]}}),s=l.computed(()=>{const c=o.value.length,d=[...t.block.children];for(;d.length<c;)d.push([]);return d.slice(0,c)});function r(c){return s.value[c]||[]}function a(c){if(e){const d=e.getComponent(c);if(d)return d}switch(c.type){case"text":return hr;case"image":return fr;case"video":return Xa;case"button":return pr;case"divider":return ur;case"social":return Ga;case"menu":return Ja;case"table":return Ya;case"spacer":return Ka;case"html":return _a;case"custom":return ss;default:return null}}function i(c){const{padding:d,margin:p,backgroundColor:u}=c.styles;return{padding:`${d.top}px ${d.right}px ${d.bottom}px ${d.left}px`,margin:`${p.top}px ${p.right}px ${p.bottom}px ${p.left}px`,backgroundColor:u||"transparent"}}return(c,d)=>{const p=l.resolveComponent("PreviewSectionBlock",!0);return l.openBlock(),l.createElementBlock("div",UL,[l.createElementVNode("div",WL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.value,(u,f)=>(l.openBlock(),l.createElementBlock("div",{key:f,style:l.normalizeStyle({width:o.value[f]})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r(f),h=>(l.openBlock(),l.createElementBlock("div",{key:h.id,style:l.normalizeStyle(i(h))},[h.type==="section"?(l.openBlock(),l.createBlock(p,{key:0,block:h,viewport:"desktop"},null,8,["block"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(a(h)),{key:1,block:h,viewport:"desktop"},null,8,["block"]))],4))),128))],4))),128))])])}}}),_L={class:"tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg tpl:bg-white",style:{"box-shadow":"var(--tpl-shadow-sm)"}},GL=Object.freeze(Object.defineProperty({__proto__:null,default:l.defineComponent({__name:"ModulePreviewCanvas",props:{blocks:{}},setup(n){const t=l.inject("blockRegistry");function e(s){if(t){const r=t.getComponent(s);if(r)return r}switch(s.type){case"section":return KL;case"text":return hr;case"image":return fr;case"video":return Xa;case"button":return pr;case"divider":return ur;case"social":return Ga;case"menu":return Ja;case"table":return Ya;case"spacer":return Ka;case"html":return _a;case"custom":return ss;default:return null}}function o(s){const{padding:r,margin:a,backgroundColor:i}=s.styles;return{padding:`${r.top}px ${r.right}px ${r.bottom}px ${r.left}px`,margin:`${a.top}px ${a.right}px ${a.bottom}px ${a.left}px`,backgroundColor:i||"transparent"}}return(s,r)=>(l.openBlock(),l.createElementBlock("div",_L,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.blocks,a=>(l.openBlock(),l.createElementBlock("div",{key:a.id,style:l.normalizeStyle(o(a))},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e(a)),{block:a,viewport:"desktop"},null,8,["block"]))],4))),128))]))}})},Symbol.toStringTag,{value:"Module"}));ln.init=w3,ln.initCloud=S3,ln.unmount=Nd,ln.useFonts=bd,Object.defineProperty(ln,Symbol.toStringTag,{value:"Module"})}));