@spotlightjs/overlay 2.11.0 → 2.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -122,14 +122,14 @@ ${JSON.stringify(a,void 0,2)}`)}}}const R6=/^\s+/u;function m6(e,t,n){return _6(
122
122
  `);let n=[];for(let r=0;r<t.length;r++){if(t[r].match(/^\s*SELECT/i)){let s=[];if(t[r].match(/.*,$/))s=[t[r]];else{if(n.push(t[r]),t[r].match(/^\s*SELECT\s+.+(?!,$)/i))continue;s.push(t[++r])}for(;t[r++].match(/.*,$/);)s.push(t[r]);const i=s.map(o=>({line:o,matches:o.match(/(^.*?\S) (AS )?(\S+,?$)/i)})).map(({line:o,matches:l})=>l?{precedingText:l[1],as:l[2],alias:l[3]}:{precedingText:o}),a=dN(i.map(({precedingText:o})=>o.replace(/\s*,\s*$/,"")));s=i.map(({precedingText:o,as:l,alias:c})=>o+(c?" ".repeat(a-o.length+1)+(l??"")+c:"")),n=[...n,...s]}n.push(t[r])}return n.join(`
123
123
  `)}let X;(function(e){e[e.SPACE=0]="SPACE",e[e.NO_SPACE=1]="NO_SPACE",e[e.NO_NEWLINE=2]="NO_NEWLINE",e[e.NEWLINE=3]="NEWLINE",e[e.MANDATORY_NEWLINE=4]="MANDATORY_NEWLINE",e[e.INDENT=5]="INDENT",e[e.SINGLE_INDENT=6]="SINGLE_INDENT"})(X||(X={}));class jN{constructor(t){ut(this,"items",[]);this.indentation=t}add(...t){for(const n of t)switch(n){case X.SPACE:this.items.push(X.SPACE);break;case X.NO_SPACE:this.trimHorizontalWhitespace();break;case X.NO_NEWLINE:this.trimWhitespace();break;case X.NEWLINE:this.trimHorizontalWhitespace(),this.addNewline(X.NEWLINE);break;case X.MANDATORY_NEWLINE:this.trimHorizontalWhitespace(),this.addNewline(X.MANDATORY_NEWLINE);break;case X.INDENT:this.addIndentation();break;case X.SINGLE_INDENT:this.items.push(X.SINGLE_INDENT);break;default:this.items.push(n)}}trimHorizontalWhitespace(){for(;v6(wl(this.items));)this.items.pop()}trimWhitespace(){for(;b6(wl(this.items));)this.items.pop()}addNewline(t){if(this.items.length>0)switch(wl(this.items)){case X.NEWLINE:this.items.pop(),this.items.push(t);break;case X.MANDATORY_NEWLINE:break;default:this.items.push(t);break}}addIndentation(){for(let t=0;t<this.indentation.getLevel();t++)this.items.push(X.SINGLE_INDENT)}toString(){return this.items.map(t=>this.itemToString(t)).join("")}getLayoutItems(){return this.items}itemToString(t){switch(t){case X.SPACE:return" ";case X.NEWLINE:case X.MANDATORY_NEWLINE:return`
124
124
  `;case X.SINGLE_INDENT:return this.indentation.getSingleIndent();default:return t}}}const v6=e=>e===X.SPACE||e===X.SINGLE_INDENT,b6=e=>e===X.SPACE||e===X.SINGLE_INDENT||e===X.NEWLINE;function M6(e,t){if(t==="standard")return e;let n=[];return e.length>=10&&e.includes(" ")&&([e,...n]=e.split(" ")),t==="tabularLeft"?e=e.padEnd(9," "):e=e.padStart(9," "),e+["",...n].join(" ")}function P6(e){return aP(e)||e===q.RESERVED_CLAUSE||e===q.RESERVED_SELECT||e===q.RESERVED_SET_OPERATION||e===q.RESERVED_JOIN||e===q.LIMIT}const YT="top-level",D6="block-level";class XN{constructor(t){ut(this,"indentTypes",[]);this.indent=t}getSingleIndent(){return this.indent}getLevel(){return this.indentTypes.length}increaseTopLevel(){this.indentTypes.push(YT)}increaseBlockLevel(){this.indentTypes.push(D6)}decreaseTopLevel(){this.indentTypes.length>0&&wl(this.indentTypes)===YT&&this.indentTypes.pop()}decreaseBlockLevel(){for(;this.indentTypes.length>0&&this.indentTypes.pop()===YT;);}}class w6 extends jN{constructor(n){super(new XN(""));ut(this,"length",0);ut(this,"trailingSpace",!1);this.expressionWidth=n}add(...n){if(n.forEach(r=>this.addToLength(r)),this.length>this.expressionWidth)throw new VT;super.add(...n)}addToLength(n){if(typeof n=="string")this.length+=n.length,this.trailingSpace=!1;else{if(n===X.MANDATORY_NEWLINE||n===X.NEWLINE)throw new VT;n===X.INDENT||n===X.SINGLE_INDENT||n===X.SPACE?this.trailingSpace||(this.length++,this.trailingSpace=!0):(n===X.NO_NEWLINE||n===X.NO_SPACE)&&this.trailingSpace&&(this.trailingSpace=!1,this.length--)}}}class VT extends Error{}class fE{constructor({cfg:t,dialectCfg:n,params:r,layout:s,inline:i=!1}){ut(this,"inline",!1);ut(this,"nodes",[]);ut(this,"index",-1);this.cfg=t,this.dialectCfg=n,this.inline=i,this.params=r,this.layout=s}format(t){for(this.nodes=t,this.index=0;this.index<this.nodes.length;this.index++)this.formatNode(this.nodes[this.index]);return this.layout}formatNode(t){this.formatComments(t.leadingComments),this.formatNodeWithoutComments(t),this.formatComments(t.trailingComments)}formatNodeWithoutComments(t){switch(t.type){case ue.function_call:return this.formatFunctionCall(t);case ue.array_subscript:return this.formatArraySubscript(t);case ue.property_access:return this.formatPropertyAccess(t);case ue.parenthesis:return this.formatParenthesis(t);case ue.between_predicate:return this.formatBetweenPredicate(t);case ue.case_expression:return this.formatCaseExpression(t);case ue.case_when:return this.formatCaseWhen(t);case ue.case_else:return this.formatCaseElse(t);case ue.clause:return this.formatClause(t);case ue.set_operation:return this.formatSetOperation(t);case ue.limit_clause:return this.formatLimitClause(t);case ue.all_columns_asterisk:return this.formatAllColumnsAsterisk(t);case ue.literal:return this.formatLiteral(t);case ue.identifier:return this.formatIdentifier(t);case ue.parameter:return this.formatParameter(t);case ue.operator:return this.formatOperator(t);case ue.comma:return this.formatComma(t);case ue.line_comment:return this.formatLineComment(t);case ue.block_comment:return this.formatBlockComment(t);case ue.keyword:return this.formatKeywordNode(t)}}formatFunctionCall(t){this.withComments(t.nameKw,()=>{this.layout.add(this.showKw(t.nameKw))}),this.formatNode(t.parenthesis)}formatArraySubscript(t){this.withComments(t.array,()=>{this.layout.add(t.array.type===ue.keyword?this.showKw(t.array):t.array.text)}),this.formatNode(t.parenthesis)}formatPropertyAccess(t){this.formatNode(t.object),this.layout.add(X.NO_SPACE,"."),this.formatNode(t.property)}formatParenthesis(t){const n=this.formatInlineExpression(t.children);n?(this.layout.add(t.openParen),this.layout.add(...n.getLayoutItems()),this.layout.add(X.NO_SPACE,t.closeParen,X.SPACE)):(this.layout.add(t.openParen,X.NEWLINE),xl(this.cfg)?(this.layout.add(X.INDENT),this.layout=this.formatSubExpression(t.children)):(this.layout.indentation.increaseBlockLevel(),this.layout.add(X.INDENT),this.layout=this.formatSubExpression(t.children),this.layout.indentation.decreaseBlockLevel()),this.layout.add(X.NEWLINE,X.INDENT,t.closeParen,X.SPACE))}formatBetweenPredicate(t){this.layout.add(this.showKw(t.betweenKw),X.SPACE),this.layout=this.formatSubExpression(t.expr1),this.layout.add(X.NO_SPACE,X.SPACE,this.showNonTabularKw(t.andKw),X.SPACE),this.layout=this.formatSubExpression(t.expr2),this.layout.add(X.SPACE)}formatCaseExpression(t){this.formatNode(t.caseKw),this.layout.indentation.increaseBlockLevel(),this.layout=this.formatSubExpression(t.expr),this.layout=this.formatSubExpression(t.clauses),this.layout.indentation.decreaseBlockLevel(),this.layout.add(X.NEWLINE,X.INDENT),this.formatNode(t.endKw)}formatCaseWhen(t){this.layout.add(X.NEWLINE,X.INDENT),this.formatNode(t.whenKw),this.layout=this.formatSubExpression(t.condition),this.formatNode(t.thenKw),this.layout=this.formatSubExpression(t.result)}formatCaseElse(t){this.layout.add(X.NEWLINE,X.INDENT),this.formatNode(t.elseKw),this.layout=this.formatSubExpression(t.result)}formatClause(t){this.isOnelineClause(t)?this.formatClauseInOnelineStyle(t):xl(this.cfg)?this.formatClauseInTabularStyle(t):this.formatClauseInIndentedStyle(t)}isOnelineClause(t){return this.dialectCfg.onelineClauses[t.nameKw.text]}formatClauseInIndentedStyle(t){this.layout.add(X.NEWLINE,X.INDENT,this.showKw(t.nameKw),X.NEWLINE),this.layout.indentation.increaseTopLevel(),this.layout.add(X.INDENT),this.layout=this.formatSubExpression(t.children),this.layout.indentation.decreaseTopLevel()}formatClauseInOnelineStyle(t){this.layout.add(X.NEWLINE,X.INDENT,this.showKw(t.nameKw),X.SPACE),this.layout=this.formatSubExpression(t.children)}formatClauseInTabularStyle(t){this.layout.add(X.NEWLINE,X.INDENT,this.showKw(t.nameKw),X.SPACE),this.layout.indentation.increaseTopLevel(),this.layout=this.formatSubExpression(t.children),this.layout.indentation.decreaseTopLevel()}formatSetOperation(t){this.layout.add(X.NEWLINE,X.INDENT,this.showKw(t.nameKw),X.NEWLINE),this.layout.add(X.INDENT),this.layout=this.formatSubExpression(t.children)}formatLimitClause(t){this.withComments(t.limitKw,()=>{this.layout.add(X.NEWLINE,X.INDENT,this.showKw(t.limitKw))}),this.layout.indentation.increaseTopLevel(),xl(this.cfg)?this.layout.add(X.SPACE):this.layout.add(X.NEWLINE,X.INDENT),t.offset?(this.layout=this.formatSubExpression(t.offset),this.layout.add(X.NO_SPACE,",",X.SPACE),this.layout=this.formatSubExpression(t.count)):this.layout=this.formatSubExpression(t.count),this.layout.indentation.decreaseTopLevel()}formatAllColumnsAsterisk(t){this.layout.add("*",X.SPACE)}formatLiteral(t){this.layout.add(t.text,X.SPACE)}formatIdentifier(t){this.layout.add(t.text,X.SPACE)}formatParameter(t){this.layout.add(this.params.get(t),X.SPACE)}formatOperator({text:t}){this.cfg.denseOperators||this.dialectCfg.alwaysDenseOperators.includes(t)?this.layout.add(X.NO_SPACE,t):t===":"?this.layout.add(X.NO_SPACE,t,X.SPACE):this.layout.add(t,X.SPACE)}formatComma(t){this.inline?this.layout.add(X.NO_SPACE,",",X.SPACE):this.layout.add(X.NO_SPACE,",",X.NEWLINE,X.INDENT)}withComments(t,n){this.formatComments(t.leadingComments),n(),this.formatComments(t.trailingComments)}formatComments(t){t&&t.forEach(n=>{n.type===ue.line_comment?this.formatLineComment(n):this.formatBlockComment(n)})}formatLineComment(t){kT(t.precedingWhitespace||"")?this.layout.add(X.NEWLINE,X.INDENT,t.text,X.MANDATORY_NEWLINE,X.INDENT):this.layout.getLayoutItems().length>0?this.layout.add(X.NO_NEWLINE,X.SPACE,t.text,X.MANDATORY_NEWLINE,X.INDENT):this.layout.add(t.text,X.MANDATORY_NEWLINE,X.INDENT)}formatBlockComment(t){this.isMultilineBlockComment(t)?(this.splitBlockComment(t.text).forEach(n=>{this.layout.add(X.NEWLINE,X.INDENT,n)}),this.layout.add(X.NEWLINE,X.INDENT)):this.layout.add(t.text,X.SPACE)}isMultilineBlockComment(t){return kT(t.text)||kT(t.precedingWhitespace||"")}isDocComment(t){const n=t.split(/\n/);return/^\/\*\*?$/.test(n[0])&&n.slice(1,n.length-1).every(r=>/^\s*\*/.test(r))&&/^\s*\*\/$/.test(wl(n))}splitBlockComment(t){return this.isDocComment(t)?t.split(/\n/).map(n=>/^\s*\*/.test(n)?" "+n.replace(/^\s*/,""):n):t.split(/\n/).map(n=>n.replace(/^\s*/,""))}formatSubExpression(t){return new fE({cfg:this.cfg,dialectCfg:this.dialectCfg,params:this.params,layout:this.layout,inline:this.inline}).format(t)}formatInlineExpression(t){const n=this.params.getPositionalParameterIndex();try{return new fE({cfg:this.cfg,dialectCfg:this.dialectCfg,params:this.params,layout:new w6(this.cfg.expressionWidth),inline:!0}).format(t)}catch(r){if(r instanceof VT){this.params.setPositionalParameterIndex(n);return}else throw r}}formatKeywordNode(t){switch(t.tokenType){case q.RESERVED_JOIN:return this.formatJoin(t);case q.AND:case q.OR:case q.XOR:return this.formatLogicalOperator(t);default:return this.formatKeyword(t)}}formatJoin(t){xl(this.cfg)?(this.layout.indentation.decreaseTopLevel(),this.layout.add(X.NEWLINE,X.INDENT,this.showKw(t),X.SPACE),this.layout.indentation.increaseTopLevel()):this.layout.add(X.NEWLINE,X.INDENT,this.showKw(t),X.SPACE)}formatKeyword(t){this.layout.add(this.showKw(t),X.SPACE)}formatLogicalOperator(t){this.cfg.logicalOperatorNewline==="before"?xl(this.cfg)?(this.layout.indentation.decreaseTopLevel(),this.layout.add(X.NEWLINE,X.INDENT,this.showKw(t),X.SPACE),this.layout.indentation.increaseTopLevel()):this.layout.add(X.NEWLINE,X.INDENT,this.showKw(t),X.SPACE):this.layout.add(this.showKw(t),X.NEWLINE,X.INDENT)}showKw(t){return P6(t.tokenType)?M6(this.showNonTabularKw(t),this.cfg.indentStyle):this.showNonTabularKw(t)}showNonTabularKw(t){switch(this.cfg.keywordCase){case"preserve":return fN(t.raw);case"upper":return t.text;case"lower":return t.text.toLowerCase()}}}class x6{constructor(t,n){this.dialect=t,this.cfg=n,this.params=new r6(this.cfg.params)}format(t){const n=this.parse(t),r=this.formatAst(n);return this.postFormat(r).trimEnd()}parse(t){return S6(this.dialect.tokenizer).parse(t,this.cfg.paramTypes||{})}formatAst(t){return t.map(n=>this.formatStatement(n)).join(`
125
- `.repeat(this.cfg.linesBetweenQueries+1))}formatStatement(t){const n=new fE({cfg:this.cfg,dialectCfg:this.dialect.formatOptions,params:this.params,layout:new jN(new XN(HN(this.cfg)))}).format(t.children);return t.hasSemicolon&&(this.cfg.newlineBeforeSemicolon?n.add(X.NEWLINE,";"):n.add(X.NO_NEWLINE,";")),n.toString()}postFormat(t){return this.cfg.tabulateAlias&&(t=y6(t)),(this.cfg.commaPosition==="before"||this.cfg.commaPosition==="tabular")&&(t=m6(t,this.cfg.commaPosition,HN(this.cfg))),t}}class $i extends Error{}function U6(e){if("multilineLists"in e)throw new $i("multilineLists config is no more supported.");if("newlineBeforeOpenParen"in e)throw new $i("newlineBeforeOpenParen config is no more supported.");if("newlineBeforeCloseParen"in e)throw new $i("newlineBeforeCloseParen config is no more supported.");if("aliasAs"in e)throw new $i("aliasAs config is no more supported.");if(e.expressionWidth<=0)throw new $i(`expressionWidth config must be positive number. Received ${e.expressionWidth} instead.`);if(e.commaPosition==="before"&&e.useTabs)throw new $i("commaPosition: before does not work when tabs are used for indentation.");return e.params&&!F6(e.params)&&console.warn('WARNING: All "params" option values should be strings.'),e}function F6(e){return(e instanceof Array?e:Object.values(e)).every(n=>typeof n=="string")}const KN={bigquery:"bigquery",db2:"db2",hive:"hive",mariadb:"mariadb",mysql:"mysql",n1ql:"n1ql",plsql:"plsql",postgresql:"postgresql",redshift:"redshift",spark:"spark",sqlite:"sqlite",sql:"sql",trino:"trino",transactsql:"transactsql",tsql:"transactsql",singlestoredb:"singlestoredb",snowflake:"snowflake"},G6=Object.keys(KN),k6={tabWidth:2,useTabs:!1,keywordCase:"preserve",indentStyle:"standard",logicalOperatorNewline:"before",tabulateAlias:!1,commaPosition:"after",expressionWidth:50,linesBetweenQueries:1,denseOperators:!1,newlineBeforeSemicolon:!1},B6=(e,t={})=>{if(typeof t.language=="string"&&!G6.includes(t.language))throw new $i(`Unsupported SQL dialect: ${t.language}`);const n=KN[t.language||"sql"];return H6(e,{...t,dialect:kD[n]})},H6=(e,{dialect:t,...n})=>{if(typeof e!="string")throw new Error("Invalid query argument. Expected string, instead got "+typeof e);const r=U6({...k6,...n});return new x6(e6(t),r).format(e)},zN=/^db(\.[A-Za-z]+)?$/,Dr={avgDuration:"AVG_DURATION",timeSpent:"TIME_SPENT",description:"DESC",avgEncodedSize:"AVG_ENCODED_SIZE"},Y6=[{id:"description",title:"Resource Description",sortKey:Dr.description,primary:!0},{id:"avgDuration",title:"Avg Duration",sortKey:Dr.avgDuration},{id:"timeSpent",title:"Time Spent",sortKey:Dr.timeSpent},{id:"avgEncodedSize",title:"Avg Encoded Size",sortKey:Dr.avgEncodedSize}],ai={queryDesc:"QUERY_DESCRIPTION",timeSpent:"TIME_SPENT",avgDuration:"AVG_DURATION"},V6=[{id:"queryDesc",title:"Query Description",sortKey:ai.queryDesc,primary:!0},{id:"avgDuration",title:"Avg Duration",sortKey:ai.avgDuration},{id:"timeSpent",title:"Time Spent",sortKey:ai.timeSpent}],eo={count:"count",lastSeen:"lastSeen"},W6=[{id:"transaction",title:"Transaction",primary:!0},{id:"lastSeen",title:"Last Seen",sortKey:eo.lastSeen},{id:"count",title:"Count",sortKey:eo.count}],to={timestamp:"timestamp",duration:"duration"},j6=[{id:"eventId",title:"Event Id",primary:!0},{id:"toalDuration",title:"Total Duration",sortKey:to.duration},{id:"timestamp",title:"Timestamp",sortKey:to.timestamp},{id:"traceId",title:"Trace Id"}],oi={foundIn:"FOUND_IN",spanId:"SPAN_ID",timeSpent:"TIME_SPENT"},X6=[{id:"foundIn",title:"Found In",sortKey:oi.foundIn,primary:!0},{id:"spanId",title:"Span Id",sortKey:oi.spanId},{id:"timeSpent",title:"Time Spent",sortKey:oi.timeSpent}],nn={pages:"Pages",lcp:"LCP",fcp:"FCP",fid:"FID",cls:"CLS",ttfb:"TTFB",score:"PERFORMANCE_TOTAL_SCORE"},K6=[{id:"pages",title:"Pages",sortKey:nn.pages,primary:!0},{id:"lcp",title:"LCP",sortKey:nn.lcp},{id:"fcp",title:"FCP",sortKey:nn.fcp},{id:"fid",title:"FID",sortKey:nn.fid},{id:"cls",title:"CLS",sortKey:nn.cls},{id:"ttfb",title:"TTFB",sortKey:nn.ttfb},{id:"score",title:"Perf Score",sortKey:nn.score}],JN={profiles:[{name:"Chrome",scoreComponents:[{measurement:"fcp",weight:.15,p10:900,p50:1600,optional:!1},{measurement:"lcp",weight:.3,p10:1200,p50:2400,optional:!1},{measurement:"fid",weight:.3,p10:100,p50:300,optional:!0},{measurement:"cls",weight:.15,p10:.1,p50:.25,optional:!1},{measurement:"ttfb",weight:.1,p10:200,p50:400,optional:!1}],condition:{op:"eq",name:"event.contexts.browser.name",value:"Chrome"}}]};function qN(e,t=2){if(e==0)return"0 B";const n=1024,r=t,s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,i)).toFixed(r))+" "+s[i]}const ZN=({title:e,titleId:t,...n})=>y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",className:"bi bi-chevron-down",viewBox:"0 0 16 16","aria-labelledby":t,...n},e?y.createElement("title",{id:t},e):null,y.createElement("path",{fillRule:"evenodd",d:"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"}));function z6({handleResize:e,isResizing:t,setIsResizing:n,...r}){const[s,i]=y.useState(!1),a=c=>{c.target instanceof HTMLDivElement&&e(c)},o=c=>{c.preventDefault(),i(!0),n(!0),document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)},l=()=>{n(!1),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};return A.jsx("div",{className:Ae("resizer","absolute left-0 top-0 h-full w-1 cursor-col-resize rounded-sm p-0.5 transition-colors",s||t?"bg-primary-600 translate-x-[-2px] transform":""),onClick:c=>c.preventDefault(),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onMouseOver:()=>i(!0),onMouseDown:o,...r})}const J6=({span:e,startTimestamp:t,totalDuration:n,depth:r=1,traceContext:s,totalTransactions:i=0,spanNodeWidth:a,setSpanNodeWidth:o=()=>{},query:l})=>{var f,m;const{spanId:c}=Ws(),u=y.useRef(null),[E,h]=y.useState(e.transaction&&i>1&&r!==1||r>=15),[R,_]=y.useState(!1),C=Pl(e.start_timestamp,e.timestamp),O=p=>{if(u.current){const I=u.current.getBoundingClientRect(),N=(p.clientX-I.left)/I.width*100;o(N)}},d=l?e.span_id.includes(l)||((f=e.op)==null?void 0:f.includes(l))||((m=e.description)==null?void 0:m.includes(l)):!1;return A.jsxs("li",{className:"pl-4",ref:u,children:[A.jsxs(Ht,{className:Ae("hover:bg-primary-900 group flex text-sm",d?"bg-primary-200 bg-opacity-20":"",c===e.span_id?"bg-primary-900":""),style:{pointerEvents:R?"none":"auto"},to:`/explore/traces/${e.trace_id}/spans/${e.span_id}`,children:[A.jsxs("div",{className:Ae("node group-hover:bg-primary-900",d?"bg-transparent":"",e.status&&e.status!=="ok"?"text-red-400":"",c===e.span_id?"bg-primary-900":"bg-primary-950"),style:{width:`${a}%`},children:[(e.children||[]).length>0&&A.jsxs("div",{className:"bg-primary-600 z-10 mr-1 flex items-center gap-1 rounded-lg px-1 text-xs font-bold text-white",onClick:p=>{p.preventDefault(),h(I=>!I)},children:[(e.children||[]).length,A.jsx(ZN,{width:12,height:12,className:Ae("transition",E?"rotate-0":"rotate-180")})]}),e.transaction&&A.jsx(ni,{size:16,platform:e.transaction.platform}),e.op&&A.jsxs(A.Fragment,{children:[A.jsx("span",{className:"font-bold",children:e.op}),A.jsx("span",{className:"text-primary-400",children:"–"})]}),A.jsx("span",{className:"block truncate",title:e.description||e.span_id,children:e.description||e.span_id})]}),A.jsxs("div",{className:Ae("waterfall",d?"!bg-transparent":""),style:{left:`${a}%`},children:[A.jsx(z6,{setIsResizing:_,isResizing:R,handleResize:O}),A.jsx("div",{className:"bg-primary-900 absolute -m-0.5 w-full p-0.5",style:{left:`calc(min(${(e.start_timestamp-t)/n*100}%, 95% - 1px) + 4px)`,width:`max(1px, ${C/n*95}%)`},children:A.jsxs("span",{className:Ae("whitespace-nowrap",iP(C)),children:[C.toLocaleString()," ms"]})})]})]}),!E&&A.jsx(WT,{traceContext:s,tree:e.children||[],startTimestamp:t,totalDuration:n,depth:r+1,totalTransactions:i,spanNodeWidth:a,setSpanNodeWidth:o,query:l})]},e.span_id)};function WT({traceContext:e,tree:t,startTimestamp:n,totalDuration:r,depth:s=1,totalTransactions:i,spanNodeWidth:a,setSpanNodeWidth:o,query:l}){return!t||!t.length?null:A.jsx("ul",{className:"tree",children:t.map(c=>A.jsx(J6,{traceContext:e,depth:s,span:c,totalTransactions:i,startTimestamp:n,totalDuration:r,spanNodeWidth:a,setSpanNodeWidth:o,query:l},c.span_id))})}function q6({desc:e,dbType:t}){if(e.startsWith("{")||t==="mongodb")try{return A.jsx(Za,{data:JSON.parse(e)})}catch{}let n=e;if(e.match(/^(SELECT|INSERT|UPDATE|DELETE|TRUNCATE|ALTER) /i))try{n=B6(e.replace(/([\s,(])(%[a-z])([\s,)])/gim,"$1?$3"),{language:t||"sql"})}catch(r){console.error(r)}return A.jsx("pre",{className:"text-primary-300 whitespace-pre-wrap break-words font-mono text-sm",children:n})}function Z6(e,t){return typeof t=="number"?e.indexOf("size")!==-1||e.indexOf("length")!==-1?qN(t):t.toLocaleString():`${t}`}function Q6({span:e}){var r,s;let t=null,n=null;return e.op&&zN.test(e.op)&&e.description?(n="Query",t=A.jsx(q6,{desc:e.description,dbType:(r=e.data)==null?void 0:r["db.system"]})):e.op==="resource.img"&&((s=e.description)==null?void 0:s.indexOf("/"))===0?(n="Preview",t=A.jsx("a",{href:e.description,className:"border-primary-950 hover:border-primary-700 -m-2 inline-block max-w-sm cursor-pointer rounded border p-1",children:A.jsx("img",{src:e.description,alt:"preview",style:{maxHeight:300}})})):e.description?(n="Description",t=A.jsx("pre",{className:"text-primary-300 whitespace-pre-wrap break-words font-mono text-sm",children:e.description})):t=A.jsx("div",{className:"text-primary-300",children:"No description recorded for this span."}),A.jsxs("div",{children:[n&&A.jsx("h2",{className:"mb-2 font-bold uppercase",children:n}),t]})}function $6({traceContext:e,span:t,startTimestamp:n,totalDuration:r,totalTransactions:s}){var c;const[i,a]=y.useState(50),o=Pl(t.start_timestamp,t.timestamp),l=nt.getEventsByTrace(t.trace_id).filter(u=>u.type!=="transaction"&&"exception"in u);return A.jsxs(z_,{backto:`/explore/traces/${t.trace_id}`,children:[A.jsx(K_,{title:"Span Details",subtitle:A.jsxs(A.Fragment,{children:[t.op&&A.jsxs(A.Fragment,{children:[t.op," ",A.jsx("span",{className:"text-primary-500",children:"—"})," "]}),t.span_id]}),backto:`/explore/traces/${t.trace_id}`}),A.jsxs("div",{className:"space-y-6",children:[A.jsx("div",{children:A.jsxs("div",{className:"flex flex-col space-y-4",children:[A.jsxs("div",{className:"text-primary-300 flex flex-1 items-center gap-x-1",children:[A.jsx(EE,{date:t.start_timestamp}),A.jsx("span",{children:"—"}),A.jsxs("span",{children:[A.jsxs("strong",{children:[Pl(n,t.start_timestamp)," ms"]})," into trace"]})]}),A.jsx("div",{className:"flex-1",children:A.jsx("div",{className:"border-primary-800 relative h-8 border py-1",children:A.jsx("div",{className:"bg-primary-800 absolute bottom-0 top-0 -m-0.5 flex w-full items-center p-0.5",style:{left:`min(${(t.start_timestamp-n)/r*100}%, 100% - 1px)`,width:`max(1px, ${o/r*100}%)`},children:A.jsxs("span",{className:"whitespace-nowrap",children:[o," ms"]})})})})]})}),l.length>0&&A.jsxs("div",{className:"flex flex-col items-start",children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Related Errors"}),l.map(u=>A.jsx(Ht,{className:"cursor-pointer underline",to:`/errors/${u.event_id}`,children:A.jsx(F_,{event:u})},u.event_id))]}),A.jsx(Q6,{span:t}),A.jsxs("div",{children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Tags"}),t.tags&&Object.keys(t.tags).length?A.jsx("table",{className:"w-full text-sm",children:A.jsx("tbody",{children:Object.entries(t.tags).map(([u,E])=>A.jsxs("tr",{className:"text-primary-300",children:[A.jsx("th",{className:" w-1/12 py-0.5 pr-4 text-left font-mono font-normal",children:A.jsx("div",{className:"w-full truncate",children:u})}),A.jsx("td",{className:"py-0.5",children:A.jsx("pre",{className:"whitespace-nowrap font-mono",children:JSON.stringify(E,void 0,2)})})]},u))})}):A.jsx("div",{className:"text-primary-300",children:"No tags recorded for this span."})]}),A.jsxs("div",{children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Context"}),A.jsx("table",{className:"w-full text-sm",children:A.jsx("tbody",{children:[["status",t.status||""],["trace",t.trace_id],["span",t.span_id],["parent",t.parent_span_id?A.jsx(Ht,{className:"underline",to:`/explore/traces/${t.trace_id}/spans/${t.parent_span_id}`,children:t.parent_span_id},`link-to-${t.parent_span_id}`):""],["op",t.op]].map(([u,E])=>A.jsxs("tr",{className:"text-primary-300",children:[A.jsx("th",{className:" w-1/12 py-0.5 pr-4 text-left font-mono font-normal",children:A.jsx("div",{className:"w-full truncate",children:u})}),A.jsx("td",{className:"py-0.5",children:A.jsx("pre",{className:"whitespace-nowrap font-mono",children:E})})]},u))})})]}),t.data&&A.jsxs("div",{children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Data"}),A.jsx("table",{className:"w-full text-sm",children:A.jsx("tbody",{children:Object.entries(t.data).map(([u,E])=>A.jsxs("tr",{className:"text-primary-300",children:[A.jsx("th",{className:" w-1/12 py-0.5 pr-4 text-left font-mono font-normal",children:A.jsx("div",{className:"w-full truncate",children:u})}),A.jsx("td",{className:"py-0.5",children:A.jsx("pre",{className:"whitespace-nowrap font-mono",children:Z6(u,E)})})]},u))})})]}),(((c=t.children)==null?void 0:c.length)??0)>0&&A.jsxs("div",{children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Sub-tree"}),A.jsx(WT,{traceContext:e,tree:[t],startTimestamp:n,totalDuration:r,totalTransactions:s,spanNodeWidth:i,setSpanNodeWidth:a})]})]})]})}const ew=50;function QN({traceId:e}){const{spanId:t}=Ws(),[n,r]=y.useState(ew),s=nt.getTraceById(e),i=t?nt.getSpanById(e,t):void 0,a=s.start_timestamp,o=s.timestamp-a;return A.jsxs(A.Fragment,{children:[A.jsx("div",{className:"px-6 py-4",children:A.jsxs("div",{className:"text-primary-300 flex flex-1 items-center gap-x-1",children:[A.jsx("div",{className:"text-primary-200",children:A.jsx(EE,{date:s.start_timestamp})}),A.jsx("span",{children:"—"}),A.jsxs("span",{children:[A.jsxs("strong",{className:"text-primary-200 font-bold",children:[Pl(s.start_timestamp,s.timestamp).toLocaleString()," ms"]})," ","recorded in"," ",A.jsxs("strong",{className:"text-primary-200 font-bold",children:[s.spans.length.toLocaleString()," spans"]})]})]})}),A.jsx("div",{className:"flex-1 px-2 pb-6",children:A.jsx(WT,{traceContext:s,tree:s.spanTree,startTimestamp:a,totalDuration:o,totalTransactions:(s.transactions||[]).length,spanNodeWidth:n,setSpanNodeWidth:r})}),i?A.jsx($6,{traceContext:s,startTimestamp:a,totalDuration:o,span:i,totalTransactions:(s.transactions||[]).length}):null]})}function tw(){const{traceId:e}=Ws(),t=zi(e),n=cs();if(!e)return A.jsx("p",{className:"text-primary-300 p-6",children:"Unknown trace id"});const r=nt.getTraceById(e);if(!r)return A.jsxs("p",{className:"text-primary-300 p-6",children:["Trace not found. Check for more"," ",A.jsx(Ht,{to:"/traces",className:"underline",children:"traces"})]});const s=t.filter(a=>{var o,l,c,u;return a.type!=="transaction"&&((l=(o=a.contexts)==null?void 0:o.trace)!=null&&l.trace_id?n.isLocalToSession((u=(c=a.contexts)==null?void 0:c.trace)==null?void 0:u.trace_id):null)!==!1}).length,i=[rr("details","Details"),rr("context","Context"),rr("errors","Errors",{notificationCount:{count:s,severe:s>0}})];return A.jsxs(A.Fragment,{children:[A.jsx(sP,{trace:r}),A.jsx(Cl,{tabs:i,nested:!0}),A.jsxs(Gn,{children:[A.jsx(De,{path:"details",element:A.jsx(QN,{traceId:e})}),A.jsx(De,{path:"spans/:spanId",element:A.jsx(QN,{traceId:e})}),A.jsx(De,{path:"context",element:A.jsx(W_,{event:r.rootTransaction||r.transactions[0]})}),A.jsx(De,{path:"errors",element:A.jsx(X_,{traceId:e})}),A.jsx(De,{path:"*",element:A.jsx(wu,{to:`/explore/traces/${e}/details`,replace:!0})})]})]})}const nw=()=>(y.useContext(Ki),nt.getTraces());function rw(){const e=nw(),t=cs(),n=qa(),[r,s]=y.useState(!n.experiments["sentry:focus-local-events"]),i=r?e:e.filter(o=>t.isLocalToSession(o.trace_id)!==!1),a=e.length-i.length;return A.jsx(A.Fragment,{children:e.length!==0?A.jsxs(GT,{children:[a>0&&A.jsx(Ml,{itemCount:a,onClick:()=>{s(!0)}}),i.map(o=>{const l=Pl(o.start_timestamp,o.timestamp);return A.jsxs(Ht,{className:"hover:bg-primary-900 flex cursor-pointer items-center gap-x-4 px-6 py-2",to:o.trace_id,children:[A.jsx(q_,{trace:o}),A.jsxs("div",{className:"text-primary-300 flex w-48 flex-col truncate font-mono text-sm",children:[A.jsxs("div",{className:"flex items-center gap-x-2",children:[A.jsx("div",{children:Ji(o.trace_id)}),t.isLocalToSession(o.trace_id)?A.jsx(FT,{title:"This trace is part of your local session.",children:"Local"}):null]}),A.jsx(uE,{date:o.start_timestamp})]}),A.jsx(Z_,{trace:o}),A.jsx("div",{className:"flex flex-col truncate font-mono",children:A.jsxs("div",{className:"text-primary-300 flex space-x-2 text-sm",children:[A.jsx("div",{className:Ae(o.status==="ok"?"text-green-400":o.status?"text-red-400":""),children:o.status||""}),A.jsx("div",{children:"—"}),A.jsxs("div",{children:[l," ms"]}),A.jsx("div",{children:"—"}),A.jsxs("div",{children:[o.spans.length.toLocaleString()," spans, ",o.transactions.length.toLocaleString()," txns"]})]})})]},o.trace_id)})]}):A.jsx("div",{className:"text-primary-300 p-6",children:"Looks like there's no traces recorded matching this query. 🤔"})})}function sw(){return A.jsxs(Gn,{children:[A.jsx(De,{path:"/:traceId/*",element:A.jsx(tw,{})}),A.jsx(De,{path:"/",element:A.jsx(rw,{})})]})}function iw(){const e=nt.getTraces().filter(n=>nt.isTraceLocal(n.trace_id)!==!1),t=[rr("traces","Traces",{notificationCount:{count:e.length}}),rr("sdks","SDKs"),rr("envelopes","Envelopes")];return A.jsxs(A.Fragment,{children:[A.jsx(Cl,{tabs:t,nested:!0}),A.jsxs("div",{className:"flex-1",children:[A.jsxs(Gn,{children:[A.jsx(De,{path:"/envelopes/*",element:A.jsx($M,{})}),A.jsx(De,{path:"/sdks/*",element:A.jsx(nP,{})}),A.jsx(De,{path:"/traces/*",element:A.jsx(sw,{})}),A.jsx(De,{path:"*",element:A.jsx(wu,{to:"/explore/traces",replace:!0})})]}),A.jsx(xu,{})]})]})}function aw(){return A.jsx(Qa,{children:A.jsx(Gn,{children:A.jsx(De,{path:"/*",element:A.jsx(iw,{})})})})}const pE=()=>{y.useContext(Ki);const e=cs(),t=nt.getTraces(),n=t.filter(i=>e.isLocalToSession(i.trace_id)!==!1),r=t.reduce((i,a)=>[...i,...a.spans],[]),s=n.reduce((i,a)=>[...i,...a.spans],[]);return{allSpans:r,localSpans:s}},no=({title:e,titleId:t,...n})=>y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:24,height:24,viewBox:"0 0 24 24","aria-labelledby":t,...n},e?y.createElement("title",{id:t},e):null,y.createElement("path",{d:"M17,14 C17.8092996,14 18.2680938,14.9010044 17.836059,15.5493995 L17.7682213,15.6401844 L12.7682213,21.6401844 C12.3950792,22.0879549 11.7283228,22.1178063 11.3160321,21.7297385 L11.2317787,21.6401844 L6.23177872,15.6401844 C5.71367776,15.0184632 6.11213562,14.0891988 6.88682851,14.0060047 L7,14 L17,14 Z M11.2317787,2.3598156 C11.6049208,1.91204508 12.2716772,1.88219371 12.6839679,2.2702615 L12.7682213,2.3598156 L17.7682213,8.3598156 C18.2863222,8.98153675 17.8878644,9.91080124 17.1131715,9.99399528 L17,10 L7,10 C6.19070043,10 5.73190618,9.09899556 6.16394105,8.45060047 L6.23177872,8.3598156 L11.2317787,2.3598156 Z"})),ro=({title:e,titleId:t,...n})=>y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:24,height:24,viewBox:"-96 0 512 512","aria-labelledby":t,...n},e?y.createElement("title",{id:t},e):null,y.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"}));function so({defaultSortType:e="",defaultAsc:t=!1}){const[n,r]=y.useState({active:e,asc:t});return{toggleSortOrder:i=>r(a=>a.active===i?{active:i,asc:!a.asc}:{active:i,asc:!1}),sort:n,setSort:r}}const ow=({query:e,spanData:t})=>{const r=t.filter(a=>a.description===e).map(a=>a.timestamp-a.start_timestamp),s=r.reduce((a,o)=>a+o,0);return{avgDuration:s/r.length,timeSpent:s,description:e}},$N={[ai.queryDesc]:(e,t)=>e.description<t.description?-1:e.description>t.description?1:0,[ai.avgDuration]:(e,t)=>e.avgDuration-t.avgDuration,[ai.timeSpent]:(e,t)=>e.timeSpent-t.timeSpent},lw=({showAll:e})=>{const{allSpans:t,localSpans:n}=pE(),{sort:r,toggleSortOrder:s}=so({defaultSortType:ai.timeSpent}),i=y.useMemo(()=>{const a=$N[r.active]||$N[ai.timeSpent],l=(e?t:n).filter(u=>zN.test(u.op||"")),c=new Set(l.map(u=>String(u==null?void 0:u.description).trim()));return c.delete(""),[...c].map(u=>ow({query:u,spanData:l})).sort((u,E)=>r.asc?a(u,E):a(E,u))},[t,n,e,r]);return i!=null&&i.length?A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:V6.map(a=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 select-none px-6 py-3.5 text-sm font-semibold",a.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer items-center gap-1",a.primary?"justify-start":"justify-end"),onClick:()=>s(a.sortKey),children:[a.title,r.active===a.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",r.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"})]})},a.id))})}),A.jsx("tbody",{children:i.map(a=>A.jsxs("tr",{className:"hover:bg-primary-900",children:[A.jsx("td",{className:"text-primary-200 w-2/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/insights/queries/${btoa(a.description)}`,children:a.description})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(a.avgDuration)}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(a.timeSpent)})]},a.description))})]}):A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"No Database queries found. Add integration in Sentry initialization to track Database queries."})};function jT({crumbs:e}){return A.jsx("div",{className:"flex items-center gap-1 px-6 py-4",children:e.map((t,n)=>{const r=n===e.length-1;return A.jsxs("div",{className:"flex items-center gap-1",children:[n>0&&A.jsx(ZN,{width:12,height:12,className:"stroke-primary-300 -rotate-90"}),t.link&&t.to?A.jsx(Ht,{className:Ae(r?"text-primary-200":"text-primary-300","hover:text-primary-100 truncate text-sm hover:underline"),to:t.to,children:t.label}):A.jsx("span",{className:Ae(r?"text-primary-200":"text-primary-300","truncate text-sm"),children:t.label})]},t.id)})})}const eI={[oi.foundIn]:(e,t)=>e.trace_id<t.trace_id?-1:e.trace_id>t.trace_id?1:0,[oi.spanId]:(e,t)=>e.span_id<t.span_id?-1:e.span_id>t.span_id?1:0,[oi.timeSpent]:(e,t)=>e.timestamp-e.start_timestamp-(t.timestamp-t.start_timestamp)},cw=({showAll:e})=>{const{allSpans:t,localSpans:n}=pE(),{type:r}=Ws(),{sort:s,toggleSortOrder:i}=so({defaultSortType:oi.timeSpent}),a=y.useMemo(()=>{if(!r)return[];const o=e?t:n,l=eI[s.active]||eI[oi.timeSpent],c=atob(r);return o.filter(u=>u.description===c).sort((u,E)=>s.asc?l(u,E):l(E,u))},[t,n,e,s,r]);return!a||!a.length?A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"Query not found."}):A.jsxs(A.Fragment,{children:[A.jsx(jT,{crumbs:[{id:"queries",label:"Queries",link:!0,to:"/insights/queries"},{id:"querySummary",label:"Query Summary",link:!1}]}),A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:X6.map(o=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 px-6 py-3.5 text-sm font-semibold",o.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer select-none items-center gap-1",o.primary?"justify-start":"justify-end"),onClick:()=>i(o.sortKey),children:[o.title,s.active===o.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",s.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"})]})},o.id))})}),A.jsx("tbody",{children:a.map(o=>A.jsxs("tr",{className:"hover:bg-primary-900",children:[A.jsx("td",{className:"text-primary-200 w-2/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/explore/traces/${o.trace_id}`,children:Ji(o.trace_id)})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/explore/traces/${o.trace_id}/spans/${o.span_id}`,children:Ji(o.span_id)})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(o.timestamp-o.start_timestamp)})]},o.span_id))})]})]})},uw=e=>{switch(e){case"top":return"bottom-full left-1/2 transform -translate-x-1/2 mb-2";case"bottom":return"top-full left-1/2 transform -translate-x-1/2 mt-2";case"left":return"top-1/2 right-full transform -translate-y-1/2 mr-2";default:return"top-1/2 left-full transform -translate-y-1/2 ml-2"}},Ew=({content:e,position:t="right",children:n})=>{const[r,s]=y.useState(!1),i=()=>{s(!0)},a=()=>{s(!1)};return A.jsxs("div",{className:"relative inline-block max-w-full",onMouseEnter:i,onMouseLeave:a,children:[n,r&&A.jsx("div",{className:Ae("absolute z-10",uw(t)),children:e})]})},dw=({resource:e,spanData:t})=>{const n=t.filter(a=>a.description===e),r=n.reduce((a,o)=>a+(o.timestamp-o.start_timestamp),0),s=r/n.length,i=n.reduce((a,o)=>{const l=o.data&&o.data["http.response_content_length"];return typeof l=="number"?a+l:a},0)/n.length;return{avgDuration:s,timeSpent:r,description:e,avgEncodedSize:i,similarResources:n}},fw=(e,t)=>{if(t.type)return e.filter(n=>n.description===t.type);if(t.regex){const n=new RegExp(t.regex);return e.filter(r=>n.test(r.op||""))}return[]},tI={[Dr.description]:(e,t)=>e.description<t.description?-1:e.description>t.description?1:0,[Dr.avgEncodedSize]:(e,t)=>e.avgEncodedSize-t.avgEncodedSize,[Dr.avgDuration]:(e,t)=>e.avgDuration-t.avgDuration,[Dr.timeSpent]:(e,t)=>e.timeSpent-t.timeSpent},pw=({showAll:e})=>{const{allSpans:t,localSpans:n}=pE(),{sort:r,toggleSortOrder:s}=so({defaultSortType:Dr.timeSpent}),i=y.useMemo(()=>{const a=fw(e?t:n,{regex:/resource\.[A-Za-z]+/}),o=new Set(a.map(u=>String(u==null?void 0:u.description).trim()));o.delete("");const l=[...o],c=tI[r.active]||tI[Dr.timeSpent];return l.map(u=>dw({resource:u,spanData:a})).sort((u,E)=>r.asc?c(u,E):c(E,u))},[r,e,t,n]);return i!=null&&i.length?A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:Y6.map(a=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 px-6 py-3.5 text-sm font-semibold",a.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer select-none items-center gap-1",a.primary?"justify-start":"justify-end"),onClick:()=>s(a.sortKey),children:[a.title,r.active===a.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",r.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"})]})},a.id))})}),A.jsx("tbody",{children:i.map(a=>{var o;return A.jsxs("tr",{className:"hover:bg-primary-900",children:[A.jsx("td",{className:"text-primary-200 relative w-2/5 whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:A.jsx(Ew,{position:"right",content:a.similarResources[0].op==="resource.img"&&((o=a.description)==null?void 0:o.indexOf("/"))===0&&A.jsxs("div",{className:"bg-primary-800 cursor-pointer rounded-lg p-4 shadow-md",children:[A.jsx("h2",{className:"mb-2 font-bold",children:"Preview"}),A.jsx("img",{src:a.description,className:"inline-block max-h-[150px] max-w-[150px] rounded p-1",alt:"preview"})]}),children:A.jsx("div",{className:"truncate",children:a.description})})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(a.avgDuration)}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(a.timeSpent)}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:qN(a.avgEncodedSize)})]},a.description)})})]}):A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"No Resource found."})},nI=Math.sqrt(2);function Tw(e){const t=.254829592,n=-.284496736,r=1.421413741,s=-1.453152027,i=1.061405429,a=.3275911,o=e<0?-1:1,l=Math.abs(e),c=1/(1+a*l),u=1-((((i*c+s)*c+r)*c+n)*c+t)*c*Math.exp(-l*l);return o*u}function hw(e,t){return Math.abs(Math.log(e)-Math.log(t))/(nI*.9061938024368232)}function Aw(e,t,n){return .5*(1-Tw((Math.log(e)-Math.log(n))/(nI*hw(n,t))))}function rI(e,t){if(t)for(const n of t.profiles){const r=e.measurements;if(r){let s=!1,i=0,a=0;for(const o of n.scoreComponents)o.optional&&!Object.prototype.hasOwnProperty.call(r,o.measurement)||(a+=o.weight);if(Math.abs(a)<Number.EPSILON)break;for(const o of n.scoreComponents){let l=0;if(Object.prototype.hasOwnProperty.call(r,o.measurement)){l=o.weight/a;const c=r[o.measurement].value,u=Aw(Math.max(0,c),o.p10,o.p50),E=u*l;i+=E,s=!0,r[`score.${o.measurement}`]={value:u,unit:"ratio"}}else r[`score.${o.measurement}`]={value:0,unit:"ratio"};r[`score.weight.${o.measurement}`]={value:l,unit:"ratio"}}s&&(r["score.total"]={value:i,unit:"ratio"});break}}}function Sw(e,t,n,r,s,i,a,o){const l=e/2+r+o,c={x:t+e/2-i/2,y:n+e/2+a/2},u=Object.values(s).reduce((w,k)=>w+k,0),E=-90,h=w=>w/u*360,[R,_,C,O,d]=[s.lcp,s.fcp,s.fid,s.cls,s.ttfb].map(h),f=c.x+l*Math.cos((E+R/2)*Math.PI/180),m=c.y+l*Math.sin((E+R/2)*Math.PI/180),p=c.x+l*Math.cos((E+R+_/2)*Math.PI/180),I=c.y+l*Math.sin((E+R+_/2)*Math.PI/180),T=c.x+l*Math.cos((E+R+_+C/2)*Math.PI/180),N=c.y+l*Math.sin((E+R+_+C/2)*Math.PI/180),g=c.x+l*Math.cos((E+R+_+C+O/2)*Math.PI/180),P=c.y+l*Math.sin((E+R+_+C+O/2)*Math.PI/180),S=c.x-12+l*Math.cos((E+R+_+C+O+d/2)*Math.PI/180),b=c.y+l*Math.sin((E+R+_+C+O+d/2)*Math.PI/180);return{lcpX:f,lcpY:m,fcpX:p,fcpY:I,fidX:T,fidY:N,clsX:g,clsY:P,ttfbX:S,ttfbY:b}}const sI={[nn.pages]:(e,t)=>e.transaction&&t.transaction&&e.transaction<t.transaction?-1:e.transaction&&t.transaction&&e.transaction>t.transaction?1:0,[nn.lcp]:(e,t)=>e.measurements["score.lcp"].value-t.measurements["score.lcp"].value,[nn.fid]:(e,t)=>e.measurements["score.fid"].value-t.measurements["score.fid"].value,[nn.fcp]:(e,t)=>e.measurements["score.fcp"].value-t.measurements["score.fcp"].value,[nn.cls]:(e,t)=>e.measurements["score.cls"].value-t.measurements["score.cls"].value,[nn.ttfb]:(e,t)=>e.measurements["score.ttfb"].value-t.measurements["score.ttfb"].value,[nn.score]:(e,t)=>e.measurements["score.total"].value-t.measurements["score.total"].value},Rw=()=>{const e=zi(),t=xi(),{sort:n,toggleSortOrder:r}=so({defaultSortType:nn.score}),s=y.useMemo(()=>{const i=sI[n.active]||sI[nn.score];return e.filter(a=>{var o,l;return a.measurements&&((l=(o=a==null?void 0:a.contexts)==null?void 0:o.trace)==null?void 0:l.op)==="pageload"}).map(a=>{const o={...a};return rI(o,JN),o}).sort((a,o)=>n.asc?i(a,o):i(o,a))},[e,n]);return s!=null&&s.length?A.jsx(A.Fragment,{children:A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:K6.map(i=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 px-6 py-3.5 text-sm font-semibold",i.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer select-none items-center gap-1",i.primary?"justify-start":"justify-end"),onClick:()=>r(i.sortKey),children:[i.title,n.active===i.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",n.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"})]})},i.id))})}),A.jsx("tbody",{children:s.map(i=>{var a,o,l,c,u,E;return A.jsxs("tr",{className:"hover:bg-primary-900 cursor-pointer",onClick:()=>t(`/insights/webvitals/${i.event_id}`),children:[A.jsx("td",{className:"text-primary-200 w-2/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:i.transaction}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(a=i.measurements)!=null&&a.lcp?Tn(i.measurements.lcp.value):"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(o=i.measurements)!=null&&o.fcp?Tn(i.measurements.fcp.value):"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(l=i.measurements)!=null&&l.fid?Tn(i.measurements.fid.value):"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(c=i.measurements)!=null&&c.cls?i.measurements.cls.value:"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(u=i.measurements)!=null&&u.ttfb?Tn(i.measurements.ttfb.value):"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(E=i.measurements["score.total"])!=null&&E.value?Math.trunc(i.measurements["score.total"].value*100):"-"})]},i.event_id)})})]})}):A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"No Measurements found."})},mw=-90,_w=1;function Nw({values:e,maxValues:t,size:n=20,barWidth:r=3,text:s,textCss:i,segmentColors:a,backgroundColors:o,progressEndcaps:l,onHoverActions:c,onBlur:u,...E}){const h=n/2,R=n/4,_=n/2-r/2,C=2*Math.PI*_,O=y.useMemo(()=>{const d=t.reduce((m,p)=>m+p,0);let f=mw;return t.flatMap((m,p)=>{const I=Math.min(Math.max(e[p],0),m),T=e.length>1?_w:0,N=(1-Math.max(m-T,0)/d)*C,g=(1-Math.max(I-T,0)/d)*C,P=f;f+=360*m/d;const S=_+r/2,b=`${S}-${o[p]}-${a[p]}`;return[A.jsx("circle",{strokeDashoffset:N,r:_,cx:S,cy:S,onMouseOver:()=>c==null?void 0:c[p](),onFocus:()=>c==null?void 0:c[p](),onMouseLeave:()=>u==null?void 0:u(),onBlur:()=>u==null?void 0:u(),className:Ae(o[p]),style:{fill:"none",strokeWidth:r,strokeDasharray:`${C} ${C}`,transform:`rotate(${P}deg)`,transformOrigin:"50% 50%",transition:"stroke 300ms"}},`ring-bg-${b}`),A.jsx("circle",{strokeDashoffset:g,strokeLinecap:l,r:_,cx:S,cy:S,onMouseOver:()=>c==null?void 0:c[p](),onFocus:()=>c==null?void 0:c[p](),onMouseLeave:()=>u==null?void 0:u(),onBlur:()=>u==null?void 0:u(),className:Ae(a[p]),style:{fill:"none",strokeWidth:r,strokeDasharray:`${C} ${C}`,transform:`rotate(${P}deg)`,transformOrigin:"50% 50%",transition:"stroke 300ms, stroke-dashoffset 300ms"}},`ring-bar-${b}`)]})},[o,r,C,t,c,u,l,_,a,e]);return A.jsxs("svg",{className:"relative",role:"img",height:_*2+r,width:_*2+r,...E,children:[A.jsx("title",{children:"Web Vitals Breakdown"}),O,A.jsx("foreignObject",{height:h,width:h,x:R,y:R,children:s!==void 0?A.jsx("div",{className:Ae("text-primary-100 flex h-full w-full items-center justify-center text-xl font-bold",i),children:s}):null})]})}class XT extends Error{}function Iw(e,{signal:t}){return new Promise((n,r)=>{t.aborted&&r(new XT);const s=()=>{r(new XT)},i=new IntersectionObserver(a=>{for(const o of a){const l=o.boundingClientRect;n(l),t.removeEventListener("abort",s)}i.disconnect()});t.addEventListener("abort",s),i.observe(e)})}function Ow({elem:e,onPositionChange:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,...i}){const a=y.useRef(new AbortController),o=y.useCallback(async c=>{if(!e.current){t(void 0);return}try{const u=await Iw(e.current,{signal:a.current.signal});t({height:u.height,left:Math.min(c.clientX-u.left,u.width),top:Math.min(c.clientY-u.top,u.height),width:u.width})}catch(u){if(u instanceof XT)return}},[t,a,e]),l=y.useCallback(()=>{a.current&&(a.current.abort(),a.current=new AbortController),t(void 0)},[t,a]);return{...i,onMouseEnter:c=>{o(c),n==null||n(c)},onMouseMove:c=>{var u;(u=e.current)!=null&&u.contains(c.target)&&(o(c),r==null||r(c))},onMouseLeave:c=>{l(),s==null||s(c)}}}function Ul({webVital:e,coordinates:t,labelCoordinates:n={}}){var i,a;const r=((i=n==null?void 0:n[e])==null?void 0:i.x)??0,s=((a=n==null?void 0:n[e])==null?void 0:a.y)??0;return A.jsx("text",{className:"fill-primary-200 stroke-primary-200 uppercase",x:t.x+r,y:t.y+s,children:e})}const Cw=({metricScore:e,metricWeights:t,totalScore:n,size:r=200,barWidth:s=25,left:i=40,top:a=25,labelWidthPadding:o=28,labelHeightPadding:l=14,radiusPadding:c=4})=>{const[u,E]=y.useState(null),[h,R]=y.useState({x:0,y:0}),_=y.useRef(null),C=Ow({elem:_,onPositionChange:S=>{if(S){const{left:b,top:w}=S;R({x:b,y:w})}}}),{lcpX:O,lcpY:d,fcpX:f,fcpY:m,fidX:p,fidY:I,clsX:T,clsY:N,ttfbX:g,ttfbY:P}=Sw(r,i,a,s,t,o,l,c);return A.jsxs("div",{ref:_,...C,children:[u&&A.jsxs("div",{className:Ae("bg-primary-900 border-primary-400 absolute flex w-40 items-center justify-between rounded-lg border p-3 shadow-lg"),style:{transform:`translate3d(${h.x-100}px, ${h.y-74}px, 0px)`},children:[A.jsx("span",{className:"text-primary-200",children:`${u.toUpperCase()} Score:`}),A.jsx("span",{className:"text-primary-200 font-semibold",children:e[`${u}Score`]})]}),A.jsxs("svg",{height:r+3*a,width:r+3*i,children:[A.jsxs(A.Fragment,{children:[t.lcp>0&&A.jsx(Ul,{webVital:"lcp",coordinates:{x:O,y:d}}),t.fcp>0&&A.jsx(Ul,{webVital:"fcp",coordinates:{x:f,y:m}}),t.fid>0&&A.jsx(Ul,{webVital:"fid",coordinates:{x:p,y:I}}),t.cls>0&&A.jsx(Ul,{webVital:"cls",coordinates:{x:T,y:N}}),t.ttfb>0&&A.jsx(Ul,{webVital:"ttfb",coordinates:{x:g,y:P}})]}),A.jsx(Nw,{values:[(e.lcpScore??0)*t.lcp*.01,(e.fcpScore??0)*t.fcp*.01,(e.fidScore??0)*t.fid*.01,(e.clsScore??0)*t.cls*.01,(e.ttfbScore??0)*t.ttfb*.01],maxValues:[t.lcp,t.fcp,t.fid,t.cls,t.ttfb],text:n,size:r,barWidth:s,segmentColors:["stroke-primary-300","stroke-primary-400","stroke-primary-500","stroke-primary-600","stroke-primary-700"],backgroundColors:["stroke-gray-400","stroke-gray-400","stroke-gray-400","stroke-gray-400","stroke-gray-400"],x:i,y:a,onHoverActions:[()=>E("lcp"),()=>E("fcp"),()=>E("fid"),()=>E("cls"),()=>E("ttfb")],onBlur:()=>E(null)})]})]})},gw=()=>{var r,s,i,a,o;const e=zi(),{page:t}=Ws(),n=[];if(e.filter(l=>l.event_id===t).map(l=>{const c={...l};rI(c,JN),n.push(c)}),t&&n.length){const l={fcpScore:Math.trunc(n[0].measurements["score.fcp"].value*100),lcpScore:Math.trunc(n[0].measurements["score.lcp"].value*100),fidScore:Math.trunc(n[0].measurements["score.fid"].value*100),clsScore:Math.trunc(n[0].measurements["score.cls"].value*100),ttfbScore:Math.trunc(n[0].measurements["score.ttfb"].value*100)},c={fcp:Math.trunc(n[0].measurements["score.weight.fcp"].value*100),lcp:Math.trunc(n[0].measurements["score.weight.lcp"].value*100),fid:Math.trunc(n[0].measurements["score.weight.fid"].value*100),cls:Math.trunc(n[0].measurements["score.weight.cls"].value*100),ttfb:Math.trunc(n[0].measurements["score.weight.ttfb"].value*100)},u=Math.trunc(n[0].measurements["score.total"].value*100),E=[{id:"fcpScore",description:"First Contentful Paint",label:"FCP",score:(r=n[0].measurements)!=null&&r.fcp?Tn(n[0].measurements.fcp.value):"-"},{id:"lcpScore",description:"Largest Contentful Paint",label:"LCP",score:(s=n[0].measurements)!=null&&s.lcp?Tn(n[0].measurements.lcp.value):"-"},{id:"fidScore",description:"First Input Delay",label:"FID",score:(i=n[0].measurements)!=null&&i.fid?Tn(n[0].measurements.fid.value):"-"},{id:"clsScore",description:"Cumulative Layout Shift",label:"CLS",score:(a=n[0].measurements)!=null&&a.cls?Tn(n[0].measurements.cls.value):"-"},{id:"ttfbScore",description:"Time to First Byte",label:"TTFB",score:(o=n[0].measurements)!=null&&o.ttfb?Tn(n[0].measurements.ttfb.value):"-"}];return A.jsxs(A.Fragment,{children:[A.jsx(jT,{crumbs:[{id:"webVitals",label:"Web Vitals",link:!0,to:"/insights/webvitals"},{id:"performanceSummary",label:"Performance Summary",link:!1}]}),A.jsxs("div",{className:"w-full px-6",children:[A.jsx("div",{className:"flex w-full items-center justify-center p-6",children:A.jsx(Cw,{totalScore:u,metricWeights:c,metricScore:l})}),A.jsx("div",{className:"flex w-full flex-wrap justify-center gap-2",children:E.map(h=>A.jsxs("div",{className:"bg-primary-900 border-primary-400 flex w-80 flex-col items-center gap-4 rounded-lg border p-2 shadow-lg",children:[A.jsx("span",{className:"text-primary-300 text-base font-semibold",children:h.label}),A.jsx("span",{className:"text-primary-300 text-sm font-light",children:h.description}),A.jsx("h2",{className:"text-primary-300 text-lg font-bold",children:h.score??"-"})]},h.id))})]})]})}return A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"No measurement found."})};function Lw(){const e=qa(),{allSpans:t,localSpans:n}=pE(),[r,s]=y.useState(!e.experiments["sentry:focus-local-events"]),i=t.length-n.length,a=[rr("queries","Queries"),rr("webvitals","Web Vitals"),rr("resources","Resources")];return A.jsxs(A.Fragment,{children:[!r&&i>0&&A.jsx(Ml,{itemCount:i,onClick:()=>{s(!0)}}),A.jsx(Cl,{tabs:a,nested:!0}),A.jsxs("div",{className:"flex-1",children:[A.jsxs(Gn,{children:[A.jsx(De,{path:"queries/:type",element:A.jsx(cw,{showAll:r})}),A.jsx(De,{path:"resources",element:A.jsx(pw,{showAll:r})}),A.jsx(De,{path:"webvitals",element:A.jsx(Rw,{})}),A.jsx(De,{path:"webvitals/:page",element:A.jsx(gw,{})}),A.jsx(De,{path:"queries",element:A.jsx(lw,{showAll:r})}),A.jsx(De,{path:"*",element:A.jsx(wu,{to:"/insights/queries",replace:!0})})]}),A.jsx(xu,{})]})]})}function yw(){return A.jsx(Qa,{children:A.jsx(Gn,{children:A.jsx(De,{path:"/*",element:A.jsx(Lw,{})})})})}function vw({showAll:e}){const{name:t}=Ws(),n=zi(),r=cs(),{sort:s,toggleSortOrder:i}=so({defaultSortType:to.timestamp}),a=y.useMemo(()=>{if(!t)return[];const o={[to.timestamp]:(R,_)=>R.start_timestamp-_.start_timestamp,[to.duration]:(R,_)=>R.timestamp+_.start_timestamp-R.start_timestamp-_.timestamp},l=atob(t),c=n.filter(R=>R.type==="transaction").filter(R=>R.transaction===l),u=e?c:c.filter(R=>{var C,O;const _=(O=(C=R.contexts)==null?void 0:C.trace)==null?void 0:O.trace_id;return!_||r.isLocalToSession(_)}),E=o[s.active]||o[to.timestamp];return u.sort((R,_)=>s.asc?E(R,_):E(_,R))},[s,e,n,r,t]);return A.jsx(A.Fragment,{children:a.length!==0?A.jsxs("div",{children:[A.jsx(jT,{crumbs:[{id:"transactions",label:"Transactions",link:!0,to:"/performance/transactions"},{id:"txnSummary",label:"Transaction Summary",link:!1}]}),A.jsx("div",{className:"w-11/12 px-6 py-4",children:A.jsx("h1",{className:"truncate text-2xl font-bold",children:atob(t)})}),A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:j6.map(o=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 select-none px-6 py-3.5 text-sm font-semibold",o.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer items-center gap-1",o.primary?"justify-start":"justify-end"),onClick:()=>o.sortKey&&i(o.sortKey),children:[o.title,o.sortKey&&(s.active===o.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",s.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"}))]})},o.id))})}),A.jsx("tbody",{children:a.map(o=>{var l,c,u,E,h,R,_,C;return A.jsxs("tr",{className:"hover:bg-primary-900",children:[A.jsx("td",{className:"text-primary-200 w-2/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/explore/traces/${(c=(l=o.contexts)==null?void 0:l.trace)==null?void 0:c.trace_id}/spans/${(E=(u=o.contexts)==null?void 0:u.trace)==null?void 0:E.span_id}`,children:Ji(o.event_id)})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(o.timestamp-o.start_timestamp)}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:A.jsx(EE,{date:o.start_timestamp})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/explore/traces/${(R=(h=o.contexts)==null?void 0:h.trace)==null?void 0:R.trace_id}`,children:Ji((C=(_=o.contexts)==null?void 0:_.trace)==null?void 0:C.trace_id)})})]},o.event_id)})})]})]}):A.jsx("div",{className:"text-primary-300 p-6",children:"Looks like there's no transaction recorded matching this query. 🤔"})})}function bw({showAll:e}){const t=zi(),n=cs(),r=xi(),{sort:s,toggleSortOrder:i}=so({defaultSortType:eo.lastSeen}),a=y.useMemo(()=>{const o={[eo.count]:(h,R)=>h[1].transactions.length-R[1].transactions.length,[eo.lastSeen]:(h,R)=>h[1].lastSeen-R[1].lastSeen},l=o[s.active]||o[eo.lastSeen],c=t.filter(h=>h.type==="transaction"),E=(e?c:c.filter(h=>{var _,C;const R=(C=(_=h.contexts)==null?void 0:_.trace)==null?void 0:C.trace_id;return!R||n.isLocalToSession(R)})).reduce((h,R)=>(R.transaction&&(R.transaction in h?(h[R.transaction].transactions.push(R),R.start_timestamp&&(h[R.transaction].lastSeen=R.start_timestamp)):h[R.transaction]={transactions:[R],lastSeen:R.start_timestamp}),h),{});return Object.entries(E).sort((h,R)=>s.asc?l(h,R):l(R,h))},[s,e,t,n]);return A.jsx(A.Fragment,{children:a.length!==0?A.jsx("div",{children:A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:W6.map(o=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 select-none px-6 py-3.5 text-sm font-semibold",o.primary?"w-3/5":"w-1/5"),children:A.jsxs("div",{className:Ae("flex cursor-pointer items-center gap-1",o.primary?"justify-start":"justify-end"),onClick:()=>o.sortKey&&i(o.sortKey),children:[o.title,o.sortKey&&(s.active===o.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",s.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"}))]})},o.id))})}),A.jsx("tbody",{children:a.map(([o,l])=>A.jsxs("tr",{className:"hover:bg-primary-900 cursor-pointer",onClick:()=>{r(`/performance/transactions/${btoa(o)}`)},children:[A.jsx("td",{className:"text-primary-200 w-3/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:o}),A.jsx("td",{className:"text-primary-200 w-1/5 whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:A.jsx(EE,{date:l.lastSeen})}),A.jsx("td",{className:"text-primary-200 w-1/5 whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:l.transactions.length})]},o))})]})}):A.jsx("div",{className:"text-primary-300 p-6",children:"Looks like there's no transactions recorded matching this query. 🤔"})})}function Mw(){const e=zi(),t=cs(),n=qa(),[r,s]=y.useState(!n.experiments["sentry:focus-local-events"]),i=e.filter(l=>l.type==="transaction"),a=r?i:i.filter(l=>{var u,E;const c=(E=(u=l.contexts)==null?void 0:u.trace)==null?void 0:E.trace_id;return!c||t.isLocalToSession(c)}),o=i.length-a.length;return A.jsxs("div",{className:"flex-1",children:[o>0&&A.jsx(Ml,{itemCount:o,onClick:()=>{s(!0)}}),A.jsxs(Gn,{children:[A.jsx(De,{path:"transactions",element:A.jsx(bw,{showAll:r})}),A.jsx(De,{path:"transactions/:name",element:A.jsx(vw,{showAll:r})}),A.jsx(De,{path:"*",element:A.jsx(wu,{to:"/performance/transactions",replace:!0})})]}),A.jsx(xu,{})]})}function Pw(){return A.jsx(Qa,{children:A.jsx(Gn,{children:A.jsx(De,{path:"/*",element:A.jsx(Mw,{})})})})}const Te=Le;let KT=0;function iI(){return KT>0}function Dw(){KT++,setTimeout(()=>{KT--})}function io(e,t={}){function n(s){return typeof s=="function"}if(!n(e))return e;try{const s=e.__sentry_wrapped__;if(s)return typeof s=="function"?s:e;if(uT(e))return e}catch{return e}const r=function(...s){try{const i=s.map(a=>io(a,t));return e.apply(this,i)}catch(i){throw Dw(),TT(a=>{a.addEventProcessor(o=>(t.mechanism&&(dT(o,void 0),ja(o,t.mechanism)),o.extra={...o.extra,arguments:s},o)),Qm(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}sm(r,e),tr(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}const _r=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function zT(e,t){const n=qT(e,t),r={type:Gw(t),value:kw(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function ww(e,t,n,r){const s=Me(),i=s&&s.getOptions().normalizeDepth,a=Ww(t),o={__serialized__:Um(t,i)};if(a)return{exception:{values:[zT(e,a)]},extra:o};const l={exception:{values:[{type:Xu(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Yw(t,{isUnhandledRejection:r})}]},extra:o};if(n){const c=qT(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function JT(e,t){return{exception:{values:[zT(e,t)]}}}function qT(e,t){const n=t.stacktrace||t.stack||"",r=Uw(t),s=Fw(t);try{return e(n,r,s)}catch{}return[]}const xw=/Minified React error #\d+;/i;function Uw(e){return e&&xw.test(e.message)?1:0}function Fw(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function aI(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function Gw(e){const t=e&&e.name;return!t&&aI(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function kw(e){const t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:aI(e)&&Array.isArray(e.message)&&e.message.length==2?e.message[1]:t:"No error message"}function Bw(e,t,n,r){const s=n&&n.syntheticException||void 0,i=ZT(e,t,s,r);return ja(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),ls(i)}function Hw(e,t,n="info",r,s){const i=r&&r.syntheticException||void 0,a=QT(e,t,i,s);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),ls(a)}function ZT(e,t,n,r,s){let i;if(Q1(t)&&t.error)return JT(e,t.error);if($1(t)||qv(t)){const a=t;if("stack"in t)i=JT(e,t);else{const o=a.name||($1(a)?"DOMError":"DOMException"),l=a.message?`${o}: ${a.message}`:o;i=QT(e,l,n,r),dT(i,l)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return oT(t)?JT(e,t):Ya(t)||Xu(t)?(i=ww(e,t,n,s),ja(i,{synthetic:!0}),i):(i=QT(e,t,n,r),dT(i,`${t}`),ja(i,{synthetic:!0}),i)}function QT(e,t,n,r){const s={};if(r&&n){const i=qT(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),ja(s,{synthetic:!0})}if(lT(t)){const{__sentry_template_string__:i,__sentry_template_values__:a}=t;return s.logentry={message:i,params:a},s}return s.message=t,s}function Yw(e,{isUnhandledRejection:t}){const n=s5(e),r=t?"promise rejection":"exception";return Q1(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Xu(e)?`Event \`${Vw(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Vw(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Ww(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}function jw(e,{metadata:t,tunnel:n,dsn:r}){const s={event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:yl(r)}},i=Xw(e);return Wi(s,[i])}function Xw(e){return[{type:"user_report"},e]}class Kw extends j3{constructor(t){const n={parentSpanIsAlwaysRootSpan:!0,...t},r=Te.SENTRY_SDK_SOURCE||Wb();h_(n,"browser",["browser"],r),super(n),n.sendClientReports&&Te.document&&Te.document.addEventListener("visibilitychange",()=>{Te.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,n){return Bw(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Hw(this._options.stackParser,t,n,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){_r&&ne.warn("SDK not enabled, will not capture user feedback.");return}const n=jw(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(t,n,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r)}}const $T=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,zw=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",ao=(e,t,n,r)=>{let s,i;return a=>{t.value>=0&&(a||r)&&(i=t.value-(s||0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=zw(t.value,n),e(t)))}},de=Le,Jw=()=>`v4-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Fl=(e=!0)=>{const t=de.performance&&de.performance.getEntriesByType&&de.performance.getEntriesByType("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Gl=()=>{const e=Fl();return e&&e.activationStart||0},oo=(e,t)=>{const n=Fl();let r="navigate";return n&&(de.document&&de.document.prerendering||Gl()>0?r="prerender":de.document&&de.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:typeof t>"u"?-1:t,rating:"good",delta:0,entries:[],id:Jw(),navigationType:r}},ea=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch{}},lo=e=>{const t=n=>{(n.type==="pagehide"||de.document&&de.document.visibilityState==="hidden")&&e(n)};de.document&&(addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0))},TE=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let kl=-1;const qw=()=>de.document.visibilityState==="hidden"&&!de.document.prerendering?0:1/0,hE=e=>{de.document.visibilityState==="hidden"&&kl>-1&&(kl=e.type==="visibilitychange"?e.timeStamp:0,Qw())},Zw=()=>{addEventListener("visibilitychange",hE,!0),addEventListener("prerenderingchange",hE,!0)},Qw=()=>{removeEventListener("visibilitychange",hE,!0),removeEventListener("prerenderingchange",hE,!0)},AE=()=>(de.document&&kl<0&&(kl=qw(),Zw()),{get firstHiddenTime(){return kl}}),Bl=e=>{de.document&&de.document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},$w=[1800,3e3],e8=(e,t={})=>{Bl(()=>{const n=AE(),r=oo("FCP");let s;const a=ea("paint",o=>{o.forEach(l=>{l.name==="first-contentful-paint"&&(a.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Gl(),0),r.entries.push(l),s(!0)))})});a&&(s=ao(e,r,$w,t.reportAllChanges))})},t8=[.1,.25],n8=(e,t={})=>{e8(TE(()=>{const n=oo("CLS",0);let r,s=0,i=[];const a=l=>{l.forEach(c=>{if(!c.hadRecentInput){const u=i[0],E=i[i.length-1];s&&u&&E&&c.startTime-E.startTime<1e3&&c.startTime-u.startTime<5e3?(s+=c.value,i.push(c)):(s=c.value,i=[c])}}),s>n.value&&(n.value=s,n.entries=i,r())},o=ea("layout-shift",a);o&&(r=ao(e,n,t8,t.reportAllChanges),lo(()=>{a(o.takeRecords()),r(!0)}),setTimeout(r,0))}))},r8=[100,300],s8=(e,t={})=>{Bl(()=>{const n=AE(),r=oo("FID");let s;const i=l=>{l.startTime<n.firstHiddenTime&&(r.value=l.processingStart-l.startTime,r.entries.push(l),s(!0))},a=l=>{l.forEach(i)},o=ea("first-input",a);s=ao(e,r,r8,t.reportAllChanges),o&&lo(TE(()=>{a(o.takeRecords()),o.disconnect()}))})};let oI=0,eh=1/0,SE=0;const i8=e=>{e.forEach(t=>{t.interactionId&&(eh=Math.min(eh,t.interactionId),SE=Math.max(SE,t.interactionId),oI=SE?(SE-eh)/7+1:0)})};let th;const a8=()=>th?oI:performance.interactionCount||0,o8=()=>{"interactionCount"in performance||th||(th=ea("event",i8,{type:"event",buffered:!0,durationThreshold:0}))},us=[],nh=new Map,l8=40;let c8=0;const u8=()=>a8()-c8,E8=()=>{const e=Math.min(us.length-1,Math.floor(u8()/50));return us[e]},rh=10,d8=[],f8=e=>{if(d8.forEach(r=>r(e)),!(e.interactionId||e.entryType==="first-input"))return;const t=us[us.length-1],n=nh.get(e.interactionId);if(n||us.length<rh||t&&e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===(n.entries[0]&&n.entries[0].startTime)&&n.entries.push(e);else{const r={id:e.interactionId,latency:e.duration,entries:[e]};nh.set(r.id,r),us.push(r)}us.sort((r,s)=>s.latency-r.latency),us.length>rh&&us.splice(rh).forEach(r=>nh.delete(r.id))}},lI=e=>{const t=de.requestIdleCallback||de.setTimeout;let n=-1;return e=TE(e),de.document&&de.document.visibilityState==="hidden"?e():(n=t(e),lo(e)),n},p8=[200,500],T8=(e,t={})=>{"PerformanceEventTiming"in de&&"interactionId"in PerformanceEventTiming.prototype&&Bl(()=>{o8();const n=oo("INP");let r;const s=a=>{lI(()=>{a.forEach(f8);const o=E8();o&&o.latency!==n.value&&(n.value=o.latency,n.entries=o.entries,r())})},i=ea("event",s,{durationThreshold:t.durationThreshold!=null?t.durationThreshold:l8});r=ao(e,n,p8,t.reportAllChanges),i&&(i.observe({type:"first-input",buffered:!0}),lo(()=>{s(i.takeRecords()),r(!0)}))})},h8=[2500,4e3],cI={},A8=(e,t={})=>{Bl(()=>{const n=AE(),r=oo("LCP");let s;const i=o=>{t.reportAllChanges||(o=o.slice(-1)),o.forEach(l=>{l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Gl(),0),r.entries=[l],s())})},a=ea("largest-contentful-paint",i);if(a){s=ao(e,r,h8,t.reportAllChanges);const o=TE(()=>{cI[r.id]||(i(a.takeRecords()),a.disconnect(),cI[r.id]=!0,s(!0))});["keydown","click"].forEach(l=>{de.document&&addEventListener(l,()=>lI(o),{once:!0,capture:!0})}),lo(o)}})},S8=[800,1800],sh=e=>{de.document&&de.document.prerendering?Bl(()=>sh(e)):de.document&&de.document.readyState!=="complete"?addEventListener("load",()=>sh(e),!0):setTimeout(e,0)},R8=(e,t={})=>{const n=oo("TTFB"),r=ao(e,n,S8,t.reportAllChanges);sh(()=>{const s=Fl();s&&(n.value=Math.max(s.responseStart-Gl(),0),n.entries=[s],r(!0))})},Hl={},RE={};let uI,EI,dI,fI,pI;function ih(e,t=!1){return Yl("cls",e,_8,uI,t)}function TI(e,t=!1){return Yl("lcp",e,I8,dI,t)}function hI(e){return Yl("fid",e,N8,EI)}function m8(e){return Yl("ttfb",e,O8,fI)}function AI(e){return Yl("inp",e,C8,pI)}function co(e,t){return SI(e,t),RE[e]||(g8(e),RE[e]=!0),RI(e,t)}function uo(e,t){const n=Hl[e];if(!(!n||!n.length))for(const r of n)try{r(t)}catch(s){$T&&ne.error(`Error while triggering instrumentation handler.
125
+ `.repeat(this.cfg.linesBetweenQueries+1))}formatStatement(t){const n=new fE({cfg:this.cfg,dialectCfg:this.dialect.formatOptions,params:this.params,layout:new jN(new XN(HN(this.cfg)))}).format(t.children);return t.hasSemicolon&&(this.cfg.newlineBeforeSemicolon?n.add(X.NEWLINE,";"):n.add(X.NO_NEWLINE,";")),n.toString()}postFormat(t){return this.cfg.tabulateAlias&&(t=y6(t)),(this.cfg.commaPosition==="before"||this.cfg.commaPosition==="tabular")&&(t=m6(t,this.cfg.commaPosition,HN(this.cfg))),t}}class $i extends Error{}function U6(e){if("multilineLists"in e)throw new $i("multilineLists config is no more supported.");if("newlineBeforeOpenParen"in e)throw new $i("newlineBeforeOpenParen config is no more supported.");if("newlineBeforeCloseParen"in e)throw new $i("newlineBeforeCloseParen config is no more supported.");if("aliasAs"in e)throw new $i("aliasAs config is no more supported.");if(e.expressionWidth<=0)throw new $i(`expressionWidth config must be positive number. Received ${e.expressionWidth} instead.`);if(e.commaPosition==="before"&&e.useTabs)throw new $i("commaPosition: before does not work when tabs are used for indentation.");return e.params&&!F6(e.params)&&console.warn('WARNING: All "params" option values should be strings.'),e}function F6(e){return(e instanceof Array?e:Object.values(e)).every(n=>typeof n=="string")}const KN={bigquery:"bigquery",db2:"db2",hive:"hive",mariadb:"mariadb",mysql:"mysql",n1ql:"n1ql",plsql:"plsql",postgresql:"postgresql",redshift:"redshift",spark:"spark",sqlite:"sqlite",sql:"sql",trino:"trino",transactsql:"transactsql",tsql:"transactsql",singlestoredb:"singlestoredb",snowflake:"snowflake"},G6=Object.keys(KN),k6={tabWidth:2,useTabs:!1,keywordCase:"preserve",indentStyle:"standard",logicalOperatorNewline:"before",tabulateAlias:!1,commaPosition:"after",expressionWidth:50,linesBetweenQueries:1,denseOperators:!1,newlineBeforeSemicolon:!1},B6=(e,t={})=>{if(typeof t.language=="string"&&!G6.includes(t.language))throw new $i(`Unsupported SQL dialect: ${t.language}`);const n=KN[t.language||"sql"];return H6(e,{...t,dialect:kD[n]})},H6=(e,{dialect:t,...n})=>{if(typeof e!="string")throw new Error("Invalid query argument. Expected string, instead got "+typeof e);const r=U6({...k6,...n});return new x6(e6(t),r).format(e)},zN=/^db(?:\.[A-Za-z]+)*$/,Dr={avgDuration:"AVG_DURATION",timeSpent:"TIME_SPENT",description:"DESC",avgEncodedSize:"AVG_ENCODED_SIZE"},Y6=[{id:"description",title:"Resource Description",sortKey:Dr.description,primary:!0},{id:"avgDuration",title:"Avg Duration",sortKey:Dr.avgDuration},{id:"timeSpent",title:"Time Spent",sortKey:Dr.timeSpent},{id:"avgEncodedSize",title:"Avg Encoded Size",sortKey:Dr.avgEncodedSize}],ai={queryDesc:"QUERY_DESCRIPTION",timeSpent:"TIME_SPENT",avgDuration:"AVG_DURATION"},V6=[{id:"queryDesc",title:"Query Description",sortKey:ai.queryDesc,primary:!0},{id:"avgDuration",title:"Avg Duration",sortKey:ai.avgDuration},{id:"timeSpent",title:"Time Spent",sortKey:ai.timeSpent}],eo={count:"count",lastSeen:"lastSeen"},W6=[{id:"transaction",title:"Transaction",primary:!0},{id:"lastSeen",title:"Last Seen",sortKey:eo.lastSeen},{id:"count",title:"Count",sortKey:eo.count}],to={timestamp:"timestamp",duration:"duration"},j6=[{id:"eventId",title:"Event Id",primary:!0},{id:"toalDuration",title:"Total Duration",sortKey:to.duration},{id:"timestamp",title:"Timestamp",sortKey:to.timestamp},{id:"traceId",title:"Trace Id"}],oi={foundIn:"FOUND_IN",spanId:"SPAN_ID",timeSpent:"TIME_SPENT"},X6=[{id:"foundIn",title:"Found In",sortKey:oi.foundIn,primary:!0},{id:"spanId",title:"Span Id",sortKey:oi.spanId},{id:"timeSpent",title:"Time Spent",sortKey:oi.timeSpent}],nn={pages:"Pages",lcp:"LCP",fcp:"FCP",fid:"FID",cls:"CLS",ttfb:"TTFB",score:"PERFORMANCE_TOTAL_SCORE"},K6=[{id:"pages",title:"Pages",sortKey:nn.pages,primary:!0},{id:"lcp",title:"LCP",sortKey:nn.lcp},{id:"fcp",title:"FCP",sortKey:nn.fcp},{id:"fid",title:"FID",sortKey:nn.fid},{id:"cls",title:"CLS",sortKey:nn.cls},{id:"ttfb",title:"TTFB",sortKey:nn.ttfb},{id:"score",title:"Perf Score",sortKey:nn.score}],JN={profiles:[{name:"Chrome",scoreComponents:[{measurement:"fcp",weight:.15,p10:900,p50:1600,optional:!1},{measurement:"lcp",weight:.3,p10:1200,p50:2400,optional:!1},{measurement:"fid",weight:.3,p10:100,p50:300,optional:!0},{measurement:"cls",weight:.15,p10:.1,p50:.25,optional:!1},{measurement:"ttfb",weight:.1,p10:200,p50:400,optional:!1}],condition:{op:"eq",name:"event.contexts.browser.name",value:"Chrome"}}]};function qN(e,t=2){if(e==0)return"0 B";const n=1024,r=t,s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,i)).toFixed(r))+" "+s[i]}const ZN=({title:e,titleId:t,...n})=>y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",className:"bi bi-chevron-down",viewBox:"0 0 16 16","aria-labelledby":t,...n},e?y.createElement("title",{id:t},e):null,y.createElement("path",{fillRule:"evenodd",d:"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"}));function z6({handleResize:e,isResizing:t,setIsResizing:n,...r}){const[s,i]=y.useState(!1),a=c=>{c.target instanceof HTMLDivElement&&e(c)},o=c=>{c.preventDefault(),i(!0),n(!0),document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)},l=()=>{n(!1),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};return A.jsx("div",{className:Ae("resizer","absolute left-0 top-0 h-full w-1 cursor-col-resize rounded-sm p-0.5 transition-colors",s||t?"bg-primary-600 translate-x-[-2px] transform":""),onClick:c=>c.preventDefault(),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onMouseOver:()=>i(!0),onMouseDown:o,...r})}const J6=({span:e,startTimestamp:t,totalDuration:n,depth:r=1,traceContext:s,totalTransactions:i=0,spanNodeWidth:a,setSpanNodeWidth:o=()=>{},query:l})=>{var f,m;const{spanId:c}=Ws(),u=y.useRef(null),[E,h]=y.useState(e.transaction&&i>1&&r!==1||r>=15),[R,_]=y.useState(!1),C=Pl(e.start_timestamp,e.timestamp),O=p=>{if(u.current){const I=u.current.getBoundingClientRect(),N=(p.clientX-I.left)/I.width*100;o(N)}},d=l?e.span_id.includes(l)||((f=e.op)==null?void 0:f.includes(l))||((m=e.description)==null?void 0:m.includes(l)):!1;return A.jsxs("li",{className:"pl-4",ref:u,children:[A.jsxs(Ht,{className:Ae("hover:bg-primary-900 group flex text-sm",d?"bg-primary-200 bg-opacity-20":"",c===e.span_id?"bg-primary-900":""),style:{pointerEvents:R?"none":"auto"},to:`/explore/traces/${e.trace_id}/spans/${e.span_id}`,children:[A.jsxs("div",{className:Ae("node group-hover:bg-primary-900",d?"bg-transparent":"",e.status&&e.status!=="ok"?"text-red-400":"",c===e.span_id?"bg-primary-900":"bg-primary-950"),style:{width:`${a}%`},children:[(e.children||[]).length>0&&A.jsxs("div",{className:"bg-primary-600 z-10 mr-1 flex items-center gap-1 rounded-lg px-1 text-xs font-bold text-white",onClick:p=>{p.preventDefault(),h(I=>!I)},children:[(e.children||[]).length,A.jsx(ZN,{width:12,height:12,className:Ae("transition",E?"rotate-0":"rotate-180")})]}),e.transaction&&A.jsx(ni,{size:16,platform:e.transaction.platform}),e.op&&A.jsxs(A.Fragment,{children:[A.jsx("span",{className:"font-bold",children:e.op}),A.jsx("span",{className:"text-primary-400",children:"–"})]}),A.jsx("span",{className:"block truncate",title:e.description||e.span_id,children:e.description||e.span_id})]}),A.jsxs("div",{className:Ae("waterfall",d?"!bg-transparent":""),style:{left:`${a}%`},children:[A.jsx(z6,{setIsResizing:_,isResizing:R,handleResize:O}),A.jsx("div",{className:"bg-primary-900 absolute -m-0.5 w-full p-0.5",style:{left:`calc(min(${(e.start_timestamp-t)/n*100}%, 95% - 1px) + 4px)`,width:`max(1px, ${C/n*95}%)`},children:A.jsxs("span",{className:Ae("whitespace-nowrap",iP(C)),children:[C.toLocaleString()," ms"]})})]})]}),!E&&A.jsx(WT,{traceContext:s,tree:e.children||[],startTimestamp:t,totalDuration:n,depth:r+1,totalTransactions:i,spanNodeWidth:a,setSpanNodeWidth:o,query:l})]},e.span_id)};function WT({traceContext:e,tree:t,startTimestamp:n,totalDuration:r,depth:s=1,totalTransactions:i,spanNodeWidth:a,setSpanNodeWidth:o,query:l}){return!t||!t.length?null:A.jsx("ul",{className:"tree",children:t.map(c=>A.jsx(J6,{traceContext:e,depth:s,span:c,totalTransactions:i,startTimestamp:n,totalDuration:r,spanNodeWidth:a,setSpanNodeWidth:o,query:l},c.span_id))})}function q6({desc:e,dbType:t}){if(e.startsWith("{")||t==="mongodb")try{return A.jsx(Za,{data:JSON.parse(e)})}catch{}let n=e;if(e.match(/^(SELECT|INSERT|UPDATE|DELETE|TRUNCATE|ALTER) /i))try{n=B6(e.replace(/([\s,(])(%[a-z])([\s,)])/gim,"$1?$3"),{language:t||"sql"})}catch(r){console.error(r)}return A.jsx("pre",{className:"text-primary-300 whitespace-pre-wrap break-words font-mono text-sm",children:n})}function Z6(e,t){return typeof t=="number"?e.indexOf("size")!==-1||e.indexOf("length")!==-1?qN(t):t.toLocaleString():`${t}`}function Q6({span:e}){var r,s;let t=null,n=null;return e.op&&zN.test(e.op)&&e.description?(n="Query",t=A.jsx(q6,{desc:e.description,dbType:(r=e.data)==null?void 0:r["db.system"]})):e.op==="resource.img"&&((s=e.description)==null?void 0:s.indexOf("/"))===0?(n="Preview",t=A.jsx("a",{href:e.description,className:"border-primary-950 hover:border-primary-700 -m-2 inline-block max-w-sm cursor-pointer rounded border p-1",children:A.jsx("img",{src:e.description,alt:"preview",style:{maxHeight:300}})})):e.description?(n="Description",t=A.jsx("pre",{className:"text-primary-300 whitespace-pre-wrap break-words font-mono text-sm",children:e.description})):t=A.jsx("div",{className:"text-primary-300",children:"No description recorded for this span."}),A.jsxs("div",{children:[n&&A.jsx("h2",{className:"mb-2 font-bold uppercase",children:n}),t]})}function $6({traceContext:e,span:t,startTimestamp:n,totalDuration:r,totalTransactions:s}){var c;const[i,a]=y.useState(50),o=Pl(t.start_timestamp,t.timestamp),l=nt.getEventsByTrace(t.trace_id).filter(u=>u.type!=="transaction"&&"exception"in u);return A.jsxs(z_,{backto:`/explore/traces/${t.trace_id}`,children:[A.jsx(K_,{title:"Span Details",subtitle:A.jsxs(A.Fragment,{children:[t.op&&A.jsxs(A.Fragment,{children:[t.op," ",A.jsx("span",{className:"text-primary-500",children:"—"})," "]}),t.span_id]}),backto:`/explore/traces/${t.trace_id}`}),A.jsxs("div",{className:"space-y-6",children:[A.jsx("div",{children:A.jsxs("div",{className:"flex flex-col space-y-4",children:[A.jsxs("div",{className:"text-primary-300 flex flex-1 items-center gap-x-1",children:[A.jsx(EE,{date:t.start_timestamp}),A.jsx("span",{children:"—"}),A.jsxs("span",{children:[A.jsxs("strong",{children:[Pl(n,t.start_timestamp)," ms"]})," into trace"]})]}),A.jsx("div",{className:"flex-1",children:A.jsx("div",{className:"border-primary-800 relative h-8 border py-1",children:A.jsx("div",{className:"bg-primary-800 absolute bottom-0 top-0 -m-0.5 flex w-full items-center p-0.5",style:{left:`min(${(t.start_timestamp-n)/r*100}%, 100% - 1px)`,width:`max(1px, ${o/r*100}%)`},children:A.jsxs("span",{className:"whitespace-nowrap",children:[o," ms"]})})})})]})}),l.length>0&&A.jsxs("div",{className:"flex flex-col items-start",children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Related Errors"}),l.map(u=>A.jsx(Ht,{className:"cursor-pointer underline",to:`/errors/${u.event_id}`,children:A.jsx(F_,{event:u})},u.event_id))]}),A.jsx(Q6,{span:t}),A.jsxs("div",{children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Tags"}),t.tags&&Object.keys(t.tags).length?A.jsx("table",{className:"w-full text-sm",children:A.jsx("tbody",{children:Object.entries(t.tags).map(([u,E])=>A.jsxs("tr",{className:"text-primary-300",children:[A.jsx("th",{className:" w-1/12 py-0.5 pr-4 text-left font-mono font-normal",children:A.jsx("div",{className:"w-full truncate",children:u})}),A.jsx("td",{className:"py-0.5",children:A.jsx("pre",{className:"whitespace-nowrap font-mono",children:JSON.stringify(E,void 0,2)})})]},u))})}):A.jsx("div",{className:"text-primary-300",children:"No tags recorded for this span."})]}),A.jsxs("div",{children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Context"}),A.jsx("table",{className:"w-full text-sm",children:A.jsx("tbody",{children:[["status",t.status||""],["trace",t.trace_id],["span",t.span_id],["parent",t.parent_span_id?A.jsx(Ht,{className:"underline",to:`/explore/traces/${t.trace_id}/spans/${t.parent_span_id}`,children:t.parent_span_id},`link-to-${t.parent_span_id}`):""],["op",t.op]].map(([u,E])=>A.jsxs("tr",{className:"text-primary-300",children:[A.jsx("th",{className:" w-1/12 py-0.5 pr-4 text-left font-mono font-normal",children:A.jsx("div",{className:"w-full truncate",children:u})}),A.jsx("td",{className:"py-0.5",children:A.jsx("pre",{className:"whitespace-nowrap font-mono",children:E})})]},u))})})]}),t.data&&A.jsxs("div",{children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Data"}),A.jsx("table",{className:"w-full text-sm",children:A.jsx("tbody",{children:Object.entries(t.data).map(([u,E])=>A.jsxs("tr",{className:"text-primary-300",children:[A.jsx("th",{className:" w-1/12 py-0.5 pr-4 text-left font-mono font-normal",children:A.jsx("div",{className:"w-full truncate",children:u})}),A.jsx("td",{className:"py-0.5",children:A.jsx("pre",{className:"whitespace-nowrap font-mono",children:Z6(u,E)})})]},u))})})]}),(((c=t.children)==null?void 0:c.length)??0)>0&&A.jsxs("div",{children:[A.jsx("h2",{className:"mb-2 font-bold uppercase",children:"Sub-tree"}),A.jsx(WT,{traceContext:e,tree:[t],startTimestamp:n,totalDuration:r,totalTransactions:s,spanNodeWidth:i,setSpanNodeWidth:a})]})]})]})}const ew=50;function QN({traceId:e}){const{spanId:t}=Ws(),[n,r]=y.useState(ew),s=nt.getTraceById(e),i=t?nt.getSpanById(e,t):void 0,a=s.start_timestamp,o=s.timestamp-a;return A.jsxs(A.Fragment,{children:[A.jsx("div",{className:"px-6 py-4",children:A.jsxs("div",{className:"text-primary-300 flex flex-1 items-center gap-x-1",children:[A.jsx("div",{className:"text-primary-200",children:A.jsx(EE,{date:s.start_timestamp})}),A.jsx("span",{children:"—"}),A.jsxs("span",{children:[A.jsxs("strong",{className:"text-primary-200 font-bold",children:[Pl(s.start_timestamp,s.timestamp).toLocaleString()," ms"]})," ","recorded in"," ",A.jsxs("strong",{className:"text-primary-200 font-bold",children:[s.spans.length.toLocaleString()," spans"]})]})]})}),A.jsx("div",{className:"flex-1 px-2 pb-6",children:A.jsx(WT,{traceContext:s,tree:s.spanTree,startTimestamp:a,totalDuration:o,totalTransactions:(s.transactions||[]).length,spanNodeWidth:n,setSpanNodeWidth:r})}),i?A.jsx($6,{traceContext:s,startTimestamp:a,totalDuration:o,span:i,totalTransactions:(s.transactions||[]).length}):null]})}function tw(){const{traceId:e}=Ws(),t=zi(e),n=cs();if(!e)return A.jsx("p",{className:"text-primary-300 p-6",children:"Unknown trace id"});const r=nt.getTraceById(e);if(!r)return A.jsxs("p",{className:"text-primary-300 p-6",children:["Trace not found. Check for more"," ",A.jsx(Ht,{to:"/traces",className:"underline",children:"traces"})]});const s=t.filter(a=>{var o,l,c,u;return a.type!=="transaction"&&((l=(o=a.contexts)==null?void 0:o.trace)!=null&&l.trace_id?n.isLocalToSession((u=(c=a.contexts)==null?void 0:c.trace)==null?void 0:u.trace_id):null)!==!1}).length,i=[rr("details","Details"),rr("context","Context"),rr("errors","Errors",{notificationCount:{count:s,severe:s>0}})];return A.jsxs(A.Fragment,{children:[A.jsx(sP,{trace:r}),A.jsx(Cl,{tabs:i,nested:!0}),A.jsxs(Gn,{children:[A.jsx(De,{path:"details",element:A.jsx(QN,{traceId:e})}),A.jsx(De,{path:"spans/:spanId",element:A.jsx(QN,{traceId:e})}),A.jsx(De,{path:"context",element:A.jsx(W_,{event:r.rootTransaction||r.transactions[0]})}),A.jsx(De,{path:"errors",element:A.jsx(X_,{traceId:e})}),A.jsx(De,{path:"*",element:A.jsx(wu,{to:`/explore/traces/${e}/details`,replace:!0})})]})]})}const nw=()=>(y.useContext(Ki),nt.getTraces());function rw(){const e=nw(),t=cs(),n=qa(),[r,s]=y.useState(!n.experiments["sentry:focus-local-events"]),i=r?e:e.filter(o=>t.isLocalToSession(o.trace_id)!==!1),a=e.length-i.length;return A.jsx(A.Fragment,{children:e.length!==0?A.jsxs(GT,{children:[a>0&&A.jsx(Ml,{itemCount:a,onClick:()=>{s(!0)}}),i.map(o=>{const l=Pl(o.start_timestamp,o.timestamp);return A.jsxs(Ht,{className:"hover:bg-primary-900 flex cursor-pointer items-center gap-x-4 px-6 py-2",to:o.trace_id,children:[A.jsx(q_,{trace:o}),A.jsxs("div",{className:"text-primary-300 flex w-48 flex-col truncate font-mono text-sm",children:[A.jsxs("div",{className:"flex items-center gap-x-2",children:[A.jsx("div",{children:Ji(o.trace_id)}),t.isLocalToSession(o.trace_id)?A.jsx(FT,{title:"This trace is part of your local session.",children:"Local"}):null]}),A.jsx(uE,{date:o.start_timestamp})]}),A.jsx(Z_,{trace:o}),A.jsx("div",{className:"flex flex-col truncate font-mono",children:A.jsxs("div",{className:"text-primary-300 flex space-x-2 text-sm",children:[A.jsx("div",{className:Ae(o.status==="ok"?"text-green-400":o.status?"text-red-400":""),children:o.status||""}),A.jsx("div",{children:"—"}),A.jsxs("div",{children:[l," ms"]}),A.jsx("div",{children:"—"}),A.jsxs("div",{children:[o.spans.length.toLocaleString()," spans, ",o.transactions.length.toLocaleString()," txns"]})]})})]},o.trace_id)})]}):A.jsx("div",{className:"text-primary-300 p-6",children:"Looks like there's no traces recorded matching this query. 🤔"})})}function sw(){return A.jsxs(Gn,{children:[A.jsx(De,{path:"/:traceId/*",element:A.jsx(tw,{})}),A.jsx(De,{path:"/",element:A.jsx(rw,{})})]})}function iw(){const e=nt.getTraces().filter(n=>nt.isTraceLocal(n.trace_id)!==!1),t=[rr("traces","Traces",{notificationCount:{count:e.length}}),rr("sdks","SDKs"),rr("envelopes","Envelopes")];return A.jsxs(A.Fragment,{children:[A.jsx(Cl,{tabs:t,nested:!0}),A.jsxs("div",{className:"flex-1",children:[A.jsxs(Gn,{children:[A.jsx(De,{path:"/envelopes/*",element:A.jsx($M,{})}),A.jsx(De,{path:"/sdks/*",element:A.jsx(nP,{})}),A.jsx(De,{path:"/traces/*",element:A.jsx(sw,{})}),A.jsx(De,{path:"*",element:A.jsx(wu,{to:"/explore/traces",replace:!0})})]}),A.jsx(xu,{})]})]})}function aw(){return A.jsx(Qa,{children:A.jsx(Gn,{children:A.jsx(De,{path:"/*",element:A.jsx(iw,{})})})})}const pE=()=>{y.useContext(Ki);const e=cs(),t=nt.getTraces(),n=t.filter(i=>e.isLocalToSession(i.trace_id)!==!1),r=t.reduce((i,a)=>[...i,...a.spans],[]),s=n.reduce((i,a)=>[...i,...a.spans],[]);return{allSpans:r,localSpans:s}},no=({title:e,titleId:t,...n})=>y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:24,height:24,viewBox:"0 0 24 24","aria-labelledby":t,...n},e?y.createElement("title",{id:t},e):null,y.createElement("path",{d:"M17,14 C17.8092996,14 18.2680938,14.9010044 17.836059,15.5493995 L17.7682213,15.6401844 L12.7682213,21.6401844 C12.3950792,22.0879549 11.7283228,22.1178063 11.3160321,21.7297385 L11.2317787,21.6401844 L6.23177872,15.6401844 C5.71367776,15.0184632 6.11213562,14.0891988 6.88682851,14.0060047 L7,14 L17,14 Z M11.2317787,2.3598156 C11.6049208,1.91204508 12.2716772,1.88219371 12.6839679,2.2702615 L12.7682213,2.3598156 L17.7682213,8.3598156 C18.2863222,8.98153675 17.8878644,9.91080124 17.1131715,9.99399528 L17,10 L7,10 C6.19070043,10 5.73190618,9.09899556 6.16394105,8.45060047 L6.23177872,8.3598156 L11.2317787,2.3598156 Z"})),ro=({title:e,titleId:t,...n})=>y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:24,height:24,viewBox:"-96 0 512 512","aria-labelledby":t,...n},e?y.createElement("title",{id:t},e):null,y.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"}));function so({defaultSortType:e="",defaultAsc:t=!1}){const[n,r]=y.useState({active:e,asc:t});return{toggleSortOrder:i=>r(a=>a.active===i?{active:i,asc:!a.asc}:{active:i,asc:!1}),sort:n,setSort:r}}const ow=({query:e,spanData:t})=>{const r=t.filter(a=>a.description===e).map(a=>a.timestamp-a.start_timestamp),s=r.reduce((a,o)=>a+o,0);return{avgDuration:s/r.length,timeSpent:s,description:e}},$N={[ai.queryDesc]:(e,t)=>e.description<t.description?-1:e.description>t.description?1:0,[ai.avgDuration]:(e,t)=>e.avgDuration-t.avgDuration,[ai.timeSpent]:(e,t)=>e.timeSpent-t.timeSpent},lw=({showAll:e})=>{const{allSpans:t,localSpans:n}=pE(),{sort:r,toggleSortOrder:s}=so({defaultSortType:ai.timeSpent}),i=y.useMemo(()=>{const a=$N[r.active]||$N[ai.timeSpent],l=(e?t:n).filter(u=>zN.test(u.op||"")),c=new Set(l.map(u=>String(u==null?void 0:u.description).trim()));return c.delete(""),[...c].map(u=>ow({query:u,spanData:l})).sort((u,E)=>r.asc?a(u,E):a(E,u))},[t,n,e,r]);return i!=null&&i.length?A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:V6.map(a=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 select-none px-6 py-3.5 text-sm font-semibold",a.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer items-center gap-1",a.primary?"justify-start":"justify-end"),onClick:()=>s(a.sortKey),children:[a.title,r.active===a.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",r.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"})]})},a.id))})}),A.jsx("tbody",{children:i.map(a=>A.jsxs("tr",{className:"hover:bg-primary-900",children:[A.jsx("td",{className:"text-primary-200 w-2/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/insights/queries/${btoa(a.description)}`,children:a.description})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(a.avgDuration)}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(a.timeSpent)})]},a.description))})]}):A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"No Database queries found. Add integration in Sentry initialization to track Database queries."})};function jT({crumbs:e}){return A.jsx("div",{className:"flex items-center gap-1 px-6 py-4",children:e.map((t,n)=>{const r=n===e.length-1;return A.jsxs("div",{className:"flex items-center gap-1",children:[n>0&&A.jsx(ZN,{width:12,height:12,className:"stroke-primary-300 -rotate-90"}),t.link&&t.to?A.jsx(Ht,{className:Ae(r?"text-primary-200":"text-primary-300","hover:text-primary-100 truncate text-sm hover:underline"),to:t.to,children:t.label}):A.jsx("span",{className:Ae(r?"text-primary-200":"text-primary-300","truncate text-sm"),children:t.label})]},t.id)})})}const eI={[oi.foundIn]:(e,t)=>e.trace_id<t.trace_id?-1:e.trace_id>t.trace_id?1:0,[oi.spanId]:(e,t)=>e.span_id<t.span_id?-1:e.span_id>t.span_id?1:0,[oi.timeSpent]:(e,t)=>e.timestamp-e.start_timestamp-(t.timestamp-t.start_timestamp)},cw=({showAll:e})=>{const{allSpans:t,localSpans:n}=pE(),{type:r}=Ws(),{sort:s,toggleSortOrder:i}=so({defaultSortType:oi.timeSpent}),a=y.useMemo(()=>{if(!r)return[];const o=e?t:n,l=eI[s.active]||eI[oi.timeSpent],c=atob(r);return o.filter(u=>u.description===c).sort((u,E)=>s.asc?l(u,E):l(E,u))},[t,n,e,s,r]);return!a||!a.length?A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"Query not found."}):A.jsxs(A.Fragment,{children:[A.jsx(jT,{crumbs:[{id:"queries",label:"Queries",link:!0,to:"/insights/queries"},{id:"querySummary",label:"Query Summary",link:!1}]}),A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:X6.map(o=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 px-6 py-3.5 text-sm font-semibold",o.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer select-none items-center gap-1",o.primary?"justify-start":"justify-end"),onClick:()=>i(o.sortKey),children:[o.title,s.active===o.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",s.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"})]})},o.id))})}),A.jsx("tbody",{children:a.map(o=>A.jsxs("tr",{className:"hover:bg-primary-900",children:[A.jsx("td",{className:"text-primary-200 w-2/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/explore/traces/${o.trace_id}`,children:Ji(o.trace_id)})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/explore/traces/${o.trace_id}/spans/${o.span_id}`,children:Ji(o.span_id)})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(o.timestamp-o.start_timestamp)})]},o.span_id))})]})]})},uw=e=>{switch(e){case"top":return"bottom-full left-1/2 transform -translate-x-1/2 mb-2";case"bottom":return"top-full left-1/2 transform -translate-x-1/2 mt-2";case"left":return"top-1/2 right-full transform -translate-y-1/2 mr-2";default:return"top-1/2 left-full transform -translate-y-1/2 ml-2"}},Ew=({content:e,position:t="right",children:n})=>{const[r,s]=y.useState(!1),i=()=>{s(!0)},a=()=>{s(!1)};return A.jsxs("div",{className:"relative inline-block max-w-full",onMouseEnter:i,onMouseLeave:a,children:[n,r&&A.jsx("div",{className:Ae("absolute z-10",uw(t)),children:e})]})},dw=({resource:e,spanData:t})=>{const n=t.filter(a=>a.description===e),r=n.reduce((a,o)=>a+(o.timestamp-o.start_timestamp),0),s=r/n.length,i=n.reduce((a,o)=>{const l=o.data&&o.data["http.response_content_length"];return typeof l=="number"?a+l:a},0)/n.length;return{avgDuration:s,timeSpent:r,description:e,avgEncodedSize:i,similarResources:n}},fw=(e,t)=>{if(t.type)return e.filter(n=>n.description===t.type);if(t.regex){const n=new RegExp(t.regex);return e.filter(r=>n.test(r.op||""))}return[]},tI={[Dr.description]:(e,t)=>e.description<t.description?-1:e.description>t.description?1:0,[Dr.avgEncodedSize]:(e,t)=>e.avgEncodedSize-t.avgEncodedSize,[Dr.avgDuration]:(e,t)=>e.avgDuration-t.avgDuration,[Dr.timeSpent]:(e,t)=>e.timeSpent-t.timeSpent},pw=({showAll:e})=>{const{allSpans:t,localSpans:n}=pE(),{sort:r,toggleSortOrder:s}=so({defaultSortType:Dr.timeSpent}),i=y.useMemo(()=>{const a=fw(e?t:n,{regex:/resource\.[A-Za-z]+/}),o=new Set(a.map(u=>String(u==null?void 0:u.description).trim()));o.delete("");const l=[...o],c=tI[r.active]||tI[Dr.timeSpent];return l.map(u=>dw({resource:u,spanData:a})).sort((u,E)=>r.asc?c(u,E):c(E,u))},[r,e,t,n]);return i!=null&&i.length?A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:Y6.map(a=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 px-6 py-3.5 text-sm font-semibold",a.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer select-none items-center gap-1",a.primary?"justify-start":"justify-end"),onClick:()=>s(a.sortKey),children:[a.title,r.active===a.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",r.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"})]})},a.id))})}),A.jsx("tbody",{children:i.map(a=>{var o;return A.jsxs("tr",{className:"hover:bg-primary-900",children:[A.jsx("td",{className:"text-primary-200 relative w-2/5 whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:A.jsx(Ew,{position:"right",content:a.similarResources[0].op==="resource.img"&&((o=a.description)==null?void 0:o.indexOf("/"))===0&&A.jsxs("div",{className:"bg-primary-800 cursor-pointer rounded-lg p-4 shadow-md",children:[A.jsx("h2",{className:"mb-2 font-bold",children:"Preview"}),A.jsx("img",{src:a.description,className:"inline-block max-h-[150px] max-w-[150px] rounded p-1",alt:"preview"})]}),children:A.jsx("div",{className:"truncate",children:a.description})})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(a.avgDuration)}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(a.timeSpent)}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:qN(a.avgEncodedSize)})]},a.description)})})]}):A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"No Resource found."})},nI=Math.sqrt(2);function Tw(e){const t=.254829592,n=-.284496736,r=1.421413741,s=-1.453152027,i=1.061405429,a=.3275911,o=e<0?-1:1,l=Math.abs(e),c=1/(1+a*l),u=1-((((i*c+s)*c+r)*c+n)*c+t)*c*Math.exp(-l*l);return o*u}function hw(e,t){return Math.abs(Math.log(e)-Math.log(t))/(nI*.9061938024368232)}function Aw(e,t,n){return .5*(1-Tw((Math.log(e)-Math.log(n))/(nI*hw(n,t))))}function rI(e,t){if(t)for(const n of t.profiles){const r=e.measurements;if(r){let s=!1,i=0,a=0;for(const o of n.scoreComponents)o.optional&&!Object.prototype.hasOwnProperty.call(r,o.measurement)||(a+=o.weight);if(Math.abs(a)<Number.EPSILON)break;for(const o of n.scoreComponents){let l=0;if(Object.prototype.hasOwnProperty.call(r,o.measurement)){l=o.weight/a;const c=r[o.measurement].value,u=Aw(Math.max(0,c),o.p10,o.p50),E=u*l;i+=E,s=!0,r[`score.${o.measurement}`]={value:u,unit:"ratio"}}else r[`score.${o.measurement}`]={value:0,unit:"ratio"};r[`score.weight.${o.measurement}`]={value:l,unit:"ratio"}}s&&(r["score.total"]={value:i,unit:"ratio"});break}}}function Sw(e,t,n,r,s,i,a,o){const l=e/2+r+o,c={x:t+e/2-i/2,y:n+e/2+a/2},u=Object.values(s).reduce((w,k)=>w+k,0),E=-90,h=w=>w/u*360,[R,_,C,O,d]=[s.lcp,s.fcp,s.fid,s.cls,s.ttfb].map(h),f=c.x+l*Math.cos((E+R/2)*Math.PI/180),m=c.y+l*Math.sin((E+R/2)*Math.PI/180),p=c.x+l*Math.cos((E+R+_/2)*Math.PI/180),I=c.y+l*Math.sin((E+R+_/2)*Math.PI/180),T=c.x+l*Math.cos((E+R+_+C/2)*Math.PI/180),N=c.y+l*Math.sin((E+R+_+C/2)*Math.PI/180),g=c.x+l*Math.cos((E+R+_+C+O/2)*Math.PI/180),P=c.y+l*Math.sin((E+R+_+C+O/2)*Math.PI/180),S=c.x-12+l*Math.cos((E+R+_+C+O+d/2)*Math.PI/180),b=c.y+l*Math.sin((E+R+_+C+O+d/2)*Math.PI/180);return{lcpX:f,lcpY:m,fcpX:p,fcpY:I,fidX:T,fidY:N,clsX:g,clsY:P,ttfbX:S,ttfbY:b}}const sI={[nn.pages]:(e,t)=>e.transaction&&t.transaction&&e.transaction<t.transaction?-1:e.transaction&&t.transaction&&e.transaction>t.transaction?1:0,[nn.lcp]:(e,t)=>e.measurements["score.lcp"].value-t.measurements["score.lcp"].value,[nn.fid]:(e,t)=>e.measurements["score.fid"].value-t.measurements["score.fid"].value,[nn.fcp]:(e,t)=>e.measurements["score.fcp"].value-t.measurements["score.fcp"].value,[nn.cls]:(e,t)=>e.measurements["score.cls"].value-t.measurements["score.cls"].value,[nn.ttfb]:(e,t)=>e.measurements["score.ttfb"].value-t.measurements["score.ttfb"].value,[nn.score]:(e,t)=>e.measurements["score.total"].value-t.measurements["score.total"].value},Rw=()=>{const e=zi(),t=xi(),{sort:n,toggleSortOrder:r}=so({defaultSortType:nn.score}),s=y.useMemo(()=>{const i=sI[n.active]||sI[nn.score];return e.filter(a=>{var o,l;return a.measurements&&((l=(o=a==null?void 0:a.contexts)==null?void 0:o.trace)==null?void 0:l.op)==="pageload"}).map(a=>{const o={...a};return rI(o,JN),o}).sort((a,o)=>n.asc?i(a,o):i(o,a))},[e,n]);return s!=null&&s.length?A.jsx(A.Fragment,{children:A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:K6.map(i=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 px-6 py-3.5 text-sm font-semibold",i.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer select-none items-center gap-1",i.primary?"justify-start":"justify-end"),onClick:()=>r(i.sortKey),children:[i.title,n.active===i.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",n.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"})]})},i.id))})}),A.jsx("tbody",{children:s.map(i=>{var a,o,l,c,u,E;return A.jsxs("tr",{className:"hover:bg-primary-900 cursor-pointer",onClick:()=>t(`/insights/webvitals/${i.event_id}`),children:[A.jsx("td",{className:"text-primary-200 w-2/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:i.transaction}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(a=i.measurements)!=null&&a.lcp?Tn(i.measurements.lcp.value):"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(o=i.measurements)!=null&&o.fcp?Tn(i.measurements.fcp.value):"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(l=i.measurements)!=null&&l.fid?Tn(i.measurements.fid.value):"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(c=i.measurements)!=null&&c.cls?i.measurements.cls.value:"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(u=i.measurements)!=null&&u.ttfb?Tn(i.measurements.ttfb.value):"-"}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:(E=i.measurements["score.total"])!=null&&E.value?Math.trunc(i.measurements["score.total"].value*100):"-"})]},i.event_id)})})]})}):A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"No Measurements found."})},mw=-90,_w=1;function Nw({values:e,maxValues:t,size:n=20,barWidth:r=3,text:s,textCss:i,segmentColors:a,backgroundColors:o,progressEndcaps:l,onHoverActions:c,onBlur:u,...E}){const h=n/2,R=n/4,_=n/2-r/2,C=2*Math.PI*_,O=y.useMemo(()=>{const d=t.reduce((m,p)=>m+p,0);let f=mw;return t.flatMap((m,p)=>{const I=Math.min(Math.max(e[p],0),m),T=e.length>1?_w:0,N=(1-Math.max(m-T,0)/d)*C,g=(1-Math.max(I-T,0)/d)*C,P=f;f+=360*m/d;const S=_+r/2,b=`${S}-${o[p]}-${a[p]}`;return[A.jsx("circle",{strokeDashoffset:N,r:_,cx:S,cy:S,onMouseOver:()=>c==null?void 0:c[p](),onFocus:()=>c==null?void 0:c[p](),onMouseLeave:()=>u==null?void 0:u(),onBlur:()=>u==null?void 0:u(),className:Ae(o[p]),style:{fill:"none",strokeWidth:r,strokeDasharray:`${C} ${C}`,transform:`rotate(${P}deg)`,transformOrigin:"50% 50%",transition:"stroke 300ms"}},`ring-bg-${b}`),A.jsx("circle",{strokeDashoffset:g,strokeLinecap:l,r:_,cx:S,cy:S,onMouseOver:()=>c==null?void 0:c[p](),onFocus:()=>c==null?void 0:c[p](),onMouseLeave:()=>u==null?void 0:u(),onBlur:()=>u==null?void 0:u(),className:Ae(a[p]),style:{fill:"none",strokeWidth:r,strokeDasharray:`${C} ${C}`,transform:`rotate(${P}deg)`,transformOrigin:"50% 50%",transition:"stroke 300ms, stroke-dashoffset 300ms"}},`ring-bar-${b}`)]})},[o,r,C,t,c,u,l,_,a,e]);return A.jsxs("svg",{className:"relative",role:"img",height:_*2+r,width:_*2+r,...E,children:[A.jsx("title",{children:"Web Vitals Breakdown"}),O,A.jsx("foreignObject",{height:h,width:h,x:R,y:R,children:s!==void 0?A.jsx("div",{className:Ae("text-primary-100 flex h-full w-full items-center justify-center text-xl font-bold",i),children:s}):null})]})}class XT extends Error{}function Iw(e,{signal:t}){return new Promise((n,r)=>{t.aborted&&r(new XT);const s=()=>{r(new XT)},i=new IntersectionObserver(a=>{for(const o of a){const l=o.boundingClientRect;n(l),t.removeEventListener("abort",s)}i.disconnect()});t.addEventListener("abort",s),i.observe(e)})}function Ow({elem:e,onPositionChange:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,...i}){const a=y.useRef(new AbortController),o=y.useCallback(async c=>{if(!e.current){t(void 0);return}try{const u=await Iw(e.current,{signal:a.current.signal});t({height:u.height,left:Math.min(c.clientX-u.left,u.width),top:Math.min(c.clientY-u.top,u.height),width:u.width})}catch(u){if(u instanceof XT)return}},[t,a,e]),l=y.useCallback(()=>{a.current&&(a.current.abort(),a.current=new AbortController),t(void 0)},[t,a]);return{...i,onMouseEnter:c=>{o(c),n==null||n(c)},onMouseMove:c=>{var u;(u=e.current)!=null&&u.contains(c.target)&&(o(c),r==null||r(c))},onMouseLeave:c=>{l(),s==null||s(c)}}}function Ul({webVital:e,coordinates:t,labelCoordinates:n={}}){var i,a;const r=((i=n==null?void 0:n[e])==null?void 0:i.x)??0,s=((a=n==null?void 0:n[e])==null?void 0:a.y)??0;return A.jsx("text",{className:"fill-primary-200 stroke-primary-200 uppercase",x:t.x+r,y:t.y+s,children:e})}const Cw=({metricScore:e,metricWeights:t,totalScore:n,size:r=200,barWidth:s=25,left:i=40,top:a=25,labelWidthPadding:o=28,labelHeightPadding:l=14,radiusPadding:c=4})=>{const[u,E]=y.useState(null),[h,R]=y.useState({x:0,y:0}),_=y.useRef(null),C=Ow({elem:_,onPositionChange:S=>{if(S){const{left:b,top:w}=S;R({x:b,y:w})}}}),{lcpX:O,lcpY:d,fcpX:f,fcpY:m,fidX:p,fidY:I,clsX:T,clsY:N,ttfbX:g,ttfbY:P}=Sw(r,i,a,s,t,o,l,c);return A.jsxs("div",{ref:_,...C,children:[u&&A.jsxs("div",{className:Ae("bg-primary-900 border-primary-400 absolute flex w-40 items-center justify-between rounded-lg border p-3 shadow-lg"),style:{transform:`translate3d(${h.x-100}px, ${h.y-74}px, 0px)`},children:[A.jsx("span",{className:"text-primary-200",children:`${u.toUpperCase()} Score:`}),A.jsx("span",{className:"text-primary-200 font-semibold",children:e[`${u}Score`]})]}),A.jsxs("svg",{height:r+3*a,width:r+3*i,children:[A.jsxs(A.Fragment,{children:[t.lcp>0&&A.jsx(Ul,{webVital:"lcp",coordinates:{x:O,y:d}}),t.fcp>0&&A.jsx(Ul,{webVital:"fcp",coordinates:{x:f,y:m}}),t.fid>0&&A.jsx(Ul,{webVital:"fid",coordinates:{x:p,y:I}}),t.cls>0&&A.jsx(Ul,{webVital:"cls",coordinates:{x:T,y:N}}),t.ttfb>0&&A.jsx(Ul,{webVital:"ttfb",coordinates:{x:g,y:P}})]}),A.jsx(Nw,{values:[(e.lcpScore??0)*t.lcp*.01,(e.fcpScore??0)*t.fcp*.01,(e.fidScore??0)*t.fid*.01,(e.clsScore??0)*t.cls*.01,(e.ttfbScore??0)*t.ttfb*.01],maxValues:[t.lcp,t.fcp,t.fid,t.cls,t.ttfb],text:n,size:r,barWidth:s,segmentColors:["stroke-primary-300","stroke-primary-400","stroke-primary-500","stroke-primary-600","stroke-primary-700"],backgroundColors:["stroke-gray-400","stroke-gray-400","stroke-gray-400","stroke-gray-400","stroke-gray-400"],x:i,y:a,onHoverActions:[()=>E("lcp"),()=>E("fcp"),()=>E("fid"),()=>E("cls"),()=>E("ttfb")],onBlur:()=>E(null)})]})]})},gw=()=>{var r,s,i,a,o;const e=zi(),{page:t}=Ws(),n=[];if(e.filter(l=>l.event_id===t).map(l=>{const c={...l};rI(c,JN),n.push(c)}),t&&n.length){const l={fcpScore:Math.trunc(n[0].measurements["score.fcp"].value*100),lcpScore:Math.trunc(n[0].measurements["score.lcp"].value*100),fidScore:Math.trunc(n[0].measurements["score.fid"].value*100),clsScore:Math.trunc(n[0].measurements["score.cls"].value*100),ttfbScore:Math.trunc(n[0].measurements["score.ttfb"].value*100)},c={fcp:Math.trunc(n[0].measurements["score.weight.fcp"].value*100),lcp:Math.trunc(n[0].measurements["score.weight.lcp"].value*100),fid:Math.trunc(n[0].measurements["score.weight.fid"].value*100),cls:Math.trunc(n[0].measurements["score.weight.cls"].value*100),ttfb:Math.trunc(n[0].measurements["score.weight.ttfb"].value*100)},u=Math.trunc(n[0].measurements["score.total"].value*100),E=[{id:"fcpScore",description:"First Contentful Paint",label:"FCP",score:(r=n[0].measurements)!=null&&r.fcp?Tn(n[0].measurements.fcp.value):"-"},{id:"lcpScore",description:"Largest Contentful Paint",label:"LCP",score:(s=n[0].measurements)!=null&&s.lcp?Tn(n[0].measurements.lcp.value):"-"},{id:"fidScore",description:"First Input Delay",label:"FID",score:(i=n[0].measurements)!=null&&i.fid?Tn(n[0].measurements.fid.value):"-"},{id:"clsScore",description:"Cumulative Layout Shift",label:"CLS",score:(a=n[0].measurements)!=null&&a.cls?Tn(n[0].measurements.cls.value):"-"},{id:"ttfbScore",description:"Time to First Byte",label:"TTFB",score:(o=n[0].measurements)!=null&&o.ttfb?Tn(n[0].measurements.ttfb.value):"-"}];return A.jsxs(A.Fragment,{children:[A.jsx(jT,{crumbs:[{id:"webVitals",label:"Web Vitals",link:!0,to:"/insights/webvitals"},{id:"performanceSummary",label:"Performance Summary",link:!1}]}),A.jsxs("div",{className:"w-full px-6",children:[A.jsx("div",{className:"flex w-full items-center justify-center p-6",children:A.jsx(Cw,{totalScore:u,metricWeights:c,metricScore:l})}),A.jsx("div",{className:"flex w-full flex-wrap justify-center gap-2",children:E.map(h=>A.jsxs("div",{className:"bg-primary-900 border-primary-400 flex w-80 flex-col items-center gap-4 rounded-lg border p-2 shadow-lg",children:[A.jsx("span",{className:"text-primary-300 text-base font-semibold",children:h.label}),A.jsx("span",{className:"text-primary-300 text-sm font-light",children:h.description}),A.jsx("h2",{className:"text-primary-300 text-lg font-bold",children:h.score??"-"})]},h.id))})]})]})}return A.jsx("p",{className:"text-primary-300 px-6 py-4",children:"No measurement found."})};function Lw(){const e=qa(),{allSpans:t,localSpans:n}=pE(),[r,s]=y.useState(!e.experiments["sentry:focus-local-events"]),i=t.length-n.length,a=[rr("queries","Queries"),rr("webvitals","Web Vitals"),rr("resources","Resources")];return A.jsxs(A.Fragment,{children:[!r&&i>0&&A.jsx(Ml,{itemCount:i,onClick:()=>{s(!0)}}),A.jsx(Cl,{tabs:a,nested:!0}),A.jsxs("div",{className:"flex-1",children:[A.jsxs(Gn,{children:[A.jsx(De,{path:"queries/:type",element:A.jsx(cw,{showAll:r})}),A.jsx(De,{path:"resources",element:A.jsx(pw,{showAll:r})}),A.jsx(De,{path:"webvitals",element:A.jsx(Rw,{})}),A.jsx(De,{path:"webvitals/:page",element:A.jsx(gw,{})}),A.jsx(De,{path:"queries",element:A.jsx(lw,{showAll:r})}),A.jsx(De,{path:"*",element:A.jsx(wu,{to:"/insights/queries",replace:!0})})]}),A.jsx(xu,{})]})]})}function yw(){return A.jsx(Qa,{children:A.jsx(Gn,{children:A.jsx(De,{path:"/*",element:A.jsx(Lw,{})})})})}function vw({showAll:e}){const{name:t}=Ws(),n=zi(),r=cs(),{sort:s,toggleSortOrder:i}=so({defaultSortType:to.timestamp}),a=y.useMemo(()=>{if(!t)return[];const o={[to.timestamp]:(R,_)=>R.start_timestamp-_.start_timestamp,[to.duration]:(R,_)=>R.timestamp+_.start_timestamp-R.start_timestamp-_.timestamp},l=atob(t),c=n.filter(R=>R.type==="transaction").filter(R=>R.transaction===l),u=e?c:c.filter(R=>{var C,O;const _=(O=(C=R.contexts)==null?void 0:C.trace)==null?void 0:O.trace_id;return!_||r.isLocalToSession(_)}),E=o[s.active]||o[to.timestamp];return u.sort((R,_)=>s.asc?E(R,_):E(_,R))},[s,e,n,r,t]);return A.jsx(A.Fragment,{children:a.length!==0?A.jsxs("div",{children:[A.jsx(jT,{crumbs:[{id:"transactions",label:"Transactions",link:!0,to:"/performance/transactions"},{id:"txnSummary",label:"Transaction Summary",link:!1}]}),A.jsx("div",{className:"w-11/12 px-6 py-4",children:A.jsx("h1",{className:"truncate text-2xl font-bold",children:atob(t)})}),A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:j6.map(o=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 select-none px-6 py-3.5 text-sm font-semibold",o.primary?"w-2/5":"w-[15%]"),children:A.jsxs("div",{className:Ae("flex cursor-pointer items-center gap-1",o.primary?"justify-start":"justify-end"),onClick:()=>o.sortKey&&i(o.sortKey),children:[o.title,o.sortKey&&(s.active===o.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",s.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"}))]})},o.id))})}),A.jsx("tbody",{children:a.map(o=>{var l,c,u,E,h,R,_,C;return A.jsxs("tr",{className:"hover:bg-primary-900",children:[A.jsx("td",{className:"text-primary-200 w-2/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/explore/traces/${(c=(l=o.contexts)==null?void 0:l.trace)==null?void 0:c.trace_id}/spans/${(E=(u=o.contexts)==null?void 0:u.trace)==null?void 0:E.span_id}`,children:Ji(o.event_id)})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:Tn(o.timestamp-o.start_timestamp)}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:A.jsx(EE,{date:o.start_timestamp})}),A.jsx("td",{className:"text-primary-200 w-[15%] whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:A.jsx(Ht,{className:"truncate hover:underline",to:`/explore/traces/${(R=(h=o.contexts)==null?void 0:h.trace)==null?void 0:R.trace_id}`,children:Ji((C=(_=o.contexts)==null?void 0:_.trace)==null?void 0:C.trace_id)})})]},o.event_id)})})]})]}):A.jsx("div",{className:"text-primary-300 p-6",children:"Looks like there's no transaction recorded matching this query. 🤔"})})}function bw({showAll:e}){const t=zi(),n=cs(),r=xi(),{sort:s,toggleSortOrder:i}=so({defaultSortType:eo.lastSeen}),a=y.useMemo(()=>{const o={[eo.count]:(h,R)=>h[1].transactions.length-R[1].transactions.length,[eo.lastSeen]:(h,R)=>h[1].lastSeen-R[1].lastSeen},l=o[s.active]||o[eo.lastSeen],c=t.filter(h=>h.type==="transaction"),E=(e?c:c.filter(h=>{var _,C;const R=(C=(_=h.contexts)==null?void 0:_.trace)==null?void 0:C.trace_id;return!R||n.isLocalToSession(R)})).reduce((h,R)=>(R.transaction&&(R.transaction in h?(h[R.transaction].transactions.push(R),R.start_timestamp&&(h[R.transaction].lastSeen=R.start_timestamp)):h[R.transaction]={transactions:[R],lastSeen:R.start_timestamp}),h),{});return Object.entries(E).sort((h,R)=>s.asc?l(h,R):l(R,h))},[s,e,t,n]);return A.jsx(A.Fragment,{children:a.length!==0?A.jsx("div",{children:A.jsxs("table",{className:"divide-primary-700 w-full table-fixed divide-y",children:[A.jsx("thead",{children:A.jsx("tr",{children:W6.map(o=>A.jsx("th",{scope:"col",className:Ae("text-primary-100 select-none px-6 py-3.5 text-sm font-semibold",o.primary?"w-3/5":"w-1/5"),children:A.jsxs("div",{className:Ae("flex cursor-pointer items-center gap-1",o.primary?"justify-start":"justify-end"),onClick:()=>o.sortKey&&i(o.sortKey),children:[o.title,o.sortKey&&(s.active===o.sortKey?A.jsx(ro,{width:12,height:12,className:Ae("fill-primary-300",s.asc?"-translate-y-0.5 rotate-0":"translate-y-0.5 rotate-180")}):A.jsx(no,{width:12,height:12,className:"stroke-primary-300"}))]})},o.id))})}),A.jsx("tbody",{children:a.map(([o,l])=>A.jsxs("tr",{className:"hover:bg-primary-900 cursor-pointer",onClick:()=>{r(`/performance/transactions/${btoa(o)}`)},children:[A.jsx("td",{className:"text-primary-200 w-3/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium",children:o}),A.jsx("td",{className:"text-primary-200 w-1/5 whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:A.jsx(EE,{date:l.lastSeen})}),A.jsx("td",{className:"text-primary-200 w-1/5 whitespace-nowrap px-6 py-4 text-right text-sm font-medium",children:l.transactions.length})]},o))})]})}):A.jsx("div",{className:"text-primary-300 p-6",children:"Looks like there's no transactions recorded matching this query. 🤔"})})}function Mw(){const e=zi(),t=cs(),n=qa(),[r,s]=y.useState(!n.experiments["sentry:focus-local-events"]),i=e.filter(l=>l.type==="transaction"),a=r?i:i.filter(l=>{var u,E;const c=(E=(u=l.contexts)==null?void 0:u.trace)==null?void 0:E.trace_id;return!c||t.isLocalToSession(c)}),o=i.length-a.length;return A.jsxs("div",{className:"flex-1",children:[o>0&&A.jsx(Ml,{itemCount:o,onClick:()=>{s(!0)}}),A.jsxs(Gn,{children:[A.jsx(De,{path:"transactions",element:A.jsx(bw,{showAll:r})}),A.jsx(De,{path:"transactions/:name",element:A.jsx(vw,{showAll:r})}),A.jsx(De,{path:"*",element:A.jsx(wu,{to:"/performance/transactions",replace:!0})})]}),A.jsx(xu,{})]})}function Pw(){return A.jsx(Qa,{children:A.jsx(Gn,{children:A.jsx(De,{path:"/*",element:A.jsx(Mw,{})})})})}const Te=Le;let KT=0;function iI(){return KT>0}function Dw(){KT++,setTimeout(()=>{KT--})}function io(e,t={}){function n(s){return typeof s=="function"}if(!n(e))return e;try{const s=e.__sentry_wrapped__;if(s)return typeof s=="function"?s:e;if(uT(e))return e}catch{return e}const r=function(...s){try{const i=s.map(a=>io(a,t));return e.apply(this,i)}catch(i){throw Dw(),TT(a=>{a.addEventProcessor(o=>(t.mechanism&&(dT(o,void 0),ja(o,t.mechanism)),o.extra={...o.extra,arguments:s},o)),Qm(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}sm(r,e),tr(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}const _r=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function zT(e,t){const n=qT(e,t),r={type:Gw(t),value:kw(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function ww(e,t,n,r){const s=Me(),i=s&&s.getOptions().normalizeDepth,a=Ww(t),o={__serialized__:Um(t,i)};if(a)return{exception:{values:[zT(e,a)]},extra:o};const l={exception:{values:[{type:Xu(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Yw(t,{isUnhandledRejection:r})}]},extra:o};if(n){const c=qT(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function JT(e,t){return{exception:{values:[zT(e,t)]}}}function qT(e,t){const n=t.stacktrace||t.stack||"",r=Uw(t),s=Fw(t);try{return e(n,r,s)}catch{}return[]}const xw=/Minified React error #\d+;/i;function Uw(e){return e&&xw.test(e.message)?1:0}function Fw(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function aI(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function Gw(e){const t=e&&e.name;return!t&&aI(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function kw(e){const t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:aI(e)&&Array.isArray(e.message)&&e.message.length==2?e.message[1]:t:"No error message"}function Bw(e,t,n,r){const s=n&&n.syntheticException||void 0,i=ZT(e,t,s,r);return ja(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),ls(i)}function Hw(e,t,n="info",r,s){const i=r&&r.syntheticException||void 0,a=QT(e,t,i,s);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),ls(a)}function ZT(e,t,n,r,s){let i;if(Q1(t)&&t.error)return JT(e,t.error);if($1(t)||qv(t)){const a=t;if("stack"in t)i=JT(e,t);else{const o=a.name||($1(a)?"DOMError":"DOMException"),l=a.message?`${o}: ${a.message}`:o;i=QT(e,l,n,r),dT(i,l)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return oT(t)?JT(e,t):Ya(t)||Xu(t)?(i=ww(e,t,n,s),ja(i,{synthetic:!0}),i):(i=QT(e,t,n,r),dT(i,`${t}`),ja(i,{synthetic:!0}),i)}function QT(e,t,n,r){const s={};if(r&&n){const i=qT(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),ja(s,{synthetic:!0})}if(lT(t)){const{__sentry_template_string__:i,__sentry_template_values__:a}=t;return s.logentry={message:i,params:a},s}return s.message=t,s}function Yw(e,{isUnhandledRejection:t}){const n=s5(e),r=t?"promise rejection":"exception";return Q1(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Xu(e)?`Event \`${Vw(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Vw(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Ww(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}function jw(e,{metadata:t,tunnel:n,dsn:r}){const s={event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:yl(r)}},i=Xw(e);return Wi(s,[i])}function Xw(e){return[{type:"user_report"},e]}class Kw extends j3{constructor(t){const n={parentSpanIsAlwaysRootSpan:!0,...t},r=Te.SENTRY_SDK_SOURCE||Wb();h_(n,"browser",["browser"],r),super(n),n.sendClientReports&&Te.document&&Te.document.addEventListener("visibilitychange",()=>{Te.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,n){return Bw(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Hw(this._options.stackParser,t,n,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){_r&&ne.warn("SDK not enabled, will not capture user feedback.");return}const n=jw(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(t,n,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r)}}const $T=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,zw=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",ao=(e,t,n,r)=>{let s,i;return a=>{t.value>=0&&(a||r)&&(i=t.value-(s||0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=zw(t.value,n),e(t)))}},de=Le,Jw=()=>`v4-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Fl=(e=!0)=>{const t=de.performance&&de.performance.getEntriesByType&&de.performance.getEntriesByType("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Gl=()=>{const e=Fl();return e&&e.activationStart||0},oo=(e,t)=>{const n=Fl();let r="navigate";return n&&(de.document&&de.document.prerendering||Gl()>0?r="prerender":de.document&&de.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:typeof t>"u"?-1:t,rating:"good",delta:0,entries:[],id:Jw(),navigationType:r}},ea=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch{}},lo=e=>{const t=n=>{(n.type==="pagehide"||de.document&&de.document.visibilityState==="hidden")&&e(n)};de.document&&(addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0))},TE=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let kl=-1;const qw=()=>de.document.visibilityState==="hidden"&&!de.document.prerendering?0:1/0,hE=e=>{de.document.visibilityState==="hidden"&&kl>-1&&(kl=e.type==="visibilitychange"?e.timeStamp:0,Qw())},Zw=()=>{addEventListener("visibilitychange",hE,!0),addEventListener("prerenderingchange",hE,!0)},Qw=()=>{removeEventListener("visibilitychange",hE,!0),removeEventListener("prerenderingchange",hE,!0)},AE=()=>(de.document&&kl<0&&(kl=qw(),Zw()),{get firstHiddenTime(){return kl}}),Bl=e=>{de.document&&de.document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},$w=[1800,3e3],e8=(e,t={})=>{Bl(()=>{const n=AE(),r=oo("FCP");let s;const a=ea("paint",o=>{o.forEach(l=>{l.name==="first-contentful-paint"&&(a.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Gl(),0),r.entries.push(l),s(!0)))})});a&&(s=ao(e,r,$w,t.reportAllChanges))})},t8=[.1,.25],n8=(e,t={})=>{e8(TE(()=>{const n=oo("CLS",0);let r,s=0,i=[];const a=l=>{l.forEach(c=>{if(!c.hadRecentInput){const u=i[0],E=i[i.length-1];s&&u&&E&&c.startTime-E.startTime<1e3&&c.startTime-u.startTime<5e3?(s+=c.value,i.push(c)):(s=c.value,i=[c])}}),s>n.value&&(n.value=s,n.entries=i,r())},o=ea("layout-shift",a);o&&(r=ao(e,n,t8,t.reportAllChanges),lo(()=>{a(o.takeRecords()),r(!0)}),setTimeout(r,0))}))},r8=[100,300],s8=(e,t={})=>{Bl(()=>{const n=AE(),r=oo("FID");let s;const i=l=>{l.startTime<n.firstHiddenTime&&(r.value=l.processingStart-l.startTime,r.entries.push(l),s(!0))},a=l=>{l.forEach(i)},o=ea("first-input",a);s=ao(e,r,r8,t.reportAllChanges),o&&lo(TE(()=>{a(o.takeRecords()),o.disconnect()}))})};let oI=0,eh=1/0,SE=0;const i8=e=>{e.forEach(t=>{t.interactionId&&(eh=Math.min(eh,t.interactionId),SE=Math.max(SE,t.interactionId),oI=SE?(SE-eh)/7+1:0)})};let th;const a8=()=>th?oI:performance.interactionCount||0,o8=()=>{"interactionCount"in performance||th||(th=ea("event",i8,{type:"event",buffered:!0,durationThreshold:0}))},us=[],nh=new Map,l8=40;let c8=0;const u8=()=>a8()-c8,E8=()=>{const e=Math.min(us.length-1,Math.floor(u8()/50));return us[e]},rh=10,d8=[],f8=e=>{if(d8.forEach(r=>r(e)),!(e.interactionId||e.entryType==="first-input"))return;const t=us[us.length-1],n=nh.get(e.interactionId);if(n||us.length<rh||t&&e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===(n.entries[0]&&n.entries[0].startTime)&&n.entries.push(e);else{const r={id:e.interactionId,latency:e.duration,entries:[e]};nh.set(r.id,r),us.push(r)}us.sort((r,s)=>s.latency-r.latency),us.length>rh&&us.splice(rh).forEach(r=>nh.delete(r.id))}},lI=e=>{const t=de.requestIdleCallback||de.setTimeout;let n=-1;return e=TE(e),de.document&&de.document.visibilityState==="hidden"?e():(n=t(e),lo(e)),n},p8=[200,500],T8=(e,t={})=>{"PerformanceEventTiming"in de&&"interactionId"in PerformanceEventTiming.prototype&&Bl(()=>{o8();const n=oo("INP");let r;const s=a=>{lI(()=>{a.forEach(f8);const o=E8();o&&o.latency!==n.value&&(n.value=o.latency,n.entries=o.entries,r())})},i=ea("event",s,{durationThreshold:t.durationThreshold!=null?t.durationThreshold:l8});r=ao(e,n,p8,t.reportAllChanges),i&&(i.observe({type:"first-input",buffered:!0}),lo(()=>{s(i.takeRecords()),r(!0)}))})},h8=[2500,4e3],cI={},A8=(e,t={})=>{Bl(()=>{const n=AE(),r=oo("LCP");let s;const i=o=>{t.reportAllChanges||(o=o.slice(-1)),o.forEach(l=>{l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Gl(),0),r.entries=[l],s())})},a=ea("largest-contentful-paint",i);if(a){s=ao(e,r,h8,t.reportAllChanges);const o=TE(()=>{cI[r.id]||(i(a.takeRecords()),a.disconnect(),cI[r.id]=!0,s(!0))});["keydown","click"].forEach(l=>{de.document&&addEventListener(l,()=>lI(o),{once:!0,capture:!0})}),lo(o)}})},S8=[800,1800],sh=e=>{de.document&&de.document.prerendering?Bl(()=>sh(e)):de.document&&de.document.readyState!=="complete"?addEventListener("load",()=>sh(e),!0):setTimeout(e,0)},R8=(e,t={})=>{const n=oo("TTFB"),r=ao(e,n,S8,t.reportAllChanges);sh(()=>{const s=Fl();s&&(n.value=Math.max(s.responseStart-Gl(),0),n.entries=[s],r(!0))})},Hl={},RE={};let uI,EI,dI,fI,pI;function ih(e,t=!1){return Yl("cls",e,_8,uI,t)}function TI(e,t=!1){return Yl("lcp",e,I8,dI,t)}function hI(e){return Yl("fid",e,N8,EI)}function m8(e){return Yl("ttfb",e,O8,fI)}function AI(e){return Yl("inp",e,C8,pI)}function co(e,t){return SI(e,t),RE[e]||(g8(e),RE[e]=!0),RI(e,t)}function uo(e,t){const n=Hl[e];if(!(!n||!n.length))for(const r of n)try{r(t)}catch(s){$T&&ne.error(`Error while triggering instrumentation handler.
126
126
  Type: ${e}
127
127
  Name: ${rs(r)}
128
128
  Error:`,s)}}function _8(){return n8(e=>{uo("cls",{metric:e}),uI=e},{reportAllChanges:!0})}function N8(){return s8(e=>{uo("fid",{metric:e}),EI=e})}function I8(){return A8(e=>{uo("lcp",{metric:e}),dI=e},{reportAllChanges:!0})}function O8(){return R8(e=>{uo("ttfb",{metric:e}),fI=e})}function C8(){return T8(e=>{uo("inp",{metric:e}),pI=e})}function Yl(e,t,n,r,s=!1){SI(e,t);let i;return RE[e]||(i=n(),RE[e]=!0),r&&t({metric:r}),RI(e,t,s?i:void 0)}function g8(e){const t={};e==="event"&&(t.durationThreshold=0),ea(e,n=>{uo(e,{entries:n})},t)}function SI(e,t){Hl[e]=Hl[e]||[],Hl[e].push(t)}function RI(e,t,n){return()=>{n&&n();const r=Hl[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function L8(e){return"duration"in e}function ah(e){return typeof e=="number"&&isFinite(e)}function Es(e,t,n,{...r}){const s=ke(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),jm(e,()=>{const i=bl({startTime:t,...r});return i&&i.end(n),i})}function mI(e){const t=Me();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:a,environment:o}=t.getOptions(),l=t.getIntegrationByName("Replay"),c=l&&l.getReplayId(),u=Ze(),E=u.getUser(),h=E!==void 0?E.email||E.id||E.ip_address:void 0;let R;try{R=u.getScopeData().contexts.profile.profile_id}catch{}const _={release:a,environment:o,user:h||void 0,profile_id:R||void 0,replay_id:c||void 0,transaction:r,"user_agent.original":de.navigator&&de.navigator.userAgent,...s};return bl({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function oh(){return de&&de.addEventListener&&de.performance}function At(e){return e/1e3}function y8(){let e=0,t,n;if(!b8())return;let r=!1;function s(){r||(r=!0,n&&v8(e,t,n),i())}const i=ih(({metric:a})=>{const o=a.entries[a.entries.length-1];o&&(e=a.value,t=o)},!0);lo(()=>{s()}),setTimeout(()=>{const a=Me();if(!a)return;const o=a.on("startNavigationSpan",()=>{s(),o&&o()}),l=xt(),c=l&&Yt(l),u=c&&ke(c);u&&u.op==="pageload"&&(n=c.spanContext().spanId)},0)}function v8(e,t,n){$T&&ne.log(`Sending CLS span (${e})`);const r=At((pn||0)+(t&&t.startTime||0)),s=Ze().getScopeData().transactionName,i=t?as(t.sources[0]&&t.sources[0].node):"Layout shift",a=Lt({[yt]:"auto.http.browser.cls",[$s]:"ui.webvital.cls",[ST]:t&&t.duration||0,"sentry.pageload.span_id":n}),o=mI({name:i,transaction:s,attributes:a,startTime:r});o&&(o.addEvent("cls",{[Zu]:"",[Qu]:e}),o.end(r))}function b8(){try{return PerformanceObserver.supportedEntryTypes.includes("layout-shift")}catch{return!1}}const M8=2147483647;let _I=0,jt={},gn,Vl;function P8({recordClsStandaloneSpans:e}){const t=oh();if(t&&pn){t.mark&&de.performance.mark("sentry-tracing-init");const n=G8(),r=F8(),s=k8(),i=e?y8():U8();return()=>{n(),r(),s(),i&&i()}}return()=>{}}function D8(){co("longtask",({entries:e})=>{const t=xt();if(!t)return;const{op:n,start_timestamp:r}=ke(t);for(const s of e){const i=At(pn+s.startTime),a=At(s.duration);n==="navigation"&&r&&i<r||Es(t,i,i+a,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[yt]:"auto.ui.browser.metrics"}})}})}function w8(){new PerformanceObserver(t=>{const n=xt();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=At(pn+r.startTime),{start_timestamp:i,op:a}=ke(n);if(a==="navigation"&&i&&s<i)continue;const o=At(r.duration),l={[yt]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:u,invokerType:E,sourceURL:h,sourceFunctionName:R,sourceCharPosition:_}=c;l["browser.script.invoker"]=u,l["browser.script.invoker_type"]=E,h&&(l["code.filepath"]=h),R&&(l["code.function"]=R),_!==-1&&(l["browser.script.source_char_position"]=_),Es(n,s,s+o,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function x8(){co("event",({entries:e})=>{const t=xt();if(t){for(const n of e)if(n.name==="click"){const r=At(pn+n.startTime),s=At(n.duration),i={name:as(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[yt]:"auto.ui.browser.metrics"}},a=nm(n.target);a&&(i.attributes["ui.component_name"]=a),Es(t,r,r+s,i)}}})}function U8(){return ih(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(jt.cls={value:e.value,unit:""},Vl=t)},!0)}function F8(){return TI(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(jt.lcp={value:e.value,unit:"millisecond"},gn=t)},!0)}function G8(){return hI(({metric:e})=>{const t=e.entries[e.entries.length-1];if(!t)return;const n=At(pn),r=At(t.startTime);jt.fid={value:e.value,unit:"millisecond"},jt["mark.fid"]={value:n+r,unit:"second"}})}function k8(){return m8(({metric:e})=>{e.entries[e.entries.length-1]&&(jt.ttfb={value:e.value,unit:"millisecond"})})}function B8(e,t){const n=oh();if(!n||!n.getEntries||!pn)return;const r=At(pn),s=n.getEntries(),{op:i,start_timestamp:a}=ke(e);if(s.slice(_I).forEach(o=>{const l=At(o.startTime),c=At(Math.max(0,o.duration));if(!(i==="navigation"&&a&&r+l<a))switch(o.entryType){case"navigation":{Y8(e,o,r);break}case"mark":case"paint":case"measure":{H8(e,o,l,c,r);const u=AE(),E=o.startTime<u.firstHiddenTime;o.name==="first-paint"&&E&&(jt.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&E&&(jt.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{j8(e,o,o.name,l,c,r);break}}}),_I=Math.max(s.length-1,0),X8(e),i==="pageload"){z8(jt);const o=jt["mark.fid"];o&&jt.fid&&(Es(e,o.value,o.value+At(jt.fid.value),{name:"first input delay",op:"ui.action",attributes:{[yt]:"auto.ui.browser.metrics"}}),delete jt["mark.fid"]),(!("fcp"in jt)||!t.recordClsOnPageloadSpan)&&delete jt.cls,Object.entries(jt).forEach(([l,c])=>{c3(l,c.value,c.unit)}),e.setAttribute("performance.timeOrigin",r),e.setAttribute("performance.activationStart",Gl()),K8(e)}gn=void 0,Vl=void 0,jt={}}function H8(e,t,n,r,s){const i=Fl(!1),a=At(i?i.requestStart:0),o=s+Math.max(n,a),l=s+n,c=l+r,u={[yt]:"auto.resource.browser.metrics"};return o!==l&&(u["sentry.browser.measure_happened_before_request"]=!0,u["sentry.browser.measure_start_time"]=o),Es(e,o,c,{name:t.name,op:t.entryType,attributes:u}),o}function Y8(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{mE(e,t,r,n)}),mE(e,t,"secureConnection",n,"TLS/SSL"),mE(e,t,"fetch",n,"cache"),mE(e,t,"domainLookup",n,"DNS"),W8(e,t,n)}function mE(e,t,n,r,s=n){const i=V8(n),a=t[i],o=t[`${n}Start`];!o||!a||Es(e,r+At(o),r+At(a),{op:`browser.${s}`,name:t.name,attributes:{[yt]:"auto.ui.browser.metrics"}})}function V8(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function W8(e,t,n){const r=n+At(t.requestStart),s=n+At(t.responseEnd),i=n+At(t.responseStart);t.responseEnd&&(Es(e,r,s,{op:"browser.request",name:t.name,attributes:{[yt]:"auto.ui.browser.metrics"}}),Es(e,i,s,{op:"browser.response",name:t.name,attributes:{[yt]:"auto.ui.browser.metrics"}}))}function j8(e,t,n,r,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=ji(n),o={[yt]:"auto.resource.browser.metrics"};lh(o,t,"transferSize","http.response_transfer_size"),lh(o,t,"encodedBodySize","http.response_content_length"),lh(o,t,"decodedBodySize","http.decoded_response_content_length");const l=t.deliveryType;l!=null&&(o["http.response_delivery_type"]=l);const c=t.renderBlockingStatus;c&&(o["resource.render_blocking_status"]=c),a.protocol&&(o["url.scheme"]=a.protocol.split(":").pop()),a.host&&(o["server.address"]=a.host),o["url.same_origin"]=n.includes(de.location.origin);const u=i+r,E=u+s;Es(e,u,E,{name:n.replace(de.location.origin,""),op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",attributes:o})}function X8(e){const t=de.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),ah(n.rtt)&&(jt["connection.rtt"]={value:n.rtt,unit:"millisecond"})),ah(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),ah(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function K8(e){gn&&(gn.element&&e.setAttribute("lcp.element",as(gn.element)),gn.id&&e.setAttribute("lcp.id",gn.id),gn.url&&e.setAttribute("lcp.url",gn.url.trim().slice(0,200)),gn.loadTime!=null&&e.setAttribute("lcp.loadTime",gn.loadTime),gn.renderTime!=null&&e.setAttribute("lcp.renderTime",gn.renderTime),e.setAttribute("lcp.size",gn.size)),Vl&&Vl.sources&&Vl.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,as(t.node)))}function lh(e,t,n,r){const s=t[n];s!=null&&s<M8&&(e[r]=s)}function z8(e){const t=Fl(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const J8=1e3;let NI,ch,uh;function II(e){const t="dom";Ks(t,e),zs(t,q8)}function q8(){if(!de.document)return;const e=er.bind(null,"dom"),t=OI(e,!0);de.document.addEventListener("click",t,!1),de.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const s=de[n],i=s&&s.prototype;!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener")||(Cn(i,"addEventListener",function(a){return function(o,l,c){if(o==="click"||o=="keypress")try{const u=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},E=u[o]=u[o]||{refCount:0};if(!E.handler){const h=OI(e);E.handler=h,a.call(this,o,h,c)}E.refCount++}catch{}return a.call(this,o,l,c)}}),Cn(i,"removeEventListener",function(a){return function(o,l,c){if(o==="click"||o=="keypress")try{const u=this.__sentry_instrumentation_handlers__||{},E=u[o];E&&(E.refCount--,E.refCount<=0&&(a.call(this,o,E.handler,c),E.handler=void 0,delete u[o]),Object.keys(u).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,o,l,c)}}))})}function Z8(e){if(e.type!==ch)return!1;try{if(!e.target||e.target._sentryId!==uh)return!1}catch{}return!0}function Q8(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function OI(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=$8(n);if(Q8(n.type,r))return;tr(n,"_sentryCaptured",!0),r&&!r._sentryId&&tr(r,"_sentryId",kn());const s=n.type==="keypress"?"input":n.type;Z8(n)||(e({event:n,name:s,global:t}),ch=n.type,uh=r?r._sentryId:void 0),clearTimeout(NI),NI=de.setTimeout(()=>{uh=void 0,ch=void 0},J8)}}function $8(e){try{return e.target}catch{return null}}let _E;function NE(e){const t="history";Ks(t,e),zs(t,ex)}function ex(){if(!Kb())return;const e=de.onpopstate;de.onpopstate=function(...n){const r=de.location.href,s=_E;if(_E=r,er("history",{from:s,to:r}),e)try{return e.apply(this,n)}catch{}};function t(n){return function(...r){const s=r.length>2?r[2]:void 0;if(s){const i=_E,a=String(s);_E=a,er("history",{from:i,to:a})}return n.apply(this,r)}}Cn(de.history,"pushState",t),Cn(de.history,"replaceState",t)}const IE={};function Eh(e){const t=IE[e];if(t)return t;let n=de[e];if(PT(n))return IE[e]=n.bind(de);const r=de.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){$T&&ne.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(IE[e]=n.bind(de))}function CI(e){IE[e]=void 0}function Eo(...e){return Eh("setTimeout")(...e)}const ta="__sentry_xhr_v3__";function gI(e){const t="xhr";Ks(t,e),zs(t,tx)}function tx(){if(!de.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=fn()*1e3,a=ss(r[0])?r[0].toUpperCase():void 0,o=nx(r[1]);if(!a||!o)return t.apply(n,r);n[ta]={method:a,url:o,request_headers:{}},a==="POST"&&o.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const c=n[ta];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const u={endTimestamp:fn()*1e3,startTimestamp:i,xhr:n,virtualError:s};er("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,E){return l(),c.apply(u,E)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,E){const[h,R]=E,_=u[ta];return _&&ss(h)&&ss(R)&&(_.request_headers[h.toLowerCase()]=R),c.apply(u,E)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[ta];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:fn()*1e3,xhr:n};return er("xhr",i),t.apply(n,r)}})}function nx(e){if(ss(e))return e;try{return e.toString()}catch{}}const dh=[],OE=new Map;function rx(){if(oh()&&pn){const t=sx();return()=>{t()}}return()=>{}}const LI={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function sx(){return AI(({metric:e})=>{if(e.value==null)return;const t=e.entries.find(_=>_.duration===e.value&&LI[_.name]);if(!t)return;const{interactionId:n}=t,r=LI[t.name],s=At(pn+t.startTime),i=At(e.value),a=xt(),o=a?Yt(a):void 0,c=(n!=null?OE.get(n):void 0)||o,u=c?ke(c).description:Ze().getScopeData().transactionName,E=as(t.target),h=Lt({[yt]:"auto.http.browser.inp",[$s]:`ui.interaction.${r}`,[ST]:t.duration}),R=mI({name:E,transaction:u,attributes:h,startTime:s});R&&(R.addEvent("inp",{[Zu]:"millisecond",[Qu]:e.value}),R.end(s+i))})}function ix(e){const t=({entries:n})=>{const r=xt(),s=r&&Yt(r);n.forEach(i=>{if(!L8(i)||!s)return;const a=i.interactionId;if(a!=null&&!OE.has(a)){if(dh.length>10){const o=dh.shift();OE.delete(o)}dh.push(a),OE.set(a,s)}})};co("event",t),co("first-input",t)}function fh(e,t=Eh("fetch")){let n=0,r=0;function s(i){const a=i.body.length;n+=a,r++;const o={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return CI("fetch"),zu("No fetch implementation available");try{return t(e.url,o).then(l=>(n-=a,r--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return CI("fetch"),n-=a,r--,zu(l)}}return eb(e,s)}const ax=30,ox=50;function ph(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?Fi:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const lx=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,cx=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ux=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ex=[ax,e=>{const t=lx.exec(e);if(t){const[,r,s,i]=t;return ph(r,Fi,+s,+i)}const n=cx.exec(e);if(n){if(n[2]&&n[2].indexOf("eval")===0){const a=ux.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const[s,i]=yI(n[1]||Fi,n[2]);return ph(i,s,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],dx=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,fx=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,px=X1(...[Ex,[ox,e=>{const t=dx.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=fx.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||Fi;return[s,r]=yI(s,r),ph(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]),yI=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Fi,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},CE=1024,Tx="Breadcrumbs",hx=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Tx,setup(n){t.console&&Cb(Rx(n)),t.dom&&II(Sx(n,t.dom)),t.xhr&&gI(mx(n)),t.fetch&&y_(_x(n)),t.history&&NE(Nx(n)),t.sentry&&n.on("beforeSendEvent",Ax(n))}}};function Ax(e){return function(n){Me()===e&&ti({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:qs(n)},{event:n})}}function Sx(e,t){return function(r){if(Me()!==e)return;let s,i,a=typeof t=="object"?t.serializeAttribute:void 0,o=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;o&&o>CE&&(_r&&ne.warn(`\`dom.maxStringLength\` cannot exceed ${CE}, but a value of ${o} was configured. Sentry will use ${CE} instead.`),o=CE),typeof a=="string"&&(a=[a]);try{const c=r.event,u=Ix(c)?c.target:c;s=as(u,{keyAttrs:a,maxStringLength:o}),i=nm(u)}catch{s="<unknown>"}if(s.length===0)return;const l={category:`ui.${r.name}`,message:s};i&&(l.data={"ui.component_name":i}),ti(l,{event:r.event,name:r.name,global:r.global})}}function Rx(e){return function(n){if(Me()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:N_(n.level),message:rm(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${rm(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;ti(r,{input:n.args,level:n.level})}}function mx(e){return function(n){if(Me()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[ta];if(!r||!s||!i)return;const{method:a,url:o,status_code:l,body:c}=i,u={method:a,url:o,status_code:l},E={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:s},h=g_(l);ti({category:"xhr",data:u,type:"http",level:h},E)}}function _x(e){return function(n){if(Me()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i=n.fetchData,a={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s};ti({category:"fetch",data:i,level:"error",type:"http"},a)}else{const i=n.response,a={...n.fetchData,status_code:i&&i.status},o={input:n.args,response:i,startTimestamp:r,endTimestamp:s},l=g_(a.status_code);ti({category:"fetch",data:a,type:"http",level:l},o)}}}function Nx(e){return function(n){if(Me()!==e)return;let r=n.from,s=n.to;const i=ji(Te.location.href);let a=r?ji(r):void 0;const o=ji(s);(!a||!a.path)&&(a=i),i.protocol===o.protocol&&i.host===o.host&&(s=o.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),ti({category:"navigation",data:{from:r,to:s}})}}function Ix(e){return!!e&&!!e.target}const Ox=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Cx="BrowserApiErrors",gx=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:Cx,setupOnce(){t.setTimeout&&Cn(Te,"setTimeout",vI),t.setInterval&&Cn(Te,"setInterval",vI),t.requestAnimationFrame&&Cn(Te,"requestAnimationFrame",Lx),t.XMLHttpRequest&&"XMLHttpRequest"in Te&&Cn(XMLHttpRequest.prototype,"send",yx);const n=t.eventTarget;n&&(Array.isArray(n)?n:Ox).forEach(vx)}}};function vI(e){return function(...t){const n=t[0];return t[0]=io(n,{mechanism:{data:{function:rs(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Lx(e){return function(t){return e.apply(this,[io(t,{mechanism:{data:{function:"requestAnimationFrame",handler:rs(e)},handled:!1,type:"instrument"}})])}}function yx(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Cn(n,s,function(i){const a={mechanism:{data:{function:s,handler:rs(i)},handled:!1,type:"instrument"}},o=uT(i);return o&&(a.mechanism.data.handler=rs(o)),io(i,a)})}),e.apply(this,t)}}function vx(e){const n=Te[e],r=n&&n.prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Cn(r,"addEventListener",function(s){return function(i,a,o){try{bx(a)&&(a.handleEvent=io(a.handleEvent,{mechanism:{data:{function:"handleEvent",handler:rs(a),target:e},handled:!1,type:"instrument"}}))}catch{}return s.apply(this,[i,io(a,{mechanism:{data:{function:"addEventListener",handler:rs(a),target:e},handled:!1,type:"instrument"}}),o])}}),Cn(r,"removeEventListener",function(s){return function(i,a,o){try{const l=a.__sentry_wrapped__;l&&s.call(this,i,l,o)}catch{}return s.call(this,i,a,o)}}))}function bx(e){return typeof e.handleEvent=="function"}const Mx=()=>({name:"BrowserSession",setupOnce(){if(typeof Te.document>"u"){_r&&ne.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}t_({ignoreDuration:!0}),s_(),NE(({from:e,to:t})=>{e!==void 0&&e!==t&&(t_({ignoreDuration:!0}),s_())})}}),Px="GlobalHandlers",Dx=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Px,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(wx(n),bI("onerror")),t.onunhandledrejection&&(xx(n),bI("onunhandledrejection"))}}};function wx(e){J1(t=>{const{stackParser:n,attachStacktrace:r}=MI();if(Me()!==e||iI())return;const{msg:s,url:i,line:a,column:o,error:l}=t,c=Gx(ZT(n,l||s,void 0,r,!1),i,a,o);c.level="error",$m(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}function xx(e){q1(t=>{const{stackParser:n,attachStacktrace:r}=MI();if(Me()!==e||iI())return;const s=Ux(t),i=cT(s)?Fx(s):ZT(n,s,void 0,r,!0);i.level="error",$m(i,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function Ux(e){if(cT(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function Fx(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Gx(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],a=i[0]=i[0]||{},o=a.stacktrace=a.stacktrace||{},l=o.frames=o.frames||[],c=r,u=n,E=ss(t)&&t.length>0?t:tm();return l.length===0&&l.push({colno:c,filename:E,function:Fi,in_app:!0,lineno:u}),e}function bI(e){_r&&ne.log(`Global Handler attached: ${e}`)}function MI(){const e=Me();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const kx=()=>({name:"HttpContext",preprocessEvent(e){if(!Te.navigator&&!Te.location&&!Te.document)return;const t=e.request&&e.request.url||Te.location&&Te.location.href,{referrer:n}=Te.document||{},{userAgent:r}=Te.navigator||{},s={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...e.request,...t&&{url:t},headers:s};e.request=i}}),Bx="cause",Hx=5,Yx="LinkedErrors",Vx=(e={})=>{const t=e.limit||Hx,n=e.key||Bx;return{name:Yx,preprocessEvent(r,s,i){const a=i.getOptions();Ib(zT,a.stackParser,a.maxValueLength,n,t,r,s)}}};function Wx(e){const t=[db(),cb(),gx(),hx(),Dx(),Vx(),yb(),kx()];return e.autoSessionTracking!==!1&&t.push(Mx()),t}function jx(e={}){const t={defaultIntegrations:Wx(e),release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Te.SENTRY_RELEASE&&Te.SENTRY_RELEASE.id?Te.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return e.defaultIntegrations==null&&delete e.defaultIntegrations,{...t,...e}}function Xx(){const e=typeof Te.window<"u"&&Te;if(!e)return!1;const t=e.chrome?"chrome":"browser",n=e[t],r=n&&n.runtime&&n.runtime.id,s=Te.location&&Te.location.href||"",i=["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"],a=!!r&&Te===Te.top&&i.some(l=>s.startsWith(`${l}//`)),o=typeof e.nw<"u";return!!r&&!a&&!o}function Kx(e={}){const t=jx(e);if(!t.skipBrowserExtensionCheck&&Xx()){Xs(()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")});return}_r&&(L_()||ne.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill."));const n={...t,stackParser:Xv(t.stackParser||px),integrations:Y3(t),transport:t.transport||fh};return z3(Kw,n)}const Qe=Le,Th="sentryReplaySession",zx="replay_event",hh="Unable to send Replay",Jx=3e5,qx=9e5,Zx=5e3,Qx=5500,$x=6e4,eU=5e3,tU=3,PI=15e4,gE=5e3,nU=3e3,rU=300,Ah=2e7,sU=4999,iU=15e3,DI=36e5;function Sh(e,t){return e??t()}function Wl(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(t,...a)),t=void 0)}return n}var vt;(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"})(vt||(vt={}));function aU(e){return e.nodeType===e.ELEMENT_NODE}function jl(e){const t=Wl([e,"optionalAccess",n=>n.host]);return Wl([t,"optionalAccess",n=>n.shadowRoot])===e}function Xl(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function oU(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function lU(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 LE(e){try{const t=e.rules||e.cssRules;return t?oU(Array.from(t,wI).join("")):null}catch{return null}}function cU(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function wI(e){let t;if(EU(e))try{t=LE(e.styleSheet)||lU(e)}catch{}else if(dU(e)){let n=e.cssText;const r=e.selectorText.includes(":"),s=typeof e.style.all=="string"&&e.style.all;if(s&&(n=cU(e)),r&&(n=uU(n)),r||s)return n}return t||e.cssText}function uU(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function EU(e){return"styleSheet"in e}function dU(e){return"selectorText"in e}class xI{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){if(!t)return-1;const n=Wl([this,"access",r=>r.getMeta,"call",r=>r(t),"optionalAccess",r=>r.id]);return Sh(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 fU(){return new xI}function yE({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 Kl({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function fo(e){return e.toLowerCase()}function Rh(e){return e.toUpperCase()}const UI="__rrweb_original__";function pU(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 i=t.getImageData,a=UI in i?i[UI]:i;if(new Uint32Array(a.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(l=>l!==0))return!1}return!0}function mh(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?fo(t):null}function vE(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function FI(e,t){let n;try{n=new URL(e,Sh(t,()=>window.location.href))}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return Sh(Wl([s,"optionalAccess",i=>i[1]]),()=>null)}const GI={};function kI(e){const t=GI[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 i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return GI[e]=r.bind(window)}function _h(...e){return kI("setTimeout")(...e)}function BI(...e){return kI("clearTimeout")(...e)}function HI(e){try{return e.contentDocument}catch{}}let TU=1;const hU=new RegExp("[^a-z0-9-_:]"),zl=-2;function Nh(){return TU++}function AU(e){if(e instanceof HTMLFormElement)return"form";const t=fo(e.tagName);return hU.test(t)?"div":t}function SU(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let po,YI;const RU=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,mU=/^(?:[a-z+]+:)?\/\//i,_U=/^www\..*/i,NU=/^(data:)([^,]*),(.*)/i;function bE(e,t){return(e||"").replace(RU,(n,r,s,i,a,o)=>{const l=s||a||o,c=r||i||"";if(!l)return n;if(mU.test(l)||_U.test(l))return`url(${c}${l}${c})`;if(NU.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${SU(t)+l}${c})`;const u=t.split("/"),E=l.split("/");u.pop();for(const h of E)h!=="."&&(h===".."?u.pop():u.push(h));return`url(${c}${u.join("/")}${c})`})}const IU=/^[^ \t\n\r\u000c]+/,OU=/^[, \t\n\r\u000c]+/;function CU(e,t){if(t.trim()==="")return t;let n=0;function r(i){let a;const o=i.exec(t.substring(n));return o?(a=o[0],n+=a.length,a):""}const s=[];for(;r(OU),!(n>=t.length);){let i=r(IU);if(i.slice(-1)===",")i=To(e,i.substring(0,i.length-1)),s.push(i);else{let a="";i=To(e,i);let o=!1;for(;;){const l=t.charAt(n);if(l===""){s.push((i+a).trim());break}else if(o)l===")"&&(o=!1);else if(l===","){n+=1,s.push((i+a).trim());break}else l==="("&&(o=!0);a+=l,n+=1}}}return s.join(", ")}const VI=new WeakMap;function To(e,t){return!t||t.trim()===""?t:ME(e,t)}function gU(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ME(e,t){let n=VI.get(e);if(n||(n=e.createElement("a"),VI.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function WI(e,t,n,r,s,i){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(t==="table"||t==="td"||t==="th")?To(e,r):n==="srcset"?CU(e,r):n==="style"?bE(r,ME(e)):t==="object"&&n==="data"?To(e,r):typeof i=="function"?i(n,r,s):r)}function jI(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function LU(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 i=e.classList[s];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function yU(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function na(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:na(e.parentNode,t,n,r+1)}function ho(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(yU(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Ao(e,t,n,r,s,i){try{const a=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(a===null)return!1;if(a.tagName==="INPUT"){const c=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let o=-1,l=-1;if(i){if(l=na(a,ho(r,s)),l<0)return!0;o=na(a,ho(t,n),l>=0?l:1/0)}else{if(o=na(a,ho(t,n)),o<0)return!1;l=na(a,ho(r,s),o>=0?o:1/0)}return o>=0?l>=0?o<=l:!0:l>=0?!1:!!i}catch{}return!!i}function vU(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const o=_h(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{BI(o),s=!0,t()});return}const a="about:blank";if(r.location.href!==a||e.src===a||e.src==="")return _h(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function bU(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=_h(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{BI(i),r=!0,t()})}function MU(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:o,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:E,unmaskTextSelector:h,inlineStylesheet:R,maskInputOptions:_={},maskTextFn:C,maskInputFn:O,dataURLOptions:d={},inlineImages:f,recordCanvas:m,keepIframeSrcFn:p,newlyAddedElement:I=!1}=t,T=PU(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:vt.Document,childNodes:[],compatMode:e.compatMode}:{type:vt.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:vt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:T};case e.ELEMENT_NODE:return wU(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:a,inlineStylesheet:R,maskAttributeFn:l,maskInputOptions:_,maskInputFn:O,dataURLOptions:d,inlineImages:f,recordCanvas:m,keepIframeSrcFn:p,newlyAddedElement:I,rootId:T,maskAllText:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:E,unmaskTextSelector:h});case e.TEXT_NODE:return DU(e,{doc:n,maskAllText:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:E,unmaskTextSelector:h,maskTextFn:C,maskInputOptions:_,maskInputFn:O,rootId:T});case e.CDATA_SECTION_NODE:return{type:vt.CDATA,textContent:"",rootId:T};case e.COMMENT_NODE:return{type:vt.Comment,textContent:e.textContent||"",rootId:T};default:return!1}}function PU(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function DU(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:a,maskTextFn:o,maskInputOptions:l,maskInputFn:c,rootId:u}=t,E=e.parentNode&&e.parentNode.tagName;let h=e.textContent;const R=E==="STYLE"?!0:void 0,_=E==="SCRIPT"?!0:void 0,C=E==="TEXTAREA"?!0:void 0;if(R&&h){try{e.nextSibling||e.previousSibling||Wl([e,"access",d=>d.parentNode,"access",d=>d.sheet,"optionalAccess",d=>d.cssRules])&&(h=LE(e.parentNode.sheet))}catch(d){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${d}`,e)}h=bE(h,ME(t.doc))}_&&(h="SCRIPT_PLACEHOLDER");const O=Ao(e,r,i,s,a,n);if(!R&&!_&&!C&&h&&O&&(h=o?o(h,e.parentElement):h.replace(/[\S]/g,"*")),C&&h&&(l.textarea||O)&&(h=c?c(h,e.parentNode):h.replace(/[\S]/g,"*")),E==="OPTION"&&h){const d=yE({type:null,tagName:E,maskInputOptions:l});h=Kl({isMasked:Ao(e,r,i,s,a,d),element:e,value:h,maskInputFn:c})}return{type:vt.Text,textContent:h||"",isStyle:R,rootId:u}}function wU(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:a,maskInputOptions:o={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:u={},inlineImages:E,recordCanvas:h,keepIframeSrcFn:R,newlyAddedElement:_=!1,rootId:C,maskAllText:O,maskTextClass:d,unmaskTextClass:f,maskTextSelector:m,unmaskTextSelector:p}=t,I=LU(e,r,s,i),T=AU(e);let N={};const g=e.attributes.length;for(let S=0;S<g;S++){const b=e.attributes[S];b.name&&!jI(T,b.name)&&(N[b.name]=WI(n,T,fo(b.name),b.value,e,l))}if(T==="link"&&a){const S=Array.from(n.styleSheets).find(w=>w.href===e.href);let b=null;S&&(b=LE(S)),b&&(N.rel=null,N.href=null,N.crossorigin=null,N._cssText=bE(b,S.href))}if(T==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const S=LE(e.sheet);S&&(N._cssText=bE(S,ME(n)))}if(T==="input"||T==="textarea"||T==="select"||T==="option"){const S=e,b=mh(S),w=vE(S,Rh(T),b),k=S.checked;if(b!=="submit"&&b!=="button"&&w){const B=Ao(S,d,m,f,p,yE({type:b,tagName:Rh(T),maskInputOptions:o}));N.value=Kl({isMasked:B,element:S,value:w,maskInputFn:c})}k&&(N.checked=k)}if(T==="option"&&(e.selected&&!o.select?N.selected=!0:delete N.selected),T==="canvas"&&h){if(e.__context==="2d")pU(e)||(N.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const S=e.toDataURL(u.type,u.quality),b=n.createElement("canvas");b.width=e.width,b.height=e.height;const w=b.toDataURL(u.type,u.quality);S!==w&&(N.rr_dataURL=S)}}if(T==="img"&&E){po||(po=n.createElement("canvas"),YI=po.getContext("2d"));const S=e,b=S.currentSrc||S.getAttribute("src")||"<unknown-src>",w=S.crossOrigin,k=()=>{S.removeEventListener("load",k);try{po.width=S.naturalWidth,po.height=S.naturalHeight,YI.drawImage(S,0,0),N.rr_dataURL=po.toDataURL(u.type,u.quality)}catch(B){if(S.crossOrigin!=="anonymous"){S.crossOrigin="anonymous",S.complete&&S.naturalWidth!==0?k():S.addEventListener("load",k);return}else console.warn(`Cannot inline img src=${b}! Error: ${B}`)}S.crossOrigin==="anonymous"&&(w?N.crossOrigin=w:S.removeAttribute("crossorigin"))};S.complete&&S.naturalWidth!==0?k():S.addEventListener("load",k)}if((T==="audio"||T==="video")&&(N.rr_mediaState=e.paused?"paused":"played",N.rr_mediaCurrentTime=e.currentTime),_||(e.scrollLeft&&(N.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(N.rr_scrollTop=e.scrollTop)),I){const{width:S,height:b}=e.getBoundingClientRect();N={class:N.class,rr_width:`${S}px`,rr_height:`${b}px`}}T==="iframe"&&!R(N.src)&&(!I&&!HI(e)&&(N.rr_src=N.src),delete N.src);let P;try{customElements.get(T)&&(P=!0)}catch{}return{type:vt.Element,tagName:T,attributes:N,childNodes:[],isSVG:gU(e)||void 0,needBlock:I,rootId:C,isCustom:P}}function $e(e){return e==null?"":e.toLowerCase()}function xU(e,t){if(t.comment&&e.type===vt.Comment)return!0;if(e.type===vt.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&FI(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&($e(e.attributes.name).match(/^msapplication-tile(image|color)$/)||$e(e.attributes.name)==="application-name"||$e(e.attributes.rel)==="icon"||$e(e.attributes.rel)==="apple-touch-icon"||$e(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&$e(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&($e(e.attributes.property).match(/^(og|twitter|fb):/)||$e(e.attributes.name).match(/^(og|twitter):/)||$e(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&($e(e.attributes.name)==="robots"||$e(e.attributes.name)==="googlebot"||$e(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&($e(e.attributes.name)==="author"||$e(e.attributes.name)==="generator"||$e(e.attributes.name)==="framework"||$e(e.attributes.name)==="publisher"||$e(e.attributes.name)==="progid"||$e(e.attributes.property).match(/^article:/)||$e(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&($e(e.attributes.name)==="google-site-verification"||$e(e.attributes.name)==="yandex-verification"||$e(e.attributes.name)==="csrf-token"||$e(e.attributes.name)==="p:domain_verify"||$e(e.attributes.name)==="verify-v1"||$e(e.attributes.name)==="verification"||$e(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function So(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:E,skipChild:h=!1,inlineStylesheet:R=!0,maskInputOptions:_={},maskAttributeFn:C,maskTextFn:O,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m={},inlineImages:p=!1,recordCanvas:I=!1,onSerialize:T,onIframeLoad:N,iframeLoadTimeout:g=5e3,onStylesheetLoad:P,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:b=()=>!1,newlyAddedElement:w=!1}=t;let{preserveWhiteSpace:k=!0}=t;const B=MU(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:o,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:E,inlineStylesheet:R,maskInputOptions:_,maskAttributeFn:C,maskTextFn:O,maskInputFn:d,dataURLOptions:m,inlineImages:p,recordCanvas:I,keepIframeSrcFn:b,newlyAddedElement:w});if(!B)return console.warn(e,"not serialized"),null;let Y;r.hasNode(e)?Y=r.getId(e):xU(B,f)||!k&&B.type===vt.Text&&!B.isStyle&&!B.textContent.replace(/^\s+|\s+$/gm,"").length?Y=zl:Y=Nh();const H=Object.assign(B,{id:Y});if(r.add(e,H),Y===zl)return null;T&&T(e);let F=!h;if(H.type===vt.Element){F=F&&!H.needBlock,delete H.needBlock;const x=e.shadowRoot;x&&Xl(x)&&(H.isShadowHost=!0)}if((H.type===vt.Document||H.type===vt.Element)&&F){f.headWhitespace&&H.type===vt.Element&&H.tagName==="head"&&(k=!1);const x={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:o,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:E,skipChild:h,inlineStylesheet:R,maskInputOptions:_,maskAttributeFn:C,maskTextFn:O,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:I,preserveWhiteSpace:k,onSerialize:T,onIframeLoad:N,iframeLoadTimeout:g,onStylesheetLoad:P,stylesheetLoadTimeout:S,keepIframeSrcFn:b};for(const K of Array.from(e.childNodes)){const J=So(K,x);J&&H.childNodes.push(J)}if(aU(e)&&e.shadowRoot)for(const K of Array.from(e.shadowRoot.childNodes)){const J=So(K,x);J&&(Xl(e.shadowRoot)&&(J.isShadow=!0),H.childNodes.push(J))}}return e.parentNode&&jl(e.parentNode)&&Xl(e.parentNode)&&(H.isShadow=!0),H.type===vt.Element&&H.tagName==="iframe"&&vU(e,()=>{const x=HI(e);if(x&&N){const K=So(x,{doc:x,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:E,skipChild:!1,inlineStylesheet:R,maskInputOptions:_,maskAttributeFn:C,maskTextFn:O,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:I,preserveWhiteSpace:k,onSerialize:T,onIframeLoad:N,iframeLoadTimeout:g,onStylesheetLoad:P,stylesheetLoadTimeout:S,keepIframeSrcFn:b});K&&N(e,K)}},g),H.type===vt.Element&&H.tagName==="link"&&typeof H.attributes.rel=="string"&&(H.attributes.rel==="stylesheet"||H.attributes.rel==="preload"&&typeof H.attributes.href=="string"&&FI(H.attributes.href)==="css")&&bU(e,()=>{if(P){const x=So(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:E,skipChild:!1,inlineStylesheet:R,maskInputOptions:_,maskAttributeFn:C,maskTextFn:O,maskInputFn:d,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:I,preserveWhiteSpace:k,onSerialize:T,onIframeLoad:N,iframeLoadTimeout:g,onStylesheetLoad:P,stylesheetLoadTimeout:S,keepIframeSrcFn:b});x&&P(e,x)}},S),H}function UU(e,t){const{mirror:n=new xI,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:a=!1,maskTextClass:o="rr-mask",unmaskTextClass:l=null,maskTextSelector:c=null,unmaskTextSelector:u=null,inlineStylesheet:E=!0,inlineImages:h=!1,recordCanvas:R=!1,maskAllInputs:_=!1,maskAttributeFn:C,maskTextFn:O,maskInputFn:d,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:p,onSerialize:I,onIframeLoad:T,iframeLoadTimeout:N,onStylesheetLoad:g,stylesheetLoadTimeout:P,keepIframeSrcFn:S=()=>!1}=t;return So(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:o,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:E,maskInputOptions:_===!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}:_===!1?{}:_,maskAttributeFn:C,maskTextFn:O,maskInputFn:d,slimDOMOptions:f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:f==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:f===!1?{}:f,dataURLOptions:m,inlineImages:h,recordCanvas:R,preserveWhiteSpace:p,onSerialize:I,onIframeLoad:T,iframeLoadTimeout:N,onStylesheetLoad:g,stylesheetLoadTimeout:P,keepIframeSrcFn:S,newlyAddedElement:!1})}function li(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(t,...a)),t=void 0)}return n}function hn(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Ro=`Please stop import mirror directly. Instead of that,\r
129
129
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
130
130
  or you can use record.mirror to access the mirror instance during recording.`;let XI={map:{},getId(){return console.error(Ro),-1},getNode(){return console.error(Ro),null},removeNodeFromMap(){console.error(Ro)},has(){return console.error(Ro),!1},reset(){console.error(Ro)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(XI=new Proxy(XI,{get(e,t,n){return t==="map"&&console.error(Ro),Reflect.get(e,t,n)}}));function Jl(e,t,n={}){let r=null,s=0;return function(...i){const a=Date.now();!s&&n.leading===!1&&(s=a);const o=t-(a-s),l=this;o<=0||o>t?(r&&(VU(r),r=null),s=a,e.apply(l,i)):!r&&n.trailing!==!1&&(r=DE(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(l,i)},o))}}function KI(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(a){DE(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>KI(e,t,i||{},!0)}function Ih(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 PE=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(PE=()=>new Date().getTime());function zI(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:li([t,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||li([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||li([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:li([t,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||li([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||li([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function JI(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function qI(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ZI(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function Bn(e,t,n,r,s){if(!e)return!1;const i=ZI(e);if(!i)return!1;const a=ho(t,n);if(!s){const c=r&&i.matches(r);return a(i)&&!c}const o=na(i,a);let l=-1;return o<0?!1:(r&&(l=na(i,ho(null,r))),o>-1&&l<0?!0:o<l)}function FU(e,t){return t.getId(e)!==-1}function Oh(e,t){return t.getId(e)===zl}function QI(e,t){if(jl(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?QI(e.parentNode,t):!0:!0}function Ch(e){return!!e.changedTouches}function GU(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 $I(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function eO(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function gh(e){return!!li([e,"optionalAccess",t=>t.shadowRoot])}class kU{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return zb(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 tO(e){let t=null;return li([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 BU(e){let t=e,n;for(;n=tO(t);)t=n;return t}function HU(e){const t=e.ownerDocument;if(!t)return!1;const n=BU(e);return t.contains(n)}function nO(e){const t=e.ownerDocument;return t?t.contains(e)||HU(e):!1}const rO={};function Lh(e){const t=rO[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 i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return rO[e]=r.bind(window)}function YU(...e){return Lh("requestAnimationFrame")(...e)}function DE(...e){return Lh("setTimeout")(...e)}function VU(...e){return Lh("clearTimeout")(...e)}var Oe=(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))(Oe||{}),Re=(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))(Re||{}),An=(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))(An||{}),ci=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ci||{}),sO;(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"})(sO||(sO={}));var iO;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(iO||(iO={}));function yh(e){try{return e.contentDocument}catch{}}function WU(e){try{return e.contentWindow}catch{}}function jU(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(t,...a)),t=void 0)}return n}function aO(e){return"__ln"in e}class XU{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=jU([n,"optionalAccess",s=>s.next])||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&aO(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&&aO(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 oO=(e,t)=>`${e}@${t}`;class KU{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 XU,s=l=>{let c=l,u=zl;for(;u===zl;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},i=l=>{if(!l.parentNode||!nO(l))return;const c=jl(l.parentNode)?this.mirror.getId(tO(l)):this.mirror.getId(l.parentNode),u=s(l);if(c===-1||u===-1)return r.addNode(l);const E=So(l,{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:h=>{$I(h,this.mirror)&&!Bn(h,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(h),eO(h,this.mirror)&&this.stylesheetManager.trackLinkElement(h),gh(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(h,R)=>{Bn(h,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(h,R),h.contentWindow&&this.canvasManager.addWindow(h.contentWindow),this.shadowDomManager.observeAttachShadow(h))},onStylesheetLoad:(h,R)=>{this.stylesheetManager.attachLinkElement(h,R)}});E&&(t.push({parentId:c,nextId:u,node:E}),n.add(E.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)lO(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(const l of this.addedSet)!cO(this.droppedSet,l)&&!lO(this.removes,l,this.mirror)||cO(this.movedSet,l)?i(l):this.droppedSet.add(l);let a=null;for(;r.length;){let l=null;if(a){const c=this.mirror.getId(a.value.parentNode),u=s(a.value);c!==-1&&u!==-1&&(l=a)}if(!l){let c=r.tail;for(;c;){const u=c;if(c=c.previous,u){const E=this.mirror.getId(u.value.parentNode);if(s(u.value)===-1)continue;if(E!==-1){l=u;break}else{const R=u.value;if(R.parentNode&&R.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const _=R.parentNode.host;if(this.mirror.getId(_)!==-1){l=u;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),i(l.value)}const o={texts:this.texts.map(l=>({id:this.mirror.getId(l.node),value:l.value})).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:c}=l;if(typeof c.style=="string"){const u=JSON.stringify(l.styleDiff),E=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+E).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.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(o))},this.processMutation=t=>{if(!Oh(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!Bn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Ao(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,ZI(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 a=mh(n),o=n.tagName;s=vE(n,o,a);const l=yE({maskInputOptions:this.maskInputOptions,tagName:o,type:a}),c=Ao(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);s=Kl({isMasked:c,element:n,value:s,maskInputFn:this.maskInputFn})}if(Bn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!yh(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!jI(n.tagName,r)&&(i.attributes[r]=WI(this.doc,fo(n.tagName),fo(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const o of Array.from(n.style)){const l=n.style.getPropertyValue(o),c=n.style.getPropertyPriority(o);l!==a.style.getPropertyValue(o)||c!==a.style.getPropertyPriority(o)?c===""?i.styleDiff[o]=l:i.styleDiff[o]=[l,c]:i._unchangedStyles[o]=[l,c]}for(const o of Array.from(a.style))n.style.getPropertyValue(o)===""&&(i.styleDiff[o]=!1)}break}case"childList":{if(Bn(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=jl(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Bn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Oh(n,this.mirror)||!FU(n,this.mirror)||(this.addedSet.has(n)?(vh(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||QI(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[oO(r,s)]?vh(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:jl(t.target)&&Xl(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(Oh(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[oO(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Bn(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes.forEach(r=>this.genAdds(r)),gh(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 vh(e,t){e.delete(t),t.childNodes.forEach(n=>vh(e,n))}function lO(e,t,n){return e.length===0?!1:zU(e,t,n)}function zU(e,t,n){let r=t.parentNode;for(;r;){const s=n.getId(r);if(e.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function cO(e,t){return e.size===0?!1:uO(e,t)}function uO(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:uO(e,n):!1}let ql;function JU(e){ql=e}function qU(){ql=void 0}const we=e=>ql?(...n)=>{try{return e(...n)}catch(r){if(ql&&ql(r)===!0)return()=>{};throw r}}:e;function Nr(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(t,...a)),t=void 0)}return n}const mo=[];function Zl(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 EO(e,t){const n=new KU;mo.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=Nr([window,"optionalAccess",a=>a.Zone,"optionalAccess",a=>a.__symbol__,"optionalCall",a=>a("MutationObserver")]);s&&window[s]&&(r=window[s]);const i=new r(we(a=>{e.onMutation&&e.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function ZU({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],o;const l=Jl(we(E=>{const h=Date.now()-o;e(a.map(R=>(R.timeOffset-=h,R)),E),a=[],o=null}),i),c=we(Jl(we(E=>{const h=Zl(E),{clientX:R,clientY:_}=Ch(E)?E.changedTouches[0]:E;o||(o=PE()),a.push({x:R,y:_,id:r.getId(h),timeOffset:PE()-o}),l(typeof DragEvent<"u"&&E instanceof DragEvent?Re.Drag:E instanceof MouseEvent?Re.MouseMove:Re.TouchMove)}),s,{trailing:!1})),u=[hn("mousemove",c,n),hn("touchmove",c,n),hn("drag",c,n)];return we(()=>{u.forEach(E=>E())})}function QU({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};const o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,l=[];let c=null;const u=E=>h=>{const R=Zl(h);if(Bn(R,r,s,i,!0))return;let _=null,C=E;if("pointerType"in h){switch(h.pointerType){case"mouse":_=ci.Mouse;break;case"touch":_=ci.Touch;break;case"pen":_=ci.Pen;break}_===ci.Touch&&(An[E]===An.MouseDown?C="TouchStart":An[E]===An.MouseUp&&(C="TouchEnd"))}else Ch(h)&&(_=ci.Touch);_!==null?(c=_,(C.startsWith("Touch")&&_===ci.Touch||C.startsWith("Mouse")&&_===ci.Mouse)&&(_=null)):An[E]===An.Click&&(_=c,c=null);const O=Ch(h)?h.changedTouches[0]:h;if(!O)return;const d=n.getId(R),{clientX:f,clientY:m}=O;we(e)({type:An[C],id:d,x:f,y:m,..._!==null&&{pointerType:_}})};return Object.keys(An).filter(E=>Number.isNaN(Number(E))&&!E.endsWith("_Departed")&&o[E]!==!1).forEach(E=>{let h=fo(E);const R=u(E);if(window.PointerEvent)switch(An[E]){case An.MouseDown:case An.MouseUp:h=h.replace("mouse","pointer");break;case An.TouchStart:case An.TouchEnd:return}l.push(hn(h,R,t))}),we(()=>{l.forEach(E=>E())})}function dO({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:a}){const o=we(Jl(we(l=>{const c=Zl(l);if(!c||Bn(c,r,s,i,!0))return;const u=n.getId(c);if(c===t&&t.defaultView){const E=zI(t.defaultView);e({id:u,x:E.left,y:E.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}),a.scroll||100));return hn("scroll",o,t)}function $U({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=we(Jl(we(()=>{const i=JI(),a=qI();(n!==i||r!==a)&&(e({width:Number(a),height:Number(i)}),n=i,r=a)}),200));return hn("resize",s,t)}const e7=["INPUT","TEXTAREA","SELECT"],fO=new WeakMap;function t7({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:a,ignoreSelector:o,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:E,maskTextClass:h,unmaskTextClass:R,maskTextSelector:_,unmaskTextSelector:C}){function O(N){let g=Zl(N);const P=N.isTrusted,S=g&&Rh(g.tagName);if(S==="OPTION"&&(g=g.parentElement),!g||!S||e7.indexOf(S)<0||Bn(g,r,s,i,!0))return;const b=g;if(b.classList.contains(a)||o&&b.matches(o))return;const w=mh(g);let k=vE(b,S,w),B=!1;const Y=yE({maskInputOptions:l,tagName:S,type:w}),H=Ao(g,h,_,R,C,Y);(w==="radio"||w==="checkbox")&&(B=g.checked),k=Kl({isMasked:H,element:g,value:k,maskInputFn:c}),d(g,E?{text:k,isChecked:B,userTriggered:P}:{text:k,isChecked:B});const F=g.name;w==="radio"&&F&&B&&t.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(x=>{if(x!==g){const K=Kl({isMasked:H,element:x,value:vE(x,S,w),maskInputFn:c});d(x,E?{text:K,isChecked:!B,userTriggered:!1}:{text:K,isChecked:!B})}})}function d(N,g){const P=fO.get(N);if(!P||P.text!==g.text||P.isChecked!==g.isChecked){fO.set(N,g);const S=n.getId(N);we(e)({...g,id:S})}}const m=(u.input==="last"?["change"]:["input","change"]).map(N=>hn(N,we(O),t)),p=t.defaultView;if(!p)return()=>{m.forEach(N=>N())};const I=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),T=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return I&&I.set&&m.push(...T.map(N=>KI(N[0],N[1],{set(){we(O)({target:this,isTrusted:!1})}},!1,p))),we(()=>{m.forEach(N=>N())})}function wE(e){const t=[];function n(r,s){if(xE("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||xE("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||xE("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||xE("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(a)}return s}return n(e,t)}function ui(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function n7({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:we((u,E,h)=>{const[R,_]=h,{id:C,styleId:O}=ui(E,t,n.styleMirror);return(C&&C!==-1||O&&O!==-1)&&e({id:C,styleId:O,adds:[{rule:R,index:_}]}),u.apply(E,h)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:we((u,E,h)=>{const[R]=h,{id:_,styleId:C}=ui(E,t,n.styleMirror);return(_&&_!==-1||C&&C!==-1)&&e({id:_,styleId:C,removes:[{index:R}]}),u.apply(E,h)})});let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:we((u,E,h)=>{const[R]=h,{id:_,styleId:C}=ui(E,t,n.styleMirror);return(_&&_!==-1||C&&C!==-1)&&e({id:_,styleId:C,replace:R}),u.apply(E,h)})}));let o;r.CSSStyleSheet.prototype.replaceSync&&(o=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(o,{apply:we((u,E,h)=>{const[R]=h,{id:_,styleId:C}=ui(E,t,n.styleMirror);return(_&&_!==-1||C&&C!==-1)&&e({id:_,styleId:C,replaceSync:R}),u.apply(E,h)})}));const l={};UE("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(UE("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),UE("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),UE("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach(([u,E])=>{c[u]={insertRule:E.prototype.insertRule,deleteRule:E.prototype.deleteRule},E.prototype.insertRule=new Proxy(c[u].insertRule,{apply:we((h,R,_)=>{const[C,O]=_,{id:d,styleId:f}=ui(R.parentStyleSheet,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,adds:[{rule:C,index:[...wE(R),O||0]}]}),h.apply(R,_)})}),E.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:we((h,R,_)=>{const[C]=_,{id:O,styleId:d}=ui(R.parentStyleSheet,t,n.styleMirror);return(O&&O!==-1||d&&d!==-1)&&e({id:O,styleId:d,removes:[{index:[...wE(R),C]}]}),h.apply(R,_)})})}),we(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),o&&(r.CSSStyleSheet.prototype.replaceSync=o),Object.entries(l).forEach(([u,E])=>{E.prototype.insertRule=c[u].insertRule,E.prototype.deleteRule=c[u].deleteRule})})}function pO({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"?Nr([n,"access",a=>a.defaultView,"optionalAccess",a=>a.Document]):Nr([n,"access",a=>a.ownerDocument,"optionalAccess",a=>a.defaultView,"optionalAccess",a=>a.ShadowRoot]),i=Nr([s,"optionalAccess",a=>a.prototype])?Object.getOwnPropertyDescriptor(Nr([s,"optionalAccess",a=>a.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return Nr([i,"access",a=>a.get,"optionalAccess",a=>a.call,"call",a=>a(this)])},set(a){const o=Nr([i,"access",l=>l.set,"optionalAccess",l=>l.call,"call",l=>l(this,a)]);if(r!==null&&r!==-1)try{t.adoptStyleSheets(a,r)}catch{}return o}}),we(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function r7({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:we((o,l,c)=>{const[u,E,h]=c;if(n.has(u))return i.apply(l,[u,E,h]);const{id:R,styleId:_}=ui(Nr([l,"access",C=>C.parentRule,"optionalAccess",C=>C.parentStyleSheet]),t,r.styleMirror);return(R&&R!==-1||_&&_!==-1)&&e({id:R,styleId:_,set:{property:u,value:E,priority:h},index:wE(l.parentRule)}),o.apply(l,c)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:we((o,l,c)=>{const[u]=c;if(n.has(u))return a.apply(l,[u]);const{id:E,styleId:h}=ui(Nr([l,"access",R=>R.parentRule,"optionalAccess",R=>R.parentStyleSheet]),t,r.styleMirror);return(E&&E!==-1||h&&h!==-1)&&e({id:E,styleId:h,remove:{property:u},index:wE(l.parentRule)}),o.apply(l,c)})}),we(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=a})}function s7({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:a}){const o=we(c=>Jl(we(u=>{const E=Zl(u);if(!E||Bn(E,t,n,r,!0))return;const{currentTime:h,volume:R,muted:_,playbackRate:C}=E;e({type:c,id:s.getId(E),currentTime:h,volume:R,muted:_,playbackRate:C})}),i.media||500)),l=[hn("play",o(0),a),hn("pause",o(1),a),hn("seeked",o(2),a),hn("volumechange",o(3),a),hn("ratechange",o(4),a)];return we(()=>{l.forEach(c=>c())})}function i7({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,u){const E=new i(l,c,u);return s.set(E,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),E};const a=Ih(t.fonts,"add",function(o){return function(l){return DE(we(()=>{const c=s.get(l);c&&(e(c),s.delete(l))}),0),o.apply(this,[l])}});return r.push(()=>{n.FontFace=i}),r.push(a),we(()=>{r.forEach(o=>o())})}function a7(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:a}=e;let o=!0;const l=we(()=>{const c=t.getSelection();if(!c||o&&Nr([c,"optionalAccess",h=>h.isCollapsed]))return;o=c.isCollapsed||!1;const u=[],E=c.rangeCount||0;for(let h=0;h<E;h++){const R=c.getRangeAt(h),{startContainer:_,startOffset:C,endContainer:O,endOffset:d}=R;Bn(_,r,s,i,!0)||Bn(O,r,s,i,!0)||u.push({start:n.getId(_),startOffset:C,end:n.getId(O),endOffset:d})}a({ranges:u})});return l(),hn("selectionchange",l)}function o7({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:Ih(n.customElements,"define",function(s){return function(i,a,o){try{t({define:{name:i}})}catch{}return s.apply(this,[i,a,o])}})}function l7(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=EO(e,e.doc));const s=ZU(e),i=QU(e),a=dO(e),o=$U(e,{win:n}),l=t7(e),c=s7(e);let u=()=>{},E=()=>{},h=()=>{},R=()=>{};e.recordDOM&&(u=n7(e,{win:n}),E=pO(e,e.doc),h=r7(e,{win:n}),e.collectFonts&&(R=i7(e)));const _=a7(e),C=o7(e),O=[];for(const d of e.plugins)O.push(d.observer(d.callback,n,d.options));return we(()=>{mo.forEach(d=>d.reset()),Nr([r,"optionalAccess",d=>d.disconnect,"call",d=>d()]),s(),i(),a(),o(),l(),c(),u(),E(),h(),R(),_(),C(),O.forEach(d=>d())})}function xE(e){return typeof window[e]<"u"}function UE(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class bh{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const i=r||this.getIdToRemoteIdMap(t),a=s||this.getRemoteIdToIdMap(t);let o=i.get(n);return o||(o=this.generateIdFn(),i.set(n,o),a.set(o,n)),o}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const i=s.get(n);return i||-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 TO(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(t,...a)),t=void 0)}return n}class c7{constructor(){this.crossOriginIframeMirror=new bh(Nh),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class u7{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new bh(Nh),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new bh(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}),TO([this,"access",s=>s.loadListener,"optionalCall",s=>s(t)]);const r=yh(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}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 i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case Oe.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:Oe.IncrementalSnapshot,data:{source:Re.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Oe.Meta:case Oe.Load:case Oe.DomContentLoaded:return!1;case Oe.Plugin:return n;case Oe.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case Oe.IncrementalSnapshot:switch(n.data.source){case Re.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 Re.Drag:case Re.TouchMove:case Re.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case Re.ViewportResize:return!1;case Re.MediaInteraction:case Re.MouseInteraction:case Re.Scroll:case Re.CanvasMutation:case Re.Input:return this.replaceIds(n.data,t,["id"]),n;case Re.StyleSheetRule:case Re.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case Re.Font:return n;case Re.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case Re.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),TO([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 i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));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!==vt.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class E7{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class d7{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(!Xl(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=EO({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(dO({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),DE(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(pO({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=yh(t),r=WU(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(Ih(t.prototype,"attachShadow",function(s){return function(i){const a=s.call(this,i);return this.shadowRoot&&nO(this)&&r.addShadowRoot(this.shadowRoot,n),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class hO{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class f7{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new kU,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 i of t){let a;this.styleMirror.has(i)?a=this.styleMirror.getId(i):(a=this.styleMirror.add(i),s.push({styleId:a,rules:Array.from(i.rules||CSSRule,(o,l)=>({rule:wI(o),index:l}))})),r.styleIds.push(a)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class p7{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.active||(this.active=!0,YU(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let ft,FE;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=cE([e,"access",t=>t.contentWindow,"optionalAccess",t=>t.Array,"access",t=>t.from])||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Ir=fU();function ds(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:a=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskAllText:c=!1,maskTextClass:u="rr-mask",unmaskTextClass:E=null,maskTextSelector:h=null,unmaskTextSelector:R=null,inlineStylesheet:_=!0,maskAllInputs:C,maskInputOptions:O,slimDOMOptions:d,maskAttributeFn:f,maskInputFn:m,maskTextFn:p,maxCanvasSize:I=null,packFn:T,sampling:N={},dataURLOptions:g={},mousemoveWait:P,recordDOM:S=!0,recordCanvas:b=!1,recordCrossOriginIframes:w=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:B=!1,collectFonts:Y=!1,inlineImages:H=!1,plugins:F,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:K=new Set([]),errorHandler:J,onMutation:le,getCanvasManager:pe}=e;JU(J);const ve=w?window.parent===window:!0;let be=!1;if(!ve)try{window.parent.document&&(be=!1)}catch{be=!0}if(ve&&!t)throw new Error("emit function is required");if(!ve&&!be)return()=>{};P!==void 0&&N.mousemove===void 0&&(N.mousemove=P),Ir.reset();const ze=C===!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}:O!==void 0?O:{},rt=d===!0||d==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:d==="all",headMetaDescKeywords:d==="all"}:d||{};GU();let He,sn=0;const Kt=Ne=>{for(const an of F||[])an.eventProcessor&&(Ne=an.eventProcessor(Ne));return T&&!be&&(Ne=T(Ne)),Ne};ft=(Ne,an)=>{const Ce=Ne;if(Ce.timestamp=PE(),cE([mo,"access",je=>je[0],"optionalAccess",je=>je.isFrozen,"call",je=>je()])&&Ce.type!==Oe.FullSnapshot&&!(Ce.type===Oe.IncrementalSnapshot&&Ce.data.source===Re.Mutation)&&mo.forEach(je=>je.unfreeze()),ve)cE([t,"optionalCall",je=>je(Kt(Ce),an)]);else if(be){const je={type:"rrweb",event:Kt(Ce),origin:window.location.origin,isCheckout:an};window.parent.postMessage(je,"*")}if(Ce.type===Oe.FullSnapshot)He=Ce,sn=0;else if(Ce.type===Oe.IncrementalSnapshot){if(Ce.data.source===Re.Mutation&&Ce.data.isAttachIframe)return;sn++;const je=r&&sn>=r,Ie=n&&He&&Ce.timestamp-He.timestamp>n;(je||Ie)&&te(!0)}};const Je=Ne=>{ft({type:Oe.IncrementalSnapshot,data:{source:Re.Mutation,...Ne}})},pt=Ne=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.Scroll,...Ne}}),zt=Ne=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.CanvasMutation,...Ne}}),Gr=Ne=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.AdoptedStyleSheet,...Ne}}),Rn=new f7({mutationCb:Je,adoptedStyleSheetCb:Gr}),Yn=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new c7:new u7({mirror:Ir,mutationCb:Je,stylesheetManager:Rn,recordCrossOriginIframes:w,wrappedEmit:ft});for(const Ne of F||[])Ne.getMirror&&Ne.getMirror({nodeMirror:Ir,crossOriginIframeMirror:Yn.crossOriginIframeMirror,crossOriginIframeStyleMirror:Yn.crossOriginIframeStyleMirror});const Ai=new p7,oa=h7(pe,{mirror:Ir,win:window,mutationCb:Ne=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.CanvasMutation,...Ne}}),recordCanvas:b,blockClass:s,blockSelector:i,unblockSelector:a,maxCanvasSize:I,sampling:N.canvas,dataURLOptions:g,errorHandler:J}),Ts=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new E7:new d7({mutationCb:Je,scrollCb:pt,bypassOptions:{onMutation:le,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:u,unmaskTextClass:E,maskTextSelector:h,unmaskTextSelector:R,inlineStylesheet:_,maskInputOptions:ze,dataURLOptions:g,maskAttributeFn:f,maskTextFn:p,maskInputFn:m,recordCanvas:b,inlineImages:H,sampling:N,slimDOMOptions:rt,iframeManager:Yn,stylesheetManager:Rn,canvasManager:oa,keepIframeSrcFn:x,processedNodeManager:Ai},mirror:Ir}),te=(Ne=!1)=>{if(!S)return;ft({type:Oe.Meta,data:{href:window.location.href,width:qI(),height:JI()}},Ne),Rn.reset(),Ts.init(),mo.forEach(Ce=>Ce.lock());const an=UU(document,{mirror:Ir,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:u,unmaskTextClass:E,maskTextSelector:h,unmaskTextSelector:R,inlineStylesheet:_,maskAllInputs:ze,maskAttributeFn:f,maskInputFn:m,maskTextFn:p,slimDOM:rt,dataURLOptions:g,recordCanvas:b,inlineImages:H,onSerialize:Ce=>{$I(Ce,Ir)&&Yn.addIframe(Ce),eO(Ce,Ir)&&Rn.trackLinkElement(Ce),gh(Ce)&&Ts.addShadowRoot(Ce.shadowRoot,document)},onIframeLoad:(Ce,je)=>{Yn.attachIframe(Ce,je),Ce.contentWindow&&oa.addWindow(Ce.contentWindow),Ts.observeAttachShadow(Ce)},onStylesheetLoad:(Ce,je)=>{Rn.attachLinkElement(Ce,je)},keepIframeSrcFn:x});if(!an)return console.warn("Failed to snapshot the document");ft({type:Oe.FullSnapshot,data:{node:an,initialOffset:zI(window)}}),mo.forEach(Ce=>Ce.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Rn.adoptStyleSheets(document.adoptedStyleSheets,Ir.getId(document))};FE=te;try{const Ne=[],an=je=>we(l7)({onMutation:le,mutationCb:Je,mousemoveCb:(Ie,Vn)=>ft({type:Oe.IncrementalSnapshot,data:{source:Vn,positions:Ie}}),mouseInteractionCb:Ie=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.MouseInteraction,...Ie}}),scrollCb:pt,viewportResizeCb:Ie=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.ViewportResize,...Ie}}),inputCb:Ie=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.Input,...Ie}}),mediaInteractionCb:Ie=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.MediaInteraction,...Ie}}),styleSheetRuleCb:Ie=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.StyleSheetRule,...Ie}}),styleDeclarationCb:Ie=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.StyleDeclaration,...Ie}}),canvasMutationCb:zt,fontCb:Ie=>ft({type:Oe.IncrementalSnapshot,data:{source:Re.Font,...Ie}}),selectionCb:Ie=>{ft({type:Oe.IncrementalSnapshot,data:{source:Re.Selection,...Ie}})},customElementCb:Ie=>{ft({type:Oe.IncrementalSnapshot,data:{source:Re.CustomElement,...Ie}})},blockClass:s,ignoreClass:o,ignoreSelector:l,maskAllText:c,maskTextClass:u,unmaskTextClass:E,maskTextSelector:h,unmaskTextSelector:R,maskInputOptions:ze,inlineStylesheet:_,sampling:N,recordDOM:S,recordCanvas:b,inlineImages:H,userTriggeredOnInput:B,collectFonts:Y,doc:je,maskAttributeFn:f,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:x,blockSelector:i,unblockSelector:a,slimDOMOptions:rt,dataURLOptions:g,mirror:Ir,iframeManager:Yn,stylesheetManager:Rn,shadowDomManager:Ts,processedNodeManager:Ai,canvasManager:oa,ignoreCSSAttributes:K,plugins:cE([F,"optionalAccess",Ie=>Ie.filter,"call",Ie=>Ie(Vn=>Vn.observer),"optionalAccess",Ie=>Ie.map,"call",Ie=>Ie(Vn=>({observer:Vn.observer,options:Vn.options,callback:bt=>ft({type:Oe.Plugin,data:{plugin:Vn.name,payload:bt}})}))])||[]},{});Yn.addLoadListener(je=>{try{Ne.push(an(je.contentDocument))}catch(Ie){console.warn(Ie)}});const Ce=()=>{te(),Ne.push(an(document))};return document.readyState==="interactive"||document.readyState==="complete"?Ce():(Ne.push(hn("DOMContentLoaded",()=>{ft({type:Oe.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&Ce()})),Ne.push(hn("load",()=>{ft({type:Oe.Load,data:{}}),k==="load"&&Ce()},window))),()=>{Ne.forEach(je=>je()),Ai.destroy(),FE=void 0,qU()}}catch(Ne){console.warn(Ne)}}function T7(e){if(!FE)throw new Error("please take full snapshot after start recording");FE(e)}ds.mirror=Ir,ds.takeFullSnapshot=T7;function h7(e,t){try{return e?e(t):new hO}catch{return console.warn("Unable to initialize CanvasManager"),new hO}}const A7=3,S7=5;function Mh(e){return e>9999999999?e:e*1e3}function Ph(e){return e>9999999999?e/1e3:e}function Ql(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:Oe.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Rr(t,10,1e3)}}),t.category==="console")))}const R7="button,a";function AO(e){return e.closest(R7)||e}function SO(e){const t=RO(e);return!t||!(t instanceof Element)?t:AO(t)}function RO(e){return m7(e)?e.target:e}function m7(e){return typeof e=="object"&&!!e&&"target"in e}let Ei;function _7(e){return Ei||(Ei=[],N7()),Ei.push(e),()=>{const t=Ei?Ei.indexOf(e):-1;t>-1&&Ei.splice(t,1)}}function N7(){Cn(Qe,"open",function(e){return function(...t){if(Ei)try{Ei.forEach(n=>n())}catch{}return e.apply(Qe,t)}})}const I7=new Set([Re.Mutation,Re.StyleSheetRule,Re.StyleDeclaration,Re.AdoptedStyleSheet,Re.CanvasMutation,Re.Selection,Re.MediaInteraction]);function O7(e,t,n){e.handleClick(t,n)}class C7{constructor(t,n,r=Ql){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=_7(()=>{this._lastMutation=mO()});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(L7(n,this._ignoreSelector)||!y7(t))return;const r={timestamp:Ph(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=Ph(t)}registerScroll(t=Date.now()){this._lastScroll=Ph(t)}registerClick(t){const n=AO(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=mO();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._scrollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:a,clickBreadcrumb:o}=t;if(i){const l=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,c=l<this._timeout*1e3?"mutation":"timeout",u={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.slowClickDetected",data:{...o.data,url:Qe.location.href,route:n.getCurrentRoute(),timeAfterClickMs:l,endReason:c,clickCount:a||1}};this._addBreadcrumbEvent(n,u);return}if(a>1){const l={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.multiClick",data:{...o.data,url:Qe.location.href,route:n.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Eo(()=>this._checkClicks(),1e3)}}const g7=["A","BUTTON","INPUT"];function L7(e,t){return!!(!g7.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 y7(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function mO(){return Date.now()/1e3}function v7(e,t){try{if(!b7(t))return;const{source:n}=t.data;if(I7.has(n)&&e.registerMutation(t.timestamp),n===Re.Scroll&&e.registerScroll(t.timestamp),M7(t)){const{type:r,id:s}=t.data,i=ds.mirror.getNode(s);i instanceof HTMLElement&&r===An.Click&&e.registerClick(i)}}catch{}}function b7(e){return e.type===A7}function M7(e){return e.data.source===Re.MouseInteraction}function wr(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var GE;(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"})(GE||(GE={}));const P7=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function D7(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(P7.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const w7=e=>t=>{if(!e.isEnabled())return;const n=x7(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&&O7(e.clickDetector,n,SO(t.event)),Ql(e,n)};function _O(e,t){const n=ds.mirror.getId(e),r=n&&ds.mirror.getNode(n),s=r&&ds.mirror.getMeta(r),i=s&&F7(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(a=>a.type===GE.Text&&a.textContent).filter(Boolean).map(a=>a.trim()).join(""),attributes:D7(i.attributes)}}:{}}}function x7(e){const{target:t,message:n}=U7(e);return wr({category:`ui.${e.name}`,..._O(t,n)})}function U7(e){const t=e.name==="click";let n,r=null;try{r=t?SO(e.event):RO(e.event),n=as(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function F7(e){return e.type===GE.Element}function G7(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=k7(t);n&&Ql(e,n)}function k7(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:a}=e;if(!a||B7(a)||!i)return null;const o=t||r||s,l=i.length===1;if(!o&&l)return null;const c=as(a,{maxStringLength:200})||"<unknown>",u=_O(a,c);return wr({category:"ui.keyDown",message:c,data:{...u.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function B7(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const H7={resource:X7,paint:W7,navigation:j7};function kE(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function Y7(e){return e.map(V7).filter(Boolean)}function V7(e){const t=H7[e.entryType];return t?t(e):null}function _o(e){return((pn||Qe.performance.timeOrigin)+e)/1e3}function W7(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=_o(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function j7(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:a,domContentLoadedEventStart:o,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:u,loadEventEnd:E,redirectCount:h,startTime:R,transferSize:_,type:C}=e;return s===0?null:{type:`${t}.${C}`,start:_o(R),end:_o(i),name:n,data:{size:_,decodedBodySize:r,encodedBodySize:a,duration:s,domInteractive:c,domContentLoadedEventStart:o,domContentLoadedEventEnd:l,loadEventStart:u,loadEventEnd:E,domComplete:i,redirectCount:h}}}function X7(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:a,encodedBodySize:o,responseStatus:l,transferSize:c}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:_o(i),end:_o(s),name:r,data:{size:c,statusCode:l,decodedBodySize:a,encodedBodySize:o}}}function K7(e){const t=e.entries[e.entries.length-1],n=t&&t.element?[t.element]:void 0;return BE(e,"largest-contentful-paint",n)}function z7(e){return e.sources!==void 0}function J7(e){const t=[],n=[];for(const r of e.entries)if(z7(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const a=ds.mirror.getId(i.node);a&&s.push(a)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return BE(e,"cumulative-layout-shift",n,t)}function q7(e){const t=e.entries[e.entries.length-1],n=t&&t.target?[t.target]:void 0;return BE(e,"first-input-delay",n)}function Z7(e){const t=e.entries[e.entries.length-1],n=t&&t.target?[t.target]:void 0;return BE(e,"interaction-to-next-paint",n)}function BE(e,t,n,r){const s=e.value,i=e.rating,a=_o(s);return{type:"web-vital",name:t,start:a,end:a,data:{value:s,size:s,rating:i,nodeIds:n?n.map(o=>ds.mirror.getId(o)):void 0,attributions:r}}}function Q7(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(co(s,n))}),r.push(TI(kE(K7,e)),ih(kE(J7,e)),hI(kE(q7,e)),AI(kE(Z7,e))),()=>{r.forEach(s=>s())}}const fe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,$7='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==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},_=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},x=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=A(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}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(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)},U=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=x(f,15),M=b.t,E=b.l,A=x(h,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),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=x(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,U)+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(U,C,0),R=U;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){_(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;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=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=C[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(a[t]^a[t+1]<<A^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=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=U(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-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[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=U(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=x,c.p=_,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(J)return J.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),a=0,s=function(t){i[a++]=t},o=0;o<e;++o){if(a+5>i.length){var f=new t(a+8+(e-o<<1));f.set(i),i=f}var h=n.charCodeAt(o);h<128||r?s(h):h<2048?(s(192|h>>6),s(128|63&h)):h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&n.charCodeAt(++o))>>18),s(128|h>>12&63),s(128|h>>6&63),s(128|63&h)):(s(224|h>>12),s(128|h>>6&63),s(128|63&h))}return b(i,0,a)}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 e9(){const e=new Blob([$7]);return URL.createObjectURL(e)}const NO=["info","warn","error","log"],HE="[Replay] ";function Dh(e,t="info"){ti({category:"console",data:{logger:"replay"},level:t,message:`${HE}${e}`},{level:t})}function t9(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=r.captureExceptions,t=r.traceInternals}};return fe?(NO.forEach(r=>{n[r]=(...s)=>{ne[r](HE,...s),t&&Dh(s.join(""),N_(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),ne.error(HE,r),e?Qm(r):t&&Dh(r,"error")},n.infoTick=(...r)=>{ne.info(HE,...r),t&&setTimeout(()=>Dh(r[0]),0)}):NO.forEach(r=>{n[r]=()=>{}}),n}const he=t9();class wh extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Ah}.`)}}class IO{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!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>Ah)throw new wh;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?Mh(t):null}}class n9{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(){fe&&he.info("Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const a=({data:o})=>{const l=o;if(l.method===t&&l.id===r){if(this._worker.removeEventListener("message",a),!l.success){fe&&he.error("Error in compression worker: ",l.response),i(new Error("Error in compression worker"));return}s(l.response)}};this._worker.addEventListener("message",a),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class r9{constructor(t){this._worker=new n9(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=Mh(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Ah?Promise.reject(new wh):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{fe&&he.exception(t,'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 s9{constructor(t){this._fallback=new IO,this._compression=new r9(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}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}set waitForCheckout(t){this._used.waitForCheckout=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(t){fe&&he.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){fe&&he.exception(i,"Failed to add events when switching buffers.")}}}function i9({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=a9(t);if(n)return n}return fe&&he.info("Using simple buffer"),new IO}function a9(e){try{const t=e||o9();if(!t)return;fe&&he.info(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new s9(n)}catch(t){fe&&he.exception(t,"Failed to create compression worker")}}function o9(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?e9():""}function xh(){try{return"sessionStorage"in Qe&&!!Qe.sessionStorage}catch{return!1}}function l9(e){c9(),e.session=void 0}function c9(){if(xh())try{Qe.sessionStorage.removeItem(Th)}catch{}}function OO(e){return e===void 0?!1:Math.random()<e}function CO(e){const t=Date.now(),n=e.id||kn(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,a=e.sampled,o=e.previousSessionId;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:a,previousSessionId:o}}function Uh(e){if(xh())try{Qe.sessionStorage.setItem(Th,JSON.stringify(e))}catch{}}function u9(e,t){return OO(e)?"session":t?"buffer":!1}function gO({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=u9(e,t),i=CO({sampled:s,previousSessionId:r});return n&&Uh(i),i}function E9(){if(!xh())return null;try{const e=Qe.sessionStorage.getItem(Th);if(!e)return null;const t=JSON.parse(e);return fe&&he.infoTick("Loading existing session"),CO(t)}catch{return null}}function Fh(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function LO(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Fh(e.started,t,r)||Fh(e.lastActivity,n,r)}function yO(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!LO(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Gh({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&E9();return s?yO(s,{sessionIdleExpire:e,maxReplayDuration:t})?(fe&&he.infoTick("Session in sessionStorage is expired, creating new one..."),gO(r,{previousSessionId:s.id})):s:(fe&&he.infoTick("Creating new session"),gO(r,{previousSessionId:n}))}function d9(e){return e.type===Oe.Custom}function kh(e,t,n){return bO(e,t)?(vO(e,t,n),!0):!1}function f9(e,t,n){return bO(e,t)?vO(e,t,n):Promise.resolve(null)}async function vO(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s=e.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=e.getOptions(),a=p9(t,i.beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(i){const a=i&&i instanceof wh,o=a?"addEventSizeExceeded":"addEvent";if(a&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:o});const l=Me();l&&l.recordDroppedEvent("internal_sdk_error","replay")}}function bO(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Mh(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(fe&&he.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function p9(e,t){try{if(typeof t=="function"&&d9(e))return t(e)}catch(n){return fe&&he.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Bh(e){return!e.type}function Hh(e){return e.type==="transaction"}function T9(e){return e.type==="replay_event"}function MO(e){return e.type==="feedback"}function h9(e){return(t,n)=>{if(!e.isEnabled()||!Bh(t)&&!Hh(t))return;const r=n&&n.statusCode;if(!(!r||r<200||r>=300)){if(Hh(t)){A9(e,t);return}S9(e,t)}}}function A9(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 S9(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)||Eo(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}})}function R9(e){return t=>{!e.isEnabled()||!Bh(t)||m9(e,t)}}function m9(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=wr({category:"replay.hydrate-error",data:{url:tm()}});Ql(e,r)}}function _9(e){const t=Me();t&&t.on("beforeAddBreadcrumb",n=>N9(e,n))}function N9(e,t){if(!e.isEnabled()||!PO(t))return;const n=I9(t);n&&Ql(e,n)}function I9(e){return!PO(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?O9(e):wr(e)}function O9(e){const t=e.data&&e.data.arguments;if(!Array.isArray(t)||t.length===0)return wr(e);let n=!1;const r=t.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>gE?(n=!0,`${s.slice(0,gE)}…`):s;if(typeof s=="object")try{const i=Rr(s,7);return JSON.stringify(i).length>gE?(n=!0,`${JSON.stringify(i,null,2).slice(0,gE)}…`):i}catch{}return s});return wr({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function PO(e){return!!e.category}function C9(e,t){return e.type||!e.exception||!e.exception.values||!e.exception.values.length?!1:!!(t.originalException&&t.originalException.__rrweb__)}function DO(){const e=Ze().getPropagationContext().dsc;e&&delete e.replay_id;const t=xt();if(t){const n=Vi(t);delete n.replay_id}}function g9(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:Oe.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 L9(e,t){return e.recordingMode!=="buffer"||t.message===hh||!t.exception||t.type?!1:OO(e.getOptions().errorSampleRate)}function y9(e){return Object.assign((t,n)=>!e.isEnabled()||e.isPaused()?t:T9(t)?(delete t.breadcrumbs,t):!Bh(t)&&!Hh(t)&&!MO(t)?t:e.checkAndHandleExpiredSession()?MO(t)?(e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),g9(e,t),t):C9(t,n)&&!e.getOptions()._experiments.captureExceptions?(fe&&he.log("Ignoring error from rrweb internals",t),null):((L9(e,t)||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),t):(DO(),t),{id:"Replay"})}function YE(e,t){return t.map(({type:n,start:r,end:s,name:i,data:a})=>{const o=e.throttledAddEvent({type:Oe.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:a}}});return typeof o=="string"?Promise.resolve(null):o})}function v9(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 b9(e){return t=>{if(!e.isEnabled())return;const n=v9(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(YE(e,[n]),!1)))}}function M9(e,t){return fe&&e.getOptions()._experiments.traceInternals?!1:rb(t,Me())}function wO(e,t){e.isEnabled()&&t!==null&&(M9(e,t.name)||e.addUpdate(()=>(YE(e,[t]),!0)))}function VE(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=GO(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function xO(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function UO(e){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[GO(e)];if(!e)return[void 0]}catch(t){return fe&&he.exception(t,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return fe&&he.info("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function WE(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 FO(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:a,request:o,response:l}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:Lt({method:i,statusCode:a,request:o,response:l})}}function $l(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function di(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:i}=P9(n);return r.body=s,i&&i.length>0&&(r._meta={warnings:i}),r}function Yh(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function GO(e){return new URLSearchParams(e).toString()}function P9(e){if(!e||typeof e!="string")return{body:e};const t=e.length>PI,n=D9(e);if(t){const r=e.slice(0,PI);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 D9(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function jE(e,t){const n=w9(e);return Js(n,t)}function w9(e,t=Qe.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Qe.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 x9(e,t,n){try{const r=await F9(e,t,n),s=FO("resource.fetch",r);wO(n.replay,s)}catch(r){fe&&he.exception(r,"Failed to capture fetch breadcrumb")}}function U9(e,t){const{input:n,response:r}=t,s=n?kO(n):void 0,i=VE(s),a=r?xO(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}async function F9(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:a,method:o,status_code:l=0,request_body_size:c,response_body_size:u}=e.data,E=jE(a,n.networkDetailAllowUrls)&&!jE(a,n.networkDetailDenyUrls),h=E?G9(n,t.input,c):$l(c),R=await k9(E,n,t.response,u);return{startTimestamp:s,endTimestamp:i,url:a,method:o,statusCode:l,request:h,response:R}}function G9({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?Y9(n,t):{};if(!e)return di(s,r,void 0);const i=kO(n),[a,o]=UO(i),l=di(s,r,a);return o?WE(l,o):l}async function k9(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return $l(s);const i=r?BO(r.headers,n):{};if(!r||!t&&s!==void 0)return di(i,s,void 0);const[a,o]=await H9(r),l=B9(a,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return o?WE(l,o):l}function B9(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e&&e.length&&n===void 0?VE(e):n;return r?t?di(s,i,e):di(s,i,void 0):$l(i)}catch(i){return fe&&he.exception(i,"Failed to serialize response body"),di(s,n,void 0)}}async function H9(e){const t=V9(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await W9(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(fe&&he.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(fe&&he.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function kO(e=[]){if(!(e.length!==2||typeof e[1]!="object"))return e[1].body}function BO(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function Y9(e,t){return e.length===1&&typeof e[0]!="string"?HO(e[0],t):e.length===2?HO(e[1],t):{}}function HO(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?BO(n,t):Array.isArray(n)?{}:Yh(n,t):{}}function V9(e){try{return e.clone()}catch(t){fe&&he.exception(t,"Failed to clone response body")}}function W9(e){return new Promise((t,n)=>{const r=Eo(()=>n(new Error("Timeout while trying to read response body")),500);j9(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function j9(e){return await e.text()}async function X9(e,t,n){try{const r=z9(e,t,n),s=FO("resource.xhr",r);wO(n.replay,s)}catch(r){fe&&he.exception(r,"Failed to capture xhr breadcrumb")}}function K9(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=VE(r),i=n.getResponseHeader("content-length")?xO(n.getResponseHeader("content-length")):Q9(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function z9(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:a,xhr:o}=t,{url:l,method:c,status_code:u=0,request_body_size:E,response_body_size:h}=e.data;if(!l)return null;if(!o||!jE(l,n.networkDetailAllowUrls)||jE(l,n.networkDetailDenyUrls)){const T=$l(E),N=$l(h);return{startTimestamp:s,endTimestamp:i,url:l,method:c,statusCode:u,request:T,response:N}}const R=o[ta],_=R?Yh(R.request_headers,n.networkRequestHeaders):{},C=Yh(J9(o),n.networkResponseHeaders),[O,d]=n.networkCaptureBodies?UO(a):[void 0],[f,m]=n.networkCaptureBodies?q9(o):[void 0],p=di(_,E,O),I=di(C,h,f);return{startTimestamp:s,endTimestamp:i,url:l,method:c,statusCode:u,request:d?WE(p,d):p,response:m?WE(I,m):I}}function J9(e){const t=e.getAllResponseHeaders();return t?t.split(`\r
131
131
  `).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}function q9(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return Z9(e.response,e.responseType)}catch(n){t.push(n)}return fe&&he.warn("Failed to get xhr response body",...t),[void 0]}function Z9(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(n){return fe&&he.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return fe&&he.info("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Q9(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return VE(n)}catch{return}}function $9(e){const t=Me();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:a}=e.getOptions(),o={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:a};t&&t.on("beforeAddBreadcrumb",(l,c)=>eF(o,l,c))}catch{}}function eF(e,t,n){if(t.data)try{tF(t)&&rF(n)&&(K9(t,n),X9(t,n,e)),nF(t)&&sF(n)&&(U9(t,n),x9(t,n,e))}catch(r){fe&&he.exception(r,"Error when enriching network breadcrumb")}}function tF(e){return e.category==="xhr"}function nF(e){return e.category==="fetch"}function rF(e){return e&&e.xhr}function sF(e){return e&&e.response}function iF(e){const t=Me();II(w7(e)),NE(b9(e)),_9(e),$9(e);const n=y9(e);x3(n),t&&(t.on("beforeSendEvent",R9(e)),t.on("afterSendEvent",h9(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 i=e.getSessionId();s&&s.includeReplay&&e.isEnabled()&&i&&r.contexts&&r.contexts.feedback&&(r.contexts.feedback.replay_id=i)}))}async function aF(e){try{return Promise.all(YE(e,[oF(Qe.performance.memory)]))}catch{return[]}}function oF(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 lF(e,t,n){let r,s,i;const a=n.maxWait?Math.max(n.maxWait,t):0;function o(){return l(),r=e(),r}function l(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function c(){return s!==void 0||i!==void 0?o():r}function u(){return s&&clearTimeout(s),s=Eo(o,t),a&&i===void 0&&(i=Eo(o,a)),r}return u.cancel=l,u.flush=c,u}const ra=Le.navigator;function cF(){return/iPhone|iPad|iPod/i.test(ra&&ra.userAgent||"")||/Macintosh/i.test(ra&&ra.userAgent||"")&&ra&&ra.maxTouchPoints&&ra.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function uF(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){fe&&he.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&v7(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!kh(e,n,s))return!0;if(!s)return!1;const i=e.session;if(dF(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer){const a=e.eventBuffer.getEarliestTimestamp();a&&(fe&&he.info(`Updating session start time to earliest event in buffer to ${new Date(a)}`),i.started=a,e.getOptions().stickySession&&Uh(i))}return i&&i.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function EF(e){const t=e.getOptions();return{type:Oe.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 dF(e,t){!t||!e.session||e.session.segmentId!==0||kh(e,EF(e),!1)}function fF(e,t,n,r){return Wi(km(e,CT(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function pF({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
132
- `;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function TF({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,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const a=await Zm(e.getOptions(),r,i,t,e,Ar());if(!a)return null;a.platform=a.platform||"javascript";const o=e.getSdkMetadata(),{name:l,version:c}=o&&o.sdk||{};return a.sdk={...a.sdk,name:l||"sentry.javascript.unknown",version:c||"0.0.0"},a}async function hF({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const a=pF({recordingData:e,headers:{segment_id:n}}),{urls:o,errorIds:l,traceIds:c,initialTimestamp:u}=r,E=Me(),h=Ze(),R=E&&E.getTransport(),_=E&&E.getDsn();if(!E||!R||!_||!i.sampled)return ls({});const C={type:zx,replay_start_timestamp:u/1e3,timestamp:s/1e3,error_ids:l,trace_ids:c,urls:o,replay_id:t,segment_id:n,replay_type:i.sampled},O=await TF({scope:h,client:E,replayId:t,event:C});if(!O)return E.recordDroppedEvent("event_processor","replay",C),fe&&he.info("An event processor returned `null`, will not send event."),ls({});delete O.sdkProcessingMetadata;const d=fF(O,a,_,E.getOptions().tunnel);let f;try{f=await R.send(d)}catch(p){const I=new Error(hh);try{I.cause=p}catch{}throw I}if(typeof f.statusCode=="number"&&(f.statusCode<200||f.statusCode>=300))throw new YO(f.statusCode);const m=f_({},f);if(d_(m,"replay"))throw new Vh(m);return f}class YO extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Vh extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function VO(e,t={count:0,interval:eU}){const{recordingData:n,onError:r}=e;if(n.length)try{return await hF(e),!0}catch(s){if(s instanceof YO||s instanceof Vh)throw s;if(e_("Replays",{_retryCount:t.count}),r&&r(s),t.count>=tU){const i=new Error(`${hh} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,a)=>{Eo(async()=>{try{await VO(e,t),i(!0)}catch(o){a(o)}},t.interval)})}}const WO="__THROTTLED",AF="__SKIPPED";function SF(e,t,n){const r=new Map,s=o=>{const l=o-n;r.forEach((c,u)=>{u<l&&r.delete(u)})},i=()=>[...r.values()].reduce((o,l)=>o+l,0);let a=!1;return(...o)=>{const l=Math.floor(Date.now()/1e3);if(s(l),i()>=t){const u=a;return a=!0,u?AF:WO}a=!1;const c=r.get(l)||0;return r.set(l,c+1),e(...o)}}class fi{constructor({options:t,recordingOptions:n}){fi.prototype.__init.call(this),fi.prototype.__init2.call(this),fi.prototype.__init3.call(this),fi.prototype.__init4.call(this),fi.prototype.__init5.call(this),fi.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Jx,sessionIdleExpire:qx},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=lF(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=SF((a,o)=>f9(this,a,o),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(nU,r),timeout:r,scrollTimeout:rU,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new C7(this,i)),fe){const a=t._experiments;he.setConfig({captureExceptions:!!a.captureExceptions,traceInternals:!!a.traceInternals})}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){fe&&he.exception(t),this._options.onError&&this._options.onError(t)}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){fe&&he.exception(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",fe&&he.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){fe&&he.info("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){fe&&he.info("Buffering is in progress, call `flush()` to save the replay");return}fe&&he.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Gh({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this._initializeRecording()}startBuffering(){if(this._isEnabled){fe&&he.info("Buffering is in progress, call `flush()` to save the replay");return}fe&&he.infoTick("Starting replay in buffer mode");const t=Gh({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=ds({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:$x}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:uF(this),...cF(),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{fe&&he.info(`Stopping Replay${n?` triggered by ${n}`:""}`),DO(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,l9(this)}catch(r){this.handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),fe&&he.info("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),fe&&he.info("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();fe&&he.info("Converting buffer to session"),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&&Fh(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${Qe.location.pathname}${Qe.location.hash}${Qe.location.search}`,n=`${Qe.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===WO){const s=wr({category:"replay.throttled"});this.addUpdate(()=>!kh(this,{type:S7,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||xt(),n=t&&Yt(t),s=(n&&ke(n).data||{})[Sr];if(!(!n||!s||!["route","custom"].includes(s)))return ke(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=i9({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=Gh({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,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 yO(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{Qe.document.addEventListener("visibilitychange",this._handleVisibilityChange),Qe.addEventListener("blur",this._handleWindowBlur),Qe.addEventListener("focus",this._handleWindowFocus),Qe.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(iF(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=Q7(this)}_removeListeners(){try{Qe.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Qe.removeEventListener("blur",this._handleWindowBlur),Qe.removeEventListener("focus",this._handleWindowFocus),Qe.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}__init(){this._handleVisibilityChange=()=>{Qe.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const t=wr({category:"ui.blur"});this._doChangeToBackgroundTasks(t)}}__init3(){this._handleWindowFocus=()=>{const t=wr({category:"ui.focus"});this._doChangeToForegroundTasks(t)}}__init4(){this._handleKeyboardEvent=t=>{G7(this,t)}}_doChangeToBackgroundTasks(t){!this.session||LO(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()){fe&&he.info("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:Oe.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=Y7(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(YE(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){fe&&he.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await aF(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 i=await this.eventBuffer.finish();await VO({replayId:t,recordingData:i,segmentId:s,eventContext:r,session:this.session,timestamp:n,onError:a=>this.handleException(a)})}catch(n){this.handleException(n),this.stop({reason:"sendReplay"});const r=Me();if(r){const s=n instanceof Vh?"ratelimit_backoff":"send_error";r.recordDroppedEvent(s,"replay")}}}__init5(){this._flush=async({force:t=!1}={})=>{if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){fe&&he.error("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 i=s<this._options.minReplayDuration,a=s>this._options.maxReplayDuration+5e3;if(i||a){fe&&he.info(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const o=this.eventBuffer;o&&this.session.segmentId===0&&!o.hasCheckout&&fe&&he.info("Flushing initial segment without checkout.");const l=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(c){this.handleException(c)}finally{this._flushLock=void 0,l&&this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Uh(this.session)}__init6(){this._onMutationHandler=t=>{const n=t.length,r=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=r&&n>r;if(n>s||i){const a=wr({category:"replay.mutations",data:{count:n,limit:i}});this._createCustomBreadcrumb(a)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function ec(e,t){return[...e,...t].join(",")}function RF({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],a=ec(e,[".sentry-mask","[data-sentry-mask]"]),o=ec(t,[]);return{maskTextSelector:a,unmaskTextSelector:o,blockSelector:ec(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:ec(r,[]),ignoreSelector:ec(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function mF({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const jO='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',_F=["content-length","content-type","accept"];let XO=!1;const NF=e=>new XE(e);class XE{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:t=Zx,flushMaxDelay:n=Qx,minReplayDuration:r=sU,maxReplayDuration:s=DI,stickySession:i=!0,useCompression:a=!0,workerUrl:o,_experiments:l={},maskAllText:c=!0,maskAllInputs:u=!0,blockAllMedia:E=!0,mutationBreadcrumbLimit:h=750,mutationLimit:R=1e4,slowClickTimeout:_=7e3,slowClickIgnoreSelectors:C=[],networkDetailAllowUrls:O=[],networkDetailDenyUrls:d=[],networkCaptureBodies:f=!0,networkRequestHeaders:m=[],networkResponseHeaders:p=[],mask:I=[],maskAttributes:T=["title","placeholder"],unmask:N=[],block:g=[],unblock:P=[],ignore:S=[],maskFn:b,beforeAddRecordingEvent:w,beforeErrorSampling:k,onError:B}={}){this.name=XE.id;const Y=RF({mask:I,unmask:N,block:g,unblock:P,ignore:S});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:b,maskInputFn:b,maskAttributeFn:(H,F,x)=>mF({maskAttributes:T,maskAllText:c,privacyOptions:Y,key:H,value:F,el:x}),...Y,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:H=>{try{H.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,iU),maxReplayDuration:Math.min(s,DI),stickySession:i,useCompression:a,workerUrl:o,blockAllMedia:E,maskAllInputs:u,maskAllText:c,mutationBreadcrumbLimit:h,mutationLimit:R,slowClickTimeout:_,slowClickIgnoreSelectors:C,networkDetailAllowUrls:O,networkDetailDenyUrls:d,networkCaptureBodies:f,networkRequestHeaders:KO(m),networkResponseHeaders:KO(p),beforeAddRecordingEvent:w,beforeErrorSampling:k,onError:B,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${jO}`:jO),this._isInitialized&&M_())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return XO}set _isInitialized(t){XO=t}afterAllSetup(t){!M_()||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()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}getRecordingMode(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=IF(this._initialOptions,t);this._replay=new fi({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}XE.__initStatic();function IF(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...Lt(e)},s=eE(n.replaysSessionSampleRate),i=eE(n.replaysOnErrorSampleRate);return s==null&&i==null&&Xs(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function KO(e){return[..._F,...e.map(t=>t.toLowerCase())]}const zO=new WeakMap,Wh=new Map,KE={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function OF(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:a,tracePropagationTargets:o}={traceFetch:KE.traceFetch,traceXHR:KE.traceXHR,trackFetchStreamPerformance:KE.trackFetchStreamPerformance,...t},l=typeof i=="function"?i:E=>!0,c=E=>yF(E,o),u={};n&&(e.addEventProcessor(E=>(E.type==="transaction"&&E.spans&&E.spans.forEach(h=>{if(h.op==="http.client"){const R=Wh.get(h.span_id);R&&(h.timestamp=R/1e3,Wh.delete(h.span_id))}}),E)),s&&kb(E=>{if(E.response){const h=zO.get(E.response);h&&E.endTimestamp&&Wh.set(h,E.endTimestamp)}}),y_(E=>{const h=Pb(E,l,c,u);if(E.response&&E.fetchData.__span&&zO.set(E.response,E.fetchData.__span),h){const R=qO(E.fetchData.url),_=R?ji(R).host:void 0;h.setAttributes({"http.url":R,"server.address":_})}a&&h&&JO(h)})),r&&gI(E=>{const h=vF(E,l,c,u);a&&h&&JO(h)})}function CF(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function JO(e){const{url:t}=ke(e).data||{};if(!t||typeof t!="string")return;const n=co("resource",({entries:r})=>{r.forEach(s=>{CF(s)&&s.name.endsWith(t)&&(LF(s).forEach(a=>e.setAttribute(...a)),setTimeout(n))})})}function gF(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function xr(e=0){return((pn||performance.timeOrigin)+e)/1e3}function LF(e){const{name:t,version:n}=gF(e.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",t]),pn?[...r,["http.request.redirect_start",xr(e.redirectStart)],["http.request.fetch_start",xr(e.fetchStart)],["http.request.domain_lookup_start",xr(e.domainLookupStart)],["http.request.domain_lookup_end",xr(e.domainLookupEnd)],["http.request.connect_start",xr(e.connectStart)],["http.request.secure_connection_start",xr(e.secureConnectionStart)],["http.request.connection_end",xr(e.connectEnd)],["http.request.request_start",xr(e.requestStart)],["http.request.response_start",xr(e.responseStart)],["http.request.response_end",xr(e.responseEnd)]]:r}function yF(e,t){const n=Te.location&&Te.location.href;if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Js(r.toString(),t)||i&&Js(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Js(e,t):r}}function vF(e,t,n,r){const s=e.xhr,i=s&&s[ta];if(!s||s.__sentry_own_request__||!i)return;const a=ei()&&t(i.url);if(e.endTimestamp&&a){const E=s.__sentry_xhr_span_id__;if(!E)return;const h=r[E];h&&i.status_code!==void 0&&(Tm(h,i.status_code),h.end(),delete r[E]);return}const o=qO(i.url),l=o?ji(o).host:void 0,c=!!xt(),u=a&&c?bl({name:`${i.method} ${i.url}`,attributes:{type:"xhr","http.method":i.method,"http.url":o,url:i.url,"server.address":l,[yt]:"auto.http.browser",[$s]:"http.client"}}):new Ja;return s.__sentry_xhr_span_id__=u.spanContext().spanId,r[s.__sentry_xhr_span_id__]=u,n(i.url)&&bF(s,ei()&&c?u:void 0),u}function bF(e,t){const{"sentry-trace":n,baggage:r}=A_({span:t});n&&MF(e,n,r)}function MF(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader("baggage",n)}catch{}}function qO(e){try{return new URL(e,Te.location.origin).href}catch{return}}function PF(){Te&&Te.document?Te.document.addEventListener("visibilitychange",()=>{const e=xt();if(!e)return;const t=Yt(e);if(Te.document.hidden&&t){const n="cancelled",{op:r,status:s}=ke(t);_r&&ne.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:wt,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):_r&&ne.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const DF="BrowserTracing",wF={...nE,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...KE},xF=(e={})=>{F5();const{enableInp:t,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:s,enableStandaloneClsSpans:i},beforeStartSpan:a,idleTimeout:o,finalTimeout:l,childSpanTimeout:c,markBackgroundSpan:u,traceFetch:E,traceXHR:h,trackFetchStreamPerformance:R,shouldCreateSpanForRequest:_,enableHTTPTimings:C,instrumentPageLoad:O,instrumentNavigation:d}={...wF,...e},f=P8({recordClsStandaloneSpans:i||!1});t&&rx(),r&&Le.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?w8():n&&D8(),s&&x8();const m={name:void 0,source:void 0};function p(I,T){const N=T.op==="pageload",g=a?a(T):T,P=g.attributes||{};T.name!==g.name&&(P[Sr]="custom",g.attributes=P),m.name=g.name,m.source=P[Sr];const S=zm(g,{idleTimeout:o,finalTimeout:l,childSpanTimeout:c,disableAutoFinish:N,beforeSpanEnd:w=>{f(),B8(w,{recordClsOnPageloadSpan:!i})}});function b(){["interactive","complete"].includes(Te.document.readyState)&&I.emit("idleSpanEnableAutoFinish",S)}return N&&Te.document&&(Te.document.addEventListener("readystatechange",()=>{b()}),b()),S}return{name:DF,afterAllSetup(I){let T,N=Te.location&&Te.location.href;function g(){T&&!ke(T).timestamp&&(_r&&ne.log(`[Tracing] Finishing current active span with op: ${ke(T).op}`),T.end())}I.on("startNavigationSpan",P=>{Me()===I&&(g(),T=p(I,{op:"navigation",...P}))}),I.on("startPageLoadSpan",(P,S={})=>{if(Me()!==I)return;g();const b=S.sentryTrace||ZO("sentry-trace"),w=S.baggage||ZO("baggage"),k=b5(b,w);Ze().setPropagationContext(k),T=p(I,{op:"pageload",...P})}),I.on("spanEnd",P=>{const S=ke(P).op;if(P!==Yt(P)||S!=="navigation"&&S!=="pageload")return;const b=Ze(),w=b.getPropagationContext();b.setPropagationContext({...w,sampled:w.sampled!==void 0?w.sampled:Hi(P),dsc:w.dsc||Vi(P)})}),Te.location&&(O&&jh(I,{name:Te.location.pathname,startTime:pn?pn/1e3:void 0,attributes:{[Sr]:"url",[yt]:"auto.pageload.browser"}}),d&&NE(({to:P,from:S})=>{if(S===void 0&&N&&N.indexOf(P)!==-1){N=void 0;return}S!==P&&(N=void 0,UF(I,{name:Te.location.pathname,attributes:{[Sr]:"url",[yt]:"auto.navigation.browser"}}))})),u&&PF(),s&&FF(o,l,c,m),t&&ix(),OF(I,{traceFetch:E,traceXHR:h,trackFetchStreamPerformance:R,tracePropagationTargets:I.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:C})}}};function jh(e,t,n){e.emit("startPageLoadSpan",t,n),Ze().setTransactionName(t.name);const r=xt();return(r&&ke(r).op)==="pageload"?r:void 0}function UF(e,t){Ar().setPropagationContext({traceId:Zs()}),Ze().setPropagationContext({traceId:Zs()}),e.emit("startNavigationSpan",t),Ze().setTransactionName(t.name);const n=xt();return(n&&ke(n).op)==="navigation"?n:void 0}function ZO(e){const t=n5(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}function FF(e,t,n,r){let s;const i=()=>{const a="ui.action.click",o=xt(),l=o&&Yt(o);if(l){const c=ke(l).op;if(["navigation","pageload"].includes(c)){_r&&ne.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(AT,"interactionInterrupted"),s.end(),s=void 0),!r.name){_r&&ne.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}s=zm({name:r.name,op:a,attributes:{[Sr]:r.source||"url"}},{idleTimeout:e,finalTimeout:t,childSpanTimeout:n})};Te.document&&addEventListener("click",i,{once:!1,capture:!0})}function No(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function GF(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=No(n);return s=>r.then(i=>s(i.transaction(t,"readwrite").objectStore(t)))}function Xh(e){return No(e.getAllKeys())}function kF(e,t,n){return e(r=>Xh(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.max(...s,0)+1),No(r.transaction)}))}function BF(e,t,n){return e(r=>Xh(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.min(...s,0)-1),No(r.transaction)}))}function HF(e){return e(t=>Xh(t).then(n=>{const r=n[0];if(r!=null)return No(t.get(r)).then(s=>(t.delete(r),No(t.transaction).then(()=>s)))}))}function YF(e){let t;function n(){return t==null&&(t=GF(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const s=await vl(r);await kF(n(),s,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const s=await vl(r);await BF(n(),s,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await HF(n());if(r)return t3(r)}catch{}}}}function VF(e){return t=>{const n=e({...t,createStore:YF});return Te.addEventListener("online",async r=>{await n.flush()}),n}}function WF(e=fh){return VF(nb(e))}const jF="SpotlightBrowser",XF=(e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:jF,setup:()=>{_r&&ne.log("Using Sidecar URL",t)},processEvent:n=>zF(n)?null:n,afterAllSetup:n=>{KF(n,t)}}};function KF(e,t){const n=Eh("fetch");let r=0;e.on("beforeEnvelope",s=>{if(r>3){ne.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:vl(s),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,ne.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}const QO=XF;function zF(e){return!!(e.type==="transaction"&&e.spans&&e.contexts&&e.contexts.trace&&e.contexts.trace.op==="ui.action.click"&&e.spans.some(({description:t})=>t&&t.includes("#sentry-spotlight")))}const JF="application/x-sentry-envelope";function $O(e={}){return{name:"sentry",forwardedContentType:[JF],setup:({open:t,sidecarUrl:n})=>{e.retries==null&&(e.retries=10);let r;n&&(r=H1(n,"/stream"),nt.setSidecarUrl(r)),Ge("Setting up Sentry integration for Spotlight"),eC(e,r&&new URL("/stream",r).href),e.openLastError&&nt.subscribe("event",i=>{i.exception&&setTimeout(()=>t(`/errors/${i.event_id}`),0)});const s=i=>{Ge("Sentry Event",i.detail.event_id),i.detail.event&&nt.pushEvent(i.detail.event).then(()=>t(`/errors/${i.detail.event.event_id}`))};return Ol("sentry:showError",s),()=>{b1("sentry:showError",s)}},processEvent:t=>ZF(t),tabs:()=>{const t=nt.getEvents().filter(n=>{var r,s,i,a;return n.type!=="transaction"&&((s=(r=n.contexts)==null?void 0:r.trace)!=null&&s.trace_id?nt.isTraceLocal((a=(i=n.contexts)==null?void 0:i.trace)==null?void 0:a.trace_id):null)!==!1}).length;return[{id:"errors",title:"Errors",notificationCount:{count:t,severe:t>0},content:qM},{id:"explore",title:"Explore",content:aw},{id:"insights",title:"Insights",content:yw},{id:"performance",title:"Performance",content:Pw}]},reset:()=>{nt.resetData()}}}function qF(e){let t=e.indexOf(10);return t===-1&&(t=e.length),t}function Kh(e){return JSON.parse(new TextDecoder().decode(e))}function ZF(e){let t=typeof e.data=="string"?Uint8Array.from(e.data,a=>a.charCodeAt(0)):e.data;function n(a){const o=a??qF(t),l=t.subarray(0,o);return t=t.subarray(o+1),l}const r=Kh(n()),s=[];for(;t.length;){const a=Kh(n()),o=a.length,l=n(o);let c;try{c=Kh(l),a.type&&(c.type=a.type)}catch(u){c=l,Ge(u)}s.push([a,c])}const i=[r,s];return nt.pushEnvelope({envelope:i,rawEnvelope:e}),{event:i,rawEvent:e}}function eC(e,t){if(e.injectIntoSDK===!1)return;const n=window.__SENTRY__,r=n&&QF(n);if(!r){Ge("Couldn't find a Sentry SDK client. Make sure you're using a Sentry SDK with version >=7.99.0 or 8.x"),e.retries&&(Ge(`Will retry ${e.retries} more time(s) at 100ms intervals...`),e.retries--,setTimeout(()=>{eC(e,t)},500));return}if(!r.getDsn()){Ge("Sentry SDK doesn't have a valid DSN. Enabling SDK integrations for just Spotlight.");try{const s=r.getOptions().integrations;for(const i of s)r.addIntegration(i)}catch(s){G1("Failed to enable all SDK integrations for Spotlight",s),Ge("Please open an issue with the error at: https://github.com/getsentry/spotlight/issues/new/choose")}}r._dsn=void 0,r._options.tracesSampler=()=>1,r._options.sampleRate=1;try{const s=Object.keys(r._integrations).find(i=>/spotlight/i.test(i));if(s){Ge(`Skipping adding integration as there's already a Spotlight integration enabled in Sentry SDK: ${s}`);return}r.addIntegration(Jb()),r.addIntegration(QO({sidecarUrl:t}))}catch(s){G1("Failed to add Spotlight integration to Sentry",s),Ge("Please open an issue with the error at: https://github.com/getsentry/spotlight/issues/new/choose")}Ge("Added Spotlight integration to Sentry SDK")}function QF(e){var t,n,r;if(e.version){const s=e[e.version],i=typeof((t=s==null?void 0:s.stack)==null?void 0:t.getScope)=="function"?(r=(n=s==null?void 0:s.stack)==null?void 0:n.getScope)==null?void 0:r.call(n):void 0;if(typeof(i==null?void 0:i.getClient)=="function")return i.getClient()}if(e.hub){const s=e.hub;if(typeof s.getClient=="function")return s.getClient()}}var zE={},tC=fy;zE.createRoot=tC.createRoot,zE.hydrateRoot=tC.hydrateRoot;function $F(e){const t={...e};return h_(t,"react"),e_("react",{version:y.version}),Kx(t)}const eG=new WeakSet;function tG(e,t){const n=xF({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:s,useNavigationType:i,createRoutesFromChildren:a,matchRoutes:o,stripBasename:l,instrumentPageLoad:c=!0,instrumentNavigation:u=!0}=e;return{...n,setup(){},afterAllSetup(E){n.afterAllSetup(E);const h=Te&&Te.location&&Te.location.pathname;c&&h&&jh(E,{name:h,attributes:{[Sr]:"url",[$s]:"pageload",[yt]:`auto.pageload.react.reactrouter_v${t}`}}),u&&eG.add(E)}}}function nG(e){return tG(e,"6")}function rG(e,t={}){const n={},r=performance.getEntriesByType("navigation");if(r.length>0){const l=r[0].serverTiming;if(l&&l.length>0)for(const{name:c,description:u}of l)(c==="sentryTrace"||c==="baggage")&&(n[c]=u)}const s=Object.keys(n).length===2,i=[nG({instrumentPageLoad:!s,useEffect:y.useEffect,useLocation:Vs,useNavigationType:ky,createRoutesFromChildren:Uu,matchRoutes:f1}),NF()],a=document.location.hash.slice(1);if(a.startsWith("spotlight")){const l=a.indexOf("="),c=l>-1?decodeURIComponent(a.slice(l+1)):void 0;i.push(QO({sidecarUrl:c}))}const o=$F({transport:WF(fh),dsn:"https://51bcd92dba1128934afd1c5726c84442@o1.ingest.us.sentry.io/4508404727283713",environment:"production",release:"spotlight@2.11.0",integrations:i,tracesSampleRate:1,tracePropagationTargets:[/^\//,document.location.origin],replaysSessionSampleRate:.01,replaysOnErrorSampleRate:1,...t});s&&o&&jh(o,{name:e},n)}function sG({processedEvents:e}){const t=e||[];return A.jsxs("div",{className:"divide-primary-900 bg-primary-950 divide-y p-4",children:[A.jsx("h1",{className:"mb-2 text-xl",children:"Console Logs"}),A.jsx("div",{className:"flex flex-col gap-2",children:t.map(n=>A.jsxs("div",{className:"bg-primary-500 py-4 pl-4",children:[A.jsx("span",{className:"bg-primary-600 p-2 font-bold",children:n.type.toUpperCase()}),A.jsx("span",{className:"ml-4 font-mono",children:n.msg})]},n.msg))})]})}const nC="application/x-spotlight-console";function iG(){const e=window.crypto.randomUUID();return{name:"console",forwardedContentType:[nC],tabs:({processedEvents:t})=>[{id:"console",title:"Browser Console Logs",notificationCount:{count:t.length},content:sG}],setup:()=>{zh("log",e),zh("warn",e),zh("error",e)},processEvent({data:t}){return{event:JSON.parse(t.toString())}}}}function zh(e,t){const n=window;n.__spotlight||(n.__spotlight={}),n.__spotlight.console||(n.__spotlight.console={});const r=n.__spotlight.console;r[e]||(r[e]=window.console[e]);const s=r[e];window.console[e]=(...i)=>{const a=aG(i);return Ba("event",{contentType:nC,data:JSON.stringify({type:e,args:a,msg:a.join(" "),sessionId:t})}),s.call(window,...i)}}function aG(e){return e.map(t=>t===null?"null":t===void 0?"undefined":typeof t=="string"?t:oG(t))}function oG(e){try{return JSON.stringify(e)}catch{return"[serialization error]"}}var rC={exports:{}},tc={},JE={exports:{}},Jh={},qh={},sC;function Zh(){if(sC)return qh;sC=1;function e(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}e.prototype.clone_empty=function(){var r=new e(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},e.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},e.prototype.has_match=function(r){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(r))return!0;return!1},e.prototype.set_indent=function(r,s){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return this.__items.length===0},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(r){this.__items.push(r);var s=r.lastIndexOf(`
132
+ `;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function TF({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,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const a=await Zm(e.getOptions(),r,i,t,e,Ar());if(!a)return null;a.platform=a.platform||"javascript";const o=e.getSdkMetadata(),{name:l,version:c}=o&&o.sdk||{};return a.sdk={...a.sdk,name:l||"sentry.javascript.unknown",version:c||"0.0.0"},a}async function hF({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const a=pF({recordingData:e,headers:{segment_id:n}}),{urls:o,errorIds:l,traceIds:c,initialTimestamp:u}=r,E=Me(),h=Ze(),R=E&&E.getTransport(),_=E&&E.getDsn();if(!E||!R||!_||!i.sampled)return ls({});const C={type:zx,replay_start_timestamp:u/1e3,timestamp:s/1e3,error_ids:l,trace_ids:c,urls:o,replay_id:t,segment_id:n,replay_type:i.sampled},O=await TF({scope:h,client:E,replayId:t,event:C});if(!O)return E.recordDroppedEvent("event_processor","replay",C),fe&&he.info("An event processor returned `null`, will not send event."),ls({});delete O.sdkProcessingMetadata;const d=fF(O,a,_,E.getOptions().tunnel);let f;try{f=await R.send(d)}catch(p){const I=new Error(hh);try{I.cause=p}catch{}throw I}if(typeof f.statusCode=="number"&&(f.statusCode<200||f.statusCode>=300))throw new YO(f.statusCode);const m=f_({},f);if(d_(m,"replay"))throw new Vh(m);return f}class YO extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Vh extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function VO(e,t={count:0,interval:eU}){const{recordingData:n,onError:r}=e;if(n.length)try{return await hF(e),!0}catch(s){if(s instanceof YO||s instanceof Vh)throw s;if(e_("Replays",{_retryCount:t.count}),r&&r(s),t.count>=tU){const i=new Error(`${hh} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,a)=>{Eo(async()=>{try{await VO(e,t),i(!0)}catch(o){a(o)}},t.interval)})}}const WO="__THROTTLED",AF="__SKIPPED";function SF(e,t,n){const r=new Map,s=o=>{const l=o-n;r.forEach((c,u)=>{u<l&&r.delete(u)})},i=()=>[...r.values()].reduce((o,l)=>o+l,0);let a=!1;return(...o)=>{const l=Math.floor(Date.now()/1e3);if(s(l),i()>=t){const u=a;return a=!0,u?AF:WO}a=!1;const c=r.get(l)||0;return r.set(l,c+1),e(...o)}}class fi{constructor({options:t,recordingOptions:n}){fi.prototype.__init.call(this),fi.prototype.__init2.call(this),fi.prototype.__init3.call(this),fi.prototype.__init4.call(this),fi.prototype.__init5.call(this),fi.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Jx,sessionIdleExpire:qx},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=lF(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=SF((a,o)=>f9(this,a,o),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(nU,r),timeout:r,scrollTimeout:rU,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new C7(this,i)),fe){const a=t._experiments;he.setConfig({captureExceptions:!!a.captureExceptions,traceInternals:!!a.traceInternals})}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){fe&&he.exception(t),this._options.onError&&this._options.onError(t)}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){fe&&he.exception(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",fe&&he.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){fe&&he.info("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){fe&&he.info("Buffering is in progress, call `flush()` to save the replay");return}fe&&he.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Gh({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this._initializeRecording()}startBuffering(){if(this._isEnabled){fe&&he.info("Buffering is in progress, call `flush()` to save the replay");return}fe&&he.infoTick("Starting replay in buffer mode");const t=Gh({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=ds({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:$x}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:uF(this),...cF(),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{fe&&he.info(`Stopping Replay${n?` triggered by ${n}`:""}`),DO(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,l9(this)}catch(r){this.handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),fe&&he.info("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),fe&&he.info("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();fe&&he.info("Converting buffer to session"),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&&Fh(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${Qe.location.pathname}${Qe.location.hash}${Qe.location.search}`,n=`${Qe.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===WO){const s=wr({category:"replay.throttled"});this.addUpdate(()=>!kh(this,{type:S7,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||xt(),n=t&&Yt(t),s=(n&&ke(n).data||{})[Sr];if(!(!n||!s||!["route","custom"].includes(s)))return ke(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=i9({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=Gh({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,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 yO(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{Qe.document.addEventListener("visibilitychange",this._handleVisibilityChange),Qe.addEventListener("blur",this._handleWindowBlur),Qe.addEventListener("focus",this._handleWindowFocus),Qe.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(iF(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=Q7(this)}_removeListeners(){try{Qe.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Qe.removeEventListener("blur",this._handleWindowBlur),Qe.removeEventListener("focus",this._handleWindowFocus),Qe.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}__init(){this._handleVisibilityChange=()=>{Qe.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const t=wr({category:"ui.blur"});this._doChangeToBackgroundTasks(t)}}__init3(){this._handleWindowFocus=()=>{const t=wr({category:"ui.focus"});this._doChangeToForegroundTasks(t)}}__init4(){this._handleKeyboardEvent=t=>{G7(this,t)}}_doChangeToBackgroundTasks(t){!this.session||LO(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()){fe&&he.info("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:Oe.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=Y7(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(YE(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){fe&&he.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await aF(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 i=await this.eventBuffer.finish();await VO({replayId:t,recordingData:i,segmentId:s,eventContext:r,session:this.session,timestamp:n,onError:a=>this.handleException(a)})}catch(n){this.handleException(n),this.stop({reason:"sendReplay"});const r=Me();if(r){const s=n instanceof Vh?"ratelimit_backoff":"send_error";r.recordDroppedEvent(s,"replay")}}}__init5(){this._flush=async({force:t=!1}={})=>{if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){fe&&he.error("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 i=s<this._options.minReplayDuration,a=s>this._options.maxReplayDuration+5e3;if(i||a){fe&&he.info(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const o=this.eventBuffer;o&&this.session.segmentId===0&&!o.hasCheckout&&fe&&he.info("Flushing initial segment without checkout.");const l=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(c){this.handleException(c)}finally{this._flushLock=void 0,l&&this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Uh(this.session)}__init6(){this._onMutationHandler=t=>{const n=t.length,r=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=r&&n>r;if(n>s||i){const a=wr({category:"replay.mutations",data:{count:n,limit:i}});this._createCustomBreadcrumb(a)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function ec(e,t){return[...e,...t].join(",")}function RF({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],a=ec(e,[".sentry-mask","[data-sentry-mask]"]),o=ec(t,[]);return{maskTextSelector:a,unmaskTextSelector:o,blockSelector:ec(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:ec(r,[]),ignoreSelector:ec(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function mF({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const jO='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',_F=["content-length","content-type","accept"];let XO=!1;const NF=e=>new XE(e);class XE{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:t=Zx,flushMaxDelay:n=Qx,minReplayDuration:r=sU,maxReplayDuration:s=DI,stickySession:i=!0,useCompression:a=!0,workerUrl:o,_experiments:l={},maskAllText:c=!0,maskAllInputs:u=!0,blockAllMedia:E=!0,mutationBreadcrumbLimit:h=750,mutationLimit:R=1e4,slowClickTimeout:_=7e3,slowClickIgnoreSelectors:C=[],networkDetailAllowUrls:O=[],networkDetailDenyUrls:d=[],networkCaptureBodies:f=!0,networkRequestHeaders:m=[],networkResponseHeaders:p=[],mask:I=[],maskAttributes:T=["title","placeholder"],unmask:N=[],block:g=[],unblock:P=[],ignore:S=[],maskFn:b,beforeAddRecordingEvent:w,beforeErrorSampling:k,onError:B}={}){this.name=XE.id;const Y=RF({mask:I,unmask:N,block:g,unblock:P,ignore:S});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:b,maskInputFn:b,maskAttributeFn:(H,F,x)=>mF({maskAttributes:T,maskAllText:c,privacyOptions:Y,key:H,value:F,el:x}),...Y,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:H=>{try{H.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,iU),maxReplayDuration:Math.min(s,DI),stickySession:i,useCompression:a,workerUrl:o,blockAllMedia:E,maskAllInputs:u,maskAllText:c,mutationBreadcrumbLimit:h,mutationLimit:R,slowClickTimeout:_,slowClickIgnoreSelectors:C,networkDetailAllowUrls:O,networkDetailDenyUrls:d,networkCaptureBodies:f,networkRequestHeaders:KO(m),networkResponseHeaders:KO(p),beforeAddRecordingEvent:w,beforeErrorSampling:k,onError:B,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${jO}`:jO),this._isInitialized&&M_())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return XO}set _isInitialized(t){XO=t}afterAllSetup(t){!M_()||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()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}getRecordingMode(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=IF(this._initialOptions,t);this._replay=new fi({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}XE.__initStatic();function IF(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...Lt(e)},s=eE(n.replaysSessionSampleRate),i=eE(n.replaysOnErrorSampleRate);return s==null&&i==null&&Xs(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function KO(e){return[..._F,...e.map(t=>t.toLowerCase())]}const zO=new WeakMap,Wh=new Map,KE={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function OF(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:a,tracePropagationTargets:o}={traceFetch:KE.traceFetch,traceXHR:KE.traceXHR,trackFetchStreamPerformance:KE.trackFetchStreamPerformance,...t},l=typeof i=="function"?i:E=>!0,c=E=>yF(E,o),u={};n&&(e.addEventProcessor(E=>(E.type==="transaction"&&E.spans&&E.spans.forEach(h=>{if(h.op==="http.client"){const R=Wh.get(h.span_id);R&&(h.timestamp=R/1e3,Wh.delete(h.span_id))}}),E)),s&&kb(E=>{if(E.response){const h=zO.get(E.response);h&&E.endTimestamp&&Wh.set(h,E.endTimestamp)}}),y_(E=>{const h=Pb(E,l,c,u);if(E.response&&E.fetchData.__span&&zO.set(E.response,E.fetchData.__span),h){const R=qO(E.fetchData.url),_=R?ji(R).host:void 0;h.setAttributes({"http.url":R,"server.address":_})}a&&h&&JO(h)})),r&&gI(E=>{const h=vF(E,l,c,u);a&&h&&JO(h)})}function CF(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function JO(e){const{url:t}=ke(e).data||{};if(!t||typeof t!="string")return;const n=co("resource",({entries:r})=>{r.forEach(s=>{CF(s)&&s.name.endsWith(t)&&(LF(s).forEach(a=>e.setAttribute(...a)),setTimeout(n))})})}function gF(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function xr(e=0){return((pn||performance.timeOrigin)+e)/1e3}function LF(e){const{name:t,version:n}=gF(e.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",t]),pn?[...r,["http.request.redirect_start",xr(e.redirectStart)],["http.request.fetch_start",xr(e.fetchStart)],["http.request.domain_lookup_start",xr(e.domainLookupStart)],["http.request.domain_lookup_end",xr(e.domainLookupEnd)],["http.request.connect_start",xr(e.connectStart)],["http.request.secure_connection_start",xr(e.secureConnectionStart)],["http.request.connection_end",xr(e.connectEnd)],["http.request.request_start",xr(e.requestStart)],["http.request.response_start",xr(e.responseStart)],["http.request.response_end",xr(e.responseEnd)]]:r}function yF(e,t){const n=Te.location&&Te.location.href;if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Js(r.toString(),t)||i&&Js(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Js(e,t):r}}function vF(e,t,n,r){const s=e.xhr,i=s&&s[ta];if(!s||s.__sentry_own_request__||!i)return;const a=ei()&&t(i.url);if(e.endTimestamp&&a){const E=s.__sentry_xhr_span_id__;if(!E)return;const h=r[E];h&&i.status_code!==void 0&&(Tm(h,i.status_code),h.end(),delete r[E]);return}const o=qO(i.url),l=o?ji(o).host:void 0,c=!!xt(),u=a&&c?bl({name:`${i.method} ${i.url}`,attributes:{type:"xhr","http.method":i.method,"http.url":o,url:i.url,"server.address":l,[yt]:"auto.http.browser",[$s]:"http.client"}}):new Ja;return s.__sentry_xhr_span_id__=u.spanContext().spanId,r[s.__sentry_xhr_span_id__]=u,n(i.url)&&bF(s,ei()&&c?u:void 0),u}function bF(e,t){const{"sentry-trace":n,baggage:r}=A_({span:t});n&&MF(e,n,r)}function MF(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader("baggage",n)}catch{}}function qO(e){try{return new URL(e,Te.location.origin).href}catch{return}}function PF(){Te&&Te.document?Te.document.addEventListener("visibilitychange",()=>{const e=xt();if(!e)return;const t=Yt(e);if(Te.document.hidden&&t){const n="cancelled",{op:r,status:s}=ke(t);_r&&ne.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:wt,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):_r&&ne.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const DF="BrowserTracing",wF={...nE,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...KE},xF=(e={})=>{F5();const{enableInp:t,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:s,enableStandaloneClsSpans:i},beforeStartSpan:a,idleTimeout:o,finalTimeout:l,childSpanTimeout:c,markBackgroundSpan:u,traceFetch:E,traceXHR:h,trackFetchStreamPerformance:R,shouldCreateSpanForRequest:_,enableHTTPTimings:C,instrumentPageLoad:O,instrumentNavigation:d}={...wF,...e},f=P8({recordClsStandaloneSpans:i||!1});t&&rx(),r&&Le.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?w8():n&&D8(),s&&x8();const m={name:void 0,source:void 0};function p(I,T){const N=T.op==="pageload",g=a?a(T):T,P=g.attributes||{};T.name!==g.name&&(P[Sr]="custom",g.attributes=P),m.name=g.name,m.source=P[Sr];const S=zm(g,{idleTimeout:o,finalTimeout:l,childSpanTimeout:c,disableAutoFinish:N,beforeSpanEnd:w=>{f(),B8(w,{recordClsOnPageloadSpan:!i})}});function b(){["interactive","complete"].includes(Te.document.readyState)&&I.emit("idleSpanEnableAutoFinish",S)}return N&&Te.document&&(Te.document.addEventListener("readystatechange",()=>{b()}),b()),S}return{name:DF,afterAllSetup(I){let T,N=Te.location&&Te.location.href;function g(){T&&!ke(T).timestamp&&(_r&&ne.log(`[Tracing] Finishing current active span with op: ${ke(T).op}`),T.end())}I.on("startNavigationSpan",P=>{Me()===I&&(g(),T=p(I,{op:"navigation",...P}))}),I.on("startPageLoadSpan",(P,S={})=>{if(Me()!==I)return;g();const b=S.sentryTrace||ZO("sentry-trace"),w=S.baggage||ZO("baggage"),k=b5(b,w);Ze().setPropagationContext(k),T=p(I,{op:"pageload",...P})}),I.on("spanEnd",P=>{const S=ke(P).op;if(P!==Yt(P)||S!=="navigation"&&S!=="pageload")return;const b=Ze(),w=b.getPropagationContext();b.setPropagationContext({...w,sampled:w.sampled!==void 0?w.sampled:Hi(P),dsc:w.dsc||Vi(P)})}),Te.location&&(O&&jh(I,{name:Te.location.pathname,startTime:pn?pn/1e3:void 0,attributes:{[Sr]:"url",[yt]:"auto.pageload.browser"}}),d&&NE(({to:P,from:S})=>{if(S===void 0&&N&&N.indexOf(P)!==-1){N=void 0;return}S!==P&&(N=void 0,UF(I,{name:Te.location.pathname,attributes:{[Sr]:"url",[yt]:"auto.navigation.browser"}}))})),u&&PF(),s&&FF(o,l,c,m),t&&ix(),OF(I,{traceFetch:E,traceXHR:h,trackFetchStreamPerformance:R,tracePropagationTargets:I.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:C})}}};function jh(e,t,n){e.emit("startPageLoadSpan",t,n),Ze().setTransactionName(t.name);const r=xt();return(r&&ke(r).op)==="pageload"?r:void 0}function UF(e,t){Ar().setPropagationContext({traceId:Zs()}),Ze().setPropagationContext({traceId:Zs()}),e.emit("startNavigationSpan",t),Ze().setTransactionName(t.name);const n=xt();return(n&&ke(n).op)==="navigation"?n:void 0}function ZO(e){const t=n5(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}function FF(e,t,n,r){let s;const i=()=>{const a="ui.action.click",o=xt(),l=o&&Yt(o);if(l){const c=ke(l).op;if(["navigation","pageload"].includes(c)){_r&&ne.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(AT,"interactionInterrupted"),s.end(),s=void 0),!r.name){_r&&ne.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}s=zm({name:r.name,op:a,attributes:{[Sr]:r.source||"url"}},{idleTimeout:e,finalTimeout:t,childSpanTimeout:n})};Te.document&&addEventListener("click",i,{once:!1,capture:!0})}function No(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function GF(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=No(n);return s=>r.then(i=>s(i.transaction(t,"readwrite").objectStore(t)))}function Xh(e){return No(e.getAllKeys())}function kF(e,t,n){return e(r=>Xh(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.max(...s,0)+1),No(r.transaction)}))}function BF(e,t,n){return e(r=>Xh(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.min(...s,0)-1),No(r.transaction)}))}function HF(e){return e(t=>Xh(t).then(n=>{const r=n[0];if(r!=null)return No(t.get(r)).then(s=>(t.delete(r),No(t.transaction).then(()=>s)))}))}function YF(e){let t;function n(){return t==null&&(t=GF(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const s=await vl(r);await kF(n(),s,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const s=await vl(r);await BF(n(),s,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await HF(n());if(r)return t3(r)}catch{}}}}function VF(e){return t=>{const n=e({...t,createStore:YF});return Te.addEventListener("online",async r=>{await n.flush()}),n}}function WF(e=fh){return VF(nb(e))}const jF="SpotlightBrowser",XF=(e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:jF,setup:()=>{_r&&ne.log("Using Sidecar URL",t)},processEvent:n=>zF(n)?null:n,afterAllSetup:n=>{KF(n,t)}}};function KF(e,t){const n=Eh("fetch");let r=0;e.on("beforeEnvelope",s=>{if(r>3){ne.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:vl(s),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,ne.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}const QO=XF;function zF(e){return!!(e.type==="transaction"&&e.spans&&e.contexts&&e.contexts.trace&&e.contexts.trace.op==="ui.action.click"&&e.spans.some(({description:t})=>t&&t.includes("#sentry-spotlight")))}const JF="application/x-sentry-envelope";function $O(e={}){return{name:"sentry",forwardedContentType:[JF],setup:({open:t,sidecarUrl:n})=>{e.retries==null&&(e.retries=10);let r;n&&(r=H1(n,"/stream"),nt.setSidecarUrl(r)),Ge("Setting up Sentry integration for Spotlight"),eC(e,r&&new URL("/stream",r).href),e.openLastError&&nt.subscribe("event",i=>{i.exception&&setTimeout(()=>t(`/errors/${i.event_id}`),0)});const s=i=>{Ge("Sentry Event",i.detail.event_id),i.detail.event&&nt.pushEvent(i.detail.event).then(()=>t(`/errors/${i.detail.event.event_id}`))};return Ol("sentry:showError",s),()=>{b1("sentry:showError",s)}},processEvent:t=>ZF(t),tabs:()=>{const t=nt.getEvents().filter(n=>{var r,s,i,a;return n.type!=="transaction"&&((s=(r=n.contexts)==null?void 0:r.trace)!=null&&s.trace_id?nt.isTraceLocal((a=(i=n.contexts)==null?void 0:i.trace)==null?void 0:a.trace_id):null)!==!1}).length;return[{id:"errors",title:"Errors",notificationCount:{count:t,severe:t>0},content:qM},{id:"explore",title:"Explore",content:aw},{id:"insights",title:"Insights",content:yw},{id:"performance",title:"Performance",content:Pw}]},reset:()=>{nt.resetData()}}}function qF(e){let t=e.indexOf(10);return t===-1&&(t=e.length),t}function Kh(e){return JSON.parse(new TextDecoder().decode(e))}function ZF(e){let t=typeof e.data=="string"?Uint8Array.from(e.data,a=>a.charCodeAt(0)):e.data;function n(a){const o=a??qF(t),l=t.subarray(0,o);return t=t.subarray(o+1),l}const r=Kh(n()),s=[];for(;t.length;){const a=Kh(n()),o=a.length,l=n(o);let c;try{c=Kh(l),a.type&&(c.type=a.type)}catch(u){c=l,Ge(u)}s.push([a,c])}const i=[r,s];return nt.pushEnvelope({envelope:i,rawEnvelope:e}),{event:i,rawEvent:e}}function eC(e,t){if(e.injectIntoSDK===!1)return;const n=window.__SENTRY__,r=n&&QF(n);if(!r){Ge("Couldn't find a Sentry SDK client. Make sure you're using a Sentry SDK with version >=7.99.0 or 8.x"),e.retries&&(Ge(`Will retry ${e.retries} more time(s) at 100ms intervals...`),e.retries--,setTimeout(()=>{eC(e,t)},500));return}if(!r.getDsn()){Ge("Sentry SDK doesn't have a valid DSN. Enabling SDK integrations for just Spotlight.");try{const s=r.getOptions().integrations;for(const i of s)r.addIntegration(i)}catch(s){G1("Failed to enable all SDK integrations for Spotlight",s),Ge("Please open an issue with the error at: https://github.com/getsentry/spotlight/issues/new/choose")}}r._dsn=void 0,r._options.tracesSampler=()=>1,r._options.sampleRate=1;try{const s=Object.keys(r._integrations).find(i=>/spotlight/i.test(i));if(s){Ge(`Skipping adding integration as there's already a Spotlight integration enabled in Sentry SDK: ${s}`);return}r.addIntegration(Jb()),r.addIntegration(QO({sidecarUrl:t}))}catch(s){G1("Failed to add Spotlight integration to Sentry",s),Ge("Please open an issue with the error at: https://github.com/getsentry/spotlight/issues/new/choose")}Ge("Added Spotlight integration to Sentry SDK")}function QF(e){var t,n,r;if(e.version){const s=e[e.version],i=typeof((t=s==null?void 0:s.stack)==null?void 0:t.getScope)=="function"?(r=(n=s==null?void 0:s.stack)==null?void 0:n.getScope)==null?void 0:r.call(n):void 0;if(typeof(i==null?void 0:i.getClient)=="function")return i.getClient()}if(e.hub){const s=e.hub;if(typeof s.getClient=="function")return s.getClient()}}var zE={},tC=fy;zE.createRoot=tC.createRoot,zE.hydrateRoot=tC.hydrateRoot;function $F(e){const t={...e};return h_(t,"react"),e_("react",{version:y.version}),Kx(t)}const eG=new WeakSet;function tG(e,t){const n=xF({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:s,useNavigationType:i,createRoutesFromChildren:a,matchRoutes:o,stripBasename:l,instrumentPageLoad:c=!0,instrumentNavigation:u=!0}=e;return{...n,setup(){},afterAllSetup(E){n.afterAllSetup(E);const h=Te&&Te.location&&Te.location.pathname;c&&h&&jh(E,{name:h,attributes:{[Sr]:"url",[$s]:"pageload",[yt]:`auto.pageload.react.reactrouter_v${t}`}}),u&&eG.add(E)}}}function nG(e){return tG(e,"6")}function rG(e,t={}){const n={},r=performance.getEntriesByType("navigation");if(r.length>0){const l=r[0].serverTiming;if(l&&l.length>0)for(const{name:c,description:u}of l)(c==="sentryTrace"||c==="baggage")&&(n[c]=u)}const s=Object.keys(n).length===2,i=[nG({instrumentPageLoad:!s,useEffect:y.useEffect,useLocation:Vs,useNavigationType:ky,createRoutesFromChildren:Uu,matchRoutes:f1}),NF()],a=document.location.hash.slice(1);if(a.startsWith("spotlight")){const l=a.indexOf("="),c=l>-1?decodeURIComponent(a.slice(l+1)):void 0;i.push(QO({sidecarUrl:c}))}const o=$F({transport:WF(fh),dsn:"https://51bcd92dba1128934afd1c5726c84442@o1.ingest.us.sentry.io/4508404727283713",environment:"production",release:"spotlight@2.11.1",integrations:i,tracesSampleRate:1,tracePropagationTargets:[/^\//,document.location.origin],replaysSessionSampleRate:.01,replaysOnErrorSampleRate:1,...t});s&&o&&jh(o,{name:e},n)}function sG({processedEvents:e}){const t=e||[];return A.jsxs("div",{className:"divide-primary-900 bg-primary-950 divide-y p-4",children:[A.jsx("h1",{className:"mb-2 text-xl",children:"Console Logs"}),A.jsx("div",{className:"flex flex-col gap-2",children:t.map(n=>A.jsxs("div",{className:"bg-primary-500 py-4 pl-4",children:[A.jsx("span",{className:"bg-primary-600 p-2 font-bold",children:n.type.toUpperCase()}),A.jsx("span",{className:"ml-4 font-mono",children:n.msg})]},n.msg))})]})}const nC="application/x-spotlight-console";function iG(){const e=window.crypto.randomUUID();return{name:"console",forwardedContentType:[nC],tabs:({processedEvents:t})=>[{id:"console",title:"Browser Console Logs",notificationCount:{count:t.length},content:sG}],setup:()=>{zh("log",e),zh("warn",e),zh("error",e)},processEvent({data:t}){return{event:JSON.parse(t.toString())}}}}function zh(e,t){const n=window;n.__spotlight||(n.__spotlight={}),n.__spotlight.console||(n.__spotlight.console={});const r=n.__spotlight.console;r[e]||(r[e]=window.console[e]);const s=r[e];window.console[e]=(...i)=>{const a=aG(i);return Ba("event",{contentType:nC,data:JSON.stringify({type:e,args:a,msg:a.join(" "),sessionId:t})}),s.call(window,...i)}}function aG(e){return e.map(t=>t===null?"null":t===void 0?"undefined":typeof t=="string"?t:oG(t))}function oG(e){try{return JSON.stringify(e)}catch{return"[serialization error]"}}var rC={exports:{}},tc={},JE={exports:{}},Jh={},qh={},sC;function Zh(){if(sC)return qh;sC=1;function e(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}e.prototype.clone_empty=function(){var r=new e(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},e.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},e.prototype.has_match=function(r){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(r))return!0;return!1},e.prototype.set_indent=function(r,s){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return this.__items.length===0},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(r){this.__items.push(r);var s=r.lastIndexOf(`
133
133
  `);s!==-1?this.__character_count=r.length-s:this.__character_count+=r.length},e.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function t(r,s){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),s=s||"",r.indent_level>0&&(s=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}t.prototype.get_indent_size=function(r,s){var i=this.__base_string_length;return s=s||0,r<0&&(i=0),i+=r*this.__indent_size,i+=s,i},t.prototype.get_indent_string=function(r,s){var i=this.__base_string;return s=s||0,r<0&&(r=0,i=""),s+=r*this.__indent_size,this.__ensure_cache(s),i+=this.__cache[s],i},t.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var r=this.__cache.length,s=0,i="";this.__indent_size&&r>=this.__indent_size&&(s=Math.floor(r/this.__indent_size),r-=s*this.__indent_size,i=new Array(s+1).join(this.__indent_string)),r&&(i+=new Array(r+1).join(" ")),this.__cache.push(i)};function n(r,s){this.__indent_cache=new t(r,s),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(r,s){return this.__indent_cache.get_indent_string(r,s)},n.prototype.get_indent_size=function(r,s){return this.__indent_cache.get_indent_size(r,s)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(r){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
134
134
  `&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
135
135
  `);return r!==`