@cling-se/widget 1.0.0-beta.1 → 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 (241) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.internal.md +82 -0
  3. package/README.md +14 -40
  4. package/README.public.md +14 -0
  5. package/dist/AddClientCallout-e8d19R3f.js +101 -0
  6. package/dist/AnswerModal-BGvB8IVV.js +3291 -0
  7. package/dist/AttachmentItem-CkHbAm4l.js +171 -0
  8. package/dist/BaseUpload-BiJBcWRu.js +2472 -0
  9. package/dist/BlockMedia-CW5wgipC.js +103 -0
  10. package/dist/CCallout-Cy2eeIYd.js +104 -0
  11. package/dist/{CCurrencyDropdown-qH-3m2eP.js → CCurrencyDropdown-DE_3CTjm.js} +91 -49
  12. package/dist/CDropdownItem-Dmq5gYzA.js +751 -0
  13. package/dist/CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js +292 -0
  14. package/dist/{CPhoneFormat-CfQayFxw.js → CPhoneFormat-BS2nP9kc.js} +13 -21
  15. package/dist/CPhoneInput-Bf6329PO.js +207 -0
  16. package/dist/CPriceInput-d1yjuMQr.js +140 -0
  17. package/dist/CSelect-DgnT07Hk.js +98 -0
  18. package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-Ckl--dyv.js +51 -0
  19. package/dist/ClientAutocomplete-9JzGcO9O.js +532 -0
  20. package/dist/ClientModal-BzWQtWSZ.js +1181 -0
  21. package/dist/ColorPicker-BvoFN8nu.js +1408 -0
  22. package/dist/CompanyModal-Bp4V_az9.js +250 -0
  23. package/dist/ContentWrapper-CuH6xKmo.js +265 -0
  24. package/dist/CoverBlockSettings-BA5L0Zee.js +861 -0
  25. package/dist/DocAnswer-BcNA_KEg.js +33 -0
  26. package/dist/DocDetails-CStEwWnU.js +448 -0
  27. package/dist/DocForm-BOoILf5E.js +6748 -0
  28. package/dist/DocFormSend-CQIf-HJY.js +171 -0
  29. package/dist/DocLinks-BRX5QzNe.js +36 -0
  30. package/dist/DocModalBase-D72yWj-x.js +29 -0
  31. package/dist/DocPrint-BI1LXUPE.js +399 -0
  32. package/dist/DocReceipt-DaZ4V76p.js +341 -0
  33. package/dist/DocSendReminder-DKGZlo7s.js +181 -0
  34. package/dist/DocTextEditor-Dm-cTZpA.js +19413 -0
  35. package/dist/DocTimeline-DCwofzuk.js +537 -0
  36. package/dist/DocumentClient-vJdxCB53.js +90 -0
  37. package/dist/DocumentLayout-CKSi42ev.js +1368 -0
  38. package/dist/DocumentLogotype-DbQlvQ-y.js +162 -0
  39. package/dist/DocumentVoided-CRX2WxWO.js +33 -0
  40. package/dist/EmbedInput-B-oeC4Wy.js +157 -0
  41. package/dist/EmbedSettings-B9Yka2yB.js +103 -0
  42. package/dist/ErrorCallout-B_ygH33E.js +34 -0
  43. package/dist/FilePreviewModal-Bf3ELTow.js +202 -0
  44. package/dist/Flag-BwTgCNHO.js +41 -0
  45. package/dist/HeaderSettings-DvC7nlyY.js +720 -0
  46. package/dist/ImageSelectModal-D3sP3lhR.js +119 -0
  47. package/dist/ImageUploadWrapper-RWNa-yIq.js +1585 -0
  48. package/dist/Index-0_3ULrWX.js +126 -0
  49. package/dist/Index-4NPe0sfX.js +629 -0
  50. package/dist/Index-B1uA0FF6.js +4 -0
  51. package/dist/Index-BBkCYm2q.js +201 -0
  52. package/dist/{Index-DIOiMm9f.js → Index-BBwvo7S9.js} +10 -18
  53. package/dist/Index-BEMlsYwJ.js +68 -0
  54. package/dist/Index-BRBhJ6kz.js +21 -0
  55. package/dist/{Index--qPMWUMT.js → Index-BTFmHjUt.js} +48 -61
  56. package/dist/Index-BcUNnxLC.js +1098 -0
  57. package/dist/Index-Bo6ExBUL.js +93 -0
  58. package/dist/Index-BvMPCgdH.js +102 -0
  59. package/dist/Index-Bx5TOI9k.js +74 -0
  60. package/dist/Index-C7GZS8EI.js +16 -0
  61. package/dist/Index-CNWhm07R.js +25 -0
  62. package/dist/{Index-DcQbh-z2.js → Index-CQpznMKV.js} +9 -17
  63. package/dist/Index-CRzsnIij.js +159 -0
  64. package/dist/Index-CeSG1C41.js +140 -0
  65. package/dist/Index-CjfjdZj5.js +52 -0
  66. package/dist/Index-CskKmZpd.js +363 -0
  67. package/dist/Index-D5qwbCo1.js +28 -0
  68. package/dist/Index-D8Ae1Txt.js +228 -0
  69. package/dist/Index-DE8aenDB.js +3452 -0
  70. package/dist/Index-DI5EB5Rt.js +39 -0
  71. package/dist/Index-DaV57YPP.js +163 -0
  72. package/dist/Index-DbwkmoyM.js +38 -0
  73. package/dist/Index-Df9skok6.js +70 -0
  74. package/dist/{Index-Bu0MGrj6.js → Index-DfLLA0ij.js} +313 -206
  75. package/dist/Index-Dw1CO5F9.js +76 -0
  76. package/dist/Index-PZXyOoVb.js +87 -0
  77. package/dist/{Index-D4XgxmbD.js → Index-ZUnH-BHj.js} +10 -18
  78. package/dist/Index-cjKGSiDi.js +136 -0
  79. package/dist/Index-m-goRuKD.js +49 -0
  80. package/dist/Index-rGeWbLcB.js +47 -0
  81. package/dist/Index-vrljNp6G.js +28 -0
  82. package/dist/Index.vue_vue_type_script_lang-aeVuChGF.js +671 -0
  83. package/dist/InputToggleRow-v6qAWPg6.js +99 -0
  84. package/dist/ManualPopover-BONBJIUA.js +57 -0
  85. package/dist/MediaWrapper-CXb2UGd9.js +18 -0
  86. package/dist/{NotBindingText-CNV2Wmdx.js → NotBindingText-BqESO13N.js} +13 -17
  87. package/dist/PackageGroup-AIysVmyh.js +1058 -0
  88. package/dist/PdfTerms-BlhHdTu3.js +34 -0
  89. package/dist/PdfViewer-DwZ1rwlN.js +392 -0
  90. package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6NNUTz0.js +17 -0
  91. package/dist/PriceHeader-C4XhnoA3.js +488 -0
  92. package/dist/SearchApi-B7lXgUY6.js +137 -0
  93. package/dist/SendForm-BcD0xSvB.js +7031 -0
  94. package/dist/Setup-C2qaYDei.js +47 -0
  95. package/dist/{SmartList-Qgu0rMrI.js → SmartList-DqG7Q5t7.js} +16 -24
  96. package/dist/Sortable.vue_vue_type_script_setup_true_lang-CzMbr8AX.js +1303 -0
  97. package/dist/{TermsSettings-CE3h_xkm.js → TermsSettings-BOCONyM4.js} +169 -49
  98. package/dist/ThemeColorRow-sjGdMzGN.js +108 -0
  99. package/dist/ToggleBinding-7oq_oXPt.js +44 -0
  100. package/dist/UploadModal-C_X2NjVY.js +134 -0
  101. package/dist/VideoPlayerInput-BsUcmpl4.js +135 -0
  102. package/dist/VideoPlayerSettings-BXMmxaZQ.js +78 -0
  103. package/dist/VideoSelectModal-CW0OweCw.js +217 -0
  104. package/dist/{anime.es-BrPTThYb.js → anime.es-gdcpA-eY.js} +1 -2
  105. package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
  106. package/dist/{debounce-C1AuSpOZ.js → debounce-DNl99Gyo.js} +7 -7
  107. package/dist/dom-CkTGWrfu.js +69 -0
  108. package/dist/{focusDrawerMixin-Be6BAK8-.js → focusDrawerMixin-BwcErMDY.js} +1 -1
  109. package/dist/{formDrawerState-DRbg5rVI.js → formDrawerState-DaurePnd.js} +2 -2
  110. package/dist/helpers-CPW--XIz.js +44 -0
  111. package/dist/index-BjiGCJPI.js +149 -0
  112. package/dist/index-CFNv6OvX.js +188 -0
  113. package/dist/index-Cx71On5Z.js +508 -0
  114. package/dist/index-DKMxIBz_.js +270 -0
  115. package/dist/index-DKf5SGLD.js +125 -0
  116. package/dist/index-E32WgUp9.js +3525 -0
  117. package/dist/index-kp-GC5I0.js +513 -0
  118. package/dist/index.es.js +2 -5
  119. package/dist/index.umd.js +306 -1505
  120. package/dist/{main-WKzC-Dnu.js → main-Cb-nyil1.js} +33252 -33755
  121. package/dist/mapFormMixin-D3BihYWW.js +1544 -0
  122. package/dist/omit--YYr41Xp.js +31 -0
  123. package/dist/{publicSenderState-BujjYsZZ.js → publicSenderState-CdRW_Wwp.js} +4 -4
  124. package/dist/regions-BdZt9Srn.js +1250 -0
  125. package/dist/splitpanes-D-ThFkeR.js +342 -0
  126. package/dist/style.css +1 -4
  127. package/dist/template-BvaNnq-g.js +1493 -0
  128. package/dist/{throttle-CWPJmFid.js → throttle-D-bUGaVh.js} +2 -2
  129. package/dist/tippy.esm-BmKNqohP.js +1994 -0
  130. package/dist/useTermsModal-Dhf6_eYb.js +87 -0
  131. package/dist/{utils-CA_Zy6u1.js → utils-CBPcYdLv.js} +8 -11
  132. package/dist/validation-DOcUOoMe.js +40 -0
  133. package/package.json +25 -31
  134. package/.eslintrc.cjs +0 -4
  135. package/dist/AddClientCallout-BWnvyBcK.js +0 -46
  136. package/dist/AnswerModal-CLGRdSnK.js +0 -3874
  137. package/dist/AttachmentItem-BPS0-wyc.js +0 -78
  138. package/dist/BaseDatePicker-BbmV_GdD.js +0 -3183
  139. package/dist/BaseUpload-9gPgI7r6.js +0 -1977
  140. package/dist/BlockMedia-DkPFWiYL.js +0 -76
  141. package/dist/CCallout-T26jwUby.js +0 -59
  142. package/dist/CDropdownItem-BE8BAMD1.js +0 -636
  143. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
  144. package/dist/CFormField-DECEfoVq.js +0 -241
  145. package/dist/CPriceInput-C4SOB-P5.js +0 -112
  146. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
  147. package/dist/ClientAutocomplete-DSebA1Mx.js +0 -78
  148. package/dist/ClientModal-BXFYvYCF.js +0 -625
  149. package/dist/ColorPicker-CZ_bJabP.js +0 -2879
  150. package/dist/CompanyModal-CDr3t28n.js +0 -141
  151. package/dist/ContentWrapper-BwmMoe4W.js +0 -183
  152. package/dist/CoverBlockSettings-_F11-DGc.js +0 -275
  153. package/dist/DocAnswer-BR59xzkT.js +0 -36
  154. package/dist/DocDetails-D1qbCbps.js +0 -259
  155. package/dist/DocForm-DBc2a7z5.js +0 -7272
  156. package/dist/DocFormSend-Casix-yG.js +0 -144
  157. package/dist/DocLinks-DGTaewyX.js +0 -38
  158. package/dist/DocModalBase-BbS_qvSv.js +0 -28
  159. package/dist/DocPrint-0PqX3mbJ.js +0 -240
  160. package/dist/DocReceipt-CU3VD5pt.js +0 -210
  161. package/dist/DocSendReminder-CuycBspr.js +0 -137
  162. package/dist/DocTextEditor-CntS2Bd-.js +0 -17180
  163. package/dist/DocTimeline-DJuv3yBe.js +0 -481
  164. package/dist/DocumentClient-C25XXzz6.js +0 -136
  165. package/dist/DocumentLayout-B7afHRMr.js +0 -4909
  166. package/dist/DocumentLogotype-sqI51wvM.js +0 -87
  167. package/dist/DocumentVoided-TahdTSMn.js +0 -25
  168. package/dist/EmbedInput-BY-wHSfc.js +0 -113
  169. package/dist/EmbedSettings-8pfjk4NP.js +0 -72
  170. package/dist/ErrorCallout-Dsr8PNsU.js +0 -28
  171. package/dist/FilePreviewModal-CcEinEFg.js +0 -81
  172. package/dist/Flag-PJKrghi9.js +0 -114
  173. package/dist/HeaderSettings-BqczIOsG.js +0 -392
  174. package/dist/ImageSelectModal-Cd-HhKnH.js +0 -84
  175. package/dist/ImageUploadWrapper-Dv43rGdb.js +0 -1604
  176. package/dist/Index-6b5VBKE-.js +0 -107
  177. package/dist/Index-B4pRJnbw.js +0 -84
  178. package/dist/Index-B69f8qgZ.js +0 -62
  179. package/dist/Index-B79YN9RO.js +0 -25
  180. package/dist/Index-BBrlPoe8.js +0 -58
  181. package/dist/Index-BXfWJCuq.js +0 -52
  182. package/dist/Index-Bd76vb37.js +0 -55
  183. package/dist/Index-BmbtQO5F.js +0 -150
  184. package/dist/Index-ByV_kJaH.js +0 -77
  185. package/dist/Index-CDV5rhWS.js +0 -49
  186. package/dist/Index-CIx4OOK-.js +0 -144
  187. package/dist/Index-CL1OWLt6.js +0 -223
  188. package/dist/Index-Caow0eZu.js +0 -31
  189. package/dist/Index-Cd3-3PEK.js +0 -2402
  190. package/dist/Index-CdpZBEKU.js +0 -98
  191. package/dist/Index-CmU3Sys-.js +0 -754
  192. package/dist/Index-CtRtgnpm.js +0 -32
  193. package/dist/Index-Cukkr33D.js +0 -140
  194. package/dist/Index-Cuqw0ios.js +0 -57
  195. package/dist/Index-Czm_WdqC.js +0 -25
  196. package/dist/Index-DNdYXHgr.js +0 -33
  197. package/dist/Index-DcuBxutp.js +0 -642
  198. package/dist/Index-DpWNWiyY.js +0 -291
  199. package/dist/Index-DzS1rZdF.js +0 -24
  200. package/dist/Index-N6s5pZxv.js +0 -26
  201. package/dist/Index-g_DNu4mt.js +0 -69
  202. package/dist/Index-mJ8F41GY.js +0 -154
  203. package/dist/Index-q7W9KA8m.js +0 -21
  204. package/dist/Index-rtzblZp4.js +0 -70
  205. package/dist/InputToggleRow-CZjxsDOQ.js +0 -57
  206. package/dist/ManualPopover-CZrWiT-P.js +0 -58
  207. package/dist/MediaWrapper-D37qK4KR.js +0 -23
  208. package/dist/PackageGroup-Heo_s8ct.js +0 -699
  209. package/dist/PdfTerms-AB9tXAtU.js +0 -36
  210. package/dist/PdfViewer-CIVkvOBr.js +0 -373
  211. package/dist/PlainHtml-CPmIebjY.js +0 -20
  212. package/dist/PriceHeader-DhDAruwX.js +0 -339
  213. package/dist/SearchApi-BMgdaI4s.js +0 -161
  214. package/dist/Setup-VIaIV9uT.js +0 -50
  215. package/dist/ThemeColorRow-DYJNgk6S.js +0 -67
  216. package/dist/ToggleBinding-CuwCeYpO.js +0 -38
  217. package/dist/UploadModal-BITcxG-J.js +0 -95
  218. package/dist/VideoPlayerInput-8szEX_8L.js +0 -93
  219. package/dist/VideoPlayerSettings-BIPytm6w.js +0 -61
  220. package/dist/VideoSelectModal-B-Pe34nb.js +0 -100
  221. package/dist/answerDocumentMixin-W7vE1Gp4.js +0 -51
  222. package/dist/formComponentsInstall-Bm3VMOh6.js +0 -2507
  223. package/dist/formValidationMixin-COkY8COk.js +0 -49
  224. package/dist/index-BFvjENMH.js +0 -81
  225. package/dist/index-BV2nGWay.js +0 -492
  226. package/dist/index-BgJ05dYc.js +0 -165
  227. package/dist/index-CMPAXxzs.js +0 -347
  228. package/dist/index-DNDjI5uI.js +0 -3916
  229. package/dist/index-aoff9oUi.js +0 -102
  230. package/dist/mapFormMixin-QbevCwJK.js +0 -72
  231. package/dist/omit-CTp9CXoU.js +0 -31
  232. package/dist/splitpanes-BHUVsCZF.js +0 -382
  233. package/dist/tinycolor-kTl0yxzz.js +0 -633
  234. package/dist/tippy.esm-sS5koDSU.js +0 -1799
  235. package/dist/vuedraggable.umd-BA3ZDRAp.js +0 -3161
  236. package/dist/vuex.esm-DKGl8mcw.js +0 -467
  237. package/public/favicon.ico +0 -0
  238. package/tsconfig.json +0 -26
  239. package/tsconfig.node.json +0 -10
  240. package/tsconfig.paths.json +0 -17
  241. package/vite.config.ts +0 -60
