haori 0.65.1 → 0.67.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/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/haori.cjs.js +22 -22
- package/dist/haori.es.js +1017 -890
- package/dist/haori.iife.js +25 -25
- package/dist/index.d.ts +4 -3
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Re = class Re {
|
|
2
2
|
/**
|
|
3
3
|
* 開発モードの状態を取得します。
|
|
4
4
|
*
|
|
5
5
|
* @returns 開発モードならtrue、そうでなければfalse
|
|
6
6
|
*/
|
|
7
7
|
static isEnabled() {
|
|
8
|
-
return
|
|
8
|
+
return Re.devMode;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* 開発モードを有効化します。
|
|
12
12
|
*/
|
|
13
13
|
static enable() {
|
|
14
|
-
|
|
14
|
+
Re.devMode = !0;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* 開発モードを無効化します。
|
|
18
18
|
*/
|
|
19
19
|
static disable() {
|
|
20
|
-
|
|
20
|
+
Re.devMode = !1;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* 開発モードを切り替えます。
|
|
@@ -25,11 +25,11 @@ const ve = class ve {
|
|
|
25
25
|
* @param enabled trueで有効化、falseで無効化
|
|
26
26
|
*/
|
|
27
27
|
static set(e) {
|
|
28
|
-
|
|
28
|
+
Re.devMode = e;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
let V =
|
|
31
|
+
Re.devMode = !1;
|
|
32
|
+
let V = Re;
|
|
33
33
|
const rt = "embedded";
|
|
34
34
|
function It(f) {
|
|
35
35
|
return f === "embedded" || f === "demo";
|
|
@@ -451,26 +451,26 @@ const rr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:
|
|
|
451
451
|
}
|
|
452
452
|
};
|
|
453
453
|
I.enhancers = /* @__PURE__ */ new Map(), I.instances = /* @__PURE__ */ new WeakMap(), I.warnedUnknownNames = /* @__PURE__ */ new Set(), I.warnedMissingGlobals = /* @__PURE__ */ new Set(), I.visited = /* @__PURE__ */ new WeakSet(), I.mutationCapture = null;
|
|
454
|
-
let
|
|
454
|
+
let le = I;
|
|
455
455
|
const Ft = "yyyy/MM/dd HH:mm", ir = "en-US", ft = 1e4;
|
|
456
|
-
function
|
|
456
|
+
function me(f) {
|
|
457
457
|
return String(f).padStart(2, "0");
|
|
458
458
|
}
|
|
459
459
|
function Ct(f, e, t, r, i, s) {
|
|
460
460
|
return {
|
|
461
461
|
yyyy: String(f).padStart(4, "0"),
|
|
462
|
-
yy:
|
|
463
|
-
MM:
|
|
462
|
+
yy: me(f % 100),
|
|
463
|
+
MM: me(e),
|
|
464
464
|
M: String(e),
|
|
465
|
-
dd:
|
|
465
|
+
dd: me(t),
|
|
466
466
|
d: String(t),
|
|
467
|
-
HH:
|
|
467
|
+
HH: me(r),
|
|
468
468
|
H: String(r),
|
|
469
|
-
mm:
|
|
470
|
-
ss:
|
|
469
|
+
mm: me(i),
|
|
470
|
+
ss: me(s)
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function $t(f, e) {
|
|
474
474
|
let t;
|
|
475
475
|
try {
|
|
476
476
|
t = new Intl.DateTimeFormat("en-US", {
|
|
@@ -492,7 +492,7 @@ function Mt(f, e) {
|
|
|
492
492
|
const i = Number(r.year), s = Number(r.month), n = Number(r.day), a = Number(r.hour), o = Number(r.minute), l = Number(r.second);
|
|
493
493
|
return !Number.isFinite(i) || !Number.isFinite(s) || !Number.isFinite(n) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(l) ? null : Ct(i, s, n, a, o, l);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ze(f, e = Ft, t) {
|
|
496
496
|
if (f == null || f === "")
|
|
497
497
|
return "";
|
|
498
498
|
const r = f instanceof Date ? f : new Date(f);
|
|
@@ -500,7 +500,7 @@ function Je(f, e = Ft, t) {
|
|
|
500
500
|
return "";
|
|
501
501
|
let i;
|
|
502
502
|
if (typeof t == "string" && t.trim() !== "") {
|
|
503
|
-
if (i =
|
|
503
|
+
if (i = $t(r, t.trim()), i === null)
|
|
504
504
|
return "";
|
|
505
505
|
} else
|
|
506
506
|
i = Ct(
|
|
@@ -518,14 +518,14 @@ function Je(f, e = Ft, t) {
|
|
|
518
518
|
);
|
|
519
519
|
}
|
|
520
520
|
const sr = "yyyy-MM-dd";
|
|
521
|
-
function
|
|
522
|
-
return
|
|
521
|
+
function Mt(f = Ft, e) {
|
|
522
|
+
return Ze(/* @__PURE__ */ new Date(), f, e);
|
|
523
523
|
}
|
|
524
524
|
function Pt(f = 0, e = sr, t) {
|
|
525
525
|
const r = Number.isFinite(f) ? Math.trunc(f) : 0, i = typeof t == "string" && t.trim() !== "" ? t.trim() : "";
|
|
526
526
|
let s, n, a;
|
|
527
527
|
if (i !== "") {
|
|
528
|
-
const l =
|
|
528
|
+
const l = $t(/* @__PURE__ */ new Date(), i);
|
|
529
529
|
if (l === null)
|
|
530
530
|
return "";
|
|
531
531
|
s = Number(l.yyyy), n = Number(l.MM), a = Number(l.dd);
|
|
@@ -534,7 +534,7 @@ function Pt(f = 0, e = sr, t) {
|
|
|
534
534
|
s = l.getFullYear(), n = l.getMonth() + 1, a = l.getDate();
|
|
535
535
|
}
|
|
536
536
|
const o = new Date(Date.UTC(s, n - 1, a + r));
|
|
537
|
-
return
|
|
537
|
+
return Ze(o, e, "UTC");
|
|
538
538
|
}
|
|
539
539
|
function Lt(f, e) {
|
|
540
540
|
if (f == null)
|
|
@@ -609,11 +609,11 @@ function Bt(f, e, t = {}) {
|
|
|
609
609
|
return l;
|
|
610
610
|
}
|
|
611
611
|
const nr = /^(\d{4})-(\d{1,2})$/, ar = 1200;
|
|
612
|
-
function
|
|
612
|
+
function qe(f, e) {
|
|
613
613
|
const t = Number(f);
|
|
614
614
|
return Number.isFinite(t) ? Math.trunc(t) : e;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function Qe(f, e) {
|
|
617
617
|
if (typeof f != "string")
|
|
618
618
|
return "";
|
|
619
619
|
const t = nr.exec(f.trim());
|
|
@@ -623,13 +623,13 @@ function Ze(f, e) {
|
|
|
623
623
|
if (i < 1 || i > 12)
|
|
624
624
|
return "";
|
|
625
625
|
const s = Number.isFinite(e) ? Math.trunc(e) : 0, n = r * 12 + (i - 1) + s, a = Math.floor(n / 12), o = n - a * 12 + 1;
|
|
626
|
-
return `${String(a).padStart(4, "0")}-${
|
|
626
|
+
return `${String(a).padStart(4, "0")}-${me(o)}`;
|
|
627
627
|
}
|
|
628
628
|
function or(f) {
|
|
629
629
|
if (typeof f == "string" && f.trim() !== "")
|
|
630
|
-
return
|
|
630
|
+
return Qe(f, 0);
|
|
631
631
|
const e = /* @__PURE__ */ new Date();
|
|
632
|
-
return `${String(e.getFullYear()).padStart(4, "0")}-${
|
|
632
|
+
return `${String(e.getFullYear()).padStart(4, "0")}-${me(e.getMonth() + 1)}`;
|
|
633
633
|
}
|
|
634
634
|
function Ut(f, e) {
|
|
635
635
|
const t = Math.trunc(Number(f));
|
|
@@ -640,7 +640,7 @@ function Ut(f, e) {
|
|
|
640
640
|
return [];
|
|
641
641
|
const i = Math.min(t, ar), s = [];
|
|
642
642
|
for (let n = 0; n <= i; n += 1) {
|
|
643
|
-
const a =
|
|
643
|
+
const a = Qe(r, -n);
|
|
644
644
|
s.push({ targetMonth: a, label: a.replace(/-/g, "/") });
|
|
645
645
|
}
|
|
646
646
|
return s;
|
|
@@ -649,15 +649,15 @@ function Ht(f, e) {
|
|
|
649
649
|
const t = { start: 0, end: 0, total: 0, empty: !0 };
|
|
650
650
|
if (!f || typeof f != "object")
|
|
651
651
|
return t;
|
|
652
|
-
const r = f, i =
|
|
652
|
+
const r = f, i = qe(r.totalElements ?? r.totalCount, 0);
|
|
653
653
|
if (i <= 0)
|
|
654
654
|
return t;
|
|
655
|
-
const s = Math.max(0,
|
|
655
|
+
const s = Math.max(0, qe(r.number, 0)), n = Math.max(0, qe(r.size, 0)), a = s * n, o = Math.min(a + 1, i);
|
|
656
656
|
let l;
|
|
657
657
|
if (e !== void 0 && Number.isFinite(e))
|
|
658
658
|
l = Math.max(0, Math.trunc(e));
|
|
659
659
|
else {
|
|
660
|
-
const d =
|
|
660
|
+
const d = qe(r.numberOfElements, NaN);
|
|
661
661
|
l = Number.isFinite(d) ? d : Math.min(n, i - a);
|
|
662
662
|
}
|
|
663
663
|
const u = Math.min(a + l, i);
|
|
@@ -712,13 +712,13 @@ function Kt(f, e) {
|
|
|
712
712
|
return r;
|
|
713
713
|
}
|
|
714
714
|
const lr = Object.freeze({
|
|
715
|
-
date:
|
|
716
|
-
now:
|
|
715
|
+
date: Ze,
|
|
716
|
+
now: Mt,
|
|
717
717
|
today: Pt,
|
|
718
718
|
number: Lt,
|
|
719
719
|
pages: Bt,
|
|
720
720
|
range: Ot,
|
|
721
|
-
monthAdd:
|
|
721
|
+
monthAdd: Qe,
|
|
722
722
|
monthRange: Ut,
|
|
723
723
|
pageSummary: Ht,
|
|
724
724
|
findBy: Vt,
|
|
@@ -879,7 +879,7 @@ const lt = class lt {
|
|
|
879
879
|
}
|
|
880
880
|
};
|
|
881
881
|
lt.ASYNC_QUEUE = new at();
|
|
882
|
-
let
|
|
882
|
+
let J = lt;
|
|
883
883
|
const zt = /* @__PURE__ */ new Set([
|
|
884
884
|
"window",
|
|
885
885
|
"self",
|
|
@@ -908,7 +908,7 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
908
908
|
"sessionStorage",
|
|
909
909
|
"IndexedDB",
|
|
910
910
|
"history"
|
|
911
|
-
]),
|
|
911
|
+
]), Ke = /* @__PURE__ */ new Set([
|
|
912
912
|
"eval",
|
|
913
913
|
"arguments"
|
|
914
914
|
]), Gt = /* @__PURE__ */ new Set([
|
|
@@ -919,11 +919,11 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
919
919
|
"localStorage",
|
|
920
920
|
"sessionStorage",
|
|
921
921
|
"IndexedDB"
|
|
922
|
-
]),
|
|
922
|
+
]), ze = /* @__PURE__ */ new Set([
|
|
923
923
|
"constructor",
|
|
924
924
|
"__proto__",
|
|
925
925
|
"prototype"
|
|
926
|
-
]),
|
|
926
|
+
]), Ge = /* @__PURE__ */ new Set([
|
|
927
927
|
"await",
|
|
928
928
|
"break",
|
|
929
929
|
"case",
|
|
@@ -1509,7 +1509,7 @@ class pr {
|
|
|
1509
1509
|
* @param position 位置
|
|
1510
1510
|
*/
|
|
1511
1511
|
checkReferenceName(e, t) {
|
|
1512
|
-
if (
|
|
1512
|
+
if (Ge.has(e) || Ke.has(e) || it.has(e))
|
|
1513
1513
|
throw Y(X.notInExpressions(e), t);
|
|
1514
1514
|
}
|
|
1515
1515
|
/**
|
|
@@ -1532,7 +1532,7 @@ class pr {
|
|
|
1532
1532
|
* @param position 位置
|
|
1533
1533
|
*/
|
|
1534
1534
|
checkPropertyName(e, t) {
|
|
1535
|
-
if (
|
|
1535
|
+
if (Ge.has(e) || Ke.has(e) || ze.has(e))
|
|
1536
1536
|
throw Y(X.notProperty(e), t);
|
|
1537
1537
|
}
|
|
1538
1538
|
/**
|
|
@@ -1996,7 +1996,7 @@ class pr {
|
|
|
1996
1996
|
return this.checkPropertyName(e.value, e.start), this.advance(), e.value;
|
|
1997
1997
|
if (e.type === "string") {
|
|
1998
1998
|
const t = e.literal;
|
|
1999
|
-
if (
|
|
1999
|
+
if (ze.has(t))
|
|
2000
2000
|
throw Y(X.notProperty(t), e.start);
|
|
2001
2001
|
return this.advance(), t;
|
|
2002
2002
|
}
|
|
@@ -2129,7 +2129,7 @@ function mt(f, e) {
|
|
|
2129
2129
|
}
|
|
2130
2130
|
function yt(f) {
|
|
2131
2131
|
const e = typeof f == "symbol" ? f : String(f);
|
|
2132
|
-
return
|
|
2132
|
+
return ze.has(e) ? "undefined" : e;
|
|
2133
2133
|
}
|
|
2134
2134
|
function mr(f) {
|
|
2135
2135
|
return typeof f == "bigint" ? f : Number(f);
|
|
@@ -2711,8 +2711,8 @@ const ct = class ct {
|
|
|
2711
2711
|
}
|
|
2712
2712
|
};
|
|
2713
2713
|
ct.COMPILE_CACHE = /* @__PURE__ */ new Map();
|
|
2714
|
-
let
|
|
2715
|
-
const
|
|
2714
|
+
let Le = ct;
|
|
2715
|
+
const T = class T {
|
|
2716
2716
|
/**
|
|
2717
2717
|
* 明示バインド内に持ち込まれてはならない危険値を返します。
|
|
2718
2718
|
*
|
|
@@ -3140,7 +3140,7 @@ let ${e.join(", ")};`;
|
|
|
3140
3140
|
n.push(l), l && s.push({
|
|
3141
3141
|
start: o.position + 1,
|
|
3142
3142
|
end: o.position + 1,
|
|
3143
|
-
text:
|
|
3143
|
+
text: T.MEMBER_KEY_GUARD_OPEN
|
|
3144
3144
|
});
|
|
3145
3145
|
} else o.value === "]" && n.pop() === !0 && s.push({
|
|
3146
3146
|
start: o.position,
|
|
@@ -3210,7 +3210,7 @@ let ${e.join(", ")};`;
|
|
|
3210
3210
|
* @return 戻り値はありません。
|
|
3211
3211
|
*/
|
|
3212
3212
|
static scheduleUnresolvedIdentifierReport() {
|
|
3213
|
-
this.unresolvedReportScheduled || (this.unresolvedReportScheduled = !0,
|
|
3213
|
+
this.unresolvedReportScheduled || (this.unresolvedReportScheduled = !0, J.waitForIdle().then(() => {
|
|
3214
3214
|
this.unresolvedReportScheduled = !1, this.reportUnresolvedIdentifiers();
|
|
3215
3215
|
}));
|
|
3216
3216
|
}
|
|
@@ -3278,7 +3278,7 @@ let ${e.join(", ")};`;
|
|
|
3278
3278
|
this.pendingScopeMissingIdentifiers.delete(t);
|
|
3279
3279
|
return;
|
|
3280
3280
|
}
|
|
3281
|
-
this.pendingScopeMissingIdentifiers.set(t, new Set(e)), !this.scopeMissingReportScheduled && (this.scopeMissingReportScheduled = !0,
|
|
3281
|
+
this.pendingScopeMissingIdentifiers.set(t, new Set(e)), !this.scopeMissingReportScheduled && (this.scopeMissingReportScheduled = !0, J.waitForIdle().then(() => {
|
|
3282
3282
|
this.scopeMissingReportScheduled = !1, this.reportScopeMissingIdentifiers();
|
|
3283
3283
|
}));
|
|
3284
3284
|
}
|
|
@@ -3324,11 +3324,11 @@ ${t}`;
|
|
|
3324
3324
|
* @returns `callback` の戻り値
|
|
3325
3325
|
*/
|
|
3326
3326
|
static withoutDiagnosis(e) {
|
|
3327
|
-
|
|
3327
|
+
T.evaluatingForDiagnosis = !0;
|
|
3328
3328
|
try {
|
|
3329
3329
|
return e();
|
|
3330
3330
|
} finally {
|
|
3331
|
-
|
|
3331
|
+
T.evaluatingForDiagnosis = !1;
|
|
3332
3332
|
}
|
|
3333
3333
|
}
|
|
3334
3334
|
/**
|
|
@@ -3612,7 +3612,7 @@ ${t}`;
|
|
|
3612
3612
|
const o = {};
|
|
3613
3613
|
t.bindKeys.forEach((l, u) => {
|
|
3614
3614
|
o[l] = s[u];
|
|
3615
|
-
}), n = () =>
|
|
3615
|
+
}), n = () => Le.run(a, o);
|
|
3616
3616
|
} else
|
|
3617
3617
|
n = () => t.evaluator.call(this.BUILTIN_HOLDER, ...s);
|
|
3618
3618
|
return this.getExpressionProfile(e).needsPropertyBlocking ? this.withBlockedPropertyAccess(n) : n();
|
|
@@ -3697,7 +3697,7 @@ ${u}return (${y});` + d;
|
|
|
3697
3697
|
*/
|
|
3698
3698
|
static prepareInterpretedEvaluator(e, t) {
|
|
3699
3699
|
try {
|
|
3700
|
-
const r =
|
|
3700
|
+
const r = Le.compile(e);
|
|
3701
3701
|
return { bindKeys: t, evaluator: null, compileFailed: !1, compiled: r };
|
|
3702
3702
|
} catch (r) {
|
|
3703
3703
|
return m.error("[Haori]", "Failed to compile expression:", e, r), this.compileFailedExpressions.add(e), { bindKeys: t, evaluator: null, compileFailed: !0 };
|
|
@@ -3858,17 +3858,17 @@ ${u}return (${y});` + d;
|
|
|
3858
3858
|
* @returns 食い違っている場合は両辺の型。該当しない場合は null
|
|
3859
3859
|
*/
|
|
3860
3860
|
static diagnoseStrictComparison(e, t = {}) {
|
|
3861
|
-
const r =
|
|
3861
|
+
const r = T.splitStrictComparison(e);
|
|
3862
3862
|
if (r === null)
|
|
3863
3863
|
return null;
|
|
3864
|
-
const [i, s] =
|
|
3865
|
-
|
|
3866
|
-
|
|
3864
|
+
const [i, s] = T.withoutDiagnosis(() => [
|
|
3865
|
+
T.evaluateDetailed(r.left, t),
|
|
3866
|
+
T.evaluateDetailed(r.right, t)
|
|
3867
3867
|
]);
|
|
3868
3868
|
if (i.unresolvedReference || s.unresolvedReference)
|
|
3869
3869
|
return null;
|
|
3870
3870
|
const n = i.value, a = s.value;
|
|
3871
|
-
return typeof n == typeof a || !
|
|
3871
|
+
return typeof n == typeof a || !T.isLooselyEqual(n, a) ? null : { left: typeof n, right: typeof a };
|
|
3872
3872
|
}
|
|
3873
3873
|
/**
|
|
3874
3874
|
* 型をまたいだ緩い比較(`==`)を行います。
|
|
@@ -3895,11 +3895,11 @@ ${u}return (${y});` + d;
|
|
|
3895
3895
|
* @returns 左辺と右辺。単一の厳密比較でない場合は null
|
|
3896
3896
|
*/
|
|
3897
3897
|
static splitStrictComparison(e) {
|
|
3898
|
-
const t =
|
|
3898
|
+
const t = T.strictComparisonSplits.get(e);
|
|
3899
3899
|
if (t !== void 0)
|
|
3900
3900
|
return t;
|
|
3901
|
-
const r =
|
|
3902
|
-
return
|
|
3901
|
+
const r = T.computeStrictComparisonSplit(e);
|
|
3902
|
+
return T.strictComparisonSplits.set(e, r), r;
|
|
3903
3903
|
}
|
|
3904
3904
|
/**
|
|
3905
3905
|
* 式を単一の厳密比較として分割します(記憶しない実体)。
|
|
@@ -3908,7 +3908,7 @@ ${u}return (${y});` + d;
|
|
|
3908
3908
|
* @returns 左辺と右辺。単一の厳密比較でない場合は null
|
|
3909
3909
|
*/
|
|
3910
3910
|
static computeStrictComparisonSplit(e) {
|
|
3911
|
-
const t =
|
|
3911
|
+
const t = T.tokenizeExpression(e);
|
|
3912
3912
|
if (t === null)
|
|
3913
3913
|
return null;
|
|
3914
3914
|
let r = 0, i = null;
|
|
@@ -3924,7 +3924,7 @@ ${u}return (${y});` + d;
|
|
|
3924
3924
|
}
|
|
3925
3925
|
if (r === 0) {
|
|
3926
3926
|
if (a.value === "&&")
|
|
3927
|
-
return
|
|
3927
|
+
return T.splitStrictComparison(
|
|
3928
3928
|
e.slice(0, a.position)
|
|
3929
3929
|
);
|
|
3930
3930
|
if (a.value === "===") {
|
|
@@ -3933,7 +3933,7 @@ ${u}return (${y});` + d;
|
|
|
3933
3933
|
i = a;
|
|
3934
3934
|
continue;
|
|
3935
3935
|
}
|
|
3936
|
-
if (
|
|
3936
|
+
if (T.COMPOSING_OPERATORS.has(a.value))
|
|
3937
3937
|
return null;
|
|
3938
3938
|
}
|
|
3939
3939
|
}
|
|
@@ -4464,33 +4464,33 @@ ${u}return (${y});` + d;
|
|
|
4464
4464
|
return a.cut ? (i && (i.cut = !0), !1) : (this.forbiddenBindingValueCache.set(e, !1), !1);
|
|
4465
4465
|
}
|
|
4466
4466
|
};
|
|
4467
|
-
|
|
4467
|
+
T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HELPERS = {
|
|
4468
4468
|
...lr
|
|
4469
|
-
},
|
|
4470
|
-
...[...
|
|
4469
|
+
}, T.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, T.BUILTIN_DATA_PROPERTY = "data", T.BUILTIN_DATA_REFERENCE_PATTERN = /(^|[^\w$.])haori\s*(\.\s*data(?![\w$])|\[)/, T.IDENTIFIER_NAME_PATTERN = /^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/u, T.STRICT_PARAMETER_RESERVED_WORDS = /* @__PURE__ */ new Set([
|
|
4470
|
+
...[...Ge].filter((e) => e !== "await"),
|
|
4471
4471
|
...it,
|
|
4472
|
-
...
|
|
4472
|
+
...Ke,
|
|
4473
4473
|
"extends",
|
|
4474
4474
|
"true",
|
|
4475
4475
|
"false",
|
|
4476
4476
|
"null"
|
|
4477
|
-
]),
|
|
4477
|
+
]), T.evalBlockedReported = !1, T.usableBindingKeyCache = /* @__PURE__ */ new Map(), T.loggedUnusableBindingKeys = /* @__PURE__ */ new Set(), T.compileFailedExpressions = /* @__PURE__ */ new Set(), T.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), T.forbiddenBindingValueSet = null, T.forbiddenBindingValueCacheResetScheduled = !1, T.loggedForbiddenKeySignatures = /* @__PURE__ */ new Set(), T.loggedForbiddenKeyResetScheduled = !1, T.FORBIDDEN_NAMES = [
|
|
4478
4478
|
...zt
|
|
4479
|
-
],
|
|
4480
|
-
...
|
|
4481
|
-
],
|
|
4482
|
-
...
|
|
4483
|
-
(e) => !
|
|
4479
|
+
], T.STRICT_FORBIDDEN_NAMES = [
|
|
4480
|
+
...Ke
|
|
4481
|
+
], T.REBINDABLE_FORBIDDEN_NAMES = Gt, T.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
|
|
4482
|
+
...T.FORBIDDEN_NAMES.filter(
|
|
4483
|
+
(e) => !T.REBINDABLE_FORBIDDEN_NAMES.has(e)
|
|
4484
4484
|
),
|
|
4485
4485
|
"constructor",
|
|
4486
4486
|
"__proto__",
|
|
4487
4487
|
"prototype",
|
|
4488
|
-
...
|
|
4489
|
-
]),
|
|
4488
|
+
...T.STRICT_FORBIDDEN_NAMES
|
|
4489
|
+
]), T.FORBIDDEN_PROPERTY_NAMES = ze, T.OBJECT_PROPERTY_MODIFIERS = /* @__PURE__ */ new Set([
|
|
4490
4490
|
"get",
|
|
4491
4491
|
"set",
|
|
4492
4492
|
"async"
|
|
4493
|
-
]),
|
|
4493
|
+
]), T.DISALLOWED_KEYWORDS = Ge, T.NON_SHADOWABLE_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
4494
4494
|
// リテラル・グローバル定数
|
|
4495
4495
|
"true",
|
|
4496
4496
|
"false",
|
|
@@ -4500,11 +4500,11 @@ k.MAX_IDENTIFIER_RECOVERY_COUNT = 8, k.BUILTIN_NAMESPACE = "haori", k.BUILTIN_HE
|
|
|
4500
4500
|
"Infinity",
|
|
4501
4501
|
// strict モードの予約語(`let` 宣言が構文エラーになる)
|
|
4502
4502
|
...it
|
|
4503
|
-
]),
|
|
4503
|
+
]), T.ALLOWED_GLOBAL_IDENTIFIERS = Yt, T.BUILTIN_HOLDER = Object.freeze(
|
|
4504
4504
|
Object.defineProperties(
|
|
4505
4505
|
{},
|
|
4506
4506
|
Object.fromEntries(
|
|
4507
|
-
[...
|
|
4507
|
+
[...T.ALLOWED_GLOBAL_IDENTIFIERS].map((e) => [
|
|
4508
4508
|
e,
|
|
4509
4509
|
{
|
|
4510
4510
|
get: () => globalThis[e],
|
|
@@ -4513,10 +4513,10 @@ k.MAX_IDENTIFIER_RECOVERY_COUNT = 8, k.BUILTIN_NAMESPACE = "haori", k.BUILTIN_HE
|
|
|
4513
4513
|
])
|
|
4514
4514
|
)
|
|
4515
4515
|
)
|
|
4516
|
-
),
|
|
4516
|
+
), T.EXPRESSION_CACHE = /* @__PURE__ */ new Map(), T.FREE_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), T.ALLOWED_SYNTAX_CACHE = /* @__PURE__ */ new Map(), T.REFERENCED_NAME_CACHE = /* @__PURE__ */ new Map(), T.PROFILE_CACHE = /* @__PURE__ */ new Map(), T.BOUND_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), T.OPTIONAL_CHAIN_CACHE = /* @__PURE__ */ new Map(), T.GUARDED_MEMBER_CACHE = /* @__PURE__ */ new Map(), T.MEMBER_KEY_GUARD_OPEN = "(_hk=>(_hk=typeof _hk==='symbol'?_hk:`${_hk}`)==='constructor'||_hk==='__proto__'||_hk==='prototype'?undefined:_hk)(", T.FORBIDDEN_NAME_PATTERNS = T.FORBIDDEN_NAMES.map((e) => ({
|
|
4517
4517
|
name: e,
|
|
4518
4518
|
pattern: new RegExp(`(^|[^\\w$.])${e}(?![\\w$])`)
|
|
4519
|
-
})),
|
|
4519
|
+
})), T.FORBIDDEN_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), T.pendingUnresolvedIdentifiers = /* @__PURE__ */ new Set(), T.evaluatingForDiagnosis = !1, T.unresolvedReportScheduled = !1, T.suppliedIdentifiers = /* @__PURE__ */ new Set(), T.pendingScopeMissingIdentifiers = /* @__PURE__ */ new Map(), T.scopeMissingReportScheduled = !1, T.rowScopeIdentifiers = /* @__PURE__ */ new Set(), T.loggedScopeMissingIdentifiers = /* @__PURE__ */ new Set(), T.loggedBlockedIdentifierExpressions = /* @__PURE__ */ new Set(), T.COMPOSING_OPERATORS = /* @__PURE__ */ new Set([
|
|
4520
4520
|
"||",
|
|
4521
4521
|
"?",
|
|
4522
4522
|
":",
|
|
@@ -4535,9 +4535,9 @@ k.MAX_IDENTIFIER_RECOVERY_COUNT = 8, k.BUILTIN_NAMESPACE = "haori", k.BUILTIN_HE
|
|
|
4535
4535
|
"/",
|
|
4536
4536
|
"%",
|
|
4537
4537
|
"..."
|
|
4538
|
-
]),
|
|
4539
|
-
let
|
|
4540
|
-
class
|
|
4538
|
+
]), T.strictComparisonSplits = /* @__PURE__ */ new Map(), T.WRAPPED_VALUES = /* @__PURE__ */ new WeakSet();
|
|
4539
|
+
let re = T;
|
|
4540
|
+
class Oe {
|
|
4541
4541
|
/**
|
|
4542
4542
|
* URLのクエリパラメータを取得します。
|
|
4543
4543
|
*
|
|
@@ -4618,12 +4618,12 @@ class $e {
|
|
|
4618
4618
|
return /^(?:javascript|vbscript):/i.test(t);
|
|
4619
4619
|
}
|
|
4620
4620
|
}
|
|
4621
|
-
const
|
|
4621
|
+
const ve = "data-haori-if-disabled", At = "input, select, textarea, button, fieldset", P = class P {
|
|
4622
4622
|
/**
|
|
4623
4623
|
* 集計状態を初期化します。
|
|
4624
4624
|
*/
|
|
4625
4625
|
static reset() {
|
|
4626
|
-
|
|
4626
|
+
P.ELEMENT_STORES.clear(), P.ensureGlobalAccess();
|
|
4627
4627
|
}
|
|
4628
4628
|
/**
|
|
4629
4629
|
* 集計を開始します。
|
|
@@ -4631,7 +4631,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4631
4631
|
* @returns 戻り値はありません。
|
|
4632
4632
|
*/
|
|
4633
4633
|
static start() {
|
|
4634
|
-
|
|
4634
|
+
P.collecting = !0;
|
|
4635
4635
|
}
|
|
4636
4636
|
/**
|
|
4637
4637
|
* 集計を停止します。
|
|
@@ -4639,7 +4639,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4639
4639
|
* @returns 戻り値はありません。
|
|
4640
4640
|
*/
|
|
4641
4641
|
static stop() {
|
|
4642
|
-
|
|
4642
|
+
P.collecting = !1;
|
|
4643
4643
|
}
|
|
4644
4644
|
/**
|
|
4645
4645
|
* 集計中かどうかを返します。
|
|
@@ -4647,7 +4647,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4647
4647
|
* @returns 集計中なら true
|
|
4648
4648
|
*/
|
|
4649
4649
|
static isCollecting() {
|
|
4650
|
-
return
|
|
4650
|
+
return P.collecting && V.isEnabled();
|
|
4651
4651
|
}
|
|
4652
4652
|
/**
|
|
4653
4653
|
* 現在の集計結果スナップショットを返します。
|
|
@@ -4655,7 +4655,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4655
4655
|
* @returns エレメントごとの集計結果
|
|
4656
4656
|
*/
|
|
4657
4657
|
static snapshot() {
|
|
4658
|
-
return
|
|
4658
|
+
return P.ensureGlobalAccess(), [...P.ELEMENT_STORES.entries()].map(([e, t]) => ({
|
|
4659
4659
|
elementId: e,
|
|
4660
4660
|
tagName: t.tagName,
|
|
4661
4661
|
attributes: [...t.attributes.entries()].map(([r, i]) => ({
|
|
@@ -4664,7 +4664,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4664
4664
|
calls: i.calls,
|
|
4665
4665
|
totalDurationMs: i.totalDurationMs,
|
|
4666
4666
|
maxDurationMs: i.maxDurationMs,
|
|
4667
|
-
placeholders:
|
|
4667
|
+
placeholders: P.sortPlaceholders(
|
|
4668
4668
|
i.placeholders
|
|
4669
4669
|
)
|
|
4670
4670
|
})).sort((r, i) => i.calls - r.calls),
|
|
@@ -4674,7 +4674,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4674
4674
|
calls: i.calls,
|
|
4675
4675
|
totalDurationMs: i.totalDurationMs,
|
|
4676
4676
|
maxDurationMs: i.maxDurationMs,
|
|
4677
|
-
placeholders:
|
|
4677
|
+
placeholders: P.sortPlaceholders(
|
|
4678
4678
|
i.placeholders
|
|
4679
4679
|
)
|
|
4680
4680
|
})).sort((r, i) => i.calls - r.calls)
|
|
@@ -4698,7 +4698,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4698
4698
|
* @param limit 出力する宣言の数。既定は 20
|
|
4699
4699
|
* @returns 要約。合計は `limit` で絞る前の全件から求める
|
|
4700
4700
|
*/
|
|
4701
|
-
static report(e =
|
|
4701
|
+
static report(e = P.DEFAULT_REPORT_LIMIT) {
|
|
4702
4702
|
const t = /* @__PURE__ */ new Map();
|
|
4703
4703
|
let r = 0, i = 0;
|
|
4704
4704
|
const s = (l, u, d) => {
|
|
@@ -4722,7 +4722,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4722
4722
|
d.maxDurationMs
|
|
4723
4723
|
), d.totalDurationMs > y.representativeDurationMs && (y.where = u, y.representativeDurationMs = d.totalDurationMs);
|
|
4724
4724
|
};
|
|
4725
|
-
|
|
4725
|
+
P.snapshot().forEach((l) => {
|
|
4726
4726
|
l.attributes.forEach((u) => {
|
|
4727
4727
|
s(
|
|
4728
4728
|
`@${u.name}
|
|
@@ -4752,7 +4752,7 @@ ${u.template}`,
|
|
|
4752
4752
|
entryCount: n.length,
|
|
4753
4753
|
top: a
|
|
4754
4754
|
};
|
|
4755
|
-
return
|
|
4755
|
+
return P.logReport(o), o;
|
|
4756
4756
|
}
|
|
4757
4757
|
/**
|
|
4758
4758
|
* 要約を表形式でコンソールへ出力します。
|
|
@@ -4782,30 +4782,30 @@ ${u.template}`,
|
|
|
4782
4782
|
* @param expressions 今回評価した式一覧
|
|
4783
4783
|
*/
|
|
4784
4784
|
static record(e, t, r) {
|
|
4785
|
-
if (!V.isEnabled() || !e || t.length === 0 || (
|
|
4785
|
+
if (!V.isEnabled() || !e || t.length === 0 || (P.ensureGlobalAccess(), !P.isCollecting()))
|
|
4786
4786
|
return;
|
|
4787
|
-
const i =
|
|
4787
|
+
const i = P.getOrCreateElementStore(
|
|
4788
4788
|
e.element
|
|
4789
4789
|
);
|
|
4790
4790
|
if (e.kind === "attribute") {
|
|
4791
|
-
const n =
|
|
4791
|
+
const n = P.getOrCreateCounter(
|
|
4792
4792
|
i.attributes,
|
|
4793
4793
|
e.rawName,
|
|
4794
4794
|
e.template
|
|
4795
4795
|
);
|
|
4796
|
-
|
|
4796
|
+
P.updateCounter(
|
|
4797
4797
|
n,
|
|
4798
4798
|
t,
|
|
4799
4799
|
r
|
|
4800
4800
|
);
|
|
4801
4801
|
return;
|
|
4802
4802
|
}
|
|
4803
|
-
const s =
|
|
4803
|
+
const s = P.getOrCreateCounter(
|
|
4804
4804
|
i.texts,
|
|
4805
4805
|
String(e.childIndex),
|
|
4806
4806
|
e.template
|
|
4807
4807
|
);
|
|
4808
|
-
|
|
4808
|
+
P.updateCounter(
|
|
4809
4809
|
s,
|
|
4810
4810
|
t,
|
|
4811
4811
|
r
|
|
@@ -4818,12 +4818,12 @@ ${u.template}`,
|
|
|
4818
4818
|
if (!V.isEnabled())
|
|
4819
4819
|
return;
|
|
4820
4820
|
const e = globalThis;
|
|
4821
|
-
e[
|
|
4822
|
-
start: () =>
|
|
4823
|
-
stop: () =>
|
|
4824
|
-
reset: () =>
|
|
4825
|
-
snapshot: () =>
|
|
4826
|
-
report: (t) =>
|
|
4821
|
+
e[P.GLOBAL_KEY] === void 0 && (e[P.GLOBAL_KEY] = {
|
|
4822
|
+
start: () => P.start(),
|
|
4823
|
+
stop: () => P.stop(),
|
|
4824
|
+
reset: () => P.reset(),
|
|
4825
|
+
snapshot: () => P.snapshot(),
|
|
4826
|
+
report: (t) => P.report(t)
|
|
4827
4827
|
});
|
|
4828
4828
|
}
|
|
4829
4829
|
/**
|
|
@@ -4833,7 +4833,7 @@ ${u.template}`,
|
|
|
4833
4833
|
* @returns 集計ストア
|
|
4834
4834
|
*/
|
|
4835
4835
|
static getOrCreateElementStore(e) {
|
|
4836
|
-
const t =
|
|
4836
|
+
const t = P.createElementId(e), r = P.ELEMENT_STORES.get(t);
|
|
4837
4837
|
if (r)
|
|
4838
4838
|
return r;
|
|
4839
4839
|
const i = {
|
|
@@ -4841,7 +4841,7 @@ ${u.template}`,
|
|
|
4841
4841
|
attributes: /* @__PURE__ */ new Map(),
|
|
4842
4842
|
texts: /* @__PURE__ */ new Map()
|
|
4843
4843
|
};
|
|
4844
|
-
return
|
|
4844
|
+
return P.ELEMENT_STORES.set(t, i), i;
|
|
4845
4845
|
}
|
|
4846
4846
|
/**
|
|
4847
4847
|
* カウンタを取得または初期化します。
|
|
@@ -4891,7 +4891,7 @@ ${u.template}`,
|
|
|
4891
4891
|
*/
|
|
4892
4892
|
static updateCounter(e, t, r) {
|
|
4893
4893
|
e.calls += 1, e.totalDurationMs += r, e.maxDurationMs = Math.max(e.maxDurationMs, r), t.forEach((i) => {
|
|
4894
|
-
const s =
|
|
4894
|
+
const s = P.getOrCreatePlaceholder(
|
|
4895
4895
|
e.placeholders,
|
|
4896
4896
|
i.expression
|
|
4897
4897
|
);
|
|
@@ -4930,12 +4930,12 @@ ${u.template}`,
|
|
|
4930
4930
|
* @returns 結果と所要時間
|
|
4931
4931
|
*/
|
|
4932
4932
|
static measure(e) {
|
|
4933
|
-
if (!
|
|
4933
|
+
if (!P.isCollecting())
|
|
4934
4934
|
return { value: e(), durationMs: 0 };
|
|
4935
|
-
const t =
|
|
4935
|
+
const t = P.now();
|
|
4936
4936
|
return {
|
|
4937
4937
|
value: e(),
|
|
4938
|
-
durationMs:
|
|
4938
|
+
durationMs: P.now() - t
|
|
4939
4939
|
};
|
|
4940
4940
|
}
|
|
4941
4941
|
/**
|
|
@@ -4962,29 +4962,29 @@ ${u.template}`,
|
|
|
4962
4962
|
return t.join(" > ");
|
|
4963
4963
|
}
|
|
4964
4964
|
};
|
|
4965
|
-
|
|
4966
|
-
let
|
|
4967
|
-
const
|
|
4965
|
+
P.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", P.ELEMENT_STORES = /* @__PURE__ */ new Map(), P.collecting = !1, P.DEFAULT_REPORT_LIMIT = 20;
|
|
4966
|
+
let Ye = P;
|
|
4967
|
+
const ye = class ye {
|
|
4968
4968
|
/**
|
|
4969
4969
|
* フラグメントのコンストラクタ。
|
|
4970
4970
|
*
|
|
4971
4971
|
* @param target 対象ノード
|
|
4972
4972
|
*/
|
|
4973
4973
|
constructor(e) {
|
|
4974
|
-
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e,
|
|
4974
|
+
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e, ye.FRAGMENT_CACHE.set(e, this);
|
|
4975
4975
|
}
|
|
4976
4976
|
static get(e) {
|
|
4977
4977
|
if (e == null)
|
|
4978
4978
|
return null;
|
|
4979
|
-
if (
|
|
4980
|
-
return
|
|
4979
|
+
if (ye.FRAGMENT_CACHE.has(e))
|
|
4980
|
+
return ye.FRAGMENT_CACHE.get(e);
|
|
4981
4981
|
let t;
|
|
4982
4982
|
switch (e.nodeType) {
|
|
4983
4983
|
case Node.ELEMENT_NODE:
|
|
4984
4984
|
t = new R(e);
|
|
4985
4985
|
break;
|
|
4986
4986
|
case Node.TEXT_NODE:
|
|
4987
|
-
t = new
|
|
4987
|
+
t = new de(e);
|
|
4988
4988
|
break;
|
|
4989
4989
|
case Node.COMMENT_NODE:
|
|
4990
4990
|
t = new ot(e);
|
|
@@ -5005,7 +5005,7 @@ const pe = class pe {
|
|
|
5005
5005
|
* @returns キャッシュ済みのフラグメント。無ければ `null`
|
|
5006
5006
|
*/
|
|
5007
5007
|
static peek(e) {
|
|
5008
|
-
return
|
|
5008
|
+
return ye.FRAGMENT_CACHE.get(e) ?? null;
|
|
5009
5009
|
}
|
|
5010
5010
|
/**
|
|
5011
5011
|
* 指定した子ノードを、エンジン自身が出し入れしている最中かどうかを返します。
|
|
@@ -5044,7 +5044,7 @@ const pe = class pe {
|
|
|
5044
5044
|
return Promise.resolve();
|
|
5045
5045
|
if (this.parent) {
|
|
5046
5046
|
const e = this.parent, t = e.skipMutationNodes;
|
|
5047
|
-
return e.holdSkipMutationNode(this.target),
|
|
5047
|
+
return e.holdSkipMutationNode(this.target), J.enqueue(() => {
|
|
5048
5048
|
e.skipMutationNodes = !0, this.target.parentNode === e.getTarget() && e.getTarget().removeChild(this.target), this.mounted = !1;
|
|
5049
5049
|
}).finally(() => {
|
|
5050
5050
|
e.skipMutationNodes = t, e.releaseSkipMutationNode(this.target);
|
|
@@ -5052,7 +5052,7 @@ const pe = class pe {
|
|
|
5052
5052
|
} else {
|
|
5053
5053
|
const e = this.target.parentNode;
|
|
5054
5054
|
if (e)
|
|
5055
|
-
return
|
|
5055
|
+
return J.enqueue(() => {
|
|
5056
5056
|
this.target.parentNode === e && e.removeChild(this.target), this.mounted = !1;
|
|
5057
5057
|
});
|
|
5058
5058
|
this.mounted = !1;
|
|
@@ -5069,7 +5069,7 @@ const pe = class pe {
|
|
|
5069
5069
|
return Promise.resolve();
|
|
5070
5070
|
if (this.parent) {
|
|
5071
5071
|
const e = this.parent, t = e.skipMutationNodes;
|
|
5072
|
-
return e.holdSkipMutationNode(this.target),
|
|
5072
|
+
return e.holdSkipMutationNode(this.target), J.enqueue(() => {
|
|
5073
5073
|
e.skipMutationNodes = !0, this.target.parentNode !== e.getTarget() && e.getTarget().appendChild(this.target), this.mounted = !0;
|
|
5074
5074
|
}).finally(() => {
|
|
5075
5075
|
e.skipMutationNodes = t, e.releaseSkipMutationNode(this.target);
|
|
@@ -5100,7 +5100,7 @@ const pe = class pe {
|
|
|
5100
5100
|
* @return 除去のPromise
|
|
5101
5101
|
*/
|
|
5102
5102
|
remove(e = !0) {
|
|
5103
|
-
return this.parent && this.parent.removeChild(this),
|
|
5103
|
+
return this.parent && this.parent.removeChild(this), ye.FRAGMENT_CACHE.delete(this.target), e ? this.unmount() : Promise.resolve();
|
|
5104
5104
|
}
|
|
5105
5105
|
/**
|
|
5106
5106
|
* 対象ノードを取得します。
|
|
@@ -5127,8 +5127,8 @@ const pe = class pe {
|
|
|
5127
5127
|
this.parent = e;
|
|
5128
5128
|
}
|
|
5129
5129
|
};
|
|
5130
|
-
|
|
5131
|
-
let D =
|
|
5130
|
+
ye.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
5131
|
+
let D = ye;
|
|
5132
5132
|
const v = class v extends D {
|
|
5133
5133
|
/**
|
|
5134
5134
|
* エレメントフラグメントのコンストラクタ。
|
|
@@ -5140,7 +5140,7 @@ const v = class v extends D {
|
|
|
5140
5140
|
super(e), this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.bindingWorkChain = Promise.resolve(), this.bindingWorkActive = 0, this.lastSupplySequence = 0, this.lastResetSequence = 0, this.initialBindAttribute = null, this.derivedBindingData = null, this.bindingDataCache = null, this.descendantBindingDataCache = null, this.visible = !0, this.display = null, this.displayPriority = null, this.template = null, this.rowLocalTemplate = null, this.listKey = null, this.renderSignature = null, this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.freshInitializationSkippable = !1, this.initialized = !1, this.value = null, this.selfWritingAttributes = /* @__PURE__ */ new Map(), this.skipChangeValue = !1, this.valueWriteUnapplied = !1, this.pendingValueWrite = null, this.userEditSequence = 0, this.authoritativeValueSequence = 0, this.lastValueSequence = 0, this.lastValueKind = "nonSupply", this.selfWrittenBind = /* @__PURE__ */ new Map(), this.lastPathApplied = /* @__PURE__ */ new Map(), this.lastChangeSequence = 0, v.dropFollowUpArtifacts(e), this.syncValue(), this.initialBindAttribute = e.getAttribute(`${c.prefix}bind`), e.getAttributeNames().forEach((i) => {
|
|
5141
5141
|
const s = e.getAttribute(i);
|
|
5142
5142
|
if (s !== null && !this.attributeMap.has(i)) {
|
|
5143
|
-
const n = new
|
|
5143
|
+
const n = new Xe(i, s);
|
|
5144
5144
|
this.attributeMap.set(i, n);
|
|
5145
5145
|
}
|
|
5146
5146
|
});
|
|
@@ -5282,7 +5282,7 @@ const v = class v extends D {
|
|
|
5282
5282
|
*/
|
|
5283
5283
|
static dropIfVisibilityArtifacts(e) {
|
|
5284
5284
|
e.hasAttribute(`${c.prefix}if-false`) && (e.style.removeProperty("display"), e.getAttribute("style")?.trim() === "" && e.removeAttribute("style"), e.removeAttribute(`${c.prefix}if-false`), v.forEachFormControlInBranch(e, (t) => {
|
|
5285
|
-
t.hasAttribute(
|
|
5285
|
+
t.hasAttribute(ve) && (t.removeAttribute(ve), t.removeAttribute("disabled"));
|
|
5286
5286
|
}));
|
|
5287
5287
|
}
|
|
5288
5288
|
/**
|
|
@@ -5293,7 +5293,7 @@ const v = class v extends D {
|
|
|
5293
5293
|
*/
|
|
5294
5294
|
remove(e = !0) {
|
|
5295
5295
|
const t = [];
|
|
5296
|
-
return e &&
|
|
5296
|
+
return e && le.destroySubtree(this.getTarget()), this.getTarget().hasAttribute(`${c.prefix}external`) ? this.detachPreservingSubtree(e) : (this.children.slice().forEach((r) => {
|
|
5297
5297
|
t.push(r.remove(!1));
|
|
5298
5298
|
}), this.children.length = 0, this.attributeMap.clear(), this.bindingData = null, this.bindingDataCache = null, this.derivedBindingData = null, this.descendantBindingDataCache = null, this.template && (t.push(this.template.remove(!1)), this.template = null), this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.clearUnappliedValueWrite(), t.push(super.remove(e)), Promise.all(t).then(() => {
|
|
5299
5299
|
}));
|
|
@@ -5314,7 +5314,7 @@ const v = class v extends D {
|
|
|
5314
5314
|
* @returns 戻り値はありません。
|
|
5315
5315
|
*/
|
|
5316
5316
|
detachObserved() {
|
|
5317
|
-
|
|
5317
|
+
le.destroySubtree(this.getTarget());
|
|
5318
5318
|
const e = this.getParent();
|
|
5319
5319
|
e && e.removeChild(this);
|
|
5320
5320
|
}
|
|
@@ -5441,7 +5441,7 @@ const v = class v extends D {
|
|
|
5441
5441
|
* @returns 予約キーなら true
|
|
5442
5442
|
*/
|
|
5443
5443
|
static isReservedBindingKey(e) {
|
|
5444
|
-
return
|
|
5444
|
+
return re.isReservedBindingKey(e);
|
|
5445
5445
|
}
|
|
5446
5446
|
/**
|
|
5447
5447
|
* バインドデータ更新に伴う DOM 反映・再評価を、同一フラグメントでは呼出順
|
|
@@ -5769,7 +5769,7 @@ const v = class v extends D {
|
|
|
5769
5769
|
return Promise.resolve();
|
|
5770
5770
|
const i = this.getTarget();
|
|
5771
5771
|
if (i instanceof HTMLInputElement && i.type === "file")
|
|
5772
|
-
return e === null || e === "" ? (this.value = null, i.value === "" ? Promise.resolve() :
|
|
5772
|
+
return e === null || e === "" ? (this.value = null, i.value === "" ? Promise.resolve() : J.enqueue(() => {
|
|
5773
5773
|
i.value = "";
|
|
5774
5774
|
})) : (m.warn(
|
|
5775
5775
|
"[Haori]",
|
|
@@ -5886,7 +5886,7 @@ const v = class v extends D {
|
|
|
5886
5886
|
*/
|
|
5887
5887
|
enqueueValueWrite(e) {
|
|
5888
5888
|
this.skipChangeValue = !0;
|
|
5889
|
-
const t =
|
|
5889
|
+
const t = J.enqueue(e).finally(() => {
|
|
5890
5890
|
this.skipChangeValue = !1;
|
|
5891
5891
|
});
|
|
5892
5892
|
return this.pendingValueWrite = t, t;
|
|
@@ -5979,7 +5979,7 @@ const v = class v extends D {
|
|
|
5979
5979
|
* @returns 戻り値はありません。
|
|
5980
5980
|
*/
|
|
5981
5981
|
static notifyValueToEnhancers(e) {
|
|
5982
|
-
|
|
5982
|
+
le.isApplied(e) && le.refreshSubtree(e);
|
|
5983
5983
|
}
|
|
5984
5984
|
/**
|
|
5985
5985
|
* 「載らなかった書き込み」の記録を解除します。
|
|
@@ -6673,7 +6673,7 @@ const v = class v extends D {
|
|
|
6673
6673
|
const i = this.getTarget(), s = i.hasAttribute(e), n = t !== e && i.hasAttribute(t);
|
|
6674
6674
|
if (!s && !n)
|
|
6675
6675
|
return Promise.resolve();
|
|
6676
|
-
const a =
|
|
6676
|
+
const a = J.enqueue(() => {
|
|
6677
6677
|
s && i.removeAttribute(e), n && i.removeAttribute(t);
|
|
6678
6678
|
}).finally(() => {
|
|
6679
6679
|
this.releaseSelfWritingAttributes(r);
|
|
@@ -6715,15 +6715,15 @@ const v = class v extends D {
|
|
|
6715
6715
|
);
|
|
6716
6716
|
if (r === null)
|
|
6717
6717
|
return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
|
|
6718
|
-
const o = new
|
|
6718
|
+
const o = new Xe(e, r);
|
|
6719
6719
|
if (s) {
|
|
6720
|
-
const
|
|
6721
|
-
if (
|
|
6722
|
-
const
|
|
6720
|
+
const fe = this.attributeMap.get(e);
|
|
6721
|
+
if (fe && (fe.isEvaluate || fe.isForceEvaluation()) && !o.isEvaluate && !o.isForceEvaluation()) {
|
|
6722
|
+
const Ae = J.enqueue(() => {
|
|
6723
6723
|
}).finally(() => {
|
|
6724
6724
|
this.releaseSelfWritingAttributes(n);
|
|
6725
6725
|
});
|
|
6726
|
-
return this.holdSelfWritingAttributes(n,
|
|
6726
|
+
return this.holdSelfWritingAttributes(n, Ae), Ae;
|
|
6727
6727
|
}
|
|
6728
6728
|
}
|
|
6729
6729
|
this.attributeMap.set(e, o);
|
|
@@ -6732,49 +6732,49 @@ const v = class v extends D {
|
|
|
6732
6732
|
element: l,
|
|
6733
6733
|
rawName: e,
|
|
6734
6734
|
template: r
|
|
6735
|
-
}), d = v.isLateActionAttribute(e) ?
|
|
6735
|
+
}), d = v.isLateActionAttribute(e) ? re.withoutDiagnosis(u) : u(), y = o.isEvaluate || o.isRawEvaluate, b = e === t && v.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), E = o.isSingleExpression(), A = be.joinEvaluateResults(d.results), w = d.results.length === 1 ? d.results[0] : A, $ = t === "value" && v.resolveDeclaredValueType(l) === "boolean", C = w === !1 && !$, se = !o.isForceEvaluation() && (t !== e ? d.hasUnresolvedReference || w === null || w === void 0 || C : b ? d.hasUnresolvedReference || w === null || w === void 0 || w === !1 : E ? d.hasUnresolvedReference || w === null || w === void 0 || C : y && A === "");
|
|
6736
6736
|
if (se && d.hasUnresolvedReference && v.warnUnresolvedAttribute(
|
|
6737
6737
|
e,
|
|
6738
6738
|
t,
|
|
6739
6739
|
r,
|
|
6740
6740
|
l
|
|
6741
|
-
), V.isEnabled() &&
|
|
6742
|
-
const
|
|
6743
|
-
|
|
6741
|
+
), V.isEnabled() && w === !1 && E) {
|
|
6742
|
+
const fe = o.getSingleExpression(), Ae = fe === null ? null : re.diagnoseStrictComparison(
|
|
6743
|
+
fe,
|
|
6744
6744
|
this.getBindingData()
|
|
6745
6745
|
);
|
|
6746
|
-
|
|
6746
|
+
Ae !== null && v.warnTypeMismatchedComparison(
|
|
6747
6747
|
e,
|
|
6748
6748
|
r,
|
|
6749
|
-
|
|
6749
|
+
Ae,
|
|
6750
6750
|
l
|
|
6751
6751
|
);
|
|
6752
6752
|
}
|
|
6753
|
-
const F = o.isForceEvaluation() ? r : E ?
|
|
6754
|
-
|
|
6753
|
+
const F = o.isForceEvaluation() ? r : E ? w : A, Z = i && o.isEvaluate && t === "value" && v.isValuePropertyTarget(l), ee = l.getRootNode(), ne = this.userEditSequence, K = Z && v.isUserEditableValue(l) && (l === ee.activeElement || this.hasPendingUserEdit()), ae = se || F === null || F === !1 && !$ ? null : String(F), j = o.isEvaluate && ae !== null && v.URL_ATTRIBUTES.has(t) && Oe.hasScriptScheme(ae);
|
|
6754
|
+
j && m.warn(
|
|
6755
6755
|
"[Haori]",
|
|
6756
|
-
`Attribute "${t}" was removed because the evaluated URL uses a script scheme: ${e}="${r}" -> ${
|
|
6756
|
+
`Attribute "${t}" was removed because the evaluated URL uses a script scheme: ${e}="${r}" -> ${ae}`,
|
|
6757
6757
|
l
|
|
6758
6758
|
);
|
|
6759
|
-
const
|
|
6760
|
-
if (!
|
|
6761
|
-
return
|
|
6759
|
+
const k = j ? null : ae, B = e !== t && l.getAttribute(e) !== r, ue = k === null ? l.hasAttribute(t) : l.getAttribute(t) !== k, U = k === null ? "" : k, Q = Z && !K && l.value !== U, pe = t === "checked" && l instanceof HTMLInputElement && (l.type === "checkbox" || l.type === "radio"), ce = t === "selected" && l instanceof HTMLOptionElement, W = ee.activeElement, G = W !== null && (pe && l === W || ce && l.closest("select") === W) || (pe || ce) && this.hasPendingCheckableUserEdit(ce), ie = this.getCheckableUserEditSequence(ce), Ee = k !== null, _e = pe && o.isEvaluate && !G && l.checked !== Ee, Ve = ce && o.isEvaluate && !G && l.selected !== Ee;
|
|
6760
|
+
if (!B && !ue && !Q && !_e && !Ve)
|
|
6761
|
+
return Z && !K && (this.value = this.normalizeValueForElement(
|
|
6762
6762
|
l,
|
|
6763
|
-
|
|
6764
|
-
), this.clearUnappliedValueWrite()), (
|
|
6765
|
-
const ut =
|
|
6766
|
-
const
|
|
6763
|
+
U
|
|
6764
|
+
), this.clearUnappliedValueWrite()), (pe || ce) && !G && this.syncCheckableValueFromDom(ce), Promise.resolve();
|
|
6765
|
+
const ut = J.enqueue(() => {
|
|
6766
|
+
const fe = this.getCheckableUserEditSequence(ce) !== ie, Ae = ce && (G || fe) ? v.captureSelection(
|
|
6767
6767
|
// 守るべき選択があるのは所属する `<select>` があるときだけ。
|
|
6768
6768
|
l.closest(
|
|
6769
6769
|
"select"
|
|
6770
6770
|
)
|
|
6771
6771
|
) : null;
|
|
6772
|
-
|
|
6772
|
+
B && l.setAttribute(e, r), k === null ? l.removeAttribute(t) : ue && (l.setAttribute(t, k), t === `${c.prefix}bind` && this.recordSelfWrittenBind(k)), t === "style" && this.captureAndHideDisplay(), Ae?.(), Z && !K && !(v.isUserEditableValue(l) && this.isSupersededByUserEdit(ne)) && (this.value = this.normalizeValueForElement(
|
|
6773
6773
|
l,
|
|
6774
|
-
|
|
6775
|
-
),
|
|
6776
|
-
const _t = _e && !
|
|
6777
|
-
_t && (l.checked =
|
|
6774
|
+
U
|
|
6775
|
+
), Q && (l.value = U), this.recordValueWriteResult(l.value === U));
|
|
6776
|
+
const _t = _e && !fe, er = Ve && !fe;
|
|
6777
|
+
_t && (l.checked = Ee), er && (l.selected = Ee), (_e || Ve) && this.syncCheckableValueFromDom(Ve);
|
|
6778
6778
|
}).finally(() => {
|
|
6779
6779
|
this.releaseSelfWritingAttributes(n);
|
|
6780
6780
|
});
|
|
@@ -6797,7 +6797,7 @@ const v = class v extends D {
|
|
|
6797
6797
|
const t = this.getTarget();
|
|
6798
6798
|
if (!t.hasAttribute(e))
|
|
6799
6799
|
return Promise.resolve();
|
|
6800
|
-
const r =
|
|
6800
|
+
const r = J.enqueue(() => {
|
|
6801
6801
|
t.removeAttribute(e);
|
|
6802
6802
|
}).finally(() => {
|
|
6803
6803
|
this.releaseSelfWritingAttributes([e]);
|
|
@@ -6834,7 +6834,7 @@ const v = class v extends D {
|
|
|
6834
6834
|
value: r.results[0],
|
|
6835
6835
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
6836
6836
|
} : {
|
|
6837
|
-
value:
|
|
6837
|
+
value: be.joinEvaluateResults(r.results),
|
|
6838
6838
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
6839
6839
|
};
|
|
6840
6840
|
}
|
|
@@ -6936,7 +6936,7 @@ const v = class v extends D {
|
|
|
6936
6936
|
t,
|
|
6937
6937
|
r
|
|
6938
6938
|
), a = this.skipMutationNodes;
|
|
6939
|
-
return this.skipMutationNodes = !0, this.holdSkipMutationNode(e.getTarget()),
|
|
6939
|
+
return this.skipMutationNodes = !0, this.holdSkipMutationNode(e.getTarget()), J.enqueue(() => {
|
|
6940
6940
|
this.target.insertBefore(e.getTarget(), n);
|
|
6941
6941
|
}).finally(() => {
|
|
6942
6942
|
this.skipMutationNodes = a, this.releaseSkipMutationNode(e.getTarget());
|
|
@@ -7172,7 +7172,7 @@ const v = class v extends D {
|
|
|
7172
7172
|
*/
|
|
7173
7173
|
static disableFormControlsInBranch(e) {
|
|
7174
7174
|
v.forEachFormControlInBranch(e, (t) => {
|
|
7175
|
-
t.hasAttribute("disabled") || (t.setAttribute(
|
|
7175
|
+
t.hasAttribute("disabled") || (t.setAttribute(ve, ""), t.setAttribute("disabled", ""));
|
|
7176
7176
|
});
|
|
7177
7177
|
}
|
|
7178
7178
|
/**
|
|
@@ -7186,7 +7186,7 @@ const v = class v extends D {
|
|
|
7186
7186
|
*/
|
|
7187
7187
|
restoreFormControlsDisabledByIf() {
|
|
7188
7188
|
v.forEachFormControlInBranch(this.getTarget(), (e) => {
|
|
7189
|
-
e.hasAttribute(
|
|
7189
|
+
e.hasAttribute(ve) && (e.removeAttribute(ve), e.removeAttribute("disabled"));
|
|
7190
7190
|
});
|
|
7191
7191
|
}
|
|
7192
7192
|
/**
|
|
@@ -7276,7 +7276,7 @@ v.NUMBER_INPUT_PATTERN = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/, v.VALUE
|
|
|
7276
7276
|
"^.+-(?:dialog|toast|toast-level|history|scroll|redirect|redirect-replace|redirect-return-param)$"
|
|
7277
7277
|
);
|
|
7278
7278
|
let R = v;
|
|
7279
|
-
class
|
|
7279
|
+
class de extends D {
|
|
7280
7280
|
/**
|
|
7281
7281
|
* テキストフラグメントのコンストラクタ。
|
|
7282
7282
|
* 対象テキストノードの内容を初期化します。
|
|
@@ -7284,7 +7284,7 @@ class ce extends D {
|
|
|
7284
7284
|
* @param target 対象テキストノード
|
|
7285
7285
|
*/
|
|
7286
7286
|
constructor(e) {
|
|
7287
|
-
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new
|
|
7287
|
+
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new be(this.text);
|
|
7288
7288
|
}
|
|
7289
7289
|
/**
|
|
7290
7290
|
* フラグメントをクローンします。
|
|
@@ -7292,7 +7292,7 @@ class ce extends D {
|
|
|
7292
7292
|
* @returns クローンされたフラグメント
|
|
7293
7293
|
*/
|
|
7294
7294
|
clone() {
|
|
7295
|
-
const e = new
|
|
7295
|
+
const e = new de(this.target.cloneNode(!0));
|
|
7296
7296
|
return e.mounted = !1, e.text = this.text, e.contents = this.contents, e.renderedText = this.renderedText, e;
|
|
7297
7297
|
}
|
|
7298
7298
|
/**
|
|
@@ -7329,7 +7329,7 @@ class ce extends D {
|
|
|
7329
7329
|
* @returns 更新のPromise
|
|
7330
7330
|
*/
|
|
7331
7331
|
setContent(e) {
|
|
7332
|
-
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new
|
|
7332
|
+
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new be(e), this.evaluate());
|
|
7333
7333
|
}
|
|
7334
7334
|
/**
|
|
7335
7335
|
* フラグメントを評価します。
|
|
@@ -7342,10 +7342,10 @@ class ce extends D {
|
|
|
7342
7342
|
new Error("Parent fragment is required for raw evaluation")
|
|
7343
7343
|
);
|
|
7344
7344
|
let e = null;
|
|
7345
|
-
return
|
|
7345
|
+
return J.enqueue(() => {
|
|
7346
7346
|
this.skipMutation = !0;
|
|
7347
7347
|
let t = this.text;
|
|
7348
|
-
this.contents.isEvaluate && (t =
|
|
7348
|
+
this.contents.isEvaluate && (t = be.joinEvaluateResults(
|
|
7349
7349
|
this.contents.evaluate(this.parent.getBindingData(), {
|
|
7350
7350
|
kind: "text",
|
|
7351
7351
|
element: this.parent.getTarget(),
|
|
@@ -7394,14 +7394,14 @@ class ot extends D {
|
|
|
7394
7394
|
* @return 更新のPromise
|
|
7395
7395
|
*/
|
|
7396
7396
|
setContent(e) {
|
|
7397
|
-
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e,
|
|
7397
|
+
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, J.enqueue(() => {
|
|
7398
7398
|
this.skipMutation = !0, this.target.textContent = this.text;
|
|
7399
7399
|
}).finally(() => {
|
|
7400
7400
|
this.skipMutation = !1;
|
|
7401
7401
|
}));
|
|
7402
7402
|
}
|
|
7403
7403
|
}
|
|
7404
|
-
const
|
|
7404
|
+
const Je = class Je {
|
|
7405
7405
|
/**
|
|
7406
7406
|
* コンストラクタ。
|
|
7407
7407
|
*
|
|
@@ -7417,7 +7417,7 @@ const Xe = class Xe {
|
|
|
7417
7417
|
});
|
|
7418
7418
|
return;
|
|
7419
7419
|
}
|
|
7420
|
-
const r = [...e.matchAll(
|
|
7420
|
+
const r = [...e.matchAll(Je.PLACEHOLDER_REGEX)];
|
|
7421
7421
|
let i = 0, s = !1, n = !1;
|
|
7422
7422
|
for (const a of r) {
|
|
7423
7423
|
a.index > i && this.contents.push({
|
|
@@ -7522,8 +7522,8 @@ const Xe = class Xe {
|
|
|
7522
7522
|
return this.contents.forEach((l) => {
|
|
7523
7523
|
try {
|
|
7524
7524
|
if (r(l)) {
|
|
7525
|
-
const u =
|
|
7526
|
-
() =>
|
|
7525
|
+
const u = Ye.measure(
|
|
7526
|
+
() => re.evaluateDetailed(l.text, e)
|
|
7527
7527
|
), d = u.value;
|
|
7528
7528
|
a += u.durationMs, n.push({
|
|
7529
7529
|
expression: l.text,
|
|
@@ -7541,16 +7541,16 @@ const Xe = class Xe {
|
|
|
7541
7541
|
durationMs: 0
|
|
7542
7542
|
}), s.push("");
|
|
7543
7543
|
}
|
|
7544
|
-
}),
|
|
7544
|
+
}), Ye.record(
|
|
7545
7545
|
t,
|
|
7546
7546
|
n,
|
|
7547
7547
|
a
|
|
7548
7548
|
), { results: s, hasUnresolvedReference: o };
|
|
7549
7549
|
}
|
|
7550
7550
|
};
|
|
7551
|
-
|
|
7552
|
-
let
|
|
7553
|
-
const
|
|
7551
|
+
Je.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
|
|
7552
|
+
let be = Je;
|
|
7553
|
+
const _ = class _ extends be {
|
|
7554
7554
|
/**
|
|
7555
7555
|
* コンストラクタ。
|
|
7556
7556
|
*
|
|
@@ -7558,8 +7558,8 @@ const Q = class Q extends ge {
|
|
|
7558
7558
|
* @param text 属性値
|
|
7559
7559
|
*/
|
|
7560
7560
|
constructor(e, t) {
|
|
7561
|
-
const r =
|
|
7562
|
-
super(t, e === `${c.prefix}bind` || r), this.name = e, this.forceEvaluation =
|
|
7561
|
+
const r = _.isEventHandlerAttribute(e);
|
|
7562
|
+
super(t, e === `${c.prefix}bind` || r), this.name = e, this.forceEvaluation = _.needsForceEvaluation(e), this.checksUrlPath = _.isRequestUrlAttribute(e), r && V.isEnabled() && t.includes("{{") && _.warnEventHandlerPlaceholder(e, t);
|
|
7563
7563
|
}
|
|
7564
7564
|
/**
|
|
7565
7565
|
* イベントハンドラ属性(名前が `on` で始まる属性と `data-attr-on*`)かどうかを
|
|
@@ -7590,7 +7590,7 @@ const Q = class Q extends ge {
|
|
|
7590
7590
|
*/
|
|
7591
7591
|
static warnEventHandlerPlaceholder(e, t) {
|
|
7592
7592
|
const r = `${e}\0${t}`;
|
|
7593
|
-
|
|
7593
|
+
_.WARNED_EVENT_HANDLER_PLACEHOLDERS.has(r) || (_.WARNED_EVENT_HANDLER_PLACEHOLDERS.add(r), m.warn(
|
|
7594
7594
|
"[Haori]",
|
|
7595
7595
|
`Placeholders in event handler attributes are not evaluated: ${e}="${t}". Use ${c.prefix}{event}-run, or read the bound value inside the called function.`
|
|
7596
7596
|
));
|
|
@@ -7610,9 +7610,9 @@ const Q = class Q extends ge {
|
|
|
7610
7610
|
const n = String(e[s]);
|
|
7611
7611
|
if (i.type === 0)
|
|
7612
7612
|
t = !0;
|
|
7613
|
-
else if (t && !/[?#]/.test(r) &&
|
|
7613
|
+
else if (t && !/[?#]/.test(r) && _.changesUrlPath(n)) {
|
|
7614
7614
|
const a = `${this.name}\0${this.getValue()}\0${n}`;
|
|
7615
|
-
|
|
7615
|
+
_.WARNED_URL_PATH_VALUES.has(a) || (_.WARNED_URL_PATH_VALUES.add(a), m.warn(
|
|
7616
7616
|
"[Haori]",
|
|
7617
7617
|
`A value embedded in the URL path is not URL-encoded and changes the request path: ${this.name}="${this.getValue()}", value: ${n}. Encode it with encodeURIComponent, or send it as a query.`
|
|
7618
7618
|
));
|
|
@@ -7640,17 +7640,17 @@ const Q = class Q extends ge {
|
|
|
7640
7640
|
* @returns 強制評価の対象なら true
|
|
7641
7641
|
*/
|
|
7642
7642
|
static needsForceEvaluation(e) {
|
|
7643
|
-
if (
|
|
7643
|
+
if (_.forceEvaluationNames === null || _.forceEvaluationPrefix !== c.prefix) {
|
|
7644
7644
|
const t = /* @__PURE__ */ new Set();
|
|
7645
7645
|
for (const r of [
|
|
7646
7646
|
c.prefix,
|
|
7647
|
-
...
|
|
7647
|
+
..._.FORCE_EVALUATION_PREFIXES
|
|
7648
7648
|
])
|
|
7649
|
-
for (const i of
|
|
7649
|
+
for (const i of _.FORCE_EVALUATION_SUFFIXES)
|
|
7650
7650
|
t.add(`${r}${i}`);
|
|
7651
|
-
|
|
7651
|
+
_.forceEvaluationNames = t, _.forceEvaluationPrefix = c.prefix;
|
|
7652
7652
|
}
|
|
7653
|
-
return
|
|
7653
|
+
return _.forceEvaluationNames.has(e);
|
|
7654
7654
|
}
|
|
7655
7655
|
/**
|
|
7656
7656
|
* 強制評価フラグを取得します。
|
|
@@ -7697,12 +7697,12 @@ const Q = class Q extends ge {
|
|
|
7697
7697
|
}) : r;
|
|
7698
7698
|
}
|
|
7699
7699
|
};
|
|
7700
|
-
|
|
7701
|
-
let
|
|
7700
|
+
_.FORCE_EVALUATION_SUFFIXES = ["if", "each", "derive"], _.FORCE_EVALUATION_PREFIXES = ["data-", "hor-"], _.forceEvaluationNames = null, _.forceEvaluationPrefix = null, _.WARNED_EVENT_HANDLER_PLACEHOLDERS = /* @__PURE__ */ new Set(), _.WARNED_URL_PATH_VALUES = /* @__PURE__ */ new Set();
|
|
7701
|
+
let Xe = _;
|
|
7702
7702
|
const vt = "[Haori]", wt = {
|
|
7703
7703
|
nameRequired: "Handler name is required.",
|
|
7704
7704
|
notFunction: (f) => `Handler "${f}" must be a function.`
|
|
7705
|
-
},
|
|
7705
|
+
}, Te = class Te {
|
|
7706
7706
|
/**
|
|
7707
7707
|
* 関数を登録します。同じ名前で登録し直すと置き換えます。
|
|
7708
7708
|
*
|
|
@@ -7720,7 +7720,7 @@ const vt = "[Haori]", wt = {
|
|
|
7720
7720
|
m.error(vt, wt.notFunction(r));
|
|
7721
7721
|
return;
|
|
7722
7722
|
}
|
|
7723
|
-
|
|
7723
|
+
Te.handlers.set(r, t);
|
|
7724
7724
|
}
|
|
7725
7725
|
/**
|
|
7726
7726
|
* 登録した関数かどうかを返します。
|
|
@@ -7729,7 +7729,7 @@ const vt = "[Haori]", wt = {
|
|
|
7729
7729
|
* @returns 登録してあれば true
|
|
7730
7730
|
*/
|
|
7731
7731
|
static has(e) {
|
|
7732
|
-
return
|
|
7732
|
+
return Te.handlers.has(e);
|
|
7733
7733
|
}
|
|
7734
7734
|
/**
|
|
7735
7735
|
* 登録した関数を返します。
|
|
@@ -7738,7 +7738,7 @@ const vt = "[Haori]", wt = {
|
|
|
7738
7738
|
* @returns 関数。登録していなければ undefined
|
|
7739
7739
|
*/
|
|
7740
7740
|
static get(e) {
|
|
7741
|
-
return
|
|
7741
|
+
return Te.handlers.get(e);
|
|
7742
7742
|
}
|
|
7743
7743
|
/**
|
|
7744
7744
|
* 登録した関数をすべて返します(式のスコープへ載せるため)。
|
|
@@ -7746,12 +7746,12 @@ const vt = "[Haori]", wt = {
|
|
|
7746
7746
|
* @returns 名前 → 関数
|
|
7747
7747
|
*/
|
|
7748
7748
|
static entries() {
|
|
7749
|
-
return Object.fromEntries(
|
|
7749
|
+
return Object.fromEntries(Te.handlers);
|
|
7750
7750
|
}
|
|
7751
7751
|
};
|
|
7752
|
-
|
|
7753
|
-
let
|
|
7754
|
-
const
|
|
7752
|
+
Te.handlers = /* @__PURE__ */ new Map();
|
|
7753
|
+
let De = Te;
|
|
7754
|
+
const ke = class ke {
|
|
7755
7755
|
/**
|
|
7756
7756
|
* 実行モードを取得します。
|
|
7757
7757
|
*
|
|
@@ -7802,7 +7802,7 @@ const Se = class Se {
|
|
|
7802
7802
|
* @return すべてのレンダリングが完了したら解決される Promise
|
|
7803
7803
|
*/
|
|
7804
7804
|
static waitForRenders() {
|
|
7805
|
-
return
|
|
7805
|
+
return J.waitForIdle();
|
|
7806
7806
|
}
|
|
7807
7807
|
/**
|
|
7808
7808
|
* 通知ダイアログを表示します。
|
|
@@ -7811,7 +7811,7 @@ const Se = class Se {
|
|
|
7811
7811
|
* @returns 通知が閉じられると解決されるPromise
|
|
7812
7812
|
*/
|
|
7813
7813
|
static dialog(e) {
|
|
7814
|
-
return
|
|
7814
|
+
return J.enqueue(() => {
|
|
7815
7815
|
window.alert(e);
|
|
7816
7816
|
}, !0);
|
|
7817
7817
|
}
|
|
@@ -7839,7 +7839,7 @@ const Se = class Se {
|
|
|
7839
7839
|
* @returns ユーザーがOKをクリックした場合はtrue、キャンセルした場合はfalseが解決されるPromise
|
|
7840
7840
|
*/
|
|
7841
7841
|
static confirm(e) {
|
|
7842
|
-
return
|
|
7842
|
+
return J.enqueue(() => window.confirm(e), !0);
|
|
7843
7843
|
}
|
|
7844
7844
|
/**
|
|
7845
7845
|
* ダイアログを開きます。
|
|
@@ -7847,8 +7847,8 @@ const Se = class Se {
|
|
|
7847
7847
|
* @param element 開くダイアログのHTML要素
|
|
7848
7848
|
*/
|
|
7849
7849
|
static openDialog(e) {
|
|
7850
|
-
return
|
|
7851
|
-
e instanceof HTMLDialogElement ? (
|
|
7850
|
+
return J.enqueue(() => {
|
|
7851
|
+
e instanceof HTMLDialogElement ? (ke.clearMessagesSync(e), e.showModal()) : m.error("[Haori]", "Element is not a dialog: ", e);
|
|
7852
7852
|
}, !0);
|
|
7853
7853
|
}
|
|
7854
7854
|
/**
|
|
@@ -7857,7 +7857,7 @@ const Se = class Se {
|
|
|
7857
7857
|
* @param element 閉じるダイアログのHTML要素
|
|
7858
7858
|
*/
|
|
7859
7859
|
static closeDialog(e) {
|
|
7860
|
-
return
|
|
7860
|
+
return J.enqueue(() => {
|
|
7861
7861
|
e instanceof HTMLDialogElement ? e.close() : m.error("[Haori]", "Element is not a dialog: ", e);
|
|
7862
7862
|
}, !0);
|
|
7863
7863
|
}
|
|
@@ -7868,7 +7868,7 @@ const Se = class Se {
|
|
|
7868
7868
|
* @param message エラーメッセージ
|
|
7869
7869
|
*/
|
|
7870
7870
|
static addErrorMessage(e, t) {
|
|
7871
|
-
return
|
|
7871
|
+
return ke.addMessage(e, t, "error");
|
|
7872
7872
|
}
|
|
7873
7873
|
/**
|
|
7874
7874
|
* メッセージをレベル付きで追加します。
|
|
@@ -7878,7 +7878,7 @@ const Se = class Se {
|
|
|
7878
7878
|
* @param level メッセージのレベル(省略可能)
|
|
7879
7879
|
*/
|
|
7880
7880
|
static addMessage(e, t, r) {
|
|
7881
|
-
return
|
|
7881
|
+
return J.enqueue(() => {
|
|
7882
7882
|
const i = e instanceof HTMLFormElement ? e : e.parentElement ?? e;
|
|
7883
7883
|
i.setAttribute("data-message", t), r !== void 0 ? i.setAttribute("data-message-level", r) : i.removeAttribute("data-message-level");
|
|
7884
7884
|
}, !0);
|
|
@@ -7892,8 +7892,8 @@ const Se = class Se {
|
|
|
7892
7892
|
* @param parent メッセージをクリアする親要素
|
|
7893
7893
|
*/
|
|
7894
7894
|
static clearMessages(e) {
|
|
7895
|
-
return
|
|
7896
|
-
!(e instanceof HTMLFormElement) && e.parentElement && (e.parentElement.removeAttribute("data-message"), e.parentElement.removeAttribute("data-message-level")),
|
|
7895
|
+
return J.enqueue(() => {
|
|
7896
|
+
!(e instanceof HTMLFormElement) && e.parentElement && (e.parentElement.removeAttribute("data-message"), e.parentElement.removeAttribute("data-message-level")), ke.clearMessagesSync(e);
|
|
7897
7897
|
}, !0);
|
|
7898
7898
|
}
|
|
7899
7899
|
/**
|
|
@@ -7920,7 +7920,7 @@ const Se = class Se {
|
|
|
7920
7920
|
* @returns 整形済み文字列。整形できない場合は空文字
|
|
7921
7921
|
*/
|
|
7922
7922
|
static date(e, t, r) {
|
|
7923
|
-
return
|
|
7923
|
+
return Ze(e, t, r);
|
|
7924
7924
|
}
|
|
7925
7925
|
/**
|
|
7926
7926
|
* 現在日時を指定フォーマットの文字列へ整形します。
|
|
@@ -7933,7 +7933,7 @@ const Se = class Se {
|
|
|
7933
7933
|
* @returns 整形済みの現在日時文字列
|
|
7934
7934
|
*/
|
|
7935
7935
|
static now(e, t) {
|
|
7936
|
-
return
|
|
7936
|
+
return Mt(e, t);
|
|
7937
7937
|
}
|
|
7938
7938
|
/**
|
|
7939
7939
|
* 現在日付に日数を加減した日付を指定フォーマットの文字列へ整形します。
|
|
@@ -7997,7 +7997,7 @@ const Se = class Se {
|
|
|
7997
7997
|
* @returns 加算後の年月(`YYYY-MM` 形式)。不正な入力は空文字
|
|
7998
7998
|
*/
|
|
7999
7999
|
static monthAdd(e, t) {
|
|
8000
|
-
return
|
|
8000
|
+
return Qe(e, t);
|
|
8001
8001
|
}
|
|
8002
8002
|
/**
|
|
8003
8003
|
* 基準月から過去方向へ `count + 1` 個の年月配列を降順で返します。
|
|
@@ -8077,7 +8077,7 @@ const Se = class Se {
|
|
|
8077
8077
|
return Kt(e, t);
|
|
8078
8078
|
}
|
|
8079
8079
|
};
|
|
8080
|
-
|
|
8080
|
+
ke.handlers = {
|
|
8081
8081
|
/**
|
|
8082
8082
|
* 関数を登録します。
|
|
8083
8083
|
*
|
|
@@ -8086,7 +8086,7 @@ Se.handlers = {
|
|
|
8086
8086
|
* @return 戻り値はありません。
|
|
8087
8087
|
*/
|
|
8088
8088
|
register(e, t) {
|
|
8089
|
-
|
|
8089
|
+
De.register(e, t);
|
|
8090
8090
|
},
|
|
8091
8091
|
/**
|
|
8092
8092
|
* 登録した関数かどうかを返します。
|
|
@@ -8095,9 +8095,9 @@ Se.handlers = {
|
|
|
8095
8095
|
* @return 登録してあれば true
|
|
8096
8096
|
*/
|
|
8097
8097
|
has(e) {
|
|
8098
|
-
return
|
|
8098
|
+
return De.has(e);
|
|
8099
8099
|
}
|
|
8100
|
-
},
|
|
8100
|
+
}, ke.enhancers = {
|
|
8101
8101
|
/**
|
|
8102
8102
|
* 外部ライブラリ連携を登録します。
|
|
8103
8103
|
*
|
|
@@ -8106,7 +8106,7 @@ Se.handlers = {
|
|
|
8106
8106
|
* @return 戻り値はありません。
|
|
8107
8107
|
*/
|
|
8108
8108
|
register(e, t) {
|
|
8109
|
-
|
|
8109
|
+
le.register(e, t);
|
|
8110
8110
|
},
|
|
8111
8111
|
/**
|
|
8112
8112
|
* 登録済みの連携かどうかを返します。
|
|
@@ -8115,16 +8115,16 @@ Se.handlers = {
|
|
|
8115
8115
|
* @return 登録済みなら true
|
|
8116
8116
|
*/
|
|
8117
8117
|
has(e) {
|
|
8118
|
-
return
|
|
8118
|
+
return le.has(e);
|
|
8119
8119
|
}
|
|
8120
8120
|
};
|
|
8121
|
-
let
|
|
8121
|
+
let xe = ke;
|
|
8122
8122
|
const yr = "入力内容を確認してください", br = ["addErrorMessage", "clearMessages"], St = "data-haori-group-name";
|
|
8123
8123
|
function Rt() {
|
|
8124
8124
|
const e = globalThis.window?.Haori;
|
|
8125
8125
|
return br.every(
|
|
8126
8126
|
(r) => typeof e?.[r] == "function"
|
|
8127
|
-
) ? e :
|
|
8127
|
+
) ? e : xe;
|
|
8128
8128
|
}
|
|
8129
8129
|
const p = class p {
|
|
8130
8130
|
/**
|
|
@@ -9075,7 +9075,7 @@ const p = class p {
|
|
|
9075
9075
|
r.setCustomValidity("");
|
|
9076
9076
|
return;
|
|
9077
9077
|
}
|
|
9078
|
-
const s = p.buildConditionScope(e), n =
|
|
9078
|
+
const s = p.buildConditionScope(e), n = re.evaluateDetailed(
|
|
9079
9079
|
p.unwrapConditionExpression(i),
|
|
9080
9080
|
s
|
|
9081
9081
|
);
|
|
@@ -9363,7 +9363,7 @@ const p = class p {
|
|
|
9363
9363
|
static createRowKeyIndexes(e, t) {
|
|
9364
9364
|
const r = /* @__PURE__ */ new Map();
|
|
9365
9365
|
return e.forEach((i, s) => {
|
|
9366
|
-
const n =
|
|
9366
|
+
const n = M.createListKey(
|
|
9367
9367
|
i,
|
|
9368
9368
|
t,
|
|
9369
9369
|
s
|
|
@@ -9543,7 +9543,7 @@ const p = class p {
|
|
|
9543
9543
|
const s = { ...i };
|
|
9544
9544
|
for (const n of t)
|
|
9545
9545
|
delete s[n];
|
|
9546
|
-
return
|
|
9546
|
+
return M.setBindingData(e.getTarget(), s, {
|
|
9547
9547
|
kind: r?.kind ?? "supply",
|
|
9548
9548
|
sequence: r?.sequence ?? R.nextSequence()
|
|
9549
9549
|
});
|
|
@@ -9849,44 +9849,44 @@ const p = class p {
|
|
|
9849
9849
|
return Promise.resolve();
|
|
9850
9850
|
const l = p.resolveFieldName(e), u = e.getAttribute(`${c.prefix}form-object`), d = e.getAttribute(`${c.prefix}form-list`), y = e.hasAttribute(`${c.prefix}form-list`);
|
|
9851
9851
|
if (l) {
|
|
9852
|
-
const b = t[String(l)], E = s &&
|
|
9852
|
+
const b = t[String(l)], E = s && re.withoutDiagnosis(
|
|
9853
9853
|
() => p.hasResolvedDeclarativeState(e)
|
|
9854
9854
|
), A = s && typeof b > "u" && !p.isDeclarativeStateBound(e);
|
|
9855
|
-
let
|
|
9856
|
-
if (E ?
|
|
9857
|
-
return (
|
|
9855
|
+
let w = b;
|
|
9856
|
+
if (E ? w = void 0 : A && (w = null), p.isFileInput(e))
|
|
9857
|
+
return (w === null || w === "") && o.push(
|
|
9858
9858
|
p.applyFragmentValue(e, null, i, a)
|
|
9859
9859
|
), Promise.all(o).then(() => {
|
|
9860
9860
|
});
|
|
9861
|
-
if (y && Array.isArray(
|
|
9861
|
+
if (y && Array.isArray(w) && // チェックボックスグループと複数選択 select は配列そのものを状態として
|
|
9862
9862
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
9863
9863
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
9864
9864
|
!p.isGroupedCheckable(e) && !p.isMultipleSelect(e)) {
|
|
9865
|
-
const
|
|
9866
|
-
n.set(C
|
|
9865
|
+
const $ = String(l), C = n.get($) ?? 0;
|
|
9866
|
+
n.set($, C + 1), o.push(
|
|
9867
9867
|
p.applyFragmentValue(
|
|
9868
9868
|
e,
|
|
9869
|
-
|
|
9869
|
+
w[C] ?? null,
|
|
9870
9870
|
i,
|
|
9871
9871
|
a
|
|
9872
9872
|
)
|
|
9873
9873
|
);
|
|
9874
|
-
} else typeof
|
|
9874
|
+
} else typeof w > "u" || (Array.isArray(w) && p.isGroupedCheckable(e) || Array.isArray(w) && p.isMultipleSelect(e) || typeof w == "string" || typeof w == "number" || typeof w == "boolean" || w === null || Array.isArray(w) && e.collectsLines() ? o.push(
|
|
9875
9875
|
p.applyFragmentValue(
|
|
9876
9876
|
e,
|
|
9877
|
-
|
|
9877
|
+
w,
|
|
9878
9878
|
i,
|
|
9879
9879
|
a
|
|
9880
9880
|
)
|
|
9881
9881
|
) : o.push(
|
|
9882
|
-
p.applyFragmentValue(e, String(
|
|
9882
|
+
p.applyFragmentValue(e, String(w), i, a)
|
|
9883
9883
|
));
|
|
9884
9884
|
} else if (u) {
|
|
9885
9885
|
const b = t[String(u)], E = b && typeof b == "object" ? b : {}, A = /* @__PURE__ */ new Map();
|
|
9886
|
-
for (const
|
|
9886
|
+
for (const w of e.getChildElementFragments())
|
|
9887
9887
|
o.push(
|
|
9888
9888
|
p.setPartValues(
|
|
9889
|
-
|
|
9889
|
+
w,
|
|
9890
9890
|
E,
|
|
9891
9891
|
r,
|
|
9892
9892
|
i,
|
|
@@ -9896,13 +9896,13 @@ const p = class p {
|
|
|
9896
9896
|
)
|
|
9897
9897
|
);
|
|
9898
9898
|
} else if (d) {
|
|
9899
|
-
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(),
|
|
9899
|
+
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(), w = e.getAttribute(`${c.prefix}each-key`), $ = p.isCollectedListFromEachSource(e) ? p.pairRowsWithItems(
|
|
9900
9900
|
A,
|
|
9901
9901
|
E,
|
|
9902
|
-
|
|
9902
|
+
w == null ? null : String(w)
|
|
9903
9903
|
) : null;
|
|
9904
|
-
for (let
|
|
9905
|
-
const se = A[
|
|
9904
|
+
for (let C = 0; C < A.length; C++) {
|
|
9905
|
+
const se = A[C], F = $ ? $[C] : E.length > C ? E[C] : null;
|
|
9906
9906
|
o.push(
|
|
9907
9907
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
9908
9908
|
p.setPartValues(
|
|
@@ -9951,10 +9951,10 @@ const p = class p {
|
|
|
9951
9951
|
const r = p.collectBindingTargetForms(e);
|
|
9952
9952
|
if (r.length > 0 && r.every((s) => s.isSupplyStale(t)))
|
|
9953
9953
|
return;
|
|
9954
|
-
p.markResetSubtree(e, t),
|
|
9954
|
+
p.markResetSubtree(e, t), M.clearUserEditMarks(e, t), p.clearValues(e), await Promise.all([
|
|
9955
9955
|
p.clearMessages(e),
|
|
9956
9956
|
p.clearEachClones(e)
|
|
9957
|
-
]), await
|
|
9957
|
+
]), await J.enqueue(() => {
|
|
9958
9958
|
const s = p.collectEditsAfter(
|
|
9959
9959
|
e,
|
|
9960
9960
|
t
|
|
@@ -9965,16 +9965,16 @@ const p = class p {
|
|
|
9965
9965
|
} finally {
|
|
9966
9966
|
p.internalResetDepth -= 1;
|
|
9967
9967
|
}
|
|
9968
|
-
p.clearDeclarativeStateFromDom(e),
|
|
9968
|
+
p.clearDeclarativeStateFromDom(e), M.invalidateDerivedSubtreeSignatures(e), p.restoreEdits(s);
|
|
9969
9969
|
});
|
|
9970
9970
|
const i = r;
|
|
9971
9971
|
for (const s of i) {
|
|
9972
9972
|
const n = p.getInitialBindingData(s);
|
|
9973
|
-
n === null && s.getRawBindingData() === null || await
|
|
9973
|
+
n === null && s.getRawBindingData() === null || await M.setBindingData(s.getTarget(), n ?? {}, {
|
|
9974
9974
|
sequence: t
|
|
9975
9975
|
});
|
|
9976
9976
|
}
|
|
9977
|
-
p.syncValuesFromDom(e), await
|
|
9977
|
+
p.syncValuesFromDom(e), await M.evaluateAll(e);
|
|
9978
9978
|
for (const s of i)
|
|
9979
9979
|
p.getInitialBindingData(s) !== null || s.getRawBindingData() !== null || await p.restoreAncestorArgValues(s, {
|
|
9980
9980
|
sequence: t,
|
|
@@ -9994,11 +9994,11 @@ const p = class p {
|
|
|
9994
9994
|
));
|
|
9995
9995
|
} else
|
|
9996
9996
|
l = p.mergeCollectedValues(l, a), p.deleteAncestorOwnedKeys(s, n, l);
|
|
9997
|
-
await
|
|
9997
|
+
await M.setBindingData(s.getTarget(), l, {
|
|
9998
9998
|
sequence: t
|
|
9999
9999
|
});
|
|
10000
10000
|
}
|
|
10001
|
-
|
|
10001
|
+
le.refreshSubtree(e.getTarget());
|
|
10002
10002
|
}
|
|
10003
10003
|
/**
|
|
10004
10004
|
* 祖先が所有するキーを、リセットの書き込み対象から落とします。
|
|
@@ -10022,7 +10022,7 @@ const p = class p {
|
|
|
10022
10022
|
*/
|
|
10023
10023
|
static getInitialBindingData(e) {
|
|
10024
10024
|
const t = e.getInitialBindAttribute();
|
|
10025
|
-
return t === null ? null :
|
|
10025
|
+
return t === null ? null : M.parseDataBind(t);
|
|
10026
10026
|
}
|
|
10027
10027
|
/**
|
|
10028
10028
|
* フラグメント配下の入力要素について、内部値を現在の DOM 値と再同期します。
|
|
@@ -10305,7 +10305,7 @@ p.INITIAL_RESTORED_FORMS = /* @__PURE__ */ new WeakSet(), p.LAST_ANCESTOR_ARG_VA
|
|
|
10305
10305
|
"prototype"
|
|
10306
10306
|
]), p.COLLECTED_ROW_IDENTITY = /* @__PURE__ */ new WeakMap(), p.COMPLETE_SET_VALUES = /* @__PURE__ */ new WeakSet(), p.COLLECTED_EXCLUDED_KEYS = /* @__PURE__ */ new WeakMap(), p.warnedPositionalRowFallbacks = /* @__PURE__ */ new Set(), p.warnedDerivedRowsWithoutKey = /* @__PURE__ */ new Set(), p.LEADING_PATH_PATTERN = /^\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*([\s\S]*)$/;
|
|
10307
10307
|
let x = p;
|
|
10308
|
-
class
|
|
10308
|
+
class O {
|
|
10309
10309
|
/**
|
|
10310
10310
|
* カスタムイベントを発火します。
|
|
10311
10311
|
*
|
|
@@ -10329,7 +10329,7 @@ class U {
|
|
|
10329
10329
|
* @param version ライブラリバージョン
|
|
10330
10330
|
*/
|
|
10331
10331
|
static ready(e) {
|
|
10332
|
-
|
|
10332
|
+
O.dispatch(document, "ready", { version: e });
|
|
10333
10333
|
}
|
|
10334
10334
|
/**
|
|
10335
10335
|
* importstartイベントを発火します。
|
|
@@ -10338,7 +10338,7 @@ class U {
|
|
|
10338
10338
|
* @param url インポート対象URL
|
|
10339
10339
|
*/
|
|
10340
10340
|
static importStart(e, t) {
|
|
10341
|
-
|
|
10341
|
+
O.dispatch(e, "importstart", {
|
|
10342
10342
|
url: t,
|
|
10343
10343
|
startedAt: performance.now()
|
|
10344
10344
|
});
|
|
@@ -10352,7 +10352,7 @@ class U {
|
|
|
10352
10352
|
* @param startedAt 開始時刻
|
|
10353
10353
|
*/
|
|
10354
10354
|
static importEnd(e, t, r, i) {
|
|
10355
|
-
|
|
10355
|
+
O.dispatch(e, "importend", {
|
|
10356
10356
|
url: t,
|
|
10357
10357
|
bytes: r,
|
|
10358
10358
|
durationMs: performance.now() - i
|
|
@@ -10366,7 +10366,7 @@ class U {
|
|
|
10366
10366
|
* @param error エラー内容
|
|
10367
10367
|
*/
|
|
10368
10368
|
static importError(e, t, r) {
|
|
10369
|
-
|
|
10369
|
+
O.dispatch(e, "importerror", { url: t, error: r });
|
|
10370
10370
|
}
|
|
10371
10371
|
/**
|
|
10372
10372
|
* bindchangeイベントを発火します。
|
|
@@ -10382,7 +10382,7 @@ class U {
|
|
|
10382
10382
|
const u = t?.[l], d = r[l];
|
|
10383
10383
|
u !== d && s.push(l);
|
|
10384
10384
|
}
|
|
10385
|
-
|
|
10385
|
+
O.dispatch(e, "bindchange", {
|
|
10386
10386
|
previous: t || {},
|
|
10387
10387
|
next: r,
|
|
10388
10388
|
changedKeys: s,
|
|
@@ -10401,7 +10401,7 @@ class U {
|
|
|
10401
10401
|
* @param reason 変更理由
|
|
10402
10402
|
*/
|
|
10403
10403
|
static bindComplete(e, t = null, r = "other") {
|
|
10404
|
-
|
|
10404
|
+
O.dispatch(e, "bindcomplete", { bindArg: t, reason: r });
|
|
10405
10405
|
}
|
|
10406
10406
|
/**
|
|
10407
10407
|
* eachupdateイベントを発火します。
|
|
@@ -10412,7 +10412,7 @@ class U {
|
|
|
10412
10412
|
* @param order 現在の順序
|
|
10413
10413
|
*/
|
|
10414
10414
|
static eachUpdate(e, t, r, i) {
|
|
10415
|
-
|
|
10415
|
+
O.dispatch(e, "eachupdate", {
|
|
10416
10416
|
added: t,
|
|
10417
10417
|
removed: r,
|
|
10418
10418
|
order: i,
|
|
@@ -10428,7 +10428,7 @@ class U {
|
|
|
10428
10428
|
* @param item 行データ
|
|
10429
10429
|
*/
|
|
10430
10430
|
static rowAdd(e, t, r, i) {
|
|
10431
|
-
|
|
10431
|
+
O.dispatch(e, "rowadd", { key: t, index: r, item: i });
|
|
10432
10432
|
}
|
|
10433
10433
|
/**
|
|
10434
10434
|
* rowremoveイベントを発火します。
|
|
@@ -10438,7 +10438,7 @@ class U {
|
|
|
10438
10438
|
* @param index インデックス
|
|
10439
10439
|
*/
|
|
10440
10440
|
static rowRemove(e, t, r) {
|
|
10441
|
-
|
|
10441
|
+
O.dispatch(e, "rowremove", { key: t, index: r });
|
|
10442
10442
|
}
|
|
10443
10443
|
/**
|
|
10444
10444
|
* rowmoveイベントを発火します。
|
|
@@ -10449,7 +10449,7 @@ class U {
|
|
|
10449
10449
|
* @param to 移動後インデックス
|
|
10450
10450
|
*/
|
|
10451
10451
|
static rowMove(e, t, r, i) {
|
|
10452
|
-
|
|
10452
|
+
O.dispatch(e, "rowmove", { key: t, from: r, to: i });
|
|
10453
10453
|
}
|
|
10454
10454
|
/**
|
|
10455
10455
|
* showイベントを発火します。
|
|
@@ -10457,7 +10457,7 @@ class U {
|
|
|
10457
10457
|
* @param target data-if要素
|
|
10458
10458
|
*/
|
|
10459
10459
|
static show(e) {
|
|
10460
|
-
|
|
10460
|
+
O.dispatch(e, "show", { visible: !0 });
|
|
10461
10461
|
}
|
|
10462
10462
|
/**
|
|
10463
10463
|
* hideイベントを発火します。
|
|
@@ -10465,7 +10465,7 @@ class U {
|
|
|
10465
10465
|
* @param target data-if要素
|
|
10466
10466
|
*/
|
|
10467
10467
|
static hide(e) {
|
|
10468
|
-
|
|
10468
|
+
O.dispatch(e, "hide", { visible: !1 });
|
|
10469
10469
|
}
|
|
10470
10470
|
/**
|
|
10471
10471
|
* fetchstartイベントを発火します。
|
|
@@ -10478,7 +10478,7 @@ class U {
|
|
|
10478
10478
|
* @return 戻り値はありません。
|
|
10479
10479
|
*/
|
|
10480
10480
|
static fetchStart(e, t, r, i, s) {
|
|
10481
|
-
|
|
10481
|
+
O.dispatch(e, "fetchstart", {
|
|
10482
10482
|
url: t,
|
|
10483
10483
|
options: r || {},
|
|
10484
10484
|
payload: i,
|
|
@@ -10495,7 +10495,7 @@ class U {
|
|
|
10495
10495
|
* @param startedAt 開始時刻
|
|
10496
10496
|
*/
|
|
10497
10497
|
static fetchEnd(e, t, r, i) {
|
|
10498
|
-
|
|
10498
|
+
O.dispatch(e, "fetchend", {
|
|
10499
10499
|
url: t,
|
|
10500
10500
|
status: r,
|
|
10501
10501
|
durationMs: performance.now() - i
|
|
@@ -10511,7 +10511,7 @@ class U {
|
|
|
10511
10511
|
* @param startedAt 開始時刻(存在する場合)
|
|
10512
10512
|
*/
|
|
10513
10513
|
static fetchError(e, t, r, i, s) {
|
|
10514
|
-
|
|
10514
|
+
O.dispatch(e, "fetcherror", {
|
|
10515
10515
|
url: t,
|
|
10516
10516
|
status: i,
|
|
10517
10517
|
error: r,
|
|
@@ -10527,7 +10527,7 @@ class U {
|
|
|
10527
10527
|
* @return 戻り値はありません。
|
|
10528
10528
|
*/
|
|
10529
10529
|
static pollTimeout(e, t, r) {
|
|
10530
|
-
|
|
10530
|
+
O.dispatch(e, "polltimeout", { count: t, elapsedMs: r });
|
|
10531
10531
|
}
|
|
10532
10532
|
/**
|
|
10533
10533
|
* pollstopイベントを発火します。
|
|
@@ -10541,7 +10541,7 @@ class U {
|
|
|
10541
10541
|
* @return 戻り値はありません。
|
|
10542
10542
|
*/
|
|
10543
10543
|
static pollStop(e, t, r, i) {
|
|
10544
|
-
|
|
10544
|
+
O.dispatch(e, "pollstop", { reason: t, count: r, elapsedMs: i });
|
|
10545
10545
|
}
|
|
10546
10546
|
}
|
|
10547
10547
|
const Er = {
|
|
@@ -10551,7 +10551,7 @@ const Er = {
|
|
|
10551
10551
|
function Ar(f, e) {
|
|
10552
10552
|
return f.replace(/\{\{([\s\S]+?)\}\}/g, (t, r) => {
|
|
10553
10553
|
try {
|
|
10554
|
-
const i =
|
|
10554
|
+
const i = re.evaluate(String(r).trim(), e);
|
|
10555
10555
|
return i == null ? "" : String(i);
|
|
10556
10556
|
} catch {
|
|
10557
10557
|
return "";
|
|
@@ -10582,7 +10582,7 @@ function vr(f, e, t) {
|
|
|
10582
10582
|
}
|
|
10583
10583
|
function kt(f, e, t) {
|
|
10584
10584
|
const r = vr(f, e, t);
|
|
10585
|
-
if (
|
|
10585
|
+
if (!Oe.isNavigableUrl(r))
|
|
10586
10586
|
return m.error(
|
|
10587
10587
|
"Haori",
|
|
10588
10588
|
`遷移先が http: / https: / 現在ページと同じスキームの URL ではないため遷移しません: ${r}`
|
|
@@ -10614,7 +10614,7 @@ function Jt(f, e = null) {
|
|
|
10614
10614
|
}
|
|
10615
10615
|
return !1;
|
|
10616
10616
|
}
|
|
10617
|
-
class
|
|
10617
|
+
class z {
|
|
10618
10618
|
/**
|
|
10619
10619
|
* セレクタ属性の値を評価済みの文字列として読み取ります。
|
|
10620
10620
|
*
|
|
@@ -10663,11 +10663,11 @@ class K {
|
|
|
10663
10663
|
* @returns 一致した要素の配列。セレクタが不正な場合は空配列
|
|
10664
10664
|
*/
|
|
10665
10665
|
static queryAllInListOrder(e, t) {
|
|
10666
|
-
if (
|
|
10666
|
+
if (z.queryAll(e, t).length === 0)
|
|
10667
10667
|
return [];
|
|
10668
10668
|
const r = /* @__PURE__ */ new Set();
|
|
10669
|
-
return
|
|
10670
|
-
|
|
10669
|
+
return z.splitList(e).forEach((i) => {
|
|
10670
|
+
z.queryAll(i, t).forEach(
|
|
10671
10671
|
(s) => r.add(s)
|
|
10672
10672
|
);
|
|
10673
10673
|
}), Array.from(r);
|
|
@@ -11040,7 +11040,7 @@ const N = class N {
|
|
|
11040
11040
|
), Promise.resolve();
|
|
11041
11041
|
N.RESTORED_ELEMENTS.add(r);
|
|
11042
11042
|
const i = N.readRecord(t), s = i ? N.extractFromRecord(t, i) : {}, n = { ...e.getRawBindingData() ?? {}, ...s };
|
|
11043
|
-
return N.seedSignature(r, N.selectFromData(t, n)), Object.keys(s).length === 0 ? Promise.resolve() :
|
|
11043
|
+
return N.seedSignature(r, N.selectFromData(t, n)), Object.keys(s).length === 0 ? Promise.resolve() : M.setBindingData(r, n, {
|
|
11044
11044
|
reentrant: !0,
|
|
11045
11045
|
kind: "nonSupply",
|
|
11046
11046
|
sequence: R.nextSequence()
|
|
@@ -11135,8 +11135,8 @@ const N = class N {
|
|
|
11135
11135
|
}
|
|
11136
11136
|
};
|
|
11137
11137
|
N.SIGNATURES = /* @__PURE__ */ new WeakMap(), N.RESTORED_ELEMENTS = /* @__PURE__ */ new WeakSet(), N.WARNED_ELEMENTS = /* @__PURE__ */ new WeakMap(), N.WARNED_KINDS = /* @__PURE__ */ new Set();
|
|
11138
|
-
let
|
|
11139
|
-
const
|
|
11138
|
+
let Be = N;
|
|
11139
|
+
const Ne = "[Haori]", Ie = {
|
|
11140
11140
|
bodyIgnored: (f) => `${f} is ignored because ${f}-handler is also declared.`,
|
|
11141
11141
|
notRegistered: (f, e) => `Handler "${f}" is not registered (${e}-handler). Register it with Haori.handlers.register().`,
|
|
11142
11142
|
argsNotArray: (f) => `${f}-args must evaluate to an array without unresolved references; the handler is not called.`,
|
|
@@ -11144,7 +11144,7 @@ const ke = "[Haori]", De = {
|
|
|
11144
11144
|
notExpression: (f) => `${f} is not run in the CSP mode (the default) because it is not a single expression. Use ${f}-handler and ${f}-args. To run it as JavaScript, select the legacy mode with <script data-csp="false">.`,
|
|
11145
11145
|
shadowed: (f, e) => `Handler(s) ${f.join(", ")} are shadowed by binding keys of the same name in ${e}; the binding values are used.`
|
|
11146
11146
|
};
|
|
11147
|
-
class
|
|
11147
|
+
class oe {
|
|
11148
11148
|
/**
|
|
11149
11149
|
* ここで組み立てる宣言かどうかを返します。false の場合、呼び出し側は従来どおり
|
|
11150
11150
|
* 本文を `new Function` で実行します。
|
|
@@ -11176,7 +11176,7 @@ class ne {
|
|
|
11176
11176
|
*/
|
|
11177
11177
|
static compile(e, t, r) {
|
|
11178
11178
|
const i = `${t}-handler`;
|
|
11179
|
-
return e.hasAttribute(i) ? (V.isEnabled() && e.hasAttribute(t) && m.warn(
|
|
11179
|
+
return e.hasAttribute(i) ? (V.isEnabled() && e.hasAttribute(t) && m.warn(Ne, Ie.bodyIgnored(t), e.getTarget()), oe.compileHandler(e, t)) : oe.compileExpression(e, t, r);
|
|
11180
11180
|
}
|
|
11181
11181
|
/**
|
|
11182
11182
|
* 登録した関数を呼ぶ呼び出しを組み立てます(`-handler` / `-args`)。
|
|
@@ -11190,23 +11190,23 @@ class ne {
|
|
|
11190
11190
|
static compileHandler(e, t) {
|
|
11191
11191
|
const r = e.getRawAttribute(`${t}-handler`), i = e.getRawAttribute(`${t}-args`);
|
|
11192
11192
|
return (s) => {
|
|
11193
|
-
const n =
|
|
11193
|
+
const n = De.get(r);
|
|
11194
11194
|
if (n === void 0) {
|
|
11195
11195
|
m.warn(
|
|
11196
|
-
|
|
11197
|
-
|
|
11196
|
+
Ne,
|
|
11197
|
+
Ie.notRegistered(r, t),
|
|
11198
11198
|
e.getTarget()
|
|
11199
11199
|
);
|
|
11200
11200
|
return;
|
|
11201
11201
|
}
|
|
11202
11202
|
let a = [];
|
|
11203
11203
|
if (i !== null) {
|
|
11204
|
-
const o =
|
|
11204
|
+
const o = re.evaluateDetailed(
|
|
11205
11205
|
i,
|
|
11206
11206
|
e.getBindingData()
|
|
11207
11207
|
);
|
|
11208
11208
|
if (!Array.isArray(o.value)) {
|
|
11209
|
-
m.warn(
|
|
11209
|
+
m.warn(Ne, Ie.argsNotArray(t), i);
|
|
11210
11210
|
return;
|
|
11211
11211
|
}
|
|
11212
11212
|
a = o.value;
|
|
@@ -11228,22 +11228,22 @@ class ne {
|
|
|
11228
11228
|
static compileExpression(e, t, r) {
|
|
11229
11229
|
const i = e.getRawAttribute(t);
|
|
11230
11230
|
if (i.includes("{{"))
|
|
11231
|
-
return m.warn(
|
|
11231
|
+
return m.warn(Ne, Ie.templateInBody(t), e.getTarget()), null;
|
|
11232
11232
|
try {
|
|
11233
|
-
|
|
11233
|
+
Le.compile(i);
|
|
11234
11234
|
} catch {
|
|
11235
|
-
return m.warn(
|
|
11235
|
+
return m.warn(Ne, Ie.notExpression(t), e.getTarget()), null;
|
|
11236
11236
|
}
|
|
11237
11237
|
return (s) => {
|
|
11238
11238
|
const n = e.getBindingData();
|
|
11239
|
-
V.isEnabled() &&
|
|
11239
|
+
V.isEnabled() && oe.reportShadowedHandlers(n, t);
|
|
11240
11240
|
const a = {
|
|
11241
|
-
...
|
|
11241
|
+
...De.entries(),
|
|
11242
11242
|
...n
|
|
11243
11243
|
};
|
|
11244
11244
|
return r.forEach((o, l) => {
|
|
11245
11245
|
a[o] = s[l];
|
|
11246
|
-
}),
|
|
11246
|
+
}), re.evaluate(i, a);
|
|
11247
11247
|
};
|
|
11248
11248
|
}
|
|
11249
11249
|
/**
|
|
@@ -11254,8 +11254,8 @@ class ne {
|
|
|
11254
11254
|
* @returns 戻り値はありません。
|
|
11255
11255
|
*/
|
|
11256
11256
|
static reportShadowedHandlers(e, t) {
|
|
11257
|
-
const r = Object.keys(e).filter((i) =>
|
|
11258
|
-
r.length > 0 && m.warn(
|
|
11257
|
+
const r = Object.keys(e).filter((i) => De.has(i));
|
|
11258
|
+
r.length > 0 && m.warn(Ne, Ie.shadowed(r, t));
|
|
11259
11259
|
}
|
|
11260
11260
|
}
|
|
11261
11261
|
const wr = [
|
|
@@ -11267,25 +11267,25 @@ const wr = [
|
|
|
11267
11267
|
"openDialog",
|
|
11268
11268
|
"toast"
|
|
11269
11269
|
], Sr = "__haoriHistoryState__", tt = "data-haori-click-lock", Dt = "ファイルを保存できませんでした", Rr = 100;
|
|
11270
|
-
let
|
|
11270
|
+
let Pe = null;
|
|
11271
11271
|
const Tr = ["info", "warning", "error", "success"], xt = /^(\d{3})-(click|click-await|close|toast|toast-level|no-message|bind)$/;
|
|
11272
|
-
function
|
|
11272
|
+
function ge() {
|
|
11273
11273
|
const e = globalThis.window?.Haori;
|
|
11274
11274
|
return wr.every(
|
|
11275
11275
|
(r) => typeof e?.[r] == "function"
|
|
11276
|
-
) ? e :
|
|
11276
|
+
) ? e : xe;
|
|
11277
11277
|
}
|
|
11278
11278
|
const kr = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
11279
|
-
function
|
|
11279
|
+
function je(f) {
|
|
11280
11280
|
return kr.has(f.toUpperCase());
|
|
11281
11281
|
}
|
|
11282
11282
|
function Dr(f, e) {
|
|
11283
11283
|
for (const [t, r] of Object.entries(e))
|
|
11284
11284
|
r !== void 0 && (Array.isArray(r) ? r.forEach((i) => {
|
|
11285
|
-
f.append(t,
|
|
11286
|
-
}) : f.append(t,
|
|
11285
|
+
f.append(t, Fe(i));
|
|
11286
|
+
}) : f.append(t, Fe(r)));
|
|
11287
11287
|
}
|
|
11288
|
-
function
|
|
11288
|
+
function Fe(f) {
|
|
11289
11289
|
if (f == null)
|
|
11290
11290
|
return "";
|
|
11291
11291
|
if (typeof f == "object" || typeof f == "function")
|
|
@@ -11347,14 +11347,14 @@ function Qt(f, e, t) {
|
|
|
11347
11347
|
const r = f[e];
|
|
11348
11348
|
r === void 0 ? f[e] = t : Array.isArray(r) ? r.push(t) : f[e] = [r, t];
|
|
11349
11349
|
}
|
|
11350
|
-
function
|
|
11350
|
+
function we(f, e) {
|
|
11351
11351
|
if (x.isCompleteSetValue(e))
|
|
11352
11352
|
return e;
|
|
11353
11353
|
if (Array.isArray(e)) {
|
|
11354
11354
|
const t = Array.isArray(f) ? f.slice() : [];
|
|
11355
11355
|
let r = !1;
|
|
11356
11356
|
return e.forEach((i, s) => {
|
|
11357
|
-
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[s] =
|
|
11357
|
+
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[s] = we(t[s], i), r = !0));
|
|
11358
11358
|
}), r ? t : f;
|
|
11359
11359
|
}
|
|
11360
11360
|
if (e !== null && typeof e == "object") {
|
|
@@ -11362,7 +11362,7 @@ function Ee(f, e) {
|
|
|
11362
11362
|
for (const [r, i] of Object.entries(
|
|
11363
11363
|
e
|
|
11364
11364
|
))
|
|
11365
|
-
t[r] =
|
|
11365
|
+
t[r] = we(t[r], i);
|
|
11366
11366
|
return t;
|
|
11367
11367
|
}
|
|
11368
11368
|
return e;
|
|
@@ -11373,7 +11373,7 @@ function Nr(f) {
|
|
|
11373
11373
|
}
|
|
11374
11374
|
function Ir(f, e) {
|
|
11375
11375
|
const t = { ...e || {} }, r = (t.method || "GET").toUpperCase();
|
|
11376
|
-
if (c.runtime !== "demo" ||
|
|
11376
|
+
if (c.runtime !== "demo" || je(r))
|
|
11377
11377
|
return {
|
|
11378
11378
|
url: f,
|
|
11379
11379
|
options: t,
|
|
@@ -11412,17 +11412,17 @@ function Fr(f) {
|
|
|
11412
11412
|
}
|
|
11413
11413
|
] : [e, String(t)]) : String(f);
|
|
11414
11414
|
}
|
|
11415
|
-
function
|
|
11416
|
-
return f instanceof Blob ? !0 : Array.isArray(f) ? f.some(
|
|
11417
|
-
|
|
11415
|
+
function Ue(f) {
|
|
11416
|
+
return f instanceof Blob ? !0 : Array.isArray(f) ? f.some(Ue) : f !== null && typeof f == "object" ? Object.values(f).some(
|
|
11417
|
+
Ue
|
|
11418
11418
|
) : !1;
|
|
11419
11419
|
}
|
|
11420
11420
|
function Cr(f) {
|
|
11421
11421
|
return Object.values(f).some((e) => e instanceof Blob ? !1 : Array.isArray(e) ? e.some(
|
|
11422
|
-
(t) => !(t instanceof Blob) &&
|
|
11423
|
-
) :
|
|
11422
|
+
(t) => !(t instanceof Blob) && Ue(t)
|
|
11423
|
+
) : Ue(e));
|
|
11424
11424
|
}
|
|
11425
|
-
function
|
|
11425
|
+
function We(f) {
|
|
11426
11426
|
return st(x.getValues(f));
|
|
11427
11427
|
}
|
|
11428
11428
|
function st(f) {
|
|
@@ -11449,7 +11449,7 @@ function st(f) {
|
|
|
11449
11449
|
t[r] = e(i);
|
|
11450
11450
|
return x.carryCollectedRowIdentity(f, t), t;
|
|
11451
11451
|
}
|
|
11452
|
-
function
|
|
11452
|
+
function $r(f, e) {
|
|
11453
11453
|
const t = new Headers(
|
|
11454
11454
|
e.headers || void 0
|
|
11455
11455
|
), r = Array.from(t.entries()).sort(
|
|
@@ -11546,9 +11546,9 @@ const g = class g {
|
|
|
11546
11546
|
* @returns 対象のフラグメント(見つからない場合は空)
|
|
11547
11547
|
*/
|
|
11548
11548
|
static resolveSelectorTargets(e, t, r) {
|
|
11549
|
-
const i =
|
|
11549
|
+
const i = z.read(e, t), s = [];
|
|
11550
11550
|
if (i)
|
|
11551
|
-
(r === "click" || r === "error-click" ?
|
|
11551
|
+
(r === "click" || r === "error-click" ? z.queryAllInListOrder(i, t) : z.queryAll(i, t)).forEach((a) => {
|
|
11552
11552
|
const o = D.get(a);
|
|
11553
11553
|
o && s.push(o);
|
|
11554
11554
|
}), s.length === 0 && m.error("Haori", `Element not found: ${i} (${t})`);
|
|
@@ -11720,7 +11720,7 @@ const g = class g {
|
|
|
11720
11720
|
* @returns 手続き開始時の評価値
|
|
11721
11721
|
*/
|
|
11722
11722
|
static readLateAttribute(e, t, r, i) {
|
|
11723
|
-
const s =
|
|
11723
|
+
const s = re.withoutDiagnosis(
|
|
11724
11724
|
() => e.getAttributeEvaluation(i)
|
|
11725
11725
|
);
|
|
11726
11726
|
return t.lateAttributes || (t.lateAttributes = /* @__PURE__ */ new Map()), t.lateAttributes.set(r, {
|
|
@@ -11772,7 +11772,7 @@ const g = class g {
|
|
|
11772
11772
|
const r = e.getRawAttribute(t);
|
|
11773
11773
|
let i;
|
|
11774
11774
|
try {
|
|
11775
|
-
i =
|
|
11775
|
+
i = M.parseDataBind(r);
|
|
11776
11776
|
} catch (s) {
|
|
11777
11777
|
return m.error("Haori", `Invalid fetch headers: ${s}`), null;
|
|
11778
11778
|
}
|
|
@@ -11863,7 +11863,7 @@ const g = class g {
|
|
|
11863
11863
|
return { value: e.replace(
|
|
11864
11864
|
g.DATA_PLACEHOLDER_REGEX,
|
|
11865
11865
|
(s, n, a) => {
|
|
11866
|
-
const o =
|
|
11866
|
+
const o = re.evaluateDetailed(
|
|
11867
11867
|
n ?? a ?? "",
|
|
11868
11868
|
t
|
|
11869
11869
|
);
|
|
@@ -11933,7 +11933,7 @@ const g = class g {
|
|
|
11933
11933
|
return { value: e.replace(
|
|
11934
11934
|
g.DATA_PLACEHOLDER_REGEX,
|
|
11935
11935
|
(s, n, a, o) => {
|
|
11936
|
-
const l =
|
|
11936
|
+
const l = re.evaluateDetailed(
|
|
11937
11937
|
n ?? a ?? "",
|
|
11938
11938
|
t
|
|
11939
11939
|
);
|
|
@@ -11970,7 +11970,7 @@ const g = class g {
|
|
|
11970
11970
|
const a = r.trim();
|
|
11971
11971
|
if (g.SINGLE_PLACEHOLDER_REGEX.test(a))
|
|
11972
11972
|
return {
|
|
11973
|
-
value:
|
|
11973
|
+
value: M.parseDataBind(s),
|
|
11974
11974
|
hasUnresolvedReference: n
|
|
11975
11975
|
};
|
|
11976
11976
|
if (a.startsWith("{") || a.startsWith("[")) {
|
|
@@ -11979,7 +11979,7 @@ const g = class g {
|
|
|
11979
11979
|
e.getBindingData()
|
|
11980
11980
|
);
|
|
11981
11981
|
return {
|
|
11982
|
-
value:
|
|
11982
|
+
value: M.parseDataBind(l.value),
|
|
11983
11983
|
hasUnresolvedReference: n || l.hasUnresolvedReference
|
|
11984
11984
|
};
|
|
11985
11985
|
}
|
|
@@ -11988,7 +11988,7 @@ const g = class g {
|
|
|
11988
11988
|
e.getBindingData()
|
|
11989
11989
|
);
|
|
11990
11990
|
return {
|
|
11991
|
-
value:
|
|
11991
|
+
value: M.parseDataBind(o.value),
|
|
11992
11992
|
hasUnresolvedReference: n || o.hasUnresolvedReference
|
|
11993
11993
|
};
|
|
11994
11994
|
}
|
|
@@ -12004,8 +12004,8 @@ const g = class g {
|
|
|
12004
12004
|
targetFragment: e
|
|
12005
12005
|
}, i = t ? g.attrName(t, "if") : g.attrName(null, "if", !0);
|
|
12006
12006
|
if (e.hasAttribute(i)) {
|
|
12007
|
-
const
|
|
12008
|
-
typeof
|
|
12007
|
+
const k = e.getRawAttribute(i);
|
|
12008
|
+
typeof k == "string" && k.trim() !== "" ? (r.conditionExpression = x.unwrapConditionExpression(k), r.conditionAttributeName = i) : m.warn(
|
|
12009
12009
|
"Haori",
|
|
12010
12010
|
`${i} に条件式が指定されていません。`
|
|
12011
12011
|
);
|
|
@@ -12016,86 +12016,98 @@ const g = class g {
|
|
|
12016
12016
|
e.getAttribute(g.attrName(t, "confirm"))
|
|
12017
12017
|
)
|
|
12018
12018
|
)), e.hasAttribute(g.attrName(t, "data")) && (r.dataAttrName = g.attrName(t, "data")), e.hasAttribute(g.attrName(t, "form"))) {
|
|
12019
|
-
const
|
|
12019
|
+
const U = z.read(
|
|
12020
12020
|
e,
|
|
12021
12021
|
g.attrName(t, "form")
|
|
12022
12022
|
);
|
|
12023
|
-
if (
|
|
12024
|
-
const
|
|
12025
|
-
|
|
12023
|
+
if (U) {
|
|
12024
|
+
const Q = z.query(
|
|
12025
|
+
U,
|
|
12026
12026
|
g.attrName(t, "form")
|
|
12027
12027
|
);
|
|
12028
|
-
|
|
12029
|
-
D.get(
|
|
12028
|
+
Q !== null ? r.formFragment = x.getFormFragment(
|
|
12029
|
+
D.get(Q)
|
|
12030
12030
|
) : m.error(
|
|
12031
12031
|
"Haori",
|
|
12032
|
-
`Form element not found: ${
|
|
12032
|
+
`Form element not found: ${U} (${g.attrName(t, "form")})`
|
|
12033
12033
|
);
|
|
12034
12034
|
} else
|
|
12035
12035
|
r.formFragment = x.getFormFragment(e);
|
|
12036
12036
|
} else if (t === "change" || t === "input") {
|
|
12037
12037
|
r.formFragment = x.getFormFragment(e);
|
|
12038
|
-
const
|
|
12039
|
-
r.implicitFormFragment = !e.getAttributeNames().some((
|
|
12038
|
+
const U = `${c.prefix}${t}-`;
|
|
12039
|
+
r.implicitFormFragment = !e.getAttributeNames().some((Q) => Q.startsWith(U)), r.formFragment === null && g.isNamedInputFragment(e) && (r.selfValueFragment = e);
|
|
12040
12040
|
}
|
|
12041
12041
|
V.isEnabled() && g.warnAuthRedirectWithoutFetch(e, t);
|
|
12042
|
-
const
|
|
12043
|
-
if (
|
|
12044
|
-
const
|
|
12042
|
+
const k = `${c.prefix}${t}-before-run`;
|
|
12043
|
+
if (oe.declared(e, k) && oe.applies(e, k)) {
|
|
12044
|
+
const U = oe.compile(e, k, [
|
|
12045
12045
|
"fetchUrl",
|
|
12046
12046
|
"fetchOptions"
|
|
12047
12047
|
]);
|
|
12048
|
-
|
|
12049
|
-
} else if (e.hasAttribute(
|
|
12050
|
-
const
|
|
12048
|
+
U && (r.beforeCallback = (Q, pe) => U([Q, pe]));
|
|
12049
|
+
} else if (e.hasAttribute(k)) {
|
|
12050
|
+
const U = e.getRawAttribute(k);
|
|
12051
12051
|
try {
|
|
12052
12052
|
r.beforeCallback = new Function(
|
|
12053
12053
|
"fetchUrl",
|
|
12054
12054
|
"fetchOptions",
|
|
12055
12055
|
`
|
|
12056
12056
|
"use strict";
|
|
12057
|
-
${
|
|
12057
|
+
${U}
|
|
12058
12058
|
`
|
|
12059
12059
|
);
|
|
12060
|
-
} catch (
|
|
12061
|
-
m.error("Haori", `Invalid before script: ${
|
|
12060
|
+
} catch (Q) {
|
|
12061
|
+
m.error("Haori", `Invalid before script: ${Q}`);
|
|
12062
12062
|
}
|
|
12063
12063
|
}
|
|
12064
|
-
const
|
|
12065
|
-
if (
|
|
12066
|
-
const
|
|
12067
|
-
|
|
12068
|
-
} else if (e.hasAttribute(
|
|
12069
|
-
const
|
|
12070
|
-
let
|
|
12064
|
+
const B = g.attrName(t, "run");
|
|
12065
|
+
if (oe.declared(e, B) && oe.applies(e, B)) {
|
|
12066
|
+
const U = oe.compile(e, B, ["event"]);
|
|
12067
|
+
U && (r.runScript = (Q) => U([Q]));
|
|
12068
|
+
} else if (e.hasAttribute(B)) {
|
|
12069
|
+
const U = String(e.getAttribute(B) ?? "");
|
|
12070
|
+
let Q = null;
|
|
12071
12071
|
try {
|
|
12072
|
-
|
|
12072
|
+
Q = new Function(
|
|
12073
12073
|
"event",
|
|
12074
12074
|
`"use strict"; return (
|
|
12075
|
-
${
|
|
12075
|
+
${U}
|
|
12076
12076
|
);`
|
|
12077
12077
|
);
|
|
12078
12078
|
} catch {
|
|
12079
12079
|
try {
|
|
12080
|
-
|
|
12081
|
-
${
|
|
12080
|
+
Q = new Function("event", `"use strict";
|
|
12081
|
+
${U}
|
|
12082
12082
|
`);
|
|
12083
|
-
} catch (
|
|
12084
|
-
m.error("Haori", `Invalid run script: ${
|
|
12083
|
+
} catch (pe) {
|
|
12084
|
+
m.error("Haori", `Invalid run script: ${pe}`);
|
|
12085
12085
|
}
|
|
12086
12086
|
}
|
|
12087
|
-
|
|
12087
|
+
Q && (r.runScript = Q);
|
|
12088
12088
|
}
|
|
12089
|
+
const ue = g.attrName(t, "clipboard");
|
|
12090
|
+
e.hasAttribute(ue) && (r.clipboardAttrName = ue, r.clipboardErrorToastMessage = g.readLateAttribute(
|
|
12091
|
+
e,
|
|
12092
|
+
r,
|
|
12093
|
+
"clipboard-error-toast",
|
|
12094
|
+
g.attrName(t, "clipboard-error-toast")
|
|
12095
|
+
), r.clipboardErrorToastLevel = g.readToastLevel(
|
|
12096
|
+
e,
|
|
12097
|
+
r,
|
|
12098
|
+
"clipboard-error-toast-level",
|
|
12099
|
+
g.attrName(t, "clipboard-error-toast-level")
|
|
12100
|
+
));
|
|
12089
12101
|
}
|
|
12090
12102
|
const s = g.attrName(t, "fetch"), n = e.hasAttribute(s);
|
|
12091
12103
|
if (n) {
|
|
12092
|
-
const
|
|
12093
|
-
|
|
12104
|
+
const k = e.getAttributeEvaluation(s);
|
|
12105
|
+
k && (r.fetchHasUnresolvedReference = k.hasUnresolvedReference, r.fetchUrl = k.hasUnresolvedReference ? null : k.value);
|
|
12094
12106
|
}
|
|
12095
12107
|
const a = {}, o = t ? g.attrName(t, "fetch-method") : g.attrName(null, "method", !0);
|
|
12096
12108
|
if (e.hasAttribute(o)) {
|
|
12097
|
-
const
|
|
12098
|
-
|
|
12109
|
+
const k = e.getAttributeEvaluation(o);
|
|
12110
|
+
k?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : a.method = g.normalizeAttributeText(k?.value) ?? void 0;
|
|
12099
12111
|
}
|
|
12100
12112
|
const l = t ? g.attrName(t, "fetch-headers") : g.attrName(null, "headers", !0), u = g.readFetchHeaders(
|
|
12101
12113
|
e,
|
|
@@ -12105,9 +12117,9 @@ ${W}
|
|
|
12105
12117
|
const d = t ? g.attrName(t, "fetch-content-type") : g.attrName(null, "content-type", !0);
|
|
12106
12118
|
let y = null;
|
|
12107
12119
|
if (e.hasAttribute(d)) {
|
|
12108
|
-
const
|
|
12109
|
-
|
|
12110
|
-
|
|
12120
|
+
const k = e.getAttributeEvaluation(d);
|
|
12121
|
+
k?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), y = g.normalizeAttributeText(
|
|
12122
|
+
k?.value
|
|
12111
12123
|
);
|
|
12112
12124
|
}
|
|
12113
12125
|
if (y !== null)
|
|
@@ -12116,10 +12128,10 @@ ${W}
|
|
|
12116
12128
|
y
|
|
12117
12129
|
);
|
|
12118
12130
|
else if (a.method && !g.hasDeclaredContentType(a.headers)) {
|
|
12119
|
-
const
|
|
12131
|
+
const k = a.method.toUpperCase();
|
|
12120
12132
|
a.headers = g.withContentType(
|
|
12121
12133
|
a.headers,
|
|
12122
|
-
|
|
12134
|
+
k === "GET" || k === "HEAD" || k === "OPTIONS" ? "application/x-www-form-urlencoded" : "application/json"
|
|
12123
12135
|
);
|
|
12124
12136
|
}
|
|
12125
12137
|
Object.keys(a).length > 0 && (r.fetchOptions = a);
|
|
@@ -12131,8 +12143,8 @@ ${W}
|
|
|
12131
12143
|
);
|
|
12132
12144
|
else if (e.hasAttribute(b)) {
|
|
12133
12145
|
r.download = !0;
|
|
12134
|
-
const
|
|
12135
|
-
r.downloadFileName =
|
|
12146
|
+
const k = e.getAttributeEvaluation(b);
|
|
12147
|
+
r.downloadFileName = k?.hasUnresolvedReference ? null : g.normalizeAttributeText(k?.value);
|
|
12136
12148
|
}
|
|
12137
12149
|
const E = t ? g.attrName(t, "fetch-download-folder") : g.attrName(null, "download-folder", !0);
|
|
12138
12150
|
e.hasAttribute(E) && (r.download ? r.downloadFolder = !0 : m.warn(
|
|
@@ -12141,82 +12153,84 @@ ${W}
|
|
|
12141
12153
|
));
|
|
12142
12154
|
const A = t ? g.attrName(t, "bind") : g.attrName(null, "bind", !0);
|
|
12143
12155
|
if (e.hasAttribute(A)) {
|
|
12144
|
-
const
|
|
12145
|
-
if (
|
|
12146
|
-
const
|
|
12147
|
-
|
|
12148
|
-
const
|
|
12149
|
-
|
|
12156
|
+
const k = z.read(e, A);
|
|
12157
|
+
if (k) {
|
|
12158
|
+
const B = z.queryAll(k, A);
|
|
12159
|
+
B.length > 0 ? (r.bindFragments = [], B.forEach((ue) => {
|
|
12160
|
+
const U = D.get(ue);
|
|
12161
|
+
U && r.bindFragments.push(U);
|
|
12150
12162
|
})) : m.error(
|
|
12151
12163
|
"Haori",
|
|
12152
|
-
`Bind element not found: ${
|
|
12164
|
+
`Bind element not found: ${k} (${A})`
|
|
12153
12165
|
);
|
|
12154
12166
|
}
|
|
12155
12167
|
}
|
|
12156
|
-
const
|
|
12157
|
-
t ? e.hasAttribute(
|
|
12158
|
-
|
|
12159
|
-
) : e.hasAttribute(
|
|
12168
|
+
const w = g.attrName(t, "bind-arg"), $ = g.attrName(null, "arg", !0), C = g.attrName(null, "bind-arg", !0);
|
|
12169
|
+
t ? e.hasAttribute(w) && (r.bindArg = e.getRawAttribute(w)) : e.hasAttribute($) ? r.bindArg = e.getRawAttribute(
|
|
12170
|
+
$
|
|
12171
|
+
) : e.hasAttribute(C) && (r.bindArg = e.getRawAttribute(C));
|
|
12160
12172
|
const se = t ? g.attrName(t, "bind-params") : g.attrName(null, "bind-params", !0);
|
|
12161
12173
|
if (e.hasAttribute(se)) {
|
|
12162
|
-
const
|
|
12163
|
-
r.bindParams =
|
|
12174
|
+
const k = e.getRawAttribute(se);
|
|
12175
|
+
r.bindParams = k.split("&").map((B) => B.trim());
|
|
12164
12176
|
}
|
|
12165
12177
|
const F = t ? g.attrName(t, "bind-append") : g.attrName(null, "bind-append", !0);
|
|
12166
12178
|
if (e.hasAttribute(F)) {
|
|
12167
|
-
const
|
|
12168
|
-
r.bindAppendParams =
|
|
12169
|
-
}
|
|
12170
|
-
const
|
|
12171
|
-
e.hasAttribute(
|
|
12172
|
-
const
|
|
12173
|
-
e.hasAttribute(
|
|
12174
|
-
const
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12179
|
+
const k = e.getRawAttribute(F);
|
|
12180
|
+
r.bindAppendParams = k.split("&").map((B) => B.trim()).filter(Boolean);
|
|
12181
|
+
}
|
|
12182
|
+
const Z = t ? g.attrName(t, "bind-merge") : g.attrName(null, "bind-merge", !0);
|
|
12183
|
+
e.hasAttribute(Z) && (r.bindMerge = !0);
|
|
12184
|
+
const ee = t ? g.attrName(t, "bind-transform") : g.attrName(null, "bind-transform", !0);
|
|
12185
|
+
e.hasAttribute(ee) && (r.bindTransform = e.getRawAttribute(ee));
|
|
12186
|
+
const ne = t ? g.attrName(t, "payload-transform") : g.attrName(null, "payload-transform", !0);
|
|
12187
|
+
e.hasAttribute(ne) && (r.payloadTransform = e.getRawAttribute(ne));
|
|
12188
|
+
const K = t ? g.attrName(t, "copy-params") : null;
|
|
12189
|
+
if (K && e.hasAttribute(K)) {
|
|
12190
|
+
const k = e.getRawAttribute(K);
|
|
12191
|
+
r.copyParams = k.split("&").map((B) => B.trim()).filter(Boolean);
|
|
12178
12192
|
}
|
|
12179
12193
|
if (t) {
|
|
12180
12194
|
if (e.hasAttribute(g.attrName(t, "adjust"))) {
|
|
12181
|
-
const
|
|
12195
|
+
const W = z.read(
|
|
12182
12196
|
e,
|
|
12183
12197
|
g.attrName(t, "adjust")
|
|
12184
12198
|
);
|
|
12185
|
-
if (
|
|
12186
|
-
const G =
|
|
12187
|
-
|
|
12199
|
+
if (W) {
|
|
12200
|
+
const G = z.queryAll(
|
|
12201
|
+
W,
|
|
12188
12202
|
g.attrName(t, "adjust")
|
|
12189
12203
|
);
|
|
12190
|
-
G.length > 0 ? (r.adjustFragments = [], G.forEach((
|
|
12191
|
-
const
|
|
12192
|
-
|
|
12204
|
+
G.length > 0 ? (r.adjustFragments = [], G.forEach((ie) => {
|
|
12205
|
+
const Ee = D.get(ie);
|
|
12206
|
+
Ee && r.adjustFragments.push(Ee);
|
|
12193
12207
|
})) : m.error(
|
|
12194
12208
|
"Haori",
|
|
12195
|
-
`Adjust element not found: ${
|
|
12209
|
+
`Adjust element not found: ${W} (${g.attrName(t, "adjust")})`
|
|
12196
12210
|
);
|
|
12197
12211
|
}
|
|
12198
12212
|
if (e.hasAttribute(g.attrName(t, "adjust-value"))) {
|
|
12199
12213
|
const G = e.getRawAttribute(
|
|
12200
12214
|
g.attrName(t, "adjust-value")
|
|
12201
|
-
),
|
|
12202
|
-
isNaN(
|
|
12215
|
+
), ie = Number(G);
|
|
12216
|
+
isNaN(ie) || (r.adjustValue = ie);
|
|
12203
12217
|
}
|
|
12204
12218
|
}
|
|
12205
12219
|
e.hasAttribute(g.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(g.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(g.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(g.attrName(t, "row-next")) && (r.rowMoveNext = !0);
|
|
12206
|
-
const
|
|
12207
|
-
if (
|
|
12208
|
-
const
|
|
12220
|
+
const k = `${c.prefix}${t}-after-run`;
|
|
12221
|
+
if (oe.declared(e, k) && oe.applies(e, k)) {
|
|
12222
|
+
const W = oe.compile(e, k, [
|
|
12209
12223
|
"response"
|
|
12210
12224
|
]);
|
|
12211
|
-
|
|
12212
|
-
} else if (e.hasAttribute(
|
|
12213
|
-
const
|
|
12225
|
+
W && (r.afterCallback = (G) => W([G]));
|
|
12226
|
+
} else if (e.hasAttribute(k)) {
|
|
12227
|
+
const W = e.getRawAttribute(k);
|
|
12214
12228
|
try {
|
|
12215
12229
|
r.afterCallback = new Function(
|
|
12216
12230
|
"response",
|
|
12217
12231
|
`
|
|
12218
12232
|
"use strict";
|
|
12219
|
-
${
|
|
12233
|
+
${W}
|
|
12220
12234
|
`
|
|
12221
12235
|
);
|
|
12222
12236
|
} catch (G) {
|
|
@@ -12241,12 +12255,12 @@ ${O}
|
|
|
12241
12255
|
"toast-level",
|
|
12242
12256
|
g.attrName(t, "toast-level")
|
|
12243
12257
|
)), t !== "poll") {
|
|
12244
|
-
const
|
|
12245
|
-
e.hasAttribute(
|
|
12258
|
+
const W = g.attrName(t, "error-toast");
|
|
12259
|
+
e.hasAttribute(W) && (r.errorToastMessage = g.readLateAttribute(
|
|
12246
12260
|
e,
|
|
12247
12261
|
r,
|
|
12248
12262
|
"error-toast",
|
|
12249
|
-
|
|
12263
|
+
W
|
|
12250
12264
|
), r.errorToastLevel = g.readToastLevel(
|
|
12251
12265
|
e,
|
|
12252
12266
|
r,
|
|
@@ -12263,27 +12277,27 @@ ${O}
|
|
|
12263
12277
|
g.attrName(t, "error-bind")
|
|
12264
12278
|
);
|
|
12265
12279
|
}
|
|
12266
|
-
const
|
|
12267
|
-
if (
|
|
12280
|
+
const B = g.attrName(t, "redirect"), ue = g.attrName(t, "redirect-replace"), U = e.hasAttribute(B), Q = e.hasAttribute(ue);
|
|
12281
|
+
if (U && (r.redirectUrl = g.readLateAttribute(
|
|
12268
12282
|
e,
|
|
12269
12283
|
r,
|
|
12270
12284
|
"redirect",
|
|
12271
|
-
|
|
12272
|
-
)),
|
|
12285
|
+
B
|
|
12286
|
+
)), Q && (r.redirectReplaceUrl = g.readLateAttribute(
|
|
12273
12287
|
e,
|
|
12274
12288
|
r,
|
|
12275
12289
|
"redirect-replace",
|
|
12276
|
-
|
|
12277
|
-
)),
|
|
12278
|
-
const
|
|
12290
|
+
ue
|
|
12291
|
+
)), U || Q) {
|
|
12292
|
+
const W = g.attrName(
|
|
12279
12293
|
t,
|
|
12280
12294
|
"redirect-return-param"
|
|
12281
12295
|
);
|
|
12282
|
-
e.hasAttribute(
|
|
12296
|
+
e.hasAttribute(W) && (r.redirectReturnParam = g.readLateAttribute(
|
|
12283
12297
|
e,
|
|
12284
12298
|
r,
|
|
12285
12299
|
"redirect-return-param",
|
|
12286
|
-
|
|
12300
|
+
W
|
|
12287
12301
|
));
|
|
12288
12302
|
}
|
|
12289
12303
|
if (e.hasAttribute(g.attrName(t, "scroll-error")) && (r.scrollOnError = !0), e.hasAttribute(g.attrName(t, "clear-messages")) && (r.clearMessagesOnSuccess = !0), e.hasAttribute(g.attrName(t, "scroll")) && (r.scrollTarget = g.readLateAttribute(
|
|
@@ -12297,20 +12311,20 @@ ${O}
|
|
|
12297
12311
|
"history",
|
|
12298
12312
|
g.attrName(t, "history")
|
|
12299
12313
|
)), e.hasAttribute(g.attrName(t, "history-data")) && (r.historyDataAttrName = g.attrName(t, "history-data")), e.hasAttribute(g.attrName(t, "history-form"))) {
|
|
12300
|
-
const
|
|
12314
|
+
const W = z.read(
|
|
12301
12315
|
e,
|
|
12302
12316
|
g.attrName(t, "history-form")
|
|
12303
12317
|
);
|
|
12304
|
-
if (
|
|
12305
|
-
const G =
|
|
12306
|
-
|
|
12318
|
+
if (W) {
|
|
12319
|
+
const G = z.query(
|
|
12320
|
+
W,
|
|
12307
12321
|
g.attrName(t, "history-form")
|
|
12308
12322
|
);
|
|
12309
12323
|
G !== null ? r.historyFormFragment = x.getFormFragment(
|
|
12310
12324
|
D.get(G)
|
|
12311
12325
|
) : m.error(
|
|
12312
12326
|
"Haori",
|
|
12313
|
-
`Form element not found: ${
|
|
12327
|
+
`Form element not found: ${W} (${g.attrName(t, "history-form")})`
|
|
12314
12328
|
);
|
|
12315
12329
|
} else
|
|
12316
12330
|
r.historyFormFragment = x.getFormFragment(e);
|
|
@@ -12325,47 +12339,47 @@ ${O}
|
|
|
12325
12339
|
"close",
|
|
12326
12340
|
"error-click",
|
|
12327
12341
|
"error-close"
|
|
12328
|
-
].forEach((
|
|
12329
|
-
if (
|
|
12342
|
+
].forEach((W) => {
|
|
12343
|
+
if (W.startsWith("error-") && t === "poll")
|
|
12330
12344
|
return;
|
|
12331
|
-
const G = g.attrName(t,
|
|
12345
|
+
const G = g.attrName(t, W);
|
|
12332
12346
|
if (!e.hasAttribute(G))
|
|
12333
12347
|
return;
|
|
12334
|
-
const
|
|
12348
|
+
const ie = g.resolveSelectorTargets(
|
|
12335
12349
|
e,
|
|
12336
12350
|
G,
|
|
12337
|
-
|
|
12351
|
+
W
|
|
12338
12352
|
);
|
|
12339
|
-
if (
|
|
12340
|
-
switch (
|
|
12353
|
+
if (ie.length > 0)
|
|
12354
|
+
switch (W) {
|
|
12341
12355
|
case "reset-before":
|
|
12342
|
-
r.resetBeforeFragments =
|
|
12356
|
+
r.resetBeforeFragments = ie;
|
|
12343
12357
|
break;
|
|
12344
12358
|
case "reset":
|
|
12345
|
-
r.resetFragments =
|
|
12359
|
+
r.resetFragments = ie;
|
|
12346
12360
|
break;
|
|
12347
12361
|
case "refetch":
|
|
12348
|
-
r.refetchFragments =
|
|
12362
|
+
r.refetchFragments = ie;
|
|
12349
12363
|
break;
|
|
12350
12364
|
case "click":
|
|
12351
|
-
r.clickFragments =
|
|
12365
|
+
r.clickFragments = ie, r.clickAwait = e.hasAttribute(`${G}-await`);
|
|
12352
12366
|
break;
|
|
12353
12367
|
case "copy":
|
|
12354
|
-
r.copyFragments =
|
|
12368
|
+
r.copyFragments = ie;
|
|
12355
12369
|
break;
|
|
12356
12370
|
case "open":
|
|
12357
|
-
r.openFragments =
|
|
12371
|
+
r.openFragments = ie;
|
|
12358
12372
|
break;
|
|
12359
12373
|
case "close":
|
|
12360
|
-
r.closeFragments =
|
|
12374
|
+
r.closeFragments = ie;
|
|
12361
12375
|
break;
|
|
12362
12376
|
case "error-click":
|
|
12363
|
-
r.errorClickFragments =
|
|
12377
|
+
r.errorClickFragments = ie, r.errorClickAwait = e.hasAttribute(
|
|
12364
12378
|
`${G}-await`
|
|
12365
12379
|
);
|
|
12366
12380
|
break;
|
|
12367
12381
|
case "error-close":
|
|
12368
|
-
r.errorCloseFragments =
|
|
12382
|
+
r.errorCloseFragments = ie;
|
|
12369
12383
|
break;
|
|
12370
12384
|
}
|
|
12371
12385
|
}), t !== "poll" && (r.errorStatusActions = g.readErrorStatusActions(
|
|
@@ -12373,73 +12387,73 @@ ${O}
|
|
|
12373
12387
|
r,
|
|
12374
12388
|
t
|
|
12375
12389
|
));
|
|
12376
|
-
const
|
|
12377
|
-
if (e.hasAttribute(
|
|
12378
|
-
const
|
|
12379
|
-
if (
|
|
12380
|
-
const G =
|
|
12390
|
+
const ce = g.attrName(t, "copy-source");
|
|
12391
|
+
if (e.hasAttribute(ce)) {
|
|
12392
|
+
const W = z.read(e, ce);
|
|
12393
|
+
if (W) {
|
|
12394
|
+
const G = z.query(W, ce);
|
|
12381
12395
|
if (G !== null) {
|
|
12382
|
-
const
|
|
12383
|
-
|
|
12396
|
+
const ie = D.get(G);
|
|
12397
|
+
ie ? r.copySourceFragment = ie : m.error(
|
|
12384
12398
|
"Haori",
|
|
12385
|
-
`Element is not managed by Haori: ${
|
|
12399
|
+
`Element is not managed by Haori: ${W} (${ce})`
|
|
12386
12400
|
);
|
|
12387
12401
|
} else
|
|
12388
12402
|
m.error(
|
|
12389
12403
|
"Haori",
|
|
12390
|
-
`Element not found: ${
|
|
12404
|
+
`Element not found: ${W} (${ce})`
|
|
12391
12405
|
);
|
|
12392
12406
|
} else
|
|
12393
12407
|
r.copySourceFragment = e;
|
|
12394
12408
|
}
|
|
12395
12409
|
}
|
|
12396
12410
|
if (!t && (e.hasAttribute(g.attrName(null, "data", !0)) && (r.dataAttrName = g.attrName(null, "data", !0)), e.hasAttribute(g.attrName(null, "form", !0)))) {
|
|
12397
|
-
const
|
|
12411
|
+
const k = z.read(
|
|
12398
12412
|
e,
|
|
12399
12413
|
g.attrName(null, "form", !0)
|
|
12400
12414
|
);
|
|
12401
|
-
if (
|
|
12402
|
-
const
|
|
12403
|
-
|
|
12415
|
+
if (k) {
|
|
12416
|
+
const B = z.query(
|
|
12417
|
+
k,
|
|
12404
12418
|
g.attrName(null, "form", !0)
|
|
12405
12419
|
);
|
|
12406
|
-
|
|
12407
|
-
D.get(
|
|
12420
|
+
B !== null ? r.formFragment = x.getFormFragment(
|
|
12421
|
+
D.get(B)
|
|
12408
12422
|
) : m.error(
|
|
12409
12423
|
"Haori",
|
|
12410
|
-
`Form element not found: ${
|
|
12424
|
+
`Form element not found: ${k} (${g.attrName(null, "fetch-form", !0)})`
|
|
12411
12425
|
);
|
|
12412
12426
|
} else
|
|
12413
12427
|
r.formFragment = x.getFormFragment(e);
|
|
12414
12428
|
}
|
|
12415
12429
|
(!t || t === "poll") && g.readNoMessageDeclarations(e, r, t ?? "fetch");
|
|
12416
|
-
const
|
|
12417
|
-
if (e.hasAttribute(
|
|
12418
|
-
const
|
|
12419
|
-
|
|
12420
|
-
const
|
|
12421
|
-
|
|
12422
|
-
}),
|
|
12430
|
+
const ae = t ? g.attrName(t, "fetch-state") : g.attrName(null, "state", !0);
|
|
12431
|
+
if (e.hasAttribute(ae)) {
|
|
12432
|
+
const k = z.read(e, ae), B = [];
|
|
12433
|
+
k ? (z.queryAll(k, ae).forEach((U) => {
|
|
12434
|
+
const Q = D.get(U);
|
|
12435
|
+
Q && B.push(Q);
|
|
12436
|
+
}), B.length === 0 && m.error(
|
|
12423
12437
|
"Haori",
|
|
12424
|
-
`Element not found: ${
|
|
12425
|
-
)) :
|
|
12438
|
+
`Element not found: ${k} (${ae})`
|
|
12439
|
+
)) : B.push(e), B.length > 0 && (r.fetchStateFragments = B);
|
|
12426
12440
|
}
|
|
12427
|
-
const
|
|
12428
|
-
if (e.hasAttribute(
|
|
12429
|
-
const
|
|
12430
|
-
if (
|
|
12441
|
+
const j = t ? g.attrName(t, "store-clear") : g.attrName(null, "store-clear", !0);
|
|
12442
|
+
if (e.hasAttribute(j)) {
|
|
12443
|
+
const k = e.getRawAttribute(j), B = k === null ? "" : k.trim();
|
|
12444
|
+
if (B === "")
|
|
12431
12445
|
m.error(
|
|
12432
12446
|
"Haori",
|
|
12433
|
-
`ストレージキーが指定されていません (${
|
|
12447
|
+
`ストレージキーが指定されていません (${j})`
|
|
12434
12448
|
);
|
|
12435
12449
|
else {
|
|
12436
|
-
r.storeClearKey =
|
|
12437
|
-
const
|
|
12438
|
-
`${
|
|
12439
|
-
),
|
|
12440
|
-
|
|
12450
|
+
r.storeClearKey = B;
|
|
12451
|
+
const ue = e.getRawAttribute(
|
|
12452
|
+
`${j}-type`
|
|
12453
|
+
), U = ue === null ? "session" : ue.trim();
|
|
12454
|
+
U === "local" || U === "session" ? r.storeClearKind = U : (m.warn(
|
|
12441
12455
|
"Haori",
|
|
12442
|
-
`${
|
|
12456
|
+
`${j}-type は session または local を指定してください(session として扱います): ${U}`
|
|
12443
12457
|
), r.storeClearKind = "session");
|
|
12444
12458
|
}
|
|
12445
12459
|
}
|
|
@@ -12539,6 +12553,64 @@ ${O}
|
|
|
12539
12553
|
async runWithOutcome() {
|
|
12540
12554
|
return await this.execute() ? "success" : this.skipped ? "skipped" : "failure";
|
|
12541
12555
|
}
|
|
12556
|
+
/**
|
|
12557
|
+
* `data-{event}-clipboard` の値をクリップボードへ書き始めます。
|
|
12558
|
+
*
|
|
12559
|
+
* 値は呼んだ時点で評価します。評価結果が空(`null` / `undefined` / `false` /
|
|
12560
|
+
* `NaN` / 空文字)の場合と未解決参照を含む場合は書きません。書き込みは同期に始め、
|
|
12561
|
+
* 結果は Promise で返します(仕様「`data-{event}-clipboard`」)。
|
|
12562
|
+
*
|
|
12563
|
+
* @param attributeName 値を宣言した属性名
|
|
12564
|
+
* @returns 書き込みが完了したら true、書かなかった・失敗した場合は false
|
|
12565
|
+
* で解決する Promise
|
|
12566
|
+
*/
|
|
12567
|
+
startClipboardWrite(e) {
|
|
12568
|
+
const t = this.options.targetFragment?.getAttributeEvaluation(e);
|
|
12569
|
+
if (t?.hasUnresolvedReference)
|
|
12570
|
+
return Promise.resolve(!1);
|
|
12571
|
+
const r = t?.value, i = r == null || r === !1 || Number.isNaN(r) ? "" : String(r);
|
|
12572
|
+
if (i === "")
|
|
12573
|
+
return Promise.resolve(!1);
|
|
12574
|
+
const s = typeof navigator > "u" ? void 0 : navigator.clipboard;
|
|
12575
|
+
if (!s || typeof s.writeText != "function")
|
|
12576
|
+
return m.warn(
|
|
12577
|
+
"Haori",
|
|
12578
|
+
`${e}: navigator.clipboard is not available (it requires a secure context such as HTTPS).`
|
|
12579
|
+
), Promise.resolve(!1);
|
|
12580
|
+
try {
|
|
12581
|
+
return s.writeText(i).then(
|
|
12582
|
+
() => !0,
|
|
12583
|
+
(n) => (m.warn("Haori", `${e}: failed to write: ${n}`), !1)
|
|
12584
|
+
);
|
|
12585
|
+
} catch (n) {
|
|
12586
|
+
return m.warn("Haori", `${e}: failed to write: ${n}`), Promise.resolve(!1);
|
|
12587
|
+
}
|
|
12588
|
+
}
|
|
12589
|
+
/**
|
|
12590
|
+
* クリップボードへ書けずに止まったことをトーストで知らせます。
|
|
12591
|
+
*
|
|
12592
|
+
* 仕様「`data-{event}-clipboard`」の「書けなかったことを知らせる」です。文言と
|
|
12593
|
+
* レベルは表示直前に評価し直します。
|
|
12594
|
+
*
|
|
12595
|
+
* @returns 表示を終えたら解決する Promise
|
|
12596
|
+
*/
|
|
12597
|
+
async showClipboardErrorToast() {
|
|
12598
|
+
const e = g.normalizeAttributeText(
|
|
12599
|
+
this.resolveLateAttribute(
|
|
12600
|
+
"clipboard-error-toast",
|
|
12601
|
+
this.options.clipboardErrorToastMessage
|
|
12602
|
+
)
|
|
12603
|
+
);
|
|
12604
|
+
if (!e)
|
|
12605
|
+
return;
|
|
12606
|
+
const t = g.toToastLevel(
|
|
12607
|
+
this.resolveLateAttribute(
|
|
12608
|
+
"clipboard-error-toast-level",
|
|
12609
|
+
this.options.clipboardErrorToastLevel
|
|
12610
|
+
)
|
|
12611
|
+
);
|
|
12612
|
+
await ge().toast(e, t ?? "info");
|
|
12613
|
+
}
|
|
12542
12614
|
/**
|
|
12543
12615
|
* 一連の処理を実行します。成功結果を内部で扱うための実体です。
|
|
12544
12616
|
*
|
|
@@ -12558,104 +12630,112 @@ ${O}
|
|
|
12558
12630
|
`${c.prefix}${this.eventType ?? "fetch"}-form が解決できません`
|
|
12559
12631
|
), !this.evaluateExecutionCondition())
|
|
12560
12632
|
return this.skipped = !0, await this.commitEditOnStop(), !1;
|
|
12633
|
+
let t;
|
|
12561
12634
|
if (this.options.runScript) {
|
|
12562
|
-
const
|
|
12635
|
+
const A = this.options.targetFragment?.getTarget() ?? null;
|
|
12563
12636
|
try {
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
);
|
|
12568
|
-
b === !1 && this.domEvent && this.domEvent.preventDefault(), b != null && typeof b.then == "function" && await b;
|
|
12569
|
-
} catch (b) {
|
|
12570
|
-
m.error("Haori", `Run script execution error: ${b}`);
|
|
12637
|
+
t = this.options.runScript.call(A, this.domEvent), t === !1 && this.domEvent && this.domEvent.preventDefault();
|
|
12638
|
+
} catch (w) {
|
|
12639
|
+
m.error("Haori", `Run script execution error: ${w}`);
|
|
12571
12640
|
}
|
|
12572
12641
|
}
|
|
12642
|
+
const r = this.options.clipboardAttrName ? this.startClipboardWrite(this.options.clipboardAttrName) : null;
|
|
12643
|
+
if (t != null && typeof t.then == "function")
|
|
12644
|
+
try {
|
|
12645
|
+
await t;
|
|
12646
|
+
} catch (A) {
|
|
12647
|
+
m.error("Haori", `Run script execution error: ${A}`);
|
|
12648
|
+
}
|
|
12649
|
+
if (r && !await r)
|
|
12650
|
+
return await this.commitEditOnStop(), await this.showClipboardErrorToast(), !1;
|
|
12573
12651
|
if (!await this.confirm())
|
|
12574
12652
|
return await this.commitEditOnStop(), !1;
|
|
12575
12653
|
if (this.options.downloadFolder && await this.prepareDownloadFolder() === "cancelled")
|
|
12576
12654
|
return !1;
|
|
12577
12655
|
this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
|
|
12578
12656
|
this.options.resetBeforeFragments.map(
|
|
12579
|
-
(
|
|
12657
|
+
(A) => x.reset(A, this.operationSequence)
|
|
12580
12658
|
)
|
|
12581
12659
|
), this.captureHistorySnapshots());
|
|
12582
|
-
const
|
|
12660
|
+
const s = this.prepareFetchRequest();
|
|
12661
|
+
if (s.payloadTransformFailed)
|
|
12662
|
+
return await this.commitEditOnStop(), !1;
|
|
12583
12663
|
this.requestUserEditSequence = R.currentSequence();
|
|
12584
|
-
const
|
|
12585
|
-
let
|
|
12664
|
+
const n = s.payload, a = Object.keys(s.sentPayload).length > 0 ? s.sentPayload : void 0;
|
|
12665
|
+
let o = s.url, l = s.options, u = !1, d = !1;
|
|
12586
12666
|
if (this.options.beforeCallback) {
|
|
12587
|
-
const
|
|
12588
|
-
|
|
12589
|
-
|
|
12667
|
+
const A = this.options.beforeCallback(
|
|
12668
|
+
o || null,
|
|
12669
|
+
l || null
|
|
12590
12670
|
);
|
|
12591
|
-
if (
|
|
12592
|
-
if (
|
|
12671
|
+
if (A != null) {
|
|
12672
|
+
if (A === !1 || typeof A == "object" && A.stop)
|
|
12593
12673
|
return !1;
|
|
12594
|
-
typeof
|
|
12674
|
+
typeof A == "object" && (u = "fetchUrl" in A, d = "fetchOptions" in A, o = u ? A.fetchUrl : o, l = d ? A.fetchOptions : l);
|
|
12595
12675
|
}
|
|
12596
12676
|
}
|
|
12597
|
-
const
|
|
12598
|
-
if (
|
|
12677
|
+
const y = Object.keys(n).length > 0;
|
|
12678
|
+
if (o) {
|
|
12599
12679
|
this.isInputEditProcedure() && await this.commitFormValues(
|
|
12600
12680
|
this.options.formFragment,
|
|
12601
|
-
|
|
12681
|
+
n,
|
|
12602
12682
|
e
|
|
12603
12683
|
);
|
|
12604
|
-
const
|
|
12605
|
-
|
|
12606
|
-
|
|
12684
|
+
const A = (l?.method || "GET").toUpperCase(), $ = !u && d && s.transportMode === "query-get" && Nr(l) && !je(A) ? s.baseUrl ?? o : o, C = Ir(
|
|
12685
|
+
$,
|
|
12686
|
+
l
|
|
12607
12687
|
);
|
|
12608
|
-
|
|
12609
|
-
const
|
|
12610
|
-
if (
|
|
12688
|
+
o = C.url;
|
|
12689
|
+
const se = { ...C.options }, F = C.normalized ? C.requestedMethod : s.requestedMethod, Z = C.effectiveMethod, ee = s.transportMode === "query-get" || C.normalized, ne = C.queryString ?? s.queryString;
|
|
12690
|
+
if (ee && m.info("Haori demo fetch normalization", {
|
|
12611
12691
|
runtime: c.runtime,
|
|
12612
|
-
requestedMethod:
|
|
12613
|
-
effectiveMethod:
|
|
12692
|
+
requestedMethod: F,
|
|
12693
|
+
effectiveMethod: Z,
|
|
12614
12694
|
transportMode: "query-get",
|
|
12615
|
-
url:
|
|
12616
|
-
payload:
|
|
12617
|
-
queryString:
|
|
12618
|
-
}), this.options.targetFragment &&
|
|
12619
|
-
const
|
|
12695
|
+
url: o,
|
|
12696
|
+
payload: a,
|
|
12697
|
+
queryString: ne
|
|
12698
|
+
}), this.options.targetFragment && o) {
|
|
12699
|
+
const K = performance.now(), ae = {
|
|
12620
12700
|
runtime: c.runtime,
|
|
12621
|
-
requestedMethod:
|
|
12622
|
-
effectiveMethod:
|
|
12623
|
-
transportMode:
|
|
12624
|
-
...
|
|
12701
|
+
requestedMethod: F,
|
|
12702
|
+
effectiveMethod: Z,
|
|
12703
|
+
transportMode: ee ? "query-get" : "http",
|
|
12704
|
+
...ee ? { queryString: ne } : {}
|
|
12625
12705
|
};
|
|
12626
|
-
return
|
|
12706
|
+
return O.fetchStart(
|
|
12627
12707
|
this.options.targetFragment.getTarget(),
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
), await this.injectFetchState("loading"), await g.invokeFetch(
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
)).catch(async (
|
|
12637
|
-
throw
|
|
12708
|
+
o,
|
|
12709
|
+
se,
|
|
12710
|
+
a,
|
|
12711
|
+
ae
|
|
12712
|
+
), await this.injectFetchState("loading"), await g.invokeFetch(o, se).then((j) => this.handleFetchResult(
|
|
12713
|
+
j,
|
|
12714
|
+
o || void 0,
|
|
12715
|
+
K
|
|
12716
|
+
)).catch(async (j) => {
|
|
12717
|
+
throw o && O.fetchError(
|
|
12638
12718
|
this.options.targetFragment.getTarget(),
|
|
12639
|
-
|
|
12640
|
-
|
|
12719
|
+
o,
|
|
12720
|
+
j
|
|
12641
12721
|
), await this.injectFetchState(
|
|
12642
12722
|
"error",
|
|
12643
12723
|
null,
|
|
12644
|
-
|
|
12645
|
-
), await this.runErrorActions(null),
|
|
12724
|
+
j instanceof Error ? j.message : String(j)
|
|
12725
|
+
), await this.runErrorActions(null), j;
|
|
12646
12726
|
});
|
|
12647
12727
|
}
|
|
12648
|
-
return await fetch(
|
|
12728
|
+
return await fetch(o, se).then((K) => this.handleFetchResult(K, o || void 0));
|
|
12649
12729
|
}
|
|
12650
|
-
(!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment &&
|
|
12730
|
+
(!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && y && await this.commitFormValues(
|
|
12651
12731
|
this.options.formFragment,
|
|
12652
|
-
|
|
12732
|
+
n,
|
|
12653
12733
|
e
|
|
12654
|
-
), this.suppressEmptyReplaceBind = !
|
|
12655
|
-
const
|
|
12734
|
+
), this.suppressEmptyReplaceBind = !y && !this.options.formFragment && (this.eventType === "change" || this.eventType === "input"), this.twoWayCommitBind = this.eventType === "change" || this.eventType === "input";
|
|
12735
|
+
const b = y ? st(n) : {}, E = new Response(JSON.stringify(b), {
|
|
12656
12736
|
headers: { "Content-Type": "application/json" }
|
|
12657
12737
|
});
|
|
12658
|
-
return await this.handleFetchResult(
|
|
12738
|
+
return await this.handleFetchResult(E);
|
|
12659
12739
|
} finally {
|
|
12660
12740
|
this.releaseExecutionLock(e);
|
|
12661
12741
|
}
|
|
@@ -12720,7 +12800,7 @@ ${O}
|
|
|
12720
12800
|
a,
|
|
12721
12801
|
x.ancestorBaseResolver(e)
|
|
12722
12802
|
);
|
|
12723
|
-
await
|
|
12803
|
+
await M.setBindingData(i, l, {
|
|
12724
12804
|
skipFragments: s,
|
|
12725
12805
|
kind: "nonSupply",
|
|
12726
12806
|
sequence: this.operationSequence,
|
|
@@ -12795,7 +12875,7 @@ ${O}
|
|
|
12795
12875
|
t.removeAttribute("disabled");
|
|
12796
12876
|
return;
|
|
12797
12877
|
}
|
|
12798
|
-
|
|
12878
|
+
M.setAttribute(t, r.name, r.value).catch(
|
|
12799
12879
|
(i) => {
|
|
12800
12880
|
m.error(
|
|
12801
12881
|
"Haori",
|
|
@@ -12812,7 +12892,7 @@ ${O}
|
|
|
12812
12892
|
* 「選んだフォルダは、そのページが開いている間だけ覚えます」)。
|
|
12813
12893
|
*/
|
|
12814
12894
|
static forgetDownloadFolder() {
|
|
12815
|
-
|
|
12895
|
+
Pe = null;
|
|
12816
12896
|
}
|
|
12817
12897
|
/**
|
|
12818
12898
|
* 保存先のフォルダを用意します。
|
|
@@ -12824,8 +12904,8 @@ ${O}
|
|
|
12824
12904
|
* 今までどおりの保存へ落とす場合は `fallback`
|
|
12825
12905
|
*/
|
|
12826
12906
|
async prepareDownloadFolder() {
|
|
12827
|
-
if (
|
|
12828
|
-
return this.downloadFolder =
|
|
12907
|
+
if (Pe)
|
|
12908
|
+
return this.downloadFolder = Pe, "ready";
|
|
12829
12909
|
const e = globalThis.showDirectoryPicker;
|
|
12830
12910
|
if (typeof e != "function")
|
|
12831
12911
|
return m.info(
|
|
@@ -12834,7 +12914,7 @@ ${O}
|
|
|
12834
12914
|
), "fallback";
|
|
12835
12915
|
try {
|
|
12836
12916
|
const t = await e.call(globalThis, { mode: "readwrite" });
|
|
12837
|
-
return
|
|
12917
|
+
return Pe = t, this.downloadFolder = t, "ready";
|
|
12838
12918
|
} catch (t) {
|
|
12839
12919
|
return t?.name === "AbortError" ? "cancelled" : (m.info(
|
|
12840
12920
|
"Haori",
|
|
@@ -12963,7 +13043,7 @@ ${O}
|
|
|
12963
13043
|
`保存先のフォルダを確かめられなかったため、今までどおり保存します: ${l}`
|
|
12964
13044
|
), "fallback";
|
|
12965
13045
|
}
|
|
12966
|
-
if (n && !await
|
|
13046
|
+
if (n && !await ge().confirm(
|
|
12967
13047
|
`${s} は既にあります。上書きしますか?`
|
|
12968
13048
|
))
|
|
12969
13049
|
return "cancelled";
|
|
@@ -13020,7 +13100,7 @@ ${O}
|
|
|
13020
13100
|
);
|
|
13021
13101
|
if (a !== "fallback")
|
|
13022
13102
|
return a;
|
|
13023
|
-
this.downloadFolder = null,
|
|
13103
|
+
this.downloadFolder = null, Pe = null;
|
|
13024
13104
|
}
|
|
13025
13105
|
const r = await this.readResponseBody(e);
|
|
13026
13106
|
if (r === null)
|
|
@@ -13049,7 +13129,7 @@ ${O}
|
|
|
13049
13129
|
* @returns 表示の完了 Promise
|
|
13050
13130
|
*/
|
|
13051
13131
|
async showDownloadFailure(e) {
|
|
13052
|
-
const t = this.resolveMessageScope(), r =
|
|
13132
|
+
const t = this.resolveMessageScope(), r = ge();
|
|
13053
13133
|
await r.clearMessages(t), e && await r.addErrorMessage(t, Dt);
|
|
13054
13134
|
}
|
|
13055
13135
|
/**
|
|
@@ -13133,34 +13213,34 @@ ${O}
|
|
|
13133
13213
|
* フェッチ後の処理を実行します。
|
|
13134
13214
|
*/
|
|
13135
13215
|
async handleFetchResult(e, t, r) {
|
|
13136
|
-
const i =
|
|
13216
|
+
const i = ge();
|
|
13137
13217
|
if (!e.ok) {
|
|
13138
13218
|
if (Jt(e.status, {
|
|
13139
13219
|
element: this.options.targetFragment.getTarget(),
|
|
13140
13220
|
attrPrefix: g.attrName(this.eventType, "", !0)
|
|
13141
13221
|
}))
|
|
13142
13222
|
return !1;
|
|
13143
|
-
this.options.targetFragment && t &&
|
|
13223
|
+
this.options.targetFragment && t && O.fetchError(
|
|
13144
13224
|
this.options.targetFragment.getTarget(),
|
|
13145
13225
|
t,
|
|
13146
13226
|
new Error(`${e.status} ${e.statusText}`),
|
|
13147
13227
|
e.status,
|
|
13148
13228
|
r
|
|
13149
13229
|
);
|
|
13150
|
-
const E = this.selectErrorActions(e.status), A = E?.bind === !0,
|
|
13230
|
+
const E = this.selectErrorActions(e.status), A = E?.bind === !0, w = await this.handleFetchError(
|
|
13151
13231
|
A ? e.clone() : e,
|
|
13152
13232
|
E?.noMessage !== !0 && !A
|
|
13153
13233
|
);
|
|
13154
|
-
return A && await this.bindResult(e).catch((
|
|
13155
|
-
m.error("Haori", "Failed to bind the error response:",
|
|
13234
|
+
return A && await this.bindResult(e).catch(($) => {
|
|
13235
|
+
m.error("Haori", "Failed to bind the error response:", $);
|
|
13156
13236
|
}), await this.injectFetchState(
|
|
13157
13237
|
"error",
|
|
13158
13238
|
e.status,
|
|
13159
13239
|
e.statusText || null,
|
|
13160
|
-
|
|
13240
|
+
w
|
|
13161
13241
|
), await this.runErrorActions(e.status), !1;
|
|
13162
13242
|
}
|
|
13163
|
-
if (this.options.targetFragment && t && r &&
|
|
13243
|
+
if (this.options.targetFragment && t && r && O.fetchEnd(
|
|
13164
13244
|
this.options.targetFragment.getTarget(),
|
|
13165
13245
|
t,
|
|
13166
13246
|
e.status,
|
|
@@ -13230,7 +13310,7 @@ ${O}
|
|
|
13230
13310
|
"scroll",
|
|
13231
13311
|
this.options.scrollTarget
|
|
13232
13312
|
);
|
|
13233
|
-
u &&
|
|
13313
|
+
u && z.query(
|
|
13234
13314
|
u,
|
|
13235
13315
|
g.attrName(this.eventType, "scroll"),
|
|
13236
13316
|
document
|
|
@@ -13254,16 +13334,16 @@ ${O}
|
|
|
13254
13334
|
this.options.redirectReturnParam
|
|
13255
13335
|
);
|
|
13256
13336
|
if (A) {
|
|
13257
|
-
const
|
|
13258
|
-
if (
|
|
13259
|
-
const
|
|
13260
|
-
|
|
13337
|
+
const $ = new URLSearchParams(window.location.search).get(A);
|
|
13338
|
+
if ($ !== null) {
|
|
13339
|
+
const C = $.trim();
|
|
13340
|
+
Oe.isSafeLocalPath(C) ? E = C : m.warn(
|
|
13261
13341
|
"Haori",
|
|
13262
|
-
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${
|
|
13342
|
+
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${$}`
|
|
13263
13343
|
);
|
|
13264
13344
|
}
|
|
13265
13345
|
}
|
|
13266
|
-
|
|
13346
|
+
Oe.isNavigableUrl(E) ? y ? window.location.replace(E) : window.location.href = E : m.error(
|
|
13267
13347
|
"Haori",
|
|
13268
13348
|
`遷移先が http: / https: / 現在ページと同じスキームの URL ではないため遷移しません: ${E}`
|
|
13269
13349
|
);
|
|
@@ -13278,7 +13358,7 @@ ${O}
|
|
|
13278
13358
|
*/
|
|
13279
13359
|
clearStore() {
|
|
13280
13360
|
const e = this.options.storeClearKey;
|
|
13281
|
-
e &&
|
|
13361
|
+
e && Be.clear(e, this.options.storeClearKind ?? "session");
|
|
13282
13362
|
}
|
|
13283
13363
|
/**
|
|
13284
13364
|
* 対象を宣言した順にクリックします(`data-{event}-click` /
|
|
@@ -13296,7 +13376,7 @@ ${O}
|
|
|
13296
13376
|
if (!e || e.length === 0)
|
|
13297
13377
|
return !1;
|
|
13298
13378
|
for (const i of e) {
|
|
13299
|
-
await
|
|
13379
|
+
await M.evaluateAll(i);
|
|
13300
13380
|
const s = i.getTarget();
|
|
13301
13381
|
if (t && g.takeClickOutcome(s), typeof s.click == "function" ? s.click() : s.dispatchEvent(
|
|
13302
13382
|
new MouseEvent("click", { bubbles: !0, cancelable: !0 })
|
|
@@ -13332,7 +13412,7 @@ ${O}
|
|
|
13332
13412
|
`${t.key}-click-await`
|
|
13333
13413
|
))
|
|
13334
13414
|
return;
|
|
13335
|
-
const i =
|
|
13415
|
+
const i = ge(), s = [];
|
|
13336
13416
|
t.closeFragments?.forEach((a) => {
|
|
13337
13417
|
const o = a.getTarget();
|
|
13338
13418
|
o instanceof HTMLElement ? s.push(i.closeDialog(o)) : m.error("Haori", "Element is not an HTML element: ", o);
|
|
@@ -13433,7 +13513,7 @@ ${O}
|
|
|
13433
13513
|
{ [Sr]: !0 },
|
|
13434
13514
|
"",
|
|
13435
13515
|
o.toString()
|
|
13436
|
-
),
|
|
13516
|
+
), M.refreshUrlParams();
|
|
13437
13517
|
} catch (a) {
|
|
13438
13518
|
m.error("Haori", `history.pushState failed: ${a}`);
|
|
13439
13519
|
}
|
|
@@ -13464,10 +13544,10 @@ ${O}
|
|
|
13464
13544
|
let r = null;
|
|
13465
13545
|
this.options.formFragment ? r = this.options.formFragment : this.options.targetFragment && (r = x.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
|
|
13466
13546
|
const i = r ? r.getTarget() : document.body;
|
|
13467
|
-
await
|
|
13547
|
+
await ge().clearMessages(i);
|
|
13468
13548
|
const s = async (u) => {
|
|
13469
13549
|
const d = r ? r.getTarget() : document.body;
|
|
13470
|
-
await
|
|
13550
|
+
await ge().addErrorMessage(d, u);
|
|
13471
13551
|
}, n = () => {
|
|
13472
13552
|
if (!this.options.scrollOnError)
|
|
13473
13553
|
return;
|
|
@@ -13492,14 +13572,14 @@ ${O}
|
|
|
13492
13572
|
const y = /* @__PURE__ */ new Map(), b = [];
|
|
13493
13573
|
for (const E of u)
|
|
13494
13574
|
if (E && typeof E == "object" && !Array.isArray(E)) {
|
|
13495
|
-
const A = E.key,
|
|
13496
|
-
if (
|
|
13575
|
+
const A = E.key, w = E.message, $ = typeof A == "string" && A.length > 0 ? A : null, C = typeof w == "string" ? w : w != null ? String(w) : "";
|
|
13576
|
+
if (C.length === 0)
|
|
13497
13577
|
continue;
|
|
13498
|
-
if (
|
|
13499
|
-
const se = y.get(
|
|
13500
|
-
se.push(
|
|
13578
|
+
if ($ !== null) {
|
|
13579
|
+
const se = y.get($) ?? [];
|
|
13580
|
+
se.push(C), y.set($, se);
|
|
13501
13581
|
} else
|
|
13502
|
-
b.push(
|
|
13582
|
+
b.push(C);
|
|
13503
13583
|
} else typeof E == "string" && E.length > 0 && b.push(E);
|
|
13504
13584
|
for (const [E, A] of y)
|
|
13505
13585
|
d.push({ key: E, message: A.join(`
|
|
@@ -13636,7 +13716,7 @@ ${O}
|
|
|
13636
13716
|
const i = this.options.conditionAttributeName ?? `${c.prefix}if`, s = x.buildConditionScope(
|
|
13637
13717
|
r,
|
|
13638
13718
|
this.options.formFragment ?? null
|
|
13639
|
-
), n =
|
|
13719
|
+
), n = re.evaluateDetailed(t, s);
|
|
13640
13720
|
return n.unresolvedReference ? (e || m.warn(
|
|
13641
13721
|
"Haori",
|
|
13642
13722
|
`${i} の参照が解決できないため実行しません: ${t}`
|
|
@@ -13681,7 +13761,7 @@ ${O}
|
|
|
13681
13761
|
*/
|
|
13682
13762
|
confirm() {
|
|
13683
13763
|
const e = this.options.confirmMessage;
|
|
13684
|
-
return e == null ? Promise.resolve(!0) :
|
|
13764
|
+
return e == null ? Promise.resolve(!0) : ge().confirm(e);
|
|
13685
13765
|
}
|
|
13686
13766
|
/**
|
|
13687
13767
|
* 結果データを対象のフラグメントにバインドします。
|
|
@@ -13698,7 +13778,7 @@ ${O}
|
|
|
13698
13778
|
let i = t ? JSON.parse(r) : r;
|
|
13699
13779
|
if (this.options.bindTransform)
|
|
13700
13780
|
try {
|
|
13701
|
-
i =
|
|
13781
|
+
i = re.evaluate(this.options.bindTransform, {
|
|
13702
13782
|
response: i
|
|
13703
13783
|
});
|
|
13704
13784
|
} catch (o) {
|
|
@@ -13733,11 +13813,11 @@ ${O}
|
|
|
13733
13813
|
apply: (b) => {
|
|
13734
13814
|
const E = this.resolveCurrentRowItem(o, b), A = { ...E };
|
|
13735
13815
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
13736
|
-
const
|
|
13816
|
+
const w = E[y], $ = w !== null && typeof w == "object" && !Array.isArray(w) ? w : {};
|
|
13737
13817
|
A[y] = this.mergeAppendBindingData(
|
|
13738
13818
|
o,
|
|
13739
13819
|
i,
|
|
13740
|
-
|
|
13820
|
+
$
|
|
13741
13821
|
);
|
|
13742
13822
|
} else
|
|
13743
13823
|
A[y] = i;
|
|
@@ -13757,7 +13837,7 @@ ${O}
|
|
|
13757
13837
|
} else
|
|
13758
13838
|
u[d] = i;
|
|
13759
13839
|
s.push(
|
|
13760
|
-
|
|
13840
|
+
M.setBindingData(
|
|
13761
13841
|
o.getTarget(),
|
|
13762
13842
|
this.reconcileUserEditsForBind(o, u, [d]),
|
|
13763
13843
|
{
|
|
@@ -13815,7 +13895,7 @@ ${O}
|
|
|
13815
13895
|
i
|
|
13816
13896
|
), d = this.options.bindMerge ? { ...o.getRawBindingData() ?? {}, ...u } : u;
|
|
13817
13897
|
s.push(
|
|
13818
|
-
|
|
13898
|
+
M.setBindingData(
|
|
13819
13899
|
o.getTarget(),
|
|
13820
13900
|
this.reconcileUserEditsForBind(
|
|
13821
13901
|
o,
|
|
@@ -13834,7 +13914,7 @@ ${O}
|
|
|
13834
13914
|
return s.push(this.applyRowWrites(a)), Promise.all(s).then(() => {
|
|
13835
13915
|
const o = this.options.bindArg ?? null;
|
|
13836
13916
|
this.options.bindFragments.forEach((l) => {
|
|
13837
|
-
|
|
13917
|
+
O.bindComplete(l.getTarget(), o);
|
|
13838
13918
|
});
|
|
13839
13919
|
});
|
|
13840
13920
|
});
|
|
@@ -13877,7 +13957,7 @@ ${O}
|
|
|
13877
13957
|
if (i === null)
|
|
13878
13958
|
return t;
|
|
13879
13959
|
const s = this.eventType === "poll";
|
|
13880
|
-
if (!s && !this.twoWayCommitBind &&
|
|
13960
|
+
if (!s && !this.twoWayCommitBind && M.clearUserEditMarks(e, i), !(e.getTarget() instanceof HTMLFormElement))
|
|
13881
13961
|
return this.reconcileAncestorArgFormEdits(
|
|
13882
13962
|
e,
|
|
13883
13963
|
t,
|
|
@@ -13893,9 +13973,9 @@ ${O}
|
|
|
13893
13973
|
const a = e.getAttribute(`${c.prefix}form-arg`);
|
|
13894
13974
|
if (a) {
|
|
13895
13975
|
const o = String(a), l = t[o], u = l && typeof l == "object" && !Array.isArray(l) ? l : {};
|
|
13896
|
-
return { ...t, [o]:
|
|
13976
|
+
return { ...t, [o]: we(u, n) };
|
|
13897
13977
|
}
|
|
13898
|
-
return
|
|
13978
|
+
return we(t, n);
|
|
13899
13979
|
}
|
|
13900
13980
|
/**
|
|
13901
13981
|
* 編集可能な行へのバインドについて、送信後の編集を要素データへ上書きし直します。
|
|
@@ -13917,12 +13997,12 @@ ${O}
|
|
|
13917
13997
|
if (r === null)
|
|
13918
13998
|
return t;
|
|
13919
13999
|
const i = this.eventType === "poll";
|
|
13920
|
-
!i && !this.twoWayCommitBind &&
|
|
14000
|
+
!i && !this.twoWayCommitBind && M.clearUserEditMarks(e, r);
|
|
13921
14001
|
const s = x.getValuesEditedAfter(
|
|
13922
14002
|
e,
|
|
13923
14003
|
i ? 0 : r
|
|
13924
14004
|
);
|
|
13925
|
-
return Object.keys(s).length === 0 ? t :
|
|
14005
|
+
return Object.keys(s).length === 0 ? t : we(t, s);
|
|
13926
14006
|
}
|
|
13927
14007
|
/**
|
|
13928
14008
|
* 祖先へのバインドについて、配下の `data-form-arg` フォームで送信後に行われた
|
|
@@ -13948,7 +14028,7 @@ ${O}
|
|
|
13948
14028
|
if (Object.keys(o).length === 0)
|
|
13949
14029
|
continue;
|
|
13950
14030
|
const l = s[a], u = l && typeof l == "object" && !Array.isArray(l) ? l : {};
|
|
13951
|
-
s = { ...s, [a]:
|
|
14031
|
+
s = { ...s, [a]: we(u, o) };
|
|
13952
14032
|
}
|
|
13953
14033
|
return s;
|
|
13954
14034
|
}
|
|
@@ -13991,7 +14071,7 @@ ${O}
|
|
|
13991
14071
|
...t
|
|
13992
14072
|
};
|
|
13993
14073
|
s.push(
|
|
13994
|
-
|
|
14074
|
+
M.setBindingData(n.getTarget(), o, {
|
|
13995
14075
|
// 通番はコピーを起こした操作のもの(フェッチ応答の反映と同じ理由)。
|
|
13996
14076
|
sequence: this.operationSequence
|
|
13997
14077
|
})
|
|
@@ -14025,7 +14105,7 @@ ${O}
|
|
|
14025
14105
|
*/
|
|
14026
14106
|
resolveCurrentRowItem(e, t) {
|
|
14027
14107
|
const r = x.getValuesEditedAfter(e, 0);
|
|
14028
|
-
return Object.keys(r).length === 0 ? t :
|
|
14108
|
+
return Object.keys(r).length === 0 ? t : we(t, r);
|
|
14029
14109
|
}
|
|
14030
14110
|
/**
|
|
14031
14111
|
* 行の要素データへコピーの値を反映します。
|
|
@@ -14053,9 +14133,9 @@ ${O}
|
|
|
14053
14133
|
* @returns コピー元のデータ
|
|
14054
14134
|
*/
|
|
14055
14135
|
resolveCopySourceData() {
|
|
14056
|
-
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ?
|
|
14136
|
+
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? We(this.options.copySourceFragment) : M.withoutReservedBindingKeys(
|
|
14057
14137
|
this.options.copySourceFragment.getRawBindingData() ?? {}
|
|
14058
|
-
) : this.options.formFragment ?
|
|
14138
|
+
) : this.options.formFragment ? We(this.options.formFragment) : this.options.targetFragment ? M.withoutReservedBindingKeys(
|
|
14059
14139
|
this.options.targetFragment.getRawBindingData() ?? {}
|
|
14060
14140
|
) : {};
|
|
14061
14141
|
}
|
|
@@ -14098,6 +14178,29 @@ ${O}
|
|
|
14098
14178
|
hasUnresolvedReference: e.hasUnresolvedReference
|
|
14099
14179
|
};
|
|
14100
14180
|
}
|
|
14181
|
+
/**
|
|
14182
|
+
* `data-{event}-payload-transform` の式で送信データを変換します。
|
|
14183
|
+
*
|
|
14184
|
+
* 式の中では送信データを `payload` として参照します。評価できない場合、未解決
|
|
14185
|
+
* 参照を含む場合、結果が配列ではないオブジェクトにならない場合は、送信データを
|
|
14186
|
+
* 作れなかったものとして null を返します(仕様
|
|
14187
|
+
* 「`data-{event}-payload-transform`(非イベント:
|
|
14188
|
+
* `data-fetch-payload-transform`)」)。
|
|
14189
|
+
*
|
|
14190
|
+
* @param expression 変換式
|
|
14191
|
+
* @param payload 収集した送信データ
|
|
14192
|
+
* @returns 変換した送信データ。作れなかった場合は null
|
|
14193
|
+
*/
|
|
14194
|
+
transformPayload(e, t) {
|
|
14195
|
+
const r = re.evaluateDetailed(e, { payload: t });
|
|
14196
|
+
if (r.unresolvedReference)
|
|
14197
|
+
return null;
|
|
14198
|
+
const i = r.value;
|
|
14199
|
+
return i === null || typeof i != "object" || Array.isArray(i) ? (m.error(
|
|
14200
|
+
"Haori",
|
|
14201
|
+
"payload-transform must return an object: " + e
|
|
14202
|
+
), null) : i;
|
|
14203
|
+
}
|
|
14101
14204
|
/**
|
|
14102
14205
|
* 現在のオプションから送信前の fetch リクエストを組み立てます。
|
|
14103
14206
|
*
|
|
@@ -14111,19 +14214,42 @@ ${O}
|
|
|
14111
14214
|
baseUrl: null,
|
|
14112
14215
|
options: null,
|
|
14113
14216
|
payload: t,
|
|
14217
|
+
sentPayload: t,
|
|
14114
14218
|
hasUnresolvedReference: r,
|
|
14115
14219
|
requestedMethod: "GET",
|
|
14116
14220
|
effectiveMethod: "GET",
|
|
14117
14221
|
transportMode: "http",
|
|
14118
14222
|
signature: null
|
|
14119
14223
|
};
|
|
14120
|
-
let i =
|
|
14121
|
-
|
|
14122
|
-
|
|
14123
|
-
|
|
14124
|
-
|
|
14125
|
-
|
|
14126
|
-
|
|
14224
|
+
let i = t;
|
|
14225
|
+
if (this.options.payloadTransform) {
|
|
14226
|
+
const y = this.transformPayload(
|
|
14227
|
+
this.options.payloadTransform,
|
|
14228
|
+
t
|
|
14229
|
+
);
|
|
14230
|
+
if (y === null)
|
|
14231
|
+
return {
|
|
14232
|
+
url: null,
|
|
14233
|
+
baseUrl: null,
|
|
14234
|
+
options: null,
|
|
14235
|
+
payload: t,
|
|
14236
|
+
sentPayload: t,
|
|
14237
|
+
payloadTransformFailed: !0,
|
|
14238
|
+
hasUnresolvedReference: !1,
|
|
14239
|
+
requestedMethod: "GET",
|
|
14240
|
+
effectiveMethod: "GET",
|
|
14241
|
+
transportMode: "http",
|
|
14242
|
+
signature: null
|
|
14243
|
+
};
|
|
14244
|
+
i = y;
|
|
14245
|
+
}
|
|
14246
|
+
let s = this.options.fetchUrl;
|
|
14247
|
+
const n = { ...this.options.fetchOptions || {} }, a = new Headers(
|
|
14248
|
+
n.headers || void 0
|
|
14249
|
+
), o = (n.method || "GET").toUpperCase(), l = c.runtime === "demo" && !je(o), u = l ? "GET" : o;
|
|
14250
|
+
if (n.method = u, Object.keys(i).length > 0 && Ue(i)) {
|
|
14251
|
+
const y = a.get("Content-Type") || "";
|
|
14252
|
+
!je(o) && /multipart\/form-data/i.test(y) ? Cr(i) && m.warn(
|
|
14127
14253
|
"Haori",
|
|
14128
14254
|
`A File value nested under ${c.prefix}form-object / ${c.prefix}form-list cannot be sent. Place file inputs at the top level of the collected form values.`
|
|
14129
14255
|
) : m.warn(
|
|
@@ -14131,39 +14257,40 @@ ${O}
|
|
|
14131
14257
|
`A File value cannot be sent without ${c.prefix}fetch-content-type="multipart/form-data" and a body method such as POST.`
|
|
14132
14258
|
);
|
|
14133
14259
|
}
|
|
14134
|
-
if (
|
|
14135
|
-
Object.keys(
|
|
14136
|
-
else if (Object.keys(
|
|
14137
|
-
const
|
|
14138
|
-
if (/multipart\/form-data/i.test(
|
|
14139
|
-
|
|
14140
|
-
const
|
|
14141
|
-
for (const [
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
}) :
|
|
14145
|
-
|
|
14146
|
-
} else if (/application\/x-www-form-urlencoded/i.test(
|
|
14147
|
-
const
|
|
14148
|
-
for (const [
|
|
14149
|
-
|
|
14150
|
-
|
|
14260
|
+
if (u === "GET" || u === "HEAD" || u === "OPTIONS")
|
|
14261
|
+
Object.keys(i).length > 0 && (s = Zt(s, i));
|
|
14262
|
+
else if (Object.keys(i).length > 0) {
|
|
14263
|
+
const y = a.get("Content-Type") || "";
|
|
14264
|
+
if (/multipart\/form-data/i.test(y)) {
|
|
14265
|
+
a.delete("Content-Type");
|
|
14266
|
+
const b = new FormData();
|
|
14267
|
+
for (const [E, A] of Object.entries(i))
|
|
14268
|
+
A == null ? b.append(E, "") : A instanceof Blob ? b.append(E, A) : Array.isArray(A) ? A.forEach((w) => {
|
|
14269
|
+
w instanceof Blob ? b.append(E, w) : b.append(E, Fe(w));
|
|
14270
|
+
}) : b.append(E, Fe(A));
|
|
14271
|
+
n.body = b;
|
|
14272
|
+
} else if (/application\/x-www-form-urlencoded/i.test(y)) {
|
|
14273
|
+
const b = new URLSearchParams();
|
|
14274
|
+
for (const [E, A] of Object.entries(i))
|
|
14275
|
+
A !== void 0 && (Array.isArray(A) ? A.forEach((w) => b.append(E, Fe(w))) : b.append(E, Fe(A)));
|
|
14276
|
+
n.body = b;
|
|
14151
14277
|
} else
|
|
14152
|
-
|
|
14278
|
+
a.set("Content-Type", "application/json"), n.body = JSON.stringify(i);
|
|
14153
14279
|
}
|
|
14154
|
-
|
|
14155
|
-
let
|
|
14156
|
-
return
|
|
14157
|
-
url:
|
|
14280
|
+
n.headers = a;
|
|
14281
|
+
let d;
|
|
14282
|
+
return l && (d = new URL(s, window.location.href).search || void 0, a.delete("Content-Type")), {
|
|
14283
|
+
url: s,
|
|
14158
14284
|
baseUrl: this.options.fetchUrl,
|
|
14159
|
-
options:
|
|
14285
|
+
options: n,
|
|
14160
14286
|
payload: t,
|
|
14287
|
+
sentPayload: i,
|
|
14161
14288
|
hasUnresolvedReference: !1,
|
|
14162
|
-
requestedMethod:
|
|
14163
|
-
effectiveMethod:
|
|
14164
|
-
queryString:
|
|
14165
|
-
transportMode:
|
|
14166
|
-
signature:
|
|
14289
|
+
requestedMethod: o,
|
|
14290
|
+
effectiveMethod: u,
|
|
14291
|
+
queryString: d,
|
|
14292
|
+
transportMode: l ? "query-get" : "http",
|
|
14293
|
+
signature: $r(s, n)
|
|
14167
14294
|
};
|
|
14168
14295
|
}
|
|
14169
14296
|
/**
|
|
@@ -14173,7 +14300,7 @@ ${O}
|
|
|
14173
14300
|
this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot = g.resolveDataAttribute(
|
|
14174
14301
|
this.options.targetFragment,
|
|
14175
14302
|
this.options.historyDataAttrName
|
|
14176
|
-
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ?
|
|
14303
|
+
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? We(this.options.historyFormFragment) : void 0;
|
|
14177
14304
|
}
|
|
14178
14305
|
/**
|
|
14179
14306
|
* history-data の評価値を取得します。
|
|
@@ -14195,7 +14322,7 @@ ${O}
|
|
|
14195
14322
|
if (this.historyFormSnapshot !== void 0)
|
|
14196
14323
|
return this.historyFormSnapshot;
|
|
14197
14324
|
if (this.options.historyFormFragment)
|
|
14198
|
-
return
|
|
14325
|
+
return We(this.options.historyFormFragment);
|
|
14199
14326
|
}
|
|
14200
14327
|
/**
|
|
14201
14328
|
* copy-params が指定されている場合は include / exclude を考慮して抽出します。
|
|
@@ -14264,9 +14391,9 @@ ${O}
|
|
|
14264
14391
|
const t = this.options.targetFragment;
|
|
14265
14392
|
if (!t)
|
|
14266
14393
|
return m.error("Haori", "Target fragment is not specified for row operation."), null;
|
|
14267
|
-
const r = g.attrName(this.eventType, e), i =
|
|
14394
|
+
const r = g.attrName(this.eventType, e), i = z.read(t, r);
|
|
14268
14395
|
if (i !== null && i.trim() !== "") {
|
|
14269
|
-
const n =
|
|
14396
|
+
const n = z.query(i, r, document);
|
|
14270
14397
|
if (n === null)
|
|
14271
14398
|
return m.error(
|
|
14272
14399
|
"Haori",
|
|
@@ -14544,7 +14671,7 @@ ${O}
|
|
|
14544
14671
|
}
|
|
14545
14672
|
if (!o)
|
|
14546
14673
|
return;
|
|
14547
|
-
const l =
|
|
14674
|
+
const l = M.setBindingData(
|
|
14548
14675
|
n.owner.getTarget(),
|
|
14549
14676
|
g.withPathValue(n.ownerData, n.path, a),
|
|
14550
14677
|
{
|
|
@@ -14560,7 +14687,7 @@ ${O}
|
|
|
14560
14687
|
sequence: this.operationSequence
|
|
14561
14688
|
}
|
|
14562
14689
|
);
|
|
14563
|
-
if (
|
|
14690
|
+
if (M.isEachUpdateRunning(s)) {
|
|
14564
14691
|
l.catch((u) => {
|
|
14565
14692
|
m.error("Haori", "Failed to write row data.", u);
|
|
14566
14693
|
});
|
|
@@ -14656,7 +14783,7 @@ ${O}
|
|
|
14656
14783
|
if (a && o !== null) {
|
|
14657
14784
|
const l = [];
|
|
14658
14785
|
r.forEach((y, b) => {
|
|
14659
|
-
|
|
14786
|
+
M.createListKey(
|
|
14660
14787
|
y,
|
|
14661
14788
|
String(a),
|
|
14662
14789
|
b
|
|
@@ -14775,14 +14902,14 @@ ${O}
|
|
|
14775
14902
|
if (g.isSameRowItem(i.array[E], b))
|
|
14776
14903
|
return;
|
|
14777
14904
|
const A = y.get(
|
|
14778
|
-
|
|
14905
|
+
M.createListKey(
|
|
14779
14906
|
b,
|
|
14780
14907
|
null,
|
|
14781
14908
|
E
|
|
14782
14909
|
)
|
|
14783
14910
|
);
|
|
14784
|
-
A &&
|
|
14785
|
-
}),
|
|
14911
|
+
A && M.clearUserEditMarks(A);
|
|
14912
|
+
}), M.setBindingData(
|
|
14786
14913
|
i.owner.getTarget(),
|
|
14787
14914
|
g.withPathValue(i.ownerData, i.path, d),
|
|
14788
14915
|
{
|
|
@@ -14827,7 +14954,7 @@ ${O}
|
|
|
14827
14954
|
...a.getRawBindingData() ?? {},
|
|
14828
14955
|
_fetch: n
|
|
14829
14956
|
};
|
|
14830
|
-
return
|
|
14957
|
+
return M.setBindingData(o, l, {
|
|
14831
14958
|
reflectToAttribute: !1,
|
|
14832
14959
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
14833
14960
|
// 解除しない)。
|
|
@@ -14839,8 +14966,8 @@ ${O}
|
|
|
14839
14966
|
}
|
|
14840
14967
|
};
|
|
14841
14968
|
g.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, g.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, g.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet(), g.CLICK_OUTCOMES = /* @__PURE__ */ new WeakMap(), g.validationReportGeneration = 0, g.VALIDATION_SCROLL_TIMEOUT_MS = 1e3, g.VALIDATION_SCROLL_STABLE_FRAMES = 2;
|
|
14842
|
-
let
|
|
14843
|
-
class
|
|
14969
|
+
let he = g;
|
|
14970
|
+
class Mr {
|
|
14844
14971
|
/**
|
|
14845
14972
|
* 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
|
|
14846
14973
|
*
|
|
@@ -14963,7 +15090,7 @@ const h = class h {
|
|
|
14963
15090
|
static reevaluateChildren(e) {
|
|
14964
15091
|
const t = [];
|
|
14965
15092
|
return e.getChildren().forEach((r) => {
|
|
14966
|
-
r instanceof R ? t.push(h.evaluateAll(r)) : r instanceof
|
|
15093
|
+
r instanceof R ? t.push(h.evaluateAll(r)) : r instanceof de && t.push(h.evaluateText(r));
|
|
14967
15094
|
}), Promise.all(t).then(() => {
|
|
14968
15095
|
});
|
|
14969
15096
|
}
|
|
@@ -15054,7 +15181,7 @@ const h = class h {
|
|
|
15054
15181
|
return Promise.all(h.initialValueRestores).then(() => h.executeManagedFetch(e, !0)).catch((a) => {
|
|
15055
15182
|
m.error("Haori", `初期表示の取得に失敗しました: ${a}`);
|
|
15056
15183
|
}), Promise.resolve();
|
|
15057
|
-
const i = h.getReactiveFetchState(r), s =
|
|
15184
|
+
const i = h.getReactiveFetchState(r), s = he.resolveAutoFetchSignature(e);
|
|
15058
15185
|
if (i.running)
|
|
15059
15186
|
return (s.hasUnresolvedReference || s.signature !== i.lastSignature) && (i.rerunRequested = !0), Promise.resolve();
|
|
15060
15187
|
if (s.hasUnresolvedReference || s.signature === null)
|
|
@@ -15062,7 +15189,7 @@ const h = class h {
|
|
|
15062
15189
|
if (i.lastSignature === s.signature)
|
|
15063
15190
|
return Promise.resolve();
|
|
15064
15191
|
i.lastSignature = s.signature, i.running = !0;
|
|
15065
|
-
const n = new
|
|
15192
|
+
const n = new he(e, null);
|
|
15066
15193
|
return n.markReentrantBind(), n.runWithResult().then(() => {
|
|
15067
15194
|
}).catch(() => {
|
|
15068
15195
|
}).finally(() => {
|
|
@@ -15088,23 +15215,23 @@ const h = class h {
|
|
|
15088
15215
|
return Promise.resolve();
|
|
15089
15216
|
r.lastUrl = s, r.running = !0;
|
|
15090
15217
|
const n = performance.now();
|
|
15091
|
-
return t.setAttribute(`${c.prefix}importing`, ""),
|
|
15218
|
+
return t.setAttribute(`${c.prefix}importing`, ""), O.importStart(t, s), Mr.load(s, void 0, {
|
|
15092
15219
|
element: t,
|
|
15093
15220
|
attrPrefix: `${c.prefix}import-`
|
|
15094
15221
|
}).then((a) => {
|
|
15095
15222
|
const o = new TextEncoder().encode(a).length;
|
|
15096
|
-
return
|
|
15223
|
+
return J.enqueue(() => {
|
|
15097
15224
|
t.innerHTML = a;
|
|
15098
15225
|
}).then(() => {
|
|
15099
|
-
t.removeAttribute(`${c.prefix}importing`),
|
|
15226
|
+
t.removeAttribute(`${c.prefix}importing`), O.importEnd(t, s, o, n), h.adoptImportedChildren(e);
|
|
15100
15227
|
const l = [];
|
|
15101
15228
|
return e.getChildren().forEach((u) => {
|
|
15102
|
-
u instanceof R ? l.push(h.scan(u.getTarget())) : u instanceof
|
|
15229
|
+
u instanceof R ? l.push(h.scan(u.getTarget())) : u instanceof de && l.push(h.evaluateText(u));
|
|
15103
15230
|
}), Promise.all(l).then(() => {
|
|
15104
15231
|
});
|
|
15105
15232
|
});
|
|
15106
15233
|
}).catch((a) => {
|
|
15107
|
-
t.removeAttribute(`${c.prefix}importing`),
|
|
15234
|
+
t.removeAttribute(`${c.prefix}importing`), O.importError(t, s, a), m.error("[Haori]", "Failed to import HTML:", s, a);
|
|
15108
15235
|
}).finally(() => {
|
|
15109
15236
|
if (r.running = !1, r.rerunRequested)
|
|
15110
15237
|
return r.rerunRequested = !1, h.executeManagedImport(e);
|
|
@@ -15159,7 +15286,7 @@ const h = class h {
|
|
|
15159
15286
|
() => x.restoreInitialValues(e)
|
|
15160
15287
|
);
|
|
15161
15288
|
return h.initialValueRestores.add(i), i.then(() => {
|
|
15162
|
-
h.initialValueRestores.delete(i), t &&
|
|
15289
|
+
h.initialValueRestores.delete(i), t && le.applySubtree(e);
|
|
15163
15290
|
});
|
|
15164
15291
|
}
|
|
15165
15292
|
/**
|
|
@@ -15180,7 +15307,7 @@ const h = class h {
|
|
|
15180
15307
|
const r = e.getTarget();
|
|
15181
15308
|
return R.retryUnappliedValueWrites(r, t).then(
|
|
15182
15309
|
() => {
|
|
15183
|
-
|
|
15310
|
+
le.applySubtree(r);
|
|
15184
15311
|
}
|
|
15185
15312
|
);
|
|
15186
15313
|
}
|
|
@@ -15193,7 +15320,7 @@ const h = class h {
|
|
|
15193
15320
|
*/
|
|
15194
15321
|
static initializeFreshEachRow(e) {
|
|
15195
15322
|
return h.initializeElementFragment(e, !0).then(() => {
|
|
15196
|
-
h.needsScheduledEvaluateAll(e) && h.scheduleEvaluateAll(e),
|
|
15323
|
+
h.needsScheduledEvaluateAll(e) && h.scheduleEvaluateAll(e), le.applySubtree(e.getTarget());
|
|
15197
15324
|
});
|
|
15198
15325
|
}
|
|
15199
15326
|
/**
|
|
@@ -15214,7 +15341,7 @@ const h = class h {
|
|
|
15214
15341
|
return e.getChildren().forEach((s) => {
|
|
15215
15342
|
s instanceof R ? (!r || h.isEachFixedChild(s)) && i.push(
|
|
15216
15343
|
h.initializeElementFragment(s, t)
|
|
15217
|
-
) : s instanceof
|
|
15344
|
+
) : s instanceof de && i.push(h.evaluateText(s));
|
|
15218
15345
|
}), Promise.all(i).then(() => {
|
|
15219
15346
|
h.refreshDerivedSubtreeSignature(e);
|
|
15220
15347
|
});
|
|
@@ -15369,14 +15496,14 @@ const h = class h {
|
|
|
15369
15496
|
typeof r == "string" && (d = () => h.executeManagedImport(n));
|
|
15370
15497
|
break;
|
|
15371
15498
|
case `${c.prefix}store`:
|
|
15372
|
-
r !== null && o.push(
|
|
15499
|
+
r !== null && o.push(Be.restore(n));
|
|
15373
15500
|
break;
|
|
15374
15501
|
case `${c.prefix}validity`:
|
|
15375
15502
|
case `${c.prefix}validity-message`:
|
|
15376
15503
|
return r !== null && x.applyCustomValidity(n), Promise.all(o).then(() => {
|
|
15377
15504
|
});
|
|
15378
15505
|
case `${c.prefix}url-param`: {
|
|
15379
|
-
const y = n.getAttribute(`${c.prefix}url-arg`), b =
|
|
15506
|
+
const y = n.getAttribute(`${c.prefix}url-arg`), b = Oe.readParams();
|
|
15380
15507
|
y === null && n.hasAttribute(`${c.prefix}store`) && m.warn(
|
|
15381
15508
|
"Haori",
|
|
15382
15509
|
`${c.prefix}url-param を ${c.prefix}url-arg なしで ${c.prefix}store と併用すると復元した値が消えます(${c.prefix}url-arg を指定してください)。`
|
|
@@ -15442,34 +15569,34 @@ const h = class h {
|
|
|
15442
15569
|
const y = R.currentSequence(), b = i.getRawBindingData();
|
|
15443
15570
|
d && (r.clearUserEdits ?? !0) && h.clearUserEditMarks(i, l);
|
|
15444
15571
|
const E = a ? h.resolveByPathAuthority(i, b, t, u) : t;
|
|
15445
|
-
i.setBindingData(E), a && (
|
|
15572
|
+
i.setBindingData(E), a && (O.bindChange(e, b, E, "manual"), Be.mirror(i));
|
|
15446
15573
|
const A = () => {
|
|
15447
15574
|
i.markBindingWorkStart();
|
|
15448
|
-
const
|
|
15449
|
-
let
|
|
15575
|
+
const w = i.getRawBindingData() ?? E;
|
|
15576
|
+
let $ = a ? i.setAttribute(
|
|
15450
15577
|
`${c.prefix}bind`,
|
|
15451
|
-
JSON.stringify(h.withoutReservedBindingKeys(
|
|
15578
|
+
JSON.stringify(h.withoutReservedBindingKeys(w))
|
|
15452
15579
|
) : Promise.resolve();
|
|
15453
|
-
return e.tagName === "FORM" && (
|
|
15580
|
+
return e.tagName === "FORM" && ($ = $.then(() => {
|
|
15454
15581
|
if (i.wasResetAfter(y))
|
|
15455
15582
|
return;
|
|
15456
|
-
const
|
|
15583
|
+
const C = i.getRawBindingData() ?? E;
|
|
15457
15584
|
return x.syncValues(
|
|
15458
15585
|
i,
|
|
15459
|
-
x.resolveSyncValues(i,
|
|
15586
|
+
x.resolveSyncValues(i, C),
|
|
15460
15587
|
!1,
|
|
15461
15588
|
u
|
|
15462
15589
|
);
|
|
15463
|
-
})),
|
|
15590
|
+
})), $ = $.then(
|
|
15464
15591
|
() => x.syncAncestorArgForms(i, y, u, b)
|
|
15465
|
-
),
|
|
15592
|
+
), $ = $.then(() => h.evaluateAll(i, s)), $ = $.then(
|
|
15466
15593
|
() => R.retryUnappliedValueWrites(e, y)
|
|
15467
|
-
),
|
|
15594
|
+
), $ = $.then(
|
|
15468
15595
|
() => h.reevaluateReactiveSpecialAttributes(i, s)
|
|
15469
|
-
),
|
|
15596
|
+
), $.then(
|
|
15470
15597
|
() => i.markBindingWorkEnd(),
|
|
15471
|
-
(
|
|
15472
|
-
throw i.markBindingWorkEnd(),
|
|
15598
|
+
(C) => {
|
|
15599
|
+
throw i.markBindingWorkEnd(), C;
|
|
15473
15600
|
}
|
|
15474
15601
|
);
|
|
15475
15602
|
};
|
|
@@ -15535,22 +15662,22 @@ const h = class h {
|
|
|
15535
15662
|
if (h.isPlainRecord(t) && h.isPlainRecord(r)) {
|
|
15536
15663
|
const d = t, y = r, b = {};
|
|
15537
15664
|
let E = Object.keys(d).some(
|
|
15538
|
-
(
|
|
15665
|
+
(w) => !Object.prototype.hasOwnProperty.call(y, w)
|
|
15539
15666
|
);
|
|
15540
15667
|
const A = /* @__PURE__ */ new Set([
|
|
15541
15668
|
...Object.keys(d),
|
|
15542
15669
|
...Object.keys(y)
|
|
15543
15670
|
]);
|
|
15544
|
-
for (const
|
|
15545
|
-
const
|
|
15671
|
+
for (const w of A) {
|
|
15672
|
+
const $ = s === "" ? w : `${s}.${w}`, C = h.mergePathAuthority(
|
|
15546
15673
|
e,
|
|
15547
|
-
Object.prototype.hasOwnProperty.call(d,
|
|
15548
|
-
Object.prototype.hasOwnProperty.call(y,
|
|
15674
|
+
Object.prototype.hasOwnProperty.call(d, w) ? d[w] : h.ABSENT_PATH,
|
|
15675
|
+
Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH,
|
|
15549
15676
|
i,
|
|
15550
|
-
|
|
15677
|
+
$,
|
|
15551
15678
|
n
|
|
15552
15679
|
);
|
|
15553
|
-
|
|
15680
|
+
C !== h.ABSENT_PATH && (b[w] = C), C !== (Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH) && (E = !0);
|
|
15554
15681
|
}
|
|
15555
15682
|
return E ? b : y;
|
|
15556
15683
|
}
|
|
@@ -15839,7 +15966,7 @@ const h = class h {
|
|
|
15839
15966
|
return Promise.resolve();
|
|
15840
15967
|
if (r.attachObserved(s, i), s instanceof R)
|
|
15841
15968
|
return h.scan(s.getTarget());
|
|
15842
|
-
if (s instanceof
|
|
15969
|
+
if (s instanceof de)
|
|
15843
15970
|
return h.evaluateText(s);
|
|
15844
15971
|
}
|
|
15845
15972
|
return Promise.resolve();
|
|
@@ -15990,7 +16117,7 @@ const h = class h {
|
|
|
15990
16117
|
if (h.canSkipUnchangedNestedEach(A))
|
|
15991
16118
|
return;
|
|
15992
16119
|
E.push(h.evaluateAll(A, t));
|
|
15993
|
-
} else A instanceof
|
|
16120
|
+
} else A instanceof de && !t.has(A) && E.push(h.evaluateText(A));
|
|
15994
16121
|
}), Promise.all(E).then(() => {
|
|
15995
16122
|
});
|
|
15996
16123
|
}).then(() => {
|
|
@@ -16013,7 +16140,7 @@ const h = class h {
|
|
|
16013
16140
|
const i = e.getRawDerivedBindingData(), s = typeof r == "string" ? r.trim() : "";
|
|
16014
16141
|
if (!t || s === "")
|
|
16015
16142
|
return i === null ? Promise.resolve(!1) : (e.setDerivedBindingData(null), Promise.resolve(!0));
|
|
16016
|
-
const n =
|
|
16143
|
+
const n = re.evaluateDetailed(
|
|
16017
16144
|
t,
|
|
16018
16145
|
e.getBindingData()
|
|
16019
16146
|
);
|
|
@@ -16060,7 +16187,7 @@ const h = class h {
|
|
|
16060
16187
|
const t = e.getRawAttribute(`${c.prefix}if`);
|
|
16061
16188
|
if (typeof t != "string" || t.indexOf("{{") >= 0)
|
|
16062
16189
|
return;
|
|
16063
|
-
if (
|
|
16190
|
+
if (re.hasCompileFailure(t)) {
|
|
16064
16191
|
m.warn(
|
|
16065
16192
|
"[Haori]",
|
|
16066
16193
|
"data-if is hidden because the expression could not be compiled (see the preceding compile error):",
|
|
@@ -16136,7 +16263,7 @@ const h = class h {
|
|
|
16136
16263
|
static evaluateEachFixedChildren(e) {
|
|
16137
16264
|
const t = [];
|
|
16138
16265
|
return e.getChildren().forEach((r) => {
|
|
16139
|
-
r instanceof R ? h.isEachFixedChild(r) && t.push(h.evaluateAll(r)) : r instanceof
|
|
16266
|
+
r instanceof R ? h.isEachFixedChild(r) && t.push(h.evaluateAll(r)) : r instanceof de && t.push(h.evaluateText(r));
|
|
16140
16267
|
}), Promise.all(t).then(() => {
|
|
16141
16268
|
});
|
|
16142
16269
|
}
|
|
@@ -16176,7 +16303,7 @@ const h = class h {
|
|
|
16176
16303
|
if (h.isHiddenIfCondition(i))
|
|
16177
16304
|
V.isEnabled() && e.isVisible() && h.logFalsyIfDiagnostics(e), r.push(
|
|
16178
16305
|
e.hide().then(() => {
|
|
16179
|
-
|
|
16306
|
+
O.hide(e.getTarget());
|
|
16180
16307
|
})
|
|
16181
16308
|
);
|
|
16182
16309
|
else {
|
|
@@ -16191,10 +16318,10 @@ const h = class h {
|
|
|
16191
16318
|
() => h.reevaluateReactiveSpecialAttributes(l)
|
|
16192
16319
|
)
|
|
16193
16320
|
) : a.push(h.scanElement(l.getTarget(), !1));
|
|
16194
|
-
} else l instanceof
|
|
16321
|
+
} else l instanceof de && !(s && t.has(l)) && a.push(h.evaluateText(l));
|
|
16195
16322
|
}), r.push(
|
|
16196
16323
|
e.show().then(() => {
|
|
16197
|
-
|
|
16324
|
+
O.show(e.getTarget()), s || (h.triggerLoadOnShow(e), le.refreshSubtree(e.getTarget(), !1));
|
|
16198
16325
|
})
|
|
16199
16326
|
), r.push(
|
|
16200
16327
|
Promise.all(a).then(() => {
|
|
@@ -16217,7 +16344,7 @@ const h = class h {
|
|
|
16217
16344
|
*/
|
|
16218
16345
|
static triggerLoadOnShow(e) {
|
|
16219
16346
|
const t = `${c.prefix}load-`;
|
|
16220
|
-
e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new
|
|
16347
|
+
e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new he(e, "load").run().catch((i) => {
|
|
16221
16348
|
m.error("[Haori]", "data-load procedure error (on show):", i);
|
|
16222
16349
|
});
|
|
16223
16350
|
}
|
|
@@ -16245,7 +16372,7 @@ const h = class h {
|
|
|
16245
16372
|
* @return 差分更新(再実行を含む)の完了 Promise
|
|
16246
16373
|
*/
|
|
16247
16374
|
static evaluateEach(e) {
|
|
16248
|
-
if (V.isEnabled() &&
|
|
16375
|
+
if (V.isEnabled() && re.recordRowScopeIdentifiers([
|
|
16249
16376
|
h.getRowScopeName(e, "each-arg"),
|
|
16250
16377
|
h.getRowScopeName(e, "each-index")
|
|
16251
16378
|
]), e.isMounted() || h.syncMountedState(e), !e.isVisible() || !e.isMounted())
|
|
@@ -16295,7 +16422,7 @@ const h = class h {
|
|
|
16295
16422
|
t.rerunRequested = !1, await h.performEachUpdate(e);
|
|
16296
16423
|
while (t.rerunRequested);
|
|
16297
16424
|
const i = e.getTarget();
|
|
16298
|
-
i.setAttribute(`${c.prefix}each-done`, ""),
|
|
16425
|
+
i.setAttribute(`${c.prefix}each-done`, ""), le.refreshSubtree(i, !1), h.runEachRenderedScript(i);
|
|
16299
16426
|
} finally {
|
|
16300
16427
|
t.running = !1, t.settled = null;
|
|
16301
16428
|
}
|
|
@@ -16315,10 +16442,10 @@ const h = class h {
|
|
|
16315
16442
|
*/
|
|
16316
16443
|
static runEachRenderedScript(e) {
|
|
16317
16444
|
const t = `${c.prefix}each-rendered-run`, r = D.get(e);
|
|
16318
|
-
if (r === null || !
|
|
16445
|
+
if (r === null || !oe.declared(r, t))
|
|
16319
16446
|
return;
|
|
16320
|
-
if (
|
|
16321
|
-
const n =
|
|
16447
|
+
if (oe.applies(r, t)) {
|
|
16448
|
+
const n = oe.compile(r, t, []);
|
|
16322
16449
|
try {
|
|
16323
16450
|
n?.([]);
|
|
16324
16451
|
} catch (a) {
|
|
@@ -16502,7 +16629,7 @@ ${i}
|
|
|
16502
16629
|
const s = (n) => {
|
|
16503
16630
|
if (h.keepsRowScopeNames(n))
|
|
16504
16631
|
for (const a of n.getChildren())
|
|
16505
|
-
a instanceof
|
|
16632
|
+
a instanceof de ? h.areExpressionsRowLocal(
|
|
16506
16633
|
h.extractInterpolations(a.getRawText()),
|
|
16507
16634
|
i
|
|
16508
16635
|
) && r.add(a) : a instanceof R && (h.isRowLocalSubtree(a, i) ? r.add(a) : s(a));
|
|
@@ -16644,7 +16771,7 @@ ${i}
|
|
|
16644
16771
|
if (i instanceof R) {
|
|
16645
16772
|
if (!h.isRowLocalSubtree(i, r))
|
|
16646
16773
|
return !1;
|
|
16647
|
-
} else if (i instanceof
|
|
16774
|
+
} else if (i instanceof de) {
|
|
16648
16775
|
const s = i.getRawText();
|
|
16649
16776
|
if (s.includes("{{") && !h.areExpressionsRowLocal(
|
|
16650
16777
|
h.extractInterpolations(s),
|
|
@@ -16668,7 +16795,7 @@ ${i}
|
|
|
16668
16795
|
const i = r.trim();
|
|
16669
16796
|
if (i === "")
|
|
16670
16797
|
continue;
|
|
16671
|
-
const s =
|
|
16798
|
+
const s = re.getFreeIdentifiers(i);
|
|
16672
16799
|
if (s.length === 0 || s.some((n) => !t.has(n)))
|
|
16673
16800
|
return !1;
|
|
16674
16801
|
}
|
|
@@ -16917,7 +17044,7 @@ ${i}
|
|
|
16917
17044
|
const s = e.getRawAttribute(i);
|
|
16918
17045
|
return typeof s == "string" && s.includes("{{");
|
|
16919
17046
|
}) ? !0 : e.getChildren().some(
|
|
16920
|
-
(i) => i instanceof
|
|
17047
|
+
(i) => i instanceof de && i.hasDynamicContent()
|
|
16921
17048
|
);
|
|
16922
17049
|
}
|
|
16923
17050
|
/**
|
|
@@ -16927,7 +17054,7 @@ ${i}
|
|
|
16927
17054
|
* @returns subtree 全体を省略可能なら true
|
|
16928
17055
|
*/
|
|
16929
17056
|
static markFreshInitializationSkippable(e) {
|
|
16930
|
-
const t = e.getAttributeNames().some((s) => h.isFreshInitializationDynamicAttribute(e, s)), r = e.getChildren().some((s) => s instanceof R ? !h.markFreshInitializationSkippable(s) : s instanceof
|
|
17057
|
+
const t = e.getAttributeNames().some((s) => h.isFreshInitializationDynamicAttribute(e, s)), r = e.getChildren().some((s) => s instanceof R ? !h.markFreshInitializationSkippable(s) : s instanceof de ? s.hasDynamicContent() : !1), i = !t && !r;
|
|
16931
17058
|
return e.setFreshInitializationSkippable(i), i;
|
|
16932
17059
|
}
|
|
16933
17060
|
/**
|
|
@@ -16960,7 +17087,7 @@ ${i}
|
|
|
16960
17087
|
let i = e.getAttribute(`${c.prefix}each-index`);
|
|
16961
17088
|
i && (i = String(i));
|
|
16962
17089
|
const s = e.getAttribute(`${c.prefix}each-key`), n = e.getAttribute(`${c.prefix}each-arg`), a = t.map(
|
|
16963
|
-
(F,
|
|
17090
|
+
(F, Z) => h.createListKey(F, s ? String(s) : null, Z)
|
|
16964
17091
|
), o = new Set(a), l = /* @__PURE__ */ new Map();
|
|
16965
17092
|
a.forEach((F) => {
|
|
16966
17093
|
l.set(F, (l.get(F) ?? 0) + 1);
|
|
@@ -16970,104 +17097,104 @@ ${i}
|
|
|
16970
17097
|
(F) => !F.hasAttribute(`${c.prefix}each-before`) && !F.hasAttribute(`${c.prefix}each-after`)
|
|
16971
17098
|
);
|
|
16972
17099
|
const y = d.map((F) => F.getListKey()), b = /* @__PURE__ */ new Set();
|
|
16973
|
-
d = d.filter((F,
|
|
16974
|
-
const
|
|
16975
|
-
if (
|
|
17100
|
+
d = d.filter((F, Z) => {
|
|
17101
|
+
const ee = String(F.getListKey()), ne = l.get(ee) ?? 0;
|
|
17102
|
+
if (ne === 0) {
|
|
16976
17103
|
b.add(F);
|
|
16977
|
-
const
|
|
16978
|
-
return
|
|
17104
|
+
const K = F.getListKey();
|
|
17105
|
+
return K !== null && O.rowRemove(F.getTarget(), K, Z), u.push(F.remove()), !1;
|
|
16979
17106
|
}
|
|
16980
|
-
return l.set(
|
|
17107
|
+
return l.set(ee, ne - 1), !0;
|
|
16981
17108
|
});
|
|
16982
17109
|
const E = d.map((F) => F.getListKey()), A = /* @__PURE__ */ new Map();
|
|
16983
17110
|
d.forEach((F) => {
|
|
16984
|
-
const
|
|
16985
|
-
if (
|
|
17111
|
+
const Z = F.getListKey();
|
|
17112
|
+
if (Z === null)
|
|
16986
17113
|
return;
|
|
16987
|
-
const
|
|
16988
|
-
|
|
17114
|
+
const ee = A.get(Z);
|
|
17115
|
+
ee ? ee.push(F) : A.set(Z, [F]);
|
|
16989
17116
|
});
|
|
16990
|
-
const
|
|
17117
|
+
const w = e.getChildElementFragments().filter((F) => !b.has(F)), $ = w.filter(
|
|
16991
17118
|
(F) => F.hasAttribute(`${c.prefix}each-before`)
|
|
16992
17119
|
).length;
|
|
16993
|
-
let
|
|
17120
|
+
let C = Promise.resolve();
|
|
16994
17121
|
const se = [];
|
|
16995
|
-
return a.forEach((F,
|
|
16996
|
-
const
|
|
16997
|
-
let
|
|
16998
|
-
const
|
|
16999
|
-
if (
|
|
17000
|
-
|
|
17001
|
-
const
|
|
17002
|
-
|
|
17122
|
+
return a.forEach((F, Z) => {
|
|
17123
|
+
const ee = t[Z], ne = Z;
|
|
17124
|
+
let K;
|
|
17125
|
+
const ae = A.get(F)?.shift();
|
|
17126
|
+
if (ae) {
|
|
17127
|
+
K = ae;
|
|
17128
|
+
const j = $ + Z;
|
|
17129
|
+
C = C.then(
|
|
17003
17130
|
() => h.updateRowFragment(
|
|
17004
|
-
|
|
17005
|
-
re,
|
|
17006
|
-
i,
|
|
17131
|
+
K,
|
|
17007
17132
|
ee,
|
|
17133
|
+
i,
|
|
17134
|
+
ne,
|
|
17008
17135
|
n ? String(n) : null,
|
|
17009
17136
|
F
|
|
17010
17137
|
).then(
|
|
17011
|
-
(
|
|
17138
|
+
(k) => (
|
|
17012
17139
|
// 再利用行も新しい並び順の位置へ移動する。移動しないと、配列を並べ替え
|
|
17013
17140
|
// ただけの更新(data-each-key 指定時はキーが変わらないため全行が再利用
|
|
17014
17141
|
// される)で DOM の順序が古いまま残る。
|
|
17015
17142
|
h.repositionEachRow(
|
|
17016
17143
|
e,
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
).then((
|
|
17021
|
-
|
|
17022
|
-
|
|
17144
|
+
K,
|
|
17145
|
+
w,
|
|
17146
|
+
j
|
|
17147
|
+
).then((B) => {
|
|
17148
|
+
B !== null && O.rowMove(
|
|
17149
|
+
K.getTarget(),
|
|
17023
17150
|
F,
|
|
17024
|
-
|
|
17025
|
-
|
|
17026
|
-
), !(!
|
|
17151
|
+
B - $,
|
|
17152
|
+
Z
|
|
17153
|
+
), !(!k && h.isRowLocalEachTemplate(e)) && se.push(
|
|
17027
17154
|
h.evaluateAll(
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
).then(() => h.applyRowFormValues(e,
|
|
17155
|
+
K,
|
|
17156
|
+
k ? /* @__PURE__ */ new Set() : h.collectRowLocalFragments(e, K)
|
|
17157
|
+
).then(() => h.applyRowFormValues(e, K, ee))
|
|
17031
17158
|
);
|
|
17032
17159
|
})
|
|
17033
17160
|
)
|
|
17034
17161
|
)
|
|
17035
17162
|
);
|
|
17036
17163
|
} else {
|
|
17037
|
-
|
|
17038
|
-
const
|
|
17039
|
-
|
|
17164
|
+
K = r.clone();
|
|
17165
|
+
const j = $ + Z;
|
|
17166
|
+
C = C.then(
|
|
17040
17167
|
() => h.updateRowFragment(
|
|
17041
|
-
|
|
17042
|
-
re,
|
|
17043
|
-
i,
|
|
17168
|
+
K,
|
|
17044
17169
|
ee,
|
|
17170
|
+
i,
|
|
17171
|
+
ne,
|
|
17045
17172
|
n ? String(n) : null,
|
|
17046
17173
|
F
|
|
17047
17174
|
).then(() => {
|
|
17048
|
-
const
|
|
17049
|
-
return e.insertBefore(
|
|
17050
|
-
|
|
17051
|
-
}).then(() => h.initializeFreshEachRow(
|
|
17052
|
-
|
|
17175
|
+
const k = w[j] ?? null;
|
|
17176
|
+
return e.insertBefore(K, k).then(() => {
|
|
17177
|
+
w.splice(j, 0, K);
|
|
17178
|
+
}).then(() => h.initializeFreshEachRow(K)).then(() => h.applyRowFormValues(e, K, ee)).then(() => {
|
|
17179
|
+
O.rowAdd(K.getTarget(), F, ne, ee);
|
|
17053
17180
|
});
|
|
17054
17181
|
})
|
|
17055
17182
|
);
|
|
17056
17183
|
}
|
|
17057
|
-
}), Promise.all(u).then(() =>
|
|
17184
|
+
}), Promise.all(u).then(() => C).then(() => Promise.all(se)).then(() => {
|
|
17058
17185
|
const F = a.filter(
|
|
17059
|
-
(
|
|
17060
|
-
),
|
|
17061
|
-
(
|
|
17062
|
-
),
|
|
17063
|
-
(
|
|
17186
|
+
(j) => j !== null
|
|
17187
|
+
), Z = E.filter(
|
|
17188
|
+
(j) => j !== null
|
|
17189
|
+
), ee = new Set(Z), ne = F.filter((j) => !ee.has(j)), ae = y.filter(
|
|
17190
|
+
(j) => j !== null
|
|
17064
17191
|
).filter(
|
|
17065
|
-
(
|
|
17192
|
+
(j) => !o.has(j)
|
|
17066
17193
|
);
|
|
17067
|
-
|
|
17194
|
+
O.eachUpdate(
|
|
17068
17195
|
e.getTarget(),
|
|
17069
|
-
|
|
17070
|
-
|
|
17196
|
+
ne,
|
|
17197
|
+
ae,
|
|
17071
17198
|
F
|
|
17072
17199
|
);
|
|
17073
17200
|
});
|
|
@@ -17359,8 +17486,8 @@ h.ATTRIBUTE_ALIAS_SUFFIX = "attr-", h.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
17359
17486
|
"enhance",
|
|
17360
17487
|
"enhance-new"
|
|
17361
17488
|
]), h.ROW_LOCAL_ROW_OPERATIONS = /* @__PURE__ */ new Set(["row-add", "row-remove", "row-prev", "row-next"]), h.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), h.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), h.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), h.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), h.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), h.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), h.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), h.ABSENT_PATH = Symbol("absent");
|
|
17362
|
-
let
|
|
17363
|
-
const
|
|
17489
|
+
let M = h;
|
|
17490
|
+
const Me = class Me {
|
|
17364
17491
|
/**
|
|
17365
17492
|
* コンストラクタ。
|
|
17366
17493
|
*
|
|
@@ -17371,7 +17498,7 @@ const Fe = class Fe {
|
|
|
17371
17498
|
if (t.defaultPrevented || x.isResettingInternally())
|
|
17372
17499
|
return;
|
|
17373
17500
|
const r = t.target;
|
|
17374
|
-
r instanceof HTMLElement && setTimeout(() =>
|
|
17501
|
+
r instanceof HTMLElement && setTimeout(() => le.refreshSubtree(r), 0);
|
|
17375
17502
|
}, this.onChange = (t) => this.delegate(t, "change"), this.onInput = (t) => this.delegate(t, "input"), this.onLoadCapture = (t) => this.delegate(t, "load"), this.onWindowLoad = () => {
|
|
17376
17503
|
if (this.deferred) {
|
|
17377
17504
|
this.deferredProcedures.push(() => this.runWindowLoadProcedure());
|
|
@@ -17380,8 +17507,8 @@ const Fe = class Fe {
|
|
|
17380
17507
|
this.runWindowLoadProcedure();
|
|
17381
17508
|
}, this.onPopstate = (t) => {
|
|
17382
17509
|
const r = t.state;
|
|
17383
|
-
if (!r || r[
|
|
17384
|
-
|
|
17510
|
+
if (!r || r[Me.HISTORY_STATE_KEY] !== !0) {
|
|
17511
|
+
M.refreshUrlParams();
|
|
17385
17512
|
return;
|
|
17386
17513
|
}
|
|
17387
17514
|
location.reload();
|
|
@@ -17394,7 +17521,7 @@ const Fe = class Fe {
|
|
|
17394
17521
|
*/
|
|
17395
17522
|
runWindowLoadProcedure() {
|
|
17396
17523
|
const e = document.documentElement, t = D.get(e);
|
|
17397
|
-
t && new
|
|
17524
|
+
t && new he(t, "load").run();
|
|
17398
17525
|
}
|
|
17399
17526
|
/**
|
|
17400
17527
|
* イベントリスナーの登録を開始します。
|
|
@@ -17488,7 +17615,7 @@ const Fe = class Fe {
|
|
|
17488
17615
|
subscribeCustomEvent(e) {
|
|
17489
17616
|
if (e === null || e === "")
|
|
17490
17617
|
return;
|
|
17491
|
-
if (
|
|
17618
|
+
if (Me.BUILTIN_EVENT_NAMES.has(e)) {
|
|
17492
17619
|
m.warn(
|
|
17493
17620
|
"[Haori]",
|
|
17494
17621
|
`data-on="${e}" は組み込みイベントです。data-${e}-* を使用してください(data-on はカスタムイベント専用)。`
|
|
@@ -17518,7 +17645,7 @@ const Fe = class Fe {
|
|
|
17518
17645
|
if (i.getAttribute(this.onAttributeName) !== e)
|
|
17519
17646
|
return;
|
|
17520
17647
|
const s = D.get(i);
|
|
17521
|
-
s instanceof R && this.isFromTarget(s, t) && new
|
|
17648
|
+
s instanceof R && this.isFromTarget(s, t) && new he(s, "on", t).run().catch((n) => {
|
|
17522
17649
|
m.error("[Haori]", "Procedure execution error:", n);
|
|
17523
17650
|
});
|
|
17524
17651
|
});
|
|
@@ -17538,8 +17665,8 @@ const Fe = class Fe {
|
|
|
17538
17665
|
const r = `${this.onAttributeName}-target`;
|
|
17539
17666
|
if (!e.hasAttribute(r))
|
|
17540
17667
|
return !0;
|
|
17541
|
-
const i =
|
|
17542
|
-
return i === null || !(s instanceof Node) ? !1 :
|
|
17668
|
+
const i = z.read(e, r), s = t.target;
|
|
17669
|
+
return i === null || !(s instanceof Node) ? !1 : z.queryAll(i, r).some(
|
|
17543
17670
|
(n) => n.contains(s)
|
|
17544
17671
|
);
|
|
17545
17672
|
}
|
|
@@ -17606,11 +17733,11 @@ const Fe = class Fe {
|
|
|
17606
17733
|
return;
|
|
17607
17734
|
(t === "change" || t === "input") && this.syncUserEdit(e, t === "change");
|
|
17608
17735
|
const s = () => {
|
|
17609
|
-
const n = new
|
|
17736
|
+
const n = new he(i, t, r).runWithOutcome().catch((a) => (m.error("[Haori]", "Procedure execution error:", a), "failure"));
|
|
17610
17737
|
if (t === "click") {
|
|
17611
|
-
|
|
17738
|
+
he.recordClickOutcome(e, n);
|
|
17612
17739
|
const a = r.target;
|
|
17613
|
-
a instanceof HTMLElement && a !== e &&
|
|
17740
|
+
a instanceof HTMLElement && a !== e && he.recordClickOutcome(a, n);
|
|
17614
17741
|
}
|
|
17615
17742
|
};
|
|
17616
17743
|
if (t === "click" && e.hasAttribute(`${c.prefix}click-defer`)) {
|
|
@@ -17731,13 +17858,13 @@ const Fe = class Fe {
|
|
|
17731
17858
|
return null;
|
|
17732
17859
|
}
|
|
17733
17860
|
};
|
|
17734
|
-
|
|
17861
|
+
Me.HISTORY_STATE_KEY = "__haoriHistoryState__", Me.BUILTIN_EVENT_NAMES = /* @__PURE__ */ new Set([
|
|
17735
17862
|
"click",
|
|
17736
17863
|
"change",
|
|
17737
17864
|
"input",
|
|
17738
17865
|
"load"
|
|
17739
17866
|
]);
|
|
17740
|
-
let nt =
|
|
17867
|
+
let nt = Me;
|
|
17741
17868
|
const q = class q {
|
|
17742
17869
|
/**
|
|
17743
17870
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
@@ -17837,7 +17964,7 @@ const q = class q {
|
|
|
17837
17964
|
static runProcedure(e, t) {
|
|
17838
17965
|
t.pending = !1, t.running = !0;
|
|
17839
17966
|
let r = !1;
|
|
17840
|
-
new
|
|
17967
|
+
new he(t.fragment, "intersect").runWithResult().then((i) => {
|
|
17841
17968
|
r = i;
|
|
17842
17969
|
}).catch((i) => {
|
|
17843
17970
|
m.error("[Haori]", "Intersect procedure execution error:", i);
|
|
@@ -17907,7 +18034,7 @@ const q = class q {
|
|
|
17907
18034
|
const r = e.getAttribute(t);
|
|
17908
18035
|
if (typeof r != "string" || r.trim() === "")
|
|
17909
18036
|
return null;
|
|
17910
|
-
const i =
|
|
18037
|
+
const i = z.query(r, t, document);
|
|
17911
18038
|
return q.isHtmlElement(i) ? i : (m.error("[Haori]", `Intersect root element not found: ${r}`), null);
|
|
17912
18039
|
}
|
|
17913
18040
|
static resolveRootMargin(e) {
|
|
@@ -17935,8 +18062,8 @@ q.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
17935
18062
|
"disabled",
|
|
17936
18063
|
"once"
|
|
17937
18064
|
]), q.registrations = /* @__PURE__ */ new Map();
|
|
17938
|
-
let
|
|
17939
|
-
const
|
|
18065
|
+
let Ce = q;
|
|
18066
|
+
const S = class S {
|
|
17940
18067
|
/**
|
|
17941
18068
|
* 指定ノードとその子孫を走査し、`data-poll-*` の監視状態を同期します。
|
|
17942
18069
|
*
|
|
@@ -17944,8 +18071,8 @@ const w = class w {
|
|
|
17944
18071
|
* @returns 戻り値はありません。
|
|
17945
18072
|
*/
|
|
17946
18073
|
static syncTree(e) {
|
|
17947
|
-
(e instanceof Element || e instanceof DocumentFragment) && (
|
|
17948
|
-
|
|
18074
|
+
(e instanceof Element || e instanceof DocumentFragment) && (S.isHtmlElement(e) && S.syncElement(e), e.querySelectorAll("*").forEach((t) => {
|
|
18075
|
+
S.syncElement(t);
|
|
17949
18076
|
}));
|
|
17950
18077
|
}
|
|
17951
18078
|
/**
|
|
@@ -17958,23 +18085,23 @@ const w = class w {
|
|
|
17958
18085
|
* @returns 戻り値はありません。
|
|
17959
18086
|
*/
|
|
17960
18087
|
static syncElement(e) {
|
|
17961
|
-
const t =
|
|
17962
|
-
if (!t && !
|
|
18088
|
+
const t = S.registrations.get(e);
|
|
18089
|
+
if (!t && !S.hasPollAttribute(e))
|
|
17963
18090
|
return;
|
|
17964
18091
|
const r = D.get(e);
|
|
17965
|
-
if (!(r instanceof R) || !
|
|
17966
|
-
t &&
|
|
18092
|
+
if (!(r instanceof R) || !S.shouldObserve(r)) {
|
|
18093
|
+
t && S.teardown(e, t);
|
|
17967
18094
|
return;
|
|
17968
18095
|
}
|
|
17969
|
-
const i =
|
|
18096
|
+
const i = S.buildConfigKey(r);
|
|
17970
18097
|
if (t) {
|
|
17971
18098
|
if (t.configKey === i) {
|
|
17972
18099
|
t.fragment = r;
|
|
17973
18100
|
return;
|
|
17974
18101
|
}
|
|
17975
|
-
|
|
18102
|
+
S.teardown(e, t);
|
|
17976
18103
|
}
|
|
17977
|
-
|
|
18104
|
+
S.startPolling(e, r, i);
|
|
17978
18105
|
}
|
|
17979
18106
|
/**
|
|
17980
18107
|
* 指定ノードとその子孫の監視を解除します。
|
|
@@ -17986,13 +18113,13 @@ const w = class w {
|
|
|
17986
18113
|
* @returns 戻り値はありません。
|
|
17987
18114
|
*/
|
|
17988
18115
|
static cleanupTree(e) {
|
|
17989
|
-
if (
|
|
17990
|
-
const t =
|
|
17991
|
-
t &&
|
|
18116
|
+
if (S.isHtmlElement(e)) {
|
|
18117
|
+
const t = S.registrations.get(e);
|
|
18118
|
+
t && S.teardown(e, t);
|
|
17992
18119
|
}
|
|
17993
18120
|
(e instanceof Element || e instanceof DocumentFragment) && e.querySelectorAll("*").forEach((t) => {
|
|
17994
|
-
const r =
|
|
17995
|
-
r &&
|
|
18121
|
+
const r = S.registrations.get(t);
|
|
18122
|
+
r && S.teardown(t, r);
|
|
17996
18123
|
});
|
|
17997
18124
|
}
|
|
17998
18125
|
/**
|
|
@@ -18001,12 +18128,12 @@ const w = class w {
|
|
|
18001
18128
|
* @returns 戻り値はありません。
|
|
18002
18129
|
*/
|
|
18003
18130
|
static disconnectAll() {
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
}),
|
|
18131
|
+
S.registrations.forEach((e) => {
|
|
18132
|
+
S.clearTimers(e);
|
|
18133
|
+
}), S.registrations.clear(), S.visibilityListener && typeof document < "u" && document.removeEventListener(
|
|
18007
18134
|
"visibilitychange",
|
|
18008
|
-
|
|
18009
|
-
),
|
|
18135
|
+
S.visibilityListener
|
|
18136
|
+
), S.visibilityListener = null;
|
|
18010
18137
|
}
|
|
18011
18138
|
/**
|
|
18012
18139
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
@@ -18048,7 +18175,7 @@ const w = class w {
|
|
|
18048
18175
|
*/
|
|
18049
18176
|
static shouldObserve(e) {
|
|
18050
18177
|
const t = `${c.prefix}poll-`;
|
|
18051
|
-
return e.getAttributeNames().some((r) => r.startsWith(t) ? !
|
|
18178
|
+
return e.getAttributeNames().some((r) => r.startsWith(t) ? !S.CONFIG_KEYS.has(r.slice(t.length)) : !1);
|
|
18052
18179
|
}
|
|
18053
18180
|
/**
|
|
18054
18181
|
* 設定の同一性を判定するキーを組み立てます。
|
|
@@ -18080,9 +18207,9 @@ const w = class w {
|
|
|
18080
18207
|
const i = {
|
|
18081
18208
|
fragment: t,
|
|
18082
18209
|
configKey: r,
|
|
18083
|
-
intervalMs:
|
|
18084
|
-
timeoutMs:
|
|
18085
|
-
errorLimit:
|
|
18210
|
+
intervalMs: S.resolveInterval(t),
|
|
18211
|
+
timeoutMs: S.resolveTimeout(t),
|
|
18212
|
+
errorLimit: S.resolveErrorLimit(t),
|
|
18086
18213
|
startedAt: performance.now(),
|
|
18087
18214
|
intervalTimerId: null,
|
|
18088
18215
|
timeoutTimerId: null,
|
|
@@ -18094,9 +18221,9 @@ const w = class w {
|
|
|
18094
18221
|
count: 0,
|
|
18095
18222
|
consecutiveErrors: 0
|
|
18096
18223
|
};
|
|
18097
|
-
|
|
18098
|
-
|
|
18099
|
-
}, i.timeoutMs)),
|
|
18224
|
+
S.registrations.set(e, i), S.ensureVisibilityListener(), i.timeoutMs !== null && (i.timeoutTimerId = setTimeout(() => {
|
|
18225
|
+
S.handleTimeout(e);
|
|
18226
|
+
}, i.timeoutMs)), S.injectState(i), S.tick(e);
|
|
18100
18227
|
}
|
|
18101
18228
|
/**
|
|
18102
18229
|
* 1回分のポーリング処理を実行し、継続する場合は次回を予約します。
|
|
@@ -18105,26 +18232,26 @@ const w = class w {
|
|
|
18105
18232
|
* @returns 処理完了の Promise
|
|
18106
18233
|
*/
|
|
18107
18234
|
static async tick(e) {
|
|
18108
|
-
const t =
|
|
18235
|
+
const t = S.registrations.get(e);
|
|
18109
18236
|
if (!t || t.stopped || t.fetching)
|
|
18110
18237
|
return;
|
|
18111
18238
|
if (t.intervalTimerId = null, !e.isConnected) {
|
|
18112
|
-
await
|
|
18239
|
+
await S.stop(e, t, "detached");
|
|
18113
18240
|
return;
|
|
18114
18241
|
}
|
|
18115
|
-
const r =
|
|
18116
|
-
if (r !== t.paused && (t.paused = r, await
|
|
18117
|
-
|
|
18242
|
+
const r = S.isHidden(e) || S.isDisabled(t.fragment);
|
|
18243
|
+
if (r !== t.paused && (t.paused = r, await S.injectState(t)), r) {
|
|
18244
|
+
S.schedule(e, t);
|
|
18118
18245
|
return;
|
|
18119
18246
|
}
|
|
18120
|
-
if (
|
|
18121
|
-
await
|
|
18247
|
+
if (S.isUntilSatisfied(t.fragment)) {
|
|
18248
|
+
await S.stop(e, t, "until");
|
|
18122
18249
|
return;
|
|
18123
18250
|
}
|
|
18124
18251
|
t.fetching = !0, t.count += 1;
|
|
18125
18252
|
let i = !1;
|
|
18126
18253
|
try {
|
|
18127
|
-
i = await new
|
|
18254
|
+
i = await new he(
|
|
18128
18255
|
t.fragment,
|
|
18129
18256
|
"poll"
|
|
18130
18257
|
).runWithResult();
|
|
@@ -18133,18 +18260,18 @@ const w = class w {
|
|
|
18133
18260
|
} finally {
|
|
18134
18261
|
t.fetching = !1;
|
|
18135
18262
|
}
|
|
18136
|
-
if (!(
|
|
18263
|
+
if (!(S.registrations.get(e) !== t || t.stopped)) {
|
|
18137
18264
|
if (i)
|
|
18138
18265
|
t.consecutiveErrors = 0;
|
|
18139
18266
|
else if (t.consecutiveErrors += 1, t.errorLimit !== null && t.consecutiveErrors >= t.errorLimit) {
|
|
18140
|
-
await
|
|
18267
|
+
await S.stop(e, t, "error");
|
|
18141
18268
|
return;
|
|
18142
18269
|
}
|
|
18143
|
-
if (i &&
|
|
18144
|
-
await
|
|
18270
|
+
if (i && S.isUntilSatisfied(t.fragment)) {
|
|
18271
|
+
await S.stop(e, t, "until");
|
|
18145
18272
|
return;
|
|
18146
18273
|
}
|
|
18147
|
-
|
|
18274
|
+
S.schedule(e, t);
|
|
18148
18275
|
}
|
|
18149
18276
|
}
|
|
18150
18277
|
/**
|
|
@@ -18159,7 +18286,7 @@ const w = class w {
|
|
|
18159
18286
|
*/
|
|
18160
18287
|
static schedule(e, t) {
|
|
18161
18288
|
t.stopped || t.intervalTimerId !== null || (t.intervalTimerId = setTimeout(() => {
|
|
18162
|
-
|
|
18289
|
+
S.tick(e);
|
|
18163
18290
|
}, t.intervalMs));
|
|
18164
18291
|
}
|
|
18165
18292
|
/**
|
|
@@ -18169,12 +18296,12 @@ const w = class w {
|
|
|
18169
18296
|
* @returns 処理完了の Promise
|
|
18170
18297
|
*/
|
|
18171
18298
|
static async handleTimeout(e) {
|
|
18172
|
-
const t =
|
|
18173
|
-
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected &&
|
|
18299
|
+
const t = S.registrations.get(e);
|
|
18300
|
+
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected && O.pollTimeout(
|
|
18174
18301
|
e,
|
|
18175
18302
|
t.count,
|
|
18176
|
-
|
|
18177
|
-
), await
|
|
18303
|
+
S.elapsed(t)
|
|
18304
|
+
), await S.stop(e, t, "timeout"));
|
|
18178
18305
|
}
|
|
18179
18306
|
/**
|
|
18180
18307
|
* ポーリングを恒久停止します。
|
|
@@ -18186,15 +18313,15 @@ const w = class w {
|
|
|
18186
18313
|
*/
|
|
18187
18314
|
static async stop(e, t, r) {
|
|
18188
18315
|
if (!t.stopped) {
|
|
18189
|
-
if (t.stopped = !0, t.stopReason = r, t.paused = !1,
|
|
18190
|
-
|
|
18316
|
+
if (t.stopped = !0, t.stopReason = r, t.paused = !1, S.clearTimers(t), r === "detached") {
|
|
18317
|
+
S.registrations.delete(e);
|
|
18191
18318
|
return;
|
|
18192
18319
|
}
|
|
18193
|
-
await
|
|
18320
|
+
await S.injectState(t), e.isConnected && O.pollStop(
|
|
18194
18321
|
e,
|
|
18195
18322
|
r,
|
|
18196
18323
|
t.count,
|
|
18197
|
-
|
|
18324
|
+
S.elapsed(t)
|
|
18198
18325
|
);
|
|
18199
18326
|
}
|
|
18200
18327
|
}
|
|
@@ -18206,7 +18333,7 @@ const w = class w {
|
|
|
18206
18333
|
* @returns 戻り値はありません。
|
|
18207
18334
|
*/
|
|
18208
18335
|
static teardown(e, t) {
|
|
18209
|
-
|
|
18336
|
+
S.clearTimers(t), S.registrations.delete(e);
|
|
18210
18337
|
}
|
|
18211
18338
|
/**
|
|
18212
18339
|
* 登録情報が持つタイマーをすべて破棄します。
|
|
@@ -18235,16 +18362,16 @@ const w = class w {
|
|
|
18235
18362
|
* @returns 戻り値はありません。
|
|
18236
18363
|
*/
|
|
18237
18364
|
static ensureVisibilityListener() {
|
|
18238
|
-
if (
|
|
18365
|
+
if (S.visibilityListener || typeof document > "u")
|
|
18239
18366
|
return;
|
|
18240
18367
|
const e = () => {
|
|
18241
|
-
document.visibilityState === "visible" && Array.from(
|
|
18368
|
+
document.visibilityState === "visible" && Array.from(S.registrations.entries()).forEach(
|
|
18242
18369
|
([t, r]) => {
|
|
18243
|
-
r.stopped || r.fetching || (r.intervalTimerId !== null && (clearTimeout(r.intervalTimerId), r.intervalTimerId = null),
|
|
18370
|
+
r.stopped || r.fetching || (r.intervalTimerId !== null && (clearTimeout(r.intervalTimerId), r.intervalTimerId = null), S.tick(t));
|
|
18244
18371
|
}
|
|
18245
18372
|
);
|
|
18246
18373
|
};
|
|
18247
|
-
|
|
18374
|
+
S.visibilityListener = e, document.addEventListener("visibilitychange", e);
|
|
18248
18375
|
}
|
|
18249
18376
|
/**
|
|
18250
18377
|
* `_poll` 状態を注入先のバインディングデータへ反映します。
|
|
@@ -18258,7 +18385,7 @@ const w = class w {
|
|
|
18258
18385
|
* @returns 注入完了の Promise
|
|
18259
18386
|
*/
|
|
18260
18387
|
static injectState(e) {
|
|
18261
|
-
const t =
|
|
18388
|
+
const t = S.resolveStateFragments(e);
|
|
18262
18389
|
if (t.length === 0)
|
|
18263
18390
|
return Promise.resolve();
|
|
18264
18391
|
const r = {
|
|
@@ -18268,7 +18395,7 @@ const w = class w {
|
|
|
18268
18395
|
timedOut: e.timedOut,
|
|
18269
18396
|
stopReason: e.stopReason,
|
|
18270
18397
|
count: e.count,
|
|
18271
|
-
elapsedMs:
|
|
18398
|
+
elapsedMs: S.elapsed(e)
|
|
18272
18399
|
};
|
|
18273
18400
|
return Promise.all(
|
|
18274
18401
|
t.map((i) => {
|
|
@@ -18276,7 +18403,7 @@ const w = class w {
|
|
|
18276
18403
|
...i.getRawBindingData() ?? {},
|
|
18277
18404
|
_poll: r
|
|
18278
18405
|
};
|
|
18279
|
-
return
|
|
18406
|
+
return M.setBindingData(s, n, {
|
|
18280
18407
|
reflectToAttribute: !1,
|
|
18281
18408
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
18282
18409
|
// 解除しない)。
|
|
@@ -18303,7 +18430,7 @@ const w = class w {
|
|
|
18303
18430
|
const i = r.getAttribute(t);
|
|
18304
18431
|
if (typeof i != "string" || i.trim() === "")
|
|
18305
18432
|
return r.getTarget().isConnected ? [r] : [];
|
|
18306
|
-
const s =
|
|
18433
|
+
const s = z.queryAll(
|
|
18307
18434
|
i,
|
|
18308
18435
|
t,
|
|
18309
18436
|
document
|
|
@@ -18330,15 +18457,15 @@ const w = class w {
|
|
|
18330
18457
|
static resolveInterval(e) {
|
|
18331
18458
|
const t = `${c.prefix}poll-interval`;
|
|
18332
18459
|
if (!e.hasAttribute(t))
|
|
18333
|
-
return
|
|
18334
|
-
const r =
|
|
18460
|
+
return S.DEFAULT_INTERVAL_MS;
|
|
18461
|
+
const r = S.toNumber(e.getAttribute(t));
|
|
18335
18462
|
return r === null ? (m.warn(
|
|
18336
18463
|
"[Haori]",
|
|
18337
|
-
`${t} は数値で指定してください。既定値 ${
|
|
18338
|
-
),
|
|
18464
|
+
`${t} は数値で指定してください。既定値 ${S.DEFAULT_INTERVAL_MS}ms を使用します。`
|
|
18465
|
+
), S.DEFAULT_INTERVAL_MS) : r < S.MIN_INTERVAL_MS ? (m.warn(
|
|
18339
18466
|
"[Haori]",
|
|
18340
|
-
`${t} の下限は ${
|
|
18341
|
-
),
|
|
18467
|
+
`${t} の下限は ${S.MIN_INTERVAL_MS}ms です。${r}ms は下限へ切り上げます。`
|
|
18468
|
+
), S.MIN_INTERVAL_MS) : r;
|
|
18342
18469
|
}
|
|
18343
18470
|
/**
|
|
18344
18471
|
* `data-poll-timeout` を解決します。
|
|
@@ -18350,7 +18477,7 @@ const w = class w {
|
|
|
18350
18477
|
const t = `${c.prefix}poll-timeout`;
|
|
18351
18478
|
if (!e.hasAttribute(t))
|
|
18352
18479
|
return null;
|
|
18353
|
-
const r =
|
|
18480
|
+
const r = S.toNumber(e.getAttribute(t));
|
|
18354
18481
|
return r === null || r <= 0 ? (m.warn(
|
|
18355
18482
|
"[Haori]",
|
|
18356
18483
|
`${t} は正の数値で指定してください。無制限として扱います。`
|
|
@@ -18366,7 +18493,7 @@ const w = class w {
|
|
|
18366
18493
|
const t = `${c.prefix}poll-error-limit`;
|
|
18367
18494
|
if (!e.hasAttribute(t))
|
|
18368
18495
|
return null;
|
|
18369
|
-
const r =
|
|
18496
|
+
const r = S.toNumber(e.getAttribute(t));
|
|
18370
18497
|
return r === null || r < 1 ? (m.warn(
|
|
18371
18498
|
"[Haori]",
|
|
18372
18499
|
`${t} は 1 以上の数値で指定してください。無制限として扱います。`
|
|
@@ -18408,7 +18535,7 @@ const w = class w {
|
|
|
18408
18535
|
*/
|
|
18409
18536
|
static isDisabled(e) {
|
|
18410
18537
|
const t = `${c.prefix}poll-disabled`;
|
|
18411
|
-
return e.hasAttribute(t) ?
|
|
18538
|
+
return e.hasAttribute(t) ? S.isTruthy(e.getAttribute(t)) : !1;
|
|
18412
18539
|
}
|
|
18413
18540
|
/**
|
|
18414
18541
|
* `data-poll-until` の条件が成立したかどうかを判定します。
|
|
@@ -18431,7 +18558,7 @@ const w = class w {
|
|
|
18431
18558
|
`${t} に未解決の参照が含まれています(停止条件は成立扱いにしません):`,
|
|
18432
18559
|
e.getRawAttribute(t),
|
|
18433
18560
|
e.getTarget()
|
|
18434
|
-
), !1) :
|
|
18561
|
+
), !1) : S.isTruthy(r.value) : !1;
|
|
18435
18562
|
}
|
|
18436
18563
|
/**
|
|
18437
18564
|
* 属性の評価値を真偽値として解釈します。
|
|
@@ -18454,20 +18581,20 @@ const w = class w {
|
|
|
18454
18581
|
return !!e;
|
|
18455
18582
|
}
|
|
18456
18583
|
};
|
|
18457
|
-
|
|
18584
|
+
S.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
18458
18585
|
"interval",
|
|
18459
18586
|
"timeout",
|
|
18460
18587
|
"until",
|
|
18461
18588
|
"error-limit",
|
|
18462
18589
|
"disabled",
|
|
18463
18590
|
"state"
|
|
18464
|
-
]),
|
|
18465
|
-
let
|
|
18466
|
-
const Pr = "0.
|
|
18591
|
+
]), S.DEFAULT_INTERVAL_MS = 5e3, S.MIN_INTERVAL_MS = 100, S.registrations = /* @__PURE__ */ new Map(), S.visibilityListener = null;
|
|
18592
|
+
let $e = S;
|
|
18593
|
+
const Pr = "0.67.0";
|
|
18467
18594
|
function Lr(f) {
|
|
18468
18595
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => f()) : Promise.resolve().then(f);
|
|
18469
18596
|
}
|
|
18470
|
-
const
|
|
18597
|
+
const L = class L {
|
|
18471
18598
|
/**
|
|
18472
18599
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
18473
18600
|
*
|
|
@@ -18486,8 +18613,8 @@ const B = class B {
|
|
|
18486
18613
|
* @param root 走査の起点ノード
|
|
18487
18614
|
*/
|
|
18488
18615
|
static syncTree(e) {
|
|
18489
|
-
(e instanceof Element || e instanceof DocumentFragment) && (
|
|
18490
|
-
|
|
18616
|
+
(e instanceof Element || e instanceof DocumentFragment) && (L.isHtmlElement(e) && L.syncElement(e), e.querySelectorAll("*").forEach((t) => {
|
|
18617
|
+
L.syncElement(t);
|
|
18491
18618
|
}));
|
|
18492
18619
|
}
|
|
18493
18620
|
/**
|
|
@@ -18497,42 +18624,42 @@ const B = class B {
|
|
|
18497
18624
|
* @param element 対象要素
|
|
18498
18625
|
*/
|
|
18499
18626
|
static syncElement(e) {
|
|
18500
|
-
const t =
|
|
18501
|
-
if (!(r instanceof R) || !
|
|
18502
|
-
t && (t.observer.disconnect(),
|
|
18627
|
+
const t = L.registrations.get(e), r = D.get(e);
|
|
18628
|
+
if (!(r instanceof R) || !L.shouldObserve(r)) {
|
|
18629
|
+
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
18503
18630
|
return;
|
|
18504
18631
|
}
|
|
18505
18632
|
if (typeof IntersectionObserver > "u")
|
|
18506
18633
|
return;
|
|
18507
|
-
const i =
|
|
18634
|
+
const i = L.resolveVarName(r);
|
|
18508
18635
|
if (i === "") {
|
|
18509
|
-
t && (t.observer.disconnect(),
|
|
18636
|
+
t && (t.observer.disconnect(), L.registrations.delete(e)), m.warn(
|
|
18510
18637
|
"[Haori]",
|
|
18511
18638
|
'data-each-visible requires a variable name (e.g. data-each-visible="visibleRange").'
|
|
18512
18639
|
);
|
|
18513
18640
|
return;
|
|
18514
18641
|
}
|
|
18515
|
-
const s =
|
|
18642
|
+
const s = L.resolveRoot(r), n = L.resolveRootMargin(r);
|
|
18516
18643
|
if (t && t.observer.root === s && t.observer.rootMargin === n && t.varName === i) {
|
|
18517
|
-
t.fragment = r,
|
|
18644
|
+
t.fragment = r, L.refreshRows(t);
|
|
18518
18645
|
return;
|
|
18519
18646
|
}
|
|
18520
|
-
t && (t.observer.disconnect(),
|
|
18647
|
+
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
18521
18648
|
const a = new IntersectionObserver(
|
|
18522
18649
|
(l) => {
|
|
18523
|
-
const u =
|
|
18650
|
+
const u = L.registrations.get(e);
|
|
18524
18651
|
if (!u)
|
|
18525
18652
|
return;
|
|
18526
18653
|
let d = !1;
|
|
18527
18654
|
l.forEach((y) => {
|
|
18528
18655
|
const b = y.target;
|
|
18529
18656
|
u.observedRows.has(b) && (y.isIntersecting ? u.visibleRows.has(b) || (u.visibleRows.add(b), d = !0) : u.visibleRows.delete(b) && (d = !0));
|
|
18530
|
-
}), d &&
|
|
18657
|
+
}), d && L.scheduleCompute(u);
|
|
18531
18658
|
},
|
|
18532
18659
|
{
|
|
18533
18660
|
root: s,
|
|
18534
18661
|
rootMargin: n,
|
|
18535
|
-
threshold:
|
|
18662
|
+
threshold: L.THRESHOLD
|
|
18536
18663
|
}
|
|
18537
18664
|
), o = {
|
|
18538
18665
|
fragment: r,
|
|
@@ -18545,7 +18672,7 @@ const B = class B {
|
|
|
18545
18672
|
scheduled: !1,
|
|
18546
18673
|
lastSnapshot: null
|
|
18547
18674
|
};
|
|
18548
|
-
|
|
18675
|
+
L.registrations.set(e, o), L.refreshRows(o);
|
|
18549
18676
|
}
|
|
18550
18677
|
/**
|
|
18551
18678
|
* 指定ノード配下の監視登録を解放します。
|
|
@@ -18553,22 +18680,22 @@ const B = class B {
|
|
|
18553
18680
|
* @param root 走査の起点ノード
|
|
18554
18681
|
*/
|
|
18555
18682
|
static cleanupTree(e) {
|
|
18556
|
-
if (
|
|
18557
|
-
const t =
|
|
18558
|
-
t && (t.observer.disconnect(),
|
|
18683
|
+
if (L.isHtmlElement(e)) {
|
|
18684
|
+
const t = L.registrations.get(e);
|
|
18685
|
+
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
18559
18686
|
}
|
|
18560
18687
|
(e instanceof Element || e instanceof DocumentFragment) && e.querySelectorAll("*").forEach((t) => {
|
|
18561
|
-
const r =
|
|
18562
|
-
r && (r.observer.disconnect(),
|
|
18688
|
+
const r = L.registrations.get(t);
|
|
18689
|
+
r && (r.observer.disconnect(), L.registrations.delete(t));
|
|
18563
18690
|
});
|
|
18564
18691
|
}
|
|
18565
18692
|
/**
|
|
18566
18693
|
* すべての監視登録を解放します。
|
|
18567
18694
|
*/
|
|
18568
18695
|
static disconnectAll() {
|
|
18569
|
-
|
|
18696
|
+
L.registrations.forEach((e) => {
|
|
18570
18697
|
e.observer.disconnect();
|
|
18571
|
-
}),
|
|
18698
|
+
}), L.registrations.clear();
|
|
18572
18699
|
}
|
|
18573
18700
|
/**
|
|
18574
18701
|
* 監視対象(`data-each` かつ `data-each-visible`)かどうかを判定します。
|
|
@@ -18602,8 +18729,8 @@ const B = class B {
|
|
|
18602
18729
|
const r = e.getAttribute(t);
|
|
18603
18730
|
if (typeof r != "string" || r.trim() === "")
|
|
18604
18731
|
return null;
|
|
18605
|
-
const i =
|
|
18606
|
-
return
|
|
18732
|
+
const i = z.query(r, t, document);
|
|
18733
|
+
return L.isHtmlElement(i) ? i : (m.error("[Haori]", `Visible range root element not found: ${r}`), null);
|
|
18607
18734
|
}
|
|
18608
18735
|
/**
|
|
18609
18736
|
* rootMargin を解決します。
|
|
@@ -18613,7 +18740,7 @@ const B = class B {
|
|
|
18613
18740
|
*/
|
|
18614
18741
|
static resolveRootMargin(e) {
|
|
18615
18742
|
const t = `${c.prefix}each-visible-margin`, r = e.getAttribute(t);
|
|
18616
|
-
return r === null || r === !1 || r === "" ?
|
|
18743
|
+
return r === null || r === !1 || r === "" ? L.DEFAULT_ROOT_MARGIN : String(r);
|
|
18617
18744
|
}
|
|
18618
18745
|
/**
|
|
18619
18746
|
* コンテナ直下の実際の行要素(`each-before`/`each-after` を除く)を描画順で返します。
|
|
@@ -18633,12 +18760,12 @@ const B = class B {
|
|
|
18633
18760
|
* @param registration 対象の登録
|
|
18634
18761
|
*/
|
|
18635
18762
|
static refreshRows(e) {
|
|
18636
|
-
const t =
|
|
18763
|
+
const t = L.realRowElements(e.fragment), r = new Set(t);
|
|
18637
18764
|
for (const i of [...e.observedRows])
|
|
18638
18765
|
r.has(i) || (e.observer.unobserve(i), e.observedRows.delete(i), e.visibleRows.delete(i));
|
|
18639
18766
|
for (const i of t)
|
|
18640
18767
|
e.observedRows.has(i) || (e.observer.observe(i), e.observedRows.add(i));
|
|
18641
|
-
|
|
18768
|
+
L.scheduleCompute(e);
|
|
18642
18769
|
}
|
|
18643
18770
|
/**
|
|
18644
18771
|
* 次フレームでの集計・公開を予約します(多発する交差イベントを 1 回にまとめる)。
|
|
@@ -18649,7 +18776,7 @@ const B = class B {
|
|
|
18649
18776
|
e.scheduled || (e.scheduled = !0, Lr(() => {
|
|
18650
18777
|
e.scheduled = !1;
|
|
18651
18778
|
const t = e.fragment.getTarget();
|
|
18652
|
-
|
|
18779
|
+
L.registrations.get(t) === e && L.computeAndPublish(e);
|
|
18653
18780
|
}));
|
|
18654
18781
|
}
|
|
18655
18782
|
/**
|
|
@@ -18658,7 +18785,7 @@ const B = class B {
|
|
|
18658
18785
|
* @param registration 対象の登録
|
|
18659
18786
|
*/
|
|
18660
18787
|
static computeAndPublish(e) {
|
|
18661
|
-
const t =
|
|
18788
|
+
const t = L.realRowElements(e.fragment), r = /* @__PURE__ */ new Map();
|
|
18662
18789
|
t.forEach((a, o) => r.set(a, o));
|
|
18663
18790
|
const i = [];
|
|
18664
18791
|
for (const a of e.visibleRows) {
|
|
@@ -18691,7 +18818,7 @@ const B = class B {
|
|
|
18691
18818
|
};
|
|
18692
18819
|
}
|
|
18693
18820
|
const n = JSON.stringify(s);
|
|
18694
|
-
n !== e.lastSnapshot && (e.lastSnapshot = n,
|
|
18821
|
+
n !== e.lastSnapshot && (e.lastSnapshot = n, L.publish(e, s));
|
|
18695
18822
|
}
|
|
18696
18823
|
/**
|
|
18697
18824
|
* 可視範囲スナップショットを最近接の上位 `data-bind` スコープへ公開します。
|
|
@@ -18700,7 +18827,7 @@ const B = class B {
|
|
|
18700
18827
|
* @param snapshot 公開するスナップショット
|
|
18701
18828
|
*/
|
|
18702
18829
|
static publish(e, t) {
|
|
18703
|
-
const r =
|
|
18830
|
+
const r = L.resolveBindOwner(e.fragment);
|
|
18704
18831
|
if (!r) {
|
|
18705
18832
|
m.warn(
|
|
18706
18833
|
"[Haori]",
|
|
@@ -18713,7 +18840,7 @@ const B = class B {
|
|
|
18713
18840
|
};
|
|
18714
18841
|
s[e.varName] = { ...t };
|
|
18715
18842
|
const n = e.fragment.getTarget(), a = i === n ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([e.fragment]);
|
|
18716
|
-
|
|
18843
|
+
M.setBindingData(i, s, {
|
|
18717
18844
|
skipFragments: a,
|
|
18718
18845
|
reflectToAttribute: !1,
|
|
18719
18846
|
// 可視範囲の公開は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
@@ -18742,8 +18869,8 @@ const B = class B {
|
|
|
18742
18869
|
return e.hasAttribute(t) ? e : null;
|
|
18743
18870
|
}
|
|
18744
18871
|
};
|
|
18745
|
-
|
|
18746
|
-
let
|
|
18872
|
+
L.THRESHOLD = 0, L.DEFAULT_ROOT_MARGIN = "0px", L.registrations = /* @__PURE__ */ new Map();
|
|
18873
|
+
let Se = L;
|
|
18747
18874
|
const H = class H {
|
|
18748
18875
|
/**
|
|
18749
18876
|
* 既存の MutationObserver をすべて停止します。
|
|
@@ -18767,8 +18894,8 @@ const H = class H {
|
|
|
18767
18894
|
H._dispatcher = e, e.startDeferred(), H._initialIntakes = [];
|
|
18768
18895
|
try {
|
|
18769
18896
|
const t = await Promise.allSettled([
|
|
18770
|
-
|
|
18771
|
-
|
|
18897
|
+
M.scan(document.head),
|
|
18898
|
+
M.scan(document.body)
|
|
18772
18899
|
]), [r, i] = t;
|
|
18773
18900
|
r.status !== "fulfilled" && m.error(
|
|
18774
18901
|
"[Haori]",
|
|
@@ -18778,11 +18905,11 @@ const H = class H {
|
|
|
18778
18905
|
"[Haori]",
|
|
18779
18906
|
"Failed to build body fragment:",
|
|
18780
18907
|
i.reason
|
|
18781
|
-
), await H.waitInitialIntakes(), await
|
|
18908
|
+
), await H.waitInitialIntakes(), await J.wait(), document.body.setAttribute("data-haori-ready", ""), H.observe(document.head), H.observe(document.body), Ce.syncTree(document.body), $e.syncTree(document.body), Se.syncTree(document.body);
|
|
18782
18909
|
} finally {
|
|
18783
18910
|
H._initialIntakes = null, e.release();
|
|
18784
18911
|
}
|
|
18785
|
-
|
|
18912
|
+
O.ready(Pr);
|
|
18786
18913
|
}
|
|
18787
18914
|
/**
|
|
18788
18915
|
* 稼働中の EventDispatcher を返します。
|
|
@@ -18996,37 +19123,37 @@ const H = class H {
|
|
|
18996
19123
|
switch (r.type) {
|
|
18997
19124
|
case "attributes": {
|
|
18998
19125
|
const i = r.target;
|
|
18999
|
-
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(
|
|
19126
|
+
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(ve) && (r.attributeName === "disabled" || r.attributeName === ve))
|
|
19000
19127
|
break;
|
|
19001
19128
|
if (r.attributeName && (r.attributeName === `${c.prefix}if-false` || r.attributeName === "style" && i.hasAttribute(`${c.prefix}if-false`))) {
|
|
19002
19129
|
r.attributeName === "style" && R.reassertHiddenDisplay(i);
|
|
19003
19130
|
break;
|
|
19004
19131
|
}
|
|
19005
|
-
if (r.attributeName &&
|
|
19132
|
+
if (r.attributeName && M.isAliasedAttributeReflection(i, r.attributeName))
|
|
19006
19133
|
break;
|
|
19007
|
-
const s =
|
|
19134
|
+
const s = M.setAttribute(
|
|
19008
19135
|
i,
|
|
19009
19136
|
r.attributeName,
|
|
19010
19137
|
i.getAttribute(r.attributeName),
|
|
19011
19138
|
!0,
|
|
19012
19139
|
t
|
|
19013
19140
|
);
|
|
19014
|
-
H._initialIntakes?.push(s),
|
|
19141
|
+
H._initialIntakes?.push(s), Ce.syncElement(i), $e.syncElement(i), Se.syncElement(i);
|
|
19015
19142
|
break;
|
|
19016
19143
|
}
|
|
19017
19144
|
case "childList": {
|
|
19018
19145
|
Array.from(r.removedNodes).forEach((i) => {
|
|
19019
|
-
H.isStaleExternalRemoval(r, i) || (
|
|
19146
|
+
H.isStaleExternalRemoval(r, i) || (Ce.cleanupTree(i), $e.cleanupTree(i), Se.cleanupTree(i), M.removeNode(i));
|
|
19020
19147
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
19021
19148
|
if (!(i.parentElement instanceof Element))
|
|
19022
19149
|
return;
|
|
19023
|
-
const s =
|
|
19024
|
-
H._initialIntakes?.push(s),
|
|
19025
|
-
}), r.target instanceof Element &&
|
|
19150
|
+
const s = M.addNode(i.parentElement, i);
|
|
19151
|
+
H._initialIntakes?.push(s), Ce.syncTree(i), $e.syncTree(i), Se.syncTree(i);
|
|
19152
|
+
}), r.target instanceof Element && Se.syncElement(r.target);
|
|
19026
19153
|
break;
|
|
19027
19154
|
}
|
|
19028
19155
|
case "characterData": {
|
|
19029
|
-
r.target instanceof Text || r.target instanceof Comment ?
|
|
19156
|
+
r.target instanceof Text || r.target instanceof Comment ? M.changeText(r.target, r.target.textContent) : m.warn(
|
|
19030
19157
|
"[Haori]",
|
|
19031
19158
|
"Unsupported character data type:",
|
|
19032
19159
|
r.target
|
|
@@ -19043,20 +19170,20 @@ const H = class H {
|
|
|
19043
19170
|
}
|
|
19044
19171
|
};
|
|
19045
19172
|
H._initialized = !1, H._mutationObservers = [], H._dispatcher = null, H._initialIntakes = null;
|
|
19046
|
-
let
|
|
19047
|
-
|
|
19048
|
-
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
19049
|
-
const Or = () =>
|
|
19173
|
+
let He = H;
|
|
19174
|
+
le.setMutationCapture((f) => He.captureMutations(f));
|
|
19175
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", He.init) : He.init();
|
|
19176
|
+
const Or = () => xe.waitForRenders(), Br = xe.enhancers, Ur = xe.handlers;
|
|
19050
19177
|
export {
|
|
19051
|
-
|
|
19052
|
-
|
|
19178
|
+
M as Core,
|
|
19179
|
+
le as Enhance,
|
|
19053
19180
|
c as Env,
|
|
19054
19181
|
x as Form,
|
|
19055
19182
|
D as Fragment,
|
|
19056
|
-
|
|
19183
|
+
xe as Haori,
|
|
19057
19184
|
m as Log,
|
|
19058
|
-
|
|
19059
|
-
|
|
19185
|
+
J as Queue,
|
|
19186
|
+
xe as default,
|
|
19060
19187
|
Br as enhancers,
|
|
19061
19188
|
Ur as handlers,
|
|
19062
19189
|
Pr as version,
|