@mushi-mushi/web 1.14.1 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +50 -9
- package/README.md +4 -1
- package/dist/index.cjs +266 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +267 -39
- package/dist/index.js.map +1 -1
- package/dist/mushi.loader.global.js +2133 -0
- package/dist/mushi.loader.global.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,2133 @@
|
|
|
1
|
+
(function(){'use strict';var an=4194304,Zt=1.5*1024*1024;function ln(t){try{return JSON.stringify(t)}catch{return null}}function cn(t,e=an){let r=ln(t);if(r===null)return {ok:false,bytes:0,maxBytes:e,serializeFailed:true,reason:"Report could not be serialized (circular reference in metadata?)"};let n=new TextEncoder().encode(r).length;return n<=e?{ok:true,bytes:n,maxBytes:e}:{ok:false,bytes:n,maxBytes:e,reason:`Report payload ${Ut(n)} exceeds limit ${Ut(e)}`}}function Ut(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}var un="X-Mushi-User-Token",et="https://dxptnwrhwsqckaftyymj.supabase.co/functions/v1/api",Re="X-Mushi-Internal",ve="__mushiInternal",dn=1e4,pn=2;function Qt(t){let{projectId:e,apiKey:r,apiEndpoint:n=et,timeout:s=dn,maxRetries:i=pn,getUserToken:a}=t,o=n.replace(/\/$/,"");async function l(c,g,h,f=i,d,b){let R=`${o}${g}`,T=new AbortController,x=setTimeout(()=>T.abort(),s),S=a?.()??null;try{let y=await fetch(R,{method:c,headers:{"Content-Type":"application/json","X-Mushi-Api-Key":r,"X-Mushi-Project":e,...S?{[un]:S}:{},...d?{[Re]:d}:{},...b},body:h?JSON.stringify(h):void 0,signal:T.signal,...d?{[ve]:d}:{}});if(clearTimeout(x),y.status===307||y.status===308){let I=y.headers.get("Location");if(I&&f>0){let q=I.replace(/\/v1\/.*$/,"").replace(/\/$/,"");if(q!==o)return o=q,l(c,g,h,f-1,d,b)}}if(!y.ok){let I=await y.json().catch(()=>({}));return y.status>=500&&f>0?(await qt(jt(i-f)),l(c,g,h,f-1,d,b)):{ok:!1,error:{code:I.error?.code||`HTTP_${y.status}`,message:I.error?.message||I.message||`HTTP ${y.status} error`}}}let k=await y.json();return {ok:!0,data:k&&typeof k=="object"&&"ok"in k&&"data"in k?k.data:k}}catch(y){return clearTimeout(x),f>0&&gn(y)?(await qt(jt(i-f)),l(c,g,h,f-1,d)):{ok:false,error:{code:"NETWORK_ERROR",message:y instanceof Error?y.message:"Unknown network error"}}}}async function m(c,g,h,f){let d=await hn(h),b=String(Date.now()),R=await mn(r,`${e}.${b}.${d}`),T=`${o}${g}`,x=await fetch(T,{method:c,headers:{"Content-Type":"application/json","X-Mushi-Api-Key":r,"X-Mushi-Project":e,[Re]:"reporter-poll","X-Reporter-Token-Hash":d,"X-Reporter-Ts":b,"X-Reporter-Hmac":R},body:f?JSON.stringify(f):void 0,[ve]:"reporter-poll"});if(!x.ok){let y=await x.json().catch(()=>({}));return {ok:false,error:{code:`HTTP_${x.status}`,message:y.error?.message??y.message??`HTTP ${x.status} error`}}}let S=await x.json();return {ok:true,data:S.data??S}}return {async submitReport(c){let g=cn(c);return g.ok?l("POST","/v1/reports",c,i,"report-submit"):{ok:false,error:{code:g.serializeFailed?"SERIALIZE_FAILED":"PAYLOAD_TOO_LARGE",message:g.reason??"Report payload exceeds size limit"}}},async getReportStatus(c){return l("GET",`/v1/reports/${c}/status`,void 0,i,"report-status")},async getSdkConfig(){return l("GET","/v1/sdk/config",void 0,i,"sdk-config")},async askAssistant(c){return l("POST","/v1/sdk/assistant",{message:c.message,threadId:c.threadId??null,context:c.context??null},1,"community")},async getLatestSdkVersion(c){let g=new URLSearchParams({package:c}).toString();return l("GET",`/v1/sdk/latest-version?${g}`,void 0,i,"sdk-config")},async postDiscoveryEvent(c){return l("POST","/v1/sdk/discovery",c,1,"discovery")},async listReporterReports(c){return m("GET","/v1/reporter/reports",c)},async listReporterComments(c,g){return m("GET",`/v1/reporter/reports/${c}/comments`,g)},async replyToReporterReport(c,g,h,f){return m("POST",`/v1/reporter/reports/${c}/reply`,g,{body:h,...f?{feedback_signal:f}:{}})},async reopenReporterReport(c,g,h){return m("POST",`/v1/reporter/reports/${c}/reopen`,g,{note:h??""})},async listNotifications(c,g){let h=new URLSearchParams;g?.since&&h.set("since",g.since),g?.limit&&h.set("limit",String(g.limit));let f=h.size?`?${h.toString()}`:"";return m("GET",`/v1/notifications${f}`,c)},async markNotificationRead(c,g){return m("POST",`/v1/notifications/${c}/read`,g,{})},async listReporterFeatureBoard(c){return m("GET","/v1/reporter/feature-board",c)},async voteReporterFeatureBoard(c,g){return m("POST",`/v1/reporter/feature-board/${c}/vote`,g,{})},async submitActivity(c,g,h){return l("POST","/v1/sdk/activity",{user_id:c,user_traits:h?.userTraits,opted_in:h?.optedIn,reporter_token_hash:h?.reporterTokenHash,...h?.hostJwt?{host_jwt:h.hostJwt}:{},events:g},1,"discovery")},async getMyPoints(c){return l("GET",`/v1/sdk/me/points?userId=${encodeURIComponent(c)}`,void 0,1,"reporter-poll")},async getMyTier(c){return l("GET",`/v1/sdk/me/tier?userId=${encodeURIComponent(c)}`,void 0,1,"reporter-poll")},async getMyHistory(c,g){let h=new URLSearchParams({userId:c,...g?.limit?{limit:String(g.limit)}:{}});return l("GET",`/v1/sdk/me/history?${h}`,void 0,1,"reporter-poll")},async getHallOfFame(c=10){return l("GET",`/v1/sdk/hall-of-fame?limit=${c}`,void 0,1,"reporter-poll")},async sendMagicLink(c){return l("POST","/v1/tester/magic-link",{email:c},1,"community")},async linkReporterToken(c,g){return l("POST","/v1/tester/link-reporter",{reporter_token_hash:c},1,"community",{Authorization:`Bearer ${g}`})},async getCrossAppReports(c,g){let h=new URLSearchParams;g?.limit&&h.set("limit",String(g.limit)),g?.offset&&h.set("offset",String(g.offset));let f=h.size?`?${h.toString()}`:"";return l("GET",`/v1/tester/cross-app-reports${f}`,void 0,1,"community",{Authorization:`Bearer ${c}`})},async getMyReputation(c){return l("GET","/v1/tester/reputation",void 0,1,"community",{Authorization:`Bearer ${c}`})},async getPublicLeaderboard(c=20){return l("GET",`/v1/public/tester-leaderboard?limit=${c}`,void 0,1,"reporter-poll")},async getTesterStatus(c){return l("GET","/v1/me/tester-status",void 0,1,"community",{Authorization:`Bearer ${c}`})}}}async function hn(t){let e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return Array.from(new Uint8Array(e)).map(r=>r.toString(16).padStart(2,"0")).join("")}async function mn(t,e){let r=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},false,["sign"]),n=await crypto.subtle.sign("HMAC",r,new TextEncoder().encode(e));return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")}function qt(t){return new Promise(e=>setTimeout(e,t))}function jt(t){return Math.min(1e3*2**t+Math.random()*500,1e4)}function gn(t){return t instanceof DOMException&&t.name==="AbortError"||t instanceof TypeError}function Ze(...t){return t.find(e=>e!==void 0&&e!=="")}function re(t){try{let e=undefined;return typeof e=="object"&&e!==null?e[t]:void 0}catch{return}}function pe(t){try{return t()}catch{return}}function er(){let t=Ze(re("VITE_MUSHI_PROJECT_ID"),re("NEXT_PUBLIC_MUSHI_PROJECT_ID"),re("NUXT_PUBLIC_MUSHI_PROJECT_ID"),re("EXPO_PUBLIC_MUSHI_PROJECT_ID"),pe(()=>process.env.NEXT_PUBLIC_MUSHI_PROJECT_ID),pe(()=>process.env.EXPO_PUBLIC_MUSHI_PROJECT_ID),pe(()=>process.env.MUSHI_PROJECT_ID)),e=Ze(re("VITE_MUSHI_API_KEY"),re("NEXT_PUBLIC_MUSHI_API_KEY"),re("NUXT_PUBLIC_MUSHI_API_KEY"),re("EXPO_PUBLIC_MUSHI_API_KEY"),pe(()=>process.env.NEXT_PUBLIC_MUSHI_API_KEY),pe(()=>process.env.EXPO_PUBLIC_MUSHI_API_KEY),pe(()=>process.env.MUSHI_API_KEY)),r=Ze(re("VITE_MUSHI_API_ENDPOINT"),re("NEXT_PUBLIC_MUSHI_API_ENDPOINT"),re("NUXT_PUBLIC_MUSHI_API_ENDPOINT"),re("EXPO_PUBLIC_MUSHI_API_ENDPOINT"),pe(()=>process.env.NEXT_PUBLIC_MUSHI_API_ENDPOINT),pe(()=>process.env.EXPO_PUBLIC_MUSHI_API_ENDPOINT),pe(()=>process.env.MUSHI_API_ENDPOINT)),n={};return t&&(n.projectId=t),e&&(n.apiKey=e),r&&(n.apiEndpoint=r),n}var fn=10,bn=2e3,yn=[/^(.)\1{10,}$/,/^[A-Z\s!?]{20,}$/,/^[\d\s]+$/,/^[^a-zA-Z\u00C0-\u024F\u4E00-\u9FFF\u3040-\u309F\u30A0-\u30FF]{10,}$/,/^(asdf|qwerty|lorem ipsum)[.,!?\s]*$/i],vn=/^[bcdfghjklmnpqrstvwxz]{6,}/i;function tr(t={}){let{enabled:e=true,blockObviousSpam:r=true,minDescriptionLength:n=fn,maxDescriptionLength:s=bn}=t;function i(o){if(!e)return {passed:true};let l=o.trim();if(l.length<n)return {passed:false,reason:`Too short (min ${n} characters)`};if(l.length>s)return {passed:false,reason:`Too long (max ${s} characters)`};if(r){for(let c of yn)if(c.test(l))return {passed:false,reason:"Detected as spam"};if(vn.test(l))return {passed:false,reason:"Detected as gibberish"};if(l.split(/\s+/).filter(c=>c.length>1).length<2)return {passed:false,reason:"Description needs at least 2 words"}}return {passed:true}}function a(o){let l=o.trim();return l.length<=s?l:l.slice(0,s)+"..."}return {check:i,truncate:a}}var zt={debug:10,info:20,warn:30,error:40,fatal:50,silent:99},wn={debug:"DBG",info:"INF",warn:"WRN",error:"ERR",fatal:"FTL"},J={reset:"\x1B[0m",dim:"\x1B[2m",bold:"\x1B[1m",cyan:"\x1B[36m",green:"\x1B[32m",yellow:"\x1B[33m",red:"\x1B[31m",white:"\x1B[37m",bgRed:"\x1B[41m"},xn={debug:J.dim,info:J.green,warn:J.yellow,error:J.red,fatal:`${J.bgRed}${J.white}${J.bold}`};function Sn(){try{if(typeof globalThis.Deno<"u")return "json"}catch{}let t=typeof globalThis.process<"u"?globalThis.process:void 0;if(t?.env){if(t.env.NODE_ENV==="production"||t.env.LOG_FORMAT==="json")return "json";if(t.env.LOG_FORMAT==="pretty"||t.stdout?.isTTY)return "pretty"}return typeof globalThis.window<"u"?"pretty":"json"}function En(t){let e=[];for(let[r,n]of Object.entries(t))n!=null&&(typeof n=="object"?e.push(`${r}=${JSON.stringify(n)}`):e.push(`${r}=${String(n)}`));return e.join(" ")}function kn(t){let{ts:e,level:r,scope:n,msg:s,...i}=t,a=e.slice(11,23),o=xn[r]??"",l=wn[r]??r.toUpperCase(),m=Object.keys(i).length>0?` ${J.dim}${En(i)}${J.reset}`:"";return `${J.dim}${a}${J.reset} ${o}${l}${J.reset} ${J.cyan}[${n}]${J.reset} ${s}${m}`}function Rn(t){return JSON.stringify(t)}function Cn(t){return t==="stderr"?(e,r)=>{console.error(r);}:(e,r)=>{switch(e){case "error":case "fatal":console.error(r);break;case "warn":console.warn(r);break;default:console.log(r);}}}function rr(t,e,r,n,s){let i=e;function a(o,l,m){if(zt[o]<zt[i])return;let c={ts:new Date().toISOString(),level:o,scope:t,msg:l,...r,...m};s(o,n(c));}return {debug:(o,l)=>a("debug",o,l),info:(o,l)=>a("info",o,l),warn:(o,l)=>a("warn",o,l),error:(o,l)=>a("error",o,l),fatal:(o,l)=>a("fatal",o,l),child(o,l){return rr(`${t}:${o}`,i,{...r,...l},n,s)},setLevel(o){i=o;}}}function De(t){let{scope:e,level:r="info",meta:n={},format:s="auto",destination:i="stdout"}=t,o=(s==="auto"?Sn():s)==="json"?Rn:kn,l=Cn(i);return rr(e,r,n,o,l)}var tt={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},fatal:()=>{},child:()=>tt,setLevel:()=>{}},Tn="mushi-mushi-keyring",we="keys",nr="offline-queue/v1",Ie=null,Ae=null;function Mn(){return typeof globalThis<"u"&&typeof globalThis.crypto<"u"&&typeof globalThis.crypto.subtle<"u"&&typeof indexedDB<"u"}function sr(){return new Promise((t,e)=>{let r=indexedDB.open(Tn,1);r.onupgradeneeded=()=>{let n=r.result;n.objectStoreNames.contains(we)||n.createObjectStore(we);},r.onsuccess=()=>t(r.result),r.onerror=()=>e(r.error);})}async function $n(){let t=await sr();return new Promise((e,r)=>{let s=t.transaction(we,"readonly").objectStore(we).get(nr);s.onsuccess=()=>e(s.result??null),s.onerror=()=>r(s.error);})}async function Ln(t){let e=await sr();return new Promise((r,n)=>{let s=e.transaction(we,"readwrite");s.objectStore(we).put(t,nr),s.oncomplete=()=>r(),s.onerror=()=>n(s.error);})}async function or(){if(Ie)return Ie;if(Ae)return Ae;if(!Mn())throw new Error("Web Crypto + IndexedDB required for offline queue encryption");return Ae=(async()=>{let t=await $n();if(t)return Ie=t,t;let e=await crypto.subtle.generateKey({name:"AES-GCM",length:256},false,["encrypt","decrypt"]);return await Ln(e),Ie=e,e})(),Ae}function Wt(t){let e="";for(let r of t)e+=String.fromCharCode(r);return btoa(e)}function Vt(t){let e=atob(t),r=new Uint8Array(new ArrayBuffer(e.length));for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}async function In(t){let e=await or(),r=crypto.getRandomValues(new Uint8Array(12)),n=new TextEncoder().encode(JSON.stringify(t)),s=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:r},e,n));return {_mme:1,iv:Wt(r),ct:Wt(s)}}function An(t){return !!t&&typeof t=="object"&&t._mme===1&&typeof t.iv=="string"&&typeof t.ct=="string"}async function _n(t){let e=await or(),r=Vt(t.iv),n=Vt(t.ct),s=await crypto.subtle.decrypt({name:"AES-GCM",iv:r},e,n);return JSON.parse(new TextDecoder().decode(s))}var _e=De({scope:"mushi:queue",level:"warn"}),Pn="mushi-mushi",ne="offline-reports",Dn=1,Qe="mushi_offline_queue",On=10,Hn=6e4,Bn=3e4;function ir(t={}){let{enabled:e=true,maxQueueSize:r=50,syncOnReconnect:n=true,encryptAtRest:s=true}=t,i=null,a=null,o=null;async function l(C){let M=new Date().toISOString();if(!s)return {...C,queuedAt:M};try{let A=await In(C);return {id:C.id,queuedAt:M,payload:A}}catch(A){return _e.warn("Offline queue: encryption failed, storing plaintext",{err:String(A)}),{...C,queuedAt:M}}}async function m(C){if(c(C))try{return await _n(C.payload)}catch(M){return _e.warn("Offline queue: decrypt failed, dropping row",{err:String(M),id:C.id}),null}return C}function c(C){return !!C.payload&&An(C.payload)}function g(){return o||(typeof indexedDB<"u"?o="indexeddb":typeof localStorage<"u"?o="localstorage":o="none",o)}function h(){return new Promise((C,M)=>{let A=indexedDB.open(Pn,Dn);A.onupgradeneeded=()=>{let O=A.result;O.objectStoreNames.contains(ne)||O.createObjectStore(ne,{keyPath:"id"});},A.onsuccess=()=>C(A.result),A.onerror=()=>{o="localstorage",M(A.error);};})}async function f(C){let M=await h(),A=await l(C);return new Promise((O,j)=>{let z=M.transaction(ne,"readwrite");z.objectStore(ne).put(A),z.oncomplete=()=>O(),z.onerror=()=>j(z.error);})}async function d(){let C=await h();return new Promise((M,A)=>{let j=C.transaction(ne,"readonly").objectStore(ne).getAll();j.onsuccess=()=>M(j.result),j.onerror=()=>A(j.error);})}async function b(C){let M=await h();return new Promise((A,O)=>{let j=M.transaction(ne,"readwrite");j.objectStore(ne).delete(C),j.oncomplete=()=>A(),j.onerror=()=>O(j.error);})}async function R(){let C=await h();return new Promise((M,A)=>{let j=C.transaction(ne,"readonly").objectStore(ne).count();j.onsuccess=()=>M(j.result),j.onerror=()=>A(j.error);})}async function T(){let C=await h();return new Promise((M,A)=>{let O=C.transaction(ne,"readwrite");O.objectStore(ne).clear(),O.oncomplete=()=>M(),O.onerror=()=>A(O.error);})}function x(){try{let C=localStorage.getItem(Qe);return C?JSON.parse(C):[]}catch{return []}}function S(C){try{localStorage.setItem(Qe,JSON.stringify(C));}catch{}}async function y(C){let M=x();M.push(await l(C)),S(M);}function k(C){let M=x().filter(A=>A.id!==C);S(M);}async function v(C){if(!e)return;if(await _()>=r){_e.warn("Offline queue full \u2014 dropping report",{maxQueueSize:r});return}let A=g();if(A==="indexeddb")try{await f(C);return}catch{o="localstorage";}if(A==="localstorage"||o==="localstorage"){await y(C);return}}function I(C){return Math.min(1e3*2**C+Math.random()*500,Hn)}function q(C){return new Promise(M=>setTimeout(M,C))}async function V(C){if(!e)return {sent:0,failed:0};let M,A=g();if(A==="indexeddb")try{M=await d();}catch{M=x();}else M=x();let O=M.slice(0,On),j=0,z=0;for(let de=0;de<O.length;de++){let ee=O[de],D=ee.id,ye=await m(ee);if(!ye){try{A==="indexeddb"?await b(D):k(D);}catch{k(D);}z++;continue}let N=await C.submitReport(ye);if(N.ok){try{A==="indexeddb"?await b(D):k(D);}catch{k(D);}j++;}else {let Ee=N.error?.code==="HTTP_400"||N.error?.code==="HTTP_413"||N.error?.code==="HTTP_422"||N.error?.code==="INGEST_ERROR"||N.error?.code==="VALIDATION_ERROR"||N.error?.code==="PAYLOAD_TOO_LARGE"||N.error?.code==="SERIALIZE_FAILED"||typeof N.error?.message=="string"&&/invalid payload|description must be at least|validation/i.test(N.error.message),Le=!Ee&&(N.error?.code==="NETWORK_ERROR"||N.error?.code==="HTTP_403"||N.error?.code==="HTTP_429"||N.error?.code==="HTTP_502"||N.error?.code==="HTTP_503"||N.error?.code==="HTTP_504"||typeof N.error?.code=="string"&&N.error.code.startsWith("HTTP_5"));if(Ee)try{A==="indexeddb"?await b(D):k(D);}catch{k(D);}else Le&&_e.debug("Offline queue: transient failure, will retry",{id:D,code:N.error?.code});z++,de<O.length-1&&await q(I(de));}}return {sent:j,failed:z}}async function _(){if(g()==="indexeddb")try{return await R()}catch{return x().length}return x().length}async function K(){if(g()==="indexeddb")try{await T();}catch{}try{localStorage.removeItem(Qe);}catch{}}function be(C){if(!e||!n||typeof window>"u")return;let M=()=>{navigator.onLine&&V(C).catch(()=>{});};window.addEventListener("online",M),a=setInterval(()=>{_().then(A=>{A>0&&M();});},Bn),i=()=>{window.removeEventListener("online",M),a&&(clearInterval(a),a=null);};}function G(){i?.(),i=null;}return {enqueue:v,flush:V,size:_,clear:K,startAutoSync:be,stopAutoSync:G}}function rt(){let t=typeof navigator<"u"?navigator:void 0,e=typeof window<"u"?window:void 0,r=typeof document<"u"?document:void 0,n=typeof screen<"u"?screen:void 0;Fn(t);let s=t&&"connection"in t?t.connection:void 0;return {userAgent:t?.userAgent??"unknown",platform:t?.platform??"unknown",language:t?.language??"en",viewport:{width:e?.innerWidth??0,height:e?.innerHeight??0},url:e?.location?.href??"",referrer:r?.referrer??"",timestamp:new Date().toISOString(),timezone:Intl?.DateTimeFormat?.()?.resolvedOptions?.()?.timeZone??"UTC",connection:s?{effectiveType:s.effectiveType,downlink:s.downlink,rtt:s.rtt}:void 0,deviceMemory:t?.deviceMemory,hardwareConcurrency:t?.hardwareConcurrency,route:e?.location?.pathname,nearestTestid:Nn(r),userAgentData:qn(t),screen:jn(n,e),prefersColorScheme:zn(e),prefersReducedMotion:se(e,"(prefers-reduced-motion: reduce)"),prefersReducedData:se(e,"(prefers-reduced-data: reduce)"),prefersContrast:Wn(e),forcedColors:se(e,"(forced-colors: active)"),online:typeof t?.onLine=="boolean"?t.onLine:void 0,displayMode:Vn(e),documentTitle:r?.title?.slice(0,200),buildId:Kn(r),pageLoadTiming:Gn(e)}}function Nn(t){if(!t)return;let e=t.activeElement??null,r=0;for(;e&&r<20;){let n=e.getAttribute?.("data-testid");if(n)return n;e=e.parentElement,r++;}}var ae=null,Kt=false;function Fn(t){if(Kt)return;let e=t?.userAgentData;e?.getHighEntropyValues&&(Kt=true,e.getHighEntropyValues(["architecture","bitness","model","platformVersion","uaFullVersion","fullVersionList"]).then(r=>{ae=r;}).catch(()=>{}));}function Un(t){if(!t?.length)return;let e=t.filter(n=>!/not.?a.?brand/i.test(n.brand));return e.length===0?void 0:e.find(n=>!/chromium|google chrome/i.test(n.brand))??e[0]}function qn(t){let e=t?.userAgentData;if(!e&&!ae)return;let r=ae?.fullVersionList,n=Un(r??e?.brands),s={};return n&&(s.browser=n.brand,s.browserVersion=n.version),e?.platform&&(s.os=e.platform),ae?.platformVersion&&(s.osVersion=ae.platformVersion),typeof e?.mobile=="boolean"&&(s.mobile=e.mobile),ae?.model&&(s.model=ae.model),ae?.architecture&&(s.architecture=ae.architecture),ae?.bitness&&(s.bitness=ae.bitness),Object.keys(s).length===0?void 0:s}function jn(t,e){if(!t&&!e)return;let r={};typeof t?.width=="number"&&(r.width=t.width),typeof t?.height=="number"&&(r.height=t.height),typeof e?.devicePixelRatio=="number"&&(r.devicePixelRatio=e.devicePixelRatio),typeof t?.colorDepth=="number"&&(r.colorDepth=t.colorDepth);let n=t?.orientation?.type;return n&&(r.orientation=n),Object.keys(r).length===0?void 0:r}function se(t,e){if(t?.matchMedia)try{return t.matchMedia(e).matches}catch{return}}function zn(t){if(t?.matchMedia)return se(t,"(prefers-color-scheme: dark)")?"dark":se(t,"(prefers-color-scheme: light)")?"light":"no-preference"}function Wn(t){if(t?.matchMedia)return se(t,"(prefers-contrast: more)")?"more":se(t,"(prefers-contrast: less)")?"less":se(t,"(prefers-contrast: custom)")?"custom":"no-preference"}function Vn(t){if(t?.matchMedia){if(se(t,"(display-mode: fullscreen)"))return "fullscreen";if(se(t,"(display-mode: standalone)"))return "standalone";if(se(t,"(display-mode: minimal-ui)"))return "minimal-ui";if(se(t,"(display-mode: browser)"))return "browser"}}function Kn(t){if(!t)return;let r=t.querySelector?.('meta[name="mushi:build"]')?.content?.trim();if(r)return r.slice(0,64)}function Gn(t){let e=t?.performance;if(!e?.getEntriesByType)return;let r;try{r=e.getEntriesByType("navigation")[0];}catch{return}if(!r)return;let n=r.startTime??0,s={};return r.domContentLoadedEventEnd>0&&(s.domContentLoadedMs=Math.round(r.domContentLoadedEventEnd-n)),r.loadEventEnd>0&&(s.loadCompleteMs=Math.round(r.loadEventEnd-n)),r.responseStart>0&&(s.timeToFirstByteMs=Math.round(r.responseStart-n)),typeof r.type=="string"&&(s.navigationType=r.type),Object.keys(s).length===0?void 0:s}var Gt="mushi_reporter_token";function Y(){if(typeof localStorage<"u"){let e=localStorage.getItem(Gt);if(e)return e}let t=Yn();if(typeof localStorage<"u")try{localStorage.setItem(Gt,t);}catch{}return t}function Yn(){if(typeof crypto<"u"&&crypto.randomUUID)return `mushi_${crypto.randomUUID()}`;let t=new Uint8Array(16);if(typeof crypto<"u")crypto.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);return `mushi_${Array.from(t).map(r=>r.toString(16).padStart(2,"0")).join("")}`}function nt(){let t=typeof crypto<"u"?crypto:void 0;if(t?.randomUUID)return t.randomUUID();let e=new Uint8Array(16);if(t?.getRandomValues)t.getRandomValues(e);else for(let n=0;n<e.length;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return `${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20,32)}`}var Yt="mushi_fingerprint_hash";function Xn(){let t=typeof navigator<"u"?navigator:void 0,e=typeof screen<"u"?screen:void 0,r=typeof window<"u"?window:void 0;return {userAgent:t?.userAgent??"unknown",platform:t?.platform??"unknown",language:t?.language??"en",timezone:Intl?.DateTimeFormat?.()?.resolvedOptions?.()?.timeZone??"UTC",screenWidth:e?.width??0,screenHeight:e?.height??0,pixelRatio:r?.devicePixelRatio??1,deviceMemory:t?.deviceMemory,hardwareConcurrency:t?.hardwareConcurrency}}async function Jn(t){if(typeof crypto<"u"&&crypto.subtle){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")}let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return `fbk_${(e>>>0).toString(16).padStart(8,"0")}`}async function ar(){if(typeof localStorage<"u"){let n=localStorage.getItem(Yt);if(n)return n}let t=Xn(),e=JSON.stringify(t),r=await Jn(e);if(typeof localStorage<"u")try{localStorage.setItem(Yt,r);}catch{}return r}var Xt="mushi_session_id",Pe=null;function Ce(){if(Pe)return Pe;if(typeof sessionStorage<"u"){let e=sessionStorage.getItem(Xt);if(e)return Pe=e,e}let t=Zn();if(Pe=t,typeof sessionStorage<"u")try{sessionStorage.setItem(Xt,t);}catch{}return t}function Zn(){let t=Date.now().toString(36),e=Math.random().toString(36).slice(2,8);return `ms_${t}_${e}`}var Qn=10,es=1,ts=5e3;function lr(t={}){let{maxBurst:e=Qn,refillRate:r=es,refillIntervalMs:n=ts}=t,s=e,i=Date.now();function a(){let c=Date.now(),g=c-i,h=Math.floor(g/n);h>0&&(s=Math.min(e,s+h*r),i=c);}function o(){return a(),s>0?(s--,true):false}function l(){s=e,i=Date.now();}function m(){return a(),s}return {tryConsume:o,reset:l,availableTokens:m}}var rs=[{key:"ssns",regex:/\b\d{3}-\d{2}-\d{4}\b/g,replacement:"[REDACTED_SSN]"},{key:"creditCards",regex:/\b(?:\d[ -]*){12,18}\d\b/g,replacement:"[REDACTED_CC]"},{key:"secretTokens",regex:/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,replacement:"[REDACTED_AWS_KEY]"},{key:"secretTokens",regex:/(?:aws_secret_access_key|secret_access_key)["'\s:=]+[A-Za-z0-9/+=]{40}\b/gi,replacement:"aws_secret_access_key=[REDACTED_AWS_SECRET]"},{key:"secretTokens",regex:/\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{24,}\b/g,replacement:"[REDACTED_STRIPE_KEY]"},{key:"secretTokens",regex:/\bpk_(?:live|test)_[A-Za-z0-9]{24,}\b/g,replacement:"[REDACTED_STRIPE_PK]"},{key:"secretTokens",regex:/\bxox[abpor]-[A-Za-z0-9-]{10,}\b/g,replacement:"[REDACTED_SLACK_TOKEN]"},{key:"secretTokens",regex:/\bghp_[A-Za-z0-9]{36}\b/g,replacement:"[REDACTED_GITHUB_PAT]"},{key:"secretTokens",regex:/\bgithub_pat_[A-Za-z0-9_]{80,}\b/g,replacement:"[REDACTED_GITHUB_PAT]"},{key:"secretTokens",regex:/\bsk-(?:proj-)?[A-Za-z0-9_-]{20,}\b/g,replacement:"[REDACTED_OPENAI_KEY]"},{key:"secretTokens",regex:/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g,replacement:"[REDACTED_ANTHROPIC_KEY]"},{key:"secretTokens",regex:/\bAIza[0-9A-Za-z_-]{35}\b/g,replacement:"[REDACTED_GOOGLE_KEY]"},{key:"secretTokens",regex:/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g,replacement:"[REDACTED_JWT]"},{key:"emails",regex:/\b[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}\b/g,replacement:"[REDACTED_EMAIL]"},{key:"phones",regex:/(?:\+\d{1,3}[\s.-])?\(?\d{2,4}\)?[\s.-]\d{3,4}[\s.-]\d{3,4}\b/g,replacement:"[REDACTED_PHONE]"},{key:"ipAddresses",regex:/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,replacement:"[REDACTED_IP]"},{key:"ipv6",regex:/\b(?:[A-Fa-f0-9]{1,4}:){2,7}[A-Fa-f0-9]{0,4}\b/g,replacement:"[REDACTED_IPV6]"}],ns={emails:true,phones:true,creditCards:true,ssns:true,ipAddresses:false,secretTokens:true,ipv6:false};function cr(t={}){let e={...ns,...t},r=rs.filter(i=>e[i.key]);function n(i){if(!i)return i;let a=i;for(let{regex:o,replacement:l}of r)a=a.replace(new RegExp(o.source,o.flags),l);return a}function s(i,a){let o={...i};for(let l of a)typeof o[l]=="string"&&(o[l]=n(o[l]));return o}return {scrub:n,scrubObject:s}}var ss=50,os=500;function ur(t={}){let e=Math.max(1,t.max??ss),r=Math.max(50,t.maxMessageLength??os),n=[];return {add(s){let i=typeof s.timestamp=="number"?s.timestamp:Date.now(),a=typeof s.message=="string"&&s.message.length>r?`${s.message.slice(0,r)}\u2026`:s.message,o={timestamp:i,category:s.category,level:s.level??"info",message:a??"",...s.data?{data:s.data}:{}};for(n.push(o);n.length>e;)n.shift();},getAll(){return n.slice()},clear(){n=[];},size(){return n.length}}}var Jt=8*1024,is=1e3;function dr(t){if(t instanceof Error){let e=t.name||"Error",r=t.message||String(t),n=typeof t.stack=="string"&&t.stack.length>0?t.stack.slice(0,Jt):void 0,s=t.cause;return {name:e,message:r,...n?{stack:n}:{},...s!==void 0?{cause:s instanceof Error?s.message:s}:{}}}if(typeof t=="string")return {name:"Error",message:t};if(t&&typeof t=="object"){let e=t,r=typeof e.name=="string"?e.name:"Error",n=typeof e.message=="string"?e.message:(()=>{try{return JSON.stringify(e).slice(0,is)}catch{return String(e)}})(),s=typeof e.stack=="string"?e.stack.slice(0,Jt):void 0;return {name:r,message:n,...s?{stack:s}:{}}}return t===void 0?{name:"Error",message:"unknown"}:{name:"Error",message:String(t)}}function as(t){let e=t.length%4===0?"":"=".repeat(4-t.length%4),r=t.replace(/-/g,"+").replace(/_/g,"/")+e;if(typeof atob=="function")return atob(r);let n=globalThis.Buffer;return n?n.from(r,"base64").toString("binary"):""}function pr(t){if(typeof t!="string")return null;let e=t.split(".");if(e.length!==3)return null;try{let r=as(e[1]),n=JSON.parse(r),s=typeof n.projectId=="string"?n.projectId:void 0,i=typeof n.sub=="string"?n.sub:void 0;return !s||!i?null:{projectId:s,sub:i,...typeof n.email=="string"?{email:n.email}:{},...typeof n.name=="string"?{name:n.name}:{},...typeof n.iat=="number"?{iat:n.iat}:{},...typeof n.exp=="number"?{exp:n.exp}:{}}}catch{return null}}async function mr(t,e=Zt){if(!t.startsWith("data:image/")||hr(t)<=e)return t;if(typeof document>"u")return null;let r=new Image;await new Promise((i,a)=>{r.onload=()=>i(),r.onerror=()=>a(new Error("screenshot_decode_failed")),r.src=t;});let n=[.65,.5,.35,.25],s=[1,.85,.7,.55,.4];for(let i of s){let a=document.createElement("canvas"),o=Math.max(1,Math.round(r.naturalWidth*i)),l=Math.max(1,Math.round(r.naturalHeight*i));a.width=o,a.height=l;let m=a.getContext("2d");if(m){m.drawImage(r,0,0,o,l);for(let c of n){let g=a.toDataURL("image/jpeg",c);if(hr(g)<=e)return g}}}return null}function hr(t){let e=t.indexOf(",");if(e<0)return t.length;let r=t.slice(e+1);return Math.ceil(r.length*3/4)}var Oe={widget:{trigger:"Report Issue",title:"Report an Issue",close:"Close",back:"Back",submit:"Submit",submitting:"Submitting\u2026",submitted:"Thank you! Your report has been submitted.",error:"Something went wrong. Please try again."},step1:{heading:"What kind of issue?",categories:{bug:"Bug",slow:"Slow / Laggy",visual:"Visual Glitch",confusing:"Confusing",other:"Other"},categoryDescriptions:{bug:"Something is broken or not working",slow:"Performance issue or slow loading",visual:"Layout, styling, or display problem",confusing:"Hard to understand or navigate",other:"Something else"}},step2:{heading:"What happened?",intents:{bug:["Crash","Unresponsive","Data loss","Wrong result","Other"],slow:["Page load","Interaction","API call","Animation","Other"],visual:["Layout broken","Overlapping","Missing element","Wrong color/font","Other"],confusing:["Unclear label","Missing help","Unexpected flow","Lost navigation","Other"],other:["Feature request","Accessibility","Typo","Other"]}},step3:{heading:"Tell us more",descriptionPlaceholder:"Describe what happened\u2026",screenshotButton:"Attach Screenshot",screenshotAttached:"Screenshot attached \u2713",screenshotCapturing:"Taking screenshot\u2026",screenshotFailed:"Couldn't capture \u2014 describe it instead",elementButton:"Select Element",elementSelected:"Element selected \u2713",elementCapturing:"Click anything on the page\u2026",elementSelectorHint:"Click any element \xB7 Esc to cancel",optional:"(optional)",tooShort:"A bit more detail helps us fix it faster",examplePrompts:["The save button does nothing","Page froze for 10 seconds","Layout looks broken here"]}};var gr={widget:{trigger:"\u554F\u984C\u3092\u5831\u544A",title:"\u554F\u984C\u3092\u5831\u544A\u3059\u308B",close:"\u9589\u3058\u308B",back:"\u623B\u308B",submit:"\u9001\u4FE1",submitting:"\u9001\u4FE1\u4E2D\u2026",submitted:"\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\uFF01\u30EC\u30DD\u30FC\u30C8\u304C\u9001\u4FE1\u3055\u308C\u307E\u3057\u305F\u3002",error:"\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"},step1:{heading:"\u3069\u306E\u3088\u3046\u306A\u554F\u984C\u3067\u3059\u304B\uFF1F",categories:{bug:"\u30D0\u30B0",slow:"\u9045\u3044\u30FB\u91CD\u3044",visual:"\u8868\u793A\u306E\u554F\u984C",confusing:"\u308F\u304B\u308A\u306B\u304F\u3044",other:"\u305D\u306E\u4ED6"},categoryDescriptions:{bug:"\u52D5\u4F5C\u3057\u306A\u3044\u3001\u58CA\u308C\u3066\u3044\u308B",slow:"\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u304C\u60AA\u3044\u3001\u8AAD\u307F\u8FBC\u307F\u304C\u9045\u3044",visual:"\u30EC\u30A4\u30A2\u30A6\u30C8\u3001\u30C7\u30B6\u30A4\u30F3\u3001\u8868\u793A\u306E\u554F\u984C",confusing:"\u7406\u89E3\u3057\u306B\u304F\u3044\u3001\u64CD\u4F5C\u304C\u308F\u304B\u308A\u306B\u304F\u3044",other:"\u305D\u306E\u4ED6\u306E\u554F\u984C"}},step2:{heading:"\u4F55\u304C\u8D77\u304D\u307E\u3057\u305F\u304B\uFF1F",intents:{bug:["\u30AF\u30E9\u30C3\u30B7\u30E5","\u7121\u53CD\u5FDC","\u30C7\u30FC\u30BF\u6D88\u5931","\u8AA4\u3063\u305F\u7D50\u679C","\u305D\u306E\u4ED6"],slow:["\u30DA\u30FC\u30B8\u8AAD\u8FBC","\u64CD\u4F5C\u53CD\u5FDC","API\u901A\u4FE1","\u30A2\u30CB\u30E1\u30FC\u30B7\u30E7\u30F3","\u305D\u306E\u4ED6"],visual:["\u30EC\u30A4\u30A2\u30A6\u30C8\u5D29\u308C","\u8981\u7D20\u306E\u91CD\u306A\u308A","\u8981\u7D20\u304C\u8868\u793A\u3055\u308C\u306A\u3044","\u8272/\u30D5\u30A9\u30F3\u30C8\u304C\u9055\u3046","\u305D\u306E\u4ED6"],confusing:["\u30E9\u30D9\u30EB\u304C\u4E0D\u660E\u77AD","\u30D8\u30EB\u30D7\u304C\u306A\u3044","\u4E88\u60F3\u5916\u306E\u30D5\u30ED\u30FC","\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u8FF7\u5B50","\u305D\u306E\u4ED6"],other:["\u6A5F\u80FD\u8981\u671B","\u30A2\u30AF\u30BB\u30B7\u30D3\u30EA\u30C6\u30A3","\u8AA4\u5B57\u8131\u5B57","\u305D\u306E\u4ED6"]}},step3:{heading:"\u8A73\u7D30\u3092\u6559\u3048\u3066\u304F\u3060\u3055\u3044",descriptionPlaceholder:"\u4F55\u304C\u8D77\u304D\u305F\u304B\u8AAC\u660E\u3057\u3066\u304F\u3060\u3055\u3044\u2026",screenshotButton:"\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u6DFB\u4ED8",screenshotAttached:"\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u6DFB\u4ED8\u6E08\u307F \u2713",screenshotCapturing:"\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u64AE\u5F71\u4E2D\u2026",screenshotFailed:"\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F \u2014 \u6587\u5B57\u3067\u6559\u3048\u3066\u304F\u3060\u3055\u3044",elementButton:"\u8981\u7D20\u3092\u9078\u629E",elementSelected:"\u8981\u7D20\u9078\u629E\u6E08\u307F \u2713",elementCapturing:"\u30DA\u30FC\u30B8\u4E0A\u306E\u8981\u7D20\u3092\u30AF\u30EA\u30C3\u30AF\u2026",elementSelectorHint:"\u8981\u7D20\u3092\u30AF\u30EA\u30C3\u30AF \xB7 Esc \u3067\u30AD\u30E3\u30F3\u30BB\u30EB",optional:"\uFF08\u4EFB\u610F\uFF09",tooShort:"\u3082\u3046\u5C11\u3057\u8A73\u3057\u304F\u6559\u3048\u3066\u304F\u3060\u3055\u3044",examplePrompts:["\u4FDD\u5B58\u30DC\u30BF\u30F3\u304C\u53CD\u5FDC\u3057\u306A\u3044","\u30DA\u30FC\u30B8\u304C10\u79D2\u56FA\u307E\u3063\u305F","\u30EC\u30A4\u30A2\u30A6\u30C8\u304C\u5D29\u308C\u3066\u3044\u308B"]}};var fr={widget:{trigger:"\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E1B\u0E31\u0E0D\u0E2B\u0E32",title:"\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E1B\u0E31\u0E0D\u0E2B\u0E32",close:"\u0E1B\u0E34\u0E14",back:"\u0E01\u0E25\u0E31\u0E1A",submit:"\u0E2A\u0E48\u0E07",submitting:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07\u2026",submitted:"\u0E02\u0E2D\u0E1A\u0E04\u0E38\u0E13\u0E04\u0E23\u0E31\u0E1A/\u0E04\u0E48\u0E30! \u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E16\u0E39\u0E01\u0E2A\u0E48\u0E07\u0E41\u0E25\u0E49\u0E27",error:"\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14 \u0E01\u0E23\u0E38\u0E13\u0E32\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07"},step1:{heading:"\u0E1B\u0E31\u0E0D\u0E2B\u0E32\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E44\u0E2B\u0E19?",categories:{bug:"\u0E1A\u0E31\u0E01",slow:"\u0E0A\u0E49\u0E32 / \u0E41\u0E25\u0E04",visual:"\u0E41\u0E2A\u0E14\u0E07\u0E1C\u0E25\u0E1C\u0E34\u0E14\u0E1B\u0E01\u0E15\u0E34",confusing:"\u0E2A\u0E31\u0E1A\u0E2A\u0E19",other:"\u0E2D\u0E37\u0E48\u0E19\u0E46"},categoryDescriptions:{bug:"\u0E21\u0E35\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E40\u0E2A\u0E35\u0E22\u0E2B\u0E23\u0E37\u0E2D\u0E17\u0E33\u0E07\u0E32\u0E19\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",slow:"\u0E1B\u0E31\u0E0D\u0E2B\u0E32\u0E1B\u0E23\u0E30\u0E2A\u0E34\u0E17\u0E18\u0E34\u0E20\u0E32\u0E1E\u0E2B\u0E23\u0E37\u0E2D\u0E42\u0E2B\u0E25\u0E14\u0E0A\u0E49\u0E32",visual:"\u0E1B\u0E31\u0E0D\u0E2B\u0E32\u0E40\u0E25\u0E22\u0E4C\u0E40\u0E2D\u0E32\u0E15\u0E4C \u0E2A\u0E44\u0E15\u0E25\u0E4C \u0E2B\u0E23\u0E37\u0E2D\u0E01\u0E32\u0E23\u0E41\u0E2A\u0E14\u0E07\u0E1C\u0E25",confusing:"\u0E40\u0E02\u0E49\u0E32\u0E43\u0E08\u0E22\u0E32\u0E01\u0E2B\u0E23\u0E37\u0E2D\u0E19\u0E33\u0E17\u0E32\u0E07\u0E22\u0E32\u0E01",other:"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E2D\u0E37\u0E48\u0E19"}},step2:{heading:"\u0E40\u0E01\u0E34\u0E14\u0E2D\u0E30\u0E44\u0E23\u0E02\u0E36\u0E49\u0E19?",intents:{bug:["\u0E41\u0E04\u0E23\u0E0A","\u0E44\u0E21\u0E48\u0E15\u0E2D\u0E1A\u0E2A\u0E19\u0E2D\u0E07","\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2B\u0E32\u0E22","\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E1C\u0E34\u0E14","\u0E2D\u0E37\u0E48\u0E19\u0E46"],slow:["\u0E42\u0E2B\u0E25\u0E14\u0E2B\u0E19\u0E49\u0E32","\u0E01\u0E32\u0E23\u0E42\u0E15\u0E49\u0E15\u0E2D\u0E1A","API","\u0E41\u0E2D\u0E19\u0E34\u0E40\u0E21\u0E0A\u0E31\u0E19","\u0E2D\u0E37\u0E48\u0E19\u0E46"],visual:["\u0E40\u0E25\u0E22\u0E4C\u0E40\u0E2D\u0E32\u0E15\u0E4C\u0E40\u0E2A\u0E35\u0E22","\u0E0B\u0E49\u0E2D\u0E19\u0E17\u0E31\u0E1A","\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E2B\u0E32\u0E22","\u0E2A\u0E35/\u0E1F\u0E2D\u0E19\u0E15\u0E4C\u0E1C\u0E34\u0E14","\u0E2D\u0E37\u0E48\u0E19\u0E46"],confusing:["\u0E1B\u0E49\u0E32\u0E22\u0E44\u0E21\u0E48\u0E0A\u0E31\u0E14","\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E33\u0E41\u0E19\u0E30\u0E19\u0E33","\u0E02\u0E31\u0E49\u0E19\u0E15\u0E2D\u0E19\u0E44\u0E21\u0E48\u0E04\u0E32\u0E14\u0E04\u0E34\u0E14","\u0E2B\u0E25\u0E07\u0E17\u0E32\u0E07","\u0E2D\u0E37\u0E48\u0E19\u0E46"],other:["\u0E02\u0E2D\u0E1F\u0E35\u0E40\u0E08\u0E2D\u0E23\u0E4C","\u0E01\u0E32\u0E23\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07","\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E1C\u0E34\u0E14","\u0E2D\u0E37\u0E48\u0E19\u0E46"]}},step3:{heading:"\u0E1A\u0E2D\u0E01\u0E40\u0E23\u0E32\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21",descriptionPlaceholder:"\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E2A\u0E34\u0E48\u0E07\u0E17\u0E35\u0E48\u0E40\u0E01\u0E34\u0E14\u0E02\u0E36\u0E49\u0E19\u2026",screenshotButton:"\u0E41\u0E19\u0E1A\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15",screenshotAttached:"\u0E41\u0E19\u0E1A\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u0E41\u0E25\u0E49\u0E27 \u2713",screenshotCapturing:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E16\u0E48\u0E32\u0E22\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u2026",screenshotFailed:"\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E16\u0E48\u0E32\u0E22\u0E20\u0E32\u0E1E\u0E44\u0E14\u0E49 \u2014 \u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E41\u0E17\u0E19",elementButton:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A",elementSelected:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E41\u0E25\u0E49\u0E27 \u2713",elementCapturing:"\u0E04\u0E25\u0E34\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E1A\u0E19\u0E2B\u0E19\u0E49\u0E32\u2026",elementSelectorHint:"\u0E04\u0E25\u0E34\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E43\u0E14\u0E01\u0E47\u0E44\u0E14\u0E49 \xB7 Esc \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01",optional:"(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)",tooShort:"\u0E01\u0E23\u0E38\u0E13\u0E32\u0E43\u0E2B\u0E49\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21",examplePrompts:["\u0E1B\u0E38\u0E48\u0E21\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E44\u0E21\u0E48\u0E17\u0E33\u0E07\u0E32\u0E19","\u0E2B\u0E19\u0E49\u0E32\u0E04\u0E49\u0E32\u0E07\u0E19\u0E32\u0E19 10 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35","\u0E40\u0E25\u0E22\u0E4C\u0E40\u0E2D\u0E32\u0E15\u0E4C\u0E1E\u0E31\u0E07"]}};var br={widget:{trigger:"Reportar problema",title:"Reportar un problema",close:"Cerrar",back:"Volver",submit:"Enviar",submitting:"Enviando\u2026",submitted:"\xA1Gracias! Tu reporte ha sido enviado.",error:"Algo sali\xF3 mal. Por favor, int\xE9ntalo de nuevo."},step1:{heading:"\xBFQu\xE9 tipo de problema?",categories:{bug:"Error",slow:"Lento",visual:"Problema visual",confusing:"Confuso",other:"Otro"},categoryDescriptions:{bug:"Algo est\xE1 roto o no funciona",slow:"Problema de rendimiento o carga lenta",visual:"Problema de dise\xF1o, estilo o visualizaci\xF3n",confusing:"Dif\xEDcil de entender o navegar",other:"Otro problema"}},step2:{heading:"\xBFQu\xE9 pas\xF3?",intents:{bug:["Crash","Sin respuesta","P\xE9rdida de datos","Resultado incorrecto","Otro"],slow:["Carga de p\xE1gina","Interacci\xF3n","Llamada API","Animaci\xF3n","Otro"],visual:["Layout roto","Superposici\xF3n","Elemento faltante","Color/fuente incorrecta","Otro"],confusing:["Etiqueta confusa","Sin ayuda","Flujo inesperado","Navegaci\xF3n perdida","Otro"],other:["Solicitud de funci\xF3n","Accesibilidad","Error tipogr\xE1fico","Otro"]}},step3:{heading:"Cu\xE9ntanos m\xE1s",descriptionPlaceholder:"Describe lo que pas\xF3\u2026",screenshotButton:"Adjuntar captura",screenshotAttached:"Captura adjunta \u2713",screenshotCapturing:"Tomando captura\u2026",screenshotFailed:"No se pudo capturar \u2014 descr\xEDbelo en su lugar",elementButton:"Seleccionar elemento",elementSelected:"Elemento seleccionado \u2713",elementCapturing:"Haz clic en cualquier elemento\u2026",elementSelectorHint:"Clic en cualquier elemento \xB7 Esc para cancelar",optional:"(opcional)",tooShort:"Un poco m\xE1s de detalle nos ayuda a resolverlo",examplePrompts:["El bot\xF3n guardar no responde","La p\xE1gina se congel\xF3 10 segundos","El dise\xF1o se ve roto aqu\xED"]}};var ls={en:Oe,ja:gr,th:fr,es:br};function st(t){let e=t&&t!=="auto"?t:typeof navigator<"u"?navigator.language??navigator.languages?.[0]:void 0;if(!e)return Oe;let r=e.split("-")[0].toLowerCase();return ls[r]??Oe}function yr(t,e="",r=""){let n=t==="dark",s=k=>/^#[0-9a-fA-F]{3,8}$/.test(k)?k:"",i=s(e),a=s(r),o=n?"#0F0E0C":"#F8F4ED",l=n?"#F2EBDD":"#0E0D0B",m=n?"#928B7E":"#5C5852",c=n?"#5A5650":"#9A9489",g=n?"#7A7268":"#6E6760",h=n?"rgba(242,235,221,0.10)":"rgba(14,13,11,0.10)",f=n?"rgba(242,235,221,0.18)":"rgba(14,13,11,0.16)",d=i||(n?"#FF5A47":"#E03C2C"),b=n?`${d}1F`:`${d}14`,R=a||(n?"#FFE5E0":"#7A1F15"),T="'Iowan Old Style', 'Palatino Linotype', 'Palatino', 'Book Antiqua', 'Cambria', Georgia, 'Times New Roman', serif",x="system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Display', 'Segoe UI', sans-serif",S="ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace",y="cubic-bezier(0.22, 1, 0.36, 1)";return `
|
|
2
|
+
:host {
|
|
3
|
+
all: initial;
|
|
4
|
+
font-family: ${x};
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
line-height: 1.55;
|
|
7
|
+
color: ${l};
|
|
8
|
+
-webkit-font-smoothing: antialiased;
|
|
9
|
+
-moz-osx-font-smoothing: grayscale;
|
|
10
|
+
font-feature-settings: 'ss01', 'cv11'; /* nicer system-ui glyphs where supported */
|
|
11
|
+
--mushi-ok: ${n?"#4ade80":"#16a34a"};
|
|
12
|
+
/* SDK contract: the host element is always pass-through. Only the
|
|
13
|
+
interactive surfaces (.mushi-trigger, .mushi-banner, .mushi-panel)
|
|
14
|
+
opt back into pointer events so the widget never creates an
|
|
15
|
+
invisible touch blocker over host-app UI. */
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
/* Only actual widget controls receive touch/mouse events. */
|
|
19
|
+
.mushi-trigger,
|
|
20
|
+
.mushi-banner,
|
|
21
|
+
.mushi-panel {
|
|
22
|
+
pointer-events: auto;
|
|
23
|
+
}
|
|
24
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
25
|
+
button { font-family: inherit; }
|
|
26
|
+
|
|
27
|
+
.mushi-trigger {
|
|
28
|
+
position: fixed;
|
|
29
|
+
width: 52px;
|
|
30
|
+
height: 52px;
|
|
31
|
+
border: 1px solid ${f};
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
background: ${o};
|
|
34
|
+
color: ${l};
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
font-family: ${T};
|
|
40
|
+
font-size: 22px;
|
|
41
|
+
line-height: 1;
|
|
42
|
+
box-shadow:
|
|
43
|
+
0 1px 0 ${h},
|
|
44
|
+
0 6px 14px -8px rgba(14,13,11,0.35),
|
|
45
|
+
inset 0 -3px 0 ${d};
|
|
46
|
+
transition: transform 200ms ${y}, box-shadow 200ms ${y};
|
|
47
|
+
overflow: visible;
|
|
48
|
+
isolation: isolate;
|
|
49
|
+
}
|
|
50
|
+
.mushi-trigger::after {
|
|
51
|
+
content: '';
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 6px;
|
|
54
|
+
right: 6px;
|
|
55
|
+
width: 6px;
|
|
56
|
+
height: 6px;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
background: ${d};
|
|
59
|
+
box-shadow: 0 0 0 0 ${d};
|
|
60
|
+
animation: mushi-pulse 2.4s ${y} infinite;
|
|
61
|
+
}
|
|
62
|
+
.mushi-trigger:hover {
|
|
63
|
+
transform: translateY(-2px) rotate(-1.5deg);
|
|
64
|
+
box-shadow:
|
|
65
|
+
0 1px 0 ${h},
|
|
66
|
+
0 14px 24px -10px rgba(14,13,11,0.45),
|
|
67
|
+
inset 0 -3px 0 ${d};
|
|
68
|
+
}
|
|
69
|
+
.mushi-trigger:active {
|
|
70
|
+
transform: translateY(0) rotate(0);
|
|
71
|
+
box-shadow:
|
|
72
|
+
0 1px 0 ${h},
|
|
73
|
+
0 2px 4px -2px rgba(14,13,11,0.35),
|
|
74
|
+
inset 0 -2px 0 ${d};
|
|
75
|
+
}
|
|
76
|
+
.mushi-trigger:focus-visible {
|
|
77
|
+
outline: 2px solid ${d};
|
|
78
|
+
outline-offset: 3px;
|
|
79
|
+
}
|
|
80
|
+
/* First-session welcome pulse. Three soft halos at 800ms each, then
|
|
81
|
+
auto-clear. Uses a box-shadow ring rather than transform/scale so it
|
|
82
|
+
can compose with the hover transform without fighting it. Respects
|
|
83
|
+
prefers-reduced-motion. */
|
|
84
|
+
@keyframes mushi-trigger-pulse {
|
|
85
|
+
0% { box-shadow: 0 0 0 0 rgba(212, 67, 50, 0.55), 0 1px 0 ${h}, 0 10px 24px -14px rgba(14,13,11,0.45); }
|
|
86
|
+
70% { box-shadow: 0 0 0 16px rgba(212, 67, 50, 0), 0 1px 0 ${h}, 0 10px 24px -14px rgba(14,13,11,0.45); }
|
|
87
|
+
100% { box-shadow: 0 0 0 0 rgba(212, 67, 50, 0), 0 1px 0 ${h}, 0 10px 24px -14px rgba(14,13,11,0.45); }
|
|
88
|
+
}
|
|
89
|
+
.mushi-trigger-pulse {
|
|
90
|
+
animation: mushi-trigger-pulse 800ms ${y} 3;
|
|
91
|
+
}
|
|
92
|
+
@media (prefers-reduced-motion: reduce) {
|
|
93
|
+
.mushi-trigger-pulse { animation: none; }
|
|
94
|
+
}
|
|
95
|
+
.mushi-trigger.bottom-right {
|
|
96
|
+
bottom: var(--mushi-bottom, calc(24px + env(safe-area-inset-bottom, 0px)));
|
|
97
|
+
right: var(--mushi-right, calc(24px + env(safe-area-inset-right, 0px)));
|
|
98
|
+
}
|
|
99
|
+
.mushi-trigger.bottom-left {
|
|
100
|
+
bottom: var(--mushi-bottom, calc(24px + env(safe-area-inset-bottom, 0px)));
|
|
101
|
+
left: var(--mushi-left, calc(24px + env(safe-area-inset-left, 0px)));
|
|
102
|
+
}
|
|
103
|
+
.mushi-trigger.top-right {
|
|
104
|
+
top: var(--mushi-top, calc(24px + env(safe-area-inset-top, 0px)));
|
|
105
|
+
right: var(--mushi-right, calc(24px + env(safe-area-inset-right, 0px)));
|
|
106
|
+
}
|
|
107
|
+
.mushi-trigger.top-left {
|
|
108
|
+
top: var(--mushi-top, calc(24px + env(safe-area-inset-top, 0px)));
|
|
109
|
+
left: var(--mushi-left, calc(24px + env(safe-area-inset-left, 0px)));
|
|
110
|
+
}
|
|
111
|
+
.mushi-trigger.edge-tab {
|
|
112
|
+
width: 32px;
|
|
113
|
+
height: 88px;
|
|
114
|
+
border-radius: 4px 0 0 4px;
|
|
115
|
+
writing-mode: vertical-rl;
|
|
116
|
+
text-orientation: upright;
|
|
117
|
+
font-size: 16px;
|
|
118
|
+
box-shadow:
|
|
119
|
+
0 1px 0 ${h},
|
|
120
|
+
0 10px 24px -14px rgba(14,13,11,0.45),
|
|
121
|
+
inset -3px 0 0 ${d};
|
|
122
|
+
}
|
|
123
|
+
.mushi-trigger.edge-tab.bottom-right,
|
|
124
|
+
.mushi-trigger.edge-tab.top-right {
|
|
125
|
+
right: var(--mushi-right, 0);
|
|
126
|
+
}
|
|
127
|
+
.mushi-trigger.edge-tab.bottom-left,
|
|
128
|
+
.mushi-trigger.edge-tab.top-left {
|
|
129
|
+
left: var(--mushi-left, 0);
|
|
130
|
+
border-radius: 0 4px 4px 0;
|
|
131
|
+
box-shadow:
|
|
132
|
+
0 1px 0 ${h},
|
|
133
|
+
0 10px 24px -14px rgba(14,13,11,0.45),
|
|
134
|
+
inset 3px 0 0 ${d};
|
|
135
|
+
}
|
|
136
|
+
.mushi-trigger.shrunk {
|
|
137
|
+
width: 36px;
|
|
138
|
+
height: 36px;
|
|
139
|
+
opacity: 0.82;
|
|
140
|
+
transform: scale(0.92);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* \u2500\u2500 Draggable FAB \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
144
|
+
When draggable is enabled the trigger uses CSS translate to apply the
|
|
145
|
+
drag offset ON TOP of the existing inset positioning, so snapping and
|
|
146
|
+
safe-area clamp still work correctly via the inset vars.
|
|
147
|
+
--mushi-drag-active 0|1 gates the transform so non-draggable FABs are
|
|
148
|
+
completely unaffected. touch-action: none prevents browser pan/scroll
|
|
149
|
+
from racing the pointer capture. */
|
|
150
|
+
.mushi-trigger {
|
|
151
|
+
touch-action: none;
|
|
152
|
+
translate:
|
|
153
|
+
calc(var(--mushi-drag-active, 0) * var(--mushi-drag-x, 0px))
|
|
154
|
+
calc(var(--mushi-drag-active, 0) * var(--mushi-drag-y, 0px));
|
|
155
|
+
}
|
|
156
|
+
.mushi-trigger.dragging {
|
|
157
|
+
cursor: grabbing !important;
|
|
158
|
+
z-index: calc(var(--z, 99999) + 2);
|
|
159
|
+
transition: none !important;
|
|
160
|
+
box-shadow:
|
|
161
|
+
0 1px 0 ${h},
|
|
162
|
+
0 20px 40px -12px rgba(14,13,11,0.55),
|
|
163
|
+
inset 0 -3px 0 ${d};
|
|
164
|
+
opacity: 0.92;
|
|
165
|
+
}
|
|
166
|
+
@media (prefers-reduced-motion: reduce) {
|
|
167
|
+
.mushi-trigger { transition: none !important; }
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@keyframes mushi-pulse {
|
|
171
|
+
0% { box-shadow: 0 0 0 0 ${d}; opacity: 1; }
|
|
172
|
+
70% { box-shadow: 0 0 0 8px ${d}00; opacity: 0.5; }
|
|
173
|
+
100% { box-shadow: 0 0 0 0 ${d}00; opacity: 1; }
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.mushi-panel {
|
|
177
|
+
position: fixed;
|
|
178
|
+
width: 384px;
|
|
179
|
+
max-width: calc(100vw - 32px);
|
|
180
|
+
max-height: min(640px, calc(100dvh - 120px - var(--mushi-keyboard-inset, 0px)));
|
|
181
|
+
background: ${o};
|
|
182
|
+
border: 1px solid ${f};
|
|
183
|
+
border-radius: 6px;
|
|
184
|
+
box-shadow:
|
|
185
|
+
0 1px 0 ${h},
|
|
186
|
+
0 24px 56px -20px rgba(14,13,11,0.30),
|
|
187
|
+
0 8px 16px -8px rgba(14,13,11,0.20);
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-direction: column;
|
|
191
|
+
transform-origin: var(--mushi-origin, bottom right);
|
|
192
|
+
transition: bottom 120ms ease, top 120ms ease, max-height 120ms ease;
|
|
193
|
+
}
|
|
194
|
+
/* Keyboard-safe: on narrow viewports lift above the keyboard */
|
|
195
|
+
.mushi-panel.keyboard-open {
|
|
196
|
+
bottom: calc(var(--mushi-keyboard-inset, 0px) + 8px) !important;
|
|
197
|
+
}
|
|
198
|
+
/* On narrow mobile, fill the width as a bottom sheet */
|
|
199
|
+
@media (max-width: 480px) {
|
|
200
|
+
.mushi-panel {
|
|
201
|
+
left: 0 !important;
|
|
202
|
+
right: 0 !important;
|
|
203
|
+
width: 100% !important;
|
|
204
|
+
max-width: 100% !important;
|
|
205
|
+
border-bottom-left-radius: 0;
|
|
206
|
+
border-bottom-right-radius: 0;
|
|
207
|
+
bottom: var(--mushi-keyboard-inset, 0px) !important;
|
|
208
|
+
}
|
|
209
|
+
.mushi-panel.keyboard-open {
|
|
210
|
+
bottom: calc(var(--mushi-keyboard-inset, 0px) + 4px) !important;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
.mushi-panel.open { animation: mushi-stamp-in 320ms ${y} both; }
|
|
214
|
+
.mushi-panel.closed { display: none; }
|
|
215
|
+
.mushi-panel.bottom-right {
|
|
216
|
+
bottom: var(--mushi-panel-bottom, calc(var(--mushi-bottom, 24px) + 64px));
|
|
217
|
+
right: var(--mushi-right, calc(24px + env(safe-area-inset-right, 0px)));
|
|
218
|
+
--mushi-origin: bottom right;
|
|
219
|
+
}
|
|
220
|
+
.mushi-panel.bottom-left {
|
|
221
|
+
bottom: var(--mushi-panel-bottom, calc(var(--mushi-bottom, 24px) + 64px));
|
|
222
|
+
left: var(--mushi-left, calc(24px + env(safe-area-inset-left, 0px)));
|
|
223
|
+
--mushi-origin: bottom left;
|
|
224
|
+
}
|
|
225
|
+
.mushi-panel.top-right {
|
|
226
|
+
top: var(--mushi-panel-top, calc(var(--mushi-top, 24px) + 64px));
|
|
227
|
+
right: var(--mushi-right, calc(24px + env(safe-area-inset-right, 0px)));
|
|
228
|
+
--mushi-origin: top right;
|
|
229
|
+
}
|
|
230
|
+
.mushi-panel.top-left {
|
|
231
|
+
top: var(--mushi-panel-top, calc(var(--mushi-top, 24px) + 64px));
|
|
232
|
+
left: var(--mushi-left, calc(24px + env(safe-area-inset-left, 0px)));
|
|
233
|
+
--mushi-origin: top left;
|
|
234
|
+
}
|
|
235
|
+
.mushi-outdated {
|
|
236
|
+
margin: 12px 14px 0;
|
|
237
|
+
padding: 10px 12px;
|
|
238
|
+
border: 1px solid ${b};
|
|
239
|
+
background: ${b};
|
|
240
|
+
color: ${R};
|
|
241
|
+
font-family: ${x};
|
|
242
|
+
font-size: 12px;
|
|
243
|
+
line-height: 1.4;
|
|
244
|
+
}
|
|
245
|
+
.mushi-outdated strong {
|
|
246
|
+
display: block;
|
|
247
|
+
font-family: ${S};
|
|
248
|
+
font-size: 10px;
|
|
249
|
+
letter-spacing: 0.12em;
|
|
250
|
+
text-transform: uppercase;
|
|
251
|
+
margin-bottom: 2px;
|
|
252
|
+
}
|
|
253
|
+
.mushi-outdated span {
|
|
254
|
+
display: block;
|
|
255
|
+
margin-top: 3px;
|
|
256
|
+
color: ${m};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@keyframes mushi-stamp-in {
|
|
260
|
+
0% { opacity: 0; transform: scale(0.94) translateY(6px); }
|
|
261
|
+
60% { opacity: 1; }
|
|
262
|
+
100% { opacity: 1; transform: scale(1) translateY(0); }
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.mushi-header {
|
|
266
|
+
padding: 18px 20px 14px;
|
|
267
|
+
border-bottom: 1px solid ${h};
|
|
268
|
+
display: grid;
|
|
269
|
+
grid-template-columns: auto 1fr auto;
|
|
270
|
+
align-items: end;
|
|
271
|
+
gap: 12px;
|
|
272
|
+
}
|
|
273
|
+
.mushi-header-mark {
|
|
274
|
+
display: inline-flex;
|
|
275
|
+
align-items: center;
|
|
276
|
+
justify-content: center;
|
|
277
|
+
width: 22px;
|
|
278
|
+
height: 22px;
|
|
279
|
+
border-radius: 3px;
|
|
280
|
+
background: ${d};
|
|
281
|
+
color: #FAF7F0;
|
|
282
|
+
font-family: ${T};
|
|
283
|
+
font-size: 14px;
|
|
284
|
+
font-weight: 600;
|
|
285
|
+
line-height: 1;
|
|
286
|
+
letter-spacing: -0.02em;
|
|
287
|
+
transform: rotate(-3deg);
|
|
288
|
+
flex-shrink: 0;
|
|
289
|
+
}
|
|
290
|
+
.mushi-header-titles {
|
|
291
|
+
min-width: 0;
|
|
292
|
+
display: flex;
|
|
293
|
+
flex-direction: column;
|
|
294
|
+
gap: 2px;
|
|
295
|
+
}
|
|
296
|
+
.mushi-header-eyebrow {
|
|
297
|
+
font-family: ${S};
|
|
298
|
+
font-size: 10px;
|
|
299
|
+
letter-spacing: 0.18em;
|
|
300
|
+
text-transform: uppercase;
|
|
301
|
+
color: ${m};
|
|
302
|
+
}
|
|
303
|
+
.mushi-header h3 {
|
|
304
|
+
font-family: ${T};
|
|
305
|
+
font-size: 19px;
|
|
306
|
+
font-weight: 500;
|
|
307
|
+
line-height: 1.15;
|
|
308
|
+
letter-spacing: -0.01em;
|
|
309
|
+
color: ${l};
|
|
310
|
+
}
|
|
311
|
+
.mushi-header-meta {
|
|
312
|
+
align-self: start;
|
|
313
|
+
display: flex;
|
|
314
|
+
align-items: center;
|
|
315
|
+
gap: 6px;
|
|
316
|
+
}
|
|
317
|
+
.mushi-step-counter {
|
|
318
|
+
font-family: ${S};
|
|
319
|
+
font-size: 11px;
|
|
320
|
+
color: ${m};
|
|
321
|
+
letter-spacing: 0.06em;
|
|
322
|
+
tab-size: 2ch;
|
|
323
|
+
padding-top: 2px;
|
|
324
|
+
}
|
|
325
|
+
.mushi-step-counter b {
|
|
326
|
+
font-weight: 600;
|
|
327
|
+
color: ${l};
|
|
328
|
+
}
|
|
329
|
+
.mushi-close {
|
|
330
|
+
background: none;
|
|
331
|
+
border: none;
|
|
332
|
+
cursor: pointer;
|
|
333
|
+
padding: 2px 4px;
|
|
334
|
+
color: ${m};
|
|
335
|
+
font-family: ${x};
|
|
336
|
+
font-size: 16px;
|
|
337
|
+
line-height: 1;
|
|
338
|
+
border-radius: 0;
|
|
339
|
+
transition: color 150ms ${y};
|
|
340
|
+
}
|
|
341
|
+
.mushi-back {
|
|
342
|
+
align-self: flex-start;
|
|
343
|
+
background: none;
|
|
344
|
+
border: none;
|
|
345
|
+
cursor: pointer;
|
|
346
|
+
padding: 0;
|
|
347
|
+
margin: 0 0 2px;
|
|
348
|
+
color: ${m};
|
|
349
|
+
font-family: ${S};
|
|
350
|
+
font-size: 10px;
|
|
351
|
+
font-weight: 500;
|
|
352
|
+
letter-spacing: 0.12em;
|
|
353
|
+
text-transform: uppercase;
|
|
354
|
+
line-height: 1.2;
|
|
355
|
+
border-radius: 0;
|
|
356
|
+
transition: color 150ms ${y};
|
|
357
|
+
}
|
|
358
|
+
.mushi-close:hover { color: ${d}; }
|
|
359
|
+
.mushi-back:hover { color: ${l}; }
|
|
360
|
+
.mushi-close:focus-visible {
|
|
361
|
+
outline: 1.5px solid ${d};
|
|
362
|
+
outline-offset: 2px;
|
|
363
|
+
}
|
|
364
|
+
.mushi-back:focus-visible {
|
|
365
|
+
outline: none;
|
|
366
|
+
color: ${d};
|
|
367
|
+
text-decoration: underline;
|
|
368
|
+
text-underline-offset: 3px;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* \u2500\u2500 Body \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
372
|
+
Generous left/right padding (22px) so type breathes. Vertical
|
|
373
|
+
padding tighter at top because the header rule already creates
|
|
374
|
+
breathing room. */
|
|
375
|
+
.mushi-body {
|
|
376
|
+
padding: 8px 22px 16px;
|
|
377
|
+
overflow-y: auto;
|
|
378
|
+
flex: 1;
|
|
379
|
+
scrollbar-width: thin;
|
|
380
|
+
scrollbar-color: ${c} transparent;
|
|
381
|
+
}
|
|
382
|
+
.mushi-body::-webkit-scrollbar { width: 6px; }
|
|
383
|
+
.mushi-body::-webkit-scrollbar-thumb { background: ${c}; border-radius: 3px; }
|
|
384
|
+
|
|
385
|
+
.mushi-option-btn {
|
|
386
|
+
display: grid;
|
|
387
|
+
grid-template-columns: auto 1fr auto;
|
|
388
|
+
align-items: center;
|
|
389
|
+
gap: 14px;
|
|
390
|
+
width: 100%;
|
|
391
|
+
padding: 14px 0;
|
|
392
|
+
border: none;
|
|
393
|
+
border-bottom: 1px solid ${h};
|
|
394
|
+
background: transparent;
|
|
395
|
+
cursor: pointer;
|
|
396
|
+
color: inherit;
|
|
397
|
+
text-align: left;
|
|
398
|
+
transition: padding 220ms ${y}, color 220ms ${y};
|
|
399
|
+
position: relative;
|
|
400
|
+
}
|
|
401
|
+
.mushi-option-btn:last-child { border-bottom: none; }
|
|
402
|
+
.mushi-option-btn:hover { padding-left: 6px; color: ${d}; }
|
|
403
|
+
.mushi-option-btn:hover .mushi-option-arrow { opacity: 1; transform: translateX(0); color: ${d}; }
|
|
404
|
+
.mushi-option-btn:focus-visible {
|
|
405
|
+
outline: none;
|
|
406
|
+
padding-left: 6px;
|
|
407
|
+
box-shadow: inset 2px 0 0 ${d};
|
|
408
|
+
}
|
|
409
|
+
.mushi-option-icon {
|
|
410
|
+
font-size: 18px;
|
|
411
|
+
line-height: 1;
|
|
412
|
+
flex-shrink: 0;
|
|
413
|
+
filter: ${n?"none":"grayscale(0.15)"};
|
|
414
|
+
}
|
|
415
|
+
.mushi-option-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
|
|
416
|
+
.mushi-option-label {
|
|
417
|
+
font-family: ${T};
|
|
418
|
+
font-size: 16px;
|
|
419
|
+
font-weight: 500;
|
|
420
|
+
letter-spacing: -0.005em;
|
|
421
|
+
line-height: 1.2;
|
|
422
|
+
}
|
|
423
|
+
.mushi-option-desc {
|
|
424
|
+
font-size: 12px;
|
|
425
|
+
color: ${m};
|
|
426
|
+
letter-spacing: 0.005em;
|
|
427
|
+
}
|
|
428
|
+
.mushi-option-arrow {
|
|
429
|
+
font-family: ${S};
|
|
430
|
+
font-size: 14px;
|
|
431
|
+
color: ${c};
|
|
432
|
+
opacity: 0;
|
|
433
|
+
transform: translateX(-4px);
|
|
434
|
+
transition: opacity 220ms ${y}, transform 220ms ${y}, color 220ms ${y};
|
|
435
|
+
}
|
|
436
|
+
/* Feature-request and Reports-inbox entries sit above the five
|
|
437
|
+
category cards as discoverable shortcuts. We give them a subtle
|
|
438
|
+
left rule so the eye reads them as a separate group rather than
|
|
439
|
+
"another category". The shortcut group has zero hover indent
|
|
440
|
+
overshoot \u2014 we want them quiet until intent. */
|
|
441
|
+
.mushi-feature-entry,
|
|
442
|
+
.mushi-reports-entry {
|
|
443
|
+
padding-left: 10px;
|
|
444
|
+
border-left: 2px solid ${c};
|
|
445
|
+
transition: padding 220ms ${y}, color 220ms ${y}, border-color 220ms ${y};
|
|
446
|
+
}
|
|
447
|
+
.mushi-feature-entry:hover,
|
|
448
|
+
.mushi-reports-entry:hover {
|
|
449
|
+
border-left-color: ${d};
|
|
450
|
+
padding-left: 14px;
|
|
451
|
+
}
|
|
452
|
+
.mushi-feature-entry .mushi-option-icon {
|
|
453
|
+
filter: none;
|
|
454
|
+
}
|
|
455
|
+
.mushi-report-row {
|
|
456
|
+
width: 100%;
|
|
457
|
+
display: grid;
|
|
458
|
+
grid-template-columns: 1fr auto;
|
|
459
|
+
gap: 10px;
|
|
460
|
+
align-items: center;
|
|
461
|
+
padding: 12px 4px 12px 0;
|
|
462
|
+
border: 0;
|
|
463
|
+
border-bottom: 1px solid ${h};
|
|
464
|
+
background: transparent;
|
|
465
|
+
color: ${l};
|
|
466
|
+
cursor: pointer;
|
|
467
|
+
text-align: left;
|
|
468
|
+
transition: background 180ms ${y}, padding-left 180ms ${y};
|
|
469
|
+
}
|
|
470
|
+
.mushi-report-row:hover,
|
|
471
|
+
.mushi-report-row:focus-visible {
|
|
472
|
+
background: ${n?"rgba(242,235,221,0.04)":"rgba(14,13,11,0.03)"};
|
|
473
|
+
padding-left: 4px;
|
|
474
|
+
}
|
|
475
|
+
.mushi-report-main {
|
|
476
|
+
min-width: 0;
|
|
477
|
+
display: grid;
|
|
478
|
+
gap: 6px;
|
|
479
|
+
}
|
|
480
|
+
.mushi-report-title {
|
|
481
|
+
font-size: 13px;
|
|
482
|
+
line-height: 1.35;
|
|
483
|
+
display: -webkit-box;
|
|
484
|
+
-webkit-line-clamp: 2;
|
|
485
|
+
-webkit-box-orient: vertical;
|
|
486
|
+
overflow: hidden;
|
|
487
|
+
}
|
|
488
|
+
.mushi-report-meta {
|
|
489
|
+
display: flex;
|
|
490
|
+
flex-wrap: wrap;
|
|
491
|
+
align-items: center;
|
|
492
|
+
gap: 8px;
|
|
493
|
+
}
|
|
494
|
+
.mushi-report-status {
|
|
495
|
+
display: inline-flex;
|
|
496
|
+
align-items: center;
|
|
497
|
+
font-family: ${S};
|
|
498
|
+
font-size: 10px;
|
|
499
|
+
font-weight: 600;
|
|
500
|
+
letter-spacing: 0.04em;
|
|
501
|
+
text-transform: uppercase;
|
|
502
|
+
padding: 2px 7px;
|
|
503
|
+
border-radius: 999px;
|
|
504
|
+
border: 1px solid transparent;
|
|
505
|
+
}
|
|
506
|
+
.mushi-status-sent {
|
|
507
|
+
color: ${n?"#A8C4FF":"#1E4A8C"};
|
|
508
|
+
background: ${n?"rgba(120,160,255,0.12)":"rgba(30,74,140,0.08)"};
|
|
509
|
+
border-color: ${n?"rgba(120,160,255,0.22)":"rgba(30,74,140,0.16)"};
|
|
510
|
+
}
|
|
511
|
+
.mushi-status-review {
|
|
512
|
+
color: ${n?"#FFD27A":"#8A5A00"};
|
|
513
|
+
background: ${n?"rgba(255,190,90,0.12)":"rgba(180,120,0,0.10)"};
|
|
514
|
+
border-color: ${n?"rgba(255,190,90,0.22)":"rgba(180,120,0,0.18)"};
|
|
515
|
+
}
|
|
516
|
+
.mushi-status-fixing {
|
|
517
|
+
color: ${n?"#FFB899":"#9A3D12"};
|
|
518
|
+
background: ${n?"rgba(255,120,60,0.12)":"rgba(224,60,44,0.10)"};
|
|
519
|
+
border-color: ${n?"rgba(255,120,60,0.24)":"rgba(224,60,44,0.18)"};
|
|
520
|
+
}
|
|
521
|
+
.mushi-status-fixed {
|
|
522
|
+
color: ${n?"#8FE3B0":"#1F6B3A"};
|
|
523
|
+
background: ${n?"rgba(80,200,130,0.12)":"rgba(31,107,58,0.10)"};
|
|
524
|
+
border-color: ${n?"rgba(80,200,130,0.22)":"rgba(31,107,58,0.18)"};
|
|
525
|
+
}
|
|
526
|
+
.mushi-status-closed,
|
|
527
|
+
.mushi-status-unknown {
|
|
528
|
+
color: ${m};
|
|
529
|
+
background: ${n?"rgba(242,235,221,0.06)":"rgba(14,13,11,0.05)"};
|
|
530
|
+
border-color: ${f};
|
|
531
|
+
}
|
|
532
|
+
.mushi-report-when {
|
|
533
|
+
font-family: ${S};
|
|
534
|
+
font-size: 10px;
|
|
535
|
+
color: ${c};
|
|
536
|
+
}
|
|
537
|
+
.mushi-unread-badge {
|
|
538
|
+
display: inline-flex;
|
|
539
|
+
align-items: center;
|
|
540
|
+
justify-content: center;
|
|
541
|
+
min-width: 18px;
|
|
542
|
+
height: 18px;
|
|
543
|
+
padding: 0 5px;
|
|
544
|
+
border-radius: 999px;
|
|
545
|
+
font-family: ${S};
|
|
546
|
+
font-size: 10px;
|
|
547
|
+
font-weight: 700;
|
|
548
|
+
color: ${R};
|
|
549
|
+
background: ${d};
|
|
550
|
+
}
|
|
551
|
+
.mushi-report-chevron {
|
|
552
|
+
font-size: 18px;
|
|
553
|
+
line-height: 1;
|
|
554
|
+
color: ${c};
|
|
555
|
+
transition: color 180ms ${y}, transform 180ms ${y};
|
|
556
|
+
}
|
|
557
|
+
.mushi-report-row:hover .mushi-report-chevron,
|
|
558
|
+
.mushi-report-row:focus-visible .mushi-report-chevron {
|
|
559
|
+
color: ${d};
|
|
560
|
+
transform: translateX(2px);
|
|
561
|
+
}
|
|
562
|
+
.mushi-thread-summary {
|
|
563
|
+
border-bottom: 1px solid ${h};
|
|
564
|
+
padding-bottom: 10px;
|
|
565
|
+
margin-bottom: 10px;
|
|
566
|
+
}
|
|
567
|
+
.mushi-thread-summary-meta {
|
|
568
|
+
display: flex;
|
|
569
|
+
flex-wrap: wrap;
|
|
570
|
+
align-items: center;
|
|
571
|
+
gap: 10px;
|
|
572
|
+
margin-bottom: 8px;
|
|
573
|
+
}
|
|
574
|
+
.mushi-thread {
|
|
575
|
+
display: grid;
|
|
576
|
+
gap: 8px;
|
|
577
|
+
max-height: 180px;
|
|
578
|
+
overflow: auto;
|
|
579
|
+
margin-bottom: 12px;
|
|
580
|
+
}
|
|
581
|
+
.mushi-thread-comment {
|
|
582
|
+
padding: 8px 10px;
|
|
583
|
+
border: 1px solid ${h};
|
|
584
|
+
background: ${n?"rgba(242,235,221,0.04)":"rgba(14,13,11,0.03)"};
|
|
585
|
+
}
|
|
586
|
+
.mushi-thread-comment.reporter {
|
|
587
|
+
border-color: ${b};
|
|
588
|
+
background: ${b};
|
|
589
|
+
}
|
|
590
|
+
.mushi-thread-comment strong {
|
|
591
|
+
display: block;
|
|
592
|
+
font-family: ${S};
|
|
593
|
+
font-size: 10px;
|
|
594
|
+
letter-spacing: 0.08em;
|
|
595
|
+
text-transform: uppercase;
|
|
596
|
+
margin-bottom: 3px;
|
|
597
|
+
}
|
|
598
|
+
.mushi-thread-comment p,
|
|
599
|
+
.mushi-muted,
|
|
600
|
+
.mushi-error-inline {
|
|
601
|
+
font-size: 12px;
|
|
602
|
+
color: ${m};
|
|
603
|
+
line-height: 1.45;
|
|
604
|
+
}
|
|
605
|
+
.mushi-error-inline { color: ${d}; }
|
|
606
|
+
|
|
607
|
+
.mushi-selected-category {
|
|
608
|
+
display: inline-flex;
|
|
609
|
+
align-items: center;
|
|
610
|
+
gap: 8px;
|
|
611
|
+
padding: 6px 10px 6px 12px;
|
|
612
|
+
border-left: 2px solid ${d};
|
|
613
|
+
background: ${b};
|
|
614
|
+
color: ${R};
|
|
615
|
+
font-family: ${S};
|
|
616
|
+
font-size: 11px;
|
|
617
|
+
letter-spacing: 0.12em;
|
|
618
|
+
text-transform: uppercase;
|
|
619
|
+
margin: 4px 0 14px;
|
|
620
|
+
border-radius: 0 3px 3px 0;
|
|
621
|
+
}
|
|
622
|
+
.mushi-selected-category span:first-child { font-size: 14px; }
|
|
623
|
+
.mushi-intents {
|
|
624
|
+
display: flex;
|
|
625
|
+
flex-direction: column;
|
|
626
|
+
gap: 2px;
|
|
627
|
+
}
|
|
628
|
+
.mushi-intent-btn {
|
|
629
|
+
display: flex;
|
|
630
|
+
align-items: center;
|
|
631
|
+
justify-content: space-between;
|
|
632
|
+
gap: 12px;
|
|
633
|
+
padding: 12px 0;
|
|
634
|
+
border: none;
|
|
635
|
+
border-bottom: 1px solid ${h};
|
|
636
|
+
background: transparent;
|
|
637
|
+
cursor: pointer;
|
|
638
|
+
color: inherit;
|
|
639
|
+
text-align: left;
|
|
640
|
+
font-family: ${T};
|
|
641
|
+
font-size: 15px;
|
|
642
|
+
transition: padding 220ms ${y}, color 220ms ${y};
|
|
643
|
+
}
|
|
644
|
+
.mushi-intent-btn::after {
|
|
645
|
+
content: '\u2192';
|
|
646
|
+
font-family: ${S};
|
|
647
|
+
font-size: 13px;
|
|
648
|
+
color: ${c};
|
|
649
|
+
opacity: 0;
|
|
650
|
+
transform: translateX(-4px);
|
|
651
|
+
transition: opacity 220ms ${y}, transform 220ms ${y};
|
|
652
|
+
}
|
|
653
|
+
.mushi-intent-btn:last-child { border-bottom: none; }
|
|
654
|
+
.mushi-intent-btn:hover { padding-left: 6px; color: ${d}; }
|
|
655
|
+
.mushi-intent-btn:hover::after { opacity: 1; transform: translateX(0); color: ${d}; }
|
|
656
|
+
.mushi-intent-btn:focus-visible {
|
|
657
|
+
outline: none;
|
|
658
|
+
padding-left: 6px;
|
|
659
|
+
box-shadow: inset 2px 0 0 ${d};
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/* Example starter chips \u2014 reduce first-report activation energy */
|
|
663
|
+
.mushi-example-chips {
|
|
664
|
+
display: flex;
|
|
665
|
+
flex-wrap: wrap;
|
|
666
|
+
gap: 6px;
|
|
667
|
+
margin-bottom: 10px;
|
|
668
|
+
}
|
|
669
|
+
.mushi-example-chip {
|
|
670
|
+
padding: 4px 10px;
|
|
671
|
+
border: 1px solid ${h};
|
|
672
|
+
border-radius: 12px;
|
|
673
|
+
background: transparent;
|
|
674
|
+
color: ${m};
|
|
675
|
+
font-family: ${x};
|
|
676
|
+
font-size: 11px;
|
|
677
|
+
cursor: pointer;
|
|
678
|
+
transition: color 150ms ${y}, border-color 150ms ${y}, background 150ms ${y};
|
|
679
|
+
white-space: nowrap;
|
|
680
|
+
}
|
|
681
|
+
.mushi-example-chip:hover {
|
|
682
|
+
color: ${l};
|
|
683
|
+
border-color: ${m};
|
|
684
|
+
background: ${n?"rgba(242,235,221,0.06)":"rgba(14,13,11,0.04)"};
|
|
685
|
+
}
|
|
686
|
+
.mushi-example-chip:focus-visible {
|
|
687
|
+
outline: 2px solid ${d};
|
|
688
|
+
outline-offset: 2px;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/* Textarea wrapper to position char counter */
|
|
692
|
+
.mushi-textarea-wrap {
|
|
693
|
+
position: relative;
|
|
694
|
+
}
|
|
695
|
+
.mushi-char-counter {
|
|
696
|
+
position: absolute;
|
|
697
|
+
bottom: 4px;
|
|
698
|
+
right: 0;
|
|
699
|
+
font-family: ${S};
|
|
700
|
+
font-size: 10px;
|
|
701
|
+
letter-spacing: 0.04em;
|
|
702
|
+
color: ${c};
|
|
703
|
+
pointer-events: none;
|
|
704
|
+
transition: color 200ms ${y};
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.mushi-textarea {
|
|
708
|
+
width: 100%;
|
|
709
|
+
min-height: 96px;
|
|
710
|
+
padding: 8px 0 10px;
|
|
711
|
+
border: none;
|
|
712
|
+
border-bottom: 1px solid ${f};
|
|
713
|
+
background: transparent;
|
|
714
|
+
color: ${l};
|
|
715
|
+
font-family: ${x};
|
|
716
|
+
font-size: 14px;
|
|
717
|
+
line-height: 1.5;
|
|
718
|
+
resize: vertical;
|
|
719
|
+
outline: none;
|
|
720
|
+
transition: border-color 200ms ${y};
|
|
721
|
+
}
|
|
722
|
+
.mushi-textarea::placeholder {
|
|
723
|
+
color: ${c};
|
|
724
|
+
font-style: italic;
|
|
725
|
+
}
|
|
726
|
+
.mushi-textarea:focus { border-bottom-color: ${d}; }
|
|
727
|
+
|
|
728
|
+
.mushi-attachments {
|
|
729
|
+
display: flex;
|
|
730
|
+
flex-wrap: wrap;
|
|
731
|
+
gap: 6px;
|
|
732
|
+
margin-top: 12px;
|
|
733
|
+
}
|
|
734
|
+
.mushi-attach-btn {
|
|
735
|
+
display: inline-flex;
|
|
736
|
+
align-items: center;
|
|
737
|
+
gap: 6px;
|
|
738
|
+
padding: 5px 10px;
|
|
739
|
+
border: 1px solid ${f};
|
|
740
|
+
border-radius: 3px;
|
|
741
|
+
background: transparent;
|
|
742
|
+
color: ${m};
|
|
743
|
+
font-family: ${S};
|
|
744
|
+
font-size: 11px;
|
|
745
|
+
letter-spacing: 0.04em;
|
|
746
|
+
text-transform: uppercase;
|
|
747
|
+
cursor: pointer;
|
|
748
|
+
transition: color 180ms ${y}, border-color 180ms ${y}, background 180ms ${y};
|
|
749
|
+
}
|
|
750
|
+
.mushi-attach-btn:hover {
|
|
751
|
+
color: ${l};
|
|
752
|
+
border-color: ${l};
|
|
753
|
+
}
|
|
754
|
+
.mushi-attach-btn.active {
|
|
755
|
+
color: ${d};
|
|
756
|
+
border-color: ${d};
|
|
757
|
+
background: ${b};
|
|
758
|
+
}
|
|
759
|
+
.mushi-attach-btn.danger {
|
|
760
|
+
color: ${R};
|
|
761
|
+
border-color: ${b};
|
|
762
|
+
background: transparent;
|
|
763
|
+
}
|
|
764
|
+
.mushi-attach-btn.danger:hover {
|
|
765
|
+
color: ${d};
|
|
766
|
+
border-color: ${d};
|
|
767
|
+
background: ${b};
|
|
768
|
+
}
|
|
769
|
+
.mushi-attach-btn.loading {
|
|
770
|
+
opacity: 0.7;
|
|
771
|
+
cursor: wait;
|
|
772
|
+
}
|
|
773
|
+
.mushi-attach-btn.error {
|
|
774
|
+
color: ${d};
|
|
775
|
+
border-color: ${b};
|
|
776
|
+
}
|
|
777
|
+
.mushi-attach-btn:focus-visible {
|
|
778
|
+
outline: 2px solid ${d};
|
|
779
|
+
outline-offset: 2px;
|
|
780
|
+
}
|
|
781
|
+
.mushi-annotate-host {
|
|
782
|
+
flex-basis: 100%;
|
|
783
|
+
margin-top: 8px;
|
|
784
|
+
}
|
|
785
|
+
.mushi-annotate-host:empty {
|
|
786
|
+
margin-top: 0;
|
|
787
|
+
}
|
|
788
|
+
.mushi-annotate-toolbar {
|
|
789
|
+
display: flex;
|
|
790
|
+
flex-wrap: wrap;
|
|
791
|
+
gap: 6px;
|
|
792
|
+
margin-bottom: 8px;
|
|
793
|
+
}
|
|
794
|
+
@keyframes mushi-spin {
|
|
795
|
+
to { transform: rotate(360deg); }
|
|
796
|
+
}
|
|
797
|
+
@keyframes mushi-fade-in {
|
|
798
|
+
from { opacity: 0; transform: translateY(4px); }
|
|
799
|
+
to { opacity: 1; transform: translateY(0); }
|
|
800
|
+
}
|
|
801
|
+
.mushi-spinner {
|
|
802
|
+
display: inline-block;
|
|
803
|
+
width: 10px;
|
|
804
|
+
height: 10px;
|
|
805
|
+
border: 1.5px solid currentColor;
|
|
806
|
+
border-top-color: transparent;
|
|
807
|
+
border-radius: 50%;
|
|
808
|
+
animation: mushi-spin 0.7s linear infinite;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.mushi-footer {
|
|
812
|
+
padding: 14px 22px 16px;
|
|
813
|
+
border-top: 1px solid ${h};
|
|
814
|
+
display: flex;
|
|
815
|
+
align-items: center;
|
|
816
|
+
justify-content: space-between;
|
|
817
|
+
gap: 12px;
|
|
818
|
+
}
|
|
819
|
+
.mushi-footer-hint {
|
|
820
|
+
font-family: ${S};
|
|
821
|
+
font-size: 10px;
|
|
822
|
+
letter-spacing: 0.10em;
|
|
823
|
+
text-transform: uppercase;
|
|
824
|
+
color: ${c};
|
|
825
|
+
}
|
|
826
|
+
.mushi-submit {
|
|
827
|
+
position: relative;
|
|
828
|
+
display: inline-flex;
|
|
829
|
+
align-items: center;
|
|
830
|
+
gap: 8px;
|
|
831
|
+
padding: 10px 18px;
|
|
832
|
+
border: 1px solid ${d};
|
|
833
|
+
border-radius: 3px;
|
|
834
|
+
background: ${d};
|
|
835
|
+
color: #FAF7F0;
|
|
836
|
+
font-family: ${S};
|
|
837
|
+
font-size: 11px;
|
|
838
|
+
letter-spacing: 0.16em;
|
|
839
|
+
text-transform: uppercase;
|
|
840
|
+
cursor: pointer;
|
|
841
|
+
overflow: hidden;
|
|
842
|
+
transition: transform 180ms ${y}, box-shadow 180ms ${y};
|
|
843
|
+
box-shadow: 0 2px 0 ${n?"#7A1F15":"#9A2A1E"};
|
|
844
|
+
}
|
|
845
|
+
.mushi-submit::after {
|
|
846
|
+
content: '';
|
|
847
|
+
position: absolute;
|
|
848
|
+
inset: 0;
|
|
849
|
+
background: radial-gradient(circle at center, rgba(255,255,255,0.35) 0%, transparent 60%);
|
|
850
|
+
opacity: 0;
|
|
851
|
+
transform: scale(0.4);
|
|
852
|
+
transition: opacity 280ms ${y}, transform 380ms ${y};
|
|
853
|
+
pointer-events: none;
|
|
854
|
+
}
|
|
855
|
+
.mushi-submit:hover {
|
|
856
|
+
transform: translateY(-1px);
|
|
857
|
+
box-shadow: 0 3px 0 ${n?"#7A1F15":"#9A2A1E"};
|
|
858
|
+
}
|
|
859
|
+
.mushi-submit:hover::after { opacity: 1; transform: scale(1.4); }
|
|
860
|
+
.mushi-submit:active { transform: translateY(1px); box-shadow: 0 1px 0 ${n?"#7A1F15":"#9A2A1E"}; }
|
|
861
|
+
.mushi-submit:disabled {
|
|
862
|
+
cursor: wait;
|
|
863
|
+
opacity: 0.7;
|
|
864
|
+
}
|
|
865
|
+
.mushi-submit:focus-visible {
|
|
866
|
+
outline: 2px solid ${d};
|
|
867
|
+
outline-offset: 3px;
|
|
868
|
+
}
|
|
869
|
+
.mushi-submit-arrow {
|
|
870
|
+
display: inline-block;
|
|
871
|
+
transition: transform 220ms ${y};
|
|
872
|
+
}
|
|
873
|
+
.mushi-submit:hover .mushi-submit-arrow { transform: translateX(3px); }
|
|
874
|
+
|
|
875
|
+
.mushi-brand-footer {
|
|
876
|
+
padding: 9px 14px 11px;
|
|
877
|
+
border-top: 1px solid ${h};
|
|
878
|
+
color: ${c};
|
|
879
|
+
font-family: ${S};
|
|
880
|
+
font-size: 9px;
|
|
881
|
+
letter-spacing: 0.16em;
|
|
882
|
+
text-align: center;
|
|
883
|
+
text-transform: uppercase;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.mushi-step-indicator {
|
|
887
|
+
display: flex;
|
|
888
|
+
align-items: center;
|
|
889
|
+
justify-content: center;
|
|
890
|
+
gap: 8px;
|
|
891
|
+
padding: 10px 22px 14px;
|
|
892
|
+
color: ${c};
|
|
893
|
+
font-family: ${S};
|
|
894
|
+
font-size: 11px;
|
|
895
|
+
letter-spacing: 0.10em;
|
|
896
|
+
}
|
|
897
|
+
.mushi-step-num {
|
|
898
|
+
display: inline-flex;
|
|
899
|
+
align-items: baseline;
|
|
900
|
+
gap: 4px;
|
|
901
|
+
transition: color 200ms ${y};
|
|
902
|
+
}
|
|
903
|
+
.mushi-step-num.done { color: ${m}; text-decoration: line-through; text-decoration-color: ${c}; }
|
|
904
|
+
.mushi-step-num.active {
|
|
905
|
+
color: ${d};
|
|
906
|
+
font-family: ${T};
|
|
907
|
+
font-size: 14px;
|
|
908
|
+
font-weight: 600;
|
|
909
|
+
letter-spacing: 0;
|
|
910
|
+
}
|
|
911
|
+
.mushi-step-sep { width: 14px; height: 1px; background: ${h}; }
|
|
912
|
+
|
|
913
|
+
.mushi-success {
|
|
914
|
+
text-align: center;
|
|
915
|
+
padding: 28px 16px 20px;
|
|
916
|
+
}
|
|
917
|
+
.mushi-success-stamp {
|
|
918
|
+
position: relative;
|
|
919
|
+
width: 96px;
|
|
920
|
+
height: 96px;
|
|
921
|
+
margin: 0 auto 16px;
|
|
922
|
+
display: inline-flex;
|
|
923
|
+
align-items: center;
|
|
924
|
+
justify-content: center;
|
|
925
|
+
}
|
|
926
|
+
.mushi-success-stamp svg {
|
|
927
|
+
position: absolute;
|
|
928
|
+
inset: 0;
|
|
929
|
+
width: 100%;
|
|
930
|
+
height: 100%;
|
|
931
|
+
}
|
|
932
|
+
.mushi-success-stamp circle {
|
|
933
|
+
fill: none;
|
|
934
|
+
stroke: ${d};
|
|
935
|
+
stroke-width: 3;
|
|
936
|
+
stroke-dasharray: 280;
|
|
937
|
+
stroke-dashoffset: 280;
|
|
938
|
+
transform: rotate(-90deg);
|
|
939
|
+
transform-origin: center;
|
|
940
|
+
animation: mushi-stamp-ring 700ms ${y} 80ms forwards;
|
|
941
|
+
}
|
|
942
|
+
.mushi-success-stamp-label {
|
|
943
|
+
font-family: ${T};
|
|
944
|
+
font-size: 18px;
|
|
945
|
+
font-weight: 600;
|
|
946
|
+
color: ${d};
|
|
947
|
+
letter-spacing: 0.04em;
|
|
948
|
+
transform: rotate(-6deg);
|
|
949
|
+
opacity: 0;
|
|
950
|
+
animation: mushi-stamp-press 360ms ${y} 600ms forwards;
|
|
951
|
+
}
|
|
952
|
+
.mushi-success-headline {
|
|
953
|
+
font-family: ${T};
|
|
954
|
+
font-size: 18px;
|
|
955
|
+
font-weight: 500;
|
|
956
|
+
color: ${l};
|
|
957
|
+
margin-bottom: 4px;
|
|
958
|
+
}
|
|
959
|
+
.mushi-success-meta {
|
|
960
|
+
font-family: ${S};
|
|
961
|
+
font-size: 11px;
|
|
962
|
+
letter-spacing: 0.10em;
|
|
963
|
+
text-transform: uppercase;
|
|
964
|
+
color: ${m};
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/* \u2500\u2500 Two-way receipt (success step) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
968
|
+
/* The receipt block sits below the stamp/meta. Three states: */
|
|
969
|
+
/* 1. delivering... (spinner pill, while host onSubmit awaits) */
|
|
970
|
+
/* 2. confirmed (Receipt #abc12345 + Track on Mushi link) */
|
|
971
|
+
/* 3. queued offline (warn pill \u2014 degrade gracefully) */
|
|
972
|
+
.mushi-success-receipt {
|
|
973
|
+
margin-top: 14px;
|
|
974
|
+
width: 100%;
|
|
975
|
+
max-width: 280px;
|
|
976
|
+
display: flex;
|
|
977
|
+
flex-direction: column;
|
|
978
|
+
gap: 6px;
|
|
979
|
+
align-items: stretch;
|
|
980
|
+
}
|
|
981
|
+
.mushi-success-receipt-row {
|
|
982
|
+
display: flex;
|
|
983
|
+
align-items: center;
|
|
984
|
+
justify-content: center;
|
|
985
|
+
gap: 8px;
|
|
986
|
+
font-family: ${S};
|
|
987
|
+
font-size: 11px;
|
|
988
|
+
letter-spacing: 0.05em;
|
|
989
|
+
color: ${m};
|
|
990
|
+
}
|
|
991
|
+
.mushi-success-receipt-label {
|
|
992
|
+
text-transform: uppercase;
|
|
993
|
+
letter-spacing: 0.10em;
|
|
994
|
+
color: ${m};
|
|
995
|
+
}
|
|
996
|
+
.mushi-success-receipt-id {
|
|
997
|
+
display: inline-flex;
|
|
998
|
+
align-items: center;
|
|
999
|
+
gap: 5px;
|
|
1000
|
+
padding: 3px 8px;
|
|
1001
|
+
border-radius: 4px;
|
|
1002
|
+
background: transparent;
|
|
1003
|
+
border: 1px dashed ${h};
|
|
1004
|
+
color: inherit;
|
|
1005
|
+
font-family: ${S};
|
|
1006
|
+
font-size: 12px;
|
|
1007
|
+
letter-spacing: 0.02em;
|
|
1008
|
+
cursor: pointer;
|
|
1009
|
+
transition: background 120ms ease, border-color 120ms ease;
|
|
1010
|
+
}
|
|
1011
|
+
.mushi-success-receipt-id:hover,
|
|
1012
|
+
.mushi-success-receipt-id:focus-visible {
|
|
1013
|
+
background: rgba(217, 65, 47, 0.06);
|
|
1014
|
+
border-color: ${d};
|
|
1015
|
+
color: ${d};
|
|
1016
|
+
outline: none;
|
|
1017
|
+
}
|
|
1018
|
+
.mushi-success-receipt-copy {
|
|
1019
|
+
font-size: 11px;
|
|
1020
|
+
opacity: 0.7;
|
|
1021
|
+
}
|
|
1022
|
+
.mushi-success-receipt-track {
|
|
1023
|
+
display: inline-flex;
|
|
1024
|
+
align-items: center;
|
|
1025
|
+
justify-content: center;
|
|
1026
|
+
gap: 4px;
|
|
1027
|
+
padding: 6px 10px;
|
|
1028
|
+
border-radius: 4px;
|
|
1029
|
+
background: ${d};
|
|
1030
|
+
color: #fff;
|
|
1031
|
+
font-family: ${S};
|
|
1032
|
+
font-size: 11px;
|
|
1033
|
+
letter-spacing: 0.10em;
|
|
1034
|
+
text-transform: uppercase;
|
|
1035
|
+
text-decoration: none;
|
|
1036
|
+
transition: filter 120ms ease;
|
|
1037
|
+
}
|
|
1038
|
+
.mushi-success-receipt-track:hover,
|
|
1039
|
+
.mushi-success-receipt-track:focus-visible {
|
|
1040
|
+
filter: brightness(0.95);
|
|
1041
|
+
outline: none;
|
|
1042
|
+
}
|
|
1043
|
+
.mushi-success-receipt-spinner {
|
|
1044
|
+
width: 11px;
|
|
1045
|
+
height: 11px;
|
|
1046
|
+
border-radius: 50%;
|
|
1047
|
+
border: 1.5px solid ${h};
|
|
1048
|
+
border-top-color: ${d};
|
|
1049
|
+
animation: mushi-receipt-spin 0.8s linear infinite;
|
|
1050
|
+
}
|
|
1051
|
+
@keyframes mushi-receipt-spin {
|
|
1052
|
+
to { transform: rotate(360deg); }
|
|
1053
|
+
}
|
|
1054
|
+
.mushi-success-receipt-hint {
|
|
1055
|
+
color: ${m};
|
|
1056
|
+
font-style: italic;
|
|
1057
|
+
}
|
|
1058
|
+
.mushi-success-receipt-warn {
|
|
1059
|
+
color: ${d};
|
|
1060
|
+
}
|
|
1061
|
+
.mushi-success-sla {
|
|
1062
|
+
margin-top: 2px;
|
|
1063
|
+
font-family: ${T};
|
|
1064
|
+
font-size: 12px;
|
|
1065
|
+
line-height: 1.45;
|
|
1066
|
+
text-align: center;
|
|
1067
|
+
color: ${m};
|
|
1068
|
+
max-width: 260px;
|
|
1069
|
+
}
|
|
1070
|
+
.mushi-success-sla-default {
|
|
1071
|
+
opacity: 0.85;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
@keyframes mushi-stamp-ring {
|
|
1075
|
+
to { stroke-dashoffset: 0; }
|
|
1076
|
+
}
|
|
1077
|
+
@keyframes mushi-stamp-press {
|
|
1078
|
+
0% { opacity: 0; transform: rotate(-6deg) scale(1.3); }
|
|
1079
|
+
60% { opacity: 1; transform: rotate(-6deg) scale(0.94); }
|
|
1080
|
+
100% { opacity: 1; transform: rotate(-6deg) scale(1); }
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
.mushi-error {
|
|
1084
|
+
margin-top: 10px;
|
|
1085
|
+
padding: 8px 0 8px 10px;
|
|
1086
|
+
border-left: 2px solid ${d};
|
|
1087
|
+
color: ${d};
|
|
1088
|
+
font-size: 12px;
|
|
1089
|
+
font-family: ${S};
|
|
1090
|
+
letter-spacing: 0.02em;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
/* \u2500\u2500 Rewards nudge (category step) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1094
|
+
.mushi-rewards-nudge {
|
|
1095
|
+
border-top: 1px solid ${h};
|
|
1096
|
+
padding: 10px 0 4px;
|
|
1097
|
+
margin-top: 6px;
|
|
1098
|
+
}
|
|
1099
|
+
.mushi-rewards-row {
|
|
1100
|
+
display: flex;
|
|
1101
|
+
align-items: center;
|
|
1102
|
+
gap: 6px;
|
|
1103
|
+
margin-bottom: 8px;
|
|
1104
|
+
}
|
|
1105
|
+
.mushi-tier-pip {
|
|
1106
|
+
width: 7px;
|
|
1107
|
+
height: 7px;
|
|
1108
|
+
border-radius: 50%;
|
|
1109
|
+
flex-shrink: 0;
|
|
1110
|
+
}
|
|
1111
|
+
.mushi-rewards-tier-name {
|
|
1112
|
+
font-family: ${S};
|
|
1113
|
+
font-size: 11px;
|
|
1114
|
+
letter-spacing: 0.08em;
|
|
1115
|
+
text-transform: uppercase;
|
|
1116
|
+
color: ${l};
|
|
1117
|
+
}
|
|
1118
|
+
.mushi-rewards-pts-count {
|
|
1119
|
+
font-family: ${S};
|
|
1120
|
+
font-size: 11px;
|
|
1121
|
+
color: ${m};
|
|
1122
|
+
margin-right: auto;
|
|
1123
|
+
}
|
|
1124
|
+
.mushi-rewards-pts-earn {
|
|
1125
|
+
font-family: ${S};
|
|
1126
|
+
font-size: 10px;
|
|
1127
|
+
color: ${d};
|
|
1128
|
+
letter-spacing: 0.04em;
|
|
1129
|
+
white-space: nowrap;
|
|
1130
|
+
}
|
|
1131
|
+
.mushi-tier-bar-track {
|
|
1132
|
+
height: 3px;
|
|
1133
|
+
background: ${f};
|
|
1134
|
+
border-radius: 2px;
|
|
1135
|
+
overflow: hidden;
|
|
1136
|
+
margin-bottom: 5px;
|
|
1137
|
+
}
|
|
1138
|
+
.mushi-tier-bar-fill {
|
|
1139
|
+
height: 100%;
|
|
1140
|
+
background: ${d};
|
|
1141
|
+
border-radius: 2px;
|
|
1142
|
+
transition: width 600ms ${y};
|
|
1143
|
+
}
|
|
1144
|
+
.mushi-rewards-next-label {
|
|
1145
|
+
font-family: ${S};
|
|
1146
|
+
font-size: 10px;
|
|
1147
|
+
color: ${m};
|
|
1148
|
+
text-align: right;
|
|
1149
|
+
letter-spacing: 0.02em;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/* \u2500\u2500 Rewards on success step \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1153
|
+
.mushi-success-rewards {
|
|
1154
|
+
margin-top: 14px;
|
|
1155
|
+
padding-top: 12px;
|
|
1156
|
+
border-top: 1px solid ${h};
|
|
1157
|
+
width: 100%;
|
|
1158
|
+
}
|
|
1159
|
+
.mushi-success-pts-award {
|
|
1160
|
+
font-family: ${S};
|
|
1161
|
+
font-size: 22px;
|
|
1162
|
+
font-weight: 700;
|
|
1163
|
+
color: ${d};
|
|
1164
|
+
text-align: center;
|
|
1165
|
+
letter-spacing: 0.06em;
|
|
1166
|
+
margin-bottom: 10px;
|
|
1167
|
+
opacity: 0;
|
|
1168
|
+
animation: mushi-pts-pop 420ms ${y} 900ms forwards;
|
|
1169
|
+
}
|
|
1170
|
+
.success-bar { margin: 0 0 5px; }
|
|
1171
|
+
|
|
1172
|
+
@keyframes mushi-pts-pop {
|
|
1173
|
+
from { opacity: 0; transform: scale(0.75) translateY(6px); }
|
|
1174
|
+
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
/* \u2500\u2500\u2500 Beta mode strip (category step) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1178
|
+
/* Brand palette: widgetAccent (vermillion) + washi ink for the strip.
|
|
1179
|
+
The previous indigo (#6366f1) is the single most recognisable AI-template
|
|
1180
|
+
colour; replaced with the widget's own vermillion wash so the beta panel
|
|
1181
|
+
reads as a Mushi-native surface rather than a generic SaaS plug-in. */
|
|
1182
|
+
|
|
1183
|
+
.mushi-beta-strip {
|
|
1184
|
+
margin: 0 16px 2px;
|
|
1185
|
+
padding: 9px 12px;
|
|
1186
|
+
background: ${b};
|
|
1187
|
+
border: 1px solid ${n?"rgba(255,90,71,0.22)":"rgba(224,60,44,0.16)"};
|
|
1188
|
+
border-radius: 4px;
|
|
1189
|
+
display: flex;
|
|
1190
|
+
flex-direction: column;
|
|
1191
|
+
gap: 4px;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
.mushi-beta-strip-row {
|
|
1195
|
+
display: flex;
|
|
1196
|
+
align-items: center;
|
|
1197
|
+
gap: 8px;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
.mushi-beta-tag {
|
|
1201
|
+
display: inline-flex;
|
|
1202
|
+
align-items: center;
|
|
1203
|
+
padding: 1px 6px;
|
|
1204
|
+
border-radius: 3px;
|
|
1205
|
+
background: ${d};
|
|
1206
|
+
color: #FAF7F0;
|
|
1207
|
+
font-family: ${S};
|
|
1208
|
+
font-size: 9px;
|
|
1209
|
+
font-weight: 700;
|
|
1210
|
+
letter-spacing: 0.14em;
|
|
1211
|
+
line-height: 1.6;
|
|
1212
|
+
white-space: nowrap;
|
|
1213
|
+
flex-shrink: 0;
|
|
1214
|
+
text-transform: uppercase;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
.mushi-beta-msg {
|
|
1218
|
+
font-size: 11px;
|
|
1219
|
+
color: ${m};
|
|
1220
|
+
line-height: 1.45;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
.mushi-beta-contact-hint {
|
|
1224
|
+
font-size: 10px;
|
|
1225
|
+
color: ${c};
|
|
1226
|
+
font-family: ${S};
|
|
1227
|
+
letter-spacing: 0.06em;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
.mushi-beta-perks {
|
|
1231
|
+
list-style: none;
|
|
1232
|
+
margin: 2px 0 0;
|
|
1233
|
+
padding: 0;
|
|
1234
|
+
display: flex;
|
|
1235
|
+
flex-direction: column;
|
|
1236
|
+
gap: 2px;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
.mushi-beta-perks li {
|
|
1240
|
+
font-size: 12px;
|
|
1241
|
+
color: ${R};
|
|
1242
|
+
font-weight: 500;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
/* \u2500\u2500\u2500 Beta changelog (collapsible What's new) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1246
|
+
|
|
1247
|
+
.mushi-changelog {
|
|
1248
|
+
margin-top: 5px;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
.mushi-changelog-summary {
|
|
1252
|
+
font-size: 11px;
|
|
1253
|
+
color: ${g};
|
|
1254
|
+
cursor: pointer;
|
|
1255
|
+
list-style: none;
|
|
1256
|
+
display: flex;
|
|
1257
|
+
align-items: center;
|
|
1258
|
+
gap: 4px;
|
|
1259
|
+
user-select: none;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
.mushi-changelog-summary::before {
|
|
1263
|
+
content: '\u25B6';
|
|
1264
|
+
font-size: 7px;
|
|
1265
|
+
opacity: 0.6;
|
|
1266
|
+
transition: transform 0.15s ease;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
.mushi-changelog[open] .mushi-changelog-summary::before {
|
|
1270
|
+
transform: rotate(90deg);
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.mushi-changelog-list {
|
|
1274
|
+
margin: 5px 0 0 4px;
|
|
1275
|
+
padding: 0;
|
|
1276
|
+
list-style: none;
|
|
1277
|
+
display: flex;
|
|
1278
|
+
flex-direction: column;
|
|
1279
|
+
gap: 2px;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
.mushi-changelog-list li {
|
|
1283
|
+
font-size: 11px;
|
|
1284
|
+
color: ${g};
|
|
1285
|
+
line-height: 1.5;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
/* \u2500\u2500\u2500 Beta success footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1289
|
+
|
|
1290
|
+
.mushi-beta-success-footer {
|
|
1291
|
+
margin-top: 14px;
|
|
1292
|
+
padding: 10px 14px;
|
|
1293
|
+
background: ${b};
|
|
1294
|
+
border: 1px solid ${n?"rgba(255,90,71,0.18)":"rgba(224,60,44,0.14)"};
|
|
1295
|
+
border-radius: 4px;
|
|
1296
|
+
display: flex;
|
|
1297
|
+
flex-direction: column;
|
|
1298
|
+
gap: 3px;
|
|
1299
|
+
text-align: left;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
.mushi-beta-success-line {
|
|
1303
|
+
font-size: 12px;
|
|
1304
|
+
color: ${R};
|
|
1305
|
+
line-height: 1.5;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
.mushi-beta-success-dim {
|
|
1309
|
+
opacity: 0.65;
|
|
1310
|
+
font-size: 12px;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/* \u2500\u2500\u2500 Banner launcher (trigger: 'banner') \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1314
|
+
|
|
1315
|
+
.mushi-banner {
|
|
1316
|
+
position: fixed;
|
|
1317
|
+
left: 0;
|
|
1318
|
+
right: 0;
|
|
1319
|
+
/* min-height (not fixed height) + border-box so the safe-area padding
|
|
1320
|
+
below extends the bar into the notch/home-indicator zone instead of
|
|
1321
|
+
letting content bleed under the status bar (mobile safe-area bleed
|
|
1322
|
+
fix \u2014 Workstream C). Horizontal padding also clears the left/right
|
|
1323
|
+
insets for landscape notches. */
|
|
1324
|
+
box-sizing: border-box;
|
|
1325
|
+
min-height: 36px;
|
|
1326
|
+
display: flex;
|
|
1327
|
+
align-items: center;
|
|
1328
|
+
justify-content: center;
|
|
1329
|
+
gap: 10px;
|
|
1330
|
+
padding: 0 calc(16px + env(safe-area-inset-right, 0px)) 0 calc(16px + env(safe-area-inset-left, 0px));
|
|
1331
|
+
font-family: ${S};
|
|
1332
|
+
font-size: 12px;
|
|
1333
|
+
letter-spacing: 0.04em;
|
|
1334
|
+
white-space: nowrap;
|
|
1335
|
+
overflow: hidden;
|
|
1336
|
+
z-index: var(--mushi-banner-z, 99998);
|
|
1337
|
+
animation: mushi-banner-slide-in 0.3s ${y} both;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.mushi-banner.top { top: 0; padding-top: env(safe-area-inset-top, 0px); }
|
|
1341
|
+
.mushi-banner.bottom { bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
|
|
1342
|
+
|
|
1343
|
+
/* --- neon variant (electric lime \u2014 dev / beta tool aesthetic) --- */
|
|
1344
|
+
.mushi-banner.neon {
|
|
1345
|
+
background: #0FFF50;
|
|
1346
|
+
color: #0a1a0a;
|
|
1347
|
+
border-bottom: 1.5px solid #00C43A;
|
|
1348
|
+
}
|
|
1349
|
+
.mushi-banner.neon.bottom {
|
|
1350
|
+
border-top: 1.5px solid #00C43A;
|
|
1351
|
+
border-bottom: none;
|
|
1352
|
+
}
|
|
1353
|
+
.mushi-banner.neon .mushi-banner-btn {
|
|
1354
|
+
background: rgba(0,0,0,0.14);
|
|
1355
|
+
color: #0a1a0a;
|
|
1356
|
+
border: 1px solid rgba(0,0,0,0.22);
|
|
1357
|
+
}
|
|
1358
|
+
.mushi-banner.neon .mushi-banner-btn:hover {
|
|
1359
|
+
background: rgba(0,0,0,0.22);
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
/* --- brand variant (widgetAccent \u2014 editorial, app-quality) --- */
|
|
1363
|
+
.mushi-banner.brand {
|
|
1364
|
+
background: ${d};
|
|
1365
|
+
color: #fff;
|
|
1366
|
+
border-bottom: 1.5px solid ${n?"#C4321E":"#B52F1F"};
|
|
1367
|
+
}
|
|
1368
|
+
.mushi-banner.brand.bottom {
|
|
1369
|
+
border-top: 1.5px solid ${n?"#C4321E":"#B52F1F"};
|
|
1370
|
+
border-bottom: none;
|
|
1371
|
+
}
|
|
1372
|
+
.mushi-banner.brand .mushi-banner-btn {
|
|
1373
|
+
background: rgba(255,255,255,0.18);
|
|
1374
|
+
color: #fff;
|
|
1375
|
+
border: 1px solid rgba(255,255,255,0.32);
|
|
1376
|
+
}
|
|
1377
|
+
.mushi-banner.brand .mushi-banner-btn:hover {
|
|
1378
|
+
background: rgba(255,255,255,0.28);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/* --- subtle variant (frosted-glass, muted \u2014 least disruptive) ---
|
|
1382
|
+
Uses the widget's own paper colour at high opacity + backdrop-blur so
|
|
1383
|
+
it blends with the host app while remaining legible. The previous 4-6%
|
|
1384
|
+
opacity values were effectively invisible \u2014 users could not distinguish
|
|
1385
|
+
the banner from the page content below it. */
|
|
1386
|
+
.mushi-banner.subtle {
|
|
1387
|
+
background: ${n?"rgba(15,14,12,0.88)":"rgba(248,244,237,0.92)"};
|
|
1388
|
+
backdrop-filter: blur(14px);
|
|
1389
|
+
-webkit-backdrop-filter: blur(14px);
|
|
1390
|
+
color: ${l};
|
|
1391
|
+
border-bottom: 1px solid ${f};
|
|
1392
|
+
}
|
|
1393
|
+
.mushi-banner.subtle.bottom {
|
|
1394
|
+
border-top: 1px solid ${f};
|
|
1395
|
+
border-bottom: none;
|
|
1396
|
+
}
|
|
1397
|
+
.mushi-banner.subtle .mushi-banner-btn {
|
|
1398
|
+
background: ${n?"rgba(242,235,221,0.10)":"rgba(14,13,11,0.08)"};
|
|
1399
|
+
color: ${l};
|
|
1400
|
+
border: 1px solid ${f};
|
|
1401
|
+
}
|
|
1402
|
+
.mushi-banner.subtle .mushi-banner-btn:hover {
|
|
1403
|
+
background: ${n?"rgba(242,235,221,0.18)":"rgba(14,13,11,0.14)"};
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
.mushi-banner-label {
|
|
1407
|
+
flex: 1;
|
|
1408
|
+
text-align: center;
|
|
1409
|
+
overflow: hidden;
|
|
1410
|
+
text-overflow: ellipsis;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/* Rich layout \u2014 pill + message + flat text actions (admin BetaBanner parity) */
|
|
1414
|
+
.mushi-banner--rich {
|
|
1415
|
+
justify-content: space-between;
|
|
1416
|
+
gap: 12px;
|
|
1417
|
+
min-height: 36px;
|
|
1418
|
+
height: auto;
|
|
1419
|
+
padding: 4px 12px 4px 16px;
|
|
1420
|
+
white-space: normal;
|
|
1421
|
+
}
|
|
1422
|
+
.mushi-banner-body {
|
|
1423
|
+
display: flex;
|
|
1424
|
+
align-items: center;
|
|
1425
|
+
gap: 8px;
|
|
1426
|
+
flex: 1;
|
|
1427
|
+
min-width: 0;
|
|
1428
|
+
overflow: hidden;
|
|
1429
|
+
}
|
|
1430
|
+
.mushi-banner-pill {
|
|
1431
|
+
display: inline-flex;
|
|
1432
|
+
flex-shrink: 0;
|
|
1433
|
+
align-items: center;
|
|
1434
|
+
padding: 1px 6px;
|
|
1435
|
+
border-radius: 3px;
|
|
1436
|
+
border: 1px solid currentColor;
|
|
1437
|
+
font-size: 10px;
|
|
1438
|
+
font-weight: 700;
|
|
1439
|
+
letter-spacing: 0.18em;
|
|
1440
|
+
text-transform: uppercase;
|
|
1441
|
+
opacity: 0.92;
|
|
1442
|
+
}
|
|
1443
|
+
.mushi-banner.neon .mushi-banner-pill {
|
|
1444
|
+
border-color: rgba(10,26,10,0.45);
|
|
1445
|
+
background: rgba(10,26,10,0.12);
|
|
1446
|
+
}
|
|
1447
|
+
.mushi-banner.brand .mushi-banner-pill {
|
|
1448
|
+
border-color: rgba(255,255,255,0.45);
|
|
1449
|
+
background: rgba(255,255,255,0.14);
|
|
1450
|
+
}
|
|
1451
|
+
.mushi-banner.subtle .mushi-banner-pill {
|
|
1452
|
+
border-color: ${f};
|
|
1453
|
+
background: ${n?"rgba(242,235,221,0.08)":"rgba(14,13,11,0.06)"};
|
|
1454
|
+
}
|
|
1455
|
+
.mushi-banner-message {
|
|
1456
|
+
min-width: 0;
|
|
1457
|
+
overflow: hidden;
|
|
1458
|
+
text-overflow: ellipsis;
|
|
1459
|
+
white-space: nowrap;
|
|
1460
|
+
font-size: 12px;
|
|
1461
|
+
font-weight: 500;
|
|
1462
|
+
line-height: 1.3;
|
|
1463
|
+
opacity: 0.9;
|
|
1464
|
+
}
|
|
1465
|
+
.mushi-banner-actions {
|
|
1466
|
+
display: inline-flex;
|
|
1467
|
+
align-items: center;
|
|
1468
|
+
gap: 0;
|
|
1469
|
+
/* Shrinkable + swipe-scrollable so a long action row can never push
|
|
1470
|
+
past the viewport edge (dismiss sits outside this nav). */
|
|
1471
|
+
flex-shrink: 1;
|
|
1472
|
+
min-width: 0;
|
|
1473
|
+
overflow-x: auto;
|
|
1474
|
+
scrollbar-width: none;
|
|
1475
|
+
font-size: 11px;
|
|
1476
|
+
}
|
|
1477
|
+
.mushi-banner-actions::-webkit-scrollbar { display: none; }
|
|
1478
|
+
@media (max-width: 480px) {
|
|
1479
|
+
/* Phones: keep only the primary bug CTA (+ dismiss outside the nav). */
|
|
1480
|
+
.mushi-banner-actions .mushi-banner-extra { display: none; }
|
|
1481
|
+
}
|
|
1482
|
+
.mushi-banner-link {
|
|
1483
|
+
display: inline-flex;
|
|
1484
|
+
align-items: center;
|
|
1485
|
+
padding: 2px 8px;
|
|
1486
|
+
border: none;
|
|
1487
|
+
background: transparent;
|
|
1488
|
+
color: inherit;
|
|
1489
|
+
cursor: pointer;
|
|
1490
|
+
font: inherit;
|
|
1491
|
+
letter-spacing: inherit;
|
|
1492
|
+
text-decoration: none;
|
|
1493
|
+
opacity: 0.88;
|
|
1494
|
+
transition: opacity 0.15s ease;
|
|
1495
|
+
flex-shrink: 0;
|
|
1496
|
+
}
|
|
1497
|
+
.mushi-banner-link:hover { opacity: 1; }
|
|
1498
|
+
.mushi-banner-link:focus-visible {
|
|
1499
|
+
outline: 2px solid ${d};
|
|
1500
|
+
outline-offset: 2px;
|
|
1501
|
+
border-radius: 2px;
|
|
1502
|
+
}
|
|
1503
|
+
.mushi-banner-divider {
|
|
1504
|
+
opacity: 0.28;
|
|
1505
|
+
padding: 0 1px;
|
|
1506
|
+
user-select: none;
|
|
1507
|
+
flex-shrink: 0;
|
|
1508
|
+
}
|
|
1509
|
+
.mushi-banner--rich .mushi-banner-dismiss {
|
|
1510
|
+
margin-left: 4px;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
.mushi-banner-btn {
|
|
1514
|
+
display: inline-flex;
|
|
1515
|
+
align-items: center;
|
|
1516
|
+
gap: 4px;
|
|
1517
|
+
padding: 3px 10px;
|
|
1518
|
+
border-radius: 3px;
|
|
1519
|
+
cursor: pointer;
|
|
1520
|
+
font: inherit;
|
|
1521
|
+
letter-spacing: inherit;
|
|
1522
|
+
transition: background 0.15s ease, opacity 0.15s ease;
|
|
1523
|
+
flex-shrink: 0;
|
|
1524
|
+
height: 24px;
|
|
1525
|
+
line-height: 1;
|
|
1526
|
+
}
|
|
1527
|
+
.mushi-banner-btn:focus-visible {
|
|
1528
|
+
outline: 2px solid ${d};
|
|
1529
|
+
outline-offset: 2px;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
.mushi-banner-dismiss {
|
|
1533
|
+
background: transparent !important;
|
|
1534
|
+
border: none !important;
|
|
1535
|
+
opacity: 0.65;
|
|
1536
|
+
cursor: pointer;
|
|
1537
|
+
font-size: 14px;
|
|
1538
|
+
line-height: 1;
|
|
1539
|
+
padding: 4px 8px;
|
|
1540
|
+
margin-left: auto;
|
|
1541
|
+
flex-shrink: 0;
|
|
1542
|
+
color: inherit;
|
|
1543
|
+
border-radius: 3px;
|
|
1544
|
+
transition: opacity 0.15s, background 0.15s;
|
|
1545
|
+
}
|
|
1546
|
+
.mushi-banner-dismiss:hover {
|
|
1547
|
+
opacity: 1;
|
|
1548
|
+
background: rgba(0,0,0,0.12) !important;
|
|
1549
|
+
}
|
|
1550
|
+
.mushi-banner.neon .mushi-banner-dismiss:hover { background: rgba(0,0,0,0.18) !important; }
|
|
1551
|
+
|
|
1552
|
+
@keyframes mushi-banner-slide-in {
|
|
1553
|
+
from { transform: translateY(calc(-1 * 100%)); opacity: 0.5; }
|
|
1554
|
+
to { transform: translateY(0); opacity: 1; }
|
|
1555
|
+
}
|
|
1556
|
+
.mushi-banner.bottom {
|
|
1557
|
+
animation-name: mushi-banner-slide-in-bottom;
|
|
1558
|
+
}
|
|
1559
|
+
@keyframes mushi-banner-slide-in-bottom {
|
|
1560
|
+
from { transform: translateY(100%); opacity: 0.5; }
|
|
1561
|
+
to { transform: translateY(0); opacity: 1; }
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1565
|
+
*,
|
|
1566
|
+
*::before,
|
|
1567
|
+
*::after {
|
|
1568
|
+
animation-duration: 0.001ms !important;
|
|
1569
|
+
animation-iteration-count: 1 !important;
|
|
1570
|
+
transition-duration: 0.001ms !important;
|
|
1571
|
+
}
|
|
1572
|
+
.mushi-success-stamp circle { stroke-dashoffset: 0; }
|
|
1573
|
+
.mushi-success-stamp-label { opacity: 1; }
|
|
1574
|
+
.mushi-success-pts-award { opacity: 1; }
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
.mushi-community-footer{display:flex;align-items:center;gap:8px;padding:10px 0 2px;border-top:1px solid ${n?"rgba(255,255,255,0.07)":"rgba(0,0,0,0.07)"};margin-top:8px;flex-wrap:wrap}
|
|
1578
|
+
.mushi-community-btn{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1579
|
+
.mushi-link-btn{background:none;border:none;padding:4px 2px;cursor:pointer;color:${d};font-size:12px;font-family:${S};text-decoration:underline;text-underline-offset:2px}
|
|
1580
|
+
.mushi-link-btn:hover{opacity:0.8}
|
|
1581
|
+
.mushi-link-btn:focus-visible,.mushi-nav-item:focus-visible{outline:2px solid ${d};outline-offset:2px;border-radius:2px}
|
|
1582
|
+
.mushi-nav-item{display:block;width:100%;text-align:left;background:${n?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)"};border:1px solid ${n?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)"};border-radius:8px;padding:10px 14px;margin-bottom:8px;cursor:pointer;font-size:13px;color:${l};transition:background .15s,border-color .15s}
|
|
1583
|
+
.mushi-nav-item:hover{background:${n?"rgba(255,255,255,0.09)":"rgba(0,0,0,0.07)"}}
|
|
1584
|
+
.mushi-account-card{display:flex;align-items:center;gap:12px;background:${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)"};border-radius:10px;padding:12px 14px;margin-bottom:14px}
|
|
1585
|
+
.mushi-account-avatar{width:40px;height:40px;border-radius:50%;background:${b};color:${R};display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;flex-shrink:0}
|
|
1586
|
+
.mushi-account-info{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
1587
|
+
.mushi-account-info strong{font:700 14px/1.3 inherit;color:${l}}
|
|
1588
|
+
.mushi-account-rank,.mushi-xapp-app-name,.mushi-label{font-size:12px;color:${g};font-family:${S}}
|
|
1589
|
+
.mushi-account-rank{display:block}
|
|
1590
|
+
.mushi-xapp-app-name{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;margin:0 0 6px}
|
|
1591
|
+
.mushi-xapp-group{margin-bottom:14px}
|
|
1592
|
+
.mushi-label{display:block;font-weight:600;margin-bottom:6px}
|
|
1593
|
+
|
|
1594
|
+
/* \u2500\u2500 Assistant tab (P5) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1595
|
+
.mushi-assistant{display:flex;flex-direction:column;height:100%;min-height:0;max-height:60vh}
|
|
1596
|
+
.mushi-assistant-log{flex:1;min-height:120px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:4px 2px 8px}
|
|
1597
|
+
.mushi-assistant-greeting{font:400 14px/1.5 ${x};color:${m};padding:6px 2px}
|
|
1598
|
+
.mushi-assistant-suggestions{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
|
|
1599
|
+
.mushi-assistant-chip{background:${b};color:${R};border:1px solid ${f};border-radius:999px;padding:5px 12px;font-size:12px;cursor:pointer;font-family:${x};transition:background .15s}
|
|
1600
|
+
.mushi-assistant-chip:hover{background:${n?"rgba(255,90,71,0.22)":"rgba(224,60,44,0.14)"}}
|
|
1601
|
+
.mushi-assistant-chip:focus-visible{outline:2px solid ${d};outline-offset:2px}
|
|
1602
|
+
.mushi-assistant-msg{max-width:85%;padding:8px 12px;border-radius:12px;font:400 14px/1.45 ${x};white-space:pre-wrap;word-break:break-word}
|
|
1603
|
+
.mushi-assistant-msg-user{align-self:flex-end;background:${d};color:#fff;border-bottom-right-radius:4px}
|
|
1604
|
+
.mushi-assistant-msg-bot{align-self:flex-start;background:${n?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)"};color:${l};border-bottom-left-radius:4px}
|
|
1605
|
+
.mushi-assistant-thinking{opacity:0.6;font-size:18px;letter-spacing:2px}
|
|
1606
|
+
.mushi-assistant-error{align-self:flex-start;color:${n?"#F87171":"#DC2626"};font-size:12px;padding:4px 2px}
|
|
1607
|
+
.mushi-assistant-form{display:flex;align-items:flex-end;gap:8px;border-top:1px solid ${h};padding-top:8px}
|
|
1608
|
+
.mushi-assistant-input{flex:1;resize:none;max-height:120px;border:1px solid ${f};border-radius:10px;padding:8px 12px;font:400 14px/1.4 ${x};background:${o};color:${l}}
|
|
1609
|
+
.mushi-assistant-input:focus-visible{outline:2px solid ${d};outline-offset:1px}
|
|
1610
|
+
.mushi-assistant-submit{flex-shrink:0;width:36px;height:36px;border:none;border-radius:50%;background:${d};color:#fff;font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .15s,opacity .15s}
|
|
1611
|
+
.mushi-assistant-submit:hover{transform:translateY(-1px)}
|
|
1612
|
+
.mushi-assistant-submit:disabled{opacity:0.5;cursor:default;transform:none}
|
|
1613
|
+
.mushi-assistant-submit:focus-visible{outline:2px solid ${d};outline-offset:2px}
|
|
1614
|
+
`}var he="@mushi-mushi/web",Z="1.16.0";var He={bug:"\u26A0\uFE0F",slow:"\u{1F40C}",visual:"\u{1F3A8}",confusing:"\u{1F615}",other:"\u{1F4DD}"},ot="Feature request";function it(t){switch(t){case "new":case "queued":case "pending":case "submitted":return "Sent";case "classified":case "triaged":case "grouped":case "dispatched":return "Review";case "fixing":return "Fixing";case "fixed":case "resolved":case "completed":return "Fixed";case "dismissed":return "Closed";default:return t.replace(/_/g," ").slice(0,12)}}function vr(t){switch(t){case "new":case "queued":case "pending":case "submitted":return "Submitted";case "classified":case "triaged":case "grouped":case "dispatched":return "In review";case "fixing":return "Fix in progress";case "fixed":case "resolved":case "completed":return "Fixed \u2014 confirm?";case "verified":return "Verified";case "reopened":return "Reopened";case "dismissed":return "Closed";default:return t.replace(/_/g," ")}}function Be(t){switch(t){case "new":case "queued":case "pending":case "submitted":return "sent";case "classified":case "triaged":case "grouped":case "dispatched":return "review";case "fixing":return "fixing";case "fixed":case "resolved":case "completed":return "fixed";case "verified":return "fixed";case "reopened":return "fixing";case "dismissed":return "closed";default:return "unknown"}}function Ne(t){let e=Date.parse(t);if(Number.isNaN(e))return "";let r=Date.now()-e;if(r<0)return "just now";let n=Math.floor(r/1e3);if(n<60)return "just now";let s=Math.floor(n/60);if(s<60)return `${s}m ago`;let i=Math.floor(s/60);if(i<24)return `${i}h ago`;let a=Math.floor(i/24);if(a<7)return `${a}d ago`;let o=Math.floor(a/7);return o<5?`${o}w ago`:new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Fe(t){return t<10?`0${t}`:String(t)}var Te=3,me={category:1,intent:2,details:3};function wr(t){return (t.metaKey||t.ctrlKey)&&t.key==="Enter"}function E(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Sr(t){switch(t.step){case "category":return us(t);case "intent":return ws(t);case "details":return xs(t);case "success":return Ss(t);case "reports":return ms(t);case "report-detail":return vs(t);case "leaderboard":return fs(t);case "roadmap":return gs(t);case "account":return bs(t);case "cross-app-reports":return ys(t);case "assistant":return cs(t)}}function cs(t){let e=t.callbacks.assistantLabel||"Ask",r=t.callbacks.assistantGreeting||"Ask me anything about this app.",n=t.callbacks.assistantSuggestions??[],i=t.assistantTurns.length===0?`<div class="mushi-assistant-greeting">${E(r)}</div>
|
|
1615
|
+
${n.length?`<div class="mushi-assistant-suggestions">${n.map(l=>`<button type="button" class="mushi-assistant-chip" data-action="assistant-suggest" data-value="${E(l)}">${E(l)}</button>`).join("")}</div>`:""}`:t.assistantTurns.map(l=>{let m=l.role==="user"?"mushi-assistant-msg-user":"mushi-assistant-msg-bot",c=l.options&&l.options.length?`<div class="mushi-assistant-suggestions">${l.options.map(g=>`<button type="button" class="mushi-assistant-chip" data-action="assistant-suggest" data-value="${E(g)}">${E(g)}</button>`).join("")}</div>`:"";return `<div class="mushi-assistant-msg ${m}">${E(l.text)}</div>${c}`}).join(""),a=t.assistantSending?'<div class="mushi-assistant-msg mushi-assistant-msg-bot mushi-assistant-thinking">\u2026</div>':"",o=t.assistantError?`<div class="mushi-assistant-error" role="alert">${E(t.assistantError)}</div>`:"";return `
|
|
1616
|
+
${Q(t,{title:e,showBack:true})}
|
|
1617
|
+
<div class="mushi-assistant">
|
|
1618
|
+
<div class="mushi-assistant-log">
|
|
1619
|
+
${i}
|
|
1620
|
+
${a}
|
|
1621
|
+
${o}
|
|
1622
|
+
</div>
|
|
1623
|
+
<form class="mushi-assistant-form" data-action="assistant-send">
|
|
1624
|
+
<textarea
|
|
1625
|
+
class="mushi-assistant-input"
|
|
1626
|
+
rows="1"
|
|
1627
|
+
placeholder="Type your question\u2026"
|
|
1628
|
+
${t.assistantSending?"disabled":""}
|
|
1629
|
+
></textarea>
|
|
1630
|
+
<button type="submit" class="mushi-assistant-submit" ${t.assistantSending?"disabled":""} aria-label="Send">\u2191</button>
|
|
1631
|
+
</form>
|
|
1632
|
+
</div>
|
|
1633
|
+
`}function Er(t){if(!t.sdkFreshness||t.config.outdatedBanner==="off"||t.config.outdatedBanner==="console-only")return "";let{latest:e,current:r,deprecated:n,message:s}=t.sdkFreshness;return !e&&!n?"":`
|
|
1634
|
+
<div class="mushi-outdated" role="status">
|
|
1635
|
+
<strong>Mushi SDK ${E(r)}</strong>
|
|
1636
|
+
${e?`latest is ${E(e)}.`:"needs attention."}
|
|
1637
|
+
${s?`<span>${E(s)}</span>`:""}
|
|
1638
|
+
</div>
|
|
1639
|
+
`}function kr(t){return t.config.brandFooter===false?"":`<div class="mushi-brand-footer">Powered by Mushi v${E(t.sdkVersion)}</div>`}function Q(t,e){let r=t.locale,{title:n,showBack:s=false,step:i,eyebrow:a}=e,o=s?`<button type="button" class="mushi-back" data-action="back" aria-label="${r.widget.back}">\u2190</button>`:`<span class="mushi-header-eyebrow">${a??"Mushi \xB7 Report"}</span>`,l=i?`<span class="mushi-step-counter" aria-label="Step ${i} of ${Te}"><b>${Fe(i)}</b> / ${Fe(Te)}</span>`:"";return `
|
|
1640
|
+
<div class="mushi-header">
|
|
1641
|
+
<div class="mushi-header-mark" aria-hidden="true">\u866B</div>
|
|
1642
|
+
<div class="mushi-header-titles">
|
|
1643
|
+
${o}
|
|
1644
|
+
<h3>${n}</h3>
|
|
1645
|
+
</div>
|
|
1646
|
+
<div class="mushi-header-meta">
|
|
1647
|
+
${l}
|
|
1648
|
+
<button type="button" class="mushi-close" data-action="close" aria-label="${r.widget.close}">\u2715</button>
|
|
1649
|
+
</div>
|
|
1650
|
+
</div>
|
|
1651
|
+
`}function at(t,e){let r=[];for(let n=1;n<=Te;n++){let s=n<e?"mushi-step-num done":n===e?"mushi-step-num active":"mushi-step-num";r.push(`<span class="${s}">${Fe(n)}</span>`),n<Te&&r.push('<span class="mushi-step-sep" aria-hidden="true"></span>');}return `<div class="mushi-step-indicator" aria-hidden="true">${r.join("")}</div>`}function us(t){let e=t.locale,n=(t.config.categories&&t.config.categories.length>0?t.config.categories.map(s=>({id:s.id,icon:s.icon??"\u{1F4AC}",label:s.label,desc:s.description??""})):["bug","slow","visual","confusing","other"].map(s=>({id:s,icon:He[s],label:e.step1.categories[s],desc:e.step1.categoryDescriptions[s]}))).map(({id:s,icon:i,label:a,desc:o})=>`
|
|
1652
|
+
<button type="button" class="mushi-option-btn" data-category="${E(s)}" role="radio" aria-checked="false">
|
|
1653
|
+
<span class="mushi-option-icon" aria-hidden="true">${E(i)}</span>
|
|
1654
|
+
<div class="mushi-option-text">
|
|
1655
|
+
<span class="mushi-option-label">${E(a)}</span>
|
|
1656
|
+
${o?`<span class="mushi-option-desc">${E(o)}</span>`:""}
|
|
1657
|
+
</div>
|
|
1658
|
+
<span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
|
|
1659
|
+
</button>
|
|
1660
|
+
`).join("");return `
|
|
1661
|
+
${Q(t,{title:e.step1.heading,step:me.category})}
|
|
1662
|
+
${t.config.betaMode?.enabled?hs(t):""}
|
|
1663
|
+
<div class="mushi-body" role="radiogroup" aria-label="${e.step1.heading}">
|
|
1664
|
+
<button type="button" class="mushi-option-btn mushi-reports-entry" data-action="reports">
|
|
1665
|
+
<span class="mushi-option-icon" aria-hidden="true">\u{1F4EC}</span>
|
|
1666
|
+
<div class="mushi-option-text">
|
|
1667
|
+
<span class="mushi-option-label">Your reports${t.unreadCount()?` (${t.unreadCount()} new)`:""}</span>
|
|
1668
|
+
<span class="mushi-option-desc">See status, developer replies, and respond</span>
|
|
1669
|
+
</div>
|
|
1670
|
+
<span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
|
|
1671
|
+
</button>
|
|
1672
|
+
${ds(t)}
|
|
1673
|
+
${t.callbacks.onFeatureBoardRequest?`
|
|
1674
|
+
<button type="button" class="mushi-option-btn" data-action="roadmap">
|
|
1675
|
+
<span class="mushi-option-icon" aria-hidden="true">\u{1F5F3}\uFE0F</span>
|
|
1676
|
+
<div class="mushi-option-text">
|
|
1677
|
+
<span class="mushi-option-label">Community ideas</span>
|
|
1678
|
+
<span class="mushi-option-desc">Vote on features and see what shipped</span>
|
|
1679
|
+
</div>
|
|
1680
|
+
<span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
|
|
1681
|
+
</button>`:""}
|
|
1682
|
+
${n}
|
|
1683
|
+
${t.rewardsState?Rs(t):""}
|
|
1684
|
+
<div class="mushi-community-footer">
|
|
1685
|
+
<button type="button" class="mushi-link-btn mushi-community-btn" data-action="open-account">
|
|
1686
|
+
${t.testerInfo?`\u{1F464} ${E(t.testerInfo.public_handle??t.testerInfo.display_name??"My account")}`:"\u{1F310} Join community \xB7 Track reports across apps"}
|
|
1687
|
+
</button>
|
|
1688
|
+
${t.rewardsState?'<button type="button" class="mushi-link-btn" data-action="open-leaderboard">\u{1F3C6} Leaderboard</button>':""}
|
|
1689
|
+
</div>
|
|
1690
|
+
</div>
|
|
1691
|
+
${at(t,me.category)}
|
|
1692
|
+
`}function ds(t){if(!(t.config.featureRequestCard!==false))return "";let r=t.config.featureRequestLabel||"Feature request",n=t.config.featureRequestDescription||"Suggest something new \u2014 even rough ideas help us prioritise";return `
|
|
1693
|
+
<button
|
|
1694
|
+
type="button"
|
|
1695
|
+
class="mushi-option-btn mushi-feature-entry"
|
|
1696
|
+
data-action="feature-request"
|
|
1697
|
+
aria-label="${E(r)}"
|
|
1698
|
+
>
|
|
1699
|
+
<span class="mushi-option-icon" aria-hidden="true">\u2728</span>
|
|
1700
|
+
<div class="mushi-option-text">
|
|
1701
|
+
<span class="mushi-option-label">${E(r)}</span>
|
|
1702
|
+
<span class="mushi-option-desc">${E(n)}</span>
|
|
1703
|
+
</div>
|
|
1704
|
+
<span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
|
|
1705
|
+
</button>
|
|
1706
|
+
`}function ps(t){let e=t.config.betaMode?.changelogItems;if(!e?.length)return "";let r=e[0],n=r.items.map(i=>`<li>\u2022 ${E(i)}</li>`).join("");return `
|
|
1707
|
+
<details class="mushi-changelog">
|
|
1708
|
+
<summary class="mushi-changelog-summary">${r.date?`What\u2019s new in ${E(r.version)} \xB7 ${E(r.date)}`:`What\u2019s new in ${E(r.version)}`}</summary>
|
|
1709
|
+
<ul class="mushi-changelog-list">${n}</ul>
|
|
1710
|
+
</details>
|
|
1711
|
+
`}function hs(t){let e=t.config.betaMode,r=E(e.appName??"This app"),n=e.message?E(e.message):`${r} is in early development \u2014 updates ship weekly`,s=e.contactEmail?E(e.contactEmail):null,i=e.perks??[];return `
|
|
1712
|
+
<div class="mushi-beta-strip" role="note" aria-label="Beta status">
|
|
1713
|
+
<div class="mushi-beta-strip-row">
|
|
1714
|
+
<span class="mushi-beta-tag" aria-hidden="true">BETA</span>
|
|
1715
|
+
<span class="mushi-beta-msg">${n}</span>
|
|
1716
|
+
</div>
|
|
1717
|
+
${s?`<div class="mushi-beta-contact-hint">Reports go to ${s} \xB7 reviewed by the team</div>`:""}
|
|
1718
|
+
${i.length>0?`
|
|
1719
|
+
<ul class="mushi-beta-perks" aria-label="Beta tester perks">
|
|
1720
|
+
${i.map(a=>`<li>\u2713 ${E(a)}</li>`).join("")}
|
|
1721
|
+
</ul>
|
|
1722
|
+
`:""}
|
|
1723
|
+
${ps(t)}
|
|
1724
|
+
</div>
|
|
1725
|
+
`}function ms(t){let e=t.reporterReports.map(n=>{let s=n.summary??n.description??`Report ${n.id.slice(0,8)}`,i=Be(n.status),a=Ne(n.created_at),o=n.unread_count&&n.unread_count>0?`<span class="mushi-unread-badge" aria-label="${n.unread_count} unread">${n.unread_count}</span>`:"";return `
|
|
1726
|
+
<button type="button" class="mushi-report-row" data-report-id="${E(n.id)}" aria-label="View report: ${E(s)}">
|
|
1727
|
+
<div class="mushi-report-main">
|
|
1728
|
+
<span class="mushi-report-title">${E(s)}</span>
|
|
1729
|
+
<span class="mushi-report-meta">
|
|
1730
|
+
<span class="mushi-report-status mushi-status-${i}">${E(it(n.status))}</span>
|
|
1731
|
+
${a?`<span class="mushi-report-when">${E(a)}</span>`:""}
|
|
1732
|
+
${o}
|
|
1733
|
+
</span>
|
|
1734
|
+
</div>
|
|
1735
|
+
<span class="mushi-report-chevron" aria-hidden="true">\u203A</span>
|
|
1736
|
+
</button>`}).join(""),r=t.rewardsState?'<button type="button" class="mushi-leaderboard-link" data-action="open-leaderboard">\u{1F3C6} Leaderboard</button>':"";return `
|
|
1737
|
+
${Q(t,{title:"Your reports",showBack:true,eyebrow:"Mushi \xB7 Inbox"})}
|
|
1738
|
+
<div class="mushi-body">
|
|
1739
|
+
${t.reporterLoading?'<p class="mushi-muted">Loading reports\u2026</p>':""}
|
|
1740
|
+
${t.reporterError?`<p class="mushi-error-inline">${E(t.reporterError)}</p>`:""}
|
|
1741
|
+
${e||(t.reporterLoading?"":'<p class="mushi-muted">No reports from this browser yet.</p>')}
|
|
1742
|
+
${r}
|
|
1743
|
+
</div>
|
|
1744
|
+
`}function gs(t){let e=t.featureBoard.map(r=>{let n=String(r.id??""),s=E(String(r.subject??"Untitled idea")),i=Number(r.vote_count??0),a=!!r.shipped_at,o=!!r.my_vote,l=a?"Shipped":String(r.status_label??r.status??"open");return `
|
|
1745
|
+
<div class="mushi-report-row mushi-roadmap-row">
|
|
1746
|
+
<div class="mushi-report-main">
|
|
1747
|
+
<span class="mushi-report-title">${s}</span>
|
|
1748
|
+
<span class="mushi-report-meta">
|
|
1749
|
+
<span class="mushi-report-status">${E(l)}</span>
|
|
1750
|
+
<span class="mushi-report-when">${i} vote${i===1?"":"s"}</span>
|
|
1751
|
+
</span>
|
|
1752
|
+
</div>
|
|
1753
|
+
${t.callbacks.onFeatureBoardVote?`
|
|
1754
|
+
<button type="button" class="mushi-vote-btn" data-vote-id="${E(n)}" aria-pressed="${o}">
|
|
1755
|
+
${o?"Voted":"Vote"}
|
|
1756
|
+
</button>`:""}
|
|
1757
|
+
</div>`}).join("");return `
|
|
1758
|
+
${Q(t,{title:"Community ideas",showBack:true,eyebrow:"Mushi \xB7 Roadmap"})}
|
|
1759
|
+
<div class="mushi-body">
|
|
1760
|
+
${t.reporterLoading?'<p class="mushi-muted">Loading ideas\u2026</p>':""}
|
|
1761
|
+
${t.reporterError?`<p class="mushi-error-inline">${E(t.reporterError)}</p>`:""}
|
|
1762
|
+
${e||(t.reporterLoading?"":'<p class="mushi-muted">No community ideas yet. Be the first to suggest one.</p>')}
|
|
1763
|
+
</div>
|
|
1764
|
+
`}function fs(t){let e=t.globalLeaderboard!==null||t.globalLeaderboardLoading,r=e?t.globalLeaderboard??[]:(t.leaderboardEntries??[]).map(o=>({tester_id:"",public_handle:null,display_name:o.display_name,rank:0,points_30d:o.points_30d,total_points:o.total_points})),n=e?t.globalLeaderboardLoading:t.leaderboardLoading,s=t.testerReputation?.rank??null,i=r.map((o,l)=>{let m=o.rank||l+1,c=t.testerReputation&&o.tester_id===t.testerReputation.tester_id;return `
|
|
1765
|
+
<div class="mushi-lb-row ${m===1?"mushi-lb-top":""}${c?" mushi-lb-me":""}">
|
|
1766
|
+
<span class="mushi-lb-rank">#${m}</span>
|
|
1767
|
+
<span class="mushi-lb-name">${E(o.public_handle??o.display_name??"Anon")}</span>
|
|
1768
|
+
<span class="mushi-lb-pts">${(o.points_30d??o.total_points).toLocaleString()} pts</span>
|
|
1769
|
+
</div>
|
|
1770
|
+
`}).join(""),a=s?`<div class="mushi-lb-myrank">You are ranked <strong>#${s}</strong> this month</div>`:t.testerJwt?"":'<button type="button" class="mushi-link-btn" data-action="open-account">Sign in to see your rank \u2192</button>';return `
|
|
1771
|
+
${Q(t,{title:"\u{1F3C6} Global Leaderboard",showBack:true,eyebrow:"Mushi \xB7 Community"})}
|
|
1772
|
+
<div class="mushi-body">
|
|
1773
|
+
${n?'<p class="mushi-muted">Loading leaderboard\u2026</p>':""}
|
|
1774
|
+
${!n&&!r.length?'<p class="mushi-muted">No contributors yet \u2014 be the first!</p>':""}
|
|
1775
|
+
<div class="mushi-lb-list">${i}</div>
|
|
1776
|
+
${a}
|
|
1777
|
+
<p class="mushi-lb-note">Global contributors this month \xB7 Points refresh monthly</p>
|
|
1778
|
+
</div>
|
|
1779
|
+
`}function bs(t){let e=t.testerInfo;if(e){let r=e.public_handle??e.display_name??"Tester",n=t.testerReputation;return `
|
|
1780
|
+
${Q(t,{title:"\u866B Mushi Account",showBack:true,eyebrow:"Mushi \xB7 Identity"})}
|
|
1781
|
+
<div class="mushi-body">
|
|
1782
|
+
<div class="mushi-account-card">
|
|
1783
|
+
<div class="mushi-account-avatar">${E(r.charAt(0).toUpperCase())}</div>
|
|
1784
|
+
<div class="mushi-account-info">
|
|
1785
|
+
<strong>${E(r)}</strong>
|
|
1786
|
+
${n?`<span class="mushi-account-rank">Rank #${n.rank??"\u2014"} \xB7 ${(n.points_30d??0).toLocaleString()} pts this month</span>`:""}
|
|
1787
|
+
</div>
|
|
1788
|
+
</div>
|
|
1789
|
+
<button type="button" class="mushi-nav-item" data-action="open-cross-app-reports">
|
|
1790
|
+
My reports across all apps \u2192
|
|
1791
|
+
</button>
|
|
1792
|
+
<button type="button" class="mushi-nav-item" data-action="open-global-leaderboard">
|
|
1793
|
+
View global leaderboard \u2192
|
|
1794
|
+
</button>
|
|
1795
|
+
<button type="button" class="mushi-link-btn" data-action="sign-out-tester">Sign out</button>
|
|
1796
|
+
</div>
|
|
1797
|
+
`}return t.magicLinkSent?`
|
|
1798
|
+
${Q(t,{title:"\u866B Check your email",showBack:true,eyebrow:"Mushi \xB7 Sign in"})}
|
|
1799
|
+
<div class="mushi-body">
|
|
1800
|
+
<p class="mushi-muted">We sent a sign-in link to <strong>${E(t.magicLinkEmail)}</strong>. Click it to connect your reports across apps and join the community.</p>
|
|
1801
|
+
<button type="button" class="mushi-link-btn" data-action="resend-magic-link">Resend email</button>
|
|
1802
|
+
${t.magicLinkError?`<p class="mushi-error">${E(t.magicLinkError)}</p>`:""}
|
|
1803
|
+
</div>
|
|
1804
|
+
`:`
|
|
1805
|
+
${Q(t,{title:"\u866B Join the community",showBack:true,eyebrow:"Mushi \xB7 Sign in"})}
|
|
1806
|
+
<div class="mushi-body">
|
|
1807
|
+
<p class="mushi-muted">Sign in to see your reports across all apps and climb the global leaderboard. No password needed.</p>
|
|
1808
|
+
<label class="mushi-label" for="mushi-email-input">Email address</label>
|
|
1809
|
+
<input
|
|
1810
|
+
id="mushi-email-input"
|
|
1811
|
+
type="email"
|
|
1812
|
+
class="mushi-textarea"
|
|
1813
|
+
data-role="magic-link-email"
|
|
1814
|
+
placeholder="you@example.com"
|
|
1815
|
+
autocomplete="email"
|
|
1816
|
+
value="${E(t.magicLinkEmail)}"
|
|
1817
|
+
style="padding: 10px 12px; height: auto; resize: none;"
|
|
1818
|
+
/>
|
|
1819
|
+
${t.magicLinkError?`<p class="mushi-error">${E(t.magicLinkError)}</p>`:""}
|
|
1820
|
+
<button type="button" class="mushi-submit" data-action="send-magic-link"${t.magicLinkSending?' disabled aria-disabled="true"':""}>
|
|
1821
|
+
<span>${t.magicLinkSending?"Sending\u2026":"Send sign-in link"}</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
|
|
1822
|
+
</button>
|
|
1823
|
+
</div>
|
|
1824
|
+
`}function ys(t){let e=t.crossAppReports??[],r=new Map;for(let s of e){let i=s.project_id??"unknown";r.has(i)||r.set(i,{name:s.app_name??"Unknown App",reports:[]}),r.get(i).reports.push(s);}let n=[...r.entries()].map(([,s])=>`
|
|
1825
|
+
<div class="mushi-xapp-group">
|
|
1826
|
+
<h4 class="mushi-xapp-app-name">${E(s.name)}</h4>
|
|
1827
|
+
${s.reports.map(i=>{let a=Be(i.status);return `
|
|
1828
|
+
<div class="mushi-report-row" data-report-id="${E(i.id)}" tabindex="0" role="button">
|
|
1829
|
+
<span class="mushi-report-status mushi-status-${a}">${E(it(i.status))}</span>
|
|
1830
|
+
<span class="mushi-report-title">${E(i.title??i.category)}</span>
|
|
1831
|
+
<span class="mushi-report-when">${E(Ne(i.created_at))}</span>
|
|
1832
|
+
</div>
|
|
1833
|
+
`}).join("")}
|
|
1834
|
+
</div>
|
|
1835
|
+
`).join("");return `
|
|
1836
|
+
${Q(t,{title:"My reports",showBack:true,eyebrow:"Mushi \xB7 All apps"})}
|
|
1837
|
+
<div class="mushi-body">
|
|
1838
|
+
${t.crossAppLoading?'<p class="mushi-muted">Loading your reports\u2026</p>':""}
|
|
1839
|
+
${!t.crossAppLoading&&!e.length?'<p class="mushi-muted">No reports filed yet.</p>':""}
|
|
1840
|
+
${n}
|
|
1841
|
+
</div>
|
|
1842
|
+
`}function vs(t){let e=t.reporterReports.find(a=>a.id===t.selectedReportId),r=e?.status??"unknown",n=Be(r),s=e?.created_at?Ne(e.created_at):"",i=t.reporterComments.map(a=>`
|
|
1843
|
+
<div class="mushi-thread-comment ${a.author_kind}">
|
|
1844
|
+
<strong>${E(a.author_kind==="reporter"?"You":a.author_name??"Developer")}</strong>
|
|
1845
|
+
<p>${E(a.body)}</p>
|
|
1846
|
+
</div>
|
|
1847
|
+
`).join("");return `
|
|
1848
|
+
${Q(t,{title:"Report thread",showBack:true,eyebrow:"Mushi \xB7 Inbox"})}
|
|
1849
|
+
<div class="mushi-body">
|
|
1850
|
+
<div class="mushi-thread-summary">
|
|
1851
|
+
<div class="mushi-thread-summary-meta">
|
|
1852
|
+
<span class="mushi-report-status mushi-status-${n}">${E(vr(r))}</span>
|
|
1853
|
+
${s?`<span class="mushi-report-when">Reported ${E(s)}</span>`:""}
|
|
1854
|
+
</div>
|
|
1855
|
+
<p>${E(e?.summary??e?.description??"Report details")}</p>
|
|
1856
|
+
</div>
|
|
1857
|
+
<div class="mushi-thread">
|
|
1858
|
+
${t.reporterLoading?'<p class="mushi-muted">Loading thread\u2026</p>':i||'<p class="mushi-muted">No developer replies yet.</p>'}
|
|
1859
|
+
</div>
|
|
1860
|
+
${["fixed","resolved","verified"].includes(r)?`
|
|
1861
|
+
<div class="mushi-verify-actions" role="group" aria-label="Fix verification">
|
|
1862
|
+
<button type="button" class="mushi-intent-btn" data-action="reporter-confirms">Yes, fixed for me</button>
|
|
1863
|
+
<button type="button" class="mushi-intent-btn" data-action="reporter-not-fixed">Not fixed yet</button>
|
|
1864
|
+
</div>
|
|
1865
|
+
`:""}
|
|
1866
|
+
<textarea class="mushi-textarea" data-role="reporter-reply" rows="3" placeholder="Reply to the developer\u2026"></textarea>
|
|
1867
|
+
<button type="button" class="mushi-submit" data-action="reporter-reply">
|
|
1868
|
+
<span>Reply</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
|
|
1869
|
+
</button>
|
|
1870
|
+
</div>
|
|
1871
|
+
`}function ws(t){let e=t.locale,r=t.selectedCategory,i=(t.resolveCustomCategory(r)?.intents??(e.step2.intents[r]||[])).map(l=>`
|
|
1872
|
+
<button type="button" class="mushi-intent-btn" data-intent="${E(l)}">
|
|
1873
|
+
${E(l)}
|
|
1874
|
+
</button>
|
|
1875
|
+
`).join(""),a=t.categoryIcon(r),o=t.categoryLabel(r);return `
|
|
1876
|
+
${Q(t,{title:e.step2.heading,showBack:true,step:me.intent})}
|
|
1877
|
+
<div class="mushi-body">
|
|
1878
|
+
<div class="mushi-selected-category">
|
|
1879
|
+
<span aria-hidden="true">${E(a)}</span>
|
|
1880
|
+
<span>${E(o)}</span>
|
|
1881
|
+
</div>
|
|
1882
|
+
<div class="mushi-intents">
|
|
1883
|
+
${i}
|
|
1884
|
+
</div>
|
|
1885
|
+
</div>
|
|
1886
|
+
${at(t,me.intent)}
|
|
1887
|
+
`}function xs(t){let e=t.locale,r=t.effectiveMinLength(),n=t.screenshotCapturing?e.step3.screenshotCapturing:t.screenshotError?e.step3.screenshotFailed:t.screenshotAttached?e.step3.screenshotAttached:e.step3.screenshotButton,s=["mushi-attach-btn",t.screenshotAttached?"active":"",t.screenshotError?"error":"",t.screenshotCapturing?"loading":""].filter(Boolean).join(" "),i=t.elementCapturing?e.step3.elementCapturing:t.elementSelected?e.step3.elementSelected:e.step3.elementButton,a=["mushi-attach-btn",t.elementSelected?"active":"",t.elementCapturing?"loading":""].filter(Boolean).join(" "),o=e.step3.examplePrompts.map(l=>`<button type="button" class="mushi-example-chip" data-example="${E(l)}">${E(l)}</button>`).join("");return `
|
|
1888
|
+
${Q(t,{title:e.step3.heading,showBack:true,step:me.details})}
|
|
1889
|
+
<div class="mushi-body">
|
|
1890
|
+
<div class="mushi-example-chips" aria-label="Example prompts">${o}</div>
|
|
1891
|
+
<div class="mushi-textarea-wrap">
|
|
1892
|
+
<textarea
|
|
1893
|
+
class="mushi-textarea"
|
|
1894
|
+
placeholder="${e.step3.descriptionPlaceholder}"
|
|
1895
|
+
rows="4"
|
|
1896
|
+
aria-label="${e.step3.heading}"
|
|
1897
|
+
autofocus
|
|
1898
|
+
></textarea>
|
|
1899
|
+
<div class="mushi-char-counter" data-role="char-counter" aria-hidden="true">
|
|
1900
|
+
<span data-role="char-current">0</span>/<span data-role="char-min">${r}</span>
|
|
1901
|
+
</div>
|
|
1902
|
+
</div>
|
|
1903
|
+
<div class="mushi-attachments">
|
|
1904
|
+
<button type="button" class="${s}"
|
|
1905
|
+
data-action="screenshot"
|
|
1906
|
+
${t.screenshotCapturing?"disabled":""}
|
|
1907
|
+
aria-label="${E(n)}"
|
|
1908
|
+
>
|
|
1909
|
+
${t.screenshotCapturing?'<span class="mushi-spinner" aria-hidden="true"></span>':"\u{1F4F8}"}
|
|
1910
|
+
${E(n)}
|
|
1911
|
+
</button>
|
|
1912
|
+
${t.screenshotAttached&&t.allowScreenshotRemove?'<button type="button" class="mushi-attach-btn danger" data-action="remove-screenshot" aria-label="Remove screenshot">\u2715 Remove</button>':""}
|
|
1913
|
+
${t.screenshotAttached?'<button type="button" class="mushi-attach-btn" data-action="annotate-screenshot" aria-label="Mark up screenshot">\u270F Mark up</button><div class="mushi-annotate-host" data-role="annotate-host"></div>':""}
|
|
1914
|
+
<button type="button" class="${a}"
|
|
1915
|
+
data-action="element"
|
|
1916
|
+
${t.elementCapturing?"disabled":""}
|
|
1917
|
+
aria-label="${E(i)}"
|
|
1918
|
+
>
|
|
1919
|
+
${t.elementCapturing?'<span class="mushi-spinner" aria-hidden="true"></span>':"\u{1F3AF}"}
|
|
1920
|
+
${E(i)}
|
|
1921
|
+
</button>
|
|
1922
|
+
</div>
|
|
1923
|
+
<div class="mushi-error" style="display:none" role="alert"></div>
|
|
1924
|
+
</div>
|
|
1925
|
+
<div class="mushi-footer">
|
|
1926
|
+
<span class="mushi-footer-hint" aria-hidden="true">\u2318 + ENTER \u2192 send</span>
|
|
1927
|
+
<button type="button" class="mushi-submit" data-action="submit"${t.submitting?" disabled":""}>
|
|
1928
|
+
<span>${t.submitting?e.widget.submitting:e.widget.submit}</span>
|
|
1929
|
+
<span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
|
|
1930
|
+
</button>
|
|
1931
|
+
</div>
|
|
1932
|
+
${at(t,me.details)}
|
|
1933
|
+
`}function Ss(t){let e=t.locale,n=(t.submittedAt??new Date).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:false});return `
|
|
1934
|
+
${Q(t,{title:e.widget.title,eyebrow:"Mushi \xB7 Receipt"})}
|
|
1935
|
+
<div class="mushi-body">
|
|
1936
|
+
<div class="mushi-success">
|
|
1937
|
+
<div class="mushi-success-stamp" aria-hidden="true">
|
|
1938
|
+
<svg viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"><circle cx="50" cy="50" r="44"/></svg>
|
|
1939
|
+
<span class="mushi-success-stamp-label">\u53D7</span>
|
|
1940
|
+
</div>
|
|
1941
|
+
<div class="mushi-success-headline">${e.widget.submitted}</div>
|
|
1942
|
+
<div class="mushi-success-meta">REPORT \xB7 ${n}</div>
|
|
1943
|
+
${Es(t)}
|
|
1944
|
+
${t.rewardsState?Cs(t):""}
|
|
1945
|
+
${t.config.betaMode?.enabled?ks(t):""}
|
|
1946
|
+
</div>
|
|
1947
|
+
</div>
|
|
1948
|
+
`}function Es(t){if(t.lastSubmitQueuedOffline)return `
|
|
1949
|
+
<div class="mushi-success-receipt" role="status">
|
|
1950
|
+
<div class="mushi-success-receipt-row mushi-success-receipt-warn">
|
|
1951
|
+
<span class="mushi-success-receipt-label">Queued offline</span>
|
|
1952
|
+
<span class="mushi-success-receipt-hint">We’ll send it the moment you’re back online.</span>
|
|
1953
|
+
</div>
|
|
1954
|
+
</div>
|
|
1955
|
+
`;if(!t.lastReportId)return `
|
|
1956
|
+
<div class="mushi-success-receipt" role="status">
|
|
1957
|
+
<div class="mushi-success-receipt-row">
|
|
1958
|
+
<span class="mushi-success-receipt-spinner" aria-hidden="true"></span>
|
|
1959
|
+
<span class="mushi-success-receipt-hint">Delivering to the team\u2026</span>
|
|
1960
|
+
</div>
|
|
1961
|
+
${xr(t)}
|
|
1962
|
+
</div>
|
|
1963
|
+
`;let e=`#${t.lastReportId.slice(0,8)}`,r=(t.config.dashboardUrl??"").replace(/\/$/,""),n=r?`${r}/reports/${encodeURIComponent(t.lastReportId)}`:"";return `
|
|
1964
|
+
<div class="mushi-success-receipt" role="status">
|
|
1965
|
+
<div class="mushi-success-receipt-row">
|
|
1966
|
+
<span class="mushi-success-receipt-label">Receipt</span>
|
|
1967
|
+
<button
|
|
1968
|
+
type="button"
|
|
1969
|
+
class="mushi-success-receipt-id"
|
|
1970
|
+
data-action="copy-report-id"
|
|
1971
|
+
data-copy-id="${E(t.lastReportId)}"
|
|
1972
|
+
title="Copy report id ${E(t.lastReportId)}"
|
|
1973
|
+
aria-label="Copy report id ${E(t.lastReportId)}"
|
|
1974
|
+
>${E(e)}<span class="mushi-success-receipt-copy" aria-hidden="true">\u2398</span></button>
|
|
1975
|
+
</div>
|
|
1976
|
+
${n?`
|
|
1977
|
+
<a
|
|
1978
|
+
class="mushi-success-receipt-track"
|
|
1979
|
+
href="${E(n)}"
|
|
1980
|
+
target="_blank"
|
|
1981
|
+
rel="noopener noreferrer"
|
|
1982
|
+
>Track on Mushi <span aria-hidden="true">\u2197</span></a>
|
|
1983
|
+
`:""}
|
|
1984
|
+
${xr(t)}
|
|
1985
|
+
</div>
|
|
1986
|
+
`}function xr(t){let e=(t.config.responseSlaLabel??"").trim();return e?`<div class="mushi-success-sla">${E(e)}</div>`:'<div class="mushi-success-sla mushi-success-sla-default">A human will look at this within a working day.</div>'}function ks(t){let e=t.config.betaMode,r=e.contactEmail?E(e.contactEmail):null,n=E(e.appName??"the team");return `
|
|
1987
|
+
<div class="mushi-beta-success-footer" role="note" aria-label="Beta feedback acknowledgement">
|
|
1988
|
+
${r?`<div class="mushi-beta-success-line">\u{1F4EC} Sent to ${r}</div>`:`<div class="mushi-beta-success-line">\u{1F4EC} Sent to ${n}</div>`}
|
|
1989
|
+
<div class="mushi-beta-success-line mushi-beta-success-dim">We aim to review within 48h \xB7 thank you for helping build this</div>
|
|
1990
|
+
</div>
|
|
1991
|
+
`}function Rs(t){let{tier:e,nextTier:r,totalPoints:n,pointsForReport:s}=t.rewardsState,i=e?.displayName??"Free",a=e?.slug??"free",o=t.tierColor(a),l=100,m="";if(r){let c=e?.pointsThreshold??0,g=r.pointsThreshold;l=g>c?Math.round(Math.min(1,(n-c)/(g-c))*100):100,m=`${Math.max(0,g-n).toLocaleString()} pts to ${E(r.displayName)}`;}return `
|
|
1992
|
+
<div class="mushi-rewards-nudge" aria-label="Rewards progress">
|
|
1993
|
+
<div class="mushi-rewards-row">
|
|
1994
|
+
<span class="mushi-tier-pip" style="background:${o}" aria-hidden="true"></span>
|
|
1995
|
+
<span class="mushi-rewards-tier-name">${E(i)}</span>
|
|
1996
|
+
<span class="mushi-rewards-pts-count">${n.toLocaleString()} pts</span>
|
|
1997
|
+
<span class="mushi-rewards-pts-earn">+${s} pts for a report</span>
|
|
1998
|
+
</div>
|
|
1999
|
+
${r?`
|
|
2000
|
+
<div class="mushi-tier-bar-track" role="progressbar" aria-valuenow="${l}" aria-valuemin="0" aria-valuemax="100" aria-label="Progress to ${E(r.displayName)}">
|
|
2001
|
+
<div class="mushi-tier-bar-fill" style="width:${l}%"></div>
|
|
2002
|
+
</div>
|
|
2003
|
+
<div class="mushi-rewards-next-label">${m}</div>
|
|
2004
|
+
`:""}
|
|
2005
|
+
</div>
|
|
2006
|
+
`}function Cs(t){let{tier:e,nextTier:r,totalPoints:n,pointsForReport:s}=t.rewardsState,i=n+s,a=100,o="";if(r){let l=e?.pointsThreshold??0,m=r.pointsThreshold;a=m>l?Math.round(Math.min(1,(i-l)/(m-l))*100):100;let c=Math.max(0,m-i);o=c>0?`${c.toLocaleString()} pts to ${E(r.displayName)}`:`\u{1F389} ${E(r.displayName)} reached!`;}return `
|
|
2007
|
+
<div class="mushi-success-rewards">
|
|
2008
|
+
<div class="mushi-success-pts-award">+${s} pts</div>
|
|
2009
|
+
${r?`
|
|
2010
|
+
<div class="mushi-tier-bar-track success-bar" role="progressbar" aria-valuenow="${a}" aria-valuemin="0" aria-valuemax="100" aria-label="Progress to ${E(r.displayName)}">
|
|
2011
|
+
<div class="mushi-tier-bar-fill" style="width:${a}%"></div>
|
|
2012
|
+
</div>
|
|
2013
|
+
<div class="mushi-rewards-next-label">${o}</div>
|
|
2014
|
+
`:""}
|
|
2015
|
+
</div>
|
|
2016
|
+
`}var Ue=class t{constructor(e={},r,n=Z){this.sdkVersion=n;this.config={position:e.position??"bottom-right",anchor:e.anchor??{},theme:e.theme??"auto",triggerText:e.triggerText||"\u{1F41B}",expandedTitle:e.expandedTitle??"",mode:e.mode??"conversational",locale:e.locale??"auto",zIndex:e.zIndex??99999,trigger:e.trigger??"auto",bannerConfig:e.bannerConfig??{},attachToSelector:e.attachToSelector??"",inset:e.inset??{},respectSafeArea:e.respectSafeArea??true,hideOnSelector:e.hideOnSelector??"",hideOnRoutes:e.hideOnRoutes??[],environments:e.environments??{},smartHide:e.smartHide??false,draggable:e.draggable??false,brandFooter:e.brandFooter??true,outdatedBanner:e.outdatedBanner??"auto",betaMode:e.betaMode??{},minDescriptionLength:e.minDescriptionLength??20,dashboardUrl:e.dashboardUrl??"",responseSlaLabel:e.responseSlaLabel??"",featureRequestCard:e.featureRequestCard??true,featureRequestLabel:e.featureRequestLabel||"Feature request",featureRequestDescription:e.featureRequestDescription||"Suggest something new \u2014 even rough ideas help us prioritise",avoidSelectors:e.avoidSelectors??[],categories:e.categories??[],accent:e.accent??"",accentText:e.accentText??""},this.callbacks=r,this.locale=st(this.config.locale==="auto"?void 0:this.config.locale),this.host=document.createElement("div"),this.host.id="mushi-mushi-widget",this.shadow=this.host.attachShadow({mode:"closed"});}sdkVersion;host;shadow;config;callbacks;locale;isOpen=false;step="category";selectedCategory=null;selectedIntent=null;viaFeatureRequest=false;screenshotAttached=false;screenshotCapturing=false;screenshotError=false;allowScreenshotRemove=true;elementSelected=false;elementCapturing=false;submitting=false;selectorHint=null;triggerVisible=true;triggerShrunk=false;triggerHiddenByScroll=false;mountedAt=null;nudgeShown=false;nudgeEl=null;nudgeTimer=null;sdkFreshness=null;reporterReports=[];featureBoard=[];reporterComments=[];selectedReportId=null;reporterLoading=false;reporterError=null;attachedLaunchers=[];smartHideCleanup=null;smartHideTimer=null;submittedAt=null;successTimer=null;autoCloseTimer=null;rewardsState=null;leaderboardEntries=null;leaderboardLoading=false;lastReportId=null;lastSubmitQueuedOffline=false;bannerDismissed=false;fabPos=null;vvCleanup=null;testerJwt=null;testerInfo=null;crossAppReports=null;crossAppLoading=false;globalLeaderboard=null;globalLeaderboardLoading=false;testerReputation=null;magicLinkSent=false;magicLinkEmail="";magicLinkError="";magicLinkSending=false;assistantTurns=[];assistantThreadId=null;assistantSending=false;assistantError=null;mount(){this.host.isConnected||(this.syncHostChromeState(),document.body.appendChild(this.host),this.syncAttachedLaunchers(),this.syncSmartHide(),this.render(),this.mountedAt=Date.now());}getIsMounted(){return this.host.isConnected}updateConfig(e={}){this.config={...this.config,...e.position?{position:e.position}:{},...e.anchor!==void 0?{anchor:e.anchor}:{},...e.theme?{theme:e.theme}:{},...e.triggerText!==void 0?{triggerText:e.triggerText||"\u{1F41B}"}:{},...e.expandedTitle!==void 0?{expandedTitle:e.expandedTitle}:{},...e.mode?{mode:e.mode}:{},...e.locale?{locale:e.locale}:{},...e.zIndex!==void 0?{zIndex:e.zIndex}:{},...e.trigger?{trigger:e.trigger}:{},...e.attachToSelector!==void 0?{attachToSelector:e.attachToSelector}:{},...e.inset!==void 0?{inset:e.inset}:{},...e.respectSafeArea!==void 0?{respectSafeArea:e.respectSafeArea}:{},...e.hideOnSelector!==void 0?{hideOnSelector:e.hideOnSelector}:{},...e.hideOnRoutes!==void 0?{hideOnRoutes:e.hideOnRoutes}:{},...e.environments!==void 0?{environments:e.environments}:{},...e.smartHide!==void 0?{smartHide:e.smartHide}:{},...e.draggable!==void 0?{draggable:e.draggable}:{},...e.brandFooter!==void 0?{brandFooter:e.brandFooter}:{},...e.outdatedBanner!==void 0?{outdatedBanner:e.outdatedBanner}:{},...e.betaMode!==void 0?{betaMode:e.betaMode}:{},...e.minDescriptionLength!==void 0?{minDescriptionLength:e.minDescriptionLength}:{},...e.dashboardUrl!==void 0?{dashboardUrl:e.dashboardUrl}:{},...e.responseSlaLabel!==void 0?{responseSlaLabel:e.responseSlaLabel}:{},...e.featureRequestCard!==void 0?{featureRequestCard:e.featureRequestCard}:{},...e.featureRequestLabel!==void 0?{featureRequestLabel:e.featureRequestLabel||"Feature request"}:{},...e.featureRequestDescription!==void 0?{featureRequestDescription:e.featureRequestDescription||"Suggest something new \u2014 even rough ideas help us prioritise"}:{},...e.bannerConfig!==void 0?{bannerConfig:e.bannerConfig}:{},...e.categories!==void 0?{categories:e.categories}:{}},this.locale=st(this.config.locale==="auto"?void 0:this.config.locale),this.host.isConnected&&this.syncHostChromeState(),this.syncAttachedLaunchers(),this.syncSmartHide(),this.render();}resolveCustomCategory(e){return this.config.categories?.find(r=>r.id===e)}resolveBaseCategory(e){return ["bug","slow","visual","confusing","other"].includes(e)?e:this.resolveCustomCategory(e)?.baseCategory??"other"}categoryIcon(e){let r=this.resolveCustomCategory(e);return r?.icon?r.icon:He[e]??"\u{1F4AC}"}categoryLabel(e){let r=this.resolveCustomCategory(e);return r?r.label:this.locale.step1.categories[e]??e}open(e){if(!this.isOpen){if(this.isOpen=true,this.screenshotAttached=false,this.screenshotCapturing=false,this.screenshotError=false,this.elementSelected=false,this.elementCapturing=false,this.submitting=false,this.submittedAt=null,this.removeSelectorHint(),this.lastReportId=null,this.lastSubmitQueuedOffline=false,this.viaFeatureRequest=false,e?.featureRequest)this.selectedCategory="other",this.selectedIntent=ot,this.viaFeatureRequest=true,this.step="details";else if(e?.category){let r=this.resolveCustomCategory(e.category);["bug","slow","visual","confusing","other"].includes(e.category)||r!==void 0?(this.selectedCategory=e.category,this.selectedIntent=null,this.step=r&&(!r.intents||r.intents.length===0)?"details":"intent"):(this.selectedCategory=null,this.selectedIntent=null,this.step="category");}else this.selectedCategory=null,this.selectedIntent=null,this.step="category";this.render(),this.callbacks.onOpen();}}close(){this.isOpen&&(this.isOpen=false,this.render(),this.callbacks.onClose());}openAssistantTab(){if(!this.callbacks.assistantEnabled){this.open();return}this.isOpen||(this.isOpen=true,this.callbacks.onOpen()),this.step="assistant",this.assistantError=null,this.render(),setTimeout(()=>{this.shadow.querySelector(".mushi-assistant-input")?.focus();},0);}async sendAssistantMessage(e){let r=e.trim();if(!(!r||this.assistantSending||!this.callbacks.onAssistantAsk)){this.assistantSending=true,this.assistantError=null,this.assistantTurns.push({role:"user",text:r}),this.render();try{let n=await this.callbacks.onAssistantAsk(r,this.assistantThreadId);n?(n.threadId&&(this.assistantThreadId=n.threadId),n.kind==="clarify"?this.assistantTurns.push({role:"assistant",text:n.question??"Could you tell me a bit more?",...n.options&&n.options.length?{options:n.options}:{}}):this.assistantTurns.push({role:"assistant",text:n.text??"\u2026"})):this.assistantError="No response \u2014 please try again.";}catch{this.assistantError="Something went wrong. Please try again.";}finally{this.assistantSending=false,this.render(),setTimeout(()=>{let n=this.shadow.querySelector(".mushi-assistant-log");n&&(n.scrollTop=n.scrollHeight);},0);}}}pulseTrigger(){if(this.isOpen)return;let e=this.shadow.querySelector(".mushi-trigger");e&&(e.classList.add("mushi-trigger-pulse"),window.setTimeout(()=>{e.classList.remove("mushi-trigger-pulse");},2400));}getIsOpen(){return this.isOpen}showTrigger(){this.triggerVisible=true,this.render();}hideTrigger(){this.triggerVisible=false,this.render();}setTrigger(e){this.updateConfig({trigger:e});}attachTo(e,r={}){let s=(typeof e=="string"?Array.from(document.querySelectorAll(e)):[e]).map(i=>{let a=o=>{o.preventDefault(),this.updateConfig(r),this.open();};return i.addEventListener("click",a),()=>i.removeEventListener("click",a)});return ()=>s.forEach(i=>i())}setScreenshotAttached(e){this.screenshotAttached=e,this.isOpen&&this.render();}setAllowScreenshotRemove(e){this.allowScreenshotRemove=e,this.isOpen&&this.render();}setElementSelected(e){this.elementSelected=e,this.elementCapturing=false,this.removeSelectorHint(),this.isOpen&&this.render();}setScreenshotCapturing(e){this.screenshotCapturing=e,this.screenshotError=false,this.isOpen&&this.render();}setScreenshotError(e){this.screenshotError=e,this.screenshotCapturing=false,this.isOpen&&this.render();}setElementCapturing(e){this.elementCapturing=e,e?this.showSelectorHint():this.removeSelectorHint(),this.isOpen&&this.render();}hidePanel(){let e=this.shadow.querySelector(".mushi-panel");e&&(e.style.display="none");}showPanel(){let e=this.shadow.querySelector(".mushi-panel");e&&(e.style.display="");}showSelectorHint(){this.removeSelectorHint();let e=document.createElement("div");e.id="mushi-selector-hint",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.style.cssText=`
|
|
2017
|
+
position: fixed;
|
|
2018
|
+
bottom: 24px;
|
|
2019
|
+
left: 50%;
|
|
2020
|
+
transform: translateX(-50%);
|
|
2021
|
+
z-index: 2147483646;
|
|
2022
|
+
background: rgba(17,17,17,0.92);
|
|
2023
|
+
color: #fff;
|
|
2024
|
+
font-family: ui-monospace, SFMono-Regular, monospace;
|
|
2025
|
+
font-size: 12px;
|
|
2026
|
+
letter-spacing: 0.04em;
|
|
2027
|
+
padding: 8px 16px;
|
|
2028
|
+
border-radius: 20px;
|
|
2029
|
+
pointer-events: none;
|
|
2030
|
+
white-space: nowrap;
|
|
2031
|
+
backdrop-filter: blur(4px);
|
|
2032
|
+
box-shadow: 0 2px 12px rgba(0,0,0,0.35);
|
|
2033
|
+
`,e.textContent=this.locale.step3.elementSelectorHint,document.body.appendChild(e),this.selectorHint=e;}removeSelectorHint(){this.selectorHint?.remove(),this.selectorHint=null,document.getElementById("mushi-selector-hint")?.remove();}showNudge(){if(this.nudgeShown||this.nudgeEl)return;this.nudgeShown=true;let r=this.shadow.querySelector(".mushi-trigger")?.getBoundingClientRect(),n=document.createElement("div");n.id="mushi-nudge-bubble",n.setAttribute("role","tooltip");let s=this.config.position.includes("right");n.style.cssText=`
|
|
2034
|
+
position: fixed;
|
|
2035
|
+
z-index: 2147483645;
|
|
2036
|
+
${r?`bottom: ${window.innerHeight-r.top+8}px; ${s?`right: ${window.innerWidth-r.right}px;`:`left: ${r.left}px;`}`:"bottom: 80px; right: 24px;"}
|
|
2037
|
+
background: rgba(17,17,17,0.92);
|
|
2038
|
+
color: #fff;
|
|
2039
|
+
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
2040
|
+
font-size: 12px;
|
|
2041
|
+
line-height: 1.4;
|
|
2042
|
+
padding: 8px 12px;
|
|
2043
|
+
border-radius: 8px;
|
|
2044
|
+
max-width: 200px;
|
|
2045
|
+
pointer-events: none;
|
|
2046
|
+
backdrop-filter: blur(4px);
|
|
2047
|
+
box-shadow: 0 2px 12px rgba(0,0,0,0.35);
|
|
2048
|
+
animation: mushi-fade-in 0.15s ease forwards;
|
|
2049
|
+
`,n.textContent=this.locale.step3.tooShort.startsWith("A bit")?"Found a bug? One sentence is enough \u{1F41B}":"\u30D0\u30B0\u3092\u898B\u3064\u3051\u305F\uFF1F\u4E00\u884C\u3067\u5927\u4E08\u592B\u3067\u3059 \u{1F41B}",document.body.appendChild(n),this.nudgeEl=n,this.nudgeTimer!==null&&clearTimeout(this.nudgeTimer),this.nudgeTimer=setTimeout(()=>this.removeNudge(),5e3);}removeNudge(){this.nudgeTimer!==null&&(clearTimeout(this.nudgeTimer),this.nudgeTimer=null),this.nudgeEl?.remove(),this.nudgeEl=null,document.getElementById("mushi-nudge-bubble")?.remove();}setSdkFreshness(e){this.sdkFreshness=e,this.isOpen&&this.render();}setRewardsState(e){this.rewardsState=e,this.isOpen&&this.render();}setLeaderboard(e,r=false){this.leaderboardEntries=e,this.leaderboardLoading=r,this.isOpen&&this.step==="leaderboard"&&this.render();}setTesterSession(e,r){this.testerJwt=e,this.testerInfo=r,this.isOpen&&this.render();}setGlobalLeaderboard(e,r=false){this.globalLeaderboard=e,this.globalLeaderboardLoading=r,this.isOpen&&(this.step==="leaderboard"||this.step==="account")&&this.render();}setCrossAppReports(e,r=false){this.crossAppReports=e,this.crossAppLoading=r,this.isOpen&&this.step==="cross-app-reports"&&this.render();}setTesterReputation(e){this.testerReputation=e,this.isOpen&&(this.step==="account"||this.step==="leaderboard")&&this.render();}destroy(){this.successTimer!==null&&(clearTimeout(this.successTimer),this.successTimer=null),this.autoCloseTimer!==null&&(clearTimeout(this.autoCloseTimer),this.autoCloseTimer=null),this.smartHideTimer!==null&&(clearTimeout(this.smartHideTimer),this.smartHideTimer=null),this.smartHideCleanup?.(),this.smartHideCleanup=null,this.teardownViewportHandlers(),this.attachedLaunchers.forEach(e=>e()),this.attachedLaunchers=[],this.removeSelectorHint(),this.removeNudge(),this.removeBodyNudge(),this.host.remove();}syncHostChromeState(){let e=this.host.style;e.setProperty("position","fixed"),e.setProperty("top","0"),e.setProperty("left","0"),e.setProperty("width","0"),e.setProperty("height","0"),e.setProperty("overflow","visible"),e.setProperty("pointer-events","none"),e.setProperty("z-index",String(this.config.zIndex)),e.setProperty("margin","0"),e.setProperty("padding","0"),e.setProperty("border","none"),e.setProperty("background","none");}isSuppressedByHost(){if(!this.config.hideOnSelector||typeof document>"u")return false;try{return !!document.querySelector(this.config.hideOnSelector)}catch{return false}}getWidgetDiagnostics(){let e=this.host.style,r=e.pointerEvents==="none"&&(e.width==="0"||e.width==="0px")&&(e.height==="0"||e.height==="0px"),n=this.host.isConnected?{width:this.host.offsetWidth,height:this.host.offsetHeight}:null,s=this.isSuppressedByHost()||this.isRouteHidden()||!this.triggerVisible,i=this.config.trigger==="banner"&&!this.bannerDismissed&&!this.isSuppressedByHost()&&!this.isRouteHidden()&&this.triggerVisible;return {widgetHostPointerSafe:r,widgetHostBounds:n,widgetSuppressed:s,bannerRendered:i}}syncAttachedLaunchers(){this.attachedLaunchers.forEach(e=>e()),this.attachedLaunchers=[],!(this.config.trigger!=="attach"||!this.config.attachToSelector)&&(typeof document>"u"||this.attachedLaunchers.push(this.attachTo(this.config.attachToSelector)));}syncSmartHide(){if(this.smartHideCleanup?.(),this.smartHideCleanup=null,this.triggerShrunk=false,this.triggerHiddenByScroll=false,!this.config.smartHide||typeof window>"u")return;let e=this.config.smartHide===true?{onScroll:"shrink",onIdleMs:900}:this.config.smartHide;if(!e.onScroll)return;let r=()=>{e.onScroll==="hide"?this.triggerHiddenByScroll=true:this.triggerShrunk=true,this.render(),this.smartHideTimer!==null&&clearTimeout(this.smartHideTimer),this.smartHideTimer=setTimeout(()=>{this.triggerHiddenByScroll=false,this.triggerShrunk=false,this.render();},e.onIdleMs??900);};window.addEventListener("scroll",r,{passive:true}),this.smartHideCleanup=()=>window.removeEventListener("scroll",r);}shouldRenderTrigger(){if(!this.triggerVisible||this.triggerHiddenByScroll||this.config.trigger==="manual"||this.config.trigger==="hidden"||this.config.trigger==="attach"||this.config.trigger==="banner"||this.isMobileSmartHidden()||this.isRouteHidden()||this.isSuppressedByHost())return false;let e=this.config.environments[this.detectEnvironment()];return e!=="never"&&e!=="manual"}static BANNER_HEIGHT=36;static BODY_NUDGE_PROP="--mushi-banner-offset";applyBodyNudge(e){let r=`${t.BANNER_HEIGHT}px`;e==="top"?(document.documentElement.style.setProperty(t.BODY_NUDGE_PROP,r),document.body.style.paddingTop||(document.body.style.paddingTop=r,document.body.dataset.mushiBannerNudged="top")):(document.documentElement.style.setProperty(t.BODY_NUDGE_PROP,r),document.body.style.paddingBottom||(document.body.style.paddingBottom=r,document.body.dataset.mushiBannerNudged="bottom"));}removeBodyNudge(){document.documentElement.style.removeProperty(t.BODY_NUDGE_PROP);let e=document.body.dataset.mushiBannerNudged;e==="top"?(document.body.style.paddingTop="",delete document.body.dataset.mushiBannerNudged):e==="bottom"&&(document.body.style.paddingBottom="",delete document.body.dataset.mushiBannerNudged);}renderBanner(){if(this.config.trigger!=="banner")return;if(this.bannerDismissed){this.removeBodyNudge();return}if(!this.triggerVisible){this.removeBodyNudge();return}if(this.isRouteHidden()){this.removeBodyNudge();return}if(this.isSuppressedByHost()){this.removeBodyNudge();return}let e=this.config.bannerConfig??{},r=e.variant??"brand",n=e.position??"top",s=e.message?.trim()??"",i=s.length>0,a=e.bugCta??"\u{1F41B} Report a bug",o=e.featureCta!==false,l=e.featureCtaLabel??"Request feature",m=e.zIndex??(this.config.zIndex??99999)-1,c=document.createElement("div");c.className=`mushi-banner ${r} ${n}${i?" mushi-banner--rich":""}`,c.style.setProperty("--mushi-banner-z",String(m)),c.setAttribute("role","banner");let g=document.createElement("button");if(g.className="mushi-banner-dismiss",g.textContent="\u2715",g.setAttribute("aria-label","Dismiss feedback banner"),g.addEventListener("click",()=>{this.bannerDismissed=true,this.removeBodyNudge(),this.render();}),i){let h=document.createElement("div");h.className="mushi-banner-body";let f=e.label===false?null:e.label??"Beta";if(f){let x=document.createElement("span");x.className="mushi-banner-pill",x.textContent=f,h.appendChild(x);}let d=document.createElement("span");d.className="mushi-banner-message",d.textContent=s,h.appendChild(d),c.appendChild(h);let b=document.createElement("nav");b.className="mushi-banner-actions",b.setAttribute("aria-label","Feedback banner actions");let R=(x=false)=>{let S=document.createElement("span");S.className=`mushi-banner-divider${x?" mushi-banner-extra":""}`,S.setAttribute("aria-hidden","true"),S.textContent="|",b.appendChild(S);},T=(x,S,y=false)=>{let k=document.createElement("button");k.type="button",k.className=`mushi-banner-link${y?" mushi-banner-extra":""}`,k.textContent=x,k.addEventListener("click",S),b.appendChild(k);};T(a,()=>this.open()),o&&(R(true),T(l,()=>this.open({featureRequest:true}),true));for(let x of e.links??[]){let S=x.label?.trim();if(!S)continue;let y=x.href&&(/^https?:\/\//i.test(x.href)||x.href.startsWith("/"))?x.href:void 0;if(R(true),y){let k=document.createElement("a");k.className="mushi-banner-link mushi-banner-extra",k.href=y,k.textContent=S,k.target="_blank",k.rel="noopener noreferrer",b.appendChild(k);}else T(S,()=>{x.featureRequest?this.open({featureRequest:true}):this.open();},true);}c.appendChild(b),c.appendChild(g);}else {let h=document.createElement("button");if(h.className="mushi-banner-btn",h.textContent=a,h.addEventListener("click",()=>this.open()),c.appendChild(h),o){let f=document.createElement("button");f.className="mushi-banner-btn",f.textContent=l,f.addEventListener("click",()=>this.open({featureRequest:true})),c.appendChild(f);}c.appendChild(g);}this.shadow.appendChild(c),this.applyBodyNudge(n);}effectiveTrigger(){if(!this.config.smartHide||typeof window>"u")return this.config.trigger;let e=this.config.smartHide===true?{onMobile:"edge-tab"}:this.config.smartHide;return window.matchMedia("(max-width: 768px)").matches&&e.onMobile==="edge-tab"?"edge-tab":this.config.trigger}isMobileSmartHidden(){if(!this.config.smartHide||typeof window>"u")return false;let e=this.config.smartHide===true?{onMobile:"edge-tab"}:this.config.smartHide;return window.matchMedia("(max-width: 768px)").matches&&e.onMobile==="hide"}detectEnvironment(){let e=typeof location<"u"?location.hostname:"";return e==="localhost"||e==="127.0.0.1"||e.endsWith(".local")?"development":/\b(staging|stage|preview|dev)\b/i.test(e)?"staging":"production"}isRouteHidden(){return !this.config.hideOnRoutes.length||typeof location>"u"?false:this.config.hideOnRoutes.some(e=>location.pathname.includes(e))}getTheme(){let e=this.config.theme;if(e==="light"||e==="dark")return e;if(e==="inherit"){let r=document.documentElement,n=r.getAttribute("data-color-scheme")||r.getAttribute("data-theme")||r.getAttribute("color-scheme")||"";if(/dark/i.test(n))return "dark";if(/light/i.test(n))return "light";if(r.classList.contains("dark"))return "dark";if(r.classList.contains("light"))return "light";try{let i=getComputedStyle(r).backgroundColor.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(i)return .299*+i[1]+.587*+i[2]+.114*+i[3]<128?"dark":"light"}catch{}}return typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}render(){let e=this.getTheme(),r=this.config.position,n=this.locale;this.shadow.innerHTML="";let s=document.createElement("style");if(s.textContent=yr(e,this.config.accent??"",this.config.accentText??""),this.shadow.appendChild(s),this.renderBanner(),this.shouldRenderTrigger()){let a=this.effectiveTrigger(),o=document.createElement("button");if(o.className=`mushi-trigger ${r}${a==="edge-tab"?" edge-tab":""}${this.triggerShrunk?" shrunk":""}`,o.textContent=this.config.triggerText,o.setAttribute("aria-label",n.widget.trigger),o.setAttribute("aria-haspopup","dialog"),o.setAttribute("aria-expanded",String(this.isOpen)),o.style.zIndex=String(this.config.zIndex),this.applyInsetVars(o),o.addEventListener("click",()=>{this.removeNudge(),this.isOpen?this.close():this.open();}),o.addEventListener("mouseenter",()=>{let l=this.mountedAt?Date.now()-this.mountedAt:0;!this.nudgeShown&&!this.isOpen&&l>=3e4&&this.showNudge();}),o.addEventListener("mouseleave",()=>{this.nudgeEl&&(this.nudgeTimer!==null&&clearTimeout(this.nudgeTimer),this.nudgeTimer=setTimeout(()=>this.removeNudge(),2e3));}),o.addEventListener("keydown",l=>{let m=this.config.draggable;if(!m)return;let c=8,g=typeof m=="object"?m.axis??"both":"both",h=0,f=0;if(g!=="y"&&(l.key==="ArrowLeft"?h=-c:l.key==="ArrowRight"&&(h=c)),g!=="x"&&(l.key==="ArrowUp"?f=-c:l.key==="ArrowDown"&&(f=c)),h!==0||f!==0){l.preventDefault();let d=this.fabPos??{x:0,y:0};this.moveFab(o,d.x+h,d.y+f,false);}}),this.config.draggable&&this.attachDragHandlers(o),this.shadow.appendChild(o),this.fabPos&&this.config.draggable){let l=this.fabPos;this.fabPos={x:0,y:0},this.moveFab(o,l.x,l.y,false);}}let i=document.createElement("div");if(i.className=`mushi-panel ${r}${this.isOpen?" open":" closed"}`,i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-label",n.widget.title),i.style.zIndex=String(this.config.zIndex+1),this.applyInsetVars(i),this.isOpen){let a=this.renderCtx();i.innerHTML=`${Er(a)}${Sr(a)}${kr(a)}`,this.shadow.appendChild(i),this.attachHandlers(i),this.trapFocus(i),this.attachViewportHandlers(i);}else this.teardownViewportHandlers();}computeAvoidTopPx(e=8){let r=this.config.avoidSelectors;if(!r?.length)return null;let n=0;for(let s of r)try{let i=document.querySelector(s);if(!i)continue;let a=i.getBoundingClientRect();a.bottom>n&&a.width>0&&a.height>0&&(n=a.bottom);}catch{}return n>0?Math.ceil(n)+e:null}computeAvoidBottomPx(e=8){let r=this.config.avoidSelectors;if(!r?.length)return null;let n=0;for(let s of r)try{let i=document.querySelector(s);if(!i)continue;let a=i.getBoundingClientRect();if(a.width>0&&a.height>0){let o=window.innerHeight-a.top+e;o>n&&(n=o);}}catch{}return n>0?Math.ceil(n):null}applyInsetVars(e){let{anchor:r}=this.config;if(r&&Object.keys(r).length>0)["top","right","bottom","left"].forEach(i=>{let a=r[i];a!==void 0&&e.style.setProperty(`--mushi-${i}`,a);}),e.style.setProperty("--mushi-safe-area",this.config.respectSafeArea?"1":"0");else {let{inset:i}=this.config;this.config.respectSafeArea||["top","right","bottom","left"].forEach(a=>{i[a]===void 0&&e.style.setProperty(`--mushi-${a}`,"24px");}),["top","right","bottom","left"].forEach(a=>{let o=i[a];o!==void 0&&e.style.setProperty(`--mushi-${a}`,o==="auto"?"auto":`${o}px`);}),e.style.setProperty("--mushi-safe-area",this.config.respectSafeArea?"1":"0");}let n=r?.top!==void 0||this.config.position?.startsWith("top"),s=r?.bottom!==void 0||this.config.position?.startsWith("bottom")||!this.config.position;if(n){let i=this.computeAvoidTopPx();i!==null&&e.style.setProperty("--mushi-top",`${i}px`);}if(s){let i=this.computeAvoidBottomPx();i!==null&&e.style.setProperty("--mushi-bottom",`${i}px`);}}fabStorageKey(){let e=this.config.projectId??"";return `mushi_fab_pos${e?`_${e}`:""}`}moveFab(e,r,n,s){let i=(()=>{let G=this.config.draggable;return G&&typeof G=="object"?G.axis??"both":"both"})(),a=window.innerWidth,o=window.innerHeight,l=e.offsetWidth||52,m=e.offsetHeight||52,c=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sai-left")||"0")||0,g=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sai-right")||"0")||0,h=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sai-top")||"0")||0,f=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sai-bottom")||"0")||0,d=8,b=e.getBoundingClientRect(),R=this.fabPos?.x??0,T=this.fabPos?.y??0,x=b.left-R,S=b.top-T,y=c+d-x,k=a-g-d-l-x,v=h+d-S,I=o-f-d-m-S,q=i==="y"?0:Math.max(y,Math.min(k,r)),V=i==="x"?0:Math.max(v,Math.min(I,n)),_=q;if(s){let G=this.config.draggable;(G===true||typeof G=="object"&&(G.snapToEdge??true))&&i!=="y"&&(_=b.left+l/2<a/2?c+d-x:a-g-d-l-x);}this.fabPos={x:_,y:V},e.style.setProperty("--mushi-drag-x",`${_}px`),e.style.setProperty("--mushi-drag-y",`${V}px`),e.style.setProperty("--mushi-drag-active","1");let K=this.config.draggable;if(K===true||typeof K=="object"&&(K.persist??true))try{localStorage.setItem(this.fabStorageKey(),JSON.stringify(this.fabPos));}catch{}}loadFabPos(){let e=this.config.draggable;if(!(!e||!(e===true||typeof e=="object"&&(e.persist??true))))try{let n=localStorage.getItem(this.fabStorageKey());if(n){let s=JSON.parse(n);typeof s?.x=="number"&&typeof s?.y=="number"&&(this.fabPos=s);}}catch{}}attachDragHandlers(e){this.fabPos===null&&this.loadFabPos();let r=0,n=0,s=0,i=0,a=false,o=false,l=h=>{if(h.button!==0&&h.pointerType!=="touch")return;e.setPointerCapture(h.pointerId),r=h.clientX,n=h.clientY;let f=this.fabPos??{x:0,y:0};s=f.x,i=f.y,a=true,o=false;},m=6,c=h=>{if(!a)return;let f=h.clientX-r,d=h.clientY-n;!o&&Math.hypot(f,d)>m&&(o=true,e.classList.add("dragging"),e.setAttribute("aria-grabbed","true")),o&&(h.preventDefault(),this.moveFab(e,s+f,i+d,false));},g=h=>{if(a){if(a=false,e.classList.remove("dragging"),e.removeAttribute("aria-grabbed"),o){let f=h.clientX-r,d=h.clientY-n;this.moveFab(e,s+f,i+d,true);let b=R=>{R.stopImmediatePropagation(),e.removeEventListener("click",b,{capture:true});};e.addEventListener("click",b,{capture:true});}o=false;}};e.addEventListener("pointerdown",l),e.addEventListener("pointermove",c),e.addEventListener("pointerup",g),e.addEventListener("pointercancel",g);}attachViewportHandlers(e){this.teardownViewportHandlers();let r=window.visualViewport;if(!r)return;let n=()=>{let i=window.innerHeight-r.height-r.offsetTop;i>50?(e.style.setProperty("--mushi-keyboard-inset",`${Math.round(i)}px`),e.classList.add("keyboard-open"),e.querySelector('textarea, input[type="text"]')?.scrollIntoView({block:"nearest",behavior:"smooth"})):(e.style.setProperty("--mushi-keyboard-inset","0px"),e.classList.remove("keyboard-open"));};r.addEventListener("resize",n,{passive:true}),r.addEventListener("scroll",n,{passive:true});let s=()=>requestAnimationFrame(n);e.addEventListener("focusin",s),this.vvCleanup=()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n),e.removeEventListener("focusin",s);};}teardownViewportHandlers(){this.vvCleanup?.(),this.vvCleanup=null;}effectiveMinLength(){let e=this.config.minDescriptionLength??20,r=this.config.locale==="auto"?typeof navigator<"u"?navigator.language??"":"":this.config.locale??"";return /^(ja|zh|ko)/i.test(r)?Math.max(4,Math.floor(e/2)):e}tierColor(e){return {free:"#6b7280",explorer:"#3b82f6",contributor:"#8b5cf6",champion:"#f59e0b"}[e]??"#6c47ff"}renderCtx(){return {config:this.config,rewardsState:this.rewardsState,lastReportId:this.lastReportId,reporterLoading:this.reporterLoading,locale:this.locale,testerReputation:this.testerReputation,testerInfo:this.testerInfo,screenshotCapturing:this.screenshotCapturing,screenshotAttached:this.screenshotAttached,reporterError:this.reporterError,magicLinkError:this.magicLinkError,elementCapturing:this.elementCapturing,submitting:this.submitting,sdkFreshness:this.sdkFreshness,screenshotError:this.screenshotError,reporterReports:this.reporterReports,magicLinkSending:this.magicLinkSending,magicLinkEmail:this.magicLinkEmail,globalLeaderboardLoading:this.globalLeaderboardLoading,globalLeaderboard:this.globalLeaderboard,elementSelected:this.elementSelected,crossAppLoading:this.crossAppLoading,callbacks:this.callbacks,testerJwt:this.testerJwt,submittedAt:this.submittedAt,step:this.step,selectedReportId:this.selectedReportId,selectedCategory:this.selectedCategory,sdkVersion:this.sdkVersion,reporterComments:this.reporterComments,magicLinkSent:this.magicLinkSent,leaderboardLoading:this.leaderboardLoading,leaderboardEntries:this.leaderboardEntries,lastSubmitQueuedOffline:this.lastSubmitQueuedOffline,featureBoard:this.featureBoard,crossAppReports:this.crossAppReports,allowScreenshotRemove:this.allowScreenshotRemove,unreadCount:()=>this.unreadCount(),tierColor:e=>this.tierColor(e),resolveCustomCategory:e=>this.resolveCustomCategory(e),effectiveMinLength:()=>this.effectiveMinLength(),categoryLabel:e=>this.categoryLabel(e),categoryIcon:e=>this.categoryIcon(e),assistantTurns:this.assistantTurns,assistantSending:this.assistantSending,assistantError:this.assistantError}}attachHandlers(e){let r=this.locale;e.querySelector('[data-action="close"]')?.addEventListener("click",()=>this.close()),e.querySelector('[data-action="back"]')?.addEventListener("click",()=>{this.step==="intent"?(this.step="category",this.selectedCategory=null):this.step==="details"?this.viaFeatureRequest?(this.step="category",this.selectedCategory=null,this.selectedIntent=null,this.viaFeatureRequest=false):(this.step="intent",this.selectedIntent=null):this.step==="reports"?this.step="category":this.step==="report-detail"?(this.step="reports",this.selectedReportId=null):this.step==="leaderboard"?this.step="reports":this.step==="roadmap"?this.step="category":this.step==="assistant"&&(this.step="category"),this.render();}),e.querySelector('[data-action="assistant"]')?.addEventListener("click",()=>{this.openAssistantTab();}),e.querySelectorAll('[data-action="assistant-suggest"]').forEach(a=>{a.addEventListener("click",()=>{let o=a.dataset.value;o&&this.sendAssistantMessage(o);});});{let a=e.querySelector('[data-action="assistant-send"]');if(a){let o=a.querySelector(".mushi-assistant-input");a.addEventListener("submit",l=>{l.preventDefault();let m=o?.value??"";o&&(o.value=""),this.sendAssistantMessage(m);}),o?.addEventListener("keydown",l=>{l.key==="Enter"&&!l.shiftKey&&(l.preventDefault(),a.requestSubmit());});}}e.querySelector('[data-action="reports"]')?.addEventListener("click",()=>{this.loadReporterReports();}),e.querySelector('[data-action="roadmap"]')?.addEventListener("click",()=>{this.loadFeatureBoard();}),e.querySelectorAll("[data-vote-id]").forEach(a=>{a.addEventListener("click",()=>{let o=a.dataset.voteId;o&&this.voteFeatureBoard(o);});}),e.querySelector('[data-action="feature-request"]')?.addEventListener("click",()=>{this.selectedCategory="other",this.selectedIntent=ot,this.viaFeatureRequest=true,this.step="details",this.render();}),e.querySelectorAll("[data-report-id]").forEach(a=>{a.addEventListener("click",()=>{let o=a.dataset.reportId;o&&this.loadReporterComments(o);});}),e.querySelector('[data-action="open-leaderboard"]')?.addEventListener("click",()=>{this.step="leaderboard",this.callbacks.onLeaderboardOpen?.(),this.callbacks.onGlobalLeaderboardOpen?.(),this.render();}),e.querySelector('[data-action="open-account"]')?.addEventListener("click",()=>{this.step="account",this.render();}),e.querySelector('[data-action="open-cross-app-reports"]')?.addEventListener("click",()=>{this.step="cross-app-reports",this.crossAppLoading=true,this.crossAppReports=null,this.render(),this.callbacks.onCrossAppReportsOpen?this.callbacks.onCrossAppReportsOpen():(this.crossAppLoading=false,this.crossAppReports=[],this.render());}),e.querySelector('[data-action="open-global-leaderboard"]')?.addEventListener("click",()=>{this.step="leaderboard",this.globalLeaderboard=null,this.globalLeaderboardLoading=true,this.render(),this.callbacks.onGlobalLeaderboardOpen?this.callbacks.onGlobalLeaderboardOpen():(this.globalLeaderboardLoading=false,this.globalLeaderboard=[],this.render());}),e.querySelector('[data-action="send-magic-link"]')?.addEventListener("click",()=>{this.handleMagicLinkSend(e);}),e.querySelector('[data-action="resend-magic-link"]')?.addEventListener("click",()=>{this.magicLinkSent=false,this.magicLinkError="",this.render();}),e.querySelector('[data-action="sign-out-tester"]')?.addEventListener("click",()=>{this.testerJwt=null,this.testerInfo=null,this.testerReputation=null,this.crossAppReports=null,this.magicLinkSent=false,this.magicLinkEmail="",this.step="category",this.callbacks.onTesterSignOut?.(),this.render();}),e.querySelector('[data-action="reporter-reply"]')?.addEventListener("click",()=>{this.submitReporterReply(e);}),e.querySelector('[data-action="reporter-confirms"]')?.addEventListener("click",()=>{this.submitReporterFeedback("confirms");}),e.querySelector('[data-action="reporter-not-fixed"]')?.addEventListener("click",()=>{this.submitReporterReopen();}),e.querySelector('[data-action="copy-report-id"]')?.addEventListener("click",a=>{let o=a.currentTarget,l=o.dataset.copyId;if(!l)return;let m=o.innerHTML,c=()=>{o.innerHTML="Copied \u2713",window.setTimeout(()=>{o.isConnected&&(o.innerHTML=m);},1600);};try{navigator.clipboard?.writeText?navigator.clipboard.writeText(l).then(c).catch(()=>c()):c();}catch{c();}}),e.querySelectorAll("[data-category]").forEach(a=>{a.addEventListener("click",()=>{let o=a.dataset.category??"other";this.selectedCategory=o;let l=this.resolveCustomCategory(o);this.step=l&&(!l.intents||l.intents.length===0)?"details":"intent",this.render();});}),e.querySelectorAll("[data-intent]").forEach(a=>{a.addEventListener("click",()=>{this.selectedIntent=a.dataset.intent??null,this.step="details",this.render();});});let n=e.querySelector(".mushi-textarea"),s=e.querySelector('[data-role="char-current"]');if(n&&s){let a=this.effectiveMinLength(),o=()=>{let l=n.value.trim().length;s.textContent=String(l);let m=e.querySelector('[data-role="char-counter"]');m&&(m.style.color=l>=a?"var(--mushi-ok, #22c55e)":"");};n.addEventListener("input",o);}e.querySelectorAll("[data-example]").forEach(a=>{a.addEventListener("click",()=>{let o=a.dataset.example??"";n&&(n.value=o,n.focus(),n.dispatchEvent(new Event("input")));});}),e.querySelector('[data-action="screenshot"]')?.addEventListener("click",()=>{this.callbacks.onScreenshotRequest();}),e.querySelector('[data-action="remove-screenshot"]')?.addEventListener("click",()=>{this.callbacks.onScreenshotRemove?.();}),e.querySelector('[data-action="annotate-screenshot"]')?.addEventListener("click",()=>{let a=e.querySelector('[data-role="annotate-host"]');a&&this.callbacks.onScreenshotAnnotateRequest&&this.callbacks.onScreenshotAnnotateRequest(a);}),e.querySelector('[data-action="element"]')?.addEventListener("click",()=>{this.callbacks.onElementSelectorRequest?.();});let i=()=>{let a=e.querySelector(".mushi-textarea"),o=a?.value?.trim()??"",l=e.querySelector(".mushi-error"),m=this.effectiveMinLength();if(o.length<m){if(l){let g=`${r.step3.tooShort} (${o.length}/${m})`;l.textContent=g,l.style.display="block",a?.focus();}return}this.submitting=true,this.submittedAt=new Date,this.lastReportId=null,this.lastSubmitQueuedOffline=false,this.render();let c=(async()=>{try{let g=this.selectedCategory,h=this.resolveBaseCategory(g),f=this.config.categories&&this.config.categories.length>0,d=this.callbacks.onSubmit({category:h,...f?{userCategory:g}:{},description:o,intent:this.selectedIntent??void 0});return d&&typeof d.then=="function"?await d??null:null}catch{return {reportId:null,queuedOffline:true}}})();this.successTimer=setTimeout(()=>{this.successTimer=null,this.submitting=false,this.step="success",this.render(),c.then(g=>{if(this.step!=="success")return;g&&(this.lastReportId=g.reportId??null,this.lastSubmitQueuedOffline=!!g.queuedOffline,this.render()),this.autoCloseTimer!==null&&clearTimeout(this.autoCloseTimer);let h=this.lastReportId&&this.config.dashboardUrl?6e3:2800;this.autoCloseTimer=setTimeout(()=>{this.autoCloseTimer=null,this.step==="success"&&this.close();},h);});},500);};e.querySelector('[data-action="submit"]')?.addEventListener("click",i),e.addEventListener("keydown",a=>{if(a.key==="Escape"){this.close();return}this.step==="details"&&wr(a)&&(a.preventDefault(),i());});}trapFocus(e){requestAnimationFrame(()=>{let r=e.querySelector("textarea");if(r){r.focus();return}let n=e.querySelectorAll("button, textarea, [tabindex]");n.length>0&&n[0].focus();});}unreadCount(){return this.reporterReports.reduce((e,r)=>e+(r.unread_count??0),0)}async loadFeatureBoard(){this.step="roadmap",this.reporterLoading=true,this.reporterError=null,this.render();try{this.featureBoard=await this.callbacks.onFeatureBoardRequest?.()??[];}catch(e){this.reporterError=e instanceof Error?e.message:"Could not load community ideas.";}finally{this.reporterLoading=false,this.render();}}async voteFeatureBoard(e){if(!(!this.callbacks.onFeatureBoardVote||this.reporterLoading)){this.reporterLoading=true,this.render();try{await this.callbacks.onFeatureBoardVote(e),this.featureBoard=await this.callbacks.onFeatureBoardRequest?.()??this.featureBoard;}catch(r){this.reporterError=r instanceof Error?r.message:"Could not update vote.";}finally{this.reporterLoading=false,this.render();}}}async submitReporterReopen(){let e=this.selectedReportId;if(!(!e||this.reporterLoading)){this.reporterLoading=true,this.render();try{this.callbacks.onReporterReopen?await this.callbacks.onReporterReopen(e,"Not fixed for me"):await this.callbacks.onReporterFeedback?.(e,"not_fixed","Not fixed for me"),await this.loadReporterReports();}catch(r){this.reporterError=r instanceof Error?r.message:"Could not reopen report.";}finally{this.reporterLoading=false,this.render();}}}async loadReporterReports(){this.step="reports",this.reporterLoading=true,this.reporterError=null,this.render();try{this.reporterReports=await this.callbacks.onReporterReportsRequest?.()??[];}catch(e){this.reporterError=e instanceof Error?e.message:"Could not load reports.";}finally{this.reporterLoading=false,this.render();}}async loadReporterComments(e){this.selectedReportId=e,this.step="report-detail",this.reporterLoading=true,this.reporterError=null,this.render();try{this.reporterComments=await this.callbacks.onReporterCommentsRequest?.(e)??[];}catch(r){this.reporterError=r instanceof Error?r.message:"Could not load thread.";}finally{this.reporterLoading=false,this.render();}}async submitReporterFeedback(e){let r=this.selectedReportId;if(!(!r||this.reporterLoading)){this.reporterLoading=true,this.render();try{await this.callbacks.onReporterFeedback?.(r,e),await this.loadReporterReports(),r&&await this.loadReporterComments(r);}catch(n){this.reporterError=n instanceof Error?n.message:"Could not send feedback.",this.reporterLoading=false,this.render();}}}async submitReporterReply(e){let r=this.selectedReportId,n=e.querySelector('[data-role="reporter-reply"]'),s=e.querySelector('[data-action="reporter-reply"]'),i=n?.value.trim()??"";if(!(!r||!i||this.reporterLoading)){this.reporterLoading=true,s&&(s.disabled=true),this.render();try{await this.callbacks.onReporterReply?.(r,i),n&&(n.value=""),await this.loadReporterComments(r);}catch(a){this.reporterError=a instanceof Error?a.message:"Could not send reply.",this.reporterLoading=false,this.render();}}}async handleMagicLinkSend(e){if(this.magicLinkSending)return;let n=(e.querySelector('[data-role="magic-link-email"]')?.value??this.magicLinkEmail).trim();if(!n||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)){this.magicLinkError="Please enter a valid email address.",this.render();return}this.magicLinkEmail=n,this.magicLinkError="",this.magicLinkSending=true,this.render();try{await this.callbacks.onMushiSignIn?.(n),this.magicLinkSent=!0;}catch(s){this.magicLinkError=s instanceof Error?s.message:"Could not send sign-in link. Try again.";}finally{this.magicLinkSending=false,this.render();}}getRecorderStep(){return this.step}getRecorderTrigger(){return this.shadow.querySelector(".mushi-trigger")}getRecorderCategoryButton(e){return this.shadow.querySelector(`[data-category="${e}"]`)}getRecorderIntentButton(e){return Array.from(this.shadow.querySelectorAll("[data-intent]")).find(r=>r.dataset.intent===e)??null}getRecorderSubmitButton(){return this.shadow.querySelector('[data-action="submit"]')}recorderClickTrigger(){this.isOpen&&this.close(),this.open();}recorderSelectCategory(e){this.isOpen||this.open(),this.step!=="category"&&(this.selectedCategory=null,this.selectedIntent=null,this.step="category",this.render()),this.selectedCategory=e,this.step="intent",this.render();}recorderSelectIntent(e){!this.isOpen||this.step!=="intent"||(this.selectedIntent=e,this.step="details",this.render());}recorderFocusDescription(){this.shadow.querySelector(".mushi-textarea")?.focus();}recorderSubmit(){this.shadow.querySelector('[data-action="submit"]')?.click();}recorderOpenMyReports(){this.isOpen||this.open(),this.loadReporterReports();}};function qe(t){if(!t)return null;let e=t.getBoundingClientRect();return e.width===0&&e.height===0?null:{x:e.left+e.width/2,y:e.top+e.height/2}}function Rr(t){if(typeof globalThis>"u")return;let e={ready:()=>t.getIsMounted(),getStep:()=>t.getRecorderStep(),getTriggerCenter:()=>qe(t.getRecorderTrigger()),getCategoryCenter:r=>qe(t.getRecorderCategoryButton(r)),getIntentCenter:r=>qe(t.getRecorderIntentButton(r)),getSubmitCenter:()=>qe(t.getRecorderSubmitButton()),clickTrigger:()=>t.recorderClickTrigger(),selectCategory:r=>t.recorderSelectCategory(r),selectIntent:r=>t.recorderSelectIntent(r),focusDescription:()=>t.recorderFocusDescription(),submit:()=>t.recorderSubmit(),openMyReports:()=>t.recorderOpenMyReports()};globalThis.__mushiRecorder=e;}var Ir="mushi_session_min_day_",Me=[],lt=null,ct=null,ce=null,pt=null,Ar=null,xe=null,fe=false,$e=null,ht=0,Ts=300*1e3,_r=0,Ms=900*1e3;function mt(){return Date.now()<_r}function gt(t){t?.startsWith("HTTP_4")&&(_r=Date.now()+Ms);}var Cr=new Set;function ut(t){return `mushi_rewards_consent_${t}`}function $s(t){try{return localStorage.getItem(ut(t))==="1"}catch{return false}}function dt(t,e){try{e?localStorage.setItem(ut(t),"1"):localStorage.removeItem(ut(t)),fe=e,xe?.submitActivity(ce??"",[],{optedIn:e}).catch(()=>{});}catch{}}function Pr(){return new Date().toISOString().slice(0,10)}function Dr(t){try{let e=sessionStorage.getItem(`${Ir}${t}_${Pr()}`);return e?parseInt(e,10):0}catch{return 0}}function Ls(t){let e=Pr(),r=`${Ir}${t}_${e}`;try{let n=Dr(t)+1;return sessionStorage.setItem(r,String(n)),n}catch{return 99}}function Or(t){xe=t.client,ce=t.userId,pt=t.traits??null,Ar=t.reporterToken??null;let{projectId:e}=t,r=Math.max(3e4,t.config.flushIntervalMs??3e5);t.config.consentMode==="auto"?(fe=true,dt(e,true)):fe=$s(e),t.config.trackActivity&&_s(e),lt&&clearInterval(lt),lt=setInterval(()=>Is(t),r),ct&&clearInterval(ct),ct=setInterval(()=>{if(!fe||!ce)return;let n=Dr(e);n<60&&(Ls(e),Se({action:"session_minute",metadata:{minutes_today:n+1}}));},6e4),t.config.showInWidget&&ft(ce).then(n=>{n&&Fr(n,t.config);}),t.config.consentMode!=="auto"&&!fe&&Ps(e,t.config);}function Hr(t,e){ce=t,pt=e??null,$e=null,ht=0;}function Se(t){!fe||!ce||Me.push({...t,queuedAt:Date.now()});}async function Is(t){if(!fe||!ce||Me.length===0)return;let e=null;if(t.config.verifyUserToken)try{e=await t.config.verifyUserToken();}catch{}if(mt())return;let r=Me.splice(0,100);try{let n=await t.client.submitActivity(ce,r,{userTraits:pt??void 0,reporterTokenHash:Ar??void 0,optedIn:!0,hostJwt:e??void 0});n.ok||(gt(n.error?.code),n.error?.code?.startsWith("HTTP_4")||Me.unshift(...r.slice(0,50)));}catch{Me.unshift(...r.slice(0,50));}}async function Br(t){let e=Date.now();return $e&&e-ht<Ts?$e:ft(t)}async function ft(t){if(!xe||mt())return null;let e=await xe.getMyTier(t);return e.ok&&e.data?($e=e.data,ht=Date.now(),$e):(gt(e.error?.code),null)}async function Nr(t=10){if(!xe||mt())return null;try{let e=await xe.getHallOfFame(t);return e.ok&&e.data?(e.data.data??[]).map(r=>({display_name:r.display_name,tier_name:r.tier_name,total_points:r.total_points,points_30d:r.points_30d})):(gt(e.error?.code),null)}catch{return null}}var Tr=null,Mr=null,$r=null,Lr="";function _s(t){let e=()=>{let n=location.pathname;if(n===Lr)return;Lr=n,!Cr.has(`${t}:${n}`)&&(Cr.add(`${t}:${n}`),Se({action:"screen_view_unique_per_day",metadata:{route:n}}));};$r=history.pushState.bind(history),history.pushState=function(...n){$r(...n),e();},window.addEventListener("popstate",e),e(),Tr=new MutationObserver(()=>e());let r=document.querySelector("main")??document.body;Tr.observe(r,{childList:true,subtree:false}),Mr=n=>{let s=n.target.closest("[data-testid]");if(!s)return;let i=s.dataset.testid;i&&Se({action:"element_selected",metadata:{testid:i,route:location.pathname}});},document.addEventListener("click",Mr,{capture:true,passive:true});}var ge=null;function Fr(t,e){if(!e.showInWidget)return;ge&&ge.remove(),ge=document.createElement("div"),ge.id="mushi-tier-badge",Object.assign(ge.style,{position:"fixed",bottom:"56px",right:"16px",zIndex:"2147483645",fontFamily:"system-ui, sans-serif"});let r=ge.attachShadow({mode:"closed"});r.innerHTML=`
|
|
2050
|
+
<style>
|
|
2051
|
+
:host { display: block; }
|
|
2052
|
+
.badge {
|
|
2053
|
+
display: inline-flex;
|
|
2054
|
+
align-items: center;
|
|
2055
|
+
gap: 6px;
|
|
2056
|
+
padding: 4px 10px;
|
|
2057
|
+
border-radius: 999px;
|
|
2058
|
+
background: rgba(0,0,0,0.75);
|
|
2059
|
+
color: #fff;
|
|
2060
|
+
font-size: 11px;
|
|
2061
|
+
font-weight: 600;
|
|
2062
|
+
letter-spacing: 0.02em;
|
|
2063
|
+
backdrop-filter: blur(6px);
|
|
2064
|
+
cursor: default;
|
|
2065
|
+
user-select: none;
|
|
2066
|
+
}
|
|
2067
|
+
.dot {
|
|
2068
|
+
width: 6px;
|
|
2069
|
+
height: 6px;
|
|
2070
|
+
border-radius: 50%;
|
|
2071
|
+
background: #6c47ff;
|
|
2072
|
+
flex-shrink: 0;
|
|
2073
|
+
}
|
|
2074
|
+
</style>
|
|
2075
|
+
<div class="badge">
|
|
2076
|
+
<span class="dot"></span>
|
|
2077
|
+
<span>${t.displayName}</span>
|
|
2078
|
+
</div>
|
|
2079
|
+
`,document.body.appendChild(ge);}var le=null;function Ps(t,e){if(le)return;le=document.createElement("div"),le.id="mushi-consent-banner",Object.assign(le.style,{position:"fixed",bottom:"80px",right:"16px",zIndex:"2147483646",maxWidth:"280px",fontFamily:"system-ui, sans-serif"});let r=le.attachShadow({mode:"closed"});r.innerHTML=`
|
|
2080
|
+
<style>
|
|
2081
|
+
:host { display: block; }
|
|
2082
|
+
.banner {
|
|
2083
|
+
background: #fff;
|
|
2084
|
+
border: 1px solid #e5e7eb;
|
|
2085
|
+
border-radius: 12px;
|
|
2086
|
+
box-shadow: 0 8px 24px rgba(0,0,0,0.12);
|
|
2087
|
+
padding: 14px 16px;
|
|
2088
|
+
font-size: 13px;
|
|
2089
|
+
line-height: 1.5;
|
|
2090
|
+
color: #374151;
|
|
2091
|
+
}
|
|
2092
|
+
.title { font-weight: 700; margin-bottom: 6px; color: #111827; }
|
|
2093
|
+
.actions { display: flex; gap: 8px; margin-top: 10px; }
|
|
2094
|
+
button {
|
|
2095
|
+
flex: 1;
|
|
2096
|
+
padding: 6px 10px;
|
|
2097
|
+
border-radius: 6px;
|
|
2098
|
+
border: none;
|
|
2099
|
+
cursor: pointer;
|
|
2100
|
+
font-size: 12px;
|
|
2101
|
+
font-weight: 600;
|
|
2102
|
+
}
|
|
2103
|
+
.accept { background: #6c47ff; color: #fff; }
|
|
2104
|
+
.decline { background: #f3f4f6; color: #374151; }
|
|
2105
|
+
</style>
|
|
2106
|
+
<div class="banner">
|
|
2107
|
+
<div class="title">\u{1F3AF} Earn rewards</div>
|
|
2108
|
+
<div>Help improve this app and earn points, badges, and perks for your contributions.</div>
|
|
2109
|
+
<div class="actions">
|
|
2110
|
+
<button class="accept" id="accept">Enable</button>
|
|
2111
|
+
<button class="decline" id="decline">No thanks</button>
|
|
2112
|
+
</div>
|
|
2113
|
+
</div>
|
|
2114
|
+
`,r.getElementById("accept")?.addEventListener("click",()=>{dt(t,true),le?.remove(),le=null,e.showInWidget&&ce&&ft(ce).then(n=>{n&&Fr(n,e);});}),r.getElementById("decline")?.addEventListener("click",()=>{dt(t,false),le?.remove(),le=null;}),document.body.appendChild(le);}function bt(){let t=[],e={},r=["log","warn","error","info","debug"];for(let n of r){let s=console[n];e[n]=s,console[n]=(...i)=>{let a=i.map(l=>{try{return typeof l=="string"?l:JSON.stringify(l)}catch{return String(l)}}).join(" ").slice(0,500),o={level:n,message:a,timestamp:Date.now()};n==="error"&&i[0]instanceof Error&&(o.stack=i[0].stack?.slice(0,1e3)),t.push(o),t.length>50&&t.shift(),s.call(console,...i);};}return {getEntries(){return [...t]},clear(){t.length=0;},destroy(){for(let n of r)e[n]&&(console[n]=e[n]);}}}var Ds=[/\/v1\/sdk(?:\/|$)/,/\/v1\/reports(?:\/|$)/,/\/v1\/notifications(?:\/|$)/,/\/v1\/reputation(?:\/|$)/];function je(t){return typeof t=="string"?t:t instanceof URL?t.href:t.url}function ze(t,e){let r=e?.[ve];if(r)return r;let n=Bs(e?.headers,Re);if(n)return n;if(typeof Request<"u"&&t instanceof Request){let s=t.headers.get(Re);if(s)return s}return null}function We(t,e={}){if([...Ds,...e.ignoreUrls??[]].some(s=>Os(t,s)))return true;let n=Hs(e.apiEndpoint);return n?yt(t).startsWith(n):false}function Os(t,e){return typeof e=="string"?yt(t).includes(e):(e.lastIndex=0,e.test(t))}function Hs(t){if(!t)return null;let e=yt(t),r=e.length;for(;r>0&&e.charCodeAt(r-1)===47;)r--;return e.slice(0,r)}function yt(t){try{return new URL(t,typeof location<"u"?location.href:"http://localhost").href}catch{return t}}function Bs(t,e){if(!t)return null;if(typeof Headers<"u"&&t instanceof Headers)return t.get(e);if(Array.isArray(t))return t.find(([s])=>s.toLowerCase()===e.toLowerCase())?.[1]??null;let r=t;return r[e]??r[e.toLowerCase()]??null}var Ns=30,Fs="00";function Us(){let t=crypto.getRandomValues(new Uint8Array(16)),e=crypto.getRandomValues(new Uint8Array(8)),r=i=>Array.from(i).map(a=>a.toString(16).padStart(2,"0")).join(""),n=r(t),s=r(e);return {traceparent:`${Fs}-${n}-${s}-01`,traceId:n,spanId:s}}function qs(t,e){for(let r of e)if(typeof r=="string"){if(t.includes(r))return true}else if(r.test(t))return true;return false}function vt(t={}){let e=[],r=globalThis.fetch,n=t;globalThis.fetch=async function(a,o){let l=Date.now(),m=o?.method?.toUpperCase()??"GET",c=je(a),h=!ze(a,o)&&!We(c,n),f,d=o,b=n.tracePropagation;if(h&&b?.enabled&&b.corsUrls?.length&&qs(c,b.corsUrls)){let{traceparent:R,traceId:T}=Us();f=T;let x=o?.headers?new Headers(o.headers):new Headers;x.set("traceparent",R),n.sessionId&&x.set("x-mushi-session",n.sessionId),d={...o,headers:x};}try{let R=await r.call(globalThis,a,d);return h&&s({method:m,url:Ur(c),status:R.status,duration:Date.now()-l,timestamp:l,...f?{traceId:f}:{}}),R}catch(R){throw h&&s({method:m,url:Ur(c),status:0,duration:Date.now()-l,timestamp:l,error:R instanceof Error?R.message:"Network error",...f?{traceId:f}:{}}),R}};function s(i){e.push(i),e.length>Ns&&e.shift();}return {getEntries(){return [...e]},clear(){e.length=0;},updateOptions(i){n=i;},destroy(){globalThis.fetch=r;}}}function Ur(t){try{let e=new URL(t),r=e.pathname+e.search;return r.length>200?e.origin+r.slice(0,200)+"...":e.origin+r}catch{return t.slice(0,200)}}function xt(t={}){let e=t;async function r(){try{if(typeof document>"u")return null;let n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return null;let i=window.innerWidth,a=window.innerHeight,o=Math.min(window.devicePixelRatio||1,2);n.width=i*o,n.height=a*o,s.scale(o,o);let l=zs(e.privacy),m=`
|
|
2115
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${a}">
|
|
2116
|
+
<foreignObject width="100%" height="100%">
|
|
2117
|
+
<div xmlns="http://www.w3.org/1999/xhtml">
|
|
2118
|
+
${new XMLSerializer().serializeToString(l)}
|
|
2119
|
+
</div>
|
|
2120
|
+
</foreignObject>
|
|
2121
|
+
</svg>
|
|
2122
|
+
`,c=new Image,g=new Blob([m],{type:"image/svg+xml;charset=utf-8"}),h=URL.createObjectURL(g);return new Promise(f=>{c.onload=()=>{try{s.drawImage(c,0,0,i,a),URL.revokeObjectURL(h),f(n.toDataURL("image/jpeg",.7));}catch{URL.revokeObjectURL(h),f(qr(i,a));}},c.onerror=()=>{URL.revokeObjectURL(h),f(qr(i,a));},c.src=h;})}catch{return null}}return {take:r,updateOptions(n){e=n;}}}var js=['input[type="password"]',"[data-mushi-redact]"];function zs(t){let e=document.documentElement.cloneNode(true);e.querySelector("#mushi-mushi-widget")?.remove(),Vs(e);let r=t?.redactSelectors!==void 0?t.redactSelectors:js;for(let n of r)for(let s of wt(e,n))Ws(s);for(let n of t?.blockSelectors??[])for(let s of wt(e,n))s.remove();for(let n of t?.maskSelectors??[])for(let s of wt(e,n))Gs(s);return e}function wt(t,e){try{return Array.from(t.querySelectorAll(e))}catch{return []}}function Ws(t){for((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.value="",t.setAttribute("value","")),t.textContent="",t.setAttribute("style",`${t.getAttribute("style")??""};background:#000!important;color:#000!important;text-shadow:none!important;border-color:#000!important;`),t.setAttribute("data-mushi-redacted","true");t.firstChild;)t.removeChild(t.firstChild);}function Vs(t){let e=typeof location<"u"?location.origin:"";for(let r of t.querySelectorAll("img, video, iframe, object, embed, picture"))r.remove();for(let r of t.querySelectorAll('link[rel="stylesheet"], link[as="style"]')){let n=r.getAttribute("href");(!n||Ks(n,e))&&r.remove();}for(let r of t.querySelectorAll("script"))r.remove();}function Ks(t,e){if(!t||t.startsWith("data:")||t.startsWith("blob:"))return false;try{let r=new URL(t,typeof location<"u"?location.href:"http://localhost/");return !!e&&r.origin!==e}catch{return true}}function qr(t,e){let r=document.createElement("canvas"),n=r.getContext("2d");if(!n)return null;r.width=t,r.height=e,n.fillStyle="#111827",n.fillRect(0,0,t,e),n.fillStyle="#e5e7eb",n.font="13px system-ui, sans-serif",n.fillText("Screenshot: layout captured (external media stripped)",16,28),n.fillText(`${t}\xD7${e}px`,16,48);try{return r.toDataURL("image/jpeg",.7)}catch{return null}}function Gs(t){(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.value="",t.setAttribute("value",""),t.setAttribute("placeholder","\u2022\u2022\u2022\u2022")),t.textContent=t.children.length===0?"\u2022\u2022\u2022\u2022":t.textContent,t.setAttribute("style",`${t.getAttribute("style")??""};background:#8f8f8f!important;color:transparent!important;text-shadow:none!important;`),t.setAttribute("data-mushi-masked","true");}function Ys(t){if(!t||!t.tagName)return;let e=t,r=e.tagName.toLowerCase(),n=e.id?`#${e.id}`:"",s=e.classList&&e.classList.length>0?`.${e.classList[0]}`:"";return `${r}${n}${s}`}function St(){let t={},e=[];if(typeof PerformanceObserver<"u"){try{let r=new PerformanceObserver(n=>{for(let s of n.getEntries())s.name==="first-contentful-paint"&&(t.fcp=s.startTime);});r.observe({type:"paint",buffered:!0}),e.push(r);}catch{}try{let r=new PerformanceObserver(n=>{let s=n.getEntries();s.length>0&&(t.lcp=s[s.length-1].startTime);});r.observe({type:"largest-contentful-paint",buffered:!0}),e.push(r);}catch{}try{let r=0,n=new PerformanceObserver(s=>{for(let i of s.getEntries())i.hadRecentInput||(r+=i.value??0,t.cls=r);});n.observe({type:"layout-shift",buffered:!0}),e.push(n);}catch{}try{let r=0,n=new PerformanceObserver(s=>{r+=s.getEntries().length,t.longTasks=r;});n.observe({type:"longtask",buffered:!0}),e.push(n);}catch{}try{let r=new Map,n=new PerformanceObserver(s=>{for(let i of s.getEntries()){let a=i.interactionId;if(!a)continue;let o=r.get(a)??0;if(i.duration>o&&r.set(a,i.duration),i.duration>(t.inp??0)){t.inp=i.duration;let l=i.processingStart-i.startTime,m=i.processingEnd-i.processingStart,c=i.startTime+i.duration-i.processingEnd;t.inpAttribution={eventType:i.name,targetSelector:Ys(i.target),inputDelay:Math.max(0,l),processingDuration:Math.max(0,m),presentationDelay:Math.max(0,c)};}}});n.observe({type:"event",durationThreshold:40,buffered:!0}),e.push(n);}catch{}try{let r=new PerformanceObserver(n=>{for(let s of n.getEntries())t.fid===void 0&&(t.fid=s.processingStart-s.startTime);});r.observe({type:"first-input",buffered:!0}),e.push(r);}catch{}}if(typeof performance<"u"&&performance.getEntriesByType)try{let r=performance.getEntriesByType("navigation");r.length>0&&r[0]&&(t.ttfb=r[0].responseStart-r[0].requestStart);}catch{}return {getMetrics(){return {...t}},destroy(){for(let r of e)r.disconnect();e.length=0;}}}function Et(){let t=false,e=null,r=null;function n(d){let b=d,R=0;for(;b&&R<20;){let T=b.getAttribute?.("data-testid");if(T)return T;b=b.parentElement,R++;}return null}function s(d){let b=[],R=d;for(;R&&R!==document.body;){let T=1,x=R.previousElementSibling;for(;x;)x.tagName===R.tagName&&T++,x=x.previousElementSibling;let S=R.tagName.toLowerCase();b.unshift(T>1?`${S}[${T}]`:S),R=R.parentElement;}return "//"+b.join("/")}function i(d){let b=d.getBoundingClientRect();return {tagName:d.tagName.toLowerCase(),id:d.id||void 0,className:d.className||void 0,textContent:d.textContent?.trim().slice(0,200)||void 0,xpath:s(d),rect:{x:Math.round(b.x),y:Math.round(b.y),width:Math.round(b.width),height:Math.round(b.height)},nearestTestid:n(d)||void 0,route:typeof window<"u"?window.location.pathname:void 0}}function a(){let d=document.createElement("div");return d.style.cssText=`
|
|
2123
|
+
position: fixed;
|
|
2124
|
+
pointer-events: none;
|
|
2125
|
+
z-index: 2147483647;
|
|
2126
|
+
border: 2px solid #6366f1;
|
|
2127
|
+
background: rgba(99, 102, 241, 0.1);
|
|
2128
|
+
border-radius: 4px;
|
|
2129
|
+
transition: all 0.1s ease;
|
|
2130
|
+
display: none;
|
|
2131
|
+
`,document.body.appendChild(d),d}function o(d){if(!e)return;let b=d.getBoundingClientRect();e.style.left=`${b.left}px`,e.style.top=`${b.top}px`,e.style.width=`${b.width}px`,e.style.height=`${b.height}px`,e.style.display="block";}function l(d){let b=d.target;b!==e&&o(b);}function m(d){d.preventDefault(),d.stopPropagation();let b=d.target;if(b===e||(d.composedPath?d.composedPath():[]).some(S=>S instanceof Element&&S.id==="mushi-mushi-widget"))return;let x=i(b);g(x);}function c(d){d.key==="Escape"&&g(null);}function g(d){f(),r?.(d),r=null;}function h(){return t&&f(),new Promise(d=>{r=d,t=true,e=a(),document.body.style.cursor="crosshair",document.addEventListener("mousemove",l,true),document.addEventListener("click",m,true),document.addEventListener("keydown",c,true);})}function f(){t&&(t=false,document.body.style.cursor="",document.removeEventListener("mousemove",l,true),document.removeEventListener("click",m,true),document.removeEventListener("keydown",c,true),e&&(e.remove(),e=null));}return {activate:h,deactivate:f,isActive:()=>t}}function kt(){let t=[],e=history.pushState,r=history.replaceState,n=()=>a("popstate"),s=()=>a("hashchange");a("initial");function i(l){t.push(l),t.length>120&&t.shift();}function a(l){typeof location>"u"||i({ts:Date.now(),kind:"route",payload:{source:l,route:`${location.pathname}${location.search}${location.hash}`,href:location.href}});}function o(l){let m=l.target instanceof Element?l.target:null;if(!m)return;let c=m.closest('button,a,[role="button"],input,textarea,select,[data-mushi-track]')??m;i({ts:Date.now(),kind:"click",payload:{tag:c.tagName.toLowerCase(),id:c.id||void 0,text:Xs(c)}});}return history.pushState=function(...m){let c=e.apply(this,m);return a("pushState"),c},history.replaceState=function(...m){let c=r.apply(this,m);return a("replaceState"),c},window.addEventListener("popstate",n),window.addEventListener("hashchange",s),document.addEventListener("click",o,true),{setScreen(l){i({ts:Date.now(),kind:"screen",payload:l});},getEntries(l={}){return [...t,...(l.consoleLogs??[]).map(c=>({ts:c.timestamp,kind:"log",payload:{level:c.level,message:c.message}})),...(l.networkLogs??[]).map(c=>({ts:c.timestamp,kind:"request",payload:{method:c.method,url:c.url,status:c.status,duration:c.duration,error:c.error}}))].sort((c,g)=>c.ts-g.ts).slice(-120)},clear(){t.length=0;},destroy(){history.pushState=e,history.replaceState=r,window.removeEventListener("popstate",n),window.removeEventListener("hashchange",s),document.removeEventListener("click",o,true);}}}function Xs(t){let e=(t.textContent??"").replace(/\s+/g," ").trim();return e?e.slice(0,80):void 0}var Js=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,Zs=/^[0-9a-f]{20,}$/i,Qs=/^\d+$/,eo=/^[a-z0-9]{16,}$/i;function jr(t){return t.length===0?t:Js.test(t)||Zs.test(t)||Qs.test(t)||eo.test(t)&&/\d/.test(t)?"[id]":t}function zr(t,e){let r=t.length>1&&t.endsWith("/")?t.slice(0,-1):t;if(e?.length){let n=to(r,e);if(n)return n}return "/"+r.split("/").filter(n=>n.length>0).map(jr).join("/")}function to(t,e){let r=t.split("/").filter(s=>s.length>0),n=[...e].sort((s,i)=>i.split("/").length-s.split("/").length);for(let s of n){let i=s.split("/").filter(o=>o.length>0);if(i.length!==r.length)continue;let a=true;for(let o=0;o<i.length;o++){let l=i[o],m=r[o];if(!(l.startsWith("[")&&l.endsWith("]"))&&!l.startsWith(":")&&l!==m){a=false;break}}if(a)return "/"+i.join("/")}return null}function ro(){if(typeof document>"u")return [];let t=new Set,e=document.querySelectorAll("[data-testid]");for(let r of Array.from(e)){let n=r.getAttribute("data-testid");n&&n.length>0&&n.length<120&&t.add(n);}return Array.from(t).sort()}function no(){if(typeof window>"u")return [];try{let t=new URLSearchParams(window.location.search),e=new Set;return t.forEach((r,n)=>e.add(n)),Array.from(e).sort()}catch{return []}}function so(){if(typeof document>"u")return null;let t=s=>(s??"").replace(/\s+/g," ").trim().slice(0,200),e=t(document.querySelector("h1")?.textContent);if(e)return e;let r=t(document.title);return r||t(document.querySelector("main")?.textContent)||null}async function oo(t){if(!t||typeof crypto>"u"||!crypto.subtle)return null;try{let e=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(r),s="";for(let i=0;i<n.length;i++)s+=n[i].toString(16).padStart(2,"0");return s}catch{return null}}function Rt(t){let{config:e,getRecentNetworkPaths:r,getUserId:n,getSessionId:s,onEvent:i}=t,a=e.throttleMs??6e4,o=e.captureDomSummary!==false,l=e.userIdSource??"auto",m=new Map,c=null,g=null;async function h(){if(typeof window>"u")return;let y=zr(window.location.pathname,e.routeTemplates),k=Date.now(),v=m.get(y)??0;if(k-v<a)return;m.set(y,k);let I=null;l==="auto"?I=n()??s():l==="session-only"&&(I=s());let q={route:y,page_title:typeof document<"u"&&(document.title||"").slice(0,300)||null,dom_summary:o?so():null,testids:ro(),network_paths:r().slice(-50),query_param_keys:no(),user_id_hash:await oo(I),observed_at:new Date().toISOString()};i(q);}function f(){g||(g=setTimeout(()=>{g=null,h();},100));}function d(){if(typeof window>"u")return;let y=window.location.pathname+window.location.search;y!==c&&(c=y,f());}if(typeof window>"u")return {destroy:()=>{},flushNow:()=>{}};let b=window.history.pushState.bind(window.history),R=window.history.replaceState.bind(window.history),T=function(...k){let v=b(...k);return d(),v},x=function(...k){let v=R(...k);return d(),v};window.history.pushState=T,window.history.replaceState=x;let S=()=>d();return window.addEventListener("popstate",S),f(),{destroy(){window.removeEventListener("popstate",S),window.history.pushState===T&&(window.history.pushState=b),window.history.replaceState===x&&(window.history.replaceState=R),g&&(clearTimeout(g),g=null),m.clear();},flushNow(){m.clear(),h();}}}function Wr(t,e,r){let n=l=>l.timestamp,s=l=>l.type===2,i=l=>l.type===4,a=Date.now()-e,o=0;for(let l=0;l<t.length;l++){let m=n(t[l]);if(typeof m=="number"&&m>=a)break;s(t[l])&&(o=i(t[l-1])?l-1:l);}if(t.length-o>r){for(let l=o+1;l<t.length;l++)if(s(t[l])&&t.length-l<=r){o=i(t[l-1])?l-1:l;break}}o>0&&t.splice(0,o);}function io(t){let e=[],r=false,n=i=>{if(!r)return;let a=i.target instanceof Element?i.target:null,o=a?.tagName?.toLowerCase()??"unknown",l=a?.closest("[data-testid]")?.getAttribute("data-testid")??void 0;e.push({type:"lite_click",timestamp:Date.now(),data:{tag:o,testId:l}}),e.length>400&&e.shift();},s=()=>{r=false,document.removeEventListener("click",n,true);};return {start(){r||(r=true,document.addEventListener("click",n,true));},stop:s,flush(){let i=Date.now()-t;return e.filter(a=>a.timestamp>=i)},destroy(){s(),e.length=0;}}}var Ve=null;async function ao(){if(Ve)return Ve;try{return Ve=await import('rrweb'),Ve}catch{return null}}async function Vr(t){let e=t.maxDurationMs??3e4,r=await ao();if(!r?.record)return io(e);let n=r.record,s=[],i=null,a=false,o=['input[type="password"]',...t.redactSelectors??[]],l=()=>{i?.(),i=null,a=false;};return {start(){a||(a=true,i=n({emit(m){s.push(m),Wr(s,e,400);},maskAllInputs:true,maskAllText:true,maskTextSelector:o.join(","),checkoutEveryNms:e,sampling:{mousemove:false,mouseInteraction:true,scroll:150,media:800}})??null);},stop:l,flush(){return Wr(s,e,400),[...s]},destroy(){l(),s.length=0;}}}function Kr(t,e){return new Promise((r,n)=>{let s=new Image;s.onload=()=>{let i=document.createElement("div");i.style.position="relative",i.style.display="inline-block",i.style.maxWidth="100%";let a=document.createElement("canvas"),o=document.createElement("canvas"),l=Math.min(1,720/s.width),m=Math.round(s.width*l),c=Math.round(s.height*l);for(let k of [a,o])k.width=m,k.height=c,k.style.width="100%",k.style.height="auto",k.style.display="block";o.style.position="absolute",o.style.left="0",o.style.top="0",o.style.cursor="crosshair";let g=a.getContext("2d"),h=o.getContext("2d");if(!g||!h){n(new Error("Canvas not supported"));return}g.drawImage(s,0,0,m,c),i.appendChild(a),i.appendChild(o),e.appendChild(i);let f="highlight",d=false,b=null,R=[],T=k=>{let v=o.getBoundingClientRect(),I="touches"in k?k.touches[0]??k.changedTouches[0]:null,q=I?I.clientX:k.clientX,V=I?I.clientY:k.clientY;return {x:(q-v.left)/v.width*m,y:(V-v.top)/v.height*c}},x=()=>{h.clearRect(0,0,m,c);for(let k of R)if(k.tool==="highlight"&&k.points.length>=2){let[v,I]=k.points;h.fillStyle="rgba(255, 230, 0, 0.35)",h.fillRect(Math.min(v.x,I.x),Math.min(v.y,I.y),Math.abs(I.x-v.x),Math.abs(I.y-v.y));}else if(k.tool==="arrow"&&k.points.length>=2){let[v,I]=k.points;h.strokeStyle="#ef4444",h.lineWidth=3,h.beginPath(),h.moveTo(v.x,v.y),h.lineTo(I.x,I.y),h.stroke();}},S=k=>{d=true,b=T(k);},y=k=>{if(!d||!b)return;d=false;let v=T(k);if(f==="blur"){let I=Math.min(b.x,v.x),q=Math.min(b.y,v.y),V=Math.abs(v.x-b.x),_=Math.abs(v.y-b.y);V>=1&&_>=1&&(g.filter="blur(8px)",g.drawImage(a,I,q,V,_,I,q,V,_),g.filter="none");}else R.push({tool:f,points:[b,v]});b=null,x();};o.addEventListener("mousedown",S),o.addEventListener("mouseup",y),o.addEventListener("touchstart",S,{passive:true}),o.addEventListener("touchend",y),r({canvas:a,setTool(k){f=k;},getDataUrl(){let k=document.createElement("canvas");k.width=m,k.height=c;let v=k.getContext("2d");return v?(v.drawImage(a,0,0),v.drawImage(o,0,0),k.toDataURL("image/jpeg",.85)):t},destroy(){o.removeEventListener("mousedown",S),o.removeEventListener("mouseup",y),o.removeEventListener("touchstart",S),o.removeEventListener("touchend",y),i.remove();}});},s.onerror=()=>n(new Error("Failed to load screenshot")),s.src=t;})}function Gr(){try{let t=globalThis;return t.Sentry?t.Sentry:void 0}catch{return}}function lo(){try{return globalThis.__SENTRY_REPLAY__}catch{return}}function co(){try{let t=globalThis,e=t.__SENTRY__,r=t.Sentry;return e?.version==="9"||r&&typeof r.lastEventId=="function"?e?.version==="9"?"v9":"v8":e?.version==="8"?"v8":r&&typeof r.getCurrentHub=="function"?"v7":"unknown"}catch{return "unknown"}}function Ct(t,e={}){let r=Math.max(0,e.breadcrumbsLimit??30),n={},s=Gr();if(!s)return n;n.sdk=co();try{let o=s;if(typeof o.lastEventId=="function")n.eventId=o.lastEventId()??void 0;else {let m=s.getCurrentHub?.()?.getScope?.();n.eventId=m?.getLastEventId?.()??void 0;}}catch{}let i;try{let o=s;typeof o.getCurrentScope=="function"?i=o.getCurrentScope():i=s.getCurrentHub?.()?.getScope?.();}catch{}if(i){try{let o=i.getUser?.();o&&(n.user={id:typeof o.id=="string"?o.id:void 0,email:typeof o.email=="string"?o.email:void 0,username:typeof o.username=="string"?o.username:void 0,ip_address:typeof o.ip_address=="string"?o.ip_address:void 0});}catch{}try{let o=i.getTags?.();if(o&&typeof o=="object"){let l={};for(let[m,c]of Object.entries(o))(typeof c=="string"||typeof c=="number"||typeof c=="boolean")&&(l[m]=c);Object.keys(l).length>0&&(n.tags=l);}}catch{}try{n.transactionName=i.getTransactionName?.()??i.getTransaction?.()?.name??void 0;}catch{}try{n.sessionId=i.getSession?.()?.sid??void 0;}catch{}try{let o=i.getBreadcrumbs?.()??i._breadcrumbs??[];if(Array.isArray(o)&&o.length>0){let l=o.slice(-r);n.breadcrumbs=l.map(m=>{let c=m;return {timestamp:typeof c.timestamp=="number"?c.timestamp<1e12?Math.round(c.timestamp*1e3):c.timestamp:void 0,category:typeof c.category=="string"?c.category:void 0,level:typeof c.level=="string"?c.level:void 0,message:typeof c.message=="string"?c.message:void 0,type:typeof c.type=="string"?c.type:void 0,data:c.data&&typeof c.data=="object"?c.data:void 0}});}}catch{}}try{let o=s,l;if(typeof o.getActiveSpan=="function"?l=o.getActiveSpan():i?.getSpan&&(l=i.getSpan()),l){let m=l.spanContext?.();n.traceId=m?.traceId??l.traceId??void 0,n.spanId=m?.spanId??l.spanId??void 0;}}catch{}let a;try{let o=s;typeof o.getClient=="function"?a=o.getClient():a=s.getCurrentHub?.()?.getClient?.();}catch{}if(a){try{let o=a.getOptions?.();o?.release&&(n.release=o.release),o?.environment&&(n.environment=o.environment);}catch{}try{let o=a.getDsn?.();if(o?.host&&o?.projectId&&n.eventId){let l=o.host.replace(/^o\d+\./,"");n.issueUrl=`https://${l}/issues/?query=${encodeURIComponent(n.eventId)}`;}}catch{}}try{let l=s.getReplay?.()??lo();n.replayId=l?.getReplayId?.()??void 0;}catch{}return n}function Tt(t,e={}){let r=Gr();if(r){try{let n=r;typeof n.setTag=="function"&&(n.setTag("mushi.report_id",t),e.reportUrl&&n.setTag("mushi.report_url",e.reportUrl)),typeof n.setContext=="function"&&n.setContext("mushi_report",{id:t,...e.reportUrl?{url:e.reportUrl}:{},captured_at:new Date().toISOString()}),typeof n.addBreadcrumb=="function"&&n.addBreadcrumb({category:"mushi",type:"info",level:"info",message:`Mushi report submitted (${t})`,data:{report_id:t,...e.reportUrl?{url:e.reportUrl}:{}}});}catch{}try{let s=r.getCurrentHub?.()?.getScope?.();s&&(s.setTag?.("mushi.report_id",t),e.reportUrl&&s.setTag?.("mushi.report_url",e.reportUrl),s.setContext?.("mushi_report",{id:t,...e.reportUrl?{url:e.reportUrl}:{}}));}catch{}}}var uo=["/login","/logout","/signup","/sso/*","/auth/*"];function Xr(t,e={}){let r=[];if(e.rageClick!==false){let b=function(R){let T=Date.now();if(R.target===d){if(f.push(T),f=f.filter(x=>T-x<500),f.length>=3){let x=R.target;t.onTrigger("rage_click",{element:x.tagName,id:x.id,text:x.textContent?.slice(0,50)}),f=[];}}else d=R.target,f=[T];};let f=[],d=null;document.addEventListener("click",b,true),r.push(()=>document.removeEventListener("click",b,true));}if(e.longTask!==false&&typeof PerformanceObserver<"u")try{let f=new PerformanceObserver(d=>{for(let b of d.getEntries())b.duration>5e3&&t.onTrigger("long_task",{duration:Math.round(b.duration),startTime:Math.round(b.startTime)});});f.observe({entryTypes:["longtask"]}),r.push(()=>f.disconnect());}catch{}let n=po(e.apiCascade);if(n.enabled){let f=[],d=globalThis.fetch;globalThis.fetch=async function(...b){let[R,T]=b,x=je(R),S=!!ze(R,T)||We(x,{apiEndpoint:e.apiEndpoint,ignoreUrls:n.ignoreUrls});try{let y=await d.apply(this,b);return !S&&!y.ok&&y.status>=400&&Yr(f,t),y}catch(y){throw S||Yr(f,t),y}},r.push(()=>{globalThis.fetch=d;});}if((e.pageDwell===true||typeof e.pageDwell=="object"&&e.pageDwell!==null)&&typeof window<"u"){let x=function(_){return b.some(K=>K.endsWith("/*")?_.startsWith(K.slice(0,-2)):_===K||_.startsWith(K+"/"))},S=function(){let _=window.location?.pathname??"";x(_)||t.onTrigger("page_dwell",{thresholdMs:d,path:_});},y=function(){R&&clearTimeout(R);let _=window.location?.pathname??"";x(_)||(R=setTimeout(S,d));},k=function(){let _=window.location?.pathname??"";_!==T&&(T=_,y());};let f=typeof e.pageDwell=="object"?e.pageDwell??{}:{},d=f.thresholdMs||300*1e3,b=f.excludeRoutes!==void 0?f.excludeRoutes:uo,R=null,T=window.location?.pathname??"";y();let v=window.history,I=v?.pushState,q=v?.replaceState;v&&I&&q&&(v.pushState=function(..._){let K=I.apply(this,_);return k(),K},v.replaceState=function(..._){let K=q.apply(this,_);return k(),K});let V=()=>k();window.addEventListener("popstate",V),r.push(()=>{R&&clearTimeout(R),window.removeEventListener("popstate",V),v&&I&&(v.pushState=I),v&&q&&(v.replaceState=q);});}if((e.firstSession===true||typeof e.firstSession=="object"&&e.firstSession!==null)&&typeof window<"u"){let f=typeof e.firstSession=="object"?e.firstSession??{}:{},d=f.delayMs??45*1e3,b=f.storageKey??(e.projectId?`mushi:${e.projectId}:firstSessionShown`:"mushi:firstSessionShown"),R=false;try{R=window.localStorage?.getItem(b)==="1";}catch{}if(!R){let T=setTimeout(()=>{try{window.localStorage?.setItem(b,"1");}catch{}t.onTrigger("first_session",{delayMs:d});},d);r.push(()=>clearTimeout(T));}}if(e.errorBoundary){let f=function(b){t.onTrigger("error_boundary",{message:b.message,filename:b.filename,lineno:b.lineno,colno:b.colno});},d=function(b){t.onTrigger("error_boundary",{message:b.reason instanceof Error?b.reason.message:String(b.reason),type:"unhandled_rejection"});};window.addEventListener("error",f),window.addEventListener("unhandledrejection",d),r.push(()=>{window.removeEventListener("error",f),window.removeEventListener("unhandledrejection",d);});}return {destroy(){r.forEach(f=>f());}}}function po(t){return t===false?{enabled:false,ignoreUrls:[]}:t&&typeof t=="object"?{enabled:t.enabled!==false,ignoreUrls:t.ignoreUrls??[]}:{enabled:true,ignoreUrls:[]}}function Yr(t,e){let r=Date.now();t.push(r);let n=t.filter(s=>r-s<1e4);n.length>=3&&(e.onTrigger("api_cascade",{failureCount:n.length,windowMs:1e4}),t.length=0);}var Jr="mushi:lastDismiss",Ke="mushi:consecDismiss",Mt="mushi:lastShown";function Ge(t){try{return localStorage.getItem(t)}catch{return null}}function Ye(t,e){try{localStorage.setItem(t,e);}catch{}}function Zr(t={}){let e=t.maxProactivePerSession??2,r=t.dismissCooldownHours??24,n=t.suppressAfterDismissals??3,s=(t.reshowCooldownMinutes??30)*60*1e3,i=0,a=new Set;function o(g){let h=Date.now();if(parseInt(Ge(Ke)??"0",10)>=n)return false;let d=Ge(Jr);if(d&&h-parseInt(d,10)<r*60*60*1e3)return false;if(s>0&&i===0){let b=Ge(Mt);if(b&&h-parseInt(b,10)<s)return false}return i>=e||a.has(g)?false:(a.add(g),i++,Ye(Mt,String(h)),true)}function l(){Ye(Jr,String(Date.now()));let g=parseInt(Ge(Ke)??"0",10);Ye(Ke,String(g+1));}function m(){Ye(Ke,"0");}function c(){i=0,a.clear();try{localStorage.removeItem(Mt);}catch{}}return {shouldShow:o,recordDismissal:l,recordSubmission:m,reset:c}}var ue=null,Xe=class{constructor(){}static init(e){if(ue)return De({scope:"mushi",level:"warn",format:"pretty"}).warn("Already initialized \u2014 call destroy() first to reinitialize"),ue;let r={...er(),...e};if(!r.projectId)throw new Error("[mushi] projectId is required \u2014 set NEXT_PUBLIC_MUSHI_PROJECT_ID / VITE_MUSHI_PROJECT_ID / MUSHI_PROJECT_ID or pass it explicitly");if(!r.apiKey)throw new Error("[mushi] apiKey is required \u2014 set NEXT_PUBLIC_MUSHI_API_KEY / VITE_MUSHI_API_KEY / MUSHI_API_KEY or pass it explicitly");return r.enabled===false?Co():(ue=ho(r),ue)}static getInstance(){return ue}static destroy(){ue?.destroy(),ue=null;}static diagnose(){return ue?.diagnose()??tn()}};function ho(t){let e=go(t),r=e,n=t.debug??false?De({scope:"mushi",level:"debug",format:"pretty"}):tt,s=null,i=null,a=Qt({projectId:e.projectId,apiKey:e.apiKey,...e.apiEndpoint?{apiEndpoint:e.apiEndpoint}:{},getUserToken:()=>s}),o=tr(e.preFilter),l=ir(e.offline),m=lr({maxBurst:10,refillRate:1,refillIntervalMs:5e3}),c=cr();function g(u){return u.map(p=>{let w={...p};if(typeof p.message=="string"&&(w.message=c.scrub(p.message)),p.data&&typeof p.data=="object"){let $={};for(let[L,P]of Object.entries(p.data))$[L]=typeof P=="string"?c.scrub(P):P;w.data=$;}return w})}function h(u){if(!u)return;let p={};for(let[w,$]of Object.entries(u))p[w]=typeof $=="string"?c.scrub($):$;return p}let f=null,d=null,b=null,R=null,T=null,x=null,S=kt(),y=null,k=0,v,I=`mushi:tester-jwt:${e.projectId}`;function q(){try{return typeof localStorage<"u"?localStorage.getItem(I):null}catch{return null}}function _(){try{typeof localStorage<"u"&&localStorage.removeItem(I);}catch{}}async function K(u){let p=await a.getTesterStatus(u);if(!p.ok||!p.data){_();return}let w=p.data;if(!w.is_tester||!w.tester_id){_();return}v.setTesterSession(u,{id:w.tester_id,public_handle:w.public_handle??null,display_name:w.display_name??null});let $=await a.getMyReputation(u);if($.ok&&$.data){let L=$.data;L.reputation&&v.setTesterReputation(L.reputation);}}function be(){if(r.capture?.console!==false?f??=bt():(f?.destroy(),f=null),r.capture?.network!==false){let L={apiEndpoint:$t(r),ignoreUrls:r.capture?.ignoreUrls,tracePropagation:r.capture?.tracePropagation,sessionId:Ce()};d?d.updateOptions(L):d=vt(L);}else d?.destroy(),d=null;if(r.capture?.performance!==false?b??=St():(b?.destroy(),b=null),r.capture?.screenshot!=="off"){let L={privacy:r.privacy};R?R.updateOptions(L):R=xt(L);}else R=null;R||(M=null),v.setAllowScreenshotRemove(r.privacy?.allowUserRemoveScreenshot!==false),r.capture?.elementSelector!==false?T??=Et():(T?.deactivate(),T=null,A=null);let u=r.capture?.discoverInventory,p=u===true?{}:u&&typeof u=="object"?u:null;p!=null&&p.enabled!==false?(x?.destroy(),x=Rt({config:p,getRecentNetworkPaths:()=>d?d.getEntries().map(L=>{try{let P=new URL(L.url,typeof window<"u"?window.location.href:"http://localhost");return P.host&&typeof window<"u"&&P.host!==window.location.host?null:P.pathname}catch{return null}}).filter(L=>L!=null&&L.length>0&&L.length<200):[],getUserId:()=>z?.id??null,getSessionId:Ce,onEvent:L=>{a.postDiscoveryEvent({...L,sdk_version:Z}).catch(P=>{n.debug("discovery emit failed",{err:String(P)});});}})):(x?.destroy(),x=null);let $=r.capture?.replay??"off";if($==="rrweb"||$==="lite"){let L=++k;Vr({redactSelectors:r.privacy?.redactSelectors}).then(P=>{if(L!==k){P.destroy();return}y?.destroy(),y=P,y.start();});}else k++,y?.destroy(),y=null;}let G=new Map;function C(u,p){G.get(u)?.forEach(w=>w({type:u,data:p}));}let M=null,A=null,O=null,j=false,z=null,de={},ee={},D=ur({max:50});D.add({category:"lifecycle",level:"info",message:"Mushi SDK init",data:{projectId:e.projectId,sdkVersion:Z}});let ye=null;ye=To(D);let N=false;async function Ee(){if(!R||N)return null;N=true;let u=v.getIsOpen();u&&v.hidePanel();let p=document.getElementById("mushi-mushi-widget"),w=p?.style.visibility??"";p&&(p.style.visibility="hidden"),await new Promise($=>{requestAnimationFrame(()=>requestAnimationFrame(()=>$()));});try{return await R.take()}finally{N=false,p&&(p.style.visibility=w),u&&v.showPanel();}}async function Le(u){let p=r.capture?.screenshot;!R||p==="off"||M||u==="open"&&p!=="auto"||u==="submit"&&p!=="on-report"&&p!=="auto"||(n.debug("Auto-capturing screenshot",{when:u,mode:p}),M=await Ee(),v.setScreenshotAttached(M!==null));}v=new Ue(e.widget,{onSubmit:async({category:u,userCategory:p,description:w,intent:$})=>(n.info("Report submitted",{category:u,userCategory:p,intent:$}),ke?.recordSubmission(),await Le("submit"),await sn(u,w,$,p)??{reportId:null,queuedOffline:true}),onOpen:()=>{n.debug("Widget opened"),Le("open"),y?.start(),C("widget:opened");},onClose:()=>{n.debug("Widget closed"),O&&(ke?.recordDismissal(),C("proactive:dismissed",{type:O})),M=null,A=null,O=null,C("widget:closed");},onScreenshotRequest:async()=>{!R||r.capture?.screenshot==="off"||(n.debug("Taking screenshot"),M=await Ee(),v.setScreenshotAttached(M!==null));},onScreenshotRemove:()=>{n.debug("Screenshot attachment removed"),M=null,v.setScreenshotAttached(false);},onScreenshotAnnotateRequest:async u=>{if(!M||u.childElementCount>0)return;let p;try{p=await Kr(M,u);}catch(X){n.warn("Screenshot annotation failed",{error:X instanceof Error?X.message:String(X)});return}let w=document.createElement("div");w.className="mushi-annotate-toolbar";let $=X=>{(M=p.getDataUrl(),v.setScreenshotAttached(true)),p.destroy(),w.remove();},L=[{id:"highlight",label:"\u270F\uFE0F Highlight"},{id:"blur",label:"\u{1F512} Blur"},{id:"arrow",label:"\u2197\uFE0F Arrow"}];for(let X of L){let H=document.createElement("button");H.type="button",H.className="mushi-attach-btn",H.dataset.tool=X.id,H.textContent=X.label,H.addEventListener("click",()=>{p.setTool(X.id),w.querySelectorAll("button[data-tool]").forEach(oe=>oe.classList.remove("active")),H.classList.add("active");}),w.appendChild(H);}w.querySelector('button[data-tool="highlight"]')?.classList.add("active");let P=document.createElement("button");P.type="button",P.className="mushi-attach-btn",P.textContent="\u2713 Done",P.addEventListener("click",()=>$()),w.appendChild(P),u.insertBefore(w,u.firstChild);},onElementSelectorRequest:async()=>{if(!(!T||r.capture?.elementSelector===false)){n.debug("Element selector activated"),v.setElementCapturing(true),v.hidePanel();try{let u=await T.activate();u?(A=u,v.setElementSelected(!0),n.debug("Element selected",{tagName:u.tagName,xpath:u.xpath})):v.setElementCapturing(!1);}finally{v.showPanel();}}},async onReporterReportsRequest(){let u=await a.listReporterReports(Y());if(!u.ok)throw new Error(u.error?.message??"Could not load reports");return u.data?.reports??[]},async onReporterCommentsRequest(u){let p=await a.listReporterComments(u,Y());if(!p.ok)throw new Error(p.error?.message??"Could not load thread");return p.data?.comments??[]},async onReporterReply(u,p){let w=await a.replyToReporterReport(u,Y(),p);if(!w.ok)throw new Error(w.error?.message??"Could not send reply")},async onReporterFeedback(u,p,w){let $=await a.replyToReporterReport(u,Y(),w??"",p);if(!$.ok)throw new Error($.error?.message??"Could not send feedback");return $.data?.feedback??null},async onReporterReopen(u,p){let w=await a.reopenReporterReport(u,Y(),p);if(!w.ok)throw new Error(w.error?.message??"Could not reopen report");return w.data?.outcome??null},async onFeatureBoardRequest(){let u=await a.listReporterFeatureBoard(Y());if(!u.ok)throw new Error(u.error?.message??"Could not load community ideas");return u.data?.tickets??[]},async onFeatureBoardVote(u){let p=await a.voteReporterFeatureBoard(u,Y());if(!p.ok)throw new Error(p.error?.message??"Could not vote");return p.data??{voted:true,action:"added"}},onLeaderboardOpen(){v.setLeaderboard(null,true),Nr(10).then(u=>{v.setLeaderboard(u,false);});},async onMushiSignIn(u){let p=await a.sendMagicLink(u);if(!p.ok)throw new Error(p.error?.message??"Could not send sign-in link");return {ok:true}},async onGlobalLeaderboardOpen(){v.setGlobalLeaderboard(null,true);try{let u=q(),p=await a.getPublicLeaderboard(50),$=(p.ok?p.data?.leaderboard??[]:[]).map(L=>({tester_id:L.tester_id,rank:L.rank,public_handle:L.public_handle,display_name:L.display_name,points_30d:L.points_30d,total_points:L.total_points??0,badge:L.badge_slug}));if(v.setGlobalLeaderboard($,!1),u){let L=await a.getMyReputation(u);if(L.ok&&L.data){let P=L.data;P.reputation&&v.setTesterReputation(P.reputation);}}}catch{v.setGlobalLeaderboard([],false);}},async onCrossAppReportsOpen(){let u=q();if(!u){v.setCrossAppReports([],false);return}try{let p=await a.getCrossAppReports(u),w=p.ok?p.data?.reports??[]:[];v.setCrossAppReports(w,!1);}catch{v.setCrossAppReports([],false);}},onTesterSignOut(){_();},assistantEnabled:e.assistant?.enabled===true,...e.assistant?.label?{assistantLabel:e.assistant.label}:{},...e.assistant?.greeting?{assistantGreeting:e.assistant.greeting}:{},...e.assistant?.suggestions?{assistantSuggestions:e.assistant.suggestions}:{},async onAssistantAsk(u,p){let w=await a.askAssistant({message:u,threadId:p,context:i});return w.ok?w.data??null:null}},Z),be(),typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>v.mount()):v.mount());let It=q();It&&K(It).catch(()=>_());let At=null,ke=null,W=r.proactive;W&&(W.rageClick!==false||W.longTask!==false||W.apiCascade!==false||W.errorBoundary===true||W.pageDwell||W.firstSession)&&typeof document<"u"&&(ke=Zr(W?.cooldown),At=Xr({onTrigger:(u,p)=>{if(!ke.shouldShow(u)){n.debug("Proactive trigger suppressed by fatigue prevention",{type:u});return}n.info("Proactive trigger fired",{type:u,context:p}),O=u,C("proactive:triggered",{type:u,context:p}),u==="first_session"?v.pulseTrigger?.():v.open();}},{rageClick:W?.rageClick,longTask:W?.longTask,apiCascade:W?.apiCascade,apiEndpoint:$t(r),errorBoundary:W?.errorBoundary,pageDwell:W?.pageDwell,firstSession:W?.firstSession,projectId:e.projectId}),n.debug("Proactive triggers enabled",{rageClick:W?.rageClick!==false,longTask:W?.longTask!==false,apiCascade:W?.apiCascade!==false,errorBoundary:W?.errorBoundary===true,pageDwell:!!W?.pageDwell,firstSession:!!W?.firstSession})),l.startAutoSync(a),l.flush(a).then(u=>{u.sent>0&&n.info("Synced offline reports",{sent:u.sent});});function Je(u){if(j=true,u.enabled===false){r=e,So(t.projectId),be(),v.updateConfig(r.widget),n.debug("Runtime SDK config disabled; using bootstrap config",{version:u.version});return}r=mo(r,u),be(),u.widget&&v.updateConfig(r.widget),n.debug("Applied runtime SDK config",{version:u.version});}if(bo(t)){let u=wo(t.projectId);u&&Je(u),a.getSdkConfig().then(p=>{p.ok&&p.data?(xo(t.projectId,p.data),Je(p.data)):p.error&&n.debug("Runtime SDK config unavailable",p.error);}).catch(p=>{n.debug("Runtime SDK config fetch failed",{error:p instanceof Error?p.message:String(p)});});}else n.debug("Runtime SDK config disabled via runtimeConfig:false; using static bootstrap config");nn(),n.info("Initialized",{projectId:t.projectId});async function nn(){if(r.widget?.outdatedBanner==="off")return;let u=Eo(he);u&&_t(u);let p=await a.getLatestSdkVersion(he);!p.ok||!p.data||(ko(he,p.data),_t(p.data));}function _t(u){let p=u.latest,w=!!(p&&Ro(Z,p));if(!w&&!u.deprecated)return;let $=u.deprecationMessage??(w?`Update ${he} to ${p}.`:null);n.warn("Mushi SDK is outdated",{package:he,current:Z,latest:p,deprecated:u.deprecated,message:$}),r.widget?.outdatedBanner!=="console-only"&&v.setSdkFreshness({latest:p,current:Z,deprecated:u.deprecated,message:$});}async function sn(u,p,w,$){let L=o.check(p);if(!L.passed){n.info("Report blocked by pre-filter",{reason:L.reason});return}let P=t.preFilter?.wasmClassifier;if(P)try{let U=await P.classify({description:p,category:u,url:typeof location<"u"?location.href:void 0,hasScreenshot:M!==null,hasSelectedElement:A!==null,hasNetworkErrors:d?.getEntries()?.some(te=>te.status>=400||!!te.error)??!1,hasConsoleErrors:f?.getEntries()?.some(te=>te.level==="error")??!1,proactiveTrigger:O??void 0});if(U.verdict==="block"){n.info("Report blocked by on-device classifier",{modelId:U.modelId,confidence:U.confidence,reason:U.reason});return}n.debug("On-device classifier verdict",{...U});}catch(U){n.warn("On-device classifier threw \u2014 falling through to server",{error:U instanceof Error?U.message:String(U)});}if(!m.tryConsume()){n.warn("Report throttled \u2014 rate limit exceeded");return}let X=c.scrub(o.truncate(p)),H=t.sentry?Ct(t.sentry):void 0,oe=await ar().catch(()=>null),Dt=r.capture?.console===false?void 0:f?.getEntries(),Ot=r.capture?.network===false?void 0:d?.getEntries(),Ht=g(D.getAll()),Bt=h(Object.keys(ee).length>0?{...ee}:void 0),Nt=H?{...H,...H.breadcrumbs?{breadcrumbs:g(H.breadcrumbs)}:{},...H.tags?{tags:h(H.tags)}:{}}:void 0,Ft=M?await mr(M).catch(()=>null):null;M&&!Ft&&n.warn("Screenshot dropped \u2014 could not compress under wire budget");let ie={id:nt(),projectId:t.projectId,category:u,...$?{userCategory:$}:{},description:X,userIntent:w,environment:rt(),consoleLogs:Dt,networkLogs:Ot,performanceMetrics:r.capture?.performance===false?void 0:b?.getMetrics(),timeline:S.getEntries({consoleLogs:Dt,networkLogs:Ot}),screenshotDataUrl:Ft??void 0,selectedElement:A??void 0,...y?{replayEvents:y.flush()}:{},metadata:{...de,...z?{user:z}:{},...H?.release?{sentryRelease:H.release}:{}},sessionId:Ce(),reporterToken:Y(),...oe?{fingerprintHash:oe}:{},appVersion:t.integrations?.vercel?.analyticsId,sdkPackage:he,sdkVersion:Z,proactiveTrigger:O??void 0,...Ht.length>0?{breadcrumbs:Ht}:{},...Bt?{tags:Bt}:{},...Nt?{sentryContext:Nt}:{},sentryEventId:H?.eventId,sentryReplayId:H?.replayId,createdAt:new Date().toISOString()};if(D.add({category:"lifecycle",level:"info",message:`Mushi report submitting (${u})`,data:{reportId:ie.id,category:u}}),t.integrations?.custom){let U={addMetadata(te,on){ie.metadata[te]=on;},setCategory(te){ie.category=te;},setDescription(te){ie.description=te;}};t.integrations.custom(U);}let B=ie;if(t.beforeSendFeedback)try{let U=await Promise.race([Promise.resolve(t.beforeSendFeedback(ie)),new Promise(te=>setTimeout(()=>te(ie),2e3))]);if(U===null){n.info("Report dropped by beforeSendFeedback hook",{reportId:ie.id});return}B=U;}catch(U){n.warn("beforeSendFeedback hook threw \u2014 sending unmodified report",{error:U instanceof Error?U.message:String(U)});}if(C("report:submitted",{reportId:B.id}),typeof navigator<"u"&&!navigator.onLine)return await l.enqueue(B),n.info("Offline \u2014 report queued",{reportId:B.id}),C("report:queued",{reportId:B.id}),{reportId:null,queuedOffline:true};let F=await a.submitReport(B);if(!F.ok&&F.error?.code==="PAYLOAD_TOO_LARGE"&&(Array.isArray(B.replayEvents)&&B.replayEvents.length>0&&(n.warn("Report too large \u2014 dropping replay buffer and retrying",{reportId:B.id}),B={...B,replayEvents:void 0},F=await a.submitReport(B)),!F.ok&&F.error?.code==="PAYLOAD_TOO_LARGE"&&B.screenshotDataUrl&&(n.warn("Report still too large \u2014 dropping screenshot and retrying",{reportId:B.id}),B={...B,screenshotDataUrl:void 0},F=await a.submitReport(B))),F.ok){if(n.info("Report sent",{reportId:F.data?.reportId}),C("report:sent",{reportId:F.data?.reportId}),F.data?.cursorAgentId){let U=F.data;C("report:dispatched",{reportId:U.reportId,agentId:U.cursorAgentId,fixId:U.fixId});}D.add({category:"lifecycle",level:"info",message:`Mushi report sent (${F.data?.reportId??ie.id})`}),Se({action:"report_submit",metadata:{category:u,reportId:F.data?.reportId??ie.id}});try{t.sentry&&F.data?.reportId&&Tt(F.data.reportId);}catch{}}else F.error?.code==="PAYLOAD_TOO_LARGE"||F.error?.code==="SERIALIZE_FAILED"?(n.warn("Report exceeds size limit after degradation \u2014 dropping",{reportId:B.id,error:F.error}),C("report:failed",{reportId:B.id,error:F.error}),D.add({category:"lifecycle",level:"error",message:`Mushi report dropped \u2014 payload too large (${B.id})`})):(n.warn("Report failed, queuing for retry",{reportId:B.id,error:F.error}),await l.enqueue(B),C("report:failed",{reportId:B.id,error:F.error}),D.add({category:"lifecycle",level:"warning",message:`Mushi report queued for retry (${B.id})`}));return M=null,A=null,O=null,F?.ok?{reportId:F.data?.reportId??ie.id,queuedOffline:false}:{reportId:null,queuedOffline:true}}let Pt={report(u){v.open(u);},on(u,p){return G.has(u)||G.set(u,new Set),G.get(u).add(p),()=>G.get(u)?.delete(p)},setUser(u){z=u;},setMetadata(u,p){de[u]=p;},setScreen(u){S.setScreen(u);},isOpen(){return v.getIsOpen()},open(){v.open();},openWith(u){v.open({category:u});},show(){v.showTrigger();},hide(){v.hideTrigger();},attachTo(u,p){return v.attachTo(u,p)},setTrigger(u){v.setTrigger(u);},close(){v.close();},updateConfig(u){Je(u);},diagnose(){return yo({apiEndpoint:$t(r),widgetMounted:v.getIsMounted(),runtimeConfigLoaded:j,captureScreenshotAvailable:R!==null,captureNetworkIntercepting:d!==null,widgetDiagnostics:v.getWidgetDiagnostics()})},destroy(){At?.destroy(),ke?.reset(),v.destroy(),f?.destroy(),d?.destroy(),b?.destroy(),T?.deactivate(),S.destroy(),x?.destroy(),x=null,y?.destroy(),y=null,l.stopAutoSync(),ye?.(),ye=null,D.clear(),G.clear(),ue=null,n.debug("Destroyed");},async captureEvent(u){if(!m.tryConsume())return n.warn("captureEvent throttled \u2014 rate limit exceeded"),null;let p=c.scrub(o.truncate(u.description)),w=u.category??"bug",$=t.sentry?Ct(t.sentry):void 0,L=g(D.getAll()),P=h(Object.keys(ee).length===0&&!u.tags?void 0:{...ee,...u.tags??{}}),X=$?{...$,...$.breadcrumbs?{breadcrumbs:g($.breadcrumbs)}:{},...$.tags?{tags:h($.tags)}:{}}:void 0,H={id:nt(),projectId:t.projectId,category:w,description:p,environment:rt(),timeline:S.getEntries(),metadata:{...u.metadata??{},...z?{user:z}:{},...u.error?{error:u.error}:{},...u.severity?{severity:u.severity}:{},...u.component?{component:u.component}:{},...u.source?{source:u.source}:{source:"captureEvent"}},...L.length>0?{breadcrumbs:L}:{},...P&&Object.keys(P).length>0?{tags:P}:{},...X?{sentryContext:X}:{},sessionId:Ce(),reporterToken:Y(),sdkPackage:he,sdkVersion:Z,sentryEventId:$?.eventId,sentryReplayId:$?.replayId,createdAt:new Date().toISOString()};if(C("report:submitted",{reportId:H.id}),typeof navigator<"u"&&!navigator.onLine)return await l.enqueue(H),C("report:queued",{reportId:H.id}),null;let oe=await a.submitReport(H);if(oe.ok){C("report:sent",{reportId:oe.data?.reportId});try{t.sentry&&oe.data?.reportId&&Tt(oe.data.reportId);}catch{}return oe.data?.reportId??null}return await l.enqueue(H),C("report:failed",{reportId:H.id,error:oe.error}),null},async captureException(u,p){let w=dr(u);D.add({category:"lifecycle",level:"error",message:`Mushi.captureException(${w.name}): ${w.message}`,...w.stack?{data:{stack:w.stack.slice(0,500)}}:{}});let $=p?.description?.trim()||`${w.name}: ${w.message}`||"Uncaught exception";return Pt.captureEvent({description:$,category:p?.category??"bug",severity:p?.severity??"high",...p?.component?{component:p.component}:{},...p?.tags?{tags:p.tags}:{},source:p?.source??"captureException",error:{name:w.name,message:w.message,...w.stack?{stack:w.stack}:{}},metadata:{...p?.metadata??{},...w.cause?{cause:w.cause}:{}}})},identify(u,p){if(z={id:u,...p?.email?{email:p.email}:{},...p?.name?{name:p.name}:{}},p)for(let[w,$]of Object.entries(p))w!=="email"&&w!=="name"&&(de[`user.${w}`]=$);if(D.add({category:"lifecycle",level:"info",message:`Mushi.identify(${u})`}),r.rewards?.enabled){let w={client:a,config:r.rewards,projectId:e.projectId,userId:u,traits:p?{email:p.email,name:p.name,provider:p.provider}:void 0};z.id===u?Or(w):Hr(u,w.traits),r.rewards.showInWidget!==false&&a.getMyPoints(u).then($=>{if(!$.ok)return;let L=$.data;v.setRewardsState({tier:L.tier?{slug:L.tier.slug??"free",displayName:L.tier.display_name??"Free",pointsThreshold:L.tier.points_threshold??0}:null,nextTier:L.next_tier?{displayName:L.next_tier.display_name??"",pointsThreshold:L.next_tier.points_threshold??0}:null,totalPoints:L.total_points??0,pointsForReport:L.report_submit_pts??50});}).catch(()=>{});}},identifyWithToken(u){if(s=u&&typeof u=="string"?u:null,s){let p=pr(s);p?.sub&&(z={id:p.sub,...p.email?{email:p.email}:{},...p.name?{name:p.name}:{}}),D.add({category:"lifecycle",level:"info",message:"Mushi.identifyWithToken()"});}else D.add({category:"lifecycle",level:"info",message:"Mushi.identifyWithToken(null)"});},publishPageContext(u){i=u&&u.route?u:null;},openAssistant(){v.openAssistantTab();},addBreadcrumb(u){D.add(u);},getBreadcrumbs(){return D.getAll()},setTag(u,p){typeof u!="string"||u.length===0||(ee[u]=p);},setTags(u){if(!(!u||typeof u!="object"))for(let[p,w]of Object.entries(u))typeof p=="string"&&p.length>0&&(ee[p]=w);},clearTag(u){if(typeof u=="string"&&u.length>0){delete ee[u];return}for(let p of Object.keys(ee))delete ee[p];},async getReputation(){if(!z?.id)return null;let u=await a.getMyPoints(z.id);return u.ok?{totalPoints:u.data.total_points??0,points30d:u.data.points_30d??0,reputation:1,confirmedBugs:0,totalReports:0}:null},async getTier(){return z?.id?Br(z.id):null},recordActivity(u,p){r.rewards?.enabled&&Se({action:u,metadata:p});},pulseTrigger(){v.pulseTrigger?.();},async listMyReports(){let u=await a.listReporterReports(Y());return u.ok?u.data?.reports??[]:[]},async listMyComments(u){let p=await a.listReporterComments(u,Y());return p.ok?p.data?.comments??[]:[]},async replyToReport(u,p){let w=await a.replyToReporterReport(u,Y(),p);return w.ok?w.data?.comment??null:null},async submitFeedbackSignal(u,p,w){let $=await a.replyToReporterReport(u,Y(),w??"",p);return $.ok?$.data?.feedback??null:null},async reopenReport(u,p){let w=await a.reopenReporterReport(u,Y(),p);return w.ok?w.data?.outcome??null:null},openMyReports(){v.recorderOpenMyReports();},async getHallOfFame(u=20){let p=await a.getHallOfFame(u);return p.ok?p.data?.data??[]:[]}};if(typeof globalThis<"u"&&(e.debug??false)&&Rr(v),typeof window<"u"&&typeof localStorage<"u"){let u="mushi:last-run",p=null;try{let w=localStorage.getItem(u);p=w===null?null:w==="unfinished",localStorage.setItem(u,"unfinished");}catch{p=null;}try{window.addEventListener("pagehide",()=>{try{localStorage.setItem(u,"clean");}catch{}});}catch{}if(typeof e.onCrashedLastRun=="function")try{e.onCrashedLastRun(p);}catch(w){n.warn("onCrashedLastRun hook threw",{error:w instanceof Error?w.message:String(w)});}}return Pt}function mo(t,e){let r=e.native?.triggerMode,n=e.widget?.launcher,s=n??e.widget?.trigger??(r==="none"||r==="shake"?"manual":void 0),i=n==="hidden"||e.widget?.trigger==="hidden",a=t.widget?.trigger,o=s==="hidden"&&!i&&a&&a!=="hidden"?a:s,l=e.widget,m=l?.bannerVariant,c=l?.bannerPosition,g=l?.bannerMessage,h=l?.bannerLabel,f=l?.bannerBugCta,d=l?.bannerFeatureCta,b=m||c||g!=null||h!=null||f!=null||d!=null?{...t.widget?.bannerConfig??{},...m?{variant:m}:{},...c?{position:c}:{},...g!=null?{message:g}:{},...h!=null?{label:h===""?false:h}:{},...f!=null?{bugCta:f??void 0}:{},...d!=null?{featureCta:d}:{}}:void 0;return {...t,widget:{...t.widget,...e.widget,...o?{trigger:o}:{},...b?{bannerConfig:b}:{},...t.widget?.betaMode?{betaMode:t.widget.betaMode}:{}},capture:{...t.capture,...e.capture},privacy:{...t.privacy}}}function go(t){if(!t.preset)return t;let e=fo(t.preset);return {...t,widget:{...e.widget,...t.widget},capture:{...e.capture,...t.capture},proactive:{...e.proactive,...t.proactive,cooldown:{...e.proactive?.cooldown,...t.proactive?.cooldown}}}}function fo(t){switch(t){case "manual-only":return {widget:{trigger:"manual",outdatedBanner:"console-only"},capture:{console:true,network:true,performance:false,screenshot:"on-report",elementSelector:false},proactive:{rageClick:false,longTask:false,apiCascade:false,errorBoundary:false}};case "beta-loud":return {widget:{trigger:"auto",outdatedBanner:"banner"},capture:{console:true,network:true,performance:true,screenshot:"auto",elementSelector:true},proactive:{rageClick:true,longTask:true,apiCascade:true,errorBoundary:true}};case "internal-debug":return {widget:{trigger:"auto",outdatedBanner:"banner",brandFooter:true},capture:{console:true,network:true,performance:true,screenshot:"auto",elementSelector:true},proactive:{rageClick:true,longTask:true,apiCascade:true,errorBoundary:true,cooldown:{maxProactivePerSession:10,dismissCooldownHours:0,suppressAfterDismissals:99}}};case "production-calm":return {widget:{trigger:"auto",outdatedBanner:"console-only"},capture:{console:true,network:true,performance:false,screenshot:"on-report",elementSelector:false},proactive:{rageClick:false,longTask:false,apiCascade:false,errorBoundary:false}}}}function $t(t){return t.apiEndpoint??et}function bo(t){return t.runtimeConfig!==false}async function yo(t){let e=await vo(t.apiEndpoint);return {apiEndpointReachable:e.reachable,cspAllowsEndpoint:e.cspAllowed,widgetMounted:t.widgetMounted,shadowDomAvailable:typeof HTMLElement<"u"&&typeof HTMLElement.prototype.attachShadow=="function",dialogSupported:typeof HTMLDialogElement<"u",runtimeConfigLoaded:t.runtimeConfigLoaded,captureScreenshotAvailable:t.captureScreenshotAvailable,captureNetworkIntercepting:t.captureNetworkIntercepting,sdkVersion:Z,widgetHostPointerSafe:t.widgetDiagnostics?.widgetHostPointerSafe??false,widgetHostBounds:t.widgetDiagnostics?.widgetHostBounds??null,widgetSuppressed:t.widgetDiagnostics?.widgetSuppressed??false,bannerRendered:t.widgetDiagnostics?.bannerRendered??false}}async function tn(){return {apiEndpointReachable:false,cspAllowsEndpoint:false,widgetMounted:false,shadowDomAvailable:typeof HTMLElement<"u"&&typeof HTMLElement.prototype.attachShadow=="function",dialogSupported:typeof HTMLDialogElement<"u",runtimeConfigLoaded:false,captureScreenshotAvailable:false,captureNetworkIntercepting:false,sdkVersion:Z,widgetHostPointerSafe:false,widgetHostBounds:null,widgetSuppressed:false,bannerRendered:false}}async function vo(t){if(typeof fetch>"u")return {reachable:false,cspAllowed:false};let e=typeof AbortController<"u"?new AbortController:null,r=e?setTimeout(()=>e.abort(),3e3):null;try{return {reachable:(await fetch(`${t.replace(/\/$/,"")}/health`,{method:"GET",cache:"no-store",...e?{signal:e.signal}:{},[ve]:"diagnose"})).ok,cspAllowed:!0}}catch{return {reachable:false,cspAllowed:false}}finally{r&&clearTimeout(r);}}function Lt(t){return `mushi:sdk-config:${t}`}function rn(t){return `mushi:sdk-version:${t}`}function wo(t){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(Lt(t));return e?JSON.parse(e).config??null:null}catch{return null}}function xo(t,e){if(!(typeof localStorage>"u"))try{localStorage.setItem(Lt(t),JSON.stringify({cachedAt:Date.now(),config:e}));}catch{}}function So(t){if(!(typeof localStorage>"u"))try{localStorage.removeItem(Lt(t));}catch{}}function Eo(t){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(rn(t));if(!e)return null;let r=JSON.parse(e);return !r.data||!r.cachedAt||Date.now()-r.cachedAt>864e5?null:r.data}catch{return null}}function ko(t,e){if(!(typeof localStorage>"u"))try{localStorage.setItem(rn(t),JSON.stringify({cachedAt:Date.now(),data:e}));}catch{}}function Ro(t,e){let r=Qr(t),n=Qr(e);for(let s=0;s<Math.max(r.length,n.length);s++){let i=r[s]??0,a=n[s]??0;if(i<a)return true;if(i>a)return false}return false}function Qr(t){return t.split(/[.-]/).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e))}function Co(){return {report:()=>{},on:()=>()=>{},setUser:()=>{},setMetadata:()=>{},setScreen:()=>{},isOpen:()=>false,open:()=>{},close:()=>{},updateConfig:()=>{},diagnose:tn,openWith:()=>{},show:()=>{},hide:()=>{},attachTo:()=>()=>{},setTrigger:()=>{},destroy:()=>{ue=null;},captureEvent:async()=>null,captureException:async()=>null,identify:()=>{},identifyWithToken:()=>{},publishPageContext:()=>{},openAssistant:()=>{},addBreadcrumb:()=>{},getBreadcrumbs:()=>[],setTag:()=>{},setTags:()=>{},clearTag:()=>{},getReputation:async()=>null,getTier:async()=>null,recordActivity:()=>{},pulseTrigger:()=>{},listMyReports:async()=>[],listMyComments:async()=>[],replyToReport:async()=>null,submitFeedbackSignal:async()=>null,reopenReport:async()=>null,openMyReports:()=>{},getHallOfFame:async()=>[]}}function To(t){if(typeof window>"u")return ()=>{};let e=[];try{let r=a=>{t.add({category:"navigation",level:"info",message:`${a}: ${window.location.pathname}`,data:{url:window.location.href,kind:a}});},n=()=>r("popstate");window.addEventListener("popstate",n,{passive:!0}),e.push(()=>window.removeEventListener("popstate",n));let s=window.history.pushState,i=window.history.replaceState;window.history.pushState=function(...o){let l=s.apply(this,o);try{r("pushState");}catch{}return l},window.history.replaceState=function(...o){let l=i.apply(this,o);try{r("replaceState");}catch{}return l},e.push(()=>{window.history.pushState=s,window.history.replaceState=i;});}catch{}try{let r=console.error,n=console.warn;console.error=function(...s){try{t.add({category:"console",level:"error",message:s.map(en).join(" ")});}catch{}return r.apply(this,s)},console.warn=function(...s){try{t.add({category:"console",level:"warning",message:s.map(en).join(" ")});}catch{}return n.apply(this,s)},e.push(()=>{console.error=r,console.warn=n;});}catch{}try{let r=n=>{try{let s=n.target;if(!(s instanceof Element))return;let i=s,a=0;for(;i&&a<10;){let o=i.getAttribute("data-testid");if(o){let l=(i.textContent??"").trim().slice(0,80);t.add({category:"ui.click",level:"info",message:`clicked ${o}${l?` \u2014 ${l}`:""}`,data:{testid:o,tag:i.tagName.toLowerCase()}});return}i=i.parentElement,a++;}}catch{}};document.addEventListener("click",r,{passive:!0,capture:!0}),e.push(()=>document.removeEventListener("click",r,!0));}catch{}return ()=>{for(let r of e)try{r();}catch{}}}function en(t){try{if(t instanceof Error)return `${t.name}: ${t.message}`;if(typeof t=="object"&&t!==null){let r=JSON.stringify(t);return r.length>200?`${r.slice(0,200)}\u2026`:r}let e=String(t);return e.length>200?`${e.slice(0,200)}\u2026`:e}catch{return `[${typeof t}]`}}function Mo(){let t=document.currentScript;if(t&&t.dataset&&t.dataset.project)return t;let e=Array.from(document.querySelectorAll("script[data-project][data-key]"));return e.length>0?e[e.length-1]:null}function $o(t){let e=t.project?.trim(),r=t.key?.trim();if(!e||!r)return null;let n={};t.trigger&&(n.trigger=t.trigger),t.theme&&(n.theme=t.theme),t.position&&(n.position=t.position),t.triggerText&&(n.triggerText=t.triggerText);let s=t.bannerVariant,i=t.bannerPosition;(s||i)&&(n.bannerConfig={...s?{variant:s}:{},...i?{position:i}:{}});let a={projectId:e,apiKey:r};return t.endpoint&&(a.apiEndpoint=t.endpoint),t.debug==="true"&&(a.debug=true),Object.keys(n).length>0&&(a.widget=n),a}function Lo(){if(typeof document>"u"||typeof window>"u")return;let t=window;if(t.__mushiLoaderInit)return;let e=Mo();if(!e)return;let r=$o(e.dataset);if(r){t.__mushiLoaderInit=true;try{Xe.init(r);}catch{}}}Lo();
|
|
2132
|
+
})();//# sourceMappingURL=mushi.loader.global.js.map
|
|
2133
|
+
//# sourceMappingURL=mushi.loader.global.js.map
|