@signalsupport/sdk 0.0.0-stage → 0.7.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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +373 -2
  3. package/dist/chunks/app-7692BILt.js +2 -0
  4. package/dist/chunks/app-7692BILt.js.map +1 -0
  5. package/dist/chunks/constants-ClGbEpjT.js +2 -0
  6. package/dist/chunks/constants-ClGbEpjT.js.map +1 -0
  7. package/dist/chunks/support-x7N-k02b.js +4 -0
  8. package/dist/chunks/support-x7N-k02b.js.map +1 -0
  9. package/dist/chunks/widget-Bxsz5StK.js +2 -0
  10. package/dist/chunks/widget-Bxsz5StK.js.map +1 -0
  11. package/dist/client.d.ts +99 -0
  12. package/dist/constants.d.ts +2 -0
  13. package/dist/errors.d.ts +25 -0
  14. package/dist/evidence.d.ts +87 -0
  15. package/dist/iife.d.ts +12 -0
  16. package/dist/index.d.ts +21 -0
  17. package/dist/index.js +1 -0
  18. package/dist/model.d.ts +201 -0
  19. package/dist/react.d.ts +26 -0
  20. package/dist/react.js +2 -0
  21. package/dist/react.js.map +1 -0
  22. package/dist/reporter.d.ts +14 -0
  23. package/dist/server.d.ts +54 -0
  24. package/dist/server.js +2 -0
  25. package/dist/server.js.map +1 -0
  26. package/dist/session.d.ts +29 -0
  27. package/dist/signal.iife.js +4 -0
  28. package/dist/signal.iife.js.map +1 -0
  29. package/dist/support.d.ts +108 -0
  30. package/dist/trail.d.ts +27 -0
  31. package/dist/widget/app.d.ts +31 -0
  32. package/dist/widget/copy.d.ts +104 -0
  33. package/dist/widget/ctx.d.ts +75 -0
  34. package/dist/widget/icons.d.ts +38 -0
  35. package/dist/widget/index.d.ts +111 -0
  36. package/dist/widget/index.js +1 -0
  37. package/dist/widget/parts.d.ts +28 -0
  38. package/dist/widget/pick.d.ts +30 -0
  39. package/dist/widget/screens/faq.d.ts +8 -0
  40. package/dist/widget/screens/feedback.d.ts +11 -0
  41. package/dist/widget/screens/home.d.ts +12 -0
  42. package/dist/widget/screens/report.d.ts +9 -0
  43. package/dist/widget/screens/reports.d.ts +26 -0
  44. package/dist/widget/store.d.ts +31 -0
  45. package/dist/widget/styles.d.ts +10 -0
  46. package/dist/widget/theme.d.ts +57 -0
  47. package/dist/widget/ui.d.ts +58 -0
  48. package/package.json +73 -4
