haori 0.22.1 → 0.22.3

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
@@ -1679,8 +1679,8 @@ const X = class X {
1679
1679
  }
1680
1680
  };
1681
1681
  X.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
1682
- let R = X;
1683
- const K = class K extends R {
1682
+ let T = X;
1683
+ const K = class K extends T {
1684
1684
  /**
1685
1685
  * エレメントフラグメントのコンストラクタ。
1686
1686
  * アトリビュートや子フラグメントの作成も行います。
@@ -1710,7 +1710,7 @@ const K = class K extends R {
1710
1710
  this.attributeMap.set(t, i);
1711
1711
  }
1712
1712
  }), e.childNodes.forEach((t) => {
1713
- const r = R.get(t);
1713
+ const r = T.get(t);
1714
1714
  r.setParent(this), this.children.push(r);
1715
1715
  });
1716
1716
  }
@@ -2242,7 +2242,7 @@ const K = class K extends R {
2242
2242
  element: a,
2243
2243
  rawName: e,
2244
2244
  template: r
2245
- }), l = s.isEvaluate || s.isRawEvaluate, h = e === t && K.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), u = s.isSingleExpression(), p = G.joinEvaluateResults(o.results), v = o.results.length === 1 ? o.results[0] : p, T = !s.isForceEvaluation() && (t !== e || h || u ? o.hasUnresolvedReference || v === null || v === void 0 || v === !1 : l && p === ""), I = s.isForceEvaluation() ? r : u ? v : p, A = i && s.isEvaluate && t === "value" && (a instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(a.type) || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement), y = a.getRootNode(), b = A && a === y.activeElement, S = T || I === null || I === !1 ? null : String(I), k = e !== t && a.getAttribute(e) !== r, C = S === null ? a.hasAttribute(t) : a.getAttribute(t) !== S, O = A && !b && S !== null && a.value !== S, j = t === "checked" && a instanceof HTMLInputElement && (a.type === "checkbox" || a.type === "radio"), $ = t === "selected" && a instanceof HTMLOptionElement, _ = y.activeElement, be = _ !== null && (j && a === _ || $ && a.closest("select") === _), te = S !== null, ve = j && !be && a.checked !== te, ye = $ && !be && a.selected !== te;
2245
+ }), l = s.isEvaluate || s.isRawEvaluate, h = e === t && K.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), u = s.isSingleExpression(), p = G.joinEvaluateResults(o.results), v = o.results.length === 1 ? o.results[0] : p, R = !s.isForceEvaluation() && (t !== e || h || u ? o.hasUnresolvedReference || v === null || v === void 0 || v === !1 : l && p === ""), I = s.isForceEvaluation() ? r : u ? v : p, A = i && s.isEvaluate && t === "value" && (a instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(a.type) || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement), y = a.getRootNode(), b = A && a === y.activeElement, S = R || I === null || I === !1 ? null : String(I), k = e !== t && a.getAttribute(e) !== r, C = S === null ? a.hasAttribute(t) : a.getAttribute(t) !== S, O = A && !b && S !== null && a.value !== S, j = t === "checked" && a instanceof HTMLInputElement && (a.type === "checkbox" || a.type === "radio"), $ = t === "selected" && a instanceof HTMLOptionElement, ee = y.activeElement, be = ee !== null && (j && a === ee || $ && a.closest("select") === ee), te = S !== null, ve = j && !be && a.checked !== te, ye = $ && !be && a.selected !== te;
2246
2246
  return !k && !C && !O && !ve && !ye ? (A && !b && S !== null && (this.value = this.normalizeValueForElement(a, S)), Promise.resolve()) : (this.skipMutationAttributes = !0, P.enqueue(() => {
2247
2247
  k && a.setAttribute(e, r), S === null ? a.removeAttribute(t) : (C && (a.setAttribute(t, S), t === `${c.prefix}bind` && this.recordSelfWrittenBind(S)), A && !b && (this.value = this.normalizeValueForElement(a, S), O && (a.value = S))), ve && (a.checked = te), ye && (a.selected = te);
2248
2248
  }).finally(() => {
@@ -2341,7 +2341,7 @@ const K = class K extends R {
2341
2341
  const i = t ? r.nextSibling : r;
2342
2342
  let n = t ? r.nextSibling : r;
2343
2343
  for (; n !== null; ) {
2344
- const s = R.get(n);
2344
+ const s = T.get(n);
2345
2345
  if (s !== null) {
2346
2346
  const a = this.children.indexOf(s);
2347
2347
  if (a !== -1)
@@ -2530,7 +2530,7 @@ K.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
2530
2530
  "selected"
2531
2531
  ]);
2532
2532
  let M = K;
2533
- class V extends R {
2533
+ class V extends T {
2534
2534
  /**
2535
2535
  * テキストフラグメントのコンストラクタ。
2536
2536
  * 対象テキストノードの内容を初期化します。
@@ -2608,7 +2608,7 @@ class V extends R {
2608
2608
  });
2609
2609
  }
2610
2610
  }
2611
- class pe extends R {
2611
+ class pe extends T {
2612
2612
  /**
2613
2613
  * コメントフラグメントのコンストラクタ。
2614
2614
  * 対象コメントノードの内容を初期化します。
@@ -2846,7 +2846,7 @@ le.FORCE_EVALUATION_ATTRIBUTES = [
2846
2846
  "hor-derive"
2847
2847
  ];
2848
2848
  let se = le;
2849
- class ee {
2849
+ class Q {
2850
2850
  /**
2851
2851
  * 実行モードを取得します。
2852
2852
  *
@@ -2922,7 +2922,7 @@ class ee {
2922
2922
  */
2923
2923
  static openDialog(e) {
2924
2924
  return P.enqueue(() => {
2925
- e instanceof HTMLDialogElement ? e.showModal() : m.error("[Haori]", "Element is not a dialog: ", e);
2925
+ e instanceof HTMLDialogElement ? (Q.clearMessagesSync(e), e.showModal()) : m.error("[Haori]", "Element is not a dialog: ", e);
2926
2926
  }, !0);
2927
2927
  }
2928
2928
  /**
@@ -2942,7 +2942,7 @@ class ee {
2942
2942
  * @param message エラーメッセージ
2943
2943
  */
2944
2944
  static addErrorMessage(e, t) {
2945
- return ee.addMessage(e, t, "error");
2945
+ return Q.addMessage(e, t, "error");
2946
2946
  }
2947
2947
  /**
2948
2948
  * メッセージをレベル付きで追加します。
@@ -2964,11 +2964,22 @@ class ee {
2964
2964
  */
2965
2965
  static clearMessages(e) {
2966
2966
  return P.enqueue(() => {
2967
- e.removeAttribute("data-message"), e.removeAttribute("data-message-level"), e.querySelectorAll("[data-message]").forEach((t) => {
2968
- t.removeAttribute("data-message"), t.removeAttribute("data-message-level");
2969
- });
2967
+ Q.clearMessagesSync(e);
2970
2968
  }, !0);
2971
2969
  }
2970
+ /**
2971
+ * 対象のエレメントおよびその子要素のメッセージ属性を同期的に除去します。
2972
+ *
2973
+ * Queue を介さないため、別の enqueue ブロック内から実行順を保ったまま
2974
+ * 呼び出せます。{@link clearMessages} および {@link openDialog} の共通処理です。
2975
+ *
2976
+ * @param parent メッセージをクリアする親要素
2977
+ */
2978
+ static clearMessagesSync(e) {
2979
+ e.removeAttribute("data-message"), e.removeAttribute("data-message-level"), e.querySelectorAll("[data-message]").forEach((t) => {
2980
+ t.removeAttribute("data-message"), t.removeAttribute("data-message-level");
2981
+ });
2982
+ }
2972
2983
  /**
2973
2984
  * 日時を指定フォーマットの文字列へ整形します。
2974
2985
  *
@@ -3115,7 +3126,7 @@ function Ae() {
3115
3126
  const e = globalThis.window?.Haori;
3116
3127
  return Ke.every(
3117
3128
  (r) => typeof e?.[r] == "function"
3118
- ) ? e : ee;
3129
+ ) ? e : Q;
3119
3130
  }
3120
3131
  class E {
3121
3132
  /**
@@ -3264,16 +3275,16 @@ class E {
3264
3275
  if (Array.isArray(u)) {
3265
3276
  const p = e.getChildElementFragments();
3266
3277
  for (let v = 0; v < p.length; v++) {
3267
- const T = p[v];
3278
+ const R = p[v];
3268
3279
  u.length > v ? s.push(
3269
3280
  E.setPartValues(
3270
- T,
3281
+ R,
3271
3282
  u[v],
3272
3283
  v,
3273
3284
  i,
3274
3285
  n
3275
3286
  )
3276
- ) : s.push(E.setPartValues(T, {}, v, i, n));
3287
+ ) : s.push(E.setPartValues(R, {}, v, i, n));
3277
3288
  }
3278
3289
  }
3279
3290
  } else
@@ -3358,7 +3369,7 @@ class E {
3358
3369
  t instanceof HTMLFormElement ? r.push(t) : r.push(...Array.from(t.querySelectorAll("form")));
3359
3370
  const i = [];
3360
3371
  for (const n of r) {
3361
- const s = R.get(n);
3372
+ const s = T.get(n);
3362
3373
  s instanceof M && i.push(s);
3363
3374
  }
3364
3375
  return i;
@@ -3746,7 +3757,7 @@ function Ye(f, e) {
3746
3757
  return null;
3747
3758
  if (!t.includes("{{"))
3748
3759
  return t;
3749
- const r = R.get(f), i = r instanceof M ? r.getBindingData() : {}, n = Ge(t, i);
3760
+ const r = T.get(f), i = r instanceof M ? r.getBindingData() : {}, n = Ge(t, i);
3750
3761
  return n === "" ? null : n;
3751
3762
  }
3752
3763
  function Je(f, e, t) {
@@ -3833,7 +3844,7 @@ function ie() {
3833
3844
  const e = globalThis.window?.Haori;
3834
3845
  return Xe.every(
3835
3846
  (r) => typeof e?.[r] == "function"
3836
- ) ? e : ee;
3847
+ ) ? e : Q;
3837
3848
  }
3838
3849
  const Ze = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
3839
3850
  function _e(f) {
@@ -4075,7 +4086,7 @@ const g = class g {
4075
4086
  if (y) {
4076
4087
  const b = document.body.querySelector(y);
4077
4088
  b !== null ? r.formFragment = E.getFormFragment(
4078
- R.get(b)
4089
+ T.get(b)
4079
4090
  ) : m.error(
4080
4091
  "Haori",
4081
4092
  `Form element not found: ${y} (${g.attrName(t, "form")})`
@@ -4224,7 +4235,7 @@ ${y}
4224
4235
  if (A) {
4225
4236
  const y = document.body.querySelectorAll(A);
4226
4237
  y.length > 0 ? (r.bindFragments = [], y.forEach((b) => {
4227
- const S = R.get(b);
4238
+ const S = T.get(b);
4228
4239
  S && r.bindFragments.push(S);
4229
4240
  })) : m.error(
4230
4241
  "Haori",
@@ -4256,8 +4267,8 @@ ${y}
4256
4267
  }
4257
4268
  const v = t ? g.attrName(t, "bind-merge") : g.attrName(null, "bind-merge", !0);
4258
4269
  e.hasAttribute(v) && (r.bindMerge = !0);
4259
- const T = t ? g.attrName(t, "bind-transform") : g.attrName(null, "bind-transform", !0);
4260
- e.hasAttribute(T) && (r.bindTransform = e.getRawAttribute(T));
4270
+ const R = t ? g.attrName(t, "bind-transform") : g.attrName(null, "bind-transform", !0);
4271
+ e.hasAttribute(R) && (r.bindTransform = e.getRawAttribute(R));
4261
4272
  const I = t ? g.attrName(t, "copy-params") : null;
4262
4273
  if (I && e.hasAttribute(I)) {
4263
4274
  const A = e.getRawAttribute(I);
@@ -4271,7 +4282,7 @@ ${y}
4271
4282
  if (b) {
4272
4283
  const S = document.body.querySelectorAll(b);
4273
4284
  S.length > 0 ? (r.adjustFragments = [], S.forEach((k) => {
4274
- const C = R.get(k);
4285
+ const C = T.get(k);
4275
4286
  C && r.adjustFragments.push(C);
4276
4287
  })) : m.error(
4277
4288
  "Haori",
@@ -4334,7 +4345,7 @@ ${b}
4334
4345
  if (b) {
4335
4346
  const S = document.body.querySelector(b);
4336
4347
  S !== null ? r.historyFormFragment = E.getFormFragment(
4337
- R.get(S)
4348
+ T.get(S)
4338
4349
  ) : m.error(
4339
4350
  "Haori",
4340
4351
  `Form element not found: ${b} (${g.attrName(t, "history-form")})`
@@ -4355,10 +4366,17 @@ ${b}
4355
4366
  if (!e.hasAttribute(S))
4356
4367
  return;
4357
4368
  const k = e.getRawAttribute(S), C = [];
4358
- if (k ? (document.body.querySelectorAll(k).forEach((j) => {
4359
- const $ = R.get(j);
4360
- $ && C.push($);
4361
- }), C.length === 0 && m.error("Haori", `Element not found: ${k} (${S})`)) : C.push(e), C.length > 0)
4369
+ if (k)
4370
+ document.body.querySelectorAll(k).forEach((j) => {
4371
+ const $ = T.get(j);
4372
+ $ && C.push($);
4373
+ }), C.length === 0 && m.error("Haori", `Element not found: ${k} (${S})`);
4374
+ else if (b === "open" || b === "close") {
4375
+ const O = e.getTarget().closest("dialog");
4376
+ O ? C.push(T.get(O)) : m.error("Haori", `Ancestor <dialog> not found (${S})`);
4377
+ } else
4378
+ C.push(e);
4379
+ if (C.length > 0)
4362
4380
  switch (b) {
4363
4381
  case "reset-before":
4364
4382
  r.resetBeforeFragments = C;
@@ -4391,7 +4409,7 @@ ${b}
4391
4409
  if (b) {
4392
4410
  const S = document.body.querySelector(b);
4393
4411
  if (S !== null) {
4394
- const k = R.get(S);
4412
+ const k = T.get(S);
4395
4413
  k ? r.copySourceFragment = k : m.error(
4396
4414
  "Haori",
4397
4415
  `Element is not managed by Haori: ${b} (${y})`
@@ -4412,7 +4430,7 @@ ${b}
4412
4430
  if (A) {
4413
4431
  const y = document.body.querySelector(A);
4414
4432
  y !== null ? r.formFragment = E.getFormFragment(
4415
- R.get(y)
4433
+ T.get(y)
4416
4434
  ) : m.error(
4417
4435
  "Haori",
4418
4436
  `Form element not found: ${A} (${g.attrName(null, "fetch-form", !0)})`
@@ -4513,7 +4531,7 @@ ${b}
4513
4531
  }
4514
4532
  const a = Object.keys(i).length > 0;
4515
4533
  if (n) {
4516
- const h = { ...s || {} }, u = r.requestedMethod, p = r.effectiveMethod, v = r.transportMode === "query-get", T = r.queryString;
4534
+ const h = { ...s || {} }, u = r.requestedMethod, p = r.effectiveMethod, v = r.transportMode === "query-get", R = r.queryString;
4517
4535
  if (v && m.info("Haori demo fetch normalization", {
4518
4536
  runtime: c.runtime,
4519
4537
  requestedMethod: u,
@@ -4521,14 +4539,14 @@ ${b}
4521
4539
  transportMode: "query-get",
4522
4540
  url: n,
4523
4541
  payload: a ? i : void 0,
4524
- queryString: T
4542
+ queryString: R
4525
4543
  }), this.options.targetFragment && n) {
4526
4544
  const I = performance.now(), A = {
4527
4545
  runtime: c.runtime,
4528
4546
  requestedMethod: u,
4529
4547
  effectiveMethod: p,
4530
4548
  transportMode: v ? "query-get" : "http",
4531
- ...v ? { queryString: T } : {}
4549
+ ...v ? { queryString: R } : {}
4532
4550
  };
4533
4551
  return N.fetchStart(
4534
4552
  this.options.targetFragment.getTarget(),
@@ -4713,12 +4731,12 @@ ${b}
4713
4731
  const l = /* @__PURE__ */ new Map(), h = [];
4714
4732
  for (const u of a)
4715
4733
  if (u && typeof u == "object" && !Array.isArray(u)) {
4716
- const p = u.key, v = u.message, T = typeof p == "string" && p.length > 0 ? p : null, I = typeof v == "string" ? v : v != null ? String(v) : "";
4734
+ const p = u.key, v = u.message, R = typeof p == "string" && p.length > 0 ? p : null, I = typeof v == "string" ? v : v != null ? String(v) : "";
4717
4735
  if (I.length === 0)
4718
4736
  continue;
4719
- if (T !== null) {
4720
- const A = l.get(T) ?? [];
4721
- A.push(I), l.set(T, A);
4737
+ if (R !== null) {
4738
+ const A = l.get(R) ?? [];
4739
+ A.push(I), l.set(R, A);
4722
4740
  } else
4723
4741
  h.push(I);
4724
4742
  } else typeof u == "string" && u.length > 0 && h.push(u);
@@ -4993,13 +5011,13 @@ ${b}
4993
5011
  if (/multipart\/form-data/i.test(u)) {
4994
5012
  s.delete("Content-Type");
4995
5013
  const p = new FormData();
4996
- for (const [v, T] of Object.entries(t))
4997
- T == null ? p.append(v, "") : T instanceof Blob ? p.append(v, T) : Array.isArray(T) ? T.forEach((I) => p.append(v, String(I))) : typeof T == "object" ? p.append(v, JSON.stringify(T)) : p.append(v, String(T));
5014
+ for (const [v, R] of Object.entries(t))
5015
+ R == null ? p.append(v, "") : R instanceof Blob ? p.append(v, R) : Array.isArray(R) ? R.forEach((I) => p.append(v, String(I))) : typeof R == "object" ? p.append(v, JSON.stringify(R)) : p.append(v, String(R));
4998
5016
  n.body = p;
4999
5017
  } else if (/application\/x-www-form-urlencoded/i.test(u)) {
5000
5018
  const p = new URLSearchParams();
5001
- for (const [v, T] of Object.entries(t))
5002
- T !== void 0 && (T === null ? p.append(v, "") : Array.isArray(T) ? T.forEach((I) => p.append(v, String(I))) : typeof T == "object" ? p.append(v, JSON.stringify(T)) : p.append(v, String(T)));
5019
+ for (const [v, R] of Object.entries(t))
5020
+ R !== void 0 && (R === null ? p.append(v, "") : Array.isArray(R) ? R.forEach((I) => p.append(v, String(I))) : typeof R == "object" ? p.append(v, JSON.stringify(R)) : p.append(v, String(R)));
5003
5021
  n.body = p;
5004
5022
  } else
5005
5023
  s.set("Content-Type", "application/json"), n.body = JSON.stringify(t);
@@ -5259,7 +5277,7 @@ const d = class d {
5259
5277
  * @returns data-attr-* の内部反映なら true
5260
5278
  */
5261
5279
  static isAliasedAttributeReflection(e, t) {
5262
- const r = R.get(e);
5280
+ const r = T.get(e);
5263
5281
  return r instanceof M ? r.hasAttribute(
5264
5282
  `${c.prefix}${d.ATTRIBUTE_ALIAS_SUFFIX}${t}`
5265
5283
  ) : !1;
@@ -5395,7 +5413,7 @@ const d = class d {
5395
5413
  if (t.removeAttribute(`${c.prefix}importing`), N.importEnd(t, n, o, s), !document.body.hasAttribute("data-haori-ready")) {
5396
5414
  const l = [];
5397
5415
  return t.childNodes.forEach((h) => {
5398
- const u = R.get(h);
5416
+ const u = T.get(h);
5399
5417
  u instanceof M ? l.push(d.scan(u.getTarget())) : u instanceof V && l.push(d.evaluateText(u));
5400
5418
  }), Promise.all(l).then(() => {
5401
5419
  });
@@ -5415,7 +5433,7 @@ const d = class d {
5415
5433
  * @returns Promise (スキャンが完了したときに解決される)
5416
5434
  */
5417
5435
  static scan(e) {
5418
- const t = R.get(e);
5436
+ const t = T.get(e);
5419
5437
  return t ? d.initializeElementFragment(t, !1) : Promise.resolve();
5420
5438
  }
5421
5439
  /**
@@ -5529,7 +5547,7 @@ const d = class d {
5529
5547
  * @returns Promise (DOM操作が完了したときに解決される)
5530
5548
  */
5531
5549
  static setAttribute(e, t, r, i = !1) {
5532
- const n = R.get(e), s = d.getAliasedAttributeName(t);
5550
+ const n = T.get(e), s = d.getAliasedAttributeName(t);
5533
5551
  if (s !== null)
5534
5552
  return r === null ? n.removeAliasedAttribute(t, s) : n.setAliasedAttribute(
5535
5553
  t,
@@ -5625,7 +5643,7 @@ const d = class d {
5625
5643
  * @returns Promise (DOM操作が完了したときに解決される)
5626
5644
  */
5627
5645
  static setBindingData(e, t, r = /* @__PURE__ */ new Set(), i = !1, n = !0) {
5628
- const s = R.get(e), a = s.getRawBindingData();
5646
+ const s = T.get(e), a = s.getRawBindingData();
5629
5647
  s.setBindingData(t), n && N.bindChange(e, a, t, "manual");
5630
5648
  const o = () => {
5631
5649
  s.markBindingWorkStart();
@@ -5664,7 +5682,7 @@ const d = class d {
5664
5682
  * `resolved: true` のときは解決済みスコープ(常にオブジェクト)。
5665
5683
  */
5666
5684
  static getBindingData(e, t = {}) {
5667
- const r = R.get(e);
5685
+ const r = T.get(e);
5668
5686
  return r instanceof M ? t.resolved ? r.getBindingData() : r.getRawBindingData() : null;
5669
5687
  }
5670
5688
  /**
@@ -5683,7 +5701,7 @@ const d = class d {
5683
5701
  * @return 解決済みスコープと各キーの由来情報
5684
5702
  */
5685
5703
  static dumpScope(e) {
5686
- const t = R.get(e);
5704
+ const t = T.get(e);
5687
5705
  if (!t)
5688
5706
  return { resolved: {}, sources: {} };
5689
5707
  const r = t.getBindingData(), i = {}, n = (l) => {
@@ -5731,10 +5749,10 @@ const d = class d {
5731
5749
  * @param node 追加するノード
5732
5750
  */
5733
5751
  static addNode(e, t) {
5734
- const r = R.get(e);
5752
+ const r = T.get(e);
5735
5753
  if (r.isSkipMutationNodes())
5736
5754
  return;
5737
- const i = R.get(t.nextSibling), n = R.get(t);
5755
+ const i = T.get(t.nextSibling), n = T.get(t);
5738
5756
  n && (r.insertBefore(n, i), n instanceof M ? d.scan(n.getTarget()) : n instanceof V && d.evaluateText(n));
5739
5757
  }
5740
5758
  /**
@@ -5743,7 +5761,7 @@ const d = class d {
5743
5761
  * @param node 削除するノード
5744
5762
  */
5745
5763
  static removeNode(e) {
5746
- const t = R.get(e);
5764
+ const t = T.get(e);
5747
5765
  if (t) {
5748
5766
  const r = t.getParent();
5749
5767
  if (r && r.isSkipMutationNodes())
@@ -5758,7 +5776,7 @@ const d = class d {
5758
5776
  * @param text 新しいテキスト
5759
5777
  */
5760
5778
  static changeText(e, t) {
5761
- const r = R.get(e);
5779
+ const r = T.get(e);
5762
5780
  r && r.setContent(t);
5763
5781
  }
5764
5782
  /**
@@ -5770,7 +5788,7 @@ const d = class d {
5770
5788
  * @returns Promise (DOM操作が完了したときに解決される)
5771
5789
  */
5772
5790
  static changeValue(e, t) {
5773
- const r = R.get(e);
5791
+ const r = T.get(e);
5774
5792
  if (r.getValue() === t)
5775
5793
  return Promise.resolve();
5776
5794
  const i = [];
@@ -6066,10 +6084,10 @@ const d = class d {
6066
6084
  (l) => !l.hasAttribute(`${c.prefix}each-before`) && !l.hasAttribute(`${c.prefix}each-after`)
6067
6085
  ).forEach((l) => {
6068
6086
  if (!s) {
6069
- const u = R.get(l);
6087
+ const u = T.get(l);
6070
6088
  u instanceof M && (r = u.clone(), d.markFreshInitializationSkippable(r), e.setTemplate(r), s = !0);
6071
6089
  }
6072
- const h = R.get(l);
6090
+ const h = T.get(l);
6073
6091
  h instanceof M && e.getChildren().includes(h) && (e.removeChild(h), h.setMounted(!1)), l.parentNode && l.parentNode.removeChild(l);
6074
6092
  });
6075
6093
  }
@@ -6332,10 +6350,10 @@ const d = class d {
6332
6350
  );
6333
6351
  const p = u.map((b) => b.getListKey());
6334
6352
  u = u.filter((b) => l.has(String(b.getListKey())) ? !0 : (h.push(b.remove()), !1));
6335
- const v = u.map((b) => b.getListKey()), T = /* @__PURE__ */ new Map();
6353
+ const v = u.map((b) => b.getListKey()), R = /* @__PURE__ */ new Map();
6336
6354
  u.forEach((b) => {
6337
6355
  const S = b.getListKey();
6338
- S !== null && !T.has(S) && T.set(S, b);
6356
+ S !== null && !R.has(S) && R.set(S, b);
6339
6357
  });
6340
6358
  const I = e.getChildElementFragments().slice(), A = I.filter(
6341
6359
  (b) => b.hasAttribute(`${c.prefix}each-before`)
@@ -6344,7 +6362,7 @@ const d = class d {
6344
6362
  return o.forEach((b, S) => {
6345
6363
  const { item: k, itemIndex: C } = a.get(b);
6346
6364
  let O;
6347
- const j = T.get(b);
6365
+ const j = R.get(b);
6348
6366
  if (j)
6349
6367
  O = j, y = y.then(
6350
6368
  () => d.updateRowFragment(
@@ -6371,8 +6389,8 @@ const d = class d {
6371
6389
  s ? String(s) : null,
6372
6390
  b
6373
6391
  ).then(() => {
6374
- const _ = I[$] ?? null;
6375
- return e.insertBefore(O, _).then(() => {
6392
+ const ee = I[$] ?? null;
6393
+ return e.insertBefore(O, ee).then(() => {
6376
6394
  I.splice($, 0, O);
6377
6395
  }).then(() => d.initializeFreshEachRow(O));
6378
6396
  })
@@ -6550,7 +6568,7 @@ d.ATTRIBUTE_ALIAS_SUFFIX = "attr-", d.PRIORITY_ATTRIBUTE_SUFFIXES = [
6550
6568
  "url-param"
6551
6569
  ], d.ATTRIBUTE_PLACEHOLDER_REGEX = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/, d.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), d.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), d.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), d.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap();
6552
6570
  let x = d;
6553
- const Z = class Z {
6571
+ const _ = class _ {
6554
6572
  /**
6555
6573
  * コンストラクタ。
6556
6574
  *
@@ -6558,11 +6576,11 @@ const Z = class Z {
6558
6576
  */
6559
6577
  constructor(e = document) {
6560
6578
  this.customEventHandlers = /* @__PURE__ */ new Map(), this.onClick = (t) => this.delegate(t, "click"), this.onChange = (t) => this.delegate(t, "change"), this.onInput = (t) => this.delegate(t, "input"), this.onLoadCapture = (t) => this.delegate(t, "load"), this.onWindowLoad = () => {
6561
- const t = document.documentElement, r = R.get(t);
6579
+ const t = document.documentElement, r = T.get(t);
6562
6580
  r && new q(r, "load").run();
6563
6581
  }, this.onPopstate = (t) => {
6564
6582
  const r = t.state;
6565
- !r || r[Z.HISTORY_STATE_KEY] !== !0 || location.reload();
6583
+ !r || r[_.HISTORY_STATE_KEY] !== !0 || location.reload();
6566
6584
  }, this.root = e;
6567
6585
  }
6568
6586
  /**
@@ -6614,7 +6632,7 @@ const Z = class Z {
6614
6632
  subscribeCustomEvent(e) {
6615
6633
  if (e === null || e === "")
6616
6634
  return;
6617
- if (Z.BUILTIN_EVENT_NAMES.has(e)) {
6635
+ if (_.BUILTIN_EVENT_NAMES.has(e)) {
6618
6636
  m.warn(
6619
6637
  "[Haori]",
6620
6638
  `data-on="${e}" は組み込みイベントです。data-${e}-* を使用してください(data-on はカスタムイベント専用)。`
@@ -6637,7 +6655,7 @@ const Z = class Z {
6637
6655
  this.root.querySelectorAll(`[${this.onAttributeName}]`).forEach((i) => {
6638
6656
  if (i.getAttribute(this.onAttributeName) !== e)
6639
6657
  return;
6640
- const n = R.get(i);
6658
+ const n = T.get(i);
6641
6659
  n instanceof M && new q(n, "on", t).run().catch((s) => {
6642
6660
  m.error("[Haori]", "Procedure execution error:", s);
6643
6661
  });
@@ -6683,7 +6701,7 @@ const Z = class Z {
6683
6701
  return;
6684
6702
  }
6685
6703
  r.hasAttribute(`${c.prefix}${t}-prevent`) && e.preventDefault();
6686
- const i = R.get(r);
6704
+ const i = T.get(r);
6687
6705
  if (!i)
6688
6706
  return;
6689
6707
  (t === "change" || t === "input") && i instanceof M && i.syncValue();
@@ -6741,13 +6759,13 @@ const Z = class Z {
6741
6759
  return null;
6742
6760
  }
6743
6761
  };
6744
- Z.HISTORY_STATE_KEY = "__haoriHistoryState__", Z.BUILTIN_EVENT_NAMES = /* @__PURE__ */ new Set([
6762
+ _.HISTORY_STATE_KEY = "__haoriHistoryState__", _.BUILTIN_EVENT_NAMES = /* @__PURE__ */ new Set([
6745
6763
  "click",
6746
6764
  "change",
6747
6765
  "input",
6748
6766
  "load"
6749
6767
  ]);
6750
- let fe = Z;
6768
+ let fe = _;
6751
6769
  const D = class D {
6752
6770
  /**
6753
6771
  * ノードが現在の Window に属する HTMLElement かどうかを判定します。
@@ -6767,7 +6785,7 @@ const D = class D {
6767
6785
  }));
6768
6786
  }
6769
6787
  static syncElement(e) {
6770
- const t = D.registrations.get(e), r = R.get(e);
6788
+ const t = D.registrations.get(e), r = T.get(e);
6771
6789
  if (!r || !D.shouldObserve(r)) {
6772
6790
  t && (t.observer.disconnect(), D.registrations.delete(e));
6773
6791
  return;
@@ -6875,7 +6893,7 @@ D.CONFIG_KEYS = /* @__PURE__ */ new Set([
6875
6893
  "disabled",
6876
6894
  "once"
6877
6895
  ]), D.registrations = /* @__PURE__ */ new Map();
6878
- let Q = D;
6896
+ let Z = D;
6879
6897
  function st(f) {
6880
6898
  typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => f()) : Promise.resolve().then(f);
6881
6899
  }
@@ -6909,7 +6927,7 @@ const w = class w {
6909
6927
  * @param element 対象要素
6910
6928
  */
6911
6929
  static syncElement(e) {
6912
- const t = w.registrations.get(e), r = R.get(e);
6930
+ const t = w.registrations.get(e), r = T.get(e);
6913
6931
  if (!(r instanceof M) || !w.shouldObserve(r)) {
6914
6932
  t && (t.observer.disconnect(), w.registrations.delete(e));
6915
6933
  return;
@@ -7176,7 +7194,7 @@ const H = class H {
7176
7194
  x.scan(document.head),
7177
7195
  x.scan(document.body)
7178
7196
  ]), [t, r] = e;
7179
- t.status !== "fulfilled" && m.error("[Haori]", "Failed to build head fragment:", t.reason), r.status !== "fulfilled" && m.error("[Haori]", "Failed to build body fragment:", r.reason), await P.wait(), document.body.setAttribute("data-haori-ready", ""), H.observe(document.head), H.observe(document.body), new fe().start(), Q.syncTree(document.body), Y.syncTree(document.body);
7197
+ t.status !== "fulfilled" && m.error("[Haori]", "Failed to build head fragment:", t.reason), r.status !== "fulfilled" && m.error("[Haori]", "Failed to build body fragment:", r.reason), await P.wait(), document.body.setAttribute("data-haori-ready", ""), H.observe(document.head), H.observe(document.body), new fe().start(), Z.syncTree(document.body), Y.syncTree(document.body);
7180
7198
  }
7181
7199
  /**
7182
7200
  * 指定された要素を監視します。
@@ -7200,14 +7218,14 @@ const H = class H {
7200
7218
  i.attributeName,
7201
7219
  n.getAttribute(i.attributeName),
7202
7220
  !0
7203
- ), Q.syncElement(n), Y.syncElement(n);
7221
+ ), Z.syncElement(n), Y.syncElement(n);
7204
7222
  break;
7205
7223
  }
7206
7224
  case "childList": {
7207
7225
  Array.from(i.removedNodes).forEach((n) => {
7208
- Q.cleanupTree(n), Y.cleanupTree(n), x.removeNode(n);
7226
+ Z.cleanupTree(n), Y.cleanupTree(n), x.removeNode(n);
7209
7227
  }), Array.from(i.addedNodes).forEach((n) => {
7210
- n.parentElement instanceof Element && (x.addNode(n.parentElement, n), Q.syncTree(n), Y.syncTree(n));
7228
+ n.parentElement instanceof Element && (x.addNode(n.parentElement, n), Z.syncTree(n), Y.syncTree(n));
7211
7229
  }), i.target instanceof Element && Y.syncElement(
7212
7230
  i.target
7213
7231
  );
@@ -7240,16 +7258,16 @@ const H = class H {
7240
7258
  H._initialized = !1, H._mutationObservers = [];
7241
7259
  let ae = H;
7242
7260
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", ae.init) : ae.init();
7243
- const at = () => ee.waitForRenders(), ot = "0.20.0";
7261
+ const at = () => Q.waitForRenders(), ot = "0.20.0";
7244
7262
  export {
7245
7263
  x as Core,
7246
7264
  c as Env,
7247
7265
  E as Form,
7248
- R as Fragment,
7249
- ee as Haori,
7266
+ T as Fragment,
7267
+ Q as Haori,
7250
7268
  m as Log,
7251
7269
  P as Queue,
7252
- ee as default,
7270
+ Q as default,
7253
7271
  ot as version,
7254
7272
  at as waitForRenders
7255
7273
  };