@moveo-ai/web-client 0.127.0-true.56 → 0.127.0-true.57

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.
package/README.md CHANGED
@@ -178,7 +178,7 @@ Initializes the chat widget.
178
178
  | `integrationId` | `string` | Yes | Your Moveo.ai integration ID |
179
179
  | `host` | `string` | No | Regional channels host, when it differs from the default |
180
180
  | `element` | `HTMLElement \| string` | No | Embed target, required for the `embed` widget position |
181
- | `identityToken` | `string` | No | Signed token that verifies the user's identity on the session |
181
+ | `identityToken` | `string \| () => string \| Promise<string>` | No | Signed token that verifies the user's identity on the session. See [Identity token](#identity-token) |
182
182
  | `voiceIntegrationId` | `string` | No | Deprecated and ignored: the call uses the desk voice pairing |
183
183
  | `variant` | `'default' \| 'nbg' \| 'alpha' \| 'fiserv'` | No | Visual variant |
184
184
 
@@ -368,6 +368,37 @@ MoveoAI.init({
368
368
  });
369
369
  ```
370
370
 
371
+ ### Identity token
372
+
373
+ An identity token is a JWT that your server signs to tell Moveo who the visitor is. Pass a function, not a fixed string, so the widget always gets the page's current token:
374
+
375
+ ```javascript
376
+ MoveoAI.init({
377
+ integrationId: 'YOUR_INTEGRATION_ID',
378
+ identityToken: async () => {
379
+ const response = await fetch('/api/moveo-token', {
380
+ credentials: 'include',
381
+ });
382
+ if (response.status === 401) {
383
+ return ''; // The visitor is logged out.
384
+ }
385
+ if (!response.ok) {
386
+ throw new Error(`Token endpoint: ${response.status}`);
387
+ }
388
+ const { token } = await response.json();
389
+ return token;
390
+ },
391
+ }).then((instance) => {
392
+ console.log('Moveo widget ready', instance);
393
+ });
394
+ ```
395
+
396
+ The function stays on your page. The widget calls it before each session create and each reconnect, and keeps no token between calls. So a short-lived token works for a long conversation, and a logout or an account switch takes effect at the next reconnect, also on a single-page app that does not reload.
397
+
398
+ - Return `''` when the visitor is logged out. If the integration requires an identity token, channels then refuses the reconnect, and the visitor starts a new conversation.
399
+ - Mint a new token on each call. Channels refuses a token without `exp`, or with an `exp` more than 24 hours ahead.
400
+ - If the function throws, returns no string, or takes more than 10 seconds, the widget calls it again after 1 second and after 2 more seconds. If every call fails, the widget continues without a token.
401
+
371
402
  ### Teaser
372
403
 
373
404
  The teaser is the invitation shown beside the closed launcher. `variant` picks
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.127.0-true.56
3
+ * @moveo-ai/web-client v0.127.0-true.57
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.127.0-true.56
3
+ * @moveo-ai/web-client v0.127.0-true.57
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.127.0-true.56
3
+ * @moveo-ai/web-client v0.127.0-true.57
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.127.0-true.56
3
+ * @moveo-ai/web-client v0.127.0-true.57
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */
@@ -1 +1 @@
1
- <!doctype html><html lang=en><head><meta name=referrer content=no-referrer><meta charset=UTF-8><link rel=preload as=script href=../web-client.min.js?37473a0e584c713ceb4f><meta property=og:title content="Continue your conversation"><meta property=og:description content="Tap to pick up your chat where you left off."><meta property=og:type content=website><meta name=twitter:card content=summary><meta name=viewport content="width=device-width,initial-scale=1"><meta name=robots content=noindex><title>Continue your conversation</title><style>body,html{color:#18181b;background:#f4f4f5;height:100%;margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,-apple-system,Segoe UI,Roboto,sans-serif}body{align-items:center;justify-content:center;display:flex}#continue-chat{box-sizing:border-box;background:#fff;border-radius:12px;width:min(560px,100%);height:min(760px,calc(100dvh - 48px));position:relative;overflow:hidden;box-shadow:0 2px 12px rgb(0 0 0 / 12%)}#continue-loading{text-align:center;background:#fff;flex-direction:column;gap:16px;align-items:center;justify-content:center;padding:24px;font-size:14px;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}#continue-loading span{box-sizing:border-box;border:3px solid rgb(0 0 0 / 30%);border-top-color:#1b66d6;border-radius:50%;width:16px;height:16px;animation:continue-spin 1s ease-in-out infinite}#continue-loading p{margin:0}@keyframes continue-spin{to{transform:rotate(360deg)}}#continue-used{box-sizing:border-box;text-align:center;max-width:420px;padding:24px}#continue-used h1{margin:0 0 8px;font-size:20px}#continue-used p{color:#52525b;margin:0;font-size:15px;line-height:22px}@media (max-width:700px){body,html{overflow:hidden}#continue-chat{border-radius:0;width:100%;height:100%;box-shadow:none}}</style></head><body><div id=continue-chat hidden><div id=continue-loading><span></span><p>Loading...</div></div><div id=continue-used hidden><h1>This link was already used</h1><p>Go back to the app where you started, or open the conversation where you already continued it.</div><script id=continue-strings type=application/json>{"ar":{"page_title":"تابع محادثتك","loading":"جارٍ التحميل...","used_title":"تم استخدام هذا الرابط بالفعل","used_subtitle":"ارجع إلى التطبيق الذي بدأت منه، أو افتح المحادثة حيث تابعتها بالفعل."},"bg":{"page_title":"Продължете разговора си","loading":"Зареждане...","used_title":"Тази връзка вече е използвана","used_subtitle":"Върнете се в приложението, където започнахте, или отворете разговора там, където вече сте го продължили."},"cs":{"page_title":"Pokračujte v konverzaci","loading":"Načítání...","used_title":"Tento odkaz už byl použit","used_subtitle":"Vraťte se do aplikace, kde jste začali, nebo otevřete konverzaci tam, kde jste v ní už pokračovali."},"da":{"page_title":"Fortsæt din samtale","loading":"Indlæser...","used_title":"Dette link er allerede brugt","used_subtitle":"Gå tilbage til appen, hvor du startede, eller åbn samtalen, hvor du allerede har fortsat den."},"de":{"page_title":"Setzen Sie Ihr Gespräch fort","loading":"Wird geladen...","used_title":"Dieser Link wurde bereits verwendet","used_subtitle":"Kehren Sie zur App zurück, in der Sie begonnen haben, oder öffnen Sie das Gespräch dort, wo Sie es bereits fortgesetzt haben."},"el":{"page_title":"Συνεχίστε τη συνομιλία σας","loading":"Φόρτωση...","used_title":"Αυτός ο σύνδεσμος έχει ήδη χρησιμοποιηθεί","used_subtitle":"Επιστρέψτε στην εφαρμογή όπου ξεκινήσατε ή ανοίξτε τη συνομιλία εκεί όπου τη συνεχίσατε ήδη."},"en":{"page_title":"Continue your conversation","loading":"Loading...","used_title":"This link was already used","used_subtitle":"Go back to the app where you started, or open the conversation where you already continued it."},"es":{"page_title":"Continúe su conversación","loading":"Cargando...","used_title":"Este enlace ya se usó","used_subtitle":"Vuelva a la app donde empezó o abra la conversación donde ya la continuó."},"fr":{"page_title":"Continuez votre conversation","loading":"Chargement...","used_title":"Ce lien a déjà été utilisé","used_subtitle":"Revenez à l'application où vous avez commencé, ou ouvrez la conversation là où vous l'avez déjà poursuivie."},"id":{"page_title":"Lanjutkan percakapan Anda","loading":"Memuat...","used_title":"Tautan ini sudah digunakan","used_subtitle":"Kembali ke aplikasi tempat Anda memulai, atau buka percakapan tempat Anda sudah melanjutkannya."},"it":{"page_title":"Continua la conversazione","loading":"Caricamento...","used_title":"Questo link è già stato usato","used_subtitle":"Torna all'app in cui hai iniziato, oppure apri la conversazione dove l'hai già continuata."},"ja":{"page_title":"会話を続ける","loading":"読み込み中...","used_title":"このリンクはすでに使用されています","used_subtitle":"開始したアプリに戻るか、すでに続きを進めている会話を開いてください。"},"me":{"page_title":"Nastavite razgovor","loading":"Učitavam...","used_title":"Ovaj link je već iskorišćen","used_subtitle":"Vratite se u aplikaciju u kojoj ste počeli ili otvorite razgovor tamo gdje ste ga već nastavili."},"nl-be":{"page_title":"Zet uw gesprek voort","loading":"Bezig met laden...","used_title":"Deze link is al gebruikt","used_subtitle":"Ga terug naar de app waar u begon, of open het gesprek waar u het al hebt voortgezet."},"nl":{"page_title":"Zet je gesprek voort","loading":"Bezig met laden...","used_title":"Deze link is al gebruikt","used_subtitle":"Ga terug naar de app waar je begon, of open het gesprek waar je het al hebt voortgezet."},"pl":{"page_title":"Kontynuuj rozmowę","loading":"Ładowanie...","used_title":"Ten link został już użyty","used_subtitle":"Wróć do aplikacji, w której rozpoczęła się rozmowa, lub otwórz ją tam, gdzie jest już kontynuowana."},"pt-br":{"page_title":"Continue sua conversa","loading":"Carregando...","used_title":"Este link já foi usado","used_subtitle":"Volte ao app onde você começou ou abra a conversa onde você já a continuou."},"pt":{"page_title":"Continue a sua conversa","loading":"A carregar...","used_title":"Esta ligação já foi utilizada","used_subtitle":"Volte à aplicação onde começou ou abra a conversa onde já a continuou."},"ro":{"page_title":"Continuă conversația","loading":"Se încarcă...","used_title":"Acest link a fost deja folosit","used_subtitle":"Revino la aplicația în care ai început sau deschide conversația acolo unde ai continuat-o deja."},"ru":{"page_title":"Продолжите разговор","loading":"Загрузка...","used_title":"Эта ссылка уже использована","used_subtitle":"Вернитесь в приложение, где вы начали, или откройте разговор там, где вы уже его продолжили."},"sq":{"page_title":"Vazhdo bisedën","loading":"Duke u ngarkuar...","used_title":"Kjo lidhje është përdorur tashmë","used_subtitle":"Kthehu te aplikacioni ku fillove ose hap bisedën aty ku e ke vazhduar tashmë."},"sr":{"page_title":"Наставите разговор","loading":"Учитавам...","used_title":"Ова веза је већ искоришћена","used_subtitle":"Вратите се у апликацију у којој сте почели или отворите разговор тамо где сте га већ наставили."},"sv":{"page_title":"Fortsätt konversationen","loading":"Laddar...","used_title":"Den här länken har redan använts","used_subtitle":"Gå tillbaka till appen där du började, eller öppna konversationen där du redan har fortsatt den."},"tl":{"page_title":"Ituloy ang pakikipag-usap mo","loading":"Naglo-load...","used_title":"Nagamit na ang link na ito","used_subtitle":"Bumalik sa app kung saan ka nagsimula, o buksan ang usapan kung saan mo na ito itinuloy."},"tr":{"page_title":"Görüşmenize devam edin","loading":"Yükleniyor...","used_title":"Bu bağlantı zaten kullanıldı","used_subtitle":"Başladığınız uygulamaya geri dönün veya görüşmeyi zaten devam ettiğiniz yerde açın."},"zh":{"page_title":"继续您的对话","loading":"加载中...","used_title":"此链接已被使用","used_subtitle":"请返回您开始对话的应用,或打开您已继续的对话。"}}</script><script src=../continue.min.js?37473a0e584c713ceb4f data-loader=../web-client.min.js?37473a0e584c713ceb4f></script></body></html>
1
+ <!doctype html><html lang=en><head><meta name=referrer content=no-referrer><meta charset=UTF-8><link rel=preload as=script href=../web-client.min.js?12222475e7b5f699675a><meta property=og:title content="Continue your conversation"><meta property=og:description content="Tap to pick up your chat where you left off."><meta property=og:type content=website><meta name=twitter:card content=summary><meta name=viewport content="width=device-width,initial-scale=1"><meta name=robots content=noindex><title>Continue your conversation</title><style>body,html{color:#18181b;background:#f4f4f5;height:100%;margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,-apple-system,Segoe UI,Roboto,sans-serif}body{align-items:center;justify-content:center;display:flex}#continue-chat{box-sizing:border-box;background:#fff;border-radius:12px;width:min(560px,100%);height:min(760px,calc(100dvh - 48px));position:relative;overflow:hidden;box-shadow:0 2px 12px rgb(0 0 0 / 12%)}#continue-loading{text-align:center;background:#fff;flex-direction:column;gap:16px;align-items:center;justify-content:center;padding:24px;font-size:14px;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}#continue-loading span{box-sizing:border-box;border:3px solid rgb(0 0 0 / 30%);border-top-color:#1b66d6;border-radius:50%;width:16px;height:16px;animation:continue-spin 1s ease-in-out infinite}#continue-loading p{margin:0}@keyframes continue-spin{to{transform:rotate(360deg)}}#continue-used{box-sizing:border-box;text-align:center;max-width:420px;padding:24px}#continue-used h1{margin:0 0 8px;font-size:20px}#continue-used p{color:#52525b;margin:0;font-size:15px;line-height:22px}@media (max-width:700px){body,html{overflow:hidden}#continue-chat{border-radius:0;width:100%;height:100%;box-shadow:none}}</style></head><body><div id=continue-chat hidden><div id=continue-loading><span></span><p>Loading...</div></div><div id=continue-used hidden><h1>This link was already used</h1><p>Go back to the app where you started, or open the conversation where you already continued it.</div><script id=continue-strings type=application/json>{"ar":{"page_title":"تابع محادثتك","loading":"جارٍ التحميل...","used_title":"تم استخدام هذا الرابط بالفعل","used_subtitle":"ارجع إلى التطبيق الذي بدأت منه، أو افتح المحادثة حيث تابعتها بالفعل."},"bg":{"page_title":"Продължете разговора си","loading":"Зареждане...","used_title":"Тази връзка вече е използвана","used_subtitle":"Върнете се в приложението, където започнахте, или отворете разговора там, където вече сте го продължили."},"cs":{"page_title":"Pokračujte v konverzaci","loading":"Načítání...","used_title":"Tento odkaz už byl použit","used_subtitle":"Vraťte se do aplikace, kde jste začali, nebo otevřete konverzaci tam, kde jste v ní už pokračovali."},"da":{"page_title":"Fortsæt din samtale","loading":"Indlæser...","used_title":"Dette link er allerede brugt","used_subtitle":"Gå tilbage til appen, hvor du startede, eller åbn samtalen, hvor du allerede har fortsat den."},"de":{"page_title":"Setzen Sie Ihr Gespräch fort","loading":"Wird geladen...","used_title":"Dieser Link wurde bereits verwendet","used_subtitle":"Kehren Sie zur App zurück, in der Sie begonnen haben, oder öffnen Sie das Gespräch dort, wo Sie es bereits fortgesetzt haben."},"el":{"page_title":"Συνεχίστε τη συνομιλία σας","loading":"Φόρτωση...","used_title":"Αυτός ο σύνδεσμος έχει ήδη χρησιμοποιηθεί","used_subtitle":"Επιστρέψτε στην εφαρμογή όπου ξεκινήσατε ή ανοίξτε τη συνομιλία εκεί όπου τη συνεχίσατε ήδη."},"en":{"page_title":"Continue your conversation","loading":"Loading...","used_title":"This link was already used","used_subtitle":"Go back to the app where you started, or open the conversation where you already continued it."},"es":{"page_title":"Continúe su conversación","loading":"Cargando...","used_title":"Este enlace ya se usó","used_subtitle":"Vuelva a la app donde empezó o abra la conversación donde ya la continuó."},"fr":{"page_title":"Continuez votre conversation","loading":"Chargement...","used_title":"Ce lien a déjà été utilisé","used_subtitle":"Revenez à l'application où vous avez commencé, ou ouvrez la conversation là où vous l'avez déjà poursuivie."},"id":{"page_title":"Lanjutkan percakapan Anda","loading":"Memuat...","used_title":"Tautan ini sudah digunakan","used_subtitle":"Kembali ke aplikasi tempat Anda memulai, atau buka percakapan tempat Anda sudah melanjutkannya."},"it":{"page_title":"Continua la conversazione","loading":"Caricamento...","used_title":"Questo link è già stato usato","used_subtitle":"Torna all'app in cui hai iniziato, oppure apri la conversazione dove l'hai già continuata."},"ja":{"page_title":"会話を続ける","loading":"読み込み中...","used_title":"このリンクはすでに使用されています","used_subtitle":"開始したアプリに戻るか、すでに続きを進めている会話を開いてください。"},"me":{"page_title":"Nastavite razgovor","loading":"Učitavam...","used_title":"Ovaj link je već iskorišćen","used_subtitle":"Vratite se u aplikaciju u kojoj ste počeli ili otvorite razgovor tamo gdje ste ga već nastavili."},"nl-be":{"page_title":"Zet uw gesprek voort","loading":"Bezig met laden...","used_title":"Deze link is al gebruikt","used_subtitle":"Ga terug naar de app waar u begon, of open het gesprek waar u het al hebt voortgezet."},"nl":{"page_title":"Zet je gesprek voort","loading":"Bezig met laden...","used_title":"Deze link is al gebruikt","used_subtitle":"Ga terug naar de app waar je begon, of open het gesprek waar je het al hebt voortgezet."},"pl":{"page_title":"Kontynuuj rozmowę","loading":"Ładowanie...","used_title":"Ten link został już użyty","used_subtitle":"Wróć do aplikacji, w której rozpoczęła się rozmowa, lub otwórz ją tam, gdzie jest już kontynuowana."},"pt-br":{"page_title":"Continue sua conversa","loading":"Carregando...","used_title":"Este link já foi usado","used_subtitle":"Volte ao app onde você começou ou abra a conversa onde você já a continuou."},"pt":{"page_title":"Continue a sua conversa","loading":"A carregar...","used_title":"Esta ligação já foi utilizada","used_subtitle":"Volte à aplicação onde começou ou abra a conversa onde já a continuou."},"ro":{"page_title":"Continuă conversația","loading":"Se încarcă...","used_title":"Acest link a fost deja folosit","used_subtitle":"Revino la aplicația în care ai început sau deschide conversația acolo unde ai continuat-o deja."},"ru":{"page_title":"Продолжите разговор","loading":"Загрузка...","used_title":"Эта ссылка уже использована","used_subtitle":"Вернитесь в приложение, где вы начали, или откройте разговор там, где вы уже его продолжили."},"sq":{"page_title":"Vazhdo bisedën","loading":"Duke u ngarkuar...","used_title":"Kjo lidhje është përdorur tashmë","used_subtitle":"Kthehu te aplikacioni ku fillove ose hap bisedën aty ku e ke vazhduar tashmë."},"sr":{"page_title":"Наставите разговор","loading":"Учитавам...","used_title":"Ова веза је већ искоришћена","used_subtitle":"Вратите се у апликацију у којој сте почели или отворите разговор тамо где сте га већ наставили."},"sv":{"page_title":"Fortsätt konversationen","loading":"Laddar...","used_title":"Den här länken har redan använts","used_subtitle":"Gå tillbaka till appen där du började, eller öppna konversationen där du redan har fortsatt den."},"tl":{"page_title":"Ituloy ang pakikipag-usap mo","loading":"Naglo-load...","used_title":"Nagamit na ang link na ito","used_subtitle":"Bumalik sa app kung saan ka nagsimula, o buksan ang usapan kung saan mo na ito itinuloy."},"tr":{"page_title":"Görüşmenize devam edin","loading":"Yükleniyor...","used_title":"Bu bağlantı zaten kullanıldı","used_subtitle":"Başladığınız uygulamaya geri dönün veya görüşmeyi zaten devam ettiğiniz yerde açın."},"zh":{"page_title":"继续您的对话","loading":"加载中...","used_title":"此链接已被使用","used_subtitle":"请返回您开始对话的应用,或打开您已继续的对话。"}}</script><script src=../continue.min.js?12222475e7b5f699675a data-loader=../web-client.min.js?12222475e7b5f699675a></script></body></html>
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see continue.min.js.LICENSE.txt */
2
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("MoveoContinue",[],o):"object"==typeof exports?exports.MoveoContinue=o():e.MoveoContinue=o()}(this,()=>(()=>{var e={833(e,o,t){o.formatArgs=function(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;o.splice(1,0,t,"color: inherit");let n=0,s=0;o[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(s=n))}),o.splice(s,0,t)},o.save=function(e){try{e?o.storage.setItem("debug",e):o.storage.removeItem("debug")}catch(e){}},o.load=function(){let e;try{e=o.storage.getItem("debug")||o.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},o.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},o.storage=function(){try{return localStorage}catch(e){}}(),o.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),o.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],o.log=console.debug||console.log||(()=>{}),e.exports=t(736)(o);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},736(e,o,t){e.exports=function(e){function o(e){let t,s,r,i=null;function a(...e){if(!a.enabled)return;const n=a,s=Number(new Date),r=s-(t||s);n.diff=r,n.prev=t,n.curr=s,t=s,e[0]=o.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,s)=>{if("%%"===t)return"%";i++;const r=o.formatters[s];if("function"==typeof r){const o=e[i];t=r.call(n,o),e.splice(i,1),i--}return t}),o.formatArgs.call(n,e),(n.log||o.log).apply(n,e)}return a.namespace=e,a.useColors=o.useColors(),a.color=o.selectColor(e),a.extend=n,a.destroy=o.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==o.namespaces&&(s=o.namespaces,r=o.enabled(e)),r),set:e=>{i=e}}),"function"==typeof o.init&&o.init(a),a}function n(e,t){const n=o(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function s(e,o){let t=0,n=0,s=-1,r=0;for(;t<e.length;)if(n<o.length&&(o[n]===e[t]||"*"===o[n]))"*"===o[n]?(s=n,r=t,n++):(t++,n++);else{if(-1===s)return!1;n=s+1,r++,t=r}for(;n<o.length&&"*"===o[n];)n++;return n===o.length}return o.debug=o,o.default=o,o.coerce=function(e){return e instanceof Error?e.stack||e.message:e},o.disable=function(){const e=[...o.names,...o.skips.map(e=>"-"+e)].join(",");return o.enable(""),e},o.enable=function(e){o.save(e),o.namespaces=e,o.names=[],o.skips=[];const t=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of t)"-"===e[0]?o.skips.push(e.slice(1)):o.names.push(e)},o.enabled=function(e){for(const t of o.skips)if(s(e,t))return!1;for(const t of o.names)if(s(e,t))return!0;return!1},o.humanize=t(585),o.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{o[t]=e[t]}),o.names=[],o.skips=[],o.formatters={},o.selectColor=function(e){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o),t|=0;return o.colors[Math.abs(t)%o.colors.length]},o.enable(o.load()),o}},585(e){var o=1e3,t=60*o,n=60*t,s=24*n,r=7*s;function i(e,o,t,n){var s=o>=1.5*t;return Math.round(e/t)+" "+n+(s?"s":"")}e.exports=function(e,a){a=a||{};var c,d,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*r;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===l&&isFinite(e))return a.long?(c=e,(d=Math.abs(c))>=s?i(c,d,s,"day"):d>=n?i(c,d,n,"hour"):d>=t?i(c,d,t,"minute"):d>=o?i(c,d,o,"second"):c+" ms"):function(e){var r=Math.abs(e);return r>=s?Math.round(e/s)+"d":r>=n?Math.round(e/n)+"h":r>=t?Math.round(e/t)+"m":r>=o?Math.round(e/o)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}};const o={};function t(n){const s=o[n];if(void 0!==s)return s.exports;const r=o[n]={exports:{}};return e[n](r,r.exports,t),r.exports}return t.n=e=>{const o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},t.d=(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{"use strict";var e,o,n,s,r,i=t(833),a=t.n(i);!function(e){e.Open="open",e.Resolved="closed",e.Expired="expired",e.Spam="spam",e.Trash="trash"}(e||(e={})),function(e){e.AnalyticsEvent="moveo-analytics-event",e.IframeLoaded="moveo-iframe-loaded",e.IframeError="moveo-iframe-error",e.WidgetLoaded="moveo-widget-loaded",e.WidgetError="moveo-widget-error",e.Opened="moveo-widget-opened",e.Closed="moveo-widget-closed",e.Resize="moveo-widget-resize",e.LocaleChanged="moveo-widget-locale-changed",e.SessionCreated="moveo-widget-session-created",e.SessionReconnected="moveo-widget-session-reconnected",e.SessionClosed="moveo-widget-session-closed",e.SessionExpired="moveo-widget-session-expired",e.ConversationClosed="moveo-widget-conversation-closed",e.LinkClicked="moveo-widget-link-clicked",e.Navigate="moveo-widget-navigate",e.UserActivity="moveo-widget-user-activity",e.VisitorAction="moveo-widget-visitor-action",e.MemberLeave="moveo-widget-member-leave",e.ConversationUnreadMessages="moveo-conversation-unread-messages",e.ConversationNoUnreadMessages="moveo-conversation-no-unread-messages",e.UserWayInit="moveo-userway-init",e.ChatBackground="moveo-widget-chat-background",e.FloatingWindowChoice="moveo-widget-floating-window-choice",e.WidgetFocused="moveo-widget-focused",e.Detached="moveo-widget-detached",e.Drag="moveo-widget-drag",e.Place="moveo-widget-place"}(o||(o={})),function(e){e.SetConfig="moveo-set-config",e.SetLocale="moveo-set-locale",e.SetCssVariables="moveo-set-css-variables",e.Open="moveo-open",e.Close="moveo-close",e.CloseConversation="moveo-close-conversation",e.SendMessage="moveo-send-message",e.ShowTeaserMessage="moveo-show-teaser-message",e.UpdateContext="moveo-update-context",e.UpdateHostContext="moveo-update-host-context",e.LoadSessionReplay="moveo-load-session-replay",e.HostScroll="moveo-host-scroll",e.HostLocation="moveo-host-location",e.HostVisibility="moveo-host-visibility",e.HostOpenerPolicy="moveo-host-opener-policy",e.HostSection="moveo-host-section",e.HostSectionsResolved="moveo-host-sections-resolved",e.WindowResize="moveo-resize",e.HostFrameBox="moveo-host-frame-box",e.HostPlacement="moveo-host-placement",e.SessionActivity="session-activity",e.UserWayDisabled="userway-disabled",e.UserWayEnabled="userway-enabled",e.LinkClicked="link-clicked",e.VisitorActionHandled="moveo-visitor-action-handled"}(n||(n={})),function(e){e.Expired="expired",e.Survey="survey",e.Closing="closing",e.Resolved="closed",e.Inactivity="inactivity",e.Continue="continue"}(s||(s={})),function(e){e.CloseButton="close-btn",e.EndSessionButton="end-btn",e.HeaderMenuButton="header-menu-btn",e.RestartButton="restart-btn",e.LauncherButton="launcher-btn",e.MessageInput="message-input",e.DisclaimerCheck="disclaimer-check",e.DisclaimerContainer="disclaimer-container",e.HeaderContainer="header-container",e.DragHandle="drag-handle",e.ImageButton="image-btn"}(r||(r={}));const c="moveo-detached:heartbeat",d="moveo-detached:bye",l=[o.AnalyticsEvent,o.LinkClicked,o.Navigate,o.UserActivity,o.VisitorAction,o.LocaleChanged],u=(Math.random().toString(36).slice(2),a()("moveo:safe-read")),g=(e,o)=>{try{return o()}catch(o){return void u("%s unreadable: %o",e,o)}},m=(e,o)=>{g(e,()=>{o()})},C=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),v=e=>Array.from(e,e=>e.charCodeAt(0).toString(16).padStart(2,"0")).join("").replace(/(.{8})(.{4})(.{4})(.{4})/,"$1-$2-$3-$4-"),p=e=>{try{const o=new URL(e);return o.origin===e&&"https:"===o.protocol&&/(^|\.)moveo\.ai$/.test(o.hostname)}catch{return!1}},f=a()("moveo:continue"),h=(e,o)=>g(e,()=>window[e].getItem(o))??null,w=(e,o)=>m("sessionStorage",()=>window.sessionStorage.setItem(e,JSON.stringify(o))),y=()=>{const e=document.getElementById("continue-used");e&&(e.hidden=!1)};((e,t)=>{const n=new URLSearchParams(window.location.search),{integrationId:s,code:r,host:i,windowMode:a}=(e=>{const o=e.has("t")?(e=>{try{const o=atob(e.replace(/-/g,"+").replace(/_/g,"/")),t=32;return o.length<=t?{}:{i:v(o.slice(0,16)),c:C(o.slice(16,t)),h:o.slice(t)}}catch{return{}}})(e.get("t")??""):{},t=(t,n)=>o[t]||e.get(t)||e.get(n),n=t("h","host");return{integrationId:t("i","integration_id"),code:t("c","code"),host:n&&p(n)?n:void 0,windowMode:"window"===e.get("mode")}})(n);(e=>{const o=((e,o)=>{const t=o=>Object.prototype.hasOwnProperty.call(e,o);return o.map(e=>{const o=(e||"").toLowerCase(),n=o.split("-")[0];return t(o)?o:t(n)?n:null}).find(Boolean)||"en"})(e,[h("localStorage","moveo_web_client_language"),...navigator.languages||[navigator.language]]),t=e[o];var n;document.documentElement.lang="me"===(n=o)?"sr-ME":n,document.documentElement.dir="ar"===o?"rtl":"ltr",document.title=t.page_title;const s=(e,o)=>{const t=document.querySelector(e);t&&(t.textContent=o)};s("#continue-loading p",t.loading),s("#continue-used h1",t.used_title),s("#continue-used p",t.used_subtitle)})(e);const u=document.getElementById("continue-chat");if(!u)return;const g=((e,o,t,n)=>s=>new Promise((r,i)=>{e.hidden=!1;const a=document.createElement("script");a.src=o,a.onerror=i,a.onload=()=>{const{MoveoAI:o}=window;o.init({...s,integrationId:t,host:n,element:e,widget_position:"embed"}).then(e=>{document.getElementById("continue-loading")?.remove(),r(e)}).catch(e=>{f("The widget did not load",e),i(e)})},document.head.appendChild(a)}))(u,t,s??"",i);if(a)return void((e,t,n)=>{const{origin:s}=window.location,r=window.opener&&!window.opener.closed?window.opener:null,i=`moveo_${e}_detached_handoff`;let a=null;try{a=JSON.parse(h("sessionStorage",i)||"null")}catch{}if(!e||a?.ended||!r&&!a?.session_id)return y(),void window.close();const u=r?.top??null;let g,m=null,C=null,v={};const p=(e,o)=>{const t=(n,r)=>{for(let i=0;i<n.length;i++)n[i].postMessage({type:e,session_id:m,data:o},s),r<4&&t(n[i].frames,r+1)};try{u&&t(u.frames,1)}catch{}},f=e=>{m=e.session_id,window.addEventListener("pagehide",()=>p(d)),n({...e.config,floating_session_id:m,...e.language&&{language:e.language},...e.client_url&&{floating_client_url:e.client_url}}).then(o=>{C=o;const t={...e.css_variables,...v.css_variables};Object.keys(t).length&&C.setCSSVariables(t),v.language&&C.setLocale(v.language),u&&(p(c),g=setInterval(()=>p(c),2e3))},()=>{p(d),window.close()})};r?(window.addEventListener("message",e=>{if(e.origin!==s)return;const n=e.data,a=String(n?.type);if("moveo-detached:session"!==n?.type||"string"!=typeof n.session_id||m||e.source!==r){if("moveo-detached:close"===n?.type)window.close();else if("moveo-detached:settings"===n?.type){const{css_variables:e,language:o}=n;C?(e&&C.setCSSVariables(e),o&&C.setLocale(o)):v={css_variables:{...v.css_variables,...e},language:o||v.language}}else if(m&&e.source===t.querySelector("iframe")?.contentWindow){if(a.endsWith(o.SessionClosed)||a.endsWith(o.SessionExpired))return clearInterval(g),w(i,{session_id:m,ended:!0}),void p(d);const t=l.find(e=>a.endsWith(e));t&&p("moveo-detached:relay",{type:t,data:e.data.data})}}else{const{session_id:e,language:o,client_url:t,css_variables:s,config:r}=n,a={session_id:e,language:o,client_url:t,css_variables:s,config:r};w(i,a),f(a)}}),r.postMessage({type:"moveo-detached:ready",session_id:a?.session_id??null},s)):f(a)})(s,u,g);const F=`moveo_${s}_continue_code`,b=`moveo_${s}_continue_origin`;if(s&&r&&m("sessionStorage",()=>{window.sessionStorage.setItem(F,r);const e=JSON.parse(h("sessionStorage",b)||"null");e?.code!==r&&window.sessionStorage.removeItem(b)}),n.has("c")||n.has("code")){n.delete("c"),n.delete("code");const e=n.toString();window.history.replaceState(null,"",`${window.location.pathname}${e?`?${e}`:""}`)}const S=`moveo_${s}_session_id`,_=r||h("sessionStorage",F),x=h("localStorage",S)||h("sessionStorage",S);s&&(_||x)?g({sticky_session:!0,continue_code:_||""}).catch(()=>{}):y()})(JSON.parse(document.getElementById("continue-strings")?.textContent||"{}"),document.currentScript?.dataset.loader??"")})(),{}})());
2
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("MoveoContinue",[],o):"object"==typeof exports?exports.MoveoContinue=o():e.MoveoContinue=o()}(this,()=>(()=>{var e={833(e,o,t){o.formatArgs=function(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;o.splice(1,0,t,"color: inherit");let n=0,s=0;o[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(s=n))}),o.splice(s,0,t)},o.save=function(e){try{e?o.storage.setItem("debug",e):o.storage.removeItem("debug")}catch(e){}},o.load=function(){let e;try{e=o.storage.getItem("debug")||o.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},o.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},o.storage=function(){try{return localStorage}catch(e){}}(),o.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),o.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],o.log=console.debug||console.log||(()=>{}),e.exports=t(736)(o);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},736(e,o,t){e.exports=function(e){function o(e){let t,s,i,r=null;function a(...e){if(!a.enabled)return;const n=a,s=Number(new Date),i=s-(t||s);n.diff=i,n.prev=t,n.curr=s,t=s,e[0]=o.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,s)=>{if("%%"===t)return"%";r++;const i=o.formatters[s];if("function"==typeof i){const o=e[r];t=i.call(n,o),e.splice(r,1),r--}return t}),o.formatArgs.call(n,e),(n.log||o.log).apply(n,e)}return a.namespace=e,a.useColors=o.useColors(),a.color=o.selectColor(e),a.extend=n,a.destroy=o.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(s!==o.namespaces&&(s=o.namespaces,i=o.enabled(e)),i),set:e=>{r=e}}),"function"==typeof o.init&&o.init(a),a}function n(e,t){const n=o(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function s(e,o){let t=0,n=0,s=-1,i=0;for(;t<e.length;)if(n<o.length&&(o[n]===e[t]||"*"===o[n]))"*"===o[n]?(s=n,i=t,n++):(t++,n++);else{if(-1===s)return!1;n=s+1,i++,t=i}for(;n<o.length&&"*"===o[n];)n++;return n===o.length}return o.debug=o,o.default=o,o.coerce=function(e){return e instanceof Error?e.stack||e.message:e},o.disable=function(){const e=[...o.names,...o.skips.map(e=>"-"+e)].join(",");return o.enable(""),e},o.enable=function(e){o.save(e),o.namespaces=e,o.names=[],o.skips=[];const t=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of t)"-"===e[0]?o.skips.push(e.slice(1)):o.names.push(e)},o.enabled=function(e){for(const t of o.skips)if(s(e,t))return!1;for(const t of o.names)if(s(e,t))return!0;return!1},o.humanize=t(585),o.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{o[t]=e[t]}),o.names=[],o.skips=[],o.formatters={},o.selectColor=function(e){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o),t|=0;return o.colors[Math.abs(t)%o.colors.length]},o.enable(o.load()),o}},585(e){var o=1e3,t=60*o,n=60*t,s=24*n,i=7*s;function r(e,o,t,n){var s=o>=1.5*t;return Math.round(e/t)+" "+n+(s?"s":"")}e.exports=function(e,a){a=a||{};var c,d,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var a=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===l&&isFinite(e))return a.long?(c=e,(d=Math.abs(c))>=s?r(c,d,s,"day"):d>=n?r(c,d,n,"hour"):d>=t?r(c,d,t,"minute"):d>=o?r(c,d,o,"second"):c+" ms"):function(e){var i=Math.abs(e);return i>=s?Math.round(e/s)+"d":i>=n?Math.round(e/n)+"h":i>=t?Math.round(e/t)+"m":i>=o?Math.round(e/o)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}};const o={};function t(n){const s=o[n];if(void 0!==s)return s.exports;const i=o[n]={exports:{}};return e[n](i,i.exports,t),i.exports}return t.n=e=>{const o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},t.d=(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{"use strict";var e,o,n,s,i,r=t(833),a=t.n(r);!function(e){e.Open="open",e.Resolved="closed",e.Expired="expired",e.Spam="spam",e.Trash="trash"}(e||(e={})),function(e){e.AnalyticsEvent="moveo-analytics-event",e.IframeLoaded="moveo-iframe-loaded",e.IframeError="moveo-iframe-error",e.WidgetLoaded="moveo-widget-loaded",e.WidgetError="moveo-widget-error",e.Opened="moveo-widget-opened",e.Closed="moveo-widget-closed",e.Resize="moveo-widget-resize",e.LocaleChanged="moveo-widget-locale-changed",e.SessionCreated="moveo-widget-session-created",e.SessionReconnected="moveo-widget-session-reconnected",e.SessionClosed="moveo-widget-session-closed",e.SessionExpired="moveo-widget-session-expired",e.ConversationClosed="moveo-widget-conversation-closed",e.LinkClicked="moveo-widget-link-clicked",e.Navigate="moveo-widget-navigate",e.UserActivity="moveo-widget-user-activity",e.VisitorAction="moveo-widget-visitor-action",e.MemberLeave="moveo-widget-member-leave",e.ConversationUnreadMessages="moveo-conversation-unread-messages",e.ConversationNoUnreadMessages="moveo-conversation-no-unread-messages",e.UserWayInit="moveo-userway-init",e.ChatBackground="moveo-widget-chat-background",e.FloatingWindowChoice="moveo-widget-floating-window-choice",e.WidgetFocused="moveo-widget-focused",e.Detached="moveo-widget-detached",e.Drag="moveo-widget-drag",e.Place="moveo-widget-place",e.IdentityTokenRequest="moveo-identity-token-request"}(o||(o={})),function(e){e.SetConfig="moveo-set-config",e.SetLocale="moveo-set-locale",e.SetCssVariables="moveo-set-css-variables",e.Open="moveo-open",e.Close="moveo-close",e.CloseConversation="moveo-close-conversation",e.SendMessage="moveo-send-message",e.ShowTeaserMessage="moveo-show-teaser-message",e.UpdateContext="moveo-update-context",e.UpdateHostContext="moveo-update-host-context",e.LoadSessionReplay="moveo-load-session-replay",e.HostScroll="moveo-host-scroll",e.HostLocation="moveo-host-location",e.HostVisibility="moveo-host-visibility",e.HostOpenerPolicy="moveo-host-opener-policy",e.HostSection="moveo-host-section",e.HostSectionsResolved="moveo-host-sections-resolved",e.WindowResize="moveo-resize",e.HostFrameBox="moveo-host-frame-box",e.HostPlacement="moveo-host-placement",e.SessionActivity="session-activity",e.UserWayDisabled="userway-disabled",e.UserWayEnabled="userway-enabled",e.LinkClicked="link-clicked",e.VisitorActionHandled="moveo-visitor-action-handled",e.IdentityToken="moveo-identity-token"}(n||(n={})),function(e){e.Expired="expired",e.Survey="survey",e.Closing="closing",e.Resolved="closed",e.Inactivity="inactivity",e.Continue="continue"}(s||(s={})),function(e){e.CloseButton="close-btn",e.EndSessionButton="end-btn",e.HeaderMenuButton="header-menu-btn",e.RestartButton="restart-btn",e.LauncherButton="launcher-btn",e.MessageInput="message-input",e.DisclaimerCheck="disclaimer-check",e.DisclaimerContainer="disclaimer-container",e.HeaderContainer="header-container",e.DragHandle="drag-handle",e.ImageButton="image-btn"}(i||(i={}));const c="moveo-detached:heartbeat",d="moveo-detached:bye",l=[o.AnalyticsEvent,o.LinkClicked,o.Navigate,o.UserActivity,o.VisitorAction,o.LocaleChanged],u=(Math.random().toString(36).slice(2),a()("moveo:safe-read")),g=(e,o)=>{try{return o()}catch(o){return void u("%s unreadable: %o",e,o)}},m=(e,o)=>{g(e,()=>{o()})},C=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),v=e=>Array.from(e,e=>e.charCodeAt(0).toString(16).padStart(2,"0")).join("").replace(/(.{8})(.{4})(.{4})(.{4})/,"$1-$2-$3-$4-"),p=e=>{try{const o=new URL(e);return o.origin===e&&"https:"===o.protocol&&/(^|\.)moveo\.ai$/.test(o.hostname)}catch{return!1}},f=a()("moveo:continue"),h=(e,o)=>g(e,()=>window[e].getItem(o))??null,w=(e,o)=>m("sessionStorage",()=>window.sessionStorage.setItem(e,JSON.stringify(o))),y=()=>{const e=document.getElementById("continue-used");e&&(e.hidden=!1)};((e,t)=>{const n=new URLSearchParams(window.location.search),{integrationId:s,code:i,host:r,windowMode:a}=(e=>{const o=e.has("t")?(e=>{try{const o=atob(e.replace(/-/g,"+").replace(/_/g,"/")),t=32;return o.length<=t?{}:{i:v(o.slice(0,16)),c:C(o.slice(16,t)),h:o.slice(t)}}catch{return{}}})(e.get("t")??""):{},t=(t,n)=>o[t]||e.get(t)||e.get(n),n=t("h","host");return{integrationId:t("i","integration_id"),code:t("c","code"),host:n&&p(n)?n:void 0,windowMode:"window"===e.get("mode")}})(n);(e=>{const o=((e,o)=>{const t=o=>Object.prototype.hasOwnProperty.call(e,o);return o.map(e=>{const o=(e||"").toLowerCase(),n=o.split("-")[0];return t(o)?o:t(n)?n:null}).find(Boolean)||"en"})(e,[h("localStorage","moveo_web_client_language"),...navigator.languages||[navigator.language]]),t=e[o];var n;document.documentElement.lang="me"===(n=o)?"sr-ME":n,document.documentElement.dir="ar"===o?"rtl":"ltr",document.title=t.page_title;const s=(e,o)=>{const t=document.querySelector(e);t&&(t.textContent=o)};s("#continue-loading p",t.loading),s("#continue-used h1",t.used_title),s("#continue-used p",t.used_subtitle)})(e);const u=document.getElementById("continue-chat");if(!u)return;const g=((e,o,t,n)=>s=>new Promise((i,r)=>{e.hidden=!1;const a=document.createElement("script");a.src=o,a.onerror=r,a.onload=()=>{const{MoveoAI:o}=window;o.init({...s,integrationId:t,host:n,element:e,widget_position:"embed"}).then(e=>{document.getElementById("continue-loading")?.remove(),i(e)}).catch(e=>{f("The widget did not load",e),r(e)})},document.head.appendChild(a)}))(u,t,s??"",r);if(a)return void((e,t,n)=>{const{origin:s}=window.location,i=window.opener&&!window.opener.closed?window.opener:null,r=`moveo_${e}_detached_handoff`;let a=null;try{a=JSON.parse(h("sessionStorage",r)||"null")}catch{}if(!e||a?.ended||!i&&!a?.session_id)return y(),void window.close();const u=i?.top??null;let g,m=null,C=null,v={};const p=(e,o)=>{const t=(n,i)=>{for(let r=0;r<n.length;r++)n[r].postMessage({type:e,session_id:m,data:o},s),i<4&&t(n[r].frames,i+1)};try{u&&t(u.frames,1)}catch{}},f=e=>{m=e.session_id,window.addEventListener("pagehide",()=>p(d)),n({...e.config,floating_session_id:m,...e.language&&{language:e.language},...e.client_url&&{floating_client_url:e.client_url}}).then(o=>{C=o;const t={...e.css_variables,...v.css_variables};Object.keys(t).length&&C.setCSSVariables(t),v.language&&C.setLocale(v.language),u&&(p(c),g=setInterval(()=>p(c),2e3))},()=>{p(d),window.close()})};i?(window.addEventListener("message",e=>{if(e.origin!==s)return;const n=e.data,a=String(n?.type);if("moveo-detached:session"!==n?.type||"string"!=typeof n.session_id||m||e.source!==i){if("moveo-detached:close"===n?.type)window.close();else if("moveo-detached:settings"===n?.type){const{css_variables:e,language:o}=n;C?(e&&C.setCSSVariables(e),o&&C.setLocale(o)):v={css_variables:{...v.css_variables,...e},language:o||v.language}}else if(m&&e.source===t.querySelector("iframe")?.contentWindow){if(a.endsWith(o.SessionClosed)||a.endsWith(o.SessionExpired))return clearInterval(g),w(r,{session_id:m,ended:!0}),void p(d);const t=l.find(e=>a.endsWith(e));t&&p("moveo-detached:relay",{type:t,data:e.data.data})}}else{const{session_id:e,language:o,client_url:t,css_variables:s,config:i}=n,a={session_id:e,language:o,client_url:t,css_variables:s,config:i};w(r,a),f(a)}}),i.postMessage({type:"moveo-detached:ready",session_id:a?.session_id??null},s)):f(a)})(s,u,g);const F=`moveo_${s}_continue_code`,b=`moveo_${s}_continue_origin`;if(s&&i&&m("sessionStorage",()=>{window.sessionStorage.setItem(F,i);const e=JSON.parse(h("sessionStorage",b)||"null");e?.code!==i&&window.sessionStorage.removeItem(b)}),n.has("c")||n.has("code")){n.delete("c"),n.delete("code");const e=n.toString();window.history.replaceState(null,"",`${window.location.pathname}${e?`?${e}`:""}`)}const S=`moveo_${s}_session_id`,_=i||h("sessionStorage",F),x=h("localStorage",S)||h("sessionStorage",S);s&&(_||x)?g({sticky_session:!0,continue_code:_||""}).catch(()=>{}):y()})(JSON.parse(document.getElementById("continue-strings")?.textContent||"{}"),document.currentScript?.dataset.loader??"")})(),{}})());
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.127.0-true.56
3
+ * @moveo-ai/web-client v0.127.0-true.57
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */