@cling-se/widget 0.9.1 → 0.9.3

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 (132) hide show
  1. package/dist/AddClientCallout-746899d9.js +57 -0
  2. package/dist/{AnswerModal-c22c6729.js → AnswerModal-fdfea0f8.js} +7 -5
  3. package/dist/{AttachmentItem-ab7c264b.js → AttachmentItem-5671c64d.js} +5 -7
  4. package/dist/BaseDatePicker-a9240306.js +3156 -0
  5. package/dist/{BaseInput-2b048506.js → BaseInput-d3c3688b.js} +4 -4
  6. package/dist/{BaseUpload-869cbd9a.js → BaseUpload-8e7a2b72.js} +3 -3
  7. package/dist/BlockMedia-b613a2a4.js +72 -0
  8. package/dist/CCallout-e9ff903a.js +52 -0
  9. package/dist/CDropdownItem-05d84f95.js +610 -0
  10. package/dist/CField-cd4dcae9.js +183 -0
  11. package/dist/CField.vue_vue_type_style_index_0_lang-4ed993c7.js +1 -0
  12. package/dist/CSlider.vue_vue_type_style_index_0_lang-383db616.js +83 -0
  13. package/dist/ClientAutocomplete-421a2216.js +80 -0
  14. package/dist/ClientModal-11341b1c.js +547 -0
  15. package/dist/ColorPicker-f90939b5.js +2881 -0
  16. package/dist/{CompanyModal-26243605.js → CompanyModal-2bfd21b8.js} +12 -11
  17. package/dist/{ContentWrapper-315b8ac7.js → ContentWrapper-4aae35b2.js} +21 -14
  18. package/dist/{CoverBlockSettings-ff4d5ccc.js → CoverBlockSettings-1f917be3.js} +7 -7
  19. package/dist/DocForm-0891c6b2.js +6767 -0
  20. package/dist/DocFormSend-2b35999d.js +135 -0
  21. package/dist/{DocModalBase-3d81e120.js → DocModalBase-225e2f2d.js} +1 -1
  22. package/dist/{DocReceipt-c9c5aefc.js → DocReceipt-1391c17a.js} +1 -1
  23. package/dist/{DocSendReminder-ab8e6f0f.js → DocSendReminder-c488842d.js} +1 -1
  24. package/dist/{DocTextEditor-88987249.js → DocTextEditor-2538e1ab.js} +16 -12
  25. package/dist/{DocTimeline-8e8a1b51.js → DocTimeline-69ada0de.js} +11 -11
  26. package/dist/DocumentClient-74b8f25b.js +145 -0
  27. package/dist/{DocumentLogotype-a777ea0d.js → DocumentLogotype-e89b53fb.js} +3 -3
  28. package/dist/{EmbedInput-4b92adae.js → EmbedInput-b7fefe5e.js} +10 -11
  29. package/dist/{EmbedSettings-0701c838.js → EmbedSettings-4957252f.js} +10 -11
  30. package/dist/ErrorCallout-42e45ec0.js +30 -0
  31. package/dist/{FilePreviewModal-fa0f4b2c.js → FilePreviewModal-75693619.js} +6 -7
  32. package/dist/FormInputRow-09d450e3.js +2045 -0
  33. package/dist/{HeaderSettings-3b1f470a.js → HeaderSettings-9b69eada.js} +23 -19
  34. package/dist/{ImageSelectModal-24b1d738.js → ImageSelectModal-94d4dc7f.js} +20 -18
  35. package/dist/{ImageUploadWrapper-f9d3ab48.js → ImageUploadWrapper-a144b042.js} +2 -2
  36. package/dist/{Index-a6d8cb6c.js → Index-00ef9241.js} +10 -10
  37. package/dist/{Index-17041bc1.js → Index-023c3119.js} +6 -7
  38. package/dist/{Index-1df9e104.js → Index-1bafafca.js} +2 -2
  39. package/dist/{Index-e9dcaa48.js → Index-2cb8fa22.js} +73 -118
  40. package/dist/{Index-9797765e.js → Index-304c45be.js} +21 -16
  41. package/dist/{Index-ec4600d0.js → Index-35387450.js} +52 -42
  42. package/dist/Index-37a9183b.js +28 -0
  43. package/dist/{Index-d21e1d0d.js → Index-3dff19dd.js} +7 -7
  44. package/dist/{Index-53f58582.js → Index-3ee2e944.js} +2 -2
  45. package/dist/{Index-41e37657.js → Index-42e26b46.js} +11 -11
  46. package/dist/{Index-36b91cfc.js → Index-4440fe3d.js} +6 -7
  47. package/dist/{Index-36fc26f9.js → Index-4563d3fa.js} +33 -31
  48. package/dist/{Index-9262d0cb.js → Index-53da7be8.js} +3 -3
  49. package/dist/{Index-bfc7f353.js → Index-62936c19.js} +16 -17
  50. package/dist/{Index-9a0239fe.js → Index-693005f0.js} +6 -7
  51. package/dist/{Index-5c0744c1.js → Index-78f13416.js} +6 -7
  52. package/dist/{Index-a01c2862.js → Index-90492f19.js} +5 -6
  53. package/dist/{Index-8bb9f798.js → Index-96f39afc.js} +6 -7
  54. package/dist/{Index-ee9ff714.js → Index-97d1f2f3.js} +8 -8
  55. package/dist/{Index-41e93dd5.js → Index-9a243eb8.js} +2 -2
  56. package/dist/{Index-01f77191.js → Index-9ffe9766.js} +11 -12
  57. package/dist/{Index-be520920.js → Index-a37beb03.js} +1 -1
  58. package/dist/{Index-e5ebcd2f.js → Index-a554b58c.js} +6 -7
  59. package/dist/{Index-aa1323ee.js → Index-a86ea774.js} +8 -9
  60. package/dist/{Index-c070cd5e.js → Index-abb8c6e4.js} +6 -6
  61. package/dist/{Index-74d98d97.js → Index-b7def77a.js} +8 -9
  62. package/dist/{Index-6f5192b8.js → Index-bcc478b3.js} +7 -8
  63. package/dist/{Index-033cd5ed.js → Index-cec7d4f1.js} +22 -15
  64. package/dist/{Index-560f7a0f.js → Index-d68a28da.js} +7 -7
  65. package/dist/{Index-5ba3dd14.js → Index-dbe97658.js} +2 -2
  66. package/dist/{Index-a5b8ec5c.js → Index-ec8d534f.js} +4 -6
  67. package/dist/{Index-013c4412.js → Index-f2b66b79.js} +6 -7
  68. package/dist/{Index-8ad015e2.js → Index-f453850f.js} +6 -7
  69. package/dist/{Index-78391f8b.js → Index-f9b5f03c.js} +27 -20
  70. package/dist/{InputToggleRow-9aa959ff.js → InputToggleRow-68320d9f.js} +1 -1
  71. package/dist/IsPremiumPreStep-0c7032a3.js +1919 -0
  72. package/dist/{MediaWrapper-03b27562.js → MediaWrapper-c50879c2.js} +4 -4
  73. package/dist/{NotBindingText-fb4e9ecb.js → NotBindingText-8f2d9244.js} +2 -2
  74. package/dist/{PackageGroup-821d41fa.js → PackageGroup-2c49e99b.js} +24 -17
  75. package/dist/{PdfTerms-4a29bcc9.js → PdfTerms-94153a5f.js} +6 -7
  76. package/dist/{PdfViewer-374bfe41.js → PdfViewer-701ad40e.js} +2 -2
  77. package/dist/{PlainHtml-65923dd4.js → PlainHtml-04a6d7f9.js} +1 -1
  78. package/dist/PriceHeader-7f92d5a7.js +336 -0
  79. package/dist/SearchApi-ffe5b697.js +148 -0
  80. package/dist/{TermsSettings-4a40aaa2.js → TermsSettings-b1bf19e9.js} +6 -6
  81. package/dist/{ThemeColorRow-72b7a35b.js → ThemeColorRow-913497f6.js} +7 -6
  82. package/dist/{ToggleBinding-00c37a9d.js → ToggleBinding-6518935d.js} +8 -9
  83. package/dist/{UploadModal-761770b9.js → UploadModal-3c399d25.js} +21 -22
  84. package/dist/{VideoPlayerInput-6692fe27.js → VideoPlayerInput-b54845a4.js} +5 -6
  85. package/dist/{VideoPlayerSettings-2b7a8a39.js → VideoPlayerSettings-496e9e79.js} +13 -14
  86. package/dist/{VideoSelectModal-4596e9b4.js → VideoSelectModal-3a566398.js} +10 -10
  87. package/dist/anime.es-e284c852.js +858 -0
  88. package/dist/answerDocumentMixin-0e5e4dbb.js +54 -0
  89. package/dist/color-71c20583.js +15 -0
  90. package/dist/{cssMode-34bf902e.js → cssMode-c0865919.js} +15 -14
  91. package/dist/focusDrawerMixin-298861bc.js +68 -0
  92. package/dist/formComponentsInstall-1be6791d.js +2491 -0
  93. package/dist/formValidationMixin-df38771c.js +4984 -0
  94. package/dist/{freemarker2-61453951.js → freemarker2-85dde97c.js} +19 -18
  95. package/dist/{handlebars-24c80c6f.js → handlebars-6aa1e52b.js} +18 -17
  96. package/dist/{html-fc291ba3.js → html-f0c735cd.js} +14 -13
  97. package/dist/{htmlMode-bb27a86a.js → htmlMode-7b3bd7c9.js} +19 -18
  98. package/dist/{index-afe3eb26.js → index-1ef6f423.js} +21 -15
  99. package/dist/index-30808a2c.js +490 -0
  100. package/dist/{index-053f9545.js → index-431938de.js} +13 -12
  101. package/dist/index-6d08eac3.js +14 -0
  102. package/dist/index-805c56e4.js +4 -0
  103. package/dist/index.es.js +3 -3
  104. package/dist/index.umd.js +713 -600
  105. package/dist/{javascript-584c9812.js → javascript-9c54ad9e.js} +11 -10
  106. package/dist/{jsonMode-f03e810a.js → jsonMode-1d1176fa.js} +19 -18
  107. package/dist/{liquid-2157b417.js → liquid-0738c73d.js} +11 -10
  108. package/dist/{main-e2129a84.js → main-2d9b8259.js} +19557 -20415
  109. package/dist/mapFormMixin-308bbdab.js +66 -0
  110. package/dist/{publicSenderState-11d47322.js → publicSenderState-9eecb11f.js} +1 -1
  111. package/dist/{python-7f1728ff.js → python-588c9e64.js} +11 -10
  112. package/dist/{razor-54008302.js → razor-fbaa1d21.js} +14 -13
  113. package/dist/regions-29ee6964.js +1250 -0
  114. package/dist/simplebar.min-75960401.js +2429 -0
  115. package/dist/style.css +4 -0
  116. package/dist/template-b877debf.js +526 -0
  117. package/dist/throttle-d7bed81a.js +18 -0
  118. package/dist/tinycolor-ef496244.js +634 -0
  119. package/dist/{tsMode-6bcf5f10.js → tsMode-c1de8e10.js} +15 -14
  120. package/dist/{typescript-f225fd6d.js → typescript-737827aa.js} +11 -10
  121. package/dist/{utils-c4dbd526.js → utils-69c41ae9.js} +5 -5
  122. package/dist/vuedraggable.umd-67b8cddf.js +3179 -0
  123. package/dist/{xml-8680011c.js → xml-30e811a1.js} +11 -10
  124. package/package.json +4 -4
  125. package/stats.html +1 -1
  126. package/dist/DocForm-b6cc1bdf.js +0 -22074
  127. package/dist/DocFormSend-1c7e370d.js +0 -113
  128. package/dist/Index-0f345bed.js +0 -29
  129. package/dist/PriceHeader-4fb21725.js +0 -329
  130. package/dist/formComponentsInstall-0d5f842a.js +0 -11121
  131. package/dist/index-3a6d34e0.js +0 -11
  132. package/dist/throttle-7fc52dc7.js +0 -18
