@ahoy-ai/web 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +91 -2
- package/dist/ahoy.js +2 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader/ahoy.d.ts +166 -0
- package/dist/esm/loader/ahoy.d.ts.map +1 -0
- package/dist/esm/loader/ahoy.js +513 -0
- package/dist/esm/loader/ahoy.js.map +1 -0
- package/dist/esm/loader/global.d.ts +12 -0
- package/dist/esm/loader/global.d.ts.map +1 -0
- package/dist/esm/loader/global.js +65 -0
- package/dist/esm/loader/global.js.map +1 -0
- package/dist/esm/loader/launcher.d.ts +34 -0
- package/dist/esm/loader/launcher.d.ts.map +1 -0
- package/dist/esm/loader/launcher.js +135 -0
- package/dist/esm/loader/launcher.js.map +1 -0
- package/dist/esm/loader/navigation.d.ts +2 -0
- package/dist/esm/loader/navigation.d.ts.map +1 -0
- package/dist/esm/loader/navigation.js +37 -0
- package/dist/esm/loader/navigation.js.map +1 -0
- package/dist/esm/loader/style.d.ts +9 -0
- package/dist/esm/loader/style.d.ts.map +1 -0
- package/dist/esm/loader/style.js +13 -0
- package/dist/esm/loader/style.js.map +1 -0
- package/dist/esm/protocol.d.ts +120 -0
- package/dist/esm/protocol.d.ts.map +1 -0
- package/dist/esm/protocol.js +58 -0
- package/dist/esm/protocol.js.map +1 -0
- package/dist/esm/version.d.ts +3 -0
- package/dist/esm/version.d.ts.map +1 -0
- package/dist/esm/version.js +3 -0
- package/dist/esm/version.js.map +1 -0
- package/package.json +68 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @ahoy-ai/web
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Web devices now send the page origin when they refresh their session token and when they update the device, so the API can apply "App settings → Web" on every visit, not only the first one. A refused origin keeps the session and stops the widget instead of registering a new visitor; the loader removes the launcher. Also: Pip welcome illustration, dark-mode polish, send button spacing and a `data-app-id`-first snippet.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @ahoy-ai/core@0.1.1
|
|
10
|
+
|
|
11
|
+
## 0.1.0
|
|
12
|
+
|
|
13
|
+
- First release (ADR 0017 phase 3).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NOJU LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,92 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ahoy-ai/web
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
In-app support chat for websites and web apps: the same chat, inbox and AI agent as Ahoy's mobile SDK, with a launcher button and a chat panel (ADR 0017). Most sites paste the script tag; bundlers can install this package; React apps use [`@ahoy-ai/react`](../react).
|
|
4
|
+
|
|
5
|
+
## Script tag
|
|
6
|
+
|
|
7
|
+
Paste before `</body>` (or in your site builder's custom-code field):
|
|
8
|
+
|
|
9
|
+
<!-- prettier-ignore -->
|
|
10
|
+
```html
|
|
11
|
+
<script>window.Ahoy=window.Ahoy||{q:[],identify:function(){this.q.push(['identify',arguments])},open:function(){this.q.push(['open'])}};</script>
|
|
12
|
+
<script data-app-id="app_XXXX" async src="https://cdn.ahoysupport.com/web/v1/ahoy.js"></script>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The first line is a queue stub: `Ahoy.identify(...)` and `Ahoy.open()` work before `ahoy.js` has loaded and are replayed in order once it has. `ahoy.js` runs before the page's `load` event and then replaces the stub with the full `window.Ahoy`; call the other methods (`setMetadata`, `track`, `logout`) after that.
|
|
16
|
+
|
|
17
|
+
| Attribute | Meaning |
|
|
18
|
+
| -------------------------------- | -------------------------------------------------------------------------------------- |
|
|
19
|
+
| `data-app-id` | Your App ID (`app_XXXX`). Without it nothing starts until `Ahoy.configure({ appId })`. |
|
|
20
|
+
| `data-environment="development"` | Turns on the setup check and development warnings. |
|
|
21
|
+
| `data-launcher="false"` | Hides the built-in button; open the chat with `Ahoy.open()` from your own. |
|
|
22
|
+
| `data-position="left"` | Overrides the launcher side published in the dashboard design (default: that side). |
|
|
23
|
+
| `data-language="de"` | Forces the chat's language (default: the page's `<html lang>`, then the browser's). |
|
|
24
|
+
| `data-api-url` | A local Ahoy API; used only with `data-environment="development"`. |
|
|
25
|
+
|
|
26
|
+
The panel is always loaded from `/web/v1/frame.html` on the same CDN as `ahoy.js` (or the CDN the file was built for, `AHOY_CDN_URL`).
|
|
27
|
+
|
|
28
|
+
## npm
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { getAhoy } from '@ahoy-ai/web';
|
|
32
|
+
|
|
33
|
+
const ahoy = getAhoy(); // window.Ahoy, created on first call
|
|
34
|
+
ahoy.configure({ appId: 'app_XXXX', environment: 'development' });
|
|
35
|
+
await ahoy.identify({ token }); // after login; ahoy.logout() on sign-out
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The npm entry is the loader only (about 5 KB gzip): no panel, no Preact, no runtime dependencies, and nothing touches `window` until you call it. The panel still comes from the CDN (`cdnUrl`, default `https://cdn.ahoysupport.com`); set `cdnUrl: 'http://localhost:4400'` for the local panel server.
|
|
39
|
+
|
|
40
|
+
## `window.Ahoy`
|
|
41
|
+
|
|
42
|
+
The same names as the mobile SDK where they apply: `configure`, `identify`, `setMetadata`, `track`, `open`, `close`, `onEvent`, `logout`, `deleteData`, `appearance`, `runSetupCheck`. For framework wrappers: `getState()` (`{ ready, open, unread }`) and `subscribe(listener)`.
|
|
43
|
+
|
|
44
|
+
- Calls made before the panel is ready are queued. Methods that return a promise resolve once the call is queued for the panel: a refused identity token arrives as an `identity_rejected` event (`Ahoy.onEvent`), and the setup check result is logged in the browser console.
|
|
45
|
+
- `identify({ token })` takes the same HS256 token as mobile, signed by **your server**. The identity secret never ships to the browser: mint the token in a server route and fetch it after login.
|
|
46
|
+
- Not on web: `registerPush` (resolves `{ registered: false, reason: 'unsupported' }`), `notificationBehavior` (null), `onOffer` and `setPaywalls` (ignored). They exist so shared code compiles, and warn once in development.
|
|
47
|
+
- The panel sets the reserved metadata key `page` (the path, no query string) on every navigation, so your inbox shows where the visitor is; a `setMetadata({ page })` of your own is overwritten.
|
|
48
|
+
|
|
49
|
+
## How it works
|
|
50
|
+
|
|
51
|
+
- **Loader** (`ahoy.js`, in your page): draws the launcher (a round button in your published accent color, with an unread badge), creates the panel iframe at page idle, and talks to it over `postMessage` (ADR 0017's message table; every message is `{ channel: 'ahoy', protocol: 1, type, payload }`, and both sides check the sender's origin). It adds no inline script or style to your page: strict sites only need `script-src` and `frame-src` for the CDN.
|
|
52
|
+
- **Panel** (`frame.html` on the CDN): `@ahoy-ai/core` with browser adapters and a Preact chat UI. It holds the session (its own `localStorage`, which your page's scripts can't read; browsers partition it per site), the history cache (IndexedDB) and the WebSocket (`/ws?token=`). In private windows or with storage blocked, the session lives in memory and a reload starts a new one.
|
|
53
|
+
- **Layout**: a 400 × 700 panel 20 px from the side on desktop, as high above the bottom as the launcher; under 640 px the panel covers the viewport with its close button always visible. The launcher hides while the panel is open.
|
|
54
|
+
- **Launcher place**: the side and the bottom offset (0 to 200 px, default bottom right, 20 px up) come from the published chat design (the dashboard's chat design editor, or `ahoy_set_chat_design`), so the button can clear a cookie bar or a bottom navigation. A side set in code (`data-position`, `position`) wins over the published side. The panel waits up to 3 seconds for the published design before the launcher appears, so it shows once, in place.
|
|
55
|
+
- **Accessibility**: the panel is a labelled dialog; focus moves to the message field on open and back to the launcher on close, Escape closes, Tab stays inside, and new support messages are announced through a live region.
|
|
56
|
+
- **Photos**: a file picker (the phone's own picker offers the camera), resized on a canvas to 2,048 px on the longest edge as JPEG, then uploaded with the same presigned POST as mobile. Queued photos keep their bytes in IndexedDB, so they survive a reload.
|
|
57
|
+
- **Allowed websites**: the panel sends your page's origin (from the referrer) when it registers, and again on every token refresh and device update, so a returning visitor's stored session is checked too. If the app lists allowed websites (dashboard App settings → Web) and yours isn't one, the API refuses (403 `origin_not_allowed`): the launcher never appears (or is removed, when the list changed during a visit), the panel sends nothing more until the page reloads, and the console says why.
|
|
58
|
+
- **`apiUrl`**: used only with `environment: 'development'` (a local API while building). In production the panel always uses the hosted API and the console says the `apiUrl` was ignored.
|
|
59
|
+
- **Setup check** (`environment: 'development'`): sent once per SDK version and origin, the first time the chat's socket connects (or falls back to polling), so it can report the origin, the config and the socket.
|
|
60
|
+
- Review cards and paywall offers are mobile-only; the panel hides them.
|
|
61
|
+
|
|
62
|
+
## Develop
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
pnpm build # dist/esm (npm), dist/ahoy.js and dist/frame/ (CDN)
|
|
66
|
+
pnpm test # Jest (jsdom): protocol, loader, adapters, bridge and panel UI
|
|
67
|
+
pnpm size # loader 12 KB, panel 70 KB gzip (ADR 0017 budgets)
|
|
68
|
+
pnpm dev # the local panel server on http://localhost:4400 (below)
|
|
69
|
+
pnpm e2e # Playwright on Chromium, Firefox and WebKit (below)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Build variables: `AHOY_CDN_URL` (the CDN base the loader opens `<AHOY_CDN_URL>/web/v1/frame.html` on; unset: the origin `ahoy.js` was loaded from) and `AHOY_DEFAULT_API_URL` (the API the panel uses when the page names none; default the dev API).
|
|
73
|
+
|
|
74
|
+
CDN layout (what `ahoy-sdk/.github/workflows/deploy-cdn.yml` publishes): `dist/ahoy.js` → `/web/v1/ahoy.js` (and `/web/<version>/ahoy.js`), `dist/frame/frame.html` → `/web/v1/frame.html`, `dist/frame/assets/*` (content-hashed) → `/web/v1/assets/*`. `frame.html` has no inline script; it needs the CSP of CONTRACT C7.
|
|
75
|
+
|
|
76
|
+
### Local panel server (port 4400)
|
|
77
|
+
|
|
78
|
+
`pnpm dev` builds into `.dev/` (never `dist/`) and serves the loader and panel like the CDN, plus demo host pages on a second origin:
|
|
79
|
+
|
|
80
|
+
- `http://localhost:4400/web/v1/ahoy.js`, `.../frame.html`: the loader and the panel (with the frame CSP).
|
|
81
|
+
- `http://127.0.0.1:4400/demo/?app=app_demo`: a host page with the two-line snippet (`&api=`, `&launcher=false`, `&position=left`, `&language=`, `&open=1` to call `Ahoy.open()` through the stub).
|
|
82
|
+
- `http://127.0.0.1:4400/demo/strict?app=app_demo`: the same under `script-src`/`frame-src` only, no inline script.
|
|
83
|
+
|
|
84
|
+
`AHOY_API_URL` (default `http://localhost:8787`) is the API the panel uses there; `PORT` changes the port; `AHOY_DEV_WATCH=1` rebuilds on each request. The local API must accept the panel's origin in CORS (CONTRACT C10).
|
|
85
|
+
|
|
86
|
+
### End-to-end tests
|
|
87
|
+
|
|
88
|
+
`pnpm e2e` starts `e2e/mock-api.mjs` (a mock `/sdk/v1` and `/ws` on port 8840) and the panel server, then runs `e2e/chat.spec.ts` on Chromium, Firefox and WebKit: anonymous chat (registration as web with the origin, the web setup check, `page` metadata), SPA navigation, photo upload (resized to 2,048 px, JPEG), identify with a token and a refused token, reconnect after a dropped socket, the unread badge across a reload, the mobile viewport, the desktop panel size, keyboard and axe (WCAG 2.1 AA), the queue stub, a strict-CSP page, a refused origin, and a returning visitor refused at the token refresh or a device update after the allowed list changed.
|
|
89
|
+
|
|
90
|
+
Against a real API: `AHOY_E2E_API_URL=http://localhost:8787 AHOY_E2E_APP_ID=app_demo pnpm e2e` (tests that need the mock's controls are skipped). `AHOY_E2E_REUSE=1` reuses servers you started yourself.
|
|
91
|
+
|
|
92
|
+
Browsers: `npx playwright install chromium-headless-shell firefox webkit` (userland, in `~/.cache/ms-playwright`). WebKit on Linux needs `libevent-2.1-7t64 libavif16 libmanette-0.2-0` (`sudo npx playwright install-deps webkit`). On the build machine they were installed without sudo: `apt-get download` of those packages plus `libgav1-1` and `libhidapi-hidraw0`, extracted with `dpkg -x` to `~/.local/opt/playwright-webkit-deps`, and symlinked into `~/.cache/ms-playwright/webkit-2388/minibrowser-wpe/sys/lib` (redo after a Playwright browser update).
|
package/dist/ahoy.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! Ahoy web loader 0.1.1 | MIT */
|
|
2
|
+
"use strict";(()=>{var M=Object.defineProperty;var k=(o,e,t)=>e in o?M(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var s=(o,e,t)=>k(o,typeof e!="symbol"?e+"":e,t);var _=[1],v="ahoy";var g=new Set(["ready","unread","resize","event","opened","closed","stopped"]);function b(o){return{channel:v,protocol:1,...o}}function A(o,e){if(!o||typeof o!="object")return null;let t=o;return t.channel!==v||typeof t.type!="string"||!e.has(t.type)||typeof t.protocol!="number"||!_.includes(t.protocol)?null:o}function y(o){if(!o)return null;try{let{protocol:e,host:t}=new URL(o);return e!=="http:"&&e!=="https:"?null:`${e}//${t}`.toLowerCase()}catch{return null}}function a(o,e){for(let[t,i]of Object.entries(e))o.style.setProperty(t,i,"important")}var d=2147483e3;var w="http://www.w3.org/2000/svg",C="M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v9a2.5 2.5 0 0 1-2.5 2.5H10l-4.2 3.6A.5.5 0 0 1 5 20.2V17h0a2.5 2.5 0 0 1-1-2Z",u=class{constructor(e,t){s(this,"doc",e);s(this,"host");s(this,"button");s(this,"badge");s(this,"label");s(this,"unread",0);this.label=t.label,this.host=e.createElement("div"),this.host.setAttribute("data-ahoy","launcher"),a(this.host,{position:"fixed","z-index":String(d),margin:"0"});let i=this.host.attachShadow?this.host.attachShadow({mode:"open"}):this.host,n=e.createElement("button");n.type="button",n.setAttribute("aria-haspopup","dialog"),n.setAttribute("aria-expanded","false"),n.setAttribute("aria-controls",t.controls),a(n,{all:"initial",display:"flex","align-items":"center","justify-content":"center",width:"56px",height:"56px","border-radius":"50%",cursor:"pointer","box-shadow":"0 6px 20px rgba(15, 23, 42, 0.24)",transition:"transform .15s ease",position:"relative",outline:"none"}),n.addEventListener("click",t.onClick),n.addEventListener("pointerenter",()=>a(n,{transform:"scale(1.06)"})),n.addEventListener("pointerleave",()=>a(n,{transform:"none"})),n.addEventListener("focus",()=>{H(n,":focus-visible")&&a(n,{"box-shadow":"0 0 0 3px #ffffff, 0 0 0 6px #111827"})}),n.addEventListener("blur",()=>a(n,{"box-shadow":"0 6px 20px rgba(15, 23, 42, 0.24)"}));let r=e.createElementNS(w,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("width","28"),r.setAttribute("height","28"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false");let l=e.createElementNS(w,"path");l.setAttribute("d",C),l.setAttribute("fill","#ffffff"),r.appendChild(l),n.appendChild(r);let p=e.createElement("span");p.setAttribute("aria-hidden","true"),a(p,{all:"initial",position:"absolute",top:"-4px",right:"-4px","min-width":"20px",height:"20px",padding:"0 6px","box-sizing":"border-box","border-radius":"10px",background:"#d92d20",color:"#ffffff",font:'600 12px/20px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',"text-align":"center",border:"2px solid #ffffff",display:"none"}),n.appendChild(p),i.appendChild(n),this.button=n,this.badge=p,this.setPosition(t.position,t.bottomOffset),this.setAccent(t.accent),this.render()}setPosition(e,t){a(this.host,{bottom:`${t}px`,...e==="left"?{left:"20px",right:"auto"}:{right:"20px",left:"auto"}})}setAccent(e){a(this.button,{background:e})}setLabel(e){this.label=e,this.render()}setUnread(e){this.unread=Math.max(0,Math.floor(e)),this.render()}setExpanded(e){this.button.setAttribute("aria-expanded",String(e))}setVisible(e){a(this.host,{display:e?"block":"none"})}focus(){this.button.focus()}remove(){this.host.remove()}render(){let e=this.unread;this.badge.textContent=e>99?"99+":String(e),a(this.badge,{display:e>0?"block":"none"}),this.button.setAttribute("aria-label",e>0?`${this.label} (${e})`:this.label)}};function H(o,e){try{return o.matches(e)}catch{return!0}}var E=Symbol.for("ahoy.history"),m="ahoy:locationchange";function x(o,e){let t=o.history;if(!t[E]){t[E]=!0;for(let r of["pushState","replaceState"]){let l=t[r];t[r]=function(...p){let f=l.apply(this,p);return o.dispatchEvent(new Event(m)),f}}}let i=null,n=()=>{let r=o.location.pathname||"/";r!==i&&(i=r,e(r))};return o.addEventListener("popstate",n),o.addEventListener(m,n),n(),()=>{o.removeEventListener("popstate",n),o.removeEventListener(m,n)}}var T="https://cdn.ahoysupport.com",R="/web/v1/frame.html",W=/^app_[A-Za-z0-9]+$/,U=400,O=700,c=20,N=200,D=640,$=1e4,V=500,F=0,h=class{constructor(e={window,document},t=null){s(this,"env",e);s(this,"scriptSrc",t);s(this,"options",null);s(this,"frameUrl","");s(this,"frameOrigin","");s(this,"iframe",null);s(this,"launcher",null);s(this,"state",{ready:!1,open:!1,unread:0});s(this,"listeners",new Set);s(this,"subscribers",new Set);s(this,"queue",[]);s(this,"wantOpen",!1);s(this,"mode","panel");s(this,"panelHeight",O);s(this,"position","right");s(this,"bottomOffset",c);s(this,"title","Support");s(this,"currentAppearance",{});s(this,"cleanups",[]);s(this,"idleHandle",null);s(this,"returnFocus",null);s(this,"stopped",!1);s(this,"warned",new Set);s(this,"frameId",`ahoy-frame-${++F}`)}configure(e){if(!e||typeof e.appId!="string"||!W.test(e.appId)){console.error('[Ahoy] configure: appId must look like "app_XXXX".');return}let t=this.options;this.options={...e},e.appearance&&(this.currentAppearance={...e.appearance});let i=this.resolveFrameUrl(e);if(t&&t.appId===e.appId&&t.apiUrl===e.apiUrl&&i===this.frameUrl&&(this.iframe||this.idleHandle)){this.applyLauncherVisibility(),this.state.ready&&this.sendConfigure();return}this.teardown(t===null),this.frameUrl=i,this.frameOrigin=y(i)??"";let n=l=>this.onMessage(l);this.env.window.addEventListener("message",n);let r=()=>this.layout();this.env.window.addEventListener("resize",r),this.cleanups.push(()=>this.env.window.removeEventListener("message",n),()=>this.env.window.removeEventListener("resize",r)),this.wantOpen?this.mount():this.idleHandle=q(this.env.window,()=>this.mount())}identify(e){return this.send({type:"identify",payload:[e]}),Promise.resolve()}setMetadata(e,t){return this.send({type:"setMetadata",payload:t?[e,t]:[e]}),Promise.resolve()}track(e,t,i){let n=[e];(t!==void 0||i!==void 0)&&n.push(t),i!==void 0&&n.push(i),this.send({type:"track",payload:n})}open(){this.stopped||(this.wantOpen=!0,this.options&&(this.iframe||this.mount(),this.state.ready&&this.post({type:"open"})))}close(){this.wantOpen=!1,this.state.ready&&this.post({type:"close"})}onEvent(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}logout(){return this.send({type:"logout"}),Promise.resolve()}deleteData(){return this.send({type:"deleteData"}),Promise.resolve()}get appearance(){return this.currentAppearance}set appearance(e){this.currentAppearance={...e??{}},this.options&&(this.options.appearance=this.currentAppearance),this.state.ready&&this.sendConfigure()}runSetupCheck(){return this.send({type:"runSetupCheck"}),Promise.resolve()}registerPush(){return this.warnOnce("registerPush","[Ahoy] registerPush: push is not available on web yet."),Promise.resolve({registered:!1,reason:"unsupported"})}notificationBehavior(){return this.warnOnce("notificationBehavior","[Ahoy] notificationBehavior: not available on web."),null}onOffer(e){return this.warnOnce("onOffer","[Ahoy] onOffer: offer cards are not shown on web."),()=>{}}setPaywalls(e){this.warnOnce("setPaywalls","[Ahoy] setPaywalls: paywall offers are not shown on web.")}getState(){return this.state}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}destroy(){this.teardown(),this.options=null,this.wantOpen=!1}resolveFrameUrl(e){return`${(e.cdnUrl??null??y(this.scriptSrc)??T).replace(/\/+$/,"")}${R}`}mount(){if(this.idleHandle?.(),this.idleHandle=null,this.iframe||!this.options)return;let e=this.env.document,t=e.createElement("iframe");t.id=this.frameId,t.title=this.title,t.src=this.frameUrl,t.referrerPolicy="origin",t.setAttribute("allow","clipboard-write"),t.setAttribute("data-ahoy","panel"),a(t,{position:"fixed",border:"0",margin:"0",padding:"0","z-index":String(d+1),background:"transparent","color-scheme":"normal","max-width":"100vw",display:"none"});let i=Date.now(),n=setInterval(()=>{if(this.state.ready||this.stopped){clearInterval(n);return}if(Date.now()-i>$){clearInterval(n),this.warnOnce("not_ready",`[Ahoy] The chat panel (${this.frameUrl}) did not start. A Content-Security-Policy without frame-src ${this.frameOrigin}, an ad blocker or a network error can cause this.`);return}this.sendConfigure()},V);t.addEventListener("load",()=>{!this.state.ready&&!this.stopped&&this.sendConfigure()}),(e.body??e.documentElement).appendChild(t),this.iframe=t,this.cleanups.push(()=>{t.remove(),clearInterval(n)})}sendConfigure(){let e=this.options;if(!e)return;let t=this.env.document;this.postNow({type:"configure",payload:{appId:e.appId,environment:e.environment==="development"?"development":"production",hostOrigin:this.env.window.location.origin,language:e.language,pageLanguage:t.documentElement.lang||void 0,appearance:this.currentAppearance,apiUrl:e.apiUrl,position:e.position==="left"||e.position==="right"?e.position:void 0,protocol:1}})}onMessage(e){if(!this.iframe||e.source!==this.iframe.contentWindow||e.origin!==this.frameOrigin)return;let t=A(e.data,g);if(t)switch(t.type){case"ready":return this.onReady(t.payload);case"unread":return this.setState({unread:Math.max(0,Number(t.payload?.count)||0)});case"resize":return this.mode=t.payload?.mode==="full"?"full":"panel",typeof t.payload?.height=="number"&&t.payload.height>0&&(this.panelHeight=Math.min(O,t.payload.height)),this.layout();case"event":return this.dispatch(t.payload);case"opened":return this.onOpened();case"closed":return this.onClosed();case"stopped":return this.onStopped()}}onStopped(){this.stopped=!0,this.queue=[],this.wantOpen=!1,this.launcher?.remove(),this.launcher=null,this.setState({ready:!1,open:!1,unread:0}),this.layout()}onReady(e){typeof e?.title=="string"&&e.title&&(this.title=e.title),(e?.position==="left"||e?.position==="right")&&(this.position=e.position),typeof e?.bottomOffset=="number"&&Number.isFinite(e.bottomOffset)&&(this.bottomOffset=Math.min(N,Math.max(0,Math.round(e.bottomOffset))));let t=typeof e?.accent=="string"?e.accent:"#0A6FD8";if(this.iframe&&(this.iframe.title=this.title),this.options?.launcher!==!1){if(this.launcher)this.launcher.setAccent(t),this.launcher.setPosition(this.position,this.bottomOffset),this.launcher.setLabel(this.title);else{this.launcher=new u(this.env.document,{position:this.position,bottomOffset:this.bottomOffset,accent:t,label:this.title,controls:this.frameId,onClick:()=>this.open()}),(this.env.document.body??this.env.document.documentElement).appendChild(this.launcher.host);let r=this.launcher;this.cleanups.push(()=>r.remove())}this.launcher.setUnread(this.state.unread)}let i=!this.state.ready;if(this.setState({ready:!0}),this.applyLauncherVisibility(),this.layout(),!i)return;let n=this.queue;this.queue=[];for(let r of n)this.post(r);this.cleanups.push(x(this.env.window,r=>this.post({type:"page",payload:{path:r}}))),this.wantOpen&&this.post({type:"open"})}onOpened(){let e=this.env.document.activeElement;this.returnFocus=e instanceof HTMLElement&&e!==this.iframe?e:null,this.wantOpen=!0,this.setState({open:!0}),this.launcher?.setExpanded(!0),this.applyLauncherVisibility(),this.layout(),this.iframe?.focus()}onClosed(){this.wantOpen=!1,this.mode="panel",this.setState({open:!1}),this.launcher?.setExpanded(!1),this.applyLauncherVisibility(),this.layout();let e=this.launcher?null:this.returnFocus;this.launcher?this.launcher.focus():e?.isConnected&&e.focus(),this.returnFocus=null}applyLauncherVisibility(){if(!this.launcher)return;let e=this.options?.launcher!==!1&&this.state.ready&&!this.state.open;this.launcher.setVisible(e)}layout(){let e=this.iframe;if(!e)return;if(!this.state.open){a(e,{display:"none"});return}let t=this.env.window,i=this.mode==="full"||t.innerWidth<D;if(e.setAttribute("data-mode",i?"full":"panel"),i){a(e,{display:"block",top:"0",left:"0",right:"auto",bottom:"auto",width:"100%",height:"100%","border-radius":"0","box-shadow":"none"});return}let n=Math.max(320,Math.min(this.panelHeight,t.innerHeight-this.bottomOffset-c));a(e,{display:"block",top:"auto",bottom:`${this.bottomOffset}px`,left:this.position==="left"?`${c}px`:"auto",right:this.position==="left"?"auto":`${c}px`,width:`${U}px`,height:`${n}px`,"border-radius":"16px","box-shadow":"0 12px 48px rgba(15, 23, 42, 0.28)"})}send(e){this.stopped||(this.state.ready?this.post(e):this.queue.push(e))}post(e){this.postNow(e)}postNow(e){let t=this.iframe?.contentWindow;if(!(!t||!this.frameOrigin))try{t.postMessage(b(e),this.frameOrigin)}catch{}}dispatch(e){if(!(!e||typeof e.type!="string"))for(let t of[...this.listeners])try{t(e)}catch(i){console.warn("[Ahoy] onEvent listener threw",i)}}setState(e){let t={...this.state,...e};if(!(t.ready===this.state.ready&&t.open===this.state.open&&t.unread===this.state.unread)){this.state=t,this.launcher?.setUnread(t.unread);for(let i of[...this.subscribers])i()}}warnOnce(e,t){this.options?.environment!=="development"||this.warned.has(e)||(this.warned.add(e),console.warn(t))}teardown(e=!1){this.idleHandle?.(),this.idleHandle=null;for(let t of this.cleanups.splice(0))t();this.iframe=null,this.launcher=null,this.stopped=!1,this.mode="panel",e||(this.queue=[]),this.setState({ready:!1,open:!1,unread:0})}};function q(o,e){let t=o.requestIdleCallback;if(typeof t=="function"){let n=t.call(o,e,{timeout:3e3});return()=>o.cancelIdleCallback?.(n)}let i=setTimeout(e,200);return()=>clearTimeout(i)}function z(o){return o instanceof h||!!o&&typeof o.subscribe=="function"}function P(o=window,e=null,t=null){let i=o,n=i.Ahoy;if(z(n))return n;let r=new h({window:o,document:o.document},e);i.Ahoy=r,t&&r.configure(t);let l=n;return B(r,l&&Array.isArray(l.q)?l.q:[]),r}function B(o,e){for(let t of e){if(!Array.isArray(t)||typeof t[0]!="string")continue;let i=o[t[0]];if(typeof i!="function")continue;let n=t[1]&&typeof t[1]=="object"?Array.from(t[1]):[];try{i.apply(o,n)}catch(r){console.warn(`[Ahoy] Ahoy.${t[0]} from the snippet failed`,r)}}}function L(o){if(!o)return null;let e=f=>o.getAttribute(`data-${f}`)??void 0,t=e("app-id");if(!t)return null;let i={appId:t},n=e("environment");(n==="development"||n==="production")&&(i.environment=n);let r=e("api-url");r&&(i.apiUrl=r);let l=e("language");l&&(i.language=l),e("launcher")==="false"&&(i.launcher=!1);let p=e("position");return(p==="left"||p==="right")&&(i.position=p),i}var S=document.currentScript instanceof HTMLScriptElement?document.currentScript:document.querySelector('script[data-app-id][src*="ahoy.js"]');P(window,S?.src??null,L(S));})();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ahoy-ai/web for bundlers: the loader behind `window.Ahoy` (launcher, iframe panel from Ahoy's
|
|
3
|
+
* CDN, postMessage). It imports nothing at runtime and touches `window` only when called, so it is
|
|
4
|
+
* safe to import during server rendering. React apps use `@ahoy-ai/react`.
|
|
5
|
+
*/
|
|
6
|
+
export { AhoyLoader, DEFAULT_CDN_URL, FRAME_PATH, FULL_SCREEN_BELOW, createAhoy, type AhoyWeb, type AhoyWebOptions, type AhoyWebState, } from './loader/ahoy.js';
|
|
7
|
+
export { getAhoy, optionsFromScript, replay } from './loader/global.js';
|
|
8
|
+
export { CHANNEL, PROTOCOL, type ConfigurePayload, type HostMessage, type LauncherPosition, type PanelMessage, type ReadyPayload, } from './protocol.js';
|
|
9
|
+
export { WEB_VERSION } from './version.js';
|
|
10
|
+
export type { AhoyAppearance, AhoyEnvironment, AhoyEvent, AhoyEventListener, AhoyEventType, AhoyIdentity, AhoyMetadata, AhoyPushResult, AhoyVerifiedIdentity, } from '@ahoy-ai/core';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,UAAU,EACV,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EACL,OAAO,EACP,QAAQ,EACR,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,YAAY,EACV,cAAc,EACd,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,oBAAoB,GACrB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ahoy-ai/web for bundlers: the loader behind `window.Ahoy` (launcher, iframe panel from Ahoy's
|
|
3
|
+
* CDN, postMessage). It imports nothing at runtime and touches `window` only when called, so it is
|
|
4
|
+
* safe to import during server rendering. React apps use `@ahoy-ai/react`.
|
|
5
|
+
*/
|
|
6
|
+
export { AhoyLoader, DEFAULT_CDN_URL, FRAME_PATH, FULL_SCREEN_BELOW, createAhoy, } from './loader/ahoy.js';
|
|
7
|
+
export { getAhoy, optionsFromScript, replay } from './loader/global.js';
|
|
8
|
+
export { CHANNEL, PROTOCOL, } from './protocol.js';
|
|
9
|
+
export { WEB_VERSION } from './version.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,UAAU,EACV,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,UAAU,GAIX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EACL,OAAO,EACP,QAAQ,GAMT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { AhoyAppearance, AhoyEnvironment, AhoyEventListener, AhoyEventProps, AhoyIdentity, AhoyMetadata, AhoyOfferHandler, AhoyPaywall, AhoyPushResult, AhoyTrackOptions, AhoyVerifiedIdentity } from '@ahoy-ai/core';
|
|
2
|
+
import { type LauncherPosition } from '../protocol.js';
|
|
3
|
+
/**
|
|
4
|
+
* Where the panel is served when nothing else says (the npm route, `@ahoy-ai/react`): production.
|
|
5
|
+
* Local and dev setups pass `cdnUrl` (CONTRACT C11).
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_CDN_URL = "https://cdn.ahoysupport.com";
|
|
8
|
+
/** The panel of this loader's major (ADR 0017: loader and panel always match on `/v1/`). */
|
|
9
|
+
export declare const FRAME_PATH = "/web/v1/frame.html";
|
|
10
|
+
export declare const FULL_SCREEN_BELOW = 640;
|
|
11
|
+
export interface AhoyWebOptions {
|
|
12
|
+
/** Public App ID from the dashboard, e.g. `app_XXXX`. */
|
|
13
|
+
appId: string;
|
|
14
|
+
/** `development` turns on the setup check and development warnings. Default `production`. */
|
|
15
|
+
environment?: AhoyEnvironment;
|
|
16
|
+
/**
|
|
17
|
+
* A local or self-hosted Ahoy API. Used only with `environment: 'development'`; production
|
|
18
|
+
* always uses the hosted API.
|
|
19
|
+
*/
|
|
20
|
+
apiUrl?: string;
|
|
21
|
+
/** Force an interface language; defaults to the page's `lang`, then the browser's languages. */
|
|
22
|
+
language?: string;
|
|
23
|
+
/** `false` hides the built-in button, for sites that call `Ahoy.open()` from their own. */
|
|
24
|
+
launcher?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The launcher's side. Set it only to override the side published in the dashboard design
|
|
27
|
+
* (Chat design → Launcher); default: the published side, else `right`.
|
|
28
|
+
*/
|
|
29
|
+
position?: LauncherPosition;
|
|
30
|
+
appearance?: AhoyAppearance;
|
|
31
|
+
/**
|
|
32
|
+
* Where the panel is served (`<cdnUrl>/web/v1/frame.html`). Default: the CDN `ahoy.js` came from,
|
|
33
|
+
* or `https://cdn.ahoysupport.com` for bundled loaders. Set it for a local (`http://localhost:4400`)
|
|
34
|
+
* or dev CDN.
|
|
35
|
+
*/
|
|
36
|
+
cdnUrl?: string;
|
|
37
|
+
}
|
|
38
|
+
/** What framework wrappers (`@ahoy-ai/react`) subscribe to. */
|
|
39
|
+
export interface AhoyWebState {
|
|
40
|
+
/** The panel answered `ready`. */
|
|
41
|
+
ready: boolean;
|
|
42
|
+
/** The chat panel is open. */
|
|
43
|
+
open: boolean;
|
|
44
|
+
/** Unread support messages, for a badge on your own button. */
|
|
45
|
+
unread: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* `window.Ahoy`: the same names as the mobile SDK where they apply (ADR 0017). Calls made before
|
|
49
|
+
* the panel is ready are queued; calls that return a promise resolve once queued (a refused
|
|
50
|
+
* identity token arrives as an `identity_rejected` event).
|
|
51
|
+
*/
|
|
52
|
+
export interface AhoyWeb {
|
|
53
|
+
configure(options: AhoyWebOptions): void;
|
|
54
|
+
identify(identity: AhoyIdentity | AhoyVerifiedIdentity): Promise<void>;
|
|
55
|
+
setMetadata(metadata: AhoyMetadata, options?: {
|
|
56
|
+
merge?: boolean;
|
|
57
|
+
}): Promise<void>;
|
|
58
|
+
track(name: string, propsOrOptions?: AhoyEventProps | AhoyTrackOptions, options?: AhoyTrackOptions): void;
|
|
59
|
+
open(): void;
|
|
60
|
+
close(): void;
|
|
61
|
+
onEvent(listener: AhoyEventListener): () => void;
|
|
62
|
+
logout(): Promise<void>;
|
|
63
|
+
deleteData(): Promise<void>;
|
|
64
|
+
appearance: AhoyAppearance;
|
|
65
|
+
/** Development only: sends the setup check again; the result is logged in the console. */
|
|
66
|
+
runSetupCheck(): Promise<void>;
|
|
67
|
+
/** Not on web (no end-user push yet): resolves `{ registered: false, reason: 'unsupported' }`. */
|
|
68
|
+
registerPush(): Promise<AhoyPushResult>;
|
|
69
|
+
/** Not on web: always null. */
|
|
70
|
+
notificationBehavior(notification?: unknown): null;
|
|
71
|
+
/** Not on web (no paywalls on a web page): the handler is never called. */
|
|
72
|
+
onOffer(handler: AhoyOfferHandler | null): () => void;
|
|
73
|
+
/** Not on web: ignored. */
|
|
74
|
+
setPaywalls(paywalls: readonly AhoyPaywall[]): void;
|
|
75
|
+
getState(): AhoyWebState;
|
|
76
|
+
subscribe(listener: () => void): () => void;
|
|
77
|
+
/** Removes the launcher and the panel (tests, or a site that unmounts the chat). */
|
|
78
|
+
destroy(): void;
|
|
79
|
+
}
|
|
80
|
+
interface Environment {
|
|
81
|
+
window: Window;
|
|
82
|
+
document: Document;
|
|
83
|
+
}
|
|
84
|
+
/** The loader behind `window.Ahoy`: launcher, iframe, postMessage and the queue. */
|
|
85
|
+
export declare class AhoyLoader implements AhoyWeb {
|
|
86
|
+
private readonly env;
|
|
87
|
+
/** The script tag's `src`: the panel comes from the same CDN. */
|
|
88
|
+
private readonly scriptSrc;
|
|
89
|
+
private options;
|
|
90
|
+
private frameUrl;
|
|
91
|
+
private frameOrigin;
|
|
92
|
+
private iframe;
|
|
93
|
+
private launcher;
|
|
94
|
+
private state;
|
|
95
|
+
private readonly listeners;
|
|
96
|
+
private readonly subscribers;
|
|
97
|
+
private queue;
|
|
98
|
+
private wantOpen;
|
|
99
|
+
private mode;
|
|
100
|
+
private panelHeight;
|
|
101
|
+
/** The launcher's place, from the panel's `ready` (site option, else published design). */
|
|
102
|
+
private position;
|
|
103
|
+
private bottomOffset;
|
|
104
|
+
private title;
|
|
105
|
+
private currentAppearance;
|
|
106
|
+
private cleanups;
|
|
107
|
+
private idleHandle;
|
|
108
|
+
private returnFocus;
|
|
109
|
+
/** The panel stopped for good (`stopped`): no launcher, nothing sent, until a reload. */
|
|
110
|
+
private stopped;
|
|
111
|
+
private readonly warned;
|
|
112
|
+
private readonly frameId;
|
|
113
|
+
constructor(env?: Environment,
|
|
114
|
+
/** The script tag's `src`: the panel comes from the same CDN. */
|
|
115
|
+
scriptSrc?: string | null);
|
|
116
|
+
configure(options: AhoyWebOptions): void;
|
|
117
|
+
identify(identity: AhoyIdentity | AhoyVerifiedIdentity): Promise<void>;
|
|
118
|
+
setMetadata(metadata: AhoyMetadata, options?: {
|
|
119
|
+
merge?: boolean;
|
|
120
|
+
}): Promise<void>;
|
|
121
|
+
track(name: string, propsOrOptions?: AhoyEventProps | AhoyTrackOptions, options?: AhoyTrackOptions): void;
|
|
122
|
+
open(): void;
|
|
123
|
+
close(): void;
|
|
124
|
+
onEvent(listener: AhoyEventListener): () => void;
|
|
125
|
+
logout(): Promise<void>;
|
|
126
|
+
deleteData(): Promise<void>;
|
|
127
|
+
get appearance(): AhoyAppearance;
|
|
128
|
+
set appearance(value: AhoyAppearance);
|
|
129
|
+
runSetupCheck(): Promise<void>;
|
|
130
|
+
registerPush(): Promise<AhoyPushResult>;
|
|
131
|
+
notificationBehavior(): null;
|
|
132
|
+
onOffer(handler: AhoyOfferHandler | null): () => void;
|
|
133
|
+
setPaywalls(paywalls: readonly AhoyPaywall[]): void;
|
|
134
|
+
getState(): AhoyWebState;
|
|
135
|
+
subscribe(listener: () => void): () => void;
|
|
136
|
+
destroy(): void;
|
|
137
|
+
private resolveFrameUrl;
|
|
138
|
+
private mount;
|
|
139
|
+
private sendConfigure;
|
|
140
|
+
private onMessage;
|
|
141
|
+
/**
|
|
142
|
+
* The panel refused to run (its console line says why): the launcher goes, the frame stays
|
|
143
|
+
* hidden and loaded so `open()` doesn't start it again, and later calls are dropped.
|
|
144
|
+
*/
|
|
145
|
+
private onStopped;
|
|
146
|
+
private onReady;
|
|
147
|
+
private onOpened;
|
|
148
|
+
private onClosed;
|
|
149
|
+
private applyLauncherVisibility;
|
|
150
|
+
/**
|
|
151
|
+
* Sizes the iframe: the panel (400 × 700, 20 px from the side, as high above the bottom as the
|
|
152
|
+
* launcher) or the whole viewport.
|
|
153
|
+
*/
|
|
154
|
+
private layout;
|
|
155
|
+
private send;
|
|
156
|
+
private post;
|
|
157
|
+
private postNow;
|
|
158
|
+
private dispatch;
|
|
159
|
+
private setState;
|
|
160
|
+
private warnOnce;
|
|
161
|
+
private teardown;
|
|
162
|
+
}
|
|
163
|
+
/** A new loader for this page (the npm route; the script tag uses `install`). */
|
|
164
|
+
export declare function createAhoy(): AhoyWeb;
|
|
165
|
+
export {};
|
|
166
|
+
//# sourceMappingURL=ahoy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ahoy.d.ts","sourceRoot":"","sources":["../../../src/loader/ahoy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAEf,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAOL,KAAK,gBAAgB,EAItB,MAAM,gBAAgB,CAAC;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