1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2aa58bb4-60de-47cb-b07e-9733e95df2aa",e._sentryDebugIdIdentifier="sentry-dbid-2aa58bb4-60de-47cb-b07e-9733e95df2aa")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12440],{83551:(e,t,i)=>{i.r(t),i.d(t,{createRumProfiler:()=>N});var n=i(89528);function a(){let e=(0,n.Y9)();return t=>{e.send("profile",t)}}var r=i(59309),s=i(45516);function o(e,t,i){let n=(0,r.wP)(e,t,i,s.j.PROFILING);return({profile:e,trace:t})=>{n.send({event:e,"wall-time.json":t})}}let l=/\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g,u=(e,t)=>e||function(e){return e?e.replace(l,"/?"):"/"}(t);var d=i(67245),c=i(86970),p=i(71758),f=i(36812);let v=p.AQ;function b(e){let t=(0,f.q)({expireDelay:v});return e.subscribe(r.Rg.RAW_RUM_EVENT_COLLECTED,({rawRumEvent:e,startClocks:i,duration:n})=>{"long_task"===e.type&&t.add({id:e.long_task.id,startClocks:i,duration:n,entryType:e.long_task.entry_type===r.K.LONG_TASK?r.do.LONG_TASK:r.do.LONG_ANIMATION_FRAME},i.relative).close((0,c.Gw)(i.relative,n))}),t}let m=p.AQ;function _(e){let t=(0,f.q)({expireDelay:m});return e.subscribe(r.Rg.ACTION_STARTED,e=>{t.add({id:e.id,label:"",startClocks:e.startClocks,duration:void 0},e.startClocks.relative)}),e.subscribe(r.Rg.RAW_RUM_EVENT_COLLECTED,({rawRumEvent:e,startClocks:i,duration:n})=>{if("action"===e.type){let a=t.getEntries(i.relative).find(t=>t.value.id===e.action.id),r=n??0;a?(a.value.duration=r,a.close((0,c.Gw)(i.relative,r))):t.add({id:e.action.id,label:"",startClocks:i,duration:n},i.relative).close((0,c.Gw)(i.relative,r))}}),t}let g=p.AQ;function y(e){let t=(0,f.q)({expireDelay:g});return e.subscribe(r.Rg.DURATION_VITAL_STARTED,e=>{t.add({id:e.id,type:r.DL.DURATION,startClocks:e.startClocks,duration:void 0,label:e.name},e.startClocks.relative)}),e.subscribe(r.Rg.RAW_RUM_EVENT_COLLECTED,({rawRumEvent:e,startClocks:i,duration:n})=>{if("vital"!==e.type)return;if(e.vital.type===r.DL.OPERATION_STEP){if("start"===e.vital.step_type)t.add({id:e.vital.id,type:e.vital.type,operationKey:e.vital.operation_key,startClocks:i,label:e.vital.name},i.relative);else if("end"===e.vital.step_type){let n=t.findAllEntries().find(t=>t.value.type===r.DL.OPERATION_STEP&&t.value.label===e.vital.name&&t.value.operationKey===e.vital.operation_key);if(!n)return;n.value.duration=(0,c.vk)(n.value.startClocks.relative,i.relative),n.close(i.relative)}return}let a=t.getEntries(i.relative).find(t=>t.value.id===e.vital.id);if(a){a.value.duration=n,a.close((0,c.Gw)(i.relative,n));return}t.add({id:e.vital.id,type:e.vital.type,operationKey:e.vital.operation_key,startClocks:i,duration:n,label:e.vital.name},i.relative).close((0,c.Gw)(i.relative,n))}),t}var k=i(69896),h=i(88626),E=i(50090);function w(e,t,i=5e3){let n,a=(0,E.Hg)({proxy:e.proxy,site:e.site,path:"/api/v2/profiling/quota",parameters:`session_id=${t}`,subdomain:"quota"}),r=new AbortController;return Promise.race([(0,k.h)(a,{credentials:"omit",signal:r.signal,headers:new Headers({"DD-CLIENT-TOKEN":e.clientToken})}).then(e=>{let t=429===e.status?{decision:"quota_ko",reason:"quota_exceeded"}:{decision:"quota_ok",reason:"api-error"};return e.json().then(e=>{(0,h.DJ)(n);let i=e?.data?.attributes;if(!i||"boolean"!=typeof i.admitted||"string"!=typeof i.reason)return t;let a="backend_client_not_initialized"===i.reason?"backend_unavailable":i.reason;return{decision:i.admitted?"quota_ok":"quota_ko",reason:a}},()=>((0,h.DJ)(n),t))}).catch(()=>((0,h.DJ)(n),{decision:"quota_ok",reason:"api-error"})),new Promise(e=>{n=(0,h.wg)(()=>{r.abort(),e({decision:"quota_ok",reason:"timeout"})},i)})])}var I=i(41095),D=i(51172),T=i(83029),R=i(77562),S=i(49439),A=i(70307);let C={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3};function N(e,t,i,s,l,p,f=C){let v,m=(0,n.d0)()?(0,I.B)(a)():(0,I.B)(o)(e,t,l),g=[],k=(0,I.B)(b)(t),E=(0,I.B)(_)(t),O=(0,I.B)(y)(t),L={state:"stopped",stateReason:"initializing"},M=0;function q(){if("running"===L.state)return;let t=p.findView();v=t?{startClocks:t.startClocks,viewId:t.id,viewName:u(t.name,document.location.pathname)}:void 0,g.push((0,T.q2)(window,T.gX.VISIBILITY_CHANGE,V).stop,(0,T.q2)(window,T.gX.BEFORE_UNLOAD,U).stop),x(),function(){if((0,n.d0)())return;let t=++M,a=i.findTrackedSession()?.id;a&&(0,I.B)(w)(e,a).then(e=>{t===M&&("running"===L.state||"paused"===L.state)&&"quota_ko"===e.decision&&P("quota_ko",e.reason)}).catch(R.Dx)}()}function P(e,t){(function(e){if("running"!==L.state){("paused"===L.state||"stopped"===L.state&&"stopped-by-user"===e)&&(L={state:"stopped",stateReason:e});return}let t=L;L={state:"stopped",stateReason:e}
1,t.cleanupTasks.forEach(e=>e()),"quota_ko"===e?((0,h.DJ)(t.timeoutId),t.profiler.removeEventListener("samplebufferfull",B),t.profiler.stop().catch(R.Dx)):G(t)})(e),g.forEach(e=>e()),g.length=0,s.set({status:"stopped",error_reason:void 0,quota_reason:t})}function x(){let e,n=S.J.Profiler;if(!n)throw s.set({status:"error",error_reason:"not-supported-by-browser"}),Error("RUM Profiler is not supported in this browser.");"running"===L.state&&G(L);let{cleanupTasks:a}=function(e){if("running"===e.state)return{cleanupTasks:e.cleanupTasks};let i=[];return i.push(t.subscribe(r.Rg.VIEW_CREATED,e=>{let t={viewId:e.id,viewName:u(e.name,document.location.pathname),startClocks:e.startClocks};j(t),v=t}).unsubscribe),{cleanupTasks:i}}(L);try{e=new n({sampleInterval:f.sampleIntervalMs,maxBufferSize:Math.round(1.5*f.collectIntervalMs/f.sampleIntervalMs)})}catch(e){e instanceof Error&&e.message.includes("disabled by Document Policy")?(A.Vy.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",e),s.set({status:"error",error_reason:"missing-document-policy-header"})):s.set({status:"error",error_reason:"unexpected-exception"});return}s.set({status:"running",error_reason:void 0}),L={state:"running",startClocks:(0,c.M8)(),profiler:e,timeoutId:(0,h.wg)(x,f.collectIntervalMs),views:[],cleanupTasks:a,longTasks:[],sessionId:i.findTrackedSession()?.id},j(v),e.addEventListener("samplebufferfull",B)}function G(t){(0,h.DJ)(t.timeoutId),t.profiler.removeEventListener("samplebufferfull",B);let{startClocks:i,views:n,sessionId:a}=t;t.profiler.stop().then(t=>{var r;let s=(0,c.M8)(),o=(0,c.vk)(i.relative,s.relative),l=k.findAll(i.relative,o),u=E.findAll(i.relative,o),p=O.findAll(i.relative,o).map(e=>({id:e.id,label:e.label,startClocks:e.startClocks,duration:e.duration})),v=o<f.minProfileDurationMs;0===l.length&&v||(r=Object.assign({},t,{startClocks:i,endClocks:s,clocksOrigin:(0,c.Oc)(),longTasks:l,actions:u,vitals:p,views:n,sampleInterval:f.sampleIntervalMs}),m({profile:function(e,t,i){let n=(0,d.m5)(t),a=function(e,t,i){let{ids:n,names:a}=function(e){let t={ids:[],names:[]};for(let i of e)t.ids.push(i.viewId),i.viewName&&t.names.push(i.viewName);return t.names=Array.from(new Set(t.names)),t}(e.views),r=e.longTasks.map(e=>e.id).filter(e=>void 0!==e),s=e.actions?.map(e=>e.id).filter(e=>void 0!==e)??[],{ids:o,labels:l}=function(e){let t={ids:[],labels:[]};if(!e)return t;for(let i of e)t.ids.push(i.id),t.labels.push(i.label);return t.labels=Array.from(new Set(t.labels)),t}(e.vitals),u={application:{id:t}};return i&&(u.session={id:i}),n.length&&(u.view={id:n,name:a}),r.length&&(u.long_task={id:r}),s.length&&(u.action={id:s,label:[]}),o.length&&(u.vital={id:o,label:l}),u}(e,t.applicationId,i),r=n.concat(["language:javascript","runtime:chrome","family:chrome","host:browser"]);return{...a,attachments:["wall-time.json"],start:new Date(e.startClocks.timeStamp).toISOString(),end:new Date(e.endClocks.timeStamp).toISOString(),family:"chrome",runtime:"chrome",format:"json",version:4,tags_profiler:r.join(","),_dd:{clock_drift:(0,c._O)()}}}(r,e,a),trace:r}))}).catch(R.Dx)}function j(e){"running"===L.state&&e&&L.views.push(e)}function B(){x()}function V(){"hidden"===document.visibilityState&&"running"===L.state?function(){if("running"!==L.state)return;let e=L;L={state:"paused"},e.cleanupTasks.forEach(e=>e()),G(e)}():"visible"===document.visibilityState&&"paused"===L.state&&x()}function U(){x()}return t.subscribe(r.Rg.SESSION_EXPIRED,()=>{P("session-expired")}),t.subscribe(r.Rg.SESSION_RENEWED,()=>{if("stopped"===L.state&&("session-expired"===L.stateReason||"quota_ko"===L.stateReason)){let t=i.findTrackedSession();t&&(0,D.$5)(t.id,(0,D.it)(e.sessionSampleRate,e.profilingSampleRate))&&q()}}),{start:q,stop:function(){P("stopped-by-user")},isStopped:function(){return"stopped"===L.state},isRunning:function(){return"running"===L.state},isPaused:function(){return"paused"===L.state}}}}}]); 2//# sourceMappingURL=datadogProfiler.311e7986e7b7c2f0.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.