haori 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/haori.es.js CHANGED
@@ -29,13 +29,13 @@ const z = class z {
29
29
  }
30
30
  };
31
31
  z.devMode = !1;
32
- let $ = z;
33
- const se = "embedded";
34
- function ce(T) {
35
- return T === "embedded" || T === "demo";
32
+ let B = z;
33
+ const ne = "embedded";
34
+ function de(E) {
35
+ return E === "embedded" || E === "demo";
36
36
  }
37
- function de(T) {
38
- return T === null ? null : ce(T) ? T : se;
37
+ function ve(E) {
38
+ return E === null ? null : de(E) ? E : ne;
39
39
  }
40
40
  const H = class H {
41
41
  /**
@@ -53,7 +53,7 @@ const H = class H {
53
53
  * @return 戻り値はありません。
54
54
  */
55
55
  static setRuntime(e) {
56
- H._runtime = ce(e) ? e : se;
56
+ H._runtime = de(e) ? e : ne;
57
57
  }
58
58
  /**
59
59
  * 実行環境からプレフィックスと開発モードかどうかを自動検出します。
@@ -67,21 +67,21 @@ const H = class H {
67
67
  if (e instanceof HTMLScriptElement) {
68
68
  const r = e.getAttribute("data-prefix") || H._prefix;
69
69
  H._prefix = r.endsWith("-") ? r : r + "-";
70
- const i = de(
70
+ const i = ve(
71
71
  e.getAttribute("data-runtime")
72
72
  );
73
73
  i !== null && (H._runtime = i);
74
74
  }
75
75
  if (e instanceof HTMLScriptElement && e.hasAttribute(`${H._prefix}dev`)) {
76
- $.set(!0);
76
+ B.set(!0);
77
77
  return;
78
78
  }
79
79
  const t = window.location.hostname;
80
80
  if (t === "localhost" || t.endsWith(".localhost") || t === "127.0.0.1" || t === "::1" || t.endsWith(".local")) {
81
- $.set(!0);
81
+ B.set(!0);
82
82
  return;
83
83
  }
84
- $.set(!1);
84
+ B.set(!1);
85
85
  } catch {
86
86
  }
87
87
  }
@@ -94,7 +94,7 @@ const H = class H {
94
94
  return H._prefix;
95
95
  }
96
96
  };
97
- H._prefix = "data-", H._runtime = se;
97
+ H._prefix = "data-", H._runtime = ne;
98
98
  let l = H;
99
99
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", l.detect) : l.detect();
100
100
  class p {
@@ -105,7 +105,7 @@ class p {
105
105
  * @param args 追加の引数
106
106
  */
107
107
  static info(e, ...t) {
108
- $.isEnabled() && console.log && console.log(e, ...t);
108
+ B.isEnabled() && console.log && console.log(e, ...t);
109
109
  }
110
110
  /**
111
111
  * 開発モードでのみコンソールに警告を出力します。
@@ -114,7 +114,7 @@ class p {
114
114
  * @param args 追加の引数
115
115
  */
116
116
  static warn(e, ...t) {
117
- $.isEnabled() && console.warn && console.warn(e, ...t);
117
+ B.isEnabled() && console.warn && console.warn(e, ...t);
118
118
  }
119
119
  /**
120
120
  * モードに関係なくコンソールにエラーを出力します。
@@ -126,7 +126,86 @@ class p {
126
126
  console.error(e, ...t);
127
127
  }
128
128
  }
129
- const I = class I {
129
+ const ye = "yyyy/MM/dd HH:mm", Ee = "en-US", ce = 1e4;
130
+ function W(E) {
131
+ return String(E).padStart(2, "0");
132
+ }
133
+ function fe(E, e = ye) {
134
+ if (E == null || E === "")
135
+ return "";
136
+ const t = E instanceof Date ? E : new Date(E);
137
+ if (Number.isNaN(t.getTime()))
138
+ return "";
139
+ const r = {
140
+ yyyy: String(t.getFullYear()).padStart(4, "0"),
141
+ yy: W(t.getFullYear() % 100),
142
+ MM: W(t.getMonth() + 1),
143
+ M: String(t.getMonth() + 1),
144
+ dd: W(t.getDate()),
145
+ d: String(t.getDate()),
146
+ HH: W(t.getHours()),
147
+ H: String(t.getHours()),
148
+ mm: W(t.getMinutes()),
149
+ ss: W(t.getSeconds())
150
+ };
151
+ return e.replace(
152
+ /yyyy|yy|MM|dd|HH|mm|ss|M|d|H/g,
153
+ (i) => r[i]
154
+ );
155
+ }
156
+ function pe(E, e) {
157
+ if (E == null || E === "")
158
+ return "";
159
+ const t = typeof E == "number" ? E : Number(E);
160
+ if (!Number.isFinite(t))
161
+ return "";
162
+ const r = {};
163
+ if (e !== void 0 && Number.isFinite(e)) {
164
+ const i = Math.max(0, Math.trunc(e));
165
+ r.minimumFractionDigits = i, r.maximumFractionDigits = i;
166
+ }
167
+ return new Intl.NumberFormat(Ee, r).format(t);
168
+ }
169
+ function ge(E, e, t) {
170
+ let r, i, s;
171
+ if (e === void 0 ? (r = 0, i = E, s = 1) : (r = E, i = e, s = t === void 0 ? 1 : t), !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(s) || s === 0)
172
+ return [];
173
+ r = Math.trunc(r), i = Math.trunc(i), s = Math.trunc(s);
174
+ const n = [];
175
+ if (s > 0)
176
+ for (let a = r; a < i && n.length < ce; a += s)
177
+ n.push(a);
178
+ else
179
+ for (let a = r; a > i && n.length < ce; a += s)
180
+ n.push(a);
181
+ return n;
182
+ }
183
+ function me(E, e, t = {}) {
184
+ const r = Math.trunc(Number(E));
185
+ if (!Number.isFinite(r) || r <= 0)
186
+ return [];
187
+ const i = Math.min(
188
+ Math.max(Math.trunc(Number(e)) || 0, 0),
189
+ r - 1
190
+ ), s = Math.max(0, Math.trunc(t.window ?? 2)), n = Math.max(0, Math.trunc(t.boundary ?? 1)), a = /* @__PURE__ */ new Set();
191
+ for (let h = 0; h < n && h < r; h += 1)
192
+ a.add(h);
193
+ for (let h = Math.max(0, r - n); h < r; h += 1)
194
+ a.add(h);
195
+ for (let h = Math.max(0, i - s); h <= Math.min(r - 1, i + s); h += 1)
196
+ a.add(h);
197
+ const o = Array.from(a).sort((h, g) => h - g), c = [];
198
+ let d = null;
199
+ for (const h of o)
200
+ d !== null && h - d > 1 && c.push({ page: null, label: "…", active: !1, ellipsis: !0 }), c.push({
201
+ page: h,
202
+ label: h + 1,
203
+ active: h === i,
204
+ ellipsis: !1
205
+ }), d = h;
206
+ return c;
207
+ }
208
+ const Ae = Object.freeze({ date: fe, number: pe, pages: me, range: ge }), I = class I {
130
209
  /**
131
210
  * 明示バインド内に持ち込まれてはならない危険値を返します。
132
211
  *
@@ -211,13 +290,13 @@ const I = class I {
211
290
  if (this.scheduleForbiddenBindingValueCacheReset(), e.trim() === "")
212
291
  return p.warn("[Haori]", e, "Expression is empty"), { value: null, unresolvedReference: !1 };
213
292
  if (this.containsDangerousPatterns(e)) {
214
- const n = this.detectDisallowedKeywords(e);
215
- if (n.length > 0) {
216
- const a = n.some((o) => o === "function" || o === "return") ? " Statement keywords are not allowed in expressions; use an arrow function such as `x => ({key: value})` instead of `function(x){ return {key: value}; }`." : " These are statement keywords and cannot be used in expressions.";
293
+ const a = this.detectDisallowedKeywords(e);
294
+ if (a.length > 0) {
295
+ const o = a.some((c) => c === "function" || c === "return") ? " Statement keywords are not allowed in expressions; use an arrow function such as `x => ({key: value})` instead of `function(x){ return {key: value}; }`." : " These are statement keywords and cannot be used in expressions.";
217
296
  p.warn(
218
297
  "[Haori]",
219
298
  e,
220
- "Expression uses disallowed keyword(s): " + n.join(", ") + "." + a
299
+ "Expression uses disallowed keyword(s): " + a.join(", ") + "." + o
221
300
  );
222
301
  } else
223
302
  p.warn(
@@ -240,42 +319,47 @@ const I = class I {
240
319
  t,
241
320
  "Binded values contain forbidden values"
242
321
  ), { value: null, unresolvedReference: !1 };
243
- const i = { ...t }, s = this.canAttemptMissingIdentifierRecovery(e);
244
- for (let n = 0; n <= this.MAX_IDENTIFIER_RECOVERY_COUNT; n += 1) {
245
- const a = this.prepareEvaluator(e, i);
246
- if (a.compileFailed || a.evaluator === null)
322
+ const i = this.BUILTIN_REFERENCE_PATTERN.test(e);
323
+ i && this.BUILTIN_NAMESPACE in t && p.warn(
324
+ "[Haori]",
325
+ `Binding key "${this.BUILTIN_NAMESPACE}" is reserved for built-in helpers; the bound value is ignored in expressions.`
326
+ );
327
+ const s = i ? { ...t, [this.BUILTIN_NAMESPACE]: this.BUILTIN_HELPERS } : { ...t }, n = this.canAttemptMissingIdentifierRecovery(e);
328
+ for (let a = 0; a <= this.MAX_IDENTIFIER_RECOVERY_COUNT; a += 1) {
329
+ const o = this.prepareEvaluator(e, s);
330
+ if (o.compileFailed || o.evaluator === null)
247
331
  return { value: null, unresolvedReference: !1 };
248
332
  try {
249
- const o = [], c = this.wrapBoundValues(i);
250
- return a.bindKeys.forEach((h) => {
251
- o.push(c[h]);
333
+ const c = [], d = this.wrapBoundValues(s);
334
+ return o.bindKeys.forEach((h) => {
335
+ c.push(d[h]);
252
336
  }), {
253
337
  value: this.withBlockedPropertyAccess(
254
- () => a.evaluator(...o)
338
+ () => o.evaluator(...c)
255
339
  ),
256
340
  unresolvedReference: !1
257
341
  };
258
- } catch (o) {
259
- if (s && o instanceof ReferenceError) {
260
- const h = this.extractMissingIdentifier(o);
261
- if (h !== null && this.canRecoverMissingIdentifier(h, i)) {
262
- i[h] = void 0;
342
+ } catch (c) {
343
+ if (n && c instanceof ReferenceError) {
344
+ const h = this.extractMissingIdentifier(c);
345
+ if (h !== null && this.canRecoverMissingIdentifier(h, s)) {
346
+ s[h] = void 0;
263
347
  continue;
264
348
  }
265
349
  }
266
- const c = this.detectForbiddenIdentifiers(e);
267
- return c.length > 0 && p.warn(
350
+ const d = this.detectForbiddenIdentifiers(e);
351
+ return d.length > 0 && p.warn(
268
352
  "[Haori]",
269
- "Expression references blocked identifier(s): " + c.join(", ") + ". These are blocked in expressions and evaluate to undefined (often the cause of this error). Use spread {...a, ...b} instead of Object.assign.",
353
+ "Expression references blocked identifier(s): " + d.join(", ") + ". These are blocked in expressions and evaluate to undefined (often the cause of this error). Use spread {...a, ...b} instead of Object.assign.",
270
354
  e
271
- ), p.error("[Haori]", "Expression evaluation error:", e, o), o instanceof ReferenceError ? { value: void 0, unresolvedReference: !0 } : { value: null, unresolvedReference: !1 };
355
+ ), p.error("[Haori]", "Expression evaluation error:", e, c), c instanceof ReferenceError ? { value: void 0, unresolvedReference: !0 } : { value: null, unresolvedReference: !1 };
272
356
  }
273
357
  }
274
358
  return p.error(
275
359
  "[Haori]",
276
360
  "Failed to recover missing identifiers:",
277
361
  e,
278
- i
362
+ s
279
363
  ), { value: void 0, unresolvedReference: !0 };
280
364
  }
281
365
  /**
@@ -390,12 +474,12 @@ return (${e});`;
390
474
  const r = [];
391
475
  let i = null;
392
476
  for (let s = 0; s < t.length; s++) {
393
- const n = t[s], a = t[s + 1] || null, o = r[r.length - 1] || null, c = t[s - 2] || null, h = t[s - 3] || null;
477
+ const n = t[s], a = t[s + 1] || null, o = r[r.length - 1] || null, c = t[s - 2] || null, d = t[s - 3] || null;
394
478
  if (this.startsObjectKey(
395
479
  o,
396
480
  i,
397
481
  c,
398
- h
482
+ d
399
483
  ) && (n.value === "[" || n.type === "identifier" && this.FORBIDDEN_PROPERTY_NAMES.has(n.value) || n.type === "string" && this.FORBIDDEN_PROPERTY_NAMES.has(
400
484
  this.decodeStringLiteral(n.value)
401
485
  )) || n.type === "identifier" && (this.DISALLOWED_KEYWORDS.has(n.value) || this.STRICT_FORBIDDEN_NAMES.includes(n.value) || (i?.value === "." || i?.value === "?.") && this.FORBIDDEN_PROPERTY_NAMES.has(n.value)) || o === "member" && n.value !== "]" && n.type === "string" && this.FORBIDDEN_PROPERTY_NAMES.has(
@@ -412,8 +496,8 @@ return (${e});`;
412
496
  break;
413
497
  }
414
498
  case "[": {
415
- const f = this.startsMemberAccess(i) ? "member" : "array";
416
- r.push(f);
499
+ const h = this.startsMemberAccess(i) ? "member" : "array";
500
+ r.push(h);
417
501
  break;
418
502
  }
419
503
  case "{":
@@ -801,7 +885,9 @@ return (${e});`;
801
885
  return this.forbiddenBindingValueCache.set(e, !1), !1;
802
886
  }
803
887
  };
804
- I.MAX_IDENTIFIER_RECOVERY_COUNT = 8, I.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), I.forbiddenBindingValueCacheResetScheduled = !1, I.FORBIDDEN_NAMES = [
888
+ I.MAX_IDENTIFIER_RECOVERY_COUNT = 8, I.BUILTIN_NAMESPACE = "haori", I.BUILTIN_HELPERS = {
889
+ ...Ae
890
+ }, I.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, I.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), I.forbiddenBindingValueCacheResetScheduled = !1, I.FORBIDDEN_NAMES = [
805
891
  // グローバルオブジェクト
806
892
  "window",
807
893
  "self",
@@ -884,8 +970,8 @@ I.MAX_IDENTIFIER_RECOVERY_COUNT = 8, I.forbiddenBindingValueCache = /* @__PURE__
884
970
  "with",
885
971
  "yield"
886
972
  ]), I.EXPRESSION_CACHE = /* @__PURE__ */ new Map();
887
- let Y = I;
888
- class ae {
973
+ let J = I;
974
+ class oe {
889
975
  constructor() {
890
976
  this.MAX_BUDGET = 8, this.queue = [], this.processing = !1;
891
977
  }
@@ -975,7 +1061,7 @@ class ae {
975
1061
  async waitForIdle(e = 1e3) {
976
1062
  let t = 0, r = 0;
977
1063
  for (; t < 2 && r < e; )
978
- this.processing || this.queue.length > 0 ? (await this.wait(), t = 0) : t += 1, await ae.nextTick(), r += 1;
1064
+ this.processing || this.queue.length > 0 ? (await this.wait(), t = 0) : t += 1, await oe.nextTick(), r += 1;
979
1065
  }
980
1066
  /**
981
1067
  * 次のフレーム(または 1 マクロタスク)まで待機します。
@@ -988,7 +1074,7 @@ class ae {
988
1074
  });
989
1075
  }
990
1076
  }
991
- const le = class le {
1077
+ const ue = class ue {
992
1078
  /**
993
1079
  * タスクをキューに追加します。
994
1080
  *
@@ -1015,9 +1101,9 @@ const le = class le {
1015
1101
  return this.ASYNC_QUEUE.waitForIdle(e);
1016
1102
  }
1017
1103
  };
1018
- le.ASYNC_QUEUE = new ae();
1019
- let M = le;
1020
- class J {
1104
+ ue.ASYNC_QUEUE = new oe();
1105
+ let x = ue;
1106
+ class X {
1021
1107
  /**
1022
1108
  * 実行モードを取得します。
1023
1109
  *
@@ -1047,7 +1133,7 @@ class J {
1047
1133
  * @return すべてのレンダリングが完了したら解決される Promise
1048
1134
  */
1049
1135
  static waitForRenders() {
1050
- return M.waitForIdle();
1136
+ return x.waitForIdle();
1051
1137
  }
1052
1138
  /**
1053
1139
  * 通知ダイアログを表示します。
@@ -1056,7 +1142,7 @@ class J {
1056
1142
  * @returns 通知が閉じられると解決されるPromise
1057
1143
  */
1058
1144
  static dialog(e) {
1059
- return M.enqueue(() => {
1145
+ return x.enqueue(() => {
1060
1146
  window.alert(e);
1061
1147
  }, !0);
1062
1148
  }
@@ -1084,7 +1170,7 @@ class J {
1084
1170
  * @returns ユーザーがOKをクリックした場合はtrue、キャンセルした場合はfalseが解決されるPromise
1085
1171
  */
1086
1172
  static confirm(e) {
1087
- return M.enqueue(() => window.confirm(e), !0);
1173
+ return x.enqueue(() => window.confirm(e), !0);
1088
1174
  }
1089
1175
  /**
1090
1176
  * ダイアログを開きます。
@@ -1092,7 +1178,7 @@ class J {
1092
1178
  * @param element 開くダイアログのHTML要素
1093
1179
  */
1094
1180
  static openDialog(e) {
1095
- return M.enqueue(() => {
1181
+ return x.enqueue(() => {
1096
1182
  e instanceof HTMLDialogElement ? e.showModal() : p.error("[Haori]", "Element is not a dialog: ", e);
1097
1183
  }, !0);
1098
1184
  }
@@ -1102,7 +1188,7 @@ class J {
1102
1188
  * @param element 閉じるダイアログのHTML要素
1103
1189
  */
1104
1190
  static closeDialog(e) {
1105
- return M.enqueue(() => {
1191
+ return x.enqueue(() => {
1106
1192
  e instanceof HTMLDialogElement ? e.close() : p.error("[Haori]", "Element is not a dialog: ", e);
1107
1193
  }, !0);
1108
1194
  }
@@ -1113,7 +1199,7 @@ class J {
1113
1199
  * @param message エラーメッセージ
1114
1200
  */
1115
1201
  static addErrorMessage(e, t) {
1116
- return J.addMessage(e, t, "error");
1202
+ return X.addMessage(e, t, "error");
1117
1203
  }
1118
1204
  /**
1119
1205
  * メッセージをレベル付きで追加します。
@@ -1123,7 +1209,7 @@ class J {
1123
1209
  * @param level メッセージのレベル(省略可能)
1124
1210
  */
1125
1211
  static addMessage(e, t, r) {
1126
- return M.enqueue(() => {
1212
+ return x.enqueue(() => {
1127
1213
  const i = e instanceof HTMLFormElement ? e : e.parentElement ?? e;
1128
1214
  i.setAttribute("data-message", t), r !== void 0 ? i.setAttribute("data-message-level", r) : i.removeAttribute("data-message-level");
1129
1215
  }, !0);
@@ -1134,21 +1220,71 @@ class J {
1134
1220
  * @param parent メッセージをクリアする親要素
1135
1221
  */
1136
1222
  static clearMessages(e) {
1137
- return M.enqueue(() => {
1223
+ return x.enqueue(() => {
1138
1224
  e.removeAttribute("data-message"), e.removeAttribute("data-message-level"), e.querySelectorAll("[data-message]").forEach((t) => {
1139
1225
  t.removeAttribute("data-message"), t.removeAttribute("data-message-level");
1140
1226
  });
1141
1227
  }, !0);
1142
1228
  }
1229
+ /**
1230
+ * 日時を指定フォーマットの文字列へ整形します。
1231
+ *
1232
+ * テンプレート式中の `haori.date(...)` と同じ実装です。
1233
+ *
1234
+ * @param value 整形対象の日時(ISO 文字列・エポックミリ秒・Date)
1235
+ * @param format フォーマット文字列(省略時は `yyyy/MM/dd HH:mm`)
1236
+ * @returns 整形済み文字列。整形できない場合は空文字
1237
+ */
1238
+ static date(e, t) {
1239
+ return fe(e, t);
1240
+ }
1241
+ /**
1242
+ * 数値を桁区切り・小数桁付きの文字列へ整形します。
1243
+ *
1244
+ * テンプレート式中の `haori.number(...)` と同じ実装です。
1245
+ *
1246
+ * @param value 整形対象(数値または数値文字列)
1247
+ * @param decimals 小数桁数(省略可能)
1248
+ * @returns 整形済み文字列。整形できない場合は空文字
1249
+ */
1250
+ static number(e, t) {
1251
+ return pe(e, t);
1252
+ }
1253
+ /**
1254
+ * 整数の配列を生成します(終端は排他)。
1255
+ *
1256
+ * テンプレート式中の `haori.range(...)` と同じ実装です。
1257
+ *
1258
+ * @param start `end` 省略時は終端、指定時は開始値
1259
+ * @param end 終端(排他)
1260
+ * @param step 刻み幅(省略時は 1)
1261
+ * @returns 整数配列
1262
+ */
1263
+ static range(e, t, r) {
1264
+ return ge(e, t, r);
1265
+ }
1266
+ /**
1267
+ * 番号ページネーション用の表示要素列を生成します。
1268
+ *
1269
+ * テンプレート式中の `haori.pages(...)` と同じ実装です。
1270
+ *
1271
+ * @param totalPages 総ページ数
1272
+ * @param current 現在ページ(0 始まり)
1273
+ * @param options 表示調整オプション(window・boundary)
1274
+ * @returns 表示要素の配列
1275
+ */
1276
+ static pages(e, t, r) {
1277
+ return me(e, t, r);
1278
+ }
1143
1279
  }
1144
- const fe = ["addErrorMessage", "clearMessages"];
1145
- function ue() {
1280
+ const Se = ["addErrorMessage", "clearMessages"];
1281
+ function he() {
1146
1282
  const e = globalThis.window?.Haori;
1147
- return fe.every(
1283
+ return Se.every(
1148
1284
  (r) => typeof e?.[r] == "function"
1149
- ) ? e : J;
1285
+ ) ? e : X;
1150
1286
  }
1151
- class A {
1287
+ class S {
1152
1288
  /**
1153
1289
  * フォーム内にある入力エレメントの値をオブジェクトとして取得します。
1154
1290
  * data-form-object属性があると、そのエレメント内の値はオブジェクトとして処理されます。
@@ -1159,7 +1295,7 @@ class A {
1159
1295
  */
1160
1296
  static getValues(e) {
1161
1297
  const t = {};
1162
- return A.getPartValues(e, t);
1298
+ return S.getPartValues(e, t);
1163
1299
  }
1164
1300
  /**
1165
1301
  * フォーム内の各入力エレメントから値を取得し、オブジェクトとして返します。
@@ -1177,11 +1313,11 @@ class A {
1177
1313
  `Element cannot have both ${l.prefix}form-object and name attributes.`
1178
1314
  );
1179
1315
  for (const n of e.getChildElementFragments())
1180
- A.getPartValues(n, t);
1316
+ S.getPartValues(n, t);
1181
1317
  } else if (i) {
1182
1318
  const n = {};
1183
1319
  for (const a of e.getChildElementFragments())
1184
- A.getPartValues(a, n);
1320
+ S.getPartValues(a, n);
1185
1321
  Object.keys(n).length > 0 && (t[String(i)] = n), s && p.warn(
1186
1322
  "Haori",
1187
1323
  `Element cannot have both ${l.prefix}form-list and ${l.prefix}form-object attributes.`
@@ -1190,12 +1326,12 @@ class A {
1190
1326
  const n = [];
1191
1327
  for (const a of e.getChildElementFragments()) {
1192
1328
  const o = {};
1193
- A.getPartValues(a, o), Object.keys(o).length > 0 && n.push(o);
1329
+ S.getPartValues(a, o), Object.keys(o).length > 0 && n.push(o);
1194
1330
  }
1195
1331
  n.length > 0 && (t[String(s)] = n);
1196
1332
  } else
1197
1333
  for (const n of e.getChildElementFragments())
1198
- A.getPartValues(n, t);
1334
+ S.getPartValues(n, t);
1199
1335
  return t;
1200
1336
  }
1201
1337
  /**
@@ -1208,7 +1344,7 @@ class A {
1208
1344
  * @returns Promise(DOMの更新が完了したら解決される)
1209
1345
  */
1210
1346
  static setValues(e, t, r = !1) {
1211
- return A.setPartValues(e, t, null, r, !0);
1347
+ return S.setPartValues(e, t, null, r, !0);
1212
1348
  }
1213
1349
  /**
1214
1350
  * フォーム内にある入力エレメントに値をイベントなしで設定します。
@@ -1220,7 +1356,7 @@ class A {
1220
1356
  * @returns Promise(DOMの更新が完了したら解決される)
1221
1357
  */
1222
1358
  static syncValues(e, t, r = !1) {
1223
- return A.setPartValues(e, t, null, r, !1);
1359
+ return S.setPartValues(e, t, null, r, !1);
1224
1360
  }
1225
1361
  /**
1226
1362
  * 単一フラグメントへ値を設定します。
@@ -1243,50 +1379,50 @@ class A {
1243
1379
  * @returns Promise(DOMの更新が完了したら解決される)
1244
1380
  */
1245
1381
  static setPartValues(e, t, r = null, i = !1, s = !0) {
1246
- const n = [], a = e.getAttribute("name"), o = e.getAttribute(`${l.prefix}form-object`), c = e.getAttribute(`${l.prefix}form-list`), h = e.getAttribute(`${l.prefix}form-detach`);
1382
+ const n = [], a = e.getAttribute("name"), o = e.getAttribute(`${l.prefix}form-object`), c = e.getAttribute(`${l.prefix}form-list`), d = e.getAttribute(`${l.prefix}form-detach`);
1247
1383
  if (a) {
1248
- if (!h || i) {
1249
- const f = t[String(a)];
1250
- c && Array.isArray(f) && r !== null ? n.push(
1251
- A.applyFragmentValue(e, f[r] ?? null, s)
1252
- ) : typeof f > "u" || (typeof f == "string" || typeof f == "number" || typeof f == "boolean" || f === null ? n.push(A.applyFragmentValue(e, f, s)) : n.push(
1253
- A.applyFragmentValue(e, String(f), s)
1384
+ if (!d || i) {
1385
+ const h = t[String(a)];
1386
+ c && Array.isArray(h) && r !== null ? n.push(
1387
+ S.applyFragmentValue(e, h[r] ?? null, s)
1388
+ ) : typeof h > "u" || (typeof h == "string" || typeof h == "number" || typeof h == "boolean" || h === null ? n.push(S.applyFragmentValue(e, h, s)) : n.push(
1389
+ S.applyFragmentValue(e, String(h), s)
1254
1390
  ));
1255
1391
  }
1256
1392
  } else if (o) {
1257
- const f = t[String(o)];
1258
- if (f && typeof f == "object")
1393
+ const h = t[String(o)];
1394
+ if (h && typeof h == "object")
1259
1395
  for (const g of e.getChildElementFragments())
1260
1396
  n.push(
1261
- A.setPartValues(
1397
+ S.setPartValues(
1262
1398
  g,
1263
- f,
1399
+ h,
1264
1400
  null,
1265
1401
  i,
1266
1402
  s
1267
1403
  )
1268
1404
  );
1269
1405
  } else if (c) {
1270
- const f = t[String(c)];
1271
- if (Array.isArray(f)) {
1406
+ const h = t[String(c)];
1407
+ if (Array.isArray(h)) {
1272
1408
  const g = e.getChildElementFragments();
1273
1409
  for (let v = 0; v < g.length; v++) {
1274
- const S = g[v];
1275
- f.length > v ? n.push(
1276
- A.setPartValues(
1277
- S,
1278
- f[v],
1410
+ const T = g[v];
1411
+ h.length > v ? n.push(
1412
+ S.setPartValues(
1413
+ T,
1414
+ h[v],
1279
1415
  v,
1280
1416
  i,
1281
1417
  s
1282
1418
  )
1283
- ) : n.push(A.setPartValues(S, {}, v, i, s));
1419
+ ) : n.push(S.setPartValues(T, {}, v, i, s));
1284
1420
  }
1285
1421
  }
1286
1422
  } else
1287
- for (const f of e.getChildElementFragments())
1423
+ for (const h of e.getChildElementFragments())
1288
1424
  n.push(
1289
- A.setPartValues(f, t, null, i, s)
1425
+ S.setPartValues(h, t, null, i, s)
1290
1426
  );
1291
1427
  return Promise.all(n).then(() => {
1292
1428
  });
@@ -1299,10 +1435,10 @@ class A {
1299
1435
  * @returns すべての初期化処理が完了するPromise
1300
1436
  */
1301
1437
  static async reset(e) {
1302
- A.clearValues(e), await Promise.all([
1303
- A.clearMessages(e),
1304
- A.clearEachClones(e)
1305
- ]), await M.enqueue(() => {
1438
+ S.clearValues(e), await Promise.all([
1439
+ S.clearMessages(e),
1440
+ S.clearEachClones(e)
1441
+ ]), await x.enqueue(() => {
1306
1442
  const t = e.getTarget();
1307
1443
  if (t instanceof HTMLFormElement)
1308
1444
  t.reset();
@@ -1347,7 +1483,7 @@ class A {
1347
1483
  static clearValues(e) {
1348
1484
  e.clearValue();
1349
1485
  for (const t of e.getChildElementFragments())
1350
- A.clearValues(t);
1486
+ S.clearValues(t);
1351
1487
  }
1352
1488
  /**
1353
1489
  * フラグメントとその子要素のメッセージをクリアします。
@@ -1356,7 +1492,7 @@ class A {
1356
1492
  * @returns Promise(メッセージのクリアが完了したら解決される)
1357
1493
  */
1358
1494
  static clearMessages(e) {
1359
- return ue().clearMessages(
1495
+ return he().clearMessages(
1360
1496
  e.getTarget()
1361
1497
  );
1362
1498
  }
@@ -1370,7 +1506,7 @@ class A {
1370
1506
  * @return Promise(メッセージの追加が完了したら解決される)
1371
1507
  */
1372
1508
  static addErrorMessage(e, t, r) {
1373
- return A.addMessage(e, t, r, "error");
1509
+ return S.addMessage(e, t, r, "error");
1374
1510
  }
1375
1511
  /**
1376
1512
  * キーに一致するフラグメントにレベル付きメッセージを追加します。
@@ -1383,9 +1519,9 @@ class A {
1383
1519
  * @return Promise(メッセージの追加が完了したら解決される)
1384
1520
  */
1385
1521
  static addMessage(e, t, r, i) {
1386
- const s = [], n = ue(), a = n.addMessage, o = (h) => typeof a == "function" ? a.call(n, h, r, i) : n.addErrorMessage(h, r), c = A.findFragmentsByKey(e, t);
1387
- return c.forEach((h) => {
1388
- s.push(o(h.getTarget()));
1522
+ const s = [], n = he(), a = n.addMessage, o = (d) => typeof a == "function" ? a.call(n, d, r, i) : n.addErrorMessage(d, r), c = S.findFragmentsByKey(e, t);
1523
+ return c.forEach((d) => {
1524
+ s.push(o(d.getTarget()));
1389
1525
  }), c.length === 0 && s.push(o(e.getTarget())), Promise.all(s).then(() => {
1390
1526
  });
1391
1527
  }
@@ -1397,7 +1533,7 @@ class A {
1397
1533
  * @returns 一致するフラグメントの配列
1398
1534
  */
1399
1535
  static findFragmentsByKey(e, t) {
1400
- return A.findFragmentByKeyParts(e, t.split("."));
1536
+ return S.findFragmentByKeyParts(e, t.split("."));
1401
1537
  }
1402
1538
  /**
1403
1539
  * 指定されたキーに一致するフラグメントを検索します。
@@ -1411,7 +1547,7 @@ class A {
1411
1547
  const r = [], i = t[0];
1412
1548
  if (t.length == 1 && e.getAttribute("name") === i && r.push(e), e.hasAttribute(`${l.prefix}form-object`))
1413
1549
  t.length > 1 && e.getAttribute(`${l.prefix}form-object`) === i && e.getChildElementFragments().forEach((n) => {
1414
- r.push(...A.findFragmentByKeyParts(n, t.slice(1)));
1550
+ r.push(...S.findFragmentByKeyParts(n, t.slice(1)));
1415
1551
  });
1416
1552
  else if (e.hasAttribute(`${l.prefix}form-list`)) {
1417
1553
  if (t.length > 1) {
@@ -1419,13 +1555,13 @@ class A {
1419
1555
  if (n !== -1 && a !== -1 && n < a) {
1420
1556
  const o = i.substring(0, n);
1421
1557
  if (s === o) {
1422
- const c = i.substring(n + 1, a), h = Number(c);
1423
- if (isNaN(h))
1558
+ const c = i.substring(n + 1, a), d = Number(c);
1559
+ if (isNaN(d))
1424
1560
  p.error("Haori", `Invalid index: ${i}`);
1425
1561
  else {
1426
- const f = e.getChildElementFragments().filter((g) => g.hasAttribute(`${l.prefix}row`));
1427
- h < f.length && r.push(
1428
- ...A.findFragmentByKeyParts(f[h], t.slice(1))
1562
+ const h = e.getChildElementFragments().filter((g) => g.hasAttribute(`${l.prefix}row`));
1563
+ d < h.length && r.push(
1564
+ ...S.findFragmentByKeyParts(h[d], t.slice(1))
1429
1565
  );
1430
1566
  }
1431
1567
  }
@@ -1433,7 +1569,7 @@ class A {
1433
1569
  }
1434
1570
  } else
1435
1571
  e.getChildElementFragments().forEach((s) => {
1436
- r.push(...A.findFragmentByKeyParts(s, t));
1572
+ r.push(...S.findFragmentByKeyParts(s, t));
1437
1573
  });
1438
1574
  return r;
1439
1575
  }
@@ -1456,12 +1592,12 @@ class A {
1456
1592
  return r ? this.getFormFragment(r) : null;
1457
1593
  }
1458
1594
  }
1459
- const x = class x {
1595
+ const N = class N {
1460
1596
  /**
1461
1597
  * 集計状態を初期化します。
1462
1598
  */
1463
1599
  static reset() {
1464
- x.ELEMENT_STORES.clear(), x.ensureGlobalAccess();
1600
+ N.ELEMENT_STORES.clear(), N.ensureGlobalAccess();
1465
1601
  }
1466
1602
  /**
1467
1603
  * 現在の集計結果スナップショットを返します。
@@ -1469,7 +1605,7 @@ const x = class x {
1469
1605
  * @returns エレメントごとの集計結果
1470
1606
  */
1471
1607
  static snapshot() {
1472
- return x.ensureGlobalAccess(), [...x.ELEMENT_STORES.entries()].map(([e, t]) => ({
1608
+ return N.ensureGlobalAccess(), [...N.ELEMENT_STORES.entries()].map(([e, t]) => ({
1473
1609
  elementId: e,
1474
1610
  tagName: t.tagName,
1475
1611
  attributes: [...t.attributes.entries()].map(([r, i]) => ({
@@ -1478,7 +1614,7 @@ const x = class x {
1478
1614
  calls: i.calls,
1479
1615
  totalDurationMs: i.totalDurationMs,
1480
1616
  maxDurationMs: i.maxDurationMs,
1481
- placeholders: x.sortPlaceholders(
1617
+ placeholders: N.sortPlaceholders(
1482
1618
  i.placeholders
1483
1619
  )
1484
1620
  })).sort((r, i) => i.calls - r.calls),
@@ -1488,7 +1624,7 @@ const x = class x {
1488
1624
  calls: i.calls,
1489
1625
  totalDurationMs: i.totalDurationMs,
1490
1626
  maxDurationMs: i.maxDurationMs,
1491
- placeholders: x.sortPlaceholders(
1627
+ placeholders: N.sortPlaceholders(
1492
1628
  i.placeholders
1493
1629
  )
1494
1630
  })).sort((r, i) => i.calls - r.calls)
@@ -1504,31 +1640,31 @@ const x = class x {
1504
1640
  * @param expressions 今回評価した式一覧
1505
1641
  */
1506
1642
  static record(e, t, r) {
1507
- if (!$.isEnabled() || !e || t.length === 0)
1643
+ if (!B.isEnabled() || !e || t.length === 0)
1508
1644
  return;
1509
- x.ensureGlobalAccess();
1510
- const i = x.getOrCreateElementStore(
1645
+ N.ensureGlobalAccess();
1646
+ const i = N.getOrCreateElementStore(
1511
1647
  e.element
1512
1648
  );
1513
1649
  if (e.kind === "attribute") {
1514
- const n = x.getOrCreateCounter(
1650
+ const n = N.getOrCreateCounter(
1515
1651
  i.attributes,
1516
1652
  e.rawName,
1517
1653
  e.template
1518
1654
  );
1519
- x.updateCounter(
1655
+ N.updateCounter(
1520
1656
  n,
1521
1657
  t,
1522
1658
  r
1523
1659
  );
1524
1660
  return;
1525
1661
  }
1526
- const s = x.getOrCreateCounter(
1662
+ const s = N.getOrCreateCounter(
1527
1663
  i.texts,
1528
1664
  String(e.childIndex),
1529
1665
  e.template
1530
1666
  );
1531
- x.updateCounter(
1667
+ N.updateCounter(
1532
1668
  s,
1533
1669
  t,
1534
1670
  r
@@ -1538,12 +1674,12 @@ const x = class x {
1538
1674
  * globalThis から dev-only の取得窓口を参照できるようにします。
1539
1675
  */
1540
1676
  static ensureGlobalAccess() {
1541
- if (!$.isEnabled())
1677
+ if (!B.isEnabled())
1542
1678
  return;
1543
1679
  const e = globalThis;
1544
- e[x.GLOBAL_KEY] === void 0 && (e[x.GLOBAL_KEY] = {
1545
- reset: () => x.reset(),
1546
- snapshot: () => x.snapshot()
1680
+ e[N.GLOBAL_KEY] === void 0 && (e[N.GLOBAL_KEY] = {
1681
+ reset: () => N.reset(),
1682
+ snapshot: () => N.snapshot()
1547
1683
  });
1548
1684
  }
1549
1685
  /**
@@ -1553,7 +1689,7 @@ const x = class x {
1553
1689
  * @returns 集計ストア
1554
1690
  */
1555
1691
  static getOrCreateElementStore(e) {
1556
- const t = x.createElementId(e), r = x.ELEMENT_STORES.get(t);
1692
+ const t = N.createElementId(e), r = N.ELEMENT_STORES.get(t);
1557
1693
  if (r)
1558
1694
  return r;
1559
1695
  const i = {
@@ -1561,7 +1697,7 @@ const x = class x {
1561
1697
  attributes: /* @__PURE__ */ new Map(),
1562
1698
  texts: /* @__PURE__ */ new Map()
1563
1699
  };
1564
- return x.ELEMENT_STORES.set(t, i), i;
1700
+ return N.ELEMENT_STORES.set(t, i), i;
1565
1701
  }
1566
1702
  /**
1567
1703
  * カウンタを取得または初期化します。
@@ -1611,7 +1747,7 @@ const x = class x {
1611
1747
  */
1612
1748
  static updateCounter(e, t, r) {
1613
1749
  e.calls += 1, e.totalDurationMs += r, e.maxDurationMs = Math.max(e.maxDurationMs, r), t.forEach((i) => {
1614
- const s = x.getOrCreatePlaceholder(
1750
+ const s = N.getOrCreatePlaceholder(
1615
1751
  e.placeholders,
1616
1752
  i.expression
1617
1753
  );
@@ -1650,10 +1786,10 @@ const x = class x {
1650
1786
  * @returns 結果と所要時間
1651
1787
  */
1652
1788
  static measure(e) {
1653
- const t = x.now();
1789
+ const t = N.now();
1654
1790
  return {
1655
1791
  value: e(),
1656
- durationMs: x.now() - t
1792
+ durationMs: N.now() - t
1657
1793
  };
1658
1794
  }
1659
1795
  /**
@@ -1680,8 +1816,8 @@ const x = class x {
1680
1816
  return t.join(" > ");
1681
1817
  }
1682
1818
  };
1683
- x.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", x.ELEMENT_STORES = /* @__PURE__ */ new Map();
1684
- let X = x;
1819
+ N.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", N.ELEMENT_STORES = /* @__PURE__ */ new Map();
1820
+ let Q = N;
1685
1821
  const G = class G {
1686
1822
  /**
1687
1823
  * フラグメントのコンストラクタ。
@@ -1705,7 +1841,7 @@ const G = class G {
1705
1841
  t = new L(e);
1706
1842
  break;
1707
1843
  case Node.COMMENT_NODE:
1708
- t = new oe(e);
1844
+ t = new le(e);
1709
1845
  break;
1710
1846
  default:
1711
1847
  return p.warn("[Haori]", "Unsupported node type:", e.nodeType), null;
@@ -1730,7 +1866,7 @@ const G = class G {
1730
1866
  return Promise.resolve();
1731
1867
  if (this.parent) {
1732
1868
  const e = this.parent, t = e.skipMutationNodes;
1733
- return M.enqueue(() => {
1869
+ return x.enqueue(() => {
1734
1870
  e.skipMutationNodes = !0, this.target.parentNode === e.getTarget() && e.getTarget().removeChild(this.target), this.mounted = !1;
1735
1871
  }).finally(() => {
1736
1872
  e.skipMutationNodes = t;
@@ -1738,7 +1874,7 @@ const G = class G {
1738
1874
  } else {
1739
1875
  const e = this.target.parentNode;
1740
1876
  if (e)
1741
- return M.enqueue(() => {
1877
+ return x.enqueue(() => {
1742
1878
  this.target.parentNode === e && e.removeChild(this.target), this.mounted = !1;
1743
1879
  });
1744
1880
  this.mounted = !1;
@@ -1755,7 +1891,7 @@ const G = class G {
1755
1891
  return Promise.resolve();
1756
1892
  if (this.parent) {
1757
1893
  const e = this.parent, t = e.skipMutationNodes;
1758
- return M.enqueue(() => {
1894
+ return x.enqueue(() => {
1759
1895
  e.skipMutationNodes = !0, this.target.parentNode !== e.getTarget() && e.getTarget().appendChild(this.target), this.mounted = !0;
1760
1896
  }).finally(() => {
1761
1897
  e.skipMutationNodes = t;
@@ -1841,7 +1977,7 @@ const V = class V extends w {
1841
1977
  ], this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.derivedBindingData = null, this.bindingDataCache = null, this.descendantBindingDataCache = null, this.visible = !0, this.display = null, this.displayPriority = null, this.template = null, this.listKey = null, this.renderSignature = null, this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.freshInitializationSkippable = !1, this.value = null, this.skipMutationAttributes = !1, this.skipChangeValue = !1, this.syncValue(), e.getAttributeNames().forEach((t) => {
1842
1978
  const r = e.getAttribute(t);
1843
1979
  if (r !== null && !this.attributeMap.has(t)) {
1844
- const i = new Q(t, r);
1980
+ const i = new Z(t, r);
1845
1981
  this.attributeMap.set(t, i);
1846
1982
  }
1847
1983
  }), e.childNodes.forEach((t) => {
@@ -2149,12 +2285,12 @@ const V = class V extends w {
2149
2285
  if (r instanceof HTMLInputElement && (r.type === "checkbox" || r.type === "radio")) {
2150
2286
  const i = this.getAttribute("value"), s = r.type === "checkbox" && i === "true";
2151
2287
  let n;
2152
- return s ? n = e === !0 || e === "true" : i === "false" ? n = e === !1 : n = i === String(e), this.value = s ? n : n ? e : null, r.checked === n ? Promise.resolve() : (this.skipChangeValue = !0, M.enqueue(() => {
2288
+ return s ? n = e === !0 || e === "true" : i === "false" ? n = e === !1 : n = i === String(e), this.value = s ? n : n ? e : null, r.checked === n ? Promise.resolve() : (this.skipChangeValue = !0, x.enqueue(() => {
2153
2289
  r.checked = n, t && r.dispatchEvent(new Event("change", { bubbles: !0 }));
2154
2290
  }).finally(() => {
2155
2291
  this.skipChangeValue = !1;
2156
2292
  }));
2157
- } else return r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement ? (this.value = e, this.skipChangeValue = !0, M.enqueue(() => {
2293
+ } else return r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement ? (this.value = e, this.skipChangeValue = !0, x.enqueue(() => {
2158
2294
  r.value = e === null ? "" : String(e), t && ((r instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(r.type) || r instanceof HTMLTextAreaElement) && r.dispatchEvent(new Event("input", { bubbles: !0 })), r.dispatchEvent(new Event("change", { bubbles: !0 })));
2159
2295
  }).finally(() => {
2160
2296
  this.skipChangeValue = !1;
@@ -2240,7 +2376,7 @@ const V = class V extends w {
2240
2376
  return Promise.resolve();
2241
2377
  this.attributeMap.delete(e), this.skipMutationAttributes = !0;
2242
2378
  const r = this.getTarget();
2243
- return M.enqueue(() => {
2379
+ return x.enqueue(() => {
2244
2380
  r.removeAttribute(e), t !== e && r.removeAttribute(t);
2245
2381
  }).finally(() => {
2246
2382
  this.skipMutationAttributes = !1;
@@ -2260,11 +2396,11 @@ const V = class V extends w {
2260
2396
  return Promise.resolve();
2261
2397
  if (r === null)
2262
2398
  return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
2263
- const n = new Q(e, r);
2399
+ const n = new Z(e, r);
2264
2400
  if (s) {
2265
2401
  const U = this.attributeMap.get(e);
2266
2402
  if (U && (U.isEvaluate || U.isForceEvaluation()) && !n.isEvaluate && !n.isForceEvaluation())
2267
- return this.skipMutationAttributes = !0, M.enqueue(() => {
2403
+ return this.skipMutationAttributes = !0, x.enqueue(() => {
2268
2404
  }).finally(() => {
2269
2405
  this.skipMutationAttributes = !1;
2270
2406
  });
@@ -2275,9 +2411,9 @@ const V = class V extends w {
2275
2411
  element: a,
2276
2412
  rawName: e,
2277
2413
  template: r
2278
- }), c = n.isEvaluate || n.isRawEvaluate, h = e === t && V.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), f = n.isSingleExpression(), g = j.joinEvaluateResults(o.results), v = o.results.length === 1 ? o.results[0] : g, S = !n.isForceEvaluation() && (t !== e || h || f ? o.hasUnresolvedReference || v === null || v === void 0 || v === !1 : c && g === ""), b = n.isForceEvaluation() ? r : f ? v : g, y = i && n.isEvaluate && t === "value" && (a instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(a.type) || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement), m = S || b === null || b === !1 ? null : String(b), E = e !== t && a.getAttribute(e) !== r, F = m === null ? a.hasAttribute(t) : a.getAttribute(t) !== m, N = y && m !== null && a.value !== m;
2279
- return !E && !F && !N ? (y && m !== null && (this.value = m), Promise.resolve()) : (this.skipMutationAttributes = !0, M.enqueue(() => {
2280
- E && a.setAttribute(e, r), m === null ? a.removeAttribute(t) : (F && a.setAttribute(t, m), y && (this.value = m, N && (a.value = m)));
2414
+ }), c = n.isEvaluate || n.isRawEvaluate, d = e === t && V.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), h = n.isSingleExpression(), g = j.joinEvaluateResults(o.results), v = o.results.length === 1 ? o.results[0] : g, T = !n.isForceEvaluation() && (t !== e || d || h ? o.hasUnresolvedReference || v === null || v === void 0 || v === !1 : c && g === ""), b = n.isForceEvaluation() ? r : h ? v : g, y = i && n.isEvaluate && t === "value" && (a instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(a.type) || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement), m = T || b === null || b === !1 ? null : String(b), A = e !== t && a.getAttribute(e) !== r, F = m === null ? a.hasAttribute(t) : a.getAttribute(t) !== m, M = y && m !== null && a.value !== m;
2415
+ return !A && !F && !M ? (y && m !== null && (this.value = m), Promise.resolve()) : (this.skipMutationAttributes = !0, x.enqueue(() => {
2416
+ A && a.setAttribute(e, r), m === null ? a.removeAttribute(t) : (F && a.setAttribute(t, m), y && (this.value = m, M && (a.value = m)));
2281
2417
  }).finally(() => {
2282
2418
  this.skipMutationAttributes = !1;
2283
2419
  }));
@@ -2293,7 +2429,7 @@ const V = class V extends w {
2293
2429
  return Promise.resolve();
2294
2430
  this.attributeMap.delete(e), this.skipMutationAttributes = !0;
2295
2431
  const t = this.getTarget();
2296
- return M.enqueue(() => {
2432
+ return x.enqueue(() => {
2297
2433
  t.removeAttribute(e);
2298
2434
  }).finally(() => {
2299
2435
  this.skipMutationAttributes = !1;
@@ -2408,7 +2544,7 @@ const V = class V extends w {
2408
2544
  n && (a = this.children.indexOf(e), t !== null && (o = this.children.indexOf(t)));
2409
2545
  const c = e.getParent();
2410
2546
  c !== null && c.removeChild(e);
2411
- let h = r === void 0 ? t?.getTarget() || null : r;
2547
+ let d = r === void 0 ? t?.getTarget() || null : r;
2412
2548
  if (t === null)
2413
2549
  this.children.push(e);
2414
2550
  else {
@@ -2422,16 +2558,16 @@ const V = class V extends w {
2422
2558
  "[Haori]",
2423
2559
  "Reference child not found in children.",
2424
2560
  t
2425
- ), this.children.push(e)) : (this.children.splice(v.index, 0, e), h = v.referenceNode);
2561
+ ), this.children.push(e)) : (this.children.splice(v.index, 0, e), d = v.referenceNode);
2426
2562
  } else
2427
2563
  this.children.splice(g, 0, e);
2428
2564
  }
2429
2565
  e.setParent(this), e.setMounted(this.mounted);
2430
- const f = this.skipMutationNodes;
2431
- return this.skipMutationNodes = !0, M.enqueue(() => {
2432
- this.target.insertBefore(e.getTarget(), h);
2566
+ const h = this.skipMutationNodes;
2567
+ return this.skipMutationNodes = !0, x.enqueue(() => {
2568
+ this.target.insertBefore(e.getTarget(), d);
2433
2569
  }).finally(() => {
2434
- this.skipMutationNodes = f;
2570
+ this.skipMutationNodes = h;
2435
2571
  });
2436
2572
  }
2437
2573
  /**
@@ -2615,7 +2751,7 @@ class L extends w {
2615
2751
  evaluate() {
2616
2752
  return this.contents.isRawEvaluate && this.parent === null ? Promise.reject(
2617
2753
  new Error("Parent fragment is required for raw evaluation")
2618
- ) : M.enqueue(() => {
2754
+ ) : x.enqueue(() => {
2619
2755
  this.skipMutation = !0;
2620
2756
  let e = this.text;
2621
2757
  this.contents.isRawEvaluate ? e = this.contents.evaluate(
@@ -2641,7 +2777,7 @@ class L extends w {
2641
2777
  });
2642
2778
  }
2643
2779
  }
2644
- class oe extends w {
2780
+ class le extends w {
2645
2781
  /**
2646
2782
  * コメントフラグメントのコンストラクタ。
2647
2783
  * 対象コメントノードの内容を初期化します。
@@ -2657,7 +2793,7 @@ class oe extends w {
2657
2793
  * @returns クローンされたフラグメント
2658
2794
  */
2659
2795
  clone() {
2660
- const e = new oe(this.target.cloneNode(!0));
2796
+ const e = new le(this.target.cloneNode(!0));
2661
2797
  return e.mounted = !1, e.text = this.text, e;
2662
2798
  }
2663
2799
  /**
@@ -2675,14 +2811,14 @@ class oe extends w {
2675
2811
  * @return 更新のPromise
2676
2812
  */
2677
2813
  setContent(e) {
2678
- return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, M.enqueue(() => {
2814
+ return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, x.enqueue(() => {
2679
2815
  this.skipMutation = !0, this.target.textContent = this.text;
2680
2816
  }).finally(() => {
2681
2817
  this.skipMutation = !1;
2682
2818
  }));
2683
2819
  }
2684
2820
  }
2685
- const _ = class _ {
2821
+ const ee = class ee {
2686
2822
  /**
2687
2823
  * コンストラクタ。
2688
2824
  *
@@ -2690,7 +2826,7 @@ const _ = class _ {
2690
2826
  */
2691
2827
  constructor(e) {
2692
2828
  this.contents = [], this.isEvaluate = !1, this.isRawEvaluate = !1, this.value = e;
2693
- const t = [...e.matchAll(_.PLACEHOLDER_REGEX)];
2829
+ const t = [...e.matchAll(ee.PLACEHOLDER_REGEX)];
2694
2830
  let r = 0, i = !1, s = !1;
2695
2831
  for (const n of t) {
2696
2832
  n.index > r && this.contents.push({
@@ -2787,35 +2923,35 @@ const _ = class _ {
2787
2923
  return this.contents.forEach((c) => {
2788
2924
  try {
2789
2925
  if (r(c)) {
2790
- const h = X.measure(
2791
- () => Y.evaluateDetailed(c.text, e)
2792
- ), f = h.value;
2793
- a += h.durationMs, n.push({
2926
+ const d = Q.measure(
2927
+ () => J.evaluateDetailed(c.text, e)
2928
+ ), h = d.value;
2929
+ a += d.durationMs, n.push({
2794
2930
  expression: c.text,
2795
- durationMs: h.durationMs
2796
- }), o = o || f.unresolvedReference, s.push(f.value);
2931
+ durationMs: d.durationMs
2932
+ }), o = o || h.unresolvedReference, s.push(h.value);
2797
2933
  } else
2798
2934
  s.push(c.text);
2799
- } catch (h) {
2935
+ } catch (d) {
2800
2936
  p.error(
2801
2937
  "[Haori]",
2802
2938
  `Error evaluating ${i} expression: ${c.text}`,
2803
- h
2939
+ d
2804
2940
  ), n.push({
2805
2941
  expression: c.text,
2806
2942
  durationMs: 0
2807
2943
  }), s.push("");
2808
2944
  }
2809
- }), X.record(
2945
+ }), Q.record(
2810
2946
  t,
2811
2947
  n,
2812
2948
  a
2813
2949
  ), { results: s, hasUnresolvedReference: o };
2814
2950
  }
2815
2951
  };
2816
- _.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
2817
- let j = _;
2818
- const ee = class ee extends j {
2952
+ ee.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
2953
+ let j = ee;
2954
+ const te = class te extends j {
2819
2955
  /**
2820
2956
  * コンストラクタ。
2821
2957
  *
@@ -2823,7 +2959,7 @@ const ee = class ee extends j {
2823
2959
  * @param text 属性値
2824
2960
  */
2825
2961
  constructor(e, t) {
2826
- super(t), this.forceEvaluation = ee.FORCE_EVALUATION_ATTRIBUTES.includes(e);
2962
+ super(t), this.forceEvaluation = te.FORCE_EVALUATION_ATTRIBUTES.includes(e);
2827
2963
  }
2828
2964
  /**
2829
2965
  * 強制評価フラグを取得します。
@@ -2870,7 +3006,7 @@ const ee = class ee extends j {
2870
3006
  }) : r;
2871
3007
  }
2872
3008
  };
2873
- ee.FORCE_EVALUATION_ATTRIBUTES = [
3009
+ te.FORCE_EVALUATION_ATTRIBUTES = [
2874
3010
  "data-if",
2875
3011
  "hor-if",
2876
3012
  "data-each",
@@ -2878,7 +3014,7 @@ ee.FORCE_EVALUATION_ATTRIBUTES = [
2878
3014
  "data-derive",
2879
3015
  "hor-derive"
2880
3016
  ];
2881
- let Q = ee;
3017
+ let Z = te;
2882
3018
  class R {
2883
3019
  /**
2884
3020
  * カスタムイベントを発火します。
@@ -2961,8 +3097,8 @@ class R {
2961
3097
  static bindChange(e, t, r, i = "other") {
2962
3098
  const s = [], n = new Set(Object.keys(t || {})), a = new Set(Object.keys(r)), o = /* @__PURE__ */ new Set([...n, ...a]);
2963
3099
  for (const c of o) {
2964
- const h = t?.[c], f = r[c];
2965
- h !== f && s.push(c);
3100
+ const d = t?.[c], h = r[c];
3101
+ d !== h && s.push(c);
2966
3102
  }
2967
3103
  R.dispatch(e, "bindchange", {
2968
3104
  previous: t || {},
@@ -3101,36 +3237,36 @@ class R {
3101
3237
  });
3102
3238
  }
3103
3239
  }
3104
- const pe = [
3240
+ const Te = [
3105
3241
  "addErrorMessage",
3106
3242
  "closeDialog",
3107
3243
  "confirm",
3108
3244
  "dialog",
3109
3245
  "openDialog",
3110
3246
  "toast"
3111
- ], ge = "__haoriHistoryState__", re = "data-haori-click-lock";
3112
- function ie() {
3247
+ ], we = "__haoriHistoryState__", ie = "data-haori-click-lock";
3248
+ function se() {
3113
3249
  const e = globalThis.window?.Haori;
3114
- return pe.every(
3250
+ return Te.every(
3115
3251
  (r) => typeof e?.[r] == "function"
3116
- ) ? e : J;
3252
+ ) ? e : X;
3117
3253
  }
3118
- const me = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
3119
- function be(T) {
3120
- return me.has(T.toUpperCase());
3254
+ const De = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
3255
+ function Re(E) {
3256
+ return De.has(E.toUpperCase());
3121
3257
  }
3122
- function ve(T, e) {
3258
+ function Fe(E, e) {
3123
3259
  for (const [t, r] of Object.entries(e))
3124
- r !== void 0 && (r === null ? T.append(t, "") : Array.isArray(r) ? r.forEach((i) => {
3125
- T.append(t, String(i));
3126
- }) : typeof r == "object" || typeof r == "function" ? T.append(t, JSON.stringify(r)) : T.append(t, String(r)));
3260
+ r !== void 0 && (r === null ? E.append(t, "") : Array.isArray(r) ? r.forEach((i) => {
3261
+ E.append(t, String(i));
3262
+ }) : typeof r == "object" || typeof r == "function" ? E.append(t, JSON.stringify(r)) : E.append(t, String(r)));
3127
3263
  }
3128
- function ye(T, e) {
3129
- const t = new URL(T, window.location.href), r = new URLSearchParams(t.search);
3130
- return ve(r, e), t.search = r.toString(), t.toString();
3264
+ function Ne(E, e) {
3265
+ const t = new URL(E, window.location.href), r = new URLSearchParams(t.search);
3266
+ return Fe(r, e), t.search = r.toString(), t.toString();
3131
3267
  }
3132
- function Ee(T) {
3133
- return T == null ? null : typeof T == "string" ? T : T instanceof URLSearchParams ? T.toString() : T instanceof FormData ? Array.from(T.entries()).map(([e, t]) => t instanceof File ? [
3268
+ function Me(E) {
3269
+ return E == null ? null : typeof E == "string" ? E : E instanceof URLSearchParams ? E.toString() : E instanceof FormData ? Array.from(E.entries()).map(([e, t]) => t instanceof File ? [
3134
3270
  e,
3135
3271
  {
3136
3272
  type: "file",
@@ -3138,22 +3274,22 @@ function Ee(T) {
3138
3274
  size: t.size,
3139
3275
  mimeType: t.type
3140
3276
  }
3141
- ] : [e, String(t)]) : String(T);
3277
+ ] : [e, String(t)]) : String(E);
3142
3278
  }
3143
- function Ae(T, e) {
3279
+ function xe(E, e) {
3144
3280
  const t = new Headers(
3145
3281
  e.headers || void 0
3146
3282
  ), r = Array.from(t.entries()).sort(
3147
3283
  ([i], [s]) => i.localeCompare(s)
3148
3284
  );
3149
3285
  return JSON.stringify({
3150
- url: T,
3286
+ url: E,
3151
3287
  method: String(e.method || "GET").toUpperCase(),
3152
3288
  headers: r,
3153
- body: Ee(e.body || null)
3289
+ body: Me(e.body || null)
3154
3290
  });
3155
3291
  }
3156
- const d = class d {
3292
+ const f = class f {
3157
3293
  /**
3158
3294
  * イベント属性名を正しく生成します。
3159
3295
  * 例: ("click", "fetch") => "data-click-fetch"
@@ -3172,7 +3308,7 @@ const d = class d {
3172
3308
  * @returns パラメータ形式として扱える文字列
3173
3309
  */
3174
3310
  static resolveDataParamString(e, t) {
3175
- return d.resolveDataParamStringDetailed(e, t).value;
3311
+ return f.resolveDataParamStringDetailed(e, t).value;
3176
3312
  }
3177
3313
  /**
3178
3314
  * data 属性のテンプレート式評価結果を URLSearchParams 向けに組み立てます。
@@ -3184,9 +3320,9 @@ const d = class d {
3184
3320
  static resolveDataParamStringDetailed(e, t) {
3185
3321
  let r = !1;
3186
3322
  return { value: e.replace(
3187
- d.DATA_PLACEHOLDER_REGEX,
3323
+ f.DATA_PLACEHOLDER_REGEX,
3188
3324
  (s, n, a) => {
3189
- const o = Y.evaluateDetailed(
3325
+ const o = J.evaluateDetailed(
3190
3326
  n ?? a ?? "",
3191
3327
  t
3192
3328
  );
@@ -3241,7 +3377,7 @@ const d = class d {
3241
3377
  static stringifyJsonTemplateStringContent(e) {
3242
3378
  if (e == null || Number.isNaN(e))
3243
3379
  return "";
3244
- const t = typeof e == "object" ? d.stringifyJsonTemplateValue(e) : String(e);
3380
+ const t = typeof e == "object" ? f.stringifyJsonTemplateValue(e) : String(e);
3245
3381
  return JSON.stringify(t).slice(1, -1);
3246
3382
  }
3247
3383
  /**
@@ -3252,7 +3388,7 @@ const d = class d {
3252
3388
  * @returns JSON として解釈可能な文字列
3253
3389
  */
3254
3390
  static resolveDataJsonString(e, t) {
3255
- return d.resolveDataJsonStringDetailed(e, t).value;
3391
+ return f.resolveDataJsonStringDetailed(e, t).value;
3256
3392
  }
3257
3393
  /**
3258
3394
  * JSON 形式 data 属性内のテンプレート式を安全に解決します。
@@ -3264,13 +3400,13 @@ const d = class d {
3264
3400
  static resolveDataJsonStringDetailed(e, t) {
3265
3401
  let r = !1;
3266
3402
  return { value: e.replace(
3267
- d.DATA_PLACEHOLDER_REGEX,
3403
+ f.DATA_PLACEHOLDER_REGEX,
3268
3404
  (s, n, a, o) => {
3269
- const c = Y.evaluateDetailed(
3405
+ const c = J.evaluateDetailed(
3270
3406
  n ?? a ?? "",
3271
3407
  t
3272
3408
  );
3273
- return r = r || c.unresolvedReference, d.isJsonStringContext(e, o) ? d.stringifyJsonTemplateStringContent(c.value) : d.stringifyJsonTemplateValue(c.value);
3409
+ return r = r || c.unresolvedReference, f.isJsonStringContext(e, o) ? f.stringifyJsonTemplateStringContent(c.value) : f.stringifyJsonTemplateValue(c.value);
3274
3410
  }
3275
3411
  ), hasUnresolvedReference: r };
3276
3412
  }
@@ -3282,7 +3418,7 @@ const d = class d {
3282
3418
  * @returns 送信データ
3283
3419
  */
3284
3420
  static resolveDataAttribute(e, t) {
3285
- return d.resolveDataAttributeDetailed(e, t).value;
3421
+ return f.resolveDataAttributeDetailed(e, t).value;
3286
3422
  }
3287
3423
  /**
3288
3424
  * data 属性を評価済みの値として取得し、未解決参照の有無を返します。
@@ -3301,13 +3437,13 @@ const d = class d {
3301
3437
  if (typeof s != "string" || r === null)
3302
3438
  return { value: null, hasUnresolvedReference: n };
3303
3439
  const a = r.trim();
3304
- if (d.SINGLE_PLACEHOLDER_REGEX.test(a))
3440
+ if (f.SINGLE_PLACEHOLDER_REGEX.test(a))
3305
3441
  return {
3306
3442
  value: P.parseDataBind(s),
3307
3443
  hasUnresolvedReference: n
3308
3444
  };
3309
3445
  if (a.startsWith("{") || a.startsWith("[")) {
3310
- const c = d.resolveDataJsonStringDetailed(
3446
+ const c = f.resolveDataJsonStringDetailed(
3311
3447
  r,
3312
3448
  e.getBindingData()
3313
3449
  );
@@ -3316,7 +3452,7 @@ const d = class d {
3316
3452
  hasUnresolvedReference: n || c.hasUnresolvedReference
3317
3453
  };
3318
3454
  }
3319
- const o = d.resolveDataParamStringDetailed(
3455
+ const o = f.resolveDataParamStringDetailed(
3320
3456
  r,
3321
3457
  e.getBindingData()
3322
3458
  );
@@ -3337,22 +3473,22 @@ const d = class d {
3337
3473
  targetFragment: e
3338
3474
  };
3339
3475
  if (t) {
3340
- if (e.hasAttribute(d.attrName(t, "validate")) && (r.valid = !0), e.hasAttribute(d.attrName(t, "confirm")) && (r.confirmMessage = e.getAttribute(d.attrName(t, "confirm")).replace(/\\n/g, `
3341
- `)), e.hasAttribute(d.attrName(t, "data")) && (r.dataAttrName = d.attrName(t, "data")), e.hasAttribute(d.attrName(t, "form"))) {
3476
+ if (e.hasAttribute(f.attrName(t, "validate")) && (r.valid = !0), e.hasAttribute(f.attrName(t, "confirm")) && (r.confirmMessage = e.getAttribute(f.attrName(t, "confirm")).replace(/\\n/g, `
3477
+ `)), e.hasAttribute(f.attrName(t, "data")) && (r.dataAttrName = f.attrName(t, "data")), e.hasAttribute(f.attrName(t, "form"))) {
3342
3478
  const y = e.getRawAttribute(
3343
- d.attrName(t, "form")
3479
+ f.attrName(t, "form")
3344
3480
  );
3345
3481
  if (y) {
3346
3482
  const m = document.body.querySelector(y);
3347
- m !== null ? r.formFragment = A.getFormFragment(
3483
+ m !== null ? r.formFragment = S.getFormFragment(
3348
3484
  w.get(m)
3349
3485
  ) : p.error(
3350
3486
  "Haori",
3351
- `Form element not found: ${y} (${d.attrName(t, "form")})`
3487
+ `Form element not found: ${y} (${f.attrName(t, "form")})`
3352
3488
  );
3353
3489
  } else
3354
- r.formFragment = A.getFormFragment(e);
3355
- } else t === "change" && (r.formFragment = A.getFormFragment(e));
3490
+ r.formFragment = S.getFormFragment(e);
3491
+ } else t === "change" && (r.formFragment = S.getFormFragment(e));
3356
3492
  if (e.hasAttribute(`${l.prefix}${t}-before-run`)) {
3357
3493
  const y = e.getRawAttribute(
3358
3494
  `${l.prefix}${t}-before-run`
@@ -3370,7 +3506,7 @@ ${y}
3370
3506
  p.error("Haori", `Invalid before script: ${m}`);
3371
3507
  }
3372
3508
  }
3373
- const b = d.attrName(t, "run");
3509
+ const b = f.attrName(t, "run");
3374
3510
  if (e.hasAttribute(b)) {
3375
3511
  const y = String(e.getAttribute(b) ?? "");
3376
3512
  try {
@@ -3386,20 +3522,20 @@ ${y}
3386
3522
  }
3387
3523
  }
3388
3524
  }
3389
- const i = d.attrName(t, "fetch"), s = e.hasAttribute(i);
3525
+ const i = f.attrName(t, "fetch"), s = e.hasAttribute(i);
3390
3526
  if (s) {
3391
3527
  const b = e.getAttributeEvaluation(i);
3392
3528
  b && (r.fetchHasUnresolvedReference = b.hasUnresolvedReference, r.fetchUrl = b.hasUnresolvedReference ? null : b.value);
3393
3529
  }
3394
3530
  const n = {};
3395
3531
  if (t) {
3396
- const b = d.attrName(t, "fetch-method");
3532
+ const b = f.attrName(t, "fetch-method");
3397
3533
  if (e.hasAttribute(b)) {
3398
3534
  const y = e.getAttributeEvaluation(b);
3399
3535
  y?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : n.method = y?.value;
3400
3536
  }
3401
3537
  } else {
3402
- const b = d.attrName(null, "method", !0);
3538
+ const b = f.attrName(null, "method", !0);
3403
3539
  if (e.hasAttribute(b)) {
3404
3540
  const y = e.getAttributeEvaluation(
3405
3541
  b
@@ -3408,7 +3544,7 @@ ${y}
3408
3544
  }
3409
3545
  }
3410
3546
  if (t) {
3411
- const b = d.attrName(t, "fetch-headers");
3547
+ const b = f.attrName(t, "fetch-headers");
3412
3548
  if (e.hasAttribute(b)) {
3413
3549
  const y = e.getRawAttribute(
3414
3550
  b
@@ -3420,7 +3556,7 @@ ${y}
3420
3556
  }
3421
3557
  }
3422
3558
  } else {
3423
- const b = d.attrName(
3559
+ const b = f.attrName(
3424
3560
  null,
3425
3561
  "headers",
3426
3562
  !0
@@ -3437,7 +3573,7 @@ ${y}
3437
3573
  }
3438
3574
  }
3439
3575
  if (t) {
3440
- const b = d.attrName(t, "fetch-content-type");
3576
+ const b = f.attrName(t, "fetch-content-type");
3441
3577
  if (e.hasAttribute(b)) {
3442
3578
  const y = e.getAttributeEvaluation(b);
3443
3579
  y?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), n.headers = {
@@ -3455,7 +3591,7 @@ ${y}
3455
3591
  "Content-Type": "application/x-www-form-urlencoded"
3456
3592
  });
3457
3593
  } else {
3458
- const b = d.attrName(
3594
+ const b = f.attrName(
3459
3595
  null,
3460
3596
  "content-type",
3461
3597
  !0
@@ -3478,72 +3614,72 @@ ${y}
3478
3614
  });
3479
3615
  }
3480
3616
  Object.keys(n).length > 0 && (r.fetchOptions = n);
3481
- const a = t ? d.attrName(t, "bind") : d.attrName(null, "bind", !0);
3617
+ const a = t ? f.attrName(t, "bind") : f.attrName(null, "bind", !0);
3482
3618
  if (e.hasAttribute(a)) {
3483
3619
  const b = e.getRawAttribute(a);
3484
3620
  if (b) {
3485
3621
  const y = document.body.querySelectorAll(b);
3486
3622
  y.length > 0 ? (r.bindFragments = [], y.forEach((m) => {
3487
- const E = w.get(m);
3488
- E && r.bindFragments.push(E);
3623
+ const A = w.get(m);
3624
+ A && r.bindFragments.push(A);
3489
3625
  })) : p.error(
3490
3626
  "Haori",
3491
3627
  `Bind element not found: ${b} (${a})`
3492
3628
  );
3493
3629
  }
3494
3630
  }
3495
- const o = d.attrName(t, "bind-arg"), c = d.attrName(
3631
+ const o = f.attrName(t, "bind-arg"), c = f.attrName(
3496
3632
  null,
3497
3633
  "arg",
3498
3634
  !0
3499
- ), h = d.attrName(
3635
+ ), d = f.attrName(
3500
3636
  null,
3501
3637
  "bind-arg",
3502
3638
  !0
3503
3639
  );
3504
3640
  t ? e.hasAttribute(o) && (r.bindArg = e.getRawAttribute(o)) : e.hasAttribute(c) ? r.bindArg = e.getRawAttribute(
3505
3641
  c
3506
- ) : e.hasAttribute(h) && (r.bindArg = e.getRawAttribute(h));
3507
- const f = t ? d.attrName(t, "bind-params") : d.attrName(null, "bind-params", !0);
3508
- if (e.hasAttribute(f)) {
3509
- const b = e.getRawAttribute(f);
3642
+ ) : e.hasAttribute(d) && (r.bindArg = e.getRawAttribute(d));
3643
+ const h = t ? f.attrName(t, "bind-params") : f.attrName(null, "bind-params", !0);
3644
+ if (e.hasAttribute(h)) {
3645
+ const b = e.getRawAttribute(h);
3510
3646
  r.bindParams = b.split("&").map((y) => y.trim());
3511
3647
  }
3512
- const g = t ? d.attrName(t, "bind-append") : d.attrName(null, "bind-append", !0);
3648
+ const g = t ? f.attrName(t, "bind-append") : f.attrName(null, "bind-append", !0);
3513
3649
  if (e.hasAttribute(g)) {
3514
3650
  const b = e.getRawAttribute(g);
3515
3651
  r.bindAppendParams = b.split("&").map((y) => y.trim()).filter(Boolean);
3516
3652
  }
3517
- const v = t ? d.attrName(t, "bind-merge") : d.attrName(null, "bind-merge", !0);
3653
+ const v = t ? f.attrName(t, "bind-merge") : f.attrName(null, "bind-merge", !0);
3518
3654
  e.hasAttribute(v) && (r.bindMerge = !0);
3519
- const S = t ? d.attrName(t, "copy-params") : null;
3520
- if (S && e.hasAttribute(S)) {
3521
- const b = e.getRawAttribute(S);
3655
+ const T = t ? f.attrName(t, "copy-params") : null;
3656
+ if (T && e.hasAttribute(T)) {
3657
+ const b = e.getRawAttribute(T);
3522
3658
  r.copyParams = b.split("&").map((y) => y.trim()).filter(Boolean);
3523
3659
  }
3524
3660
  if (t) {
3525
- if (e.hasAttribute(d.attrName(t, "adjust"))) {
3661
+ if (e.hasAttribute(f.attrName(t, "adjust"))) {
3526
3662
  const m = e.getRawAttribute(
3527
- d.attrName(t, "adjust")
3663
+ f.attrName(t, "adjust")
3528
3664
  );
3529
3665
  if (m) {
3530
- const E = document.body.querySelectorAll(m);
3531
- E.length > 0 ? (r.adjustFragments = [], E.forEach((F) => {
3532
- const N = w.get(F);
3533
- N && r.adjustFragments.push(N);
3666
+ const A = document.body.querySelectorAll(m);
3667
+ A.length > 0 ? (r.adjustFragments = [], A.forEach((F) => {
3668
+ const M = w.get(F);
3669
+ M && r.adjustFragments.push(M);
3534
3670
  })) : p.error(
3535
3671
  "Haori",
3536
- `Adjust element not found: ${m} (${d.attrName(t, "adjust")})`
3672
+ `Adjust element not found: ${m} (${f.attrName(t, "adjust")})`
3537
3673
  );
3538
3674
  }
3539
- if (e.hasAttribute(d.attrName(t, "adjust-value"))) {
3540
- const E = e.getRawAttribute(
3541
- d.attrName(t, "adjust-value")
3542
- ), F = Number(E);
3675
+ if (e.hasAttribute(f.attrName(t, "adjust-value"))) {
3676
+ const A = e.getRawAttribute(
3677
+ f.attrName(t, "adjust-value")
3678
+ ), F = Number(A);
3543
3679
  isNaN(F) || (r.adjustValue = F);
3544
3680
  }
3545
3681
  }
3546
- if (e.hasAttribute(d.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(d.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(d.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(d.attrName(t, "row-next")) && (r.rowMoveNext = !0), e.hasAttribute(`${l.prefix}${t}-after-run`)) {
3682
+ if (e.hasAttribute(f.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(f.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(f.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(f.attrName(t, "row-next")) && (r.rowMoveNext = !0), e.hasAttribute(`${l.prefix}${t}-after-run`)) {
3547
3683
  const m = e.getRawAttribute(
3548
3684
  `${l.prefix}${t}-after-run`
3549
3685
  );
@@ -3555,40 +3691,40 @@ ${y}
3555
3691
  ${m}
3556
3692
  `
3557
3693
  );
3558
- } catch (E) {
3559
- p.error("Haori", `Invalid after script: ${E}`);
3694
+ } catch (A) {
3695
+ p.error("Haori", `Invalid after script: ${A}`);
3560
3696
  }
3561
3697
  }
3562
- if (e.hasAttribute(d.attrName(t, "dialog")) && (r.dialogMessage = e.getAttribute(d.attrName(t, "dialog")).replace(/\\n/g, `
3563
- `)), e.hasAttribute(d.attrName(t, "toast"))) {
3698
+ if (e.hasAttribute(f.attrName(t, "dialog")) && (r.dialogMessage = e.getAttribute(f.attrName(t, "dialog")).replace(/\\n/g, `
3699
+ `)), e.hasAttribute(f.attrName(t, "toast"))) {
3564
3700
  r.toastMessage = e.getAttribute(
3565
- d.attrName(t, "toast")
3701
+ f.attrName(t, "toast")
3566
3702
  );
3567
3703
  const m = e.getRawAttribute(
3568
- d.attrName(t, "toast-level")
3704
+ f.attrName(t, "toast-level")
3569
3705
  ), F = ["info", "warning", "error", "success"].includes(m);
3570
3706
  r.toastLevel = F ? m : null;
3571
3707
  }
3572
- if (e.hasAttribute(d.attrName(t, "redirect")) && (r.redirectUrl = e.getAttribute(
3573
- d.attrName(t, "redirect")
3574
- )), e.hasAttribute(d.attrName(t, "scroll-error")) && (r.scrollOnError = !0), e.hasAttribute(d.attrName(t, "scroll")) && (r.scrollTarget = e.getAttribute(
3575
- d.attrName(t, "scroll")
3576
- )), e.hasAttribute(d.attrName(t, "history")) && (r.historyUrl = e.getAttribute(
3577
- d.attrName(t, "history")
3578
- )), e.hasAttribute(d.attrName(t, "history-data")) && (r.historyDataAttrName = d.attrName(t, "history-data")), e.hasAttribute(d.attrName(t, "history-form"))) {
3708
+ if (e.hasAttribute(f.attrName(t, "redirect")) && (r.redirectUrl = e.getAttribute(
3709
+ f.attrName(t, "redirect")
3710
+ )), e.hasAttribute(f.attrName(t, "scroll-error")) && (r.scrollOnError = !0), e.hasAttribute(f.attrName(t, "scroll")) && (r.scrollTarget = e.getAttribute(
3711
+ f.attrName(t, "scroll")
3712
+ )), e.hasAttribute(f.attrName(t, "history")) && (r.historyUrl = e.getAttribute(
3713
+ f.attrName(t, "history")
3714
+ )), e.hasAttribute(f.attrName(t, "history-data")) && (r.historyDataAttrName = f.attrName(t, "history-data")), e.hasAttribute(f.attrName(t, "history-form"))) {
3579
3715
  const m = e.getRawAttribute(
3580
- d.attrName(t, "history-form")
3716
+ f.attrName(t, "history-form")
3581
3717
  );
3582
3718
  if (m) {
3583
- const E = document.body.querySelector(m);
3584
- E !== null ? r.historyFormFragment = A.getFormFragment(
3585
- w.get(E)
3719
+ const A = document.body.querySelector(m);
3720
+ A !== null ? r.historyFormFragment = S.getFormFragment(
3721
+ w.get(A)
3586
3722
  ) : p.error(
3587
3723
  "Haori",
3588
- `Form element not found: ${m} (${d.attrName(t, "history-form")})`
3724
+ `Form element not found: ${m} (${f.attrName(t, "history-form")})`
3589
3725
  );
3590
3726
  } else
3591
- r.historyFormFragment = A.getFormFragment(e);
3727
+ r.historyFormFragment = S.getFormFragment(e);
3592
3728
  }
3593
3729
  [
3594
3730
  "reset-before",
@@ -3599,47 +3735,47 @@ ${m}
3599
3735
  "open",
3600
3736
  "close"
3601
3737
  ].forEach((m) => {
3602
- const E = d.attrName(t, m);
3603
- if (!e.hasAttribute(E))
3738
+ const A = f.attrName(t, m);
3739
+ if (!e.hasAttribute(A))
3604
3740
  return;
3605
- const F = e.getRawAttribute(E), N = [];
3606
- if (F ? (document.body.querySelectorAll(F).forEach((B) => {
3607
- const K = w.get(B);
3608
- K && N.push(K);
3609
- }), N.length === 0 && p.error("Haori", `Element not found: ${F} (${E})`)) : N.push(e), N.length > 0)
3741
+ const F = e.getRawAttribute(A), M = [];
3742
+ if (F ? (document.body.querySelectorAll(F).forEach(($) => {
3743
+ const K = w.get($);
3744
+ K && M.push(K);
3745
+ }), M.length === 0 && p.error("Haori", `Element not found: ${F} (${A})`)) : M.push(e), M.length > 0)
3610
3746
  switch (m) {
3611
3747
  case "reset-before":
3612
- r.resetBeforeFragments = N;
3748
+ r.resetBeforeFragments = M;
3613
3749
  break;
3614
3750
  case "reset":
3615
- r.resetFragments = N;
3751
+ r.resetFragments = M;
3616
3752
  break;
3617
3753
  case "refetch":
3618
- r.refetchFragments = N;
3754
+ r.refetchFragments = M;
3619
3755
  break;
3620
3756
  case "click":
3621
- r.clickFragments = N;
3757
+ r.clickFragments = M;
3622
3758
  break;
3623
3759
  case "copy":
3624
- r.copyFragments = N;
3760
+ r.copyFragments = M;
3625
3761
  break;
3626
3762
  case "open":
3627
- r.openFragments = N;
3763
+ r.openFragments = M;
3628
3764
  break;
3629
3765
  case "close":
3630
- r.closeFragments = N;
3766
+ r.closeFragments = M;
3631
3767
  break;
3632
3768
  }
3633
3769
  });
3634
- const y = d.attrName(t, "copy-source");
3770
+ const y = f.attrName(t, "copy-source");
3635
3771
  if (e.hasAttribute(y)) {
3636
3772
  const m = e.getRawAttribute(
3637
3773
  y
3638
3774
  );
3639
3775
  if (m) {
3640
- const E = document.body.querySelector(m);
3641
- if (E !== null) {
3642
- const F = w.get(E);
3776
+ const A = document.body.querySelector(m);
3777
+ if (A !== null) {
3778
+ const F = w.get(A);
3643
3779
  F ? r.copySourceFragment = F : p.error(
3644
3780
  "Haori",
3645
3781
  `Element is not managed by Haori: ${m} (${y})`
@@ -3653,20 +3789,20 @@ ${m}
3653
3789
  r.copySourceFragment = e;
3654
3790
  }
3655
3791
  }
3656
- if (!t && (e.hasAttribute(d.attrName(null, "data", !0)) && (r.dataAttrName = d.attrName(null, "data", !0)), e.hasAttribute(d.attrName(null, "form", !0)))) {
3792
+ if (!t && (e.hasAttribute(f.attrName(null, "data", !0)) && (r.dataAttrName = f.attrName(null, "data", !0)), e.hasAttribute(f.attrName(null, "form", !0)))) {
3657
3793
  const b = e.getRawAttribute(
3658
- d.attrName(null, "form", !0)
3794
+ f.attrName(null, "form", !0)
3659
3795
  );
3660
3796
  if (b) {
3661
3797
  const y = document.body.querySelector(b);
3662
- y !== null ? r.formFragment = A.getFormFragment(
3798
+ y !== null ? r.formFragment = S.getFormFragment(
3663
3799
  w.get(y)
3664
3800
  ) : p.error(
3665
3801
  "Haori",
3666
- `Form element not found: ${b} (${d.attrName(null, "fetch-form", !0)})`
3802
+ `Form element not found: ${b} (${f.attrName(null, "fetch-form", !0)})`
3667
3803
  );
3668
3804
  } else
3669
- r.formFragment = A.getFormFragment(e);
3805
+ r.formFragment = S.getFormFragment(e);
3670
3806
  }
3671
3807
  return s && (!r.bindFragments || r.bindFragments.length === 0) && (r.bindFragments = [e]), r;
3672
3808
  }
@@ -3690,7 +3826,7 @@ ${m}
3690
3826
  * @param domEvent 起点となった DOM イベント
3691
3827
  */
3692
3828
  constructor(e, t = null, r = null) {
3693
- d.isElementFragment(e) ? (this.options = d.buildOptions(e, t), this.eventType = t) : (this.options = e, this.eventType = null), this.domEvent = r;
3829
+ f.isElementFragment(e) ? (this.options = f.buildOptions(e, t), this.eventType = t) : (this.options = e, this.eventType = null), this.domEvent = r;
3694
3830
  }
3695
3831
  /**
3696
3832
  * 非イベント data-fetch の自動再評価用シグネチャを解決します。
@@ -3699,7 +3835,7 @@ ${m}
3699
3835
  * @returns フェッチシグネチャと未解決参照の有無
3700
3836
  */
3701
3837
  static resolveAutoFetchSignature(e) {
3702
- return new d(e, null).resolveFetchSignature();
3838
+ return new f(e, null).resolveFetchSignature();
3703
3839
  }
3704
3840
  /**
3705
3841
  * 一連の処理を実行します。オプションが空の場合は即座にresolveされます。
@@ -3731,62 +3867,62 @@ ${m}
3731
3867
  if (Object.keys(this.options).length === 0 || this.options.formFragment && this.validate(this.options.formFragment) === !1)
3732
3868
  return !1;
3733
3869
  if (this.options.runScript) {
3734
- const h = this.options.targetFragment?.getTarget() ?? null;
3870
+ const d = this.options.targetFragment?.getTarget() ?? null;
3735
3871
  try {
3736
3872
  this.options.runScript.call(
3737
- h,
3873
+ d,
3738
3874
  this.domEvent
3739
3875
  ) === !1 && this.domEvent && this.domEvent.preventDefault();
3740
- } catch (f) {
3741
- p.error("Haori", `Run script execution error: ${f}`);
3876
+ } catch (h) {
3877
+ p.error("Haori", `Run script execution error: ${h}`);
3742
3878
  }
3743
3879
  }
3744
3880
  if (!await this.confirm())
3745
3881
  return !1;
3746
3882
  this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
3747
3883
  this.options.resetBeforeFragments.map(
3748
- (h) => A.reset(h)
3884
+ (d) => S.reset(d)
3749
3885
  )
3750
3886
  ), this.captureHistorySnapshots());
3751
3887
  const r = this.prepareFetchRequest(), i = r.payload;
3752
3888
  let s = r.url, n = r.options;
3753
3889
  if (this.options.beforeCallback) {
3754
- const h = this.options.beforeCallback(
3890
+ const d = this.options.beforeCallback(
3755
3891
  s || null,
3756
3892
  n || null
3757
3893
  );
3758
- if (h != null) {
3759
- if (h === !1 || typeof h == "object" && h.stop)
3894
+ if (d != null) {
3895
+ if (d === !1 || typeof d == "object" && d.stop)
3760
3896
  return !1;
3761
- typeof h == "object" && (s = "fetchUrl" in h ? h.fetchUrl : s, n = "fetchOptions" in h ? h.fetchOptions : n);
3897
+ typeof d == "object" && (s = "fetchUrl" in d ? d.fetchUrl : s, n = "fetchOptions" in d ? d.fetchOptions : n);
3762
3898
  }
3763
3899
  }
3764
3900
  const a = Object.keys(i).length > 0;
3765
3901
  if (s) {
3766
- const h = { ...n || {} }, f = r.requestedMethod, g = r.effectiveMethod, v = r.transportMode === "query-get", S = r.queryString;
3902
+ const d = { ...n || {} }, h = r.requestedMethod, g = r.effectiveMethod, v = r.transportMode === "query-get", T = r.queryString;
3767
3903
  if (v && p.info("Haori demo fetch normalization", {
3768
3904
  runtime: l.runtime,
3769
- requestedMethod: f,
3905
+ requestedMethod: h,
3770
3906
  effectiveMethod: g,
3771
3907
  transportMode: "query-get",
3772
3908
  url: s,
3773
3909
  payload: a ? i : void 0,
3774
- queryString: S
3910
+ queryString: T
3775
3911
  }), this.options.targetFragment && s) {
3776
3912
  const b = performance.now(), y = {
3777
3913
  runtime: l.runtime,
3778
- requestedMethod: f,
3914
+ requestedMethod: h,
3779
3915
  effectiveMethod: g,
3780
3916
  transportMode: v ? "query-get" : "http",
3781
- ...v ? { queryString: S } : {}
3917
+ ...v ? { queryString: T } : {}
3782
3918
  };
3783
3919
  return R.fetchStart(
3784
3920
  this.options.targetFragment.getTarget(),
3785
3921
  s,
3786
- h,
3922
+ d,
3787
3923
  a ? i : void 0,
3788
3924
  y
3789
- ), fetch(s, h).then((m) => this.handleFetchResult(
3925
+ ), fetch(s, d).then((m) => this.handleFetchResult(
3790
3926
  m,
3791
3927
  s || void 0,
3792
3928
  b
@@ -3798,13 +3934,13 @@ ${m}
3798
3934
  ), m;
3799
3935
  });
3800
3936
  }
3801
- return fetch(s, h).then((b) => this.handleFetchResult(b, s || void 0));
3937
+ return fetch(s, d).then((b) => this.handleFetchResult(b, s || void 0));
3802
3938
  }
3803
3939
  if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && a) {
3804
- const h = this.options.formFragment, f = h.getTarget(), g = /* @__PURE__ */ new Set();
3805
- e && e.appliedDisabledAttribute && this.options.targetFragment && g.add(this.options.targetFragment), f.setAttribute(`${l.prefix}bind`, JSON.stringify(i));
3806
- const v = h.getBindingData();
3807
- Object.assign(v, i), await P.setBindingData(f, v, g);
3940
+ const d = this.options.formFragment, h = d.getTarget(), g = /* @__PURE__ */ new Set();
3941
+ e && e.appliedDisabledAttribute && this.options.targetFragment && g.add(this.options.targetFragment), h.setAttribute(`${l.prefix}bind`, JSON.stringify(i));
3942
+ const v = d.getBindingData();
3943
+ Object.assign(v, i), await P.setBindingData(h, v, g);
3808
3944
  }
3809
3945
  const o = a ? i : {}, c = new Response(JSON.stringify(o), {
3810
3946
  headers: { "Content-Type": "application/json" }
@@ -3823,12 +3959,12 @@ ${m}
3823
3959
  if (this.eventType !== "click" || !this.options.targetFragment)
3824
3960
  return null;
3825
3961
  const t = this.options.targetFragment.getTarget();
3826
- if (d.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(re))
3962
+ if (f.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(ie))
3827
3963
  return !1;
3828
3964
  const r = t.hasAttribute(
3829
3965
  `${l.prefix}click-no-disabled`
3830
3966
  );
3831
- return d.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(re, ""), r || t.setAttribute("disabled", ""), {
3967
+ return f.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(ie, ""), r || t.setAttribute("disabled", ""), {
3832
3968
  target: t,
3833
3969
  appliedDisabledAttribute: !r
3834
3970
  };
@@ -3840,13 +3976,13 @@ ${m}
3840
3976
  * @returns 戻り値はありません。
3841
3977
  */
3842
3978
  releaseExecutionLock(e) {
3843
- e && (d.RUNNING_CLICK_TARGETS.delete(e.target), e.target.removeAttribute(re), e.appliedDisabledAttribute && e.target.removeAttribute("disabled"));
3979
+ e && (f.RUNNING_CLICK_TARGETS.delete(e.target), e.target.removeAttribute(ie), e.appliedDisabledAttribute && e.target.removeAttribute("disabled"));
3844
3980
  }
3845
3981
  /**
3846
3982
  * フェッチ後の処理を実行します。
3847
3983
  */
3848
3984
  async handleFetchResult(e, t, r) {
3849
- const i = ie();
3985
+ const i = se();
3850
3986
  if (!e.ok)
3851
3987
  return this.options.targetFragment && t && R.fetchError(
3852
3988
  this.options.targetFragment.getTarget(),
@@ -3870,11 +4006,11 @@ ${m}
3870
4006
  }
3871
4007
  const s = [];
3872
4008
  s.push(this.bindResult(e)), s.push(this.adjust()), s.push(this.addRow()), s.push(this.removeRow()), s.push(this.movePrevRow()), s.push(this.moveNextRow()), await Promise.all(s), this.options.resetFragments && this.options.resetFragments.length > 0 && await Promise.all(
3873
- this.options.resetFragments.map((a) => A.reset(a))
4009
+ this.options.resetFragments.map((a) => S.reset(a))
3874
4010
  ), await this.copy();
3875
4011
  const n = [];
3876
4012
  if (this.options.refetchFragments && this.options.refetchFragments.length > 0 && this.options.refetchFragments.forEach((a) => {
3877
- n.push(new d(a, null).run());
4013
+ n.push(new f(a, null).run());
3878
4014
  }), this.options.clickFragments && this.options.clickFragments.length > 0)
3879
4015
  for (const a of this.options.clickFragments) {
3880
4016
  await P.evaluateAll(a);
@@ -3912,11 +4048,11 @@ ${m}
3912
4048
  return;
3913
4049
  }
3914
4050
  const o = (c) => {
3915
- for (const [h, f] of Object.entries(c))
3916
- f != null && (Array.isArray(f) ? f.forEach((g) => a.searchParams.append(h, String(g))) : typeof f == "object" ? a.searchParams.set(h, JSON.stringify(f)) : a.searchParams.set(h, String(f)));
4051
+ for (const [d, h] of Object.entries(c))
4052
+ h != null && (Array.isArray(h) ? h.forEach((g) => a.searchParams.append(d, String(g))) : typeof h == "object" ? a.searchParams.set(d, JSON.stringify(h)) : a.searchParams.set(d, String(h)));
3917
4053
  };
3918
4054
  i && o(t), s && o(r), history.pushState(
3919
- { [ge]: !0 },
4055
+ { [we]: !0 },
3920
4056
  "",
3921
4057
  a.toString()
3922
4058
  );
@@ -3929,10 +4065,10 @@ ${m}
3929
4065
  */
3930
4066
  async handleFetchError(e) {
3931
4067
  let t = null;
3932
- this.options.formFragment ? t = this.options.formFragment : this.options.targetFragment && (t = A.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
4068
+ this.options.formFragment ? t = this.options.formFragment : this.options.targetFragment && (t = S.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
3933
4069
  const r = async (n) => {
3934
4070
  const a = t ? t.getTarget() : document.body;
3935
- await ie().addErrorMessage(a, n);
4071
+ await se().addErrorMessage(a, n);
3936
4072
  }, i = () => {
3937
4073
  if (!this.options.scrollOnError)
3938
4074
  return;
@@ -3958,7 +4094,7 @@ ${m}
3958
4094
  if (a.length === 0)
3959
4095
  return await r(`${e.status} ${e.statusText}`), i(), !1;
3960
4096
  for (const o of a)
3961
- o.key && t ? await A.addErrorMessage(t, o.key, o.message) : await r(o.message);
4097
+ o.key && t ? await S.addErrorMessage(t, o.key, o.message) : await r(o.message);
3962
4098
  return i(), !1;
3963
4099
  } catch {
3964
4100
  }
@@ -4017,7 +4153,7 @@ ${m}
4017
4153
  */
4018
4154
  confirm() {
4019
4155
  const e = this.options.confirmMessage;
4020
- return e == null ? Promise.resolve(!0) : ie().confirm(e);
4156
+ return e == null ? Promise.resolve(!0) : se().confirm(e);
4021
4157
  }
4022
4158
  /**
4023
4159
  * 結果データを対象のフラグメントにバインドします。
@@ -4101,7 +4237,7 @@ ${m}
4101
4237
  * copy のコピー元データを取得します。
4102
4238
  */
4103
4239
  resolveCopySourceData() {
4104
- return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? A.getValues(this.options.copySourceFragment) : { ...this.options.copySourceFragment.getBindingData() } : this.options.formFragment ? A.getValues(this.options.formFragment) : this.options.targetFragment ? { ...this.options.targetFragment.getBindingData() } : {};
4240
+ return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? S.getValues(this.options.copySourceFragment) : { ...this.options.copySourceFragment.getBindingData() } : this.options.formFragment ? S.getValues(this.options.formFragment) : this.options.targetFragment ? { ...this.options.targetFragment.getBindingData() } : {};
4105
4241
  }
4106
4242
  /**
4107
4243
  * data 属性とフォーム値を統合した送信データを作成します。
@@ -4119,8 +4255,8 @@ ${m}
4119
4255
  buildPayloadResolution() {
4120
4256
  const e = {};
4121
4257
  let t = !1;
4122
- if (this.options.formFragment && Object.assign(e, A.getValues(this.options.formFragment)), this.options.data && typeof this.options.data == "object" && Object.assign(e, this.options.data), this.options.targetFragment && this.options.dataAttrName) {
4123
- const r = d.resolveDataAttributeDetailed(
4258
+ if (this.options.formFragment && Object.assign(e, S.getValues(this.options.formFragment)), this.options.data && typeof this.options.data == "object" && Object.assign(e, this.options.data), this.options.targetFragment && this.options.dataAttrName) {
4259
+ const r = f.resolveDataAttributeDetailed(
4124
4260
  this.options.targetFragment,
4125
4261
  this.options.dataAttrName
4126
4262
  );
@@ -4161,47 +4297,47 @@ ${m}
4161
4297
  let i = this.options.fetchUrl;
4162
4298
  const s = { ...this.options.fetchOptions || {} }, n = new Headers(
4163
4299
  s.headers || void 0
4164
- ), a = (s.method || "GET").toUpperCase(), o = l.runtime === "demo" && !be(a), c = o ? "GET" : a;
4300
+ ), a = (s.method || "GET").toUpperCase(), o = l.runtime === "demo" && !Re(a), c = o ? "GET" : a;
4165
4301
  if (s.method = c, c === "GET" || c === "HEAD" || c === "OPTIONS")
4166
- Object.keys(t).length > 0 && (i = ye(i, t));
4302
+ Object.keys(t).length > 0 && (i = Ne(i, t));
4167
4303
  else if (Object.keys(t).length > 0) {
4168
- const f = n.get("Content-Type") || "";
4169
- if (/multipart\/form-data/i.test(f)) {
4304
+ const h = n.get("Content-Type") || "";
4305
+ if (/multipart\/form-data/i.test(h)) {
4170
4306
  n.delete("Content-Type");
4171
4307
  const g = new FormData();
4172
- for (const [v, S] of Object.entries(t))
4173
- S == null ? g.append(v, "") : S instanceof Blob ? g.append(v, S) : Array.isArray(S) ? S.forEach((b) => g.append(v, String(b))) : typeof S == "object" ? g.append(v, JSON.stringify(S)) : g.append(v, String(S));
4308
+ for (const [v, T] of Object.entries(t))
4309
+ T == null ? g.append(v, "") : T instanceof Blob ? g.append(v, T) : Array.isArray(T) ? T.forEach((b) => g.append(v, String(b))) : typeof T == "object" ? g.append(v, JSON.stringify(T)) : g.append(v, String(T));
4174
4310
  s.body = g;
4175
- } else if (/application\/x-www-form-urlencoded/i.test(f)) {
4311
+ } else if (/application\/x-www-form-urlencoded/i.test(h)) {
4176
4312
  const g = new URLSearchParams();
4177
- for (const [v, S] of Object.entries(t))
4178
- S !== void 0 && (S === null ? g.append(v, "") : Array.isArray(S) ? S.forEach((b) => g.append(v, String(b))) : typeof S == "object" ? g.append(v, JSON.stringify(S)) : g.append(v, String(S)));
4313
+ for (const [v, T] of Object.entries(t))
4314
+ T !== void 0 && (T === null ? g.append(v, "") : Array.isArray(T) ? T.forEach((b) => g.append(v, String(b))) : typeof T == "object" ? g.append(v, JSON.stringify(T)) : g.append(v, String(T)));
4179
4315
  s.body = g;
4180
4316
  } else
4181
4317
  n.set("Content-Type", "application/json"), s.body = JSON.stringify(t);
4182
4318
  }
4183
4319
  s.headers = n;
4184
- let h;
4185
- return o && (h = new URL(i, window.location.href).search || void 0, n.delete("Content-Type")), {
4320
+ let d;
4321
+ return o && (d = new URL(i, window.location.href).search || void 0, n.delete("Content-Type")), {
4186
4322
  url: i,
4187
4323
  options: s,
4188
4324
  payload: t,
4189
4325
  hasUnresolvedReference: !1,
4190
4326
  requestedMethod: a,
4191
4327
  effectiveMethod: c,
4192
- queryString: h,
4328
+ queryString: d,
4193
4329
  transportMode: o ? "query-get" : "http",
4194
- signature: Ae(i, s)
4330
+ signature: xe(i, s)
4195
4331
  };
4196
4332
  }
4197
4333
  /**
4198
4334
  * reset-before 後の history 用スナップショットを保存します。
4199
4335
  */
4200
4336
  captureHistorySnapshots() {
4201
- this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot = d.resolveDataAttribute(
4337
+ this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot = f.resolveDataAttribute(
4202
4338
  this.options.targetFragment,
4203
4339
  this.options.historyDataAttrName
4204
- ) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? A.getValues(this.options.historyFormFragment) : void 0;
4340
+ ) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? S.getValues(this.options.historyFormFragment) : void 0;
4205
4341
  }
4206
4342
  /**
4207
4343
  * history-data の評価値を取得します。
@@ -4209,7 +4345,7 @@ ${m}
4209
4345
  * @returns history-data の評価値。
4210
4346
  */
4211
4347
  resolveHistoryDataValues() {
4212
- return this.historyDataSnapshot !== void 0 ? this.historyDataSnapshot : this.options.targetFragment && this.options.historyDataAttrName ? d.resolveDataAttribute(
4348
+ return this.historyDataSnapshot !== void 0 ? this.historyDataSnapshot : this.options.targetFragment && this.options.historyDataAttrName ? f.resolveDataAttribute(
4213
4349
  this.options.targetFragment,
4214
4350
  this.options.historyDataAttrName
4215
4351
  ) : this.options.historyData;
@@ -4223,7 +4359,7 @@ ${m}
4223
4359
  if (this.historyFormSnapshot !== void 0)
4224
4360
  return this.historyFormSnapshot;
4225
4361
  if (this.options.historyFormFragment)
4226
- return A.getValues(this.options.historyFormFragment);
4362
+ return S.getValues(this.options.historyFormFragment);
4227
4363
  }
4228
4364
  /**
4229
4365
  * copy-params が指定されている場合は include / exclude を考慮して抽出します。
@@ -4291,7 +4427,7 @@ ${m}
4291
4427
  const t = [], r = e.clone();
4292
4428
  return t.push(
4293
4429
  e.getParent().insertAfter(r, e)
4294
- ), t.push(P.evaluateAll(r)), t.push(A.reset(r)), Promise.all(t).then(() => {
4430
+ ), t.push(P.evaluateAll(r)), t.push(S.reset(r)), Promise.all(t).then(() => {
4295
4431
  });
4296
4432
  }
4297
4433
  /**
@@ -4343,9 +4479,9 @@ ${m}
4343
4479
  return r ? r.insertAfter(e, t) : Promise.resolve();
4344
4480
  }
4345
4481
  };
4346
- d.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, d.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, d.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet();
4347
- let q = d;
4348
- class Se {
4482
+ f.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, f.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, f.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet();
4483
+ let q = f;
4484
+ class Pe {
4349
4485
  /**
4350
4486
  * URLのクエリパラメータを取得します。
4351
4487
  *
@@ -4358,7 +4494,7 @@ class Se {
4358
4494
  }), e;
4359
4495
  }
4360
4496
  }
4361
- class Te {
4497
+ class Ie {
4362
4498
  /**
4363
4499
  * 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
4364
4500
  *
@@ -4567,16 +4703,16 @@ const u = class u {
4567
4703
  return Promise.resolve();
4568
4704
  r.lastUrl = s, r.running = !0;
4569
4705
  const n = performance.now();
4570
- return t.setAttribute(`${l.prefix}importing`, ""), R.importStart(t, s), Te.load(s).then((a) => {
4706
+ return t.setAttribute(`${l.prefix}importing`, ""), R.importStart(t, s), Ie.load(s).then((a) => {
4571
4707
  const o = new TextEncoder().encode(a).length;
4572
- return M.enqueue(() => {
4708
+ return x.enqueue(() => {
4573
4709
  t.innerHTML = a;
4574
4710
  }).then(() => {
4575
4711
  if (t.removeAttribute(`${l.prefix}importing`), R.importEnd(t, s, o, n), !document.body.hasAttribute("data-haori-ready")) {
4576
4712
  const c = [];
4577
- return t.childNodes.forEach((h) => {
4578
- const f = w.get(h);
4579
- f instanceof C ? c.push(u.scan(f.getTarget())) : f instanceof L && c.push(u.evaluateText(f));
4713
+ return t.childNodes.forEach((d) => {
4714
+ const h = w.get(d);
4715
+ h instanceof C ? c.push(u.scan(h.getTarget())) : h instanceof L && c.push(u.evaluateText(h));
4580
4716
  }), Promise.all(c).then(() => {
4581
4717
  });
4582
4718
  }
@@ -4761,20 +4897,20 @@ const u = class u {
4761
4897
  typeof r == "string" && a.push(u.executeManagedImport(s));
4762
4898
  break;
4763
4899
  case `${l.prefix}url-param`: {
4764
- const h = s.getAttribute(`${l.prefix}url-arg`), f = Se.readParams();
4765
- if (h === null)
4766
- a.push(u.setBindingData(e, f));
4900
+ const d = s.getAttribute(`${l.prefix}url-arg`), h = Pe.readParams();
4901
+ if (d === null)
4902
+ a.push(u.setBindingData(e, h));
4767
4903
  else {
4768
4904
  const g = s.getRawBindingData() || {};
4769
- g[String(h)] = f, a.push(u.setBindingData(e, g));
4905
+ g[String(d)] = h, a.push(u.setBindingData(e, g));
4770
4906
  }
4771
4907
  break;
4772
4908
  }
4773
4909
  }
4774
4910
  return r === null ? a.push(s.removeAttribute(t)) : a.push(s.setAttribute(t, r, i)), Promise.all(a).then(() => {
4775
4911
  if (o !== null)
4776
- return s.setDeriveInputSignature(c), o.then((h) => {
4777
- if (h)
4912
+ return s.setDeriveInputSignature(c), o.then((d) => {
4913
+ if (d)
4778
4914
  return u.reevaluateChildren(s);
4779
4915
  });
4780
4916
  }).then(() => {
@@ -4797,7 +4933,7 @@ const u = class u {
4797
4933
  );
4798
4934
  if (e.tagName === "FORM") {
4799
4935
  const a = i.getAttribute(`${l.prefix}form-arg`), o = a && t[String(a)] && typeof t[String(a)] == "object" && !Array.isArray(t[String(a)]) ? t[String(a)] : a ? {} : t;
4800
- n = n.then(() => A.syncValues(i, o));
4936
+ n = n.then(() => S.syncValues(i, o));
4801
4937
  }
4802
4938
  return n = n.then(() => u.evaluateAll(i, r)), n = n.then(
4803
4939
  () => u.reevaluateReactiveSpecialAttributes(i, r)
@@ -4824,22 +4960,22 @@ const u = class u {
4824
4960
  if (!t)
4825
4961
  return { resolved: {}, sources: {} };
4826
4962
  const r = t.getBindingData(), i = {}, s = (c) => {
4827
- const h = c.getTarget();
4828
- return h.id ? `#${h.id}` : h.tagName.toLowerCase();
4829
- }, n = (c, h, f, g) => {
4963
+ const d = c.getTarget();
4964
+ return d.id ? `#${d.id}` : d.tagName.toLowerCase();
4965
+ }, n = (c, d, h, g) => {
4830
4966
  if (c)
4831
4967
  for (const v of Object.keys(c))
4832
4968
  v in i || (i[v] = {
4833
4969
  value: c[v],
4834
- source: s(h),
4835
- kind: f,
4970
+ source: s(d),
4971
+ kind: h,
4836
4972
  depth: g
4837
4973
  });
4838
4974
  };
4839
4975
  let a = t, o = 0;
4840
4976
  for (; a; )
4841
4977
  a !== t && n(a.getRawDerivedBindingData(), a, "derive", o), n(a.getRawBindingData(), a, "bind", o), a = a.getParent(), o += 1;
4842
- return $.isEnabled() && p.info("[Haori]", "scope dump for", e, { resolved: r, sources: i }), { resolved: r, sources: i };
4978
+ return B.isEnabled() && p.info("[Haori]", "scope dump for", e, { resolved: r, sources: i }), { resolved: r, sources: i };
4843
4979
  }
4844
4980
  /**
4845
4981
  * data-bind 属性の値をパースします。
@@ -4914,7 +5050,7 @@ const u = class u {
4914
5050
  i.push(r.setValue(t));
4915
5051
  const s = u.getFormFragment(r);
4916
5052
  if (s) {
4917
- const n = A.getValues(s), a = s.getAttribute(`${l.prefix}form-arg`);
5053
+ const n = S.getValues(s), a = s.getAttribute(`${l.prefix}form-arg`);
4918
5054
  let o;
4919
5055
  a ? (o = s.getRawBindingData(), o || (o = {}), o[String(a)] = n) : o = n, i.push(u.setBindingData(s.getTarget(), o));
4920
5056
  }
@@ -4944,7 +5080,7 @@ const u = class u {
4944
5080
  return Promise.resolve();
4945
5081
  let r = u.reevaluateInterpolatedAttributes(e);
4946
5082
  const i = e.hasAttribute(`${l.prefix}derive`), s = e.hasAttribute(`${l.prefix}if`), n = e.hasAttribute(`${l.prefix}each`), a = e.getRawAttribute(`${l.prefix}derive`), o = e.getRawAttribute(`${l.prefix}derive-name`);
4947
- let c = !1, h = !1, f = null;
5083
+ let c = !1, d = !1, h = null;
4948
5084
  if (!i && e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), !i && e.getDeriveInputSignature() !== null && e.setDeriveInputSignature(null), i) {
4949
5085
  const g = u.createDeriveInputSignature(
4950
5086
  e,
@@ -4970,10 +5106,10 @@ const u = class u {
4970
5106
  e.setDeriveSubtreeSignature(null), u.logDerivedSubtreeProfileSnapshot(e, "skip-ineligible");
4971
5107
  return;
4972
5108
  }
4973
- f = u.createDescendantBindingSignature(
5109
+ h = u.createDescendantBindingSignature(
4974
5110
  e,
4975
5111
  "evaluateAll"
4976
- ), h = !0, c = e.getDeriveSubtreeSignature() !== null && e.getDeriveSubtreeSignature() === f, u.logDerivedSubtreeProfileSnapshot(
5112
+ ), d = !0, c = e.getDeriveSubtreeSignature() !== null && e.getDeriveSubtreeSignature() === h, u.logDerivedSubtreeProfileSnapshot(
4977
5113
  e,
4978
5114
  c ? "skip-hit" : "skip-miss"
4979
5115
  );
@@ -4990,7 +5126,7 @@ const u = class u {
4990
5126
  }), Promise.all(g).then(() => {
4991
5127
  });
4992
5128
  }).then(() => {
4993
- h && f !== null && e.setDeriveSubtreeSignature(f);
5129
+ d && h !== null && e.setDeriveSubtreeSignature(h);
4994
5130
  }));
4995
5131
  }
4996
5132
  /**
@@ -5009,7 +5145,7 @@ const u = class u {
5009
5145
  const i = e.getRawDerivedBindingData(), s = typeof r == "string" ? r.trim() : "";
5010
5146
  if (!t || s === "")
5011
5147
  return i === null ? Promise.resolve(!1) : (e.setDerivedBindingData(null), Promise.resolve(!0));
5012
- const n = Y.evaluateDetailed(
5148
+ const n = J.evaluateDetailed(
5013
5149
  t,
5014
5150
  e.getBindingData()
5015
5151
  );
@@ -5084,7 +5220,7 @@ const u = class u {
5084
5220
  static evaluateIf(e) {
5085
5221
  const t = [], r = e.getAttribute(`${l.prefix}if`);
5086
5222
  if (u.isHiddenIfCondition(r))
5087
- $.isEnabled() && u.logFalsyIfDiagnostics(e), t.push(
5223
+ B.isEnabled() && u.logFalsyIfDiagnostics(e), t.push(
5088
5224
  e.hide().then(() => {
5089
5225
  R.hide(e.getTarget());
5090
5226
  })
@@ -5203,11 +5339,11 @@ const u = class u {
5203
5339
  (c) => !c.hasAttribute(`${l.prefix}each-before`) && !c.hasAttribute(`${l.prefix}each-after`)
5204
5340
  ).forEach((c) => {
5205
5341
  if (!n) {
5206
- const f = w.get(c);
5207
- f instanceof C && (r = f.clone(), u.markFreshInitializationSkippable(r), e.setTemplate(r), n = !0);
5342
+ const h = w.get(c);
5343
+ h instanceof C && (r = h.clone(), u.markFreshInitializationSkippable(r), e.setTemplate(r), n = !0);
5208
5344
  }
5209
- const h = w.get(c);
5210
- h instanceof C && e.getChildren().includes(h) && (e.removeChild(h), h.setMounted(!1)), c.parentNode && c.parentNode.removeChild(c);
5345
+ const d = w.get(c);
5346
+ d instanceof C && e.getChildren().includes(d) && (e.removeChild(d), d.setMounted(!1)), c.parentNode && c.parentNode.removeChild(c);
5211
5347
  });
5212
5348
  }
5213
5349
  return this.updateDiff(e, t).then(() => {
@@ -5315,7 +5451,7 @@ const u = class u {
5315
5451
  * @returns プロファイル
5316
5452
  */
5317
5453
  static getOrCreateDerivedSubtreeProfile(e) {
5318
- if (!$.isEnabled() || !e.hasAttribute(`${l.prefix}derive`))
5454
+ if (!B.isEnabled() || !e.hasAttribute(`${l.prefix}derive`))
5319
5455
  return null;
5320
5456
  const t = u.DERIVE_SUBTREE_PROFILES.get(e);
5321
5457
  if (t)
@@ -5455,72 +5591,72 @@ const u = class u {
5455
5591
  let i = e.getAttribute(`${l.prefix}each-index`);
5456
5592
  i && (i = String(i));
5457
5593
  const s = e.getAttribute(`${l.prefix}each-key`), n = e.getAttribute(`${l.prefix}each-arg`), a = /* @__PURE__ */ new Map(), o = [];
5458
- t.forEach((E, F) => {
5459
- const N = u.createListKey(
5460
- E,
5594
+ t.forEach((A, F) => {
5595
+ const M = u.createListKey(
5596
+ A,
5461
5597
  s ? String(s) : null,
5462
5598
  F
5463
5599
  );
5464
- o.push(N), a.set(N, { item: E, itemIndex: F });
5600
+ o.push(M), a.set(M, { item: A, itemIndex: F });
5465
5601
  });
5466
- const c = new Set(o), h = [];
5467
- let f = e.getChildren().filter((E) => E instanceof C).filter(
5468
- (E) => !E.hasAttribute(`${l.prefix}each-before`) && !E.hasAttribute(`${l.prefix}each-after`)
5602
+ const c = new Set(o), d = [];
5603
+ let h = e.getChildren().filter((A) => A instanceof C).filter(
5604
+ (A) => !A.hasAttribute(`${l.prefix}each-before`) && !A.hasAttribute(`${l.prefix}each-after`)
5469
5605
  );
5470
- const g = f.map((E) => E.getListKey());
5471
- f = f.filter((E) => c.has(String(E.getListKey())) ? !0 : (h.push(E.remove()), !1));
5472
- const v = f.map((E) => E.getListKey()), S = /* @__PURE__ */ new Map();
5473
- f.forEach((E) => {
5474
- const F = E.getListKey();
5475
- F !== null && !S.has(F) && S.set(F, E);
5606
+ const g = h.map((A) => A.getListKey());
5607
+ h = h.filter((A) => c.has(String(A.getListKey())) ? !0 : (d.push(A.remove()), !1));
5608
+ const v = h.map((A) => A.getListKey()), T = /* @__PURE__ */ new Map();
5609
+ h.forEach((A) => {
5610
+ const F = A.getListKey();
5611
+ F !== null && !T.has(F) && T.set(F, A);
5476
5612
  });
5477
5613
  const b = e.getChildElementFragments().slice(), y = b.filter(
5478
- (E) => E.hasAttribute(`${l.prefix}each-before`)
5614
+ (A) => A.hasAttribute(`${l.prefix}each-before`)
5479
5615
  ).length;
5480
5616
  let m = Promise.resolve();
5481
- return o.forEach((E, F) => {
5482
- const { item: N, itemIndex: U } = a.get(E);
5483
- let B;
5484
- const K = S.get(E);
5617
+ return o.forEach((A, F) => {
5618
+ const { item: M, itemIndex: U } = a.get(A);
5619
+ let $;
5620
+ const K = T.get(A);
5485
5621
  if (K)
5486
- B = K, m = m.then(
5622
+ $ = K, m = m.then(
5487
5623
  () => u.updateRowFragment(
5488
- B,
5489
- N,
5624
+ $,
5625
+ M,
5490
5626
  i,
5491
5627
  U,
5492
5628
  n ? String(n) : null,
5493
- E
5629
+ A
5494
5630
  ).then((k) => {
5495
5631
  if (k)
5496
- return u.evaluateAll(B);
5632
+ return u.evaluateAll($);
5497
5633
  })
5498
5634
  );
5499
5635
  else {
5500
- B = r.clone();
5636
+ $ = r.clone();
5501
5637
  const k = y + F;
5502
5638
  m = m.then(
5503
5639
  () => u.updateRowFragment(
5504
- B,
5505
- N,
5640
+ $,
5641
+ M,
5506
5642
  i,
5507
5643
  U,
5508
5644
  n ? String(n) : null,
5509
- E
5645
+ A
5510
5646
  ).then(() => {
5511
- const he = b[k] ?? null;
5512
- return e.insertBefore(B, he).then(() => {
5513
- b.splice(k, 0, B);
5514
- }).then(() => u.initializeFreshEachRow(B));
5647
+ const be = b[k] ?? null;
5648
+ return e.insertBefore($, be).then(() => {
5649
+ b.splice(k, 0, $);
5650
+ }).then(() => u.initializeFreshEachRow($));
5515
5651
  })
5516
5652
  );
5517
5653
  }
5518
- }), Promise.all(h).then(() => m).then(() => {
5519
- const E = o.filter(
5654
+ }), Promise.all(d).then(() => m).then(() => {
5655
+ const A = o.filter(
5520
5656
  (k) => k !== null
5521
5657
  ), F = v.filter(
5522
5658
  (k) => k !== null
5523
- ), N = new Set(F), U = E.filter((k) => !N.has(k)), K = g.filter(
5659
+ ), M = new Set(F), U = A.filter((k) => !M.has(k)), K = g.filter(
5524
5660
  (k) => k !== null
5525
5661
  ).filter(
5526
5662
  (k) => !c.has(k)
@@ -5529,7 +5665,7 @@ const u = class u {
5529
5665
  e.getTarget(),
5530
5666
  U,
5531
5667
  K,
5532
- E
5668
+ A
5533
5669
  );
5534
5670
  });
5535
5671
  }
@@ -5687,7 +5823,7 @@ u.ATTRIBUTE_ALIAS_SUFFIX = "attr-", u.PRIORITY_ATTRIBUTE_SUFFIXES = [
5687
5823
  "url-param"
5688
5824
  ], u.ATTRIBUTE_PLACEHOLDER_REGEX = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/, u.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), u.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), u.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), u.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap();
5689
5825
  let P = u;
5690
- const te = class te {
5826
+ const re = class re {
5691
5827
  /**
5692
5828
  * コンストラクタ。
5693
5829
  *
@@ -5699,7 +5835,7 @@ const te = class te {
5699
5835
  r && new q(r, "load").run();
5700
5836
  }, this.onPopstate = (t) => {
5701
5837
  const r = t.state;
5702
- !r || r[te.HISTORY_STATE_KEY] !== !0 || location.reload();
5838
+ !r || r[re.HISTORY_STATE_KEY] !== !0 || location.reload();
5703
5839
  }, this.root = e;
5704
5840
  }
5705
5841
  /**
@@ -5725,6 +5861,7 @@ const te = class te {
5725
5861
  const r = this.getElementFromTarget(e.target, t);
5726
5862
  if (!r)
5727
5863
  return;
5864
+ r.hasAttribute(`data-${t}-prevent`) && e.preventDefault();
5728
5865
  const i = w.get(r);
5729
5866
  if (!i)
5730
5867
  return;
@@ -5774,8 +5911,8 @@ const te = class te {
5774
5911
  return null;
5775
5912
  }
5776
5913
  };
5777
- te.HISTORY_STATE_KEY = "__haoriHistoryState__";
5778
- let ne = te;
5914
+ re.HISTORY_STATE_KEY = "__haoriHistoryState__";
5915
+ let ae = re;
5779
5916
  const D = class D {
5780
5917
  /**
5781
5918
  * ノードが現在の Window に属する HTMLElement かどうかを判定します。
@@ -5813,10 +5950,10 @@ const D = class D {
5813
5950
  t && (t.observer.disconnect(), D.registrations.delete(e));
5814
5951
  const o = new IntersectionObserver(
5815
5952
  (c) => {
5816
- const h = D.registrations.get(e);
5817
- h && c.forEach((f) => {
5818
- !f.isIntersecting || h.running || D.isDisabled(h.fragment) || (h.running = !0, new q(h.fragment, "intersect").runWithResult().then((g) => {
5819
- g && h.once && (h.observer.disconnect(), D.registrations.delete(e));
5953
+ const d = D.registrations.get(e);
5954
+ d && c.forEach((h) => {
5955
+ !h.isIntersecting || d.running || D.isDisabled(d.fragment) || (d.running = !0, new q(d.fragment, "intersect").runWithResult().then((g) => {
5956
+ g && d.once && (d.observer.disconnect(), D.registrations.delete(e));
5820
5957
  }).catch((g) => {
5821
5958
  p.error(
5822
5959
  "[Haori]",
@@ -5903,7 +6040,7 @@ D.CONFIG_KEYS = /* @__PURE__ */ new Set([
5903
6040
  "disabled",
5904
6041
  "once"
5905
6042
  ]), D.registrations = /* @__PURE__ */ new Map();
5906
- let W = D;
6043
+ let Y = D;
5907
6044
  const O = class O {
5908
6045
  /**
5909
6046
  * 既存の MutationObserver をすべて停止します。
@@ -5925,7 +6062,7 @@ const O = class O {
5925
6062
  P.scan(document.head),
5926
6063
  P.scan(document.body)
5927
6064
  ]), [t, r] = e;
5928
- t.status !== "fulfilled" && p.error("[Haori]", "Failed to build head fragment:", t.reason), r.status !== "fulfilled" && p.error("[Haori]", "Failed to build body fragment:", r.reason), await M.wait(), document.body.setAttribute("data-haori-ready", ""), O.observe(document.head), O.observe(document.body), new ne().start(), W.syncTree(document.body);
6065
+ t.status !== "fulfilled" && p.error("[Haori]", "Failed to build head fragment:", t.reason), r.status !== "fulfilled" && p.error("[Haori]", "Failed to build body fragment:", r.reason), await x.wait(), document.body.setAttribute("data-haori-ready", ""), O.observe(document.head), O.observe(document.body), new ae().start(), Y.syncTree(document.body);
5929
6066
  }
5930
6067
  /**
5931
6068
  * 指定された要素を監視します。
@@ -5949,14 +6086,14 @@ const O = class O {
5949
6086
  i.attributeName,
5950
6087
  s.getAttribute(i.attributeName),
5951
6088
  !0
5952
- ), W.syncElement(s);
6089
+ ), Y.syncElement(s);
5953
6090
  break;
5954
6091
  }
5955
6092
  case "childList": {
5956
6093
  Array.from(i.removedNodes).forEach((s) => {
5957
- W.cleanupTree(s), P.removeNode(s);
6094
+ Y.cleanupTree(s), P.removeNode(s);
5958
6095
  }), Array.from(i.addedNodes).forEach((s) => {
5959
- s.parentElement instanceof Element && (P.addNode(s.parentElement, s), W.syncTree(s));
6096
+ s.parentElement instanceof Element && (P.addNode(s.parentElement, s), Y.syncTree(s));
5960
6097
  });
5961
6098
  break;
5962
6099
  }
@@ -5985,19 +6122,19 @@ const O = class O {
5985
6122
  }
5986
6123
  };
5987
6124
  O._initialized = !1, O._mutationObservers = [];
5988
- let Z = O;
5989
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", Z.init) : Z.init();
5990
- const we = () => J.waitForRenders(), De = "0.11.0";
6125
+ let _ = O;
6126
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", _.init) : _.init();
6127
+ const Ce = () => X.waitForRenders(), ke = "0.12.0";
5991
6128
  export {
5992
6129
  P as Core,
5993
6130
  l as Env,
5994
- A as Form,
6131
+ S as Form,
5995
6132
  w as Fragment,
5996
- J as Haori,
6133
+ X as Haori,
5997
6134
  p as Log,
5998
- M as Queue,
5999
- J as default,
6000
- De as version,
6001
- we as waitForRenders
6135
+ x as Queue,
6136
+ X as default,
6137
+ ke as version,
6138
+ Ce as waitForRenders
6002
6139
  };
6003
6140
  //# sourceMappingURL=haori.es.js.map