@spectosh/browser 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/point-4P-cvF8S.cjs +252 -0
- package/dist/{point-B777VT29.js → point-B5SXBYaU.js} +356 -349
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/specto-browser.cjs +1 -1
- package/dist/specto-browser.js +1 -1
- package/dist/{src-BfP2ol_O.cjs → src-BDf8wYoH.cjs} +5 -5
- package/dist/{src-oKUp2jmR.js → src-mrKmVGmE.js} +276 -265
- package/package.json +1 -1
- package/src/point/describe.js +15 -12
- package/src/point/index.js +3 -2
- package/src/recorder.js +14 -5
- package/src/scrub.js +13 -0
- package/types/index.d.ts +2 -0
- package/dist/point-rS_lg9Ro.cjs +0 -252
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
const e=require("./src-BDf8wYoH.cjs");var t=[`data-testid`,`data-test`,`data-test-id`,`data-cy`,`data-qa`],n=[`display`,`visibility`,`opacity`,`pointerEvents`,`zIndex`,`overflow`,`cursor`,`color`,`background`],r=new Set([`id`,`class`,`role`,`type`,`name`,`href`,`disabled`,`aria-disabled`,`aria-expanded`,`aria-busy`,`aria-hidden`,`aria-pressed`,`aria-selected`,`aria-checked`,`for`,`data-specto-src`,...t]),i=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]),a=e=>String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`),o=e=>String(e?.tagName||``).toLowerCase(),s=(e,t)=>{try{return e.getAttribute(t)}catch{return null}},c=e=>!!e&&e.length<=64&&!/\d{4,}|^:|:r\w*:|^(ember|react|radix|headlessui|mui|rc|el)[-_:]?\d/i.test(e)&&/^[A-Za-z][\w-]*$/.test(e),l=e=>e&&!e.startsWith(`specto-`)&&e.length<=40&&!/\d{3,}|^(css|sc|jsx|emotion|tw)-|__[A-Za-z0-9]{5,}$|^[a-z0-9]{6,}$/i.test(e);function u(t,n,r=``){let i=o(t);if(i===`input`||i===`textarea`||i===`select`||s(t,`contenteditable`)===`true`)return!0;if(n)return!e.v(t,r);for(let e=t;e&&e.nodeType===1;e=e.parentElement)if(e.classList?.contains(`specto-mask`)||e.classList?.contains(`specto-block`))return!0;return!1}function d(e){for(let n of t){let t=s(e,n);if(t)return[n,t]}return null}function f(e){let t=o(e),n=e.id;if(c(n))return{sel:`${t}#${n}`,anchor:!0};let r=d(e);if(r)return{sel:`${t}[${r[0]}="${a(r[1])}"]`,anchor:!0};let i=typeof e.className==`string`?e.className.trim().split(/\s+/).filter(l).slice(0,2):[],s=i.length?`${t}.${i.join(`.`)}`:t,u=e.parentElement;if(u){let n=Array.from(u.children||[]).filter(e=>o(e)===t);n.length>1&&(s+=`:nth-of-type(${n.indexOf(e)+1})`)}return{sel:s,anchor:!1}}function p(e,t=5){let n=[];for(let r=e,i=0;r&&r.nodeType===1&&i<t&&o(r)!==`html`&&o(r)!==`body`;r=r.parentElement,i++){let e=f(r);if(n.unshift(e.sel),e.anchor)break}return n.join(` > `)||o(e)||`body`}function m(t,n){let r=s(t,`aria-label`)||s(t,`title`)||s(t,`alt`);if(r&&!n)return e._(r).trim().slice(0,80);let i=s(t,`aria-labelledby`);if(i&&!n)try{let t=document.getElementById(i)?.textContent;if(t)return e._(t).trim().slice(0,80)}catch{}if(n)return``;let a=(t.innerText??t.textContent??``).replace(/\s+/g,` `).trim();return e._(a).slice(0,80)}function h(e){let t=s(e,`role`);if(t)return t;let n=o(e);return n===`a`&&s(e,`href`)!=null?`link`:n===`button`||n===`input`&&[`submit`,`button`,`reset`].includes(s(e,`type`))?`button`:n===`input`?s(e,`type`)===`checkbox`?`checkbox`:s(e,`type`)===`radio`?`radio`:`textbox`:n===`select`?`combobox`:n===`textarea`?`textbox`:/^h[1-6]$/.test(n)?`heading`:n===`img`?`img`:null}function g(e,{masked:t}={}){let n=[],r=d(e);r&&n.push(`[${r[0]}="${a(r[1])}"]`),c(e.id)&&n.push(`#${e.id}`);let i=h(e),o=m(e,t);return i&&o&&o.length<=40&&n.push(`role=${i}[name="${a(o)}"]`),n.push(p(e)),[...new Set(n)].slice(0,6)}function _(e){let t=null;for(let n=e;n&&n.nodeType===1&&!t;n=n.parentElement)t=s(n,`data-specto-src`);let n=e&&Object.keys(e).find(e=>e.startsWith(`__reactFiber$`)||e.startsWith(`__reactInternalInstance$`));if(n)for(let r=e[n],i=0;r&&i<60;r=r.return,i++){let e=r.type;if(!e||typeof e==`string`)continue;let n=e.displayName||e.name||e.render?.displayName||e.render?.name||e.type?.displayName||e.type?.name;if(n&&/^[A-Z]/.test(n)&&!/^(Fragment|Suspense|StrictMode|Profiler|Provider|Consumer|Context)/.test(n)){let e=r._debugSource;return!t&&e?.fileName&&(t=`${String(e.fileName).replace(/^.*?\/(src|app|pages|components)\//,`$1/`)}:${e.lineNumber}`),{component:n.slice(0,120),source:t}}}for(let n=e,r=0;n&&r<20;n=n.parentElement,r++){let e=n.__vueParentComponent;if(e){let n=e.type?.name||e.type?.__name||e.type?.__file&&String(e.type.__file).split(`/`).pop().replace(/\.vue$/,``);if(n)return{component:n,source:t||(e.type?.__file?String(e.type.__file).replace(/^.*?\/src\//,`src/`):null)}}let r=n.__svelte_meta;if(r?.loc?.file)return{component:String(r.loc.file).split(`/`).pop().replace(/\.svelte$/,``),source:t||`${r.loc.file}:${r.loc.line}`}}return{component:null,source:t}}function v(t){let n=[];for(let r=t.parentElement,i=0;r&&r.nodeType===1&&i<25&&n.length<6;r=r.parentElement,i++){let t=o(r);if(t===`body`||t===`html`)break;let i=s(r,`role`),a=s(r,`aria-label`);([`main`,`nav`,`header`,`footer`,`aside`,`form`,`dialog`,`section`,`table`].includes(t)||[`dialog`,`navigation`,`form`,`region`,`tabpanel`,`menu`].includes(i)||c(r.id)||d(r))&&n.unshift(`${t}${c(r.id)?`#${r.id}`:``}${a?`[${e._(a).slice(0,30)}]`:``}`)}return n}function y(e){let t={},n=o(e);e.disabled===!0||s(e,`aria-disabled`)===`true`?t.disabled=!0:[`button`,`input`,`select`,`textarea`].includes(n)&&(t.disabled=!1),n===`input`&&[`checkbox`,`radio`].includes(s(e,`type`))&&(t.checked=!!e.checked);let r=s(e,`aria-expanded`);return r!=null&&(t.expanded=r===`true`),s(e,`aria-busy`)===`true`&&(t.busy=!0),Object.keys(t).length?t:void 0}function b(e){try{let t=getComputedStyle(e),r={};for(let e of n){let n=e===`background`?t.backgroundColor:t[e];n!=null&&n!==``&&(r[e]=String(n).slice(0,80))}return r}catch{return{}}}function x(t,{strict:n=!1,unmask:a=``,maxNodes:s=60,maxDepth:c=4,maxChars:l=4e3}={}){let d=0,f=(t,p,m)=>{if(d++>s)return`…`;if(t.nodeType===3){let n=String(t.textContent||``).replace(/\s+/g,` `);return n.trim()?m?n.replace(/\S/g,`•`).slice(0,60):e._(n).slice(0,120).replace(/</g,`<`):n?` `:``}if(t.nodeType!==1)return``;let h=o(t);if([`script`,`style`,`noscript`,`template`,`svg`].includes(h))return h===`svg`?`<svg/>`:``;let g=n?u(t,!0,a)||!!t.closest?.(`[contenteditable="true"]`):m||u(t,!1),_=[];for(let n of Array.from(t.attributes||[])){if(!r.has(n.name))continue;let t=n.value;if(n.name===`href`)try{t=new URL(t,location.href).pathname}catch{t=``}n.name===`class`&&(t=t.split(/\s+/).filter(e=>e&&!e.startsWith(`specto-`)).slice(0,4).join(` `)),_.push(t===``?n.name:`${n.name}="${e._(t).slice(0,80).replace(/"/g,`"`)}"`)}h===`input`&&_.push(`value="[masked]"`);let v=`<${h}${_.length?` `+_.join(` `):``}>`;if(i.has(h))return v;if(p>=c)return`${v}…</${h}>`;let y=``;for(let e of Array.from(t.childNodes||[]))if(y+=f(e,p+1,g),y.length>l)break;return`${v}${y}</${h}>`};return f(t,0,u(t,n,a)).slice(0,l)}function S(e,t){let n=d(e);return[t.component,n?n[1]:null,t.name||o(e)].filter(Boolean).slice(0,2).join(` › `)||o(e)}function ee(t,{strict:n=!1,unmask:r=``}={}){let i=u(t,n,r),{component:a,source:c}=_(t),l=m(t,i),d=h(t),f=null;try{let e=t.getBoundingClientRect();f={x:Math.round(e.left),y:Math.round(e.top),w:Math.round(e.width),h:Math.round(e.height)}}catch{}return{tag:o(t),role:d,label:i?null:s(t,`aria-label`)?e._(s(t,`aria-label`)).slice(0,120):null,name:l?`${l}${d?` ${d}`:``}`:d||o(t),component:a,source:c,selectors:g(t,{masked:i}),path:v(t),rect:f,text:i?null:l||null,state:y(t),styles:b(t),snapshot:x(t,{strict:n,unmask:r})}}var C=1e3,w=6e3,T=1e4;function E(e,t,n=Date.now()){for(let r=e.length-1;r>=0;r--){let i=e[r];if(n-i.at>6e4)break;try{if(i.el&&t(i.el))return i.at}catch{}}return null}function te({recent:e,contains:t,now:n=Date.now()}){let r=E(e.clicks||[],t,n),[i,a]=r?[r-C,r+w]:[n-T,n],o=(e.network||[]).filter(e=>e.at>=i&&e.at<=a).slice(-20).map(e=>({at:e.at,method:e.method,url:e.url,status:e.status,dur:e.dur,...e.error?{error:!0}:{}})),s=(e.console||[]).filter(e=>e.level===`error`||e.level===`warn`).slice(-15).map(e=>({at:e.at,level:e.level,text:e.text})),c=(e.event||[]).filter(e=>e.type===`error`).slice(-5).map(e=>({at:e.at,level:`error`,text:e.message,stack:e.stack})),l=(e.event||[]).filter(e=>[`click`,`nav`,`rage`,`dead`,`custom`].includes(e.type)&&e.at<=n&&n-e.at<12e4).slice(-15).map(e=>({at:e.at,type:e.type,target:e.sel||e.target||null,path:e.path||null,name:e.name||null}));return{network:o,console:[...s,...c].sort((e,t)=>e.at-t.at).slice(-20),events:l,clickedAt:r}}function ne(){let e=navigator.userAgent||``,t=window.innerWidth,n=(navigator.maxTouchPoints||0)>0,r=e=>{try{return window.matchMedia(e).matches}catch{return!1}};return{browser:e.slice(0,200),os:/Windows/.test(e)?`Windows`:/Mac OS X|Macintosh/.test(e)?n?`iPadOS`:`macOS`:/Android/.test(e)?`Android`:/iPhone|iPad|iOS/.test(e)?`iOS`:/Linux/.test(e)?`Linux`:null,device:t<640?`phone`:t<1024&&n?`tablet`:`desktop`,locale:navigator.language||null,tz:(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return null}})(),reducedMotion:r(`(prefers-reduced-motion: reduce)`),colorScheme:r(`(prefers-color-scheme: dark)`)?`dark`:`light`,viewport:{w:t,h:window.innerHeight}}}var D=[`audio/webm;codecs=opus`,`audio/ogg;codecs=opus`,`audio/mp4`,`audio/webm`],O=.08,k=700,A=2e4,re=()=>typeof window<`u`&&window.MediaRecorder!==void 0&&!!navigator.mediaDevices?.getUserMedia;async function ie({onPhrase:e=()=>{},keep:t=!1}={}){let n=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),r=D.find(e=>{try{return MediaRecorder.isTypeSupported(e)}catch{return!1}})||``,i={...r?{mimeType:r}:{},audioBitsPerSecond:16e3},a=Date.now(),o=null,s=null,c=null;try{s=new(window.AudioContext||window.webkitAudioContext);let e=s.createMediaStreamSource(n);o=s.createAnalyser(),o.fftSize=1024,c=new Uint8Array(o.fftSize),e.connect(o)}catch{}let l=()=>{if(!o)return 0;o.getByteTimeDomainData(c);let e=0;for(let t of c)e+=(t-128)*(t-128);return Math.min(1,Math.sqrt(e/c.length)/40)},u=null,d=!1,f=()=>{if(d)return;let e=new MediaRecorder(n,i),t={rec:e,chunks:[],at:Date.now(),spoke:!o,loudAt:0};e.ondataavailable=e=>{e.data?.size&&t.chunks.push(e.data)},e.start(),u=t},p=()=>new Promise(t=>{let n=u;if(u=null,!n)return t();n.rec.onstop=()=>{if(n.spoke&&n.chunks.length){let t=n.rec.mimeType||r||`audio/webm`;try{e({blob:new Blob(n.chunks,{type:t}),mime:t,startedAt:n.at,endedAt:Date.now()})}catch{}}t()};try{n.rec.stop()}catch{t()}}),m=()=>{u&&(p(),f())};f();let h=setInterval(()=>{if(!u)return;let e=Date.now();o&&l()>=O&&(u.spoke=!0,u.loudAt=e),u.spoke&&(u.loudAt&&e-u.loudAt>k||e-u.at>A)&&m()},50),g=null;t&&(g={rec:new MediaRecorder(n,i),chunks:[]},g.rec.ondataavailable=e=>{e.data?.size&&g.chunks.push(e.data)},g.rec.start(1e3));let _=null;return{startedAt:a,level:l,cut:m,stop:()=>_||(d=!0,clearInterval(h),_=(async()=>{await p();let e=null;g&&(e=await new Promise(e=>{let t=g.rec.mimeType||r||`audio/webm`,n=()=>e({blob:new Blob(g.chunks,{type:t}),mime:t,startedAt:a});if(g.rec.state===`inactive`)return n();g.rec.onstop=n;try{g.rec.stop()}catch{n()}}));for(let e of n.getTracks())e.stop();try{s?.close()}catch{}return e})(),_)}}function ae(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]||``),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}var oe=`specto-point-used`,j=`specto-point-visits`,se=`specto-point-visit`,M=`specto-point-hint`,ce=`specto-point-nudged`,N=`specto-point-me`,P=`specto-point-hidden`,le=12e3,F=`specto-point-receipts`,I=7776e6,L=()=>{try{return(JSON.parse(localStorage.getItem(`specto-point-receipts`)||`[]`)||[]).filter(e=>e&&e.r&&Date.now()-e.at<I)}catch{return[]}},R=e=>V.set(localStorage,F,JSON.stringify(e.slice(-20))),z=e=>{let t=L().filter(t=>t.r!==e);t.push({r:e,at:Date.now()}),R(t),V.set(localStorage,`${F}-at`,String(Date.now()))},ue=e=>R(L().filter(t=>t.r!==e)),de=2e3,B=2592e6,V={get:(e,t)=>{try{return e.getItem(t)}catch{return null}},set:(e,t,n)=>{try{e.setItem(t,n)}catch{}}};function H(e,t=location.pathname){return!e?.length||e.some(e=>RegExp(`^${e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`)}$`).test(t))}function fe(e){let t=parseInt(String(e).slice(1),16);if(!Number.isFinite(t))return`#fff`;let[n,r,i]=[t>>16,t>>8&255,t&255].map(e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4));return .2126*n+.7152*r+.0722*i>.4?`#0E1320`:`#fff`}var U=()=>/Mac|iPhone|iPad/.test(globalThis.navigator?.platform||``);function pe(e,t=U()){return e.trigger===`double-ctrl`?t?[`⌘`,`⌘`]:[`Ctrl`,`Ctrl`]:e.trigger===`chord`?[`Alt`,`Shift`,`P`]:e.trigger===`hold-alt`?[t?`⌥`:`Alt`]:e.trigger===`hold-ctrl`?[`Ctrl`]:e.trigger===`custom`?String(e.shortcut?.label||``).split(`+`).filter(Boolean):[]}function me(e,t=U()){let n=pe(e,t);return n.length?e.trigger.startsWith(`hold`)?`hold ${n[0]}`:e.trigger===`double-ctrl`?n.join(` `):n.join(`+`):``}var W=e=>String(e).replace(/[&<>"]/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`})[e]),he=(e,t=`kc`)=>e.map(e=>`<kbd class="${t}">${W(e)}</kbd>`).join(``);function ge(e){let t=pe(e);return t.length?e.trigger===`double-ctrl`?`Tap ${t[0]===`⌘`?`⌘`:`Ctrl`} twice`:e.trigger.startsWith(`hold`)?`Hold ${t[0]}`:`Press ${t.join(`+`)}`:``}var G=[`bottom-right`,`bottom-left`,`edge`];function K(e,t){if(t===!1)return null;if(!t||typeof t!=`object`)return e;let n=e||{label:`Report a problem`,position:`bottom-right`,color:`#0E1320`,pages:[]},r=Array.isArray(t.offset)?t.offset.slice(0,2).map(e=>Math.max(0,Math.min(600,Math.round(Number(e)||0)))):null;return{...n,...G.includes(t.position)?{position:t.position}:{},...typeof t.label==`string`&&t.label.trim()?{label:t.label.trim().slice(0,40)}:{},.../^#[0-9a-f]{6}$/i.test(t.color||``)?{color:t.color}:{},...r&&r.length===2?{offset:r}:{}}}function _e(e,{used:t,visits:n,last:r,release:i,now:a=Date.now()}){return!e||t?!1:e.when===`monthly`?!r||a-r.at>=B:e.when===`release`?!!i&&r?.release!==i:n>=3&&!r}function ve(e,t,n){let r=0;if(t.includes(`network`))for(let t of e.network||[])t.at>n&&(t.error||t.status>=500)&&(r=Math.max(r,t.at));for(let i of e.event||[])i.at<=n||(i.type===`error`&&t.includes(`error`)||i.type===`rage`&&t.includes(`rage`)||i.type===`dead`&&t.includes(`dead`))&&(r=Math.max(r,i.at));return r}function ye(e,t,{open:n,may:r,local:i}){let a=e._point,o=typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches,s=o?[]:pe(t);V.get(sessionStorage,se)||(V.set(sessionStorage,se,`1`),V.set(localStorage,j,String((Number(V.get(localStorage,j))||0)+1)));let c=document.createElement(`div`);c.id=`specto-point-entry`,c.className=`specto-block`,c.setAttribute(`style`,`all:initial;position:fixed;top:0;left:0;width:0;height:0;overflow:visible;z-index:var(--specto-launcher-z,2147483645)`);let l=c.attachShadow({mode:`open`}),u=K(t.launcher,i),d={};try{d=JSON.parse(V.get(localStorage,N)||`{}`)||{}}catch{}let f=e=>{d={...d,...e},V.set(localStorage,N,JSON.stringify(d)),x(),B()},p=()=>u?.position===`edge`?`edge`:d.side||(u?.position===`bottom-left`?`left`:`right`),m=()=>p()===`left`?`left`:`right`;l.innerHTML=`<style>${J}</style>
|
|
2
|
+
<button class="pill" type="button" hidden>
|
|
3
|
+
<svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.5"/><circle class="d" cx="8" cy="8" r="1.6"/></svg>
|
|
4
|
+
<span class="lbl"></span>${s.length?`<span class="keys" aria-hidden="true">${he(s)}</span>`:``}
|
|
5
|
+
</button>
|
|
6
|
+
<div class="menu lmenu" role="menu" aria-label="Report a problem button" hidden>
|
|
7
|
+
<button class="m-open" type="button" role="menuitem">${W(u?.label||`Report a problem`)}</button>
|
|
8
|
+
<hr>
|
|
9
|
+
<button class="m-size" type="button" role="menuitem"></button>
|
|
10
|
+
<button class="m-side" type="button" role="menuitem"></button>
|
|
11
|
+
<button class="m-hide" type="button" role="menuitem">Hide for this visit</button>
|
|
12
|
+
<p class="tip">Or drag it out of the way</p>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="menu cmenu" role="menu" aria-label="Report a problem here" hidden>
|
|
15
|
+
<button class="c-go" type="button" role="menuitem"><svg class="ic" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.5"/><circle class="d" cx="8" cy="8" r="1.6"/></svg>Report a problem here</button>
|
|
16
|
+
<p class="tip">Shift + right-click for the browser’s menu</p>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="card nudge" role="dialog" aria-label="Something didn't work?" hidden>
|
|
19
|
+
<div class="hd"><span class="red" aria-hidden="true"></span><b>That didn’t work?</b></div>
|
|
20
|
+
<p>Show us what happened: point at it and say what you expected. Takes 20 seconds.</p>
|
|
21
|
+
<div class="row"><button class="go" type="button">Show us</button><button class="no" type="button">Not now</button>${s.length?`<span class="or">or ${he(s)}</span>`:``}</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="card hint" role="dialog" aria-label="Report a problem" hidden>
|
|
24
|
+
<div class="hd">${s.length?`<span class="big" aria-hidden="true">${he(s,`kc lg`)}</span>`:``}<b>Spot something broken?</b></div>
|
|
25
|
+
<p>${s.length?`${ge(t)}, click`:`${o?`Tap`:`Click`} “${W(K(t.launcher,i)?.label||`Report a problem`)}”, then ${o?`tap`:`click`}`} what’s wrong and tell us. We see exactly what you saw.</p>
|
|
26
|
+
<div class="row"><button class="go" type="button">Try it now</button><button class="no" type="button">Got it</button></div>
|
|
27
|
+
</div>`;let h=e=>l.querySelector(e);document.documentElement.appendChild(c);let g=h(`.pill`),_=h(`.nudge`),v=h(`.hint`),y=h(`.lmenu`),b=h(`.cmenu`);function x(){g.querySelector(`.lbl`).textContent=u?.label||``,g.className=`pill ${p()}${d.compact&&p()!==`edge`?` compact`:``}`,g.setAttribute(`aria-label`,u?.label||`Report a problem`),g.title=`${u?.label||`Report a problem`}${s.length?` (${me(t)})`:``}`,g.style.setProperty(`--bg`,u?.color||`#0E1320`),g.style.setProperty(`--ink`,fe(u?.color||`#0E1320`));for(let[e,t]of[`x`,`y`].entries()){let n=t===`y`&&Number.isFinite(d.y)?d.y:u?.offset?.[e];n==null?c.style.removeProperty(`--specto-launcher-${t}`):c.style.setProperty(`--specto-launcher-${t}`,`${n}px`)}y.querySelector(`.m-size`).textContent=d.compact?`Show the label`:`Make it smaller`,y.querySelector(`.m-side`).textContent=p()===`left`?`Move it to the right`:`Move it to the left`,y.querySelector(`.m-side`).hidden=p()===`edge`,y.querySelector(`.m-size`).hidden=p()===`edge`,_.classList.toggle(`left`,m()===`left`),_.classList.toggle(`right`,m()===`right`);let e=t.hint?.where===`launcher`?m():t.hint?.where===`bottom-left`?`left`:`right`;v.classList.toggle(`left`,e===`left`),v.classList.toggle(`right`,e===`right`),v.classList.toggle(`by`,!!u&&u.position!==`edge`&&e===m())}x();let S=null,ee=0,C=!1,w=()=>{y.hidden=!0,b.hidden=!0,C=!1};function T(){w();let e=g.getBoundingClientRect();y.style.bottom=`${Math.max(8,innerHeight-e.top+8)}px`,y.style.left=p()===`left`?`${Math.max(8,e.left)}px`:``,y.style.right=p()===`left`?``:`${Math.max(8,innerWidth-e.right)}px`,y.hidden=!1,C=!0,y.querySelector(`button`).focus()}g.addEventListener(`click`,e=>{S?.moved?e.preventDefault():(g.hidden=!0,n(`launcher`))}),g.addEventListener(`contextmenu`,e=>{e.preventDefault(),e.stopPropagation(),T()}),g.addEventListener(`pointerdown`,e=>{e.button===0&&(S={x:e.clientX,y:e.clientY,moved:!1},e.pointerType!==`mouse`&&(ee=setTimeout(()=>{S&&!S.moved&&(S=null,T())},550)))});let E=e=>{if(!S||!S.moved&&Math.hypot(e.clientX-S.x,e.clientY-S.y)<6)return;clearTimeout(ee),S.moved=!0,g.classList.add(`dragging`);let t=g.getBoundingClientRect(),n=p()===`edge`;g.style.left=`${n?innerWidth-t.width:Math.min(innerWidth-t.width-8,Math.max(8,e.clientX-t.width/2))}px`,g.style.right=`auto`,g.style.top=`${Math.min(innerHeight-t.height-8,Math.max(8,e.clientY-t.height/2))}px`,g.style.bottom=`auto`,g.style.transform=n?`rotate(180deg)`:`none`},te=e=>{if(clearTimeout(ee),!S?.moved){S=null;return}let t=g.getBoundingClientRect();g.classList.remove(`dragging`);for(let e of[`left`,`right`,`top`,`bottom`,`transform`])g.style[e]=``;let n=Math.round(Math.min(innerHeight-t.height-8,Math.max(8,innerHeight-t.bottom)));f({y:n,...p()===`edge`?{}:{side:e.clientX<innerWidth/2?`left`:`right`}}),setTimeout(()=>{S=null},0)};window.addEventListener(`pointermove`,E,!0),window.addEventListener(`pointerup`,te,!0),y.querySelector(`.m-open`).addEventListener(`click`,()=>{w(),g.hidden=!0,n(`launcher`)}),y.querySelector(`.m-size`).addEventListener(`click`,()=>{w(),f({compact:!d.compact})}),y.querySelector(`.m-side`).addEventListener(`click`,()=>{w(),f({side:p()===`left`?`right`:`left`})}),y.querySelector(`.m-hide`).addEventListener(`click`,()=>{w(),V.set(sessionStorage,P,`1`),B()});let ne=null,D=e=>!!e.closest(`a[href],input,textarea,select,img,video,[contenteditable=""],[contenteditable="true"]`)||!!String(getSelection?.()||``).trim(),O=e=>{if(!t.context||t.context===`off`||e.composedPath?.().includes(c)||document.getElementById(`specto-point`)||!r())return;let i=e.target instanceof Element?e.target:null;if(i){if(e.shiftKey||e.altKey){if(t.context===`menu`&&e.shiftKey)return;e.preventDefault(),w(),n(`context`,i)}else t.context!==`menu`||D(i)||(e.preventDefault(),w(),ne=i,b.style.left=`${Math.min(e.clientX,innerWidth-250)}px`,b.style.top=`${Math.min(e.clientY,innerHeight-90)}px`,b.hidden=!1,C=!0,b.querySelector(`button`).focus())}};b.querySelector(`.c-go`).addEventListener(`click`,()=>{let e=ne;w(),e?.isConnected&&n(`context`,e)}),window.addEventListener(`contextmenu`,O,!0);let k=e=>{C&&!e.composedPath?.().includes(c)&&w()},A=e=>{C&&e.key===`Escape`&&(w(),g.focus?.())};window.addEventListener(`pointerdown`,k,!0),window.addEventListener(`keydown`,A,!0),window.addEventListener(`scroll`,w,{passive:!0,capture:!0});let re=0,ie=0,ae=Date.now(),F=()=>{re=Date.now()};window.addEventListener(`keydown`,F,!0);let I=()=>{_.hidden=!0};_.querySelector(`.go`).addEventListener(`click`,()=>{I(),n(`nudge`)}),_.querySelector(`.no`).addEventListener(`click`,I);let L=null;try{L=JSON.parse(V.get(localStorage,M)||`null`)}catch{}let R=()=>V.get(localStorage,oe)===`1`,z=()=>{v.hidden=!0};v.querySelector(`.go`).addEventListener(`click`,()=>{z(),n(`hint`)}),v.querySelector(`.no`).addEventListener(`click`,z);let ue=!1,B=()=>{let e=!!document.getElementById(`specto-point`),n=r()&&!e,i=!!document.getElementById(`specto-feedback-host`),o=V.get(sessionStorage,P)===`1`;if(g.hidden=!(u&&n&&!i&&!o&&H(u.pages)),g.hidden&&!y.hidden&&w(),e&&(I(),z()),t.nudge&&n&&!ie&&!V.get(sessionStorage,ce)){let e=ve(a.recent(),t.nudge,ae),n=Date.now()-re<de||/^(INPUT|TEXTAREA|SELECT)$/.test(document.activeElement?.tagName||``)||document.activeElement?.isContentEditable;e&&!n&&(ie=Date.now(),V.set(sessionStorage,ce,`1`),z(),_.hidden=!1,setTimeout(I,le)),e&&(ae=e)}if(t.hint&&n&&!ue){ue=!0;let e=Number(V.get(localStorage,j))||0;_e(t.hint,{used:R(),visits:e,last:L,release:a.release})&&(V.set(localStorage,M,JSON.stringify({at:Date.now(),release:a.release||null})),setTimeout(()=>{_.hidden&&!document.getElementById(`specto-point`)&&(v.hidden=!1)},1500))}};B();let U=setInterval(B,1e3),G=new MutationObserver(B);return G.observe(document.documentElement,{childList:!0}),{launcher(e){u=K(t.launcher,e),x(),B()},stop(){clearInterval(U),G.disconnect(),window.removeEventListener(`keydown`,F,!0),window.removeEventListener(`pointermove`,E,!0),window.removeEventListener(`pointerup`,te,!0),window.removeEventListener(`contextmenu`,O,!0),window.removeEventListener(`pointerdown`,k,!0),window.removeEventListener(`keydown`,A,!0),window.removeEventListener(`scroll`,w,!0),c.remove()}}}function q(e,{open:t}={}){let n=(e||[]).filter(e=>e&&e.title).slice(0,3);if(!n.length||document.getElementById(`specto-point-fixed`))return null;let r=document.createElement(`div`);r.id=`specto-point-fixed`,r.className=`specto-block`,r.setAttribute(`style`,`all:initial;position:fixed;top:0;left:0;width:0;height:0;overflow:visible;z-index:2147483646`);let i=r.attachShadow({mode:`open`}),a=n[0];i.innerHTML=`<style>${J}${be}</style>
|
|
28
|
+
<div class="card fixed" role="status" aria-live="polite">
|
|
29
|
+
<button class="x" type="button" aria-label="Dismiss"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M3 3l6 6M9 3l-6 6"/></svg></button>
|
|
30
|
+
<div class="hd"><span class="okc" aria-hidden="true"><svg viewBox="0 0 12 12"><path d="M2.5 6.2 5 8.5 9.5 3.5"/></svg></span><b></b></div>
|
|
31
|
+
<p class="msg"></p>${n.length>1?`<p class="more">And ${n.length-1} more you reported ${n.length>2?`are`:`is`} fixed too.</p>`:``}
|
|
32
|
+
<div class="row"><button class="go" type="button">Got it</button><button class="no still" type="button">Still happening?</button></div>
|
|
33
|
+
</div>`,i.querySelector(`b`).textContent=`Fixed: ${a.title}`,i.querySelector(`.msg`).textContent=a.message||`The fix is live. Thank you, it helped.`;let o=()=>r.remove();return i.querySelector(`.x`).addEventListener(`click`,o),i.querySelector(`.go`).addEventListener(`click`,o),i.querySelector(`.still`).addEventListener(`click`,()=>{o(),t?.(`fixed`,null,a.receipt)}),document.documentElement.appendChild(r),{close:o}}var be=`
|
|
34
|
+
.card.fixed{top:20px;right:20px;bottom:auto;width:340px;padding:16px 16px 14px}
|
|
35
|
+
.fixed .hd{align-items:flex-start;padding-right:22px}
|
|
36
|
+
.fixed .hd b{line-height:1.4}
|
|
37
|
+
.okc{width:22px;height:22px;flex:none;border-radius:50%;background:#14C8A6;display:flex;align-items:center;justify-content:center}
|
|
38
|
+
.okc svg{width:12px;height:12px;fill:none;stroke:#0E1320;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
|
|
39
|
+
.fixed .more{font-size:12px;color:#8A93A6}
|
|
40
|
+
.fixed .row{margin-top:2px}
|
|
41
|
+
.x{position:absolute;top:8px;right:8px;width:28px;height:28px;border:0;border-radius:6px;background:none;color:#8A93A6;display:flex;align-items:center;justify-content:center;cursor:pointer}
|
|
42
|
+
.x svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
|
|
43
|
+
.x:hover{color:#F4F5F8}
|
|
44
|
+
@media (max-width:480px){.card.fixed{left:12px;right:12px;width:auto}}
|
|
45
|
+
`,J=`
|
|
46
|
+
:host{all:initial}
|
|
47
|
+
*{-webkit-user-select:none;user-select:none}
|
|
48
|
+
input,textarea{-webkit-user-select:text;user-select:text}
|
|
49
|
+
*{box-sizing:border-box;font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
|
|
50
|
+
[hidden]{display:none!important}
|
|
51
|
+
.kc{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border:1px solid rgba(255,255,255,.22);border-bottom-width:2px;border-radius:5px;background:rgba(255,255,255,.06);color:inherit;font:600 10.5px/1 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap}
|
|
52
|
+
.kc.lg{min-width:34px;height:26px;padding:0 8px;font-size:12.5px;border-bottom-width:3px;border-radius:6px}
|
|
53
|
+
.keys,.or,.big{display:inline-flex;align-items:center;gap:3px}
|
|
54
|
+
.pill{position:fixed;bottom:var(--specto-launcher-y,20px);display:inline-flex;align-items:center;gap:10px;height:40px;padding:0 12px 0 11px;border:0;border-radius:999px;background:var(--bg,#0E1320);color:var(--ink,#fff);font:600 13px/1 ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;cursor:pointer;box-shadow:0 8px 22px rgba(7,10,16,.28);white-space:nowrap}
|
|
55
|
+
.pill.right{right:var(--specto-launcher-x,20px)}.pill.left{left:var(--specto-launcher-x,20px)}
|
|
56
|
+
.pill .ic{width:16px;height:16px;flex:none;fill:none;stroke:#A9A0FF;stroke-width:1.6}
|
|
57
|
+
.pill .ic .d{fill:#A9A0FF;stroke:none}
|
|
58
|
+
.pill .keys{opacity:.7}
|
|
59
|
+
.pill .kc{height:18px;min-width:18px;border-color:currentColor;background:transparent;opacity:.85}
|
|
60
|
+
.pill.edge{right:0;bottom:auto;top:calc(50% + var(--specto-launcher-y,0px) - 20px);height:auto;padding:14px 9px;gap:8px;border-radius:10px 0 0 10px;writing-mode:vertical-rl;transform:translateY(-50%) rotate(180deg)}
|
|
61
|
+
.pill.edge .keys{display:none}
|
|
62
|
+
.pill:hover{filter:brightness(1.12)}
|
|
63
|
+
.pill:focus-visible,.card button:focus-visible{outline:2px solid #5B4BF0;outline-offset:2px}
|
|
64
|
+
.card{position:fixed;bottom:calc(var(--specto-launcher-y,20px) + 52px);width:330px;background:#0E1320;color:#F4F5F8;border-radius:12px;padding:14px 16px;box-shadow:0 12px 32px rgba(7,10,16,.35);font-size:13px;display:flex;flex-direction:column;gap:10px}
|
|
65
|
+
.card.right{right:var(--specto-launcher-x,20px)}.card.left{left:var(--specto-launcher-x,20px)}
|
|
66
|
+
.card.hint:not(.by){bottom:24px}
|
|
67
|
+
.hd{display:flex;align-items:center;gap:10px}
|
|
68
|
+
.hd b{font-size:14px;font-weight:600}
|
|
69
|
+
.red{width:8px;height:8px;border-radius:50%;background:#F87171;flex:none}
|
|
70
|
+
.card p{margin:0;line-height:1.5;color:#C3C8D4}
|
|
71
|
+
.row{display:flex;align-items:center;gap:10px}
|
|
72
|
+
.go{height:34px;padding:0 14px;background:#5B4BF0;border:0;color:#fff;border-radius:8px;font-weight:600;font-size:13px;cursor:pointer}
|
|
73
|
+
.no{height:34px;padding:0 10px;background:none;border:0;color:#8A93A6;font-size:13px;cursor:pointer}
|
|
74
|
+
.or{margin-left:auto;gap:4px;font-size:11px;color:#8A93A6}
|
|
75
|
+
.pill.compact{width:44px;height:44px;padding:0;justify-content:center;gap:0}
|
|
76
|
+
.pill.compact .lbl,.pill.compact .keys{display:none}
|
|
77
|
+
.pill.compact .ic{width:20px;height:20px}
|
|
78
|
+
.pill.compact::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:2px solid rgba(169,160,255,.55);animation:sp-pulse 2.4s ease-out 2;pointer-events:none}
|
|
79
|
+
@keyframes sp-pulse{0%{transform:scale(.85);opacity:1}100%{transform:scale(1.35);opacity:0}}
|
|
80
|
+
.pill.dragging{cursor:grabbing;transition:none;box-shadow:0 14px 34px rgba(7,10,16,.4)}
|
|
81
|
+
.menu{position:fixed;min-width:210px;background:#0E1320;color:#F4F5F8;border:1px solid #2a3346;border-radius:10px;padding:5px;box-shadow:0 12px 32px rgba(7,10,16,.4);font-size:13px;display:flex;flex-direction:column}
|
|
82
|
+
.menu button{display:flex;align-items:center;gap:8px;text-align:left;background:none;border:0;color:inherit;font:inherit;padding:8px 10px;border-radius:7px;cursor:pointer}
|
|
83
|
+
.menu button:hover,.menu button:focus-visible{background:rgba(91,75,240,.22);outline:none}
|
|
84
|
+
.menu .m-open,.menu .c-go{font-weight:600}
|
|
85
|
+
.menu .ic{width:16px;height:16px;fill:none;stroke:#A9A0FF;stroke-width:1.6}
|
|
86
|
+
.menu .ic .d{fill:#A9A0FF;stroke:none}
|
|
87
|
+
.menu hr{border:0;border-top:1px solid #232c40;margin:4px 2px}
|
|
88
|
+
.menu .tip{margin:4px 10px 6px;font-size:11px;color:#8A93A6}
|
|
89
|
+
@media (prefers-reduced-motion:reduce){.pill.compact::after{animation:none;opacity:0}}
|
|
90
|
+
@media (max-width:480px){.card{width:calc(100vw - 40px)}}
|
|
91
|
+
`,xe=[`broken`,`wrong`,`slow`,`confusing`,`idea`],Se=`specto-point-voice`,Ce=`specto-point-sent`,we=`specto-point-used`,Te=2,Ee=6e3,De=[``,`①`,`②`,`③`,`④`,`⑤`,`⑥`,`⑦`,`⑧`,`⑨`,`⑩`],Oe=`<svg viewBox="0 0 18 18" aria-hidden="true"><rect x="6.5" y="2" width="5" height="9" rx="2.5"/><path d="M3.5 8.5a5.5 5.5 0 0 0 11 0M9 14v2.5"/></svg>`,ke=`<svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.5 6.2 5 8.5 9.5 3.5"/></svg>`,Y={get:e=>{try{return localStorage.getItem(e)}catch{return null}},set:(e,t)=>{try{localStorage.setItem(e,t)}catch{}}},Ae={broken:`#F43F5E`,wrong:`#F59E0B`,slow:`#8B5CF6`,confusing:`#0EA5E9`,idea:`#10B981`},je={broken:`Broken`,wrong:`Wrong`,slow:`Slow`,confusing:`Confusing`,idea:`Idea`},Me=`specto-point-howto`,Ne=20,Pe=8,Fe={"double-ctrl":`Double-tap Ctrl`,"hold-alt":`Hold Alt`,"hold-ctrl":`Hold Ctrl`,chord:`Alt + Shift + P`},Ie=[`pointerdown`,`pointerup`,`mousedown`,`mouseup`,`click`,`dblclick`,`auxclick`,`contextmenu`,`touchstart`,`touchend`];function X(e,t={}){if(document.getElementById(`specto-point`))return null;let n=e._point,r=()=>n.strict(),i=()=>n.unmask?.()||``,a=[],o=`armed`,s=null,c=null,l=null,d=null,f=null,p=null,h=0,g=[],v=0,y=!1,b=!1,x=0,C=!1,w=!1,T=document.createElement(`div`);T.id=`specto-point`,T.className=`specto-block`,T.setAttribute(`style`,`all:initial;position:fixed;top:0;left:0;width:0;height:0;overflow:visible;z-index:2147483646`);let E=T.attachShadow({mode:`open`});E.innerHTML=`<style>${Le}</style>
|
|
92
|
+
<div class="ring" data-state="armed" aria-hidden="true"><span class="badge"></span><span class="dot"></span></div>
|
|
93
|
+
<div class="outline" aria-hidden="true"><span class="chip"></span></div>
|
|
94
|
+
<div class="frame" aria-hidden="true"></div>
|
|
95
|
+
<div class="marks"></div>
|
|
96
|
+
<section class="rail" role="region" aria-label="Specto Point — report what is wrong">
|
|
97
|
+
<header><b>Point</b><span class="hint"></span><button class="x" aria-label="Leave Point" title="Leave (Esc)">×</button></header>
|
|
98
|
+
<ol class="list"></ol>
|
|
99
|
+
<p class="empty">Click what is wrong. Drag to frame an area.</p>
|
|
100
|
+
<div class="vcard" hidden>
|
|
101
|
+
<b>Tell us like you’d tell a friend</b>
|
|
102
|
+
<p>Point at things and just talk: “this button does nothing”. Your words show up here as you go.</p>
|
|
103
|
+
<p class="fine">Your browser will ask to use the microphone. We only turn your voice into text; the recording is deleted.</p>
|
|
104
|
+
<button class="vstart" type="button">${Oe}Start talking</button>
|
|
105
|
+
<p class="fine c">Rather type? Just start typing.</p>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="listening" hidden>
|
|
108
|
+
<div class="lh"><span class="rd" aria-hidden="true"></span>Listening<span class="bars" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span></div>
|
|
109
|
+
<p class="cap" aria-live="polite"></p>
|
|
110
|
+
<p class="fine">Each phrase shows up a moment after you pause, on the marker you were pointing at.</p>
|
|
111
|
+
</div>
|
|
112
|
+
<details class="exp"><summary>Expected / what happened</summary>
|
|
113
|
+
<input class="expected" maxlength="500" placeholder="What did you expect?" aria-label="What did you expect?">
|
|
114
|
+
<input class="actual" maxlength="500" placeholder="What happened instead?" aria-label="What happened instead?">
|
|
115
|
+
</details>
|
|
116
|
+
<label class="keep" hidden><input type="checkbox"> Also send my voice recording (kept 30 days)</label>
|
|
117
|
+
<button class="flowbtn" type="button" title="F — use the page normally while Specto brackets this stretch of the recording">Record a flow</button>
|
|
118
|
+
<div class="row bottom">
|
|
119
|
+
<button class="mic" type="button" hidden aria-label="Talk" title="M — talk instead of typing; your words appear as you go">${Oe}</button>
|
|
120
|
+
<button class="typei" type="button" hidden>Type instead</button>
|
|
121
|
+
<button class="send" type="button" disabled>Send</button>
|
|
122
|
+
</div>
|
|
123
|
+
<p class="status" role="status" aria-live="polite"></p>
|
|
124
|
+
</section>
|
|
125
|
+
<div class="howto" hidden role="dialog" aria-label="How Point works"></div>`;let D=e=>E.querySelector(e),O=D(`.ring`),k=D(`.outline`),A=D(`.frame`),oe=D(`.marks`),j=D(`.rail`),se=D(`.list`),M=D(`.status`),ce=D(`.hint`);document.documentElement.appendChild(T);let N=document.createElement(`style`);N.id=`specto-point-cursor`,N.textContent=`html.specto-point-on,html.specto-point-on *{cursor:none!important}`,document.head?.appendChild(N);let P=e=>document.documentElement.classList.toggle(`specto-point-on`,e);P(!0),n.active(!0);let le=e=>e.composedPath?.().includes(T),F=(e,t)=>{M.textContent=e||``,M.classList.toggle(`bad`,!!t)};function I(e){o=e,O.dataset.state=d?`${e} listening`:e;let t=e===`flow`;P(!t&&e!==`sent`),n.active(!t&&e!==`sent`),k.style.display=t?`none`:``,ce.textContent=e===`flow`?`Use the page — F ends the flow`:`Esc to cancel`,D(`.flowbtn`).textContent=l&&!l.end?`End the flow`:l?.end?`Flow recorded ✓`:`Record a flow`,D(`.flowbtn`).classList.toggle(`on`,e===`flow`),D(`.send`).disabled=b||!(a.length||l?.end||D(`.expected`).value.trim()||D(`.actual`).value.trim()),D(`.empty`).hidden=a.length>0,O.querySelector(`.badge`).textContent=e===`marking`||e===`armed`?String(a.length+1):``}function L(e){e!==v&&(d&&(d.cut(),g.push({at:Date.now(),marker:e})),v=e)}function R(e,t){if(a.length>=Ne){F(`At most ${Ne} markers in one report`,!0);return}Ze();let o=Date.now(),s=ee(e,{strict:r(),unmask:i()}),c=te({recent:n.recent(),contains:t=>e===t||e.contains(t)||t.contains?.(e),now:o}),l={n:a.length+1,el:e,kind:t?`region`:`element`,flag:`broken`,note:``,at:o,desc:s,ctx:c,region:t?{x:t.x+scrollX,y:t.y+scrollY,w:t.w,h:t.h}:null};t&&(l.desc.rect={x:Math.round(t.x),y:Math.round(t.y),w:Math.round(t.w),h:Math.round(t.h)}),a.push(l),L(l.n),H(),I(`marking`),nt||de(e,t)}function de(e,t){if(innerWidth<=560)return;let n;try{n=t||e.getBoundingClientRect()}catch{return}let r=j.getBoundingClientRect();n.x<r.right&&n.x+(n.w??n.width)>r.left&&n.y<r.bottom&&n.y+(n.h??n.height)>r.top&&j.classList.toggle(`left`)}function B(e){a.splice(e,1),a.forEach((e,t)=>{e.n=t+1}),L(a.length?a[a.length-1].n:0),H(),I(a.length?`marking`:`armed`)}let V=e=>{e.flag=xe[(xe.indexOf(e.flag)+1)%xe.length],H()};function H(){se.replaceChildren(...a.map((e,t)=>{let n=document.createElement(`li`);return n.innerHTML=`<button class="num" type="button" title="Change the flag" style="--c:${Ae[e.flag]}">${e.n}</button>
|
|
126
|
+
<span class="what"><span class="name"></span><button class="flag" type="button" style="--c:${Ae[e.flag]}">${je[e.flag]}</button></span>
|
|
127
|
+
<textarea class="note" rows="1" maxlength="1000" placeholder="${d?`Talk, or type here`:`Note (optional)`}" aria-label="Note for marker ${e.n}"></textarea>
|
|
128
|
+
<button class="rm" type="button" aria-label="Remove marker ${e.n}">×</button>`,n.dataset.n=String(e.n),n.querySelector(`.name`).textContent=e.desc.component?`${e.desc.component} · ${e.desc.name}`:e.desc.name,n.querySelector(`.note`).value=e.note,n.querySelector(`.note`).addEventListener(`input`,t=>{e.note=t.target.value}),n.querySelector(`.note`).addEventListener(`focus`,()=>L(e.n)),n.querySelector(`.num`).addEventListener(`click`,()=>V(e)),n.querySelector(`.flag`).addEventListener(`click`,()=>V(e)),n.querySelector(`.rm`).addEventListener(`click`,()=>B(t)),n.addEventListener(`pointerenter`,()=>L(e.n)),n})),oe.replaceChildren(...a.map(e=>{let t=document.createElement(`div`);return t.className=`mk ${e.kind}`,t.style.setProperty(`--c`,Ae[e.flag]),t.innerHTML=`<button class="pin" type="button" aria-label="Marker ${e.n}: ${je[e.flag]} — click to change">${e.n}</button>`,t.querySelector(`.pin`).addEventListener(`click`,t=>{t.stopPropagation(),V(e)}),e.node=t,t})),fe()}function fe(){for(let e of a){if(!e.node)continue;let t;if(e.region)t={left:e.region.x-scrollX,top:e.region.y-scrollY,width:e.region.w,height:e.region.h};else try{t=e.el.getBoundingClientRect()}catch{t=null}!t||!e.region&&!e.el.isConnected?e.node.style.display=`none`:(e.node.style.display=``,e.node.style.transform=`translate(${t.left}px, ${t.top}px)`,e.node.style.width=`${Math.max(4,t.width)}px`,e.node.style.height=`${Math.max(4,t.height)}px`)}}let U=()=>{if(!C){if(fe(),d){let e=d.level();O.style.setProperty(`--lv`,e.toFixed(2)),D(`.bars`).style.setProperty(`--lv`,Math.min(1,e*2.5).toFixed(2))}x=requestAnimationFrame(U)}};x=requestAnimationFrame(U);let me=(e,t)=>{let n=document.elementFromPoint(e,t);return n&&n!==T&&n!==document.documentElement?n:null};function W(e){if(!e){k.style.opacity=`0`;return}let t;try{t=e.getBoundingClientRect()}catch{return}if(k.style.opacity=`1`,k.style.transform=`translate(${t.left}px, ${t.top}px)`,k.style.width=`${t.width}px`,k.style.height=`${t.height}px`,s!==e){let n=u(e,r(),i()),{component:a}=_(e),o=S(e,{component:a,name:m(e,n).slice(0,30)});k.querySelector(`.chip`).textContent=o,k.classList.toggle(`below`,t.top<24)}}let ge=e=>{if(O.style.transform=`translate(${e.clientX}px, ${e.clientY}px)`,O.classList.add(`seen`),o===`flow`||o===`sent`)return;if(le(e)){W(null),s=null;return}if(c&&(Math.abs(e.clientX-c.x)>Pe||Math.abs(e.clientY-c.y)>Pe)){c.region={x:Math.min(c.x,e.clientX),y:Math.min(c.y,e.clientY),w:Math.abs(e.clientX-c.x),h:Math.abs(e.clientY-c.y)},Object.assign(A.style,{display:`block`,transform:`translate(${c.region.x}px, ${c.region.y}px)`,width:`${c.region.w}px`,height:`${c.region.h}px`}),W(null);return}let t=me(e.clientX,e.clientY);W(t),s=t;let n=t&&a.find(e=>e.el===t||e.el.contains?.(t));n&&L(n.n)},G=e=>{if(!(C||o===`flow`||o===`sent`||le(e))&&(e.preventDefault(),e.stopImmediatePropagation(),e.type===`pointerdown`&&e.button===0&&(c={x:e.clientX,y:e.clientY,el:me(e.clientX,e.clientY),region:null}),e.type===`pointerup`&&c)){let e=c;if(c=null,A.style.display=`none`,e.region&&e.region.w>Pe&&e.region.h>Pe){let t=e.region.x+e.region.w/2,n=e.region.y+e.region.h/2;R(me(t,n)||document.body,e.region)}else e.el&&R(e.el,null)}},K=e=>{let t=e.composedPath?.()[0];return t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`)&&le(e)},_e=e=>{if(C||o===`sent`)return;if(K(e)){e.key===`Escape`?(e.target.blur?.(),j.focus?.()):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Q());return}let t=e.key;if((!X.hidden||d)&&t.length===1&&t!==`?`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&o!==`flow`)Qe(e);else if((e.ctrlKey||e.metaKey)&&(t===`a`||t===`A`))e.preventDefault();else if([`Escape`,`Enter`,`Backspace`,`f`,`F`,`m`,`M`,`?`,`Tab`].includes(t)&&(o!==`flow`||[`f`,`F`,`Escape`].includes(t))){if(e.preventDefault(),e.stopImmediatePropagation(),t===`Escape`){if(o===`flow`){q();return}if(a.length&&!y){y=!0,F(`Press Esc again to discard this report`),setTimeout(()=>{y=!1},3e3);return}$()}else t===`Enter`?s&&!a.some(e=>e.el===s)&&ve.active?R(s,null):Q():t===`Backspace`?a.length&&B(a.length-1):t===`f`||t===`F`?o===`flow`?q():ye():t===`m`||t===`M`?Ye():t===`?`?$e(!0):t===`Tab`&&ve.next(e.shiftKey)}},ve={active:!1,i:-1,next(e){let t=Array.from(document.querySelectorAll(`a[href],button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"]),[role=button],[role=link]`)).filter(e=>{let t=e.getBoundingClientRect();return t.width>0&&t.height>0&&!T.contains(e)});if(t.length){this.active=!0,this.i=(this.i+(e?-1:1)+t.length)%t.length,s=t[this.i];try{s.scrollIntoView({block:`nearest`})}catch{}W(s)}}};function ye(){l?.end&&(l=null),l={start:Date.now(),end:null},W(null),I(`flow`),be()}function q(){l&&!l.end&&(l.end=Date.now(),I(a.length?`marking`:`armed`),F(`Flow recorded (${Math.round((l.end-l.start)/1e3)} s)`))}function be(){if(C||!l||l.end)return;let e=Math.round((Date.now()-l.start)/1e3);ce.textContent=`Recording the flow ${String(Math.floor(e/60)).padStart(2,`0`)}:${String(e%60).padStart(2,`0`)} — F ends it`,setTimeout(be,500)}let J=D(`.mic`),X=D(`.vcard`),Z=!!t.voice&&re(),Re=t.voiceLang&&t.voiceLang!==`auto`?t.voiceLang:String(navigator.language||``).slice(0,2).toLowerCase(),ze=String(n.endpoint).replace(/\/api\/point$/,`/api/point-transcribe`);Z&&(J.hidden=!1),Z&&t.keepAudio&&(D(`.keep`).hidden=!1);let Be=e=>{let t=0;for(let n of g)if(n.at<=e)t=n.marker;else break;return t};function Ve(e){let t=e&&se.querySelector(`li[data-n="${e}"]`);return t?t.querySelector(`.note`):(D(`.exp`).open=!0,D(`.actual`))}async function He(e){let t=Be(e.startedAt),r=Date.now();h++,I(o);try{let i=await fetch(ze,{method:`POST`,headers:{"Content-Type":`text/plain;charset=UTF-8`},credentials:`omit`,body:JSON.stringify({key:n.key,mime:e.mime,data:await ae(e.blob),lang:Re})}),o=await i.json().catch(()=>({})),s=i.ok?String(o.text||``).trim():``;if(s){Ge(t,s,e.startedAt,r);let n=a.find(e=>e.n===t),i=Ve(n?t:0);n&&(n.note=`${n.note?`${n.note} `:``}${s}`.slice(0,1e3)),i&&(i.value=n?n.note:`${i.value?`${i.value} `:``}${s}`.slice(0,500),i.dispatchEvent(new Event(`input`)))}else i.ok||F(`Some of what you said couldn’t be written down — type it if it’s missing`,!0)}catch{F(`Some of what you said couldn’t be written down — type it if it’s missing`,!0)}h--,I(o)}let Ue=D(`.cap`),We=[];function Ge(e,t,n,r){We.push({n:e,words:t,at:n,end:r}),Ue.replaceChildren(...We.slice(-4).map(e=>{let t=document.createElement(`span`),n=a.find(t=>t.n===e.n);return n&&(t.className=`said`,t.style.setProperty(`--c`,Ae[n.flag])),t.textContent=`${e.words}${n?` ${De[n.n]||`(${n.n})`}`:``} `,t}))}function Ke(e){J.classList.toggle(`on`,e),J.setAttribute(`aria-label`,e?`Stop talking`:`Talk`),D(`.typei`).hidden=!e,D(`.listening`).hidden=!e}async function qe(){if(!d)return;let e=d;d=null,Ke(!1),I(o),f=await e.stop()}async function Je(){if(Z&&!d){X.hidden=!0,J.hidden=!1;try{d=await ie({onPhrase:He,keep:!!t.keepAudio}),p||={startedAt:d.startedAt},Y.set(Se,`yes`),g.push({at:d.startedAt,marker:v}),We.length||(Ue.textContent=`Say what you see…`),Ke(!0),I(o)}catch(e){d=null,e?.name===`NotAllowedError`&&Y.set(Se,`no`),F(e?.name===`NotAllowedError`?`The microphone is blocked for this site — type instead`:`The microphone could not start — type instead`,!0)}}}let Ye=()=>d?qe():Je(),Xe=!1;function Ze(){Xe||!Z||d||Y.get(Se)||(Xe=!0,X.hidden=!1,J.hidden=!0)}D(`.typei`).addEventListener(`click`,()=>{qe(),Ve(v)?.focus()});function Qe(e){X.hidden=!0,J.hidden=!Z,d&&qe();let t=Ve(v);t&&(e.preventDefault(),e.stopImmediatePropagation(),t.focus(),t.value+=e.key,t.dispatchEvent(new Event(`input`)))}function $e(e){let n=!1;try{n=localStorage.getItem(Me)===`1`}catch{}if(n&&!e)return;try{localStorage.setItem(Me,`1`)}catch{}w=!0;let r=D(`.howto`);r.innerHTML=`<div class="scene" aria-hidden="true"><div class="page"><i></i><i></i><b class="btn">Pay</b></div><span class="cur"></span><span class="pinh">1</span><span class="wave"></span></div>
|
|
129
|
+
<ol><li><b>${Fe[t.trigger]||`Use the shortcut`}</b> to point</li><li><b>Click</b> what is wrong</li>${t.voice?`<li><b>Say</b> what you see</li>`:`<li><b>Add a note</b> if you like</li>`}<li><b>Enter</b> sends it</li></ol>
|
|
130
|
+
<button class="ok" type="button">Got it</button>`,r.hidden=!1;let i=()=>{r.hidden||(r.hidden=!0,Ze())};r.querySelector(`.ok`).addEventListener(`click`,i),setTimeout(i,9e3)}async function Q(){if(b)return;l&&!l.end&&q();let r=D(`.expected`).value.trim(),i=D(`.actual`).value.trim();if(!a.length&&!l?.end&&!r&&!i){F(`Mark something first — click what is wrong`,!0);return}b=!0,I(o);let s=D(`.send`);s.innerHTML=`<span class="spin" aria-hidden="true"></span>Sending…`,j.classList.add(`busy`),F(``);try{d&&await qe(),h>0&&F(`Writing down the last of what you said…`);for(let e=Date.now()+Ee;h>0&&Date.now()<e;)await new Promise(e=>setTimeout(e,100));F(``);let o=!!(t.keepAudio&&D(`.keep input`).checked&&f?.blob?.size),s={page:location.pathname,release:n.release||void 0,expected:r||void 0,actual:i||void 0,markers:a.map(e=>({n:e.n,kind:e.kind,flag:e.flag,note:e.note.trim()||void 0,at:e.at,...e.desc,viewport:{w:innerWidth,h:innerHeight},scroll:{x:Math.round(scrollX),y:Math.round(scrollY)},dpr:devicePixelRatio||1,events:e.ctx.events,network:e.ctx.network,console:e.ctx.console})),flow:l?.end?l:void 0,env:ne(),voice:p?{live:!0,startedAt:p.startedAt,timeline:g,lang:Re||void 0,keep:o,phrases:We.map(e=>({at:e.at,end:e.end,marker:a.some(t=>t.n===e.n)?e.n:0,text:e.words}))}:void 0,via:t.via||void 0},c={key:n.key,sessionId:e.sessionId||null,report:s,notify:{on:!!t.notify?.tick},...t.about?{about:t.about}:{}};o&&(c.audio={mime:f.mime,data:await ae(f.blob)});let u=await fetch(n.endpoint,{method:`POST`,headers:{"Content-Type":`text/plain;charset=UTF-8`},credentials:`omit`,body:JSON.stringify(c)}),m=await u.json().catch(()=>({}));if(!u.ok)throw Error(m.error||`HTTP ${u.status}`);et(m.bug,m.receipt,m.reopened)}catch(e){b=!1,s.textContent=`Send`,j.classList.remove(`busy`),I(o),F(`Couldn't send: ${String(e?.message||e).slice(0,80)} — try again`,!0)}}function et(e,r=null,i=!1){I(`sent`),n.active(!1),P(!1),W(null),j.classList.add(`done`);let a=Math.floor(Number(e))||0,o=t.thanks?.message?t.thanks.message.replace(/\{number\}/g,a?String(a):``):i?`Thanks — bug #${a} is open again, and the team can see what you saw.`:a?`Sent as bug #${a} — thank you.`:`Sent — thank you.`,s=document.createElement(`div`);s.className=`thanks`,s.innerHTML=`<div class="th"><span class="okc" aria-hidden="true">${ke}</span><b></b></div>`,s.querySelector(`b`).textContent=o;let c=(Number(Y.get(Ce))||0)+1;Y.set(Ce,String(c));let l=pe(t),u=typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches,d=t.thanks?.teach!==!1&&l.length>0&&!u&&t.via!==`shortcut`&&c<=Te;if(d){let e=document.createElement(`p`);e.className=`teach`,e.innerHTML=`Next time, from any page: ${t.trigger===`double-ctrl`?`tap `:``}<span class="caps">${he(l)}</span> and click what’s wrong.`,s.append(e)}let f=t.notify&&r?tt(r):null;f&&s.append(f),j.replaceChildren(s),t.onSent?.(e);let p=null,m=e=>{clearTimeout(p),p=setTimeout($,e)};s.addEventListener(`pointerenter`,()=>clearTimeout(p)),s.addEventListener(`focusin`,()=>clearTimeout(p)),s.addEventListener(`pointerleave`,()=>{s.contains(s.getRootNode().activeElement)||m(2500)}),s.addEventListener(`focusout`,()=>m(2500)),m(f?6500:d?5200:2600)}function tt(e){let r=n.endpoint.replace(/\/api\/point$/,`/api/point-notify`),i=t=>fetch(r,{method:`POST`,headers:{"Content-Type":`text/plain;charset=UTF-8`},credentials:`omit`,body:JSON.stringify({key:n.key,receipt:e,...t})}),a=!!n.identified?.(),o=document.createElement(`div`);o.className=`tell`,o.innerHTML=`<label class="tick"><input type="checkbox"><span><b>Tell me when it’s fixed</b><small></small></span></label>`;let s=o.querySelector(`input`),c=o.querySelector(`small`);s.checked=!!t.notify.tick,c.textContent=a&&t.notify.email?`Here, and by email`:`We’ll show it here next time you visit`,s.checked&&z(e);let l=null;return t.notify.email&&!a&&(l=document.createElement(`form`),l.className=`mail`,l.innerHTML=`<label for="sp-mail">Email me too (optional)</label><div><input id="sp-mail" type="email" autocomplete="email" placeholder="you@example.com" maxlength="254"><button type="submit">Save</button></div><p class="mailmsg" role="status"></p>`,l.hidden=!s.checked,l.addEventListener(`submit`,async e=>{e.preventDefault();let t=l.querySelector(`input`),n=l.querySelector(`.mailmsg`),r=t.value.trim();if(r){n.textContent=`Saving…`;try{let e=await i({on:!0,email:r}),a=await e.json().catch(()=>({}));n.textContent=e.ok?`Saved — one email when it’s fixed, then we delete it`:a.error||`Couldn’t save it`,e.ok&&(t.disabled=!0)}catch{n.textContent=`Couldn’t save it`}}}),o.append(l)),s.addEventListener(`change`,()=>{let t=s.checked;t?z(e):ue(e),l&&(l.hidden=!t),i({on:t}).catch(()=>{})}),o}function $(){if(!C){C=!0,cancelAnimationFrame(x),d&&d.stop(),n.active(!1),P(!1);for(let e of Ie)window.removeEventListener(e,G,!0);window.removeEventListener(`pointermove`,ge,!0),window.removeEventListener(`keydown`,_e,!0),T.remove(),N.remove(),t.onClose?.()}}for(let e of Ie)window.addEventListener(e,G,{capture:!0,passive:!1});try{getSelection()?.removeAllRanges()}catch{}window.addEventListener(`pointermove`,ge,!0),window.addEventListener(`keydown`,_e,!0),D(`.x`).addEventListener(`click`,$);let nt=!1,rt=(e,t)=>{let n=j.offsetWidth,r=j.offsetHeight;j.style.left=`${Math.min(innerWidth-n-8,Math.max(8,e))}px`,j.style.top=`${Math.min(innerHeight-Math.min(r,120),Math.max(8,t))}px`,j.style.right=`auto`,j.style.bottom=`auto`,nt=!0},it=j.querySelector(`header`);it.title=`Drag to move`,it.addEventListener(`pointerdown`,e=>{if(e.button!==0||e.target.closest(`button`)||innerWidth<=560)return;let t=j.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;j.classList.add(`moving`);let i=e=>rt(e.clientX-n,e.clientY-r),a=()=>{j.classList.remove(`moving`),window.removeEventListener(`pointermove`,i,!0),window.removeEventListener(`pointerup`,a,!0)};window.addEventListener(`pointermove`,i,!0),window.addEventListener(`pointerup`,a,!0),e.preventDefault()}),D(`.send`).addEventListener(`click`,Q),D(`.flowbtn`).addEventListener(`click`,()=>l&&!l.end?q():ye()),J.addEventListener(`click`,Ye),D(`.vstart`).addEventListener(`click`,Je);for(let e of[`.expected`,`.actual`])D(e).addEventListener(`input`,()=>I(o));I(`armed`),Y.set(we,`1`);let at=Y.get(Se);return Z&&at===`yes`&&Je(),$e(!1),w||Ze(),t.target?.isConnected&&!T.contains(t.target)&&R(t.target,null),{toggle:()=>a.length||l?.end?Q():$(),released:()=>{!a.length&&!l&&!w&&o===`armed`&&$()},close:$,send:Q,get markers(){return a.length},get state(){return o}}}var Le=`
|
|
131
|
+
:host{all:initial}
|
|
132
|
+
*{-webkit-user-select:none;user-select:none}
|
|
133
|
+
input,textarea{-webkit-user-select:text;user-select:text}
|
|
134
|
+
*{box-sizing:border-box;font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
|
|
135
|
+
[hidden]{display:none!important}
|
|
136
|
+
.ring{position:fixed;left:0;top:0;width:24px;height:24px;margin:-12px 0 0 -12px;border-radius:50%;border:2px solid #94A3B8;background:rgba(148,163,184,.12);pointer-events:none;z-index:4;transition:border-color .15s,background .15s;will-change:transform}
|
|
137
|
+
.ring .dot{position:absolute;left:50%;top:50%;width:4px;height:4px;margin:-2px;border-radius:50%;background:#94A3B8}
|
|
138
|
+
.ring .badge{position:absolute;left:16px;top:-12px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:#0E1320;color:#fff;font-size:10px;font-weight:700;line-height:16px;text-align:center;display:none}
|
|
139
|
+
.ring[data-state~="marking"]{border-color:#5B4BF0;background:rgba(91,75,240,.16)}
|
|
140
|
+
.ring[data-state~="marking"] .dot{background:#5B4BF0}
|
|
141
|
+
.ring[data-state~="armed"] .badge,.ring[data-state~="marking"] .badge{display:block}
|
|
142
|
+
.ring[data-state~="listening"]{box-shadow:0 0 0 calc(2px + var(--lv,0) * 10px) rgba(91,75,240,.35)}
|
|
143
|
+
.ring[data-state~="flow"]{width:14px;height:14px;margin:-7px 0 0 -7px;border-color:#F43F5E;background:#F43F5E;opacity:.9}
|
|
144
|
+
.ring[data-state~="flow"] .dot{display:none}
|
|
145
|
+
.ring[data-state~="sent"]{display:none}
|
|
146
|
+
.ring:not(.seen){opacity:0}
|
|
147
|
+
@media (prefers-reduced-motion:reduce){.ring{transition:none}}
|
|
148
|
+
.outline{position:fixed;left:0;top:0;border:1.5px solid #5B4BF0;border-radius:3px;background:rgba(91,75,240,.06);pointer-events:none;opacity:0;z-index:2}
|
|
149
|
+
.outline .chip{position:absolute;left:-1px;bottom:100%;margin-bottom:4px;max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:#0E1320;color:#fff;font-size:11px;font-weight:600;padding:3px 7px;border-radius:5px}
|
|
150
|
+
.outline.below .chip{bottom:auto;top:100%;margin:4px 0 0}
|
|
151
|
+
.frame{position:fixed;left:0;top:0;display:none;border:1.5px dashed #5B4BF0;background:rgba(91,75,240,.08);pointer-events:none;z-index:2}
|
|
152
|
+
.marks{position:fixed;left:0;top:0;width:0;height:0;z-index:3}
|
|
153
|
+
.mk{position:fixed;left:0;top:0;border:2px solid var(--c);border-radius:4px;pointer-events:none}
|
|
154
|
+
.mk.region{border-style:dashed}
|
|
155
|
+
.mk .pin{position:absolute;left:-11px;top:-11px;width:22px;height:22px;border-radius:50%;border:2px solid #fff;background:var(--c);color:#fff;font:700 11px/18px ui-sans-serif,system-ui;text-align:center;pointer-events:auto;cursor:pointer;padding:0;box-shadow:0 2px 8px rgba(0,0,0,.35)}
|
|
156
|
+
.rail{position:fixed;top:16px;right:16px;width:320px;max-height:calc(100vh - 32px);overflow:auto;background:#0E1320;color:#E6E8EE;border:1px solid #2a3346;border-radius:12px;padding:12px;box-shadow:0 12px 40px rgba(0,0,0,.45);font-size:13px;z-index:5;cursor:default}
|
|
157
|
+
.rail *{cursor:auto}
|
|
158
|
+
.rail header,.rail header *:not(button){cursor:grab}
|
|
159
|
+
.rail.moving,.rail.moving *{cursor:grabbing!important;user-select:none}
|
|
160
|
+
.rail.left{right:auto;left:16px}
|
|
161
|
+
.rail button{cursor:pointer}
|
|
162
|
+
.rail header{display:flex;align-items:center;gap:8px;margin-bottom:8px}
|
|
163
|
+
.rail header b{font-size:14px}
|
|
164
|
+
.hint{flex:1;color:#94A3B8;font-size:11.5px}
|
|
165
|
+
.x{background:none;border:0;color:#94A3B8;font-size:18px;line-height:1;padding:2px 6px}
|
|
166
|
+
.list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
|
|
167
|
+
.list li{display:grid;grid-template-columns:22px 1fr 18px;gap:4px 8px;align-items:center;background:#151B2B;border:1px solid #232c40;border-radius:8px;padding:6px 8px}
|
|
168
|
+
.num{width:22px;height:22px;border-radius:50%;border:0;background:var(--c);color:#fff;font-weight:700;font-size:11px;padding:0}
|
|
169
|
+
.what{display:flex;align-items:center;gap:6px;min-width:0}
|
|
170
|
+
.name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
|
|
171
|
+
.flag{border:1px solid var(--c);color:var(--c);background:transparent;border-radius:999px;font-size:10.5px;font-weight:700;padding:1px 7px}
|
|
172
|
+
.note{grid-column:2/4;grid-row:2;width:100%;background:#0B0F19;border:1px solid #2a3346;border-radius:6px;color:#E6E8EE;padding:5px 8px;font-size:12.5px;outline:none;resize:none;min-height:28px;field-sizing:content;max-height:120px;line-height:1.45}
|
|
173
|
+
.vcard{margin-top:10px;background:#151B2B;border:1px solid #3b3a7a;border-radius:10px;padding:12px}
|
|
174
|
+
.vcard b{font-size:13.5px}
|
|
175
|
+
.vcard p{margin:6px 0;color:#C3C8D4;font-size:12.5px;line-height:1.5}
|
|
176
|
+
.vcard .fine{color:#94A3B8;font-size:11.5px}
|
|
177
|
+
.vcard .c{text-align:center;margin-bottom:0}
|
|
178
|
+
.kc{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border:1px solid rgba(255,255,255,.22);border-bottom-width:2px;border-radius:5px;background:rgba(255,255,255,.06);color:inherit;font:600 10.5px/1 ui-monospace,SFMono-Regular,Menlo,monospace}
|
|
179
|
+
.caps{display:inline-flex;gap:3px;vertical-align:middle;margin:0 2px}
|
|
180
|
+
.vstart{width:100%;height:44px;margin-top:6px;display:flex;align-items:center;justify-content:center;gap:8px;background:#5B4BF0;border:0;color:#fff;font-weight:700;border-radius:10px;font-size:13.5px}
|
|
181
|
+
.vstart svg,.mic svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
|
|
182
|
+
.listening{margin-top:10px;background:rgba(255,255,255,.04);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px}
|
|
183
|
+
.lh{display:flex;align-items:center;gap:8px;font-size:12px;color:#C3C8D4}
|
|
184
|
+
.rd{width:8px;height:8px;border-radius:50%;background:#F87171;box-shadow:0 0 0 4px rgba(248,113,113,.2)}
|
|
185
|
+
.bars{margin-left:auto;display:flex;align-items:flex-end;gap:2px;height:14px}
|
|
186
|
+
.bars i{display:block;width:3px;border-radius:2px;background:#14C8A6;height:calc(3px + var(--lv,0) * 11px)}
|
|
187
|
+
.bars i:nth-child(2){height:calc(5px + var(--lv,0) * 9px)}.bars i:nth-child(3){height:calc(3px + var(--lv,0) * 8px)}.bars i:nth-child(4){height:calc(6px + var(--lv,0) * 8px)}.bars i:nth-child(5){height:calc(2px + var(--lv,0) * 6px)}
|
|
188
|
+
.cap{margin:0;font-size:14px;line-height:1.6;color:#F4F5F8;min-height:1.6em}
|
|
189
|
+
.cap .said{color:var(--c);font-weight:600}
|
|
190
|
+
.listening .fine{margin:0;font-size:11px;color:#8A93A6;line-height:1.5}
|
|
191
|
+
.flowbtn{margin-top:10px;width:100%;background:#151B2B;border:1px solid #2a3346;color:#E6E8EE;border-radius:8px;padding:7px 8px;font-size:12px;font-weight:600}
|
|
192
|
+
.flowbtn.on{border-color:#F43F5E;color:#FDA4AF}
|
|
193
|
+
.bottom{gap:8px}
|
|
194
|
+
.mic{flex:none;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid rgba(169,160,255,.5);color:#A9A0FF;padding:0}
|
|
195
|
+
.mic.on{background:#F87171;border-color:#F87171;color:#0E1320}
|
|
196
|
+
.typei{height:44px;padding:0 12px;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:transparent;color:#C3C8D4;font-size:13px}
|
|
197
|
+
.send{flex:1;height:44px;background:#5B4BF0;border:0;color:#fff;font-weight:700;border-radius:10px;padding:0 16px;font-size:14px}
|
|
198
|
+
.send:disabled{opacity:.45;cursor:default}
|
|
199
|
+
.rail.busy .send:disabled{opacity:1}
|
|
200
|
+
.rail.busy .list,.rail.busy .exp,.rail.busy .flowbtn,.rail.busy .mic,.rail.busy .typei,.rail.busy .listening{opacity:.5;pointer-events:none}
|
|
201
|
+
.send{display:flex;align-items:center;justify-content:center;gap:8px}
|
|
202
|
+
.spin{width:15px;height:15px;border-radius:50%;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;animation:sp-spin .7s linear infinite}
|
|
203
|
+
@keyframes sp-spin{to{transform:rotate(360deg)}}
|
|
204
|
+
@media (prefers-reduced-motion:reduce){.spin{animation-duration:2s}}
|
|
205
|
+
@media (max-width:560px){.rail{top:auto;left:8px;right:8px;bottom:8px;width:auto;max-height:55vh;border-radius:14px}.howto{width:calc(100vw - 24px);bottom:auto;top:12px}}
|
|
206
|
+
.rail.done{width:auto;max-width:360px;padding:14px 16px}
|
|
207
|
+
.thanks{margin:0;color:#F4F5F8;display:flex;flex-direction:column;gap:8px}
|
|
208
|
+
.th{display:flex;align-items:center;gap:10px}
|
|
209
|
+
.th b{font-size:14px;font-weight:600}
|
|
210
|
+
.okc{width:22px;height:22px;flex:none;border-radius:50%;background:#14C8A6;display:flex;align-items:center;justify-content:center}
|
|
211
|
+
.okc svg{width:12px;height:12px;fill:none;stroke:#0E1320;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
|
|
212
|
+
.teach{margin:0;font-size:13px;line-height:1.7;color:#C3C8D4}
|
|
213
|
+
.tell{border-top:1px solid rgba(255,255,255,.1);padding-top:12px;display:flex;flex-direction:column;gap:10px}
|
|
214
|
+
.tick{display:flex;gap:10px;align-items:flex-start;font-size:13px;line-height:1.5;color:#C3C8D4;cursor:pointer}
|
|
215
|
+
.tick input{width:16px;height:16px;margin:2px 0 0;flex:none;accent-color:#14C8A6;cursor:pointer}
|
|
216
|
+
.tick b{display:block;color:#F4F5F8;font-weight:600}
|
|
217
|
+
.tick small{font-size:13px}
|
|
218
|
+
.mail{display:flex;flex-direction:column;gap:6px;padding-left:26px;margin:0}
|
|
219
|
+
.mail label{font-size:12px;color:#C3C8D4}
|
|
220
|
+
.mail div{display:flex;gap:8px}
|
|
221
|
+
.mail input{flex:1;min-width:0;height:34px;border-radius:8px;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.06);color:#F4F5F8;padding:0 10px;font:inherit;font-size:13px}
|
|
222
|
+
.mail input:disabled{opacity:.6}
|
|
223
|
+
.mail button{height:34px;padding:0 14px;border:0;border-radius:8px;background:#F4F5F8;color:#0E1320;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
|
|
224
|
+
.mailmsg{margin:0;font-size:12px;color:#8A93A6}
|
|
225
|
+
.mailmsg:empty{display:none}
|
|
226
|
+
.keep{display:flex;gap:6px;align-items:center;margin-top:10px;font-size:12px;color:#C3C8D4}
|
|
227
|
+
.note:focus,.exp input:focus{border-color:#5B4BF0}
|
|
228
|
+
.rm{grid-column:3;grid-row:1;background:none;border:0;color:#64748B;font-size:15px;padding:0}
|
|
229
|
+
.empty{color:#94A3B8;margin:6px 0 8px;font-size:12.5px}
|
|
230
|
+
.row{display:flex;align-items:center;gap:8px;margin-top:10px}
|
|
231
|
+
.exp{margin-top:10px;color:#94A3B8;font-size:12px}
|
|
232
|
+
.exp summary{cursor:pointer}
|
|
233
|
+
.exp input{display:block;width:100%;margin-top:6px;background:#0B0F19;border:1px solid #2a3346;border-radius:6px;color:#E6E8EE;padding:6px 8px;font-size:12.5px;outline:none}
|
|
234
|
+
.status{margin:8px 0 0;font-size:12px;color:#94A3B8;min-height:1em}
|
|
235
|
+
.status:empty{display:none}
|
|
236
|
+
.status.bad{color:#FCA5A5}
|
|
237
|
+
.howto{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);width:360px;background:#0E1320;color:#E6E8EE;border:1px solid #2a3346;border-radius:14px;padding:14px;box-shadow:0 16px 50px rgba(0,0,0,.5);z-index:6;font-size:13px}
|
|
238
|
+
.howto ol{margin:10px 0 8px;padding-left:20px;line-height:1.7}
|
|
239
|
+
.howto .ok{background:#5B4BF0;border:0;color:#fff;border-radius:8px;padding:6px 12px;font-weight:700;cursor:pointer}
|
|
240
|
+
.scene{position:relative;height:96px;border-radius:9px;background:#151B2B;overflow:hidden}
|
|
241
|
+
.scene .page{position:absolute;inset:12px 14px}
|
|
242
|
+
.scene .page i{display:block;height:8px;border-radius:4px;background:#232c40;margin-bottom:8px;width:70%}
|
|
243
|
+
.scene .page i+i{width:45%}
|
|
244
|
+
.scene .btn{position:absolute;right:10px;bottom:6px;background:#2E86F0;color:#fff;font-size:11px;padding:5px 14px;border-radius:6px}
|
|
245
|
+
.scene .cur{position:absolute;left:30px;top:20px;width:18px;height:18px;margin:-9px;border-radius:50%;border:2px solid #94A3B8;animation:sp-move 8s infinite}
|
|
246
|
+
.scene .pinh{position:absolute;right:62px;bottom:20px;width:18px;height:18px;border-radius:50%;background:#F43F5E;color:#fff;font:700 10px/18px ui-sans-serif,system-ui;text-align:center;opacity:0;animation:sp-pin 8s infinite}
|
|
247
|
+
.scene .wave{position:absolute;left:20px;bottom:16px;width:40px;height:10px;border-radius:5px;background:linear-gradient(90deg,#5B4BF0,#2E86F0);opacity:0;animation:sp-wave 8s infinite}
|
|
248
|
+
@keyframes sp-move{0%,8%{transform:translate(0,0);border-color:#94A3B8}30%,100%{transform:translate(250px,52px);border-color:#5B4BF0}}
|
|
249
|
+
@keyframes sp-pin{0%,34%{opacity:0;transform:scale(.4)}40%,100%{opacity:1;transform:scale(1)}}
|
|
250
|
+
@keyframes sp-wave{0%,48%{opacity:0;transform:scaleX(.3)}55%,60%{opacity:1;transform:scaleX(1)}65%,70%{opacity:1;transform:scaleX(.5)}75%,85%{opacity:1;transform:scaleX(1)}92%,100%{opacity:0}}
|
|
251
|
+
@media (prefers-reduced-motion:reduce){.scene .cur,.scene .pinh,.scene .wave{animation:none}.scene .pinh,.scene .wave{opacity:1}.scene .cur{transform:translate(250px,52px)}}
|
|
252
|
+
`;exports.FLAGS=xe,exports.mountEntry=ye,exports.openPoint=X,exports.showFixed=q;
|