@axceera/playstep 0.5.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,7 +23,8 @@ Mark the elements your guides point at with `data-guide`:
23
23
 
24
24
  Other calls: `playstep.start(guideId)`, `playstep.complete(stepId)`, `playstep.page(path)`,
25
25
  `playstep.openLauncher({ anchor })` (the list of guides people can replay, next to your own menu button), `playstep.resetProgress(guideId?)`
26
- (let guides start again, keeping the user) and `playstep.reset()` (on sign-out).
26
+ (let guides start again, keeping the user), `playstep.reset()` (on sign-out) and `playstep.pause()` / `playstep.resume()`
27
+ (no guides for now, for a user who should not see them, keeping their progress).
27
28
 
28
29
  ## Script tag
29
30
 
@@ -39,7 +40,10 @@ carries the hashes of the chunks it loads, so pinning it covers everything that
39
40
  data-app-key="ps_pub_xxx"></script>
40
41
  ```
41
42
 
42
- - About 3 KB gzipped until a guide shows; the guide UI (under 20 KB) and event delivery (about 2 KB) load only then.
43
+ - About 3 KB gzipped until a guide shows; the guide card (about 8.5 KB) and event delivery (about 2 KB) load only
44
+ then, the guide list and the finish screen only when they show. No dependencies.
45
+ - Feather-light by design: PlayStep's API sends each user a config already made for their language and platform, so
46
+ the SDK only draws, and new features arrive as data rather than code.
43
47
  - Never loses usage: batches that cannot be sent are retried with backoff and kept in local storage until they go
44
48
  (on a later page if need be), every event carries an id so a retried one counts once, and `identify` ids are hashed
45
49
  synchronously, so a page that closes right away still sends under the right person.
@@ -47,6 +51,10 @@ carries the hashes of the chunks it loads, so pinning it covers everything that
47
51
  - Looks like your app: guides wear the brand kit set in the dashboard (colours, font, corners), and follow your page
48
52
  into dark mode and back (a `dark` class, `data-theme` or `color-scheme` on `<html>` or `<body>`, else the device).
49
53
  `init({ colorMode: 'light' | 'dark' })` overrides that.
54
+ - Speaks your users' language: each guide shows in the browser's language when it has it (else its default), with
55
+ that language's clips or images and the guide card's own words translated. `init({ locale: 'fr' })` (or
56
+ `data-locale="fr"` on the script tag) picks one, and `playstep.setLocale('de')` switches a running app without a
57
+ reload. Arabic, Hebrew, Persian and Urdu read right to left.
50
58
  - Fails silent: if PlayStep cannot load, your app behaves as if it were not installed.
51
59
  - No `eval`, no inline scripts: works under a strict Content Security Policy.
52
60
 
@@ -1,4 +1,4 @@
1
- const e=/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g,t=/\+?\(?\d[\d\s().-]{5,}\d/g,n=/\d{6,}/g,r=/\b(?=[\w-]*\d)[\w-]{24,}\b/g;function i(i){return[e,r,n].some(e=>new RegExp(e.source).test(i))||[...i.matchAll(t)].some(e=>e[0].replace(/\D/g,``).length>=7)}function a(i){if(!i)return``;let a=i.replace(/\s+/g,` `).trim().replace(e,`[email]`).replace(r,`[id]`).replace(t,e=>e.replace(/\D/g,``).length>=7?`[number]`:e).replace(n,`[number]`);return a.length>80?`${a.slice(0,79)}…`:a}function o(e=80){let t=/^(:|radix-|headlessui-|react-|ember\d|mui-|v-|css-|sc-|jsx-)|\d{3,}|[a-f0-9]{8,}|__/i,n=/active|selected|current|open|hover|focus|disabled|hidden|show|visible|checked|loading/i,r=e=>(e??``).replace(/\s+/g,` `).trim().slice(0,80),i=e=>`"${e.replace(/["\\]/g,`\\$&`)}"`,a=e=>CSS.escape(e),o=e=>{try{return document.querySelectorAll(e).length===1}catch{return!1}},s=e=>{let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return!1;let n=getComputedStyle(e);return n.visibility!==`hidden`&&n.display!==`none`&&Number(n.opacity||1)>.05},c=e=>{let t=e.getAttribute(`role`),n=e.tagName,r=(e.getAttribute(`type`)??``).toLowerCase();return t===`tab`||t===`menuitem`||t===`link`||t===`button`?t:t===`checkbox`||t===`switch`||n===`INPUT`&&(r===`checkbox`||r===`radio`)?`checkbox`:n===`A`?`link`:n===`BUTTON`||n===`SUMMARY`||n===`INPUT`&&/^(submit|button|reset|image)$/.test(r)?`button`:n===`SELECT`?`select`:n===`INPUT`||n===`TEXTAREA`?`input`:`other`},l=e=>{let r=e.tagName.toLowerCase(),s=[];e.id&&!t.test(e.id)&&s.push(`#${a(e.id)}`);for(let t of[`data-testid`,`data-test`,`data-cy`,`data-qa`]){let n=e.getAttribute(t);n&&s.push(`[${t}=${i(n)}]`)}for(let t of[`aria-label`,`name`,`title`,`placeholder`]){let n=e.getAttribute(t);n&&n.length<=80&&s.push(`${r}[${t}=${i(n)}]`)}let c=e.getAttribute(`href`);r===`a`&&c&&!/^javascript:/i.test(c)&&c.length<=200&&s.push(`a[href=${i(c)}]`);let l=[...e.classList].filter(e=>/^[a-z][\w-]{1,40}$/i.test(e)&&!t.test(e)&&!n.test(e));l.length&&s.push(`${r}.${l.slice(0,3).map(a).join(`.`)}`);for(let e of s)if(o(e))return e;let u=[],d=e;for(;d&&u.length<7;){if(d===document.body){u.unshift(`body`);break}if(d!==e&&d.id&&!t.test(d.id)){u.unshift(`#${a(d.id)}`);break}let n=d.tagName.toLowerCase(),r=d.parentElement?[...d.parentElement.children].filter(e=>e.tagName===d.tagName):[];u.unshift(r.length>1?`${n}:nth-of-type(${r.indexOf(d)+1})`:n),d=d.parentElement}let f=u.join(`>`);return o(f)?f:void 0},u=e=>{let t=e.getAttribute(`aria-label`)||e.getAttribute(`title`);if(t)return t;let n=e.getAttribute(`aria-labelledby`);if(n)return n.split(/\s+/).map(e=>document.getElementById(e)?.textContent??``).join(` `);let r=e.labels;return r?.length?r[0].innerText:``},d=[...document.querySelectorAll(`a[href],button,input:not([type=hidden]),select,textarea,summary,[role=button],[role=link],[role=tab],[role=menuitem],[role=checkbox],[role=switch],[data-guide]`)].filter(e=>!e.closest(`[data-private],[aria-hidden=true],[inert]`)&&s(e)&&!e.parentElement?.closest(`a[href],button,[role=button],[role=link]`)).map((e,t)=>{let n=e.getBoundingClientRect(),r=n.bottom>0&&n.top<innerHeight;return{e,i:t,score:(e.hasAttribute(`data-guide`)?0:2)+ +!r}}).sort((e,t)=>e.score-t.score||e.i-t.i).slice(0,e).sort((e,t)=>e.i-t.i),f=[];for(let{e}of d){let t=c(e),n=e.getAttribute(`data-guide`),i=t===`input`||t===`select`?``:r(e.innerText||e.textContent),a=r(u(e))||(e.tagName===`INPUT`&&t===`button`?r(e.value):``),o=r(e.getAttribute(`placeholder`)),s=e.getAttribute(`href`),d;if(e.tagName===`A`&&s)try{let e=new URL(s,location.href);e.origin===location.origin&&(d=e.pathname)}catch{}let p=n?void 0:l(e);if(!n&&!p)continue;let m=e.getBoundingClientRect();f.push({ref:`e${f.length+1}`,role:t,...i?{text:i}:{},...a&&a!==i?{label:a}:{},...o?{placeholder:o}:{},...d?{href:d}:{},...n?{anchor:n.slice(0,64)}:{css:p.slice(0,300)},clickable:t!==`input`&&t!==`select`&&t!==`other`,rect:[m.left+scrollX,m.top+scrollY,m.width,m.height].map(Math.round)})}let p=[...document.querySelectorAll(`h1,h2,h3,[role=heading]`)].filter(e=>!e.closest(`[data-private]`)&&s(e)).map(e=>r(e.innerText)).filter(Boolean).slice(0,10);return{platform:`web`,path:location.pathname||`/`,...document.title?{title:r(document.title)}:{},headings:p,viewport:[innerWidth,innerHeight],elements:f}}function s(){let e=document.createElement(`canvas`);e.width=e.height=1;let t=e.getContext(`2d`,{willReadFrequently:!0}),n=e=>{if(!t||!e||e===`transparent`||e===`none`||(t.fillStyle=`#010203`,t.fillStyle=e,t.fillStyle===`#010203`&&!/^#010203$/i.test(e)))return null;t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let n=t.getImageData(0,0,1,1).data;return[n[0],n[1],n[2],n[3]/255]},r=e=>`#${e.slice(0,3).map(e=>e.toString(16).padStart(2,`0`)).join(``)}`,i=e=>(Math.max(e[0],e[1],e[2])-Math.min(e[0],e[1],e[2]))/255,a=e=>{let[t,n,r]=e.slice(0,3).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r},o=(e,t)=>{let r=n(e),i=n(t);return Math.hypot(r[0]-i[0],r[1]-i[1],r[2]-i[2])<30},s=e=>{let t=e.getBoundingClientRect();if(t.width<4||t.height<4||t.bottom<0||t.top>innerHeight*3)return null;let n=getComputedStyle(e);return n.visibility===`hidden`||n.display===`none`||Number(n.opacity||1)<.3?null:{r:t,s:n}},c=e=>{let t=n(e);return t&&t[3]>=.9?t:null},l=e=>e.length?e.sort((e,t)=>e-t)[Math.floor(e.length/2)]:void 0,u=null;for(let e of[document.querySelector(`#root,#app,#__next,[data-reactroot],main`),document.body,document.documentElement])if(u=e?c(getComputedStyle(e).backgroundColor):null,u)break;for(let e=document.elementFromPoint(innerWidth/2,innerHeight/2);!u&&e;e=e.parentElement)u=c(getComputedStyle(e).backgroundColor);u??(u=getComputedStyle(document.documentElement).colorScheme.trim()===`dark`?[18,18,18,1]:[255,255,255,1]);let d=a(u)<.2,f=n(getComputedStyle(document.querySelector(`main`)??document.body).color),p=[],m=(e,t,n)=>{let r=p.find(t=>t.from===n&&o(t.color,e));r?r.weight+=t:p.push({color:e,weight:t,from:n})},h=[],g=document.querySelectorAll(`button,[role=button],input[type=submit],input[type=button],a,[class*=btn],[class*=Btn],[class*=button],[class*=Button]`);for(let e of[...g].slice(0,400)){let t=s(e);if(!t)continue;let o=c(t.s.backgroundColor);if(o&&i(o)>.18&&a(o)>.02&&a(o)<.9){m(r(o),Math.min(t.r.width*t.r.height,3e4),`button`);let e=Number.parseFloat(t.s.borderTopLeftRadius)||0;h.push(e>=t.r.height/2-1?999:e)}else if(e.tagName===`A`){let e=n(t.s.color);e&&i(e)>.25&&m(r(e),400,`link`)}}let _=getComputedStyle(document.documentElement),v=/* @__PURE__ */ new Set,y=0;for(let e of[...document.styleSheets]){let t;try{t=e.cssRules}catch{continue}for(let e of[...t]){if(++y>3e3)break;let t=e.style;if(t&&/:root|html|body|\.light|\[data-theme/.test(e.selectorText??``))for(let e of[...t]){if(!e.startsWith(`--`)||v.has(e)||!/primary|accent|brand/i.test(e)||/foreground|fg|text|contrast|muted|soft|subtle|hover|active|border|ring|shadow|50\b|100\b|900\b/i.test(e))continue;v.add(e);let t=_.getPropertyValue(e).trim(),a=n(t)??n(`hsl(${t})`)??n(`rgb(${t})`)??n(`oklch(${t})`);a&&a[3]>=.9&&i(a)>.18&&m(r(a),/^--(color-)?(primary|brand)$/i.test(e)?8e4:4e4,`variable`)}}}let b=n(document.querySelector(`meta[name=theme-color]`)?.getAttribute(`content`));b&&i(b)>.18&&m(r(b),2e4,`theme-color`);let x=[],S=[],C=document.querySelectorAll(`section,article,aside,dialog,[role=dialog],[class*=card],[class*=Card],[class*=panel],[class*=Panel],div`);for(let e of[...C].slice(0,800)){let t=s(e);if(!t||t.r.width*t.r.height<2e4||t.r.width>innerWidth*.95)continue;let n=c(t.s.backgroundColor);if(!n||i(n)>.2||o(r(n),r(u))||a(n)<.2!==d)continue;let l=t.s.boxShadow!==`none`||Number.parseFloat(t.s.borderTopWidth)>0,f=r(n),p=x.find(e=>o(e.color,f)),m=Math.min(t.r.width*t.r.height,2e5)*(l?2:1);p?p.weight+=m:x.push({color:f,weight:m}),l&&S.push(Number.parseFloat(t.s.borderTopLeftRadius)||0)}let w=getComputedStyle(document.body).fontFamily,T=document.querySelector(`h1,h2`),E=T?getComputedStyle(T).fontFamily:void 0;return{scheme:d?`dark`:`light`,background:r(u),...f?{text:r(f)}:{},accents:p.sort((e,t)=>t.weight-e.weight).slice(0,8),surfaces:x.sort((e,t)=>t.weight-e.weight).slice(0,4).map(e=>e.color),...w?{font:w.slice(0,300)}:{},...E&&E!==w?{displayFont:E.slice(0,300)}:{},...h.length?{radius:l(h)}:{},...S.length?{cardRadius:l(S)}:{}}}function c(){try{return s()}catch{return}}const l=`playstep_preview`,u=`playstep_capture_on`,d={get:e=>{try{return sessionStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{t===null?sessionStorage.removeItem(e):sessionStorage.setItem(e,t)}catch{}}};function f(e){let t=e=>e&&a(e)||void 0;return{...e,title:t(e.title),headings:(e.headings??[]).map(e=>a(e)).filter(Boolean),elements:e.elements.map(e=>({...e,text:t(e.text),label:t(e.label),placeholder:t(e.placeholder),href:e.href&&!i(e.href)?e.href:void 0,css:e.css&&!i(e.css)?e.css:void 0})).filter(e=>e.anchor||e.css)}}function p(e,t){let n=document.createElement(`playstep-capture`),r=n.attachShadow({mode:`open`});document.body.appendChild(n);let i=document.createElement(`div`);i.className=`p`,i.setAttribute(`role`,`region`),i.setAttribute(`aria-label`,`PlayStep capture`),r.innerHTML=`<style>:host{all:initial}
1
+ const e=/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g,t=/\+?\(?\d[\d\s().-]{5,}\d/g,n=/\d{6,}/g,r=/\b(?=[\w-]*\d)[\w-]{24,}\b/g;function i(i){return[e,r,n].some(e=>new RegExp(e.source).test(i))||[...i.matchAll(t)].some(e=>e[0].replace(/\D/g,``).length>=7)}function a(i){if(!i)return``;let a=i.replace(/\s+/g,` `).trim().replace(e,`[email]`).replace(r,`[id]`).replace(t,e=>e.replace(/\D/g,``).length>=7?`[number]`:e).replace(n,`[number]`);return a.length>80?`${a.slice(0,79)}…`:a}function o(e=80){let t=/^(:|radix-|headlessui-|react-|ember\d|mui-|v-|css-|sc-|jsx-)|\d{3,}|[a-f0-9]{8,}|__/i,n=/active|selected|current|open|hover|focus|disabled|hidden|show|visible|checked|loading/i,r=e=>(e??``).replace(/\s+/g,` `).trim().slice(0,80),i=e=>`"${e.replace(/["\\]/g,`\\$&`)}"`,a=e=>CSS.escape(e),o=e=>{try{return document.querySelectorAll(e).length===1}catch{return!1}},s=e=>{let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return!1;let n=getComputedStyle(e);return n.visibility!==`hidden`&&n.display!==`none`&&Number(n.opacity||1)>.05},c=e=>{let t=e.getAttribute(`role`),n=e.tagName,r=(e.getAttribute(`type`)??``).toLowerCase();return t===`tab`||t===`menuitem`||t===`link`||t===`button`?t:t===`checkbox`||t===`switch`||n===`INPUT`&&(r===`checkbox`||r===`radio`)?`checkbox`:n===`A`?`link`:n===`BUTTON`||n===`SUMMARY`||n===`INPUT`&&/^(submit|button|reset|image)$/.test(r)?`button`:n===`SELECT`?`select`:n===`INPUT`||n===`TEXTAREA`?`input`:`other`},l=e=>{let r=e.tagName.toLowerCase(),s=[];e.id&&!t.test(e.id)&&s.push(`#${a(e.id)}`);for(let t of[`data-testid`,`data-test`,`data-cy`,`data-qa`]){let n=e.getAttribute(t);n&&s.push(`[${t}=${i(n)}]`)}for(let t of[`aria-label`,`name`,`title`,`placeholder`]){let n=e.getAttribute(t);n&&n.length<=80&&s.push(`${r}[${t}=${i(n)}]`)}let c=e.getAttribute(`href`);r===`a`&&c&&!/^javascript:/i.test(c)&&c.length<=200&&s.push(`a[href=${i(c)}]`);let l=[...e.classList].filter(e=>/^[a-z][\w-]{1,40}$/i.test(e)&&!t.test(e)&&!n.test(e));l.length&&s.push(`${r}.${l.slice(0,3).map(a).join(`.`)}`);for(let e of s)if(o(e))return e;let u=[],d=e;for(;d&&u.length<7;){if(d===document.body){u.unshift(`body`);break}if(d!==e&&d.id&&!t.test(d.id)){u.unshift(`#${a(d.id)}`);break}let n=d.tagName.toLowerCase(),r=d.parentElement?[...d.parentElement.children].filter(e=>e.tagName===d.tagName):[];u.unshift(r.length>1?`${n}:nth-of-type(${r.indexOf(d)+1})`:n),d=d.parentElement}let f=u.join(`>`);return o(f)?f:void 0},u=e=>{let t=e.getAttribute(`aria-label`)||e.getAttribute(`title`);if(t)return t;let n=e.getAttribute(`aria-labelledby`);if(n)return n.split(/\s+/).map(e=>document.getElementById(e)?.textContent??``).join(` `);let r=e.labels;return r?.length?r[0].innerText:``},d=[...document.querySelectorAll(`a[href],button,input:not([type=hidden]),select,textarea,summary,[role=button],[role=link],[role=tab],[role=menuitem],[role=checkbox],[role=switch],[data-guide]`)].filter(e=>!e.closest(`[data-private],[aria-hidden=true],[inert]`)&&s(e)&&!e.parentElement?.closest(`a[href],button,[role=button],[role=link]`)).map((e,t)=>{let n=e.getBoundingClientRect(),r=n.bottom>0&&n.top<innerHeight;return{e,i:t,score:(e.hasAttribute(`data-guide`)?0:2)+ +!r}}).sort((e,t)=>e.score-t.score||e.i-t.i).slice(0,e).sort((e,t)=>e.i-t.i),f=[];for(let{e}of d){let t=c(e),n=e.getAttribute(`data-guide`),i=t===`input`||t===`select`?``:r(e.innerText||e.textContent),a=r(u(e))||(e.tagName===`INPUT`&&t===`button`?r(e.value):``),o=r(e.getAttribute(`placeholder`)),s=e.getAttribute(`href`),d;if(e.tagName===`A`&&s)try{let e=new URL(s,location.href);e.origin===location.origin&&(d=e.pathname)}catch{}let p=n?void 0:l(e);if(!n&&!p)continue;let m=e.getBoundingClientRect();f.push({ref:`e${f.length+1}`,role:t,...i?{text:i}:{},...a&&a!==i?{label:a}:{},...o?{placeholder:o}:{},...d?{href:d}:{},...n?{anchor:n.slice(0,64)}:{css:p.slice(0,300)},clickable:t!==`input`&&t!==`select`&&t!==`other`,rect:[m.left+scrollX,m.top+scrollY,m.width,m.height].map(Math.round)})}let p=[...document.querySelectorAll(`h1,h2,h3,[role=heading]`)].filter(e=>!e.closest(`[data-private]`)&&s(e)).map(e=>r(e.innerText)).filter(Boolean).slice(0,10);return{platform:`web`,path:location.pathname||`/`,...document.title?{title:r(document.title)}:{},headings:p,viewport:[innerWidth,innerHeight],elements:f}}function s(){let e=document.createElement(`canvas`);e.width=e.height=1;let t=e.getContext(`2d`,{willReadFrequently:!0}),n=e=>{if(!t||!e||e===`transparent`||e===`none`||(t.fillStyle=`#010203`,t.fillStyle=e,t.fillStyle===`#010203`&&!/^#010203$/i.test(e)))return null;t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let n=t.getImageData(0,0,1,1).data;return[n[0],n[1],n[2],n[3]/255]},r=e=>`#${e.slice(0,3).map(e=>e.toString(16).padStart(2,`0`)).join(``)}`,i=e=>(Math.max(e[0],e[1],e[2])-Math.min(e[0],e[1],e[2]))/255,a=e=>{let[t,n,r]=e.slice(0,3).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r},o=(e,t)=>{let r=n(e),i=n(t);return Math.hypot(r[0]-i[0],r[1]-i[1],r[2]-i[2])<30},s=e=>{let t=e.getBoundingClientRect();if(t.width<4||t.height<4||t.bottom<0||t.top>innerHeight*3)return null;let n=getComputedStyle(e);return n.visibility===`hidden`||n.display===`none`||Number(n.opacity||1)<.3?null:{r:t,s:n}},c=e=>{let t=n(e);return t&&t[3]>=.9?t:null},l=e=>e.length?e.sort((e,t)=>e-t)[Math.floor(e.length/2)]:void 0,u=null;for(let e of[document.querySelector(`#root,#app,#__next,[data-reactroot],main`),document.body,document.documentElement])if(u=e?c(getComputedStyle(e).backgroundColor):null,u)break;for(let e=document.elementFromPoint(innerWidth/2,innerHeight/2);!u&&e;e=e.parentElement)u=c(getComputedStyle(e).backgroundColor);u??(u=getComputedStyle(document.documentElement).colorScheme.trim()===`dark`?[18,18,18,1]:[255,255,255,1]);let d=a(u)<.2,f=n(getComputedStyle(document.querySelector(`main`)??document.body).color),p=[],m=(e,t,n)=>{let r=p.find(t=>t.from===n&&o(t.color,e));r?r.weight+=t:p.push({color:e,weight:t,from:n})},h=[],g=document.querySelectorAll(`button,[role=button],input[type=submit],input[type=button],a,[class*=btn],[class*=Btn],[class*=button],[class*=Button]`);for(let e of[...g].slice(0,400)){let t=s(e);if(!t)continue;let o=c(t.s.backgroundColor);if(o&&i(o)>.18&&a(o)>.02&&a(o)<.9){m(r(o),Math.min(t.r.width*t.r.height,3e4),`button`);let e=Number.parseFloat(t.s.borderTopLeftRadius)||0;h.push(e>=t.r.height/2-1?999:e)}else if(e.tagName===`A`){let e=n(t.s.color);e&&i(e)>.25&&m(r(e),400,`link`)}}let _=getComputedStyle(document.documentElement),v=/* @__PURE__ */ new Set,y=0;for(let e of[...document.styleSheets]){let t;try{t=e.cssRules}catch{continue}for(let e of[...t]){if(++y>3e3)break;let t=e.style;if(t&&/:root|html|body|\.light|\[data-theme/.test(e.selectorText??``))for(let e of[...t]){if(!e.startsWith(`--`)||v.has(e)||!/primary|accent|brand/i.test(e)||/foreground|fg|text|contrast|muted|soft|subtle|hover|active|border|ring|shadow|sidebar|chart|50\b|100\b|900\b/i.test(e))continue;v.add(e);let t=_.getPropertyValue(e).trim(),a=n(t)??n(`hsl(${t})`)??n(`rgb(${t})`)??n(`oklch(${t})`);a&&a[3]>=.9&&i(a)>.18&&m(r(a),/^--(color-)?(primary|brand)$/i.test(e)?8e4:4e4,`variable`)}}}let b=n(document.querySelector(`meta[name=theme-color]`)?.getAttribute(`content`));b&&i(b)>.18&&m(r(b),2e4,`theme-color`);let x=[],S=[],C=document.querySelectorAll(`section,article,aside,dialog,[role=dialog],[class*=card],[class*=Card],[class*=panel],[class*=Panel],div`);for(let e of[...C].slice(0,800)){let t=s(e);if(!t||t.r.width*t.r.height<2e4||t.r.width>innerWidth*.95)continue;let n=c(t.s.backgroundColor);if(!n||i(n)>.2||o(r(n),r(u))||a(n)<.2!==d)continue;let l=t.s.boxShadow!==`none`||Number.parseFloat(t.s.borderTopWidth)>0,f=r(n),p=x.find(e=>o(e.color,f)),m=Math.min(t.r.width*t.r.height,2e5)*(l?2:1);p?p.weight+=m:x.push({color:f,weight:m}),l&&S.push(Number.parseFloat(t.s.borderTopLeftRadius)||0)}let w=getComputedStyle(document.body).fontFamily,T=document.querySelector(`h1,h2`),E=T?getComputedStyle(T).fontFamily:void 0;return{scheme:d?`dark`:`light`,background:r(u),...f?{text:r(f)}:{},accents:p.sort((e,t)=>t.weight-e.weight).slice(0,8),surfaces:x.sort((e,t)=>t.weight-e.weight).slice(0,4).map(e=>e.color),...w?{font:w.slice(0,300)}:{},...E&&E!==w?{displayFont:E.slice(0,300)}:{},...h.length?{radius:l(h)}:{},...S.length?{cardRadius:l(S)}:{}}}function c(){try{return s()}catch{return}}const l=`playstep_preview`,u=`playstep_capture_on`,d={get:e=>{try{return sessionStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{t===null?sessionStorage.removeItem(e):sessionStorage.setItem(e,t)}catch{}}};function f(e){let t=e=>e&&a(e)||void 0;return{...e,title:t(e.title),headings:(e.headings??[]).map(e=>a(e)).filter(Boolean),elements:e.elements.map(e=>({...e,text:t(e.text),label:t(e.label),placeholder:t(e.placeholder),href:e.href&&!i(e.href)?e.href:void 0,css:e.css&&!i(e.css)?e.css:void 0})).filter(e=>e.anchor||e.css)}}function p(e,t){let n=document.createElement(`playstep-capture`),r=n.attachShadow({mode:`open`});document.body.appendChild(n);let i=document.createElement(`div`);i.className=`p`,i.setAttribute(`role`,`region`),i.setAttribute(`aria-label`,`PlayStep capture`),r.innerHTML=`<style>:host{all:initial}
2
2
  .p{position:fixed;left:24px;bottom:24px;z-index:2147483001;width:320px;max-width:calc(100vw - 48px);box-sizing:border-box;padding:16px;border-radius:16px;background:#fff;color:#151823;font:14px/20px system-ui,-apple-system,"Segoe UI",sans-serif;box-shadow:0 12px 32px #15182333,0 0 0 1px #15182314}
3
3
  h2{margin:0 0 4px;font-size:15px;line-height:22px;font-weight:700;display:flex;align-items:center;gap:8px}
4
4
  p{margin:0 0 12px;color:#4a5163}
@@ -1 +1 @@
1
- var __playstep_capture=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});let t=/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g,n=/\+?\(?\d[\d\s().-]{5,}\d/g,o=/\d{6,}/g,r=/\b(?=[\w-]*\d)[\w-]{24,}\b/g;function l(e){return[t,r,o].some(t=>new RegExp(t.source).test(e))||[...e.matchAll(n)].some(e=>e[0].replace(/\D/g,"").length>=7)}function a(e){if(!e)return"";let l=e.replace(/\s+/g," ").trim().replace(t,"[email]").replace(r,"[id]").replace(n,e=>e.replace(/\D/g,"").length>=7?"[number]":e).replace(o,"[number]");return l.length>80?`${l.slice(0,79)}…`:l}function i(e=80){let t=/^(:|radix-|headlessui-|react-|ember\d|mui-|v-|css-|sc-|jsx-)|\d{3,}|[a-f0-9]{8,}|__/i,n=/active|selected|current|open|hover|focus|disabled|hidden|show|visible|checked|loading/i,o=e=>(e??"").replace(/\s+/g," ").trim().slice(0,80),r=e=>`"${e.replace(/["\\]/g,"\\$&")}"`,l=e=>CSS.escape(e),a=e=>{try{return 1===document.querySelectorAll(e).length}catch{return!1}},i=e=>{let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return!1;let n=getComputedStyle(e);return"hidden"!==n.visibility&&"none"!==n.display&&Number(n.opacity||1)>.05},s=e=>{let t=e.getAttribute("role"),n=e.tagName,o=(e.getAttribute("type")??"").toLowerCase();return"tab"===t||"menuitem"===t||"link"===t||"button"===t?t:"checkbox"===t||"switch"===t||"INPUT"===n&&("checkbox"===o||"radio"===o)?"checkbox":"A"===n?"link":"BUTTON"===n||"SUMMARY"===n||"INPUT"===n&&/^(submit|button|reset|image)$/.test(o)?"button":"SELECT"===n?"select":"INPUT"===n||"TEXTAREA"===n?"input":"other"},c=e=>{let o=e.tagName.toLowerCase(),i=[];e.id&&!t.test(e.id)&&i.push(`#${l(e.id)}`);for(let t of["data-testid","data-test","data-cy","data-qa"]){let n=e.getAttribute(t);n&&i.push(`[${t}=${r(n)}]`)}for(let t of["aria-label","name","title","placeholder"]){let n=e.getAttribute(t);n&&n.length<=80&&i.push(`${o}[${t}=${r(n)}]`)}let s=e.getAttribute("href");"a"===o&&s&&!/^javascript:/i.test(s)&&s.length<=200&&i.push(`a[href=${r(s)}]`);let c=[...e.classList].filter(e=>/^[a-z][\w-]{1,40}$/i.test(e)&&!t.test(e)&&!n.test(e));c.length&&i.push(`${o}.${c.slice(0,3).map(l).join(".")}`);for(let e of i)if(a(e))return e;let u=[],d=e;for(;d&&u.length<7;){if(d===document.body){u.unshift("body");break}if(d!==e&&d.id&&!t.test(d.id)){u.unshift(`#${l(d.id)}`);break}let n=d.tagName.toLowerCase(),o=d.parentElement?[...d.parentElement.children].filter(e=>e.tagName===d.tagName):[];u.unshift(o.length>1?`${n}:nth-of-type(${o.indexOf(d)+1})`:n),d=d.parentElement}let p=u.join(">");return a(p)?p:void 0},u=e=>{let t=e.getAttribute("aria-label")||e.getAttribute("title");if(t)return t;let n=e.getAttribute("aria-labelledby");if(n)return n.split(/\s+/).map(e=>document.getElementById(e)?.textContent??"").join(" ");let o=e.labels;return o?.length?o[0].innerText:""},d=[...document.querySelectorAll("a[href],button,input:not([type=hidden]),select,textarea,summary,[role=button],[role=link],[role=tab],[role=menuitem],[role=checkbox],[role=switch],[data-guide]")].filter(e=>!e.closest("[data-private],[aria-hidden=true],[inert]")&&i(e)&&!e.parentElement?.closest("a[href],button,[role=button],[role=link]")).map((e,t)=>{let n=e.getBoundingClientRect(),o=n.bottom>0&&n.top<innerHeight;return{e:e,i:t,score:(e.hasAttribute("data-guide")?0:2)+ +!o}}).sort((e,t)=>e.score-t.score||e.i-t.i).slice(0,e).sort((e,t)=>e.i-t.i),p=[];for(let{e:e}of d){let t,n=s(e),r=e.getAttribute("data-guide"),l="input"===n||"select"===n?"":o(e.innerText||e.textContent),a=o(u(e))||("INPUT"===e.tagName&&"button"===n?o(e.value):""),i=o(e.getAttribute("placeholder")),d=e.getAttribute("href");if("A"===e.tagName&&d)try{let e=new URL(d,location.href);e.origin===location.origin&&(t=e.pathname)}catch{}let h=r?void 0:c(e);if(!r&&!h)continue;let m=e.getBoundingClientRect();p.push({ref:`e${p.length+1}`,role:n,...l?{text:l}:{},...a&&a!==l?{label:a}:{},...i?{placeholder:i}:{},...t?{href:t}:{},...r?{anchor:r.slice(0,64)}:{css:h.slice(0,300)},clickable:"input"!==n&&"select"!==n&&"other"!==n,rect:[m.left+scrollX,m.top+scrollY,m.width,m.height].map(Math.round)})}let h=[...document.querySelectorAll("h1,h2,h3,[role=heading]")].filter(e=>!e.closest("[data-private]")&&i(e)).map(e=>o(e.innerText)).filter(Boolean).slice(0,10);return{platform:"web",path:location.pathname||"/",...document.title?{title:o(document.title)}:{},headings:h,viewport:[innerWidth,innerHeight],elements:p}}function s(){try{return function(){let e=document.createElement("canvas");e.width=e.height=1;let t=e.getContext("2d",{willReadFrequently:!0}),n=e=>{if(!t||!e||"transparent"===e||"none"===e||(t.fillStyle="#010203",t.fillStyle=e,"#010203"===t.fillStyle&&!/^#010203$/i.test(e)))return null;t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let n=t.getImageData(0,0,1,1).data;return[n[0],n[1],n[2],n[3]/255]},o=e=>`#${e.slice(0,3).map(e=>e.toString(16).padStart(2,"0")).join("")}`,r=e=>(Math.max(e[0],e[1],e[2])-Math.min(e[0],e[1],e[2]))/255,l=e=>{let[t,n,o]=e.slice(0,3).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*t+.7152*n+.0722*o},a=(e,t)=>{let o=n(e),r=n(t);return Math.hypot(o[0]-r[0],o[1]-r[1],o[2]-r[2])<30},i=e=>{let t=e.getBoundingClientRect();if(t.width<4||t.height<4||t.bottom<0||t.top>3*innerHeight)return null;let n=getComputedStyle(e);return"hidden"===n.visibility||"none"===n.display||Number(n.opacity||1)<.3?null:{r:t,s:n}},s=e=>{let t=n(e);return t&&t[3]>=.9?t:null},c=e=>e.length?e.sort((e,t)=>e-t)[Math.floor(e.length/2)]:void 0,u=null;for(let e of[document.querySelector("#root,#app,#__next,[data-reactroot],main"),document.body,document.documentElement])if(u=e?s(getComputedStyle(e).backgroundColor):null,u)break;for(let e=document.elementFromPoint(innerWidth/2,innerHeight/2);!u&&e;e=e.parentElement)u=s(getComputedStyle(e).backgroundColor);u??(u="dark"===getComputedStyle(document.documentElement).colorScheme.trim()?[18,18,18,1]:[255,255,255,1]);let d=l(u)<.2,p=n(getComputedStyle(document.querySelector("main")??document.body).color),h=[],m=(e,t,n)=>{let o=h.find(t=>t.from===n&&a(t.color,e));o?o.weight+=t:h.push({color:e,weight:t,from:n})},g=[],f=document.querySelectorAll("button,[role=button],input[type=submit],input[type=button],a,[class*=btn],[class*=Btn],[class*=button],[class*=Button]");for(let e of[...f].slice(0,400)){let t=i(e);if(!t)continue;let a=s(t.s.backgroundColor);if(a&&r(a)>.18&&l(a)>.02&&l(a)<.9){m(o(a),Math.min(t.r.width*t.r.height,3e4),"button");let e=Number.parseFloat(t.s.borderTopLeftRadius)||0;g.push(e>=t.r.height/2-1?999:e)}else if("A"===e.tagName){let e=n(t.s.color);e&&r(e)>.25&&m(o(e),400,"link")}}let b=getComputedStyle(document.documentElement),y=new Set,x=0;for(let e of[...document.styleSheets]){let t;try{t=e.cssRules}catch{continue}for(let e of[...t]){if(++x>3e3)break;let t=e.style;if(t&&/:root|html|body|\.light|\[data-theme/.test(e.selectorText??""))for(let e of[...t]){if(!e.startsWith("--")||y.has(e)||!/primary|accent|brand/i.test(e)||/foreground|fg|text|contrast|muted|soft|subtle|hover|active|border|ring|shadow|50\b|100\b|900\b/i.test(e))continue;y.add(e);let t=b.getPropertyValue(e).trim(),l=n(t)??n(`hsl(${t})`)??n(`rgb(${t})`)??n(`oklch(${t})`);l&&l[3]>=.9&&r(l)>.18&&m(o(l),/^--(color-)?(primary|brand)$/i.test(e)?8e4:4e4,"variable")}}}let w=n(document.querySelector("meta[name=theme-color]")?.getAttribute("content"));w&&r(w)>.18&&m(o(w),2e4,"theme-color");let S=[],v=[],k=document.querySelectorAll("section,article,aside,dialog,[role=dialog],[class*=card],[class*=Card],[class*=panel],[class*=Panel],div");for(let e of[...k].slice(0,800)){let t=i(e);if(!t||t.r.width*t.r.height<2e4||t.r.width>.95*innerWidth)continue;let n=s(t.s.backgroundColor);if(!n||r(n)>.2||a(o(n),o(u))||l(n)<.2!==d)continue;let c="none"!==t.s.boxShadow||Number.parseFloat(t.s.borderTopWidth)>0,p=o(n),h=S.find(e=>a(e.color,p)),m=Math.min(t.r.width*t.r.height,2e5)*(c?2:1);h?h.weight+=m:S.push({color:p,weight:m}),c&&v.push(Number.parseFloat(t.s.borderTopLeftRadius)||0)}let C=getComputedStyle(document.body).fontFamily,$=document.querySelector("h1,h2"),A=$?getComputedStyle($).fontFamily:void 0;return{scheme:d?"dark":"light",background:o(u),...p?{text:o(p)}:{},accents:h.sort((e,t)=>t.weight-e.weight).slice(0,8),surfaces:S.sort((e,t)=>t.weight-e.weight).slice(0,4).map(e=>e.color),...C?{font:C.slice(0,300)}:{},...A&&A!==C?{displayFont:A.slice(0,300)}:{},...g.length?{radius:c(g)}:{},...v.length?{cardRadius:c(v)}:{}}}()}catch{return}}let c="playstep_preview",u="playstep_capture_on",d=e=>{try{return sessionStorage.getItem(e)}catch{return null}},p=(e,t)=>{try{null===t?sessionStorage.removeItem(e):sessionStorage.setItem(e,t)}catch{}};function h(e){let t=e=>e&&a(e)||void 0;return{...e,title:t(e.title),headings:(e.headings??[]).map(e=>a(e)).filter(Boolean),elements:e.elements.map(e=>({...e,text:t(e.text),label:t(e.label),placeholder:t(e.placeholder),href:e.href&&!l(e.href)?e.href:void 0,css:e.css&&!l(e.css)?e.css:void 0})).filter(e=>e.anchor||e.css)}}return e.redactScreen=h,e.snapshotPage=i,e.start=function(e,t){let n=document.createElement("playstep-capture"),o=n.attachShadow({mode:"open"});document.body.appendChild(n);let r=document.createElement("div");r.className="p",r.setAttribute("role","region"),r.setAttribute("aria-label","PlayStep capture"),o.innerHTML='<style>:host{all:initial}\n.p{position:fixed;left:24px;bottom:24px;z-index:2147483001;width:320px;max-width:calc(100vw - 48px);box-sizing:border-box;padding:16px;border-radius:16px;background:#fff;color:#151823;font:14px/20px system-ui,-apple-system,"Segoe UI",sans-serif;box-shadow:0 12px 32px #15182333,0 0 0 1px #15182314}\nh2{margin:0 0 4px;font-size:15px;line-height:22px;font-weight:700;display:flex;align-items:center;gap:8px}\np{margin:0 0 12px;color:#4a5163}\n.dot{width:8px;height:8px;border-radius:50%;background:#e5484d;animation:b 1.6s ease-in-out infinite}\n@keyframes b{50%{opacity:.35}}\n.row{display:flex;gap:8px;flex-wrap:wrap}\nbutton{font:600 14px/20px inherit;font-family:inherit;border:0;border-radius:999px;padding:8px 14px;cursor:pointer;background:#eef0f5;color:#151823}\nbutton.go{background:#2e5bff;color:#fff}\nbutton:focus-visible{outline:2px solid #2e5bff;outline-offset:2px}\n.last{margin:-6px 0 12px;font-size:12px;color:#4a5163;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n@media (prefers-color-scheme:dark){.p{background:#151821;color:#e7e9ee;box-shadow:0 12px 32px #0008,0 0 0 1px #ffffff1a}p,.last{color:#b4bccb}button{background:#262a35;color:#e7e9ee}button.go{background:#4f78ff}}\n@media (prefers-reduced-motion:reduce){.dot{animation:none}}</style>',o.appendChild(r);let l,a=0,m="",g=!1,f=(n="")=>`${e.endpoint}${n}?key=${encodeURIComponent(t)}`,b=(e,t,n=!1)=>{let o=document.createElement("button");return o.textContent=e,n&&(o.className="go"),o.onclick=t,o},y=(e,t,n,o={})=>{r.innerHTML="";let l=document.createElement("h2");o.live&&(l.innerHTML='<span class="dot" aria-hidden="true"></span>'),l.append(e);let a=document.createElement("p");if(a.textContent=t,a.setAttribute("aria-live","polite"),r.append(l,a),o.note){let e=document.createElement("div");e.className="last",e.textContent=o.note,r.append(e)}let i=document.createElement("div");i.className="row",i.append(...n),r.append(i)},x=()=>{g=!0,clearTimeout(l),p(c,null),p(u,null),n.remove()},w=()=>{g=!0,p(c,null),p(u,null),y("Capture link expired","Get a new link from Generate with AI in PlayStep.",[b("Close",x,!0)])},S=e=>y(`Capturing · ${a} ${1===a?"page":"pages"}`,"Open the pages your users need help with. Each one is added as you go.",[b("Capture this page",()=>{v()}),b("Finish",()=>{!async function(){g=!0,await fetch(f("/finish"),{method:"POST"}).catch(()=>{}),p(c,null),p(u,null),y("Capture finished",`${a} ${1===a?"page":"pages"} captured. Go back to PlayStep to generate tours.`,[b("Close",()=>n.remove(),!0)])}()},!0)],{live:!0,note:e});async function v(){if(g)return;clearTimeout(l);let e={...h(i()),style:s()};try{let t=await fetch(f("/screens"),{method:"POST",headers:{"content-type":"text/plain"},body:JSON.stringify(e)});if(404===t.status||410===t.status)return w();let n=await t.json().catch(()=>({}));if(!t.ok)return S(n.message??"That page could not be added.");a=n.screens??a+1,m=location.pathname,S(`Added ${e.title||m}`)}catch{S("PlayStep could not be reached. It will try again on the next page.")}}let k=()=>{g||"1"!==d(u)||location.pathname===m||(clearTimeout(l),l=setTimeout(()=>{v()},1200))};for(let e of["pushState","replaceState"]){let t=history[e];history[e]=function(...e){t.apply(this,e),k()}}addEventListener("popstate",k);let C=()=>{p(u,"1"),S(),k()};return"1"===d(u)?fetch(f()).then(e=>e.ok?e.json():Promise.reject(e.status)).then(e=>{a=e.screens,C()}).catch(e=>404===e?w():C()):y("Show PlayStep your app","Visit the pages your users need help with. PlayStep notes the buttons, links and headings on each page. Never what you type, and no screenshots.",[b("Start capturing",C,!0),b("Not now",x)]),{captureNow:v,stop:x}},e}({});
1
+ var __playstep_capture=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});let t=/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g,n=/\+?\(?\d[\d\s().-]{5,}\d/g,o=/\d{6,}/g,r=/\b(?=[\w-]*\d)[\w-]{24,}\b/g;function l(e){return[t,r,o].some(t=>new RegExp(t.source).test(e))||[...e.matchAll(n)].some(e=>e[0].replace(/\D/g,"").length>=7)}function a(e){if(!e)return"";let l=e.replace(/\s+/g," ").trim().replace(t,"[email]").replace(r,"[id]").replace(n,e=>e.replace(/\D/g,"").length>=7?"[number]":e).replace(o,"[number]");return l.length>80?`${l.slice(0,79)}…`:l}function i(e=80){let t=/^(:|radix-|headlessui-|react-|ember\d|mui-|v-|css-|sc-|jsx-)|\d{3,}|[a-f0-9]{8,}|__/i,n=/active|selected|current|open|hover|focus|disabled|hidden|show|visible|checked|loading/i,o=e=>(e??"").replace(/\s+/g," ").trim().slice(0,80),r=e=>`"${e.replace(/["\\]/g,"\\$&")}"`,l=e=>CSS.escape(e),a=e=>{try{return 1===document.querySelectorAll(e).length}catch{return!1}},i=e=>{let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return!1;let n=getComputedStyle(e);return"hidden"!==n.visibility&&"none"!==n.display&&Number(n.opacity||1)>.05},s=e=>{let t=e.getAttribute("role"),n=e.tagName,o=(e.getAttribute("type")??"").toLowerCase();return"tab"===t||"menuitem"===t||"link"===t||"button"===t?t:"checkbox"===t||"switch"===t||"INPUT"===n&&("checkbox"===o||"radio"===o)?"checkbox":"A"===n?"link":"BUTTON"===n||"SUMMARY"===n||"INPUT"===n&&/^(submit|button|reset|image)$/.test(o)?"button":"SELECT"===n?"select":"INPUT"===n||"TEXTAREA"===n?"input":"other"},c=e=>{let o=e.tagName.toLowerCase(),i=[];e.id&&!t.test(e.id)&&i.push(`#${l(e.id)}`);for(let t of["data-testid","data-test","data-cy","data-qa"]){let n=e.getAttribute(t);n&&i.push(`[${t}=${r(n)}]`)}for(let t of["aria-label","name","title","placeholder"]){let n=e.getAttribute(t);n&&n.length<=80&&i.push(`${o}[${t}=${r(n)}]`)}let s=e.getAttribute("href");"a"===o&&s&&!/^javascript:/i.test(s)&&s.length<=200&&i.push(`a[href=${r(s)}]`);let c=[...e.classList].filter(e=>/^[a-z][\w-]{1,40}$/i.test(e)&&!t.test(e)&&!n.test(e));c.length&&i.push(`${o}.${c.slice(0,3).map(l).join(".")}`);for(let e of i)if(a(e))return e;let u=[],d=e;for(;d&&u.length<7;){if(d===document.body){u.unshift("body");break}if(d!==e&&d.id&&!t.test(d.id)){u.unshift(`#${l(d.id)}`);break}let n=d.tagName.toLowerCase(),o=d.parentElement?[...d.parentElement.children].filter(e=>e.tagName===d.tagName):[];u.unshift(o.length>1?`${n}:nth-of-type(${o.indexOf(d)+1})`:n),d=d.parentElement}let p=u.join(">");return a(p)?p:void 0},u=e=>{let t=e.getAttribute("aria-label")||e.getAttribute("title");if(t)return t;let n=e.getAttribute("aria-labelledby");if(n)return n.split(/\s+/).map(e=>document.getElementById(e)?.textContent??"").join(" ");let o=e.labels;return o?.length?o[0].innerText:""},d=[...document.querySelectorAll("a[href],button,input:not([type=hidden]),select,textarea,summary,[role=button],[role=link],[role=tab],[role=menuitem],[role=checkbox],[role=switch],[data-guide]")].filter(e=>!e.closest("[data-private],[aria-hidden=true],[inert]")&&i(e)&&!e.parentElement?.closest("a[href],button,[role=button],[role=link]")).map((e,t)=>{let n=e.getBoundingClientRect(),o=n.bottom>0&&n.top<innerHeight;return{e:e,i:t,score:(e.hasAttribute("data-guide")?0:2)+ +!o}}).sort((e,t)=>e.score-t.score||e.i-t.i).slice(0,e).sort((e,t)=>e.i-t.i),p=[];for(let{e:e}of d){let t,n=s(e),r=e.getAttribute("data-guide"),l="input"===n||"select"===n?"":o(e.innerText||e.textContent),a=o(u(e))||("INPUT"===e.tagName&&"button"===n?o(e.value):""),i=o(e.getAttribute("placeholder")),d=e.getAttribute("href");if("A"===e.tagName&&d)try{let e=new URL(d,location.href);e.origin===location.origin&&(t=e.pathname)}catch{}let h=r?void 0:c(e);if(!r&&!h)continue;let m=e.getBoundingClientRect();p.push({ref:`e${p.length+1}`,role:n,...l?{text:l}:{},...a&&a!==l?{label:a}:{},...i?{placeholder:i}:{},...t?{href:t}:{},...r?{anchor:r.slice(0,64)}:{css:h.slice(0,300)},clickable:"input"!==n&&"select"!==n&&"other"!==n,rect:[m.left+scrollX,m.top+scrollY,m.width,m.height].map(Math.round)})}let h=[...document.querySelectorAll("h1,h2,h3,[role=heading]")].filter(e=>!e.closest("[data-private]")&&i(e)).map(e=>o(e.innerText)).filter(Boolean).slice(0,10);return{platform:"web",path:location.pathname||"/",...document.title?{title:o(document.title)}:{},headings:h,viewport:[innerWidth,innerHeight],elements:p}}function s(){try{return function(){let e=document.createElement("canvas");e.width=e.height=1;let t=e.getContext("2d",{willReadFrequently:!0}),n=e=>{if(!t||!e||"transparent"===e||"none"===e||(t.fillStyle="#010203",t.fillStyle=e,"#010203"===t.fillStyle&&!/^#010203$/i.test(e)))return null;t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let n=t.getImageData(0,0,1,1).data;return[n[0],n[1],n[2],n[3]/255]},o=e=>`#${e.slice(0,3).map(e=>e.toString(16).padStart(2,"0")).join("")}`,r=e=>(Math.max(e[0],e[1],e[2])-Math.min(e[0],e[1],e[2]))/255,l=e=>{let[t,n,o]=e.slice(0,3).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*t+.7152*n+.0722*o},a=(e,t)=>{let o=n(e),r=n(t);return Math.hypot(o[0]-r[0],o[1]-r[1],o[2]-r[2])<30},i=e=>{let t=e.getBoundingClientRect();if(t.width<4||t.height<4||t.bottom<0||t.top>3*innerHeight)return null;let n=getComputedStyle(e);return"hidden"===n.visibility||"none"===n.display||Number(n.opacity||1)<.3?null:{r:t,s:n}},s=e=>{let t=n(e);return t&&t[3]>=.9?t:null},c=e=>e.length?e.sort((e,t)=>e-t)[Math.floor(e.length/2)]:void 0,u=null;for(let e of[document.querySelector("#root,#app,#__next,[data-reactroot],main"),document.body,document.documentElement])if(u=e?s(getComputedStyle(e).backgroundColor):null,u)break;for(let e=document.elementFromPoint(innerWidth/2,innerHeight/2);!u&&e;e=e.parentElement)u=s(getComputedStyle(e).backgroundColor);u??(u="dark"===getComputedStyle(document.documentElement).colorScheme.trim()?[18,18,18,1]:[255,255,255,1]);let d=l(u)<.2,p=n(getComputedStyle(document.querySelector("main")??document.body).color),h=[],m=(e,t,n)=>{let o=h.find(t=>t.from===n&&a(t.color,e));o?o.weight+=t:h.push({color:e,weight:t,from:n})},g=[],f=document.querySelectorAll("button,[role=button],input[type=submit],input[type=button],a,[class*=btn],[class*=Btn],[class*=button],[class*=Button]");for(let e of[...f].slice(0,400)){let t=i(e);if(!t)continue;let a=s(t.s.backgroundColor);if(a&&r(a)>.18&&l(a)>.02&&l(a)<.9){m(o(a),Math.min(t.r.width*t.r.height,3e4),"button");let e=Number.parseFloat(t.s.borderTopLeftRadius)||0;g.push(e>=t.r.height/2-1?999:e)}else if("A"===e.tagName){let e=n(t.s.color);e&&r(e)>.25&&m(o(e),400,"link")}}let b=getComputedStyle(document.documentElement),y=new Set,x=0;for(let e of[...document.styleSheets]){let t;try{t=e.cssRules}catch{continue}for(let e of[...t]){if(++x>3e3)break;let t=e.style;if(t&&/:root|html|body|\.light|\[data-theme/.test(e.selectorText??""))for(let e of[...t]){if(!e.startsWith("--")||y.has(e)||!/primary|accent|brand/i.test(e)||/foreground|fg|text|contrast|muted|soft|subtle|hover|active|border|ring|shadow|sidebar|chart|50\b|100\b|900\b/i.test(e))continue;y.add(e);let t=b.getPropertyValue(e).trim(),l=n(t)??n(`hsl(${t})`)??n(`rgb(${t})`)??n(`oklch(${t})`);l&&l[3]>=.9&&r(l)>.18&&m(o(l),/^--(color-)?(primary|brand)$/i.test(e)?8e4:4e4,"variable")}}}let w=n(document.querySelector("meta[name=theme-color]")?.getAttribute("content"));w&&r(w)>.18&&m(o(w),2e4,"theme-color");let S=[],v=[],k=document.querySelectorAll("section,article,aside,dialog,[role=dialog],[class*=card],[class*=Card],[class*=panel],[class*=Panel],div");for(let e of[...k].slice(0,800)){let t=i(e);if(!t||t.r.width*t.r.height<2e4||t.r.width>.95*innerWidth)continue;let n=s(t.s.backgroundColor);if(!n||r(n)>.2||a(o(n),o(u))||l(n)<.2!==d)continue;let c="none"!==t.s.boxShadow||Number.parseFloat(t.s.borderTopWidth)>0,p=o(n),h=S.find(e=>a(e.color,p)),m=Math.min(t.r.width*t.r.height,2e5)*(c?2:1);h?h.weight+=m:S.push({color:p,weight:m}),c&&v.push(Number.parseFloat(t.s.borderTopLeftRadius)||0)}let C=getComputedStyle(document.body).fontFamily,$=document.querySelector("h1,h2"),A=$?getComputedStyle($).fontFamily:void 0;return{scheme:d?"dark":"light",background:o(u),...p?{text:o(p)}:{},accents:h.sort((e,t)=>t.weight-e.weight).slice(0,8),surfaces:S.sort((e,t)=>t.weight-e.weight).slice(0,4).map(e=>e.color),...C?{font:C.slice(0,300)}:{},...A&&A!==C?{displayFont:A.slice(0,300)}:{},...g.length?{radius:c(g)}:{},...v.length?{cardRadius:c(v)}:{}}}()}catch{return}}let c="playstep_preview",u="playstep_capture_on",d=e=>{try{return sessionStorage.getItem(e)}catch{return null}},p=(e,t)=>{try{null===t?sessionStorage.removeItem(e):sessionStorage.setItem(e,t)}catch{}};function h(e){let t=e=>e&&a(e)||void 0;return{...e,title:t(e.title),headings:(e.headings??[]).map(e=>a(e)).filter(Boolean),elements:e.elements.map(e=>({...e,text:t(e.text),label:t(e.label),placeholder:t(e.placeholder),href:e.href&&!l(e.href)?e.href:void 0,css:e.css&&!l(e.css)?e.css:void 0})).filter(e=>e.anchor||e.css)}}return e.redactScreen=h,e.snapshotPage=i,e.start=function(e,t){let n=document.createElement("playstep-capture"),o=n.attachShadow({mode:"open"});document.body.appendChild(n);let r=document.createElement("div");r.className="p",r.setAttribute("role","region"),r.setAttribute("aria-label","PlayStep capture"),o.innerHTML='<style>:host{all:initial}\n.p{position:fixed;left:24px;bottom:24px;z-index:2147483001;width:320px;max-width:calc(100vw - 48px);box-sizing:border-box;padding:16px;border-radius:16px;background:#fff;color:#151823;font:14px/20px system-ui,-apple-system,"Segoe UI",sans-serif;box-shadow:0 12px 32px #15182333,0 0 0 1px #15182314}\nh2{margin:0 0 4px;font-size:15px;line-height:22px;font-weight:700;display:flex;align-items:center;gap:8px}\np{margin:0 0 12px;color:#4a5163}\n.dot{width:8px;height:8px;border-radius:50%;background:#e5484d;animation:b 1.6s ease-in-out infinite}\n@keyframes b{50%{opacity:.35}}\n.row{display:flex;gap:8px;flex-wrap:wrap}\nbutton{font:600 14px/20px inherit;font-family:inherit;border:0;border-radius:999px;padding:8px 14px;cursor:pointer;background:#eef0f5;color:#151823}\nbutton.go{background:#2e5bff;color:#fff}\nbutton:focus-visible{outline:2px solid #2e5bff;outline-offset:2px}\n.last{margin:-6px 0 12px;font-size:12px;color:#4a5163;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n@media (prefers-color-scheme:dark){.p{background:#151821;color:#e7e9ee;box-shadow:0 12px 32px #0008,0 0 0 1px #ffffff1a}p,.last{color:#b4bccb}button{background:#262a35;color:#e7e9ee}button.go{background:#4f78ff}}\n@media (prefers-reduced-motion:reduce){.dot{animation:none}}</style>',o.appendChild(r);let l,a=0,m="",g=!1,f=(n="")=>`${e.endpoint}${n}?key=${encodeURIComponent(t)}`,b=(e,t,n=!1)=>{let o=document.createElement("button");return o.textContent=e,n&&(o.className="go"),o.onclick=t,o},y=(e,t,n,o={})=>{r.innerHTML="";let l=document.createElement("h2");o.live&&(l.innerHTML='<span class="dot" aria-hidden="true"></span>'),l.append(e);let a=document.createElement("p");if(a.textContent=t,a.setAttribute("aria-live","polite"),r.append(l,a),o.note){let e=document.createElement("div");e.className="last",e.textContent=o.note,r.append(e)}let i=document.createElement("div");i.className="row",i.append(...n),r.append(i)},x=()=>{g=!0,clearTimeout(l),p(c,null),p(u,null),n.remove()},w=()=>{g=!0,p(c,null),p(u,null),y("Capture link expired","Get a new link from Generate with AI in PlayStep.",[b("Close",x,!0)])},S=e=>y(`Capturing · ${a} ${1===a?"page":"pages"}`,"Open the pages your users need help with. Each one is added as you go.",[b("Capture this page",()=>{v()}),b("Finish",()=>{!async function(){g=!0,await fetch(f("/finish"),{method:"POST"}).catch(()=>{}),p(c,null),p(u,null),y("Capture finished",`${a} ${1===a?"page":"pages"} captured. Go back to PlayStep to generate tours.`,[b("Close",()=>n.remove(),!0)])}()},!0)],{live:!0,note:e});async function v(){if(g)return;clearTimeout(l);let e={...h(i()),style:s()};try{let t=await fetch(f("/screens"),{method:"POST",headers:{"content-type":"text/plain"},body:JSON.stringify(e)});if(404===t.status||410===t.status)return w();let n=await t.json().catch(()=>({}));if(!t.ok)return S(n.message??"That page could not be added.");a=n.screens??a+1,m=location.pathname,S(`Added ${e.title||m}`)}catch{S("PlayStep could not be reached. It will try again on the next page.")}}let k=()=>{g||"1"!==d(u)||location.pathname===m||(clearTimeout(l),l=setTimeout(()=>{v()},1200))};for(let e of["pushState","replaceState"]){let t=history[e];history[e]=function(...e){t.apply(this,e),k()}}addEventListener("popstate",k);let C=()=>{p(u,"1"),S(),k()};return"1"===d(u)?fetch(f()).then(e=>e.ok?e.json():Promise.reject(e.status)).then(e=>{a=e.screens,C()}).catch(e=>404===e?w():C()):y("Show PlayStep your app","Visit the pages your users need help with. PlayStep notes the buttons, links and headings on each page. Never what you type, and no screenshots.",[b("Start capturing",C,!0),b("Not now",x)]),{captureNow:v,stop:x}},e}({});
@@ -0,0 +1 @@
1
+ var __playstep_done=function(t,i){return Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.css=".cel{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:336px;max-width:calc(100vw - 24px);padding:24px 20px 20px;text-align:center;overflow:hidden}.cel h2{font-size:24px;line-height:30px;font-weight:800}.cel p{margin-bottom:16px}.art{position:relative;height:72px;margin-bottom:8px}.tile{position:absolute;left:50%;top:4px;width:64px;height:64px;margin-left:-32px;border-radius:var(--ps-radius-lg);background:var(--ps-spark);color:var(--ps-on-spark);display:grid;place-items:center;animation:pop .6s cubic-bezier(.2,1.6,.4,1) both}.tile svg{width:30px;height:30px}.art i{position:absolute;border-radius:99px}.art i:nth-child(1){width:22px;height:8px;left:22%;top:14px;transform:rotate(-20deg);background:var(--ps-accent)}.art i:nth-child(2){width:10px;height:10px;left:30%;top:46px;background:var(--ps-spark)}.art i:nth-child(3){width:12px;height:12px;right:24%;top:10px;background:var(--ps-chart-4)}.art i:nth-child(4){width:24px;height:8px;right:20%;top:44px;transform:rotate(24deg);background:var(--ps-chart-5)}.art i:nth-child(5){width:8px;height:8px;left:16%;top:60px;background:var(--ps-chart-5)}.art i:nth-child(6){width:8px;height:8px;right:30%;top:64px;background:var(--ps-accent)}@keyframes pop{0%{opacity:0;transform:scale(.4) rotate(-12deg)}}",t.drawDone=function(t,e){let a=t.engine.launcherGuides().find(i=>i.id!=e.id&&"done"!=t.engine.progress.guides[i.id]?.status),r=(0,i.words)(t,e.lang),p=(0,i.h)("div",{class:"cel",role:"dialog","aria-modal":"true","aria-labelledby":"ps-cel",tabindex:"-1",lang:e.lang,dir:e.rtl&&"rtl"},(0,i.h)("div",{class:"art","aria-hidden":"true"},[1,2,3,4,5,6].map(()=>(0,i.h)("i")),(0,i.h)("span",{class:"tile"},(0,i.icon)("ps-level-up"))),(0,i.h)("h2",{id:"ps-cel"},r("level_cleared")),(0,i.h)("p",null,r("finished",{guide:e.name}),a?` ${r("next_up",{guide:a.name})}`:""),(0,i.h)("div",{class:"acts"},(0,i.h)("button",{class:"btn sec",onClick:()=>t.dispatch({type:"start",guide:e.id})},(0,i.icon)("rotate-ccw"),r("replay")),a?(0,i.h)("button",{class:"btn pri",onClick:()=>t.dispatch({type:"start",guide:a.id})},r("next_guide"),(0,i.icon)("arrow-right")):(0,i.h)("button",{class:"btn pri",onClick:()=>t.dispatch({type:"close"})},r("done"))));return[(0,i.h)("div",{class:"scrim",onClick:()=>t.dispatch({type:"close"})}),p]},t}({},__playstep_ui);
@@ -1 +1 @@
1
- var __playstep_events=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});let t="playstep:q",r=(e,t)=>fetch(e,{method:"POST",body:t,keepalive:!0,headers:{"content-type":"text/plain"}}).then(e=>({status:e.status,retryAfter:Number(e.headers.get("retry-after"))||void 0}),()=>({status:0})),s={read(e){try{return JSON.parse(localStorage.getItem(e))??[]}catch{return[]}},write(e,r){try{r.length?localStorage.setItem(e,JSON.stringify(r)):localStorage.removeItem(e);let s=!1;for(let e=0;e<localStorage.length;e++)s||(s=!!localStorage.key(e)?.startsWith("playstep:q:"));s?localStorage.setItem(t,"1"):localStorage.removeItem(t)}catch{}}};function l(e){let t,l,a=[],n=[],o=[],i=0,c=!1,g=`${e.storageKey}:${Math.random().toString(36).slice(2,10)}`,u=()=>s.write(g,[...o,...n]),p=async t=>await(e.send?.(e.url,t))??(e.send?{status:204}:r(e.url,t));try{for(let t=localStorage.length-1;t>=0;t--){let r=localStorage.key(t);r?.startsWith(`${e.storageKey}:`)&&(n.push(...s.read(r).filter(e=>Date.now()-e.t<6048e5)),localStorage.removeItem(r))}}catch{}async function h(){if(!c&&!l){c=!0;try{for(;n.length;){let e=await p(n[0].b);if(0===e.status||408===e.status||429===e.status||e.status>=500){i=Math.min(6e4,2*i||2e3),l=setTimeout(()=>{l=void 0,h()},Math.max(i,1e3*(e.retryAfter??0)));break}i=0,n.shift(),u()}}finally{c=!1}}}function d(s=!1){clearTimeout(t),t=void 0;let l=a.length?e.envelope():null;if(l){for(;a.length;)n.push({b:JSON.stringify({...l,events:a.splice(0,20)}),t:Date.now()});n=n.slice(-25),u()}if(s){for(let t of n.splice(0))e.send?p(t.b):navigator.sendBeacon?.(e.url,t.b)||r(e.url,t.b),o.push(t);o=o.slice(-25),u()}else h()}return n=n.sort((e,t)=>e.t-t.t).slice(-25),u(),addEventListener("visibilitychange",()=>"hidden"===document.visibilityState&&d(!0)),addEventListener("pagehide",()=>d(!0)),n.length&&h(),{push(r){a.push(r),a.length>=20?d():t??(t=setTimeout(d,e.delayMs??2e3))},flush:()=>d(),get size(){return a.length},get pending(){return n.length}}}let a=[];for(let e=2;a.length<64;e++){let t=!0;for(let r=2;r*r<=e;r++)e%r===0&&(t=!1);t&&a.push(Math.cbrt(e)%1*2**32|0)}let n=(e,t)=>e>>>t|e<<32-t;function o(e){let t=(new TextEncoder).encode(e),r=t.length,s=new Uint32Array(16*(r+8>>6)+16);for(let e=0;e<r;e++)s[e>>2]|=t[e]<<24-e%4*8;s[r>>2]|=128<<24-r%4*8,s[s.length-1]=8*r,s[s.length-2]=Math.floor(r/536870912);let l=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],o=new Uint32Array(64);for(let e=0;e<s.length;e+=16){for(let t=0;t<64;t++)if(t<16)o[t]=s[e+t];else{let e=o[t-15],r=o[t-2];o[t]=o[t-16]+(n(e,7)^n(e,18)^e>>>3)+o[t-7]+(n(r,17)^n(r,19)^r>>>10)}let[t,r,i,c,g,u,p,h]=l;for(let e=0;e<64;e++){let s=h+(n(g,6)^n(g,11)^n(g,25))+(g&u^~g&p)+a[e]+o[e]|0,l=(n(t,2)^n(t,13)^n(t,22))+(t&r^t&i^r&i)|0;h=p,p=u,u=g,g=c+s|0,c=i,i=r,r=t,t=s+l|0}[t,r,i,c,g,u,p,h].forEach((e,t)=>l[t]=l[t]+e|0)}return l.map(e=>(e>>>0).toString(16).padStart(8,"0")).join("")}let i={get(e){try{return JSON.parse(localStorage.getItem(`playstep:${e}`))}catch{return null}},set(e,t){try{localStorage.setItem(`playstep:${e}`,JSON.stringify(t))}catch{}}},c=e=>e+(crypto.randomUUID?crypto.randomUUID().replace(/-/g,""):Math.random().toString(36).slice(2)+Date.now().toString(36));function g(){try{let e=sessionStorage.getItem("playstep:s");return e||sessionStorage.setItem("playstep:s",e=c("s_")),e}catch{return c("s_")}}return e.createTransport=function(e){let t=g(),r=i.get("d");r||i.set("d",r=c("d_"));let s,a=r,n=l({url:e.url,send:e.send,storageKey:`playstep:q:${e.appKey}`,envelope:()=>{let l=e.userId()||void 0;return l!==s&&(s=l,a=l?`u_${o(`${e.appKey}:${l}`).slice(0,40)}`:r),{key:e.appKey,sdk:{name:e.sdk,version:e.version},platform:"web",session_id:t,user_key:a,preview:e.preview}}});return{session:t,push:e=>n.push({...e,id:e.id??c("e").slice(0,25),...e.message?{message:e.message.slice(0,300)}:{}}),flush:n.flush}},e.randomId=c,e.sessionId=g,e}({});
1
+ var __playstep_events=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});let t="playstep:q",r=(e,t)=>fetch(e,{method:"POST",body:t,keepalive:!0,headers:{"content-type":"text/plain"}}).then(e=>({status:e.status,retryAfter:Number(e.headers.get("retry-after"))||void 0}),()=>({status:0})),l={read(e){try{return JSON.parse(localStorage.getItem(e))??[]}catch{return[]}},write(e,r){try{r.length?localStorage.setItem(e,JSON.stringify(r)):localStorage.removeItem(e);let l=!1;for(let e=0;e<localStorage.length;e++)l||(l=!!localStorage.key(e)?.startsWith("playstep:q:"));l?localStorage.setItem(t,"1"):localStorage.removeItem(t)}catch{}}};function s(e){let t,s,a=[],n=[],o=[],i=0,c=!1,g=`${e.storageKey}:${Math.random().toString(36).slice(2,10)}`,u=()=>l.write(g,[...o,...n]),h=async t=>await(e.send?.(e.url,t))??(e.send?{status:204}:r(e.url,t));try{for(let t=localStorage.length-1;t>=0;t--){let r=localStorage.key(t);r?.startsWith(`${e.storageKey}:`)&&(n.push(...l.read(r).filter(e=>Date.now()-e.t<6048e5)),localStorage.removeItem(r))}}catch{}async function p(){if(!c&&!s){c=!0;try{for(;n.length;){let e=await h(n[0].b);if(0===e.status||408===e.status||429===e.status||e.status>=500){i=Math.min(6e4,2*i||2e3),s=setTimeout(()=>{s=void 0,p()},Math.max(i,1e3*(e.retryAfter??0)));break}i=0,n.shift(),u()}}finally{c=!1}}}function d(l=!1){clearTimeout(t),t=void 0;let s=a.length?e.envelope():null;if(s){for(;a.length;)n.push({b:JSON.stringify({...s,events:a.splice(0,20)}),t:Date.now()});n=n.slice(-25),u()}if(l){for(let t of n.splice(0))e.send?h(t.b):navigator.sendBeacon?.(e.url,t.b)||r(e.url,t.b),o.push(t);o=o.slice(-25),u()}else p()}return n=n.sort((e,t)=>e.t-t.t).slice(-25),u(),addEventListener("visibilitychange",()=>"hidden"===document.visibilityState&&d(!0)),addEventListener("pagehide",()=>d(!0)),n.length&&p(),{push(r){a.push(r),a.length>=20?d():t??(t=setTimeout(d,e.delayMs??2e3))},flush:()=>d(),get size(){return a.length},get pending(){return n.length}}}let a=[];for(let e=2;a.length<64;e++){let t=!0;for(let r=2;r*r<=e;r++)e%r===0&&(t=!1);t&&a.push(Math.cbrt(e)%1*2**32|0)}let n=(e,t)=>e>>>t|e<<32-t;function o(e){let t=(new TextEncoder).encode(e),r=t.length,l=new Uint32Array(16*(r+8>>6)+16);for(let e=0;e<r;e++)l[e>>2]|=t[e]<<24-e%4*8;l[r>>2]|=128<<24-r%4*8,l[l.length-1]=8*r,l[l.length-2]=Math.floor(r/536870912);let s=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],o=new Uint32Array(64);for(let e=0;e<l.length;e+=16){for(let t=0;t<64;t++)if(t<16)o[t]=l[e+t];else{let e=o[t-15],r=o[t-2];o[t]=o[t-16]+(n(e,7)^n(e,18)^e>>>3)+o[t-7]+(n(r,17)^n(r,19)^r>>>10)}let[t,r,i,c,g,u,h,p]=s;for(let e=0;e<64;e++){let l=p+(n(g,6)^n(g,11)^n(g,25))+(g&u^~g&h)+a[e]+o[e]|0,s=(n(t,2)^n(t,13)^n(t,22))+(t&r^t&i^r&i)|0;p=h,h=u,u=g,g=c+l|0,c=i,i=r,r=t,t=l+s|0}[t,r,i,c,g,u,h,p].forEach((e,t)=>s[t]=s[t]+e|0)}return s.map(e=>(e>>>0).toString(16).padStart(8,"0")).join("")}let i={get(e){try{return JSON.parse(localStorage.getItem(`playstep:${e}`))}catch{return null}},set(e,t){try{localStorage.setItem(`playstep:${e}`,JSON.stringify(t))}catch{}}},c=e=>e+(crypto.randomUUID?crypto.randomUUID().replace(/-/g,""):Math.random().toString(36).slice(2)+Date.now().toString(36));function g(){try{let e=sessionStorage.getItem("playstep:s");return e||sessionStorage.setItem("playstep:s",e=c("s_")),e}catch{return c("s_")}}return e.createTransport=function(e){let t=g(),r=i.get("d");r||i.set("d",r=c("d_"));let l,a=r,n=s({url:e.url,send:e.send,storageKey:`playstep:q:${e.appKey}`,envelope:()=>{let s=e.userId()||void 0;return s!==l&&(l=s,a=s?`u_${o(`${e.appKey}:${s}`).slice(0,40)}`:r),{key:e.appKey,sdk:{name:e.sdk,version:e.version},session_id:t,user_key:a,preview:e.preview,locale:e.locale()}}});return{session:t,push:e=>n.push({...e,id:e.id??c("e").slice(0,25),...e.message?{message:e.message.slice(0,300)}:{}}),flush:n.flush}},e.randomId=c,e.sessionId=g,e}({});
@@ -1 +1 @@
1
- var __playstep_launcher=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});let t=e=>"dark"==e||"light"==e?e:void 0;function o(e,o,r){let n=t(r)??t(e.theme?.mode)??t(o);return n?"dark"==n:function(){for(let e of[document.documentElement,document.body]){if(!e)continue;let t=getComputedStyle(e).colorScheme,o=/\b(dark|light)\b/.exec(`${e.className} ${Object.values(e.dataset)} ${/^(dark|light)$/.test(t)?t:""}`);if(o)return"dark"==o[1]}}()??matchMedia("(prefers-color-scheme: dark)").matches}return e.captureIntegrity="sha256-v6KXkv00yz54BDOgiwGgQ1PrwBICS5n92rpvset8ndE=",e.drawLauncher=function(e,t,r,n,i){let d=t.launcherGuides();if(!d.length)return;let l=o(r,i.colorMode),a=r.theme?.[l?"dark":"light"]??{},c=d.filter(e=>!t.progress.guides[e.id]).length;e.innerHTML=`<button aria-label="Open guides" style="position:fixed;${r.launcher.position.slice(7)}:24px;bottom:24px;z-index:2147483000;padding:15px;border:0;border-radius:50%;cursor:pointer;background:${a.accent??(l?"#7091ff":"#2e5bff")};color:${a["on-accent"]??(l?"#0c0e13":"#fff")};box-shadow:0 8px 24px #0004"><svg width=26 height=26 viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M12 21a9 9 0 1 0-8.05-4.98L3 21l4.98-.95A8.96 8.96 0 0 0 12 21zM10 9v6l5-3z"/></svg>${c?`<b style="position:absolute;top:-2px;right:-2px;padding:0 6px;border-radius:9px;background:#ffc933;color:#151823;font:800 11px/20px sans-serif">${c}</b>`:""}</button>`,e.querySelector("button").onclick=n},e}({});
1
+ var __playstep_launcher=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});let t=e=>"dark"==e||"light"==e?e:void 0;function o(e,o,r){let n=t(r)??t(e.theme?.mode)??t(o);return n?"dark"==n:function(){for(let e of[document.documentElement,document.body]){if(!e)continue;let t=getComputedStyle(e).colorScheme,o=/\b(dark|light)\b/.exec(`${e.className} ${Object.values(e.dataset)} ${/^(dark|light)$/.test(t)?t:""}`);if(o)return"dark"==o[1]}}()??matchMedia("(prefers-color-scheme: dark)").matches}return e.captureIntegrity="sha256-AR4Ja7XvDHIrqdPWqvaPm8oOKBI6VDVtoVXn5bZEVVk=",e.drawLauncher=function(e,t,r,n,i){let a=t.launcherGuides();if(!a.length)return;let d=o(r,i.colorMode),l=r.theme?.[d?"dark":"light"]??{},c=a.filter(e=>!t.progress.guides[e.id]).length;e.innerHTML=`<button aria-label="${r.words[r.lang].open_guides}" style="position:fixed;${r.launcher.position.slice(7)}:24px;bottom:24px;z-index:2147483000;padding:15px;border:0;border-radius:50%;cursor:pointer;background:${l.accent??(d?"#7091ff":"#2e5bff")};color:${l["on-accent"]??(d?"#0c0e13":"#fff")};box-shadow:0 8px 24px #0004"><svg width=26 height=26 viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M12 21a9 9 0 1 0-8.05-4.98L3 21l4.98-.95A8.96 8.96 0 0 0 12 21zM10 9v6l5-3z"/></svg>${c?`<b style="position:absolute;top:-2px;right:-2px;padding:0 6px;border-radius:9px;background:#ffc933;color:#151823;font:800 11px/20px sans-serif">${c}</b>`:""}</button>`,e.firstChild.onclick=n},e}({});
@@ -0,0 +1 @@
1
+ var __playstep_list=function(t,e){return Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.css=".panel{position:fixed;right:24px;bottom:96px;width:320px;max-width:calc(100vw - 36px);max-height:calc(100vh - 120px);overflow:auto;padding:16px}.solo{bottom:24px}.panel .x{float:right}.panel>p{font-size:13px;line-height:18px;color:var(--ps-ink-muted);margin:-2px 0 12px}.rows{list-style:none;padding:0}.row{display:flex;align-items:center;gap:12px;width:100%;padding:10px;border-radius:var(--ps-radius-md);text-align:left}.ti{width:36px;height:36px;flex:none;border-radius:var(--ps-radius-md);display:grid;place-items:center;background:var(--ps-primary-soft);color:var(--ps-primary-ink)}.ti.spark{background:var(--ps-spark-soft);color:var(--ps-spark-ink)}.ti.mint{background:var(--ps-tag-mint);color:var(--ps-ink)}.ti svg{width:18px;height:18px}.rb{flex:1;min-width:0}.rt,.rm{display:block;font-weight:600}.rm{font-size:12px;line-height:16px;font-weight:500;color:var(--ps-ink-muted)}.prog{display:block;height:6px;border-radius:99px;background:var(--ps-surface-sunken);margin-top:6px;overflow:hidden}.prog i{display:block;height:100%;background:var(--ps-accent)}.rp{display:flex;align-items:center;gap:4px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted)}.so{margin-top:8px}.new{height:24px;padding:0 10px;border-radius:99px;background:var(--ps-spark-soft);color:var(--ps-spark-ink);font-size:12px;line-height:24px;font-weight:600}.pb{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:10px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted);text-decoration:none}.panel.left{right:auto;left:24px}@media (max-width:480px){.panel{right:18px;bottom:86px}.solo{bottom:18px}.panel.left{left:18px}}",t.drawList=function(t,i,s){let a=t.config.launcher,p=(0,e.words)(t),n=t.engine.launcherGuides(),r=t.engine.progress.guides;i.className=`panel${"bottom-left"==a.position?" left":""}${a.enabled?"":" solo"}`,i.setAttribute("aria-label",p("guides")),i.lang=t.config.lang,t.config.rtl&&(i.dir="rtl"),(0,e.fillEl)(i,(0,e.h)("button",{class:"x","aria-label":p("close_guides"),onClick:s},(0,e.icon)("x")),(0,e.h)("h2",null,a.title),(0,e.h)("p",null,a.description),(0,e.h)("ul",{class:"rows"},n.map(i=>{let a=r[i.id],n=i.steps.length,o="done"==a?.status,l="running"==a?.status;return(0,e.h)("li",null,(0,e.h)("button",{class:"row",onClick:()=>{s(),a&&t.dispatch({type:"reset_progress",guide:i.id}),t.dispatch({type:"start",guide:i.id})}},(0,e.h)("span",{class:"ti"+(o?" mint":a?"":" spark")},(0,e.icon)(o?"check":"ps-guide")),(0,e.h)("span",{class:"rb"},(0,e.h)("span",{class:"rt"},i.name),(0,e.h)("span",{class:"rm"},o?p("completed"):l?p("step_of",{n:a.step+1,total:n}):p("n_steps",{n:n})),l&&(0,e.h)("span",{class:"prog","aria-hidden":"true"},(0,e.h)("i",{style:{width:a.step/n*100+"%"}}))),a?(0,e.h)("span",{class:"rp"},(0,e.icon)("rotate-ccw"),p("replay")):(0,e.h)("span",{class:"new"},p("new"))))})),n.some(t=>r[t.id])&&(0,e.h)("div",{class:"acts so"},(0,e.h)("button",{class:"btn gho",onClick:()=>{t.dispatch({type:"reset_progress"}),t.engine.active?s():i.focus()}},p("start_over"))),!1!==t.config.flags?.show_badge&&(0,e.h)("a",{class:"pb",href:"https://playstep.app/?ref=badge",target:"_blank",rel:"noopener"},(0,e.h)("span",{style:{display:"inline-flex",width:"16px",height:"16px"},ref:t=>t.innerHTML='<svg viewBox="0 0 48 48" aria-hidden="true"><rect width="48" height="48" rx="13" fill="#2E5BFF"/><rect x="11" y="10" width="8" height="28" rx="4" fill="#fff"/><path d="M23.5 12v17l12-8.5z" fill="#FFC933" stroke="#FFC933" stroke-width="3.5" stroke-linejoin="round"/></svg>'}),"Powered by PlayStep"))},t}({},__playstep_ui);
@@ -1 +1 @@
1
- !function(){let e=e=>e.length>1?e.replace(/\/+$/,""):e;function t(t,n){return!!t&&void 0!==n&&(r=e(t),RegExp(`^${r.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")}$`)).test(e(n));var r}function n(e){let n,r,{config:i,platform:s}=e,a=e.progress??{seen:!1,guides:{}},o=e.traits??{},p=null,u=new Set,c=i.flags||{},d=(i.guides??[]).filter(e=>e.spec_version<=3&&(e.targeting?.platforms??["web"]).includes(s)),l=e=>d.find(t=>t.id===e),g=(e,t,n)=>({type:e,guide_id:t.id,guide_version:t.version,...n>=0&&{step_id:t.steps[n].id,step_index:n}}),h=e=>!c.disabled&&(!c.paused_for_new_users||a.seen)&&function(e,t){return(e??[]).every(e=>{let n=t[e.trait];return"exists"===e.op?null!=n:"in"===e.op?Array.isArray(e.value)&&e.value.includes(n):n===e.value==("eq"===e.op)})}(e.targeting?.segments,o),f=(e,t,n)=>{a.guides[e.id]={version:e.version,step:n,status:t}},m=e=>t(e.path,r),y=e=>t(e.skip_if_on,r)||m(e.complete_on),v=(e,t,r)=>{for(;t<e.steps.length;){if(p={guide:e,index:t,status:"running"},n=void 0,f(e,"running",t),r.push(g("step_shown",e,t)),!y(e.steps[t]))return r;r.push(g("step_completed",e,t++))}return p={guide:e,index:--t,status:"completed"},f(e,"done",t),r.push(g("guide_completed",e)),r},_=(e,t)=>(a.seen=!0,v(e,t,[g("guide_shown",e)])),w=()=>{let e=p;return p=null,"running"===e?.status?(f(e.guide,"dismissed",e.index),[g("guide_dismissed",e.guide,e.index)]):[]},x=()=>{let e=p;return v(e.guide,e.index+1,[g("step_completed",e.guide,e.index)])},$=e=>{let t=d.find(t=>(e=>{let t=a.guides[e.id];return!p&&!u.has(e.id)&&h(e)&&(!t||"done"!==t.status&&("running"===t.status||!e.trigger.once))})(t)&&e(t));return t?_(t,0):[]},S=()=>(u.clear(),$(e=>"first_visit"===e.trigger.type||m(e.trigger)));return{get active(){return p},progress:a,dispatch:function(e){let t="running"===p?.status?p.guide.steps[p.index]:null;switch(e.type){case"init":{r=e.path;let t=d.find(e=>"running"===a.guides[e.id]?.status&&h(e));if(t){let e=a.guides[t.id];return _(t,e.version===t.version?e.step:0)}return S()}case"page_view":return r=e.path,t&&y(t)?x():$(e=>m(e.trigger));case"reset_progress":{let t="string"==typeof e.guide&&l(e.guide);return void 0===t?[]:((!t||p?.guide===t)&&(p=null),t?delete a.guides[t.id]:a.guides={},[{type:"progress_reset",guide_id:t?t.id:void 0},...S()])}case"event":return"event"===t?.complete_on.type&&t.complete_on.name===e.name?x():$(t=>"event"===t.trigger.type&&t.trigger.name===e.name);case"tap":return"tap_anchor"===t?.complete_on.type&&t.anchor===e.anchor?x():[];case"complete":return t?.id===e.step?x():[];case"next":return"next_button"===t?.complete_on.type?x():[];case"back":return t&&0!==p.index?(p={...p,index:p.index-1},f(p.guide,"running",p.index),[g("step_shown",p.guide,p.index)]):[];case"hide":return t&&(u.add(p.guide.id),p=null),[];case"close":if("completed"!==p?.status)return[];case"dismiss":return w();case"start":{let n=l(e.guide);return!n||!h(n)||t&&p.guide===n&&n.steps.slice(0,p.index).every(y)?[]:w().concat(_(n,0))}case"anchor_missing":return t&&t.anchor===e.anchor&&n!==e.anchor?(n=e.anchor,[{...g("anchor_missing",p.guide,p.index),anchor:e.anchor}]):[];case"identify":return o={...o,...e.traits},[]}},launcherGuides:()=>d.filter(e=>!1!==e.launcher&&h(e))}}let r={get(e){try{return JSON.parse(localStorage.getItem(`playstep:${e}`))}catch{return null}},set(e,t){try{localStorage.setItem(`playstep:${e}`,JSON.stringify(t))}catch{}}},i="playstep_preview",s=document.currentScript;function a(e,t){return new Promise((n,r)=>{document.head.append(Object.assign(document.createElement("script"),{src:new URL(`${e}.js`,s?.src||location.href).href,integrity:t,crossOrigin:"anonymous",onload:()=>n(window[`__playstep_${e}`]),onerror:()=>r(Error(e))}))})}let o=()=>a("launcher","sha256-cRfLn8IceaWlkTL1lnFJJcmfAe8YUXJAr1fXQpdkb8U="),p=function(e,t,s,a="web"){let o,p,u,c,d,l,g,h={},f=[],m=[],y=()=>`p:${o.appKey}`,v=()=>o.preview||r.set(y(),p.progress),_=e=>{let t={...e,ts:Date.now()};o?.preview||(c?c.send(t):m.push(t)),o?.onEvent?.(t)},w=e=>{try{_({type:"sdk_error",message:String(e)})}catch{}},x=e=>(...t)=>{try{e(...t)}catch(e){w(e)}},$=(e,t)=>x(n=>S({type:e,[t]:n}));function S(e){if(!p)return void f.push(e);let t=p.dispatch(e);v(),t.forEach(x(_)),(p.active||r.get("q"))&&E(),c?.update()}function b(){return l??(l=document.body.appendChild(document.createElement("playstep-root")).attachShadow({mode:"open"}))}function E(){return d??(d=e().then(e=>{let t=b();return t.innerHTML="",c=e.mount({engine:p,config:u,options:o,root:t,outbox:m,userId:()=>g,dispatch:x(S),emit:x(_)})}).catch(w))}let L,I=x((e={})=>{p?p.launcherGuides().length&&E().then(t=>t?.openLauncher(e.anchor)):L=e});function k(e){e.launcher?.enabled&&p.launcherGuides().length&&!d&&t&&t().then(t=>{d||t.drawLauncher(b(),p,e,I,o)}).catch(w)}return{version:"0.5.1",init:x(e=>{if(o||!e?.appKey)return;o={...e};let t=()=>setTimeout(()=>async function(){let e=o,t=(e.apiBase??"https://cdn.playstep.app").replace(/\/$/,""),c=null;try{c=new URLSearchParams(location.search).get(i)||(e.config?null:sessionStorage.getItem(i))}catch{}e.preview||(e.preview=!(!e.config&&!c));let d=e.config;try{d??(d=await fetch(`${t}/v1/${c?`preview/${c}?key=`:"config/"}${e.appKey}`).then(e=>e.json()))}catch{return}try{c&&sessionStorage[d.guides?"setItem":"removeItem"](i,c)}catch{}if(d?.capture)s?.().then(t=>t.start(d.capture,e.appKey)).catch(w);else if(d?.guides&&!d.flags?.disabled&&(u=d,e.eventsUrl=d.ingest_url??`${t}/v1/events`,p=n({config:d,platform:a,progress:e.preview?void 0:r.get(y())??void 0,traits:h}),S({type:"init",path:location.pathname}),f.splice(0).forEach(S),L&&I(L),k(d),!1!==e.autoPageViews)){let e=location.pathname,t=x(()=>location.pathname!==e&&S({type:"page_view",path:e=location.pathname}));for(let e of["pushState","replaceState"]){let n=history[e];history[e]=function(...e){n.apply(this,e),t()}}addEventListener("popstate",t)}}().catch(w));"complete"===document.readyState?t():addEventListener("load",t)}),identify:x((e,t)=>{g=e,h={...h,...t},S({type:"identify",traits:h})}),track:$("event","name"),start:$("start","guide"),complete:$("complete","step"),page:x(e=>S({type:"page_view",path:e??location.pathname})),openLauncher:I,resetProgress:$("reset_progress","guide"),reset:x(()=>{S({type:"dismiss"}),g=void 0,h={},p&&(Object.assign(p.progress,{seen:!1,guides:{}}),v(),c?.update()),o?.preview||r.set("d",null)})}}(()=>a("ui","sha256-q52Zx88PiNnSHb1HIMsZjxOEk0d05jUONpKu/oxaH9U="),o,()=>o().then(e=>a("capture",e.captureIntegrity)));if(!window.playstep){window.playstep=p;let e=s?.dataset;e?.appKey&&p.init({appKey:e.appKey,apiBase:e.api,locale:e.locale})}}();
1
+ !function(){let e=e=>e.length>1?e.replace(/\/+$/,""):e;function t(t,n){return!!t&&void 0!==n&&(r=e(t),RegExp(`^${r.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")}$`)).test(e(n));var r}function n(e){let n,r,{config:i}=e,s=e.progress??{seen:!1,guides:{}},a=e.traits??{},u=null,o=new Set,p=!1,c=i.flags,d=i.guides,l=e=>d.find(t=>t.id===e),g=(e,t,n)=>({type:e,guide_id:t.id,guide_version:t.version,...n>=0&&{step_id:t.steps[n].id,step_index:n}}),h=e=>!p&&!c.disabled&&(!c.paused_for_new_users||s.seen)&&function(e,t){return(e??[]).every(e=>{let n=t[e.trait];return"exists"===e.op?null!=n:"in"===e.op?Array.isArray(e.value)&&e.value.includes(n):n===e.value==("eq"===e.op)})}(e.segments,a),y=(e,t,n)=>{s.guides[e.id]={version:e.version,step:n,status:t}},m=e=>t(e.path,r),f=e=>t(e.skip_if_on,r)||m(e.complete_on),v=(e,t,r)=>{for(;t<e.steps.length;){if(u={guide:e,index:t,status:"running"},n=void 0,y(e,"running",t),r.push(g("step_shown",e,t)),!f(e.steps[t]))return r;r.push(g("step_completed",e,t++))}return u={guide:e,index:--t,status:"completed"},y(e,"done",t),r.push(g("guide_completed",e)),r},_=(e,t)=>(s.seen=!0,v(e,t,[g("guide_shown",e)])),w=()=>{let e=u;return u=null,"running"===e?.status?(y(e.guide,"dismissed",e.index),[g("guide_dismissed",e.guide,e.index)]):[]},x=()=>{let e=u;return v(e.guide,e.index+1,[g("step_completed",e.guide,e.index)])},$=e=>{let t=d.find(t=>(e=>{let t=s.guides[e.id];return!u&&!o.has(e.id)&&h(e)&&(!t||"done"!==t.status&&("running"===t.status||!e.trigger.once))})(t)&&e(t));return t?_(t,0):[]},S=()=>$(e=>"first_visit"===e.trigger.type||m(e.trigger)),E=()=>{let e=d.find(e=>"running"===s.guides[e.id]?.status&&!o.has(e.id)&&h(e));if(!e)return S();let t=s.guides[e.id];return _(e,t.version===e.version?t.step:0)};return{get active(){return p?null:u},progress:s,dispatch:function(e){let t=p||"running"!==u?.status?null:u.guide.steps[u.index];switch(e.type){case"init":return r=e.path,o.clear(),E();case"pause":return p=!0,[];case"resume":return p?(p=!1,u?[]:E()):[];case"page_view":return r=e.path,t&&f(t)?x():$(e=>m(e.trigger));case"reset_progress":{let t="string"==typeof e.guide&&l(e.guide);return void 0===t?[]:((!t||u?.guide===t)&&(u=null),t?delete s.guides[t.id]:s.guides={},[{type:"progress_reset",guide_id:t?t.id:void 0},...(o.clear(),S())])}case"event":return"event"===t?.complete_on.type&&t.complete_on.name===e.name?x():$(t=>"event"===t.trigger.type&&t.trigger.name===e.name);case"tap":return"tap_anchor"===t?.complete_on.type&&t.anchor===e.anchor?x():[];case"complete":return t?.id===e.step?x():[];case"next":return"next_button"===t?.complete_on.type?x():[];case"back":return t&&0!==u.index?(u={...u,index:u.index-1},y(u.guide,"running",u.index),[g("step_shown",u.guide,u.index)]):[];case"hide":return t&&(o.add(u.guide.id),u=null),[];case"close":if("completed"!==u?.status)return[];case"dismiss":return w();case"start":{let n=l(e.guide);return!n||!h(n)||t&&u.guide===n&&n.steps.slice(0,u.index).every(f)?[]:w().concat(_(n,0))}case"anchor_missing":return t&&t.anchor===e.anchor&&n!==e.anchor?(n=e.anchor,[{...g("anchor_missing",u.guide,u.index),anchor:e.anchor}]):[];case"identify":return a={...a,...e.traits},[]}},launcherGuides:()=>d.filter(e=>e.launcher&&h(e)),use(e){i=e,d=e.guides,u&&(u={...u,guide:l(u.guide.id)??u.guide})}}}let r={get(e){try{return JSON.parse(localStorage.getItem(`playstep:${e}`))}catch{return null}},set(e,t){try{localStorage.setItem(`playstep:${e}`,JSON.stringify(t))}catch{}}},i="playstep_preview",s=document.currentScript;function a(e,t){return new Promise((n,r)=>{document.head.append(Object.assign(document.createElement("script"),{src:new URL(`${e}.js`,s?.src||location.href).href,integrity:t,crossOrigin:"anonymous",onload:()=>n(window[`__playstep_${e}`]),onerror:()=>r(Error(e))}))})}let u=()=>a("launcher","sha256-MXzjgrJQkFDwhR3H7iqT1z+XgjeCMVo9/FUXfvSvTaM="),o=function(e,t,s){let a,u,o,p,c,d,l,g,h,y={},m=!1,f=[],v=[],_=()=>`p:${a.appKey}`,w=()=>a.preview||r.set(_(),u.progress),x=e=>{let t={...e,ts:Date.now()};a?.preview||(c?c.send(t):v.push(t)),a?.onEvent?.(t)},$=e=>{try{x({type:"sdk_error",message:String(e)})}catch{}},S=e=>(...t)=>{try{e(...t)}catch(e){$(e)}},E=(e,t)=>S(n=>I({type:e,[t]:n}));function I(e){if(!u)return void f.push(e);let t=u.dispatch(e);w(),t.forEach(S(x)),(u.active||r.get("q"))&&b(),c?.update()}function L(){return l??(l=document.body.appendChild(document.createElement("playstep-root")).attachShadow({mode:"open"}))}function b(){return d??(d=e().then(e=>{let t=L();return t.innerHTML="",c=e.mount({engine:u,get config(){return o},options:a,root:t,outbox:v,userId:()=>g,dispatch:S(I),emit:S(x)})}).catch($))}let K,j=S((e={})=>{u?u.launcherGuides().length&&b().then(t=>t?.openLauncher(e.anchor)):K=e});function k(e){e.launcher?.enabled&&u.launcherGuides().length&&!d&&t&&t().then(t=>{d||t.drawLauncher(L(),u,e,j,a)}).catch($)}let P=e=>S(()=>{m!==e&&(m=e,u&&(I({type:e?"pause":"resume"}),!d&&(e?l&&(l.innerHTML=""):k(o))))});return{version:"0.7.0",init:S(e=>{if(a||!e?.appKey)return;a={...e},h&&(a.locale=h);let t=()=>setTimeout(()=>async function(){let e=a,t=(e.apiBase??"https://cdn.playstep.app").replace(/\/$/,""),c=null;try{c=new URLSearchParams(location.search).get(i)||(e.config?null:sessionStorage.getItem(i))}catch{}e.preview||(e.preview=!(!e.config&&!c)),p=n=>fetch(`${t}/v2/${c?`preview/${c}?key=${e.appKey}&`:`config/${e.appKey}?`}l=${n}`).then(e=>e.json());let d=e.config;try{d??(d=await p(e.locale??navigator.language??""))}catch{return}try{c&&sessionStorage[d.guides?"setItem":"removeItem"](i,c)}catch{}if(d?.capture)s?.().then(t=>t.start(d.capture,e.appKey)).catch($);else if(d?.guides&&!d.flags?.disabled&&(o=d,e.eventsUrl=d.ingest_url??`${t}/v1/events`,u=n({config:d,progress:e.preview?void 0:r.get(_())??void 0,traits:y}),m&&u.dispatch({type:"pause"}),I({type:"init",path:location.pathname}),f.splice(0).forEach(I),K&&j(K),k(d),!1!==e.autoPageViews)){let e=location.pathname,t=S(()=>location.pathname!==e&&I({type:"page_view",path:e=location.pathname}));for(let e of["pushState","replaceState"]){let n=history[e];history[e]=function(...e){n.apply(this,e),t()}}addEventListener("popstate",t)}}().catch($));"complete"===document.readyState?t():addEventListener("load",t)}),identify:S((e,t)=>{g=e,y={...y,...t},I({type:"identify",traits:y})}),track:E("event","name"),start:E("start","guide"),complete:E("complete","step"),page:S(e=>I({type:"page_view",path:e??location.pathname})),openLauncher:j,resetProgress:E("reset_progress","guide"),reset:S(()=>{I({type:"dismiss"}),g=void 0,y={},u&&(Object.assign(u.progress,{seen:!1,guides:{}}),w(),c?.update()),a?.preview||r.set("d",null)}),pause:P(!0),resume:P(!1),isPaused:()=>m,setLocale:S(e=>{h=e,a&&(a.locale=e),p?.(e).then(t=>{t.guides&&a?.locale==e&&(u.use(o=t),c?.update())}).catch($)})}}(()=>a("ui","sha256-jwKjAeFW5xd9lfgyCVIEToh7IJycIyAi3YoP8cFqr/Y="),u,()=>u().then(e=>a("capture",e.captureIntegrity)));if(!window.playstep){window.playstep=o;let e=s?.dataset;e?.appKey&&o.init({appKey:e.appKey,apiBase:e.api,locale:e.locale})}}();
package/dist/cdn/ui.js CHANGED
@@ -1 +1 @@
1
- var __playstep_ui=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});let t=Math.min,n=Math.max,r=Math.round,i=e=>({x:e,y:e}),o={left:"right",right:"left",bottom:"top",top:"bottom"};function a(e,r,i){return n(e,t(r,i))}function l(e,t){return"function"==typeof e?e(t):e}function s(e){return e.split("-")[0]}function c(e){return e.split("-")[1]}function p(e){return"x"===e?"y":"x"}function d(e){return"y"===e?"height":"width"}function u(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function f(e){return p(u(e))}function _(e,t,n){void 0===n&&(n=!1);let r=c(e),i=f(e),o=d(i),a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=w(a)),[a,w(a)]}function h(e){let t=w(e);return[m(e),t,m(t)]}function m(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let g=["left","right"],x=["right","left"],v=["top","bottom"],y=["bottom","top"];function b(e,t,n,r){let i=c(e),o=function(e,t,n){switch(e){case"top":case"bottom":return n?t?x:g:t?g:x;case"left":case"right":return t?v:y;default:return[]}}(s(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(m)))),o}function w(e){let t=s(e);return o[t]+e.slice(t.length)}function k(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function S(e,t,n){let r,{reference:i,floating:o}=e,a=u(t),l=f(t),p=d(l),_=s(t),h="y"===a,m=i.x+i.width/2-o.width/2,g=i.y+i.height/2-o.height/2,x=i[p]/2-o[p]/2;switch(_){case"top":r={x:m,y:i.y-o.height};break;case"bottom":r={x:m,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:g};break;case"left":r={x:i.x-o.width,y:g};break;default:r={x:i.x,y:i.y}}let v=c(t);return v&&(r[l]+=x*("end"===v?1:-1)*(n&&h?-1:1)),r}async function L(e,t){void 0===t&&(t={});let{x:n,y:r,platform:i,rects:o,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:u=!1,padding:f=0}=l(t,e),_=function(e){return"number"==typeof e?{top:e,right:e,bottom:e,left:e}:function(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}(e)}(f),h=a[u?"floating"===d?"reference":"floating":d],m=k(await i.getClippingRect({element:await(null==i.isElement?void 0:i.isElement(h))??!0?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:p,strategy:s})),g="floating"===d?{x:n,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),v=await(null==i.isElement?void 0:i.isElement(x))&&await(null==i.getScale?void 0:i.getScale(x))||{x:1,y:1},y=k(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:x,strategy:s}):g);return{top:(m.top-y.top+_.top)/v.y,bottom:(y.bottom-m.bottom+_.bottom)/v.y,left:(m.left-y.left+_.left)/v.x,right:(y.right-m.right+_.right)/v.x}}let C=new Set(["left","top"]);async function T(e,t){let{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),a=s(n),p=c(n),d="y"===u(n),f=C.has(a)?-1:1,_=o&&d?-1:1,h=l(t,e),{mainAxis:m,crossAxis:g,alignmentAxis:x}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return p&&"number"==typeof x&&(g="end"===p?-1*x:x),d?{x:g*_,y:m*f}:{x:m*f,y:g*_}}function M(){return typeof window<"u"}function E(e){return $(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function P(e){return(($(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function $(e){return!!M()&&(e instanceof Node||e instanceof R(e).Node)}function A(e){return!!M()&&(e instanceof Element||e instanceof R(e).Element)}function H(e){return!!M()&&(e instanceof HTMLElement||e instanceof R(e).HTMLElement)}function D(e){return!(!M()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof R(e).ShadowRoot)}function F(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function N(e){return/^(table|td|th)$/.test(E(e))}function O(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}let z,W=/transform|translate|scale|rotate|perspective|filter/,U=/paint|layout|strict|content/,B=e=>!!e&&"none"!==e;function I(e){let t=A(e)?q(e):e;return B(t.transform)||B(t.translate)||B(t.scale)||B(t.rotate)||B(t.perspective)||!j()&&(B(t.backdropFilter)||B(t.filter))||W.test(t.willChange||"")||U.test(t.contain||"")}function j(){return z??(z=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),z}function V(e){return/^(html|body|#document)$/.test(E(e))}function q(e){return R(e).getComputedStyle(e)}function K(e){return A(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G(e){if("html"===E(e))return e;let t=e.assignedSlot||e.parentNode||D(e)&&e.host||P(e);return D(t)?t.host:t}function X(e){let t=G(e);return V(t)?(e.ownerDocument||e).body:H(t)&&F(t)?t:X(t)}function Y(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!0);let r=X(e),i=r===e.ownerDocument?.body,o=R(r);if(i){let e=J(o);return t.concat(o,o.visualViewport||[],F(r)?r:[],e&&n?Y(e):[])}return t.concat(r,Y(r,[],n))}function J(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q(e){let t=q(e),n=parseFloat(t.width)||0,i=parseFloat(t.height)||0,o=H(e),a=o?e.offsetWidth:n,l=o?e.offsetHeight:i,s=r(n)!==a||r(i)!==l;return s&&(n=a,i=l),{width:n,height:i,$:s}}function Z(e){return A(e)?e:e.contextElement}function ee(e){let t=Z(e);if(!H(t))return i(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:l}=Q(t),s=(l?r(n.width):n.width)/o,c=(l?r(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}let te=i(0);function ne(e){let t=R(e);return j()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:te}function re(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),a=Z(e),l=i(1);t&&(r?A(r)&&(l=ee(r)):l=ee(e));let s=function(e,t,n){return void 0===t&&(t=!1),!!n&&t&&n===R(e)}(a,n,r)?ne(a):i(0),c=(o.left+s.x)/l.x,p=(o.top+s.y)/l.y,d=o.width/l.x,u=o.height/l.y;if(a&&r){let e=R(a),t=A(r)?R(r):r,n=e,i=J(n);for(;i&&t!==n;){let e=ee(i),t=i.getBoundingClientRect(),r=q(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,p*=e.y,d*=e.x,u*=e.y,c+=o,p+=a,n=R(i),i=J(n)}}return k({width:d,height:u,x:c,y:p})}function ie(e,t){let n=K(e).scrollLeft;return t?t.left+n:re(P(e)).left+n}function oe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ie(e,n),y:n.top+t.scrollTop}}function ae(e){let t=K(e),r=e.ownerDocument.body,i=n(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=n(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),a=-t.scrollLeft+ie(e),l=-t.scrollTop;return"rtl"===q(r).direction&&(a+=n(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:l}}function le(e,t,n){let r;if("viewport"===t||"layoutViewport"===t)r=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,i=R(e),o=P(e),a=i.visualViewport,l=o.clientWidth,s=o.clientHeight,c=0,p=0;if(a){let e=!j()||"fixed"===t;r?e||(c=-a.offsetLeft,p=-a.offsetTop):(l=a.width,s=a.height,e&&(c=a.offsetLeft,p=a.offsetTop))}if(ie(o)<=0){let e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r),a="stable both-edges"===getComputedStyle(o).scrollbarGutter?i/2:i;a<=25&&(l-=a)}return{width:l,height:s,x:c,y:p}}(e,n,t);else if("document"===t)r=ae(P(e));else if(A(t))r=function(e,t){let n=re(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ee(e);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{let n=ne(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return k(r)}function se(e,t){let n=t.get(e);if(n)return n;let r=Y(e,[],!1).filter(e=>A(e)&&"body"!==E(e)),i=null,o="fixed"===q(e).position,a=o?G(e):e;for(;A(a)&&!V(a);){let e=q(a),t=I(a),n=i?i.position:o?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?i=e:r=r.filter(e=>e!==a),a=G(a)}return t.set(e,r),r}function ce(e,t,n){let r=H(t),o=P(t),a="fixed"===n,l=re(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=i(0);if((r||!a)&&(("body"!==E(t)||F(o))&&(s=K(t)),r)){let e=re(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&o&&(c.x=ie(o));let p=!o||r||a?i(0):oe(o,s);return{x:l.left+s.scrollLeft-c.x-p.x,y:l.top+s.scrollTop-c.y-p.y,width:l.width,height:l.height}}function pe(e){return"static"===q(e).position}function de(e,t){if(!H(e)||"fixed"===q(e).position)return null;if(t)return t(e);let n=e.offsetParent;return P(e)===n&&(n=n.ownerDocument.body),n}function ue(e,t){let n=R(e);if(O(e))return n;if(!H(e)){let t=G(e);for(;t&&!V(t);){if(A(t)&&!pe(t))return t;t=G(t)}return n}let r=de(e,t);for(;r&&N(r)&&pe(r);)r=de(r,t);return r&&V(r)&&pe(r)&&!I(r)?n:r||function(e){let t=G(e);for(;H(t)&&!V(t);){if(I(t))return t;if(O(t))return null;t=G(t)}return null}(e)||n}let fe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,a="fixed"===o,l=P(r),s=!!t&&O(t.floating);if(r===l||s&&a)return n;let c={scrollLeft:0,scrollTop:0},p=i(1),d=i(0),u=H(r);if((u||!a)&&(("body"!==E(r)||F(l))&&(c=K(r)),u)){let e=re(r);p=ee(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let f=!l||u||a?i(0):oe(l,c);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-c.scrollLeft*p.x+d.x+f.x,y:n.y*p.y-c.scrollTop*p.y+d.y+f.y}},getDocumentElement:P,getClippingRect:function(e){let{element:r,boundary:i,rootBoundary:o,strategy:a}=e,l=[..."clippingAncestors"===i?O(r)?[]:se(r,this._c):[].concat(i),o],s=le(r,l[0],a),c=s.top,p=s.right,d=s.bottom,u=s.left;for(let e=1;e<l.length;e++){let i=le(r,l[e],a);c=n(i.top,c),p=t(i.right,p),d=t(i.bottom,d),u=n(i.left,u)}return{width:p-u,height:d-c,x:u,y:c}},getOffsetParent:ue,getElementRects:async function(e){let t=this.getOffsetParent||ue,n=this.getDimensions,r=await n(e.floating);return{reference:ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=Q(e);return{width:t,height:n}},getScale:ee,isElement:A,isRTL:function(e){return"rtl"===q(e).direction}},_e=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n;let{x:r,y:i,placement:o,middlewareData:a}=t,l=await T(t,e);return o===a.offset?.placement&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:o}}}}},he=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...f}=l(e,t),_={x:n,y:r},h=await o.detectOverflow(t,f),m=u(i),g=p(m),x=_[g],v=_[m],y=(e,t)=>a(t+h["y"===e?"top":"left"],t,t-h["y"===e?"bottom":"right"]);s&&(x=y(g,x)),c&&(v=y(m,v));let b=d.fn({...t,[g]:x,[m]:v});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[g]:s,[m]:c}}}}}},me=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:c,elements:p}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...y}=l(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};let k=s(r),S=u(a),L=s(a)===a,C=await(null==c.isRTL?void 0:c.isRTL(p.floating)),T=m||(L||!v?[w(a)]:h(a)),M="none"!==x;!m&&M&&T.push(...b(a,v,x,C));let E=[a,...T],R=await c.detectOverflow(t,y),P=[],$=i.flip?.overflows||[];if(d&&P.push(R[k]),f){let e=_(r,o,C);P.push(R[e[0]],R[e[1]])}if($=[...$,{placement:r,overflows:P}],!P.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=E[e];if(t&&("alignment"!==f||S===u(t)||$.every(e=>u(e.placement)!==S||e.overflows[0]>0)))return{data:{index:e,overflows:$},reset:{placement:t}};let n=$.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(g){case"bestFit":{let e=$.filter(e=>{if(M){let t=u(e.placement);return t===S||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},ge=(e,t,n)=>{let r=new Map,i=n??{},o={...fe,...i.platform,_c:r};return(async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:L},s=await(null==a.isRTL?void 0:a.isRTL(t)),c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:d}=S(c,r,s),u=r,f=0,_={};for(let n=0;n<o.length;n++){let h=o[n];if(!h)continue;let{name:m,fn:g}=h,{x:x,y:v,data:y,reset:b}=await g({x:p,y:d,initialPlacement:r,placement:u,strategy:i,middlewareData:_,rects:c,platform:l,elements:{reference:e,floating:t}});p=x??p,d=v??d,_[m]={..._[m],...y},b&&f<50&&(f++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:p,y:d}=S(c,u,s))),n=-1)}return{x:p,y:d,placement:u,strategy:i,middlewareData:_}})(e,t,{...i,platform:o})};var xe,ve,ye,be,we,ke,Se,Le,Ce,Te,Me={},Ee=[],Re=/^m(i|n|o|s|text|space)$/,Pe=Array.isArray,$e=Ee.slice,Ae=Object.assign;function He(e){e&&e.parentNode&&e.remove()}function De(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i||++ve,__i:-1,__u:0};return!i&&xe.vnode&&xe.vnode(o),o}function Fe(e){return e.children}function Ne(e,t){this.props=e,this.context=t,this.__g=0}function Oe(e,t){if(null==t)return e.__?Oe(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return"function"!=typeof e.type||e.props.__P?null:Oe(e)}function ze(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),ze(e)}function We(e){(8&e.__g||!(e.__g|=8)||!ye.push(e)||we++)&&be==xe.debounceRendering||((be=xe.debounceRendering)||queueMicrotask)(Ue)}function Ue(){var e,t,n,r,i,o,a,l,s;try{for(t=1;ye.length;)ye.length>t&&ye.sort(ke),e=ye.shift(),t=ye.length,8&e.__g&&(r=void 0,i=void 0,o=(i=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((r=Ae({constructor:void 0},i)).__v=i.__v+1,xe.vnode&&xe.vnode(r),Ke(s,r,i,n.__n,s.namespaceURI,32&i.__u?[o]:null,a,o||Oe(i),32&i.__u,l),r.__v=i.__v,r.__.__k[r.__i]=r,Xe(a,r,l),i.__=i.__e=null,r.__e!=o&&ze(r)))}finally{ye.length=we=0}}function Be(e,t,n,r,i,o,a,l,s,c,p){var d,u,f,_,h,m,g=r.__k||Ee,x=t.length;for(s=function(e,t,n,r,i){var o,a,l,s,c,p,d,u,f,_,h=n.length,m=h,g=0,x=!1,v=e.__k=Array(i);for(o=0;o<i;o++)null!=(a=t[o])&&"boolean"!=typeof a&&"function"!=typeof a?("object"!=typeof a||a.constructor==String?a=v[o]=De(null,a):Pe(a)?a=v[o]=De(Fe,{children:a}):void 0===a.constructor&&a.__b?a=v[o]=De(a.type,a.props,a.key,a.ref,a.__v):v[o]=a,s=o+g,a.__=e,a.__b=e.__b+1,l=null,~(c=a.__i=je(a,n,s,m))&&(m--,(l=n[c])&&(l.__u|=2)),l&&l.__v?(a.__u|=2,c==s-1?g--:c==s+1?g++:c!=s&&(c>s?g--:g++,x=!0)):(~c||(i>h?g--:i<h&&g++),"function"!=typeof a.type&&(a.__u|=4))):v[o]=null;if(x){for(p=[],d=[],o=0;o<i;o++)if((a=v[o])&&2&a.__u){for(u=0,f=p.length;u<f;)p[_=u+f>>1]<a.__i?u=_+1:f=_;p[u]=a.__i,d[o]=u+1}for(g=p.length;o--;)d[o]&&(d[o]==g?g--:v[o].__u|=4)}if(m)for(o=0;o<h;o++)!(l=n[o])||2&l.__u||(l.__e==r&&(r=Oe(l)),Je(l,l));return r}(n,t,g,s,x),d=0;d<x;d++)null!=(f=n.__k[d])&&(u=~f.__i&&g[f.__i]||Me,f.__i=d,m=Ke(e,f,u,i,o,a,l,s,c,p),_=f.__e,(u.ref!=f.ref||8&u.__u)&&(u.ref&&Ye(u.ref,null,f,u),f.ref&&p.push(f.ref,f.__c||_,f)),h=h||_,4&f.__u?(s=Ie(f,s,e,!u.__v),u.__e&&(u.__e=null)):"function"==typeof f.type&&void 0!==m?s=m:_&&(s=_.nextSibling),f.__u&=-7);return n.__e=h,s}function Ie(e,t,n,r){var i,o,a;if("function"==typeof e.type){if(e.props.__P)return t;if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&(i[o].__=e,t=Ie(i[o],t,n,!1));return t}for(t&&!t.parentNode&&(t=Oe(e))&&!t.parentNode&&(t=null),a=t;a&&8==a.nodeType;)a=a.nextSibling;for(e.__e!=a&&(!r&&n.moveBefore&&e.__e.parentNode?n.moveBefore(e.__e,t):n.insertBefore(e.__e,t||null)),t=e.__e;(t=t&&t.nextSibling)&&8==t.nodeType;);return t}function je(e,t,n,r){var i,o,a,l=e.key,s=e.type,c=t[n],p=c&&!(2&c.__u);if(null===c&&null==l||p&&l==c.key&&s==c.type)return n;if(r>+!!p)for(i=n-1,o=n+1;i>=0||o<t.length;)if((c=t[a=i>=0?i--:o++])&&!(2&c.__u)&&l==c.key&&s==c.type)return a;return-1}function Ve(e,t,n){n??(n=""),"-"==t[0]?e.setProperty(t,n):e[t]=n}function qe(e,t,n,r,i){var o,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ve(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||Ve(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])(e.__e||(e.__e={}))[t]=n,n&&r||(a=Te[t]||(Te[t]=function(e){return function(t){if(this.__e){var n=this.__e[e];if(null==t[Se])t[Se]=Ce++;else if(t[Se]<this.__a[e])return;return n(xe.event?xe.event(t):t)}}}(t)),(e.__a||(e.__a={}))[t]=Ce,o=t!=(t=t.replace(Le,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),n?e.addEventListener(t,a,o):e.removeEventListener(t,a,o));else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=n??"";break e}catch{}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function Ke(e,t,n,r,i,o,a,l,s,c){var p,d,u,f,_,h,m,g,x,v,y,b,w,k,S,L,C,T,M,E,R=t.type;if(void 0!==t.constructor)return null;if(128&n.__u&&(s=32&n.__u,p=n.__c.__z)){if(t.__u|=s,d=o=[],8==p.nodeType)for(u=1,f=p.nextSibling;f;f=f.nextSibling){if(8==f.nodeType)if(f.data.startsWith("$s"))u++;else if(f.data.startsWith("/$s")&&! --u)break;o.push(f)}else o.push(p);l=o[0]}(p=xe.__b)&&p(t);e:if("function"==typeof R){_=a.length;try{if(v=t.props,y=(p=R.prototype)&&p.render,b=(p=R.contextType)&&r[p.__c],w=p?b?b.props.value:p.__:r,n.__c?2&(h=t.__c=n.__c).__g&&(h.__g|=1):(y?t.__c=h=new R(v,w):(t.__c=h=new Ne(v,w),h.constructor=R,h.render=Qe),b&&b.sub(h),h.state||(h.state={}),h.__n=r,h.__g|=8,h.__h=[],h.__k=[]),y&&(h.__s||(h.__s=h.state),R.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=Ae({},h.__s)),Ae(h.__s,R.getDerivedStateFromProps(v,h.__s)))),m=h.props,g=h.state,h.__v=t,n.__c){if(y&&!R.getDerivedStateFromProps&&v!==m&&h.componentWillReceiveProps&&h.componentWillReceiveProps(v,w),t.__v==n.__v&&!(8&h.__g)||!(4&h.__g)&&h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(v,h.__s,w)){t.__v!=n.__v&&(h.props=v,h.state=h.__s,h.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),Ee.push.apply(h.__h,h.__k),h.__k=[],h.__h.length&&a.push(h),l=Oe(n);break e}h.componentWillUpdate&&h.componentWillUpdate(v,h.__s,w),y&&h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(m,g,x)})}else y&&!R.getDerivedStateFromProps&&h.componentWillMount&&h.componentWillMount(),y&&h.componentDidMount&&h.__h.push(h.componentDidMount);if(h.context=w,h.props=v,h.__P=e,h.__g&=-5,k=xe.__r,S=0,y)h.state=h.__s,h.__g&=-9,k&&k(t),p=h.render(h.props,h.state,h.context),Ee.push.apply(h.__h,h.__k),h.__k=[];else do{h.__g&=-9,k&&k(t),p=h.render(h.props,h.state,h.context),h.state=h.__s}while(8&h.__g&&++S<25);h.state=h.__s,h.getChildContext&&(r=Ae({},r,h.getChildContext())),y&&n.__c&&h.getSnapshotBeforeUpdate&&(x=h.getSnapshotBeforeUpdate(m,g)),L=p&&p.type===Fe&&null==p.key?p.props.children:p,v.__P&&(p=l,i=(e=v.__P).namespaceURI,s=o=null,n.props&&n.props.__P!=e&&(n.__k.some(function(e){e&&Je(e,e)}),n.__k=null),l=n.__k?Oe(n,0):null),l=Be(e,Pe(L)?L:[L],t,n,r,i,o,a,l,s,c),v.__P&&(t.__e=null,l=p),t.__u&=-161,128&n.__u&&(h.__z=null),d&&d.some(He),h.__h.length&&a.push(h),1&h.__g&&(h.__g&=-4)}catch(e){if(a.length=_,t.__v=null,s||o)if(e.then){if(C=0,t.__u|=s?160:128,o){for(~(M=o.indexOf(l||void 0))||(M=o.length);(E=o[M-1])&&8==E.nodeType;)M--;for(;M<o.length;M++)if(E=o[M])if(o[M]=null,8==E.nodeType){if(E.data.startsWith("$s"))C++||(T=E);else if(C&&E.data.startsWith("/$s")&&! --C){l=E;break}}else if(!C)break}if(!T){for(;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;T=l}t.__c.__z||(t.__c.__z=T),t.__e=l}else o&&o.some(He);else t.__e=n.__e;t.__k||(t.__k=n.__k||[]),e.then||Ge(t),xe.__e(e,t,n)}}else l=t.__e=function(e,t,n,r,i,o,a,l,s,c){var p,d,u,f,_,h,m,g,x,v=n.props||Me,y=t.props,b=t.type;if("svg"==b?i="http://www.w3.org/2000/svg":"math"==b?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o)for(p=0;p<o.length;p++)if((_=o[p])&&(b?_.localName==b:3==_.nodeType)){e=_,o[p]=null;break}if(!e){if(g=c.ownerDocument||document,!b)return g.createTextNode(y);e=g.createElementNS(i,b,y.is&&y),l&&(xe.__m&&xe.__m(t,o),l=!1),o=null}if(b){if(c="template"==b?e.content:e,o="textarea"==b&&null!=y.defaultValue?null:o&&$e.call(c.childNodes),!l&&o)for(v={},p=0;p<e.attributes.length;p++)v[(_=e.attributes[p]).name]=_.value;for(p in v)_=v[p],"dangerouslySetInnerHTML"==p?u=_:"children"==p||p in y||"value"==p&&"defaultValue"in y||"checked"==p&&"defaultChecked"in y||qe(e,p,null,_,i);for(p in x=1&n.__u,y)_=y[p],"children"==p?f=_:"dangerouslySetInnerHTML"==p?d=_:"value"==p?h=_:"checked"==p?m=_:l&&"function"!=typeof _||!(v[p]!==_||x&&null!=_)||qe(e,p,_,v[p],i);d?(l||u&&(d.__html==u.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[]):(u&&(e.textContent=""),("foreignObject"==b||"http://www.w3.org/1998/Math/MathML"==i&&Re.test(b))&&(i="http://www.w3.org/1999/xhtml"),Be(c,Pe(f)?f:[f],t,n,r,i,o,a,o?o[0]:n.__k&&Oe(n,0),l,s),o&&o.some(He)),l&&"textarea"!=b||(p="value","progress"==b&&null==h?e.removeAttribute(p):null==h||h===e[p]&&("progress"!=b||h)||qe(e,p,h,v[p],i),p="checked",null!=m&&m!=e[p]&&qe(e,p,m,v[p],i))}else v===y||l&&e.data==y||(e.data=y);return e}(n.__e,t,n,r,i,o,a,s,c,e);return(p=xe.diffed)&&p(t),128&t.__u?void 0:l}function Ge(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(Ge))}function Xe(e,t,n){for(var r=0;r<n.length;)Ye(n[r++],n[r++],n[r++]);xe.__c&&xe.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){xe.__e(e,t.__v)}})}function Ye(e,t,n,r){try{"function"==typeof e?t?t.__x=e(t)||1:r&&(r=r.__c||r.__e)&&(t=r.__x)&&(r.__x=null,"function"==typeof t?t():e(null)):e.current=t}catch(e){xe.__e(e,n)}}function Je(e,t,n){var r,i;if(xe.unmount&&xe.unmount(e),!(r=e.ref)||r.current&&r.current!=e.__e||Ye(r,null,t,e),r=e.__c){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){xe.__e(e,t)}r.__P=r.__n=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Je(r[i],t,"function"!=typeof e.type||n&&!e.props.__P);(r=e.__e)&&(n||He(r),r.__e&&(r.__e=null)),e.__e=e.__c=e.__=null}function Qe(e,t,n){return this.constructor(e,n)}xe={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((o=i.constructor)&&o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=8&i.__g),i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=8&i.__g),a)return void(i.__g|=2)}catch(t){e=t,a=0}}throw we=0,e}},ve=0,Ne.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=Ae({},this.state)),"function"==typeof e&&(e=e(Ae({},n),this.props)),e&&(Ae(n,e),this.__v&&(t&&this.__k.push(t),We(this)))},Ne.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),We(this))},Ne.prototype.render=Fe,ye=[],we=0,ke=function(e,t){return e.__v.__b-t.__v.__b},Se=Symbol(),Le=/(PointerCapture)$|Capture$/i,Ce=0,Te={};var Ze,et,tt,nt,rt=Object.is,it=0,ot=[],at=[],lt=xe,st=lt.__b,ct=lt.__r,pt=lt.diffed,dt=lt.__c,ut=lt.unmount,ft=lt.__;function _t(e,t){lt.__h&&lt.__h(et,e,it||t),it=0;var n=et.__H||(et.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ht(e){return it=1,function(e,t){var n=_t(Ze++,2);if(n.t=e,!n.__c&&(n.__=[Ct(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);rt(t,r)||(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=et,!et.__f)){et.__f=!0;var r=et.shouldComponentUpdate;et.shouldComponentUpdate=function(e,t,n){var i=this.__H;if(!i)return!0;var o=!1,a=this.props!=e;if(i.__.some(function(e){e.__N&&(o=!0,rt(e.__[0],e.__N[0])||(a=!0))}),r){var l=r.call(this,e,t,n);return o?l||a:l}return!o||a}}return n.__}(Ct,e)}function mt(e,t){var n=_t(Ze++,3);!lt.__s&&Lt(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,et.__H.__h.push(n))}function gt(e,t){var n=_t(Ze++,4);!lt.__s&&Lt(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,et.__h.push(n))}function xt(e){return it=5,function(e,t){var n=_t(Ze++,7);return Lt(n.__H,t)&&(n.__=e(),n.__H=t),n.__}(function(){return{current:e}},[])}function vt(){var e;do{for(;e=at.shift();)try{kt(e)}catch(t){lt.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=ot.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(kt),t.__h.some(St),t.__h=[]}catch(n){t.__h=[],lt.__e(n,e.__v)}}}while(at.length)}lt.__b=function(e){et=null,st&&st(e)},lt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ft&&ft(e,t)},lt.__r=function(e){ct&&ct(e),Ze=0;var t=(et=e.__c).__H;t&&(tt==et?et.__h=[]:(t.__h.some(kt),t.__h.some(St),Ze=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),tt=et},lt.diffed=function(e){pt&&pt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&wt(ot.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),tt=et=null},lt.__c=function(e,t){t.some(function(e){try{e.__h.some(kt),e.__h=e.__h.filter(function(e){return!e.__||St(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],lt.__e(n,e.__v)}}),dt&&dt(e,t)},lt.unmount=function(e){ut&&ut(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(r){try{if(r.__P&&r.__c){if(void 0===n){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n=n&&n.__c}r.__P=n,wt(at.push(r))}else kt(r)}catch(e){t=e}}),r.__H=void 0,t&&lt.__e(t,r.__v))};var yt="function"==typeof requestAnimationFrame;function bt(e){var t,n=function(){clearTimeout(r),yt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);yt&&(t=requestAnimationFrame(n))}function wt(e){1!=e&&nt==lt.requestAnimationFrame||((nt=lt.requestAnimationFrame)||bt)(vt)}function kt(e){var t=et,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),et=t}function St(e){var t=et;e.__c=e.__(),et=t}function Lt(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!rt(t,e[n])})}function Ct(e,t){return"function"==typeof t?t(e):t}let Tt=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,Mt=e=>"dark"==e||"light"==e?e:void 0;function Et(e,t,n="en"){return e?e[t]??e[t.split("-")[0]]??e[n]??Object.values(e)[0]??"":""}let Rt=e=>{let t=Math.round(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`};function Pt(e){let t=Number.parseInt(e.slice(1),16),n=e=>(e/=255)<=.03928?e/12.92:((e+.055)/1.055)**2.4,r=.2126*n(t>>16&255)+.7152*n(t>>8&255)+.0722*n(255&t);return 1.05/(r+.05)>=(r+.05)/.0595?"#ffffff":"#151823"}let $t={x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',play:'<path d="M5 5a2 2 0 0 1 3-1.7l12 7a2 2 0 0 1 0 3.5l-12 7A2 2 0 0 1 5 19z"/>',"volume-2":'<path d="M11 4.7a.7.7 0 0 0-1.2-.5L6.4 7.6A1.4 1.4 0 0 1 5.4 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.4a1.4 1.4 0 0 1 1 .4l3.4 3.4A.7.7 0 0 0 11 19.3z"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.4 18.4a9 9 0 0 0 0-12.7"/>',"volume-x":'<path d="M11 4.7a.7.7 0 0 0-1.2-.5L6.4 7.6A1.4 1.4 0 0 1 5.4 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.4a1.4 1.4 0 0 1 1 .4l3.4 3.4A.7.7 0 0 0 11 19.3z"/><path d="m16.5 14.5 5-5"/><path d="m16.5 9.5 5 5"/>',check:'<path d="M20 6 9 17l-5-5"/>',"maximize-2":'<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>',"arrow-right":'<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',"rotate-ccw":'<path d="M3 12a9 9 0 1 0 9-9 9.8 9.8 0 0 0-6.7 2.7L3 8"/><path d="M3 3v5h5"/>',"external-link":'<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>',"ps-launcher":'<path d="M12 21a9 9 0 1 0-8-5L3 21l5-.9A9 9 0 0 0 12 21z"/><path d="M10 9v6l5-3z"/>',"ps-level-up":'<path d="M3 21h5v-4h5v-4h5V9"/><path d="M18 9V3l4 2.5L18 8"/>',"ps-guide":'<rect x="4" y="3" width="4" height="18" rx="2"/><path d="M12 5.5v10l7.5-5z"/>'};var At=0;function Ht(e,t,n,r,i,o){t||(t={});var a,l,s=t;if("ref"in s&&"function"!=typeof e)for(l in s={},t)"ref"==l?a=t[l]:s[l]=t[l];var c={type:e,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--At,__i:-1,__u:0};return(i||o)&&(c.__source=i,c.__self=o),xe.vnode&&xe.vnode(c),c}function Dt({name:e}){return Ht("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",dangerouslySetInnerHTML:{__html:$t[e]}})}function Ft(e){try{let t=JSON.parse(sessionStorage.getItem("playstep:clips")??"[]");if(t.includes(e))return!1;sessionStorage.setItem("playstep:clips",JSON.stringify([...t,e].slice(-200)))}catch{}return!0}Array.isArray;let Nt=e=>e.options.locale??navigator.language??"en",Ot=(e,t)=>Et(t.name,Nt(e),t.locale_default)||t.id;function zt({ctx:e,guide:t,index:n,reduced:r,clip:i,big:o,onExpand:a,onDuration:l}){let s=t.steps[n],c=xt(null),[p,d]=ht(!0),[u,f]=ht(!r&&"embed"!==i.source),[_,h]=ht(i.duration_ms??0),m=r=>e.emit({type:r,guide_id:t.id,guide_version:t.version,step_id:s.id,step_index:n,clip_id:"hosted"===i.source?i.clip_id:void 0,clip_source:i.source}),g=e=>Ft(`${e}|${i.url}`)&&m(e);if(mt(()=>{let e=c.current;e&&u&&(e.muted=p,e.play()?.catch(()=>{}))},[u,i.url]),mt(()=>l(u&&"embed"!==i.source?_:0),[_,u]),"embed"===i.source){let t=function(e){try{let t,n=new URL(e),r=n.hostname.replace(/^(www|m)\./,"");if("youtu.be"===r?t=n.pathname.slice(1):"youtube.com"===r&&(t=n.searchParams.get("v")??n.pathname.match(/^\/(?:embed|shorts)\/([\w-]+)/)?.[1]),t)return{src:`https://www.youtube-nocookie.com/embed/${t}?autoplay=1&rel=0`,thumb:`https://i.ytimg.com/vi/${t}/hqdefault.jpg`};if(t="vimeo.com"===r||"player.vimeo.com"===r?n.pathname.match(/(\d{5,})/)?.[1]:null,t)return{src:`https://player.vimeo.com/video/${t}?autoplay=1`}}catch{}return null}(i.url),n=new URL(i.url).hostname.replace(/^www\./,"");return Ht("div",{class:"clip embed",children:u&&t?Ht("iframe",{src:t.src,title:`Video: ${Et(s.title,Nt(e))}`,allow:"autoplay; encrypted-media; picture-in-picture; fullscreen",allowFullScreen:!0}):Ht(Fe,{children:[(i.poster??t?.thumb)&&Ht("img",{src:i.poster??t?.thumb,alt:""}),Ht("button",{class:"play","aria-label":"Play video",onClick:()=>(f(!0),m("clip_played")),children:Ht(Dt,{name:"play"})}),Ht("div",{class:"bar",children:Ht("span",{class:"pill",children:[Ht(Dt,{name:"external-link"}),n,_?` · ${Rt(_)}`:""]})})]})})}return Ht("div",{class:"clip",children:[u?Ht("video",{ref:c,src:i.url,poster:i.poster,muted:p,loop:!0,autoplay:!0,playsInline:!0,preload:"auto","aria-label":`Clip: ${Et(s.title,Nt(e))}`,onLoadedData:()=>g("clip_loaded"),onPlaying:()=>g("clip_played"),onLoadedMetadata:e=>{let t=e.currentTarget.duration;Number.isFinite(t)&&h(1e3*t)}}):Ht(Fe,{children:[i.poster&&Ht("img",{src:i.poster,alt:""}),Ht("button",{class:"play","aria-label":"Play clip",onClick:()=>f(!0),children:Ht(Dt,{name:"play"})})]}),u&&Ht("div",{class:"bar",children:[Ht("span",{class:"pill",children:[Ht(Dt,{name:"play"}),_?`${Rt(_)} loop`:"Loop"]}),Ht("button",{class:"round","aria-label":p?"Unmute clip":"Mute clip",onClick:()=>{d(!p),c.current&&(c.current.muted=!p),p&&m("clip_unmuted")},children:Ht(Dt,{name:p?"volume-x":"volume-2"})}),Ht("button",{class:"round","aria-label":o?"Shrink clip":"Expand clip","aria-pressed":o,onClick:a,children:Ht(Dt,{name:"maximize-2"})})]})]})}function Wt({ctx:e,guide:t,index:n,reduced:r,cardRef:i,style:o}){let a=t.steps[n],l=t.steps.length,[s,c]=ht(!1),[p,d]=ht(0),u=n=>Et(n,Nt(e),t.locale_default),f="next_button"===a.complete_on.type;return mt(()=>{c(!1);let i=t.steps[n+1],o=i?.clip;if(o&&"embed"!==o.source&&!r&&!navigator.connection?.saveData){let r=document.createElement("video");r.preload="auto",r.muted=!0,r.src=o.url,"hosted"===o.source&&Ft(`clip_loaded|${o.url}`)&&e.emit({type:"clip_loaded",guide_id:t.id,guide_version:t.version,step_id:i.id,step_index:n+1,clip_id:o.clip_id,clip_source:"hosted"})}},[t.id,n]),Ht("div",{ref:i,class:"card"+(s?" big":""),style:o,role:"dialog","aria-modal":"false","aria-labelledby":"ps-title","aria-describedby":"ps-text",tabIndex:-1,"data-step":a.id,children:[a.clip&&Ht(zt,{ctx:e,guide:t,index:n,reduced:r,clip:a.clip,big:s,onExpand:()=>c(!s),onDuration:d},a.id),Ht("div",{class:"body",children:[Ht("div",{class:"meta",children:[Ht("span",{children:["Step ",n+1," of ",l," · ",Ot(e,t)]}),Ht("button",{class:"x","aria-label":"Close guide",onClick:()=>e.dispatch({type:"dismiss"}),children:Ht(Dt,{name:"x"})})]}),Ht("div",{class:"steps",role:"img","aria-label":`Step ${n+1} of ${l}`,children:t.steps.map((e,t)=>Ht("span",{class:"seg"+(t<n?" done":t===n?" cur"+(p&&!r?" anim":""):""),style:t===n&&p?{"--d":`${p}ms`}:void 0},t))}),Ht("h2",{class:"title",id:"ps-title",children:u(a.title)}),Ht("p",{class:"text",id:"ps-text",children:u(a.body)})]}),Ht("div",{class:"foot",children:[Ht("span",f?{class:"sp"}:{class:"wait",children:[Ht("span",{class:"pulse","aria-hidden":"true"}),"Waiting for you"]}),n>0&&"page"!==t.steps[n-1].complete_on.type&&!t.steps[n-1].skip_if_on&&Ht("button",{class:"btn gho",onClick:()=>e.dispatch({type:"back"}),children:"Back"}),f&&Ht("button",{class:"btn pri",onClick:()=>e.dispatch({type:"next"}),children:[n+1===l?"Done":"Next",Ht(Dt,{name:"arrow-right"})]})]})]})}let Ut=["width:22px;height:8px;left:22%;top:14px;transform:rotate(-20deg);background:var(--ps-accent)","width:10px;height:10px;left:30%;top:46px;background:var(--ps-spark)","width:12px;height:12px;right:24%;top:10px;background:var(--ps-chart-4)","width:24px;height:8px;right:20%;top:44px;transform:rotate(24deg);background:var(--ps-chart-5)","width:8px;height:8px;left:16%;top:60px;background:var(--ps-chart-5)","width:8px;height:8px;right:30%;top:64px;background:var(--ps-accent)"];function Bt({ctx:e,guide:t}){let n=e.engine.launcherGuides().find(n=>n.id!==t.id&&"done"!==e.engine.progress.guides[n.id]?.status),r=xt(null);return mt(()=>r.current?.focus(),[]),Ht(Fe,{children:[Ht("div",{class:"scrim",onClick:()=>e.dispatch({type:"close"})}),Ht("div",{class:"cel",ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"ps-cel",tabIndex:-1,children:[Ht("div",{class:"art","aria-hidden":"true",children:[Ut.map((e,t)=>Ht("span",{class:"bit",style:e},t)),Ht("span",{class:"tile",children:Ht(Dt,{name:"ps-level-up"})})]}),Ht("h2",{id:"ps-cel",children:"Level cleared"}),Ht("p",{children:["You finished ",Ot(e,t),".",n?` Next up: ${Ot(e,n)}.`:""]}),Ht("div",{class:"acts",children:[Ht("button",{class:"btn sec",onClick:()=>e.dispatch({type:"start",guide:t.id}),children:[Ht(Dt,{name:"rotate-ccw"}),"Replay"]}),Ht("button",n?{class:"btn pri",onClick:()=>e.dispatch({type:"start",guide:n.id}),children:["Next guide",Ht(Dt,{name:"arrow-right"})]}:{class:"btn pri",onClick:()=>e.dispatch({type:"close"}),children:"Done"})]})]})]})}function It({ctx:e,open:t,setOpen:n,near:r}){let i=xt(null);gt(()=>{let e=i.current;e&&(e.style.cssText="",r&&ge(r,e,{strategy:"fixed",placement:"top-start",middleware:[_e(8),me({padding:12}),he({padding:12})]}).then(({x:t,y:n})=>e.style.cssText=`left:${t}px;top:${n}px;right:auto;bottom:auto`))},[t,r]);let o=xt(null);mt(()=>{t?(o.current=e.root.activeElement??document.activeElement,i.current?.focus()):o.current?.focus()},[t]);let a=e.config.launcher,l=e.engine.launcherGuides();if(!l.length)return null;let s=e.engine.progress.guides,c=l.filter(e=>!s[e.id]).length,p="bottom-left"===a?.position?" left":"";return Ht(Fe,{children:[t&&Ht("div",{class:`panel${p}${a?.enabled?"":" solo"}`,ref:i,tabIndex:-1,role:"dialog","aria-label":"Guides",children:[Ht("button",{class:"x","aria-label":"Close guides",onClick:()=>n(!1),children:Ht(Dt,{name:"x"})}),Ht("h2",{children:Et(a?.title,Nt(e))||"Need a hand?"}),Ht("p",{children:Et(a?.description,Nt(e))||"Pick a guide and play it step by step."}),Ht("ul",{class:"rows",children:l.map(t=>{let r=s[t.id],i=t.steps.length,o="done"===r?.status,a="running"===r?.status;return Ht("li",{children:Ht("button",{class:"row",onClick:()=>{n(!1),r&&e.dispatch({type:"reset_progress",guide:t.id}),e.dispatch({type:"start",guide:t.id})},children:[Ht("span",{class:"ti"+(o?" mint":r?"":" spark"),children:Ht(Dt,{name:o?"check":"ps-guide"})}),Ht("span",{class:"rb",children:[Ht("span",{class:"rt",children:Ot(e,t)}),Ht("span",{class:"rm",children:o?"Completed":a?`Step ${r.step+1} of ${i}`:`${i} steps`}),a&&Ht("span",{class:"prog","aria-hidden":"true",children:Ht("i",{style:{width:r.step/i*100+"%"}})})]}),Ht("span",r?{class:"rp",children:[Ht(Dt,{name:"rotate-ccw"}),"Replay"]}:{class:"new",children:"New"})]})},t.id)})}),l.some(e=>s[e.id])&&Ht("div",{class:"acts so",children:Ht("button",{class:"btn gho",onClick:()=>{e.dispatch({type:"reset_progress"}),e.engine.active?n(!1):i.current?.focus()},children:"Start over"})}),!1!==e.config.flags?.show_badge&&Ht("a",{class:"pb",href:"https://playstep.app/?ref=badge",target:"_blank",rel:"noopener",children:[Ht("span",{dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 48 48" aria-hidden="true"><rect width="48" height="48" rx="13" fill="#2E5BFF"/><rect x="11" y="10" width="8" height="28" rx="4" fill="#fff"/><path d="M23.5 12v17l12-8.5z" fill="#FFC933" stroke="#FFC933" stroke-width="3.5" stroke-linejoin="round"/></svg>'},style:"display:inline-flex;width:16px;height:16px"}),"Powered by PlayStep"]})]}),a?.enabled&&Ht("button",{class:`lb${p}`,"aria-label":t?"Close guides":"Open guides","aria-expanded":t,onClick:()=>n(!t),children:[Ht(Dt,{name:"ps-launcher"}),c>0&&!t&&Ht("span",{class:"cnt",children:c})]})]})}let jt=document.currentScript?.src,Vt=e=>!!e?.getClientRects().length;function qt(){if([...document.querySelectorAll('[aria-modal="true"],[role="dialog"],[role="alertdialog"],[role="listbox"],[role="menu"]')].some(Vt))return!0;try{return!!document.querySelector(":popover-open")}catch{return!1}}function Kt(e,t){let n=document.querySelector(`[data-guide="${CSS.escape(e)}"]`);try{n||(n=t?[...document.querySelectorAll(t.css)].find(e=>Vt(e)&&(!t.text||e.innerText.includes(t.text)))??null:null)}catch{}return Vt(n)?n:null}function Gt({ctx:e,guide:t,index:n,reduced:r}){let i=t.steps[n],o=function(e,t,n){let[r,i]=ht(()=>e?Kt(e,t):null);return mt(()=>{if(!e)return i(null);let r=Kt(e,t);i(r);let o=0,a=()=>{o=0;let n=Kt(e,t);n!==r&&i(r=n)},l=new MutationObserver(()=>o||(o=requestAnimationFrame(a)));l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-guide","hidden","style","class"]});let s=setTimeout(()=>!r&&n(e),3e3);return()=>{l.disconnect(),clearTimeout(s),cancelAnimationFrame(o)}},[e,t]),r}(i.anchor,i.find?.web,t=>e.dispatch({type:"anchor_missing",anchor:t})),a=xt(null);mt(()=>{if(!o)return;let t=t=>t.composedPath().includes(o)&&e.dispatch({type:"tap",anchor:i.anchor});return document.addEventListener("click",t,!0),()=>document.removeEventListener("click",t,!0)},[o]);let l=t.theme?.position??"bottom",s=function(e,t,n,r,i){let[o,a]=ht(null);return gt(()=>{let i=t.current;if(!i)return;if(!e){let e=()=>a({x:(innerWidth-i.offsetWidth)/2,y:"center"===r?(innerHeight-i.offsetHeight)/2:innerHeight-i.offsetHeight-24});e();let t=new ResizeObserver(e);return t.observe(i),addEventListener("resize",e),()=>{t.disconnect(),removeEventListener("resize",e)}}let o=e.getBoundingClientRect();(o.bottom<0||o.top>innerHeight)&&e.scrollIntoView({block:"center",behavior:Tt()?"auto":"smooth"});let l=()=>{let t=e.getBoundingClientRect(),r=Number.parseFloat(getComputedStyle(e).borderTopLeftRadius)||8;ge(e,i,{strategy:"fixed",placement:"auto"===n?"bottom":n,middleware:[_e(18),me({fallbackPlacements:["top","left","right"],padding:12}),he({padding:12})]}).then(({x:e,y:n})=>a({x:e,y:n,spot:{x:t.left-6,y:t.top-6,w:t.width+12,h:t.height+12,r:Math.min(r+6,(t.height+12)/2)}}))};l();let s=new ResizeObserver(l);s.observe(e),s.observe(i),addEventListener("scroll",l,{capture:!0,passive:!0}),addEventListener("resize",l);let c=setInterval(l,400);return()=>{s.disconnect(),clearInterval(c),removeEventListener("scroll",l,{capture:!0}),removeEventListener("resize",l)}},[e,r,n,...i]),o}(o,a,i.placement??"auto",l,[i.id]),c=xt("");mt(()=>{s&&c.current!==i.id&&(c.current=i.id,document.activeElement?.matches("input,textarea,select,[contenteditable]:not([contenteditable=false])")||a.current?.focus({preventScroll:!0}))},[i.id,s]);let[p,d]=ht(!1);mt(()=>{s&&!p&&requestAnimationFrame(()=>d(!0))},[s]),mt(()=>{let t=t=>{if("Tab"!==t.key||!a.current)return;let n=[...a.current.querySelectorAll('button,a,iframe,[tabindex="0"]')],r=t.composedPath().includes(a.current),i=n[0],l=n.at(-1),s=e.root.activeElement;r&&!t.shiftKey&&s===l?(t.preventDefault(),(o??i)?.focus()):r&&t.shiftKey&&s===i?(t.preventDefault(),(o??l)?.focus()):o&&document.activeElement===o&&(t.preventDefault(),(t.shiftKey?l:i)?.focus())};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[o]);let u=s?.spot;return Ht(Fe,{children:[o&&u?Ht("div",{class:"spot","aria-hidden":"true",style:{width:`${u.w}px`,height:`${u.h}px`,transform:`translate(${u.x}px,${u.y}px)`,borderRadius:`${u.r}px`}}):!o&&"center"===l&&Ht("div",{class:"scrim","aria-hidden":"true"}),Ht(Wt,{ctx:e,guide:t,index:n,reduced:r,cardRef:a,style:s?{transform:`translate(${Math.round(s.x)}px,${Math.round(s.y)}px)`,transition:p?void 0:"none"}:{visibility:"hidden"}})]})}function Xt({ctx:e,handle:t}){let[,n]=ht(0),r=()=>n(e=>e+1),[i,o]=ht(!1),[a,l]=ht(),s=Tt();t.update=r,t.openLauncher=t=>{let n=document.activeElement;l(t??(n!==document.body&&n!==e.root.host?n??void 0:void 0)),o(!0)},mt(()=>{let t=t=>{if("Escape"!==t.key||t.defaultPrevented||!t.composedPath().includes(e.root.host)||qt())return;let n=e.engine.active;if(i)o(!1);else if("completed"===n?.status)e.dispatch({type:"close"});else if(n){let t=n.guide.steps[n.index],r=t.anchor?Kt(t.anchor,t.find?.web):null;e.dispatch({type:"hide"}),r?.focus({preventScroll:!0})}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[i]),mt(()=>{let e=new MutationObserver(r),t=matchMedia("(prefers-color-scheme: dark)");for(let t of[document.documentElement,document.body])e.observe(t,{attributes:!0});return t.addEventListener("change",r),()=>{e.disconnect(),t.removeEventListener("change",r)}},[]);let c=e.engine.active,p=c?.guide,d=function(e,t,n){let r=Mt(n)??Mt(e.theme?.mode)??Mt(t);return r?"dark"==r:function(){for(let e of[document.documentElement,document.body]){if(!e)continue;let t=getComputedStyle(e).colorScheme,n=/\b(dark|light)\b/.exec(`${e.className} ${Object.values(e.dataset)} ${/^(dark|light)$/.test(t)?t:""}`);if(n)return"dark"==n[1]}}()??matchMedia("(prefers-color-scheme: dark)").matches}(e.config,e.options.colorMode,p?.theme?.mode)?"dark":"light";e.root.host.setAttribute("data-mode",d);let u=e.config.theme,f=p?.theme?.accent,_={};for(let[e,t]of Object.entries({...u?.[d],...p?.theme?.resolved?.[d]??(!u&&f&&{accent:f,"accent-hover":f,"on-accent":Pt(f)})}))_[`--ps-${e}`]=t;let h="running"===c?.status?c.guide.steps[c.index]:void 0;return Ht("div",{class:"l",style:_,children:[Ht(It,{ctx:e,open:i,setOpen:o,near:a}),!i&&"running"===c?.status&&Ht(Gt,{ctx:e,guide:c.guide,index:c.index,reduced:s},c.guide.id),!i&&"completed"===c?.status&&Ht(Bt,{ctx:e,guide:c.guide}),Ht("div",{class:"sr","aria-live":"polite",children:h?`Step ${c.index+1} of ${c.guide.steps.length}: ${Et(h.title,Nt(e))}`:c?"Level cleared":""})]})}return e.findAnchor=Kt,e.hostPopupOpen=qt,e.mount=function(e){let t=e.options,n=t=>{e.outbox.push(t)};new Promise((e,t)=>document.head.append(Object.assign(document.createElement("script"),{src:new URL("events.js",jt||location.href).href,integrity:"sha256-AseK8i2RbqbXQKFUcBWNC4a7ke+Nrh85Kuots5BQdv0=",crossOrigin:"anonymous",onload:()=>e(window.__playstep_events),onerror:()=>t(Error("events"))}))).then(({createTransport:r})=>{let i=r({appKey:t.appKey,url:t.eventsUrl,sdk:t.sdkName??"web",version:"0.5.1",preview:t.preview,userId:e.userId,send:t.transport});e.outbox.splice(0).forEach(i.push),n=i.push}).catch(t=>e.emit({type:"sdk_error",message:String(t)}));let r=document.createElement("style");r.textContent=':host{--ps-radius-md:14px;--ps-radius-lg:20px;--ps-font-display:"Bricolage Grotesque","Figtree",system-ui,sans-serif;--ps-font-sans:"Figtree",system-ui,-apple-system,"Segoe UI",sans-serif;--ps-clip-overlay:rgba(12,14,19,.72);--ps-ease:cubic-bezier(.2,.8,.2,1);--ps-accent:var(--ps-primary);--ps-accent-hover:var(--ps-primary-hover);--ps-on-accent:var(--ps-on-primary);--ps-surface:#fff;--ps-surface-sunken:#f5f6f9;--ps-surface-raised:#fff;--ps-line:#e3e6ec;--ps-ink:#151823;--ps-ink-secondary:#454b5c;--ps-ink-muted:#646b7d;--ps-primary:#2e5bff;--ps-primary-hover:#2149e6;--ps-primary-soft:#e8edff;--ps-primary-ink:#2149e6;--ps-on-primary:#fff;--ps-spark:#ffc933;--ps-spark-soft:#fff4cc;--ps-spark-ink:#7a5a00;--ps-on-spark:#151823;--ps-scrim:rgba(12,14,19,.64);--ps-tag-mint:#ddf5ea;--ps-chart-4:#14b37d;--ps-chart-5:#ff7a59;--ps-shadow-lg:0 20px 48px -12px rgba(21,24,35,.28),0 4px 10px rgba(21,24,35,.06);--ps-ring-focus:0 0 0 2px #fff,0 0 0 4px #2e5bff}:host([data-mode=dark]){--ps-surface:#161922;--ps-surface-sunken:#1d212b;--ps-surface-raised:#222633;--ps-line:#2a2f3c;--ps-ink:#f2f4f8;--ps-ink-secondary:#c5cad5;--ps-ink-muted:#959cad;--ps-primary:#7091ff;--ps-primary-hover:#8da7ff;--ps-primary-soft:#1c2550;--ps-primary-ink:#93abff;--ps-on-primary:#0c0e13;--ps-spark:#ffd452;--ps-spark-soft:#3a2f0a;--ps-spark-ink:#ffd86b;--ps-on-spark:#151823;--ps-scrim:rgba(0,0,0,.72);--ps-tag-mint:#0f2c22;--ps-chart-4:#3dd9a0;--ps-chart-5:#ff9478;--ps-shadow-lg:0 20px 48px -12px rgba(0,0,0,.8),0 4px 10px rgba(0,0,0,.5);--ps-ring-focus:0 0 0 2px #161922,0 0 0 4px #7091ff}:host{all:initial}*{box-sizing:border-box;margin:0}.l{position:fixed;inset:0;pointer-events:none;z-index:2147483000;font:400 14px/20px var(--ps-font-sans);color:var(--ps-ink);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;border:0;padding:0;background:none;cursor:pointer}button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:none;box-shadow:var(--ps-ring-focus)}svg{width:16px;height:16px;flex:none}.scrim{position:fixed;inset:0;background:var(--ps-scrim);pointer-events:auto}.spot,.card{position:fixed;left:0;top:0;transition:transform .36s var(--ps-ease),width .36s var(--ps-ease),height .36s var(--ps-ease)}.spot{box-shadow:0 0 0 9999px var(--ps-scrim)}.spot:after{content:"";position:absolute;inset:-4px;border-radius:18px;border:2px solid var(--ps-spark);animation:ring 1.8s ease-out infinite}.card,.cel,.panel{background:var(--ps-surface-raised);border-radius:var(--ps-radius-lg);box-shadow:var(--ps-shadow-lg);pointer-events:auto;outline:none}.card{width:336px;max-width:calc(100vw - 24px);padding:10px}.big{width:min(720px,calc(100vw - 24px))}.clip{position:relative;aspect-ratio:16/10;border-radius:var(--ps-radius-md);overflow:hidden;background:var(--ps-surface-sunken)}.clip>video,.clip>img,.clip>iframe{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border:0}.bar{position:absolute;left:8px;right:8px;bottom:8px;display:flex;align-items:center;gap:6px;color:#fff}.pill,.round{background:var(--ps-clip-overlay);border-radius:99px;display:inline-flex;align-items:center;justify-content:center}.pill{height:24px;padding:0 8px;gap:4px;font:700 11px/1 var(--ps-font-sans)}.pill svg{width:13px;height:13px}.round{width:28px;height:28px}.round svg{width:14px;height:14px}.bar .round:first-of-type{margin-left:auto}.play{position:absolute;inset:0;margin:auto;width:60px;height:60px;border-radius:50%;background:var(--ps-accent);color:var(--ps-on-accent);display:grid;place-items:center}.play svg{width:26px;height:26px}.body{padding:14px 8px 6px}.meta{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted);margin-bottom:10px}.meta span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.x{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;margin:-6px -6px -6px 0}.x:hover,.gho:hover,.row:hover,.sec:hover{background:var(--ps-surface-sunken);color:var(--ps-ink)}.steps{display:flex;gap:4px;margin-bottom:12px}.seg{flex:1;height:6px;border-radius:99px;background:var(--ps-surface-sunken);overflow:hidden;position:relative}.done{background:var(--ps-accent)}.cur:after{content:"";position:absolute;left:0;top:0;bottom:0;width:55%;border-radius:99px;background:var(--ps-spark)}.anim:after{animation:fill var(--d,4s) linear infinite}.title,.cel h2,.panel h2{font:700 20px/26px var(--ps-font-display);letter-spacing:-.01em;margin-bottom:4px}.text,.cel p{color:var(--ps-ink-secondary)}.foot{display:flex;align-items:center;gap:8px;padding:14px 8px 4px}.wait,.sp{flex:1}.wait{display:flex;align-items:center;gap:8px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted)}.pulse{width:8px;height:8px;border-radius:50%;background:var(--ps-spark);animation:pulse 1.6s ease-out infinite}.btn{height:32px;padding:0 14px;border-radius:var(--ps-radius-btn,99px);border:1px solid transparent;font-size:13px;line-height:18px;font-weight:600;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.pri{background:var(--ps-accent);color:var(--ps-on-accent)}.pri:hover{background:var(--ps-accent-hover)}.x{color:var(--ps-ink-muted)}.gho{color:var(--ps-ink-secondary)}.embed{background:#151823}.sec{background:var(--ps-surface);border-color:var(--ps-line)}.cel{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:336px;max-width:calc(100vw - 24px);padding:24px 20px 20px;text-align:center;overflow:hidden}.cel h2{font-size:24px;line-height:30px;font-weight:800}.cel p{margin-bottom:16px}.art{position:relative;height:72px;margin-bottom:8px}.tile{position:absolute;left:50%;top:4px;width:64px;height:64px;margin-left:-32px;border-radius:var(--ps-radius-lg);background:var(--ps-spark);color:var(--ps-on-spark);display:grid;place-items:center;animation:pop .6s cubic-bezier(.2,1.6,.4,1) both}.tile svg{width:30px;height:30px}.bit{position:absolute;border-radius:99px}.acts{display:flex;justify-content:center;gap:12px}.lb{position:fixed;bottom:24px;right:24px;width:56px;height:56px;border-radius:50%;background:var(--ps-accent);color:var(--ps-on-accent);box-shadow:var(--ps-shadow-lg);display:grid;place-items:center;pointer-events:auto}.lb svg{width:26px;height:26px}.cnt{position:absolute;top:-2px;right:-2px;min-width:20px;height:20px;padding:0 5px;border-radius:99px;background:var(--ps-spark);color:var(--ps-on-spark);font:800 11px/20px var(--ps-font-sans)}.panel{position:fixed;right:24px;bottom:96px;width:320px;max-width:calc(100vw - 36px);max-height:calc(100vh - 120px);overflow:auto;padding:16px}.left{right:auto;left:24px}.solo{bottom:24px}.panel .x{float:right}.panel>p{font-size:13px;line-height:18px;color:var(--ps-ink-muted);margin:-2px 0 12px}.rows{list-style:none;padding:0}.row{display:flex;align-items:center;gap:12px;width:100%;padding:10px;border-radius:var(--ps-radius-md);text-align:left}.ti{width:36px;height:36px;flex:none;border-radius:var(--ps-radius-md);display:grid;place-items:center;background:var(--ps-primary-soft);color:var(--ps-primary-ink)}.ti.spark{background:var(--ps-spark-soft);color:var(--ps-spark-ink)}.ti.mint{background:var(--ps-tag-mint);color:var(--ps-ink)}.ti svg{width:18px;height:18px}.rb{flex:1;min-width:0}.rt,.rm{display:block;font-weight:600}.rm{font-size:12px;line-height:16px;font-weight:500;color:var(--ps-ink-muted)}.prog{display:block;height:6px;border-radius:99px;background:var(--ps-surface-sunken);margin-top:6px;overflow:hidden}.prog i{display:block;height:100%;background:var(--ps-accent)}.rp{display:flex;align-items:center;gap:4px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted)}.so{margin-top:8px}.new{height:24px;padding:0 10px;border-radius:99px;background:var(--ps-spark-soft);color:var(--ps-spark-ink);font-size:12px;line-height:24px;font-weight:600}.pb{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:10px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted);text-decoration:none}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}@keyframes ring{to{opacity:0;transform:scale(1.12)}}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--ps-spark)}70%,to{box-shadow:0 0 0 8px transparent}}@keyframes fill{0%{width:0}to{width:100%}}@keyframes pop{0%{opacity:0;transform:scale(.4) rotate(-12deg)}}@media (max-width:480px){.card{width:300px}.title{font-size:17px;line-height:22px}.lb{right:18px;bottom:18px}.panel{right:18px;bottom:86px}.solo{bottom:18px}.left{right:auto;left:18px}}@media (prefers-reduced-motion:reduce){.spot,.card{transition:none}.spot:after,.pulse,.cur:after,.tile{animation:none}}',e.root.appendChild(r);let i=document.createElement("div");e.root.appendChild(i);let o={update:()=>{},openLauncher:()=>{},send:e=>n(e)};return function(e,t){var n,r,i,o;xe.__&&xe.__(e,t),9==t.nodeType&&(t=t.documentElement),r=(n=e&&32&e.__u)?null:t.__k,t.__k=De(Fe,{children:[e]}),i=[],o=[],Ke(t,t.__k,r||Me,Me,t.namespaceURI,r?null:t.firstChild?$e.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,o),Xe(i,t.__k,o),t.__k.props.children=null}(Ht(Xt,{ctx:e,handle:o}),i),o},e}({});
1
+ var __playstep_ui=function(e){function t(e,t){let i=e=>!!e?.getClientRects().length,a=document.querySelector(`[data-guide="${CSS.escape(e)}"]`);try{a||(a=t?[...document.querySelectorAll(t.css)].find(e=>i(e)&&(!t.text||e.innerText.includes(t.text)))??null:null)}catch{}return i(a)?a:null}Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});let i=e=>"dark"==e||"light"==e?e:void 0;function a(e,t,a){let s=i(a)??i(e.theme?.mode)??i(t);return s?"dark"==s:function(){for(let e of[document.documentElement,document.body]){if(!e)continue;let t=getComputedStyle(e).colorScheme,i=/\b(dark|light)\b/.exec(`${e.className} ${Object.values(e.dataset)} ${/^(dark|light)$/.test(t)?t:""}`);if(i)return"dark"==i[1]}}()??matchMedia("(prefers-color-scheme: dark)").matches}let s=e=>{let t=Math.round(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`},r={x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',play:'<path d="M5 5a2 2 0 0 1 3-1.7l12 7a2 2 0 0 1 0 3.5l-12 7A2 2 0 0 1 5 19z"/>',"volume-2":'<path d="M11 4.7a.7.7 0 0 0-1.2-.5L6.4 7.6A1.4 1.4 0 0 1 5.4 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.4a1.4 1.4 0 0 1 1 .4l3.4 3.4A.7.7 0 0 0 11 19.3z"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.4 18.4a9 9 0 0 0 0-12.7"/>',"volume-x":'<path d="M11 4.7a.7.7 0 0 0-1.2-.5L6.4 7.6A1.4 1.4 0 0 1 5.4 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.4a1.4 1.4 0 0 1 1 .4l3.4 3.4A.7.7 0 0 0 11 19.3z"/><path d="m16.5 14.5 5-5"/><path d="m16.5 9.5 5 5"/>',check:'<path d="M20 6 9 17l-5-5"/>',"maximize-2":'<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>',"arrow-right":'<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',"rotate-ccw":'<path d="M3 12a9 9 0 1 0 9-9 9.8 9.8 0 0 0-6.7 2.7L3 8"/><path d="M3 3v5h5"/>',"external-link":'<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>',"ps-launcher":'<path d="M12 21a9 9 0 1 0-8-5L3 21l5-.9A9 9 0 0 0 12 21z"/><path d="M10 9v6l5-3z"/>',"ps-level-up":'<path d="M3 21h5v-4h5v-4h5V9"/><path d="M18 9V3l4 2.5L18 8"/>',"ps-guide":'<rect x="4" y="3" width="4" height="18" rx="2"/><path d="M12 5.5v10l7.5-5z"/>'};function n(e,t,...i){let a=document.createElement(e);for(let e in t){let i=t[e];if(null!=i&&!1!==i)if("o"==e[0]&&"n"==e[1])a.addEventListener(e.slice(2).toLowerCase(),i);else if("ref"==e)i(a);else if("style"==e)for(let e in i)a.style.setProperty(e,i[e]);else a.setAttribute(e,!0===i?"":String(i))}return o(a,i),a}function o(e,t){for(let i of t)Array.isArray(i)?o(e,i):null!=i&&!1!==i&&e.appendChild("object"==typeof i?i:document.createTextNode(String(i)))}let l=document.createElement("template");function p(e){return l.innerHTML=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${r[e]}</svg>`,l.content.firstChild}let d=(e,...t)=>{e.textContent="",o(e,t)},c=(e,t=e.config.lang)=>(i,a)=>((e,t={})=>e.replace(/\{(\w+)\}/g,(e,i)=>i in t?String(t[i]):e))(e.config.words[t]?.[i]??i,a);function u(e,t,i,a,s,r){(!r||function(e){try{let t=JSON.parse(sessionStorage.getItem("playstep:clips")??"[]");if(t.includes(e))return!1;sessionStorage.setItem("playstep:clips",JSON.stringify([...t,e].slice(-200)))}catch{}return!0}(`${s}|${a.url}`))&&e.emit({type:s,guide_id:t.id,guide_version:t.version,step_id:t.steps[i].id,step_index:i,clip_id:a.clip_id,clip_source:a.source})}function h(e,t,i,a,r,o,l){let h=c(e,t.lang),f=t.steps[i].title,g=n("div",{class:"clip"}),m=!0,b=a.duration_ms??0;if("embed"==a.kind)return g.className="clip embed",d(g,a.poster&&n("img",{src:a.poster,alt:""}),n("button",{class:"play","aria-label":h("play_video"),onClick:()=>{d(g,n("iframe",{src:a.url,title:h("video",{title:f}),allow:"autoplay; encrypted-media; picture-in-picture; fullscreen",allowfullscreen:!0})),u(e,t,i,a,"clip_played")}},p("play")),n("div",{class:"bar"},n("span",{class:"pill"},p("external-link"),a.label,b?` · ${s(b)}`:""))),l(0),g;let x=()=>{let r=n("video",{src:a.url,poster:a.poster,loop:!0,autoplay:!0,playsinline:!0,preload:"auto","aria-label":h("clip",{title:f}),onLoadeddata:()=>u(e,t,i,a,"clip_loaded",!0),onPlaying:()=>u(e,t,i,a,"clip_played",!0),onLoadedmetadata:()=>{Number.isFinite(r.duration)&&(b=1e3*r.duration,c.textContent=`${s(b)} `,l(b))}});r.muted=!0;let c=n("span",null,b?`${s(b)} `:""),x=n("button",{class:"round","aria-label":h("unmute_clip"),onClick:()=>{m=!m,r.muted=m,x.setAttribute("aria-label",h(m?"unmute_clip":"mute_clip")),d(x,p(m?"volume-x":"volume-2")),m||u(e,t,i,a,"clip_unmuted")}},p("volume-x")),v=n("button",{class:"round","aria-label":h("expand_clip"),"aria-pressed":"false",onClick:()=>{let e=o.classList.toggle("big");v.setAttribute("aria-label",h(e?"shrink_clip":"expand_clip")),v.setAttribute("aria-pressed",String(e))}},p("maximize-2"));d(g,r,n("div",{class:"bar"},n("span",{class:"pill"},p("play"),c,h("loop")),x,v)),r.play()?.catch(()=>{}),l(b)};return r?d(g,a.poster&&n("img",{src:a.poster,alt:""}),n("button",{class:"play","aria-label":h("play_clip"),onClick:x},p("play"))):x(),g}function f(e,t,i,a,s){let r=t.steps[i],o=t.steps.length,l=c(e,t.lang),f="next_button"==r.complete_on.type,g=r.media,m=l("step_of",{n:i+1,total:o}),b=t.steps.map((e,t)=>n("span",{class:"seg"+(t<i?" done":t==i?" cur":"")}));s.classList.remove("big"),s.dataset.step=r.id,s.lang=t.lang,t.rtl?s.dir="rtl":s.removeAttribute("dir"),d(s,"image"==g?.kind?n("div",{class:"clip img"},n("img",{src:g.url,alt:g.label??"",width:g.width,height:g.height})):g&&h(e,t,i,g,a,s,e=>{let t=b[i];t.className="seg cur"+(e&&!a?" anim":""),e?t.style.setProperty("--d",`${e}ms`):t.style.removeProperty("--d")}),n("div",{class:"body"},n("div",{class:"meta"},n("span",null,`${m} · ${t.name}`),n("button",{class:"x","aria-label":l("close_guide"),onClick:()=>e.dispatch({type:"dismiss"})},p("x"))),n("div",{class:"steps",role:"img","aria-label":m},b),n("h2",{class:"title",id:"ps-title"},r.title),n("p",{class:"text",id:"ps-text"},r.body)),n("div",{class:"foot"},f?n("span",{class:"sp"}):n("span",{class:"wait"},n("span",{class:"pulse","aria-hidden":"true"}),l("waiting")),r.back&&n("button",{class:"btn gho",onClick:()=>e.dispatch({type:"back"})},l("back")),f&&n("button",{class:"btn pri",onClick:()=>e.dispatch({type:"next"})},l(i+1==o?"done":"next"),p("arrow-right"))));let x=t.steps[i+1]?.media;if(x&&"embed"!=x.kind&&!a&&!navigator.connection?.saveData)if("image"==x.kind)(new Image).src=x.url;else{let a=document.createElement("video");a.preload="auto",a.muted=!0,a.src=x.url,"hosted"==x.source&&u(e,t,i+1,x,"clip_loaded",!0)}}function g(e,t,i,a,s,r=!1,n=12){let o={bottom:e.bottom+s+i<=innerHeight-n,top:e.top-s-i>=n,left:e.left-s-t>=n,right:e.right+s+t<=innerWidth-n},l=a.find(e=>o[e])??a[0],p=(e,t)=>Math.max(n,Math.min(e,t-n));return"top"==l||"bottom"==l?{x:p(r?e.left:e.left+(e.width-t)/2,innerWidth-t),y:"top"==l?e.top-s-i:e.bottom+s}:{x:"left"==l?e.left-s-t:e.right+s,y:p(e.top+(e.height-i)/2,innerHeight-i)}}let m=document.currentScript?.src,b=(e,t,i)=>t?new Promise((i,a)=>document.head.append(Object.assign(document.createElement("script"),{src:new URL(`${e}.js`,m||location.href).href,integrity:t,crossOrigin:"anonymous",onload:()=>i(window[`__playstep_${e}`]),onerror:()=>a(Error(e))}))):i(),x=()=>b("events","sha256-CerIJEpuL4cLDqI43o7a5jOuy0Z8DXYl/ONzSKtoLTo=",()=>import("../core/transport")),v=()=>b("list","sha256-S/G0OwvlP9HcGlohdg39i6K/864ro2QmO7EeWbR6nFQ=",()=>import("./list")),y=()=>b("done","sha256-55mQSPuf9FqiGIbmh9a92hpRupfaw34ACX1xtueSU30=",()=>import("./done"));function w(e,t,i){let a=c(e),s=e.engine.launcherGuides().filter(t=>!e.engine.progress.guides[t.id]).length;t.className="lb"+("bottom-left"==e.config.launcher.position?" left":""),t.setAttribute("aria-label",a(i?"close_guides":"open_guides")),t.setAttribute("aria-expanded",String(i)),d(t,p("ps-launcher"),s>0&&!i&&n("span",{class:"cnt"},s))}let k=(e,t,i,a)=>(e.addEventListener(t,i,a),()=>e.removeEventListener(t,i,a));function _(e,i,a){let s,r,o=n("div",{class:"card",role:"dialog","aria-modal":"false","aria-labelledby":"ps-title","aria-describedby":"ps-text",tabindex:"-1",style:{visibility:"hidden"}}),l=n("div",{class:"spot","aria-hidden":"true"}),p=n("div",{class:"scrim","aria-hidden":"true"}),d=!1,c=!1,u=-1,h=null,m=[],b=[],x=[],v=!1,y="",w="",_=e=>e.splice(0).forEach(e=>e()),M=()=>s.steps[u];function S(e,t,i){o.style.transform=`translate(${Math.round(e)}px,${Math.round(t)}px)`,o.style.visibility="",v||(o.style.transition="none",requestAnimationFrame(()=>(v=!0,o.style.transition=""))),d!=!(!h||!i)&&(d=!d,a()),h&&i&&Object.assign(l.style,{width:`${i.w}px`,height:`${i.h}px`,transform:`translate(${i.x}px,${i.y}px)`,borderRadius:`${i.r}px`}),y!=M().id&&(y=M().id,document.activeElement?.matches("input,textarea,select,[contenteditable]:not([contenteditable=false])")||o.focus({preventScroll:!0}))}function $(){_(x);let e=o;if(c!=(!h&&"center"==s.position)&&(c=!c,a()),!h){let t=()=>S((innerWidth-e.offsetWidth)/2,"center"==s.position?(innerHeight-e.offsetHeight)/2:innerHeight-e.offsetHeight-24);t();let i=new ResizeObserver(t);return i.observe(e),void x.push(()=>i.disconnect(),k(window,"resize",t))}let t=h,r=t.getBoundingClientRect();(r.bottom<0||r.top>innerHeight)&&t.scrollIntoView({block:"center",behavior:i?"auto":"smooth"});let n=()=>{let i=t.getBoundingClientRect(),a=Number.parseFloat(getComputedStyle(t).borderTopLeftRadius)||8,s=M().placement,{x:r,y:n}=g(i,e.offsetWidth,e.offsetHeight,["auto"==s?"bottom":s,"top","left","right"],18);S(r,n,{x:i.left-6,y:i.top-6,w:i.width+12,h:i.height+12,r:Math.min(a+6,(i.height+12)/2)})};n();let l=new ResizeObserver(n);l.observe(t),l.observe(e);let p=setInterval(n,400);x.push(()=>l.disconnect(),()=>clearInterval(p),k(window,"scroll",n,{capture:!0,passive:!0}),k(window,"resize",n))}function C(i){h=i,_(b),clearTimeout(r);let a=M();if(i)b.push(k(document,"click",t=>{t.composedPath().includes(i)&&(w="",e.dispatch({type:"tap",anchor:a.anchor}))},!0)),i==t(a.anchor,a.find?.web)&&(w=a.id);else if(w==a.id){let i=u;r=setTimeout(()=>{for(let a=i;a--;){let r=s.steps[a];if(!r.anchor||"page"==r.complete_on.type)return;if(t(r.anchor,r.find?.web)){for(let t=i;t-- >a;)e.dispatch({type:"back"});return}}},400)}b.push(k(document,"keydown",t=>{if("Tab"!=t.key)return;let a=[...o.querySelectorAll('button,a,iframe,[tabindex="0"]')],s=t.composedPath().includes(o),r=a[0],n=a.at(-1),l=e.root.activeElement;s&&!t.shiftKey&&l==n?(t.preventDefault(),(i??r)?.focus()):s&&t.shiftKey&&l==r?(t.preventDefault(),(i??n)?.focus()):i&&document.activeElement==i&&(t.preventDefault(),(t.shiftKey?n:r)?.focus())},!0)),$()}function A(){_(m);let i=M(),a=i.anchor?t(i.anchor,i.find?.web):null;if(C(a),!i.anchor)return;let s=0,r=()=>{s=0;let e=t(i.anchor,i.find?.web);e!=a&&C(a=e)},n=new MutationObserver(()=>s||(s=requestAnimationFrame(r)));n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-guide","hidden","style","class"]});let o=setTimeout(()=>!a&&e.dispatch({type:"anchor_missing",anchor:i.anchor}),3e3);m.push(()=>n.disconnect(),()=>clearTimeout(o),()=>cancelAnimationFrame(s))}return{nodes:()=>[d&&l,c&&p,o],get guide(){return s},update(t,a){if(t==s&&a==u)return;let r=!s||a!=u||t.steps[a]?.id!=M().id;s=t,u=a,f(e,t,a,i,o),r?A():$()},stop(){_(m),_(b),_(x),clearTimeout(r)}}}return e.fillEl=d,e.h=n,e.icon=p,e.mount=function(e){let i=e.options,s=t=>{e.outbox.push(t)};x().then(({createTransport:t})=>{let a=t({appKey:i.appKey,url:i.eventsUrl,sdk:i.sdkName??"web",version:"0.7.0",preview:i.preview,userId:e.userId,locale:()=>(e=>e.options.locale??navigator.language??"en")(e),send:i.transport});e.outbox.splice(0).forEach(a.push),s=a.push}).catch(t=>e.emit({type:"sdk_error",message:String(t)}));let r=e.root;r.appendChild(n("style",null,':host{--ps-radius-md:14px;--ps-radius-lg:20px;--ps-font-display:"Bricolage Grotesque","Figtree",system-ui,sans-serif;--ps-font-sans:"Figtree",system-ui,-apple-system,"Segoe UI",sans-serif;--ps-clip-overlay:rgba(12,14,19,.72);--ps-ease:cubic-bezier(.2,.8,.2,1);--ps-accent:var(--ps-primary);--ps-accent-hover:var(--ps-primary-hover);--ps-on-accent:var(--ps-on-primary);--ps-surface:#fff;--ps-surface-sunken:#f5f6f9;--ps-surface-raised:#fff;--ps-line:#e3e6ec;--ps-ink:#151823;--ps-ink-secondary:#454b5c;--ps-ink-muted:#646b7d;--ps-primary:#2e5bff;--ps-primary-hover:#2149e6;--ps-primary-soft:#e8edff;--ps-primary-ink:#2149e6;--ps-on-primary:#fff;--ps-spark:#ffc933;--ps-spark-soft:#fff4cc;--ps-spark-ink:#7a5a00;--ps-on-spark:#151823;--ps-scrim:rgba(12,14,19,.64);--ps-tag-mint:#ddf5ea;--ps-chart-4:#14b37d;--ps-chart-5:#ff7a59;--ps-shadow-lg:0 20px 48px -12px rgba(21,24,35,.28),0 4px 10px rgba(21,24,35,.06);--ps-ring-focus:0 0 0 2px #fff,0 0 0 4px #2e5bff}:host([data-mode=dark]){--ps-surface:#161922;--ps-surface-sunken:#1d212b;--ps-surface-raised:#222633;--ps-line:#2a2f3c;--ps-ink:#f2f4f8;--ps-ink-secondary:#c5cad5;--ps-ink-muted:#959cad;--ps-primary:#7091ff;--ps-primary-hover:#8da7ff;--ps-primary-soft:#1c2550;--ps-primary-ink:#93abff;--ps-on-primary:#0c0e13;--ps-spark:#ffd452;--ps-spark-soft:#3a2f0a;--ps-spark-ink:#ffd86b;--ps-on-spark:#151823;--ps-scrim:rgba(0,0,0,.72);--ps-tag-mint:#0f2c22;--ps-chart-4:#3dd9a0;--ps-chart-5:#ff9478;--ps-shadow-lg:0 20px 48px -12px rgba(0,0,0,.8),0 4px 10px rgba(0,0,0,.5);--ps-ring-focus:0 0 0 2px #161922,0 0 0 4px #7091ff}:host{all:initial}*{box-sizing:border-box;margin:0}.l{position:fixed;inset:0;pointer-events:none;z-index:2147483000;font:400 14px/20px var(--ps-font-sans);color:var(--ps-ink);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;border:0;padding:0;background:none;cursor:pointer}button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:none;box-shadow:var(--ps-ring-focus)}svg{width:16px;height:16px;flex:none}.scrim{position:fixed;inset:0;background:var(--ps-scrim);pointer-events:auto}.spot,.card{position:fixed;left:0;top:0;transition:transform .36s var(--ps-ease),width .36s var(--ps-ease),height .36s var(--ps-ease)}.spot{box-shadow:0 0 0 9999px var(--ps-scrim)}.spot:after{content:"";position:absolute;inset:-4px;border-radius:18px;border:2px solid var(--ps-spark);animation:ring 1.8s ease-out infinite}.card,.cel,.panel{background:var(--ps-surface-raised);border-radius:var(--ps-radius-lg);box-shadow:var(--ps-shadow-lg);pointer-events:auto;outline:none}.card{width:336px;max-width:calc(100vw - 24px);padding:10px}.big{width:min(720px,calc(100vw - 24px))}.clip{position:relative;aspect-ratio:16/10;border-radius:var(--ps-radius-md);overflow:hidden;background:var(--ps-surface-sunken)}.clip>video,.clip>img,.clip>iframe{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border:0}.bar{position:absolute;left:8px;right:8px;bottom:8px;display:flex;align-items:center;gap:6px;color:#fff}.pill,.round{background:var(--ps-clip-overlay);border-radius:99px;display:inline-flex;align-items:center;justify-content:center}.pill{height:24px;padding:0 8px;gap:4px;font:700 11px/1 var(--ps-font-sans)}.pill svg{width:13px;height:13px}.round{width:28px;height:28px}.round svg{width:14px;height:14px}.bar .round:first-of-type{margin-inline-start:auto}[dir=rtl] .btn svg{transform:scaleX(-1)}.img>img{object-fit:contain}.play{position:absolute;inset:0;margin:auto;width:60px;height:60px;border-radius:50%;background:var(--ps-accent);color:var(--ps-on-accent);display:grid;place-items:center}.play svg{width:26px;height:26px}.body{padding:14px 8px 6px}.meta{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted);margin-bottom:10px}.meta span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.x{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;margin:-6px -6px -6px 0}.x:hover,.gho:hover,.row:hover,.sec:hover{background:var(--ps-surface-sunken);color:var(--ps-ink)}.steps{display:flex;gap:4px;margin-bottom:12px}.seg{flex:1;height:6px;border-radius:99px;background:var(--ps-surface-sunken);overflow:hidden;position:relative}.done{background:var(--ps-accent)}.cur:after{content:"";position:absolute;left:0;top:0;bottom:0;width:55%;border-radius:99px;background:var(--ps-spark)}.anim:after{animation:fill var(--d,4s) linear infinite}.title,.cel h2,.panel h2{font:700 20px/26px var(--ps-font-display);letter-spacing:-.01em;margin-bottom:4px}.text,.cel p{color:var(--ps-ink-secondary)}.foot{display:flex;align-items:center;gap:8px;padding:14px 8px 4px}.wait,.sp{flex:1}.wait{display:flex;align-items:center;gap:8px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted)}.pulse{width:8px;height:8px;border-radius:50%;background:var(--ps-spark);animation:pulse 1.6s ease-out infinite}.btn{height:32px;padding:0 14px;border-radius:var(--ps-radius-btn,99px);border:1px solid transparent;font-size:13px;line-height:18px;font-weight:600;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.pri{background:var(--ps-accent);color:var(--ps-on-accent)}.pri:hover{background:var(--ps-accent-hover)}.x{color:var(--ps-ink-muted)}.gho{color:var(--ps-ink-secondary)}.embed{background:#151823}.sec{background:var(--ps-surface);border-color:var(--ps-line)}.acts{display:flex;justify-content:center;gap:12px}.lb{position:fixed;bottom:24px;right:24px;width:56px;height:56px;border-radius:50%;background:var(--ps-accent);color:var(--ps-on-accent);box-shadow:var(--ps-shadow-lg);display:grid;place-items:center;pointer-events:auto}.lb svg{width:26px;height:26px}.cnt{position:absolute;top:-2px;right:-2px;min-width:20px;height:20px;padding:0 5px;border-radius:99px;background:var(--ps-spark);color:var(--ps-on-spark);font:800 11px/20px var(--ps-font-sans)}.left{right:auto;left:24px}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}@keyframes ring{to{opacity:0;transform:scale(1.12)}}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--ps-spark)}70%,to{box-shadow:0 0 0 8px transparent}}@keyframes fill{0%{width:0}to{width:100%}}@media (max-width:480px){.card{width:300px}.title{font-size:17px;line-height:22px}.lb{right:18px;bottom:18px}.left{right:auto;left:18px}}@media (prefers-reduced-motion:reduce){.spot,.card{transition:none}.spot:after,.pulse,.cur:after,.tile{animation:none}}'));let o,l,p,d,u,h,f,m,b=r.appendChild(n("div",{class:"l"})),M=n("div",{class:"sr","aria-live":"polite"}),S=!1,$=null,C=n("button",{onClick:()=>H(!S)}),A=t=>e.emit({type:"sdk_error",message:String(t)}),E=()=>u??(u=v().then(e=>(p=e,r.appendChild(n("style",null,e.css)),N())).catch(A)),L=()=>h??(h=y().then(e=>(d=e,r.appendChild(n("style",null,e.css)),N())).catch(A)),z=[],O=()=>[M],H=e=>{S=e,N()};function j(e){let t=e.filter(Boolean);for(t.forEach((e,t)=>b.childNodes[t]!=e&&b.insertBefore(e,b.childNodes[t]??null));b.childNodes.length>t.length;)b.lastChild.remove()}function N(){let t=e.engine.active,s=t?.guide,u=a(e.config,i.colorMode,s?.mode)?"dark":"light";r.host.setAttribute("data-mode",u),b.removeAttribute("style");for(let[t,i]of Object.entries({...e.config.theme?.[u],...s?.tokens?.[u]}))b.style.setProperty(`--ps-${t}`,i);let h=e.engine.launcherGuides().length>0,x=!!l;S&&h&&p?(l??(l=n("div",{tabindex:"-1",role:"dialog"})),p.drawList(e,l,()=>H(!1))):(l=void 0,S&&h&&E()),h&&w(e,C,S),S||"running"!=t?.status?(f?.stop(),f=void 0):f?.guide?.id!=s.id&&(f?.stop(),f=_(e,matchMedia("(prefers-reduced-motion: reduce)").matches,()=>j(O()))),"running"==t?.status&&t.index==s.steps.length-1&&L();let v=!S&&"completed"==t?.status&&!!d;!S&&"completed"==t?.status&&!d&&L();let y=v&&(m!=s||!z.length);if(v?y&&(z=d.drawDone(e,s)):z=[],m=v?s:void 0,M.textContent=t?"running"==t.status?`${c(e,s.lang)("step_of",{n:t.index+1,total:s.steps.length})}: ${s.steps[t.index].title}`:c(e,s.lang)("level_cleared"):"",O=()=>[l,h&&e.config.launcher.enabled&&C,...f?.nodes()??[],...z,M],j(O()),f?.update(s,t.index),l&&!x){if($=r.activeElement??document.activeElement,o){let{x:e,y:t}=g(o.getBoundingClientRect(),l.offsetWidth,l.offsetHeight,["top","bottom"],8,!0);l.style.cssText=`left:${e}px;top:${t}px;right:auto;bottom:auto`}l.focus()}else!l&&x&&$?.focus();y&&z[1]?.focus()}k(window,"keydown",i=>{if("Escape"!=i.key||i.defaultPrevented||!i.composedPath().includes(r.host))return;let a=e.engine.active;if(S)H(!1);else if("completed"==a?.status)e.dispatch({type:"close"});else{if(!a)return;{let i=a.guide.steps[a.index],s=i.anchor?t(i.anchor,i.find?.web):null;e.dispatch({type:"hide"}),s?.focus({preventScroll:!0})}}i.preventDefault(),i.stopPropagation()},!0);let P=new MutationObserver(()=>N());for(let e of[document.documentElement,document.body])P.observe(e,{attributes:!0});return k(matchMedia("(prefers-color-scheme: dark)"),"change",()=>N()),N(),{update:()=>{e.engine.launcherGuides().length||(S=!1),N()},openLauncher:e=>{let t=document.activeElement;o=e??(t!=document.body&&t!=r.host?t??void 0:void 0),H(!0)},send:e=>s(e)}},e.words=c,e}({});
@@ -0,0 +1 @@
1
+ import{h as e,icon as t,words as n}from"./ui-uhppJh4o.js";const r=`.cel{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:336px;max-width:calc(100vw - 24px);padding:24px 20px 20px;text-align:center;overflow:hidden}.cel h2{font-size:24px;line-height:30px;font-weight:800}.cel p{margin-bottom:16px}.art{position:relative;height:72px;margin-bottom:8px}.tile{position:absolute;left:50%;top:4px;width:64px;height:64px;margin-left:-32px;border-radius:var(--ps-radius-lg);background:var(--ps-spark);color:var(--ps-on-spark);display:grid;place-items:center;animation:pop .6s cubic-bezier(.2,1.6,.4,1) both}.tile svg{width:30px;height:30px}.art i{position:absolute;border-radius:99px}.art i:nth-child(1){width:22px;height:8px;left:22%;top:14px;transform:rotate(-20deg);background:var(--ps-accent)}.art i:nth-child(2){width:10px;height:10px;left:30%;top:46px;background:var(--ps-spark)}.art i:nth-child(3){width:12px;height:12px;right:24%;top:10px;background:var(--ps-chart-4)}.art i:nth-child(4){width:24px;height:8px;right:20%;top:44px;transform:rotate(24deg);background:var(--ps-chart-5)}.art i:nth-child(5){width:8px;height:8px;left:16%;top:60px;background:var(--ps-chart-5)}.art i:nth-child(6){width:8px;height:8px;right:30%;top:64px;background:var(--ps-accent)}@keyframes pop{0%{opacity:0;transform:scale(.4) rotate(-12deg)}}`;function i(r,i){let a=r.engine.launcherGuides().find(e=>e.id!=i.id&&r.engine.progress.guides[e.id]?.status!=`done`),o=n(r,i.lang),s=e(`div`,{class:`cel`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`ps-cel`,tabindex:`-1`,lang:i.lang,dir:i.rtl&&`rtl`},e(`div`,{class:`art`,"aria-hidden":`true`},[1,2,3,4,5,6].map(()=>e(`i`)),e(`span`,{class:`tile`},t(`ps-level-up`))),e(`h2`,{id:`ps-cel`},o(`level_cleared`)),e(`p`,null,o(`finished`,{guide:i.name}),a?` ${o(`next_up`,{guide:a.name})}`:``),e(`div`,{class:`acts`},e(`button`,{class:`btn sec`,onClick:()=>r.dispatch({type:`start`,guide:i.id})},t(`rotate-ccw`),o(`replay`)),a?e(`button`,{class:`btn pri`,onClick:()=>r.dispatch({type:`start`,guide:a.id})},o(`next_guide`),t(`arrow-right`)):e(`button`,{class:`btn pri`,onClick:()=>r.dispatch({type:`close`})},o(`done`))));return[e(`div`,{class:`scrim`,onClick:()=>r.dispatch({type:`close`})}),s]}export{r as css,i as drawDone};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
+ //#region ../spec/src/strings.d.ts
2
+ /** Every word the SDK UI shows. `{n}`, `{total}`, `{guide}` and `{title}` are filled in by the SDK. */
3
+ declare const UI_STRING_KEYS: readonly ["next", "back", "done", "close_guide", "step_of", "waiting", "level_cleared", "finished", "next_up", "replay", "next_guide", "guides", "open_guides", "close_guides", "need_a_hand", "pick_a_guide", "completed", "n_steps", "new", "start_over", "video", "play_video", "clip", "play_clip", "loop", "mute_clip", "unmute_clip", "expand_clip", "shrink_clip"];
4
+ type UiStringKey = (typeof UI_STRING_KEYS)[number];
5
+ //#endregion
1
6
  //#region ../spec/src/types.d.ts
2
- type Platform = 'web' | 'flutter' | 'react-native';
3
- type LocalizedText = Record<string, string>;
4
7
  interface ClipBase {
5
8
  poster?: string;
6
9
  duration_ms?: number;
@@ -43,17 +46,6 @@ interface Find {
43
46
  value: string;
44
47
  };
45
48
  }
46
- interface Step {
47
- id: string;
48
- anchor?: string;
49
- find?: Find;
50
- title: LocalizedText;
51
- body: LocalizedText;
52
- clip?: Clip;
53
- complete_on: CompleteOn;
54
- skip_if_on?: string;
55
- placement: 'auto' | 'top' | 'bottom' | 'left' | 'right';
56
- }
57
49
  type Trigger = {
58
50
  type: 'first_visit';
59
51
  once: boolean;
@@ -110,58 +102,17 @@ interface ResolvedTheme {
110
102
  display?: string;
111
103
  };
112
104
  }
113
- interface Guide {
114
- spec_version: 1 | 2 | 3;
115
- id: string;
116
- version: number;
117
- name?: LocalizedText;
118
- locale_default: string;
119
- trigger: Trigger;
120
- targeting: {
121
- platforms: Platform[];
122
- segments: SegmentRule[];
123
- };
124
- theme: {
125
- accent?: string;
126
- position: 'bottom' | 'center';
127
- mode: ColorMode;
128
- resolved?: {
129
- light: ThemeTokens;
130
- dark: ThemeTokens;
131
- };
132
- };
133
- launcher: boolean;
134
- steps: Step[];
135
- }
136
105
  interface ConfigFlags {
137
106
  disabled: boolean;
138
107
  paused_for_new_users: boolean;
139
108
  show_badge: boolean;
140
109
  }
141
- interface LauncherConfig {
142
- enabled: boolean;
143
- position: 'bottom-right' | 'bottom-left';
144
- title?: LocalizedText;
145
- description?: LocalizedText;
146
- }
147
110
  /** Capture links (Generate with AI): where the capture panel sends screens. */
148
111
  interface CaptureConfig {
149
112
  endpoint: string;
150
113
  expires_at: string;
151
114
  max_screens: number;
152
115
  }
153
- interface AppConfig {
154
- spec_version: 1;
155
- app_id: string;
156
- env: 'dev' | 'prod';
157
- generated_at: string;
158
- ingest_url?: string;
159
- flags: ConfigFlags;
160
- launcher: LauncherConfig;
161
- guides: Guide[];
162
- capture?: CaptureConfig;
163
- theme?: ResolvedTheme;
164
- }
165
116
  type EventType = 'guide_shown' | 'step_shown' | 'step_completed' | 'clip_loaded' | 'clip_played' | 'clip_unmuted' | 'guide_completed' | 'guide_dismissed' | 'anchor_missing' | 'sdk_error' | 'progress_reset';
166
117
  interface AnalyticsEvent {
167
118
  /** Random per event, so a batch delivered twice counts once. */
@@ -177,6 +128,80 @@ interface AnalyticsEvent {
177
128
  clip_source?: ClipSource;
178
129
  message?: string;
179
130
  }
131
+ /** A step's clip or image, ready to draw. */
132
+ interface RenderedMedia {
133
+ /** `video`: a muted looping <video>; `embed`: a click-to-load player (`url` is the player); `image`. */
134
+ kind: 'video' | 'embed' | 'image';
135
+ url: string;
136
+ poster?: string;
137
+ duration_ms?: number;
138
+ /** For clip events. */
139
+ source?: ClipSource;
140
+ clip_id?: string;
141
+ /** `embed`: the site it plays from; `image`: its description for screen readers. */
142
+ label?: string;
143
+ width?: number;
144
+ height?: number;
145
+ }
146
+ interface RenderedStep {
147
+ id: string;
148
+ anchor?: string;
149
+ find?: Find;
150
+ title: string;
151
+ body: string;
152
+ media?: RenderedMedia;
153
+ complete_on: CompleteOn;
154
+ skip_if_on?: string;
155
+ placement: 'auto' | 'top' | 'bottom' | 'left' | 'right';
156
+ /** Show Back on this step. */
157
+ back?: true;
158
+ }
159
+ interface RenderedGuide {
160
+ id: string;
161
+ version: number;
162
+ name: string;
163
+ /** The language it shows in: a key of the config's `words`. */
164
+ lang: string;
165
+ rtl?: true;
166
+ trigger: Trigger;
167
+ segments?: SegmentRule[];
168
+ launcher: boolean;
169
+ /** Where the card sits for steps without an anchor. */
170
+ position: 'bottom' | 'center';
171
+ /** Always this mode, whatever the app does. */
172
+ mode?: 'light' | 'dark';
173
+ /** Its own accent's tokens, over the brand kit's. */
174
+ tokens?: {
175
+ light: ThemeTokens;
176
+ dark: ThemeTokens;
177
+ };
178
+ steps: RenderedStep[];
179
+ }
180
+ /** The guide UI's own words in one language, every one filled. */
181
+ type Words = Record<UiStringKey, string>;
182
+ interface RenderedConfig {
183
+ /** The render protocol it was made for (RENDER_PROTOCOL). */
184
+ render: number;
185
+ app_id: string;
186
+ env: 'dev' | 'prod';
187
+ generated_at: string;
188
+ ingest_url?: string;
189
+ flags: ConfigFlags;
190
+ /** The guide list's language. */
191
+ lang: string;
192
+ rtl?: true;
193
+ /** Per language used: the list's and each guide's. */
194
+ words: Record<string, Words>;
195
+ launcher: {
196
+ enabled: boolean;
197
+ position: 'bottom-right' | 'bottom-left';
198
+ title: string;
199
+ description: string;
200
+ };
201
+ theme?: ResolvedTheme;
202
+ guides: RenderedGuide[];
203
+ capture?: CaptureConfig;
204
+ }
180
205
  //#endregion
181
206
  //#region src/core/engine.d.ts
182
207
  type Traits = Record<string, unknown>;
@@ -195,12 +220,15 @@ interface InitOptions {
195
220
  appKey: string;
196
221
  /** Where configs and events live. Defaults to https://cdn.playstep.app. */
197
222
  apiBase?: string;
198
- /** Defaults to the browser language. */
223
+ /**
224
+ * The language to show guides in, like `fr` or `pt-BR`. Defaults to the browser language. A guide without that
225
+ * language shows in its default one. Change it later with setLocale().
226
+ */
199
227
  locale?: string;
200
228
  /** Send page views for client-side navigation automatically. Default true. */
201
229
  autoPageViews?: boolean;
202
230
  /** Use this config instead of fetching one (dashboard previews and tests). Nothing is metered. */
203
- config?: AppConfig;
231
+ config?: RenderedConfig;
204
232
  /** Preview mode: nothing is metered. Set automatically by `?playstep_preview=` links. */
205
233
  preview?: boolean;
206
234
  /** Called for every analytics event, so you can pipe guide events into your own analytics. */
@@ -247,11 +275,28 @@ interface PlayStep {
247
275
  * the current page straight away. Emits `progress_reset`.
248
276
  */
249
277
  resetProgress: (guideId?: string) => void;
250
- /** Forgets the user and their guide progress on this device (call on sign-out). */
278
+ /**
279
+ * Forgets the user and their guide progress on this device (call on sign-out). It does not end a pause().
280
+ */
251
281
  reset: () => void;
282
+ /**
283
+ * Stops guides for now, for a user who should not see them at the moment (a guest in this workspace, say): nothing
284
+ * starts, a guide that is showing leaves the screen with nothing stored, and the guide list cannot open. Stored
285
+ * progress is untouched. Lasts until resume() or the next page load. Use reset() on sign-out instead.
286
+ */
287
+ pause: () => void;
288
+ /** Ends a pause(): the guide that was showing comes back on its step, else triggers are checked for this page. */
289
+ resume: () => void;
290
+ /** Whether guides are paused. */
291
+ isPaused: () => boolean;
292
+ /**
293
+ * Shows guides in another language from now on, for an app that switches language without reloading. A guide that
294
+ * is showing switches straight away.
295
+ */
296
+ setLocale: (locale: string) => void;
252
297
  }
253
298
  //#endregion
254
299
  //#region src/index.d.ts
255
300
  export declare const playstep: PlayStep;
256
301
  //#endregion
257
- export { type AnalyticsEvent, type AppConfig, type ColorMode, type Guide, type InitOptions, type OpenLauncherOptions, type PlayStep, playstep as default };
302
+ export { type AnalyticsEvent, type RenderedConfig as AppConfig, type ColorMode, type RenderedGuide as Guide, type InitOptions, type OpenLauncherOptions, type PlayStep, playstep as default };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{n as e}from"./sdk-uFgPUdIh.js";const t=e(()=>import(`./ui-DBJLPgG5.js`),()=>import(`./launcher-button-DMxEcXwn.js`),()=>import(`./capture-BhZiRrIB.js`));export{t as default,t as playstep};
1
+ import{n as e}from"./sdk-Ba_W5Ehd.js";const t=e(()=>import(`./ui-uhppJh4o.js`).then(e=>e.t),()=>import(`./launcher-button-BFeH6G4k.js`),()=>import(`./capture-NeIia2Wg.js`));export{t as default,t as playstep};
@@ -0,0 +1 @@
1
+ import{t as e}from"./mode-CPlpg1Yl.js";const t=``;function n(t,n,r,i,a){let o=n.launcherGuides();if(!o.length)return;let s=e(r,a.colorMode),c=r.theme?.[s?`dark`:`light`]??{},l=o.filter(e=>!n.progress.guides[e.id]).length;t.innerHTML=`<button aria-label="${r.words[r.lang].open_guides}" style="position:fixed;${r.launcher.position.slice(7)}:24px;bottom:24px;z-index:2147483000;padding:15px;border:0;border-radius:50%;cursor:pointer;background:${c.accent??(s?`#7091ff`:`#2e5bff`)};color:${c[`on-accent`]??(s?`#0c0e13`:`#fff`)};box-shadow:0 8px 24px #0004"><svg width=26 height=26 viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M12 21a9 9 0 1 0-8.05-4.98L3 21l4.98-.95A8.96 8.96 0 0 0 12 21zM10 9v6l5-3z"/></svg>${l?`<b style="position:absolute;top:-2px;right:-2px;padding:0 6px;border-radius:9px;background:#ffc933;color:#151823;font:800 11px/20px sans-serif">${l}</b>`:``}</button>`,t.firstChild.onclick=i}export{t as captureIntegrity,n as drawLauncher};
@@ -0,0 +1 @@
1
+ import{fillEl as e,h as t,icon as n,words as r}from"./ui-uhppJh4o.js";const i=`.panel{position:fixed;right:24px;bottom:96px;width:320px;max-width:calc(100vw - 36px);max-height:calc(100vh - 120px);overflow:auto;padding:16px}.solo{bottom:24px}.panel .x{float:right}.panel>p{font-size:13px;line-height:18px;color:var(--ps-ink-muted);margin:-2px 0 12px}.rows{list-style:none;padding:0}.row{display:flex;align-items:center;gap:12px;width:100%;padding:10px;border-radius:var(--ps-radius-md);text-align:left}.ti{width:36px;height:36px;flex:none;border-radius:var(--ps-radius-md);display:grid;place-items:center;background:var(--ps-primary-soft);color:var(--ps-primary-ink)}.ti.spark{background:var(--ps-spark-soft);color:var(--ps-spark-ink)}.ti.mint{background:var(--ps-tag-mint);color:var(--ps-ink)}.ti svg{width:18px;height:18px}.rb{flex:1;min-width:0}.rt,.rm{display:block;font-weight:600}.rm{font-size:12px;line-height:16px;font-weight:500;color:var(--ps-ink-muted)}.prog{display:block;height:6px;border-radius:99px;background:var(--ps-surface-sunken);margin-top:6px;overflow:hidden}.prog i{display:block;height:100%;background:var(--ps-accent)}.rp{display:flex;align-items:center;gap:4px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted)}.so{margin-top:8px}.new{height:24px;padding:0 10px;border-radius:99px;background:var(--ps-spark-soft);color:var(--ps-spark-ink);font-size:12px;line-height:24px;font-weight:600}.pb{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:10px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted);text-decoration:none}.panel.left{right:auto;left:24px}@media (max-width:480px){.panel{right:18px;bottom:86px}.solo{bottom:18px}.panel.left{left:18px}}`;function a(i,a,o){let s=i.config.launcher,c=r(i),l=i.engine.launcherGuides(),u=i.engine.progress.guides;a.className=`panel${s.position==`bottom-left`?` left`:``}${s.enabled?``:` solo`}`,a.setAttribute(`aria-label`,c(`guides`)),a.lang=i.config.lang,i.config.rtl&&(a.dir=`rtl`),e(a,t(`button`,{class:`x`,"aria-label":c(`close_guides`),onClick:o},n(`x`)),t(`h2`,null,s.title),t(`p`,null,s.description),t(`ul`,{class:`rows`},l.map(e=>{let r=u[e.id],a=e.steps.length,s=r?.status==`done`,l=r?.status==`running`;return t(`li`,null,t(`button`,{class:`row`,onClick:()=>{o(),r&&i.dispatch({type:`reset_progress`,guide:e.id}),i.dispatch({type:`start`,guide:e.id})}},t(`span`,{class:`ti${s?` mint`:r?``:` spark`}`},n(s?`check`:`ps-guide`)),t(`span`,{class:`rb`},t(`span`,{class:`rt`},e.name),t(`span`,{class:`rm`},s?c(`completed`):l?c(`step_of`,{n:r.step+1,total:a}):c(`n_steps`,{n:a})),l&&t(`span`,{class:`prog`,"aria-hidden":`true`},t(`i`,{style:{width:`${r.step/a*100}%`}}))),r?t(`span`,{class:`rp`},n(`rotate-ccw`),c(`replay`)):t(`span`,{class:`new`},c(`new`))))})),l.some(e=>u[e.id])&&t(`div`,{class:`acts so`},t(`button`,{class:`btn gho`,onClick:()=>{i.dispatch({type:`reset_progress`}),i.engine.active?o():a.focus()}},c(`start_over`))),i.config.flags?.show_badge!==!1&&t(`a`,{class:`pb`,href:`https://playstep.app/?ref=badge`,target:`_blank`,rel:`noopener`},t(`span`,{style:{display:`inline-flex`,width:`16px`,height:`16px`},ref:e=>e.innerHTML=`<svg viewBox="0 0 48 48" aria-hidden="true"><rect width="48" height="48" rx="13" fill="#2E5BFF"/><rect x="11" y="10" width="8" height="28" rx="4" fill="#fff"/><path d="M23.5 12v17l12-8.5z" fill="#FFC933" stroke="#FFC933" stroke-width="3.5" stroke-linejoin="round"/></svg>`}),`Powered by PlayStep`))}export{i as css,a as drawList};
@@ -0,0 +1 @@
1
+ import{n as e}from"./util-oI8xpB8k.js";const t=e=>RegExp(`^${e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`)}$`),n=e=>e.length>1?e.replace(/\/+$/,``):e;function r(e,r){return!!e&&r!==void 0&&t(n(e)).test(n(r))}function i(e,t){return(e??[]).every(e=>{let n=t[e.trait];return e.op===`exists`?n!=null:e.op===`in`?Array.isArray(e.value)&&e.value.includes(n):n===e.value==(e.op===`eq`)})}function a(e){let{config:t}=e,n=e.progress??{seen:!1,guides:{}},a=e.traits??{},o=null,s,c=/* @__PURE__ */ new Set,l=!1,u=t.flags,d=t.guides,f=e=>d.find(t=>t.id===e),p=(e,t,n)=>({type:e,guide_id:t.id,guide_version:t.version,...n>=0&&{step_id:t.steps[n].id,step_index:n}}),m=e=>!l&&!u.disabled&&(!u.paused_for_new_users||n.seen)&&i(e.segments,a),h=e=>{let t=n.guides[e.id];return!o&&!c.has(e.id)&&m(e)&&(!t||t.status!==`done`&&(t.status===`running`||!e.trigger.once))},g=(e,t,r)=>{n.guides[e.id]={version:e.version,step:r,status:t}},_,v=e=>r(e.path,_),y=e=>r(e.skip_if_on,_)||v(e.complete_on),b=(e,t,n)=>{for(;t<e.steps.length;){if(o={guide:e,index:t,status:`running`},s=void 0,g(e,`running`,t),n.push(p(`step_shown`,e,t)),!y(e.steps[t]))return n;n.push(p(`step_completed`,e,t++))}return o={guide:e,index:--t,status:`completed`},g(e,`done`,t),n.push(p(`guide_completed`,e)),n},x=(e,t)=>(n.seen=!0,b(e,t,[p(`guide_shown`,e)])),S=()=>{let e=o;return o=null,e?.status===`running`?(g(e.guide,`dismissed`,e.index),[p(`guide_dismissed`,e.guide,e.index)]):[]},C=()=>{let e=o;return b(e.guide,e.index+1,[p(`step_completed`,e.guide,e.index)])},w=e=>{let t=d.find(t=>h(t)&&e(t));return t?x(t,0):[]},T=()=>(c.clear(),E()),E=()=>w(e=>e.trigger.type===`first_visit`||v(e.trigger)),D=()=>{let e=d.find(e=>n.guides[e.id]?.status===`running`&&!c.has(e.id)&&m(e));if(!e)return E();let t=n.guides[e.id];return x(e,t.version===e.version?t.step:0)};function O(e){let t=!l&&o?.status===`running`?o.guide.steps[o.index]:null;switch(e.type){case`init`:return _=e.path,c.clear(),D();case`pause`:return l=!0,[];case`resume`:return l?(l=!1,o?[]:D()):[];case`page_view`:return _=e.path,t&&y(t)?C():w(e=>v(e.trigger));case`reset_progress`:{let t=typeof e.guide==`string`&&f(e.guide);return t===void 0?[]:((!t||o?.guide===t)&&(o=null),t?delete n.guides[t.id]:n.guides={},[{type:`progress_reset`,guide_id:t?t.id:void 0},...T()])}case`event`:return t?.complete_on.type===`event`&&t.complete_on.name===e.name?C():w(t=>t.trigger.type===`event`&&t.trigger.name===e.name);case`tap`:return t?.complete_on.type===`tap_anchor`&&t.anchor===e.anchor?C():[];case`complete`:return t?.id===e.step?C():[];case`next`:return t?.complete_on.type===`next_button`?C():[];case`back`:return!t||o.index===0?[]:(o={...o,index:o.index-1},g(o.guide,`running`,o.index),[p(`step_shown`,o.guide,o.index)]);case`hide`:return t&&(c.add(o.guide.id),o=null),[];case`close`:if(o?.status!==`completed`)return[];case`dismiss`:return S();case`start`:{let n=f(e.guide);return!n||!m(n)||t&&o.guide===n&&n.steps.slice(0,o.index).every(y)?[]:S().concat(x(n,0))}case`anchor_missing`:return!t||t.anchor!==e.anchor||s===e.anchor?[]:(s=e.anchor,[{...p(`anchor_missing`,o.guide,o.index),anchor:e.anchor}]);case`identify`:return a={...a,...e.traits},[]}}return{get active(){return l?null:o},progress:n,dispatch:O,launcherGuides:()=>d.filter(e=>e.launcher&&m(e)),use(e){t=e,d=e.guides,o&&(o={...o,guide:f(o.guide.id)??o.guide})}}}const o=`0.7.0`,s=`playstep_preview`;function c(t,n,r){let i,c,l,u,d,f,p,m,h={},g=!1,_,v=[],y=[],b=()=>`p:${i.appKey}`,x=()=>i.preview||e.set(b(),c.progress),S=e=>{let t={...e,ts:Date.now()};i?.preview||(d?d.send(t):y.push(t)),i?.onEvent?.(t)},C=e=>{try{S({type:`sdk_error`,message:String(e)})}catch{}},w=e=>(...t)=>{try{e(...t)}catch(e){C(e)}},T=(e,t)=>w(n=>E({type:e,[t]:n}));function E(t){if(!c)return void v.push(t);let n=c.dispatch(t);x(),n.forEach(w(S)),(c.active||e.get(`q`))&&O(),d?.update()}function D(){return p??(p=document.body.appendChild(document.createElement(`playstep-root`)).attachShadow({mode:`open`}))}function O(){return f??(f=t().then(e=>{let t=D();return t.innerHTML=``,d=e.mount({engine:c,get config(){return l},options:i,root:t,outbox:y,userId:()=>m,dispatch:w(E),emit:w(S)})}).catch(C))}let k,A=w((e={})=>{c?c.launcherGuides().length&&O().then(t=>t?.openLauncher(e.anchor)):k=e});function j(e){e.launcher?.enabled&&c.launcherGuides().length&&!f&&n&&n().then(t=>{f||t.drawLauncher(D(),c,e,A,i)}).catch(C)}let M=e=>w(()=>{g!==e&&(g=e,c&&(E({type:e?`pause`:`resume`}),!f&&(e?p&&(p.innerHTML=``):j(l))))});async function N(){let t=i,n=(t.apiBase??`https://cdn.playstep.app`).replace(/\/$/,``),o=null;try{o=new URLSearchParams(location.search).get(s)||(t.config?null:sessionStorage.getItem(s))}catch{}t.preview||(t.preview=!!(t.config||o)),u=e=>fetch(`${n}/v2/${o?`preview/${o}?key=${t.appKey}&`:`config/${t.appKey}?`}l=${e}`).then(e=>e.json());let d=t.config;try{d??(d=await u(t.locale??navigator.language??``))}catch{return}try{o&&sessionStorage[d.guides?`setItem`:`removeItem`](s,o)}catch{}if(d?.capture)return void r?.().then(e=>e.start(d.capture,t.appKey)).catch(C);if(d?.guides&&!d.flags?.disabled&&(l=d,t.eventsUrl=d.ingest_url??`${n}/v1/events`,c=a({config:d,progress:t.preview?void 0:e.get(b())??void 0,traits:h}),g&&c.dispatch({type:`pause`}),E({type:`init`,path:location.pathname}),v.splice(0).forEach(E),k&&A(k),j(d),t.autoPageViews!==!1)){let e=location.pathname,t=w(()=>location.pathname!==e&&E({type:`page_view`,path:e=location.pathname}));for(let e of[`pushState`,`replaceState`]){let n=history[e];history[e]=function(...e){n.apply(this,e),t()}}addEventListener(`popstate`,t)}}return{version:o,init:w(e=>{if(i||!e?.appKey)return;i={...e},_&&(i.locale=_);let t=()=>setTimeout(()=>N().catch(C));document.readyState===`complete`?t():addEventListener(`load`,t)}),identify:w((e,t)=>{m=e,h={...h,...t},E({type:`identify`,traits:h})}),track:T(`event`,`name`),start:T(`start`,`guide`),complete:T(`complete`,`step`),page:w(e=>E({type:`page_view`,path:e??location.pathname})),openLauncher:A,resetProgress:T(`reset_progress`,`guide`),reset:w(()=>{E({type:`dismiss`}),m=void 0,h={},c&&(Object.assign(c.progress,{seen:!1,guides:{}}),x(),d?.update()),i?.preview||e.set(`d`,null)}),pause:M(!0),resume:M(!1),isPaused:()=>g,setLocale:w(e=>{_=e,i&&(i.locale=e),u?.(e).then(t=>{t.guides&&i?.locale==e&&(c.use(l=t),d?.update())}).catch(C)})}}export{c as n,o as t};
@@ -1 +1 @@
1
- import{n as e}from"./util-oI8xpB8k.js";const t=`playstep:q`,n=(e,t)=>fetch(e,{method:`POST`,body:t,keepalive:!0,headers:{"content-type":`text/plain`}}).then(e=>({status:e.status,retryAfter:Number(e.headers.get(`retry-after`))||void 0}),()=>({status:0})),r={read(e){try{return JSON.parse(localStorage.getItem(e))??[]}catch{return[]}},write(e,n){try{n.length?localStorage.setItem(e,JSON.stringify(n)):localStorage.removeItem(e);let r=!1;for(let e=0;e<localStorage.length;e++)r||(r=!!localStorage.key(e)?.startsWith(`playstep:q:`));r?localStorage.setItem(t,`1`):localStorage.removeItem(t)}catch{}}};function i(e){let t=[],i=[],a=[],o,s,c=0,l=!1,u=`${e.storageKey}:${Math.random().toString(36).slice(2,10)}`,d=()=>r.write(u,[...a,...i]),f=async t=>await e.send?.(e.url,t)??(e.send?{status:204}:n(e.url,t));try{for(let t=localStorage.length-1;t>=0;t--){let n=localStorage.key(t);n?.startsWith(`${e.storageKey}:`)&&(i.push(...r.read(n).filter(e=>Date.now()-e.t<6048e5)),localStorage.removeItem(n))}}catch{}i=i.sort((e,t)=>e.t-t.t).slice(-25),d();async function p(){if(!(l||s)){l=!0;try{for(;i.length;){let e=await f(i[0].b);if(e.status===0||e.status===408||e.status===429||e.status>=500){c=Math.min(6e4,c*2||2e3),s=setTimeout(()=>{s=void 0,p()},Math.max(c,(e.retryAfter??0)*1e3));break}c=0,i.shift(),d()}}finally{l=!1}}}function m(r=!1){clearTimeout(o),o=void 0;let s=t.length?e.envelope():null;if(s){for(;t.length;)i.push({b:JSON.stringify({...s,events:t.splice(0,20)}),t:Date.now()});i=i.slice(-25),d()}if(!r)return void p();for(let t of i.splice(0))e.send?f(t.b):navigator.sendBeacon?.(e.url,t.b)||n(e.url,t.b),a.push(t);a=a.slice(-25),d()}return addEventListener(`visibilitychange`,()=>document.visibilityState===`hidden`&&m(!0)),addEventListener(`pagehide`,()=>m(!0)),i.length&&p(),{push(n){t.push(n),t.length>=20?m():o??(o=setTimeout(m,e.delayMs??2e3))},flush:()=>m(),get size(){return t.length},get pending(){return i.length}}}const a=[];for(let e=2;a.length<64;e++){let t=!0;for(let n=2;n*n<=e;n++)e%n===0&&(t=!1);t&&a.push(Math.cbrt(e)%1*2**32|0)}const o=(e,t)=>e>>>t|e<<32-t;function s(e){let t=new TextEncoder().encode(e),n=t.length,r=new Uint32Array((n+8>>6)*16+16);for(let e=0;e<n;e++)r[e>>2]|=t[e]<<24-e%4*8;r[n>>2]|=128<<24-n%4*8,r[r.length-1]=n*8,r[r.length-2]=Math.floor(n/536870912);let i=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=/* @__PURE__ */ new Uint32Array(64);for(let e=0;e<r.length;e+=16){for(let t=0;t<64;t++)if(t<16)s[t]=r[e+t];else{let e=s[t-15],n=s[t-2];s[t]=s[t-16]+(o(e,7)^o(e,18)^e>>>3)+s[t-7]+(o(n,17)^o(n,19)^n>>>10)}let[t,n,c,l,u,d,f,p]=i;for(let e=0;e<64;e++){let r=p+(o(u,6)^o(u,11)^o(u,25))+(u&d^~u&f)+a[e]+s[e]|0,i=(o(t,2)^o(t,13)^o(t,22))+(t&n^t&c^n&c)|0;p=f,f=d,d=u,u=l+r|0,l=c,c=n,n=t,t=r+i|0}[t,n,c,l,u,d,f,p].forEach((e,t)=>i[t]=i[t]+e|0)}return i.map(e=>(e>>>0).toString(16).padStart(8,`0`)).join(``)}const c=e=>e+(crypto.randomUUID?crypto.randomUUID().replace(/-/g,``):Math.random().toString(36).slice(2)+Date.now().toString(36));function l(){try{let e=sessionStorage.getItem(`playstep:s`);return e||sessionStorage.setItem(`playstep:s`,e=c(`s_`)),e}catch{return c(`s_`)}}function u(t){let n=l(),r=e.get(`d`);r||e.set(`d`,r=c(`d_`));let a,o=r,u=i({url:t.url,send:t.send,storageKey:`playstep:q:${t.appKey}`,envelope:()=>{let e=t.userId()||void 0;return e!==a&&(a=e,o=e?`u_${s(`${t.appKey}:${e}`).slice(0,40)}`:r),{key:t.appKey,sdk:{name:t.sdk,version:t.version},platform:`web`,session_id:n,user_key:o,preview:t.preview}}});return{session:n,push:e=>u.push({...e,id:e.id??c(`e`).slice(0,25),...e.message?{message:e.message.slice(0,300)}:{}}),flush:u.flush}}export{u as createTransport,c as randomId,l as sessionId};
1
+ import{n as e}from"./util-oI8xpB8k.js";const t=`playstep:q`,n=(e,t)=>fetch(e,{method:`POST`,body:t,keepalive:!0,headers:{"content-type":`text/plain`}}).then(e=>({status:e.status,retryAfter:Number(e.headers.get(`retry-after`))||void 0}),()=>({status:0})),r={read(e){try{return JSON.parse(localStorage.getItem(e))??[]}catch{return[]}},write(e,n){try{n.length?localStorage.setItem(e,JSON.stringify(n)):localStorage.removeItem(e);let r=!1;for(let e=0;e<localStorage.length;e++)r||(r=!!localStorage.key(e)?.startsWith(`playstep:q:`));r?localStorage.setItem(t,`1`):localStorage.removeItem(t)}catch{}}};function i(e){let t=[],i=[],a=[],o,s,c=0,l=!1,u=`${e.storageKey}:${Math.random().toString(36).slice(2,10)}`,d=()=>r.write(u,[...a,...i]),f=async t=>await e.send?.(e.url,t)??(e.send?{status:204}:n(e.url,t));try{for(let t=localStorage.length-1;t>=0;t--){let n=localStorage.key(t);n?.startsWith(`${e.storageKey}:`)&&(i.push(...r.read(n).filter(e=>Date.now()-e.t<6048e5)),localStorage.removeItem(n))}}catch{}i=i.sort((e,t)=>e.t-t.t).slice(-25),d();async function p(){if(!(l||s)){l=!0;try{for(;i.length;){let e=await f(i[0].b);if(e.status===0||e.status===408||e.status===429||e.status>=500){c=Math.min(6e4,c*2||2e3),s=setTimeout(()=>{s=void 0,p()},Math.max(c,(e.retryAfter??0)*1e3));break}c=0,i.shift(),d()}}finally{l=!1}}}function m(r=!1){clearTimeout(o),o=void 0;let s=t.length?e.envelope():null;if(s){for(;t.length;)i.push({b:JSON.stringify({...s,events:t.splice(0,20)}),t:Date.now()});i=i.slice(-25),d()}if(!r)return void p();for(let t of i.splice(0))e.send?f(t.b):navigator.sendBeacon?.(e.url,t.b)||n(e.url,t.b),a.push(t);a=a.slice(-25),d()}return addEventListener(`visibilitychange`,()=>document.visibilityState===`hidden`&&m(!0)),addEventListener(`pagehide`,()=>m(!0)),i.length&&p(),{push(n){t.push(n),t.length>=20?m():o??(o=setTimeout(m,e.delayMs??2e3))},flush:()=>m(),get size(){return t.length},get pending(){return i.length}}}const a=[];for(let e=2;a.length<64;e++){let t=!0;for(let n=2;n*n<=e;n++)e%n===0&&(t=!1);t&&a.push(Math.cbrt(e)%1*2**32|0)}const o=(e,t)=>e>>>t|e<<32-t;function s(e){let t=new TextEncoder().encode(e),n=t.length,r=new Uint32Array((n+8>>6)*16+16);for(let e=0;e<n;e++)r[e>>2]|=t[e]<<24-e%4*8;r[n>>2]|=128<<24-n%4*8,r[r.length-1]=n*8,r[r.length-2]=Math.floor(n/536870912);let i=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=/* @__PURE__ */ new Uint32Array(64);for(let e=0;e<r.length;e+=16){for(let t=0;t<64;t++)if(t<16)s[t]=r[e+t];else{let e=s[t-15],n=s[t-2];s[t]=s[t-16]+(o(e,7)^o(e,18)^e>>>3)+s[t-7]+(o(n,17)^o(n,19)^n>>>10)}let[t,n,c,l,u,d,f,p]=i;for(let e=0;e<64;e++){let r=p+(o(u,6)^o(u,11)^o(u,25))+(u&d^~u&f)+a[e]+s[e]|0,i=(o(t,2)^o(t,13)^o(t,22))+(t&n^t&c^n&c)|0;p=f,f=d,d=u,u=l+r|0,l=c,c=n,n=t,t=r+i|0}[t,n,c,l,u,d,f,p].forEach((e,t)=>i[t]=i[t]+e|0)}return i.map(e=>(e>>>0).toString(16).padStart(8,`0`)).join(``)}const c=e=>e+(crypto.randomUUID?crypto.randomUUID().replace(/-/g,``):Math.random().toString(36).slice(2)+Date.now().toString(36));function l(){try{let e=sessionStorage.getItem(`playstep:s`);return e||sessionStorage.setItem(`playstep:s`,e=c(`s_`)),e}catch{return c(`s_`)}}function u(t){let n=l(),r=e.get(`d`);r||e.set(`d`,r=c(`d_`));let a,o=r,u=i({url:t.url,send:t.send,storageKey:`playstep:q:${t.appKey}`,envelope:()=>{let e=t.userId()||void 0;return e!==a&&(a=e,o=e?`u_${s(`${t.appKey}:${e}`).slice(0,40)}`:r),{key:t.appKey,sdk:{name:t.sdk,version:t.version},session_id:n,user_key:o,preview:t.preview,locale:t.locale()}}});return{session:n,push:e=>u.push({...e,id:e.id??c(`e`).slice(0,25),...e.message?{message:e.message.slice(0,300)}:{}}),flush:u.flush}}export{u as createTransport,c as randomId,l as sessionId};
@@ -0,0 +1 @@
1
+ import{t as e}from"./sdk-Ba_W5Ehd.js";import{t}from"./util-oI8xpB8k.js";import{t as n}from"./mode-CPlpg1Yl.js";var r=Object.defineProperty,i=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n};const a={x:`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`,play:`<path d="M5 5a2 2 0 0 1 3-1.7l12 7a2 2 0 0 1 0 3.5l-12 7A2 2 0 0 1 5 19z"/>`,"volume-2":`<path d="M11 4.7a.7.7 0 0 0-1.2-.5L6.4 7.6A1.4 1.4 0 0 1 5.4 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.4a1.4 1.4 0 0 1 1 .4l3.4 3.4A.7.7 0 0 0 11 19.3z"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.4 18.4a9 9 0 0 0 0-12.7"/>`,"volume-x":`<path d="M11 4.7a.7.7 0 0 0-1.2-.5L6.4 7.6A1.4 1.4 0 0 1 5.4 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.4a1.4 1.4 0 0 1 1 .4l3.4 3.4A.7.7 0 0 0 11 19.3z"/><path d="m16.5 14.5 5-5"/><path d="m16.5 9.5 5 5"/>`,check:`<path d="M20 6 9 17l-5-5"/>`,"maximize-2":`<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>`,"arrow-right":`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`,"rotate-ccw":`<path d="M3 12a9 9 0 1 0 9-9 9.8 9.8 0 0 0-6.7 2.7L3 8"/><path d="M3 3v5h5"/>`,"external-link":`<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>`,"ps-launcher":`<path d="M12 21a9 9 0 1 0-8-5L3 21l5-.9A9 9 0 0 0 12 21z"/><path d="M10 9v6l5-3z"/>`,"ps-level-up":`<path d="M3 21h5v-4h5v-4h5V9"/><path d="M18 9V3l4 2.5L18 8"/>`,"ps-guide":`<rect x="4" y="3" width="4" height="18" rx="2"/><path d="M12 5.5v10l7.5-5z"/>`};function o(e,t,...n){let r=document.createElement(e);for(let e in t){let n=t[e];if(n!=null&&n!==!1){if(e[0]==`o`&&e[1]==`n`)r.addEventListener(e.slice(2).toLowerCase(),n);else if(e==`ref`)n(r);else if(e==`style`)for(let e in n)r.style.setProperty(e,n[e]);else r.setAttribute(e,n===!0?``:String(n))}}return s(r,n),r}function s(e,t){for(let n of t)Array.isArray(n)?s(e,n):n!=null&&n!==!1&&e.appendChild(typeof n==`object`?n:document.createTextNode(String(n)))}const c=document.createElement(`template`);function l(e){return c.innerHTML=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${a[e]}</svg>`,c.content.firstChild}const u=(e,...t)=>{e.textContent=``,s(e,t)},d=(e,t={})=>e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e),f=e=>{let t=Math.round(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`},p=e=>e.options.locale??navigator.language??`en`,m=(e,t=e.config.lang)=>(n,r)=>d(e.config.words[t]?.[n]??n,r);function h(e,t){let n=e=>!!e?.getClientRects().length,r=document.querySelector(`[data-guide="${CSS.escape(e)}"]`);try{r||(r=t?[...document.querySelectorAll(t.css)].find(e=>n(e)&&(!t.text||e.innerText.includes(t.text)))??null:null)}catch{}return n(r)?r:null}function g(e){try{let t=JSON.parse(sessionStorage.getItem(`playstep:clips`)??`[]`);if(t.includes(e))return!1;sessionStorage.setItem(`playstep:clips`,JSON.stringify([...t,e].slice(-200)))}catch{}return!0}function _(e,t,n,r,i,a){(!a||g(`${i}|${r.url}`))&&e.emit({type:i,guide_id:t.id,guide_version:t.version,step_id:t.steps[n].id,step_index:n,clip_id:r.clip_id,clip_source:r.source})}function v(e,t,n,r,i,a,s){let c=m(e,t.lang),d=t.steps[n].title,p=o(`div`,{class:`clip`}),h=!0,g=r.duration_ms??0;if(r.kind==`embed`)return p.className=`clip embed`,u(p,r.poster&&o(`img`,{src:r.poster,alt:``}),o(`button`,{class:`play`,"aria-label":c(`play_video`),onClick:()=>{u(p,o(`iframe`,{src:r.url,title:c(`video`,{title:d}),allow:`autoplay; encrypted-media; picture-in-picture; fullscreen`,allowfullscreen:!0})),_(e,t,n,r,`clip_played`)}},l(`play`)),o(`div`,{class:`bar`},o(`span`,{class:`pill`},l(`external-link`),r.label,g?` · ${f(g)}`:``))),s(0),p;let v=()=>{let i=o(`video`,{src:r.url,poster:r.poster,loop:!0,autoplay:!0,playsinline:!0,preload:`auto`,"aria-label":c(`clip`,{title:d}),onLoadeddata:()=>_(e,t,n,r,`clip_loaded`,!0),onPlaying:()=>_(e,t,n,r,`clip_played`,!0),onLoadedmetadata:()=>{Number.isFinite(i.duration)&&(g=i.duration*1e3,m.textContent=`${f(g)} `,s(g))}});i.muted=!0;let m=o(`span`,null,g?`${f(g)} `:``),v=o(`button`,{class:`round`,"aria-label":c(`unmute_clip`),onClick:()=>{h=!h,i.muted=h,v.setAttribute(`aria-label`,c(h?`unmute_clip`:`mute_clip`)),u(v,l(h?`volume-x`:`volume-2`)),h||_(e,t,n,r,`clip_unmuted`)}},l(`volume-x`)),y=o(`button`,{class:`round`,"aria-label":c(`expand_clip`),"aria-pressed":`false`,onClick:()=>{let e=a.classList.toggle(`big`);y.setAttribute(`aria-label`,c(e?`shrink_clip`:`expand_clip`)),y.setAttribute(`aria-pressed`,String(e))}},l(`maximize-2`));u(p,i,o(`div`,{class:`bar`},o(`span`,{class:`pill`},l(`play`),m,c(`loop`)),v,y)),i.play()?.catch(()=>{}),s(g)};return i?u(p,r.poster&&o(`img`,{src:r.poster,alt:``}),o(`button`,{class:`play`,"aria-label":c(`play_clip`),onClick:v},l(`play`))):v(),p}function y(e,t,n,r,i){let a=t.steps[n],s=t.steps.length,c=m(e,t.lang),d=a.complete_on.type==`next_button`,f=a.media,p=c(`step_of`,{n:n+1,total:s}),h=t.steps.map((e,t)=>o(`span`,{class:`seg${t<n?` done`:t==n?` cur`:``}`})),g=e=>{let t=h[n];t.className=`seg cur${e&&!r?` anim`:``}`,e?t.style.setProperty(`--d`,`${e}ms`):t.style.removeProperty(`--d`)};i.classList.remove(`big`),i.dataset.step=a.id,i.lang=t.lang,t.rtl?i.dir=`rtl`:i.removeAttribute(`dir`),u(i,f?.kind==`image`?o(`div`,{class:`clip img`},o(`img`,{src:f.url,alt:f.label??``,width:f.width,height:f.height})):f&&v(e,t,n,f,r,i,g),o(`div`,{class:`body`},o(`div`,{class:`meta`},o(`span`,null,`${p} · ${t.name}`),o(`button`,{class:`x`,"aria-label":c(`close_guide`),onClick:()=>e.dispatch({type:`dismiss`})},l(`x`))),o(`div`,{class:`steps`,role:`img`,"aria-label":p},h),o(`h2`,{class:`title`,id:`ps-title`},a.title),o(`p`,{class:`text`,id:`ps-text`},a.body)),o(`div`,{class:`foot`},d?o(`span`,{class:`sp`}):o(`span`,{class:`wait`},o(`span`,{class:`pulse`,"aria-hidden":`true`}),c(`waiting`)),a.back&&o(`button`,{class:`btn gho`,onClick:()=>e.dispatch({type:`back`})},c(`back`)),d&&o(`button`,{class:`btn pri`,onClick:()=>e.dispatch({type:`next`})},c(n+1==s?`done`:`next`),l(`arrow-right`))));let y=t.steps[n+1]?.media;if(y&&y.kind!=`embed`&&!r&&!navigator.connection?.saveData){if(y.kind==`image`)new Image().src=y.url;else{let r=document.createElement(`video`);r.preload=`auto`,r.muted=!0,r.src=y.url,y.source==`hosted`&&_(e,t,n+1,y,`clip_loaded`,!0)}}}function b(e,t,n,r,i,a=!1,o=12){let s={bottom:e.bottom+i+n<=innerHeight-o,top:e.top-i-n>=o,left:e.left-i-t>=o,right:e.right+i+t<=innerWidth-o},c=r.find(e=>s[e])??r[0],l=(e,t)=>Math.max(o,Math.min(e,t-o));return c==`top`||c==`bottom`?{x:l(a?e.left:e.left+(e.width-t)/2,innerWidth-t),y:c==`top`?e.top-i-n:e.bottom+i}:{x:c==`left`?e.left-i-t:e.right+i,y:l(e.top+(e.height-n)/2,innerHeight-n)}}var x=/* @__PURE__ */ i({fillEl:()=>u,h:()=>o,icon:()=>l,mount:()=>A,words:()=>m});const S=document.currentScript?.src,C=(e,t,n)=>t?new Promise((n,r)=>document.head.append(Object.assign(document.createElement(`script`),{src:new URL(`${e}.js`,S||location.href).href,integrity:t,crossOrigin:`anonymous`,onload:()=>n(window[`__playstep_${e}`]),onerror:()=>r(Error(e))}))):n(),w=()=>C(`events`,``,()=>import(`./transport-BbOItkab.js`)),T=()=>C(`list`,typeof __PLAYSTEP_LIST_INTEGRITY__==`string`?__PLAYSTEP_LIST_INTEGRITY__:``,()=>import(`./list-Dqrzp4FD.js`)),E=()=>C(`done`,typeof __PLAYSTEP_DONE_INTEGRITY__==`string`?__PLAYSTEP_DONE_INTEGRITY__:``,()=>import(`./done-BwXakUjv.js`));function D(e,t,n){let r=m(e),i=e.engine.launcherGuides().filter(t=>!e.engine.progress.guides[t.id]).length;t.className=`lb${e.config.launcher.position==`bottom-left`?` left`:``}`,t.setAttribute(`aria-label`,r(n?`close_guides`:`open_guides`)),t.setAttribute(`aria-expanded`,String(n)),u(t,l(`ps-launcher`),i>0&&!n&&o(`span`,{class:`cnt`},i))}const O=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r));function k(e,t,n){let r=o(`div`,{class:`card`,role:`dialog`,"aria-modal":`false`,"aria-labelledby":`ps-title`,"aria-describedby":`ps-text`,tabindex:`-1`,style:{visibility:`hidden`}}),i=o(`div`,{class:`spot`,"aria-hidden":`true`}),a=o(`div`,{class:`scrim`,"aria-hidden":`true`}),s=!1,c=!1,l,u=-1,d=null,f=[],p=[],m=[],g=!1,_=``,v=``,x,S=e=>e.splice(0).forEach(e=>e()),C=()=>l.steps[u];function w(e,t,a){r.style.transform=`translate(${Math.round(e)}px,${Math.round(t)}px)`,r.style.visibility=``,g||(r.style.transition=`none`,requestAnimationFrame(()=>(g=!0,r.style.transition=``))),s!=!!(d&&a)&&(s=!s,n()),d&&a&&Object.assign(i.style,{width:`${a.w}px`,height:`${a.h}px`,transform:`translate(${a.x}px,${a.y}px)`,borderRadius:`${a.r}px`}),_!=C().id&&(_=C().id,document.activeElement?.matches(`input,textarea,select,[contenteditable]:not([contenteditable=false])`)||r.focus({preventScroll:!0}))}function T(){S(m);let e=r;if(c!=(!d&&l.position==`center`)&&(c=!c,n()),!d){let t=()=>w((innerWidth-e.offsetWidth)/2,l.position==`center`?(innerHeight-e.offsetHeight)/2:innerHeight-e.offsetHeight-24);t();let n=new ResizeObserver(t);n.observe(e),m.push(()=>n.disconnect(),O(window,`resize`,t));return}let i=d,a=i.getBoundingClientRect();(a.bottom<0||a.top>innerHeight)&&i.scrollIntoView({block:`center`,behavior:t?`auto`:`smooth`});let o=()=>{let t=i.getBoundingClientRect(),n=Number.parseFloat(getComputedStyle(i).borderTopLeftRadius)||8,r=C().placement,{x:a,y:o}=b(t,e.offsetWidth,e.offsetHeight,[r==`auto`?`bottom`:r,`top`,`left`,`right`],18);w(a,o,{x:t.left-6,y:t.top-6,w:t.width+12,h:t.height+12,r:Math.min(n+6,(t.height+12)/2)})};o();let s=new ResizeObserver(o);s.observe(i),s.observe(e);let u=setInterval(o,400);m.push(()=>s.disconnect(),()=>clearInterval(u),O(window,`scroll`,o,{capture:!0,passive:!0}),O(window,`resize`,o))}function E(t){d=t,S(p),clearTimeout(x);let n=C();if(t)p.push(O(document,`click`,(r=>{r.composedPath().includes(t)&&(v=``,e.dispatch({type:`tap`,anchor:n.anchor}))}),!0)),t==h(n.anchor,n.find?.web)&&(v=n.id);else if(v==n.id){let t=u;x=setTimeout(()=>{for(let n=t;n--;){let r=l.steps[n];if(!r.anchor||r.complete_on.type==`page`)return;if(h(r.anchor,r.find?.web)){for(let r=t;r-->n;)e.dispatch({type:`back`});return}}},400)}p.push(O(document,`keydown`,(n=>{if(n.key!=`Tab`)return;let i=[...r.querySelectorAll(`button,a,iframe,[tabindex="0"]`)],a=n.composedPath().includes(r),o=i[0],s=i.at(-1),c=e.root.activeElement;a&&!n.shiftKey&&c==s?(n.preventDefault(),(t??o)?.focus()):a&&n.shiftKey&&c==o?(n.preventDefault(),(t??s)?.focus()):t&&document.activeElement==t&&(n.preventDefault(),(n.shiftKey?s:o)?.focus())}),!0)),T()}function D(){S(f);let t=C(),n=t.anchor?h(t.anchor,t.find?.web):null;if(E(n),!t.anchor)return;let r=0,i=()=>{r=0;let e=h(t.anchor,t.find?.web);e!=n&&E(n=e)},a=new MutationObserver(()=>r||(r=requestAnimationFrame(i)));a.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-guide`,`hidden`,`style`,`class`]});let o=setTimeout(()=>!n&&e.dispatch({type:`anchor_missing`,anchor:t.anchor}),3e3);f.push(()=>a.disconnect(),()=>clearTimeout(o),()=>cancelAnimationFrame(r))}return{nodes:()=>[s&&i,c&&a,r],get guide(){return l},update(n,i){if(n==l&&i==u)return;let a=!l||i!=u||n.steps[i]?.id!=C().id;l=n,u=i,y(e,n,i,t,r),a?D():T()},stop(){S(f),S(p),S(m),clearTimeout(x)}}}function A(r){let i=r.options,a=e=>void r.outbox.push(e);w().then(({createTransport:t})=>{let n=t({appKey:i.appKey,url:i.eventsUrl,sdk:i.sdkName??`web`,version:e,preview:i.preview,userId:r.userId,locale:()=>p(r),send:i.transport});r.outbox.splice(0).forEach(n.push),a=n.push}).catch(e=>r.emit({type:`sdk_error`,message:String(e)}));let s=r.root;s.appendChild(o(`style`,null,`:host{--ps-radius-md:14px;--ps-radius-lg:20px;--ps-font-display:"Bricolage Grotesque","Figtree",system-ui,sans-serif;--ps-font-sans:"Figtree",system-ui,-apple-system,"Segoe UI",sans-serif;--ps-clip-overlay:rgba(12,14,19,.72);--ps-ease:cubic-bezier(.2,.8,.2,1);--ps-accent:var(--ps-primary);--ps-accent-hover:var(--ps-primary-hover);--ps-on-accent:var(--ps-on-primary);--ps-surface:#fff;--ps-surface-sunken:#f5f6f9;--ps-surface-raised:#fff;--ps-line:#e3e6ec;--ps-ink:#151823;--ps-ink-secondary:#454b5c;--ps-ink-muted:#646b7d;--ps-primary:#2e5bff;--ps-primary-hover:#2149e6;--ps-primary-soft:#e8edff;--ps-primary-ink:#2149e6;--ps-on-primary:#fff;--ps-spark:#ffc933;--ps-spark-soft:#fff4cc;--ps-spark-ink:#7a5a00;--ps-on-spark:#151823;--ps-scrim:rgba(12,14,19,.64);--ps-tag-mint:#ddf5ea;--ps-chart-4:#14b37d;--ps-chart-5:#ff7a59;--ps-shadow-lg:0 20px 48px -12px rgba(21,24,35,.28),0 4px 10px rgba(21,24,35,.06);--ps-ring-focus:0 0 0 2px #fff,0 0 0 4px #2e5bff}:host([data-mode=dark]){--ps-surface:#161922;--ps-surface-sunken:#1d212b;--ps-surface-raised:#222633;--ps-line:#2a2f3c;--ps-ink:#f2f4f8;--ps-ink-secondary:#c5cad5;--ps-ink-muted:#959cad;--ps-primary:#7091ff;--ps-primary-hover:#8da7ff;--ps-primary-soft:#1c2550;--ps-primary-ink:#93abff;--ps-on-primary:#0c0e13;--ps-spark:#ffd452;--ps-spark-soft:#3a2f0a;--ps-spark-ink:#ffd86b;--ps-on-spark:#151823;--ps-scrim:rgba(0,0,0,.72);--ps-tag-mint:#0f2c22;--ps-chart-4:#3dd9a0;--ps-chart-5:#ff9478;--ps-shadow-lg:0 20px 48px -12px rgba(0,0,0,.8),0 4px 10px rgba(0,0,0,.5);--ps-ring-focus:0 0 0 2px #161922,0 0 0 4px #7091ff}:host{all:initial}*{box-sizing:border-box;margin:0}.l{position:fixed;inset:0;pointer-events:none;z-index:2147483000;font:400 14px/20px var(--ps-font-sans);color:var(--ps-ink);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;border:0;padding:0;background:none;cursor:pointer}button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:none;box-shadow:var(--ps-ring-focus)}svg{width:16px;height:16px;flex:none}.scrim{position:fixed;inset:0;background:var(--ps-scrim);pointer-events:auto}.spot,.card{position:fixed;left:0;top:0;transition:transform .36s var(--ps-ease),width .36s var(--ps-ease),height .36s var(--ps-ease)}.spot{box-shadow:0 0 0 9999px var(--ps-scrim)}.spot:after{content:"";position:absolute;inset:-4px;border-radius:18px;border:2px solid var(--ps-spark);animation:ring 1.8s ease-out infinite}.card,.cel,.panel{background:var(--ps-surface-raised);border-radius:var(--ps-radius-lg);box-shadow:var(--ps-shadow-lg);pointer-events:auto;outline:none}.card{width:336px;max-width:calc(100vw - 24px);padding:10px}.big{width:min(720px,calc(100vw - 24px))}.clip{position:relative;aspect-ratio:16/10;border-radius:var(--ps-radius-md);overflow:hidden;background:var(--ps-surface-sunken)}.clip>video,.clip>img,.clip>iframe{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border:0}.bar{position:absolute;left:8px;right:8px;bottom:8px;display:flex;align-items:center;gap:6px;color:#fff}.pill,.round{background:var(--ps-clip-overlay);border-radius:99px;display:inline-flex;align-items:center;justify-content:center}.pill{height:24px;padding:0 8px;gap:4px;font:700 11px/1 var(--ps-font-sans)}.pill svg{width:13px;height:13px}.round{width:28px;height:28px}.round svg{width:14px;height:14px}.bar .round:first-of-type{margin-inline-start:auto}[dir=rtl] .btn svg{transform:scaleX(-1)}.img>img{object-fit:contain}.play{position:absolute;inset:0;margin:auto;width:60px;height:60px;border-radius:50%;background:var(--ps-accent);color:var(--ps-on-accent);display:grid;place-items:center}.play svg{width:26px;height:26px}.body{padding:14px 8px 6px}.meta{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted);margin-bottom:10px}.meta span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.x{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;margin:-6px -6px -6px 0}.x:hover,.gho:hover,.row:hover,.sec:hover{background:var(--ps-surface-sunken);color:var(--ps-ink)}.steps{display:flex;gap:4px;margin-bottom:12px}.seg{flex:1;height:6px;border-radius:99px;background:var(--ps-surface-sunken);overflow:hidden;position:relative}.done{background:var(--ps-accent)}.cur:after{content:"";position:absolute;left:0;top:0;bottom:0;width:55%;border-radius:99px;background:var(--ps-spark)}.anim:after{animation:fill var(--d,4s) linear infinite}.title,.cel h2,.panel h2{font:700 20px/26px var(--ps-font-display);letter-spacing:-.01em;margin-bottom:4px}.text,.cel p{color:var(--ps-ink-secondary)}.foot{display:flex;align-items:center;gap:8px;padding:14px 8px 4px}.wait,.sp{flex:1}.wait{display:flex;align-items:center;gap:8px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted)}.pulse{width:8px;height:8px;border-radius:50%;background:var(--ps-spark);animation:pulse 1.6s ease-out infinite}.btn{height:32px;padding:0 14px;border-radius:var(--ps-radius-btn,99px);border:1px solid transparent;font-size:13px;line-height:18px;font-weight:600;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.pri{background:var(--ps-accent);color:var(--ps-on-accent)}.pri:hover{background:var(--ps-accent-hover)}.x{color:var(--ps-ink-muted)}.gho{color:var(--ps-ink-secondary)}.embed{background:#151823}.sec{background:var(--ps-surface);border-color:var(--ps-line)}.acts{display:flex;justify-content:center;gap:12px}.lb{position:fixed;bottom:24px;right:24px;width:56px;height:56px;border-radius:50%;background:var(--ps-accent);color:var(--ps-on-accent);box-shadow:var(--ps-shadow-lg);display:grid;place-items:center;pointer-events:auto}.lb svg{width:26px;height:26px}.cnt{position:absolute;top:-2px;right:-2px;min-width:20px;height:20px;padding:0 5px;border-radius:99px;background:var(--ps-spark);color:var(--ps-on-spark);font:800 11px/20px var(--ps-font-sans)}.left{right:auto;left:24px}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}@keyframes ring{to{opacity:0;transform:scale(1.12)}}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--ps-spark)}70%,to{box-shadow:0 0 0 8px transparent}}@keyframes fill{0%{width:0}to{width:100%}}@media (max-width:480px){.card{width:300px}.title{font-size:17px;line-height:22px}.lb{right:18px;bottom:18px}.left{right:auto;left:18px}}@media (prefers-reduced-motion:reduce){.spot,.card{transition:none}.spot:after,.pulse,.cur:after,.tile{animation:none}}`));let c=s.appendChild(o(`div`,{class:`l`})),l=o(`div`,{class:`sr`,"aria-live":`polite`}),u=!1,d,f,g=null,_=o(`button`,{onClick:()=>I(!u)}),v,y,x,S,C=e=>r.emit({type:`sdk_error`,message:String(e)}),A=()=>x??(x=T().then(e=>(v=e,s.appendChild(o(`style`,null,e.css)),R())).catch(C)),j=()=>S??(S=E().then(e=>(y=e,s.appendChild(o(`style`,null,e.css)),R())).catch(C)),M,N=[],P=()=>[l],F,I=e=>{u=e,R()};function L(e){let t=e.filter(Boolean);for(t.forEach((e,t)=>c.childNodes[t]!=e&&c.insertBefore(e,c.childNodes[t]??null));c.childNodes.length>t.length;)c.lastChild.remove()}function R(){let e=r.engine.active,a=e?.guide,p=n(r.config,i.colorMode,a?.mode)?`dark`:`light`;s.host.setAttribute(`data-mode`,p),c.removeAttribute(`style`);for(let[e,t]of Object.entries({...r.config.theme?.[p],...a?.tokens?.[p]}))c.style.setProperty(`--ps-${e}`,t);let h=r.engine.launcherGuides().length>0,x=!!f;u&&h&&v?(f??(f=o(`div`,{tabindex:`-1`,role:`dialog`})),v.drawList(r,f,()=>I(!1))):(f=void 0,u&&h&&A()),h&&D(r,_,u),!u&&e?.status==`running`?M?.guide?.id!=a.id&&(M?.stop(),M=k(r,t(),()=>L(P()))):(M?.stop(),M=void 0),e?.status==`running`&&e.index==a.steps.length-1&&j();let S=!u&&e?.status==`completed`&&!!y;!u&&e?.status==`completed`&&!y&&j();let C=S&&(F!=a||!N.length);if(S?C&&(N=y.drawDone(r,a)):N=[],F=S?a:void 0,l.textContent=e?e.status==`running`?`${m(r,a.lang)(`step_of`,{n:e.index+1,total:a.steps.length})}: ${a.steps[e.index].title}`:m(r,a.lang)(`level_cleared`):``,P=()=>[f,h&&r.config.launcher.enabled&&_,...M?.nodes()??[],...N,l],L(P()),M?.update(a,e.index),f&&!x){if(g=s.activeElement??document.activeElement,d){let{x:e,y:t}=b(d.getBoundingClientRect(),f.offsetWidth,f.offsetHeight,[`top`,`bottom`],8,!0);f.style.cssText=`left:${e}px;top:${t}px;right:auto;bottom:auto`}f.focus()}else!f&&x&&g?.focus();C&&N[1]?.focus()}O(window,`keydown`,(e=>{if(e.key!=`Escape`||e.defaultPrevented||!e.composedPath().includes(s.host))return;let t=r.engine.active;if(u)I(!1);else if(t?.status==`completed`)r.dispatch({type:`close`});else if(t){let e=t.guide.steps[t.index],n=e.anchor?h(e.anchor,e.find?.web):null;r.dispatch({type:`hide`}),n?.focus({preventScroll:!0})}else return;e.preventDefault(),e.stopPropagation()}),!0);let z=new MutationObserver(()=>R());for(let e of[document.documentElement,document.body])z.observe(e,{attributes:!0});return O(matchMedia(`(prefers-color-scheme: dark)`),`change`,()=>R()),R(),{update:()=>{r.engine.launcherGuides().length||(u=!1),R()},openLauncher:e=>{let t=document.activeElement;d=e??(t!=document.body&&t!=s.host?t??void 0:void 0),I(!0)},send:e=>a(e)}}export{u as fillEl,o as h,l as icon,A as mount,x as t,m as words};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@axceera/playstep",
3
- "version": "0.5.1",
4
- "description": "PlayStep web SDK: playable, video-first guides for any web app. A 3 KB loader; the guide UI loads only when a guide shows.",
3
+ "version": "0.7.0",
4
+ "description": "PlayStep web SDK: playable, video-first guides for any web app. A 3.2 KB loader; the guide UI loads only when a guide shows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "homepage": "https://playstep.app/docs/sdk/web",
@@ -27,10 +27,6 @@
27
27
  "dist/*.d.ts",
28
28
  "dist/cdn"
29
29
  ],
30
- "dependencies": {
31
- "@floating-ui/dom": "^1.8.0",
32
- "preact": "^11.0.1"
33
- },
34
30
  "devDependencies": {
35
31
  "@playwright/test": "^1.64.0",
36
32
  "@size-limit/file": "^14.2.0",
@@ -43,8 +39,8 @@
43
39
  "typescript": "~6.0.3",
44
40
  "vite": "^8.3.4",
45
41
  "vitest": "^4.1.11",
46
- "@playstep/spec": "0.1.0",
47
- "@playstep/design-system": "0.1.0"
42
+ "@playstep/design-system": "0.1.0",
43
+ "@playstep/spec": "0.1.0"
48
44
  },
49
45
  "scripts": {
50
46
  "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsdown && node scripts/cdn.ts",
@@ -1 +0,0 @@
1
- import{t as e}from"./mode-CPlpg1Yl.js";const t=``;function n(t,n,r,i,a){let o=n.launcherGuides();if(!o.length)return;let s=e(r,a.colorMode),c=r.theme?.[s?`dark`:`light`]??{},l=o.filter(e=>!n.progress.guides[e.id]).length;t.innerHTML=`<button aria-label="Open guides" style="position:fixed;${r.launcher.position.slice(7)}:24px;bottom:24px;z-index:2147483000;padding:15px;border:0;border-radius:50%;cursor:pointer;background:${c.accent??(s?`#7091ff`:`#2e5bff`)};color:${c[`on-accent`]??(s?`#0c0e13`:`#fff`)};box-shadow:0 8px 24px #0004"><svg width=26 height=26 viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M12 21a9 9 0 1 0-8.05-4.98L3 21l4.98-.95A8.96 8.96 0 0 0 12 21zM10 9v6l5-3z"/></svg>${l?`<b style="position:absolute;top:-2px;right:-2px;padding:0 6px;border-radius:9px;background:#ffc933;color:#151823;font:800 11px/20px sans-serif">${l}</b>`:``}</button>`,t.querySelector(`button`).onclick=i}export{t as captureIntegrity,n as drawLauncher};
@@ -1 +0,0 @@
1
- import{n as e}from"./util-oI8xpB8k.js";const t=e=>RegExp(`^${e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`)}$`),n=e=>e.length>1?e.replace(/\/+$/,``):e;function r(e,r){return!!e&&r!==void 0&&t(n(e)).test(n(r))}function i(e,t){return(e??[]).every(e=>{let n=t[e.trait];return e.op===`exists`?n!=null:e.op===`in`?Array.isArray(e.value)&&e.value.includes(n):n===e.value==(e.op===`eq`)})}function a(e){let{config:t,platform:n}=e,a=e.progress??{seen:!1,guides:{}},o=e.traits??{},s=null,c,l=/* @__PURE__ */ new Set,u=t.flags||{},d=(t.guides??[]).filter(e=>e.spec_version<=3&&(e.targeting?.platforms??[`web`]).includes(n)),f=e=>d.find(t=>t.id===e),p=(e,t,n)=>({type:e,guide_id:t.id,guide_version:t.version,...n>=0&&{step_id:t.steps[n].id,step_index:n}}),m=e=>!u.disabled&&(!u.paused_for_new_users||a.seen)&&i(e.targeting?.segments,o),h=e=>{let t=a.guides[e.id];return!s&&!l.has(e.id)&&m(e)&&(!t||t.status!==`done`&&(t.status===`running`||!e.trigger.once))},g=(e,t,n)=>{a.guides[e.id]={version:e.version,step:n,status:t}},_,v=e=>r(e.path,_),y=e=>r(e.skip_if_on,_)||v(e.complete_on),b=(e,t,n)=>{for(;t<e.steps.length;){if(s={guide:e,index:t,status:`running`},c=void 0,g(e,`running`,t),n.push(p(`step_shown`,e,t)),!y(e.steps[t]))return n;n.push(p(`step_completed`,e,t++))}return s={guide:e,index:--t,status:`completed`},g(e,`done`,t),n.push(p(`guide_completed`,e)),n},x=(e,t)=>(a.seen=!0,b(e,t,[p(`guide_shown`,e)])),S=()=>{let e=s;return s=null,e?.status===`running`?(g(e.guide,`dismissed`,e.index),[p(`guide_dismissed`,e.guide,e.index)]):[]},C=()=>{let e=s;return b(e.guide,e.index+1,[p(`step_completed`,e.guide,e.index)])},w=e=>{let t=d.find(t=>h(t)&&e(t));return t?x(t,0):[]},T=()=>(l.clear(),w(e=>e.trigger.type===`first_visit`||v(e.trigger)));function E(e){let t=s?.status===`running`?s.guide.steps[s.index]:null;switch(e.type){case`init`:{_=e.path;let t=d.find(e=>a.guides[e.id]?.status===`running`&&m(e));if(t){let e=a.guides[t.id];return x(t,e.version===t.version?e.step:0)}return T()}case`page_view`:return _=e.path,t&&y(t)?C():w(e=>v(e.trigger));case`reset_progress`:{let t=typeof e.guide==`string`&&f(e.guide);return t===void 0?[]:((!t||s?.guide===t)&&(s=null),t?delete a.guides[t.id]:a.guides={},[{type:`progress_reset`,guide_id:t?t.id:void 0},...T()])}case`event`:return t?.complete_on.type===`event`&&t.complete_on.name===e.name?C():w(t=>t.trigger.type===`event`&&t.trigger.name===e.name);case`tap`:return t?.complete_on.type===`tap_anchor`&&t.anchor===e.anchor?C():[];case`complete`:return t?.id===e.step?C():[];case`next`:return t?.complete_on.type===`next_button`?C():[];case`back`:return!t||s.index===0?[]:(s={...s,index:s.index-1},g(s.guide,`running`,s.index),[p(`step_shown`,s.guide,s.index)]);case`hide`:return t&&(l.add(s.guide.id),s=null),[];case`close`:if(s?.status!==`completed`)return[];case`dismiss`:return S();case`start`:{let n=f(e.guide);return!n||!m(n)||t&&s.guide===n&&n.steps.slice(0,s.index).every(y)?[]:S().concat(x(n,0))}case`anchor_missing`:return!t||t.anchor!==e.anchor||c===e.anchor?[]:(c=e.anchor,[{...p(`anchor_missing`,s.guide,s.index),anchor:e.anchor}]);case`identify`:return o={...o,...e.traits},[]}}return{get active(){return s},progress:a,dispatch:E,launcherGuides:()=>d.filter(e=>e.launcher!==!1&&m(e))}}const o=`0.5.1`,s=`playstep_preview`;function c(t,n,r,i=`web`){let c,l,u,d,f,p,m,h={},g=[],_=[],v=()=>`p:${c.appKey}`,y=()=>c.preview||e.set(v(),l.progress),b=e=>{let t={...e,ts:Date.now()};c?.preview||(d?d.send(t):_.push(t)),c?.onEvent?.(t)},x=e=>{try{b({type:`sdk_error`,message:String(e)})}catch{}},S=e=>(...t)=>{try{e(...t)}catch(e){x(e)}},C=(e,t)=>S(n=>w({type:e,[t]:n}));function w(t){if(!l)return void g.push(t);let n=l.dispatch(t);y(),n.forEach(S(b)),(l.active||e.get(`q`))&&E(),d?.update()}function T(){return p??(p=document.body.appendChild(document.createElement(`playstep-root`)).attachShadow({mode:`open`}))}function E(){return f??(f=t().then(e=>{let t=T();return t.innerHTML=``,d=e.mount({engine:l,config:u,options:c,root:t,outbox:_,userId:()=>m,dispatch:S(w),emit:S(b)})}).catch(x))}let D,O=S((e={})=>{l?l.launcherGuides().length&&E().then(t=>t?.openLauncher(e.anchor)):D=e});function k(e){e.launcher?.enabled&&l.launcherGuides().length&&!f&&n&&n().then(t=>{f||t.drawLauncher(T(),l,e,O,c)}).catch(x)}async function A(){let t=c,n=(t.apiBase??`https://cdn.playstep.app`).replace(/\/$/,``),o=null;try{o=new URLSearchParams(location.search).get(s)||(t.config?null:sessionStorage.getItem(s))}catch{}t.preview||(t.preview=!!(t.config||o));let d=t.config;try{d??(d=await fetch(`${n}/v1/${o?`preview/${o}?key=`:`config/`}${t.appKey}`).then(e=>e.json()))}catch{return}try{o&&sessionStorage[d.guides?`setItem`:`removeItem`](s,o)}catch{}if(d?.capture)return void r?.().then(e=>e.start(d.capture,t.appKey)).catch(x);if(d?.guides&&!d.flags?.disabled&&(u=d,t.eventsUrl=d.ingest_url??`${n}/v1/events`,l=a({config:d,platform:i,progress:t.preview?void 0:e.get(v())??void 0,traits:h}),w({type:`init`,path:location.pathname}),g.splice(0).forEach(w),D&&O(D),k(d),t.autoPageViews!==!1)){let e=location.pathname,t=S(()=>location.pathname!==e&&w({type:`page_view`,path:e=location.pathname}));for(let e of[`pushState`,`replaceState`]){let n=history[e];history[e]=function(...e){n.apply(this,e),t()}}addEventListener(`popstate`,t)}}return{version:o,init:S(e=>{if(c||!e?.appKey)return;c={...e};let t=()=>setTimeout(()=>A().catch(x));document.readyState===`complete`?t():addEventListener(`load`,t)}),identify:S((e,t)=>{m=e,h={...h,...t},w({type:`identify`,traits:h})}),track:C(`event`,`name`),start:C(`start`,`guide`),complete:C(`complete`,`step`),page:S(e=>w({type:`page_view`,path:e??location.pathname})),openLauncher:O,resetProgress:C(`reset_progress`,`guide`),reset:S(()=>{w({type:`dismiss`}),m=void 0,h={},l&&(Object.assign(l.progress,{seen:!1,guides:{}}),y(),d?.update()),c?.preview||e.set(`d`,null)})}}export{c as n,o as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./sdk-uFgPUdIh.js";import{t}from"./util-oI8xpB8k.js";import{t as n}from"./mode-CPlpg1Yl.js";import{computePosition as r,flip as i,offset as a,shift as o}from"@floating-ui/dom";import{render as s}from"preact";import{useEffect as c,useLayoutEffect as l,useRef as u,useState as d}from"preact/hooks";import{Fragment as f,jsx as p,jsxs as m}from"preact/jsx-runtime";function h(e,t,n=`en`){return e?e[t]??e[t.split(`-`)[0]]??e[n]??Object.values(e)[0]??``:``}function g(e){try{let t=new URL(e),n=t.hostname.replace(/^(www|m)\./,``),r;if(n===`youtu.be`?r=t.pathname.slice(1):n===`youtube.com`&&(r=t.searchParams.get(`v`)??t.pathname.match(/^\/(?:embed|shorts)\/([\w-]+)/)?.[1]),r)return{src:`https://www.youtube-nocookie.com/embed/${r}?autoplay=1&rel=0`,thumb:`https://i.ytimg.com/vi/${r}/hqdefault.jpg`};if(r=n===`vimeo.com`||n===`player.vimeo.com`?t.pathname.match(/(\d{5,})/)?.[1]:null,r)return{src:`https://player.vimeo.com/video/${r}?autoplay=1`}}catch{}return null}const _=e=>{let t=Math.round(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`};function v(e){let t=Number.parseInt(e.slice(1),16),n=e=>(e/=255)<=.03928?e/12.92:((e+.055)/1.055)**2.4,r=.2126*n(t>>16&255)+.7152*n(t>>8&255)+.0722*n(t&255);return 1.05/(r+.05)>=(r+.05)/.0595?`#ffffff`:`#151823`}const y={x:`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`,play:`<path d="M5 5a2 2 0 0 1 3-1.7l12 7a2 2 0 0 1 0 3.5l-12 7A2 2 0 0 1 5 19z"/>`,"volume-2":`<path d="M11 4.7a.7.7 0 0 0-1.2-.5L6.4 7.6A1.4 1.4 0 0 1 5.4 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.4a1.4 1.4 0 0 1 1 .4l3.4 3.4A.7.7 0 0 0 11 19.3z"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.4 18.4a9 9 0 0 0 0-12.7"/>`,"volume-x":`<path d="M11 4.7a.7.7 0 0 0-1.2-.5L6.4 7.6A1.4 1.4 0 0 1 5.4 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.4a1.4 1.4 0 0 1 1 .4l3.4 3.4A.7.7 0 0 0 11 19.3z"/><path d="m16.5 14.5 5-5"/><path d="m16.5 9.5 5 5"/>`,check:`<path d="M20 6 9 17l-5-5"/>`,"maximize-2":`<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>`,"arrow-right":`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`,"rotate-ccw":`<path d="M3 12a9 9 0 1 0 9-9 9.8 9.8 0 0 0-6.7 2.7L3 8"/><path d="M3 3v5h5"/>`,"external-link":`<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>`,"ps-launcher":`<path d="M12 21a9 9 0 1 0-8-5L3 21l5-.9A9 9 0 0 0 12 21z"/><path d="M10 9v6l5-3z"/>`,"ps-level-up":`<path d="M3 21h5v-4h5v-4h5V9"/><path d="M18 9V3l4 2.5L18 8"/>`,"ps-guide":`<rect x="4" y="3" width="4" height="18" rx="2"/><path d="M12 5.5v10l7.5-5z"/>`};function b({name:e}){return/* @__PURE__ */ p(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:y[e]}})}function x(e){try{let t=JSON.parse(sessionStorage.getItem(`playstep:clips`)??`[]`);if(t.includes(e))return!1;sessionStorage.setItem(`playstep:clips`,JSON.stringify([...t,e].slice(-200)))}catch{}return!0}const S=e=>e.options.locale??navigator.language??`en`,C=(e,t)=>h(t.name,S(e),t.locale_default)||t.id;function w({ctx:e,guide:t,index:n,reduced:r,clip:i,big:a,onExpand:o,onDuration:s}){let l=t.steps[n],v=u(null),[y,C]=d(!0),[w,T]=d(!r&&i.source!==`embed`),[E,D]=d(i.duration_ms??0),O=r=>e.emit({type:r,guide_id:t.id,guide_version:t.version,step_id:l.id,step_index:n,clip_id:i.source===`hosted`?i.clip_id:void 0,clip_source:i.source}),k=e=>x(`${e}|${i.url}`)&&O(e);if(c(()=>{let e=v.current;e&&w&&(e.muted=y,e.play()?.catch(()=>{}))},[w,i.url]),c(()=>s(w&&i.source!==`embed`?E:0),[E,w]),i.source===`embed`){let t=g(i.url),n=new URL(i.url).hostname.replace(/^www\./,``);return/* @__PURE__ */ p(`div`,{class:`clip embed`,children:w&&t?/* @__PURE__ */ p(`iframe`,{src:t.src,title:`Video: ${h(l.title,S(e))}`,allow:`autoplay; encrypted-media; picture-in-picture; fullscreen`,allowFullScreen:!0}):/* @__PURE__ */ m(f,{children:[(i.poster??t?.thumb)&&/* @__PURE__ */ p(`img`,{src:i.poster??t?.thumb,alt:``}),/* @__PURE__ */ p(`button`,{class:`play`,"aria-label":`Play video`,onClick:()=>(T(!0),O(`clip_played`)),children:/* @__PURE__ */ p(b,{name:`play`})}),/* @__PURE__ */ p(`div`,{class:`bar`,children:/* @__PURE__ */ m(`span`,{class:`pill`,children:[/* @__PURE__ */ p(b,{name:`external-link`}),n,E?` · ${_(E)}`:``]})})]})})}return/* @__PURE__ */ m(`div`,{class:`clip`,children:[w?/* @__PURE__ */ p(`video`,{ref:v,src:i.url,poster:i.poster,muted:y,loop:!0,autoplay:!0,playsInline:!0,preload:`auto`,"aria-label":`Clip: ${h(l.title,S(e))}`,onLoadedData:()=>k(`clip_loaded`),onPlaying:()=>k(`clip_played`),onLoadedMetadata:e=>{let t=e.currentTarget.duration;Number.isFinite(t)&&D(t*1e3)}}):/* @__PURE__ */ m(f,{children:[i.poster&&/* @__PURE__ */ p(`img`,{src:i.poster,alt:``}),/* @__PURE__ */ p(`button`,{class:`play`,"aria-label":`Play clip`,onClick:()=>T(!0),children:/* @__PURE__ */ p(b,{name:`play`})})]}),w&&/* @__PURE__ */ m(`div`,{class:`bar`,children:[/* @__PURE__ */ m(`span`,{class:`pill`,children:[/* @__PURE__ */ p(b,{name:`play`}),E?`${_(E)} loop`:`Loop`]}),/* @__PURE__ */ p(`button`,{class:`round`,"aria-label":y?`Unmute clip`:`Mute clip`,onClick:()=>{C(!y),v.current&&(v.current.muted=!y),y&&O(`clip_unmuted`)},children:/* @__PURE__ */ p(b,{name:y?`volume-x`:`volume-2`})}),/* @__PURE__ */ p(`button`,{class:`round`,"aria-label":a?`Shrink clip`:`Expand clip`,"aria-pressed":a,onClick:o,children:/* @__PURE__ */ p(b,{name:`maximize-2`})})]})]})}function T({ctx:e,guide:t,index:n,reduced:r,cardRef:i,style:a}){let o=t.steps[n],s=t.steps.length,[l,u]=d(!1),[f,g]=d(0),_=n=>h(n,S(e),t.locale_default),v=o.complete_on.type===`next_button`;return c(()=>{u(!1);let i=t.steps[n+1],a=i?.clip;if(a&&a.source!==`embed`&&!r&&!navigator.connection?.saveData){let r=document.createElement(`video`);r.preload=`auto`,r.muted=!0,r.src=a.url,a.source===`hosted`&&x(`clip_loaded|${a.url}`)&&e.emit({type:`clip_loaded`,guide_id:t.id,guide_version:t.version,step_id:i.id,step_index:n+1,clip_id:a.clip_id,clip_source:`hosted`})}},[t.id,n]),/* @__PURE__ */ m(`div`,{ref:i,class:`card${l?` big`:``}`,style:a,role:`dialog`,"aria-modal":`false`,"aria-labelledby":`ps-title`,"aria-describedby":`ps-text`,tabIndex:-1,"data-step":o.id,children:[o.clip&&/* @__PURE__ */ p(w,{ctx:e,guide:t,index:n,reduced:r,clip:o.clip,big:l,onExpand:()=>u(!l),onDuration:g},o.id),/* @__PURE__ */ m(`div`,{class:`body`,children:[/* @__PURE__ */ m(`div`,{class:`meta`,children:[/* @__PURE__ */ m(`span`,{children:[`Step `,n+1,` of `,s,` · `,C(e,t)]}),/* @__PURE__ */ p(`button`,{class:`x`,"aria-label":`Close guide`,onClick:()=>e.dispatch({type:`dismiss`}),children:/* @__PURE__ */ p(b,{name:`x`})})]}),/* @__PURE__ */ p(`div`,{class:`steps`,role:`img`,"aria-label":`Step ${n+1} of ${s}`,children:t.steps.map((e,t)=>/* @__PURE__ */ p(`span`,{class:`seg${t<n?` done`:t===n?` cur${f&&!r?` anim`:``}`:``}`,style:t===n&&f?{"--d":`${f}ms`}:void 0},t))}),/* @__PURE__ */ p(`h2`,{class:`title`,id:`ps-title`,children:_(o.title)}),/* @__PURE__ */ p(`p`,{class:`text`,id:`ps-text`,children:_(o.body)})]}),/* @__PURE__ */ m(`div`,{class:`foot`,children:[v?/* @__PURE__ */ p(`span`,{class:`sp`}):/* @__PURE__ */ m(`span`,{class:`wait`,children:[/* @__PURE__ */ p(`span`,{class:`pulse`,"aria-hidden":`true`}),`Waiting for you`]}),n>0&&t.steps[n-1].complete_on.type!==`page`&&!t.steps[n-1].skip_if_on&&/* @__PURE__ */ p(`button`,{class:`btn gho`,onClick:()=>e.dispatch({type:`back`}),children:`Back`}),v&&/* @__PURE__ */ m(`button`,{class:`btn pri`,onClick:()=>e.dispatch({type:`next`}),children:[n+1===s?`Done`:`Next`,/* @__PURE__ */ p(b,{name:`arrow-right`})]})]})]})}const E=[`width:22px;height:8px;left:22%;top:14px;transform:rotate(-20deg);background:var(--ps-accent)`,`width:10px;height:10px;left:30%;top:46px;background:var(--ps-spark)`,`width:12px;height:12px;right:24%;top:10px;background:var(--ps-chart-4)`,`width:24px;height:8px;right:20%;top:44px;transform:rotate(24deg);background:var(--ps-chart-5)`,`width:8px;height:8px;left:16%;top:60px;background:var(--ps-chart-5)`,`width:8px;height:8px;right:30%;top:64px;background:var(--ps-accent)`];function D({ctx:e,guide:t}){let n=e.engine.launcherGuides().find(n=>n.id!==t.id&&e.engine.progress.guides[n.id]?.status!==`done`),r=u(null);return c(()=>r.current?.focus(),[]),/* @__PURE__ */ m(f,{children:[/* @__PURE__ */ p(`div`,{class:`scrim`,onClick:()=>e.dispatch({type:`close`})}),/* @__PURE__ */ m(`div`,{class:`cel`,ref:r,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`ps-cel`,tabIndex:-1,children:[/* @__PURE__ */ m(`div`,{class:`art`,"aria-hidden":`true`,children:[E.map((e,t)=>/* @__PURE__ */ p(`span`,{class:`bit`,style:e},t)),/* @__PURE__ */ p(`span`,{class:`tile`,children:/* @__PURE__ */ p(b,{name:`ps-level-up`})})]}),/* @__PURE__ */ p(`h2`,{id:`ps-cel`,children:`Level cleared`}),/* @__PURE__ */ m(`p`,{children:[`You finished `,C(e,t),`.`,n?` Next up: ${C(e,n)}.`:``]}),/* @__PURE__ */ m(`div`,{class:`acts`,children:[/* @__PURE__ */ m(`button`,{class:`btn sec`,onClick:()=>e.dispatch({type:`start`,guide:t.id}),children:[/* @__PURE__ */ p(b,{name:`rotate-ccw`}),`Replay`]}),n?/* @__PURE__ */ m(`button`,{class:`btn pri`,onClick:()=>e.dispatch({type:`start`,guide:n.id}),children:[`Next guide`,/* @__PURE__ */ p(b,{name:`arrow-right`})]}):/* @__PURE__ */ p(`button`,{class:`btn pri`,onClick:()=>e.dispatch({type:`close`}),children:`Done`})]})]})]})}function O({ctx:e,open:t,setOpen:n,near:s}){let d=u(null);l(()=>{let e=d.current;e&&(e.style.cssText=``,s&&r(s,e,{strategy:`fixed`,placement:`top-start`,middleware:[a(8),i({padding:12}),o({padding:12})]}).then(({x:t,y:n})=>e.style.cssText=`left:${t}px;top:${n}px;right:auto;bottom:auto`))},[t,s]);let g=u(null);c(()=>{t?(g.current=e.root.activeElement??document.activeElement,d.current?.focus()):g.current?.focus()},[t]);let _=e.config.launcher,v=e.engine.launcherGuides();if(!v.length)return null;let y=e.engine.progress.guides,x=v.filter(e=>!y[e.id]).length,w=_?.position===`bottom-left`?` left`:``;return/* @__PURE__ */ m(f,{children:[t&&/* @__PURE__ */ m(`div`,{class:`panel${w}${_?.enabled?``:` solo`}`,ref:d,tabIndex:-1,role:`dialog`,"aria-label":`Guides`,children:[/* @__PURE__ */ p(`button`,{class:`x`,"aria-label":`Close guides`,onClick:()=>n(!1),children:/* @__PURE__ */ p(b,{name:`x`})}),/* @__PURE__ */ p(`h2`,{children:h(_?.title,S(e))||`Need a hand?`}),/* @__PURE__ */ p(`p`,{children:h(_?.description,S(e))||`Pick a guide and play it step by step.`}),/* @__PURE__ */ p(`ul`,{class:`rows`,children:v.map(t=>{let r=y[t.id],i=t.steps.length,a=r?.status===`done`,o=r?.status===`running`;return/* @__PURE__ */ p(`li`,{children:/* @__PURE__ */ m(`button`,{class:`row`,onClick:()=>{n(!1),r&&e.dispatch({type:`reset_progress`,guide:t.id}),e.dispatch({type:`start`,guide:t.id})},children:[/* @__PURE__ */ p(`span`,{class:`ti${a?` mint`:r?``:` spark`}`,children:/* @__PURE__ */ p(b,{name:a?`check`:`ps-guide`})}),/* @__PURE__ */ m(`span`,{class:`rb`,children:[/* @__PURE__ */ p(`span`,{class:`rt`,children:C(e,t)}),/* @__PURE__ */ p(`span`,{class:`rm`,children:a?`Completed`:o?`Step ${r.step+1} of ${i}`:`${i} steps`}),o&&/* @__PURE__ */ p(`span`,{class:`prog`,"aria-hidden":`true`,children:/* @__PURE__ */ p(`i`,{style:{width:`${r.step/i*100}%`}})})]}),r?/* @__PURE__ */ m(`span`,{class:`rp`,children:[/* @__PURE__ */ p(b,{name:`rotate-ccw`}),`Replay`]}):/* @__PURE__ */ p(`span`,{class:`new`,children:`New`})]})},t.id)})}),v.some(e=>y[e.id])&&/* @__PURE__ */ p(`div`,{class:`acts so`,children:/* @__PURE__ */ p(`button`,{class:`btn gho`,onClick:()=>{e.dispatch({type:`reset_progress`}),e.engine.active?n(!1):d.current?.focus()},children:`Start over`})}),e.config.flags?.show_badge!==!1&&/* @__PURE__ */ m(`a`,{class:`pb`,href:`https://playstep.app/?ref=badge`,target:`_blank`,rel:`noopener`,children:[/* @__PURE__ */ p(`span`,{dangerouslySetInnerHTML:{__html:`<svg viewBox="0 0 48 48" aria-hidden="true"><rect width="48" height="48" rx="13" fill="#2E5BFF"/><rect x="11" y="10" width="8" height="28" rx="4" fill="#fff"/><path d="M23.5 12v17l12-8.5z" fill="#FFC933" stroke="#FFC933" stroke-width="3.5" stroke-linejoin="round"/></svg>`},style:`display:inline-flex;width:16px;height:16px`}),`Powered by PlayStep`]})]}),_?.enabled&&/* @__PURE__ */ m(`button`,{class:`lb${w}`,"aria-label":t?`Close guides`:`Open guides`,"aria-expanded":t,onClick:()=>n(!t),children:[/* @__PURE__ */ p(b,{name:`ps-launcher`}),x>0&&!t&&/* @__PURE__ */ p(`span`,{class:`cnt`,children:x})]})]})}document.currentScript?.src;const k=()=>import(`./transport-Cu51h2G6.js`),A=e=>!!e?.getClientRects().length;function j(){if([...document.querySelectorAll(`[aria-modal="true"],[role="dialog"],[role="alertdialog"],[role="listbox"],[role="menu"]`)].some(A))return!0;try{return!!document.querySelector(`:popover-open`)}catch{return!1}}function M(e,t){let n=document.querySelector(`[data-guide="${CSS.escape(e)}"]`);try{n||(n=t?[...document.querySelectorAll(t.css)].find(e=>A(e)&&(!t.text||e.innerText.includes(t.text)))??null:null)}catch{}return A(n)?n:null}function N(e,t,n){let[r,i]=d(()=>e?M(e,t):null);return c(()=>{if(!e)return i(null);let r=M(e,t);i(r);let a=0,o=()=>{a=0;let n=M(e,t);n!==r&&i(r=n)},s=new MutationObserver(()=>a||(a=requestAnimationFrame(o)));s.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-guide`,`hidden`,`style`,`class`]});let c=setTimeout(()=>!r&&n(e),3e3);return()=>{s.disconnect(),clearTimeout(c),cancelAnimationFrame(a)}},[e,t]),r}function P(e,n,s,c,u){let[f,p]=d(null);return l(()=>{let l=n.current;if(!l)return;if(!e){let e=()=>p({x:(innerWidth-l.offsetWidth)/2,y:c===`center`?(innerHeight-l.offsetHeight)/2:innerHeight-l.offsetHeight-24});e();let t=new ResizeObserver(e);return t.observe(l),addEventListener(`resize`,e),()=>{t.disconnect(),removeEventListener(`resize`,e)}}let u=e.getBoundingClientRect();(u.bottom<0||u.top>innerHeight)&&e.scrollIntoView({block:`center`,behavior:t()?`auto`:`smooth`});let d=()=>{let t=e.getBoundingClientRect(),n=Number.parseFloat(getComputedStyle(e).borderTopLeftRadius)||8;r(e,l,{strategy:`fixed`,placement:s===`auto`?`bottom`:s,middleware:[a(18),i({fallbackPlacements:[`top`,`left`,`right`],padding:12}),o({padding:12})]}).then(({x:e,y:r})=>p({x:e,y:r,spot:{x:t.left-6,y:t.top-6,w:t.width+12,h:t.height+12,r:Math.min(n+6,(t.height+12)/2)}}))};d();let f=new ResizeObserver(d);f.observe(e),f.observe(l),addEventListener(`scroll`,d,{capture:!0,passive:!0}),addEventListener(`resize`,d);let m=setInterval(d,400);return()=>{f.disconnect(),clearInterval(m),removeEventListener(`scroll`,d,{capture:!0}),removeEventListener(`resize`,d)}},[e,c,s,...u]),f}function F({ctx:e,guide:t,index:n,reduced:r}){let i=t.steps[n],a=N(i.anchor,i.find?.web,t=>e.dispatch({type:`anchor_missing`,anchor:t})),o=u(null);c(()=>{if(!a)return;let t=t=>t.composedPath().includes(a)&&e.dispatch({type:`tap`,anchor:i.anchor});return document.addEventListener(`click`,t,!0),()=>document.removeEventListener(`click`,t,!0)},[a]);let s=t.theme?.position??`bottom`,l=P(a,o,i.placement??`auto`,s,[i.id]),h=u(``);c(()=>{l&&h.current!==i.id&&(h.current=i.id,document.activeElement?.matches(`input,textarea,select,[contenteditable]:not([contenteditable=false])`)||o.current?.focus({preventScroll:!0}))},[i.id,l]);let[g,_]=d(!1);c(()=>{l&&!g&&requestAnimationFrame(()=>_(!0))},[l]),c(()=>{let t=t=>{if(t.key!==`Tab`||!o.current)return;let n=[...o.current.querySelectorAll(`button,a,iframe,[tabindex="0"]`)],r=t.composedPath().includes(o.current),i=n[0],s=n.at(-1),c=e.root.activeElement;r&&!t.shiftKey&&c===s?(t.preventDefault(),(a??i)?.focus()):r&&t.shiftKey&&c===i?(t.preventDefault(),(a??s)?.focus()):a&&document.activeElement===a&&(t.preventDefault(),(t.shiftKey?s:i)?.focus())};return document.addEventListener(`keydown`,t,!0),()=>document.removeEventListener(`keydown`,t,!0)},[a]);let v=l?.spot;return/* @__PURE__ */ m(f,{children:[a&&v?/* @__PURE__ */ p(`div`,{class:`spot`,"aria-hidden":`true`,style:{width:`${v.w}px`,height:`${v.h}px`,transform:`translate(${v.x}px,${v.y}px)`,borderRadius:`${v.r}px`}}):!a&&s===`center`&&/* @__PURE__ */ p(`div`,{class:`scrim`,"aria-hidden":`true`}),/* @__PURE__ */ p(T,{ctx:e,guide:t,index:n,reduced:r,cardRef:o,style:l?{transform:`translate(${Math.round(l.x)}px,${Math.round(l.y)}px)`,transition:g?void 0:`none`}:{visibility:`hidden`}})]})}function I({ctx:e,handle:r}){let[,i]=d(0),a=()=>i(e=>e+1),[o,s]=d(!1),[l,u]=d(),f=t();r.update=a,r.openLauncher=t=>{let n=document.activeElement;u(t??(n!==document.body&&n!==e.root.host?n??void 0:void 0)),s(!0)},c(()=>{let t=t=>{if(t.key!==`Escape`||t.defaultPrevented||!t.composedPath().includes(e.root.host)||j())return;let n=e.engine.active;if(o)s(!1);else if(n?.status===`completed`)e.dispatch({type:`close`});else if(n){let t=n.guide.steps[n.index],r=t.anchor?M(t.anchor,t.find?.web):null;e.dispatch({type:`hide`}),r?.focus({preventScroll:!0})}};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[o]),c(()=>{let e=new MutationObserver(a),t=matchMedia(`(prefers-color-scheme: dark)`);for(let t of[document.documentElement,document.body])e.observe(t,{attributes:!0});return t.addEventListener(`change`,a),()=>{e.disconnect(),t.removeEventListener(`change`,a)}},[]);let g=e.engine.active,_=g?.guide,y=n(e.config,e.options.colorMode,_?.theme?.mode)?`dark`:`light`;e.root.host.setAttribute(`data-mode`,y);let b=e.config.theme,x=_?.theme?.accent,C={};for(let[e,t]of Object.entries({...b?.[y],..._?.theme?.resolved?.[y]??(!b&&x&&{accent:x,"accent-hover":x,"on-accent":v(x)})}))C[`--ps-${e}`]=t;let w=g?.status===`running`?g.guide.steps[g.index]:void 0;return/* @__PURE__ */ m(`div`,{class:`l`,style:C,children:[/* @__PURE__ */ p(O,{ctx:e,open:o,setOpen:s,near:l}),!o&&g?.status===`running`&&/* @__PURE__ */ p(F,{ctx:e,guide:g.guide,index:g.index,reduced:f},g.guide.id),!o&&g?.status===`completed`&&/* @__PURE__ */ p(D,{ctx:e,guide:g.guide}),/* @__PURE__ */ p(`div`,{class:`sr`,"aria-live":`polite`,children:w?`Step ${g.index+1} of ${g.guide.steps.length}: ${h(w.title,S(e))}`:g?`Level cleared`:``})]})}function L(t){let n=t.options,r=e=>void t.outbox.push(e);k().then(({createTransport:i})=>{let a=i({appKey:n.appKey,url:n.eventsUrl,sdk:n.sdkName??`web`,version:e,preview:n.preview,userId:t.userId,send:n.transport});t.outbox.splice(0).forEach(a.push),r=a.push}).catch(e=>t.emit({type:`sdk_error`,message:String(e)}));let i=document.createElement(`style`);i.textContent=`:host{--ps-radius-md:14px;--ps-radius-lg:20px;--ps-font-display:"Bricolage Grotesque","Figtree",system-ui,sans-serif;--ps-font-sans:"Figtree",system-ui,-apple-system,"Segoe UI",sans-serif;--ps-clip-overlay:rgba(12,14,19,.72);--ps-ease:cubic-bezier(.2,.8,.2,1);--ps-accent:var(--ps-primary);--ps-accent-hover:var(--ps-primary-hover);--ps-on-accent:var(--ps-on-primary);--ps-surface:#fff;--ps-surface-sunken:#f5f6f9;--ps-surface-raised:#fff;--ps-line:#e3e6ec;--ps-ink:#151823;--ps-ink-secondary:#454b5c;--ps-ink-muted:#646b7d;--ps-primary:#2e5bff;--ps-primary-hover:#2149e6;--ps-primary-soft:#e8edff;--ps-primary-ink:#2149e6;--ps-on-primary:#fff;--ps-spark:#ffc933;--ps-spark-soft:#fff4cc;--ps-spark-ink:#7a5a00;--ps-on-spark:#151823;--ps-scrim:rgba(12,14,19,.64);--ps-tag-mint:#ddf5ea;--ps-chart-4:#14b37d;--ps-chart-5:#ff7a59;--ps-shadow-lg:0 20px 48px -12px rgba(21,24,35,.28),0 4px 10px rgba(21,24,35,.06);--ps-ring-focus:0 0 0 2px #fff,0 0 0 4px #2e5bff}:host([data-mode=dark]){--ps-surface:#161922;--ps-surface-sunken:#1d212b;--ps-surface-raised:#222633;--ps-line:#2a2f3c;--ps-ink:#f2f4f8;--ps-ink-secondary:#c5cad5;--ps-ink-muted:#959cad;--ps-primary:#7091ff;--ps-primary-hover:#8da7ff;--ps-primary-soft:#1c2550;--ps-primary-ink:#93abff;--ps-on-primary:#0c0e13;--ps-spark:#ffd452;--ps-spark-soft:#3a2f0a;--ps-spark-ink:#ffd86b;--ps-on-spark:#151823;--ps-scrim:rgba(0,0,0,.72);--ps-tag-mint:#0f2c22;--ps-chart-4:#3dd9a0;--ps-chart-5:#ff9478;--ps-shadow-lg:0 20px 48px -12px rgba(0,0,0,.8),0 4px 10px rgba(0,0,0,.5);--ps-ring-focus:0 0 0 2px #161922,0 0 0 4px #7091ff}:host{all:initial}*{box-sizing:border-box;margin:0}.l{position:fixed;inset:0;pointer-events:none;z-index:2147483000;font:400 14px/20px var(--ps-font-sans);color:var(--ps-ink);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;border:0;padding:0;background:none;cursor:pointer}button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:none;box-shadow:var(--ps-ring-focus)}svg{width:16px;height:16px;flex:none}.scrim{position:fixed;inset:0;background:var(--ps-scrim);pointer-events:auto}.spot,.card{position:fixed;left:0;top:0;transition:transform .36s var(--ps-ease),width .36s var(--ps-ease),height .36s var(--ps-ease)}.spot{box-shadow:0 0 0 9999px var(--ps-scrim)}.spot:after{content:"";position:absolute;inset:-4px;border-radius:18px;border:2px solid var(--ps-spark);animation:ring 1.8s ease-out infinite}.card,.cel,.panel{background:var(--ps-surface-raised);border-radius:var(--ps-radius-lg);box-shadow:var(--ps-shadow-lg);pointer-events:auto;outline:none}.card{width:336px;max-width:calc(100vw - 24px);padding:10px}.big{width:min(720px,calc(100vw - 24px))}.clip{position:relative;aspect-ratio:16/10;border-radius:var(--ps-radius-md);overflow:hidden;background:var(--ps-surface-sunken)}.clip>video,.clip>img,.clip>iframe{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border:0}.bar{position:absolute;left:8px;right:8px;bottom:8px;display:flex;align-items:center;gap:6px;color:#fff}.pill,.round{background:var(--ps-clip-overlay);border-radius:99px;display:inline-flex;align-items:center;justify-content:center}.pill{height:24px;padding:0 8px;gap:4px;font:700 11px/1 var(--ps-font-sans)}.pill svg{width:13px;height:13px}.round{width:28px;height:28px}.round svg{width:14px;height:14px}.bar .round:first-of-type{margin-left:auto}.play{position:absolute;inset:0;margin:auto;width:60px;height:60px;border-radius:50%;background:var(--ps-accent);color:var(--ps-on-accent);display:grid;place-items:center}.play svg{width:26px;height:26px}.body{padding:14px 8px 6px}.meta{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted);margin-bottom:10px}.meta span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.x{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;margin:-6px -6px -6px 0}.x:hover,.gho:hover,.row:hover,.sec:hover{background:var(--ps-surface-sunken);color:var(--ps-ink)}.steps{display:flex;gap:4px;margin-bottom:12px}.seg{flex:1;height:6px;border-radius:99px;background:var(--ps-surface-sunken);overflow:hidden;position:relative}.done{background:var(--ps-accent)}.cur:after{content:"";position:absolute;left:0;top:0;bottom:0;width:55%;border-radius:99px;background:var(--ps-spark)}.anim:after{animation:fill var(--d,4s) linear infinite}.title,.cel h2,.panel h2{font:700 20px/26px var(--ps-font-display);letter-spacing:-.01em;margin-bottom:4px}.text,.cel p{color:var(--ps-ink-secondary)}.foot{display:flex;align-items:center;gap:8px;padding:14px 8px 4px}.wait,.sp{flex:1}.wait{display:flex;align-items:center;gap:8px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted)}.pulse{width:8px;height:8px;border-radius:50%;background:var(--ps-spark);animation:pulse 1.6s ease-out infinite}.btn{height:32px;padding:0 14px;border-radius:var(--ps-radius-btn,99px);border:1px solid transparent;font-size:13px;line-height:18px;font-weight:600;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.pri{background:var(--ps-accent);color:var(--ps-on-accent)}.pri:hover{background:var(--ps-accent-hover)}.x{color:var(--ps-ink-muted)}.gho{color:var(--ps-ink-secondary)}.embed{background:#151823}.sec{background:var(--ps-surface);border-color:var(--ps-line)}.cel{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:336px;max-width:calc(100vw - 24px);padding:24px 20px 20px;text-align:center;overflow:hidden}.cel h2{font-size:24px;line-height:30px;font-weight:800}.cel p{margin-bottom:16px}.art{position:relative;height:72px;margin-bottom:8px}.tile{position:absolute;left:50%;top:4px;width:64px;height:64px;margin-left:-32px;border-radius:var(--ps-radius-lg);background:var(--ps-spark);color:var(--ps-on-spark);display:grid;place-items:center;animation:pop .6s cubic-bezier(.2,1.6,.4,1) both}.tile svg{width:30px;height:30px}.bit{position:absolute;border-radius:99px}.acts{display:flex;justify-content:center;gap:12px}.lb{position:fixed;bottom:24px;right:24px;width:56px;height:56px;border-radius:50%;background:var(--ps-accent);color:var(--ps-on-accent);box-shadow:var(--ps-shadow-lg);display:grid;place-items:center;pointer-events:auto}.lb svg{width:26px;height:26px}.cnt{position:absolute;top:-2px;right:-2px;min-width:20px;height:20px;padding:0 5px;border-radius:99px;background:var(--ps-spark);color:var(--ps-on-spark);font:800 11px/20px var(--ps-font-sans)}.panel{position:fixed;right:24px;bottom:96px;width:320px;max-width:calc(100vw - 36px);max-height:calc(100vh - 120px);overflow:auto;padding:16px}.left{right:auto;left:24px}.solo{bottom:24px}.panel .x{float:right}.panel>p{font-size:13px;line-height:18px;color:var(--ps-ink-muted);margin:-2px 0 12px}.rows{list-style:none;padding:0}.row{display:flex;align-items:center;gap:12px;width:100%;padding:10px;border-radius:var(--ps-radius-md);text-align:left}.ti{width:36px;height:36px;flex:none;border-radius:var(--ps-radius-md);display:grid;place-items:center;background:var(--ps-primary-soft);color:var(--ps-primary-ink)}.ti.spark{background:var(--ps-spark-soft);color:var(--ps-spark-ink)}.ti.mint{background:var(--ps-tag-mint);color:var(--ps-ink)}.ti svg{width:18px;height:18px}.rb{flex:1;min-width:0}.rt,.rm{display:block;font-weight:600}.rm{font-size:12px;line-height:16px;font-weight:500;color:var(--ps-ink-muted)}.prog{display:block;height:6px;border-radius:99px;background:var(--ps-surface-sunken);margin-top:6px;overflow:hidden}.prog i{display:block;height:100%;background:var(--ps-accent)}.rp{display:flex;align-items:center;gap:4px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted)}.so{margin-top:8px}.new{height:24px;padding:0 10px;border-radius:99px;background:var(--ps-spark-soft);color:var(--ps-spark-ink);font-size:12px;line-height:24px;font-weight:600}.pb{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:10px;font-size:12px;line-height:16px;font-weight:600;color:var(--ps-ink-muted);text-decoration:none}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}@keyframes ring{to{opacity:0;transform:scale(1.12)}}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--ps-spark)}70%,to{box-shadow:0 0 0 8px transparent}}@keyframes fill{0%{width:0}to{width:100%}}@keyframes pop{0%{opacity:0;transform:scale(.4) rotate(-12deg)}}@media (max-width:480px){.card{width:300px}.title{font-size:17px;line-height:22px}.lb{right:18px;bottom:18px}.panel{right:18px;bottom:86px}.solo{bottom:18px}.left{right:auto;left:18px}}@media (prefers-reduced-motion:reduce){.spot,.card{transition:none}.spot:after,.pulse,.cur:after,.tile{animation:none}}`,t.root.appendChild(i);let a=document.createElement(`div`);t.root.appendChild(a);let o={update:()=>{},openLauncher:()=>{},send:e=>r(e)};return s(/* @__PURE__ */ p(I,{ctx:t,handle:o}),a),o}export{M as findAnchor,j as hostPopupOpen,L as mount};