@cling-se/widget 0.17.3 → 0.18.0

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/CHANGELOG.md +7 -0
  2. package/dist/AddClientCallout-Bod9Eqx4.js +101 -0
  3. package/dist/AnswerModal-a2cyKFbt.js +3371 -0
  4. package/dist/AttachmentItem-DBUqckCS.js +171 -0
  5. package/dist/BaseUpload-DrWzuvbS.js +6503 -0
  6. package/dist/BlockMedia-DuE_K9hR.js +103 -0
  7. package/dist/CCallout-CM1VsH30.js +104 -0
  8. package/dist/{CCurrencyDropdown-CXXQu8th.js → CCurrencyDropdown-C_lAaq4P.js} +91 -53
  9. package/dist/CDropdownItem-DMUAJ90n.js +749 -0
  10. package/dist/CFormField.vue_vue_type_script_setup_true_lang-BqAyWe3T.js +292 -0
  11. package/dist/{CPhoneFormat-BtBGl8b4.js → CPhoneFormat-Dnn_cKk7.js} +13 -21
  12. package/dist/CPhoneInput-DuGkDiv-.js +207 -0
  13. package/dist/CPriceInput-B7DYzKcF.js +142 -0
  14. package/dist/CSelect-BZZDr27O.js +98 -0
  15. package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-D2jDhnYI.js +51 -0
  16. package/dist/ClientAutocomplete-DuaJ5zDf.js +532 -0
  17. package/dist/ClientModal-CaMSjLkD.js +1188 -0
  18. package/dist/ColorPicker-BISZPQ6j.js +1408 -0
  19. package/dist/CompanyModal-ClTcmU4Y.js +250 -0
  20. package/dist/ContentWrapper-Bj7jbWU0.js +265 -0
  21. package/dist/CoverBlockSettings-AXyiLxrF.js +861 -0
  22. package/dist/DocAnswer-Bu09V33D.js +33 -0
  23. package/dist/DocDetails-B6-2LKsO.js +452 -0
  24. package/dist/DocForm-CFN8LWSd.js +6772 -0
  25. package/dist/DocFormSend-D1CUhy4n.js +171 -0
  26. package/dist/DocLinks-CuliFqtN.js +36 -0
  27. package/dist/DocModalBase-BxKsnwN-.js +29 -0
  28. package/dist/DocPrint-B_HJ_RET.js +399 -0
  29. package/dist/DocReceipt-D-A1TaTI.js +341 -0
  30. package/dist/DocSendReminder-BKTJonzh.js +181 -0
  31. package/dist/{DocTextEditor-yD9Dt_um.js → DocTextEditor-CEPcJT2o.js} +7907 -5579
  32. package/dist/DocTimeline-CF9S4YDZ.js +537 -0
  33. package/dist/DocumentClient-7mbq2QA4.js +90 -0
  34. package/dist/DocumentLayout-DkFlHgW6.js +1434 -0
  35. package/dist/DocumentLogotype-BTYMdpNi.js +162 -0
  36. package/dist/DocumentVoided-CWr5WMUv.js +33 -0
  37. package/dist/EmbedInput-SevVEpwc.js +156 -0
  38. package/dist/EmbedSettings-YMbUmp1O.js +103 -0
  39. package/dist/ErrorCallout-CQo2iF9c.js +34 -0
  40. package/dist/FilePreviewModal-C0xBeoAz.js +202 -0
  41. package/dist/Flag-BObij6SN.js +41 -0
  42. package/dist/HeaderSettings-C77pR78n.js +720 -0
  43. package/dist/ImageSelectModal-DKdU-0uq.js +119 -0
  44. package/dist/ImageUploadWrapper-BGkS5Cll.js +1585 -0
  45. package/dist/Index-B3y-jq9s.js +1098 -0
  46. package/dist/Index-B41pUREi.js +47 -0
  47. package/dist/Index-BEyeS1OG.js +52 -0
  48. package/dist/Index-BG5j8ZFP.js +93 -0
  49. package/dist/Index-BOT65yQR.js +68 -0
  50. package/dist/Index-BQNl-cXP.js +28 -0
  51. package/dist/Index-BY6xsS7C.js +38 -0
  52. package/dist/Index-Bh0Xv5ry.js +163 -0
  53. package/dist/Index-Bn4FSQcx.js +228 -0
  54. package/dist/Index-BrRIAede.js +87 -0
  55. package/dist/Index-C-6um0kX.js +76 -0
  56. package/dist/{Index-C_aIQ908.js → Index-C-gHa5xk.js} +319 -214
  57. package/dist/Index-C0wcjKCH.js +629 -0
  58. package/dist/Index-C6BbUFYw.js +160 -0
  59. package/dist/Index-C8xwJ0m1.js +200 -0
  60. package/dist/Index-CKgFEJF4.js +140 -0
  61. package/dist/{Index-Dfq7egc1.js → Index-CQwmu4f1.js} +47 -60
  62. package/dist/Index-CXchTpBa.js +74 -0
  63. package/dist/{Index-Ch9r5yhG.js → Index-CYoRt8PA.js} +9 -17
  64. package/dist/Index-CZZNQ4q5.js +39 -0
  65. package/dist/Index-CkaAs5ms.js +136 -0
  66. package/dist/Index-CtpXaBz8.js +363 -0
  67. package/dist/Index-CxDsSGtZ.js +126 -0
  68. package/dist/Index-DFkTBm02.js +102 -0
  69. package/dist/Index-DP3ll8F-.js +70 -0
  70. package/dist/{Index-RWMPRDAE.js → Index-DPDzMKQa.js} +10 -18
  71. package/dist/Index-DvxSig3z.js +25 -0
  72. package/dist/Index-Dzrn3Y6p.js +16 -0
  73. package/dist/{Index-CRiATiQn.js → Index-LQb0omFE.js} +10 -18
  74. package/dist/Index-Mt4mSaNT.js +4 -0
  75. package/dist/Index-_xN_cczo.js +3477 -0
  76. package/dist/Index-gAz45qgR.js +21 -0
  77. package/dist/Index-xXLFalgR.js +49 -0
  78. package/dist/Index-zyZRPz3H.js +28 -0
  79. package/dist/Index.vue_vue_type_script_lang-Ddo1wo-D.js +671 -0
  80. package/dist/InputToggleRow-CokEYwm2.js +99 -0
  81. package/dist/ManualPopover-Dukly7GP.js +65 -0
  82. package/dist/MediaWrapper-B8msCrQm.js +18 -0
  83. package/dist/{NotBindingText-CC7TxUqg.js → NotBindingText-DcQd8Eej.js} +13 -17
  84. package/dist/PackageGroup-clUIUoik.js +1060 -0
  85. package/dist/PdfTerms-DpzMVRfN.js +34 -0
  86. package/dist/PdfViewer-CSf4Rtbj.js +392 -0
  87. package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6KSjjMA.js +17 -0
  88. package/dist/PriceHeader-Dyweu8aH.js +488 -0
  89. package/dist/{SearchApi-G2Hvp0Dd.js → SearchApi-Y1fDQn0u.js} +37 -49
  90. package/dist/SendForm-B9l24WwR.js +6689 -0
  91. package/dist/Setup-DyzbPFM4.js +47 -0
  92. package/dist/{SmartList-BynTuXtB.js → SmartList-CWGKoAJh.js} +16 -24
  93. package/dist/Sortable.vue_vue_type_script_setup_true_lang-C2Gwp6Q-.js +1349 -0
  94. package/dist/{TermsSettings-cA5YAO77.js → TermsSettings-BeQH307A.js} +169 -56
  95. package/dist/ThemeColorRow-DFIsPy55.js +105 -0
  96. package/dist/ToggleBinding-DlH4y1IM.js +44 -0
  97. package/dist/UploadModal-BZ0mPBBB.js +134 -0
  98. package/dist/VideoPlayerInput-DBxcTUb7.js +134 -0
  99. package/dist/VideoPlayerSettings-Dg1OxjOa.js +78 -0
  100. package/dist/VideoSelectModal-BhbanMix.js +217 -0
  101. package/dist/{anime.es-BrPTThYb.js → anime.es-4wvNItHq.js} +205 -201
  102. package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
  103. package/dist/{dom-Ds4ypDrd.js → dom-CkTGWrfu.js} +3 -6
  104. package/dist/{focusDrawerMixin-CximZA1J.js → focusDrawerMixin-BVbTYOGr.js} +1 -1
  105. package/dist/{formDrawerState-CkNGdxn5.js → formDrawerState-CogZ-GVm.js} +2 -2
  106. package/dist/helpers-B4GUxtdD.js +46 -0
  107. package/dist/index-BZDey7B-.js +268 -0
  108. package/dist/index-Bd8_ZHHq.js +188 -0
  109. package/dist/index-BvyoYp1e.js +508 -0
  110. package/dist/index-CJZoubA3.js +3525 -0
  111. package/dist/index-D7yQWP4d.js +125 -0
  112. package/dist/index-D8hGHka6.js +513 -0
  113. package/dist/index-Dxy4tf7x.js +149 -0
  114. package/dist/index.es.js +2 -5
  115. package/dist/index.umd.js +303 -1486
  116. package/dist/main-Bn5XkQPb.js +57570 -0
  117. package/dist/mapFormMixin-C7FJLnbO.js +1528 -0
  118. package/dist/omit-DrWpFvRJ.js +56 -0
  119. package/dist/{publicSenderState-CGEm9EYe.js → publicSenderState-tdtCFPMx.js} +4 -4
  120. package/dist/splitpanes-BApidgjj.js +342 -0
  121. package/dist/template-CHdf2K2I.js +1572 -0
  122. package/dist/tippy.esm-Co6FYzEM.js +1994 -0
  123. package/dist/useTermsModal-VDnO1Lro.js +87 -0
  124. package/dist/{utils-Dr4AcaE9.js → utils-DZkn0Q9c.js} +8 -11
  125. package/dist/validation-CqBkar3f.js +40 -0
  126. package/dist/widget.css +1 -0
  127. package/package.json +20 -25
  128. package/dist/AddClientCallout-Br6IhwGH.js +0 -48
  129. package/dist/AnswerModal-CsWltR6j.js +0 -3879
  130. package/dist/AttachmentItem-BG7FuSCD.js +0 -85
  131. package/dist/BaseDatePicker-PSNBtUIh.js +0 -3187
  132. package/dist/BaseUpload-BfEurAAV.js +0 -1977
  133. package/dist/BlockMedia-Bo3OfNSU.js +0 -76
  134. package/dist/CCallout-CAjM8-1X.js +0 -58
  135. package/dist/CDropdownItem-CN7gSfgY.js +0 -640
  136. package/dist/CFormField-Clvcf2Jh.js +0 -240
  137. package/dist/CPhoneInput-CEHXh5jM.js +0 -138
  138. package/dist/CPriceInput-D2c07SXp.js +0 -116
  139. package/dist/CSelect-Cz2IPzxS.js +0 -91
  140. package/dist/CSkeleton-AsnvnD-m.js +0 -55
  141. package/dist/ClientAutocomplete-CZ55-DKe.js +0 -438
  142. package/dist/ClientModal-CgUhWZ5L.js +0 -666
  143. package/dist/ColorPicker-IFGHqH-u.js +0 -2879
  144. package/dist/CompanyModal-TLSBFo3U.js +0 -147
  145. package/dist/ContentWrapper-HClxKPuT.js +0 -190
  146. package/dist/CoverBlockSettings-D99hAa6e.js +0 -659
  147. package/dist/DocAnswer-CTV_Bpt7.js +0 -36
  148. package/dist/DocDetails-CQe5htXj.js +0 -263
  149. package/dist/DocForm-6Efv5_oz.js +0 -5017
  150. package/dist/DocFormSend-DbXcklxU.js +0 -146
  151. package/dist/DocLinks-BO545zbL.js +0 -38
  152. package/dist/DocModalBase-DXHNJ-6i.js +0 -28
  153. package/dist/DocPrint-Bf2U4FQN.js +0 -240
  154. package/dist/DocReceipt-CWXvC7bY.js +0 -217
  155. package/dist/DocSendReminder-CRzBM2NJ.js +0 -140
  156. package/dist/DocTimeline-DGVOk8-2.js +0 -485
  157. package/dist/DocumentClient-Das9BaJ7.js +0 -136
  158. package/dist/DocumentLayout-4q8rmTVT.js +0 -4880
  159. package/dist/DocumentLogotype-DLncJJAB.js +0 -92
  160. package/dist/DocumentVoided-CcI9lX27.js +0 -25
  161. package/dist/EmbedInput-BPdy0lGS.js +0 -117
  162. package/dist/EmbedSettings-L2iwYLQK.js +0 -74
  163. package/dist/ErrorCallout-Ds_tBT02.js +0 -27
  164. package/dist/FilePreviewModal-hxUu330p.js +0 -81
  165. package/dist/Flag-1-HcT5Dz.js +0 -46
  166. package/dist/HeaderSettings-C27fMugK.js +0 -440
  167. package/dist/ImageSelectModal-BKDIyxF4.js +0 -86
  168. package/dist/ImageUploadWrapper-BiYzUQur.js +0 -1604
  169. package/dist/Index-5BOWxcPG.js +0 -26
  170. package/dist/Index-B1Odktov.js +0 -754
  171. package/dist/Index-B3d5BjEn.js +0 -25
  172. package/dist/Index-B3sSU_4X.js +0 -54
  173. package/dist/Index-B5Dqsh3K.js +0 -150
  174. package/dist/Index-B6aO1c_w.js +0 -62
  175. package/dist/Index-BGfICxJQ.js +0 -643
  176. package/dist/Index-BHopC0hv.js +0 -24
  177. package/dist/Index-BJXcSmp_.js +0 -55
  178. package/dist/Index-BQe6QjQZ.js +0 -25
  179. package/dist/Index-BmXx_x6t.js +0 -77
  180. package/dist/Index-C692qMTG.js +0 -294
  181. package/dist/Index-CEvbw-3i.js +0 -41
  182. package/dist/Index-CYSULnpn.js +0 -32
  183. package/dist/Index-CdtYzwAM.js +0 -107
  184. package/dist/Index-CetF2FW0.js +0 -230
  185. package/dist/Index-Cv6XLM20.js +0 -73
  186. package/dist/Index-Cwy8ff76.js +0 -154
  187. package/dist/Index-D34z4UEY.js +0 -84
  188. package/dist/Index-DNCei-lp.js +0 -56
  189. package/dist/Index-DUbxgIYB.js +0 -2445
  190. package/dist/Index-DVwn_LLf.js +0 -28
  191. package/dist/Index-Dla-mesV.js +0 -146
  192. package/dist/Index-KtUkOPI2.js +0 -58
  193. package/dist/Index-LjnOTVJk.js +0 -66
  194. package/dist/Index-ky1SRtfY.js +0 -94
  195. package/dist/Index-mceZW2NX.js +0 -41
  196. package/dist/Index-tD3hZjh8.js +0 -144
  197. package/dist/Index-vM5kDtC2.js +0 -33
  198. package/dist/InputToggleRow-BmDuSbE2.js +0 -57
  199. package/dist/ManualPopover-CQfjPvFe.js +0 -60
  200. package/dist/MediaWrapper-DDzcjR6V.js +0 -23
  201. package/dist/PackageGroup-mAGXfZDv.js +0 -704
  202. package/dist/PdfTerms-BH_Nwf2h.js +0 -31
  203. package/dist/PdfViewer-mBLxI8bA.js +0 -383
  204. package/dist/PlainHtml-B7gUNNZd.js +0 -27
  205. package/dist/PriceHeader-DClYMPcq.js +0 -338
  206. package/dist/SendForm-Cxv_m8Rq.js +0 -1023
  207. package/dist/Setup-B90VDZTG.js +0 -50
  208. package/dist/ThemeColorRow-D-Z7w4Wk.js +0 -69
  209. package/dist/ToggleBinding-DOeTcWzi.js +0 -42
  210. package/dist/UploadModal-DOPLVEpV.js +0 -95
  211. package/dist/VideoPlayerInput-1zG06elO.js +0 -97
  212. package/dist/VideoPlayerSettings-O-4rAYYh.js +0 -61
  213. package/dist/VideoSelectModal-DzqFrqCg.js +0 -104
  214. package/dist/answerDocumentMixin-HBiNWYCH.js +0 -51
  215. package/dist/debounce-Ch1d3526.js +0 -84
  216. package/dist/formValidationMixin-D_MzsHsR.js +0 -49
  217. package/dist/index-BNdbPq4J.js +0 -492
  218. package/dist/index-BXzugeJ6.js +0 -81
  219. package/dist/index-C5wcxrC6.js +0 -167
  220. package/dist/index-CgDOs7t4.js +0 -2700
  221. package/dist/index-Cj-_2coz.js +0 -351
  222. package/dist/index-DpqV5y0K.js +0 -102
  223. package/dist/main-BL_yzf2r.js +0 -57357
  224. package/dist/mapFormMixin-Cu_vkTP-.js +0 -3028
  225. package/dist/omit-Dfe_H1Ft.js +0 -31
  226. package/dist/simplebar.min-CRlLD1Oz.js +0 -71
  227. package/dist/splitpanes-BHUVsCZF.js +0 -382
  228. package/dist/style.css +0 -4
  229. package/dist/throttle-BX_w77tW.js +0 -18
  230. package/dist/tippy.esm-n4arfVzA.js +0 -1805
  231. package/dist/vuedraggable.umd-DW4PJoZ3.js +0 -3161
  232. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -0,0 +1,1188 @@
