@revolugo/elements 6.14.4 → 6.14.5-beta.1

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 (73) hide show
  1. package/dist/css/{revolugo.cancellationpoliciesbadge.CVnwoRRv.css → revolugo.cancellationpoliciesbadge.DDwUPwrW.css} +1 -1
  2. package/dist/css/{revolugo.creditcardstripeform.CQo4EdV9.css → revolugo.creditcardstripeform.CuNCVfSx.css} +1 -1
  3. package/dist/css/revolugo.preferencesmenu.CKbQGJ3O.css +1 -0
  4. package/dist/css/{revolugo.webcomponentwrapper.Sz4vrcSR.css → revolugo.webcomponentwrapper.DTRm9uoD.css} +1 -1
  5. package/dist/index.es.min.js +9 -9
  6. package/dist/index.es.min.js.map +1 -1
  7. package/dist/index.min.js +1 -1
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/revolugo.banktransferdetails.BP_tJ7LE.min.js +47 -0
  10. package/dist/revolugo.bookingdetailssidebar.uBmlbbwL.min.js +43 -0
  11. package/dist/revolugo.bookingmanager.DbD300O2.min.js +26 -0
  12. package/dist/revolugo.cancellationpoliciesbadge.4c-sKZJT.min.js +26 -0
  13. package/dist/revolugo.cancellationpoliciesbadge.props.DQAyNos3.min.js +29129 -0
  14. package/dist/revolugo.cancellationpolicieslist.Dbx8dII4.min.js +26 -0
  15. package/dist/revolugo.creditcardstripeform.3lMRw0xn.min.js +50 -0
  16. package/dist/revolugo.creditcardstripeform.BniE9G3A.min.js +2998 -0
  17. package/dist/revolugo.currencypickerbtn.DoN18HCn.min.js +26 -0
  18. package/dist/{revolugo.dialog-attach.BOO2g6vS.min.js → revolugo.dialog-attach.6VpBfdcy.min.js} +2 -2
  19. package/dist/revolugo.fastbookingflow.CN7EVTUx.min.js +36 -0
  20. package/dist/revolugo.fullbookingflow.DTnGJm5Y.min.js +26 -0
  21. package/dist/revolugo.hoteldescriptionview.B8br8GvA.min.js +26 -0
  22. package/dist/revolugo.hotelofferlist.Cr3Fzniz.min.js +26 -0
  23. package/dist/revolugo.hoteloffersearchmenu.CZ7-d2Th.min.js +122 -0
  24. package/dist/revolugo.hoteloffersmap.DQKvoXiQ.min.js +26 -0
  25. package/dist/revolugo.hoteloffersview.CLFxZ3mf.min.js +29 -0
  26. package/dist/revolugo.hotelroomofferlist.ChljEG26.min.js +26 -0
  27. package/dist/revolugo.hotelroomoffersbookingflow.D_LiRFXI.min.js +26 -0
  28. package/dist/revolugo.hotelroomoffersearchmenu.4sk7JI6A.min.js +26 -0
  29. package/dist/revolugo.hotelroomoffersview.D8Y7CJji.min.js +26 -0
  30. package/dist/revolugo.index.BzkaHkln.min.js +101 -0
  31. package/dist/revolugo.index.wc.BKw6iLbQ.min.js +30119 -0
  32. package/dist/revolugo.langpickerbtn.BShR-GQQ.min.js +31 -0
  33. package/dist/revolugo.min.js +1 -1
  34. package/dist/revolugo.prebookform.BrvEx_MQ.min.js +26 -0
  35. package/dist/revolugo.preferencesmenu.Ry46592I.min.js +943 -0
  36. package/dist/revolugo.preferencesmenu.SU8grFAz.min.js +24 -0
  37. package/dist/revolugo.roominglisteditor.BWyMkRdQ.min.js +26 -0
  38. package/dist/revolugo.storybooktoolbar.ntjn_Lif.min.js +828 -0
  39. package/dist/revolugo.termsandconditions.C82FXzrW.min.js +31 -0
  40. package/dist/{revolugo.vtoolbar.BrJsPjyn.min.js → revolugo.vtoolbar.Dxq2BdoM.min.js} +40 -40
  41. package/dist/revolugo.webcomponentwrapper.MNN0gXoE.min.js +30885 -0
  42. package/package.json +13 -148
  43. package/dist/css/revolugo.preferencesmenu.xwW9g-pj.css +0 -1
  44. package/dist/revolugo.banktransferdetails.Cub44miS.min.js +0 -47
  45. package/dist/revolugo.bookingdetailssidebar.FLVMXWfb.min.js +0 -43
  46. package/dist/revolugo.bookingmanager.Kt-XEVcb.min.js +0 -26
  47. package/dist/revolugo.cancellationpoliciesbadge.props.B3Oir2JL.min.js +0 -28795
  48. package/dist/revolugo.cancellationpoliciesbadge.wXqASj4o.min.js +0 -26
  49. package/dist/revolugo.cancellationpolicieslist.CB2jqcOC.min.js +0 -26
  50. package/dist/revolugo.creditcardstripeform.BKHC0EXa.min.js +0 -50
  51. package/dist/revolugo.creditcardstripeform.CFj-X3B1.min.js +0 -2137
  52. package/dist/revolugo.currencypickerbtn.Bil8a4MK.min.js +0 -26
  53. package/dist/revolugo.fastbookingflow.Ey7heNp3.min.js +0 -36
  54. package/dist/revolugo.fullbookingflow.BmEQb3hX.min.js +0 -26
  55. package/dist/revolugo.hoteldescriptionview.CQjMsC50.min.js +0 -26
  56. package/dist/revolugo.hotelofferlist.BCSGpg35.min.js +0 -26
  57. package/dist/revolugo.hoteloffersearchmenu.CX8d-C9i.min.js +0 -115
  58. package/dist/revolugo.hoteloffersmap.DZCoqYy9.min.js +0 -26
  59. package/dist/revolugo.hoteloffersview.Dl6PHNuf.min.js +0 -21
  60. package/dist/revolugo.hotelroomofferlist.D_K55U8L.min.js +0 -26
  61. package/dist/revolugo.hotelroomoffersbookingflow.Cxftg_K5.min.js +0 -26
  62. package/dist/revolugo.hotelroomoffersearchmenu.BAW7QSdh.min.js +0 -26
  63. package/dist/revolugo.hotelroomoffersview.Cck3d1D7.min.js +0 -26
  64. package/dist/revolugo.index.CE4W8vd5.min.js +0 -101
  65. package/dist/revolugo.index.wc.C1k5jVOs.min.js +0 -24036
  66. package/dist/revolugo.langpickerbtn.hPOI4yKr.min.js +0 -31
  67. package/dist/revolugo.prebookform.ta_y5ufY.min.js +0 -26
  68. package/dist/revolugo.preferencesmenu.CNzF7xpj.min.js +0 -24
  69. package/dist/revolugo.preferencesmenu.shY-3UnD.min.js +0 -932
  70. package/dist/revolugo.roominglisteditor.CzQTR_4C.min.js +0 -26
  71. package/dist/revolugo.storybooktoolbar.D828oQt9.min.js +0 -824
  72. package/dist/revolugo.termsandconditions.sDirhmY4.min.js +0 -31
  73. package/dist/revolugo.webcomponentwrapper.BE6Todxg.min.js +0 -30737
