@verbb/formie-web-components 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/index.js +1454 -1406
- package/dist/signature_pad-CKGlHEaq.js +464 -0
- package/package.json +4 -4
- package/dist/index.js.map +0 -1
- package/dist/signature_pad-69C-Dgt3.js +0 -391
- package/dist/signature_pad-69C-Dgt3.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,993 +1,968 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (typeof e == "number") return e;
|
|
23
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " + e + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
24
|
-
})(n) + e[r + 1], e[0]), e, g), oe = (e, t) => {
|
|
25
|
-
if (h) e.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
26
|
-
else for (let n of t) {
|
|
27
|
-
let t = document.createElement("style"), r = m.litNonce;
|
|
28
|
-
r !== void 0 && t.setAttribute("nonce", r), t.textContent = n.cssText, e.appendChild(t);
|
|
29
|
-
}
|
|
30
|
-
}, se = h ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((e) => {
|
|
31
|
-
let t = "";
|
|
32
|
-
for (let n of e.cssRules) t += n.cssText;
|
|
33
|
-
return ie(t);
|
|
34
|
-
})(e) : e, { is: ce, defineProperty: le, getOwnPropertyDescriptor: ue, getOwnPropertyNames: de, getOwnPropertySymbols: fe, getPrototypeOf: pe } = Object, _ = globalThis, me = _.trustedTypes, he = me ? me.emptyScript : "", ge = _.reactiveElementPolyfillSupport, v = (e, t) => e, y = {
|
|
35
|
-
toAttribute(e, t) {
|
|
36
|
-
switch (t) {
|
|
37
|
-
case Boolean:
|
|
38
|
-
e = e ? he : null;
|
|
39
|
-
break;
|
|
40
|
-
case Object:
|
|
41
|
-
case Array: e = e == null ? e : JSON.stringify(e);
|
|
42
|
-
}
|
|
43
|
-
return e;
|
|
44
|
-
},
|
|
45
|
-
fromAttribute(e, t) {
|
|
46
|
-
let n = e;
|
|
47
|
-
switch (t) {
|
|
48
|
-
case Boolean:
|
|
49
|
-
n = e !== null;
|
|
50
|
-
break;
|
|
51
|
-
case Number:
|
|
52
|
-
n = e === null ? null : Number(e);
|
|
53
|
-
break;
|
|
54
|
-
case Object:
|
|
55
|
-
case Array: try {
|
|
56
|
-
n = JSON.parse(e);
|
|
57
|
-
} catch {
|
|
58
|
-
n = null;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return n;
|
|
62
|
-
}
|
|
63
|
-
}, b = (e, t) => !ce(e, t), _e = {
|
|
64
|
-
attribute: !0,
|
|
65
|
-
type: String,
|
|
66
|
-
converter: y,
|
|
67
|
-
reflect: !1,
|
|
68
|
-
useDefault: !1,
|
|
69
|
-
hasChanged: b
|
|
1
|
+
import { isKnownFrontendFieldType as xt, isCompositeField as Wt, isRepeatableField as qt, isFileField as Gt, compositePartDefinitions as Bt, repeaterRowDefinitions as Kt, createRepeaterRowValue as Zt, loadGraphqlFrontendEnvelope as Jt, loadFrontendEnvelope as Qt, createGraphqlFrontendTransport as Xt, createRestFrontendTransport as Yt, createFrontendFormInstance as te, FRONTEND_CLIENT_EVENT_NAMES as ee } from "@verbb/formie-core";
|
|
2
|
+
import { createFormieClient as se, FORMIE_HTML_EVENT_NAMES as ie } from "@verbb/formie-browser";
|
|
3
|
+
import { createFormieClient as gs } from "@verbb/formie-browser";
|
|
4
|
+
const F = globalThis, et = F.ShadowRoot && (F.ShadyCSS === void 0 || F.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, st = /* @__PURE__ */ Symbol(), ut = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
let Rt = class {
|
|
6
|
+
constructor(t, e, i) {
|
|
7
|
+
if (this._$cssResult$ = !0, i !== st) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
8
|
+
this.cssText = t, this.t = e;
|
|
9
|
+
}
|
|
10
|
+
get styleSheet() {
|
|
11
|
+
let t = this.o;
|
|
12
|
+
const e = this.t;
|
|
13
|
+
if (et && t === void 0) {
|
|
14
|
+
const i = e !== void 0 && e.length === 1;
|
|
15
|
+
i && (t = ut.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && ut.set(e, t));
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
toString() {
|
|
20
|
+
return this.cssText;
|
|
21
|
+
}
|
|
70
22
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
23
|
+
const re = (s) => new Rt(typeof s == "string" ? s : s + "", void 0, st), ne = (s, ...t) => {
|
|
24
|
+
const e = s.length === 1 ? s[0] : t.reduce((i, r, n) => i + ((o) => {
|
|
25
|
+
if (o._$cssResult$ === !0) return o.cssText;
|
|
26
|
+
if (typeof o == "number") return o;
|
|
27
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
28
|
+
})(r) + s[n + 1], s[0]);
|
|
29
|
+
return new Rt(e, s, st);
|
|
30
|
+
}, oe = (s, t) => {
|
|
31
|
+
if (et) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
32
|
+
else for (const e of t) {
|
|
33
|
+
const i = document.createElement("style"), r = F.litNonce;
|
|
34
|
+
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
|
|
35
|
+
}
|
|
36
|
+
}, pt = et ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
|
|
37
|
+
let e = "";
|
|
38
|
+
for (const i of t.cssRules) e += i.cssText;
|
|
39
|
+
return re(e);
|
|
40
|
+
})(s) : s;
|
|
41
|
+
const { is: ae, defineProperty: le, getOwnPropertyDescriptor: de, getOwnPropertyNames: he, getOwnPropertySymbols: ce, getPrototypeOf: ue } = Object, G = globalThis, ft = G.trustedTypes, pe = ft ? ft.emptyScript : "", fe = G.reactiveElementPolyfillSupport, U = (s, t) => s, j = { toAttribute(s, t) {
|
|
42
|
+
switch (t) {
|
|
43
|
+
case Boolean:
|
|
44
|
+
s = s ? pe : null;
|
|
45
|
+
break;
|
|
46
|
+
case Object:
|
|
47
|
+
case Array:
|
|
48
|
+
s = s == null ? s : JSON.stringify(s);
|
|
49
|
+
}
|
|
50
|
+
return s;
|
|
51
|
+
}, fromAttribute(s, t) {
|
|
52
|
+
let e = s;
|
|
53
|
+
switch (t) {
|
|
54
|
+
case Boolean:
|
|
55
|
+
e = s !== null;
|
|
56
|
+
break;
|
|
57
|
+
case Number:
|
|
58
|
+
e = s === null ? null : Number(s);
|
|
59
|
+
break;
|
|
60
|
+
case Object:
|
|
61
|
+
case Array:
|
|
62
|
+
try {
|
|
63
|
+
e = JSON.parse(s);
|
|
64
|
+
} catch {
|
|
65
|
+
e = null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return e;
|
|
69
|
+
} }, it = (s, t) => !ae(s, t), mt = { attribute: !0, type: String, converter: j, reflect: !1, useDefault: !1, hasChanged: it };
|
|
70
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), G.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
71
|
+
let R = class extends HTMLElement {
|
|
72
|
+
static addInitializer(t) {
|
|
73
|
+
this._$Ei(), (this.l ??= []).push(t);
|
|
74
|
+
}
|
|
75
|
+
static get observedAttributes() {
|
|
76
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
77
|
+
}
|
|
78
|
+
static createProperty(t, e = mt) {
|
|
79
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
80
|
+
const i = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, i, e);
|
|
81
|
+
r !== void 0 && le(this.prototype, t, r);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
static getPropertyDescriptor(t, e, i) {
|
|
85
|
+
const { get: r, set: n } = de(this.prototype, t) ?? { get() {
|
|
86
|
+
return this[e];
|
|
87
|
+
}, set(o) {
|
|
88
|
+
this[e] = o;
|
|
89
|
+
} };
|
|
90
|
+
return { get: r, set(o) {
|
|
91
|
+
const l = r?.call(this);
|
|
92
|
+
n?.call(this, o), this.requestUpdate(t, l, i);
|
|
93
|
+
}, configurable: !0, enumerable: !0 };
|
|
94
|
+
}
|
|
95
|
+
static getPropertyOptions(t) {
|
|
96
|
+
return this.elementProperties.get(t) ?? mt;
|
|
97
|
+
}
|
|
98
|
+
static _$Ei() {
|
|
99
|
+
if (this.hasOwnProperty(U("elementProperties"))) return;
|
|
100
|
+
const t = ue(this);
|
|
101
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
102
|
+
}
|
|
103
|
+
static finalize() {
|
|
104
|
+
if (this.hasOwnProperty(U("finalized"))) return;
|
|
105
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(U("properties"))) {
|
|
106
|
+
const e = this.properties, i = [...he(e), ...ce(e)];
|
|
107
|
+
for (const r of i) this.createProperty(r, e[r]);
|
|
108
|
+
}
|
|
109
|
+
const t = this[Symbol.metadata];
|
|
110
|
+
if (t !== null) {
|
|
111
|
+
const e = litPropertyMetadata.get(t);
|
|
112
|
+
if (e !== void 0) for (const [i, r] of e) this.elementProperties.set(i, r);
|
|
113
|
+
}
|
|
114
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
115
|
+
for (const [e, i] of this.elementProperties) {
|
|
116
|
+
const r = this._$Eu(e, i);
|
|
117
|
+
r !== void 0 && this._$Eh.set(r, e);
|
|
118
|
+
}
|
|
119
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
120
|
+
}
|
|
121
|
+
static finalizeStyles(t) {
|
|
122
|
+
const e = [];
|
|
123
|
+
if (Array.isArray(t)) {
|
|
124
|
+
const i = new Set(t.flat(1 / 0).reverse());
|
|
125
|
+
for (const r of i) e.unshift(pt(r));
|
|
126
|
+
} else t !== void 0 && e.push(pt(t));
|
|
127
|
+
return e;
|
|
128
|
+
}
|
|
129
|
+
static _$Eu(t, e) {
|
|
130
|
+
const i = e.attribute;
|
|
131
|
+
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
132
|
+
}
|
|
133
|
+
constructor() {
|
|
134
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
135
|
+
}
|
|
136
|
+
_$Ev() {
|
|
137
|
+
this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
|
|
138
|
+
}
|
|
139
|
+
addController(t) {
|
|
140
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
|
|
141
|
+
}
|
|
142
|
+
removeController(t) {
|
|
143
|
+
this._$EO?.delete(t);
|
|
144
|
+
}
|
|
145
|
+
_$E_() {
|
|
146
|
+
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
147
|
+
for (const i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
148
|
+
t.size > 0 && (this._$Ep = t);
|
|
149
|
+
}
|
|
150
|
+
createRenderRoot() {
|
|
151
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
152
|
+
return oe(t, this.constructor.elementStyles), t;
|
|
153
|
+
}
|
|
154
|
+
connectedCallback() {
|
|
155
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
156
|
+
}
|
|
157
|
+
enableUpdating(t) {
|
|
158
|
+
}
|
|
159
|
+
disconnectedCallback() {
|
|
160
|
+
this._$EO?.forEach((t) => t.hostDisconnected?.());
|
|
161
|
+
}
|
|
162
|
+
attributeChangedCallback(t, e, i) {
|
|
163
|
+
this._$AK(t, i);
|
|
164
|
+
}
|
|
165
|
+
_$ET(t, e) {
|
|
166
|
+
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
|
|
167
|
+
if (r !== void 0 && i.reflect === !0) {
|
|
168
|
+
const n = (i.converter?.toAttribute !== void 0 ? i.converter : j).toAttribute(e, i.type);
|
|
169
|
+
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
_$AK(t, e) {
|
|
173
|
+
const i = this.constructor, r = i._$Eh.get(t);
|
|
174
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
175
|
+
const n = i.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : j;
|
|
176
|
+
this._$Em = r;
|
|
177
|
+
const l = o.fromAttribute(e, n.type);
|
|
178
|
+
this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
requestUpdate(t, e, i, r = !1, n) {
|
|
182
|
+
if (t !== void 0) {
|
|
183
|
+
const o = this.constructor;
|
|
184
|
+
if (r === !1 && (n = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ?? it)(n, e) || i.useDefault && i.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, i)))) return;
|
|
185
|
+
this.C(t, e, i);
|
|
186
|
+
}
|
|
187
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
188
|
+
}
|
|
189
|
+
C(t, e, { useDefault: i, reflect: r, wrapped: n }, o) {
|
|
190
|
+
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
191
|
+
}
|
|
192
|
+
async _$EP() {
|
|
193
|
+
this.isUpdatePending = !0;
|
|
194
|
+
try {
|
|
195
|
+
await this._$ES;
|
|
196
|
+
} catch (e) {
|
|
197
|
+
Promise.reject(e);
|
|
198
|
+
}
|
|
199
|
+
const t = this.scheduleUpdate();
|
|
200
|
+
return t != null && await t, !this.isUpdatePending;
|
|
201
|
+
}
|
|
202
|
+
scheduleUpdate() {
|
|
203
|
+
return this.performUpdate();
|
|
204
|
+
}
|
|
205
|
+
performUpdate() {
|
|
206
|
+
if (!this.isUpdatePending) return;
|
|
207
|
+
if (!this.hasUpdated) {
|
|
208
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
209
|
+
for (const [r, n] of this._$Ep) this[r] = n;
|
|
210
|
+
this._$Ep = void 0;
|
|
211
|
+
}
|
|
212
|
+
const i = this.constructor.elementProperties;
|
|
213
|
+
if (i.size > 0) for (const [r, n] of i) {
|
|
214
|
+
const { wrapped: o } = n, l = this[r];
|
|
215
|
+
o !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, n, l);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
let t = !1;
|
|
219
|
+
const e = this._$AL;
|
|
220
|
+
try {
|
|
221
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(e)) : this._$EM();
|
|
222
|
+
} catch (i) {
|
|
223
|
+
throw t = !1, this._$EM(), i;
|
|
224
|
+
}
|
|
225
|
+
t && this._$AE(e);
|
|
226
|
+
}
|
|
227
|
+
willUpdate(t) {
|
|
228
|
+
}
|
|
229
|
+
_$AE(t) {
|
|
230
|
+
this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
231
|
+
}
|
|
232
|
+
_$EM() {
|
|
233
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
234
|
+
}
|
|
235
|
+
get updateComplete() {
|
|
236
|
+
return this.getUpdateComplete();
|
|
237
|
+
}
|
|
238
|
+
getUpdateComplete() {
|
|
239
|
+
return this._$ES;
|
|
240
|
+
}
|
|
241
|
+
shouldUpdate(t) {
|
|
242
|
+
return !0;
|
|
243
|
+
}
|
|
244
|
+
update(t) {
|
|
245
|
+
this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM();
|
|
246
|
+
}
|
|
247
|
+
updated(t) {
|
|
248
|
+
}
|
|
249
|
+
firstUpdated(t) {
|
|
250
|
+
}
|
|
255
251
|
};
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}))(1), M = Symbol.for("lit-noChange"), N = Symbol.for("lit-nothing"), Ae = /* @__PURE__ */ new WeakMap(), P = w.createTreeWalker(w, 129);
|
|
264
|
-
function je(e, t) {
|
|
265
|
-
if (!D(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
266
|
-
return be === void 0 ? t : be.createHTML(t);
|
|
252
|
+
R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[U("elementProperties")] = /* @__PURE__ */ new Map(), R[U("finalized")] = /* @__PURE__ */ new Map(), fe?.({ ReactiveElement: R }), (G.reactiveElementVersions ??= []).push("2.1.2");
|
|
253
|
+
const rt = globalThis, $t = (s) => s, W = rt.trustedTypes, gt = W ? W.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, Mt = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, Tt = "?" + _, me = `<${Tt}>`, C = document, H = () => C.createComment(""), I = (s) => s === null || typeof s != "object" && typeof s != "function", nt = Array.isArray, $e = (s) => nt(s) || typeof s?.[Symbol.iterator] == "function", J = `[
|
|
254
|
+
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, bt = /-->/g, vt = />/g, E = RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^
|
|
255
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), yt = /'/g, _t = /"/g, kt = /^(?:script|style|textarea|title)$/i, ge = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), h = ge(1), w = /* @__PURE__ */ Symbol.for("lit-noChange"), p = /* @__PURE__ */ Symbol.for("lit-nothing"), At = /* @__PURE__ */ new WeakMap(), S = C.createTreeWalker(C, 129);
|
|
256
|
+
function Ut(s, t) {
|
|
257
|
+
if (!nt(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
258
|
+
return gt !== void 0 ? gt.createHTML(t) : t;
|
|
267
259
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
let i;
|
|
280
|
-
this.parts = [];
|
|
281
|
-
let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] = Me(t, n);
|
|
282
|
-
if (this.el = e.createElement(l, r), P.currentNode = this.el.content, n === 2 || n === 3) {
|
|
283
|
-
let e = this.el.content.firstChild;
|
|
284
|
-
e.replaceWith(...e.childNodes);
|
|
285
|
-
}
|
|
286
|
-
for (; (i = P.nextNode()) !== null && c.length < s;) {
|
|
287
|
-
if (i.nodeType === 1) {
|
|
288
|
-
if (i.hasAttributes()) for (let e of i.getAttributeNames()) if (e.endsWith(xe)) {
|
|
289
|
-
let t = u[o++], n = i.getAttribute(e).split(C), r = /([.?@])?(.*)/.exec(t);
|
|
290
|
-
c.push({
|
|
291
|
-
type: 1,
|
|
292
|
-
index: a,
|
|
293
|
-
name: r[2],
|
|
294
|
-
strings: n,
|
|
295
|
-
ctor: r[1] === "." ? Pe : r[1] === "?" ? Fe : r[1] === "@" ? Ie : R
|
|
296
|
-
}), i.removeAttribute(e);
|
|
297
|
-
} else e.startsWith(C) && (c.push({
|
|
298
|
-
type: 6,
|
|
299
|
-
index: a
|
|
300
|
-
}), i.removeAttribute(e));
|
|
301
|
-
if (ke.test(i.tagName)) {
|
|
302
|
-
let e = i.textContent.split(C), t = e.length - 1;
|
|
303
|
-
if (t > 0) {
|
|
304
|
-
i.textContent = S ? S.emptyScript : "";
|
|
305
|
-
for (let n = 0; n < t; n++) i.append(e[n], T()), P.nextNode(), c.push({
|
|
306
|
-
type: 2,
|
|
307
|
-
index: ++a
|
|
308
|
-
});
|
|
309
|
-
i.append(e[t], T());
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
} else if (i.nodeType === 8) if (i.data === Se) c.push({
|
|
313
|
-
type: 2,
|
|
314
|
-
index: a
|
|
315
|
-
});
|
|
316
|
-
else {
|
|
317
|
-
let e = -1;
|
|
318
|
-
for (; (e = i.data.indexOf(C, e + 1)) !== -1;) c.push({
|
|
319
|
-
type: 7,
|
|
320
|
-
index: a
|
|
321
|
-
}), e += C.length - 1;
|
|
322
|
-
}
|
|
323
|
-
a++;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
static createElement(e, t) {
|
|
327
|
-
let n = w.createElement("template");
|
|
328
|
-
return n.innerHTML = e, n;
|
|
329
|
-
}
|
|
260
|
+
const be = (s, t) => {
|
|
261
|
+
const e = s.length - 1, i = [];
|
|
262
|
+
let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = k;
|
|
263
|
+
for (let l = 0; l < e; l++) {
|
|
264
|
+
const a = s[l];
|
|
265
|
+
let d, u, c = -1, f = 0;
|
|
266
|
+
for (; f < a.length && (o.lastIndex = f, u = o.exec(a), u !== null); ) f = o.lastIndex, o === k ? u[1] === "!--" ? o = bt : u[1] !== void 0 ? o = vt : u[2] !== void 0 ? (kt.test(u[2]) && (r = RegExp("</" + u[2], "g")), o = E) : u[3] !== void 0 && (o = E) : o === E ? u[0] === ">" ? (o = r ?? k, c = -1) : u[1] === void 0 ? c = -2 : (c = o.lastIndex - u[2].length, d = u[1], o = u[3] === void 0 ? E : u[3] === '"' ? _t : yt) : o === _t || o === yt ? o = E : o === bt || o === vt ? o = k : (o = E, r = void 0);
|
|
267
|
+
const m = o === E && s[l + 1].startsWith("/>") ? " " : "";
|
|
268
|
+
n += o === k ? a + me : c >= 0 ? (i.push(d), a.slice(0, c) + Mt + a.slice(c) + _ + m) : a + _ + (c === -2 ? l : m);
|
|
269
|
+
}
|
|
270
|
+
return [Ut(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
330
271
|
};
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
272
|
+
class O {
|
|
273
|
+
constructor({ strings: t, _$litType$: e }, i) {
|
|
274
|
+
let r;
|
|
275
|
+
this.parts = [];
|
|
276
|
+
let n = 0, o = 0;
|
|
277
|
+
const l = t.length - 1, a = this.parts, [d, u] = be(t, e);
|
|
278
|
+
if (this.el = O.createElement(d, i), S.currentNode = this.el.content, e === 2 || e === 3) {
|
|
279
|
+
const c = this.el.content.firstChild;
|
|
280
|
+
c.replaceWith(...c.childNodes);
|
|
281
|
+
}
|
|
282
|
+
for (; (r = S.nextNode()) !== null && a.length < l; ) {
|
|
283
|
+
if (r.nodeType === 1) {
|
|
284
|
+
if (r.hasAttributes()) for (const c of r.getAttributeNames()) if (c.endsWith(Mt)) {
|
|
285
|
+
const f = u[o++], m = r.getAttribute(c).split(_), g = /([.?@])?(.*)/.exec(f);
|
|
286
|
+
a.push({ type: 1, index: n, name: g[2], strings: m, ctor: g[1] === "." ? ye : g[1] === "?" ? _e : g[1] === "@" ? Ae : B }), r.removeAttribute(c);
|
|
287
|
+
} else c.startsWith(_) && (a.push({ type: 6, index: n }), r.removeAttribute(c));
|
|
288
|
+
if (kt.test(r.tagName)) {
|
|
289
|
+
const c = r.textContent.split(_), f = c.length - 1;
|
|
290
|
+
if (f > 0) {
|
|
291
|
+
r.textContent = W ? W.emptyScript : "";
|
|
292
|
+
for (let m = 0; m < f; m++) r.append(c[m], H()), S.nextNode(), a.push({ type: 2, index: ++n });
|
|
293
|
+
r.append(c[f], H());
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
} else if (r.nodeType === 8) if (r.data === Tt) a.push({ type: 2, index: n });
|
|
297
|
+
else {
|
|
298
|
+
let c = -1;
|
|
299
|
+
for (; (c = r.data.indexOf(_, c + 1)) !== -1; ) a.push({ type: 7, index: n }), c += _.length - 1;
|
|
300
|
+
}
|
|
301
|
+
n++;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
static createElement(t, e) {
|
|
305
|
+
const i = C.createElement("template");
|
|
306
|
+
return i.innerHTML = t, i;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
function T(s, t, e = s, i) {
|
|
310
|
+
if (t === w) return t;
|
|
311
|
+
let r = i !== void 0 ? e._$Co?.[i] : e._$Cl;
|
|
312
|
+
const n = I(t) ? void 0 : t._$litDirective$;
|
|
313
|
+
return r?.constructor !== n && (r?._$AO?.(!1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ??= [])[i] = r : e._$Cl = r), r !== void 0 && (t = T(s, r._$AS(s, t.values), r, i)), t;
|
|
314
|
+
}
|
|
315
|
+
class ve {
|
|
316
|
+
constructor(t, e) {
|
|
317
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
318
|
+
}
|
|
319
|
+
get parentNode() {
|
|
320
|
+
return this._$AM.parentNode;
|
|
321
|
+
}
|
|
322
|
+
get _$AU() {
|
|
323
|
+
return this._$AM._$AU;
|
|
324
|
+
}
|
|
325
|
+
u(t) {
|
|
326
|
+
const { el: { content: e }, parts: i } = this._$AD, r = (t?.creationScope ?? C).importNode(e, !0);
|
|
327
|
+
S.currentNode = r;
|
|
328
|
+
let n = S.nextNode(), o = 0, l = 0, a = i[0];
|
|
329
|
+
for (; a !== void 0; ) {
|
|
330
|
+
if (o === a.index) {
|
|
331
|
+
let d;
|
|
332
|
+
a.type === 2 ? d = new V(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ee(n, this, t)), this._$AV.push(d), a = i[++l];
|
|
333
|
+
}
|
|
334
|
+
o !== a?.index && (n = S.nextNode(), o++);
|
|
335
|
+
}
|
|
336
|
+
return S.currentNode = C, r;
|
|
337
|
+
}
|
|
338
|
+
p(t) {
|
|
339
|
+
let e = 0;
|
|
340
|
+
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
class V {
|
|
344
|
+
get _$AU() {
|
|
345
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
346
|
+
}
|
|
347
|
+
constructor(t, e, i, r) {
|
|
348
|
+
this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
349
|
+
}
|
|
350
|
+
get parentNode() {
|
|
351
|
+
let t = this._$AA.parentNode;
|
|
352
|
+
const e = this._$AM;
|
|
353
|
+
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
|
|
354
|
+
}
|
|
355
|
+
get startNode() {
|
|
356
|
+
return this._$AA;
|
|
357
|
+
}
|
|
358
|
+
get endNode() {
|
|
359
|
+
return this._$AB;
|
|
360
|
+
}
|
|
361
|
+
_$AI(t, e = this) {
|
|
362
|
+
t = T(this, t, e), I(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== w && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : $e(t) ? this.k(t) : this._(t);
|
|
363
|
+
}
|
|
364
|
+
O(t) {
|
|
365
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
366
|
+
}
|
|
367
|
+
T(t) {
|
|
368
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
369
|
+
}
|
|
370
|
+
_(t) {
|
|
371
|
+
this._$AH !== p && I(this._$AH) ? this._$AA.nextSibling.data = t : this.T(C.createTextNode(t)), this._$AH = t;
|
|
372
|
+
}
|
|
373
|
+
$(t) {
|
|
374
|
+
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = O.createElement(Ut(i.h, i.h[0]), this.options)), i);
|
|
375
|
+
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
376
|
+
else {
|
|
377
|
+
const n = new ve(r, this), o = n.u(this.options);
|
|
378
|
+
n.p(e), this.T(o), this._$AH = n;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
_$AC(t) {
|
|
382
|
+
let e = At.get(t.strings);
|
|
383
|
+
return e === void 0 && At.set(t.strings, e = new O(t)), e;
|
|
384
|
+
}
|
|
385
|
+
k(t) {
|
|
386
|
+
nt(this._$AH) || (this._$AH = [], this._$AR());
|
|
387
|
+
const e = this._$AH;
|
|
388
|
+
let i, r = 0;
|
|
389
|
+
for (const n of t) r === e.length ? e.push(i = new V(this.O(H()), this.O(H()), this, this.options)) : i = e[r], i._$AI(n), r++;
|
|
390
|
+
r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
|
|
391
|
+
}
|
|
392
|
+
_$AR(t = this._$AA.nextSibling, e) {
|
|
393
|
+
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
394
|
+
const i = $t(t).nextSibling;
|
|
395
|
+
$t(t).remove(), t = i;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
setConnected(t) {
|
|
399
|
+
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
class B {
|
|
403
|
+
get tagName() {
|
|
404
|
+
return this.element.tagName;
|
|
405
|
+
}
|
|
406
|
+
get _$AU() {
|
|
407
|
+
return this._$AM._$AU;
|
|
408
|
+
}
|
|
409
|
+
constructor(t, e, i, r, n) {
|
|
410
|
+
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = p;
|
|
411
|
+
}
|
|
412
|
+
_$AI(t, e = this, i, r) {
|
|
413
|
+
const n = this.strings;
|
|
414
|
+
let o = !1;
|
|
415
|
+
if (n === void 0) t = T(this, t, e, 0), o = !I(t) || t !== this._$AH && t !== w, o && (this._$AH = t);
|
|
416
|
+
else {
|
|
417
|
+
const l = t;
|
|
418
|
+
let a, d;
|
|
419
|
+
for (t = n[0], a = 0; a < n.length - 1; a++) d = T(this, l[i + a], e, a), d === w && (d = this._$AH[a]), o ||= !I(d) || d !== this._$AH[a], d === p ? t = p : t !== p && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
|
|
420
|
+
}
|
|
421
|
+
o && !r && this.j(t);
|
|
422
|
+
}
|
|
423
|
+
j(t) {
|
|
424
|
+
t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
class ye extends B {
|
|
428
|
+
constructor() {
|
|
429
|
+
super(...arguments), this.type = 3;
|
|
430
|
+
}
|
|
431
|
+
j(t) {
|
|
432
|
+
this.element[this.name] = t === p ? void 0 : t;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
class _e extends B {
|
|
436
|
+
constructor() {
|
|
437
|
+
super(...arguments), this.type = 4;
|
|
438
|
+
}
|
|
439
|
+
j(t) {
|
|
440
|
+
this.element.toggleAttribute(this.name, !!t && t !== p);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
class Ae extends B {
|
|
444
|
+
constructor(t, e, i, r, n) {
|
|
445
|
+
super(t, e, i, r, n), this.type = 5;
|
|
446
|
+
}
|
|
447
|
+
_$AI(t, e = this) {
|
|
448
|
+
if ((t = T(this, t, e, 0) ?? p) === w) return;
|
|
449
|
+
const i = this._$AH, r = t === p && i !== p || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== p && (i === p || r);
|
|
450
|
+
r && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
451
|
+
}
|
|
452
|
+
handleEvent(t) {
|
|
453
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
class Ee {
|
|
457
|
+
constructor(t, e, i) {
|
|
458
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
|
459
|
+
}
|
|
460
|
+
get _$AU() {
|
|
461
|
+
return this._$AM._$AU;
|
|
462
|
+
}
|
|
463
|
+
_$AI(t) {
|
|
464
|
+
T(this, t);
|
|
465
|
+
}
|
|
335
466
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
u(e) {
|
|
347
|
-
let { el: { content: t }, parts: n } = this._$AD, r = (e?.creationScope ?? w).importNode(t, !0);
|
|
348
|
-
P.currentNode = r;
|
|
349
|
-
let i = P.nextNode(), a = 0, o = 0, s = n[0];
|
|
350
|
-
for (; s !== void 0;) {
|
|
351
|
-
if (a === s.index) {
|
|
352
|
-
let t;
|
|
353
|
-
s.type === 2 ? t = new L(i, i.nextSibling, this, e) : s.type === 1 ? t = new s.ctor(i, s.name, s.strings, this, e) : s.type === 6 && (t = new Le(i, this, e)), this._$AV.push(t), s = n[++o];
|
|
354
|
-
}
|
|
355
|
-
a !== s?.index && (i = P.nextNode(), a++);
|
|
356
|
-
}
|
|
357
|
-
return P.currentNode = w, r;
|
|
358
|
-
}
|
|
359
|
-
p(e) {
|
|
360
|
-
let t = 0;
|
|
361
|
-
for (let n of this._$AV) n !== void 0 && (n.strings === void 0 ? n._$AI(e[t]) : (n._$AI(e, n, t), t += n.strings.length - 2)), t++;
|
|
362
|
-
}
|
|
363
|
-
}, L = class e {
|
|
364
|
-
get _$AU() {
|
|
365
|
-
return this._$AM?._$AU ?? this._$Cv;
|
|
366
|
-
}
|
|
367
|
-
constructor(e, t, n, r) {
|
|
368
|
-
this.type = 2, this._$AH = N, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = n, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
369
|
-
}
|
|
370
|
-
get parentNode() {
|
|
371
|
-
let e = this._$AA.parentNode, t = this._$AM;
|
|
372
|
-
return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
|
|
373
|
-
}
|
|
374
|
-
get startNode() {
|
|
375
|
-
return this._$AA;
|
|
376
|
-
}
|
|
377
|
-
get endNode() {
|
|
378
|
-
return this._$AB;
|
|
379
|
-
}
|
|
380
|
-
_$AI(e, t = this) {
|
|
381
|
-
e = I(this, e, t), E(e) ? e === N || e == null || e === "" ? (this._$AH !== N && this._$AR(), this._$AH = N) : e !== this._$AH && e !== M && this._(e) : e._$litType$ === void 0 ? e.nodeType === void 0 ? we(e) ? this.k(e) : this._(e) : this.T(e) : this.$(e);
|
|
382
|
-
}
|
|
383
|
-
O(e) {
|
|
384
|
-
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
385
|
-
}
|
|
386
|
-
T(e) {
|
|
387
|
-
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
388
|
-
}
|
|
389
|
-
_(e) {
|
|
390
|
-
this._$AH !== N && E(this._$AH) ? this._$AA.nextSibling.data = e : this.T(w.createTextNode(e)), this._$AH = e;
|
|
391
|
-
}
|
|
392
|
-
$(e) {
|
|
393
|
-
let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = F.createElement(je(n.h, n.h[0]), this.options)), n);
|
|
394
|
-
if (this._$AH?._$AD === r) this._$AH.p(t);
|
|
395
|
-
else {
|
|
396
|
-
let e = new Ne(r, this), n = e.u(this.options);
|
|
397
|
-
e.p(t), this.T(n), this._$AH = e;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
_$AC(e) {
|
|
401
|
-
let t = Ae.get(e.strings);
|
|
402
|
-
return t === void 0 && Ae.set(e.strings, t = new F(e)), t;
|
|
403
|
-
}
|
|
404
|
-
k(t) {
|
|
405
|
-
D(this._$AH) || (this._$AH = [], this._$AR());
|
|
406
|
-
let n = this._$AH, r, i = 0;
|
|
407
|
-
for (let a of t) i === n.length ? n.push(r = new e(this.O(T()), this.O(T()), this, this.options)) : r = n[i], r._$AI(a), i++;
|
|
408
|
-
i < n.length && (this._$AR(r && r._$AB.nextSibling, i), n.length = i);
|
|
409
|
-
}
|
|
410
|
-
_$AR(e = this._$AA.nextSibling, t) {
|
|
411
|
-
for (this._$AP?.(!1, !0, t); e !== this._$AB;) {
|
|
412
|
-
let t = ye(e).nextSibling;
|
|
413
|
-
ye(e).remove(), e = t;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
setConnected(e) {
|
|
417
|
-
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
418
|
-
}
|
|
419
|
-
}, R = class {
|
|
420
|
-
get tagName() {
|
|
421
|
-
return this.element.tagName;
|
|
422
|
-
}
|
|
423
|
-
get _$AU() {
|
|
424
|
-
return this._$AM._$AU;
|
|
425
|
-
}
|
|
426
|
-
constructor(e, t, n, r, i) {
|
|
427
|
-
this.type = 1, this._$AH = N, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = i, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(/* @__PURE__ */ new String()), this.strings = n) : this._$AH = N;
|
|
428
|
-
}
|
|
429
|
-
_$AI(e, t = this, n, r) {
|
|
430
|
-
let i = this.strings, a = !1;
|
|
431
|
-
if (i === void 0) e = I(this, e, t, 0), a = !E(e) || e !== this._$AH && e !== M, a && (this._$AH = e);
|
|
432
|
-
else {
|
|
433
|
-
let r = e, o, s;
|
|
434
|
-
for (e = i[0], o = 0; o < i.length - 1; o++) s = I(this, r[n + o], t, o), s === M && (s = this._$AH[o]), a ||= !E(s) || s !== this._$AH[o], s === N ? e = N : e !== N && (e += (s ?? "") + i[o + 1]), this._$AH[o] = s;
|
|
435
|
-
}
|
|
436
|
-
a && !r && this.j(e);
|
|
437
|
-
}
|
|
438
|
-
j(e) {
|
|
439
|
-
e === N ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
440
|
-
}
|
|
441
|
-
}, Pe = class extends R {
|
|
442
|
-
constructor() {
|
|
443
|
-
super(...arguments), this.type = 3;
|
|
444
|
-
}
|
|
445
|
-
j(e) {
|
|
446
|
-
this.element[this.name] = e === N ? void 0 : e;
|
|
447
|
-
}
|
|
448
|
-
}, Fe = class extends R {
|
|
449
|
-
constructor() {
|
|
450
|
-
super(...arguments), this.type = 4;
|
|
451
|
-
}
|
|
452
|
-
j(e) {
|
|
453
|
-
this.element.toggleAttribute(this.name, !!e && e !== N);
|
|
454
|
-
}
|
|
455
|
-
}, Ie = class extends R {
|
|
456
|
-
constructor(e, t, n, r, i) {
|
|
457
|
-
super(e, t, n, r, i), this.type = 5;
|
|
458
|
-
}
|
|
459
|
-
_$AI(e, t = this) {
|
|
460
|
-
if ((e = I(this, e, t, 0) ?? N) === M) return;
|
|
461
|
-
let n = this._$AH, r = e === N && n !== N || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, i = e !== N && (n === N || r);
|
|
462
|
-
r && this.element.removeEventListener(this.name, this, n), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
463
|
-
}
|
|
464
|
-
handleEvent(e) {
|
|
465
|
-
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
466
|
-
}
|
|
467
|
-
}, Le = class {
|
|
468
|
-
constructor(e, t, n) {
|
|
469
|
-
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = n;
|
|
470
|
-
}
|
|
471
|
-
get _$AU() {
|
|
472
|
-
return this._$AM._$AU;
|
|
473
|
-
}
|
|
474
|
-
_$AI(e) {
|
|
475
|
-
I(this, e);
|
|
476
|
-
}
|
|
477
|
-
}, Re = {
|
|
478
|
-
M: xe,
|
|
479
|
-
P: C,
|
|
480
|
-
A: Se,
|
|
481
|
-
C: 1,
|
|
482
|
-
L: Me,
|
|
483
|
-
R: Ne,
|
|
484
|
-
D: we,
|
|
485
|
-
V: I,
|
|
486
|
-
I: L,
|
|
487
|
-
H: R,
|
|
488
|
-
N: Fe,
|
|
489
|
-
U: Ie,
|
|
490
|
-
B: Pe,
|
|
491
|
-
F: Le
|
|
492
|
-
}, ze = ve.litHtmlPolyfillSupport;
|
|
493
|
-
ze?.(F, L), (ve.litHtmlVersions ??= []).push("3.3.2");
|
|
494
|
-
var Be = (e, t, n) => {
|
|
495
|
-
let r = n?.renderBefore ?? t, i = r._$litPart$;
|
|
496
|
-
if (i === void 0) {
|
|
497
|
-
let e = n?.renderBefore ?? null;
|
|
498
|
-
r._$litPart$ = i = new L(t.insertBefore(T(), e), e, void 0, n ?? {});
|
|
499
|
-
}
|
|
500
|
-
return i._$AI(e), i;
|
|
501
|
-
}, z = globalThis, B = class extends x {
|
|
502
|
-
constructor() {
|
|
503
|
-
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
504
|
-
}
|
|
505
|
-
createRenderRoot() {
|
|
506
|
-
let e = super.createRenderRoot();
|
|
507
|
-
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
508
|
-
}
|
|
509
|
-
update(e) {
|
|
510
|
-
let t = this.render();
|
|
511
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Be(t, this.renderRoot, this.renderOptions);
|
|
512
|
-
}
|
|
513
|
-
connectedCallback() {
|
|
514
|
-
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
515
|
-
}
|
|
516
|
-
disconnectedCallback() {
|
|
517
|
-
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
518
|
-
}
|
|
519
|
-
render() {
|
|
520
|
-
return M;
|
|
521
|
-
}
|
|
467
|
+
const Se = rt.litHtmlPolyfillSupport;
|
|
468
|
+
Se?.(O, V), (rt.litHtmlVersions ??= []).push("3.3.2");
|
|
469
|
+
const Ce = (s, t, e) => {
|
|
470
|
+
const i = e?.renderBefore ?? t;
|
|
471
|
+
let r = i._$litPart$;
|
|
472
|
+
if (r === void 0) {
|
|
473
|
+
const n = e?.renderBefore ?? null;
|
|
474
|
+
i._$litPart$ = r = new V(t.insertBefore(H(), n), n, void 0, e ?? {});
|
|
475
|
+
}
|
|
476
|
+
return r._$AI(s), r;
|
|
522
477
|
};
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}
|
|
545
|
-
attribute: !0,
|
|
546
|
-
type: String,
|
|
547
|
-
converter: y,
|
|
548
|
-
reflect: !1,
|
|
549
|
-
hasChanged: b
|
|
550
|
-
}, qe = (e = Ke, t, n) => {
|
|
551
|
-
let { kind: r, metadata: i } = n, a = globalThis.litPropertyMetadata.get(i);
|
|
552
|
-
if (a === void 0 && globalThis.litPropertyMetadata.set(i, a = /* @__PURE__ */ new Map()), r === "setter" && ((e = Object.create(e)).wrapped = !0), a.set(n.name, e), r === "accessor") {
|
|
553
|
-
let { name: r } = n;
|
|
554
|
-
return {
|
|
555
|
-
set(n) {
|
|
556
|
-
let i = t.get.call(this);
|
|
557
|
-
t.set.call(this, n), this.requestUpdate(r, i, e, !0, n);
|
|
558
|
-
},
|
|
559
|
-
init(t) {
|
|
560
|
-
return t !== void 0 && this.C(r, void 0, e, t), t;
|
|
561
|
-
}
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
if (r === "setter") {
|
|
565
|
-
let { name: r } = n;
|
|
566
|
-
return function(n) {
|
|
567
|
-
let i = this[r];
|
|
568
|
-
t.call(this, n), this.requestUpdate(r, i, e, !0, n);
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
throw Error("Unsupported decorator location: " + r);
|
|
478
|
+
const ot = globalThis;
|
|
479
|
+
let M = class extends R {
|
|
480
|
+
constructor() {
|
|
481
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
482
|
+
}
|
|
483
|
+
createRenderRoot() {
|
|
484
|
+
const t = super.createRenderRoot();
|
|
485
|
+
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
486
|
+
}
|
|
487
|
+
update(t) {
|
|
488
|
+
const e = this.render();
|
|
489
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ce(e, this.renderRoot, this.renderOptions);
|
|
490
|
+
}
|
|
491
|
+
connectedCallback() {
|
|
492
|
+
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
493
|
+
}
|
|
494
|
+
disconnectedCallback() {
|
|
495
|
+
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
496
|
+
}
|
|
497
|
+
render() {
|
|
498
|
+
return w;
|
|
499
|
+
}
|
|
572
500
|
};
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
501
|
+
M._$litElement$ = !0, M.finalized = !0, ot.litElementHydrateSupport?.({ LitElement: M });
|
|
502
|
+
const we = ot.litElementPolyfillSupport;
|
|
503
|
+
we?.({ LitElement: M });
|
|
504
|
+
(ot.litElementVersions ??= []).push("4.2.2");
|
|
505
|
+
const Pt = /* @__PURE__ */ Symbol.for(""), xe = (s) => {
|
|
506
|
+
if (s?.r === Pt) return s?._$litStatic$;
|
|
507
|
+
}, Nt = (s) => ({ _$litStatic$: s, r: Pt }), Et = /* @__PURE__ */ new Map(), Re = (s) => (t, ...e) => {
|
|
508
|
+
const i = e.length;
|
|
509
|
+
let r, n;
|
|
510
|
+
const o = [], l = [];
|
|
511
|
+
let a, d = 0, u = !1;
|
|
512
|
+
for (; d < i; ) {
|
|
513
|
+
for (a = t[d]; d < i && (n = e[d], (r = xe(n)) !== void 0); ) a += r + t[++d], u = !0;
|
|
514
|
+
d !== i && l.push(n), o.push(a), d++;
|
|
515
|
+
}
|
|
516
|
+
if (d === i && o.push(t[i]), u) {
|
|
517
|
+
const c = o.join("$$lit$$");
|
|
518
|
+
(t = Et.get(c)) === void 0 && (o.raw = o, Et.set(c, t = o)), e = l;
|
|
519
|
+
}
|
|
520
|
+
return s(t, ...e);
|
|
521
|
+
}, L = Re(h);
|
|
522
|
+
const Me = { attribute: !0, type: String, converter: j, reflect: !1, hasChanged: it }, Te = (s = Me, t, e) => {
|
|
523
|
+
const { kind: i, metadata: r } = e;
|
|
524
|
+
let n = globalThis.litPropertyMetadata.get(r);
|
|
525
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), n.set(e.name, s), i === "accessor") {
|
|
526
|
+
const { name: o } = e;
|
|
527
|
+
return { set(l) {
|
|
528
|
+
const a = t.get.call(this);
|
|
529
|
+
t.set.call(this, l), this.requestUpdate(o, a, s, !0, l);
|
|
530
|
+
}, init(l) {
|
|
531
|
+
return l !== void 0 && this.C(o, void 0, s, l), l;
|
|
532
|
+
} };
|
|
533
|
+
}
|
|
534
|
+
if (i === "setter") {
|
|
535
|
+
const { name: o } = e;
|
|
536
|
+
return function(l) {
|
|
537
|
+
const a = this[o];
|
|
538
|
+
t.call(this, l), this.requestUpdate(o, a, s, !0, l);
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
throw Error("Unsupported decorator location: " + i);
|
|
542
|
+
};
|
|
543
|
+
function $(s) {
|
|
544
|
+
return (t, e) => typeof e == "object" ? Te(s, t, e) : ((i, r, n) => {
|
|
545
|
+
const o = r.hasOwnProperty(n);
|
|
546
|
+
return r.constructor.createProperty(n, i), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
|
|
547
|
+
})(s, t, e);
|
|
548
|
+
}
|
|
549
|
+
function K(s) {
|
|
550
|
+
return $({ ...s, state: !0, attribute: !1 });
|
|
551
|
+
}
|
|
552
|
+
const ke = /^[a-z][a-z0-9]*(-[a-z0-9]+)+$/;
|
|
553
|
+
function P(s) {
|
|
554
|
+
if (!ke.test(s))
|
|
555
|
+
throw new Error(
|
|
556
|
+
`[Formie WC] Invalid custom element tag "${s}". Use lowercase hyphenated names (e.g. my-text-field).`
|
|
557
|
+
);
|
|
578
558
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
559
|
+
class Z {
|
|
560
|
+
constructor() {
|
|
561
|
+
this.fieldControls = {}, this.fieldTag = null, this.regions = {};
|
|
562
|
+
}
|
|
563
|
+
registerFieldControl(t, e) {
|
|
564
|
+
return P(e), this.fieldControls[t] = e, this;
|
|
565
|
+
}
|
|
566
|
+
/** Register a custom element used as the **field** host for every question. */
|
|
567
|
+
registerField(t) {
|
|
568
|
+
return P(t), this.fieldTag = t, this;
|
|
569
|
+
}
|
|
570
|
+
registerRegion(t, e) {
|
|
571
|
+
return P(e), this.regions[t] = e, this;
|
|
572
|
+
}
|
|
573
|
+
clone() {
|
|
574
|
+
const t = new Z();
|
|
575
|
+
return t.fieldControls = { ...this.fieldControls }, t.fieldTag = this.fieldTag, t.regions = { ...this.regions }, t;
|
|
576
|
+
}
|
|
587
577
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
function W(e) {
|
|
592
|
-
if (!Je.test(e)) throw Error(`[Formie WC] Invalid custom element tag "${e}". Use lowercase hyphenated names (e.g. my-text-field).`);
|
|
578
|
+
const Ue = new Z();
|
|
579
|
+
function Pe() {
|
|
580
|
+
return Ue;
|
|
593
581
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
this.fieldControls = {}, this.fieldTag = null, this.regions = {};
|
|
597
|
-
}
|
|
598
|
-
registerFieldControl(e, t) {
|
|
599
|
-
return W(t), this.fieldControls[e] = t, this;
|
|
600
|
-
}
|
|
601
|
-
registerField(e) {
|
|
602
|
-
return W(e), this.fieldTag = e, this;
|
|
603
|
-
}
|
|
604
|
-
registerRegion(e, t) {
|
|
605
|
-
return W(t), this.regions[e] = t, this;
|
|
606
|
-
}
|
|
607
|
-
clone() {
|
|
608
|
-
let t = new e();
|
|
609
|
-
return t.fieldControls = { ...this.fieldControls }, t.fieldTag = this.fieldTag, t.regions = { ...this.regions }, t;
|
|
610
|
-
}
|
|
611
|
-
}, Ye = new G();
|
|
612
|
-
function Xe() {
|
|
613
|
-
return Ye;
|
|
582
|
+
function us() {
|
|
583
|
+
return new Z();
|
|
614
584
|
}
|
|
615
|
-
|
|
616
|
-
|
|
585
|
+
const Ne = (s) => s.strings === void 0;
|
|
586
|
+
const Ht = { CHILD: 2 }, It = (s) => (...t) => ({ _$litDirective$: s, values: t });
|
|
587
|
+
class Ot {
|
|
588
|
+
constructor(t) {
|
|
589
|
+
}
|
|
590
|
+
get _$AU() {
|
|
591
|
+
return this._$AM._$AU;
|
|
592
|
+
}
|
|
593
|
+
_$AT(t, e, i) {
|
|
594
|
+
this._$Ct = t, this._$AM = e, this._$Ci = i;
|
|
595
|
+
}
|
|
596
|
+
_$AS(t, e) {
|
|
597
|
+
return this.update(t, e);
|
|
598
|
+
}
|
|
599
|
+
update(t, e) {
|
|
600
|
+
return this.render(...e);
|
|
601
|
+
}
|
|
617
602
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
this._$Ct = e, this._$AM = t, this._$Ci = n;
|
|
637
|
-
}
|
|
638
|
-
_$AS(e, t) {
|
|
639
|
-
return this.update(e, t);
|
|
640
|
-
}
|
|
641
|
-
update(e, t) {
|
|
642
|
-
return this.render(...t);
|
|
643
|
-
}
|
|
644
|
-
}, K = (e, t) => {
|
|
645
|
-
let n = e._$AN;
|
|
646
|
-
if (n === void 0) return !1;
|
|
647
|
-
for (let e of n) e._$AO?.(t, !1), K(e, t);
|
|
648
|
-
return !0;
|
|
649
|
-
}, q = (e) => {
|
|
650
|
-
let t, n;
|
|
651
|
-
do {
|
|
652
|
-
if ((t = e._$AM) === void 0) break;
|
|
653
|
-
n = t._$AN, n.delete(e), e = t;
|
|
654
|
-
} while (n?.size === 0);
|
|
655
|
-
}, rt = (e) => {
|
|
656
|
-
for (let t; t = e._$AM; e = t) {
|
|
657
|
-
let n = t._$AN;
|
|
658
|
-
if (n === void 0) t._$AN = n = /* @__PURE__ */ new Set();
|
|
659
|
-
else if (n.has(e)) break;
|
|
660
|
-
n.add(e), ot(t);
|
|
661
|
-
}
|
|
603
|
+
const N = (s, t) => {
|
|
604
|
+
const e = s._$AN;
|
|
605
|
+
if (e === void 0) return !1;
|
|
606
|
+
for (const i of e) i._$AO?.(t, !1), N(i, t);
|
|
607
|
+
return !0;
|
|
608
|
+
}, q = (s) => {
|
|
609
|
+
let t, e;
|
|
610
|
+
do {
|
|
611
|
+
if ((t = s._$AM) === void 0) break;
|
|
612
|
+
e = t._$AN, e.delete(s), s = t;
|
|
613
|
+
} while (e?.size === 0);
|
|
614
|
+
}, Lt = (s) => {
|
|
615
|
+
for (let t; t = s._$AM; s = t) {
|
|
616
|
+
let e = t._$AN;
|
|
617
|
+
if (e === void 0) t._$AN = e = /* @__PURE__ */ new Set();
|
|
618
|
+
else if (e.has(s)) break;
|
|
619
|
+
e.add(s), Oe(t);
|
|
620
|
+
}
|
|
662
621
|
};
|
|
663
|
-
function
|
|
664
|
-
|
|
622
|
+
function He(s) {
|
|
623
|
+
this._$AN !== void 0 ? (q(this), this._$AM = s, Lt(this)) : this._$AM = s;
|
|
665
624
|
}
|
|
666
|
-
function
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
625
|
+
function Ie(s, t = !1, e = 0) {
|
|
626
|
+
const i = this._$AH, r = this._$AN;
|
|
627
|
+
if (r !== void 0 && r.size !== 0) if (t) if (Array.isArray(i)) for (let n = e; n < i.length; n++) N(i[n], !1), q(i[n]);
|
|
628
|
+
else i != null && (N(i, !1), q(i));
|
|
629
|
+
else N(this, s);
|
|
671
630
|
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
}, st = class extends nt {
|
|
675
|
-
constructor() {
|
|
676
|
-
super(...arguments), this._$AN = void 0;
|
|
677
|
-
}
|
|
678
|
-
_$AT(e, t, n) {
|
|
679
|
-
super._$AT(e, t, n), rt(this), this.isConnected = e._$AU;
|
|
680
|
-
}
|
|
681
|
-
_$AO(e, t = !0) {
|
|
682
|
-
e !== this.isConnected && (this.isConnected = e, e ? this.reconnected?.() : this.disconnected?.()), t && (K(this, e), q(this));
|
|
683
|
-
}
|
|
684
|
-
setValue(e) {
|
|
685
|
-
if ($e(this._$Ct)) this._$Ct._$AI(e, this);
|
|
686
|
-
else {
|
|
687
|
-
let t = [...this._$Ct._$AH];
|
|
688
|
-
t[this._$Ci] = e, this._$Ct._$AI(t, this, 0);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
disconnected() {}
|
|
692
|
-
reconnected() {}
|
|
693
|
-
}, ct = /* @__PURE__ */ new WeakMap(), lt = tt(class extends st {
|
|
694
|
-
render(e) {
|
|
695
|
-
return N;
|
|
696
|
-
}
|
|
697
|
-
update(e, [t]) {
|
|
698
|
-
let n = t !== this.G;
|
|
699
|
-
return n && this.G !== void 0 && this.rt(void 0), (n || this.lt !== this.ct) && (this.G = t, this.ht = e.options?.host, this.rt(this.ct = e.element)), N;
|
|
700
|
-
}
|
|
701
|
-
rt(e) {
|
|
702
|
-
if (this.isConnected || (e = void 0), typeof this.G == "function") {
|
|
703
|
-
let t = this.ht ?? globalThis, n = ct.get(t);
|
|
704
|
-
n === void 0 && (n = /* @__PURE__ */ new WeakMap(), ct.set(t, n)), n.get(this.G) !== void 0 && this.G.call(this.ht, void 0), n.set(this.G, e), e !== void 0 && this.G.call(this.ht, e);
|
|
705
|
-
} else this.G.value = e;
|
|
706
|
-
}
|
|
707
|
-
get lt() {
|
|
708
|
-
return typeof this.G == "function" ? ct.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
709
|
-
}
|
|
710
|
-
disconnected() {
|
|
711
|
-
this.lt === this.ct && this.rt(void 0);
|
|
712
|
-
}
|
|
713
|
-
reconnected() {
|
|
714
|
-
this.rt(this.ct);
|
|
715
|
-
}
|
|
716
|
-
}), ut = class extends nt {
|
|
717
|
-
constructor(e) {
|
|
718
|
-
if (super(e), this.it = N, e.type !== et.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
719
|
-
}
|
|
720
|
-
render(e) {
|
|
721
|
-
if (e === N || e == null) return this._t = void 0, this.it = e;
|
|
722
|
-
if (e === M) return e;
|
|
723
|
-
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
724
|
-
if (e === this.it) return this._t;
|
|
725
|
-
this.it = e;
|
|
726
|
-
let t = [e];
|
|
727
|
-
return t.raw = t, this._t = {
|
|
728
|
-
_$litType$: this.constructor.resultType,
|
|
729
|
-
strings: t,
|
|
730
|
-
values: []
|
|
731
|
-
};
|
|
732
|
-
}
|
|
631
|
+
const Oe = (s) => {
|
|
632
|
+
s.type == Ht.CHILD && (s._$AP ??= Ie, s._$AQ ??= He);
|
|
733
633
|
};
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
634
|
+
class Le extends Ot {
|
|
635
|
+
constructor() {
|
|
636
|
+
super(...arguments), this._$AN = void 0;
|
|
637
|
+
}
|
|
638
|
+
_$AT(t, e, i) {
|
|
639
|
+
super._$AT(t, e, i), Lt(this), this.isConnected = t._$AU;
|
|
640
|
+
}
|
|
641
|
+
_$AO(t, e = !0) {
|
|
642
|
+
t !== this.isConnected && (this.isConnected = t, t ? this.reconnected?.() : this.disconnected?.()), e && (N(this, t), q(this));
|
|
643
|
+
}
|
|
644
|
+
setValue(t) {
|
|
645
|
+
if (Ne(this._$Ct)) this._$Ct._$AI(t, this);
|
|
646
|
+
else {
|
|
647
|
+
const e = [...this._$Ct._$AH];
|
|
648
|
+
e[this._$Ci] = t, this._$Ct._$AI(e, this, 0);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
disconnected() {
|
|
652
|
+
}
|
|
653
|
+
reconnected() {
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
const Q = /* @__PURE__ */ new WeakMap(), Ve = It(class extends Le {
|
|
657
|
+
render(s) {
|
|
658
|
+
return p;
|
|
659
|
+
}
|
|
660
|
+
update(s, [t]) {
|
|
661
|
+
const e = t !== this.G;
|
|
662
|
+
return e && this.G !== void 0 && this.rt(void 0), (e || this.lt !== this.ct) && (this.G = t, this.ht = s.options?.host, this.rt(this.ct = s.element)), p;
|
|
663
|
+
}
|
|
664
|
+
rt(s) {
|
|
665
|
+
if (this.isConnected || (s = void 0), typeof this.G == "function") {
|
|
666
|
+
const t = this.ht ?? globalThis;
|
|
667
|
+
let e = Q.get(t);
|
|
668
|
+
e === void 0 && (e = /* @__PURE__ */ new WeakMap(), Q.set(t, e)), e.get(this.G) !== void 0 && this.G.call(this.ht, void 0), e.set(this.G, s), s !== void 0 && this.G.call(this.ht, s);
|
|
669
|
+
} else this.G.value = s;
|
|
670
|
+
}
|
|
671
|
+
get lt() {
|
|
672
|
+
return typeof this.G == "function" ? Q.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
673
|
+
}
|
|
674
|
+
disconnected() {
|
|
675
|
+
this.lt === this.ct && this.rt(void 0);
|
|
676
|
+
}
|
|
677
|
+
reconnected() {
|
|
678
|
+
this.rt(this.ct);
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
class tt extends Ot {
|
|
682
|
+
constructor(t) {
|
|
683
|
+
if (super(t), this.it = p, t.type !== Ht.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
684
|
+
}
|
|
685
|
+
render(t) {
|
|
686
|
+
if (t === p || t == null) return this._t = void 0, this.it = t;
|
|
687
|
+
if (t === w) return t;
|
|
688
|
+
if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
689
|
+
if (t === this.it) return this._t;
|
|
690
|
+
this.it = t;
|
|
691
|
+
const e = [t];
|
|
692
|
+
return e.raw = e, this._t = { _$litType$: this.constructor.resultType, strings: e, values: [] };
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
tt.directiveName = "unsafeHTML", tt.resultType = 1;
|
|
696
|
+
const ze = It(tt);
|
|
697
|
+
function ps(s) {
|
|
698
|
+
return !!s && typeof s == "object" && "id" in s && "handle" in s && "type" in s;
|
|
740
699
|
}
|
|
741
|
-
function
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
700
|
+
function Vt(s) {
|
|
701
|
+
if (xt(s.type))
|
|
702
|
+
return s.type;
|
|
703
|
+
const t = s.input && typeof s.input == "object" ? s.input : {}, e = typeof t.fieldKind == "string" ? t.fieldKind : null;
|
|
704
|
+
return e === "text" ? "single-line-text" : e === "textarea" ? "multi-line-text" : e === "boolean" ? "agree" : e === "file" ? "file" : s.type;
|
|
745
705
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
//#endregion
|
|
750
|
-
//#region src/render-view.ts
|
|
751
|
-
function mt(e) {
|
|
752
|
-
return W(e), We(e);
|
|
706
|
+
const D = "formie-control-value-change";
|
|
707
|
+
function at(s) {
|
|
708
|
+
return P(s), Nt(s);
|
|
753
709
|
}
|
|
754
|
-
function
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
710
|
+
function Fe(s, t, e, i, r, n, o, l) {
|
|
711
|
+
if (!s || !(s instanceof HTMLElement))
|
|
712
|
+
return;
|
|
713
|
+
const a = t.toLowerCase();
|
|
714
|
+
let d = s.firstElementChild;
|
|
715
|
+
(!d || d.tagName.toLowerCase() !== a) && (s.replaceChildren(), d = document.createElement(t), d.addEventListener(D, (u) => {
|
|
716
|
+
l(u.detail);
|
|
717
|
+
}), s.append(d)), d.field = e, d.value = i, d.errorKey = r, d.disabled = n, d.hidden = o;
|
|
760
718
|
}
|
|
761
|
-
function
|
|
762
|
-
|
|
719
|
+
function De(s, t, e, i, r, n, o, l) {
|
|
720
|
+
return h`<div
|
|
763
721
|
class="starter-core-registry-host min-w-0"
|
|
764
|
-
${
|
|
765
|
-
|
|
766
|
-
|
|
722
|
+
${Ve((a) => {
|
|
723
|
+
Fe(a, t, e, i, r, n, o, l);
|
|
724
|
+
})}
|
|
767
725
|
></div>`;
|
|
768
726
|
}
|
|
769
|
-
function
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
727
|
+
function je(s, t, e, i, r = "default") {
|
|
728
|
+
if (r === "compositePart")
|
|
729
|
+
return We(t, e, i);
|
|
730
|
+
const n = s.registry.fieldTag;
|
|
731
|
+
if (!n)
|
|
732
|
+
return qe(t, e, i);
|
|
733
|
+
const o = at(n);
|
|
734
|
+
return L`<${o} .field=${t} .errors=${e}>${i}</${o}>`;
|
|
775
735
|
}
|
|
776
|
-
function
|
|
777
|
-
|
|
778
|
-
<div class="starter-component-subfield" data-formie-field-type=${
|
|
779
|
-
${
|
|
780
|
-
<div class="starter-component-injected-control grid gap-2 text-slate-900">${
|
|
781
|
-
${t.length > 0 ?
|
|
782
|
-
${t.map((
|
|
783
|
-
</ul>` :
|
|
736
|
+
function We(s, t, e) {
|
|
737
|
+
return h`
|
|
738
|
+
<div class="starter-component-subfield" data-formie-field-type=${s.type}>
|
|
739
|
+
${s.label ? h`<label class="starter-component-subfield-label">${s.label}</label>` : p}
|
|
740
|
+
<div class="starter-component-injected-control grid gap-2 text-slate-900">${e}</div>
|
|
741
|
+
${t.length > 0 ? h`<ul class="grid gap-1 text-sm text-red-600">
|
|
742
|
+
${t.map((i) => h`<li>${i}</li>`)}
|
|
743
|
+
</ul>` : p}
|
|
784
744
|
</div>
|
|
785
745
|
`;
|
|
786
746
|
}
|
|
787
|
-
function
|
|
788
|
-
|
|
789
|
-
<div class="starter-component-card" data-formie-field-type=${
|
|
790
|
-
${
|
|
791
|
-
${
|
|
792
|
-
<div class="starter-component-injected-control grid gap-2 text-slate-900">${
|
|
793
|
-
${t.length > 0 ?
|
|
794
|
-
${t.map((
|
|
795
|
-
</ul>` :
|
|
747
|
+
function qe(s, t, e) {
|
|
748
|
+
return h`
|
|
749
|
+
<div class="starter-component-card" data-formie-field-type=${s.type}>
|
|
750
|
+
${s.label ? h`<label class="starter-component-label">${s.label}</label>` : p}
|
|
751
|
+
${s.instructions ? h`<p class="starter-component-help">${s.instructions}</p>` : p}
|
|
752
|
+
<div class="starter-component-injected-control grid gap-2 text-slate-900">${e}</div>
|
|
753
|
+
${t.length > 0 ? h`<ul class="grid gap-1 text-sm text-red-600">
|
|
754
|
+
${t.map((i) => h`<li>${i}</li>`)}
|
|
755
|
+
</ul>` : p}
|
|
796
756
|
</div>
|
|
797
757
|
`;
|
|
798
758
|
}
|
|
799
|
-
function
|
|
800
|
-
|
|
801
|
-
|
|
759
|
+
function St(s, t, e, i) {
|
|
760
|
+
const r = s.input;
|
|
761
|
+
if (s.type === "multi-line-text")
|
|
762
|
+
return h`
|
|
802
763
|
<textarea
|
|
803
764
|
class="starter-component-control"
|
|
804
765
|
.value=${typeof t == "string" ? t : ""}
|
|
805
|
-
?disabled=${
|
|
806
|
-
placeholder=${typeof
|
|
807
|
-
@input=${(
|
|
808
|
-
|
|
809
|
-
|
|
766
|
+
?disabled=${e}
|
|
767
|
+
placeholder=${typeof r.placeholder == "string" ? r.placeholder : ""}
|
|
768
|
+
@input=${(o) => {
|
|
769
|
+
i(o.target.value);
|
|
770
|
+
}}
|
|
810
771
|
></textarea>
|
|
811
772
|
`;
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
773
|
+
if (s.type === "dropdown") {
|
|
774
|
+
const o = Array.isArray(r.options) ? r.options : [], l = r.multiple === !0;
|
|
775
|
+
return h`
|
|
815
776
|
<select
|
|
816
777
|
class="starter-component-control"
|
|
817
|
-
?disabled=${
|
|
818
|
-
multiple=${
|
|
819
|
-
.value=${
|
|
820
|
-
@change=${(
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
778
|
+
?disabled=${e}
|
|
779
|
+
multiple=${l}
|
|
780
|
+
.value=${l ? void 0 : typeof t == "string" ? t : ""}
|
|
781
|
+
@change=${(a) => {
|
|
782
|
+
const d = a.target;
|
|
783
|
+
i(l ? Array.from(d.selectedOptions).map((u) => u.value) : d.value);
|
|
784
|
+
}}
|
|
824
785
|
>
|
|
825
|
-
${
|
|
786
|
+
${o.map(
|
|
787
|
+
(a) => h`
|
|
826
788
|
<option
|
|
827
|
-
value=${String(
|
|
828
|
-
?disabled=${
|
|
789
|
+
value=${String(a.value ?? "")}
|
|
790
|
+
?disabled=${a.disabled === !0}
|
|
829
791
|
>
|
|
830
|
-
${String(
|
|
792
|
+
${String(a.label ?? a.value ?? "")}
|
|
831
793
|
</option>
|
|
832
|
-
`
|
|
794
|
+
`
|
|
795
|
+
)}
|
|
833
796
|
</select>
|
|
834
797
|
`;
|
|
835
|
-
|
|
836
|
-
|
|
798
|
+
}
|
|
799
|
+
const n = typeof r.inputType == "string" ? r.inputType : s.type === "email" ? "email" : s.type === "phone" ? "tel" : s.type === "number" ? "number" : "text";
|
|
800
|
+
return h`
|
|
837
801
|
<input
|
|
838
802
|
class="starter-component-control"
|
|
839
|
-
type=${
|
|
803
|
+
type=${n}
|
|
840
804
|
.value=${typeof t == "string" ? t : ""}
|
|
841
|
-
?disabled=${
|
|
842
|
-
placeholder=${typeof
|
|
843
|
-
@input=${(
|
|
844
|
-
|
|
845
|
-
|
|
805
|
+
?disabled=${e}
|
|
806
|
+
placeholder=${typeof r.placeholder == "string" ? r.placeholder : ""}
|
|
807
|
+
@input=${(o) => {
|
|
808
|
+
i(o.target.value);
|
|
809
|
+
}}
|
|
846
810
|
/>
|
|
847
811
|
`;
|
|
848
812
|
}
|
|
849
|
-
function
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
813
|
+
function Ge(s, t) {
|
|
814
|
+
const { field: e, value: i, errorKey: r, disabled: n, setValue: o } = t, l = e.input, a = Vt(e);
|
|
815
|
+
if (Wt(e))
|
|
816
|
+
return Ke(s, t);
|
|
817
|
+
if (qt(e))
|
|
818
|
+
return Ze(s, t);
|
|
819
|
+
if (Gt(e))
|
|
820
|
+
return Be(e, i, n, o);
|
|
821
|
+
if (a === "signature")
|
|
822
|
+
return h`<formie-internal-signature
|
|
823
|
+
.field=${e}
|
|
824
|
+
.modules=${s.state.definition.modules}
|
|
825
|
+
.value=${typeof i == "string" ? i : ""}
|
|
826
|
+
?disabled=${n}
|
|
827
|
+
@formie-control-value-change=${(d) => {
|
|
828
|
+
o(d.detail);
|
|
829
|
+
}}
|
|
862
830
|
></formie-internal-signature>`;
|
|
863
|
-
|
|
864
|
-
|
|
831
|
+
if (a === "multi-line-text" || a === "dropdown")
|
|
832
|
+
return St(e, i, n, o);
|
|
833
|
+
if (a === "radio") {
|
|
834
|
+
const d = Array.isArray(l.options) ? l.options : [];
|
|
835
|
+
return h`
|
|
865
836
|
<div class="flex flex-col gap-2">
|
|
866
|
-
${
|
|
867
|
-
|
|
868
|
-
|
|
837
|
+
${d.map((u) => {
|
|
838
|
+
const c = String(u.value ?? "");
|
|
839
|
+
return h`
|
|
869
840
|
<label class="flex items-center gap-2 text-sm text-slate-800">
|
|
870
841
|
<input
|
|
871
842
|
type="radio"
|
|
872
|
-
name=${`${
|
|
873
|
-
.checked=${
|
|
874
|
-
?disabled=${
|
|
843
|
+
name=${`${e.id}-radio`}
|
|
844
|
+
.checked=${i === c}
|
|
845
|
+
?disabled=${n}
|
|
875
846
|
@change=${() => {
|
|
876
|
-
|
|
877
|
-
|
|
847
|
+
o(c);
|
|
848
|
+
}}
|
|
878
849
|
/>
|
|
879
|
-
<span>${String(
|
|
850
|
+
<span>${String(u.label ?? c)}</span>
|
|
880
851
|
</label>
|
|
881
852
|
`;
|
|
882
|
-
|
|
853
|
+
})}
|
|
883
854
|
</div>
|
|
884
855
|
`;
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
856
|
+
}
|
|
857
|
+
if (a === "checkboxes") {
|
|
858
|
+
const d = Array.isArray(l.options) ? l.options : [], u = Array.isArray(i) ? i.map((c) => String(c)) : [];
|
|
859
|
+
return h`
|
|
888
860
|
<div class="flex flex-col gap-2">
|
|
889
|
-
${
|
|
890
|
-
|
|
891
|
-
|
|
861
|
+
${d.map((c) => {
|
|
862
|
+
const f = String(c.value ?? ""), m = u.includes(f);
|
|
863
|
+
return h`
|
|
892
864
|
<label class="flex items-center gap-2 text-sm text-slate-800">
|
|
893
865
|
<input
|
|
894
866
|
type="checkbox"
|
|
895
|
-
.checked=${
|
|
896
|
-
?disabled=${
|
|
867
|
+
.checked=${m}
|
|
868
|
+
?disabled=${n}
|
|
897
869
|
@change=${() => {
|
|
898
|
-
|
|
899
|
-
|
|
870
|
+
const g = m ? u.filter((x) => x !== f) : [...u, f];
|
|
871
|
+
o(g);
|
|
872
|
+
}}
|
|
900
873
|
/>
|
|
901
|
-
<span>${String(
|
|
874
|
+
<span>${String(c.label ?? f)}</span>
|
|
902
875
|
</label>
|
|
903
876
|
`;
|
|
904
|
-
|
|
877
|
+
})}
|
|
905
878
|
</div>
|
|
906
879
|
`;
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
880
|
+
}
|
|
881
|
+
if (a === "agree") {
|
|
882
|
+
const d = typeof l.descriptionHtml == "string" ? l.descriptionHtml : null;
|
|
883
|
+
return h`
|
|
911
884
|
<label class="flex items-start gap-2 text-sm text-slate-800">
|
|
912
885
|
<input
|
|
913
886
|
type="checkbox"
|
|
914
|
-
.checked=${
|
|
915
|
-
?disabled=${
|
|
916
|
-
@change=${(
|
|
917
|
-
|
|
918
|
-
|
|
887
|
+
.checked=${i === !0}
|
|
888
|
+
?disabled=${n}
|
|
889
|
+
@change=${(u) => {
|
|
890
|
+
o(u.target.checked);
|
|
891
|
+
}}
|
|
919
892
|
/>
|
|
920
|
-
<span>${
|
|
893
|
+
<span>${d ? ze(d) : e.label ?? ""}</span>
|
|
921
894
|
</label>
|
|
922
895
|
`;
|
|
923
|
-
|
|
924
|
-
|
|
896
|
+
}
|
|
897
|
+
return xt(a) ? St(e, i, n, o) : h`<div class="rounded-xl border border-amber-200 bg-amber-50 p-3 text-sm text-amber-900">
|
|
925
898
|
Unknown field type:
|
|
926
|
-
${String(
|
|
899
|
+
${String(e.meta?.fieldType ?? e.type)}
|
|
927
900
|
</div>`;
|
|
928
901
|
}
|
|
929
|
-
function
|
|
930
|
-
|
|
931
|
-
|
|
902
|
+
function Be(s, t, e, i) {
|
|
903
|
+
const r = s.input, n = Array.isArray(t) ? t : [], o = r.multiple === !0, l = n.map((a, d) => a && typeof a == "object" && "name" in a && typeof a.name == "string" ? a.name : a && typeof a == "object" && "filename" in a && typeof a.filename == "string" ? a.filename : a && typeof a == "object" && "assetId" in a && typeof a.assetId == "number" ? `Asset #${a.assetId}` : `File ${d + 1}`);
|
|
904
|
+
return h`
|
|
932
905
|
<div class="grid gap-2">
|
|
933
906
|
<input
|
|
934
907
|
type="file"
|
|
935
908
|
class="starter-component-control"
|
|
936
|
-
?disabled=${
|
|
909
|
+
?disabled=${e}
|
|
937
910
|
multiple=${o}
|
|
938
|
-
@change=${(
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
911
|
+
@change=${(a) => {
|
|
912
|
+
const d = a.target;
|
|
913
|
+
i(Array.from(d.files || []));
|
|
914
|
+
}}
|
|
942
915
|
/>
|
|
943
|
-
${
|
|
944
|
-
${
|
|
945
|
-
</ul>` :
|
|
916
|
+
${l.length > 0 ? h`<ul class="grid gap-1 text-sm text-slate-600">
|
|
917
|
+
${l.map((a) => h`<li>${a}</li>`)}
|
|
918
|
+
</ul>` : p}
|
|
946
919
|
</div>
|
|
947
920
|
`;
|
|
948
921
|
}
|
|
949
|
-
function
|
|
950
|
-
|
|
951
|
-
|
|
922
|
+
function Ke(s, t) {
|
|
923
|
+
const { field: e, value: i, errorKey: r, disabled: n, setValue: o } = t, l = Bt(e), a = i && typeof i == "object" ? i : {};
|
|
924
|
+
return l.length === 0 ? h`<div class="text-sm text-amber-800">Composite field has no parts.</div>` : h`
|
|
952
925
|
<div class="starter-component-name-grid">
|
|
953
|
-
${
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
926
|
+
${l.filter((d) => d.meta?.hidden !== !0).map((d) => {
|
|
927
|
+
const u = `${r}.${d.handle}`;
|
|
928
|
+
return lt(
|
|
929
|
+
s,
|
|
930
|
+
{
|
|
931
|
+
field: d,
|
|
932
|
+
value: a[d.handle],
|
|
933
|
+
errors: s.state.errors.fields[u] || [],
|
|
934
|
+
errorKey: u,
|
|
935
|
+
disabled: n || d.meta?.disabled === !0,
|
|
936
|
+
setValue(c) {
|
|
937
|
+
o({
|
|
938
|
+
...a,
|
|
939
|
+
[d.handle]: c
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
"compositePart"
|
|
944
|
+
);
|
|
945
|
+
})}
|
|
969
946
|
</div>
|
|
970
947
|
`;
|
|
971
948
|
}
|
|
972
|
-
function
|
|
973
|
-
|
|
974
|
-
|
|
949
|
+
function Ze(s, t) {
|
|
950
|
+
const { field: e, value: i, errorKey: r, disabled: n, setValue: o } = t, l = Kt(e), a = Array.isArray(i) ? i : [], d = e.input, u = Number(d.minRows ?? 0) || 0, c = Number(d.maxRows ?? 0) || 0, f = !n && (c <= 0 || a.length < c);
|
|
951
|
+
return l.length === 0 ? h`<div class="text-sm text-amber-800">Repeater has no row layout.</div>` : h`
|
|
975
952
|
<div class="grid gap-4" data-formie-repeater-container>
|
|
976
|
-
${
|
|
953
|
+
${a.map((m, g) => h`
|
|
977
954
|
<div class="rounded-xl border border-slate-200 p-4" data-formie-repeater-item>
|
|
978
|
-
${
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
} : r));
|
|
983
|
-
}))}
|
|
955
|
+
${l.map((x, ht) => Je(s, x, m, `${r}.${g}`, n, (zt, Ft) => {
|
|
956
|
+
const Dt = a.map((ct, jt) => jt !== g ? ct : { ...ct, [zt.handle]: Ft });
|
|
957
|
+
o(Dt);
|
|
958
|
+
}))}
|
|
984
959
|
<button
|
|
985
960
|
type="button"
|
|
986
961
|
class="mt-2 rounded-lg border border-slate-200 px-3 py-1.5 text-sm font-medium text-slate-700"
|
|
987
|
-
?disabled=${
|
|
962
|
+
?disabled=${n || u > 0 && a.length <= u}
|
|
988
963
|
@click=${() => {
|
|
989
|
-
|
|
990
|
-
|
|
964
|
+
o(a.filter((x, ht) => ht !== g));
|
|
965
|
+
}}
|
|
991
966
|
>
|
|
992
967
|
Remove
|
|
993
968
|
</button>
|
|
@@ -996,486 +971,606 @@ function wt(e, t) {
|
|
|
996
971
|
<button
|
|
997
972
|
type="button"
|
|
998
973
|
class="rounded-xl border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-slate-700 shadow-sm"
|
|
999
|
-
?disabled=${!
|
|
974
|
+
?disabled=${!f}
|
|
1000
975
|
@click=${() => {
|
|
1001
|
-
|
|
1002
|
-
|
|
976
|
+
o([...a, Zt(e)]);
|
|
977
|
+
}}
|
|
1003
978
|
>
|
|
1004
|
-
${String(
|
|
979
|
+
${String(d.addLabel ?? "Add another row")}
|
|
1005
980
|
</button>
|
|
1006
981
|
</div>
|
|
1007
982
|
`;
|
|
1008
983
|
}
|
|
1009
|
-
function
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
setValue: f
|
|
1018
|
-
}), n);
|
|
984
|
+
function lt(s, t, e = "default") {
|
|
985
|
+
const { field: i, value: r, errors: n, errorKey: o, disabled: l, setValue: a } = t, u = s.state.fieldStates[i.id]?.hidden === !0;
|
|
986
|
+
if (u)
|
|
987
|
+
return h``;
|
|
988
|
+
const c = Vt(i), f = s.registry.fieldControls[i.type] || s.registry.fieldControls[c] || null, m = (x) => {
|
|
989
|
+
a(x), s.host.requestUpdate();
|
|
990
|
+
}, g = f ? De(s, f, i, r, o, l, u, m) : Ge(s, { ...t, setValue: m });
|
|
991
|
+
return je(s, i, n, g, e);
|
|
1019
992
|
}
|
|
1020
|
-
function
|
|
1021
|
-
|
|
993
|
+
function Je(s, t, e, i, r, n) {
|
|
994
|
+
return h`
|
|
1022
995
|
<div class="starter-core-row grid gap-4">
|
|
1023
|
-
${t.fields.map((
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
996
|
+
${t.fields.map((o) => {
|
|
997
|
+
const l = `${i}.${o.handle}`;
|
|
998
|
+
return lt(s, {
|
|
999
|
+
field: o,
|
|
1000
|
+
value: e[o.handle],
|
|
1001
|
+
errors: s.state.errors.fields[l] || [],
|
|
1002
|
+
errorKey: l,
|
|
1003
|
+
disabled: r === !0 || s.state.fieldStates[o.id]?.disabled === !0,
|
|
1004
|
+
setValue(a) {
|
|
1005
|
+
n(o, a);
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
})}
|
|
1036
1009
|
</div>
|
|
1037
1010
|
`;
|
|
1038
1011
|
}
|
|
1039
|
-
function
|
|
1040
|
-
|
|
1012
|
+
function Qe(s, t) {
|
|
1013
|
+
return h`
|
|
1041
1014
|
<div class="starter-core-row grid gap-4">
|
|
1042
|
-
${t.fields.map((
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1015
|
+
${t.fields.map((e) => lt(s, {
|
|
1016
|
+
field: e,
|
|
1017
|
+
value: s.state.values[e.id],
|
|
1018
|
+
errors: s.state.errors.fields[e.id] || [],
|
|
1019
|
+
errorKey: e.id,
|
|
1020
|
+
disabled: s.state.fieldStates[e.id]?.disabled === !0,
|
|
1021
|
+
setValue(i) {
|
|
1022
|
+
s.instance.setValue(e.id, i);
|
|
1023
|
+
}
|
|
1024
|
+
}))}
|
|
1052
1025
|
</div>
|
|
1053
1026
|
`;
|
|
1054
1027
|
}
|
|
1055
|
-
function
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1028
|
+
function Xe(s) {
|
|
1029
|
+
const t = s.state.definition.pages.find((r) => r.id === s.state.currentPageId);
|
|
1030
|
+
if (!t)
|
|
1031
|
+
return h``;
|
|
1032
|
+
const e = s.registry.regions.pageActions;
|
|
1033
|
+
if (e) {
|
|
1034
|
+
const r = at(e);
|
|
1035
|
+
return L`<${r}
|
|
1062
1036
|
.page=${t}
|
|
1063
|
-
.state=${
|
|
1064
|
-
.instance=${
|
|
1037
|
+
.state=${s.state}
|
|
1038
|
+
.instance=${s.instance}
|
|
1065
1039
|
></${r}>`;
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
${t.actions.secondary.map((t) => j`
|
|
1040
|
+
}
|
|
1041
|
+
const i = t.actions.secondary.map(
|
|
1042
|
+
(r) => h`
|
|
1070
1043
|
<button
|
|
1071
1044
|
type="button"
|
|
1072
1045
|
@click=${() => {
|
|
1073
|
-
|
|
1074
|
-
|
|
1046
|
+
s.instance.submit(r.type);
|
|
1047
|
+
}}
|
|
1075
1048
|
>
|
|
1076
|
-
${
|
|
1049
|
+
${r.label}
|
|
1077
1050
|
</button>
|
|
1078
|
-
`
|
|
1051
|
+
`
|
|
1052
|
+
);
|
|
1053
|
+
return h`
|
|
1054
|
+
<div class="formie-page-actions">
|
|
1055
|
+
${i}
|
|
1079
1056
|
<button type="submit">${t.actions.primary.label}</button>
|
|
1080
1057
|
</div>
|
|
1081
1058
|
`;
|
|
1082
1059
|
}
|
|
1083
|
-
function
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1060
|
+
function Ye(s) {
|
|
1061
|
+
const t = s.state.definition.pages.find((l) => l.id === s.state.currentPageId && s.state.pageStates[l.id]?.hidden !== !0) || s.state.definition.pages.find((l) => s.state.pageStates[l.id]?.hidden !== !0) || s.state.definition.pages[0];
|
|
1062
|
+
if (!t)
|
|
1063
|
+
return h``;
|
|
1064
|
+
const e = s.state.errors.form, i = s.state.lastSubmitResult?.messages.error, r = !!i && !e.includes(i), n = h`
|
|
1065
|
+
${e.length > 0 ? h`<div class="starter-core-msg starter-core-msg-error mb-4 rounded-2xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800">
|
|
1088
1066
|
<ul class="list-inside list-disc">
|
|
1089
|
-
${
|
|
1067
|
+
${e.map((l) => h`<li>${l}</li>`)}
|
|
1090
1068
|
</ul>
|
|
1091
|
-
</div>` :
|
|
1092
|
-
${
|
|
1093
|
-
${
|
|
1094
|
-
</div>` :
|
|
1095
|
-
${
|
|
1096
|
-
${
|
|
1097
|
-
`, o =
|
|
1098
|
-
|
|
1069
|
+
</div>` : p}
|
|
1070
|
+
${s.state.lastSubmitResult?.messages.notice ? h`<div class="mb-4 rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-800">
|
|
1071
|
+
${s.state.lastSubmitResult.messages.notice}
|
|
1072
|
+
</div>` : p}
|
|
1073
|
+
${r ? h`<div class="mb-4 rounded-2xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800">${i}</div>` : p}
|
|
1074
|
+
${ts(s, t)}
|
|
1075
|
+
`, o = s.state.session.tokens.render ?? "";
|
|
1076
|
+
return h`
|
|
1099
1077
|
<form
|
|
1100
|
-
class=${
|
|
1101
|
-
data-formie-definition=${
|
|
1078
|
+
class=${s.formClass || "starter-component-form starter-core-preview text-slate-900"}
|
|
1079
|
+
data-formie-definition=${s.state.definition.handle}
|
|
1102
1080
|
data-formie-render-id=${o}
|
|
1103
|
-
@submit=${(
|
|
1104
|
-
|
|
1105
|
-
|
|
1081
|
+
@submit=${(l) => {
|
|
1082
|
+
l.preventDefault(), s.instance.submit();
|
|
1083
|
+
}}
|
|
1106
1084
|
>
|
|
1107
|
-
${
|
|
1085
|
+
${n}
|
|
1108
1086
|
</form>
|
|
1109
1087
|
`;
|
|
1110
1088
|
}
|
|
1111
|
-
function
|
|
1112
|
-
|
|
1089
|
+
function ts(s, t) {
|
|
1090
|
+
const e = s.registry.regions.page, i = h`
|
|
1113
1091
|
<div class="starter-core-fields grid gap-4">
|
|
1114
|
-
${t.rows.map((
|
|
1092
|
+
${t.rows.map((r) => Qe(s, r))}
|
|
1115
1093
|
</div>
|
|
1116
|
-
${
|
|
1094
|
+
${Xe(s)}
|
|
1117
1095
|
`;
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1096
|
+
if (e) {
|
|
1097
|
+
const r = at(e);
|
|
1098
|
+
return L`<${r} .page=${t} .state=${s.state}>${i}</${r}>`;
|
|
1099
|
+
}
|
|
1100
|
+
return h`
|
|
1123
1101
|
<section data-page-id=${t.id} class="starter-core-page space-y-4">
|
|
1124
|
-
${
|
|
1102
|
+
${i}
|
|
1125
1103
|
</section>
|
|
1126
1104
|
`;
|
|
1127
1105
|
}
|
|
1128
|
-
function
|
|
1129
|
-
|
|
1106
|
+
function es(s = "Loading form…") {
|
|
1107
|
+
return h`<div class="mt-3 text-sm text-slate-500">${s}</div>`;
|
|
1130
1108
|
}
|
|
1131
|
-
function
|
|
1132
|
-
|
|
1109
|
+
function ss(s) {
|
|
1110
|
+
return h`<div class="mb-4 rounded-2xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800">${s}</div>`;
|
|
1133
1111
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1112
|
+
var is = Object.defineProperty, v = (s, t, e, i) => {
|
|
1113
|
+
for (var r = void 0, n = s.length - 1, o; n >= 0; n--)
|
|
1114
|
+
(o = s[n]) && (r = o(t, e, r) || r);
|
|
1115
|
+
return r && is(t, e, r), r;
|
|
1116
|
+
};
|
|
1117
|
+
function Ct(s) {
|
|
1118
|
+
return P(s), Nt(s);
|
|
1141
1119
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1120
|
+
class b extends M {
|
|
1121
|
+
constructor() {
|
|
1122
|
+
super(...arguments), this.endpoint = "", this.formHandle = "", this.transport = "rest", this.fetchCredentials = "same-origin", this.formClass = "", this.loadingMessage = "Loading form…", this.loadError = null, this.booting = !1, this.snapshot = null, this.instance = null, this.unsubscribers = [], this.loadGeneration = 0;
|
|
1123
|
+
}
|
|
1124
|
+
createRenderRoot() {
|
|
1125
|
+
return this;
|
|
1126
|
+
}
|
|
1127
|
+
disconnectedCallback() {
|
|
1128
|
+
super.disconnectedCallback(), this.teardown();
|
|
1129
|
+
}
|
|
1130
|
+
connectedCallback() {
|
|
1131
|
+
super.connectedCallback(), this.bootstrap(!1);
|
|
1132
|
+
}
|
|
1133
|
+
willUpdate(t) {
|
|
1134
|
+
if (super.willUpdate(t), !this.hasUpdated)
|
|
1135
|
+
return;
|
|
1136
|
+
["endpoint", "formHandle", "siteId", "transport", "fetchCredentials"].some((i) => t.has(i)) && this.bootstrap(!0);
|
|
1137
|
+
}
|
|
1138
|
+
/** Form instance after a successful load; `null` while loading or after teardown. */
|
|
1139
|
+
getFormieInstance() {
|
|
1140
|
+
return this.instance;
|
|
1141
|
+
}
|
|
1142
|
+
/** Reload envelope + form instance from the server. */
|
|
1143
|
+
async reload() {
|
|
1144
|
+
await this.bootstrap(!0);
|
|
1145
|
+
}
|
|
1146
|
+
get resolvedRegistry() {
|
|
1147
|
+
return this.registry ?? Pe();
|
|
1148
|
+
}
|
|
1149
|
+
teardown() {
|
|
1150
|
+
for (const t of this.unsubscribers)
|
|
1151
|
+
t();
|
|
1152
|
+
this.unsubscribers = [], this.instance?.destroy(), this.instance = null, this.snapshot = null;
|
|
1153
|
+
}
|
|
1154
|
+
async bootstrap(t) {
|
|
1155
|
+
const e = ++this.loadGeneration, i = this.formHandle.trim(), r = this.endpoint.trim();
|
|
1156
|
+
if (!i) {
|
|
1157
|
+
this.teardown(), this.booting = !1, this.loadError = "Set `form-handle` on <formie-core-form>.";
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
if (t)
|
|
1161
|
+
this.teardown();
|
|
1162
|
+
else if (this.instance)
|
|
1163
|
+
return;
|
|
1164
|
+
this.booting = !0, this.loadError = null;
|
|
1165
|
+
const n = this.fetchCredentials, o = this.siteId;
|
|
1166
|
+
try {
|
|
1167
|
+
const l = {
|
|
1168
|
+
endpoint: r,
|
|
1169
|
+
formHandle: i,
|
|
1170
|
+
...o !== void 0 ? { siteId: o } : {},
|
|
1171
|
+
credentials: n
|
|
1172
|
+
}, a = this.transport === "graphql" ? await Jt(l) : await Qt(l);
|
|
1173
|
+
if (e !== this.loadGeneration)
|
|
1174
|
+
return;
|
|
1175
|
+
const d = this.transport === "graphql" ? Xt(l) : Yt(l), u = te({ envelope: a, transport: d });
|
|
1176
|
+
this.instance = u;
|
|
1177
|
+
for (const c of ee) {
|
|
1178
|
+
const f = u.on(c, (m) => {
|
|
1179
|
+
this.dispatchEvent(
|
|
1180
|
+
new CustomEvent(c, {
|
|
1181
|
+
detail: m,
|
|
1182
|
+
bubbles: !0,
|
|
1183
|
+
composed: !0
|
|
1184
|
+
})
|
|
1185
|
+
);
|
|
1186
|
+
});
|
|
1187
|
+
this.unsubscribers.push(f);
|
|
1188
|
+
}
|
|
1189
|
+
this.unsubscribers.push(
|
|
1190
|
+
u.subscribe((c) => {
|
|
1191
|
+
this.snapshot = c, this.requestUpdate();
|
|
1192
|
+
})
|
|
1193
|
+
), this.booting = !1;
|
|
1194
|
+
} catch (l) {
|
|
1195
|
+
if (e !== this.loadGeneration)
|
|
1196
|
+
return;
|
|
1197
|
+
this.teardown(), this.booting = !1, this.loadError = l instanceof Error ? l.message : "Unable to load the form.";
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
render() {
|
|
1201
|
+
const t = this.resolvedRegistry;
|
|
1202
|
+
if (this.loadError) {
|
|
1203
|
+
const e = t.regions.errorSummary;
|
|
1204
|
+
if (e) {
|
|
1205
|
+
const i = Ct(e);
|
|
1206
|
+
return L`<${i} .errors=${[this.loadError]} .kind=${"load"}></${i}>`;
|
|
1207
|
+
}
|
|
1208
|
+
return ss(this.loadError);
|
|
1209
|
+
}
|
|
1210
|
+
if (this.booting || !this.snapshot || !this.instance) {
|
|
1211
|
+
const e = t.regions.loading;
|
|
1212
|
+
if (e) {
|
|
1213
|
+
const i = Ct(e);
|
|
1214
|
+
return L`<${i} .message=${this.loadingMessage}></${i}>`;
|
|
1215
|
+
}
|
|
1216
|
+
return es(this.loadingMessage);
|
|
1217
|
+
}
|
|
1218
|
+
return Ye({
|
|
1219
|
+
registry: t,
|
|
1220
|
+
state: this.snapshot,
|
|
1221
|
+
instance: this.instance,
|
|
1222
|
+
host: this,
|
|
1223
|
+
formClass: this.formClass || ""
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1146
1226
|
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
composed: !0
|
|
1211
|
-
}));
|
|
1212
|
-
});
|
|
1213
|
-
this.unsubscribers.push(e);
|
|
1214
|
-
}
|
|
1215
|
-
this.unsubscribers.push(p.subscribe((e) => {
|
|
1216
|
-
this.snapshot = e, this.requestUpdate();
|
|
1217
|
-
})), this.booting = !1;
|
|
1218
|
-
} catch (e) {
|
|
1219
|
-
if (i !== this.loadGeneration) return;
|
|
1220
|
-
this.teardown(), this.booting = !1, this.loadError = e instanceof Error ? e.message : "Unable to load the form.";
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
render() {
|
|
1224
|
-
let e = this.resolvedRegistry;
|
|
1225
|
-
if (this.loadError) {
|
|
1226
|
-
let t = e.regions.errorSummary;
|
|
1227
|
-
if (t) {
|
|
1228
|
-
let e = Nt(t);
|
|
1229
|
-
return V`<${e} .errors=${[this.loadError]} .kind=${"load"}></${e}>`;
|
|
1230
|
-
}
|
|
1231
|
-
return Mt(this.loadError);
|
|
1232
|
-
}
|
|
1233
|
-
if (this.booting || !this.snapshot || !this.instance) {
|
|
1234
|
-
let t = e.regions.loading;
|
|
1235
|
-
if (t) {
|
|
1236
|
-
let e = Nt(t);
|
|
1237
|
-
return V`<${e} .message=${this.loadingMessage}></${e}>`;
|
|
1238
|
-
}
|
|
1239
|
-
return jt(this.loadingMessage);
|
|
1240
|
-
}
|
|
1241
|
-
return kt({
|
|
1242
|
-
registry: e,
|
|
1243
|
-
state: this.snapshot,
|
|
1244
|
-
instance: this.instance,
|
|
1245
|
-
host: this,
|
|
1246
|
-
formClass: this.formClass || ""
|
|
1247
|
-
});
|
|
1248
|
-
}
|
|
1249
|
-
};
|
|
1250
|
-
Y([H({ type: String })], X.prototype, "endpoint", void 0), Y([H({
|
|
1251
|
-
type: String,
|
|
1252
|
-
attribute: "form-handle"
|
|
1253
|
-
})], X.prototype, "formHandle", void 0), Y([H({
|
|
1254
|
-
type: Number,
|
|
1255
|
-
attribute: "site-id",
|
|
1256
|
-
converter: { fromAttribute(e) {
|
|
1257
|
-
if (e == null || e === "") return;
|
|
1258
|
-
let t = Number(e);
|
|
1259
|
-
return Number.isFinite(t) ? t : void 0;
|
|
1260
|
-
} }
|
|
1261
|
-
})], X.prototype, "siteId", void 0), Y([H({
|
|
1262
|
-
attribute: "transport",
|
|
1263
|
-
converter: { fromAttribute(e) {
|
|
1264
|
-
return (e ?? "rest").toLowerCase() === "graphql" ? "graphql" : "rest";
|
|
1265
|
-
} }
|
|
1266
|
-
})], X.prototype, "transport", void 0), Y([H({
|
|
1267
|
-
attribute: "fetch-credentials",
|
|
1268
|
-
converter: { fromAttribute(e) {
|
|
1269
|
-
return e === "omit" || e === "same-origin" || e === "include" ? e : "same-origin";
|
|
1270
|
-
} }
|
|
1271
|
-
})], X.prototype, "fetchCredentials", void 0), Y([H({
|
|
1272
|
-
type: String,
|
|
1273
|
-
attribute: "form-class"
|
|
1274
|
-
})], X.prototype, "formClass", void 0), Y([H({
|
|
1275
|
-
type: String,
|
|
1276
|
-
attribute: "loading-message"
|
|
1277
|
-
})], X.prototype, "loadingMessage", void 0), Y([H({ attribute: !1 })], X.prototype, "registry", void 0), Y([U()], X.prototype, "loadError", void 0), Y([U()], X.prototype, "booting", void 0), Y([U()], X.prototype, "snapshot", void 0);
|
|
1278
|
-
//#endregion
|
|
1279
|
-
//#region src/form-element.ts
|
|
1280
|
-
function Pt(e) {
|
|
1281
|
-
if (e == null || e === "") return !1;
|
|
1282
|
-
let t = e.toLowerCase();
|
|
1283
|
-
return t === "true" || t === "1";
|
|
1227
|
+
v([
|
|
1228
|
+
$({ type: String })
|
|
1229
|
+
], b.prototype, "endpoint");
|
|
1230
|
+
v([
|
|
1231
|
+
$({ type: String, attribute: "form-handle" })
|
|
1232
|
+
], b.prototype, "formHandle");
|
|
1233
|
+
v([
|
|
1234
|
+
$({
|
|
1235
|
+
type: Number,
|
|
1236
|
+
attribute: "site-id",
|
|
1237
|
+
converter: {
|
|
1238
|
+
fromAttribute(s) {
|
|
1239
|
+
if (s == null || s === "")
|
|
1240
|
+
return;
|
|
1241
|
+
const t = Number(s);
|
|
1242
|
+
return Number.isFinite(t) ? t : void 0;
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
})
|
|
1246
|
+
], b.prototype, "siteId");
|
|
1247
|
+
v([
|
|
1248
|
+
$({
|
|
1249
|
+
attribute: "transport",
|
|
1250
|
+
converter: {
|
|
1251
|
+
fromAttribute(s) {
|
|
1252
|
+
return (s ?? "rest").toLowerCase() === "graphql" ? "graphql" : "rest";
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
})
|
|
1256
|
+
], b.prototype, "transport");
|
|
1257
|
+
v([
|
|
1258
|
+
$({
|
|
1259
|
+
attribute: "fetch-credentials",
|
|
1260
|
+
converter: {
|
|
1261
|
+
fromAttribute(s) {
|
|
1262
|
+
return s === "omit" || s === "same-origin" || s === "include" ? s : "same-origin";
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
})
|
|
1266
|
+
], b.prototype, "fetchCredentials");
|
|
1267
|
+
v([
|
|
1268
|
+
$({ type: String, attribute: "form-class" })
|
|
1269
|
+
], b.prototype, "formClass");
|
|
1270
|
+
v([
|
|
1271
|
+
$({ type: String, attribute: "loading-message" })
|
|
1272
|
+
], b.prototype, "loadingMessage");
|
|
1273
|
+
v([
|
|
1274
|
+
$({ attribute: !1 })
|
|
1275
|
+
], b.prototype, "registry");
|
|
1276
|
+
v([
|
|
1277
|
+
K()
|
|
1278
|
+
], b.prototype, "loadError");
|
|
1279
|
+
v([
|
|
1280
|
+
K()
|
|
1281
|
+
], b.prototype, "booting");
|
|
1282
|
+
v([
|
|
1283
|
+
K()
|
|
1284
|
+
], b.prototype, "snapshot");
|
|
1285
|
+
function X(s) {
|
|
1286
|
+
if (s == null || s === "")
|
|
1287
|
+
return !1;
|
|
1288
|
+
const t = s.toLowerCase();
|
|
1289
|
+
return t === "true" || t === "1";
|
|
1284
1290
|
}
|
|
1285
|
-
function
|
|
1286
|
-
|
|
1291
|
+
function y(s, t, e) {
|
|
1292
|
+
typeof e == "string" && e.length > 0 ? s.setAttribute(t, e) : s.removeAttribute(t);
|
|
1287
1293
|
}
|
|
1288
|
-
function
|
|
1289
|
-
|
|
1294
|
+
function Y(s, t, e) {
|
|
1295
|
+
e === !0 ? s.setAttribute(t, "true") : s.removeAttribute(t);
|
|
1290
1296
|
}
|
|
1291
|
-
function
|
|
1292
|
-
|
|
1297
|
+
function rs(s, t) {
|
|
1298
|
+
return t.startsWith("http") ? t : `${s}${t}`;
|
|
1293
1299
|
}
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1300
|
+
class ns extends HTMLElement {
|
|
1301
|
+
constructor() {
|
|
1302
|
+
super(), this.mountedInstance = null, this.optionState = {}, this.mountScheduled = null, this.eventUnsubs = [];
|
|
1303
|
+
}
|
|
1304
|
+
static get observedAttributes() {
|
|
1305
|
+
return [
|
|
1306
|
+
"mode",
|
|
1307
|
+
"transport",
|
|
1308
|
+
"theme",
|
|
1309
|
+
"form-handle",
|
|
1310
|
+
"endpoint",
|
|
1311
|
+
"refresh-tokens",
|
|
1312
|
+
"static-cache",
|
|
1313
|
+
"locale",
|
|
1314
|
+
"site-id",
|
|
1315
|
+
"auto-visible",
|
|
1316
|
+
"base-url"
|
|
1317
|
+
];
|
|
1318
|
+
}
|
|
1319
|
+
/** Lazily create client + mount container (not in the constructor). */
|
|
1320
|
+
ensureInitialized() {
|
|
1321
|
+
this.mountRoot || (this.client = se(), this.mountRoot = document.createElement("div"));
|
|
1322
|
+
}
|
|
1323
|
+
connectedCallback() {
|
|
1324
|
+
this.ensureInitialized(), this.style.display = "block", this.contains(this.mountRoot) || this.append(this.mountRoot), this.scheduleMount();
|
|
1325
|
+
}
|
|
1326
|
+
disconnectedCallback() {
|
|
1327
|
+
this.unmount();
|
|
1328
|
+
}
|
|
1329
|
+
attributeChangedCallback(t, e, i) {
|
|
1330
|
+
e === i || !this.isConnected || t === "refresh-tokens" && this.optionState.refreshTokens !== void 0 || t === "static-cache" && this.optionState.staticCache !== void 0 || this.scheduleMount();
|
|
1331
|
+
}
|
|
1332
|
+
get baseUrl() {
|
|
1333
|
+
const t = this.getAttribute("base-url");
|
|
1334
|
+
return this.optionState.baseUrl ?? t ?? void 0;
|
|
1335
|
+
}
|
|
1336
|
+
set baseUrl(t) {
|
|
1337
|
+
this.optionState.baseUrl = t, y(this, "base-url", t), this.scheduleMount();
|
|
1338
|
+
}
|
|
1339
|
+
get transport() {
|
|
1340
|
+
const t = this.getAttribute("transport");
|
|
1341
|
+
return this.optionState.transport ?? t ?? void 0;
|
|
1342
|
+
}
|
|
1343
|
+
set transport(t) {
|
|
1344
|
+
this.optionState.transport = t, y(this, "transport", t), this.scheduleMount();
|
|
1345
|
+
}
|
|
1346
|
+
get theme() {
|
|
1347
|
+
const t = this.getAttribute("theme");
|
|
1348
|
+
return this.optionState.theme ?? t ?? void 0;
|
|
1349
|
+
}
|
|
1350
|
+
set theme(t) {
|
|
1351
|
+
this.optionState.theme = t, y(this, "theme", t), this.scheduleMount();
|
|
1352
|
+
}
|
|
1353
|
+
get themeConfig() {
|
|
1354
|
+
return this.optionState.themeConfig;
|
|
1355
|
+
}
|
|
1356
|
+
set themeConfig(t) {
|
|
1357
|
+
this.optionState.themeConfig = t, this.scheduleMount();
|
|
1358
|
+
}
|
|
1359
|
+
get payload() {
|
|
1360
|
+
return this.optionState.payload;
|
|
1361
|
+
}
|
|
1362
|
+
set payload(t) {
|
|
1363
|
+
this.optionState.payload = t, this.scheduleMount();
|
|
1364
|
+
}
|
|
1365
|
+
get formHandle() {
|
|
1366
|
+
const t = this.getAttribute("form-handle");
|
|
1367
|
+
return this.optionState.formHandle ?? t ?? void 0;
|
|
1368
|
+
}
|
|
1369
|
+
set formHandle(t) {
|
|
1370
|
+
this.optionState.formHandle = t, y(this, "form-handle", t), this.scheduleMount();
|
|
1371
|
+
}
|
|
1372
|
+
get endpoint() {
|
|
1373
|
+
const t = this.getAttribute("endpoint");
|
|
1374
|
+
return this.optionState.endpoint ?? t ?? void 0;
|
|
1375
|
+
}
|
|
1376
|
+
set endpoint(t) {
|
|
1377
|
+
this.optionState.endpoint = t, y(this, "endpoint", t), this.scheduleMount();
|
|
1378
|
+
}
|
|
1379
|
+
get staticCache() {
|
|
1380
|
+
return this.optionState.staticCache ?? (this.hasAttribute("static-cache") ? X(this.getAttribute("static-cache")) : void 0);
|
|
1381
|
+
}
|
|
1382
|
+
set staticCache(t) {
|
|
1383
|
+
this.optionState.staticCache = t, Y(this, "static-cache", t), this.scheduleMount();
|
|
1384
|
+
}
|
|
1385
|
+
get refreshTokens() {
|
|
1386
|
+
return this.optionState.refreshTokens ?? (this.hasAttribute("refresh-tokens") ? X(this.getAttribute("refresh-tokens")) : void 0);
|
|
1387
|
+
}
|
|
1388
|
+
set refreshTokens(t) {
|
|
1389
|
+
this.optionState.refreshTokens = t, Y(this, "refresh-tokens", t), this.scheduleMount();
|
|
1390
|
+
}
|
|
1391
|
+
get locale() {
|
|
1392
|
+
const t = this.getAttribute("locale");
|
|
1393
|
+
return this.optionState.locale ?? t ?? void 0;
|
|
1394
|
+
}
|
|
1395
|
+
set locale(t) {
|
|
1396
|
+
this.optionState.locale = t, y(this, "locale", t), this.scheduleMount();
|
|
1397
|
+
}
|
|
1398
|
+
get siteId() {
|
|
1399
|
+
return this.optionState.siteId ?? (this.getAttribute("site-id") ? Number(this.getAttribute("site-id")) : void 0);
|
|
1400
|
+
}
|
|
1401
|
+
set siteId(t) {
|
|
1402
|
+
this.optionState.siteId = t, y(this, "site-id", typeof t == "number" ? String(t) : void 0), this.scheduleMount();
|
|
1403
|
+
}
|
|
1404
|
+
get autoVisible() {
|
|
1405
|
+
return this.optionState.autoVisible ?? (this.hasAttribute("auto-visible") ? X(this.getAttribute("auto-visible")) : void 0);
|
|
1406
|
+
}
|
|
1407
|
+
set autoVisible(t) {
|
|
1408
|
+
this.optionState.autoVisible = t, Y(this, "auto-visible", t), this.scheduleMount();
|
|
1409
|
+
}
|
|
1410
|
+
get mode() {
|
|
1411
|
+
const t = this.getAttribute("mode");
|
|
1412
|
+
return this.optionState.mode ?? t ?? "server-rendered";
|
|
1413
|
+
}
|
|
1414
|
+
set mode(t) {
|
|
1415
|
+
this.optionState.mode = t, y(this, "mode", t), this.scheduleMount();
|
|
1416
|
+
}
|
|
1417
|
+
getInstance() {
|
|
1418
|
+
return this.ensureInitialized(), this.mountedInstance;
|
|
1419
|
+
}
|
|
1420
|
+
async submit(t = "submit") {
|
|
1421
|
+
return this.ensureInitialized(), this.mountedInstance ? this.mountedInstance.submit(t) : null;
|
|
1422
|
+
}
|
|
1423
|
+
buildOptions() {
|
|
1424
|
+
const t = this.baseUrl || "", e = this.transport, i = e === "graphql" ? "/api" : "/actions/formie/server/forms/render", r = rs(t, this.endpoint || i), n = this.staticCache, o = this.refreshTokens;
|
|
1425
|
+
return {
|
|
1426
|
+
mode: this.mode,
|
|
1427
|
+
transport: e,
|
|
1428
|
+
theme: this.theme,
|
|
1429
|
+
themeConfig: this.themeConfig,
|
|
1430
|
+
formHandle: this.formHandle,
|
|
1431
|
+
endpoint: r,
|
|
1432
|
+
payload: this.payload,
|
|
1433
|
+
staticCache: n,
|
|
1434
|
+
refreshTokens: o,
|
|
1435
|
+
locale: this.locale,
|
|
1436
|
+
siteId: this.siteId,
|
|
1437
|
+
autoVisible: this.autoVisible ?? !1
|
|
1438
|
+
};
|
|
1439
|
+
}
|
|
1440
|
+
bindInstanceEvents(t) {
|
|
1441
|
+
this.eventUnsubs.forEach((e) => e()), this.eventUnsubs = ie.map((e) => t.on(e, (i) => {
|
|
1442
|
+
this.dispatchEvent(new CustomEvent(e, {
|
|
1443
|
+
detail: i,
|
|
1444
|
+
bubbles: !0,
|
|
1445
|
+
composed: !0
|
|
1446
|
+
}));
|
|
1447
|
+
}));
|
|
1448
|
+
}
|
|
1449
|
+
async scheduleMount() {
|
|
1450
|
+
return this.ensureInitialized(), this.mountScheduled ? this.mountScheduled : (this.mountScheduled = Promise.resolve().then(async () => {
|
|
1451
|
+
this.mountScheduled = null, this.isConnected && await this.mount();
|
|
1452
|
+
}), this.mountScheduled);
|
|
1453
|
+
}
|
|
1454
|
+
async mount() {
|
|
1455
|
+
await this.unmount();
|
|
1456
|
+
const t = await this.client.mount(this.mountRoot, this.buildOptions());
|
|
1457
|
+
this.mountedInstance = t, this.bindInstanceEvents(t), this.dispatchEvent(new CustomEvent("formie-mounted", {
|
|
1458
|
+
detail: {
|
|
1459
|
+
id: t.id,
|
|
1460
|
+
instance: t
|
|
1461
|
+
},
|
|
1462
|
+
bubbles: !0,
|
|
1463
|
+
composed: !0
|
|
1464
|
+
}));
|
|
1465
|
+
}
|
|
1466
|
+
async unmount() {
|
|
1467
|
+
if (this.eventUnsubs.forEach((e) => e()), this.eventUnsubs = [], !this.mountRoot || !this.mountedInstance)
|
|
1468
|
+
return;
|
|
1469
|
+
const t = this.mountedInstance;
|
|
1470
|
+
await this.client.unmount(this.mountRoot), this.mountedInstance = null, this.dispatchEvent(new CustomEvent("formie-unmounted", {
|
|
1471
|
+
detail: {
|
|
1472
|
+
id: t.id
|
|
1473
|
+
},
|
|
1474
|
+
bubbles: !0,
|
|
1475
|
+
composed: !0
|
|
1476
|
+
}));
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
var os = Object.defineProperty, z = (s, t, e, i) => {
|
|
1480
|
+
for (var r = void 0, n = s.length - 1, o; n >= 0; n--)
|
|
1481
|
+
(o = s[n]) && (r = o(t, e, r) || r);
|
|
1482
|
+
return r && os(t, e, r), r;
|
|
1483
|
+
};
|
|
1484
|
+
const dt = class dt extends M {
|
|
1485
|
+
constructor() {
|
|
1486
|
+
super(...arguments), this.modules = [], this.value = "", this.disabled = !1, this.loadError = null, this.pad = null, this.strokeListener = () => {
|
|
1487
|
+
this.emitValue();
|
|
1488
|
+
}, this.onWinResize = () => {
|
|
1489
|
+
const t = this.shadowRoot?.querySelector("canvas");
|
|
1490
|
+
t instanceof HTMLCanvasElement && this.resizeCanvas(t);
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1493
|
+
async firstUpdated() {
|
|
1494
|
+
const t = this.shadowRoot?.querySelector("canvas");
|
|
1495
|
+
if (!(!t || !(t instanceof HTMLCanvasElement)))
|
|
1496
|
+
try {
|
|
1497
|
+
const { default: e } = await import("./signature_pad-CKGlHEaq.js"), i = this.resolveDrawModuleConfig(), r = typeof i?.options == "object" && i.options && typeof i.options.backgroundColor == "string" ? String(i.options.backgroundColor) : "#ffffff", n = typeof i?.options == "object" && i.options && typeof i.options.penColor == "string" ? String(i.options.penColor) : "#000000", o = typeof i?.options == "object" && i.options && Number(i.options.penWeight ?? 2) || 2, l = new e(t, {
|
|
1498
|
+
backgroundColor: r,
|
|
1499
|
+
penColor: n,
|
|
1500
|
+
minWidth: o,
|
|
1501
|
+
maxWidth: o
|
|
1502
|
+
});
|
|
1503
|
+
this.pad = l, l.addEventListener?.("endStroke", this.strokeListener), this.resizeCanvas(t), window.addEventListener("resize", this.onWinResize), this.applySerializedValue();
|
|
1504
|
+
} catch (e) {
|
|
1505
|
+
this.loadError = e instanceof Error ? e.message : "Signature pad failed to load.";
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
disconnectedCallback() {
|
|
1509
|
+
super.disconnectedCallback(), window.removeEventListener("resize", this.onWinResize), this.pad?.removeEventListener && this.pad.removeEventListener("endStroke", this.strokeListener), this.pad = null;
|
|
1510
|
+
}
|
|
1511
|
+
resolveDrawModuleConfig() {
|
|
1512
|
+
const t = new Set(this.field.moduleRefs || []), e = this.modules.find((i) => t.has(i.id) && i.capability === "draw-signature");
|
|
1513
|
+
return e && typeof e.config == "object" && e.config ? e.config : null;
|
|
1514
|
+
}
|
|
1515
|
+
resizeCanvas(t) {
|
|
1516
|
+
const e = Math.max(window.devicePixelRatio || 1, 1), i = Math.max(1, Math.floor(t.clientWidth || 480)), r = 192, n = t.getContext("2d");
|
|
1517
|
+
t.width = i * e, t.height = r * e, n?.scale(e, e), t.style.width = `${i}px`, t.style.height = `${r}px`, this.pad?.fromDataURL?.(this.value || "data:,");
|
|
1518
|
+
}
|
|
1519
|
+
updated(t) {
|
|
1520
|
+
if (t.has("value") && this.pad && this.applySerializedValue(), t.has("disabled") && this.pad) {
|
|
1521
|
+
const e = this.shadowRoot?.querySelector("canvas");
|
|
1522
|
+
e instanceof HTMLElement && (e.style.pointerEvents = this.disabled ? "none" : "");
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
applySerializedValue() {
|
|
1526
|
+
if (this.pad) {
|
|
1527
|
+
if (!this.value) {
|
|
1528
|
+
this.pad.isEmpty() || this.pad.clear();
|
|
1529
|
+
return;
|
|
1530
|
+
}
|
|
1531
|
+
try {
|
|
1532
|
+
this.pad.fromDataURL(this.value);
|
|
1533
|
+
} catch {
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
emitValue() {
|
|
1538
|
+
if (!this.pad || this.pad.isEmpty()) {
|
|
1539
|
+
this.dispatchEvent(
|
|
1540
|
+
new CustomEvent(D, {
|
|
1541
|
+
detail: "",
|
|
1542
|
+
bubbles: !0,
|
|
1543
|
+
composed: !0
|
|
1544
|
+
})
|
|
1545
|
+
);
|
|
1546
|
+
return;
|
|
1547
|
+
}
|
|
1548
|
+
this.dispatchEvent(
|
|
1549
|
+
new CustomEvent(D, {
|
|
1550
|
+
detail: this.pad.toDataURL(),
|
|
1551
|
+
bubbles: !0,
|
|
1552
|
+
composed: !0
|
|
1553
|
+
})
|
|
1554
|
+
);
|
|
1555
|
+
}
|
|
1556
|
+
render() {
|
|
1557
|
+
return this.loadError ? h`<div class="err">${this.loadError}</div>` : h`
|
|
1558
|
+
<div class="wrap">
|
|
1559
|
+
<canvas></canvas>
|
|
1560
|
+
<button type="button" ?disabled=${this.disabled} @click=${() => {
|
|
1561
|
+
this.pad?.clear(), this.dispatchEvent(
|
|
1562
|
+
new CustomEvent(D, {
|
|
1563
|
+
detail: "",
|
|
1564
|
+
bubbles: !0,
|
|
1565
|
+
composed: !0
|
|
1566
|
+
})
|
|
1567
|
+
);
|
|
1568
|
+
}}>Clear</button>
|
|
1569
|
+
</div>
|
|
1570
|
+
`;
|
|
1571
|
+
}
|
|
1572
|
+
};
|
|
1573
|
+
dt.styles = ne`
|
|
1479
1574
|
:host {
|
|
1480
1575
|
display: block;
|
|
1481
1576
|
}
|
|
@@ -1510,87 +1605,40 @@ var It = class extends HTMLElement {
|
|
|
1510
1605
|
color: #b91c1c;
|
|
1511
1606
|
}
|
|
1512
1607
|
`;
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
let e = new Set(this.field.moduleRefs || []), t = this.modules.find((t) => e.has(t.id) && t.capability === "draw-signature");
|
|
1533
|
-
return t && typeof t.config == "object" && t.config ? t.config : null;
|
|
1534
|
-
}
|
|
1535
|
-
resizeCanvas(e) {
|
|
1536
|
-
let t = Math.max(window.devicePixelRatio || 1, 1), n = Math.max(1, Math.floor(e.clientWidth || 480)), r = e.getContext("2d");
|
|
1537
|
-
e.width = n * t, e.height = 192 * t, r?.scale(t, t), e.style.width = `${n}px`, e.style.height = "192px", this.pad?.fromDataURL?.(this.value || "data:,");
|
|
1538
|
-
}
|
|
1539
|
-
updated(e) {
|
|
1540
|
-
if (e.has("value") && this.pad && this.applySerializedValue(), e.has("disabled") && this.pad) {
|
|
1541
|
-
let e = this.shadowRoot?.querySelector("canvas");
|
|
1542
|
-
e instanceof HTMLElement && (e.style.pointerEvents = this.disabled ? "none" : "");
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
applySerializedValue() {
|
|
1546
|
-
if (this.pad) {
|
|
1547
|
-
if (!this.value) {
|
|
1548
|
-
this.pad.isEmpty() || this.pad.clear();
|
|
1549
|
-
return;
|
|
1550
|
-
}
|
|
1551
|
-
try {
|
|
1552
|
-
this.pad.fromDataURL(this.value);
|
|
1553
|
-
} catch {}
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
emitValue() {
|
|
1557
|
-
if (!this.pad || this.pad.isEmpty()) {
|
|
1558
|
-
this.dispatchEvent(new CustomEvent(J, {
|
|
1559
|
-
detail: "",
|
|
1560
|
-
bubbles: !0,
|
|
1561
|
-
composed: !0
|
|
1562
|
-
}));
|
|
1563
|
-
return;
|
|
1564
|
-
}
|
|
1565
|
-
this.dispatchEvent(new CustomEvent(J, {
|
|
1566
|
-
detail: this.pad.toDataURL(),
|
|
1567
|
-
bubbles: !0,
|
|
1568
|
-
composed: !0
|
|
1569
|
-
}));
|
|
1570
|
-
}
|
|
1571
|
-
render() {
|
|
1572
|
-
return this.loadError ? j`<div class="err">${this.loadError}</div>` : j`
|
|
1573
|
-
<div class="wrap">
|
|
1574
|
-
<canvas></canvas>
|
|
1575
|
-
<button type="button" ?disabled=${this.disabled} @click=${() => {
|
|
1576
|
-
this.pad?.clear(), this.dispatchEvent(new CustomEvent(J, {
|
|
1577
|
-
detail: "",
|
|
1578
|
-
bubbles: !0,
|
|
1579
|
-
composed: !0
|
|
1580
|
-
}));
|
|
1581
|
-
}}>Clear</button>
|
|
1582
|
-
</div>
|
|
1583
|
-
`;
|
|
1584
|
-
}
|
|
1585
|
-
};
|
|
1586
|
-
Y([H({ attribute: !1 })], $.prototype, "field", void 0), Y([H({ attribute: !1 })], $.prototype, "modules", void 0), Y([H({ type: String })], $.prototype, "value", void 0), Y([H({ type: Boolean })], $.prototype, "disabled", void 0), Y([U()], $.prototype, "loadError", void 0);
|
|
1587
|
-
//#endregion
|
|
1588
|
-
//#region src/index.ts
|
|
1589
|
-
var Lt = !1;
|
|
1590
|
-
function Rt() {
|
|
1591
|
-
Lt || (Lt = !0, customElements.get("formie-form") || customElements.define("formie-form", It), customElements.get("formie-internal-signature") || customElements.define("formie-internal-signature", $), customElements.get("formie-core-form") || customElements.define("formie-core-form", X));
|
|
1608
|
+
let A = dt;
|
|
1609
|
+
z([
|
|
1610
|
+
$({ attribute: !1 })
|
|
1611
|
+
], A.prototype, "field");
|
|
1612
|
+
z([
|
|
1613
|
+
$({ attribute: !1 })
|
|
1614
|
+
], A.prototype, "modules");
|
|
1615
|
+
z([
|
|
1616
|
+
$({ type: String })
|
|
1617
|
+
], A.prototype, "value");
|
|
1618
|
+
z([
|
|
1619
|
+
$({ type: Boolean })
|
|
1620
|
+
], A.prototype, "disabled");
|
|
1621
|
+
z([
|
|
1622
|
+
K()
|
|
1623
|
+
], A.prototype, "loadError");
|
|
1624
|
+
let wt = !1;
|
|
1625
|
+
function fs() {
|
|
1626
|
+
wt || (wt = !0, customElements.get("formie-form") || customElements.define("formie-form", ns), customElements.get("formie-internal-signature") || customElements.define("formie-internal-signature", A), customElements.get("formie-core-form") || customElements.define("formie-core-form", b));
|
|
1592
1627
|
}
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1628
|
+
export {
|
|
1629
|
+
D as FORMIE_CONTROL_VALUE_EVENT,
|
|
1630
|
+
b as FormieCoreForm,
|
|
1631
|
+
ns as FormieFormElement,
|
|
1632
|
+
A as FormieInternalSignature,
|
|
1633
|
+
Z as FormieRegistry,
|
|
1634
|
+
P as assertValidCustomElementName,
|
|
1635
|
+
gs as createFormieClient,
|
|
1636
|
+
us as createFormieRegistry,
|
|
1637
|
+
Pe as getFormieRegistry,
|
|
1638
|
+
ps as isFieldDefinition,
|
|
1639
|
+
fs as registerFormieWebComponents,
|
|
1640
|
+
ss as renderErrorView,
|
|
1641
|
+
Ye as renderFormView,
|
|
1642
|
+
es as renderLoadingView,
|
|
1643
|
+
Vt as resolveFieldRendererType
|
|
1644
|
+
};
|