haiku-atelier-2024/web/app/themes/haiku-atelier-2024/assets/js/gaffe-legacy.js
gcch a4094da86a 2025-11-03 (bis)
- ajoute un .dockerignore.
- ajoute un Dockerfile.
- met à jour les dépendances.
- utilise bun comme gestionnaire de paquets npm.
- utilise une configuration Vite en TypeScript.
- ajoute les fichiers compilés JavaScript aux fichiers pris en charge par Git.
2025-11-03 17:22:29 +01:00

1 line
43 KiB
JavaScript

System.register(["./api-legacy.BVjX3txO.js","./exports-legacy.BuhD0gYd.js"],function(e,t){"use strict";var n,r,s,o,i,a,c,u,d,l,p,f,h,m,g,y,_,v,E,b,w,k,S,x,T,$,R,O,P,C,D,L,q,M,N,j,A,H,I,U,B,F,W,X,z,G,Y,J,K,V,Q,Z,ee,te,ne,re,se,oe,ie,ae,ce,ue,de,le,pe,fe,he;return{setters:[e=>{n=e.E,r=e.a},e=>{s=e.D,o=e.d,i=e.g,a=e.G,c=e.i,u=e.a,d=e.b,l=e.n,p=e.c,f=e.e,h=e.S,m=e.f,g=e.m,y=e.u,_=e.h,v=e.j,E=e.k,b=e.l,w=e.p,k=e.o,S=e.q,x=e.r,T=e.s,$=e.t,R=e.v,O=e.w,P=e.x,C=e.y,D=e.z,L=e.A,q=e.B,M=e.C,N=e.E,j=e.F,A=e.H,H=e.I,I=e.J,U=e.K,B=e.L,F=e.M,W=e.N,X=e.O,z=e.P,G=e.Q,Y=e.R,J=e.T,K=e.U,V=e.V,Q=e.W,Z=e.X,ee=e.Y,te=e.Z,ne=e._,re=e.$,se=e.a0,oe=e.a1,ie=e.a2,ae=e.a3,ce=e.a4,ue=e.a5,de=e.a6,le=e.a7,pe=e.a8,fe=e.a9,he=e.aa}],execute:function(){const e={},t={};function me(t,n){e[t]=e[t]||[],e[t].push(n)}function ge(e,n){if(!t[e]){t[e]=!0;try{n()}catch(r){s&&o.error(`Error while instrumenting ${e}`,r)}}}function ye(t,n){const r=t&&e[t];if(r)for(const e of r)try{e(n)}catch(a){s&&o.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${i(e)}\nError:`,a)}}let _e=null;function ve(){_e=a.onerror,a.onerror=function(e,t,n,r,s){return ye("error",{column:r,error:s,line:n,msg:e,url:t}),!!_e&&_e.apply(this,arguments)},a.onerror.__SENTRY_INSTRUMENTED__=!0}let Ee=null;function be(){Ee=a.onunhandledrejection,a.onunhandledrejection=function(e){return ye("unhandledrejection",e),!Ee||Ee.apply(this,arguments)},a.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function we(e){o.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function ke(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(xe(n)){if(c(e.description,n))return s&&we(e),!0;continue}if(!n.name&&!n.op)continue;const t=!n.name||c(e.description,n.name),r=!n.op||e.op&&c(e.op,n.op);if(t&&r)return s&&we(e),!0}return!1}function Se(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const s of e)s.parent_span_id===r&&(s.parent_span_id=n)}function xe(e){return"string"==typeof e||e instanceof RegExp}function Te(e,t=[]){return[e,t]}function $e(e,t){const[n,r]=e;return[n,[...r,t]]}function Re(e,t){const n=e[1];for(const r of n)if(t(r,r[0].type))return!0;return!1}function Oe(e){const t=d(a);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function Pe(e){const[t,n]=e;let r=JSON.stringify(t);function s(e){"string"==typeof r?r="string"==typeof e?r+e:[Oe(r),e]:r.push("string"==typeof e?Oe(e):e)}for(const o of n){const[e,t]=o;if(s(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)s(t);else{let e;try{e=JSON.stringify(t)}catch{e=JSON.stringify(l(t))}s(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}(r)}function Ce(e){const t="string"==typeof e.data?Oe(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const De={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function Le(e){return De[e]}function qe(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Me(e,t,n,r){const s=qe(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){if(!t)return e;const n=e.sdk||{};e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0}}(e,n?.sdk);const i=function(e,t,n,r){const s=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:u(r)},...s&&{trace:s}}}(e,s,r,t);return delete e.sdkProcessingMetadata,Te(i,[[{type:o},e]])}function Ne(e,t,n){return t||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`}const je=[];function Ae(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function He(e,t,n){if(n[t.name])s&&o.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===je.indexOf(t.name)&&"function"==typeof t.setupOnce&&(t.setupOnce(),je.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}s&&o.log(`Integration installed: ${t.name}`)}}function Ie(e,t){const n=t??function(e){return Ue().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=u(r)),Te(s,[(o=e,[{type:"log",item_count:o.length,content_type:"application/vnd.sentry.items.log+json"},{items:o}])]);var o}(n,r._metadata,r.tunnel,e.getDsn());Ue().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function Ue(){return p("clientToLogBufferMap",()=>new WeakMap)}function Be(e,t){const n=t??function(e){return Fe().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=u(r)),Te(s,[(o=e,[{type:"trace_metric",item_count:o.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:o}])]);var o}(n,r._metadata,r.tunnel,e.getDsn());Fe().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Fe(){return p("clientToMetricBufferMap",()=>new WeakMap)}const We="Not capturing exception because it's already been captured.",Xe="Discarded session because of missing or non-string release",ze=Symbol.for("SentryInternalError"),Ge=Symbol.for("SentryDoNotSendEventError");function Ye(e){return{message:e,[ze]:!0}}function Je(e){return{message:e,[Ge]:!0}}function Ke(e){return!!e&&"object"==typeof e&&ze in e}function Ve(e){return!!e&&"object"==typeof e&&Ge in e}function Qe(e,t,n,r,s){let o,i=0;e.on(n,()=>{i=0,clearTimeout(o)}),e.on(t,t=>{i+=r(t),i>=8e5?s(e):(clearTimeout(o),o=setTimeout(()=>{s(e)},5e3))}),e.on("flush",()=>{s(e)})}class Ze{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=g(e.dsn):s&&o.warn("No DSN provided, client will not send events."),this._dsn){const t=Ne(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs&&Qe(this,"afterCaptureLog","flushLogs",rt,Ie),this._options._experiments?.enableMetrics&&Qe(this,"afterCaptureMetric","flushMetrics",nt,Be)}captureException(e,t,n){const r=y();if(_(e))return s&&o.log(We),r;const i={event_id:r,...t};return this._process(this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n))),i.event_id}captureMessage(e,t,n,r){const s={event_id:y(),...n},o=R(e)?e:String(e),i=v(e)?this.eventFromMessage(o,t,s):this.eventFromException(e,s);return this._process(i.then(e=>this._captureEvent(e,s,r))),s.event_id}captureEvent(e,t,n){const r=y();if(t?.originalException&&_(t.originalException))return s&&o.log(We),r;const i={event_id:r,...t},a=e.sdkProcessingMetadata||{},c=a.capturedSpanScope,u=a.capturedSpanIsolationScope;return this._process(this._captureEvent(e,i,c||n,u)),i.event_id}captureSession(e){this.sendSession(e),E(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(!t)return!0;this.emit("flush");const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];He(this,e,this._integrations),t||Ae(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=Me(e,this._dsn,this._options._metadata,this._options.tunnel);for(const r of t.attachments||[])n=$e(n,Ce(r));this.sendEnvelope(n).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=b}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(s&&o.warn(Xe));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(s&&o.warn(Xe));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const s=qe(n);return Te({sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:u(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;s&&o.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(t){return s&&o.error("Error while sending envelope:",t),{}}return s&&o.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t&&He(e,t,n)}),n}(this,e),Ae(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const s=t.exception?.values;if(s){r=!0;for(const e of s){const t=e.mechanism;if(!1===t?.handled){n=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&n)&&(E(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const s=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o?.length&&(t.integrations=o),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),w(s,e,t,n,this,r).then(e=>{if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:k(n),...e.contexts};const r=S(this,n);return e.sdkProcessingMetadata={dynamicSamplingContext:r,...e.sdkProcessingMetadata},e})}_captureEvent(e,t={},n=x(),r=T()){return s&&et(e)&&o.log(`Captured error event \`${function(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{s&&(Ve(e)?o.log(e.message):Ke(e)?o.warn(e.message):o.warn(e))})}_processEvent(e,t,n,r){const s=this.getOptions(),{sampleRate:o}=s,i=tt(e),a=et(e),c=e.type||"error",u=`before send for type \`${c}\``,d=void 0===o?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}(o);if(a&&"number"==typeof d&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error"),$(Je(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const l="replay_event"===c?"replay":c;return this._prepareEvent(e,t,n,r).then(e=>{if(null===e)throw this.recordDroppedEvent("event_processor",l),Je("An event processor returned `null`, will not send event.");if(t.data&&!0===t.data.__sentry__)return e;const n=function(e,t,n,r){const{beforeSend:s,beforeSendTransaction:o,beforeSendSpan:i,ignoreSpans:a}=t;let c=n;if(et(c)&&s)return s(c,r);if(tt(c)){if(i||a){const t=function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:o,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:o,profile_id:i?.[m],exclusive_time:i?.[h],measurements:e.measurements,is_segment:!0}}(c);if(a?.length&&ke(t,a))return null;if(i){const e=i(t);e?c=P(n,{type:"transaction",timestamp:(u=e).timestamp,start_timestamp:u.start_timestamp,transaction:u.description,contexts:{trace:{trace_id:u.trace_id,span_id:u.span_id,parent_span_id:u.parent_span_id,op:u.op,status:u.status,origin:u.origin,data:{...u.data,...u.profile_id&&{[m]:u.profile_id},...u.exclusive_time&&{[h]:u.exclusive_time}}}},measurements:u.measurements}):O()}if(c.spans){const t=[],n=c.spans;for(const e of n)if(a?.length&&ke(e,a))Se(n,e);else if(i){const n=i(e);n?t.push(n):(O(),t.push(e))}else t.push(e);const r=c.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),c.spans=t}}if(o){if(c.spans){const e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return o(c,r)}}var u;return c}(this,s,e,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(C(e))return e.then(e=>{if(!D(e)&&null!==e)throw Ye(n);return e},e=>{throw Ye(`${t} rejected with ${e}`)});if(!D(e)&&null!==e)throw Ye(n);return e}(n,u)}).then(s=>{if(null===s){if(this.recordDroppedEvent("before_send",l),i){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw Je(`${u} returned \`null\`, will not send event.`)}const o=n.getSession()||r.getSession();if(a&&o&&this._updateSessionFromEvent(o,s),i){const e=(s.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(s.spans?s.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const c=s.transaction_info;if(i&&c&&s.transaction!==e.transaction){const e="custom";s.transaction_info={...c,source:e}}return this.sendEvent(s,t),s}).then(null,e=>{if(Ve(e)||Ke(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),Ye(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){s&&o.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(s&&o.log("No outcomes to send"));if(!this._dsn)return void(s&&o.log("No dsn provided, will not send outcomes"));s&&o.log("Sending outcomes:",e);const t=(n=e,Te((r=this._options.tunnel&&u(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:f(),discarded_events:n}]]));var n,r;this.sendEnvelope(t)}}function et(e){return void 0===e.type}function tt(e){return"transaction"===e.type}function nt(e){let t=0;return e.name&&(t+=2*e.name.length),"string"==typeof e.value?t+=2*e.value.length:t+=8,t+st(e.attributes)}function rt(e){let t=0;return e.message&&(t+=2*e.message.length),t+st(e.attributes)}function st(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*ot(e[0]):v(e)?t+=ot(e):t+=100}),t}function ot(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}const it=Symbol.for("SentryBufferFullError");function at(e=100){const t=new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return $(it);const s=r();return t.add(s),s.then(()=>n(s),()=>n(s)),s},drain:function(e){if(!t.size)return L(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>setTimeout(()=>t(!1),e))];return Promise.race(r)}}}function ct(e,{statusCode:t,headers:n},r=Date.now()){const s={...e},o=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(o)for(const a of o.trim().split(",")){const[e,t,,,n]=a.split(":",5),o=parseInt(e,10),i=1e3*(isNaN(o)?60:o);if(t)for(const a of t.split(";"))"metric_bucket"===a&&n&&!n.split(";").includes("custom")||(s[a]=r+i);else s.all=r+i}else i?s.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(i,r):429===t&&(s.all=r+6e4);return s}function ut(e,t,n=at(e.bufferSize||64)){let r={};return{send:function(i){const a=[];if(Re(i,(t,n)=>{const s=Le(n);!function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,s)?a.push(t):e.recordDroppedEvent("ratelimit_backoff",s)}),0===a.length)return Promise.resolve({});const c=Te(i[0],a),u=t=>{Re(c,(n,r)=>{e.recordDroppedEvent(t,Le(r))})};return n.add(()=>t({body:Pe(c)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&s&&o.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=ct(r,e),e),e=>{throw u("network_error"),s&&o.error("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===it)return s&&o.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}function dt(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function lt(e,t){const n=t?.getDsn(),r=t?.getOptions().tunnel;return function(e,t){const n=function(e){const t=e.indexOf("://")<=0&&0!==e.indexOf("//"),n=t?"thismessage:/":void 0;try{if("canParse"in URL&&!URL.canParse(e,n))return;const r=new URL(e,n);return t?{isRelative:t,pathname:r.pathname,search:r.search,hash:r.hash}:r}catch{}}(e);return!(!n||function(e){return"isRelative"in e}(n))&&(!!t&&n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search))}(e,n)||function(e,t){return!!t&&pt(e)===pt(t)}(e,r)}function pt(e){return"/"===e[e.length-1]?e.slice(0,-1):e}function ft(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}const ht=100;function mt(e,t){const n=M(),r=T();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=ht}=n.getOptions();if(o<=0)return;const i={timestamp:f(),...e},a=s?N(()=>s(i,t)):i;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,o))}let gt;const yt=new WeakMap,_t=()=>({name:"FunctionToString",setupOnce(){gt=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=j(this),n=yt.has(M())&&void 0!==t?t:this;return gt.apply(n,e)}}catch{}},setup(e){yt.set(e,!0)}});function vt(e,t,n,r,s,o){if(!s.exception?.values||!o||!A(o.originalException,Error))return;const i=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;i&&(s.exception.values=Et(e,t,r,o.originalException,n,s.exception.values,i,0))}function Et(e,t,n,r,s,o,i,a){if(o.length>=n+1)return o;let c=[...o];if(A(r[s],Error)){bt(i,a);const o=e(t,r[s]),u=c.length;wt(o,s,u,a),c=Et(e,t,n,r[s],s,[o,...c],o,u)}return Array.isArray(r.errors)&&r.errors.forEach((r,o)=>{if(A(r,Error)){bt(i,a);const u=e(t,r),d=c.length;wt(u,`errors[${o}]`,d,a),c=Et(e,t,n,r,s,[u,...c],u,d)}}),c}function bt(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function wt(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function kt(e){const t="console";me(t,e),ge(t,St)}function St(){"console"in a&&H.forEach(function(e){e in a.console&&I(a.console,e,function(t){return U[e]=t,function(...t){ye("console",{args:t,level:e});const n=U[e];n?.apply(a.console,t)}})})}function xt(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Tt=(e={})=>{const t=e.levels||H,n=e.handled??!0;return{name:"CaptureConsole",setup(e){"console"in a&&kt(({args:r,level:s})=>{M()===e&&t.includes(s)&&function(e,t,n){const r={level:xt(t),extra:{arguments:e}};B(s=>{if(s.addEventProcessor(e=>(e.logger="console",F(e,{handled:n,type:"auto.core.capture_console"}),e)),"assert"===t){if(!e[0]){const t=`Assertion failed: ${W(e.slice(1)," ")||"console.assert"}`;s.setExtra("arguments",e.slice(1)),X(t,r)}return}const o=e.find(e=>e instanceof Error);if(o)return void z(o,r);const i=W(e," ");X(i,r)})}(r,s,n)})}}},$t=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!Ot(e,t)&&!!Rt(e,t))))}(e,t)||!!function(e,t){const n=Pt(t),r=Pt(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!Ot(e,t)&&!!Rt(e,t)))}(e,t))}(t,e))return s&&o.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function Rt(e,t){let n=G(e),r=G(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++){const e=r[s],t=n[s];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function Ot(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function Pt(e){return e.exception?.values?.[0]}function Ct(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const Dt=a;function Lt(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function qt(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in Dt))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(Lt(Dt.fetch))return!0;let e=!1;const t=Dt.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Lt(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){s&&o.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Mt(e,t){const n="fetch";me(n,e),ge(n,()=>function(e,t=!1){t&&!qt()||I(a,"fetch",function(e){return function(...t){const n=new Error,{method:r,url:s}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:jt(t),method:Nt(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:jt(t),method:Nt(t,"method")?String(t.method).toUpperCase():"GET"}}(t),o={args:t,fetchData:{method:r,url:s},startTimestamp:1e3*Y(),virtualError:n,headers:At(t)};return ye("fetch",{...o}),e.apply(a,t).then(async e=>(ye("fetch",{...o,endTimestamp:1e3*Y(),response:e}),e),e=>{if(ye("fetch",{...o,endTimestamp:1e3*Y(),error:e}),J(e)&&void 0===e.stack&&(e.stack=n.stack,K(e,"framesToPop",1)),e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(o.fetchData.url);e.message=`${e.message} (${t.host})`}catch{}throw e})}})}(0,t))}function Nt(e,t){return!!e&&"object"==typeof e&&!!e[t]}function jt(e){return"string"==typeof e?e:e?Nt(e,"url")?e.url:e.toString?e.toString():"":""}function At(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(V(t))return new Headers(t.headers)}catch{}}const Ht=a;let It=0;function Ut(){return It>0}function Bt(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(j(e))return e}catch{return e}const n=function(...n){try{const r=n.map(e=>Bt(e,t));return e.apply(this,r)}catch(r){throw It++,setTimeout(()=>{It--}),B(e=>{e.addEventProcessor(e=>(t.mechanism&&(ee(e,void 0),F(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),z(r)}),r}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}Z(n,e),K(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}function Ft(e,t){const n=zt(e,t),r={type:Jt(t),value:Kt(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Wt(e,t,n,r){const s=M(),o=s?.getOptions().normalizeDepth,i=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}(t),a={__serialized__:oe(t,o)};if(i)return{exception:{values:[Ft(e,i)]},extra:a};const c={exception:{values:[{type:se(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Zt(t,{isUnhandledRejection:r})}]},extra:a};if(n){const t=zt(e,n);t.length&&(c.exception.values[0].stacktrace={frames:t})}return c}function Xt(e,t){return{exception:{values:[Ft(e,t)]}}}function zt(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Gt.test(e.message)?1:0}(t),s=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,s)}catch{}return[]}const Gt=/Minified React error #\d+;/i;function Yt(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function Jt(e){const t=e?.name;return!t&&Yt(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Kt(e){const t=e?.message;return Yt(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Vt(e,t,n,r,s){let o;if(te(t)&&t.error)return Xt(e,t.error);if(ne(t)||re(t)){const s=t;if("stack"in t)o=Xt(e,t);else{const t=s.name||(ne(s)?"DOMError":"DOMException"),i=s.message?`${t}: ${s.message}`:t;o=Qt(e,i,n,r),ee(o,i)}return"code"in s&&(o.tags={...o.tags,"DOMException.code":`${s.code}`}),o}return J(t)?Xt(e,t):D(t)||se(t)?(o=Wt(e,t,n,s),F(o,{synthetic:!0}),o):(o=Qt(e,t,n,r),ee(o,`${t}`),F(o,{synthetic:!0}),o)}function Qt(e,t,n,r){const s={};if(r&&n){const r=zt(e,n);r.length&&(s.exception={values:[{value:t,stacktrace:{frames:r}}]}),F(s,{synthetic:!0})}if(R(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return s.logentry={message:e,params:n},s}return s.message=t,s}function Zt(e,{isUnhandledRejection:t}){const n=ie(e),r=t?"promise rejection":"exception";return te(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:se(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}const en=a;let tn,nn,rn,sn;function on(){if(!en.document)return;const e=ye.bind(null,"dom"),t=an(e,!0);en.document.addEventListener("click",t,!1),en.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=en,r=n[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(I(r,"addEventListener",function(t){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},o=r[n]=r[n]||{refCount:0};if(!o.handler){const r=an(e);o.handler=r,t.call(this,n,r,s)}o.refCount++}catch{}return t.call(this,n,r,s)}}),I(r,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},s=n[t];s&&(s.refCount--,s.refCount<=0&&(e.call(this,t,s.handler,r),s.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function an(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;K(n,"_sentryCaptured",!0),r&&!r._sentryId&&K(r,"_sentryId",y());const s="keypress"===n.type?"input":n.type;(function(e){if(e.type!==nn)return!1;try{if(!e.target||e.target._sentryId!==rn)return!1}catch{}return!0})(n)||(e({event:n,name:s,global:t}),nn=n.type,rn=r?r._sentryId:void 0),clearTimeout(tn),tn=en.setTimeout(()=>{rn=void 0,nn=void 0},1e3)}}function cn(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=sn,s=function(e){try{return new URL(e,en.location.origin).toString()}catch{return e}}(String(n));if(sn=s,r===s)return e.apply(this,t);ye("history",{from:r,to:s})}return e.apply(this,t)}}en.addEventListener("popstate",()=>{const e=en.location.href,t=sn;sn=e,t!==e&&ye("history",{from:t,to:e})}),"history"in Dt&&Dt.history&&(I(en.history,"pushState",e),I(en.history,"replaceState",e))}const un="__sentry_xhr_v3__";function dn(e){me("xhr",e),ge("xhr",ln)}function ln(){if(!en.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,s=1e3*Y(),o=ae(n[0])?n[0].toUpperCase():void 0,i=function(e){if(ae(e))return e;try{return e.toString()}catch{}}(n[1]);if(!o||!i)return e.apply(t,n);t[un]={method:o,url:i,request_headers:{}},"POST"===o&&i.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[un];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}ye("xhr",{endTimestamp:1e3*Y(),startTimestamp:s,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,s]=n,o=t[un];return o&&ae(r)&&ae(s)&&(o.request_headers[r.toLowerCase()]=s),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[un];return r?(void 0!==n[0]&&(r.body=n[0]),ye("xhr",{startTimestamp:1e3*Y(),xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function pn(e,t,n,r){const s={filename:e,function:"<anonymous>"===t?ue:t,in_app:!0};return void 0!==n&&(s.lineno=n),void 0!==r&&(s.colno=r),s}const fn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,hn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mn=/\((\S*)(?::(\d+))(?::(\d+))\)/,gn=/at (.+?) ?\(data:(.+?),/,yn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,_n=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,vn=ce([30,e=>{const t=e.match(gn);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=fn.exec(e);if(n){const[,e,t,r]=n;return pn(e,ue,+t,+r)}const r=hn.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){const e=mn.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=En(r[1]||ue,r[2]);return pn(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],[50,e=>{const t=yn.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=_n.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||ue;return[n,e]=En(n,e),pn(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),En=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:ue,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},bn="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,wn=1024,kn=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&kt(function(e){return function(t){if(M()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:xt(t.level),message:W(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${W(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}mt(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(M()!==e)return;let r,s,i="object"==typeof t?t.serializeAttribute:void 0,a="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;a&&a>wn&&(bn&&o.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=wn),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=le(t,{keyAttrs:i,maxStringLength:a}),s=pe(t)}catch{r="<unknown>"}if(0===r.length)return;const c={category:`ui.${n.name}`,message:r};s&&(c.data={"ui.component_name":s}),mt(c,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),me("dom",n),ge("dom",on)),t.xhr&&dn(function(e){return function(t){if(M()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,s=t.xhr[un];if(!n||!r||!s)return;const{method:o,url:i,status_code:a,body:c}=s,u={method:o,url:i,status_code:a},d={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},l={category:"xhr",data:u,type:"http",level:Ct(a)};e.emit("beforeOutgoingRequestBreadcrumb",l,d),mt(l,d)}}(e)),t.fetch&&Mt(function(e){return function(t){if(M()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.fetchData.method,t.fetchData.url,t.error){const s=t.fetchData,o={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},i={category:"fetch",data:s,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,o),mt(i,o)}else{const s=t.response,o={...t.fetchData,status_code:s?.status};t.fetchData.request_body_size,t.fetchData.response_body_size;const i={input:t.args,response:s,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:o,type:"http",level:Ct(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,i),mt(a,i)}}}(e)),t.history&&function(e){const t="history";me(t,e),ge(t,cn)}(function(e){return function(t){if(M()!==e)return;let n=t.from,r=t.to;const s=dt(Ht.location.href);let o=n?dt(n):void 0;const i=dt(r);o?.path||(o=s),s.protocol===i.protocol&&s.host===i.host&&(r=i.relative),s.protocol===o.protocol&&s.host===o.host&&(n=o.relative),mt({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){M()===e&&mt({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:de(t)},{event:t})}}(e))}}},Sn=["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"],xn=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&I(Ht,"setTimeout",Tn),t.setInterval&&I(Ht,"setInterval",Tn),t.requestAnimationFrame&&I(Ht,"requestAnimationFrame",$n),t.XMLHttpRequest&&"XMLHttpRequest"in Ht&&I(XMLHttpRequest.prototype,"send",Rn);const e=t.eventTarget;e&&(Array.isArray(e)?e:Sn).forEach(e=>function(e,t){const n=Ht,r=n[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(I(r,"addEventListener",function(n){return function(r,s,o){try{"function"==typeof s.handleEvent&&(s.handleEvent=Bt(s.handleEvent,{mechanism:{data:{handler:i(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,s),n.apply(this,[r,Bt(s,{mechanism:{data:{handler:i(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),o])}}),I(r,"removeEventListener",function(e){return function(t,n,r){try{const s=n.__sentry_wrapped__;s&&e.call(this,t,s,r)}catch{}return e.call(this,t,n,r)}}))}(e,t))}}};function Tn(e){return function(...t){const n=t[0];return t[0]=Bt(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${i(e)}`}}),e.apply(this,t)}}function $n(e){return function(t){return e.apply(this,[Bt(t,{mechanism:{data:{handler:i(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Rn(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&I(n,e,function(t){const n={mechanism:{data:{handler:i(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=j(t);return r&&(n.mechanism.data.handler=i(r)),Bt(t,n)})}),e.apply(this,t)}}const On=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";me(t,e),ge(t,ve)}(t=>{const{stackParser:n,attachStacktrace:r}=Cn();if(M()!==e||Ut())return;const{msg:s,url:o,line:i,column:a,error:c}=t,u=function(e,t,n,r){const s=e.exception=e.exception||{},o=s.values=s.values||[],i=o[0]=o[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[],u=r,d=n,l=function(e){if(ae(e)&&0!==e.length){if(e.startsWith("data:")){const t=e.match(/^data:([^;]+)/);return`<data:${t?t[1]:"text/javascript"}${e.includes("base64,")?",base64":""}>`}return e.slice(0,1024)}}(t)??Q();return 0===c.length&&c.push({colno:u,filename:l,function:ue,in_app:!0,lineno:d}),e}(Vt(n,c||s,void 0,r,!1),o,i,a);u.level="error",fe(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}(e),Pn("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";me(t,e),ge(t,be)}(t=>{const{stackParser:n,attachStacktrace:r}=Cn();if(M()!==e||Ut())return;const s=function(e){if(v(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}(t),o=v(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:Vt(n,s,void 0,r,!0);o.level="error",fe(o,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}(e),Pn("onunhandledrejection"))}}};function Pn(e){bn&&o.log(`Global Handler attached: ${e}`)}function Cn(){const e=M();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const Dn=()=>({name:"HttpContext",preprocessEvent(e){if(!Ht.navigator&&!Ht.location&&!Ht.document)return;const t=function(){const e=Q(),{referrer:t}=Ht.document||{},{userAgent:n}=Ht.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),Ln=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,s){vt(Ft,s.getOptions().stackParser,n,t,e,r)}}},qn=(e={})=>{const t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:"HttpClient",setup(e){!function(e,t){qt()&&Mt(n=>{if(M()!==e)return;const{response:r,args:s,error:o,virtualError:i}=n,[a,c]=s;r&&function(e,t,n,r,s){if(An(e,n.status,n.url)){const e=function(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}(t,r);let o,i,a,c;In()&&([o,a]=Mn("Cookie",e),[i,c]=Mn("Set-Cookie",n));const u=Hn({url:e.url,method:e.method,status:n.status,requestHeaders:o,responseHeaders:i,requestCookies:a,responseCookies:c,error:s,type:"fetch"});fe(u)}}(t,a,r,c,o||i)},!1)}(e,t),function(e,t){"XMLHttpRequest"in a&&dn(n=>{if(M()!==e)return;const{error:r,virtualError:s}=n,i=n.xhr,a=i[un];if(!a)return;const{method:c,request_headers:u}=a;try{!function(e,t,n,r,s){if(An(e,t.status,t.responseURL)){let e,o,i;if(In()){try{const e=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;e&&(o=jn(e))}catch{}try{i=function(e){const t=e.getAllResponseHeaders();return t?t.split("\r\n").reduce((e,t)=>{const[n,r]=t.split(": ");return n&&r&&(e[n]=r),e},{}):{}}(t)}catch{}e=r}const a=Hn({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:i,responseCookies:o,error:s,type:"xhr"});fe(a)}}(t,i,c,u,r||s)}catch(d){bn&&o.warn("Error while extracting response event form XHR response",d)}})}(e,t)}}};function Mn(e,t){const n=function(e){const t={};return e.forEach((e,n)=>{t[n]=e}),t}(t.headers);let r;try{const t=n[e]||n[e.toLowerCase()]||void 0;t&&(r=jn(t))}catch{}return[n,r]}function Nn(e){if(e){const t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function jn(e){return e.split("; ").reduce((e,t)=>{const[n,r]=t.split("=");return n&&r&&(e[n]=r),e},{})}function An(e,t,n){return function(e,t){return e.some(e=>"number"==typeof e?e===t:t>=e[0]&&t<=e[1])}(e.failedRequestStatusCodes,t)&&(r=e.failedRequestTargets,s=n,r.some(e=>"string"==typeof e?s.includes(e):e.test(s)))&&!lt(n,M());var r,s}function Hn(e){const t=M(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,s=`HTTP Client Error with status code: ${e.status}`,o={message:s,exception:{values:[{type:"Error",value:s,stacktrace:r?{frames:r}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:Nn(e.responseHeaders)}}};return F(o,{type:`auto.http.client.${e.type}`,handled:!1}),o}function In(){const e=M();return!!e&&Boolean(e.getOptions().sendDefaultPii)}const Un=new class extends Ze{constructor(e){const t=(n=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Ht.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...n});var n;!function(e,t,n=[t],r="npm"){const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:q})),version:q}),e._metadata=s}(t,"browser",["browser"],Ht.SENTRY_SDK_SOURCE||"npm"),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?"auto":"never",...t._metadata.sdk.settings}),super(t);const{sendDefaultPii:r,sendClientReports:s,enableLogs:o,_experiments:i}=this._options;Ht.document&&(s||o||i?.enableMetrics)&&Ht.document.addEventListener("visibilitychange",()=>{"hidden"===Ht.document.visibilityState&&(s&&this._flushOutcomes(),o&&Ie(this),i?.enableMetrics&&Be(this))}),r&&this.on("beforeSendSession",ft)}eventFromException(e,t){return function(e,t,n,r){const s=Vt(e,t,n?.syntheticException||void 0,r);return F(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),L(s)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,s){const o=Qt(e,t,r?.syntheticException||void 0,s);return o.level=n,r?.event_id&&(o.event_id=r.event_id),L(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}({dsn:"https://14362801769747a4b7c1e04eb0c7a3cc@collie.haikuatelier.com/1",environment:"production",integrations:[kn(),xn(),Tt({levels:["warn","error"]}),$t(),_t(),On(),qn({failedRequestStatusCodes:[[400,599]]}),Dn(),Ln()],sendDefaultPii:!0,stackParser:vn,tracesSampleRate:1,transport:e=>ut(e,async t=>{const s={body:t.body,headers:e.headers??{},method:"POST",mode:"no-cors",referrerPolicy:"no-referrer",...e.fetchOptions};return he(await fetch(e.url,s),e=>({headers:{[r]:e.headers.get(r),[n]:e.headers.get(n)},statusCode:e.status}))})});x().setClient(Un),Un.init()}}});