@emailmaker/filemanager 0.10.83 → 0.10.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{file-manager-IconsTab-ww_epetO.js → file-manager-IconsTab-CJ34Rtaj.js} +2 -2
- package/file-manager-ImageCodeGenerator-CkdzoWfD.js +2 -0
- package/{file-manager-JsBarcode-CMRzMjTV.js → file-manager-JsBarcode-YTpHbsV3.js} +2 -2
- package/file-manager-browser-DgSQCpyR.js +2 -0
- package/{file-manager-index-Du1En8uk.js → file-manager-index-DptuziBQ.js} +9 -9
- package/file-manager.css +142 -142
- package/file-manager.esm.js +1 -1
- package/file-manager.js +1 -10
- package/package.json +1 -1
- package/file-manager-ImageCodeGenerator-BxkI9HtY.js +0 -2
- package/file-manager-index-CqMa6hmd.js +0 -2
package/file-manager.css
CHANGED
|
@@ -1,3 +1,145 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.em-filemanager .root {
|
|
3
|
+
padding: 16px 20px 24px;
|
|
4
|
+
max-width: 520px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.em-filemanager .controls {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 20px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.em-filemanager .segmentedControl {
|
|
14
|
+
background-color: var(--ant-color-fill-secondary, rgba(0, 0, 0, 0.06));
|
|
15
|
+
padding: 4px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.em-filemanager .sizeRow {
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-template-columns: 1fr 1fr;
|
|
21
|
+
gap: 16px 24px;
|
|
22
|
+
align-items: center;
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.em-filemanager .sizeRowLabel {
|
|
27
|
+
margin: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** InputNumber с prefix / suffix — ширина блока значения */
|
|
31
|
+
.em-filemanager .sizeInputNumber {
|
|
32
|
+
width: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.em-filemanager .sizeSuffix {
|
|
36
|
+
color: var(--ant-color-text-tertiary);
|
|
37
|
+
font-size: 13px;
|
|
38
|
+
line-height: 1;
|
|
39
|
+
-webkit-user-select: none;
|
|
40
|
+
user-select: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.em-filemanager .colorGrid {
|
|
44
|
+
display: grid;
|
|
45
|
+
grid-template-columns: 1fr 1fr;
|
|
46
|
+
gap: 16px 24px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.em-filemanager .colorCell {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
align-items: stretch;
|
|
53
|
+
gap: 8px;
|
|
54
|
+
min-width: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.em-filemanager .colorCellLabel {
|
|
58
|
+
margin: 0 !important;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.em-filemanager .colorPickerFull {
|
|
63
|
+
width: 100%;
|
|
64
|
+
justify-content: flex-start;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.em-filemanager .bgExtras {
|
|
68
|
+
grid-column: 1/-1;
|
|
69
|
+
margin-top: -8px;
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: 12px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.em-filemanager .bgWarning {
|
|
76
|
+
margin: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.em-filemanager .previewSection {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
gap: 12px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.em-filemanager .previewTitle {
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.em-filemanager .previewWrap {
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
align-items: center;
|
|
94
|
+
min-height: 220px;
|
|
95
|
+
padding: 16px;
|
|
96
|
+
border: 1px solid var(--ant-color-border-secondary, #f0f0f0);
|
|
97
|
+
border-radius: 8px;
|
|
98
|
+
background-color: var(--ant-color-fill-quaternary, #fafafa);
|
|
99
|
+
background-image: linear-gradient(45deg, #e8e8e8 25%, transparent 25%), linear-gradient(-45deg, #e8e8e8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e8e8e8 75%), linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
|
|
100
|
+
background-size: 16px 16px;
|
|
101
|
+
background-position: 0 0, 0 8px, 8px -8px, -8px 0;
|
|
102
|
+
position: relative;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.em-filemanager .scanLine {
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 50%;
|
|
109
|
+
left: 20%;
|
|
110
|
+
right: 20%;
|
|
111
|
+
height: 2px;
|
|
112
|
+
background-color: #ff4d4f;
|
|
113
|
+
box-shadow: 0 0 6px #ff4d4f;
|
|
114
|
+
z-index: 10;
|
|
115
|
+
pointer-events: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.em-filemanager .scanLineBarcode {
|
|
119
|
+
left: 10%;
|
|
120
|
+
right: 10%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.em-filemanager .previewWrapBarcode {
|
|
124
|
+
min-height: 104px;
|
|
125
|
+
padding: 12px 16px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.em-filemanager .previewCanvas {
|
|
129
|
+
display: block;
|
|
130
|
+
max-width: 100%;
|
|
131
|
+
height: auto;
|
|
132
|
+
background: transparent;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.em-filemanager .previewCanvasBarcode {
|
|
136
|
+
max-height: 120px;
|
|
137
|
+
width: auto;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.em-filemanager .actions {
|
|
141
|
+
margin-top: 8px;
|
|
142
|
+
}
|
|
1
143
|
.em-filemanager .iconsTab {
|
|
2
144
|
display: flex;
|
|
3
145
|
flex-direction: column;
|
|
@@ -434,148 +576,6 @@
|
|
|
434
576
|
background: rgba(255, 255, 255, 0.6);
|
|
435
577
|
pointer-events: all;
|
|
436
578
|
}
|
|
437
|
-
@charset "UTF-8";
|
|
438
|
-
.em-filemanager .root {
|
|
439
|
-
padding: 16px 20px 24px;
|
|
440
|
-
max-width: 520px;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.em-filemanager .controls {
|
|
444
|
-
display: flex;
|
|
445
|
-
flex-direction: column;
|
|
446
|
-
gap: 20px;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
.em-filemanager .segmentedControl {
|
|
450
|
-
background-color: var(--ant-color-fill-secondary, rgba(0, 0, 0, 0.06));
|
|
451
|
-
padding: 4px;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.em-filemanager .sizeRow {
|
|
455
|
-
display: grid;
|
|
456
|
-
grid-template-columns: 1fr 1fr;
|
|
457
|
-
gap: 16px 24px;
|
|
458
|
-
align-items: center;
|
|
459
|
-
width: 100%;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
.em-filemanager .sizeRowLabel {
|
|
463
|
-
margin: 0;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
/** InputNumber с prefix / suffix — ширина блока значения */
|
|
467
|
-
.em-filemanager .sizeInputNumber {
|
|
468
|
-
width: 100%;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
.em-filemanager .sizeSuffix {
|
|
472
|
-
color: var(--ant-color-text-tertiary);
|
|
473
|
-
font-size: 13px;
|
|
474
|
-
line-height: 1;
|
|
475
|
-
-webkit-user-select: none;
|
|
476
|
-
user-select: none;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.em-filemanager .colorGrid {
|
|
480
|
-
display: grid;
|
|
481
|
-
grid-template-columns: 1fr 1fr;
|
|
482
|
-
gap: 16px 24px;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
.em-filemanager .colorCell {
|
|
486
|
-
display: flex;
|
|
487
|
-
flex-direction: column;
|
|
488
|
-
align-items: stretch;
|
|
489
|
-
gap: 8px;
|
|
490
|
-
min-width: 0;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.em-filemanager .colorCellLabel {
|
|
494
|
-
margin: 0 !important;
|
|
495
|
-
white-space: nowrap;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
.em-filemanager .colorPickerFull {
|
|
499
|
-
width: 100%;
|
|
500
|
-
justify-content: flex-start;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
.em-filemanager .bgExtras {
|
|
504
|
-
grid-column: 1/-1;
|
|
505
|
-
margin-top: -8px;
|
|
506
|
-
display: flex;
|
|
507
|
-
flex-direction: column;
|
|
508
|
-
gap: 12px;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.em-filemanager .bgWarning {
|
|
512
|
-
margin: 0;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
.em-filemanager .previewSection {
|
|
516
|
-
display: flex;
|
|
517
|
-
flex-direction: column;
|
|
518
|
-
gap: 12px;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
.em-filemanager .previewTitle {
|
|
522
|
-
font-size: 14px;
|
|
523
|
-
font-weight: 600;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
.em-filemanager .previewWrap {
|
|
527
|
-
display: flex;
|
|
528
|
-
justify-content: center;
|
|
529
|
-
align-items: center;
|
|
530
|
-
min-height: 220px;
|
|
531
|
-
padding: 16px;
|
|
532
|
-
border: 1px solid var(--ant-color-border-secondary, #f0f0f0);
|
|
533
|
-
border-radius: 8px;
|
|
534
|
-
background-color: var(--ant-color-fill-quaternary, #fafafa);
|
|
535
|
-
background-image: linear-gradient(45deg, #e8e8e8 25%, transparent 25%), linear-gradient(-45deg, #e8e8e8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e8e8e8 75%), linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
|
|
536
|
-
background-size: 16px 16px;
|
|
537
|
-
background-position: 0 0, 0 8px, 8px -8px, -8px 0;
|
|
538
|
-
position: relative;
|
|
539
|
-
overflow: hidden;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.em-filemanager .scanLine {
|
|
543
|
-
position: absolute;
|
|
544
|
-
top: 50%;
|
|
545
|
-
left: 20%;
|
|
546
|
-
right: 20%;
|
|
547
|
-
height: 2px;
|
|
548
|
-
background-color: #ff4d4f;
|
|
549
|
-
box-shadow: 0 0 6px #ff4d4f;
|
|
550
|
-
z-index: 10;
|
|
551
|
-
pointer-events: none;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.em-filemanager .scanLineBarcode {
|
|
555
|
-
left: 10%;
|
|
556
|
-
right: 10%;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
.em-filemanager .previewWrapBarcode {
|
|
560
|
-
min-height: 104px;
|
|
561
|
-
padding: 12px 16px;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
.em-filemanager .previewCanvas {
|
|
565
|
-
display: block;
|
|
566
|
-
max-width: 100%;
|
|
567
|
-
height: auto;
|
|
568
|
-
background: transparent;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
.em-filemanager .previewCanvasBarcode {
|
|
572
|
-
max-height: 120px;
|
|
573
|
-
width: auto;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
.em-filemanager .actions {
|
|
577
|
-
margin-top: 8px;
|
|
578
|
-
}
|
|
579
579
|
.em-filemanager .noFilesContainer {
|
|
580
580
|
text-align: center;
|
|
581
581
|
}
|
package/file-manager.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{D as FileContent,J as FileManagerApiError,C as FileManagerApp,x as FileManagerAppWithContext,E as FileModals,G as FolderSidebar,P as PixieOnlyApp,B as default,v as init,A as initFileManager,y as initPixieEditor,H as installResizeObserverErrorHandler,K as mapHttpStatusToErrorCode,I as uninstallResizeObserverErrorHandler,w as unmount,z as unmountPixieEditor}from"./file-manager-index-
|
|
1
|
+
export{D as FileContent,J as FileManagerApiError,C as FileManagerApp,x as FileManagerAppWithContext,E as FileModals,G as FolderSidebar,P as PixieOnlyApp,B as default,v as init,A as initFileManager,y as initPixieEditor,H as installResizeObserverErrorHandler,K as mapHttpStatusToErrorCode,I as uninstallResizeObserverErrorHandler,w as unmount,z as unmountPixieEditor}from"./file-manager-index-DptuziBQ.js";import"react/jsx-runtime";import"react";import"react-dom/client";import"antd";import"antd/es/alert/ErrorBoundary";import"@ant-design/icons";import"react-dom";
|
|
2
2
|
//# sourceMappingURL=file-manager.esm.js.map
|
package/file-manager.js
CHANGED
|
@@ -93508,15 +93508,6 @@ const FileManagerContent = () => {
|
|
|
93508
93508
|
else {
|
|
93509
93509
|
fileUpload.markAsSuccess(uploadId);
|
|
93510
93510
|
}
|
|
93511
|
-
const rawTargetFolderId = (uploaded && uploaded.folderId) || selectedFolder || null;
|
|
93512
|
-
if (handleFolderSelect) {
|
|
93513
|
-
if (!rawTargetFolderId || rawTargetFolderId === 'folders') {
|
|
93514
|
-
handleFolderSelect('folders');
|
|
93515
|
-
}
|
|
93516
|
-
else {
|
|
93517
|
-
handleFolderSelect(rawTargetFolderId);
|
|
93518
|
-
}
|
|
93519
|
-
}
|
|
93520
93511
|
await ((_a = folderSidebarRef.current) === null || _a === void 0 ? void 0 : _a.refreshFileCounts());
|
|
93521
93512
|
return uploaded;
|
|
93522
93513
|
}
|
|
@@ -93526,7 +93517,7 @@ const FileManagerContent = () => {
|
|
|
93526
93517
|
fileUpload.markAsError(uploadId, errorMessage);
|
|
93527
93518
|
throw error;
|
|
93528
93519
|
}
|
|
93529
|
-
}, [filesApi, fileUpload, selectedFolder, files
|
|
93520
|
+
}, [filesApi, fileUpload, selectedFolder, files]);
|
|
93530
93521
|
const handleDroppedFilesWithRefresh = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useCallback(async (files) => {
|
|
93531
93522
|
var _a;
|
|
93532
93523
|
if (handleDroppedFiles) {
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{useRef as t,useCallback as o,useState as n,useMemo as i,useEffect as s}from"react";import{Segmented as l,Alert as c,Input as d,Typography as h,InputNumber as m,ColorPicker as u,Checkbox as g,Button as p}from"antd";import{u as w,a as f,q as v}from"./file-manager-index-Du1En8uk.js";import"@ant-design/icons";import"react-dom/client";import"antd/es/alert/ErrorBoundary";import"react-dom";const b=({size:e=24,color:a="currentColor",...t})=>r.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:a,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},r.createElement("path",{d:"m14 10 7-7m0 0h-6m6 0v6m-11 5-7 7m0 0h6m-6 0v-6"}));b.displayName="Expand01";var x={root:"root",controls:"controls",segmentedControl:"segmentedControl",sizeRow:"sizeRow",sizeRowLabel:"sizeRowLabel",sizeInputNumber:"sizeInputNumber",sizeSuffix:"sizeSuffix",colorGrid:"colorGrid",colorCell:"colorCell",colorCellLabel:"colorCellLabel",colorPickerFull:"colorPickerFull",bgExtras:"bgExtras",bgWarning:"bgWarning",previewSection:"previewSection",previewTitle:"previewTitle",previewWrap:"previewWrap",scanLine:"scanLine",scanLineBarcode:"scanLineBarcode",previewWrapBarcode:"previewWrapBarcode",previewCanvas:"previewCanvas",previewCanvasBarcode:"previewCanvasBarcode",actions:"actions"};const C=({customRequest:r,state:C,setState:N})=>{var M,y;const{t:k}=w(),{options:B}=f(),j=null!==(y=null===(M=null==B?void 0:B.config)||void 0===M?void 0:M.iconStrokeWidth)&&void 0!==y?y:1.75,z=t(null),{mode:S,rawText:E,foregroundHex:L,backgroundHex:P,transparentBackground:R,qrSidePx:O,barcodeBarHeightPx:T}=C,W=o(e=>N(a=>Object.assign(Object.assign({},a),{mode:e})),[N]),q=o(e=>N(a=>Object.assign(Object.assign({},a),{rawText:e})),[N]),H=o(e=>N(a=>Object.assign(Object.assign({},a),{foregroundHex:e})),[N]),I=o(e=>N(a=>Object.assign(Object.assign({},a),{backgroundHex:e})),[N]),F=o(e=>N(a=>Object.assign(Object.assign({},a),{transparentBackground:e})),[N]),G=o(e=>N(a=>Object.assign(Object.assign({},a),{qrSidePx:e})),[N]),A=o(e=>N(a=>Object.assign(Object.assign({},a),{barcodeBarHeightPx:e})),[N]),[D,J]=n(E),[Q,V]=n(null),[U,$]=n(!1),K=i(()=>v.debounce(e=>J(e),300),[]);s(()=>(K(E),()=>{K.cancel()}),[E,K]);const X=R?"#00000000":P,Y=o(async(e,a)=>{const r=(await import("./file-manager-index-CqMa6hmd.js").then(function(e){return e.i})).default,t=a.trim(),o=Math.min(280,Math.max(80,O));if(!t){e.width=o,e.height=o;const a=e.getContext("2d");return void(a&&a.clearRect(0,0,e.width,e.height))}e.width=o,e.height=o,await r.toCanvas(e,t,{width:o,margin:2,color:{dark:L,light:X}})},[L,X,O]),Z=o(async(e,a)=>{const r=(await import("./file-manager-JsBarcode-CMRzMjTV.js").then(function(e){return e.J})).default,t=a.trim(),o=R?"rgba(0,0,0,0)":P,n=Math.min(72,Math.max(24,T)),i=Math.max(1,Math.round(n/42)),s=Math.max(4,Math.round(.07*n)),l=Math.max(10,Math.round(.15*n));if(!t){e.width=Math.round(4*n),e.height=Math.round(1.65*n);const a=e.getContext("2d");return void(a&&a.clearRect(0,0,e.width,e.height))}e.width=Math.round(4.2*n),e.height=Math.round(1.65*n),r(e,t,{format:"CODE128",displayValue:!0,background:o,lineColor:L,margin:s,width:i,height:n,fontSize:l})},[L,P,R,T]);s(()=>{const e=z.current;if(!e)return;let a=!1;return(async()=>{try{"qr"===S?await Y(e,D):await Z(e,D),a||V(null)}catch(r){const t=r instanceof Error?r.message:String(r);if(!a){V("barcode"===S?k("Barcode generation failed"):t);const a=e.getContext("2d");a&&a.clearRect(0,0,e.width,e.height)}}})(),()=>{a=!0}},[S,D,Z,Y,k]);const _=o(async()=>{K.flush();const e=E.trim();if(!e)throw new Error(k("Enter text or URL to preview"));const a="undefined"==typeof window?2:Math.min(3,Math.max(2,window.devicePixelRatio||2));if("qr"===S){const r=Math.min(600,Math.max(80,O)),t=Math.round(r*a),o=document.createElement("canvas");o.width=t,o.height=t;const n=(await import("./file-manager-index-CqMa6hmd.js").then(function(e){return e.i})).default;await n.toCanvas(o,e,{width:t,margin:2,color:{dark:L,light:X}});const i=await new Promise(e=>o.toBlob(e,"image/png"));if(!i)throw new Error("PNG export failed");return i}const r=(await import("./file-manager-JsBarcode-CMRzMjTV.js").then(function(e){return e.J})).default,t=document.createElement("canvas"),o=R?"rgba(0,0,0,0)":P,n=Math.min(130,Math.max(24,T)),i=Math.max(6,Math.round(.1*n)),s=Math.max(2,Math.round(n/36)),l=Math.max(12,Math.round(.16*n));r(t,e,{format:"CODE128",displayValue:!0,background:o,lineColor:L,margin:Math.round(i*a),width:Math.round(s*a),height:Math.round(n*a),fontSize:Math.round(l*a)});const c=await new Promise(e=>t.toBlob(e,"image/png"));if(!c)throw new Error("PNG export failed");return c},[S,E,L,X,P,R,O,T,K,k]),ee=o(async()=>{if(U)return;if(E.trim()){$(!0);try{let e;try{e=await _()}catch(e){const a=e instanceof Error?e.message:String(e);return void V(a)}const a=new File([e],`${"qr"===S?"qr-code":"barcode"}-${Date.now()}.png`,{type:"image/png",lastModified:Date.now()});await Promise.resolve(r({file:a}))}finally{$(!1)}}},[r,_,S,E,U]),ae=Boolean(E.trim())&&!Q;return e("div",{className:x.root,children:a("div",{className:x.controls,children:[e(l,{block:!0,className:x.segmentedControl,value:S,onChange:e=>{W(e),V(null)},options:[{label:k("QR code"),value:"qr"},{label:k("Barcode"),value:"barcode"}]}),Q&&e(c,{type:"error",message:k("Validation error"),description:Q,showIcon:!0,closable:!0,onClose:()=>V(null)}),e(d.TextArea,{value:E,onChange:e=>{q(e.target.value),V(null)},placeholder:k("Text or URL"),rows:3,spellCheck:!1,autoComplete:"off"}),a("div",{className:x.sizeRow,children:[e(h.Text,{type:"secondary",className:x.sizeRowLabel,children:k("qr"===S?"QR image size px":"Barcode bar height px")}),e(m,"qr"===S?{className:x.sizeInputNumber,min:80,max:600,step:8,value:O,onChange:e=>G("number"!=typeof e||Number.isNaN(e)?200:e),prefix:e(b,{size:18,strokeWidth:j}),suffix:e("span",{className:x.sizeSuffix,children:"px"}),"aria-label":k("QR image size px")}:{className:x.sizeInputNumber,min:24,max:130,step:4,value:T,onChange:e=>A("number"!=typeof e||Number.isNaN(e)?60:e),prefix:e(b,{size:18,strokeWidth:j}),suffix:e("span",{className:x.sizeSuffix,children:"px"}),"aria-label":k("Barcode bar height px")})]}),a("div",{className:x.colorGrid,children:[a("div",{className:x.colorCell,children:[e(h.Text,{type:"secondary",className:x.colorCellLabel,children:k("Code color","Code color")}),e(u,{className:x.colorPickerFull,value:L,format:"hex",disabledAlpha:!0,showText:!0,onChange:(e,a)=>{const r="string"==typeof e?e:(null==e?void 0:e.toHexString)?e.toHexString():a;H(r)}})]}),a("div",{className:x.colorCell,children:[e(h.Text,{type:"secondary",className:x.colorCellLabel,children:k("Background color","Background color")}),e(u,{className:x.colorPickerFull,value:P,format:"hex",disabledAlpha:!0,showText:!0,disabled:R,onChange:(e,a)=>{const r="string"==typeof e?e:(null==e?void 0:e.toHexString)?e.toHexString():a;I(r)}})]}),a("div",{className:x.bgExtras,children:[e(g,{checked:R,onChange:e=>F(e.target.checked),children:k("Transparent background","Transparent background")}),R&&e(c,{type:"warning",showIcon:!0,message:k("QR transparent background hint"),className:x.bgWarning})]})]}),a("div",{className:x.previewSection,children:[e(h.Text,{className:x.previewTitle,children:k("Preview","Preview")}),a("div",{className:[x.previewWrap,"barcode"===S&&x.previewWrapBarcode].filter(Boolean).join(" "),children:[e("div",{className:[x.scanLine,"barcode"===S&&x.scanLineBarcode].filter(Boolean).join(" ")}),e("canvas",{ref:z,className:[x.previewCanvas,"barcode"===S&&x.previewCanvasBarcode].filter(Boolean).join(" "),"aria-label":k("Preview")})]})]}),e("div",{className:x.actions,children:e(p,{type:"primary",onClick:()=>{ee()},loading:U,disabled:!ae,children:k("Add to My files")})})]})})};export{C as default};
|
|
2
|
-
//# sourceMappingURL=file-manager-ImageCodeGenerator-BxkI9HtY.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t}from"./file-manager-index-Du1En8uk.js";import e from"fs";import n from"util";import r from"stream";import i from"zlib";import o from"assert";import s from"buffer";var a,h,u={};function l(){return h?a:(h=1,a=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then})}var f,c={},d={};function p(){if(f)return d;let t;f=1;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return d.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},d.getSymbolTotalCodewords=function(t){return e[t]},d.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},d.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');t=e},d.isKanjiModeEnabled=function(){return void 0!==t},d.toSJIS=function(e){return t(e)},d}var g,_,m,w,y,E={};function b(){return g||(g=1,(t=E).L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(t){return n}}),E;var t}var T,C={};var A,I={};var P,L={};var B,R={};function v(){if(B)return R;B=1;const t=b(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return R.getBlocksCount=function(n,r){switch(r){case t.L:return e[4*(n-1)+0];case t.M:return e[4*(n-1)+1];case t.Q:return e[4*(n-1)+2];case t.H:return e[4*(n-1)+3];default:return}},R.getTotalCodewordsCount=function(e,r){switch(r){case t.L:return n[4*(e-1)+0];case t.M:return n[4*(e-1)+1];case t.Q:return n[4*(e-1)+2];case t.H:return n[4*(e-1)+3];default:return}},R}var O,x,M,k,N={},D={};function S(){return x||(x=1,function(t){const e=function(){if(O)return D;O=1;const t=new Uint8Array(512),e=new Uint8Array(256);return function(){let n=1;for(let r=0;r<255;r++)t[r]=n,e[n]=r,n<<=1,256&n&&(n^=285);for(let e=255;e<512;e++)t[e]=t[e-255]}(),D.log=function(t){if(t<1)throw new Error("log("+t+")");return e[t]},D.exp=function(e){return t[e]},D.mul=function(n,r){return 0===n||0===r?0:t[e[n]+e[r]]},D}();t.mul=function(t,n){const r=new Uint8Array(t.length+n.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<n.length;o++)r[i+o]^=e.mul(t[i],n[o]);return r},t.mod=function(t,n){let r=new Uint8Array(t);for(;r.length-n.length>=0;){const t=r[0];for(let i=0;i<n.length;i++)r[i]^=e.mul(n[i],t);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},t.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=t.mul(r,new Uint8Array([1,e.exp(i)]));return r}}(N)),N}var U,Y={},H={},F={};function z(){return U||(U=1,F.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),F}var G,j,W,K={};function J(){if(G)return K;G=1;const t="[0-9]+";let e="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";e=e.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+e+")(?:.|[\r\n]))+";K.KANJI=new RegExp(e,"g"),K.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),K.BYTE=new RegExp(n,"g"),K.NUMERIC=new RegExp(t,"g"),K.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const r=new RegExp("^"+e+"$"),i=new RegExp("^"+t+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return K.testKanji=function(t){return r.test(t)},K.testNumeric=function(t){return i.test(t)},K.testAlphanumeric=function(t){return o.test(t)},K}function V(){return j||(j=1,function(t){const e=z(),n=J();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,n){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!e.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?t.ccBits[0]:n<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(e){return n.testNumeric(e)?t.NUMERIC:n.testAlphanumeric(e)?t.ALPHANUMERIC:n.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(t){return n}}}(H)),H}function q(){return W||(W=1,function(t){const e=p(),n=v(),r=b(),i=V(),o=z(),s=e.getBCHDigit(7973);function a(t,e){return i.getCharCountIndicator(t,e)+4}function h(t,e){let n=0;return t.forEach(function(t){const r=a(t.mode,e);n+=r+t.getBitsLength()}),n}t.from=function(t,e){return o.isValid(t)?parseInt(t,10):e},t.getCapacity=function(t,r,s){if(!o.isValid(t))throw new Error("Invalid QR Code version");void 0===s&&(s=i.BYTE);const h=8*(e.getSymbolTotalCodewords(t)-n.getTotalCodewordsCount(t,r));if(s===i.MIXED)return h;const u=h-a(s,t);switch(s){case i.NUMERIC:return Math.floor(u/10*3);case i.ALPHANUMERIC:return Math.floor(u/11*2);case i.KANJI:return Math.floor(u/13);case i.BYTE:default:return Math.floor(u/8)}},t.getBestVersionForData=function(e,n){let o;const s=r.from(n,r.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let r=1;r<=40;r++)if(h(e,r)<=t.getCapacity(r,n,i.MIXED))return r}(e,s);if(0===e.length)return 1;o=e[0]}else o=e;return function(e,n,r){for(let i=1;i<=40;i++)if(n<=t.getCapacity(i,r,e))return i}(o.mode,o.getLength(),s)},t.getEncodedBits=function(t){if(!o.isValid(t)||t<7)throw new Error("Invalid QR Code version");let n=t<<12;for(;e.getBCHDigit(n)-s>=0;)n^=7973<<e.getBCHDigit(n)-s;return t<<12|n}}(Y)),Y}var Q,Z={};var $,X,tt,et,nt,rt,it,ot,st={};var at,ht,ut,lt={exports:{}};function ft(){return at||(at=1,function(t){var e={single_source_shortest_paths:function(t,n,r){var i={},o={};o[n]=0;var s,a,h,u,l,f,c,d=e.PriorityQueue.make();for(d.push(n,0);!d.empty();)for(h in a=(s=d.pop()).value,u=s.cost,l=t[a]||{})l.hasOwnProperty(h)&&(f=u+l[h],c=o[h],(void 0===o[h]||c>f)&&(o[h]=f,d.push(h,f),i[h]=a));if(void 0!==r&&void 0===o[r]){var p=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(p)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,n,r){var i=e.single_source_shortest_paths(t,n,r);return e.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var n,r=e.PriorityQueue,i={};for(n in t=t||{},r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=e}(lt)),lt.exports}function ct(){return ht||(ht=1,function(t){const e=V(),n=function(){if(X)return $;X=1;const t=V();function e(e){this.mode=t.NUMERIC,this.data=e.toString()}return e.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(t){let e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);const i=this.data.length-e;i>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*i+1))},$=e}(),r=function(){if(et)return tt;et=1;const t=V(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(e){this.mode=t.ALPHANUMERIC,this.data=e}return n.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=45*e.indexOf(this.data[n]);r+=e.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(e.indexOf(this.data[n]),6)},tt=n}(),i=function(){if(rt)return nt;rt=1;const t=V();function e(e){this.mode=t.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}return e.getBitsLength=function(t){return 8*t},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)},nt=e}(),o=function(){if(ot)return it;ot=1;const t=V(),e=p();function n(e){this.mode=t.KANJI,this.data=e}return n.getBitsLength=function(t){return 13*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n;for(n=0;n<this.data.length;n++){let r=e.toSJIS(this.data[n]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[n]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}},it=n}(),s=J(),a=p(),h=ft();function u(t){return unescape(encodeURIComponent(t)).length}function l(t,e,n){const r=[];let i;for(;null!==(i=t.exec(n));)r.push({data:i[0],index:i.index,mode:e,length:i[0].length});return r}function f(t){const n=l(s.NUMERIC,e.NUMERIC,t),r=l(s.ALPHANUMERIC,e.ALPHANUMERIC,t);let i,o;a.isKanjiModeEnabled()?(i=l(s.BYTE,e.BYTE,t),o=l(s.KANJI,e.KANJI,t)):(i=l(s.BYTE_KANJI,e.BYTE,t),o=[]);return n.concat(r,i,o).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function c(t,s){switch(s){case e.NUMERIC:return n.getBitsLength(t);case e.ALPHANUMERIC:return r.getBitsLength(t);case e.KANJI:return o.getBitsLength(t);case e.BYTE:return i.getBitsLength(t)}}function d(t,s){let h;const u=e.getBestModeForData(t);if(h=e.from(s,u),h!==e.BYTE&&h.bit<u.bit)throw new Error('"'+t+'" cannot be encoded with mode '+e.toString(h)+".\n Suggested mode is: "+e.toString(u));switch(h!==e.KANJI||a.isKanjiModeEnabled()||(h=e.BYTE),h){case e.NUMERIC:return new n(t);case e.ALPHANUMERIC:return new r(t);case e.KANJI:return new o(t);case e.BYTE:return new i(t)}}t.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(d(e,null)):e.data&&t.push(d(e.data,e.mode)),t},[])},t.fromString=function(n,r){const i=function(t){const n=[];for(let r=0;r<t.length;r++){const i=t[r];switch(i.mode){case e.NUMERIC:n.push([i,{data:i.data,mode:e.ALPHANUMERIC,length:i.length},{data:i.data,mode:e.BYTE,length:i.length}]);break;case e.ALPHANUMERIC:n.push([i,{data:i.data,mode:e.BYTE,length:i.length}]);break;case e.KANJI:n.push([i,{data:i.data,mode:e.BYTE,length:u(i.data)}]);break;case e.BYTE:n.push([{data:i.data,mode:e.BYTE,length:u(i.data)}])}}return n}(f(n,a.isKanjiModeEnabled())),o=function(t,n){const r={},i={start:{}};let o=["start"];for(let s=0;s<t.length;s++){const a=t[s],h=[];for(let t=0;t<a.length;t++){const u=a[t],l=""+s+t;h.push(l),r[l]={node:u,lastCount:0},i[l]={};for(let t=0;t<o.length;t++){const s=o[t];r[s]&&r[s].node.mode===u.mode?(i[s][l]=c(r[s].lastCount+u.length,u.mode)-c(r[s].lastCount,u.mode),r[s].lastCount+=u.length):(r[s]&&(r[s].lastCount=u.length),i[s][l]=c(u.length,u.mode)+4+e.getCharCountIndicator(u.mode,n))}}o=h}for(let t=0;t<o.length;t++)i[o[t]].end=0;return{map:i,table:r}}(i,r),s=h.find_path(o.map,"start","end"),l=[];for(let t=1;t<s.length-1;t++)l.push(o.table[s[t]].node);return t.fromArray(function(t){return t.reduce(function(t,e){const n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}(l))},t.rawSplit=function(e){return t.fromArray(f(e,a.isKanjiModeEnabled()))}}(st)),st}function dt(){if(ut)return c;ut=1;const t=p(),e=b(),n=function(){if(m)return _;function t(){this.buffer=[],this.length=0}return m=1,t.prototype={get:function(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(let n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},_=t}(),r=function(){if(y)return w;function t(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return y=1,t.prototype.set=function(t,e,n,r){const i=t*this.size+e;this.data[i]=n,r&&(this.reservedBit[i]=!0)},t.prototype.get=function(t,e){return this.data[t*this.size+e]},t.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},t.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},w=t}(),i=(T||(T=1,function(t){const e=p().getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const n=Math.floor(t/7)+2,r=e(t),i=145===r?26:2*Math.ceil((r-13)/(2*n-2)),o=[r-7];for(let t=1;t<n-1;t++)o[t]=o[t-1]-i;return o.push(6),o.reverse()},t.getPositions=function(e){const n=[],r=t.getRowColCoords(e),i=r.length;for(let t=0;t<i;t++)for(let e=0;e<i;e++)0===t&&0===e||0===t&&e===i-1||t===i-1&&0===e||n.push([r[t],r[e]]);return n}}(C)),C),o=function(){if(A)return I;A=1;const t=p().getSymbolSize;return I.getPositions=function(e){const n=t(e);return[[0,0],[n-7,0],[0,n-7]]},I}(),s=(P||(P=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e=3,n=3,r=40,i=10;function o(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(n+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return n*r%2+n*r%3==0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(t){const n=t.size;let r=0,i=0,o=0,s=null,a=null;for(let h=0;h<n;h++){i=o=0,s=a=null;for(let u=0;u<n;u++){let n=t.get(h,u);n===s?i++:(i>=5&&(r+=e+(i-5)),s=n,i=1),n=t.get(u,h),n===a?o++:(o>=5&&(r+=e+(o-5)),a=n,o=1)}i>=5&&(r+=e+(i-5)),o>=5&&(r+=e+(o-5))}return r},t.getPenaltyN2=function(t){const e=t.size;let r=0;for(let n=0;n<e-1;n++)for(let i=0;i<e-1;i++){const e=t.get(n,i)+t.get(n,i+1)+t.get(n+1,i)+t.get(n+1,i+1);4!==e&&0!==e||r++}return r*n},t.getPenaltyN3=function(t){const e=t.size;let n=0,i=0,o=0;for(let r=0;r<e;r++){i=o=0;for(let s=0;s<e;s++)i=i<<1&2047|t.get(r,s),s>=10&&(1488===i||93===i)&&n++,o=o<<1&2047|t.get(s,r),s>=10&&(1488===o||93===o)&&n++}return n*r},t.getPenaltyN4=function(t){let e=0;const n=t.data.length;for(let r=0;r<n;r++)e+=t.data[r];return Math.abs(Math.ceil(100*e/n/5)-10)*i},t.applyMask=function(t,e){const n=e.size;for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.isReserved(i,r)||e.xor(i,r,o(t,i,r))},t.getBestMask=function(e,n){const r=Object.keys(t.Patterns).length;let i=0,o=1/0;for(let s=0;s<r;s++){n(s),t.applyMask(s,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(s,e),r<o&&(o=r,i=s)}return i}}(L)),L),a=v(),h=function(){if(k)return M;k=1;const t=S();function e(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(e){this.degree=e,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(e.length+this.degree);n.set(e);const r=t.mod(n,this.genPoly),i=this.degree-r.length;if(i>0){const t=new Uint8Array(this.degree);return t.set(r,i),t}return r},M=e}(),u=q(),l=function(){if(Q)return Z;Q=1;const t=p(),e=t.getBCHDigit(1335);return Z.getEncodedBits=function(n,r){const i=n.bit<<3|r;let o=i<<10;for(;t.getBCHDigit(o)-e>=0;)o^=1335<<t.getBCHDigit(o)-e;return 21522^(i<<10|o)},Z}(),f=V(),d=ct();function g(t,e,n){const r=t.size,i=l.getEncodedBits(e,n);let o,s;for(o=0;o<15;o++)s=1==(i>>o&1),o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(r-15+o,8,s,!0),o<8?t.set(8,r-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(r-8,8,1,!0)}function E(e,r,i){const o=new n;i.forEach(function(t){o.put(t.mode.bit,4),o.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(o)});const s=8*(t.getSymbolTotalCodewords(e)-a.getTotalCodewordsCount(e,r));for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);const u=(s-o.getLengthInBits())/8;for(let t=0;t<u;t++)o.put(t%2?17:236,8);return function(e,n,r){const i=t.getSymbolTotalCodewords(n),o=a.getTotalCodewordsCount(n,r),s=i-o,u=a.getBlocksCount(n,r),l=i%u,f=u-l,c=Math.floor(i/u),d=Math.floor(s/u),p=d+1,g=c-d,_=new h(g);let m=0;const w=new Array(u),y=new Array(u);let E=0;const b=new Uint8Array(e.buffer);for(let t=0;t<u;t++){const e=t<f?d:p;w[t]=b.slice(m,m+e),y[t]=_.encode(w[t]),m+=e,E=Math.max(E,e)}const T=new Uint8Array(i);let C,A,I=0;for(C=0;C<E;C++)for(A=0;A<u;A++)C<w[A].length&&(T[I++]=w[A][C]);for(C=0;C<g;C++)for(A=0;A<u;A++)T[I++]=y[A][C];return T}(o,e,r)}function B(e,n,a,h){let l;if(Array.isArray(e))l=d.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let t=n;if(!t){const n=d.rawSplit(e);t=u.getBestVersionForData(n,a)}l=d.fromString(e,t||40)}}const f=u.getBestVersionForData(l,a);if(!f)throw new Error("The amount of data is too big to be stored in a QR Code");if(n){if(n<f)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+f+".\n")}else n=f;const c=E(n,a,l),p=t.getSymbolSize(n),_=new r(p);return function(t,e){const n=t.size,r=o.getPositions(e);for(let e=0;e<r.length;e++){const i=r[e][0],o=r[e][1];for(let e=-1;e<=7;e++)if(!(i+e<=-1||n<=i+e))for(let r=-1;r<=7;r++)o+r<=-1||n<=o+r||(e>=0&&e<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===e||6===e)||e>=2&&e<=4&&r>=2&&r<=4?t.set(i+e,o+r,!0,!0):t.set(i+e,o+r,!1,!0))}}(_,n),function(t){const e=t.size;for(let n=8;n<e-8;n++){const e=n%2==0;t.set(n,6,e,!0),t.set(6,n,e,!0)}}(_),function(t,e){const n=i.getPositions(e);for(let e=0;e<n.length;e++){const r=n[e][0],i=n[e][1];for(let e=-2;e<=2;e++)for(let n=-2;n<=2;n++)-2===e||2===e||-2===n||2===n||0===e&&0===n?t.set(r+e,i+n,!0,!0):t.set(r+e,i+n,!1,!0)}}(_,n),g(_,a,0),n>=7&&function(t,e){const n=t.size,r=u.getEncodedBits(e);let i,o,s;for(let e=0;e<18;e++)i=Math.floor(e/3),o=e%3+n-8-3,s=1==(r>>e&1),t.set(i,o,s,!0),t.set(o,i,s,!0)}(_,n),function(t,e){const n=t.size;let r=-1,i=n-1,o=7,s=0;for(let a=n-1;a>0;a-=2)for(6===a&&a--;;){for(let n=0;n<2;n++)if(!t.isReserved(i,a-n)){let r=!1;s<e.length&&(r=1==(e[s]>>>o&1)),t.set(i,a-n,r),o--,-1===o&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}(_,c),isNaN(h)&&(h=s.getBestMask(_,g.bind(null,_,a))),s.applyMask(h,_),g(_,a,h),{modules:_,version:n,errorCorrectionLevel:a,maskPattern:h,segments:l}}return c.create=function(n,r){if(void 0===n||""===n)throw new Error("No input text");let i,o,a=e.M;return void 0!==r&&(a=e.from(r.errorCorrectionLevel,e.M),i=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),B(n,i,a,o)},c}var pt,gt={},_t={},mt={exports:{}},wt={exports:{}};function yt(){if(pt)return wt.exports;pt=1;let t=n,e=r,i=wt.exports=function(){e.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};return t.inherits(i,e),i.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},i.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let n;return n=Buffer.isBuffer(t)?t:Buffer.from(t,e||this._encoding),this._buffers.push(n),this._buffered+=n.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},i.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},i.prototype.destroySoon=i.prototype.end,i.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},i.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},i.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},i.prototype._processRead=function(t){this._reads.shift();let e=0,n=0,r=Buffer.alloc(t.length);for(;e<t.length;){let i=this._buffers[n++],o=Math.min(i.length,t.length-e);i.copy(r,e,0,o),e+=o,o!==i.length&&(this._buffers[--n]=i.slice(o))}n>0&&this._buffers.splice(0,n),this._buffered-=t.length,t.func.call(this,r)},i.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}},wt.exports}var Et,bt,Tt,Ct,At,It={exports:{}},Pt={exports:{}},Lt={};function Bt(){if(Et)return Lt;Et=1;let t=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];return Lt.getImagePasses=function(e,n){let r=[],i=e%8,o=n%8,s=(e-i)/8,a=(n-o)/8;for(let e=0;e<t.length;e++){let n=t[e],h=s*n.x.length,u=a*n.y.length;for(let t=0;t<n.x.length&&n.x[t]<i;t++)h++;for(let t=0;t<n.y.length&&n.y[t]<o;t++)u++;h>0&&u>0&&r.push({width:h,height:u,index:e})}return r},Lt.getInterlaceIterator=function(e){return function(n,r,i){let o=n%t[i].x.length,s=(n-o)/t[i].x.length*8+t[i].x[o],a=r%t[i].y.length;return 4*s+((r-a)/t[i].y.length*8+t[i].y[a])*e*4}},Lt}function Rt(){return Tt?bt:(Tt=1,bt=function(t,e,n){let r=t+e-n,i=Math.abs(r-t),o=Math.abs(r-e),s=Math.abs(r-n);return i<=o&&i<=s?t:o<=s?e:n})}function vt(){if(Ct)return Pt.exports;Ct=1;let t=Bt(),e=Rt();function n(t,e,n){let r=t*e;return 8!==n&&(r=Math.ceil(r/(8/n))),r}let r=Pt.exports=function(e,r){let i=e.width,o=e.height,s=e.interlace,a=e.bpp,h=e.depth;if(this.read=r.read,this.write=r.write,this.complete=r.complete,this._imageIndex=0,this._images=[],s){let e=t.getImagePasses(i,o);for(let t=0;t<e.length;t++)this._images.push({byteWidth:n(e[t].width,a,h),height:e[t].height,lineIndex:0})}else this._images.push({byteWidth:n(i,a,h),height:o,lineIndex:0});this._xComparison=8===h?a:16===h?2*a:1};return r.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},r.prototype._unFilterType1=function(t,e,n){let r=this._xComparison,i=r-1;for(let o=0;o<n;o++){let n=t[1+o],s=o>i?e[o-r]:0;e[o]=n+s}},r.prototype._unFilterType2=function(t,e,n){let r=this._lastLine;for(let i=0;i<n;i++){let n=t[1+i],o=r?r[i]:0;e[i]=n+o}},r.prototype._unFilterType3=function(t,e,n){let r=this._xComparison,i=r-1,o=this._lastLine;for(let s=0;s<n;s++){let n=t[1+s],a=o?o[s]:0,h=s>i?e[s-r]:0,u=Math.floor((h+a)/2);e[s]=n+u}},r.prototype._unFilterType4=function(t,n,r){let i=this._xComparison,o=i-1,s=this._lastLine;for(let a=0;a<r;a++){let r=t[1+a],h=s?s[a]:0,u=a>o?n[a-i]:0,l=a>o&&s?s[a-i]:0,f=e(u,h,l);n[a]=r+f}},r.prototype._reverseFilterLine=function(t){let e,n=t[0],r=this._images[this._imageIndex],i=r.byteWidth;if(0===n)e=t.slice(1,i+1);else switch(e=Buffer.alloc(i),n){case 1:this._unFilterType1(t,e,i);break;case 2:this._unFilterType2(t,e,i);break;case 3:this._unFilterType3(t,e,i);break;case 4:this._unFilterType4(t,e,i);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(e),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=e,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())},Pt.exports}var Ot,xt,Mt={exports:{}};function kt(){return xt?Ot:(xt=1,Ot={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5})}var Nt,Dt,St={exports:{}};function Ut(){if(Nt)return St.exports;Nt=1;let t=[];!function(){for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)1&n?n=3988292384^n>>>1:n>>>=1;t[e]=n}}();let e=St.exports=function(){this._crc=-1};return e.prototype.write=function(e){for(let n=0;n<e.length;n++)this._crc=t[255&(this._crc^e[n])]^this._crc>>>8;return!0},e.prototype.crc32=function(){return-1^this._crc},e.crc32=function(e){let n=-1;for(let r=0;r<e.length;r++)n=t[255&(n^e[r])]^n>>>8;return-1^n},St.exports}function Yt(){if(Dt)return Mt.exports;Dt=1;let t=kt(),e=Ut(),n=Mt.exports=function(e,n){this._options=e,e.checkCRC=!1!==e.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[t.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[t.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[t.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[t.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[t.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[t.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=n.read,this.error=n.error,this.metadata=n.metadata,this.gamma=n.gamma,this.transColor=n.transColor,this.palette=n.palette,this.parsed=n.parsed,this.inflateData=n.inflateData,this.finished=n.finished,this.simpleTransparency=n.simpleTransparency,this.headersFinished=n.headersFinished||function(){}};return n.prototype.start=function(){this.read(t.PNG_SIGNATURE.length,this._parseSignature.bind(this))},n.prototype._parseSignature=function(e){let n=t.PNG_SIGNATURE;for(let t=0;t<n.length;t++)if(e[t]!==n[t])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},n.prototype._parseChunkBegin=function(n){let r=n.readUInt32BE(0),i=n.readUInt32BE(4),o="";for(let t=4;t<8;t++)o+=String.fromCharCode(n[t]);let s=Boolean(32&n[4]);if(this._hasIHDR||i===t.TYPE_IHDR){if(this._crc=new e,this._crc.write(Buffer.from(o)),this._chunks[i])return this._chunks[i](r);s?this.read(r+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+o))}else this.error(new Error("Expected IHDR on beggining"))},n.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},n.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},n.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),n=this._crc.crc32();this._options.checkCRC&&n!==e?this.error(new Error("Crc error - "+e+" - "+n)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},n.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},n.prototype._parseIHDR=function(e){this._crc.write(e);let n=e.readUInt32BE(0),r=e.readUInt32BE(4),i=e[8],o=e[9],s=e[10],a=e[11],h=e[12];if(8!==i&&4!==i&&2!==i&&1!==i&&16!==i)return void this.error(new Error("Unsupported bit depth "+i));if(!(o in t.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==s)return void this.error(new Error("Unsupported compression method"));if(0!==a)return void this.error(new Error("Unsupported filter method"));if(0!==h&&1!==h)return void this.error(new Error("Unsupported interlace method"));this._colorType=o;let u=t.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:n,height:r,depth:i,interlace:Boolean(h),palette:Boolean(o&t.COLORTYPE_PALETTE),color:Boolean(o&t.COLORTYPE_COLOR),alpha:Boolean(o&t.COLORTYPE_ALPHA),bpp:u,colorType:o}),this._handleChunkEnd()},n.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},n.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let n=0;n<e;n++)this._palette.push([t[3*n],t[3*n+1],t[3*n+2],255]);this.palette(this._palette),this._handleChunkEnd()},n.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},n.prototype._parseTRNS=function(e){if(this._crc.write(e),this._colorType===t.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(e.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let t=0;t<e.length;t++)this._palette[t][3]=e[t];this.palette(this._palette)}this._colorType===t.COLORTYPE_GRAYSCALE&&this.transColor([e.readUInt16BE(0)]),this._colorType===t.COLORTYPE_COLOR&&this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)]),this._handleChunkEnd()},n.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},n.prototype._parseGAMA=function(e){this._crc.write(e),this.gamma(e.readUInt32BE(0)/t.GAMMA_DIVISION),this._handleChunkEnd()},n.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},n.prototype._parseIDAT=function(e,n){if(this._crc.write(n),this._colorType===t.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(n);let r=e-n.length;r>0?this._handleIDAT(r):this._handleChunkEnd()},n.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},n.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()},Mt.exports}var Ht,Ft,zt,Gt,jt={};function Wt(){if(Ht)return jt;Ht=1;let t=Bt(),e=[function(){},function(t,e,n,r){if(r===e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=255},function(t,e,n,r){if(r+1>=e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=e[r+1]},function(t,e,n,r){if(r+2>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=255},function(t,e,n,r){if(r+3>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=e[r+3]}],n=[function(){},function(t,e,n,r){let i=e[0];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=r},function(t,e,n){let r=e[0];t[n]=r,t[n+1]=r,t[n+2]=r,t[n+3]=e[1]},function(t,e,n,r){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=r},function(t,e,n){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3]}];function r(t,n,r,i,o,s){let a=t.width,h=t.height,u=t.index;for(let t=0;t<h;t++)for(let h=0;h<a;h++){let a=r(h,t,u);e[i](n,o,a,s),s+=i}return s}function i(t,e,r,i,o,s){let a=t.width,h=t.height,u=t.index;for(let t=0;t<h;t++){for(let h=0;h<a;h++){let a=o.get(i),l=r(h,t,u);n[i](e,a,l,s)}o.resetAfterLine()}}return jt.dataToBitMap=function(e,n){let o,s,a=n.width,h=n.height,u=n.depth,l=n.bpp,f=n.interlace;8!==u&&(o=function(t,e){let n=[],r=0;function i(){if(r===t.length)throw new Error("Ran out of data");let i,o,s,a,h,u,l,f,c=t[r];switch(r++,e){default:throw new Error("unrecognised depth");case 16:l=t[r],r++,n.push((c<<8)+l);break;case 4:l=15&c,f=c>>4,n.push(f,l);break;case 2:h=3&c,u=c>>2&3,l=c>>4&3,f=c>>6&3,n.push(f,l,u,h);break;case 1:i=1&c,o=c>>1&1,s=c>>2&1,a=c>>3&1,h=c>>4&1,u=c>>5&1,l=c>>6&1,f=c>>7&1,n.push(f,l,u,h,a,s,o,i)}}return{get:function(t){for(;n.length<t;)i();let e=n.slice(0,t);return n=n.slice(t),e},resetAfterLine:function(){n.length=0},end:function(){if(r!==t.length)throw new Error("extra data found")}}}(e,u)),s=u<=8?Buffer.alloc(a*h*4):new Uint16Array(a*h*4);let c,d,p=Math.pow(2,u)-1,g=0;if(f)c=t.getImagePasses(a,h),d=t.getInterlaceIterator(a,h);else{let t=0;d=function(){let e=t;return t+=4,e},c=[{width:a,height:h}]}for(let t=0;t<c.length;t++)8===u?g=r(c[t],s,d,l,e,g):i(c[t],s,d,l,o,p);if(8===u){if(g!==e.length)throw new Error("extra data found")}else o.end();return s},jt}function Kt(){if(zt)return Ft;return zt=1,Ft=function(t,e){let n=e.depth,r=e.width,i=e.height,o=e.colorType,s=e.transColor,a=e.palette,h=t;return 3===o?function(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let r=0;r<n;r++){let n=i[t[o]];if(!n)throw new Error("index "+t[o]+" not in palette");for(let t=0;t<4;t++)e[o+t]=n[t];o+=4}}(t,h,r,i,a):(s&&function(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let r=0;r<n;r++){let n=!1;if(1===i.length?i[0]===t[o]&&(n=!0):i[0]===t[o]&&i[1]===t[o+1]&&i[2]===t[o+2]&&(n=!0),n)for(let t=0;t<4;t++)e[o+t]=0;o+=4}}(t,h,r,i,s),8!==n&&(16===n&&(h=Buffer.alloc(r*i*4)),function(t,e,n,r,i){let o=Math.pow(2,i)-1,s=0;for(let i=0;i<r;i++)for(let r=0;r<n;r++){for(let n=0;n<4;n++)e[s+n]=Math.floor(255*t[s+n]/o+.5);s+=4}}(t,h,r,i,n))),h}}function Jt(){if(Gt)return mt.exports;Gt=1;let t=n,e=i,r=yt(),o=function(){if(At)return It.exports;At=1;let t=n,e=yt(),r=vt(),i=It.exports=function(t){e.call(this);let n=[],i=this;this._filter=new r(t,{read:this.read.bind(this),write:function(t){n.push(t)},complete:function(){i.emit("complete",Buffer.concat(n))}}),this._filter.start()};return t.inherits(i,e),It.exports}(),s=Yt(),a=Wt(),h=Kt(),u=mt.exports=function(t){r.call(this),this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};return t.inherits(u,r),u.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0},u.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=e.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let t=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,n=Math.max(t,e.Z_MIN_CHUNK);this._inflate=e.createInflate({chunkSize:n});let r=t,i=this.emit.bind(this,"error");this._inflate.on("error",function(t){r&&i(t)}),this._filter.on("complete",this._complete.bind(this));let o=this._filter.write.bind(this._filter);this._inflate.on("data",function(t){r&&(t.length>r&&(t=t.slice(0,r)),r-=t.length,o(t))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},u.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new o(this._bitmapInfo)},u.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},u.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},u.prototype._simpleTransparency=function(){this._metaData.alpha=!0},u.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},u.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},u.prototype._complete=function(t){if(this.errord)return;let e;try{let n=a.dataToBitMap(t,this._bitmapInfo);e=h(n,this._bitmapInfo),n=null}catch(t){return void this._handleError(t)}this.emit("parsed",e)},mt.exports}var Vt,qt,Qt,Zt,$t,Xt,te={exports:{}},ee={exports:{}};function ne(){if($t)return ee.exports;$t=1;let t=kt(),e=Ut(),n=function(){if(qt)return Vt;qt=1;let t=kt();return Vt=function(e,n,r,i){let o=-1!==[t.COLORTYPE_COLOR_ALPHA,t.COLORTYPE_ALPHA].indexOf(i.colorType);if(i.colorType===i.inputColorType){let t=function(){let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256!==new Int16Array(t)[0]}();if(8===i.bitDepth||16===i.bitDepth&&t)return e}let s=16!==i.bitDepth?e:new Uint16Array(e.buffer),a=255,h=t.COLORTYPE_TO_BPP_MAP[i.inputColorType];4!==h||i.inputHasAlpha||(h=3);let u=t.COLORTYPE_TO_BPP_MAP[i.colorType];16===i.bitDepth&&(a=65535,u*=2);let l=Buffer.alloc(n*r*u),f=0,c=0,d=i.bgColor||{};function p(){let e,n,r,h=a;switch(i.inputColorType){case t.COLORTYPE_COLOR_ALPHA:h=s[f+3],e=s[f],n=s[f+1],r=s[f+2];break;case t.COLORTYPE_COLOR:e=s[f],n=s[f+1],r=s[f+2];break;case t.COLORTYPE_ALPHA:h=s[f+1],e=s[f],n=e,r=e;break;case t.COLORTYPE_GRAYSCALE:e=s[f],n=e,r=e;break;default:throw new Error("input color type:"+i.inputColorType+" is not supported at present")}return i.inputHasAlpha&&(o||(h/=a,e=Math.min(Math.max(Math.round((1-h)*d.red+h*e),0),a),n=Math.min(Math.max(Math.round((1-h)*d.green+h*n),0),a),r=Math.min(Math.max(Math.round((1-h)*d.blue+h*r),0),a))),{red:e,green:n,blue:r,alpha:h}}void 0===d.red&&(d.red=a),void 0===d.green&&(d.green=a),void 0===d.blue&&(d.blue=a);for(let e=0;e<r;e++)for(let e=0;e<n;e++){let e=p();switch(i.colorType){case t.COLORTYPE_COLOR_ALPHA:case t.COLORTYPE_COLOR:8===i.bitDepth?(l[c]=e.red,l[c+1]=e.green,l[c+2]=e.blue,o&&(l[c+3]=e.alpha)):(l.writeUInt16BE(e.red,c),l.writeUInt16BE(e.green,c+2),l.writeUInt16BE(e.blue,c+4),o&&l.writeUInt16BE(e.alpha,c+6));break;case t.COLORTYPE_ALPHA:case t.COLORTYPE_GRAYSCALE:{let t=(e.red+e.green+e.blue)/3;8===i.bitDepth?(l[c]=t,o&&(l[c+1]=e.alpha)):(l.writeUInt16BE(t,c),o&&l.writeUInt16BE(e.alpha,c+2));break}default:throw new Error("unrecognised color Type "+i.colorType)}f+=h,c+=u}return l}}(),r=function(){if(Zt)return Qt;Zt=1;let t=Rt(),e={0:function(t,e,n,r,i){for(let o=0;o<n;o++)r[i+o]=t[e+o]},1:function(t,e,n,r,i,o){for(let s=0;s<n;s++){let n=s>=o?t[e+s-o]:0,a=t[e+s]-n;r[i+s]=a}},2:function(t,e,n,r,i){for(let o=0;o<n;o++){let s=e>0?t[e+o-n]:0,a=t[e+o]-s;r[i+o]=a}},3:function(t,e,n,r,i,o){for(let s=0;s<n;s++){let a=s>=o?t[e+s-o]:0,h=e>0?t[e+s-n]:0,u=t[e+s]-(a+h>>1);r[i+s]=u}},4:function(e,n,r,i,o,s){for(let a=0;a<r;a++){let h=a>=s?e[n+a-s]:0,u=n>0?e[n+a-r]:0,l=n>0&&a>=s?e[n+a-(r+s)]:0,f=e[n+a]-t(h,u,l);i[o+a]=f}}},n={0:function(t,e,n){let r=0,i=e+n;for(let n=e;n<i;n++)r+=Math.abs(t[n]);return r},1:function(t,e,n,r){let i=0;for(let o=0;o<n;o++){let n=o>=r?t[e+o-r]:0,s=t[e+o]-n;i+=Math.abs(s)}return i},2:function(t,e,n){let r=0,i=e+n;for(let o=e;o<i;o++){let i=e>0?t[o-n]:0,s=t[o]-i;r+=Math.abs(s)}return r},3:function(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,a=e>0?t[e+o-n]:0,h=t[e+o]-(s+a>>1);i+=Math.abs(h)}return i},4:function(e,n,r,i){let o=0;for(let s=0;s<r;s++){let a=s>=i?e[n+s-i]:0,h=n>0?e[n+s-r]:0,u=n>0&&s>=i?e[n+s-(r+i)]:0,l=e[n+s]-t(a,h,u);o+=Math.abs(l)}return o}};return Qt=function(t,r,i,o,s){let a;if("filterType"in o&&-1!==o.filterType){if("number"!=typeof o.filterType)throw new Error("unrecognised filter types");a=[o.filterType]}else a=[0,1,2,3,4];16===o.bitDepth&&(s*=2);let h=r*s,u=0,l=0,f=Buffer.alloc((h+1)*i),c=a[0];for(let r=0;r<i;r++){if(a.length>1){let e=1/0;for(let r=0;r<a.length;r++){let i=n[a[r]](t,l,h,s);i<e&&(c=a[r],e=i)}}f[u]=c,u++,e[c](t,l,h,f,u,s),u+=h,l+=h}return f}}(),o=i,s=ee.exports=function(e){if(this._options=e,e.deflateChunkSize=e.deflateChunkSize||32768,e.deflateLevel=null!=e.deflateLevel?e.deflateLevel:9,e.deflateStrategy=null!=e.deflateStrategy?e.deflateStrategy:3,e.inputHasAlpha=null==e.inputHasAlpha||e.inputHasAlpha,e.deflateFactory=e.deflateFactory||o.createDeflate,e.bitDepth=e.bitDepth||8,e.colorType="number"==typeof e.colorType?e.colorType:t.COLORTYPE_COLOR_ALPHA,e.inputColorType="number"==typeof e.inputColorType?e.inputColorType:t.COLORTYPE_COLOR_ALPHA,-1===[t.COLORTYPE_GRAYSCALE,t.COLORTYPE_COLOR,t.COLORTYPE_COLOR_ALPHA,t.COLORTYPE_ALPHA].indexOf(e.colorType))throw new Error("option color type:"+e.colorType+" is not supported at present");if(-1===[t.COLORTYPE_GRAYSCALE,t.COLORTYPE_COLOR,t.COLORTYPE_COLOR_ALPHA,t.COLORTYPE_ALPHA].indexOf(e.inputColorType))throw new Error("option input color type:"+e.inputColorType+" is not supported at present");if(8!==e.bitDepth&&16!==e.bitDepth)throw new Error("option bit depth:"+e.bitDepth+" is not supported at present")};return s.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},s.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},s.prototype.filterData=function(e,i,o){let s=n(e,i,o,this._options),a=t.COLORTYPE_TO_BPP_MAP[this._options.colorType];return r(s,i,o,this._options,a)},s.prototype._packChunk=function(t,n){let r=n?n.length:0,i=Buffer.alloc(r+12);return i.writeUInt32BE(r,0),i.writeUInt32BE(t,4),n&&n.copy(i,8),i.writeInt32BE(e.crc32(i.slice(4,i.length-4)),i.length-4),i},s.prototype.packGAMA=function(e){let n=Buffer.alloc(4);return n.writeUInt32BE(Math.floor(e*t.GAMMA_DIVISION),0),this._packChunk(t.TYPE_gAMA,n)},s.prototype.packIHDR=function(e,n){let r=Buffer.alloc(13);return r.writeUInt32BE(e,0),r.writeUInt32BE(n,4),r[8]=this._options.bitDepth,r[9]=this._options.colorType,r[10]=0,r[11]=0,r[12]=0,this._packChunk(t.TYPE_IHDR,r)},s.prototype.packIDAT=function(e){return this._packChunk(t.TYPE_IDAT,e)},s.prototype.packIEND=function(){return this._packChunk(t.TYPE_IEND,null)},ee.exports}var re,ie={},oe={exports:{}};function se(){return re||(re=1,function(t,e){let r=o.ok,a=i,h=n,u=s.kMaxLength;function l(t){if(!(this instanceof l))return new l(t);t&&t.chunkSize<a.Z_MIN_CHUNK&&(t.chunkSize=a.Z_MIN_CHUNK),a.Inflate.call(this,t),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,t&&null!=t.maxLength&&(this._maxLength=t.maxLength)}function f(t,e){t._handle&&(t._handle.close(),t._handle=null)}function c(t,e){return function(t,e){if("string"==typeof e&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let n=t._finishFlushFlag;return null==n&&(n=a.Z_FINISH),t._processChunk(e,n)}(new l(e),t)}l.prototype._processChunk=function(t,e,n){if("function"==typeof n)return a.Inflate._processChunk.call(this,t,e,n);let i,o,s=this,h=t&&t.length,l=this._chunkSize-this._offset,c=this._maxLength,d=0,p=[],g=0;function _(t,e){if(s._hadError)return;let n=l-e;if(r(n>=0,"have should not go down"),n>0){let t=s._buffer.slice(s._offset,s._offset+n);if(s._offset+=n,t.length>c&&(t=t.slice(0,c)),p.push(t),g+=t.length,c-=t.length,0===c)return!1}return(0===e||s._offset>=s._chunkSize)&&(l=s._chunkSize,s._offset=0,s._buffer=Buffer.allocUnsafe(s._chunkSize)),0===e&&(d+=h-t,h=t,!0)}this.on("error",function(t){i=t}),r(this._handle,"zlib binding closed");do{o=this._handle.writeSync(e,t,d,h,this._buffer,this._offset,l),o=o||this._writeState}while(!this._hadError&&_(o[0],o[1]));if(this._hadError)throw i;if(g>=u)throw f(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes");let m=Buffer.concat(p,g);return f(this),m},h.inherits(l,a.Inflate),t.exports=e=c,e.Inflate=l,e.createInflate=function(t){return new l(t)},e.inflateSync=c}(oe,oe.exports)),oe.exports}var ae,he={exports:{}};function ue(){if(ae)return he.exports;ae=1;let t=he.exports=function(t){this._buffer=t,this._reads=[]};return t.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})},t.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;{this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0},he.exports}var le,fe,ce,de,pe,ge,_e,me={};function we(){if(ce)return fe;ce=1;let t=!0,e=i,n=se();e.deflateSync||(t=!1);let r=ue(),o=function(){if(le)return me;le=1;let t=ue(),e=vt();return me.process=function(n,r){let i=[],o=new t(n);return new e(r,{read:o.read.bind(o),write:function(t){i.push(t)},complete:function(){}}).start(),o.process(),Buffer.concat(i)},me}(),s=Yt(),a=Wt(),h=Kt();return fe=function(i,u){if(!t)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let l,f,c;let d=[];let p=new r(i),g=new s(u,{read:p.read.bind(p),error:function(t){l=t},metadata:function(t){f=t},gamma:function(t){c=t},palette:function(t){f.palette=t},transColor:function(t){f.transColor=t},inflateData:function(t){d.push(t)},simpleTransparency:function(){f.alpha=!0}});if(g.start(),p.process(),l)throw l;let _,m=Buffer.concat(d);if(d.length=0,f.interlace)_=e.inflateSync(m);else{let t=(1+(f.width*f.bpp*f.depth+7>>3))*f.height;_=n(m,{chunkSize:t,maxLength:t})}if(m=null,!_||!_.length)throw new Error("bad png - invalid inflate data response");let w=o.process(_,f);m=null;let y=a.dataToBitMap(w,f);w=null;let E=h(y,f);return f.data=E,f.gamma=c||0,f},fe}function ye(){if(ge)return ie;ge=1;let t=we(),e=function(){if(pe)return de;pe=1;let t=!0,e=i;e.deflateSync||(t=!1);let n=kt(),r=ne();return de=function(i,o){if(!t)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let s=new r(o||{}),a=[];a.push(Buffer.from(n.PNG_SIGNATURE)),a.push(s.packIHDR(i.width,i.height)),i.gamma&&a.push(s.packGAMA(i.gamma));let h=s.filterData(i.data,i.width,i.height),u=e.deflateSync(h,s.getDeflateOptions());if(h=null,!u||!u.length)throw new Error("bad png - invalid compressed data response");return a.push(s.packIDAT(u)),a.push(s.packIEND()),Buffer.concat(a)},de}();return ie.read=function(e,n){return t(e,n||{})},ie.write=function(t,n){return e(t,n)},ie}function Ee(){if(_e)return _t;_e=1;let t=n,e=r,i=Jt(),o=function(){if(Xt)return te.exports;Xt=1;let t=n,e=r,i=kt(),o=ne(),s=te.exports=function(t){e.call(this);let n=t||{};this._packer=new o(n),this._deflate=this._packer.createDeflate(),this.readable=!0};return t.inherits(s,e),s.prototype.pack=function(t,e,n,r){this.emit("data",Buffer.from(i.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,n)),r&&this.emit("data",this._packer.packGAMA(r));let o=this._packer.filterData(t,e,n);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)},te.exports}(),s=ye(),a=_t.PNG=function(t){e.call(this),t=t||{},this.width=0|t.width,this.height=0|t.height,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new i(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new o(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};return t.inherits(a,e),a.sync=s,a.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},a.prototype.parse=function(t,e){if(e){let t,n;t=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this),n=function(n){this.removeListener("parsed",t),e(n,null)}.bind(this),this.once("parsed",t),this.once("error",n)}return this.end(t),this},a.prototype.write=function(t){return this._parser.write(t),!0},a.prototype.end=function(t){this._parser.end(t)},a.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},a.prototype._gamma=function(t){this.gamma=t},a.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},a.bitblt=function(t,e,n,r,i,o,s,a){if(r|=0,i|=0,o|=0,s|=0,a|=0,(n|=0)>t.width||r>t.height||n+i>t.width||r+o>t.height)throw new Error("bitblt reading outside image");if(s>e.width||a>e.height||s+i>e.width||a+o>e.height)throw new Error("bitblt writing outside image");for(let h=0;h<o;h++)t.data.copy(e.data,(a+h)*e.width+s<<2,(r+h)*t.width+n<<2,(r+h)*t.width+n+i<<2)},a.prototype.bitblt=function(t,e,n,r,i,o,s){return a.bitblt(this,t,e,n,r,i,o,s),this},a.adjustGamma=function(t){if(t.gamma){for(let e=0;e<t.height;e++)for(let n=0;n<t.width;n++){let r=t.width*e+n<<2;for(let e=0;e<3;e++){let n=t.data[r+e]/255;n=Math.pow(n,1/2.2/t.gamma),t.data[r+e]=Math.round(255*n)}}t.gamma=0}},a.prototype.adjustGamma=function(){a.adjustGamma(this)},_t}var be,Te,Ce={};function Ae(){return be||(be=1,function(t){function e(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");const n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const n=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:e(t.color.dark||"#000000ff"),light:e(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},t.getImageWidth=function(e,n){const r=t.getScale(e,n);return Math.floor((e+2*n.margin)*r)},t.qrToImageData=function(e,n,r){const i=n.modules.size,o=n.modules.data,s=t.getScale(i,r),a=Math.floor((i+2*r.margin)*s),h=r.margin*s,u=[r.color.light,r.color.dark];for(let t=0;t<a;t++)for(let n=0;n<a;n++){let l=4*(t*a+n),f=r.color.light;if(t>=h&&n>=h&&t<a-h&&n<a-h){f=u[o[Math.floor((t-h)/s)*i+Math.floor((n-h)/s)]?1:0]}e[l++]=f.r,e[l++]=f.g,e[l++]=f.b,e[l]=f.a}}}(Ce)),Ce}var Ie,Pe={};var Le,Be={},Re={};var ve,Oe,xe={};function Me(){if(ve)return xe;ve=1;const t="[37m",e="[30m",n="[0m",r="[47m"+e,i="[40m"+t,o=function(t,e,n,r){const i=e+1;if(n>=i||r>=i||r<-1||n<-1)return"0";if(n>=e||r>=e||r<0||n<0)return"1";return t[r*e+n]?"2":"1"},s=function(t,e,n,r){return o(t,e,n,r)+o(t,e,n,r+1)};return xe.render=function(o,a,h){const u=o.modules.size,l=o.modules.data,f=!(!a||!a.inverse),c=a&&a.inverse?i:r,d=function(t,e,r){return{"00":n+" "+t,"01":n+e+"▄"+t,"02":n+r+"▄"+t,10:n+e+"▀"+t,11:" ",12:"▄",20:n+r+"▀"+t,21:"▀",22:"█"}}(c,f?e:t,f?t:e),p=n+"\n"+c;let g=c;for(let t=-1;t<u+1;t+=2){for(let e=-1;e<u;e++)g+=d[s(l,u,e,t)];g+=d[s(l,u,u,t)]+p}return g+=n,"function"==typeof h&&h(null,g),g},xe}function ke(){if(Oe)return Be;Oe=1;const t=(Le||(Le=1,Re.render=function(t,e,n){const r=t.modules.size,i=t.modules.data,o="[47m [0m";let s="";const a=Array(r+3).join(o),h=Array(2).join(o);s+=a+"\n";for(let t=0;t<r;++t){s+=o;for(let e=0;e<r;e++)s+=i[t*r+e]?"[40m [0m":o;s+=h+"\n"}return s+=a+"\n","function"==typeof n&&n(null,s),s}),Re),e=Me();return Be.render=function(n,r,i){return r&&r.small?e.render(n,r,i):t.render(n,r,i)},Be}var Ne,De,Se={},Ue={};function Ye(){if(Ne)return Ue;Ne=1;const t=Ae();function e(t,e){const n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function n(t,e,n){let r=t+e;return void 0!==n&&(r+=" "+n),r}return Ue.render=function(r,i,o){const s=t.getOptions(i),a=r.modules.size,h=r.modules.data,u=a+2*s.margin,l=s.color.light.a?"<path "+e(s.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",f="<path "+e(s.color.dark,"stroke")+' d="'+function(t,e,r){let i="",o=0,s=!1,a=0;for(let h=0;h<t.length;h++){const u=Math.floor(h%e),l=Math.floor(h/e);u||s||(s=!0),t[h]?(a++,h>0&&u>0&&t[h-1]||(i+=s?n("M",u+r,.5+l+r):n("m",o,0),o=0,s=!1),u+1<e&&t[h+1]||(i+=n("h",a),a=0)):o++}return i}(h,a,s.margin)+'"/>',c='viewBox="0 0 '+u+" "+u+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+c+' shape-rendering="crispEdges">'+l+f+"</svg>\n";return"function"==typeof o&&o(null,d),d},Ue}var He,Fe,ze,Ge,je,We={},Ke={};function Je(){return He||(He=1,function(t){const e=Ae();t.render=function(t,n,r){let i=r,o=n;void 0!==i||n&&n.getContext||(i=n,n=void 0),n||(o=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),i=e.getOptions(i);const s=e.getImageWidth(t.modules.size,i),a=o.getContext("2d"),h=a.createImageData(s,s);return e.qrToImageData(h.data,t,i),function(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}(a,o,s),a.putImageData(h,0,0),o},t.renderToDataURL=function(e,n,r){let i=r;void 0!==i||n&&n.getContext||(i=n,n=void 0),i||(i={});const o=t.render(e,n,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}}(Ke)),Ke}function Ve(){if(ze)return u;ze=1;const t=l(),n=dt(),r=(Te||(Te=1,function(t){const n=e,r=Ee().PNG,i=Ae();t.render=function(t,e){const n=i.getOptions(e),o=n.rendererOpts,s=i.getImageWidth(t.modules.size,n);o.width=s,o.height=s;const a=new r(o);return i.qrToImageData(a.data,t,n),a},t.renderToDataURL=function(e,n,r){void 0===r&&(r=n,n=void 0),t.renderToBuffer(e,n,function(t,e){t&&r(t);let n="data:image/png;base64,";n+=e.toString("base64"),r(null,n)})},t.renderToBuffer=function(e,n,r){void 0===r&&(r=n,n=void 0);const i=t.render(e,n),o=[];i.on("error",r),i.on("data",function(t){o.push(t)}),i.on("end",function(){r(null,Buffer.concat(o))}),i.pack()},t.renderToFile=function(e,r,i,o){void 0===o&&(o=i,i=void 0);let s=!1;const a=(...t)=>{s||(s=!0,o.apply(null,t))},h=n.createWriteStream(e);h.on("error",a),h.on("close",a),t.renderToFileStream(h,r,i)},t.renderToFileStream=function(e,n,r){t.render(n,r).pack().pipe(e)}}(gt)),gt),i=(Ie||(Ie=1,function(t){const n=Ae(),r={WW:" ",WB:"▄",BB:"█",BW:"▀"},i={BB:" ",BW:"▄",WW:"█",WB:"▀"};function o(t,e,n){return t&&e?n.BB:t&&!e?n.BW:!t&&e?n.WB:n.WW}t.render=function(t,e,s){const a=n.getOptions(e);let h=r;"#ffffff"!==a.color.dark.hex&&"#000000"!==a.color.light.hex||(h=i);const u=t.modules.size,l=t.modules.data;let f="",c=Array(u+2*a.margin+1).join(h.WW);c=Array(a.margin/2+1).join(c+"\n");const d=Array(a.margin+1).join(h.WW);f+=c;for(let t=0;t<u;t+=2){f+=d;for(let e=0;e<u;e++)f+=o(l[t*u+e],l[(t+1)*u+e],h);f+=d+"\n"}return f+=c.slice(0,-1),"function"==typeof s&&s(null,f),f},t.renderToFile=function(n,r,i,o){void 0===o&&(o=i,i=void 0);const s=e,a=t.render(r,i);s.writeFile(n,a,o)}}(Pe)),Pe),o=ke(),s=(De||(De=1,function(t){const n=Ye();t.render=n.render,t.renderToFile=function(n,r,i,o){void 0===o&&(o=i,i=void 0);const s=e,a='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+t.render(r,i);s.writeFile(n,a,o)}}(Se)),Se);function a(e,n,r){if(void 0===e)throw new Error("String required as first argument");if(void 0===r&&(r=n,n={}),"function"!=typeof r){if(!t())throw new Error("Callback required as last argument");n=r||{},r=null}return{opts:n,cb:r}}function h(t){switch(t){case"svg":return s;case"txt":case"utf8":return i;default:return r}}function f(t,e,r){if(!r.cb)return new Promise(function(i,o){try{const s=n.create(e,r.opts);return t(s,r.opts,function(t,e){return t?o(t):i(e)})}catch(t){o(t)}});try{const i=n.create(e,r.opts);return t(i,r.opts,r.cb)}catch(t){r.cb(t)}}return u.create=n.create,u.toCanvas=function(){if(Fe)return We;Fe=1;const t=l(),e=dt(),n=Je(),r=Ye();function i(n,r,i,o,s){const a=[].slice.call(arguments,1),h=a.length,u="function"==typeof a[h-1];if(!u&&!t())throw new Error("Callback required as last argument");if(!u){if(h<1)throw new Error("Too few arguments provided");return 1===h?(i=r,r=o=void 0):2!==h||r.getContext||(o=i,i=r,r=void 0),new Promise(function(t,s){try{const s=e.create(i,o);t(n(s,r,o))}catch(t){s(t)}})}if(h<2)throw new Error("Too few arguments provided");2===h?(s=i,i=r,r=o=void 0):3===h&&(r.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=i,i=r,r=void 0));try{const t=e.create(i,o);s(null,n(t,r,o))}catch(t){s(t)}}return We.create=e.create,We.toCanvas=i.bind(null,n.render),We.toDataURL=i.bind(null,n.renderToDataURL),We.toString=i.bind(null,function(t,e,n){return r.render(t,n)}),We}().toCanvas,u.toString=function(t,e,n){const r=a(t,e,n),h=function(t){switch(t){case"svg":return s;case"terminal":return o;default:return i}}(r.opts?r.opts.type:void 0);return f(h.render,t,r)},u.toDataURL=function(t,e,n){const r=a(t,e,n);return f(h(r.opts.type).renderToDataURL,t,r)},u.toBuffer=function(t,e,n){const r=a(t,e,n);return f(h(r.opts.type).renderToBuffer,t,r)},u.toFile=function(e,n,r,i){if("string"!=typeof e||"string"!=typeof n&&"object"!=typeof n)throw new Error("Invalid argument");if(arguments.length<3&&!t())throw new Error("Too few arguments provided");const o=a(n,r,i),s=o.opts.type||function(t){return t.slice((t.lastIndexOf(".")-1>>>0)+2).toLowerCase()}(e);return f(h(s).renderToFile.bind(null,e),n,o)},u.toFileStream=function(t,e,n){if(arguments.length<2)throw new Error("Too few arguments provided");const r=a(e,n,t.emit.bind(t,"error"));f(h("png").renderToFileStream.bind(null,t),e,r)},u}var qe=t(je?Ge:(je=1,Ge=Ve())),Qe=Object.freeze({__proto__:null,default:qe});export{Qe as i};
|
|
2
|
-
//# sourceMappingURL=file-manager-index-CqMa6hmd.js.map
|