@ezeep/ezeep-js 1.0.266 → 1.0.268

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.
Files changed (168) hide show
  1. package/dist/cjs/app-globals-D7ISNeUi.js +16 -0
  2. package/dist/cjs/ezeep.cjs.js +43 -12
  3. package/dist/cjs/ezp-auth_15.cjs.entry.js +27964 -26035
  4. package/dist/cjs/index-dv_gozsq.js +4694 -0
  5. package/dist/cjs/loader.cjs.js +7 -17
  6. package/dist/collection/collection-manifest.json +19 -18
  7. package/dist/collection/components/ezp-auth/ezp-auth.js +266 -245
  8. package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +93 -81
  9. package/dist/collection/components/ezp-dialog/ezp-dialog.js +226 -210
  10. package/dist/collection/components/ezp-icon/ezp-icon.js +117 -102
  11. package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +181 -159
  12. package/dist/collection/components/ezp-input/ezp-input.css +5 -5
  13. package/dist/collection/components/ezp-input/ezp-input.js +227 -205
  14. package/dist/collection/components/ezp-label/ezp-label.css +5 -5
  15. package/dist/collection/components/ezp-label/ezp-label.js +151 -132
  16. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +5 -5
  17. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +1118 -1107
  18. package/dist/collection/components/ezp-printing/ezp-printing.css +183 -125
  19. package/dist/collection/components/ezp-printing/ezp-printing.js +872 -807
  20. package/dist/collection/components/ezp-select/ezp-select.css +4 -4
  21. package/dist/collection/components/ezp-select/ezp-select.js +376 -351
  22. package/dist/collection/components/ezp-status/ezp-status.css +5 -5
  23. package/dist/collection/components/ezp-status/ezp-status.js +238 -223
  24. package/dist/collection/components/ezp-stepper/ezp-stepper.css +5 -5
  25. package/dist/collection/components/ezp-stepper/ezp-stepper.js +256 -243
  26. package/dist/collection/components/ezp-text-button/ezp-text-button.js +196 -174
  27. package/dist/collection/components/ezp-upload/ezp-upload.css +3 -25
  28. package/dist/collection/components/ezp-upload/ezp-upload.js +134 -141
  29. package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +5 -5
  30. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +180 -185
  31. package/dist/collection/services/auth.js +133 -133
  32. package/dist/collection/services/print.js +167 -167
  33. package/dist/collection/services/user.js +16 -16
  34. package/dist/collection/shared/global.js +7 -7
  35. package/dist/collection/utils/utils.js +89 -89
  36. package/dist/components/auth.js +1 -0
  37. package/dist/components/ezp-auth.d.ts +11 -0
  38. package/dist/components/ezp-auth.js +1 -0
  39. package/dist/components/ezp-auth2.js +1 -0
  40. package/dist/components/ezp-backdrop.d.ts +11 -0
  41. package/dist/components/ezp-backdrop.js +1 -0
  42. package/dist/components/ezp-backdrop2.js +1 -0
  43. package/dist/components/ezp-dialog.d.ts +11 -0
  44. package/dist/components/ezp-dialog.js +1 -0
  45. package/dist/components/ezp-dialog2.js +1 -0
  46. package/dist/components/ezp-icon-button.d.ts +11 -0
  47. package/dist/components/ezp-icon-button.js +1 -0
  48. package/dist/components/ezp-icon-button2.js +1 -0
  49. package/dist/components/ezp-icon.d.ts +11 -0
  50. package/dist/components/ezp-icon.js +1 -0
  51. package/dist/components/ezp-icon2.js +1 -0
  52. package/dist/components/ezp-input.d.ts +11 -0
  53. package/dist/components/ezp-input.js +1 -0
  54. package/dist/components/ezp-input2.js +1 -0
  55. package/dist/components/ezp-label.d.ts +11 -0
  56. package/dist/components/ezp-label.js +1 -0
  57. package/dist/components/ezp-label2.js +1 -0
  58. package/dist/components/ezp-printer-selection.d.ts +11 -0
  59. package/dist/components/ezp-printer-selection.js +1 -0
  60. package/dist/components/ezp-printer-selection2.js +1 -0
  61. package/dist/components/ezp-printing.d.ts +11 -0
  62. package/dist/components/ezp-printing.js +1 -0
  63. package/dist/components/ezp-select.d.ts +11 -0
  64. package/dist/components/ezp-select.js +1 -0
  65. package/dist/components/ezp-select2.js +1 -0
  66. package/dist/components/ezp-status.d.ts +11 -0
  67. package/dist/components/ezp-status.js +1 -0
  68. package/dist/components/ezp-status2.js +1 -0
  69. package/dist/components/ezp-stepper.d.ts +11 -0
  70. package/dist/components/ezp-stepper.js +1 -0
  71. package/dist/components/ezp-stepper2.js +1 -0
  72. package/dist/components/ezp-text-button.d.ts +11 -0
  73. package/dist/components/ezp-text-button.js +1 -0
  74. package/dist/components/ezp-text-button2.js +1 -0
  75. package/dist/components/ezp-upload.d.ts +11 -0
  76. package/dist/components/ezp-upload.js +1 -0
  77. package/dist/components/ezp-upload2.js +1 -0
  78. package/dist/components/ezp-user-menu.d.ts +11 -0
  79. package/dist/components/ezp-user-menu.js +1 -0
  80. package/dist/components/ezp-user-menu2.js +1 -0
  81. package/dist/components/i18next.js +1 -0
  82. package/dist/components/index.d.ts +35 -0
  83. package/dist/components/index.js +1 -0
  84. package/dist/directives/angular-component-lib/utils.ts +33 -14
  85. package/dist/directives/proxies.ts +231 -111
  86. package/dist/esm/app-globals-CpP67t2l.js +14 -0
  87. package/dist/esm/ezeep.js +41 -12
  88. package/dist/esm/ezp-auth_15.entry.js +27967 -26036
  89. package/dist/esm/index-BTfWEHH9.js +4677 -0
  90. package/dist/esm/loader.js +7 -15
  91. package/dist/esm-es5/app-globals-CpP67t2l.js +1 -0
  92. package/dist/esm-es5/ezeep.js +1 -1
  93. package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
  94. package/dist/esm-es5/index-BTfWEHH9.js +13 -0
  95. package/dist/esm-es5/loader.js +1 -1
  96. package/dist/ezeep/ezeep.esm.js +1 -1
  97. package/dist/ezeep/ezeep.js +16 -19
  98. package/dist/ezeep/p-5ok9OZMg.system.js +1 -0
  99. package/dist/ezeep/p-BTfWEHH9.js +2 -0
  100. package/dist/ezeep/p-CfQRcOh8.system.js +1 -0
  101. package/dist/ezeep/p-CpP67t2l.js +1 -0
  102. package/dist/ezeep/p-DhXN1yGM.system.js +13 -0
  103. package/dist/ezeep/p-ba70b358.entry.js +1 -0
  104. package/dist/ezeep/p-f3ad7583.system.entry.js +7 -0
  105. package/dist/types/components/ezp-auth/ezp-auth.d.ts +20 -20
  106. package/dist/types/components/ezp-backdrop/ezp-backdrop.d.ts +7 -7
  107. package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +38 -38
  108. package/dist/types/components/ezp-icon/ezp-icon.d.ts +24 -24
  109. package/dist/types/components/ezp-icon-button/ezp-icon-button.d.ts +23 -23
  110. package/dist/types/components/ezp-input/ezp-input.d.ts +38 -38
  111. package/dist/types/components/ezp-label/ezp-label.d.ts +21 -21
  112. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +116 -116
  113. package/dist/types/components/ezp-printing/ezp-printing.d.ts +83 -83
  114. package/dist/types/components/ezp-select/ezp-select.d.ts +80 -80
  115. package/dist/types/components/ezp-status/ezp-status.d.ts +40 -40
  116. package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +65 -65
  117. package/dist/types/components/ezp-text-button/ezp-text-button.d.ts +25 -25
  118. package/dist/types/components/ezp-upload/ezp-upload.d.ts +38 -38
  119. package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +43 -43
  120. package/dist/types/components.d.ts +493 -50
  121. package/dist/types/services/auth.d.ts +27 -27
  122. package/dist/types/services/print.d.ts +32 -32
  123. package/dist/types/services/user.d.ts +4 -4
  124. package/dist/types/stencil-public-runtime.d.ts +335 -40
  125. package/dist/types/utils/utils.d.ts +6 -6
  126. package/loader/cdn.js +1 -2
  127. package/loader/index.cjs.js +1 -2
  128. package/loader/index.d.ts +13 -1
  129. package/loader/index.es2017.js +1 -2
  130. package/loader/index.js +1 -2
  131. package/package.json +10 -10
  132. package/www/build/ezeep.esm.js +1 -1
  133. package/www/build/ezeep.js +16 -19
  134. package/www/build/p-5ok9OZMg.system.js +1 -0
  135. package/www/build/p-8f4a7bc3.js +1 -0
  136. package/www/build/p-BTfWEHH9.js +2 -0
  137. package/www/build/p-CfQRcOh8.system.js +1 -0
  138. package/www/build/p-CpP67t2l.js +1 -0
  139. package/www/build/p-DhXN1yGM.system.js +13 -0
  140. package/www/build/p-ba70b358.entry.js +1 -0
  141. package/www/build/p-f3ad7583.system.entry.js +7 -0
  142. package/www/index.html +1 -1
  143. package/dist/cjs/app-globals-53afb196.js +0 -15
  144. package/dist/cjs/index-1f953145.js +0 -1482
  145. package/dist/custom-elements/index.d.ts +0 -129
  146. package/dist/custom-elements/index.js +0 -34555
  147. package/dist/esm/app-globals-28960cbc.js +0 -13
  148. package/dist/esm/index-3ac1b749.js +0 -1450
  149. package/dist/esm/polyfills/css-shim.js +0 -1
  150. package/dist/esm-es5/app-globals-28960cbc.js +0 -1
  151. package/dist/esm-es5/index-3ac1b749.js +0 -1
  152. package/dist/ezeep/p-0cc2026d.system.js +0 -1
  153. package/dist/ezeep/p-312f40d7.js +0 -1
  154. package/dist/ezeep/p-84bd195a.system.js +0 -1
  155. package/dist/ezeep/p-a4d37138.js +0 -1
  156. package/dist/ezeep/p-d3570133.system.entry.js +0 -7
  157. package/dist/ezeep/p-dcf9f118.entry.js +0 -1
  158. package/dist/ezeep/p-ded04529.system.js +0 -1
  159. package/loader/package.json +0 -10
  160. package/www/build/p-0cc2026d.system.js +0 -1
  161. package/www/build/p-312f40d7.js +0 -1
  162. package/www/build/p-84bd195a.system.js +0 -1
  163. package/www/build/p-a4d37138.js +0 -1
  164. package/www/build/p-d3570133.system.entry.js +0 -7
  165. package/www/build/p-dcf9f118.entry.js +0 -1
  166. package/www/build/p-ded04529.system.js +0 -1
  167. /package/dist/ezeep/{p-50ea2036.system.js → p-YWpyar7R.system.js} +0 -0
  168. /package/www/build/{p-50ea2036.system.js → p-YWpyar7R.system.js} +0 -0
