import{d$ as Ki,e0 as _e,e1 as to,e2 as zr,e3 as Ji,e4 as dr,e5 as C,e6 as fr,e7 as Zi,e8 as Qi,e9 as wn,ea as be,eb as ea,ec as ta,ed as G,ee as En,ef as no,eg as Wr,eh as un,b5 as kn,ei as na,ej as ro,ek as It,el as hr,em as ra,en as sa,eo as so,ep as je,eq as oa,er as ia,es as oo,et as aa,eu as Cn,ev as Tt,ew as Le,ex as In,ey as ca,ez as la,eA as Ce,eB as xn,eC as Mn,eD as pr,eE as io,eF as ao,eG as co,eH as lo,eI as uo,eJ as mr,eK as fo,eL as Vn,eM as ae,eN as ho,eO as ua,eP as da,eQ as fa,eR as ha,eS as po,eT as Y,eU as pa,eV as ma,eW as jr,eX as mo,eY as Je,eZ as _o,e_ as _a,e$ as ga,f0 as ya,f1 as ba,f2 as Sa,f3 as va,f4 as wa,f5 as go,f6 as Ea,f7 as yo,f8 as qr,f9 as ka,fa as Ca,fb as Yn,fc as _r,fd as Ia,fe as xa,ff as Ma,fg as Ra,fh as bo,fi as So,fj as Gr,fk as Ta,fl as Aa,fm as Na,fn as Oa,fo as La,fp as Da,fq as Pa,fr as Fa,fs as Ba,ft as Ha,fu as $a,fv as Ua,fw as za,fx as Wa,fy as ja,fz as qa,fA as Ga,fB as Va,fC as Ya,fD as Xa,fE as Ka,fF as Ja,fG as Za,fH as Qa,fI as ec,fJ as tc,fK as nc,fL as rc,fM as sc,fN as oc,fO as ic,fP as ac,fQ as cc,fR as lc,fS as uc,fT as dc,fU as fc,fV as hc,fW as pc,fX as mc,fY as _c,fZ as gc,f_ as yc,f$ as bc,g0 as Sc,g1 as vc,g2 as wc,g3 as Ec,g4 as kc,g5 as Cc,g6 as Ic,g7 as xc,g8 as Mc,g9 as Rc,ga as Tc,gb as Ac,gc as Nc}from"./index-BbBXKozi.js";function Oc(){return!Ki()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Xn(){return typeof window<"u"&&(!Oc()||Lc())}function Lc(){return _e.process!==void 0&&_e.process.type==="renderer"}function Dc(e,t){let n=0;for(let r=e.length-1;r>=0;r--){const s=e[r];s==="."?e.splice(r,1):s===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}const Pc=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Fc(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Pc.exec(t);return n?n.slice(1):[]}function Vr(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){const s=r>=0?e[r]:"/";s&&(t=`${s}/${t}`,n=s.charAt(0)==="/")}return t=Dc(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Yr(e){let t=0;for(;t<e.length&&e[t]==="";t++);let n=e.length-1;for(;n>=0&&e[n]==="";n--);return t>n?[]:e.slice(t,n-t+1)}function Bc(e,t){e=Vr(e).slice(1),t=Vr(t).slice(1);const n=Yr(e.split("/")),r=Yr(t.split("/")),s=Math.min(n.length,r.length);let o=s;for(let c=0;c<s;c++)if(n[c]!==r[c]){o=c;break}let i=[];for(let c=o;c<n.length;c++)i.push("..");return i=i.concat(r.slice(o)),i.join("/")}function Hc(e,t){return Fc(e)[2]||""}function $c(e,t){return e??t()}function en(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],o=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=o(n)):(s==="call"||s==="optionalCall")&&(n=o((...i)=>n.call(t,...i)),t=void 0)}return n}function Uc(){to()}const Xr=100,Kr=5e3,zc=36e5;function Wc(e){function t(...n){dr&&C.info("[Offline]:",...n)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const s=n.createStore(n);let o=Kr,i;function c(l,p,f){return zr(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,p,f):!0}function a(l){i&&clearTimeout(i),i=setTimeout(async()=>{i=void 0;const p=await s.shift();p&&(t("Attempting to send previously queued event"),p[0].sent_at=new Date().toISOString(),d(p,!0).catch(f=>{t("Failed to retry sending",f)}))},l),typeof i!="number"&&i.unref&&i.unref()}function u(){i||(a(o),o=Math.min(o*2,zc))}async function d(l,p=!1){if(!p&&zr(l,["replay_event","replay_recording"]))return await s.push(l),a(Xr),{};try{const f=await r.send(l);let m=Xr;if(f){if(f.headers&&f.headers["retry-after"])m=Ji(f.headers["retry-after"]);else if(f.headers&&f.headers["x-sentry-rate-limits"])m=6e4;else if((f.statusCode||0)>=400)return f}return a(m),o=Kr,f}catch(f){if(await c(l,f,o))return p?await s.unshift(l):await s.push(l),u(),t("Error sending. Event queued.",f),{};throw f}}return n.flushAtStartup&&u(),{send:d,flush:l=>r.flush(l)}}}function vo(e,t){let n;return wn(e,(r,s)=>(t.includes(s)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function jc(e,t){return n=>{const r=e(n);return{...r,send:async s=>{const o=vo(s,["event","transaction","profile","replay_event"]);return o&&(o.release=t),r.send(s)}}}}function qc(e,t){return fr(t?{...e[0],dsn:t}:e[0],e[1])}function Gc(e,t){return n=>{const r=e(n),s=new Map;function o(a,u){const d=u?`${a}:${u}`:a;let l=s.get(d);if(!l){const p=Zi(a);if(!p)return;const f=Qi(p,n.tunnel);l=u?jc(e,u)({...n,url:f}):e({...n,url:f}),s.set(d,l)}return[a,l]}async function i(a){function u(f){const m=f&&f.length?f:["event"];return vo(a,m)}const d=t({envelope:a,getEvent:u}).map(f=>typeof f=="string"?o(f,void 0):o(f.dsn,f.release)).filter(f=>!!f),l=d.length?d:[["",r]];return(await Promise.all(l.map(([f,m])=>m.send(qc(a,f)))))[0]}async function c(a){const u=[...s.values(),r];return(await Promise.all(u.map(l=>l.flush(a)))).every(l=>l)}return{send:i,flush:c}}}function wo(e,t){const n=t&&t.getDsn(),r=t&&t.getOptions().tunnel;return Yc(e,n)||Vc(e,r)}function Vc(e,t){return t?Jr(e)===Jr(t):!1}function Yc(e,t){return t?e.includes(t.host):!1}function Jr(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Xc(e,...t){const n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}const Eo=new Map,Zr=new Set;function Kc(e){if(_e._sentryModuleMetadata)for(const t of Object.keys(_e._sentryModuleMetadata)){const n=_e._sentryModuleMetadata[t];if(Zr.has(t))continue;Zr.add(t);const r=e(t);for(const s of r.reverse())if(s.filename){Eo.set(s.filename,n);break}}}function Jc(e,t){return Kc(e),Eo.get(t)}function ko(e,t){try{t.exception.values.forEach(n=>{if(n.stacktrace)for(const r of n.stacktrace.frames||[]){if(!r.filename||r.module_metadata)continue;const s=Jc(e,r.filename);s&&(r.module_metadata=s)}})}catch{}}function Co(e){try{e.exception.values.forEach(t=>{if(t.stacktrace)for(const n of t.stacktrace.frames||[])delete n.module_metadata})}catch{}}const Zc="ModuleMetadata",Qc=()=>({name:Zc,setup(e){e.on("beforeEnvelope",t=>{wn(t,(n,r)=>{if(r==="event"){const s=Array.isArray(n)?n[1]:void 0;s&&(Co(s),n[1]=s)}})})},processEvent(e,t,n){const r=n.getOptions().stackParser;return ko(r,e),e}}),el=be(Qc),tl="CaptureConsole",nl=(e={})=>{const t=e.levels||ea;return{name:tl,setup(n){"console"in _e&&ta(({args:r,level:s})=>{G()!==n||!t.includes(s)||sl(r,s)})}}},rl=be(nl);function sl(e,t){const n={level:na(t),extra:{arguments:e}};En(r=>{if(r.addEventProcessor(i=>(i.logger="console",no(i,{handled:!1,type:"console"}),i)),t==="assert"){if(!e[0]){const i=`Assertion failed: ${Wr(e.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",e.slice(1)),un(i,n)}return}const s=e.find(i=>i instanceof Error);if(s){kn(s,n);return}const o=Wr(e," ");un(o,n)})}const ol="Debug",il=(e={})=>{const t={debugger:!1,stringify:!1,...e};return{name:ol,setup(n){n.on("beforeSendEvent",(r,s)=>{if(t.debugger)debugger;ro(()=>{t.stringify?(console.log(JSON.stringify(r,null,2)),s&&Object.keys(s).length&&console.log(JSON.stringify(s,null,2))):(console.log(r),s&&Object.keys(s).length&&console.log(s))})})}}},al=be(il),cl="ExtraErrorData",ll=(e={})=>{const{depth:t=3,captureErrorCause:n=!0}=e;return{name:cl,processEvent(r,s,o){const{maxValueLength:i=250}=o.getOptions();return dl(r,s,t,n,i)}}},ul=be(ll);function dl(e,t={},n,r,s){if(!t.originalException||!It(t.originalException))return e;const o=t.originalException.name||t.originalException.constructor.name,i=fl(t.originalException,r,s);if(i){const c={...e.contexts},a=hr(i,n);return ra(a)&&(sa(a,"__sentry_skip_normalization__",!0),c[o]=a),{...e,contexts:c}}return e}function fl(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],s={};for(const o of Object.keys(e)){if(r.indexOf(o)!==-1)continue;const i=e[o];s[o]=It(i)||typeof i=="string"?so(`${i}`,n):i}if(t&&e.cause!==void 0&&(s.cause=It(e.cause)?e.cause.toString():e.cause),typeof e.toJSON=="function"){const o=e.toJSON();for(const i of Object.keys(o)){const c=o[i];s[i]=It(c)?c.toString():c}}return s}catch(r){dr&&C.error("Unable to extract extra data from the Error object:",r)}return null}const hl="RewriteFrames",pl=be((e={})=>{const t=e.root,n=e.prefix||"app:///",r="window"in _e&&_e.window!==void 0,s=e.iteratee||ml({isBrowser:r,root:t,prefix:n});function o(c){try{return{...c,exception:{...c.exception,values:c.exception.values.map(a=>({...a,...a.stacktrace&&{stacktrace:i(a.stacktrace)}}))}}}catch{return c}}function i(c){return{...c,frames:c&&c.frames&&c.frames.map(a=>s(a))}}return{name:hl,processEvent(c){let a=c;return c.exception&&Array.isArray(c.exception.values)&&(a=o(a)),a}}});function ml({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;const s=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),o=/^\//.test(r.filename);if(e){if(t){const i=r.filename;i.indexOf(t)===0&&(r.filename=i.replace(t,n))}}else if(s||o){const i=s?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,c=t?Bc(t,i):Hc(i);r.filename=`${n}${c}`}return r}}const _l="SessionTiming",gl=()=>{const e=je()*1e3;return{name:_l,processEvent(t){const n=je()*1e3;return{...t,extra:{...t.extra,"session:start":e,"session:duration":n-e,"session:end":n}}}}},yl=be(gl),bl=10,Sl="ZodErrors";function vl(e){return It(e)&&e.name==="ZodError"&&Array.isArray(e.errors)}function wl(e){return{...e,path:"path"in e&&Array.isArray(e.path)?e.path.join("."):void 0,keys:"keys"in e?JSON.stringify(e.keys):void 0,unionErrors:"unionErrors"in e?JSON.stringify(e.unionErrors):void 0}}function El(e){const t=new Set;for(const r of e.issues)r.path&&r.path[0]&&t.add(r.path[0]);const n=Array.from(t);return`Failed to validate keys: ${so(n.join(", "),100)}`}function kl(e,t,n){return!t.exception||!t.exception.values||!n||!n.originalException||!vl(n.originalException)||n.originalException.issues.length===0?t:{...t,exception:{...t.exception,values:[{...t.exception.values[0],value:El(n.originalException)},...t.exception.values.slice(1)]},extra:{...t.extra,"zoderror.issues":n.originalException.errors.slice(0,e).map(wl)}}}const Cl=(e={})=>{const t=e.limit||bl;return{name:Sl,processEvent(n,r){return kl(t,n,r)}}},Il=be(Cl),xl=be(e=>({name:"ThirdPartyErrorsFilter",setup(t){t.on("beforeEnvelope",n=>{wn(n,(r,s)=>{if(s==="event"){const o=Array.isArray(r)?r[1]:void 0;o&&(Co(o),r[1]=o)}})})},processEvent(t,n,r){const s=r.getOptions().stackParser;ko(s,t);const o=Ml(t);if(o){const i=e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(o[i](a=>!a.some(u=>e.filterKeys.includes(u)))){if(e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="drop-error-if-exclusively-contains-third-party-frames")return null;t.tags={...t.tags,third_party_code:!0}}}return t}}));function Ml(e){const t=oa(e);if(t)return t.filter(n=>!!n.filename).map(n=>n.module_metadata?Object.keys(n.module_metadata).filter(r=>r.startsWith(Qr)).map(r=>r.slice(Qr.length)):[])}const Qr="_sentryBundlerPluginAppKey:",Io="c",xo="g",gr="s",Mo="d",Rl=5e3;function Ro(e,t){const n=ia("globalMetricsAggregators",()=>new WeakMap),r=n.get(e);if(r)return r;const s=new t(e);return e.on("flush",()=>s.flush()),e.on("close",()=>s.close()),n.set(e,s),s}function Rn(e,t,n,r,s={}){const o=s.client||G();if(!o)return;const i=Cn(),c=i?Tt(i):void 0,a=c&&Le(c).description,{unit:u,tags:d,timestamp:l}=s,{release:p,environment:f}=o.getOptions(),m={};p&&(m.release=p),f&&(m.environment=f),a&&(m.transaction=a),dr&&C.log(`Adding value of ${r} to ${t} metric ${n}`),Ro(o,e).add(t,n,r,u,{...m,...d},l)}function Tl(e,t,n=1,r){Rn(e,Io,t,yr(n),r)}function Kn(e,t,n,r){Rn(e,Mo,t,yr(n),r)}function Al(e,t,n,r="second",s){if(typeof n=="function"){const o=je();return oo({op:"metrics.timing",name:t,startTime:o,onlyIfParent:!0},i=>aa(()=>n(),()=>{},()=>{const c=je(),a=c-o;Kn(e,t,a,{...s,unit:"second"}),i.end(c)}))}Kn(e,t,n,{...s,unit:r})}function Nl(e,t,n,r){Rn(e,gr,t,n,r)}function Ol(e,t,n,r){Rn(e,xo,t,yr(n),r)}const Pt={increment:Tl,distribution:Kn,set:Nl,gauge:Ol,timing:Al,getMetricsAggregatorForClient:Ro};function yr(e){return typeof e=="string"?parseInt(e):e}function Ll(e,t,n,r){const s=Object.entries(In(r)).sort((o,i)=>o[0].localeCompare(i[0]));return`${e}${t}${n}${s}`}function Dl(e){let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return t>>>0}function Pl(e){let t="";for(const n of e){const r=Object.entries(n.tags),s=r.length>0?`|#${r.map(([o,i])=>`${o}:${i}`).join(",")}`:"";t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${s}|T${n.timestamp} `}return t}function Fl(e){return e.replace(/[^\w]+/gi,"_")}function Bl(e){return e.replace(/[^\w\-.]+/gi,"_")}function Hl(e){return e.replace(/[^\w\-./]+/gi,"")}const $l=[[` `,"\\n"],["\r","\\r"],[" ","\\t"],["\\","\\\\"],["|","\\u{7c}"],[",","\\u{2c}"]];function Ul(e){for(const[t,n]of $l)if(e===t)return n;return e}function zl(e){return[...e].reduce((t,n)=>t+Ul(n),"")}function Wl(e){const t={};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const r=Hl(n);t[r]=zl(String(e[n]))}return t}function jl(e,t){C.log(`Flushing aggregated metrics, number of metrics: ${t.length}`);const n=e.getDsn(),r=e.getSdkMetadata(),s=e.getOptions().tunnel,o=ql(t,n,r,s);e.sendEnvelope(o)}function ql(e,t,n,r){const s={sent_at:new Date().toISOString()};n&&n.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),r&&t&&(s.dsn=ca(t));const o=Gl(e);return fr(s,[o])}function Gl(e){const t=Pl(e);return[{type:"statsd",length:t.length},t]}class Vl{constructor(t){this._value=t}get weight(){return 1}add(t){this._value+=t}toString(){return`${this._value}`}}class Yl{constructor(t){this._last=t,this._min=t,this._max=t,this._sum=t,this._count=1}get weight(){return 5}add(t){this._last=t,t<this._min&&(this._min=t),t>this._max&&(this._max=t),this._sum+=t,this._count++}toString(){return`${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`}}class Xl{constructor(t){this._value=[t]}get weight(){return this._value.length}add(t){this._value.push(t)}toString(){return this._value.join(":")}}class Kl{constructor(t){this.first=t,this._value=new Set([t])}get weight(){return this._value.size}add(t){this._value.add(t)}toString(){return Array.from(this._value).map(t=>typeof t=="string"?Dl(t):t).join(":")}}const Jl={[Io]:Vl,[xo]:Yl,[Mo]:Xl,[gr]:Kl};class Ft{constructor(t){this._client=t,this._buckets=new Map,this._interval=setInterval(()=>this.flush(),Rl)}add(t,n,r,s="none",o={},i=je()){const c=Math.floor(i),a=Bl(n),u=Wl(o),d=Fl(s),l=Ll(t,a,d,u);let p=this._buckets.get(l);const f=p&&t===gr?p.metric.weight:0;p?(p.metric.add(r),p.timestamp<c&&(p.timestamp=c)):(p={metric:new Jl[t](r),timestamp:c,metricType:t,name:a,unit:d,tags:u},this._buckets.set(l,p));const m=typeof r=="string"?p.metric.weight-f:r;la(t,a,m,d,o,l)}flush(){if(this._buckets.size===0)return;const t=Array.from(this._buckets.values());jl(this._client,t),this._buckets.clear()}close(){clearInterval(this._interval),this.flush()}}function To(e,t={},n=Ce()){const{message:r,name:s,email:o,url:i,source:c,associatedEventId:a,tags:u}=e,d={contexts:{feedback:In({contact_email:o,name:s,message:r,url:i,source:c,associated_event_id:a})},type:"feedback",level:"info",tags:u},l=n&&n.getClient()||G();return l&&l.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}function Zl(){return{bindClient(e){Ce().setClient(e)},withScope:En,getClient:()=>G(),getScope:Ce,getIsolationScope:xn,captureException:(e,t)=>Ce().captureException(e,t),captureMessage:(e,t,n)=>Ce().captureMessage(e,t,n),captureEvent:Mn,addBreadcrumb:pr,setUser:io,setTags:ao,setTag:co,setExtra:lo,setExtras:uo,setContext:mr,getIntegration(e){const t=G();return t&&t.getIntegrationByName(e.id)||null},startSession:fo,endSession:Vn,captureSession(e){if(e)return Vn();eu()}}}const Ql=Zl;function eu(){const e=Ce(),t=G(),n=e.getSession();t&&n&&t.captureSession(n)}const tu={replayIntegration:"replay",replayCanvasIntegration:"replay-canvas",feedbackIntegration:"feedback",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot",captureConsoleIntegration:"captureconsole",contextLinesIntegration:"contextlines",linkedErrorsIntegration:"linkederrors",debugIntegration:"debug",dedupeIntegration:"dedupe",extraErrorDataIntegration:"extraerrordata",httpClientIntegration:"httpclient",reportingObserverIntegration:"reportingobserver",rewriteFramesIntegration:"rewriteframes",sessionTimingIntegration:"sessiontiming",browserProfilingIntegration:"browserprofiling"},es=ae;async function br(e){const t=tu[e],n=es.Sentry=es.Sentry||{};if(!t)throw new Error(`Cannot lazy load integration: ${e}`);const r=n[e];if(typeof r=="function")return r;const s=nu(t),o=ae.document.createElement("script");o.src=s,o.crossOrigin="anonymous",o.referrerPolicy="origin";const i=new Promise((a,u)=>{o.addEventListener("load",()=>a()),o.addEventListener("error",u)});ae.document.body.appendChild(o);try{await i}catch{throw new Error(`Error when loading integration: ${e}`)}const c=n[e];if(typeof c!="function")throw new Error(`Could not load integration: ${e}`);return c}function nu(e){const t=G(),n=t&&t.getOptions(),r=n&&n.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${ho}/${e}.min.js`,r).toString()}const ru=_e,su="ReportingObserver",ts=new WeakMap,ou=(e={})=>{const t=e.types||["crash","deprecation","intervention"];function n(r){if(ts.has(G()))for(const s of r)En(o=>{o.setExtra("url",s.url);const i=`ReportingObserver [${s.type}]`;let c="No details available";if(s.body){const a={};for(const u in s.body)a[u]=s.body[u];if(o.setExtra("body",a),s.type==="crash"){const u=s.body;c=[u.crashId||"",u.reason||""].join(" ").trim()||c}else c=s.body.message||c}un(`${i}: ${c}`)})}return{name:su,setupOnce(){if(!ua())return;new ru.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(r){ts.set(r,!0)}}},iu=be(ou),au="HttpClient",cu=(e={})=>{const t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:au,setup(n){gu(n,t),yu(n,t)}}},lu=be(cu);function uu(e,t,n,r){if(No(e,n.status,n.url)){const s=bu(t,r);let o,i,c,a;Lo()&&([o,c]=ns("Cookie",s),[i,a]=ns("Set-Cookie",n));const u=Oo({url:s.url,method:s.method,status:n.status,requestHeaders:o,responseHeaders:i,requestCookies:c,responseCookies:a});Mn(u)}}function ns(e,t){const n=hu(t.headers);let r;try{const s=n[e]||n[e.toLowerCase()]||void 0;s&&(r=Ao(s))}catch{Y&&C.log(`Could not extract cookies from header ${e}`)}return[n,r]}function du(e,t,n,r){if(No(e,t.status,t.responseURL)){let s,o,i;if(Lo()){try{const a=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;a&&(o=Ao(a))}catch{Y&&C.log("Could not extract cookies from response headers")}try{i=pu(t)}catch{Y&&C.log("Could not extract headers from response")}s=r}const c=Oo({url:t.responseURL,method:n,status:t.status,requestHeaders:s,responseHeaders:i,responseCookies:o});Mn(c)}}function fu(e){if(e){const t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function Ao(e){return e.split("; ").reduce((t,n)=>{const[r,s]=n.split("=");return r&&s&&(t[r]=s),t},{})}function hu(e){const t={};return e.forEach((n,r)=>{t[r]=n}),t}function pu(e){const t=e.getAllResponseHeaders();return t?t.split(`\r `).reduce((n,r)=>{const[s,o]=r.split(": ");return s&&o&&(n[s]=o),n},{}):{}}function mu(e,t){return e.some(n=>typeof n=="string"?t.includes(n):n.test(t))}function _u(e,t){return e.some(n=>typeof n=="number"?n===t:t>=n[0]&&t<=n[1])}function gu(e,t){da()&&fa(n=>{if(G()!==e)return;const{response:r,args:s}=n,[o,i]=s;r&&uu(t,o,r,i)})}function yu(e,t){"XMLHttpRequest"in _e&&ha(n=>{if(G()!==e)return;const r=n.xhr,s=r[po];if(!s)return;const{method:o,request_headers:i}=s;try{du(t,r,o,i)}catch(c){Y&&C.warn("Error while extracting response event form XHR response",c)}})}function No(e,t,n){return _u(e.failedRequestStatusCodes,t)&&mu(e.failedRequestTargets,n)&&!wo(n,G())}function Oo(e){const t=`HTTP Client Error with status code: ${e.status}`,n={message:t,exception:{values:[{type:"Error",value:t}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:fu(e.responseHeaders)}}};return no(n,{type:"http.client",handled:!1}),n}function bu(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function Lo(){const e=G();return e?!!e.getOptions().sendDefaultPii:!1}const Hn=_e,Su=7,vu="ContextLines",wu=(e={})=>{const t=e.frameContextLines!=null?e.frameContextLines:Su;return{name:vu,processEvent(n){return ku(n,t)}}},Eu=be(wu);function ku(e,t){const n=Hn.document,r=Hn.location&&pa(Hn.location.href);if(!n||!r)return e;const s=e.exception&&e.exception.values;if(!s||!s.length)return e;const o=n.documentElement.innerHTML;if(!o)return e;const i=["<!DOCTYPE html>","<html>",...o.split(` `),"</html>"];return s.forEach(c=>{const a=c.stacktrace;a&&a.frames&&(a.frames=a.frames.map(u=>Cu(u,i,r,t)))}),e}function Cu(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||ma(t,e,r),e}const q=_e,Sr="sentryReplaySession",Iu="replay_event",vr="Unable to send Replay",xu=3e5,Mu=9e5,Ru=5e3,Tu=5500,Au=6e4,Nu=5e3,Ou=3,rs=15e4,jt=5e3,Lu=3e3,Du=300,wr=2e7,Pu=4999,Fu=15e3,ss=36e5;function Bu(e,t){return e??t()}function dn(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],o=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=o(n)):(s==="call"||s==="optionalCall")&&(n=o((...i)=>n.call(t,...i)),t=void 0)}return n}var ie;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(ie||(ie={}));function Hu(e){return e.nodeType===e.ELEMENT_NODE}function xt(e){const t=dn([e,"optionalAccess",n=>n.host]);return dn([t,"optionalAccess",n=>n.shadowRoot])===e}function Mt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function $u(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function Uu(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function fn(e){try{const t=e.rules||e.cssRules;return t?$u(Array.from(t,Do).join("")):null}catch{return null}}function Do(e){let t;if(Wu(e))try{t=fn(e.styleSheet)||Uu(e)}catch{}else if(ju(e)&&e.selectorText.includes(":"))return zu(e.cssText);return t||e.cssText}function zu(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Wu(e){return"styleSheet"in e}function ju(e){return"selectorText"in e}class Po{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){if(!t)return-1;const n=dn([this,"access",r=>r.getMeta,"call",r=>r(t),"optionalAccess",r=>r.id]);return Bu(n,()=>-1)}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function qu(){return new Po}function Tn({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function At({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function mt(e){return e.toLowerCase()}function Jn(e){return e.toUpperCase()}const os="__rrweb_original__";function Gu(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let s=0;s<e.height;s+=n){const o=t.getImageData,i=os in o?o[os]:o;if(new Uint32Array(i.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function Er(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?mt(t):null}function hn(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}let Vu=1;const Yu=new RegExp("[^a-z0-9-_:]"),Nt=-2;function kr(){return Vu++}function Xu(e){if(e instanceof HTMLFormElement)return"form";const t=mt(e.tagName);return Yu.test(t)?"div":t}function Ku(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let st,is;const Ju=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Zu=/^(?:[a-z+]+:)?\/\//i,Qu=/^www\..*/i,ed=/^(data:)([^,]*),(.*)/i;function pn(e,t){return(e||"").replace(Ju,(n,r,s,o,i,c)=>{const a=s||i||c,u=r||o||"";if(!a)return n;if(Zu.test(a)||Qu.test(a))return`url(${u}${a}${u})`;if(ed.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${Ku(t)+a}${u})`;const d=t.split("/"),l=a.split("/");d.pop();for(const p of l)p!=="."&&(p===".."?d.pop():d.push(p));return`url(${u}${d.join("/")}${u})`})}const td=/^[^ \t\n\r\u000c]+/,nd=/^[, \t\n\r\u000c]+/;function rd(e,t){if(t.trim()==="")return t;let n=0;function r(o){let i;const c=o.exec(t.substring(n));return c?(i=c[0],n+=i.length,i):""}const s=[];for(;r(nd),!(n>=t.length);){let o=r(td);if(o.slice(-1)===",")o=ct(e,o.substring(0,o.length-1)),s.push(o);else{let i="";o=ct(e,o);let c=!1;for(;;){const a=t.charAt(n);if(a===""){s.push((o+i).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){n+=1,s.push((o+i).trim());break}else a==="("&&(c=!0);i+=a,n+=1}}}return s.join(", ")}function ct(e,t){if(!t||t.trim()==="")return t;const n=e.createElement("a");return n.href=t,n.href}function sd(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Cr(){const e=document.createElement("a");return e.href="",e.href}function Fo(e,t,n,r,s,o){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(t==="table"||t==="td"||t==="th")?ct(e,r):n==="srcset"?rd(e,r):n==="style"?pn(r,Cr()):t==="object"&&n==="data"?ct(e,r):typeof o=="function"?o(n,r,s):r)}function Bo(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function od(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const o=e.classList[s];if(t.test(o))return!0}if(n)return e.matches(n)}catch{}return!1}function id(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Ye(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Ye(e.parentNode,t,n,r+1)}function lt(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(id(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function _t(e,t,n,r,s,o){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(i.tagName==="INPUT"){const u=i.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let c=-1,a=-1;if(o){if(a=Ye(i,lt(r,s)),a<0)return!0;c=Ye(i,lt(t,n),a>=0?a:1/0)}else{if(c=Ye(i,lt(t,n)),c<0)return!1;a=Ye(i,lt(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!o}catch{}return!!o}function ad(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){const c=setTimeout(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{clearTimeout(c),s=!0,t()});return}const i="about:blank";if(r.location.href!==i||e.src===i||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function cd(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const o=setTimeout(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{clearTimeout(o),r=!0,t()})}function ld(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:p,inlineStylesheet:f,maskInputOptions:m={},maskTextFn:y,maskInputFn:w,dataURLOptions:_={},inlineImages:v,recordCanvas:I,keepIframeSrcFn:b,newlyAddedElement:k=!1}=t,E=ud(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ie.Document,childNodes:[],compatMode:e.compatMode}:{type:ie.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ie.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:E};case e.ELEMENT_NODE:return fd(e,{doc:n,blockClass:s,blockSelector:o,unblockSelector:i,inlineStylesheet:f,maskAttributeFn:a,maskInputOptions:m,maskInputFn:w,dataURLOptions:_,inlineImages:v,recordCanvas:I,keepIframeSrcFn:b,newlyAddedElement:k,rootId:E,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:p});case e.TEXT_NODE:return dd(e,{maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:p,maskTextFn:y,maskInputOptions:m,maskInputFn:w,rootId:E});case e.CDATA_SECTION_NODE:return{type:ie.CDATA,textContent:"",rootId:E};case e.COMMENT_NODE:return{type:ie.Comment,textContent:e.textContent||"",rootId:E};default:return!1}}function ud(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function dd(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:o,unmaskTextSelector:i,maskTextFn:c,maskInputOptions:a,maskInputFn:u,rootId:d}=t,l=e.parentNode&&e.parentNode.tagName;let p=e.textContent;const f=l==="STYLE"?!0:void 0,m=l==="SCRIPT"?!0:void 0,y=l==="TEXTAREA"?!0:void 0;if(f&&p){try{e.nextSibling||e.previousSibling||dn([e,"access",_=>_.parentNode,"access",_=>_.sheet,"optionalAccess",_=>_.cssRules])&&(p=fn(e.parentNode.sheet))}catch(_){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${_}`,e)}p=pn(p,Cr())}m&&(p="SCRIPT_PLACEHOLDER");const w=_t(e,r,o,s,i,n);if(!f&&!m&&!y&&p&&w&&(p=c?c(p,e.parentElement):p.replace(/[\S]/g,"*")),y&&p&&(a.textarea||w)&&(p=u?u(p,e.parentNode):p.replace(/[\S]/g,"*")),l==="OPTION"&&p){const _=Tn({type:null,tagName:l,maskInputOptions:a});p=At({isMasked:_t(e,r,o,s,i,_),element:e,value:p,maskInputFn:u})}return{type:ie.Text,textContent:p||"",isStyle:f,rootId:d}}function fd(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:o,inlineStylesheet:i,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,rootId:y,maskAllText:w,maskTextClass:_,unmaskTextClass:v,maskTextSelector:I,unmaskTextSelector:b}=t,k=od(e,r,s,o),E=Xu(e);let g={};const x=e.attributes.length;for(let S=0;S<x;S++){const R=e.attributes[S];R.name&&!Bo(E,R.name,R.value)&&(g[R.name]=Fo(n,E,mt(R.name),R.value,e,a))}if(E==="link"&&i){const S=Array.from(n.styleSheets).find(P=>P.href===e.href);let R=null;S&&(R=fn(S)),R&&(delete g.rel,delete g.href,g._cssText=pn(R,S.href))}if(E==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const S=fn(e.sheet);S&&(g._cssText=pn(S,Cr()))}if(E==="input"||E==="textarea"||E==="select"||E==="option"){const S=e,R=Er(S),P=hn(S,Jn(E),R),K=S.checked;if(R!=="submit"&&R!=="button"&&P){const V=_t(S,_,I,v,b,Tn({type:R,tagName:Jn(E),maskInputOptions:c}));g.value=At({isMasked:V,element:S,value:P,maskInputFn:u})}K&&(g.checked=K)}if(E==="option"&&(e.selected&&!c.select?g.selected=!0:delete g.selected),E==="canvas"&&p){if(e.__context==="2d")Gu(e)||(g.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const S=e.toDataURL(d.type,d.quality),R=document.createElement("canvas");R.width=e.width,R.height=e.height;const P=R.toDataURL(d.type,d.quality);S!==P&&(g.rr_dataURL=S)}}if(E==="img"&&l){st||(st=n.createElement("canvas"),is=st.getContext("2d"));const S=e,R=S.crossOrigin;S.crossOrigin="anonymous";const P=()=>{S.removeEventListener("load",P);try{st.width=S.naturalWidth,st.height=S.naturalHeight,is.drawImage(S,0,0),g.rr_dataURL=st.toDataURL(d.type,d.quality)}catch(K){console.warn(`Cannot inline img src=${S.currentSrc}! Error: ${K}`)}R?g.crossOrigin=R:S.removeAttribute("crossorigin")};S.complete&&S.naturalWidth!==0?P():S.addEventListener("load",P)}if((E==="audio"||E==="video")&&(g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),k){const{width:S,height:R}=e.getBoundingClientRect();g={class:g.class,rr_width:`${S}px`,rr_height:`${R}px`}}E==="iframe"&&!f(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let M;try{customElements.get(E)&&(M=!0)}catch{}return{type:ie.Element,tagName:E,attributes:g,childNodes:[],isSVG:sd(e)||void 0,needBlock:k,rootId:y,isCustom:M}}function j(e){return e==null?"":e.toLowerCase()}function hd(e,t){if(t.comment&&e.type===ie.Comment)return!0;if(e.type===ie.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(j(e.attributes.name).match(/^msapplication-tile(image|color)$/)||j(e.attributes.name)==="application-name"||j(e.attributes.rel)==="icon"||j(e.attributes.rel)==="apple-touch-icon"||j(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&j(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(j(e.attributes.property).match(/^(og|twitter|fb):/)||j(e.attributes.name).match(/^(og|twitter):/)||j(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(j(e.attributes.name)==="robots"||j(e.attributes.name)==="googlebot"||j(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(j(e.attributes.name)==="author"||j(e.attributes.name)==="generator"||j(e.attributes.name)==="framework"||j(e.attributes.name)==="publisher"||j(e.attributes.name)==="progid"||j(e.attributes.property).match(/^article:/)||j(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(j(e.attributes.name)==="google-site-verification"||j(e.attributes.name)==="yandex-verification"||j(e.attributes.name)==="csrf-token"||j(e.attributes.name)==="p:domain_verify"||j(e.attributes.name)==="verify-v1"||j(e.attributes.name)==="verification"||j(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ut(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:p=!1,inlineStylesheet:f=!0,maskInputOptions:m={},maskAttributeFn:y,maskTextFn:w,maskInputFn:_,slimDOMOptions:v,dataURLOptions:I={},inlineImages:b=!1,recordCanvas:k=!1,onSerialize:E,onIframeLoad:g,iframeLoadTimeout:x=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:R=()=>!1,newlyAddedElement:P=!1}=t;let{preserveWhiteSpace:K=!0}=t;const V=ld(e,{doc:n,mirror:r,blockClass:s,blockSelector:o,maskAllText:c,unblockSelector:i,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:y,maskTextFn:w,maskInputFn:_,dataURLOptions:I,inlineImages:b,recordCanvas:k,keepIframeSrcFn:R,newlyAddedElement:P});if(!V)return console.warn(e,"not serialized"),null;let se;r.hasNode(e)?se=r.getId(e):hd(V,v)||!K&&V.type===ie.Text&&!V.isStyle&&!V.textContent.replace(/^\s+|\s+$/gm,"").length?se=Nt:se=kr();const L=Object.assign(V,{id:se});if(r.add(e,L),se===Nt)return null;E&&E(e);let ce=!p;if(L.type===ie.Element){ce=ce&&!L.needBlock,delete L.needBlock;const F=e.shadowRoot;F&&Mt(F)&&(L.isShadowHost=!0)}if((L.type===ie.Document||L.type===ie.Element)&&ce){v.headWhitespace&&L.type===ie.Element&&L.tagName==="head"&&(K=!1);const F={doc:n,mirror:r,blockClass:s,blockSelector:o,maskAllText:c,unblockSelector:i,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:p,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:y,maskTextFn:w,maskInputFn:_,slimDOMOptions:v,dataURLOptions:I,inlineImages:b,recordCanvas:k,preserveWhiteSpace:K,onSerialize:E,onIframeLoad:g,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:S,keepIframeSrcFn:R};for(const Z of Array.from(e.childNodes)){const fe=ut(Z,F);fe&&L.childNodes.push(fe)}if(Hu(e)&&e.shadowRoot)for(const Z of Array.from(e.shadowRoot.childNodes)){const fe=ut(Z,F);fe&&(Mt(e.shadowRoot)&&(fe.isShadow=!0),L.childNodes.push(fe))}}return e.parentNode&&xt(e.parentNode)&&Mt(e.parentNode)&&(L.isShadow=!0),L.type===ie.Element&&L.tagName==="iframe"&&ad(e,()=>{const F=e.contentDocument;if(F&&g){const Z=ut(F,{doc:F,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:y,maskTextFn:w,maskInputFn:_,slimDOMOptions:v,dataURLOptions:I,inlineImages:b,recordCanvas:k,preserveWhiteSpace:K,onSerialize:E,onIframeLoad:g,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:S,keepIframeSrcFn:R});Z&&g(e,Z)}},x),L.type===ie.Element&&L.tagName==="link"&&L.attributes.rel==="stylesheet"&&cd(e,()=>{if(M){const F=ut(e,{doc:n,mirror:r,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:y,maskTextFn:w,maskInputFn:_,slimDOMOptions:v,dataURLOptions:I,inlineImages:b,recordCanvas:k,preserveWhiteSpace:K,onSerialize:E,onIframeLoad:g,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:S,keepIframeSrcFn:R});F&&M(e,F)}},S),L}function pd(e,t){const{mirror:n=new Po,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:o=null,maskAllText:i=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:p=!1,recordCanvas:f=!1,maskAllInputs:m=!1,maskAttributeFn:y,maskTextFn:w,maskInputFn:_,slimDOM:v=!1,dataURLOptions:I,preserveWhiteSpace:b,onSerialize:k,onIframeLoad:E,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:M,keepIframeSrcFn:S=()=>!1}=t||{};return ut(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:o,maskAllText:i,maskTextClass:c,unmaskTextClass:a,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:l,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:y,maskTextFn:w,maskInputFn:_,slimDOMOptions:v===!0||v==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:I,inlineImages:p,recordCanvas:f,preserveWhiteSpace:b,onSerialize:k,onIframeLoad:E,iframeLoadTimeout:g,onStylesheetLoad:x,stylesheetLoadTimeout:M,keepIframeSrcFn:S,newlyAddedElement:!1})}function Fe(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],o=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=o(n)):(s==="call"||s==="optionalCall")&&(n=o((...i)=>n.call(t,...i)),t=void 0)}return n}function de(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const it=`Please stop import mirror directly. Instead of that,\r now you can use replayer.getMirror() to access the mirror instance of a replayer,\r or you can use record.mirror to access the mirror instance during recording.`;let as={map:{},getId(){return console.error(it),-1},getNode(){return console.error(it),null},removeNodeFromMap(){console.error(it)},has(){return console.error(it),!1},reset(){console.error(it)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(as=new Proxy(as,{get(e,t,n){return t==="map"&&console.error(it),Reflect.get(e,t,n)}}));function Ot(e,t,n={}){let r=null,s=0;return function(...o){const i=Date.now();!s&&n.leading===!1&&(s=i);const c=t-(i-s),a=this;c<=0||c>t?(r&&(vd(r),r=null),s=i,e.apply(a,o)):!r&&n.trailing!==!1&&(r=An(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,o)},c))}}function Ho(e,t,n,r,s=window){const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(i){An(()=>{n.set.call(this,i)},0),o&&o.set&&o.set.call(this,i)}}),()=>Ho(e,t,o||{},!0)}function Ir(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}let mn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(mn=()=>new Date().getTime());function $o(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:Fe([t,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||Fe([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||Fe([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:Fe([t,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||Fe([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||Fe([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function Uo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Wo(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function ke(e,t,n,r,s){if(!e)return!1;const o=Wo(e);if(!o)return!1;const i=lt(t,n);if(!s){const u=r&&o.matches(r);return i(o)&&!u}const c=Ye(o,i);let a=-1;return c<0?!1:(r&&(a=Ye(o,lt(null,r))),c>-1&&a<0?!0:c<a)}function md(e,t){return t.getId(e)!==-1}function $n(e,t){return t.getId(e)===Nt}function jo(e,t){if(xt(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?jo(e.parentNode,t):!0:!0}function Zn(e){return!!e.changedTouches}function _d(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function qo(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Go(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Qn(e){return!!Fe([e,"optionalAccess",t=>t.shadowRoot])}class gd{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return $c(this.styleIDMap.get(t),()=>-1)}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Vo(e){let t=null;return Fe([e,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function yd(e){let t=e,n;for(;n=Vo(t);)t=n;return t}function bd(e){const t=e.ownerDocument;if(!t)return!1;const n=yd(e);return t.contains(n)}function Yo(e){const t=e.ownerDocument;return t?t.contains(e)||bd(e):!1}const cs={};function xr(e){const t=cs[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const o=s.contentWindow;o&&o[e]&&(r=o[e]),n.head.removeChild(s)}catch{}return cs[e]=r.bind(window)}function Sd(...e){return xr("requestAnimationFrame")(...e)}function An(...e){return xr("setTimeout")(...e)}function vd(...e){return xr("clearTimeout")(...e)}var T=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(T||{}),A=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(A||{}),ue=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ue||{}),Ne=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ne||{});function wd(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],o=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=o(n)):(s==="call"||s==="optionalCall")&&(n=o((...i)=>n.call(t,...i)),t=void 0)}return n}function ls(e){return"__ln"in e}class Ed{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=wd([n,"optionalAccess",s=>s.next])||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&ls(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&ls(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const us=(e,t)=>`${e}@${t}`;class kd{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new Ed,s=a=>{let u=a,d=Nt;for(;d===Nt;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},o=a=>{if(!a.parentNode||!Yo(a))return;const u=xt(a.parentNode)?this.mirror.getId(Vo(a)):this.mirror.getId(a.parentNode),d=s(a);if(u===-1||d===-1)return r.addNode(a);const l=ut(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{qo(p,this.mirror)&&this.iframeManager.addIframe(p),Go(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Qn(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(p,f)=>{this.iframeManager.attachIframe(p,f),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,f)=>{this.stylesheetManager.attachLinkElement(p,f)}});l&&(t.push({parentId:u,nextId:d,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)ds(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||o(a);for(const a of this.addedSet)!fs(this.droppedSet,a)&&!ds(this.removes,a,this.mirror)||fs(this.movedSet,a)?o(a):this.droppedSet.add(a);let i=null;for(;r.length;){let a=null;if(i){const u=this.mirror.getId(i.value.parentNode),d=s(i.value);u!==-1&&d!==-1&&(a=i)}if(!a){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(l!==-1){a=d;break}else{const f=d.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=f.parentNode.host;if(this.mirror.getId(m)!==-1){a=d;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}i=a.previous,r.removeNode(a.value),o(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const d=JSON.stringify(a.styleDiff),l=JSON.stringify(a._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.processMutation=t=>{if(!$n(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ke(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:_t(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Wo(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if(r==="value"){const i=Er(n),c=n.tagName;s=hn(n,c,i);const a=Tn({maskInputOptions:this.maskInputOptions,tagName:c,type:i}),u=_t(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=At({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(ke(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let o=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!n.contentDocument)r="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Bo(n.tagName,r)&&(o.attributes[r]=Fo(this.doc,mt(n.tagName),mt(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const i=this.unattachedDoc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue);for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),u=n.style.getPropertyPriority(c);a!==i.style.getPropertyValue(c)||u!==i.style.getPropertyPriority(c)?u===""?o.styleDiff[c]=a:o.styleDiff[c]=[a,u]:o._unchangedStyles[c]=[a,u]}for(const c of Array.from(i.style))n.style.getPropertyValue(c)===""&&(o.styleDiff[c]=!1)}break}case"childList":{if(ke(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=xt(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ke(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||$n(n,this.mirror)||!md(n,this.mirror)||(this.addedSet.has(n)?(er(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||jo(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[us(r,s)]?er(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:xt(t.target)&&Mt(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if($n(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[us(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ke(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes.forEach(r=>this.genAdds(r)),Qn(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function er(e,t){e.delete(t),t.childNodes.forEach(n=>er(e,n))}function ds(e,t,n){return e.length===0?!1:Xo(e,t,n)}function Xo(e,t,n){const{parentNode:r}=t;if(!r)return!1;const s=n.getId(r);return e.some(o=>o.id===s)?!0:Xo(e,r,n)}function fs(e,t){return e.size===0?!1:Ko(e,t)}function Ko(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Ko(e,n):!1}let Rt;function Cd(e){Rt=e}function Id(){Rt=void 0}const O=e=>Rt?(...n)=>{try{return e(...n)}catch(r){if(Rt&&Rt(r)===!0)return()=>{};throw r}}:e;function Me(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],o=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=o(n)):(s==="call"||s==="optionalCall")&&(n=o((...i)=>n.call(t,...i)),t=void 0)}return n}const dt=[];function Bt(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Jo(e,t){const n=new kd;dt.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=Me([window,"optionalAccess",i=>i.Zone,"optionalAccess",i=>i.__symbol__,"optionalCall",i=>i("MutationObserver")]);s&&window[s]&&(r=window[s]);const o=new r(O(i=>{e.onMutation&&e.onMutation(i)===!1||n.processMutations.bind(n)(i)}));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function xd({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let i=[],c;const a=Ot(O(l=>{const p=Date.now()-c;e(i.map(f=>(f.timeOffset-=p,f)),l),i=[],c=null}),o),u=O(Ot(O(l=>{const p=Bt(l),{clientX:f,clientY:m}=Zn(l)?l.changedTouches[0]:l;c||(c=mn()),i.push({x:f,y:m,id:r.getId(p),timeOffset:mn()-c}),a(typeof DragEvent<"u"&&l instanceof DragEvent?A.Drag:l instanceof MouseEvent?A.MouseMove:A.TouchMove)}),s,{trailing:!1})),d=[de("mousemove",u,n),de("touchmove",u,n),de("drag",u,n)];return O(()=>{d.forEach(l=>l())})}function Md({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const c=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,a=[];let u=null;const d=l=>p=>{const f=Bt(p);if(ke(f,r,s,o,!0))return;let m=null,y=l;if("pointerType"in p){switch(p.pointerType){case"mouse":m=Ne.Mouse;break;case"touch":m=Ne.Touch;break;case"pen":m=Ne.Pen;break}m===Ne.Touch?ue[l]===ue.MouseDown?y="TouchStart":ue[l]===ue.MouseUp&&(y="TouchEnd"):Ne.Pen}else Zn(p)&&(m=Ne.Touch);m!==null?(u=m,(y.startsWith("Touch")&&m===Ne.Touch||y.startsWith("Mouse")&&m===Ne.Mouse)&&(m=null)):ue[l]===ue.Click&&(m=u,u=null);const w=Zn(p)?p.changedTouches[0]:p;if(!w)return;const _=n.getId(f),{clientX:v,clientY:I}=w;O(e)({type:ue[y],id:_,x:v,y:I,...m!==null&&{pointerType:m}})};return Object.keys(ue).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&c[l]!==!1).forEach(l=>{let p=mt(l);const f=d(l);if(window.PointerEvent)switch(ue[l]){case ue.MouseDown:case ue.MouseUp:p=p.replace("mouse","pointer");break;case ue.TouchStart:case ue.TouchEnd:return}a.push(de(p,f,t))}),O(()=>{a.forEach(l=>l())})}function Zo({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:o,sampling:i}){const c=O(Ot(O(a=>{const u=Bt(a);if(!u||ke(u,r,s,o,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=$o(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),i.scroll||100));return de("scroll",c,t)}function Rd({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=O(Ot(O(()=>{const o=Uo(),i=zo();(n!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),n=o,r=i)}),200));return de("resize",s,t)}const Td=["INPUT","TEXTAREA","SELECT"],hs=new WeakMap;function Ad({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:o,ignoreClass:i,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:p,unmaskTextClass:f,maskTextSelector:m,unmaskTextSelector:y}){function w(g){let x=Bt(g);const M=g.isTrusted,S=x&&Jn(x.tagName);if(S==="OPTION"&&(x=x.parentElement),!x||!S||Td.indexOf(S)<0||ke(x,r,s,o,!0))return;const R=x;if(R.classList.contains(i)||c&&R.matches(c))return;const P=Er(x);let K=hn(R,S,P),V=!1;const se=Tn({maskInputOptions:a,tagName:S,type:P}),L=_t(x,p,m,f,y,se);(P==="radio"||P==="checkbox")&&(V=x.checked),K=At({isMasked:L,element:x,value:K,maskInputFn:u}),_(x,l?{text:K,isChecked:V,userTriggered:M}:{text:K,isChecked:V});const ce=x.name;P==="radio"&&ce&&V&&t.querySelectorAll(`input[type="radio"][name="${ce}"]`).forEach(F=>{if(F!==x){const Z=At({isMasked:L,element:F,value:hn(F,S,P),maskInputFn:u});_(F,l?{text:Z,isChecked:!V,userTriggered:!1}:{text:Z,isChecked:!V})}})}function _(g,x){const M=hs.get(g);if(!M||M.text!==x.text||M.isChecked!==x.isChecked){hs.set(g,x);const S=n.getId(g);O(e)({...x,id:S})}}const I=(d.input==="last"?["change"]:["input","change"]).map(g=>de(g,O(w),t)),b=t.defaultView;if(!b)return()=>{I.forEach(g=>g())};const k=b.Object.getOwnPropertyDescriptor(b.HTMLInputElement.prototype,"value"),E=[[b.HTMLInputElement.prototype,"value"],[b.HTMLInputElement.prototype,"checked"],[b.HTMLSelectElement.prototype,"value"],[b.HTMLTextAreaElement.prototype,"value"],[b.HTMLSelectElement.prototype,"selectedIndex"],[b.HTMLOptionElement.prototype,"selected"]];return k&&k.set&&I.push(...E.map(g=>Ho(g[0],g[1],{set(){O(w)({target:this,isTrusted:!1})}},!1,b))),O(()=>{I.forEach(g=>g())})}function _n(e){const t=[];function n(r,s){if(qt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||qt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||qt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||qt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(i)}else if(r.parentStyleSheet){const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(i)}return s}return n(e,t)}function Be(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function Nd({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:O((d,l,p)=>{const[f,m]=p,{id:y,styleId:w}=Be(l,t,n.styleMirror);return(y&&y!==-1||w&&w!==-1)&&e({id:y,styleId:w,adds:[{rule:f,index:m}]}),d.apply(l,p)})});const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:O((d,l,p)=>{const[f]=p,{id:m,styleId:y}=Be(l,t,n.styleMirror);return(m&&m!==-1||y&&y!==-1)&&e({id:m,styleId:y,removes:[{index:f}]}),d.apply(l,p)})});let i;r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:O((d,l,p)=>{const[f]=p,{id:m,styleId:y}=Be(l,t,n.styleMirror);return(m&&m!==-1||y&&y!==-1)&&e({id:m,styleId:y,replace:f}),d.apply(l,p)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:O((d,l,p)=>{const[f]=p,{id:m,styleId:y}=Be(l,t,n.styleMirror);return(m&&m!==-1||y&&y!==-1)&&e({id:m,styleId:y,replaceSync:f}),d.apply(l,p)})}));const a={};Gt("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Gt("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Gt("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Gt("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:O((p,f,m)=>{const[y,w]=m,{id:_,styleId:v}=Be(f.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||v&&v!==-1)&&e({id:_,styleId:v,adds:[{rule:y,index:[..._n(f),w||0]}]}),p.apply(f,m)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:O((p,f,m)=>{const[y]=m,{id:w,styleId:_}=Be(f.parentStyleSheet,t,n.styleMirror);return(w&&w!==-1||_&&_!==-1)&&e({id:w,styleId:_,removes:[{index:[..._n(f),y]}]}),p.apply(f,m)})})}),O(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=o,i&&(r.CSSStyleSheet.prototype.replace=i),c&&(r.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function Qo({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?Me([n,"access",i=>i.defaultView,"optionalAccess",i=>i.Document]):Me([n,"access",i=>i.ownerDocument,"optionalAccess",i=>i.defaultView,"optionalAccess",i=>i.ShadowRoot]),o=Me([s,"optionalAccess",i=>i.prototype])?Object.getOwnPropertyDescriptor(Me([s,"optionalAccess",i=>i.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!o?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get(){return Me([o,"access",i=>i.get,"optionalAccess",i=>i.call,"call",i=>i(this)])},set(i){const c=Me([o,"access",a=>a.set,"optionalAccess",a=>a.call,"call",a=>a(this,i)]);if(r!==null&&r!==-1)try{t.adoptStyleSheets(i,r)}catch{}return c}}),O(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})}))}function Od({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:O((c,a,u)=>{const[d,l,p]=u;if(n.has(d))return o.apply(a,[d,l,p]);const{id:f,styleId:m}=Be(Me([a,"access",y=>y.parentRule,"optionalAccess",y=>y.parentStyleSheet]),t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,set:{property:d,value:l,priority:p},index:_n(a.parentRule)}),c.apply(a,u)})});const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:O((c,a,u)=>{const[d]=u;if(n.has(d))return i.apply(a,[d]);const{id:l,styleId:p}=Be(Me([a,"access",f=>f.parentRule,"optionalAccess",f=>f.parentStyleSheet]),t,r.styleMirror);return(l&&l!==-1||p&&p!==-1)&&e({id:l,styleId:p,remove:{property:d},index:_n(a.parentRule)}),c.apply(a,u)})}),O(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i})}function Ld({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:o,doc:i}){const c=O(u=>Ot(O(d=>{const l=Bt(d);if(!l||ke(l,t,n,r,!0))return;const{currentTime:p,volume:f,muted:m,playbackRate:y}=l;e({type:u,id:s.getId(l),currentTime:p,volume:f,muted:m,playbackRate:y})}),o.media||500)),a=[de("play",c(0),i),de("pause",c(1),i),de("seeked",c(2),i),de("volumechange",c(3),i),de("ratechange",c(4),i)];return O(()=>{a.forEach(u=>u())})}function Dd({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,o=n.FontFace;n.FontFace=function(a,u,d){const l=new o(a,u,d);return s.set(l,{family:a,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const i=Ir(t.fonts,"add",function(c){return function(a){return An(O(()=>{const u=s.get(a);u&&(e(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=o}),r.push(i),O(()=>{r.forEach(c=>c())})}function Pd(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:o,selectionCb:i}=e;let c=!0;const a=O(()=>{const u=t.getSelection();if(!u||c&&Me([u,"optionalAccess",p=>p.isCollapsed]))return;c=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let p=0;p<l;p++){const f=u.getRangeAt(p),{startContainer:m,startOffset:y,endContainer:w,endOffset:_}=f;ke(m,r,s,o,!0)||ke(w,r,s,o,!0)||d.push({start:n.getId(m),startOffset:y,end:n.getId(w),endOffset:_})}i({ranges:d})});return a(),de("selectionchange",a)}function Fd({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:Ir(n.customElements,"define",function(s){return function(o,i,c){try{t({define:{name:o}})}catch{}return s.apply(this,[o,i,c])}})}function Bd(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};const r=Jo(e,e.doc),s=xd(e),o=Md(e),i=Zo(e),c=Rd(e,{win:n}),a=Ad(e),u=Ld(e),d=Nd(e,{win:n}),l=Qo(e,e.doc),p=Od(e,{win:n}),f=e.collectFonts?Dd(e):()=>{},m=Pd(e),y=Fd(e),w=[];for(const _ of e.plugins)w.push(_.observer(_.callback,n,_.options));return O(()=>{dt.forEach(_=>_.reset()),r.disconnect(),s(),o(),i(),c(),a(),u(),d(),l(),p(),f(),m(),y(),w.forEach(_=>_())})}function qt(e){return typeof window[e]<"u"}function Gt(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class tr{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const o=r||this.getIdToRemoteIdMap(t),i=s||this.getRemoteIdToIdMap(t);let c=o.get(n);return c||(c=this.generateIdFn(),o.set(n,c),i.set(c,n)),c}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(o=>this.getId(t,o,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const o=s.get(n);return o||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(s=>this.getRemoteId(t,s,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}function ps(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],o=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=o(n)):(s==="call"||s==="optionalCall")&&(n=o((...i)=>n.call(t,...i)),t=void 0)}return n}class Hd{constructor(){this.crossOriginIframeMirror=new tr(kr),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class $d{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new tr(kr),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),ps([this,"access",r=>r.loadListener,"optionalCall",r=>r(t)]),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const s=this.crossOriginIframeMap.get(t.source);if(!s)return;const o=this.transformCrossOriginEvent(s,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case T.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:T.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case T.Meta:case T.Load:case T.DomContentLoaded:return!1;case T.Plugin:return n;case T.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case T.IncrementalSnapshot:switch(n.data.source){case A.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);const s=this.crossOriginIframeRootIdMap.get(t);s&&this.patchRootIdOnNode(r.node,s)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case A.Drag:case A.TouchMove:case A.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(n.data,t,["id"]),n;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case A.Font:return n;case A.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case A.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),ps([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(s=>{this.replaceStyleIds(s,t,["styleId"])})]),n}}return!1}replace(t,n,r,s){for(const o of s)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=t.getIds(r,n[o]):n[o]=t.getId(r,n[o]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==ie.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class Ud{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class zd{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!Mt(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const r=Jo({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Zo({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),An(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Qo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(Ir(t.prototype,"attachShadow",function(s){return function(o){const i=s.call(this,o);return this.shadowRoot&&Yo(this)&&r.addShadowRoot(this.shadowRoot,n),i}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class ms{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class Wd{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new gd,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},s=[];for(const o of t){let i;this.styleMirror.has(o)?i=this.styleMirror.getId(o):(i=this.styleMirror.add(o),s.push({styleId:i,rules:Array.from(o.rules||CSSRule,(c,a)=>({rule:Do(c),index:a}))})),r.styleIds.push(i)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class jd{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){Sd(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}let re,gn;const Ee=qu();function ze(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,unblockSelector:i=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:p=null,unmaskTextSelector:f=null,inlineStylesheet:m=!0,maskAllInputs:y,maskInputOptions:w,slimDOMOptions:_,maskAttributeFn:v,maskInputFn:I,maskTextFn:b,maxCanvasSize:k=null,packFn:E,sampling:g={},dataURLOptions:x={},mousemoveWait:M,recordCanvas:S=!1,recordCrossOriginIframes:R=!1,recordAfter:P=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:K=!1,collectFonts:V=!1,inlineImages:se=!1,plugins:L,keepIframeSrcFn:ce=()=>!1,ignoreCSSAttributes:F=new Set([]),errorHandler:Z,onMutation:fe,getCanvasManager:he}=e;Cd(Z);const le=R?window.parent===window:!0;let Ie=!1;if(!le)try{window.parent.document&&(Ie=!1)}catch{Ie=!0}if(le&&!t)throw new Error("emit function is required");M!==void 0&&g.mousemove===void 0&&(g.mousemove=M),Ee.reset();const Qe=y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:w!==void 0?w:{},et=_===!0||_==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_==="all",headMetaDescKeywords:_==="all"}:_||{};_d();let tt,nt=0;const rt=B=>{for(const we of L||[])we.eventProcessor&&(B=we.eventProcessor(B));return E&&!Ie&&(B=E(B)),B};re=(B,we)=>{const D=B;if(D.timestamp=mn(),en([dt,"access",Q=>Q[0],"optionalAccess",Q=>Q.isFrozen,"call",Q=>Q()])&&D.type!==T.FullSnapshot&&!(D.type===T.IncrementalSnapshot&&D.data.source===A.Mutation)&&dt.forEach(Q=>Q.unfreeze()),le)en([t,"optionalCall",Q=>Q(rt(D),we)]);else if(Ie){const Q={type:"rrweb",event:rt(D),origin:window.location.origin,isCheckout:we};window.parent.postMessage(Q,"*")}if(D.type===T.FullSnapshot)tt=D,nt=0;else if(D.type===T.IncrementalSnapshot){if(D.data.source===A.Mutation&&D.data.isAttachIframe)return;nt++;const Q=r&&nt>=r,H=n&&tt&&D.timestamp-tt.timestamp>n;(Q||H)&&Bn(!0)}};const W=B=>{re({type:T.IncrementalSnapshot,data:{source:A.Mutation,...B}})},te=B=>re({type:T.IncrementalSnapshot,data:{source:A.Scroll,...B}}),pe=B=>re({type:T.IncrementalSnapshot,data:{source:A.CanvasMutation,...B}}),oe=B=>re({type:T.IncrementalSnapshot,data:{source:A.AdoptedStyleSheet,...B}}),ne=new Wd({mutationCb:W,adoptedStyleSheetCb:oe}),ve=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Hd:new $d({mirror:Ee,mutationCb:W,stylesheetManager:ne,recordCrossOriginIframes:R,wrappedEmit:re});for(const B of L||[])B.getMirror&&B.getMirror({nodeMirror:Ee,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror});const xe=new jd,zt=Gd(he,{mirror:Ee,win:window,mutationCb:B=>re({type:T.IncrementalSnapshot,data:{source:A.CanvasMutation,...B}}),recordCanvas:S,blockClass:s,blockSelector:o,unblockSelector:i,maxCanvasSize:k,sampling:g.canvas,dataURLOptions:x,errorHandler:Z}),Wt=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Ud:new zd({mutationCb:W,scrollCb:te,bypassOptions:{onMutation:fe,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskInputOptions:Qe,dataURLOptions:x,maskAttributeFn:v,maskTextFn:b,maskInputFn:I,recordCanvas:S,inlineImages:se,sampling:g,slimDOMOptions:et,iframeManager:ve,stylesheetManager:ne,canvasManager:zt,keepIframeSrcFn:ce,processedNodeManager:xe},mirror:Ee}),Bn=(B=!1)=>{re({type:T.Meta,data:{href:window.location.href,width:zo(),height:Uo()}},B),ne.reset(),Wt.init(),dt.forEach(D=>D.lock());const we=pd(document,{mirror:Ee,blockClass:s,blockSelector:o,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskAllInputs:Qe,maskAttributeFn:v,maskInputFn:I,maskTextFn:b,slimDOM:et,dataURLOptions:x,recordCanvas:S,inlineImages:se,onSerialize:D=>{qo(D,Ee)&&ve.addIframe(D),Go(D,Ee)&&ne.trackLinkElement(D),Qn(D)&&Wt.addShadowRoot(D.shadowRoot,document)},onIframeLoad:(D,Q)=>{ve.attachIframe(D,Q),Wt.observeAttachShadow(D)},onStylesheetLoad:(D,Q)=>{ne.attachLinkElement(D,Q)},keepIframeSrcFn:ce});if(!we)return console.warn("Failed to snapshot the document");re({type:T.FullSnapshot,data:{node:we,initialOffset:$o(window)}}),dt.forEach(D=>D.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ne.adoptStyleSheets(document.adoptedStyleSheets,Ee.getId(document))};gn=Bn;try{const B=[],we=Q=>O(Bd)({onMutation:fe,mutationCb:W,mousemoveCb:(H,qe)=>re({type:T.IncrementalSnapshot,data:{source:qe,positions:H}}),mouseInteractionCb:H=>re({type:T.IncrementalSnapshot,data:{source:A.MouseInteraction,...H}}),scrollCb:te,viewportResizeCb:H=>re({type:T.IncrementalSnapshot,data:{source:A.ViewportResize,...H}}),inputCb:H=>re({type:T.IncrementalSnapshot,data:{source:A.Input,...H}}),mediaInteractionCb:H=>re({type:T.IncrementalSnapshot,data:{source:A.MediaInteraction,...H}}),styleSheetRuleCb:H=>re({type:T.IncrementalSnapshot,data:{source:A.StyleSheetRule,...H}}),styleDeclarationCb:H=>re({type:T.IncrementalSnapshot,data:{source:A.StyleDeclaration,...H}}),canvasMutationCb:pe,fontCb:H=>re({type:T.IncrementalSnapshot,data:{source:A.Font,...H}}),selectionCb:H=>{re({type:T.IncrementalSnapshot,data:{source:A.Selection,...H}})},customElementCb:H=>{re({type:T.IncrementalSnapshot,data:{source:A.CustomElement,...H}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:p,unmaskTextSelector:f,maskInputOptions:Qe,inlineStylesheet:m,sampling:g,recordCanvas:S,inlineImages:se,userTriggeredOnInput:K,collectFonts:V,doc:Q,maskAttributeFn:v,maskInputFn:I,maskTextFn:b,keepIframeSrcFn:ce,blockSelector:o,unblockSelector:i,slimDOMOptions:et,dataURLOptions:x,mirror:Ee,iframeManager:ve,stylesheetManager:ne,shadowDomManager:Wt,processedNodeManager:xe,canvasManager:zt,ignoreCSSAttributes:F,plugins:en([L,"optionalAccess",H=>H.filter,"call",H=>H(qe=>qe.observer),"optionalAccess",H=>H.map,"call",H=>H(qe=>({observer:qe.observer,options:qe.options,callback:Xi=>re({type:T.Plugin,data:{plugin:qe.name,payload:Xi}})}))])||[]},{});ve.addLoadListener(Q=>{try{B.push(we(Q.contentDocument))}catch(H){console.warn(H)}});const D=()=>{Bn(),B.push(we(document))};return document.readyState==="interactive"||document.readyState==="complete"?D():(B.push(de("DOMContentLoaded",()=>{re({type:T.DomContentLoaded,data:{}}),P==="DOMContentLoaded"&&D()})),B.push(de("load",()=>{re({type:T.Load,data:{}}),P==="load"&&D()},window))),()=>{B.forEach(Q=>Q()),xe.destroy(),gn=void 0,Id()}}catch(B){console.warn(B)}}function qd(e){if(!gn)throw new Error("please take full snapshot after start recording");gn(e)}ze.mirror=Ee;ze.takeFullSnapshot=qd;function Gd(e,t){try{return e?e(t):new ms}catch{return console.warn("Unable to initialize CanvasManager"),new ms}}const Vd=3,Yd=5;function Mr(e){return e>9999999999?e:e*1e3}function Un(e){return e>9999999999?e/1e3:e}function Ht(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:T.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:hr(t,10,1e3)}}),t.category==="console")))}const Xd="button,a";function ei(e){return e.closest(Xd)||e}function ti(e){const t=ni(e);return!t||!(t instanceof Element)?t:ei(t)}function ni(e){return Kd(e)?e.target:e}function Kd(e){return typeof e=="object"&&!!e&&"target"in e}let He;function Jd(e){return He||(He=[],Zd()),He.push(e),()=>{const t=He?He.indexOf(e):-1;t>-1&&He.splice(t,1)}}function Zd(){Ea(q,"open",function(e){return function(...t){if(He)try{He.forEach(n=>n())}catch{}return e.apply(q,t)}})}function Qd(e,t,n){e.handleClick(t,n)}class ef{constructor(t,n,r=Ht){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=Jd(()=>{this._lastMutation=_s()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(nf(n,this._ignoreSelector)||!rf(t))return;const r={timestamp:Un(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Un(t)}registerScroll(t=Date.now()){this._lastScroll=Un(t)}registerClick(t){const n=ei(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=_s();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(const r of t){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,o=!r&&!s,{clickCount:i,clickBreadcrumb:c}=t;if(o){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=a<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:q.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:u,clickCount:i||1}};this._addBreadcrumbEvent(n,d);return}if(i>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:q.location.href,route:n.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Je(()=>this._checkClicks(),1e3)}}const tf=["A","BUTTON","INPUT"];function nf(e,t){return!!(!tf.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function rf(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function _s(){return Date.now()/1e3}function sf(e,t){try{if(!of(t))return;const{source:n}=t.data;if(n===A.Mutation&&e.registerMutation(t.timestamp),n===A.Scroll&&e.registerScroll(t.timestamp),af(t)){const{type:r,id:s}=t.data,o=ze.mirror.getNode(s);o instanceof HTMLElement&&r===ue.Click&&e.registerClick(o)}}catch{}}function of(e){return e.type===Vd}function af(e){return e.data.source===A.MouseInteraction}function Re(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var yn;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(yn||(yn={}));const cf=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function lf(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(cf.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const uf=e=>t=>{if(!e.isEnabled())return;const n=df(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&s&&s.target&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&Qd(e.clickDetector,n,ti(t.event)),Ht(e,n)};function ri(e,t){const n=ze.mirror.getId(e),r=n&&ze.mirror.getNode(n),s=r&&ze.mirror.getMeta(r),o=s&&hf(s)?s:null;return{message:t,data:o?{nodeId:n,node:{id:n,tagName:o.tagName,textContent:Array.from(o.childNodes).map(i=>i.type===yn.Text&&i.textContent).filter(Boolean).map(i=>i.trim()).join(""),attributes:lf(o.attributes)}}:{}}}function df(e){const{target:t,message:n}=ff(e);return Re({category:`ui.${e.name}`,...ri(t,n)})}function ff(e){const t=e.name==="click";let n,r=null;try{r=t?ti(e.event):ni(e.event),n=_o(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function hf(e){return e.type===yn.Element}function pf(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=mf(t);n&&Ht(e,n)}function mf(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:o,target:i}=e;if(!i||_f(i)||!o)return null;const c=t||r||s,a=o.length===1;if(!c&&a)return null;const u=_o(i,{maxStringLength:200})||"<unknown>",d=ri(i,u);return Re({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:o}})}function _f(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const gf={resource:wf,paint:Sf,navigation:vf};function Vt(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function yf(e){return e.map(bf).filter(Boolean)}function bf(e){const t=gf[e.entryType];return t?t(e):null}function gt(e){return((Yn||q.performance.timeOrigin)+e)/1e3}function Sf(e){const{duration:t,entryType:n,name:r,startTime:s}=e,o=gt(s);return{type:n,name:r,start:o,end:o+t,data:void 0}}function vf(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:o,encodedBodySize:i,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:p,startTime:f,transferSize:m,type:y}=e;return s===0?null:{type:`${t}.${y}`,start:gt(f),end:gt(o),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:i,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:l,domComplete:o,redirectCount:p}}}function wf(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:o,decodedBodySize:i,encodedBodySize:c,responseStatus:a,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:gt(o),end:gt(s),name:r,data:{size:u,statusCode:a,decodedBodySize:i,encodedBodySize:c}}}function Ef(e){const t=e.entries[e.entries.length-1],n=t?t.element:void 0;return Nn(e,"largest-contentful-paint",n)}function kf(e){const t=e.entries[0],n=t&&t.sources&&t.sources[0]?t.sources[0].node:void 0;return Nn(e,"cumulative-layout-shift",n)}function Cf(e){const t=e.entries[e.entries.length-1],n=t?t.target:void 0;return Nn(e,"first-input-delay",n)}function If(e){const t=e.entries[e.entries.length-1],n=t?t.target:void 0;return Nn(e,"interaction-to-next-paint",n)}function Nn(e,t,n){const r=e.value,s=e.rating,o=gt(r);return{type:"web-vital",name:t,start:o,end:o,data:{value:r,size:r,rating:s,nodeId:n?ze.mirror.getId(n):void 0}}}function xf(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function n({entries:s}){s.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(_a(s,n))}),r.push(ga(Vt(Ef,e)),ya(Vt(kf,e)),ba(Vt(Cf,e)),Sa(Vt(If,e))),()=>{r.forEach(s=>s())}}const U=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Mf='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}},L=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},O=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},j=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},q=function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&j(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}},B=function(t){return 10+(t.filename?t.filename.length+1:0)},G=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(O(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();var H=function(){function t(t,n){this.c=L(),this.v=1,G.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),G.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=O(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=L();i.p(n.dictionary),j(t,2,i.d())}}(r,this.o),this.v=0),n&&j(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),J="undefined"!=typeof TextEncoder&&new TextEncoder,K="undefined"!=typeof TextDecoder&&new TextDecoder;try{K.decode(F,{stream:!0})}catch(t){}var N=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(P(t),this.d=n||!1)},t}();function P(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(J)return J.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}function Q(t){return function(t,n){n||(n={});var r=S(),e=t.length;r.p(t);var i=O(t,n,B(n),8),a=i.length;return q(i,n),j(i,a-8,r.d()),j(i,a-4,e),i}(P(t))}const R=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new H,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new N(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},V={clear:()=>{R.clear()},addEvent:t=>R.addEvent(t),finish:()=>R.finish(),compress:t=>Q(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in V&&"function"==typeof V[n])try{const t=V[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function Rf(){const e=new Blob([Mf]);return URL.createObjectURL(e)}function me(e,t){U&&(C.info(e),t&&si(e))}function Ke(e,t){U&&(C.info(e),t&&Je(()=>{si(e)},0))}function si(e){pr({category:"console",data:{logger:"replay"},level:"info",message:e},{level:"info"})}class Rr extends Error{constructor(){super(`Event buffer exceeded maximum size of ${wr}.`)}}class oi{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>wr)throw new Rr;this.events.push(t)}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const t=this.events.map(n=>n.timestamp).sort()[0];return t?Mr(t):null}}class Tf{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){me("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,o)=>{const i=({data:c})=>{const a=c;if(a.method===t&&a.id===r){if(this._worker.removeEventListener("message",i),!a.success){U&&C.error("[Replay]",a.response),o(new Error("Error in compression worker"));return}s(a.response)}};this._worker.addEventListener("message",i),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class Af{constructor(t){this._worker=new Tf(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=Mr(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>wr?Promise.reject(new Rr):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{U&&C.warn('[Replay] Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class Nf{constructor(t){this._fallback=new oi,this._compression=new Af(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{me("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n}=this._fallback,r=[];for(const s of t)r.push(this._compression.addEvent(s));this._compression.hasCheckout=n,this._used=this._compression;try{await Promise.all(r)}catch(s){U&&C.warn("[Replay] Failed to add events when switching buffers.",s)}}}function Of({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=Lf(t);if(n)return n}return me("[Replay] Using simple buffer"),new oi}function Lf(e){try{const t=e||Df();if(!t)return;me(`[Replay] Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new Nf(n)}catch{me("[Replay] Failed to create compression worker")}}function Df(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Rf():""}function Tr(){try{return"sessionStorage"in q&&!!q.sessionStorage}catch{return!1}}function Pf(e){Ff(),e.session=void 0}function Ff(){if(Tr())try{q.sessionStorage.removeItem(Sr)}catch{}}function ii(e){return e===void 0?!1:Math.random()<e}function ai(e){const t=Date.now(),n=e.id||_r(),r=e.started||t,s=e.lastActivity||t,o=e.segmentId||0,i=e.sampled,c=e.previousSessionId;return{id:n,started:r,lastActivity:s,segmentId:o,sampled:i,previousSessionId:c}}function Ar(e){if(Tr())try{q.sessionStorage.setItem(Sr,JSON.stringify(e))}catch{}}function Bf(e,t){return ii(e)?"session":t?"buffer":!1}function gs({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=Bf(e,t),o=ai({sampled:s,previousSessionId:r});return n&&Ar(o),o}function Hf(e){if(!Tr())return null;try{const t=q.sessionStorage.getItem(Sr);if(!t)return null;const n=JSON.parse(t);return Ke("[Replay] Loading existing session",e),ai(n)}catch{return null}}function nr(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function ci(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return nr(e.started,t,r)||nr(e.lastActivity,n,r)}function li(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!ci(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function zn({traceInternals:e,sessionIdleExpire:t,maxReplayDuration:n,previousSessionId:r},s){const o=s.stickySession&&Hf(e);return o?li(o,{sessionIdleExpire:t,maxReplayDuration:n})?(Ke("[Replay] Session in sessionStorage is expired, creating new one..."),gs(s,{previousSessionId:o.id})):o:(Ke("[Replay] Creating new session",e),gs(s,{previousSessionId:r}))}function $f(e){return e.type===T.Custom}function Nr(e,t,n){return di(e,t)?(ui(e,t,n),!0):!1}function Uf(e,t,n){return di(e,t)?ui(e,t,n):Promise.resolve(null)}async function ui(e,t,n){if(!e.eventBuffer)return null;try{n&&e.recordingMode==="buffer"&&e.eventBuffer.clear(),n&&(e.eventBuffer.hasCheckout=!0);const r=e.getOptions(),s=zf(t,r.beforeAddRecordingEvent);return s?await e.eventBuffer.addEvent(s):void 0}catch(r){const s=r&&r instanceof Rr?"addEventSizeExceeded":"addEvent";U&&C.error(r),await e.stop({reason:s});const o=G();o&&o.recordDroppedEvent("internal_sdk_error","replay")}}function di(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Mr(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Ke(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,e.getOptions()._experiments.traceInternals),!1):!0}function zf(e,t){try{if(typeof t=="function"&&$f(e))return t(e)}catch(n){return U&&C.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return e}function Or(e){return!e.type}function rr(e){return e.type==="transaction"}function Wf(e){return e.type==="replay_event"}function ys(e){return e.type==="feedback"}function jf(e){return(t,n)=>{if(!e.isEnabled()||!Or(t)&&!rr(t))return;const r=n&&n.statusCode;if(!(!r||r<200||r>=300)){if(rr(t)){qf(e,t);return}Gf(e,t)}}}function qf(e,t){const n=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function Gf(e,t){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||Je(()=>{e.sendBufferedReplayOrFlush()})}function Vf(e){return t=>{!e.isEnabled()||!Or(t)||Yf(e,t)}}function Yf(e,t){const n=t.exception&&t.exception.values&&t.exception.values[0]&&t.exception.values[0].value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=Re({category:"replay.hydrate-error",data:{url:yo()}});Ht(e,r)}}function Xf(e){const t=G();t&&t.on("beforeAddBreadcrumb",n=>Kf(e,n))}function Kf(e,t){if(!e.isEnabled()||!fi(t))return;const n=Jf(t);n&&Ht(e,n)}function Jf(e){return!fi(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?Zf(e):Re(e)}function Zf(e){const t=e.data&&e.data.arguments;if(!Array.isArray(t)||t.length===0)return Re(e);let n=!1;const r=t.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>jt?(n=!0,`${s.slice(0,jt)}…`):s;if(typeof s=="object")try{const o=hr(s,7);return JSON.stringify(o).length>jt?(n=!0,`${JSON.stringify(o,null,2).slice(0,jt)}…`):o}catch{}return s});return Re({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function fi(e){return!!e.category}function Qf(e,t){return e.type||!e.exception||!e.exception.values||!e.exception.values.length?!1:!!(t.originalException&&t.originalException.__rrweb__)}function eh(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:T.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function th(e,t){return e.recordingMode!=="buffer"||t.message===vr||!t.exception||t.type?!1:ii(e.getOptions().errorSampleRate)}function nh(e){return Object.assign((t,n)=>e.isEnabled()?Wf(t)?(delete t.breadcrumbs,t):!Or(t)&&!rr(t)&&!ys(t)||!e.checkAndHandleExpiredSession()?t:ys(t)?(e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),eh(e,t),t):Qf(t,n)&&!e.getOptions()._experiments.captureExceptions?(U&&C.log("[Replay] Ignoring error from rrweb internals",t),null):((th(e,t)||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),t):t,{id:"Replay"})}function On(e,t){return t.map(({type:n,start:r,end:s,name:o,data:i})=>{const c=e.throttledAddEvent({type:T.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:o,startTimestamp:r,endTimestamp:s,data:i}}});return typeof c=="string"?Promise.resolve(null):c})}function rh(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function sh(e){return t=>{if(!e.isEnabled())return;const n=rh(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(On(e,[n]),!1)))}}function oh(e,t){return U&&e.getOptions()._experiments.traceInternals?!1:wo(t,G())}function hi(e,t){e.isEnabled()&&t!==null&&(oh(e,t.name)||e.addUpdate(()=>(On(e,[t]),!0)))}function Ln(e){if(!e)return;const t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=gi(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function pi(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function mi(e){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[gi(e)];if(!e)return[void 0]}catch{return U&&C.warn("[Replay] Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return U&&C.info("[Replay] Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function bn(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function _i(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:o,statusCode:i,request:c,response:a}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:In({method:o,statusCode:i,request:c,response:a})}}function Lt(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function We(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:o}=ih(n);return r.body=s,o&&o.length>0&&(r._meta={warnings:o}),r}function sr(e,t){return Object.entries(e).reduce((n,[r,s])=>{const o=r.toLowerCase();return t.includes(o)&&e[r]&&(n[o]=s),n},{})}function gi(e){return new URLSearchParams(e).toString()}function ih(e){if(!e||typeof e!="string")return{body:e};const t=e.length>rs,n=ah(e);if(t){const r=e.slice(0,rs);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function ah(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Sn(e,t){const n=ch(e);return Ra(n,t)}function ch(e,t=q.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(q.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function lh(e,t,n){try{const r=await dh(e,t,n),s=_i("resource.fetch",r);hi(n.replay,s)}catch(r){U&&C.error("[Replay] Failed to capture fetch breadcrumb",r)}}function uh(e,t){const{input:n,response:r}=t,s=n?yi(n):void 0,o=Ln(s),i=r?pi(r.headers.get("content-length")):void 0;o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}async function dh(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:o=r}=t,{url:i,method:c,status_code:a=0,request_body_size:u,response_body_size:d}=e.data,l=Sn(i,n.networkDetailAllowUrls)&&!Sn(i,n.networkDetailDenyUrls),p=l?fh(n,t.input,u):Lt(u),f=await hh(l,n,t.response,d);return{startTimestamp:s,endTimestamp:o,url:i,method:c,statusCode:a,request:p,response:f}}function fh({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?_h(n,t):{};if(!e)return We(s,r,void 0);const o=yi(n),[i,c]=mi(o),a=We(s,r,i);return c?bn(a,c):a}async function hh(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return Lt(s);const o=r?bi(r.headers,n):{};if(!r||!t&&s!==void 0)return We(o,s,void 0);const[i,c]=await mh(r),a=ph(i,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:o});return c?bn(a,c):a}function ph(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const o=e&&e.length&&n===void 0?Ln(e):n;return r?t?We(s,o,e):We(s,o,void 0):Lt(o)}catch(o){return U&&C.warn("[Replay] Failed to serialize response body",o),We(s,n,void 0)}}async function mh(e){const t=gh(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await yh(t)]}catch(n){return U&&C.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}function yi(e=[]){if(!(e.length!==2||typeof e[1]!="object"))return e[1].body}function bi(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function _h(e,t){return e.length===1&&typeof e[0]!="string"?bs(e[0],t):e.length===2?bs(e[1],t):{}}function bs(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?bi(n,t):Array.isArray(n)?{}:sr(n,t):{}}function gh(e){try{return e.clone()}catch(t){U&&C.warn("[Replay] Failed to clone response body",t)}}function yh(e){return new Promise((t,n)=>{const r=Je(()=>n(new Error("Timeout while trying to read response body")),500);bh(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function bh(e){return await e.text()}async function Sh(e,t,n){try{const r=wh(e,t,n),s=_i("resource.xhr",r);hi(n.replay,s)}catch(r){U&&C.error("[Replay] Failed to capture xhr breadcrumb",r)}}function vh(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=Ln(r),o=n.getResponseHeader("content-length")?pi(n.getResponseHeader("content-length")):Ih(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),o!==void 0&&(e.data.response_body_size=o)}function wh(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:o=r,input:i,xhr:c}=t,{url:a,method:u,status_code:d=0,request_body_size:l,response_body_size:p}=e.data;if(!a)return null;if(!c||!Sn(a,n.networkDetailAllowUrls)||Sn(a,n.networkDetailDenyUrls)){const E=Lt(l),g=Lt(p);return{startTimestamp:s,endTimestamp:o,url:a,method:u,statusCode:d,request:E,response:g}}const f=c[po],m=f?sr(f.request_headers,n.networkRequestHeaders):{},y=sr(Eh(c),n.networkResponseHeaders),[w,_]=n.networkCaptureBodies?mi(i):[void 0],[v,I]=n.networkCaptureBodies?kh(c):[void 0],b=We(m,l,w),k=We(y,p,v);return{startTimestamp:s,endTimestamp:o,url:a,method:u,statusCode:d,request:_?bn(b,_):b,response:I?bn(k,I):k}}function Eh(e){const t=e.getAllResponseHeaders();return t?t.split(`\r `).reduce((n,r)=>{const[s,o]=r.split(": ");return o&&(n[s.toLowerCase()]=o),n},{}):{}}function kh(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return Ch(e.response,e.responseType)}catch(n){t.push(n)}return U&&C.warn("[Replay] Failed to get xhr response body",...t),[void 0]}function Ch(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch{return U&&C.warn("[Replay] Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return U&&C.info("[Replay] Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Ih(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return Ln(n)}catch{return}}function xh(e){const t=G();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:i}=e.getOptions(),c={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:i};t&&t.on("beforeAddBreadcrumb",(a,u)=>Mh(c,a,u))}catch{}}function Mh(e,t,n){if(t.data)try{Rh(t)&&Ah(n)&&(vh(t,n),Sh(t,n,e)),Th(t)&&Nh(n)&&(uh(t,n),lh(t,n,e))}catch{U&&C.warn("Error when enriching network breadcrumb")}}function Rh(e){return e.category==="xhr"}function Th(e){return e.category==="fetch"}function Ah(e){return e&&e.xhr}function Nh(e){return e&&e.response}function Oh(e){const t=G();va(uf(e)),wa(sh(e)),Xf(e),xh(e);const n=nh(e);go(n),t&&(t.on("beforeSendEvent",Vf(e)),t.on("afterSendEvent",jf(e)),t.on("createDsc",r=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=s)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",(r,s)=>{const o=e.getSessionId();s&&s.includeReplay&&e.isEnabled()&&o&&r.contexts&&r.contexts.feedback&&(r.contexts.feedback.replay_id=o)}))}async function Lh(e){try{return Promise.all(On(e,[Dh(q.performance.memory)]))}catch{return[]}}function Dh(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Ph(e,t,n){let r,s,o;const i=n&&n.maxWait?Math.max(n.maxWait,t):0;function c(){return a(),r=e(),r}function a(){s!==void 0&&clearTimeout(s),o!==void 0&&clearTimeout(o),s=o=void 0}function u(){return s!==void 0||o!==void 0?c():r}function d(){return s&&clearTimeout(s),s=Je(c,t),i&&o===void 0&&(o=Je(c,i)),r}return d.cancel=a,d.flush=u,d}function Fh(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){U&&C.warn("[Replay] Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&sf(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Nr(e,n,s))return!0;if(!s)return!1;if(Hh(e,s),e.session&&e.session.previousSessionId)return!0;if(e.recordingMode==="buffer"&&e.session&&e.eventBuffer){const o=e.eventBuffer.getEarliestTimestamp();o&&(me(`[Replay] Updating session start time to earliest event in buffer to ${new Date(o)}`,e.getOptions()._experiments.traceInternals),e.session.started=o,e.getOptions().stickySession&&Ar(e.session))}return e.recordingMode==="session"&&e.flush(),!0})}}function Bh(e){const t=e.getOptions();return{type:T.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function Hh(e,t){!t||!e.session||e.session.segmentId!==0||Nr(e,Bh(e),!1)}function $h(e,t,n,r){return fr(Ia(e,xa(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function Uh({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)} `;if(typeof e=="string")n=`${r}${e}`;else{const o=new TextEncoder().encode(r);n=new Uint8Array(o.length+e.length),n.set(o),n.set(e,o.length)}return n}async function zh({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,o={event_id:n,integrations:s};e.emit("preprocessEvent",r,o);const i=await Ma(e.getOptions(),r,o,t,e,xn());if(!i)return null;i.platform=i.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u}=c&&c.sdk||{};return i.sdk={...i.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0"},i}async function Wh({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:o}){const i=Uh({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:d}=r,l=G(),p=Ce(),f=l&&l.getTransport(),m=l&&l.getDsn();if(!l||!f||!m||!o.sampled)return qr({});const y={type:Iu,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:o.sampled},w=await zh({scope:p,client:l,replayId:t,event:y});if(!w)return l.recordDroppedEvent("event_processor","replay",y),me("An event processor returned `null`, will not send event."),qr({});delete w.sdkProcessingMetadata;const _=$h(w,i,m,l.getOptions().tunnel);let v;try{v=await f.send(_)}catch(b){const k=new Error(vr);try{k.cause=b}catch{}throw k}if(typeof v.statusCode=="number"&&(v.statusCode<200||v.statusCode>=300))throw new Si(v.statusCode);const I=ka({},v);if(Ca(I,"replay"))throw new vi(I);return v}class Si extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class vi extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function wi(e,t={count:0,interval:Nu}){const{recordingData:n,options:r}=e;if(n.length)try{return await Wh(e),!0}catch(s){if(s instanceof Si||s instanceof vi)throw s;if(mr("Replays",{_retryCount:t.count}),U&&r._experiments&&r._experiments.captureExceptions&&kn(s),t.count>=Ou){const o=new Error(`${vr} - max retries exceeded`);try{o.cause=s}catch{}throw o}return t.interval*=++t.count,new Promise((o,i)=>{Je(async()=>{try{await wi(e,t),o(!0)}catch(c){i(c)}},t.interval)})}}const Ei="__THROTTLED",jh="__SKIPPED";function qh(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,d)=>{d<a&&r.delete(d)})},o=()=>[...r.values()].reduce((c,a)=>c+a,0);let i=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),o()>=t){const d=i;return i=!0,d?jh:Ei}i=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class $e{constructor({options:t,recordingOptions:n}){$e.prototype.__init.call(this),$e.prototype.__init2.call(this),$e.prototype.__init3.call(this),$e.prototype.__init4.call(this),$e.prototype.__init5.call(this),$e.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:xu,sessionIdleExpire:Mu},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=Ph(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=qh((i,c)=>Uf(this,i,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),o=r?{threshold:Math.min(Lu,r),timeout:r,scrollTimeout:Du,ignoreSelector:s?s.join(","):""}:void 0;o&&(this.clickDetector=new ef(this,o))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){this._handleException(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",Ke(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");Ke("[Replay] Starting replay in session mode",this._options._experiments.traceInternals),this._updateUserActivity();const t=zn({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");Ke("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const t=zn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=ze({...this._recordingOptions,...this.recordingMode==="buffer"&&{checkoutEveryNms:Au},emit:Fh(this),onMutation:this._onMutationHandler,...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this._handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this._handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{me(`[Replay] Stopping Replay${n?` triggered by ${n}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,Pf(this)}catch(r){this._handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),me("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),me("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();me("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const n=t();this.recordingMode!=="buffer"&&n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&nr(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${q.location.pathname}${q.location.hash}${q.location.search}`,n=`${q.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){const r=this._throttledAddEvent(t,n);if(r===Ei){const s=Re({category:"replay.throttled"});this.addUpdate(()=>!Nr(this,{type:Yd,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||Cn(),n=t&&Tt(t),s=(n&&Le(n).data||{})[mo];if(!(!n||!s||!["route","custom"].includes(s)))return Le(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Of({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(t){U&&C.error("[Replay]",t),U&&this._options._experiments&&this._options._experiments.captureExceptions&&kn(t)}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=zn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return li(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{q.document.addEventListener("visibilitychange",this._handleVisibilityChange),q.addEventListener("blur",this._handleWindowBlur),q.addEventListener("focus",this._handleWindowFocus),q.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Oh(this),this._hasInitializedCoreListeners=!0)}catch(t){this._handleException(t)}this._performanceCleanupCallback=xf(this)}_removeListeners(){try{q.document.removeEventListener("visibilitychange",this._handleVisibilityChange),q.removeEventListener("blur",this._handleWindowBlur),q.removeEventListener("focus",this._handleWindowFocus),q.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this._handleException(t)}}__init(){this._handleVisibilityChange=()=>{q.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const t=Re({category:"ui.blur"});this._doChangeToBackgroundTasks(t)}}__init3(){this._handleWindowFocus=()=>{const t=Re({category:"ui.focus"});this._doChangeToForegroundTasks(t)}}__init4(){this._handleKeyboardEvent=t=>{pf(this,t)}}_doChangeToBackgroundTasks(t){!this.session||ci(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){me("[Replay] Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:T.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){const t=yf(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(On(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){U&&C.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await Lh(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const o=await this.eventBuffer.finish();await wi({replayId:t,recordingData:o,segmentId:s,eventContext:r,session:this.session,options:this.getOptions(),timestamp:n})}catch(n){this._handleException(n),this.stop({reason:"sendReplay"});const r=G();r&&r.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:t=!1}={})=>{if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){U&&C.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const o=s<this._options.minReplayDuration,i=s>this._options.maxReplayDuration+5e3;if(o||i){me(`[Replay] Session duration (${Math.floor(s/1e3)}s) is too ${o?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),o&&this._debouncedFlush();return}const c=this.eventBuffer;if(c&&this.session.segmentId===0&&!c.hasCheckout&&me("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(a){U&&C.error(a)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ar(this.session)}__init6(){this._onMutationHandler=t=>{const n=t.length,r=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,o=r&&n>r;if(n>s||o){const i=Re({category:"replay.mutations",data:{count:n,limit:o}});this._createCustomBreadcrumb(i)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function wt(e,t){return[...e,...t].join(",")}function Gh({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const o=['base[href="/"]'],i=wt(e,[".sentry-mask","[data-sentry-mask]"]),c=wt(t,[]);return{maskTextSelector:i,unmaskTextSelector:c,blockSelector:wt(n,[".sentry-block","[data-sentry-block]",...o]),unblockSelector:wt(r,[]),ignoreSelector:wt(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function Vh({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:o}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?o:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?o.replace(/[\S]/g,"*"):o}const Ss='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Yh=["content-length","content-type","accept"];let vs=!1;const Xh=e=>new Dn(e);class Dn{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:t=Ru,flushMaxDelay:n=Tu,minReplayDuration:r=Pu,maxReplayDuration:s=ss,stickySession:o=!0,useCompression:i=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:p=750,mutationLimit:f=1e4,slowClickTimeout:m=7e3,slowClickIgnoreSelectors:y=[],networkDetailAllowUrls:w=[],networkDetailDenyUrls:_=[],networkCaptureBodies:v=!0,networkRequestHeaders:I=[],networkResponseHeaders:b=[],mask:k=[],maskAttributes:E=["title","placeholder"],unmask:g=[],block:x=[],unblock:M=[],ignore:S=[],maskFn:R,beforeAddRecordingEvent:P,beforeErrorSampling:K}={}){this.name=Dn.id;const V=Gh({mask:k,unmask:g,block:x,unblock:M,ignore:S});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:R,maskInputFn:R,maskAttributeFn:(se,L,ce)=>Vh({maskAttributes:E,maskAllText:u,privacyOptions:V,key:se,value:L,el:ce}),...V,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:se=>{try{se.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,Fu),maxReplayDuration:Math.min(s,ss),stickySession:o,useCompression:i,workerUrl:c,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:p,mutationLimit:f,slowClickTimeout:m,slowClickIgnoreSelectors:y,networkDetailAllowUrls:w,networkDetailDenyUrls:_,networkCaptureBodies:v,networkRequestHeaders:ws(I),networkResponseHeaders:ws(b),beforeAddRecordingEvent:P,beforeErrorSampling:K,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Ss}`:Ss),this._isInitialized&&Xn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return vs}set _isInitialized(t){vs=t}afterAllSetup(t){!Xn()||this._replay||(this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(t){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(t)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=Kh(this._initialOptions,t);this._replay=new $e({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}Dn.__initStatic();function Kh(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...In(e)},s=jr(n.replaysSessionSampleRate),o=jr(n.replaysOnErrorSampleRate);return s==null&&o==null&&ro(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),o!=null&&(r.errorSampleRate=o),r}function ws(e){return[...Yh,...e.map(t=>t.toLowerCase())]}function Jh(){const e=G();return e&&e.getIntegrationByName("Replay")}var Es;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(Es||(Es={}));function Zh(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function or(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:or(e.parentNode,t,n,r+1)}function ks(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(Zh(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}const at=`Please stop import mirror directly. Instead of that,\r now you can use replayer.getMirror() to access the mirror instance of a replayer,\r or you can use record.mirror to access the mirror instance during recording.`;let Cs={map:{},getId(){return console.error(at),-1},getNode(){return console.error(at),null},removeNodeFromMap(){console.error(at)},has(){return console.error(at),!1},reset(){console.error(at)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Cs=new Proxy(Cs,{get(e,t,n){return t==="map"&&console.error(at),Reflect.get(e,t,n)}}));function Lr(e,t,n,r,s=window){const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(i){Ci(()=>{n.set.call(this,i)},0),o&&o.set&&o.set.call(this,i)}}),()=>Lr(e,t,o||{},!0)}function Dr(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString());function Qh(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function Pn(e,t,n,r,s){if(!e)return!1;const o=Qh(e);if(!o)return!1;const i=ks(t,n),c=or(o,i);let a=-1;return c<0?!1:(r&&(a=or(o,ks(null,r))),c>-1&&a<0?!0:c<a)}const Is={};function ki(e){const t=Is[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const o=s.contentWindow;o&&o[e]&&(r=o[e]),n.head.removeChild(s)}catch{}return Is[e]=r.bind(window)}function Ge(...e){return ki("requestAnimationFrame")(...e)}function Ci(...e){return ki("setTimeout")(...e)}var yt=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(yt||{});let tn;function ep(e){tn=e}const xs=e=>tn?(...n)=>{try{return e(...n)}catch(r){if(tn&&tn(r)===!0)return()=>{};throw r}}:e;var ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tp=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Yt=0;Yt<ft.length;Yt++)tp[ft.charCodeAt(Yt)]=Yt;var np=function(e){var t=new Uint8Array(e),n,r=t.length,s="";for(n=0;n<r;n+=3)s+=ft[t[n]>>2],s+=ft[(t[n]&3)<<4|t[n+1]>>4],s+=ft[(t[n+1]&15)<<2|t[n+2]>>6],s+=ft[t[n+2]&63];return r%3===2?s=s.substring(0,s.length-1)+"=":r%3===1&&(s=s.substring(0,s.length-2)+"=="),s};const Ms=new Map;function rp(e,t){let n=Ms.get(e);return n||(n=new Map,Ms.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const Ii=(e,t,n)=>{if(!e||!(Mi(e,t)||typeof e=="object"))return;const r=e.constructor.name,s=rp(n,r);let o=s.indexOf(e);return o===-1&&(o=s.length,s.push(e)),o};function nn(e,t,n){if(e instanceof Array)return e.map(r=>nn(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,s=np(e);return{rr_type:r,base64:s}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[nn(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:s}=e;return{rr_type:r,src:s}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",s=e.toDataURL();return{rr_type:r,src:s}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[nn(e.data,t,n),e.width,e.height]};if(Mi(e,t)||typeof e=="object"){const r=e.constructor.name,s=Ii(e,t,n);return{rr_type:r,index:s}}}}return e}const xi=(e,t,n)=>e.map(r=>nn(r,t,n)),Mi=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof t[s]=="function").find(s=>e instanceof t[s]);function sp(e,t,n,r,s){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const c of i)try{if(typeof t.CanvasRenderingContext2D.prototype[c]!="function")continue;const a=Dr(t.CanvasRenderingContext2D.prototype,c,function(u){return function(...d){return Pn(this.canvas,n,r,s,!0)||Ci(()=>{const l=xi(d,t,this);e(this.canvas,{type:yt["2D"],property:c,args:l})},0),u.apply(this,d)}});o.push(a)}catch{const u=Lr(t.CanvasRenderingContext2D.prototype,c,{set(d){e(this.canvas,{type:yt["2D"],property:c,args:[d],setter:!0})}});o.push(u)}return()=>{o.forEach(c=>c())}}function op(e){return e==="experimental-webgl"?"webgl":e}function Rs(e,t,n,r,s){const o=[];try{const i=Dr(e.HTMLCanvasElement.prototype,"getContext",function(c){return function(a,...u){if(!Pn(this,t,n,r,!0)){const d=op(a);if("__context"in this||(this.__context=d),s&&["webgl","webgl2"].includes(d))if(u[0]&&typeof u[0]=="object"){const l=u[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return c.apply(this,[a,...u])}});o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(i=>i())}}function Ts(e,t,n,r,s,o,i,c){const a=[],u=Object.getOwnPropertyNames(e);for(const d of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof e[d]!="function")continue;const l=Dr(e,d,function(p){return function(...f){const m=p.apply(this,f);if(Ii(m,c,this),"tagName"in this.canvas&&!Pn(this.canvas,r,s,o,!0)){const y=xi(f,c,this),w={type:t,property:d,args:y};n(this.canvas,w)}return m}});a.push(l)}catch{const p=Lr(e,d,{set(f){n(this.canvas,{type:t,property:d,args:[f],setter:!0})}});a.push(p)}return a}function ip(e,t,n,r,s,o){const i=[];return i.push(...Ts(t.WebGLRenderingContext.prototype,yt.WebGL,e,n,r,s,o,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Ts(t.WebGL2RenderingContext.prototype,yt.WebGL2,e,n,r,s,o,t)),()=>{i.forEach(c=>c())}}var ap='for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};';function cp(){const e=new Blob([ap]);return URL.createObjectURL(e)}class lp{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,p)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(p)};const{sampling:n="all",win:r,blockClass:s,blockSelector:o,unblockSelector:i,maxCanvasSize:c,recordCanvas:a,dataURLOptions:u,errorHandler:d}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,d&&ep(d),!t.enableManualSnapshot&&xs(()=>{a&&n==="all"&&this.initCanvasMutationObserver(r,s,o,i),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,s,o,i,c,{dataURLOptions:u})})()}initCanvasFPSObserver(t,n,r,s,o,i,c){const a=Rs(n,r,s,o,!0),u=this.takeSnapshot(!1,t,n,r,s,o,i,c.dataURLOptions);this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(t,n,r,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Rs(t,n,r,s,!1),i=sp(this.processMutation.bind(this),t,n,r,s),c=ip(this.processMutation.bind(this),t,n,r,s,this.mirror);this.resetObservers=()=>{o(),i(),c()}}snapshot(t){const{options:n}=this,r=this.takeSnapshot(!0,n.sampling==="all"?2:n.sampling||2,n.win,n.blockClass,n.blockSelector,n.unblockSelector,n.maxCanvasSize,n.dataURLOptions,t);this.resetObservers=()=>{cancelAnimationFrame(r)}}takeSnapshot(t,n,r,s,o,i,c,a,u){const d=new Map,l=new Worker(cp());l.onmessage=_=>{const v=_.data,{id:I}=v;if(d.set(I,!1),!("base64"in v))return;const{base64:b,type:k,width:E,height:g}=v;this.mutationCb({id:I,type:yt["2D"],commands:[{property:"clearRect",args:[0,0,E,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:k}]},0,0,E,g]}]})};const p=1e3/n;let f=0,m;const y=_=>{if(_)return[_];const v=[];return r.document.querySelectorAll("canvas").forEach(I=>{Pn(I,s,o,i)||v.push(I)}),v},w=_=>{if(f&&_-f<p){m=Ge(w);return}f=_,y(u).forEach(v=>{const I=this.mirror.getId(v);if(!d.get(I)&&!(!v.width||!v.height)){if(d.set(I,!0),!t&&["webgl","webgl2"].includes(v.__context)){const b=v.getContext(v.__context);en([b,"optionalAccess",k=>k.getContextAttributes,"call",k=>k(),"optionalAccess",k=>k.preserveDrawingBuffer])===!1&&b.clear(b.COLOR_BUFFER_BIT)}createImageBitmap(v).then(b=>{l.postMessage({id:I,bitmap:b,width:v.width,height:v.height,dataURLOptions:a,maxCanvasSize:c},[b])}).catch(b=>{xs(()=>{throw b})()})}}),m=Ge(w)};return m=Ge(w),m}startPendingCanvasMutationFlusher(){Ge(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,Ge(t)};Ge(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),Ge(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const s=r.map(i=>{const{type:c,...a}=i;return a}),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:s}),this.pendingCanvasMutations.delete(t)}}const As={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},up="ReplayCanvas",Xt=1280,dp=(e={})=>{const[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,Xt):Xt,n?Math.min(n,Xt):Xt]};let s;const o=new Promise(i=>s=i);return{name:up,getOptions(){const{quality:i,enableManualSnapshot:c,maxCanvasSize:a}=r;return{enableManualSnapshot:c,recordCanvas:!0,getCanvasManager:u=>{const d=new lp({...u,enableManualSnapshot:c,maxCanvasSize:a,errorHandler:l=>{try{typeof l=="object"&&(l.__rrweb__=!0)}catch{}}});return s(d),d},...As[i||"medium"]||As.medium}},async snapshot(i){(await o).snapshot(i)}}},fp=be(dp),Te=_e,X=Te.document,kt=Te.navigator,hp="Report a Bug",pp="Cancel",mp="Send Bug Report",_p="Confirm",gp="Report a Bug",yp="your.email@example.org",bp="Email",Sp="What's the bug? What did you expect?",vp="Description",wp="Your Name",Ep="Name",kp="Thank you for your report!",Cp="(required)",Ip="Add a screenshot",xp="Remove screenshot",Mp="widget",Rp="api",Tp=5e3,Ri=(e,t={includeReplay:!0})=>{if(!e.message)throw new Error("Unable to submit feedback with empty message");const n=G();if(!n)throw new Error("No client setup, cannot send feedback.");e.tags&&Object.keys(e.tags).length&&Ce().setTags(e.tags);const r=To({source:Rp,url:yo(),...e},t);return new Promise((s,o)=>{const i=setTimeout(()=>o("Unable to determine if Feedback was correctly sent."),5e3);n.on("afterSendEvent",(c,a)=>{if(c.event_id===r)return clearTimeout(i),a&&typeof a.statusCode=="number"&&a.statusCode>=200&&a.statusCode<300&&s(r),a&&typeof a.statusCode=="number"&&a.statusCode===0?o("Unable to send Feedback. This is because of network issues, or because you are using an ad-blocker."):o("Unable to send Feedback. This could be because of network issues, or because you are using an ad-blocker")})})},rn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Ap(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(kt.userAgent)||/Macintosh/i.test(kt.userAgent)&&kt.maxTouchPoints&&kt.maxTouchPoints>1||!isSecureContext)}function Kt(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{t.onFormOpen&&t.onFormOpen(),e.onFormOpen&&e.onFormOpen()},onFormClose:()=>{t.onFormClose&&t.onFormClose(),e.onFormClose&&e.onFormClose()},onSubmitSuccess:n=>{t.onSubmitSuccess&&t.onSubmitSuccess(n),e.onSubmitSuccess&&e.onSubmitSuccess(n)},onSubmitError:n=>{t.onSubmitError&&t.onSubmitError(n),e.onSubmitError&&e.onSubmitError(n)},onFormSubmitted:()=>{t.onFormSubmitted&&t.onFormSubmitted(),e.onFormSubmitted&&e.onFormSubmitted()},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function Np(){const e=X.createElement("style");return e.textContent=` .widget__actor { position: fixed; z-index: var(--z-index); margin: var(--page-margin); inset: var(--actor-inset); display: flex; align-items: center; gap: 8px; padding: 16px; font-family: inherit; font-size: var(--font-size); font-weight: 600; line-height: 1.14em; text-decoration: none; background: var(--actor-background, var(--background)); border-radius: var(--actor-border-radius, 1.7em/50%); border: var(--actor-border, var(--border)); box-shadow: var(--actor-box-shadow, var(--box-shadow)); color: var(--actor-color, var(--foreground)); fill: var(--actor-color, var(--foreground)); cursor: pointer; opacity: 1; transition: transform 0.2s ease-in-out; transform: translate(0, 0) scale(1); } .widget__actor[aria-hidden="true"] { opacity: 0; pointer-events: none; visibility: hidden; transform: translate(0, 16px) scale(0.98); } .widget__actor:hover { background: var(--actor-hover-background, var(--background)); filter: var(--interactive-filter); } .widget__actor svg { width: 1.14em; height: 1.14em; } @media (max-width: 600px) { .widget__actor span { display: none; } } `,e}function ye(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}const ot=20,Op="http://www.w3.org/2000/svg";function Lp(){const e=c=>Te.document.createElementNS(Op,c),t=ye(e("svg"),{width:`${ot}`,height:`${ot}`,viewBox:`0 0 ${ot} ${ot}`,fill:"var(--foreground)"}),n=ye(e("g"),{clipPath:"url(#clip0_57_80)"}),r=ye(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);const s=e("defs"),o=ye(e("clipPath"),{id:"clip0_57_80"}),i=ye(e("rect"),{width:`${ot}`,height:`${ot}`,fill:"white"});return o.appendChild(i),s.appendChild(o),t.appendChild(s).appendChild(o).appendChild(i),t}function Dp({triggerLabel:e,shadow:t}){const n=X.createElement("button");if(n.type="button",n.className="widget__actor",n.ariaHidden="false",n.ariaLabel=e,n.appendChild(Lp()),e){const s=X.createElement("span");s.appendChild(X.createTextNode(e)),n.appendChild(s)}const r=Np();return{el:n,appendToDom(){t.appendChild(r),t.appendChild(n)},removeFromDom(){t.removeChild(n),t.removeChild(r)},show(){n.ariaHidden="false"},hide(){n.ariaHidden="true"}}}const Ti="rgba(88, 74, 192, 1)",Pp={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:Ti,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},Ns={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:Ti,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function Os(e){return` --foreground: ${e.foreground}; --background: ${e.background}; --accent-foreground: ${e.accentForeground}; --accent-background: ${e.accentBackground}; --success-color: ${e.successColor}; --error-color: ${e.errorColor}; --border: ${e.border}; --box-shadow: ${e.boxShadow}; --outline: ${e.outline}; --interactive-filter: ${e.interactiveFilter}; `}function Fp({colorScheme:e,themeDark:t,themeLight:n}){const r=X.createElement("style");return r.textContent=` :host { --font-family: system-ui, 'Helvetica Neue', Arial, sans-serif; --font-size: 14px; --z-index: 100000; --page-margin: 16px; --inset: auto 0 0 auto; --actor-inset: var(--inset); font-family: var(--font-family); font-size: var(--font-size); ${e!=="system"?"color-scheme: only light;":""} ${Os(e==="dark"?{...Ns,...t}:{...Pp,...n})} } ${e==="system"?` @media (prefers-color-scheme: dark) { :host { ${Os({...Ns,...t})} } }`:""} } `,r}const Ai=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:s="sentry-feedback",autoInject:o=!0,showBranding:i=!0,isEmailRequired:c=!1,isNameRequired:a=!1,showEmail:u=!0,showName:d=!0,enableScreenshot:l=!0,useSentryUser:p={email:"email",name:"username"},tags:f,colorScheme:m="system",themeLight:y={},themeDark:w={},addScreenshotButtonLabel:_=Ip,cancelButtonLabel:v=pp,confirmButtonLabel:I=_p,emailLabel:b=bp,emailPlaceholder:k=yp,formTitle:E=gp,isRequiredLabel:g=Cp,messageLabel:x=vp,messagePlaceholder:M=Sp,nameLabel:S=Ep,namePlaceholder:R=wp,removeScreenshotButtonLabel:P=xp,submitButtonLabel:K=mp,successMessageText:V=kp,triggerLabel:se=hp,onFormOpen:L,onFormClose:ce,onSubmitSuccess:F,onSubmitError:Z,onFormSubmitted:fe}={})=>{const he={id:s,autoInject:o,showBranding:i,isEmailRequired:c,isNameRequired:a,showEmail:u,showName:d,enableScreenshot:l,useSentryUser:p,tags:f,colorScheme:m,themeDark:w,themeLight:y,triggerLabel:se,cancelButtonLabel:v,submitButtonLabel:K,confirmButtonLabel:I,formTitle:E,emailLabel:b,emailPlaceholder:k,messageLabel:x,messagePlaceholder:M,nameLabel:S,namePlaceholder:R,successMessageText:V,isRequiredLabel:g,addScreenshotButtonLabel:_,removeScreenshotButtonLabel:P,onFormClose:ce,onFormOpen:L,onSubmitError:Z,onSubmitSuccess:F,onFormSubmitted:fe};let le=null,Ie=[];const Qe=W=>{if(!le){const te=X.createElement("div");te.id=String(W.id),X.body.appendChild(te),le=te.attachShadow({mode:"open"}),le.appendChild(Fp(W))}return le},et=async(W,te,pe)=>{const oe=G(),ne=oe&&oe.getIntegrationByName(W);if(ne)return ne;const xe=(te&&te()||await e(pe))();return oe&&oe.addIntegration(xe),xe},tt=async W=>{const te=W.enableScreenshot&&Ap(),[pe,oe]=await Promise.all([et("FeedbackModal",t,"feedbackModalIntegration"),te?et("FeedbackScreenshot",n,"feedbackScreenshotIntegration"):void 0]);if(!pe)throw rn&&C.error("[Feedback] Missing feedback modal integration. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!");return te&&!oe&&rn&&C.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots."),pe.createDialog({options:W,screenshotIntegration:te?oe:void 0,sendFeedback:Ri,shadow:Qe(W)})},nt=(W,te={})=>{const pe=Kt(he,te),oe=typeof W=="string"?X.querySelector(W):typeof W.addEventListener=="function"?W:null;if(!oe)throw rn&&C.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let ne=null;const ve=async()=>{ne||(ne=await tt({...pe,onFormClose:()=>{ne&&ne.close(),pe.onFormClose&&pe.onFormClose()},onFormSubmitted:()=>{ne&&ne.removeFromDom(),pe.onFormSubmitted&&pe.onFormSubmitted()}})),ne.appendToDom(),ne.open()};oe.addEventListener("click",ve);const xe=()=>{Ie=Ie.filter(zt=>zt!==xe),ne&&ne.removeFromDom(),ne=null,oe.removeEventListener("click",ve)};return Ie.push(xe),xe},rt=(W={})=>{const te=Kt(he,W),pe=Qe(te),oe=Dp({triggerLabel:te.triggerLabel,shadow:pe});return nt(oe.el,{...te,onFormOpen(){oe.hide()},onFormClose(){oe.show()},onFormSubmitted(){oe.show()}}),oe};return{name:"Feedback",setupOnce(){!Xn()||!he.autoInject||(X.readyState==="loading"?X.addEventListener("DOMContentLoaded",()=>rt().appendToDom):rt().appendToDom())},attachTo:nt,createWidget(W={}){const te=rt(Kt(he,W));return te.appendToDom(),te},async createForm(W={}){return tt(Kt(he,W))},remove(){le&&(le.parentElement&&le.parentElement.remove(),le=null),Ie.forEach(W=>W()),Ie=[]}}};function Bp(){const e=G();return e&&e.getIntegrationByName("Feedback")}var Fn,z,Ni,Ve,Ls,Oi,ir,Dt={},Pr=[],Hp=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Fr=Array.isArray;function Ue(e,t){for(var n in t)e[n]=t[n];return e}function Li(e){var t=e.parentNode;t&&t.removeChild(e)}function N(e,t,n){var r,s,o,i={};for(o in t)o=="key"?r=t[o]:o=="ref"?s=t[o]:i[o]=t[o];if(arguments.length>2&&(i.children=arguments.length>3?Fn.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)i[o]===void 0&&(i[o]=e.defaultProps[o]);return sn(e,i,r,s,null)}function sn(e,t,n,r,s){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Ni,__i:-1,__u:0};return s==null&&z.vnode!=null&&z.vnode(o),o}function $t(e){return e.children}function on(e,t){this.props=e,this.context=t}function bt(e,t){if(t==null)return e.__?bt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?bt(e):null}function $p(e,t,n){var r,s=e.__v,o=s.__e,i=e.__P;if(i)return(r=Ue({},s)).__v=s.__v+1,z.vnode&&z.vnode(r),Br(i,r,s,e.__n,i.ownerSVGElement!==void 0,32&s.__u?[o]:null,t,o??bt(s),!!(32&s.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=o&&Di(r),r}function Di(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Di(e)}}function Ds(e){(!e.__d&&(e.__d=!0)&&Ve.push(e)&&!vn.__r++||Ls!==z.debounceRendering)&&((Ls=z.debounceRendering)||Oi)(vn)}function vn(){var e,t,n,r=[],s=[];for(Ve.sort(ir);e=Ve.shift();)e.__d&&(n=Ve.length,t=$p(e,r,s)||t,n===0||Ve.length>n?(ar(r,t,s),s.length=r.length=0,t=void 0,Ve.sort(ir)):t&&z.__c&&z.__c(t,Pr));t&&ar(r,t,s),vn.__r=0}function Pi(e,t,n,r,s,o,i,c,a,u,d){var l,p,f,m,y,w=r&&r.__k||Pr,_=t.length;for(n.__d=a,Up(n,t,w),a=n.__d,l=0;l<_;l++)(f=n.__k[l])!=null&&typeof f!="boolean"&&typeof f!="function"&&(p=f.__i===-1?Dt:w[f.__i]||Dt,f.__i=l,Br(e,f,p,s,o,i,c,a,u,d),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&Hr(p.ref,null,f),d.push(f.ref,f.__c||m,f)),y==null&&m!=null&&(y=m),65536&f.__u||p.__k===f.__k?a=Fi(f,a,e):typeof f.type=="function"&&f.__d!==void 0?a=f.__d:m&&(a=m.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=a,n.__e=y}function Up(e,t,n){var r,s,o,i,c,a=t.length,u=n.length,d=u,l=0;for(e.__k=[],r=0;r<a;r++)(s=e.__k[r]=(s=t[r])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?sn(null,s,null,null,s):Fr(s)?sn($t,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?sn(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=e,s.__b=e.__b+1,c=zp(s,n,i=r+l,d),s.__i=c,o=null,c!==-1&&(d--,(o=n[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&l--,typeof s.type!="function"&&(s.__u|=65536)):c!==i&&(c===i+1?l++:c>i?d>a-i?l+=c-i:l--:l=c<i&&c==i-1?c-i:0,c!==r+l&&(s.__u|=65536))):(o=n[r])&&o.key==null&&o.__e&&(o.__e==e.__d&&(e.__d=bt(o)),cr(o,o,!1),n[r]=null,d--);if(d)for(r=0;r<u;r++)(o=n[r])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=bt(o)),cr(o,o))}function Fi(e,t,n){var r,s;if(typeof e.type=="function"){for(r=e.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=e,t=Fi(r[s],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function zp(e,t,n,r){var s=e.key,o=e.type,i=n-1,c=n+1,a=t[n];if(a===null||a&&s==a.key&&o===a.type)return n;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;i>=0||c<t.length;){if(i>=0){if((a=t[i])&&!(131072&a.__u)&&s==a.key&&o===a.type)return i;i--}if(c<t.length){if((a=t[c])&&!(131072&a.__u)&&s==a.key&&o===a.type)return c;c++}}return-1}function Ps(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Hp.test(t)?n:n+"px"}function Jt(e,t,n,r,s){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ps(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ps(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?Bs:Fs,o)):e.removeEventListener(t,o?Bs:Fs,o);else{if(s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Fs(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(z.event?z.event(e):e)}}function Bs(e){if(this.l)return this.l[e.type+!0](z.event?z.event(e):e)}function Br(e,t,n,r,s,o,i,c,a,u){var d,l,p,f,m,y,w,_,v,I,b,k,E,g,x,M=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),o=[c=t.__e=n.__e]),(d=z.__b)&&d(t);e:if(typeof M=="function")try{if(_=t.props,v=(d=M.contextType)&&r[d.__c],I=d?v?v.props.value:d.__:r,n.__c?w=(l=t.__c=n.__c).__=l.__E:("prototype"in M&&M.prototype.render?t.__c=l=new M(_,I):(t.__c=l=new on(_,I),l.constructor=M,l.render=jp),v&&v.sub(l),l.props=_,l.state||(l.state={}),l.context=I,l.__n=r,p=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),M.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Ue({},l.__s)),Ue(l.__s,M.getDerivedStateFromProps(_,l.__s))),f=l.props,m=l.state,l.__v=t,p)M.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(M.getDerivedStateFromProps==null&&_!==f&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(_,I),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(_,l.__s,I)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=_,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(S){S&&(S.__=t)}),b=0;b<l._sb.length;b++)l.__h.push(l._sb[b]);l._sb=[],l.__h.length&&i.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(_,l.__s,I),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(f,m,y)})}if(l.context=I,l.props=_,l.__P=e,l.__e=!1,k=z.__r,E=0,"prototype"in M&&M.prototype.render){for(l.state=l.__s,l.__d=!1,k&&k(t),d=l.render(l.props,l.state,l.context),g=0;g<l._sb.length;g++)l.__h.push(l._sb[g]);l._sb=[]}else do l.__d=!1,k&&k(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++E<25);l.state=l.__s,l.getChildContext!=null&&(r=Ue(Ue({},r),l.getChildContext())),p||l.getSnapshotBeforeUpdate==null||(y=l.getSnapshotBeforeUpdate(f,m)),Pi(e,Fr(x=d!=null&&d.type===$t&&d.key==null?d.props.children:d)?x:[x],t,n,r,s,o,i,c,a,u),l.base=t.__e,t.__u&=-161,l.__h.length&&i.push(l),w&&(l.__E=l.__=null)}catch(S){t.__v=null,a||o!=null?(t.__e=c,t.__u|=a?160:32,o[o.indexOf(c)]=null):(t.__e=n.__e,t.__k=n.__k),z.__e(S,t,n)}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Wp(n.__e,t,n,r,s,o,i,a,u);(d=z.diffed)&&d(t)}function ar(e,t,n){for(var r=0;r<n.length;r++)Hr(n[r],n[++r],n[++r]);z.__c&&z.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(o){o.call(s)})}catch(o){z.__e(o,s.__v)}})}function Wp(e,t,n,r,s,o,i,c,a){var u,d,l,p,f,m,y,w=n.props,_=t.props,v=t.type;if(v==="svg"&&(s=!0),o!=null){for(u=0;u<o.length;u++)if((f=o[u])&&"setAttribute"in f==!!v&&(v?f.localName===v:f.nodeType===3)){e=f,o[u]=null;break}}if(e==null){if(v===null)return document.createTextNode(_);e=s?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,_.is&&_),o=null,c=!1}if(v===null)w===_||c&&e.data===_||(e.data=_);else{if(o=o&&Fn.call(e.childNodes),w=n.props||Dt,!c&&o!=null)for(w={},u=0;u<e.attributes.length;u++)w[(f=e.attributes[u]).name]=f.value;for(u in w)f=w[u],u=="children"||(u=="dangerouslySetInnerHTML"?l=f:u==="key"||u in _||Jt(e,u,null,f,s));for(u in _)f=_[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?d=f:u=="value"?m=f:u=="checked"?y=f:u==="key"||c&&typeof f!="function"||w[u]===f||Jt(e,u,f,w[u],s);if(d)c||l&&(d.__html===l.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(l&&(e.innerHTML=""),Pi(e,Fr(p)?p:[p],t,n,r,s&&v!=="foreignObject",o,i,o?o[0]:n.__k&&bt(n,0),c,a),o!=null)for(u=o.length;u--;)o[u]!=null&&Li(o[u]);c||(u="value",m!==void 0&&(m!==e[u]||v==="progress"&&!m||v==="option"&&m!==w[u])&&Jt(e,u,m,w[u],!1),u="checked",y!==void 0&&y!==e[u]&&Jt(e,u,y,w[u],!1))}return e}function Hr(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){z.__e(r,n)}}function cr(e,t,n){var r,s;if(z.unmount&&z.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Hr(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){z.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&cr(r[s],t,n||typeof e.type!="function");n||e.__e==null||Li(e.__e),e.__=e.__e=e.__d=void 0}function jp(e,t,n){return this.constructor(e,n)}function qp(e,t,n){var r,s,o,i;z.__&&z.__(e,t),s=(r=typeof n=="function")?null:t.__k,o=[],i=[],Br(t,e=(!r&&n||t).__k=N($t,null,[e]),s||Dt,Dt,t.ownerSVGElement!==void 0,!r&&n?[n]:s?null:t.firstChild?Fn.call(t.childNodes):null,o,!r&&n?n:s?s.__e:t.firstChild,r,i),e.__d=void 0,ar(o,e,i)}Fn=Pr.slice,z={__e:function(e,t,n,r){for(var s,o,i;t=t.__;)if((s=t.__c)&&!s.__)try{if((o=s.constructor)&&o.getDerivedStateFromError!=null&&(s.setState(o.getDerivedStateFromError(e)),i=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,r||{}),i=s.__d),i)return s.__E=s}catch(c){e=c}throw e}},Ni=0,on.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ue({},this.state),typeof e=="function"&&(e=e(Ue({},n),this.props)),e&&Ue(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ds(this))},on.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ds(this))},on.prototype.render=$t,Ve=[],Oi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ir=function(e,t){return e.__v.__b-t.__v.__b},vn.__r=0;var De,$,Wn,Hs,St=0,Bi=[],an=[],ee=z,$s=ee.__b,Us=ee.__r,zs=ee.diffed,Ws=ee.__c,js=ee.unmount,qs=ee.__;function Ze(e,t){ee.__h&&ee.__h($,e,St||t),St=0;var n=$.__H||($.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:an}),n.__[e]}function ht(e){return St=1,Hi(Ui,e)}function Hi(e,t,n){var r=Ze(De++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ui(void 0,t),function(c){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,c);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=$,!$.u)){var s=function(c,a,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!o||o.call(this,c,a,u);var l=!1;return d.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(l=!0)}}),!(!l&&r.__c.props===c)&&(!o||o.call(this,c,a,u))};$.u=!0;var o=$.shouldComponentUpdate,i=$.componentWillUpdate;$.componentWillUpdate=function(c,a,u){if(this.__e){var d=o;o=void 0,s(c,a,u),o=d}i&&i.call(this,c,a,u)},$.shouldComponentUpdate=s}return r.__N||r.__}function Gp(e,t){var n=Ze(De++,3);!ee.__s&&$r(n.__H,t)&&(n.__=e,n.i=t,$.__H.__h.push(n))}function $i(e,t){var n=Ze(De++,4);!ee.__s&&$r(n.__H,t)&&(n.__=e,n.i=t,$.__h.push(n))}function Vp(e){return St=5,Ut(function(){return{current:e}},[])}function Yp(e,t,n){St=6,$i(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Ut(e,t){var n=Ze(De++,7);return $r(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function pt(e,t){return St=8,Ut(function(){return e},t)}function Xp(e){var t=$.context[e.__c],n=Ze(De++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub($)),t.props.value):e.__}function Kp(e,t){ee.useDebugValue&&ee.useDebugValue(t?t(e):e)}function Jp(e){var t=Ze(De++,10),n=ht();return t.__=e,$.componentDidCatch||($.componentDidCatch=function(r,s){t.__&&t.__(r,s),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Zp(){var e=Ze(De++,11);if(!e.__){for(var t=$.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Qp(){for(var e;e=Bi.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(cn),e.__H.__h.forEach(lr),e.__H.__h=[]}catch(t){e.__H.__h=[],ee.__e(t,e.__v)}}ee.__b=function(e){$=null,$s&&$s(e)},ee.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),qs&&qs(e,t)},ee.__r=function(e){Us&&Us(e),De=0;var t=($=e.__c).__H;t&&(Wn===$?(t.__h=[],$.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=an,n.__N=n.i=void 0})):(t.__h.forEach(cn),t.__h.forEach(lr),t.__h=[],De=0)),Wn=$},ee.diffed=function(e){zs&&zs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Bi.push(t)!==1&&Hs===ee.requestAnimationFrame||((Hs=ee.requestAnimationFrame)||em)(Qp)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==an&&(n.__=n.__V),n.i=void 0,n.__V=an})),Wn=$=null},ee.__c=function(e,t){t.some(function(n){try{n.__h.forEach(cn),n.__h=n.__h.filter(function(r){return!r.__||lr(r)})}catch(r){t.some(function(s){s.__h&&(s.__h=[])}),t=[],ee.__e(r,n.__v)}}),Ws&&Ws(e,t)},ee.unmount=function(e){js&&js(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{cn(r)}catch(s){t=s}}),n.__H=void 0,t&&ee.__e(t,n.__v))};var Gs=typeof requestAnimationFrame=="function";function em(e){var t,n=function(){clearTimeout(r),Gs&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Gs&&(t=requestAnimationFrame(n))}function cn(e){var t=$,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),$=t}function lr(e){var t=$;e.__c=e.__(),$=t}function $r(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ui(e,t){return typeof t=="function"?t(e):t}const tm={__proto__:null,useCallback:pt,useContext:Xp,useDebugValue:Kp,useEffect:Gp,useErrorBoundary:Jp,useId:Zp,useImperativeHandle:Yp,useLayoutEffect:$i,useMemo:Ut,useReducer:Hi,useRef:Vp,useState:ht},nm="http://www.w3.org/2000/svg";function rm(){const e=r=>X.createElementNS(nm,r),t=ye(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=ye(e("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return t.appendChild(n),t}const Vs="/home/runner/work/sentry-javascript/sentry-javascript/packages/feedback/src/modal/components/DialogHeader.tsx";function sm({options:e}){const t=Ut(()=>({__html:rm().outerHTML}),[]);return N("h2",{class:"dialog__header",__self:this,__source:{fileName:Vs,lineNumber:16}},e.formTitle,e.showBranding?N("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t,__self:this,__source:{fileName:Vs,lineNumber:19}}):null)}function om(e,t){const n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}const J="/home/runner/work/sentry-javascript/sentry-javascript/packages/feedback/src/modal/components/Form.tsx";function jn(e,t){const n=e.get(t);return typeof n=="string"?n.trim():""}function im({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:s,onSubmitSuccess:o,onSubmitError:i,showEmail:c,showName:a,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:p,cancelButtonLabel:f,emailLabel:m,emailPlaceholder:y,isEmailRequired:w,isNameRequired:_,messageLabel:v,messagePlaceholder:I,nameLabel:b,namePlaceholder:k,submitButtonLabel:E,isRequiredLabel:g}=e,[x,M]=ht(null),[S,R]=ht(!1),P=u&&u.input,[K,V]=ht(null),se=pt(F=>{V(F),R(!1)},[]),L=pt(F=>{const Z=om(F,{emailLabel:m,isEmailRequired:w,isNameRequired:_,messageLabel:v,nameLabel:b});return Z.length>0?M(`Please enter in the following required fields: ${Z.join(", ")}`):M(null),Z.length===0},[m,w,_,v,b]),ce=pt(async F=>{try{if(F.preventDefault(),!(F.target instanceof HTMLFormElement))return;const Z=new FormData(F.target),fe=await(u&&S?u.value():void 0),he={name:jn(Z,"name"),email:jn(Z,"email"),message:jn(Z,"message"),attachments:fe?[fe]:void 0};if(!L(he))return;try{await s({name:he.name,email:he.email,message:he.message,source:Mp,tags:d},{attachments:he.attachments}),o(he)}catch(le){rn&&C.error(le),M(le),i(le)}}catch{}},[u&&S,o,i]);return N("form",{class:"form",onSubmit:ce,__self:this,__source:{fileName:J,lineNumber:144}},P&&S?N(P,{onError:se,__self:this,__source:{fileName:J,lineNumber:146}}):null,N("div",{class:"form__right","data-sentry-feedback":!0,__self:this,__source:{fileName:J,lineNumber:149}},N("div",{class:"form__top",__self:this,__source:{fileName:J,lineNumber:150}},x?N("div",{class:"form__error-container",__self:this,__source:{fileName:J,lineNumber:151}},x):null,a?N("label",{for:"name",class:"form__label",__self:this,__source:{fileName:J,lineNumber:154}},N(qn,{label:b,isRequiredLabel:g,isRequired:_,__self:this,__source:{fileName:J,lineNumber:155}}),N("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:k,required:_,type:"text",__self:this,__source:{fileName:J,lineNumber:156}})):N("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden",__self:this,__source:{fileName:J,lineNumber:167}}),c?N("label",{for:"email",class:"form__label",__self:this,__source:{fileName:J,lineNumber:171}},N(qn,{label:m,isRequiredLabel:g,isRequired:w,__self:this,__source:{fileName:J,lineNumber:172}}),N("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:y,required:w,type:"email",__self:this,__source:{fileName:J,lineNumber:173}})):N("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden",__self:this,__source:{fileName:J,lineNumber:184}}),N("label",{for:"message",class:"form__label",__self:this,__source:{fileName:J,lineNumber:187}},N(qn,{label:v,isRequiredLabel:g,isRequired:!0,__self:this,__source:{fileName:J,lineNumber:188}}),N("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:I,required:!0,rows:5,__self:this,__source:{fileName:J,lineNumber:189}})),P?N("label",{for:"screenshot",class:"form__label",__self:this,__source:{fileName:J,lineNumber:201}},N("button",{class:"btn btn--default",type:"button",onClick:()=>{V(null),R(F=>!F)},__self:this,__source:{fileName:J,lineNumber:202}},S?p:l),K?N("div",{class:"form__error-container",__self:this,__source:{fileName:J,lineNumber:212}},K.message):null):null),N("div",{class:"btn-group",__self:this,__source:{fileName:J,lineNumber:216}},N("button",{class:"btn btn--primary",type:"submit",__self:this,__source:{fileName:J,lineNumber:217}},E),N("button",{class:"btn btn--default",type:"button",onClick:r,__self:this,__source:{fileName:J,lineNumber:220}},f))))}function qn({label:e,isRequired:t,isRequiredLabel:n}){return N("span",{class:"form__label__text",__self:this,__source:{fileName:J,lineNumber:239}},e,t&&N("span",{class:"form__label__text--required",__self:this,__source:{fileName:J,lineNumber:241}},n))}const Zt=16,Ys=17,am="http://www.w3.org/2000/svg";function cm(){const e=a=>Te.document.createElementNS(am,a),t=ye(e("svg"),{width:`${Zt}`,height:`${Ys}`,viewBox:`0 0 ${Zt} ${Ys}`,fill:"inherit"}),n=ye(e("g"),{clipPath:"url(#clip0_57_156)"}),r=ye(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),s=ye(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(s,r);const o=e("defs"),i=ye(e("clipPath"),{id:"clip0_57_156"}),c=ye(e("rect"),{width:`${Zt}`,height:`${Zt}`,fill:"white",transform:"translate(0 0.5)"});return i.appendChild(c),o.appendChild(i),t.appendChild(o).appendChild(i).appendChild(c),t}const Ae="/home/runner/work/sentry-javascript/sentry-javascript/packages/feedback/src/modal/components/Dialog.tsx";function lm({open:e,onFormSubmitted:t,...n}){const r=n.options,s=Ut(()=>({__html:cm().outerHTML}),[]),[o,i]=ht(null),c=pt(()=>{o&&(clearTimeout(o),i(null)),t()},[o]),a=pt(u=>{n.onSubmitSuccess(u),i(setTimeout(()=>{t(),i(null)},Tp))},[t]);return N($t,{__self:this,__source:{fileName:Ae,lineNumber:48}},o?N("div",{class:"success__position",onClick:c,__self:this,__source:{fileName:Ae,lineNumber:50}},N("div",{class:"success__content",__self:this,__source:{fileName:Ae,lineNumber:51}},r.successMessageText,N("span",{class:"success__icon",dangerouslySetInnerHTML:s,__self:this,__source:{fileName:Ae,lineNumber:53}}))):N("dialog",{class:"dialog",onClick:r.onFormClose,open:e,__self:this,__source:{fileName:Ae,lineNumber:57}},N("div",{class:"dialog__position",__self:this,__source:{fileName:Ae,lineNumber:58}},N("div",{class:"dialog__content",onClick:u=>{u.stopPropagation()},__self:this,__source:{fileName:Ae,lineNumber:59}},N(sm,{options:r,__self:this,__source:{fileName:Ae,lineNumber:66}}),N(im,{...n,onSubmitSuccess:a,__self:this,__source:{fileName:Ae,lineNumber:67}})))))}const um=` .dialog { position: fixed; z-index: var(--z-index); margin: 0; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0; height: 100vh; width: 100vw; color: var(--dialog-color, var(--foreground)); fill: var(--dialog-color, var(--foreground)); line-height: 1.75em; background-color: rgba(0, 0, 0, 0.05); border: none; inset: 0; opacity: 1; transition: opacity 0.2s ease-in-out; } .dialog__position { position: fixed; z-index: var(--z-index); inset: var(--dialog-inset); padding: var(--page-margin); display: flex; max-height: calc(100vh - (2 * var(--page-margin))); } @media (max-width: 600px) { .dialog__position { inset: var(--page-margin); padding: 0; } } .dialog__position:has(.editor) { inset: var(--page-margin); padding: 0; } .dialog:not([open]) { opacity: 0; pointer-events: none; visibility: hidden; } .dialog:not([open]) .dialog__content { transform: translate(0, -16px) scale(0.98); } .dialog__content { display: flex; flex-direction: column; gap: 16px; padding: var(--dialog-padding, 24px); max-width: 100%; width: 100%; max-height: 100%; overflow: auto; background: var(--dialog-background, var(--background)); border-radius: var(--dialog-border-radius, 20px); border: var(--dialog-border, var(--border)); box-shadow: var(--dialog-box-shadow, var(--box-shadow)); transform: translate(0, 0) scale(1); transition: transform 0.2s ease-in-out; } `,dm=` .dialog__header { display: flex; align-items: center; justify-content: space-between; font-weight: var(--dialog-header-weight, 600); margin: 0; } .brand-link { display: inline-flex; } .brand-link:focus-visible { outline: var(--outline); } `,fm=` .form { display: flex; overflow: auto; flex-direction: row; gap: 16px; flex: 1 0; } .form__right { flex: 0 0 var(--form-width, 272px); width: var(--form-width, 272px); display: flex; overflow: auto; flex-direction: column; justify-content: space-between; gap: 20px; } @media (max-width: 600px) { .form__right { width: auto; } } .form__top { display: flex; flex-direction: column; gap: 8px; } .form__error-container { color: var(--error-color); fill: var(--error-color); } .form__label { display: flex; flex-direction: column; gap: 4px; margin: 0px; } .form__label__text { display: flex; gap: 4px; align-items: center; } .form__label__text--required { font-size: 0.85em; } .form__input { font-family: inherit; line-height: inherit; background: transparent; box-sizing: border-box; border: var(--input-border, var(--border)); border-radius: var(--input-border-radius, 6px); color: var(--input-color, inherit); fill: var(--input-color, inherit); font-size: var(--input-font-size, inherit); font-weight: var(--input-font-weight, 500); padding: 6px 12px; } .form__input::placeholder { opacity: 0.65; color: var(--input-placeholder-color, inherit); filter: var(--interactive-filter); } .form__input:focus-visible { outline: var(--input-focus-outline, var(--outline)); } .form__input--textarea { font-family: inherit; resize: vertical; } .error { color: var(--error-color); fill: var(--error-color); } `,hm=` .btn-group { display: grid; gap: 8px; } .btn { line-height: inherit; border: var(--button-border, var(--border)); border-radius: var(--button-border-radius, 6px); cursor: pointer; font-family: inherit; font-size: var(--button-font-size, inherit); font-weight: var(--button-font-weight, 600); padding: var(--button-padding, 6px 16px); } .btn[disabled] { opacity: 0.6; pointer-events: none; } .btn--primary { color: var(--button-primary-color, var(--accent-foreground)); fill: var(--button-primary-color, var(--accent-foreground)); background: var(--button-primary-background, var(--accent-background)); border: var(--button-primary-border, var(--border)); border-radius: var(--button-primary-border-radius, 6px); font-weight: var(--button-primary-font-weight, 500); } .btn--primary:hover { color: var(--button-primary-hover-color, var(--accent-foreground)); fill: var(--button-primary-hover-color, var(--accent-foreground)); background: var(--button-primary-hover-background, var(--accent-background)); filter: var(--interactive-filter); } .btn--primary:focus-visible { background: var(--button-primary-hover-background, var(--accent-background)); filter: var(--interactive-filter); outline: var(--button-primary-focus-outline, var(--outline)); } .btn--default { color: var(--button-color, var(--foreground)); fill: var(--button-color, var(--foreground)); background: var(--button-background, var(--background)); border: var(--button-border, var(--border)); border-radius: var(--button-border-radius, 6px); font-weight: var(--button-font-weight, 500); } .btn--default:hover { color: var(--button-color, var(--foreground)); fill: var(--button-color, var(--foreground)); background: var(--button-hover-background, var(--background)); filter: var(--interactive-filter); } .btn--default:focus-visible { background: var(--button-hover-background, var(--background)); filter: var(--interactive-filter); outline: var(--button-focus-outline, var(--outline)); } `,pm=` .success__position { position: fixed; inset: var(--dialog-inset); padding: var(--page-margin); z-index: var(--z-index); } .success__content { background: var(--success-background, var(--background)); border: var(--success-border, var(--border)); border-radius: var(--success-border-radius, 1.7em/50%); box-shadow: var(--success-box-shadow, var(--box-shadow)); font-weight: var(--success-font-weight, 600); color: var(--success-color); fill: var(--success-color); padding: 12px 24px; line-height: 1.75em; display: grid; align-items: center; grid-auto-flow: column; gap: 6px; cursor: default; } .success__icon { display: flex; } `;function mm(){const e=X.createElement("style");return e.textContent=` :host { --dialog-inset: var(--inset); } ${um} ${dm} ${fm} ${hm} ${pm} `,e}const _m="/home/runner/work/sentry-javascript/sentry-javascript/packages/feedback/src/modal/integration.tsx";function gm(){const e=Ce().getUser(),t=xn().getUser(),n=bo().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}const ym=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const s=r,o=e.useSentryUser,i=gm(),c=X.createElement("div"),a=mm();let u="";const d={get el(){return c},appendToDom(){!s.contains(a)&&!s.contains(c)&&(s.appendChild(a),s.appendChild(c))},removeFromDom(){s.removeChild(c),s.removeChild(a),X.body.style.overflow=u},open(){p(!0),e.onFormOpen&&e.onFormOpen(),u=X.body.style.overflow,X.body.style.overflow="hidden"},close(){p(!1),X.body.style.overflow=u}},l=t&&t.createInput({h:N,hooks:tm,dialog:d,options:e}),p=f=>{qp(N(lm,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:o&&i&&i[o.name]||"",defaultEmail:o&&i&&i[o.email]||"",onFormClose:()=>{p(!1),e.onFormClose&&e.onFormClose()},onSubmit:n,onSubmitSuccess:m=>{p(!1),e.onSubmitSuccess&&e.onSubmitSuccess(m)},onSubmitError:m=>{e.onSubmitError&&e.onSubmitError(m)},onFormSubmitted:()=>{e.onFormSubmitted&&e.onFormSubmitted()},open:f,__self:void 0,__source:{fileName:_m,lineNumber:67}}),c)};return d}});function bm(){const e=X.createElement("style"),t="#1A141F",n="#302735";return e.textContent=` .editor { padding: 10px; padding-top: 65px; padding-bottom: 65px; flex-grow: 1; background-color: ${t}; background-image: repeating-linear-gradient( -145deg, transparent, transparent 8px, ${t} 8px, ${t} 11px ), repeating-linear-gradient( -45deg, transparent, transparent 15px, ${n} 15px, ${n} 16px ); } .editor__canvas-container { width: 100%; height: 100%; position: relative; display: flex; align-items: center; justify-content: center; } .editor__canvas-container canvas { object-fit: contain; position: relative; } .editor__crop-btn-group { padding: 8px; gap: 8px; border-radius: var(--menu-border-radius, 6px); background: var(--button-primary-background, var(--background)); width: 175px; position: absolute; } .editor__crop-corner { width: 30px; height: 30px; position: absolute; background: none; border: 3px solid #ffffff; } .editor__crop-corner--top-left { cursor: nwse-resize; border-right: none; border-bottom: none; } .editor__crop-corner--top-right { cursor: nesw-resize; border-left: none; border-bottom: none; } .editor__crop-corner--bottom-left { cursor: nesw-resize; border-right: none; border-top: none; } .editor__crop-corner--bottom-right { cursor: nwse-resize; border-left: none; border-top: none; } `,e}function Sm({hooks:e}){return function({onBeforeScreenshot:n,onScreenshot:r,onAfterScreenshot:s,onError:o}){e.useEffect(()=>{(async()=>{n();const c=await kt.mediaDevices.getDisplayMedia({video:{width:Te.innerWidth*Te.devicePixelRatio,height:Te.innerHeight*Te.devicePixelRatio},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),a=X.createElement("video");await new Promise((u,d)=>{a.srcObject=c,a.onloadedmetadata=()=>{r(a),c.getTracks().forEach(l=>l.stop()),u()},a.play().catch(d)}),s()})().catch(o)},[])}}const ge="/home/runner/work/sentry-javascript/sentry-javascript/packages/feedback/src/screenshot/components/ScreenshotEditor.tsx",Ct=30,Oe=3,Pe=Ct+Oe,Se=Te.devicePixelRatio,Et=e=>({x:Math.min(e.startX,e.endX),y:Math.min(e.startY,e.endY),width:Math.abs(e.startX-e.endX),height:Math.abs(e.startY-e.endY)}),Gn=e=>{const t=e.clientHeight,n=e.clientWidth,r=e.width/e.height;let s=t*r,o=t;s>n&&(s=n,o=n/r);const i=(n-s)/2,c=(t-o)/2;return{startX:i,startY:c,endX:s+i,endY:o+c}};function vm({h:e,hooks:t,imageBuffer:n,dialog:r,options:s}){const o=Sm({hooks:t});return function({onError:c}){const a=t.useMemo(()=>({__html:bm().innerText}),[]),u=t.useRef(null),d=t.useRef(null),l=t.useRef(null),[p,f]=t.useState({startX:0,startY:0,endX:0,endY:0}),[m,y]=t.useState(!1);t.useEffect(()=>{Te.addEventListener("resize",w,!1)},[]);function w(){const b=l.current,k=Et(Gn(n));if(b){b.width=k.width*Se,b.height=k.height*Se,b.style.width=`${k.width}px`,b.style.height=`${k.height}px`;const g=b.getContext("2d");g&&g.scale(Se,Se)}const E=d.current;E&&(E.style.width=`${k.width}px`,E.style.height=`${k.height}px`),f({startX:0,startY:0,endX:k.width,endY:k.height})}t.useEffect(()=>{const b=l.current;if(!b)return;const k=b.getContext("2d");if(!k)return;const E=Et(Gn(n)),g=Et(p);k.clearRect(0,0,E.width,E.height),k.fillStyle="rgba(0, 0, 0, 0.5)",k.fillRect(0,0,E.width,E.height),k.clearRect(g.x,g.y,g.width,g.height),k.strokeStyle="#ffffff",k.lineWidth=3,k.strokeRect(g.x+1,g.y+1,g.width-2,g.height-2),k.strokeStyle="#000000",k.lineWidth=1,k.strokeRect(g.x+3,g.y+3,g.width-6,g.height-6)},[p]);function _(b,k){y(!1);const E=v(k),g=()=>{X.removeEventListener("mousemove",E),X.removeEventListener("mouseup",g),y(!0)};X.addEventListener("mouseup",g),X.addEventListener("mousemove",E)}const v=t.useCallback(b=>function(k){if(!l.current)return;const E=l.current,g=E.getBoundingClientRect(),x=k.clientX-g.x,M=k.clientY-g.y;switch(b){case"top-left":f(S=>({...S,startX:Math.min(Math.max(0,x),S.endX-Pe),startY:Math.min(Math.max(0,M),S.endY-Pe)}));break;case"top-right":f(S=>({...S,endX:Math.max(Math.min(x,E.width/Se),S.startX+Pe),startY:Math.min(Math.max(0,M),S.endY-Pe)}));break;case"bottom-left":f(S=>({...S,startX:Math.min(Math.max(0,x),S.endX-Pe),endY:Math.max(Math.min(M,E.height/Se),S.startY+Pe)}));break;case"bottom-right":f(S=>({...S,endX:Math.max(Math.min(x,E.width/Se),S.startX+Pe),endY:Math.max(Math.min(M,E.height/Se),S.startY+Pe)}));break}},[]);function I(){const b=X.createElement("canvas"),k=Et(Gn(n)),E=Et(p);b.width=E.width*Se,b.height=E.height*Se;const g=b.getContext("2d");g&&n&&g.drawImage(n,E.x/k.width*n.width,E.y/k.height*n.height,E.width/k.width*n.width,E.height/k.height*n.height,0,0,b.width,b.height);const x=n.getContext("2d");x&&(x.clearRect(0,0,n.width,n.height),n.width=b.width,n.height=b.height,n.style.width=`${E.width}px`,n.style.height=`${E.height}px`,x.drawImage(b,0,0),w())}return o({onBeforeScreenshot:t.useCallback(()=>{r.el.style.display="none"},[]),onScreenshot:t.useCallback(b=>{const k=n.getContext("2d");if(!k)throw new Error("Could not get canvas context");n.width=b.videoWidth,n.height=b.videoHeight,n.style.width="100%",n.style.height="100%",k.drawImage(b,0,0)},[n]),onAfterScreenshot:t.useCallback(()=>{r.el.style.display="block";const b=u.current;b&&b.appendChild(n),w()},[]),onError:t.useCallback(b=>{r.el.style.display="block",c(b)},[])}),e("div",{class:"editor",__self:this,__source:{fileName:ge,lineNumber:258}},e("style",{dangerouslySetInnerHTML:a,__self:this,__source:{fileName:ge,lineNumber:259}}),e("div",{class:"editor__canvas-container",ref:u,__self:this,__source:{fileName:ge,lineNumber:260}},e("div",{class:"editor__crop-container",style:{position:"absolute",zIndex:1},ref:d,__self:this,__source:{fileName:ge,lineNumber:261}},e("canvas",{style:{position:"absolute"},ref:l,__self:this,__source:{fileName:ge,lineNumber:262}}),e(Qt,{left:p.startX-Oe,top:p.startY-Oe,onGrabButton:_,corner:"top-left",__self:this,__source:{fileName:ge,lineNumber:263}}),e(Qt,{left:p.endX-Ct+Oe,top:p.startY-Oe,onGrabButton:_,corner:"top-right",__self:this,__source:{fileName:ge,lineNumber:269}}),e(Qt,{left:p.startX-Oe,top:p.endY-Ct+Oe,onGrabButton:_,corner:"bottom-left",__self:this,__source:{fileName:ge,lineNumber:275}}),e(Qt,{left:p.endX-Ct+Oe,top:p.endY-Ct+Oe,onGrabButton:_,corner:"bottom-right",__self:this,__source:{fileName:ge,lineNumber:281}}),e("div",{style:{left:Math.max(0,p.endX-191),top:Math.max(0,p.endY+8),display:m?"flex":"none"},class:"editor__crop-btn-group",__self:this,__source:{fileName:ge,lineNumber:287}},e("button",{onClick:b=>{b.preventDefault(),l.current&&f({startX:0,startY:0,endX:l.current.width/Se,endY:l.current.height/Se}),y(!1)},class:"btn btn--default",__self:this,__source:{fileName:ge,lineNumber:295}},s.cancelButtonLabel),e("button",{onClick:b=>{b.preventDefault(),I(),y(!1)},class:"btn btn--primary",__self:this,__source:{fileName:ge,lineNumber:312}},s.confirmButtonLabel)))))}}function Qt({top:e,left:t,corner:n,onGrabButton:r}){return h("button",{class:`editor__crop-corner editor__crop-corner--${n} `,style:{top:e,left:t},onMouseDown:s=>{s.preventDefault(),r(s,n)},onClick:s=>{s.preventDefault()},__self:this,__source:{fileName:ge,lineNumber:342}})}const wm=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const s=X.createElement("canvas");return{input:vm({h:e,hooks:t,imageBuffer:s,dialog:n,options:r}),value:async()=>{const o=await new Promise(i=>{s.toBlob(i,"image/png")});if(o)return{data:new Uint8Array(await o.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}),Em=Ai({lazyLoadIntegration:br}),Xs=Ai({lazyLoadIntegration:br,getModalIntegration:()=>ym,getScreenshotIntegration:()=>wm});function km(e,t=1,n){Pt.increment(Ft,e,t,n)}function Cm(e,t,n){Pt.distribution(Ft,e,t,n)}function Im(e,t,n){Pt.set(Ft,e,t,n)}function xm(e,t,n){Pt.gauge(Ft,e,t,n)}function Mm(e,t,n="second",r){return Pt.timing(Ft,e,t,n,r)}const Rm={increment:km,distribution:Cm,set:Im,gauge:xm,timing:Mm};function vt(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Tm(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=vt(n);return s=>r.then(o=>s(o.transaction(t,"readwrite").objectStore(t)))}function Ur(e){return vt(e.getAllKeys())}function Am(e,t,n){return e(r=>Ur(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.max(...s,0)+1),vt(r.transaction)}))}function Nm(e,t,n){return e(r=>Ur(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.min(...s,0)-1),vt(r.transaction)}))}function Om(e){return e(t=>Ur(t).then(n=>{const r=n[0];if(r!=null)return vt(t.get(r)).then(s=>(t.delete(r),vt(t.transaction).then(()=>s)))}))}function Lm(e){let t;function n(){return t==null&&(t=Tm(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const s=await Gr(r);await Am(n(),s,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const s=await Gr(r);await Nm(n(),s,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await Om(n());if(r)return Ta(r)}catch{}}}}function Dm(e){return t=>e({...t,createStore:Lm})}function Pm(e=So){return Dm(Wc(e))}const Ks=1e6,ln=String(0),Fm="main";let zi="",Wi="",ji="",ur=ae.navigator&&ae.navigator.userAgent||"",qi="";const Bm=ae.navigator&&ae.navigator.language||ae.navigator&&ae.navigator.languages&&ae.navigator.languages[0]||"";function Hm(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const Js=ae.navigator&&ae.navigator.userAgentData;Hm(Js)&&Js.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(zi=e.platform||"",ji=e.architecture||"",qi=e.model||"",Wi=e.platformVersion||"",e.fullVersionList&&e.fullVersionList.length>0){const t=e.fullVersionList[e.fullVersionList.length-1];ur=`${t.brand} ${t.version}`}}).catch(e=>{});function $m(e){return!("thread_metadata"in e)}function Um(e){return $m(e)?jm(e):e}function zm(e){const t=e&&e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id;return typeof t=="string"&&t.length!==32&&Y&&C.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function Wm(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const s=zm(r),o=Um(n),i=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:je()*1e3),c=typeof r.timestamp=="number"?r.timestamp*1e3:je()*1e3;return{event_id:e,timestamp:new Date(i).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Aa,runtime:{name:"javascript",version:ae.navigator.userAgent},os:{name:zi,version:Wi,build_number:ur},device:{locale:Bm,model:qi,manufacturer:ur,architecture:ji,is_emulator:!1},debug_meta:{images:Vm(n.resources)},profile:o,transactions:[{name:r.transaction||"",id:r.event_id||_r(),trace_id:s,active_thread_id:ln,relative_start_ns:"0",relative_end_ns:((c-i)*1e6).toFixed(0)}]}}function Gi(e){return Le(e).op==="pageload"}function jm(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[ln]:{name:Fm}}},s=e.samples[0];if(!s)return r;const o=s.timestamp,i=typeof performance.timeOrigin=="number"?performance.timeOrigin:Yn||0,c=i-(Yn||i);return e.samples.forEach((a,u)=>{if(a.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[u]={elapsed_since_start_ns:((a.timestamp+c-o)*Ks).toFixed(0),stack_id:t,thread_id:ln};return}let d=e.stacks[a.stackId];const l=[];for(;d;){l.push(d.frameId);const f=e.frames[d.frameId];f&&r.frames[d.frameId]===void 0&&(r.frames[d.frameId]={function:f.name,abs_path:typeof f.resourceId=="number"?e.resources[f.resourceId]:void 0,lineno:f.line,colno:f.column}),d=d.parentId===void 0?void 0:e.stacks[d.parentId]}const p={elapsed_since_start_ns:((a.timestamp+c-o)*Ks).toFixed(0),stack_id:n,thread_id:ln};r.stacks[n]=l,r.samples[u]=p,n++}),r}function qm(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function Gm(e){const t=[];return wn(e,(n,r)=>{if(r==="transaction")for(let s=1;s<n.length;s++){const o=n[s];o&&o.contexts&&o.contexts.profile&&o.contexts.profile.profile_id&&t.push(n[s])}}),t}const Zs=new WeakMap;function Vm(e){const t=_e._sentryDebugIds;if(!t)return[];const n=G(),r=n&&n.getOptions(),s=r&&r.stackParser;if(!s)return[];let o;const i=Zs.get(s);i?o=i:(o=new Map,Zs.set(s,o));const c=Object.keys(t).reduce((u,d)=>{let l;const p=o.get(d);p?l=p:(l=s(d),o.set(d,l));for(let f=l.length-1;f>=0;f--){const m=l[f],y=m&&m.filename;if(m&&y){u[y]=t[d];break}}return u},{}),a=[];for(const u of e)u&&c[u]&&a.push({type:"sourcemap",code_file:u,debug_id:c[u]});return a}function Ym(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(Y&&C.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(Y&&C.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function Xm(e){return e.samples.length<2?(Y&&C.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(Y&&C.log("[Profiling] Discarding profile because it contains no frames"),!1)}let Vi=!1;const Yi=3e4;function Km(e){return typeof e=="function"}function Jm(){const e=ae.Profiler;if(!Km(e)){Y&&C.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(Yi/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{Y&&(C.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),C.log("[Profiling] Disabling profiling for current user session.")),Vi=!0}}function Qs(e){if(Vi)return Y&&C.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return Y&&C.log("[Profiling] Discarding profile because transaction was not sampled."),!1;const t=G(),n=t&&t.getOptions();if(!n)return Y&&C.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return Ym(r)?r?(r===!0?!0:Math.random()<r)?!0:(Y&&C.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(Y&&C.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(Y&&C.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function Zm(e,t,n,r){return Xm(n)?Wm(e,t,n,r):null}const Xe=new Map;function Qm(){return Xe.size}function e_(e){const t=Xe.get(e);return t&&Xe.delete(e),t}function t_(e,t){if(Xe.set(e,t),Xe.size>30){const n=Xe.keys().next().value;Xe.delete(n)}}function eo(e){let t;Gi(e)&&(t=je()*1e3);const n=Jm();if(!n)return;Y&&C.log(`[Profiling] started profiling span: ${Le(e).description}`);const r=_r();Ce().setContext("profile",{profile_id:r,start_timestamp:t});async function s(){if(e&&n)return n.stop().then(a=>{if(o&&(ae.clearTimeout(o),o=void 0),Y&&C.log(`[Profiling] stopped profiling of span: ${Le(e).description}`),!a){Y&&C.log(`[Profiling] profiler returned null profile for: ${Le(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}t_(r,a)}).catch(a=>{Y&&C.log("[Profiling] error while stopping profiler:",a)})}let o=ae.setTimeout(()=>{Y&&C.log("[Profiling] max profile duration elapsed, stopping profiling for:",Le(e).description),s()},Yi);const i=e.end.bind(e);function c(){return e?(s().then(()=>{i()},()=>{i()}),e):i()}e.end=c}const n_="BrowserProfiling",r_=()=>({name:n_,setup(e){const t=Cn(),n=t&&Tt(t);n&&Gi(n)&&Qs(n)&&eo(n),e.on("spanStart",r=>{r===Tt(r)&&Qs(r)&&eo(r)}),e.on("beforeEnvelope",r=>{if(!Qm())return;const s=Gm(r);if(!s.length)return;const o=[];for(const i of s){const c=i&&i.contexts,a=c&&c.profile&&c.profile.profile_id,u=c&&c.profile&&c.profile.start_timestamp;if(typeof a!="string"){Y&&C.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!a){Y&&C.log("[Profiling] cannot find profile for a span without a profile context");continue}c&&c.profile&&delete c.profile;const d=e_(a);if(!d){Y&&C.log(`[Profiling] Could not retrieve profile for span: ${a}`);continue}const l=Zm(a,u,d,i);l&&o.push(l)}qm(r,o)})}}),s_=be(r_),i_=Object.freeze(Object.defineProperty({__proto__:null,BrowserClient:Na,SDK_VERSION:ho,SEMANTIC_ATTRIBUTE_SENTRY_OP:Oa,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:La,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:Da,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:mo,Scope:Pa,WINDOW:ae,addBreadcrumb:pr,addEventProcessor:go,addIntegration:Fa,addTracingExtensions:Uc,breadcrumbsIntegration:Ba,browserApiErrorsIntegration:Ha,browserProfilingIntegration:s_,browserTracingIntegration:$a,captureConsoleIntegration:rl,captureEvent:Mn,captureException:kn,captureFeedback:To,captureMessage:un,captureSession:Ua,captureUserFeedback:za,chromeStackLineParser:Wa,close:ja,contextLinesIntegration:Eu,continueTrace:qa,createTransport:Ga,createUserFeedbackEnvelope:Va,debugIntegration:al,dedupeIntegration:Ya,defaultRequestInstrumentationOptions:Xa,defaultStackLineParsers:Ka,defaultStackParser:Ja,endSession:Vn,eventFromException:Za,eventFromMessage:Qa,exceptionFromError:ec,extraErrorDataIntegration:ul,feedbackAsyncIntegration:Em,feedbackIntegration:Xs,feedbackSyncIntegration:Xs,flush:tc,forceLoad:nc,functionToStringIntegration:rc,geckoStackLineParser:sc,getActiveSpan:Cn,getClient:G,getCurrentHub:Ql,getCurrentScope:Ce,getDefaultIntegrations:oc,getFeedback:Bp,getGlobalScope:bo,getIsolationScope:xn,getReplay:Jh,getRootSpan:Tt,getSpanDescendants:ic,getSpanStatusFromHttpCode:ac,globalHandlersIntegration:cc,httpClientIntegration:lu,httpContextIntegration:lc,inboundFiltersIntegration:uc,init:dc,instrumentOutgoingRequests:fc,isInitialized:hc,lastEventId:pc,lazyLoadIntegration:br,linkedErrorsIntegration:mc,makeBrowserOfflineTransport:Pm,makeFetchTransport:So,makeMultiplexedTransport:Gc,metrics:Rm,moduleMetadataIntegration:el,onLoad:_c,opera10StackLineParser:gc,opera11StackLineParser:yc,parameterize:Xc,registerSpanErrorInstrumentation:to,replayCanvasIntegration:fp,replayIntegration:Xh,reportingObserverIntegration:iu,rewriteFramesIntegration:pl,sendFeedback:Ri,sessionTimingIntegration:yl,setContext:mr,setCurrentClient:bc,setExtra:lo,setExtras:uo,setHttpStatus:Sc,setMeasurement:vc,setTag:co,setTags:ao,setUser:io,showReportDialog:wc,spanToBaggageHeader:Ec,spanToJSON:Le,spanToTraceHeader:kc,startBrowserTracingNavigationSpan:Cc,startBrowserTracingPageLoadSpan:Ic,startInactiveSpan:xc,startNewTrace:Mc,startSession:fo,startSpan:Rc,startSpanManual:oo,thirdPartyErrorFilterIntegration:xl,winjsStackLineParser:Tc,withActiveSpan:Ac,withIsolationScope:Nc,withScope:En,zodErrorsIntegration:Il},Symbol.toStringTag,{value:"Module"}));export{i_ as S}; //# sourceMappingURL=index-Bm0ugJZe.js.map