@paprize/core 0.0.7 → 0.0.9

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,1458 +0,0 @@
1
- const me = "paprize", fe = "pz-temp-container", it = "pz-current-element", ot = "pz-current-text", rt = "pz-ignored-element", st = "pz-ignored-text", X = "paprize-global-style", U = "pz-page", _e = "pz-section", T = "pz-preview", C = "data-pz-";
2
- let oe = !1;
3
- const at = () => {
4
- oe = !0;
5
- }, ve = () => oe;
6
- function re(i) {
7
- return i.nodeType === Node.ELEMENT_NODE;
8
- }
9
- function be(i) {
10
- return i.nodeType === Node.TEXT_NODE;
11
- }
12
- function $(i) {
13
- const e = i.getBoundingClientRect(), t = getComputedStyle(i), n = parseFloat(t.marginTop) || 0, o = parseFloat(t.marginBottom) || 0;
14
- return e.height + n + o;
15
- }
16
- function lt(i) {
17
- i.style.visibility = "hidden", i.style.position = "absolute", i.style.left = "-9999px", i.style.top = "-9999px";
18
- }
19
- const se = {
20
- hyphen: "-",
21
- keepOnSamePage: !1,
22
- hyphenationDisabled: !1
23
- }, ae = {
24
- hyphen: {
25
- key: `${C}hyphen`,
26
- reader: (i) => String(i)
27
- },
28
- keepOnSamePage: {
29
- key: `${C}keep-on-same-page`,
30
- reader: (i) => i === "true"
31
- },
32
- hyphenationDisabled: {
33
- key: `${C}hyphenation-disabled`,
34
- reader: (i) => i === "true"
35
- }
36
- };
37
- function ct(i) {
38
- const e = {};
39
- for (const [t, n] of Object.entries(i)) {
40
- const o = ae[t];
41
- o !== void 0 && n !== void 0 && (e[o.key] = String(n));
42
- }
43
- return e;
44
- }
45
- const K = /* @__PURE__ */ new WeakMap();
46
- function ye(i, e, t, n) {
47
- if (t == null)
48
- return;
49
- const o = e(t);
50
- o !== void 0 && (n[i] = o);
51
- }
52
- function le(i) {
53
- if (!i)
54
- return {};
55
- if (!(i instanceof Element))
56
- return le(i?.parentNode);
57
- const e = {};
58
- for (const o of Object.keys(se)) {
59
- const r = o, s = ae[r], d = i.getAttribute(s.key);
60
- ye(r, s.reader, d, e);
61
- }
62
- const n = { ...i.parentNode ? K.get(i.parentNode) : void 0, ...e };
63
- return K.set(i, n), n;
64
- }
65
- const ce = {
66
- id: "default",
67
- plugins: [],
68
- ...se
69
- };
70
- function we(i, e) {
71
- const t = le(i);
72
- return { ...ce, ...e, ...t };
73
- }
74
- function Se(i) {
75
- return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
76
- }
77
- var O = { exports: {} }, Ce = O.exports, Y;
78
- function Ne() {
79
- return Y || (Y = 1, (function(i) {
80
- (function(e, t) {
81
- i.exports ? i.exports = t() : e.log = t();
82
- })(Ce, function() {
83
- var e = function() {
84
- }, t = "undefined", n = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), o = [
85
- "trace",
86
- "debug",
87
- "info",
88
- "warn",
89
- "error"
90
- ], r = {}, s = null;
91
- function d(l, p) {
92
- var a = l[p];
93
- if (typeof a.bind == "function")
94
- return a.bind(l);
95
- try {
96
- return Function.prototype.bind.call(a, l);
97
- } catch {
98
- return function() {
99
- return Function.prototype.apply.apply(a, [l, arguments]);
100
- };
101
- }
102
- }
103
- function P() {
104
- console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
105
- }
106
- function b(l) {
107
- return l === "debug" && (l = "log"), typeof console === t ? !1 : l === "trace" && n ? P : console[l] !== void 0 ? d(console, l) : console.log !== void 0 ? d(console, "log") : e;
108
- }
109
- function f() {
110
- for (var l = this.getLevel(), p = 0; p < o.length; p++) {
111
- var a = o[p];
112
- this[a] = p < l ? e : this.methodFactory(a, l, this.name);
113
- }
114
- if (this.log = this.debug, typeof console === t && l < this.levels.SILENT)
115
- return "No console available for logging";
116
- }
117
- function _(l) {
118
- return function() {
119
- typeof console !== t && (f.call(this), this[l].apply(this, arguments));
120
- };
121
- }
122
- function W(l, p, a) {
123
- return b(l) || _.apply(this, arguments);
124
- }
125
- function q(l, p) {
126
- var a = this, R, j, y, m = "loglevel";
127
- typeof l == "string" ? m += ":" + l : typeof l == "symbol" && (m = void 0);
128
- function pe(c) {
129
- var u = (o[c] || "silent").toUpperCase();
130
- if (!(typeof window === t || !m)) {
131
- try {
132
- window.localStorage[m] = u;
133
- return;
134
- } catch {
135
- }
136
- try {
137
- window.document.cookie = encodeURIComponent(m) + "=" + u + ";";
138
- } catch {
139
- }
140
- }
141
- }
142
- function J() {
143
- var c;
144
- if (!(typeof window === t || !m)) {
145
- try {
146
- c = window.localStorage[m];
147
- } catch {
148
- }
149
- if (typeof c === t)
150
- try {
151
- var u = window.document.cookie, H = encodeURIComponent(m), Z = u.indexOf(H + "=");
152
- Z !== -1 && (c = /^([^;]+)/.exec(
153
- u.slice(Z + H.length + 1)
154
- )[1]);
155
- } catch {
156
- }
157
- return a.levels[c] === void 0 && (c = void 0), c;
158
- }
159
- }
160
- function ue() {
161
- if (!(typeof window === t || !m)) {
162
- try {
163
- window.localStorage.removeItem(m);
164
- } catch {
165
- }
166
- try {
167
- window.document.cookie = encodeURIComponent(m) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
168
- } catch {
169
- }
170
- }
171
- }
172
- function E(c) {
173
- var u = c;
174
- if (typeof u == "string" && a.levels[u.toUpperCase()] !== void 0 && (u = a.levels[u.toUpperCase()]), typeof u == "number" && u >= 0 && u <= a.levels.SILENT)
175
- return u;
176
- throw new TypeError("log.setLevel() called with invalid level: " + c);
177
- }
178
- a.name = l, a.levels = {
179
- TRACE: 0,
180
- DEBUG: 1,
181
- INFO: 2,
182
- WARN: 3,
183
- ERROR: 4,
184
- SILENT: 5
185
- }, a.methodFactory = p || W, a.getLevel = function() {
186
- return y ?? j ?? R;
187
- }, a.setLevel = function(c, u) {
188
- return y = E(c), u !== !1 && pe(y), f.call(a);
189
- }, a.setDefaultLevel = function(c) {
190
- j = E(c), J() || a.setLevel(c, !1);
191
- }, a.resetLevel = function() {
192
- y = null, ue(), f.call(a);
193
- }, a.enableAll = function(c) {
194
- a.setLevel(a.levels.TRACE, c);
195
- }, a.disableAll = function(c) {
196
- a.setLevel(a.levels.SILENT, c);
197
- }, a.rebuild = function() {
198
- if (s !== a && (R = E(s.getLevel())), f.call(a), s === a)
199
- for (var c in r)
200
- r[c].rebuild();
201
- }, R = E(
202
- s ? s.getLevel() : "WARN"
203
- );
204
- var G = J();
205
- G != null && (y = E(G)), f.call(a);
206
- }
207
- s = new q(), s.getLogger = function(p) {
208
- if (typeof p != "symbol" && typeof p != "string" || p === "")
209
- throw new TypeError("You must supply a name when creating a logger.");
210
- var a = r[p];
211
- return a || (a = r[p] = new q(
212
- p,
213
- s.methodFactory
214
- )), a;
215
- };
216
- var ge = typeof window !== t ? window.log : void 0;
217
- return s.noConflict = function() {
218
- return typeof window !== t && window.log === s && (window.log = ge), s;
219
- }, s.getLoggers = function() {
220
- return r;
221
- }, s.default = s, s;
222
- });
223
- })(O)), O.exports;
224
- }
225
- var xe = Ne();
226
- const S = /* @__PURE__ */ Se(xe), g = S.getLogger(me);
227
- g.setDefaultLevel("info");
228
- const M = "\x1B[46mPLUGIN\x1B[0m";
229
- function N(i, e, ...t) {
230
- i.sort((n, o) => n.order - o.order).forEach((n) => {
231
- const o = n[e];
232
- if (o) {
233
- g.debug(
234
- M,
235
- `executing plugin ${n.name}:${String(e)} ()`,
236
- t
237
- );
238
- try {
239
- o(...t), g.debug(
240
- M,
241
- `plugin ${n.name}:${String(e)} executed`,
242
- t
243
- );
244
- } catch (r) {
245
- g.debug(
246
- M,
247
- `plugin ${n.name}:${String(e)} failed`,
248
- r
249
- );
250
- }
251
- }
252
- });
253
- }
254
- const x = {
255
- Element: "element",
256
- Text: "text"
257
- };
258
- class F {
259
- _node;
260
- config;
261
- type = x.Element;
262
- transaction;
263
- clonedFrom;
264
- cloneCount;
265
- constructor(e, t, n, o) {
266
- this._node = e, this.transaction = t, this.config = n, this.clonedFrom = o, this.cloneCount = o ? o.cloneCount + 1 : 0;
267
- }
268
- getOriginalNode() {
269
- let e = this.clonedFrom;
270
- for (; e?.clonedFrom; )
271
- e = e.clonedFrom;
272
- return e?._node;
273
- }
274
- appendChild(e) {
275
- this.transaction.isActive && this.transaction.addRollbackCallback(() => {
276
- this._node.removeChild(e.getNode());
277
- }), this._node.appendChild(e.getNode());
278
- }
279
- clone(e) {
280
- const t = this._node.cloneNode(e), n = new F(
281
- t,
282
- this.transaction,
283
- this.config,
284
- this
285
- );
286
- return N(
287
- this.config.plugins,
288
- "onClone",
289
- this.config.id,
290
- this._node,
291
- n
292
- ), n;
293
- }
294
- getHeight() {
295
- return $(this._node);
296
- }
297
- remove() {
298
- this.transaction.addCommitCallback(() => {
299
- this._node.remove();
300
- });
301
- }
302
- isEmpty() {
303
- return this._node.innerHTML === "";
304
- }
305
- getChildrenCount() {
306
- return this._node.childNodes.length;
307
- }
308
- getNode() {
309
- return this._node;
310
- }
311
- }
312
- class Pe {
313
- _node;
314
- type = x.Text;
315
- transaction;
316
- config;
317
- constructor(e, t, n) {
318
- this._node = e, this.transaction = t, this.config = n;
319
- }
320
- get textContent() {
321
- return this._node.textContent ?? "";
322
- }
323
- set textContent(e) {
324
- this._node.textContent = e;
325
- }
326
- remove() {
327
- this.transaction.addCommitCallback(() => {
328
- this._node.remove();
329
- });
330
- }
331
- getNode() {
332
- return this._node;
333
- }
334
- }
335
- function z(i, e, t) {
336
- if (be(i))
337
- return new Pe(i, e, t);
338
- if (re(i))
339
- return new F(i, e, t);
340
- throw new Error("Unsupported node type");
341
- }
342
- const k = "\x1B[106mDOM\x1B[0m";
343
- class Ee {
344
- _transaction;
345
- _treeWalker;
346
- _config;
347
- _completed = !1;
348
- _currentNode = null;
349
- _previousNode = null;
350
- constructor(e, t, n) {
351
- this._transaction = t, this._config = n, this._treeWalker = document.createTreeWalker(
352
- e,
353
- NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT
354
- );
355
- }
356
- get completed() {
357
- return this._completed;
358
- }
359
- get currentNode() {
360
- return this._currentNode;
361
- }
362
- get previousNode() {
363
- return this._previousNode;
364
- }
365
- goToNextNode() {
366
- this._treeWalker.nextNode() || (this._completed = !0), g.debug(k, "moving to next node"), this.setState();
367
- }
368
- goToNextSiblingOrParentSibling() {
369
- let e = 0;
370
- if (this._treeWalker.nextSibling())
371
- return g.debug(k, "moving to next sibling node"), this.setState(), { parentsTraversed: e };
372
- for (; this._treeWalker.parentNode(); )
373
- if (e++, this._treeWalker.nextSibling())
374
- return g.debug(
375
- k,
376
- "moving to parent sibling node, traversed:",
377
- e
378
- ), this.setState(), { parentsTraversed: e };
379
- return this._completed = !0, { parentsTraversed: e };
380
- }
381
- goToFirstChildOrNextNode() {
382
- return this._treeWalker.firstChild() ? (g.debug(k, "moving to first child node"), this.setState(), { parentsTraversed: 1 }) : (this.goToNextNode(), { parentsTraversed: 0 });
383
- }
384
- setState() {
385
- this._previousNode = this._currentNode, this._currentNode = z(
386
- this._treeWalker.currentNode,
387
- this._transaction,
388
- we(this._treeWalker.currentNode, this._config)
389
- ), g.debug(k, "moved to node", {
390
- currentNode: this._currentNode,
391
- previousNode: this._previousNode
392
- });
393
- }
394
- }
395
- class Te {
396
- _onRollback;
397
- _onCommit;
398
- isActive;
399
- constructor() {
400
- this._onRollback = [], this._onCommit = [], this.isActive = !1;
401
- }
402
- start = () => {
403
- if (this.isActive)
404
- throw new Error("Transaction already in progress");
405
- this.isActive = !0, this._onRollback = [], this._onCommit = [];
406
- };
407
- addRollbackCallback = (e) => {
408
- this._onRollback.push(e);
409
- };
410
- addCommitCallback = (e) => {
411
- if (!this.isActive) {
412
- e();
413
- return;
414
- }
415
- this._onCommit.push(e);
416
- };
417
- rollback = () => {
418
- this.isActive && (this.isActive = !1, this._onRollback.forEach((e) => e()));
419
- };
420
- commit = () => {
421
- this.isActive && (this.isActive = !1, this._onCommit.forEach((e) => e()));
422
- };
423
- }
424
- const Q = "\x1B[102mPAGE\x1B[0m";
425
- class I {
426
- currentPage;
427
- activeElement;
428
- currentElement;
429
- parentStack;
430
- pageIsFull;
431
- pageIndex;
432
- pageHeight;
433
- constructor(e, t, n, o, r, s, d) {
434
- this.currentPage = e, this.activeElement = t, this.currentElement = n, this.parentStack = o, this.pageIsFull = r, this.pageIndex = s, this.pageHeight = d;
435
- }
436
- static create(e, t, n, o) {
437
- return new I(
438
- e,
439
- null,
440
- e,
441
- t,
442
- !1,
443
- n,
444
- o
445
- );
446
- }
447
- clone = () => new I(
448
- this.currentPage,
449
- this.activeElement,
450
- this.currentElement,
451
- [...this.parentStack],
452
- this.pageIsFull,
453
- this.pageIndex,
454
- this.pageHeight
455
- );
456
- }
457
- class V {
458
- _pageState;
459
- _transaction;
460
- _tempContainer;
461
- _config;
462
- constructor(e, t, n, o) {
463
- this._tempContainer = e, this._config = o, this._transaction = n;
464
- const r = V.createPageHtmlElement(
465
- t.width
466
- ), s = this.createNewPage(r);
467
- this._pageState = I.create(s, [], 0, t.height), N(this._config.plugins, "onNewPage", o.id, this);
468
- }
469
- nextPage() {
470
- const e = this.createNewPage(
471
- this._pageState.currentPage.getNode().cloneNode(!1)
472
- ), t = I.create(
473
- e,
474
- [],
475
- this._pageState.pageIndex + 1,
476
- this._pageState.pageHeight
477
- );
478
- this.cloneParentStackToNewPage(t), this.cleanupEmptyParent(), this._pageState = t, N(
479
- this._config.plugins,
480
- "onNewPage",
481
- this._config.id,
482
- this
483
- );
484
- }
485
- cloneParentStackToNewPage(e) {
486
- for (const t of this._pageState.parentStack) {
487
- const n = t.clone(!1);
488
- e.currentElement.appendChild(n), e.currentElement = n, e.parentStack.push(n);
489
- }
490
- }
491
- cleanupEmptyParent() {
492
- const e = [...this._pageState.parentStack], t = () => {
493
- for (let n = e.length - 1; n >= 0; n--) {
494
- const o = e[n];
495
- o.isEmpty() && o.remove();
496
- }
497
- };
498
- this._transaction.addCommitCallback(t);
499
- }
500
- enterElement() {
501
- if (!this._pageState.activeElement || this._pageState.activeElement.type !== x.Element)
502
- throw new Error("Invalid state: activeElement is not an Element");
503
- g.debug(
504
- Q,
505
- "entering an element",
506
- this._pageState.activeElement
507
- ), this._pageState.currentElement = this._pageState.activeElement, this._pageState.parentStack.push(this._pageState.activeElement);
508
- }
509
- leaveElement() {
510
- this._pageState.activeElement = null;
511
- const e = this._pageState.parentStack.pop();
512
- g.debug(Q, "leaving a parent element", e);
513
- const t = this._pageState.parentStack.at(-1);
514
- this._pageState.currentElement = t ?? this._pageState.currentPage;
515
- }
516
- static createPageHtmlElement(e) {
517
- const t = document.createElement("div");
518
- return t.style.width = `${e}px`, t.style.maxWidth = `${e}px`, t;
519
- }
520
- createNewPage(e) {
521
- return this._tempContainer.appendChild(e), this._transaction.isActive && this._transaction.addRollbackCallback(() => {
522
- this._tempContainer.removeChild(e);
523
- }), z(e, this._transaction, this._config);
524
- }
525
- startTransaction() {
526
- this._transaction.start();
527
- const e = this._pageState.clone();
528
- return this._transaction.addRollbackCallback(() => {
529
- this._pageState = e;
530
- }), this._transaction;
531
- }
532
- hasEmptySpace(e) {
533
- return !this._pageState.pageIsFull && this._pageState.currentPage.getHeight() + (e || 1e-4) <= this._pageState.pageHeight;
534
- }
535
- isOverFlow() {
536
- return this._pageState.currentPage.getHeight() > this._pageState.pageHeight;
537
- }
538
- markPageAsFull() {
539
- this._pageState.pageIsFull = !0;
540
- }
541
- appendChild(e, t) {
542
- const n = e.clone(t);
543
- return this._pageState.currentElement.appendChild(n), this._pageState.activeElement = n, n;
544
- }
545
- addTextNode(e) {
546
- if (this._pageState.activeElement?.type === x.Text)
547
- return this._pageState.activeElement;
548
- const t = document.createTextNode(e), n = z(
549
- t,
550
- this._transaction,
551
- this._config
552
- );
553
- return this._pageState.currentElement.appendChild(n), this._pageState.activeElement = n, n;
554
- }
555
- getPageState() {
556
- return this._pageState;
557
- }
558
- }
559
- const h = {
560
- None: 0,
561
- // The node fits completely on the page, no further splitting required.
562
- FullNodePlaced: 1,
563
- // The entire node was placed on the page, continue with the next sibling or element.
564
- SplitChildren: 2
565
- // The node is too large for the page, and its children must be paginated individually.
566
- };
567
- function ke(i, e) {
568
- const t = ee(i, e);
569
- if (t !== h.None)
570
- return t;
571
- const { rollback: n, commit: o } = e.startTransaction();
572
- e.nextPage();
573
- const r = ee(i, e);
574
- return r !== h.None ? (o(), r) : (n(), g.debug("Element is too big to fit on a page", i), h.None);
575
- }
576
- function ee(i, e) {
577
- if (e.hasEmptySpace(i.getHeight())) {
578
- const n = e.appendChild(i, !0);
579
- if (e.isOverFlow())
580
- n.remove();
581
- else
582
- return h.FullNodePlaced;
583
- }
584
- if (i.config.keepOnSamePage || i.getChildrenCount() === 0)
585
- return h.None;
586
- const t = e.appendChild(i, !1);
587
- return e.isOverFlow() ? (t.remove(), h.None) : h.SplitChildren;
588
- }
589
- function Ae(i, e) {
590
- let t = h.FullNodePlaced;
591
- const n = i.textContent.split(/(\s+)/).filter((s) => s !== "");
592
- let o, r = 0;
593
- for (; o || r < n.length; ) {
594
- const s = o ?? n[r], d = Le(s, e, i.config);
595
- d.completed || (t = h.None), d.pendingToken ? o = d.pendingToken : (o = void 0, r++);
596
- }
597
- return t;
598
- }
599
- function Le(i, e, t) {
600
- e.hasEmptySpace() || e.nextPage();
601
- const n = e.addTextNode(""), o = n.textContent;
602
- if (n.textContent += i, !e.isOverFlow())
603
- return {
604
- completed: !0
605
- };
606
- n.textContent = o;
607
- const r = Fe(i, e, t);
608
- return {
609
- pendingToken: r.leftovers,
610
- completed: r.completed
611
- };
612
- }
613
- function Fe(i, e, t) {
614
- const { rollback: n, commit: o } = e.startTransaction();
615
- if (e.nextPage(), e.addTextNode(i), !e.isOverFlow())
616
- return o(), {
617
- completed: !0
618
- };
619
- if (n(), t.hyphenationDisabled)
620
- return g.warn("Hyphenation disabled, skipping oversized token:", i), {
621
- completed: !1
622
- };
623
- const r = Ie(i, t.hyphen, e);
624
- return {
625
- completed: !0,
626
- leftovers: r && r.length > 0 ? r : void 0
627
- };
628
- }
629
- function Ie(i, e, t) {
630
- const n = t.addTextNode("");
631
- let o = "";
632
- for (let r = 0; r < i.length; r++) {
633
- const s = i[r], d = o + s;
634
- if (n.textContent = d + e, !t.hasEmptySpace())
635
- return n.textContent = o ? o + e : "", t.markPageAsFull(), i.slice(r);
636
- o = d;
637
- }
638
- return null;
639
- }
640
- const A = "\x1B[103mPAGINATOR\x1B[0m";
641
- class B {
642
- _domState;
643
- _pageManager;
644
- _transaction;
645
- _tempContainer;
646
- _config;
647
- constructor(e, t, n) {
648
- this._config = { ...ce, ...n }, this._tempContainer = B.createTempContainer(this._config.id), this._transaction = new Te(), this._domState = new Ee(e, this._transaction, this._config), this._pageManager = new V(
649
- this._tempContainer,
650
- t,
651
- this._transaction,
652
- this._config
653
- );
654
- }
655
- static createTempContainer(e) {
656
- const t = document.createElement("div");
657
- return t.style.display = "flex", t.style.flexDirection = "column", t.style.gap = "20px", t.setAttribute(`${C}-section-id`, e), t.classList.add(fe), document.body.appendChild(t), t;
658
- }
659
- static paginate(e, t, n) {
660
- const o = new B(e, t, n);
661
- return o.processAllNodes(), Array.from(o._tempContainer.childNodes).filter((s) => re(s)).map((s) => s.innerHTML);
662
- }
663
- processAllNodes() {
664
- this._domState.goToNextNode();
665
- do {
666
- S.debug(
667
- A,
668
- "paginating node",
669
- this._domState.currentNode
670
- );
671
- const e = this.processCurrentNode();
672
- switch (N(
673
- this._config.plugins,
674
- "afterVisitNode",
675
- this._config.id,
676
- e,
677
- this._domState,
678
- this._pageManager
679
- ), e) {
680
- case h.None:
681
- this.handleNodeSkipped();
682
- break;
683
- case h.FullNodePlaced:
684
- this.handleFullNodePlaced();
685
- break;
686
- case h.SplitChildren:
687
- this.handleChildrenSplit();
688
- break;
689
- }
690
- } while (this._domState.completed === !1);
691
- S.debug(A, "pagination completed");
692
- }
693
- handleNodeSkipped() {
694
- S.debug(A, "node skipped - couldn't paginate"), this._domState.goToNextNode();
695
- }
696
- handleFullNodePlaced() {
697
- S.debug(A, "node fully paginated");
698
- const { parentsTraversed: e } = this._domState.goToNextSiblingOrParentSibling();
699
- for (let t = 0; t < e; t++)
700
- this._pageManager.leaveElement();
701
- }
702
- handleChildrenSplit() {
703
- S.debug(
704
- A,
705
- "node partially paginated - splitting children"
706
- ), this._domState.goToFirstChildOrNextNode().parentsTraversed === 1 && this._domState.previousNode?.type === x.Element && this._pageManager.enterElement();
707
- }
708
- processCurrentNode() {
709
- if (!this._domState.currentNode)
710
- return h.None;
711
- if (this._domState.currentNode.type === x.Element) {
712
- const e = {};
713
- return N(
714
- this._config.plugins,
715
- "onVisitElement",
716
- this._config.id,
717
- this._domState,
718
- this._pageManager,
719
- e
720
- ), e.result !== void 0 ? e.result : ke(
721
- this._domState.currentNode,
722
- this._pageManager
723
- );
724
- } else {
725
- const e = {};
726
- return N(
727
- this._config.plugins,
728
- "onVisitText",
729
- this._config.id,
730
- this._domState,
731
- this._pageManager,
732
- e
733
- ), e.result !== void 0 ? e.result : Ae(
734
- this._domState.currentNode,
735
- this._pageManager
736
- );
737
- }
738
- }
739
- }
740
- class de {
741
- registry = /* @__PURE__ */ new Map();
742
- addEventListener(e, t) {
743
- const { registry: n } = this, o = new Set(n.get(e));
744
- return o.add(t), n.set(e, o), () => this.removeEventListener(e, t);
745
- }
746
- removeEventListener(e, t) {
747
- const { registry: n } = this, o = new Set(n.get(e));
748
- o.delete(t), n.set(e, o);
749
- }
750
- async dispatch(e, ...t) {
751
- const { registry: n } = this, o = n.get(e);
752
- if (o)
753
- for (const r of o)
754
- await r(...t);
755
- }
756
- }
757
- const dt = {
758
- /** 841mm x 594mm */
759
- A1: { height: "841mm", width: "594mm" },
760
- /** 594mm x 420mm */
761
- A2: { height: "594mm", width: "420mm" },
762
- /** 420mm x 297mm */
763
- A3: { height: "420mm", width: "297mm" },
764
- /** 297mm x 210mm */
765
- A4: { height: "297mm", width: "210mm" },
766
- /** 210mm x 148mm */
767
- A5: { height: "210mm", width: "148mm" },
768
- /** 148mm x 105mm */
769
- A6: { height: "148mm", width: "105mm" },
770
- /** 500mm x 353mm */
771
- B3: { height: "500mm", width: "353mm" },
772
- /** 353mm x 250mm */
773
- B4: { height: "353mm", width: "250mm" },
774
- /** 250mm x 176mm */
775
- B5: { height: "250mm", width: "176mm" },
776
- /** 8.5in x 11in */
777
- Letter: { height: "8.5in", width: "11in" },
778
- /** 11in x 8.5in */
779
- Legal: { height: "11in", width: "8.5in" },
780
- /** 11in x 17in */
781
- Tabloid: { height: "11in", width: "17in" }
782
- }, Re = {
783
- /** Top, Right, Bottom, Left: 1in */
784
- Normal: {
785
- top: "1in",
786
- right: "1in",
787
- bottom: "1in",
788
- left: "1in"
789
- },
790
- /** Top: 0.4in, Right, Bottom, Left: 0.6in */
791
- Narrow: {
792
- top: "0.4in",
793
- right: "0.6in",
794
- bottom: "0.6in",
795
- left: "0.6in"
796
- },
797
- /** Top, Bottom: 0.5in, Right, Left: 2in */
798
- Wide: {
799
- top: "0.5in",
800
- right: "2in",
801
- bottom: "0.5in",
802
- left: "2in"
803
- },
804
- /** Top, Right, Bottom, Left: 0 */
805
- None: {
806
- top: "0in",
807
- right: "0in",
808
- bottom: "0in",
809
- left: "0in"
810
- }
811
- }, He = "__PAPRIZE_IS_INITIALIZED", te = "__PAPRIZE_IS_READY", ne = "__PAPRIZE_READ_JSON_DATA_FILE";
812
- function Oe(i) {
813
- const e = i.getBoundingClientRect(), t = getComputedStyle(i), n = parseFloat(t.marginLeft) || 0, o = parseFloat(t.marginRight) || 0;
814
- return {
815
- height: $(i),
816
- width: e.width + n + o
817
- };
818
- }
819
- function $e(i, e, t) {
820
- const { height: n, width: o } = Oe(i), r = e ? $(e) : 0, s = t ? $(t) : 0;
821
- return { height: n, width: o, sectionHeaderHeight: r, sectionFooterHeight: s };
822
- }
823
- function ze(i, e, t) {
824
- return {
825
- name: "sectionPageHeight",
826
- order: 1,
827
- afterVisitNode: (n, o, r, s) => {
828
- !r.completed || t <= 0 || s.hasEmptySpace(t) || s.nextPage();
829
- },
830
- onNewPage: (n, o) => {
831
- const r = o.getPageState();
832
- r.pageIndex === 0 ? r.pageHeight = i + t : r.pageHeight = i + e + t;
833
- }
834
- };
835
- }
836
- function Be(i) {
837
- return i ? `${i.top} ${i.right} ${i.bottom} ${i.left}` : "0";
838
- }
839
- function De(i) {
840
- let e = null;
841
- return () => (e || (e = i()), e);
842
- }
843
- async function We() {
844
- if (!(ne in window))
845
- return null;
846
- const i = await window[ne]?.();
847
- return i ? JSON.parse(i) : null;
848
- }
849
- const je = `
850
- html {
851
- box-sizing: border-box;
852
- }
853
-
854
- *,
855
- *:before,
856
- *:after {
857
- box-sizing: inherit;
858
- }
859
-
860
- :root {
861
- --paprize-page-background-color: #ffffff;
862
- --paprize-page-margin-bottom: 10px;
863
- --paprize-page-box-shadow: rgb(142 138 138) -1px 3px 5px 2px;
864
- --paprize-section-margin-bottom: 10px;
865
- --paprize-preview-background-color: rgb(218 220 224);
866
- --paprize-preview-padding: 30px 10px;
867
- }
868
-
869
- body {
870
- margin: 0;
871
- }
872
-
873
- @media screen {
874
- .${T} {
875
- min-height: 100vh;
876
- display: flex;
877
- flex-direction: column;
878
- align-items: center;
879
- background-color: var(--paprize-preview-background-color);
880
- padding: var(--paprize-preview-padding);
881
- }
882
-
883
- .${U} {
884
- box-shadow: var(--paprize-page-box-shadow);
885
- margin-bottom: var(--paprize-page-margin-bottom);
886
- background-color: var(--paprize-page-background-color);
887
- }
888
-
889
- .${_e} {
890
- margin-bottom: var(--paprize-section-margin-bottom);
891
- }
892
- }
893
-
894
- @media print {
895
- html:has(.${T}) *:not(.${T}):not(.${T} *):not(:has(.${T})) {
896
- display: none !important;
897
- }
898
- }
899
- `, Me = {
900
- display: "flex",
901
- flexDirection: "column"
902
- }, Ue = {
903
- position: "absolute",
904
- left: "-9999px",
905
- top: "-9999px",
906
- visibility: "hidden"
907
- }, Ve = (i, e) => ({
908
- display: "flex",
909
- flexDirection: "column",
910
- width: i.width,
911
- height: i.height,
912
- maxHeight: i.height,
913
- position: "relative",
914
- padding: Be(e),
915
- zIndex: "1"
916
- }), qe = {
917
- overflow: "hidden",
918
- width: "100%",
919
- height: "100%"
920
- }, Je = {
921
- position: "absolute",
922
- width: "100%",
923
- height: "100%",
924
- left: 0,
925
- top: 0
926
- }, Ge = (i) => ({
927
- page: `section-${i}`
928
- });
929
- function Ze(i, e) {
930
- return `@page section-${i} {
931
- margin: none;
932
- size:${e.width} ${e.height};
933
- width:${e.width};
934
- height:${e.height};
935
- }`;
936
- }
937
- const v = {
938
- globalStyle: je,
939
- component: Me,
940
- outOfScreen: Ue,
941
- page: Ve,
942
- overlay: Je,
943
- pageContent: qe,
944
- sectionPageMedia: Ze,
945
- section: Ge
946
- };
947
- function L(i) {
948
- return i?.cloneNode(!0) ?? null;
949
- }
950
- function Xe(i) {
951
- return {
952
- sectionHeader: L(i.sectionHeader),
953
- sectionFooter: L(i.sectionFooter),
954
- pageHeader: L(i.pageHeader),
955
- pageFooter: L(i.pageFooter),
956
- pageContent: L(i.pageContent)
957
- };
958
- }
959
- const Ke = "data-pz-page-break";
960
- class Ye {
961
- name = "pageBreak";
962
- order = 1;
963
- onVisitElement = (e, t, n, o) => {
964
- t.currentNode.getNode().getAttribute(Ke) === "true" && (n.markPageAsFull(), o.result = h.FullNodePlaced);
965
- };
966
- }
967
- class Qe {
968
- _options = {};
969
- name = "table";
970
- order = 1;
971
- constructor(e = {}) {
972
- this._options = e;
973
- }
974
- onNewPage = (e, t) => {
975
- if (this._options.includeHeaderOnlyTables)
976
- return;
977
- const o = t.getPageState().parentStack.find(
978
- (_) => this._isTable(_.getNode())
979
- );
980
- if (!o || !o.clonedFrom)
981
- return;
982
- const r = o.clonedFrom, s = r.getNode(), d = s.tHead;
983
- if (!(d !== null))
984
- return;
985
- const b = s.tBodies;
986
- if (!this._isTableBodyEmpty(b))
987
- return;
988
- if (r.remove(), o.getNode().tHead === null) {
989
- const _ = z(
990
- d.cloneNode(!0),
991
- o.transaction,
992
- o.config
993
- );
994
- o.appendChild(_);
995
- }
996
- };
997
- onClone = (e, t, n) => {
998
- if (t.tagName === "TR") {
999
- n.config.keepOnSamePage = !0;
1000
- return;
1001
- }
1002
- if (!this._isTable(t) || !n.clonedFrom || n.cloneCount === 1)
1003
- return;
1004
- const o = n.getOriginalNode(), r = o.tHead;
1005
- if (r && this._options.cloneHeader === !0) {
1006
- const d = new F(
1007
- r.cloneNode(!0),
1008
- n.transaction,
1009
- n.config
1010
- );
1011
- n.appendChild(d);
1012
- }
1013
- const s = o.tFoot;
1014
- if (s && this._options.cloneFooter === !0) {
1015
- const d = new F(
1016
- s.cloneNode(!0),
1017
- n.transaction,
1018
- n.config
1019
- );
1020
- n.appendChild(d);
1021
- }
1022
- };
1023
- _isTable(e) {
1024
- return e.tagName === "TABLE";
1025
- }
1026
- _isTableBodyEmpty(e) {
1027
- if (e.length === 0) return !0;
1028
- const t = e[0];
1029
- if (t.rows.length !== 1) return !1;
1030
- const n = t.rows[0];
1031
- return n.cells.length !== 1 ? !1 : n.cells[0].textContent.trim() === "";
1032
- }
1033
- }
1034
- const et = [
1035
- new Ye(),
1036
- new Qe()
1037
- ], gt = {
1038
- name: "debug",
1039
- order: Number.MAX_SAFE_INTEGER,
1040
- onNewPage: (i, e) => {
1041
- const t = e.getPageState().currentPage.getNode();
1042
- t.classList.contains(U) || t.classList.add(U), t.setAttribute(`${C}-element`, "page"), t.setAttribute(
1043
- `${C}-height`,
1044
- e.getPageState().pageHeight.toString()
1045
- );
1046
- }
1047
- }, tt = "sectionToc";
1048
- class pt {
1049
- name = tt;
1050
- order = 1;
1051
- _state = /* @__PURE__ */ new Map();
1052
- getContentList = () => Array.from(this._state.values()).flat();
1053
- onVisitElement = (e, t, n) => {
1054
- {
1055
- const o = t.currentNode.getNode(), r = this.getHeadingLevel(o);
1056
- if (!r || !o.textContent) return;
1057
- const s = n.getPageState().pageIndex;
1058
- s === 0 && this._state.set(e, []), this._state.get(e)?.push({
1059
- sectionId: e,
1060
- pageIndex: s,
1061
- title: o.textContent,
1062
- level: r
1063
- });
1064
- }
1065
- };
1066
- getHeadingLevel(e) {
1067
- const t = e.tagName;
1068
- return /^H[1-6]$/.test(t) ? parseInt(t.charAt(1), 10) : null;
1069
- }
1070
- }
1071
- class D {
1072
- _promises;
1073
- monitor;
1074
- get promise() {
1075
- return this._promises.length > 0 ? Promise.allSettled(this._promises.map((e) => e.promise)).then(
1076
- () => {
1077
- }
1078
- ) : Promise.resolve();
1079
- }
1080
- constructor() {
1081
- this._promises = [], this.monitor = new de();
1082
- }
1083
- async add(e = []) {
1084
- if (this._promises.push(...e.map(D.toTracked)), await new Promise((t) => setTimeout(t, 0)), this.getPending().length === 0) {
1085
- this.monitor.dispatch("onChange", 0);
1086
- return;
1087
- }
1088
- this._promises.forEach((t) => this.injectEvents(t));
1089
- }
1090
- static toTracked(e) {
1091
- const t = {
1092
- promise: e,
1093
- status: "pending"
1094
- };
1095
- return t.promise.finally(() => {
1096
- t.status = "resolved";
1097
- }), t;
1098
- }
1099
- async injectEvents(e) {
1100
- e.promise.finally(() => {
1101
- const t = this.getPending();
1102
- this.monitor.dispatch("onChange", t.length);
1103
- });
1104
- }
1105
- getPending() {
1106
- return Array.from(this._promises.values()).filter(
1107
- (e) => e.status === "pending"
1108
- );
1109
- }
1110
- }
1111
- function ut(i, e) {
1112
- return `${i}-${e + 1}`;
1113
- }
1114
- function nt(i, e) {
1115
- return e === "landscape" ? { height: i.width, width: i.height } : i;
1116
- }
1117
- const w = "\x1B[43mREPORT\x1B[0m";
1118
- class ht {
1119
- _sections;
1120
- _monitor;
1121
- _paginationInProgress;
1122
- _pendingPaginateResolvers;
1123
- _currentAbortController;
1124
- constructor() {
1125
- this._sections = /* @__PURE__ */ new Map(), this._monitor = new de(), this._paginationInProgress = !1, this._pendingPaginateResolvers = [], this._currentAbortController = null, window[He] = !0, this._injectStyle(v.globalStyle);
1126
- }
1127
- /**
1128
- * Monitor instance used to subscribe to pagination events.
1129
- * See {@link ReportBuilderEvents} for available event types.
1130
- */
1131
- get monitor() {
1132
- return this._monitor;
1133
- }
1134
- /**
1135
- * Removes a section from the registered sections, if it has already been registered in the report.
1136
- */
1137
- removeSection(e) {
1138
- this._sections.delete(e);
1139
- }
1140
- /**
1141
- * Registers a section by its ID, specifying the page size, margins, and other options.
1142
- *
1143
- * @param options - Configuration options for the section.
1144
- * @param components - The DOM components associated with the section.
1145
- * @param onPaginationCompleted - Callback invoked when pagination for the section is completed.
1146
- * @returns `true` if the section was added to the report’s section list, or `false` if it already exists.
1147
- */
1148
- async tryAddSection(e, t, n) {
1149
- if (this._sections.has(e.id))
1150
- return !1;
1151
- const o = {
1152
- sectionIndex: this._sections.size,
1153
- sectionId: e.id,
1154
- isPaginated: !1,
1155
- isSuspended: !!e.suspense?.length,
1156
- pages: []
1157
- };
1158
- return this._sections.set(e.id, {
1159
- context: o,
1160
- options: {
1161
- ...e,
1162
- size: nt(
1163
- e.size,
1164
- e.orientation ?? "portrait"
1165
- )
1166
- },
1167
- components: t,
1168
- onPaginationCompleted: n
1169
- }), this._injectStyle(
1170
- v.sectionPageMedia(e.id, e.size)
1171
- ), await this._monitor.dispatch("sectionCreated", o), !0;
1172
- }
1173
- /**
1174
- * Schedules a pagination operation.
1175
- *
1176
- * It is not possible to schedule multiple pagination operations in parallel,
1177
- * as the process involves DOM manipulation, and concurrent modifications
1178
- * could cause conflicts and unexpected results.
1179
- * Each newly scheduled operation is queued and executed sequentially.
1180
- * When a new pagination is scheduled, any ongoing or pending operations
1181
- * will be aborted, and the new pagination will start immediately afterward.
1182
- *
1183
- * @returns A promise that resolves when the first pagination cycle is completed.
1184
- * It does not wait for suspended sections to resolve and be paginated.
1185
- * To wait for all sections to complete pagination, use the
1186
- * `suspension` property of the returned result object.
1187
- */
1188
- async schedulePagination() {
1189
- return this._sections.size === 0 ? (window[te] = !0, {
1190
- sections: [],
1191
- suspension: Promise.resolve()
1192
- }) : (this._paginationInProgress && this._currentAbortController && (g.debug(
1193
- w,
1194
- "Cancelling previous pagination operation."
1195
- ), this._currentAbortController.abort(
1196
- "Cancelled by new paginate call"
1197
- )), this._paginationInProgress ? new Promise((e, t) => {
1198
- this._pendingPaginateResolvers.push({ resolve: e, reject: t });
1199
- }) : this._executePagination());
1200
- }
1201
- /**
1202
- * Retrieves JSON data injected by **@paprize/puppeteer** during server-side rendering (SSR).
1203
- *
1204
- * If no injected data is available, the function returns the provided `defaultData`, or `null` if none is given.
1205
- *
1206
- * ⚠️ **Important Notes:**
1207
- * - This function is **not type-safe** — it performs **no runtime type validation** on the returned data.
1208
- * - It is available **only during server-side rendering** when using **@paprize/puppeteer**.
1209
- * - When used in **client-side rendering** or **development** mode, you should provide a `defaultData` value for testing purposes.
1210
- *
1211
- * @template T - The expected type of the injected JSON data.
1212
- * @param defaultData - Optional fallback value to return if no injected data is found.
1213
- * @returns A promise resolving to the injected JSON data if available, otherwise the provided default value or `null`.
1214
- */
1215
- async getJsonData(e) {
1216
- return await this._lazyJsonDataReader().catch(() => e) ?? e ?? null;
1217
- }
1218
- _lazyJsonDataReader = De(We);
1219
- async _executePagination() {
1220
- this._paginationInProgress = !0, this._currentAbortController = new AbortController();
1221
- const e = this._currentAbortController.signal;
1222
- try {
1223
- if (g.debug(w, "Schedule paginate."), await document.fonts.ready, e.aborted)
1224
- return new Promise((o, r) => {
1225
- this._pendingPaginateResolvers.push({ resolve: o, reject: r });
1226
- });
1227
- const t = [];
1228
- for (const o of this._sections.values()) {
1229
- o.context.isPaginated = !1;
1230
- const r = new D();
1231
- await r.add(o.options.suspense), r.monitor.addEventListener("onChange", (s) => {
1232
- g.debug(
1233
- w,
1234
- `${s} pending promises in section '${o.options.id}'.`
1235
- );
1236
- }), r.promise.then(async () => {
1237
- e.aborted || (g.debug(
1238
- w,
1239
- `Start paginating section '${o.options.id}'.`
1240
- ), o.context.isSuspended = !1, this._paginateSection(o));
1241
- }), t.push(r);
1242
- }
1243
- const n = new D();
1244
- return n.monitor.addEventListener("onChange", async () => {
1245
- g.debug(w, "Report pagination completed."), await this._monitor.dispatch("paginationCycleCompleted", {
1246
- sections: [...this._sections.values()].map(
1247
- (o) => o.context
1248
- )
1249
- });
1250
- }), e.aborted ? new Promise((o, r) => {
1251
- this._pendingPaginateResolvers.push({ resolve: o, reject: r });
1252
- }) : (await n.add(t.map((o) => o.promise)), {
1253
- sections: [...this._sections.values()].map((o) => o.context),
1254
- suspension: n.promise.then(() => {
1255
- window[te] = !0;
1256
- })
1257
- });
1258
- } finally {
1259
- this._processPendingPagination(), this._paginationInProgress = !1, this._currentAbortController = null;
1260
- }
1261
- }
1262
- async _processPendingPagination() {
1263
- if (this._pendingPaginateResolvers.length === 0)
1264
- return;
1265
- g.debug(
1266
- w,
1267
- `Processing ${this._pendingPaginateResolvers.length} pending paginate calls.`
1268
- );
1269
- const e = [...this._pendingPaginateResolvers];
1270
- this._pendingPaginateResolvers = [];
1271
- const t = await this._executePagination();
1272
- for (const n of e)
1273
- n.resolve(t);
1274
- }
1275
- _injectStyle(e) {
1276
- let t = document.getElementById(
1277
- X
1278
- );
1279
- t || (t = document.createElement("style"), t.id = X, t.textContent = "", document.head.appendChild(t)), t.textContent = (t.textContent + e).replace(/\s+/g, " ").replace(/\s*([:;{}])\s*/g, "$1").trim();
1280
- }
1281
- async _paginateSection(e) {
1282
- const t = document.createElement("div");
1283
- Object.assign(
1284
- t.style,
1285
- v.page(
1286
- e.options.size,
1287
- e.options.margin ?? Re.None
1288
- )
1289
- ), ve() || Object.assign(t.style, v.outOfScreen);
1290
- const n = Xe(e.components);
1291
- n.sectionHeader && (Object.assign(
1292
- n.sectionHeader.style,
1293
- v.component
1294
- ), t.appendChild(n.sectionHeader)), n.pageHeader && (Object.assign(n.pageHeader.style, v.component), t.appendChild(n.pageHeader)), Object.assign(n.pageContent.style, v.pageContent), t.appendChild(n.pageContent), n.pageFooter && (Object.assign(n.pageFooter.style, v.component), t.appendChild(n.pageFooter)), n.sectionFooter && (Object.assign(
1295
- n.sectionFooter.style,
1296
- v.component
1297
- ), t.appendChild(n.sectionFooter)), document.body.appendChild(t);
1298
- const { height: o, width: r, sectionHeaderHeight: s, sectionFooterHeight: d } = $e(
1299
- n.pageContent,
1300
- n.sectionHeader,
1301
- n.sectionFooter
1302
- ), P = B.paginate(
1303
- n.pageContent,
1304
- { height: o, width: r },
1305
- {
1306
- id: e.options.id,
1307
- plugins: [
1308
- ...e.options.plugins ?? et,
1309
- ze(
1310
- o,
1311
- s,
1312
- d
1313
- )
1314
- ]
1315
- }
1316
- );
1317
- t.remove();
1318
- const b = P.map((_, W) => ({
1319
- pageIndex: W,
1320
- totalPages: P.length,
1321
- sectionId: e.options.id,
1322
- pageContentHtml: _
1323
- }));
1324
- e.onPaginationCompleted(b);
1325
- for (const _ of b)
1326
- await this._monitor.dispatch("pageCompleted", _);
1327
- const f = {
1328
- ...e.context,
1329
- isPaginated: !0,
1330
- isSuspended: !1,
1331
- pages: b
1332
- };
1333
- this._sections.set(e.options.id, {
1334
- ...e,
1335
- context: f
1336
- }), await this._monitor.dispatch("sectionCompleted", f);
1337
- }
1338
- }
1339
- const ie = [
1340
- "ad",
1341
- "adipisicing",
1342
- "aliqua",
1343
- "aliquip",
1344
- "amet",
1345
- "anim",
1346
- "aute",
1347
- "cillum",
1348
- "commodo",
1349
- "consectetur",
1350
- "consequat",
1351
- "culpa",
1352
- "cupidatat",
1353
- "deserunt",
1354
- "do",
1355
- "dolor",
1356
- "dolore",
1357
- "duis",
1358
- "ea",
1359
- "eiusmod",
1360
- "elit",
1361
- "enim",
1362
- "esse",
1363
- "est",
1364
- "et",
1365
- "eu",
1366
- "ex",
1367
- "excepteur",
1368
- "exercitation",
1369
- "fugiat",
1370
- "id",
1371
- "in",
1372
- "incididunt",
1373
- "ipsum",
1374
- "irure",
1375
- "labore",
1376
- "laboris",
1377
- "laborum",
1378
- "Lorem",
1379
- "magna",
1380
- "minim",
1381
- "mollit",
1382
- "nisi",
1383
- "non",
1384
- "nostrud",
1385
- "nulla",
1386
- "occaecat",
1387
- "officia",
1388
- "pariatur",
1389
- "proident",
1390
- "qui",
1391
- "quis",
1392
- "reprehenderit",
1393
- "sint",
1394
- "sit",
1395
- "sunt",
1396
- "tempor",
1397
- "ullamco",
1398
- "ut",
1399
- "velit",
1400
- "veniam",
1401
- "voluptate"
1402
- ];
1403
- function mt(i, e) {
1404
- if (i <= 0)
1405
- return "";
1406
- const t = [], n = Math.floor(e * 982451653);
1407
- for (let o = 0; o < i; o++) {
1408
- const r = (n + o * 2654435761) % Math.pow(2, 32), s = Math.floor(
1409
- r / Math.pow(2, 32) * ie.length
1410
- );
1411
- t.push(ie[s]);
1412
- }
1413
- return t.length > 0 && (t[0] = t[0].charAt(0).toUpperCase() + t[0].slice(1)), t.join(" ") + ".";
1414
- }
1415
- export {
1416
- de as EventDispatcher,
1417
- Ye as PageBreakPlugin,
1418
- B as Paginator,
1419
- ht as ReportBuilder,
1420
- pt as SectionTocPlugin,
1421
- h as SplitResult,
1422
- Qe as TablePlugin,
1423
- nt as adjustPageSize,
1424
- C as attributePrefix,
1425
- ut as buildPageId,
1426
- Xe as cloneComponents,
1427
- mt as createLoremIpsumParagraph,
1428
- it as currentElementClassName,
1429
- ot as currentTextClassName,
1430
- gt as debugPlugin,
1431
- et as defaultPlugins,
1432
- at as enableDebugMode,
1433
- $ as getVisibleHeight,
1434
- je as globalStyle,
1435
- X as globalStyleId,
1436
- rt as ignoredElementClassName,
1437
- st as ignoredTextClassName,
1438
- ve as isDebugMode,
1439
- re as isElement,
1440
- be as isTextNode,
1441
- ct as layoutOptionsToAttributes,
1442
- g as logger,
1443
- me as loggerName,
1444
- lt as moveOffscreen,
1445
- Ke as pageBreakAttributeName,
1446
- U as pageClassName,
1447
- Re as pageMargin,
1448
- dt as pageSize,
1449
- He as paprize_isInitialized,
1450
- te as paprize_isReady,
1451
- ne as paprize_readJsonDataFile,
1452
- T as previewClassName,
1453
- v as reportStyles,
1454
- _e as sectionClassName,
1455
- tt as sectionTocName,
1456
- fe as tempContainerClassName
1457
- };
1458
- //# sourceMappingURL=paprize-core.js.map