@@ -1,795 +1,786 @@
1
- import { Component, Host, Listen, Event, State, h, Prop, Fragment, } from '@stencil/core';
2
- import i18next from 'i18next';
3
- import authStore from '../../services/auth';
4
- import printStore, { EzpPrintService } from '../../services/print';
5
- import userStore, { EzpUserService } from '../../services/user';
6
- import { managePaperDimensions, poll, removeEmptyStrings } from '../../utils/utils';
7
- import { PAPER_ID, validatePageRange, formatPageRange } from '../../utils/utils';
1
+ import { Host, h, Fragment, } from "@stencil/core";
2
+ import i18next from "i18next";
3
+ import authStore from "../../services/auth";
4
+ import printStore, { EzpPrintService } from "../../services/print";
5
+ import userStore, { EzpUserService } from "../../services/user";
6
+ import { managePaperDimensions, poll, removeEmptyStrings } from "../../utils/utils";
7
+ import { PAPER_ID, validatePageRange, formatPageRange } from "../../utils/utils";
8
8
  export class EzpPrinterSelection {
9
- constructor() {
10
- this.fileExtension = '';
11
- this.duplexOptions = [
12
- {
13
- id: 1,
14
- title: i18next.t('printer_selection.duplex_none'),
15
- },
16
- {
17
- id: 2,
18
- title: i18next.t('printer_selection.duplex_long'),
19
- },
20
- {
21
- id: 3,
22
- title: i18next.t('printer_selection.duplex_short'),
23
- },
24
- ];
25
- this.ColorOptions = [
26
- {
27
- id: 1,
28
- title: i18next.t('printer_selection.color_color'),
29
- },
30
- {
31
- id: 2,
32
- title: i18next.t('printer_selection.color_grayscale'),
33
- },
34
- ];
35
- this.hidemenu = false;
36
- this.hideheader = false;
37
- /**
38
- *
39
- * States
40
- *
41
- */
42
- this.loading = true;
43
- this.printProcessing = false;
44
- this.pageRangeInvalid = false;
45
- this.uploading = false;
46
- this.preparingUpload = false;
47
- this.printSuccess = false;
48
- this.printFailed = false;
49
- this.notSupported = false;
50
- this.noPrinters = false;
51
- this.hubDriverError = false;
52
- this.userMenuOpen = false;
53
- this.printStopped = false;
54
- this.selectedPrinterConfig = {
55
- Default: {
56
- Color: '',
57
- Duplex: '',
58
- Paper: '',
59
- Orientation: '',
60
- Resolution: '',
61
- Tray: '',
62
- },
63
- OrientationsSupported: [],
64
- PaperFormats: [],
65
- Resolutions: [],
66
- DuplexSupported: false,
67
- Color: false,
68
- Trays: [],
69
- };
70
- // needs to be initialised with empty strings
71
- this.selectedProperties = {
72
- paper: '',
73
- paperid: '',
74
- color: false,
75
- duplex: true,
76
- duplexmode: 1,
77
- orientation: 1,
78
- copies: '',
79
- resolution: 0,
80
- paperlength: 0,
81
- paperwidth: 0,
82
- defaultSource: '',
83
- trayname: '',
84
- PageRanges: '',
85
- };
86
- this.currentFileIndex = 0;
87
- this.totalFiles = 0;
88
- this.failedFiles = [];
89
- this.successfulFiles = [];
90
- this.partialSuccess = false;
91
- /**
92
- *
93
- * Private methods
94
- *
95
- */
96
- /** Description... */
97
- this.handleCancel = () => {
98
- this.failedFiles = [];
99
- this.successfulFiles = [];
100
- this.partialSuccess = false;
101
- this.hubDriverError = false;
102
- this.printCancel.emit();
103
- };
104
- this.validateData = (data) => {
105
- console.log('[validateData] Checking data:', data);
106
- const { jobstatus } = data;
107
- // Define status handlers
108
- const statusHandlers = {
109
- 0: () => {
110
- // Success
111
- this.printSuccess = true;
112
- this.printProcessing = false;
113
- return true;
114
- },
115
- 1246: () => false,
116
- 129: () => false,
117
- 3011: () => {
118
- // Failure
119
- this.printFailed = true;
120
- this.printProcessing = false;
121
- return true;
122
- },
123
- 2: () => {
124
- // Failure
125
- this.printFailed = true;
126
- this.printProcessing = false;
127
- return true;
128
- },
129
- };
130
- // Check for hub printer driver errors
131
- const hubDriverErrorCodes = [412, 500, 503, 1048579];
132
- if (hubDriverErrorCodes.includes(jobstatus) && this.selectedPrinter.is_queue) {
133
- this.hubDriverError = true;
9
+ constructor() {
10
+ this.fileExtension = '';
11
+ this.duplexOptions = [
12
+ {
13
+ id: 1,
14
+ title: i18next.t('printer_selection.duplex_none'),
15
+ },
16
+ {
17
+ id: 2,
18
+ title: i18next.t('printer_selection.duplex_long'),
19
+ },
20
+ {
21
+ id: 3,
22
+ title: i18next.t('printer_selection.duplex_short'),
23
+ },
24
+ ];
25
+ this.ColorOptions = [
26
+ {
27
+ id: 1,
28
+ title: i18next.t('printer_selection.color_color'),
29
+ },
30
+ {
31
+ id: 2,
32
+ title: i18next.t('printer_selection.color_grayscale'),
33
+ },
34
+ ];
35
+ this.hidemenu = false;
36
+ this.hideheader = false;
37
+ /**
38
+ *
39
+ * States
40
+ *
41
+ */
42
+ this.loading = true;
134
43
  this.printProcessing = false;
135
- return true;
136
- }
137
- // Use handler if exists, otherwise treat as failure
138
- const handler = statusHandlers[jobstatus];
139
- if (handler) {
140
- return handler();
141
- }
142
- // Unknown status, treat as failure for safety
143
- this.printFailed = true;
144
- this.printProcessing = false;
145
- return true;
146
- };
147
- this.POLL_INTERVAL = 2000;
148
- this.MAX_POLL_ATTEMPTS = Infinity;
149
- this.HUB_TIMEOUT = 30000; // 30 seconds timeout for hub printers
150
- /** Description... */
151
- this.handlePrint = async () => {
152
- this.printButton.blur();
153
- this.printProcessing = true;
154
- this.failedFiles = [];
155
- this.successfulFiles = [];
156
- this.partialSuccess = false;
157
- this.hubDriverError = false;
158
- // Set up timeout for hub printers to prevent infinite loading
159
- let hubTimeout;
160
- if (this.selectedPrinter.is_queue) {
161
- hubTimeout = setTimeout(() => {
162
- console.log('[handlePrint] Hub printer timeout reached, setting driver error');
163
- this.hubDriverError = true;
164
- this.printProcessing = false;
165
- }, this.HUB_TIMEOUT);
166
- }
167
- // we have to initialse this obj with empty strings to display the select component
168
- // but don't want to send any attributes with empty strings to the API
169
- if (this.selectedPrinterConfig.Trays &&
170
- this.selectedPrinterConfig.Trays.length >= 0 &&
171
- this.selectedPrinterConfig.Trays[0] == null) {
172
- delete this.selectedProperties.trayname;
173
- delete this.selectedProperties.defaultSource;
174
- }
175
- let cleanPrintProperties = removeEmptyStrings(this.selectedProperties);
176
- cleanPrintProperties = managePaperDimensions(cleanPrintProperties);
177
- if (cleanPrintProperties.PageRanges)
178
- cleanPrintProperties.PageRanges = formatPageRange(cleanPrintProperties.PageRanges);
179
- // put it in store for further use
180
- printStore.state.fileUrl = this.fileurl;
181
- printStore.state.fileID = this.fileid;
182
- printStore.state.fileType = this.filetype;
183
- printStore.state.printerID = this.selectedPrinter.id;
184
- printStore.state.printerProperties = this.selectedProperties;
185
- printStore.state.fileName = this.filename;
186
- if (this.fileurl) {
187
- this.printService
188
- .printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
189
- .then((response) => {
190
- if (response.status === 200 && this.selectedPrinter.is_queue) {
191
- this.printProcessing = false;
192
- this.printSuccess = true;
193
- if (hubTimeout)
194
- clearTimeout(hubTimeout);
195
- }
196
- if (response.status === 412) {
197
- response.json().then((data) => (this.fileid = data.fileid));
198
- this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
199
- }
200
- else {
201
- return response.json();
202
- }
203
- })
204
- .then((data) => {
205
- if (data.code === 804) {
44
+ this.pageRangeInvalid = false;
45
+ this.uploading = false;
46
+ this.preparingUpload = false;
47
+ this.printSuccess = false;
48
+ this.printFailed = false;
49
+ this.notSupported = false;
50
+ this.noPrinters = false;
51
+ this.hubDriverError = false;
52
+ this.userMenuOpen = false;
53
+ this.printStopped = false;
54
+ this.selectedPrinterConfig = {
55
+ Default: {
56
+ Color: '',
57
+ Duplex: '',
58
+ Paper: '',
59
+ Orientation: '',
60
+ Resolution: '',
61
+ Tray: '',
62
+ },
63
+ OrientationsSupported: [],
64
+ PaperFormats: [],
65
+ Resolutions: [],
66
+ DuplexSupported: false,
67
+ Color: false,
68
+ Trays: [],
69
+ };
70
+ // needs to be initialised with empty strings
71
+ this.selectedProperties = {
72
+ paper: '',
73
+ paperid: '',
74
+ color: false,
75
+ duplex: true,
76
+ duplexmode: 1,
77
+ orientation: 1,
78
+ copies: '',
79
+ resolution: 0,
80
+ paperlength: 0,
81
+ paperwidth: 0,
82
+ defaultSource: '',
83
+ trayname: '',
84
+ PageRanges: '',
85
+ };
86
+ this.currentFileIndex = 0;
87
+ this.totalFiles = 0;
88
+ this.failedFiles = [];
89
+ this.successfulFiles = [];
90
+ this.partialSuccess = false;
91
+ /**
92
+ *
93
+ * Private methods
94
+ *
95
+ */
96
+ /** Description... */
97
+ this.handleCancel = () => {
98
+ this.failedFiles = [];
99
+ this.successfulFiles = [];
100
+ this.partialSuccess = false;
101
+ this.hubDriverError = false;
102
+ this.printCancel.emit();
103
+ };
104
+ this.validateData = (data) => {
105
+ console.log('[validateData] Checking data:', data);
106
+ const { jobstatus } = data;
107
+ // Define status handlers
108
+ const statusHandlers = {
109
+ 0: () => {
110
+ // Success
111
+ this.printSuccess = true;
112
+ this.printProcessing = false;
113
+ return true;
114
+ },
115
+ 1246: () => false, // Still processing
116
+ 129: () => false, // Still processing
117
+ 3011: () => {
118
+ // Failure
119
+ this.printFailed = true;
120
+ this.printProcessing = false;
121
+ return true;
122
+ },
123
+ 2: () => {
124
+ // Failure
125
+ this.printFailed = true;
126
+ this.printProcessing = false;
127
+ return true;
128
+ },
129
+ };
130
+ // Check for hub printer driver errors
131
+ const hubDriverErrorCodes = [412, 500, 503, 1048579];
132
+ if (hubDriverErrorCodes.includes(jobstatus) && this.selectedPrinter.is_queue) {
133
+ this.hubDriverError = true;
134
+ this.printProcessing = false;
135
+ return true;
136
+ }
137
+ // Use handler if exists, otherwise treat as failure
138
+ const handler = statusHandlers[jobstatus];
139
+ if (handler) {
140
+ return handler();
141
+ }
142
+ // Unknown status, treat as failure for safety
206
143
  this.printFailed = true;
207
144
  this.printProcessing = false;
208
- if (hubTimeout)
209
- clearTimeout(hubTimeout);
210
- }
211
- else if (this.selectedPrinter.is_queue &&
212
- (data.code === 412 || data.code === 500 || data.code === 503 || data.code === 1048579)) {
213
- // Hub printer specific errors - likely driver not assigned
214
- console.log('[handlePrint] Hub printer driver error detected:', data);
215
- this.hubDriverError = true;
216
- this.printProcessing = false;
217
- if (hubTimeout)
218
- clearTimeout(hubTimeout);
219
- }
220
- else if (data.jobid) {
221
- printStore.state.jobID = data.jobid;
222
- poll({
223
- fn: this.printService.getPrintStatus,
224
- validate: this.validateData,
225
- interval: this.POLL_INTERVAL,
226
- maxAttempts: this.MAX_POLL_ATTEMPTS,
227
- }).catch((err) => {
228
- console.warn('[handlePrint] Polling error:', err);
229
- // Check if this is a hub printer and the error might be driver-related
230
- if (this.selectedPrinter.is_queue) {
231
- this.hubDriverError = true;
232
- }
233
- else {
234
- this.printFailed = true;
235
- }
236
- this.printProcessing = false;
237
- if (hubTimeout)
238
- clearTimeout(hubTimeout);
239
- });
240
- }
241
- else {
242
- // No job ID returned - check if it's a hub printer
145
+ return true;
146
+ };
147
+ this.POLL_INTERVAL = 2000;
148
+ this.MAX_POLL_ATTEMPTS = Infinity;
149
+ this.HUB_TIMEOUT = 30000; // 30 seconds timeout for hub printers
150
+ /** Description... */
151
+ this.handlePrint = async () => {
152
+ this.printButton.blur();
153
+ this.printProcessing = true;
154
+ this.failedFiles = [];
155
+ this.successfulFiles = [];
156
+ this.partialSuccess = false;
157
+ this.hubDriverError = false;
158
+ // Set up timeout for hub printers to prevent infinite loading
159
+ let hubTimeout;
243
160
  if (this.selectedPrinter.is_queue) {
244
- this.hubDriverError = true;
161
+ hubTimeout = setTimeout(() => {
162
+ console.log('[handlePrint] Hub printer timeout reached, setting driver error');
163
+ this.hubDriverError = true;
164
+ this.printProcessing = false;
165
+ }, this.HUB_TIMEOUT);
245
166
  }
246
- else {
247
- this.printFailed = true;
167
+ // we have to initialse this obj with empty strings to display the select component
168
+ // but don't want to send any attributes with empty strings to the API
169
+ if (this.selectedPrinterConfig.Trays &&
170
+ this.selectedPrinterConfig.Trays.length >= 0 &&
171
+ this.selectedPrinterConfig.Trays[0] == null) {
172
+ delete this.selectedProperties.trayname;
173
+ delete this.selectedProperties.defaultSource;
174
+ }
175
+ let cleanPrintProperties = removeEmptyStrings(this.selectedProperties);
176
+ cleanPrintProperties = managePaperDimensions(cleanPrintProperties);
177
+ if (cleanPrintProperties.PageRanges)
178
+ cleanPrintProperties.PageRanges = formatPageRange(cleanPrintProperties.PageRanges);
179
+ // put it in store for further use
180
+ printStore.state.fileUrl = this.fileurl;
181
+ printStore.state.fileID = this.fileid;
182
+ printStore.state.fileType = this.filetype;
183
+ printStore.state.printerID = this.selectedPrinter.id;
184
+ printStore.state.printerProperties = this.selectedProperties;
185
+ printStore.state.fileName = this.filename;
186
+ if (this.fileurl) {
187
+ this.printService
188
+ .printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
189
+ .then((response) => {
190
+ if (response.status === 200 && this.selectedPrinter.is_queue) {
191
+ this.printProcessing = false;
192
+ this.printSuccess = true;
193
+ if (hubTimeout)
194
+ clearTimeout(hubTimeout);
195
+ }
196
+ if (response.status === 412) {
197
+ response.json().then((data) => (this.fileid = data.fileid));
198
+ this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
199
+ }
200
+ else {
201
+ return response.json();
202
+ }
203
+ })
204
+ .then((data) => {
205
+ if (data.code === 804) {
206
+ this.printFailed = true;
207
+ this.printProcessing = false;
208
+ if (hubTimeout)
209
+ clearTimeout(hubTimeout);
210
+ }
211
+ else if (this.selectedPrinter.is_queue &&
212
+ (data.code === 412 || data.code === 500 || data.code === 503 || data.code === 1048579)) {
213
+ // Hub printer specific errors - likely driver not assigned
214
+ console.log('[handlePrint] Hub printer driver error detected:', data);
215
+ this.hubDriverError = true;
216
+ this.printProcessing = false;
217
+ if (hubTimeout)
218
+ clearTimeout(hubTimeout);
219
+ }
220
+ else if (data.jobid) {
221
+ printStore.state.jobID = data.jobid;
222
+ poll({
223
+ fn: this.printService.getPrintStatus,
224
+ validate: this.validateData,
225
+ interval: this.POLL_INTERVAL,
226
+ maxAttempts: this.MAX_POLL_ATTEMPTS,
227
+ }).catch((err) => {
228
+ console.warn('[handlePrint] Polling error:', err);
229
+ // Check if this is a hub printer and the error might be driver-related
230
+ if (this.selectedPrinter.is_queue) {
231
+ this.hubDriverError = true;
232
+ }
233
+ else {
234
+ this.printFailed = true;
235
+ }
236
+ this.printProcessing = false;
237
+ if (hubTimeout)
238
+ clearTimeout(hubTimeout);
239
+ });
240
+ }
241
+ else {
242
+ // No job ID returned - check if it's a hub printer
243
+ if (this.selectedPrinter.is_queue) {
244
+ this.hubDriverError = true;
245
+ }
246
+ else {
247
+ this.printFailed = true;
248
+ }
249
+ this.printProcessing = false;
250
+ if (hubTimeout)
251
+ clearTimeout(hubTimeout);
252
+ }
253
+ })
254
+ .catch((error) => {
255
+ console.log('[handlePrint] Error caught:', error);
256
+ // Check if this is a hub printer and the error might be driver-related
257
+ if (this.selectedPrinter.is_queue) {
258
+ this.hubDriverError = true;
259
+ }
260
+ else {
261
+ this.printFailed = true;
262
+ }
263
+ this.printProcessing = false;
264
+ if (hubTimeout)
265
+ clearTimeout(hubTimeout);
266
+ });
267
+ }
268
+ else if (this.files && this.files.length > 1) {
269
+ await this.processMultipleFiles(this.files, cleanPrintProperties);
270
+ if (hubTimeout)
271
+ clearTimeout(hubTimeout);
248
272
  }
273
+ else if (this.files && this.files.length === 1) {
274
+ // --- Begin: Consistent single file handling ---
275
+ this.totalFiles = 1;
276
+ this.currentFileIndex = 0;
277
+ this.failedFiles = [];
278
+ this.successfulFiles = [];
279
+ try {
280
+ await this.processSingleFile(this.files[0], cleanPrintProperties);
281
+ this.successfulFiles.push(this.files[0].name);
282
+ this.printSuccess = true;
283
+ this.partialSuccess = false;
284
+ this.printProcessing = false;
285
+ }
286
+ catch (error) {
287
+ console.error(`Error processing file ${this.files[0].name}:`, error);
288
+ this.failedFiles.push(this.files[0].name);
289
+ this.printFailed = true;
290
+ this.partialSuccess = false;
291
+ this.printProcessing = false;
292
+ // Check if this is a hub driver error
293
+ if (error.message && error.message.includes('Hub printer driver error')) {
294
+ this.hubDriverError = true;
295
+ }
296
+ }
297
+ if (hubTimeout)
298
+ clearTimeout(hubTimeout);
299
+ // --- End: Consistent single file handling ---
300
+ }
301
+ localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
302
+ localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
303
+ this.printStopped = false;
304
+ };
305
+ this.handleUserMenu = () => {
306
+ this.userMenuOpen = true;
307
+ };
308
+ this.validateFileType = async (name) => {
309
+ const extension = name.split('.').pop();
310
+ this.fileExtension = extension.toLowerCase();
311
+ return printStore.state.supportedFileExtensions.includes(`${this.fileExtension}`);
312
+ };
313
+ }
314
+ /**
315
+ *
316
+ * Listeners
317
+ *
318
+ */
319
+ listenInputValueChanged(event) {
320
+ this.setSelectedProperties(event.detail);
321
+ }
322
+ listenSelectSelection(event) {
323
+ this.setSelectedProperties(event.detail);
324
+ }
325
+ listenStepperChanged(event) {
326
+ this.selectedProperties.copies = event.detail;
327
+ }
328
+ listenUserMenuClosure() {
329
+ this.userMenuOpen = false;
330
+ }
331
+ listenLogout() {
332
+ this.printCancel.emit();
333
+ this.logout.emit();
334
+ }
335
+ listenStatusCancel(event) {
336
+ if (event.detail === 'print-processing') {
337
+ this.printStopped = true;
249
338
  this.printProcessing = false;
250
- if (hubTimeout)
251
- clearTimeout(hubTimeout);
252
- }
253
- })
254
- .catch((error) => {
255
- console.log('[handlePrint] Error caught:', error);
256
- // Check if this is a hub printer and the error might be driver-related
257
- if (this.selectedPrinter.is_queue) {
258
- this.hubDriverError = true;
259
- }
260
- else {
261
- this.printFailed = true;
262
- }
263
- this.printProcessing = false;
264
- if (hubTimeout)
265
- clearTimeout(hubTimeout);
266
- });
267
- }
268
- else if (this.files && this.files.length > 1) {
269
- await this.processMultipleFiles(this.files, cleanPrintProperties);
270
- if (hubTimeout)
271
- clearTimeout(hubTimeout);
272
- }
273
- else if (this.files && this.files.length === 1) {
274
- // --- Begin: Consistent single file handling ---
275
- this.totalFiles = 1;
276
- this.currentFileIndex = 0;
277
- this.failedFiles = [];
278
- this.successfulFiles = [];
279
- try {
280
- await this.processSingleFile(this.files[0], cleanPrintProperties);
281
- this.successfulFiles.push(this.files[0].name);
282
- this.printSuccess = true;
283
- this.partialSuccess = false;
284
- this.printProcessing = false;
339
+ // Abort the print request
340
+ this.printService.abortPrint();
285
341
  }
286
- catch (error) {
287
- console.error(`Error processing file ${this.files[0].name}:`, error);
288
- this.failedFiles.push(this.files[0].name);
289
- this.printFailed = true;
290
- this.partialSuccess = false;
291
- this.printProcessing = false;
292
- // Check if this is a hub driver error
293
- if (error.message && error.message.includes('Hub printer driver error')) {
294
- this.hubDriverError = true;
295
- }
342
+ }
343
+ listenStatusClose(event) {
344
+ switch (event.detail) {
345
+ case 'print-success':
346
+ this.printSuccess = false;
347
+ this.partialSuccess = false;
348
+ this.failedFiles = [];
349
+ this.successfulFiles = [];
350
+ this.printCancel.emit();
351
+ break;
352
+ case 'print-failed':
353
+ this.printFailed = false;
354
+ break;
355
+ case 'hub-driver-error':
356
+ this.hubDriverError = false;
357
+ break;
358
+ case 'not-supported':
359
+ this.noPrinters = false;
360
+ break;
361
+ case 'no-printers':
362
+ this.noPrinters = false;
363
+ this.printCancel.emit();
364
+ break;
296
365
  }
297
- if (hubTimeout)
298
- clearTimeout(hubTimeout);
299
- // --- End: Consistent single file handling ---
300
- }
301
- localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
302
- localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
303
- this.printStopped = false;
304
- };
305
- this.handleUserMenu = () => {
306
- this.userMenuOpen = true;
307
- };
308
- this.validateFileType = async (name) => {
309
- const extension = name.split('.').pop();
310
- this.fileExtension = extension.toLowerCase();
311
- return printStore.state.supportedFileExtensions.includes(`${this.fileExtension}`);
312
- };
313
- }
314
- /**
315
- *
316
- * Listeners
317
- *
318
- */
319
- listenInputValueChanged(event) {
320
- this.setSelectedProperties(event.detail);
321
- }
322
- listenSelectSelection(event) {
323
- this.setSelectedProperties(event.detail);
324
- }
325
- listenStepperChanged(event) {
326
- this.selectedProperties.copies = event.detail;
327
- }
328
- listenUserMenuClosure() {
329
- this.userMenuOpen = false;
330
- }
331
- listenLogout() {
332
- this.printCancel.emit();
333
- this.logout.emit();
334
- }
335
- listenStatusCancel(event) {
336
- if (event.detail === 'print-processing') {
337
- this.printStopped = true;
338
- this.printProcessing = false;
339
- // Abort the print request
340
- this.printService.abortPrint();
341
366
  }
342
- }
343
- listenStatusClose(event) {
344
- switch (event.detail) {
345
- case 'print-success':
346
- this.printSuccess = false;
347
- this.partialSuccess = false;
348
- this.failedFiles = [];
349
- this.successfulFiles = [];
350
- this.printCancel.emit();
351
- break;
352
- case 'print-failed':
353
- this.printFailed = false;
354
- break;
355
- case 'hub-driver-error':
356
- this.hubDriverError = false;
357
- break;
358
- case 'not-supported':
359
- this.noPrinters = false;
360
- break;
361
- case 'no-printers':
362
- this.noPrinters = false;
363
- this.printCancel.emit();
364
- break;
367
+ listenStatusRetry(event) {
368
+ switch (event.detail) {
369
+ case 'not-supported':
370
+ this.printCancel.emit();
371
+ break;
372
+ case 'print-failed':
373
+ this.printFailed = false;
374
+ this.printProcessing = false;
375
+ this.handlePrint();
376
+ break;
377
+ case 'hub-driver-error':
378
+ this.hubDriverError = false;
379
+ this.printProcessing = false;
380
+ this.handlePrint();
381
+ break;
382
+ }
365
383
  }
366
- }
367
- listenStatusRetry(event) {
368
- switch (event.detail) {
369
- case 'not-supported':
370
- this.printCancel.emit();
371
- break;
372
- case 'print-failed':
373
- this.printFailed = false;
374
- this.printProcessing = false;
375
- this.handlePrint();
376
- break;
377
- case 'hub-driver-error':
378
- this.hubDriverError = false;
379
- this.printProcessing = false;
380
- this.handlePrint();
381
- break;
384
+ getPropertiesFromLocalStorage() {
385
+ if (localStorage.getItem('properties')) {
386
+ this.selectedProperties = JSON.parse(localStorage.getItem('properties'));
387
+ }
388
+ if (localStorage.getItem('printer')) {
389
+ const savedPrinter = JSON.parse(localStorage.getItem('printer'));
390
+ if (this.printers.some((printer) => printer.id === savedPrinter.id)) {
391
+ this.selectedPrinter = savedPrinter;
392
+ }
393
+ else {
394
+ this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
395
+ localStorage.removeItem('printer');
396
+ localStorage.removeItem('properties');
397
+ }
398
+ }
399
+ else {
400
+ this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
401
+ }
402
+ this.setPaperid();
382
403
  }
383
- }
384
- getPropertiesFromLocalStorage() {
385
- if (localStorage.getItem('properties')) {
386
- this.selectedProperties = JSON.parse(localStorage.getItem('properties'));
404
+ setPaperid() {
405
+ this.paperid = this.selectedProperties.paperid;
387
406
  }
388
- if (localStorage.getItem('printer')) {
389
- const savedPrinter = JSON.parse(localStorage.getItem('printer'));
390
- if (this.printers.some((printer) => printer.id === savedPrinter.id)) {
391
- this.selectedPrinter = savedPrinter;
392
- }
393
- else {
394
- this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
395
- localStorage.removeItem('printer');
396
- localStorage.removeItem('properties');
397
- }
407
+ getUserInfo() {
408
+ const userService = new EzpUserService();
409
+ return userService.getUserInfo().then((user) => {
410
+ userStore.state.user = user;
411
+ this.userName = userStore.state.user.display_name;
412
+ });
398
413
  }
399
- else {
400
- this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
414
+ async setSelectedProperties(eventDetails) {
415
+ switch (eventDetails.type) {
416
+ case 'printer':
417
+ this.selectedPrinter.id = eventDetails.id;
418
+ this.selectedPrinter.name = eventDetails.title;
419
+ this.selectedPrinter.is_queue = eventDetails.is_queue;
420
+ await this.printService
421
+ .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
422
+ .then((data) => {
423
+ var _a, _b, _c, _d, _e, _f, _g;
424
+ this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
425
+ this.selectedProperties.color =
426
+ ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
427
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
428
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
429
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
430
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
431
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
432
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
433
+ if (this.selectedPrinterConfig.Trays &&
434
+ this.selectedPrinterConfig.Trays.length >= 1 &&
435
+ this.selectedPrinterConfig.Trays[0] != null) {
436
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
437
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
438
+ }
439
+ if (this.selectedPrinterConfig.Trays &&
440
+ this.selectedPrinterConfig.Trays.length >= 0 &&
441
+ this.selectedPrinterConfig.Trays[0] == null) {
442
+ delete this.selectedProperties.trayname;
443
+ delete this.selectedProperties.defaultSource;
444
+ }
445
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
446
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
447
+ delete this.selectedProperties.PageRanges;
448
+ });
449
+ // this.setDefaultPaperFormat()
450
+ break;
451
+ case 'color':
452
+ this.selectedProperties.color =
453
+ eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
454
+ break;
455
+ case 'orientation':
456
+ this.selectedProperties.orientation = eventDetails.id;
457
+ break;
458
+ case 'format':
459
+ this.selectedProperties.paper = eventDetails.title;
460
+ this.selectedProperties.paperid = eventDetails.id;
461
+ break;
462
+ case 'quality':
463
+ this.selectedProperties.resolution = eventDetails.title;
464
+ break;
465
+ case 'length':
466
+ this.selectedProperties.paperlength = eventDetails.value;
467
+ break;
468
+ case 'width':
469
+ this.selectedProperties.paperwidth = eventDetails.value;
470
+ break;
471
+ case 'tray':
472
+ if (this.selectedPrinterConfig.Trays &&
473
+ this.selectedPrinterConfig.Trays.length >= 0 &&
474
+ this.selectedPrinterConfig.Trays[0] == null) {
475
+ delete this.selectedProperties.trayname;
476
+ delete this.selectedProperties.defaultSource;
477
+ }
478
+ if (this.selectedPrinterConfig.Trays &&
479
+ this.selectedPrinterConfig.Trays.length >= 1 &&
480
+ this.selectedPrinterConfig.Trays[0] != null) {
481
+ this.selectedProperties.trayname = eventDetails.title;
482
+ this.selectedProperties.defaultSource = eventDetails.id;
483
+ }
484
+ break;
485
+ case 'paper_ranges':
486
+ this.selectedProperties.PageRanges = eventDetails.value;
487
+ this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
488
+ break;
489
+ case 'duplex':
490
+ if (eventDetails.title == i18next.t('printer_selection.duplex_none') ||
491
+ eventDetails.title == i18next.t('printer_selection.duplex_long') ||
492
+ eventDetails.title == i18next.t('printer_selection.duplex_short')) {
493
+ this.selectedProperties.duplex = true;
494
+ }
495
+ else {
496
+ this.selectedProperties.duplex = false;
497
+ }
498
+ this.selectedProperties.duplexmode = eventDetails.id;
499
+ break;
500
+ default:
501
+ break;
502
+ }
503
+ this.setPaperid();
401
504
  }
402
- this.setPaperid();
403
- }
404
- setPaperid() {
405
- this.paperid = this.selectedProperties.paperid;
406
- }
407
- getUserInfo() {
408
- const userService = new EzpUserService();
409
- return userService.getUserInfo().then((user) => {
410
- userStore.state.user = user;
411
- this.userName = userStore.state.user.display_name;
412
- });
413
- }
414
- async setSelectedProperties(eventDetails) {
415
- switch (eventDetails.type) {
416
- case 'printer':
417
- this.selectedPrinter.id = eventDetails.id;
418
- this.selectedPrinter.name = eventDetails.title;
419
- this.selectedPrinter.is_queue = eventDetails.is_queue;
420
- await this.printService
421
- .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
422
- .then((data) => {
423
- var _a, _b, _c, _d, _e, _f, _g;
424
- this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
425
- this.selectedProperties.color =
426
- ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
427
- this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
428
- this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
429
- let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
430
- this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
431
- this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
432
- let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
433
- if (this.selectedPrinterConfig.Trays &&
434
- this.selectedPrinterConfig.Trays.length >= 1 &&
435
- this.selectedPrinterConfig.Trays[0] != null) {
436
- this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
437
- this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
438
- }
439
- if (this.selectedPrinterConfig.Trays &&
440
- this.selectedPrinterConfig.Trays.length >= 0 &&
441
- this.selectedPrinterConfig.Trays[0] == null) {
442
- delete this.selectedProperties.trayname;
443
- delete this.selectedProperties.defaultSource;
444
- }
445
- this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
446
- this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
447
- delete this.selectedProperties.PageRanges;
448
- });
449
- // this.setDefaultPaperFormat()
450
- break;
451
- case 'color':
452
- this.selectedProperties.color =
453
- eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
454
- break;
455
- case 'orientation':
456
- this.selectedProperties.orientation = eventDetails.id;
457
- break;
458
- case 'format':
459
- this.selectedProperties.paper = eventDetails.title;
460
- this.selectedProperties.paperid = eventDetails.id;
461
- break;
462
- case 'quality':
463
- this.selectedProperties.resolution = eventDetails.title;
464
- break;
465
- case 'length':
466
- this.selectedProperties.paperlength = eventDetails.value;
467
- break;
468
- case 'width':
469
- this.selectedProperties.paperwidth = eventDetails.value;
470
- break;
471
- case 'tray':
472
- if (this.selectedPrinterConfig.Trays &&
473
- this.selectedPrinterConfig.Trays.length >= 0 &&
474
- this.selectedPrinterConfig.Trays[0] == null) {
475
- delete this.selectedProperties.trayname;
476
- delete this.selectedProperties.defaultSource;
505
+ async handleFiles(files, printPorperties) {
506
+ this.totalFiles = files.length;
507
+ this.currentFileIndex = 0;
508
+ this.failedFiles = [];
509
+ this.successfulFiles = [];
510
+ // Process each file individually
511
+ for (let i = 0; i < files.length; i++) {
512
+ this.currentFileIndex = i;
513
+ const file = files[i];
514
+ try {
515
+ await this.processSingleFile(file, printPorperties);
516
+ this.successfulFiles.push(file.name);
517
+ }
518
+ catch (error) {
519
+ console.error(`Error processing file ${file.name}:`, error);
520
+ this.failedFiles.push(file.name);
521
+ // Check if this is a hub driver error
522
+ if (error.message && error.message.includes('Hub printer driver error')) {
523
+ this.hubDriverError = true;
524
+ this.printProcessing = false;
525
+ return; // Stop processing other files if it's a hub driver issue
526
+ }
527
+ // Continue with the next file
528
+ }
477
529
  }
478
- if (this.selectedPrinterConfig.Trays &&
479
- this.selectedPrinterConfig.Trays.length >= 1 &&
480
- this.selectedPrinterConfig.Trays[0] != null) {
481
- this.selectedProperties.trayname = eventDetails.title;
482
- this.selectedProperties.defaultSource = eventDetails.id;
530
+ // Determine final status based on results
531
+ if (this.failedFiles.length === 0) {
532
+ // All files processed successfully
533
+ this.printSuccess = true;
534
+ this.partialSuccess = false;
535
+ this.printProcessing = false;
483
536
  }
484
- break;
485
- case 'paper_ranges':
486
- this.selectedProperties.PageRanges = eventDetails.value;
487
- this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
488
- break;
489
- case 'duplex':
490
- if (eventDetails.title == i18next.t('printer_selection.duplex_none') ||
491
- eventDetails.title == i18next.t('printer_selection.duplex_long') ||
492
- eventDetails.title == i18next.t('printer_selection.duplex_short')) {
493
- this.selectedProperties.duplex = true;
537
+ else if (this.successfulFiles.length === 0) {
538
+ // All files failed
539
+ this.printFailed = true;
540
+ this.partialSuccess = false;
541
+ this.printProcessing = false;
494
542
  }
495
543
  else {
496
- this.selectedProperties.duplex = false;
544
+ // Some files succeeded, some failed - show partial success
545
+ this.printSuccess = true;
546
+ this.partialSuccess = true;
547
+ this.printProcessing = false;
497
548
  }
498
- this.selectedProperties.duplexmode = eventDetails.id;
499
- break;
500
- default:
501
- break;
502
549
  }
503
- this.setPaperid();
504
- }
505
- async handleFiles(files, printPorperties) {
506
- this.totalFiles = files.length;
507
- this.currentFileIndex = 0;
508
- this.failedFiles = [];
509
- this.successfulFiles = [];
510
- // Process each file individually
511
- for (let i = 0; i < files.length; i++) {
512
- this.currentFileIndex = i;
513
- const file = files[i];
514
- try {
515
- await this.processSingleFile(file, printPorperties);
516
- this.successfulFiles.push(file.name);
517
- }
518
- catch (error) {
519
- console.error(`Error processing file ${file.name}:`, error);
520
- this.failedFiles.push(file.name);
521
- // Check if this is a hub driver error
522
- if (error.message && error.message.includes('Hub printer driver error')) {
523
- this.hubDriverError = true;
524
- this.printProcessing = false;
525
- return; // Stop processing other files if it's a hub driver issue
550
+ async processSingleFile(file, printProperties) {
551
+ this.preparingUpload = true;
552
+ const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
553
+ this.preparingUpload = false;
554
+ const fileid = response.fileid;
555
+ const sasUri = response.sasUri;
556
+ const filetype = this.getFileExtension(file.name);
557
+ this.uploading = true;
558
+ try {
559
+ // Upload the file
560
+ const res = await this.printService.uploadBlobFiles(sasUri, file);
561
+ if (res._response.status === 201) {
562
+ // Print the file
563
+ const data = await this.printService.printByFileID(authStore.state.accessToken, fileid, filetype, this.selectedPrinter.id, printProperties, file.name);
564
+ if (data.code === 804) {
565
+ throw new Error(`Print failed for file: ${file.name}`);
566
+ }
567
+ // Check for hub printer driver errors
568
+ if (this.selectedPrinter.is_queue &&
569
+ (data.code === 412 || data.code === 500 || data.code === 503)) {
570
+ throw new Error(`Hub printer driver error for file: ${file.name}`);
571
+ }
572
+ if (data.jobid) {
573
+ printStore.state.jobID = data.jobid;
574
+ // Wait for this print job to complete before processing the next file
575
+ await this.waitForPrintCompletion();
576
+ }
577
+ else {
578
+ throw new Error(`No job ID returned for file: ${file.name}`);
579
+ }
580
+ }
581
+ else {
582
+ throw new Error(`Upload failed for file: ${file.name}`);
583
+ }
526
584
  }
527
- // Continue with the next file
528
- }
529
- }
530
- // Determine final status based on results
531
- if (this.failedFiles.length === 0) {
532
- // All files processed successfully
533
- this.printSuccess = true;
534
- this.partialSuccess = false;
535
- this.printProcessing = false;
585
+ catch (error) {
586
+ this.uploading = false;
587
+ throw error;
588
+ }
589
+ this.uploading = false;
536
590
  }
537
- else if (this.successfulFiles.length === 0) {
538
- // All files failed
539
- this.printFailed = true;
540
- this.partialSuccess = false;
541
- this.printProcessing = false;
591
+ async waitForPrintCompletion() {
592
+ while (true) {
593
+ try {
594
+ const data = await this.printService.getPrintStatus();
595
+ console.log('[waitForPrintCompletion] Poll response:', data);
596
+ if (data.jobstatus === 0) {
597
+ // Success
598
+ return;
599
+ }
600
+ else if (data.jobstatus === 1246 || data.jobstatus === 129) {
601
+ // Still processing, wait before next poll
602
+ await new Promise((resolve) => setTimeout(resolve, this.POLL_INTERVAL));
603
+ }
604
+ else if (data.jobstatus === 3011 || data.jobstatus === 2) {
605
+ // Failure
606
+ throw new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus));
607
+ }
608
+ else if (this.selectedPrinter.is_queue &&
609
+ (data.jobstatus === 412 || data.jobstatus === 500 || data.jobstatus === 503)) {
610
+ // Hub printer driver error
611
+ throw new Error('Hub printer driver error: ' + (data.jobstatusstring || data.jobstatus));
612
+ }
613
+ else {
614
+ // Unknown status, treat as failure for safety
615
+ throw new Error('Unknown print job status: ' + data.jobstatus);
616
+ }
617
+ }
618
+ catch (error) {
619
+ throw error;
620
+ }
621
+ }
542
622
  }
543
- else {
544
- // Some files succeeded, some failed - show partial success
545
- this.printSuccess = true;
546
- this.partialSuccess = true;
547
- this.printProcessing = false;
623
+ getFileExtension(filename) {
624
+ const extension = filename.split('.').pop();
625
+ return extension ? extension.toLowerCase() : '';
548
626
  }
549
- }
550
- async processSingleFile(file, printProperties) {
551
- this.preparingUpload = true;
552
- const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
553
- this.preparingUpload = false;
554
- const fileid = response.fileid;
555
- const sasUri = response.sasUri;
556
- const filetype = this.getFileExtension(file.name);
557
- this.uploading = true;
558
- try {
559
- // Upload the file
560
- const res = await this.printService.uploadBlobFiles(sasUri, file);
561
- if (res._response.status === 201) {
562
- // Print the file
563
- const data = await this.printService.printByFileID(authStore.state.accessToken, fileid, filetype, this.selectedPrinter.id, printProperties, file.name);
564
- if (data.code === 804) {
565
- throw new Error(`Print failed for file: ${file.name}`);
627
+ setDefaultPaperFormat() {
628
+ var _a, _b, _c, _d, _e;
629
+ let format;
630
+ const language = navigator.language;
631
+ if (language === 'en-US') {
632
+ format = 'Letter';
566
633
  }
567
- // Check for hub printer driver errors
568
- if (this.selectedPrinter.is_queue &&
569
- (data.code === 412 || data.code === 500 || data.code === 503)) {
570
- throw new Error(`Hub printer driver error for file: ${file.name}`);
634
+ else if (language === 'my') {
635
+ format = 'Letter';
636
+ }
637
+ else {
638
+ format = 'A4';
571
639
  }
572
- if (data.jobid) {
573
- printStore.state.jobID = data.jobid;
574
- // Wait for this print job to complete before processing the next file
575
- await this.waitForPrintCompletion();
640
+ if ((_a = this.selectedPrinterConfig.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((el) => el.Name.includes(format))) {
641
+ this.selectedProperties.paper = (_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.find((el) => el.Name.includes(format)).Name;
642
+ this.selectedProperties.paperid = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.find((el) => el.Name.includes(format)).Id;
576
643
  }
577
644
  else {
578
- throw new Error(`No job ID returned for file: ${file.name}`);
645
+ this.selectedProperties.paper = (_d = this.selectedPrinterConfig.PaperFormats[0]) === null || _d === void 0 ? void 0 : _d.Name;
646
+ this.selectedProperties.paperid = (_e = this.selectedPrinterConfig.PaperFormats[0]) === null || _e === void 0 ? void 0 : _e.Id;
579
647
  }
580
- }
581
- else {
582
- throw new Error(`Upload failed for file: ${file.name}`);
583
- }
648
+ this.setPaperid();
584
649
  }
585
- catch (error) {
586
- this.uploading = false;
587
- throw error;
588
- }
589
- this.uploading = false;
590
- }
591
- async waitForPrintCompletion() {
592
- while (true) {
593
- try {
594
- const data = await this.printService.getPrintStatus();
595
- console.log('[waitForPrintCompletion] Poll response:', data);
596
- if (data.jobstatus === 0) {
597
- // Success
598
- return;
599
- }
600
- else if (data.jobstatus === 1246 || data.jobstatus === 129) {
601
- // Still processing, wait before next poll
602
- await new Promise((resolve) => setTimeout(resolve, this.POLL_INTERVAL));
650
+ async processMultipleFiles(files, printProperties) {
651
+ this.totalFiles = files.length;
652
+ this.currentFileIndex = 0;
653
+ this.failedFiles = [];
654
+ this.successfulFiles = [];
655
+ for (let i = 0; i < files.length; i++) {
656
+ this.currentFileIndex = i;
657
+ const file = files[i];
658
+ try {
659
+ await this.processSingleFile(file, printProperties);
660
+ this.successfulFiles.push(file.name);
661
+ }
662
+ catch (error) {
663
+ console.error(`Error processing file ${file.name}:`, error);
664
+ this.failedFiles.push(file.name);
665
+ // Continue with the next file
666
+ }
603
667
  }
604
- else if (data.jobstatus === 3011 || data.jobstatus === 2) {
605
- // Failure
606
- throw new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus));
668
+ // Set UI state
669
+ if (this.failedFiles.length === 0) {
670
+ this.printSuccess = true;
671
+ this.partialSuccess = false;
672
+ this.printProcessing = false;
607
673
  }
608
- else if (this.selectedPrinter.is_queue &&
609
- (data.jobstatus === 412 || data.jobstatus === 500 || data.jobstatus === 503)) {
610
- // Hub printer driver error
611
- throw new Error('Hub printer driver error: ' + (data.jobstatusstring || data.jobstatus));
674
+ else if (this.successfulFiles.length === 0) {
675
+ this.printFailed = true;
676
+ this.partialSuccess = false;
677
+ this.printProcessing = false;
612
678
  }
613
679
  else {
614
- // Unknown status, treat as failure for safety
615
- throw new Error('Unknown print job status: ' + data.jobstatus);
680
+ this.printSuccess = true;
681
+ this.partialSuccess = true;
682
+ this.printProcessing = false;
616
683
  }
617
- }
618
- catch (error) {
619
- throw error;
620
- }
621
- }
622
- }
623
- getFileExtension(filename) {
624
- const extension = filename.split('.').pop();
625
- return extension ? extension.toLowerCase() : '';
626
- }
627
- setDefaultPaperFormat() {
628
- var _a, _b, _c, _d, _e;
629
- let format;
630
- const language = navigator.language;
631
- if (language === 'en-US') {
632
- format = 'Letter';
633
684
  }
634
- else if (language === 'my') {
635
- format = 'Letter';
636
- }
637
- else {
638
- format = 'A4';
639
- }
640
- if ((_a = this.selectedPrinterConfig.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((el) => el.Name.includes(format))) {
641
- this.selectedProperties.paper = (_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.find((el) => el.Name.includes(format)).Name;
642
- this.selectedProperties.paperid = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.find((el) => el.Name.includes(format)).Id;
643
- }
644
- else {
645
- this.selectedProperties.paper = (_d = this.selectedPrinterConfig.PaperFormats[0]) === null || _d === void 0 ? void 0 : _d.Name;
646
- this.selectedProperties.paperid = (_e = this.selectedPrinterConfig.PaperFormats[0]) === null || _e === void 0 ? void 0 : _e.Id;
647
- }
648
- this.setPaperid();
649
- }
650
- async processMultipleFiles(files, printProperties) {
651
- this.totalFiles = files.length;
652
- this.currentFileIndex = 0;
653
- this.failedFiles = [];
654
- this.successfulFiles = [];
655
- for (let i = 0; i < files.length; i++) {
656
- this.currentFileIndex = i;
657
- const file = files[i];
658
- try {
659
- await this.processSingleFile(file, printProperties);
660
- this.successfulFiles.push(file.name);
661
- }
662
- catch (error) {
663
- console.error(`Error processing file ${file.name}:`, error);
664
- this.failedFiles.push(file.name);
665
- // Continue with the next file
666
- }
667
- }
668
- // Set UI state
669
- if (this.failedFiles.length === 0) {
670
- this.printSuccess = true;
671
- this.partialSuccess = false;
672
- this.printProcessing = false;
673
- }
674
- else if (this.successfulFiles.length === 0) {
675
- this.printFailed = true;
676
- this.partialSuccess = false;
677
- this.printProcessing = false;
678
- }
679
- else {
680
- this.printSuccess = true;
681
- this.partialSuccess = true;
682
- this.printProcessing = false;
683
- }
684
- }
685
- /**
686
- *
687
- * Lifecycle methods
688
- *
689
- */
690
- /** Description... */
691
- async connectedCallback() {
692
- this.printService = new EzpPrintService(this.redirectURI, this.clientID);
693
- this.printService.registerFetchInterceptor();
694
- await this.getUserInfo();
695
- await this.printService
696
- .getPrinterList(authStore.state.accessToken)
697
- .then((printers) => {
698
- this.printers = printers;
699
- if (!(this.printers.length > 0)) {
700
- this.noPrinters = true;
701
- }
702
- });
703
- this.getPropertiesFromLocalStorage();
704
- // if printer is stored from previous print, get the config to enable property selection
705
- if (this.selectedPrinter.id != '') {
706
- await this.printService
707
- .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
708
- .then((data) => {
709
- var _a, _b, _c, _d, _e, _f, _g;
710
- this.selectedPrinterConfig = data[0];
711
- this.selectedProperties.color =
712
- ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
713
- this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
714
- this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
715
- let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
716
- this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
717
- this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
718
- let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
719
- if (this.selectedPrinterConfig.Trays &&
720
- this.selectedPrinterConfig.Trays.length >= 1 &&
721
- this.selectedPrinterConfig.Trays[0] != null) {
722
- this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
723
- this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
685
+ /**
686
+ *
687
+ * Lifecycle methods
688
+ *
689
+ */
690
+ /** Description... */
691
+ async connectedCallback() {
692
+ this.printService = new EzpPrintService(this.redirectURI, this.clientID);
693
+ this.printService.registerFetchInterceptor();
694
+ await this.getUserInfo();
695
+ await this.printService
696
+ .getPrinterList(authStore.state.accessToken)
697
+ .then((printers) => {
698
+ this.printers = printers;
699
+ if (!(this.printers.length > 0)) {
700
+ this.noPrinters = true;
701
+ }
702
+ });
703
+ this.getPropertiesFromLocalStorage();
704
+ // if printer is stored from previous print, get the config to enable property selection
705
+ if (this.selectedPrinter.id != '') {
706
+ await this.printService
707
+ .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
708
+ .then((data) => {
709
+ var _a, _b, _c, _d, _e, _f, _g;
710
+ this.selectedPrinterConfig = data[0];
711
+ this.selectedProperties.color =
712
+ ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
713
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
714
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
715
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
716
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
717
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
718
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
719
+ if (this.selectedPrinterConfig.Trays &&
720
+ this.selectedPrinterConfig.Trays.length >= 1 &&
721
+ this.selectedPrinterConfig.Trays[0] != null) {
722
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
723
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
724
+ }
725
+ if (this.selectedPrinterConfig.Trays &&
726
+ this.selectedPrinterConfig.Trays.length >= 0 &&
727
+ this.selectedPrinterConfig.Trays[0] == null) {
728
+ delete this.selectedProperties.trayname;
729
+ delete this.selectedProperties.defaultSource;
730
+ }
731
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
732
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
733
+ delete this.selectedProperties.PageRanges;
734
+ });
735
+ if (this.selectedProperties.paper === '') {
736
+ this.setDefaultPaperFormat();
737
+ }
724
738
  }
725
- if (this.selectedPrinterConfig.Trays &&
726
- this.selectedPrinterConfig.Trays.length >= 0 &&
727
- this.selectedPrinterConfig.Trays[0] == null) {
728
- delete this.selectedProperties.trayname;
729
- delete this.selectedProperties.defaultSource;
739
+ await (await this.printService.getConfig(authStore.state.accessToken))
740
+ .json()
741
+ .then((response) => {
742
+ printStore.state.supportedFileExtensions = response.System.FILEEXT;
743
+ });
744
+ await this.printService
745
+ .getAllPrinterProperties(authStore.state.accessToken)
746
+ .then((printerConfig) => {
747
+ this.printerConfig = printerConfig;
748
+ });
749
+ if (this.files && this.files.length > 0) {
750
+ // Validate all files
751
+ const validationPromises = this.files.map((file) => this.validateFileType(file.name));
752
+ const validationResults = await Promise.all(validationPromises);
753
+ const allValid = validationResults.every((valid) => valid);
754
+ this.notSupported = !allValid;
730
755
  }
731
- this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
732
- this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
733
- delete this.selectedProperties.PageRanges;
734
- });
735
- if (this.selectedProperties.paper === '') {
736
- this.setDefaultPaperFormat();
737
- }
738
- }
739
- await (await this.printService.getConfig(authStore.state.accessToken))
740
- .json()
741
- .then((response) => {
742
- printStore.state.supportedFileExtensions = response.System.FILEEXT;
743
- });
744
- await this.printService
745
- .getAllPrinterProperties(authStore.state.accessToken)
746
- .then((printerConfig) => {
747
- this.printerConfig = printerConfig;
748
- });
749
- if (this.files && this.files.length > 0) {
750
- // Validate all files
751
- const validationPromises = this.files.map((file) => this.validateFileType(file.name));
752
- const validationResults = await Promise.all(validationPromises);
753
- const allValid = validationResults.every((valid) => valid);
754
- this.notSupported = !allValid;
756
+ this.loading = false;
755
757
  }
756
- this.loading = false;
757
- }
758
- /**
759
- *
760
- * Render method
761
- *
762
- */
763
- render() {
764
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
765
- return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } },
766
- h("div", { id: "box", "data-backdrop-surface": true },
767
- !this.printStopped && (h(Fragment, null, this.printProcessing ? (h("ezp-status", { processing: true, description: this.totalFiles > 1
768
- ? `${i18next.t('printer_selection.print_processing')} (${this.currentFileIndex + 1}/${this.totalFiles})`
769
- : this.preparingUpload
770
- ? i18next.t('printer_selection.prepare_upload')
771
- : this.uploading
772
- ? i18next.t('printer_selection.uploading')
773
- : i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.selectedPrinter.is_queue && this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: this.totalFiles > 1
774
- ? this.failedFiles.length > 0
775
- ? `${i18next.t('printer_selection.pull_print_success')} (${this.successfulFiles.length}/${this.totalFiles} files)`
776
- : `${i18next.t('printer_selection.pull_print_success')} (${this.totalFiles} files)`
777
- : i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printSuccess ? (h("ezp-status", { icon: this.partialSuccess ? 'exclamation-mark' : 'checkmark-alt', description: this.totalFiles > 1
778
- ? this.partialSuccess
779
- ? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
780
- : `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
781
- : i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.hubDriverError ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "hub-driver-error", close: true, retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)),
782
- !this.hideheader && (h("div", { id: "header" },
783
- h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }),
784
- h("ezp-label", { text: !this.notSupported
785
- ? this.files && this.files.length > 1
786
- ? i18next.t('printer_selection.files_selected', { count: this.files.length })
787
- : this.filename
788
- : '', ellipsis: true }),
789
- !this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu })))),
790
- h("div", { id: "body" },
791
- h("div", { id: "printer" },
792
- h("ezp-select", { label: i18next.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
758
+ /**
759
+ *
760
+ * Render method
761
+ *
762
+ */
763
+ render() {
764
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
765
+ return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } }, h("div", { id: "box", "data-backdrop-surface": true }, !this.printStopped && (h(Fragment, null, this.printProcessing ? (h("ezp-status", { processing: true, description: this.totalFiles > 1
766
+ ? `${i18next.t('printer_selection.print_processing')} (${this.currentFileIndex + 1}/${this.totalFiles})`
767
+ : this.preparingUpload
768
+ ? i18next.t('printer_selection.prepare_upload')
769
+ : this.uploading
770
+ ? i18next.t('printer_selection.uploading')
771
+ : i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.selectedPrinter.is_queue && this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: this.totalFiles > 1
772
+ ? this.failedFiles.length > 0
773
+ ? `${i18next.t('printer_selection.pull_print_success')} (${this.successfulFiles.length}/${this.totalFiles} files)`
774
+ : `${i18next.t('printer_selection.pull_print_success')} (${this.totalFiles} files)`
775
+ : i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printSuccess ? (h("ezp-status", { icon: this.partialSuccess ? 'exclamation-mark' : 'checkmark-alt', description: this.totalFiles > 1
776
+ ? this.partialSuccess
777
+ ? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
778
+ : `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
779
+ : i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.hubDriverError ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "hub-driver-error", close: true, retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)), !this.hideheader && (h("div", { id: "header" }, h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }), h("ezp-label", { text: !this.notSupported
780
+ ? this.files && this.files.length > 1
781
+ ? i18next.t('printer_selection.files_selected', { count: this.files.length })
782
+ : this.filename
783
+ : '', ellipsis: true }), !this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu })))), h("div", { id: "body" }, h("div", { id: "printer" }, h("ezp-select", { label: i18next.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
793
784
  ? i18next.t('printer_selection.select_printer')
794
785
  : i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
795
786
  id: printer.id,
@@ -797,392 +788,412 @@ export class EzpPrinterSelection {
797
788
  meta: printer.location !== '' ? printer.location : '',
798
789
  type: 'printer',
799
790
  is_queue: printer.is_queue,
800
- })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })),
801
- h("div", { id: "options" },
802
- h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: (_a = this.ColorOptions) === null || _a === void 0 ? void 0 : _a.map((option) => ({
791
+ })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })), h("div", { id: "options" }, h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: (_a = this.ColorOptions) === null || _a === void 0 ? void 0 : _a.map((option) => ({
803
792
  id: option.id,
804
793
  title: option.title,
805
794
  meta: '',
806
795
  type: 'color',
807
- })), preSelected: this.selectedPrinter.id && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == 'color'
796
+ })), preSelected: this.selectedPrinter.id && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == 'color'
808
797
  ? i18next.t('printer_selection.color_color')
809
- : i18next.t('printer_selection.color_grayscale'), disabled: !this.selectedPrinterConfig.ColorSupported }),
810
- h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: (_c = this.duplexOptions) === null || _c === void 0 ? void 0 : _c.map((option) => ({
798
+ : i18next.t('printer_selection.color_grayscale'), disabled: !this.selectedPrinterConfig.ColorSupported }), h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: (_c = this.duplexOptions) === null || _c === void 0 ? void 0 : _c.map((option) => ({
811
799
  id: option.id,
812
800
  title: option.title,
813
801
  meta: '',
814
802
  type: 'duplex',
815
- })), preSelected: this.selectedPrinter.id &&
803
+ })), preSelected: this.selectedPrinter.id &&
816
804
  ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == 'duplex_simplex'
817
805
  ? i18next.t('printer_selection.duplex_none')
818
806
  : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == 'duplex_vertical'
819
- ? i18next.t('printer_selection.duplex_long')
820
- : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
821
- ? i18next.t('printer_selection.duplex_short')
822
- : null, disabled: !this.selectedPrinterConfig.DuplexSupported }),
823
- h("ezp-select", { label: i18next.t('printer_selection.size'), icon: "size", placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
807
+ ? i18next.t('printer_selection.duplex_long')
808
+ : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
809
+ ? i18next.t('printer_selection.duplex_short')
810
+ : null, disabled: !this.selectedPrinterConfig.DuplexSupported }), h("ezp-select", { label: i18next.t('printer_selection.size'), icon: "size", placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
824
811
  this.selectedPrinterConfig.PaperFormats.map((format) => ({
825
- id: format.Id,
826
- title: format.Name,
827
- meta: `${format.XRes} x ${format.YRes}`,
828
- type: 'format',
812
+ id: format.Id,
813
+ title: format.Name,
814
+ meta: `${format.XRes} x ${format.YRes}`,
815
+ type: 'format',
829
816
  })), preSelected: this.selectedPrinter.id &&
830
817
  ((_g = this.selectedPrinterConfig.PaperFormats) === null || _g === void 0 ? void 0 : _g.find((el) => { var _a; return el.Name.includes((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper); }))
831
818
  ? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
832
- : null, disabled: !(((_j = this.selectedPrinterConfig.PaperFormats) === null || _j === void 0 ? void 0 : _j.length) > 0) }),
833
- this.paperid == PAPER_ID ? (h(Fragment, null,
834
- h("ezp-input", { icon: "width", suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }),
835
- h("ezp-input", { icon: "height", suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null,
836
- h("ezp-select", { label: i18next.t('printer_selection.orientation'), icon: "orientation", placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.OrientationsSupported.map((orientation, index) => ({
819
+ : null, disabled: !(((_j = this.selectedPrinterConfig.PaperFormats) === null || _j === void 0 ? void 0 : _j.length) > 0) }), this.paperid == PAPER_ID ? (h(Fragment, null, h("ezp-input", { icon: "width", suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }), h("ezp-input", { icon: "height", suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null, h("ezp-select", { label: i18next.t('printer_selection.orientation'), icon: "orientation", placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.OrientationsSupported.map((orientation, index) => ({
837
820
  id: index + 1,
838
821
  title: i18next.t(`printer_selection.orientation_${orientation}`),
839
822
  meta: '',
840
823
  type: 'orientation',
841
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }),
842
- h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.map((option, index) => ({
824
+ })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.map((option, index) => ({
843
825
  id: index,
844
826
  title: option,
845
827
  meta: '',
846
828
  type: 'quality',
847
- })), preSelected: this.selectedPrinter.id &&
829
+ })), preSelected: this.selectedPrinter.id &&
848
830
  ((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
849
831
  ? this.selectedPrinterConfig.Default.Resolution
850
- : null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }),
851
- this.selectedPrinterConfig.Trays &&
852
- this.selectedPrinterConfig.Trays.length >= 1 &&
853
- this.selectedPrinterConfig.Trays[0] != null ? (h("ezp-select", { label: i18next.t('printer_selection.trays'), icon: "trays", placeholder: i18next.t('printer_selection.select_trays'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.Trays &&
832
+ : null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }), this.selectedPrinterConfig.Trays &&
833
+ this.selectedPrinterConfig.Trays.length >= 1 &&
834
+ this.selectedPrinterConfig.Trays[0] != null ? (h("ezp-select", { label: i18next.t('printer_selection.trays'), icon: "trays", placeholder: i18next.t('printer_selection.select_trays'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.Trays &&
854
835
  this.selectedPrinterConfig.Trays.length >= 1 &&
855
836
  this.selectedPrinterConfig.Trays.map((trays) => ({
856
- title: trays.Name,
857
- id: trays.Index,
858
- meta: '',
859
- type: 'tray',
837
+ title: trays.Name,
838
+ id: trays.Index,
839
+ meta: '',
840
+ type: 'tray',
860
841
  })), preSelected: this.selectedPrinter.id &&
861
842
  ((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
862
843
  ? this.selectedPrinterConfig.Default.Tray
863
- : null })) : null,
864
- h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })),
865
- h("ezp-stepper", { label: i18next.t('printer_selection.copies'), icon: "copies" })),
866
- h("div", { id: "footer" },
867
- h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }),
868
- h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing || this.pageRangeInvalid, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button), class: "action", id: "print" })),
869
- !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
870
- }
871
- static get is() { return "ezp-printer-selection"; }
872
- static get encapsulation() { return "shadow"; }
873
- static get originalStyleUrls() { return {
874
- "$": ["ezp-printer-selection.scss"]
875
- }; }
876
- static get styleUrls() { return {
877
- "$": ["ezp-printer-selection.css"]
878
- }; }
879
- static get properties() { return {
880
- "clientID": {
881
- "type": "string",
882
- "mutable": false,
883
- "complexType": {
884
- "original": "string",
885
- "resolved": "string",
886
- "references": {}
887
- },
888
- "required": false,
889
- "optional": false,
890
- "docs": {
891
- "tags": [],
892
- "text": "\nProperties"
893
- },
894
- "attribute": "client-i-d",
895
- "reflect": false
896
- },
897
- "redirectURI": {
898
- "type": "string",
899
- "mutable": false,
900
- "complexType": {
901
- "original": "string",
902
- "resolved": "string",
903
- "references": {}
904
- },
905
- "required": false,
906
- "optional": false,
907
- "docs": {
908
- "tags": [],
909
- "text": ""
910
- },
911
- "attribute": "redirect-u-r-i",
912
- "reflect": false
913
- },
914
- "filename": {
915
- "type": "string",
916
- "mutable": true,
917
- "complexType": {
918
- "original": "string",
919
- "resolved": "string",
920
- "references": {}
921
- },
922
- "required": false,
923
- "optional": false,
924
- "docs": {
925
- "tags": [],
926
- "text": ""
927
- },
928
- "attribute": "filename",
929
- "reflect": false
930
- },
931
- "fileurl": {
932
- "type": "string",
933
- "mutable": false,
934
- "complexType": {
935
- "original": "string",
936
- "resolved": "string",
937
- "references": {}
938
- },
939
- "required": false,
940
- "optional": false,
941
- "docs": {
942
- "tags": [],
943
- "text": ""
944
- },
945
- "attribute": "fileurl",
946
- "reflect": false
947
- },
948
- "filetype": {
949
- "type": "string",
950
- "mutable": true,
951
- "complexType": {
952
- "original": "string",
953
- "resolved": "string",
954
- "references": {}
955
- },
956
- "required": false,
957
- "optional": false,
958
- "docs": {
959
- "tags": [],
960
- "text": ""
961
- },
962
- "attribute": "filetype",
963
- "reflect": false
964
- },
965
- "fileid": {
966
- "type": "string",
967
- "mutable": true,
968
- "complexType": {
969
- "original": "string",
970
- "resolved": "string",
971
- "references": {}
972
- },
973
- "required": false,
974
- "optional": false,
975
- "docs": {
976
- "tags": [],
977
- "text": ""
978
- },
979
- "attribute": "fileid",
980
- "reflect": false
981
- },
982
- "files": {
983
- "type": "unknown",
984
- "mutable": false,
985
- "complexType": {
986
- "original": "File[]",
987
- "resolved": "File[]",
988
- "references": {
989
- "File": {
990
- "location": "global"
991
- }
992
- }
993
- },
994
- "required": false,
995
- "optional": false,
996
- "docs": {
997
- "tags": [],
998
- "text": ""
999
- }
1000
- },
1001
- "hidemenu": {
1002
- "type": "boolean",
1003
- "mutable": false,
1004
- "complexType": {
1005
- "original": "boolean",
1006
- "resolved": "boolean",
1007
- "references": {}
1008
- },
1009
- "required": false,
1010
- "optional": false,
1011
- "docs": {
1012
- "tags": [],
1013
- "text": ""
1014
- },
1015
- "attribute": "hidemenu",
1016
- "reflect": false,
1017
- "defaultValue": "false"
1018
- },
1019
- "hideheader": {
1020
- "type": "boolean",
1021
- "mutable": false,
1022
- "complexType": {
1023
- "original": "boolean",
1024
- "resolved": "boolean",
1025
- "references": {}
1026
- },
1027
- "required": false,
1028
- "optional": false,
1029
- "docs": {
1030
- "tags": [],
1031
- "text": ""
1032
- },
1033
- "attribute": "hideheader",
1034
- "reflect": false,
1035
- "defaultValue": "false"
1036
- },
1037
- "seamless": {
1038
- "type": "boolean",
1039
- "mutable": false,
1040
- "complexType": {
1041
- "original": "boolean",
1042
- "resolved": "boolean",
1043
- "references": {}
1044
- },
1045
- "required": false,
1046
- "optional": false,
1047
- "docs": {
1048
- "tags": [],
1049
- "text": ""
1050
- },
1051
- "attribute": "seamless",
1052
- "reflect": false
844
+ : null })) : null, h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })), h("ezp-stepper", { label: i18next.t('printer_selection.copies'), icon: "copies" })), h("div", { id: "footer" }, h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }), h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing || this.pageRangeInvalid, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button), class: "action", id: "print" })), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
845
+ }
846
+ static get is() { return "ezp-printer-selection"; }
847
+ static get encapsulation() { return "shadow"; }
848
+ static get originalStyleUrls() {
849
+ return {
850
+ "$": ["ezp-printer-selection.scss"]
851
+ };
852
+ }
853
+ static get styleUrls() {
854
+ return {
855
+ "$": ["ezp-printer-selection.css"]
856
+ };
857
+ }
858
+ static get properties() {
859
+ return {
860
+ "clientID": {
861
+ "type": "string",
862
+ "mutable": false,
863
+ "complexType": {
864
+ "original": "string",
865
+ "resolved": "string",
866
+ "references": {}
867
+ },
868
+ "required": false,
869
+ "optional": false,
870
+ "docs": {
871
+ "tags": [],
872
+ "text": "\nProperties"
873
+ },
874
+ "getter": false,
875
+ "setter": false,
876
+ "reflect": false,
877
+ "attribute": "client-i-d"
878
+ },
879
+ "redirectURI": {
880
+ "type": "string",
881
+ "mutable": false,
882
+ "complexType": {
883
+ "original": "string",
884
+ "resolved": "string",
885
+ "references": {}
886
+ },
887
+ "required": false,
888
+ "optional": false,
889
+ "docs": {
890
+ "tags": [],
891
+ "text": ""
892
+ },
893
+ "getter": false,
894
+ "setter": false,
895
+ "reflect": false,
896
+ "attribute": "redirect-u-r-i"
897
+ },
898
+ "filename": {
899
+ "type": "string",
900
+ "mutable": true,
901
+ "complexType": {
902
+ "original": "string",
903
+ "resolved": "string",
904
+ "references": {}
905
+ },
906
+ "required": false,
907
+ "optional": false,
908
+ "docs": {
909
+ "tags": [],
910
+ "text": ""
911
+ },
912
+ "getter": false,
913
+ "setter": false,
914
+ "reflect": false,
915
+ "attribute": "filename"
916
+ },
917
+ "fileurl": {
918
+ "type": "string",
919
+ "mutable": false,
920
+ "complexType": {
921
+ "original": "string",
922
+ "resolved": "string",
923
+ "references": {}
924
+ },
925
+ "required": false,
926
+ "optional": false,
927
+ "docs": {
928
+ "tags": [],
929
+ "text": ""
930
+ },
931
+ "getter": false,
932
+ "setter": false,
933
+ "reflect": false,
934
+ "attribute": "fileurl"
935
+ },
936
+ "filetype": {
937
+ "type": "string",
938
+ "mutable": true,
939
+ "complexType": {
940
+ "original": "string",
941
+ "resolved": "string",
942
+ "references": {}
943
+ },
944
+ "required": false,
945
+ "optional": false,
946
+ "docs": {
947
+ "tags": [],
948
+ "text": ""
949
+ },
950
+ "getter": false,
951
+ "setter": false,
952
+ "reflect": false,
953
+ "attribute": "filetype"
954
+ },
955
+ "fileid": {
956
+ "type": "string",
957
+ "mutable": true,
958
+ "complexType": {
959
+ "original": "string",
960
+ "resolved": "string",
961
+ "references": {}
962
+ },
963
+ "required": false,
964
+ "optional": false,
965
+ "docs": {
966
+ "tags": [],
967
+ "text": ""
968
+ },
969
+ "getter": false,
970
+ "setter": false,
971
+ "reflect": false,
972
+ "attribute": "fileid"
973
+ },
974
+ "files": {
975
+ "type": "unknown",
976
+ "mutable": false,
977
+ "complexType": {
978
+ "original": "File[]",
979
+ "resolved": "File[]",
980
+ "references": {
981
+ "File": {
982
+ "location": "global",
983
+ "id": "global::File"
984
+ }
985
+ }
986
+ },
987
+ "required": false,
988
+ "optional": false,
989
+ "docs": {
990
+ "tags": [],
991
+ "text": ""
992
+ },
993
+ "getter": false,
994
+ "setter": false
995
+ },
996
+ "hidemenu": {
997
+ "type": "boolean",
998
+ "mutable": false,
999
+ "complexType": {
1000
+ "original": "boolean",
1001
+ "resolved": "boolean",
1002
+ "references": {}
1003
+ },
1004
+ "required": false,
1005
+ "optional": false,
1006
+ "docs": {
1007
+ "tags": [],
1008
+ "text": ""
1009
+ },
1010
+ "getter": false,
1011
+ "setter": false,
1012
+ "reflect": false,
1013
+ "attribute": "hidemenu",
1014
+ "defaultValue": "false"
1015
+ },
1016
+ "hideheader": {
1017
+ "type": "boolean",
1018
+ "mutable": false,
1019
+ "complexType": {
1020
+ "original": "boolean",
1021
+ "resolved": "boolean",
1022
+ "references": {}
1023
+ },
1024
+ "required": false,
1025
+ "optional": false,
1026
+ "docs": {
1027
+ "tags": [],
1028
+ "text": ""
1029
+ },
1030
+ "getter": false,
1031
+ "setter": false,
1032
+ "reflect": false,
1033
+ "attribute": "hideheader",
1034
+ "defaultValue": "false"
1035
+ },
1036
+ "seamless": {
1037
+ "type": "boolean",
1038
+ "mutable": false,
1039
+ "complexType": {
1040
+ "original": "boolean",
1041
+ "resolved": "boolean",
1042
+ "references": {}
1043
+ },
1044
+ "required": false,
1045
+ "optional": false,
1046
+ "docs": {
1047
+ "tags": [],
1048
+ "text": ""
1049
+ },
1050
+ "getter": false,
1051
+ "setter": false,
1052
+ "reflect": false,
1053
+ "attribute": "seamless"
1054
+ }
1055
+ };
1056
+ }
1057
+ static get states() {
1058
+ return {
1059
+ "loading": {},
1060
+ "printProcessing": {},
1061
+ "pageRangeInvalid": {},
1062
+ "uploading": {},
1063
+ "preparingUpload": {},
1064
+ "printSuccess": {},
1065
+ "printFailed": {},
1066
+ "notSupported": {},
1067
+ "noPrinters": {},
1068
+ "hubDriverError": {},
1069
+ "userMenuOpen": {},
1070
+ "printStopped": {},
1071
+ "userName": {},
1072
+ "printers": {},
1073
+ "selectedPrinter": {},
1074
+ "printerConfig": {},
1075
+ "selectedPrinterConfig": {},
1076
+ "selectedProperties": {},
1077
+ "paperid": {},
1078
+ "currentFileIndex": {},
1079
+ "totalFiles": {},
1080
+ "failedFiles": {},
1081
+ "successfulFiles": {},
1082
+ "partialSuccess": {}
1083
+ };
1084
+ }
1085
+ static get events() {
1086
+ return [{
1087
+ "method": "printCancel",
1088
+ "name": "printCancel",
1089
+ "bubbles": true,
1090
+ "cancelable": true,
1091
+ "composed": true,
1092
+ "docs": {
1093
+ "tags": [],
1094
+ "text": "Description..."
1095
+ },
1096
+ "complexType": {
1097
+ "original": "MouseEvent",
1098
+ "resolved": "MouseEvent",
1099
+ "references": {
1100
+ "MouseEvent": {
1101
+ "location": "global",
1102
+ "id": "global::MouseEvent"
1103
+ }
1104
+ }
1105
+ }
1106
+ }, {
1107
+ "method": "printSubmit",
1108
+ "name": "printSubmit",
1109
+ "bubbles": true,
1110
+ "cancelable": true,
1111
+ "composed": true,
1112
+ "docs": {
1113
+ "tags": [],
1114
+ "text": "Description..."
1115
+ },
1116
+ "complexType": {
1117
+ "original": "MouseEvent",
1118
+ "resolved": "MouseEvent",
1119
+ "references": {
1120
+ "MouseEvent": {
1121
+ "location": "global",
1122
+ "id": "global::MouseEvent"
1123
+ }
1124
+ }
1125
+ }
1126
+ }, {
1127
+ "method": "logout",
1128
+ "name": "logout",
1129
+ "bubbles": true,
1130
+ "cancelable": true,
1131
+ "composed": true,
1132
+ "docs": {
1133
+ "tags": [],
1134
+ "text": ""
1135
+ },
1136
+ "complexType": {
1137
+ "original": "MouseEvent",
1138
+ "resolved": "MouseEvent",
1139
+ "references": {
1140
+ "MouseEvent": {
1141
+ "location": "global",
1142
+ "id": "global::MouseEvent"
1143
+ }
1144
+ }
1145
+ }
1146
+ }];
1147
+ }
1148
+ static get listeners() {
1149
+ return [{
1150
+ "name": "inputValueChanged",
1151
+ "method": "listenInputValueChanged",
1152
+ "target": undefined,
1153
+ "capture": false,
1154
+ "passive": false
1155
+ }, {
1156
+ "name": "selectSelection",
1157
+ "method": "listenSelectSelection",
1158
+ "target": undefined,
1159
+ "capture": false,
1160
+ "passive": false
1161
+ }, {
1162
+ "name": "stepperChanged",
1163
+ "method": "listenStepperChanged",
1164
+ "target": undefined,
1165
+ "capture": false,
1166
+ "passive": false
1167
+ }, {
1168
+ "name": "userMenuClosure",
1169
+ "method": "listenUserMenuClosure",
1170
+ "target": undefined,
1171
+ "capture": false,
1172
+ "passive": false
1173
+ }, {
1174
+ "name": "logoutEmitter",
1175
+ "method": "listenLogout",
1176
+ "target": undefined,
1177
+ "capture": false,
1178
+ "passive": false
1179
+ }, {
1180
+ "name": "statusCancel",
1181
+ "method": "listenStatusCancel",
1182
+ "target": undefined,
1183
+ "capture": false,
1184
+ "passive": false
1185
+ }, {
1186
+ "name": "statusClose",
1187
+ "method": "listenStatusClose",
1188
+ "target": undefined,
1189
+ "capture": false,
1190
+ "passive": false
1191
+ }, {
1192
+ "name": "statusRetry",
1193
+ "method": "listenStatusRetry",
1194
+ "target": undefined,
1195
+ "capture": false,
1196
+ "passive": false
1197
+ }];
1053
1198
  }
1054
- }; }
1055
- static get states() { return {
1056
- "loading": {},
1057
- "printProcessing": {},
1058
- "pageRangeInvalid": {},
1059
- "uploading": {},
1060
- "preparingUpload": {},
1061
- "printSuccess": {},
1062
- "printFailed": {},
1063
- "notSupported": {},
1064
- "noPrinters": {},
1065
- "hubDriverError": {},
1066
- "userMenuOpen": {},
1067
- "printStopped": {},
1068
- "userName": {},
1069
- "printers": {},
1070
- "selectedPrinter": {},
1071
- "printerConfig": {},
1072
- "selectedPrinterConfig": {},
1073
- "selectedProperties": {},
1074
- "paperid": {},
1075
- "currentFileIndex": {},
1076
- "totalFiles": {},
1077
- "failedFiles": {},
1078
- "successfulFiles": {},
1079
- "partialSuccess": {}
1080
- }; }
1081
- static get events() { return [{
1082
- "method": "printCancel",
1083
- "name": "printCancel",
1084
- "bubbles": true,
1085
- "cancelable": true,
1086
- "composed": true,
1087
- "docs": {
1088
- "tags": [],
1089
- "text": "Description..."
1090
- },
1091
- "complexType": {
1092
- "original": "MouseEvent",
1093
- "resolved": "MouseEvent",
1094
- "references": {
1095
- "MouseEvent": {
1096
- "location": "global"
1097
- }
1098
- }
1099
- }
1100
- }, {
1101
- "method": "printSubmit",
1102
- "name": "printSubmit",
1103
- "bubbles": true,
1104
- "cancelable": true,
1105
- "composed": true,
1106
- "docs": {
1107
- "tags": [],
1108
- "text": "Description..."
1109
- },
1110
- "complexType": {
1111
- "original": "MouseEvent",
1112
- "resolved": "MouseEvent",
1113
- "references": {
1114
- "MouseEvent": {
1115
- "location": "global"
1116
- }
1117
- }
1118
- }
1119
- }, {
1120
- "method": "logout",
1121
- "name": "logout",
1122
- "bubbles": true,
1123
- "cancelable": true,
1124
- "composed": true,
1125
- "docs": {
1126
- "tags": [],
1127
- "text": ""
1128
- },
1129
- "complexType": {
1130
- "original": "MouseEvent",
1131
- "resolved": "MouseEvent",
1132
- "references": {
1133
- "MouseEvent": {
1134
- "location": "global"
1135
- }
1136
- }
1137
- }
1138
- }]; }
1139
- static get listeners() { return [{
1140
- "name": "inputValueChanged",
1141
- "method": "listenInputValueChanged",
1142
- "target": undefined,
1143
- "capture": false,
1144
- "passive": false
1145
- }, {
1146
- "name": "selectSelection",
1147
- "method": "listenSelectSelection",
1148
- "target": undefined,
1149
- "capture": false,
1150
- "passive": false
1151
- }, {
1152
- "name": "stepperChanged",
1153
- "method": "listenStepperChanged",
1154
- "target": undefined,
1155
- "capture": false,
1156
- "passive": false
1157
- }, {
1158
- "name": "userMenuClosure",
1159
- "method": "listenUserMenuClosure",
1160
- "target": undefined,
1161
- "capture": false,
1162
- "passive": false
1163
- }, {
1164
- "name": "logoutEmitter",
1165
- "method": "listenLogout",
1166
- "target": undefined,
1167
- "capture": false,
1168
- "passive": false
1169
- }, {
1170
- "name": "statusCancel",
1171
- "method": "listenStatusCancel",
1172
- "target": undefined,
1173
- "capture": false,
1174
- "passive": false
1175
- }, {
1176
- "name": "statusClose",
1177
- "method": "listenStatusClose",
1178
- "target": undefined,
1179
- "capture": false,
1180
- "passive": false
1181
- }, {
1182
- "name": "statusRetry",
1183
- "method": "listenStatusRetry",
1184
- "target": undefined,
1185
- "capture": false,
1186
- "passive": false
1187
- }]; }
1188
1199
  }