@paprize/react 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { jsx as b, jsxs as ue, Fragment as z } from "react/jsx-runtime";
2
- import Oe, { useInsertionEffect as pt, useRef as B, createElement as ft, createContext as ve, useReducer as gt, useEffect as Y, useDebugValue as ht, useCallback as mt, useContext as se, Children as vt, isValidElement as St, useMemo as T, useState as Be, useId as De } from "react";
1
+ import { jsx as b, jsxs as de, Fragment as z } from "react/jsx-runtime";
2
+ import Be, { useInsertionEffect as pt, useRef as B, createElement as ft, createContext as Se, useReducer as gt, useEffect as Y, useDebugValue as ht, useCallback as mt, useContext as Z, Children as vt, isValidElement as St, useMemo as T, useState as $e, useId as De } from "react";
3
3
  import { createPortal as _t } from "react-dom";
4
- function Se(e) {
4
+ function _e(e) {
5
5
  pt(() => {
6
6
  const t = document.createElement("style");
7
7
  return t.textContent = e, document.head.appendChild(t), () => t.remove();
@@ -43,41 +43,41 @@ const wt = `
43
43
  }
44
44
  `;
45
45
  function Gn({ children: e }) {
46
- return Se(wt), /* @__PURE__ */ b("div", { className: "paprize-preview", children: e });
46
+ return _e(wt), /* @__PURE__ */ b("div", { className: "paprize-preview", children: e });
47
47
  }
48
- const $ = {};
48
+ const M = {};
49
49
  function He(e, t) {
50
50
  return e.unstable_is ? e.unstable_is(t) : t === e;
51
51
  }
52
52
  function Me(e) {
53
53
  return "init" in e;
54
54
  }
55
- function de(e) {
55
+ function pe(e) {
56
56
  return !!e.write;
57
57
  }
58
- function Ne(e) {
58
+ function Ae(e) {
59
59
  return "v" in e || "e" in e;
60
60
  }
61
- function X(e) {
61
+ function Q(e) {
62
62
  if ("e" in e)
63
63
  throw e.e;
64
- if (($ ? "production" : void 0) !== "production" && !("v" in e))
64
+ if ((M ? "production" : void 0) !== "production" && !("v" in e))
65
65
  throw new Error("[Bug] atom state is not initialized");
66
66
  return e.v;
67
67
  }
68
- const Q = /* @__PURE__ */ new WeakMap();
69
- function $e(e) {
68
+ const ee = /* @__PURE__ */ new WeakMap();
69
+ function We(e) {
70
70
  var t;
71
- return ee(e) && !!((t = Q.get(e)) != null && t[0]);
71
+ return te(e) && !!((t = ee.get(e)) != null && t[0]);
72
72
  }
73
73
  function yt(e) {
74
- const t = Q.get(e);
74
+ const t = ee.get(e);
75
75
  t?.[0] && (t[0] = !1, t[1].forEach((n) => n()));
76
76
  }
77
- function pe(e, t) {
78
- let n = Q.get(e);
77
+ function fe(e, t) {
78
+ let n = ee.get(e);
79
79
  if (!n) {
80
- n = [!0, /* @__PURE__ */ new Set()], Q.set(e, n);
80
+ n = [!0, /* @__PURE__ */ new Set()], ee.set(e, n);
81
81
  const o = () => {
82
82
  n[0] = !1;
83
83
  };
@@ -85,17 +85,17 @@ function pe(e, t) {
85
85
  }
86
86
  n[1].add(t);
87
87
  }
88
- function ee(e) {
88
+ function te(e) {
89
89
  return typeof e?.then == "function";
90
90
  }
91
- function We(e, t, n) {
91
+ function Ve(e, t, n) {
92
92
  if (!n.p.has(e)) {
93
93
  n.p.add(e);
94
94
  const o = () => n.p.delete(e);
95
95
  t.then(o, o);
96
96
  }
97
97
  }
98
- function Ve(e, t, n) {
98
+ function Ue(e, t, n) {
99
99
  var o;
100
100
  const i = /* @__PURE__ */ new Set();
101
101
  for (const r of ((o = n.get(e)) == null ? void 0 : o.t) || [])
@@ -112,12 +112,12 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
112
112
  return (o = t.onMount) == null ? void 0 : o.call(t, n);
113
113
  }, Nt = (e, t) => {
114
114
  const n = A(e), o = n[0], i = n[9];
115
- if (($ ? "production" : void 0) !== "production" && !t)
115
+ if ((M ? "production" : void 0) !== "production" && !t)
116
116
  throw new Error("Atom is undefined or null");
117
117
  let r = o.get(t);
118
118
  return r || (r = { d: /* @__PURE__ */ new Map(), p: /* @__PURE__ */ new Set(), n: 0 }, o.set(t, r), i?.(e, t)), r;
119
119
  }, At = (e) => {
120
- const t = A(e), n = t[1], o = t[3], i = t[4], r = t[5], s = t[6], p = t[13], h = [], d = (l) => {
120
+ const t = A(e), n = t[1], o = t[3], i = t[4], r = t[5], s = t[6], d = t[13], h = [], p = (l) => {
121
121
  try {
122
122
  l();
123
123
  } catch (g) {
@@ -125,34 +125,34 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
125
125
  }
126
126
  };
127
127
  do {
128
- s.f && d(s.f);
128
+ s.f && p(s.f);
129
129
  const l = /* @__PURE__ */ new Set(), g = l.add.bind(l);
130
130
  o.forEach((v) => {
131
131
  var m;
132
132
  return (m = n.get(v)) == null ? void 0 : m.l.forEach(g);
133
- }), o.clear(), r.forEach(g), r.clear(), i.forEach(g), i.clear(), l.forEach(d), o.size && p(e);
133
+ }), o.clear(), r.forEach(g), r.clear(), i.forEach(g), i.clear(), l.forEach(p), o.size && d(e);
134
134
  } while (o.size || r.size || i.size);
135
135
  if (h.length)
136
136
  throw new AggregateError(h);
137
137
  }, Pt = (e) => {
138
- const t = A(e), n = t[1], o = t[2], i = t[3], r = t[11], s = t[14], p = t[17], h = [], d = /* @__PURE__ */ new WeakSet(), l = /* @__PURE__ */ new WeakSet(), g = Array.from(i);
138
+ const t = A(e), n = t[1], o = t[2], i = t[3], r = t[11], s = t[14], d = t[17], h = [], p = /* @__PURE__ */ new WeakSet(), l = /* @__PURE__ */ new WeakSet(), g = Array.from(i);
139
139
  for (; g.length; ) {
140
140
  const v = g[g.length - 1], m = r(e, v);
141
141
  if (l.has(v)) {
142
142
  g.pop();
143
143
  continue;
144
144
  }
145
- if (d.has(v)) {
145
+ if (p.has(v)) {
146
146
  if (o.get(v) === m.n)
147
147
  h.push([v, m]);
148
- else if (($ ? "production" : void 0) !== "production" && o.has(v))
148
+ else if ((M ? "production" : void 0) !== "production" && o.has(v))
149
149
  throw new Error("[Bug] invalidated atom exists");
150
150
  l.add(v), g.pop();
151
151
  continue;
152
152
  }
153
- d.add(v);
154
- for (const _ of Ve(v, m, n))
155
- d.has(_) || g.push(_);
153
+ p.add(v);
154
+ for (const _ of Ue(v, m, n))
155
+ p.has(_) || g.push(_);
156
156
  }
157
157
  for (let v = h.length - 1; v >= 0; --v) {
158
158
  const [m, _] = h[v];
@@ -162,12 +162,12 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
162
162
  a = !0;
163
163
  break;
164
164
  }
165
- a && (s(e, m), p(e, m)), o.delete(m);
165
+ a && (s(e, m), d(e, m)), o.delete(m);
166
166
  }
167
167
  }, xt = (e, t) => {
168
168
  var n;
169
- const o = A(e), i = o[1], r = o[2], s = o[3], p = o[6], h = o[7], d = o[11], l = o[12], g = o[13], v = o[14], m = o[16], _ = o[17], a = d(e, t);
170
- if (Ne(a) && (i.has(t) && r.get(t) !== a.n || Array.from(a.d).every(
169
+ const o = A(e), i = o[1], r = o[2], s = o[3], d = o[6], h = o[7], p = o[11], l = o[12], g = o[13], v = o[14], m = o[16], _ = o[17], a = p(e, t);
170
+ if (Ae(a) && (i.has(t) && r.get(t) !== a.n || Array.from(a.d).every(
171
171
  ([y, L]) => (
172
172
  // Recursively, read the atom state of the dependency, and
173
173
  // check if the atom epoch number is unchanged
@@ -183,19 +183,19 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
183
183
  function k(y) {
184
184
  var L;
185
185
  if (He(t, y)) {
186
- const R = d(e, y);
187
- if (!Ne(R))
186
+ const I = p(e, y);
187
+ if (!Ae(I))
188
188
  if (Me(y))
189
- te(e, y, y.init);
189
+ ne(e, y, y.init);
190
190
  else
191
191
  throw new Error("no atom init");
192
- return X(R);
192
+ return Q(I);
193
193
  }
194
194
  const P = v(e, y);
195
195
  try {
196
- return X(P);
196
+ return Q(P);
197
197
  } finally {
198
- a.d.set(y, P.n), $e(a.v) && We(t, a.v, P), (L = i.get(y)) == null || L.t.add(t), u || c();
198
+ a.d.set(y, P.n), We(a.v) && Ve(t, a.v, P), (L = i.get(y)) == null || L.t.add(t), u || c();
199
199
  }
200
200
  }
201
201
  let C, E;
@@ -204,8 +204,8 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
204
204
  return C || (C = new AbortController()), C.signal;
205
205
  },
206
206
  get setSelf() {
207
- return ($ ? "production" : void 0) !== "production" && !de(t) && console.warn("setSelf function cannot be used with read-only atom"), !E && de(t) && (E = (...y) => {
208
- if (($ ? "production" : void 0) !== "production" && u && console.warn("setSelf function cannot be called in sync"), !u)
207
+ return (M ? "production" : void 0) !== "production" && !pe(t) && console.warn("setSelf function cannot be used with read-only atom"), !E && pe(t) && (E = (...y) => {
208
+ if ((M ? "production" : void 0) !== "production" && u && console.warn("setSelf function cannot be called in sync"), !u)
209
209
  try {
210
210
  return m(e, t, ...y);
211
211
  } finally {
@@ -216,38 +216,38 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
216
216
  }, O = a.n;
217
217
  try {
218
218
  const y = h(e, t, k, w);
219
- return te(e, t, y), ee(y) && (pe(y, () => C?.abort()), y.then(c, c)), a;
219
+ return ne(e, t, y), te(y) && (fe(y, () => C?.abort()), y.then(c, c)), a;
220
220
  } catch (y) {
221
221
  return delete a.v, a.e = y, ++a.n, a;
222
222
  } finally {
223
- u = !1, O !== a.n && r.get(t) === O && (r.set(t, a.n), s.add(t), (n = p.c) == null || n.call(p, t));
223
+ u = !1, O !== a.n && r.get(t) === O && (r.set(t, a.n), s.add(t), (n = d.c) == null || n.call(d, t));
224
224
  }
225
225
  }, Tt = (e, t) => {
226
226
  const n = A(e), o = n[1], i = n[2], r = n[11], s = [t];
227
227
  for (; s.length; ) {
228
- const p = s.pop(), h = r(e, p);
229
- for (const d of Ve(p, h, o)) {
230
- const l = r(e, d);
231
- i.set(d, l.n), s.push(d);
228
+ const d = s.pop(), h = r(e, d);
229
+ for (const p of Ue(d, h, o)) {
230
+ const l = r(e, p);
231
+ i.set(p, l.n), s.push(p);
232
232
  }
233
233
  }
234
- }, Ue = (e, t, ...n) => {
235
- const o = A(e), i = o[3], r = o[6], s = o[8], p = o[11], h = o[12], d = o[13], l = o[14], g = o[15], v = o[17];
234
+ }, je = (e, t, ...n) => {
235
+ const o = A(e), i = o[3], r = o[6], s = o[8], d = o[11], h = o[12], p = o[13], l = o[14], g = o[15], v = o[17];
236
236
  let m = !0;
237
- const _ = (u) => X(l(e, u)), a = (u, ...c) => {
237
+ const _ = (u) => Q(l(e, u)), a = (u, ...c) => {
238
238
  var k;
239
- const C = p(e, u);
239
+ const C = d(e, u);
240
240
  try {
241
241
  if (He(t, u)) {
242
242
  if (!Me(u))
243
243
  throw new Error("atom not writable");
244
244
  const E = C.n, w = c[0];
245
- te(e, u, w), v(e, u), E !== C.n && (i.add(u), (k = r.c) == null || k.call(r, u), g(e, u));
245
+ ne(e, u, w), v(e, u), E !== C.n && (i.add(u), (k = r.c) == null || k.call(r, u), g(e, u));
246
246
  return;
247
247
  } else
248
- return Ue(e, u, ...c);
248
+ return je(e, u, ...c);
249
249
  } finally {
250
- m || (d(e), h(e));
250
+ m || (p(e), h(e));
251
251
  }
252
252
  };
253
253
  try {
@@ -257,12 +257,12 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
257
257
  }
258
258
  }, Lt = (e, t) => {
259
259
  var n;
260
- const o = A(e), i = o[1], r = o[3], s = o[6], p = o[11], h = o[15], d = o[18], l = o[19], g = p(e, t), v = i.get(t);
261
- if (v && !$e(g.v)) {
260
+ const o = A(e), i = o[1], r = o[3], s = o[6], d = o[11], h = o[15], p = o[18], l = o[19], g = d(e, t), v = i.get(t);
261
+ if (v && !We(g.v)) {
262
262
  for (const [m, _] of g.d)
263
263
  if (!v.d.has(m)) {
264
- const a = p(e, m);
265
- d(e, m).t.add(t), v.d.add(m), _ !== a.n && (r.add(m), (n = s.c) == null || n.call(s, m), h(e, m));
264
+ const a = d(e, m);
265
+ p(e, m).t.add(t), v.d.add(m), _ !== a.n && (r.add(m), (n = s.c) == null || n.call(s, m), h(e, m));
266
266
  }
267
267
  for (const m of v.d || [])
268
268
  if (!g.d.has(m)) {
@@ -271,30 +271,30 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
271
271
  _?.t.delete(t);
272
272
  }
273
273
  }
274
- }, je = (e, t) => {
274
+ }, Je = (e, t) => {
275
275
  var n;
276
- const o = A(e), i = o[1], r = o[4], s = o[6], p = o[10], h = o[11], d = o[12], l = o[13], g = o[14], v = o[16], m = h(e, t);
276
+ const o = A(e), i = o[1], r = o[4], s = o[6], d = o[10], h = o[11], p = o[12], l = o[13], g = o[14], v = o[16], m = h(e, t);
277
277
  let _ = i.get(t);
278
278
  if (!_) {
279
279
  g(e, t);
280
280
  for (const a of m.d.keys())
281
- je(e, a).t.add(t);
281
+ Je(e, a).t.add(t);
282
282
  if (_ = {
283
283
  l: /* @__PURE__ */ new Set(),
284
284
  d: new Set(m.d.keys()),
285
285
  t: /* @__PURE__ */ new Set()
286
- }, i.set(t, _), (n = s.m) == null || n.call(s, t), de(t)) {
286
+ }, i.set(t, _), (n = s.m) == null || n.call(s, t), pe(t)) {
287
287
  const a = () => {
288
288
  let u = !0;
289
289
  const c = (...k) => {
290
290
  try {
291
291
  return v(e, t, ...k);
292
292
  } finally {
293
- u || (l(e), d(e));
293
+ u || (l(e), p(e));
294
294
  }
295
295
  };
296
296
  try {
297
- const k = p(e, t, c);
297
+ const k = d(e, t, c);
298
298
  k && (_.u = () => {
299
299
  u = !0;
300
300
  try {
@@ -311,35 +311,35 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
311
311
  }
312
312
  }
313
313
  return _;
314
- }, Rt = (e, t) => {
314
+ }, It = (e, t) => {
315
315
  var n;
316
- const o = A(e), i = o[1], r = o[5], s = o[6], p = o[11], h = o[19], d = p(e, t);
316
+ const o = A(e), i = o[1], r = o[5], s = o[6], d = o[11], h = o[19], p = d(e, t);
317
317
  let l = i.get(t);
318
318
  if (l && !l.l.size && !Array.from(l.t).some((g) => {
319
319
  var v;
320
320
  return (v = i.get(g)) == null ? void 0 : v.d.has(t);
321
321
  })) {
322
322
  l.u && r.add(l.u), l = void 0, i.delete(t), (n = s.u) == null || n.call(s, t);
323
- for (const g of d.d.keys()) {
323
+ for (const g of p.d.keys()) {
324
324
  const v = h(e, g);
325
325
  v?.t.delete(t);
326
326
  }
327
327
  return;
328
328
  }
329
329
  return l;
330
- }, te = (e, t, n) => {
330
+ }, ne = (e, t, n) => {
331
331
  const o = A(e)[11], i = o(e, t), r = "v" in i, s = i.v;
332
- if (ee(n))
333
- for (const p of i.d.keys())
334
- We(
332
+ if (te(n))
333
+ for (const d of i.d.keys())
334
+ Ve(
335
335
  t,
336
336
  n,
337
- o(e, p)
337
+ o(e, d)
338
338
  );
339
- i.v = n, delete i.e, (!r || !Object.is(s, i.v)) && (++i.n, ee(s) && yt(s));
340
- }, It = (e, t) => {
339
+ i.v = n, delete i.e, (!r || !Object.is(s, i.v)) && (++i.n, te(s) && yt(s));
340
+ }, Rt = (e, t) => {
341
341
  const n = A(e)[14];
342
- return X(n(e, t));
342
+ return Q(n(e, t));
343
343
  }, Ft = (e, t, ...n) => {
344
344
  const o = A(e), i = o[12], r = o[13], s = o[16];
345
345
  try {
@@ -352,10 +352,10 @@ const bt = (e, t, ...n) => t.read(...n), kt = (e, t, ...n) => t.write(...n), Et
352
352
  return h.add(n), i(e), () => {
353
353
  h.delete(n), s(e, t), i(e);
354
354
  };
355
- }, Je = /* @__PURE__ */ new WeakMap();
355
+ }, Ge = /* @__PURE__ */ new WeakMap();
356
356
  function A(e) {
357
- const t = Je.get(e);
358
- if (($ ? "production" : void 0) !== "production" && !t)
357
+ const t = Ge.get(e);
358
+ if ((M ? "production" : void 0) !== "production" && !t)
359
359
  throw new Error(
360
360
  "Store must be created by buildStore to read its building blocks"
361
361
  );
@@ -402,65 +402,65 @@ function Ot(...e) {
402
402
  Pt,
403
403
  xt,
404
404
  Tt,
405
- Ue,
406
- Lt,
407
405
  je,
408
- Rt,
409
- te,
406
+ Lt,
407
+ Je,
410
408
  It,
409
+ ne,
410
+ Rt,
411
411
  Ft,
412
412
  zt
413
413
  ].map((o, i) => e[i] || o);
414
- return Je.set(t, Object.freeze(n)), t;
414
+ return Ge.set(t, Object.freeze(n)), t;
415
415
  }
416
- const Ge = {};
416
+ const Ye = {};
417
417
  let Bt = 0;
418
- function Z(e, t) {
418
+ function X(e, t) {
419
419
  const n = `atom${++Bt}`, o = {
420
420
  toString() {
421
- return (Ge ? "production" : void 0) !== "production" && this.debugLabel ? n + ":" + this.debugLabel : n;
421
+ return (Ye ? "production" : void 0) !== "production" && this.debugLabel ? n + ":" + this.debugLabel : n;
422
422
  }
423
423
  };
424
- return typeof e == "function" ? o.read = e : (o.init = e, o.read = Dt, o.write = Ht), t && (o.write = t), o;
424
+ return typeof e == "function" ? o.read = e : (o.init = e, o.read = $t, o.write = Dt), t && (o.write = t), o;
425
425
  }
426
- function Dt(e) {
426
+ function $t(e) {
427
427
  return e(this);
428
428
  }
429
- function Ht(e, t, n) {
429
+ function Dt(e, t, n) {
430
430
  return t(
431
431
  this,
432
432
  typeof n == "function" ? n(e(this)) : n
433
433
  );
434
434
  }
435
- function _e() {
435
+ function we() {
436
436
  return Ot();
437
437
  }
438
438
  let j;
439
- function Mt() {
440
- return j || (j = _e(), (Ge ? "production" : void 0) !== "production" && (globalThis.__JOTAI_DEFAULT_STORE__ || (globalThis.__JOTAI_DEFAULT_STORE__ = j), globalThis.__JOTAI_DEFAULT_STORE__ !== j && console.warn(
439
+ function Ht() {
440
+ return j || (j = we(), (Ye ? "production" : void 0) !== "production" && (globalThis.__JOTAI_DEFAULT_STORE__ || (globalThis.__JOTAI_DEFAULT_STORE__ = j), globalThis.__JOTAI_DEFAULT_STORE__ !== j && console.warn(
441
441
  "Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"
442
442
  ))), j;
443
443
  }
444
- const $t = {}, Ye = ve(
444
+ const Mt = {}, qe = Se(
445
445
  void 0
446
446
  );
447
- function qe(e) {
448
- return se(Ye) || Mt();
447
+ function Ze(e) {
448
+ return Z(qe) || Ht();
449
449
  }
450
450
  function Wt({
451
451
  children: e,
452
452
  store: t
453
453
  }) {
454
454
  const n = B(void 0);
455
- return !t && !n.current && (n.current = _e()), ft(
456
- Ye.Provider,
455
+ return !t && !n.current && (n.current = we()), ft(
456
+ qe.Provider,
457
457
  {
458
458
  value: t || n.current
459
459
  },
460
460
  e
461
461
  );
462
462
  }
463
- const fe = (e) => typeof e?.then == "function", ge = (e) => {
463
+ const ge = (e) => typeof e?.then == "function", he = (e) => {
464
464
  e.status || (e.status = "pending", e.then(
465
465
  (t) => {
466
466
  e.status = "fulfilled", e.value = t;
@@ -469,34 +469,34 @@ const fe = (e) => typeof e?.then == "function", ge = (e) => {
469
469
  e.status = "rejected", e.reason = t;
470
470
  }
471
471
  ));
472
- }, Vt = Oe.use || // A shim for older React versions
472
+ }, Vt = Be.use || // A shim for older React versions
473
473
  ((e) => {
474
474
  if (e.status === "pending")
475
475
  throw e;
476
476
  if (e.status === "fulfilled")
477
477
  return e.value;
478
- throw e.status === "rejected" ? e.reason : (ge(e), e);
479
- }), ae = /* @__PURE__ */ new WeakMap(), Ae = (e, t) => {
480
- let n = ae.get(e);
478
+ throw e.status === "rejected" ? e.reason : (he(e), e);
479
+ }), ce = /* @__PURE__ */ new WeakMap(), Pe = (e, t) => {
480
+ let n = ce.get(e);
481
481
  return n || (n = new Promise((o, i) => {
482
482
  let r = e;
483
- const s = (d) => (l) => {
484
- r === d && o(l);
485
- }, p = (d) => (l) => {
486
- r === d && i(l);
483
+ const s = (p) => (l) => {
484
+ r === p && o(l);
485
+ }, d = (p) => (l) => {
486
+ r === p && i(l);
487
487
  }, h = () => {
488
488
  try {
489
- const d = t();
490
- fe(d) ? (ae.set(d, n), r = d, d.then(s(d), p(d)), pe(d, h)) : o(d);
491
- } catch (d) {
492
- i(d);
489
+ const p = t();
490
+ ge(p) ? (ce.set(p, n), r = p, p.then(s(p), d(p)), fe(p, h)) : o(p);
491
+ } catch (p) {
492
+ i(p);
493
493
  }
494
494
  };
495
- e.then(s(e), p(e)), pe(e, h);
496
- }), ae.set(e, n)), n;
495
+ e.then(s(e), d(e)), fe(e, h);
496
+ }), ce.set(e, n)), n;
497
497
  };
498
- function ne(e, t) {
499
- const { delay: n, unstable_promiseStatus: o = !Oe.use } = {}, i = qe(), [[r, s, p], h] = gt(
498
+ function oe(e, t) {
499
+ const { delay: n, unstable_promiseStatus: o = !Be.use } = {}, i = Ze(), [[r, s, d], h] = gt(
500
500
  (l) => {
501
501
  const g = i.get(e);
502
502
  return Object.is(l[0], g) && l[1] === i && l[2] === e ? l : [g, i, e];
@@ -504,14 +504,14 @@ function ne(e, t) {
504
504
  void 0,
505
505
  () => [i.get(e), i, e]
506
506
  );
507
- let d = r;
508
- if ((s !== i || p !== e) && (h(), d = i.get(e)), Y(() => {
507
+ let p = r;
508
+ if ((s !== i || d !== e) && (h(), p = i.get(e)), Y(() => {
509
509
  const l = i.sub(e, () => {
510
510
  if (o)
511
511
  try {
512
512
  const g = i.get(e);
513
- fe(g) && ge(
514
- Ae(g, () => i.get(e))
513
+ ge(g) && he(
514
+ Pe(g, () => i.get(e))
515
515
  );
516
516
  } catch {
517
517
  }
@@ -522,36 +522,36 @@ function ne(e, t) {
522
522
  h();
523
523
  });
524
524
  return h(), l;
525
- }, [i, e, n, o]), ht(d), fe(d)) {
526
- const l = Ae(d, () => i.get(e));
527
- return o && ge(l), Vt(l);
525
+ }, [i, e, n, o]), ht(p), ge(p)) {
526
+ const l = Pe(p, () => i.get(e));
527
+ return o && he(l), Vt(l);
528
528
  }
529
- return d;
529
+ return p;
530
530
  }
531
- function we(e, t) {
532
- const n = qe();
531
+ function ye(e, t) {
532
+ const n = Ze();
533
533
  return mt(
534
534
  (...i) => {
535
- if (($t ? "production" : void 0) !== "production" && !("write" in e))
535
+ if ((Mt ? "production" : void 0) !== "production" && !("write" in e))
536
536
  throw new Error("not writable atom");
537
537
  return n.set(e, ...i);
538
538
  },
539
539
  [n, e]
540
540
  );
541
541
  }
542
- const Ut = "__PAPRIZE_IS_READY", jt = "__PAPRIZE_READ_JSON_DATA_FILE", Jt = _e(), Gt = {
542
+ const Ut = "__PAPRIZE_IS_READY", jt = "__PAPRIZE_READ_JSON_DATA_FILE", Jt = we(), Gt = {
543
543
  totalPages: 0,
544
544
  isPaginated: !1,
545
545
  pendingSuspensions: /* @__PURE__ */ new Set()
546
- }, V = Z(/* @__PURE__ */ new Map());
546
+ }, V = X(/* @__PURE__ */ new Map());
547
547
  V.debugLabel = "sectionsAtom";
548
- const ye = Z({
548
+ const be = X({
549
549
  totalSections: 0,
550
550
  isPaginated: !1
551
551
  });
552
- ye.debugLabel = "reportAtom";
552
+ be.debugLabel = "reportAtom";
553
553
  function Yt() {
554
- const e = we(ye), t = ne(V);
554
+ const e = ye(be), t = oe(V);
555
555
  return Y(() => {
556
556
  const n = t.size, o = Array.from(t.values()).every(
557
557
  (i) => i.isPaginated
@@ -579,20 +579,17 @@ const qt = `
579
579
  }
580
580
  `;
581
581
  function Yn({ children: e }) {
582
- return Se(qt), /* @__PURE__ */ ue(Wt, { store: Jt, children: [
582
+ return _e(qt), /* @__PURE__ */ de(Wt, { store: Jt, children: [
583
583
  e,
584
584
  /* @__PURE__ */ b(Yt, {})
585
585
  ] });
586
586
  }
587
- function Ze({ children: e }) {
587
+ function Xe({ children: e }) {
588
588
  return /* @__PURE__ */ b(z, { children: e });
589
589
  }
590
590
  function Ke({ children: e }) {
591
591
  return /* @__PURE__ */ b(z, { children: e });
592
592
  }
593
- function Xe({ children: e }) {
594
- return /* @__PURE__ */ b(z, { children: e });
595
- }
596
593
  function Qe({ children: e }) {
597
594
  return /* @__PURE__ */ b(z, { children: e });
598
595
  }
@@ -602,15 +599,18 @@ function et({ children: e }) {
602
599
  function tt({ children: e }) {
603
600
  return /* @__PURE__ */ b(z, { children: e });
604
601
  }
602
+ function nt({ children: e }) {
603
+ return /* @__PURE__ */ b(z, { children: e });
604
+ }
605
605
  function Zt(e) {
606
606
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
607
607
  }
608
- var K = { exports: {} }, Kt = K.exports, Pe;
609
- function Xt() {
610
- return Pe || (Pe = 1, (function(e) {
608
+ var K = { exports: {} }, Xt = K.exports, xe;
609
+ function Kt() {
610
+ return xe || (xe = 1, (function(e) {
611
611
  (function(t, n) {
612
612
  e.exports ? e.exports = n() : t.log = n();
613
- })(Kt, function() {
613
+ })(Xt, function() {
614
614
  var t = function() {
615
615
  }, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), i = [
616
616
  "trace",
@@ -619,7 +619,7 @@ function Xt() {
619
619
  "warn",
620
620
  "error"
621
621
  ], r = {}, s = null;
622
- function p(a, u) {
622
+ function d(a, u) {
623
623
  var c = a[u];
624
624
  if (typeof c.bind == "function")
625
625
  return c.bind(a);
@@ -634,8 +634,8 @@ function Xt() {
634
634
  function h() {
635
635
  console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
636
636
  }
637
- function d(a) {
638
- return a === "debug" && (a = "log"), typeof console === n ? !1 : a === "trace" && o ? h : console[a] !== void 0 ? p(console, a) : console.log !== void 0 ? p(console, "log") : t;
637
+ function p(a) {
638
+ return a === "debug" && (a = "log"), typeof console === n ? !1 : a === "trace" && o ? h : console[a] !== void 0 ? d(console, a) : console.log !== void 0 ? d(console, "log") : t;
639
639
  }
640
640
  function l() {
641
641
  for (var a = this.getLevel(), u = 0; u < i.length; u++) {
@@ -651,7 +651,7 @@ function Xt() {
651
651
  };
652
652
  }
653
653
  function v(a, u, c) {
654
- return d(a) || g.apply(this, arguments);
654
+ return p(a) || g.apply(this, arguments);
655
655
  }
656
656
  function m(a, u) {
657
657
  var c = this, k, C, E, w = "loglevel";
@@ -679,9 +679,9 @@ function Xt() {
679
679
  }
680
680
  if (typeof f === n)
681
681
  try {
682
- var S = window.document.cookie, I = encodeURIComponent(w), U = S.indexOf(I + "=");
682
+ var S = window.document.cookie, R = encodeURIComponent(w), U = S.indexOf(R + "=");
683
683
  U !== -1 && (f = /^([^;]+)/.exec(
684
- S.slice(U + I.length + 1)
684
+ S.slice(U + R.length + 1)
685
685
  )[1]);
686
686
  } catch {
687
687
  }
@@ -732,8 +732,8 @@ function Xt() {
732
732
  }, k = P(
733
733
  s ? s.getLevel() : "WARN"
734
734
  );
735
- var R = y();
736
- R != null && (E = P(R)), l.call(c);
735
+ var I = y();
736
+ I != null && (E = P(I)), l.call(c);
737
737
  }
738
738
  s = new m(), s.getLogger = function(u) {
739
739
  if (typeof u != "symbol" && typeof u != "string" || u === "")
@@ -753,14 +753,14 @@ function Xt() {
753
753
  });
754
754
  })(K)), K.exports;
755
755
  }
756
- var Qt = Xt();
757
- const F = /* @__PURE__ */ Zt(Qt), xe = [
758
- Ze,
756
+ var Qt = Kt();
757
+ const F = /* @__PURE__ */ Zt(Qt), Te = [
759
758
  Xe,
759
+ Qe,
760
760
  Ke,
761
+ nt,
761
762
  tt,
762
- et,
763
- Qe
763
+ et
764
764
  ];
765
765
  function en(e) {
766
766
  let t = null;
@@ -768,28 +768,28 @@ function en(e) {
768
768
  if (vt.forEach(e, (o) => {
769
769
  if (!St(o))
770
770
  throw F.error("Invalid React element found in children", { child: o }), new Error("Invalid React element found in children");
771
- const i = xe.find((r) => r === o.type);
771
+ const i = Te.find((r) => r === o.type);
772
772
  if (!i)
773
773
  throw Error(
774
- `Component "${o.type}" is not valid as a child for Section, Expected one of: ${xe.map((r) => r.name).join(",")}`
774
+ `Component "${o.type}" is not valid as a child for Section, Expected one of: ${Te.map((r) => r.name).join(",")}`
775
775
  );
776
776
  switch (i) {
777
- case et:
777
+ case tt:
778
778
  n.sectionHeader = o;
779
779
  break;
780
- case Qe:
780
+ case et:
781
781
  n.sectionFooter = o;
782
782
  break;
783
- case Ze:
783
+ case Xe:
784
784
  t = o;
785
785
  break;
786
- case Xe:
786
+ case Qe:
787
787
  n.header = o;
788
788
  break;
789
789
  case Ke:
790
790
  n.footer = o;
791
791
  break;
792
- case tt:
792
+ case nt:
793
793
  n.overlay = o;
794
794
  break;
795
795
  }
@@ -808,21 +808,21 @@ function nn(e, t) {
808
808
  height:${t.height};
809
809
  }`;
810
810
  }
811
- const on = "paprize", nt = "pz-temp-container", ot = "data-pz-";
811
+ const on = "paprize", ot = "pz-temp-container", ke = "data-pz-";
812
812
  function it(e) {
813
813
  return e.nodeType === Node.ELEMENT_NODE;
814
814
  }
815
815
  function rn(e) {
816
816
  return e.nodeType === Node.TEXT_NODE;
817
817
  }
818
- function oe(e) {
818
+ function ie(e) {
819
819
  const t = e.getBoundingClientRect(), n = getComputedStyle(e), o = parseFloat(n.marginTop) || 0, i = parseFloat(n.marginBottom) || 0;
820
820
  return t.height + o + i;
821
821
  }
822
822
  function sn(e) {
823
823
  e.style.visibility = "hidden", e.style.position = "absolute", e.style.left = "-9999px", e.style.top = "-9999px";
824
824
  }
825
- class D {
825
+ class $ {
826
826
  name;
827
827
  defaultValue;
828
828
  _reader;
@@ -833,20 +833,20 @@ class D {
833
833
  return this._reader(t);
834
834
  }
835
835
  static createStr(t, n) {
836
- return new D(t, (o) => o, n);
836
+ return new $(t, (o) => o, n);
837
837
  }
838
838
  static createBool(t, n) {
839
- return new D(
839
+ return new $(
840
840
  t,
841
841
  (o) => o === "true",
842
842
  n
843
843
  );
844
844
  }
845
845
  }
846
- const ie = {
847
- hyphen: D.createStr("hyphen", "-"),
848
- keepOnSamePage: D.createBool("keep-on-same-page", !1),
849
- hyphenationEnabled: D.createBool(
846
+ const re = {
847
+ hyphen: $.createStr("hyphen", "-"),
848
+ keepOnSamePage: $.createBool("keep-on-same-page", !1),
849
+ hyphenationEnabled: $.createBool(
850
850
  "hyphenation-enabled",
851
851
  !0
852
852
  )
@@ -856,32 +856,33 @@ function an(e) {
856
856
  for (const n in e) {
857
857
  const o = e[n];
858
858
  if (o !== void 0) {
859
- const i = ie[n];
860
- t[`${ot}${i.name}`] = String(o);
859
+ const i = re[n];
860
+ t[`${ke}${i.name}`] = String(o);
861
861
  }
862
862
  }
863
863
  return t;
864
864
  }
865
865
  const cn = Object.fromEntries(
866
- Object.entries(ie).map(([e, t]) => [
866
+ Object.entries(re).map(([e, t]) => [
867
867
  e,
868
868
  t.defaultValue
869
869
  ])
870
- ), Te = /* @__PURE__ */ new WeakMap();
870
+ ), Le = /* @__PURE__ */ new WeakMap();
871
871
  function rt(e) {
872
872
  if (!e)
873
873
  return {};
874
874
  if (!(e instanceof Element))
875
875
  return rt(e?.parentNode);
876
876
  const t = {};
877
- for (const i in ie) {
878
- const r = ie[i], s = `${ot}${r.name}`, p = e.getAttribute(s);
879
- p !== null && (t[i] = r.read(p));
877
+ for (const i in re) {
878
+ const r = re[i], s = `${ke}${r.name}`, d = e.getAttribute(s);
879
+ d !== null && (t[i] = r.read(d));
880
880
  }
881
- const o = { ...e.parentNode ? Te.get(e.parentNode) : void 0, ...t };
882
- return Te.set(e, o), o;
881
+ const o = { ...e.parentNode ? Le.get(e.parentNode) : void 0, ...t };
882
+ return Le.set(e, o), o;
883
883
  }
884
884
  const st = {
885
+ id: "default",
885
886
  plugins: [],
886
887
  ...cn
887
888
  };
@@ -891,25 +892,25 @@ function ln(e, t) {
891
892
  }
892
893
  const N = F.getLogger(on);
893
894
  N.setDefaultLevel("info");
894
- const ce = "\x1B[46mPLUGIN\x1B[0m";
895
- function H(e, t, ...n) {
896
- e.forEach((o) => {
895
+ const le = "\x1B[46mPLUGIN\x1B[0m";
896
+ function D(e, t, ...n) {
897
+ e.sort((o, i) => o.order - i.order).forEach((o) => {
897
898
  const i = o[t];
898
899
  if (i) {
899
900
  N.debug(
900
- ce,
901
- `executing plugin ${o.name}:${String(t)}`,
901
+ le,
902
+ `executing plugin ${o.name}:${String(t)} ()`,
902
903
  n
903
904
  );
904
905
  try {
905
906
  i(...n), N.debug(
906
- ce,
907
+ le,
907
908
  `plugin ${o.name}:${String(t)} executed`,
908
909
  n
909
910
  );
910
911
  } catch (r) {
911
912
  N.debug(
912
- ce,
913
+ le,
913
914
  `plugin ${o.name}:${String(t)} failed`,
914
915
  r
915
916
  );
@@ -921,7 +922,7 @@ const W = {
921
922
  Element: "element",
922
923
  Text: "text"
923
924
  };
924
- class be {
925
+ class Ee {
925
926
  _node;
926
927
  _transaction;
927
928
  type = W.Element;
@@ -935,20 +936,21 @@ class be {
935
936
  }), this._node.appendChild(t.getNode());
936
937
  }
937
938
  clone(t) {
938
- const n = this._node.cloneNode(t), o = new be(
939
+ const n = this._node.cloneNode(t), o = new Ee(
939
940
  n,
940
941
  this._transaction,
941
942
  this.config
942
943
  );
943
- return H(
944
+ return D(
944
945
  this.config.plugins,
945
946
  "onClone",
947
+ this.config.id,
946
948
  this._node,
947
949
  o
948
950
  ), o;
949
951
  }
950
952
  getHeight() {
951
- return oe(this._node);
953
+ return ie(this._node);
952
954
  }
953
955
  remove() {
954
956
  this._transaction.addCommitCallback(() => {
@@ -988,11 +990,11 @@ class un {
988
990
  return this._node;
989
991
  }
990
992
  }
991
- function he(e, t, n) {
993
+ function me(e, t, n) {
992
994
  if (rn(e))
993
995
  return new un(e, t, n);
994
996
  if (it(e))
995
- return new be(e, t, n);
997
+ return new Ee(e, t, n);
996
998
  throw new Error("Unsupported node type");
997
999
  }
998
1000
  const J = "\x1B[106mDOM\x1B[0m";
@@ -1038,7 +1040,7 @@ class dn {
1038
1040
  return this._treeWalker.firstChild() ? (N.debug(J, "moving to first child node"), this.setState(), { parentsTraversed: 1 }) : (this.nextNode(), { parentsTraversed: 0 });
1039
1041
  }
1040
1042
  setState() {
1041
- this._previousNode = this._currentNode, this._currentNode = he(
1043
+ this._previousNode = this._currentNode, this._currentNode = me(
1042
1044
  this._treeWalker.currentNode,
1043
1045
  this._transaction,
1044
1046
  ln(this._treeWalker.currentNode, this._config)
@@ -1077,7 +1079,7 @@ class pn {
1077
1079
  this.isActive && (this.isActive = !1, this._onCommit.forEach((t) => t()));
1078
1080
  };
1079
1081
  }
1080
- const Le = "\x1B[102mPAGE\x1B[0m";
1082
+ const Ie = "\x1B[102mPAGE\x1B[0m";
1081
1083
  class q {
1082
1084
  currentPage;
1083
1085
  activeElement;
@@ -1086,8 +1088,8 @@ class q {
1086
1088
  pageIsFull;
1087
1089
  pageIndex;
1088
1090
  pageHeight;
1089
- constructor(t, n, o, i, r, s, p) {
1090
- this.currentPage = t, this.activeElement = n, this.currentElement = o, this.parentStack = i, this.pageIsFull = r, this.pageIndex = s, this.pageHeight = p;
1091
+ constructor(t, n, o, i, r, s, d) {
1092
+ this.currentPage = t, this.activeElement = n, this.currentElement = o, this.parentStack = i, this.pageIsFull = r, this.pageIndex = s, this.pageHeight = d;
1091
1093
  }
1092
1094
  static create(t, n, o, i) {
1093
1095
  return new q(
@@ -1110,17 +1112,17 @@ class q {
1110
1112
  this.pageHeight
1111
1113
  );
1112
1114
  }
1113
- class ke {
1115
+ class Ce {
1114
1116
  _pageState;
1115
1117
  _transaction;
1116
1118
  _tempContainer;
1117
1119
  _config;
1118
1120
  constructor(t, n, o, i) {
1119
1121
  this._tempContainer = t, this._config = i, this._transaction = o;
1120
- const r = ke.createPageHtmlElement(
1122
+ const r = Ce.createPageHtmlElement(
1121
1123
  n.width
1122
1124
  ), s = this.createNewPage(r);
1123
- this._pageState = q.create(s, [], 0, n.height), H(this._config.plugins, "onNewPage", this._pageState);
1125
+ this._pageState = q.create(s, [], 0, n.height), D(this._config.plugins, "onNewPage", i.id, this);
1124
1126
  }
1125
1127
  nextPage() {
1126
1128
  const t = this.createNewPage(
@@ -1131,7 +1133,12 @@ class ke {
1131
1133
  this._pageState.pageIndex + 1,
1132
1134
  this._pageState.pageHeight
1133
1135
  );
1134
- this.cloneParentStackToNewPage(n), this.cleanupEmptyParent(), this._pageState = n, H(this._config.plugins, "onNewPage", this._pageState);
1136
+ this.cloneParentStackToNewPage(n), this.cleanupEmptyParent(), this._pageState = n, D(
1137
+ this._config.plugins,
1138
+ "onNewPage",
1139
+ this._config.id,
1140
+ this
1141
+ );
1135
1142
  }
1136
1143
  cloneParentStackToNewPage(t) {
1137
1144
  for (const n of this._pageState.parentStack) {
@@ -1152,7 +1159,7 @@ class ke {
1152
1159
  if (!this._pageState.activeElement || this._pageState.activeElement.type !== W.Element)
1153
1160
  throw new Error("Invalid state: activeElement is not an Element");
1154
1161
  N.debug(
1155
- Le,
1162
+ Ie,
1156
1163
  "entering an element",
1157
1164
  this._pageState.activeElement
1158
1165
  ), this._pageState.currentElement = this._pageState.activeElement, this._pageState.parentStack.push(this._pageState.activeElement);
@@ -1160,18 +1167,18 @@ class ke {
1160
1167
  leaveElement() {
1161
1168
  this._pageState.activeElement = null;
1162
1169
  const t = this._pageState.parentStack.pop();
1163
- N.debug(Le, "leaving a parent element", t);
1170
+ N.debug(Ie, "leaving a parent element", t);
1164
1171
  const n = this._pageState.parentStack.at(-1);
1165
1172
  this._pageState.currentElement = n ?? this._pageState.currentPage;
1166
1173
  }
1167
1174
  static createPageHtmlElement(t) {
1168
1175
  const n = document.createElement("div");
1169
- return n.style.display = "flex", n.style.flexDirection = "column", n.style.width = `${t}px`, n.style.maxWidth = `${t}px`, n;
1176
+ return n.style.width = `${t}px`, n.style.maxWidth = `${t}px`, n;
1170
1177
  }
1171
1178
  createNewPage(t) {
1172
1179
  return this._tempContainer.appendChild(t), this._transaction.isActive && this._transaction.addRollbackCallback(() => {
1173
1180
  this._tempContainer.removeChild(t);
1174
- }), he(t, this._transaction, this._config);
1181
+ }), me(t, this._transaction, this._config);
1175
1182
  }
1176
1183
  startTransaction() {
1177
1184
  this._transaction.start();
@@ -1181,7 +1188,7 @@ class ke {
1181
1188
  }), this._transaction;
1182
1189
  }
1183
1190
  hasEmptySpace(t) {
1184
- return !this._pageState.pageIsFull && this._pageState.currentPage.getHeight() + (t || 1) <= this._pageState.pageHeight;
1191
+ return !this._pageState.pageIsFull && this._pageState.currentPage.getHeight() + (t || 1e-4) <= this._pageState.pageHeight;
1185
1192
  }
1186
1193
  isOverFlow() {
1187
1194
  return this._pageState.currentPage.getHeight() > this._pageState.pageHeight;
@@ -1196,13 +1203,16 @@ class ke {
1196
1203
  addTextNode(t) {
1197
1204
  if (this._pageState.activeElement?.type === W.Text)
1198
1205
  return this._pageState.activeElement;
1199
- const n = document.createTextNode(t), o = he(
1206
+ const n = document.createTextNode(t), o = me(
1200
1207
  n,
1201
1208
  this._transaction,
1202
1209
  this._config
1203
1210
  );
1204
1211
  return this._pageState.currentElement.appendChild(o), this._pageState.activeElement = o, o;
1205
1212
  }
1213
+ getPageState() {
1214
+ return this._pageState;
1215
+ }
1206
1216
  }
1207
1217
  const x = {
1208
1218
  None: 0,
@@ -1239,8 +1249,8 @@ function gn(e, t) {
1239
1249
  const o = e.textContent.split(/(\s+)/).filter((s) => s !== "");
1240
1250
  let i, r = 0;
1241
1251
  for (; i || r < o.length; ) {
1242
- const s = i ?? o[r], p = hn(s, t, e.config);
1243
- p.completed || (n = x.None), p.pendingToken ? i = p.pendingToken : (i = void 0, r++);
1252
+ const s = i ?? o[r], d = hn(s, t, e.config);
1253
+ d.completed || (n = x.None), d.pendingToken ? i = d.pendingToken : (i = void 0, r++);
1244
1254
  }
1245
1255
  return n;
1246
1256
  }
@@ -1279,34 +1289,34 @@ function vn(e, t, n) {
1279
1289
  const o = n.addTextNode("");
1280
1290
  let i = "";
1281
1291
  for (let r = 0; r < e.length; r++) {
1282
- const s = e[r], p = i + s;
1283
- if (o.textContent = p + t, !n.hasEmptySpace())
1292
+ const s = e[r], d = i + s;
1293
+ if (o.textContent = d + t, !n.hasEmptySpace())
1284
1294
  return o.textContent = i ? i + t : "", n.markPageAsFull(), e.slice(r);
1285
- i = p;
1295
+ i = d;
1286
1296
  }
1287
1297
  return null;
1288
1298
  }
1289
1299
  const G = "\x1B[103mPAGINATOR\x1B[0m";
1290
- class re {
1300
+ class se {
1291
1301
  _domState;
1292
1302
  _pageManager;
1293
1303
  _transaction;
1294
1304
  _tempContainer;
1295
1305
  _config;
1296
1306
  constructor(t, n, o) {
1297
- this._config = { ...st, ...o }, this._tempContainer = re.createTempContainer(), this._transaction = new pn(), this._domState = new dn(t, this._transaction, this._config), this._pageManager = new ke(
1307
+ this._config = { ...st, ...o }, this._tempContainer = se.createTempContainer(this._config.id), this._transaction = new pn(), this._domState = new dn(t, this._transaction, this._config), this._pageManager = new Ce(
1298
1308
  this._tempContainer,
1299
1309
  n,
1300
1310
  this._transaction,
1301
1311
  this._config
1302
1312
  );
1303
1313
  }
1304
- static createTempContainer() {
1305
- const t = document.createElement("div");
1306
- return t.classList.add(nt), sn(t), document.body.appendChild(t), t;
1314
+ static createTempContainer(t) {
1315
+ const n = document.createElement("div");
1316
+ return n.style.display = "flex", n.style.flexDirection = "column", n.style.gap = "20px", n.setAttribute(`${ke}-section-id`, t), n.classList.add(ot), sn(n), document.body.appendChild(n), n;
1307
1317
  }
1308
1318
  static paginate(t, n, o) {
1309
- const i = new re(t, n, o);
1319
+ const i = new se(t, n, o);
1310
1320
  i.processAllNodes();
1311
1321
  const r = Array.from(i._tempContainer.childNodes).filter((s) => it(s)).map((s) => s.innerHTML);
1312
1322
  return i._tempContainer.remove(), r;
@@ -1329,9 +1339,10 @@ class re {
1329
1339
  this.handleChildrenSplit();
1330
1340
  break;
1331
1341
  }
1332
- H(
1342
+ D(
1333
1343
  this._config.plugins,
1334
1344
  "afterVisitNode",
1345
+ this._config.id,
1335
1346
  this._domState,
1336
1347
  this._pageManager
1337
1348
  );
@@ -1358,9 +1369,10 @@ class re {
1358
1369
  return x.None;
1359
1370
  if (this._domState.currentNode.type === W.Element) {
1360
1371
  const t = {};
1361
- return H(
1372
+ return D(
1362
1373
  this._config.plugins,
1363
1374
  "onVisitElement",
1375
+ this._config.id,
1364
1376
  this._domState,
1365
1377
  this._pageManager,
1366
1378
  t
@@ -1370,9 +1382,10 @@ class re {
1370
1382
  );
1371
1383
  } else {
1372
1384
  const t = {};
1373
- return H(
1385
+ return D(
1374
1386
  this._config.plugins,
1375
1387
  "onVisitText",
1388
+ this._config.id,
1376
1389
  this._domState,
1377
1390
  this._pageManager,
1378
1391
  t
@@ -1385,10 +1398,11 @@ class re {
1385
1398
  }
1386
1399
  const at = "data-pz-page-break", Sn = "pageBreak", _n = {
1387
1400
  name: Sn,
1388
- onVisitElement: (e, t, n) => {
1389
- e.currentNode.getNode().getAttribute(at) === "true" && (t.markPageAsFull(), n.result = x.FullNodePlaced);
1401
+ order: 1,
1402
+ onVisitElement: (e, t, n, o) => {
1403
+ t.currentNode.getNode().getAttribute(at) === "true" && (n.markPageAsFull(), o.result = x.FullNodePlaced);
1390
1404
  }
1391
- }, wn = [_n], ct = ve({
1405
+ }, wn = [_n], ct = Se({
1392
1406
  pageNumber: 0,
1393
1407
  totalPages: 0
1394
1408
  });
@@ -1398,11 +1412,12 @@ function yn(e) {
1398
1412
  function bn(e) {
1399
1413
  const t = e.getBoundingClientRect(), n = getComputedStyle(e), o = parseFloat(n.marginLeft) || 0, i = parseFloat(n.marginRight) || 0;
1400
1414
  return {
1401
- height: oe(e),
1415
+ height: ie(e),
1402
1416
  width: t.width + o + i
1403
1417
  };
1404
1418
  }
1405
- function Ie({
1419
+ const ae = Se("");
1420
+ function Fe({
1406
1421
  elements: e,
1407
1422
  dimensions: t,
1408
1423
  margin: n,
@@ -1410,16 +1425,17 @@ function Ie({
1410
1425
  totalPages: i,
1411
1426
  ref: r,
1412
1427
  sectionHeaderRef: s,
1413
- sectionFooterRef: p,
1428
+ sectionFooterRef: d,
1414
1429
  contentRef: h
1415
1430
  }) {
1416
- const d = T(
1431
+ const p = Z(ae), l = T(
1417
1432
  () => ({ pageNumber: o, totalPages: i }),
1418
1433
  [o, i]
1419
1434
  );
1420
- return /* @__PURE__ */ b(ct, { value: d, children: /* @__PURE__ */ ue(
1435
+ return /* @__PURE__ */ b(ct, { value: l, children: /* @__PURE__ */ de(
1421
1436
  "div",
1422
1437
  {
1438
+ id: `${p}-${o}`,
1423
1439
  className: "paprize-page paprize-page-component",
1424
1440
  ref: r,
1425
1441
  style: {
@@ -1444,7 +1460,9 @@ function Ie({
1444
1460
  "div",
1445
1461
  {
1446
1462
  style: {
1447
- overflow: "hidden"
1463
+ overflow: "hidden",
1464
+ width: "100%",
1465
+ height: "100%"
1448
1466
  },
1449
1467
  ref: h,
1450
1468
  children: e.content
@@ -1463,7 +1481,7 @@ function Ie({
1463
1481
  children: e.overlay
1464
1482
  }
1465
1483
  ),
1466
- (e.footer || e.sectionFooter) && /* @__PURE__ */ ue(
1484
+ (e.footer || e.sectionFooter) && /* @__PURE__ */ de(
1467
1485
  "div",
1468
1486
  {
1469
1487
  className: "paprize-page-component",
@@ -1474,7 +1492,7 @@ function Ie({
1474
1492
  "div",
1475
1493
  {
1476
1494
  className: "paprize-page-component",
1477
- ref: p,
1495
+ ref: d,
1478
1496
  children: e.sectionFooter
1479
1497
  }
1480
1498
  )
@@ -1486,35 +1504,36 @@ function Ie({
1486
1504
  ) });
1487
1505
  }
1488
1506
  function kn(e, t, n) {
1489
- const { height: o, width: i } = bn(e), r = t ? oe(t) : 0, s = n ? oe(n) : 0;
1507
+ const { height: o, width: i } = bn(e), r = t ? ie(t) : 0, s = n ? ie(n) : 0;
1490
1508
  return { height: o, width: i, sectionHeaderHeight: r, sectionFooterHeight: s };
1491
1509
  }
1492
1510
  function En(e, t, n) {
1493
1511
  return {
1494
1512
  name: "sectionPageHeight",
1495
- afterVisitNode: (o, i) => {
1496
- !o.completed || n <= 0 || i.hasEmptySpace(n) || i.nextPage();
1513
+ order: 1,
1514
+ afterVisitNode: (o, i, r) => {
1515
+ !i.completed || n <= 0 || r.hasEmptySpace(n) || r.nextPage();
1497
1516
  },
1498
- onNewPage: (o) => {
1499
- o.pageIndex === 0 ? o.pageHeight = e + n : o.pageHeight = e + t + n;
1517
+ onNewPage: (o, i) => {
1518
+ const r = i.getPageState();
1519
+ r.pageIndex === 0 ? r.pageHeight = e + n : r.pageHeight = e + t + n;
1500
1520
  }
1501
1521
  };
1502
1522
  }
1503
- const Ee = ve("");
1504
1523
  function Cn(e, t) {
1505
1524
  const n = T(
1506
- () => Z(null, (o, i, ...r) => e(o, i, ...r)),
1525
+ () => X(null, (o, i, ...r) => e(o, i, ...r)),
1507
1526
  [e]
1508
1527
  );
1509
- return we(n);
1528
+ return ye(n);
1510
1529
  }
1511
1530
  const Nn = {
1512
1531
  totalPages: 0,
1513
1532
  isPaginated: !1,
1514
1533
  pendingSuspensions: 0
1515
1534
  }, lt = () => {
1516
- const e = se(Ee), t = T(
1517
- () => Z((o) => {
1535
+ const e = Z(ae), t = T(
1536
+ () => X((o) => {
1518
1537
  const i = o(V).get(e);
1519
1538
  return i ? {
1520
1539
  totalPages: i.totalPages,
@@ -1523,18 +1542,18 @@ const Nn = {
1523
1542
  } : Nn;
1524
1543
  }),
1525
1544
  [e]
1526
- ), n = ne(t);
1545
+ ), n = oe(t);
1527
1546
  return {
1528
- sectionName: e,
1547
+ sectionId: e,
1529
1548
  totalPages: n.totalPages
1530
1549
  };
1531
1550
  };
1532
1551
  function An(e) {
1533
1552
  return lt(), Cn((n) => (n(V).get(e)?.pendingSuspensions?.size ?? 0) > 0);
1534
1553
  }
1535
- const Ce = (e) => {
1554
+ const Ne = (e) => {
1536
1555
  const t = T(
1537
- () => Z(
1556
+ () => X(
1538
1557
  () => 0,
1539
1558
  (n, o, i) => {
1540
1559
  o(
@@ -1548,44 +1567,44 @@ const Ce = (e) => {
1548
1567
  ),
1549
1568
  [e]
1550
1569
  );
1551
- return we(t);
1552
- }, le = "\x1B[41mREACT\x1B[0m", Fe = (e, t, n, o, i) => e?.dimensions === n && e?.margin === o && e?.elements === t && e?.config === i && e?.elements === t;
1570
+ return ye(t);
1571
+ }, ue = "\x1B[41mREACT\x1B[0m", ze = (e, t, n, o, i) => e?.dimensions === n && e?.margin === o && e?.elements === t && e?.config === i && e?.elements === t;
1553
1572
  function Pn(e, t, n, o) {
1554
- const i = se(Ee), r = An(i), s = Ce(i), p = B(null), [h, d] = Be({
1573
+ const i = Z(ae), r = An(i), s = Ne(i), d = B(null), [h, p] = $e({
1555
1574
  results: null,
1556
1575
  isLoading: !0
1557
1576
  }), l = B(null), g = B(null), v = B(null), m = B(null);
1558
1577
  return Y(() => {
1559
- Fe(
1560
- p.current,
1578
+ ze(
1579
+ d.current,
1561
1580
  e,
1562
1581
  t,
1563
1582
  n,
1564
1583
  o
1565
- ) || d({
1584
+ ) || p({
1566
1585
  results: null,
1567
1586
  isLoading: !0
1568
1587
  });
1569
1588
  }, [t, e, n, o]), Y(() => {
1570
- if (!l.current || !m.current || Fe(p.current, e, t, n, o))
1589
+ if (!l.current || !m.current || ze(d.current, e, t, n, o))
1571
1590
  return;
1572
1591
  if (r()) {
1573
- N.info(le, `Section "${i}" is suspended`);
1592
+ N.info(ue, `Section "${i}" is suspended`);
1574
1593
  return;
1575
1594
  }
1576
1595
  const { height: _, width: a, sectionFooterHeight: u, sectionHeaderHeight: c } = kn(
1577
1596
  m.current,
1578
1597
  g.current,
1579
1598
  v.current
1580
- ), k = o?.plugins.length ? o.plugins : [
1581
- ...wn,
1599
+ ), k = [
1600
+ ...o.plugins ?? wn,
1582
1601
  En(
1583
1602
  _,
1584
1603
  c,
1585
1604
  u
1586
1605
  )
1587
1606
  ];
1588
- N.debug(le, "Calling Paginator", {
1607
+ N.debug(ue, "Calling Paginator", {
1589
1608
  sectionName: i,
1590
1609
  height: _,
1591
1610
  width: a,
@@ -1593,22 +1612,22 @@ function Pn(e, t, n, o) {
1593
1612
  sectionHeaderHeight: c,
1594
1613
  plugins: k
1595
1614
  });
1596
- const C = re.paginate(
1615
+ const C = se.paginate(
1597
1616
  m.current,
1598
1617
  { height: _, width: a },
1599
1618
  { ...o, plugins: k }
1600
1619
  );
1601
- N.debug(le, "Paginator Result", {
1620
+ N.debug(ue, "Paginator Result", {
1602
1621
  sectionName: i,
1603
1622
  paginatorResult: C
1604
- }), d({
1623
+ }), p({
1605
1624
  results: C,
1606
1625
  isLoading: !1
1607
1626
  }), s((E) => ({
1608
1627
  ...E,
1609
1628
  totalPages: C.length,
1610
1629
  isPaginated: !0
1611
- })), p.current = { elements: e, dimensions: t, margin: n, config: o };
1630
+ })), d.current = { elements: e, dimensions: t, margin: n, config: o };
1612
1631
  }), {
1613
1632
  ...h,
1614
1633
  pageRef: l,
@@ -1623,15 +1642,16 @@ function xn({
1623
1642
  margin: n,
1624
1643
  config: o
1625
1644
  }) {
1626
- const { results: i, pageRef: r, sectionHeaderRef: s, sectionFooterRef: p, contentRef: h } = Pn(e, t, n, o);
1645
+ const { results: i, pageRef: r, sectionHeaderRef: s, sectionFooterRef: d, contentRef: h } = Pn(e, t, n, o);
1627
1646
  return i !== null ? /* @__PURE__ */ b(z, { children: i.map((l, g) => /* @__PURE__ */ b(
1628
- Ie,
1647
+ Fe,
1629
1648
  {
1630
1649
  elements: {
1631
1650
  ...e,
1632
1651
  content: /* @__PURE__ */ b(
1633
1652
  "div",
1634
1653
  {
1654
+ style: { display: "contents" },
1635
1655
  dangerouslySetInnerHTML: {
1636
1656
  __html: l
1637
1657
  }
@@ -1645,13 +1665,13 @@ function xn({
1645
1665
  },
1646
1666
  g
1647
1667
  )) }) : _t(
1648
- /* @__PURE__ */ b("div", { className: nt, style: {
1668
+ /* @__PURE__ */ b("div", { className: ot, style: {
1649
1669
  visibility: "hidden",
1650
1670
  position: "absolute",
1651
1671
  left: "-9999px",
1652
1672
  top: "-9999px"
1653
1673
  }, children: /* @__PURE__ */ b(
1654
- Ie,
1674
+ Fe,
1655
1675
  {
1656
1676
  elements: e,
1657
1677
  dimensions: t,
@@ -1660,7 +1680,7 @@ function xn({
1660
1680
  totalPages: 1,
1661
1681
  ref: r,
1662
1682
  sectionHeaderRef: s,
1663
- sectionFooterRef: p,
1683
+ sectionFooterRef: d,
1664
1684
  contentRef: h
1665
1685
  }
1666
1686
  ) }),
@@ -1672,35 +1692,37 @@ function qn({
1672
1692
  dimension: t,
1673
1693
  orientation: n = "portrait",
1674
1694
  margin: o,
1675
- config: i,
1676
- name: r
1695
+ config: i
1677
1696
  }) {
1678
- const s = De(), p = r ?? s, h = Ce(p);
1697
+ const r = De(), s = T(
1698
+ () => ({ ...i, id: i?.id ?? r }),
1699
+ [i, r]
1700
+ ), d = s.id, h = Ne(d);
1679
1701
  T(() => {
1680
1702
  h((l) => ({ ...l, isPaginated: !1 }));
1681
1703
  }, [h]);
1682
- const d = T(
1704
+ const p = T(
1683
1705
  () => ({
1684
1706
  dimensions: tn(t, n),
1685
1707
  elements: en(e),
1686
1708
  margin: o,
1687
- config: i
1709
+ config: s
1688
1710
  }),
1689
- [e, t, o, i, n]
1711
+ [e, t, o, s, n]
1690
1712
  );
1691
- return Se(nn(s, d.dimensions)), /* @__PURE__ */ b(
1713
+ return _e(nn(d, p.dimensions)), /* @__PURE__ */ b(
1692
1714
  "section",
1693
1715
  {
1694
1716
  className: "paprize-section",
1695
- id: `section-${p}`,
1696
- style: { page: `section-${p}` },
1697
- children: /* @__PURE__ */ b(Ee, { value: p, children: /* @__PURE__ */ b(
1717
+ id: `section-${d}`,
1718
+ style: { page: `section-${d}` },
1719
+ children: /* @__PURE__ */ b(ae, { value: d, children: /* @__PURE__ */ b(
1698
1720
  xn,
1699
1721
  {
1700
- elements: d.elements,
1701
- dimensions: d.dimensions,
1702
- margin: d.margin,
1703
- config: d.config
1722
+ elements: p.elements,
1723
+ dimensions: p.dimensions,
1724
+ margin: p.margin,
1725
+ config: p.config
1704
1726
  }
1705
1727
  ) })
1706
1728
  }
@@ -1709,7 +1731,7 @@ function qn({
1709
1731
  function Zn() {
1710
1732
  return /* @__PURE__ */ b("span", { [at]: "true" });
1711
1733
  }
1712
- function Kn({ children: e, ...t }) {
1734
+ function Xn({ children: e, ...t }) {
1713
1735
  return /* @__PURE__ */ b(
1714
1736
  "div",
1715
1737
  {
@@ -1719,15 +1741,15 @@ function Kn({ children: e, ...t }) {
1719
1741
  }
1720
1742
  );
1721
1743
  }
1722
- const Xn = () => {
1723
- const e = se(ct);
1744
+ const Kn = () => {
1745
+ const e = Z(ct);
1724
1746
  return {
1725
1747
  pageNumber: e.pageNumber,
1726
1748
  totalPages: e.totalPages
1727
1749
  };
1728
1750
  };
1729
1751
  function Qn() {
1730
- const e = ne(V), t = ne(ye);
1752
+ const e = oe(V), t = oe(be);
1731
1753
  return T(
1732
1754
  () => ({
1733
1755
  totalSections: t.totalSections,
@@ -1735,7 +1757,7 @@ function Qn() {
1735
1757
  isFirstPaginationCompleted: t.totalSections > 0,
1736
1758
  sections: Array.from(e.entries()).map(
1737
1759
  ([n, { totalPages: o, isPaginated: i }]) => ({
1738
- sectionName: n,
1760
+ sectionId: n,
1739
1761
  totalPages: o,
1740
1762
  isPaginated: i
1741
1763
  })
@@ -1745,7 +1767,7 @@ function Qn() {
1745
1767
  );
1746
1768
  }
1747
1769
  function Tn(e, t = !0) {
1748
- const n = De(), o = Ce(e);
1770
+ const n = De(), o = Ne(e);
1749
1771
  return T(() => {
1750
1772
  t && o((i) => ({
1751
1773
  ...i,
@@ -1764,7 +1786,7 @@ function Tn(e, t = !0) {
1764
1786
  }), [n, o]);
1765
1787
  }
1766
1788
  const Ln = "paprize";
1767
- class M {
1789
+ class H {
1768
1790
  name;
1769
1791
  defaultValue;
1770
1792
  _reader;
@@ -1775,38 +1797,38 @@ class M {
1775
1797
  return this._reader(t);
1776
1798
  }
1777
1799
  static createStr(t, n) {
1778
- return new M(t, (o) => o, n);
1800
+ return new H(t, (o) => o, n);
1779
1801
  }
1780
1802
  static createBool(t, n) {
1781
- return new M(
1803
+ return new H(
1782
1804
  t,
1783
1805
  (o) => o === "true",
1784
1806
  n
1785
1807
  );
1786
1808
  }
1787
1809
  }
1788
- const Rn = {
1789
- hyphen: M.createStr("hyphen", "-"),
1790
- keepOnSamePage: M.createBool("keep-on-same-page", !1),
1791
- hyphenationEnabled: M.createBool(
1810
+ const In = {
1811
+ hyphen: H.createStr("hyphen", "-"),
1812
+ keepOnSamePage: H.createBool("keep-on-same-page", !1),
1813
+ hyphenationEnabled: H.createBool(
1792
1814
  "hyphenation-enabled",
1793
1815
  !0
1794
1816
  )
1795
- }, In = Object.fromEntries(
1796
- Object.entries(Rn).map(([e, t]) => [
1817
+ }, Rn = Object.fromEntries(
1818
+ Object.entries(In).map(([e, t]) => [
1797
1819
  e,
1798
1820
  t.defaultValue
1799
1821
  ])
1800
1822
  );
1801
1823
  ({
1802
- ...In
1824
+ ...Rn
1803
1825
  });
1804
1826
  function Fn(e) {
1805
1827
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1806
1828
  }
1807
- var me = { exports: {} }, zn = me.exports, ze;
1829
+ var ve = { exports: {} }, zn = ve.exports, Oe;
1808
1830
  function On() {
1809
- return ze || (ze = 1, (function(e) {
1831
+ return Oe || (Oe = 1, (function(e) {
1810
1832
  (function(t, n) {
1811
1833
  e.exports ? e.exports = n() : t.log = n();
1812
1834
  })(zn, function() {
@@ -1818,7 +1840,7 @@ function On() {
1818
1840
  "warn",
1819
1841
  "error"
1820
1842
  ], r = {}, s = null;
1821
- function p(a, u) {
1843
+ function d(a, u) {
1822
1844
  var c = a[u];
1823
1845
  if (typeof c.bind == "function")
1824
1846
  return c.bind(a);
@@ -1833,8 +1855,8 @@ function On() {
1833
1855
  function h() {
1834
1856
  console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
1835
1857
  }
1836
- function d(a) {
1837
- return a === "debug" && (a = "log"), typeof console === n ? !1 : a === "trace" && o ? h : console[a] !== void 0 ? p(console, a) : console.log !== void 0 ? p(console, "log") : t;
1858
+ function p(a) {
1859
+ return a === "debug" && (a = "log"), typeof console === n ? !1 : a === "trace" && o ? h : console[a] !== void 0 ? d(console, a) : console.log !== void 0 ? d(console, "log") : t;
1838
1860
  }
1839
1861
  function l() {
1840
1862
  for (var a = this.getLevel(), u = 0; u < i.length; u++) {
@@ -1850,7 +1872,7 @@ function On() {
1850
1872
  };
1851
1873
  }
1852
1874
  function v(a, u, c) {
1853
- return d(a) || g.apply(this, arguments);
1875
+ return p(a) || g.apply(this, arguments);
1854
1876
  }
1855
1877
  function m(a, u) {
1856
1878
  var c = this, k, C, E, w = "loglevel";
@@ -1878,9 +1900,9 @@ function On() {
1878
1900
  }
1879
1901
  if (typeof f === n)
1880
1902
  try {
1881
- var S = window.document.cookie, I = encodeURIComponent(w), U = S.indexOf(I + "=");
1903
+ var S = window.document.cookie, R = encodeURIComponent(w), U = S.indexOf(R + "=");
1882
1904
  U !== -1 && (f = /^([^;]+)/.exec(
1883
- S.slice(U + I.length + 1)
1905
+ S.slice(U + R.length + 1)
1884
1906
  )[1]);
1885
1907
  } catch {
1886
1908
  }
@@ -1931,8 +1953,8 @@ function On() {
1931
1953
  }, k = P(
1932
1954
  s ? s.getLevel() : "WARN"
1933
1955
  );
1934
- var R = y();
1935
- R != null && (E = P(R)), l.call(c);
1956
+ var I = y();
1957
+ I != null && (E = P(I)), l.call(c);
1936
1958
  }
1937
1959
  s = new m(), s.getLogger = function(a) {
1938
1960
  if (typeof a != "symbol" && typeof a != "string" || a === "")
@@ -1950,13 +1972,13 @@ function On() {
1950
1972
  return r;
1951
1973
  }, s.default = s, s;
1952
1974
  });
1953
- })(me)), me.exports;
1975
+ })(ve)), ve.exports;
1954
1976
  }
1955
1977
  var Bn = On();
1956
- const Dn = /* @__PURE__ */ Fn(Bn), ut = Dn.getLogger(Ln);
1978
+ const $n = /* @__PURE__ */ Fn(Bn), ut = $n.getLogger(Ln);
1957
1979
  ut.setDefaultLevel("info");
1958
- function Hn(e, t) {
1959
- const { sectionName: n } = lt(), { release: o } = Tn(n), [i, r] = Be({
1980
+ function Dn(e, t) {
1981
+ const { sectionId: n } = lt(), { release: o } = Tn(n), [i, r] = $e({
1960
1982
  state: "loading",
1961
1983
  value: t
1962
1984
  });
@@ -1968,16 +1990,16 @@ function Hn(e, t) {
1968
1990
  i.state !== "loading" && o();
1969
1991
  }, [i, o]), i.value;
1970
1992
  }
1971
- function Mn(e) {
1993
+ function Hn(e) {
1972
1994
  let t = null;
1973
1995
  return () => (t || (t = e()), t);
1974
1996
  }
1975
- const $n = Mn(async () => {
1997
+ const Mn = Hn(async () => {
1976
1998
  const e = await window[jt]?.();
1977
1999
  return e ? JSON.parse(e) : null;
1978
2000
  });
1979
2001
  function eo(e) {
1980
- return Hn($n(), e);
2002
+ return Dn(Mn(), e);
1981
2003
  }
1982
2004
  const Wn = {
1983
2005
  A1: { height: "841mm", width: "594mm" },
@@ -1999,24 +2021,24 @@ const Wn = {
1999
2021
  None: { top: "0in", right: "0in", bottom: "0in", left: "0in" }
2000
2022
  }, to = Wn, no = Vn;
2001
2023
  export {
2002
- Kn as Layout,
2024
+ Xn as Layout,
2003
2025
  Zn as PageBreak,
2004
- Ze as PageContent,
2026
+ Xe as PageContent,
2005
2027
  Ke as PageFooter,
2006
- Xe as PageHeader,
2028
+ Qe as PageHeader,
2029
+ nt as PageOverlay,
2007
2030
  Gn as ReportPreview,
2008
2031
  Yn as ReportRoot,
2009
2032
  qn as Section,
2010
- Qe as SectionFooter,
2011
- et as SectionHeader,
2012
- wn as defaultPlugins,
2013
- $n as jsonData,
2033
+ et as SectionFooter,
2034
+ tt as SectionHeader,
2035
+ Mn as jsonData,
2014
2036
  no as pageMargin,
2015
2037
  to as pageSize,
2016
2038
  eo as useJsonData,
2017
- Xn as usePageInfo,
2039
+ Kn as usePageInfo,
2018
2040
  Qn as useReportInfo,
2019
2041
  lt as useSectionInfo,
2020
2042
  Tn as useSectionSuspension,
2021
- Hn as useSuspenseForPromise
2043
+ Dn as useSuspenseForPromise
2022
2044
  };