@everymatrix/general-player-login-form 1.63.3 → 1.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { $ as L, a as Z, b as $, S as ee, i as te, f as M, s as ie, c as oe, d as re, n as Y, e as R, r as ne, g as T, h as J, j as v, k as P, l as s, m as q, o as k, p as z, t as S, q as ae, u as se, v as le, w as de, x as ce, y as ue, z as me } from "./GeneralPlayerLoginForm-DS12mJtt.js";
1
+ import { $ as D, a as Z, b as $, S as ee, i as te, f as M, s as ie, c as oe, d as re, n as Y, e as R, r as ne, g as E, h as J, j as v, k as P, l as s, m as L, o as k, p as z, t as S, q as ae, u as se, v as le, w as de, x as ce, y as ue, z as me } from "./GeneralPlayerLoginForm-BNFAIasR.js";
2
2
  function fe({ withLocale: o, translations: e }) {
3
- L.subscribe((i) => {
4
- i == null && (Z.set(e), L.set(o));
3
+ D.subscribe((i) => {
4
+ i == null && (Z.set(e), D.set(o));
5
5
  });
6
6
  }
7
7
  function G(o, e) {
@@ -115,7 +115,7 @@ const K = {
115
115
  }
116
116
  };
117
117
  function ve(o) {
118
- re(o, "svelte-uutjwi", "*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.Title{font-size:14px;margin:0;padding-bottom:20px}.Field{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;padding-bottom:30px;position:relative}.Field label{font-size:14px;font-weight:300;padding-bottom:5px}.Field input,.Field select{width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.Field.InvalidField input{border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));background:var(--emw--color-pale, #FBECF4);color:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C))}.Field.Hidden{display:none}.LoginSMSHint{margin-top:20px}.InvalidInput{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:10px;line-height:10px}.ErrorMessage{margin:0 0 15px 0;font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.Button{color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;margin-top:24px}.Button[disabled]{background:var(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-100, #E6E6E6);cursor:not-allowed}.Button.SmsVerificationResend{background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8));color:var(--emw--registration-typography, var(--emw--color-contrast, #07072A))}");
118
+ re(o, "svelte-c25n4u", "*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.Title{font-size:14px;margin:0;padding-bottom:20px}.Field{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;padding-bottom:30px;position:relative}.Field label{font-size:14px;font-weight:300;padding-bottom:5px}.Field input,.Field select{width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.Field.InvalidField input{border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));background:var(--emw--color-pale, #FBECF4);color:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E))}.Field.Hidden{display:none}.LoginSMSHint{margin-top:20px}.InvalidInput{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:10px;line-height:10px}.ErrorMessage{margin:0 0 15px 0;font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.Button{color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;margin-top:24px}.Button[disabled]{background:var(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-100, #E6E6E6);cursor:not-allowed}.Button.SmsVerificationResend{background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8));color:var(--emw--registration-typography, var(--emw--color-contrast, #07072A))}");
119
119
  }
120
120
  function ge(o) {
121
121
  let e = (
@@ -132,7 +132,7 @@ function ge(o) {
132
132
  p(a, r) {
133
133
  r & /*$_*/
134
134
  32 && e !== (e = /*$_*/
135
- a[5]("errorTitle") + "") && T(i, e);
135
+ a[5]("errorTitle") + "") && E(i, e);
136
136
  },
137
137
  d(a) {
138
138
  a && R(i);
@@ -154,7 +154,7 @@ function pe(o) {
154
154
  p(a, r) {
155
155
  r & /*$_*/
156
156
  32 && e !== (e = /*$_*/
157
- a[5]("title") + "") && T(i, e);
157
+ a[5]("title") + "") && E(i, e);
158
158
  },
159
159
  d(a) {
160
160
  a && R(i);
@@ -176,7 +176,7 @@ function W(o) {
176
176
  p(r, l) {
177
177
  l & /*$_*/
178
178
  32 && i !== (i = /*$_*/
179
- r[5]("smsCodeError") + "") && T(a, i);
179
+ r[5]("smsCodeError") + "") && E(a, i);
180
180
  },
181
181
  d(r) {
182
182
  r && R(e);
@@ -198,7 +198,7 @@ function Q(o) {
198
198
  p(r, l) {
199
199
  l & /*$_*/
200
200
  32 && i !== (i = /*$_*/
201
- r[5]("resendMessage") + "") && T(a, i);
201
+ r[5]("resendMessage") + "") && E(a, i);
202
202
  },
203
203
  d(r) {
204
204
  r && R(e);
@@ -223,8 +223,8 @@ function X(o) {
223
223
  p(p, h) {
224
224
  h & /*secondsLeft*/
225
225
  16 && a !== (a = /*secondsLeft*/
226
- p[4] < 10 ? "0" : "") && T(r, a), h & /*secondsLeft*/
227
- 16 && T(
226
+ p[4] < 10 ? "0" : "") && E(r, a), h & /*secondsLeft*/
227
+ 16 && E(
228
228
  l,
229
229
  /*secondsLeft*/
230
230
  p[4]
@@ -239,20 +239,20 @@ function ye(o) {
239
239
  let e, i, a, r, l, g = (
240
240
  /*$_*/
241
241
  o[5]("code") + ""
242
- ), p, h, C, E, d, F, _, I, j, w, y = (
242
+ ), p, h, _, T, d, F, C, I, j, w, y = (
243
243
  /*$_*/
244
244
  o[5]("activate") + ""
245
- ), x, U, c, V = (
245
+ ), x, B, c, V = (
246
246
  /*$_*/
247
247
  o[5]("resend") + ""
248
- ), N, O, D, H;
249
- function B(n, f) {
248
+ ), U, q, N, H;
249
+ function O(n, f) {
250
250
  return (
251
251
  /*isSmsValid*/
252
252
  n[2] ? pe : ge
253
253
  );
254
254
  }
255
- let A = B(o), b = A(o), u = !/*isSmsValid*/
255
+ let A = O(o), b = A(o), u = !/*isSmsValid*/
256
256
  o[2] && W(o), m = (
257
257
  /*timer*/
258
258
  o[3] && Q(o)
@@ -262,46 +262,46 @@ function ye(o) {
262
262
  );
263
263
  return {
264
264
  c() {
265
- e = k("div"), i = k("h3"), b.c(), a = z(), r = k("div"), l = k("label"), p = S(g), h = S(":"), C = k("span"), C.textContent = "*", E = z(), d = k("input"), F = z(), u && u.c(), I = z(), m && m.c(), j = z(), w = k("button"), x = S(y), U = z(), c = k("button"), N = S(V), O = z(), t && t.c(), v(i, "class", "Title"), v(C, "class", "FormRequired"), v(l, "for", "SmsCode"), v(d, "type", "text"), v(d, "id", "SmsCode"), v(d, "inputmode", "numeric"), v(d, "pattern", "[0-9]*"), v(d, "maxlength", "6"), v(r, "class", _ = "Field SmsVerificationField " + (/*isSmsValid*/
265
+ e = k("div"), i = k("h3"), b.c(), a = z(), r = k("div"), l = k("label"), p = S(g), h = S(":"), _ = k("span"), _.textContent = "*", T = z(), d = k("input"), F = z(), u && u.c(), I = z(), m && m.c(), j = z(), w = k("button"), x = S(y), B = z(), c = k("button"), U = S(V), q = z(), t && t.c(), v(i, "class", "Title"), v(_, "class", "FormRequired"), v(l, "for", "SmsCode"), v(d, "type", "text"), v(d, "id", "SmsCode"), v(d, "inputmode", "numeric"), v(d, "pattern", "[0-9]*"), v(d, "maxlength", "6"), v(r, "class", C = "Field SmsVerificationField " + (/*isSmsValid*/
266
266
  o[2] ? "" : "InvalidField")), v(w, "class", "Button SmsVerificationValidate"), v(c, "class", "Button SmsVerificationResend"), c.disabled = /*timer*/
267
267
  o[3], v(e, "class", "Container SmsVerificationContainer");
268
268
  },
269
269
  m(n, f) {
270
- P(n, e, f), s(e, i), b.m(i, null), s(e, a), s(e, r), s(r, l), s(l, p), s(l, h), s(l, C), s(r, E), s(r, d), J(
270
+ P(n, e, f), s(e, i), b.m(i, null), s(e, a), s(e, r), s(r, l), s(l, p), s(l, h), s(l, _), s(r, T), s(r, d), J(
271
271
  d,
272
272
  /*smsCode*/
273
273
  o[1]
274
- ), s(r, F), u && u.m(r, null), s(e, I), m && m.m(e, null), s(e, j), s(e, w), s(w, x), s(e, U), s(e, c), s(c, N), s(c, O), t && t.m(c, null), o[20](e), D || (H = [
275
- q(
274
+ ), s(r, F), u && u.m(r, null), s(e, I), m && m.m(e, null), s(e, j), s(e, w), s(w, x), s(e, B), s(e, c), s(c, U), s(c, q), t && t.m(c, null), o[20](e), N || (H = [
275
+ L(
276
276
  d,
277
277
  "input",
278
278
  /*input_input_handler*/
279
279
  o[18]
280
280
  ),
281
- q(
281
+ L(
282
282
  d,
283
283
  "keydown",
284
284
  /*keydown_handler*/
285
285
  o[19]
286
286
  ),
287
- q(
287
+ L(
288
288
  w,
289
289
  "click",
290
290
  /*activateUser*/
291
291
  o[6]
292
292
  ),
293
- q(
293
+ L(
294
294
  c,
295
295
  "click",
296
296
  /*resendCode*/
297
297
  o[7]
298
298
  )
299
- ], D = !0);
299
+ ], N = !0);
300
300
  },
301
301
  p(n, [f]) {
302
- A === (A = B(n)) && b ? b.p(n, f) : (b.d(1), b = A(n), b && (b.c(), b.m(i, null))), f & /*$_*/
302
+ A === (A = O(n)) && b ? b.p(n, f) : (b.d(1), b = A(n), b && (b.c(), b.m(i, null))), f & /*$_*/
303
303
  32 && g !== (g = /*$_*/
304
- n[5]("code") + "") && T(p, g), f & /*smsCode*/
304
+ n[5]("code") + "") && E(p, g), f & /*smsCode*/
305
305
  2 && d.value !== /*smsCode*/
306
306
  n[1] && J(
307
307
  d,
@@ -309,13 +309,13 @@ function ye(o) {
309
309
  n[1]
310
310
  ), /*isSmsValid*/
311
311
  n[2] ? u && (u.d(1), u = null) : u ? u.p(n, f) : (u = W(n), u.c(), u.m(r, null)), f & /*isSmsValid*/
312
- 4 && _ !== (_ = "Field SmsVerificationField " + (/*isSmsValid*/
313
- n[2] ? "" : "InvalidField")) && v(r, "class", _), /*timer*/
312
+ 4 && C !== (C = "Field SmsVerificationField " + (/*isSmsValid*/
313
+ n[2] ? "" : "InvalidField")) && v(r, "class", C), /*timer*/
314
314
  n[3] ? m ? m.p(n, f) : (m = Q(n), m.c(), m.m(e, j)) : m && (m.d(1), m = null), f & /*$_*/
315
315
  32 && y !== (y = /*$_*/
316
- n[5]("activate") + "") && T(x, y), f & /*$_*/
316
+ n[5]("activate") + "") && E(x, y), f & /*$_*/
317
317
  32 && V !== (V = /*$_*/
318
- n[5]("resend") + "") && T(N, V), /*timer*/
318
+ n[5]("resend") + "") && E(U, V), /*timer*/
319
319
  n[3] ? t ? t.p(n, f) : (t = X(n), t.c(), t.m(c, null)) : t && (t.d(1), t = null), f & /*timer*/
320
320
  8 && (c.disabled = /*timer*/
321
321
  n[3]);
@@ -323,17 +323,17 @@ function ye(o) {
323
323
  i: Y,
324
324
  o: Y,
325
325
  d(n) {
326
- n && R(e), b.d(), u && u.d(), m && m.d(), t && t.d(), o[20](null), D = !1, ne(H);
326
+ n && R(e), b.d(), u && u.d(), m && m.d(), t && t.d(), o[20](null), N = !1, ne(H);
327
327
  }
328
328
  };
329
329
  }
330
330
  function he(o, e, i) {
331
331
  let a;
332
332
  ae(o, de, (t) => i(5, a = t));
333
- let { endpoint: r = "" } = e, { tokenid: l = "" } = e, { playerid: g = "" } = e, { smstemplate: p = "Please use this code {0} to activate your accout" } = e, { number: h = "" } = e, { mbsource: C } = e, { clientstyling: E = "" } = e, { clientstylingurl: d = "" } = e, { translationurl: F = "" } = e, _, I = !0, j = !1, w, y, x = +localStorage.getItem("smsTimer") || 0, U = Date.now() / 1e3 - x, c = 60 - Math.floor(U);
333
+ let { endpoint: r = "" } = e, { tokenid: l = "" } = e, { playerid: g = "" } = e, { smstemplate: p = "Please use this code {0} to activate your accout" } = e, { number: h = "" } = e, { mbsource: _ } = e, { clientstyling: T = "" } = e, { clientstylingurl: d = "" } = e, { translationurl: F = "" } = e, C, I = !0, j = !1, w, y, x = +localStorage.getItem("smsTimer") || 0, B = Date.now() / 1e3 - x, c = 60 - Math.floor(B);
334
334
  const V = { numeric: /^[0-9]{0,6}$/ };
335
335
  fe({ withLocale: "en", translations: {} });
336
- const N = () => {
336
+ const U = () => {
337
337
  fetch(F).then((n) => n.json()).then((n) => {
338
338
  Object.keys(n).forEach((f) => {
339
339
  G(f, n[f]);
@@ -345,9 +345,9 @@ function he(o, e, i) {
345
345
  Object.keys(K).forEach((t) => {
346
346
  G(t, K[t]);
347
347
  });
348
- const O = async () => {
348
+ const q = async () => {
349
349
  try {
350
- if ((await fetch(`${r}/v1/player/${g}/activateSMS?tokenId=${l}&validationCode=${_}`, {
350
+ if ((await fetch(`${r}/v1/player/${g}/activateSMS?tokenId=${l}&validationCode=${C}`, {
351
351
  headers: {
352
352
  "Content-Type": "application/json",
353
353
  accept: "application/json"
@@ -368,8 +368,8 @@ function he(o, e, i) {
368
368
  } catch (t) {
369
369
  console.log(t);
370
370
  }
371
- }, D = async () => {
372
- localStorage.setItem("smsTimer", JSON.stringify(Math.floor(Date.now() / 1e3))), B();
371
+ }, N = async () => {
372
+ localStorage.setItem("smsTimer", JSON.stringify(Math.floor(Date.now() / 1e3))), O();
373
373
  try {
374
374
  const t = await fetch(`${r}/v1/player/sms/token`, {
375
375
  method: "POST",
@@ -392,8 +392,8 @@ function he(o, e, i) {
392
392
  }
393
393
  }, H = () => {
394
394
  c > 0 ? i(4, c--, c) : (clearInterval(w), i(3, w = !1), i(4, c = 60));
395
- }, B = () => {
396
- U < 60 && i(3, w = setInterval(
395
+ }, O = () => {
396
+ B < 60 && i(3, w = setInterval(
397
397
  () => {
398
398
  H();
399
399
  },
@@ -407,11 +407,11 @@ function he(o, e, i) {
407
407
  let t = JSON.parse(localStorage.getItem("playerData"));
408
408
  i(10, g = t.playerid), i(11, h = t.number);
409
409
  }
410
- return B(), () => {
410
+ return O(), () => {
411
411
  };
412
412
  });
413
413
  function b() {
414
- _ = this.value, i(1, _);
414
+ C = this.value, i(1, C);
415
415
  }
416
416
  const u = (t) => A(t);
417
417
  function m(t) {
@@ -420,31 +420,31 @@ function he(o, e, i) {
420
420
  });
421
421
  }
422
422
  return o.$$set = (t) => {
423
- "endpoint" in t && i(12, r = t.endpoint), "tokenid" in t && i(9, l = t.tokenid), "playerid" in t && i(10, g = t.playerid), "smstemplate" in t && i(13, p = t.smstemplate), "number" in t && i(11, h = t.number), "mbsource" in t && i(14, C = t.mbsource), "clientstyling" in t && i(15, E = t.clientstyling), "clientstylingurl" in t && i(16, d = t.clientstylingurl), "translationurl" in t && i(17, F = t.translationurl);
423
+ "endpoint" in t && i(12, r = t.endpoint), "tokenid" in t && i(9, l = t.tokenid), "playerid" in t && i(10, g = t.playerid), "smstemplate" in t && i(13, p = t.smstemplate), "number" in t && i(11, h = t.number), "mbsource" in t && i(14, _ = t.mbsource), "clientstyling" in t && i(15, T = t.clientstyling), "clientstylingurl" in t && i(16, d = t.clientstylingurl), "translationurl" in t && i(17, F = t.translationurl);
424
424
  }, o.$$.update = () => {
425
425
  o.$$.dirty & /*tokenid, playerid, endpoint*/
426
426
  5632, o.$$.dirty & /*clientstyling, customStylingContainer*/
427
- 32769 && E && y && ce(y, E), o.$$.dirty & /*clientstylingurl, customStylingContainer*/
427
+ 32769 && T && y && ce(y, T), o.$$.dirty & /*clientstylingurl, customStylingContainer*/
428
428
  65537 && d && y && ue(y, d), o.$$.dirty & /*mbsource, customStylingContainer*/
429
- 16385 && C && y && me(y, `${C}.Style`), o.$$.dirty & /*translationurl*/
430
- 131072 && F && N();
429
+ 16385 && _ && y && me(y, `${_}.Style`), o.$$.dirty & /*translationurl*/
430
+ 131072 && F && U();
431
431
  }, [
432
432
  y,
433
- _,
433
+ C,
434
434
  I,
435
435
  w,
436
436
  c,
437
437
  a,
438
- O,
439
- D,
438
+ q,
439
+ N,
440
440
  A,
441
441
  l,
442
442
  g,
443
443
  h,
444
444
  r,
445
445
  p,
446
- C,
447
- E,
446
+ _,
447
+ T,
448
448
  d,
449
449
  F,
450
450
  b,
@@ -1 +1 @@
1
- "use strict";var V=(r,t,n)=>new Promise((s,o)=>{var l=d=>{try{c(n.next(d))}catch(h){o(h)}},m=d=>{try{c(n.throw(d))}catch(h){o(h)}},c=d=>d.done?s(d.value):Promise.resolve(d.value).then(l,m);c((n=n.apply(r,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./GeneralPlayerLoginForm-i4oeSokc.cjs");function O({withLocale:r,translations:t}){e.$locale.subscribe(n=>{n==null&&(e.$dictionary.set(t),e.$locale.set(r))})}function R(r,t){e.addMessages(r,t)}const U={en:{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"A new verification code has been sent to your phone number.",activate:"Activate Account",resend:"Resend",loginSMSHint:"A new verification code has been sent to your phone number"},"zh-hk":{title:"请输入您在号码上收到的验证码",errorTitle:"您的代码无效,您可以重新发送代码并重试",code:"短信代码",smsCodeError:"短信验证码无效,请重新发送验证码",resendMessage:"新的验证码已发送至您的手机号码",activate:"激活账户",resend:"重发"},fr:{title:"Veuillez entrer le code de vérification que vous avez reçu sur votre numéro",errorTitle:"Votre code n'était pas valide, vous pouvez renvoyer le code et réessayer",code:"Code SMS",smsCodeError:"Code sms invalide, vous pouvez renvoyer le code",resendMessage:"Un nouveau code de vérification a été envoyé à votre numéro de téléphone.",activate:"Activer le compte",resend:"Renvoyer"},tr:{title:"Please enter the verification code you received on your number",errorTitle:"Kodunuz geçersizdi, kodu tekrar gönderip tekrar deneyebilirsiniz",code:"SMS kodu",smsCodeError:"Geçersiz sms kodu, kodu tekrar gönderebilirsiniz",resendMessage:"Telefon numaranıza yeni bir doğrulama kodu gönderildi.",activate:"Aktif hesap",resend:"Yeniden gönder",loginSMSHint:"Telefon numaranıza yeni bir doğrulama kodu gönderildi"},ro:{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"Un nou cod de verificare a fost trimis catre numarul dumneavoastra.",activate:"Activate Account",resend:"Resend"},es:{title:"Por favor ingrese su código de verificación enviado por mensaje de texto a su número de telefono",errorTitle:"Su código es invalido",code:"Código SMS",smsCodeError:"Código SMS invalido",resendMessage:"Un nuevo codigo de verificación ha sido enviado a tu número celular.",activate:"Activar Cuenta",resend:"Reenviar"},pt:{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"Um novo código de verificação foi enviado para o seu número de telefone.",activate:"Activate Account",resend:"Resend"},hr:{title:"Unesite verifikacijski kod koji ste primili na svoj broj telefona",errorTitle:"Vaš kod je nevažeći",code:"Sms kod",smsCodeError:"Nevažeći sms kod",resendMessage:"Novi verifkacijski kod poslan je na vaš broj telefona.",activate:"Aktiviraj račun",resend:"Ponovno pošalji",loginSMSHint:"Novi verifkacijski kod poslan je na vaš broj telefona"},"pt-br":{title:"Por favor, insira o código de verificação que você recebeu no seu número de celular",errorTitle:"Código inválido,vôce pode reenviar o código e tentar novamente",code:"Código SMS",smsCodeError:"Código SMS inválido,vôce pode reenviar o código",resendMessage:"Um novo código de verificação foi enviado para o seu número de celular.",activate:"Ativar conta",resend:"Reenviar",loginSMSHint:"Um novo código de verificação foi enviado para o seu número de celular."},"es-mx":{title:"Por favor ingrese el código de verificación que recibió en su número móvil",errorTitle:"Código inválido,Puede enviar el código e intentar de nuevo",code:"Código SMS",smsCodeError:"Código SMS inválido,Puede reenviar el código",resendMessage:"Un nuevo código de verificación ha sido enviado a su número móvil .",activate:"Activar Cuenta",resend:"Reenviar",loginSMSHint:"Un nuevo código de verificación ha sido enviado a su número móvil ."},"en-us":{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"A new verification code has been sent to your phone number.",activate:"Activate Account",resend:"Resend",loginSMSHint:"A new verification code has been sent to your phone number"}};function L(r){e.append_styles(r,"svelte-uutjwi","*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.Title{font-size:14px;margin:0;padding-bottom:20px}.Field{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;padding-bottom:30px;position:relative}.Field label{font-size:14px;font-weight:300;padding-bottom:5px}.Field input,.Field select{width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.Field.InvalidField input{border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));background:var(--emw--color-pale, #FBECF4);color:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C))}.Field.Hidden{display:none}.LoginSMSHint{margin-top:20px}.InvalidInput{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:10px;line-height:10px}.ErrorMessage{margin:0 0 15px 0;font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.Button{color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;margin-top:24px}.Button[disabled]{background:var(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-100, #E6E6E6);cursor:not-allowed}.Button.SmsVerificationResend{background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8));color:var(--emw--registration-typography, var(--emw--color-contrast, #07072A))}")}function q(r){let t=r[5]("errorTitle")+"",n;return{c(){n=e.text(t)},m(s,o){e.insert(s,n,o)},p(s,o){o&32&&t!==(t=s[5]("errorTitle")+"")&&e.set_data(n,t)},d(s){s&&e.detach(n)}}}function Y(r){let t=r[5]("title")+"",n;return{c(){n=e.text(t)},m(s,o){e.insert(s,n,o)},p(s,o){o&32&&t!==(t=s[5]("title")+"")&&e.set_data(n,t)},d(s){s&&e.detach(n)}}}function N(r){let t,n=r[5]("smsCodeError")+"",s;return{c(){t=e.element("p"),s=e.text(n),e.attr(t,"class","InvalidInput")},m(o,l){e.insert(o,t,l),e.append(t,s)},p(o,l){l&32&&n!==(n=o[5]("smsCodeError")+"")&&e.set_data(s,n)},d(o){o&&e.detach(t)}}}function D(r){let t,n=r[5]("resendMessage")+"",s;return{c(){t=e.element("p"),s=e.text(n),e.attr(t,"class","SmsVerificationResendMessage")},m(o,l){e.insert(o,t,l),e.append(t,s)},p(o,l){l&32&&n!==(n=o[5]("resendMessage")+"")&&e.set_data(s,n)},d(o){o&&e.detach(t)}}}function H(r){let t,n,s=r[4]<10?"0":"",o,l,m;return{c(){t=e.element("span"),n=e.text("(0:"),o=e.text(s),l=e.text(r[4]),m=e.text(")"),e.attr(t,"class","SmsVerificationResendTimer")},m(c,d){e.insert(c,t,d),e.append(t,n),e.append(t,o),e.append(t,l),e.append(t,m)},p(c,d){d&16&&s!==(s=c[4]<10?"0":"")&&e.set_data(o,s),d&16&&e.set_data(l,c[4])},d(c){c&&e.detach(t)}}}function G(r){let t,n,s,o,l,m=r[5]("code")+"",c,d,h,w,u,_,k,T,C,S,y=r[5]("activate")+"",E,j,p,F=r[5]("resend")+"",A,P,x,z;function I(a,g){return a[2]?Y:q}let M=I(r),b=M(r),f=!r[2]&&N(r),v=r[3]&&D(r),i=r[3]&&H(r);return{c(){t=e.element("div"),n=e.element("h3"),b.c(),s=e.space(),o=e.element("div"),l=e.element("label"),c=e.text(m),d=e.text(":"),h=e.element("span"),h.textContent="*",w=e.space(),u=e.element("input"),_=e.space(),f&&f.c(),T=e.space(),v&&v.c(),C=e.space(),S=e.element("button"),E=e.text(y),j=e.space(),p=e.element("button"),A=e.text(F),P=e.space(),i&&i.c(),e.attr(n,"class","Title"),e.attr(h,"class","FormRequired"),e.attr(l,"for","SmsCode"),e.attr(u,"type","text"),e.attr(u,"id","SmsCode"),e.attr(u,"inputmode","numeric"),e.attr(u,"pattern","[0-9]*"),e.attr(u,"maxlength","6"),e.attr(o,"class",k="Field SmsVerificationField "+(r[2]?"":"InvalidField")),e.attr(S,"class","Button SmsVerificationValidate"),e.attr(p,"class","Button SmsVerificationResend"),p.disabled=r[3],e.attr(t,"class","Container SmsVerificationContainer")},m(a,g){e.insert(a,t,g),e.append(t,n),b.m(n,null),e.append(t,s),e.append(t,o),e.append(o,l),e.append(l,c),e.append(l,d),e.append(l,h),e.append(o,w),e.append(o,u),e.set_input_value(u,r[1]),e.append(o,_),f&&f.m(o,null),e.append(t,T),v&&v.m(t,null),e.append(t,C),e.append(t,S),e.append(S,E),e.append(t,j),e.append(t,p),e.append(p,A),e.append(p,P),i&&i.m(p,null),r[20](t),x||(z=[e.listen(u,"input",r[18]),e.listen(u,"keydown",r[19]),e.listen(S,"click",r[6]),e.listen(p,"click",r[7])],x=!0)},p(a,[g]){M===(M=I(a))&&b?b.p(a,g):(b.d(1),b=M(a),b&&(b.c(),b.m(n,null))),g&32&&m!==(m=a[5]("code")+"")&&e.set_data(c,m),g&2&&u.value!==a[1]&&e.set_input_value(u,a[1]),a[2]?f&&(f.d(1),f=null):f?f.p(a,g):(f=N(a),f.c(),f.m(o,null)),g&4&&k!==(k="Field SmsVerificationField "+(a[2]?"":"InvalidField"))&&e.attr(o,"class",k),a[3]?v?v.p(a,g):(v=D(a),v.c(),v.m(t,C)):v&&(v.d(1),v=null),g&32&&y!==(y=a[5]("activate")+"")&&e.set_data(E,y),g&32&&F!==(F=a[5]("resend")+"")&&e.set_data(A,F),a[3]?i?i.p(a,g):(i=H(a),i.c(),i.m(p,null)):i&&(i.d(1),i=null),g&8&&(p.disabled=a[3])},i:e.noop,o:e.noop,d(a){a&&e.detach(t),b.d(),f&&f.d(),v&&v.d(),i&&i.d(),r[20](null),x=!1,e.run_all(z)}}}function J(r,t,n){let s;e.component_subscribe(r,e.$format,i=>n(5,s=i));let{endpoint:o=""}=t,{tokenid:l=""}=t,{playerid:m=""}=t,{smstemplate:c="Please use this code {0} to activate your accout"}=t,{number:d=""}=t,{mbsource:h}=t,{clientstyling:w=""}=t,{clientstylingurl:u=""}=t,{translationurl:_=""}=t,k,T=!0,C=!1,S,y,E=+localStorage.getItem("smsTimer")||0,j=Date.now()/1e3-E,p=60-Math.floor(j);const F={numeric:/^[0-9]{0,6}$/};O({withLocale:"en",translations:{}});const A=()=>{fetch(_).then(a=>a.json()).then(a=>{Object.keys(a).forEach(g=>{R(g,a[g])})}).catch(a=>{console.log(a)})};Object.keys(U).forEach(i=>{R(i,U[i])});const P=()=>V(this,null,function*(){try{if((yield fetch(`${o}/v1/player/${m}/activateSMS?tokenId=${l}&validationCode=${k}`,{headers:{"Content-Type":"application/json",accept:"application/json"}})).ok)n(2,T=!0),window.postMessage({type:"SmsHasBeenValidated"},window.location.href);else throw window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Could not activate user"}},window.location.href),n(2,T=!1),new Error("Could not activate user")}catch(i){console.log(i)}}),x=()=>V(this,null,function*(){localStorage.setItem("smsTimer",JSON.stringify(Math.floor(Date.now()/1e3))),I();try{const i=yield fetch(`${o}/v1/player/sms/token`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({userId:m,messageTemplate:c,destination:d})}),a=yield i.json();if(i.ok)n(9,l=a.id),C=!1,z();else throw C=!0,new Error("Failed to fetch")}catch(i){C=!0,console.error(i)}}),z=()=>{p>0?n(4,p--,p):(clearInterval(S),n(3,S=!1),n(4,p=60))},I=()=>{j<60&&n(3,S=setInterval(()=>{z()},1e3))},M=i=>{!F.numeric.test(i.key)&&i.keyCode!==8&&i.keyCode!==9&&i.keyCode!==46&&i.preventDefault()};e.onMount(()=>{if(!m||!d){let i=JSON.parse(localStorage.getItem("playerData"));n(10,m=i.playerid),n(11,d=i.number)}return I(),()=>{}});function b(){k=this.value,n(1,k)}const f=i=>M(i);function v(i){e.binding_callbacks[i?"unshift":"push"](()=>{y=i,n(0,y)})}return r.$$set=i=>{"endpoint"in i&&n(12,o=i.endpoint),"tokenid"in i&&n(9,l=i.tokenid),"playerid"in i&&n(10,m=i.playerid),"smstemplate"in i&&n(13,c=i.smstemplate),"number"in i&&n(11,d=i.number),"mbsource"in i&&n(14,h=i.mbsource),"clientstyling"in i&&n(15,w=i.clientstyling),"clientstylingurl"in i&&n(16,u=i.clientstylingurl),"translationurl"in i&&n(17,_=i.translationurl)},r.$$.update=()=>{r.$$.dirty&5632,r.$$.dirty&32769&&w&&y&&e.setClientStyling(y,w),r.$$.dirty&65537&&u&&y&&e.setClientStylingURL(y,u),r.$$.dirty&16385&&h&&y&&e.setStreamStyling(y,`${h}.Style`),r.$$.dirty&131072&&_&&A()},[y,k,T,S,p,s,P,x,M,l,m,d,o,c,h,w,u,_,b,f,v]}class B extends e.SvelteComponent{constructor(t){super(),e.init(this,t,J,G,e.safe_not_equal,{endpoint:12,tokenid:9,playerid:10,smstemplate:13,number:11,mbsource:14,clientstyling:15,clientstylingurl:16,translationurl:17},L)}get endpoint(){return this.$$.ctx[12]}set endpoint(t){this.$$set({endpoint:t}),e.flush()}get tokenid(){return this.$$.ctx[9]}set tokenid(t){this.$$set({tokenid:t}),e.flush()}get playerid(){return this.$$.ctx[10]}set playerid(t){this.$$set({playerid:t}),e.flush()}get smstemplate(){return this.$$.ctx[13]}set smstemplate(t){this.$$set({smstemplate:t}),e.flush()}get number(){return this.$$.ctx[11]}set number(t){this.$$set({number:t}),e.flush()}get mbsource(){return this.$$.ctx[14]}set mbsource(t){this.$$set({mbsource:t}),e.flush()}get clientstyling(){return this.$$.ctx[15]}set clientstyling(t){this.$$set({clientstyling:t}),e.flush()}get clientstylingurl(){return this.$$.ctx[16]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),e.flush()}get translationurl(){return this.$$.ctx[17]}set translationurl(t){this.$$set({translationurl:t}),e.flush()}}e.create_custom_element(B,{endpoint:{},tokenid:{},playerid:{},smstemplate:{},number:{},mbsource:{},clientstyling:{},clientstylingurl:{},translationurl:{}},[],[],!0);exports.default=B;
1
+ "use strict";var V=(r,t,i)=>new Promise((s,o)=>{var l=d=>{try{c(i.next(d))}catch(h){o(h)}},m=d=>{try{c(i.throw(d))}catch(h){o(h)}},c=d=>d.done?s(d.value):Promise.resolve(d.value).then(l,m);c((i=i.apply(r,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./GeneralPlayerLoginForm-BsDmrar4.cjs");function L({withLocale:r,translations:t}){e.$locale.subscribe(i=>{i==null&&(e.$dictionary.set(t),e.$locale.set(r))})}function R(r,t){e.addMessages(r,t)}const B={en:{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"A new verification code has been sent to your phone number.",activate:"Activate Account",resend:"Resend",loginSMSHint:"A new verification code has been sent to your phone number"},"zh-hk":{title:"请输入您在号码上收到的验证码",errorTitle:"您的代码无效,您可以重新发送代码并重试",code:"短信代码",smsCodeError:"短信验证码无效,请重新发送验证码",resendMessage:"新的验证码已发送至您的手机号码",activate:"激活账户",resend:"重发"},fr:{title:"Veuillez entrer le code de vérification que vous avez reçu sur votre numéro",errorTitle:"Votre code n'était pas valide, vous pouvez renvoyer le code et réessayer",code:"Code SMS",smsCodeError:"Code sms invalide, vous pouvez renvoyer le code",resendMessage:"Un nouveau code de vérification a été envoyé à votre numéro de téléphone.",activate:"Activer le compte",resend:"Renvoyer"},tr:{title:"Please enter the verification code you received on your number",errorTitle:"Kodunuz geçersizdi, kodu tekrar gönderip tekrar deneyebilirsiniz",code:"SMS kodu",smsCodeError:"Geçersiz sms kodu, kodu tekrar gönderebilirsiniz",resendMessage:"Telefon numaranıza yeni bir doğrulama kodu gönderildi.",activate:"Aktif hesap",resend:"Yeniden gönder",loginSMSHint:"Telefon numaranıza yeni bir doğrulama kodu gönderildi"},ro:{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"Un nou cod de verificare a fost trimis catre numarul dumneavoastra.",activate:"Activate Account",resend:"Resend"},es:{title:"Por favor ingrese su código de verificación enviado por mensaje de texto a su número de telefono",errorTitle:"Su código es invalido",code:"Código SMS",smsCodeError:"Código SMS invalido",resendMessage:"Un nuevo codigo de verificación ha sido enviado a tu número celular.",activate:"Activar Cuenta",resend:"Reenviar"},pt:{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"Um novo código de verificação foi enviado para o seu número de telefone.",activate:"Activate Account",resend:"Resend"},hr:{title:"Unesite verifikacijski kod koji ste primili na svoj broj telefona",errorTitle:"Vaš kod je nevažeći",code:"Sms kod",smsCodeError:"Nevažeći sms kod",resendMessage:"Novi verifkacijski kod poslan je na vaš broj telefona.",activate:"Aktiviraj račun",resend:"Ponovno pošalji",loginSMSHint:"Novi verifkacijski kod poslan je na vaš broj telefona"},"pt-br":{title:"Por favor, insira o código de verificação que você recebeu no seu número de celular",errorTitle:"Código inválido,vôce pode reenviar o código e tentar novamente",code:"Código SMS",smsCodeError:"Código SMS inválido,vôce pode reenviar o código",resendMessage:"Um novo código de verificação foi enviado para o seu número de celular.",activate:"Ativar conta",resend:"Reenviar",loginSMSHint:"Um novo código de verificação foi enviado para o seu número de celular."},"es-mx":{title:"Por favor ingrese el código de verificación que recibió en su número móvil",errorTitle:"Código inválido,Puede enviar el código e intentar de nuevo",code:"Código SMS",smsCodeError:"Código SMS inválido,Puede reenviar el código",resendMessage:"Un nuevo código de verificación ha sido enviado a su número móvil .",activate:"Activar Cuenta",resend:"Reenviar",loginSMSHint:"Un nuevo código de verificación ha sido enviado a su número móvil ."},"en-us":{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"A new verification code has been sent to your phone number.",activate:"Activate Account",resend:"Resend",loginSMSHint:"A new verification code has been sent to your phone number"}};function q(r){e.append_styles(r,"svelte-c25n4u","*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.Title{font-size:14px;margin:0;padding-bottom:20px}.Field{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;padding-bottom:30px;position:relative}.Field label{font-size:14px;font-weight:300;padding-bottom:5px}.Field input,.Field select{width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.Field.InvalidField input{border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));background:var(--emw--color-pale, #FBECF4);color:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E))}.Field.Hidden{display:none}.LoginSMSHint{margin-top:20px}.InvalidInput{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:10px;line-height:10px}.ErrorMessage{margin:0 0 15px 0;font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.Button{color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;margin-top:24px}.Button[disabled]{background:var(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-100, #E6E6E6);cursor:not-allowed}.Button.SmsVerificationResend{background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8));color:var(--emw--registration-typography, var(--emw--color-contrast, #07072A))}")}function D(r){let t=r[5]("errorTitle")+"",i;return{c(){i=e.text(t)},m(s,o){e.insert(s,i,o)},p(s,o){o&32&&t!==(t=s[5]("errorTitle")+"")&&e.set_data(i,t)},d(s){s&&e.detach(i)}}}function Y(r){let t=r[5]("title")+"",i;return{c(){i=e.text(t)},m(s,o){e.insert(s,i,o)},p(s,o){o&32&&t!==(t=s[5]("title")+"")&&e.set_data(i,t)},d(s){s&&e.detach(i)}}}function U(r){let t,i=r[5]("smsCodeError")+"",s;return{c(){t=e.element("p"),s=e.text(i),e.attr(t,"class","InvalidInput")},m(o,l){e.insert(o,t,l),e.append(t,s)},p(o,l){l&32&&i!==(i=o[5]("smsCodeError")+"")&&e.set_data(s,i)},d(o){o&&e.detach(t)}}}function N(r){let t,i=r[5]("resendMessage")+"",s;return{c(){t=e.element("p"),s=e.text(i),e.attr(t,"class","SmsVerificationResendMessage")},m(o,l){e.insert(o,t,l),e.append(t,s)},p(o,l){l&32&&i!==(i=o[5]("resendMessage")+"")&&e.set_data(s,i)},d(o){o&&e.detach(t)}}}function H(r){let t,i,s=r[4]<10?"0":"",o,l,m;return{c(){t=e.element("span"),i=e.text("(0:"),o=e.text(s),l=e.text(r[4]),m=e.text(")"),e.attr(t,"class","SmsVerificationResendTimer")},m(c,d){e.insert(c,t,d),e.append(t,i),e.append(t,o),e.append(t,l),e.append(t,m)},p(c,d){d&16&&s!==(s=c[4]<10?"0":"")&&e.set_data(o,s),d&16&&e.set_data(l,c[4])},d(c){c&&e.detach(t)}}}function G(r){let t,i,s,o,l,m=r[5]("code")+"",c,d,h,_,u,w,k,E,C,S,y=r[5]("activate")+"",F,j,p,T=r[5]("resend")+"",A,P,x,z;function I(a,g){return a[2]?Y:D}let M=I(r),b=M(r),f=!r[2]&&U(r),v=r[3]&&N(r),n=r[3]&&H(r);return{c(){t=e.element("div"),i=e.element("h3"),b.c(),s=e.space(),o=e.element("div"),l=e.element("label"),c=e.text(m),d=e.text(":"),h=e.element("span"),h.textContent="*",_=e.space(),u=e.element("input"),w=e.space(),f&&f.c(),E=e.space(),v&&v.c(),C=e.space(),S=e.element("button"),F=e.text(y),j=e.space(),p=e.element("button"),A=e.text(T),P=e.space(),n&&n.c(),e.attr(i,"class","Title"),e.attr(h,"class","FormRequired"),e.attr(l,"for","SmsCode"),e.attr(u,"type","text"),e.attr(u,"id","SmsCode"),e.attr(u,"inputmode","numeric"),e.attr(u,"pattern","[0-9]*"),e.attr(u,"maxlength","6"),e.attr(o,"class",k="Field SmsVerificationField "+(r[2]?"":"InvalidField")),e.attr(S,"class","Button SmsVerificationValidate"),e.attr(p,"class","Button SmsVerificationResend"),p.disabled=r[3],e.attr(t,"class","Container SmsVerificationContainer")},m(a,g){e.insert(a,t,g),e.append(t,i),b.m(i,null),e.append(t,s),e.append(t,o),e.append(o,l),e.append(l,c),e.append(l,d),e.append(l,h),e.append(o,_),e.append(o,u),e.set_input_value(u,r[1]),e.append(o,w),f&&f.m(o,null),e.append(t,E),v&&v.m(t,null),e.append(t,C),e.append(t,S),e.append(S,F),e.append(t,j),e.append(t,p),e.append(p,A),e.append(p,P),n&&n.m(p,null),r[20](t),x||(z=[e.listen(u,"input",r[18]),e.listen(u,"keydown",r[19]),e.listen(S,"click",r[6]),e.listen(p,"click",r[7])],x=!0)},p(a,[g]){M===(M=I(a))&&b?b.p(a,g):(b.d(1),b=M(a),b&&(b.c(),b.m(i,null))),g&32&&m!==(m=a[5]("code")+"")&&e.set_data(c,m),g&2&&u.value!==a[1]&&e.set_input_value(u,a[1]),a[2]?f&&(f.d(1),f=null):f?f.p(a,g):(f=U(a),f.c(),f.m(o,null)),g&4&&k!==(k="Field SmsVerificationField "+(a[2]?"":"InvalidField"))&&e.attr(o,"class",k),a[3]?v?v.p(a,g):(v=N(a),v.c(),v.m(t,C)):v&&(v.d(1),v=null),g&32&&y!==(y=a[5]("activate")+"")&&e.set_data(F,y),g&32&&T!==(T=a[5]("resend")+"")&&e.set_data(A,T),a[3]?n?n.p(a,g):(n=H(a),n.c(),n.m(p,null)):n&&(n.d(1),n=null),g&8&&(p.disabled=a[3])},i:e.noop,o:e.noop,d(a){a&&e.detach(t),b.d(),f&&f.d(),v&&v.d(),n&&n.d(),r[20](null),x=!1,e.run_all(z)}}}function J(r,t,i){let s;e.component_subscribe(r,e.$format,n=>i(5,s=n));let{endpoint:o=""}=t,{tokenid:l=""}=t,{playerid:m=""}=t,{smstemplate:c="Please use this code {0} to activate your accout"}=t,{number:d=""}=t,{mbsource:h}=t,{clientstyling:_=""}=t,{clientstylingurl:u=""}=t,{translationurl:w=""}=t,k,E=!0,C=!1,S,y,F=+localStorage.getItem("smsTimer")||0,j=Date.now()/1e3-F,p=60-Math.floor(j);const T={numeric:/^[0-9]{0,6}$/};L({withLocale:"en",translations:{}});const A=()=>{fetch(w).then(a=>a.json()).then(a=>{Object.keys(a).forEach(g=>{R(g,a[g])})}).catch(a=>{console.log(a)})};Object.keys(B).forEach(n=>{R(n,B[n])});const P=()=>V(this,null,function*(){try{if((yield fetch(`${o}/v1/player/${m}/activateSMS?tokenId=${l}&validationCode=${k}`,{headers:{"Content-Type":"application/json",accept:"application/json"}})).ok)i(2,E=!0),window.postMessage({type:"SmsHasBeenValidated"},window.location.href);else throw window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Could not activate user"}},window.location.href),i(2,E=!1),new Error("Could not activate user")}catch(n){console.log(n)}}),x=()=>V(this,null,function*(){localStorage.setItem("smsTimer",JSON.stringify(Math.floor(Date.now()/1e3))),I();try{const n=yield fetch(`${o}/v1/player/sms/token`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({userId:m,messageTemplate:c,destination:d})}),a=yield n.json();if(n.ok)i(9,l=a.id),C=!1,z();else throw C=!0,new Error("Failed to fetch")}catch(n){C=!0,console.error(n)}}),z=()=>{p>0?i(4,p--,p):(clearInterval(S),i(3,S=!1),i(4,p=60))},I=()=>{j<60&&i(3,S=setInterval(()=>{z()},1e3))},M=n=>{!T.numeric.test(n.key)&&n.keyCode!==8&&n.keyCode!==9&&n.keyCode!==46&&n.preventDefault()};e.onMount(()=>{if(!m||!d){let n=JSON.parse(localStorage.getItem("playerData"));i(10,m=n.playerid),i(11,d=n.number)}return I(),()=>{}});function b(){k=this.value,i(1,k)}const f=n=>M(n);function v(n){e.binding_callbacks[n?"unshift":"push"](()=>{y=n,i(0,y)})}return r.$$set=n=>{"endpoint"in n&&i(12,o=n.endpoint),"tokenid"in n&&i(9,l=n.tokenid),"playerid"in n&&i(10,m=n.playerid),"smstemplate"in n&&i(13,c=n.smstemplate),"number"in n&&i(11,d=n.number),"mbsource"in n&&i(14,h=n.mbsource),"clientstyling"in n&&i(15,_=n.clientstyling),"clientstylingurl"in n&&i(16,u=n.clientstylingurl),"translationurl"in n&&i(17,w=n.translationurl)},r.$$.update=()=>{r.$$.dirty&5632,r.$$.dirty&32769&&_&&y&&e.setClientStyling(y,_),r.$$.dirty&65537&&u&&y&&e.setClientStylingURL(y,u),r.$$.dirty&16385&&h&&y&&e.setStreamStyling(y,`${h}.Style`),r.$$.dirty&131072&&w&&A()},[y,k,E,S,p,s,P,x,M,l,m,d,o,c,h,_,u,w,b,f,v]}class O extends e.SvelteComponent{constructor(t){super(),e.init(this,t,J,G,e.safe_not_equal,{endpoint:12,tokenid:9,playerid:10,smstemplate:13,number:11,mbsource:14,clientstyling:15,clientstylingurl:16,translationurl:17},q)}get endpoint(){return this.$$.ctx[12]}set endpoint(t){this.$$set({endpoint:t}),e.flush()}get tokenid(){return this.$$.ctx[9]}set tokenid(t){this.$$set({tokenid:t}),e.flush()}get playerid(){return this.$$.ctx[10]}set playerid(t){this.$$set({playerid:t}),e.flush()}get smstemplate(){return this.$$.ctx[13]}set smstemplate(t){this.$$set({smstemplate:t}),e.flush()}get number(){return this.$$.ctx[11]}set number(t){this.$$set({number:t}),e.flush()}get mbsource(){return this.$$.ctx[14]}set mbsource(t){this.$$set({mbsource:t}),e.flush()}get clientstyling(){return this.$$.ctx[15]}set clientstyling(t){this.$$set({clientstyling:t}),e.flush()}get clientstylingurl(){return this.$$.ctx[16]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),e.flush()}get translationurl(){return this.$$.ctx[17]}set translationurl(t){this.$$set({translationurl:t}),e.flush()}}e.create_custom_element(O,{endpoint:{},tokenid:{},playerid:{},smstemplate:{},number:{},mbsource:{},clientstyling:{},clientstylingurl:{},translationurl:{}},[],[],!0);exports.default=O;