drill-widgets 2.7.4 → 2.7.6

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.
@@ -3,8 +3,8 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const Y = globalThis, he = Y.ShadowRoot && (Y.ShadyCSS === void 0 || Y.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ge = Symbol(), ve = /* @__PURE__ */ new WeakMap();
7
- let Fe = class {
6
+ const q = globalThis, he = q.ShadowRoot && (q.ShadyCSS === void 0 || q.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ge = Symbol(), ve = /* @__PURE__ */ new WeakMap();
7
+ let Te = class {
8
8
  constructor(e, t, n) {
9
9
  if (this._$cssResult$ = !0, n !== ge) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
10
  this.cssText = e, this.t = t;
@@ -22,30 +22,30 @@ let Fe = class {
22
22
  return this.cssText;
23
23
  }
24
24
  };
25
- const Re = (i) => new Fe(typeof i == "string" ? i : i + "", void 0, ge), N = (i, ...e) => {
25
+ const Oe = (i) => new Te(typeof i == "string" ? i : i + "", void 0, ge), N = (i, ...e) => {
26
26
  const t = i.length === 1 ? i[0] : e.reduce((n, s, r) => n + ((o) => {
27
27
  if (o._$cssResult$ === !0) return o.cssText;
28
28
  if (typeof o == "number") return o;
29
29
  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.");
30
30
  })(s) + i[r + 1], i[0]);
31
- return new Fe(t, i, ge);
32
- }, We = (i, e) => {
31
+ return new Te(t, i, ge);
32
+ }, Re = (i, e) => {
33
33
  if (he) i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
34
34
  else for (const t of e) {
35
- const n = document.createElement("style"), s = Y.litNonce;
35
+ const n = document.createElement("style"), s = q.litNonce;
36
36
  s !== void 0 && n.setAttribute("nonce", s), n.textContent = t.cssText, i.appendChild(n);
37
37
  }
38
38
  }, xe = he ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
39
39
  let t = "";
40
40
  for (const n of e.cssRules) t += n.cssText;
41
- return Re(t);
41
+ return Oe(t);
42
42
  })(i) : i;
43
43
  /**
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const { is: He, defineProperty: Ve, getOwnPropertyDescriptor: je, getOwnPropertyNames: Qe, getOwnPropertySymbols: Be, getPrototypeOf: qe } = Object, A = globalThis, _e = A.trustedTypes, Ge = _e ? _e.emptyScript : "", ne = A.reactiveElementPolyfillSupport, W = (i, e) => i, J = { toAttribute(i, e) {
48
+ const { is: We, defineProperty: He, getOwnPropertyDescriptor: Ve, getOwnPropertyNames: je, getOwnPropertySymbols: Qe, getPrototypeOf: Be } = Object, A = globalThis, _e = A.trustedTypes, Ge = _e ? _e.emptyScript : "", ne = A.reactiveElementPolyfillSupport, W = (i, e) => i, K = { toAttribute(i, e) {
49
49
  switch (e) {
50
50
  case Boolean:
51
51
  i = i ? Ge : null;
@@ -73,23 +73,23 @@ const { is: He, defineProperty: Ve, getOwnPropertyDescriptor: je, getOwnProperty
73
73
  }
74
74
  }
75
75
  return t;
76
- } }, fe = (i, e) => !He(i, e), ye = { attribute: !0, type: String, converter: J, reflect: !1, useDefault: !1, hasChanged: fe };
76
+ } }, fe = (i, e) => !We(i, e), Se = { attribute: !0, type: String, converter: K, reflect: !1, useDefault: !1, hasChanged: fe };
77
77
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), A.litPropertyMetadata ?? (A.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
- let P = class extends HTMLElement {
78
+ let I = class extends HTMLElement {
79
79
  static addInitializer(e) {
80
80
  this._$Ei(), (this.l ?? (this.l = [])).push(e);
81
81
  }
82
82
  static get observedAttributes() {
83
83
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
84
84
  }
85
- static createProperty(e, t = ye) {
85
+ static createProperty(e, t = Se) {
86
86
  if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
87
87
  const n = Symbol(), s = this.getPropertyDescriptor(e, n, t);
88
- s !== void 0 && Ve(this.prototype, e, s);
88
+ s !== void 0 && He(this.prototype, e, s);
89
89
  }
90
90
  }
91
91
  static getPropertyDescriptor(e, t, n) {
92
- const { get: s, set: r } = je(this.prototype, e) ?? { get() {
92
+ const { get: s, set: r } = Ve(this.prototype, e) ?? { get() {
93
93
  return this[t];
94
94
  }, set(o) {
95
95
  this[t] = o;
@@ -100,17 +100,17 @@ let P = class extends HTMLElement {
100
100
  }, configurable: !0, enumerable: !0 };
101
101
  }
102
102
  static getPropertyOptions(e) {
103
- return this.elementProperties.get(e) ?? ye;
103
+ return this.elementProperties.get(e) ?? Se;
104
104
  }
105
105
  static _$Ei() {
106
106
  if (this.hasOwnProperty(W("elementProperties"))) return;
107
- const e = qe(this);
107
+ const e = Be(this);
108
108
  e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
109
109
  }
110
110
  static finalize() {
111
111
  if (this.hasOwnProperty(W("finalized"))) return;
112
112
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(W("properties"))) {
113
- const t = this.properties, n = [...Qe(t), ...Be(t)];
113
+ const t = this.properties, n = [...je(t), ...Qe(t)];
114
114
  for (const s of n) this.createProperty(s, t[s]);
115
115
  }
116
116
  const e = this[Symbol.metadata];
@@ -159,7 +159,7 @@ let P = class extends HTMLElement {
159
159
  }
160
160
  createRenderRoot() {
161
161
  const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
162
- return We(e, this.constructor.elementStyles), e;
162
+ return Re(e, this.constructor.elementStyles), e;
163
163
  }
164
164
  connectedCallback() {
165
165
  var e;
@@ -184,7 +184,7 @@ let P = class extends HTMLElement {
184
184
  var r;
185
185
  const n = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, n);
186
186
  if (s !== void 0 && n.reflect === !0) {
187
- const o = (((r = n.converter) == null ? void 0 : r.toAttribute) !== void 0 ? n.converter : J).toAttribute(t, n.type);
187
+ const o = (((r = n.converter) == null ? void 0 : r.toAttribute) !== void 0 ? n.converter : K).toAttribute(t, n.type);
188
188
  this._$Em = e, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
189
189
  }
190
190
  }
@@ -192,7 +192,7 @@ let P = class extends HTMLElement {
192
192
  var r, o;
193
193
  const n = this.constructor, s = n._$Eh.get(e);
194
194
  if (s !== void 0 && this._$Em !== s) {
195
- const a = n.getPropertyOptions(s), d = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((r = a.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? a.converter : J;
195
+ const a = n.getPropertyOptions(s), d = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((r = a.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? a.converter : K;
196
196
  this._$Em = s, this[s] = d.fromAttribute(t, a.type) ?? ((o = this._$Ej) == null ? void 0 : o.get(s)) ?? null, this._$Em = null;
197
197
  }
198
198
  }
@@ -276,56 +276,56 @@ let P = class extends HTMLElement {
276
276
  firstUpdated(e) {
277
277
  }
278
278
  };
279
- P.elementStyles = [], P.shadowRootOptions = { mode: "open" }, P[W("elementProperties")] = /* @__PURE__ */ new Map(), P[W("finalized")] = /* @__PURE__ */ new Map(), ne == null || ne({ ReactiveElement: P }), (A.reactiveElementVersions ?? (A.reactiveElementVersions = [])).push("2.1.0");
279
+ I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[W("elementProperties")] = /* @__PURE__ */ new Map(), I[W("finalized")] = /* @__PURE__ */ new Map(), ne == null || ne({ ReactiveElement: I }), (A.reactiveElementVersions ?? (A.reactiveElementVersions = [])).push("2.1.0");
280
280
  /**
281
281
  * @license
282
282
  * Copyright 2017 Google LLC
283
283
  * SPDX-License-Identifier: BSD-3-Clause
284
284
  */
285
- const H = globalThis, K = H.trustedTypes, Se = K ? K.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ze = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`, Ie = "?" + E, Ye = `<${Ie}>`, z = document, V = () => z.createComment(""), j = (i) => i === null || typeof i != "object" && typeof i != "function", me = Array.isArray, Je = (i) => me(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", se = `[
285
+ const H = globalThis, J = H.trustedTypes, ye = J ? J.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ze = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`, Ue = "?" + E, Ye = `<${Ue}>`, z = document, V = () => z.createComment(""), j = (i) => i === null || typeof i != "object" && typeof i != "function", me = Array.isArray, qe = (i) => me(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", se = `[
286
286
  \f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, we = /-->/g, ke = />/g, M = RegExp(`>|${se}(?:([^\\s"'>=/]+)(${se}*=${se}*(?:[^
287
- \f\r"'\`<>=]|("|')|))|$)`, "g"), $e = /'/g, De = /"/g, Pe = /^(?:script|style|textarea|title)$/i, Ke = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), l = Ke(1), I = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Ce = /* @__PURE__ */ new WeakMap(), T = z.createTreeWalker(z, 129);
288
- function Ue(i, e) {
287
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), $e = /'/g, De = /"/g, Ie = /^(?:script|style|textarea|title)$/i, Ke = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), l = Ke(1), U = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Ce = /* @__PURE__ */ new WeakMap(), F = z.createTreeWalker(z, 129);
288
+ function Pe(i, e) {
289
289
  if (!me(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
290
- return Se !== void 0 ? Se.createHTML(e) : e;
290
+ return ye !== void 0 ? ye.createHTML(e) : e;
291
291
  }
292
- const Xe = (i, e) => {
292
+ const Je = (i, e) => {
293
293
  const t = i.length - 1, n = [];
294
294
  let s, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = O;
295
295
  for (let a = 0; a < t; a++) {
296
296
  const d = i[a];
297
297
  let p, c, u = -1, h = 0;
298
- for (; h < d.length && (o.lastIndex = h, c = o.exec(d), c !== null); ) h = o.lastIndex, o === O ? c[1] === "!--" ? o = we : c[1] !== void 0 ? o = ke : c[2] !== void 0 ? (Pe.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = M) : c[3] !== void 0 && (o = M) : o === M ? c[0] === ">" ? (o = s ?? O, u = -1) : c[1] === void 0 ? u = -2 : (u = o.lastIndex - c[2].length, p = c[1], o = c[3] === void 0 ? M : c[3] === '"' ? De : $e) : o === De || o === $e ? o = M : o === we || o === ke ? o = O : (o = M, s = void 0);
298
+ for (; h < d.length && (o.lastIndex = h, c = o.exec(d), c !== null); ) h = o.lastIndex, o === O ? c[1] === "!--" ? o = we : c[1] !== void 0 ? o = ke : c[2] !== void 0 ? (Ie.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = M) : c[3] !== void 0 && (o = M) : o === M ? c[0] === ">" ? (o = s ?? O, u = -1) : c[1] === void 0 ? u = -2 : (u = o.lastIndex - c[2].length, p = c[1], o = c[3] === void 0 ? M : c[3] === '"' ? De : $e) : o === De || o === $e ? o = M : o === we || o === ke ? o = O : (o = M, s = void 0);
299
299
  const g = o === M && i[a + 1].startsWith("/>") ? " " : "";
300
300
  r += o === O ? d + Ye : u >= 0 ? (n.push(p), d.slice(0, u) + ze + d.slice(u) + E + g) : d + E + (u === -2 ? a : g);
301
301
  }
302
- return [Ue(i, r + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), n];
302
+ return [Pe(i, r + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), n];
303
303
  };
304
304
  class Q {
305
305
  constructor({ strings: e, _$litType$: t }, n) {
306
306
  let s;
307
307
  this.parts = [];
308
308
  let r = 0, o = 0;
309
- const a = e.length - 1, d = this.parts, [p, c] = Xe(e, t);
310
- if (this.el = Q.createElement(p, n), T.currentNode = this.el.content, t === 2 || t === 3) {
309
+ const a = e.length - 1, d = this.parts, [p, c] = Je(e, t);
310
+ if (this.el = Q.createElement(p, n), F.currentNode = this.el.content, t === 2 || t === 3) {
311
311
  const u = this.el.content.firstChild;
312
312
  u.replaceWith(...u.childNodes);
313
313
  }
314
- for (; (s = T.nextNode()) !== null && d.length < a; ) {
314
+ for (; (s = F.nextNode()) !== null && d.length < a; ) {
315
315
  if (s.nodeType === 1) {
316
316
  if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(ze)) {
317
317
  const h = c[o++], g = s.getAttribute(u).split(E), b = /([.?@])?(.*)/.exec(h);
318
- d.push({ type: 1, index: r, name: b[2], strings: g, ctor: b[1] === "." ? et : b[1] === "?" ? tt : b[1] === "@" ? it : ie }), s.removeAttribute(u);
318
+ d.push({ type: 1, index: r, name: b[2], strings: g, ctor: b[1] === "." ? Ze : b[1] === "?" ? et : b[1] === "@" ? tt : ie }), s.removeAttribute(u);
319
319
  } else u.startsWith(E) && (d.push({ type: 6, index: r }), s.removeAttribute(u));
320
- if (Pe.test(s.tagName)) {
320
+ if (Ie.test(s.tagName)) {
321
321
  const u = s.textContent.split(E), h = u.length - 1;
322
322
  if (h > 0) {
323
- s.textContent = K ? K.emptyScript : "";
324
- for (let g = 0; g < h; g++) s.append(u[g], V()), T.nextNode(), d.push({ type: 2, index: ++r });
323
+ s.textContent = J ? J.emptyScript : "";
324
+ for (let g = 0; g < h; g++) s.append(u[g], V()), F.nextNode(), d.push({ type: 2, index: ++r });
325
325
  s.append(u[h], V());
326
326
  }
327
327
  }
328
- } else if (s.nodeType === 8) if (s.data === Ie) d.push({ type: 2, index: r });
328
+ } else if (s.nodeType === 8) if (s.data === Ue) d.push({ type: 2, index: r });
329
329
  else {
330
330
  let u = -1;
331
331
  for (; (u = s.data.indexOf(E, u + 1)) !== -1; ) d.push({ type: 7, index: r }), u += E.length - 1;
@@ -340,12 +340,12 @@ class Q {
340
340
  }
341
341
  function L(i, e, t = i, n) {
342
342
  var o, a;
343
- if (e === I) return e;
343
+ if (e === U) return e;
344
344
  let s = n !== void 0 ? (o = t._$Co) == null ? void 0 : o[n] : t._$Cl;
345
345
  const r = j(e) ? void 0 : e._$litDirective$;
346
346
  return (s == null ? void 0 : s.constructor) !== r && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), r === void 0 ? s = void 0 : (s = new r(i), s._$AT(i, t, n)), n !== void 0 ? (t._$Co ?? (t._$Co = []))[n] = s : t._$Cl = s), s !== void 0 && (e = L(i, s._$AS(i, e.values), s, n)), e;
347
347
  }
348
- class Ze {
348
+ class Xe {
349
349
  constructor(e, t) {
350
350
  this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
351
351
  }
@@ -357,16 +357,16 @@ class Ze {
357
357
  }
358
358
  u(e) {
359
359
  const { el: { content: t }, parts: n } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? z).importNode(t, !0);
360
- T.currentNode = s;
361
- let r = T.nextNode(), o = 0, a = 0, d = n[0];
360
+ F.currentNode = s;
361
+ let r = F.nextNode(), o = 0, a = 0, d = n[0];
362
362
  for (; d !== void 0; ) {
363
363
  if (o === d.index) {
364
364
  let p;
365
- d.type === 2 ? p = new B(r, r.nextSibling, this, e) : d.type === 1 ? p = new d.ctor(r, d.name, d.strings, this, e) : d.type === 6 && (p = new nt(r, this, e)), this._$AV.push(p), d = n[++a];
365
+ d.type === 2 ? p = new B(r, r.nextSibling, this, e) : d.type === 1 ? p = new d.ctor(r, d.name, d.strings, this, e) : d.type === 6 && (p = new it(r, this, e)), this._$AV.push(p), d = n[++a];
366
366
  }
367
- o !== (d == null ? void 0 : d.index) && (r = T.nextNode(), o++);
367
+ o !== (d == null ? void 0 : d.index) && (r = F.nextNode(), o++);
368
368
  }
369
- return T.currentNode = z, s;
369
+ return F.currentNode = z, s;
370
370
  }
371
371
  p(e) {
372
372
  let t = 0;
@@ -393,7 +393,7 @@ class B {
393
393
  return this._$AB;
394
394
  }
395
395
  _$AI(e, t = this) {
396
- e = L(this, e, t), j(e) ? e === v || e == null || e === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : e !== this._$AH && e !== I && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Je(e) ? this.k(e) : this._(e);
396
+ e = L(this, e, t), j(e) ? e === v || e == null || e === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : e !== this._$AH && e !== U && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : qe(e) ? this.k(e) : this._(e);
397
397
  }
398
398
  O(e) {
399
399
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -406,10 +406,10 @@ class B {
406
406
  }
407
407
  $(e) {
408
408
  var r;
409
- const { values: t, _$litType$: n } = e, s = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = Q.createElement(Ue(n.h, n.h[0]), this.options)), n);
409
+ const { values: t, _$litType$: n } = e, s = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = Q.createElement(Pe(n.h, n.h[0]), this.options)), n);
410
410
  if (((r = this._$AH) == null ? void 0 : r._$AD) === s) this._$AH.p(t);
411
411
  else {
412
- const o = new Ze(s, this), a = o.u(this.options);
412
+ const o = new Xe(s, this), a = o.u(this.options);
413
413
  o.p(t), this.T(a), this._$AH = o;
414
414
  }
415
415
  }
@@ -449,11 +449,11 @@ class ie {
449
449
  _$AI(e, t = this, n, s) {
450
450
  const r = this.strings;
451
451
  let o = !1;
452
- if (r === void 0) e = L(this, e, t, 0), o = !j(e) || e !== this._$AH && e !== I, o && (this._$AH = e);
452
+ if (r === void 0) e = L(this, e, t, 0), o = !j(e) || e !== this._$AH && e !== U, o && (this._$AH = e);
453
453
  else {
454
454
  const a = e;
455
455
  let d, p;
456
- for (e = r[0], d = 0; d < r.length - 1; d++) p = L(this, a[n + d], t, d), p === I && (p = this._$AH[d]), o || (o = !j(p) || p !== this._$AH[d]), p === v ? e = v : e !== v && (e += (p ?? "") + r[d + 1]), this._$AH[d] = p;
456
+ for (e = r[0], d = 0; d < r.length - 1; d++) p = L(this, a[n + d], t, d), p === U && (p = this._$AH[d]), o || (o = !j(p) || p !== this._$AH[d]), p === v ? e = v : e !== v && (e += (p ?? "") + r[d + 1]), this._$AH[d] = p;
457
457
  }
458
458
  o && !s && this.j(e);
459
459
  }
@@ -461,7 +461,7 @@ class ie {
461
461
  e === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
462
462
  }
463
463
  }
464
- class et extends ie {
464
+ class Ze extends ie {
465
465
  constructor() {
466
466
  super(...arguments), this.type = 3;
467
467
  }
@@ -469,7 +469,7 @@ class et extends ie {
469
469
  this.element[this.name] = e === v ? void 0 : e;
470
470
  }
471
471
  }
472
- class tt extends ie {
472
+ class et extends ie {
473
473
  constructor() {
474
474
  super(...arguments), this.type = 4;
475
475
  }
@@ -477,12 +477,12 @@ class tt extends ie {
477
477
  this.element.toggleAttribute(this.name, !!e && e !== v);
478
478
  }
479
479
  }
480
- class it extends ie {
480
+ class tt extends ie {
481
481
  constructor(e, t, n, s, r) {
482
482
  super(e, t, n, s, r), this.type = 5;
483
483
  }
484
484
  _$AI(e, t = this) {
485
- if ((e = L(this, e, t, 0) ?? v) === I) return;
485
+ if ((e = L(this, e, t, 0) ?? v) === U) return;
486
486
  const n = this._$AH, s = e === v && n !== v || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, r = e !== v && (n === v || s);
487
487
  s && this.element.removeEventListener(this.name, this, n), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
488
488
  }
@@ -491,7 +491,7 @@ class it extends ie {
491
491
  typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
492
492
  }
493
493
  }
494
- class nt {
494
+ class it {
495
495
  constructor(e, t, n) {
496
496
  this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = n;
497
497
  }
@@ -504,7 +504,7 @@ class nt {
504
504
  }
505
505
  const re = H.litHtmlPolyfillSupport;
506
506
  re == null || re(Q, B), (H.litHtmlVersions ?? (H.litHtmlVersions = [])).push("3.3.0");
507
- const st = (i, e, t) => {
507
+ const nt = (i, e, t) => {
508
508
  const n = (t == null ? void 0 : t.renderBefore) ?? e;
509
509
  let s = n._$litPart$;
510
510
  if (s === void 0) {
@@ -518,8 +518,8 @@ const st = (i, e, t) => {
518
518
  * Copyright 2017 Google LLC
519
519
  * SPDX-License-Identifier: BSD-3-Clause
520
520
  */
521
- const F = globalThis;
522
- let U = class extends P {
521
+ const T = globalThis;
522
+ let P = class extends I {
523
523
  constructor() {
524
524
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
525
525
  }
@@ -530,7 +530,7 @@ let U = class extends P {
530
530
  }
531
531
  update(e) {
532
532
  const t = this.render();
533
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = st(t, this.renderRoot, this.renderOptions);
533
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = nt(t, this.renderRoot, this.renderOptions);
534
534
  }
535
535
  connectedCallback() {
536
536
  var e;
@@ -541,14 +541,14 @@ let U = class extends P {
541
541
  super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
542
542
  }
543
543
  render() {
544
- return I;
544
+ return U;
545
545
  }
546
546
  };
547
- var Te;
548
- U._$litElement$ = !0, U.finalized = !0, (Te = F.litElementHydrateSupport) == null || Te.call(F, { LitElement: U });
549
- const oe = F.litElementPolyfillSupport;
550
- oe == null || oe({ LitElement: U });
551
- (F.litElementVersions ?? (F.litElementVersions = [])).push("4.2.0");
547
+ var Fe;
548
+ P._$litElement$ = !0, P.finalized = !0, (Fe = T.litElementHydrateSupport) == null || Fe.call(T, { LitElement: P });
549
+ const oe = T.litElementPolyfillSupport;
550
+ oe == null || oe({ LitElement: P });
551
+ (T.litElementVersions ?? (T.litElementVersions = [])).push("4.2.0");
552
552
  /**
553
553
  * @license
554
554
  * Copyright 2017 Google LLC
@@ -564,7 +564,7 @@ const Le = (i) => (e, t) => {
564
564
  * Copyright 2017 Google LLC
565
565
  * SPDX-License-Identifier: BSD-3-Clause
566
566
  */
567
- const rt = { attribute: !0, type: String, converter: J, reflect: !1, hasChanged: fe }, ot = (i = rt, e, t) => {
567
+ const st = { attribute: !0, type: String, converter: K, reflect: !1, hasChanged: fe }, rt = (i = st, e, t) => {
568
568
  const { kind: n, metadata: s } = t;
569
569
  let r = globalThis.litPropertyMetadata.get(s);
570
570
  if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), n === "setter" && ((i = Object.create(i)).wrapped = !0), r.set(t.name, i), n === "accessor") {
@@ -586,7 +586,7 @@ const rt = { attribute: !0, type: String, converter: J, reflect: !1, hasChanged:
586
586
  throw Error("Unsupported decorator location: " + n);
587
587
  };
588
588
  function D(i) {
589
- return (e, t) => typeof t == "object" ? ot(i, e, t) : ((n, s, r) => {
589
+ return (e, t) => typeof t == "object" ? rt(i, e, t) : ((n, s, r) => {
590
590
  const o = s.hasOwnProperty(r);
591
591
  return s.constructor.createProperty(r, n), o ? Object.getOwnPropertyDescriptor(s, r) : void 0;
592
592
  })(i, e, t);
@@ -599,38 +599,37 @@ function D(i) {
599
599
  function _(i) {
600
600
  return D({ ...i, state: !0, attribute: !1 });
601
601
  }
602
- const y = [];
602
+ const S = [];
603
603
  for (let i = 0; i < 256; ++i)
604
- y.push((i + 256).toString(16).slice(1));
605
- function at(i, e = 0) {
606
- return (y[i[e + 0]] + y[i[e + 1]] + y[i[e + 2]] + y[i[e + 3]] + "-" + y[i[e + 4]] + y[i[e + 5]] + "-" + y[i[e + 6]] + y[i[e + 7]] + "-" + y[i[e + 8]] + y[i[e + 9]] + "-" + y[i[e + 10]] + y[i[e + 11]] + y[i[e + 12]] + y[i[e + 13]] + y[i[e + 14]] + y[i[e + 15]]).toLowerCase();
604
+ S.push((i + 256).toString(16).slice(1));
605
+ function ot(i, e = 0) {
606
+ return (S[i[e + 0]] + S[i[e + 1]] + S[i[e + 2]] + S[i[e + 3]] + "-" + S[i[e + 4]] + S[i[e + 5]] + "-" + S[i[e + 6]] + S[i[e + 7]] + "-" + S[i[e + 8]] + S[i[e + 9]] + "-" + S[i[e + 10]] + S[i[e + 11]] + S[i[e + 12]] + S[i[e + 13]] + S[i[e + 14]] + S[i[e + 15]]).toLowerCase();
607
607
  }
608
608
  let ae;
609
- const dt = new Uint8Array(16);
610
- function lt() {
609
+ const at = new Uint8Array(16);
610
+ function dt() {
611
611
  if (!ae) {
612
612
  if (typeof crypto > "u" || !crypto.getRandomValues)
613
613
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
614
614
  ae = crypto.getRandomValues.bind(crypto);
615
615
  }
616
- return ae(dt);
616
+ return ae(at);
617
617
  }
618
- const pt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ee = { randomUUID: pt };
618
+ const lt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ee = { randomUUID: lt };
619
619
  function de(i, e, t) {
620
620
  var s;
621
621
  if (Ee.randomUUID && !i)
622
622
  return Ee.randomUUID();
623
623
  i = i || {};
624
- const n = i.random ?? ((s = i.rng) == null ? void 0 : s.call(i)) ?? lt();
624
+ const n = i.random ?? ((s = i.rng) == null ? void 0 : s.call(i)) ?? dt();
625
625
  if (n.length < 16)
626
626
  throw new Error("Random bytes length must be >= 16");
627
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, at(n);
627
+ return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, ot(n);
628
628
  }
629
- const ct = N`
629
+ const pt = N`
630
630
  :host {
631
631
  display: block;
632
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
633
- sans-serif;
632
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
634
633
  background-color: #f9fafb; /* Lighter gray background */
635
634
  border-radius: 8px;
636
635
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
@@ -699,7 +698,7 @@ const ct = N`
699
698
  padding: 0;
700
699
  background-color: #f9fafb; /* Lighter gray background continues */
701
700
  }
702
- `, ut = N`
701
+ `, ct = N`
703
702
  .form-group {
704
703
  display: flex;
705
704
  flex-direction: column;
@@ -894,7 +893,7 @@ const ct = N`
894
893
  border-color: #3b82f6;
895
894
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
896
895
  }
897
- `, ht = N`
896
+ `, ut = N`
898
897
  /* Steps and Questions Sections */
899
898
  .section {
900
899
  padding: 16px;
@@ -1356,7 +1355,8 @@ const ct = N`
1356
1355
  background: white;
1357
1356
  border-radius: 8px;
1358
1357
  padding: 24px 48px;
1359
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
1358
+ box-shadow:
1359
+ 0 1px 3px 0 rgba(0, 0, 0, 0.1),
1360
1360
  0 1px 2px -1px rgba(0, 0, 0, 0.1);
1361
1361
  display: flex;
1362
1362
  flex-direction: row;
@@ -1432,7 +1432,9 @@ const ct = N`
1432
1432
  margin-bottom: 0;
1433
1433
  cursor: pointer;
1434
1434
  border: 2px solid transparent;
1435
- transition: border 0.2s, box-shadow 0.2s;
1435
+ transition:
1436
+ border 0.2s,
1437
+ box-shadow 0.2s;
1436
1438
  gap: 12px;
1437
1439
  }
1438
1440
  .runner-step-item.active {
@@ -2238,7 +2240,9 @@ const ct = N`
2238
2240
  background: #fff;
2239
2241
  border-radius: 16px;
2240
2242
  padding: 48px 40px;
2241
- box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
2243
+ box-shadow:
2244
+ 0 4px 6px -1px rgb(0 0 0 / 0.1),
2245
+ 0 2px 4px -2px rgb(0 0 0 / 0.1);
2242
2246
  }
2243
2247
 
2244
2248
  .not-assigned-icon {
@@ -2419,8 +2423,7 @@ const ct = N`
2419
2423
  background: #fff;
2420
2424
  padding: 40px;
2421
2425
  box-sizing: border-box;
2422
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
2423
- sans-serif;
2426
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
2424
2427
  }
2425
2428
 
2426
2429
  .print-step {
@@ -2562,8 +2565,7 @@ const ct = N`
2562
2565
  color: #fff;
2563
2566
  }
2564
2567
 
2565
- .runner-mobile-step-tab:not(.active):not(.completed)
2566
- .runner-mobile-step-badge {
2568
+ .runner-mobile-step-tab:not(.active):not(.completed) .runner-mobile-step-badge {
2567
2569
  background: rgba(0, 0, 0, 0.1);
2568
2570
  color: inherit;
2569
2571
  }
@@ -2950,7 +2952,7 @@ const ct = N`
2950
2952
  margin: 2px 0;
2951
2953
  line-height: 1.4;
2952
2954
  }
2953
- `, gt = N`
2955
+ `, ht = N`
2954
2956
  /* Modal Styles */
2955
2957
  .modal-overlay {
2956
2958
  position: fixed;
@@ -3088,219 +3090,12 @@ const ct = N`
3088
3090
  background-color: #2563eb;
3089
3091
  }
3090
3092
  `;
3091
- var ft = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, C = (i, e, t, n) => {
3092
- for (var s = n > 1 ? void 0 : n ? mt(e, t) : e, r = i.length - 1, o; r >= 0; r--)
3093
+ var gt = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, C = (i, e, t, n) => {
3094
+ for (var s = n > 1 ? void 0 : n ? ft(e, t) : e, r = i.length - 1, o; r >= 0; r--)
3093
3095
  (o = i[r]) && (s = (n ? o(e, t, s) : o(s)) || s);
3094
- return n && s && ft(e, t, s), s;
3096
+ return n && s && gt(e, t, s), s;
3095
3097
  };
3096
- const Oe = [
3097
- {
3098
- id: "wf-1",
3099
- name: "Onboarding Checklist",
3100
- description: "Standard checklist for new employees.",
3101
- steps: [
3102
- {
3103
- id: "step-1",
3104
- title: "Welcome Information",
3105
- description: "Basic details collection.",
3106
- order: 1,
3107
- assignment: {
3108
- category: "individual",
3109
- type: "specific_user",
3110
- email: "hr@example.com"
3111
- },
3112
- elements: [
3113
- {
3114
- id: "c1",
3115
- type: "text",
3116
- content: "Welcome to our company! We're excited to have you join our team. This onboarding process will help you get set up quickly and efficiently.",
3117
- order: 1
3118
- },
3119
- {
3120
- id: "c2",
3121
- type: "divider",
3122
- content: "",
3123
- caption: "Personal Information",
3124
- order: 2
3125
- },
3126
- {
3127
- id: "q1",
3128
- type: "text_input",
3129
- label: "Full Name",
3130
- order: 3,
3131
- required: !0
3132
- },
3133
- {
3134
- id: "q2",
3135
- type: "text_input",
3136
- label: "Email Address",
3137
- order: 4,
3138
- required: !0
3139
- },
3140
- {
3141
- id: "c3",
3142
- type: "markdown",
3143
- content: `## Next Steps
3144
-
3145
- After completing this form, you'll receive:
3146
-
3147
- * **Welcome email** with your login credentials
3148
- * **Schedule** for your orientation meeting
3149
- * **Access** to company resources
3150
-
3151
- ### Important Notes
3152
-
3153
- Please ensure all information is *accurate* before proceeding. If you need to make changes later, contact your HR representative.
3154
-
3155
- ### What to Expect
3156
-
3157
- 1. **Immediate**: Confirmation email
3158
- 2. **Within 24 hours**: Welcome package
3159
- 3. **This week**: Orientation meeting
3160
-
3161
- > **Pro tip**: Save this information for future reference!
3162
-
3163
- You can use \`code snippets\` like this for technical details.`,
3164
- order: 5
3165
- }
3166
- ],
3167
- status: "pending"
3168
- },
3169
- {
3170
- id: "step-2",
3171
- title: "Department Setup",
3172
- description: "",
3173
- // Added default empty description
3174
- order: 2,
3175
- assignment: {
3176
- category: "individual",
3177
- type: "instance_assignee_select"
3178
- },
3179
- elements: [
3180
- {
3181
- id: "c4",
3182
- type: "text",
3183
- content: "Now let's set up your department and role information. This will help us assign you to the right teams and provide appropriate access.",
3184
- order: 1
3185
- },
3186
- {
3187
- id: "q3",
3188
- type: "select",
3189
- label: "Department",
3190
- order: 2,
3191
- required: !0,
3192
- options: ["Engineering", "Sales", "Marketing", "HR"]
3193
- },
3194
- {
3195
- id: "q4",
3196
- type: "text_input",
3197
- label: "Role/Title",
3198
- order: 3,
3199
- required: !0
3200
- },
3201
- {
3202
- id: "c5",
3203
- type: "divider",
3204
- content: "",
3205
- order: 4
3206
- },
3207
- {
3208
- id: "c6",
3209
- type: "html",
3210
- content: "<div style='background: #f0f9ff; padding: 16px; border-radius: 8px; border-left: 4px solid #3b82f6;'><strong>Note:</strong> Your department assignment will determine your initial access permissions and team assignments. You can request changes through your manager after onboarding.</div>",
3211
- order: 5
3212
- }
3213
- ],
3214
- status: "pending"
3215
- },
3216
- {
3217
- id: "step-3",
3218
- title: "Feedback",
3219
- description: "Any initial comments?",
3220
- order: 3,
3221
- assignment: {
3222
- category: "individual",
3223
- type: "subject"
3224
- },
3225
- elements: [
3226
- {
3227
- id: "c7",
3228
- type: "text",
3229
- content: "We'd love to hear your feedback about the onboarding process. Your input helps us improve the experience for future team members.",
3230
- order: 1
3231
- },
3232
- {
3233
- id: "q5",
3234
- type: "textarea",
3235
- label: "Comments",
3236
- order: 2,
3237
- required: !1
3238
- },
3239
- {
3240
- id: "c8",
3241
- type: "image",
3242
- content: "",
3243
- url: "https://example.com/onboarding-complete.jpg",
3244
- alt: "Onboarding Complete",
3245
- caption: "Congratulations on completing your onboarding!",
3246
- order: 3
3247
- }
3248
- ],
3249
- status: "pending"
3250
- }
3251
- ]
3252
- },
3253
- {
3254
- id: "wf-2",
3255
- name: "IT Asset Request",
3256
- description: "Request new hardware or software.",
3257
- steps: [
3258
- {
3259
- id: "s1",
3260
- title: "Request Details",
3261
- order: 1,
3262
- assignment: {
3263
- category: "individual",
3264
- type: "subject"
3265
- },
3266
- elements: [
3267
- {
3268
- id: "itq1",
3269
- type: "select",
3270
- label: "Asset Type",
3271
- order: 1,
3272
- required: !1,
3273
- options: ["Laptop", "Monitor", "Software License"]
3274
- }
3275
- ],
3276
- status: "pending"
3277
- },
3278
- {
3279
- id: "s2",
3280
- title: "Justification",
3281
- order: 2,
3282
- assignment: {
3283
- category: "role",
3284
- type: "instance_role_assignee_select",
3285
- targetId: "manager"
3286
- },
3287
- elements: [
3288
- {
3289
- id: "itq2",
3290
- type: "textarea",
3291
- label: "Reason",
3292
- order: 1,
3293
- required: !0
3294
- }
3295
- ],
3296
- status: "pending"
3297
- }
3298
- ]
3299
- }
3300
- ];
3301
- JSON.parse(JSON.stringify(Oe[0].steps));
3302
- JSON.parse(JSON.stringify(Oe[1].steps));
3303
- let w = class extends U {
3098
+ let w = class extends P {
3304
3099
  constructor() {
3305
3100
  super(...arguments), this._templateData = {
3306
3101
  name: "",
@@ -3361,7 +3156,7 @@ let w = class extends U {
3361
3156
  description: this._templateData.description || "",
3362
3157
  steps: this._templateData.steps || []
3363
3158
  };
3364
- console.log("💾 Builder Widget: Save button clicked"), console.log("📄 Workflow Template:", JSON.stringify(t, null, 2)), console.log("🔄 Calling onSave callback with workflow template"), (e = this.onSave) == null || e.call(this, t);
3159
+ console.log("💾 Builder Widget: Save button clicked"), console.log("📄 Workflow Template:", JSON.stringify(t, null, 2)), console.log("🔄 Calling onWorkflow updated callback with workflow template"), (e = this.onWorkflowUpdated) == null || e.call(this, t);
3365
3160
  } else
3366
3161
  console.log("⚠️ Builder Widget: Save attempted but no title provided");
3367
3162
  }
@@ -3413,9 +3208,7 @@ let w = class extends U {
3413
3208
  this._selectedStepId = i, console.log("🎯 Step selected:", i);
3414
3209
  }
3415
3210
  _getSelectedStep() {
3416
- return !this._selectedStepId || !this._templateData.steps ? null : this._templateData.steps.find(
3417
- (i) => i.id === this._selectedStepId
3418
- ) || null;
3211
+ return !this._selectedStepId || !this._templateData.steps ? null : this._templateData.steps.find((i) => i.id === this._selectedStepId) || null;
3419
3212
  }
3420
3213
  // Drag and Drop Methods
3421
3214
  _handleDragStart(i, e) {
@@ -3436,11 +3229,7 @@ let w = class extends U {
3436
3229
  this._draggedStepId = null, this._dragOverStepId = null;
3437
3230
  return;
3438
3231
  }
3439
- const t = this._templateData.steps || [], n = t.findIndex(
3440
- (a) => a.id === this._draggedStepId
3441
- ), s = t.findIndex(
3442
- (a) => a.id === e
3443
- );
3232
+ const t = this._templateData.steps || [], n = t.findIndex((a) => a.id === this._draggedStepId), s = t.findIndex((a) => a.id === e);
3444
3233
  if (n === -1 || s === -1) {
3445
3234
  console.error("Could not find step indices for reordering");
3446
3235
  return;
@@ -3471,9 +3260,7 @@ let w = class extends U {
3471
3260
  console.log("⚠️ No step selected");
3472
3261
  return;
3473
3262
  }
3474
- if (["text", "html", "divider", "markdown"].includes(
3475
- i
3476
- )) {
3263
+ if (["text", "html", "divider", "markdown"].includes(i)) {
3477
3264
  let r = {
3478
3265
  id: `c-${Date.now()}`,
3479
3266
  type: i,
@@ -3722,9 +3509,7 @@ Use **bold** and *italic* text.`;
3722
3509
  placeholder="Option ${t + 1}"
3723
3510
  .value=${e}
3724
3511
  @input=${(n) => {
3725
- const s = n.target, r = [
3726
- ...i.options || []
3727
- ];
3512
+ const s = n.target, r = [...i.options || []];
3728
3513
  r[t] = s.value, this._updateQuestion(i.id, {
3729
3514
  options: r
3730
3515
  });
@@ -3733,9 +3518,7 @@ Use **bold** and *italic* text.`;
3733
3518
  <button
3734
3519
  class="remove-option-button"
3735
3520
  @click=${() => {
3736
- const n = [
3737
- ...i.options || []
3738
- ];
3521
+ const n = [...i.options || []];
3739
3522
  n.splice(t, 1), this._updateQuestion(i.id, {
3740
3523
  options: n
3741
3524
  });
@@ -3750,10 +3533,7 @@ Use **bold** and *italic* text.`;
3750
3533
  <button
3751
3534
  class="add-option-button"
3752
3535
  @click=${() => {
3753
- const e = [
3754
- ...i.options || [],
3755
- ""
3756
- ];
3536
+ const e = [...i.options || [], ""];
3757
3537
  this._updateQuestion(i.id, {
3758
3538
  options: e
3759
3539
  });
@@ -3766,8 +3546,7 @@ Use **bold** and *italic* text.`;
3766
3546
  ` : l`
3767
3547
  <div class="single-checkbox-info">
3768
3548
  <p class="config-note">
3769
- Single checkbox - users can check/uncheck for Yes/No
3770
- response
3549
+ Single checkbox - users can check/uncheck for Yes/No response
3771
3550
  </p>
3772
3551
  </div>
3773
3552
  `}
@@ -3836,17 +3615,13 @@ Use **bold** and *italic* text.`;
3836
3615
  case "file_upload":
3837
3616
  return l`
3838
3617
  <div class="question-config-section">
3839
- <p class="config-note">
3840
- File upload field - users can upload files
3841
- </p>
3618
+ <p class="config-note">File upload field - users can upload files</p>
3842
3619
  </div>
3843
3620
  `;
3844
3621
  case "signature":
3845
3622
  return l`
3846
3623
  <div class="question-config-section">
3847
- <p class="config-note">
3848
- Digital signature pad - users can sign with mouse/touch
3849
- </p>
3624
+ <p class="config-note">Digital signature pad - users can sign with mouse/touch</p>
3850
3625
  </div>
3851
3626
  `;
3852
3627
  case "date":
@@ -4111,10 +3886,7 @@ Use **bold** and *italic* text.`;
4111
3886
  }
4112
3887
  _hasSteps() {
4113
3888
  const i = !!(this._templateData.steps && this._templateData.steps.length > 0);
4114
- return i && !this._selectedStepId && this._templateData.steps && (this._selectedStepId = this._templateData.steps[0].id, console.log(
4115
- "🎯 Auto-selected first step:",
4116
- this._templateData.steps[0].title
4117
- )), !i && this._selectedStepId && (this._selectedStepId = null), i;
3889
+ return i && !this._selectedStepId && this._templateData.steps && (this._selectedStepId = this._templateData.steps[0].id, console.log("🎯 Auto-selected first step:", this._templateData.steps[0].title)), !i && this._selectedStepId && (this._selectedStepId = null), i;
4118
3890
  }
4119
3891
  _getAssignmentDisplayText(i) {
4120
3892
  switch (i.category) {
@@ -4143,7 +3915,6 @@ Use **bold** and *italic* text.`;
4143
3915
  }
4144
3916
  }
4145
3917
  render() {
4146
- this._hasSteps();
4147
3918
  const i = this._getSelectedStep();
4148
3919
  return l`
4149
3920
  <div class="header">
@@ -4170,9 +3941,7 @@ Use **bold** and *italic* text.`;
4170
3941
  </div>
4171
3942
  </div>
4172
3943
  <div class="header-actions">
4173
- <button class="save-button" @click=${this._handleSave}>
4174
- Save template
4175
- </button>
3944
+ <button class="save-button" @click=${this._handleSave}>Save template</button>
4176
3945
  </div>
4177
3946
  </div>
4178
3947
 
@@ -4187,10 +3956,7 @@ Use **bold** and *italic* text.`;
4187
3956
  </div>
4188
3957
 
4189
3958
  <div class="steps-list">
4190
- <div
4191
- class="step-item selected"
4192
- @click=${() => this._selectStep("step-1")}
4193
- >
3959
+ <div class="step-item selected" @click=${() => this._selectStep("step-1")}>
4194
3960
  <div class="step-handle">⋮⋮</div>
4195
3961
  <div class="step-content">
4196
3962
  <strong>Step 1</strong>
@@ -4206,9 +3972,7 @@ Use **bold** and *italic* text.`;
4206
3972
  <div class="section">
4207
3973
  <div class="section-header">
4208
3974
  <h2>Questions</h2>
4209
- <button class="add-button" @click=${() => this._addQuestion()}>
4210
- Add
4211
- </button>
3975
+ <button class="add-button" @click=${() => this._addQuestion()}>Add</button>
4212
3976
  </div>
4213
3977
 
4214
3978
  ${i && i.elements && i.elements.length > 0 ? l`
@@ -4221,11 +3985,7 @@ Use **bold** and *italic* text.`;
4221
3985
  <div class="question-item">
4222
3986
  <div class="question-header">
4223
3987
  <h3 class="question-title">
4224
- ${s.label || (s.type === "checkbox" ? this._getCheckboxTypeDisplayName(
4225
- s
4226
- ) : this._getQuestionTypeDisplayName(
4227
- s.type
4228
- ))}
3988
+ ${s.label || (s.type === "checkbox" ? this._getCheckboxTypeDisplayName(s) : this._getQuestionTypeDisplayName(s.type))}
4229
3989
  </h3>
4230
3990
  <div class="question-header-controls">
4231
3991
  <select
@@ -4244,36 +4004,20 @@ Use **bold** and *italic* text.`;
4244
4004
  return;
4245
4005
  }
4246
4006
  const p = { type: a };
4247
- ["select", "radio", "checkbox"].includes(
4248
- a
4249
- ) && !s.options && (p.options = [
4250
- "Option 1",
4251
- "Option 2"
4252
- ]);
4007
+ ["select", "radio", "checkbox"].includes(a) && !s.options && (p.options = ["Option 1", "Option 2"]);
4253
4008
  const c = this._getQuestionTypeDisplayName(
4254
4009
  s.type
4255
4010
  );
4256
- (!s.label || s.label === c) && (p.label = this._getQuestionTypeDisplayName(
4257
- a
4258
- )), this._updateQuestion(
4259
- s.id,
4260
- p
4261
- );
4011
+ (!s.label || s.label === c) && (p.label = this._getQuestionTypeDisplayName(a)), this._updateQuestion(s.id, p);
4262
4012
  }}
4263
4013
  >
4264
4014
  <optgroup label="Questions">
4265
- <option value="text_input">
4266
- Text Input (short)
4267
- </option>
4268
- <option value="textarea">
4269
- Text Input (long)
4270
- </option>
4015
+ <option value="text_input">Text Input (short)</option>
4016
+ <option value="textarea">Text Input (long)</option>
4271
4017
  <option value="select">Select</option>
4272
4018
  <option value="radio">Radio</option>
4273
4019
  <option value="checkbox">Checkbox</option>
4274
- <option value="file_upload">
4275
- File Upload
4276
- </option>
4020
+ <option value="file_upload">File Upload</option>
4277
4021
  <option value="signature">Signature</option>
4278
4022
  <option value="number">Number</option>
4279
4023
  <option value="date">Date</option>
@@ -4308,9 +4052,7 @@ Use **bold** and *italic* text.`;
4308
4052
  }}
4309
4053
  />
4310
4054
 
4311
- ${this._renderQuestionTypeSpecificFields(
4312
- s
4313
- )}
4055
+ ${this._renderQuestionTypeSpecificFields(s)}
4314
4056
 
4315
4057
  <label class="question-required-label">
4316
4058
  <input
@@ -4333,9 +4075,7 @@ Use **bold** and *italic* text.`;
4333
4075
  <div class="question-item">
4334
4076
  <div class="question-header">
4335
4077
  <h3 class="question-title">
4336
- ${this._getContentTypeDisplayName(
4337
- s.type
4338
- )}
4078
+ ${this._getContentTypeDisplayName(s.type)}
4339
4079
  </h3>
4340
4080
  <div class="question-header-controls">
4341
4081
  <select
@@ -4357,18 +4097,12 @@ Use **bold** and *italic* text.`;
4357
4097
  }}
4358
4098
  >
4359
4099
  <optgroup label="Questions">
4360
- <option value="text_input">
4361
- Text Input (short)
4362
- </option>
4363
- <option value="textarea">
4364
- Text Input (long)
4365
- </option>
4100
+ <option value="text_input">Text Input (short)</option>
4101
+ <option value="textarea">Text Input (long)</option>
4366
4102
  <option value="select">Select</option>
4367
4103
  <option value="radio">Radio</option>
4368
4104
  <option value="checkbox">Checkbox</option>
4369
- <option value="file_upload">
4370
- File Upload
4371
- </option>
4105
+ <option value="file_upload">File Upload</option>
4372
4106
  <option value="signature">Signature</option>
4373
4107
  <option value="number">Number</option>
4374
4108
  <option value="date">Date</option>
@@ -4390,9 +4124,7 @@ Use **bold** and *italic* text.`;
4390
4124
  </div>
4391
4125
  </div>
4392
4126
  <div class="question-content">
4393
- ${this._renderContentTypeSpecificFields(
4394
- s
4395
- )}
4127
+ ${this._renderContentTypeSpecificFields(s)}
4396
4128
  </div>
4397
4129
  </div>
4398
4130
  `;
@@ -4421,9 +4153,7 @@ Use **bold** and *italic* text.`;
4421
4153
  <div class="empty-state">
4422
4154
  <h3>Add questions</h3>
4423
4155
  <p>Use the add button to start building your workflow</p>
4424
- <button class="add-button" @click=${() => this._addQuestion()}>
4425
- Add
4426
- </button>
4156
+ <button class="add-button" @click=${() => this._addQuestion()}>Add</button>
4427
4157
  </div>
4428
4158
  `}
4429
4159
  </div>
@@ -4433,11 +4163,11 @@ Use **bold** and *italic* text.`;
4433
4163
  }
4434
4164
  };
4435
4165
  w.styles = N`
4166
+ ${pt}
4436
4167
  ${ct}
4437
4168
  ${ut}
4438
- ${ht}
4439
4169
  ${Ne}
4440
- ${gt}
4170
+ ${ht}
4441
4171
  `;
4442
4172
  C([
4443
4173
  _()
@@ -4469,7 +4199,7 @@ C([
4469
4199
  w = C([
4470
4200
  Le("builder-widget")
4471
4201
  ], w);
4472
- class bt {
4202
+ class mt {
4473
4203
  constructor(e, t) {
4474
4204
  this.signaturePads = e, this.savedSignatures = t;
4475
4205
  }
@@ -4484,7 +4214,10 @@ class bt {
4484
4214
  if (this.isQuestionElement(o)) {
4485
4215
  const a = o;
4486
4216
  if (a.required) {
4487
- const d = this.validateQuestion(a, t[a.id]);
4217
+ const d = this.validateQuestion(
4218
+ a,
4219
+ t[a.id]
4220
+ );
4488
4221
  d && (s = !1, r[a.id] = d.message);
4489
4222
  }
4490
4223
  }
@@ -4552,7 +4285,7 @@ class bt {
4552
4285
  ].includes(e.type);
4553
4286
  }
4554
4287
  }
4555
- class vt {
4288
+ class bt {
4556
4289
  getStorageKey(e) {
4557
4290
  return `runner-form-data-${e || "default"}`;
4558
4291
  }
@@ -4637,10 +4370,10 @@ class be {
4637
4370
  return new be(e[1], n, s, e[2], t.start, t.end);
4638
4371
  }
4639
4372
  static calculateControlPoints(e, t, n) {
4640
- const s = e.x - t.x, r = e.y - t.y, o = t.x - n.x, a = t.y - n.y, d = { x: (e.x + t.x) / 2, y: (e.y + t.y) / 2 }, p = { x: (t.x + n.x) / 2, y: (t.y + n.y) / 2 }, c = Math.sqrt(s * s + r * r), u = Math.sqrt(o * o + a * a), h = d.x - p.x, g = d.y - p.y, b = c + u == 0 ? 0 : u / (c + u), k = { x: p.x + h * b, y: p.y + g * b }, q = t.x - k.x, G = t.y - k.y;
4373
+ const s = e.x - t.x, r = e.y - t.y, o = t.x - n.x, a = t.y - n.y, d = { x: (e.x + t.x) / 2, y: (e.y + t.y) / 2 }, p = { x: (t.x + n.x) / 2, y: (t.y + n.y) / 2 }, c = Math.sqrt(s * s + r * r), u = Math.sqrt(o * o + a * a), h = d.x - p.x, g = d.y - p.y, b = c + u == 0 ? 0 : u / (c + u), k = { x: p.x + h * b, y: p.y + g * b }, G = t.x - k.x, Y = t.y - k.y;
4641
4374
  return {
4642
- c1: new X(d.x + q, d.y + G),
4643
- c2: new X(p.x + q, p.y + G)
4375
+ c1: new X(d.x + G, d.y + Y),
4376
+ c2: new X(p.x + G, p.y + Y)
4644
4377
  };
4645
4378
  }
4646
4379
  constructor(e, t, n, s, r, o) {
@@ -4662,7 +4395,7 @@ class be {
4662
4395
  return t * (1 - e) * (1 - e) * (1 - e) + 3 * n * (1 - e) * (1 - e) * e + 3 * s * (1 - e) * e * e + r * e * e * e;
4663
4396
  }
4664
4397
  }
4665
- class xt {
4398
+ class vt {
4666
4399
  constructor() {
4667
4400
  try {
4668
4401
  this._et = new EventTarget();
@@ -4680,7 +4413,7 @@ class xt {
4680
4413
  this._et.removeEventListener(e, t, n);
4681
4414
  }
4682
4415
  }
4683
- function _t(i, e = 250) {
4416
+ function xt(i, e = 250) {
4684
4417
  let t = 0, n = null, s, r, o;
4685
4418
  const a = () => {
4686
4419
  t = Date.now(), n = null, s = i.apply(r, o), n || (r = null, o = []);
@@ -4690,10 +4423,10 @@ function _t(i, e = 250) {
4690
4423
  return r = this, o = p, u <= 0 || u > e ? (n && (clearTimeout(n), n = null), t = c, s = i.apply(r, o), n || (r = null, o = [])) : n || (n = window.setTimeout(a, u)), s;
4691
4424
  };
4692
4425
  }
4693
- class Z extends xt {
4426
+ class Z extends vt {
4694
4427
  constructor(e, t = {}) {
4695
4428
  var n, s, r;
4696
- super(), this.canvas = e, this._drawingStroke = !1, this._isEmpty = !0, this._lastPoints = [], this._data = [], this._lastVelocity = 0, this._lastWidth = 0, this.velocityFilterWeight = t.velocityFilterWeight || 0.7, this.minWidth = t.minWidth || 0.5, this.maxWidth = t.maxWidth || 2.5, this.throttle = (n = t.throttle) !== null && n !== void 0 ? n : 16, this.minDistance = (s = t.minDistance) !== null && s !== void 0 ? s : 5, this.dotSize = t.dotSize || 0, this.penColor = t.penColor || "black", this.backgroundColor = t.backgroundColor || "rgba(0,0,0,0)", this.compositeOperation = t.compositeOperation || "source-over", this.canvasContextOptions = (r = t.canvasContextOptions) !== null && r !== void 0 ? r : {}, this._strokeMoveUpdate = this.throttle ? _t(Z.prototype._strokeUpdate, this.throttle) : Z.prototype._strokeUpdate, this._handleMouseDown = this._handleMouseDown.bind(this), this._handleMouseMove = this._handleMouseMove.bind(this), this._handleMouseUp = this._handleMouseUp.bind(this), this._handleTouchStart = this._handleTouchStart.bind(this), this._handleTouchMove = this._handleTouchMove.bind(this), this._handleTouchEnd = this._handleTouchEnd.bind(this), this._handlePointerDown = this._handlePointerDown.bind(this), this._handlePointerMove = this._handlePointerMove.bind(this), this._handlePointerUp = this._handlePointerUp.bind(this), this._ctx = e.getContext("2d", this.canvasContextOptions), this.clear(), this.on();
4429
+ super(), this.canvas = e, this._drawingStroke = !1, this._isEmpty = !0, this._lastPoints = [], this._data = [], this._lastVelocity = 0, this._lastWidth = 0, this.velocityFilterWeight = t.velocityFilterWeight || 0.7, this.minWidth = t.minWidth || 0.5, this.maxWidth = t.maxWidth || 2.5, this.throttle = (n = t.throttle) !== null && n !== void 0 ? n : 16, this.minDistance = (s = t.minDistance) !== null && s !== void 0 ? s : 5, this.dotSize = t.dotSize || 0, this.penColor = t.penColor || "black", this.backgroundColor = t.backgroundColor || "rgba(0,0,0,0)", this.compositeOperation = t.compositeOperation || "source-over", this.canvasContextOptions = (r = t.canvasContextOptions) !== null && r !== void 0 ? r : {}, this._strokeMoveUpdate = this.throttle ? xt(Z.prototype._strokeUpdate, this.throttle) : Z.prototype._strokeUpdate, this._handleMouseDown = this._handleMouseDown.bind(this), this._handleMouseMove = this._handleMouseMove.bind(this), this._handleMouseUp = this._handleMouseUp.bind(this), this._handleTouchStart = this._handleTouchStart.bind(this), this._handleTouchMove = this._handleTouchMove.bind(this), this._handleTouchEnd = this._handleTouchEnd.bind(this), this._handlePointerDown = this._handlePointerDown.bind(this), this._handlePointerMove = this._handlePointerMove.bind(this), this._handlePointerUp = this._handlePointerUp.bind(this), this._ctx = e.getContext("2d", this.canvasContextOptions), this.clear(), this.on();
4697
4430
  }
4698
4431
  clear() {
4699
4432
  const { _ctx: e, canvas: t } = this;
@@ -4972,7 +4705,7 @@ class Z extends xt {
4972
4705
  }), d.outerHTML;
4973
4706
  }
4974
4707
  }
4975
- class yt {
4708
+ class _t {
4976
4709
  constructor(e) {
4977
4710
  this.signaturePads = /* @__PURE__ */ new Map(), this.canvasElements = /* @__PURE__ */ new Map(), this.onSignatureChange = e;
4978
4711
  }
@@ -5121,7 +4854,7 @@ class St {
5121
4854
  ].includes(e);
5122
4855
  }
5123
4856
  }
5124
- class wt {
4857
+ class yt {
5125
4858
  constructor(e, t) {
5126
4859
  this.mode = e, this.currentUser = t;
5127
4860
  }
@@ -5405,11 +5138,7 @@ const te = class te {
5405
5138
  this.formStateManager.clearValidationError(e);
5406
5139
  const a = this.createFileInfo(r);
5407
5140
  this.formStateManager.setFormField(e, a);
5408
- const d = this.hasFileChanged(
5409
- e,
5410
- a,
5411
- n.savedInstance
5412
- );
5141
+ const d = this.hasFileChanged(e, a, n.savedInstance);
5413
5142
  d && n.mode !== "preview" ? this.executeFileUploadCallback(e, r, a, n) : this.logSkippedCallback(e, n.mode, d), (h = n.onRequestUpdate) == null || h.call(n), n.mode !== "admin" && ((g = n.onFormDataSave) == null || g.call(n));
5414
5143
  }
5415
5144
  /**
@@ -5448,9 +5177,7 @@ const te = class te {
5448
5177
  if (!(n != null && n.steps)) return !0;
5449
5178
  for (const s of n.steps)
5450
5179
  if (s.responses) {
5451
- const r = s.responses.find(
5452
- (o) => o.elementId === e
5453
- );
5180
+ const r = s.responses.find((o) => o.elementId === e);
5454
5181
  if (r && r.value && typeof r.value == "object") {
5455
5182
  const o = r.value;
5456
5183
  return o.name !== t.name || o.size !== t.size || o.type !== t.type || o.lastModified !== t.lastModified;
@@ -5477,15 +5204,12 @@ const te = class te {
5477
5204
  * Logs when file upload callback is skipped
5478
5205
  */
5479
5206
  logSkippedCallback(e, t, n) {
5480
- t === "preview" ? console.log(
5481
- "Preview mode: skipping file upload callback for:",
5482
- e
5483
- ) : n || console.log("File unchanged, skipping callback for:", e);
5207
+ t === "preview" ? console.log("Preview mode: skipping file upload callback for:", e) : n || console.log("File unchanged, skipping callback for:", e);
5484
5208
  }
5485
5209
  };
5486
5210
  te.MAX_FILE_SIZE = 5 * 1024 * 1024;
5487
5211
  let ce = te;
5488
- class S {
5212
+ class y {
5489
5213
  /**
5490
5214
  * Determines if a form element should be disabled based on context
5491
5215
  * Centralizes the disabled logic for consistency across all input types
@@ -5516,7 +5240,7 @@ class S {
5516
5240
  // Extract file extension and guess type
5517
5241
  static _guessFileTypeFromUrl(e) {
5518
5242
  var r;
5519
- const n = (r = S._extractFilenameFromUrl(e).split(".").pop()) == null ? void 0 : r.toLowerCase();
5243
+ const n = (r = y._extractFilenameFromUrl(e).split(".").pop()) == null ? void 0 : r.toLowerCase();
5520
5244
  return n ? {
5521
5245
  pdf: "PDF Document",
5522
5246
  doc: "Word Document",
@@ -5560,9 +5284,7 @@ class S {
5560
5284
  @change=${(r) => n.handlers.handleInputChange(e.id, r)}
5561
5285
  >
5562
5286
  <option value="">Choose</option>
5563
- ${(s = e.options) == null ? void 0 : s.map(
5564
- (r) => l`<option value=${r}>${r}</option>`
5565
- )}
5287
+ ${(s = e.options) == null ? void 0 : s.map((r) => l`<option value=${r}>${r}</option>`)}
5566
5288
  </select>`;
5567
5289
  }
5568
5290
  static renderRadio(e, t, n) {
@@ -5598,9 +5320,7 @@ class S {
5598
5320
  ${a.length > 0 ? a.map((d) => l`<div>• ${d}</div>`) : l`<span class="print-no-response">No selections made</span>`}
5599
5321
  </div>`;
5600
5322
  }
5601
- return l`<div
5602
- class="checkbox-group ${r ? "print-mode" : ""}"
5603
- >
5323
+ return l`<div class="checkbox-group ${r ? "print-mode" : ""}">
5604
5324
  ${(o = e.options) == null ? void 0 : o.map(
5605
5325
  (a) => l`
5606
5326
  <label class="checkbox-option">
@@ -5610,11 +5330,7 @@ class S {
5610
5330
  value=${a}
5611
5331
  .checked=${Array.isArray(t) ? t.includes(a) : !1}
5612
5332
  ?disabled=${s}
5613
- @change=${r ? null : (d) => n.handlers.handleCheckboxGroupChange(
5614
- e.id,
5615
- a,
5616
- d
5617
- )}
5333
+ @change=${r ? null : (d) => n.handlers.handleCheckboxGroupChange(e.id, a, d)}
5618
5334
  />
5619
5335
  <span class="checkbox-label">${a}</span>
5620
5336
  </label>
@@ -5624,9 +5340,7 @@ class S {
5624
5340
  } else
5625
5341
  return r ? l`<div class="print-response-value checkbox-response">
5626
5342
  ${t ? "Yes" : "No"}
5627
- </div>` : l`<label
5628
- class="checkbox-single ${r ? "print-mode" : ""}"
5629
- >
5343
+ </div>` : l`<label class="checkbox-single ${r ? "print-mode" : ""}">
5630
5344
  <input
5631
5345
  type="checkbox"
5632
5346
  id=${e.id}
@@ -5650,9 +5364,7 @@ class S {
5650
5364
  var u;
5651
5365
  const p = d.target;
5652
5366
  p.style.display = "none";
5653
- const c = (u = p.parentElement) == null ? void 0 : u.querySelector(
5654
- ".signature-fallback"
5655
- );
5367
+ const c = (u = p.parentElement) == null ? void 0 : u.querySelector(".signature-fallback");
5656
5368
  c && c.classList.remove("hidden");
5657
5369
  }}
5658
5370
  />
@@ -5674,9 +5386,7 @@ class S {
5674
5386
  var u;
5675
5387
  const p = d.target;
5676
5388
  p.style.display = "none";
5677
- const c = (u = p.parentElement) == null ? void 0 : u.querySelector(
5678
- ".signature-fallback"
5679
- );
5389
+ const c = (u = p.parentElement) == null ? void 0 : u.querySelector(".signature-fallback");
5680
5390
  c && c.classList.remove("hidden");
5681
5391
  }}
5682
5392
  />
@@ -5694,12 +5404,7 @@ class S {
5694
5404
  return l`
5695
5405
  <div class="signature-admin-display">
5696
5406
  <div class="signature-existing">
5697
- ${d ? l`
5698
- <div
5699
- class="signature-svg-container"
5700
- .innerHTML=${s}
5701
- ></div>
5702
- ` : l`
5407
+ ${d ? l` <div class="signature-svg-container" .innerHTML=${s}></div> ` : l`
5703
5408
  <img
5704
5409
  src="${s}"
5705
5410
  alt="Digital Signature"
@@ -5708,16 +5413,12 @@ class S {
5708
5413
  var h;
5709
5414
  const c = p.target;
5710
5415
  c.style.display = "none";
5711
- const u = (h = c.parentElement) == null ? void 0 : h.querySelector(
5712
- ".signature-fallback"
5713
- );
5416
+ const u = (h = c.parentElement) == null ? void 0 : h.querySelector(".signature-fallback");
5714
5417
  u && u.classList.remove("hidden");
5715
5418
  }}
5716
5419
  />
5717
5420
  <div class="signature-fallback hidden">
5718
- <span class="signature-error"
5719
- >Unable to display signature</span
5720
- >
5421
+ <span class="signature-error">Unable to display signature</span>
5721
5422
  </div>
5722
5423
  `}
5723
5424
  </div>
@@ -5734,9 +5435,7 @@ class S {
5734
5435
  `;
5735
5436
  }
5736
5437
  return l`
5737
- <div
5738
- class="signature-container ${this._isInputDisabled(n) ? "disabled" : ""}"
5739
- >
5438
+ <div class="signature-container ${this._isInputDisabled(n) ? "disabled" : ""}">
5740
5439
  <canvas id="signature-${e.id}" class="signature-canvas"></canvas>
5741
5440
  <div class="signature-controls">
5742
5441
  <button
@@ -5782,37 +5481,23 @@ class S {
5782
5481
  <div class="print-response-value file-response">
5783
5482
  📎 ${s.name}
5784
5483
  ${s.size ? l` <span class="file-size"
5785
- >(${S._formatFileSize(
5786
- s.size
5787
- )})</span
5484
+ >(${y._formatFileSize(s.size)})</span
5788
5485
  >` : ""}
5789
5486
  </div>
5790
5487
  `;
5791
5488
  if (r) {
5792
- const a = S._extractFilenameFromUrl(s);
5793
- return l`
5794
- <div class="print-response-value file-response">
5795
- 📎 ${a}
5796
- </div>
5797
- `;
5489
+ const a = y._extractFilenameFromUrl(s);
5490
+ return l` <div class="print-response-value file-response">📎 ${a}</div> `;
5798
5491
  } else
5799
- return l`
5800
- <div class="print-response-value file-response">
5801
- 📎 ${s}
5802
- </div>
5803
- `;
5492
+ return l` <div class="print-response-value file-response">📎 ${s}</div> `;
5804
5493
  } else {
5805
- const a = r ? s : "#", d = o ? s.name : r ? S._extractFilenameFromUrl(s) : "View File";
5494
+ const a = r ? s : "#", d = o ? s.name : r ? y._extractFilenameFromUrl(s) : "View File";
5806
5495
  return l`
5807
5496
  <div class="file-upload-view-only">
5808
- <a href="${a}" target="_blank" class="file-link">
5809
- 📎 ${d}
5810
- </a>
5497
+ <a href="${a}" target="_blank" class="file-link"> 📎 ${d} </a>
5811
5498
  ${o && s.size ? l`
5812
5499
  <span class="file-size-info"
5813
- >(${S._formatFileSize(
5814
- s.size
5815
- )})</span
5500
+ >(${y._formatFileSize(s.size)})</span
5816
5501
  >
5817
5502
  ` : ""}
5818
5503
  </div>
@@ -5839,9 +5524,7 @@ class S {
5839
5524
  />
5840
5525
  ${s ? l`
5841
5526
  <div class="file-preview">
5842
- <span class="file-name"
5843
- >${s.name || "File selected"}</span
5844
- >
5527
+ <span class="file-name">${s.name || "File selected"}</span>
5845
5528
  <button
5846
5529
  type="button"
5847
5530
  class="file-clear-btn"
@@ -5879,19 +5562,19 @@ class S {
5879
5562
  const n = t.formData[e.id] ?? "", s = t.validationErrors[e.id], r = () => {
5880
5563
  switch (e.type) {
5881
5564
  case "textarea":
5882
- return S.renderTextArea(e, n, t);
5565
+ return y.renderTextArea(e, n, t);
5883
5566
  case "select":
5884
- return S.renderSelect(e, n, t);
5567
+ return y.renderSelect(e, n, t);
5885
5568
  case "radio":
5886
- return S.renderRadio(e, n, t);
5569
+ return y.renderRadio(e, n, t);
5887
5570
  case "checkbox":
5888
- return S.renderCheckbox(e, n, t);
5571
+ return y.renderCheckbox(e, n, t);
5889
5572
  case "signature":
5890
- return S.renderSignature(e, n, t);
5573
+ return y.renderSignature(e, n, t);
5891
5574
  case "file_upload":
5892
- return S.renderFileUpload(e, n, t);
5575
+ return y.renderFileUpload(e, n, t);
5893
5576
  default:
5894
- return S.renderDefaultInput(e, n, t);
5577
+ return y.renderDefaultInput(e, n, t);
5895
5578
  }
5896
5579
  }, o = e.type === "checkbox" && (!e.options || e.options.length === 0);
5897
5580
  return t.mode === "print" ? l`
@@ -5919,8 +5602,8 @@ class S {
5919
5602
  * Copyright 2017 Google LLC
5920
5603
  * SPDX-License-Identifier: BSD-3-Clause
5921
5604
  */
5922
- const kt = { CHILD: 2 }, $t = (i) => (...e) => ({ _$litDirective$: i, values: e });
5923
- class Dt {
5605
+ const wt = { CHILD: 2 }, kt = (i) => (...e) => ({ _$litDirective$: i, values: e });
5606
+ class $t {
5924
5607
  constructor(e) {
5925
5608
  }
5926
5609
  get _$AU() {
@@ -5941,13 +5624,13 @@ class Dt {
5941
5624
  * Copyright 2017 Google LLC
5942
5625
  * SPDX-License-Identifier: BSD-3-Clause
5943
5626
  */
5944
- class ue extends Dt {
5627
+ class ue extends $t {
5945
5628
  constructor(e) {
5946
- if (super(e), this.it = v, e.type !== kt.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
5629
+ if (super(e), this.it = v, e.type !== wt.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
5947
5630
  }
5948
5631
  render(e) {
5949
5632
  if (e === v || e == null) return this._t = void 0, this.it = e;
5950
- if (e === I) return e;
5633
+ if (e === U) return e;
5951
5634
  if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
5952
5635
  if (e === this.it) return this._t;
5953
5636
  this.it = e;
@@ -5956,7 +5639,7 @@ class ue extends Dt {
5956
5639
  }
5957
5640
  }
5958
5641
  ue.directiveName = "unsafeHTML", ue.resultType = 1;
5959
- const Ae = $t(ue);
5642
+ const Ae = kt(ue);
5960
5643
  class $ {
5961
5644
  static renderMarkdown(e) {
5962
5645
  return e.replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*(.*?)\*\*/gim, "<strong>$1</strong>").replace(/\*(.*?)\*/gim, "<em>$1</em>").replace(/`(.*?)`/gim, "<code>$1</code>").replace(/^> (.*$)/gim, "<blockquote>$1</blockquote>").replace(/\n/gim, "<br>");
@@ -6065,16 +5748,16 @@ class Me {
6065
5748
  <div class="runner-mobile-steps">
6066
5749
  <nav aria-label="Workflow steps">
6067
5750
  <div class="runner-mobile-steps-container">
6068
- ${t == null ? void 0 : t.map((s, r) => {
6069
- const o = e.isStepAssignedToUser(s), a = e.completedSteps.has(s.id);
5751
+ ${t == null ? void 0 : t.map((s) => {
5752
+ const r = e.isStepAssignedToUser(s), o = e.completedSteps.has(s.id);
6070
5753
  return l`
6071
5754
  <div
6072
- class="runner-mobile-step-tab ${a ? "completed" : ""} ${o ? "" : "unassigned"} ${n ? "disabled" : ""}"
6073
- style="cursor: not-allowed; opacity: ${n ? "0.6" : o ? "1" : "0.6"};"
5755
+ class="runner-mobile-step-tab ${o ? "completed" : ""} ${r ? "" : "unassigned"} ${n ? "disabled" : ""}"
5756
+ style="cursor: not-allowed; opacity: ${n ? "0.6" : r ? "1" : "0.6"};"
6074
5757
  >
6075
5758
  <span class="runner-mobile-step-title">${s.title}</span>
6076
5759
  <span class="runner-mobile-step-badge">
6077
- ${a ? "Completed" : o ? "Your Step" : "Other User"}
5760
+ ${o ? "Completed" : r ? "Your Step" : "Other User"}
6078
5761
  </span>
6079
5762
  </div>
6080
5763
  `;
@@ -6101,12 +5784,10 @@ class Me {
6101
5784
  <path d="m7 11V7a5 5 0 0 1 10 0v4"></path>
6102
5785
  </svg>
6103
5786
  </div>
6104
- <h2 class="not-assigned-title">
6105
- This workflow is not assigned to you
6106
- </h2>
5787
+ <h2 class="not-assigned-title">This workflow is not assigned to you</h2>
6107
5788
  <p class="not-assigned-description">
6108
- You don't have any steps assigned in this workflow. Please contact
6109
- your administrator if you believe this is an error.
5789
+ You don't have any steps assigned in this workflow. Please contact your administrator if
5790
+ you believe this is an error.
6110
5791
  </p>
6111
5792
  </div>
6112
5793
  </div>
@@ -6129,16 +5810,16 @@ class Me {
6129
5810
  <div class="runner-sidebar-header">Steps</div>
6130
5811
  <nav aria-label="Workflow steps">
6131
5812
  <ul class="runner-steps-list">
6132
- ${(s = (n = e.instance) == null ? void 0 : n.steps) == null ? void 0 : s.map((r, o) => {
6133
- const a = e.isStepAssignedToUser(r), d = e.completedSteps.has(r.id);
5813
+ ${(s = (n = e.instance) == null ? void 0 : n.steps) == null ? void 0 : s.map((r) => {
5814
+ const o = e.isStepAssignedToUser(r), a = e.completedSteps.has(r.id);
6134
5815
  return l`
6135
5816
  <li
6136
- class="runner-step-item ${d ? "completed" : ""} ${a ? "" : "unassigned"}"
6137
- style="opacity: ${a ? "1" : "0.6"}; cursor: not-allowed;"
5817
+ class="runner-step-item ${a ? "completed" : ""} ${o ? "" : "unassigned"}"
5818
+ style="opacity: ${o ? "1" : "0.6"}; cursor: not-allowed;"
6138
5819
  >
6139
5820
  <span class="runner-step-title">${r.title}</span>
6140
5821
  <span class="runner-step-badge">
6141
- ${d ? "Submitted" : a ? "Your Step" : "Other User"}
5822
+ ${a ? "Submitted" : o ? "Your Step" : "Other User"}
6142
5823
  </span>
6143
5824
  </li>
6144
5825
  `;
@@ -6190,9 +5871,7 @@ class R {
6190
5871
  <nav aria-label="Workflow steps">
6191
5872
  <ul class="runner-steps-list">
6192
5873
  ${t == null ? void 0 : t.map((n, s) => {
6193
- const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r), d = (e.isSubmitted || e.userStepsSubmitted) && e.mode !== "preview" && e.mode !== "admin" && e.mode !== "view-only" && e.mode !== "print";
6194
- e.mode;
6195
- const p = e.isLoading;
5874
+ const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r), d = (e.isSubmitted || e.userStepsSubmitted) && e.mode !== "preview" && e.mode !== "admin" && e.mode !== "view-only" && e.mode !== "print", p = e.isLoading;
6196
5875
  return l`
6197
5876
  <li
6198
5877
  class="runner-step-item ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${d ? "disabled" : ""} ${p ? "loading-disabled" : ""}"
@@ -6218,9 +5897,7 @@ class R {
6218
5897
  <nav aria-label="Workflow steps">
6219
5898
  <div class="runner-mobile-steps-container">
6220
5899
  ${t == null ? void 0 : t.map((n, s) => {
6221
- const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r), d = (e.isSubmitted || e.userStepsSubmitted) && e.mode !== "preview" && e.mode !== "admin" && e.mode !== "view-only" && e.mode !== "print";
6222
- e.mode;
6223
- const p = e.isLoading;
5900
+ const r = e.mode === "preview" || e.mode === "admin" || e.mode === "view-only" || e.mode === "print" || e.isStepAssignedToUser(n), o = s === e.currentStepIndex, a = this.isStepCompleted(n, e, r), d = (e.isSubmitted || e.userStepsSubmitted) && e.mode !== "preview" && e.mode !== "admin" && e.mode !== "view-only" && e.mode !== "print", p = e.isLoading;
6224
5901
  return l`
6225
5902
  <button
6226
5903
  class="runner-mobile-step-tab ${o ? "active" : ""} ${a ? "completed" : ""} ${r ? "" : "unassigned"} ${d ? "disabled" : ""} ${p ? "loading-disabled" : ""}"
@@ -6245,9 +5922,7 @@ class R {
6245
5922
  return n === "print" ? l`
6246
5923
  <div class="step-print-header">
6247
5924
  <div class="print-step-title">${t.title}</div>
6248
- ${t.description ? l`<div class="print-step-description">
6249
- ${t.description}
6250
- </div>` : ""}
5925
+ ${t.description ? l`<div class="print-step-description">${t.description}</div>` : ""}
6251
5926
  <hr class="print-question-separator" />
6252
5927
  </div>
6253
5928
  ` : l`
@@ -6259,7 +5934,7 @@ class R {
6259
5934
  `;
6260
5935
  }
6261
5936
  }
6262
- class Ct {
5937
+ class Dt {
6263
5938
  static renderFormActions(e) {
6264
5939
  return e.mode === "preview" || e.mode === "view-only" || e.mode === "print" || !e.isCurrentStepAssigned ? l`` : l`
6265
5940
  <div class="runner-form-actions">
@@ -6312,12 +5987,12 @@ class le {
6312
5987
  r(u), a !== "preview" && o(e, c);
6313
5988
  }
6314
5989
  }
6315
- var Et = Object.defineProperty, At = Object.getOwnPropertyDescriptor, x = (i, e, t, n) => {
6316
- for (var s = n > 1 ? void 0 : n ? At(e, t) : e, r = i.length - 1, o; r >= 0; r--)
5990
+ var Ct = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, x = (i, e, t, n) => {
5991
+ for (var s = n > 1 ? void 0 : n ? Et(e, t) : e, r = i.length - 1, o; r >= 0; r--)
6317
5992
  (o = i[r]) && (s = (n ? o(e, t, s) : o(s)) || s);
6318
- return n && s && Et(e, t, s), s;
5993
+ return n && s && Ct(e, t, s), s;
6319
5994
  };
6320
- let m = class extends U {
5995
+ let m = class extends P {
6321
5996
  constructor() {
6322
5997
  super(...arguments), this.mode = "default", this.isLoading = !1, this._currentStepIndex = 0, this._formData = {}, this._validationErrors = {}, this._internalCompletedSteps = /* @__PURE__ */ new Set(), this._formRestorationComplete = !1, this._savedSignatures = /* @__PURE__ */ new Set(), this._replacingSignatures = /* @__PURE__ */ new Set(), this._isSubmitted = !1, this._userStepsSubmitted = !1, this._justSaved = !1;
6323
5998
  }
@@ -6332,22 +6007,16 @@ let m = class extends U {
6332
6007
  super.disconnectedCallback(), window.removeEventListener("resize", this._handleResize.bind(this)), (i = this.signatureManager) == null || i.destroy();
6333
6008
  }
6334
6009
  _initializeServices() {
6335
- this.persistenceManager = new vt(), this.responseTracker = new St(), this.formStateManager = new pe(), this.signatureManager = new yt(
6010
+ this.persistenceManager = new bt(), this.responseTracker = new St(), this.formStateManager = new pe(), this.signatureManager = new _t(
6336
6011
  (i) => this._handleSignatureChange(i)
6337
- ), this.fileUploadManager = new ce(
6338
- this.formStateManager,
6339
- this.responseTracker
6340
- ), this._updateNavigationService(), this._updateValidationService();
6012
+ ), this.fileUploadManager = new ce(this.formStateManager, this.responseTracker), this._updateNavigationService(), this._updateValidationService();
6341
6013
  }
6342
6014
  _updateNavigationService() {
6343
- this.navigationService = new wt(
6344
- this.mode || "default",
6345
- this.currentUser
6346
- );
6015
+ this.navigationService = new yt(this.mode || "default", this.currentUser);
6347
6016
  }
6348
6017
  _updateValidationService() {
6349
6018
  var i;
6350
- this.validationService = new bt(
6019
+ this.validationService = new mt(
6351
6020
  ((i = this.signatureManager) == null ? void 0 : i.getAllSignaturePads()) || /* @__PURE__ */ new Map(),
6352
6021
  this._savedSignatures
6353
6022
  );
@@ -6391,10 +6060,7 @@ let m = class extends U {
6391
6060
  };
6392
6061
  }
6393
6062
  _handleSignatureChange(i) {
6394
- this.formStateManager.setFormField(i.questionId, i.hasSignature), this.formStateManager.setFormField(
6395
- `${i.questionId}_signatureData`,
6396
- i.signatureData
6397
- ), this._formData = this.formStateManager.getFormData(), this._savedSignatures.has(i.questionId) && (this._savedSignatures = new Set(
6063
+ this.formStateManager.setFormField(i.questionId, i.hasSignature), this.formStateManager.setFormField(`${i.questionId}_signatureData`, i.signatureData), this._formData = this.formStateManager.getFormData(), this._savedSignatures.has(i.questionId) && (this._savedSignatures = new Set(
6398
6064
  [...this._savedSignatures].filter((e) => e !== i.questionId)
6399
6065
  )), this._clearValidationError(i.questionId), this.mode !== "admin" && this._saveFormDataToHistory();
6400
6066
  }
@@ -6446,19 +6112,13 @@ let m = class extends U {
6446
6112
  var i;
6447
6113
  !((i = this.instance) != null && i.steps) || this.instance.steps.length === 0 || (this.formStateManager.initializeFromResponses(this.instance.steps), this._formData = this.formStateManager.getFormData(), this._currentStepIndex = 0, this.instance.steps.forEach((e) => {
6448
6114
  e.responses && e.responses.length > 0 ? (e.status = "completed", this._internalCompletedSteps.add(e.id)) : e.status = "pending";
6449
- }), console.log(
6450
- "View-only mode initialized with existing responses:",
6451
- this._formData
6452
- ));
6115
+ }), console.log("View-only mode initialized with existing responses:", this._formData));
6453
6116
  }
6454
6117
  _initializePrintMode() {
6455
6118
  var i;
6456
6119
  !((i = this.instance) != null && i.steps) || this.instance.steps.length === 0 || (this.formStateManager.initializeFromResponses(this.instance.steps), this._formData = this.formStateManager.getFormData(), this._currentStepIndex = 0, this.instance.steps.forEach((e) => {
6457
6120
  e.responses && e.responses.length > 0 ? (e.status = "completed", this._internalCompletedSteps.add(e.id)) : e.status = "pending";
6458
- }), console.log(
6459
- "Print mode initialized with existing responses:",
6460
- this._formData
6461
- ));
6121
+ }), console.log("Print mode initialized with existing responses:", this._formData));
6462
6122
  }
6463
6123
  _isStepAssignedToUser(i) {
6464
6124
  return this.navigationService.isStepAssignedToUser(i);
@@ -6519,10 +6179,7 @@ let m = class extends U {
6519
6179
  ), this._handleFormDataUpdate(i);
6520
6180
  }
6521
6181
  _initializeSignaturePad(i) {
6522
- this.signatureManager.initializeSignaturePad(
6523
- i,
6524
- this.shadowRoot
6525
- ) && this._updateValidationService();
6182
+ this.signatureManager.initializeSignaturePad(i, this.shadowRoot) && this._updateValidationService();
6526
6183
  }
6527
6184
  _handleResize() {
6528
6185
  this.signatureManager.handleResize();
@@ -6531,12 +6188,7 @@ let m = class extends U {
6531
6188
  this.signatureManager.clearSignature(i);
6532
6189
  }
6533
6190
  _startReplaceSignature(i) {
6534
- this._replacingSignatures = /* @__PURE__ */ new Set([
6535
- ...this._replacingSignatures,
6536
- i
6537
- ]), this.formStateManager.setFormField(i, !1), this.formStateManager.setFormField(`${i}_signatureData`, null), this._formData = this.formStateManager.getFormData(), this._savedSignatures = new Set(
6538
- [...this._savedSignatures].filter((e) => e !== i)
6539
- ), this.requestUpdate();
6191
+ this._replacingSignatures = /* @__PURE__ */ new Set([...this._replacingSignatures, i]), this.formStateManager.setFormField(i, !1), this.formStateManager.setFormField(`${i}_signatureData`, null), this._formData = this.formStateManager.getFormData(), this._savedSignatures = new Set([...this._savedSignatures].filter((e) => e !== i)), this.requestUpdate();
6540
6192
  }
6541
6193
  _cancelReplaceSignature(i) {
6542
6194
  this._replacingSignatures = new Set(
@@ -6591,14 +6243,10 @@ let m = class extends U {
6591
6243
  console.log("Capturing signatures from step:", i.id);
6592
6244
  }
6593
6245
  _trackQuestionResponse(i, e) {
6594
- this.responseTracker.trackQuestionResponse(
6595
- this._currentStep,
6596
- i,
6597
- e
6598
- );
6246
+ this.responseTracker.trackQuestionResponse(this._currentStep, i, e);
6599
6247
  }
6600
6248
  _renderQuestion(i) {
6601
- return S.render(i, this._getRenderContext());
6249
+ return y.render(i, this._getRenderContext());
6602
6250
  }
6603
6251
  _renderContentElement(i) {
6604
6252
  return $.render(i, this._getRenderContext());
@@ -6612,11 +6260,7 @@ let m = class extends U {
6612
6260
  _renderStepElement(i) {
6613
6261
  return this.mode === "print" ? this._isQuestionElement(i) ? this._renderQuestion(i) : this._isContentElement(i) ? this._renderContentElement(i) : l`<div class="unknown-element">
6614
6262
  <p>⚠️ Unknown element type: ${i.type}</p>
6615
- </div>` : this._isQuestionElement(i) ? l`<div class="runner-card">
6616
- ${this._renderQuestion(i)}
6617
- </div>` : this._isContentElement(i) ? l`<div class="runner-card">
6618
- ${this._renderContentElement(i)}
6619
- </div>` : l`<div class="runner-card">
6263
+ </div>` : this._isQuestionElement(i) ? l`<div class="runner-card">${this._renderQuestion(i)}</div>` : this._isContentElement(i) ? l`<div class="runner-card">${this._renderContentElement(i)}</div>` : l`<div class="runner-card">
6620
6264
  <div class="unknown-element">
6621
6265
  <p>⚠️ Unknown element type: ${i.type}</p>
6622
6266
  </div>
@@ -6640,9 +6284,7 @@ let m = class extends U {
6640
6284
  </div>` : l`
6641
6285
  <div class="print-layout">
6642
6286
  <!-- Instance Title at top -->
6643
- <div class="print-instance-title">
6644
- ${this.instance.name || "Untitled Form"}
6645
- </div>
6287
+ <div class="print-instance-title">${this.instance.name || "Untitled Form"}</div>
6646
6288
  <hr class="print-question-separator" />
6647
6289
 
6648
6290
  ${this.instance.steps.map((e) => this._renderStepWithElements(e))}
@@ -6654,15 +6296,11 @@ let m = class extends U {
6654
6296
  if (!this._validateStep()) return;
6655
6297
  const i = this._currentStep;
6656
6298
  i && this._captureSignaturesFromStep(i);
6657
- const e = this._findNextAssignedStep(
6658
- this._currentStepIndex
6659
- );
6299
+ const e = this._findNextAssignedStep(this._currentStepIndex);
6660
6300
  if (e !== -1) {
6661
6301
  const o = (t = this._currentStep) == null ? void 0 : t.id;
6662
6302
  if (this._currentStepIndex = e, o && ((n = this.instance) != null && n.steps)) {
6663
- const d = this.instance.steps.find(
6664
- (p) => p.id === o
6665
- );
6303
+ const d = this.instance.steps.find((p) => p.id === o);
6666
6304
  d && (d.status = "completed");
6667
6305
  }
6668
6306
  const a = (r = (s = this.instance) == null ? void 0 : s.steps) == null ? void 0 : r[this._currentStepIndex];
@@ -6675,16 +6313,10 @@ let m = class extends U {
6675
6313
  }
6676
6314
  }
6677
6315
  _findNextAssignedStep(i) {
6678
- return this.instance ? this.navigationService.findNextAssignedStep(
6679
- i,
6680
- this.instance
6681
- ) : -1;
6316
+ return this.instance ? this.navigationService.findNextAssignedStep(i, this.instance) : -1;
6682
6317
  }
6683
6318
  _isLastAssignedStep() {
6684
- return this.navigationService.isLastAssignedStep(
6685
- this._currentStepIndex,
6686
- this.instance
6687
- );
6319
+ return this.navigationService.isLastAssignedStep(this._currentStepIndex, this.instance);
6688
6320
  }
6689
6321
  _isLastStepInWorkflow() {
6690
6322
  var e;
@@ -6697,10 +6329,7 @@ let m = class extends U {
6697
6329
  `🎯 _goToStep called: stepIndex=${i}, mode=${this.mode}, currentStep=${this._currentStepIndex}`
6698
6330
  );
6699
6331
  const e = this.mode === "preview" ? this.workflow : this.instance;
6700
- if (console.log(
6701
- "📊 Data source:",
6702
- e ? `${((n = e.steps) == null ? void 0 : n.length) || 0} steps` : "null"
6703
- ), !e) {
6332
+ if (console.log("📊 Data source:", e ? `${((n = e.steps) == null ? void 0 : n.length) || 0} steps` : "null"), !e) {
6704
6333
  console.log("❌ No data source available");
6705
6334
  return;
6706
6335
  }
@@ -6766,23 +6395,17 @@ let m = class extends U {
6766
6395
  this.scrollIntoView({ behavior: "smooth", block: "start" });
6767
6396
  const i = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".runner-layout");
6768
6397
  i && i.scrollTo({ top: 0, behavior: "smooth" });
6769
- const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector(
6770
- ".runner-main-content"
6771
- );
6398
+ const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".runner-main-content");
6772
6399
  e && e.scrollTo({ top: 0, behavior: "smooth" });
6773
6400
  });
6774
6401
  }
6775
6402
  _updateInstanceData(i, e, t) {
6776
6403
  var d, p, c, u, h, g, b;
6777
6404
  i && this._internalCompletedSteps.add(i);
6778
- let n = (p = (d = this.instance) == null ? void 0 : d.steps) == null ? void 0 : p.find(
6779
- (k) => k.id === i
6780
- );
6405
+ let n = (p = (d = this.instance) == null ? void 0 : d.steps) == null ? void 0 : p.find((k) => k.id === i);
6781
6406
  if (!n && this._internalCompletedSteps.size > 0) {
6782
- const k = Array.from(this._internalCompletedSteps), q = k[k.length - 1];
6783
- n = (u = (c = this.instance) == null ? void 0 : c.steps) == null ? void 0 : u.find(
6784
- (G) => G.id === q
6785
- );
6407
+ const k = Array.from(this._internalCompletedSteps), G = k[k.length - 1];
6408
+ n = (u = (c = this.instance) == null ? void 0 : c.steps) == null ? void 0 : u.find((Y) => Y.id === G);
6786
6409
  }
6787
6410
  const s = e === "submission", r = ((h = this.instance) == null ? void 0 : h.steps) && this._internalCompletedSteps.size >= this.instance.steps.length, o = s || r ? null : this._currentStep ? {
6788
6411
  id: this._currentStep.id,
@@ -6811,9 +6434,7 @@ let m = class extends U {
6811
6434
  _restoreFormData() {
6812
6435
  var e;
6813
6436
  if (!this.persistenceManager.shouldRestoreData(this.mode || "default")) {
6814
- console.log(
6815
- "Skipping form data restoration - showing official instance data"
6816
- );
6437
+ console.log("Skipping form data restoration - showing official instance data");
6817
6438
  return;
6818
6439
  }
6819
6440
  const i = this.persistenceManager.restoreFormData((e = this.instance) == null ? void 0 : e.id);
@@ -6833,9 +6454,7 @@ let m = class extends U {
6833
6454
  _restoreFormValuesToDOM() {
6834
6455
  this.updateComplete.then(() => {
6835
6456
  var e, t;
6836
- (e = this.shadowRoot) != null && e.querySelector(
6837
- ".runner-step-form"
6838
- ) && (Object.entries(this._formData).forEach(([n, s]) => {
6457
+ (e = this.shadowRoot) != null && e.querySelector(".runner-step-form") && (Object.entries(this._formData).forEach(([n, s]) => {
6839
6458
  var o;
6840
6459
  if (n.endsWith("_signatureData")) return;
6841
6460
  const r = (o = this.shadowRoot) == null ? void 0 : o.getElementById(n);
@@ -6862,9 +6481,7 @@ let m = class extends U {
6862
6481
  if (t.type === "text_input" || t.type === "textarea" || t.type === "select" || t.type === "number" || t.type === "radio" || t.type === "checkbox" || t.type === "date" || t.type === "file_upload" || t.type === "signature") {
6863
6482
  const n = t, s = this._formData[n.id];
6864
6483
  if (s !== void 0 && e.responses) {
6865
- let r = e.responses.find(
6866
- (o) => o.elementId === n.id
6867
- );
6484
+ let r = e.responses.find((o) => o.elementId === n.id);
6868
6485
  r ? (r.value = s, r.answeredAt = /* @__PURE__ */ new Date()) : (r = {
6869
6486
  elementId: n.id,
6870
6487
  value: s,
@@ -6900,9 +6517,7 @@ let m = class extends U {
6900
6517
  }
6901
6518
  _extractFormDataFromDOM() {
6902
6519
  var n;
6903
- const i = {}, e = (n = this.shadowRoot) == null ? void 0 : n.querySelector(
6904
- ".runner-step-form"
6905
- );
6520
+ const i = {}, e = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".runner-step-form");
6906
6521
  if (!e) return i;
6907
6522
  const t = e.elements;
6908
6523
  for (let s = 0; s < t.length; s++) {
@@ -6928,9 +6543,7 @@ let m = class extends U {
6928
6543
  if (s.type === "text_input" || s.type === "textarea" || s.type === "select" || s.type === "number" || s.type === "radio" || s.type === "checkbox" || s.type === "date" || s.type === "file_upload" || s.type === "signature") {
6929
6544
  const r = s, o = this._formData[r.id];
6930
6545
  if (o !== void 0 && n.responses) {
6931
- let a = n.responses.find(
6932
- (d) => d.elementId === r.id
6933
- );
6546
+ let a = n.responses.find((d) => d.elementId === r.id);
6934
6547
  a ? (a.value = o, a.answeredAt = /* @__PURE__ */ new Date()) : (a = {
6935
6548
  elementId: r.id,
6936
6549
  value: o,
@@ -7085,14 +6698,9 @@ let m = class extends U {
7085
6698
  mode: this.mode
7086
6699
  })}
7087
6700
  </div>`}
7088
- <form
7089
- class="runner-step-form"
7090
- @submit=${(o) => o.preventDefault()}
7091
- >
7092
- ${i.elements.map(
7093
- (o) => this._renderStepElement(o)
7094
- )}
7095
- ${Ct.renderFormActions({
6701
+ <form class="runner-step-form" @submit=${(o) => o.preventDefault()}>
6702
+ ${i.elements.map((o) => this._renderStepElement(o))}
6703
+ ${Dt.renderFormActions({
7096
6704
  mode: this.mode || "default",
7097
6705
  isLastStep: e,
7098
6706
  isLastStepInWorkflow: t,
@@ -7212,7 +6820,7 @@ x([
7212
6820
  m = x([
7213
6821
  Le("runner-widget")
7214
6822
  ], m);
7215
- function Xt(i, e = {}) {
6823
+ function Jt(i, e = {}) {
7216
6824
  const {
7217
6825
  title: t = i.name || "Workflow Instance",
7218
6826
  includeStyles: n = !0,
@@ -7239,8 +6847,8 @@ function Xt(i, e = {}) {
7239
6847
  </div>
7240
6848
  <hr class="print-question-separator" />
7241
6849
 
7242
- ${r ? jt(i, o) : ""}
7243
- ${i.steps.map((d) => Mt(d)).join(`
6850
+ ${r ? Vt(i, o) : ""}
6851
+ ${i.steps.map((d) => At(d)).join(`
7244
6852
  `)}
7245
6853
  </div>
7246
6854
  </body>
@@ -7249,11 +6857,11 @@ function Xt(i, e = {}) {
7249
6857
  generatedAt: o
7250
6858
  };
7251
6859
  }
7252
- function Mt(i) {
6860
+ function At(i) {
7253
6861
  return `
7254
6862
  <div class="print-step">
7255
6863
  <!-- Step Header -->
7256
- ${Tt(i)}
6864
+ ${Mt(i)}
7257
6865
 
7258
6866
  <!-- Step Elements -->
7259
6867
  ${i.elements.map((e) => Ft(e, i)).join(`
@@ -7261,22 +6869,20 @@ function Mt(i) {
7261
6869
  </div>
7262
6870
  `;
7263
6871
  }
7264
- function Tt(i) {
6872
+ function Mt(i) {
7265
6873
  return `
7266
6874
  <div class="step-print-header">
7267
6875
  <div class="print-step-title">${f(i.title)}</div>
7268
- ${i.description ? `<div class="print-step-description">${f(
7269
- i.description
7270
- )}</div>` : ""}
6876
+ ${i.description ? `<div class="print-step-description">${f(i.description)}</div>` : ""}
7271
6877
  <hr class="print-question-separator" />
7272
6878
  </div>
7273
6879
  `;
7274
6880
  }
7275
6881
  function Ft(i, e) {
7276
- return Ht(i) ? zt(i, e) : It(i);
6882
+ return Wt(i) ? Tt(i, e) : zt(i);
7277
6883
  }
7278
- function zt(i, e) {
7279
- const t = Vt(i.id, e.responses), n = t == null ? void 0 : t.value, r = i.type === "checkbox" && (!i.options || i.options.length === 0) ? "" : `
6884
+ function Tt(i, e) {
6885
+ const t = Ht(i.id, e.responses), n = t == null ? void 0 : t.value, r = i.type === "checkbox" && (!i.options || i.options.length === 0) ? "" : `
7280
6886
  <div class="print-question-title">
7281
6887
  ${f(i.label)}:
7282
6888
  </div>
@@ -7285,19 +6891,19 @@ function zt(i, e) {
7285
6891
  case "text_input":
7286
6892
  case "number":
7287
6893
  case "date":
7288
- return r + Pt(i, n) + o;
7289
- case "textarea":
7290
6894
  return r + Ut(i, n) + o;
6895
+ case "textarea":
6896
+ return r + It(i, n) + o;
7291
6897
  case "select":
7292
- return r + Lt(i, n) + o;
6898
+ return r + Pt(i, n) + o;
7293
6899
  case "radio":
7294
- return r + Nt(i, n) + o;
6900
+ return r + Lt(i, n) + o;
7295
6901
  case "checkbox":
7296
- return r + Ot(i, n) + o;
6902
+ return r + Nt(i, n) + o;
7297
6903
  case "file_upload":
7298
- return r + Rt(i, n) + o;
6904
+ return r + Ot(i, n) + o;
7299
6905
  case "signature":
7300
- return r + Wt(i, n) + o;
6906
+ return r + Rt(i, n) + o;
7301
6907
  default:
7302
6908
  return r + `
7303
6909
  <div class="unknown-element">
@@ -7306,7 +6912,7 @@ function zt(i, e) {
7306
6912
  ` + o;
7307
6913
  }
7308
6914
  }
7309
- function It(i) {
6915
+ function zt(i) {
7310
6916
  const e = i.type !== "divider" ? '<hr class="print-question-separator" />' : "";
7311
6917
  switch (i.type) {
7312
6918
  case "text":
@@ -7336,7 +6942,7 @@ function It(i) {
7336
6942
  <div class="content-print">
7337
6943
  <div class="content-element">
7338
6944
  <div class="markdown-content">
7339
- ${qt(i.content)}
6945
+ ${Bt(i.content)}
7340
6946
  </div>
7341
6947
  </div>
7342
6948
  ${e}
@@ -7348,9 +6954,7 @@ function It(i) {
7348
6954
  <div class="content-element">
7349
6955
  <div class="divider-content">
7350
6956
  <hr class="content-divider" />
7351
- ${i.caption ? `<div class="divider-caption">${f(
7352
- i.caption
7353
- )}</div>` : ""}
6957
+ ${i.caption ? `<div class="divider-caption">${f(i.caption)}</div>` : ""}
7354
6958
  </div>
7355
6959
  </div>
7356
6960
  </div>
@@ -7404,7 +7008,7 @@ function It(i) {
7404
7008
  `;
7405
7009
  }
7406
7010
  }
7407
- function Pt(i, e) {
7011
+ function Ut(i, e) {
7408
7012
  const t = e != null ? f(String(e)) : "";
7409
7013
  return `
7410
7014
  <div class="print-response-value input-response">
@@ -7412,14 +7016,14 @@ function Pt(i, e) {
7412
7016
  </div>
7413
7017
  `;
7414
7018
  }
7415
- function Ut(i, e) {
7019
+ function It(i, e) {
7416
7020
  return `
7417
7021
  <div class="print-response-value textarea-response">
7418
7022
  ${(e != null ? f(String(e)) : "") || '<span class="print-no-response">No response</span>'}
7419
7023
  </div>
7420
7024
  `;
7421
7025
  }
7422
- function Lt(i, e) {
7026
+ function Pt(i, e) {
7423
7027
  const t = e != null ? String(e) : "";
7424
7028
  return `
7425
7029
  <div class="print-response-value select-response">
@@ -7427,7 +7031,7 @@ function Lt(i, e) {
7427
7031
  </div>
7428
7032
  `;
7429
7033
  }
7430
- function Nt(i, e) {
7034
+ function Lt(i, e) {
7431
7035
  const t = e != null ? String(e) : "";
7432
7036
  return `
7433
7037
  <div class="print-response-value radio-response">
@@ -7435,7 +7039,7 @@ function Nt(i, e) {
7435
7039
  </div>
7436
7040
  `;
7437
7041
  }
7438
- function Ot(i, e) {
7042
+ function Nt(i, e) {
7439
7043
  if ((i.options || []).length === 0)
7440
7044
  return `
7441
7045
  <div class="print-response-value checkbox-response">
@@ -7451,7 +7055,7 @@ function Ot(i, e) {
7451
7055
  `;
7452
7056
  }
7453
7057
  }
7454
- function Rt(i, e) {
7058
+ function Ot(i, e) {
7455
7059
  if (!e)
7456
7060
  return '<div class="print-response-value file-response"><span class="print-no-response">No file uploaded</span></div>';
7457
7061
  const t = typeof e == "string";
@@ -7459,11 +7063,11 @@ function Rt(i, e) {
7459
7063
  return `
7460
7064
  <div class="print-response-value file-response">
7461
7065
  📎 ${f(e.name)}
7462
- ${e.size ? ` <span class="file-size">(${Qt(e.size)})</span>` : ""}
7066
+ ${e.size ? ` <span class="file-size">(${jt(e.size)})</span>` : ""}
7463
7067
  </div>
7464
7068
  `;
7465
7069
  if (t) {
7466
- const s = Bt(e);
7070
+ const s = Qt(e);
7467
7071
  return `
7468
7072
  <div class="print-response-value file-response">
7469
7073
  📎 ${f(s)}
@@ -7476,7 +7080,7 @@ function Rt(i, e) {
7476
7080
  </div>
7477
7081
  `;
7478
7082
  }
7479
- function Wt(i, e) {
7083
+ function Rt(i, e) {
7480
7084
  if (!e)
7481
7085
  return '<div class="print-response-value signature-response"><span class="print-no-response">No signature provided</span></div>';
7482
7086
  const t = typeof e == "string" ? e : e.url || e.dataURL;
@@ -7494,7 +7098,7 @@ function Wt(i, e) {
7494
7098
  </div>
7495
7099
  `;
7496
7100
  }
7497
- function Ht(i) {
7101
+ function Wt(i) {
7498
7102
  return [
7499
7103
  "text_input",
7500
7104
  "textarea",
@@ -7507,10 +7111,10 @@ function Ht(i) {
7507
7111
  "signature"
7508
7112
  ].includes(i.type);
7509
7113
  }
7510
- function Vt(i, e) {
7114
+ function Ht(i, e) {
7511
7115
  return e == null ? void 0 : e.find((t) => t.elementId === i);
7512
7116
  }
7513
- function jt(i, e) {
7117
+ function Vt(i, e) {
7514
7118
  return `
7515
7119
  <div class="runner-card" style="margin-bottom: 40px; border-left: 4px solid #3b82f6;">
7516
7120
  <div style="display: flex; justify-content: between; align-items: center; gap: 20px;">
@@ -7524,12 +7128,8 @@ function jt(i, e) {
7524
7128
  </p>
7525
7129
  </div>
7526
7130
  <div style="text-align: right; color: #6b7280; font-size: 0.875rem;">
7527
- <p style="margin: 0;"><strong>Instance ID:</strong> ${f(
7528
- i.id
7529
- )}</p>
7530
- <p style="margin: 0;"><strong>Workflow ID:</strong> ${f(
7531
- i.workflowId
7532
- )}</p>
7131
+ <p style="margin: 0;"><strong>Instance ID:</strong> ${f(i.id)}</p>
7132
+ <p style="margin: 0;"><strong>Workflow ID:</strong> ${f(i.workflowId)}</p>
7533
7133
  </div>
7534
7134
  </div>
7535
7135
  </div>
@@ -7546,12 +7146,12 @@ function f(i) {
7546
7146
  "'": "&#39;"
7547
7147
  })[n]);
7548
7148
  }
7549
- function Qt(i) {
7149
+ function jt(i) {
7550
7150
  if (i === 0) return "0 Bytes";
7551
7151
  const e = 1024, t = ["Bytes", "KB", "MB", "GB"], n = Math.floor(Math.log(i) / Math.log(e));
7552
7152
  return parseFloat((i / Math.pow(e, n)).toFixed(2)) + " " + t[n];
7553
7153
  }
7554
- function Bt(i) {
7154
+ function Qt(i) {
7555
7155
  try {
7556
7156
  return new URL(i).pathname.split("/").pop() || "" || "Uploaded File";
7557
7157
  } catch {
@@ -7559,7 +7159,7 @@ function Bt(i) {
7559
7159
  return t && t.includes(".") ? t : "Uploaded File";
7560
7160
  }
7561
7161
  }
7562
- function qt(i) {
7162
+ function Bt(i) {
7563
7163
  return i == null ? "" : String(i).replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim, "<strong>$1</strong>").replace(/\*(.*)\*/gim, "<em>$1</em>").replace(/`(.*)`/gim, "<code>$1</code>").replace(/\n/gim, "<br>");
7564
7164
  }
7565
7165
  function Gt() {
@@ -8070,32 +7670,22 @@ function Gt() {
8070
7670
  }
8071
7671
  `;
8072
7672
  }
8073
- function Zt(i, e = {}) {
7673
+ function Xt(i, e = {}) {
8074
7674
  if (!customElements.get("builder-widget"))
8075
- return console.error(
8076
- "Error: <builder-widget> is not defined. Make sure it was imported."
8077
- ), null;
7675
+ return console.error("Error: <builder-widget> is not defined. Make sure it was imported."), null;
8078
7676
  const t = document.getElementById(i);
8079
7677
  if (!t)
8080
- return console.error(
8081
- `Error: Target element with ID '${i}' not found.`
8082
- ), null;
7678
+ return console.error(`Error: Target element with ID '${i}' not found.`), null;
8083
7679
  t.innerHTML = "";
8084
- const n = document.createElement(
8085
- "builder-widget"
8086
- );
7680
+ const n = document.createElement("builder-widget");
8087
7681
  return e.onWorkflowCreated && (n.onWorkflowCreated = e.onWorkflowCreated), e.onWorkflowDeleted && (n.onWorkflowDeleted = e.onWorkflowDeleted), e.onWorkflowUpdated && (n.onWorkflowUpdated = e.onWorkflowUpdated), t.appendChild(n), console.log(`Drill Builder mounted on #${i}`), n;
8088
7682
  }
8089
- function ei(i, e) {
7683
+ function Zt(i, e) {
8090
7684
  if (!customElements.get("runner-widget"))
8091
- return console.error(
8092
- "Error: <runner-widget> is not defined. Make sure it was imported."
8093
- ), null;
7685
+ return console.error("Error: <runner-widget> is not defined. Make sure it was imported."), null;
8094
7686
  const t = document.getElementById(i);
8095
7687
  if (!t)
8096
- return console.error(
8097
- `Error: Target element with ID '${i}' not found.`
8098
- ), null;
7688
+ return console.error(`Error: Target element with ID '${i}' not found.`), null;
8099
7689
  if (e.mode === "preview") {
8100
7690
  if (!e || !e.workflow)
8101
7691
  return console.error("Error: Workflow data must be provided for preview mode."), t.innerHTML = '<p style="color: red;">Error: Workflow data required for preview mode.</p>', null;
@@ -8118,16 +7708,14 @@ function ei(i, e) {
8118
7708
  }
8119
7709
  }), t.appendChild(n), console.log(`Drill Runner mounted on #${i}`), n;
8120
7710
  }
8121
- function ti(i, e) {
7711
+ function ei(i, e) {
8122
7712
  const t = i.getFormData(), n = JSON.parse(JSON.stringify(e));
8123
7713
  return n.steps && n.steps.forEach((s) => {
8124
7714
  s.responses || (s.responses = []), s.elements.forEach((r) => {
8125
7715
  if (r.type === "text_input" || r.type === "textarea" || r.type === "select" || r.type === "number" || r.type === "radio" || r.type === "checkbox" || r.type === "date" || r.type === "file_upload" || r.type === "signature") {
8126
7716
  const o = t[r.id];
8127
7717
  if (o !== void 0) {
8128
- let a = s.responses.find(
8129
- (d) => d.elementId === r.id
8130
- );
7718
+ let a = s.responses.find((d) => d.elementId === r.id);
8131
7719
  a ? (a.value = o, a.answeredAt = /* @__PURE__ */ new Date()) : (a = {
8132
7720
  elementId: r.id,
8133
7721
  value: o,
@@ -8138,7 +7726,7 @@ function ti(i, e) {
8138
7726
  });
8139
7727
  }), n;
8140
7728
  }
8141
- function ii(i, e) {
7729
+ function ti(i, e) {
8142
7730
  const t = {};
8143
7731
  e.steps && e.steps.forEach((n) => {
8144
7732
  n.responses && n.responses.forEach((s) => {
@@ -8147,9 +7735,9 @@ function ii(i, e) {
8147
7735
  }), i.restoreFormData(), console.log("Form data restored to runner widget:", t);
8148
7736
  }
8149
7737
  export {
8150
- Zt as createBuilder,
8151
- ei as createRunner,
8152
- Xt as generateInstanceHTML,
8153
- ii as restoreFormDataToRunner,
8154
- ti as updateInstanceFromRunnerForm
7738
+ Xt as createBuilder,
7739
+ Zt as createRunner,
7740
+ Jt as generateInstanceHTML,
7741
+ ti as restoreFormDataToRunner,
7742
+ ei as updateInstanceFromRunnerForm
8155
7743
  };