@@ -0,0 +1,1181 @@
1
+ import { C as L } from "./ClientAutocomplete-9JzGcO9O.js";
2
+ import { _ as z, b5 as j, o as p, d as h, E as Z, b6 as Y, s as i, ao as N, n as y, S as G, af as H, ar as B, a8 as K, m as P, a5 as J, b as g, v as r, e as n, w as a, c as b, f as v, F, k as O, B as C, aa as $, as as Q, D as X, p as _, a as x, g as q, bb as ee, aF as te } from "./main-Cb-nyil1.js";
3
+ import { C as oe, a as ne, w as E } from "./CDropdownItem-Dmq5gYzA.js";
4
+ import { _ as le } from "./CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js";
5
+ import { C as ae } from "./CPhoneInput-Bf6329PO.js";
6
+ import { u as ie } from "./index-kp-GC5I0.js";
7
+ import { r as se, a as k, e as re } from "./index-BjiGCJPI.js";
8
+ import { o as de } from "./omit--YYr41Xp.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, f, c, l) {
14
+ return p(), 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] = (...u) => e.focus && e.focus(...u)),
19
+ onKeydown: t[3] || (t[3] = H(N((u) => e.$refs.label.click(), ["prevent"]), ["enter"]))
20
+ }, [
21
+ Z(i("input", {
22
+ ref: "input",
23
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => e.computedValue = u),
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 f = t.length, c = f % 2;
49
+ let l, u;
50
+ for (l = 0; l < f; l += 1)
51
+ u = parseInt(t.charAt(l), 10), l % 2 === c && (u *= 2), u > 9 && (u -= 9), s += u;
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 c = t.substring(0, 2), l = (/* @__PURE__ */ new Date()).getFullYear(), u = parseInt(
66
+ l.toString().substring(2, 2),
67
+ 10
68
+ );
69
+ parseInt(c, 10) === 19 || parseInt(c, 10) === 20 || (parseInt(c, 10) >= 0 && parseInt(c, 10) <= u ? 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: [E],
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: k(this.requireReference && !this.isIndivid)
274
+ },
275
+ email: {
276
+ email: re
277
+ }
278
+ } : {
279
+ name: {
280
+ required: se
281
+ },
282
+ orgNo: {
283
+ required: k(this.type === "company")
284
+ },
285
+ cellphone: {
286
+ required: k(!this.isIndivid)
287
+ },
288
+ reference: {
289
+ required: k(!this.isIndivid)
290
+ },
291
+ email: {
292
+ required: k(!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
+ ...P({
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, f;
361
+ const e = this.$refs[this.inputFocusOnMount] || this.$refs.name;
362
+ (f = (s = (t = e == null ? void 0 : e.$el) == null ? void 0 : t.nextElementSibling) == null ? void 0 : s.querySelector("input")) == null || f.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" } }, Ie = { style: { "font-size": "12px", opacity: "0.7" } }, Me = {
373
+ class: "flex items-center justify-center",
374
+ style: { "margin-bottom": "calc(2.5 * var(--rem))" }
375
+ }, Se = { class: "type-toggle" }, Fe = { key: 0 }, Oe = {
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" }, Pe = { class: "max-w-[calc(16_*_var(--rem))] py-1 leading-5" }, Ee = { 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, f, c, l) {
386
+ const u = g("ClientAutocomplete"), d = g("CField"), m = g("CInput"), I = g("Animation"), R = g("CPhoneInput"), w = g("CButton"), M = g("CDropdownItem"), S = g("CDropdown"), W = g("CCheckbox"), D = g("CRadio");
387
+ return p(), h("div", be, [
388
+ s.simpleForm ? (p(), 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(d, {
406
+ label: l.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(),
407
+ validator: f.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(u, {
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(I, null, {
426
+ default: a(() => [
427
+ l.isIndivid ? v("", !0) : (p(), b(d, {
428
+ key: 0,
429
+ validator: f.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(m, {
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(d, {
449
+ validator: f.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(m, {
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 ? (p(), b(S, {
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
+ (p(), h(F, null, O(["signee", "recipient", "approver"], (o) => n(M, {
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", Ie, 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)) : (p(), h("div", {
550
+ key: 1,
551
+ class: y({ "column-only": e.windowWidth <= 600 })
552
+ }, [
553
+ i("div", Me, [
554
+ i("div", Se, [
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(d, {
566
+ class: "flex",
567
+ grouped: ""
568
+ }, {
569
+ default: a(() => [
570
+ n(d, {
571
+ label: l.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(),
572
+ validator: f.v$.name,
573
+ messages: l.messages.name,
574
+ "label-position": "inside",
575
+ expanded: ""
576
+ }, {
577
+ default: a(() => [
578
+ n(u, {
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(d, {
591
+ label: l.isIndivid ? e.$t("_common:socialNo").capitalize() : e.$t("_common:orgNoShort").capitalize(),
592
+ validator: f.v$.orgNo,
593
+ messages: l.isIndivid ? l.messages.orgNo : l.messages.realOrgNo,
594
+ "label-position": "inside",
595
+ expanded: ""
596
+ }, {
597
+ default: a(() => [
598
+ n(m, {
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(I, null, {
611
+ default: a(() => [
612
+ e.type && !l.isIndivid ? (p(), b(d, {
613
+ key: 0,
614
+ validator: f.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(m, {
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") ? (p(), b(d, {
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(d, {
652
+ class: "flex",
653
+ grouped: ""
654
+ }, {
655
+ default: a(() => [
656
+ n(d, {
657
+ validator: f.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(m, {
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(d, {
690
+ label: e.$t("_common:address").capitalize(),
691
+ "label-position": "inside"
692
+ }, {
693
+ default: a(() => [
694
+ n(m, {
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(d, {
704
+ class: "force-two flex",
705
+ grouped: ""
706
+ }, {
707
+ default: a(() => [
708
+ n(d, { expanded: "" }, {
709
+ default: a(() => [
710
+ n(m, {
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(d, { expanded: "" }, {
720
+ default: a(() => [
721
+ n(m, {
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(d, { 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(I, null, {
765
+ default: a(() => [
766
+ e.type && e.separateWorkAddress ? (p(), h("div", Fe, [
767
+ n(d, {
768
+ label: e.$t("_common:addressWork").capitalize() + ` ( ${e.$t("workAddressSubLabel")} )`
769
+ }, {
770
+ default: a(() => [
771
+ n(m, {
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(d, {
781
+ class: "force-two flex",
782
+ grouped: ""
783
+ }, {
784
+ default: a(() => [
785
+ n(d, { expanded: "" }, {
786
+ default: a(() => [
787
+ n(m, {
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(d, { expanded: "" }, {
798
+ default: a(() => [
799
+ n(m, {
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 ? (p(), b(d, {
817
+ key: 0,
818
+ grouped: "",
819
+ class: "flex pt-4"
820
+ }, {
821
+ default: a(() => [
822
+ s.documentRole ? (p(), h("div", Oe, [
823
+ i("div", ze, r(e.$t("_common:documentRole.title")), 1),
824
+ n(S, {
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
+ (p(), h(F, null, O(["signee", "recipient", "approver"], (o) => n(M, {
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 ? (p(), h("div", Ae, [
871
+ i("div", Be, r(e.$t("_common:signMethod.title")), 1),
872
+ n(S, {
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", Pe, [
886
+ i("div", null, r(e.$t(`signMethod.${s.answerMethod.accept}.title`)), 1),
887
+ i("div", Ee, r(e.$t(`signMethod.${s.answerMethod.accept}.content`)), 1)
888
+ ])
889
+ ]),
890
+ _: 1
891
+ })
892
+ ]),
893
+ default: a(() => [
894
+ (p(!0), h(F, null, O(s.signOptions, (o) => (p(), b(M, {
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: [E],
972
+ props: {
973
+ documentClientIndex: {
974
+ type: Number,
975
+ default: 0
976
+ },
977
+ signOrder: {
978
+ type: Number,
979
+ default: 0
980
+ },
981
+ inputFocusOnMount: {
982
+ type: String,
983
+ default: ""
984
+ },
985
+ forceExpand: {
986
+ type: Boolean,
987
+ default: !1
988
+ },
989
+ signOptions: {
990
+ type: Array,
991
+ default: () => ["signature", "inPerson"]
992
+ },
993
+ setFormValue: {
994
+ type: Function,
995
+ required: !0
996
+ },
997
+ removeFormValue: {
998
+ type: Function,
999
+ required: !0
1000
+ },
1001
+ // Optional prop if this modal is mounted from public form
1002
+ isPublicForm: {
1003
+ type: Boolean,
1004
+ default: !1
1005
+ }
1006
+ },
1007
+ data() {
1008
+ var t;
1009
+ let e = $(this.formData, "data.defaultAnswerMethod.accept") || "signature";
1010
+ return (t = this.signOptions) != null && t.length && !this.signOptions.includes(e) && ([e] = this.signOptions), {
1011
+ storedNewClient: {
1012
+ documentRole: "signee",
1013
+ answerMethod: {
1014
+ accept: e,
1015
+ deny: "button"
1016
+ }
1017
+ },
1018
+ isLoading: !1,
1019
+ hasChanged: !1,
1020
+ showMore: !1
1021
+ };
1022
+ },
1023
+ computed: {
1024
+ ...Ye({
1025
+ endCustomer: "endCustomer"
1026
+ }),
1027
+ ...Q("forms", {
1028
+ formData: (e) => e.document2
1029
+ }),
1030
+ ...P({
1031
+ can: "application/can",
1032
+ feature: "application/feature",
1033
+ defaultClientType: "endCustomers/defaultClientType"
1034
+ }),
1035
+ validateOrgNo() {
1036
+ return !!(this.feature("bankId") || this.isPublicForm && X[_.brand].defaultRegion === "SE");
1037
+ },
1038
+ existsOnDocument() {
1039
+ return !!$(this.formData, `clients[${this.documentClientIndex}]`);
1040
+ }
1041
+ },
1042
+ created() {
1043
+ this.forceExpand && (this.showMore = !0);
1044
+ const e = $(
1045
+ this.formData,
1046
+ `clients[${this.documentClientIndex}]`,
1047
+ {}
1048
+ );
1049
+ this.loadForm(e), ["endCustomer", "storedNewClient"].forEach(
1050
+ (t) => this.$watch(t, {
1051
+ deep: !0,
1052
+ handler() {
1053
+ this.hasChanged = !0;
1054
+ }
1055
+ })
1056
+ );
1057
+ },
1058
+ methods: {
1059
+ ...x({
1060
+ saveClient: q.FORM_SUBMIT_ENDCUSTOMER,
1061
+ showMessage: q.SHOW_MESSAGE
1062
+ }),
1063
+ omit: de,
1064
+ loadForm(e = {}) {
1065
+ this.storedNewClient = Object.assign(this.storedNewClient, e), this.endCustomer = ee({
1066
+ type: this.defaultClientType(),
1067
+ ...e
1068
+ });
1069
+ },
1070
+ async onSave() {
1071
+ this.isLoading = !0;
1072
+ let e = $(this.endCustomer, "id");
1073
+ if (!this.isPublicForm) {
1074
+ let t = !1;
1075
+ this.endCustomer && (this.endCustomer.id ? this.can("endCustomers", "modify", this.endCustomer.id) && (t = !0) : this.can("endCustomers", "create") && (t = !0)), t && (e = await this.saveClient());
1076
+ }
1077
+ this.setFormValue({
1078
+ key: `clients[${this.documentClientIndex}]`,
1079
+ value: te(
1080
+ { ...this.endCustomer, ...e && { id: e } },
1081
+ { ...this.storedNewClient, signOrder: this.signOrder }
1082
+ )
1083
+ }), this.$emit("close"), this.isLoading = !1;
1084
+ },
1085
+ removeClient() {
1086
+ this.showMessage({
1087
+ displayType: "dialog",
1088
+ type: "danger",
1089
+ title: this.$t("removeDialog.title"),
1090
+ message: this.$t("removeDialog.message"),
1091
+ actions: {
1092
+ cancel: {
1093
+ text: this.$t("_common:cancel"),
1094
+ callback: "cancel"
1095
+ },
1096
+ submit: {
1097
+ text: this.$t("_common:remove"),
1098
+ callback: () => {
1099
+ this.removeFormValue(`clients[${this.documentClientIndex}]`), this.$emit("close");
1100
+ }
1101
+ }
1102
+ }
1103
+ });
1104
+ },
1105
+ close() {
1106
+ return !this.hasChanged || !this.showMore ? this.$emit("close") : this.showMessage({
1107
+ displayType: "dialog",
1108
+ type: "danger",
1109
+ title: this.$t("unsavedDialog.title"),
1110
+ message: this.$t("unsavedDialog.message"),
1111
+ actions: {
1112
+ cancel: {
1113
+ text: this.$t("unsavedDialog.cancel"),
1114
+ callback: "cancel"
1115
+ },
1116
+ submit: {
1117
+ text: this.$t("unsavedDialog.submit"),
1118
+ callback: () => this.$emit("close")
1119
+ }
1120
+ }
1121
+ });
1122
+ }
1123
+ }
1124
+ }, 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" };
1125
+ function Ke(e, t, s, f, c, l) {
1126
+ const u = g("CButton"), d = g("FormClient");
1127
+ return p(), h("div", {
1128
+ 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",
1129
+ onClickPassive: t[4] || (t[4] = N((...m) => l.close && l.close(...m), ["self"]))
1130
+ }, [
1131
+ i("div", He, [
1132
+ n(u, {
1133
+ class: y([c.showMore ? "" : "sm:!hidden", "z-2 absolute right-4 top-4"]),
1134
+ pattern: "tertiary",
1135
+ type: "none",
1136
+ circle: "",
1137
+ icon: "x",
1138
+ onClick: l.close
1139
+ }, null, 8, ["class", "onClick"]),
1140
+ n(d, {
1141
+ "document-role": c.storedNewClient.documentRole,
1142
+ "onUpdate:documentRole": t[0] || (t[0] = (m) => c.storedNewClient.documentRole = m),
1143
+ "answer-method": c.storedNewClient.answerMethod,
1144
+ "onUpdate:answerMethod": t[1] || (t[1] = (m) => c.storedNewClient.answerMethod = m),
1145
+ "search-enabled": !0,
1146
+ "require-reference": !1,
1147
+ "simple-form": !c.showMore,
1148
+ "input-focus-on-mount": s.inputFocusOnMount,
1149
+ "sign-options": s.signOptions,
1150
+ "validate-org-no": l.validateOrgNo,
1151
+ "is-public-form": s.isPublicForm,
1152
+ class: y([[c.showMore ? "w-[520px]" : "w-[360px]"], "max-w-full p-0"]),
1153
+ onSetClient: t[2] || (t[2] = (m) => l.loadForm(l.omit(m, ["answerMethod"]))),
1154
+ onSubmit: l.onSave,
1155
+ onShowMore: t[3] || (t[3] = (m) => c.showMore = !0)
1156
+ }, null, 8, ["document-role", "answer-method", "simple-form", "input-focus-on-mount", "sign-options", "validate-org-no", "is-public-form", "class", "onSubmit"]),
1157
+ l.existsOnDocument && e.mq === "sm" ? (p(), b(u, {
1158
+ key: 0,
1159
+ type: "danger",
1160
+ pattern: "secondary",
1161
+ wide: "",
1162
+ class: "mt-4 text-sm",
1163
+ onClick: l.removeClient
1164
+ }, {
1165
+ default: a(() => [
1166
+ C(r(e.$t("_common:remove")), 1)
1167
+ ]),
1168
+ _: 1
1169
+ }, 8, ["onClick"])) : v("", !0)
1170
+ ])
1171
+ ], 32);
1172
+ }
1173
+ const Je = /* @__PURE__ */ z(Ge, [["render", Ke]]), lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1174
+ __proto__: null,
1175
+ default: Je
1176
+ }, Symbol.toStringTag, { value: "Module" }));
1177
+ export {
1178
+ Je as C,
1179
+ ge as a,
1180
+ lt as b
1181
+ };