@blipit/browser 0.3.21 → 0.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.3.22
2
+
3
+ - The Report a bug button and the report form match the site by default: they use the page's font (`body`) and its main colour, read from a CSS variable (`--primary`, `--color-primary`, `--primary-color`, `--brand`, `--brand-color`, `--color-brand`, `--bs-primary`, `--o-brand-primary`), then the primary button, the first link, or `<meta name="theme-color">`. In the form the colour is lightened or darkened until it reads on the card, and text on it turns dark when the colour is light.
4
+ - `feedbackWidget.color` now colours the form as well as the button, and `feedbackWidget.font` sets the font of both. Options in code win over what is read from the page.
5
+ - `feedbackWidget.match: false`, or Match my site off in the project's Bug report widget settings, keeps the Blipit look; the project colour is used then, and also when no site colour can be read.
6
+ - Fix: with `theme: "auto"`, a page with no background colour and no `color-scheme` is light, as browsers draw it, instead of following the visitor's dark mode.
7
+
1
8
  ## 0.3.21
2
9
 
3
10
  - Every keyed request to Blipit (events, sessions, bug reports with their screenshot, recording and voice uploads, the feedback form and settings) sends `X-Blipit-Sdk: @blipit/browser/<version>`, so the update card in Blipit always shows the version you run. Through `@blipit/nextjs` it names `@blipit/nextjs`. Beacons sent while the page closes, web vitals and replay chunks carry no headers and are unchanged.