@@ -1,824 +0,0 @@
1
- import { s as pe, d as M, h as J, i as A, b as R, A as ve, _ as ge, j as O, a as o, w as r, k as Q, l as T, p as S, m as X, F, o as _, q as he, t as ye, v as H, x as Ee, u as w, y as be, c as Z, z as Se, r as I } from "./revolugo.index.wc.C1k5jVOs.min.js";
2
- import { B as Ae, _ as N, V as ee, b as te, c as $, d as x, e as ie, f as ae, g as D, h as ne, i as oe, j as k, k as q, l as se, u as ke, m as Ce, n as we, W as _e } from "./revolugo.webcomponentwrapper.BE6Todxg.min.js";
3
- import { d as Ve } from "./revolugo.dialog-attach.BOO2g6vS.min.js";
4
- import { t as Le, w as Oe, s as B } from "./revolugo.index.CE4W8vd5.min.js";
5
- function me(t) {
6
- try {
7
- if (typeof document < "u") {
8
- window.REVOLUGO_ELEMENTS_STYLES = window.REVOLUGO_ELEMENTS_STYLES || {
9
- sheets: [],
10
- components: []
11
- };
12
- const e = import.meta.url, a = e.slice(0, e.lastIndexOf("/") + 1) + t;
13
- window.REVOLUGO_ELEMENTS_STYLES.sheets.push(a);
14
- for (const i of REVOLUGO_ELEMENTS_STYLES.components)
15
- i(a);
16
- if (t.indexOf("fonts") >= 0) {
17
- const i = document.createElement("link");
18
- i.rel = "stylesheet", linK.href = a, document.head.appendChild(i);
19
- }
20
- }
21
- } catch (e) {
22
- console.error("[revolugo-elements] ", e);
23
- }
24
- }
25
- var L = {}, Y;
26
- function Ke() {
27
- if (Y) return L;
28
- Y = 1, Object.defineProperty(L, "__esModule", { value: !0 }), L.parse = u, L.serialize = P;
29
- const t = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, e = /^[\u0021-\u003A\u003C-\u007E]*$/, a = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, i = /^[\u0020-\u003A\u003D-\u007E]*$/, c = Object.prototype.toString, g = /* @__PURE__ */ (() => {
30
- const s = function() {
31
- };
32
- return s.prototype = /* @__PURE__ */ Object.create(null), s;
33
- })();
34
- function u(s, p) {
35
- const n = new g(), y = s.length;
36
- if (y < 2)
37
- return n;
38
- const C = p?.decode || m;
39
- let l = 0;
40
- do {
41
- const E = s.indexOf("=", l);
42
- if (E === -1)
43
- break;
44
- const b = s.indexOf(";", l), f = b === -1 ? y : b;
45
- if (E > f) {
46
- l = s.lastIndexOf(";", E - 1) + 1;
47
- continue;
48
- }
49
- const v = h(s, l, E), ue = d(s, E, v), j = s.slice(v, ue);
50
- if (n[j] === void 0) {
51
- let z = h(s, E + 1, f), ce = d(s, f, z);
52
- const fe = C(s.slice(z, ce));
53
- n[j] = fe;
54
- }
55
- l = f + 1;
56
- } while (l < y);
57
- return n;
58
- }
59
- function h(s, p, n) {
60
- do {
61
- const y = s.charCodeAt(p);
62
- if (y !== 32 && y !== 9)
63
- return p;
64
- } while (++p < n);
65
- return n;
66
- }
67
- function d(s, p, n) {
68
- for (; p > n; ) {
69
- const y = s.charCodeAt(--p);
70
- if (y !== 32 && y !== 9)
71
- return p + 1;
72
- }
73
- return n;
74
- }
75
- function P(s, p, n) {
76
- const y = n?.encode || encodeURIComponent;
77
- if (!t.test(s))
78
- throw new TypeError(`argument name is invalid: ${s}`);
79
- const C = y(p);
80
- if (!e.test(C))
81
- throw new TypeError(`argument val is invalid: ${p}`);
82
- let l = s + "=" + C;
83
- if (!n)
84
- return l;
85
- if (n.maxAge !== void 0) {
86
- if (!Number.isInteger(n.maxAge))
87
- throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);
88
- l += "; Max-Age=" + n.maxAge;
89
- }
90
- if (n.domain) {
91
- if (!a.test(n.domain))
92
- throw new TypeError(`option domain is invalid: ${n.domain}`);
93
- l += "; Domain=" + n.domain;
94
- }
95
- if (n.path) {
96
- if (!i.test(n.path))
97
- throw new TypeError(`option path is invalid: ${n.path}`);
98
- l += "; Path=" + n.path;
99
- }
100
- if (n.expires) {
101
- if (!V(n.expires) || !Number.isFinite(n.expires.valueOf()))
102
- throw new TypeError(`option expires is invalid: ${n.expires}`);
103
- l += "; Expires=" + n.expires.toUTCString();
104
- }
105
- if (n.httpOnly && (l += "; HttpOnly"), n.secure && (l += "; Secure"), n.partitioned && (l += "; Partitioned"), n.priority)
106
- switch (typeof n.priority == "string" ? n.priority.toLowerCase() : void 0) {
107
- case "low":
108
- l += "; Priority=Low";
109
- break;
110
- case "medium":
111
- l += "; Priority=Medium";
112
- break;
113
- case "high":
114
- l += "; Priority=High";
115
- break;
116
- default:
117
- throw new TypeError(`option priority is invalid: ${n.priority}`);
118
- }
119
- if (n.sameSite)
120
- switch (typeof n.sameSite == "string" ? n.sameSite.toLowerCase() : n.sameSite) {
121
- case !0:
122
- case "strict":
123
- l += "; SameSite=Strict";
124
- break;
125
- case "lax":
126
- l += "; SameSite=Lax";
127
- break;
128
- case "none":
129
- l += "; SameSite=None";
130
- break;
131
- default:
132
- throw new TypeError(`option sameSite is invalid: ${n.sameSite}`);
133
- }
134
- return l;
135
- }
136
- function m(s) {
137
- if (s.indexOf("%") === -1)
138
- return s;
139
- try {
140
- return decodeURIComponent(s);
141
- } catch {
142
- return s;
143
- }
144
- }
145
- function V(s) {
146
- return c.call(s) === "[object Date]";
147
- }
148
- return L;
149
- }
150
- var K = Ke();
151
- function Ie() {
152
- const t = typeof global > "u" ? void 0 : global.TEST_HAS_DOCUMENT_COOKIE;
153
- return typeof t == "boolean" ? t : typeof document == "object" && typeof document.cookie == "string";
154
- }
155
- function xe(t) {
156
- return typeof t == "string" ? K.parse(t) : typeof t == "object" && t !== null ? t : {};
157
- }
158
- function U(t, e = {}) {
159
- const a = Me(t);
160
- if (!e.doNotParse)
161
- try {
162
- return JSON.parse(a);
163
- } catch {
164
- }
165
- return t;
166
- }
167
- function Me(t) {
168
- return t && t[0] === "j" && t[1] === ":" ? t.substr(2) : t;
169
- }
170
- class Pe {
171
- constructor(e, a = {}) {
172
- this.changeListeners = [], this.HAS_DOCUMENT_COOKIE = !1, this.update = () => {
173
- if (!this.HAS_DOCUMENT_COOKIE)
174
- return;
175
- const c = this.cookies;
176
- this.cookies = K.parse(document.cookie), this._checkChanges(c);
177
- };
178
- const i = typeof document > "u" ? "" : document.cookie;
179
- this.cookies = xe(e || i), this.defaultSetOptions = a, this.HAS_DOCUMENT_COOKIE = Ie();
180
- }
181
- _emitChange(e) {
182
- for (let a = 0; a < this.changeListeners.length; ++a)
183
- this.changeListeners[a](e);
184
- }
185
- _checkChanges(e) {
186
- new Set(Object.keys(e).concat(Object.keys(this.cookies))).forEach((i) => {
187
- e[i] !== this.cookies[i] && this._emitChange({
188
- name: i,
189
- value: U(this.cookies[i])
190
- });
191
- });
192
- }
193
- _startPolling() {
194
- this.pollingInterval = setInterval(this.update, 300);
195
- }
196
- _stopPolling() {
197
- this.pollingInterval && clearInterval(this.pollingInterval);
198
- }
199
- get(e, a = {}) {
200
- return a.doNotUpdate || this.update(), U(this.cookies[e], a);
201
- }
202
- getAll(e = {}) {
203
- e.doNotUpdate || this.update();
204
- const a = {};
205
- for (let i in this.cookies)
206
- a[i] = U(this.cookies[i], e);
207
- return a;
208
- }
209
- set(e, a, i) {
210
- i ? i = Object.assign(Object.assign({}, this.defaultSetOptions), i) : i = this.defaultSetOptions;
211
- const c = typeof a == "string" ? a : JSON.stringify(a);
212
- this.cookies = Object.assign(Object.assign({}, this.cookies), { [e]: c }), this.HAS_DOCUMENT_COOKIE && (document.cookie = K.serialize(e, c, i)), this._emitChange({ name: e, value: a, options: i });
213
- }
214
- remove(e, a) {
215
- const i = a = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), a), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 });
216
- this.cookies = Object.assign({}, this.cookies), delete this.cookies[e], this.HAS_DOCUMENT_COOKIE && (document.cookie = K.serialize(e, "", i)), this._emitChange({ name: e, value: void 0, options: a });
217
- }
218
- addChangeListener(e) {
219
- this.changeListeners.push(e), this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1 && (typeof window == "object" && "cookieStore" in window ? window.cookieStore.addEventListener("change", this.update) : this._startPolling());
220
- }
221
- removeChangeListener(e) {
222
- const a = this.changeListeners.indexOf(e);
223
- a >= 0 && this.changeListeners.splice(a, 1), this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0 && (typeof window == "object" && "cookieStore" in window ? window.cookieStore.removeEventListener("change", this.update) : this._stopPolling());
224
- }
225
- removeAllChangeListeners() {
226
- for (; this.changeListeners.length > 0; )
227
- this.removeChangeListener(this.changeListeners[0]);
228
- }
229
- }
230
- // @__NO_SIDE_EFFECTS__
231
- function re(t, { doNotParse: e = !1, autoUpdateDependencies: a = !1 } = {}, i = new Pe()) {
232
- const c = a ? [...t || []] : t;
233
- let g = i.getAll({ doNotParse: !0 });
234
- const u = pe(0), h = () => {
235
- const d = i.getAll({ doNotParse: !0 });
236
- Ue(c || null, d, g) && u.value++, g = d;
237
- };
238
- return i.addChangeListener(h), Le(() => {
239
- i.removeChangeListener(h);
240
- }), {
241
- get: (...d) => (a && c && !c.includes(d[0]) && c.push(d[0]), u.value, i.get(d[0], {
242
- doNotParse: e,
243
- ...d[1]
244
- })),
245
- getAll: (...d) => (u.value, i.getAll({
246
- doNotParse: e,
247
- ...d[0]
248
- })),
249
- set: (...d) => i.set(...d),
250
- remove: (...d) => i.remove(...d),
251
- addChangeListener: (...d) => i.addChangeListener(...d),
252
- removeChangeListener: (...d) => i.removeChangeListener(...d)
253
- };
254
- }
255
- function Ue(t, e, a) {
256
- if (!t) return !0;
257
- for (const i of t) if (e[i] !== a[i]) return !0;
258
- return !1;
259
- }
260
- const le = M({
261
- components: {
262
- BTag: Ae
263
- },
264
- methods: {
265
- closeDialog() {
266
- this.dialog = !1, this.apiKey = this.cookies.get("apiKey");
267
- },
268
- async isValidApiKey() {
269
- if (!this.apiKey)
270
- return !1;
271
- const t = {
272
- apiEnvironment: window.RevolugoElements.config.apiEnvironment,
273
- apiKey: this.apiKey,
274
- apiVersion: ve.V1,
275
- optionalHeaders: window.RevolugoElements.config.optionalHeaders
276
- }, e = new ge(t);
277
- try {
278
- return !!await e.hotels.retrieve({
279
- id: "2yvb"
280
- });
281
- } catch (a) {
282
- return console.error(a), !1;
283
- }
284
- },
285
- async onSubmit() {
286
- this.validate(), await this.updateApiKey(), this.apiKey && this.closeDialog();
287
- },
288
- async updateApiKey() {
289
- try {
290
- if (this.isLoading = !0, await this.isValidApiKey())
291
- this.config.apiKey !== this.apiKey && this.updateConfig({
292
- ...this.config,
293
- apiKey: this.apiKey
294
- }), this.cookies.set("apiKey", this.apiKey, {
295
- expires: new Date(Date.now() + 1e3 * 60 * 60 * 24 * 365)
296
- });
297
- else
298
- throw new Error("Invalid API Key");
299
- } catch {
300
- console.error("Invalid API Key");
301
- } finally {
302
- this.isLoading = !1;
303
- }
304
- },
305
- validate() {
306
- this.$refs.apiKeyEditorForm.validate();
307
- }
308
- },
309
- mixins: [
310
- Oe(["config.apiEnvironment"], "updateApiKey", {
311
- deep: !0,
312
- immediate: !0
313
- }),
314
- Ve
315
- ],
316
- name: "ApiKeyEditor",
317
- setup() {
318
- const t = /* @__PURE__ */ re(["apiKey"]), { t: e } = J(), a = A(t.get("apiKey")), i = R(
319
- () => window.RevolugoElements.config.apiEnvironment
320
- ), c = R(() => [
321
- (d) => !!d || `A valid API Key is required. ${e("ApiKeyEditor.hint", {
322
- environment: i.value
323
- })}`
324
- ]), g = A(!1), u = A(!1), h = A(!1);
325
- return {
326
- apiKey: a,
327
- apiKeyRules: c,
328
- cookies: t,
329
- dialog: g,
330
- isFormValid: u,
331
- isLoading: h,
332
- t: e
333
- };
334
- }
335
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-explicit-any
336
- });
337
- function W(t) {
338
- const e = t;
339
- e.__i18n = e.__i18n || [], e.__i18n.push({
340
- locale: "",
341
- resource: {
342
- "en-US": {
343
- ApiKeyEditor: {
344
- hint: { t: 0, b: { t: 2, i: [{ t: 3, v: "Please, put your Publishable API Key for " }, { t: 4, k: "environment" }, { t: 3, v: " environment" }] } },
345
- invalid: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Provided API Key credential is not valid" } }
346
- }
347
- },
348
- "fr-FR": {
349
- ApiKeyEditor: {
350
- hint: { t: 0, b: { t: 2, i: [{ t: 3, v: "Indiquez votre clé API Publishable pour l'environnement " }, { t: 4, k: "environment" }] } },
351
- invalid: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "La clé API renseignée est invalide." } }
352
- }
353
- },
354
- "de-DE": {
355
- ApiKeyEditor: {
356
- hint: { t: 0, b: { t: 2, i: [{ t: 3, v: "Bitte gib deinen Veröffentlichen API-Schlüssel für die " }, { t: 4, k: "environment" }, { t: 3, v: " Umgebung an" }] } },
357
- invalid: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Der angegebene API-Schlüssel ist ungültig" } }
358
- }
359
- },
360
- "es-ES": {
361
- ApiKeyEditor: {
362
- hint: { t: 0, b: { t: 2, i: [{ t: 3, v: "Por favor, introduzca su clave API pública para el entorno " }, { t: 4, k: "environment" }] } },
363
- invalid: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "La clave API proporcionada no es válida" } }
364
- }
365
- },
366
- "it-IT": {
367
- ApiKeyEditor: {
368
- hint: { t: 0, b: { t: 2, i: [{ t: 3, v: "Inserisci la tua chiave API pubblica per l'ambiente " }, { t: 4, k: "environment" }] } },
369
- invalid: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "La chiave API fornita non è valida" } }
370
- }
371
- },
372
- "nl-NL": {
373
- ApiKeyEditor: {
374
- hint: { t: 0, b: { t: 2, i: [{ t: 3, v: "Vul hier uw Publishable API Key in voor de " }, { t: 4, k: "environment" }, { t: 3, v: " omgeving" }] } },
375
- invalid: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "De opgegeven API Key is ongeldig" } }
376
- }
377
- },
378
- "pt-PT": {
379
- ApiKeyEditor: {
380
- hint: { t: 0, b: { t: 2, i: [{ t: 3, v: "Por favor, coloque a sua chave API Publicável para o ambiente " }, { t: 4, k: "environment" }] } },
381
- invalid: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "A credencial da chave API fornecida não é válida" } }
382
- }
383
- }
384
- }
385
- });
386
- }
387
- function Re(t, e, a, i, c, g) {
388
- return _(), O("div", null, [
389
- o(se, {
390
- modelValue: t.dialog,
391
- "onUpdate:modelValue": e[2] || (e[2] = (u) => t.dialog = u),
392
- attach: t.$dialogAttach || void 0,
393
- "max-width": "600px"
394
- }, {
395
- activator: r(({ props: u }) => [
396
- o(k, X(u, {
397
- color: t.cookies.get("apiKey") ? "success" : "warning",
398
- elevation: "0",
399
- size: "x-small"
400
- }), {
401
- default: r(() => [
402
- t.cookies.get("apiKey") ? (_(), O(F, { key: 1 }, [
403
- o(q, { class: "mr-2" }, {
404
- default: r(() => [...e[5] || (e[5] = [
405
- S(" fas fa-check ", -1)
406
- ])]),
407
- _: 1
408
- }),
409
- e[6] || (e[6] = S(" Valid API key ", -1))
410
- ], 64)) : (_(), O(F, { key: 0 }, [
411
- o(q, { class: "mr-2" }, {
412
- default: r(() => [...e[3] || (e[3] = [
413
- S(" fas fa-exclamation ", -1)
414
- ])]),
415
- _: 1
416
- }),
417
- e[4] || (e[4] = S(" No API key provided ", -1))
418
- ], 64))
419
- ]),
420
- _: 1
421
- }, 16, ["color"])
422
- ]),
423
- default: r(() => [
424
- o(ee, null, {
425
- default: r(() => [
426
- o(te, { class: "pa-4" }, {
427
- default: r(() => [
428
- o($, { class: "pa-0" }, {
429
- default: r(() => [
430
- o(x, { "no-gutters": "" }, {
431
- default: r(() => [
432
- o(ie, null, {
433
- default: r(() => [
434
- o(ae, {
435
- ref: "apiKeyEditorForm",
436
- modelValue: t.isFormValid,
437
- "onUpdate:modelValue": e[1] || (e[1] = (u) => t.isFormValid = u),
438
- class: "m-0",
439
- onSubmit: Q(t.onSubmit, ["prevent"])
440
- }, {
441
- default: r(() => [
442
- o(D, {
443
- modelValue: t.apiKey,
444
- "onUpdate:modelValue": e[0] || (e[0] = (u) => t.apiKey = u),
445
- density: "compact",
446
- hint: t.t("ApiKeyEditor.hint", {
447
- environment: t.config.apiEnvironment
448
- }),
449
- label: "API Key",
450
- variant: "outlined",
451
- "persistent-hint": "",
452
- required: "",
453
- rules: t.apiKeyRules,
454
- onKeyup: T(t.onSubmit, ["enter"])
455
- }, null, 8, ["modelValue", "hint", "rules", "onKeyup"])
456
- ]),
457
- _: 1
458
- }, 8, ["modelValue", "onSubmit"])
459
- ]),
460
- _: 1
461
- })
462
- ]),
463
- _: 1
464
- })
465
- ]),
466
- _: 1
467
- })
468
- ]),
469
- _: 1
470
- }),
471
- o(ne, null, {
472
- default: r(() => [
473
- o(oe),
474
- o(k, {
475
- color: "blue-darken-1",
476
- size: "small",
477
- variant: "text",
478
- onClick: t.closeDialog
479
- }, {
480
- default: r(() => [...e[7] || (e[7] = [
481
- S(" Close ", -1)
482
- ])]),
483
- _: 1
484
- }, 8, ["onClick"]),
485
- o(k, {
486
- class: "text-right",
487
- color: "primary",
488
- disabled: t.isLoading,
489
- elevation: "0",
490
- loading: t.isLoading,
491
- size: "small",
492
- onClick: t.onSubmit
493
- }, {
494
- default: r(() => [...e[8] || (e[8] = [
495
- S(" Save ", -1)
496
- ])]),
497
- _: 1
498
- }, 8, ["disabled", "loading", "onClick"])
499
- ]),
500
- _: 1
501
- })
502
- ]),
503
- _: 1
504
- })
505
- ]),
506
- _: 1
507
- }, 8, ["modelValue", "attach"])
508
- ]);
509
- }
510
- typeof W == "function" && W(le);
511
- const Te = /* @__PURE__ */ N(le, [["render", Re]]), de = /* @__PURE__ */ M({
512
- __name: "EventMetadataEditor",
513
- setup(t) {
514
- const { config: e, updateConfig: a } = he(), i = /* @__PURE__ */ re(["eventMetadata"]), { isFetching: c } = ye(ke()), { t: g } = J(), u = A(null), { $dialogAttach: h } = Ce(u), d = [
515
- (b) => {
516
- if (!b)
517
- return !0;
518
- try {
519
- return (
520
- // eslint-disable-next-line no-constant-binary-expression
521
- !!new URL(b) || g("EventMetadataEditor.validation.imageURL")
522
- );
523
- } catch {
524
- return g("EventMetadataEditor.validation.imageURL");
525
- }
526
- }
527
- ], P = [
528
- (b) => !!b || g("EventMetadataEditor.validation.name")
529
- ], m = A(
530
- i.get("eventMetadata") || {
531
- dateEnd: H().add(1, "day").format("YYYY-MM-DD").toString(),
532
- dateStart: H().format("YYYY-MM-DD").toString(),
533
- name: ""
534
- }
535
- ), V = A(!1), s = A(!1), p = R({
536
- get() {
537
- return !m.value.dateStart || !m.value.dateEnd ? [] : B(
538
- m.value.dateStart,
539
- m.value.dateEnd
540
- );
541
- },
542
- set(b) {
543
- [m.value.dateStart, m.value.dateEnd] = B(...b);
544
- }
545
- });
546
- function n() {
547
- V.value = !1;
548
- }
549
- function y() {
550
- return !(!m.value.name?.length || !p.value[0] || !p.value[1]);
551
- }
552
- function C() {
553
- y() && (a({
554
- ...e.value,
555
- eventMetadata: m.value
556
- }), i.set("eventMetadata", JSON.stringify(m)), n());
557
- }
558
- function l() {
559
- C(), n();
560
- }
561
- function E() {
562
- i.remove("eventMetadata"), m.value = {}, a({
563
- ...e.value,
564
- eventMetadata: {}
565
- }), n();
566
- }
567
- return Ee(() => {
568
- i.get("eventMetadata") && a({
569
- ...e.value,
570
- eventMetadata: i.get("eventMetadata")
571
- });
572
- }), (b, f) => (_(), O("div", {
573
- ref_key: "root",
574
- ref: u
575
- }, [
576
- o(se, {
577
- modelValue: V.value,
578
- "onUpdate:modelValue": f[4] || (f[4] = (v) => V.value = v),
579
- attach: w(h),
580
- height: "600px",
581
- "max-width": "600px"
582
- }, {
583
- activator: r(({ props: v }) => [
584
- o(k, X(v, {
585
- color: w(i).get("eventMetadata") ? "success" : "warning",
586
- elevation: "0",
587
- size: "x-small"
588
- }), {
589
- default: r(() => [
590
- S(be(m.value?.name ? `EVENT : ${m.value?.name}` : "ADD EVENT METADATA"), 1)
591
- ]),
592
- _: 1
593
- }, 16, ["color"])
594
- ]),
595
- default: r(() => [
596
- o(ee, null, {
597
- default: r(() => [
598
- o(te, { class: "pa-4" }, {
599
- default: r(() => [
600
- o($, { class: "pa-0" }, {
601
- default: r(() => [
602
- o(x, { "no-gutters": "" }, {
603
- default: r(() => [
604
- o(ie, null, {
605
- default: r(() => [
606
- o(ae, {
607
- ref: "eventMetadataEditorForm",
608
- modelValue: s.value,
609
- "onUpdate:modelValue": f[3] || (f[3] = (v) => s.value = v),
610
- class: "m-0",
611
- onSubmit: Q(l, ["prevent"])
612
- }, {
613
- default: r(() => [
614
- o(D, {
615
- modelValue: m.value.name,
616
- "onUpdate:modelValue": f[0] || (f[0] = (v) => m.value.name = v),
617
- density: "compact",
618
- label: "Name of the event",
619
- variant: "outlined",
620
- "persistent-hint": "",
621
- required: "",
622
- rules: P,
623
- onKeyup: T(l, ["enter"])
624
- }, null, 8, ["modelValue"]),
625
- o(D, {
626
- modelValue: m.value.imageUrl,
627
- "onUpdate:modelValue": f[1] || (f[1] = (v) => m.value.imageUrl = v),
628
- density: "compact",
629
- label: "Image URL",
630
- variant: "outlined",
631
- "persistent-hint": "",
632
- rules: d,
633
- onKeyup: T(l, ["enter"])
634
- }, null, 8, ["modelValue"]),
635
- o(x, null, {
636
- default: r(() => [
637
- o(we, {
638
- modelValue: p.value,
639
- "onUpdate:modelValue": f[2] || (f[2] = (v) => p.value = v)
640
- }, null, 8, ["modelValue"])
641
- ]),
642
- _: 1
643
- })
644
- ]),
645
- _: 1
646
- }, 8, ["modelValue"])
647
- ]),
648
- _: 1
649
- })
650
- ]),
651
- _: 1
652
- })
653
- ]),
654
- _: 1
655
- })
656
- ]),
657
- _: 1
658
- }),
659
- o(ne, null, {
660
- default: r(() => [
661
- o(oe),
662
- o(k, {
663
- color: "grey",
664
- size: "small",
665
- variant: "text",
666
- onClick: n
667
- }, {
668
- default: r(() => [...f[5] || (f[5] = [
669
- S(" Close ", -1)
670
- ])]),
671
- _: 1
672
- }),
673
- o(k, {
674
- color: "error",
675
- disabled: w(c),
676
- loading: w(c),
677
- size: "small",
678
- variant: "text",
679
- onClick: E
680
- }, {
681
- default: r(() => [...f[6] || (f[6] = [
682
- S(" Reset ", -1)
683
- ])]),
684
- _: 1
685
- }, 8, ["disabled", "loading"]),
686
- o(k, {
687
- color: "success",
688
- disabled: w(c),
689
- loading: w(c),
690
- size: "small",
691
- variant: "flat",
692
- onClick: l
693
- }, {
694
- default: r(() => [...f[7] || (f[7] = [
695
- S(" Save ", -1)
696
- ])]),
697
- _: 1
698
- }, 8, ["disabled", "loading"])
699
- ]),
700
- _: 1
701
- })
702
- ]),
703
- _: 1
704
- })
705
- ]),
706
- _: 1
707
- }, 8, ["modelValue", "attach"])
708
- ], 512));
709
- }
710
- });
711
- function G(t) {
712
- const e = t;
713
- e.__i18n = e.__i18n || [], e.__i18n.push({
714
- locale: "",
715
- resource: {
716
- "en-US": {
717
- EventMetadataEditor: {
718
- validation: {
719
- imageURL: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Please provide a valid URL" } },
720
- name: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Please provide a name" } }
721
- }
722
- }
723
- },
724
- "fr-FR": {
725
- EventMetadataEditor: {
726
- validation: {
727
- imageURL: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Veuillez fournir une URL valide d'image" } },
728
- name: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Veuillez entrer le nom de l'événement" } }
729
- }
730
- }
731
- },
732
- "de-DE": {
733
- EventMetadataEditor: {
734
- validation: {
735
- imageURL: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Bitte geben Sie eine gültige URL an" } },
736
- name: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Bitte geben Sie einen Namen an" } }
737
- }
738
- }
739
- },
740
- "es-ES": {
741
- EventMetadataEditor: {
742
- validation: {
743
- imageURL: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Por favor, introduce una URL válida" } },
744
- name: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Por favor, introduce un nombre" } }
745
- }
746
- }
747
- },
748
- "it-IT": {
749
- EventMetadataEditor: {
750
- validation: {
751
- imageURL: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Inserisci un URL valido" } },
752
- name: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Inserisci un nome" } }
753
- }
754
- }
755
- },
756
- "nl-NL": {
757
- EventMetadataEditor: {
758
- validation: {
759
- imageURL: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Geef een geldige URL op" } },
760
- name: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Geef een naam op" } }
761
- }
762
- }
763
- },
764
- "pt-PT": {
765
- EventMetadataEditor: {
766
- validation: {
767
- imageURL: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Por favor, introduza um URL válido" } },
768
- name: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Por favor, introduza um nome" } }
769
- }
770
- }
771
- }
772
- }
773
- });
774
- }
775
- typeof G == "function" && G(de);
776
- const De = M({
777
- components: {
778
- ApiKeyEditor: Te,
779
- EventMetadataEditor: de
780
- },
781
- name: "StorybookExtraToolbar"
782
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-explicit-any
783
- }), Ne = { class: "flex gap-1 px-3" };
784
- function $e(t, e, a, i, c, g) {
785
- const u = I("ApiKeyEditor"), h = I("EventMetadataEditor");
786
- return _(), Z($, {
787
- class: "pa-0 mb-3",
788
- fluid: ""
789
- }, {
790
- default: r(() => [
791
- o(x, { "no-gutters": "" }, {
792
- default: r(() => [
793
- Se("div", Ne, [
794
- o(u),
795
- o(h)
796
- ])
797
- ]),
798
- _: 1
799
- })
800
- ]),
801
- _: 1
802
- });
803
- }
804
- const je = /* @__PURE__ */ N(De, [["render", $e]]), ze = M({
805
- components: {
806
- StorybookExtraToolbar: je,
807
- WebComponentWrapper: _e
808
- }
809
- });
810
- function Fe(t, e, a, i, c, g) {
811
- const u = I("StorybookExtraToolbar"), h = I("WebComponentWrapper");
812
- return _(), Z(h, { "error-overlay-disabled": "" }, {
813
- default: r(() => [
814
- o(u)
815
- ]),
816
- _: 1
817
- });
818
- }
819
- const We = /* @__PURE__ */ N(ze, [["render", Fe]]);
820
- me("css/revolugo.storybooktoolbar.d_cxquq9.css");
821
- export {
822
- We as default
823
- };
824
- //# sourceMappingURL=revolugo.storybooktoolbar.D828oQt9.min.js.map