@cling-se/widget 0.17.0 → 1.0.0-beta.2

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 (232) hide show
  1. package/dist/AddClientCallout-e8d19R3f.js +101 -0
  2. package/dist/AnswerModal-BGvB8IVV.js +3291 -0
  3. package/dist/AttachmentItem-CkHbAm4l.js +171 -0
  4. package/dist/BaseUpload-BiJBcWRu.js +2472 -0
  5. package/dist/BlockMedia-CW5wgipC.js +103 -0
  6. package/dist/CCallout-Cy2eeIYd.js +104 -0
  7. package/dist/{CCurrencyDropdown-C2rXt2cJ.js → CCurrencyDropdown-DE_3CTjm.js} +91 -53
  8. package/dist/CDropdownItem-Dmq5gYzA.js +751 -0
  9. package/dist/CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js +292 -0
  10. package/dist/{CPhoneFormat-C8VPsiK6.js → CPhoneFormat-BS2nP9kc.js} +13 -21
  11. package/dist/CPhoneInput-Bf6329PO.js +207 -0
  12. package/dist/CPriceInput-d1yjuMQr.js +140 -0
  13. package/dist/CSelect-DgnT07Hk.js +98 -0
  14. package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-Ckl--dyv.js +51 -0
  15. package/dist/ClientAutocomplete-9JzGcO9O.js +532 -0
  16. package/dist/ClientModal-BzWQtWSZ.js +1181 -0
  17. package/dist/ColorPicker-BvoFN8nu.js +1408 -0
  18. package/dist/CompanyModal-Bp4V_az9.js +250 -0
  19. package/dist/ContentWrapper-CuH6xKmo.js +265 -0
  20. package/dist/CoverBlockSettings-BA5L0Zee.js +861 -0
  21. package/dist/DocAnswer-BcNA_KEg.js +33 -0
  22. package/dist/DocDetails-CStEwWnU.js +448 -0
  23. package/dist/DocForm-BOoILf5E.js +6748 -0
  24. package/dist/DocFormSend-CQIf-HJY.js +171 -0
  25. package/dist/DocLinks-BRX5QzNe.js +36 -0
  26. package/dist/DocModalBase-D72yWj-x.js +29 -0
  27. package/dist/DocPrint-BI1LXUPE.js +399 -0
  28. package/dist/DocReceipt-DaZ4V76p.js +341 -0
  29. package/dist/DocSendReminder-DKGZlo7s.js +181 -0
  30. package/dist/DocTextEditor-Dm-cTZpA.js +19413 -0
  31. package/dist/DocTimeline-DCwofzuk.js +537 -0
  32. package/dist/DocumentClient-vJdxCB53.js +90 -0
  33. package/dist/DocumentLayout-CKSi42ev.js +1368 -0
  34. package/dist/DocumentLogotype-DbQlvQ-y.js +162 -0
  35. package/dist/DocumentVoided-CRX2WxWO.js +33 -0
  36. package/dist/EmbedInput-B-oeC4Wy.js +157 -0
  37. package/dist/EmbedSettings-B9Yka2yB.js +103 -0
  38. package/dist/ErrorCallout-B_ygH33E.js +34 -0
  39. package/dist/FilePreviewModal-Bf3ELTow.js +202 -0
  40. package/dist/Flag-BwTgCNHO.js +41 -0
  41. package/dist/HeaderSettings-DvC7nlyY.js +720 -0
  42. package/dist/ImageSelectModal-D3sP3lhR.js +119 -0
  43. package/dist/ImageUploadWrapper-RWNa-yIq.js +1585 -0
  44. package/dist/Index-0_3ULrWX.js +126 -0
  45. package/dist/Index-4NPe0sfX.js +629 -0
  46. package/dist/Index-B1uA0FF6.js +4 -0
  47. package/dist/Index-BBkCYm2q.js +201 -0
  48. package/dist/{Index-LzN6dktq.js → Index-BBwvo7S9.js} +10 -18
  49. package/dist/Index-BEMlsYwJ.js +68 -0
  50. package/dist/Index-BRBhJ6kz.js +21 -0
  51. package/dist/{Index-BPUYpfLJ.js → Index-BTFmHjUt.js} +47 -60
  52. package/dist/Index-BcUNnxLC.js +1098 -0
  53. package/dist/Index-Bo6ExBUL.js +93 -0
  54. package/dist/Index-BvMPCgdH.js +102 -0
  55. package/dist/Index-Bx5TOI9k.js +74 -0
  56. package/dist/Index-C7GZS8EI.js +16 -0
  57. package/dist/Index-CNWhm07R.js +25 -0
  58. package/dist/{Index-BUK-1yVR.js → Index-CQpznMKV.js} +9 -17
  59. package/dist/Index-CRzsnIij.js +159 -0
  60. package/dist/Index-CeSG1C41.js +140 -0
  61. package/dist/Index-CjfjdZj5.js +52 -0
  62. package/dist/Index-CskKmZpd.js +363 -0
  63. package/dist/Index-D5qwbCo1.js +28 -0
  64. package/dist/Index-D8Ae1Txt.js +228 -0
  65. package/dist/Index-DE8aenDB.js +3452 -0
  66. package/dist/Index-DI5EB5Rt.js +39 -0
  67. package/dist/Index-DaV57YPP.js +163 -0
  68. package/dist/Index-DbwkmoyM.js +38 -0
  69. package/dist/Index-Df9skok6.js +70 -0
  70. package/dist/{Index-BHJGfHm9.js → Index-DfLLA0ij.js} +313 -206
  71. package/dist/Index-Dw1CO5F9.js +76 -0
  72. package/dist/Index-PZXyOoVb.js +87 -0
  73. package/dist/{Index-BioOegOO.js → Index-ZUnH-BHj.js} +10 -18
  74. package/dist/Index-cjKGSiDi.js +136 -0
  75. package/dist/Index-m-goRuKD.js +49 -0
  76. package/dist/Index-rGeWbLcB.js +47 -0
  77. package/dist/Index-vrljNp6G.js +28 -0
  78. package/dist/Index.vue_vue_type_script_lang-aeVuChGF.js +671 -0
  79. package/dist/InputToggleRow-v6qAWPg6.js +99 -0
  80. package/dist/ManualPopover-BONBJIUA.js +57 -0
  81. package/dist/MediaWrapper-CXb2UGd9.js +18 -0
  82. package/dist/{NotBindingText-CM3FN0A6.js → NotBindingText-BqESO13N.js} +13 -17
  83. package/dist/PackageGroup-AIysVmyh.js +1058 -0
  84. package/dist/PdfTerms-BlhHdTu3.js +34 -0
  85. package/dist/PdfViewer-DwZ1rwlN.js +392 -0
  86. package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6NNUTz0.js +17 -0
  87. package/dist/PriceHeader-C4XhnoA3.js +488 -0
  88. package/dist/SearchApi-B7lXgUY6.js +137 -0
  89. package/dist/SendForm-BcD0xSvB.js +7031 -0
  90. package/dist/Setup-C2qaYDei.js +47 -0
  91. package/dist/{SmartList-DhhjSWLO.js → SmartList-DqG7Q5t7.js} +16 -24
  92. package/dist/Sortable.vue_vue_type_script_setup_true_lang-CzMbr8AX.js +1303 -0
  93. package/dist/{TermsSettings-BEQwmkFH.js → TermsSettings-BOCONyM4.js} +169 -56
  94. package/dist/ThemeColorRow-sjGdMzGN.js +108 -0
  95. package/dist/ToggleBinding-7oq_oXPt.js +44 -0
  96. package/dist/UploadModal-C_X2NjVY.js +134 -0
  97. package/dist/VideoPlayerInput-BsUcmpl4.js +135 -0
  98. package/dist/VideoPlayerSettings-BXMmxaZQ.js +78 -0
  99. package/dist/VideoSelectModal-CW0OweCw.js +217 -0
  100. package/dist/{anime.es-BrPTThYb.js → anime.es-gdcpA-eY.js} +1 -2
  101. package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
  102. package/dist/{debounce-D0hKNU85.js → debounce-DNl99Gyo.js} +10 -10
  103. package/dist/dom-CkTGWrfu.js +69 -0
  104. package/dist/{focusDrawerMixin-C_aTLmK0.js → focusDrawerMixin-BwcErMDY.js} +1 -1
  105. package/dist/{formDrawerState-Da4mcbab.js → formDrawerState-DaurePnd.js} +2 -2
  106. package/dist/helpers-CPW--XIz.js +44 -0
  107. package/dist/index-BjiGCJPI.js +149 -0
  108. package/dist/index-CFNv6OvX.js +188 -0
  109. package/dist/index-Cx71On5Z.js +508 -0
  110. package/dist/index-DKMxIBz_.js +270 -0
  111. package/dist/index-DKf5SGLD.js +125 -0
  112. package/dist/index-E32WgUp9.js +3525 -0
  113. package/dist/index-kp-GC5I0.js +513 -0
  114. package/dist/index.es.js +2 -5
  115. package/dist/index.umd.js +285 -1485
  116. package/dist/{main-BgzLHIoo.js → main-Cb-nyil1.js} +41414 -42507
  117. package/dist/mapFormMixin-D3BihYWW.js +1544 -0
  118. package/dist/omit--YYr41Xp.js +31 -0
  119. package/dist/{publicSenderState-DB4BHByV.js → publicSenderState-CdRW_Wwp.js} +4 -4
  120. package/dist/splitpanes-D-ThFkeR.js +342 -0
  121. package/dist/style.css +1 -4
  122. package/dist/template-BvaNnq-g.js +1493 -0
  123. package/dist/{throttle-DT2UVOqm.js → throttle-D-bUGaVh.js} +2 -2
  124. package/dist/tippy.esm-BmKNqohP.js +1994 -0
  125. package/dist/useTermsModal-Dhf6_eYb.js +87 -0
  126. package/dist/{utils-nos8CB1L.js → utils-CBPcYdLv.js} +8 -11
  127. package/dist/validation-DOcUOoMe.js +40 -0
  128. package/package.json +18 -21
  129. package/dist/AddClientCallout-BJzBdba1.js +0 -48
  130. package/dist/AnswerModal-frHq1g4s.js +0 -3874
  131. package/dist/AttachmentItem-BaN0OrEV.js +0 -85
  132. package/dist/BaseDatePicker-B-AfdrSb.js +0 -3187
  133. package/dist/BaseUpload-CY3lTcte.js +0 -1977
  134. package/dist/BlockMedia-Bb5wQIDg.js +0 -76
  135. package/dist/CCallout-5quI6yyk.js +0 -58
  136. package/dist/CDropdownItem-CaoSQX6X.js +0 -640
  137. package/dist/CFormField-Dd2Y71JG.js +0 -240
  138. package/dist/CPhoneInput-BU1t6eo_.js +0 -138
  139. package/dist/CPriceInput-pv2aIVkH.js +0 -116
  140. package/dist/CSelect-CrM45B7V.js +0 -91
  141. package/dist/CSkeleton-BkvONMqL.js +0 -55
  142. package/dist/ClientAutocomplete-BRXIKQSk.js +0 -438
  143. package/dist/ClientModal-CvHAptV2.js +0 -666
  144. package/dist/ColorPicker-RgoXRrud.js +0 -2879
  145. package/dist/CompanyModal-OL4bD9Gk.js +0 -147
  146. package/dist/ContentWrapper-8HduCnR4.js +0 -190
  147. package/dist/CoverBlockSettings-DUv8AcdX.js +0 -659
  148. package/dist/DocAnswer-DiyFfpT2.js +0 -36
  149. package/dist/DocDetails-BxNRfBnK.js +0 -263
  150. package/dist/DocForm-MGp-o0pu.js +0 -5017
  151. package/dist/DocFormSend-q_QuVCqh.js +0 -146
  152. package/dist/DocLinks-DGDdp30U.js +0 -38
  153. package/dist/DocModalBase-qG4RqwBn.js +0 -28
  154. package/dist/DocPrint-Cln3kt0g.js +0 -240
  155. package/dist/DocReceipt-nbsJ-ukZ.js +0 -217
  156. package/dist/DocSendReminder-B3qdqduf.js +0 -140
  157. package/dist/DocTextEditor-CQDnjnRY.js +0 -17193
  158. package/dist/DocTimeline-CgKHoDcG.js +0 -485
  159. package/dist/DocumentClient-UZlnIlz5.js +0 -136
  160. package/dist/DocumentLayout-Dvr4zgyF.js +0 -4880
  161. package/dist/DocumentLogotype-mAVgMRHr.js +0 -92
  162. package/dist/DocumentVoided-BXYNrf_6.js +0 -25
  163. package/dist/EmbedInput-YRUrw3c6.js +0 -117
  164. package/dist/EmbedSettings-DvRreF7H.js +0 -74
  165. package/dist/ErrorCallout-DVknpLVY.js +0 -27
  166. package/dist/FilePreviewModal-DC56FaGy.js +0 -81
  167. package/dist/Flag-D5iZLESg.js +0 -46
  168. package/dist/HeaderSettings-DXZnZL7A.js +0 -440
  169. package/dist/ImageSelectModal-Bu4_xZga.js +0 -86
  170. package/dist/ImageUploadWrapper-CtZhkAm1.js +0 -1604
  171. package/dist/Index-B1dJO6Bk.js +0 -54
  172. package/dist/Index-B3pz1coY.js +0 -150
  173. package/dist/Index-BHgW8EHW.js +0 -2446
  174. package/dist/Index-BNucs2O-.js +0 -154
  175. package/dist/Index-BW-EtZ1z.js +0 -55
  176. package/dist/Index-BjKACpun.js +0 -66
  177. package/dist/Index-C94BL4uU.js +0 -294
  178. package/dist/Index-CB57haU8.js +0 -58
  179. package/dist/Index-CP17iXT6.js +0 -25
  180. package/dist/Index-CUSbvjoD.js +0 -62
  181. package/dist/Index-CVnD6jo5.js +0 -25
  182. package/dist/Index-Ci5zdPeT.js +0 -28
  183. package/dist/Index-CikqSMjb.js +0 -41
  184. package/dist/Index-CxO4tJ3U.js +0 -26
  185. package/dist/Index-D4J4BpHd.js +0 -230
  186. package/dist/Index-DAQQQlut.js +0 -754
  187. package/dist/Index-DNxSR72J.js +0 -73
  188. package/dist/Index-DPuKRwmu.js +0 -41
  189. package/dist/Index-DSy8QG8T.js +0 -32
  190. package/dist/Index-DX6_D-J-.js +0 -77
  191. package/dist/Index-Dk0KaIKg.js +0 -643
  192. package/dist/Index-Hkzoh9QR.js +0 -24
  193. package/dist/Index-KsHJxWAa.js +0 -94
  194. package/dist/Index-TtItTuv6.js +0 -33
  195. package/dist/Index-YAD39Qvg.js +0 -146
  196. package/dist/Index-eh909lAz.js +0 -107
  197. package/dist/Index-otowKI_C.js +0 -56
  198. package/dist/Index-t_oVV8Rc.js +0 -84
  199. package/dist/Index-vG96oEXZ.js +0 -144
  200. package/dist/InputToggleRow-CcqJDguN.js +0 -57
  201. package/dist/ManualPopover-BE2IN-XU.js +0 -60
  202. package/dist/MediaWrapper-lnGUFiyc.js +0 -23
  203. package/dist/PackageGroup-BsmxOMLW.js +0 -704
  204. package/dist/PdfTerms-BgYwZoAZ.js +0 -31
  205. package/dist/PdfViewer-C0lDpjte.js +0 -383
  206. package/dist/PlainHtml-5YwYVj1v.js +0 -27
  207. package/dist/PriceHeader-CxqhpGS-.js +0 -338
  208. package/dist/SearchApi-BndaIbri.js +0 -161
  209. package/dist/SendForm-D7U9fG-5.js +0 -1023
  210. package/dist/Setup-CmAK2_ZT.js +0 -50
  211. package/dist/ThemeColorRow-BlnhzebY.js +0 -69
  212. package/dist/ToggleBinding-t_58JFya.js +0 -42
  213. package/dist/UploadModal-T-WpYNsN.js +0 -95
  214. package/dist/VideoPlayerInput-DKHKjMgX.js +0 -97
  215. package/dist/VideoPlayerSettings-DDMlUvSt.js +0 -61
  216. package/dist/VideoSelectModal-B9bbP0dd.js +0 -104
  217. package/dist/answerDocumentMixin-DXI_E5Kx.js +0 -51
  218. package/dist/dom-CWsqMElk.js +0 -71
  219. package/dist/formValidationMixin-WZ2lGndu.js +0 -49
  220. package/dist/index-B2l57ilt.js +0 -102
  221. package/dist/index-COKDjmM2.js +0 -167
  222. package/dist/index-HtKGcIng.js +0 -2700
  223. package/dist/index-LQ7NztTt.js +0 -81
  224. package/dist/index-fx5gR8fM.js +0 -351
  225. package/dist/index-zXXJrTvv.js +0 -492
  226. package/dist/mapFormMixin-CQgSN7dv.js +0 -3028
  227. package/dist/omit-ScS7B6c5.js +0 -31
  228. package/dist/simplebar.min-B0cB_p8g.js +0 -71
  229. package/dist/splitpanes-BHUVsCZF.js +0 -382
  230. package/dist/tippy.esm-CR89mtdY.js +0 -1805
  231. package/dist/vuedraggable.umd-CkXXkt1b.js +0 -3161
  232. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -0,0 +1,171 @@