package/README.md CHANGED
@@ -150,6 +150,7 @@ Blipit.init({
150
150
  feedbackWidget: {
151
151
  position: "bottom-right",
152
152
  color: "#3882F6",
153
+ font: "Inter, sans-serif",
153
154
  text: "Feedback",
154
155
  style: "icon",
155
156
  shortcut: "ctrl+shift+b",
@@ -206,6 +207,10 @@ have no report widget yet.
206
207
  - `position` is `bottom-right` (default), `bottom-left`, `middle-right` or `middle-left`. `color` and
207
208
  `text` override the defaults; the label is translated into the visitor's language otherwise. Options
208
209
  passed in code win over the project settings.
210
+ - The button and the report form match your site by default: they use the page's font and its main colour, read from
211
+ a CSS variable such as `--primary` or `--brand`, the primary button or the links. `color` and `font` set them yourself
212
+ and apply to the button and the form. `match: false` keeps the Blipit look. The dashboard has the same switch,
213
+ Match my site; the project colour is used when it is off or when no site colour can be read.
209
214
  - `style` is `label` (default: icon and text) or `icon` (a round icon-only button; the text stays as its
210
215
  tooltip and accessible name). The dashboard has the same choice under Button style.
211
216
  - `feedbackWidget: false` hides the button; `openReport()` and `attachReport()` keep working, so you
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var V=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var ze=(e,t)=>{for(var n in t)V(e,n,{get:t[n],enumerable:!0})},qe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ke(t))!Ue.call(e,r)&&r!==n&&V(e,r,{get:()=>t[r],enumerable:!(i=De(t,r))||i.enumerable});return e};var He=e=>qe(V({},"__esModule",{value:!0}),e);var It={};ze(It,{addBreadcrumb:()=>Tt,attachReport:()=>Ct,captureException:()=>Et,captureMessage:()=>_t,captureSecurity:()=>Rt,flush:()=>At,init:()=>St,openReport:()=>se,reportButton:()=>Mt,setReportMetadata:()=>_e,setTag:()=>Ot,setUser:()=>$t,showFeedback:()=>Lt,updateWidget:()=>Bt});module.exports=He(It);function F(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0");return t}var X=globalThis.__blipitRefused??=new Set,B=e=>X.has(e);async function T(e,t){if(e.status!==409)return!1;let n=null;try{n=await e.clone().json()}catch{}return n?.reason!=="platform_mismatch"?!1:(X.has(t)||(X.add(t),console.error(`[blipit] ${String(n.error??"This key belongs to a project for another platform.")} Blipit stopped sending with this key until the page reloads.`)),!0)}function k(){return new Date().toISOString()}var Ve=/token|key|password|secret|auth|session|passwd|api/i;function A(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let n=e.slice(0,t),r=e.slice(t+1).split("&").map(o=>{let a=o.indexOf("=");if(a===-1)return o;let d=o.slice(0,a);return Ve.test(d)?`${d}=[redacted]`:o}).join("&");return`${n}?${r}`.slice(0,2048)}var Xe=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function ae(e){return e.replace(Xe,"$1[redacted]")}function m(e,t){return e.length>t?e.slice(0,t):e}var de=".blipit-mask,[data-blipit-mask]";function Y(e){return e.replace(/#.*/,"").replace(/([?&][^=&]*)=[^&]*/g,"$1=").slice(0,2048)}function R(e,t,n){e.push(t),e.length>n&&e.shift()}function G(e){let t=e.id?`#${e.id}`:"",n=typeof e.className=="string"&&e.className.trim()?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return m(`${e.tagName.toLowerCase()}${t}${n}`,128)}function D(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}catch{let n=document.createElement("style");n.textContent=t,(e===document?document.head:e).append(n)}}function L(e,t){return`${e.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${t}`}function ce(e,t){let n=e?/^(https?:\/\/[^?#]*\/)blipit(?:\.min)?\.js(?:[?#].*)?$/.exec(e):null;return n?n[1]:`https://blipit.io/sdk/${t}/`}function le(e,t){let n=`/sdk/${t}/`,[i,r]=t.split(".");return e.endsWith(n)?`${e.slice(0,-n.length)}/sdk/${i==="0"?`${i}.${r}`:i}/`:e}function Ye(e){let t=e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?/);if(!t||(t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))<.5)return null;let[i,r,o]=[t[1],t[2],t[3]].map(a=>{let d=parseFloat(a)/255;return d<=.03928?d/12.92:((d+.055)/1.055)**2.4});return .2126*i+.7152*r+.0722*o}function ue(e){if(e==="light"||e==="dark")return e;if(typeof document<"u"){for(let n of[document.body,document.documentElement]){if(!n)continue;let i=Ye(getComputedStyle(n).backgroundColor);if(i!==null)return i<.4?"dark":"light"}let t=getComputedStyle(document.documentElement).colorScheme;if(t==="dark")return"dark";if(t&&t!=="normal"&&!t.includes("dark"))return"light"}return typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Ge=5e3,pe={en:["Report {ref} sent.","We will email you updates."],ar:["\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A {ref}.","\u0633\u0646\u0631\u0627\u0633\u0644\u0643 \u0628\u0627\u0644\u062A\u062D\u062F\u064A\u062B\u0627\u062A."],de:["Meldung {ref} gesendet.","Wir informieren Sie per E-Mail."],es:["Reporte {ref} enviado.","Te enviaremos novedades por correo."],fr:["Signalement {ref} envoy\xE9.","Nous vous tiendrons au courant par e-mail."],it:["Segnalazione {ref} inviata.","Ti invieremo aggiornamenti via email."],ja:["\u5831\u544A {ref} \u3092\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002","\u9032\u6357\u306F\u30E1\u30FC\u30EB\u3067\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002"],nl:["Melding {ref} verstuurd.","We mailen je updates."],pt:["Relato {ref} enviado.","Vamos enviar novidades por e-mail."],tr:["{ref} numaral\u0131 bildirim g\xF6nderildi.","Geli\u015Fmeleri e-postayla bildirece\u011Fiz."],zh:["\u62A5\u544A {ref} \u5DF2\u53D1\u9001\u3002","\u6211\u4EEC\u4F1A\u901A\u8FC7\u90AE\u4EF6\u544A\u77E5\u8FDB\u5C55\u3002"]};function Je(e,t,n){if(typeof e!="string"||!/^BR-\d{1,12}$/.test(e))return null;let[i,r]=pe[n.toLowerCase().split(/[-_]/)[0]]??pe.en;return`${i.replace("{ref}",e)}${t===!0?` ${r}`:""}`}function w(e,t,n){let i=document.createElement(e);return i.style.cssText=t,n!==void 0&&(i.textContent=n),i}var J="display:block;width:100%;box-sizing:border-box;margin:4px 0 12px;padding:8px 10px;font:inherit;border:1px solid #c5ccd6;border-radius:6px;background:#fff;color:#111",fe="font:inherit;padding:8px 14px;border-radius:6px;cursor:pointer;border:1px solid #c5ccd6;background:#fff;color:#111",Z=!1;function me(e,t,n,i){if(Z||typeof document>"u"||!document.body)return;Z=!0;let r=w("dialog","max-width:420px;width:calc(100% - 32px);padding:20px;border:1px solid #c5ccd6;border-radius:10px;font:14px/1.45 system-ui,sans-serif;color:#111;background:#fff");r.setAttribute("aria-labelledby","blipit-fb-title");let o=w("form","margin:0"),a=w("h2","margin:0 0 12px;font-size:17px",n.title??"Tell us what happened");a.id="blipit-fb-title";let d=(I,_,E)=>{let M=w("label","display:block;font-weight:600",I);M.htmlFor=E,_.id=E,o.append(M,_)},c=w("input",J);c.type="text",c.maxLength=128,c.autocomplete="name",c.value=n.name??"";let s=w("input",J);s.type="email",s.maxLength=254,s.autocomplete="email",s.value=n.email??"";let u=w("textarea",`${J};min-height:110px;resize:vertical`);u.required=!0,u.maxLength=Ge;let p=w("p","margin:0 0 12px;min-height:1.2em;font-size:13px");p.setAttribute("role","status"),p.setAttribute("aria-live","polite");let h=w("div","display:flex;gap:8px;justify-content:flex-end"),y=w("button",fe,"Cancel");y.type="button";let x=w("button",`${fe};background:#111;color:#fff;border-color:#111`,"Send");x.type="submit",o.append(a),d("Name (optional)",c,"blipit-fb-name"),d("Email (optional)",s,"blipit-fb-email"),d("What went wrong?",u,"blipit-fb-message"),h.append(y,x),o.append(p,h),r.append(o),document.body.append(r);let O=()=>{Z=!1,r.remove()},b=()=>typeof r.close=="function"&&r.open?r.close():O();y.addEventListener("click",b),r.addEventListener("close",O),o.addEventListener("submit",async I=>{I.preventDefault();let _=u.value.trim();if(!_){p.textContent="Please describe what happened.",u.focus();return}x.disabled=!0,y.disabled=!0,x.setAttribute("aria-busy","true"),x.textContent="Sending\u2026",p.textContent="";try{let E=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":t,"X-Blipit-Sdk":i},body:JSON.stringify({name:c.value.trim()||void 0,email:s.value.trim()||void 0,message:_,event_id:n.eventId,url:typeof location<"u"?location.href.split(/[?#]/)[0]:void 0})});if(await T(E,t))throw new Error("platform_mismatch");if(!E.ok)throw new Error(String(E.status));let M=await E.json().catch(()=>({})),f=Je(M.ref,M.emails,typeof navigator>"u"?"en":navigator.language??"en");p.textContent=f??"Thanks, your message was sent.",x.textContent="Sent",setTimeout(b,f?4e3:1200)}catch{p.textContent="That did not send. Please try again.",x.disabled=!1,y.disabled=!1,x.removeAttribute("aria-busy"),x.textContent="Send"}}),typeof r.showModal=="function"?r.showModal():r.setAttribute("open",""),u.focus()}var Q={platforms:["android","ios","react-native","flutter","web","backend","odoo"],names:{android:"Android",ios:"iOS","react-native":"React Native",flutter:"Flutter",web:"Web",backend:"Backend",odoo:"Odoo"}};var qt=Q.platforms,Ht=Q.names;var Qe={"blipit-android":"android","maven:com.github.blipit-io:blipit-android":"android","blipit-swift":"ios","swiftpm:blipit-swift":"ios","@blipit/react-native":"react-native","npm:@blipit/react-native":"react-native","blipit-flutter":"flutter","pub:blipit_flutter":"flutter","@blipit/browser":"web","blipit-browser":"web","npm:@blipit/browser":"web","@blipit/nextjs":"web","npm:@blipit/nextjs":"web","@blipit/node":"node","npm:@blipit/node":"node","blipit-python":"backend","pypi:blipit":"backend","blipit-ruby":"backend","gem:blipit":"backend","blipit-php":"backend","composer:blipit/blipit":"backend","blipit-go":"backend","go:github.com/blipit-io/blipit-go":"backend","blipit-java":"backend","maven:io.blipit:blipit":"backend","blipit-dotnet":"backend","nuget:blipit":"backend","@blipit/cli":"backend","blipit-odoo":"odoo",blipit_monitor:"odoo"},Vt=Object.keys(Qe);var ge=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var K=class{constructor(t,n,i,r,o){this.endpoint=t;this.key=n;this.sdk=i;this.debug=r;this.instance=o;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;sdk;debug;instance;queue=[];timer;sending=!1;enqueue(t){this.queue.push(t),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let t=this.queue[0];if(!await this.send(t))break;this.queue.shift()}}finally{this.sending=!1}}}async send(t,n=0){if(B(this.key))return!0;try{let i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(t),keepalive:!0});return i.status===429||i.status>=500?this.retry(t,n):await T(i,this.key)?(this.queue.length=0,!1):(this.debug&&i.status>=400&&console.warn("[blipit] event rejected",i.status,await i.text()),!0)}catch{return this.retry(t,n)}}async retry(t,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",t.event_id),!0):(await new Promise(i=>setTimeout(i,1e3*2**n)),this.send(t,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon||B(this.key)))for(;this.queue.length>0;){let t=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,i=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(i,JSON.stringify(t))}}};var be={ok:0,errored:1,crashed:2},U=class{constructor(t,n,i,r,o){this.url=t;this.key=n;this.sdk=i;this.release=r;this.environment=o;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;sdk;release;environment;sid="";started="";status="ok";errors=0;did;setUser(t){this.did=t}markError(t){if(!this.sid)return;this.errors+=1;let n=t?"crashed":"errored";be[n]<=be[this.status]||(this.status=n,this.send(!1))}start(){this.sid=F(),this.started=k(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(t){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&t?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),i=`${this.url}?key=${encodeURIComponent(this.key)}`;if(!B(this.key))try{if(t&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(i,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk},body:n,keepalive:!0}).then(r=>T(r,this.key)).catch(()=>{})}catch{return}}};var et=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,tt=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,he=/^(chrome|moz|safari-web)-extension:/;function nt(){if(typeof location<"u"&&location.origin)return location.origin}function rt(e){if(he.test(e)||e==="<anonymous>"||e==="[native code]")return!1;let t=nt();return!!(!t||e.startsWith(t)||!/^[a-z]+:/i.test(e))}function ye(e){if(!e)return[];let t=[];for(let n of e.split(`
2
- `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=et.exec(n)??tt.exec(n);if(!i)continue;let[,r,o,a,d]=i;if(!o)continue;let c={filename:m(o,1024),in_app:rt(o)};r&&(c.function=m(r,512)),a&&(c.lineno=Number(a)),d&&(c.colno=Number(d)),t.push(c)}return t.reverse(),t.slice(-128)}function xe(e){return e.length===0?!1:e.every(t=>he.test(t.filename))}var j="@blipit/browser",S="0.3.21",ve=ce(typeof document<"u"?document.currentScript?.src:void 0,S),v={exact:ve,channel:le(ve,S),debug:!1,tag:!1},it="https://in.blipit.io/api/v1/events",ot=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],st={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},at={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function dt(e){if(!ge.includes(e?.kind))return;let t=m(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=m(String(e.actorId),128)),e.ip&&(n.ip=m(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=m(String(e.userAgent),512)),e.database&&(n.database=m(String(e.database),64)),e.outcome&&(n.outcome=m(String(e.outcome),64)),e.target&&(n.target=m(String(e.target),256)),n}var z=class{constructor(t){this.options=t;this.endpoint=t.endpoint??it;let n=t._sdk??{name:j,version:S};this.sdk=`${n.name}/${n.version}`,this.transport=new K(this.endpoint,t.key,this.sdk,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new U(L(this.endpoint,"/api/v1/sessions"),t.key,this.sdk,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...ot,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;sdk;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[m(t,64)]=m(n,256)}addBreadcrumb(t){let n={timestamp:k(),...t};n.message&&(n.message=ae(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:A(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let i=t instanceof Error?t:new Error(String(t)),r={type:i.name||"Error",value:m(i.message||String(i),4096),handled:n},o=ye(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:m(t,8192),level:n})}captureSecurity(t){let n=dt(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${st[n.kind]} for ${n.actor}`,level:at[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=t.exception?.value??t.message??"";if(n){for(let d of this.ignoreErrors)if(typeof d=="string"?i.includes(d):d.test(i))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&xe(t.exception.stacktrace.frames))return;let a=`${t.exception?.type??""}|${i}`;if(t.exception?.handled===!1){if(this.seen.has(a)&&this.seen.size<100)return;this.seen.add(a),setTimeout(()=>this.seen.delete(a),5e3)}}let r={event_id:F(),timestamp:k(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:A(location.href)}:void 0,contexts:this.collectContexts(),sdk:this.options._sdk??{name:j,version:S},...t};for(let a of Object.keys(r))r[a]===void 0&&delete r[a];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let a=this.options.beforeSend(r);if(!a)return;r=a}return this.transport.enqueue(r),this.lastEventId=r.event_id,(r.level==="error"||r.level==="fatal")&&R(this.errorIds,r.event_id,20),r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(t.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(t.os={name:m(r[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};var ee={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},ct="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:#fff;font:600 14px system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px rgba(56,130,246,.75),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px rgba(56,130,246,.85),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",lt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',Ee,ke={},ut,$,te=()=>{},C,we=0;function N(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function _e(e){Ee=e}var Se=(e,t)=>new Promise((n,i)=>{let r=document.createElement("script");r.src=e,r.async=!0,r.onload=()=>n(window[t]),r.onerror=i,document.head.appendChild(r)});function ne(e,t,n){return ke[t]??=(async()=>{if(!n&&v.channel!==v.exact){try{let r=await Se(v.channel+e,t);if(r?.accepts?.({version:S,api:1}))return r}catch{}window[t]=void 0,v.debug&&console.log(`[blipit] fallback ${v.exact}${e}`)}let i=await Se(n??v.exact+e,t);if(!i)throw Error(t);return i})().catch(i=>{throw delete ke[t],i})}function pt(e,t){try{let n=e.options._sdk??{name:j,version:S},i=t?.[n.name],r=e.options.debug||/^(localhost$|127\.|\[::1])|\.local$/.test(location.hostname);try{r||=process.env.NODE_ENV==="development"}catch{}if(!r||!i||i.version.localeCompare(n.version,"en",{numeric:!0})<1)return;let o=`blipit_latest_${i.version}`,a=sessionStorage;if(a[o])return;a[o]=1,console.info(`[blipit] ${i.version} is available (you have ${n.version})${i.note?` \u2014 ${i.note}`:""} \u2014 ${v.tag?`load ${v.exact.replace(S,i.version)}blipit.js`:`npm install ${n.name}@latest`}`)}catch{}}function Re(){let e=(navigator.language??"en").slice(0,2);return ee[e]?e:"en"}function $e(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=Re(),n.textContent=ee[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var Oe=()=>{};function Te(e){Oe=e}function re(e,t){Oe(L(e.endpoint,"/api/v1/feedback"),e.options.key,t,e.sdk)}function q(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),i=r=>{te(r),n.forEach(o=>r?o.setAttribute("aria-busy","true"):o.removeAttribute("aria-busy"))};i(!0),Promise.all([ne("blipit-report.js","BlipitReport",t.src),H(e)]).then(([r,o])=>o.enabled!==!1&&r.open(e,{metadata:Ee,recording:o.recording===!0,recordingMaxMs:o.recording_max_ms,storageFull:o.storage_full===!0,reportsFull:o.reports_full===!0,theme:o.theme,hide:a=>$&&($.style.display=a?"none":"")}),()=>re(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>i(!1))}async function ft(e){let t=`blipit_fb_${S}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(L(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,"X-Blipit-Sdk":e.sdk,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return N(e,`settings failed (HTTP ${n.status})`),{};let i=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:i}))}catch{}return i}catch{return N(e,"settings unreachable (offline, ad blocker or CSP connect-src)"),{}}}function H(e){return ut??=ft(e)}async function ie(e){let t=e.options.feedbackWidget,n=++we;if(typeof document>"u")return;if(t===!1)return N(e,"Report a bug button off: feedbackWidget is false");let i=await H(e);if(pt(e,i.latest),n!==we)return;if(i.enabled===!1)return N(e,"Report a bug button hidden by the project setting");let r={...i,...typeof t=="object"?t:{}},[o,a]=ee[Re()],d=r.text||o;$=document.createElement("div"),$.setAttribute("data-blipit-ui","");let c=$.attachShadow({mode:"open"}),s=document.createElement("button");s.type="button";let[u,p]=(/^(bottom|middle)-(left|right)$/.test(r.position??"")?r.position:"bottom-right").split("-");s.style.cssText=`${r.color?`--c:${r.color};`:""}${p}:calc(20px + env(safe-area-inset-${p},0px));${u==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,s.setAttribute("aria-haspopup","dialog"),r.style==="icon"&&(s.className="o",s.title=d);let h=b=>{s.disabled=b,s.setAttribute("aria-label",b?a:d),s.innerHTML=b?"<i></i><span></span>":`${lt}<span></span>`,s.lastChild.textContent=b?a:d};te=h,h(!1),s.addEventListener("click",()=>q(e)),D(c,ct),c.append(s);let y=r.shortcut?.toLowerCase().replace(/\s/g,"");C&&document.removeEventListener("keydown",C),C=void 0,y&&(C=b=>{[b.ctrlKey&&"ctrl",b.shiftKey&&"shift",b.altKey&&"alt",b.metaKey&&"meta",b.key.toLowerCase()].filter(Boolean).join("+")===y&&(b.preventDefault(),q(e))},document.addEventListener("keydown",C));let x=$,O=()=>{$===x&&(document.body.append(x),N(e,`Report a bug button shown at ${u}-${p}`))};document.body?O():document.addEventListener("DOMContentLoaded",O)}function Le(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},$?.remove(),$=void 0,C&&document.removeEventListener("keydown",C),C=void 0,te=()=>{},ie(e)}function oe(e){return typeof e=="string"?e.length:e?.size}function Ce(e){return e&&Number(e)||void 0}function mt(e,t){return async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=(i?.method??n.method??"GET").toUpperCase(),a=Date.now();try{let d=await e(n,i);return t(o,r,d.status,a,oe(i?.body),Ce(d.headers.get("content-length"))),d}catch(d){throw t(o,r,0,a,oe(i?.body)),d}}}function gt(e,t){let n=e.open,i=e.send;e.open=function(r,o){return this._blipit=[String(r).toUpperCase(),String(o)],n.apply(this,arguments)},e.send=function(r){let o=this._blipit;if(o){let a=Date.now();this.addEventListener("loadend",()=>t(o[0],o[1],this.status,a,oe(r),Ce(this.getResponseHeader("content-length"))))}return i.apply(this,arguments)}}function Me(e){if(typeof window>"u")return;let t=L(e.endpoint,""),{console:n,network:i,actions:r}=e.logs;window.addEventListener("error",c=>{e.captureException(c.error??c.message,!1)}),window.addEventListener("unhandledrejection",c=>{e.captureException(c.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",c=>{let s=c.target;if(!(s instanceof Element)||s.closest("[data-blipit-ui]"))return;let u=G(s);e.addBreadcrumb({category:"ui.click",message:`Clicked ${u}`});let p=s.closest(de)?"***":m((s.textContent??"").trim().replace(/\s+/g," "),80);R(r,{timestamp:k(),type:"click",selector:u,text:p},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",c=>{let s=c.target;s instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)&&R(r,{timestamp:k(),type:"focus",selector:G(s)},50)},{capture:!0,passive:!0}));let o=(c,s,u,p,h,y)=>{t&&s.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${c} ${A(s)} \u2192 ${u||"network error"}`,level:u>=400||!u?"error":"info",data:{url:A(s),method:c,status_code:u||void 0}}),R(i,{timestamp:k(),method:c,url:Y(s),status:u,duration:Date.now()-p,request_size:h,response_size:y},50))};typeof window.fetch=="function"&&(window.fetch=mt(window.fetch.bind(window),o)),typeof XMLHttpRequest<"u"&&gt(XMLHttpRequest.prototype,o);for(let c of["log","info","debug","warn","error"]){let s=console[c].bind(console);console[c]=(...u)=>{let p=m(u.map(h=>typeof h=="string"?h:bt(h)).join(" "),1024);if(c==="warn"||c==="error"){e.addBreadcrumb({category:"console",level:c==="warn"?"warning":"error",message:p});let h=u.find(y=>y instanceof Error);R(n,{timestamp:k(),level:c,message:p,stack:m((h??new Error).stack??"",2e3)},100)}else R(n,{timestamp:k(),level:c,message:p},100);s(...u)}}let a=()=>R(r,{timestamp:k(),type:"navigation",url:Y(location.href)},50),d=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${A(location.href)}`}),a()};if(a(),window.history){let c=window.history.pushState.bind(window.history);window.history.pushState=(...s)=>{c(...s),d()},window.addEventListener("popstate",d)}}function bt(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function Be(){let e=0,t=0,n=0,i=0;return r=>(r.hadRecentInput||(t>0&&r.startTime-i<1e3&&r.startTime-n<5e3?t+=r.value:(t=r.value,n=r.startTime),i=r.startTime,t>e&&(e=t)),e)}function ht(e){if(e.size===0)return;let t=[...e.values()].sort((n,i)=>i-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function yt(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function P(e,t,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>t(r))).observe({type:e,buffered:!0,...n})}catch{}}function Ae(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=f=>Math.max(0,Math.round(f-r)),a=document.visibilityState==="hidden",d=location.pathname,c=i?.type,s={},u=Be(),p=new Map,h=!1,y=!1;i&&i.responseStart>0&&(s.ttfb=o(i.responseStart)),a||(P("paint",f=>{f.name==="first-contentful-paint"&&(s.fcp=o(f.startTime))}),P("largest-contentful-paint",f=>{h||(s.lcp=o(f.startTime))}));let x=()=>{h=!0};addEventListener("keydown",x,{once:!0,capture:!0}),addEventListener("pointerdown",x,{once:!0,capture:!0}),P("layout-shift",f=>{s.cls=Math.round(u(f)*1e4)/1e4});let O=f=>{if(!f.interactionId)return;p.set(f.interactionId,Math.max(p.get(f.interactionId)??0,f.duration));let W=ht(p);W!==void 0&&(s.inp=Math.round(W))};P("event",O,{durationThreshold:40}),P("first-input",O);let b=navigator.connection?.effectiveType,I=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,_=()=>{if(y||Object.keys(s).length===0||B(t))return;y=!0;let f=JSON.stringify({path:d.slice(0,512),metrics:s,nav:c,connection:b&&/^(slow-2g|2g|3g|4g)$/.test(b)?b:void 0,device:yt(navigator.userAgent)});try{if(navigator.sendBeacon?.(I,f))return}catch{}fetch(I,{method:"POST",body:f,keepalive:!0}).then(W=>T(W,t)).catch(()=>{})},E=()=>{location.pathname!==d&&(_(),d=location.pathname,c="route",s={},u=Be(),p=new Map,h=!0,y=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&_()),addEventListener("pagehide",_),addEventListener("popstate",E);let M=history.pushState;history.pushState=function(...f){M.apply(this,f),E()}}function xt(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function Ie(e,t,n,i){let r=xt(e);if(!r||typeof document>"u")return;let o=F(),a;return ne("blipit-replay.js","BlipitReplay",e.src).then(d=>a=d.start({id:o,mode:r,endpoint:t,key:n,instance:i},e),()=>{}),{id:o,active:()=>a?.active()??!1,error:d=>a?.error(d),report:d=>a?.report?.(d)}}var Fe='<svg viewBox="0 0 242.4 208.7" aria-hidden="true"><defs><linearGradient id="bm1" x1="0" y1="1" x2=".5" y2="0"><stop offset="0" stop-color="#00C2FF"/><stop offset=".35" stop-color="#3882F6"/><stop offset="1" stop-color="#0F172A"/></linearGradient><linearGradient id="bm2" x1="0" y1="1" x2="1" y2="0"><stop offset="0" stop-color="#3882F6"/><stop offset=".5" stop-color="#00C2FF"/><stop offset="1" stop-color="#3882F6"/></linearGradient></defs><path fill="url(#bm1)" d="M115.5,164.5c-3.9,0-7.8-.4-11.5-1.2-3.7-.8-7.3-1.9-10.8-3.4-3.4-1.4-6.7-3.2-9.7-5.3-3.0-2.0-5.9-4.4-8.5-7.0s-4.9-5.4-7.0-8.5c-2.1-3.1-3.9-6.3-5.3-9.8-1.5-3.5-2.6-7.1-3.4-10.8-.8-3.8-1.2-7.7-1.2-11.5V19.1c0-6.6,5.4-12.0,12.0-12.0s12.0,5.4,12.0,12.0v88.2c0,2.2.2,4.5.7,6.7.4,2.1,1.1,4.2,1.9,6.2.8,2.0,1.9,3.9,3.1,5.7,1.2,1.8,2.6,3.4,4.1,4.9s3.2,2.9,4.9,4.1c1.8,1.2,3.7,2.2,5.6,3.1,2.0.8,4.1,1.5,6.2,1.9,4.4.9,9.1.9,13.4,0,2.1-.4,4.2-1.1,6.2-1.9,2.0-.8,3.9-1.9,5.7-3.1,1.8-1.2,3.4-2.6,4.9-4.1s2.9-3.2,4.1-4.9c1.2-1.8,2.2-3.7,3.1-5.7.8-2.0,1.5-4.1,1.9-6.2.5-2.2.7-4.5.7-6.7s-.2-4.5-.7-6.7c-.4-2.1-1.1-4.2-1.9-6.2-.8-2.0-1.9-3.9-3.1-5.7-1.2-1.8-2.6-3.4-4.1-4.9s-3.2-2.9-4.9-4.1c-1.8-1.2-3.7-2.2-5.7-3.1-2.0-.8-4.1-1.5-6.2-1.9-4.4-.9-9.1-.9-13.4,0-6.5,1.3-12.9-2.9-14.2-9.4-1.3-6.5,2.9-12.9,9.4-14.2,7.6-1.6,15.5-1.6,23.1,0,3.7.8,7.3,1.9,10.8,3.4,3.4,1.4,6.7,3.2,9.7,5.3,3.0,2.0,5.9,4.4,8.5,7.0s4.9,5.4,7.0,8.5c2.1,3.1,3.9,6.3,5.3,9.8,1.5,3.5,2.6,7.1,3.4,10.8.8,3.8,1.2,7.7,1.2,11.5s-.4,7.8-1.2,11.5c-.8,3.7-1.9,7.3-3.4,10.8-1.4,3.4-3.2,6.7-5.3,9.7-2.0,3.0-4.4,5.9-7.0,8.5s-5.4,4.9-8.5,7.0c-3.1,2.1-6.3,3.9-9.8,5.3-3.5,1.5-7.1,2.6-10.8,3.4-3.8.8-7.7,1.2-11.5,1.2Z"/><path fill="url(#bm2)" d="M208.1,103.0c-.0-.6-.8-.9-1.2-.5-3.2,3.1-7.6,5.0-12.4,5.0-3.9,0-9.1-1.6-10.2-2.5-.3-.1-.1,1.4-.1,2.5,0,40.5-34.4,73.0-75.5,70.0-33.4-2.5-60.8-28.8-64.4-62.1-1.0-9.4-.2-18.6,2.2-27.0,1.6-5.6,2.6-11.4,2.6-17.3v-22.4c0-3.4-4.3-5.0-6.5-2.4-13.2,15.4-21.6,35.1-22.7,56.6-2.6,54.1,40.6,98.9,94.1,98.9s94.2-42.3,94.2-94.2c0-1.5-.1-3.0-.1-4.5Z"/><path fill="url(#bm2)" d="M201.2,70.1c-14.8-35.8-50.9-60.5-92.3-58.3h-.1c-8.2.5-14.6,7.4-14.6,15.7v.1c0,5.4,4.7,9.6,10.0,8.8,3.2-.5,6.5-.7,9.9-.7,28.7,0,53.5,17.4,64.3,42.1.2.5.9.6,1.2.1,3.2-4.8,8.7-7.9,14.9-7.9,2.0,0,4.0.3,5.8,1.0.6.2,1.1-.4.9-1.0Z"/><circle fill="#00C2FF" cx="194.5" cy="88" r="15.8"/></svg>';var l=".blipit-rb.blipit-rb",vt=`${l}{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:9px;height:40px;padding-inline:5px 17px;border-radius:99px;font:600 14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;color:#fff;background:linear-gradient(135deg,#3882F6,#2F5BEA);box-shadow:0 10px 24px -12px rgba(56,130,246,.8),0 1px 3px rgba(11,26,58,.16),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s}${l}:hover{transform:translateY(-1px);box-shadow:0 16px 32px -12px rgba(56,130,246,.85),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22)}${l}:active{transform:scale(.97)}${l}:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}${l}[aria-busy=true]{cursor:progress}${l}>span{all:unset}${l}>.blipit-rb-m{position:relative;display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px rgba(11,26,58,.08),0 1px 2px rgba(11,26,58,.12)}${l} svg{display:block;width:19px;height:17px}${l}[data-size=sm]{height:32px;gap:7px;padding-inline:4px 13px;font-size:13px}${l}[data-size=sm]>.blipit-rb-m{width:24px;height:24px}${l}[data-size=sm] svg{width:15px;height:13px}${l}[data-variant=outline],${l}[data-variant=ghost]{color:#0B1A3A;background:transparent;box-shadow:inset 0 0 0 1px #CBD7EA}${l}[data-variant=ghost]{box-shadow:none}${l}[data-variant=outline]:hover,${l}[data-variant=ghost]:hover{transform:none;background:rgba(56,130,246,.08);box-shadow:inset 0 0 0 1px rgba(56,130,246,.45)}${l}[data-variant=ghost]:hover{box-shadow:none}${l}[data-theme=dark]{background:linear-gradient(135deg,#5B9BFF,#3D6BF0);box-shadow:0 10px 24px -12px rgba(91,155,255,.7),inset 0 1px 0 rgba(255,255,255,.2)}${l}[data-theme=dark][data-variant=outline],${l}[data-theme=dark][data-variant=ghost]{color:#E8EEF8;background:transparent;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}${l}[data-theme=dark][data-variant=ghost]{box-shadow:none}${l}[data-theme=dark][data-variant=outline]:hover,${l}[data-theme=dark][data-variant=ghost]:hover{background:rgba(91,155,255,.16);box-shadow:inset 0 0 0 1px rgba(91,155,255,.45)}${l}[data-theme=dark][data-variant=ghost]:hover{box-shadow:none}${l}[data-theme=dark]>.blipit-rb-m{box-shadow:0 0 0 1px rgba(255,255,255,.1)}${l}[aria-busy=true] svg{visibility:hidden}${l}[aria-busy=true]>.blipit-rb-m::after{content:"";position:absolute;inset:4px;border:2px solid #3882F6;border-right-color:transparent;border-radius:50%;animation:blipit-rb-r .8s linear infinite}@keyframes blipit-rb-r{to{transform:rotate(1turn)}}@media(pointer:coarse){${l}{min-height:44px}}@media(prefers-reduced-motion:reduce){${l}{transition:none}${l}:hover,${l}:active{transform:none}${l}[aria-busy=true]>.blipit-rb-m::after{animation-duration:3s}}@media(forced-colors:active){${l}{border:1px solid ButtonText}}`,je=0;function Ne(e,t={}){je||D(document,vt);let n=++je,i=document.createElement("span");i.className="blipit-rb-m",i.innerHTML=Fe.replace(/bm(\d)/g,`bm$1-${n}`);let r=document.createElement("span");r.textContent=e.textContent,e.replaceChildren(i,r),e.classList.add("blipit-rb"),e.setAttribute("data-variant",t.variant==="outline"||t.variant==="ghost"?t.variant:"solid"),e.setAttribute("data-size",t.size==="sm"?"sm":"md"),e.setAttribute("data-theme",ue(t.theme==="light"||t.theme==="dark"?t.theme:void 0))}var g,Pe=new Set;function We(e,t){Pe.has(t)||(Pe.add(t),console[e](t))}var kt="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",wt="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function St(e){if(g)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return We("warn",kt);if(t.startsWith("blipit_sk_"))return We("error",wt);if(g=new z({...e,key:t}),e.sdkChannel==="exact"&&(v.channel=v.exact),v.debug=!!e.debug,e.user){let{id:r,name:o,email:a,username:d}=e.user;g.setUser({id:r===void 0?void 0:String(r),email:a,username:d??o})}Me(g),e.webVitals!==!1&&typeof window<"u"&&Ae(g.endpoint,t,e.instance);let n=g,i=r=>r&&(n.replay=Ie(r,n.endpoint,t,e.instance));i(e.replay??(typeof window<"u"&&void H(n).then(r=>i(r.replay)))),typeof window<"u"&&ie(g),e.debug&&console.log(`[blipit] ${j}@${S} initialized`)}function Et(e){return g?.captureException(e,!0)}function _t(e,t){return g?.captureMessage(e,t)}function Rt(e){return g?.captureSecurity(e)}function $t(e){g?.setUser(e)}function Ot(e,t){g?.setTag(e,t)}function Tt(e){g?.addBreadcrumb(e)}function Lt(e={}){g&&re(g,{...e,eventId:e.eventId??g.lastEventId})}function se(){g&&q(g)}function Ct(e){e.addEventListener("click",t=>{t.preventDefault(),se()})}function Mt(e={}){let t=$e(e.label,se);return Ne(t,e),t}function Bt(e){g&&Le(g,e)}function At(){return g?.flush()??Promise.resolve()}Te(me);0&&(module.exports={addBreadcrumb,attachReport,captureException,captureMessage,captureSecurity,flush,init,openReport,reportButton,setReportMetadata,setTag,setUser,showFeedback,updateWidget});
1
+ "use strict";var Y=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Ge=(e,t)=>{for(var n in t)Y(e,n,{get:t[n],enumerable:!0})},Je=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Xe(t))!Ye.call(e,o)&&o!==n&&Y(e,o,{get:()=>t[o],enumerable:!(r=Ve(t,o))||r.enumerable});return e};var Ze=e=>Je(Y({},"__esModule",{value:!0}),e);var Ut={};Ge(Ut,{addBreadcrumb:()=>Nt,attachReport:()=>Pt,captureException:()=>Lt,captureMessage:()=>At,captureSecurity:()=>Bt,flush:()=>Kt,init:()=>Ct,openReport:()=>de,reportButton:()=>Wt,setReportMetadata:()=>Ce,setTag:()=>jt,setUser:()=>It,showFeedback:()=>Ft,updateWidget:()=>Dt});module.exports=Ze(Ut);function j(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0");return t}var G=globalThis.__blipitRefused??=new Set,B=e=>G.has(e);async function M(e,t){if(e.status!==409)return!1;let n=null;try{n=await e.clone().json()}catch{}return n?.reason!=="platform_mismatch"?!1:(G.has(t)||(G.add(t),console.error(`[blipit] ${String(n.error??"This key belongs to a project for another platform.")} Blipit stopped sending with this key until the page reloads.`)),!0)}function w(){return new Date().toISOString()}var Qe=/token|key|password|secret|auth|session|passwd|api/i;function I(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let n=e.slice(0,t),o=e.slice(t+1).split("&").map(i=>{let s=i.indexOf("=");if(s===-1)return i;let d=i.slice(0,s);return Qe.test(d)?`${d}=[redacted]`:i}).join("&");return`${n}?${o}`.slice(0,2048)}var et=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function ce(e){return e.replace(et,"$1[redacted]")}function g(e,t){return e.length>t?e.slice(0,t):e}var le=".blipit-mask,[data-blipit-mask]";function J(e){return e.replace(/#.*/,"").replace(/([?&][^=&]*)=[^&]*/g,"$1=").slice(0,2048)}function $(e,t,n){e.push(t),e.length>n&&e.shift()}function Z(e){let t=e.id?`#${e.id}`:"",n=typeof e.className=="string"&&e.className.trim()?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return g(`${e.tagName.toLowerCase()}${t}${n}`,128)}function U(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}catch{let n=document.createElement("style");n.textContent=t,(e===document?document.head:e).append(n)}}function C(e,t){return`${e.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${t}`}function ue(e,t){let n=e?/^(https?:\/\/[^?#]*\/)blipit(?:\.min)?\.js(?:[?#].*)?$/.exec(e):null;return n?n[1]:`https://blipit.io/sdk/${t}/`}function pe(e,t){let n=`/sdk/${t}/`,[r,o]=t.split(".");return e.endsWith(n)?`${e.slice(0,-n.length)}/sdk/${r==="0"?`${r}.${o}`:r}/`:e}function fe(e){let t=e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?/);if(!t||(t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))<.5)return null;let[r,o,i]=[t[1],t[2],t[3]].map(s=>{let d=parseFloat(s)/255;return d<=.03928?d/12.92:((d+.055)/1.055)**2.4});return .2126*r+.7152*o+.0722*i}function me(e){if(e==="light"||e==="dark")return e;if(typeof document<"u"){for(let n of[document.body,document.documentElement]){if(!n)continue;let r=fe(getComputedStyle(n).backgroundColor);if(r!==null)return r<.4?"dark":"light"}let t=getComputedStyle(document.documentElement).colorScheme;if(t==="dark")return"dark";if(!t?.includes("dark"))return"light"}return typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var tt=e=>Math.max(...e)-Math.min(...e)>40||Math.max(...e)<70||Math.min(...e)>245,nt=["primary","color-primary","primary-color","brand","brand-color","color-brand","bs-primary","o-brand-primary"],rt=".btn-primary,.button-primary,.btn--primary,.is-primary,[class*=btn-primary],[data-variant=primary],button[type=submit],input[type=submit]";function K(e){try{let t=(e??"").trim(),n=a=>CSS.supports("color",a);if(!t)return null;if(!n(t)){let a=t.match(/#[\da-f]{3,8}|(?:rgb|hsl|oklch|oklab|lab|lch|hwb)a?\([^()]+\)/i)?.[0];if(n(`hsl(${t})`))t=`hsl(${t})`;else if(a&&n(a))t=a;else return null}let r=document.createElement("canvas");r.width=r.height=1;let o=r.getContext("2d");o.fillStyle=t,o.fillRect(0,0,1,1);let[i,s,d,c]=o.getImageData(0,0,1,1).data;return c>200?[i,s,d]:null}catch{return null}}var ge=e=>(fe(`rgb(${e})`)??0)>.45?"#0B1A3A":"#fff";function be(){let e={};try{let t=getComputedStyle(document.documentElement),n=(s,d)=>s&&(d?Math.max(...s)-Math.min(...s)>40:tt(s))?s:null,r=null;for(let s of nt)if(r=K(t.getPropertyValue(`--${s}`)))break;if(!r){for(let s of Array.from(document.querySelectorAll(rt)).slice(0,12))if(r=n(K(getComputedStyle(s).backgroundColor)))break}let o=document.querySelector("a[href]");r||=n(o&&K(getComputedStyle(o).color),!0),r&&["0,0,238","85,26,139","158,158,255"].includes(r.join())&&(r=null),r||=n(K(document.querySelector('meta[name="theme-color"]')?.content),!0),r&&(e.rgb=r);let i=getComputedStyle(document.body).fontFamily;i&&!/^"?(times( new roman)?|serif|-webkit-standard)"?$/i.test(i.trim())&&(e.font=i.replace(/[;{}]/g,""))}catch{}return e}var ot=5e3,he={en:["Report {ref} sent.","We will email you updates."],ar:["\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A {ref}.","\u0633\u0646\u0631\u0627\u0633\u0644\u0643 \u0628\u0627\u0644\u062A\u062D\u062F\u064A\u062B\u0627\u062A."],de:["Meldung {ref} gesendet.","Wir informieren Sie per E-Mail."],es:["Reporte {ref} enviado.","Te enviaremos novedades por correo."],fr:["Signalement {ref} envoy\xE9.","Nous vous tiendrons au courant par e-mail."],it:["Segnalazione {ref} inviata.","Ti invieremo aggiornamenti via email."],ja:["\u5831\u544A {ref} \u3092\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002","\u9032\u6357\u306F\u30E1\u30FC\u30EB\u3067\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002"],nl:["Melding {ref} verstuurd.","We mailen je updates."],pt:["Relato {ref} enviado.","Vamos enviar novidades por e-mail."],tr:["{ref} numaral\u0131 bildirim g\xF6nderildi.","Geli\u015Fmeleri e-postayla bildirece\u011Fiz."],zh:["\u62A5\u544A {ref} \u5DF2\u53D1\u9001\u3002","\u6211\u4EEC\u4F1A\u901A\u8FC7\u90AE\u4EF6\u544A\u77E5\u8FDB\u5C55\u3002"]};function it(e,t,n){if(typeof e!="string"||!/^BR-\d{1,12}$/.test(e))return null;let[r,o]=he[n.toLowerCase().split(/[-_]/)[0]]??he.en;return`${r.replace("{ref}",e)}${t===!0?` ${o}`:""}`}function S(e,t,n){let r=document.createElement(e);return r.style.cssText=t,n!==void 0&&(r.textContent=n),r}var Q="display:block;width:100%;box-sizing:border-box;margin:4px 0 12px;padding:8px 10px;font:inherit;border:1px solid #c5ccd6;border-radius:6px;background:#fff;color:#111",ye="font:inherit;padding:8px 14px;border-radius:6px;cursor:pointer;border:1px solid #c5ccd6;background:#fff;color:#111",ee=!1;function xe(e,t,n,r){if(ee||typeof document>"u"||!document.body)return;ee=!0;let o=S("dialog","max-width:420px;width:calc(100% - 32px);padding:20px;border:1px solid #c5ccd6;border-radius:10px;font:14px/1.45 system-ui,sans-serif;color:#111;background:#fff");o.setAttribute("aria-labelledby","blipit-fb-title");let i=S("form","margin:0"),s=S("h2","margin:0 0 12px;font-size:17px",n.title??"Tell us what happened");s.id="blipit-fb-title";let d=(f,k,_)=>{let A=S("label","display:block;font-weight:600",f);A.htmlFor=_,k.id=_,i.append(A,k)},c=S("input",Q);c.type="text",c.maxLength=128,c.autocomplete="name",c.value=n.name??"";let a=S("input",Q);a.type="email",a.maxLength=254,a.autocomplete="email",a.value=n.email??"";let u=S("textarea",`${Q};min-height:110px;resize:vertical`);u.required=!0,u.maxLength=ot;let p=S("p","margin:0 0 12px;min-height:1.2em;font-size:13px");p.setAttribute("role","status"),p.setAttribute("aria-live","polite");let h=S("div","display:flex;gap:8px;justify-content:flex-end"),y=S("button",ye,"Cancel");y.type="button";let x=S("button",`${ye};background:#111;color:#fff;border-color:#111`,"Send");x.type="submit",i.append(s),d("Name (optional)",c,"blipit-fb-name"),d("Email (optional)",a,"blipit-fb-email"),d("What went wrong?",u,"blipit-fb-message"),h.append(y,x),i.append(p,h),o.append(i),document.body.append(o);let O=()=>{ee=!1,o.remove()},R=()=>typeof o.close=="function"&&o.open?o.close():O();y.addEventListener("click",R),o.addEventListener("close",O),i.addEventListener("submit",async f=>{f.preventDefault();let k=u.value.trim();if(!k){p.textContent="Please describe what happened.",u.focus();return}x.disabled=!0,y.disabled=!0,x.setAttribute("aria-busy","true"),x.textContent="Sending\u2026",p.textContent="";try{let _=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":t,"X-Blipit-Sdk":r},body:JSON.stringify({name:c.value.trim()||void 0,email:a.value.trim()||void 0,message:k,event_id:n.eventId,url:typeof location<"u"?location.href.split(/[?#]/)[0]:void 0})});if(await M(_,t))throw new Error("platform_mismatch");if(!_.ok)throw new Error(String(_.status));let A=await _.json().catch(()=>({})),m=it(A.ref,A.emails,typeof navigator>"u"?"en":navigator.language??"en");p.textContent=m??"Thanks, your message was sent.",x.textContent="Sent",setTimeout(R,m?4e3:1200)}catch{p.textContent="That did not send. Please try again.",x.disabled=!1,y.disabled=!1,x.removeAttribute("aria-busy"),x.textContent="Send"}}),typeof o.showModal=="function"?o.showModal():o.setAttribute("open",""),u.focus()}var te={platforms:["android","ios","react-native","flutter","web","backend","odoo"],names:{android:"Android",ios:"iOS","react-native":"React Native",flutter:"Flutter",web:"Web",backend:"Backend",odoo:"Odoo"}};var Qt=te.platforms,en=te.names;var at={"blipit-android":"android","maven:com.github.blipit-io:blipit-android":"android","blipit-swift":"ios","swiftpm:blipit-swift":"ios","@blipit/react-native":"react-native","npm:@blipit/react-native":"react-native","blipit-flutter":"flutter","pub:blipit_flutter":"flutter","@blipit/browser":"web","blipit-browser":"web","npm:@blipit/browser":"web","@blipit/nextjs":"web","npm:@blipit/nextjs":"web","@blipit/node":"node","npm:@blipit/node":"node","blipit-python":"backend","pypi:blipit":"backend","blipit-ruby":"backend","gem:blipit":"backend","blipit-php":"backend","composer:blipit/blipit":"backend","blipit-go":"backend","go:github.com/blipit-io/blipit-go":"backend","blipit-java":"backend","maven:io.blipit:blipit":"backend","blipit-dotnet":"backend","nuget:blipit":"backend","@blipit/cli":"backend","blipit-odoo":"odoo",blipit_monitor:"odoo"},tn=Object.keys(at);var ve=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var z=class{constructor(t,n,r,o,i){this.endpoint=t;this.key=n;this.sdk=r;this.debug=o;this.instance=i;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;sdk;debug;instance;queue=[];timer;sending=!1;enqueue(t){this.queue.push(t),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let t=this.queue[0];if(!await this.send(t))break;this.queue.shift()}}finally{this.sending=!1}}}async send(t,n=0){if(B(this.key))return!0;try{let r=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(t),keepalive:!0});return r.status===429||r.status>=500?this.retry(t,n):await M(r,this.key)?(this.queue.length=0,!1):(this.debug&&r.status>=400&&console.warn("[blipit] event rejected",r.status,await r.text()),!0)}catch{return this.retry(t,n)}}async retry(t,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",t.event_id),!0):(await new Promise(r=>setTimeout(r,1e3*2**n)),this.send(t,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon||B(this.key)))for(;this.queue.length>0;){let t=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,r=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(r,JSON.stringify(t))}}};var ke={ok:0,errored:1,crashed:2},q=class{constructor(t,n,r,o,i){this.url=t;this.key=n;this.sdk=r;this.release=o;this.environment=i;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;sdk;release;environment;sid="";started="";status="ok";errors=0;did;setUser(t){this.did=t}markError(t){if(!this.sid)return;this.errors+=1;let n=t?"crashed":"errored";ke[n]<=ke[this.status]||(this.status=n,this.send(!1))}start(){this.sid=j(),this.started=w(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(t){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&t?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),r=`${this.url}?key=${encodeURIComponent(this.key)}`;if(!B(this.key))try{if(t&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(r,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk},body:n,keepalive:!0}).then(o=>M(o,this.key)).catch(()=>{})}catch{return}}};var dt=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,ct=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,we=/^(chrome|moz|safari-web)-extension:/;function lt(){if(typeof location<"u"&&location.origin)return location.origin}function ut(e){if(we.test(e)||e==="<anonymous>"||e==="[native code]")return!1;let t=lt();return!!(!t||e.startsWith(t)||!/^[a-z]+:/i.test(e))}function Se(e){if(!e)return[];let t=[];for(let n of e.split(`
2
+ `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let r=dt.exec(n)??ct.exec(n);if(!r)continue;let[,o,i,s,d]=r;if(!i)continue;let c={filename:g(i,1024),in_app:ut(i)};o&&(c.function=g(o,512)),s&&(c.lineno=Number(s)),d&&(c.colno=Number(d)),t.push(c)}return t.reverse(),t.slice(-128)}function Ee(e){return e.length===0?!1:e.every(t=>we.test(t.filename))}var N="@blipit/browser",E="0.3.22",_e=ue(typeof document<"u"?document.currentScript?.src:void 0,E),v={exact:_e,channel:pe(_e,E),debug:!1,tag:!1},pt="https://in.blipit.io/api/v1/events",ft=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],mt={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},gt={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function bt(e){if(!ve.includes(e?.kind))return;let t=g(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=g(String(e.actorId),128)),e.ip&&(n.ip=g(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=g(String(e.userAgent),512)),e.database&&(n.database=g(String(e.database),64)),e.outcome&&(n.outcome=g(String(e.outcome),64)),e.target&&(n.target=g(String(e.target),256)),n}var H=class{constructor(t){this.options=t;this.endpoint=t.endpoint??pt;let n=t._sdk??{name:N,version:E};this.sdk=`${n.name}/${n.version}`,this.transport=new z(this.endpoint,t.key,this.sdk,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new q(C(this.endpoint,"/api/v1/sessions"),t.key,this.sdk,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...ft,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;sdk;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[g(t,64)]=g(n,256)}addBreadcrumb(t){let n={timestamp:w(),...t};n.message&&(n.message=ce(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:I(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let r=t instanceof Error?t:new Error(String(t)),o={type:r.name||"Error",value:g(r.message||String(r),4096),handled:n},i=Se(r.stack);return i.length>0&&(o.stacktrace={frames:i}),this.processAndSend({exception:o,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:g(t,8192),level:n})}captureSecurity(t){let n=bt(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${mt[n.kind]} for ${n.actor}`,level:gt[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let r=t.exception?.value??t.message??"";if(n){for(let d of this.ignoreErrors)if(typeof d=="string"?r.includes(d):d.test(r))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&Ee(t.exception.stacktrace.frames))return;let s=`${t.exception?.type??""}|${r}`;if(t.exception?.handled===!1){if(this.seen.has(s)&&this.seen.size<100)return;this.seen.add(s),setTimeout(()=>this.seen.delete(s),5e3)}}let o={event_id:j(),timestamp:w(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:I(location.href)}:void 0,contexts:this.collectContexts(),sdk:this.options._sdk??{name:N,version:E},...t};for(let s of Object.keys(o))o[s]===void 0&&delete o[s];let i=this.replay?.active()&&(o.level==="error"||o.level==="fatal")?this.replay:void 0;if(i&&(o.tags={...o.tags,replay_id:i.id}),this.options.beforeSend){let s=this.options.beforeSend(o);if(!s)return;o=s}return this.transport.enqueue(o),this.lastEventId=o.event_id,(o.level==="error"||o.level==="fatal")&&$(this.errorIds,o.event_id,20),o.exception&&this.session?.markError(o.exception.handled===!1),i?.error(o.event_id),o.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",r=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;r&&(t.browser={name:r[1],version:r[2]});let o=/\(([^)]+)\)/.exec(n);return o&&o[1]&&(t.os={name:g(o[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};var ne={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},ht="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:var(--o,#fff);font:600 14px var(--f,system-ui),system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px var(--g,rgba(56,130,246,.75)),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px var(--g,rgba(56,130,246,.85)),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",yt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',Oe,Re={},xt,T,re=()=>{},L,$e=0,F=()=>{};function Me(e,t){let n=(e.match??t.match)===!1?{}:be(),r=e.color?void 0:n.rgb;return{color:e.color??(r?`rgb(${r})`:t.color),rgb:r,font:e.font??n.font}}function P(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function Ce(e){Oe=e}var Te=(e,t)=>new Promise((n,r)=>{let o=document.createElement("script");o.src=e,o.async=!0,o.onload=()=>n(window[t]),o.onerror=r,document.head.appendChild(o)});function oe(e,t,n){return Re[t]??=(async()=>{if(!n&&v.channel!==v.exact){try{let o=await Te(v.channel+e,t);if(o?.accepts?.({version:E,api:1}))return o}catch{}window[t]=void 0,v.debug&&console.log(`[blipit] fallback ${v.exact}${e}`)}let r=await Te(n??v.exact+e,t);if(!r)throw Error(t);return r})().catch(r=>{throw delete Re[t],r})}function vt(e,t){try{let n=e.options._sdk??{name:N,version:E},r=t?.[n.name],o=e.options.debug||/^(localhost$|127\.|\[::1])|\.local$/.test(location.hostname);try{o||=process.env.NODE_ENV==="development"}catch{}if(!o||!r||r.version.localeCompare(n.version,"en",{numeric:!0})<1)return;let i=`blipit_latest_${r.version}`,s=sessionStorage;if(s[i])return;s[i]=1,console.info(`[blipit] ${r.version} is available (you have ${n.version})${r.note?` \u2014 ${r.note}`:""} \u2014 ${v.tag?`load ${v.exact.replace(E,r.version)}blipit.js`:`npm install ${n.name}@latest`}`)}catch{}}function Le(){let e=(navigator.language??"en").slice(0,2);return ne[e]?e:"en"}function Ae(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=Le(),n.textContent=ne[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var Be=()=>{};function Ie(e){Be=e}function ie(e,t){Be(C(e.endpoint,"/api/v1/feedback"),e.options.key,t,e.sdk)}function V(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),r=o=>{re(o),n.forEach(i=>o?i.setAttribute("aria-busy","true"):i.removeAttribute("aria-busy"))};r(!0),F(),Promise.all([oe("blipit-report.js","BlipitReport",t.src),X(e)]).then(([o,i])=>i.enabled!==!1&&o.open(e,{metadata:Oe,recording:i.recording===!0,recordingMaxMs:i.recording_max_ms,storageFull:i.storage_full===!0,reportsFull:i.reports_full===!0,theme:i.theme,look:Me(t,i),hide:s=>T&&(T.style.display=s?"none":"")}),()=>ie(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>r(!1))}async function kt(e){let t=`blipit_fb_${E}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(C(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,"X-Blipit-Sdk":e.sdk,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return P(e,`settings failed (HTTP ${n.status})`),{};let r=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:r}))}catch{}return r}catch{return P(e,"settings unreachable (offline, ad blocker or CSP connect-src)"),{}}}function X(e){return xt??=kt(e)}async function se(e){let t=e.options.feedbackWidget,n=++$e;if(typeof document>"u")return;if(t===!1)return P(e,"Report a bug button off: feedbackWidget is false");let r=await X(e);if(vt(e,r.latest),n!==$e)return;if(r.enabled===!1)return P(e,"Report a bug button hidden by the project setting");let o={...r,...typeof t=="object"?t:{}},[i,s]=ne[Le()],d=o.text||i;T=document.createElement("div"),T.setAttribute("data-blipit-ui","");let c=T.attachShadow({mode:"open"}),a=document.createElement("button");a.type="button";let[u,p]=(/^(bottom|middle)-(left|right)$/.test(o.position??"")?o.position:"bottom-right").split("-");a.style.cssText=`${o.color?`--c:${o.color};`:""}${p}:calc(20px + env(safe-area-inset-${p},0px));${u==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,a.setAttribute("aria-haspopup","dialog"),o.style==="icon"&&(a.className="o",a.title=d);let h=typeof t=="object"?t:{};F=()=>{let{rgb:f,font:k}=Me(h,r);f&&(a.style.cssText+=`;--c:rgb(${f});--g:rgba(${f},.6);--o:${ge(f)}`),k&&(a.style.cssText+=`;--f:${k.replace(/[;{}]/g,"")}`)};let y=f=>{a.disabled=f,a.setAttribute("aria-label",f?s:d),a.innerHTML=f?"<i></i><span></span>":`${yt}<span></span>`,a.lastChild.textContent=f?s:d};re=y,y(!1),a.addEventListener("click",()=>V(e)),U(c,ht),c.append(a);let x=o.shortcut?.toLowerCase().replace(/\s/g,"");L&&document.removeEventListener("keydown",L),L=void 0,x&&(L=f=>{[f.ctrlKey&&"ctrl",f.shiftKey&&"shift",f.altKey&&"alt",f.metaKey&&"meta",f.key.toLowerCase()].filter(Boolean).join("+")===x&&(f.preventDefault(),V(e))},document.addEventListener("keydown",L));let O=T,R=()=>{T===O&&(document.body.append(O),F(),document.readyState!=="complete"&&globalThis.addEventListener?.("load",()=>F(),{once:!0}),P(e,`Report a bug button shown at ${u}-${p}`))};document.body?R():document.addEventListener("DOMContentLoaded",R)}function je(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},T?.remove(),T=void 0,L&&document.removeEventListener("keydown",L),L=void 0,re=F=()=>{},se(e)}function ae(e){return typeof e=="string"?e.length:e?.size}function Ne(e){return e&&Number(e)||void 0}function wt(e,t){return async(n,r)=>{let o=typeof n=="string"?n:n instanceof URL?n.href:n.url,i=(r?.method??n.method??"GET").toUpperCase(),s=Date.now();try{let d=await e(n,r);return t(i,o,d.status,s,ae(r?.body),Ne(d.headers.get("content-length"))),d}catch(d){throw t(i,o,0,s,ae(r?.body)),d}}}function St(e,t){let n=e.open,r=e.send;e.open=function(o,i){return this._blipit=[String(o).toUpperCase(),String(i)],n.apply(this,arguments)},e.send=function(o){let i=this._blipit;if(i){let s=Date.now();this.addEventListener("loadend",()=>t(i[0],i[1],this.status,s,ae(o),Ne(this.getResponseHeader("content-length"))))}return r.apply(this,arguments)}}function Fe(e){if(typeof window>"u")return;let t=C(e.endpoint,""),{console:n,network:r,actions:o}=e.logs;window.addEventListener("error",c=>{e.captureException(c.error??c.message,!1)}),window.addEventListener("unhandledrejection",c=>{e.captureException(c.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",c=>{let a=c.target;if(!(a instanceof Element)||a.closest("[data-blipit-ui]"))return;let u=Z(a);e.addBreadcrumb({category:"ui.click",message:`Clicked ${u}`});let p=a.closest(le)?"***":g((a.textContent??"").trim().replace(/\s+/g," "),80);$(o,{timestamp:w(),type:"click",selector:u,text:p},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",c=>{let a=c.target;a instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName)&&$(o,{timestamp:w(),type:"focus",selector:Z(a)},50)},{capture:!0,passive:!0}));let i=(c,a,u,p,h,y)=>{t&&a.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${c} ${I(a)} \u2192 ${u||"network error"}`,level:u>=400||!u?"error":"info",data:{url:I(a),method:c,status_code:u||void 0}}),$(r,{timestamp:w(),method:c,url:J(a),status:u,duration:Date.now()-p,request_size:h,response_size:y},50))};typeof window.fetch=="function"&&(window.fetch=wt(window.fetch.bind(window),i)),typeof XMLHttpRequest<"u"&&St(XMLHttpRequest.prototype,i);for(let c of["log","info","debug","warn","error"]){let a=console[c].bind(console);console[c]=(...u)=>{let p=g(u.map(h=>typeof h=="string"?h:Et(h)).join(" "),1024);if(c==="warn"||c==="error"){e.addBreadcrumb({category:"console",level:c==="warn"?"warning":"error",message:p});let h=u.find(y=>y instanceof Error);$(n,{timestamp:w(),level:c,message:p,stack:g((h??new Error).stack??"",2e3)},100)}else $(n,{timestamp:w(),level:c,message:p},100);a(...u)}}let s=()=>$(o,{timestamp:w(),type:"navigation",url:J(location.href)},50),d=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${I(location.href)}`}),s()};if(s(),window.history){let c=window.history.pushState.bind(window.history);window.history.pushState=(...a)=>{c(...a),d()},window.addEventListener("popstate",d)}}function Et(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function Pe(){let e=0,t=0,n=0,r=0;return o=>(o.hadRecentInput||(t>0&&o.startTime-r<1e3&&o.startTime-n<5e3?t+=o.value:(t=o.value,n=o.startTime),r=o.startTime,t>e&&(e=t)),e)}function _t(e){if(e.size===0)return;let t=[...e.values()].sort((n,r)=>r-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function Rt(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function W(e,t,n){try{new PerformanceObserver(r=>r.getEntries().forEach(o=>t(o))).observe({type:e,buffered:!0,...n})}catch{}}function We(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let r=performance.getEntriesByType("navigation")[0],o=r?.activationStart??0,i=m=>Math.max(0,Math.round(m-o)),s=document.visibilityState==="hidden",d=location.pathname,c=r?.type,a={},u=Pe(),p=new Map,h=!1,y=!1;r&&r.responseStart>0&&(a.ttfb=i(r.responseStart)),s||(W("paint",m=>{m.name==="first-contentful-paint"&&(a.fcp=i(m.startTime))}),W("largest-contentful-paint",m=>{h||(a.lcp=i(m.startTime))}));let x=()=>{h=!0};addEventListener("keydown",x,{once:!0,capture:!0}),addEventListener("pointerdown",x,{once:!0,capture:!0}),W("layout-shift",m=>{a.cls=Math.round(u(m)*1e4)/1e4});let O=m=>{if(!m.interactionId)return;p.set(m.interactionId,Math.max(p.get(m.interactionId)??0,m.duration));let D=_t(p);D!==void 0&&(a.inp=Math.round(D))};W("event",O,{durationThreshold:40}),W("first-input",O);let R=navigator.connection?.effectiveType,f=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,k=()=>{if(y||Object.keys(a).length===0||B(t))return;y=!0;let m=JSON.stringify({path:d.slice(0,512),metrics:a,nav:c,connection:R&&/^(slow-2g|2g|3g|4g)$/.test(R)?R:void 0,device:Rt(navigator.userAgent)});try{if(navigator.sendBeacon?.(f,m))return}catch{}fetch(f,{method:"POST",body:m,keepalive:!0}).then(D=>M(D,t)).catch(()=>{})},_=()=>{location.pathname!==d&&(k(),d=location.pathname,c="route",a={},u=Pe(),p=new Map,h=!0,y=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&k()),addEventListener("pagehide",k),addEventListener("popstate",_);let A=history.pushState;history.pushState=function(...m){A.apply(this,m),_()}}function $t(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function De(e,t,n,r){let o=$t(e);if(!o||typeof document>"u")return;let i=j(),s;return oe("blipit-replay.js","BlipitReplay",e.src).then(d=>s=d.start({id:i,mode:o,endpoint:t,key:n,instance:r},e),()=>{}),{id:i,active:()=>s?.active()??!1,error:d=>s?.error(d),report:d=>s?.report?.(d)}}var Ke='<svg viewBox="0 0 242.4 208.7" aria-hidden="true"><defs><linearGradient id="bm1" x1="0" y1="1" x2=".5" y2="0"><stop offset="0" stop-color="#00C2FF"/><stop offset=".35" stop-color="#3882F6"/><stop offset="1" stop-color="#0F172A"/></linearGradient><linearGradient id="bm2" x1="0" y1="1" x2="1" y2="0"><stop offset="0" stop-color="#3882F6"/><stop offset=".5" stop-color="#00C2FF"/><stop offset="1" stop-color="#3882F6"/></linearGradient></defs><path fill="url(#bm1)" d="M115.5,164.5c-3.9,0-7.8-.4-11.5-1.2-3.7-.8-7.3-1.9-10.8-3.4-3.4-1.4-6.7-3.2-9.7-5.3-3.0-2.0-5.9-4.4-8.5-7.0s-4.9-5.4-7.0-8.5c-2.1-3.1-3.9-6.3-5.3-9.8-1.5-3.5-2.6-7.1-3.4-10.8-.8-3.8-1.2-7.7-1.2-11.5V19.1c0-6.6,5.4-12.0,12.0-12.0s12.0,5.4,12.0,12.0v88.2c0,2.2.2,4.5.7,6.7.4,2.1,1.1,4.2,1.9,6.2.8,2.0,1.9,3.9,3.1,5.7,1.2,1.8,2.6,3.4,4.1,4.9s3.2,2.9,4.9,4.1c1.8,1.2,3.7,2.2,5.6,3.1,2.0.8,4.1,1.5,6.2,1.9,4.4.9,9.1.9,13.4,0,2.1-.4,4.2-1.1,6.2-1.9,2.0-.8,3.9-1.9,5.7-3.1,1.8-1.2,3.4-2.6,4.9-4.1s2.9-3.2,4.1-4.9c1.2-1.8,2.2-3.7,3.1-5.7.8-2.0,1.5-4.1,1.9-6.2.5-2.2.7-4.5.7-6.7s-.2-4.5-.7-6.7c-.4-2.1-1.1-4.2-1.9-6.2-.8-2.0-1.9-3.9-3.1-5.7-1.2-1.8-2.6-3.4-4.1-4.9s-3.2-2.9-4.9-4.1c-1.8-1.2-3.7-2.2-5.7-3.1-2.0-.8-4.1-1.5-6.2-1.9-4.4-.9-9.1-.9-13.4,0-6.5,1.3-12.9-2.9-14.2-9.4-1.3-6.5,2.9-12.9,9.4-14.2,7.6-1.6,15.5-1.6,23.1,0,3.7.8,7.3,1.9,10.8,3.4,3.4,1.4,6.7,3.2,9.7,5.3,3.0,2.0,5.9,4.4,8.5,7.0s4.9,5.4,7.0,8.5c2.1,3.1,3.9,6.3,5.3,9.8,1.5,3.5,2.6,7.1,3.4,10.8.8,3.8,1.2,7.7,1.2,11.5s-.4,7.8-1.2,11.5c-.8,3.7-1.9,7.3-3.4,10.8-1.4,3.4-3.2,6.7-5.3,9.7-2.0,3.0-4.4,5.9-7.0,8.5s-5.4,4.9-8.5,7.0c-3.1,2.1-6.3,3.9-9.8,5.3-3.5,1.5-7.1,2.6-10.8,3.4-3.8.8-7.7,1.2-11.5,1.2Z"/><path fill="url(#bm2)" d="M208.1,103.0c-.0-.6-.8-.9-1.2-.5-3.2,3.1-7.6,5.0-12.4,5.0-3.9,0-9.1-1.6-10.2-2.5-.3-.1-.1,1.4-.1,2.5,0,40.5-34.4,73.0-75.5,70.0-33.4-2.5-60.8-28.8-64.4-62.1-1.0-9.4-.2-18.6,2.2-27.0,1.6-5.6,2.6-11.4,2.6-17.3v-22.4c0-3.4-4.3-5.0-6.5-2.4-13.2,15.4-21.6,35.1-22.7,56.6-2.6,54.1,40.6,98.9,94.1,98.9s94.2-42.3,94.2-94.2c0-1.5-.1-3.0-.1-4.5Z"/><path fill="url(#bm2)" d="M201.2,70.1c-14.8-35.8-50.9-60.5-92.3-58.3h-.1c-8.2.5-14.6,7.4-14.6,15.7v.1c0,5.4,4.7,9.6,10.0,8.8,3.2-.5,6.5-.7,9.9-.7,28.7,0,53.5,17.4,64.3,42.1.2.5.9.6,1.2.1,3.2-4.8,8.7-7.9,14.9-7.9,2.0,0,4.0.3,5.8,1.0.6.2,1.1-.4.9-1.0Z"/><circle fill="#00C2FF" cx="194.5" cy="88" r="15.8"/></svg>';var l=".blipit-rb.blipit-rb",Tt=`${l}{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:9px;height:40px;padding-inline:5px 17px;border-radius:99px;font:600 14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;color:#fff;background:linear-gradient(135deg,#3882F6,#2F5BEA);box-shadow:0 10px 24px -12px rgba(56,130,246,.8),0 1px 3px rgba(11,26,58,.16),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s}${l}:hover{transform:translateY(-1px);box-shadow:0 16px 32px -12px rgba(56,130,246,.85),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22)}${l}:active{transform:scale(.97)}${l}:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}${l}[aria-busy=true]{cursor:progress}${l}>span{all:unset}${l}>.blipit-rb-m{position:relative;display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px rgba(11,26,58,.08),0 1px 2px rgba(11,26,58,.12)}${l} svg{display:block;width:19px;height:17px}${l}[data-size=sm]{height:32px;gap:7px;padding-inline:4px 13px;font-size:13px}${l}[data-size=sm]>.blipit-rb-m{width:24px;height:24px}${l}[data-size=sm] svg{width:15px;height:13px}${l}[data-variant=outline],${l}[data-variant=ghost]{color:#0B1A3A;background:transparent;box-shadow:inset 0 0 0 1px #CBD7EA}${l}[data-variant=ghost]{box-shadow:none}${l}[data-variant=outline]:hover,${l}[data-variant=ghost]:hover{transform:none;background:rgba(56,130,246,.08);box-shadow:inset 0 0 0 1px rgba(56,130,246,.45)}${l}[data-variant=ghost]:hover{box-shadow:none}${l}[data-theme=dark]{background:linear-gradient(135deg,#5B9BFF,#3D6BF0);box-shadow:0 10px 24px -12px rgba(91,155,255,.7),inset 0 1px 0 rgba(255,255,255,.2)}${l}[data-theme=dark][data-variant=outline],${l}[data-theme=dark][data-variant=ghost]{color:#E8EEF8;background:transparent;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}${l}[data-theme=dark][data-variant=ghost]{box-shadow:none}${l}[data-theme=dark][data-variant=outline]:hover,${l}[data-theme=dark][data-variant=ghost]:hover{background:rgba(91,155,255,.16);box-shadow:inset 0 0 0 1px rgba(91,155,255,.45)}${l}[data-theme=dark][data-variant=ghost]:hover{box-shadow:none}${l}[data-theme=dark]>.blipit-rb-m{box-shadow:0 0 0 1px rgba(255,255,255,.1)}${l}[aria-busy=true] svg{visibility:hidden}${l}[aria-busy=true]>.blipit-rb-m::after{content:"";position:absolute;inset:4px;border:2px solid #3882F6;border-right-color:transparent;border-radius:50%;animation:blipit-rb-r .8s linear infinite}@keyframes blipit-rb-r{to{transform:rotate(1turn)}}@media(pointer:coarse){${l}{min-height:44px}}@media(prefers-reduced-motion:reduce){${l}{transition:none}${l}:hover,${l}:active{transform:none}${l}[aria-busy=true]>.blipit-rb-m::after{animation-duration:3s}}@media(forced-colors:active){${l}{border:1px solid ButtonText}}`,Ue=0;function ze(e,t={}){Ue||U(document,Tt);let n=++Ue,r=document.createElement("span");r.className="blipit-rb-m",r.innerHTML=Ke.replace(/bm(\d)/g,`bm$1-${n}`);let o=document.createElement("span");o.textContent=e.textContent,e.replaceChildren(r,o),e.classList.add("blipit-rb"),e.setAttribute("data-variant",t.variant==="outline"||t.variant==="ghost"?t.variant:"solid"),e.setAttribute("data-size",t.size==="sm"?"sm":"md"),e.setAttribute("data-theme",me(t.theme==="light"||t.theme==="dark"?t.theme:void 0))}var b,qe=new Set;function He(e,t){qe.has(t)||(qe.add(t),console[e](t))}var Ot="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",Mt="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function Ct(e){if(b)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return He("warn",Ot);if(t.startsWith("blipit_sk_"))return He("error",Mt);if(b=new H({...e,key:t}),e.sdkChannel==="exact"&&(v.channel=v.exact),v.debug=!!e.debug,e.user){let{id:o,name:i,email:s,username:d}=e.user;b.setUser({id:o===void 0?void 0:String(o),email:s,username:d??i})}Fe(b),e.webVitals!==!1&&typeof window<"u"&&We(b.endpoint,t,e.instance);let n=b,r=o=>o&&(n.replay=De(o,n.endpoint,t,e.instance));r(e.replay??(typeof window<"u"&&void X(n).then(o=>r(o.replay)))),typeof window<"u"&&se(b),e.debug&&console.log(`[blipit] ${N}@${E} initialized`)}function Lt(e){return b?.captureException(e,!0)}function At(e,t){return b?.captureMessage(e,t)}function Bt(e){return b?.captureSecurity(e)}function It(e){b?.setUser(e)}function jt(e,t){b?.setTag(e,t)}function Nt(e){b?.addBreadcrumb(e)}function Ft(e={}){b&&ie(b,{...e,eventId:e.eventId??b.lastEventId})}function de(){b&&V(b)}function Pt(e){e.addEventListener("click",t=>{t.preventDefault(),de()})}function Wt(e={}){let t=Ae(e.label,de);return ze(t,e),t}function Dt(e){b&&je(b,e)}function Kt(){return b?.flush()??Promise.resolve()}Ie(xe);0&&(module.exports={addBreadcrumb,attachReport,captureException,captureMessage,captureSecurity,flush,init,openReport,reportButton,setReportMetadata,setTag,setUser,showFeedback,updateWidget});
package/dist/index.d.cts CHANGED
@@ -13,6 +13,8 @@ interface WidgetOptions {
13
13
  color?: string;
14
14
  text?: string;
15
15
  style?: "label" | "icon";
16
+ font?: string;
17
+ match?: boolean;
16
18
  shortcut?: string;
17
19
  src?: string;
18
20
  }
package/dist/index.d.ts CHANGED
@@ -13,6 +13,8 @@ interface WidgetOptions {
13
13
  color?: string;
14
14
  text?: string;
15
15
  style?: "label" | "icon";
16
+ font?: string;
17
+ match?: boolean;
16
18
  shortcut?: string;
17
19
  src?: string;
18
20
  }
@@ -1,2 +1,2 @@
1
- "use strict";var Blipit=(()=>{var K=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var Me=(e,t)=>{for(var n in t)K(e,n,{get:t[n],enumerable:!0})},Ce=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Le(t))!Ie.call(e,r)&&r!==n&&K(e,r,{get:()=>t[r],enumerable:!(i=Be(t,r))||i.enumerable});return e};var Ae=e=>Ce(K({},"__esModule",{value:!0}),e);var kt={};Me(kt,{addBreadcrumb:()=>mt,attachReport:()=>bt,captureException:()=>dt,captureMessage:()=>ut,captureSecurity:()=>lt,flush:()=>yt,init:()=>ct,openReport:()=>F,reportButton:()=>vt,setReportMetadata:()=>xe,setTag:()=>ft,setUser:()=>pt,showFeedback:()=>gt,updateWidget:()=>ht});var q={platforms:["android","ios","react-native","flutter","web","backend","odoo"],names:{android:"Android",ios:"iOS","react-native":"React Native",flutter:"Flutter",web:"Web",backend:"Backend",odoo:"Odoo"}};var Ot=q.platforms,$t=q.names;var Ne={"blipit-android":"android","maven:com.github.blipit-io:blipit-android":"android","blipit-swift":"ios","swiftpm:blipit-swift":"ios","@blipit/react-native":"react-native","npm:@blipit/react-native":"react-native","blipit-flutter":"flutter","pub:blipit_flutter":"flutter","@blipit/browser":"web","blipit-browser":"web","npm:@blipit/browser":"web","@blipit/nextjs":"web","npm:@blipit/nextjs":"web","@blipit/node":"node","npm:@blipit/node":"node","blipit-python":"backend","pypi:blipit":"backend","blipit-ruby":"backend","gem:blipit":"backend","blipit-php":"backend","composer:blipit/blipit":"backend","blipit-go":"backend","go:github.com/blipit-io/blipit-go":"backend","blipit-java":"backend","maven:io.blipit:blipit":"backend","blipit-dotnet":"backend","nuget:blipit":"backend","@blipit/cli":"backend","blipit-odoo":"odoo",blipit_monitor:"odoo"},Tt=Object.keys(Ne);var ne=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];function O(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0");return t}var z=globalThis.__blipitRefused??=new Set,E=e=>z.has(e);async function $(e,t){if(e.status!==409)return!1;let n=null;try{n=await e.clone().json()}catch{}return n?.reason!=="platform_mismatch"?!1:(z.has(t)||(z.add(t),console.error(`[blipit] ${String(n.error??"This key belongs to a project for another platform.")} Blipit stopped sending with this key until the page reloads.`)),!0)}function y(){return new Date().toISOString()}var Pe=/token|key|password|secret|auth|session|passwd|api/i;function R(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let n=e.slice(0,t),r=e.slice(t+1).split("&").map(o=>{let s=o.indexOf("=");if(s===-1)return o;let c=o.slice(0,s);return Pe.test(c)?`${c}=[redacted]`:o}).join("&");return`${n}?${r}`.slice(0,2048)}var De=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function re(e){return e.replace(De,"$1[redacted]")}function u(e,t){return e.length>t?e.slice(0,t):e}var ie=".blipit-mask,[data-blipit-mask]";function H(e){return e.replace(/#.*/,"").replace(/([?&][^=&]*)=[^&]*/g,"$1=").slice(0,2048)}function x(e,t,n){e.push(t),e.length>n&&e.shift()}function V(e){let t=e.id?`#${e.id}`:"",n=typeof e.className=="string"&&e.className.trim()?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return u(`${e.tagName.toLowerCase()}${t}${n}`,128)}function oe(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}catch{let n=document.createElement("style");n.textContent=t,(e===document?document.head:e).append(n)}}function S(e,t){return`${e.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${t}`}function se(e,t){let n=e?/^(https?:\/\/[^?#]*\/)blipit(?:\.min)?\.js(?:[?#].*)?$/.exec(e):null;return n?n[1]:`https://blipit.io/sdk/${t}/`}function ae(e,t){let n=`/sdk/${t}/`,[i,r]=t.split(".");return e.endsWith(n)?`${e.slice(0,-n.length)}/sdk/${i==="0"?`${i}.${r}`:i}/`:e}var j=class{constructor(t,n,i,r,o){this.endpoint=t;this.key=n;this.sdk=i;this.debug=r;this.instance=o;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;sdk;debug;instance;queue=[];timer;sending=!1;enqueue(t){this.queue.push(t),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let t=this.queue[0];if(!await this.send(t))break;this.queue.shift()}}finally{this.sending=!1}}}async send(t,n=0){if(E(this.key))return!0;try{let i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(t),keepalive:!0});return i.status===429||i.status>=500?this.retry(t,n):await $(i,this.key)?(this.queue.length=0,!1):(this.debug&&i.status>=400&&console.warn("[blipit] event rejected",i.status,await i.text()),!0)}catch{return this.retry(t,n)}}async retry(t,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",t.event_id),!0):(await new Promise(i=>setTimeout(i,1e3*2**n)),this.send(t,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon||E(this.key)))for(;this.queue.length>0;){let t=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,i=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(i,JSON.stringify(t))}}};var ce={ok:0,errored:1,crashed:2},N=class{constructor(t,n,i,r,o){this.url=t;this.key=n;this.sdk=i;this.release=r;this.environment=o;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;sdk;release;environment;sid="";started="";status="ok";errors=0;did;setUser(t){this.did=t}markError(t){if(!this.sid)return;this.errors+=1;let n=t?"crashed":"errored";ce[n]<=ce[this.status]||(this.status=n,this.send(!1))}start(){this.sid=O(),this.started=y(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(t){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&t?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),i=`${this.url}?key=${encodeURIComponent(this.key)}`;if(!E(this.key))try{if(t&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(i,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk},body:n,keepalive:!0}).then(r=>$(r,this.key)).catch(()=>{})}catch{return}}};var We=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,Fe=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,de=/^(chrome|moz|safari-web)-extension:/;function Ue(){if(typeof location<"u"&&location.origin)return location.origin}function Ke(e){if(de.test(e)||e==="<anonymous>"||e==="[native code]")return!1;let t=Ue();return!!(!t||e.startsWith(t)||!/^[a-z]+:/i.test(e))}function ue(e){if(!e)return[];let t=[];for(let n of e.split(`
2
- `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=We.exec(n)??Fe.exec(n);if(!i)continue;let[,r,o,s,c]=i;if(!o)continue;let d={filename:u(o,1024),in_app:Ke(o)};r&&(d.function=u(r,512)),s&&(d.lineno=Number(s)),c&&(d.colno=Number(c)),t.push(d)}return t.reverse(),t.slice(-128)}function le(e){return e.length===0?!1:e.every(t=>de.test(t.filename))}var T="@blipit/browser",v="0.3.21",pe=se(typeof document<"u"?document.currentScript?.src:void 0,v),b={exact:pe,channel:ae(pe,v),debug:!1,tag:!1},qe="https://in.blipit.io/api/v1/events",ze=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],He={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},Ve={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function Xe(e){if(!ne.includes(e?.kind))return;let t=u(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=u(String(e.actorId),128)),e.ip&&(n.ip=u(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=u(String(e.userAgent),512)),e.database&&(n.database=u(String(e.database),64)),e.outcome&&(n.outcome=u(String(e.outcome),64)),e.target&&(n.target=u(String(e.target),256)),n}var P=class{constructor(t){this.options=t;this.endpoint=t.endpoint??qe;let n=t._sdk??{name:T,version:v};this.sdk=`${n.name}/${n.version}`,this.transport=new j(this.endpoint,t.key,this.sdk,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new N(S(this.endpoint,"/api/v1/sessions"),t.key,this.sdk,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...ze,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;sdk;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[u(t,64)]=u(n,256)}addBreadcrumb(t){let n={timestamp:y(),...t};n.message&&(n.message=re(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:R(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let i=t instanceof Error?t:new Error(String(t)),r={type:i.name||"Error",value:u(i.message||String(i),4096),handled:n},o=ue(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:u(t,8192),level:n})}captureSecurity(t){let n=Xe(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${He[n.kind]} for ${n.actor}`,level:Ve[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=t.exception?.value??t.message??"";if(n){for(let c of this.ignoreErrors)if(typeof c=="string"?i.includes(c):c.test(i))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&le(t.exception.stacktrace.frames))return;let s=`${t.exception?.type??""}|${i}`;if(t.exception?.handled===!1){if(this.seen.has(s)&&this.seen.size<100)return;this.seen.add(s),setTimeout(()=>this.seen.delete(s),5e3)}}let r={event_id:O(),timestamp:y(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:R(location.href)}:void 0,contexts:this.collectContexts(),sdk:this.options._sdk??{name:T,version:v},...t};for(let s of Object.keys(r))r[s]===void 0&&delete r[s];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let s=this.options.beforeSend(r);if(!s)return;r=s}return this.transport.enqueue(r),this.lastEventId=r.event_id,(r.level==="error"||r.level==="fatal")&&x(this.errorIds,r.event_id,20),r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(t.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(t.os={name:u(r[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};function X(e){return typeof e=="string"?e.length:e?.size}function fe(e){return e&&Number(e)||void 0}function Ye(e,t){return async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=(i?.method??n.method??"GET").toUpperCase(),s=Date.now();try{let c=await e(n,i);return t(o,r,c.status,s,X(i?.body),fe(c.headers.get("content-length"))),c}catch(c){throw t(o,r,0,s,X(i?.body)),c}}}function Je(e,t){let n=e.open,i=e.send;e.open=function(r,o){return this._blipit=[String(r).toUpperCase(),String(o)],n.apply(this,arguments)},e.send=function(r){let o=this._blipit;if(o){let s=Date.now();this.addEventListener("loadend",()=>t(o[0],o[1],this.status,s,X(r),fe(this.getResponseHeader("content-length"))))}return i.apply(this,arguments)}}function me(e){if(typeof window>"u")return;let t=S(e.endpoint,""),{console:n,network:i,actions:r}=e.logs;window.addEventListener("error",d=>{e.captureException(d.error??d.message,!1)}),window.addEventListener("unhandledrejection",d=>{e.captureException(d.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",d=>{let a=d.target;if(!(a instanceof Element)||a.closest("[data-blipit-ui]"))return;let p=V(a);e.addBreadcrumb({category:"ui.click",message:`Clicked ${p}`});let m=a.closest(ie)?"***":u((a.textContent??"").trim().replace(/\s+/g," "),80);x(r,{timestamp:y(),type:"click",selector:p,text:m},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",d=>{let a=d.target;a instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName)&&x(r,{timestamp:y(),type:"focus",selector:V(a)},50)},{capture:!0,passive:!0}));let o=(d,a,p,m,h,k)=>{t&&a.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${d} ${R(a)} \u2192 ${p||"network error"}`,level:p>=400||!p?"error":"info",data:{url:R(a),method:d,status_code:p||void 0}}),x(i,{timestamp:y(),method:d,url:H(a),status:p,duration:Date.now()-m,request_size:h,response_size:k},50))};typeof window.fetch=="function"&&(window.fetch=Ye(window.fetch.bind(window),o)),typeof XMLHttpRequest<"u"&&Je(XMLHttpRequest.prototype,o);for(let d of["log","info","debug","warn","error"]){let a=console[d].bind(console);console[d]=(...p)=>{let m=u(p.map(h=>typeof h=="string"?h:Ge(h)).join(" "),1024);if(d==="warn"||d==="error"){e.addBreadcrumb({category:"console",level:d==="warn"?"warning":"error",message:m});let h=p.find(k=>k instanceof Error);x(n,{timestamp:y(),level:d,message:m,stack:u((h??new Error).stack??"",2e3)},100)}else x(n,{timestamp:y(),level:d,message:m},100);a(...p)}}let s=()=>x(r,{timestamp:y(),type:"navigation",url:H(location.href)},50),c=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${R(location.href)}`}),s()};if(s(),window.history){let d=window.history.pushState.bind(window.history);window.history.pushState=(...a)=>{d(...a),c()},window.addEventListener("popstate",c)}}function Ge(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function ge(){let e=0,t=0,n=0,i=0;return r=>(r.hadRecentInput||(t>0&&r.startTime-i<1e3&&r.startTime-n<5e3?t+=r.value:(t=r.value,n=r.startTime),i=r.startTime,t>e&&(e=t)),e)}function Ze(e){if(e.size===0)return;let t=[...e.values()].sort((n,i)=>i-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function Qe(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function M(e,t,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>t(r))).observe({type:e,buffered:!0,...n})}catch{}}function be(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=f=>Math.max(0,Math.round(f-r)),s=document.visibilityState==="hidden",c=location.pathname,d=i?.type,a={},p=ge(),m=new Map,h=!1,k=!1;i&&i.responseStart>0&&(a.ttfb=o(i.responseStart)),s||(M("paint",f=>{f.name==="first-contentful-paint"&&(a.fcp=o(f.startTime))}),M("largest-contentful-paint",f=>{h||(a.lcp=o(f.startTime))}));let L=()=>{h=!0};addEventListener("keydown",L,{once:!0,capture:!0}),addEventListener("pointerdown",L,{once:!0,capture:!0}),M("layout-shift",f=>{a.cls=Math.round(p(f)*1e4)/1e4});let I=f=>{if(!f.interactionId)return;m.set(f.interactionId,Math.max(m.get(f.interactionId)??0,f.duration));let A=Ze(m);A!==void 0&&(a.inp=Math.round(A))};M("event",I,{durationThreshold:40}),M("first-input",I);let g=navigator.connection?.effectiveType,ee=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,U=()=>{if(k||Object.keys(a).length===0||E(t))return;k=!0;let f=JSON.stringify({path:c.slice(0,512),metrics:a,nav:d,connection:g&&/^(slow-2g|2g|3g|4g)$/.test(g)?g:void 0,device:Qe(navigator.userAgent)});try{if(navigator.sendBeacon?.(ee,f))return}catch{}fetch(ee,{method:"POST",body:f,keepalive:!0}).then(A=>$(A,t)).catch(()=>{})},te=()=>{location.pathname!==c&&(U(),c=location.pathname,d="route",a={},p=ge(),m=new Map,h=!0,k=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&U()),addEventListener("pagehide",U),addEventListener("popstate",te);let Te=history.pushState;history.pushState=function(...f){Te.apply(this,f),te()}}var Y={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},et="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:#fff;font:600 14px system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px rgba(56,130,246,.75),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px rgba(56,130,246,.85),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",tt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',ke,he={},nt,w,J=()=>{},_,ye=0;function C(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function xe(e){ke=e}var ve=(e,t)=>new Promise((n,i)=>{let r=document.createElement("script");r.src=e,r.async=!0,r.onload=()=>n(window[t]),r.onerror=i,document.head.appendChild(r)});function B(e,t,n){return he[t]??=(async()=>{if(!n&&b.channel!==b.exact){try{let r=await ve(b.channel+e,t);if(r?.accepts?.({version:v,api:1}))return r}catch{}window[t]=void 0,b.debug&&console.log(`[blipit] fallback ${b.exact}${e}`)}let i=await ve(n??b.exact+e,t);if(!i)throw Error(t);return i})().catch(i=>{throw delete he[t],i})}function rt(e,t){try{let n=e.options._sdk??{name:T,version:v},i=t?.[n.name],r=e.options.debug||/^(localhost$|127\.|\[::1])|\.local$/.test(location.hostname);try{r||=process.env.NODE_ENV==="development"}catch{}if(!r||!i||i.version.localeCompare(n.version,"en",{numeric:!0})<1)return;let o=`blipit_latest_${i.version}`,s=sessionStorage;if(s[o])return;s[o]=1,console.info(`[blipit] ${i.version} is available (you have ${n.version})${i.note?` \u2014 ${i.note}`:""} \u2014 ${b.tag?`load ${b.exact.replace(v,i.version)}blipit.js`:`npm install ${n.name}@latest`}`)}catch{}}function we(){let e=(navigator.language??"en").slice(0,2);return Y[e]?e:"en"}function G(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=we(),n.textContent=Y[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var Se=()=>{};function _e(e){Se=e}function Z(e,t){Se(S(e.endpoint,"/api/v1/feedback"),e.options.key,t,e.sdk)}function D(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),i=r=>{J(r),n.forEach(o=>r?o.setAttribute("aria-busy","true"):o.removeAttribute("aria-busy"))};i(!0),Promise.all([B("blipit-report.js","BlipitReport",t.src),W(e)]).then(([r,o])=>o.enabled!==!1&&r.open(e,{metadata:ke,recording:o.recording===!0,recordingMaxMs:o.recording_max_ms,storageFull:o.storage_full===!0,reportsFull:o.reports_full===!0,theme:o.theme,hide:s=>w&&(w.style.display=s?"none":"")}),()=>Z(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>i(!1))}async function it(e){let t=`blipit_fb_${v}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(S(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,"X-Blipit-Sdk":e.sdk,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return C(e,`settings failed (HTTP ${n.status})`),{};let i=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:i}))}catch{}return i}catch{return C(e,"settings unreachable (offline, ad blocker or CSP connect-src)"),{}}}function W(e){return nt??=it(e)}async function Q(e){let t=e.options.feedbackWidget,n=++ye;if(typeof document>"u")return;if(t===!1)return C(e,"Report a bug button off: feedbackWidget is false");let i=await W(e);if(rt(e,i.latest),n!==ye)return;if(i.enabled===!1)return C(e,"Report a bug button hidden by the project setting");let r={...i,...typeof t=="object"?t:{}},[o,s]=Y[we()],c=r.text||o;w=document.createElement("div"),w.setAttribute("data-blipit-ui","");let d=w.attachShadow({mode:"open"}),a=document.createElement("button");a.type="button";let[p,m]=(/^(bottom|middle)-(left|right)$/.test(r.position??"")?r.position:"bottom-right").split("-");a.style.cssText=`${r.color?`--c:${r.color};`:""}${m}:calc(20px + env(safe-area-inset-${m},0px));${p==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,a.setAttribute("aria-haspopup","dialog"),r.style==="icon"&&(a.className="o",a.title=c);let h=g=>{a.disabled=g,a.setAttribute("aria-label",g?s:c),a.innerHTML=g?"<i></i><span></span>":`${tt}<span></span>`,a.lastChild.textContent=g?s:c};J=h,h(!1),a.addEventListener("click",()=>D(e)),oe(d,et),d.append(a);let k=r.shortcut?.toLowerCase().replace(/\s/g,"");_&&document.removeEventListener("keydown",_),_=void 0,k&&(_=g=>{[g.ctrlKey&&"ctrl",g.shiftKey&&"shift",g.altKey&&"alt",g.metaKey&&"meta",g.key.toLowerCase()].filter(Boolean).join("+")===k&&(g.preventDefault(),D(e))},document.addEventListener("keydown",_));let L=w,I=()=>{w===L&&(document.body.append(L),C(e,`Report a bug button shown at ${p}-${m}`))};document.body?I():document.addEventListener("DOMContentLoaded",I)}function Ee(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},w?.remove(),w=void 0,_&&document.removeEventListener("keydown",_),_=void 0,J=()=>{},Q(e)}function ot(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function Re(e,t,n,i){let r=ot(e);if(!r||typeof document>"u")return;let o=O(),s;return B("blipit-replay.js","BlipitReplay",e.src).then(c=>s=c.start({id:o,mode:r,endpoint:t,key:n,instance:i},e),()=>{}),{id:o,active:()=>s?.active()??!1,error:c=>s?.error(c),report:c=>s?.report?.(c)}}var l,Oe=new Set;function $e(e,t){Oe.has(t)||(Oe.add(t),console[e](t))}var st="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",at="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function ct(e){if(l)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return $e("warn",st);if(t.startsWith("blipit_sk_"))return $e("error",at);if(l=new P({...e,key:t}),e.sdkChannel==="exact"&&(b.channel=b.exact),b.debug=!!e.debug,e.user){let{id:r,name:o,email:s,username:c}=e.user;l.setUser({id:r===void 0?void 0:String(r),email:s,username:c??o})}me(l),e.webVitals!==!1&&typeof window<"u"&&be(l.endpoint,t,e.instance);let n=l,i=r=>r&&(n.replay=Re(r,n.endpoint,t,e.instance));i(e.replay??(typeof window<"u"&&void W(n).then(r=>i(r.replay)))),typeof window<"u"&&Q(l),e.debug&&console.log(`[blipit] ${T}@${v} initialized`)}function dt(e){return l?.captureException(e,!0)}function ut(e,t){return l?.captureMessage(e,t)}function lt(e){return l?.captureSecurity(e)}function pt(e){l?.setUser(e)}function ft(e,t){l?.setTag(e,t)}function mt(e){l?.addBreadcrumb(e)}function gt(e={}){l&&Z(l,{...e,eventId:e.eventId??l.lastEventId})}function F(){l&&D(l)}function bt(e){e.addEventListener("click",t=>{t.preventDefault(),F()})}function ht(e){l&&Ee(l,e)}function yt(){return l?.flush()??Promise.resolve()}b.tag=!0;_e((e,t,n,i)=>B("blipit-feedback.js","BlipitFeedback").then(r=>r.showFeedbackDialog(e,t,n,i),()=>{}));function vt(e={}){let t=G(e.label,F);return t.style.visibility="hidden",B("blipit-button.js","BlipitButton").then(n=>n.paint(t,e)).catch(()=>{}).then(()=>t.style.removeProperty("visibility")),t}return Ae(kt);})();
1
+ "use strict";var Blipit=(()=>{var H=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Ne=Object.prototype.hasOwnProperty;var Pe=(e,t)=>{for(var n in t)H(e,n,{get:t[n],enumerable:!0})},De=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of je(t))!Ne.call(e,o)&&o!==n&&H(e,o,{get:()=>t[o],enumerable:!(r=Ae(t,o))||r.enumerable});return e};var We=e=>De(H({},"__esModule",{value:!0}),e);var Tt={};Pe(Tt,{addBreadcrumb:()=>St,attachReport:()=>Et,captureException:()=>yt,captureMessage:()=>vt,captureSecurity:()=>kt,flush:()=>$t,init:()=>ht,openReport:()=>z,reportButton:()=>Ot,setReportMetadata:()=>Re,setTag:()=>wt,setUser:()=>xt,showFeedback:()=>_t,updateWidget:()=>Rt});var V={platforms:["android","ios","react-native","flutter","web","backend","odoo"],names:{android:"Android",ios:"iOS","react-native":"React Native",flutter:"Flutter",web:"Web",backend:"Backend",odoo:"Odoo"}};var jt=V.platforms,Nt=V.names;var Ue={"blipit-android":"android","maven:com.github.blipit-io:blipit-android":"android","blipit-swift":"ios","swiftpm:blipit-swift":"ios","@blipit/react-native":"react-native","npm:@blipit/react-native":"react-native","blipit-flutter":"flutter","pub:blipit_flutter":"flutter","@blipit/browser":"web","blipit-browser":"web","npm:@blipit/browser":"web","@blipit/nextjs":"web","npm:@blipit/nextjs":"web","@blipit/node":"node","npm:@blipit/node":"node","blipit-python":"backend","pypi:blipit":"backend","blipit-ruby":"backend","gem:blipit":"backend","blipit-php":"backend","composer:blipit/blipit":"backend","blipit-go":"backend","go:github.com/blipit-io/blipit-go":"backend","blipit-java":"backend","maven:io.blipit:blipit":"backend","blipit-dotnet":"backend","nuget:blipit":"backend","@blipit/cli":"backend","blipit-odoo":"odoo",blipit_monitor:"odoo"},Pt=Object.keys(Ue);var oe=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];function T(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0");return t}var X=globalThis.__blipitRefused??=new Set,E=e=>X.has(e);async function L(e,t){if(e.status!==409)return!1;let n=null;try{n=await e.clone().json()}catch{}return n?.reason!=="platform_mismatch"?!1:(X.has(t)||(X.add(t),console.error(`[blipit] ${String(n.error??"This key belongs to a project for another platform.")} Blipit stopped sending with this key until the page reloads.`)),!0)}function y(){return new Date().toISOString()}var Ke=/token|key|password|secret|auth|session|passwd|api/i;function R(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let n=e.slice(0,t),o=e.slice(t+1).split("&").map(i=>{let s=i.indexOf("=");if(s===-1)return i;let c=i.slice(0,s);return Ke.test(c)?`${c}=[redacted]`:i}).join("&");return`${n}?${o}`.slice(0,2048)}var qe=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function ie(e){return e.replace(qe,"$1[redacted]")}function u(e,t){return e.length>t?e.slice(0,t):e}var se=".blipit-mask,[data-blipit-mask]";function Y(e){return e.replace(/#.*/,"").replace(/([?&][^=&]*)=[^&]*/g,"$1=").slice(0,2048)}function x(e,t,n){e.push(t),e.length>n&&e.shift()}function J(e){let t=e.id?`#${e.id}`:"",n=typeof e.className=="string"&&e.className.trim()?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return u(`${e.tagName.toLowerCase()}${t}${n}`,128)}function ae(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}catch{let n=document.createElement("style");n.textContent=t,(e===document?document.head:e).append(n)}}function S(e,t){return`${e.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${t}`}function ce(e,t){let n=e?/^(https?:\/\/[^?#]*\/)blipit(?:\.min)?\.js(?:[?#].*)?$/.exec(e):null;return n?n[1]:`https://blipit.io/sdk/${t}/`}function de(e,t){let n=`/sdk/${t}/`,[r,o]=t.split(".");return e.endsWith(n)?`${e.slice(0,-n.length)}/sdk/${r==="0"?`${r}.${o}`:r}/`:e}function ze(e){let t=e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?/);if(!t||(t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))<.5)return null;let[r,o,i]=[t[1],t[2],t[3]].map(s=>{let c=parseFloat(s)/255;return c<=.03928?c/12.92:((c+.055)/1.055)**2.4});return .2126*r+.7152*o+.0722*i}var He=e=>Math.max(...e)-Math.min(...e)>40||Math.max(...e)<70||Math.min(...e)>245,Ve=["primary","color-primary","primary-color","brand","brand-color","color-brand","bs-primary","o-brand-primary"],Xe=".btn-primary,.button-primary,.btn--primary,.is-primary,[class*=btn-primary],[data-variant=primary],button[type=submit],input[type=submit]";function D(e){try{let t=(e??"").trim(),n=a=>CSS.supports("color",a);if(!t)return null;if(!n(t)){let a=t.match(/#[\da-f]{3,8}|(?:rgb|hsl|oklch|oklab|lab|lch|hwb)a?\([^()]+\)/i)?.[0];if(n(`hsl(${t})`))t=`hsl(${t})`;else if(a&&n(a))t=a;else return null}let r=document.createElement("canvas");r.width=r.height=1;let o=r.getContext("2d");o.fillStyle=t,o.fillRect(0,0,1,1);let[i,s,c,d]=o.getImageData(0,0,1,1).data;return d>200?[i,s,c]:null}catch{return null}}var ue=e=>(ze(`rgb(${e})`)??0)>.45?"#0B1A3A":"#fff";function le(){let e={};try{let t=getComputedStyle(document.documentElement),n=(s,c)=>s&&(c?Math.max(...s)-Math.min(...s)>40:He(s))?s:null,r=null;for(let s of Ve)if(r=D(t.getPropertyValue(`--${s}`)))break;if(!r){for(let s of Array.from(document.querySelectorAll(Xe)).slice(0,12))if(r=n(D(getComputedStyle(s).backgroundColor)))break}let o=document.querySelector("a[href]");r||=n(o&&D(getComputedStyle(o).color),!0),r&&["0,0,238","85,26,139","158,158,255"].includes(r.join())&&(r=null),r||=n(D(document.querySelector('meta[name="theme-color"]')?.content),!0),r&&(e.rgb=r);let i=getComputedStyle(document.body).fontFamily;i&&!/^"?(times( new roman)?|serif|-webkit-standard)"?$/i.test(i.trim())&&(e.font=i.replace(/[;{}]/g,""))}catch{}return e}var W=class{constructor(t,n,r,o,i){this.endpoint=t;this.key=n;this.sdk=r;this.debug=o;this.instance=i;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;sdk;debug;instance;queue=[];timer;sending=!1;enqueue(t){this.queue.push(t),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let t=this.queue[0];if(!await this.send(t))break;this.queue.shift()}}finally{this.sending=!1}}}async send(t,n=0){if(E(this.key))return!0;try{let r=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(t),keepalive:!0});return r.status===429||r.status>=500?this.retry(t,n):await L(r,this.key)?(this.queue.length=0,!1):(this.debug&&r.status>=400&&console.warn("[blipit] event rejected",r.status,await r.text()),!0)}catch{return this.retry(t,n)}}async retry(t,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",t.event_id),!0):(await new Promise(r=>setTimeout(r,1e3*2**n)),this.send(t,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon||E(this.key)))for(;this.queue.length>0;){let t=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,r=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(r,JSON.stringify(t))}}};var pe={ok:0,errored:1,crashed:2},F=class{constructor(t,n,r,o,i){this.url=t;this.key=n;this.sdk=r;this.release=o;this.environment=i;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;sdk;release;environment;sid="";started="";status="ok";errors=0;did;setUser(t){this.did=t}markError(t){if(!this.sid)return;this.errors+=1;let n=t?"crashed":"errored";pe[n]<=pe[this.status]||(this.status=n,this.send(!1))}start(){this.sid=T(),this.started=y(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(t){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&t?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),r=`${this.url}?key=${encodeURIComponent(this.key)}`;if(!E(this.key))try{if(t&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(r,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk},body:n,keepalive:!0}).then(o=>L(o,this.key)).catch(()=>{})}catch{return}}};var Ye=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,Je=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,fe=/^(chrome|moz|safari-web)-extension:/;function Ge(){if(typeof location<"u"&&location.origin)return location.origin}function Ze(e){if(fe.test(e)||e==="<anonymous>"||e==="[native code]")return!1;let t=Ge();return!!(!t||e.startsWith(t)||!/^[a-z]+:/i.test(e))}function me(e){if(!e)return[];let t=[];for(let n of e.split(`
2
+ `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let r=Ye.exec(n)??Je.exec(n);if(!r)continue;let[,o,i,s,c]=r;if(!i)continue;let d={filename:u(i,1024),in_app:Ze(i)};o&&(d.function=u(o,512)),s&&(d.lineno=Number(s)),c&&(d.colno=Number(c)),t.push(d)}return t.reverse(),t.slice(-128)}function ge(e){return e.length===0?!1:e.every(t=>fe.test(t.filename))}var M="@blipit/browser",v="0.3.22",be=ce(typeof document<"u"?document.currentScript?.src:void 0,v),b={exact:be,channel:de(be,v),debug:!1,tag:!1},Qe="https://in.blipit.io/api/v1/events",et=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],tt={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},nt={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function rt(e){if(!oe.includes(e?.kind))return;let t=u(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=u(String(e.actorId),128)),e.ip&&(n.ip=u(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=u(String(e.userAgent),512)),e.database&&(n.database=u(String(e.database),64)),e.outcome&&(n.outcome=u(String(e.outcome),64)),e.target&&(n.target=u(String(e.target),256)),n}var U=class{constructor(t){this.options=t;this.endpoint=t.endpoint??Qe;let n=t._sdk??{name:M,version:v};this.sdk=`${n.name}/${n.version}`,this.transport=new W(this.endpoint,t.key,this.sdk,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new F(S(this.endpoint,"/api/v1/sessions"),t.key,this.sdk,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...et,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;sdk;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[u(t,64)]=u(n,256)}addBreadcrumb(t){let n={timestamp:y(),...t};n.message&&(n.message=ie(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:R(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let r=t instanceof Error?t:new Error(String(t)),o={type:r.name||"Error",value:u(r.message||String(r),4096),handled:n},i=me(r.stack);return i.length>0&&(o.stacktrace={frames:i}),this.processAndSend({exception:o,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:u(t,8192),level:n})}captureSecurity(t){let n=rt(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${tt[n.kind]} for ${n.actor}`,level:nt[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let r=t.exception?.value??t.message??"";if(n){for(let c of this.ignoreErrors)if(typeof c=="string"?r.includes(c):c.test(r))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&ge(t.exception.stacktrace.frames))return;let s=`${t.exception?.type??""}|${r}`;if(t.exception?.handled===!1){if(this.seen.has(s)&&this.seen.size<100)return;this.seen.add(s),setTimeout(()=>this.seen.delete(s),5e3)}}let o={event_id:T(),timestamp:y(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:R(location.href)}:void 0,contexts:this.collectContexts(),sdk:this.options._sdk??{name:M,version:v},...t};for(let s of Object.keys(o))o[s]===void 0&&delete o[s];let i=this.replay?.active()&&(o.level==="error"||o.level==="fatal")?this.replay:void 0;if(i&&(o.tags={...o.tags,replay_id:i.id}),this.options.beforeSend){let s=this.options.beforeSend(o);if(!s)return;o=s}return this.transport.enqueue(o),this.lastEventId=o.event_id,(o.level==="error"||o.level==="fatal")&&x(this.errorIds,o.event_id,20),o.exception&&this.session?.markError(o.exception.handled===!1),i?.error(o.event_id),o.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",r=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;r&&(t.browser={name:r[1],version:r[2]});let o=/\(([^)]+)\)/.exec(n);return o&&o[1]&&(t.os={name:u(o[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};function G(e){return typeof e=="string"?e.length:e?.size}function he(e){return e&&Number(e)||void 0}function ot(e,t){return async(n,r)=>{let o=typeof n=="string"?n:n instanceof URL?n.href:n.url,i=(r?.method??n.method??"GET").toUpperCase(),s=Date.now();try{let c=await e(n,r);return t(i,o,c.status,s,G(r?.body),he(c.headers.get("content-length"))),c}catch(c){throw t(i,o,0,s,G(r?.body)),c}}}function it(e,t){let n=e.open,r=e.send;e.open=function(o,i){return this._blipit=[String(o).toUpperCase(),String(i)],n.apply(this,arguments)},e.send=function(o){let i=this._blipit;if(i){let s=Date.now();this.addEventListener("loadend",()=>t(i[0],i[1],this.status,s,G(o),he(this.getResponseHeader("content-length"))))}return r.apply(this,arguments)}}function ye(e){if(typeof window>"u")return;let t=S(e.endpoint,""),{console:n,network:r,actions:o}=e.logs;window.addEventListener("error",d=>{e.captureException(d.error??d.message,!1)}),window.addEventListener("unhandledrejection",d=>{e.captureException(d.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",d=>{let a=d.target;if(!(a instanceof Element)||a.closest("[data-blipit-ui]"))return;let f=J(a);e.addBreadcrumb({category:"ui.click",message:`Clicked ${f}`});let g=a.closest(se)?"***":u((a.textContent??"").trim().replace(/\s+/g," "),80);x(o,{timestamp:y(),type:"click",selector:f,text:g},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",d=>{let a=d.target;a instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName)&&x(o,{timestamp:y(),type:"focus",selector:J(a)},50)},{capture:!0,passive:!0}));let i=(d,a,f,g,h,k)=>{t&&a.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${d} ${R(a)} \u2192 ${f||"network error"}`,level:f>=400||!f?"error":"info",data:{url:R(a),method:d,status_code:f||void 0}}),x(r,{timestamp:y(),method:d,url:Y(a),status:f,duration:Date.now()-g,request_size:h,response_size:k},50))};typeof window.fetch=="function"&&(window.fetch=ot(window.fetch.bind(window),i)),typeof XMLHttpRequest<"u"&&it(XMLHttpRequest.prototype,i);for(let d of["log","info","debug","warn","error"]){let a=console[d].bind(console);console[d]=(...f)=>{let g=u(f.map(h=>typeof h=="string"?h:st(h)).join(" "),1024);if(d==="warn"||d==="error"){e.addBreadcrumb({category:"console",level:d==="warn"?"warning":"error",message:g});let h=f.find(k=>k instanceof Error);x(n,{timestamp:y(),level:d,message:g,stack:u((h??new Error).stack??"",2e3)},100)}else x(n,{timestamp:y(),level:d,message:g},100);a(...f)}}let s=()=>x(o,{timestamp:y(),type:"navigation",url:Y(location.href)},50),c=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${R(location.href)}`}),s()};if(s(),window.history){let d=window.history.pushState.bind(window.history);window.history.pushState=(...a)=>{d(...a),c()},window.addEventListener("popstate",c)}}function st(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function ve(){let e=0,t=0,n=0,r=0;return o=>(o.hadRecentInput||(t>0&&o.startTime-r<1e3&&o.startTime-n<5e3?t+=o.value:(t=o.value,n=o.startTime),r=o.startTime,t>e&&(e=t)),e)}function at(e){if(e.size===0)return;let t=[...e.values()].sort((n,r)=>r-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function ct(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function A(e,t,n){try{new PerformanceObserver(r=>r.getEntries().forEach(o=>t(o))).observe({type:e,buffered:!0,...n})}catch{}}function ke(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let r=performance.getEntriesByType("navigation")[0],o=r?.activationStart??0,i=m=>Math.max(0,Math.round(m-o)),s=document.visibilityState==="hidden",c=location.pathname,d=r?.type,a={},f=ve(),g=new Map,h=!1,k=!1;r&&r.responseStart>0&&(a.ttfb=i(r.responseStart)),s||(A("paint",m=>{m.name==="first-contentful-paint"&&(a.fcp=i(m.startTime))}),A("largest-contentful-paint",m=>{h||(a.lcp=i(m.startTime))}));let C=()=>{h=!0};addEventListener("keydown",C,{once:!0,capture:!0}),addEventListener("pointerdown",C,{once:!0,capture:!0}),A("layout-shift",m=>{a.cls=Math.round(f(m)*1e4)/1e4});let I=m=>{if(!m.interactionId)return;g.set(m.interactionId,Math.max(g.get(m.interactionId)??0,m.duration));let P=at(g);P!==void 0&&(a.inp=Math.round(P))};A("event",I,{durationThreshold:40}),A("first-input",I);let $=navigator.connection?.effectiveType,p=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,O=()=>{if(k||Object.keys(a).length===0||E(t))return;k=!0;let m=JSON.stringify({path:c.slice(0,512),metrics:a,nav:d,connection:$&&/^(slow-2g|2g|3g|4g)$/.test($)?$:void 0,device:ct(navigator.userAgent)});try{if(navigator.sendBeacon?.(p,m))return}catch{}fetch(p,{method:"POST",body:m,keepalive:!0}).then(P=>L(P,t)).catch(()=>{})},re=()=>{location.pathname!==c&&(O(),c=location.pathname,d="route",a={},f=ve(),g=new Map,h=!0,k=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&O()),addEventListener("pagehide",O),addEventListener("popstate",re);let Ie=history.pushState;history.pushState=function(...m){Ie.apply(this,m),re()}}var Z={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},dt="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:var(--o,#fff);font:600 14px var(--f,system-ui),system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px var(--g,rgba(56,130,246,.75)),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px var(--g,rgba(56,130,246,.85)),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",ut='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',_e,xe={},lt,w,Q=()=>{},_,we=0,j=()=>{};function Ee(e,t){let n=(e.match??t.match)===!1?{}:le(),r=e.color?void 0:n.rgb;return{color:e.color??(r?`rgb(${r})`:t.color),rgb:r,font:e.font??n.font}}function N(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function Re(e){_e=e}var Se=(e,t)=>new Promise((n,r)=>{let o=document.createElement("script");o.src=e,o.async=!0,o.onload=()=>n(window[t]),o.onerror=r,document.head.appendChild(o)});function B(e,t,n){return xe[t]??=(async()=>{if(!n&&b.channel!==b.exact){try{let o=await Se(b.channel+e,t);if(o?.accepts?.({version:v,api:1}))return o}catch{}window[t]=void 0,b.debug&&console.log(`[blipit] fallback ${b.exact}${e}`)}let r=await Se(n??b.exact+e,t);if(!r)throw Error(t);return r})().catch(r=>{throw delete xe[t],r})}function pt(e,t){try{let n=e.options._sdk??{name:M,version:v},r=t?.[n.name],o=e.options.debug||/^(localhost$|127\.|\[::1])|\.local$/.test(location.hostname);try{o||=process.env.NODE_ENV==="development"}catch{}if(!o||!r||r.version.localeCompare(n.version,"en",{numeric:!0})<1)return;let i=`blipit_latest_${r.version}`,s=sessionStorage;if(s[i])return;s[i]=1,console.info(`[blipit] ${r.version} is available (you have ${n.version})${r.note?` \u2014 ${r.note}`:""} \u2014 ${b.tag?`load ${b.exact.replace(v,r.version)}blipit.js`:`npm install ${n.name}@latest`}`)}catch{}}function $e(){let e=(navigator.language??"en").slice(0,2);return Z[e]?e:"en"}function ee(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=$e(),n.textContent=Z[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var Oe=()=>{};function Te(e){Oe=e}function te(e,t){Oe(S(e.endpoint,"/api/v1/feedback"),e.options.key,t,e.sdk)}function K(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),r=o=>{Q(o),n.forEach(i=>o?i.setAttribute("aria-busy","true"):i.removeAttribute("aria-busy"))};r(!0),j(),Promise.all([B("blipit-report.js","BlipitReport",t.src),q(e)]).then(([o,i])=>i.enabled!==!1&&o.open(e,{metadata:_e,recording:i.recording===!0,recordingMaxMs:i.recording_max_ms,storageFull:i.storage_full===!0,reportsFull:i.reports_full===!0,theme:i.theme,look:Ee(t,i),hide:s=>w&&(w.style.display=s?"none":"")}),()=>te(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>r(!1))}async function ft(e){let t=`blipit_fb_${v}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(S(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,"X-Blipit-Sdk":e.sdk,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return N(e,`settings failed (HTTP ${n.status})`),{};let r=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:r}))}catch{}return r}catch{return N(e,"settings unreachable (offline, ad blocker or CSP connect-src)"),{}}}function q(e){return lt??=ft(e)}async function ne(e){let t=e.options.feedbackWidget,n=++we;if(typeof document>"u")return;if(t===!1)return N(e,"Report a bug button off: feedbackWidget is false");let r=await q(e);if(pt(e,r.latest),n!==we)return;if(r.enabled===!1)return N(e,"Report a bug button hidden by the project setting");let o={...r,...typeof t=="object"?t:{}},[i,s]=Z[$e()],c=o.text||i;w=document.createElement("div"),w.setAttribute("data-blipit-ui","");let d=w.attachShadow({mode:"open"}),a=document.createElement("button");a.type="button";let[f,g]=(/^(bottom|middle)-(left|right)$/.test(o.position??"")?o.position:"bottom-right").split("-");a.style.cssText=`${o.color?`--c:${o.color};`:""}${g}:calc(20px + env(safe-area-inset-${g},0px));${f==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,a.setAttribute("aria-haspopup","dialog"),o.style==="icon"&&(a.className="o",a.title=c);let h=typeof t=="object"?t:{};j=()=>{let{rgb:p,font:O}=Ee(h,r);p&&(a.style.cssText+=`;--c:rgb(${p});--g:rgba(${p},.6);--o:${ue(p)}`),O&&(a.style.cssText+=`;--f:${O.replace(/[;{}]/g,"")}`)};let k=p=>{a.disabled=p,a.setAttribute("aria-label",p?s:c),a.innerHTML=p?"<i></i><span></span>":`${ut}<span></span>`,a.lastChild.textContent=p?s:c};Q=k,k(!1),a.addEventListener("click",()=>K(e)),ae(d,dt),d.append(a);let C=o.shortcut?.toLowerCase().replace(/\s/g,"");_&&document.removeEventListener("keydown",_),_=void 0,C&&(_=p=>{[p.ctrlKey&&"ctrl",p.shiftKey&&"shift",p.altKey&&"alt",p.metaKey&&"meta",p.key.toLowerCase()].filter(Boolean).join("+")===C&&(p.preventDefault(),K(e))},document.addEventListener("keydown",_));let I=w,$=()=>{w===I&&(document.body.append(I),j(),document.readyState!=="complete"&&globalThis.addEventListener?.("load",()=>j(),{once:!0}),N(e,`Report a bug button shown at ${f}-${g}`))};document.body?$():document.addEventListener("DOMContentLoaded",$)}function Le(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},w?.remove(),w=void 0,_&&document.removeEventListener("keydown",_),_=void 0,Q=j=()=>{},ne(e)}function mt(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function Me(e,t,n,r){let o=mt(e);if(!o||typeof document>"u")return;let i=T(),s;return B("blipit-replay.js","BlipitReplay",e.src).then(c=>s=c.start({id:i,mode:o,endpoint:t,key:n,instance:r},e),()=>{}),{id:i,active:()=>s?.active()??!1,error:c=>s?.error(c),report:c=>s?.report?.(c)}}var l,Be=new Set;function Ce(e,t){Be.has(t)||(Be.add(t),console[e](t))}var gt="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",bt="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function ht(e){if(l)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return Ce("warn",gt);if(t.startsWith("blipit_sk_"))return Ce("error",bt);if(l=new U({...e,key:t}),e.sdkChannel==="exact"&&(b.channel=b.exact),b.debug=!!e.debug,e.user){let{id:o,name:i,email:s,username:c}=e.user;l.setUser({id:o===void 0?void 0:String(o),email:s,username:c??i})}ye(l),e.webVitals!==!1&&typeof window<"u"&&ke(l.endpoint,t,e.instance);let n=l,r=o=>o&&(n.replay=Me(o,n.endpoint,t,e.instance));r(e.replay??(typeof window<"u"&&void q(n).then(o=>r(o.replay)))),typeof window<"u"&&ne(l),e.debug&&console.log(`[blipit] ${M}@${v} initialized`)}function yt(e){return l?.captureException(e,!0)}function vt(e,t){return l?.captureMessage(e,t)}function kt(e){return l?.captureSecurity(e)}function xt(e){l?.setUser(e)}function wt(e,t){l?.setTag(e,t)}function St(e){l?.addBreadcrumb(e)}function _t(e={}){l&&te(l,{...e,eventId:e.eventId??l.lastEventId})}function z(){l&&K(l)}function Et(e){e.addEventListener("click",t=>{t.preventDefault(),z()})}function Rt(e){l&&Le(l,e)}function $t(){return l?.flush()??Promise.resolve()}b.tag=!0;Te((e,t,n,r)=>B("blipit-feedback.js","BlipitFeedback").then(o=>o.showFeedbackDialog(e,t,n,r),()=>{}));function Ot(e={}){let t=ee(e.label,z);return t.style.visibility="hidden",B("blipit-button.js","BlipitButton").then(n=>n.paint(t,e)).catch(()=>{}).then(()=>t.style.removeProperty("visibility")),t}return We(Tt);})();
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- function F(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0");return t}var V=globalThis.__blipitRefused??=new Set,B=e=>V.has(e);async function T(e,t){if(e.status!==409)return!1;let n=null;try{n=await e.clone().json()}catch{}return n?.reason!=="platform_mismatch"?!1:(V.has(t)||(V.add(t),console.error(`[blipit] ${String(n.error??"This key belongs to a project for another platform.")} Blipit stopped sending with this key until the page reloads.`)),!0)}function k(){return new Date().toISOString()}var Pe=/token|key|password|secret|auth|session|passwd|api/i;function A(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let n=e.slice(0,t),r=e.slice(t+1).split("&").map(o=>{let a=o.indexOf("=");if(a===-1)return o;let d=o.slice(0,a);return Pe.test(d)?`${d}=[redacted]`:o}).join("&");return`${n}?${r}`.slice(0,2048)}var We=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function oe(e){return e.replace(We,"$1[redacted]")}function m(e,t){return e.length>t?e.slice(0,t):e}var se=".blipit-mask,[data-blipit-mask]";function X(e){return e.replace(/#.*/,"").replace(/([?&][^=&]*)=[^&]*/g,"$1=").slice(0,2048)}function R(e,t,n){e.push(t),e.length>n&&e.shift()}function Y(e){let t=e.id?`#${e.id}`:"",n=typeof e.className=="string"&&e.className.trim()?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return m(`${e.tagName.toLowerCase()}${t}${n}`,128)}function D(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}catch{let n=document.createElement("style");n.textContent=t,(e===document?document.head:e).append(n)}}function L(e,t){return`${e.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${t}`}function ae(e,t){let n=e?/^(https?:\/\/[^?#]*\/)blipit(?:\.min)?\.js(?:[?#].*)?$/.exec(e):null;return n?n[1]:`https://blipit.io/sdk/${t}/`}function de(e,t){let n=`/sdk/${t}/`,[i,r]=t.split(".");return e.endsWith(n)?`${e.slice(0,-n.length)}/sdk/${i==="0"?`${i}.${r}`:i}/`:e}function De(e){let t=e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?/);if(!t||(t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))<.5)return null;let[i,r,o]=[t[1],t[2],t[3]].map(a=>{let d=parseFloat(a)/255;return d<=.03928?d/12.92:((d+.055)/1.055)**2.4});return .2126*i+.7152*r+.0722*o}function ce(e){if(e==="light"||e==="dark")return e;if(typeof document<"u"){for(let n of[document.body,document.documentElement]){if(!n)continue;let i=De(getComputedStyle(n).backgroundColor);if(i!==null)return i<.4?"dark":"light"}let t=getComputedStyle(document.documentElement).colorScheme;if(t==="dark")return"dark";if(t&&t!=="normal"&&!t.includes("dark"))return"light"}return typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Ke=5e3,le={en:["Report {ref} sent.","We will email you updates."],ar:["\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A {ref}.","\u0633\u0646\u0631\u0627\u0633\u0644\u0643 \u0628\u0627\u0644\u062A\u062D\u062F\u064A\u062B\u0627\u062A."],de:["Meldung {ref} gesendet.","Wir informieren Sie per E-Mail."],es:["Reporte {ref} enviado.","Te enviaremos novedades por correo."],fr:["Signalement {ref} envoy\xE9.","Nous vous tiendrons au courant par e-mail."],it:["Segnalazione {ref} inviata.","Ti invieremo aggiornamenti via email."],ja:["\u5831\u544A {ref} \u3092\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002","\u9032\u6357\u306F\u30E1\u30FC\u30EB\u3067\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002"],nl:["Melding {ref} verstuurd.","We mailen je updates."],pt:["Relato {ref} enviado.","Vamos enviar novidades por e-mail."],tr:["{ref} numaral\u0131 bildirim g\xF6nderildi.","Geli\u015Fmeleri e-postayla bildirece\u011Fiz."],zh:["\u62A5\u544A {ref} \u5DF2\u53D1\u9001\u3002","\u6211\u4EEC\u4F1A\u901A\u8FC7\u90AE\u4EF6\u544A\u77E5\u8FDB\u5C55\u3002"]};function Ue(e,t,n){if(typeof e!="string"||!/^BR-\d{1,12}$/.test(e))return null;let[i,r]=le[n.toLowerCase().split(/[-_]/)[0]]??le.en;return`${i.replace("{ref}",e)}${t===!0?` ${r}`:""}`}function w(e,t,n){let i=document.createElement(e);return i.style.cssText=t,n!==void 0&&(i.textContent=n),i}var G="display:block;width:100%;box-sizing:border-box;margin:4px 0 12px;padding:8px 10px;font:inherit;border:1px solid #c5ccd6;border-radius:6px;background:#fff;color:#111",ue="font:inherit;padding:8px 14px;border-radius:6px;cursor:pointer;border:1px solid #c5ccd6;background:#fff;color:#111",J=!1;function pe(e,t,n,i){if(J||typeof document>"u"||!document.body)return;J=!0;let r=w("dialog","max-width:420px;width:calc(100% - 32px);padding:20px;border:1px solid #c5ccd6;border-radius:10px;font:14px/1.45 system-ui,sans-serif;color:#111;background:#fff");r.setAttribute("aria-labelledby","blipit-fb-title");let o=w("form","margin:0"),a=w("h2","margin:0 0 12px;font-size:17px",n.title??"Tell us what happened");a.id="blipit-fb-title";let d=(I,_,E)=>{let M=w("label","display:block;font-weight:600",I);M.htmlFor=E,_.id=E,o.append(M,_)},c=w("input",G);c.type="text",c.maxLength=128,c.autocomplete="name",c.value=n.name??"";let s=w("input",G);s.type="email",s.maxLength=254,s.autocomplete="email",s.value=n.email??"";let u=w("textarea",`${G};min-height:110px;resize:vertical`);u.required=!0,u.maxLength=Ke;let p=w("p","margin:0 0 12px;min-height:1.2em;font-size:13px");p.setAttribute("role","status"),p.setAttribute("aria-live","polite");let h=w("div","display:flex;gap:8px;justify-content:flex-end"),y=w("button",ue,"Cancel");y.type="button";let x=w("button",`${ue};background:#111;color:#fff;border-color:#111`,"Send");x.type="submit",o.append(a),d("Name (optional)",c,"blipit-fb-name"),d("Email (optional)",s,"blipit-fb-email"),d("What went wrong?",u,"blipit-fb-message"),h.append(y,x),o.append(p,h),r.append(o),document.body.append(r);let O=()=>{J=!1,r.remove()},b=()=>typeof r.close=="function"&&r.open?r.close():O();y.addEventListener("click",b),r.addEventListener("close",O),o.addEventListener("submit",async I=>{I.preventDefault();let _=u.value.trim();if(!_){p.textContent="Please describe what happened.",u.focus();return}x.disabled=!0,y.disabled=!0,x.setAttribute("aria-busy","true"),x.textContent="Sending\u2026",p.textContent="";try{let E=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":t,"X-Blipit-Sdk":i},body:JSON.stringify({name:c.value.trim()||void 0,email:s.value.trim()||void 0,message:_,event_id:n.eventId,url:typeof location<"u"?location.href.split(/[?#]/)[0]:void 0})});if(await T(E,t))throw new Error("platform_mismatch");if(!E.ok)throw new Error(String(E.status));let M=await E.json().catch(()=>({})),f=Ue(M.ref,M.emails,typeof navigator>"u"?"en":navigator.language??"en");p.textContent=f??"Thanks, your message was sent.",x.textContent="Sent",setTimeout(b,f?4e3:1200)}catch{p.textContent="That did not send. Please try again.",x.disabled=!1,y.disabled=!1,x.removeAttribute("aria-busy"),x.textContent="Send"}}),typeof r.showModal=="function"?r.showModal():r.setAttribute("open",""),u.focus()}var Z={platforms:["android","ios","react-native","flutter","web","backend","odoo"],names:{android:"Android",ios:"iOS","react-native":"React Native",flutter:"Flutter",web:"Web",backend:"Backend",odoo:"Odoo"}};var Et=Z.platforms,_t=Z.names;var qe={"blipit-android":"android","maven:com.github.blipit-io:blipit-android":"android","blipit-swift":"ios","swiftpm:blipit-swift":"ios","@blipit/react-native":"react-native","npm:@blipit/react-native":"react-native","blipit-flutter":"flutter","pub:blipit_flutter":"flutter","@blipit/browser":"web","blipit-browser":"web","npm:@blipit/browser":"web","@blipit/nextjs":"web","npm:@blipit/nextjs":"web","@blipit/node":"node","npm:@blipit/node":"node","blipit-python":"backend","pypi:blipit":"backend","blipit-ruby":"backend","gem:blipit":"backend","blipit-php":"backend","composer:blipit/blipit":"backend","blipit-go":"backend","go:github.com/blipit-io/blipit-go":"backend","blipit-java":"backend","maven:io.blipit:blipit":"backend","blipit-dotnet":"backend","nuget:blipit":"backend","@blipit/cli":"backend","blipit-odoo":"odoo",blipit_monitor:"odoo"},Rt=Object.keys(qe);var fe=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var K=class{constructor(t,n,i,r,o){this.endpoint=t;this.key=n;this.sdk=i;this.debug=r;this.instance=o;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;sdk;debug;instance;queue=[];timer;sending=!1;enqueue(t){this.queue.push(t),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let t=this.queue[0];if(!await this.send(t))break;this.queue.shift()}}finally{this.sending=!1}}}async send(t,n=0){if(B(this.key))return!0;try{let i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(t),keepalive:!0});return i.status===429||i.status>=500?this.retry(t,n):await T(i,this.key)?(this.queue.length=0,!1):(this.debug&&i.status>=400&&console.warn("[blipit] event rejected",i.status,await i.text()),!0)}catch{return this.retry(t,n)}}async retry(t,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",t.event_id),!0):(await new Promise(i=>setTimeout(i,1e3*2**n)),this.send(t,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon||B(this.key)))for(;this.queue.length>0;){let t=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,i=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(i,JSON.stringify(t))}}};var me={ok:0,errored:1,crashed:2},U=class{constructor(t,n,i,r,o){this.url=t;this.key=n;this.sdk=i;this.release=r;this.environment=o;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;sdk;release;environment;sid="";started="";status="ok";errors=0;did;setUser(t){this.did=t}markError(t){if(!this.sid)return;this.errors+=1;let n=t?"crashed":"errored";me[n]<=me[this.status]||(this.status=n,this.send(!1))}start(){this.sid=F(),this.started=k(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(t){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&t?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),i=`${this.url}?key=${encodeURIComponent(this.key)}`;if(!B(this.key))try{if(t&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(i,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk},body:n,keepalive:!0}).then(r=>T(r,this.key)).catch(()=>{})}catch{return}}};var He=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,Ve=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,ge=/^(chrome|moz|safari-web)-extension:/;function Xe(){if(typeof location<"u"&&location.origin)return location.origin}function Ye(e){if(ge.test(e)||e==="<anonymous>"||e==="[native code]")return!1;let t=Xe();return!!(!t||e.startsWith(t)||!/^[a-z]+:/i.test(e))}function be(e){if(!e)return[];let t=[];for(let n of e.split(`
2
- `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=He.exec(n)??Ve.exec(n);if(!i)continue;let[,r,o,a,d]=i;if(!o)continue;let c={filename:m(o,1024),in_app:Ye(o)};r&&(c.function=m(r,512)),a&&(c.lineno=Number(a)),d&&(c.colno=Number(d)),t.push(c)}return t.reverse(),t.slice(-128)}function he(e){return e.length===0?!1:e.every(t=>ge.test(t.filename))}var j="@blipit/browser",S="0.3.21",ye=ae(typeof document<"u"?document.currentScript?.src:void 0,S),v={exact:ye,channel:de(ye,S),debug:!1,tag:!1},Ge="https://in.blipit.io/api/v1/events",Je=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],Ze={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},Qe={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function et(e){if(!fe.includes(e?.kind))return;let t=m(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=m(String(e.actorId),128)),e.ip&&(n.ip=m(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=m(String(e.userAgent),512)),e.database&&(n.database=m(String(e.database),64)),e.outcome&&(n.outcome=m(String(e.outcome),64)),e.target&&(n.target=m(String(e.target),256)),n}var z=class{constructor(t){this.options=t;this.endpoint=t.endpoint??Ge;let n=t._sdk??{name:j,version:S};this.sdk=`${n.name}/${n.version}`,this.transport=new K(this.endpoint,t.key,this.sdk,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new U(L(this.endpoint,"/api/v1/sessions"),t.key,this.sdk,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...Je,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;sdk;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[m(t,64)]=m(n,256)}addBreadcrumb(t){let n={timestamp:k(),...t};n.message&&(n.message=oe(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:A(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let i=t instanceof Error?t:new Error(String(t)),r={type:i.name||"Error",value:m(i.message||String(i),4096),handled:n},o=be(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:m(t,8192),level:n})}captureSecurity(t){let n=et(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${Ze[n.kind]} for ${n.actor}`,level:Qe[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=t.exception?.value??t.message??"";if(n){for(let d of this.ignoreErrors)if(typeof d=="string"?i.includes(d):d.test(i))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&he(t.exception.stacktrace.frames))return;let a=`${t.exception?.type??""}|${i}`;if(t.exception?.handled===!1){if(this.seen.has(a)&&this.seen.size<100)return;this.seen.add(a),setTimeout(()=>this.seen.delete(a),5e3)}}let r={event_id:F(),timestamp:k(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:A(location.href)}:void 0,contexts:this.collectContexts(),sdk:this.options._sdk??{name:j,version:S},...t};for(let a of Object.keys(r))r[a]===void 0&&delete r[a];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let a=this.options.beforeSend(r);if(!a)return;r=a}return this.transport.enqueue(r),this.lastEventId=r.event_id,(r.level==="error"||r.level==="fatal")&&R(this.errorIds,r.event_id,20),r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(t.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(t.os={name:m(r[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};var Q={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},tt="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:#fff;font:600 14px system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px rgba(56,130,246,.75),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px rgba(56,130,246,.85),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",nt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',we,xe={},rt,$,ee=()=>{},C,ve=0;function N(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function it(e){we=e}var ke=(e,t)=>new Promise((n,i)=>{let r=document.createElement("script");r.src=e,r.async=!0,r.onload=()=>n(window[t]),r.onerror=i,document.head.appendChild(r)});function te(e,t,n){return xe[t]??=(async()=>{if(!n&&v.channel!==v.exact){try{let r=await ke(v.channel+e,t);if(r?.accepts?.({version:S,api:1}))return r}catch{}window[t]=void 0,v.debug&&console.log(`[blipit] fallback ${v.exact}${e}`)}let i=await ke(n??v.exact+e,t);if(!i)throw Error(t);return i})().catch(i=>{throw delete xe[t],i})}function ot(e,t){try{let n=e.options._sdk??{name:j,version:S},i=t?.[n.name],r=e.options.debug||/^(localhost$|127\.|\[::1])|\.local$/.test(location.hostname);try{r||=process.env.NODE_ENV==="development"}catch{}if(!r||!i||i.version.localeCompare(n.version,"en",{numeric:!0})<1)return;let o=`blipit_latest_${i.version}`,a=sessionStorage;if(a[o])return;a[o]=1,console.info(`[blipit] ${i.version} is available (you have ${n.version})${i.note?` \u2014 ${i.note}`:""} \u2014 ${v.tag?`load ${v.exact.replace(S,i.version)}blipit.js`:`npm install ${n.name}@latest`}`)}catch{}}function Se(){let e=(navigator.language??"en").slice(0,2);return Q[e]?e:"en"}function Ee(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=Se(),n.textContent=Q[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var _e=()=>{};function Re(e){_e=e}function ne(e,t){_e(L(e.endpoint,"/api/v1/feedback"),e.options.key,t,e.sdk)}function q(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),i=r=>{ee(r),n.forEach(o=>r?o.setAttribute("aria-busy","true"):o.removeAttribute("aria-busy"))};i(!0),Promise.all([te("blipit-report.js","BlipitReport",t.src),H(e)]).then(([r,o])=>o.enabled!==!1&&r.open(e,{metadata:we,recording:o.recording===!0,recordingMaxMs:o.recording_max_ms,storageFull:o.storage_full===!0,reportsFull:o.reports_full===!0,theme:o.theme,hide:a=>$&&($.style.display=a?"none":"")}),()=>ne(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>i(!1))}async function st(e){let t=`blipit_fb_${S}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(L(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,"X-Blipit-Sdk":e.sdk,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return N(e,`settings failed (HTTP ${n.status})`),{};let i=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:i}))}catch{}return i}catch{return N(e,"settings unreachable (offline, ad blocker or CSP connect-src)"),{}}}function H(e){return rt??=st(e)}async function re(e){let t=e.options.feedbackWidget,n=++ve;if(typeof document>"u")return;if(t===!1)return N(e,"Report a bug button off: feedbackWidget is false");let i=await H(e);if(ot(e,i.latest),n!==ve)return;if(i.enabled===!1)return N(e,"Report a bug button hidden by the project setting");let r={...i,...typeof t=="object"?t:{}},[o,a]=Q[Se()],d=r.text||o;$=document.createElement("div"),$.setAttribute("data-blipit-ui","");let c=$.attachShadow({mode:"open"}),s=document.createElement("button");s.type="button";let[u,p]=(/^(bottom|middle)-(left|right)$/.test(r.position??"")?r.position:"bottom-right").split("-");s.style.cssText=`${r.color?`--c:${r.color};`:""}${p}:calc(20px + env(safe-area-inset-${p},0px));${u==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,s.setAttribute("aria-haspopup","dialog"),r.style==="icon"&&(s.className="o",s.title=d);let h=b=>{s.disabled=b,s.setAttribute("aria-label",b?a:d),s.innerHTML=b?"<i></i><span></span>":`${nt}<span></span>`,s.lastChild.textContent=b?a:d};ee=h,h(!1),s.addEventListener("click",()=>q(e)),D(c,tt),c.append(s);let y=r.shortcut?.toLowerCase().replace(/\s/g,"");C&&document.removeEventListener("keydown",C),C=void 0,y&&(C=b=>{[b.ctrlKey&&"ctrl",b.shiftKey&&"shift",b.altKey&&"alt",b.metaKey&&"meta",b.key.toLowerCase()].filter(Boolean).join("+")===y&&(b.preventDefault(),q(e))},document.addEventListener("keydown",C));let x=$,O=()=>{$===x&&(document.body.append(x),N(e,`Report a bug button shown at ${u}-${p}`))};document.body?O():document.addEventListener("DOMContentLoaded",O)}function $e(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},$?.remove(),$=void 0,C&&document.removeEventListener("keydown",C),C=void 0,ee=()=>{},re(e)}function ie(e){return typeof e=="string"?e.length:e?.size}function Oe(e){return e&&Number(e)||void 0}function at(e,t){return async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=(i?.method??n.method??"GET").toUpperCase(),a=Date.now();try{let d=await e(n,i);return t(o,r,d.status,a,ie(i?.body),Oe(d.headers.get("content-length"))),d}catch(d){throw t(o,r,0,a,ie(i?.body)),d}}}function dt(e,t){let n=e.open,i=e.send;e.open=function(r,o){return this._blipit=[String(r).toUpperCase(),String(o)],n.apply(this,arguments)},e.send=function(r){let o=this._blipit;if(o){let a=Date.now();this.addEventListener("loadend",()=>t(o[0],o[1],this.status,a,ie(r),Oe(this.getResponseHeader("content-length"))))}return i.apply(this,arguments)}}function Te(e){if(typeof window>"u")return;let t=L(e.endpoint,""),{console:n,network:i,actions:r}=e.logs;window.addEventListener("error",c=>{e.captureException(c.error??c.message,!1)}),window.addEventListener("unhandledrejection",c=>{e.captureException(c.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",c=>{let s=c.target;if(!(s instanceof Element)||s.closest("[data-blipit-ui]"))return;let u=Y(s);e.addBreadcrumb({category:"ui.click",message:`Clicked ${u}`});let p=s.closest(se)?"***":m((s.textContent??"").trim().replace(/\s+/g," "),80);R(r,{timestamp:k(),type:"click",selector:u,text:p},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",c=>{let s=c.target;s instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)&&R(r,{timestamp:k(),type:"focus",selector:Y(s)},50)},{capture:!0,passive:!0}));let o=(c,s,u,p,h,y)=>{t&&s.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${c} ${A(s)} \u2192 ${u||"network error"}`,level:u>=400||!u?"error":"info",data:{url:A(s),method:c,status_code:u||void 0}}),R(i,{timestamp:k(),method:c,url:X(s),status:u,duration:Date.now()-p,request_size:h,response_size:y},50))};typeof window.fetch=="function"&&(window.fetch=at(window.fetch.bind(window),o)),typeof XMLHttpRequest<"u"&&dt(XMLHttpRequest.prototype,o);for(let c of["log","info","debug","warn","error"]){let s=console[c].bind(console);console[c]=(...u)=>{let p=m(u.map(h=>typeof h=="string"?h:ct(h)).join(" "),1024);if(c==="warn"||c==="error"){e.addBreadcrumb({category:"console",level:c==="warn"?"warning":"error",message:p});let h=u.find(y=>y instanceof Error);R(n,{timestamp:k(),level:c,message:p,stack:m((h??new Error).stack??"",2e3)},100)}else R(n,{timestamp:k(),level:c,message:p},100);s(...u)}}let a=()=>R(r,{timestamp:k(),type:"navigation",url:X(location.href)},50),d=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${A(location.href)}`}),a()};if(a(),window.history){let c=window.history.pushState.bind(window.history);window.history.pushState=(...s)=>{c(...s),d()},window.addEventListener("popstate",d)}}function ct(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function Le(){let e=0,t=0,n=0,i=0;return r=>(r.hadRecentInput||(t>0&&r.startTime-i<1e3&&r.startTime-n<5e3?t+=r.value:(t=r.value,n=r.startTime),i=r.startTime,t>e&&(e=t)),e)}function lt(e){if(e.size===0)return;let t=[...e.values()].sort((n,i)=>i-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function ut(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function P(e,t,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>t(r))).observe({type:e,buffered:!0,...n})}catch{}}function Ce(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=f=>Math.max(0,Math.round(f-r)),a=document.visibilityState==="hidden",d=location.pathname,c=i?.type,s={},u=Le(),p=new Map,h=!1,y=!1;i&&i.responseStart>0&&(s.ttfb=o(i.responseStart)),a||(P("paint",f=>{f.name==="first-contentful-paint"&&(s.fcp=o(f.startTime))}),P("largest-contentful-paint",f=>{h||(s.lcp=o(f.startTime))}));let x=()=>{h=!0};addEventListener("keydown",x,{once:!0,capture:!0}),addEventListener("pointerdown",x,{once:!0,capture:!0}),P("layout-shift",f=>{s.cls=Math.round(u(f)*1e4)/1e4});let O=f=>{if(!f.interactionId)return;p.set(f.interactionId,Math.max(p.get(f.interactionId)??0,f.duration));let W=lt(p);W!==void 0&&(s.inp=Math.round(W))};P("event",O,{durationThreshold:40}),P("first-input",O);let b=navigator.connection?.effectiveType,I=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,_=()=>{if(y||Object.keys(s).length===0||B(t))return;y=!0;let f=JSON.stringify({path:d.slice(0,512),metrics:s,nav:c,connection:b&&/^(slow-2g|2g|3g|4g)$/.test(b)?b:void 0,device:ut(navigator.userAgent)});try{if(navigator.sendBeacon?.(I,f))return}catch{}fetch(I,{method:"POST",body:f,keepalive:!0}).then(W=>T(W,t)).catch(()=>{})},E=()=>{location.pathname!==d&&(_(),d=location.pathname,c="route",s={},u=Le(),p=new Map,h=!0,y=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&_()),addEventListener("pagehide",_),addEventListener("popstate",E);let M=history.pushState;history.pushState=function(...f){M.apply(this,f),E()}}function pt(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function Me(e,t,n,i){let r=pt(e);if(!r||typeof document>"u")return;let o=F(),a;return te("blipit-replay.js","BlipitReplay",e.src).then(d=>a=d.start({id:o,mode:r,endpoint:t,key:n,instance:i},e),()=>{}),{id:o,active:()=>a?.active()??!1,error:d=>a?.error(d),report:d=>a?.report?.(d)}}var Be='<svg viewBox="0 0 242.4 208.7" aria-hidden="true"><defs><linearGradient id="bm1" x1="0" y1="1" x2=".5" y2="0"><stop offset="0" stop-color="#00C2FF"/><stop offset=".35" stop-color="#3882F6"/><stop offset="1" stop-color="#0F172A"/></linearGradient><linearGradient id="bm2" x1="0" y1="1" x2="1" y2="0"><stop offset="0" stop-color="#3882F6"/><stop offset=".5" stop-color="#00C2FF"/><stop offset="1" stop-color="#3882F6"/></linearGradient></defs><path fill="url(#bm1)" d="M115.5,164.5c-3.9,0-7.8-.4-11.5-1.2-3.7-.8-7.3-1.9-10.8-3.4-3.4-1.4-6.7-3.2-9.7-5.3-3.0-2.0-5.9-4.4-8.5-7.0s-4.9-5.4-7.0-8.5c-2.1-3.1-3.9-6.3-5.3-9.8-1.5-3.5-2.6-7.1-3.4-10.8-.8-3.8-1.2-7.7-1.2-11.5V19.1c0-6.6,5.4-12.0,12.0-12.0s12.0,5.4,12.0,12.0v88.2c0,2.2.2,4.5.7,6.7.4,2.1,1.1,4.2,1.9,6.2.8,2.0,1.9,3.9,3.1,5.7,1.2,1.8,2.6,3.4,4.1,4.9s3.2,2.9,4.9,4.1c1.8,1.2,3.7,2.2,5.6,3.1,2.0.8,4.1,1.5,6.2,1.9,4.4.9,9.1.9,13.4,0,2.1-.4,4.2-1.1,6.2-1.9,2.0-.8,3.9-1.9,5.7-3.1,1.8-1.2,3.4-2.6,4.9-4.1s2.9-3.2,4.1-4.9c1.2-1.8,2.2-3.7,3.1-5.7.8-2.0,1.5-4.1,1.9-6.2.5-2.2.7-4.5.7-6.7s-.2-4.5-.7-6.7c-.4-2.1-1.1-4.2-1.9-6.2-.8-2.0-1.9-3.9-3.1-5.7-1.2-1.8-2.6-3.4-4.1-4.9s-3.2-2.9-4.9-4.1c-1.8-1.2-3.7-2.2-5.7-3.1-2.0-.8-4.1-1.5-6.2-1.9-4.4-.9-9.1-.9-13.4,0-6.5,1.3-12.9-2.9-14.2-9.4-1.3-6.5,2.9-12.9,9.4-14.2,7.6-1.6,15.5-1.6,23.1,0,3.7.8,7.3,1.9,10.8,3.4,3.4,1.4,6.7,3.2,9.7,5.3,3.0,2.0,5.9,4.4,8.5,7.0s4.9,5.4,7.0,8.5c2.1,3.1,3.9,6.3,5.3,9.8,1.5,3.5,2.6,7.1,3.4,10.8.8,3.8,1.2,7.7,1.2,11.5s-.4,7.8-1.2,11.5c-.8,3.7-1.9,7.3-3.4,10.8-1.4,3.4-3.2,6.7-5.3,9.7-2.0,3.0-4.4,5.9-7.0,8.5s-5.4,4.9-8.5,7.0c-3.1,2.1-6.3,3.9-9.8,5.3-3.5,1.5-7.1,2.6-10.8,3.4-3.8.8-7.7,1.2-11.5,1.2Z"/><path fill="url(#bm2)" d="M208.1,103.0c-.0-.6-.8-.9-1.2-.5-3.2,3.1-7.6,5.0-12.4,5.0-3.9,0-9.1-1.6-10.2-2.5-.3-.1-.1,1.4-.1,2.5,0,40.5-34.4,73.0-75.5,70.0-33.4-2.5-60.8-28.8-64.4-62.1-1.0-9.4-.2-18.6,2.2-27.0,1.6-5.6,2.6-11.4,2.6-17.3v-22.4c0-3.4-4.3-5.0-6.5-2.4-13.2,15.4-21.6,35.1-22.7,56.6-2.6,54.1,40.6,98.9,94.1,98.9s94.2-42.3,94.2-94.2c0-1.5-.1-3.0-.1-4.5Z"/><path fill="url(#bm2)" d="M201.2,70.1c-14.8-35.8-50.9-60.5-92.3-58.3h-.1c-8.2.5-14.6,7.4-14.6,15.7v.1c0,5.4,4.7,9.6,10.0,8.8,3.2-.5,6.5-.7,9.9-.7,28.7,0,53.5,17.4,64.3,42.1.2.5.9.6,1.2.1,3.2-4.8,8.7-7.9,14.9-7.9,2.0,0,4.0.3,5.8,1.0.6.2,1.1-.4.9-1.0Z"/><circle fill="#00C2FF" cx="194.5" cy="88" r="15.8"/></svg>';var l=".blipit-rb.blipit-rb",ft=`${l}{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:9px;height:40px;padding-inline:5px 17px;border-radius:99px;font:600 14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;color:#fff;background:linear-gradient(135deg,#3882F6,#2F5BEA);box-shadow:0 10px 24px -12px rgba(56,130,246,.8),0 1px 3px rgba(11,26,58,.16),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s}${l}:hover{transform:translateY(-1px);box-shadow:0 16px 32px -12px rgba(56,130,246,.85),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22)}${l}:active{transform:scale(.97)}${l}:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}${l}[aria-busy=true]{cursor:progress}${l}>span{all:unset}${l}>.blipit-rb-m{position:relative;display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px rgba(11,26,58,.08),0 1px 2px rgba(11,26,58,.12)}${l} svg{display:block;width:19px;height:17px}${l}[data-size=sm]{height:32px;gap:7px;padding-inline:4px 13px;font-size:13px}${l}[data-size=sm]>.blipit-rb-m{width:24px;height:24px}${l}[data-size=sm] svg{width:15px;height:13px}${l}[data-variant=outline],${l}[data-variant=ghost]{color:#0B1A3A;background:transparent;box-shadow:inset 0 0 0 1px #CBD7EA}${l}[data-variant=ghost]{box-shadow:none}${l}[data-variant=outline]:hover,${l}[data-variant=ghost]:hover{transform:none;background:rgba(56,130,246,.08);box-shadow:inset 0 0 0 1px rgba(56,130,246,.45)}${l}[data-variant=ghost]:hover{box-shadow:none}${l}[data-theme=dark]{background:linear-gradient(135deg,#5B9BFF,#3D6BF0);box-shadow:0 10px 24px -12px rgba(91,155,255,.7),inset 0 1px 0 rgba(255,255,255,.2)}${l}[data-theme=dark][data-variant=outline],${l}[data-theme=dark][data-variant=ghost]{color:#E8EEF8;background:transparent;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}${l}[data-theme=dark][data-variant=ghost]{box-shadow:none}${l}[data-theme=dark][data-variant=outline]:hover,${l}[data-theme=dark][data-variant=ghost]:hover{background:rgba(91,155,255,.16);box-shadow:inset 0 0 0 1px rgba(91,155,255,.45)}${l}[data-theme=dark][data-variant=ghost]:hover{box-shadow:none}${l}[data-theme=dark]>.blipit-rb-m{box-shadow:0 0 0 1px rgba(255,255,255,.1)}${l}[aria-busy=true] svg{visibility:hidden}${l}[aria-busy=true]>.blipit-rb-m::after{content:"";position:absolute;inset:4px;border:2px solid #3882F6;border-right-color:transparent;border-radius:50%;animation:blipit-rb-r .8s linear infinite}@keyframes blipit-rb-r{to{transform:rotate(1turn)}}@media(pointer:coarse){${l}{min-height:44px}}@media(prefers-reduced-motion:reduce){${l}{transition:none}${l}:hover,${l}:active{transform:none}${l}[aria-busy=true]>.blipit-rb-m::after{animation-duration:3s}}@media(forced-colors:active){${l}{border:1px solid ButtonText}}`,Ae=0;function Ie(e,t={}){Ae||D(document,ft);let n=++Ae,i=document.createElement("span");i.className="blipit-rb-m",i.innerHTML=Be.replace(/bm(\d)/g,`bm$1-${n}`);let r=document.createElement("span");r.textContent=e.textContent,e.replaceChildren(i,r),e.classList.add("blipit-rb"),e.setAttribute("data-variant",t.variant==="outline"||t.variant==="ghost"?t.variant:"solid"),e.setAttribute("data-size",t.size==="sm"?"sm":"md"),e.setAttribute("data-theme",ce(t.theme==="light"||t.theme==="dark"?t.theme:void 0))}var g,Fe=new Set;function je(e,t){Fe.has(t)||(Fe.add(t),console[e](t))}var mt="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",gt="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function gn(e){if(g)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return je("warn",mt);if(t.startsWith("blipit_sk_"))return je("error",gt);if(g=new z({...e,key:t}),e.sdkChannel==="exact"&&(v.channel=v.exact),v.debug=!!e.debug,e.user){let{id:r,name:o,email:a,username:d}=e.user;g.setUser({id:r===void 0?void 0:String(r),email:a,username:d??o})}Te(g),e.webVitals!==!1&&typeof window<"u"&&Ce(g.endpoint,t,e.instance);let n=g,i=r=>r&&(n.replay=Me(r,n.endpoint,t,e.instance));i(e.replay??(typeof window<"u"&&void H(n).then(r=>i(r.replay)))),typeof window<"u"&&re(g),e.debug&&console.log(`[blipit] ${j}@${S} initialized`)}function bn(e){return g?.captureException(e,!0)}function hn(e,t){return g?.captureMessage(e,t)}function yn(e){return g?.captureSecurity(e)}function xn(e){g?.setUser(e)}function vn(e,t){g?.setTag(e,t)}function kn(e){g?.addBreadcrumb(e)}function wn(e={}){g&&ne(g,{...e,eventId:e.eventId??g.lastEventId})}function Ne(){g&&q(g)}function Sn(e){e.addEventListener("click",t=>{t.preventDefault(),Ne()})}function En(e={}){let t=Ee(e.label,Ne);return Ie(t,e),t}function _n(e){g&&$e(g,e)}function Rn(){return g?.flush()??Promise.resolve()}Re(pe);export{kn as addBreadcrumb,Sn as attachReport,bn as captureException,hn as captureMessage,yn as captureSecurity,Rn as flush,gn as init,Ne as openReport,En as reportButton,it as setReportMetadata,vn as setTag,xn as setUser,wn as showFeedback,_n as updateWidget};
1
+ function j(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0");return t}var Y=globalThis.__blipitRefused??=new Set,B=e=>Y.has(e);async function M(e,t){if(e.status!==409)return!1;let n=null;try{n=await e.clone().json()}catch{}return n?.reason!=="platform_mismatch"?!1:(Y.has(t)||(Y.add(t),console.error(`[blipit] ${String(n.error??"This key belongs to a project for another platform.")} Blipit stopped sending with this key until the page reloads.`)),!0)}function w(){return new Date().toISOString()}var qe=/token|key|password|secret|auth|session|passwd|api/i;function I(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let n=e.slice(0,t),o=e.slice(t+1).split("&").map(i=>{let s=i.indexOf("=");if(s===-1)return i;let d=i.slice(0,s);return qe.test(d)?`${d}=[redacted]`:i}).join("&");return`${n}?${o}`.slice(0,2048)}var He=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function ae(e){return e.replace(He,"$1[redacted]")}function g(e,t){return e.length>t?e.slice(0,t):e}var de=".blipit-mask,[data-blipit-mask]";function G(e){return e.replace(/#.*/,"").replace(/([?&][^=&]*)=[^&]*/g,"$1=").slice(0,2048)}function $(e,t,n){e.push(t),e.length>n&&e.shift()}function J(e){let t=e.id?`#${e.id}`:"",n=typeof e.className=="string"&&e.className.trim()?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return g(`${e.tagName.toLowerCase()}${t}${n}`,128)}function U(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}catch{let n=document.createElement("style");n.textContent=t,(e===document?document.head:e).append(n)}}function C(e,t){return`${e.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${t}`}function ce(e,t){let n=e?/^(https?:\/\/[^?#]*\/)blipit(?:\.min)?\.js(?:[?#].*)?$/.exec(e):null;return n?n[1]:`https://blipit.io/sdk/${t}/`}function le(e,t){let n=`/sdk/${t}/`,[r,o]=t.split(".");return e.endsWith(n)?`${e.slice(0,-n.length)}/sdk/${r==="0"?`${r}.${o}`:r}/`:e}function ue(e){let t=e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?/);if(!t||(t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))<.5)return null;let[r,o,i]=[t[1],t[2],t[3]].map(s=>{let d=parseFloat(s)/255;return d<=.03928?d/12.92:((d+.055)/1.055)**2.4});return .2126*r+.7152*o+.0722*i}function pe(e){if(e==="light"||e==="dark")return e;if(typeof document<"u"){for(let n of[document.body,document.documentElement]){if(!n)continue;let r=ue(getComputedStyle(n).backgroundColor);if(r!==null)return r<.4?"dark":"light"}let t=getComputedStyle(document.documentElement).colorScheme;if(t==="dark")return"dark";if(!t?.includes("dark"))return"light"}return typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Ve=e=>Math.max(...e)-Math.min(...e)>40||Math.max(...e)<70||Math.min(...e)>245,Xe=["primary","color-primary","primary-color","brand","brand-color","color-brand","bs-primary","o-brand-primary"],Ye=".btn-primary,.button-primary,.btn--primary,.is-primary,[class*=btn-primary],[data-variant=primary],button[type=submit],input[type=submit]";function K(e){try{let t=(e??"").trim(),n=a=>CSS.supports("color",a);if(!t)return null;if(!n(t)){let a=t.match(/#[\da-f]{3,8}|(?:rgb|hsl|oklch|oklab|lab|lch|hwb)a?\([^()]+\)/i)?.[0];if(n(`hsl(${t})`))t=`hsl(${t})`;else if(a&&n(a))t=a;else return null}let r=document.createElement("canvas");r.width=r.height=1;let o=r.getContext("2d");o.fillStyle=t,o.fillRect(0,0,1,1);let[i,s,d,c]=o.getImageData(0,0,1,1).data;return c>200?[i,s,d]:null}catch{return null}}var fe=e=>(ue(`rgb(${e})`)??0)>.45?"#0B1A3A":"#fff";function me(){let e={};try{let t=getComputedStyle(document.documentElement),n=(s,d)=>s&&(d?Math.max(...s)-Math.min(...s)>40:Ve(s))?s:null,r=null;for(let s of Xe)if(r=K(t.getPropertyValue(`--${s}`)))break;if(!r){for(let s of Array.from(document.querySelectorAll(Ye)).slice(0,12))if(r=n(K(getComputedStyle(s).backgroundColor)))break}let o=document.querySelector("a[href]");r||=n(o&&K(getComputedStyle(o).color),!0),r&&["0,0,238","85,26,139","158,158,255"].includes(r.join())&&(r=null),r||=n(K(document.querySelector('meta[name="theme-color"]')?.content),!0),r&&(e.rgb=r);let i=getComputedStyle(document.body).fontFamily;i&&!/^"?(times( new roman)?|serif|-webkit-standard)"?$/i.test(i.trim())&&(e.font=i.replace(/[;{}]/g,""))}catch{}return e}var Ge=5e3,ge={en:["Report {ref} sent.","We will email you updates."],ar:["\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A {ref}.","\u0633\u0646\u0631\u0627\u0633\u0644\u0643 \u0628\u0627\u0644\u062A\u062D\u062F\u064A\u062B\u0627\u062A."],de:["Meldung {ref} gesendet.","Wir informieren Sie per E-Mail."],es:["Reporte {ref} enviado.","Te enviaremos novedades por correo."],fr:["Signalement {ref} envoy\xE9.","Nous vous tiendrons au courant par e-mail."],it:["Segnalazione {ref} inviata.","Ti invieremo aggiornamenti via email."],ja:["\u5831\u544A {ref} \u3092\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002","\u9032\u6357\u306F\u30E1\u30FC\u30EB\u3067\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002"],nl:["Melding {ref} verstuurd.","We mailen je updates."],pt:["Relato {ref} enviado.","Vamos enviar novidades por e-mail."],tr:["{ref} numaral\u0131 bildirim g\xF6nderildi.","Geli\u015Fmeleri e-postayla bildirece\u011Fiz."],zh:["\u62A5\u544A {ref} \u5DF2\u53D1\u9001\u3002","\u6211\u4EEC\u4F1A\u901A\u8FC7\u90AE\u4EF6\u544A\u77E5\u8FDB\u5C55\u3002"]};function Je(e,t,n){if(typeof e!="string"||!/^BR-\d{1,12}$/.test(e))return null;let[r,o]=ge[n.toLowerCase().split(/[-_]/)[0]]??ge.en;return`${r.replace("{ref}",e)}${t===!0?` ${o}`:""}`}function S(e,t,n){let r=document.createElement(e);return r.style.cssText=t,n!==void 0&&(r.textContent=n),r}var Z="display:block;width:100%;box-sizing:border-box;margin:4px 0 12px;padding:8px 10px;font:inherit;border:1px solid #c5ccd6;border-radius:6px;background:#fff;color:#111",be="font:inherit;padding:8px 14px;border-radius:6px;cursor:pointer;border:1px solid #c5ccd6;background:#fff;color:#111",Q=!1;function he(e,t,n,r){if(Q||typeof document>"u"||!document.body)return;Q=!0;let o=S("dialog","max-width:420px;width:calc(100% - 32px);padding:20px;border:1px solid #c5ccd6;border-radius:10px;font:14px/1.45 system-ui,sans-serif;color:#111;background:#fff");o.setAttribute("aria-labelledby","blipit-fb-title");let i=S("form","margin:0"),s=S("h2","margin:0 0 12px;font-size:17px",n.title??"Tell us what happened");s.id="blipit-fb-title";let d=(f,k,_)=>{let A=S("label","display:block;font-weight:600",f);A.htmlFor=_,k.id=_,i.append(A,k)},c=S("input",Z);c.type="text",c.maxLength=128,c.autocomplete="name",c.value=n.name??"";let a=S("input",Z);a.type="email",a.maxLength=254,a.autocomplete="email",a.value=n.email??"";let u=S("textarea",`${Z};min-height:110px;resize:vertical`);u.required=!0,u.maxLength=Ge;let p=S("p","margin:0 0 12px;min-height:1.2em;font-size:13px");p.setAttribute("role","status"),p.setAttribute("aria-live","polite");let h=S("div","display:flex;gap:8px;justify-content:flex-end"),y=S("button",be,"Cancel");y.type="button";let x=S("button",`${be};background:#111;color:#fff;border-color:#111`,"Send");x.type="submit",i.append(s),d("Name (optional)",c,"blipit-fb-name"),d("Email (optional)",a,"blipit-fb-email"),d("What went wrong?",u,"blipit-fb-message"),h.append(y,x),i.append(p,h),o.append(i),document.body.append(o);let O=()=>{Q=!1,o.remove()},R=()=>typeof o.close=="function"&&o.open?o.close():O();y.addEventListener("click",R),o.addEventListener("close",O),i.addEventListener("submit",async f=>{f.preventDefault();let k=u.value.trim();if(!k){p.textContent="Please describe what happened.",u.focus();return}x.disabled=!0,y.disabled=!0,x.setAttribute("aria-busy","true"),x.textContent="Sending\u2026",p.textContent="";try{let _=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":t,"X-Blipit-Sdk":r},body:JSON.stringify({name:c.value.trim()||void 0,email:a.value.trim()||void 0,message:k,event_id:n.eventId,url:typeof location<"u"?location.href.split(/[?#]/)[0]:void 0})});if(await M(_,t))throw new Error("platform_mismatch");if(!_.ok)throw new Error(String(_.status));let A=await _.json().catch(()=>({})),m=Je(A.ref,A.emails,typeof navigator>"u"?"en":navigator.language??"en");p.textContent=m??"Thanks, your message was sent.",x.textContent="Sent",setTimeout(R,m?4e3:1200)}catch{p.textContent="That did not send. Please try again.",x.disabled=!1,y.disabled=!1,x.removeAttribute("aria-busy"),x.textContent="Send"}}),typeof o.showModal=="function"?o.showModal():o.setAttribute("open",""),u.focus()}var ee={platforms:["android","ios","react-native","flutter","web","backend","odoo"],names:{android:"Android",ios:"iOS","react-native":"React Native",flutter:"Flutter",web:"Web",backend:"Backend",odoo:"Odoo"}};var Lt=ee.platforms,At=ee.names;var Qe={"blipit-android":"android","maven:com.github.blipit-io:blipit-android":"android","blipit-swift":"ios","swiftpm:blipit-swift":"ios","@blipit/react-native":"react-native","npm:@blipit/react-native":"react-native","blipit-flutter":"flutter","pub:blipit_flutter":"flutter","@blipit/browser":"web","blipit-browser":"web","npm:@blipit/browser":"web","@blipit/nextjs":"web","npm:@blipit/nextjs":"web","@blipit/node":"node","npm:@blipit/node":"node","blipit-python":"backend","pypi:blipit":"backend","blipit-ruby":"backend","gem:blipit":"backend","blipit-php":"backend","composer:blipit/blipit":"backend","blipit-go":"backend","go:github.com/blipit-io/blipit-go":"backend","blipit-java":"backend","maven:io.blipit:blipit":"backend","blipit-dotnet":"backend","nuget:blipit":"backend","@blipit/cli":"backend","blipit-odoo":"odoo",blipit_monitor:"odoo"},Bt=Object.keys(Qe);var ye=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var z=class{constructor(t,n,r,o,i){this.endpoint=t;this.key=n;this.sdk=r;this.debug=o;this.instance=i;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;sdk;debug;instance;queue=[];timer;sending=!1;enqueue(t){this.queue.push(t),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let t=this.queue[0];if(!await this.send(t))break;this.queue.shift()}}finally{this.sending=!1}}}async send(t,n=0){if(B(this.key))return!0;try{let r=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(t),keepalive:!0});return r.status===429||r.status>=500?this.retry(t,n):await M(r,this.key)?(this.queue.length=0,!1):(this.debug&&r.status>=400&&console.warn("[blipit] event rejected",r.status,await r.text()),!0)}catch{return this.retry(t,n)}}async retry(t,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",t.event_id),!0):(await new Promise(r=>setTimeout(r,1e3*2**n)),this.send(t,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon||B(this.key)))for(;this.queue.length>0;){let t=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,r=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(r,JSON.stringify(t))}}};var xe={ok:0,errored:1,crashed:2},q=class{constructor(t,n,r,o,i){this.url=t;this.key=n;this.sdk=r;this.release=o;this.environment=i;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;sdk;release;environment;sid="";started="";status="ok";errors=0;did;setUser(t){this.did=t}markError(t){if(!this.sid)return;this.errors+=1;let n=t?"crashed":"errored";xe[n]<=xe[this.status]||(this.status=n,this.send(!1))}start(){this.sid=j(),this.started=w(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(t){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&t?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),r=`${this.url}?key=${encodeURIComponent(this.key)}`;if(!B(this.key))try{if(t&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(r,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,"X-Blipit-Sdk":this.sdk},body:n,keepalive:!0}).then(o=>M(o,this.key)).catch(()=>{})}catch{return}}};var et=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,tt=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,ve=/^(chrome|moz|safari-web)-extension:/;function nt(){if(typeof location<"u"&&location.origin)return location.origin}function rt(e){if(ve.test(e)||e==="<anonymous>"||e==="[native code]")return!1;let t=nt();return!!(!t||e.startsWith(t)||!/^[a-z]+:/i.test(e))}function ke(e){if(!e)return[];let t=[];for(let n of e.split(`
2
+ `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let r=et.exec(n)??tt.exec(n);if(!r)continue;let[,o,i,s,d]=r;if(!i)continue;let c={filename:g(i,1024),in_app:rt(i)};o&&(c.function=g(o,512)),s&&(c.lineno=Number(s)),d&&(c.colno=Number(d)),t.push(c)}return t.reverse(),t.slice(-128)}function we(e){return e.length===0?!1:e.every(t=>ve.test(t.filename))}var N="@blipit/browser",E="0.3.22",Se=ce(typeof document<"u"?document.currentScript?.src:void 0,E),v={exact:Se,channel:le(Se,E),debug:!1,tag:!1},ot="https://in.blipit.io/api/v1/events",it=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],st={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},at={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function dt(e){if(!ye.includes(e?.kind))return;let t=g(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=g(String(e.actorId),128)),e.ip&&(n.ip=g(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=g(String(e.userAgent),512)),e.database&&(n.database=g(String(e.database),64)),e.outcome&&(n.outcome=g(String(e.outcome),64)),e.target&&(n.target=g(String(e.target),256)),n}var H=class{constructor(t){this.options=t;this.endpoint=t.endpoint??ot;let n=t._sdk??{name:N,version:E};this.sdk=`${n.name}/${n.version}`,this.transport=new z(this.endpoint,t.key,this.sdk,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new q(C(this.endpoint,"/api/v1/sessions"),t.key,this.sdk,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...it,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;sdk;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[g(t,64)]=g(n,256)}addBreadcrumb(t){let n={timestamp:w(),...t};n.message&&(n.message=ae(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:I(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let r=t instanceof Error?t:new Error(String(t)),o={type:r.name||"Error",value:g(r.message||String(r),4096),handled:n},i=ke(r.stack);return i.length>0&&(o.stacktrace={frames:i}),this.processAndSend({exception:o,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:g(t,8192),level:n})}captureSecurity(t){let n=dt(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${st[n.kind]} for ${n.actor}`,level:at[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let r=t.exception?.value??t.message??"";if(n){for(let d of this.ignoreErrors)if(typeof d=="string"?r.includes(d):d.test(r))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&we(t.exception.stacktrace.frames))return;let s=`${t.exception?.type??""}|${r}`;if(t.exception?.handled===!1){if(this.seen.has(s)&&this.seen.size<100)return;this.seen.add(s),setTimeout(()=>this.seen.delete(s),5e3)}}let o={event_id:j(),timestamp:w(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:I(location.href)}:void 0,contexts:this.collectContexts(),sdk:this.options._sdk??{name:N,version:E},...t};for(let s of Object.keys(o))o[s]===void 0&&delete o[s];let i=this.replay?.active()&&(o.level==="error"||o.level==="fatal")?this.replay:void 0;if(i&&(o.tags={...o.tags,replay_id:i.id}),this.options.beforeSend){let s=this.options.beforeSend(o);if(!s)return;o=s}return this.transport.enqueue(o),this.lastEventId=o.event_id,(o.level==="error"||o.level==="fatal")&&$(this.errorIds,o.event_id,20),o.exception&&this.session?.markError(o.exception.handled===!1),i?.error(o.event_id),o.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",r=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;r&&(t.browser={name:r[1],version:r[2]});let o=/\(([^)]+)\)/.exec(n);return o&&o[1]&&(t.os={name:g(o[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};var te={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},ct="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:var(--o,#fff);font:600 14px var(--f,system-ui),system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px var(--g,rgba(56,130,246,.75)),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px var(--g,rgba(56,130,246,.85)),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",lt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',$e,Ee={},ut,T,ne=()=>{},L,_e=0,F=()=>{};function Te(e,t){let n=(e.match??t.match)===!1?{}:me(),r=e.color?void 0:n.rgb;return{color:e.color??(r?`rgb(${r})`:t.color),rgb:r,font:e.font??n.font}}function P(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function pt(e){$e=e}var Re=(e,t)=>new Promise((n,r)=>{let o=document.createElement("script");o.src=e,o.async=!0,o.onload=()=>n(window[t]),o.onerror=r,document.head.appendChild(o)});function re(e,t,n){return Ee[t]??=(async()=>{if(!n&&v.channel!==v.exact){try{let o=await Re(v.channel+e,t);if(o?.accepts?.({version:E,api:1}))return o}catch{}window[t]=void 0,v.debug&&console.log(`[blipit] fallback ${v.exact}${e}`)}let r=await Re(n??v.exact+e,t);if(!r)throw Error(t);return r})().catch(r=>{throw delete Ee[t],r})}function ft(e,t){try{let n=e.options._sdk??{name:N,version:E},r=t?.[n.name],o=e.options.debug||/^(localhost$|127\.|\[::1])|\.local$/.test(location.hostname);try{o||=process.env.NODE_ENV==="development"}catch{}if(!o||!r||r.version.localeCompare(n.version,"en",{numeric:!0})<1)return;let i=`blipit_latest_${r.version}`,s=sessionStorage;if(s[i])return;s[i]=1,console.info(`[blipit] ${r.version} is available (you have ${n.version})${r.note?` \u2014 ${r.note}`:""} \u2014 ${v.tag?`load ${v.exact.replace(E,r.version)}blipit.js`:`npm install ${n.name}@latest`}`)}catch{}}function Oe(){let e=(navigator.language??"en").slice(0,2);return te[e]?e:"en"}function Me(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=Oe(),n.textContent=te[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var Ce=()=>{};function Le(e){Ce=e}function oe(e,t){Ce(C(e.endpoint,"/api/v1/feedback"),e.options.key,t,e.sdk)}function V(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),r=o=>{ne(o),n.forEach(i=>o?i.setAttribute("aria-busy","true"):i.removeAttribute("aria-busy"))};r(!0),F(),Promise.all([re("blipit-report.js","BlipitReport",t.src),X(e)]).then(([o,i])=>i.enabled!==!1&&o.open(e,{metadata:$e,recording:i.recording===!0,recordingMaxMs:i.recording_max_ms,storageFull:i.storage_full===!0,reportsFull:i.reports_full===!0,theme:i.theme,look:Te(t,i),hide:s=>T&&(T.style.display=s?"none":"")}),()=>oe(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>r(!1))}async function mt(e){let t=`blipit_fb_${E}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(C(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,"X-Blipit-Sdk":e.sdk,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return P(e,`settings failed (HTTP ${n.status})`),{};let r=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:r}))}catch{}return r}catch{return P(e,"settings unreachable (offline, ad blocker or CSP connect-src)"),{}}}function X(e){return ut??=mt(e)}async function ie(e){let t=e.options.feedbackWidget,n=++_e;if(typeof document>"u")return;if(t===!1)return P(e,"Report a bug button off: feedbackWidget is false");let r=await X(e);if(ft(e,r.latest),n!==_e)return;if(r.enabled===!1)return P(e,"Report a bug button hidden by the project setting");let o={...r,...typeof t=="object"?t:{}},[i,s]=te[Oe()],d=o.text||i;T=document.createElement("div"),T.setAttribute("data-blipit-ui","");let c=T.attachShadow({mode:"open"}),a=document.createElement("button");a.type="button";let[u,p]=(/^(bottom|middle)-(left|right)$/.test(o.position??"")?o.position:"bottom-right").split("-");a.style.cssText=`${o.color?`--c:${o.color};`:""}${p}:calc(20px + env(safe-area-inset-${p},0px));${u==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,a.setAttribute("aria-haspopup","dialog"),o.style==="icon"&&(a.className="o",a.title=d);let h=typeof t=="object"?t:{};F=()=>{let{rgb:f,font:k}=Te(h,r);f&&(a.style.cssText+=`;--c:rgb(${f});--g:rgba(${f},.6);--o:${fe(f)}`),k&&(a.style.cssText+=`;--f:${k.replace(/[;{}]/g,"")}`)};let y=f=>{a.disabled=f,a.setAttribute("aria-label",f?s:d),a.innerHTML=f?"<i></i><span></span>":`${lt}<span></span>`,a.lastChild.textContent=f?s:d};ne=y,y(!1),a.addEventListener("click",()=>V(e)),U(c,ct),c.append(a);let x=o.shortcut?.toLowerCase().replace(/\s/g,"");L&&document.removeEventListener("keydown",L),L=void 0,x&&(L=f=>{[f.ctrlKey&&"ctrl",f.shiftKey&&"shift",f.altKey&&"alt",f.metaKey&&"meta",f.key.toLowerCase()].filter(Boolean).join("+")===x&&(f.preventDefault(),V(e))},document.addEventListener("keydown",L));let O=T,R=()=>{T===O&&(document.body.append(O),F(),document.readyState!=="complete"&&globalThis.addEventListener?.("load",()=>F(),{once:!0}),P(e,`Report a bug button shown at ${u}-${p}`))};document.body?R():document.addEventListener("DOMContentLoaded",R)}function Ae(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},T?.remove(),T=void 0,L&&document.removeEventListener("keydown",L),L=void 0,ne=F=()=>{},ie(e)}function se(e){return typeof e=="string"?e.length:e?.size}function Be(e){return e&&Number(e)||void 0}function gt(e,t){return async(n,r)=>{let o=typeof n=="string"?n:n instanceof URL?n.href:n.url,i=(r?.method??n.method??"GET").toUpperCase(),s=Date.now();try{let d=await e(n,r);return t(i,o,d.status,s,se(r?.body),Be(d.headers.get("content-length"))),d}catch(d){throw t(i,o,0,s,se(r?.body)),d}}}function bt(e,t){let n=e.open,r=e.send;e.open=function(o,i){return this._blipit=[String(o).toUpperCase(),String(i)],n.apply(this,arguments)},e.send=function(o){let i=this._blipit;if(i){let s=Date.now();this.addEventListener("loadend",()=>t(i[0],i[1],this.status,s,se(o),Be(this.getResponseHeader("content-length"))))}return r.apply(this,arguments)}}function Ie(e){if(typeof window>"u")return;let t=C(e.endpoint,""),{console:n,network:r,actions:o}=e.logs;window.addEventListener("error",c=>{e.captureException(c.error??c.message,!1)}),window.addEventListener("unhandledrejection",c=>{e.captureException(c.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",c=>{let a=c.target;if(!(a instanceof Element)||a.closest("[data-blipit-ui]"))return;let u=J(a);e.addBreadcrumb({category:"ui.click",message:`Clicked ${u}`});let p=a.closest(de)?"***":g((a.textContent??"").trim().replace(/\s+/g," "),80);$(o,{timestamp:w(),type:"click",selector:u,text:p},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",c=>{let a=c.target;a instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName)&&$(o,{timestamp:w(),type:"focus",selector:J(a)},50)},{capture:!0,passive:!0}));let i=(c,a,u,p,h,y)=>{t&&a.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${c} ${I(a)} \u2192 ${u||"network error"}`,level:u>=400||!u?"error":"info",data:{url:I(a),method:c,status_code:u||void 0}}),$(r,{timestamp:w(),method:c,url:G(a),status:u,duration:Date.now()-p,request_size:h,response_size:y},50))};typeof window.fetch=="function"&&(window.fetch=gt(window.fetch.bind(window),i)),typeof XMLHttpRequest<"u"&&bt(XMLHttpRequest.prototype,i);for(let c of["log","info","debug","warn","error"]){let a=console[c].bind(console);console[c]=(...u)=>{let p=g(u.map(h=>typeof h=="string"?h:ht(h)).join(" "),1024);if(c==="warn"||c==="error"){e.addBreadcrumb({category:"console",level:c==="warn"?"warning":"error",message:p});let h=u.find(y=>y instanceof Error);$(n,{timestamp:w(),level:c,message:p,stack:g((h??new Error).stack??"",2e3)},100)}else $(n,{timestamp:w(),level:c,message:p},100);a(...u)}}let s=()=>$(o,{timestamp:w(),type:"navigation",url:G(location.href)},50),d=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${I(location.href)}`}),s()};if(s(),window.history){let c=window.history.pushState.bind(window.history);window.history.pushState=(...a)=>{c(...a),d()},window.addEventListener("popstate",d)}}function ht(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function je(){let e=0,t=0,n=0,r=0;return o=>(o.hadRecentInput||(t>0&&o.startTime-r<1e3&&o.startTime-n<5e3?t+=o.value:(t=o.value,n=o.startTime),r=o.startTime,t>e&&(e=t)),e)}function yt(e){if(e.size===0)return;let t=[...e.values()].sort((n,r)=>r-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function xt(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function W(e,t,n){try{new PerformanceObserver(r=>r.getEntries().forEach(o=>t(o))).observe({type:e,buffered:!0,...n})}catch{}}function Ne(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let r=performance.getEntriesByType("navigation")[0],o=r?.activationStart??0,i=m=>Math.max(0,Math.round(m-o)),s=document.visibilityState==="hidden",d=location.pathname,c=r?.type,a={},u=je(),p=new Map,h=!1,y=!1;r&&r.responseStart>0&&(a.ttfb=i(r.responseStart)),s||(W("paint",m=>{m.name==="first-contentful-paint"&&(a.fcp=i(m.startTime))}),W("largest-contentful-paint",m=>{h||(a.lcp=i(m.startTime))}));let x=()=>{h=!0};addEventListener("keydown",x,{once:!0,capture:!0}),addEventListener("pointerdown",x,{once:!0,capture:!0}),W("layout-shift",m=>{a.cls=Math.round(u(m)*1e4)/1e4});let O=m=>{if(!m.interactionId)return;p.set(m.interactionId,Math.max(p.get(m.interactionId)??0,m.duration));let D=yt(p);D!==void 0&&(a.inp=Math.round(D))};W("event",O,{durationThreshold:40}),W("first-input",O);let R=navigator.connection?.effectiveType,f=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,k=()=>{if(y||Object.keys(a).length===0||B(t))return;y=!0;let m=JSON.stringify({path:d.slice(0,512),metrics:a,nav:c,connection:R&&/^(slow-2g|2g|3g|4g)$/.test(R)?R:void 0,device:xt(navigator.userAgent)});try{if(navigator.sendBeacon?.(f,m))return}catch{}fetch(f,{method:"POST",body:m,keepalive:!0}).then(D=>M(D,t)).catch(()=>{})},_=()=>{location.pathname!==d&&(k(),d=location.pathname,c="route",a={},u=je(),p=new Map,h=!0,y=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&k()),addEventListener("pagehide",k),addEventListener("popstate",_);let A=history.pushState;history.pushState=function(...m){A.apply(this,m),_()}}function vt(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function Fe(e,t,n,r){let o=vt(e);if(!o||typeof document>"u")return;let i=j(),s;return re("blipit-replay.js","BlipitReplay",e.src).then(d=>s=d.start({id:i,mode:o,endpoint:t,key:n,instance:r},e),()=>{}),{id:i,active:()=>s?.active()??!1,error:d=>s?.error(d),report:d=>s?.report?.(d)}}var Pe='<svg viewBox="0 0 242.4 208.7" aria-hidden="true"><defs><linearGradient id="bm1" x1="0" y1="1" x2=".5" y2="0"><stop offset="0" stop-color="#00C2FF"/><stop offset=".35" stop-color="#3882F6"/><stop offset="1" stop-color="#0F172A"/></linearGradient><linearGradient id="bm2" x1="0" y1="1" x2="1" y2="0"><stop offset="0" stop-color="#3882F6"/><stop offset=".5" stop-color="#00C2FF"/><stop offset="1" stop-color="#3882F6"/></linearGradient></defs><path fill="url(#bm1)" d="M115.5,164.5c-3.9,0-7.8-.4-11.5-1.2-3.7-.8-7.3-1.9-10.8-3.4-3.4-1.4-6.7-3.2-9.7-5.3-3.0-2.0-5.9-4.4-8.5-7.0s-4.9-5.4-7.0-8.5c-2.1-3.1-3.9-6.3-5.3-9.8-1.5-3.5-2.6-7.1-3.4-10.8-.8-3.8-1.2-7.7-1.2-11.5V19.1c0-6.6,5.4-12.0,12.0-12.0s12.0,5.4,12.0,12.0v88.2c0,2.2.2,4.5.7,6.7.4,2.1,1.1,4.2,1.9,6.2.8,2.0,1.9,3.9,3.1,5.7,1.2,1.8,2.6,3.4,4.1,4.9s3.2,2.9,4.9,4.1c1.8,1.2,3.7,2.2,5.6,3.1,2.0.8,4.1,1.5,6.2,1.9,4.4.9,9.1.9,13.4,0,2.1-.4,4.2-1.1,6.2-1.9,2.0-.8,3.9-1.9,5.7-3.1,1.8-1.2,3.4-2.6,4.9-4.1s2.9-3.2,4.1-4.9c1.2-1.8,2.2-3.7,3.1-5.7.8-2.0,1.5-4.1,1.9-6.2.5-2.2.7-4.5.7-6.7s-.2-4.5-.7-6.7c-.4-2.1-1.1-4.2-1.9-6.2-.8-2.0-1.9-3.9-3.1-5.7-1.2-1.8-2.6-3.4-4.1-4.9s-3.2-2.9-4.9-4.1c-1.8-1.2-3.7-2.2-5.7-3.1-2.0-.8-4.1-1.5-6.2-1.9-4.4-.9-9.1-.9-13.4,0-6.5,1.3-12.9-2.9-14.2-9.4-1.3-6.5,2.9-12.9,9.4-14.2,7.6-1.6,15.5-1.6,23.1,0,3.7.8,7.3,1.9,10.8,3.4,3.4,1.4,6.7,3.2,9.7,5.3,3.0,2.0,5.9,4.4,8.5,7.0s4.9,5.4,7.0,8.5c2.1,3.1,3.9,6.3,5.3,9.8,1.5,3.5,2.6,7.1,3.4,10.8.8,3.8,1.2,7.7,1.2,11.5s-.4,7.8-1.2,11.5c-.8,3.7-1.9,7.3-3.4,10.8-1.4,3.4-3.2,6.7-5.3,9.7-2.0,3.0-4.4,5.9-7.0,8.5s-5.4,4.9-8.5,7.0c-3.1,2.1-6.3,3.9-9.8,5.3-3.5,1.5-7.1,2.6-10.8,3.4-3.8.8-7.7,1.2-11.5,1.2Z"/><path fill="url(#bm2)" d="M208.1,103.0c-.0-.6-.8-.9-1.2-.5-3.2,3.1-7.6,5.0-12.4,5.0-3.9,0-9.1-1.6-10.2-2.5-.3-.1-.1,1.4-.1,2.5,0,40.5-34.4,73.0-75.5,70.0-33.4-2.5-60.8-28.8-64.4-62.1-1.0-9.4-.2-18.6,2.2-27.0,1.6-5.6,2.6-11.4,2.6-17.3v-22.4c0-3.4-4.3-5.0-6.5-2.4-13.2,15.4-21.6,35.1-22.7,56.6-2.6,54.1,40.6,98.9,94.1,98.9s94.2-42.3,94.2-94.2c0-1.5-.1-3.0-.1-4.5Z"/><path fill="url(#bm2)" d="M201.2,70.1c-14.8-35.8-50.9-60.5-92.3-58.3h-.1c-8.2.5-14.6,7.4-14.6,15.7v.1c0,5.4,4.7,9.6,10.0,8.8,3.2-.5,6.5-.7,9.9-.7,28.7,0,53.5,17.4,64.3,42.1.2.5.9.6,1.2.1,3.2-4.8,8.7-7.9,14.9-7.9,2.0,0,4.0.3,5.8,1.0.6.2,1.1-.4.9-1.0Z"/><circle fill="#00C2FF" cx="194.5" cy="88" r="15.8"/></svg>';var l=".blipit-rb.blipit-rb",kt=`${l}{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:9px;height:40px;padding-inline:5px 17px;border-radius:99px;font:600 14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;color:#fff;background:linear-gradient(135deg,#3882F6,#2F5BEA);box-shadow:0 10px 24px -12px rgba(56,130,246,.8),0 1px 3px rgba(11,26,58,.16),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s}${l}:hover{transform:translateY(-1px);box-shadow:0 16px 32px -12px rgba(56,130,246,.85),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22)}${l}:active{transform:scale(.97)}${l}:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}${l}[aria-busy=true]{cursor:progress}${l}>span{all:unset}${l}>.blipit-rb-m{position:relative;display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px rgba(11,26,58,.08),0 1px 2px rgba(11,26,58,.12)}${l} svg{display:block;width:19px;height:17px}${l}[data-size=sm]{height:32px;gap:7px;padding-inline:4px 13px;font-size:13px}${l}[data-size=sm]>.blipit-rb-m{width:24px;height:24px}${l}[data-size=sm] svg{width:15px;height:13px}${l}[data-variant=outline],${l}[data-variant=ghost]{color:#0B1A3A;background:transparent;box-shadow:inset 0 0 0 1px #CBD7EA}${l}[data-variant=ghost]{box-shadow:none}${l}[data-variant=outline]:hover,${l}[data-variant=ghost]:hover{transform:none;background:rgba(56,130,246,.08);box-shadow:inset 0 0 0 1px rgba(56,130,246,.45)}${l}[data-variant=ghost]:hover{box-shadow:none}${l}[data-theme=dark]{background:linear-gradient(135deg,#5B9BFF,#3D6BF0);box-shadow:0 10px 24px -12px rgba(91,155,255,.7),inset 0 1px 0 rgba(255,255,255,.2)}${l}[data-theme=dark][data-variant=outline],${l}[data-theme=dark][data-variant=ghost]{color:#E8EEF8;background:transparent;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}${l}[data-theme=dark][data-variant=ghost]{box-shadow:none}${l}[data-theme=dark][data-variant=outline]:hover,${l}[data-theme=dark][data-variant=ghost]:hover{background:rgba(91,155,255,.16);box-shadow:inset 0 0 0 1px rgba(91,155,255,.45)}${l}[data-theme=dark][data-variant=ghost]:hover{box-shadow:none}${l}[data-theme=dark]>.blipit-rb-m{box-shadow:0 0 0 1px rgba(255,255,255,.1)}${l}[aria-busy=true] svg{visibility:hidden}${l}[aria-busy=true]>.blipit-rb-m::after{content:"";position:absolute;inset:4px;border:2px solid #3882F6;border-right-color:transparent;border-radius:50%;animation:blipit-rb-r .8s linear infinite}@keyframes blipit-rb-r{to{transform:rotate(1turn)}}@media(pointer:coarse){${l}{min-height:44px}}@media(prefers-reduced-motion:reduce){${l}{transition:none}${l}:hover,${l}:active{transform:none}${l}[aria-busy=true]>.blipit-rb-m::after{animation-duration:3s}}@media(forced-colors:active){${l}{border:1px solid ButtonText}}`,We=0;function De(e,t={}){We||U(document,kt);let n=++We,r=document.createElement("span");r.className="blipit-rb-m",r.innerHTML=Pe.replace(/bm(\d)/g,`bm$1-${n}`);let o=document.createElement("span");o.textContent=e.textContent,e.replaceChildren(r,o),e.classList.add("blipit-rb"),e.setAttribute("data-variant",t.variant==="outline"||t.variant==="ghost"?t.variant:"solid"),e.setAttribute("data-size",t.size==="sm"?"sm":"md"),e.setAttribute("data-theme",pe(t.theme==="light"||t.theme==="dark"?t.theme:void 0))}var b,Ke=new Set;function Ue(e,t){Ke.has(t)||(Ke.add(t),console[e](t))}var wt="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",St="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function Sn(e){if(b)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return Ue("warn",wt);if(t.startsWith("blipit_sk_"))return Ue("error",St);if(b=new H({...e,key:t}),e.sdkChannel==="exact"&&(v.channel=v.exact),v.debug=!!e.debug,e.user){let{id:o,name:i,email:s,username:d}=e.user;b.setUser({id:o===void 0?void 0:String(o),email:s,username:d??i})}Ie(b),e.webVitals!==!1&&typeof window<"u"&&Ne(b.endpoint,t,e.instance);let n=b,r=o=>o&&(n.replay=Fe(o,n.endpoint,t,e.instance));r(e.replay??(typeof window<"u"&&void X(n).then(o=>r(o.replay)))),typeof window<"u"&&ie(b),e.debug&&console.log(`[blipit] ${N}@${E} initialized`)}function En(e){return b?.captureException(e,!0)}function _n(e,t){return b?.captureMessage(e,t)}function Rn(e){return b?.captureSecurity(e)}function $n(e){b?.setUser(e)}function Tn(e,t){b?.setTag(e,t)}function On(e){b?.addBreadcrumb(e)}function Mn(e={}){b&&oe(b,{...e,eventId:e.eventId??b.lastEventId})}function ze(){b&&V(b)}function Cn(e){e.addEventListener("click",t=>{t.preventDefault(),ze()})}function Ln(e={}){let t=Me(e.label,ze);return De(t,e),t}function An(e){b&&Ae(b,e)}function Bn(){return b?.flush()??Promise.resolve()}Le(he);export{On as addBreadcrumb,Cn as attachReport,En as captureException,_n as captureMessage,Rn as captureSecurity,Bn as flush,Sn as init,ze as openReport,Ln as reportButton,pt as setReportMetadata,Tn as setTag,$n as setUser,Mn as showFeedback,An as updateWidget};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blipit/browser",
3
- "version": "0.3.21",
3
+ "version": "0.3.22",
4
4
  "description": "Blipit error monitoring SDK for browsers. Know your app broke before your users tell you.",
5
5
  "license": "MIT",
6
6
  "type": "module",