@@ -0,0 +1,4 @@
1
+ var SignalSupport=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};function i(e){"@babel/helpers - typeof";return i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i(e)}function a(e,t){if(i(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function o(e){var t=a(e,`string`);return i(t)==`symbol`?t:t+``}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=class extends Error{constructor(e,t,n={}){super(t),s(this,`code`,void 0),s(this,`status`,void 0),s(this,`path`,void 0),s(this,`retryAfter`,void 0),this.name=`SignalError`,this.code=e,this.status=n.status,this.path=n.path,this.retryAfter=n.retryAfter}get retryable(){return this.status===void 0||this.status===429||this.status>=500}};async function l(e){let t=await e.json().catch(()=>null);if(!e.ok){let n=t?.error;throw new c(n?.code??`INTERNAL`,n?.message??`request failed with ${e.status}`,{status:e.status,path:n?.path,retryAfter:Number(e.headers.get(`retry-after`))||void 0})}if(!t||!(`data`in t))throw new c(`MALFORMED`,`the service answered outside the { message, data } envelope`,{status:e.status});return t.data}function u(e,t){return new c(`TRANSPORT`,`could not reach ${e}: ${t instanceof Error?t.message:String(t)}`)}function d(...e){return e.reduce((e,t)=>t?{...e,...t}:e,{...D})}function f(){let e=O();if(e)return{platform:e.userAgentData?.platform??e.platform,cores:e.hardwareConcurrency,memory:e.deviceMemory}}function p(){let e=O(),t=k();if(!(!e||!t))return{userAgent:e.userAgent,viewport:{width:t.innerWidth,height:t.innerHeight},pixelRatio:t.devicePixelRatio}}function m(){let e=O()?.connection;return e?{effectiveType:e.effectiveType,downlink:e.downlink,rtt:e.rtt}:void 0}function h(){let e=O();return e?{language:e.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}:void 0}function g(e=f()){return e?[e.platform,e.cores?`${String(e.cores)} cores`:null,e.memory?`${String(e.memory)} GB`:null].filter(Boolean).join(` · `):`Not available here`}function _(e=p()){if(!e)return`Not available here`;let t=String(e.userAgent??``),n=/Edg\/(\d+)/.exec(t)?.[1]?`Edge ${/Edg\/(\d+)/.exec(t)[1]}`:/Firefox\/(\d+)/.exec(t)?.[1]?`Firefox ${/Firefox\/(\d+)/.exec(t)[1]}`:/Chrome\/(\d+)/.exec(t)?.[1]?`Chrome ${/Chrome\/(\d+)/.exec(t)[1]}`:/Version\/(\d+).*Safari/.exec(t)?.[1]?`Safari ${/Version\/(\d+)/.exec(t)[1]}`:`Browser`,r=e.viewport;return r?`${n} · ${r.width}×${r.height}`:n}async function v(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))try{let e=await r();e!==void 0&&(t[n]=e)}catch(e){t[n]={unavailable:e instanceof Error?e.message:String(e)}}return Object.keys(t).length?t:void 0}function y(e,t={}){let n=[],r={},i=(t,i,a)=>{if(!e[t]){n.push(t);return}let o=a();o!==void 0&&(r[i]=o)};return i(`system`,`system`,f),i(`browser`,`browser`,p),i(`network`,`network`,m),i(`locale`,`locale`,h),i(`trail`,`trail`,()=>t.trail),i(`extra`,`extra`,()=>t.extra),e.screenshot?(t.screenshot&&(r.screenshot=t.screenshot),t.screenshotKey&&(r.screenshot_key=t.screenshotKey)):n.push(`screenshot`),r.withheld=n,r}function b(e,t){return new Promise(n=>{let r=setTimeout(n,t);e.then(()=>(clearTimeout(r),n()),()=>(clearTimeout(r),n()))})}function x(){if(typeof document>`u`||typeof requestAnimationFrame>`u`)return()=>{};let e=document.createElement(`div`);e.setAttribute(`aria-hidden`,`true`),e.style.cssText=`position:fixed;left:0;top:0;width:1px;height:1px;pointer-events:none;z-index:2147483647;`,document.body.appendChild(e);let t=!0,n=0,r=()=>{t=!t,e.style.background=t?`rgba(0,0,0,0.01)`:`rgba(0,0,0,0.02)`,n=requestAnimationFrame(r)};return n=requestAnimationFrame(r),()=>{cancelAnimationFrame(n),e.remove()}}function S(e,t){let n=e;return typeof n.requestVideoFrameCallback==`function`?new Promise(e=>{let r=setTimeout(e,1e3),i=t,a=()=>{--i<=0?(clearTimeout(r),e()):n.requestVideoFrameCallback(a)};n.requestVideoFrameCallback(a)}):new Promise(e=>setTimeout(e,150))}function C(e,t,n){let r=Math.min(1,A/Math.max(t,n)),i=Math.max(1,Math.round(t*r)),a=Math.max(1,Math.round(n*r)),o=document.createElement(`canvas`);o.width=i,o.height=a,o.getContext(`2d`).drawImage(e,0,0,i,a);let s=te,c=o.toDataURL(`image/webp`,s);for(c.startsWith(`data:image/webp`)||(c=o.toDataURL(`image/jpeg`,s));E(c)>14e5&&s>.3;)s-=.12,c=o.toDataURL(c.startsWith(`data:image/webp`)?`image/webp`:`image/jpeg`,s);let l=c.slice(5,c.indexOf(`;`));return{ok:!0,dataUrl:c,width:i,height:a,bytes:E(c),mime:l}}async function w(e,t={}){try{t.beforeCapture?.(),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())));let n=``;if(await b(e().then(e=>void(n=e)),5e3),!n.startsWith(`data:image/`)&&!n.startsWith(`blob:`))throw Error(`The screen could not be captured.`);let r=new Image;return r.src=n,await r.decode(),C(r,r.naturalWidth,r.naturalHeight)}catch(e){return{ok:!1,reason:`failed`,message:e instanceof Error?e.message:`The screen could not be captured.`}}finally{t.afterCapture?.()}}async function T(e={}){let t=typeof navigator>`u`?void 0:navigator.mediaDevices;if(!t?.getDisplayMedia)return{ok:!1,reason:`unsupported`,message:`This browser cannot capture the screen.`};let n;try{n=await t.getDisplayMedia({video:{displaySurface:`browser`},audio:!1,preferCurrentTab:!0,selfBrowserSurface:`include`})}catch(e){let t=e instanceof Error?e.name:``;return t===`NotAllowedError`||t===`AbortError`?{ok:!1,reason:`cancelled`,message:`Capture was cancelled.`}:{ok:!1,reason:`failed`,message:e instanceof Error?e.message:`The screen could not be captured.`}}let r=x();try{e.beforeCapture?.();let t=document.createElement(`video`);if(t.muted=!0,t.playsInline=!0,t.srcObject=n,await b(t.play(),3e3),t.videoWidth||await b(new Promise(e=>t.addEventListener(`loadeddata`,e,{once:!0})),3e3),!t.videoWidth)throw Error(`The screen could not be captured: no picture arrived.`);return await new Promise(e=>setTimeout(e,350)),await S(t,2),C(t,t.videoWidth,t.videoHeight)}catch(e){return{ok:!1,reason:`failed`,message:e instanceof Error?e.message:`The screen could not be captured.`}}finally{r(),n.getTracks().forEach(e=>e.stop()),e.afterCapture?.()}}function E(e){let t=e.slice(e.indexOf(`,`)+1);return Math.floor(t.length*3/4)}function ee(e){return e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}var D,O,k,A,te,j=n((()=>{D=Object.freeze({screenshot:!0,system:!0,browser:!0,network:!0,locale:!1,trail:!0,extra:!0}),O=()=>typeof navigator>`u`?void 0:navigator,k=()=>typeof window>`u`?void 0:window,A=1600,te=.72}));j();var ne=6e4;function re(e,t){let n=null,r=null;async function i(){if(!e)return null;let r;if(typeof e==`function`)r=await e();else{let n=t??globalThis.fetch?.bind(globalThis);if(!n)return null;let i=await n(e,{method:`POST`,credentials:`include`,headers:{accept:`application/json`}});if(!i.ok)return null;let a=await i.json().catch(()=>null);r=a?.data??a}if(!r)return null;let i=typeof r==`string`?{token:r}:r;if(!i.token)return null;let a=i.expires_at?Date.parse(i.expires_at)-ne:1/0;return n={token:i.token,expiresAt:a},i.token}return{async get(e=!1){return!e&&n&&Date.now()<n.expiresAt?n.token:(r||(r=i().catch(()=>null).finally(()=>{r=null})),r)},clear(){n=null}}}var ie=class{constructor(){s(this,`options`,null),s(this,`sessionCache`,null)}init(e){if(!e?.key&&!e?.session)throw new c(`CONFIG`,`Signal.init needs a key (sig_pub_ in a browser, sig_live_ on a server) or a session source.`);return typeof window<`u`&&e.key?.startsWith(`sig_live_`)&&console.warn(`[signal] a sig_live_ key is a SERVER credential and anyone can read it in a browser bundle. Use a sig_pub_ key here.`),this.options=e,this.sessionCache=re(e.session,e.fetchImpl),this}setUser(e){if(!this.options)throw M();return this.options={...this.options,user:e??void 0},this}setContext(e){if(!this.options)throw M();return this.options={...this.options,context:{...this.options.context,...e}},this}get initialised(){return this.options!==null}get apiBase(){return(this.options?.apiBase??`https://signal-api.character.xyz`).replace(/\/+$/,``)}get session(){if(!this.sessionCache)throw M();return this.sessionCache}async report(e){let t=this.options;if(!t)throw M();if(!e?.subject?.trim())throw new c(`VALIDATION`,`a signal needs a subject`,{path:`subject`,status:422});let n=d(t.consent,e.consent),r={...t.user,...e.reporter},i={...t.product?{product:t.product}:{},...t.context,...e.context},a={type:e.type??`incident`,subject:e.subject.trim(),body:e.body??``,impact:e.impact??`moderate`,urgency:e.urgency??`medium`,reporter:{external_id:r.id??null,name:r.name??`Anonymous`,email:r.email??null},reporter_kind:e.reporterKind??`person`,evidence:y(n,{screenshot:e.screenshot,screenshotKey:e.screenshotKey,trail:e.trail,extra:e.extra}),...Object.keys(i).length?{source_context:i}:{}},o=t.fetchImpl??globalThis.fetch?.bind(globalThis);if(!o)throw new c(`CONFIG`,`no fetch is available; pass fetchImpl on a runtime without one`);let s=t.session?await this.session.get():null,f=s??t.key;if(!f)throw new c(`NO_SESSION`,`nobody is signed in, and no publishable key was given for anonymous reports`,{status:401});let p=this.apiBase,m=e.idempotencyKey??ae(),h=e=>o(`${p}/v1/intake/signal`,{method:`POST`,headers:{"content-type":`application/json`,authorization:`Bearer ${e}`,"x-idempotency-key":m},body:JSON.stringify(a)}),g;try{if(g=await h(f),g.status===401&&s){let e=await this.session.get(!0);e&&(g=await h(e))}}catch(e){throw u(p,e)}let _=await l(g);if(!_?.id)throw new c(`MALFORMED`,`the service answered outside the { message, data } envelope`,{status:g.status});return _}};function M(){return new c(`CONFIG`,`call Signal.init({ key }) before reporting`)}function ae(){let e=globalThis.crypto;return e?.randomUUID?e.randomUUID():`idem_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`}var oe=new ie;function se(e){return new ie().init(e)}function N(e,t){let n=e=>e.trim().replace(/^v/i,``).split(/[.+-]/).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e)),r=n(e),i=n(t);for(let e=0;e<Math.max(r.length,i.length);e++){let t=(r[e]??0)-(i[e]??0);if(t!==0)return t<0?-1:1}return 0}function ce(e,t){return e.status!==`resolved`||e.verified_at||!ue(e)?!1:!e.fixed_in_version||!t||N(t,e.fixed_in_version)>=0}function le(e,t){return e.status===`resolved`&&!e.verified_at&&ue(e)&&!!e.fixed_in_version&&!!t&&N(t,e.fixed_in_version)<0}function ue(e){return e.disposition===null||e.disposition===`fixed`}function de(e){return P(e).open&&e.status!==`fix_pending_release`}function P(e,t){if(e.type===`feedback`)return fe(e);let n={stages:ye,active:!1,offPath:!1,open:!0,needsYou:!1},r=e.fixed_in_version?` in ${e.fixed_in_version}`:``;switch(e.status){case`triage`:return e.team_replies>0?{...n,label:`Being read`,blurb:`Someone on the team is reading this now.`,tone:`info`,stage:1,active:!0}:e.read_at?{...n,label:`Read`,blurb:`Someone on the team has read it. Next, they decide what happens with it.`,tone:`info`,stage:1}:{...n,label:`Received`,blurb:`The team has your report. Nobody has picked it up yet.`,tone:`info`,stage:0};case`open`:return{...n,label:e.reopens>0?`Reopened`:`Accepted`,blurb:e.reopens>0?`You told the team it is still wrong, so it went back on the list.`:`Taken as a real issue. It is on the list to fix.`,tone:e.reopens>0?`warn`:`accent`,stage:2};case`in_progress`:return{...n,label:`Being fixed`,blurb:`Someone is working on this right now.`,tone:`accent`,stage:2,active:!0};case`waiting_user`:return{...n,label:`Waiting for you`,blurb:`The team asked you something. Reply below and it goes straight back to them.`,tone:`warn`,stage:2,needsYou:!0};case`deferred`:return{...n,label:`On hold`,blurb:`Accepted, but not being worked on right now.`,tone:`neutral`,stage:2};case`fix_pending_release`:return{...n,label:`Fixed, shipping soon`,blurb:`The fix is done and goes out${r}. You will be asked to check it once you have it.`,tone:`success`,stage:3};case`resolved`:if(e.verified_at)return{...n,label:`Closed, you confirmed it`,blurb:`You confirmed the fix on your own machine. Thank you.`,tone:`success`,stage:4,open:!1};if(!ue(e)){let t=xe[e.disposition??``]??xe.answered;return{...n,...t,stage:1,offPath:!0,open:!1}}return le(e,t)?{...n,label:`Fixed${r}`,blurb:`Fixed${r}; you are on ${t}. Update, and this will ask you to check it.`,tone:`success`,stage:3}:{...n,label:`Fixed: check it`,blurb:`The team believes this is fixed. Try what went wrong and tell them what you find.`,tone:`success`,stage:4,needsYou:!0};case`rejected`:{let t=xe[e.disposition??``]??{label:`Not taken`,blurb:`The team is not treating this as a bug. The reply below says why.`,tone:`danger`};return{...n,...t,stage:1,offPath:!0,open:!1}}default:return fe(e)}}function fe(e){let t={stages:be,active:!1,offPath:!1,open:!0,needsYou:!1};if(e.disposition===`withdrawn`)return{...t,...xe.withdrawn,stage:1,offPath:!0,open:!1};switch(e.status){case`under_review`:return{...t,label:`Being read`,blurb:`The team is reading this.`,tone:`info`,stage:1,active:!0};case`planned`:return{...t,label:`Planned`,blurb:`This is on the plan.`,tone:`accent`,stage:2};case`in_progress`:return{...t,label:`Being built`,blurb:`Someone is building this now.`,tone:`accent`,stage:2,active:!0};case`shipped`:return{...t,label:`Shipped`,blurb:`This is out. Thank you for asking for it.`,tone:`success`,stage:3,open:!1};case`declined`:return{...t,label:`Not planned`,blurb:`The team decided not to build this. The reply below says why.`,tone:`neutral`,stage:1,offPath:!0,open:!1};case`deferred`:return{...t,label:`Later`,blurb:`Not now, but not forgotten.`,tone:`neutral`,stage:1};default:return e.read_at?{...t,label:`Read`,blurb:`Someone on the team has read it.`,tone:`info`,stage:1}:{...t,label:`Received`,blurb:`The team has your feedback.`,tone:`info`,stage:0}}}function pe(e){let t=[...e.timeline];if(!e.read_at)return t;let n=Date.parse(e.read_at);if(t.some(e=>e.by===`team`&&Date.parse(e.at)<n))return t;let r={kind:`read`,at:e.read_at,by:`team`,name:null},i=t.findIndex(e=>Date.parse(e.at)>=n);return t.splice(i<0?t.length:i,0,r),t}function me(e){return e?`Read by ${e}`:`Read by the team`}function he(e){return e.what.trim().length<12?{field:`what`,message:`Say what happened. A sentence is enough, but one word is not.`}:e.expected.trim().length<12?{field:`expected`,message:`Say what you expected instead. This is the half that says what to build.`}:null}function ge(e,t){return[...e].sort((e,n)=>{let r=P(e,t),i=P(n,t);return r.needsYou===i.needsYou?r.open===i.open?Date.parse(n.created_at)-Date.parse(e.created_at):r.open?-1:1:r.needsYou?-1:1})}function F(e,t=Date.now()){let n=Math.max(0,Math.round((t-(typeof e==`number`?e:Date.parse(e)))/1e3));if(n<10)return`just now`;if(n<60)return`${n}s ago`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function _e(e){return e.by===`you`?e.from?e.from===`resolved`||e.from===`shipped`?`You reopened it`:e.from===`waiting_user`?`Back with the team after your reply`:e.to===`rejected`||e.to===`declined`||e.to===`resolved`?`You withdrew it`:`You moved it`:`You sent this`:e.to===`open`&&(e.from===`resolved`||e.from===`rejected`)?`Reopened`:we[e.to]??e.to}function ve(e){return e.split(/\n{2,}/).map(e=>{let[t,...n]=e.split(`
2
+ `);return n.length&&/^(What happened|Expected instead)$/.test(t.trim())?{label:t.trim(),text:n.join(`
3
+ `).trim()}:{label:null,text:e.trim()}}).filter(e=>e.text)}var ye,be,xe,Se,Ce,we,I=n((()=>{ye=[`Sent`,`Read`,`Accepted`,`Fixed`,`You check`],be=[`Sent`,`Read`,`Planned`,`Shipped`],xe={by_design:{label:`Working as intended`,blurb:`The team looked, and this is how it is meant to work. The reply below says why.`,tone:`neutral`},workaround:{label:`Workaround given`,blurb:`There is a way around this for now. The reply below has it.`,tone:`info`},answered:{label:`Answered`,blurb:`The team answered this. The reply is below.`,tone:`success`},cannot_reproduce:{label:`Could not reproduce`,blurb:`The team could not make it happen. If it happens again, reply with what you did.`,tone:`neutral`},wont_fix:{label:`Not being fixed`,blurb:`The team decided not to change this. The reply below says why.`,tone:`neutral`},out_of_scope:{label:`Out of scope`,blurb:`This is outside what the product covers.`,tone:`neutral`},insufficient_info:{label:`Needs more detail`,blurb:`There was not enough to go on. Reporting it again with steps will reopen the conversation.`,tone:`warn`},duplicate:{label:`Already reported`,blurb:`The same thing is tracked on another report, so the work happens there.`,tone:`neutral`},spam:{label:`Closed`,blurb:`This report was closed.`,tone:`neutral`},test:{label:`Closed`,blurb:`This was a test report.`,tone:`neutral`},withdrawn:{label:`Withdrawn`,blurb:`You withdrew this report, so the team is no longer working on it. If it comes back, report it again.`,tone:`neutral`}},Se={blocking:{label:`Blocks me`,hint:`I cannot carry on working`,tone:`danger`,impact:`moderate`,urgency:`critical`},major:{label:`Major`,hint:`A real problem, I have a workaround`,tone:`warn`,impact:`moderate`,urgency:`high`},minor:{label:`Minor`,hint:`Annoying, but small`,tone:`info`,impact:`minor`,urgency:`medium`},cosmetic:{label:`Cosmetic`,hint:`It just looks wrong`,tone:`neutral`,impact:`minor`,urgency:`low`}},Ce={idea:{label:`An idea`,hint:`Something you wish this did`},praise:{label:`This works well`,hint:`Tell us what to protect`},confusing:{label:`This confused me`,hint:`You could not tell what it would do`},complaint:{label:`This frustrates me`,hint:`It works, and it is painful`}},we={triage:`Received`,open:`Accepted`,in_progress:`Being worked on`,waiting_user:`The team is waiting for you`,fix_pending_release:`Fixed, shipping soon`,deferred:`On hold`,resolved:`Marked fixed`,rejected:`Closed`,under_review:`Being read`,planned:`Planned`,shipped:`Shipped`,declined:`Not planned`}}));I();function Te(e,t,n){let r=()=>{let e=n??globalThis.fetch?.bind(globalThis);if(!e)throw new c(`CONFIG`,`no fetch is available; pass fetchImpl on a runtime without one`);return e};async function i(n,a,o,s=!1){let d=await t.get(s);if(!d)throw new c(`NO_SESSION`,`nobody is signed in, so there are no reports to read`,{status:401});let f;try{f=await r()(`${e}${a}`,{method:n,headers:{authorization:`Bearer ${d}`,accept:`application/json`,...o===void 0?{}:{"content-type":`application/json`}},body:o===void 0?void 0:JSON.stringify(o)})}catch(t){throw u(e,t)}return f.status===401&&!s?i(n,a,o,!0):l(f)}return{list:()=>i(`GET`,`/v1/reporter/signals`),get:e=>i(`GET`,`/v1/reporter/signals/${encodeURIComponent(e)}`),reply:(e,t)=>i(`POST`,`/v1/reporter/signals/${encodeURIComponent(e)}/replies`,{body:t}),verify:(e,t,n)=>i(`POST`,`/v1/reporter/signals/${encodeURIComponent(e)}/verify`,{works:t,...n?{note:n}:{}}),withdraw:(e,t)=>i(`POST`,`/v1/reporter/signals/${encodeURIComponent(e)}/withdraw`,t?{note:t}:{})}}function Ee(e=60){let t=[];return{record(n,r,i=Date.now()){let a=String(r).trim().slice(0,300);if(!a)return;let o=t[t.length-1];if(o&&o.kind===n&&o.label===a&&i-o.at<1500){o.at=i;return}t.push({at:i,kind:n,label:a}),t.length>e&&t.splice(0,t.length-e)},recent(e=10){return t.slice(-e).map(e=>({...e}))},size:()=>t.length,clear(){t.length=0},captureErrors(e=typeof window>`u`?void 0:window){if(!e)return()=>{};let t=e=>this.record(`error`,e.message||`Uncaught error`),n=e=>{let t=e.reason;this.record(`error`,typeof t==`string`?t:t?.message??`Unhandled promise rejection`)};return e.addEventListener(`error`,t),e.addEventListener(`unhandledrejection`,n),()=>{e.removeEventListener(`error`,t),e.removeEventListener(`unhandledrejection`,n)}}}}j();function De(e){return`SG-${e.slice(-6).toUpperCase()}`}var Oe=`signal.seen.v1`;function ke(e){let t=new ie().init({...e,context:{...e.appVersion?{app_version:e.appVersion}:{},...e.context}}),n=Te(t.apiBase,t.session,e.fetchImpl),r=e.trail===!1?Ee(0):e.trail??Ee(),i=e.captureErrors===!1?()=>{}:r.captureErrors(),a={...e.context},o=Ae(),s={signedIn:e.session?null:!1,loading:!1,reports:[],attention:0,error:null,updatedAt:null},l=new Set,u=e=>{s={...s,...e},s.attention=d(s.reports);for(let e of l)e(s)};function d(t){return t.filter(t=>P(t,e.appVersion).needsYou||m(t)).length}function m(e){return e.last_team_reply_at?Date.parse(e.last_team_reply_at)>(o[e.id]??0):!1}let h=0;async function g(){if(e.session){h=Date.now(),u({loading:!0});try{if(!await t.session.get()){u({signedIn:!1,loading:!1,reports:[],error:null});return}let r=await n.list();u({signedIn:!0,loading:!1,reports:ge(r,e.appVersion),error:null,updatedAt:Date.now()})}catch(e){e instanceof c&&e.code===`NO_SESSION`?u({signedIn:!1,loading:!1,reports:[],error:null}):u({loading:!1,error:Me(e)})}}}let _=null,y=()=>{document.visibilityState===`visible`&&g()},b=()=>{Date.now()-h>5e3&&g()};e.session&&typeof window<`u`&&(g(),_=setInterval(()=>{document.visibilityState===`visible`&&g()},e.refreshMs??12e4),document.addEventListener(`visibilitychange`,y),window.addEventListener(`focus`,b));function x(t){let{timeline:n,attached:r,...i}=t,a=s.reports.filter(e=>e.id!==i.id);u({reports:ge([i,...a],e.appVersion)})}return{client:t,reporter:n,trail:r,appVersion:e.appVersion,getState:()=>s,subscribe(e){return l.add(e),()=>{l.delete(e)}},refresh:g,context:()=>({...a}),setContext(e){a={...a,...e}},record:(e,t)=>r.record(e,t),async collect(){return{system:f(),browser:p(),trail:r.recent(10),extra:await v(e.diagnostics)}},async submitIssue(n){let i=Se[n.severity],o={system:!0,browser:!0,trail:!0,extra:!0,screenshot:!0,...n.include},s=o.extra?await v(e.diagnostics):void 0,c=n.area?.trim()||a.area,l=await t.report({type:`incident`,subject:je(n.what),body:`What happened\n${n.what.trim()}\n\nExpected instead\n${n.expected.trim()}`,impact:i.impact,urgency:i.urgency,reporter:n.contact,screenshot:o.screenshot?n.screenshot:void 0,trail:o.trail?r.recent(10):void 0,extra:s,consent:{system:o.system,browser:o.browser,trail:o.trail,extra:o.extra,screenshot:o.screenshot},context:{...a,...c?{area:c}:{},severity:n.severity}});return r.record(`note`,`Reported an issue (${De(l.id)})`),g(),{id:l.id,ref:De(l.id)}},async submitFeedback(e){let n=e.area?.trim()||a.area,r=await t.report({type:`feedback`,subject:`${Ce[e.kind].label}: ${je(e.body,100)}`,body:e.body.trim(),impact:`minor`,urgency:`low`,reporter:e.contact,screenshot:e.screenshot,consent:{trail:!1,extra:!1},context:{...a,...n?{area:n}:{},feedback_kind:e.kind}});return g(),{id:r.id,ref:De(r.id)}},async detail(e){let t=await n.get(e);return x(t),t},async reply(e,t){let r=await n.reply(e,t);return x(r),r},async verify(e,t,i){let a=await n.verify(e,t,i);return r.record(`note`,t?`Confirmed the fix for ${De(e)}`:`Said ${De(e)} is still happening`),x(a),a},async withdraw(e,t){let i=await n.withdraw(e,t);return r.record(`note`,`Withdrew ${De(e)}`),x(i),i},unread:m,markSeen(e){o={...o,[e]:Date.now()};try{localStorage.setItem(Oe,JSON.stringify(o))}catch{}u({})},destroy(){i(),_&&clearInterval(_),typeof document<`u`&&document.removeEventListener(`visibilitychange`,y),typeof window<`u`&&window.removeEventListener(`focus`,b),l.clear()}}}function Ae(){try{let e=JSON.parse(localStorage.getItem(Oe)??`{}`);return e&&typeof e==`object`?e:{}}catch{return{}}}function je(e,t=120){let n=e.trim().split(/\r?\n/)[0]??``;return n.length>t?`${n.slice(0,t-1).trimEnd()}…`:n}function Me(e){return e instanceof Error?e.message:String(e)}function Ne(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??`{${n}}`))}var Pe,Fe=n((()=>{Pe={launcher:`Help`,title:`Support`,homeTitle:`How can we help?`,reportAction:`Report an issue`,reportHint:`Something is broken or does the wrong thing`,feedbackAction:`Share feedback`,feedbackHint:`An idea, a frustration, or something that works well`,faqAction:`Browse the FAQs`,faqHint:`Answers to what people ask most`,yourReports:`Your reports`,refresh:`Check for updates`,updatedAgo:`Updated {ago}`,upToDate:`Up to date`,seeAll:`See all`,signedOutReports:`Sign in to follow your reports here.`,fixesWaitingOne:`A fix for one of your reports is ready. It needs your check.`,fixesWaitingMany:`Fixes for {n} of your reports are ready. They need your check.`,questionWaiting:`The team asked you something.`,stepDescribe:`Describe`,stepAttach:`Attach`,stepReview:`Review`,whatLabel:`What happened?`,whatHint:`What you did, and what the product did. Plain words are perfect.`,whatPlaceholder:`I selected three items and pressed Delete. Only one went away.`,expectedLabel:`What did you expect instead?`,expectedHint:`This is the half that says what to build. Two lines is plenty.`,expectedPlaceholder:`All three should have been deleted, the way they are from the menu.`,severityLabel:`How much is it holding you up?`,whereLabel:`Where in the product?`,whereHint:`Filled in from where you are. Change it if the problem is elsewhere.`,attachIntro:`Attach as much or as little as you like. Everything is shown before it is sent, and nothing is collected in the background.`,screenshot:`Screen capture`,screenshotNone:`Not captured. You choose what to share; this tab is offered first.`,capture:`Capture screen`,retake:`Retake`,capturing:`Capturing…`,pickHint:`Go to the screen you want to show`,pickCapture:`Capture`,system:`System and browser`,trail:`Your last steps`,trailNone:`Nothing recorded yet.`,diagnostics:`Diagnostics from the product`,contactLabel:`How can the team reach you?`,contactHint:`Optional. Without it, the team cannot reply to you.`,namePlaceholder:`Your name`,emailPlaceholder:`you@example.com`,attached:`Attached`,notAttached:`not attached`,next:`Next`,back:`Back`,cancel:`Cancel`,submitReport:`Send report`,reportSent:`Report sent`,reportSentBody:`You can follow it from here. When the team believes it is fixed, this is where you will be asked to check it.`,reportSentAnon:`Keep this reference. Quote it if you contact the team about this.`,track:`Follow this report`,done:`Done`,feedbackKindLabel:`What kind of feedback?`,feedbackLabel:`Tell us`,feedbackPlaceholder:`What you would change, and why it matters to you.`,sendFeedback:`Send feedback`,thanks:`Thank you`,thanksBody:`Feedback is read, and it is what decides what gets built next.`,faqSearch:`Search the FAQs`,faqEmpty:`Nothing matches.`,faqNotFound:`Did not find it?`,allReports:`All reports`,noReports:`Nothing reported yet`,noReportsBody:`When something does not behave the way you expect, this is where it goes, and where you watch what happens to it.`,conversation:`Conversation`,replyPlaceholder:`Reply to the team`,send:`Send`,closedNote:`This report is closed. Reporting it again opens a new one.`,withdrawAction:`Withdraw this report`,withdrawTitle:`Withdraw this report?`,withdrawBody:`The team stops working on it. This cannot be undone, but you can always report it again.`,withdrawPlaceholder:`Anything the team should know? (optional)`,withdrawConfirm:`Withdraw`,withdrawKeep:`Keep it`,closedReports:`Closed`,nothingOpen:`Nothing open right now.`,verifyTitle:`This should be fixed in the build you are running.`,verifyBody:`Try what went wrong and tell the team what you find. The report stays open until you do.`,verifyYes:`Yes, it works now`,verifyNo:`No, still happening`,verifyNoPlaceholder:`What is still happening? Anything that changed since you reported it helps.`,verifySend:`Send`,updateTitle:`Fixed in {version}. You are on {running}.`,updateBody:`Update to get the fix, then this report will ask you to check it.`,whatYouReported:`What you reported`,team:`Team`,you:`You`,error:`Something went wrong. Try again.`}}));Fe();var Ie=[`header`,`home-top`,`home-bottom`,`report-top`,`feedback-top`,`sent`,`footer`];function Le(e){let t=e,n=new Set;return{get:()=>t,set(e){t={...t,...e};for(let e of n)e()},subscribe(e){return n.add(e),()=>n.delete(e)}}}function Re(e,t){let n=typeof e==`string`?{preset:e}:e??{},r={...Ke[n.preset??`midnight`],...ze(n)};return r.scheme===`auto`?{...t?He:Ue,...L,...Be(n,[`accent`,`accentText`,`radius`,`font`,`mono`,`fontSize`,`width`]),scheme:`auto`}:r}function ze(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>t!==void 0&&e!==`preset`))}function Be(e,t){return Object.fromEntries(Object.entries(e).filter(([e,n])=>t.includes(e)&&n!==void 0))}function Ve(e){let t=e.radius;return[`--sg-accent:${e.accent}`,`--sg-accent-text:${e.accentText}`,`--sg-bg:${e.background}`,`--sg-surface:${e.surface}`,`--sg-raised:${e.raised}`,`--sg-border:${e.border}`,`--sg-text:${e.text}`,`--sg-muted:${e.muted}`,`--sg-dim:${e.dim}`,`--sg-success:${e.success}`,`--sg-warning:${e.warning}`,`--sg-danger:${e.danger}`,`--sg-info:${e.info}`,`--sg-radius:${t}px`,`--sg-radius-sm:${Math.max(4,Math.round(t*.6))}px`,`--sg-font:${e.font}`,`--sg-mono:${e.mono}`,`--sg-size:${e.fontSize}px`,`--sg-width:${e.width}px`,`--sg-shadow:${e.shadow}`,`--sg-scrim:${e.scrim}`,`color-scheme:${e.scheme===`light`?`light`:e.scheme===`dark`?`dark`:`light dark`}`].join(`;`)}var L,He,Ue,We,Ge,Ke,qe=n((()=>{L={radius:12,font:`inherit`,mono:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`,fontSize:13,width:440},He={...L,scheme:`dark`,accent:`#6d5efc`,accentText:`#ffffff`,background:`#0e1017`,surface:`#151824`,raised:`#1c2030`,border:`rgba(255,255,255,0.09)`,text:`#eef1f8`,muted:`#a3abc0`,dim:`#7f889d`,success:`#3ccf91`,warning:`#f5a524`,danger:`#ff5a6a`,info:`#4fb8ff`,shadow:`0 24px 70px -20px rgba(0,0,0,0.75)`,scrim:`rgba(4,5,10,0.55)`},Ue={...L,scheme:`light`,accent:`#2563eb`,accentText:`#ffffff`,background:`#ffffff`,surface:`#f6f7f9`,raised:`#eef0f4`,border:`rgba(15,23,42,0.11)`,text:`#0f172a`,muted:`#475569`,dim:`#64748b`,success:`#15803d`,warning:`#b45309`,danger:`#dc2626`,info:`#0369a1`,shadow:`0 24px 60px -24px rgba(15,23,42,0.35)`,scrim:`rgba(15,23,42,0.35)`},We={...L,scheme:`dark`,accent:`#7a50dd`,accentText:`#ffffff`,background:`#0d0b12`,surface:`#15121d`,raised:`#1d1927`,border:`rgba(255,255,255,0.08)`,text:`#f3f0fa`,muted:`#b4abc8`,dim:`#8a819e`,success:`#34d399`,warning:`#fbbf24`,danger:`#fb7185`,info:`#a78bfa`,radius:10,fontSize:12.5,width:480,shadow:`-24px 0 60px -20px rgba(0,0,0,0.9)`,scrim:`rgba(0,0,0,0.55)`},Ge={...L,scheme:`light`,accent:`#c2410c`,accentText:`#ffffff`,background:`#fffdf8`,surface:`#f7f2e8`,raised:`#efe8da`,border:`rgba(68,48,20,0.14)`,text:`#2b2118`,muted:`#5c4b3a`,dim:`#7a6754`,success:`#3f7d3a`,warning:`#a16207`,danger:`#b91c1c`,info:`#1d4ed8`,radius:18,fontSize:14,width:420,shadow:`0 30px 60px -30px rgba(68,48,20,0.45)`,scrim:`rgba(43,33,24,0.3)`},Ke={midnight:He,daylight:Ue,studio:We,paper:Ge}}));function Je(e){let t=[];for(let n of e.classList){let e=Ze[n];e&&t.push(e)}return e.classList.contains(`sg-btn`)&&!e.classList.contains(`sg-btn-ghost`)&&!e.classList.contains(`sg-btn-danger`)&&t.push(`button-primary`),e.classList.contains(`sg-chip`)&&(e.getAttribute(`aria-checked`)===`true`||e.getAttribute(`aria-pressed`)===`true`)&&t.push(`chip-selected`),t.join(` `)}function Ye(e){let t=Je(e);t?e.getAttribute(`part`)!==t&&e.setAttribute(`part`,t):e.hasAttribute(`part`)&&e.removeAttribute(`part`)}function Xe(e){let t=e=>{if(e instanceof Element){Ye(e);for(let t of e.querySelectorAll(`[class]`))Ye(t)}};for(let n of e.children)t(n);let n=new MutationObserver(e=>{for(let n of e)if(n.type===`attributes`)Ye(n.target);else for(let e of n.addedNodes)t(e)});return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`class`,`aria-checked`,`aria-pressed`]}),()=>n.disconnect()}var Ze,Qe=n((()=>{Ze={"sg-launcher":`launcher`,"sg-pickbar":`capture-bar`,"sg-badge":`badge`,"sg-scrim":`scrim`,"sg-panel":`panel`,"sg-header":`header`,"sg-title":`title`,"sg-sub":`subtitle`,"sg-iconbtn":`icon-button`,"sg-body":`body`,"sg-footer":`footer`,"sg-section":`section`,"sg-section-title":`section-title`,"sg-action":`action`,"sg-action-label":`action-label`,"sg-action-hint":`action-hint`,"sg-tile":`tile`,"sg-btn":`button`,"sg-btn-ghost":`button-ghost`,"sg-btn-danger":`button-danger`,"sg-link":`link`,"sg-label":`label`,"sg-hint":`hint`,"sg-err":`error`,"sg-input":`input`,"sg-textarea":`textarea`,"sg-chip":`chip`,"sg-switch":`switch`,"sg-pill":`pill`,"sg-banner":`banner`,"sg-card":`card`,"sg-steps":`steps`,"sg-row":`row`,"sg-row-title":`row-title`,"sg-rail":`rail`,"sg-msg":`message`,"sg-team":`message-team`,"sg-you":`message-you`,"sg-composer":`composer`,"sg-faq":`faq-item`,"sg-confirm":`confirmation`,"sg-ref":`reference`}}));function R(e,t){for(var n in t)e[n]=t[n];return e}function $e(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function et(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?Ct.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return tt(e,o,r,i,null)}function tt(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++wt,__i:-1,__u:0};return i==null&&V.vnode!=null&&V.vnode(a),a}function z(e){return e.children}function nt(e,t){this.props=e,this.context=t}function B(e,t){if(t==null)return e.__?B(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?B(e):null}function rt(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=R({},t);a.__v=t.__v+1,V.vnode&&V.vnode(a),mt(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??B(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,gt(r,a,i),t.__e=t.__=null,a.__e!=n&&it(a)}}function it(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),it(e)}function at(e){(!e.__d&&(e.__d=!0)&&H.push(e)&&!ot.__r++||Tt!=V.debounceRendering)&&((Tt=V.debounceRendering)||Et)(ot)}function ot(){try{for(var e,t=1;H.length;)H.length>t&&H.sort(Dt),e=H.shift(),t=H.length,rt(e)}finally{H.length=ot.__r=0}}function st(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_=r&&r.__k||It,v=t.length;for(c=ct(n,t,_,c,v),d=0;d<v;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&_[p.__i]||Ft,p.__i=d,g=mt(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&yt(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),4&p.__u?(c=lt(p,c,e),f.__e&&(f.__e=null)):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function ct(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=tt(null,o,null,null,null):Rt(o)?o=e.__k[a]=tt(z,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=tt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=ut(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=B(s)),bt(s,s));return r}function lt(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=lt(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=B(e)),t=n.insertBefore(e.__e,t||null));do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ut(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function dt(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||Lt.test(t)?n:n+`px`}function ft(e,t,n,r,i){var a,o;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||dt(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||dt(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(jt,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n[At]=r[At]:(n[At]=Mt,e.addEventListener(t,a?Pt:Nt,a)):e.removeEventListener(t,a?Pt:Nt,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function pt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[kt]==null)t[kt]=Mt++;else if(t[kt]<n[At])return;return n(V.event?V.event(t):t)}}}function mt(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=V.__b)&&u(t);n:if(typeof E==`function`){d=o.length;try{if(v=t.props,y=E.prototype&&E.prototype.render,b=(u=E.contextType)&&r[u.__c],x=u?b?b.props.value:u.__:r,n.__c?_=(f=t.__c=n.__c).__=f.__E:(y?t.__c=f=new E(v,x):(t.__c=f=new nt(v,x),f.constructor=E,f.render=xt),b&&b.sub(f),f.state||(f.state={}),f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&E.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=R({},f.__s)),R(f.__s,E.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&E.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&E.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),t.__v==n.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)){t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),It.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f),s=B(n);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__e=!1,S=V.__r,C=0,y)f.state=f.__s,f.__d=!1,S&&S(t),u=f.render(f.props,f.state,f.context),It.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,S&&S(t),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++C<25);f.state=f.__s,f.getChildContext!=null&&(r=R(R({},r),f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),w=u!=null&&u.type===z&&u.key==null?_t(u.props.children):u,s=st(e,Rt(w)?w:[w],t,n,r,i,a,o,s,c,l),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__E=f.__=null)}catch(e){if(o.length=d,t.__v=null,c||a!=null){if(e.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a!=null&&(a[a.indexOf(s)]=null),t.__e=s}else if(a!=null)for(T=a.length;T--;)$e(a[T])}else t.__e=n.__e;t.__k??(t.__k=n.__k||[]),e.then||ht(t),V.__e(e,t,n)}}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=vt(n.__e,t,n,r,i,a,o,c,l);return(u=V.diffed)&&u(t),128&t.__u?void 0:s}function ht(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ht))}function gt(e,t,n){for(var r=0;r<n.length;r++)yt(n[r],n[++r],n[++r]);V.__c&&V.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){V.__e(e,t.__v)}})}function _t(e){return typeof e!=`object`||!e||e.__b>0?e:Rt(e)?e.map(_t):e.constructor===void 0?R({},e):null}function vt(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props||Ft,_=t.props,v=t.type;if(v==`svg`?i=`http://www.w3.org/2000/svg`:v==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||(i=`http://www.w3.org/1999/xhtml`),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName==v:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(i,v,_.is&&_),s&&(V.__m&&V.__m(t,a),s=!1),a=null}if(v==null)g===_||s&&e.data==_||(e.data=_);else{if(a=v==`textarea`&&_.defaultValue!=null?null:a&&Ct.call(e.childNodes),!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`dangerouslySetInnerHTML`?d=p:l==`children`||l in _||l==`value`&&`defaultValue`in _||l==`checked`&&`defaultChecked`in _||ft(e,l,null,p,i);for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:s&&typeof p!=`function`||g[l]===p||ft(e,l,p,g[l],i);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),st(t.type==`template`?e.content:e,Rt(f)?f:[f],t,n,r,v==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&B(n,0),s,c),a!=null)for(l=a.length;l--;)$e(a[l]);s&&v!=`textarea`||(l=`value`,v==`progress`&&m==null?e.removeAttribute(`value`):m!=null&&(m!==e[l]||v==`progress`&&!m||v==`option`&&m!=g[l])&&ft(e,l,m,g[l],i),l=`checked`,h!=null&&h!=e[l]&&ft(e,l,h,g[l],i))}return e}function yt(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){V.__e(e,n)}}function bt(e,t,n){var r,i;if(V.unmount&&V.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||yt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){V.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&bt(r[i],t,n||typeof e.type!=`function`);n||$e(e.__e),e.__c=e.__=e.__e=void 0}function xt(e,t,n){return this.constructor(e,n)}function St(e,t,n){var r,i,a,o;t==document&&(t=document.documentElement),V.__&&V.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,a=[],o=[],mt(t,e=(!r&&n||t).__k=et(z,null,[e]),i||Ft,Ft,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?Ct.call(t.childNodes):null,a,!r&&n?n:i?i.__e:t.firstChild,r,o),gt(a,e,o),e.props.children=null}var Ct,V,wt,H,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt=n((()=>{Ft={},It=[],Lt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Rt=Array.isArray,Ct=It.slice,V={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},wt=0,nt.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=R({},this.state);typeof e==`function`&&(e=e(R({},n),this.props)),e&&R(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),at(this))},nt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),at(this))},nt.prototype.render=z,H=[],Et=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Dt=function(e,t){return e.__v.__b-t.__v.__b},ot.__r=0,Ot=Math.random().toString(8),kt=`__d`+Ot,At=`__a`+Ot,jt=/(PointerCapture)$|Capture$/i,Mt=0,Nt=pt(!1),Pt=pt(!0)}));function Bt(e,t){q.__h&&q.__h(K,e,Qt||t),Qt=0;var n=K.__H||(K.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function U(e){return Qt=1,Vt(Jt,e)}function Vt(e,t,n){var r=Bt(Yt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Jt(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=K,!K.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};K.__f=!0;var a=K.shouldComponentUpdate,o=K.componentWillUpdate;K.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},K.shouldComponentUpdate=i}return r.__N||r.__}function W(e,t){var n=Bt(Yt++,3);!q.__s&&qt(n.__H,t)&&(n.__=e,n.u=t,K.__H.__h.push(n))}function G(e){return Qt=5,Ht(function(){return{current:e}},[])}function Ht(e,t){var n=Bt(Yt++,7);return qt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ut(){for(var e;e=$t.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Gt),t.__h.some(Kt),t.__h=[]}catch(n){t.__h=[],q.__e(n,e.__v)}}}function Wt(e){var t,n=function(){clearTimeout(r),sn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);sn&&(t=requestAnimationFrame(n))}function Gt(e){var t=K,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),K=t}function Kt(e){var t=K;e.__c=e.__(),K=t}function qt(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Jt(e,t){return typeof t==`function`?t(e):t}var Yt,K,Xt,Zt,Qt,$t,q,en,tn,nn,rn,an,on,sn,cn=n((()=>{zt(),Qt=0,$t=[],q=V,en=q.__b,tn=q.__r,nn=q.diffed,rn=q.__c,an=q.unmount,on=q.__,q.__b=function(e){K=null,en&&en(e)},q.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),on&&on(e,t)},q.__r=function(e){tn&&tn(e),Yt=0;var t=(K=e.__c).__H;t&&(Xt===K?(t.__h=[],K.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Gt),t.__h.some(Kt),t.__h=[],Yt=0)),Xt=K},q.diffed=function(e){nn&&nn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($t.push(t)!==1&&Zt===q.requestAnimationFrame||((Zt=q.requestAnimationFrame)||Wt)(Ut)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),Xt=K=null},q.__c=function(e,t){t.some(function(e){try{e.__h.some(Gt),e.__h=e.__h.filter(function(e){return!e.__||Kt(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],q.__e(n,e.__v)}}),rn&&rn(e,t)},q.unmount=function(e){an&&an(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Gt(e)}catch(e){t=e}}),n.__H=void 0,t&&q.__e(t,n.__v))},sn=typeof requestAnimationFrame==`function`}));function J(e,t,n,r,i,a){t||(t={});var o,s,c=t;if(`ref`in c)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ln,__i:-1,__u:0,__source:i,__self:a};if(typeof e==`function`&&(o=e.defaultProps))for(s in o)c[s]===void 0&&(c[s]=o[s]);return V.vnode&&V.vnode(l),l}var ln,Y=n((()=>{zt(),ln=0,Array.isArray}));function un(e){return Object.prototype.hasOwnProperty.call(dn,e)}function X({name:e,size:t=16,stroke:n=1.8}){return J(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":n,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:J(`path`,{d:dn[e]})})}var dn,fn=n((()=>{Y(),dn={lifebuoy:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-5a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm2.8-6.8L18.4 5.6M9.2 9.2 5.6 5.6m3.6 9.2-3.6 3.6m9.2-3.6 3.6 3.6`,bug:`M9 9V8a3 3 0 0 1 6 0v1M8 9h8a6 6 0 0 1 1 3v3a5 5 0 0 1-10 0v-3a6 6 0 0 1 1-3ZM3 13h4m10 0h4M12 20v-6M4 19l3.35-2M20 19l-3.35-2M4 7l3.75 2.4M20 7l-3.75 2.4`,bulb:`M3 12h1m8-9v1m8 8h1M5.6 5.6l.7.7m12.1-.7-.7.7M9 16a5 5 0 1 1 6 0 3.5 3.5 0 0 0-1 3 2 2 0 0 1-4 0 3.5 3.5 0 0 0-1-3M9.7 17h4.6`,question:`M8 9h8M8 13h6M9 18H6a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-3l-3 3-3-3Z`,chevronRight:`m9 6 6 6-6 6`,chevronLeft:`m15 6-6 6 6 6`,arrowLeft:`M5 12h14M5 12l6 6M5 12l6-6`,x:`M18 6 6 18M6 6l12 12`,check:`m5 12 5 5L20 7`,checkCircle:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-3-9 2 2 4-4`,camera:`M5 7h1a2 2 0 0 0 2-2 1 1 0 0 1 1-1h6a1 1 0 0 1 1 1 2 2 0 0 0 2 2h1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2Zm7 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z`,monitor:`M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5Zm4 15h10M9 16v4m6-4v4`,history:`M12 8v4l2 2M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5`,cpu:`M5 6a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6Zm4 3h6v6H9V9ZM3 10h2m-2 4h2m14-4h2m-2 4h2M10 3v2m4-2v2m-4 14v2m4-2v2`,send:`M10 14 21 3M21 3l-6.5 18a.55.55 0 0 1-1 0L10 14l-7-3.5a.55.55 0 0 1 0-1L21 3`,search:`M10 17a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm11 4-6-6`,thumbUp:`M7 11v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h3Zm0 0a4 4 0 0 0 4-4V6a2 2 0 0 1 4 0v5h3a2 2 0 0 1 2 2l-1 5a2 3 0 0 1-2 2h-7a3 3 0 0 1-3-3`,refresh:`M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4`,download:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12`,external:`M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1 9-9m-5 0h5v5`,book:`M3 19a9 9 0 0 1 9 0 9 9 0 0 1 9 0M3 6a9 9 0 0 1 9 0 9 9 0 0 1 9 0M3 6v13M12 6v13M21 6v13`,message:`M8 9h8M8 13h6M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-5l-5 3v-3H6a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h12Z`}}));function Z({icon:e,tone:t,small:n}){return J(`span`,{class:`sg-tile sg-t-${t}${n?` sg-sm`:``}`,children:J(X,{name:e,size:n?14:17})})}function pn({tone:e,children:t}){return J(`span`,{class:`sg-pill sg-t-${e}`,children:t})}function Q({children:e,onClick:t,variant:n=`primary`,disabled:r,busy:i,icon:a,type:o=`button`,testId:s,btnRef:c,label:l}){return J(`button`,{ref:c,type:o,class:n===`primary`?`sg-btn`:n===`ghost`?`sg-btn sg-btn-ghost`:`sg-btn sg-btn-danger`,onClick:t,disabled:r||i,"data-testid":s,"aria-label":l,children:[i?J(`span`,{class:`sg-spin`,"aria-hidden":`true`}):a?J(X,{name:a,size:15}):null,e]})}function mn({label:e,hint:t,error:n,children:r}){return J(`label`,{class:`sg-field`,children:[J(`span`,{class:`sg-label`,children:e}),r,n?J(`span`,{class:`sg-err`,role:`alert`,children:n}):t?J(`span`,{class:`sg-hint`,children:t}):null]})}function $({name:e,filled:t}){return t.has(e)?J(`div`,{class:`sg-slot sg-slot-${e}`,"data-testid":`sg-slot-${e}`,children:J(`slot`,{name:e})}):null}function hn({on:e,onChange:t,label:n}){return J(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,class:`sg-switch`,onClick:()=>t(!e)})}function gn({view:e}){let t=e.stages.length;return J(`div`,{class:`sg-rail sg-t-${e.offPath?`neutral`:e.tone}`,role:`img`,"aria-label":`${e.label}: stage ${e.stage+1} of ${t}`,children:e.stages.map((n,r)=>{let i=r<=e.stage,a=r===e.stage,o=r===t-1&&!e.offPath&&r>e.stage;return J(`div`,{class:`sg-rail-stage`,children:[J(`div`,{class:`sg-rail-line`,children:[J(`span`,{class:`sg-rail-seg ${r===0?`sg-none`:r<=e.stage?`sg-on`:``}`}),J(`span`,{class:`sg-rail-node${i?` sg-on`:``}${a?` sg-here`:``}${a&&e.active?` sg-pulse`:``}${o?` sg-yours`:``}`}),J(`span`,{class:`sg-rail-seg ${r===t-1?`sg-none`:r<e.stage?`sg-on`:``}`})]}),J(`span`,{class:`sg-rail-label${i?` sg-on`:``}`,children:e.offPath&&r>e.stage?``:n})]},n)})})}var _n=n((()=>{fn(),Y()}));function vn({w:e}){let[t,n]=U(``),r=Ht(()=>{let n=t.trim().toLowerCase();return n?e.faq.filter(e=>`${e.q} ${e.a} ${(e.tags??[]).join(` `)}`.toLowerCase().includes(n)):e.faq},[t,e.faq]);return J(`div`,{class:`sg-body`,children:J(`div`,{class:`sg-pad`,children:[J(`div`,{style:{position:`relative`,marginBottom:`12px`},children:[J(`span`,{class:`sg-dim`,style:{position:`absolute`,left:`10px`,top:`9px`},children:J(X,{name:`search`,size:15})}),J(`input`,{class:`sg-input`,style:{paddingLeft:`32px`},placeholder:e.copy.faqSearch,"aria-label":e.copy.faqSearch,value:t,onInput:e=>n(e.currentTarget.value),"data-testid":`sg-faq-search`})]}),r.length===0&&J(`p`,{class:`sg-p sg-dim sg-small`,children:e.copy.faqEmpty}),r.map(e=>J(`details`,{class:`sg-faq`,children:[J(`summary`,{children:[e.q,J(`span`,{class:`sg-chev`,children:J(X,{name:`chevronRight`,size:14})})]}),J(`div`,{class:`sg-faq-a`,children:e.a})]},e.q)),e.features.report&&J(`div`,{class:`sg-banner sg-t-accent`,style:{marginTop:`16px`,alignItems:`center`},children:[J(`span`,{style:{flex:1},class:`sg-banner-title`,children:e.copy.faqNotFound}),J(Q,{variant:`ghost`,icon:`bug`,onClick:()=>e.go({name:`report`}),children:e.copy.reportAction})]})]})})}var yn=n((()=>{cn(),fn(),_n(),Y()}));function bn({w:e}){let{copy:t,support:n,state:r,features:i}=e,[a,o]=U(`idea`),[s,c]=U(``),[l,u]=U(null),[d,f]=U({name:``,email:``}),[p,m]=U(!1),[h,g]=U(!1),[_,v]=U(null),y=s.trim().length<4,b=r.signedIn!==!0;async function x(){if(g(!0),!y){m(!0),v(null);try{let t=await n.submitFeedback({kind:a,body:s,screenshot:l??void 0,contact:b&&(d.name||d.email)?{name:d.name||void 0,email:d.email||void 0}:void 0});e.emit(`submitted`,{...t,type:`feedback`}),e.go({name:`thanks`})}catch(e){v(e instanceof Error?e.message:t.error)}finally{m(!1)}}}return J(z,{children:[J(`div`,{class:`sg-body`,children:[J($,{name:`feedback-top`,filled:e.slots}),J(`div`,{class:`sg-pad sg-stack`,children:[J(`div`,{children:[J(`span`,{class:`sg-label`,children:t.feedbackKindLabel}),J(`div`,{class:`sg-chips`,role:`radiogroup`,"aria-label":t.feedbackKindLabel,children:Object.keys(Ce).map(e=>J(`button`,{type:`button`,class:`sg-chip`,role:`radio`,"aria-checked":a===e,onClick:()=>o(e),"data-testid":`sg-kind-${e}`,children:Ce[e].label},e))}),J(`span`,{class:`sg-hint`,children:Ce[a].hint})]}),J(mn,{label:t.feedbackLabel,error:h&&y?`Say a little more.`:null,children:J(`textarea`,{class:`sg-textarea${h&&y?` sg-invalid`:``}`,value:s,onInput:e=>c(e.currentTarget.value),placeholder:t.feedbackPlaceholder,"data-testid":`sg-feedback-body`,autoFocus:!0})}),i.screenshot&&J(`div`,{children:l?J(z,{children:[J(`img`,{class:`sg-shot`,src:l,alt:`The frame that will be attached`}),J(`button`,{type:`button`,class:`sg-link`,style:{marginTop:`6px`},onClick:()=>u(null),children:`Remove`})]}):J(`button`,{type:`button`,class:`sg-link`,onClick:async()=>{let t=await e.capture();t.ok&&u(t.dataUrl)},children:[`+ `,t.capture]})}),b&&J(`div`,{children:[J(`span`,{class:`sg-label`,children:t.contactLabel}),J(`div`,{class:`sg-stack`,children:[J(`input`,{class:`sg-input`,placeholder:t.namePlaceholder,value:d.name,onInput:e=>f(t=>({...t,name:e.currentTarget.value}))}),J(`input`,{class:`sg-input`,type:`email`,placeholder:t.emailPlaceholder,value:d.email,onInput:e=>f(t=>({...t,email:e.currentTarget.value}))})]}),J(`span`,{class:`sg-hint`,children:t.contactHint})]}),_&&J(`p`,{class:`sg-err`,role:`alert`,children:_})]})]}),J(`div`,{class:`sg-footer`,children:[J(Q,{variant:`ghost`,onClick:()=>e.go({name:`home`}),children:t.cancel}),J(Q,{onClick:()=>void x(),busy:p,icon:`send`,testId:`sg-send-feedback`,children:t.sendFeedback})]})]})}var xn=n((()=>{cn(),I(),_n(),Y()}));function Sn({w:e,compact:t=!1}){let n=e.state.reports;if(n.length===0)return J(`div`,{class:`sg-empty`,children:[J(`span`,{class:`sg-empty-icon`,children:J(X,{name:`bug`,size:20})}),J(`p`,{class:`sg-p`,style:{marginTop:`10px`,fontWeight:600},children:e.copy.noReports}),J(`p`,{class:`sg-p sg-small sg-dim`,style:{marginTop:`4px`},children:e.copy.noReportsBody}),e.features.report&&J(`div`,{style:{marginTop:`14px`},children:J(Q,{variant:`ghost`,icon:`bug`,onClick:()=>e.go({name:`report`}),children:e.copy.reportAction})})]});let r=n.filter(t=>P(t,e.appVersion).open),i=n.filter(t=>!P(t,e.appVersion).open);return t?J(z,{children:[r.length>0?J(Cn,{w:e,reports:r.slice(0,3)}):J(`p`,{class:`sg-p sg-small sg-dim sg-pad`,children:e.copy.nothingOpen}),i.length>0&&J(`button`,{type:`button`,class:`sg-closed-link`,onClick:()=>e.go({name:`reports`}),"data-testid":`sg-closed-link`,children:[e.copy.closedReports,` · `,i.length,J(X,{name:`chevronRight`,size:14})]})]}):J(z,{children:[r.length>0?J(Cn,{w:e,reports:r}):J(`p`,{class:`sg-p sg-small sg-dim sg-pad`,children:e.copy.nothingOpen}),i.length>0&&J(`details`,{class:`sg-closed`,"data-testid":`sg-closed`,children:[J(`summary`,{children:[J(X,{name:`chevronRight`,size:14}),e.copy.closedReports,` · `,i.length]}),J(Cn,{w:e,reports:i})]})]})}function Cn({w:e,reports:t}){return J(`ul`,{class:`sg-list`,"data-testid":`sg-report-list`,children:t.map(t=>{let n=P(t,e.appVersion),r=e.support.unread(t),i=typeof t.source_context?.area==`string`?t.source_context.area:null;return J(`li`,{children:J(`button`,{type:`button`,class:`sg-row`,onClick:()=>e.go({name:`detail`,id:t.id}),"data-testid":`sg-report-row`,children:[J(`div`,{class:`sg-row-main`,children:[J(`div`,{class:`sg-row-top`,children:[r&&J(`span`,{class:`sg-dot`,style:{marginTop:`7px`},"aria-label":`New reply`}),J(`span`,{class:`sg-row-title`,children:t.subject}),J(pn,{tone:n.tone,children:n.label})]}),J(`div`,{class:`sg-row-meta`,children:[J(`span`,{class:`sg-mono`,children:t.ref}),i&&J(`span`,{children:[`· `,i]}),J(`span`,{children:[`· `,F(t.created_at)]})]}),n.needsYou&&J(`span`,{class:`sg-row-cta sg-t-${t.status===`waiting_user`?`warn`:`success`}`,children:[J(X,{name:t.status===`waiting_user`?`message`:`checkCircle`,size:13}),t.status===`waiting_user`?`Reply to the team`:`Check the fix and tell the team`]})]}),J(`span`,{class:`sg-chev`,style:{paddingTop:`2px`},children:J(X,{name:`chevronRight`})})]})},t.id)})})}function wn({w:e,id:t}){let{copy:n,support:r}=e,[i,a]=U(null),[o,s]=U(null),[c,l]=U(``),[u,d]=U(!1),[f,p]=U(!1),[m,h]=U(``),[g,_]=U(!1),[v,y]=U(!1),[b,x]=U(``),[S,C]=U(!1),w=G(null);if(W(()=>{let e=!0,i=()=>r.detail(t).then(n=>{e&&(a(n),r.markSeen(t))}).catch(t=>e&&s(t instanceof Error?t.message:n.error));i();let o=setInterval(()=>{document.visibilityState===`visible`&&i()},1e4),c=()=>{document.visibilityState===`visible`&&i()};return window.addEventListener(`focus`,c),document.addEventListener(`visibilitychange`,c),()=>{e=!1,clearInterval(o),window.removeEventListener(`focus`,c),document.removeEventListener(`visibilitychange`,c)}},[t,r,n.error,e.tick]),W(()=>{w.current?.scrollIntoView({block:`end`})},[i?.timeline.length??0]),!i)return J(`div`,{class:`sg-body`,"aria-busy":`true`,children:o?J(`p`,{class:`sg-err sg-pad`,children:o}):J(z,{children:[J(`div`,{class:`sg-skeleton`}),J(`div`,{class:`sg-skeleton`})]})});let T=P(i,e.appVersion),E=ve(i.body),ee=ce(i,e.appVersion),D=le(i,e.appVersion),O=typeof i.source_context?.area==`string`?i.source_context.area:null,k=typeof i.source_context?.app_version==`string`?i.source_context.app_version:null;async function A(i){_(!0),s(null);try{let n=await r.verify(t,i,i?void 0:m.trim()||void 0);a(n),p(!1),h(``),e.emit(`verified`,{id:t,works:i})}catch(e){s(e instanceof Error?e.message:n.error)}finally{_(!1)}}async function te(){C(!0),s(null);try{let n=await r.withdraw(t,b.trim()||void 0);a(n),y(!1),x(``),e.emit(`withdrawn`,{id:t})}catch(e){s(e instanceof Error?e.message:n.error)}finally{C(!1)}}async function j(){let e=c.trim();if(e){d(!0),s(null);try{a(await r.reply(t,e)),l(``)}catch(e){s(e instanceof Error?e.message:n.error)}finally{d(!1)}}}return J(z,{children:[J(`div`,{class:`sg-body`,"data-testid":`sg-detail`,children:J(`div`,{class:`sg-pad sg-stack`,children:[J(`div`,{class:`sg-rail-box`,children:J(gn,{view:T})}),J(`div`,{children:[J(pn,{tone:T.tone,children:T.label}),J(`p`,{class:`sg-p sg-muted`,style:{marginTop:`6px`},children:T.blurb})]}),ee&&J(`div`,{class:`sg-banner sg-t-success`,style:{display:`block`},"data-testid":`sg-verify`,children:[J(`p`,{class:`sg-banner-title`,style:{display:`flex`,gap:`8px`,alignItems:`center`},children:[J(X,{name:`checkCircle`}),` `,n.verifyTitle]}),J(`p`,{class:`sg-banner-body`,children:[i.fixed_in_version&&e.appVersion?`Fixed in ${i.fixed_in_version}; you are on ${e.appVersion}. `:``,n.verifyBody]}),f?J(`div`,{style:{marginTop:`10px`},class:`sg-stack`,children:[J(`textarea`,{class:`sg-textarea`,value:m,onInput:e=>h(e.currentTarget.value),placeholder:n.verifyNoPlaceholder,autoFocus:!0,"data-testid":`sg-verify-note`}),J(`div`,{style:{display:`flex`,gap:`8px`},children:[J(Q,{variant:`danger`,onClick:()=>void A(!1),busy:g,testId:`sg-verify-send-no`,children:n.verifySend}),J(Q,{variant:`ghost`,onClick:()=>p(!1),children:n.cancel})]})]}):J(`div`,{style:{marginTop:`10px`,display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[J(Q,{icon:`thumbUp`,onClick:()=>void A(!0),busy:g,testId:`sg-verify-yes`,children:n.verifyYes}),J(Q,{variant:`danger`,onClick:()=>p(!0),testId:`sg-verify-no`,children:n.verifyNo})]})]}),D&&J(`div`,{class:`sg-banner sg-t-warn`,children:[J(Z,{icon:`download`,tone:`warn`,small:!0}),J(`div`,{children:[J(`p`,{class:`sg-banner-title`,children:Ne(n.updateTitle,{version:i.fixed_in_version??``,running:e.appVersion??``})}),J(`p`,{class:`sg-banner-body`,children:n.updateBody})]})]}),J(`div`,{children:[J(`span`,{class:`sg-label`,children:n.whatYouReported}),E.some(e=>e.label)?J(`dl`,{class:`sg-review`,style:{margin:`4px 0 0`},children:E.map((e,t)=>J(z,{children:[e.label&&J(`dt`,{children:e.label},`l${t}`),J(`dd`,{children:e.text},`t${t}`)]}))}):J(z,{children:[J(`p`,{class:`sg-p`,style:{fontWeight:600},children:i.subject}),i.body&&J(`p`,{class:`sg-p sg-muted`,style:{whiteSpace:`pre-wrap`,marginTop:`4px`},children:i.body})]}),J(`div`,{class:`sg-row-meta`,style:{marginTop:`6px`},children:[J(`span`,{class:`sg-mono`,children:i.ref}),O&&J(`span`,{children:[`· `,O]}),k&&J(`span`,{children:[`· reported on `,k]}),J(`span`,{children:[`· `,F(i.created_at)]})]})]}),J(`div`,{children:[J(`span`,{class:`sg-label`,children:n.conversation}),J(`div`,{class:`sg-thread`,"data-testid":`sg-thread`,children:[pe(i).map((e,t)=>e.kind===`read`?J(`div`,{class:`sg-event`,"data-testid":`sg-read`,children:[me(e.name),` · `,F(e.at)]},t):e.kind===`status`?J(`div`,{class:`sg-event`,children:[_e(e),` · `,F(e.at)]},t):J(`div`,{class:`sg-msg ${e.by===`you`?`sg-you`:`sg-team`}`,"data-testid":`sg-msg-${e.by}`,children:[J(`span`,{class:`sg-msg-meta`,children:[e.by===`you`?n.you:e.author_name,` · `,F(e.at)]}),e.body]},t)),J(`div`,{ref:w})]})]}),de(i)&&!ee&&(v?J(`div`,{class:`sg-banner`,style:{display:`block`},"data-testid":`sg-withdraw`,children:[J(`p`,{class:`sg-banner-title`,children:n.withdrawTitle}),J(`p`,{class:`sg-banner-body`,children:n.withdrawBody}),J(`div`,{style:{marginTop:`10px`},class:`sg-stack`,children:[J(`textarea`,{class:`sg-textarea`,value:b,onInput:e=>x(e.currentTarget.value),placeholder:n.withdrawPlaceholder,autoFocus:!0,"data-testid":`sg-withdraw-note`}),J(`div`,{style:{display:`flex`,gap:`8px`},children:[J(Q,{variant:`danger`,onClick:()=>void te(),busy:S,testId:`sg-withdraw-confirm`,children:n.withdrawConfirm}),J(Q,{variant:`ghost`,onClick:()=>y(!1),children:n.withdrawKeep})]})]})]}):J(`button`,{type:`button`,class:`sg-quiet-link`,onClick:()=>y(!0),"data-testid":`sg-withdraw-open`,children:n.withdrawAction})),o&&J(`p`,{class:`sg-err`,role:`alert`,children:o})]})}),T.open?J(`form`,{class:`sg-composer`,onSubmit:e=>{e.preventDefault(),j()},children:[J(`textarea`,{class:`sg-textarea`,rows:1,value:c,onInput:e=>l(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),j())},placeholder:n.replyPlaceholder,"aria-label":n.replyPlaceholder,"data-testid":`sg-reply`}),J(Q,{type:`submit`,icon:`send`,busy:u,disabled:!c.trim(),testId:`sg-reply-send`,children:n.send})]}):J(`div`,{class:`sg-footer sg-small sg-dim`,children:n.closedNote})]})}var Tn=n((()=>{cn(),I(),fn(),_n(),Y()}));function En({w:e}){let{copy:t,features:n,state:r}=e,i=r.reports,a=i.filter(t=>t.status===`resolved`&&P(t,e.appVersion).needsYou),o=i.filter(e=>e.status===`waiting_user`),s=n.reports&&r.signedIn!==!1,c=i.filter(t=>P(t,e.appVersion).open).length;return J(`div`,{class:`sg-body`,"data-testid":`sg-home`,children:[J($,{name:`home-top`,filled:e.slots}),J(`section`,{class:`sg-section`,children:[J(`div`,{class:`sg-section-head`,children:J(`h3`,{class:`sg-section-title`,children:t.homeTitle})}),n.report&&J(`button`,{type:`button`,class:`sg-action`,onClick:()=>e.go({name:`report`}),"data-testid":`sg-open-report`,children:[J(Z,{icon:`bug`,tone:`danger`}),J(`span`,{class:`sg-action-text`,children:[J(`span`,{class:`sg-action-label`,children:t.reportAction}),J(`span`,{class:`sg-action-hint`,children:t.reportHint})]}),J(`span`,{class:`sg-chev`,children:J(X,{name:`chevronRight`})})]}),n.feedback&&J(`button`,{type:`button`,class:`sg-action`,onClick:()=>e.go({name:`feedback`}),"data-testid":`sg-open-feedback`,children:[J(Z,{icon:`bulb`,tone:`warn`}),J(`span`,{class:`sg-action-text`,children:[J(`span`,{class:`sg-action-label`,children:t.feedbackAction}),J(`span`,{class:`sg-action-hint`,children:t.feedbackHint})]}),J(`span`,{class:`sg-chev`,children:J(X,{name:`chevronRight`})})]}),n.faq&&e.faq.length>0&&J(`button`,{type:`button`,class:`sg-action`,onClick:()=>e.go({name:`faq`}),"data-testid":`sg-open-faq`,children:[J(Z,{icon:`question`,tone:`accent`}),J(`span`,{class:`sg-action-text`,children:[J(`span`,{class:`sg-action-label`,children:t.faqAction}),J(`span`,{class:`sg-action-hint`,children:t.faqHint})]}),J(`span`,{class:`sg-chev`,children:J(X,{name:`chevronRight`})})]}),e.actions.map((e,t)=>J(Dn,{action:e,index:t},`${e.label}-${t}`))]}),s&&J(`section`,{class:`sg-section`,style:{paddingLeft:0,paddingRight:0},children:[J(`div`,{class:`sg-section-head`,style:{padding:`0 16px`},children:[J(`h3`,{class:`sg-section-title`,children:[t.yourReports,c?` · ${c}`:``]}),c>3&&J(`button`,{type:`button`,class:`sg-link`,onClick:()=>e.go({name:`reports`}),children:[t.seeAll,` `,c]})]}),(a.length>0||o.length>0)&&J(`div`,{style:{padding:`0 16px 10px`},children:J(`button`,{type:`button`,class:`sg-banner sg-t-${a.length?`success`:`warn`}`,onClick:()=>e.go(a.length+o.length===1?{name:`detail`,id:(a[0]??o[0]).id}:{name:`reports`}),"data-testid":`sg-attention`,children:[J(Z,{icon:a.length?`checkCircle`:`message`,tone:a.length?`success`:`warn`,small:!0}),J(`span`,{children:J(`span`,{class:`sg-banner-title`,children:a.length?a.length===1?t.fixesWaitingOne:Ne(t.fixesWaitingMany,{n:a.length}):t.questionWaiting})})]})}),r.signedIn===null||r.loading&&i.length===0?J(`div`,{"aria-busy":`true`,children:[J(`div`,{class:`sg-skeleton`}),J(`div`,{class:`sg-skeleton`})]}):i.length===0?J(On,{w:e}):J(Sn,{w:e,compact:!0})]}),n.reports&&r.signedIn===!1&&J(`section`,{class:`sg-section`,children:J(`p`,{class:`sg-p sg-small sg-dim`,children:t.signedOutReports})}),J($,{name:`home-bottom`,filled:e.slots})]})}function Dn({action:e,index:t}){let n=e.icon&&un(e.icon)?e.icon:null,r=e.icon&&!n?e.icon:null,i=J(z,{children:[r?J(`span`,{class:`sg-tile sg-t-accent`,children:J(`img`,{src:r,alt:``,class:`sg-tile-img`})}):J(Z,{icon:n??(e.href?`external`:`chevronRight`),tone:`accent`}),J(`span`,{class:`sg-action-text`,children:[J(`span`,{class:`sg-action-label`,children:e.label}),e.hint&&J(`span`,{class:`sg-action-hint`,children:e.hint})]}),J(`span`,{class:`sg-chev`,children:J(X,{name:e.href?`external`:`chevronRight`})})]});return e.href?J(`a`,{class:`sg-action`,href:e.href,target:`_blank`,rel:`noopener noreferrer`,"data-testid":`sg-host-action-${t}`,children:i}):J(`button`,{type:`button`,class:`sg-action`,onClick:()=>e.onClick?.(),"data-testid":`sg-host-action-${t}`,children:i})}function On({w:e}){return J(`div`,{style:{padding:`0 16px`},children:J(`div`,{class:`sg-rail-box`,children:[J(gn,{view:{label:`How a report travels`,blurb:``,tone:`accent`,stages:[`Sent`,`Read`,`Accepted`,`Fixed`,`You check`],stage:-1,active:!1,offPath:!1,open:!0,needsYou:!1}}),J(`p`,{class:`sg-p sg-small sg-muted`,style:{marginTop:`10px`},children:e.copy.noReportsBody})]})})}var kn=n((()=>{I(),Fe(),fn(),_n(),Tn(),Y()}));function An({w:e}){let{copy:t,support:n,state:r,features:i}=e,[a,o]=U(1),[s,c]=U(``),[l,u]=U(``),[d,f]=U(`major`),[p,m]=U(String(n.context().area??``)),[h,v]=U(!1),[y,b]=U(null),[x,S]=U(null),[C,w]=U(null),[T,E]=U(!1),[D,O]=U({screenshot:!0,system:!0,trail:!0,extra:!0}),[k,A]=U({name:``,email:``}),[te,j]=U(!1),[ne,re]=U(null),ie=r.signedIn!==!0,M=he({what:s,expected:l});async function ae(){if(v(!0),!M){j(!0);try{b(await n.collect())}catch{b({trail:n.trail.recent(10)})}finally{j(!1),o(2)}}}async function oe(){E(!0),w(null);let t=await e.capture();E(!1),t.ok?(S({dataUrl:t.dataUrl,width:t.width,height:t.height,bytes:t.bytes,mime:t.mime}),O(e=>({...e,screenshot:!0}))):t.reason!==`cancelled`&&w(t.message)}async function se(){j(!0),re(null);try{let t=await n.submitIssue({what:s,expected:l,severity:d,area:p,screenshot:D.screenshot&&x?x.dataUrl:void 0,include:{screenshot:D.screenshot&&!!x,system:D.system,browser:D.system,trail:D.trail,extra:D.extra},contact:ie&&(k.name||k.email)?{name:k.name||void 0,email:k.email||void 0}:void 0});e.emit(`submitted`,{...t,type:`incident`}),e.go({name:`sent`,id:t.id,ref:t.ref})}catch(e){re(e instanceof Error?e.message:t.error)}finally{j(!1)}}let N=y?.trail??[],ce=y?.extra?Object.keys(y.extra):[];return J(z,{children:[J(jn,{step:a,labels:[t.stepDescribe,t.stepAttach,t.stepReview]}),J(`div`,{class:`sg-body`,children:[a===1&&J($,{name:`report-top`,filled:e.slots}),a===1&&J(`div`,{class:`sg-pad sg-stack`,children:[J(mn,{label:t.whatLabel,hint:t.whatHint,error:h&&M?.field===`what`?M.message:null,children:J(`textarea`,{class:`sg-textarea${h&&M?.field===`what`?` sg-invalid`:``}`,value:s,onInput:e=>c(e.currentTarget.value),placeholder:t.whatPlaceholder,"data-testid":`sg-what`,autoFocus:!0})}),J(mn,{label:t.expectedLabel,hint:t.expectedHint,error:h&&M?.field===`expected`?M.message:null,children:J(`textarea`,{class:`sg-textarea${h&&M?.field===`expected`?` sg-invalid`:``}`,value:l,onInput:e=>u(e.currentTarget.value),placeholder:t.expectedPlaceholder,"data-testid":`sg-expected`})}),J(`div`,{children:[J(`span`,{class:`sg-label`,children:t.severityLabel}),J(`div`,{class:`sg-chips`,role:`radiogroup`,"aria-label":t.severityLabel,children:Pn.map(e=>J(`button`,{type:`button`,class:`sg-chip`,role:`radio`,"aria-checked":d===e,onClick:()=>f(e),"data-testid":`sg-sev-${e}`,children:[J(`span`,{class:`sg-dot sg-t-${Se[e].tone}`}),Se[e].label]},e))}),J(`span`,{class:`sg-hint`,children:Se[d].hint})]}),J(mn,{label:t.whereLabel,hint:t.whereHint,children:J(`input`,{class:`sg-input`,value:p,onInput:e=>m(e.currentTarget.value),"data-testid":`sg-where`})})]}),a===2&&J(`div`,{class:`sg-pad`,children:[J(`p`,{class:`sg-p sg-small sg-muted`,style:{marginBottom:`12px`},children:t.attachIntro}),i.screenshot&&J(Mn,{icon:`camera`,title:t.screenshot,summary:x?`${x.width}×${x.height} · ${ee(x.bytes)}`:t.screenshotNone,on:D.screenshot&&!!x,onToggle:e=>x?O(t=>({...t,screenshot:e})):void oe(),accessory:J(`button`,{type:`button`,class:`sg-link`,onClick:()=>void oe(),disabled:T,"data-testid":`sg-capture`,children:T?t.capturing:x?t.retake:t.capture}),children:[x&&J(`img`,{class:`sg-shot`,src:x.dataUrl,alt:`The frame that will be attached`,"data-testid":`sg-shot`}),C&&J(`span`,{class:`sg-err`,children:C})]}),J(Mn,{icon:`monitor`,title:t.system,summary:`${g(y?.system)} · ${_(y?.browser)}`,on:D.system,onToggle:e=>O(t=>({...t,system:e})),children:J(`pre`,{class:`sg-json`,children:JSON.stringify({system:y?.system,browser:y?.browser},null,2)})}),J(Mn,{icon:`history`,title:t.trail,summary:N.length?`${N.length} steps, ending with “${N[N.length-1].label}”`:t.trailNone,on:D.trail&&N.length>0,onToggle:e=>O(t=>({...t,trail:e})),children:N.length>0&&J(`ol`,{class:`sg-steplist`,children:N.map((e,t)=>J(`li`,{children:[J(`span`,{class:`sg-when`,children:F(e.at)}),J(`span`,{class:e.kind===`error`?`sg-err-step`:``,children:e.label})]},t))})}),ce.length>0&&J(Mn,{icon:`cpu`,title:t.diagnostics,summary:ce.join(`, `),on:D.extra,onToggle:e=>O(t=>({...t,extra:e})),children:J(`pre`,{class:`sg-json`,children:JSON.stringify(y?.extra,null,2)})})]}),a===3&&J(`div`,{class:`sg-pad`,children:[J(`dl`,{class:`sg-review`,style:{margin:0},children:[J(`dt`,{children:t.whatLabel}),J(`dd`,{children:s.trim()}),J(`dt`,{children:t.expectedLabel}),J(`dd`,{children:l.trim()}),J(`dt`,{children:t.severityLabel}),J(`dd`,{children:Se[d].label}),p.trim()&&J(z,{children:[J(`dt`,{children:t.whereLabel}),J(`dd`,{children:p.trim()})]}),e.appVersion&&J(z,{children:[J(`dt`,{children:`Version`}),J(`dd`,{children:e.appVersion})]})]}),J(`span`,{class:`sg-label`,children:t.attached}),J(`ul`,{class:`sg-attached`,children:[i.screenshot&&J(Nn,{on:D.screenshot&&!!x,label:t.screenshot,copy:t.notAttached}),J(Nn,{on:D.system,label:t.system,copy:t.notAttached}),J(Nn,{on:D.trail&&N.length>0,label:t.trail,copy:t.notAttached}),ce.length>0&&J(Nn,{on:D.extra,label:t.diagnostics,copy:t.notAttached})]}),ie&&J(`div`,{style:{marginTop:`16px`},children:[J(`span`,{class:`sg-label`,children:t.contactLabel}),J(`div`,{class:`sg-stack`,children:[J(`input`,{class:`sg-input`,placeholder:t.namePlaceholder,value:k.name,onInput:e=>A(t=>({...t,name:e.currentTarget.value}))}),J(`input`,{class:`sg-input`,type:`email`,placeholder:t.emailPlaceholder,value:k.email,onInput:e=>A(t=>({...t,email:e.currentTarget.value}))})]}),J(`span`,{class:`sg-hint`,children:t.contactHint})]}),ne&&J(`p`,{class:`sg-err`,role:`alert`,style:{marginTop:`12px`},children:ne})]})]}),J(`div`,{class:`sg-footer`,children:[J(Q,{variant:`ghost`,icon:a===1?void 0:`chevronLeft`,onClick:()=>a===1?e.go({name:`home`}):o(e=>e-1),children:a===1?t.cancel:t.back}),a===1&&J(Q,{onClick:()=>void ae(),busy:te,testId:`sg-next`,children:t.next}),a===2&&J(Q,{onClick:()=>o(3),testId:`sg-next`,children:t.next}),a===3&&J(Q,{onClick:()=>void se(),busy:te,icon:`send`,testId:`sg-submit`,children:t.submitReport})]})]})}function jn({step:e,labels:t}){return J(`div`,{class:`sg-steps`,"aria-label":`Step ${e} of ${t.length}`,children:t.map((n,r)=>{let i=r+1,a=i<e,o=i===e;return J(`div`,{class:`sg-step`,children:[J(`div`,{class:`sg-step-line`,children:[J(`span`,{class:`sg-step-seg ${r===0?`sg-none`:a||o?`sg-on`:``}`}),J(`span`,{class:`sg-step-node${o?` sg-now`:a?` sg-done`:``}`,children:a?J(X,{name:`check`,size:11,stroke:2.6}):i}),J(`span`,{class:`sg-step-seg ${r===t.length-1?`sg-none`:a?`sg-on`:``}`})]}),J(`span`,{class:`sg-step-label${o?` sg-now`:``}`,children:n})]},n)})})}function Mn({icon:e,title:t,summary:n,on:r,onToggle:i,accessory:a,children:o}){return J(`div`,{class:`sg-card${r?``:` sg-off`}`,children:[J(`div`,{class:`sg-card-head`,children:[J(`span`,{class:`sg-dim`,style:{paddingTop:`2px`},children:J(X,{name:e})}),J(`div`,{class:`sg-card-text`,children:[J(`p`,{class:`sg-card-title`,children:t}),J(`p`,{class:`sg-card-sum`,children:n}),a&&J(`div`,{style:{marginTop:`4px`},children:a})]}),J(hn,{on:r,onChange:i,label:`Attach ${t}`})]}),o&&J(`div`,{class:`sg-card-body`,children:o})]})}function Nn({on:e,label:t,copy:n}){return J(`li`,{class:e?``:`sg-dim`,children:[J(`span`,{style:{color:e?`var(--sg-success)`:`var(--sg-dim)`},children:e?J(X,{name:`check`,size:14,stroke:2.4}):`–`}),t,!e&&J(`span`,{class:`sg-small sg-dim`,children:n})]})}var Pn,Fn=n((()=>{cn(),j(),I(),fn(),_n(),Y(),Pn=[`blocking`,`major`,`minor`,`cosmetic`]}));function In(e,t,n){let r=null,i=!1;function a(t){let n=r;r=null,i=!1,e.set({picking:!1,hidden:!1}),n?.(t)}return{get active(){return r!==null},start(){return n()?(r&&a(Ln),new Promise(t=>{r=t,e.set({picking:!0,hidden:!1})})):Promise.resolve({ok:!1,reason:`unsupported`,message:`This browser cannot capture the screen.`})},async capture(){if(!r||i)return;i=!0,e.set({hidden:!0});let n=await t({beforeCapture:()=>e.set({hidden:!0}),afterCapture:()=>{}});if(i=!1,r){if(!n.ok&&n.reason===`cancelled`){e.set({hidden:!1});return}a(n)}},cancel(){r&&a(Ln)}}}var Ln,Rn=n((()=>{Ln={ok:!1,reason:`cancelled`,message:`Capture was cancelled.`}})),zn,Bn=n((()=>{zn=`:host{all:initial;font-family:inherit}.sg-root{font-family:var(--sg-font);font-size:var(--sg-size);line-height:1.5;color:var(--sg-text);-webkit-font-smoothing:antialiased}.sg-root *,.sg-root *::before,.sg-root *::after{box-sizing:border-box}.sg-root button,.sg-root input,.sg-root textarea{font:inherit;color:inherit}.sg-root :focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}.sg-launcher{position:fixed;bottom:20px;z-index:var(--sg-z);display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 16px 0 14px;border:0;border-radius:999px;cursor:pointer;background:var(--sg-accent);color:var(--sg-accent-text);font-weight:600;font-size:calc(var(--sg-size) + 0.5px);box-shadow:0 10px 30px -10px color-mix(in srgb,var(--sg-accent) 70%,black),0 2px 6px rgba(0,0,0,0.18);transition:transform .16s ease,box-shadow .16s ease}.sg-launcher:hover{transform:translateY(-1px)}.sg-launcher.sg-right{right:20px}.sg-launcher.sg-left{left:20px}.sg-launcher[data-hidden="true"]{opacity:0;pointer-events:none;transform:scale(.9)}.sg-badge{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--sg-danger);color:#fff;font-size:11px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;line-height:1}.sg-launcher .sg-badge{margin-left:2px;box-shadow:0 0 0 2px var(--sg-accent)}.sg-scrim{position:fixed;inset:0;z-index:var(--sg-z);background:var(--sg-scrim);opacity:0;transition:opacity .18s ease;backdrop-filter:blur(1.5px)}.sg-open .sg-scrim{opacity:1}.sg-panel{position:fixed;z-index:calc(var(--sg-z) + 1);display:flex;flex-direction:column;overflow:hidden;background:var(--sg-bg);color:var(--sg-text);border:1px solid var(--sg-border);box-shadow:var(--sg-shadow);transition:transform .24s cubic-bezier(.22,1,.36,1),opacity .2s ease}.sg-panel[hidden]{display:none}.sg-panel:focus{outline:none}.sg-drawer{top:0;bottom:0;width:min(var(--sg-width),100vw);border-top:0;border-bottom:0}.sg-drawer.sg-right{right:0;border-right:0;transform:translateX(100%)}.sg-drawer.sg-left{left:0;border-left:0;transform:translateX(-100%)}.sg-open .sg-drawer{transform:none}.sg-modal{left:50%;top:50%;width:min(560px,calc(100vw - 32px));height:min(720px,calc(100vh - 48px));border-radius:calc(var(--sg-radius) + 4px);transform:translate(-50%,-48%) scale(.98);opacity:0}.sg-open .sg-modal{transform:translate(-50%,-50%);opacity:1}.sg-popover{bottom:80px;width:min(calc(var(--sg-width) - 40px),calc(100vw - 32px));height:min(680px,calc(100vh - 110px));border-radius:calc(var(--sg-radius) + 4px);transform:translateY(12px) scale(.98);opacity:0;transform-origin:bottom right}.sg-popover.sg-right{right:20px}.sg-popover.sg-left{left:20px;transform-origin:bottom left}.sg-open .sg-popover{transform:none;opacity:1}.sg-sheet{left:0;right:0;bottom:0;height:min(88vh,760px);border-radius:calc(var(--sg-radius) + 6px) calc(var(--sg-radius) + 6px) 0 0;border-bottom:0;transform:translateY(100%)}.sg-open .sg-sheet{transform:none}.sg-grabber{width:36px;height:4px;border-radius:4px;background:var(--sg-border);margin:8px auto 0;flex:none}.sg-accentline{position:absolute;inset:0 0 auto 0;height:1px;pointer-events:none;background:linear-gradient(90deg,var(--sg-accent),color-mix(in srgb,var(--sg-accent) 30%,transparent),transparent)}.sg-header{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--sg-border);flex:none;position:relative}.sg-brand{width:28px;height:28px;border-radius:var(--sg-radius-sm);object-fit:contain;flex:none}.sg-head-text{min-width:0;flex:1}.sg-title{margin:0;font-size:calc(var(--sg-size) + 1.5px);font-weight:650;letter-spacing:-0.01em;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sg-sub{margin:1px 0 0;font-size:calc(var(--sg-size) - 2.5px);color:var(--sg-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sg-iconbtn{width:30px;height:30px;border:0;background:transparent;border-radius:var(--sg-radius-sm);color:var(--sg-muted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex:none}.sg-iconbtn:hover{background:var(--sg-raised);color:var(--sg-text)}.sg-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}.sg-pad{padding:14px 16px}.sg-stack>* + *{margin-top:14px}.sg-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-top:1px solid var(--sg-border);flex:none}.sg-section{padding:14px 16px}.sg-section + .sg-section{border-top:1px solid var(--sg-border)}.sg-section-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}.sg-section-title{margin:0;font-size:calc(var(--sg-size) - 2px);font-weight:650;letter-spacing:.06em;text-transform:uppercase;color:var(--sg-dim)}.sg-muted{color:var(--sg-muted)}.sg-dim{color:var(--sg-dim)}.sg-small{font-size:calc(var(--sg-size) - 1.5px)}.sg-mono{font-family:var(--sg-mono);font-size:calc(var(--sg-size) - 2px);letter-spacing:.02em}.sg-p{margin:0}.sg-action{width:100%;display:flex;align-items:center;gap:12px;padding:11px 12px;border:1px solid var(--sg-border);border-radius:var(--sg-radius);background:var(--sg-surface);cursor:pointer;text-align:left;transition:background .12s ease,border-color .12s ease}.sg-action + .sg-action{margin-top:8px}.sg-action:hover{background:var(--sg-raised);border-color:color-mix(in srgb,var(--sg-accent) 35%,var(--sg-border))}.sg-action-text{flex:1;min-width:0}.sg-action-label{display:block;font-weight:600}.sg-action-hint{display:block;font-size:calc(var(--sg-size) - 1.5px);color:var(--sg-dim)}.sg-chev{color:var(--sg-dim);flex:none}.sg-tile{width:34px;height:34px;border-radius:var(--sg-radius-sm);display:inline-flex;align-items:center;justify-content:center;flex:none}.sg-tile.sg-sm{width:28px;height:28px}.sg-tile-img{width:20px;height:20px;object-fit:contain}a.sg-action{color:inherit;text-decoration:none}.sg-slot{padding:12px 16px 0}.sg-slot-header{padding:0;display:flex;align-items:center;flex:none}.sg-slot-footer{padding:10px 14px;border-top:1px solid var(--sg-border);flex:none}.sg-slot-sent{padding:18px 0 0;width:100%}.sg-slot-home-bottom{padding:12px 16px 16px}.sg-t-accent{--sg-tone:var(--sg-accent)}.sg-t-info{--sg-tone:var(--sg-info)}.sg-t-warn{--sg-tone:var(--sg-warning)}.sg-t-danger{--sg-tone:var(--sg-danger)}.sg-t-success{--sg-tone:var(--sg-success)}.sg-t-neutral{--sg-tone:var(--sg-muted)}.sg-tile[class*="sg-t-"]{color:var(--sg-tone);background:color-mix(in srgb,var(--sg-tone) 15%,transparent)}.sg-pill{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:999px;white-space:nowrap;font-size:calc(var(--sg-size) - 2.5px);font-weight:600;color:var(--sg-tone);background:color-mix(in srgb,var(--sg-tone) 14%,transparent);border:1px solid color-mix(in srgb,var(--sg-tone) 30%,transparent)}.sg-banner{display:flex;gap:10px;align-items:flex-start;padding:11px 12px;border-radius:var(--sg-radius);background:color-mix(in srgb,var(--sg-tone) 11%,transparent);border:1px solid color-mix(in srgb,var(--sg-tone) 32%,transparent)}.sg-banner-title{margin:0;font-weight:600}.sg-banner-body{margin:2px 0 0;color:var(--sg-muted);font-size:calc(var(--sg-size) - 1px)}button.sg-banner{width:100%;text-align:left;cursor:pointer}.sg-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:34px;padding:0 14px;border-radius:var(--sg-radius-sm);border:1px solid transparent;background:var(--sg-accent);color:var(--sg-accent-text);font-weight:600;cursor:pointer;white-space:nowrap;transition:filter .12s ease,opacity .12s ease}.sg-btn:hover{filter:brightness(1.08)}.sg-btn:disabled{opacity:.45;cursor:default;filter:none}.sg-btn-ghost{background:transparent;color:var(--sg-muted);border-color:var(--sg-border)}.sg-btn-ghost:hover{background:var(--sg-raised);color:var(--sg-text);filter:none}.sg-btn-danger{background:transparent;color:var(--sg-danger);border-color:color-mix(in srgb,var(--sg-danger) 40%,transparent)}.sg-link{border:0;background:none;padding:0;color:var(--sg-accent);cursor:pointer;font-weight:600;font-size:calc(var(--sg-size) - 1px)}.sg-link:hover{text-decoration:underline}.sg-quiet-link{align-self:flex-start;border:0;background:none;padding:0;color:var(--sg-dim);cursor:pointer;font:inherit;font-size:calc(var(--sg-size) - 1.5px);text-decoration:underline;text-underline-offset:3px;text-decoration-color:color-mix(in srgb,currentColor 40%,transparent)}.sg-quiet-link:hover{color:var(--sg-text)}.sg-closed{border-top:1px solid var(--sg-border)}.sg-closed>summary,.sg-closed-link{display:flex;align-items:center;gap:6px;width:100%;padding:12px 16px;list-style:none;cursor:pointer;border:0;background:none;color:var(--sg-muted);font:inherit;font-weight:600;font-size:calc(var(--sg-size) - 1.5px);text-align:left}.sg-closed>summary::-webkit-details-marker{display:none}.sg-closed>summary:hover,.sg-closed-link:hover{color:var(--sg-text)}.sg-closed>summary svg{transition:transform .15s ease}.sg-closed[open]>summary svg{transform:rotate(90deg)}.sg-closed-link{justify-content:space-between;border-top:1px solid var(--sg-border)}.sg-back{border:0;background:none;padding:0;color:var(--sg-muted);cursor:pointer;display:inline-flex;align-items:center;gap:4px}.sg-back:hover{color:var(--sg-text)}.sg-field{display:block}.sg-label{display:block;font-weight:600;margin-bottom:4px}.sg-hint{display:block;color:var(--sg-dim);font-size:calc(var(--sg-size) - 1.5px);margin-top:4px}.sg-err{display:block;color:var(--sg-danger);font-size:calc(var(--sg-size) - 1.5px);margin-top:4px}.sg-input,.sg-textarea{width:100%;border:1px solid var(--sg-border);background:var(--sg-surface);border-radius:var(--sg-radius-sm);padding:8px 10px;outline:none;transition:border-color .12s ease,box-shadow .12s ease}.sg-textarea{min-height:84px;resize:vertical;line-height:1.45}.sg-input:focus,.sg-textarea:focus{border-color:var(--sg-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--sg-accent) 22%,transparent)}.sg-input::placeholder,.sg-textarea::placeholder{color:var(--sg-dim)}.sg-invalid{border-color:var(--sg-danger) !important}.sg-chips{display:flex;flex-wrap:wrap;gap:6px}.sg-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;border:1px solid var(--sg-border);background:var(--sg-surface);cursor:pointer;font-size:calc(var(--sg-size) - 1px)}.sg-chip:hover{background:var(--sg-raised)}.sg-chip[aria-pressed="true"],.sg-chip[aria-checked="true"]{border-color:var(--sg-accent);background:color-mix(in srgb,var(--sg-accent) 16%,transparent);color:var(--sg-text)}.sg-dot{width:7px;height:7px;border-radius:999px;background:var(--sg-tone,var(--sg-accent));flex:none;display:inline-block}.sg-steps{display:flex;padding:12px 16px 10px;border-bottom:1px solid var(--sg-border);flex:none}.sg-step{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center}.sg-step-line{display:flex;align-items:center;width:100%}.sg-step-seg{flex:1;height:1px;background:var(--sg-border)}.sg-step-seg.sg-on{background:color-mix(in srgb,var(--sg-accent) 70%,transparent)}.sg-step-seg.sg-none{background:transparent}.sg-step-node{width:20px;height:20px;border-radius:999px;border:1px solid var(--sg-border);display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:var(--sg-dim);flex:none}.sg-step-node.sg-now{background:var(--sg-accent);border-color:var(--sg-accent);color:var(--sg-accent-text);box-shadow:0 0 14px -2px color-mix(in srgb,var(--sg-accent) 85%,transparent)}.sg-step-node.sg-done{background:color-mix(in srgb,var(--sg-accent) 20%,transparent);border-color:color-mix(in srgb,var(--sg-accent) 60%,transparent);color:var(--sg-accent)}.sg-step-label{margin-top:5px;font-size:calc(var(--sg-size) - 3px);color:var(--sg-dim);letter-spacing:.02em}.sg-step-label.sg-now{color:var(--sg-text);font-weight:600}.sg-card{border:1px solid var(--sg-border);border-radius:var(--sg-radius);background:var(--sg-surface);overflow:hidden}.sg-card + .sg-card{margin-top:8px}.sg-card-head{display:flex;align-items:flex-start;gap:10px;padding:10px 12px}.sg-card-text{flex:1;min-width:0}.sg-card-title{margin:0;font-weight:600}.sg-card-sum{margin:1px 0 0;color:var(--sg-dim);font-size:calc(var(--sg-size) - 1.5px)}.sg-card-body{padding:0 12px 12px}.sg-card.sg-off .sg-card-body,.sg-card.sg-off .sg-card-title{opacity:.55}.sg-switch{position:relative;width:34px;height:20px;border-radius:999px;border:0;background:var(--sg-raised);cursor:pointer;flex:none;box-shadow:inset 0 0 0 1px var(--sg-border);transition:background .15s ease}.sg-switch::after{content:'';position:absolute;top:3px;left:3px;width:14px;height:14px;border-radius:999px;background:var(--sg-muted);transition:transform .15s ease,background .15s ease}.sg-switch[aria-checked="true"]{background:var(--sg-accent);box-shadow:none}.sg-switch[aria-checked="true"]::after{transform:translateX(14px);background:var(--sg-accent-text)}.sg-shot{display:block;width:100%;max-height:220px;object-fit:contain;border-radius:var(--sg-radius-sm);border:1px solid var(--sg-border);background:var(--sg-bg)}.sg-json{margin:0;max-height:180px;overflow:auto;padding:8px 10px;border-radius:var(--sg-radius-sm);background:var(--sg-bg);border:1px solid var(--sg-border);font-family:var(--sg-mono);font-size:calc(var(--sg-size) - 2.5px);line-height:1.5;color:var(--sg-muted);white-space:pre-wrap;word-break:break-word}.sg-steplist{margin:0;padding:0;list-style:none}.sg-steplist li{display:flex;gap:8px;font-size:calc(var(--sg-size) - 1px);padding:2px 0}.sg-steplist .sg-when{width:54px;flex:none;text-align:right;color:var(--sg-dim);font-size:calc(var(--sg-size) - 2.5px);padding-top:1px}.sg-steplist .sg-err-step{color:var(--sg-danger)}.sg-review dt{font-size:calc(var(--sg-size) - 3px);text-transform:uppercase;letter-spacing:.07em;color:var(--sg-dim);font-weight:650}.sg-review dd{margin:2px 0 12px;white-space:pre-wrap;word-break:break-word}.sg-attached{margin:0;padding:0;list-style:none}.sg-attached li{display:flex;gap:8px;align-items:center;padding:2px 0}.sg-list{margin:0;padding:0;list-style:none}.sg-row{width:100%;display:flex;gap:10px;align-items:flex-start;padding:11px 16px;border:0;background:transparent;cursor:pointer;text-align:left}.sg-row:hover{background:var(--sg-surface)}.sg-list li + li .sg-row{border-top:1px solid var(--sg-border)}.sg-row-main{flex:1;min-width:0}.sg-row-top{display:flex;align-items:flex-start;gap:8px}.sg-row-title{flex:1;min-width:0;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sg-row-meta{margin-top:2px;color:var(--sg-dim);font-size:calc(var(--sg-size) - 2.5px);display:flex;gap:6px;flex-wrap:wrap;align-items:center}.sg-row-cta{margin-top:6px;display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border-radius:var(--sg-radius-sm);font-size:calc(var(--sg-size) - 2px);font-weight:600;color:var(--sg-tone);background:color-mix(in srgb,var(--sg-tone) 13%,transparent)}.sg-empty{text-align:center;padding:34px 20px}.sg-empty-icon{width:44px;height:44px;border-radius:999px;border:1px solid var(--sg-border);display:inline-flex;align-items:center;justify-content:center;color:var(--sg-dim)}.sg-rail{display:flex;align-items:flex-start}.sg-rail-stage{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;text-align:center}.sg-rail-line{display:flex;align-items:center;width:100%}.sg-rail-seg{flex:1;height:2px;border-radius:2px;background:var(--sg-border)}.sg-rail-seg.sg-on{background:var(--sg-tone,var(--sg-accent))}.sg-rail-seg.sg-none{background:transparent}.sg-rail-node{width:12px;height:12px;border-radius:999px;border:2px solid var(--sg-border);background:var(--sg-bg);flex:none}.sg-rail-node.sg-on{border-color:var(--sg-tone,var(--sg-accent));background:var(--sg-tone,var(--sg-accent))}.sg-rail-node.sg-here{box-shadow:0 0 0 4px color-mix(in srgb,var(--sg-tone,var(--sg-accent)) 25%,transparent)}.sg-rail-node.sg-yours{border-color:var(--sg-tone,var(--sg-accent));border-style:dashed}.sg-rail-node.sg-pulse{animation:sg-pulse 1.6s ease-in-out infinite}.sg-rail-label{margin-top:6px;font-size:calc(var(--sg-size) - 3px);color:var(--sg-dim);line-height:1.2}.sg-rail-label.sg-on{color:var(--sg-text)}.sg-rail-box{padding:12px 10px 10px;border-radius:var(--sg-radius);border:1px solid var(--sg-border);background:linear-gradient(180deg,var(--sg-surface),transparent)}@keyframes sg-pulse{0%,100%{box-shadow:0 0 0 3px color-mix(in srgb,var(--sg-tone,var(--sg-accent)) 15%,transparent)}50%{box-shadow:0 0 0 7px color-mix(in srgb,var(--sg-tone,var(--sg-accent)) 28%,transparent)}}.sg-thread{display:flex;flex-direction:column;gap:10px}.sg-event{display:flex;align-items:center;gap:8px;color:var(--sg-dim);font-size:calc(var(--sg-size) - 2px)}.sg-event::before,.sg-event::after{content:'';flex:1;height:1px;background:var(--sg-border)}.sg-msg{max-width:88%;padding:9px 11px;border-radius:var(--sg-radius);white-space:pre-wrap;word-break:break-word}.sg-msg-meta{display:block;font-size:calc(var(--sg-size) - 3px);color:var(--sg-dim);margin-bottom:2px}.sg-msg.sg-team{align-self:flex-start;background:var(--sg-surface);border:1px solid var(--sg-border);border-top-left-radius:4px}.sg-msg.sg-you{align-self:flex-end;background:color-mix(in srgb,var(--sg-accent) 18%,var(--sg-bg));border:1px solid color-mix(in srgb,var(--sg-accent) 35%,transparent);border-top-right-radius:4px}.sg-composer{display:flex;gap:8px;align-items:flex-end;padding:10px 14px;border-top:1px solid var(--sg-border);flex:none}.sg-composer .sg-textarea{min-height:38px;max-height:140px}.sg-confirm{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px}.sg-ring{width:50px;height:50px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--sg-success);background:color-mix(in srgb,var(--sg-success) 12%,transparent);border:1px solid color-mix(in srgb,var(--sg-success) 40%,transparent)}.sg-ref{margin-top:8px;padding:3px 10px;border-radius:999px;border:1px solid var(--sg-border);background:var(--sg-surface);font-family:var(--sg-mono);font-size:calc(var(--sg-size) - 2px)}.sg-faq{border:1px solid var(--sg-border);border-radius:var(--sg-radius);background:var(--sg-surface)}.sg-faq + .sg-faq{margin-top:8px}.sg-faq summary{list-style:none;cursor:pointer;padding:10px 12px;font-weight:600;display:flex;gap:8px;align-items:center}.sg-faq summary::-webkit-details-marker{display:none}.sg-faq summary .sg-chev{margin-left:auto;transition:transform .15s ease}.sg-faq[open] summary .sg-chev{transform:rotate(90deg)}.sg-faq-a{padding:0 12px 12px;color:var(--sg-muted);white-space:pre-wrap}.sg-skeleton{height:46px;border-radius:var(--sg-radius-sm);background:var(--sg-surface);margin:8px 16px;animation:sg-shimmer 1.2s ease-in-out infinite}@keyframes sg-shimmer{50%{opacity:.55}}.sg-spin{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-right-color:transparent;animation:sg-rot .7s linear infinite}@keyframes sg-rot{to{transform:rotate(360deg)}}.sg-refresh.sg-busy svg{animation:sg-rot .7s linear infinite}.sg-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}@media (max-width:560px){.sg-panel.sg-drawer,.sg-panel.sg-modal,.sg-panel.sg-popover{left:0;right:0;top:auto;bottom:0;width:100%;height:min(90vh,760px);border-radius:calc(var(--sg-radius) + 6px) calc(var(--sg-radius) + 6px) 0 0;border:1px solid var(--sg-border);border-bottom:0;transform:translateY(100%);opacity:1}.sg-open .sg-panel{transform:none}.sg-launcher{bottom:calc(16px + env(safe-area-inset-bottom))}}.sg-pickbar{visibility:visible;position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:calc(var(--sg-z) + 2);display:flex;align-items:center;gap:10px;max-width:calc(100vw - 24px);padding:6px 6px 6px 14px;border-radius:999px;background:var(--sg-bg);color:var(--sg-text);border:1px solid var(--sg-border);box-shadow:var(--sg-shadow)}.sg-pickdot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--sg-accent);box-shadow:0 0 0 0 color-mix(in srgb,var(--sg-accent) 60%,transparent);animation:sg-pickpulse 1.6s ease-out infinite}@keyframes sg-pickpulse{70%{box-shadow:0 0 0 7px transparent}100%{box-shadow:0 0 0 0 transparent}}.sg-pickhint{min-width:0;font-size:calc(var(--sg-size) - 0.5px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sg-pickbar .sg-btn{border-radius:999px}.sg-pickbar .sg-btn-ghost{padding:0 12px}@media (max-width:480px){.sg-pickbar{left:12px;right:12px;transform:none;border-radius:22px}.sg-pickhint{flex:1;white-space:normal;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.sg-pick-cancel-label{display:none}.sg-pickbar .sg-btn-ghost{padding:0;width:34px}}@media (max-width:480px) and (pointer:coarse){.sg-pickbar .sg-btn-ghost{width:44px}}@media (pointer:coarse){.sg-iconbtn{width:44px;height:44px}.sg-btn{height:44px;padding:0 16px}.sg-chip{min-height:44px;padding:8px 14px}.sg-link,.sg-back,.sg-quiet-link{min-height:44px;display:inline-flex;align-items:center}.sg-closed>summary,.sg-closed-link{min-height:44px}.sg-switch::before{content:'';position:absolute;inset:-12px -5px}.sg-root .sg-input,.sg-root .sg-textarea{font-size:max(16px,var(--sg-size))}.sg-input{min-height:44px}.sg-composer .sg-textarea{min-height:44px}.sg-faq summary{min-height:44px}.sg-row,.sg-action{min-height:44px}}@media (prefers-reduced-motion:reduce){.sg-panel,.sg-scrim,.sg-launcher{transition:none}.sg-rail-node.sg-pulse,.sg-skeleton,.sg-spin,.sg-refresh.sg-busy svg,.sg-pickdot{animation:none}}`})),Vn=r({App:()=>Wn,renderPanel:()=>qn,unmountPanel:()=>Jn});function Hn(e,t){let[,n]=U(0);return W(()=>e(()=>n(e=>e+1)),[e]),t()}function Un(){let e=typeof matchMedia>`u`?null:matchMedia(`(prefers-color-scheme: dark)`),[t,n]=U(e?.matches??!0);return W(()=>{if(!e)return;let t=()=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),t}function Wn(e){let t=Hn(e.ui.subscribe,e.ui.get),n=Hn(e.support.subscribe,e.support.getState),r=Un(),i=Ht(()=>Re(t.theme,r),[t.theme,r]),a=G(null),o=G(null),s=t.history[t.history.length-1]??{name:`home`},c=Ht(()=>{let t=e.captureFrame;return t?In(e.ui,e=>w(t,e),()=>!0):In(e.ui,T,()=>typeof navigator<`u`&&!!navigator.mediaDevices?.getDisplayMedia)},[e.ui]),l=G(null),u=G(null),d=n=>e.ui.set({history:n.name===`home`?[n]:[...t.history.filter(e=>e.name!==n.name||n.name===`detail`),n]}),f=()=>e.ui.set({history:t.history.length>1?t.history.slice(0,-1):[{name:`home`}]}),p=()=>e.ui.set({open:!1});W(()=>{t.open&&e.support.refresh()},[t.open,t.session]),W(()=>{if(!t.open)return;let n=setInterval(()=>{document.visibilityState===`visible`&&e.support.refresh()},15e3);return()=>clearInterval(n)},[t.open,e.support]);let[m,h]=U(!1),[g,_]=U(0);async function v(){m||(h(!0),e.ui.set({tick:t.tick+1}),await Promise.all([e.support.refresh(),new Promise(e=>setTimeout(e,600))]),h(!1),_(Date.now()))}W(()=>{if(n.signedIn!==!1)return;let r=t.history.filter(e=>e.name!==`reports`&&e.name!==`detail`);r.length!==t.history.length&&e.ui.set({history:r.length?r:[{name:`home`}]})},[n.signedIn,t.history,e.ui]),W(()=>{if(!t.open)return;o.current=document.activeElement;let n=setTimeout(()=>{(a.current?.querySelector(`[autofocus]`)??a.current)?.focus({preventScroll:!0})},60),r=t=>{if(e.ui.get().picking){t.key===`Escape`&&(t.stopPropagation(),t.preventDefault(),c.cancel());return}if(t.key===`Escape`){t.stopPropagation(),t.preventDefault(),p();return}if(t.key!==`Tab`||!a.current||e.layout===`popover`)return;let n=[...a.current.querySelectorAll(`button:not([disabled]), input, textarea, summary, [tabindex="0"]`)].filter(e=>e.offsetParent!==null);if(!n.length)return;let r=e.root.activeElement,i=n[0],o=n[n.length-1];t.shiftKey&&r===i?(t.preventDefault(),o.focus()):!t.shiftKey&&r===o&&(t.preventDefault(),i.focus())};return window.addEventListener(`keydown`,r,!0),()=>{clearTimeout(n),window.removeEventListener(`keydown`,r,!0),o.current?.focus?.({preventScroll:!0})}},[t.open]),W(()=>{!t.open&&c.active&&c.cancel()},[t.open,c]);let y=G(!1);W(()=>{t.picking&&!y.current&&l.current?.focus({preventScroll:!0}),!t.picking&&y.current&&a.current?.focus({preventScroll:!0}),y.current=t.picking},[t.picking]),W(()=>{if(!t.picking||t.hidden||!u.current)return;let e=document.documentElement,n=e.style.getPropertyValue(`padding-top`),r=e.style.getPropertyPriority(`padding-top`),i=parseFloat(getComputedStyle(e).paddingTop)||0,a=Math.ceil(u.current.getBoundingClientRect().bottom)+8;return e.style.setProperty(`padding-top`,`${i+a}px`,`important`),()=>{n?e.style.setProperty(`padding-top`,n,r):e.style.removeProperty(`padding-top`)}},[t.picking,t.hidden]);let b={support:e.support,state:n,tick:t.tick,copy:e.copy,features:{...e.features,reports:e.features.reports},faq:e.faq,actions:e.actions,slots:new Set(t.slots),appVersion:e.support.appVersion,go:d,capture:()=>c.start(),emit:e.emit},x=s.name===`report`?e.copy.reportAction:s.name===`feedback`?e.copy.feedbackAction:s.name===`faq`?`FAQs`:s.name===`reports`?e.copy.yourReports:s.name===`detail`?n.reports.find(e=>e.id===s.id)?.ref??`Report`:e.copy.title,S=[e.support.context().area,e.support.appVersion?`v${e.support.appVersion}`:null].filter(Boolean).join(` · `)||e.brand?.name||``,C=s.name===`faq`||s.name===`reports`||s.name===`detail`,E=n.signedIn===!0&&(s.name===`reports`||s.name===`detail`||s.name===`home`&&n.reports.length>0),ee=n.updatedAt?`${e.copy.refresh} · ${Ne(e.copy.updatedAgo,{ago:F(new Date(n.updatedAt).toISOString())})}`:e.copy.refresh,D=e.layout!==`popover`,O=e.launcher&&e.launcher.position===`bottom-left`?`sg-left`:`sg-right`,k=e.layout===`popover`&&e.launcher?O:e.side===`left`?`sg-left`:`sg-right`;return J(`div`,{class:`sg-root${t.open?` sg-open`:``}`,style:`${Ve(i)};--sg-z:${e.zIndex};${t.hidden||t.picking?`visibility:hidden;`:``}`,"data-theme":i.scheme,children:[e.launcher&&!(t.open&&D)&&J(`button`,{type:`button`,class:`sg-launcher ${O}`,onClick:()=>t.open?p():e.ui.set({open:!0,history:[{name:`home`}],session:t.session+1}),"aria-label":n.attention?`${e.launcher.label??e.copy.launcher}, ${n.attention} need you`:e.launcher.label??e.copy.launcher,"aria-expanded":t.open,"data-testid":`sg-launcher`,children:[J(X,{name:t.open?`x`:`lifebuoy`,size:18,stroke:2}),e.launcher.label??e.copy.launcher,n.attention>0&&!t.open&&J(`span`,{class:`sg-badge`,children:n.attention>9?`9+`:n.attention})]}),D&&t.open&&J(`div`,{class:`sg-scrim`,onClick:p,"aria-hidden":`true`}),J(`div`,{ref:a,class:`sg-panel sg-${e.layout} ${k}`,role:`dialog`,"aria-modal":D?`true`:void 0,"aria-label":e.copy.title,hidden:!t.open,tabIndex:-1,"data-testid":`sg-panel`,children:[e.layout===`sheet`&&J(`span`,{class:`sg-grabber`,"aria-hidden":`true`}),J(`span`,{class:`sg-accentline`,"aria-hidden":`true`}),J(`div`,{class:`sg-header`,children:[C?J(`button`,{type:`button`,class:`sg-iconbtn`,onClick:f,"aria-label":`Back`,"data-testid":`sg-back`,children:J(X,{name:`arrowLeft`})}):e.brand?.logo?J(`img`,{class:`sg-brand`,src:e.brand.logo,alt:``}):J(Z,{icon:`lifebuoy`,tone:`accent`,small:!0}),J(`div`,{class:`sg-head-text`,children:[J(`h2`,{class:`sg-title`,children:x}),S&&J(`p`,{class:`sg-sub`,children:S})]}),J($,{name:`header`,filled:b.slots}),E&&J(`button`,{type:`button`,class:`sg-iconbtn sg-refresh${m?` sg-busy`:``}`,onClick:()=>void v(),"aria-label":ee,title:ee,"aria-busy":m?`true`:void 0,"data-testid":`sg-refresh`,children:J(X,{name:`refresh`})}),J(`span`,{class:`sg-sr`,"aria-live":`polite`,children:g&&!m?e.copy.upToDate:``}),J(`button`,{type:`button`,class:`sg-iconbtn`,onClick:p,"aria-label":`Close`,"data-testid":`sg-close`,children:J(X,{name:`x`})})]}),t.open&&J(Gn,{w:b,screen:s},t.session),J($,{name:`footer`,filled:b.slots})]}),t.picking&&!t.hidden&&J(`div`,{ref:u,class:`sg-pickbar`,role:`toolbar`,"aria-label":e.copy.screenshot,"data-testid":`sg-pickbar`,children:[J(`span`,{class:`sg-pickdot`,"aria-hidden":`true`}),J(`span`,{class:`sg-pickhint`,children:e.copy.pickHint}),J(Q,{onClick:()=>void c.capture(),icon:`camera`,testId:`sg-pick-capture`,btnRef:l,children:e.copy.pickCapture}),J(Q,{variant:`ghost`,onClick:()=>c.cancel(),testId:`sg-pick-cancel`,icon:`x`,label:e.copy.cancel,children:J(`span`,{class:`sg-pick-cancel-label`,children:e.copy.cancel})})]})]})}function Gn({w:e,screen:t}){switch(t.name){case`report`:return J(An,{w:e});case`feedback`:return J(bn,{w:e});case`faq`:return J(vn,{w:e});case`reports`:return J(`div`,{class:`sg-body`,children:J(Sn,{w:e})});case`detail`:return J(wn,{w:e,id:t.id});case`sent`:return J(Kn,{heading:e.copy.reportSent,reference:t.ref,body:e.state.signedIn?e.copy.reportSentBody:e.copy.reportSentAnon,primary:e.state.signedIn?{label:e.copy.track,onClick:()=>e.go({name:`detail`,id:t.id})}:void 0,onDone:()=>e.go({name:`home`}),doneLabel:e.copy.done,slots:e.slots});case`thanks`:return J(Kn,{heading:e.copy.thanks,body:e.copy.thanksBody,onDone:()=>e.go({name:`home`}),doneLabel:e.copy.done});default:return J(En,{w:e})}}function Kn({heading:e,body:t,reference:n,primary:r,onDone:i,doneLabel:a,slots:o}){return J(`div`,{class:`sg-body`,children:J(`div`,{class:`sg-confirm`,"data-testid":`sg-confirm`,children:[J(`span`,{class:`sg-ring`,children:J(X,{name:`checkCircle`,size:24,stroke:1.6})}),J(`p`,{class:`sg-p`,style:{marginTop:`12px`,fontWeight:650,fontSize:`calc(var(--sg-size) + 2px)`},children:e}),n&&J(`span`,{class:`sg-ref`,"data-testid":`sg-ref`,children:n}),J(`p`,{class:`sg-p sg-muted`,style:{marginTop:`10px`,maxWidth:`36ch`},children:t}),J(`div`,{style:{marginTop:`18px`,display:`flex`,gap:`8px`},children:[r&&J(Q,{onClick:r.onClick,children:r.label}),J(Q,{variant:`ghost`,onClick:i,children:a})]}),o&&J($,{name:`sent`,filled:o})]})})}function qn(e,t,n){try{let e=new CSSStyleSheet;e.replaceSync(zn),t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}catch{let e=document.createElement(`style`);e.textContent=zn,t.insertBefore(e,t.firstChild)}St(J(Wn,{...n}),e),Yn.set(e,Xe(t))}function Jn(e){Yn.get(e)?.(),St(null,e)}var Yn,Xn=n((()=>{zt(),cn(),j(),I(),Fe(),fn(),yn(),xn(),kn(),Fn(),Tn(),qe(),_n(),Qe(),Rn(),Bn(),Y(),Yn=new WeakMap}));Fe();function Zn(e){if(typeof document>`u`)throw Error(`mountSupport runs in a browser. On a server, use @signalsupport/sdk/server.`);let t=!e.support,n=e.support??ke(e),r={report:!0,feedback:!0,faq:!0,reports:!!e.session,screenshot:!0,...e.features},i={...Pe,...e.copy},a=e.launcher!==!1&&{position:e.launcher?.position??`bottom-right`,label:e.launcher?.label},o=document.createElement(`div`);o.setAttribute(`data-signal-support`,``),(e.container??document.body).appendChild(o);let s=o.attachShadow({mode:`open`}),c=document.createElement(`div`);s.appendChild(c);let l=Le({open:!1,history:[{name:`home`}],session:0,hidden:!1,picking:!1,theme:e.theme,slots:[],tick:0}),u=null,d=null,f=e=>{try{u||(u=new CSSStyleSheet,s.adoptedStyleSheets=[...s.adoptedStyleSheets,u]),u.replaceSync(e)}catch{d||(d=document.createElement(`style`),s.appendChild(d)),d.textContent=e}};e.css&&f(e.css);let p=new Map,m=e=>{if(!Ie.includes(e))throw Error(`Unknown slot "${e}". Slots: ${Ie.join(`, `)}.`);let t=p.get(e);return t||(t=document.createElement(`div`),t.setAttribute(`slot`,e),o.appendChild(t),p.set(e,t),l.set({slots:[...p.keys()]})),t};for(let[t,n]of Object.entries(e.slots??{}))n&&m(t).appendChild(n);let h=new Map,g=(e,t)=>{for(let n of h.get(e)??[])n(t)},_=!1,v=l.subscribe(()=>{let e=l.get().open;e!==_&&g(e?`open`:`close`),_=e}),y=n.getState().attention,b=n.subscribe(e=>{e.attention!==y&&g(`attention`,e.attention),y=e.attention}),x=!1,S=null,C=null,w=()=>(C??(C=Promise.resolve().then(()=>(Xn(),Vn)).then(t=>{x||(S=t,t.renderPanel(c,s,{ui:l,support:n,copy:i,features:r,faq:e.faq??[],actions:e.actions??[],layout:e.layout??`drawer`,side:e.side??`right`,launcher:a,brand:e.brand,zIndex:e.zIndex??2147483e3,captureFrame:e.captureFrame,emit:g,root:s}))})),C),T=null;if(e.eager)w();else{let e=globalThis.requestIdleCallback;T=e?e(()=>void w(),{timeout:3e3}):setTimeout(()=>void w(),1500)}let E=(e=`home`)=>{l.set({open:!0,history:e===`home`?[{name:`home`}]:[{name:`home`},{name:e}],session:l.get().session+1}),w()};return{open:E,close:()=>l.set({open:!1}),toggle:e=>l.get().open?l.set({open:!1}):E(e),isOpen:()=>l.get().open,setContext:e=>n.setContext(e),setTheme:e=>l.set({theme:e}),setCss:f,slot:m,on(e,t){let r=h.get(e)??new Set;return r.add(t),h.set(e,r),e===`attention`&&t(n.getState().attention),()=>r.delete(t)},ready:w,support:n,destroy(){x=!0;let e=globalThis.cancelIdleCallback;T!==null&&(e??clearTimeout)(T),v(),b(),S?.unmountPanel(c),o.remove(),t&&n.destroy(),h.clear()}}}return j(),I(),Fe(),qe(),e.DEFAULT_COPY=Pe,e.PRESETS=Ke,e.Signal=oe,e.captureScreen=T,e.createClient=se,e.createSupport=ke,e.mountSupport=Zn,e.statusView=P,e})({});
4
+ //# sourceMappingURL=signal.iife.js.map