@@ -0,0 +1,547 @@
1
+ import { v as p, H as h, I as v, n as u, b as c, g as d, J as y, t as C } from "./main-2d9b8259.js";
2
+ import { m as f, b, a as _ } from "./vuex.esm-4a0fff7c.js";
3
+ import { w as $ } from "./CDropdownItem-05d84f95.js";
4
+ import { C as w } from "./ClientAutocomplete-421a2216.js";
5
+ import { v as r } from "./index-805c56e4.js";
6
+ import "./SearchApi-ffe5b697.js";
7
+ function g(n) {
8
+ if (typeof n > "u")
9
+ throw Error("Missing param inputParam");
10
+ let e = n;
11
+ Number.isInteger(e) && (e = e.toString());
12
+ let t = 0;
13
+ const i = e.length, a = i % 2;
14
+ let o, s;
15
+ for (o = 0; o < i; o += 1)
16
+ s = parseInt(e.charAt(o), 10), o % 2 === a && (s *= 2), s > 9 && (s -= 9), t += s;
17
+ return t % 10 === 0;
18
+ }
19
+ function m(n) {
20
+ let e = n.replace(/ /g, "");
21
+ return e = e.replace(/-/g, ""), !g(e) || (e = [e.slice(0, 6), "-", e.slice(6)].join(""), !e.match(/^(\d{6})-(\d{4})$/)) ? !1 : e;
22
+ }
23
+ function l(n) {
24
+ if (typeof n > "u" || n === null || n === "")
25
+ return !1;
26
+ let e = n.trim().replace(/[^0-9]+/g, "");
27
+ if (e.length !== 10 && e.length !== 12)
28
+ return !1;
29
+ if (e.length === 10) {
30
+ const a = e.substring(0, 2), o = (/* @__PURE__ */ new Date()).getFullYear(), s = parseInt(o.toString().substring(2, 2), 10);
31
+ parseInt(a, 10) === 19 || parseInt(a, 10) === 20 || (parseInt(a, 10) >= 0 && parseInt(a, 10) <= s ? e = `20${e}` : e = `19${e}`);
32
+ }
33
+ return (/* @__PURE__ */ new Date()).getFullYear() - parseInt(e.substring(0, 4), 10) < 16 ? !1 : g(e.substring(2)) ? e : !1;
34
+ }
35
+ const x = {
36
+ sv: {
37
+ title: "Mottagare",
38
+ createButton: "Lägg till mottagare",
39
+ updateButton: "Spara mottagare",
40
+ individual: "Privatperson",
41
+ reference: "Referens",
42
+ workAddressSubLabel: "Där arbetet utförs",
43
+ showMore: "Visa fler fält",
44
+ seperateWorkAddress: {
45
+ false: "Arbetsadress som ovan",
46
+ true: "Annan"
47
+ },
48
+ placeholders: {
49
+ name: "Mottagarens namn",
50
+ companyName: "Företagets namn",
51
+ socialNo: "10 eller 12 siffror",
52
+ orgNo: "Företagets org-nr",
53
+ reference: "Er referens",
54
+ cellphone: "Mobilnummer",
55
+ address: "Gatuadress"
56
+ },
57
+ validations: {
58
+ name: {
59
+ required: "Vem är din kund?"
60
+ },
61
+ orgNo: {
62
+ personalNumber: "Personnumret är inte giltigt"
63
+ },
64
+ realOrgNo: {
65
+ realOrgNo: "Organisationsnumret är inte giltigt"
66
+ },
67
+ reference: {
68
+ required: "Vem är din referens?"
69
+ },
70
+ email: {
71
+ required: "E-post saknas",
72
+ email: "E-posten är ogiltig"
73
+ }
74
+ },
75
+ signMethod: {
76
+ button: {
77
+ title: "Standard - knapptryck",
78
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
79
+ },
80
+ bankId: {
81
+ title: "BankId",
82
+ content: "Samma säkerhetsgrad som bankerna har."
83
+ },
84
+ signature: {
85
+ title: "Standard",
86
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
87
+ },
88
+ inPerson: {
89
+ title: "Fysisk underskrift",
90
+ content: "Signatur på utskrivet dokument"
91
+ }
92
+ }
93
+ },
94
+ en: {
95
+ title: "Recipient",
96
+ createButton: "Add recipient",
97
+ updateButton: "Save recipient",
98
+ individual: "Individual",
99
+ reference: "Contact",
100
+ workAddressSubLabel: "Where work is going to be performed",
101
+ showMore: "Show additional fields",
102
+ seperateWorkAddress: {
103
+ false: "Work address same as above",
104
+ true: "Other"
105
+ },
106
+ placeholders: {
107
+ name: "Recipient name",
108
+ companyName: "Company name",
109
+ socialNo: "10 or 12 numbers",
110
+ orgNo: "Company registration number",
111
+ reference: "Name",
112
+ cellphone: "Cellphone",
113
+ address: "Street"
114
+ },
115
+ validations: {
116
+ name: {
117
+ required: "Who's your contact person?"
118
+ },
119
+ orgNo: {
120
+ personalNumber: "Invalid social security number"
121
+ },
122
+ realOrgNo: {
123
+ realOrgNo: "Invalid organisation number"
124
+ },
125
+ reference: {
126
+ required: "Missing contact name"
127
+ },
128
+ email: {
129
+ required: "Email missing",
130
+ email: "Invalid email"
131
+ }
132
+ },
133
+ signMethod: {
134
+ button: {
135
+ title: "Standard - button",
136
+ content: "Level of proof: IP address, timestamp and device."
137
+ },
138
+ bankId: {
139
+ title: "BankID",
140
+ content: "Same level of proof as the banks use."
141
+ },
142
+ signature: {
143
+ title: "Signature",
144
+ content: "Level of proof: IP address, timestamp and device."
145
+ },
146
+ inPerson: {
147
+ title: "In person",
148
+ content: "Signature on print document"
149
+ }
150
+ }
151
+ }
152
+ };
153
+ const { mapFields: k } = p({
154
+ getterType: "forms/getField",
155
+ mutationType: "forms/updateField"
156
+ }), S = {
157
+ name: "FormClient",
158
+ i18nOptions: {
159
+ namespaces: "formClient",
160
+ messages: x
161
+ },
162
+ components: {
163
+ ClientAutocomplete: w,
164
+ Animation: h
165
+ },
166
+ mixins: [$],
167
+ props: {
168
+ requireReference: {
169
+ type: Boolean,
170
+ default: !0
171
+ },
172
+ searchEnabled: {
173
+ type: Boolean,
174
+ default: !1
175
+ },
176
+ validateOrgNo: {
177
+ type: Boolean,
178
+ default: !1
179
+ },
180
+ simpleForm: {
181
+ type: Boolean,
182
+ default: !1
183
+ },
184
+ inputFocusOnMount: {
185
+ type: String,
186
+ default: ""
187
+ },
188
+ // Optional field with prop sync, if within the context of documents
189
+ documentRole: {
190
+ type: String,
191
+ default: ""
192
+ },
193
+ // Optional field with prop sync, if within the context of documents
194
+ answerMethod: {
195
+ type: Object,
196
+ default: null
197
+ },
198
+ isPublicForm: {
199
+ type: Boolean,
200
+ default: !1
201
+ }
202
+ },
203
+ validations() {
204
+ return [this.name, this.orgNo, this.reference, this.email, this.cellphone].some((e) => !!e) ? {
205
+ orgNo: {
206
+ personalNumber(e) {
207
+ return !this.validateOrgNo || !e ? !0 : this.isIndivid ? l(e) : m(e) || l(e);
208
+ }
209
+ },
210
+ reference: {
211
+ required: r.requiredIf((e) => e.requireReference && !e.isIndivid)
212
+ },
213
+ email: {
214
+ email: r.email
215
+ }
216
+ } : {
217
+ name: {
218
+ required: r.required
219
+ },
220
+ orgNo: {
221
+ required: r.requiredIf((e) => e.type === "company")
222
+ },
223
+ cellphone: {
224
+ required: r.requiredIf((e) => !e.isIndivid)
225
+ },
226
+ reference: {
227
+ required: r.requiredIf((e) => !e.isIndivid)
228
+ },
229
+ email: {
230
+ required: r.requiredIf((e) => !e.isIndivid)
231
+ }
232
+ };
233
+ },
234
+ watch: {
235
+ type(n) {
236
+ v.setItem("defaultClientType", n);
237
+ }
238
+ },
239
+ computed: {
240
+ ...k({
241
+ id: "endCustomer.id",
242
+ type: "endCustomer.customerType",
243
+ name: "endCustomer.name",
244
+ realOrgNo: "endCustomer.org_no",
245
+ reference: "endCustomer.reference",
246
+ email: "endCustomer.email",
247
+ street: "endCustomer.street",
248
+ zip: "endCustomer.zip",
249
+ city: "endCustomer.city",
250
+ cellphone: "endCustomer.cellphone",
251
+ cellphoneRegion: "endCustomer.cellphoneRegion",
252
+ separateWorkAddress: "endCustomer.separateWorkAddress",
253
+ workStreet: "endCustomer.workStreet",
254
+ workZip: "endCustomer.workZip",
255
+ workCity: "endCustomer.workCity",
256
+ reverseVat: "endCustomer.reverseVat",
257
+ doUpdateEndCustomer: "endCustomer.doUpdateEndCustomer"
258
+ }),
259
+ ...f({
260
+ isPosting: "endCustomers/isPosting",
261
+ companyRegion: "application/companyRegion",
262
+ feature: "application/feature"
263
+ }),
264
+ messages() {
265
+ return {
266
+ name: {
267
+ required: this.$t("validations.name.required")
268
+ },
269
+ orgNo: {
270
+ personalNumber: this.$t("validations.orgNo.personalNumber")
271
+ },
272
+ realOrgNo: {
273
+ personalNumber: this.$t("validations.realOrgNo.realOrgNo")
274
+ },
275
+ reference: {
276
+ required: this.$t("validations.reference.required")
277
+ },
278
+ email: {
279
+ required: this.$t("validations.email.required"),
280
+ email: this.$t("validations.email.email")
281
+ }
282
+ };
283
+ },
284
+ orgNo: {
285
+ get() {
286
+ return this.realOrgNo;
287
+ },
288
+ set(n) {
289
+ const e = this.isIndivid ? l(n) : m(n) || l(n);
290
+ return this.validateOrgNo && e ? (this.realOrgNo = e, !0) : (this.realOrgNo = n, !0);
291
+ }
292
+ },
293
+ isIndivid() {
294
+ return this.type === "individual";
295
+ }
296
+ },
297
+ mounted() {
298
+ this.$refs[this.inputFocusOnMount] ? this.$refs[this.inputFocusOnMount].$el.querySelector("input").focus() : this.$refs.name.$el.querySelector("input").focus();
299
+ },
300
+ methods: {
301
+ validateForm() {
302
+ return this.$v.$touch(), this.$v.$invalid ? !1 : (this.$emit("submit", !0), !0);
303
+ }
304
+ }
305
+ };
306
+ var N = function() {
307
+ var e = this, t = e._self._c;
308
+ return t("div", { staticClass: "form-client" }, [e.simpleForm ? t("form", { on: { submit: function(i) {
309
+ return i.preventDefault(), e.validateForm.apply(null, arguments);
310
+ } } }, [t("div", { staticClass: "flex flex-wrap items-center pb-6 space-between" }, [t("div", { staticClass: "flex-grow", staticStyle: { "font-weight": "600", "font-size": "20px" } }, [e._v(" " + e._s(e.$t("_common:recipient").capitalize()) + " ")]), t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
311
+ e.type = "individual";
312
+ } } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
313
+ e.type = "company";
314
+ } } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticStyle: { "margin-bottom": "1.5rem" }, attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "search-enabled": e.searchEnabled, "show-loading": !0 }, on: { setClient: function(i) {
315
+ return e.$emit("setClient", i);
316
+ } }, model: { value: e.name, callback: function(i) {
317
+ e.name = i;
318
+ }, expression: "name" } })], 1), t("Animation", [e.isIndivid ? e._e() : t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
319
+ e.reference = i;
320
+ }, expression: "reference" } })], 1)], 1), t("CField", { staticStyle: { "margin-bottom": "1.5rem" }, attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
321
+ e.email = typeof i == "string" ? i.trim() : i;
322
+ }, expression: "email" } })], 1), t("CPhoneInput", { ref: "cellphone", staticStyle: { "margin-bottom": "1.5rem" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
323
+ e.cellphoneRegion = i;
324
+ } }, model: { value: e.cellphone, callback: function(i) {
325
+ e.cellphone = i;
326
+ }, expression: "cellphone" } }), e.documentRole ? t("CDropdown", { staticStyle: { "margin-bottom": "1rem" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", staticStyle: { width: "100%" }, attrs: { slot: "trigger", "dropdown-icon": !0, "icon-props": {
327
+ stroke: "hsl(0, 0%, 50%)"
328
+ }, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary" }, slot: "trigger" }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])]), e._l(["signee", "recipient", "approver"], function(i) {
329
+ return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
330
+ stroke: "hsl(0, 0%, 50%)"
331
+ } }, on: { click: function(a) {
332
+ return e.$emit("update:document-role", i);
333
+ } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
334
+ })], 2) : e._e(), t("CButton", { attrs: { type: "secondary", pattern: "tertiary", size: "small", "icon-left": "arrow-right" }, on: { click: function(i) {
335
+ return e.$emit("show-more");
336
+ } } }, [e._v(" " + e._s(e.$t("showMore").capitalize()) + " ")]), t("CButton", { staticClass: "mt-4", staticStyle: { 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)" }, attrs: { loading: e.isPosting, "native-type": "submit", type: "secondary", wide: "", size: "medium" } }, [e._v(" " + e._s(e.$t(`${e.id ? "update" : "create"}Button`)) + " ")])], 1) : t("div", { class: { "column-only": e.windowWidth <= 600 } }, [t("div", { staticClass: "flex items-center justify-center", staticStyle: { "margin-bottom": "2.5rem" } }, [t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
337
+ e.type = "individual";
338
+ } } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
339
+ e.type = "company";
340
+ } } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside", expanded: "" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "show-loading": !0, "search-enabled": e.searchEnabled }, on: { setClient: function(i) {
341
+ return e.$emit("setClient", i);
342
+ } }, model: { value: e.name, callback: function(i) {
343
+ e.name = i;
344
+ }, expression: "name" } })], 1), t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:socialNo").capitalize() : e.$t("_common:orgNoShort").capitalize(), validator: e.$v.orgNo, messages: e.isIndivid ? e.messages.orgNo : e.messages.realOrgNo, "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "orgNo", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.socialNo") : e.$t("placeholders.orgNo") }, model: { value: e.orgNo, callback: function(i) {
345
+ e.orgNo = i;
346
+ }, expression: "orgNo" } })], 1)], 1), t("Animation", [e.type && !e.isIndivid ? t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("_common:reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
347
+ e.reference = i;
348
+ }, expression: "reference" } })], 1) : e._e(), e.type && !e.isIndivid && e.feature("reverseVat") && e.feature("regionSE") ? t("CField", { staticStyle: { "padding-left": "0.5em", "margin-bottom": "2rem" } }, [t("CCheckbox", { attrs: { size: "normal" }, model: { value: e.reverseVat, callback: function(i) {
349
+ e.reverseVat = i;
350
+ }, expression: "reverseVat" } }, [e._v(" " + e._s(e.$t("_common:vat.reverseVat")) + " ")])], 1) : e._e()], 1), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
351
+ e.email = typeof i == "string" ? i.trim() : i;
352
+ }, expression: "email" } })], 1), t("CPhoneInput", { staticStyle: { "margin-bottom": "1.5rem" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
353
+ e.cellphoneRegion = i;
354
+ } }, model: { value: e.cellphone, callback: function(i) {
355
+ e.cellphone = i;
356
+ }, expression: "cellphone" } })], 1), t("CField", { attrs: { label: e.$t("_common:address").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "street", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.street, callback: function(i) {
357
+ e.street = i;
358
+ }, expression: "street" } })], 1), t("CField", { staticClass: "flex force-two", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "zip", attrs: { placeholder: e.$t("_common:zip").capitalize() }, model: { value: e.zip, callback: function(i) {
359
+ e.zip = i;
360
+ }, expression: "zip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "city", attrs: { placeholder: e.$t("_common:city").capitalize() }, model: { value: e.city, callback: function(i) {
361
+ e.city = i;
362
+ }, expression: "city" } })], 1)], 1), t("CField", { staticClass: "flex" }, [t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !1, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
363
+ e.separateWorkAddress = i;
364
+ }, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.false")) + " ")]), t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !0, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
365
+ e.separateWorkAddress = i;
366
+ }, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.true")) + " ")])], 1), t("Animation", [e.type && e.separateWorkAddress ? t("div", [t("CField", { attrs: { label: e.$t("_common:addressWork").capitalize() + ` ( ${e.$t("workAddressSubLabel")} )` } }, [t("CInput", { ref: "workStreet", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.workStreet, callback: function(i) {
367
+ e.workStreet = i;
368
+ }, expression: "workStreet" } })], 1), t("CField", { staticClass: "flex force-two", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workZip", attrs: { placeholder: e.$t("_common:zip").capitalize(), expanded: "" }, model: { value: e.workZip, callback: function(i) {
369
+ e.workZip = i;
370
+ }, expression: "workZip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workCity", attrs: { placeholder: e.$t("_common:city").capitalize(), expanded: "" }, model: { value: e.workCity, callback: function(i) {
371
+ e.workCity = i;
372
+ }, expression: "workCity" } })], 1)], 1)], 1) : e._e()]), e.documentRole || e.answerMethod ? t("CField", { staticClass: "flex pt-4", attrs: { grouped: "" } }, [e.documentRole ? t("div", { staticClass: "dropdown-field-wrapper" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:documentRole.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "1rem" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", staticStyle: { width: "100%" }, attrs: { slot: "trigger", "dropdown-icon": !0, "icon-props": {
373
+ stroke: "hsl(0, 0%, 50%)"
374
+ }, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary" }, slot: "trigger" }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])]), e._l(["signee", "recipient", "approver"], function(i) {
375
+ return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
376
+ stroke: "hsl(0, 0%, 50%)"
377
+ } }, on: { click: function(a) {
378
+ return e.$emit("update:document-role", i);
379
+ } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
380
+ })], 2)], 1) : e._e(), e.answerMethod ? t("div", { staticClass: "dropdown-field-wrapper" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "1rem" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", attrs: { slot: "trigger", "dropdown-icon": !0, type: "none", pattern: "secondary", wide: "" }, slot: "trigger" }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`signMethod.${e.answerMethod.accept}.title`)))]), t("div", { staticClass: "truncate", staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`signMethod.${e.answerMethod.accept}.content`)) + " ")])])]), e._l([
381
+ ...!e.isPublicForm && e.feature("bankId") ? ["bankId"] : [],
382
+ "signature",
383
+ "inPerson"
384
+ ], function(i) {
385
+ return t("CDropdownItem", { key: i, on: { click: function(a) {
386
+ return e.$emit("update:answer-method", { ...e.answerMethod, accept: i });
387
+ } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`signMethod.${i}.title`)))]), t("div", { staticClass: "max-w-[12rem] truncate", staticStyle: { "font-size": "12px", opacity: "0.7", "text-wrap": "wrap" } }, [e._v(" " + e._s(e.$t(`signMethod.${i}.content`)) + " ")])])]);
388
+ })], 2)], 1) : e._e()]) : e._e(), t("div", { staticStyle: { "margin-top": "3rem" } }, [t("CButton", { staticStyle: { 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)" }, attrs: { loading: e.isPosting, type: "secondary", wide: "" }, on: { click: e.validateForm } }, [e._v(e._s(e.$t(`${e.id ? "update" : "create"}Button`)))])], 1)], 1)]);
389
+ }, I = [], F = /* @__PURE__ */ u(
390
+ S,
391
+ N,
392
+ I,
393
+ !1,
394
+ null,
395
+ "0a4c270d",
396
+ null,
397
+ null
398
+ );
399
+ const z = F.exports, { mapFields: M } = p({
400
+ getterType: "forms/getField",
401
+ mutationType: "forms/updateField"
402
+ }), R = {
403
+ name: "ClientModal",
404
+ i18nOptions: {
405
+ namespaces: "components",
406
+ keyPrefix: "account.documentForm.clients"
407
+ },
408
+ components: {
409
+ FormClient: z
410
+ },
411
+ props: {
412
+ documentClientIndex: {
413
+ type: Number,
414
+ default: 0
415
+ },
416
+ signOrder: {
417
+ type: Number,
418
+ default: 0
419
+ },
420
+ inputFocusOnMount: {
421
+ type: String,
422
+ default: ""
423
+ },
424
+ forceExpand: {
425
+ type: Boolean,
426
+ default: !1
427
+ },
428
+ // Optional prop if this modal is mounted from public form
429
+ isPublicForm: {
430
+ type: Boolean,
431
+ default: !1
432
+ }
433
+ },
434
+ data() {
435
+ return {
436
+ storedNewClient: {
437
+ documentRole: "signee",
438
+ answerMethod: {
439
+ accept: "signature",
440
+ deny: "button"
441
+ }
442
+ },
443
+ isLoading: !1,
444
+ hasChanged: !1,
445
+ showMore: !1
446
+ };
447
+ },
448
+ computed: {
449
+ ...M({
450
+ endCustomer: "endCustomer"
451
+ }),
452
+ ...b("forms", {
453
+ formData: (n) => n.document2
454
+ }),
455
+ ...f({
456
+ can: "application/can",
457
+ defaultClientType: "endCustomers/defaultClientType"
458
+ })
459
+ },
460
+ created() {
461
+ this.forceExpand && (this.showMore = !0);
462
+ const n = c(this.formData, `clients[${this.documentClientIndex}]`, {});
463
+ this.loadForm(n), ["endCustomer", "storedNewClient"].forEach((e) => this.$watch(e, {
464
+ deep: !0,
465
+ handler() {
466
+ this.hasChanged = !0;
467
+ }
468
+ }));
469
+ },
470
+ methods: {
471
+ ..._({
472
+ saveClient: d.FORM_SUBMIT_ENDCUSTOMER,
473
+ setFormValue: d.SET_FORM_VALUE,
474
+ showMessage: d.SHOW_MESSAGE
475
+ }),
476
+ loadForm(n = {}) {
477
+ this.storedNewClient = Object.assign(this.storedNewClient, n), this.endCustomer = y({
478
+ type: this.defaultClientType(),
479
+ ...n
480
+ });
481
+ },
482
+ async onSave() {
483
+ this.isLoading = !0;
484
+ let n = c(this.endCustomer, "id");
485
+ if (!this.isPublicForm) {
486
+ let e = !1;
487
+ this.endCustomer && (this.endCustomer.id ? this.can("endCustomers", "modify", this.endCustomer.id) && (e = !0) : this.can("endCustomers", "create") && (e = !0)), e && (n = await this.saveClient());
488
+ }
489
+ this.setFormValue({
490
+ key: `document2.clients[${this.documentClientIndex}]`,
491
+ value: C(
492
+ { ...this.endCustomer, ...n && { id: n } },
493
+ { ...this.storedNewClient, signOrder: this.signOrder }
494
+ )
495
+ }), this.$emit("close"), this.isLoading = !1;
496
+ },
497
+ close() {
498
+ return !this.hasChanged || !this.showMore ? this.$emit("close") : this.showMessage({
499
+ displayType: "dialog",
500
+ type: "danger",
501
+ title: this.$t("unsavedDialog.title"),
502
+ message: this.$t("unsavedDialog.message"),
503
+ actions: {
504
+ cancel: {
505
+ text: this.$t("unsavedDialog.cancel"),
506
+ callback: "cancel"
507
+ },
508
+ submit: {
509
+ text: this.$t("unsavedDialog.submit"),
510
+ callback: () => this.$emit("close")
511
+ }
512
+ }
513
+ });
514
+ }
515
+ }
516
+ };
517
+ var O = function() {
518
+ var e = this, t = e._self._c;
519
+ return t("div", { staticClass: "font-primary bg-black bg-opacity-10 fixed inset-0 sm:py-4 z-[1000] grid place-items-center overflow-auto max-sm:w-full max-sm:min-h-full max-sm:block max-sm:overflow-auto", on: { "&click": function(i) {
520
+ return i.target !== i.currentTarget ? null : e.close.apply(null, arguments);
521
+ } } }, [t("div", { staticClass: "relative flex flex-col items-center p-10 mx-auto text-lg bg-white rounded-xl max-sm:w-full max-sm:h-initial max-sm:min-h-full max-sm:rounded-none" }, [t("CButton", { staticClass: "absolute z-2 top-4 right-4", class: e.showMore ? "" : "sm:!hidden", attrs: { pattern: "tertiary", type: "none", circle: "", icon: "x" }, on: { click: e.close } }), t("FormClient", { staticClass: "max-w-full p-0", class: [e.showMore ? "w-[520px]" : "w-[360px]"], attrs: { "search-enabled": !0, "require-reference": !1, "simple-form": !e.showMore, "input-focus-on-mount": e.inputFocusOnMount, "document-role": e.storedNewClient.documentRole, "answer-method": e.storedNewClient.answerMethod, "is-public-form": e.isPublicForm }, on: { "update:documentRole": function(i) {
522
+ return e.$set(e.storedNewClient, "documentRole", i);
523
+ }, "update:document-role": function(i) {
524
+ return e.$set(e.storedNewClient, "documentRole", i);
525
+ }, "update:answerMethod": function(i) {
526
+ return e.$set(e.storedNewClient, "answerMethod", i);
527
+ }, "update:answer-method": function(i) {
528
+ return e.$set(e.storedNewClient, "answerMethod", i);
529
+ }, setClient: function(i) {
530
+ return e.loadForm(i);
531
+ }, submit: e.onSave, "show-more": function(i) {
532
+ e.showMore = !0;
533
+ } } })], 1)]);
534
+ }, A = [], q = /* @__PURE__ */ u(
535
+ R,
536
+ O,
537
+ A,
538
+ !1,
539
+ null,
540
+ null,
541
+ null,
542
+ null
543
+ );
544
+ const T = q.exports;
545
+ export {
546
+ T as default
547
+ };