@readerseye2/cr_viewer 1.0.15 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,6 +3,12 @@ var Vi = Object.defineProperty;
3
3
  var qi = (e, t, n) => t in e ? Vi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
4
  var Ar = (e, t, n) => qi(e, typeof t != "symbol" ? t + "" : t, n);
5
5
  import { jsx as x, jsxs as X, Fragment as yt } from "react/jsx-runtime";
6
+ import "@fontsource/noto-sans-kr/400.css";
7
+ import "@fontsource/noto-sans-kr/700.css";
8
+ import "@fontsource/noto-serif-kr/400.css";
9
+ import "@fontsource/noto-serif-kr/700.css";
10
+ import "@fontsource/nanum-myeongjo/400.css";
11
+ import "@fontsource/nanum-myeongjo/700.css";
6
12
  import * as dt from "react";
7
13
  import N, { createContext as Ft, useContext as Ue, useMemo as ve, useLayoutEffect as Tt, useRef as ie, useEffect as Se, useCallback as Z, createElement as hn, memo as Wt, useState as et, useId as ji } from "react";
8
14
  import Ui from "react-dom";
@@ -155,26 +161,26 @@ function Yi() {
155
161
  } else y = m.current;
156
162
  m = c(
157
163
  function() {
158
- function f(_) {
164
+ function f(C) {
159
165
  if (!u) {
160
- if (u = !0, T = _, _ = g(_), b !== void 0 && y.hasValue) {
166
+ if (u = !0, T = C, C = g(C), b !== void 0 && y.hasValue) {
161
167
  var h = y.value;
162
- if (b(h, _))
168
+ if (b(h, C))
163
169
  return k = h;
164
170
  }
165
- return k = _;
171
+ return k = C;
166
172
  }
167
- if (h = k, r(T, _)) return h;
168
- var S = g(_);
169
- return b !== void 0 && b(h, S) ? (T = _, h) : (T = _, k = S);
173
+ if (h = k, r(T, C)) return h;
174
+ var S = g(C);
175
+ return b !== void 0 && b(h, S) ? (T = C, h) : (T = C, k = S);
170
176
  }
171
- var u = !1, T, k, I = v === void 0 ? null : v;
177
+ var u = !1, T, k, R = v === void 0 ? null : v;
172
178
  return [
173
179
  function() {
174
180
  return f(d());
175
181
  },
176
- I === null ? void 0 : function() {
177
- return f(I());
182
+ R === null ? void 0 : function() {
183
+ return f(R());
178
184
  }
179
185
  ];
180
186
  },
@@ -215,27 +221,27 @@ function Xi() {
215
221
  } else y = m.current;
216
222
  m = c(
217
223
  function() {
218
- function f(_) {
224
+ function f(C) {
219
225
  if (!u) {
220
- if (u = !0, T = _, _ = g(_), b !== void 0 && y.hasValue) {
226
+ if (u = !0, T = C, C = g(C), b !== void 0 && y.hasValue) {
221
227
  var h = y.value;
222
- if (b(h, _))
228
+ if (b(h, C))
223
229
  return k = h;
224
230
  }
225
- return k = _;
231
+ return k = C;
226
232
  }
227
- if (h = k, r(T, _))
233
+ if (h = k, r(T, C))
228
234
  return h;
229
- var S = g(_);
230
- return b !== void 0 && b(h, S) ? (T = _, h) : (T = _, k = S);
235
+ var S = g(C);
236
+ return b !== void 0 && b(h, S) ? (T = C, h) : (T = C, k = S);
231
237
  }
232
- var u = !1, T, k, I = v === void 0 ? null : v;
238
+ var u = !1, T, k, R = v === void 0 ? null : v;
233
239
  return [
234
240
  function() {
235
241
  return f(d());
236
242
  },
237
- I === null ? void 0 : function() {
238
- return f(I());
243
+ R === null ? void 0 : function() {
244
+ return f(R());
239
245
  }
240
246
  ];
241
247
  },
@@ -439,15 +445,15 @@ const bn = {
439
445
  }, Ko = [
440
446
  {
441
447
  label: "고딕체",
442
- value: "'Noto Sans KR', 'Apple SD Gothic Neo', 'Pretendard', Roboto, Segoe UI, Arial, sans-serif"
448
+ value: "'Noto Sans KR', sans-serif"
443
449
  },
444
450
  {
445
451
  label: "명조체",
446
- value: "'Nanum Myeongjo', 'Noto Serif KR', 'Batang', 'Times New Roman', serif"
452
+ value: "'Noto Serif KR', serif"
447
453
  },
448
454
  {
449
455
  label: "바탕체",
450
- value: "'Batang', 'Nanum Myeongjo', 'Noto Serif KR', 'Times New Roman', serif"
456
+ value: "'Nanum Myeongjo', serif"
451
457
  }
452
458
  ], Ve = {
453
459
  mode: "page",
@@ -1355,12 +1361,12 @@ const Os = {
1355
1361
  l,
1356
1362
  ce((h) => h.length > 0),
1357
1363
  be(f, y),
1358
- U(([h, S, C]) => {
1359
- const R = h.reduce((O, P, w) => Xe(O, P, Zt(P, S.offsetTree, C) || w), Gt());
1364
+ U(([h, S, I]) => {
1365
+ const _ = h.reduce((O, P, w) => Xe(O, P, Zt(P, S.offsetTree, I) || w), Gt());
1360
1366
  return {
1361
1367
  ...S,
1362
1368
  groupIndices: h,
1363
- groupOffsetTree: R
1369
+ groupOffsetTree: _
1364
1370
  };
1365
1371
  })
1366
1372
  ),
@@ -1370,10 +1376,10 @@ const Os = {
1370
1376
  r,
1371
1377
  be(f),
1372
1378
  ce(([h, { lastIndex: S }]) => h < S),
1373
- U(([h, { lastIndex: S, lastSize: C }]) => [
1379
+ U(([h, { lastIndex: S, lastSize: I }]) => [
1374
1380
  {
1375
1381
  endIndex: S,
1376
- size: C,
1382
+ size: I,
1377
1383
  startIndex: h
1378
1384
  }
1379
1385
  ])
@@ -1392,8 +1398,8 @@ const Os = {
1392
1398
  d,
1393
1399
  ce((h) => h !== void 0 && Ce(Be(f).sizeTree)),
1394
1400
  U((h) => {
1395
- const S = Be(v), C = Be(l).length > 0;
1396
- return S ? C ? [
1401
+ const S = Be(v), I = Be(l).length > 0;
1402
+ return S ? I ? [
1397
1403
  { endIndex: 0, size: S, startIndex: 0 },
1398
1404
  { endIndex: 1, size: h, startIndex: 1 }
1399
1405
  ] : [] : [{ endIndex: 0, size: h, startIndex: 0 }];
@@ -1406,19 +1412,19 @@ const Os = {
1406
1412
  ce((h) => h !== void 0 && h.length > 0 && Ce(Be(f).sizeTree)),
1407
1413
  U((h) => {
1408
1414
  const S = [];
1409
- let C = h[0], R = 0;
1415
+ let I = h[0], _ = 0;
1410
1416
  for (let O = 1; O < h.length; O++) {
1411
1417
  const P = h[O];
1412
- P !== C && (S.push({
1418
+ P !== I && (S.push({
1413
1419
  endIndex: O - 1,
1414
- size: C,
1415
- startIndex: R
1416
- }), C = P, R = O);
1420
+ size: I,
1421
+ startIndex: _
1422
+ }), I = P, _ = O);
1417
1423
  }
1418
1424
  return S.push({
1419
1425
  endIndex: h.length - 1,
1420
- size: C,
1421
- startIndex: R
1426
+ size: I,
1427
+ startIndex: _
1422
1428
  }), S;
1423
1429
  })
1424
1430
  ),
@@ -1428,21 +1434,21 @@ const Os = {
1428
1434
  l,
1429
1435
  be(v, d),
1430
1436
  ce(([, h, S]) => h !== void 0 && S !== void 0),
1431
- U(([h, S, C]) => {
1432
- const R = [];
1437
+ U(([h, S, I]) => {
1438
+ const _ = [];
1433
1439
  for (let O = 0; O < h.length; O++) {
1434
1440
  const P = h[O], w = h[O + 1];
1435
- R.push({
1441
+ _.push({
1436
1442
  startIndex: P,
1437
1443
  endIndex: P,
1438
1444
  size: S
1439
- }), w !== void 0 && R.push({
1445
+ }), w !== void 0 && _.push({
1440
1446
  startIndex: P + 1,
1441
1447
  endIndex: w - 1,
1442
- size: C
1448
+ size: I
1443
1449
  });
1444
1450
  }
1445
- return R;
1451
+ return _;
1446
1452
  })
1447
1453
  ),
1448
1454
  n
@@ -1452,9 +1458,9 @@ const Os = {
1452
1458
  n,
1453
1459
  be(f),
1454
1460
  ht(
1455
- ({ sizes: h }, [S, C]) => ({
1456
- changed: C !== h,
1457
- sizes: C
1461
+ ({ sizes: h }, [S, I]) => ({
1462
+ changed: I !== h,
1463
+ sizes: I
1458
1464
  }),
1459
1465
  { changed: !1, sizes: p }
1460
1466
  ),
@@ -1475,8 +1481,8 @@ const Os = {
1475
1481
  if (h > 0)
1476
1482
  ge(t, !0), ge(i, h + Kr(h, S));
1477
1483
  else if (h < 0) {
1478
- const C = Be(u);
1479
- C.length > 0 && (h -= Kr(-h, C)), ge(s, h);
1484
+ const I = Be(u);
1485
+ I.length > 0 && (h -= Kr(-h, I)), ge(s, h);
1480
1486
  }
1481
1487
  }
1482
1488
  ), Ie(L(c, be(e)), ([h, S]) => {
@@ -1486,23 +1492,23 @@ const Os = {
1486
1492
  Ye.ERROR
1487
1493
  );
1488
1494
  });
1489
- const I = Ze(i);
1495
+ const R = Ze(i);
1490
1496
  te(
1491
1497
  L(
1492
1498
  i,
1493
1499
  be(f),
1494
1500
  U(([h, S]) => {
1495
- const C = S.groupIndices.length > 0, R = [], O = S.lastSize;
1496
- if (C) {
1501
+ const I = S.groupIndices.length > 0, _ = [], O = S.lastSize;
1502
+ if (I) {
1497
1503
  const P = Yt(S.sizeTree, 0);
1498
1504
  let w = 0, E = 0;
1499
1505
  for (; w < h; ) {
1500
1506
  const W = S.groupIndices[E], M = S.groupIndices.length === E + 1 ? 1 / 0 : S.groupIndices[E + 1] - W - 1;
1501
- R.push({
1507
+ _.push({
1502
1508
  endIndex: W,
1503
1509
  size: P,
1504
1510
  startIndex: W
1505
- }), R.push({
1511
+ }), _.push({
1506
1512
  endIndex: W + 1 + M - 1,
1507
1513
  size: O,
1508
1514
  startIndex: W + 1
@@ -1528,7 +1534,7 @@ const Os = {
1528
1534
  {
1529
1535
  prevIndex: h,
1530
1536
  prevSize: 0,
1531
- ranges: R
1537
+ ranges: _
1532
1538
  }
1533
1539
  ).ranges;
1534
1540
  }
@@ -1548,13 +1554,13 @@ const Os = {
1548
1554
  ),
1549
1555
  n
1550
1556
  );
1551
- const _ = Ze(
1557
+ const C = Ze(
1552
1558
  L(
1553
1559
  s,
1554
1560
  be(f, y),
1555
- U(([h, { offsetTree: S }, C]) => {
1556
- const R = -h;
1557
- return Zt(R, S, C);
1561
+ U(([h, { offsetTree: S }, I]) => {
1562
+ const _ = -h;
1563
+ return Zt(_, S, I);
1558
1564
  })
1559
1565
  )
1560
1566
  );
@@ -1562,11 +1568,11 @@ const Os = {
1562
1568
  L(
1563
1569
  s,
1564
1570
  be(f, y),
1565
- U(([h, S, C]) => {
1571
+ U(([h, S, I]) => {
1566
1572
  if (S.groupIndices.length > 0) {
1567
1573
  if (Ce(S.sizeTree))
1568
1574
  return S;
1569
- let R = Gt();
1575
+ let _ = Gt();
1570
1576
  const O = Be(u);
1571
1577
  let P = 0, w = 0, E = 0;
1572
1578
  for (; P < -h; ) {
@@ -1574,30 +1580,30 @@ const Os = {
1574
1580
  const A = O[w + 1] - E - 1;
1575
1581
  w++, P += A + 1;
1576
1582
  }
1577
- if (R = kt(S.sizeTree).reduce((A, { k: W, v: M }) => Xe(A, Math.max(0, W + h), M), R), P !== -h) {
1583
+ if (_ = kt(S.sizeTree).reduce((A, { k: W, v: M }) => Xe(A, Math.max(0, W + h), M), _), P !== -h) {
1578
1584
  const A = Yt(S.sizeTree, E);
1579
- R = Xe(R, 0, A);
1585
+ _ = Xe(_, 0, A);
1580
1586
  const W = ct(S.sizeTree, -h + 1)[1];
1581
- R = Xe(R, 1, W);
1587
+ _ = Xe(_, 1, W);
1582
1588
  }
1583
1589
  return {
1584
1590
  ...S,
1585
- sizeTree: R,
1586
- ...hr(S.offsetTree, 0, R, C)
1591
+ sizeTree: _,
1592
+ ...hr(S.offsetTree, 0, _, I)
1587
1593
  };
1588
1594
  } else {
1589
- const R = kt(S.sizeTree).reduce((O, { k: P, v: w }) => Xe(O, Math.max(0, P + h), w), Gt());
1595
+ const _ = kt(S.sizeTree).reduce((O, { k: P, v: w }) => Xe(O, Math.max(0, P + h), w), Gt());
1590
1596
  return {
1591
1597
  ...S,
1592
- sizeTree: R,
1593
- ...hr(S.offsetTree, 0, R, C)
1598
+ sizeTree: _,
1599
+ ...hr(S.offsetTree, 0, _, I)
1594
1600
  };
1595
1601
  }
1596
1602
  })
1597
1603
  ),
1598
1604
  f
1599
1605
  ), {
1600
- beforeUnshiftWith: I,
1606
+ beforeUnshiftWith: R,
1601
1607
  // input
1602
1608
  data: m,
1603
1609
  defaultItemSize: d,
@@ -1610,7 +1616,7 @@ const Os = {
1610
1616
  itemSize: b,
1611
1617
  listRefresh: k,
1612
1618
  shiftWith: s,
1613
- shiftWithOffset: _,
1619
+ shiftWithOffset: C,
1614
1620
  sizeRanges: n,
1615
1621
  // output
1616
1622
  sizes: f,
@@ -1706,14 +1712,14 @@ const on = xe(
1706
1712
  be(e, i, o),
1707
1713
  U(
1708
1714
  ([
1709
- [k, I, _, h, S, C, R, O],
1715
+ [k, R, C, h, S, I, _, O],
1710
1716
  P,
1711
1717
  w,
1712
1718
  E
1713
1719
  ]) => {
1714
- const A = ci(k), { align: W, behavior: M, offset: B } = A, F = h - 1, V = li(A, I, F);
1715
- let q = Zt(V, I.offsetTree, P) + C;
1716
- W === "end" ? (q += w + ct(I.sizeTree, V)[1] - _ + E, V === F && (q += R)) : W === "center" ? q += (w + ct(I.sizeTree, V)[1] - _ + E) / 2 : q -= S, B && (q += B);
1720
+ const A = ci(k), { align: W, behavior: M, offset: B } = A, F = h - 1, D = li(A, R, F);
1721
+ let q = Zt(D, R.offsetTree, P) + I;
1722
+ W === "end" ? (q += w + ct(R.sizeTree, D)[1] - C + E, D === F && (q += _)) : W === "center" ? q += (w + ct(R.sizeTree, D)[1] - C + E) / 2 : q -= S, B && (q += B);
1717
1723
  const ue = (de) => {
1718
1724
  T(), de ? (O("retrying to scroll to", { location: k }, Ye.DEBUG), ge(b, k)) : (ge(m, !0), O("list did not change, scroll successful", {}, Ye.DEBUG));
1719
1725
  };
@@ -1728,7 +1734,7 @@ const on = xe(
1728
1734
  p = at(L(t, zs(150)), ue);
1729
1735
  return f = setTimeout(() => {
1730
1736
  T();
1731
- }, 1200), ge(l, !0), O("scrolling from index to", { behavior: M, index: V, top: q }, Ye.DEBUG), { behavior: M, top: q };
1737
+ }, 1200), ge(l, !0), O("scrolling from index to", { behavior: M, index: D, top: q }, Ye.DEBUG), { behavior: M, top: q };
1732
1738
  }
1733
1739
  )
1734
1740
  ),
@@ -1839,26 +1845,26 @@ const Jt = "up", Ut = "down", As = "none", Ls = {
1839
1845
  const m = Ze(
1840
1846
  L(
1841
1847
  Fe(r, ae(i), ae(t), ae(e), ae(d)),
1842
- ht((u, [{ scrollHeight: T, scrollTop: k }, I, _, h, S]) => {
1843
- const C = k + I - T > -S, R = {
1848
+ ht((u, [{ scrollHeight: T, scrollTop: k }, R, C, h, S]) => {
1849
+ const I = k + R - T > -S, _ = {
1844
1850
  scrollHeight: T,
1845
1851
  scrollTop: k,
1846
- viewportHeight: I
1852
+ viewportHeight: R
1847
1853
  };
1848
- if (C) {
1854
+ if (I) {
1849
1855
  let P, w;
1850
1856
  return k > u.state.scrollTop ? (P = "SCROLLED_DOWN", w = u.state.scrollTop - k) : (P = "SIZE_DECREASED", w = u.state.scrollTop - k || u.scrollTopDelta), {
1851
1857
  atBottom: !0,
1852
1858
  atBottomBecause: P,
1853
1859
  scrollTopDelta: w,
1854
- state: R
1860
+ state: _
1855
1861
  };
1856
1862
  }
1857
1863
  let O;
1858
- return R.scrollHeight > u.state.scrollHeight ? O = "SIZE_INCREASED" : I < u.state.viewportHeight ? O = "VIEWPORT_HEIGHT_DECREASING" : k < u.state.scrollTop ? O = "SCROLLING_UPWARDS" : O = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1864
+ return _.scrollHeight > u.state.scrollHeight ? O = "SIZE_INCREASED" : R < u.state.viewportHeight ? O = "VIEWPORT_HEIGHT_DECREASING" : k < u.state.scrollTop ? O = "SCROLLING_UPWARDS" : O = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1859
1865
  atBottom: !1,
1860
1866
  notAtBottomBecause: O,
1861
- state: R
1867
+ state: _
1862
1868
  };
1863
1869
  }, Ls),
1864
1870
  Me((u, T) => u && u.atBottom === T.atBottom)
@@ -1867,7 +1873,7 @@ const Jt = "up", Ut = "down", As = "none", Ls = {
1867
1873
  L(
1868
1874
  r,
1869
1875
  ht(
1870
- (u, { scrollHeight: T, scrollTop: k, viewportHeight: I }) => {
1876
+ (u, { scrollHeight: T, scrollTop: k, viewportHeight: R }) => {
1871
1877
  if (ui(u.scrollHeight, T))
1872
1878
  return {
1873
1879
  changed: !1,
@@ -1876,8 +1882,8 @@ const Jt = "up", Ut = "down", As = "none", Ls = {
1876
1882
  scrollTop: k
1877
1883
  };
1878
1884
  {
1879
- const _ = T - (k + I) < 1;
1880
- return u.scrollTop !== k && _ ? {
1885
+ const C = T - (k + R) < 1;
1886
+ return u.scrollTop !== k && C ? {
1881
1887
  changed: !0,
1882
1888
  jump: u.scrollTop - k,
1883
1889
  scrollHeight: T,
@@ -1984,12 +1990,12 @@ const kr = xe(
1984
1990
  u,
1985
1991
  T
1986
1992
  ]) => {
1987
- const k = d - u, I = p + f, _ = Math.max(g - k, 0);
1993
+ const k = d - u, R = p + f, C = Math.max(g - k, 0);
1988
1994
  let h = Qr;
1989
- const S = Xr(T, en), C = Xr(T, tn);
1990
- return b -= u, b += g + f, m += g + f, m -= u, b > d + I - S && (h = Jt), m < d - _ + v + C && (h = Ut), h !== Qr ? [
1995
+ const S = Xr(T, en), I = Xr(T, tn);
1996
+ return b -= u, b += g + f, m += g + f, m -= u, b > d + R - S && (h = Jt), m < d - C + v + I && (h = Ut), h !== Qr ? [
1991
1997
  Math.max(k - g - Yr(y, en, h) - S, 0),
1992
- k - _ - f + v + Yr(y, tn, h) + C
1998
+ k - C - f + v + Yr(y, tn, h) + I
1993
1999
  ] : null;
1994
2000
  }
1995
2001
  ),
@@ -2128,8 +2134,8 @@ const Pt = xe(
2128
2134
  ae(u),
2129
2135
  e
2130
2136
  ),
2131
- ce(([h, S, , C, , , , , , , , R]) => {
2132
- const O = R && R.length !== C;
2137
+ ce(([h, S, , I, , , , , , , , _]) => {
2138
+ const O = _ && _.length !== I;
2133
2139
  return h && !S && !O;
2134
2140
  }),
2135
2141
  U(
@@ -2137,8 +2143,8 @@ const Pt = xe(
2137
2143
  ,
2138
2144
  ,
2139
2145
  [h, S],
2140
- C,
2141
- R,
2146
+ I,
2147
+ _,
2142
2148
  O,
2143
2149
  P,
2144
2150
  w,
@@ -2147,37 +2153,37 @@ const Pt = xe(
2147
2153
  W,
2148
2154
  M
2149
2155
  ]) => {
2150
- var B, F, V, q;
2151
- const ue = R, { offsetTree: de, sizeTree: ke } = ue, Re = Be(p);
2152
- if (C === 0)
2153
- return { ...Wn, totalCount: C };
2156
+ var B, F, D, q;
2157
+ const ue = _, { offsetTree: de, sizeTree: ke } = ue, Re = Be(p);
2158
+ if (I === 0)
2159
+ return { ...Wn, totalCount: I };
2154
2160
  if (h === 0 && S === 0)
2155
- return Re === 0 ? { ...Wn, totalCount: C } : di(Re, O, R, E, A, M || []);
2161
+ return Re === 0 ? { ...Wn, totalCount: I } : di(Re, O, _, E, A, M || []);
2156
2162
  if (Ce(ke))
2157
2163
  return Re > 0 ? null : mn(
2158
- Hs(Tr(O, C), ue, M),
2164
+ Hs(Tr(O, I), ue, M),
2159
2165
  [],
2160
- C,
2166
+ I,
2161
2167
  A,
2162
2168
  ue,
2163
2169
  E
2164
2170
  );
2165
2171
  const ee = [];
2166
2172
  if (w.length > 0) {
2167
- const $ = w[0], J = w[w.length - 1];
2173
+ const V = w[0], J = w[w.length - 1];
2168
2174
  let se = 0;
2169
- for (const re of Ht(ke, $, J)) {
2170
- const pe = re.value, le = Math.max(re.start, $), we = Math.min(re.end, J);
2175
+ for (const re of Ht(ke, V, J)) {
2176
+ const pe = re.value, le = Math.max(re.start, V), we = Math.min(re.end, J);
2171
2177
  for (let me = le; me <= we; me++)
2172
2178
  ee.push({ data: M == null ? void 0 : M[me], index: me, offset: se, size: pe }), se += pe;
2173
2179
  }
2174
2180
  }
2175
2181
  if (!P)
2176
- return mn([], ee, C, A, ue, E);
2182
+ return mn([], ee, I, A, ue, E);
2177
2183
  const Q = w.length > 0 ? w[w.length - 1] + 1 : 0, z = ks(de, h, S, Q);
2178
2184
  if (z.length === 0)
2179
2185
  return null;
2180
- const K = C - 1, ne = _n([], ($) => {
2186
+ const K = I - 1, ne = _n([], (V) => {
2181
2187
  for (const J of z) {
2182
2188
  const se = J.value;
2183
2189
  let re = se.offset, pe = J.start;
@@ -2190,16 +2196,16 @@ const Pt = xe(
2190
2196
  pe < Q && (re += (Q - pe) * le, pe = Q);
2191
2197
  const we = Math.min(J.end, K);
2192
2198
  for (let me = pe; me <= we && !(re >= S); me++)
2193
- $.push({ data: M == null ? void 0 : M[me], index: me, offset: re, size: le }), re += le + A;
2199
+ V.push({ data: M == null ? void 0 : M[me], index: me, offset: re, size: le }), re += le + A;
2194
2200
  }
2195
2201
  }), H = Jr(W, en), oe = Jr(W, tn);
2196
2202
  if (ne.length > 0 && (H > 0 || oe > 0)) {
2197
- const $ = ne[0], J = ne[ne.length - 1];
2198
- if (H > 0 && $.index > Q) {
2199
- const se = Math.min(H, $.index - Q), re = [];
2200
- let pe = $.offset;
2201
- for (let le = $.index - 1; le >= $.index - se; le--) {
2202
- const we = (F = (B = Ht(ke, le, le)[0]) == null ? void 0 : B.value) != null ? F : $.size;
2203
+ const V = ne[0], J = ne[ne.length - 1];
2204
+ if (H > 0 && V.index > Q) {
2205
+ const se = Math.min(H, V.index - Q), re = [];
2206
+ let pe = V.offset;
2207
+ for (let le = V.index - 1; le >= V.index - se; le--) {
2208
+ const we = (F = (B = Ht(ke, le, le)[0]) == null ? void 0 : B.value) != null ? F : V.size;
2203
2209
  pe -= we + A, re.unshift({ data: M == null ? void 0 : M[le], index: le, offset: pe, size: we });
2204
2210
  }
2205
2211
  ne.unshift(...re);
@@ -2208,12 +2214,12 @@ const Pt = xe(
2208
2214
  const se = Math.min(oe, K - J.index);
2209
2215
  let re = J.offset + J.size + A;
2210
2216
  for (let pe = J.index + 1; pe <= J.index + se; pe++) {
2211
- const le = (q = (V = Ht(ke, pe, pe)[0]) == null ? void 0 : V.value) != null ? q : J.size;
2217
+ const le = (q = (D = Ht(ke, pe, pe)[0]) == null ? void 0 : D.value) != null ? q : J.size;
2212
2218
  ne.push({ data: M == null ? void 0 : M[pe], index: pe, offset: re, size: le }), re += le + A;
2213
2219
  }
2214
2220
  }
2215
2221
  }
2216
- return mn(ne, ee, C, A, ue, E);
2222
+ return mn(ne, ee, I, A, ue, E);
2217
2223
  }
2218
2224
  ),
2219
2225
  //@ts-expect-error filter needs to be fixed
@@ -2258,7 +2264,7 @@ const Pt = xe(
2258
2264
  Me(Xt),
2259
2265
  U(([h]) => h)
2260
2266
  )
2261
- ), I = Ze(
2267
+ ), R = Ze(
2262
2268
  L(
2263
2269
  T,
2264
2270
  mt(200),
@@ -2266,18 +2272,18 @@ const Pt = xe(
2266
2272
  U(({ items: h }) => h[0].index),
2267
2273
  Me()
2268
2274
  )
2269
- ), _ = Ze(
2275
+ ), C = Ze(
2270
2276
  L(
2271
2277
  T,
2272
2278
  ce(({ items: h }) => h.length > 0),
2273
2279
  U(({ items: h }) => {
2274
- let S = 0, C = h.length - 1;
2275
- for (; h[S].type === "group" && S < C; )
2280
+ let S = 0, I = h.length - 1;
2281
+ for (; h[S].type === "group" && S < I; )
2276
2282
  S++;
2277
- for (; h[C].type === "group" && C > S; )
2278
- C--;
2283
+ for (; h[I].type === "group" && I > S; )
2284
+ I--;
2279
2285
  return {
2280
- endIndex: h[C].index,
2286
+ endIndex: h[I].index,
2281
2287
  startIndex: h[S].index
2282
2288
  };
2283
2289
  }),
@@ -2290,8 +2296,8 @@ const Pt = xe(
2290
2296
  itemsRendered: f,
2291
2297
  listState: T,
2292
2298
  minOverscanItemCount: u,
2293
- rangeChanged: _,
2294
- startReached: I,
2299
+ rangeChanged: C,
2300
+ startReached: R,
2295
2301
  topItemsIndexes: y,
2296
2302
  ...g
2297
2303
  };
@@ -2357,10 +2363,10 @@ const Pt = xe(
2357
2363
  be(t, l, n, i, o, r, c),
2358
2364
  be(e),
2359
2365
  U(([[v, g, b, m, y, p, f, u], T]) => {
2360
- const { align: k, behavior: I, calculateViewLocation: _ = Fs, done: h, ...S } = v, C = li(v, g, m - 1), R = Zt(C, g.offsetTree, T) + y + p, O = R + ct(g.sizeTree, C)[1], P = u + p, w = u + b - f, E = _({
2366
+ const { align: k, behavior: R, calculateViewLocation: C = Fs, done: h, ...S } = v, I = li(v, g, m - 1), _ = Zt(I, g.offsetTree, T) + y + p, O = _ + ct(g.sizeTree, I)[1], P = u + p, w = u + b - f, E = C({
2361
2367
  itemBottom: O,
2362
- itemTop: R,
2363
- locationParams: { align: k, behavior: I, ...S },
2368
+ itemTop: _,
2369
+ locationParams: { align: k, behavior: R, ...S },
2364
2370
  viewportBottom: w,
2365
2371
  viewportTop: P
2366
2372
  });
@@ -2402,10 +2408,10 @@ const Ws = (e, t) => typeof e == "function" ? eo(e(t)) : t && eo(e), Ds = xe(
2402
2408
  ]) => {
2403
2409
  const m = G(!1), y = ye();
2404
2410
  let p = null;
2405
- function f(I) {
2411
+ function f(R) {
2406
2412
  ge(s, {
2407
2413
  align: "end",
2408
- behavior: I,
2414
+ behavior: R,
2409
2415
  index: "LAST"
2410
2416
  });
2411
2417
  }
@@ -2413,53 +2419,53 @@ const Ws = (e, t) => typeof e == "function" ? eo(e(t)) : t && eo(e), Ds = xe(
2413
2419
  L(
2414
2420
  Fe(L(ae(t), _t(1)), l),
2415
2421
  be(ae(m), i, c, v),
2416
- U(([[I, _], h, S, C, R]) => {
2417
- let O = _ && C, P = "auto";
2418
- return O && (P = Ws(h, S || R), O = O && !!P), { followOutputBehavior: P, shouldFollow: O, totalCount: I };
2422
+ U(([[R, C], h, S, I, _]) => {
2423
+ let O = C && I, P = "auto";
2424
+ return O && (P = Ws(h, S || _), O = O && !!P), { followOutputBehavior: P, shouldFollow: O, totalCount: R };
2419
2425
  }),
2420
- ce(({ shouldFollow: I }) => I)
2426
+ ce(({ shouldFollow: R }) => R)
2421
2427
  ),
2422
- ({ followOutputBehavior: I, totalCount: _ }) => {
2428
+ ({ followOutputBehavior: R, totalCount: C }) => {
2423
2429
  p && (p(), p = null), Be(n) ? requestAnimationFrame(() => {
2424
- Be(d)("following output to ", { totalCount: _ }, Ye.DEBUG), f(I);
2430
+ Be(d)("following output to ", { totalCount: C }, Ye.DEBUG), f(R);
2425
2431
  }) : p = at(e, () => {
2426
- Be(d)("following output to ", { totalCount: _ }, Ye.DEBUG), f(I), p = null;
2432
+ Be(d)("following output to ", { totalCount: C }, Ye.DEBUG), f(R), p = null;
2427
2433
  });
2428
2434
  }
2429
2435
  );
2430
- function u(I) {
2431
- const _ = at(o, (h) => {
2432
- I && !h.atBottom && h.notAtBottomBecause === "SIZE_INCREASED" && !p && (Be(d)("scrolling to bottom due to increased size", {}, Ye.DEBUG), f("auto"));
2436
+ function u(R) {
2437
+ const C = at(o, (h) => {
2438
+ R && !h.atBottom && h.notAtBottomBecause === "SIZE_INCREASED" && !p && (Be(d)("scrolling to bottom due to increased size", {}, Ye.DEBUG), f("auto"));
2433
2439
  });
2434
- setTimeout(_, 100);
2440
+ setTimeout(C, 100);
2435
2441
  }
2436
2442
  Ie(
2437
2443
  L(
2438
2444
  Fe(ae(m), t, a),
2439
- ce(([I, , _]) => I && _),
2445
+ ce(([R, , C]) => R && C),
2440
2446
  ht(
2441
- ({ value: I }, [, _]) => ({ refreshed: I === _, value: _ }),
2447
+ ({ value: R }, [, C]) => ({ refreshed: R === C, value: C }),
2442
2448
  { refreshed: !1, value: 0 }
2443
2449
  ),
2444
- ce(({ refreshed: I }) => I),
2450
+ ce(({ refreshed: R }) => R),
2445
2451
  be(m, t)
2446
2452
  ),
2447
- ([, I]) => {
2448
- Be(c) && u(I !== !1);
2453
+ ([, R]) => {
2454
+ Be(c) && u(R !== !1);
2449
2455
  }
2450
2456
  ), Ie(y, () => {
2451
2457
  u(Be(m) !== !1);
2452
- }), Ie(Fe(ae(m), o), ([I, _]) => {
2453
- I && !_.atBottom && _.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && f("auto");
2458
+ }), Ie(Fe(ae(m), o), ([R, C]) => {
2459
+ R && !C.atBottom && C.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && f("auto");
2454
2460
  });
2455
2461
  const T = G(null), k = ye();
2456
2462
  return te(
2457
2463
  ur(
2458
2464
  L(
2459
2465
  ae(r),
2460
- U((I) => {
2461
- var _;
2462
- return (_ = I == null ? void 0 : I.length) != null ? _ : 0;
2466
+ U((R) => {
2467
+ var C;
2468
+ return (C = R == null ? void 0 : R.length) != null ? C : 0;
2463
2469
  })
2464
2470
  ),
2465
2471
  L(ae(t))
@@ -2469,15 +2475,15 @@ const Ws = (e, t) => typeof e == "function" ? eo(e(t)) : t && eo(e), Ds = xe(
2469
2475
  L(
2470
2476
  Fe(L(k, _t(1)), l),
2471
2477
  be(ae(T), c, v, g),
2472
- U(([[I, _], h, S, C, R]) => _ && S && (h == null ? void 0 : h({ context: R, totalCount: I, scrollingInProgress: C }))),
2473
- ce((I) => !!I),
2478
+ U(([[R, C], h, S, I, _]) => C && S && (h == null ? void 0 : h({ context: _, totalCount: R, scrollingInProgress: I }))),
2479
+ ce((R) => !!R),
2474
2480
  mt(0)
2475
2481
  ),
2476
- (I) => {
2482
+ (R) => {
2477
2483
  p && (p(), p = null), Be(n) ? requestAnimationFrame(() => {
2478
- Be(d)("scrolling into view", {}), ge(b, I);
2484
+ Be(d)("scrolling into view", {}), ge(b, R);
2479
2485
  }) : p = at(e, () => {
2480
- Be(d)("scrolling into view", {}), ge(b, I), p = null;
2486
+ Be(d)("scrolling into view", {}), ge(b, R), p = null;
2481
2487
  });
2482
2488
  }
2483
2489
  ), { autoscrollToBottom: y, followOutput: m, scrollIntoViewOnChange: T };
@@ -2663,10 +2669,10 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2663
2669
  l,
2664
2670
  be(s),
2665
2671
  ht(
2666
- ([, f, u, T], [{ bottom: k, items: I, offsetBottom: _, totalCount: h }, S]) => {
2667
- const C = k + _;
2668
- let R = 0;
2669
- return u === h && f.length > 0 && I.length > 0 && (I[0].originalIndex === 0 && f[0].originalIndex === 0 || (R = C - T, R !== 0 && (R += S))), [R, I, h, C];
2672
+ ([, f, u, T], [{ bottom: k, items: R, offsetBottom: C, totalCount: h }, S]) => {
2673
+ const I = k + C;
2674
+ let _ = 0;
2675
+ return u === h && f.length > 0 && R.length > 0 && (R[0].originalIndex === 0 && f[0].originalIndex === 0 || (_ = I - T, _ !== 0 && (_ += S))), [_, R, h, I];
2670
2676
  },
2671
2677
  [0, [], 0, 0]
2672
2678
  ),
@@ -2699,20 +2705,20 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2699
2705
  L(
2700
2706
  a,
2701
2707
  be(g, d),
2702
- U(([f, { groupIndices: u, lastSize: T, sizeTree: k }, I]) => {
2703
- function _(h) {
2704
- return h * (T + I);
2708
+ U(([f, { groupIndices: u, lastSize: T, sizeTree: k }, R]) => {
2709
+ function C(h) {
2710
+ return h * (T + R);
2705
2711
  }
2706
2712
  if (u.length === 0)
2707
- return _(f);
2713
+ return C(f);
2708
2714
  {
2709
2715
  let h = 0;
2710
2716
  const S = Yt(k, 0);
2711
- let C = 0, R = 0;
2712
- for (; C < f; ) {
2713
- C++, h += S;
2714
- let O = u.length === R + 1 ? 1 / 0 : u[R + 1] - u[R] - 1;
2715
- C + O > f && (h -= S, O = f - C + 1), C += O, h += _(O), R++;
2717
+ let I = 0, _ = 0;
2718
+ for (; I < f; ) {
2719
+ I++, h += S;
2720
+ let O = u.length === _ + 1 ? 1 / 0 : u[_ + 1] - u[_] - 1;
2721
+ I + O > f && (h -= S, O = f - I + 1), I += O, h += C(O), _++;
2716
2722
  }
2717
2723
  return h;
2718
2724
  }
@@ -2790,16 +2796,16 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2790
2796
  u,
2791
2797
  T,
2792
2798
  k,
2793
- { scrollToIndex: I },
2794
- _,
2799
+ { scrollToIndex: R },
2800
+ C,
2795
2801
  { topItemCount: h },
2796
2802
  { groupCounts: S },
2797
- C
2803
+ I
2798
2804
  ]) => {
2799
- const { listState: R, minOverscanItemCount: O, topItemsIndexes: P, rangeChanged: w, ...E } = k;
2800
- return te(w, C.scrollSeekRangeChanged), te(
2805
+ const { listState: _, minOverscanItemCount: O, topItemsIndexes: P, rangeChanged: w, ...E } = k;
2806
+ return te(w, I.scrollSeekRangeChanged), te(
2801
2807
  L(
2802
- C.windowViewportRect,
2808
+ I.windowViewportRect,
2803
2809
  U((A) => A.visibleHeight)
2804
2810
  ),
2805
2811
  f.viewportHeight
@@ -2823,9 +2829,9 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2823
2829
  ...T,
2824
2830
  groupIndices: s,
2825
2831
  itemSize: l,
2826
- listState: R,
2832
+ listState: _,
2827
2833
  minOverscanItemCount: O,
2828
- scrollToIndex: I,
2834
+ scrollToIndex: R,
2829
2835
  // output
2830
2836
  statefulTotalCount: v,
2831
2837
  trackItemSizes: b,
@@ -2833,7 +2839,7 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2833
2839
  rangeChanged: w,
2834
2840
  ...E,
2835
2841
  // the bag of IO from featureGroup1System
2836
- ...C,
2842
+ ...I,
2837
2843
  ...f,
2838
2844
  sizes: d,
2839
2845
  ...u
@@ -2891,18 +2897,18 @@ function vi(e, t, n) {
2891
2897
  const v = N.forwardRef((p, f) => {
2892
2898
  const { children: u, ...T } = p, [k] = N.useState(() => _n(gs(e), (h) => {
2893
2899
  l(h, T);
2894
- })), [I] = N.useState(Vr(d, k));
2900
+ })), [R] = N.useState(Vr(d, k));
2895
2901
  dn(() => {
2896
2902
  for (const h of s)
2897
- h in T && Ie(I[h], T[h]);
2903
+ h in T && Ie(R[h], T[h]);
2898
2904
  return () => {
2899
- Object.values(I).map(yr);
2905
+ Object.values(R).map(yr);
2900
2906
  };
2901
- }, [T, I, k]), dn(() => {
2907
+ }, [T, R, k]), dn(() => {
2902
2908
  l(k, T);
2903
2909
  }), N.useImperativeHandle(f, $r(a(k)));
2904
- const _ = n;
2905
- return /* @__PURE__ */ x(c.Provider, { value: k, children: n ? /* @__PURE__ */ x(_, { ...Xs([...r, ...o, ...s], T), children: u }) : u });
2910
+ const C = n;
2911
+ return /* @__PURE__ */ x(c.Provider, { value: k, children: n ? /* @__PURE__ */ x(C, { ...Xs([...r, ...o, ...s], T), children: u }) : u });
2906
2912
  }), g = (p) => {
2907
2913
  const f = N.useContext(c);
2908
2914
  return N.useCallback(
@@ -3051,7 +3057,7 @@ const Js = /* @__PURE__ */ xe(() => {
3051
3057
  Er("deviation", (E) => {
3052
3058
  f !== E && u(E);
3053
3059
  });
3054
- const T = fe("EmptyPlaceholder"), k = fe("ScrollSeekPlaceholder") || tl, I = fe("ListComponent"), _ = fe("ItemComponent"), h = fe("GroupComponent"), S = fe("computeItemKey"), C = fe("isSeeking"), R = fe("groupIndices").length > 0, O = fe("alignToBottom"), P = fe("initialItemFinalLocationReached"), w = e ? {} : {
3060
+ const T = fe("EmptyPlaceholder"), k = fe("ScrollSeekPlaceholder") || tl, R = fe("ListComponent"), C = fe("ItemComponent"), h = fe("GroupComponent"), S = fe("computeItemKey"), I = fe("isSeeking"), _ = fe("groupIndices").length > 0, O = fe("alignToBottom"), P = fe("initialItemFinalLocationReached"), w = e ? {} : {
3055
3061
  boxSizing: "border-box",
3056
3062
  ...y ? {
3057
3063
  display: "inline-block",
@@ -3068,15 +3074,15 @@ const Js = /* @__PURE__ */ xe(() => {
3068
3074
  ...P ? {} : { visibility: "hidden" }
3069
3075
  };
3070
3076
  return !e && t.totalCount === 0 && T ? /* @__PURE__ */ x(T, { ...qe(T, a) }) : /* @__PURE__ */ x(
3071
- I,
3077
+ R,
3072
3078
  {
3073
- ...qe(I, a),
3079
+ ...qe(R, a),
3074
3080
  "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
3075
3081
  ref: p,
3076
3082
  style: w,
3077
3083
  children: (e ? t.topItems : t.items).map((E) => {
3078
3084
  const A = E.originalIndex, W = S(A + t.firstItemIndex, E.data, a);
3079
- return C ? /* @__PURE__ */ hn(
3085
+ return I ? /* @__PURE__ */ hn(
3080
3086
  k,
3081
3087
  {
3082
3088
  ...qe(k, a),
@@ -3098,10 +3104,10 @@ const Js = /* @__PURE__ */ xe(() => {
3098
3104
  },
3099
3105
  d(E.index, a)
3100
3106
  ) : /* @__PURE__ */ hn(
3101
- _,
3107
+ C,
3102
3108
  {
3103
- ...qe(_, a),
3104
- ...ll(_, E.data),
3109
+ ...qe(C, a),
3110
+ ...ll(C, E.data),
3105
3111
  "data-index": A,
3106
3112
  "data-item-group-index": E.groupIndex,
3107
3113
  "data-item-index": E.index,
@@ -3109,7 +3115,7 @@ const Js = /* @__PURE__ */ xe(() => {
3109
3115
  key: W,
3110
3116
  style: y ? rl : Ii
3111
3117
  },
3112
- R ? l(E.index, E.groupIndex, E.data, a) : l(E.index, E.data, a)
3118
+ _ ? l(E.index, E.groupIndex, E.data, a) : l(E.index, E.data, a)
3113
3119
  );
3114
3120
  })
3115
3121
  }
@@ -3396,9 +3402,9 @@ const wl = /* @__PURE__ */ xe(
3396
3402
  b,
3397
3403
  { didMount: m, propsReady: y },
3398
3404
  { customScrollParent: p, useWindowScroll: f, windowScrollContainerState: u, windowScrollTo: T, windowViewportRect: k },
3399
- I
3405
+ R
3400
3406
  ]) => {
3401
- const _ = G(0), h = G(0), S = G(ro), C = G({ height: 0, width: 0 }), R = G({ height: 0, width: 0 }), O = ye(), P = ye(), w = G(0), E = G(null), A = G({ column: 0, row: 0 }), W = ye(), M = ye(), B = G(!1), F = G(0), V = G(!0), q = G(!1), ue = G(!1);
3407
+ const C = G(0), h = G(0), S = G(ro), I = G({ height: 0, width: 0 }), _ = G({ height: 0, width: 0 }), O = ye(), P = ye(), w = G(0), E = G(null), A = G({ column: 0, row: 0 }), W = ye(), M = ye(), B = G(!1), F = G(0), D = G(!0), q = G(!1), ue = G(!1);
3402
3408
  Ie(
3403
3409
  L(
3404
3410
  m,
@@ -3406,18 +3412,18 @@ const wl = /* @__PURE__ */ xe(
3406
3412
  ce(([z, K]) => !!K)
3407
3413
  ),
3408
3414
  () => {
3409
- ge(V, !1);
3415
+ ge(D, !1);
3410
3416
  }
3411
3417
  ), Ie(
3412
3418
  L(
3413
- Fe(m, V, R, C, F, q),
3419
+ Fe(m, D, _, I, F, q),
3414
3420
  ce(([z, K, ne, H, , oe]) => z && !K && ne.height !== 0 && H.height !== 0 && !oe)
3415
3421
  ),
3416
3422
  ([, , , , z]) => {
3417
3423
  ge(q, !0), Cr(1, () => {
3418
3424
  ge(O, z);
3419
3425
  }), at(L(a), () => {
3420
- ge(t, [0, 0]), ge(V, !0);
3426
+ ge(t, [0, 0]), ge(D, !0);
3421
3427
  });
3422
3428
  }
3423
3429
  ), te(
@@ -3434,21 +3440,21 @@ const wl = /* @__PURE__ */ xe(
3434
3440
  ce(([, z]) => z != null)
3435
3441
  ),
3436
3442
  ([, z]) => {
3437
- z && (ge(C, z.viewport), ge(R, z.item), ge(A, z.gap), z.scrollTop > 0 && (ge(B, !0), at(L(a, _t(1)), (K) => {
3443
+ z && (ge(I, z.viewport), ge(_, z.item), ge(A, z.gap), z.scrollTop > 0 && (ge(B, !0), at(L(a, _t(1)), (K) => {
3438
3444
  ge(B, !1);
3439
3445
  }), ge(l, { top: z.scrollTop })));
3440
3446
  }
3441
3447
  ), te(
3442
3448
  L(
3443
- C,
3449
+ I,
3444
3450
  U(({ height: z }) => z)
3445
3451
  ),
3446
3452
  v
3447
3453
  ), te(
3448
3454
  L(
3449
3455
  Fe(
3450
- ae(C, fn),
3451
- ae(R, fn),
3456
+ ae(I, fn),
3457
+ ae(_, fn),
3452
3458
  ae(A, (z, K) => z && z.column === K.column && z.row === K.row),
3453
3459
  ae(a)
3454
3460
  ),
@@ -3463,15 +3469,15 @@ const wl = /* @__PURE__ */ xe(
3463
3469
  ), te(
3464
3470
  L(
3465
3471
  Fe(
3466
- ae(_),
3472
+ ae(C),
3467
3473
  r,
3468
3474
  ae(A, xl),
3469
- ae(R, fn),
3470
- ae(C, fn),
3475
+ ae(_, fn),
3476
+ ae(I, fn),
3471
3477
  ae(E),
3472
3478
  ae(h),
3473
3479
  ae(B),
3474
- ae(V),
3480
+ ae(D),
3475
3481
  ae(F)
3476
3482
  ),
3477
3483
  ce(([, , , , , , , z]) => !z),
@@ -3481,14 +3487,14 @@ const wl = /* @__PURE__ */ xe(
3481
3487
  [K, ne],
3482
3488
  H,
3483
3489
  oe,
3484
- $,
3490
+ V,
3485
3491
  J,
3486
3492
  se,
3487
3493
  ,
3488
3494
  re,
3489
3495
  pe
3490
3496
  ]) => {
3491
- const { column: le, row: we } = H, { height: me, width: Te } = oe, { width: Oe } = $;
3497
+ const { column: le, row: we } = H, { height: me, width: Te } = oe, { width: Oe } = V;
3492
3498
  if (se === 0 && (z === 0 || Oe === 0))
3493
3499
  return ro;
3494
3500
  if (Te === 0) {
@@ -3498,7 +3504,7 @@ const wl = /* @__PURE__ */ xe(
3498
3504
  const Ne = ki(Oe, Te, le);
3499
3505
  let Le, $e;
3500
3506
  re ? K === 0 && ne === 0 && se > 0 ? (Le = 0, $e = se - 1) : (Le = Ne * Sn((K + we) / (me + we)), $e = Ne * oo((ne + we) / (me + we)) - 1, $e = Vn(z - 1, Kt($e, Ne - 1)), Le = Vn($e, Kt(0, Le))) : (Le = 0, $e = -1);
3501
- const ut = so(Le, $e, J), { bottom: Qe, top: He } = lo($, H, oe, ut), ot = oo(z / Ne), Je = ot * me + (ot - 1) * we - Qe;
3507
+ const ut = so(Le, $e, J), { bottom: Qe, top: He } = lo(V, H, oe, ut), ot = oo(z / Ne), Je = ot * me + (ot - 1) * we - Qe;
3502
3508
  return { bottom: Qe, itemHeight: me, items: ut, itemWidth: Te, offsetBottom: Je, offsetTop: He, top: He };
3503
3509
  }
3504
3510
  )
@@ -3510,14 +3516,14 @@ const wl = /* @__PURE__ */ xe(
3510
3516
  ce((z) => z !== null),
3511
3517
  U((z) => z.length)
3512
3518
  ),
3513
- _
3519
+ C
3514
3520
  ), te(
3515
3521
  L(
3516
- Fe(C, R, S, A),
3522
+ Fe(I, _, S, A),
3517
3523
  ce(([z, K, { items: ne }]) => ne.length > 0 && K.height !== 0 && z.height !== 0),
3518
3524
  U(([z, K, { items: ne }, H]) => {
3519
- const { bottom: oe, top: $ } = lo(z, H, K, ne);
3520
- return [$, oe];
3525
+ const { bottom: oe, top: V } = lo(z, H, K, ne);
3526
+ return [V, oe];
3521
3527
  }),
3522
3528
  Me(Xt)
3523
3529
  ),
@@ -3534,7 +3540,7 @@ const wl = /* @__PURE__ */ xe(
3534
3540
  );
3535
3541
  const ke = Ze(
3536
3542
  L(
3537
- Fe(S, _),
3543
+ Fe(S, C),
3538
3544
  ce(([{ items: z }]) => z.length > 0),
3539
3545
  be(de),
3540
3546
  ce(([[z, K], ne]) => {
@@ -3567,10 +3573,10 @@ const wl = /* @__PURE__ */ xe(
3567
3573
  te(ee, b.scrollSeekRangeChanged), te(
3568
3574
  L(
3569
3575
  O,
3570
- be(C, R, _, A),
3576
+ be(I, _, C, A),
3571
3577
  U(([z, K, ne, H, oe]) => {
3572
- const $ = ci(z), { align: J, behavior: se, offset: re } = $;
3573
- let pe = $.index;
3578
+ const V = ci(z), { align: J, behavior: se, offset: re } = V;
3579
+ let pe = V.index;
3574
3580
  pe === "LAST" && (pe = H - 1), pe = Kt(0, pe, Vn(H - 1, pe));
3575
3581
  let le = gr(K, oe, ne, pe);
3576
3582
  return J === "end" ? le = io(le - K.height + ne.height) : J === "center" && (le = io(le - K.height / 2 + ne.height / 2)), re && (le += re), { behavior: se, top: le };
@@ -3590,7 +3596,7 @@ const wl = /* @__PURE__ */ xe(
3590
3596
  k,
3591
3597
  U((z) => ({ height: z.visibleHeight, width: z.visibleWidth }))
3592
3598
  ),
3593
- C
3599
+ I
3594
3600
  ), {
3595
3601
  customScrollParent: p,
3596
3602
  // input
@@ -3601,7 +3607,7 @@ const wl = /* @__PURE__ */ xe(
3601
3607
  headerHeight: i,
3602
3608
  increaseViewportBy: e,
3603
3609
  initialItemCount: h,
3604
- itemDimensions: R,
3610
+ itemDimensions: _,
3605
3611
  overscan: n,
3606
3612
  restoreStateFrom: M,
3607
3613
  scrollBy: s,
@@ -3611,9 +3617,9 @@ const wl = /* @__PURE__ */ xe(
3611
3617
  scrollToIndex: O,
3612
3618
  scrollTop: a,
3613
3619
  smoothScrollTargetReached: d,
3614
- totalCount: _,
3620
+ totalCount: C,
3615
3621
  useWindowScroll: f,
3616
- viewportDimensions: C,
3622
+ viewportDimensions: I,
3617
3623
  windowScrollContainerState: u,
3618
3624
  windowScrollTo: T,
3619
3625
  windowViewportRect: k,
@@ -3630,7 +3636,7 @@ const wl = /* @__PURE__ */ xe(
3630
3636
  startReached: Re,
3631
3637
  stateChanged: W,
3632
3638
  stateRestoreInProgress: B,
3633
- ...I
3639
+ ...R
3634
3640
  };
3635
3641
  },
3636
3642
  Ee(kr, Ke, ln, gi, It, Rr, wt)
@@ -3687,8 +3693,8 @@ const Il = /* @__PURE__ */ xe(() => {
3687
3693
  s(u);
3688
3694
  const T = f.firstChild;
3689
3695
  if (T) {
3690
- const { height: k, width: I } = T.getBoundingClientRect();
3691
- v({ height: k, width: I });
3696
+ const { height: k, width: R } = T.getBoundingClientRect();
3697
+ v({ height: k, width: R });
3692
3698
  }
3693
3699
  g({
3694
3700
  column: ao("column-gap", getComputedStyle(f).columnGap, b),
@@ -3904,12 +3910,12 @@ const Ul = Object.freeze({
3904
3910
  pointerColor: void 0
3905
3911
  }), _i = N.memo(
3906
3912
  function({ runs: t, ns: n, baseIndex: r, preGroups: o }) {
3907
- const i = _e((C) => C.setClipIndex), s = _e((C) => C.seek), c = j((C) => C.setCurrentGlobalRunIndex), l = yn(), a = j((C) => C.rangeStartGI), d = j((C) => C.rangeEndGI), v = j((C) => C.setRange), g = a != null && d != null, b = Z(
3908
- (C) => {
3913
+ const i = _e((I) => I.setClipIndex), s = _e((I) => I.seek), c = j((I) => I.setCurrentGlobalRunIndex), l = yn(), a = j((I) => I.rangeStartGI), d = j((I) => I.rangeEndGI), v = j((I) => I.setRange), g = a != null && d != null, b = Z(
3914
+ (I) => {
3909
3915
  var M;
3910
- const R = (M = C.target) == null ? void 0 : M.closest("[data-g]");
3911
- if (!R) return;
3912
- const O = Number(R.dataset.g), P = O - r;
3916
+ const _ = (M = I.target) == null ? void 0 : M.closest("[data-g]");
3917
+ if (!_) return;
3918
+ const O = Number(_.dataset.g), P = O - r;
3913
3919
  if (P < 0 || P >= t.length) return;
3914
3920
  const w = t[P], E = w.text ?? "";
3915
3921
  if (!E.trim() || !/[가-힣a-zA-Z0-9]/.test(E)) return;
@@ -3919,11 +3925,11 @@ const Ul = Object.freeze({
3919
3925
  },
3920
3926
  [t, r, s, i, c]
3921
3927
  ), m = ie(null), y = ie(!1), p = Z(
3922
- (C) => {
3928
+ (I) => {
3923
3929
  var w;
3924
- const R = (w = C.target) == null ? void 0 : w.closest("[data-g]");
3925
- if (!R) return;
3926
- const O = Number(R.dataset.g), P = O - r;
3930
+ const _ = (w = I.target) == null ? void 0 : w.closest("[data-g]");
3931
+ if (!_) return;
3932
+ const O = Number(_.dataset.g), P = O - r;
3927
3933
  P < 0 || P >= t.length || (y.current = !1, m.current && (window.clearTimeout(m.current), m.current = null), m.current = window.setTimeout(() => {
3928
3934
  l.getState().status !== "playing" && (v(O, O), y.current = !0, m.current = null);
3929
3935
  }, 800));
@@ -3933,40 +3939,40 @@ const Ul = Object.freeze({
3933
3939
  m.current && (window.clearTimeout(m.current), m.current = null);
3934
3940
  }, []), u = Z(() => {
3935
3941
  f();
3936
- }, [f]), T = f, k = f, I = j((C) => C.clearRange), _ = Z(
3937
- (C) => {
3942
+ }, [f]), T = f, k = f, R = j((I) => I.clearRange), C = Z(
3943
+ (I) => {
3938
3944
  var P;
3939
3945
  if (y.current) {
3940
3946
  y.current = !1;
3941
3947
  return;
3942
3948
  }
3943
- const R = (P = C.target) == null ? void 0 : P.closest("[data-g]");
3944
- if (!R) return;
3945
- const O = Number(R.dataset.g);
3946
- isNaN(O) || g && a != null && d != null && (I(), C.stopPropagation());
3949
+ const _ = (P = I.target) == null ? void 0 : P.closest("[data-g]");
3950
+ if (!_) return;
3951
+ const O = Number(_.dataset.g);
3952
+ isNaN(O) || g && a != null && d != null && (R(), I.stopPropagation());
3947
3953
  },
3948
- [g, a, d, I]
3954
+ [g, a, d, R]
3949
3955
  ), h = o, S = r + t.length - 1;
3950
3956
  return /* @__PURE__ */ x(
3951
3957
  "span",
3952
3958
  {
3953
- onClick: _,
3959
+ onClick: C,
3954
3960
  onDoubleClick: b,
3955
3961
  onPointerDown: p,
3956
3962
  onPointerUp: u,
3957
3963
  onPointerCancel: T,
3958
3964
  onPointerLeave: k,
3959
- children: h.map((C, R) => /* @__PURE__ */ x(
3965
+ children: h.map((I, _) => /* @__PURE__ */ x(
3960
3966
  Ql,
3961
3967
  {
3962
3968
  ns: n,
3963
- group: C,
3969
+ group: I,
3964
3970
  runs: t,
3965
3971
  paraLastG: S,
3966
3972
  rangeStartGI: a,
3967
3973
  rangeEndGI: d
3968
3974
  },
3969
- `${n}/grp:${R}-${C.startG}`
3975
+ `${n}/grp:${_}-${I.startG}`
3970
3976
  ))
3971
3977
  }
3972
3978
  );
@@ -4014,7 +4020,7 @@ const Ul = Object.freeze({
4014
4020
  "--ul-offset": "0.35em"
4015
4021
  } : void 0;
4016
4022
  return /* @__PURE__ */ x(yt, { children: Array.from({ length: g }).map((p, f) => {
4017
- const T = r[v + f], k = n.startG + f, I = `${t}/run:${k}`, _ = !!T.split && k !== o;
4023
+ const T = r[v + f], k = n.startG + f, R = `${t}/run:${k}`, C = !!T.split && k !== o;
4018
4024
  let h = `${ft.runWrap}`;
4019
4025
  return b && (g === 1 ? h += ` ${ft.highlight}` : f === 0 ? h += ` ${ft.highlightleft}` : f + 1 === g ? h += ` ${ft.highlightright}` : h += ` ${ft.highlightcenter}`), m && (g === 1 ? h += ` ${ft.underline}` : f === 0 ? h += ` ${ft.underlineleft}` : f + 1 === g ? h += ` ${ft.underlineright}` : h += ` ${ft.underlinecenter}`), /* @__PURE__ */ X(N.Fragment, { children: [
4020
4026
  /* @__PURE__ */ x("span", { className: h, style: y, children: /* @__PURE__ */ x(
@@ -4028,8 +4034,8 @@ const Ul = Object.freeze({
4028
4034
  isInRange: i != null && s != null && k >= i && k <= s
4029
4035
  }
4030
4036
  ) }),
4031
- _ && /* @__PURE__ */ x(Kl, {})
4032
- ] }, I);
4037
+ C && /* @__PURE__ */ x(Kl, {})
4038
+ ] }, R);
4033
4039
  }) });
4034
4040
  },
4035
4041
  (e, t) => e.group === t.group && // 그룹 메타 참조 동일
@@ -4324,7 +4330,7 @@ function st(e, t) {
4324
4330
  return Tn(n, e, t);
4325
4331
  }
4326
4332
  const Oi = () => {
4327
- const e = j((r) => r.section), t = Ei(), n = e.quiz;
4333
+ const e = j((r) => r.section), t = Ei(), n = e.quizzes;
4328
4334
  return !n || !n.length ? null : /* @__PURE__ */ X(
4329
4335
  "button",
4330
4336
  {
@@ -4614,24 +4620,24 @@ function wa({
4614
4620
  nsPrefix: n
4615
4621
  }) {
4616
4622
  const r = ve(() => {
4617
- const C = [], R = Or();
4623
+ const I = [], _ = Or();
4618
4624
  return t.forEach((O, P) => {
4619
- O.type === "paragraph" && (C[P] = Pr(O, R));
4620
- }), C;
4621
- }, [t]), o = j((C) => {
4622
- var R;
4623
- return ((R = C.layout) == null ? void 0 : R.prefix) ?? [];
4624
- }), i = j((C) => {
4625
- var R;
4626
- return ((R = C.derivedNav) == null ? void 0 : R.splitGroupsPerBlock) ?? [];
4627
- }), s = Y((C) => C.marginX), c = Y((C) => C.viewportHeight), l = ie({
4625
+ O.type === "paragraph" && (I[P] = Pr(O, _));
4626
+ }), I;
4627
+ }, [t]), o = j((I) => {
4628
+ var _;
4629
+ return ((_ = I.layout) == null ? void 0 : _.prefix) ?? [];
4630
+ }), i = j((I) => {
4631
+ var _;
4632
+ return ((_ = I.derivedNav) == null ? void 0 : _.splitGroupsPerBlock) ?? [];
4633
+ }), s = Y((I) => I.marginX), c = Y((I) => I.viewportHeight), l = ie({
4628
4634
  start: 0,
4629
4635
  end: 0
4630
4636
  }), a = Z(
4631
- (C) => {
4632
- const R = t[C], O = `${n}blk-${R.id}`;
4633
- if (R.type === "image") {
4634
- const { src: E, alt: A, width: W, height: M } = R, B = W && M ? `${W} / ${M}` : "4 / 3", F = C >= l.current.start && C <= l.current.end, V = c > 80 ? Math.floor((c - 80) * 0.6) : void 0;
4637
+ (I) => {
4638
+ const _ = t[I], O = `${n}blk-${_.id}`;
4639
+ if (_.type === "image") {
4640
+ const { src: E, alt: A, width: W, height: M } = _, B = W && M ? `${W} / ${M}` : "4 / 3", F = I >= l.current.start && I <= l.current.end, D = c > 80 ? Math.floor((c - 80) * 0.6) : void 0;
4635
4641
  return /* @__PURE__ */ X("div", { style: { margin: "12px 0", textAlign: "center", width: "100%" }, children: [
4636
4642
  /* @__PURE__ */ x(
4637
4643
  "div",
@@ -4639,7 +4645,7 @@ function wa({
4639
4645
  style: {
4640
4646
  position: "relative",
4641
4647
  width: "100%",
4642
- maxHeight: V,
4648
+ maxHeight: D,
4643
4649
  aspectRatio: B
4644
4650
  },
4645
4651
  children: /* @__PURE__ */ x(
@@ -4665,7 +4671,7 @@ function wa({
4665
4671
  A && /* @__PURE__ */ x("div", { style: { fontSize: 12, color: "#6b7280", marginTop: 4 }, children: A })
4666
4672
  ] });
4667
4673
  }
4668
- const P = r[C] ?? void 0, w = i[C];
4674
+ const P = r[I] ?? void 0, w = i[I];
4669
4675
  return /* @__PURE__ */ x(
4670
4676
  "div",
4671
4677
  {
@@ -4676,10 +4682,10 @@ function wa({
4676
4682
  children: /* @__PURE__ */ x(
4677
4683
  Zl,
4678
4684
  {
4679
- block: R,
4685
+ block: _,
4680
4686
  computedMarker: P,
4681
4687
  ns: O,
4682
- baseIndex: o[C],
4688
+ baseIndex: o[I],
4683
4689
  sectionId: e.section_id,
4684
4690
  preGroups: w
4685
4691
  }
@@ -4688,12 +4694,12 @@ function wa({
4688
4694
  );
4689
4695
  },
4690
4696
  [t, r, o, n, e, i, c]
4691
- ), d = ie(null), v = Z((C) => {
4692
- d.current = C;
4697
+ ), d = ie(null), v = Z((I) => {
4698
+ d.current = I;
4693
4699
  }, []), g = ve(
4694
- () => Wt((C) => {
4695
- const { style: R, children: O, ...P } = C;
4696
- return /* @__PURE__ */ x("div", { ...P, style: R, children: /* @__PURE__ */ x(
4700
+ () => Wt((I) => {
4701
+ const { style: _, children: O, ...P } = I;
4702
+ return /* @__PURE__ */ x("div", { ...P, style: _, children: /* @__PURE__ */ x(
4697
4703
  "div",
4698
4704
  {
4699
4705
  style: {
@@ -4712,7 +4718,7 @@ function wa({
4712
4718
  ) });
4713
4719
  }),
4714
4720
  [s]
4715
- ), b = ie(null), m = ve(() => t.map((C) => C.id), [t]), [y, p] = et(!1);
4721
+ ), b = ie(null), m = ve(() => t.map((I) => I.id), [t]), [y, p] = et(!1);
4716
4722
  Se(() => {
4717
4723
  p(!1);
4718
4724
  }, [t]);
@@ -4721,11 +4727,11 @@ function wa({
4721
4727
  }, []), u = Z(() => {
4722
4728
  if (!y)
4723
4729
  return /* @__PURE__ */ x("div", { style: { height: 40 } });
4724
- const C = e.quiz, R = Math.max(80, Math.floor(c * 0.5));
4725
- return C && C.length ? /* @__PURE__ */ X("div", { style: { display: "block" }, children: [
4730
+ const I = e.quizzes, _ = Math.max(80, Math.floor(c * 0.5));
4731
+ return I && I.length ? /* @__PURE__ */ X("div", { style: { display: "block" }, children: [
4726
4732
  /* @__PURE__ */ x("div", { style: { display: "flex", justifyContent: "center", marginTop: 20 }, children: /* @__PURE__ */ x(Oi, {}) }),
4727
4733
  /* @__PURE__ */ x("div", { style: { display: "flex", justifyContent: "center", marginTop: 20 }, children: /* @__PURE__ */ x(Cn, { isIcon: !1 }) }),
4728
- /* @__PURE__ */ x("div", { style: { height: R, width: "100%" } })
4734
+ /* @__PURE__ */ x("div", { style: { height: _, width: "100%" } })
4729
4735
  ] }) : /* @__PURE__ */ X("div", { children: [
4730
4736
  /* @__PURE__ */ x("div", { style: { display: "flex", justifyContent: "center", marginTop: 20 }, children: /* @__PURE__ */ x(Cn, { isIcon: !1 }) }),
4731
4737
  /* @__PURE__ */ x("div", { style: { height: 40 } })
@@ -4744,28 +4750,28 @@ function wa({
4744
4750
  // , ScrollPlaceholder
4745
4751
  ]
4746
4752
  // CustomScroller는 고정이면 deps에 안 넣어도 OK
4747
- ), k = Z((C) => m[C], [m]), I = Rt(), [_] = et(() => I.getState().progress.currentGlobalRunIndex ?? 0), h = ve(() => {
4753
+ ), k = Z((I) => m[I], [m]), R = Rt(), [C] = et(() => R.getState().progress.currentGlobalRunIndex ?? 0), h = ve(() => {
4748
4754
  if (!o.length) return 0;
4749
- const C = o[o.length - 1], R = Math.max(0, Math.min(_, C));
4750
- return zi(o, R);
4751
- }, [o, _]);
4755
+ const I = o[o.length - 1], _ = Math.max(0, Math.min(C, I));
4756
+ return zi(o, _);
4757
+ }, [o, C]);
4752
4758
  console.log("SectionRenderVirtuoso확인");
4753
4759
  const S = Rt();
4754
4760
  return Se(() => {
4755
- let C = !1;
4761
+ let I = !1;
4756
4762
  return (async () => {
4757
- let R = d.current;
4758
- if (!R) {
4763
+ let _ = d.current;
4764
+ if (!_) {
4759
4765
  for (let E = 0; E < 20; E++) {
4760
- if (await new Promise((A) => setTimeout(A, 50)), C) return;
4761
- if (R = d.current, R) break;
4766
+ if (await new Promise((A) => setTimeout(A, 50)), I) return;
4767
+ if (_ = d.current, _) break;
4762
4768
  }
4763
- if (!R) return;
4769
+ if (!_) return;
4764
4770
  }
4765
4771
  const O = S.getState().progress.currentGlobalRunIndex, P = S.getState().progress.setSectionLoading, w = O != null && O >= 0 ? O : 0;
4766
- await Mi(R, w), !C && (await vt(), await vt(), await vt(), await vt(), !C && P(!1));
4772
+ await Mi(_, w), !I && (await vt(), await vt(), await vt(), await vt(), !I && P(!1));
4767
4773
  })(), () => {
4768
- C = !0;
4774
+ I = !0;
4769
4775
  };
4770
4776
  }, [d, S]), /* @__PURE__ */ X(yt, { children: [
4771
4777
  /* @__PURE__ */ x(
@@ -4827,8 +4833,8 @@ const Ia = ({
4827
4833
  let B = 0;
4828
4834
  const F = w.querySelector(`[data-g="${E}"]`);
4829
4835
  if (F) {
4830
- const V = w.getBoundingClientRect();
4831
- B = (F.getBoundingClientRect().top - V.top) / V.height;
4836
+ const D = w.getBoundingClientRect();
4837
+ B = (F.getBoundingClientRect().top - D.top) / D.height;
4832
4838
  }
4833
4839
  l.getState().emit({
4834
4840
  type: "scroll",
@@ -4847,7 +4853,7 @@ const Ia = ({
4847
4853
  s || a.current && (f.current || (y(w), p(w)));
4848
4854
  },
4849
4855
  [s, y, p]
4850
- ), T = ie(void 0), k = ie(void 0), I = ie(void 0), _ = ie(void 0);
4856
+ ), T = ie(void 0), k = ie(void 0), R = ie(void 0), C = ie(void 0);
4851
4857
  Se(() => {
4852
4858
  const w = e.current;
4853
4859
  if (w)
@@ -4855,10 +4861,10 @@ const Ia = ({
4855
4861
  a.current = !0;
4856
4862
  }, k.current = () => {
4857
4863
  a.current = !0;
4858
- }, I.current = () => {
4864
+ }, R.current = () => {
4859
4865
  a.current = !0;
4860
- }, _.current = () => u(w), w.addEventListener("wheel", T.current, { passive: !0 }), w.addEventListener("touchmove", k.current, { passive: !0 }), window.addEventListener("keydown", I.current, { passive: !0 }), w.addEventListener("scroll", _.current, { passive: !0 }), () => {
4861
- w.removeEventListener("wheel", T.current), w.removeEventListener("touchmove", k.current), window.removeEventListener("keydown", I.current), w.removeEventListener("scroll", _.current), d.current != null && cancelAnimationFrame(d.current), g.current != null && (clearTimeout(g.current), g.current = null);
4866
+ }, C.current = () => u(w), w.addEventListener("wheel", T.current, { passive: !0 }), w.addEventListener("touchmove", k.current, { passive: !0 }), window.addEventListener("keydown", R.current, { passive: !0 }), w.addEventListener("scroll", C.current, { passive: !0 }), () => {
4867
+ w.removeEventListener("wheel", T.current), w.removeEventListener("touchmove", k.current), window.removeEventListener("keydown", R.current), w.removeEventListener("scroll", C.current), d.current != null && cancelAnimationFrame(d.current), g.current != null && (clearTimeout(g.current), g.current = null);
4862
4868
  };
4863
4869
  }, [u, e]), Se(() => {
4864
4870
  const w = e.current;
@@ -4880,15 +4886,15 @@ const Ia = ({
4880
4886
  const h = ie({
4881
4887
  first: -1,
4882
4888
  last: -1
4883
- }), S = ie(!1), C = Z(() => {
4889
+ }), S = ie(!1), I = Z(() => {
4884
4890
  const w = e.current;
4885
4891
  if (!w) return;
4886
4892
  const E = go(w), A = (E == null ? void 0 : E.first) ?? -1, W = (E == null ? void 0 : E.last) ?? -1;
4887
4893
  h.current = { first: A, last: W };
4888
- }, [e]), R = ie(!1), O = Z(() => {
4894
+ }, [e]), _ = ie(!1), O = Z(() => {
4889
4895
  const w = e.current;
4890
- if (!w || R.current) return;
4891
- R.current = !0;
4896
+ if (!w || _.current) return;
4897
+ _.current = !0;
4892
4898
  const E = Math.min(
4893
4899
  w.scrollTop + Math.floor(w.clientHeight * 0.6),
4894
4900
  w.scrollHeight - w.clientHeight
@@ -4898,8 +4904,8 @@ const Ia = ({
4898
4904
  });
4899
4905
  }, [e]);
4900
4906
  Se(() => {
4901
- !S.current && s && (R.current = !1, C()), S.current = s;
4902
- }, [s, C]), Se(() => {
4907
+ !S.current && s && (_.current = !1, I()), S.current = s;
4908
+ }, [s, I]), Se(() => {
4903
4909
  if (s !== !0) return;
4904
4910
  const w = e.current;
4905
4911
  if (!w) return;
@@ -4919,7 +4925,7 @@ const Ia = ({
4919
4925
  } finally {
4920
4926
  f.current = !1;
4921
4927
  }
4922
- C();
4928
+ I();
4923
4929
  })();
4924
4930
  return;
4925
4931
  }
@@ -4933,14 +4939,14 @@ const Ia = ({
4933
4939
  });
4934
4940
  }
4935
4941
  M().then((B) => {
4936
- B ? C() : O();
4942
+ B ? I() : O();
4937
4943
  });
4938
4944
  }
4939
4945
  }, [
4940
4946
  s,
4941
4947
  i,
4942
4948
  O,
4943
- C,
4949
+ I,
4944
4950
  e
4945
4951
  ]);
4946
4952
  const P = Z(() => {
@@ -4951,8 +4957,8 @@ const Ia = ({
4951
4957
  if (!ne) return !1;
4952
4958
  const H = ee.getBoundingClientRect(), oe = ne.getBoundingClientRect();
4953
4959
  if (oe.height <= 0 || H.height <= 0) return !1;
4954
- const $ = (oe.top + oe.height / 2 - H.top) / H.height;
4955
- return $ >= z && $ <= K;
4960
+ const V = (oe.top + oe.height / 2 - H.top) / H.height;
4961
+ return V >= z && V <= K;
4956
4962
  }
4957
4963
  const A = (ee) => ee === "instant" ? "auto" : ee, W = (ee) => {
4958
4964
  const Q = w.scrollTop, z = w.scrollHeight - w.clientHeight, K = z > 0 ? Q / z : 0;
@@ -4994,10 +5000,10 @@ const Ia = ({
4994
5000
  behavior: "smooth",
4995
5001
  topPaddingRatio: K
4996
5002
  }), await B()) : ne || await M(ee, "auto"), f.current = !1, W(ee), E(w, ee, 0.1, 0.7);
4997
- }, V = async (ee) => F(ee);
5003
+ }, D = async (ee) => F(ee);
4998
5004
  return {
4999
5005
  ensureVisibleGI: F,
5000
- scrollToGI: V,
5006
+ scrollToGI: D,
5001
5007
  getVisibleRange: () => go(w),
5002
5008
  getScrollTop: () => w.scrollTop,
5003
5009
  setScrollTop: (ee) => {
@@ -5010,10 +5016,10 @@ const Ia = ({
5010
5016
  return (z.top - K.top) / K.height;
5011
5017
  },
5012
5018
  scrollToGIAtOffset: async (ee, Q) => {
5013
- await V(ee), await new Promise((se) => requestAnimationFrame(() => requestAnimationFrame(se)));
5019
+ await D(ee), await new Promise((se) => requestAnimationFrame(() => requestAnimationFrame(se)));
5014
5020
  const z = w.querySelector(`[data-g="${ee}"]`);
5015
5021
  if (!z) return;
5016
- const K = z.getBoundingClientRect(), ne = w.getBoundingClientRect(), H = ne.height > 0 ? ne.height / w.clientHeight : 1, oe = (K.top - ne.top) / H, $ = Q * w.clientHeight, J = oe - $;
5022
+ const K = z.getBoundingClientRect(), ne = w.getBoundingClientRect(), H = ne.height > 0 ? ne.height / w.clientHeight : 1, oe = (K.top - ne.top) / H, V = Q * w.clientHeight, J = oe - V;
5017
5023
  w.scrollTop = w.scrollTop + J;
5018
5024
  }
5019
5025
  };
@@ -5093,11 +5099,11 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5093
5099
  label: qa,
5094
5100
  compactBtn: ja
5095
5101
  }, Ua = Wt(function() {
5096
- const t = ie(null), n = Ue(Mt), r = (n == null ? void 0 : n.getState().isPlaybackMode) ?? !1, o = _e((S) => S.status), i = _e((S) => S.currentTimeMs), s = _e((S) => S.currentClip), c = _e((S) => S.playbackKind), l = Y((S) => S.muteAudio), a = Y((S) => S.audioSpeed), d = _e((S) => S.getClipSrc), v = _e((S) => S._onTime), g = _e((S) => S._onEnded), b = _e((S) => S._onError), m = j((S) => S.setCurrentGlobalRunIndex), y = j((S) => S.getSectionScrollApi), p = j((S) => S.snapToReadable), f = j((S) => S.edgeReadable), u = ie(null), T = ie(null), k = ie(!1), I = ie(null);
5102
+ const t = ie(null), n = Ue(Mt), r = (n == null ? void 0 : n.getState().isPlaybackMode) ?? !1, o = _e((S) => S.status), i = _e((S) => S.currentTimeMs), s = _e((S) => S.currentClip), c = _e((S) => S.playbackKind), l = Y((S) => S.muteAudio), a = Y((S) => S.audioSpeed), d = _e((S) => S.getClipSrc), v = _e((S) => S._onTime), g = _e((S) => S._onEnded), b = _e((S) => S._onError), m = j((S) => S.setCurrentGlobalRunIndex), y = j((S) => S.getSectionScrollApi), p = j((S) => S.snapToReadable), f = j((S) => S.edgeReadable), u = ie(null), T = ie(null), k = ie(!1), R = ie(null);
5097
5103
  Se(() => {
5098
5104
  c === "real" && (k.current = !0);
5099
5105
  }, [c]);
5100
- const _ = ve(() => {
5106
+ const C = ve(() => {
5101
5107
  const S = d(s);
5102
5108
  if (!S) return null;
5103
5109
  try {
@@ -5108,14 +5114,14 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5108
5114
  }, [s, d]);
5109
5115
  Se(() => {
5110
5116
  k.current = !0;
5111
- }, [_]), Se(() => {
5117
+ }, [C]), Se(() => {
5112
5118
  const S = t.current;
5113
5119
  if (!S) return;
5114
- const C = () => {
5120
+ const I = () => {
5115
5121
  if (S.paused || S.ended) return;
5116
5122
  const P = S.currentTime * 1e3;
5117
5123
  k.current && P === 0 || (P > 0 && (k.current = !1), v(P));
5118
- }, R = () => {
5124
+ }, _ = () => {
5119
5125
  var w, E;
5120
5126
  g();
5121
5127
  const P = f(1);
@@ -5127,14 +5133,14 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5127
5133
  readyState: w.readyState
5128
5134
  }), b();
5129
5135
  };
5130
- return S.addEventListener("timeupdate", C), S.addEventListener("ended", R), S.addEventListener("error", O), () => {
5131
- S.removeEventListener("timeupdate", C), S.removeEventListener("ended", R), S.removeEventListener("error", O);
5136
+ return S.addEventListener("timeupdate", I), S.addEventListener("ended", _), S.addEventListener("error", O), () => {
5137
+ S.removeEventListener("timeupdate", I), S.removeEventListener("ended", _), S.removeEventListener("error", O);
5132
5138
  };
5133
5139
  }, [v, g, b, f, m, y]), Se(() => {
5134
5140
  if (r) return;
5135
5141
  const S = t.current;
5136
5142
  if (!S) return;
5137
- if (!_) {
5143
+ if (!C) {
5138
5144
  try {
5139
5145
  S.pause();
5140
5146
  } catch (P) {
@@ -5143,24 +5149,24 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5143
5149
  T.current = null;
5144
5150
  return;
5145
5151
  }
5146
- const C = S.currentSrc || S.src || null, R = !C || C !== _;
5147
- if (R) {
5152
+ const I = S.currentSrc || S.src || null, _ = !I || I !== C;
5153
+ if (_) {
5148
5154
  try {
5149
5155
  S.pause();
5150
5156
  } catch (P) {
5151
5157
  console.log("pause error", P);
5152
5158
  }
5153
- S.src = _;
5159
+ S.src = C;
5154
5160
  try {
5155
5161
  S.load();
5156
5162
  } catch (P) {
5157
5163
  console.log("load error", P);
5158
5164
  }
5159
- T.current = _;
5165
+ T.current = C;
5160
5166
  }
5161
5167
  S.muted = !!l, S.volume = 1, S.playbackRate = typeof a == "number" ? a : 1;
5162
5168
  const O = async () => {
5163
- R && await new Promise((P) => {
5169
+ _ && await new Promise((P) => {
5164
5170
  let w = !1;
5165
5171
  const E = () => {
5166
5172
  w || (w = !0, S.removeEventListener("loadedmetadata", E), S.removeEventListener("canplay", E), P());
@@ -5181,15 +5187,15 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5181
5187
  } catch (P) {
5182
5188
  console.log("pause error", P);
5183
5189
  }
5184
- }, [_, l, o, a, r]), Se(() => {
5190
+ }, [C, l, o, a, r]), Se(() => {
5185
5191
  if (r) return;
5186
5192
  const S = t.current;
5187
5193
  if (!S || c !== "real") return;
5188
- const C = i / 1e3;
5189
- if (Number.isFinite(C)) {
5194
+ const I = i / 1e3;
5195
+ if (Number.isFinite(I)) {
5190
5196
  if (S.readyState < 1) {
5191
5197
  u.current = i;
5192
- const R = () => {
5198
+ const _ = () => {
5193
5199
  if (u.current != null) {
5194
5200
  const O = u.current / 1e3;
5195
5201
  try {
@@ -5199,27 +5205,27 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5199
5205
  }
5200
5206
  u.current = null;
5201
5207
  }
5202
- S.removeEventListener("loadedmetadata", R), S.removeEventListener("canplay", R);
5208
+ S.removeEventListener("loadedmetadata", _), S.removeEventListener("canplay", _);
5203
5209
  };
5204
- S.addEventListener("loadedmetadata", R), S.addEventListener("canplay", R);
5210
+ S.addEventListener("loadedmetadata", _), S.addEventListener("canplay", _);
5205
5211
  return;
5206
5212
  }
5207
- if (Math.abs(S.currentTime - C) > 0.2)
5213
+ if (Math.abs(S.currentTime - I) > 0.2)
5208
5214
  try {
5209
- S.currentTime = C;
5210
- } catch (R) {
5211
- console.log("currentTime보정오류", R);
5215
+ S.currentTime = I;
5216
+ } catch (_) {
5217
+ console.log("currentTime보정오류", _);
5212
5218
  }
5213
5219
  }
5214
5220
  }, [i, c, r]);
5215
5221
  const h = _e((S) => S.getGIFromCT);
5216
5222
  return Se(() => {
5217
- var R, O;
5223
+ var _, O;
5218
5224
  if (r || c !== "real" || o !== "playing" && o !== "loading") return;
5219
5225
  const S = h(s, i);
5220
5226
  if (S < 0) return;
5221
- const C = p(S);
5222
- C !== I.current && (I.current = C, m(C, "audio"), C % 5 === 0 && ((O = (R = y()) == null ? void 0 : R.ensureVisibleGI) == null || O.call(R, C)));
5227
+ const I = p(S);
5228
+ I !== R.current && (R.current = I, m(I, "audio"), I % 5 === 0 && ((O = (_ = y()) == null ? void 0 : _.ensureVisibleGI) == null || O.call(_, I)));
5223
5229
  }, [
5224
5230
  o,
5225
5231
  s,
@@ -5244,19 +5250,19 @@ const Qa = "_scrubberWrap_uw0cd_2", Ya = "_labels_uw0cd_9", Xa = "_index_uw0cd_1
5244
5250
  range: ec
5245
5251
  };
5246
5252
  function tc() {
5247
- const e = Y((I) => I.isDev), t = j((I) => I.currentGlobalRunIndex), n = j((I) => I.totalRuns), r = j((I) => I.setCurrentGlobalRunIndex), o = j((I) => I.getSectionScrollApi), i = j((I) => I.giToPercentTotal), s = j((I) => I.percentToGITotal), c = j((I) => I.snapToReadable), l = _e((I) => I.scrollLock), a = _e((I) => I.pause), d = _e((I) => I.play), v = _e((I) => I.syncToGI), [g, b] = et(() => i(t || 0));
5253
+ const e = Y((R) => R.isDev), t = j((R) => R.currentGlobalRunIndex), n = j((R) => R.totalRuns), r = j((R) => R.setCurrentGlobalRunIndex), o = j((R) => R.getSectionScrollApi), i = j((R) => R.giToPercentTotal), s = j((R) => R.percentToGITotal), c = j((R) => R.snapToReadable), l = _e((R) => R.scrollLock), a = _e((R) => R.pause), d = _e((R) => R.play), v = _e((R) => R.syncToGI), [g, b] = et(() => i(t || 0));
5248
5254
  Se(() => {
5249
5255
  b(i(t || 0));
5250
5256
  }, [t, i]);
5251
5257
  const m = ie(!1), y = ve(() => Math.max(0, Math.min(t ?? 0, Math.max(0, (n ?? 1) - 1))) + 1, [t, n]), p = Z(() => {
5252
5258
  l && (a(), m.current = !0);
5253
- }, [l, a]), f = Z((I) => {
5254
- b(Number(I.currentTarget.value));
5259
+ }, [l, a]), f = Z((R) => {
5260
+ b(Number(R.currentTarget.value));
5255
5261
  }, []), u = Z(async () => {
5256
- const I = s(g), _ = c(I);
5257
- a(), r(_, "scrubber-commit"), v(_);
5262
+ const R = s(g), C = c(R);
5263
+ a(), r(C, "scrubber-commit"), v(C);
5258
5264
  const h = o();
5259
- h != null && h.ensureVisibleGI && await h.ensureVisibleGI(_), m.current && (m.current = !1, d());
5265
+ h != null && h.ensureVisibleGI && await h.ensureVisibleGI(C), m.current && (m.current = !1, d());
5260
5266
  }, [g, s, c, a, r, v, o, d]), T = ve(
5261
5267
  () => ({ "--pct": `${g}%` }),
5262
5268
  [g]
@@ -5287,7 +5293,7 @@ function tc() {
5287
5293
  onTouchEnd: () => {
5288
5294
  u();
5289
5295
  },
5290
- onKeyUp: (I) => I.key === "Enter" || I.key === " " ? void u() : void 0,
5296
+ onKeyUp: (R) => R.key === "Enter" || R.key === " " ? void u() : void 0,
5291
5297
  "aria-label": "진행률"
5292
5298
  }
5293
5299
  ),
@@ -5302,20 +5308,20 @@ const nc = N.memo(tc), rc = Wt(function() {
5302
5308
  const t = Ue(Mt), n = (t == null ? void 0 : t.getState().isPlaybackMode) ?? !1, r = _e((S) => S.playbackKind), o = _e((S) => S.status), i = _e((S) => S.fake), s = Y((S) => S.audioSpeed), c = _e((S) => S.pause), l = j((S) => S.totalRuns), a = j((S) => S.currentGlobalRunIndex), d = j((S) => S.setCurrentGlobalRunIndex), v = j((S) => S.getSectionScrollApi), g = j((S) => S.nextReadableFrom), b = j((S) => S.edgeReadable), m = ie(null), y = ie(null), p = ie(0), f = ie(-1), u = !n && r === "fake" && o === "playing", T = Math.max(1, (i == null ? void 0 : i.totalWords) ?? 1), k = ve(() => {
5303
5309
  const S = 200 * s;
5304
5310
  return T / S * 6e4;
5305
- }, [T, s]), I = ve(() => !l || l <= 1 || k <= 0 ? 0 : (l - 1) / k, [l, k]);
5311
+ }, [T, s]), R = ve(() => !l || l <= 1 || k <= 0 ? 0 : (l - 1) / k, [l, k]);
5306
5312
  Se(() => {
5307
5313
  if (!u) return;
5308
5314
  const S = Math.max(0, Math.min(a ?? 0, Math.max(0, (l ?? 1) - 1)));
5309
5315
  p.current = S, f.current = S, y.current = null;
5310
5316
  }, [u, a, l]);
5311
- const _ = ie(-1);
5317
+ const C = ie(-1);
5312
5318
  Se(() => {
5313
5319
  if (!l) {
5314
- _.current = -1;
5320
+ C.current = -1;
5315
5321
  return;
5316
5322
  }
5317
5323
  const S = b(1);
5318
- _.current = S ?? -1;
5324
+ C.current = S ?? -1;
5319
5325
  }, [b, l]);
5320
5326
  const h = Z(
5321
5327
  (S) => {
@@ -5325,17 +5331,17 @@ const nc = N.memo(tc), rc = Wt(function() {
5325
5331
  m.current = null;
5326
5332
  return;
5327
5333
  }
5328
- if (!l || l <= 1 || I <= 0) {
5334
+ if (!l || l <= 1 || R <= 0) {
5329
5335
  m.current = null;
5330
5336
  return;
5331
5337
  }
5332
- const C = y.current;
5338
+ const I = y.current;
5333
5339
  y.current = S;
5334
- const R = C == null ? 0 : Math.max(0, S - C), O = l - 1;
5335
- p.current = Math.min(O, p.current + I * R);
5340
+ const _ = I == null ? 0 : Math.max(0, S - I), O = l - 1;
5341
+ p.current = Math.min(O, p.current + R * _);
5336
5342
  const P = Math.floor(p.current), w = v(), E = g(P, 1);
5337
5343
  if (E == null) {
5338
- const B = _.current >= 0 ? _.current : P;
5344
+ const B = C.current >= 0 ? C.current : P;
5339
5345
  B !== f.current && (f.current = B, d(B, "audio"), await ((W = w == null ? void 0 : w.ensureVisibleGI) == null ? void 0 : W.call(w, B))), c(), m.current = null;
5340
5346
  return;
5341
5347
  }
@@ -5343,7 +5349,7 @@ const nc = N.memo(tc), rc = Wt(function() {
5343
5349
  A !== f.current && (f.current = A, d(A, "audio"), A % 5 === 0 && await ((M = w == null ? void 0 : w.ensureVisibleGI) == null ? void 0 : M.call(w, A))), m.current = requestAnimationFrame(h);
5344
5350
  })().catch(console.error);
5345
5351
  },
5346
- [u, l, I, g, d, v, c]
5352
+ [u, l, R, g, d, v, c]
5347
5353
  );
5348
5354
  return Se(() => (u ? m.current == null && (m.current = requestAnimationFrame(h)) : (m.current && (cancelAnimationFrame(m.current), m.current = null), y.current = null), () => {
5349
5355
  m.current && (cancelAnimationFrame(m.current), m.current = null);
@@ -5499,39 +5505,40 @@ function wc(e) {
5499
5505
  return rt({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z" }, child: [] }] })(e);
5500
5506
  }
5501
5507
  function Ic() {
5502
- const e = Y((I) => I.showOverlays), t = j((I) => I.section), n = !!t.ast.isAddedSplit, r = !!t.ast.isAddedAudio, o = Y((I) => I.muteAudio), i = Y((I) => I.showPointer), s = Y((I) => I.showSplit), c = Y((I) => I.toggleMuteAudio), l = Y((I) => I.toggleShowPointer), a = Y((I) => I.toggleShowSplit), d = Y((I) => I.overlayCompactMode), v = Y((I) => I.toggleOverlayCompactMode), g = yn(), b = Rt();
5508
+ var R;
5509
+ const e = Y((C) => C.showOverlays), t = j((C) => C.section), n = !!t.ast.isAddedSplit, r = !!((R = t.audios) != null && R.length), o = Y((C) => C.muteAudio), i = Y((C) => C.showPointer), s = Y((C) => C.showSplit), c = Y((C) => C.toggleMuteAudio), l = Y((C) => C.toggleShowPointer), a = Y((C) => C.toggleShowSplit), d = Y((C) => C.overlayCompactMode), v = Y((C) => C.toggleOverlayCompactMode), g = yn(), b = Rt();
5503
5510
  Se(() => {
5504
- const I = g.getState(), { syncToGI: _, useFake: h, useReal: S } = I, C = I.playbackKind, R = b.getState().progress.currentGlobalRunIndex ?? 0;
5511
+ const C = g.getState(), { syncToGI: h, useFake: S, useReal: I } = C, _ = C.playbackKind, O = b.getState().progress.currentGlobalRunIndex ?? 0;
5505
5512
  if (!r) {
5506
- C !== "fake" && h();
5513
+ _ !== "fake" && S();
5507
5514
  return;
5508
5515
  }
5509
- o ? C !== "fake" && (console.log("이부분일까?"), h()) : C !== "real" && (_(R), S());
5516
+ o ? _ !== "fake" && (console.log("이부분일까?"), S()) : _ !== "real" && (h(O), I());
5510
5517
  }, [r, o, b, g]);
5511
- const m = _e((I) => I.play), y = _e((I) => I.pause), p = _e((I) => I.status), f = Z(
5512
- (I) => {
5513
- I.stopPropagation(), p === "playing" || p === "loading" ? y() : m();
5518
+ const m = _e((C) => C.play), y = _e((C) => C.pause), p = _e((C) => C.status), f = Z(
5519
+ (C) => {
5520
+ C.stopPropagation(), p === "playing" || p === "loading" ? y() : m();
5514
5521
  },
5515
5522
  [p, m, y]
5516
5523
  ), u = yn(), T = Rt(), k = Z(
5517
- async (I) => {
5518
- var B, F;
5519
- if (I.stopPropagation(), p === "playing" || p === "loading") {
5524
+ async (C) => {
5525
+ var F, D;
5526
+ if (C.stopPropagation(), p === "playing" || p === "loading") {
5520
5527
  y();
5521
5528
  return;
5522
5529
  }
5523
- const { progress: _ } = T.getState(), {
5524
- currentGlobalRunIndex: h,
5525
- snapToReadable: S,
5526
- edgeReadable: C,
5527
- setCurrentGlobalRunIndex: R,
5528
- getSectionScrollApi: O
5529
- } = _, P = u.getState(), w = P.currentClip, E = O == null ? void 0 : O(), A = typeof h == "number" ? h : 0, W = typeof S == "function" ? S(A) : A, M = typeof C == "function" ? C(1) : null;
5530
- if (M != null && W >= M) {
5531
- R == null || R(M, "audio"), await ((B = E == null ? void 0 : E.ensureVisibleGI) == null ? void 0 : B.call(E, M)), P.syncToGI(M);
5530
+ const { progress: h } = T.getState(), {
5531
+ currentGlobalRunIndex: S,
5532
+ snapToReadable: I,
5533
+ edgeReadable: _,
5534
+ setCurrentGlobalRunIndex: O,
5535
+ getSectionScrollApi: P
5536
+ } = h, w = u.getState(), E = w.currentClip, A = P == null ? void 0 : P(), W = typeof S == "number" ? S : 0, M = typeof I == "function" ? I(W) : W, B = typeof _ == "function" ? _(1) : null;
5537
+ if (B != null && M >= B) {
5538
+ O == null || O(B, "audio"), await ((F = A == null ? void 0 : A.ensureVisibleGI) == null ? void 0 : F.call(A, B)), w.syncToGI(B);
5532
5539
  return;
5533
5540
  }
5534
- R == null || R(W, "audio"), await ((F = E == null ? void 0 : E.ensureVisibleGI) == null ? void 0 : F.call(E, W)), P.syncToGI(W), m(w);
5541
+ O == null || O(M, "audio"), await ((D = A == null ? void 0 : A.ensureVisibleGI) == null ? void 0 : D.call(A, M)), w.syncToGI(M), m(E);
5535
5542
  },
5536
5543
  [p, y, m, u, T]
5537
5544
  );
@@ -5539,11 +5546,11 @@ function Ic() {
5539
5546
  "div",
5540
5547
  {
5541
5548
  className: `${Ge.wrap} ${e ? Ge.visible : ""} ${d ? Ge.compact : ""}`,
5542
- onClick: (I) => {
5543
- I.stopPropagation();
5549
+ onClick: (C) => {
5550
+ C.stopPropagation();
5544
5551
  },
5545
- onTouchStart: (I) => {
5546
- I.stopPropagation();
5552
+ onTouchStart: (C) => {
5553
+ C.stopPropagation();
5547
5554
  },
5548
5555
  children: [
5549
5556
  !d && /* @__PURE__ */ x(nc, {}),
@@ -5554,8 +5561,8 @@ function Ic() {
5554
5561
  "button",
5555
5562
  {
5556
5563
  type: "button",
5557
- onClick: (I) => {
5558
- I.stopPropagation(), v();
5564
+ onClick: (C) => {
5565
+ C.stopPropagation(), v();
5559
5566
  },
5560
5567
  className: Ge.compactBtn,
5561
5568
  title: d ? "오버레이 확대" : "오버레이 축소",
@@ -5583,8 +5590,8 @@ function Ic() {
5583
5590
  "button",
5584
5591
  {
5585
5592
  type: "button",
5586
- onClick: (I) => {
5587
- I.stopPropagation(), c();
5593
+ onClick: (C) => {
5594
+ C.stopPropagation(), c();
5588
5595
  },
5589
5596
  className: `${Ge.btn} ${o ? "" : Ge.btnActive}`,
5590
5597
  title: "오디오북 음소거 전환",
@@ -5598,8 +5605,8 @@ function Ic() {
5598
5605
  "button",
5599
5606
  {
5600
5607
  type: "button",
5601
- onClick: (I) => {
5602
- I.stopPropagation(), l();
5608
+ onClick: (C) => {
5609
+ C.stopPropagation(), l();
5603
5610
  },
5604
5611
  className: `${Ge.btn} ${i ? Ge.btnActive : ""}`,
5605
5612
  title: "포인터 표시",
@@ -5613,8 +5620,8 @@ function Ic() {
5613
5620
  "button",
5614
5621
  {
5615
5622
  type: "button",
5616
- onClick: (I) => {
5617
- I.stopPropagation(), a();
5623
+ onClick: (C) => {
5624
+ C.stopPropagation(), a();
5618
5625
  },
5619
5626
  disabled: !n,
5620
5627
  className: `${Ge.btn} ${s ? Ge.btnActive : ""} ${n ? "" : Ge.btnForbidden}`,
@@ -5688,22 +5695,22 @@ const Bc = N.memo(Pc), zc = "_wrap_62su0_7", Ac = "_wrapHidden_62su0_29", Lc = "
5688
5695
  inlineFlex: Qc
5689
5696
  };
5690
5697
  function Yc({ visible: e }) {
5691
- const t = Y((h) => h.mode), n = Y((h) => h.setMode), r = Y((h) => h.theme), o = Y((h) => h.setTheme), i = Y((h) => h.fontFamily), s = Y((h) => h.setFontFamily), c = Y((h) => h.resetToDefaults), l = Y((h) => h.getFontLevel()), a = Y((h) => h.getLineLevel()), d = Y((h) => h.getMarginLevel()), v = Y((h) => h.setFontLevel), g = Y((h) => h.setLineLevel), b = Y((h) => h.setMarginLevel), m = Y((h) => h.pointerStyle), y = Y((h) => h.setPointerStyle), p = Y((h) => h.pointerColor), f = Y((h) => h.setPointerColor), u = Y((h) => h.breakMarks), T = Y((h) => h.toggleBreakMark), k = Y((h) => h.getBreakGapLevel()), I = Y((h) => h.setBreakGapLevel), _ = `${Ae.wrap} ${e ? Ae.wrapVisible : Ae.wrapHidden}`;
5692
- return /* @__PURE__ */ X("div", { className: _, role: "dialog", "aria-modal": "true", "aria-label": "뷰어 설정", children: [
5698
+ const t = Y((h) => h.mode), n = Y((h) => h.setMode), r = Y((h) => h.theme), o = Y((h) => h.setTheme), i = Y((h) => h.fontFamily), s = Y((h) => h.setFontFamily), c = Y((h) => h.resetToDefaults), l = Y((h) => h.getFontLevel()), a = Y((h) => h.getLineLevel()), d = Y((h) => h.getMarginLevel()), v = Y((h) => h.setFontLevel), g = Y((h) => h.setLineLevel), b = Y((h) => h.setMarginLevel), m = Y((h) => h.pointerStyle), y = Y((h) => h.setPointerStyle), p = Y((h) => h.pointerColor), f = Y((h) => h.setPointerColor), u = Y((h) => h.breakMarks), T = Y((h) => h.toggleBreakMark), k = Y((h) => h.getBreakGapLevel()), R = Y((h) => h.setBreakGapLevel), C = `${Ae.wrap} ${e ? Ae.wrapVisible : Ae.wrapHidden}`;
5699
+ return /* @__PURE__ */ X("div", { className: C, role: "dialog", "aria-modal": "true", "aria-label": "뷰어 설정", children: [
5693
5700
  /* @__PURE__ */ X("div", { className: Ae.scrollArea, children: [
5694
5701
  /* @__PURE__ */ x(jt, { label: "열람방식", children: /* @__PURE__ */ X("div", { className: Ae.inlineFlex, children: [
5695
5702
  /* @__PURE__ */ x(Lt, { active: t === "page", onClick: () => n("page"), children: "페이지" }),
5696
5703
  /* @__PURE__ */ x(Lt, { active: t === "scroll", onClick: () => n("scroll"), children: "스크롤" })
5697
5704
  ] }) }),
5698
5705
  /* @__PURE__ */ x(jt, { label: "테마", children: /* @__PURE__ */ x("div", { className: Ae.inlineFlex, children: Object.keys(bn).map((h) => {
5699
- const S = h, C = bn[S];
5706
+ const S = h, I = bn[S];
5700
5707
  return /* @__PURE__ */ x(
5701
5708
  "button",
5702
5709
  {
5703
5710
  type: "button",
5704
5711
  onClick: () => o(S),
5705
5712
  className: `${Ae.themeCircle} ${r === h ? Ae.themeCircleActive : ""}`,
5706
- style: { background: C.bg, color: C.fg, fontFamily: i },
5713
+ style: { background: I.bg, color: I.fg, fontFamily: i },
5707
5714
  title: String(h),
5708
5715
  "aria-label": `테마: ${String(h)}`,
5709
5716
  children: "A"
@@ -5782,8 +5789,8 @@ function Yc({ visible: e }) {
5782
5789
  level: k,
5783
5790
  min: 1,
5784
5791
  max: 5,
5785
- onDec: () => I(Math.max(1, k - 1)),
5786
- onInc: () => I(Math.min(5, k + 1))
5792
+ onDec: () => R(Math.max(1, k - 1)),
5793
+ onInc: () => R(Math.min(5, k + 1))
5787
5794
  }
5788
5795
  )
5789
5796
  ] }),
@@ -6064,8 +6071,8 @@ function ru(e) {
6064
6071
  if (!f || f.length === 0) return -1;
6065
6072
  let u = 0, T = f.length - 1, k = 0;
6066
6073
  for (; u <= T; ) {
6067
- const I = u + T >> 1;
6068
- f[I].t <= p ? (k = I, u = I + 1) : T = I - 1;
6074
+ const R = u + T >> 1;
6075
+ f[R].t <= p ? (k = R, u = R + 1) : T = R - 1;
6069
6076
  }
6070
6077
  return f[Math.max(0, Math.min(k, f.length - 1))].g;
6071
6078
  },
@@ -6087,8 +6094,8 @@ function ru(e) {
6087
6094
  }
6088
6095
  if (!f) {
6089
6096
  let k = y + 1;
6090
- const I = y + 100;
6091
- for (; p[k] == null && k <= I; ) k++;
6097
+ const R = y + 100;
6098
+ for (; p[k] == null && k <= R; ) k++;
6092
6099
  p[k] && (f = p[k]);
6093
6100
  }
6094
6101
  }
@@ -6167,13 +6174,13 @@ function lu(e) {
6167
6174
  mr(u) && (i[g + f] = 1);
6168
6175
  }
6169
6176
  const y = ra(b, g).map((f) => {
6170
- var I;
6177
+ var R;
6171
6178
  const u = f.startG - g, T = f.endG - f.startG + 1;
6172
6179
  let k = -1;
6173
- for (let _ = 0; _ < T; _++) {
6174
- const h = ((I = b[u + _]) == null ? void 0 : I.text) ?? "";
6180
+ for (let C = 0; C < T; C++) {
6181
+ const h = ((R = b[u + C]) == null ? void 0 : R.text) ?? "";
6175
6182
  if (mr(h)) {
6176
- k = f.startG + _;
6183
+ k = f.startG + C;
6177
6184
  break;
6178
6185
  }
6179
6186
  }
@@ -6261,19 +6268,19 @@ function cu(e) {
6261
6268
  b((B) => {
6262
6269
  const F = B.progress;
6263
6270
  if (F.totalRuns === M) return B;
6264
- const V = F.currentGlobalRunIndex < 0 && M > 0;
6271
+ const D = F.currentGlobalRunIndex < 0 && M > 0;
6265
6272
  return {
6266
6273
  progress: {
6267
6274
  ...F,
6268
6275
  totalRuns: M,
6269
- currentGlobalRunIndex: V ? 0 : F.currentGlobalRunIndex,
6270
- lastUpdateBy: V ? "program" : F.lastUpdateBy
6276
+ currentGlobalRunIndex: D ? 0 : F.currentGlobalRunIndex,
6277
+ lastUpdateBy: D ? "program" : F.lastUpdateBy
6271
6278
  }
6272
6279
  };
6273
6280
  });
6274
6281
  }, u = (M, B = "program") => {
6275
- const F = m().progress.currentGlobalRunIndex, V = m().progress, q = V.totalRuns > 0 ? Math.max(-1, Math.min(M, V.totalRuns - 1)) : M;
6276
- F === q && V.lastUpdateBy === B || (b((ue) => ({
6282
+ const F = m().progress.currentGlobalRunIndex, D = m().progress, q = D.totalRuns > 0 ? Math.max(-1, Math.min(M, D.totalRuns - 1)) : M;
6283
+ F === q && D.lastUpdateBy === B || (b((ue) => ({
6277
6284
  progress: {
6278
6285
  ...ue.progress,
6279
6286
  currentGlobalRunIndex: q,
@@ -6286,17 +6293,17 @@ function cu(e) {
6286
6293
  }, T = (M) => {
6287
6294
  const { sectionLoading: B, _loadingStartTime: F } = m().progress;
6288
6295
  if (B === M) return;
6289
- const V = Date.now();
6296
+ const D = Date.now();
6290
6297
  if (M)
6291
6298
  b((q) => ({
6292
6299
  progress: {
6293
6300
  ...q.progress,
6294
6301
  sectionLoading: !0,
6295
- _loadingStartTime: V
6302
+ _loadingStartTime: D
6296
6303
  }
6297
6304
  })), c && c.getState().emit({ type: "loading_start", payload: {} });
6298
6305
  else {
6299
- const ue = (F ? V - F : 0) / 1e3;
6306
+ const ue = (F ? D - F : 0) / 1e3;
6300
6307
  b((de) => ({
6301
6308
  progress: {
6302
6309
  ...de.progress,
@@ -6309,8 +6316,8 @@ function cu(e) {
6309
6316
  b((B) => ({
6310
6317
  progress: { ...B.progress, pageIndex: M }
6311
6318
  }));
6312
- }, I = (M, B) => {
6313
- const V = m().progress.rangeStartGI == null;
6319
+ }, R = (M, B) => {
6320
+ const D = m().progress.rangeStartGI == null;
6314
6321
  if (b((q) => ({
6315
6322
  progress: {
6316
6323
  ...q.progress,
@@ -6320,11 +6327,11 @@ function cu(e) {
6320
6327
  })), c) {
6321
6328
  const q = S();
6322
6329
  c.getState().emit({
6323
- type: V ? "range_select" : "range_change",
6330
+ type: D ? "range_select" : "range_change",
6324
6331
  payload: { startGI: Math.min(M, B), endGI: Math.max(M, B), text: q }
6325
6332
  });
6326
6333
  }
6327
- }, _ = () => {
6334
+ }, C = () => {
6328
6335
  b((M) => ({
6329
6336
  progress: {
6330
6337
  ...M.progress,
@@ -6334,16 +6341,16 @@ function cu(e) {
6334
6341
  })), c && c.getState().emit({ type: "range_clear", payload: {} });
6335
6342
  }, h = (M) => {
6336
6343
  const { rangeStartGI: B, rangeEndGI: F } = m().progress;
6337
- B == null || F == null || (M < B ? b((V) => ({
6338
- progress: { ...V.progress, rangeStartGI: M }
6339
- })) : M > F ? b((V) => ({
6340
- progress: { ...V.progress, rangeEndGI: M }
6341
- })) : _());
6344
+ B == null || F == null || (M < B ? b((D) => ({
6345
+ progress: { ...D.progress, rangeStartGI: M }
6346
+ })) : M > F ? b((D) => ({
6347
+ progress: { ...D.progress, rangeEndGI: M }
6348
+ })) : C());
6342
6349
  }, S = () => {
6343
6350
  var ke;
6344
- const { rangeStartGI: M, rangeEndGI: B, section: F, layout: V } = m().progress;
6345
- if (M == null || B == null || !V) return "";
6346
- const q = ((ke = F.ast) == null ? void 0 : ke.blocks) ?? [], ue = V.prefix, de = [];
6351
+ const { rangeStartGI: M, rangeEndGI: B, section: F, layout: D } = m().progress;
6352
+ if (M == null || B == null || !D) return "";
6353
+ const q = ((ke = F.ast) == null ? void 0 : ke.blocks) ?? [], ue = D.prefix, de = [];
6347
6354
  for (let Re = 0; Re < q.length; Re++) {
6348
6355
  const ee = q[Re];
6349
6356
  if (ee.type !== "paragraph") continue;
@@ -6354,20 +6361,20 @@ function cu(e) {
6354
6361
  }
6355
6362
  }
6356
6363
  return de.join("");
6357
- }, C = (M) => {
6358
- const { totalRuns: B, derivedNav: F } = m().progress, V = F == null ? void 0 : F.readableGi;
6359
- if (!V || B <= 0) return M;
6364
+ }, I = (M) => {
6365
+ const { totalRuns: B, derivedNav: F } = m().progress, D = F == null ? void 0 : F.readableGi;
6366
+ if (!D || B <= 0) return M;
6360
6367
  const q = B, ue = Math.max(0, Math.min(M, q - 1));
6361
- if (V[ue]) return ue;
6368
+ if (D[ue]) return ue;
6362
6369
  let de = ue - 1, ke = ue + 1;
6363
6370
  for (; de >= 0 || ke < q; ) {
6364
- if (ke < q && V[ke]) return ke;
6365
- if (de >= 0 && V[de]) return de;
6371
+ if (ke < q && D[ke]) return ke;
6372
+ if (de >= 0 && D[de]) return de;
6366
6373
  ke += 1, de -= 1;
6367
6374
  }
6368
6375
  return ue;
6369
- }, R = (M, B) => {
6370
- const { totalRuns: F, derivedNav: V } = m().progress, q = V == null ? void 0 : V.readableGi;
6376
+ }, _ = (M, B) => {
6377
+ const { totalRuns: F, derivedNav: D } = m().progress, q = D == null ? void 0 : D.readableGi;
6371
6378
  if (!q || F <= 0) return null;
6372
6379
  if (B > 0) {
6373
6380
  for (let ue = Math.min(Math.max(M, 0), F - 1); ue < F; ue += 1)
@@ -6377,12 +6384,12 @@ function cu(e) {
6377
6384
  if (q[ue]) return ue;
6378
6385
  return null;
6379
6386
  }, O = (M) => {
6380
- const { totalRuns: B, derivedNav: F } = m().progress, V = F == null ? void 0 : F.readableGi;
6381
- if (!V || B <= 0) return null;
6387
+ const { totalRuns: B, derivedNav: F } = m().progress, D = F == null ? void 0 : F.readableGi;
6388
+ if (!D || B <= 0) return null;
6382
6389
  if (M > 0) {
6383
- for (let q = B - 1; q >= 0; q -= 1) if (V[q]) return q;
6390
+ for (let q = B - 1; q >= 0; q -= 1) if (D[q]) return q;
6384
6391
  } else
6385
- for (let q = 0; q < B; q += 1) if (V[q]) return q;
6392
+ for (let q = 0; q < B; q += 1) if (D[q]) return q;
6386
6393
  return null;
6387
6394
  };
6388
6395
  return {
@@ -6395,22 +6402,22 @@ function cu(e) {
6395
6402
  setSectionLoading: T,
6396
6403
  setPageIndex: k,
6397
6404
  // Range Selection API
6398
- setRange: I,
6399
- clearRange: _,
6405
+ setRange: R,
6406
+ clearRange: C,
6400
6407
  extendRange: h,
6401
6408
  getRangeText: S,
6402
6409
  // 네비 API
6403
- snapToReadable: C,
6404
- nextReadableFrom: R,
6410
+ snapToReadable: I,
6411
+ nextReadableFrom: _,
6405
6412
  edgeReadable: O,
6406
- hasReadableInDir: (M, B) => R(M + (B > 0 ? 1 : -1), B) != null,
6413
+ hasReadableInDir: (M, B) => _(M + (B > 0 ? 1 : -1), B) != null,
6407
6414
  computeStepTarget: (M, B) => {
6408
- const { totalRuns: F, derivedNav: V } = m().progress;
6415
+ const { totalRuns: F, derivedNav: D } = m().progress;
6409
6416
  if (!F || F <= 0) return M;
6410
- const q = (V == null ? void 0 : V.groups) ?? [], ue = V == null ? void 0 : V.giToGroupIdx;
6417
+ const q = (D == null ? void 0 : D.groups) ?? [], ue = D == null ? void 0 : D.giToGroupIdx;
6411
6418
  if (!q.length || !ue) {
6412
6419
  const z = F - 1;
6413
- return C(Math.max(0, Math.min(M + B, z)));
6420
+ return I(Math.max(0, Math.min(M + B, z)));
6414
6421
  }
6415
6422
  let de = ue[M] ?? -1;
6416
6423
  if (de < 0 || de >= q.length)
@@ -6422,15 +6429,15 @@ function cu(e) {
6422
6429
  }
6423
6430
  }
6424
6431
  if (de < 0 || de >= q.length)
6425
- return O(B) ?? C(M);
6432
+ return O(B) ?? I(M);
6426
6433
  const ke = (Q) => Q >= 0 && Q < q.length && (q[Q].firstReadableGI ?? -1) >= 0;
6427
6434
  let Re = de + B;
6428
6435
  for (; Re >= 0 && Re < q.length && !ke(Re); )
6429
6436
  Re += B;
6430
6437
  if (Re < 0 || Re >= q.length)
6431
- return O(B) ?? C(M + B);
6438
+ return O(B) ?? I(M + B);
6432
6439
  const ee = q[Re].firstReadableGI;
6433
- return ee >= 0 ? ee : C(M + B);
6440
+ return ee >= 0 ? ee : I(M + B);
6434
6441
  },
6435
6442
  giToPercentTotal: (M) => {
6436
6443
  const B = m().progress.totalRuns;
@@ -6439,8 +6446,8 @@ function cu(e) {
6439
6446
  percentToGITotal: (M) => {
6440
6447
  const B = m().progress.totalRuns;
6441
6448
  if (!B || B <= 1) return 0;
6442
- const F = Math.max(0, Math.min(M, 100)), V = Math.round(F / 100 * (B - 1));
6443
- return Math.max(0, Math.min(V, B - 1));
6449
+ const F = Math.max(0, Math.min(M, 100)), D = Math.round(F / 100 * (B - 1));
6450
+ return Math.max(0, Math.min(D, B - 1));
6444
6451
  }
6445
6452
  }
6446
6453
  };
@@ -6500,27 +6507,27 @@ const fu = ({
6500
6507
  return u;
6501
6508
  }, [m, o]), p = ve(() => {
6502
6509
  const u = [], T = Or();
6503
- return y.forEach((k, I) => {
6504
- u[I] = Pr(k.b, T);
6510
+ return y.forEach((k, R) => {
6511
+ u[R] = Pr(k.b, T);
6505
6512
  }), u;
6506
6513
  }, [y]), f = (u, T, k) => {
6507
6514
  if (!u || u.length === 0) return [];
6508
- const I = [];
6509
- for (const _ of u) {
6510
- const h = _.startG, S = _.endG;
6515
+ const R = [];
6516
+ for (const C of u) {
6517
+ const h = C.startG, S = C.endG;
6511
6518
  if (S < T || h > k) continue;
6512
- const C = Math.max(h, T), R = Math.min(S, k), O = C - h | 0, P = Math.max(0, R - C + 1);
6519
+ const I = Math.max(h, T), _ = Math.min(S, k), O = I - h | 0, P = Math.max(0, _ - I + 1);
6513
6520
  if (P <= 0) continue;
6514
- const w = (_.r0 ?? 0) + O;
6515
- I.push({
6516
- ..._,
6517
- startG: C,
6518
- endG: R,
6521
+ const w = (C.r0 ?? 0) + O;
6522
+ R.push({
6523
+ ...C,
6524
+ startG: I,
6525
+ endG: _,
6519
6526
  r0: w,
6520
6527
  len: P
6521
6528
  });
6522
6529
  }
6523
- return I;
6530
+ return R;
6524
6531
  };
6525
6532
  return /* @__PURE__ */ x(
6526
6533
  "div",
@@ -6557,7 +6564,7 @@ const fu = ({
6557
6564
  /* @__PURE__ */ x("div", { style: { height: 40 } }),
6558
6565
  /* @__PURE__ */ x("div", { style: { flex: 1, overflow: "hidden" }, children: m.map((u, T) => {
6559
6566
  var Q;
6560
- const k = o[u], I = T === 0, _ = T === m.length - 1, h = {
6567
+ const k = o[u], R = T === 0, C = T === m.length - 1, h = {
6561
6568
  boxSizing: "border-box",
6562
6569
  paddingRight: `${i}px`,
6563
6570
  paddingLeft: `${i}px`,
@@ -6569,7 +6576,7 @@ const fu = ({
6569
6576
  height: "auto"
6570
6577
  }, S = `sec-${r.section_id}/blk-${k.id ?? u}`;
6571
6578
  if (k.type === "image") {
6572
- const { src: z, alt: K, width: ne, height: H } = k, oe = ne && H ? `${ne} / ${H}` : "4 / 3", $ = a > 80 ? Math.floor((a - 80) * 0.6) : void 0;
6579
+ const { src: z, alt: K, width: ne, height: H } = k, oe = ne && H ? `${ne} / ${H}` : "4 / 3", V = a > 80 ? Math.floor((a - 80) * 0.6) : void 0;
6573
6580
  return /* @__PURE__ */ x("div", { style: h, children: /* @__PURE__ */ X(
6574
6581
  "div",
6575
6582
  {
@@ -6585,7 +6592,7 @@ const fu = ({
6585
6592
  style: {
6586
6593
  position: "relative",
6587
6594
  width: "100%",
6588
- maxHeight: $,
6595
+ maxHeight: V,
6589
6596
  aspectRatio: oe
6590
6597
  },
6591
6598
  children: /* @__PURE__ */ x(
@@ -6612,26 +6619,26 @@ const fu = ({
6612
6619
  }
6613
6620
  ) }, S);
6614
6621
  }
6615
- const C = k, R = y.findIndex(
6622
+ const I = k, _ = y.findIndex(
6616
6623
  (z) => z.originalBlockIndex === u
6617
- ), O = R >= 0 ? p[R] : void 0, P = C.runs ?? [], w = P.length;
6624
+ ), O = _ >= 0 ? p[_] : void 0, P = I.runs ?? [], w = P.length;
6618
6625
  let E = 0, A = Math.max(0, w - 1);
6619
- I && g.startOffsetInBlock != null && (E = Math.min(Math.max(0, g.startOffsetInBlock), A)), _ && g.endOffsetInBlock != null && (A = Math.max(
6626
+ R && g.startOffsetInBlock != null && (E = Math.min(Math.max(0, g.startOffsetInBlock), A)), C && g.endOffsetInBlock != null && (A = Math.max(
6620
6627
  E,
6621
6628
  Math.min(g.endOffsetInBlock, A)
6622
6629
  ));
6623
- const W = E > 0, M = d[u] ?? 0, B = v[u] ?? [], F = M + E, V = M + A;
6624
- let q = f(B, F, V);
6630
+ const W = E > 0, M = d[u] ?? 0, B = v[u] ?? [], F = M + E, D = M + A;
6631
+ let q = f(B, F, D);
6625
6632
  const ue = M + E;
6626
6633
  q = q.map((z) => {
6627
- const K = Math.max(0, (z.startG ?? F) - ue), ne = z.len ?? Math.max(1, (z.endG ?? V) - (z.startG ?? F) + 1);
6634
+ const K = Math.max(0, (z.startG ?? F) - ue), ne = z.len ?? Math.max(1, (z.endG ?? D) - (z.startG ?? F) + 1);
6628
6635
  return {
6629
6636
  ...z,
6630
6637
  r0: K,
6631
6638
  len: ne
6632
6639
  };
6633
6640
  });
6634
- const de = E <= A ? P.slice(E, A + 1) : [], ke = C.list ? C.list.level * 24 : 0, Re = ((Q = C.list) == null ? void 0 : Q.kind) === "bullet" ? C.list.glyph ?? "•" : void 0, ee = W ? void 0 : O ?? Re;
6641
+ const de = E <= A ? P.slice(E, A + 1) : [], ke = I.list ? I.list.level * 24 : 0, Re = ((Q = I.list) == null ? void 0 : Q.kind) === "bullet" ? I.list.glyph ?? "•" : void 0, ee = W ? void 0 : O ?? Re;
6635
6642
  return /* @__PURE__ */ x("div", { style: h, children: /* @__PURE__ */ X(
6636
6643
  "p",
6637
6644
  {
@@ -6639,12 +6646,12 @@ const fu = ({
6639
6646
  width: "100%",
6640
6647
  margin: "8px 0",
6641
6648
  paddingLeft: ke,
6642
- textAlign: C.textAlign,
6649
+ textAlign: I.textAlign,
6643
6650
  whiteSpace: "pre-wrap",
6644
6651
  boxSizing: "border-box"
6645
6652
  },
6646
6653
  children: [
6647
- C.list && ee ? /* @__PURE__ */ x(
6654
+ I.list && ee ? /* @__PURE__ */ x(
6648
6655
  "span",
6649
6656
  {
6650
6657
  "aria-hidden": !0,
@@ -6740,13 +6747,13 @@ function hu(e) {
6740
6747
  var E;
6741
6748
  const w = ((E = document == null ? void 0 : document.body) == null ? void 0 : E.style) ?? null;
6742
6749
  w && u.current.prevUserSelect != null && (w.userSelect = u.current.prevUserSelect, u.current.prevUserSelect = null), u.current.capturedEl && u.current.pid != null && typeof u.current.capturedEl.hasPointerCapture == "function" && u.current.capturedEl.hasPointerCapture(u.current.pid) && u.current.capturedEl.releasePointerCapture(u.current.pid), u.current.capturedEl = null;
6743
- }, I = dt.useCallback(
6750
+ }, R = dt.useCallback(
6744
6751
  (w) => {
6745
6752
  const E = s ?? i;
6746
6753
  E != null && E(w.target) || (u.current.pid = w.pointerId, u.current.startX = w.clientX, u.current.startY = w.clientY, u.current.startT = w.timeStamp, u.current.swiping = !1, u.current.canceledClick = !1, u.current.capturedEl = w.currentTarget);
6747
6754
  },
6748
6755
  [s, i]
6749
- ), _ = dt.useCallback(
6756
+ ), C = dt.useCallback(
6750
6757
  (w) => {
6751
6758
  var B;
6752
6759
  if (u.current.pid == null || w.pointerId !== u.current.pid) return;
@@ -6760,8 +6767,8 @@ function hu(e) {
6760
6767
  F.setPointerCapture(w.pointerId);
6761
6768
  } catch {
6762
6769
  }
6763
- const V = ((B = document == null ? void 0 : document.body) == null ? void 0 : B.style) ?? null;
6764
- V && (u.current.prevUserSelect = V.userSelect ?? null, V.userSelect = "none"), w.preventDefault();
6770
+ const D = ((B = document == null ? void 0 : document.body) == null ? void 0 : B.style) ?? null;
6771
+ D && (u.current.prevUserSelect = D.userSelect ?? null, D.userSelect = "none"), w.preventDefault();
6765
6772
  }
6766
6773
  return;
6767
6774
  }
@@ -6789,13 +6796,13 @@ function hu(e) {
6789
6796
  ]
6790
6797
  ), S = dt.useCallback(() => {
6791
6798
  u.current.swiping && (m == null || m()), k(), u.current.pid = null, u.current.swiping = !1, u.current.canceledClick = !1;
6792
- }, [m]), C = dt.useCallback(
6799
+ }, [m]), I = dt.useCallback(
6793
6800
  (w) => {
6794
6801
  var E, A;
6795
6802
  (A = (E = u.current.capturedEl) == null ? void 0 : E.hasPointerCapture) != null && A.call(E, w.pointerId) || u.current.pid != null && u.current.swiping && (m == null || m(), k(), u.current.pid = null, u.current.swiping = !1, u.current.canceledClick = !1);
6796
6803
  },
6797
6804
  [m]
6798
- ), R = dt.useCallback(() => {
6805
+ ), _ = dt.useCallback(() => {
6799
6806
  u.current.pid != null && u.current.swiping && (m == null || m()), k(), u.current.pid = null, u.current.swiping = !1, u.current.canceledClick = !1;
6800
6807
  }, [m]), O = dt.useCallback(
6801
6808
  (w) => {
@@ -6828,12 +6835,12 @@ function hu(e) {
6828
6835
  },
6829
6836
  []
6830
6837
  ), {
6831
- onPointerDown: I,
6832
- onPointerMove: _,
6838
+ onPointerDown: R,
6839
+ onPointerMove: C,
6833
6840
  onPointerUp: h,
6834
6841
  onPointerCancel: S,
6835
- onPointerLeave: C,
6836
- onLostPointerCapture: R,
6842
+ onPointerLeave: I,
6843
+ onLostPointerCapture: _,
6837
6844
  onClick: O,
6838
6845
  onDoubleClick: P
6839
6846
  };
@@ -6992,10 +6999,10 @@ function Tu() {
6992
6999
  var E = d, A = v;
6993
7000
  return d = v = void 0, p = w, b = c.apply(A, E), b;
6994
7001
  }
6995
- function I(w) {
7002
+ function R(w) {
6996
7003
  return p = w, m = setTimeout(S, l), f ? k(w) : b;
6997
7004
  }
6998
- function _(w) {
7005
+ function C(w) {
6999
7006
  var E = w - y, A = w - p, W = l - E;
7000
7007
  return u ? i(W, g - A) : W;
7001
7008
  }
@@ -7006,29 +7013,29 @@ function Tu() {
7006
7013
  function S() {
7007
7014
  var w = t();
7008
7015
  if (h(w))
7009
- return C(w);
7010
- m = setTimeout(S, _(w));
7016
+ return I(w);
7017
+ m = setTimeout(S, C(w));
7011
7018
  }
7012
- function C(w) {
7019
+ function I(w) {
7013
7020
  return m = void 0, T && d ? k(w) : (d = v = void 0, b);
7014
7021
  }
7015
- function R() {
7022
+ function _() {
7016
7023
  m !== void 0 && clearTimeout(m), p = 0, d = y = v = m = void 0;
7017
7024
  }
7018
7025
  function O() {
7019
- return m === void 0 ? b : C(t());
7026
+ return m === void 0 ? b : I(t());
7020
7027
  }
7021
7028
  function P() {
7022
7029
  var w = t(), E = h(w);
7023
7030
  if (d = arguments, v = this, y = w, E) {
7024
7031
  if (m === void 0)
7025
- return I(y);
7032
+ return R(y);
7026
7033
  if (u)
7027
7034
  return clearTimeout(m), m = setTimeout(S, l), k(y);
7028
7035
  }
7029
7036
  return m === void 0 && (m = setTimeout(S, l)), b;
7030
7037
  }
7031
- return P.cancel = R, P.flush = O, P;
7038
+ return P.cancel = _, P.flush = O, P;
7032
7039
  }
7033
7040
  return ir = s, ir;
7034
7041
  }
@@ -7110,17 +7117,17 @@ async function Ou({
7110
7117
  const p = Mu(y);
7111
7118
  lt(p, y);
7112
7119
  try {
7113
- const k = Math.abs(b - 1) > 1e-3, I = 1 / b;
7114
- k && (t.style.transform = `scale(${I})`, t.style.transformOrigin = "top left");
7115
- const _ = Math.max(0, e.offsetWidth || 0), h = Math.max(0, Math.min(_, o));
7120
+ const k = Math.abs(b - 1) > 1e-3, R = 1 / b;
7121
+ k && (t.style.transform = `scale(${R})`, t.style.transformOrigin = "top left");
7122
+ const C = Math.max(0, e.offsetWidth || 0), h = Math.max(0, Math.min(C, o));
7116
7123
  t.style.maxWidth = `${h}px`, lt(p, y);
7117
7124
  let S = Math.round(n.offsetHeight || 0);
7118
7125
  S || (S = Math.max(0, n.clientHeight | 0)), console.log(
7119
7126
  "[calcPages] playbackScale:",
7120
7127
  b.toFixed(4),
7121
7128
  k ? "(scaled, applying inverse)" : "(no scale)"
7122
- ), console.log("[calcPages] viewWidth:", _), console.log("[calcPages] pageBoxWidth:", h), console.log("[calcPages] maxPageHeight:", S), console.log("[calcPages] contentArea rect:", n.getBoundingClientRect()), console.log("[calcPages] measureRoot rect:", t.getBoundingClientRect());
7123
- const C = 1.5, R = (H, oe) => oe + H <= S - C, O = getComputedStyle(e), P = {
7129
+ ), console.log("[calcPages] viewWidth:", C), console.log("[calcPages] pageBoxWidth:", h), console.log("[calcPages] maxPageHeight:", S), console.log("[calcPages] contentArea rect:", n.getBoundingClientRect()), console.log("[calcPages] measureRoot rect:", t.getBoundingClientRect());
7130
+ const I = 1.5, _ = (H, oe) => oe + H <= S - I, O = getComputedStyle(e), P = {
7124
7131
  letterSpacing: O.letterSpacing,
7125
7132
  wordSpacing: O.wordSpacing,
7126
7133
  fontKerning: O.fontKerning || "normal",
@@ -7138,16 +7145,16 @@ async function Ou({
7138
7145
  W.style.boxSizing = "border-box", W.style.width = `${E}px`, W.style.maxWidth = `${E}px`, W.style.margin = "0 auto", W.style.display = "flex", n.appendChild(W);
7139
7146
  const M = document.createElement("div");
7140
7147
  M.style.boxSizing = "border-box", M.style.paddingRight = `${i}px`, M.style.paddingLeft = `${i}px`, M.style.width = `${E}px`, M.style.maxWidth = `${E}px`, M.style.margin = "0 auto", M.style.display = "flex", M.style.justifyContent = "center", M.style.height = "auto", W.appendChild(M);
7141
- const B = /* @__PURE__ */ new Map(), F = {}, V = Eu(p, y, r.length), q = (H, oe) => {
7142
- const $ = document.createElement("p");
7143
- return $.style.margin = "8px 0", $.style.paddingLeft = oe ? `${oe}px` : "0", $.style.textAlign = H.textAlign ?? "start", $.style.whiteSpace = "pre-wrap", $.style.lineHeight = String(l), $.style.fontSize = `${c}px`, $.style.boxSizing = "border-box", $.style.fontFamily = s ?? "", $.style.width = "100%", w($), $;
7148
+ const B = /* @__PURE__ */ new Map(), F = {}, D = Eu(p, y, r.length), q = (H, oe) => {
7149
+ const V = document.createElement("p");
7150
+ return V.style.margin = "8px 0", V.style.paddingLeft = oe ? `${oe}px` : "0", V.style.textAlign = H.textAlign ?? "start", V.style.whiteSpace = "pre-wrap", V.style.lineHeight = String(l), V.style.fontSize = `${c}px`, V.style.boxSizing = "border-box", V.style.fontFamily = s ?? "", V.style.width = "100%", w(V), V;
7144
7151
  }, ue = (H, oe) => {
7145
- const $ = oe ?? [], J = document.createDocumentFragment();
7146
- for (let se = 0; se < $.length; se++) {
7147
- const re = $[se], pe = document.createElement("span");
7152
+ const V = oe ?? [], J = document.createDocumentFragment();
7153
+ for (let se = 0; se < V.length; se++) {
7154
+ const re = V[se], pe = document.createElement("span");
7148
7155
  pe.dataset.runbox = String(se), pe.style.whiteSpace = "pre-wrap";
7149
7156
  const le = document.createElement("span");
7150
- if (le.dataset.run = String(se), le.textContent = (re == null ? void 0 : re.text) ?? "", le.style.whiteSpace = "pre-wrap", re != null && re.bold && (le.style.fontWeight = "700"), re != null && re.italic && (le.style.fontStyle = "italic"), re != null && re.underline && (le.style.textDecoration = "underline"), pe.appendChild(le), a && (re != null && re.split) && se !== $.length - 1) {
7157
+ if (le.dataset.run = String(se), le.textContent = (re == null ? void 0 : re.text) ?? "", le.style.whiteSpace = "pre-wrap", re != null && re.bold && (le.style.fontWeight = "700"), re != null && re.italic && (le.style.fontStyle = "italic"), re != null && re.underline && (le.style.textDecoration = "underline"), pe.appendChild(le), a && (re != null && re.split) && se !== V.length - 1) {
7151
7158
  const we = Math.max(0, (d ?? 0) / 2), me = document.createElement("span");
7152
7159
  me.style.display = "inline-block", me.style.width = `${we}px`;
7153
7160
  const Te = document.createElement("span");
@@ -7161,16 +7168,16 @@ async function Ou({
7161
7168
  }
7162
7169
  H.appendChild(J);
7163
7170
  }, de = m > 80 ? Math.floor((m - 80) * 0.6) : void 0, ke = (H) => {
7164
- const oe = H != null && H.width && (H != null && H.height) ? `${H.width} / ${H.height}` : "4 / 3", $ = document.createElement("div");
7165
- $.style.margin = "12px 0", $.style.textAlign = "center", $.style.width = `${A}px`;
7171
+ const oe = H != null && H.width && (H != null && H.height) ? `${H.width} / ${H.height}` : "4 / 3", V = document.createElement("div");
7172
+ V.style.margin = "12px 0", V.style.textAlign = "center", V.style.width = `${A}px`;
7166
7173
  const J = document.createElement("div");
7167
7174
  J.style.position = "relative", J.style.width = "100%", de && (J.style.maxHeight = `${de}px`), J.style.aspectRatio = oe;
7168
7175
  const se = document.createElement("div");
7169
- if (se.style.position = "absolute", se.style.inset = "0", se.style.width = "100%", se.style.height = "100%", J.appendChild(se), $.appendChild(J), H != null && H.alt) {
7176
+ if (se.style.position = "absolute", se.style.inset = "0", se.style.width = "100%", se.style.height = "100%", J.appendChild(se), V.appendChild(J), H != null && H.alt) {
7170
7177
  const re = document.createElement("div");
7171
- re.style.fontSize = "12px", re.style.color = "#6B7280", re.style.marginTop = "4px", re.textContent = String(H.alt), w(re), $.appendChild(re);
7178
+ re.style.fontSize = "12px", re.style.color = "#6B7280", re.style.marginTop = "4px", re.textContent = String(H.alt), w(re), V.appendChild(re);
7172
7179
  }
7173
- return $;
7180
+ return V;
7174
7181
  };
7175
7182
  for (let H = 0; H < r.length; H++) {
7176
7183
  lt(p, y);
@@ -7179,26 +7186,26 @@ async function Ou({
7179
7186
  const Te = oe.block, Oe = ke(Te);
7180
7187
  M.appendChild(Oe);
7181
7188
  const Ne = Oe.getBoundingClientRect(), { mt: Le, mb: $e } = sr(Oe);
7182
- F[H] = { contentH: Math.ceil(Ne.height), mt: Le, mb: $e }, await V(24);
7189
+ F[H] = { contentH: Math.ceil(Ne.height), mt: Le, mb: $e }, await D(24);
7183
7190
  continue;
7184
7191
  }
7185
- const $ = oe.block, J = $.list ? ($.list.level ?? 0) * 24 : 0, se = oe.paraIndex ?? 0, re = g[se] ?? (((f = $.list) == null ? void 0 : f.kind) === "bullet" ? ((u = $.list) == null ? void 0 : u.glyph) ?? "•" : void 0);
7186
- if (!!($.list && re)) {
7187
- const Te = q($, J);
7192
+ const V = oe.block, J = V.list ? (V.list.level ?? 0) * 24 : 0, se = oe.paraIndex ?? 0, re = g[se] ?? (((f = V.list) == null ? void 0 : f.kind) === "bullet" ? ((u = V.list) == null ? void 0 : u.glyph) ?? "•" : void 0);
7193
+ if (!!(V.list && re)) {
7194
+ const Te = q(V, J);
7188
7195
  Te.dataset.variant = "with";
7189
- const Oe = q($, J);
7196
+ const Oe = q(V, J);
7190
7197
  Oe.dataset.variant = "no";
7191
7198
  const Ne = document.createElement("span");
7192
- Ne.textContent = `${re} `, Ne.style.minWidth = "16px", Ne.style.display = "inline-block", Ne.style.whiteSpace = "nowrap", Ne.style.userSelect = "none", Te.appendChild(Ne), ue(Te, $.runs), ue(Oe, $.runs);
7199
+ Ne.textContent = `${re} `, Ne.style.minWidth = "16px", Ne.style.display = "inline-block", Ne.style.whiteSpace = "nowrap", Ne.style.userSelect = "none", Te.appendChild(Ne), ue(Te, V.runs), ue(Oe, V.runs);
7193
7200
  const Le = document.createDocumentFragment();
7194
7201
  Le.appendChild(Te), Le.appendChild(Oe), M.appendChild(Le);
7195
7202
  } else {
7196
- const Te = q($, J);
7197
- Te.dataset.variant = "with", ue(Te, $.runs), M.appendChild(Te);
7203
+ const Te = q(V, J);
7204
+ Te.dataset.variant = "with", ue(Te, V.runs), M.appendChild(Te);
7198
7205
  }
7199
7206
  const le = M.querySelector('p[data-variant="with"]'), we = M.querySelector('p[data-variant="no"]'), me = we ?? le;
7200
7207
  if (le && me) {
7201
- const Te = Ho(le), Oe = Ho(me), { mt: Ne, mb: Le } = sr(le), { mt: $e, mb: ut } = sr(me), Qe = ((T = $.runs) == null ? void 0 : T.length) ?? 0, He = we ? Oe : Te, ot = we ? $e : Ne, Je = we ? ut : Le;
7208
+ const Te = Ho(le), Oe = Ho(me), { mt: Ne, mb: Le } = sr(le), { mt: $e, mb: ut } = sr(me), Qe = ((T = V.runs) == null ? void 0 : T.length) ?? 0, He = we ? Oe : Te, ot = we ? $e : Ne, Je = we ? ut : Le;
7202
7209
  if (H < 3) {
7203
7210
  const bt = le.getBoundingClientRect().height;
7204
7211
  console.log(
@@ -7215,26 +7222,26 @@ async function Ou({
7215
7222
  mbNo: Je
7216
7223
  });
7217
7224
  }
7218
- await V(24);
7225
+ await D(24);
7219
7226
  }
7220
7227
  lt(p, y), M.innerHTML = "";
7221
- const Re = (H, oe, $, J) => {
7222
- if (oe > $) return { top: 0, content: 0, mb: 0 };
7223
- const se = J ? H.lastBottomNo : H.lastBottomWith, re = J ? H.mtNo : H.mtWith, pe = J ? H.mbNo : H.mbWith, le = J ? 0 : re, we = oe > 0 ? se[oe - 1] ?? 0 : 0, me = Math.max(0, (se[$] ?? 0) - we);
7228
+ const Re = (H, oe, V, J) => {
7229
+ if (oe > V) return { top: 0, content: 0, mb: 0 };
7230
+ const se = J ? H.lastBottomNo : H.lastBottomWith, re = J ? H.mtNo : H.mtWith, pe = J ? H.mbNo : H.mbWith, le = J ? 0 : re, we = oe > 0 ? se[oe - 1] ?? 0 : 0, me = Math.max(0, (se[V] ?? 0) - we);
7224
7231
  return { top: le, content: me, mb: pe };
7225
7232
  }, ee = [];
7226
7233
  let Q = 0, z, K = null, ne = null;
7227
7234
  for (; Q < r.length; ) {
7228
7235
  lt(p, y);
7229
7236
  const H = Q;
7230
- let oe = 0, $ = 0, J = z;
7237
+ let oe = 0, V = 0, J = z;
7231
7238
  J != null && K === Q && ne != null && (J = Math.max(J, ne + 1));
7232
7239
  let se = -1, re;
7233
7240
  for (; Q < r.length; ) {
7234
7241
  if (lt(p, y), r[Q].kind === "image") {
7235
- const He = F[Q] ?? { contentH: 0, mt: 0, mb: 0 }, Je = (oe === 0 ? He.mt : $ + He.mt) + He.contentH;
7236
- if (R(Je, oe)) {
7237
- oe += Je, se = Q, re = void 0, $ = He.mb, Q += 1, z = void 0, K = null, ne = null;
7242
+ const He = F[Q] ?? { contentH: 0, mt: 0, mb: 0 }, Je = (oe === 0 ? He.mt : V + He.mt) + He.contentH;
7243
+ if (_(Je, oe)) {
7244
+ oe += Je, se = Q, re = void 0, V = He.mb, Q += 1, z = void 0, K = null, ne = null;
7238
7245
  continue;
7239
7246
  }
7240
7247
  if (oe === 0) {
@@ -7243,7 +7250,7 @@ async function Ou({
7243
7250
  endBlock: Q,
7244
7251
  ...J != null ? { startOffsetInBlock: J } : {}
7245
7252
  // 이미지에는 run 오프셋 개념이 없어 endOffsetInBlock 생략
7246
- }), Q += 1, z = void 0, K = null, ne = null, $ = 0;
7253
+ }), Q += 1, z = void 0, K = null, ne = null, V = 0;
7247
7254
  break;
7248
7255
  }
7249
7256
  break;
@@ -7253,16 +7260,16 @@ async function Ou({
7253
7260
  Q += 1, z = void 0, K = null, ne = null;
7254
7261
  continue;
7255
7262
  }
7256
- const Te = me > 0, Oe = Re(le, me, we - 1, Te), Le = (oe === 0 ? Oe.top : $ + Oe.top) + Oe.content;
7257
- if (R(Le, oe)) {
7258
- oe += Le, se = Q, re = we - 1, $ = Oe.mb, Q += 1, z = void 0, K = null, ne = null;
7263
+ const Te = me > 0, Oe = Re(le, me, we - 1, Te), Le = (oe === 0 ? Oe.top : V + Oe.top) + Oe.content;
7264
+ if (_(Le, oe)) {
7265
+ oe += Le, se = Q, re = we - 1, V = Oe.mb, Q += 1, z = void 0, K = null, ne = null;
7259
7266
  continue;
7260
7267
  }
7261
7268
  let $e = me, ut = we - 1, Qe = me - 1;
7262
7269
  for (; $e <= ut; ) {
7263
7270
  lt(p, y);
7264
- const He = $e + ut >> 1, ot = Re(le, me, He, Te), Je = (oe === 0 ? ot.top : $ + ot.top) + ot.content;
7265
- R(Je, oe) ? (Qe = He, $e = He + 1) : ut = He - 1;
7271
+ const He = $e + ut >> 1, ot = Re(le, me, He, Te), Je = (oe === 0 ? ot.top : V + ot.top) + ot.content;
7272
+ _(Je, oe) ? (Qe = He, $e = He + 1) : ut = He - 1;
7266
7273
  }
7267
7274
  if (Qe >= me) {
7268
7275
  ee.push({
@@ -7270,7 +7277,7 @@ async function Ou({
7270
7277
  endBlock: Q,
7271
7278
  ...J != null ? { startOffsetInBlock: J } : {},
7272
7279
  endOffsetInBlock: Qe
7273
- }), z = Qe + 1, K = Q, ne = Qe, $ = 0;
7280
+ }), z = Qe + 1, K = Q, ne = Qe, V = 0;
7274
7281
  break;
7275
7282
  }
7276
7283
  if (oe > 0) {
@@ -7279,7 +7286,7 @@ async function Ou({
7279
7286
  endBlock: se >= 0 ? se : Math.min(Q - 1, r.length - 1),
7280
7287
  ...J != null ? { startOffsetInBlock: J } : {},
7281
7288
  ...re != null ? { endOffsetInBlock: re } : {}
7282
- }), $ = 0;
7289
+ }), V = 0;
7283
7290
  break;
7284
7291
  } else {
7285
7292
  const He = me;
@@ -7288,7 +7295,7 @@ async function Ou({
7288
7295
  endBlock: Q,
7289
7296
  ...J != null ? { startOffsetInBlock: J } : {},
7290
7297
  endOffsetInBlock: He
7291
- }), z = He + 1, K = Q, ne = He, $ = 0;
7298
+ }), z = He + 1, K = Q, ne = He, V = 0;
7292
7299
  break;
7293
7300
  }
7294
7301
  }
@@ -7360,21 +7367,21 @@ function Au(e) {
7360
7367
  }
7361
7368
  function Lu() {
7362
7369
  var zr;
7363
- const e = ji(), t = j((D) => D.section), n = j((D) => D.sectionLoading), r = j((D) => D.rangeStartGI), o = j((D) => D.rangeEndGI), i = r != null && o != null, s = Et(), c = Y((D) => D.theme), l = bn[c], a = Y((D) => D.fontFamily), d = Y((D) => D.fontSizePx), v = Y((D) => D.lineHeight), g = Y((D) => D.marginX), b = Y((D) => D.viewportHeight), m = 860, y = ie(null), { items: p } = ve(() => {
7364
- var D;
7365
- return Au(((D = t == null ? void 0 : t.ast) == null ? void 0 : D.blocks) ?? []);
7370
+ const e = ji(), t = j(($) => $.section), n = j(($) => $.sectionLoading), r = j(($) => $.rangeStartGI), o = j(($) => $.rangeEndGI), i = r != null && o != null, s = Et(), c = Y(($) => $.theme), l = bn[c], a = Y(($) => $.fontFamily), d = Y(($) => $.fontSizePx), v = Y(($) => $.lineHeight), g = Y(($) => $.marginX), b = Y(($) => $.viewportHeight), m = 860, y = ie(null), { items: p } = ve(() => {
7371
+ var $;
7372
+ return Au((($ = t == null ? void 0 : t.ast) == null ? void 0 : $.blocks) ?? []);
7366
7373
  }, [t]), f = ve(() => {
7367
- const D = [], ze = Or();
7374
+ const $ = [], ze = Or();
7368
7375
  return p.forEach((We) => {
7369
7376
  if (We.kind === "paragraph") {
7370
7377
  const Ct = We.paraIndex;
7371
- D[Ct] = Pr(We.block, ze);
7378
+ $[Ct] = Pr(We.block, ze);
7372
7379
  }
7373
- }), D;
7380
+ }), $;
7374
7381
  }, [p]), [u, T] = et({
7375
7382
  pages: [],
7376
7383
  pageByRunIndex: null
7377
- }), k = j((D) => D.pageIndex), I = j((D) => D.setPageIndex), _ = ie(0), h = ie(null), [S, C] = et(!1), [R, O] = et(null), [P, w] = et(!1), E = ve(
7384
+ }), k = j(($) => $.pageIndex), R = j(($) => $.setPageIndex), C = ie(0), h = ie(null), [S, I] = et(!1), [_, O] = et(null), [P, w] = et(!1), E = ve(
7378
7385
  () => ({
7379
7386
  flex: 1,
7380
7387
  fontFamily: a,
@@ -7395,33 +7402,33 @@ function Lu() {
7395
7402
  breakGapPx: W,
7396
7403
  slash: M
7397
7404
  } = Y(
7398
- nn((D) => {
7405
+ nn(($) => {
7399
7406
  var ze;
7400
7407
  return {
7401
- showSplit: D.showSplit,
7402
- breakGapPx: D.breakGapPx ?? 0,
7403
- slash: ((ze = D.breakMarks) == null ? void 0 : ze.slash) ?? !1
7408
+ showSplit: $.showSplit,
7409
+ breakGapPx: $.breakGapPx ?? 0,
7410
+ slash: ((ze = $.breakMarks) == null ? void 0 : ze.slash) ?? !1
7404
7411
  };
7405
7412
  })
7406
7413
  ), B = Rt();
7407
7414
  Se(() => {
7408
7415
  u && u.pages.length && (console.log("그래서 총 페이지", u.pages.length), (async () => {
7409
- const D = B.getState().progress.setSectionLoading;
7410
- await vt(), await vt(), await vt(), await vt(), console.log("recalc종료"), D(!1);
7416
+ const $ = B.getState().progress.setSectionLoading;
7417
+ await vt(), await vt(), await vt(), await vt(), console.log("recalc종료"), $(!1);
7411
7418
  })());
7412
7419
  }, [u, B]);
7413
7420
  const F = Z(() => {
7414
7421
  console.log("@@@@@@recalc호출");
7415
- const D = y.current, ze = le.current, We = we.current;
7416
- if (console.log("showSplit", A), !D || !ze || !We || p.length === 0) {
7417
- T({ pages: [], pageByRunIndex: null }), I(0);
7422
+ const $ = y.current, ze = le.current, We = we.current;
7423
+ if (console.log("showSplit", A), !$ || !ze || !We || p.length === 0) {
7424
+ T({ pages: [], pageByRunIndex: null }), R(0);
7418
7425
  return;
7419
7426
  }
7420
7427
  (async () => {
7421
7428
  const Ct = performance.now();
7422
7429
  try {
7423
7430
  const it = s.getState().playbackScale, { pages: Bt, pageByRunIndex: Di } = await Ou({
7424
- viewHost: D,
7431
+ viewHost: $,
7425
7432
  measureRoot: ze,
7426
7433
  contentArea: We,
7427
7434
  items: p,
@@ -7440,7 +7447,7 @@ function Lu() {
7440
7447
  }), $i = performance.now();
7441
7448
  console.log(
7442
7449
  `✅ calcPages 완료: ${($i - Ct).toFixed(1)} ms (${Bt.length} pages)`
7443
- ), T({ pages: Bt, pageByRunIndex: Di }), I(0);
7450
+ ), T({ pages: Bt, pageByRunIndex: Di }), R(0);
7444
7451
  } catch (it) {
7445
7452
  if (it instanceof Fi) {
7446
7453
  console.log("이젠실행 취소 들어옴!");
@@ -7450,7 +7457,7 @@ function Lu() {
7450
7457
  }
7451
7458
  })();
7452
7459
  }, [
7453
- I,
7460
+ R,
7454
7461
  p,
7455
7462
  m,
7456
7463
  g,
@@ -7464,56 +7471,56 @@ function Lu() {
7464
7471
  s,
7465
7472
  b,
7466
7473
  e
7467
- ]), V = j((D) => D.setCurrentGlobalRunIndex), q = j((D) => {
7474
+ ]), D = j(($) => $.setCurrentGlobalRunIndex), q = j(($) => {
7468
7475
  var ze;
7469
- return ((ze = D.layout) == null ? void 0 : ze.prefix) ?? [];
7470
- }), ue = _e((D) => D.syncToGI), de = Z(
7471
- (D) => {
7472
- const ze = u.pages.length + 1, We = k + D;
7476
+ return ((ze = $.layout) == null ? void 0 : ze.prefix) ?? [];
7477
+ }), ue = _e(($) => $.syncToGI), de = Z(
7478
+ ($) => {
7479
+ const ze = u.pages.length + 1, We = k + $;
7473
7480
  if (We < 0 || We >= ze) return;
7474
7481
  const Ct = k === u.pages.length;
7475
7482
  if (We === u.pages.length) {
7476
- I(We);
7483
+ R(We);
7477
7484
  return;
7478
7485
  }
7479
- if (Ct && D === -1) {
7486
+ if (Ct && $ === -1) {
7480
7487
  const Bt = No(u.pages[We], p, q);
7481
- Bt != null && (V(Bt, "scrubber-step"), ue(Bt)), I(We);
7488
+ Bt != null && (D(Bt, "scrubber-step"), ue(Bt)), R(We);
7482
7489
  return;
7483
7490
  }
7484
7491
  const it = No(u.pages[We], p, q);
7485
- it != null ? (V(it, "scrubber-step"), ue(it)) : I(We);
7492
+ it != null ? (D(it, "scrubber-step"), ue(it)) : R(We);
7486
7493
  },
7487
- [k, u.pages, p, q, V, I, ue]
7494
+ [k, u.pages, p, q, D, R, ue]
7488
7495
  ), ke = Z(() => {
7489
- S || _.current !== 0 ? (O("prev"), C(!1)) : de(-1);
7496
+ S || C.current !== 0 ? (O("prev"), I(!1)) : de(-1);
7490
7497
  }, [S, de]), Re = Z(() => {
7491
- S || _.current !== 0 ? (O("next"), C(!1)) : de(1);
7498
+ S || C.current !== 0 ? (O("next"), I(!1)) : de(1);
7492
7499
  }, [S, de]), ee = kn(), Q = Z(() => {
7493
- const { isSettingsOpen: D, setSettingsOpen: ze, toggleOverlays: We } = ee.getState();
7494
- D ? ze(!1) : We();
7495
- }, [ee]), z = u.pages.length + 1, K = ((zr = y.current) == null ? void 0 : zr.clientWidth) || 400, ne = Z((D) => {
7500
+ const { isSettingsOpen: $, setSettingsOpen: ze, toggleOverlays: We } = ee.getState();
7501
+ $ ? ze(!1) : We();
7502
+ }, [ee]), z = u.pages.length + 1, K = ((zr = y.current) == null ? void 0 : zr.clientWidth) || 400, ne = Z(($) => {
7496
7503
  var it;
7497
7504
  const ze = h.current;
7498
7505
  if (!ze) return;
7499
- const We = ((it = y.current) == null ? void 0 : it.clientWidth) || 1, Ct = D / We * 33.333;
7506
+ const We = ((it = y.current) == null ? void 0 : it.clientWidth) || 1, Ct = $ / We * 33.333;
7500
7507
  ze.style.transform = `translate3d(${-33.333 + Ct}%, 0, 0)`;
7501
7508
  }, []), H = Z(
7502
- (D) => {
7503
- k === 0 && D > 0 || k >= z - 1 && D < 0 || (_.current = D, ne(D), S || C(!0));
7509
+ ($) => {
7510
+ k === 0 && $ > 0 || k >= z - 1 && $ < 0 || (C.current = $, ne($), S || I(!0));
7504
7511
  },
7505
7512
  [k, z, ne, S]
7506
7513
  ), oe = Z(() => {
7507
- _.current = 0, C(!1);
7508
- const D = h.current;
7509
- D && (D.style.transition = "transform 250ms ease-out", D.style.transform = "translate3d(-33.333%, 0, 0)");
7510
- }, []), $ = Z(
7511
- (D) => {
7512
- if (D.target !== D.currentTarget || D.propertyName !== "transform") return;
7513
- const ze = R;
7514
- w(!0), O(null), _.current = 0, ze === "prev" ? de(-1) : ze === "next" && de(1);
7514
+ C.current = 0, I(!1);
7515
+ const $ = h.current;
7516
+ $ && ($.style.transition = "transform 250ms ease-out", $.style.transform = "translate3d(-33.333%, 0, 0)");
7517
+ }, []), V = Z(
7518
+ ($) => {
7519
+ if ($.target !== $.currentTarget || $.propertyName !== "transform") return;
7520
+ const ze = _;
7521
+ w(!0), O(null), C.current = 0, ze === "prev" ? de(-1) : ze === "next" && de(1);
7515
7522
  },
7516
- [R, de]
7523
+ [_, de]
7517
7524
  );
7518
7525
  Tt(() => {
7519
7526
  P && requestAnimationFrame(() => {
@@ -7523,12 +7530,12 @@ function Lu() {
7523
7530
  });
7524
7531
  }, [P]);
7525
7532
  const J = yn(), se = Z(
7526
- (D) => i || zu(D) ? !0 : Bu(D),
7533
+ ($) => i || zu($) ? !0 : Bu($),
7527
7534
  [i]
7528
7535
  ), re = Z(
7529
- (D) => {
7536
+ ($) => {
7530
7537
  const ze = J.getState().status;
7531
- return ze === "playing" || ze === "loading" ? !0 : se(D);
7538
+ return ze === "playing" || ze === "loading" ? !0 : se($);
7532
7539
  },
7533
7540
  [J, se]
7534
7541
  ), pe = hu({
@@ -7550,8 +7557,8 @@ function Lu() {
7550
7557
  pageTransitionThreshold: K * 0.5
7551
7558
  // 50% 이상 드래그 시 전환
7552
7559
  }), le = ie(null), we = ie(null), me = Z(() => {
7553
- const D = B.getState().progress.setSectionLoading;
7554
- D(!0);
7560
+ const $ = B.getState().progress.setSectionLoading;
7561
+ $(!0);
7555
7562
  }, [B]), Te = ve(
7556
7563
  () => ({
7557
7564
  trailing: !0,
@@ -7562,8 +7569,8 @@ function Lu() {
7562
7569
  ), Oe = _u(F, 200, me, Te), Ne = ie("");
7563
7570
  Se(() => {
7564
7571
  if (b <= 0) return;
7565
- const D = `${a}|${d}|${v}|${g}|${A}|${W}|${M}|${b}|${t == null ? void 0 : t.section_id}`;
7566
- Ne.current !== D && (Ne.current = D, console.log("debounceRecalc 취소"), Oe.cancel(), me(), F());
7572
+ const $ = `${a}|${d}|${v}|${g}|${A}|${W}|${M}|${b}|${t == null ? void 0 : t.section_id}`;
7573
+ Ne.current !== $ && (Ne.current = $, console.log("debounceRecalc 취소"), Oe.cancel(), me(), F());
7567
7574
  }, [
7568
7575
  Oe,
7569
7576
  F,
@@ -7578,7 +7585,7 @@ function Lu() {
7578
7585
  b,
7579
7586
  t == null ? void 0 : t.section_id
7580
7587
  ]), pu([y], Oe);
7581
- const Le = j((D) => D.registerSectionScrollApi);
7588
+ const Le = j(($) => $.registerSectionScrollApi);
7582
7589
  Se(() => (Le({
7583
7590
  // 페이지 모드에서는 GI 기반 스크롤 불필요 - 더미 구현
7584
7591
  ensureVisibleGI: () => Promise.resolve(!0),
@@ -7592,7 +7599,7 @@ function Lu() {
7592
7599
  // 페이지 이동 구현
7593
7600
  stepPage: de
7594
7601
  }), () => Le(void 0)), [Le, de]);
7595
- const $e = t.quiz && t.quiz.length > 0, ut = u.pages.length > 0 && k === u.pages.length, Qe = k > 0 ? k - 1 : null, He = k < z - 1 ? k + 1 : null, ot = ve(() => R === "prev" ? "translate3d(0%, 0, 0)" : R === "next" ? "translate3d(-66.666%, 0, 0)" : "translate3d(-33.333%, 0, 0)", [R]), Je = (D) => n ? null : D === u.pages.length ? /* @__PURE__ */ X(
7602
+ const $e = t.quizzes && t.quizzes.length > 0, ut = u.pages.length > 0 && k === u.pages.length, Qe = k > 0 ? k - 1 : null, He = k < z - 1 ? k + 1 : null, ot = ve(() => _ === "prev" ? "translate3d(0%, 0, 0)" : _ === "next" ? "translate3d(-66.666%, 0, 0)" : "translate3d(-33.333%, 0, 0)", [_]), Je = ($) => n ? null : $ === u.pages.length ? /* @__PURE__ */ X(
7596
7603
  "div",
7597
7604
  {
7598
7605
  style: {
@@ -7609,7 +7616,7 @@ function Lu() {
7609
7616
  /* @__PURE__ */ x(Cn, { isIcon: !1 })
7610
7617
  ]
7611
7618
  }
7612
- ) : /* @__PURE__ */ x(fu, { pages: u.pages, pageIndex: D, maxWidth: m }), bt = {
7619
+ ) : /* @__PURE__ */ x(fu, { pages: u.pages, pageIndex: $, maxWidth: m }), bt = {
7613
7620
  width: "33.333%",
7614
7621
  height: "100%",
7615
7622
  flexShrink: 0,
@@ -7620,7 +7627,7 @@ function Lu() {
7620
7627
  boxSizing: "border-box",
7621
7628
  backfaceVisibility: "hidden",
7622
7629
  WebkitBackfaceVisibility: "hidden"
7623
- }, Vt = !P && (!S || R !== null);
7630
+ }, Vt = !P && (!S || _ !== null);
7624
7631
  return console.log("여기리랜더"), /* @__PURE__ */ X("div", { ref: y, style: { ...E, touchAction: "pan-y" }, ...pe, children: [
7625
7632
  /* @__PURE__ */ X(
7626
7633
  "div",
@@ -7638,7 +7645,7 @@ function Lu() {
7638
7645
  backfaceVisibility: "hidden",
7639
7646
  WebkitBackfaceVisibility: "hidden"
7640
7647
  },
7641
- onTransitionEnd: R ? $ : void 0,
7648
+ onTransitionEnd: _ ? V : void 0,
7642
7649
  children: [
7643
7650
  /* @__PURE__ */ x("div", { style: bt, children: Qe !== null && Je(Qe) }),
7644
7651
  /* @__PURE__ */ x("div", { style: bt, children: Je(k) }),
@@ -7714,7 +7721,7 @@ function Lu() {
7714
7721
  {
7715
7722
  pages: u.pages,
7716
7723
  items: p,
7717
- onGotoPage: I,
7724
+ onGotoPage: R,
7718
7725
  currentPageIndex: k,
7719
7726
  isOnExtraPage: ut
7720
7727
  }
@@ -7785,7 +7792,7 @@ const Du = "_Overlay_ybic8_3", $u = "_Dialog_ybic8_15", Vu = "_Body_ybic8_25", q
7785
7792
  StatSub: gd
7786
7793
  };
7787
7794
  function md(e) {
7788
- return e ? e.kind === "temp" ? e.blobUrl : e.cdnUrl : null;
7795
+ return e ? e.kind === "temp" ? e.image_blob_url : e.image_cdn_url : null;
7789
7796
  }
7790
7797
  function Wi(e) {
7791
7798
  var t;
@@ -7810,18 +7817,18 @@ const vd = Wt(function() {
7810
7817
  const p = r.map((M) => n[M]), f = p.length, u = p.reduce((M, B) => M + (B.score ?? 0), 0), T = p.reduce((M, B) => {
7811
7818
  const F = v[B.qid];
7812
7819
  return M + (F != null && F.isCorrect ? B.score ?? 0 : 0);
7813
- }, 0), k = p.map((M) => v[M.qid]).filter((M) => !!M), I = typeof a == "number" && typeof d == "number" ? Math.max(0, d - a) : k.reduce((M, B) => M + (B.ms ?? 0), 0), _ = f > 0 ? Math.round(I / f) : 0, h = [...k].sort((M, B) => M.ms - B.ms), S = h[0], C = h[h.length - 1], R = k.filter((M) => !M.multi), O = k.filter((M) => M.multi), P = R.filter((M) => M.isCorrect).length, w = O.filter((M) => M.isCorrect).length, E = k.filter((M) => M.timedOut).length, A = k.filter((M) => M.revealed).length, W = k.filter((M) => !M.isCorrect).sort((M, B) => B.ms - M.ms).slice(0, 3);
7820
+ }, 0), k = p.map((M) => v[M.qid]).filter((M) => !!M), R = typeof a == "number" && typeof d == "number" ? Math.max(0, d - a) : k.reduce((M, B) => M + (B.ms ?? 0), 0), C = f > 0 ? Math.round(R / f) : 0, h = [...k].sort((M, B) => M.ms - B.ms), S = h[0], I = h[h.length - 1], _ = k.filter((M) => !M.multi), O = k.filter((M) => M.multi), P = _.filter((M) => M.isCorrect).length, w = O.filter((M) => M.isCorrect).length, E = k.filter((M) => M.timedOut).length, A = k.filter((M) => M.revealed).length, W = k.filter((M) => !M.isCorrect).sort((M, B) => B.ms - M.ms).slice(0, 3);
7814
7821
  return {
7815
7822
  total: f,
7816
7823
  correct: s,
7817
7824
  rate: f ? Math.round(s / f * 100) : 0,
7818
- timeMsTotal: I,
7819
- avgMs: _,
7825
+ timeMsTotal: R,
7826
+ avgMs: C,
7820
7827
  totalScore: u,
7821
7828
  gainedScore: T,
7822
7829
  fastest: S,
7823
- slowest: C,
7824
- singles: { total: R.length, correct: P },
7830
+ slowest: I,
7831
+ singles: { total: _.length, correct: P },
7825
7832
  multis: { total: O.length, correct: w },
7826
7833
  timedOut: E,
7827
7834
  revealed: A,
@@ -7977,7 +7984,7 @@ function ar(e) {
7977
7984
  }
7978
7985
  function Do(e) {
7979
7986
  if (!e) return {};
7980
- const t = (e.quiz ?? []).slice().sort((n, r) => n.index - r.index);
7987
+ const t = (e.quizzes ?? []).slice().sort((n, r) => n.index - r.index);
7981
7988
  return {
7982
7989
  sectionId: e.section_id,
7983
7990
  quizzes: t,
@@ -8189,26 +8196,26 @@ function Cd({ children: e, initialState: t }) {
8189
8196
  if (s.phase !== "finished" && i.phase === "finished") {
8190
8197
  const c = r.current;
8191
8198
  if (!c) return;
8192
- const { sectionId: l, quizzes: a, order: d, perQ: v, startedAt: g, finishedAt: b } = i, m = d.map((_) => a[_]), y = m.length, p = m.filter((_) => {
8199
+ const { sectionId: l, quizzes: a, order: d, perQ: v, startedAt: g, finishedAt: b } = i, m = d.map((C) => a[C]), y = m.length, p = m.filter((C) => {
8193
8200
  var h;
8194
- return (h = v[_.qid]) == null ? void 0 : h.isCorrect;
8195
- }).length, f = m.reduce((_, h) => _ + (h.score ?? 0), 0), u = m.reduce((_, h) => {
8201
+ return (h = v[C.qid]) == null ? void 0 : h.isCorrect;
8202
+ }).length, f = m.reduce((C, h) => C + (h.score ?? 0), 0), u = m.reduce((C, h) => {
8196
8203
  const S = v[h.qid];
8197
- return _ + (S != null && S.isCorrect ? h.score ?? 0 : 0);
8198
- }, 0), T = typeof g == "number" && typeof b == "number" ? Math.max(0, b - g) : 0, k = m.map((_) => {
8199
- const h = v[_.qid];
8204
+ return C + (S != null && S.isCorrect ? h.score ?? 0 : 0);
8205
+ }, 0), T = typeof g == "number" && typeof b == "number" ? Math.max(0, b - g) : 0, k = m.map((C) => {
8206
+ const h = v[C.qid];
8200
8207
  return {
8201
- qid: _.qid,
8202
- index: _.index,
8203
- question: _.question,
8204
- score: _.score ?? 0,
8208
+ qid: C.qid,
8209
+ index: C.index,
8210
+ question: C.question,
8211
+ score: C.score ?? 0,
8205
8212
  isCorrect: (h == null ? void 0 : h.isCorrect) ?? !1,
8206
8213
  selected: (h == null ? void 0 : h.selected) ?? [],
8207
8214
  correctIdxes: (h == null ? void 0 : h.correctIdxes) ?? [],
8208
8215
  ms: (h == null ? void 0 : h.ms) ?? 0,
8209
8216
  timedOut: (h == null ? void 0 : h.timedOut) ?? !1
8210
8217
  };
8211
- }), I = {
8218
+ }), R = {
8212
8219
  sectionId: l ?? "",
8213
8220
  total: y,
8214
8221
  correct: p,
@@ -8218,7 +8225,7 @@ function Cd({ children: e, initialState: t }) {
8218
8225
  timeMsTotal: T,
8219
8226
  perQuestion: k
8220
8227
  };
8221
- c(I);
8228
+ c(R);
8222
8229
  }
8223
8230
  });
8224
8231
  return () => o();
@@ -8486,15 +8493,15 @@ const Rd = ({
8486
8493
  a({ x: y.width * f / 2, y: 80 });
8487
8494
  return;
8488
8495
  }
8489
- const T = u.getBoundingClientRect(), k = m.querySelector(`[data-g="${n}"]`), I = k == null ? void 0 : k.getBoundingClientRect();
8490
- let _ = (T.left + T.width / 2 - y.left) * f;
8491
- I && (_ = ((I.left + T.right) / 2 - y.left) * f);
8492
- const h = 160, S = 50, C = 16, R = 12, O = y.width * f, P = Math.max(
8493
- C + h / 2,
8494
- Math.min(_, O - C - h / 2)
8495
- ), w = (((I == null ? void 0 : I.top) ?? T.top) - y.top) * f - S - R;
8496
+ const T = u.getBoundingClientRect(), k = m.querySelector(`[data-g="${n}"]`), R = k == null ? void 0 : k.getBoundingClientRect();
8497
+ let C = (T.left + T.width / 2 - y.left) * f;
8498
+ R && (C = ((R.left + T.right) / 2 - y.left) * f);
8499
+ const h = 160, S = 50, I = 16, _ = 12, O = y.width * f, P = Math.max(
8500
+ I + h / 2,
8501
+ Math.min(C, O - I - h / 2)
8502
+ ), w = (((R == null ? void 0 : R.top) ?? T.top) - y.top) * f - S - _;
8496
8503
  let E = w;
8497
- w < C && (E = (T.bottom - y.top) * f + R), a({ x: P, y: E });
8504
+ w < I && (E = (T.bottom - y.top) * f + _), a({ x: P, y: E });
8498
8505
  };
8499
8506
  g();
8500
8507
  const b = e.current;
@@ -8579,20 +8586,20 @@ const Rd = ({
8579
8586
  const f = () => {
8580
8587
  const T = e.current;
8581
8588
  if (!T) return;
8582
- const k = T.getBoundingClientRect(), _ = 1 / (o.getState().playbackScale || 1), h = T.querySelector(`[data-g="${t}"]`), S = T.querySelector(`[data-g="${n}"]`);
8589
+ const k = T.getBoundingClientRect(), C = 1 / (o.getState().playbackScale || 1), h = T.querySelector(`[data-g="${t}"]`), S = T.querySelector(`[data-g="${n}"]`);
8583
8590
  if (h) {
8584
- const C = h.getBoundingClientRect();
8591
+ const I = h.getBoundingClientRect();
8585
8592
  c({
8586
- x: (C.left - k.left) * _,
8587
- y: (C.bottom - k.top) * _
8593
+ x: (I.left - k.left) * C,
8594
+ y: (I.bottom - k.top) * C
8588
8595
  });
8589
8596
  } else
8590
8597
  c(null);
8591
8598
  if (S) {
8592
- const C = S.getBoundingClientRect();
8599
+ const I = S.getBoundingClientRect();
8593
8600
  a({
8594
- x: (C.right - k.left) * _,
8595
- y: (C.bottom - k.top) * _
8601
+ x: (I.right - k.left) * C,
8602
+ y: (I.bottom - k.top) * C
8596
8603
  });
8597
8604
  } else
8598
8605
  a(null);
@@ -8606,10 +8613,10 @@ const Rd = ({
8606
8613
  const g = Z((f, u) => {
8607
8614
  var k;
8608
8615
  const T = document.elementsFromPoint(f, u);
8609
- for (const I of T) {
8610
- const _ = (k = I.getAttribute) == null ? void 0 : k.call(I, "data-g");
8611
- if (_ != null)
8612
- return parseInt(_, 10);
8616
+ for (const R of T) {
8617
+ const C = (k = R.getAttribute) == null ? void 0 : k.call(R, "data-g");
8618
+ if (C != null)
8619
+ return parseInt(C, 10);
8613
8620
  }
8614
8621
  return null;
8615
8622
  }, []), b = Z(
@@ -8782,7 +8789,7 @@ const Pd = ({ isOpen: e, onClose: t, text: n }) => e ? /* @__PURE__ */ x(
8782
8789
  )
8783
8790
  }
8784
8791
  ) : null, Bd = (e, t, n) => Math.min(n, Math.max(t, e));
8785
- function Nd({
8792
+ function qd({
8786
8793
  section: e,
8787
8794
  initialViewerState: t,
8788
8795
  initialProgressRunIndex: n,
@@ -8798,11 +8805,11 @@ function Nd({
8798
8805
  isDev: g = !1
8799
8806
  }) {
8800
8807
  const b = String((e == null ? void 0 : e.section_id) ?? "0"), m = ve(() => {
8801
- var k, I;
8808
+ var k, R;
8802
8809
  const u = ((k = e == null ? void 0 : e.ast) == null ? void 0 : k.blocks) ?? [];
8803
8810
  let T = 0;
8804
- for (const _ of u)
8805
- (_ == null ? void 0 : _.type) !== "image" && (T += ((I = _ == null ? void 0 : _.runs) == null ? void 0 : I.length) ?? 0);
8811
+ for (const C of u)
8812
+ (C == null ? void 0 : C.type) !== "image" && (T += ((R = C == null ? void 0 : C.runs) == null ? void 0 : R.length) ?? 0);
8806
8813
  return T;
8807
8814
  }, [e]), y = ve(() => typeof n == "number" ? Bd(n, m > 0 ? 0 : -1, Math.max(m - 1, -1)) : (m > 0, 0), [n, m]), p = ve(
8808
8815
  () => ({
@@ -8899,5 +8906,5 @@ function zd() {
8899
8906
  );
8900
8907
  }
8901
8908
  export {
8902
- Nd as CRViewer
8909
+ qd as CRViewer
8903
8910
  };