1
+ import { C as L } from "./ClientAutocomplete-DuaJ5zDf.js";
2
+ import { _ as z, b4 as j, o as f, b as h, E as Z, b5 as Y, s as i, an as N, n as y, S as G, ae as H, aq as B, a7 as K, m as E, a4 as J, v as r, d as n, w as a, c as b, f as v, F as O, k as F, B as C, e as g, a9 as k, ar as Q, D as X, p as _, a as x, g as q, ba as ee, aE as te } from "./main-Bn5XkQPb.js";
3
+ import { C as oe, a as ne, w as P } from "./CDropdownItem-DMUAJ90n.js";
4
+ import { _ as le } from "./CFormField.vue_vue_type_script_setup_true_lang-BqAyWe3T.js";
5
+ import { C as ae } from "./CPhoneInput-DuGkDiv-.js";
6
+ import { u as ie } from "./index-D8hGHka6.js";
7
+ import { r as se, a as $, e as re } from "./index-Dxy4tf7x.js";
8
+ import { o as de } from "./omit-DrWpFvRJ.js";
9
+ const me = {
10
+ name: "CRadio",
11
+ mixins: [j]
12
+ }, ue = ["disabled"], pe = ["disabled", "required", "name", "value"], ce = { class: "control-label" };
13
+ function fe(e, t, s, d, u, l) {
14
+ return f(), h("label", {
15
+ ref: "label",
16
+ class: y([[`is-${e.size}`, { "is-disabled": e.disabled }], "b-radio radio"]),
17
+ disabled: e.disabledOrUndefined,
18
+ onClick: t[2] || (t[2] = (...c) => e.focus && e.focus(...c)),
19
+ onKeydown: t[3] || (t[3] = H(N((c) => e.$refs.label.click(), ["prevent"]), ["enter"]))
20
+ }, [
21
+ Z(i("input", {
22
+ ref: "input",
23
+ "onUpdate:modelValue": t[0] || (t[0] = (c) => e.computedValue = c),
24
+ disabled: e.disabledOrUndefined,
25
+ required: e.requiredOrUndefined,
26
+ name: e.name,
27
+ value: e.nativeValue,
28
+ type: "radio",
29
+ onClick: t[1] || (t[1] = N(() => {
30
+ }, ["stop"]))
31
+ }, null, 8, pe), [
32
+ [Y, e.computedValue]
33
+ ]),
34
+ i("span", {
35
+ class: y([`is-${e.type}`, "check"])
36
+ }, null, 2),
37
+ i("span", ce, [
38
+ G(e.$slots, "default")
39
+ ])
40
+ ], 42, ue);
41
+ }
42
+ const ge = /* @__PURE__ */ z(me, [["render", fe]]);
43
+ function T(e) {
44
+ if (typeof e > "u") throw Error("Missing param inputParam");
45
+ let t = e;
46
+ Number.isInteger(t) && (t = t.toString());
47
+ let s = 0;
48
+ const d = t.length, u = d % 2;
49
+ let l, c;
50
+ for (l = 0; l < d; l += 1)
51
+ c = parseInt(t.charAt(l), 10), l % 2 === u && (c *= 2), c > 9 && (c -= 9), s += c;
52
+ return s % 10 === 0;
53
+ }
54
+ function A(e) {
55
+ let t = e.replace(/ /g, "");
56
+ return t = t.replace(/-/g, ""), !T(t) || (t = [t.slice(0, 6), "-", t.slice(6)].join(""), !t.match(/^(\d{6})-(\d{4})$/)) ? !1 : t;
57
+ }
58
+ function V(e) {
59
+ if (typeof e > "u" || e === null || e === "")
60
+ return !1;
61
+ let t = e.trim().replace(/[^0-9]+/g, "");
62
+ if (t.length !== 10 && t.length !== 12)
63
+ return !1;
64
+ if (t.length === 10) {
65
+ const u = t.substring(0, 2), l = (/* @__PURE__ */ new Date()).getFullYear(), c = parseInt(
66
+ l.toString().substring(2, 4),
67
+ 10
68
+ );
69
+ parseInt(u, 10) === 19 || parseInt(u, 10) === 20 || (parseInt(u, 10) >= 0 && parseInt(u, 10) <= c ? t = `20${t}` : t = `19${t}`);
70
+ }
71
+ return (/* @__PURE__ */ new Date()).getFullYear() - parseInt(t.substring(0, 4), 10) < 16 ? !1 : T(t.substring(2)) ? t : !1;
72
+ }
73
+ const he = {
74
+ sv: {
75
+ title: "Mottagare",
76
+ updateButton: "Spara mottagare",
77
+ individual: "Privatperson",
78
+ reference: "Referens",
79
+ workAddressSubLabel: "Där arbetet utförs",
80
+ showMore: "Visa fler fält",
81
+ seperateWorkAddress: {
82
+ false: "Arbetsadress som ovan",
83
+ true: "Annan"
84
+ },
85
+ placeholders: {
86
+ name: "Mottagarens namn",
87
+ companyName: "Företagets namn",
88
+ socialNo: "10 eller 12 siffror",
89
+ orgNo: "Företagets org-nr",
90
+ reference: "Er referens",
91
+ cellphone: "Mobilnummer",
92
+ address: "Gatuadress"
93
+ },
94
+ validations: {
95
+ name: {
96
+ required: "Vem är din kund?"
97
+ },
98
+ orgNo: {
99
+ personalNumber: "Personnumret är inte giltigt"
100
+ },
101
+ realOrgNo: {
102
+ realOrgNo: "Organisationsnumret är inte giltigt"
103
+ },
104
+ reference: {
105
+ required: "Vem är din referens?"
106
+ },
107
+ email: {
108
+ required: "E-post saknas",
109
+ email: "E-posten är ogiltig"
110
+ }
111
+ },
112
+ signMethod: {
113
+ button: {
114
+ title: "Standard - knapptryck",
115
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
116
+ },
117
+ bankId: {
118
+ title: "BankId",
119
+ content: "Samma säkerhetsgrad som bankerna har."
120
+ },
121
+ signature: {
122
+ title: "Standard",
123
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
124
+ },
125
+ inPerson: {
126
+ title: "Fysisk underskrift",
127
+ content: "Signatur på utskrivet dokument"
128
+ }
129
+ }
130
+ },
131
+ en: {
132
+ title: "Recipient",
133
+ updateButton: "Save recipient",
134
+ individual: "Individual",
135
+ reference: "Contact",
136
+ workAddressSubLabel: "Where work is going to be performed",
137
+ showMore: "Show additional fields",
138
+ seperateWorkAddress: {
139
+ false: "Work address same as above",
140
+ true: "Other"
141
+ },
142
+ placeholders: {
143
+ name: "Recipient name",
144
+ companyName: "Company name",
145
+ socialNo: "10 or 12 numbers",
146
+ orgNo: "Company registration number",
147
+ reference: "Name",
148
+ cellphone: "Cellphone",
149
+ address: "Street"
150
+ },
151
+ validations: {
152
+ name: {
153
+ required: "Who's your contact person?"
154
+ },
155
+ orgNo: {
156
+ personalNumber: "Invalid social security number"
157
+ },
158
+ realOrgNo: {
159
+ realOrgNo: "Invalid organisation number"
160
+ },
161
+ reference: {
162
+ required: "Missing contact name"
163
+ },
164
+ email: {
165
+ required: "Email missing",
166
+ email: "Invalid email"
167
+ }
168
+ },
169
+ signMethod: {
170
+ button: {
171
+ title: "Standard - button",
172
+ content: "Level of proof: IP address, timestamp and device."
173
+ },
174
+ bankId: {
175
+ title: "BankID",
176
+ content: "Same level of proof as the banks use."
177
+ },
178
+ signature: {
179
+ title: "Signature",
180
+ content: "Level of proof: IP address, timestamp and device."
181
+ },
182
+ inPerson: {
183
+ title: "In person",
184
+ content: "Signature on print document"
185
+ }
186
+ }
187
+ }
188
+ }, { mapFields: ve } = B({
189
+ getterType: "forms/getField",
190
+ mutationType: "forms/updateField"
191
+ }), ye = {
192
+ name: "FormClient",
193
+ i18nOptions: {
194
+ namespaces: "formClient",
195
+ messages: he
196
+ },
197
+ components: {
198
+ ClientAutocomplete: L,
199
+ CCheckbox: K,
200
+ CDropdown: oe,
201
+ CDropdownItem: ne,
202
+ CField: le,
203
+ CPhoneInput: ae,
204
+ CRadio: ge
205
+ },
206
+ emits: [
207
+ "setClient",
208
+ "show-more",
209
+ "update:document-role",
210
+ "update:answer-method",
211
+ "submit"
212
+ ],
213
+ mixins: [P],
214
+ props: {
215
+ requireReference: {
216
+ type: Boolean,
217
+ default: !0
218
+ },
219
+ searchEnabled: {
220
+ type: Boolean,
221
+ default: !1
222
+ },
223
+ validateOrgNo: {
224
+ type: Boolean,
225
+ default: !1
226
+ },
227
+ simpleForm: {
228
+ type: Boolean,
229
+ default: !1
230
+ },
231
+ inputFocusOnMount: {
232
+ type: String,
233
+ default: ""
234
+ },
235
+ // Optional field with prop sync, if within the context of documents
236
+ documentRole: {
237
+ type: String,
238
+ default: ""
239
+ },
240
+ // Optional field with prop sync, if within the context of documents
241
+ answerMethod: {
242
+ type: Object,
243
+ default: null
244
+ },
245
+ signOptions: {
246
+ type: Array,
247
+ default: () => []
248
+ },
249
+ isPublicForm: {
250
+ type: Boolean,
251
+ default: !1
252
+ }
253
+ },
254
+ setup() {
255
+ return {
256
+ v$: ie()
257
+ };
258
+ },
259
+ validations() {
260
+ return [
261
+ this.name,
262
+ this.orgNo,
263
+ this.reference,
264
+ this.email,
265
+ this.cellphone
266
+ ].some((t) => !!t) ? {
267
+ orgNo: {
268
+ personalNumber(t) {
269
+ return !this.validateOrgNo || !t ? !0 : this.isIndivid ? V(t) : A(t) || V(t);
270
+ }
271
+ },
272
+ reference: {
273
+ required: $(this.requireReference && !this.isIndivid)
274
+ },
275
+ email: {
276
+ email: re
277
+ }
278
+ } : {
279
+ name: {
280
+ required: se
281
+ },
282
+ orgNo: {
283
+ required: $(this.type === "company")
284
+ },
285
+ cellphone: {
286
+ required: $(!this.isIndivid)
287
+ },
288
+ reference: {
289
+ required: $(!this.isIndivid)
290
+ },
291
+ email: {
292
+ required: $(!this.isIndivid)
293
+ }
294
+ };
295
+ },
296
+ computed: {
297
+ ...ve({
298
+ id: "endCustomer.id",
299
+ type: "endCustomer.customerType",
300
+ name: "endCustomer.name",
301
+ realOrgNo: "endCustomer.org_no",
302
+ reference: "endCustomer.reference",
303
+ email: "endCustomer.email",
304
+ street: "endCustomer.street",
305
+ zip: "endCustomer.zip",
306
+ city: "endCustomer.city",
307
+ cellphone: "endCustomer.cellphone",
308
+ cellphoneRegion: "endCustomer.cellphoneRegion",
309
+ separateWorkAddress: "endCustomer.separateWorkAddress",
310
+ workStreet: "endCustomer.workStreet",
311
+ workZip: "endCustomer.workZip",
312
+ workCity: "endCustomer.workCity",
313
+ reverseVat: "endCustomer.reverseVat",
314
+ doUpdateEndCustomer: "endCustomer.doUpdateEndCustomer"
315
+ }),
316
+ ...E({
317
+ isPosting: "endCustomers/isPosting",
318
+ companyRegion: "application/companyRegion",
319
+ feature: "application/feature"
320
+ }),
321
+ messages() {
322
+ return {
323
+ name: {
324
+ required: this.$t("validations.name.required")
325
+ },
326
+ orgNo: {
327
+ personalNumber: this.$t("validations.orgNo.personalNumber")
328
+ },
329
+ realOrgNo: {
330
+ personalNumber: this.$t("validations.realOrgNo.realOrgNo")
331
+ },
332
+ reference: {
333
+ required: this.$t("validations.reference.required")
334
+ },
335
+ email: {
336
+ required: this.$t("validations.email.required"),
337
+ email: this.$t("validations.email.email")
338
+ }
339
+ };
340
+ },
341
+ orgNo: {
342
+ get() {
343
+ return this.realOrgNo;
344
+ },
345
+ set(e) {
346
+ const t = this.isIndivid ? V(e) : A(e) || V(e);
347
+ return this.validateOrgNo && t ? (this.realOrgNo = t, !0) : (this.realOrgNo = e, !0);
348
+ }
349
+ },
350
+ isIndivid() {
351
+ return this.type === "individual";
352
+ }
353
+ },
354
+ watch: {
355
+ type(e) {
356
+ J.setItem("defaultClientType", e);
357
+ }
358
+ },
359
+ mounted() {
360
+ var t, s, d;
361
+ const e = this.$refs[this.inputFocusOnMount] || this.$refs.name;
362
+ (d = (s = (t = e == null ? void 0 : e.$el) == null ? void 0 : t.nextElementSibling) == null ? void 0 : s.querySelector("input")) == null || d.focus();
363
+ },
364
+ methods: {
365
+ validateForm() {
366
+ return this.v$.$touch(), this.v$.$invalid ? !1 : (this.$emit("submit", !0), !0);
367
+ }
368
+ }
369
+ }, be = { class: "form-client" }, Ce = { class: "space-between flex flex-wrap items-center pb-6" }, we = {
370
+ class: "flex-grow",
371
+ style: { "font-weight": "600", "font-size": "20px" }
372
+ }, ke = { class: "type-toggle" }, $e = { style: { "line-height": "1.25", padding: "4px 0" } }, Ve = { style: { "font-size": "12px", opacity: "0.7" } }, Ne = { style: { "line-height": "1.25", padding: "4px 0" } }, Se = { style: { "font-size": "12px", opacity: "0.7" } }, Ie = {
373
+ class: "flex items-center justify-center",
374
+ style: { "margin-bottom": "calc(2.5 * var(--rem))" }
375
+ }, Me = { class: "type-toggle" }, Oe = { key: 0 }, Fe = {
376
+ key: 0,
377
+ class: "dropdown-field-wrapper flex min-w-0 flex-col"
378
+ }, ze = { class: "my-1 text-sm text-gray-600" }, Re = { class: "py-1 leading-5" }, De = { class: "text-xs opacity-70" }, Ue = { style: { "line-height": "1.25", padding: "4px 0" } }, qe = { style: { "font-size": "12px", opacity: "0.7" } }, Ae = {
379
+ key: 1,
380
+ class: "dropdown-field-wrapper flex min-w-0 flex-col"
381
+ }, Be = { class: "my-1 text-sm text-gray-600" }, Ee = { class: "max-w-[calc(16_*_var(--rem))] py-1 leading-5" }, Pe = { class: "truncate text-xs opacity-70" }, Te = { style: { "line-height": "1.25", padding: "4px 0" } }, We = {
382
+ class: "max-w-[calc(12_*_var(--rem))] truncate",
383
+ style: { "font-size": "12px", opacity: "0.7", "text-wrap": "wrap" }
384
+ }, Le = { style: { "margin-top": "calc(3 * var(--rem))" } };
385
+ function je(e, t, s, d, u, l) {
386
+ const c = g("ClientAutocomplete"), m = g("CField"), p = g("CInput"), S = g("Animation"), R = g("CPhoneInput"), w = g("CButton"), I = g("CDropdownItem"), M = g("CDropdown"), W = g("CCheckbox"), D = g("CRadio");
387
+ return f(), h("div", be, [
388
+ s.simpleForm ? (f(), h("form", {
389
+ key: 0,
390
+ onSubmit: t[9] || (t[9] = N((...o) => l.validateForm && l.validateForm(...o), ["prevent"]))
391
+ }, [
392
+ i("div", Ce, [
393
+ i("div", we, r(e.$t("_common:recipient").capitalize()), 1),
394
+ i("div", ke, [
395
+ i("div", {
396
+ class: y([{ active: e.type === "individual" }, "type-toggle-button"]),
397
+ onClick: t[0] || (t[0] = (o) => e.type = "individual")
398
+ }, r(e.$t("individual")), 3),
399
+ i("div", {
400
+ class: y([{ active: e.type === "company" }, "type-toggle-button"]),
401
+ onClick: t[1] || (t[1] = (o) => e.type = "company")
402
+ }, r(e.$t("_common:company").capitalize()), 3)
403
+ ])
404
+ ]),
405
+ n(m, {
406
+ label: l.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(),
407
+ validator: d.v$.name,
408
+ messages: l.messages.name,
409
+ "label-position": "inside",
410
+ style: { "margin-bottom": "calc(1.5 * var(--rem))" }
411
+ }, {
412
+ default: a(() => [
413
+ n(c, {
414
+ ref: "name",
415
+ modelValue: e.name,
416
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => e.name = o),
417
+ placeholder: l.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"),
418
+ "search-enabled": s.searchEnabled,
419
+ "show-loading": !0,
420
+ onSetClient: t[3] || (t[3] = (o) => e.$emit("setClient", o))
421
+ }, null, 8, ["modelValue", "placeholder", "search-enabled"])
422
+ ]),
423
+ _: 1
424
+ }, 8, ["label", "validator", "messages"]),
425
+ n(S, null, {
426
+ default: a(() => [
427
+ l.isIndivid ? v("", !0) : (f(), b(m, {
428
+ key: 0,
429
+ validator: d.v$.reference,
430
+ messages: l.messages.reference,
431
+ label: e.$t("reference").capitalize(),
432
+ "label-position": "inside",
433
+ class: "pb-4"
434
+ }, {
435
+ default: a(() => [
436
+ n(p, {
437
+ ref: "reference",
438
+ modelValue: e.reference,
439
+ "onUpdate:modelValue": t[4] || (t[4] = (o) => e.reference = o),
440
+ placeholder: e.$t("placeholders.reference")
441
+ }, null, 8, ["modelValue", "placeholder"])
442
+ ]),
443
+ _: 1
444
+ }, 8, ["validator", "messages", "label"]))
445
+ ]),
446
+ _: 1
447
+ }),
448
+ n(m, {
449
+ validator: d.v$.email,
450
+ messages: l.messages.email,
451
+ label: e.$t("_common:email").capitalize(),
452
+ "label-position": "inside",
453
+ style: { "margin-bottom": "calc(1.5 * var(--rem))" }
454
+ }, {
455
+ default: a(() => [
456
+ n(p, {
457
+ ref: "email",
458
+ modelValue: e.email,
459
+ "onUpdate:modelValue": t[5] || (t[5] = (o) => e.email = o),
460
+ modelModifiers: { trim: !0 },
461
+ placeholder: e.$t("_common:email").capitalize()
462
+ }, null, 8, ["modelValue", "placeholder"])
463
+ ]),
464
+ _: 1
465
+ }, 8, ["validator", "messages", "label"]),
466
+ n(R, {
467
+ ref: "cellphone",
468
+ modelValue: e.cellphone,
469
+ "onUpdate:modelValue": t[6] || (t[6] = (o) => e.cellphone = o),
470
+ region: e.cellphoneRegion,
471
+ "onUpdate:region": t[7] || (t[7] = (o) => e.cellphoneRegion = o),
472
+ label: e.$t("_common:cellphone").capitalize(),
473
+ placeholder: e.$t("placeholders.cellphone"),
474
+ "default-region": e.companyRegion,
475
+ "label-position": "inside"
476
+ }, null, 8, ["modelValue", "region", "label", "placeholder", "default-region"]),
477
+ s.documentRole ? (f(), b(M, {
478
+ key: 0,
479
+ expanded: "",
480
+ style: { "margin-bottom": "calc(1 * var(--rem))", "margin-top": "calc(0.75 * var(--rem))" }
481
+ }, {
482
+ trigger: a(() => [
483
+ n(w, {
484
+ "dropdown-icon": !0,
485
+ "icon-props": {
486
+ stroke: "hsl(0, 0%, 50%)"
487
+ },
488
+ "icon-left": s.documentRole === "signee" ? "pen-tool" : "eye",
489
+ class: "is-left",
490
+ type: "none",
491
+ pattern: "secondary",
492
+ style: { width: "100%" }
493
+ }, {
494
+ default: a(() => [
495
+ i("div", $e, [
496
+ i("div", null, r(e.$t(`_common:documentRole.${s.documentRole}.description`)), 1),
497
+ i("div", Ve, r(e.$t(`_common:documentRole.${s.documentRole}.label`)), 1)
498
+ ])
499
+ ]),
500
+ _: 1
501
+ }, 8, ["icon-left"])
502
+ ]),
503
+ default: a(() => [
504
+ (f(), h(O, null, F(["signee", "recipient", "approver"], (o) => n(I, {
505
+ key: o,
506
+ "icon-left": o === "signee" ? "pen-tool" : "eye",
507
+ "icon-props": {
508
+ stroke: "hsl(0, 0%, 50%)"
509
+ },
510
+ onClick: (U) => e.$emit("update:document-role", o)
511
+ }, {
512
+ default: a(() => [
513
+ i("div", Ne, [
514
+ i("div", null, r(e.$t(`_common:documentRole.${o}.description`)), 1),
515
+ i("div", Se, r(e.$t(`_common:documentRole.${o}.label`)), 1)
516
+ ])
517
+ ]),
518
+ _: 2
519
+ }, 1032, ["icon-left", "onClick"])), 64))
520
+ ]),
521
+ _: 1
522
+ })) : v("", !0),
523
+ n(w, {
524
+ type: "secondary",
525
+ pattern: "tertiary",
526
+ size: "small",
527
+ "icon-left": "arrow-right",
528
+ onClick: t[8] || (t[8] = (o) => e.$emit("show-more"))
529
+ }, {
530
+ default: a(() => [
531
+ C(r(e.$t("showMore").capitalize()), 1)
532
+ ]),
533
+ _: 1
534
+ }),
535
+ n(w, {
536
+ loading: e.isPosting,
537
+ "native-type": "submit",
538
+ type: "secondary",
539
+ wide: "",
540
+ size: "medium",
541
+ class: "mt-4",
542
+ style: { padding: "16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0, 0, 0, 0.1)" }
543
+ }, {
544
+ default: a(() => [
545
+ C(r(e.$t("updateButton")), 1)
546
+ ]),
547
+ _: 1
548
+ }, 8, ["loading"])
549
+ ], 32)) : (f(), h("div", {
550
+ key: 1,
551
+ class: y({ "column-only": e.windowWidth <= 600 })
552
+ }, [
553
+ i("div", Ie, [
554
+ i("div", Me, [
555
+ i("div", {
556
+ class: y([{ active: e.type === "individual" }, "type-toggle-button"]),
557
+ onClick: t[10] || (t[10] = (o) => e.type = "individual")
558
+ }, r(e.$t("individual")), 3),
559
+ i("div", {
560
+ class: y([{ active: e.type === "company" }, "type-toggle-button"]),
561
+ onClick: t[11] || (t[11] = (o) => e.type = "company")
562
+ }, r(e.$t("_common:company").capitalize()), 3)
563
+ ])
564
+ ]),
565
+ n(m, {
566
+ class: "flex",
567
+ grouped: ""
568
+ }, {
569
+ default: a(() => [
570
+ n(m, {
571
+ label: l.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(),
572
+ validator: d.v$.name,
573
+ messages: l.messages.name,
574
+ "label-position": "inside",
575
+ expanded: ""
576
+ }, {
577
+ default: a(() => [
578
+ n(c, {
579
+ ref: "name",
580
+ modelValue: e.name,
581
+ "onUpdate:modelValue": t[12] || (t[12] = (o) => e.name = o),
582
+ placeholder: l.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"),
583
+ "show-loading": !0,
584
+ "search-enabled": s.searchEnabled,
585
+ onSetClient: t[13] || (t[13] = (o) => e.$emit("setClient", o))
586
+ }, null, 8, ["modelValue", "placeholder", "search-enabled"])
587
+ ]),
588
+ _: 1
589
+ }, 8, ["label", "validator", "messages"]),
590
+ n(m, {
591
+ label: l.isIndivid ? e.$t("_common:socialNo").capitalize() : e.$t("_common:orgNoShort").capitalize(),
592
+ validator: d.v$.orgNo,
593
+ messages: l.isIndivid ? l.messages.orgNo : l.messages.realOrgNo,
594
+ "label-position": "inside",
595
+ expanded: ""
596
+ }, {
597
+ default: a(() => [
598
+ n(p, {
599
+ ref: "orgNo",
600
+ modelValue: l.orgNo,
601
+ "onUpdate:modelValue": t[14] || (t[14] = (o) => l.orgNo = o),
602
+ placeholder: l.isIndivid ? e.$t("placeholders.socialNo") : e.$t("placeholders.orgNo")
603
+ }, null, 8, ["modelValue", "placeholder"])
604
+ ]),
605
+ _: 1
606
+ }, 8, ["label", "validator", "messages"])
607
+ ]),
608
+ _: 1
609
+ }),
610
+ n(S, null, {
611
+ default: a(() => [
612
+ e.type && !l.isIndivid ? (f(), b(m, {
613
+ key: 0,
614
+ validator: d.v$.reference,
615
+ messages: l.messages.reference,
616
+ label: e.$t("_common:reference").capitalize(),
617
+ "label-position": "inside",
618
+ class: "pb-4"
619
+ }, {
620
+ default: a(() => [
621
+ n(p, {
622
+ ref: "reference",
623
+ modelValue: e.reference,
624
+ "onUpdate:modelValue": t[15] || (t[15] = (o) => e.reference = o),
625
+ placeholder: e.$t("placeholders.reference")
626
+ }, null, 8, ["modelValue", "placeholder"])
627
+ ]),
628
+ _: 1
629
+ }, 8, ["validator", "messages", "label"])) : v("", !0),
630
+ e.type && !l.isIndivid && e.feature("reverseVat") && e.feature("regionSE") ? (f(), b(m, {
631
+ key: 1,
632
+ style: { "padding-left": "0.5em", "margin-bottom": "calc(2 * var(--rem))" }
633
+ }, {
634
+ default: a(() => [
635
+ n(W, {
636
+ modelValue: e.reverseVat,
637
+ "onUpdate:modelValue": t[16] || (t[16] = (o) => e.reverseVat = o),
638
+ size: "normal"
639
+ }, {
640
+ default: a(() => [
641
+ C(r(e.$t("_common:vat.reverseVat")), 1)
642
+ ]),
643
+ _: 1
644
+ }, 8, ["modelValue"])
645
+ ]),
646
+ _: 1
647
+ })) : v("", !0)
648
+ ]),
649
+ _: 1
650
+ }),
651
+ n(m, {
652
+ class: "flex",
653
+ grouped: ""
654
+ }, {
655
+ default: a(() => [
656
+ n(m, {
657
+ validator: d.v$.email,
658
+ messages: l.messages.email,
659
+ label: e.$t("_common:email").capitalize(),
660
+ "label-position": "inside",
661
+ class: "flex-1",
662
+ expanded: ""
663
+ }, {
664
+ default: a(() => [
665
+ n(p, {
666
+ ref: "email",
667
+ modelValue: e.email,
668
+ "onUpdate:modelValue": t[17] || (t[17] = (o) => e.email = o),
669
+ modelModifiers: { trim: !0 },
670
+ placeholder: e.$t("_common:email").capitalize()
671
+ }, null, 8, ["modelValue", "placeholder"])
672
+ ]),
673
+ _: 1
674
+ }, 8, ["validator", "messages", "label"]),
675
+ n(R, {
676
+ modelValue: e.cellphone,
677
+ "onUpdate:modelValue": t[18] || (t[18] = (o) => e.cellphone = o),
678
+ region: e.cellphoneRegion,
679
+ "onUpdate:region": t[19] || (t[19] = (o) => e.cellphoneRegion = o),
680
+ label: e.$t("_common:cellphone").capitalize(),
681
+ placeholder: e.$t("placeholders.cellphone"),
682
+ "default-region": e.companyRegion,
683
+ "label-position": "inside",
684
+ class: "h-full flex-1"
685
+ }, null, 8, ["modelValue", "region", "label", "placeholder", "default-region"])
686
+ ]),
687
+ _: 1
688
+ }),
689
+ n(m, {
690
+ label: e.$t("_common:address").capitalize(),
691
+ "label-position": "inside"
692
+ }, {
693
+ default: a(() => [
694
+ n(p, {
695
+ ref: "street",
696
+ modelValue: e.street,
697
+ "onUpdate:modelValue": t[20] || (t[20] = (o) => e.street = o),
698
+ placeholder: e.$t("placeholders.address")
699
+ }, null, 8, ["modelValue", "placeholder"])
700
+ ]),
701
+ _: 1
702
+ }, 8, ["label"]),
703
+ n(m, {
704
+ class: "force-two flex",
705
+ grouped: ""
706
+ }, {
707
+ default: a(() => [
708
+ n(m, { expanded: "" }, {
709
+ default: a(() => [
710
+ n(p, {
711
+ ref: "zip",
712
+ modelValue: e.zip,
713
+ "onUpdate:modelValue": t[21] || (t[21] = (o) => e.zip = o),
714
+ placeholder: e.$t("_common:zip").capitalize()
715
+ }, null, 8, ["modelValue", "placeholder"])
716
+ ]),
717
+ _: 1
718
+ }),
719
+ n(m, { expanded: "" }, {
720
+ default: a(() => [
721
+ n(p, {
722
+ ref: "city",
723
+ modelValue: e.city,
724
+ "onUpdate:modelValue": t[22] || (t[22] = (o) => e.city = o),
725
+ placeholder: e.$t("_common:city").capitalize()
726
+ }, null, 8, ["modelValue", "placeholder"])
727
+ ]),
728
+ _: 1
729
+ })
730
+ ]),
731
+ _: 1
732
+ }),
733
+ n(m, { class: "flex" }, {
734
+ default: a(() => [
735
+ n(D, {
736
+ modelValue: e.separateWorkAddress,
737
+ "onUpdate:modelValue": t[23] || (t[23] = (o) => e.separateWorkAddress = o),
738
+ "native-value": !1,
739
+ type: "secondary",
740
+ size: "small",
741
+ style: { "margin-bottom": "0.5em" }
742
+ }, {
743
+ default: a(() => [
744
+ C(r(e.$t("seperateWorkAddress.false")), 1)
745
+ ]),
746
+ _: 1
747
+ }, 8, ["modelValue"]),
748
+ n(D, {
749
+ modelValue: e.separateWorkAddress,
750
+ "onUpdate:modelValue": t[24] || (t[24] = (o) => e.separateWorkAddress = o),
751
+ "native-value": !0,
752
+ type: "secondary",
753
+ size: "small",
754
+ style: { "margin-bottom": "0.5em" }
755
+ }, {
756
+ default: a(() => [
757
+ C(r(e.$t("seperateWorkAddress.true")), 1)
758
+ ]),
759
+ _: 1
760
+ }, 8, ["modelValue"])
761
+ ]),
762
+ _: 1
763
+ }),
764
+ n(S, null, {
765
+ default: a(() => [
766
+ e.type && e.separateWorkAddress ? (f(), h("div", Oe, [
767
+ n(m, {
768
+ label: e.$t("_common:addressWork").capitalize() + ` ( ${e.$t("workAddressSubLabel")} )`
769
+ }, {
770
+ default: a(() => [
771
+ n(p, {
772
+ ref: "workStreet",
773
+ modelValue: e.workStreet,
774
+ "onUpdate:modelValue": t[25] || (t[25] = (o) => e.workStreet = o),
775
+ placeholder: e.$t("placeholders.address")
776
+ }, null, 8, ["modelValue", "placeholder"])
777
+ ]),
778
+ _: 1
779
+ }, 8, ["label"]),
780
+ n(m, {
781
+ class: "force-two flex",
782
+ grouped: ""
783
+ }, {
784
+ default: a(() => [
785
+ n(m, { expanded: "" }, {
786
+ default: a(() => [
787
+ n(p, {
788
+ ref: "workZip",
789
+ modelValue: e.workZip,
790
+ "onUpdate:modelValue": t[26] || (t[26] = (o) => e.workZip = o),
791
+ placeholder: e.$t("_common:zip").capitalize(),
792
+ expanded: ""
793
+ }, null, 8, ["modelValue", "placeholder"])
794
+ ]),
795
+ _: 1
796
+ }),
797
+ n(m, { expanded: "" }, {
798
+ default: a(() => [
799
+ n(p, {
800
+ ref: "workCity",
801
+ modelValue: e.workCity,
802
+ "onUpdate:modelValue": t[27] || (t[27] = (o) => e.workCity = o),
803
+ placeholder: e.$t("_common:city").capitalize(),
804
+ expanded: ""
805
+ }, null, 8, ["modelValue", "placeholder"])
806
+ ]),
807
+ _: 1
808
+ })
809
+ ]),
810
+ _: 1
811
+ })
812
+ ])) : v("", !0)
813
+ ]),
814
+ _: 1
815
+ }),
816
+ s.documentRole || s.answerMethod ? (f(), b(m, {
817
+ key: 0,
818
+ grouped: "",
819
+ class: "flex pt-4"
820
+ }, {
821
+ default: a(() => [
822
+ s.documentRole ? (f(), h("div", Fe, [
823
+ i("div", ze, r(e.$t("_common:documentRole.title")), 1),
824
+ n(M, {
825
+ expanded: "",
826
+ style: { "margin-bottom": "calc(1 * var(--rem))" }
827
+ }, {
828
+ trigger: a(() => [
829
+ n(w, {
830
+ "dropdown-icon": !0,
831
+ "icon-props": {
832
+ stroke: "hsl(0, 0%, 50%)"
833
+ },
834
+ "icon-left": s.documentRole === "signee" ? "pen-tool" : "eye",
835
+ class: "is-left",
836
+ type: "none",
837
+ pattern: "secondary",
838
+ expanded: ""
839
+ }, {
840
+ default: a(() => [
841
+ i("div", Re, [
842
+ i("div", null, r(e.$t(`_common:documentRole.${s.documentRole}.description`)), 1),
843
+ i("div", De, r(e.$t(`_common:documentRole.${s.documentRole}.label`)), 1)
844
+ ])
845
+ ]),
846
+ _: 1
847
+ }, 8, ["icon-left"])
848
+ ]),
849
+ default: a(() => [
850
+ (f(), h(O, null, F(["signee", "recipient", "approver"], (o) => n(I, {
851
+ key: o,
852
+ "icon-left": o === "signee" ? "pen-tool" : "eye",
853
+ "icon-props": {
854
+ stroke: "hsl(0, 0%, 50%)"
855
+ },
856
+ onClick: (U) => e.$emit("update:document-role", o)
857
+ }, {
858
+ default: a(() => [
859
+ i("div", Ue, [
860
+ i("div", null, r(e.$t(`_common:documentRole.${o}.description`)), 1),
861
+ i("div", qe, r(e.$t(`_common:documentRole.${o}.label`)), 1)
862
+ ])
863
+ ]),
864
+ _: 2
865
+ }, 1032, ["icon-left", "onClick"])), 64))
866
+ ]),
867
+ _: 1
868
+ })
869
+ ])) : v("", !0),
870
+ s.answerMethod ? (f(), h("div", Ae, [
871
+ i("div", Be, r(e.$t("_common:signMethod.title")), 1),
872
+ n(M, {
873
+ expanded: "",
874
+ style: { "margin-bottom": "calc(1 * var(--rem))" }
875
+ }, {
876
+ trigger: a(() => [
877
+ n(w, {
878
+ "dropdown-icon": !0,
879
+ class: "is-left",
880
+ type: "none",
881
+ pattern: "secondary",
882
+ expanded: ""
883
+ }, {
884
+ default: a(() => [
885
+ i("div", Ee, [
886
+ i("div", null, r(e.$t(`signMethod.${s.answerMethod.accept}.title`)), 1),
887
+ i("div", Pe, r(e.$t(`signMethod.${s.answerMethod.accept}.content`)), 1)
888
+ ])
889
+ ]),
890
+ _: 1
891
+ })
892
+ ]),
893
+ default: a(() => [
894
+ (f(!0), h(O, null, F(s.signOptions, (o) => (f(), b(I, {
895
+ key: o,
896
+ onClick: (U) => e.$emit("update:answer-method", {
897
+ ...s.answerMethod,
898
+ accept: o
899
+ })
900
+ }, {
901
+ default: a(() => [
902
+ i("div", Te, [
903
+ i("div", null, r(e.$t(`signMethod.${o}.title`)), 1),
904
+ i("div", We, r(e.$t(`signMethod.${o}.content`)), 1)
905
+ ])
906
+ ]),
907
+ _: 2
908
+ }, 1032, ["onClick"]))), 128))
909
+ ]),
910
+ _: 1
911
+ })
912
+ ])) : v("", !0)
913
+ ]),
914
+ _: 1
915
+ })) : v("", !0),
916
+ i("div", Le, [
917
+ n(w, {
918
+ loading: e.isPosting,
919
+ type: "secondary",
920
+ wide: "",
921
+ style: { padding: "16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0, 0, 0, 0.1)" },
922
+ onClick: l.validateForm
923
+ }, {
924
+ default: a(() => [
925
+ C(r(e.$t("updateButton")), 1)
926
+ ]),
927
+ _: 1
928
+ }, 8, ["loading", "onClick"])
929
+ ])
930
+ ], 2))
931
+ ]);
932
+ }
933
+ const Ze = /* @__PURE__ */ z(ye, [["render", je], ["__scopeId", "data-v-a49b2cec"]]), { mapFields: Ye } = B({
934
+ getterType: "forms/getField",
935
+ mutationType: "forms/updateField"
936
+ }), Ge = {
937
+ name: "ClientModal",
938
+ i18nOptions: {
939
+ namespaces: "clientModal",
940
+ messages: {
941
+ en: {
942
+ unsavedDialog: {
943
+ title: "Unsaved changes",
944
+ message: "Are you sure you want to cancel?",
945
+ cancel: "No",
946
+ submit: "Yes"
947
+ },
948
+ removeDialog: {
949
+ title: "Remove recipient",
950
+ message: "Would you like to remove recipient from the document?"
951
+ }
952
+ },
953
+ sv: {
954
+ unsavedDialog: {
955
+ title: "Osparade ändringar",
956
+ message: "Är du säker på att du vill avbryta?",
957
+ cancel: "Stanna kvar",
958
+ submit: "Ja, stäng"
959
+ },
960
+ removeDialog: {
961
+ title: "Ta bort mottagare",
962
+ message: "Vill du ta bort mottagaren från dokumentet?"
963
+ }
964
+ }
965
+ }
966
+ },
967
+ components: {
968
+ FormClient: Ze
969
+ },
970
+ emits: ["close"],
971
+ mixins: [P],
972
+ props: {
973
+ documentClientIndex: {
974
+ type: Number,
975
+ default: 0
976
+ },
977
+ inputFocusOnMount: {
978
+ type: String,
979
+ default: ""
980
+ },
981
+ forceExpand: {
982
+ type: Boolean,
983
+ default: !1
984
+ },
985
+ signOptions: {
986
+ type: Array,
987
+ default: () => ["signature", "inPerson"]
988
+ },
989
+ setFormValue: {
990
+ type: Function,
991
+ required: !0
992
+ },
993
+ removeFormValue: {
994
+ type: Function,
995
+ required: !0
996
+ },
997
+ // Optional prop if this modal is mounted from public form
998
+ isPublicForm: {
999
+ type: Boolean,
1000
+ default: !1
1001
+ }
1002
+ },
1003
+ data() {
1004
+ var t;
1005
+ let e = k(this.formData, "data.defaultAnswerMethod.accept") || "signature";
1006
+ return (t = this.signOptions) != null && t.length && !this.signOptions.includes(e) && ([e] = this.signOptions), {
1007
+ storedNewClient: {
1008
+ documentRole: "signee",
1009
+ answerMethod: {
1010
+ accept: e,
1011
+ deny: "button"
1012
+ }
1013
+ },
1014
+ isLoading: !1,
1015
+ hasChanged: !1,
1016
+ showMore: !1
1017
+ };
1018
+ },
1019
+ computed: {
1020
+ ...Ye({
1021
+ endCustomer: "endCustomer"
1022
+ }),
1023
+ ...Q("forms", {
1024
+ formData: (e) => e.document2
1025
+ }),
1026
+ ...E({
1027
+ can: "application/can",
1028
+ feature: "application/feature",
1029
+ defaultClientType: "endCustomers/defaultClientType"
1030
+ }),
1031
+ validateOrgNo() {
1032
+ return !!(this.feature("bankId") || this.isPublicForm && X[_.brand].defaultRegion === "SE");
1033
+ },
1034
+ existsOnDocument() {
1035
+ return !!k(this.formData, `clients[${this.documentClientIndex}]`);
1036
+ },
1037
+ useSignOrder() {
1038
+ return k(this.formData, "useSignOrder", !1);
1039
+ }
1040
+ },
1041
+ created() {
1042
+ this.forceExpand && (this.showMore = !0);
1043
+ const e = k(
1044
+ this.formData,
1045
+ `clients[${this.documentClientIndex}]`,
1046
+ {}
1047
+ );
1048
+ this.loadForm(e), ["endCustomer", "storedNewClient"].forEach(
1049
+ (t) => this.$watch(t, {
1050
+ deep: !0,
1051
+ handler() {
1052
+ this.hasChanged = !0;
1053
+ }
1054
+ })
1055
+ );
1056
+ },
1057
+ methods: {
1058
+ ...x({
1059
+ saveClient: q.FORM_SUBMIT_ENDCUSTOMER,
1060
+ showMessage: q.SHOW_MESSAGE
1061
+ }),
1062
+ omit: de,
1063
+ loadForm(e = {}) {
1064
+ this.storedNewClient = Object.assign(this.storedNewClient, e), this.endCustomer = ee({
1065
+ type: this.defaultClientType(),
1066
+ ...e
1067
+ });
1068
+ },
1069
+ async onSave() {
1070
+ var t, s;
1071
+ this.isLoading = !0;
1072
+ let e = k(this.endCustomer, "id");
1073
+ if (!this.isPublicForm) {
1074
+ let d = !1;
1075
+ this.endCustomer && (this.endCustomer.id ? this.can("endCustomers", "modify", this.endCustomer.id) && (d = !0) : this.can("endCustomers", "create") && (d = !0)), d && (e = await this.saveClient());
1076
+ }
1077
+ if (this.useSignOrder && !this.storedNewClient.signOrder) {
1078
+ const d = ((s = (t = this.formData) == null ? void 0 : t.clients) == null ? void 0 : s.reduce(
1079
+ (u, l) => l.signOrder > u ? l.signOrder : u,
1080
+ 0
1081
+ )) || 0;
1082
+ this.storedNewClient.signOrder = d + 1;
1083
+ }
1084
+ this.setFormValue({
1085
+ key: `clients[${this.documentClientIndex}]`,
1086
+ value: te(
1087
+ { ...this.endCustomer, ...e && { id: e } },
1088
+ { ...this.storedNewClient }
1089
+ )
1090
+ }), this.$emit("close"), this.isLoading = !1;
1091
+ },
1092
+ removeClient() {
1093
+ this.showMessage({
1094
+ displayType: "dialog",
1095
+ type: "danger",
1096
+ title: this.$t("removeDialog.title"),
1097
+ message: this.$t("removeDialog.message"),
1098
+ actions: {
1099
+ cancel: {
1100
+ text: this.$t("_common:cancel"),
1101
+ callback: "cancel"
1102
+ },
1103
+ submit: {
1104
+ text: this.$t("_common:remove"),
1105
+ callback: () => {
1106
+ this.removeFormValue(`clients[${this.documentClientIndex}]`), this.$emit("close");
1107
+ }
1108
+ }
1109
+ }
1110
+ });
1111
+ },
1112
+ close() {
1113
+ return !this.hasChanged || !this.showMore ? this.$emit("close") : this.showMessage({
1114
+ displayType: "dialog",
1115
+ type: "danger",
1116
+ title: this.$t("unsavedDialog.title"),
1117
+ message: this.$t("unsavedDialog.message"),
1118
+ actions: {
1119
+ cancel: {
1120
+ text: this.$t("unsavedDialog.cancel"),
1121
+ callback: "cancel"
1122
+ },
1123
+ submit: {
1124
+ text: this.$t("unsavedDialog.submit"),
1125
+ callback: () => this.$emit("close")
1126
+ }
1127
+ }
1128
+ });
1129
+ }
1130
+ }
1131
+ }, He = { class: "max-sm:h-initial relative mx-auto flex flex-col items-center rounded-xl bg-white p-10 text-lg max-sm:min-h-full max-sm:w-full max-sm:rounded-none max-sm:pt-16" };
1132
+ function Ke(e, t, s, d, u, l) {
1133
+ const c = g("CButton"), m = g("FormClient");
1134
+ return f(), h("div", {
1135
+ class: "font-primary fixed inset-0 z-[1000] grid place-items-center overflow-auto bg-black bg-opacity-10 max-sm:block max-sm:min-h-full max-sm:w-full max-sm:overflow-auto sm:py-4",
1136
+ onClickPassive: t[4] || (t[4] = N((...p) => l.close && l.close(...p), ["self"]))
1137
+ }, [
1138
+ i("div", He, [
1139
+ n(c, {
1140
+ class: y([u.showMore ? "" : "sm:!hidden", "z-2 absolute right-4 top-4"]),
1141
+ pattern: "tertiary",
1142
+ type: "none",
1143
+ circle: "",
1144
+ icon: "x",
1145
+ onClick: l.close
1146
+ }, null, 8, ["class", "onClick"]),
1147
+ n(m, {
1148
+ "document-role": u.storedNewClient.documentRole,
1149
+ "onUpdate:documentRole": t[0] || (t[0] = (p) => u.storedNewClient.documentRole = p),
1150
+ "answer-method": u.storedNewClient.answerMethod,
1151
+ "onUpdate:answerMethod": t[1] || (t[1] = (p) => u.storedNewClient.answerMethod = p),
1152
+ "search-enabled": !0,
1153
+ "require-reference": !1,
1154
+ "simple-form": !u.showMore,
1155
+ "input-focus-on-mount": s.inputFocusOnMount,
1156
+ "sign-options": s.signOptions,
1157
+ "validate-org-no": l.validateOrgNo,
1158
+ "is-public-form": s.isPublicForm,
1159
+ class: y([[u.showMore ? "w-[520px]" : "w-[360px]"], "max-w-full p-0"]),
1160
+ onSetClient: t[2] || (t[2] = (p) => l.loadForm(l.omit(p, ["answerMethod"]))),
1161
+ onSubmit: l.onSave,
1162
+ onShowMore: t[3] || (t[3] = (p) => u.showMore = !0)
1163
+ }, null, 8, ["document-role", "answer-method", "simple-form", "input-focus-on-mount", "sign-options", "validate-org-no", "is-public-form", "class", "onSubmit"]),
1164
+ l.existsOnDocument && e.mq === "sm" ? (f(), b(c, {
1165
+ key: 0,
1166
+ type: "danger",
1167
+ pattern: "secondary",
1168
+ wide: "",
1169
+ class: "mt-4 text-sm",
1170
+ onClick: l.removeClient
1171
+ }, {
1172
+ default: a(() => [
1173
+ C(r(e.$t("_common:remove")), 1)
1174
+ ]),
1175
+ _: 1
1176
+ }, 8, ["onClick"])) : v("", !0)
1177
+ ])
1178
+ ], 32);
1179
+ }
1180
+ const Je = /* @__PURE__ */ z(Ge, [["render", Ke]]), lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1181
+ __proto__: null,
1182
+ default: Je
1183
+ }, Symbol.toStringTag, { value: "Module" }));
1184
+ export {
1185
+ Je as C,
1186
+ ge as a,
1187
+ lt as b
1188
+ };