@moveo-ai/web-client 0.120.0-true.3 → 0.120.0-true.5
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/dist/63.min.js.LICENSE.txt +1 -1
- package/dist/752.min.js.LICENSE.txt +1 -1
- package/dist/882.min.js.LICENSE.txt +1 -1
- package/dist/929.min.js.LICENSE.txt +1 -1
- package/dist/_headers +4 -0
- package/dist/audio-client.min.js.LICENSE.txt +1 -1
- package/dist/continue/index.html +176 -0
- package/dist/iframe.min.js +1 -1
- package/dist/iframe.min.js.LICENSE.txt +1 -1
- package/dist/index.html +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/preview.css.min.js.LICENSE.txt +1 -1
- package/dist/public/locales/ar.json +21 -0
- package/dist/public/locales/bg.json +21 -0
- package/dist/public/locales/cs.json +21 -0
- package/dist/public/locales/da.json +21 -0
- package/dist/public/locales/de.json +21 -0
- package/dist/public/locales/el.json +21 -0
- package/dist/public/locales/en.json +21 -0
- package/dist/public/locales/es.json +21 -0
- package/dist/public/locales/fr.json +21 -0
- package/dist/public/locales/id.json +21 -0
- package/dist/public/locales/it.json +21 -0
- package/dist/public/locales/ja.json +21 -0
- package/dist/public/locales/me.json +21 -0
- package/dist/public/locales/nl-be.json +21 -0
- package/dist/public/locales/nl.json +21 -0
- package/dist/public/locales/pl.json +21 -0
- package/dist/public/locales/pt-br.json +21 -0
- package/dist/public/locales/pt.json +21 -0
- package/dist/public/locales/ro.json +21 -0
- package/dist/public/locales/ru.json +21 -0
- package/dist/public/locales/sq.json +21 -0
- package/dist/public/locales/sr.json +21 -0
- package/dist/public/locales/sv.json +21 -0
- package/dist/public/locales/tl.json +21 -0
- package/dist/public/locales/tr.json +21 -0
- package/dist/public/locales/zh.json +21 -0
- package/dist/telnyx-client.min.js.LICENSE.txt +1 -1
- package/dist/web-client.min.js +1 -1
- package/dist/web-client.min.js.LICENSE.txt +1 -1
- package/dist/webrtc-client.min.js.LICENSE.txt +1 -1
- package/package.json +1 -1
package/dist/_headers
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<!doctype html><html lang="en"><head><meta name="referrer" content="no-referrer"/><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="robots" content="noindex"/><title>Continue your conversation</title><style>html,
|
|
2
|
+
body {
|
|
3
|
+
margin: 0;
|
|
4
|
+
height: 100%;
|
|
5
|
+
background: #f4f4f5;
|
|
6
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
7
|
+
color: #18181b;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
body {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#continue-chat {
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
width: min(560px, 100%);
|
|
19
|
+
height: min(760px, calc(100dvh - 48px));
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
border-radius: 12px;
|
|
22
|
+
background: #fff;
|
|
23
|
+
box-shadow: 0 2px 12px rgb(0 0 0 / 12%);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#continue-used {
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
max-width: 420px;
|
|
29
|
+
padding: 24px;
|
|
30
|
+
text-align: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#continue-used h1 {
|
|
34
|
+
margin: 0 0 8px;
|
|
35
|
+
font-size: 20px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#continue-used p {
|
|
39
|
+
margin: 0;
|
|
40
|
+
color: #52525b;
|
|
41
|
+
font-size: 15px;
|
|
42
|
+
line-height: 22px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (width <= 700px) {
|
|
46
|
+
#continue-chat {
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100dvh;
|
|
49
|
+
border-radius: 0;
|
|
50
|
+
box-shadow: none;
|
|
51
|
+
}
|
|
52
|
+
}</style></head><body><div id="continue-chat" hidden></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.</p></div><script>(function () {
|
|
53
|
+
const params = new URLSearchParams(window.location.search);
|
|
54
|
+
|
|
55
|
+
// `t` packs the integration id (16 bytes), the code (16 bytes) and the channels host.
|
|
56
|
+
const readToken = (token) => {
|
|
57
|
+
try {
|
|
58
|
+
const bytes = atob(token.replace(/-/g, '+').replace(/_/g, '/'));
|
|
59
|
+
if (bytes.length <= 32) {
|
|
60
|
+
return {};
|
|
61
|
+
}
|
|
62
|
+
const hex = Array.from(bytes.slice(0, 16), (char) =>
|
|
63
|
+
char.charCodeAt(0).toString(16).padStart(2, '0')
|
|
64
|
+
).join('');
|
|
65
|
+
return {
|
|
66
|
+
i: `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`,
|
|
67
|
+
c: btoa(bytes.slice(16, 32))
|
|
68
|
+
.replace(/\+/g, '-')
|
|
69
|
+
.replace(/\//g, '_')
|
|
70
|
+
.replace(/=+$/, ''),
|
|
71
|
+
h: bytes.slice(32),
|
|
72
|
+
};
|
|
73
|
+
} catch {
|
|
74
|
+
return {};
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// A value in `t` wins over its own parameter, and the long names still work.
|
|
79
|
+
const token = params.has('t') ? readToken(params.get('t')) : {};
|
|
80
|
+
const param = (short, long) =>
|
|
81
|
+
token[short] || params.get(short) || params.get(long);
|
|
82
|
+
const integrationId = param('i', 'integration_id');
|
|
83
|
+
const code = param('c', 'code');
|
|
84
|
+
const rawHost = param('h', 'host');
|
|
85
|
+
|
|
86
|
+
// Only a Moveo host: the link is built by our agents, but anyone can edit a URL.
|
|
87
|
+
const allowedHost = (value) => {
|
|
88
|
+
try {
|
|
89
|
+
const url = new URL(value);
|
|
90
|
+
return url.protocol === 'https:' && /(^|\.)moveo\.ai$/.test(url.hostname);
|
|
91
|
+
} catch {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const host = rawHost && allowedHost(rawHost) ? rawHost : undefined;
|
|
96
|
+
|
|
97
|
+
const read = (store, key) => {
|
|
98
|
+
try {
|
|
99
|
+
return window[store].getItem(key);
|
|
100
|
+
} catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// The widget's own language order: the stored choice, then the browser's.
|
|
106
|
+
const strings = {"ar":{"page_title":"تابع محادثتك","used_title":"تم استخدام هذا الرابط بالفعل","used_subtitle":"ارجع إلى التطبيق الذي بدأت منه، أو افتح المحادثة حيث تابعتها بالفعل."},"bg":{"page_title":"Продължете разговора си","used_title":"Тази връзка вече е използвана","used_subtitle":"Върнете се в приложението, където започнахте, или отворете разговора там, където вече сте го продължили."},"cs":{"page_title":"Pokračujte v konverzaci","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","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","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":"Συνεχίστε τη συνομιλία σας","used_title":"Αυτός ο σύνδεσμος έχει ήδη χρησιμοποιηθεί","used_subtitle":"Επιστρέψτε στην εφαρμογή όπου ξεκινήσατε ή ανοίξτε τη συνομιλία εκεί όπου τη συνεχίσατε ήδη."},"en":{"page_title":"Continue your conversation","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","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","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","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","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":"会話を続ける","used_title":"このリンクはすでに使用されています","used_subtitle":"開始したアプリに戻るか、すでに続きを進めている会話を開いてください。"},"me":{"page_title":"Nastavite razgovor","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","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","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ę","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","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","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","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":"Продолжите разговор","used_title":"Эта ссылка уже использована","used_subtitle":"Вернитесь в приложение, где вы начали, или откройте разговор там, где вы уже его продолжили."},"sq":{"page_title":"Vazhdo bisedën","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":"Наставите разговор","used_title":"Ова веза је већ искоришћена","used_subtitle":"Вратите се у апликацију у којој сте почели или отворите разговор тамо где сте га већ наставили."},"sv":{"page_title":"Fortsätt konversationen","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","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","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":"继续您的对话","used_title":"此链接已被使用","used_subtitle":"请返回您开始对话的应用,或打开您已继续的对话。"}};
|
|
107
|
+
const supported = (tag) => {
|
|
108
|
+
const lower = (tag || '').toLowerCase();
|
|
109
|
+
const base = lower.split('-')[0];
|
|
110
|
+
return strings[lower] ? lower : strings[base] ? base : null;
|
|
111
|
+
};
|
|
112
|
+
const language =
|
|
113
|
+
[
|
|
114
|
+
read('localStorage', 'moveo_web_client_language'),
|
|
115
|
+
...(navigator.languages || [navigator.language]),
|
|
116
|
+
]
|
|
117
|
+
.map(supported)
|
|
118
|
+
.find(Boolean) || 'en';
|
|
119
|
+
document.documentElement.lang = language === 'me' ? 'sr-ME' : language;
|
|
120
|
+
document.documentElement.dir = language === 'ar' ? 'rtl' : 'ltr';
|
|
121
|
+
document.title = strings[language].page_title;
|
|
122
|
+
document.querySelector('#continue-used h1').textContent =
|
|
123
|
+
strings[language].used_title;
|
|
124
|
+
document.querySelector('#continue-used p').textContent =
|
|
125
|
+
strings[language].used_subtitle;
|
|
126
|
+
|
|
127
|
+
const codeKey = `moveo_${integrationId}_continue_code`;
|
|
128
|
+
if (integrationId && code) {
|
|
129
|
+
try {
|
|
130
|
+
window.sessionStorage.setItem(codeKey, code);
|
|
131
|
+
} catch {
|
|
132
|
+
// Storage blocked: the code still works for this load.
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (params.has('c') || params.has('code')) {
|
|
137
|
+
params.delete('c');
|
|
138
|
+
params.delete('code');
|
|
139
|
+
const query = params.toString();
|
|
140
|
+
window.history.replaceState(
|
|
141
|
+
null,
|
|
142
|
+
'',
|
|
143
|
+
`${window.location.pathname}${query ? `?${query}` : ''}`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const sessionKey = `moveo_${integrationId}_session_id`;
|
|
148
|
+
const storedCode = code || read('sessionStorage', codeKey);
|
|
149
|
+
const storedSession =
|
|
150
|
+
read('localStorage', sessionKey) || read('sessionStorage', sessionKey);
|
|
151
|
+
|
|
152
|
+
if (!integrationId || (!storedCode && !storedSession)) {
|
|
153
|
+
document.getElementById('continue-used').hidden = false;
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const element = document.getElementById('continue-chat');
|
|
158
|
+
element.hidden = false;
|
|
159
|
+
|
|
160
|
+
const webpackFiles = `../iframe.min.js?e2ea0f203a1bad29e885,../web-client.min.js?e2ea0f203a1bad29e885,../preview.css.min.js?e2ea0f203a1bad29e885,../audio-client.min.js?e2ea0f203a1bad29e885,../webrtc-client.min.js?e2ea0f203a1bad29e885,../telnyx-client.min.js?e2ea0f203a1bad29e885`.split(',');
|
|
161
|
+
const script = document.createElement('script');
|
|
162
|
+
script.src = webpackFiles.find((file) => file.includes('web-client.min.js'));
|
|
163
|
+
script.onload = function () {
|
|
164
|
+
window.MoveoAI.init({
|
|
165
|
+
integrationId,
|
|
166
|
+
host,
|
|
167
|
+
element,
|
|
168
|
+
widget_position: 'embed',
|
|
169
|
+
sticky_session: true,
|
|
170
|
+
continue_code: storedCode || '',
|
|
171
|
+
}).catch((error) => {
|
|
172
|
+
console.error(error);
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
document.head.appendChild(script);
|
|
176
|
+
})();</script></body></html>
|