1
+ import { S as f } from "./SendForm-BcD0xSvB.js";
2
+ import { _ as h, r as v, m as w, a as y, g as S, C as p, b as c, o as a, c as D, w as u, d as l, e as _, f as i } from "./main-Cb-nyil1.js";
3
+ const s = v({
4
+ canEdit: !1,
5
+ isForm: !0,
6
+ setFormValue: null,
7
+ removeFormValue: null
8
+ }), F = {
9
+ name: "DocFormSend",
10
+ components: {
11
+ SendForm: f
12
+ },
13
+ provide: () => ({ viewSettings: s, allowSenderSign: !1 }),
14
+ // TODO maybe not needed
15
+ props: {
16
+ // consumer options
17
+ showName: {
18
+ type: Boolean,
19
+ default: !0
20
+ },
21
+ showSave: {
22
+ type: Boolean,
23
+ default: !0
24
+ },
25
+ showSchedule: {
26
+ type: Boolean,
27
+ default: !0
28
+ },
29
+ allowManualDelivery: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ allowEditClients: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ contentSlot: {
38
+ type: String,
39
+ default: null
40
+ },
41
+ footerSlot: {
42
+ type: String,
43
+ default: null
44
+ },
45
+ // widget internals
46
+ setFormValue: {
47
+ type: Function,
48
+ default: null
49
+ },
50
+ removeFormValue: {
51
+ type: Function,
52
+ default: null
53
+ },
54
+ closeFunc: {
55
+ type: Function,
56
+ default: null
57
+ },
58
+ beforeSave: {
59
+ type: Function,
60
+ default: null
61
+ },
62
+ beforeSend: {
63
+ type: Function,
64
+ default: null
65
+ }
66
+ },
67
+ data() {
68
+ return {
69
+ document: null
70
+ };
71
+ },
72
+ computed: {
73
+ ...w({
74
+ company: "application/company",
75
+ can: "application/can",
76
+ rawDoc: "forms/document",
77
+ isPosting: "documents2/isPosting"
78
+ })
79
+ },
80
+ watch: {
81
+ rawDoc: {
82
+ immediate: !0,
83
+ handler() {
84
+ this.initDoc();
85
+ }
86
+ }
87
+ },
88
+ async created() {
89
+ this.setDocValue && (s.setFormValue = this.setDocValue), this.removeDocValue && (s.removeFormValue = this.removeDocValue);
90
+ },
91
+ methods: {
92
+ ...y({
93
+ saveDocument: S.SAVE_DYNDOC_FORM
94
+ // loadCompanyUser: global.LOAD_COMPANY_USER,
95
+ }),
96
+ async initDoc() {
97
+ if (!this.rawDoc) throw new Error("Missing initiated form document");
98
+ this.document = new p({
99
+ data: this.rawDoc,
100
+ can: this.can,
101
+ getters: this.$store.getters,
102
+ updateSender: !0
103
+ });
104
+ },
105
+ setDocValue({ key: t, value: o }) {
106
+ return this.setFormValue({ key: t, value: o });
107
+ },
108
+ removeDocValue(t) {
109
+ return this.removeFormValue(t);
110
+ },
111
+ async onSaveDocument({ doSend: t = !1 } = {}) {
112
+ let o = !1;
113
+ typeof this.beforeSave == "function" && (o = await this.beforeSave(this.document)), t && typeof this.beforeSend == "function" && (o = await this.beforeSend(this.document)), !(o || !await this.saveDocument({ doSend: t })) && this.close();
114
+ },
115
+ close() {
116
+ this.closeFunc();
117
+ }
118
+ }
119
+ }, V = ["innerHTML"], g = ["innerHTML"], M = {
120
+ key: 1,
121
+ class: "grid h-full w-full place-items-center"
122
+ };
123
+ function C(t, o, e, b, r, n) {
124
+ const m = c("SendForm"), d = c("CIcon");
125
+ return r.document ? (a(), D(m, {
126
+ key: 0,
127
+ _document: r.document,
128
+ _value: {
129
+ expiresAt: "data.expiresAt",
130
+ personalMessage: "data.personalMessage",
131
+ defaultAnswerMethod: "data.defaultAnswerMethod",
132
+ clients: "clients",
133
+ reminders: "data.reminders",
134
+ name: "data.name"
135
+ },
136
+ "show-name": e.showName,
137
+ "show-save": e.showSave,
138
+ "show-schedule": e.showSchedule,
139
+ "allow-edit-clients": e.allowEditClients,
140
+ "allow-manual-delivery": e.allowManualDelivery,
141
+ "set-form-value": n.setDocValue,
142
+ "remove-form-value": n.removeDocValue,
143
+ "on-save-document": n.onSaveDocument,
144
+ "use-scroll": "",
145
+ class: "h-full w-full"
146
+ }, {
147
+ content: u(() => [
148
+ e.contentSlot ? (a(), l("div", {
149
+ key: 0,
150
+ innerHTML: e.contentSlot
151
+ }, null, 8, V)) : i("", !0)
152
+ ]),
153
+ footer: u(() => [
154
+ e.footerSlot ? (a(), l("div", {
155
+ key: 0,
156
+ innerHTML: e.footerSlot
157
+ }, null, 8, g)) : i("", !0)
158
+ ]),
159
+ _: 1
160
+ }, 8, ["_document", "show-name", "show-save", "show-schedule", "allow-edit-clients", "allow-manual-delivery", "set-form-value", "remove-form-value", "on-save-document"])) : (a(), l("div", M, [
161
+ _(d, {
162
+ type: "loader",
163
+ class: "animate-spin text-gray-400",
164
+ size: 28
165
+ })
166
+ ]));
167
+ }
168
+ const x = /* @__PURE__ */ h(F, [["render", C]]);
169
+ export {
170
+ x as default
171
+ };
@@ -0,0 +1,36 @@
1
+ import { C as s } from "./index-CFNv6OvX.js";
2
+ import { _ as t, b as c, o as l, d as i, e as r } from "./main-Cb-nyil1.js";
3
+ const a = {
4
+ name: "DocLinks",
5
+ components: {
6
+ ClientLinks: s
7
+ },
8
+ props: {
9
+ document: {
10
+ type: Object,
11
+ required: !0
12
+ },
13
+ closeFunc: {
14
+ type: Function,
15
+ default: null
16
+ }
17
+ },
18
+ methods: {
19
+ close() {
20
+ this.closeFunc && this.closeFunc();
21
+ }
22
+ }
23
+ }, u = { class: "h-full w-full overflow-auto" };
24
+ function d(m, p, e, _, f, o) {
25
+ const n = c("ClientLinks");
26
+ return l(), i("div", u, [
27
+ r(n, {
28
+ id: e.document.id,
29
+ onClose: o.close
30
+ }, null, 8, ["id", "onClose"])
31
+ ]);
32
+ }
33
+ const h = /* @__PURE__ */ t(a, [["render", d]]);
34
+ export {
35
+ h as default
36
+ };
@@ -0,0 +1,29 @@
1
+ import { _ as n, b as c, o as s, d as l, c as r, f as d, S as p } from "./main-Cb-nyil1.js";
2
+ const i = {
3
+ name: "DocModalBase",
4
+ components: {},
5
+ emits: ["close"],
6
+ props: {
7
+ showClose: {
8
+ type: Boolean,
9
+ default: !1
10
+ }
11
+ }
12
+ }, m = { class: "doc-modal-base" };
13
+ function u(e, o, t, _, f, B) {
14
+ const a = c("CButton");
15
+ return s(), l("div", m, [
16
+ t.showClose ? (s(), r(a, {
17
+ key: 0,
18
+ class: "absolute right-4 top-4 text-gray-500",
19
+ circle: "",
20
+ icon: "x",
21
+ onClick: o[0] || (o[0] = (C) => e.$emit("close"))
22
+ })) : d("", !0),
23
+ p(e.$slots, "default", {}, void 0, !0)
24
+ ]);
25
+ }
26
+ const k = /* @__PURE__ */ n(i, [["render", u], ["__scopeId", "data-v-722dcbc7"]]);
27
+ export {
28
+ k as D
29
+ };
@@ -0,0 +1,399 @@
1
+ import { _ as C, a8 as I, p as D, a5 as P, aw as _, ax as k, b as h, a3 as V, o as p, d as m, s as o, v as l, n as y, e as r, E as B, f as w, B as b, w as x, ay as E } from "./main-Cb-nyil1.js";
2
+ const z = {
3
+ i18nOptions: {
4
+ namespaces: "documentPrint",
5
+ messages: {
6
+ en: {
7
+ title: "Print options",
8
+ appendAttachments: "Append attachments",
9
+ appendAttachmentsSub: "Append attachments",
10
+ hideDocumentAttachmentBlocks: "Hide document attachment blocks",
11
+ hideDocumentAttachmentBlocksTooltip: "Hide blocks with the type of attachments.",
12
+ showVerification: "Include verification",
13
+ showVerificationSub: "Signature verification.",
14
+ showLast4ssn: "Include the last 4 digits of the personal identification number from the BankID signature.",
15
+ showEvents: "Show events",
16
+ buttonText: "Download PDF",
17
+ preparingPdf: "Preparing PDF...",
18
+ preparingPdfDone: "PDF is complete",
19
+ preparingPdfError: "Could not create PDF. Try again."
20
+ },
21
+ sv: {
22
+ title: "Utskriftsinställningar",
23
+ appendAttachments: "Bifoga bilagor",
24
+ appendAttachmentsSub: "Inkludera bilagor i slutet av PDF:en.",
25
+ hideDocumentAttachmentBlocks: "Göm dokumentblock som är bilagor",
26
+ hideDocumentAttachmentBlocksTooltip: "Dölj blocken av typen bilagor.",
27
+ showVerification: "Inkludera verifikat",
28
+ showVerificationSub: "Signaturverifikat.",
29
+ showLast4ssn: "Inkludera de sista 4-siffrorna i personnummret från BankID-signaturen",
30
+ showEvents: "Visa händelser",
31
+ buttonText: "Ladda ner PDF",
32
+ preparingPdf: "Förbereder PDF...",
33
+ preparingPdfDone: "PDF är redo",
34
+ preparingPdfError: "Kunde inte skapa PDF. Pröva igen."
35
+ }
36
+ }
37
+ },
38
+ name: "DocumentPrint",
39
+ components: {
40
+ CCheckbox: I
41
+ },
42
+ emits: ["close"],
43
+ props: {
44
+ document: {
45
+ type: Object,
46
+ required: !0
47
+ },
48
+ isSuperUser: {
49
+ type: Boolean,
50
+ required: !1
51
+ }
52
+ },
53
+ data() {
54
+ return {
55
+ options: {
56
+ appendAttachments: !0,
57
+ hideDocumentAttachmentBlocks: !1,
58
+ showVerification: !0,
59
+ showEvents: !0,
60
+ showLast4ssn: !0,
61
+ forceDoCreatePdf: !1,
62
+ // Only for superuser
63
+ compressImages: !1,
64
+ // Only for superuser
65
+ debugPage: !1,
66
+ // Only for superuser
67
+ extraTimeout: 0
68
+ // Only for superuser
69
+ },
70
+ showMoreOptions: !1,
71
+ omitAttachmentBlockTooltip: {
72
+ content: '<svg style="margin-top: 2px;" width="193" height="122" viewBox="0 0 193 122" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="193" height="122" rx="5" fill="white"/><text fill="black" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="11" font-weight="bold" letter-spacing="0em"><tspan x="13" y="25.5">' + this.$t("_common:attachment_plural").capitalize() + `</tspan></text><path d="M14 33H25.2941L30 38.225V52H14V33Z" fill="#FFC4C4"/><path opacity="0.34" d="M14 60H25.5L30 64.5V79H14V60Z" fill="#42A4FF"/><text fill="black" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="11" letter-spacing="0em"><tspan x="41" y="46.5">${this.$t("_common:file").capitalize()} #1</tspan></text><text fill="black" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="11" letter-spacing="0em"><tspan x="41" y="73.5">${this.$t("_common:file").capitalize()} #2</tspan></text><rect x="13" y="87" width="61" height="12" fill="#E2E2E2"/><rect x="13" y="103" width="168" height="6" fill="#E2E2E2"/><rect x="13" y="112" width="151" height="6" fill="#E2E2E2"/><rect x="13" y="3" width="97" height="6" fill="#E2E2E2"/><rect x="14" y="47" width="16" height="5" fill="#FF1515"/><rect x="14" y="74" width="16" height="5" fill="#42A4FF"/></svg><div style="max-width: 193px; padding: 2px 0 8px 0;">
73
+ ${this.$t("hideDocumentAttachmentBlocksTooltip")}
74
+ </div>`,
75
+ placement: "left",
76
+ html: !0
77
+ }
78
+ };
79
+ },
80
+ computed: {
81
+ extraTimeout: {
82
+ get() {
83
+ return this.options.extraTimeout || null;
84
+ },
85
+ set(s) {
86
+ s ? this.options.extraTimeout = parseInt(s, 10) : this.options.extraTimeout = 0;
87
+ }
88
+ },
89
+ allowVerification() {
90
+ return this.document && this.document.allowVerification;
91
+ },
92
+ showAdminOptions() {
93
+ return D.showAdminSettings || this.isSuperUser;
94
+ },
95
+ hasBankIdSignatures() {
96
+ var i;
97
+ const { clients: s, senderClient: e } = this.document;
98
+ return e != null && e.socialNo && ((i = e.answerMethod) == null ? void 0 : i.accept) === "bankId" ? !0 : s.some(
99
+ (u) => {
100
+ var t;
101
+ return u.socialNo && ((t = u.answerMethod) == null ? void 0 : t.accept) === "bankId";
102
+ }
103
+ );
104
+ }
105
+ },
106
+ created() {
107
+ Object.assign(
108
+ this.options,
109
+ JSON.parse(P.getItem("print-settings"))
110
+ ), this.allowVerification || (this.options.showVerification = !1), this.$watch("options", {
111
+ deep: !0,
112
+ handler(s) {
113
+ P.setItem("print-settings", JSON.stringify(s)), !s.showVerification && !s.showEvents && (this.options.showEvents = !0), !s.showVerification && !s.showLast4ssn && (this.options.showLast4ssn = !0);
114
+ }
115
+ });
116
+ },
117
+ methods: {
118
+ async generatePdf() {
119
+ if (!this.document || !this.document.publicId) return;
120
+ const s = this.$t("preparingPdfDone"), e = this.$t("preparingPdfError"), i = this.$t("preparingPdf"), u = this.$t("_common:download"), { data: t } = await _.addDocument(this.document.publicId, {
121
+ ...this.options,
122
+ brand: D.brand
123
+ // this.$brand not defined on init
124
+ // locale: this.$i18n.locale,
125
+ // timeZone: get(Intl.DateTimeFormat().resolvedOptions(), 'timeZone') || '',
126
+ });
127
+ let a, n;
128
+ const f = async () => {
129
+ const { data: d } = await _.get(t) || {};
130
+ ({ status: a, url: n } = d);
131
+ }, g = async () => {
132
+ try {
133
+ if (await f(), a === "canceled")
134
+ throw new Error(
135
+ `Canceled preparing document pdf for publicId: ${this.document.publicId}`
136
+ );
137
+ if (a === "completed" && n) {
138
+ const d = () => {
139
+ const v = window.open(n, "_blank");
140
+ return v ? (v.focus(), !0) : !1;
141
+ };
142
+ return d() || k({
143
+ type: "success",
144
+ message: s,
145
+ time: null,
146
+ // won't close notification after default 6 sec
147
+ closeButton: !0,
148
+ actions: {
149
+ submit: {
150
+ text: u,
151
+ callback: d
152
+ }
153
+ }
154
+ }), "close";
155
+ }
156
+ return await E(3e3), g();
157
+ } catch (d) {
158
+ return k({
159
+ type: "error",
160
+ message: e
161
+ }), this.$error(d, { showMessage: !1 }), "close";
162
+ }
163
+ };
164
+ await k({
165
+ type: "spinner",
166
+ message: i,
167
+ time: g,
168
+ closeButton: !0
169
+ }), this.$emit("close");
170
+ }
171
+ }
172
+ }, F = { class: "options-wrapper" }, T = { class: "pb-4 text-lg font-semibold" }, S = { class: "print-options" }, M = { class: "select-none pb-1 text-sm font-medium text-gray-800" }, O = { class: "option-item" }, L = {
173
+ class: "has-text-grey-dark",
174
+ style: { "font-size": "13px" }
175
+ }, N = {
176
+ class: "has-text-grey-dark",
177
+ style: { "font-size": "13px" }
178
+ }, H = { class: "select-none pb-1 text-sm font-medium text-gray-800" }, $ = {
179
+ class: "has-text-grey-dark",
180
+ style: { "font-size": "13px" }
181
+ }, j = { key: 1 }, U = { key: 0 }, q = { class: "border-t-2 border-white bg-gray-100 text-xs opacity-80 hover:bg-gray-200" };
182
+ function J(s, e, i, u, t, a) {
183
+ const n = h("CCheckbox"), f = h("CIcon"), g = h("Animation"), d = h("CInput"), v = h("CButton"), A = V("tooltip");
184
+ return p(), m("div", null, [
185
+ o("div", F, [
186
+ o("div", T, l(s.$t("title")), 1),
187
+ o("div", S, [
188
+ o("div", M, l(s.$t("_common:document")), 1),
189
+ o("div", O, [
190
+ o("div", {
191
+ class: y([{ disabled: !i.document.attachedFiles.length }, "option-item__inner bg-gray-100 hover:bg-gray-200"]),
192
+ onClick: e[0] || (e[0] = (c) => t.options.appendAttachments = !t.options.appendAttachments)
193
+ }, [
194
+ r(n, {
195
+ "model-value": i.document.attachedFiles.length ? t.options.appendAttachments : !1,
196
+ type: "secondary",
197
+ size: "small",
198
+ style: { flex: "0 0 30px" }
199
+ }, null, 8, ["model-value"]),
200
+ o("div", null, [
201
+ o("div", null, l(s.$t("appendAttachments")), 1),
202
+ o("div", L, l(s.$tc("_common:attachment", {
203
+ count: i.document.attachedFiles.length
204
+ })), 1)
205
+ ])
206
+ ], 2),
207
+ B((p(), m("div", null, [
208
+ o("div", {
209
+ class: y([{
210
+ disabled: !i.document.getAllNodesWithType("attachments").length
211
+ }, "option-item__inner border-t-2 border-white bg-gray-100 hover:bg-gray-200"]),
212
+ onClick: e[1] || (e[1] = (c) => t.options.hideDocumentAttachmentBlocks = !t.options.hideDocumentAttachmentBlocks)
213
+ }, [
214
+ r(n, {
215
+ "model-value": i.document.getAllNodesWithType("attachments").length ? t.options.hideDocumentAttachmentBlocks : !1,
216
+ type: "secondary",
217
+ size: "small",
218
+ style: { flex: "0 0 30px" }
219
+ }, null, 8, ["model-value"]),
220
+ o("div", null, [
221
+ o("div", null, l(s.$t("hideDocumentAttachmentBlocks")), 1),
222
+ o("div", N, l(s.$tc("_common:block", {
223
+ count: i.document.getAllNodesWithType("attachments").length
224
+ })), 1)
225
+ ])
226
+ ], 2)
227
+ ])), [
228
+ [A, t.omitAttachmentBlockTooltip]
229
+ ])
230
+ ]),
231
+ e[15] || (e[15] = o("div", { style: { height: "1.25rem" } }, null, -1)),
232
+ o("div", H, l(s.$t("_common:verification").capitalize()), 1),
233
+ o("div", {
234
+ class: y([{ disabled: !a.allowVerification }, "option-item"])
235
+ }, [
236
+ o("div", {
237
+ class: "option-item__inner bg-gray-100 hover:bg-gray-200",
238
+ onClick: e[2] || (e[2] = (c) => t.options.showVerification = !t.options.showVerification)
239
+ }, [
240
+ r(n, {
241
+ "model-value": t.options.showVerification,
242
+ type: "secondary",
243
+ size: "small",
244
+ style: { flex: "0 0 30px" }
245
+ }, null, 8, ["model-value"]),
246
+ o("div", null, [
247
+ o("div", null, l(s.$t("showVerification")), 1),
248
+ o("div", $, l(s.$t("showVerificationSub")), 1)
249
+ ])
250
+ ]),
251
+ t.options.showVerification ? (p(), m("div", {
252
+ key: 0,
253
+ class: "option-item__inner border-t-2 border-white bg-gray-100 pl-8 hover:bg-gray-200",
254
+ onClick: e[3] || (e[3] = (c) => t.options.showEvents = !t.options.showEvents)
255
+ }, [
256
+ r(n, {
257
+ "model-value": t.options.showEvents,
258
+ type: "secondary",
259
+ size: "small",
260
+ style: { flex: "0 0 30px" }
261
+ }, null, 8, ["model-value"]),
262
+ o("div", null, [
263
+ o("div", null, l(s.$t("showEvents")), 1)
264
+ ])
265
+ ])) : w("", !0),
266
+ t.options.showVerification && a.hasBankIdSignatures ? (p(), m("div", j, [
267
+ o("div", {
268
+ class: "mb-1 mt-3 inline-flex cursor-pointer select-none items-center rounded p-2 text-xs font-medium leading-none text-gray-500 hover:bg-gray-100",
269
+ onClick: e[4] || (e[4] = (c) => t.showMoreOptions = !t.showMoreOptions)
270
+ }, [
271
+ b(l(s.$t("_common:more").capitalize()) + " ", 1),
272
+ r(f, {
273
+ type: "chevron-right",
274
+ class: y([{ "rotate-90": t.showMoreOptions }, "ml-0.5 transition-transform"]),
275
+ "stroke-width": "2.25",
276
+ size: "12"
277
+ }, null, 8, ["class"])
278
+ ]),
279
+ r(g, null, {
280
+ default: x(() => [
281
+ t.showMoreOptions ? (p(), m("div", {
282
+ key: 0,
283
+ class: "option-item__inner bg-gray-100 hover:bg-gray-200",
284
+ onClick: e[5] || (e[5] = (c) => t.options.showLast4ssn = !t.options.showLast4ssn)
285
+ }, [
286
+ r(n, {
287
+ "model-value": t.options.showLast4ssn,
288
+ type: "secondary",
289
+ size: "small",
290
+ style: { flex: "0 0 30px" }
291
+ }, null, 8, ["model-value"]),
292
+ o("div", null, [
293
+ o("div", null, l(s.$t("showLast4ssn")), 1)
294
+ ])
295
+ ])) : w("", !0)
296
+ ]),
297
+ _: 1
298
+ })
299
+ ])) : w("", !0)
300
+ ], 2),
301
+ a.showAdminOptions ? (p(), m("div", U, [
302
+ e[13] || (e[13] = o("div", { style: { height: "1.25rem" } }, null, -1)),
303
+ e[14] || (e[14] = o("div", { class: "select-none pb-1 text-sm font-medium text-gray-800" }, " Superuser + VPN ", -1)),
304
+ o("div", {
305
+ class: "option-item__inner border-t-2 border-white bg-gray-100 text-xs opacity-80 hover:bg-gray-200",
306
+ onClick: e[6] || (e[6] = (c) => t.options.forceDoCreatePdf = !t.options.forceDoCreatePdf)
307
+ }, [
308
+ r(n, {
309
+ "model-value": t.options.forceDoCreatePdf,
310
+ size: "small",
311
+ class: "py-2"
312
+ }, {
313
+ default: x(() => e[10] || (e[10] = [
314
+ b(" Force re-create PDF ")
315
+ ])),
316
+ _: 1
317
+ }, 8, ["model-value"])
318
+ ]),
319
+ o("div", {
320
+ class: "option-item__inner border-t-2 border-white bg-gray-100 text-xs opacity-80 hover:bg-gray-200",
321
+ onClick: e[7] || (e[7] = (c) => t.options.compressImages = !t.options.compressImages)
322
+ }, [
323
+ r(n, {
324
+ "model-value": t.options.compressImages,
325
+ type: "secondary",
326
+ size: "small",
327
+ style: { flex: "0 0 30px" }
328
+ }, null, 8, ["model-value"]),
329
+ e[11] || (e[11] = o("div", null, [
330
+ o("div", null, "Compress images")
331
+ ], -1))
332
+ ]),
333
+ o("div", {
334
+ class: "option-item__inner border-t-2 border-white bg-gray-100 text-xs opacity-80 hover:bg-gray-200",
335
+ onClick: e[8] || (e[8] = (c) => t.options.debugPage = !t.options.debugPage)
336
+ }, [
337
+ r(n, {
338
+ "model-value": t.options.debugPage,
339
+ size: "small",
340
+ class: "py-2"
341
+ }, {
342
+ default: x(() => e[12] || (e[12] = [
343
+ b(" Debug page output ")
344
+ ])),
345
+ _: 1
346
+ }, 8, ["model-value"])
347
+ ]),
348
+ o("div", q, [
349
+ r(d, {
350
+ modelValue: a.extraTimeout,
351
+ "onUpdate:modelValue": e[9] || (e[9] = (c) => a.extraTimeout = c),
352
+ modelModifiers: { number: !0 },
353
+ type: "number",
354
+ filled: "",
355
+ size: "small",
356
+ placeholder: "Optional extra timeout (ms)"
357
+ }, null, 8, ["modelValue"])
358
+ ])
359
+ ])) : w("", !0)
360
+ ])
361
+ ]),
362
+ r(v, {
363
+ type: "secondary",
364
+ size: "medium",
365
+ wide: "",
366
+ onClick: a.generatePdf
367
+ }, {
368
+ default: x(() => [
369
+ b(l(s.$t("buttonText")), 1)
370
+ ]),
371
+ _: 1
372
+ }, 8, ["onClick"])
373
+ ]);
374
+ }
375
+ const W = /* @__PURE__ */ C(z, [["render", J], ["__scopeId", "data-v-d1c9dab3"]]), Z = {
376
+ name: "DocPrint",
377
+ components: {
378
+ DocumentPrint: W
379
+ },
380
+ props: {
381
+ document: {
382
+ type: Object,
383
+ required: !0
384
+ }
385
+ }
386
+ }, G = { class: "h-full w-full overflow-auto px-8 py-12" };
387
+ function K(s, e, i, u, t, a) {
388
+ const n = h("DocumentPrint");
389
+ return p(), m("div", G, [
390
+ r(n, {
391
+ document: i.document,
392
+ onClose: e[0] || (e[0] = (f) => s.$router.push("/"))
393
+ }, null, 8, ["document"])
394
+ ]);
395
+ }
396
+ const R = /* @__PURE__ */ C(Z, [["render", K]]);
397
+ export {
398
+ R as default
399
+ };