harperdb 4.7.0-beta.2 → 4.7.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/harperdb.js +31 -31
- package/bin/lite.js +3 -3
- package/launchServiceScripts/launchNatsIngestService.js +3 -3
- package/launchServiceScripts/launchNatsReplyService.js +3 -3
- package/launchServiceScripts/launchUpdateNodes4-0-0.js +3 -3
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/resources/RequestTarget.d.ts +2 -0
- package/resources/analytics/hostnames.d.ts +5 -477
- package/resources/databases.d.ts +1 -478
- package/server/jobs/jobProcess.js +3 -3
- package/server/threads/threadServer.js +3 -3
- package/studio/web/assets/{index-CXaPu3wc.js → index-BqOgGOeU.js} +2 -2
- package/studio/web/assets/{index-B797owPM.js → index-C4VX60Fd.js} +1 -1
- package/studio/web/assets/{profiler-CgmzpljF.js → profiler-OUXA1uul.js} +1 -1
- package/studio/web/assets/{startRecording-DiD-ht9H.js → startRecording-D8PRkhto.js} +1 -1
- package/studio/web/index.html +1 -1
- package/utility/scripts/restartHdb.js +3 -3
|
@@ -290,7 +290,7 @@ function aB(e,t){for(var n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&
|
|
|
290
290
|
${g}`,b=>{n.notifyAfterAddMessage(b-v)})}function u(g){return g!==void 0&&r[g]!==void 0}function f(g){const v=r[g];delete r[g];const x=e.estimateEncodedBytesCount(v);n.notifyAfterRemoveMessage(x)}function m(g,v){const x=vu(g),b=e.estimateEncodedBytesCount(x);if(b>=o){ht.warn(`Discarded a message whose size was bigger than the maximum allowed size ${o}KB. ${E0} ${zq}/#technical-limitations`);return}u(v)&&f(v),l(x,b,v)}function p(g){const v=n$(r).join(`
|
|
291
291
|
`);r={};const x=uK(g.reason),b=x?t.sendOnExit:t.send;if(x&&e.isAsync){const S=e.finishSync();S.outputBytesCount&&b(Bk(S));const C=[S.pendingData,v].filter(Boolean).join(`
|
|
292
292
|
`);C&&b({data:C,bytesCount:KI(C)})}else v&&e.write(e.isEmpty?v:`
|
|
293
|
-
${v}`),e.finish(S=>{b(Bk(S))})}return{flushController:n,add:m,upsert:m,stop:i.unsubscribe}}function Bk(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function k$({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:o,sessionExpireObservable:r}){const i=o.subscribe(b=>p(b.reason)),l=r.subscribe(()=>p("session_expire")),u=new bt(()=>()=>{i.unsubscribe(),l.unsubscribe()});let f=0,m=0;function p(b){if(m===0)return;const S=m,C=f;m=0,f=0,x(),u.notify({reason:b,messagesCount:S,bytesCount:C})}let g;function v(){g===void 0&&(g=sr(()=>{p("duration_limit")},n))}function x(){_o(g),g=void 0}return{flushObservable:u,get messagesCount(){return m},notifyBeforeAddMessage(b){f+b>=t&&p("bytes_limit"),m+=1,f+=b,v()},notifyAfterAddMessage(b=0){f+=b,m>=e?p("messages_limit"):f>=t&&p("bytes_limit")},notifyAfterRemoveMessage(b){f-=b,m-=1,m===0&&x()}}}const Ys="DISCARDED",to="SKIPPED";function dK(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(o=>o!==n)}}},triggerHook(t,n){const o=e[t]||[],r=[];for(const i of o){const l=i(n);if(l===Ys)return Ys;l!==to&&r.push(l)}return os(...r)}}}const xi={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},fK=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],mK=[q7];let Ix;function bu(){return Ix||(Ix=new WI(100)),Ix}function hK(e,t,n,o,r,i){const l=new bt,{stop:u}=gK(t,o,r,i,l),{enabled:f}=pK(e,t,n,l);return{stop:u,enabled:f}}function pK(e,t,n,o){const r={},i=!mK.includes(t.site)&&ts(t.telemetrySampleRate),l={[xi.LOG]:i,[xi.CONFIGURATION]:i&&ts(t.telemetryConfigurationSampleRate),[xi.USAGE]:i&&ts(t.telemetryUsageSampleRate)},u=vK(),f=bu();return f.subscribe(({rawEvent:p,kind:g})=>{if(!l[p.type])return;let v=r[g];if(v||(v=r[g]=new Set),v.size>=t.maxTelemetryEventsPerPage)return;const x=vu(p);if(v.has(x))return;const b=n.triggerHook(1,{startTime:Gn().relative});if(b===Ys)return;const S=m(b,e,p,u);o.notify(S),v$("telemetry",S),v.add(x)}),f.unbuffer(),Zq(A0),{enabled:i};function m(p,g,v,x){const S={type:"telemetry",date:Gn().timeStamp,service:g,version:"6.19.0",source:"browser",_dd:{format_version:2},telemetry:os(v,{runtime_env:x,connectivity:y$(),sdk_setup:"npm"}),experimental_features:Array.from(B7())};return os(S,p)}}function gK(e,t,n,o,r){const i=[];if(Yc()){const l=Lf(),u=r.subscribe(f=>l.send("internal_telemetry",f));i.push(u.unsubscribe)}else{const l=[e.rumEndpointBuilder];e.replica&&yK(e)&&l.push(e.replica.rumEndpointBuilder);const u=N$({encoder:o(4),request:R$(l,e.batchBytesLimit,t),flushController:k$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new bt}),messageBytesLimit:e.messageBytesLimit});i.push(u.stop);const f=r.subscribe(u.add);i.push(f.unsubscribe)}return{stop:()=>i.forEach(l=>l())}}function vK(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function yK(e){return e.site===g$}function oa(e,t){lw(Ug.debug,e,t),bu().notify({rawEvent:{type:xi.LOG,message:e,status:"debug",...t},kind:"debug"})}function A0(e,t){bu().notify({rawEvent:{type:xi.LOG,status:"error",...xK(e),...t},kind:"error"})}function bK(e){bu().notify({rawEvent:{type:xi.CONFIGURATION,configuration:e},kind:xi.CONFIGURATION})}function I0(e,t){bu().notify({rawEvent:{type:xi.LOG,message:e,status:"debug",...t},kind:e})}function vr(e){bu().notify({rawEvent:{type:xi.USAGE,usage:e},kind:xi.USAGE})}function xK(e){if(ul(e)){const t=zf(e);return{error:{kind:t.name,stack:Uf(_K(t))},message:t.message}}return{error:{stack:p$},message:`Uncaught ${vu(e)}`}}function _K(e){return e.stack=e.stack.filter(t=>!t.url||fK.some(n=>t.url.startsWith(n))),e}const wK=10,SK=100,CK=cr,T$="--",O$=[];let vp;function Ta(e,t,n=0){var o;const{isLockEnabled:r,persistSession:i,expireSession:l}=t,u=v=>i({...v,lock:m}),f=()=>{const{lock:v,...x}=t.retrieveSession();return{session:x,lock:v&&!RK(v)?v:void 0}};if(vp||(vp=e),e!==vp){O$.push(e);return}if(r&&n>=SK){oa("Aborted session operation after max lock retries",{currentStore:f()}),Hk(t);return}let m,p=f();if(r){if(p.lock){Lh(e,t,n);return}if(m=EK(),u(p.session),p=f(),p.lock!==m){Lh(e,t,n);return}}let g=e.process(p.session);if(r&&(p=f(),p.lock!==m)){Lh(e,t,n);return}if(g&&(tf(g)?l(g):(a$(g),r?u(g):i(g))),r&&!(g&&tf(g))){if(p=f(),p.lock!==m){Lh(e,t,n);return}i(p.session),g=p.session}(o=e.after)===null||o===void 0||o.call(e,g||p.session),Hk(t)}function Lh(e,t,n){sr(()=>{Ta(e,t,n+1)},wK)}function Hk(e){vp=void 0;const t=O$.shift();t&&Ta(t,e)}function EK(){return ur()+T$+Bn()}function RK(e){const[,t]=e.split(T$);return!t||en(Number(t),Bn())>CK}const Gk=cr;function jK(e){switch(e.sessionPersistence){case mf.COOKIE:return Uk(e);case mf.LOCAL_STORAGE:return Fk();case void 0:{let t=Uk(e);return!t&&e.allowFallbackToLocalStorage&&(t=Fk()),t}default:ht.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function NK(e,t){return e.type===mf.COOKIE?d7(t,e.cookieOptions):h7(t)}function kK(e,t,n,o,r=NK(e,t)){const i=new bt,l=new bt,u=new bt,f=gu(x,Gk);let m;S();const{throttled:p,cancel:g}=Bg(()=>{Ta({process:A=>{if(gp(A))return;const I=b(A);return C(I),I},after:A=>{s$(A)&&!E()&&T(A),m=A}},r)},Gk);function v(){Ta({process:A=>E()?b(A):void 0},r)}function x(){const A=r.retrieveSession();tf(A)?Ta({process:I=>tf(I)?ka(I,t):void 0,after:b},r):b(A)}function b(A){return tf(A)&&(A=ka(A,t)),E()&&(j(A)?N():(u.notify({previousState:m,newState:A}),m=A)),A}function S(){Ta({process:A=>{if(gp(A))return ka(A,t)},after:A=>{m=A}},r)}function C(A){if(gp(A))return!1;const I=o(A[n]);A[n]=I,delete A.isExpired,I!==o$&&!A.id&&(A.id=ur(),A.created=String(Ro()))}function E(){return m?.[n]!==void 0}function j(A){return m.id!==A.id||m[n]!==A[n]}function N(){m=ka(m,t),l.notify()}function T(A){m=A,i.notify()}function k(A){Ta({process:I=>({...I,...A}),after:b},r)}return{expandOrRenewSession:p,expandSession:v,getSession:()=>m,renewObservable:i,expireObservable:l,sessionStateUpdateObservable:u,restartSession:S,expire:()=>{g(),r.expireSession(m),b(ka(m,t))},stop:()=>{Vg(f)},updateSessionState:k}}const dw={GRANTED:"granted",NOT_GRANTED:"not-granted"};function TK(e){const t=new bt;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===dw.GRANTED},observable:t}}function $0(e){const t=dl(e);return t==="string"||t==="function"||e instanceof RegExp}function M0(e,t,n=!1){return e.some(o=>{try{if(typeof o=="function")return o(t);if(o instanceof RegExp)return o.test(t);if(typeof o=="string")return n?t.startsWith(o):o===t}catch(r){ht.error(r)}return!1})}const A$=["chrome-extension://","moz-extension://"];function qk(e){return A$.some(t=>e.includes(t))}function OK(e,t=""){return!qk(e)&&qk(t)}function AK(e=""){for(const t of A$){const n=e.match(new RegExp(`${t}[^/]+`));if(n)return n[0]}}const Kk="Running the Browser SDK in a Web extension content script is discouraged and will be forbidden in a future major release unless the `allowedTrackingOrigins` option is provided.",IK="SDK initialized on a non-allowed domain.";function $K(e,t=typeof location<"u"?location.origin:"",n=new Error().stack){const o=e.allowedTrackingOrigins;if(!o){if(OK(t,n)){ht.warn(Kk);const i=AK(n);oa(Kk,{extensionUrl:i||"unknown"})}return!0}const r=M0(o,t);return r||ht.error(IK),r}function P0(e){return D0(e,location.href).href}function MK(e){try{return!!D0(e)}catch{return!1}}function PK(e){const t=D0(e).pathname;return t[0]==="/"?t:`/${t}`}function D0(e,t){const{URL:n}=DK();try{return t!==void 0?new n(e,t):new n(e)}catch(o){throw new Error(`Failed to construct URL: ${String(o)} ${vu({url:e,base:t})}`)}}let $x;function DK(){if(!$x){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=window}$x={URL:t.URL},e?.remove()}return $x}function Oa(e,t,n){const o=zK(e,t);return{build(r,i){const l=UK(e,t,r,i,n);return o(l)},trackType:t}}function zK(e,t){const n=`/api/v2/${t}`,o=e.proxy;if(typeof o=="string"){const i=P0(o);return l=>`${i}?ddforward=${encodeURIComponent(`${n}?${l}`)}`}if(typeof o=="function")return i=>o({path:n,parameters:i});const r=I$(t,e);return i=>`https://${r}${n}?${i}`}function I$(e,t){const{site:n=$a,internalAnalyticsSubdomain:o}=t;if(e==="logs"&&t.usePciIntake&&n===$a)return K7;if(o&&n===$a)return`${o}.${$a}`;if(n===H7)return`http-intake.logs.${n}`;const r=n.split("."),i=r.pop();return`browser-intake-${r.join("-")}.${i}`}function UK({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},o,r,{retry:i,encoding:l},u=[]){const f=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.19.0")}`,"dd-evp-origin=browser",`dd-request-id=${ur()}`].concat(u);return l&&f.push(`dd-evp-encoding=${l}`),o==="rum"&&(f.push(`batch_time=${Bn()}`,`_dd.api=${r}`),i&&f.push(`_dd.retry_count=${i.count}`,`_dd.retry_after=${i.lastFailureStatus}`)),t&&f.reverse(),f.join("&")}function LK(e){const t=e.site||$a,n=e.source==="flutter"?"flutter":"browser",o=FK({...e,site:t,source:n});return{replica:VK({...e,site:t,source:n}),site:t,source:n,...o}}function FK(e){return{logsEndpointBuilder:Oa(e,"logs"),rumEndpointBuilder:Oa(e,"rum"),profilingEndpointBuilder:Oa(e,"profile"),sessionReplayEndpointBuilder:Oa(e,"replay"),exposuresEndpointBuilder:Oa(e,"exposures")}}function VK(e){if(!e.replica)return;const t={...e,site:$a,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Oa(t,"logs"),rumEndpointBuilder:Oa(t,"rum",[`application.id=${e.replica.applicationId}`])}}function BK(e){return Z7.every(t=>e.includes(t))}const nf={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},fw={ALL:"all",SAMPLED:"sampled"};function Mx(e,t){return e!=null&&typeof e!="string"?(ht.error(`${t} must be defined as a string`),!1):!0}function HK(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(ht.error(`Site should be a valid Datadog site. ${E0} ${Lg}/getting_started/site/.`),!1):!0}function xc(e,t){return e!==void 0&&!Uq(e)?(ht.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function GK(e){var t,n,o,r,i,l,u,f,m,p;if(!e||!e.clientToken){ht.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){ht.error("Allowed Tracking Origins must be an array");return}if(!(!HK(e.site)||!xc(e.sessionSampleRate,"Session")||!xc(e.telemetrySampleRate,"Telemetry")||!xc(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!xc(e.telemetryUsageSampleRate,"Telemetry Usage")||!Mx(e.version,"Version")||!Mx(e.env,"Env")||!Mx(e.service,"Service")||!$K(e))){if(e.trackingConsent!==void 0&&!Lp(dw,e.trackingConsent)){ht.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&VI(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:jK(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(o=e.telemetryConfigurationSampleRate)!==null&&o!==void 0?o:5,telemetryUsageSampleRate:(r=e.telemetryUsageSampleRate)!==null&&r!==void 0?r:5,service:(i=e.service)!==null&&i!==void 0?i:void 0,env:(l=e.env)!==null&&l!==void 0?l:void 0,version:(u=e.version)!==null&&u!==void 0?u:void 0,datacenter:(f=e.datacenter)!==null&&f!==void 0?f:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(m=e.trackingConsent)!==null&&m!==void 0?m:dw.GRANTED,trackAnonymousUser:(p=e.trackAnonymousUser)!==null&&p!==void 0?p:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*uf,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*cr,batchMessagesLimit:50,messageBytesLimit:256*uf,variant:e.variant,sdkVersion:e.sdkVersion,...LK(e)}}}function qK(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}const KK=200;function ZK(e){const{env:t,service:n,version:o,datacenter:r,sdkVersion:i,variant:l}=e,u=[lc("sdk_version",i??"6.19.0")];return t&&u.push(lc("env",t)),n&&u.push(lc("service",n)),o&&u.push(lc("version",o)),r&&u.push(lc("datacenter",r)),l&&u.push(lc("variant",l)),u}function lc(e,t){const n=t?`${e}:${t}`:e;return(n.length>KK||XK(n))&&ht.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${E0} ${Lg}/getting_started/tagging/#defining-tags`),YK(n)}function YK(e){return e.replace(/,/g,"_")}function XK(e){return WK()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function WK(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function _i(e,t,n,{computeHandlingStack:o}={}){let r=e[t];if(typeof r!="function")if(t in e&&t.startsWith("on"))r=kt;else return{stop:kt};let i=!1;const l=function(){if(i)return r.apply(this,arguments);const u=Array.from(arguments);let f;Ya(n,null,[{target:this,parameters:u,onPostCall:p=>{f=p},handlingStack:o?hf("instrumented method"):void 0}]);const m=r.apply(this,u);return f&&Ya(f,null,[m]),m};return e[t]=l,{stop:()=>{i=!0,e[t]===l&&(e[t]=r)}}}function Abe(e,t,n){const o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o.set||!o.configurable)return{stop:kt};const r=kt;let i=(u,f)=>{sr(()=>{i!==r&&n(u,f)},0)};const l=function(u){o.set.call(this,u),i(this,u)};return Object.defineProperty(e,t,{set:l}),{stop:()=>{var u;((u=Object.getOwnPropertyDescriptor(e,t))===null||u===void 0?void 0:u.set)===l&&Object.defineProperty(e,t,o),i=r}}}function QK(){return new bt(e=>{const t=(r,i)=>{const l=k0({stackTrace:i,originalError:r,startClocks:Gn(),nonErrorPrefix:"Uncaught",source:yu.SOURCE,handling:"unhandled"});e.notify(l)},{stop:n}=JK(t),{stop:o}=eZ(t);return()=>{n(),o()}})}function JK(e){return _i(Qo(),"onerror",({parameters:[t,n,o,r,i]})=>{let l;ul(i)||(l=I7(t,n,o,r)),e(i??t,l)})}function eZ(e){return _i(Qo(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function tZ(e){const t={version:"6.19.0",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return Yq},enumerable:!1}),t}function nZ(e,t,n){const o=e[t];o&&!o.q&&o.version&&ht.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,o&&o.q&&o.q.forEach(r=>VI(r,"onReady callback threw an error:")())}function $$(e,t){t.silentMultipleInit||ht.error(`${e} is already initialized.`)}const pf={intervention:"intervention",cspViolation:"csp_violation"};function rZ(e,t){const n=[];t.includes(pf.cspViolation)&&n.push(iZ(e));const o=t.filter(r=>r!==pf.cspViolation);return o.length&&n.push(oZ(o)),XI(...n)}function oZ(e){return new bt(t=>{if(!window.ReportingObserver)return;const n=tt((r,i)=>r.forEach(l=>t.notify(sZ(l)))),o=new window.ReportingObserver(n,{types:e,buffered:!0});return o.observe(),()=>{o.disconnect()}})}function iZ(e){return new bt(t=>{const{stop:n}=Qt(e,document,"securitypolicyviolation",o=>{t.notify(aZ(o))});return n})}function sZ(e){const{type:t,body:n}=e;return M$({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:P$(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function aZ(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return M$({type:e.effectiveDirective,message:`${pf.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:P$(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${QI(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function M$(e){return{startClocks:Gn(),source:yu.REPORT,handling:"unhandled",...e}}function P$(e,t,n,o,r){return n?Uf({name:e,message:t,stack:[{func:"?",url:n,line:o??void 0,column:r??void 0}]}):void 0}function D$(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}const Fh=1/0,lZ=Mr;let Id=null;const yp=new Set;function cZ(){yp.forEach(e=>e())}function xu({expireDelay:e,maxEntries:t}){let n=[];Id||(Id=gu(()=>cZ(),lZ));const o=()=>{const p=eo()-e;for(;n.length>0&&n[n.length-1].endTime<p;)n.pop()};yp.add(o);function r(p,g){const v={value:p,startTime:g,endTime:Fh,remove:()=>{D$(n,v)},close:x=>{v.endTime=x}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function i(p=Fh,g={returnInactive:!1}){for(const v of n)if(v.startTime<=p){if(g.returnInactive||p<=v.endTime)return v.value;break}}function l(p){const g=n[0];g&&g.endTime===Fh&&g.close(p)}function u(p=Fh,g=0){const v=pu(p,g);return n.filter(x=>x.startTime<=v&&p<=x.endTime).map(x=>x.value)}function f(){n=[]}function m(){yp.delete(o),yp.size===0&&Id&&(Vg(Id),Id=null)}return{add:r,find:i,closeActive:l,findAll:u,reset:f,stop:m}}const uZ="datadog-synthetics-public-id",dZ="datadog-synthetics-result-id",fZ="datadog-synthetics-injects-rum";function z$(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||Us(fZ))}function U$(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||Us(uZ);return typeof e=="string"?e:void 0}function L$(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||Us(dZ);return typeof e=="string"?e:void 0}function F$(){return!!(U$()&&L$())}const mZ=Mr,hZ=cl;function pZ(e,t,n,o){const r=new bt,i=new bt,l=kK(e.sessionStoreStrategyType,e,t,n),u=xu({expireDelay:hZ});l.renewObservable.subscribe(()=>{u.add(f(),eo()),r.notify()}),l.expireObservable.subscribe(()=>{i.notify(),u.closeActive(eo())}),l.expandOrRenewSession(),u.add(f(),GI().relative),o.observable.subscribe(()=>{o.isGranted()?l.expandOrRenewSession():l.expire()}),gZ(e,()=>{o.isGranted()&&l.expandOrRenewSession()}),vZ(e,()=>l.expandSession()),yZ(e,()=>l.restartSession());function f(){const m=l.getSession();return m?{id:m.id,trackingType:m[t],isReplayForced:!!m.forcedReplay,anonymousId:m.anonymousId}:(bZ().catch(()=>{}),{id:"invalid",trackingType:o$,isReplayForced:!1,anonymousId:void 0})}return{findSession:(m,p)=>u.find(m,p),renewObservable:r,expireObservable:i,sessionStateUpdateObservable:l.sessionStateUpdateObservable,expire:l.expire,updateSessionState:l.updateSessionState}}function gZ(e,t){const{stop:n}=Zs(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function vZ(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:o}=Qt(e,document,"visibilitychange",n);gu(n,mZ)}function yZ(e,t){const{stop:n}=Qt(e,window,"resume",t,{capture:!0})}async function bZ(){const e=u$();let t=[];"cookieStore"in window?t=await window.cookieStore.getAll("_dd_s"):t=document.cookie.split(/\s*;\s*/).filter(n=>n.startsWith("_dd_s")),oa("Unexpected session state",{session:e,isSyntheticsTest:F$(),createdTimestamp:e?.created,expireTimestamp:e?.expire,cookie:{count:t.length,domain:t$(),...t},currentDomain:`${window.location.protocol}//${window.location.hostname}`})}function xZ(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,o){const r=KI(n);t+=r,e+=n,o&&o(r)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class _Z{constructor(){this.callbacks={}}notify(t,n){const o=this.callbacks[t];o&&o.forEach(r=>r(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(o=>n!==o)}}}}function Px(e,t,n){let o=0,r=!1;return{isLimitReached(){if(o===0&&sr(()=>{o=0},Mr),o+=1,o<=t||r)return r=!1,!1;if(o===t+1){r=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:yu.AGENT,startClocks:Gn()})}finally{r=!1}}return!0}}}function z0(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:kt}):Qt(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function wZ(e,t){return new Promise(n=>{z0(e,t,n)})}let Dx;const U0=new WeakMap;function SZ(e){return Dx||(Dx=CZ(e)),Dx}function CZ(e){return new bt(t=>{const{stop:n}=_i(XMLHttpRequest.prototype,"open",EZ),{stop:o}=_i(XMLHttpRequest.prototype,"send",i=>{RZ(i,e,t)},{computeHandlingStack:!0}),{stop:r}=_i(XMLHttpRequest.prototype,"abort",jZ);return()=>{n(),o(),r()}})}function EZ({target:e,parameters:[t,n]}){U0.set(e,{state:"open",method:String(t).toUpperCase(),url:P0(String(n))})}function RZ({target:e,handlingStack:t},n,o){const r=U0.get(e);if(!r)return;const i=r;i.state="start",i.startClocks=Gn(),i.isAborted=!1,i.xhr=e,i.handlingStack=t;let l=!1;const{stop:u}=_i(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(m(),u(),l)return;l=!0;const p=r;p.state="complete",p.duration=en(i.startClocks.timeStamp,Bn()),p.status=e.status,o.notify(df(p))},{stop:m}=Qt(n,e,"loadend",f);o.notify(i)}function jZ({target:e}){const t=U0.get(e);t&&(t.isAborted=!0)}let zx;function V$(){return zx||(zx=NZ()),zx}function NZ(){return new bt(e=>{if(!window.fetch)return;const{stop:t}=_i(window,"fetch",n=>kZ(n,e),{computeHandlingStack:!0});return t})}function kZ({parameters:e,onPostCall:t,handlingStack:n},o){const[r,i]=e;let l=i&&i.method;l===void 0&&r instanceof Request&&(l=r.method);const u=l!==void 0?String(l).toUpperCase():"GET",f=r instanceof Request?r.url:P0(String(r)),m=Gn(),p={state:"start",init:i,input:r,method:u,startClocks:m,url:f,handlingStack:n};o.notify(p),e[0]=p.input,e[1]=p.init,t(g=>TZ(o,g,p))}function TZ(e,t,n){const o=n;function r(i){o.state="resolve",Object.assign(o,i),e.notify(o)}t.then(tt(i=>{r({response:i,responseType:i.type,status:i.status,isAborted:!1})}),tt(i=>{var l,u;r({status:0,isAborted:((u=(l=o.init)===null||l===void 0?void 0:l.signal)===null||u===void 0?void 0:u.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function OZ(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(tt(e),t);return()=>window.cancelIdleCallback(n)}return IZ(e)}const AZ=50;function IZ(e){const t=Ro(),n=sr(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,AZ-(Ro()-t))})},0);return()=>_o(n)}const $Z=cr,MZ=30;function PZ(){const e=[];function t(o){let r;if(o.didTimeout){const i=performance.now();r=()=>MZ-(performance.now()-i)}else r=o.timeRemaining.bind(o);for(;r()>0&&e.length;)e.shift()();e.length&&n()}function n(){OZ(t,{timeout:$Z})}return{push(o){e.push(o)===1&&n()}}}let Ux={};function DZ(e){const t=e.map(n=>(Ux[n]||(Ux[n]=zZ(n)),Ux[n]));return XI(...t)}function zZ(e){return new bt(t=>{const n=Xi[e];return Xi[e]=(...o)=>{n.apply(console,o);const r=hf("console error");Ya(()=>{t.notify(UZ(o,e,r))})},()=>{Xi[e]=n}})}function UZ(e,t,n){const o=e.map(r=>LZ(r)).join(" ");if(t===Ug.error){const r=e.find(ul),i=k0({originalError:r,handlingStack:n,startClocks:Gn(),source:yu.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=o,{api:t,message:o,handlingStack:n,error:i}}return{api:t,message:o,error:void 0,handlingStack:n}}function LZ(e){return typeof e=="string"?fn(e):ul(e)?h$(zf(e)):vu(fn(e),void 0,2)}const FZ=500;function VZ(){const e=[];return{add:r=>{e.push(r)>FZ&&e.splice(0,1)},remove:r=>{D$(e,r)},drain:r=>{e.forEach(i=>i(r)),e.length=0}}}function BZ(e){const t=dl(e)==="object";return t||ht.error("Unsupported context:",e),t}function Lx(e,t,n){const o={...e};for(const[r,{required:i,type:l}]of Object.entries(t))l==="string"&&!Zk(o[r])&&(o[r]=String(o[r])),i&&Zk(o[r])&&ht.warn(`The property ${r} of ${n} is required; context will not be sent to the intake.`);return o}function Zk(e){return e==null||e===""}function Kg(e="",{propertiesConfig:t={}}={}){let n={};const o=new bt,r={getContext:()=>O0(n),setContext:i=>{BZ(i)?n=fn(Lx(i,t,e)):r.clearContext(),o.notify()},setContextProperty:(i,l)=>{n=fn(Lx({...n,[i]:l},t,e)),o.notify()},removeContextProperty:i=>{delete n[i],Lx(n,t,e),o.notify()},clearContext:()=>{n={},o.notify()},changeObservable:o};return r}function hr(e,t,n,o){return tt((...r)=>(o&&vr({feature:o}),e()[t][n](...r)))}const HZ="_dd_c",GZ=[];function L0(e,t,n,o){const r=qZ(n,o);GZ.push(Qt(e,window,"storage",({key:m})=>{r===m&&l()})),t.changeObservable.subscribe(u);const i=os(f(),t.getContext());ll(i)||t.setContext(i);function l(){t.setContext(f())}function u(){localStorage.setItem(r,JSON.stringify(t.getContext()))}function f(){const m=localStorage.getItem(r);return m?JSON.parse(m):{}}}function qZ(e,t){return`${HZ}_${e}_${t}`}function KZ(e,t,n){const o=B$();return t.storeContextsAcrossPages&&L0(t,o,n,4),e.register(0,()=>{const r=o.getContext();return ll(r)||!r.id?to:{account:r}}),o}function B$(){return Kg("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function ZZ(e,t,n,o){const r=H$();return t.storeContextsAcrossPages&&L0(t,r,n,2),e.register(0,()=>({context:r.getContext()})),r}function H$(){return Kg("global context")}function YZ(e,t,n,o){const r=G$();return t.storeContextsAcrossPages&&L0(t,r,o,1),e.register(0,({eventType:i,startTime:l})=>{const u=r.getContext(),f=n.findTrackedSession(l);return f&&f.anonymousId&&!u.anonymous_id&&t.trackAnonymousUser&&(u.anonymous_id=f.anonymousId),ll(u)?to:{type:i,usr:u}}),e.register(1,({startTime:i})=>{var l;return{anonymous_id:(l=n.findTrackedSession(i))===null||l===void 0?void 0:l.anonymousId}}),r}function G$(){return Kg("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Vn={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},pr={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function XZ(e,t,n){const o=e.getReader();let r=0;i();function i(){o.read().then(tt(u=>{if(u.done){l();return}r+=u.value.length,r>n.bytesLimit?l():i()}),tt(u=>t(u)))}function l(){o.cancel().catch(kt),t(void 0,void 0,void 0)}}const br={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Zg={FETCH:br.FETCH,XHR:br.XHR},WZ=500;function QZ(e=QK){const t=new WI(WZ),n=e().subscribe(o=>{t.notify({type:0,error:o})});return{observable:t,stop:()=>{n.unsubscribe()}}}function JZ(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const it={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},q$={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Wi={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},F0={CLICK:"click",CUSTOM:"custom"},$d={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},K$={DURATION:"duration"};function eY(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function tY(e,t,n){function o(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function r(i){o(i)&&e.notify(12,rY(i))}return{addDurationVital:r,startDurationVital:(i,l={})=>Z$(n,i,l),stopDurationVital:(i,l={})=>{Y$(r,n,i,l)}}}function Z$({vitalsByName:e,vitalsByReference:t},n,o={}){const r={name:n,startClocks:Gn(),context:o.context,description:o.description},i={__dd_vital_reference:!0};return e.set(n,r),t.set(i,r),i}function Y$(e,{vitalsByName:t,vitalsByReference:n},o,r={}){const i=typeof o=="string"?t.get(o):n.get(o);i&&(e(nY(i,i.startClocks,r,Gn())),typeof o=="string"?t.delete(o):n.delete(o))}function nY(e,t,n,o){var r;return{name:e.name,type:K$.DURATION,startClocks:t,duration:en(t.timeStamp,o.timeStamp),context:os(e.context,n.context),description:(r=n.description)!==null&&r!==void 0?r:e.description}}function rY(e,t){const n={date:e.startClocks.timeStamp,vital:{id:ur(),type:e.type,name:e.name,duration:ot(e.duration),description:e.description},type:it.VITAL,context:e.context};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,duration:e.duration,domainContext:{}}}function X$(e,t,n){if(e)for(const o of e){const r=o[t];r&&r(n)}}const Yk=new Map;function W$(e,t){if(t===100)return!0;if(t===0)return!1;const n=Yk.get(t);if(n&&e===n.sessionId)return n.decision;let o;return window.BigInt?o=oY(BigInt(`0x${e.split("-")[4]}`),t):o=ts(t),Yk.set(t,{sessionId:e,decision:o}),o}function oY(e,t){const n=BigInt("1111111111111111111"),o=BigInt("0x10000000000000000"),r=e*n%o;return Number(r)<=t/100*Number(o)}function iY(){return J$(64)}function Q$(){return J$(63)}function J$(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let o=t[1],r=t[0],i="";do{const l=o%n*4294967296+r;o=Math.floor(o/n),r=Math.floor(l/n),i=(l%n).toString(n)+i}while(o||r);return i}}}function cc(e){return e.toString(16).padStart(16,"0")}function sY(e){const t=e;return dl(t)==="object"&&$0(t.match)&&Array.isArray(t.propagatorTypes)}function aY(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function lY(e,t,n,o){return{clearTracingIfNeeded:aY,traceFetch:r=>Xk(e,r,t,n,o,i=>{var l;if(r.input instanceof Request&&!(!((l=r.init)===null||l===void 0)&&l.headers))r.input=new Request(r.input),Object.keys(i).forEach(u=>{r.input.headers.append(u,i[u])});else{r.init=df(r.init);const u=[];r.init.headers instanceof Headers?r.init.headers.forEach((f,m)=>{u.push([m,f])}):Array.isArray(r.init.headers)?r.init.headers.forEach(f=>{u.push(f)}):r.init.headers&&Object.keys(r.init.headers).forEach(f=>{u.push([f,r.init.headers[f]])}),r.init.headers=u.concat(j0(i))}}),traceXhr:(r,i)=>Xk(e,r,t,n,o,l=>{Object.keys(l).forEach(u=>{i.setRequestHeader(u,l[u])})})}}function Xk(e,t,n,o,r,i){const l=n.findTrackedSession();if(!l)return;const u=e.allowedTracingUrls.find(p=>M0([p.match],t.url,!0));if(!u)return;const f=W$(l.id,e.traceSampleRate);(f||e.traceContextInjection===fw.ALL)&&(t.traceSampled=f,t.traceId=iY(),t.spanId=Q$(),i(cY(t.traceId,t.spanId,t.traceSampled,l.id,u.propagatorTypes,o,r,e)))}function cY(e,t,n,o,r,i,l,u){const f={};if(r.forEach(m=>{switch(m){case"datadog":{Object.assign(f,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(f,{traceparent:`00-0000000000000000${cc(e)}-${cc(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(f,{b3:`${cc(e)}-${cc(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(f,{"X-B3-TraceId":cc(e),"X-B3-SpanId":cc(t),"X-B3-Sampled":n?"1":"0"});break}}}),u.propagateTraceBaggage){const m={"session.id":o},p=i.getContext().id;typeof p=="string"&&(m["user.id"]=p);const g=l.getContext().id;typeof g=="string"&&(m["account.id"]=g);const v=Object.entries(m).map(([x,b])=>`${x}=${encodeURIComponent(b)}`).join(",");v&&(f.baggage=v)}return f}const eM=["tracecontext","datadog"];function uY(e){var t,n,o,r,i,l,u;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&ht.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){ht.error("Application ID is not configured, no RUM data will be collected.");return}if(!xc(e.sessionReplaySampleRate,"Session Replay")||!xc(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){ht.error("Excluded Activity Urls should be an array");return}const f=dY(e);if(!f)return;const m=GK(e);if(!m)return;const p=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:p,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:p===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:Mf(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(o=e.excludedActivityUrls)!==null&&o!==void 0?o:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((r=e.trackUserInteractions)!==null&&r!==void 0)||r),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((i=e.trackResources)!==null&&i!==void 0)||i),trackLongTasks:!!(!((l=e.trackLongTasks)!==null&&l!==void 0)||l),trackBfcacheViews:!!e.trackBfcacheViews,subdomain:e.subdomain,defaultPrivacyLevel:Lp(nf,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:nf.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,initialViewMetricsTelemetrySampleRate:1,replayTelemetrySampleRate:1,traceContextInjection:Lp(fw,e.traceContextInjection)?e.traceContextInjection:fw.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(u=e.profilingSampleRate)!==null&&u!==void 0?u:0,propagateTraceBaggage:!!e.propagateTraceBaggage,...m}}function dY(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){ht.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){ht.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{$0(n)?t.push({match:n,propagatorTypes:eM}):sY(n)?t.push(n):ht.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function fY(e){const t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(n=>{$0(n)?eM.forEach(o=>t.add(o)):dl(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(o=>t.add(o))}),Array.from(t)}function mY(e){var t;const n=qK(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:fY(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(o=>{var r;return{name:o.name,...(r=o.getConfigurationTelemetry)===null||r===void 0?void 0:r.call(o)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,...n}}const hY="v1",pY=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function gY(e,t){const n=await EY(e);if(!n.ok){ht.error(n.error);return}return vY(e,n.value,t)}function vY(e,t,n){const o={...e};return pY.forEach(r=>{r in t&&(o[r]=Bp(t[r]))}),Object.keys(n).forEach(r=>{t[r]!==void 0&&xY(n[r],t[r])}),o}function Bp(e){if(Array.isArray(e))return e.map(Bp);if(yY(e)){if(bY(e)){const t=e.rcSerializedType;switch(t){case"string":return e.value;case"regex":return tM(e.value);case"dynamic":return _Y(e);default:ht.error(`Unsupported remote configuration: "rcSerializedType": "${t}"`);return}}return ZI(e,Bp)}return e}function yY(e){return typeof e=="object"&&e!==null}function bY(e){return"rcSerializedType"in e}function tM(e){try{return new RegExp(e)}catch{ht.error(`Invalid regex in the remote configuration: '${e}'`)}}function xY(e,t){t.forEach(({key:n,value:o})=>{e.setContextProperty(n,Bp(o))})}function _Y(e){const t=e.strategy;switch(t){case"cookie":return wY(e);case"dom":return SY(e);default:ht.error(`Unsupported remote configuration: "strategy": "${t}"`);return}}function wY({name:e,extractor:t}){const n=Gg(e);return t!==void 0&&n!==void 0?nM(t,n):n}function SY({selector:e,attribute:t,extractor:n}){let o;try{o=document.querySelector(e)}catch{o=null,ht.error(`Invalid selector in the remote configuration: '${e}'`)}if(o===null||CY(o,t))return;const r=t!==void 0?o.getAttribute(t):o.textContent;return n!==void 0&&r!==null?nM(n,r):r??void 0}function CY(e,t){return e.getAttribute("type")==="password"&&t==="value"}function nM(e,t){const n=tM(e.value);if(n===void 0)return;const o=n.exec(t);if(o===null)return;const[r,i]=o;return i||r}async function EY(e){let t;try{t=await fetch(RY(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function RY(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${I$("rum",e)}/${hY}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function jY({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,o,r){const i=VZ(),l=H$();Fx(l,Vn.globalContext,i);const u=G$();Fx(u,Vn.userContext,i);const f=B$();Fx(f,Vn.accountContext,i);let m,p,g,v;const x=n.observable.subscribe(S),b={};function S(){if(!g||!v||!n.isGranted())return;x.unsubscribe();let N;if(v.trackViewsManually){if(!m)return;i.remove(m.callback),N=m.options}const T=r(v,p,N);i.drain(T)}function C(N){const T=Yc();if(T&&(N=NY(N)),g=N,bK(mY(N)),v){$$("DD_RUM",N);return}const k=uY(N);if(k){if(!T&&!k.sessionStoreStrategyType){ht.warn("No storage available for session. We will not send any data.");return}k.compressIntakeRequests&&!T&&t&&(p=t(k,"Datadog RUM",kt),!p)||(v=k,V$().subscribe(kt),n.tryToInit(k.trackingConsent),S())}}const E=N=>{i.add(T=>T.addDurationVital(N))};return{init(N,T){if(!N){ht.error("Missing configuration");return}F7(N.enableExperimentalFeatures),g=N,!(e&&z$())&&(X$(N.plugins,"onInit",{initConfiguration:N,publicApi:T}),N.remoteConfigurationId?gY(N,{user:u,context:l}).then(k=>{k&&C(k)}).catch(qc):C(N))},get initConfiguration(){return g},getInternalContext:kt,stopSession:kt,addTiming(N,T=Bn()){i.add(k=>k.addTiming(N,T))},startView(N,T=Gn()){const k=A=>{A.startView(N,T)};i.add(k),m||(m={options:N,callback:k},S())},setViewName(N){i.add(T=>T.setViewName(N))},setViewContext(N){i.add(T=>T.setViewContext(N))},setViewContextProperty(N,T){i.add(k=>k.setViewContextProperty(N,T))},getViewContext:()=>b,globalContext:l,userContext:u,accountContext:f,addAction(N){i.add(T=>T.addAction(N))},addError(N){i.add(T=>T.addError(N))},addFeatureFlagEvaluation(N,T){i.add(k=>k.addFeatureFlagEvaluation(N,T))},startDurationVital(N,T){return Z$(o,N,T)},stopDurationVital(N,T){Y$(E,o,N,T)},addDurationVital:E}}function NY(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Lf())===null||n===void 0?void 0:n.getPrivacyLevel()}}function Fx(e,t,n){e.changeObservable.subscribe(()=>{const o=e.getContext();n.add(r=>r[t].setContext(o))})}function kY(e,t,n,o={}){const r=TK(),i=eY(),l=QZ().observable;let u=jY(o,r,i,(g,v,x)=>{const b=e(g,t,n,x,v&&o.createDeflateEncoder?S=>o.createDeflateEncoder(g,v,S):xZ,r,i,l,o.sdkName);return t.onRumStart(b.lifeCycle,g,b.session,b.viewHistory,v,b.telemetry),n.onRumStart(b.lifeCycle,b.hooks,g,b.session,b.viewHistory),u=TY(u,b),X$(g.plugins,"onRumStart",{strategy:u,addEvent:b.addEvent}),b});const f=()=>u,m=tt(g=>{const v=typeof g=="object"?g:{name:g};u.startView(v),vr({feature:"start-view"})}),p=tZ({init:tt(g=>{u.init(g,p)}),setTrackingConsent:tt(g=>{r.update(g),vr({feature:"set-tracking-consent",tracking_consent:g})}),setViewName:tt(g=>{u.setViewName(g),vr({feature:"set-view-name"})}),setViewContext:tt(g=>{u.setViewContext(g),vr({feature:"set-view-context"})}),setViewContextProperty:tt((g,v)=>{u.setViewContextProperty(g,v),vr({feature:"set-view-context-property"})}),getViewContext:tt(()=>(vr({feature:"set-view-context-property"}),u.getViewContext())),getInternalContext:tt(g=>u.getInternalContext(g)),getInitConfiguration:tt(()=>O0(u.initConfiguration)),addAction:(g,v)=>{const x=hf("action");Ya(()=>{u.addAction({name:fn(g),context:fn(v),startClocks:Gn(),type:F0.CUSTOM,handlingStack:x}),vr({feature:"add-action"})})},addError:(g,v)=>{const x=hf("error");Ya(()=>{u.addError({error:g,handlingStack:x,context:fn(v),startClocks:Gn()}),vr({feature:"add-error"})})},addTiming:tt((g,v)=>{u.addTiming(fn(g),v)}),setGlobalContext:hr(f,Vn.globalContext,pr.setContext,"set-global-context"),getGlobalContext:hr(f,Vn.globalContext,pr.getContext,"get-global-context"),setGlobalContextProperty:hr(f,Vn.globalContext,pr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:hr(f,Vn.globalContext,pr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:hr(f,Vn.globalContext,pr.clearContext,"clear-global-context"),setUser:hr(f,Vn.userContext,pr.setContext,"set-user"),getUser:hr(f,Vn.userContext,pr.getContext,"get-user"),setUserProperty:hr(f,Vn.userContext,pr.setContextProperty,"set-user-property"),removeUserProperty:hr(f,Vn.userContext,pr.removeContextProperty,"remove-user-property"),clearUser:hr(f,Vn.userContext,pr.clearContext,"clear-user"),setAccount:hr(f,Vn.accountContext,pr.setContext,"set-account"),getAccount:hr(f,Vn.accountContext,pr.getContext,"get-account"),setAccountProperty:hr(f,Vn.accountContext,pr.setContextProperty,"set-account-property"),removeAccountProperty:hr(f,Vn.accountContext,pr.removeContextProperty,"remove-account-property"),clearAccount:hr(f,Vn.accountContext,pr.clearContext,"clear-account"),startView:m,stopSession:tt(()=>{u.stopSession(),vr({feature:"stop-session"})}),addFeatureFlagEvaluation:tt((g,v)=>{u.addFeatureFlagEvaluation(fn(g),fn(v)),vr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:tt(()=>t.getSessionReplayLink()),startSessionReplayRecording:tt(g=>{t.start(g),vr({feature:"start-session-replay-recording",force:g&&g.force})}),stopSessionReplayRecording:tt(()=>t.stop()),addDurationVital:tt((g,v)=>{vr({feature:"add-duration-vital"}),u.addDurationVital({name:fn(g),type:K$.DURATION,startClocks:Fq(v.startTime),duration:v.duration,context:fn(v&&v.context),description:fn(v&&v.description)})}),startDurationVital:tt((g,v)=>(vr({feature:"start-duration-vital"}),u.startDurationVital(fn(g),{context:fn(v&&v.context),description:fn(v&&v.description)}))),stopDurationVital:tt((g,v)=>{vr({feature:"stop-duration-vital"}),u.stopDurationVital(typeof g=="string"?fn(g):g,{context:fn(v&&v.context),description:fn(v&&v.description)})})});return p}function TY(e,t){return{init:n=>{$$("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function OY(){const e=AY();return new bt(t=>{if(!e)return;const n=new e(tt(o=>t.notify(o)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function AY(){let e;const t=window;if(t.Zone&&(e=Ks(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(kt),o=Ks(n,"originalInstance");e=o&&o.constructor}return e||(e=t.MutationObserver),e}function IY(){const e=new bt,{stop:t}=_i(window,"open",()=>e.notify());return{observable:e,stop:t}}function $Y(e,t,n,o,r){return{get:i=>{const l=n.findView(i),u=r.findUrl(i),f=t.findTrackedSession(i);if(f&&l&&u){const m=o.findActionId(i);return{application_id:e,session_id:f.id,user_action:m?{id:m}:void 0,view:{id:l.id,name:l.name,referrer:u.referrer,url:u.url}}}}}}const MY=_Z,PY=cl;function DY(e){const t=xu({expireDelay:PY});e.subscribe(1,o=>{t.add(n(o),o.startClocks.relative)}),e.subscribe(6,({endClocks:o})=>{t.closeActive(o.relative)}),e.subscribe(3,o=>{const r=t.find(o.startClocks.relative);r&&(o.name&&(r.name=o.name),o.context&&(r.context=o.context),r.sessionIsActive=o.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(o){return{service:o.service,version:o.version,context:o.context,id:o.id,name:o.name,startClocks:o.startClocks}}return{findView:o=>t.find(o),stop:()=>{t.stop()}}}const rM="initial_document",zY=[[br.DOCUMENT,e=>rM===e],[br.XHR,e=>e==="xmlhttprequest"],[br.FETCH,e=>e==="fetch"],[br.BEACON,e=>e==="beacon"],[br.CSS,(e,t)=>/\.css$/i.test(t)],[br.JS,(e,t)=>/\.js$/i.test(t)],[br.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[br.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[br.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function UY(e){const t=e.name;if(!MK(t))return oa(`Failed to construct URL for "${e.name}"`),br.OTHER;const n=PK(t);for(const[o,r]of zY)if(r(e.initiatorType,n))return o;return br.OTHER}function Wk(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function oM(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function LY(e){const{duration:t,startTime:n,responseEnd:o}=e;return t===0&&n<o?en(n,o):t}function FY(e){if(!sM(e))return;const{startTime:t,fetchStart:n,workerStart:o,redirectStart:r,redirectEnd:i,domainLookupStart:l,domainLookupEnd:u,connectStart:f,secureConnectionStart:m,connectEnd:p,requestStart:g,responseStart:v,responseEnd:x}=e,b={download:Na(t,v,x),first_byte:Na(t,g,v)};return 0<o&&o<n&&(b.worker=Na(t,o,n)),n<p&&(b.connect=Na(t,f,p),f<=m&&m<=p&&(b.ssl=Na(t,m,p))),n<u&&(b.dns=Na(t,l,u)),t<i&&(b.redirect=Na(t,r,i)),b}function iM(e){return e.duration>=0}function sM(e){const t=Wk(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=VY(e)?Wk(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function VY(e){return e.redirectEnd>e.startTime}function Na(e,t,n){if(e<=t&&t<=n)return{duration:ot(en(t,n)),start:ot(en(e,t))}}function BY(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function HY(e){return e.deliveryType===""?"other":e.deliveryType}function GY(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:o}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:o}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function V0(e){return e&&(!BK(e)||qg(Xa.TRACK_INTAKE_REQUESTS))}const qY=/data:(.+)?(;base64)?,/g,KY=24e3;function ZY(e,t=KY){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(qY);return n?`${n[0]}[...]`:e}let Qk=1;function YY(e,t,n,o,r){const i=lY(t,n,o,r);XY(e,t,i),WY(e,i)}function XY(e,t,n){const o=SZ(t).subscribe(r=>{const i=r;if(V0(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=aM(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":n.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:Zg.XHR,url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack});break}});return{stop:()=>o.unsubscribe()}}function WY(e,t){const n=V$().subscribe(o=>{const r=o;if(V0(r.url))switch(r.state){case"start":t.traceFetch(r),r.requestIndex=aM(),e.notify(7,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":QY(r,i=>{t.clearTracingIfNeeded(r),e.notify(8,{duration:i,method:r.method,requestIndex:r.requestIndex,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:Zg.FETCH,url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack})});break}});return{stop:()=>n.unsubscribe()}}function aM(){const e=Qk;return Qk+=1,e}function QY(e,t){const n=e.response&&W7(e.response);!n||!n.body?t(en(e.startClocks.timeStamp,Bn())):XZ(n.body,()=>{t(en(e.startClocks.timeStamp,Bn()))},{bytesLimit:Number.POSITIVE_INFINITY})}function lM(e){return Mf(e)&&e<0?void 0:e}function cM({lifeCycle:e,isChildEvent:t,onChange:n=kt}){const o={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},r=e.subscribe(13,i=>{var l;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case it.ERROR:o.errorCount+=1,n();break;case it.ACTION:o.actionCount+=1,i.action.frustration&&(o.frustrationCount+=i.action.frustration.type.length),n();break;case it.LONG_TASK:o.longTaskCount+=1,n();break;case it.RESOURCE:!((l=i._dd)===null||l===void 0)&&l.discarded||(o.resourceCount+=1,n());break}});return{stop:()=>{r.unsubscribe()},eventCounts:o}}function JY(e,t){const n=Ro();let o=!1;const{stop:r}=Zs(e,window,["click","mousedown","keydown","touchstart","pointerdown"],u=>{if(!u.cancelable)return;const f={entryType:"first-input",processingStart:eo(),processingEnd:eo(),startTime:u.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};u.type==="pointerdown"?i(e,f):l(f)},{passive:!0,capture:!0});return{stop:r};function i(u,f){Zs(u,window,["pointerup","pointercancel"],m=>{m.type==="pointerup"&&l(f)},{once:!0})}function l(u){if(!o){o=!0,r();const f=u.processingStart-u.startTime;f>=0&&f<Ro()-n&&t(u)}}}var wt;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(wt||(wt={}));function Ci(e,t){return new bt(n=>{if(!window.PerformanceObserver)return;const o=f=>{const m=nX(f);m.length>0&&n.notify(m)};let r,i=!0;const l=new PerformanceObserver(tt(f=>{i?r=sr(()=>o(f.getEntries())):o(f.getEntries())}));try{l.observe(t)}catch{if([wt.RESOURCE,wt.NAVIGATION,wt.LONG_TASK,wt.PAINT].includes(t.type)){t.buffered&&(r=sr(()=>o(performance.getEntriesByType(t.type))));try{l.observe({entryTypes:[t.type]})}catch{return}}}i=!1,eX(e);let u;return!fl(wt.FIRST_INPUT)&&t.type===wt.FIRST_INPUT&&({stop:u}=JY(e,f=>{o([f])})),()=>{l.disconnect(),u&&u(),_o(r)}})}let Md;function eX(e){return!Md&&tX()&&"addEventListener"in performance&&(Md=Qt(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Md?.stop()}}function tX(){return window.performance!==void 0&&"getEntries"in performance}function fl(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function nX(e){return e.filter(t=>!rX(t))}function rX(e){return e.entryType===wt.RESOURCE&&(!V0(e.name)||!iM(e))}function uM(e){return e.nodeType===Node.TEXT_NODE}function oX(e){return e.nodeType===Node.COMMENT_NODE}function is(e){return e.nodeType===Node.ELEMENT_NODE}function dM(e){return is(e)&&!!e.shadowRoot}function iX(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&is(t.host)}function Ibe(e){return e.childNodes.length>0||dM(e)}function $be(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;dM(e)&&t(e.shadowRoot)}function sX(e){return iX(e)?e.host:e.parentNode}const fM=100,aX=100,Jk="data-dd-excluded-activity-mutations";function B0(e,t,n,o,r,i){const l=cX(e,t,n,o);return lX(l,r,i)}function lX(e,t,n){let o,r=!1;const i=sr(tt(()=>m({hadActivity:!1})),fM),l=n!==void 0?sr(tt(()=>m({hadActivity:!0,end:Bn()})),n):void 0,u=e.subscribe(({isBusy:p})=>{_o(i),_o(o);const g=Bn();p||(o=sr(tt(()=>m({hadActivity:!0,end:g})),aX))}),f=()=>{r=!0,_o(i),_o(o),_o(l),u.unsubscribe()};function m(p){r||(f(),t(p))}return{stop:f}}function cX(e,t,n,o){return new bt(r=>{const i=[];let l,u=0;return i.push(t.subscribe(m=>{m.every(uX)||f()}),n.subscribe(f),Ci(o,{type:wt.RESOURCE}).subscribe(m=>{m.some(p=>!Vx(o,p.name))&&f()}),e.subscribe(7,m=>{Vx(o,m.url)||(l===void 0&&(l=m.requestIndex),u+=1,f())}),e.subscribe(8,m=>{Vx(o,m.url)||l===void 0||m.requestIndex<l||(u-=1,f())})),()=>{i.forEach(m=>m.unsubscribe())};function f(){r.notify({isBusy:u>0})}})}function Vx(e,t){return M0(e.excludedActivityUrls,t)}function uX(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&is(t)&&t.matches(`[${Jk}], [${Jk}] *`))}const Et={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:nf.ALLOW,MASK:nf.MASK,MASK_USER_INPUT:nf.MASK_USER_INPUT},dX="data-dd-privacy",Mbe="hidden",fX="dd-privacy-",Bx="***",Pbe="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",mX={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},hX="x";function mM(e,t,n){if(n&&n.has(e))return n.get(e);const o=sX(e),r=o?mM(o,t,n):t,i=hM(e),l=pX(i,r);return n&&n.set(e,l),l}function pX(e,t){switch(t){case Et.HIDDEN:case Et.IGNORE:return t}switch(e){case Et.ALLOW:case Et.MASK:case Et.MASK_USER_INPUT:case Et.HIDDEN:case Et.IGNORE:return e;default:return t}}function hM(e){if(is(e)){if(e.tagName==="BASE")return Et.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return Et.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Et.MASK}if(e.matches(_c(Et.HIDDEN)))return Et.HIDDEN;if(e.matches(_c(Et.MASK)))return Et.MASK;if(e.matches(_c(Et.MASK_USER_INPUT)))return Et.MASK_USER_INPUT;if(e.matches(_c(Et.ALLOW)))return Et.ALLOW;if(vX(e))return Et.IGNORE}}function pM(e,t){switch(t){case Et.MASK:case Et.HIDDEN:case Et.IGNORE:return!0;case Et.MASK_USER_INPUT:return uM(e)?eT(e.parentNode):eT(e);default:return!1}}function eT(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!mX[t.tagName]}const gX=e=>e.replace(/\S/g,hX);function Dbe(e,t,n){var o;const r=(o=e.parentElement)===null||o===void 0?void 0:o.tagName;let i=e.textContent||"";if(t&&!i.trim())return;const l=n;if(r==="SCRIPT")i=Bx;else if(l===Et.HIDDEN)i=Bx;else if(pM(e,l))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=Bx:i=gX(i);return i}function vX(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),o=t("rel"),r=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||o==="icon"||o==="apple-touch-icon"||o==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(r)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(r)||/^product:/.test(r)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function _c(e){return`[${dX}="${e}"], .${fX}${e}`}const Yg="data-dd-action-name",yX="Masked Element";function bX(e,{enablePrivacyForActionName:t,actionNameAttribute:n},o=Et.ALLOW){const r=tT(e,Yg)||n&&tT(e,n);return r?{name:r,nameSource:"custom_attribute"}:o===Et.MASK?{name:yX,nameSource:"mask_placeholder"}:nT(e,n,xX,t)||nT(e,n,_X,t)||{name:"",nameSource:"blank"}}function tT(e,t){const n=e.closest(`[${t}]`);if(!n)return;const o=n.getAttribute(t);return vM(gM(o.trim()))}const xX=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return bp(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return bp(e,t,n)},e=>Pd(e,"aria-label"),(e,t,n)=>{const o=e.getAttribute("aria-labelledby");if(o)return{name:o.split(/\s+/).map(r=>SX(e,r)).filter(r=>!!r).map(r=>yM(r,t,n)).join(" "),nameSource:"text_content"}},e=>Pd(e,"alt"),e=>Pd(e,"name"),e=>Pd(e,"title"),e=>Pd(e,"placeholder"),(e,t,n)=>{if("options"in e&&e.options.length>0)return bp(e.options[0],t,n)}],_X=[(e,t,n)=>bp(e,t,n)],wX=10;function nT(e,t,n,o){let r=e,i=0;for(;i<=wX&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const l of n){const u=l(r,t,o);if(u){const{name:f,nameSource:m}=u,p=f&&f.trim();if(p)return{name:vM(gM(p)),nameSource:m}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function gM(e){return e.replace(/\s+/g," ")}function vM(e){return e.length>100?`${QI(e,100)} [...]`:e}function SX(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Pd(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function bp(e,t,n){return{name:yM(e,t,n)||"",nameSource:"text_content"}}function yM(e,t,n){if(!e.isContentEditable){if(qg(Xa.USE_TREE_WALKER_FOR_ACTION_NAME))return CX(e,t,n);if("innerText"in e){let o=e.innerText;const r=i=>{const l=e.querySelectorAll(i);for(let u=0;u<l.length;u+=1){const f=l[u];if("innerText"in f){const m=f.innerText;m&&m.trim().length>0&&(o=o.replace(m,""))}}};return r(`[${Yg}]`),t&&r(`[${t}]`),n&&r(`${_c(Et.HIDDEN)}, ${_c(Et.MASK)}`),o}return e.textContent}}function CX(e,t,n){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,i);let r="";for(;o.nextNode();){const l=o.currentNode;if(is(l)){(l.nodeName==="BR"||l.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(l).display))&&(r+=" ");continue}r+=l.textContent||""}return r.replace(/\s+/g," ").trim();function i(l){if(is(l)){const u=hM(l);if(l.hasAttribute(Yg)||t&&l.hasAttribute(t)||n&&u&&pM(l,u))return NodeFilter.FILTER_REJECT;const f=getComputedStyle(l);if(f.visibility!=="visible"||f.display==="none"||f.contentVisibility&&f.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}const EX=[Yg,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],RX=[xM,NX],jX=[xM,kX,TX];function Ff(e,t){if(!e.isConnected)return;let n,o=e;for(;o&&o.nodeName!=="HTML";){const r=rT(o,RX,AX,t,n);if(r)return r;n=rT(o,jX,IX,t,n)||Xg(OX(o),n),o=o.parentElement}return n}function bM(e){return/[0-9]/.test(e)}function NX(e){if(e.id&&!bM(e.id))return`#${CSS.escape(e.id)}`}function kX(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const o=t[n];if(!bM(o))return`${CSS.escape(e.tagName)}.${CSS.escape(o)}`}}function TX(e){return CSS.escape(e.tagName)}function xM(e,t){if(t){const o=n(t);if(o)return o}for(const o of EX){const r=n(o);if(r)return r}function n(o){if(e.hasAttribute(o))return`${CSS.escape(e.tagName)}[${o}="${CSS.escape(e.getAttribute(o))}"]`}}function OX(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function rT(e,t,n,o,r){for(const i of t){const l=i(e,o);if(l&&n(e,l,r))return Xg(l,r)}}function AX(e,t,n){return e.ownerDocument.querySelectorAll(Xg(t,n)).length===1}function IX(e,t,n){let o;if(n===void 0)o=l=>l.matches(t);else{const l=Xg(`${t}:scope`,n);o=u=>u.querySelector(l)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&o(i))return!1;i=i.nextElementSibling}return!0}function Xg(e,t){return t?`${e}>${t}`:e}const _M=cr,$X=100;function MX(e,t){const n=[];let o=0,r;i(e);function i(f){f.stopObservable.subscribe(l),n.push(f),_o(r),r=sr(u,_M)}function l(){o===1&&n.every(f=>f.isStopped())&&(o=2,t(n))}function u(){_o(r),o===0&&(o=1,l())}return{tryAppend:f=>o!==0?!1:n.length>0&&!PX(n[n.length-1].event,f.event)?(u(),!1):(i(f),!0),stop:()=>{u()}}}function PX(e,t){return e.target===t.target&&DX(e,t)<=$X&&e.timeStamp-t.timeStamp<=_M}function DX(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function zX(e,{onPointerDown:t,onPointerUp:n}){let o,r={selection:!1,input:!1,scroll:!1},i;const l=[Qt(e,window,"pointerdown",u=>{iT(u)&&(o=oT(),r={selection:!1,input:!1,scroll:!1},i=t(u))},{capture:!0}),Qt(e,window,"selectionchange",()=>{(!o||!oT())&&(r.selection=!0)},{capture:!0}),Qt(e,window,"scroll",()=>{r.scroll=!0},{capture:!0,passive:!0}),Qt(e,window,"pointerup",u=>{if(iT(u)&&i){const f=r;n(i,u,()=>f),i=void 0}},{capture:!0}),Qt(e,window,"input",()=>{r.input=!0},{capture:!0})];return{stop:()=>{l.forEach(u=>u.stop())}}}function oT(){const e=window.getSelection();return!e||e.isCollapsed}function iT(e){return e.target instanceof Element&&e.isPrimary!==!1}const sT=3;function UX(e,t){if(LX(e))return t.addFrustration($d.RAGE_CLICK),e.some(aT)&&t.addFrustration($d.DEAD_CLICK),t.hasError&&t.addFrustration($d.ERROR_CLICK),{isRage:!0};const n=e.some(o=>o.getUserActivity().selection);return e.forEach(o=>{o.hasError&&o.addFrustration($d.ERROR_CLICK),aT(o)&&!n&&o.addFrustration($d.DEAD_CLICK)}),{isRage:!1}}function LX(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(sT-1);t+=1)if(e[t+sT-1].event.timeStamp-e[t].event.timeStamp<=cr)return!0;return!1}const FX='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function aT(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(FX)}const wM=10*cr,rf=new Map;function VX(e){const t=rf.get(e);return rf.delete(e),t}function SM(e,t){rf.set(e,t),rf.forEach((n,o)=>{en(o,eo())>wM&&rf.delete(o)})}const BX=5*Mr;function HX(e,t,n,o){const r=xu({expireDelay:BX}),i=new bt;let l;e.subscribe(10,()=>{r.reset()}),e.subscribe(5,p),e.subscribe(11,g=>{g.reason===jc.UNLOADING&&p()});const{stop:u}=zX(o,{onPointerDown:g=>GX(o,e,t,g,n),onPointerUp:({clickActionBase:g,hadActivityOnPointerDown:v},x,b)=>{qX(o,e,t,n,r,i,m,g,x,b,v)}});return{stop:()=>{p(),i.notify(),u()},actionContexts:{findActionId:g=>r.findAll(g)}};function m(g){if(!l||!l.tryAppend(g)){const v=g.clone();l=MX(g,x=>{ZX(x,v)})}}function p(){l&&l.stop()}}function GX(e,t,n,o,r){const i=e.enablePrivacyForActionName?mM(o.target,e.defaultPrivacyLevel):Et.ALLOW;if(i===Et.HIDDEN)return;const l=KX(o,i,e);let u=!1;return B0(t,n,r,e,f=>{u=f.hadActivity},fM),{clickActionBase:l,hadActivityOnPointerDown:()=>u}}function qX(e,t,n,o,r,i,l,u,f,m,p){var g;const v=CM(t,r,m,u,f);l(v);const x=(g=u?.target)===null||g===void 0?void 0:g.selector;x&&SM(f.timeStamp,x);const{stop:b}=B0(t,n,o,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},wM),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=i.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),b(),C.unsubscribe()})}function KX(e,t,n){const o=e.target.getBoundingClientRect(),r=Ff(e.target,n.actionNameAttribute);r&&SM(e.timeStamp,r);const i=bX(e.target,n,t);return{type:F0.CLICK,target:{width:Math.round(o.width),height:Math.round(o.height),selector:r},position:{x:Math.round(e.clientX-o.left),y:Math.round(e.clientY-o.top)},name:i.name,nameSource:i.nameSource}}function CM(e,t,n,o,r){const i=ur(),l=Gn(),u=t.add(i,l.relative),f=cM({lifeCycle:e,isChildEvent:b=>b.action!==void 0&&(Array.isArray(b.action.id)?b.action.id.includes(i):b.action.id===i)});let m=0,p;const g=[],v=new bt;function x(b){m===0&&(p=b,m=1,p?u.close(R0(p)):u.remove(),f.stop(),v.notify())}return{event:r,stop:x,stopObservable:v,get hasError(){return f.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:b=>{g.push(b)},startClocks:l,isStopped:()=>m===1||m===2,clone:()=>CM(e,t,n,o,r),validate:b=>{if(x(),m!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=f.eventCounts,j={duration:p&&en(l.timeStamp,p),startClocks:l,id:i,frustrationTypes:g,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:b??[r],event:r,...o};e.notify(0,j),m=2},discard:()=>{x(),m=2}}}function ZX(e,t){const{isRage:n}=UX(e,t);n?(e.forEach(o=>o.discard()),t.stop(Bn()),t.validate(e.map(o=>o.event))):(t.discard(),e.forEach(o=>o.validate()))}function YX(e,t,n,o,r){e.subscribe(0,u=>e.notify(12,lT(u))),t.register(0,({startTime:u,eventType:f})=>{if(f!==it.ERROR&&f!==it.RESOURCE&&f!==it.LONG_TASK)return to;const m=i.findActionId(u);return m?{type:f,action:{id:m}}:to}),t.register(1,({startTime:u})=>({action:{id:i.findActionId(u)}}));let i={findActionId:kt},l=kt;return r.trackUserInteractions&&({actionContexts:i,stop:l}=HX(e,n,o,r)),{addAction:u=>{e.notify(12,lT(u))},actionContexts:i,stop:l}}function lT(e){const t=Hx(e)?{action:{id:e.id,loading_time:lM(ot(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=os({action:{id:ur(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:it.ACTION},t),o=Hx(e)?e.duration:void 0,r=Hx(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:o,startTime:e.startClocks.relative,domainContext:r}}function Hx(e){return e.type!==F0.CUSTOM}function XX(e){const t=DZ([Ug.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function WX(e,t){const n=rZ(e,[pf.cspViolation,pf.intervention]).subscribe(o=>t.notify(o));return{stop:()=>{n.unsubscribe()}}}function QX(e,t,n){const o=new bt;return n.subscribe(r=>{r.type===0&&o.notify(r.error)}),XX(o),WX(t,o),o.subscribe(r=>e.notify(14,{error:r})),JX(e)}function JX(e){return e.subscribe(14,({error:t})=>{e.notify(12,eW(t))}),{addError:({error:t,handlingStack:n,componentStack:o,startClocks:r,context:i})=>{const l=k0({originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:"Provided",source:yu.CUSTOM,handling:"handled"});l.context=os(l.context,i),e.notify(14,{error:l})}}}function eW(e){const t={date:e.startClocks.timeStamp,error:{id:ur(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:it.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const cT=new WeakSet;function tW(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(o=>!cT.has(o)).filter(o=>iM(o)&&sM(o)).filter(o=>nW(o,e.startClocks.relative,EM({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return cT.add(n[0]),n[0].toJSON()}function EM(e){return pu(e.startTime,e.duration)}function nW(e,t,n){return e.startTime>=t-1&&EM(e)<=pu(n,1)}const rW=2*Mr;function oW(e){const t=iW(e)||sW(e);if(!(!t||t.traceTime<=Ro()-rW))return t.traceId}function iW(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return RM(t&&t.content,n&&n.content)}function sW(e){const t=aW(e);if(t)return RM(ff(t,"trace-id"),ff(t,"trace-time"))}function RM(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function aW(e){for(let t=0;t<e.childNodes.length;t+=1){const n=uT(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],o=uT(n);if(o)return o;if(!uM(n))break}}function uT(e){if(e&&oX(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function jM(){if(fl(wt.NAVIGATION)){const n=performance.getEntriesByType(wt.NAVIGATION)[0];if(n)return n}const e=lW(),t={entryType:wt.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function lW(){const e={},t=performance.timing;for(const n in t)if(Mf(t[n])){const o=n,r=t[o];e[o]=r===0?0:R0(r)}return e}function cW(e,t,n=jM){z0(e,"interactive",()=>{const o=n(),r=Object.assign(o.toJSON(),{entryType:wt.RESOURCE,initiatorType:rM,duration:o.responseEnd,traceId:oW(document),toJSON:()=>({...r,toJSON:void 0})});t(r)})}const uW=1e3;function dW(e){const t=new Set,n=e.subscribe(8,o=>{t.add(o),t.size>uW&&(oa("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(o){let r=1/0,i;for(const l of t){const u=o.startTime-l.startClocks.relative;0<=u&&u<r&&l.url===o.name&&(r=Math.abs(u),i=l)}return i&&t.delete(i),i},stop(){n.unsubscribe()}}}function fW(e,t,n,o=PZ(),r=cW){let i;const l=qg(Xa.EARLY_REQUEST_COLLECTION);l?i=dW(e):e.subscribe(8,m=>{f(()=>mW(m,t,n))});const u=Ci(t,{type:wt.RESOURCE,buffered:!0}).subscribe(m=>{for(const p of m)(l||!oM(p))&&f(()=>dT(p,t,n,i))});r(t,m=>{f(()=>dT(m,t,n,i))});function f(m){o.push(()=>{const p=m();p&&e.notify(12,p)})}return{stop:()=>{u.unsubscribe()}}}function mW(e,t,n){const o=tW(e);return NM(o,e,n,t)}function dT(e,t,n,o){const r=oM(e)&&o?o.getMatchingRequest(e):void 0;return NM(e,r,n,t)}function NM(e,t,n,o){if(!e&&!t)return;const r=t?gW(t,o):vW(e,o);if(!o.trackResources&&!r)return;const i=e?Fg(e.startTime):t.startClocks,l=e?LY(e):yW(n,i,t.duration),u=os({date:i.timeStamp,resource:{id:ur(),duration:ot(l),type:t?t.type===Zg.XHR?br.XHR:br.FETCH:UY(e),method:t?t.method:void 0,status_code:t?t.status:bW(e.responseStatus),url:t?ZY(t.url):e.name,protocol:e&&BY(e),delivery_type:e&&HY(e)},type:it.RESOURCE,_dd:{discarded:!o.trackResources}},r,e&&pW(e));return{startTime:i.relative,duration:l,rawRumEvent:u,domainContext:hW(e,t)}}function hW(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Zg.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function pW(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...GY(e),...FY(e)}}}function gW(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function vW(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Q$().toString(),rule_psr:t.rulePsr}}}function yW(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function bW(e){return e===0?void 0:e}function xW(e,t,n){const{stop:o,eventCounts:r}=cM({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:o,eventCounts:r}}const _W=10*Mr;function wW(e,t,n){return{stop:Ci(e,{type:wt.PAINT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.name==="first-contentful-paint"&&l.startTime<t.timeStamp&&l.startTime<_W);i&&n(i.startTime)}).unsubscribe}}function SW(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(en(e,eo()))})})}function CW(e,t,n){const o=Ci(e,{type:wt.FIRST_INPUT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.startTime<t.timeStamp);if(i){const l=en(i.startTime,i.processingStart);let u;i.target&&is(i.target)&&(u=Ff(i.target,e.actionNameAttribute)),n({delay:l>=0?l:0,time:i.startTime,targetSelector:u})}});return{stop:()=>{o.unsubscribe()}}}function EW(e,t,n=jM){return NW(e,()=>{const o=n();jW(o)||t(RW(o))})}function RW(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=eo()?e.responseStart:void 0}}function jW(e){return e.loadEventEnd<=0}function NW(e,t){let n;const{stop:o}=z0(e,"complete",()=>{n=sr(()=>t())});return{stop:()=>{o(),_o(n)}}}const kW=10*Mr;function TW(e,t,n,o){let r=1/0;const{stop:i}=Zs(e,n,["pointerdown","keydown"],f=>{r=f.timeStamp},{capture:!0,once:!0});let l=0;const u=Ci(e,{type:wt.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(f=>{const m=e7(f,p=>p.entryType===wt.LARGEST_CONTENTFUL_PAINT&&p.startTime<r&&p.startTime<t.timeStamp&&p.startTime<kW&&p.size>l);if(m){let p;m.element&&(p=Ff(m.element,e.actionNameAttribute)),o({value:m.startTime,targetSelector:p,resourceUrl:OW(m)}),l=m.size}});return{stop:()=>{i(),u.unsubscribe()}}}function OW(e){return e.url===""?void 0:e.url}function kM(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:kt};if(fl(wt.VISIBILITY_STATE)){const i=performance.getEntriesByType(wt.VISIBILITY_STATE).filter(l=>l.name==="hidden").find(l=>l.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:kt}}let o=1/0;const{stop:r}=Zs(e,n,["pagehide","visibilitychange"],i=>{(i.type==="pagehide"||document.visibilityState==="hidden")&&(o=i.timeStamp,r())},{capture:!0});return{get timeStamp(){return o},stop:r}}function AW(e,t,n,o){const r={},{stop:i}=EW(e,g=>{n(g.loadEvent),r.navigationTimings=g,o()}),l=kM(e,t),{stop:u}=wW(e,l,g=>{r.firstContentfulPaint=g,o()}),{stop:f}=TW(e,l,window,g=>{r.largestContentfulPaint=g,o()}),{stop:m}=CW(e,l,g=>{r.firstInput=g,o()});function p(){i(),u(),f(),m(),l.stop()}return{stop:p,initialViewMetrics:r}}const mw=(e,t)=>e*t,IW=(e,t)=>{const n=Math.max(e.left,t.left),o=Math.max(e.top,t.top),r=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return n>=r||o>=i?0:mw(r-n,i-o)},fT=e=>{const t=mw(e.previousRect.width,e.previousRect.height),n=mw(e.currentRect.width,e.currentRect.height),o=IW(e.previousRect,e.currentRect);return t+n-o};function $W(e,t,n){if(!UW())return{stop:kt};let o=0,r;n({value:0});const i=zW(),l=Ci(e,{type:wt.LAYOUT_SHIFT,buffered:!0}).subscribe(u=>{var f;for(const m of u){if(m.hadRecentInput||m.startTime<t)continue;const{cumulatedValue:p,isMaxValue:g}=i.update(m);if(g){const v=MW(m.sources);r={target:v?.node?new WeakRef(v.node):void 0,time:en(t,m.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>o){o=p;const v=(f=r?.target)===null||f===void 0?void 0:f.deref();n({value:ef(o,4),targetSelector:v&&Ff(v,e.actionNameAttribute),time:r?.time,previousRect:r?.previousRect?mT(r.previousRect):void 0,currentRect:r?.currentRect?mT(r.currentRect):void 0,devicePixelRatio:r?.devicePixelRatio})}}});return{stop:()=>{l.unsubscribe()}}}function MW(e){let t;for(const n of e)if(n.node&&is(n.node)){const o=fT(n);(!t||fT(t)<o)&&(t=n)}return t}function mT({x:e,y:t,width:n,height:o}){return{x:e,y:t,width:n,height:o}}const PW=5*cr,DW=cr;function zW(){let e=0,t,n,o=0;return{update:r=>{const i=t===void 0||r.startTime-n>=DW||r.startTime-t>=PW;let l;return i?(t=n=r.startTime,o=e=r.value,l=!0):(e+=r.value,n=r.startTime,l=r.value>o,l&&(o=r.value)),{cumulatedValue:e,isMaxValue:l}}}}function UW(){return fl(wt.LAYOUT_SHIFT)&&"WeakRef"in window}let xp,TM=0,Gx=1/0,qx=0;function LW(){"interactionCount"in performance||xp||(xp=new window.PerformanceObserver(tt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(Gx=Math.min(Gx,n.interactionId),qx=Math.max(qx,n.interactionId),TM=(qx-Gx)/7+1)})})),xp.observe({type:"event",buffered:!0,durationThreshold:0}))}const hT=()=>xp?TM:window.performance.interactionCount||0,pT=10,FW=1*Mr;function VW(e,t,n){if(!GW())return{getInteractionToNextPaint:()=>{},setViewEnd:kt,stop:kt};const{getViewInteractionCount:o,stopViewInteractionCount:r}=HW(n);let i=1/0;const l=BW(o);let u=-1,f,m;function p(x){for(const S of x)S.interactionId&&S.startTime>=t&&S.startTime<=i&&l.process(S);const b=l.estimateP98Interaction();b&&b.duration!==u&&(u=b.duration,m=en(t,b.startTime),f=VX(b.startTime),!f&&b.target&&is(b.target)&&(f=Ff(b.target,e.actionNameAttribute)))}const g=Ci(e,{type:wt.FIRST_INPUT,buffered:!0}).subscribe(p),v=Ci(e,{type:wt.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(u>=0)return{value:Math.min(u,FW),targetSelector:f,time:m};if(o())return{value:0}},setViewEnd:x=>{i=x,r()},stop:()=>{v.unsubscribe(),g.unsubscribe()}}}function BW(e){const t=[];function n(){t.sort((o,r)=>r.duration-o.duration).splice(pT)}return{process(o){const r=t.findIndex(l=>o.interactionId===l.interactionId),i=t[t.length-1];r!==-1?o.duration>t[r].duration&&(t[r]=o,n()):(t.length<pT||o.duration>i.duration)&&(t.push(o),n())},estimateP98Interaction(){const o=Math.min(t.length-1,Math.floor(e()/50));return t[o]}}}function HW(e){LW();const t=e===Wi.INITIAL_LOAD?0:hT();let n={stopped:!1};function o(){return hT()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:o(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:o()}}}}function GW(){return fl(wt.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function qW(e,t,n,o,r,i,l){let u=r===Wi.INITIAL_LOAD,f=!0;const m=[],p=kM(o,i);function g(){if(!f&&!u&&m.length>0){const x=Math.max(...m);x<p.timeStamp-i.relative&&l(x)}}const{stop:v}=B0(e,t,n,o,x=>{f&&(f=!1,x.hadActivity&&m.push(en(i.timeStamp,x.end)),g())});return{stop:()=>{v(),p.stop()},setLoadEvent:x=>{u&&(u=!1,m.push(x),g())}}}function zbe(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function KW(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let Kx;function ZW(e){return Kx||(Kx=YW(e)),Kx}function YW(e){return new bt(t=>{const{throttled:n}=Bg(()=>{t.notify(H0())},200);return Qt(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function H0(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const XW=cr;function WW(e,t,n,o=JW(e)){let r=0,i=0,l=0;const u=o.subscribe(({scrollDepth:f,scrollTop:m,scrollHeight:p})=>{let g=!1;if(f>r&&(r=f,g=!0),p>i){i=p;const v=eo();l=en(t.relative,v),g=!0}g&&n({maxDepth:Math.min(r,i),maxDepthScrollTop:m,maxScrollHeight:i,maxScrollHeightTime:l})});return{stop:()=>u.unsubscribe()}}function QW(){const e=KW(),{height:t}=H0(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),o=Math.round(t+e);return{scrollHeight:n,scrollDepth:o,scrollTop:e}}function JW(e,t=XW){return new bt(n=>{function o(){n.notify(QW())}if(window.ResizeObserver){const r=Bg(o,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,l=new ResizeObserver(tt(r.throttled));i&&l.observe(i);const u=Qt(e,window,"scroll",r.throttled,{passive:!0});return()=>{r.cancel(),l.disconnect(),u.stop()}}})}function eQ(e,t,n,o,r,i,l){const u={},{stop:f,setLoadEvent:m}=qW(e,t,n,o,i,l,S=>{u.loadingTime=S,r()}),{stop:p}=WW(o,l,S=>{u.scroll=S}),{stop:g}=$W(o,l.relative,S=>{u.cumulativeLayoutShift=S,r()}),{stop:v,getInteractionToNextPaint:x,setViewEnd:b}=VW(o,l.relative,i);return{stop:()=>{f(),g(),p()},stopINPTracking:v,setLoadEvent:m,setViewEnd:b,getCommonViewMetrics:()=>(u.interactionToNextPaint=x(),u)}}function tQ(e,t){const{stop:n}=Qt(e,window,"pageshow",o=>{o.persisted&&t(o)},{capture:!0});return n}function nQ(e,t,n){SW(e.relative,o=>{t.firstContentfulPaint=o,t.largestContentfulPaint={value:o},n()})}const rQ=3e3,oQ=5*Mr,iQ=5*Mr;function sQ(e,t,n,o,r,i,l,u){const f=new Set;let m=v(Wi.INITIAL_LOAD,GI(),u),p;x();let g;l&&(g=b(i),r.trackBfcacheViews&&(p=tQ(r,S=>{m.end();const C=Fg(S.timeStamp);m=v(Wi.BF_CACHE,C,void 0)})));function v(S,C,E){const j=aQ(t,n,o,r,e,S,C,E);return f.add(j),j.stopObservable.subscribe(()=>{f.delete(j)}),j}function x(){t.subscribe(10,()=>{m=v(Wi.ROUTE_CHANGE,void 0,{name:m.name,service:m.service,version:m.version,context:m.contextManager.getContext()})}),t.subscribe(9,()=>{m.end({sessionIsActive:!1})})}function b(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{cQ(C,E)&&(m.end(),m=v(Wi.ROUTE_CHANGE))})}return{addTiming:(S,C=Bn())=>{m.addTiming(S,C)},startView:(S,C)=>{m.end({endClocks:C}),m=v(Wi.ROUTE_CHANGE,C,S)},setViewContext:S=>{m.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{m.contextManager.setContextProperty(S,C)},setViewName:S=>{m.setViewName(S)},getViewContext:()=>m.contextManager.getContext(),stop:()=>{g&&g.unsubscribe(),p&&p(),m.end(),f.forEach(S=>S.stop())}}}function aQ(e,t,n,o,r,i,l=Gn(),u){const f=ur(),m=new bt,p={};let g=0,v;const x=df(r),b=Kg();let S=!0,C=u?.name;const E=u?.service||o.service,j=u?.version||o.version,N=u?.context;N&&b.setContext(N);const T={id:f,name:C,startClocks:l,service:E,version:j,context:N};e.notify(1,T),e.notify(2,T);const{throttled:k,cancel:A}=Bg(M,rQ,{leading:!1}),{setLoadEvent:I,setViewEnd:P,stop:F,stopINPTracking:L,getCommonViewMetrics:se}=eQ(e,t,n,o,re,i,l),{stop:te,initialViewMetrics:ce}=i===Wi.INITIAL_LOAD?AW(o,l,I,re):{stop:kt,initialViewMetrics:{}};i===Wi.BF_CACHE&&nQ(l,ce,re);const{stop:ae,eventCounts:ie}=xW(e,f,re),$=gu(M,oQ),K=e.subscribe(11,H=>{H.reason===jc.UNLOADING&&M()});M(),b.changeObservable.subscribe(re);function U(){e.notify(3,{id:f,name:C,context:b.getContext(),startClocks:l,sessionIsActive:S})}function re(){U(),k()}function M(){A(),U(),g+=1;const H=v===void 0?Bn():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:g,id:f,name:C,service:E,version:j,context:b.getContext(),loadingType:i,location:x,startClocks:l,commonViewMetrics:se(),initialViewMetrics:ce,duration:en(l.timeStamp,H),isActive:v===void 0,sessionIsActive:S,eventCounts:ie})}return{get name(){return C},service:E,version:j,contextManager:b,stopObservable:m,end(H={}){var le,B;v||(v=(le=H.endClocks)!==null&&le!==void 0?le:Gn(),S=(B=H.sessionIsActive)!==null&&B!==void 0?B:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Vg($),P(v.relative),F(),K.unsubscribe(),M(),sr(()=>{this.stop()},iQ))},stop(){te(),ae(),L(),m.notify()},addTiming(H,le){if(v)return;const B=Gq(le)?le:en(l.timeStamp,le);p[lQ(H)]=B,re()},setViewName(H){C=H,M()}}}function lQ(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&ht.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function cQ(e,t){return e.pathname!==t.pathname||!uQ(t.hash)&&gT(t.hash)!==gT(e.hash)}function uQ(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function gT(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function dQ(e,t,n,o,r,i,l,u,f,m){return e.subscribe(4,p=>e.notify(12,fQ(p,n,u))),t.register(0,({startTime:p,eventType:g})=>{const v=f.findView(p);return v?{type:g,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:Ys}),t.register(1,({startTime:p})=>{var g;return{view:{id:(g=f.findView(p))===null||g===void 0?void 0:g.id}}}),sQ(o,e,r,i,n,l,!n.trackViewsManually,m)}function fQ(e,t,n){var o,r,i,l,u,f,m,p,g,v,x,b,S,C,E,j,N,T;const k=n.getReplayStats(e.id),A=(r=(o=e.commonViewMetrics)===null||o===void 0?void 0:o.cumulativeLayoutShift)===null||r===void 0?void 0:r.devicePixelRatio,I={_dd:{document_version:e.documentVersion,replay_stats:k,cls:A?{device_pixel_ratio:A}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:it.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:ot((l=e.commonViewMetrics.cumulativeLayoutShift)===null||l===void 0?void 0:l.time),cumulative_layout_shift_target_selector:(u=e.commonViewMetrics.cumulativeLayoutShift)===null||u===void 0?void 0:u.targetSelector,first_byte:ot((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.firstByte),dom_complete:ot((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domComplete),dom_content_loaded:ot((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:ot((g=e.initialViewMetrics.navigationTimings)===null||g===void 0?void 0:g.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:ot(e.initialViewMetrics.firstContentfulPaint),first_input_delay:ot((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:ot((x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.time),first_input_target_selector:(b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.targetSelector,interaction_to_next_paint:ot((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:ot((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:ot((j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.value),largest_contentful_paint_target_selector:(N=e.initialViewMetrics.largestContentfulPaint)===null||N===void 0?void 0:N.targetSelector,load_event:ot((T=e.initialViewMetrics.navigationTimings)===null||T===void 0?void 0:T.loadEvent),loading_time:lM(ot(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:mQ(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:ot(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:ot(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:JZ()}};return ll(e.customTimings)||(I.view.custom_timings=ZI(e.customTimings,ot)),{rawRumEvent:I,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function mQ({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:o,largestContentfulPaint:r}){return{cls:e&&{score:e.value,timestamp:ot(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:ot(n)},fid:o&&{duration:ot(o.delay),timestamp:ot(o.time),target_selector:o.targetSelector},inp:t&&{duration:ot(t.value),timestamp:ot(t.time),target_selector:t.targetSelector},lcp:r&&{timestamp:ot(r.value),target_selector:r.targetSelector,resource_url:r.resourceUrl}}}const hQ="rum";function pQ(e,t,n){const o=pZ(e,hQ,r=>vQ(e,r),n);return o.expireObservable.subscribe(()=>{t.notify(9)}),o.renewObservable.subscribe(()=>{t.notify(10)}),o.sessionStateUpdateObservable.subscribe(({previousState:r,newState:i})=>{if(!r.forcedReplay&&i.forcedReplay){const l=o.findSession();l&&(l.isReplayForced=!0)}}),{findTrackedSession:r=>{const i=o.findSession(r);if(!(!i||i.trackingType==="0"))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:o.expire,expireObservable:o.expireObservable,setForcedReplay:()=>o.updateSessionState({forcedReplay:"1"})}}function gQ(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:j$("records")?1:0};return{findTrackedSession:()=>e,expire:kt,expireObservable:new bt,setForcedReplay:kt}}function vQ(e,t){return yQ(t)?t:ts(e.sessionSampleRate)?ts(e.sessionReplaySampleRate)?"1":"2":"0"}function yQ(e){return e==="0"||e==="1"||e==="2"}function bQ(e,t,n,o,r,i){const l=[e.rumEndpointBuilder];e.replica&&l.push(e.replica.rumEndpointBuilder);const u=N$({encoder:i(2),request:R$(l,e.batchBytesLimit,n),flushController:k$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:o,sessionExpireObservable:r}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,f=>{f.type===it.VIEW?u.upsert(f,f.view.id):u.add(f)}),u}function xQ(e){const t=Lf();e.subscribe(13,n=>{t.send("rum",n)})}const _Q=cl;function wQ(e,t,n,o){const r=xu({expireDelay:_Q});let i;e.subscribe(1,({startClocks:f})=>{const m=o.href;r.add(u({url:m,referrer:i||document.referrer}),f.relative),i=m}),e.subscribe(6,({endClocks:f})=>{r.closeActive(f.relative)});const l=n.subscribe(({newLocation:f})=>{const m=r.find();if(m){const p=eo();r.closeActive(p),r.add(u({url:f.href,referrer:m.referrer}),p)}});function u({url:f,referrer:m}){return{url:f,referrer:m}}return t.register(0,({startTime:f,eventType:m})=>{const p=r.find(f);return p?{type:m,view:{url:p.url,referrer:p.referrer}}:Ys}),{findUrl:f=>r.find(f),stop:()=>{l.unsubscribe(),r.stop()}}}function SQ(e,t){let n=df(t);return new bt(o=>{const{stop:r}=CQ(e,l),{stop:i}=EQ(e,l);function l(){if(n.href===t.href)return;const u=df(t);o.notify({newLocation:u,oldLocation:n}),n=u}return()=>{r(),i()}})}function CQ(e,t){const{stop:n}=_i(vT("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:o}=_i(vT("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:r}=Qt(e,window,"popstate",t);return{stop:()=>{n(),o(),r()}}}function EQ(e,t){return Qt(e,window,"hashchange",t)}function vT(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const RQ=cl;function jQ(e,t,n){const o=xu({expireDelay:RQ});return e.subscribe(1,({startClocks:r})=>{o.add({},r.relative)}),e.subscribe(6,({endClocks:r})=>{o.closeActive(r.relative)}),t.register(0,({startTime:r,eventType:i})=>{if(!n.trackFeatureFlagsForEvents.concat([it.VIEW,it.ERROR]).includes(i))return to;const u=o.find(r);return!u||ll(u)?to:{type:i,feature_flags:u}}),{addFeatureFlagEvaluation:(r,i)=>{const l=o.find();l&&(l[r]=i)}}}const NQ=10*cr;let Nc,Vh;function kQ(e,t,n,o){t.enabled&&ts(e.customerDataTelemetrySampleRate)&&(OM(),Vh=!1,n.subscribe(13,()=>{Vh=!0}),o.subscribe(({bytesCount:i,messagesCount:l})=>{Vh&&(Vh=!1,Nc.batchCount+=1,bT(Nc.batchBytesCount,i),bT(Nc.batchMessagesCount,l))}),gu(TQ,NQ))}function TQ(){Nc.batchCount!==0&&(I0("Customer data measures",Nc),OM())}function yT(){return{min:1/0,max:0,sum:0}}function bT(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function OM(){Nc={batchCount:0,batchBytesCount:yT(),batchMessagesCount:yT()}}const OQ=4e3,AQ=500,IQ=cl;function $Q(e,t,n=AQ){const o=xu({expireDelay:IQ,maxEntries:OQ});let r;fl(wt.VISIBILITY_STATE)&&performance.getEntriesByType(wt.VISIBILITY_STATE).forEach(m=>{const p=m.name==="hidden"?"hidden":"active";l(p,m.startTime)}),l(AM(),eo());const{stop:i}=Zs(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],f=>{l(PQ(f),f.timeStamp)},{capture:!0});function l(f,m=eo()){f!==r&&(r=f,o.closeActive(m),o.add({state:r,startTime:m},m))}function u(f,m,p){return o.findAll(m,p).some(g=>g.state===f)}return e.register(0,({startTime:f,duration:m=0,eventType:p})=>{if(p===it.VIEW){const g=o.findAll(f,m);return{type:p,_dd:{page_states:MQ(g,f,n)}}}return p===it.ACTION||p===it.ERROR?{type:p,view:{in_foreground:u("active",f,0)}}:to}),{wasInPageStateDuringPeriod:u,addPageState:l,stop:()=>{i(),o.stop()}}}function MQ(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:o,startTime:r})=>({state:o,start:ot(en(t,r))}))}function PQ(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":AM()}function AM(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function DQ(e,t){let n;const o=requestAnimationFrame(tt(()=>{n=H0()})),r=ZW(t).subscribe(i=>{n=i}).unsubscribe;return e.register(0,({eventType:i})=>({type:i,display:n?{viewport:n}:void 0})),{stop:()=>{r(),o&&cancelAnimationFrame(o)}}}function zQ(e,t){const n=window.cookieStore?UQ(e):FQ;return new bt(o=>n(t,r=>o.notify(r)))}function UQ(e){return(t,n)=>Qt(e,window.cookieStore,"change",r=>{const i=r.changed.find(l=>l.name===t)||r.deleted.find(l=>l.name===t);i&&n(i.value)}).stop}const LQ=cr;function FQ(e,t){const n=ff(document.cookie,e),o=gu(()=>{const r=ff(document.cookie,e);r!==n&&t(r)},LQ);return()=>{Vg(o)}}const xT="datadog-ci-visibility-test-execution-id";function VQ(e,t,n=zQ(e,xT)){var o;let r=Us(xT)||((o=window.Cypress)===null||o===void 0?void 0:o.env("traceId"));const i=n.subscribe(l=>{r=l});return t.register(0,({eventType:l})=>typeof r!="string"?to:{type:l,session:{type:"ci_test"},ci_test:{test_execution_id:r}}),{stop:()=>{i.unsubscribe()}}}function BQ(e,t){const n=Ci(t,{type:wt.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(o=>{for(const r of o){const i=Fg(r.startTime),l={date:i.timeStamp,long_task:{id:ur(),entry_type:q$.LONG_ANIMATION_FRAME,duration:ot(r.duration),blocking_duration:ot(r.blockingDuration),first_ui_event_timestamp:ot(r.firstUIEventTimestamp),render_start:ot(r.renderStart),style_and_layout_start:ot(r.styleAndLayoutStart),start_time:ot(r.startTime),scripts:r.scripts.map(u=>({duration:ot(u.duration),pause_duration:ot(u.pauseDuration),forced_style_and_layout_duration:ot(u.forcedStyleAndLayoutDuration),start_time:ot(u.startTime),execution_start:ot(u.executionStart),source_url:u.sourceURL,source_function_name:u.sourceFunctionName,source_char_position:u.sourceCharPosition,invoker:u.invoker,invoker_type:u.invokerType,window_attribution:u.windowAttribution}))},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop:()=>n.unsubscribe()}}function HQ(e,t){const n=Ci(t,{type:wt.LONG_TASK,buffered:!0}).subscribe(o=>{for(const r of o){if(r.entryType!==wt.LONG_TASK||!t.trackLongTasks)break;const i=Fg(r.startTime),l={date:i.timeStamp,long_task:{id:ur(),entry_type:q$.LONG_TASK,duration:ot(r.duration)},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop(){n.unsubscribe()}}}function GQ(e){e.register(0,({eventType:t})=>{if(!F$())return to;const n=U$(),o=L$();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:o,injected:z$()}}})}function qQ(e,t,n){const o=O0(e),r=n(o);return j0(t).forEach(([i,l])=>hw(e,o,i.split(/\.|(?=\[\])/),l)),r}function hw(e,t,n,o){const[r,...i]=n;if(r==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((l,u)=>hw(l,t[u],i,o));return}if(!(!_T(e)||!_T(t))){if(i.length>0)return hw(e[r],t[r],i,o);KQ(e,r,t[r],o)}}function KQ(e,t,n,o){const r=dl(n);r===o?e[t]=fn(n):o==="object"&&(r==="undefined"||r==="null")&&(e[t]={})}function _T(e){return dl(e)==="object"}const uc={"view.name":"string","view.url":"string","view.referrer":"string"},dc={context:"object"},fc={service:"string",version:"string"};let IM;function ZQ(e,t,n,o){IM={[it.VIEW]:{"view.performance.lcp.resource_url":"string",...dc,...uc,...fc},[it.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...dc,...uc,...fc},[it.RESOURCE]:{"resource.url":"string",...qg(Xa.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...dc,...uc,...fc},[it.ACTION]:{"action.target.name":"string",...dc,...uc,...fc},[it.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...dc,...uc,...fc},[it.VITAL]:{...dc,...uc,...fc}};const r={[it.ERROR]:Px(it.ERROR,e.eventRateLimiterThreshold,o),[it.ACTION]:Px(it.ACTION,e.eventRateLimiterThreshold,o),[it.VITAL]:Px(it.VITAL,e.eventRateLimiterThreshold,o)};t.subscribe(12,({startTime:i,duration:l,rawRumEvent:u,domainContext:f})=>{const m=n.triggerHook(0,{eventType:u.type,startTime:i,duration:l});if(m===Ys)return;const p=os(m,u,{ddtags:ZK(e).join(",")});YQ(p,e.beforeSend,f,r)&&(ll(p.context)&&delete p.context,t.notify(13,p))})}function YQ(e,t,n,o){var r;if(t){const l=qQ(e,IM[e.type],u=>t(u,n));if(l===!1&&e.type!==it.VIEW)return!1;l===!1&&ht.warn("Can't dismiss view events using beforeSend!")}return!((r=o[e.type])===null||r===void 0?void 0:r.isLimitReached())}function XQ(e,t,n,o){e.register(0,({eventType:r,startTime:i})=>{const l=t.findTrackedSession(i),u=o.findView(i);if(!l||!u)return Ys;let f,m,p;return r===it.VIEW?(f=n.getReplayStats(u.id)?!0:void 0,m=l.sessionReplay===1,p=u.sessionIsActive?void 0:!1):f=n.isRecording()?!0:void 0,{type:r,session:{id:l.id,type:"user",has_replay:f,sampled_for_replay:m,is_active:p}}}),e.register(1,({startTime:r})=>{const i=t.findTrackedSession(r);return i?{session:{id:i.id}}:to})}function WQ(e){e.register(0,({eventType:t})=>({type:t,connectivity:y$()}))}function QQ(e,t,n){e.register(0,({eventType:o})=>{const r=t.source;return{type:o,_dd:{format_version:2,drift:Bq(),configuration:{session_sample_rate:ef(t.sessionSampleRate,3),session_replay_sample_rate:ef(t.sessionReplaySampleRate,3),profiling_sample_rate:ef(t.profilingSampleRate,3)},browser_sdk_version:Yc()?"6.19.0":void 0,sdk_name:n},application:{id:t.applicationId},date:Bn(),source:r}}),e.register(1,()=>({application:{id:t.applicationId}}))}function JQ(e,t){e.register(1,()=>t.isGranted()?to:Ys)}const eJ=dK,tJ=[it.ACTION,it.ERROR,it.LONG_TASK,it.RESOURCE,it.VITAL];function nJ(e){return{addEvent:(t,n,o,r)=>{tJ.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:o,duration:r})}}}const rJ="Initial view metrics";function oJ(e,t,n){if(!(n.enabled&&ts(e.initialViewMetricsTelemetrySampleRate)))return{stop:kt};const{unsubscribe:r}=t.subscribe(4,({initialViewMetrics:i})=>{!i.largestContentfulPaint||!i.navigationTimings||(I0(rJ,{metrics:iJ(i.largestContentfulPaint,i.navigationTimings)}),r())});return{stop:r}}function iJ(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function sJ(e,t,n,o,r,i,l,u,f){const m=[],p=new MY,g=eJ();p.subscribe(13,de=>v$("rum",de));const v=de=>{p.notify(14,{error:de}),oa("Error reported to customer",{"error.message":de.message})},x=cK(e),b=x.subscribe(de=>{p.notify(11,de)});m.push(()=>b.unsubscribe());const S=hK("browser-rum-sdk",e,g,v,x,r);m.push(S.stop);const C=Yc()?gQ():pQ(e,p,i);if(Yc())xQ(p);else{const de=bQ(e,p,v,x,C.expireObservable,r);m.push(()=>de.stop()),kQ(e,S,p,de.flushController.flushObservable)}const E=OY(),j=SQ(e,location),{observable:N,stop:T}=IY();m.push(T),QQ(g,e,f);const k=$Q(g,e),A=DY(p);m.push(()=>A.stop());const I=wQ(p,g,j,location);m.push(()=>I.stop());const P=jQ(p,g,e);XQ(g,C,t,A),WQ(g),JQ(g,i);const F=ZZ(g,e,"rum"),L=YZ(g,e,C,"rum"),se=KZ(g,e,"rum"),{actionContexts:te,addAction:ce,addEvent:ae,stop:ie}=aJ(p,g,e,k,E,N,v);m.push(ie);const{addTiming:$,startView:K,setViewName:U,setViewContext:re,setViewContextProperty:M,getViewContext:H,stop:le}=dQ(p,g,e,location,E,N,j,t,A,o);m.push(le);const{stop:B}=oJ(e,p,S);m.push(B);const{stop:Y}=fW(p,e,k);if(m.push(Y),e.trackLongTasks)if(fl(wt.LONG_ANIMATION_FRAME)){const{stop:de}=BQ(p,e);m.push(de)}else HQ(p,e);const{addError:pe}=QX(p,e,u);u.unbuffer(),YY(p,e,C,L,se);const ve=tY(p,k,l),ue=$Y(e.applicationId,C,A,te,I);return m.push(()=>n.stop()),{addAction:ce,addEvent:ae,addError:pe,addTiming:$,addFeatureFlagEvaluation:P.addFeatureFlagEvaluation,startView:K,setViewContext:re,setViewContextProperty:M,getViewContext:H,setViewName:U,lifeCycle:p,viewHistory:A,session:C,stopSession:()=>C.expire(),getInternalContext:ue.get,startDurationVital:ve.startDurationVital,stopDurationVital:ve.stopDurationVital,addDurationVital:ve.addDurationVital,globalContext:F,userContext:L,accountContext:se,telemetry:S,stop:()=>{m.forEach(de=>de())},hooks:g}}function aJ(e,t,n,o,r,i,l){const u=YX(e,t,r,i,n),f=nJ(e),m=DQ(t,n),p=VQ(n,t);return GQ(t),ZQ(n,e,t,l),{pageStateHistory:o,addAction:u.addAction,addEvent:f.addEvent,actionContexts:u.actionContexts,stop:()=>{u.stop(),p.stop(),m.stop(),o.stop()}}}function lJ(e,{session:t,viewContext:n,errorType:o}){const r=t?t.id:"no-session-id",i=[];o!==void 0&&i.push(`error-type=${o}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const l=cJ(e),u=`/rum/replay/sessions/${r}`;return`${l}${u}?${i.join("&")}`}function cJ(e){const t=e.site,n=e.subdomain||uJ(e);return`https://${n?`${n}.`:""}${t}`}function uJ(e){switch(e.site){case $a:case G7:return"app";case g$:return"dd";default:return}}const dJ=1e3;let xo;function Ube(e){return Wg(e).segments_count}function Lbe(e){Wg(e).segments_count+=1}function Fbe(e){Wg(e).records_count+=1}function Vbe(e,t){Wg(e).segments_total_raw_size+=t}function fJ(e){return xo?.get(e)}function Wg(e){xo||(xo=new Map);let t;return xo.has(e)?t=xo.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},xo.set(e,t),xo.size>dJ&&mJ()),t}function mJ(){if(!xo)return;const e=xo.keys().next().value;e&&xo.delete(e)}function $M(e,t,n){let o=0,r=[],i,l=!0,u=0;const f=[],{stop:m}=Qt(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const x=f[0];x&&(x.id===v.id?(f.shift(),o+=v.additionalBytesCount,r.push(v.result),i=v.trailer,x.writeCallback?x.writeCallback(v.result.byteLength):x.finishCallback&&x.finishCallback()):x.id<v.id&&(m(),oa("Worker responses received out of order.")))});function p(){const v=r.length===0?new Uint8Array(0):Kq(r.concat(i)),x={rawBytesCount:o,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return o=0,r=[],x}function g(){l||(t.postMessage({action:"reset",streamId:n}),l=!0)}return{isAsync:!0,get isEmpty(){return l},write(v,x){t.postMessage({action:"write",id:u,data:v,streamId:n}),f.push({id:u,writeCallback:x,data:v}),l=!1,u+=1},finish(v){g(),f.length?(f.forEach(x=>{delete x.writeCallback}),f[f.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){g();const v=f.map(x=>x.data).join("");return f.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){m()}}}function G0({configuredUrl:e,error:t,source:n,scriptType:o}){if(ht.error(`${n} failed to start: an error occurred while initializing the ${o}:`,t),t instanceof Event||t instanceof Error&&hJ(t.message)){let r;e?r=`Please make sure the ${o} URL ${e} is correct and CSP is correctly configured.`:r="Please make sure CSP is correctly configured.",ht.error(`${r} See documentation at ${Lg}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else o==="worker"&&A0(t)}function hJ(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const pJ=30*cr;function MM(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([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]),n=new Uint8Array([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]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.19.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let mn={status:0};function PM(e,t,n,o=MM){switch(mn.status===0&&gJ(e,t,o),mn.status){case 1:return mn.initializationFailureCallbacks.push(n),mn.worker;case 3:return mn.worker}}function wT(){return mn.status}function gJ(e,t,n=MM){try{const o=n(e),{stop:r}=Qt(e,o,"error",u=>{Zx(e,t,u)}),{stop:i}=Qt(e,o,"message",({data:u})=>{u.type==="errored"?Zx(e,t,u.error,u.streamId):u.type==="initialized"&&yJ(u.version)});o.postMessage({action:"init"}),sr(()=>vJ(t),pJ),mn={status:1,worker:o,stop:()=>{r(),i()},initializationFailureCallbacks:[]}}catch(o){Zx(e,t,o)}}function vJ(e){mn.status===1&&(ht.error(`${e} failed to start: a timeout occurred while initializing the Worker`),mn.initializationFailureCallbacks.forEach(t=>t()),mn={status:2})}function yJ(e){mn.status===1&&(mn={status:3,worker:mn.worker,stop:mn.stop,version:e})}function Zx(e,t,n,o){mn.status===1||mn.status===0?(G0({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),mn.status===1&&mn.initializationFailureCallbacks.forEach(r=>r()),mn={status:2}):A0(n,{worker_version:mn.status===3&&mn.version,stream_id:o})}function DM(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function bJ(e,t,n,o){const r=t.findTrackedSession(),i=xJ(r,o),l=n.findView();return lJ(e,{viewContext:l,errorType:i,session:r})}function xJ(e,t){if(!DM())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}const _J="Recorder init metrics";function wJ(e,t,n){if(!(t.enabled&&ts(e.replayTelemetrySampleRate)))return{stop:kt};let r,i,l;const{unsubscribe:u}=n.subscribe(f=>{switch(f.type){case"start":r={forced:f.forced,timestamp:Bn()},i=void 0,l=void 0;break;case"document-ready":r&&(i=en(r.timestamp,Bn()));break;case"recorder-settled":r&&(l=en(r.timestamp,Bn()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":u(),r&&I0(_J,{metrics:SJ(r.forced,l,en(r.timestamp,Bn()),f.type,i)});break}});return{stop:u}}function SJ(e,t,n,o,r){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:o,waitForDocReadyDuration:r}}function CJ(e,t,n,o,r,i,l){let u=0,f;t.subscribe(9,()=>{(u===2||u===3)&&(v(),u=1)}),t.subscribe(10,()=>{u===1&&g()});const m=new bt;wJ(e,l,m);const p=async x=>{m.notify({type:"start",forced:x});const[b]=await Promise.all([ST(m,{type:"recorder-settled"},r()),ST(m,{type:"document-ready"},wZ(e,"interactive"))]);if(u!==2){m.notify({type:"aborted"});return}if(!b){u=0,m.notify({type:"recorder-load-failed"});return}const S=i();if(!S){u=0,m.notify({type:"deflate-encoder-load-failed"});return}({stop:f}=b(t,e,n,o,S,l)),u=3,m.notify({type:"succeeded"})};function g(x){const b=n.findTrackedSession();if(EJ(b,x)){u=1;return}if(RJ(u))return;u=2;const S=jJ(b,x)||!1;p(S).catch(qc),S&&n.setForcedReplay()}function v(){u===3&&f?.(),u=0}return{start:g,stop:v,getSessionReplayLink(){return bJ(e,n,o,u!==0)},isRecording:()=>u===3}}function EJ(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function RJ(e){return e===2||e===3}function jJ(e,t){return t&&t.force&&e.sessionReplay===0}async function ST(e,t,n){try{return await n}finally{e.notify(t)}}function NJ(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:kt},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function kJ(e,t){if(Yc()&&!j$("records")||!DM())return{start:kt,stop:kt,getReplayStats:()=>{},onRumStart:kt,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:o}=NJ();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:r,isRecording:()=>wT()===3&&n.isRecording(),getReplayStats:i=>wT()===3?fJ(i):void 0};function r(i,l,u,f,m,p){let g;function v(){return g||(m??(m=PM(l,"Datadog Session Replay",()=>{n.stop()},t)),m&&(g=$M(l,m,1))),g}n=CJ(l,i,u,f,e,v,p),o(l)&&n.start()}}const TJ="modulepreload",OJ=function(e){return"/"+e},CT={},q0=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){let f=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");r=f(n.map(m=>{if(m=OJ(m),m in CT)return;CT[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":TJ,p||(v.as="script"),v.crossOrigin="",v.href=m,u&&v.setAttribute("nonce",u),document.head.appendChild(v),p)return new Promise((x,b)=>{v.addEventListener("load",x),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${m}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return r.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};async function AJ(e=IJ){try{return await e()}catch(t){G0({error:t,source:"Recorder",scriptType:"module"})}}async function IJ(){return(await q0(()=>import("./startRecording-DiD-ht9H.js"),[])).startRecording}function $J(){return Qo().Profiler!==void 0}const MJ=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==it.VIEW&&n!==it.LONG_TASK?to:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function PJ(e=DJ){try{return await e()}catch(t){G0({error:t,source:"Profiler",scriptType:"module"})}}async function DJ(){return(await q0(()=>import("./profiler-CgmzpljF.js"),[])).createRumProfiler}function zJ(){let e;function t(n,o,r,i,l){const u=i.findTrackedSession();if(!u||!W$(u.id,r.profilingSampleRate))return;const f=MJ(o);if(!$J()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}PJ().then(m=>{if(!m){oa("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=m(r,n,i,f),e.start(l.findView())}).catch(qc)}return{onRumStart:t,stop:()=>{e?.stop().catch(qc)}}}const UJ=kJ(AJ),LJ=zJ(),FJ=kY(sJ,UJ,LJ,{startDeflateWorker:PM,createDeflateEncoder:$M,sdkName:"rum"});nZ(Qo(),"DD_RUM",FJ);function _p(e,t){hf("react error"),Gn()}const ET={didCatch:!1,error:null};class Bbe extends q.Component{constructor(t){super(t),this.resetError=()=>{this.setState(ET)},this.state=ET}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){_p()}render(){return this.state.didCatch?q.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let RT=!1;function VJ(){_.useEffect(()=>{RT||(RT=!0)},[])}function BJ(){return c.jsx(c.Fragment,{children:c.jsx(ls,{})})}const Qg=I8()({component:BJ});function HJ(e,t){const n=_.createContext(t),o=i=>{const{children:l,...u}=i,f=_.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:f,children:l})};o.displayName=e+"Provider";function r(i){const l=_.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Jo(e,t=[]){let n=[];function o(i,l){const u=_.createContext(l),f=n.length;n=[...n,l];const m=g=>{const{scope:v,children:x,...b}=g,S=v?.[e]?.[f]||u,C=_.useMemo(()=>b,Object.values(b));return c.jsx(S.Provider,{value:C,children:x})};m.displayName=i+"Provider";function p(g,v){const x=v?.[e]?.[f]||u,b=_.useContext(x);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,p]}const r=()=>{const i=n.map(l=>_.createContext(l));return function(u){const f=u?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return r.scopeName=e,[o,GJ(r,...t)]}function GJ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const l=o.reduce((u,{useScope:f,scopeName:m})=>{const g=f(i)[`__scope${m}`];return{...u,...g}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var qJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=qJ.reduce((e,t)=>{const n=Ba(`Primitive.${t}`),o=_.forwardRef((r,i)=>{const{asChild:l,...u}=r,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(f,{...u,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Hp(e,t){e&&fu.flushSync(()=>e.dispatchEvent(t))}var En=globalThis?.document?_.useLayoutEffect:()=>{},KJ=CA[" useInsertionEffect ".trim().toString()]||En;function Ei({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,l]=ZJ({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:r;{const p=_.useRef(e!==void 0);_.useEffect(()=>{const g=p.current;g!==u&&console.warn(`${o} is changing from ${g?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,o])}const m=_.useCallback(p=>{if(u){const g=YJ(p)?p(e):p;g!==e&&l.current?.(g)}else i(p)},[u,e,i,l]);return[f,m]}function ZJ({defaultProp:e,onChange:t}){const[n,o]=_.useState(e),r=_.useRef(n),i=_.useRef(t);return KJ(()=>{i.current=t},[t]),_.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function YJ(e){return typeof e=="function"}var XJ=_.createContext(void 0);function _u(e){const t=_.useContext(XJ);return e||t||"ltr"}function WJ(e,t){return _.useReducer((n,o)=>t[n][o]??n,e)}var Pn=e=>{const{present:t,children:n}=e,o=QJ(t),r=typeof n=="function"?n({present:o.isPresent}):_.Children.only(n),i=st(o.ref,JJ(r));return typeof n=="function"||o.isPresent?_.cloneElement(r,{ref:i}):null};Pn.displayName="Presence";function QJ(e){const[t,n]=_.useState(),o=_.useRef(null),r=_.useRef(e),i=_.useRef("none"),l=e?"mounted":"unmounted",[u,f]=WJ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const m=Bh(o.current);i.current=u==="mounted"?m:"none"},[u]),En(()=>{const m=o.current,p=r.current;if(p!==e){const v=i.current,x=Bh(m);e?f("MOUNT"):x==="none"||m?.display==="none"?f("UNMOUNT"):f(p&&v!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,f]),En(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=x=>{const S=Bh(o.current).includes(CSS.escape(x.animationName));if(x.target===t&&S&&(f("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=x=>{x.target===t&&(i.current=Bh(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:_.useCallback(m=>{o.current=m?getComputedStyle(m):null,n(m)},[])}}function Bh(e){return e?.animationName||"none"}function JJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eee=CA[" useId ".trim().toString()]||(()=>{}),tee=0;function Qr(e){const[t,n]=_.useState(eee());return En(()=>{n(o=>o??String(tee++))},[e]),t?`radix-${t}`:""}function Vf(e){const t=e+"CollectionProvider",[n,o]=Jo(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:E}=S,j=q.useRef(null),N=q.useRef(new Map).current;return c.jsx(r,{scope:C,itemMap:N,collectionRef:j,children:E})};l.displayName=t;const u=e+"CollectionSlot",f=Ba(u),m=q.forwardRef((S,C)=>{const{scope:E,children:j}=S,N=i(u,E),T=st(C,N.collectionRef);return c.jsx(f,{ref:T,children:j})});m.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=Ba(p),x=q.forwardRef((S,C)=>{const{scope:E,children:j,...N}=S,T=q.useRef(null),k=st(C,T),A=i(p,E);return q.useEffect(()=>(A.itemMap.set(T,{ref:T,...N}),()=>void A.itemMap.delete(T))),c.jsx(v,{[g]:"",ref:k,children:j})});x.displayName=p;function b(S){const C=i(e+"CollectionConsumer",S);return q.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const N=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((A,I)=>N.indexOf(A.ref.current)-N.indexOf(I.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:m,ItemSlot:x},b,o]}function qt(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}function nee(e,t=globalThis?.document){const n=qt(e);_.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var ree="DismissableLayer",pw="dismissableLayer.update",oee="dismissableLayer.pointerDownOutside",iee="dismissableLayer.focusOutside",jT,zM=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wu=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...f}=e,m=_.useContext(zM),[p,g]=_.useState(null),v=p?.ownerDocument??globalThis?.document,[,x]=_.useState({}),b=st(t,I=>g(I)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),j=p?S.indexOf(p):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,T=j>=E,k=lee(I=>{const P=I.target,F=[...m.branches].some(L=>L.contains(P));!T||F||(r?.(I),l?.(I),I.defaultPrevented||u?.())},v),A=cee(I=>{const P=I.target;[...m.branches].some(L=>L.contains(P))||(i?.(I),l?.(I),I.defaultPrevented||u?.())},v);return nee(I=>{j===m.layers.size-1&&(o?.(I),!I.defaultPrevented&&u&&(I.preventDefault(),u()))},v),_.useEffect(()=>{if(p)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(jT=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),NT(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=jT)}},[p,v,n,m]),_.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),NT())},[p,m]),_.useEffect(()=>{const I=()=>x({});return document.addEventListener(pw,I),()=>document.removeEventListener(pw,I)},[]),c.jsx(Ue.div,{...f,ref:b,style:{pointerEvents:N?T?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,k.onPointerDownCapture)})});wu.displayName=ree;var see="DismissableLayerBranch",aee=_.forwardRef((e,t)=>{const n=_.useContext(zM),o=_.useRef(null),r=st(t,o);return _.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(Ue.div,{...e,ref:r})});aee.displayName=see;function lee(e,t=globalThis?.document){const n=qt(e),o=_.useRef(!1),r=_.useRef(()=>{});return _.useEffect(()=>{const i=u=>{if(u.target&&!o.current){let f=function(){UM(oee,n,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=f,t.addEventListener("click",r.current,{once:!0})):f()}else t.removeEventListener("click",r.current);o.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function cee(e,t=globalThis?.document){const n=qt(e),o=_.useRef(!1);return _.useEffect(()=>{const r=i=>{i.target&&!o.current&&UM(iee,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function NT(){const e=new CustomEvent(pw);document.dispatchEvent(e)}function UM(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Hp(r,i):r.dispatchEvent(i)}function LM(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var FM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uee="VisuallyHidden",VM=_.forwardRef((e,t)=>c.jsx(Ue.span,{...e,ref:t,style:{...FM,...e.style}}));VM.displayName=uee;var BM=VM,ml="NavigationMenu",[K0,HM,dee]=Vf(ml),[gw,fee,mee]=Vf(ml),[Z0]=Jo(ml,[dee,mee]),[hee,Ao]=Z0(ml),[pee,gee]=Z0(ml),GM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,delayDuration:l=200,skipDelayDuration:u=300,orientation:f="horizontal",dir:m,...p}=e,[g,v]=_.useState(null),x=st(t,F=>v(F)),b=_u(m),S=_.useRef(0),C=_.useRef(0),E=_.useRef(0),[j,N]=_.useState(!0),[T,k]=Ei({prop:o,onChange:F=>{const L=F!=="",se=u>0;L?(window.clearTimeout(E.current),se&&N(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>N(!0),u)),r?.(F)},defaultProp:i??"",caller:ml}),A=_.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>k(""),150)},[k]),I=_.useCallback(F=>{window.clearTimeout(C.current),k(F)},[k]),P=_.useCallback(F=>{T===F?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),k(F)},l)},[T,k,l]);return _.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),c.jsx(qM,{scope:n,isRootMenu:!0,value:T,dir:b,orientation:f,rootNavigationMenu:g,onTriggerEnter:F=>{window.clearTimeout(S.current),j?P(F):I(F)},onTriggerLeave:()=>{window.clearTimeout(S.current),A()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:A,onItemSelect:F=>{k(L=>L===F?"":F)},onItemDismiss:()=>k(""),children:c.jsx(Ue.nav,{"aria-label":"Main","data-orientation":f,dir:b,...p,ref:x})})});GM.displayName=ml;var vw="NavigationMenuSub",vee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,orientation:l="horizontal",...u}=e,f=Ao(vw,n),[m,p]=Ei({prop:o,onChange:r,defaultProp:i??"",caller:vw});return c.jsx(qM,{scope:n,isRootMenu:!1,value:m,dir:f.dir,orientation:l,rootNavigationMenu:f.rootNavigationMenu,onTriggerEnter:g=>p(g),onItemSelect:g=>p(g),onItemDismiss:()=>p(""),children:c.jsx(Ue.div,{"data-orientation":l,...u,ref:t})})});vee.displayName=vw;var qM=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:o,dir:r,orientation:i,children:l,value:u,onItemSelect:f,onItemDismiss:m,onTriggerEnter:p,onTriggerLeave:g,onContentEnter:v,onContentLeave:x}=e,[b,S]=_.useState(null),[C,E]=_.useState(new Map),[j,N]=_.useState(null);return c.jsx(hee,{scope:t,isRootMenu:n,rootNavigationMenu:o,value:u,previousValue:LM(u),baseId:Qr(),dir:r,orientation:i,viewport:b,onViewportChange:S,indicatorTrack:j,onIndicatorTrackChange:N,onTriggerEnter:qt(p),onTriggerLeave:qt(g),onContentEnter:qt(v),onContentLeave:qt(x),onItemSelect:qt(f),onItemDismiss:qt(m),onViewportContentChange:_.useCallback((T,k)=>{E(A=>(A.set(T,k),new Map(A)))},[]),onViewportContentRemove:_.useCallback(T=>{E(k=>k.has(T)?(k.delete(T),new Map(k)):k)},[]),children:c.jsx(K0.Provider,{scope:t,children:c.jsx(pee,{scope:t,items:C,children:l})})})},KM="NavigationMenuList",ZM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Ao(KM,n),i=c.jsx(Ue.ul,{"data-orientation":r.orientation,...o,ref:t});return c.jsx(Ue.div,{style:{position:"relative"},ref:r.onIndicatorTrackChange,children:c.jsx(K0.Slot,{scope:n,children:r.isRootMenu?c.jsx(tP,{asChild:!0,children:i}):i})})});ZM.displayName=KM;var YM="NavigationMenuItem",[yee,XM]=Z0(YM),WM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,...r}=e,i=Qr(),l=o||i||"LEGACY_REACT_AUTO_VALUE",u=_.useRef(null),f=_.useRef(null),m=_.useRef(null),p=_.useRef(()=>{}),g=_.useRef(!1),v=_.useCallback((b="start")=>{if(u.current){p.current();const S=bw(u.current);S.length&&W0(b==="start"?S:S.reverse())}},[]),x=_.useCallback(()=>{if(u.current){const b=bw(u.current);b.length&&(p.current=Nee(b))}},[]);return c.jsx(yee,{scope:n,value:l,triggerRef:f,contentRef:u,focusProxyRef:m,wasEscapeCloseRef:g,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:x,onContentFocusOutside:x,children:c.jsx(Ue.li,{...r,ref:t})})});WM.displayName=YM;var yw="NavigationMenuTrigger",bee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:o,...r}=e,i=Ao(yw,e.__scopeNavigationMenu),l=XM(yw,e.__scopeNavigationMenu),u=_.useRef(null),f=st(u,l.triggerRef,t),m=rP(i.baseId,l.value),p=oP(i.baseId,l.value),g=_.useRef(!1),v=_.useRef(!1),x=l.value===i.value;return c.jsxs(c.Fragment,{children:[c.jsx(K0.ItemSlot,{scope:n,value:l.value,children:c.jsx(nP,{asChild:!0,children:c.jsx(Ue.button,{id:m,disabled:o,"data-disabled":o?"":void 0,"data-state":Q0(x),"aria-expanded":x,"aria-controls":p,...r,ref:f,onPointerEnter:Se(e.onPointerEnter,()=>{v.current=!1,l.wasEscapeCloseRef.current=!1}),onPointerMove:Se(e.onPointerMove,Gp(()=>{o||v.current||l.wasEscapeCloseRef.current||g.current||(i.onTriggerEnter(l.value),g.current=!0)})),onPointerLeave:Se(e.onPointerLeave,Gp(()=>{o||(i.onTriggerLeave(),g.current=!1)})),onClick:Se(e.onClick,()=>{i.onItemSelect(l.value),v.current=x}),onKeyDown:Se(e.onKeyDown,b=>{const C={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];x&&b.key===C&&(l.onEntryKeyDown(),b.preventDefault())})})})}),x&&c.jsxs(c.Fragment,{children:[c.jsx(BM,{"aria-hidden":!0,tabIndex:0,ref:l.focusProxyRef,onFocus:b=>{const S=l.contentRef.current,C=b.relatedTarget,E=C===u.current,j=S?.contains(C);(E||!j)&&l.onFocusProxyEnter(E?"start":"end")}}),i.viewport&&c.jsx("span",{"aria-owns":p})]})]})});bee.displayName=yw;var xee="NavigationMenuLink",kT="navigationMenu.linkSelect",QM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:o,onSelect:r,...i}=e;return c.jsx(nP,{asChild:!0,children:c.jsx(Ue.a,{"data-active":o?"":void 0,"aria-current":o?"page":void 0,...i,ref:t,onClick:Se(e.onClick,l=>{const u=l.target,f=new CustomEvent(kT,{bubbles:!0,cancelable:!0});if(u.addEventListener(kT,m=>r?.(m),{once:!0}),Hp(u,f),!f.defaultPrevented&&!l.metaKey){const m=new CustomEvent(wp,{bubbles:!0,cancelable:!0});Hp(u,m)}},{checkForDefaultPrevented:!1})})})});QM.displayName=xee;var Y0="NavigationMenuIndicator",_ee=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Ao(Y0,e.__scopeNavigationMenu),i=!!r.value;return r.indicatorTrack?_0.createPortal(c.jsx(Pn,{present:n||i,children:c.jsx(wee,{...o,ref:t})}),r.indicatorTrack):null});_ee.displayName=Y0;var wee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Ao(Y0,n),i=HM(n),[l,u]=_.useState(null),[f,m]=_.useState(null),p=r.orientation==="horizontal",g=!!r.value;_.useEffect(()=>{const b=i().find(S=>S.value===r.value)?.ref.current;b&&u(b)},[i,r.value]);const v=()=>{l&&m({size:p?l.offsetWidth:l.offsetHeight,offset:p?l.offsetLeft:l.offsetTop})};return xw(l,v),xw(r.indicatorTrack,v),f?c.jsx(Ue.div,{"aria-hidden":!0,"data-state":g?"visible":"hidden","data-orientation":r.orientation,...o,ref:t,style:{position:"absolute",...p?{left:0,width:f.size+"px",transform:`translateX(${f.offset}px)`}:{top:0,height:f.size+"px",transform:`translateY(${f.offset}px)`},...o.style}}):null}),Xc="NavigationMenuContent",See=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Ao(Xc,e.__scopeNavigationMenu),i=XM(Xc,e.__scopeNavigationMenu),l=st(i.contentRef,t),u=i.value===r.value,f={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...o};return r.viewport?c.jsx(Cee,{forceMount:n,...f,ref:l}):c.jsx(Pn,{present:n||u,children:c.jsx(JM,{"data-state":Q0(u),...f,ref:l,onPointerEnter:Se(e.onPointerEnter,r.onContentEnter),onPointerLeave:Se(e.onPointerLeave,Gp(r.onContentLeave)),style:{pointerEvents:!u&&r.isRootMenu?"none":void 0,...f.style}})})});See.displayName=Xc;var Cee=_.forwardRef((e,t)=>{const n=Ao(Xc,e.__scopeNavigationMenu),{onViewportContentChange:o,onViewportContentRemove:r}=n;return En(()=>{o(e.value,{ref:t,...e})},[e,t,o]),En(()=>()=>r(e.value),[e.value,r]),null}),wp="navigationMenu.rootContentDismiss",JM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,triggerRef:r,focusProxyRef:i,wasEscapeCloseRef:l,onRootContentClose:u,onContentFocusOutside:f,...m}=e,p=Ao(Xc,n),g=_.useRef(null),v=st(g,t),x=rP(p.baseId,o),b=oP(p.baseId,o),S=HM(n),C=_.useRef(null),{onItemDismiss:E}=p;_.useEffect(()=>{const N=g.current;if(p.isRootMenu&&N){const T=()=>{E(),u(),N.contains(document.activeElement)&&r.current?.focus()};return N.addEventListener(wp,T),()=>N.removeEventListener(wp,T)}},[p.isRootMenu,e.value,r,E,u]);const j=_.useMemo(()=>{const T=S().map(L=>L.value);p.dir==="rtl"&&T.reverse();const k=T.indexOf(p.value),A=T.indexOf(p.previousValue),I=o===p.value,P=A===T.indexOf(o);if(!I&&!P)return C.current;const F=(()=>{if(k!==A){if(I&&A!==-1)return k>A?"from-end":"from-start";if(P&&k!==-1)return k>A?"to-start":"to-end"}return null})();return C.current=F,F},[p.previousValue,p.value,p.dir,S,o]);return c.jsx(tP,{asChild:!0,children:c.jsx(wu,{id:b,"aria-labelledby":x,"data-motion":j,"data-orientation":p.orientation,...m,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const N=new Event(wp,{bubbles:!0,cancelable:!0});g.current?.dispatchEvent(N)},onFocusOutside:Se(e.onFocusOutside,N=>{f();const T=N.target;p.rootNavigationMenu?.contains(T)&&N.preventDefault()}),onPointerDownOutside:Se(e.onPointerDownOutside,N=>{const T=N.target,k=S().some(I=>I.ref.current?.contains(T)),A=p.isRootMenu&&p.viewport?.contains(T);(k||A||!p.isRootMenu)&&N.preventDefault()}),onKeyDown:Se(e.onKeyDown,N=>{const T=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!T){const A=bw(N.currentTarget),I=document.activeElement,P=A.findIndex(se=>se===I),L=N.shiftKey?A.slice(0,P).reverse():A.slice(P+1,A.length);W0(L)?N.preventDefault():i.current?.focus()}}),onEscapeKeyDown:Se(e.onEscapeKeyDown,N=>{l.current=!0})})})}),X0="NavigationMenuViewport",eP=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,i=!!Ao(X0,e.__scopeNavigationMenu).value;return c.jsx(Pn,{present:n||i,children:c.jsx(Eee,{...o,ref:t})})});eP.displayName=X0;var Eee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:o,...r}=e,i=Ao(X0,n),l=st(t,i.onViewportChange),u=gee(Xc,e.__scopeNavigationMenu),[f,m]=_.useState(null),[p,g]=_.useState(null),v=f?f?.width+"px":void 0,x=f?f?.height+"px":void 0,b=!!i.value,S=b?i.value:i.previousValue;return xw(p,()=>{p&&m({width:p.offsetWidth,height:p.offsetHeight})}),c.jsx(Ue.div,{"data-state":Q0(b),"data-orientation":i.orientation,...r,ref:l,style:{pointerEvents:!b&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":x,...r.style},onPointerEnter:Se(e.onPointerEnter,i.onContentEnter),onPointerLeave:Se(e.onPointerLeave,Gp(i.onContentLeave)),children:Array.from(u.items).map(([E,{ref:j,forceMount:N,...T}])=>{const k=S===E;return c.jsx(Pn,{present:N||k,children:c.jsx(JM,{...T,ref:Rf(j,A=>{k&&A&&g(A)})})},E)})})}),Ree="FocusGroup",tP=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Ao(Ree,n);return c.jsx(gw.Provider,{scope:n,children:c.jsx(gw.Slot,{scope:n,children:c.jsx(Ue.div,{dir:r.dir,...o,ref:t})})})}),TT=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],jee="FocusGroupItem",nP=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=fee(n),i=Ao(jee,n);return c.jsx(gw.ItemSlot,{scope:n,children:c.jsx(Ue.button,{...o,ref:t,onKeyDown:Se(e.onKeyDown,l=>{if(["Home","End",...TT].includes(l.key)){let f=r().map(g=>g.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(l.key)&&f.reverse(),TT.includes(l.key)){const g=f.indexOf(l.currentTarget);f=f.slice(g+1)}setTimeout(()=>W0(f)),l.preventDefault()}})})})});function bw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function W0(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function Nee(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function xw(e,t){const n=qt(t);En(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}function Q0(e){return e?"open":"closed"}function rP(e,t){return`${e}-trigger-${t}`}function oP(e,t){return`${e}-content-${t}`}function Gp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var kee=GM,Tee=ZM,Oee=WM,Aee=QM,Iee=eP;function $ee({className:e,...t}){return c.jsx("div",{className:$e("absolute top-full left-0 isolate z-50 flex justify-center"),children:c.jsx(Iee,{"data-slot":"navigation-menu-viewport",className:$e("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function iP({className:e,children:t,viewport:n=!0,...o}){return c.jsxs(kee,{"data-slot":"navigation-menu","data-viewport":n,className:$e("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...o,children:[t,n&&c.jsx($ee,{})]})}function qp({className:e,...t}){return c.jsx(Oee,{"data-slot":"navigation-menu-item",className:$e("relative",e),...t})}function Kp({className:e,...t}){return c.jsx(Aee,{"data-slot":"navigation-menu-link",className:$e("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function sP({className:e,...t}){return c.jsx(Tee,{"data-slot":"navigation-menu-list",className:$e("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function Bf(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return Fs({id:Sn,operationsUrl:e})}function Hf(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return{instanceClient:Fs({id:Sn,operationsUrl:e}),entityType:"instance"}}function dr(e){const{instanceId:t,clusterId:n}=Ze({strict:!1}),o=Sn;return{instanceClient:Fs({id:o,operationsUrl:e}),entityId:o,entityType:"instance"}}function Mee(){localStorage.clear()}function Pee(){sessionStorage.clear()}async function Dee(){Hn.setUserForEntity(Sn,null),cf.getQueryCache().clear(),Mee(),Pee(),await cf.invalidateQueries({refetchType:"none"})}async function zee(e){await Hn.signOutFromPotentiallyAuthenticatedInstances(),await If(e)}function Uee(){const e=Bf();return at({mutationFn:()=>zee({instanceClient:e}),onSuccess:Dee})}function Gf(e){const{user:t}=mu(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];return!o?.permission&&!o?.organization?{update:!1,remove:!1}:o.permission?.super_user?{update:!0,remove:!0}:{update:o.organization.update,remove:o.organization.delete}}function Su(e){const{user:t}=mu(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];if(!o?.permission&&!o?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(o.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const r=o.organization.roles;return{create:r.create,remove:r.delete,update:r.update,view:r.view}}function J0(e,t){const{user:n}=mu(),{organizationId:o,clusterId:r}=Ze({strict:!1}),i=t??r,l=n?.roles?.[e??o];if(!l?.permission&&!l?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(l.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const u=l.organization.clusters.resources?.find(m=>m.id===i),f=l.organization.clusters;return{create:f.create,remove:u?u.delete:f.delete,update:u?u.update:f.update,view:u?u.view:f.view}}function aP(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=ra(n??t),r=o?.role?.permission;return r?r.super_user===!0:!1}function eS(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=ra(n??t),r=o?.role?.permission;return r?r.super_user===!0||r.structure_user===!0:!1}function Yx(e,t,n,o){const{clusterId:r,instanceId:i}=Ze({strict:!1}),{user:l}=ra(e??i??r),u=l?.role?.permission;return u?u.super_user===!0||u.structure_user===!0?!0:u[t]?.tables?.[n][o]===!0:!1}const Lee={className:"text-white"};function Fee({signOut:e}){const{user:t}=sl();hu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Gf(n),{view:r}=Su(n),[i,l]=_.useState(!1);return c.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs(ze,{to:na,children:[c.jsx(tS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.2"})]}),c.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:()=>{l(!i)},children:[c.jsx("span",{className:"sr-only",children:i?"Close menu":"Open menu"}),i?c.jsx(FI,{}):c.jsx(zI,{})]})]}),c.jsxs("div",{className:`${i?"block":"hidden"} md:hidden space-y-1 pb-3 bg-black-dark absolute left-0 top-full w-full rounded-b-md`,children:[!Pc,!Pc,c.jsxs(ze,{to:"/docs",className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(S0,{className:"mr-4"})," Docs"]}),c.jsxs(ze,{to:void 0,onClick:e,className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(DI,{className:"mr-4"})," Sign Out"]})]})]})}function Vee({signOut:e}){const{user:t}=sl();hu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Gf(n),{view:r}=Su(n);return c.jsx("div",{className:"hidden md:block",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(ze,{to:na,children:[c.jsx(tS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.2"})]})}),c.jsx(iP,{children:c.jsxs(sP,{className:"text-grey-400",children:[!Pc,!Pc,c.jsx(qp,{children:c.jsx(Kp,{asChild:!0,children:c.jsxs(ze,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(S0,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Docs"})]})})}),c.jsx(qp,{children:c.jsx(Kp,{asChild:!0,children:c.jsxs(ze,{to:void 0,onClick:e,className:"flex-row items-center",children:[c.jsx(DI,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Sign Out"})]})})})]})})]})})}function Bee(){return c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(ze,{to:"/sign-in",children:[c.jsx(tS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.2"})]})}),c.jsx(iP,{children:c.jsxs(sP,{className:"text-grey-400",children:[c.jsx(qp,{children:c.jsx(Kp,{asChild:!0,children:c.jsxs(ze,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(S0,{})," ",c.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),c.jsx(qp,{children:c.jsx(Kp,{asChild:!0,children:c.jsxs(ze,{to:"/sign-in",className:"flex-row items-center",activeProps:Lee,children:[c.jsx(MG,{})," Sign In"]})})})]})})]})}function tS(){return c.jsxs(c.Fragment,{children:[c.jsx("img",{src:"/logo_harper_db_studio.png",alt:"logo",className:"w-64 hidden md:inline-block"}),c.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}function lP(){const{mutate:e}=Uee(),t=gn(),{user:n}=sl(),o=Rn(),r=_.useCallback(()=>{e(void 0,{onSuccess:async()=>{Ce.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Ce.dismiss()}}),t({to:"/sign-in"}),o.invalidate()}})},[e,o,t]);return n?c.jsxs(c.Fragment,{children:[c.jsx(Fee,{signOut:r}),c.jsx(Vee,{signOut:r})]}):c.jsx(Bee,{})}function Hh({title:e,children:t}){return c.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[c.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function Hee(){return c.jsxs(c.Fragment,{children:[c.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:c.jsx(lP,{})}),c.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[c.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:c.jsxs("div",{children:[c.jsx("h1",{className:"text-4xl font-bold",children:"Harper Studio"}),c.jsx("span",{children:"Manage all your Harper instances."}),c.jsxs("ul",{className:"ps-5",children:[c.jsx(Hh,{title:"Manage All Instances",children:c.jsx("span",{children:"View, create, and delete instances from one location."})}),c.jsx(Hh,{title:"Embedded API Server",children:c.jsx("span",{children:"Harper components give you unlimited application flexibility"})}),c.jsx(Hh,{title:"Fully Managed Cloud & 5G Instances",children:c.jsx("span",{children:"Go from zero to code in minutes."})}),c.jsx(Hh,{title:"Deploy Anywhere",children:c.jsxs("div",{className:"mt-6",children:[c.jsx("a",{href:"https://hub.docker.com/r/harperdb/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"Docker"}),c.jsx("a",{href:"https://www.npmjs.com/package/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"npm"}),c.jsx("a",{href:"https://docs.harperdb.io/docs/deployments/install-harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 border-2 border-blue-100 rounded-md",children:"all options"})]})})]})]})}),c.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:c.jsx(ls,{})})]})]})}const Dd=new Map;function hl(e){if(!e)return"";if(Dd.has(e))return Dd.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return Dd.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return Dd.set(e,""),"";const o=[];for(let l=0;l<n.length;l++){const u=n[l],f=l+1<n.length?n[l+1]:void 0;/^[A-Z]{2,}$/.test(u)&&f==="s"?(o.push(u+"s"),l++):/^[A-Z]$/.test(u)&&f!==void 0&&/^[A-Z]s$/.test(f)?(o.push(u+f),l++):o.push(u)}const i=o.map(Gee).join(" ");return Dd.set(e,i),i}function Gee(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Jg(){const e=Y8(),{organization:t,instance:n,cluster:o}=w0({strict:!1}),r=_.useMemo(()=>{const i=e.pathname.split("/").filter(u=>u&&u.length>0),l=[c.jsxs(ze,{to:"/",children:[c.jsx(NG,{"aria-hidden":"true",className:"size-5 shrink-0"}),c.jsx("span",{className:"sr-only",children:"Home"})]})];for(let u=0;u<i.length;u++){const f=i[u];if(f==="instance")continue;let m=`/${i.slice(0,u+1).join("/")}`,p=hl(f),g;f==="databases"&&i.length===u+3?(p=i[u+2],u+=2):p.startsWith("Org ")?p=t?.name||"Org":p.startsWith("Clu ")?(p=o?.name||"Cluster",i[u+1]==="instance"&&(m+="/instances")):p.startsWith("Ins ")&&(p=n?.name?.split(".")?.shift()||"Instance"),l.push(c.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:c.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),c.jsxs(ze,{to:m,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[p,g]}))}return l},[e.pathname,o?.name,n?.name,t?.name]);return c.jsxs("div",{role:"list",className:"flex items-center space-x-0 lg:space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...r]})}var qf=e=>e.type==="checkbox",Ma=e=>e instanceof Date,_r=e=>e==null;const cP=e=>typeof e=="object";var pn=e=>!_r(e)&&!Array.isArray(e)&&cP(e)&&!Ma(e),uP=e=>pn(e)&&e.target?qf(e.target)?e.target.checked:e.target.value:e,qee=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,dP=(e,t)=>e.has(qee(t)),Kee=e=>{const t=e.constructor&&e.constructor.prototype;return pn(t)&&t.hasOwnProperty("isPrototypeOf")},nS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ft(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(nS&&(e instanceof Blob||o))&&(n||pn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!Kee(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Ft(e[r]));else return e;return t}var ev=e=>/^\w*$/.test(e),Vt=e=>e===void 0,tv=e=>Array.isArray(e)?e.filter(Boolean):[],rS=e=>tv(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ee=(e,t,n)=>{if(!t||!pn(e))return n;const o=(ev(t)?[t]:rS(t)).reduce((r,i)=>_r(r)?r:r[i],e);return Vt(o)||o===e?Vt(e[t])?n:e[t]:o},Kr=e=>typeof e=="boolean",Ct=(e,t,n)=>{let o=-1;const r=ev(t)?[t]:rS(t),i=r.length,l=i-1;for(;++o<i;){const u=r[o];let f=n;if(o!==l){const m=e[u];f=pn(m)||Array.isArray(m)?m:isNaN(+r[o+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const Zp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},wo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Zi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},oS=q.createContext(null);oS.displayName="HookFormContext";const Kf=()=>q.useContext(oS),Zee=e=>{const{children:t,...n}=e;return q.createElement(oS.Provider,{value:n},t)};var fP=(e,t,n,o=!0)=>{const r={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(r,i,{get:()=>{const l=i;return t._proxyFormState[l]!==wo.all&&(t._proxyFormState[l]=!o||wo.all),n&&(n[l]=!0),e[l]}});return r};const nv=typeof window<"u"?q.useLayoutEffect:q.useEffect;function iS(e){const t=Kf(),{control:n=t.control,disabled:o,name:r,exact:i}=e||{},[l,u]=q.useState(n._formState),f=q.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return nv(()=>n._subscribe({name:r,formState:f.current,exact:i,callback:m=>{!o&&u({...n._formState,...m})}}),[r,o,i]),q.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),q.useMemo(()=>fP(l,n,f.current,!1),[l,n])}var gi=e=>typeof e=="string",mP=(e,t,n,o,r)=>gi(e)?(o&&t.watch.add(e),Ee(n,e,r)):Array.isArray(e)?e.map(i=>(o&&t.watch.add(i),Ee(n,i))):(o&&(t.watchAll=!0),n),_w=e=>_r(e)||!cP(e);function Qi(e,t,n=new WeakSet){if(_w(e)||_w(t))return e===t;if(Ma(e)&&Ma(t))return e.getTime()===t.getTime();const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of o){const l=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const u=t[i];if(Ma(l)&&Ma(u)||pn(l)&&pn(u)||Array.isArray(l)&&Array.isArray(u)?!Qi(l,u,n):l!==u)return!1}}return!0}function Yee(e){const t=Kf(),{control:n=t.control,name:o,defaultValue:r,disabled:i,exact:l,compute:u}=e||{},f=q.useRef(r),m=q.useRef(u),p=q.useRef(void 0);m.current=u;const g=q.useMemo(()=>n._getWatch(o,f.current),[n,o]),[v,x]=q.useState(m.current?m.current(g):g);return nv(()=>n._subscribe({name:o,formState:{values:!0},exact:l,callback:b=>{if(!i){const S=mP(o,n._names,b.values||n._formValues,!1,f.current);if(m.current){const C=m.current(S);Qi(C,p.current)||(x(C),p.current=C)}else x(S)}}}),[n,i,o,l]),q.useEffect(()=>n._removeUnmounted()),v}function Xee(e){const t=Kf(),{name:n,disabled:o,control:r=t.control,shouldUnregister:i,defaultValue:l}=e,u=dP(r._names.array,n),f=q.useMemo(()=>Ee(r._formValues,n,Ee(r._defaultValues,n,l)),[r,n,l]),m=Yee({control:r,name:n,defaultValue:f,exact:!0}),p=iS({control:r,name:n,exact:!0}),g=q.useRef(e),v=q.useRef(r.register(n,{...e.rules,value:m,...Kr(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const x=q.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ee(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ee(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ee(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ee(p.validatingFields,n)},error:{enumerable:!0,get:()=>Ee(p.errors,n)}}),[p,n]),b=q.useCallback(j=>v.current.onChange({target:{value:uP(j),name:n},type:Zp.CHANGE}),[n]),S=q.useCallback(()=>v.current.onBlur({target:{value:Ee(r._formValues,n),name:n},type:Zp.BLUR}),[n,r._formValues]),C=q.useCallback(j=>{const N=Ee(r._fields,n);N&&j&&(N._f.ref={focus:()=>j.focus&&j.focus(),select:()=>j.select&&j.select(),setCustomValidity:T=>j.setCustomValidity(T),reportValidity:()=>j.reportValidity()})},[r._fields,n]),E=q.useMemo(()=>({name:n,value:m,...Kr(o)||p.disabled?{disabled:p.disabled||o}:{},onChange:b,onBlur:S,ref:C}),[n,o,p.disabled,b,S,C,m]);return q.useEffect(()=>{const j=r._options.shouldUnregister||i;r.register(n,{...g.current.rules,...Kr(g.current.disabled)?{disabled:g.current.disabled}:{}});const N=(T,k)=>{const A=Ee(r._fields,T);A&&A._f&&(A._f.mount=k)};if(N(n,!0),j){const T=Ft(Ee(r._options.defaultValues,n));Ct(r._defaultValues,n,T),Vt(Ee(r._formValues,n))&&Ct(r._formValues,n,T)}return!u&&r.register(n),()=>{(u?j&&!r._state.action:j)?r.unregister(n):N(n,!1)}},[n,r,u,i]),q.useEffect(()=>{r._setDisabledField({disabled:o,name:n})},[o,n,r]),q.useMemo(()=>({field:E,formState:p,fieldState:x}),[E,p,x])}const Wee=e=>e.render(Xee(e));var sS=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},Or=e=>Array.isArray(e)?e:[e],OT=()=>{let e=[];return{get observers(){return e},next:r=>{for(const i of e)i.next&&i.next(r)},subscribe:r=>(e.push(r),{unsubscribe:()=>{e=e.filter(i=>i!==r)}}),unsubscribe:()=>{e=[]}}},yr=e=>pn(e)&&!Object.keys(e).length,aS=e=>e.type==="file",Fo=e=>typeof e=="function",Yp=e=>{if(!nS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},hP=e=>e.type==="select-multiple",lS=e=>e.type==="radio",Qee=e=>lS(e)||qf(e),Xx=e=>Yp(e)&&e.isConnected;function Jee(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=Vt(e)?o++:e[t[o++]];return e}function ete(e){for(const t in e)if(e.hasOwnProperty(t)&&!Vt(e[t]))return!1;return!0}function dn(e,t){const n=Array.isArray(t)?t:ev(t)?[t]:rS(t),o=n.length===1?e:Jee(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(pn(o)&&yr(o)||Array.isArray(o)&&ete(o))&&dn(e,n.slice(0,-1)),e}var pP=e=>{for(const t in e)if(Fo(e[t]))return!0;return!1};function Xp(e,t={}){const n=Array.isArray(e);if(pn(e)||n)for(const o in e)Array.isArray(e[o])||pn(e[o])&&!pP(e[o])?(t[o]=Array.isArray(e[o])?[]:{},Xp(e[o],t[o])):_r(e[o])||(t[o]=!0);return t}function gP(e,t,n){const o=Array.isArray(e);if(pn(e)||o)for(const r in e)Array.isArray(e[r])||pn(e[r])&&!pP(e[r])?Vt(t)||_w(n[r])?n[r]=Array.isArray(e[r])?Xp(e[r],[]):{...Xp(e[r])}:gP(e[r],_r(t)?{}:t[r],n[r]):n[r]=!Qi(e[r],t[r]);return n}var zd=(e,t)=>gP(e,t,Xp(t));const AT={value:!1,isValid:!1},IT={value:!0,isValid:!0};var vP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Vt(e[0].attributes.value)?Vt(e[0].value)||e[0].value===""?IT:{value:e[0].value,isValid:!0}:IT:AT}return AT},yP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>Vt(e)?e:t?e===""?NaN:e&&+e:n&&gi(e)?new Date(e):o?o(e):e;const $T={isValid:!1,value:null};var bP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,$T):$T;function MT(e){const t=e.ref;return aS(t)?t.files:lS(t)?bP(e.refs).value:hP(t)?[...t.selectedOptions].map(({value:n})=>n):qf(t)?vP(e.refs).value:yP(Vt(t.value)?e.ref.value:t.value,e)}var tte=(e,t,n,o)=>{const r={};for(const i of e){const l=Ee(t,i);l&&Ct(r,i,l._f)}return{criteriaMode:n,names:[...e],fields:r,shouldUseNativeValidation:o}},Wp=e=>e instanceof RegExp,Ud=e=>Vt(e)?e:Wp(e)?e.source:pn(e)?Wp(e.value)?e.value.source:e.value:e,wc=e=>({isOnSubmit:!e||e===wo.onSubmit,isOnBlur:e===wo.onBlur,isOnChange:e===wo.onChange,isOnAll:e===wo.all,isOnTouch:e===wo.onTouched});const PT="AsyncFunction";var nte=e=>!!e&&!!e.validate&&!!(Fo(e.validate)&&e.validate.constructor.name===PT||pn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===PT)),rte=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ww=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const kc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Ee(e,r);if(i){const{_f:l,...u}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],r)&&!o)return!0;if(l.ref&&t(l.ref,l.name)&&!o)return!0;if(kc(u,t))break}else if(pn(u)&&kc(u,t))break}}};function DT(e,t,n){const o=Ee(e,n);if(o||ev(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),l=Ee(t,i),u=Ee(e,i);if(l&&!Array.isArray(l)&&n!==i)return{name:n};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};r.pop()}return{name:n}}var ote=(e,t,n,o)=>{n(e);const{name:r,...i}=e;return yr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!o||wo.all))},ite=(e,t,n)=>!e||!t||e===t||Or(e).some(o=>o&&(n?o===t:o.startsWith(t)||t.startsWith(o))),ste=(e,t,n,o,r)=>r.isOnAll?!1:!n&&r.isOnTouch?!(t||e):(n?o.isOnBlur:r.isOnBlur)?!e:(n?o.isOnChange:r.isOnChange)?e:!0,ate=(e,t)=>!tv(Ee(e,t)).length&&dn(e,t),xP=(e,t,n)=>{const o=Or(Ee(e,n));return Ct(o,"root",t[n]),Ct(e,n,o),e},Sp=e=>gi(e);function zT(e,t,n="validate"){if(Sp(e)||Array.isArray(e)&&e.every(Sp)||Kr(e)&&!e)return{type:n,message:Sp(e)?e:"",ref:t}}var mc=e=>pn(e)&&!Wp(e)?e:{value:e,message:""},Sw=async(e,t,n,o,r,i)=>{const{ref:l,refs:u,required:f,maxLength:m,minLength:p,min:g,max:v,pattern:x,validate:b,name:S,valueAsNumber:C,mount:E}=e._f,j=Ee(n,S);if(!E||t.has(S))return{};const N=u?u[0]:l,T=te=>{r&&N.reportValidity&&(N.setCustomValidity(Kr(te)?"":te||""),N.reportValidity())},k={},A=lS(l),I=qf(l),P=A||I,F=(C||aS(l))&&Vt(l.value)&&Vt(j)||Yp(l)&&l.value===""||j===""||Array.isArray(j)&&!j.length,L=sS.bind(null,S,o,k),se=(te,ce,ae,ie=Zi.maxLength,$=Zi.minLength)=>{const K=te?ce:ae;k[S]={type:te?ie:$,message:K,ref:l,...L(te?ie:$,K)}};if(i?!Array.isArray(j)||!j.length:f&&(!P&&(F||_r(j))||Kr(j)&&!j||I&&!vP(u).isValid||A&&!bP(u).isValid)){const{value:te,message:ce}=Sp(f)?{value:!!f,message:f}:mc(f);if(te&&(k[S]={type:Zi.required,message:ce,ref:N,...L(Zi.required,ce)},!o))return T(ce),k}if(!F&&(!_r(g)||!_r(v))){let te,ce;const ae=mc(v),ie=mc(g);if(!_r(j)&&!isNaN(j)){const $=l.valueAsNumber||j&&+j;_r(ae.value)||(te=$>ae.value),_r(ie.value)||(ce=$<ie.value)}else{const $=l.valueAsDate||new Date(j),K=M=>new Date(new Date().toDateString()+" "+M),U=l.type=="time",re=l.type=="week";gi(ae.value)&&j&&(te=U?K(j)>K(ae.value):re?j>ae.value:$>new Date(ae.value)),gi(ie.value)&&j&&(ce=U?K(j)<K(ie.value):re?j<ie.value:$<new Date(ie.value))}if((te||ce)&&(se(!!te,ae.message,ie.message,Zi.max,Zi.min),!o))return T(k[S].message),k}if((m||p)&&!F&&(gi(j)||i&&Array.isArray(j))){const te=mc(m),ce=mc(p),ae=!_r(te.value)&&j.length>+te.value,ie=!_r(ce.value)&&j.length<+ce.value;if((ae||ie)&&(se(ae,te.message,ce.message),!o))return T(k[S].message),k}if(x&&!F&&gi(j)){const{value:te,message:ce}=mc(x);if(Wp(te)&&!j.match(te)&&(k[S]={type:Zi.pattern,message:ce,ref:l,...L(Zi.pattern,ce)},!o))return T(ce),k}if(b){if(Fo(b)){const te=await b(j,n),ce=zT(te,N);if(ce&&(k[S]={...ce,...L(Zi.validate,ce.message)},!o))return T(ce.message),k}else if(pn(b)){let te={};for(const ce in b){if(!yr(te)&&!o)break;const ae=zT(await b[ce](j,n),N,ce);ae&&(te={...ae,...L(ce,ae.message)},T(ae.message),o&&(k[S]=te))}if(!yr(te)&&(k[S]={ref:N,...te},!o))return k}}return T(!0),k};const lte={mode:wo.onSubmit,reValidateMode:wo.onChange,shouldFocusError:!0};function cte(e={}){let t={...lte,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Fo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},o={},r=pn(t.defaultValues)||pn(t.values)?Ft(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Ft(r),l={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...p};const v={array:OT(),state:OT()},x=t.criteriaMode===wo.all,b=z=>W=>{clearTimeout(m),m=setTimeout(z,W)},S=async z=>{if(!t.disabled&&(p.isValid||g.isValid||z)){const W=t.resolver?yr((await I()).errors):await F(o,!0);W!==n.isValid&&v.state.next({isValid:W})}},C=(z,W)=>{!t.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((z||Array.from(u.mount)).forEach(oe=>{oe&&(W?Ct(n.validatingFields,oe,W):dn(n.validatingFields,oe))}),v.state.next({validatingFields:n.validatingFields,isValidating:!yr(n.validatingFields)}))},E=(z,W=[],oe,ye,xe=!0,be=!0)=>{if(ye&&oe&&!t.disabled){if(l.action=!0,be&&Array.isArray(Ee(o,z))){const je=oe(Ee(o,z),ye.argA,ye.argB);xe&&Ct(o,z,je)}if(be&&Array.isArray(Ee(n.errors,z))){const je=oe(Ee(n.errors,z),ye.argA,ye.argB);xe&&Ct(n.errors,z,je),ate(n.errors,z)}if((p.touchedFields||g.touchedFields)&&be&&Array.isArray(Ee(n.touchedFields,z))){const je=oe(Ee(n.touchedFields,z),ye.argA,ye.argB);xe&&Ct(n.touchedFields,z,je)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=zd(r,i)),v.state.next({name:z,isDirty:se(z,W),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ct(i,z,W)},j=(z,W)=>{Ct(n.errors,z,W),v.state.next({errors:n.errors})},N=z=>{n.errors=z,v.state.next({errors:n.errors,isValid:!1})},T=(z,W,oe,ye)=>{const xe=Ee(o,z);if(xe){const be=Ee(i,z,Vt(oe)?Ee(r,z):oe);Vt(be)||ye&&ye.defaultChecked||W?Ct(i,z,W?be:MT(xe._f)):ae(z,be),l.mount&&S()}},k=(z,W,oe,ye,xe)=>{let be=!1,je=!1;const We={name:z};if(!t.disabled){if(!oe||ye){(p.isDirty||g.isDirty)&&(je=n.isDirty,n.isDirty=We.isDirty=se(),be=je!==We.isDirty);const ft=Qi(Ee(r,z),W);je=!!Ee(n.dirtyFields,z),ft?dn(n.dirtyFields,z):Ct(n.dirtyFields,z,!0),We.dirtyFields=n.dirtyFields,be=be||(p.dirtyFields||g.dirtyFields)&&je!==!ft}if(oe){const ft=Ee(n.touchedFields,z);ft||(Ct(n.touchedFields,z,oe),We.touchedFields=n.touchedFields,be=be||(p.touchedFields||g.touchedFields)&&ft!==oe)}be&&xe&&v.state.next(We)}return be?We:{}},A=(z,W,oe,ye)=>{const xe=Ee(n.errors,z),be=(p.isValid||g.isValid)&&Kr(W)&&n.isValid!==W;if(t.delayError&&oe?(f=b(()=>j(z,oe)),f(t.delayError)):(clearTimeout(m),f=null,oe?Ct(n.errors,z,oe):dn(n.errors,z)),(oe?!Qi(xe,oe):xe)||!yr(ye)||be){const je={...ye,...be&&Kr(W)?{isValid:W}:{},errors:n.errors,name:z};n={...n,...je},v.state.next(je)}},I=async z=>{C(z,!0);const W=await t.resolver(i,t.context,tte(z||u.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return C(z),W},P=async z=>{const{errors:W}=await I(z);if(z)for(const oe of z){const ye=Ee(W,oe);ye?Ct(n.errors,oe,ye):dn(n.errors,oe)}else n.errors=W;return W},F=async(z,W,oe={valid:!0})=>{for(const ye in z){const xe=z[ye];if(xe){const{_f:be,...je}=xe;if(be){const We=u.array.has(be.name),ft=xe._f&&nte(xe._f);ft&&p.validatingFields&&C([ye],!0);const Rt=await Sw(xe,u.disabled,i,x,t.shouldUseNativeValidation&&!W,We);if(ft&&p.validatingFields&&C([ye]),Rt[be.name]&&(oe.valid=!1,W))break;!W&&(Ee(Rt,be.name)?We?xP(n.errors,Rt,be.name):Ct(n.errors,be.name,Rt[be.name]):dn(n.errors,be.name))}!yr(je)&&await F(je,W,oe)}}return oe.valid},L=()=>{for(const z of u.unMount){const W=Ee(o,z);W&&(W._f.refs?W._f.refs.every(oe=>!Xx(oe)):!Xx(W._f.ref))&&ue(z)}u.unMount=new Set},se=(z,W)=>!t.disabled&&(z&&W&&Ct(i,z,W),!Qi(M(),r)),te=(z,W,oe)=>mP(z,u,{...l.mount?i:Vt(W)?r:gi(z)?{[z]:W}:W},oe,W),ce=z=>tv(Ee(l.mount?i:r,z,t.shouldUnregister?Ee(r,z,[]):[])),ae=(z,W,oe={})=>{const ye=Ee(o,z);let xe=W;if(ye){const be=ye._f;be&&(!be.disabled&&Ct(i,z,yP(W,be)),xe=Yp(be.ref)&&_r(W)?"":W,hP(be.ref)?[...be.ref.options].forEach(je=>je.selected=xe.includes(je.value)):be.refs?qf(be.ref)?be.refs.forEach(je=>{(!je.defaultChecked||!je.disabled)&&(Array.isArray(xe)?je.checked=!!xe.find(We=>We===je.value):je.checked=xe===je.value||!!xe)}):be.refs.forEach(je=>je.checked=je.value===xe):aS(be.ref)?be.ref.value="":(be.ref.value=xe,be.ref.type||v.state.next({name:z,values:Ft(i)})))}(oe.shouldDirty||oe.shouldTouch)&&k(z,xe,oe.shouldTouch,oe.shouldDirty,!0),oe.shouldValidate&&re(z)},ie=(z,W,oe)=>{for(const ye in W){if(!W.hasOwnProperty(ye))return;const xe=W[ye],be=z+"."+ye,je=Ee(o,be);(u.array.has(z)||pn(xe)||je&&!je._f)&&!Ma(xe)?ie(be,xe,oe):ae(be,xe,oe)}},$=(z,W,oe={})=>{const ye=Ee(o,z),xe=u.array.has(z),be=Ft(W);Ct(i,z,be),xe?(v.array.next({name:z,values:Ft(i)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&oe.shouldDirty&&v.state.next({name:z,dirtyFields:zd(r,i),isDirty:se(z,be)})):ye&&!ye._f&&!_r(be)?ie(z,be,oe):ae(z,be,oe),ww(z,u)&&v.state.next({...n,name:z}),v.state.next({name:l.mount?z:void 0,values:Ft(i)})},K=async z=>{l.mount=!0;const W=z.target;let oe=W.name,ye=!0;const xe=Ee(o,oe),be=ft=>{ye=Number.isNaN(ft)||Ma(ft)&&isNaN(ft.getTime())||Qi(ft,Ee(i,oe,ft))},je=wc(t.mode),We=wc(t.reValidateMode);if(xe){let ft,Rt;const zr=W.type?MT(xe._f):uP(z),Ur=z.type===Zp.BLUR||z.type===Zp.FOCUS_OUT,ni=!rte(xe._f)&&!t.resolver&&!Ee(n.errors,oe)&&!xe._f.deps||ste(Ur,Ee(n.touchedFields,oe),n.isSubmitted,We,je),ri=ww(oe,u,Ur);Ct(i,oe,zr),Ur?(!W||!W.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(z),f&&f(0)):xe._f.onChange&&xe._f.onChange(z);const oi=k(oe,zr,Ur),io=!yr(oi)||ri;if(!Ur&&v.state.next({name:oe,type:z.type,values:Ft(i)}),ni)return(p.isValid||g.isValid)&&(t.mode==="onBlur"?Ur&&S():Ur||S()),io&&v.state.next({name:oe,...ri?{}:oi});if(!Ur&&ri&&v.state.next({...n}),t.resolver){const{errors:ii}=await I([oe]);if(be(zr),ye){const Ti=DT(n.errors,o,oe),ds=DT(ii,o,Ti.name||oe);ft=ds.error,oe=ds.name,Rt=yr(ii)}}else C([oe],!0),ft=(await Sw(xe,u.disabled,i,x,t.shouldUseNativeValidation))[oe],C([oe]),be(zr),ye&&(ft?Rt=!1:(p.isValid||g.isValid)&&(Rt=await F(o,!0)));ye&&(xe._f.deps&&re(xe._f.deps),A(oe,Rt,ft,oi))}},U=(z,W)=>{if(Ee(n.errors,W)&&z.focus)return z.focus(),1},re=async(z,W={})=>{let oe,ye;const xe=Or(z);if(t.resolver){const be=await P(Vt(z)?z:xe);oe=yr(be),ye=z?!xe.some(je=>Ee(be,je)):oe}else z?(ye=(await Promise.all(xe.map(async be=>{const je=Ee(o,be);return await F(je&&je._f?{[be]:je}:je)}))).every(Boolean),!(!ye&&!n.isValid)&&S()):ye=oe=await F(o);return v.state.next({...!gi(z)||(p.isValid||g.isValid)&&oe!==n.isValid?{}:{name:z},...t.resolver||!z?{isValid:oe}:{},errors:n.errors}),W.shouldFocus&&!ye&&kc(o,U,z?xe:u.mount),ye},M=z=>{const W={...l.mount?i:r};return Vt(z)?W:gi(z)?Ee(W,z):z.map(oe=>Ee(W,oe))},H=(z,W)=>({invalid:!!Ee((W||n).errors,z),isDirty:!!Ee((W||n).dirtyFields,z),error:Ee((W||n).errors,z),isValidating:!!Ee(n.validatingFields,z),isTouched:!!Ee((W||n).touchedFields,z)}),le=z=>{z&&Or(z).forEach(W=>dn(n.errors,W)),v.state.next({errors:z?n.errors:{}})},B=(z,W,oe)=>{const ye=(Ee(o,z,{_f:{}})._f||{}).ref,xe=Ee(n.errors,z)||{},{ref:be,message:je,type:We,...ft}=xe;Ct(n.errors,z,{...ft,...W,ref:ye}),v.state.next({name:z,errors:n.errors,isValid:!1}),oe&&oe.shouldFocus&&ye&&ye.focus&&ye.focus()},Y=(z,W)=>Fo(z)?v.state.subscribe({next:oe=>"values"in oe&&z(te(void 0,W),oe)}):te(z,W,!0),pe=z=>v.state.subscribe({next:W=>{ite(z.name,W.name,z.exact)&&ote(W,z.formState||p,Mt,z.reRenderRoot)&&z.callback({values:{...i},...n,...W,defaultValues:r})}}).unsubscribe,ve=z=>(l.mount=!0,g={...g,...z.formState},pe({...z,formState:g})),ue=(z,W={})=>{for(const oe of z?Or(z):u.mount)u.mount.delete(oe),u.array.delete(oe),W.keepValue||(dn(o,oe),dn(i,oe)),!W.keepError&&dn(n.errors,oe),!W.keepDirty&&dn(n.dirtyFields,oe),!W.keepTouched&&dn(n.touchedFields,oe),!W.keepIsValidating&&dn(n.validatingFields,oe),!t.shouldUnregister&&!W.keepDefaultValue&&dn(r,oe);v.state.next({values:Ft(i)}),v.state.next({...n,...W.keepDirty?{isDirty:se()}:{}}),!W.keepIsValid&&S()},de=({disabled:z,name:W})=>{(Kr(z)&&l.mount||z||u.disabled.has(W))&&(z?u.disabled.add(W):u.disabled.delete(W))},Re=(z,W={})=>{let oe=Ee(o,z);const ye=Kr(W.disabled)||Kr(t.disabled);return Ct(o,z,{...oe||{},_f:{...oe&&oe._f?oe._f:{ref:{name:z}},name:z,mount:!0,...W}}),u.mount.add(z),oe?de({disabled:Kr(W.disabled)?W.disabled:t.disabled,name:z}):T(z,!0,W.value),{...ye?{disabled:W.disabled||t.disabled}:{},...t.progressive?{required:!!W.required,min:Ud(W.min),max:Ud(W.max),minLength:Ud(W.minLength),maxLength:Ud(W.maxLength),pattern:Ud(W.pattern)}:{},name:z,onChange:K,onBlur:K,ref:xe=>{if(xe){Re(z,W),oe=Ee(o,z);const be=Vt(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,je=Qee(be),We=oe._f.refs||[];if(je?We.find(ft=>ft===be):be===oe._f.ref)return;Ct(o,z,{_f:{...oe._f,...je?{refs:[...We.filter(Xx),be,...Array.isArray(Ee(r,z))?[{}]:[]],ref:{type:be.type,name:z}}:{ref:be}}}),T(z,!1,void 0,be)}else oe=Ee(o,z,{}),oe._f&&(oe._f.mount=!1),(t.shouldUnregister||W.shouldUnregister)&&!(dP(u.array,z)&&l.action)&&u.unMount.add(z)}}},Le=()=>t.shouldFocusError&&kc(o,U,u.mount),Ye=z=>{Kr(z)&&(v.state.next({disabled:z}),kc(o,(W,oe)=>{const ye=Ee(o,oe);ye&&(W.disabled=ye._f.disabled||z,Array.isArray(ye._f.refs)&&ye._f.refs.forEach(xe=>{xe.disabled=ye._f.disabled||z}))},0,!1))},He=(z,W)=>async oe=>{let ye;oe&&(oe.preventDefault&&oe.preventDefault(),oe.persist&&oe.persist());let xe=Ft(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:be,values:je}=await I();n.errors=be,xe=Ft(je)}else await F(o);if(u.disabled.size)for(const be of u.disabled)dn(xe,be);if(dn(n.errors,"root"),yr(n.errors)){v.state.next({errors:{}});try{await z(xe,oe)}catch(be){ye=be}}else W&&await W({...n.errors},oe),Le(),setTimeout(Le);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:yr(n.errors)&&!ye,submitCount:n.submitCount+1,errors:n.errors}),ye)throw ye},Ht=(z,W={})=>{Ee(o,z)&&(Vt(W.defaultValue)?$(z,Ft(Ee(r,z))):($(z,W.defaultValue),Ct(r,z,Ft(W.defaultValue))),W.keepTouched||dn(n.touchedFields,z),W.keepDirty||(dn(n.dirtyFields,z),n.isDirty=W.defaultValue?se(z,Ft(Ee(r,z))):se()),W.keepError||(dn(n.errors,z),p.isValid&&S()),v.state.next({...n}))},Yt=(z,W={})=>{const oe=z?Ft(z):r,ye=Ft(oe),xe=yr(z),be=xe?r:ye;if(W.keepDefaultValues||(r=oe),!W.keepValues){if(W.keepDirtyValues){const je=new Set([...u.mount,...Object.keys(zd(r,i))]);for(const We of Array.from(je))Ee(n.dirtyFields,We)?Ct(be,We,Ee(i,We)):$(We,Ee(be,We))}else{if(nS&&Vt(z))for(const je of u.mount){const We=Ee(o,je);if(We&&We._f){const ft=Array.isArray(We._f.refs)?We._f.refs[0]:We._f.ref;if(Yp(ft)){const Rt=ft.closest("form");if(Rt){Rt.reset();break}}}}if(W.keepFieldsRef)for(const je of u.mount)$(je,Ee(be,je));else o={}}i=t.shouldUnregister?W.keepDefaultValues?Ft(r):{}:Ft(be),v.array.next({values:{...be}}),v.state.next({values:{...be}})}u={mount:W.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!p.isValid||!!W.keepIsValid||!!W.keepDirtyValues,l.watch=!!t.shouldUnregister,v.state.next({submitCount:W.keepSubmitCount?n.submitCount:0,isDirty:xe?!1:W.keepDirty?n.isDirty:!!(W.keepDefaultValues&&!Qi(z,r)),isSubmitted:W.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:xe?{}:W.keepDirtyValues?W.keepDefaultValues&&i?zd(r,i):n.dirtyFields:W.keepDefaultValues&&z?zd(r,z):W.keepDirty?n.dirtyFields:{},touchedFields:W.keepTouched?n.touchedFields:{},errors:W.keepErrors?n.errors:{},isSubmitSuccessful:W.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:r})},Kn=(z,W)=>Yt(Fo(z)?z(i):z,W),fr=(z,W={})=>{const oe=Ee(o,z),ye=oe&&oe._f;if(ye){const xe=ye.refs?ye.refs[0]:ye.ref;xe.focus&&(xe.focus(),W.shouldSelect&&Fo(xe.select)&&xe.select())}},Mt=z=>{n={...n,...z}},Pt={control:{register:Re,unregister:ue,getFieldState:H,handleSubmit:He,setError:B,_subscribe:pe,_runSchema:I,_focusError:Le,_getWatch:te,_getDirty:se,_setValid:S,_setFieldArray:E,_setDisabledField:de,_setErrors:N,_getFieldArray:ce,_reset:Yt,_resetDefaultValues:()=>Fo(t.defaultValues)&&t.defaultValues().then(z=>{Kn(z,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:Ye,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return i},get _state(){return l},set _state(z){l=z},get _defaultValues(){return r},get _names(){return u},set _names(z){u=z},get _formState(){return n},get _options(){return t},set _options(z){t={...t,...z}}},subscribe:ve,trigger:re,register:Re,handleSubmit:He,watch:Y,setValue:$,getValues:M,reset:Kn,resetField:Ht,clearErrors:le,unregister:ue,setError:B,setFocus:fr,getFieldState:H};return{...Pt,formControl:Pt}}var Ps=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Wx=(e,t,n={})=>n.shouldFocus||Vt(n.shouldFocus)?n.focusName||`${e}.${Vt(n.focusIndex)?t:n.focusIndex}.`:"",Qx=(e,t)=>[...e,...Or(t)],Jx=e=>Array.isArray(e)?e.map(()=>{}):void 0;function e_(e,t,n){return[...e.slice(0,t),...Or(n),...e.slice(t)]}var t_=(e,t,n)=>Array.isArray(e)?(Vt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],n_=(e,t)=>[...Or(t),...Or(e)];function ute(e,t){let n=0;const o=[...e];for(const r of t)o.splice(r-n,1),n++;return tv(o).length?o:[]}var r_=(e,t)=>Vt(t)?[]:ute(e,Or(t).sort((n,o)=>n-o)),o_=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},UT=(e,t,n)=>(e[t]=n,e);function _P(e){const t=Kf(),{control:n=t.control,name:o,keyName:r="id",shouldUnregister:i,rules:l}=e,[u,f]=q.useState(n._getFieldArray(o)),m=q.useRef(n._getFieldArray(o).map(Ps)),p=q.useRef(u),g=q.useRef(!1);p.current=u,n._names.array.add(o),q.useMemo(()=>l&&n.register(o,l),[n,l,o]),nv(()=>n._subjects.array.subscribe({next:({values:k,name:A})=>{if(A===o||!A){const I=Ee(k,o);Array.isArray(I)&&(f(I),m.current=I.map(Ps))}}}).unsubscribe,[n,o]);const v=q.useCallback(k=>{g.current=!0,n._setFieldArray(o,k)},[n,o]),x=(k,A)=>{const I=Or(Ft(k)),P=Qx(n._getFieldArray(o),I);n._names.focus=Wx(o,P.length-1,A),m.current=Qx(m.current,I.map(Ps)),v(P),f(P),n._setFieldArray(o,P,Qx,{argA:Jx(k)})},b=(k,A)=>{const I=Or(Ft(k)),P=n_(n._getFieldArray(o),I);n._names.focus=Wx(o,0,A),m.current=n_(m.current,I.map(Ps)),v(P),f(P),n._setFieldArray(o,P,n_,{argA:Jx(k)})},S=k=>{const A=r_(n._getFieldArray(o),k);m.current=r_(m.current,k),v(A),f(A),!Array.isArray(Ee(n._fields,o))&&Ct(n._fields,o,void 0),n._setFieldArray(o,A,r_,{argA:k})},C=(k,A,I)=>{const P=Or(Ft(A)),F=e_(n._getFieldArray(o),k,P);n._names.focus=Wx(o,k,I),m.current=e_(m.current,k,P.map(Ps)),v(F),f(F),n._setFieldArray(o,F,e_,{argA:k,argB:Jx(A)})},E=(k,A)=>{const I=n._getFieldArray(o);o_(I,k,A),o_(m.current,k,A),v(I),f(I),n._setFieldArray(o,I,o_,{argA:k,argB:A},!1)},j=(k,A)=>{const I=n._getFieldArray(o);t_(I,k,A),t_(m.current,k,A),v(I),f(I),n._setFieldArray(o,I,t_,{argA:k,argB:A},!1)},N=(k,A)=>{const I=Ft(A),P=UT(n._getFieldArray(o),k,I);m.current=[...P].map((F,L)=>!F||L===k?Ps():m.current[L]),v(P),f([...P]),n._setFieldArray(o,P,UT,{argA:k,argB:I},!0,!1)},T=k=>{const A=Or(Ft(k));m.current=A.map(Ps),v([...A]),f([...A]),n._setFieldArray(o,[...A],I=>I,{},!0,!1)};return q.useEffect(()=>{if(n._state.action=!1,ww(o,n._names)&&n._subjects.state.next({...n._formState}),g.current&&(!wc(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!wc(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([o]).then(k=>{const A=Ee(k.errors,o),I=Ee(n._formState.errors,o);(I?!A&&I.type||A&&(I.type!==A.type||I.message!==A.message):A&&A.type)&&(A?Ct(n._formState.errors,o,A):dn(n._formState.errors,o),n._subjects.state.next({errors:n._formState.errors}))});else{const k=Ee(n._fields,o);k&&k._f&&!(wc(n._options.reValidateMode).isOnSubmit&&wc(n._options.mode).isOnSubmit)&&Sw(k,n._names.disabled,n._formValues,n._options.criteriaMode===wo.all,n._options.shouldUseNativeValidation,!0).then(A=>!yr(A)&&n._subjects.state.next({errors:xP(n._formState.errors,A,o)}))}n._subjects.state.next({name:o,values:Ft(n._formValues)}),n._names.focus&&kc(n._fields,(k,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&k.focus)return k.focus(),1}),n._names.focus="",n._setValid(),g.current=!1},[u,o,n]),q.useEffect(()=>(!Ee(n._formValues,o)&&n._setFieldArray(o),()=>{const k=(A,I)=>{const P=Ee(n._fields,A);P&&P._f&&(P._f.mount=I)};n._options.shouldUnregister||i?n.unregister(o):k(o,!1)}),[o,n,r,i]),{swap:q.useCallback(E,[v,o,n]),move:q.useCallback(j,[v,o,n]),prepend:q.useCallback(b,[v,o,n]),append:q.useCallback(x,[v,o,n]),remove:q.useCallback(S,[v,o,n]),insert:q.useCallback(C,[v,o,n]),update:q.useCallback(N,[v,o,n]),replace:q.useCallback(T,[v,o,n]),fields:q.useMemo(()=>u.map((k,A)=>({...k,[r]:m.current[A]||Ps()})),[u,r])}}function vn(e={}){const t=q.useRef(void 0),n=q.useRef(void 0),[o,r]=q.useState({isDirty:!1,isValidating:!1,isLoading:Fo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Fo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Fo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...u}=cte(e);t.current={...u,formState:o}}const i=t.current.control;return i._options=e,nv(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>r({...i._formState}),reRenderRoot:!0});return r(u=>({...u,isReady:!0})),i._formState.isReady=!0,l},[i]),q.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),q.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),q.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),q.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),q.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==o.isDirty&&i._subjects.state.next({isDirty:l})}},[i,o.isDirty]),q.useEffect(()=>{e.values&&!Qi(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,r(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),q.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=fP(o,i),t.current}const yn=Zee,wP=_.createContext({}),SP=_.createContext({});function cS(){const e=_.useContext(wP),t=_.useContext(SP),{getFieldState:n}=Kf(),o=iS({name:e.name}),r=n(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...r}}function Me({...e}){const{error:t,formItemId:n,formDescriptionId:o,formMessageId:r}=cS();return c.jsx(o0,{"data-slot":"form-control",id:n,"aria-describedby":t?`${o} ${r}`:`${o}`,"aria-invalid":!!t,...e})}function Pe({...e}){return c.jsx(wP,{value:{name:e.name},children:c.jsx(Wee,{...e})})}function Oe({className:e,...t}){const n=_.useId();return c.jsx(SP,{value:{id:n},children:c.jsx("div",{"data-slot":"form-item",className:$e("grid gap-2",e),...t})})}var dte="Label",CP=_.forwardRef((e,t)=>c.jsx(Ue.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));CP.displayName=dte;var fte=CP;function uS({className:e,...t}){return c.jsx(fte,{"data-slot":"label",className:$e("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Ae({className:e,...t}){const{error:n,formItemId:o}=cS();return c.jsx(uS,{"data-slot":"form-label","data-error":!!n,className:$e("data-[error=true]:text-destructive",e),htmlFor:o,...t})}function Ie({className:e,...t}){const{error:n,formMessageId:o}=cS(),r=n?String(n?.message):t.children;return r?c.jsx("p",{"data-slot":"form-message",id:o,className:$e("text-destructive text-sm",e),...t,children:r}):null}function Fe({className:e,type:t,...n}){return c.jsx("input",{type:t,"data-slot":"input",className:$e(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
|
|
293
|
+
${v}`),e.finish(S=>{b(Bk(S))})}return{flushController:n,add:m,upsert:m,stop:i.unsubscribe}}function Bk(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function k$({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:o,sessionExpireObservable:r}){const i=o.subscribe(b=>p(b.reason)),l=r.subscribe(()=>p("session_expire")),u=new bt(()=>()=>{i.unsubscribe(),l.unsubscribe()});let f=0,m=0;function p(b){if(m===0)return;const S=m,C=f;m=0,f=0,x(),u.notify({reason:b,messagesCount:S,bytesCount:C})}let g;function v(){g===void 0&&(g=sr(()=>{p("duration_limit")},n))}function x(){_o(g),g=void 0}return{flushObservable:u,get messagesCount(){return m},notifyBeforeAddMessage(b){f+b>=t&&p("bytes_limit"),m+=1,f+=b,v()},notifyAfterAddMessage(b=0){f+=b,m>=e?p("messages_limit"):f>=t&&p("bytes_limit")},notifyAfterRemoveMessage(b){f-=b,m-=1,m===0&&x()}}}const Ys="DISCARDED",to="SKIPPED";function dK(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(o=>o!==n)}}},triggerHook(t,n){const o=e[t]||[],r=[];for(const i of o){const l=i(n);if(l===Ys)return Ys;l!==to&&r.push(l)}return os(...r)}}}const xi={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},fK=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],mK=[q7];let Ix;function bu(){return Ix||(Ix=new WI(100)),Ix}function hK(e,t,n,o,r,i){const l=new bt,{stop:u}=gK(t,o,r,i,l),{enabled:f}=pK(e,t,n,l);return{stop:u,enabled:f}}function pK(e,t,n,o){const r={},i=!mK.includes(t.site)&&ts(t.telemetrySampleRate),l={[xi.LOG]:i,[xi.CONFIGURATION]:i&&ts(t.telemetryConfigurationSampleRate),[xi.USAGE]:i&&ts(t.telemetryUsageSampleRate)},u=vK(),f=bu();return f.subscribe(({rawEvent:p,kind:g})=>{if(!l[p.type])return;let v=r[g];if(v||(v=r[g]=new Set),v.size>=t.maxTelemetryEventsPerPage)return;const x=vu(p);if(v.has(x))return;const b=n.triggerHook(1,{startTime:Gn().relative});if(b===Ys)return;const S=m(b,e,p,u);o.notify(S),v$("telemetry",S),v.add(x)}),f.unbuffer(),Zq(A0),{enabled:i};function m(p,g,v,x){const S={type:"telemetry",date:Gn().timeStamp,service:g,version:"6.19.0",source:"browser",_dd:{format_version:2},telemetry:os(v,{runtime_env:x,connectivity:y$(),sdk_setup:"npm"}),experimental_features:Array.from(B7())};return os(S,p)}}function gK(e,t,n,o,r){const i=[];if(Yc()){const l=Lf(),u=r.subscribe(f=>l.send("internal_telemetry",f));i.push(u.unsubscribe)}else{const l=[e.rumEndpointBuilder];e.replica&&yK(e)&&l.push(e.replica.rumEndpointBuilder);const u=N$({encoder:o(4),request:R$(l,e.batchBytesLimit,t),flushController:k$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new bt}),messageBytesLimit:e.messageBytesLimit});i.push(u.stop);const f=r.subscribe(u.add);i.push(f.unsubscribe)}return{stop:()=>i.forEach(l=>l())}}function vK(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function yK(e){return e.site===g$}function oa(e,t){lw(Ug.debug,e,t),bu().notify({rawEvent:{type:xi.LOG,message:e,status:"debug",...t},kind:"debug"})}function A0(e,t){bu().notify({rawEvent:{type:xi.LOG,status:"error",...xK(e),...t},kind:"error"})}function bK(e){bu().notify({rawEvent:{type:xi.CONFIGURATION,configuration:e},kind:xi.CONFIGURATION})}function I0(e,t){bu().notify({rawEvent:{type:xi.LOG,message:e,status:"debug",...t},kind:e})}function vr(e){bu().notify({rawEvent:{type:xi.USAGE,usage:e},kind:xi.USAGE})}function xK(e){if(ul(e)){const t=zf(e);return{error:{kind:t.name,stack:Uf(_K(t))},message:t.message}}return{error:{stack:p$},message:`Uncaught ${vu(e)}`}}function _K(e){return e.stack=e.stack.filter(t=>!t.url||fK.some(n=>t.url.startsWith(n))),e}const wK=10,SK=100,CK=cr,T$="--",O$=[];let vp;function Ta(e,t,n=0){var o;const{isLockEnabled:r,persistSession:i,expireSession:l}=t,u=v=>i({...v,lock:m}),f=()=>{const{lock:v,...x}=t.retrieveSession();return{session:x,lock:v&&!RK(v)?v:void 0}};if(vp||(vp=e),e!==vp){O$.push(e);return}if(r&&n>=SK){oa("Aborted session operation after max lock retries",{currentStore:f()}),Hk(t);return}let m,p=f();if(r){if(p.lock){Lh(e,t,n);return}if(m=EK(),u(p.session),p=f(),p.lock!==m){Lh(e,t,n);return}}let g=e.process(p.session);if(r&&(p=f(),p.lock!==m)){Lh(e,t,n);return}if(g&&(tf(g)?l(g):(a$(g),r?u(g):i(g))),r&&!(g&&tf(g))){if(p=f(),p.lock!==m){Lh(e,t,n);return}i(p.session),g=p.session}(o=e.after)===null||o===void 0||o.call(e,g||p.session),Hk(t)}function Lh(e,t,n){sr(()=>{Ta(e,t,n+1)},wK)}function Hk(e){vp=void 0;const t=O$.shift();t&&Ta(t,e)}function EK(){return ur()+T$+Bn()}function RK(e){const[,t]=e.split(T$);return!t||en(Number(t),Bn())>CK}const Gk=cr;function jK(e){switch(e.sessionPersistence){case mf.COOKIE:return Uk(e);case mf.LOCAL_STORAGE:return Fk();case void 0:{let t=Uk(e);return!t&&e.allowFallbackToLocalStorage&&(t=Fk()),t}default:ht.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function NK(e,t){return e.type===mf.COOKIE?d7(t,e.cookieOptions):h7(t)}function kK(e,t,n,o,r=NK(e,t)){const i=new bt,l=new bt,u=new bt,f=gu(x,Gk);let m;S();const{throttled:p,cancel:g}=Bg(()=>{Ta({process:A=>{if(gp(A))return;const I=b(A);return C(I),I},after:A=>{s$(A)&&!E()&&T(A),m=A}},r)},Gk);function v(){Ta({process:A=>E()?b(A):void 0},r)}function x(){const A=r.retrieveSession();tf(A)?Ta({process:I=>tf(I)?ka(I,t):void 0,after:b},r):b(A)}function b(A){return tf(A)&&(A=ka(A,t)),E()&&(j(A)?N():(u.notify({previousState:m,newState:A}),m=A)),A}function S(){Ta({process:A=>{if(gp(A))return ka(A,t)},after:A=>{m=A}},r)}function C(A){if(gp(A))return!1;const I=o(A[n]);A[n]=I,delete A.isExpired,I!==o$&&!A.id&&(A.id=ur(),A.created=String(Ro()))}function E(){return m?.[n]!==void 0}function j(A){return m.id!==A.id||m[n]!==A[n]}function N(){m=ka(m,t),l.notify()}function T(A){m=A,i.notify()}function k(A){Ta({process:I=>({...I,...A}),after:b},r)}return{expandOrRenewSession:p,expandSession:v,getSession:()=>m,renewObservable:i,expireObservable:l,sessionStateUpdateObservable:u,restartSession:S,expire:()=>{g(),r.expireSession(m),b(ka(m,t))},stop:()=>{Vg(f)},updateSessionState:k}}const dw={GRANTED:"granted",NOT_GRANTED:"not-granted"};function TK(e){const t=new bt;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===dw.GRANTED},observable:t}}function $0(e){const t=dl(e);return t==="string"||t==="function"||e instanceof RegExp}function M0(e,t,n=!1){return e.some(o=>{try{if(typeof o=="function")return o(t);if(o instanceof RegExp)return o.test(t);if(typeof o=="string")return n?t.startsWith(o):o===t}catch(r){ht.error(r)}return!1})}const A$=["chrome-extension://","moz-extension://"];function qk(e){return A$.some(t=>e.includes(t))}function OK(e,t=""){return!qk(e)&&qk(t)}function AK(e=""){for(const t of A$){const n=e.match(new RegExp(`${t}[^/]+`));if(n)return n[0]}}const Kk="Running the Browser SDK in a Web extension content script is discouraged and will be forbidden in a future major release unless the `allowedTrackingOrigins` option is provided.",IK="SDK initialized on a non-allowed domain.";function $K(e,t=typeof location<"u"?location.origin:"",n=new Error().stack){const o=e.allowedTrackingOrigins;if(!o){if(OK(t,n)){ht.warn(Kk);const i=AK(n);oa(Kk,{extensionUrl:i||"unknown"})}return!0}const r=M0(o,t);return r||ht.error(IK),r}function P0(e){return D0(e,location.href).href}function MK(e){try{return!!D0(e)}catch{return!1}}function PK(e){const t=D0(e).pathname;return t[0]==="/"?t:`/${t}`}function D0(e,t){const{URL:n}=DK();try{return t!==void 0?new n(e,t):new n(e)}catch(o){throw new Error(`Failed to construct URL: ${String(o)} ${vu({url:e,base:t})}`)}}let $x;function DK(){if(!$x){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=window}$x={URL:t.URL},e?.remove()}return $x}function Oa(e,t,n){const o=zK(e,t);return{build(r,i){const l=UK(e,t,r,i,n);return o(l)},trackType:t}}function zK(e,t){const n=`/api/v2/${t}`,o=e.proxy;if(typeof o=="string"){const i=P0(o);return l=>`${i}?ddforward=${encodeURIComponent(`${n}?${l}`)}`}if(typeof o=="function")return i=>o({path:n,parameters:i});const r=I$(t,e);return i=>`https://${r}${n}?${i}`}function I$(e,t){const{site:n=$a,internalAnalyticsSubdomain:o}=t;if(e==="logs"&&t.usePciIntake&&n===$a)return K7;if(o&&n===$a)return`${o}.${$a}`;if(n===H7)return`http-intake.logs.${n}`;const r=n.split("."),i=r.pop();return`browser-intake-${r.join("-")}.${i}`}function UK({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},o,r,{retry:i,encoding:l},u=[]){const f=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.19.0")}`,"dd-evp-origin=browser",`dd-request-id=${ur()}`].concat(u);return l&&f.push(`dd-evp-encoding=${l}`),o==="rum"&&(f.push(`batch_time=${Bn()}`,`_dd.api=${r}`),i&&f.push(`_dd.retry_count=${i.count}`,`_dd.retry_after=${i.lastFailureStatus}`)),t&&f.reverse(),f.join("&")}function LK(e){const t=e.site||$a,n=e.source==="flutter"?"flutter":"browser",o=FK({...e,site:t,source:n});return{replica:VK({...e,site:t,source:n}),site:t,source:n,...o}}function FK(e){return{logsEndpointBuilder:Oa(e,"logs"),rumEndpointBuilder:Oa(e,"rum"),profilingEndpointBuilder:Oa(e,"profile"),sessionReplayEndpointBuilder:Oa(e,"replay"),exposuresEndpointBuilder:Oa(e,"exposures")}}function VK(e){if(!e.replica)return;const t={...e,site:$a,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Oa(t,"logs"),rumEndpointBuilder:Oa(t,"rum",[`application.id=${e.replica.applicationId}`])}}function BK(e){return Z7.every(t=>e.includes(t))}const nf={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},fw={ALL:"all",SAMPLED:"sampled"};function Mx(e,t){return e!=null&&typeof e!="string"?(ht.error(`${t} must be defined as a string`),!1):!0}function HK(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(ht.error(`Site should be a valid Datadog site. ${E0} ${Lg}/getting_started/site/.`),!1):!0}function xc(e,t){return e!==void 0&&!Uq(e)?(ht.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function GK(e){var t,n,o,r,i,l,u,f,m,p;if(!e||!e.clientToken){ht.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){ht.error("Allowed Tracking Origins must be an array");return}if(!(!HK(e.site)||!xc(e.sessionSampleRate,"Session")||!xc(e.telemetrySampleRate,"Telemetry")||!xc(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!xc(e.telemetryUsageSampleRate,"Telemetry Usage")||!Mx(e.version,"Version")||!Mx(e.env,"Env")||!Mx(e.service,"Service")||!$K(e))){if(e.trackingConsent!==void 0&&!Lp(dw,e.trackingConsent)){ht.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&VI(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:jK(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(o=e.telemetryConfigurationSampleRate)!==null&&o!==void 0?o:5,telemetryUsageSampleRate:(r=e.telemetryUsageSampleRate)!==null&&r!==void 0?r:5,service:(i=e.service)!==null&&i!==void 0?i:void 0,env:(l=e.env)!==null&&l!==void 0?l:void 0,version:(u=e.version)!==null&&u!==void 0?u:void 0,datacenter:(f=e.datacenter)!==null&&f!==void 0?f:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(m=e.trackingConsent)!==null&&m!==void 0?m:dw.GRANTED,trackAnonymousUser:(p=e.trackAnonymousUser)!==null&&p!==void 0?p:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*uf,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*cr,batchMessagesLimit:50,messageBytesLimit:256*uf,variant:e.variant,sdkVersion:e.sdkVersion,...LK(e)}}}function qK(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}const KK=200;function ZK(e){const{env:t,service:n,version:o,datacenter:r,sdkVersion:i,variant:l}=e,u=[lc("sdk_version",i??"6.19.0")];return t&&u.push(lc("env",t)),n&&u.push(lc("service",n)),o&&u.push(lc("version",o)),r&&u.push(lc("datacenter",r)),l&&u.push(lc("variant",l)),u}function lc(e,t){const n=t?`${e}:${t}`:e;return(n.length>KK||XK(n))&&ht.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${E0} ${Lg}/getting_started/tagging/#defining-tags`),YK(n)}function YK(e){return e.replace(/,/g,"_")}function XK(e){return WK()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function WK(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function _i(e,t,n,{computeHandlingStack:o}={}){let r=e[t];if(typeof r!="function")if(t in e&&t.startsWith("on"))r=kt;else return{stop:kt};let i=!1;const l=function(){if(i)return r.apply(this,arguments);const u=Array.from(arguments);let f;Ya(n,null,[{target:this,parameters:u,onPostCall:p=>{f=p},handlingStack:o?hf("instrumented method"):void 0}]);const m=r.apply(this,u);return f&&Ya(f,null,[m]),m};return e[t]=l,{stop:()=>{i=!0,e[t]===l&&(e[t]=r)}}}function Abe(e,t,n){const o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o.set||!o.configurable)return{stop:kt};const r=kt;let i=(u,f)=>{sr(()=>{i!==r&&n(u,f)},0)};const l=function(u){o.set.call(this,u),i(this,u)};return Object.defineProperty(e,t,{set:l}),{stop:()=>{var u;((u=Object.getOwnPropertyDescriptor(e,t))===null||u===void 0?void 0:u.set)===l&&Object.defineProperty(e,t,o),i=r}}}function QK(){return new bt(e=>{const t=(r,i)=>{const l=k0({stackTrace:i,originalError:r,startClocks:Gn(),nonErrorPrefix:"Uncaught",source:yu.SOURCE,handling:"unhandled"});e.notify(l)},{stop:n}=JK(t),{stop:o}=eZ(t);return()=>{n(),o()}})}function JK(e){return _i(Qo(),"onerror",({parameters:[t,n,o,r,i]})=>{let l;ul(i)||(l=I7(t,n,o,r)),e(i??t,l)})}function eZ(e){return _i(Qo(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function tZ(e){const t={version:"6.19.0",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return Yq},enumerable:!1}),t}function nZ(e,t,n){const o=e[t];o&&!o.q&&o.version&&ht.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,o&&o.q&&o.q.forEach(r=>VI(r,"onReady callback threw an error:")())}function $$(e,t){t.silentMultipleInit||ht.error(`${e} is already initialized.`)}const pf={intervention:"intervention",cspViolation:"csp_violation"};function rZ(e,t){const n=[];t.includes(pf.cspViolation)&&n.push(iZ(e));const o=t.filter(r=>r!==pf.cspViolation);return o.length&&n.push(oZ(o)),XI(...n)}function oZ(e){return new bt(t=>{if(!window.ReportingObserver)return;const n=tt((r,i)=>r.forEach(l=>t.notify(sZ(l)))),o=new window.ReportingObserver(n,{types:e,buffered:!0});return o.observe(),()=>{o.disconnect()}})}function iZ(e){return new bt(t=>{const{stop:n}=Qt(e,document,"securitypolicyviolation",o=>{t.notify(aZ(o))});return n})}function sZ(e){const{type:t,body:n}=e;return M$({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:P$(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function aZ(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return M$({type:e.effectiveDirective,message:`${pf.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:P$(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${QI(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function M$(e){return{startClocks:Gn(),source:yu.REPORT,handling:"unhandled",...e}}function P$(e,t,n,o,r){return n?Uf({name:e,message:t,stack:[{func:"?",url:n,line:o??void 0,column:r??void 0}]}):void 0}function D$(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}const Fh=1/0,lZ=Mr;let Id=null;const yp=new Set;function cZ(){yp.forEach(e=>e())}function xu({expireDelay:e,maxEntries:t}){let n=[];Id||(Id=gu(()=>cZ(),lZ));const o=()=>{const p=eo()-e;for(;n.length>0&&n[n.length-1].endTime<p;)n.pop()};yp.add(o);function r(p,g){const v={value:p,startTime:g,endTime:Fh,remove:()=>{D$(n,v)},close:x=>{v.endTime=x}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function i(p=Fh,g={returnInactive:!1}){for(const v of n)if(v.startTime<=p){if(g.returnInactive||p<=v.endTime)return v.value;break}}function l(p){const g=n[0];g&&g.endTime===Fh&&g.close(p)}function u(p=Fh,g=0){const v=pu(p,g);return n.filter(x=>x.startTime<=v&&p<=x.endTime).map(x=>x.value)}function f(){n=[]}function m(){yp.delete(o),yp.size===0&&Id&&(Vg(Id),Id=null)}return{add:r,find:i,closeActive:l,findAll:u,reset:f,stop:m}}const uZ="datadog-synthetics-public-id",dZ="datadog-synthetics-result-id",fZ="datadog-synthetics-injects-rum";function z$(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||Us(fZ))}function U$(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||Us(uZ);return typeof e=="string"?e:void 0}function L$(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||Us(dZ);return typeof e=="string"?e:void 0}function F$(){return!!(U$()&&L$())}const mZ=Mr,hZ=cl;function pZ(e,t,n,o){const r=new bt,i=new bt,l=kK(e.sessionStoreStrategyType,e,t,n),u=xu({expireDelay:hZ});l.renewObservable.subscribe(()=>{u.add(f(),eo()),r.notify()}),l.expireObservable.subscribe(()=>{i.notify(),u.closeActive(eo())}),l.expandOrRenewSession(),u.add(f(),GI().relative),o.observable.subscribe(()=>{o.isGranted()?l.expandOrRenewSession():l.expire()}),gZ(e,()=>{o.isGranted()&&l.expandOrRenewSession()}),vZ(e,()=>l.expandSession()),yZ(e,()=>l.restartSession());function f(){const m=l.getSession();return m?{id:m.id,trackingType:m[t],isReplayForced:!!m.forcedReplay,anonymousId:m.anonymousId}:(bZ().catch(()=>{}),{id:"invalid",trackingType:o$,isReplayForced:!1,anonymousId:void 0})}return{findSession:(m,p)=>u.find(m,p),renewObservable:r,expireObservable:i,sessionStateUpdateObservable:l.sessionStateUpdateObservable,expire:l.expire,updateSessionState:l.updateSessionState}}function gZ(e,t){const{stop:n}=Zs(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function vZ(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:o}=Qt(e,document,"visibilitychange",n);gu(n,mZ)}function yZ(e,t){const{stop:n}=Qt(e,window,"resume",t,{capture:!0})}async function bZ(){const e=u$();let t=[];"cookieStore"in window?t=await window.cookieStore.getAll("_dd_s"):t=document.cookie.split(/\s*;\s*/).filter(n=>n.startsWith("_dd_s")),oa("Unexpected session state",{session:e,isSyntheticsTest:F$(),createdTimestamp:e?.created,expireTimestamp:e?.expire,cookie:{count:t.length,domain:t$(),...t},currentDomain:`${window.location.protocol}//${window.location.hostname}`})}function xZ(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,o){const r=KI(n);t+=r,e+=n,o&&o(r)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class _Z{constructor(){this.callbacks={}}notify(t,n){const o=this.callbacks[t];o&&o.forEach(r=>r(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(o=>n!==o)}}}}function Px(e,t,n){let o=0,r=!1;return{isLimitReached(){if(o===0&&sr(()=>{o=0},Mr),o+=1,o<=t||r)return r=!1,!1;if(o===t+1){r=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:yu.AGENT,startClocks:Gn()})}finally{r=!1}}return!0}}}function z0(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:kt}):Qt(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function wZ(e,t){return new Promise(n=>{z0(e,t,n)})}let Dx;const U0=new WeakMap;function SZ(e){return Dx||(Dx=CZ(e)),Dx}function CZ(e){return new bt(t=>{const{stop:n}=_i(XMLHttpRequest.prototype,"open",EZ),{stop:o}=_i(XMLHttpRequest.prototype,"send",i=>{RZ(i,e,t)},{computeHandlingStack:!0}),{stop:r}=_i(XMLHttpRequest.prototype,"abort",jZ);return()=>{n(),o(),r()}})}function EZ({target:e,parameters:[t,n]}){U0.set(e,{state:"open",method:String(t).toUpperCase(),url:P0(String(n))})}function RZ({target:e,handlingStack:t},n,o){const r=U0.get(e);if(!r)return;const i=r;i.state="start",i.startClocks=Gn(),i.isAborted=!1,i.xhr=e,i.handlingStack=t;let l=!1;const{stop:u}=_i(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(m(),u(),l)return;l=!0;const p=r;p.state="complete",p.duration=en(i.startClocks.timeStamp,Bn()),p.status=e.status,o.notify(df(p))},{stop:m}=Qt(n,e,"loadend",f);o.notify(i)}function jZ({target:e}){const t=U0.get(e);t&&(t.isAborted=!0)}let zx;function V$(){return zx||(zx=NZ()),zx}function NZ(){return new bt(e=>{if(!window.fetch)return;const{stop:t}=_i(window,"fetch",n=>kZ(n,e),{computeHandlingStack:!0});return t})}function kZ({parameters:e,onPostCall:t,handlingStack:n},o){const[r,i]=e;let l=i&&i.method;l===void 0&&r instanceof Request&&(l=r.method);const u=l!==void 0?String(l).toUpperCase():"GET",f=r instanceof Request?r.url:P0(String(r)),m=Gn(),p={state:"start",init:i,input:r,method:u,startClocks:m,url:f,handlingStack:n};o.notify(p),e[0]=p.input,e[1]=p.init,t(g=>TZ(o,g,p))}function TZ(e,t,n){const o=n;function r(i){o.state="resolve",Object.assign(o,i),e.notify(o)}t.then(tt(i=>{r({response:i,responseType:i.type,status:i.status,isAborted:!1})}),tt(i=>{var l,u;r({status:0,isAborted:((u=(l=o.init)===null||l===void 0?void 0:l.signal)===null||u===void 0?void 0:u.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function OZ(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(tt(e),t);return()=>window.cancelIdleCallback(n)}return IZ(e)}const AZ=50;function IZ(e){const t=Ro(),n=sr(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,AZ-(Ro()-t))})},0);return()=>_o(n)}const $Z=cr,MZ=30;function PZ(){const e=[];function t(o){let r;if(o.didTimeout){const i=performance.now();r=()=>MZ-(performance.now()-i)}else r=o.timeRemaining.bind(o);for(;r()>0&&e.length;)e.shift()();e.length&&n()}function n(){OZ(t,{timeout:$Z})}return{push(o){e.push(o)===1&&n()}}}let Ux={};function DZ(e){const t=e.map(n=>(Ux[n]||(Ux[n]=zZ(n)),Ux[n]));return XI(...t)}function zZ(e){return new bt(t=>{const n=Xi[e];return Xi[e]=(...o)=>{n.apply(console,o);const r=hf("console error");Ya(()=>{t.notify(UZ(o,e,r))})},()=>{Xi[e]=n}})}function UZ(e,t,n){const o=e.map(r=>LZ(r)).join(" ");if(t===Ug.error){const r=e.find(ul),i=k0({originalError:r,handlingStack:n,startClocks:Gn(),source:yu.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=o,{api:t,message:o,handlingStack:n,error:i}}return{api:t,message:o,error:void 0,handlingStack:n}}function LZ(e){return typeof e=="string"?fn(e):ul(e)?h$(zf(e)):vu(fn(e),void 0,2)}const FZ=500;function VZ(){const e=[];return{add:r=>{e.push(r)>FZ&&e.splice(0,1)},remove:r=>{D$(e,r)},drain:r=>{e.forEach(i=>i(r)),e.length=0}}}function BZ(e){const t=dl(e)==="object";return t||ht.error("Unsupported context:",e),t}function Lx(e,t,n){const o={...e};for(const[r,{required:i,type:l}]of Object.entries(t))l==="string"&&!Zk(o[r])&&(o[r]=String(o[r])),i&&Zk(o[r])&&ht.warn(`The property ${r} of ${n} is required; context will not be sent to the intake.`);return o}function Zk(e){return e==null||e===""}function Kg(e="",{propertiesConfig:t={}}={}){let n={};const o=new bt,r={getContext:()=>O0(n),setContext:i=>{BZ(i)?n=fn(Lx(i,t,e)):r.clearContext(),o.notify()},setContextProperty:(i,l)=>{n=fn(Lx({...n,[i]:l},t,e)),o.notify()},removeContextProperty:i=>{delete n[i],Lx(n,t,e),o.notify()},clearContext:()=>{n={},o.notify()},changeObservable:o};return r}function hr(e,t,n,o){return tt((...r)=>(o&&vr({feature:o}),e()[t][n](...r)))}const HZ="_dd_c",GZ=[];function L0(e,t,n,o){const r=qZ(n,o);GZ.push(Qt(e,window,"storage",({key:m})=>{r===m&&l()})),t.changeObservable.subscribe(u);const i=os(f(),t.getContext());ll(i)||t.setContext(i);function l(){t.setContext(f())}function u(){localStorage.setItem(r,JSON.stringify(t.getContext()))}function f(){const m=localStorage.getItem(r);return m?JSON.parse(m):{}}}function qZ(e,t){return`${HZ}_${e}_${t}`}function KZ(e,t,n){const o=B$();return t.storeContextsAcrossPages&&L0(t,o,n,4),e.register(0,()=>{const r=o.getContext();return ll(r)||!r.id?to:{account:r}}),o}function B$(){return Kg("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function ZZ(e,t,n,o){const r=H$();return t.storeContextsAcrossPages&&L0(t,r,n,2),e.register(0,()=>({context:r.getContext()})),r}function H$(){return Kg("global context")}function YZ(e,t,n,o){const r=G$();return t.storeContextsAcrossPages&&L0(t,r,o,1),e.register(0,({eventType:i,startTime:l})=>{const u=r.getContext(),f=n.findTrackedSession(l);return f&&f.anonymousId&&!u.anonymous_id&&t.trackAnonymousUser&&(u.anonymous_id=f.anonymousId),ll(u)?to:{type:i,usr:u}}),e.register(1,({startTime:i})=>{var l;return{anonymous_id:(l=n.findTrackedSession(i))===null||l===void 0?void 0:l.anonymousId}}),r}function G$(){return Kg("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Vn={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},pr={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function XZ(e,t,n){const o=e.getReader();let r=0;i();function i(){o.read().then(tt(u=>{if(u.done){l();return}r+=u.value.length,r>n.bytesLimit?l():i()}),tt(u=>t(u)))}function l(){o.cancel().catch(kt),t(void 0,void 0,void 0)}}const br={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Zg={FETCH:br.FETCH,XHR:br.XHR},WZ=500;function QZ(e=QK){const t=new WI(WZ),n=e().subscribe(o=>{t.notify({type:0,error:o})});return{observable:t,stop:()=>{n.unsubscribe()}}}function JZ(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const it={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},q$={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Wi={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},F0={CLICK:"click",CUSTOM:"custom"},$d={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},K$={DURATION:"duration"};function eY(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function tY(e,t,n){function o(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function r(i){o(i)&&e.notify(12,rY(i))}return{addDurationVital:r,startDurationVital:(i,l={})=>Z$(n,i,l),stopDurationVital:(i,l={})=>{Y$(r,n,i,l)}}}function Z$({vitalsByName:e,vitalsByReference:t},n,o={}){const r={name:n,startClocks:Gn(),context:o.context,description:o.description},i={__dd_vital_reference:!0};return e.set(n,r),t.set(i,r),i}function Y$(e,{vitalsByName:t,vitalsByReference:n},o,r={}){const i=typeof o=="string"?t.get(o):n.get(o);i&&(e(nY(i,i.startClocks,r,Gn())),typeof o=="string"?t.delete(o):n.delete(o))}function nY(e,t,n,o){var r;return{name:e.name,type:K$.DURATION,startClocks:t,duration:en(t.timeStamp,o.timeStamp),context:os(e.context,n.context),description:(r=n.description)!==null&&r!==void 0?r:e.description}}function rY(e,t){const n={date:e.startClocks.timeStamp,vital:{id:ur(),type:e.type,name:e.name,duration:ot(e.duration),description:e.description},type:it.VITAL,context:e.context};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,duration:e.duration,domainContext:{}}}function X$(e,t,n){if(e)for(const o of e){const r=o[t];r&&r(n)}}const Yk=new Map;function W$(e,t){if(t===100)return!0;if(t===0)return!1;const n=Yk.get(t);if(n&&e===n.sessionId)return n.decision;let o;return window.BigInt?o=oY(BigInt(`0x${e.split("-")[4]}`),t):o=ts(t),Yk.set(t,{sessionId:e,decision:o}),o}function oY(e,t){const n=BigInt("1111111111111111111"),o=BigInt("0x10000000000000000"),r=e*n%o;return Number(r)<=t/100*Number(o)}function iY(){return J$(64)}function Q$(){return J$(63)}function J$(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let o=t[1],r=t[0],i="";do{const l=o%n*4294967296+r;o=Math.floor(o/n),r=Math.floor(l/n),i=(l%n).toString(n)+i}while(o||r);return i}}}function cc(e){return e.toString(16).padStart(16,"0")}function sY(e){const t=e;return dl(t)==="object"&&$0(t.match)&&Array.isArray(t.propagatorTypes)}function aY(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function lY(e,t,n,o){return{clearTracingIfNeeded:aY,traceFetch:r=>Xk(e,r,t,n,o,i=>{var l;if(r.input instanceof Request&&!(!((l=r.init)===null||l===void 0)&&l.headers))r.input=new Request(r.input),Object.keys(i).forEach(u=>{r.input.headers.append(u,i[u])});else{r.init=df(r.init);const u=[];r.init.headers instanceof Headers?r.init.headers.forEach((f,m)=>{u.push([m,f])}):Array.isArray(r.init.headers)?r.init.headers.forEach(f=>{u.push(f)}):r.init.headers&&Object.keys(r.init.headers).forEach(f=>{u.push([f,r.init.headers[f]])}),r.init.headers=u.concat(j0(i))}}),traceXhr:(r,i)=>Xk(e,r,t,n,o,l=>{Object.keys(l).forEach(u=>{i.setRequestHeader(u,l[u])})})}}function Xk(e,t,n,o,r,i){const l=n.findTrackedSession();if(!l)return;const u=e.allowedTracingUrls.find(p=>M0([p.match],t.url,!0));if(!u)return;const f=W$(l.id,e.traceSampleRate);(f||e.traceContextInjection===fw.ALL)&&(t.traceSampled=f,t.traceId=iY(),t.spanId=Q$(),i(cY(t.traceId,t.spanId,t.traceSampled,l.id,u.propagatorTypes,o,r,e)))}function cY(e,t,n,o,r,i,l,u){const f={};if(r.forEach(m=>{switch(m){case"datadog":{Object.assign(f,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(f,{traceparent:`00-0000000000000000${cc(e)}-${cc(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(f,{b3:`${cc(e)}-${cc(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(f,{"X-B3-TraceId":cc(e),"X-B3-SpanId":cc(t),"X-B3-Sampled":n?"1":"0"});break}}}),u.propagateTraceBaggage){const m={"session.id":o},p=i.getContext().id;typeof p=="string"&&(m["user.id"]=p);const g=l.getContext().id;typeof g=="string"&&(m["account.id"]=g);const v=Object.entries(m).map(([x,b])=>`${x}=${encodeURIComponent(b)}`).join(",");v&&(f.baggage=v)}return f}const eM=["tracecontext","datadog"];function uY(e){var t,n,o,r,i,l,u;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&ht.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){ht.error("Application ID is not configured, no RUM data will be collected.");return}if(!xc(e.sessionReplaySampleRate,"Session Replay")||!xc(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){ht.error("Excluded Activity Urls should be an array");return}const f=dY(e);if(!f)return;const m=GK(e);if(!m)return;const p=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:p,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:p===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:Mf(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(o=e.excludedActivityUrls)!==null&&o!==void 0?o:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((r=e.trackUserInteractions)!==null&&r!==void 0)||r),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((i=e.trackResources)!==null&&i!==void 0)||i),trackLongTasks:!!(!((l=e.trackLongTasks)!==null&&l!==void 0)||l),trackBfcacheViews:!!e.trackBfcacheViews,subdomain:e.subdomain,defaultPrivacyLevel:Lp(nf,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:nf.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,initialViewMetricsTelemetrySampleRate:1,replayTelemetrySampleRate:1,traceContextInjection:Lp(fw,e.traceContextInjection)?e.traceContextInjection:fw.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(u=e.profilingSampleRate)!==null&&u!==void 0?u:0,propagateTraceBaggage:!!e.propagateTraceBaggage,...m}}function dY(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){ht.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){ht.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{$0(n)?t.push({match:n,propagatorTypes:eM}):sY(n)?t.push(n):ht.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function fY(e){const t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(n=>{$0(n)?eM.forEach(o=>t.add(o)):dl(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(o=>t.add(o))}),Array.from(t)}function mY(e){var t;const n=qK(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:fY(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(o=>{var r;return{name:o.name,...(r=o.getConfigurationTelemetry)===null||r===void 0?void 0:r.call(o)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,...n}}const hY="v1",pY=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function gY(e,t){const n=await EY(e);if(!n.ok){ht.error(n.error);return}return vY(e,n.value,t)}function vY(e,t,n){const o={...e};return pY.forEach(r=>{r in t&&(o[r]=Bp(t[r]))}),Object.keys(n).forEach(r=>{t[r]!==void 0&&xY(n[r],t[r])}),o}function Bp(e){if(Array.isArray(e))return e.map(Bp);if(yY(e)){if(bY(e)){const t=e.rcSerializedType;switch(t){case"string":return e.value;case"regex":return tM(e.value);case"dynamic":return _Y(e);default:ht.error(`Unsupported remote configuration: "rcSerializedType": "${t}"`);return}}return ZI(e,Bp)}return e}function yY(e){return typeof e=="object"&&e!==null}function bY(e){return"rcSerializedType"in e}function tM(e){try{return new RegExp(e)}catch{ht.error(`Invalid regex in the remote configuration: '${e}'`)}}function xY(e,t){t.forEach(({key:n,value:o})=>{e.setContextProperty(n,Bp(o))})}function _Y(e){const t=e.strategy;switch(t){case"cookie":return wY(e);case"dom":return SY(e);default:ht.error(`Unsupported remote configuration: "strategy": "${t}"`);return}}function wY({name:e,extractor:t}){const n=Gg(e);return t!==void 0&&n!==void 0?nM(t,n):n}function SY({selector:e,attribute:t,extractor:n}){let o;try{o=document.querySelector(e)}catch{o=null,ht.error(`Invalid selector in the remote configuration: '${e}'`)}if(o===null||CY(o,t))return;const r=t!==void 0?o.getAttribute(t):o.textContent;return n!==void 0&&r!==null?nM(n,r):r??void 0}function CY(e,t){return e.getAttribute("type")==="password"&&t==="value"}function nM(e,t){const n=tM(e.value);if(n===void 0)return;const o=n.exec(t);if(o===null)return;const[r,i]=o;return i||r}async function EY(e){let t;try{t=await fetch(RY(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function RY(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${I$("rum",e)}/${hY}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function jY({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,o,r){const i=VZ(),l=H$();Fx(l,Vn.globalContext,i);const u=G$();Fx(u,Vn.userContext,i);const f=B$();Fx(f,Vn.accountContext,i);let m,p,g,v;const x=n.observable.subscribe(S),b={};function S(){if(!g||!v||!n.isGranted())return;x.unsubscribe();let N;if(v.trackViewsManually){if(!m)return;i.remove(m.callback),N=m.options}const T=r(v,p,N);i.drain(T)}function C(N){const T=Yc();if(T&&(N=NY(N)),g=N,bK(mY(N)),v){$$("DD_RUM",N);return}const k=uY(N);if(k){if(!T&&!k.sessionStoreStrategyType){ht.warn("No storage available for session. We will not send any data.");return}k.compressIntakeRequests&&!T&&t&&(p=t(k,"Datadog RUM",kt),!p)||(v=k,V$().subscribe(kt),n.tryToInit(k.trackingConsent),S())}}const E=N=>{i.add(T=>T.addDurationVital(N))};return{init(N,T){if(!N){ht.error("Missing configuration");return}F7(N.enableExperimentalFeatures),g=N,!(e&&z$())&&(X$(N.plugins,"onInit",{initConfiguration:N,publicApi:T}),N.remoteConfigurationId?gY(N,{user:u,context:l}).then(k=>{k&&C(k)}).catch(qc):C(N))},get initConfiguration(){return g},getInternalContext:kt,stopSession:kt,addTiming(N,T=Bn()){i.add(k=>k.addTiming(N,T))},startView(N,T=Gn()){const k=A=>{A.startView(N,T)};i.add(k),m||(m={options:N,callback:k},S())},setViewName(N){i.add(T=>T.setViewName(N))},setViewContext(N){i.add(T=>T.setViewContext(N))},setViewContextProperty(N,T){i.add(k=>k.setViewContextProperty(N,T))},getViewContext:()=>b,globalContext:l,userContext:u,accountContext:f,addAction(N){i.add(T=>T.addAction(N))},addError(N){i.add(T=>T.addError(N))},addFeatureFlagEvaluation(N,T){i.add(k=>k.addFeatureFlagEvaluation(N,T))},startDurationVital(N,T){return Z$(o,N,T)},stopDurationVital(N,T){Y$(E,o,N,T)},addDurationVital:E}}function NY(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Lf())===null||n===void 0?void 0:n.getPrivacyLevel()}}function Fx(e,t,n){e.changeObservable.subscribe(()=>{const o=e.getContext();n.add(r=>r[t].setContext(o))})}function kY(e,t,n,o={}){const r=TK(),i=eY(),l=QZ().observable;let u=jY(o,r,i,(g,v,x)=>{const b=e(g,t,n,x,v&&o.createDeflateEncoder?S=>o.createDeflateEncoder(g,v,S):xZ,r,i,l,o.sdkName);return t.onRumStart(b.lifeCycle,g,b.session,b.viewHistory,v,b.telemetry),n.onRumStart(b.lifeCycle,b.hooks,g,b.session,b.viewHistory),u=TY(u,b),X$(g.plugins,"onRumStart",{strategy:u,addEvent:b.addEvent}),b});const f=()=>u,m=tt(g=>{const v=typeof g=="object"?g:{name:g};u.startView(v),vr({feature:"start-view"})}),p=tZ({init:tt(g=>{u.init(g,p)}),setTrackingConsent:tt(g=>{r.update(g),vr({feature:"set-tracking-consent",tracking_consent:g})}),setViewName:tt(g=>{u.setViewName(g),vr({feature:"set-view-name"})}),setViewContext:tt(g=>{u.setViewContext(g),vr({feature:"set-view-context"})}),setViewContextProperty:tt((g,v)=>{u.setViewContextProperty(g,v),vr({feature:"set-view-context-property"})}),getViewContext:tt(()=>(vr({feature:"set-view-context-property"}),u.getViewContext())),getInternalContext:tt(g=>u.getInternalContext(g)),getInitConfiguration:tt(()=>O0(u.initConfiguration)),addAction:(g,v)=>{const x=hf("action");Ya(()=>{u.addAction({name:fn(g),context:fn(v),startClocks:Gn(),type:F0.CUSTOM,handlingStack:x}),vr({feature:"add-action"})})},addError:(g,v)=>{const x=hf("error");Ya(()=>{u.addError({error:g,handlingStack:x,context:fn(v),startClocks:Gn()}),vr({feature:"add-error"})})},addTiming:tt((g,v)=>{u.addTiming(fn(g),v)}),setGlobalContext:hr(f,Vn.globalContext,pr.setContext,"set-global-context"),getGlobalContext:hr(f,Vn.globalContext,pr.getContext,"get-global-context"),setGlobalContextProperty:hr(f,Vn.globalContext,pr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:hr(f,Vn.globalContext,pr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:hr(f,Vn.globalContext,pr.clearContext,"clear-global-context"),setUser:hr(f,Vn.userContext,pr.setContext,"set-user"),getUser:hr(f,Vn.userContext,pr.getContext,"get-user"),setUserProperty:hr(f,Vn.userContext,pr.setContextProperty,"set-user-property"),removeUserProperty:hr(f,Vn.userContext,pr.removeContextProperty,"remove-user-property"),clearUser:hr(f,Vn.userContext,pr.clearContext,"clear-user"),setAccount:hr(f,Vn.accountContext,pr.setContext,"set-account"),getAccount:hr(f,Vn.accountContext,pr.getContext,"get-account"),setAccountProperty:hr(f,Vn.accountContext,pr.setContextProperty,"set-account-property"),removeAccountProperty:hr(f,Vn.accountContext,pr.removeContextProperty,"remove-account-property"),clearAccount:hr(f,Vn.accountContext,pr.clearContext,"clear-account"),startView:m,stopSession:tt(()=>{u.stopSession(),vr({feature:"stop-session"})}),addFeatureFlagEvaluation:tt((g,v)=>{u.addFeatureFlagEvaluation(fn(g),fn(v)),vr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:tt(()=>t.getSessionReplayLink()),startSessionReplayRecording:tt(g=>{t.start(g),vr({feature:"start-session-replay-recording",force:g&&g.force})}),stopSessionReplayRecording:tt(()=>t.stop()),addDurationVital:tt((g,v)=>{vr({feature:"add-duration-vital"}),u.addDurationVital({name:fn(g),type:K$.DURATION,startClocks:Fq(v.startTime),duration:v.duration,context:fn(v&&v.context),description:fn(v&&v.description)})}),startDurationVital:tt((g,v)=>(vr({feature:"start-duration-vital"}),u.startDurationVital(fn(g),{context:fn(v&&v.context),description:fn(v&&v.description)}))),stopDurationVital:tt((g,v)=>{vr({feature:"stop-duration-vital"}),u.stopDurationVital(typeof g=="string"?fn(g):g,{context:fn(v&&v.context),description:fn(v&&v.description)})})});return p}function TY(e,t){return{init:n=>{$$("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function OY(){const e=AY();return new bt(t=>{if(!e)return;const n=new e(tt(o=>t.notify(o)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function AY(){let e;const t=window;if(t.Zone&&(e=Ks(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(kt),o=Ks(n,"originalInstance");e=o&&o.constructor}return e||(e=t.MutationObserver),e}function IY(){const e=new bt,{stop:t}=_i(window,"open",()=>e.notify());return{observable:e,stop:t}}function $Y(e,t,n,o,r){return{get:i=>{const l=n.findView(i),u=r.findUrl(i),f=t.findTrackedSession(i);if(f&&l&&u){const m=o.findActionId(i);return{application_id:e,session_id:f.id,user_action:m?{id:m}:void 0,view:{id:l.id,name:l.name,referrer:u.referrer,url:u.url}}}}}}const MY=_Z,PY=cl;function DY(e){const t=xu({expireDelay:PY});e.subscribe(1,o=>{t.add(n(o),o.startClocks.relative)}),e.subscribe(6,({endClocks:o})=>{t.closeActive(o.relative)}),e.subscribe(3,o=>{const r=t.find(o.startClocks.relative);r&&(o.name&&(r.name=o.name),o.context&&(r.context=o.context),r.sessionIsActive=o.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(o){return{service:o.service,version:o.version,context:o.context,id:o.id,name:o.name,startClocks:o.startClocks}}return{findView:o=>t.find(o),stop:()=>{t.stop()}}}const rM="initial_document",zY=[[br.DOCUMENT,e=>rM===e],[br.XHR,e=>e==="xmlhttprequest"],[br.FETCH,e=>e==="fetch"],[br.BEACON,e=>e==="beacon"],[br.CSS,(e,t)=>/\.css$/i.test(t)],[br.JS,(e,t)=>/\.js$/i.test(t)],[br.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[br.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[br.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function UY(e){const t=e.name;if(!MK(t))return oa(`Failed to construct URL for "${e.name}"`),br.OTHER;const n=PK(t);for(const[o,r]of zY)if(r(e.initiatorType,n))return o;return br.OTHER}function Wk(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function oM(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function LY(e){const{duration:t,startTime:n,responseEnd:o}=e;return t===0&&n<o?en(n,o):t}function FY(e){if(!sM(e))return;const{startTime:t,fetchStart:n,workerStart:o,redirectStart:r,redirectEnd:i,domainLookupStart:l,domainLookupEnd:u,connectStart:f,secureConnectionStart:m,connectEnd:p,requestStart:g,responseStart:v,responseEnd:x}=e,b={download:Na(t,v,x),first_byte:Na(t,g,v)};return 0<o&&o<n&&(b.worker=Na(t,o,n)),n<p&&(b.connect=Na(t,f,p),f<=m&&m<=p&&(b.ssl=Na(t,m,p))),n<u&&(b.dns=Na(t,l,u)),t<i&&(b.redirect=Na(t,r,i)),b}function iM(e){return e.duration>=0}function sM(e){const t=Wk(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=VY(e)?Wk(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function VY(e){return e.redirectEnd>e.startTime}function Na(e,t,n){if(e<=t&&t<=n)return{duration:ot(en(t,n)),start:ot(en(e,t))}}function BY(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function HY(e){return e.deliveryType===""?"other":e.deliveryType}function GY(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:o}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:o}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function V0(e){return e&&(!BK(e)||qg(Xa.TRACK_INTAKE_REQUESTS))}const qY=/data:(.+)?(;base64)?,/g,KY=24e3;function ZY(e,t=KY){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(qY);return n?`${n[0]}[...]`:e}let Qk=1;function YY(e,t,n,o,r){const i=lY(t,n,o,r);XY(e,t,i),WY(e,i)}function XY(e,t,n){const o=SZ(t).subscribe(r=>{const i=r;if(V0(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=aM(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":n.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:Zg.XHR,url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack});break}});return{stop:()=>o.unsubscribe()}}function WY(e,t){const n=V$().subscribe(o=>{const r=o;if(V0(r.url))switch(r.state){case"start":t.traceFetch(r),r.requestIndex=aM(),e.notify(7,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":QY(r,i=>{t.clearTracingIfNeeded(r),e.notify(8,{duration:i,method:r.method,requestIndex:r.requestIndex,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:Zg.FETCH,url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack})});break}});return{stop:()=>n.unsubscribe()}}function aM(){const e=Qk;return Qk+=1,e}function QY(e,t){const n=e.response&&W7(e.response);!n||!n.body?t(en(e.startClocks.timeStamp,Bn())):XZ(n.body,()=>{t(en(e.startClocks.timeStamp,Bn()))},{bytesLimit:Number.POSITIVE_INFINITY})}function lM(e){return Mf(e)&&e<0?void 0:e}function cM({lifeCycle:e,isChildEvent:t,onChange:n=kt}){const o={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},r=e.subscribe(13,i=>{var l;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case it.ERROR:o.errorCount+=1,n();break;case it.ACTION:o.actionCount+=1,i.action.frustration&&(o.frustrationCount+=i.action.frustration.type.length),n();break;case it.LONG_TASK:o.longTaskCount+=1,n();break;case it.RESOURCE:!((l=i._dd)===null||l===void 0)&&l.discarded||(o.resourceCount+=1,n());break}});return{stop:()=>{r.unsubscribe()},eventCounts:o}}function JY(e,t){const n=Ro();let o=!1;const{stop:r}=Zs(e,window,["click","mousedown","keydown","touchstart","pointerdown"],u=>{if(!u.cancelable)return;const f={entryType:"first-input",processingStart:eo(),processingEnd:eo(),startTime:u.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};u.type==="pointerdown"?i(e,f):l(f)},{passive:!0,capture:!0});return{stop:r};function i(u,f){Zs(u,window,["pointerup","pointercancel"],m=>{m.type==="pointerup"&&l(f)},{once:!0})}function l(u){if(!o){o=!0,r();const f=u.processingStart-u.startTime;f>=0&&f<Ro()-n&&t(u)}}}var wt;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(wt||(wt={}));function Ci(e,t){return new bt(n=>{if(!window.PerformanceObserver)return;const o=f=>{const m=nX(f);m.length>0&&n.notify(m)};let r,i=!0;const l=new PerformanceObserver(tt(f=>{i?r=sr(()=>o(f.getEntries())):o(f.getEntries())}));try{l.observe(t)}catch{if([wt.RESOURCE,wt.NAVIGATION,wt.LONG_TASK,wt.PAINT].includes(t.type)){t.buffered&&(r=sr(()=>o(performance.getEntriesByType(t.type))));try{l.observe({entryTypes:[t.type]})}catch{return}}}i=!1,eX(e);let u;return!fl(wt.FIRST_INPUT)&&t.type===wt.FIRST_INPUT&&({stop:u}=JY(e,f=>{o([f])})),()=>{l.disconnect(),u&&u(),_o(r)}})}let Md;function eX(e){return!Md&&tX()&&"addEventListener"in performance&&(Md=Qt(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Md?.stop()}}function tX(){return window.performance!==void 0&&"getEntries"in performance}function fl(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function nX(e){return e.filter(t=>!rX(t))}function rX(e){return e.entryType===wt.RESOURCE&&(!V0(e.name)||!iM(e))}function uM(e){return e.nodeType===Node.TEXT_NODE}function oX(e){return e.nodeType===Node.COMMENT_NODE}function is(e){return e.nodeType===Node.ELEMENT_NODE}function dM(e){return is(e)&&!!e.shadowRoot}function iX(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&is(t.host)}function Ibe(e){return e.childNodes.length>0||dM(e)}function $be(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;dM(e)&&t(e.shadowRoot)}function sX(e){return iX(e)?e.host:e.parentNode}const fM=100,aX=100,Jk="data-dd-excluded-activity-mutations";function B0(e,t,n,o,r,i){const l=cX(e,t,n,o);return lX(l,r,i)}function lX(e,t,n){let o,r=!1;const i=sr(tt(()=>m({hadActivity:!1})),fM),l=n!==void 0?sr(tt(()=>m({hadActivity:!0,end:Bn()})),n):void 0,u=e.subscribe(({isBusy:p})=>{_o(i),_o(o);const g=Bn();p||(o=sr(tt(()=>m({hadActivity:!0,end:g})),aX))}),f=()=>{r=!0,_o(i),_o(o),_o(l),u.unsubscribe()};function m(p){r||(f(),t(p))}return{stop:f}}function cX(e,t,n,o){return new bt(r=>{const i=[];let l,u=0;return i.push(t.subscribe(m=>{m.every(uX)||f()}),n.subscribe(f),Ci(o,{type:wt.RESOURCE}).subscribe(m=>{m.some(p=>!Vx(o,p.name))&&f()}),e.subscribe(7,m=>{Vx(o,m.url)||(l===void 0&&(l=m.requestIndex),u+=1,f())}),e.subscribe(8,m=>{Vx(o,m.url)||l===void 0||m.requestIndex<l||(u-=1,f())})),()=>{i.forEach(m=>m.unsubscribe())};function f(){r.notify({isBusy:u>0})}})}function Vx(e,t){return M0(e.excludedActivityUrls,t)}function uX(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&is(t)&&t.matches(`[${Jk}], [${Jk}] *`))}const Et={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:nf.ALLOW,MASK:nf.MASK,MASK_USER_INPUT:nf.MASK_USER_INPUT},dX="data-dd-privacy",Mbe="hidden",fX="dd-privacy-",Bx="***",Pbe="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",mX={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},hX="x";function mM(e,t,n){if(n&&n.has(e))return n.get(e);const o=sX(e),r=o?mM(o,t,n):t,i=hM(e),l=pX(i,r);return n&&n.set(e,l),l}function pX(e,t){switch(t){case Et.HIDDEN:case Et.IGNORE:return t}switch(e){case Et.ALLOW:case Et.MASK:case Et.MASK_USER_INPUT:case Et.HIDDEN:case Et.IGNORE:return e;default:return t}}function hM(e){if(is(e)){if(e.tagName==="BASE")return Et.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return Et.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Et.MASK}if(e.matches(_c(Et.HIDDEN)))return Et.HIDDEN;if(e.matches(_c(Et.MASK)))return Et.MASK;if(e.matches(_c(Et.MASK_USER_INPUT)))return Et.MASK_USER_INPUT;if(e.matches(_c(Et.ALLOW)))return Et.ALLOW;if(vX(e))return Et.IGNORE}}function pM(e,t){switch(t){case Et.MASK:case Et.HIDDEN:case Et.IGNORE:return!0;case Et.MASK_USER_INPUT:return uM(e)?eT(e.parentNode):eT(e);default:return!1}}function eT(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!mX[t.tagName]}const gX=e=>e.replace(/\S/g,hX);function Dbe(e,t,n){var o;const r=(o=e.parentElement)===null||o===void 0?void 0:o.tagName;let i=e.textContent||"";if(t&&!i.trim())return;const l=n;if(r==="SCRIPT")i=Bx;else if(l===Et.HIDDEN)i=Bx;else if(pM(e,l))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=Bx:i=gX(i);return i}function vX(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),o=t("rel"),r=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||o==="icon"||o==="apple-touch-icon"||o==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(r)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(r)||/^product:/.test(r)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function _c(e){return`[${dX}="${e}"], .${fX}${e}`}const Yg="data-dd-action-name",yX="Masked Element";function bX(e,{enablePrivacyForActionName:t,actionNameAttribute:n},o=Et.ALLOW){const r=tT(e,Yg)||n&&tT(e,n);return r?{name:r,nameSource:"custom_attribute"}:o===Et.MASK?{name:yX,nameSource:"mask_placeholder"}:nT(e,n,xX,t)||nT(e,n,_X,t)||{name:"",nameSource:"blank"}}function tT(e,t){const n=e.closest(`[${t}]`);if(!n)return;const o=n.getAttribute(t);return vM(gM(o.trim()))}const xX=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return bp(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return bp(e,t,n)},e=>Pd(e,"aria-label"),(e,t,n)=>{const o=e.getAttribute("aria-labelledby");if(o)return{name:o.split(/\s+/).map(r=>SX(e,r)).filter(r=>!!r).map(r=>yM(r,t,n)).join(" "),nameSource:"text_content"}},e=>Pd(e,"alt"),e=>Pd(e,"name"),e=>Pd(e,"title"),e=>Pd(e,"placeholder"),(e,t,n)=>{if("options"in e&&e.options.length>0)return bp(e.options[0],t,n)}],_X=[(e,t,n)=>bp(e,t,n)],wX=10;function nT(e,t,n,o){let r=e,i=0;for(;i<=wX&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const l of n){const u=l(r,t,o);if(u){const{name:f,nameSource:m}=u,p=f&&f.trim();if(p)return{name:vM(gM(p)),nameSource:m}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function gM(e){return e.replace(/\s+/g," ")}function vM(e){return e.length>100?`${QI(e,100)} [...]`:e}function SX(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Pd(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function bp(e,t,n){return{name:yM(e,t,n)||"",nameSource:"text_content"}}function yM(e,t,n){if(!e.isContentEditable){if(qg(Xa.USE_TREE_WALKER_FOR_ACTION_NAME))return CX(e,t,n);if("innerText"in e){let o=e.innerText;const r=i=>{const l=e.querySelectorAll(i);for(let u=0;u<l.length;u+=1){const f=l[u];if("innerText"in f){const m=f.innerText;m&&m.trim().length>0&&(o=o.replace(m,""))}}};return r(`[${Yg}]`),t&&r(`[${t}]`),n&&r(`${_c(Et.HIDDEN)}, ${_c(Et.MASK)}`),o}return e.textContent}}function CX(e,t,n){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,i);let r="";for(;o.nextNode();){const l=o.currentNode;if(is(l)){(l.nodeName==="BR"||l.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(l).display))&&(r+=" ");continue}r+=l.textContent||""}return r.replace(/\s+/g," ").trim();function i(l){if(is(l)){const u=hM(l);if(l.hasAttribute(Yg)||t&&l.hasAttribute(t)||n&&u&&pM(l,u))return NodeFilter.FILTER_REJECT;const f=getComputedStyle(l);if(f.visibility!=="visible"||f.display==="none"||f.contentVisibility&&f.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}const EX=[Yg,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],RX=[xM,NX],jX=[xM,kX,TX];function Ff(e,t){if(!e.isConnected)return;let n,o=e;for(;o&&o.nodeName!=="HTML";){const r=rT(o,RX,AX,t,n);if(r)return r;n=rT(o,jX,IX,t,n)||Xg(OX(o),n),o=o.parentElement}return n}function bM(e){return/[0-9]/.test(e)}function NX(e){if(e.id&&!bM(e.id))return`#${CSS.escape(e.id)}`}function kX(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const o=t[n];if(!bM(o))return`${CSS.escape(e.tagName)}.${CSS.escape(o)}`}}function TX(e){return CSS.escape(e.tagName)}function xM(e,t){if(t){const o=n(t);if(o)return o}for(const o of EX){const r=n(o);if(r)return r}function n(o){if(e.hasAttribute(o))return`${CSS.escape(e.tagName)}[${o}="${CSS.escape(e.getAttribute(o))}"]`}}function OX(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function rT(e,t,n,o,r){for(const i of t){const l=i(e,o);if(l&&n(e,l,r))return Xg(l,r)}}function AX(e,t,n){return e.ownerDocument.querySelectorAll(Xg(t,n)).length===1}function IX(e,t,n){let o;if(n===void 0)o=l=>l.matches(t);else{const l=Xg(`${t}:scope`,n);o=u=>u.querySelector(l)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&o(i))return!1;i=i.nextElementSibling}return!0}function Xg(e,t){return t?`${e}>${t}`:e}const _M=cr,$X=100;function MX(e,t){const n=[];let o=0,r;i(e);function i(f){f.stopObservable.subscribe(l),n.push(f),_o(r),r=sr(u,_M)}function l(){o===1&&n.every(f=>f.isStopped())&&(o=2,t(n))}function u(){_o(r),o===0&&(o=1,l())}return{tryAppend:f=>o!==0?!1:n.length>0&&!PX(n[n.length-1].event,f.event)?(u(),!1):(i(f),!0),stop:()=>{u()}}}function PX(e,t){return e.target===t.target&&DX(e,t)<=$X&&e.timeStamp-t.timeStamp<=_M}function DX(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function zX(e,{onPointerDown:t,onPointerUp:n}){let o,r={selection:!1,input:!1,scroll:!1},i;const l=[Qt(e,window,"pointerdown",u=>{iT(u)&&(o=oT(),r={selection:!1,input:!1,scroll:!1},i=t(u))},{capture:!0}),Qt(e,window,"selectionchange",()=>{(!o||!oT())&&(r.selection=!0)},{capture:!0}),Qt(e,window,"scroll",()=>{r.scroll=!0},{capture:!0,passive:!0}),Qt(e,window,"pointerup",u=>{if(iT(u)&&i){const f=r;n(i,u,()=>f),i=void 0}},{capture:!0}),Qt(e,window,"input",()=>{r.input=!0},{capture:!0})];return{stop:()=>{l.forEach(u=>u.stop())}}}function oT(){const e=window.getSelection();return!e||e.isCollapsed}function iT(e){return e.target instanceof Element&&e.isPrimary!==!1}const sT=3;function UX(e,t){if(LX(e))return t.addFrustration($d.RAGE_CLICK),e.some(aT)&&t.addFrustration($d.DEAD_CLICK),t.hasError&&t.addFrustration($d.ERROR_CLICK),{isRage:!0};const n=e.some(o=>o.getUserActivity().selection);return e.forEach(o=>{o.hasError&&o.addFrustration($d.ERROR_CLICK),aT(o)&&!n&&o.addFrustration($d.DEAD_CLICK)}),{isRage:!1}}function LX(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(sT-1);t+=1)if(e[t+sT-1].event.timeStamp-e[t].event.timeStamp<=cr)return!0;return!1}const FX='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function aT(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(FX)}const wM=10*cr,rf=new Map;function VX(e){const t=rf.get(e);return rf.delete(e),t}function SM(e,t){rf.set(e,t),rf.forEach((n,o)=>{en(o,eo())>wM&&rf.delete(o)})}const BX=5*Mr;function HX(e,t,n,o){const r=xu({expireDelay:BX}),i=new bt;let l;e.subscribe(10,()=>{r.reset()}),e.subscribe(5,p),e.subscribe(11,g=>{g.reason===jc.UNLOADING&&p()});const{stop:u}=zX(o,{onPointerDown:g=>GX(o,e,t,g,n),onPointerUp:({clickActionBase:g,hadActivityOnPointerDown:v},x,b)=>{qX(o,e,t,n,r,i,m,g,x,b,v)}});return{stop:()=>{p(),i.notify(),u()},actionContexts:{findActionId:g=>r.findAll(g)}};function m(g){if(!l||!l.tryAppend(g)){const v=g.clone();l=MX(g,x=>{ZX(x,v)})}}function p(){l&&l.stop()}}function GX(e,t,n,o,r){const i=e.enablePrivacyForActionName?mM(o.target,e.defaultPrivacyLevel):Et.ALLOW;if(i===Et.HIDDEN)return;const l=KX(o,i,e);let u=!1;return B0(t,n,r,e,f=>{u=f.hadActivity},fM),{clickActionBase:l,hadActivityOnPointerDown:()=>u}}function qX(e,t,n,o,r,i,l,u,f,m,p){var g;const v=CM(t,r,m,u,f);l(v);const x=(g=u?.target)===null||g===void 0?void 0:g.selector;x&&SM(f.timeStamp,x);const{stop:b}=B0(t,n,o,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},wM),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=i.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),b(),C.unsubscribe()})}function KX(e,t,n){const o=e.target.getBoundingClientRect(),r=Ff(e.target,n.actionNameAttribute);r&&SM(e.timeStamp,r);const i=bX(e.target,n,t);return{type:F0.CLICK,target:{width:Math.round(o.width),height:Math.round(o.height),selector:r},position:{x:Math.round(e.clientX-o.left),y:Math.round(e.clientY-o.top)},name:i.name,nameSource:i.nameSource}}function CM(e,t,n,o,r){const i=ur(),l=Gn(),u=t.add(i,l.relative),f=cM({lifeCycle:e,isChildEvent:b=>b.action!==void 0&&(Array.isArray(b.action.id)?b.action.id.includes(i):b.action.id===i)});let m=0,p;const g=[],v=new bt;function x(b){m===0&&(p=b,m=1,p?u.close(R0(p)):u.remove(),f.stop(),v.notify())}return{event:r,stop:x,stopObservable:v,get hasError(){return f.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:b=>{g.push(b)},startClocks:l,isStopped:()=>m===1||m===2,clone:()=>CM(e,t,n,o,r),validate:b=>{if(x(),m!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=f.eventCounts,j={duration:p&&en(l.timeStamp,p),startClocks:l,id:i,frustrationTypes:g,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:b??[r],event:r,...o};e.notify(0,j),m=2},discard:()=>{x(),m=2}}}function ZX(e,t){const{isRage:n}=UX(e,t);n?(e.forEach(o=>o.discard()),t.stop(Bn()),t.validate(e.map(o=>o.event))):(t.discard(),e.forEach(o=>o.validate()))}function YX(e,t,n,o,r){e.subscribe(0,u=>e.notify(12,lT(u))),t.register(0,({startTime:u,eventType:f})=>{if(f!==it.ERROR&&f!==it.RESOURCE&&f!==it.LONG_TASK)return to;const m=i.findActionId(u);return m?{type:f,action:{id:m}}:to}),t.register(1,({startTime:u})=>({action:{id:i.findActionId(u)}}));let i={findActionId:kt},l=kt;return r.trackUserInteractions&&({actionContexts:i,stop:l}=HX(e,n,o,r)),{addAction:u=>{e.notify(12,lT(u))},actionContexts:i,stop:l}}function lT(e){const t=Hx(e)?{action:{id:e.id,loading_time:lM(ot(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=os({action:{id:ur(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:it.ACTION},t),o=Hx(e)?e.duration:void 0,r=Hx(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:o,startTime:e.startClocks.relative,domainContext:r}}function Hx(e){return e.type!==F0.CUSTOM}function XX(e){const t=DZ([Ug.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function WX(e,t){const n=rZ(e,[pf.cspViolation,pf.intervention]).subscribe(o=>t.notify(o));return{stop:()=>{n.unsubscribe()}}}function QX(e,t,n){const o=new bt;return n.subscribe(r=>{r.type===0&&o.notify(r.error)}),XX(o),WX(t,o),o.subscribe(r=>e.notify(14,{error:r})),JX(e)}function JX(e){return e.subscribe(14,({error:t})=>{e.notify(12,eW(t))}),{addError:({error:t,handlingStack:n,componentStack:o,startClocks:r,context:i})=>{const l=k0({originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:"Provided",source:yu.CUSTOM,handling:"handled"});l.context=os(l.context,i),e.notify(14,{error:l})}}}function eW(e){const t={date:e.startClocks.timeStamp,error:{id:ur(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:it.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const cT=new WeakSet;function tW(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(o=>!cT.has(o)).filter(o=>iM(o)&&sM(o)).filter(o=>nW(o,e.startClocks.relative,EM({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return cT.add(n[0]),n[0].toJSON()}function EM(e){return pu(e.startTime,e.duration)}function nW(e,t,n){return e.startTime>=t-1&&EM(e)<=pu(n,1)}const rW=2*Mr;function oW(e){const t=iW(e)||sW(e);if(!(!t||t.traceTime<=Ro()-rW))return t.traceId}function iW(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return RM(t&&t.content,n&&n.content)}function sW(e){const t=aW(e);if(t)return RM(ff(t,"trace-id"),ff(t,"trace-time"))}function RM(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function aW(e){for(let t=0;t<e.childNodes.length;t+=1){const n=uT(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],o=uT(n);if(o)return o;if(!uM(n))break}}function uT(e){if(e&&oX(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function jM(){if(fl(wt.NAVIGATION)){const n=performance.getEntriesByType(wt.NAVIGATION)[0];if(n)return n}const e=lW(),t={entryType:wt.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function lW(){const e={},t=performance.timing;for(const n in t)if(Mf(t[n])){const o=n,r=t[o];e[o]=r===0?0:R0(r)}return e}function cW(e,t,n=jM){z0(e,"interactive",()=>{const o=n(),r=Object.assign(o.toJSON(),{entryType:wt.RESOURCE,initiatorType:rM,duration:o.responseEnd,traceId:oW(document),toJSON:()=>({...r,toJSON:void 0})});t(r)})}const uW=1e3;function dW(e){const t=new Set,n=e.subscribe(8,o=>{t.add(o),t.size>uW&&(oa("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(o){let r=1/0,i;for(const l of t){const u=o.startTime-l.startClocks.relative;0<=u&&u<r&&l.url===o.name&&(r=Math.abs(u),i=l)}return i&&t.delete(i),i},stop(){n.unsubscribe()}}}function fW(e,t,n,o=PZ(),r=cW){let i;const l=qg(Xa.EARLY_REQUEST_COLLECTION);l?i=dW(e):e.subscribe(8,m=>{f(()=>mW(m,t,n))});const u=Ci(t,{type:wt.RESOURCE,buffered:!0}).subscribe(m=>{for(const p of m)(l||!oM(p))&&f(()=>dT(p,t,n,i))});r(t,m=>{f(()=>dT(m,t,n,i))});function f(m){o.push(()=>{const p=m();p&&e.notify(12,p)})}return{stop:()=>{u.unsubscribe()}}}function mW(e,t,n){const o=tW(e);return NM(o,e,n,t)}function dT(e,t,n,o){const r=oM(e)&&o?o.getMatchingRequest(e):void 0;return NM(e,r,n,t)}function NM(e,t,n,o){if(!e&&!t)return;const r=t?gW(t,o):vW(e,o);if(!o.trackResources&&!r)return;const i=e?Fg(e.startTime):t.startClocks,l=e?LY(e):yW(n,i,t.duration),u=os({date:i.timeStamp,resource:{id:ur(),duration:ot(l),type:t?t.type===Zg.XHR?br.XHR:br.FETCH:UY(e),method:t?t.method:void 0,status_code:t?t.status:bW(e.responseStatus),url:t?ZY(t.url):e.name,protocol:e&&BY(e),delivery_type:e&&HY(e)},type:it.RESOURCE,_dd:{discarded:!o.trackResources}},r,e&&pW(e));return{startTime:i.relative,duration:l,rawRumEvent:u,domainContext:hW(e,t)}}function hW(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Zg.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function pW(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...GY(e),...FY(e)}}}function gW(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function vW(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Q$().toString(),rule_psr:t.rulePsr}}}function yW(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function bW(e){return e===0?void 0:e}function xW(e,t,n){const{stop:o,eventCounts:r}=cM({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:o,eventCounts:r}}const _W=10*Mr;function wW(e,t,n){return{stop:Ci(e,{type:wt.PAINT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.name==="first-contentful-paint"&&l.startTime<t.timeStamp&&l.startTime<_W);i&&n(i.startTime)}).unsubscribe}}function SW(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(en(e,eo()))})})}function CW(e,t,n){const o=Ci(e,{type:wt.FIRST_INPUT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.startTime<t.timeStamp);if(i){const l=en(i.startTime,i.processingStart);let u;i.target&&is(i.target)&&(u=Ff(i.target,e.actionNameAttribute)),n({delay:l>=0?l:0,time:i.startTime,targetSelector:u})}});return{stop:()=>{o.unsubscribe()}}}function EW(e,t,n=jM){return NW(e,()=>{const o=n();jW(o)||t(RW(o))})}function RW(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=eo()?e.responseStart:void 0}}function jW(e){return e.loadEventEnd<=0}function NW(e,t){let n;const{stop:o}=z0(e,"complete",()=>{n=sr(()=>t())});return{stop:()=>{o(),_o(n)}}}const kW=10*Mr;function TW(e,t,n,o){let r=1/0;const{stop:i}=Zs(e,n,["pointerdown","keydown"],f=>{r=f.timeStamp},{capture:!0,once:!0});let l=0;const u=Ci(e,{type:wt.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(f=>{const m=e7(f,p=>p.entryType===wt.LARGEST_CONTENTFUL_PAINT&&p.startTime<r&&p.startTime<t.timeStamp&&p.startTime<kW&&p.size>l);if(m){let p;m.element&&(p=Ff(m.element,e.actionNameAttribute)),o({value:m.startTime,targetSelector:p,resourceUrl:OW(m)}),l=m.size}});return{stop:()=>{i(),u.unsubscribe()}}}function OW(e){return e.url===""?void 0:e.url}function kM(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:kt};if(fl(wt.VISIBILITY_STATE)){const i=performance.getEntriesByType(wt.VISIBILITY_STATE).filter(l=>l.name==="hidden").find(l=>l.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:kt}}let o=1/0;const{stop:r}=Zs(e,n,["pagehide","visibilitychange"],i=>{(i.type==="pagehide"||document.visibilityState==="hidden")&&(o=i.timeStamp,r())},{capture:!0});return{get timeStamp(){return o},stop:r}}function AW(e,t,n,o){const r={},{stop:i}=EW(e,g=>{n(g.loadEvent),r.navigationTimings=g,o()}),l=kM(e,t),{stop:u}=wW(e,l,g=>{r.firstContentfulPaint=g,o()}),{stop:f}=TW(e,l,window,g=>{r.largestContentfulPaint=g,o()}),{stop:m}=CW(e,l,g=>{r.firstInput=g,o()});function p(){i(),u(),f(),m(),l.stop()}return{stop:p,initialViewMetrics:r}}const mw=(e,t)=>e*t,IW=(e,t)=>{const n=Math.max(e.left,t.left),o=Math.max(e.top,t.top),r=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return n>=r||o>=i?0:mw(r-n,i-o)},fT=e=>{const t=mw(e.previousRect.width,e.previousRect.height),n=mw(e.currentRect.width,e.currentRect.height),o=IW(e.previousRect,e.currentRect);return t+n-o};function $W(e,t,n){if(!UW())return{stop:kt};let o=0,r;n({value:0});const i=zW(),l=Ci(e,{type:wt.LAYOUT_SHIFT,buffered:!0}).subscribe(u=>{var f;for(const m of u){if(m.hadRecentInput||m.startTime<t)continue;const{cumulatedValue:p,isMaxValue:g}=i.update(m);if(g){const v=MW(m.sources);r={target:v?.node?new WeakRef(v.node):void 0,time:en(t,m.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>o){o=p;const v=(f=r?.target)===null||f===void 0?void 0:f.deref();n({value:ef(o,4),targetSelector:v&&Ff(v,e.actionNameAttribute),time:r?.time,previousRect:r?.previousRect?mT(r.previousRect):void 0,currentRect:r?.currentRect?mT(r.currentRect):void 0,devicePixelRatio:r?.devicePixelRatio})}}});return{stop:()=>{l.unsubscribe()}}}function MW(e){let t;for(const n of e)if(n.node&&is(n.node)){const o=fT(n);(!t||fT(t)<o)&&(t=n)}return t}function mT({x:e,y:t,width:n,height:o}){return{x:e,y:t,width:n,height:o}}const PW=5*cr,DW=cr;function zW(){let e=0,t,n,o=0;return{update:r=>{const i=t===void 0||r.startTime-n>=DW||r.startTime-t>=PW;let l;return i?(t=n=r.startTime,o=e=r.value,l=!0):(e+=r.value,n=r.startTime,l=r.value>o,l&&(o=r.value)),{cumulatedValue:e,isMaxValue:l}}}}function UW(){return fl(wt.LAYOUT_SHIFT)&&"WeakRef"in window}let xp,TM=0,Gx=1/0,qx=0;function LW(){"interactionCount"in performance||xp||(xp=new window.PerformanceObserver(tt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(Gx=Math.min(Gx,n.interactionId),qx=Math.max(qx,n.interactionId),TM=(qx-Gx)/7+1)})})),xp.observe({type:"event",buffered:!0,durationThreshold:0}))}const hT=()=>xp?TM:window.performance.interactionCount||0,pT=10,FW=1*Mr;function VW(e,t,n){if(!GW())return{getInteractionToNextPaint:()=>{},setViewEnd:kt,stop:kt};const{getViewInteractionCount:o,stopViewInteractionCount:r}=HW(n);let i=1/0;const l=BW(o);let u=-1,f,m;function p(x){for(const S of x)S.interactionId&&S.startTime>=t&&S.startTime<=i&&l.process(S);const b=l.estimateP98Interaction();b&&b.duration!==u&&(u=b.duration,m=en(t,b.startTime),f=VX(b.startTime),!f&&b.target&&is(b.target)&&(f=Ff(b.target,e.actionNameAttribute)))}const g=Ci(e,{type:wt.FIRST_INPUT,buffered:!0}).subscribe(p),v=Ci(e,{type:wt.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(u>=0)return{value:Math.min(u,FW),targetSelector:f,time:m};if(o())return{value:0}},setViewEnd:x=>{i=x,r()},stop:()=>{v.unsubscribe(),g.unsubscribe()}}}function BW(e){const t=[];function n(){t.sort((o,r)=>r.duration-o.duration).splice(pT)}return{process(o){const r=t.findIndex(l=>o.interactionId===l.interactionId),i=t[t.length-1];r!==-1?o.duration>t[r].duration&&(t[r]=o,n()):(t.length<pT||o.duration>i.duration)&&(t.push(o),n())},estimateP98Interaction(){const o=Math.min(t.length-1,Math.floor(e()/50));return t[o]}}}function HW(e){LW();const t=e===Wi.INITIAL_LOAD?0:hT();let n={stopped:!1};function o(){return hT()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:o(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:o()}}}}function GW(){return fl(wt.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function qW(e,t,n,o,r,i,l){let u=r===Wi.INITIAL_LOAD,f=!0;const m=[],p=kM(o,i);function g(){if(!f&&!u&&m.length>0){const x=Math.max(...m);x<p.timeStamp-i.relative&&l(x)}}const{stop:v}=B0(e,t,n,o,x=>{f&&(f=!1,x.hadActivity&&m.push(en(i.timeStamp,x.end)),g())});return{stop:()=>{v(),p.stop()},setLoadEvent:x=>{u&&(u=!1,m.push(x),g())}}}function zbe(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function KW(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let Kx;function ZW(e){return Kx||(Kx=YW(e)),Kx}function YW(e){return new bt(t=>{const{throttled:n}=Bg(()=>{t.notify(H0())},200);return Qt(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function H0(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const XW=cr;function WW(e,t,n,o=JW(e)){let r=0,i=0,l=0;const u=o.subscribe(({scrollDepth:f,scrollTop:m,scrollHeight:p})=>{let g=!1;if(f>r&&(r=f,g=!0),p>i){i=p;const v=eo();l=en(t.relative,v),g=!0}g&&n({maxDepth:Math.min(r,i),maxDepthScrollTop:m,maxScrollHeight:i,maxScrollHeightTime:l})});return{stop:()=>u.unsubscribe()}}function QW(){const e=KW(),{height:t}=H0(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),o=Math.round(t+e);return{scrollHeight:n,scrollDepth:o,scrollTop:e}}function JW(e,t=XW){return new bt(n=>{function o(){n.notify(QW())}if(window.ResizeObserver){const r=Bg(o,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,l=new ResizeObserver(tt(r.throttled));i&&l.observe(i);const u=Qt(e,window,"scroll",r.throttled,{passive:!0});return()=>{r.cancel(),l.disconnect(),u.stop()}}})}function eQ(e,t,n,o,r,i,l){const u={},{stop:f,setLoadEvent:m}=qW(e,t,n,o,i,l,S=>{u.loadingTime=S,r()}),{stop:p}=WW(o,l,S=>{u.scroll=S}),{stop:g}=$W(o,l.relative,S=>{u.cumulativeLayoutShift=S,r()}),{stop:v,getInteractionToNextPaint:x,setViewEnd:b}=VW(o,l.relative,i);return{stop:()=>{f(),g(),p()},stopINPTracking:v,setLoadEvent:m,setViewEnd:b,getCommonViewMetrics:()=>(u.interactionToNextPaint=x(),u)}}function tQ(e,t){const{stop:n}=Qt(e,window,"pageshow",o=>{o.persisted&&t(o)},{capture:!0});return n}function nQ(e,t,n){SW(e.relative,o=>{t.firstContentfulPaint=o,t.largestContentfulPaint={value:o},n()})}const rQ=3e3,oQ=5*Mr,iQ=5*Mr;function sQ(e,t,n,o,r,i,l,u){const f=new Set;let m=v(Wi.INITIAL_LOAD,GI(),u),p;x();let g;l&&(g=b(i),r.trackBfcacheViews&&(p=tQ(r,S=>{m.end();const C=Fg(S.timeStamp);m=v(Wi.BF_CACHE,C,void 0)})));function v(S,C,E){const j=aQ(t,n,o,r,e,S,C,E);return f.add(j),j.stopObservable.subscribe(()=>{f.delete(j)}),j}function x(){t.subscribe(10,()=>{m=v(Wi.ROUTE_CHANGE,void 0,{name:m.name,service:m.service,version:m.version,context:m.contextManager.getContext()})}),t.subscribe(9,()=>{m.end({sessionIsActive:!1})})}function b(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{cQ(C,E)&&(m.end(),m=v(Wi.ROUTE_CHANGE))})}return{addTiming:(S,C=Bn())=>{m.addTiming(S,C)},startView:(S,C)=>{m.end({endClocks:C}),m=v(Wi.ROUTE_CHANGE,C,S)},setViewContext:S=>{m.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{m.contextManager.setContextProperty(S,C)},setViewName:S=>{m.setViewName(S)},getViewContext:()=>m.contextManager.getContext(),stop:()=>{g&&g.unsubscribe(),p&&p(),m.end(),f.forEach(S=>S.stop())}}}function aQ(e,t,n,o,r,i,l=Gn(),u){const f=ur(),m=new bt,p={};let g=0,v;const x=df(r),b=Kg();let S=!0,C=u?.name;const E=u?.service||o.service,j=u?.version||o.version,N=u?.context;N&&b.setContext(N);const T={id:f,name:C,startClocks:l,service:E,version:j,context:N};e.notify(1,T),e.notify(2,T);const{throttled:k,cancel:A}=Bg(M,rQ,{leading:!1}),{setLoadEvent:I,setViewEnd:P,stop:F,stopINPTracking:L,getCommonViewMetrics:se}=eQ(e,t,n,o,re,i,l),{stop:te,initialViewMetrics:ce}=i===Wi.INITIAL_LOAD?AW(o,l,I,re):{stop:kt,initialViewMetrics:{}};i===Wi.BF_CACHE&&nQ(l,ce,re);const{stop:ae,eventCounts:ie}=xW(e,f,re),$=gu(M,oQ),K=e.subscribe(11,H=>{H.reason===jc.UNLOADING&&M()});M(),b.changeObservable.subscribe(re);function U(){e.notify(3,{id:f,name:C,context:b.getContext(),startClocks:l,sessionIsActive:S})}function re(){U(),k()}function M(){A(),U(),g+=1;const H=v===void 0?Bn():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:g,id:f,name:C,service:E,version:j,context:b.getContext(),loadingType:i,location:x,startClocks:l,commonViewMetrics:se(),initialViewMetrics:ce,duration:en(l.timeStamp,H),isActive:v===void 0,sessionIsActive:S,eventCounts:ie})}return{get name(){return C},service:E,version:j,contextManager:b,stopObservable:m,end(H={}){var le,B;v||(v=(le=H.endClocks)!==null&&le!==void 0?le:Gn(),S=(B=H.sessionIsActive)!==null&&B!==void 0?B:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Vg($),P(v.relative),F(),K.unsubscribe(),M(),sr(()=>{this.stop()},iQ))},stop(){te(),ae(),L(),m.notify()},addTiming(H,le){if(v)return;const B=Gq(le)?le:en(l.timeStamp,le);p[lQ(H)]=B,re()},setViewName(H){C=H,M()}}}function lQ(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&ht.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function cQ(e,t){return e.pathname!==t.pathname||!uQ(t.hash)&&gT(t.hash)!==gT(e.hash)}function uQ(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function gT(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function dQ(e,t,n,o,r,i,l,u,f,m){return e.subscribe(4,p=>e.notify(12,fQ(p,n,u))),t.register(0,({startTime:p,eventType:g})=>{const v=f.findView(p);return v?{type:g,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:Ys}),t.register(1,({startTime:p})=>{var g;return{view:{id:(g=f.findView(p))===null||g===void 0?void 0:g.id}}}),sQ(o,e,r,i,n,l,!n.trackViewsManually,m)}function fQ(e,t,n){var o,r,i,l,u,f,m,p,g,v,x,b,S,C,E,j,N,T;const k=n.getReplayStats(e.id),A=(r=(o=e.commonViewMetrics)===null||o===void 0?void 0:o.cumulativeLayoutShift)===null||r===void 0?void 0:r.devicePixelRatio,I={_dd:{document_version:e.documentVersion,replay_stats:k,cls:A?{device_pixel_ratio:A}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:it.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:ot((l=e.commonViewMetrics.cumulativeLayoutShift)===null||l===void 0?void 0:l.time),cumulative_layout_shift_target_selector:(u=e.commonViewMetrics.cumulativeLayoutShift)===null||u===void 0?void 0:u.targetSelector,first_byte:ot((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.firstByte),dom_complete:ot((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domComplete),dom_content_loaded:ot((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:ot((g=e.initialViewMetrics.navigationTimings)===null||g===void 0?void 0:g.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:ot(e.initialViewMetrics.firstContentfulPaint),first_input_delay:ot((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:ot((x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.time),first_input_target_selector:(b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.targetSelector,interaction_to_next_paint:ot((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:ot((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:ot((j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.value),largest_contentful_paint_target_selector:(N=e.initialViewMetrics.largestContentfulPaint)===null||N===void 0?void 0:N.targetSelector,load_event:ot((T=e.initialViewMetrics.navigationTimings)===null||T===void 0?void 0:T.loadEvent),loading_time:lM(ot(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:mQ(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:ot(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:ot(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:JZ()}};return ll(e.customTimings)||(I.view.custom_timings=ZI(e.customTimings,ot)),{rawRumEvent:I,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function mQ({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:o,largestContentfulPaint:r}){return{cls:e&&{score:e.value,timestamp:ot(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:ot(n)},fid:o&&{duration:ot(o.delay),timestamp:ot(o.time),target_selector:o.targetSelector},inp:t&&{duration:ot(t.value),timestamp:ot(t.time),target_selector:t.targetSelector},lcp:r&&{timestamp:ot(r.value),target_selector:r.targetSelector,resource_url:r.resourceUrl}}}const hQ="rum";function pQ(e,t,n){const o=pZ(e,hQ,r=>vQ(e,r),n);return o.expireObservable.subscribe(()=>{t.notify(9)}),o.renewObservable.subscribe(()=>{t.notify(10)}),o.sessionStateUpdateObservable.subscribe(({previousState:r,newState:i})=>{if(!r.forcedReplay&&i.forcedReplay){const l=o.findSession();l&&(l.isReplayForced=!0)}}),{findTrackedSession:r=>{const i=o.findSession(r);if(!(!i||i.trackingType==="0"))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:o.expire,expireObservable:o.expireObservable,setForcedReplay:()=>o.updateSessionState({forcedReplay:"1"})}}function gQ(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:j$("records")?1:0};return{findTrackedSession:()=>e,expire:kt,expireObservable:new bt,setForcedReplay:kt}}function vQ(e,t){return yQ(t)?t:ts(e.sessionSampleRate)?ts(e.sessionReplaySampleRate)?"1":"2":"0"}function yQ(e){return e==="0"||e==="1"||e==="2"}function bQ(e,t,n,o,r,i){const l=[e.rumEndpointBuilder];e.replica&&l.push(e.replica.rumEndpointBuilder);const u=N$({encoder:i(2),request:R$(l,e.batchBytesLimit,n),flushController:k$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:o,sessionExpireObservable:r}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,f=>{f.type===it.VIEW?u.upsert(f,f.view.id):u.add(f)}),u}function xQ(e){const t=Lf();e.subscribe(13,n=>{t.send("rum",n)})}const _Q=cl;function wQ(e,t,n,o){const r=xu({expireDelay:_Q});let i;e.subscribe(1,({startClocks:f})=>{const m=o.href;r.add(u({url:m,referrer:i||document.referrer}),f.relative),i=m}),e.subscribe(6,({endClocks:f})=>{r.closeActive(f.relative)});const l=n.subscribe(({newLocation:f})=>{const m=r.find();if(m){const p=eo();r.closeActive(p),r.add(u({url:f.href,referrer:m.referrer}),p)}});function u({url:f,referrer:m}){return{url:f,referrer:m}}return t.register(0,({startTime:f,eventType:m})=>{const p=r.find(f);return p?{type:m,view:{url:p.url,referrer:p.referrer}}:Ys}),{findUrl:f=>r.find(f),stop:()=>{l.unsubscribe(),r.stop()}}}function SQ(e,t){let n=df(t);return new bt(o=>{const{stop:r}=CQ(e,l),{stop:i}=EQ(e,l);function l(){if(n.href===t.href)return;const u=df(t);o.notify({newLocation:u,oldLocation:n}),n=u}return()=>{r(),i()}})}function CQ(e,t){const{stop:n}=_i(vT("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:o}=_i(vT("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:r}=Qt(e,window,"popstate",t);return{stop:()=>{n(),o(),r()}}}function EQ(e,t){return Qt(e,window,"hashchange",t)}function vT(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const RQ=cl;function jQ(e,t,n){const o=xu({expireDelay:RQ});return e.subscribe(1,({startClocks:r})=>{o.add({},r.relative)}),e.subscribe(6,({endClocks:r})=>{o.closeActive(r.relative)}),t.register(0,({startTime:r,eventType:i})=>{if(!n.trackFeatureFlagsForEvents.concat([it.VIEW,it.ERROR]).includes(i))return to;const u=o.find(r);return!u||ll(u)?to:{type:i,feature_flags:u}}),{addFeatureFlagEvaluation:(r,i)=>{const l=o.find();l&&(l[r]=i)}}}const NQ=10*cr;let Nc,Vh;function kQ(e,t,n,o){t.enabled&&ts(e.customerDataTelemetrySampleRate)&&(OM(),Vh=!1,n.subscribe(13,()=>{Vh=!0}),o.subscribe(({bytesCount:i,messagesCount:l})=>{Vh&&(Vh=!1,Nc.batchCount+=1,bT(Nc.batchBytesCount,i),bT(Nc.batchMessagesCount,l))}),gu(TQ,NQ))}function TQ(){Nc.batchCount!==0&&(I0("Customer data measures",Nc),OM())}function yT(){return{min:1/0,max:0,sum:0}}function bT(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function OM(){Nc={batchCount:0,batchBytesCount:yT(),batchMessagesCount:yT()}}const OQ=4e3,AQ=500,IQ=cl;function $Q(e,t,n=AQ){const o=xu({expireDelay:IQ,maxEntries:OQ});let r;fl(wt.VISIBILITY_STATE)&&performance.getEntriesByType(wt.VISIBILITY_STATE).forEach(m=>{const p=m.name==="hidden"?"hidden":"active";l(p,m.startTime)}),l(AM(),eo());const{stop:i}=Zs(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],f=>{l(PQ(f),f.timeStamp)},{capture:!0});function l(f,m=eo()){f!==r&&(r=f,o.closeActive(m),o.add({state:r,startTime:m},m))}function u(f,m,p){return o.findAll(m,p).some(g=>g.state===f)}return e.register(0,({startTime:f,duration:m=0,eventType:p})=>{if(p===it.VIEW){const g=o.findAll(f,m);return{type:p,_dd:{page_states:MQ(g,f,n)}}}return p===it.ACTION||p===it.ERROR?{type:p,view:{in_foreground:u("active",f,0)}}:to}),{wasInPageStateDuringPeriod:u,addPageState:l,stop:()=>{i(),o.stop()}}}function MQ(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:o,startTime:r})=>({state:o,start:ot(en(t,r))}))}function PQ(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":AM()}function AM(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function DQ(e,t){let n;const o=requestAnimationFrame(tt(()=>{n=H0()})),r=ZW(t).subscribe(i=>{n=i}).unsubscribe;return e.register(0,({eventType:i})=>({type:i,display:n?{viewport:n}:void 0})),{stop:()=>{r(),o&&cancelAnimationFrame(o)}}}function zQ(e,t){const n=window.cookieStore?UQ(e):FQ;return new bt(o=>n(t,r=>o.notify(r)))}function UQ(e){return(t,n)=>Qt(e,window.cookieStore,"change",r=>{const i=r.changed.find(l=>l.name===t)||r.deleted.find(l=>l.name===t);i&&n(i.value)}).stop}const LQ=cr;function FQ(e,t){const n=ff(document.cookie,e),o=gu(()=>{const r=ff(document.cookie,e);r!==n&&t(r)},LQ);return()=>{Vg(o)}}const xT="datadog-ci-visibility-test-execution-id";function VQ(e,t,n=zQ(e,xT)){var o;let r=Us(xT)||((o=window.Cypress)===null||o===void 0?void 0:o.env("traceId"));const i=n.subscribe(l=>{r=l});return t.register(0,({eventType:l})=>typeof r!="string"?to:{type:l,session:{type:"ci_test"},ci_test:{test_execution_id:r}}),{stop:()=>{i.unsubscribe()}}}function BQ(e,t){const n=Ci(t,{type:wt.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(o=>{for(const r of o){const i=Fg(r.startTime),l={date:i.timeStamp,long_task:{id:ur(),entry_type:q$.LONG_ANIMATION_FRAME,duration:ot(r.duration),blocking_duration:ot(r.blockingDuration),first_ui_event_timestamp:ot(r.firstUIEventTimestamp),render_start:ot(r.renderStart),style_and_layout_start:ot(r.styleAndLayoutStart),start_time:ot(r.startTime),scripts:r.scripts.map(u=>({duration:ot(u.duration),pause_duration:ot(u.pauseDuration),forced_style_and_layout_duration:ot(u.forcedStyleAndLayoutDuration),start_time:ot(u.startTime),execution_start:ot(u.executionStart),source_url:u.sourceURL,source_function_name:u.sourceFunctionName,source_char_position:u.sourceCharPosition,invoker:u.invoker,invoker_type:u.invokerType,window_attribution:u.windowAttribution}))},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop:()=>n.unsubscribe()}}function HQ(e,t){const n=Ci(t,{type:wt.LONG_TASK,buffered:!0}).subscribe(o=>{for(const r of o){if(r.entryType!==wt.LONG_TASK||!t.trackLongTasks)break;const i=Fg(r.startTime),l={date:i.timeStamp,long_task:{id:ur(),entry_type:q$.LONG_TASK,duration:ot(r.duration)},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop(){n.unsubscribe()}}}function GQ(e){e.register(0,({eventType:t})=>{if(!F$())return to;const n=U$(),o=L$();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:o,injected:z$()}}})}function qQ(e,t,n){const o=O0(e),r=n(o);return j0(t).forEach(([i,l])=>hw(e,o,i.split(/\.|(?=\[\])/),l)),r}function hw(e,t,n,o){const[r,...i]=n;if(r==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((l,u)=>hw(l,t[u],i,o));return}if(!(!_T(e)||!_T(t))){if(i.length>0)return hw(e[r],t[r],i,o);KQ(e,r,t[r],o)}}function KQ(e,t,n,o){const r=dl(n);r===o?e[t]=fn(n):o==="object"&&(r==="undefined"||r==="null")&&(e[t]={})}function _T(e){return dl(e)==="object"}const uc={"view.name":"string","view.url":"string","view.referrer":"string"},dc={context:"object"},fc={service:"string",version:"string"};let IM;function ZQ(e,t,n,o){IM={[it.VIEW]:{"view.performance.lcp.resource_url":"string",...dc,...uc,...fc},[it.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...dc,...uc,...fc},[it.RESOURCE]:{"resource.url":"string",...qg(Xa.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...dc,...uc,...fc},[it.ACTION]:{"action.target.name":"string",...dc,...uc,...fc},[it.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...dc,...uc,...fc},[it.VITAL]:{...dc,...uc,...fc}};const r={[it.ERROR]:Px(it.ERROR,e.eventRateLimiterThreshold,o),[it.ACTION]:Px(it.ACTION,e.eventRateLimiterThreshold,o),[it.VITAL]:Px(it.VITAL,e.eventRateLimiterThreshold,o)};t.subscribe(12,({startTime:i,duration:l,rawRumEvent:u,domainContext:f})=>{const m=n.triggerHook(0,{eventType:u.type,startTime:i,duration:l});if(m===Ys)return;const p=os(m,u,{ddtags:ZK(e).join(",")});YQ(p,e.beforeSend,f,r)&&(ll(p.context)&&delete p.context,t.notify(13,p))})}function YQ(e,t,n,o){var r;if(t){const l=qQ(e,IM[e.type],u=>t(u,n));if(l===!1&&e.type!==it.VIEW)return!1;l===!1&&ht.warn("Can't dismiss view events using beforeSend!")}return!((r=o[e.type])===null||r===void 0?void 0:r.isLimitReached())}function XQ(e,t,n,o){e.register(0,({eventType:r,startTime:i})=>{const l=t.findTrackedSession(i),u=o.findView(i);if(!l||!u)return Ys;let f,m,p;return r===it.VIEW?(f=n.getReplayStats(u.id)?!0:void 0,m=l.sessionReplay===1,p=u.sessionIsActive?void 0:!1):f=n.isRecording()?!0:void 0,{type:r,session:{id:l.id,type:"user",has_replay:f,sampled_for_replay:m,is_active:p}}}),e.register(1,({startTime:r})=>{const i=t.findTrackedSession(r);return i?{session:{id:i.id}}:to})}function WQ(e){e.register(0,({eventType:t})=>({type:t,connectivity:y$()}))}function QQ(e,t,n){e.register(0,({eventType:o})=>{const r=t.source;return{type:o,_dd:{format_version:2,drift:Bq(),configuration:{session_sample_rate:ef(t.sessionSampleRate,3),session_replay_sample_rate:ef(t.sessionReplaySampleRate,3),profiling_sample_rate:ef(t.profilingSampleRate,3)},browser_sdk_version:Yc()?"6.19.0":void 0,sdk_name:n},application:{id:t.applicationId},date:Bn(),source:r}}),e.register(1,()=>({application:{id:t.applicationId}}))}function JQ(e,t){e.register(1,()=>t.isGranted()?to:Ys)}const eJ=dK,tJ=[it.ACTION,it.ERROR,it.LONG_TASK,it.RESOURCE,it.VITAL];function nJ(e){return{addEvent:(t,n,o,r)=>{tJ.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:o,duration:r})}}}const rJ="Initial view metrics";function oJ(e,t,n){if(!(n.enabled&&ts(e.initialViewMetricsTelemetrySampleRate)))return{stop:kt};const{unsubscribe:r}=t.subscribe(4,({initialViewMetrics:i})=>{!i.largestContentfulPaint||!i.navigationTimings||(I0(rJ,{metrics:iJ(i.largestContentfulPaint,i.navigationTimings)}),r())});return{stop:r}}function iJ(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function sJ(e,t,n,o,r,i,l,u,f){const m=[],p=new MY,g=eJ();p.subscribe(13,de=>v$("rum",de));const v=de=>{p.notify(14,{error:de}),oa("Error reported to customer",{"error.message":de.message})},x=cK(e),b=x.subscribe(de=>{p.notify(11,de)});m.push(()=>b.unsubscribe());const S=hK("browser-rum-sdk",e,g,v,x,r);m.push(S.stop);const C=Yc()?gQ():pQ(e,p,i);if(Yc())xQ(p);else{const de=bQ(e,p,v,x,C.expireObservable,r);m.push(()=>de.stop()),kQ(e,S,p,de.flushController.flushObservable)}const E=OY(),j=SQ(e,location),{observable:N,stop:T}=IY();m.push(T),QQ(g,e,f);const k=$Q(g,e),A=DY(p);m.push(()=>A.stop());const I=wQ(p,g,j,location);m.push(()=>I.stop());const P=jQ(p,g,e);XQ(g,C,t,A),WQ(g),JQ(g,i);const F=ZZ(g,e,"rum"),L=YZ(g,e,C,"rum"),se=KZ(g,e,"rum"),{actionContexts:te,addAction:ce,addEvent:ae,stop:ie}=aJ(p,g,e,k,E,N,v);m.push(ie);const{addTiming:$,startView:K,setViewName:U,setViewContext:re,setViewContextProperty:M,getViewContext:H,stop:le}=dQ(p,g,e,location,E,N,j,t,A,o);m.push(le);const{stop:B}=oJ(e,p,S);m.push(B);const{stop:Y}=fW(p,e,k);if(m.push(Y),e.trackLongTasks)if(fl(wt.LONG_ANIMATION_FRAME)){const{stop:de}=BQ(p,e);m.push(de)}else HQ(p,e);const{addError:pe}=QX(p,e,u);u.unbuffer(),YY(p,e,C,L,se);const ve=tY(p,k,l),ue=$Y(e.applicationId,C,A,te,I);return m.push(()=>n.stop()),{addAction:ce,addEvent:ae,addError:pe,addTiming:$,addFeatureFlagEvaluation:P.addFeatureFlagEvaluation,startView:K,setViewContext:re,setViewContextProperty:M,getViewContext:H,setViewName:U,lifeCycle:p,viewHistory:A,session:C,stopSession:()=>C.expire(),getInternalContext:ue.get,startDurationVital:ve.startDurationVital,stopDurationVital:ve.stopDurationVital,addDurationVital:ve.addDurationVital,globalContext:F,userContext:L,accountContext:se,telemetry:S,stop:()=>{m.forEach(de=>de())},hooks:g}}function aJ(e,t,n,o,r,i,l){const u=YX(e,t,r,i,n),f=nJ(e),m=DQ(t,n),p=VQ(n,t);return GQ(t),ZQ(n,e,t,l),{pageStateHistory:o,addAction:u.addAction,addEvent:f.addEvent,actionContexts:u.actionContexts,stop:()=>{u.stop(),p.stop(),m.stop(),o.stop()}}}function lJ(e,{session:t,viewContext:n,errorType:o}){const r=t?t.id:"no-session-id",i=[];o!==void 0&&i.push(`error-type=${o}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const l=cJ(e),u=`/rum/replay/sessions/${r}`;return`${l}${u}?${i.join("&")}`}function cJ(e){const t=e.site,n=e.subdomain||uJ(e);return`https://${n?`${n}.`:""}${t}`}function uJ(e){switch(e.site){case $a:case G7:return"app";case g$:return"dd";default:return}}const dJ=1e3;let xo;function Ube(e){return Wg(e).segments_count}function Lbe(e){Wg(e).segments_count+=1}function Fbe(e){Wg(e).records_count+=1}function Vbe(e,t){Wg(e).segments_total_raw_size+=t}function fJ(e){return xo?.get(e)}function Wg(e){xo||(xo=new Map);let t;return xo.has(e)?t=xo.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},xo.set(e,t),xo.size>dJ&&mJ()),t}function mJ(){if(!xo)return;const e=xo.keys().next().value;e&&xo.delete(e)}function $M(e,t,n){let o=0,r=[],i,l=!0,u=0;const f=[],{stop:m}=Qt(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const x=f[0];x&&(x.id===v.id?(f.shift(),o+=v.additionalBytesCount,r.push(v.result),i=v.trailer,x.writeCallback?x.writeCallback(v.result.byteLength):x.finishCallback&&x.finishCallback()):x.id<v.id&&(m(),oa("Worker responses received out of order.")))});function p(){const v=r.length===0?new Uint8Array(0):Kq(r.concat(i)),x={rawBytesCount:o,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return o=0,r=[],x}function g(){l||(t.postMessage({action:"reset",streamId:n}),l=!0)}return{isAsync:!0,get isEmpty(){return l},write(v,x){t.postMessage({action:"write",id:u,data:v,streamId:n}),f.push({id:u,writeCallback:x,data:v}),l=!1,u+=1},finish(v){g(),f.length?(f.forEach(x=>{delete x.writeCallback}),f[f.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){g();const v=f.map(x=>x.data).join("");return f.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){m()}}}function G0({configuredUrl:e,error:t,source:n,scriptType:o}){if(ht.error(`${n} failed to start: an error occurred while initializing the ${o}:`,t),t instanceof Event||t instanceof Error&&hJ(t.message)){let r;e?r=`Please make sure the ${o} URL ${e} is correct and CSP is correctly configured.`:r="Please make sure CSP is correctly configured.",ht.error(`${r} See documentation at ${Lg}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else o==="worker"&&A0(t)}function hJ(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const pJ=30*cr;function MM(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([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]),n=new Uint8Array([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]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.19.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let mn={status:0};function PM(e,t,n,o=MM){switch(mn.status===0&&gJ(e,t,o),mn.status){case 1:return mn.initializationFailureCallbacks.push(n),mn.worker;case 3:return mn.worker}}function wT(){return mn.status}function gJ(e,t,n=MM){try{const o=n(e),{stop:r}=Qt(e,o,"error",u=>{Zx(e,t,u)}),{stop:i}=Qt(e,o,"message",({data:u})=>{u.type==="errored"?Zx(e,t,u.error,u.streamId):u.type==="initialized"&&yJ(u.version)});o.postMessage({action:"init"}),sr(()=>vJ(t),pJ),mn={status:1,worker:o,stop:()=>{r(),i()},initializationFailureCallbacks:[]}}catch(o){Zx(e,t,o)}}function vJ(e){mn.status===1&&(ht.error(`${e} failed to start: a timeout occurred while initializing the Worker`),mn.initializationFailureCallbacks.forEach(t=>t()),mn={status:2})}function yJ(e){mn.status===1&&(mn={status:3,worker:mn.worker,stop:mn.stop,version:e})}function Zx(e,t,n,o){mn.status===1||mn.status===0?(G0({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),mn.status===1&&mn.initializationFailureCallbacks.forEach(r=>r()),mn={status:2}):A0(n,{worker_version:mn.status===3&&mn.version,stream_id:o})}function DM(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function bJ(e,t,n,o){const r=t.findTrackedSession(),i=xJ(r,o),l=n.findView();return lJ(e,{viewContext:l,errorType:i,session:r})}function xJ(e,t){if(!DM())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}const _J="Recorder init metrics";function wJ(e,t,n){if(!(t.enabled&&ts(e.replayTelemetrySampleRate)))return{stop:kt};let r,i,l;const{unsubscribe:u}=n.subscribe(f=>{switch(f.type){case"start":r={forced:f.forced,timestamp:Bn()},i=void 0,l=void 0;break;case"document-ready":r&&(i=en(r.timestamp,Bn()));break;case"recorder-settled":r&&(l=en(r.timestamp,Bn()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":u(),r&&I0(_J,{metrics:SJ(r.forced,l,en(r.timestamp,Bn()),f.type,i)});break}});return{stop:u}}function SJ(e,t,n,o,r){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:o,waitForDocReadyDuration:r}}function CJ(e,t,n,o,r,i,l){let u=0,f;t.subscribe(9,()=>{(u===2||u===3)&&(v(),u=1)}),t.subscribe(10,()=>{u===1&&g()});const m=new bt;wJ(e,l,m);const p=async x=>{m.notify({type:"start",forced:x});const[b]=await Promise.all([ST(m,{type:"recorder-settled"},r()),ST(m,{type:"document-ready"},wZ(e,"interactive"))]);if(u!==2){m.notify({type:"aborted"});return}if(!b){u=0,m.notify({type:"recorder-load-failed"});return}const S=i();if(!S){u=0,m.notify({type:"deflate-encoder-load-failed"});return}({stop:f}=b(t,e,n,o,S,l)),u=3,m.notify({type:"succeeded"})};function g(x){const b=n.findTrackedSession();if(EJ(b,x)){u=1;return}if(RJ(u))return;u=2;const S=jJ(b,x)||!1;p(S).catch(qc),S&&n.setForcedReplay()}function v(){u===3&&f?.(),u=0}return{start:g,stop:v,getSessionReplayLink(){return bJ(e,n,o,u!==0)},isRecording:()=>u===3}}function EJ(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function RJ(e){return e===2||e===3}function jJ(e,t){return t&&t.force&&e.sessionReplay===0}async function ST(e,t,n){try{return await n}finally{e.notify(t)}}function NJ(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:kt},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function kJ(e,t){if(Yc()&&!j$("records")||!DM())return{start:kt,stop:kt,getReplayStats:()=>{},onRumStart:kt,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:o}=NJ();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:r,isRecording:()=>wT()===3&&n.isRecording(),getReplayStats:i=>wT()===3?fJ(i):void 0};function r(i,l,u,f,m,p){let g;function v(){return g||(m??(m=PM(l,"Datadog Session Replay",()=>{n.stop()},t)),m&&(g=$M(l,m,1))),g}n=CJ(l,i,u,f,e,v,p),o(l)&&n.start()}}const TJ="modulepreload",OJ=function(e){return"/"+e},CT={},q0=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){let f=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");r=f(n.map(m=>{if(m=OJ(m),m in CT)return;CT[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":TJ,p||(v.as="script"),v.crossOrigin="",v.href=m,u&&v.setAttribute("nonce",u),document.head.appendChild(v),p)return new Promise((x,b)=>{v.addEventListener("load",x),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${m}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return r.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};async function AJ(e=IJ){try{return await e()}catch(t){G0({error:t,source:"Recorder",scriptType:"module"})}}async function IJ(){return(await q0(()=>import("./startRecording-D8PRkhto.js"),[])).startRecording}function $J(){return Qo().Profiler!==void 0}const MJ=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==it.VIEW&&n!==it.LONG_TASK?to:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function PJ(e=DJ){try{return await e()}catch(t){G0({error:t,source:"Profiler",scriptType:"module"})}}async function DJ(){return(await q0(()=>import("./profiler-OUXA1uul.js"),[])).createRumProfiler}function zJ(){let e;function t(n,o,r,i,l){const u=i.findTrackedSession();if(!u||!W$(u.id,r.profilingSampleRate))return;const f=MJ(o);if(!$J()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}PJ().then(m=>{if(!m){oa("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=m(r,n,i,f),e.start(l.findView())}).catch(qc)}return{onRumStart:t,stop:()=>{e?.stop().catch(qc)}}}const UJ=kJ(AJ),LJ=zJ(),FJ=kY(sJ,UJ,LJ,{startDeflateWorker:PM,createDeflateEncoder:$M,sdkName:"rum"});nZ(Qo(),"DD_RUM",FJ);function _p(e,t){hf("react error"),Gn()}const ET={didCatch:!1,error:null};class Bbe extends q.Component{constructor(t){super(t),this.resetError=()=>{this.setState(ET)},this.state=ET}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){_p()}render(){return this.state.didCatch?q.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let RT=!1;function VJ(){_.useEffect(()=>{RT||(RT=!0)},[])}function BJ(){return c.jsx(c.Fragment,{children:c.jsx(ls,{})})}const Qg=I8()({component:BJ});function HJ(e,t){const n=_.createContext(t),o=i=>{const{children:l,...u}=i,f=_.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:f,children:l})};o.displayName=e+"Provider";function r(i){const l=_.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Jo(e,t=[]){let n=[];function o(i,l){const u=_.createContext(l),f=n.length;n=[...n,l];const m=g=>{const{scope:v,children:x,...b}=g,S=v?.[e]?.[f]||u,C=_.useMemo(()=>b,Object.values(b));return c.jsx(S.Provider,{value:C,children:x})};m.displayName=i+"Provider";function p(g,v){const x=v?.[e]?.[f]||u,b=_.useContext(x);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,p]}const r=()=>{const i=n.map(l=>_.createContext(l));return function(u){const f=u?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return r.scopeName=e,[o,GJ(r,...t)]}function GJ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const l=o.reduce((u,{useScope:f,scopeName:m})=>{const g=f(i)[`__scope${m}`];return{...u,...g}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var qJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=qJ.reduce((e,t)=>{const n=Ba(`Primitive.${t}`),o=_.forwardRef((r,i)=>{const{asChild:l,...u}=r,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(f,{...u,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Hp(e,t){e&&fu.flushSync(()=>e.dispatchEvent(t))}var En=globalThis?.document?_.useLayoutEffect:()=>{},KJ=CA[" useInsertionEffect ".trim().toString()]||En;function Ei({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,l]=ZJ({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:r;{const p=_.useRef(e!==void 0);_.useEffect(()=>{const g=p.current;g!==u&&console.warn(`${o} is changing from ${g?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,o])}const m=_.useCallback(p=>{if(u){const g=YJ(p)?p(e):p;g!==e&&l.current?.(g)}else i(p)},[u,e,i,l]);return[f,m]}function ZJ({defaultProp:e,onChange:t}){const[n,o]=_.useState(e),r=_.useRef(n),i=_.useRef(t);return KJ(()=>{i.current=t},[t]),_.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function YJ(e){return typeof e=="function"}var XJ=_.createContext(void 0);function _u(e){const t=_.useContext(XJ);return e||t||"ltr"}function WJ(e,t){return _.useReducer((n,o)=>t[n][o]??n,e)}var Pn=e=>{const{present:t,children:n}=e,o=QJ(t),r=typeof n=="function"?n({present:o.isPresent}):_.Children.only(n),i=st(o.ref,JJ(r));return typeof n=="function"||o.isPresent?_.cloneElement(r,{ref:i}):null};Pn.displayName="Presence";function QJ(e){const[t,n]=_.useState(),o=_.useRef(null),r=_.useRef(e),i=_.useRef("none"),l=e?"mounted":"unmounted",[u,f]=WJ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const m=Bh(o.current);i.current=u==="mounted"?m:"none"},[u]),En(()=>{const m=o.current,p=r.current;if(p!==e){const v=i.current,x=Bh(m);e?f("MOUNT"):x==="none"||m?.display==="none"?f("UNMOUNT"):f(p&&v!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,f]),En(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=x=>{const S=Bh(o.current).includes(CSS.escape(x.animationName));if(x.target===t&&S&&(f("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=x=>{x.target===t&&(i.current=Bh(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:_.useCallback(m=>{o.current=m?getComputedStyle(m):null,n(m)},[])}}function Bh(e){return e?.animationName||"none"}function JJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eee=CA[" useId ".trim().toString()]||(()=>{}),tee=0;function Qr(e){const[t,n]=_.useState(eee());return En(()=>{n(o=>o??String(tee++))},[e]),t?`radix-${t}`:""}function Vf(e){const t=e+"CollectionProvider",[n,o]=Jo(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:E}=S,j=q.useRef(null),N=q.useRef(new Map).current;return c.jsx(r,{scope:C,itemMap:N,collectionRef:j,children:E})};l.displayName=t;const u=e+"CollectionSlot",f=Ba(u),m=q.forwardRef((S,C)=>{const{scope:E,children:j}=S,N=i(u,E),T=st(C,N.collectionRef);return c.jsx(f,{ref:T,children:j})});m.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=Ba(p),x=q.forwardRef((S,C)=>{const{scope:E,children:j,...N}=S,T=q.useRef(null),k=st(C,T),A=i(p,E);return q.useEffect(()=>(A.itemMap.set(T,{ref:T,...N}),()=>void A.itemMap.delete(T))),c.jsx(v,{[g]:"",ref:k,children:j})});x.displayName=p;function b(S){const C=i(e+"CollectionConsumer",S);return q.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const N=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((A,I)=>N.indexOf(A.ref.current)-N.indexOf(I.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:m,ItemSlot:x},b,o]}function qt(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}function nee(e,t=globalThis?.document){const n=qt(e);_.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var ree="DismissableLayer",pw="dismissableLayer.update",oee="dismissableLayer.pointerDownOutside",iee="dismissableLayer.focusOutside",jT,zM=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wu=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...f}=e,m=_.useContext(zM),[p,g]=_.useState(null),v=p?.ownerDocument??globalThis?.document,[,x]=_.useState({}),b=st(t,I=>g(I)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),j=p?S.indexOf(p):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,T=j>=E,k=lee(I=>{const P=I.target,F=[...m.branches].some(L=>L.contains(P));!T||F||(r?.(I),l?.(I),I.defaultPrevented||u?.())},v),A=cee(I=>{const P=I.target;[...m.branches].some(L=>L.contains(P))||(i?.(I),l?.(I),I.defaultPrevented||u?.())},v);return nee(I=>{j===m.layers.size-1&&(o?.(I),!I.defaultPrevented&&u&&(I.preventDefault(),u()))},v),_.useEffect(()=>{if(p)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(jT=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),NT(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=jT)}},[p,v,n,m]),_.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),NT())},[p,m]),_.useEffect(()=>{const I=()=>x({});return document.addEventListener(pw,I),()=>document.removeEventListener(pw,I)},[]),c.jsx(Ue.div,{...f,ref:b,style:{pointerEvents:N?T?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,k.onPointerDownCapture)})});wu.displayName=ree;var see="DismissableLayerBranch",aee=_.forwardRef((e,t)=>{const n=_.useContext(zM),o=_.useRef(null),r=st(t,o);return _.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(Ue.div,{...e,ref:r})});aee.displayName=see;function lee(e,t=globalThis?.document){const n=qt(e),o=_.useRef(!1),r=_.useRef(()=>{});return _.useEffect(()=>{const i=u=>{if(u.target&&!o.current){let f=function(){UM(oee,n,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=f,t.addEventListener("click",r.current,{once:!0})):f()}else t.removeEventListener("click",r.current);o.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function cee(e,t=globalThis?.document){const n=qt(e),o=_.useRef(!1);return _.useEffect(()=>{const r=i=>{i.target&&!o.current&&UM(iee,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function NT(){const e=new CustomEvent(pw);document.dispatchEvent(e)}function UM(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Hp(r,i):r.dispatchEvent(i)}function LM(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var FM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uee="VisuallyHidden",VM=_.forwardRef((e,t)=>c.jsx(Ue.span,{...e,ref:t,style:{...FM,...e.style}}));VM.displayName=uee;var BM=VM,ml="NavigationMenu",[K0,HM,dee]=Vf(ml),[gw,fee,mee]=Vf(ml),[Z0]=Jo(ml,[dee,mee]),[hee,Ao]=Z0(ml),[pee,gee]=Z0(ml),GM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,delayDuration:l=200,skipDelayDuration:u=300,orientation:f="horizontal",dir:m,...p}=e,[g,v]=_.useState(null),x=st(t,F=>v(F)),b=_u(m),S=_.useRef(0),C=_.useRef(0),E=_.useRef(0),[j,N]=_.useState(!0),[T,k]=Ei({prop:o,onChange:F=>{const L=F!=="",se=u>0;L?(window.clearTimeout(E.current),se&&N(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>N(!0),u)),r?.(F)},defaultProp:i??"",caller:ml}),A=_.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>k(""),150)},[k]),I=_.useCallback(F=>{window.clearTimeout(C.current),k(F)},[k]),P=_.useCallback(F=>{T===F?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),k(F)},l)},[T,k,l]);return _.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),c.jsx(qM,{scope:n,isRootMenu:!0,value:T,dir:b,orientation:f,rootNavigationMenu:g,onTriggerEnter:F=>{window.clearTimeout(S.current),j?P(F):I(F)},onTriggerLeave:()=>{window.clearTimeout(S.current),A()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:A,onItemSelect:F=>{k(L=>L===F?"":F)},onItemDismiss:()=>k(""),children:c.jsx(Ue.nav,{"aria-label":"Main","data-orientation":f,dir:b,...p,ref:x})})});GM.displayName=ml;var vw="NavigationMenuSub",vee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,orientation:l="horizontal",...u}=e,f=Ao(vw,n),[m,p]=Ei({prop:o,onChange:r,defaultProp:i??"",caller:vw});return c.jsx(qM,{scope:n,isRootMenu:!1,value:m,dir:f.dir,orientation:l,rootNavigationMenu:f.rootNavigationMenu,onTriggerEnter:g=>p(g),onItemSelect:g=>p(g),onItemDismiss:()=>p(""),children:c.jsx(Ue.div,{"data-orientation":l,...u,ref:t})})});vee.displayName=vw;var qM=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:o,dir:r,orientation:i,children:l,value:u,onItemSelect:f,onItemDismiss:m,onTriggerEnter:p,onTriggerLeave:g,onContentEnter:v,onContentLeave:x}=e,[b,S]=_.useState(null),[C,E]=_.useState(new Map),[j,N]=_.useState(null);return c.jsx(hee,{scope:t,isRootMenu:n,rootNavigationMenu:o,value:u,previousValue:LM(u),baseId:Qr(),dir:r,orientation:i,viewport:b,onViewportChange:S,indicatorTrack:j,onIndicatorTrackChange:N,onTriggerEnter:qt(p),onTriggerLeave:qt(g),onContentEnter:qt(v),onContentLeave:qt(x),onItemSelect:qt(f),onItemDismiss:qt(m),onViewportContentChange:_.useCallback((T,k)=>{E(A=>(A.set(T,k),new Map(A)))},[]),onViewportContentRemove:_.useCallback(T=>{E(k=>k.has(T)?(k.delete(T),new Map(k)):k)},[]),children:c.jsx(K0.Provider,{scope:t,children:c.jsx(pee,{scope:t,items:C,children:l})})})},KM="NavigationMenuList",ZM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Ao(KM,n),i=c.jsx(Ue.ul,{"data-orientation":r.orientation,...o,ref:t});return c.jsx(Ue.div,{style:{position:"relative"},ref:r.onIndicatorTrackChange,children:c.jsx(K0.Slot,{scope:n,children:r.isRootMenu?c.jsx(tP,{asChild:!0,children:i}):i})})});ZM.displayName=KM;var YM="NavigationMenuItem",[yee,XM]=Z0(YM),WM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,...r}=e,i=Qr(),l=o||i||"LEGACY_REACT_AUTO_VALUE",u=_.useRef(null),f=_.useRef(null),m=_.useRef(null),p=_.useRef(()=>{}),g=_.useRef(!1),v=_.useCallback((b="start")=>{if(u.current){p.current();const S=bw(u.current);S.length&&W0(b==="start"?S:S.reverse())}},[]),x=_.useCallback(()=>{if(u.current){const b=bw(u.current);b.length&&(p.current=Nee(b))}},[]);return c.jsx(yee,{scope:n,value:l,triggerRef:f,contentRef:u,focusProxyRef:m,wasEscapeCloseRef:g,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:x,onContentFocusOutside:x,children:c.jsx(Ue.li,{...r,ref:t})})});WM.displayName=YM;var yw="NavigationMenuTrigger",bee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:o,...r}=e,i=Ao(yw,e.__scopeNavigationMenu),l=XM(yw,e.__scopeNavigationMenu),u=_.useRef(null),f=st(u,l.triggerRef,t),m=rP(i.baseId,l.value),p=oP(i.baseId,l.value),g=_.useRef(!1),v=_.useRef(!1),x=l.value===i.value;return c.jsxs(c.Fragment,{children:[c.jsx(K0.ItemSlot,{scope:n,value:l.value,children:c.jsx(nP,{asChild:!0,children:c.jsx(Ue.button,{id:m,disabled:o,"data-disabled":o?"":void 0,"data-state":Q0(x),"aria-expanded":x,"aria-controls":p,...r,ref:f,onPointerEnter:Se(e.onPointerEnter,()=>{v.current=!1,l.wasEscapeCloseRef.current=!1}),onPointerMove:Se(e.onPointerMove,Gp(()=>{o||v.current||l.wasEscapeCloseRef.current||g.current||(i.onTriggerEnter(l.value),g.current=!0)})),onPointerLeave:Se(e.onPointerLeave,Gp(()=>{o||(i.onTriggerLeave(),g.current=!1)})),onClick:Se(e.onClick,()=>{i.onItemSelect(l.value),v.current=x}),onKeyDown:Se(e.onKeyDown,b=>{const C={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];x&&b.key===C&&(l.onEntryKeyDown(),b.preventDefault())})})})}),x&&c.jsxs(c.Fragment,{children:[c.jsx(BM,{"aria-hidden":!0,tabIndex:0,ref:l.focusProxyRef,onFocus:b=>{const S=l.contentRef.current,C=b.relatedTarget,E=C===u.current,j=S?.contains(C);(E||!j)&&l.onFocusProxyEnter(E?"start":"end")}}),i.viewport&&c.jsx("span",{"aria-owns":p})]})]})});bee.displayName=yw;var xee="NavigationMenuLink",kT="navigationMenu.linkSelect",QM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:o,onSelect:r,...i}=e;return c.jsx(nP,{asChild:!0,children:c.jsx(Ue.a,{"data-active":o?"":void 0,"aria-current":o?"page":void 0,...i,ref:t,onClick:Se(e.onClick,l=>{const u=l.target,f=new CustomEvent(kT,{bubbles:!0,cancelable:!0});if(u.addEventListener(kT,m=>r?.(m),{once:!0}),Hp(u,f),!f.defaultPrevented&&!l.metaKey){const m=new CustomEvent(wp,{bubbles:!0,cancelable:!0});Hp(u,m)}},{checkForDefaultPrevented:!1})})})});QM.displayName=xee;var Y0="NavigationMenuIndicator",_ee=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Ao(Y0,e.__scopeNavigationMenu),i=!!r.value;return r.indicatorTrack?_0.createPortal(c.jsx(Pn,{present:n||i,children:c.jsx(wee,{...o,ref:t})}),r.indicatorTrack):null});_ee.displayName=Y0;var wee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Ao(Y0,n),i=HM(n),[l,u]=_.useState(null),[f,m]=_.useState(null),p=r.orientation==="horizontal",g=!!r.value;_.useEffect(()=>{const b=i().find(S=>S.value===r.value)?.ref.current;b&&u(b)},[i,r.value]);const v=()=>{l&&m({size:p?l.offsetWidth:l.offsetHeight,offset:p?l.offsetLeft:l.offsetTop})};return xw(l,v),xw(r.indicatorTrack,v),f?c.jsx(Ue.div,{"aria-hidden":!0,"data-state":g?"visible":"hidden","data-orientation":r.orientation,...o,ref:t,style:{position:"absolute",...p?{left:0,width:f.size+"px",transform:`translateX(${f.offset}px)`}:{top:0,height:f.size+"px",transform:`translateY(${f.offset}px)`},...o.style}}):null}),Xc="NavigationMenuContent",See=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Ao(Xc,e.__scopeNavigationMenu),i=XM(Xc,e.__scopeNavigationMenu),l=st(i.contentRef,t),u=i.value===r.value,f={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...o};return r.viewport?c.jsx(Cee,{forceMount:n,...f,ref:l}):c.jsx(Pn,{present:n||u,children:c.jsx(JM,{"data-state":Q0(u),...f,ref:l,onPointerEnter:Se(e.onPointerEnter,r.onContentEnter),onPointerLeave:Se(e.onPointerLeave,Gp(r.onContentLeave)),style:{pointerEvents:!u&&r.isRootMenu?"none":void 0,...f.style}})})});See.displayName=Xc;var Cee=_.forwardRef((e,t)=>{const n=Ao(Xc,e.__scopeNavigationMenu),{onViewportContentChange:o,onViewportContentRemove:r}=n;return En(()=>{o(e.value,{ref:t,...e})},[e,t,o]),En(()=>()=>r(e.value),[e.value,r]),null}),wp="navigationMenu.rootContentDismiss",JM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,triggerRef:r,focusProxyRef:i,wasEscapeCloseRef:l,onRootContentClose:u,onContentFocusOutside:f,...m}=e,p=Ao(Xc,n),g=_.useRef(null),v=st(g,t),x=rP(p.baseId,o),b=oP(p.baseId,o),S=HM(n),C=_.useRef(null),{onItemDismiss:E}=p;_.useEffect(()=>{const N=g.current;if(p.isRootMenu&&N){const T=()=>{E(),u(),N.contains(document.activeElement)&&r.current?.focus()};return N.addEventListener(wp,T),()=>N.removeEventListener(wp,T)}},[p.isRootMenu,e.value,r,E,u]);const j=_.useMemo(()=>{const T=S().map(L=>L.value);p.dir==="rtl"&&T.reverse();const k=T.indexOf(p.value),A=T.indexOf(p.previousValue),I=o===p.value,P=A===T.indexOf(o);if(!I&&!P)return C.current;const F=(()=>{if(k!==A){if(I&&A!==-1)return k>A?"from-end":"from-start";if(P&&k!==-1)return k>A?"to-start":"to-end"}return null})();return C.current=F,F},[p.previousValue,p.value,p.dir,S,o]);return c.jsx(tP,{asChild:!0,children:c.jsx(wu,{id:b,"aria-labelledby":x,"data-motion":j,"data-orientation":p.orientation,...m,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const N=new Event(wp,{bubbles:!0,cancelable:!0});g.current?.dispatchEvent(N)},onFocusOutside:Se(e.onFocusOutside,N=>{f();const T=N.target;p.rootNavigationMenu?.contains(T)&&N.preventDefault()}),onPointerDownOutside:Se(e.onPointerDownOutside,N=>{const T=N.target,k=S().some(I=>I.ref.current?.contains(T)),A=p.isRootMenu&&p.viewport?.contains(T);(k||A||!p.isRootMenu)&&N.preventDefault()}),onKeyDown:Se(e.onKeyDown,N=>{const T=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!T){const A=bw(N.currentTarget),I=document.activeElement,P=A.findIndex(se=>se===I),L=N.shiftKey?A.slice(0,P).reverse():A.slice(P+1,A.length);W0(L)?N.preventDefault():i.current?.focus()}}),onEscapeKeyDown:Se(e.onEscapeKeyDown,N=>{l.current=!0})})})}),X0="NavigationMenuViewport",eP=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,i=!!Ao(X0,e.__scopeNavigationMenu).value;return c.jsx(Pn,{present:n||i,children:c.jsx(Eee,{...o,ref:t})})});eP.displayName=X0;var Eee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:o,...r}=e,i=Ao(X0,n),l=st(t,i.onViewportChange),u=gee(Xc,e.__scopeNavigationMenu),[f,m]=_.useState(null),[p,g]=_.useState(null),v=f?f?.width+"px":void 0,x=f?f?.height+"px":void 0,b=!!i.value,S=b?i.value:i.previousValue;return xw(p,()=>{p&&m({width:p.offsetWidth,height:p.offsetHeight})}),c.jsx(Ue.div,{"data-state":Q0(b),"data-orientation":i.orientation,...r,ref:l,style:{pointerEvents:!b&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":x,...r.style},onPointerEnter:Se(e.onPointerEnter,i.onContentEnter),onPointerLeave:Se(e.onPointerLeave,Gp(i.onContentLeave)),children:Array.from(u.items).map(([E,{ref:j,forceMount:N,...T}])=>{const k=S===E;return c.jsx(Pn,{present:N||k,children:c.jsx(JM,{...T,ref:Rf(j,A=>{k&&A&&g(A)})})},E)})})}),Ree="FocusGroup",tP=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Ao(Ree,n);return c.jsx(gw.Provider,{scope:n,children:c.jsx(gw.Slot,{scope:n,children:c.jsx(Ue.div,{dir:r.dir,...o,ref:t})})})}),TT=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],jee="FocusGroupItem",nP=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=fee(n),i=Ao(jee,n);return c.jsx(gw.ItemSlot,{scope:n,children:c.jsx(Ue.button,{...o,ref:t,onKeyDown:Se(e.onKeyDown,l=>{if(["Home","End",...TT].includes(l.key)){let f=r().map(g=>g.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(l.key)&&f.reverse(),TT.includes(l.key)){const g=f.indexOf(l.currentTarget);f=f.slice(g+1)}setTimeout(()=>W0(f)),l.preventDefault()}})})})});function bw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function W0(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function Nee(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function xw(e,t){const n=qt(t);En(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}function Q0(e){return e?"open":"closed"}function rP(e,t){return`${e}-trigger-${t}`}function oP(e,t){return`${e}-content-${t}`}function Gp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var kee=GM,Tee=ZM,Oee=WM,Aee=QM,Iee=eP;function $ee({className:e,...t}){return c.jsx("div",{className:$e("absolute top-full left-0 isolate z-50 flex justify-center"),children:c.jsx(Iee,{"data-slot":"navigation-menu-viewport",className:$e("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function iP({className:e,children:t,viewport:n=!0,...o}){return c.jsxs(kee,{"data-slot":"navigation-menu","data-viewport":n,className:$e("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...o,children:[t,n&&c.jsx($ee,{})]})}function qp({className:e,...t}){return c.jsx(Oee,{"data-slot":"navigation-menu-item",className:$e("relative",e),...t})}function Kp({className:e,...t}){return c.jsx(Aee,{"data-slot":"navigation-menu-link",className:$e("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function sP({className:e,...t}){return c.jsx(Tee,{"data-slot":"navigation-menu-list",className:$e("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function Bf(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return Fs({id:Sn,operationsUrl:e})}function Hf(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return{instanceClient:Fs({id:Sn,operationsUrl:e}),entityType:"instance"}}function dr(e){const{instanceId:t,clusterId:n}=Ze({strict:!1}),o=Sn;return{instanceClient:Fs({id:o,operationsUrl:e}),entityId:o,entityType:"instance"}}function Mee(){localStorage.clear()}function Pee(){sessionStorage.clear()}async function Dee(){Hn.setUserForEntity(Sn,null),cf.getQueryCache().clear(),Mee(),Pee(),await cf.invalidateQueries({refetchType:"none"})}async function zee(e){await Hn.signOutFromPotentiallyAuthenticatedInstances(),await If(e)}function Uee(){const e=Bf();return at({mutationFn:()=>zee({instanceClient:e}),onSuccess:Dee})}function Gf(e){const{user:t}=mu(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];return!o?.permission&&!o?.organization?{update:!1,remove:!1}:o.permission?.super_user?{update:!0,remove:!0}:{update:o.organization.update,remove:o.organization.delete}}function Su(e){const{user:t}=mu(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];if(!o?.permission&&!o?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(o.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const r=o.organization.roles;return{create:r.create,remove:r.delete,update:r.update,view:r.view}}function J0(e,t){const{user:n}=mu(),{organizationId:o,clusterId:r}=Ze({strict:!1}),i=t??r,l=n?.roles?.[e??o];if(!l?.permission&&!l?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(l.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const u=l.organization.clusters.resources?.find(m=>m.id===i),f=l.organization.clusters;return{create:f.create,remove:u?u.delete:f.delete,update:u?u.update:f.update,view:u?u.view:f.view}}function aP(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=ra(n??t),r=o?.role?.permission;return r?r.super_user===!0:!1}function eS(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=ra(n??t),r=o?.role?.permission;return r?r.super_user===!0||r.structure_user===!0:!1}function Yx(e,t,n,o){const{clusterId:r,instanceId:i}=Ze({strict:!1}),{user:l}=ra(e??i??r),u=l?.role?.permission;return u?u.super_user===!0||u.structure_user===!0?!0:u[t]?.tables?.[n][o]===!0:!1}const Lee={className:"text-white"};function Fee({signOut:e}){const{user:t}=sl();hu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Gf(n),{view:r}=Su(n),[i,l]=_.useState(!1);return c.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs(ze,{to:na,children:[c.jsx(tS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.3"})]}),c.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:()=>{l(!i)},children:[c.jsx("span",{className:"sr-only",children:i?"Close menu":"Open menu"}),i?c.jsx(FI,{}):c.jsx(zI,{})]})]}),c.jsxs("div",{className:`${i?"block":"hidden"} md:hidden space-y-1 pb-3 bg-black-dark absolute left-0 top-full w-full rounded-b-md`,children:[!Pc,!Pc,c.jsxs(ze,{to:"/docs",className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(S0,{className:"mr-4"})," Docs"]}),c.jsxs(ze,{to:void 0,onClick:e,className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(DI,{className:"mr-4"})," Sign Out"]})]})]})}function Vee({signOut:e}){const{user:t}=sl();hu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Gf(n),{view:r}=Su(n);return c.jsx("div",{className:"hidden md:block",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(ze,{to:na,children:[c.jsx(tS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.3"})]})}),c.jsx(iP,{children:c.jsxs(sP,{className:"text-grey-400",children:[!Pc,!Pc,c.jsx(qp,{children:c.jsx(Kp,{asChild:!0,children:c.jsxs(ze,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(S0,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Docs"})]})})}),c.jsx(qp,{children:c.jsx(Kp,{asChild:!0,children:c.jsxs(ze,{to:void 0,onClick:e,className:"flex-row items-center",children:[c.jsx(DI,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Sign Out"})]})})})]})})]})})}function Bee(){return c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(ze,{to:"/sign-in",children:[c.jsx(tS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.3"})]})}),c.jsx(iP,{children:c.jsxs(sP,{className:"text-grey-400",children:[c.jsx(qp,{children:c.jsx(Kp,{asChild:!0,children:c.jsxs(ze,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(S0,{})," ",c.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),c.jsx(qp,{children:c.jsx(Kp,{asChild:!0,children:c.jsxs(ze,{to:"/sign-in",className:"flex-row items-center",activeProps:Lee,children:[c.jsx(MG,{})," Sign In"]})})})]})})]})}function tS(){return c.jsxs(c.Fragment,{children:[c.jsx("img",{src:"/logo_harper_db_studio.png",alt:"logo",className:"w-64 hidden md:inline-block"}),c.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}function lP(){const{mutate:e}=Uee(),t=gn(),{user:n}=sl(),o=Rn(),r=_.useCallback(()=>{e(void 0,{onSuccess:async()=>{Ce.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Ce.dismiss()}}),t({to:"/sign-in"}),o.invalidate()}})},[e,o,t]);return n?c.jsxs(c.Fragment,{children:[c.jsx(Fee,{signOut:r}),c.jsx(Vee,{signOut:r})]}):c.jsx(Bee,{})}function Hh({title:e,children:t}){return c.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[c.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function Hee(){return c.jsxs(c.Fragment,{children:[c.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:c.jsx(lP,{})}),c.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[c.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:c.jsxs("div",{children:[c.jsx("h1",{className:"text-4xl font-bold",children:"Harper Studio"}),c.jsx("span",{children:"Manage all your Harper instances."}),c.jsxs("ul",{className:"ps-5",children:[c.jsx(Hh,{title:"Manage All Instances",children:c.jsx("span",{children:"View, create, and delete instances from one location."})}),c.jsx(Hh,{title:"Embedded API Server",children:c.jsx("span",{children:"Harper components give you unlimited application flexibility"})}),c.jsx(Hh,{title:"Fully Managed Cloud & 5G Instances",children:c.jsx("span",{children:"Go from zero to code in minutes."})}),c.jsx(Hh,{title:"Deploy Anywhere",children:c.jsxs("div",{className:"mt-6",children:[c.jsx("a",{href:"https://hub.docker.com/r/harperdb/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"Docker"}),c.jsx("a",{href:"https://www.npmjs.com/package/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"npm"}),c.jsx("a",{href:"https://docs.harperdb.io/docs/deployments/install-harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 border-2 border-blue-100 rounded-md",children:"all options"})]})})]})]})}),c.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:c.jsx(ls,{})})]})]})}const Dd=new Map;function hl(e){if(!e)return"";if(Dd.has(e))return Dd.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return Dd.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return Dd.set(e,""),"";const o=[];for(let l=0;l<n.length;l++){const u=n[l],f=l+1<n.length?n[l+1]:void 0;/^[A-Z]{2,}$/.test(u)&&f==="s"?(o.push(u+"s"),l++):/^[A-Z]$/.test(u)&&f!==void 0&&/^[A-Z]s$/.test(f)?(o.push(u+f),l++):o.push(u)}const i=o.map(Gee).join(" ");return Dd.set(e,i),i}function Gee(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Jg(){const e=Y8(),{organization:t,instance:n,cluster:o}=w0({strict:!1}),r=_.useMemo(()=>{const i=e.pathname.split("/").filter(u=>u&&u.length>0),l=[c.jsxs(ze,{to:"/",children:[c.jsx(NG,{"aria-hidden":"true",className:"size-5 shrink-0"}),c.jsx("span",{className:"sr-only",children:"Home"})]})];for(let u=0;u<i.length;u++){const f=i[u];if(f==="instance")continue;let m=`/${i.slice(0,u+1).join("/")}`,p=hl(f),g;f==="databases"&&i.length===u+3?(p=i[u+2],u+=2):p.startsWith("Org ")?p=t?.name||"Org":p.startsWith("Clu ")?(p=o?.name||"Cluster",i[u+1]==="instance"&&(m+="/instances")):p.startsWith("Ins ")&&(p=n?.name?.split(".")?.shift()||"Instance"),l.push(c.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:c.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),c.jsxs(ze,{to:m,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[p,g]}))}return l},[e.pathname,o?.name,n?.name,t?.name]);return c.jsxs("div",{role:"list",className:"flex items-center space-x-0 lg:space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...r]})}var qf=e=>e.type==="checkbox",Ma=e=>e instanceof Date,_r=e=>e==null;const cP=e=>typeof e=="object";var pn=e=>!_r(e)&&!Array.isArray(e)&&cP(e)&&!Ma(e),uP=e=>pn(e)&&e.target?qf(e.target)?e.target.checked:e.target.value:e,qee=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,dP=(e,t)=>e.has(qee(t)),Kee=e=>{const t=e.constructor&&e.constructor.prototype;return pn(t)&&t.hasOwnProperty("isPrototypeOf")},nS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ft(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(nS&&(e instanceof Blob||o))&&(n||pn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!Kee(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Ft(e[r]));else return e;return t}var ev=e=>/^\w*$/.test(e),Vt=e=>e===void 0,tv=e=>Array.isArray(e)?e.filter(Boolean):[],rS=e=>tv(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ee=(e,t,n)=>{if(!t||!pn(e))return n;const o=(ev(t)?[t]:rS(t)).reduce((r,i)=>_r(r)?r:r[i],e);return Vt(o)||o===e?Vt(e[t])?n:e[t]:o},Kr=e=>typeof e=="boolean",Ct=(e,t,n)=>{let o=-1;const r=ev(t)?[t]:rS(t),i=r.length,l=i-1;for(;++o<i;){const u=r[o];let f=n;if(o!==l){const m=e[u];f=pn(m)||Array.isArray(m)?m:isNaN(+r[o+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const Zp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},wo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Zi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},oS=q.createContext(null);oS.displayName="HookFormContext";const Kf=()=>q.useContext(oS),Zee=e=>{const{children:t,...n}=e;return q.createElement(oS.Provider,{value:n},t)};var fP=(e,t,n,o=!0)=>{const r={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(r,i,{get:()=>{const l=i;return t._proxyFormState[l]!==wo.all&&(t._proxyFormState[l]=!o||wo.all),n&&(n[l]=!0),e[l]}});return r};const nv=typeof window<"u"?q.useLayoutEffect:q.useEffect;function iS(e){const t=Kf(),{control:n=t.control,disabled:o,name:r,exact:i}=e||{},[l,u]=q.useState(n._formState),f=q.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return nv(()=>n._subscribe({name:r,formState:f.current,exact:i,callback:m=>{!o&&u({...n._formState,...m})}}),[r,o,i]),q.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),q.useMemo(()=>fP(l,n,f.current,!1),[l,n])}var gi=e=>typeof e=="string",mP=(e,t,n,o,r)=>gi(e)?(o&&t.watch.add(e),Ee(n,e,r)):Array.isArray(e)?e.map(i=>(o&&t.watch.add(i),Ee(n,i))):(o&&(t.watchAll=!0),n),_w=e=>_r(e)||!cP(e);function Qi(e,t,n=new WeakSet){if(_w(e)||_w(t))return e===t;if(Ma(e)&&Ma(t))return e.getTime()===t.getTime();const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of o){const l=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const u=t[i];if(Ma(l)&&Ma(u)||pn(l)&&pn(u)||Array.isArray(l)&&Array.isArray(u)?!Qi(l,u,n):l!==u)return!1}}return!0}function Yee(e){const t=Kf(),{control:n=t.control,name:o,defaultValue:r,disabled:i,exact:l,compute:u}=e||{},f=q.useRef(r),m=q.useRef(u),p=q.useRef(void 0);m.current=u;const g=q.useMemo(()=>n._getWatch(o,f.current),[n,o]),[v,x]=q.useState(m.current?m.current(g):g);return nv(()=>n._subscribe({name:o,formState:{values:!0},exact:l,callback:b=>{if(!i){const S=mP(o,n._names,b.values||n._formValues,!1,f.current);if(m.current){const C=m.current(S);Qi(C,p.current)||(x(C),p.current=C)}else x(S)}}}),[n,i,o,l]),q.useEffect(()=>n._removeUnmounted()),v}function Xee(e){const t=Kf(),{name:n,disabled:o,control:r=t.control,shouldUnregister:i,defaultValue:l}=e,u=dP(r._names.array,n),f=q.useMemo(()=>Ee(r._formValues,n,Ee(r._defaultValues,n,l)),[r,n,l]),m=Yee({control:r,name:n,defaultValue:f,exact:!0}),p=iS({control:r,name:n,exact:!0}),g=q.useRef(e),v=q.useRef(r.register(n,{...e.rules,value:m,...Kr(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const x=q.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ee(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ee(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ee(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ee(p.validatingFields,n)},error:{enumerable:!0,get:()=>Ee(p.errors,n)}}),[p,n]),b=q.useCallback(j=>v.current.onChange({target:{value:uP(j),name:n},type:Zp.CHANGE}),[n]),S=q.useCallback(()=>v.current.onBlur({target:{value:Ee(r._formValues,n),name:n},type:Zp.BLUR}),[n,r._formValues]),C=q.useCallback(j=>{const N=Ee(r._fields,n);N&&j&&(N._f.ref={focus:()=>j.focus&&j.focus(),select:()=>j.select&&j.select(),setCustomValidity:T=>j.setCustomValidity(T),reportValidity:()=>j.reportValidity()})},[r._fields,n]),E=q.useMemo(()=>({name:n,value:m,...Kr(o)||p.disabled?{disabled:p.disabled||o}:{},onChange:b,onBlur:S,ref:C}),[n,o,p.disabled,b,S,C,m]);return q.useEffect(()=>{const j=r._options.shouldUnregister||i;r.register(n,{...g.current.rules,...Kr(g.current.disabled)?{disabled:g.current.disabled}:{}});const N=(T,k)=>{const A=Ee(r._fields,T);A&&A._f&&(A._f.mount=k)};if(N(n,!0),j){const T=Ft(Ee(r._options.defaultValues,n));Ct(r._defaultValues,n,T),Vt(Ee(r._formValues,n))&&Ct(r._formValues,n,T)}return!u&&r.register(n),()=>{(u?j&&!r._state.action:j)?r.unregister(n):N(n,!1)}},[n,r,u,i]),q.useEffect(()=>{r._setDisabledField({disabled:o,name:n})},[o,n,r]),q.useMemo(()=>({field:E,formState:p,fieldState:x}),[E,p,x])}const Wee=e=>e.render(Xee(e));var sS=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},Or=e=>Array.isArray(e)?e:[e],OT=()=>{let e=[];return{get observers(){return e},next:r=>{for(const i of e)i.next&&i.next(r)},subscribe:r=>(e.push(r),{unsubscribe:()=>{e=e.filter(i=>i!==r)}}),unsubscribe:()=>{e=[]}}},yr=e=>pn(e)&&!Object.keys(e).length,aS=e=>e.type==="file",Fo=e=>typeof e=="function",Yp=e=>{if(!nS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},hP=e=>e.type==="select-multiple",lS=e=>e.type==="radio",Qee=e=>lS(e)||qf(e),Xx=e=>Yp(e)&&e.isConnected;function Jee(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=Vt(e)?o++:e[t[o++]];return e}function ete(e){for(const t in e)if(e.hasOwnProperty(t)&&!Vt(e[t]))return!1;return!0}function dn(e,t){const n=Array.isArray(t)?t:ev(t)?[t]:rS(t),o=n.length===1?e:Jee(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(pn(o)&&yr(o)||Array.isArray(o)&&ete(o))&&dn(e,n.slice(0,-1)),e}var pP=e=>{for(const t in e)if(Fo(e[t]))return!0;return!1};function Xp(e,t={}){const n=Array.isArray(e);if(pn(e)||n)for(const o in e)Array.isArray(e[o])||pn(e[o])&&!pP(e[o])?(t[o]=Array.isArray(e[o])?[]:{},Xp(e[o],t[o])):_r(e[o])||(t[o]=!0);return t}function gP(e,t,n){const o=Array.isArray(e);if(pn(e)||o)for(const r in e)Array.isArray(e[r])||pn(e[r])&&!pP(e[r])?Vt(t)||_w(n[r])?n[r]=Array.isArray(e[r])?Xp(e[r],[]):{...Xp(e[r])}:gP(e[r],_r(t)?{}:t[r],n[r]):n[r]=!Qi(e[r],t[r]);return n}var zd=(e,t)=>gP(e,t,Xp(t));const AT={value:!1,isValid:!1},IT={value:!0,isValid:!0};var vP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Vt(e[0].attributes.value)?Vt(e[0].value)||e[0].value===""?IT:{value:e[0].value,isValid:!0}:IT:AT}return AT},yP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>Vt(e)?e:t?e===""?NaN:e&&+e:n&&gi(e)?new Date(e):o?o(e):e;const $T={isValid:!1,value:null};var bP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,$T):$T;function MT(e){const t=e.ref;return aS(t)?t.files:lS(t)?bP(e.refs).value:hP(t)?[...t.selectedOptions].map(({value:n})=>n):qf(t)?vP(e.refs).value:yP(Vt(t.value)?e.ref.value:t.value,e)}var tte=(e,t,n,o)=>{const r={};for(const i of e){const l=Ee(t,i);l&&Ct(r,i,l._f)}return{criteriaMode:n,names:[...e],fields:r,shouldUseNativeValidation:o}},Wp=e=>e instanceof RegExp,Ud=e=>Vt(e)?e:Wp(e)?e.source:pn(e)?Wp(e.value)?e.value.source:e.value:e,wc=e=>({isOnSubmit:!e||e===wo.onSubmit,isOnBlur:e===wo.onBlur,isOnChange:e===wo.onChange,isOnAll:e===wo.all,isOnTouch:e===wo.onTouched});const PT="AsyncFunction";var nte=e=>!!e&&!!e.validate&&!!(Fo(e.validate)&&e.validate.constructor.name===PT||pn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===PT)),rte=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ww=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const kc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Ee(e,r);if(i){const{_f:l,...u}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],r)&&!o)return!0;if(l.ref&&t(l.ref,l.name)&&!o)return!0;if(kc(u,t))break}else if(pn(u)&&kc(u,t))break}}};function DT(e,t,n){const o=Ee(e,n);if(o||ev(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),l=Ee(t,i),u=Ee(e,i);if(l&&!Array.isArray(l)&&n!==i)return{name:n};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};r.pop()}return{name:n}}var ote=(e,t,n,o)=>{n(e);const{name:r,...i}=e;return yr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!o||wo.all))},ite=(e,t,n)=>!e||!t||e===t||Or(e).some(o=>o&&(n?o===t:o.startsWith(t)||t.startsWith(o))),ste=(e,t,n,o,r)=>r.isOnAll?!1:!n&&r.isOnTouch?!(t||e):(n?o.isOnBlur:r.isOnBlur)?!e:(n?o.isOnChange:r.isOnChange)?e:!0,ate=(e,t)=>!tv(Ee(e,t)).length&&dn(e,t),xP=(e,t,n)=>{const o=Or(Ee(e,n));return Ct(o,"root",t[n]),Ct(e,n,o),e},Sp=e=>gi(e);function zT(e,t,n="validate"){if(Sp(e)||Array.isArray(e)&&e.every(Sp)||Kr(e)&&!e)return{type:n,message:Sp(e)?e:"",ref:t}}var mc=e=>pn(e)&&!Wp(e)?e:{value:e,message:""},Sw=async(e,t,n,o,r,i)=>{const{ref:l,refs:u,required:f,maxLength:m,minLength:p,min:g,max:v,pattern:x,validate:b,name:S,valueAsNumber:C,mount:E}=e._f,j=Ee(n,S);if(!E||t.has(S))return{};const N=u?u[0]:l,T=te=>{r&&N.reportValidity&&(N.setCustomValidity(Kr(te)?"":te||""),N.reportValidity())},k={},A=lS(l),I=qf(l),P=A||I,F=(C||aS(l))&&Vt(l.value)&&Vt(j)||Yp(l)&&l.value===""||j===""||Array.isArray(j)&&!j.length,L=sS.bind(null,S,o,k),se=(te,ce,ae,ie=Zi.maxLength,$=Zi.minLength)=>{const K=te?ce:ae;k[S]={type:te?ie:$,message:K,ref:l,...L(te?ie:$,K)}};if(i?!Array.isArray(j)||!j.length:f&&(!P&&(F||_r(j))||Kr(j)&&!j||I&&!vP(u).isValid||A&&!bP(u).isValid)){const{value:te,message:ce}=Sp(f)?{value:!!f,message:f}:mc(f);if(te&&(k[S]={type:Zi.required,message:ce,ref:N,...L(Zi.required,ce)},!o))return T(ce),k}if(!F&&(!_r(g)||!_r(v))){let te,ce;const ae=mc(v),ie=mc(g);if(!_r(j)&&!isNaN(j)){const $=l.valueAsNumber||j&&+j;_r(ae.value)||(te=$>ae.value),_r(ie.value)||(ce=$<ie.value)}else{const $=l.valueAsDate||new Date(j),K=M=>new Date(new Date().toDateString()+" "+M),U=l.type=="time",re=l.type=="week";gi(ae.value)&&j&&(te=U?K(j)>K(ae.value):re?j>ae.value:$>new Date(ae.value)),gi(ie.value)&&j&&(ce=U?K(j)<K(ie.value):re?j<ie.value:$<new Date(ie.value))}if((te||ce)&&(se(!!te,ae.message,ie.message,Zi.max,Zi.min),!o))return T(k[S].message),k}if((m||p)&&!F&&(gi(j)||i&&Array.isArray(j))){const te=mc(m),ce=mc(p),ae=!_r(te.value)&&j.length>+te.value,ie=!_r(ce.value)&&j.length<+ce.value;if((ae||ie)&&(se(ae,te.message,ce.message),!o))return T(k[S].message),k}if(x&&!F&&gi(j)){const{value:te,message:ce}=mc(x);if(Wp(te)&&!j.match(te)&&(k[S]={type:Zi.pattern,message:ce,ref:l,...L(Zi.pattern,ce)},!o))return T(ce),k}if(b){if(Fo(b)){const te=await b(j,n),ce=zT(te,N);if(ce&&(k[S]={...ce,...L(Zi.validate,ce.message)},!o))return T(ce.message),k}else if(pn(b)){let te={};for(const ce in b){if(!yr(te)&&!o)break;const ae=zT(await b[ce](j,n),N,ce);ae&&(te={...ae,...L(ce,ae.message)},T(ae.message),o&&(k[S]=te))}if(!yr(te)&&(k[S]={ref:N,...te},!o))return k}}return T(!0),k};const lte={mode:wo.onSubmit,reValidateMode:wo.onChange,shouldFocusError:!0};function cte(e={}){let t={...lte,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Fo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},o={},r=pn(t.defaultValues)||pn(t.values)?Ft(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Ft(r),l={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...p};const v={array:OT(),state:OT()},x=t.criteriaMode===wo.all,b=z=>W=>{clearTimeout(m),m=setTimeout(z,W)},S=async z=>{if(!t.disabled&&(p.isValid||g.isValid||z)){const W=t.resolver?yr((await I()).errors):await F(o,!0);W!==n.isValid&&v.state.next({isValid:W})}},C=(z,W)=>{!t.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((z||Array.from(u.mount)).forEach(oe=>{oe&&(W?Ct(n.validatingFields,oe,W):dn(n.validatingFields,oe))}),v.state.next({validatingFields:n.validatingFields,isValidating:!yr(n.validatingFields)}))},E=(z,W=[],oe,ye,xe=!0,be=!0)=>{if(ye&&oe&&!t.disabled){if(l.action=!0,be&&Array.isArray(Ee(o,z))){const je=oe(Ee(o,z),ye.argA,ye.argB);xe&&Ct(o,z,je)}if(be&&Array.isArray(Ee(n.errors,z))){const je=oe(Ee(n.errors,z),ye.argA,ye.argB);xe&&Ct(n.errors,z,je),ate(n.errors,z)}if((p.touchedFields||g.touchedFields)&&be&&Array.isArray(Ee(n.touchedFields,z))){const je=oe(Ee(n.touchedFields,z),ye.argA,ye.argB);xe&&Ct(n.touchedFields,z,je)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=zd(r,i)),v.state.next({name:z,isDirty:se(z,W),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ct(i,z,W)},j=(z,W)=>{Ct(n.errors,z,W),v.state.next({errors:n.errors})},N=z=>{n.errors=z,v.state.next({errors:n.errors,isValid:!1})},T=(z,W,oe,ye)=>{const xe=Ee(o,z);if(xe){const be=Ee(i,z,Vt(oe)?Ee(r,z):oe);Vt(be)||ye&&ye.defaultChecked||W?Ct(i,z,W?be:MT(xe._f)):ae(z,be),l.mount&&S()}},k=(z,W,oe,ye,xe)=>{let be=!1,je=!1;const We={name:z};if(!t.disabled){if(!oe||ye){(p.isDirty||g.isDirty)&&(je=n.isDirty,n.isDirty=We.isDirty=se(),be=je!==We.isDirty);const ft=Qi(Ee(r,z),W);je=!!Ee(n.dirtyFields,z),ft?dn(n.dirtyFields,z):Ct(n.dirtyFields,z,!0),We.dirtyFields=n.dirtyFields,be=be||(p.dirtyFields||g.dirtyFields)&&je!==!ft}if(oe){const ft=Ee(n.touchedFields,z);ft||(Ct(n.touchedFields,z,oe),We.touchedFields=n.touchedFields,be=be||(p.touchedFields||g.touchedFields)&&ft!==oe)}be&&xe&&v.state.next(We)}return be?We:{}},A=(z,W,oe,ye)=>{const xe=Ee(n.errors,z),be=(p.isValid||g.isValid)&&Kr(W)&&n.isValid!==W;if(t.delayError&&oe?(f=b(()=>j(z,oe)),f(t.delayError)):(clearTimeout(m),f=null,oe?Ct(n.errors,z,oe):dn(n.errors,z)),(oe?!Qi(xe,oe):xe)||!yr(ye)||be){const je={...ye,...be&&Kr(W)?{isValid:W}:{},errors:n.errors,name:z};n={...n,...je},v.state.next(je)}},I=async z=>{C(z,!0);const W=await t.resolver(i,t.context,tte(z||u.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return C(z),W},P=async z=>{const{errors:W}=await I(z);if(z)for(const oe of z){const ye=Ee(W,oe);ye?Ct(n.errors,oe,ye):dn(n.errors,oe)}else n.errors=W;return W},F=async(z,W,oe={valid:!0})=>{for(const ye in z){const xe=z[ye];if(xe){const{_f:be,...je}=xe;if(be){const We=u.array.has(be.name),ft=xe._f&&nte(xe._f);ft&&p.validatingFields&&C([ye],!0);const Rt=await Sw(xe,u.disabled,i,x,t.shouldUseNativeValidation&&!W,We);if(ft&&p.validatingFields&&C([ye]),Rt[be.name]&&(oe.valid=!1,W))break;!W&&(Ee(Rt,be.name)?We?xP(n.errors,Rt,be.name):Ct(n.errors,be.name,Rt[be.name]):dn(n.errors,be.name))}!yr(je)&&await F(je,W,oe)}}return oe.valid},L=()=>{for(const z of u.unMount){const W=Ee(o,z);W&&(W._f.refs?W._f.refs.every(oe=>!Xx(oe)):!Xx(W._f.ref))&&ue(z)}u.unMount=new Set},se=(z,W)=>!t.disabled&&(z&&W&&Ct(i,z,W),!Qi(M(),r)),te=(z,W,oe)=>mP(z,u,{...l.mount?i:Vt(W)?r:gi(z)?{[z]:W}:W},oe,W),ce=z=>tv(Ee(l.mount?i:r,z,t.shouldUnregister?Ee(r,z,[]):[])),ae=(z,W,oe={})=>{const ye=Ee(o,z);let xe=W;if(ye){const be=ye._f;be&&(!be.disabled&&Ct(i,z,yP(W,be)),xe=Yp(be.ref)&&_r(W)?"":W,hP(be.ref)?[...be.ref.options].forEach(je=>je.selected=xe.includes(je.value)):be.refs?qf(be.ref)?be.refs.forEach(je=>{(!je.defaultChecked||!je.disabled)&&(Array.isArray(xe)?je.checked=!!xe.find(We=>We===je.value):je.checked=xe===je.value||!!xe)}):be.refs.forEach(je=>je.checked=je.value===xe):aS(be.ref)?be.ref.value="":(be.ref.value=xe,be.ref.type||v.state.next({name:z,values:Ft(i)})))}(oe.shouldDirty||oe.shouldTouch)&&k(z,xe,oe.shouldTouch,oe.shouldDirty,!0),oe.shouldValidate&&re(z)},ie=(z,W,oe)=>{for(const ye in W){if(!W.hasOwnProperty(ye))return;const xe=W[ye],be=z+"."+ye,je=Ee(o,be);(u.array.has(z)||pn(xe)||je&&!je._f)&&!Ma(xe)?ie(be,xe,oe):ae(be,xe,oe)}},$=(z,W,oe={})=>{const ye=Ee(o,z),xe=u.array.has(z),be=Ft(W);Ct(i,z,be),xe?(v.array.next({name:z,values:Ft(i)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&oe.shouldDirty&&v.state.next({name:z,dirtyFields:zd(r,i),isDirty:se(z,be)})):ye&&!ye._f&&!_r(be)?ie(z,be,oe):ae(z,be,oe),ww(z,u)&&v.state.next({...n,name:z}),v.state.next({name:l.mount?z:void 0,values:Ft(i)})},K=async z=>{l.mount=!0;const W=z.target;let oe=W.name,ye=!0;const xe=Ee(o,oe),be=ft=>{ye=Number.isNaN(ft)||Ma(ft)&&isNaN(ft.getTime())||Qi(ft,Ee(i,oe,ft))},je=wc(t.mode),We=wc(t.reValidateMode);if(xe){let ft,Rt;const zr=W.type?MT(xe._f):uP(z),Ur=z.type===Zp.BLUR||z.type===Zp.FOCUS_OUT,ni=!rte(xe._f)&&!t.resolver&&!Ee(n.errors,oe)&&!xe._f.deps||ste(Ur,Ee(n.touchedFields,oe),n.isSubmitted,We,je),ri=ww(oe,u,Ur);Ct(i,oe,zr),Ur?(!W||!W.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(z),f&&f(0)):xe._f.onChange&&xe._f.onChange(z);const oi=k(oe,zr,Ur),io=!yr(oi)||ri;if(!Ur&&v.state.next({name:oe,type:z.type,values:Ft(i)}),ni)return(p.isValid||g.isValid)&&(t.mode==="onBlur"?Ur&&S():Ur||S()),io&&v.state.next({name:oe,...ri?{}:oi});if(!Ur&&ri&&v.state.next({...n}),t.resolver){const{errors:ii}=await I([oe]);if(be(zr),ye){const Ti=DT(n.errors,o,oe),ds=DT(ii,o,Ti.name||oe);ft=ds.error,oe=ds.name,Rt=yr(ii)}}else C([oe],!0),ft=(await Sw(xe,u.disabled,i,x,t.shouldUseNativeValidation))[oe],C([oe]),be(zr),ye&&(ft?Rt=!1:(p.isValid||g.isValid)&&(Rt=await F(o,!0)));ye&&(xe._f.deps&&re(xe._f.deps),A(oe,Rt,ft,oi))}},U=(z,W)=>{if(Ee(n.errors,W)&&z.focus)return z.focus(),1},re=async(z,W={})=>{let oe,ye;const xe=Or(z);if(t.resolver){const be=await P(Vt(z)?z:xe);oe=yr(be),ye=z?!xe.some(je=>Ee(be,je)):oe}else z?(ye=(await Promise.all(xe.map(async be=>{const je=Ee(o,be);return await F(je&&je._f?{[be]:je}:je)}))).every(Boolean),!(!ye&&!n.isValid)&&S()):ye=oe=await F(o);return v.state.next({...!gi(z)||(p.isValid||g.isValid)&&oe!==n.isValid?{}:{name:z},...t.resolver||!z?{isValid:oe}:{},errors:n.errors}),W.shouldFocus&&!ye&&kc(o,U,z?xe:u.mount),ye},M=z=>{const W={...l.mount?i:r};return Vt(z)?W:gi(z)?Ee(W,z):z.map(oe=>Ee(W,oe))},H=(z,W)=>({invalid:!!Ee((W||n).errors,z),isDirty:!!Ee((W||n).dirtyFields,z),error:Ee((W||n).errors,z),isValidating:!!Ee(n.validatingFields,z),isTouched:!!Ee((W||n).touchedFields,z)}),le=z=>{z&&Or(z).forEach(W=>dn(n.errors,W)),v.state.next({errors:z?n.errors:{}})},B=(z,W,oe)=>{const ye=(Ee(o,z,{_f:{}})._f||{}).ref,xe=Ee(n.errors,z)||{},{ref:be,message:je,type:We,...ft}=xe;Ct(n.errors,z,{...ft,...W,ref:ye}),v.state.next({name:z,errors:n.errors,isValid:!1}),oe&&oe.shouldFocus&&ye&&ye.focus&&ye.focus()},Y=(z,W)=>Fo(z)?v.state.subscribe({next:oe=>"values"in oe&&z(te(void 0,W),oe)}):te(z,W,!0),pe=z=>v.state.subscribe({next:W=>{ite(z.name,W.name,z.exact)&&ote(W,z.formState||p,Mt,z.reRenderRoot)&&z.callback({values:{...i},...n,...W,defaultValues:r})}}).unsubscribe,ve=z=>(l.mount=!0,g={...g,...z.formState},pe({...z,formState:g})),ue=(z,W={})=>{for(const oe of z?Or(z):u.mount)u.mount.delete(oe),u.array.delete(oe),W.keepValue||(dn(o,oe),dn(i,oe)),!W.keepError&&dn(n.errors,oe),!W.keepDirty&&dn(n.dirtyFields,oe),!W.keepTouched&&dn(n.touchedFields,oe),!W.keepIsValidating&&dn(n.validatingFields,oe),!t.shouldUnregister&&!W.keepDefaultValue&&dn(r,oe);v.state.next({values:Ft(i)}),v.state.next({...n,...W.keepDirty?{isDirty:se()}:{}}),!W.keepIsValid&&S()},de=({disabled:z,name:W})=>{(Kr(z)&&l.mount||z||u.disabled.has(W))&&(z?u.disabled.add(W):u.disabled.delete(W))},Re=(z,W={})=>{let oe=Ee(o,z);const ye=Kr(W.disabled)||Kr(t.disabled);return Ct(o,z,{...oe||{},_f:{...oe&&oe._f?oe._f:{ref:{name:z}},name:z,mount:!0,...W}}),u.mount.add(z),oe?de({disabled:Kr(W.disabled)?W.disabled:t.disabled,name:z}):T(z,!0,W.value),{...ye?{disabled:W.disabled||t.disabled}:{},...t.progressive?{required:!!W.required,min:Ud(W.min),max:Ud(W.max),minLength:Ud(W.minLength),maxLength:Ud(W.maxLength),pattern:Ud(W.pattern)}:{},name:z,onChange:K,onBlur:K,ref:xe=>{if(xe){Re(z,W),oe=Ee(o,z);const be=Vt(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,je=Qee(be),We=oe._f.refs||[];if(je?We.find(ft=>ft===be):be===oe._f.ref)return;Ct(o,z,{_f:{...oe._f,...je?{refs:[...We.filter(Xx),be,...Array.isArray(Ee(r,z))?[{}]:[]],ref:{type:be.type,name:z}}:{ref:be}}}),T(z,!1,void 0,be)}else oe=Ee(o,z,{}),oe._f&&(oe._f.mount=!1),(t.shouldUnregister||W.shouldUnregister)&&!(dP(u.array,z)&&l.action)&&u.unMount.add(z)}}},Le=()=>t.shouldFocusError&&kc(o,U,u.mount),Ye=z=>{Kr(z)&&(v.state.next({disabled:z}),kc(o,(W,oe)=>{const ye=Ee(o,oe);ye&&(W.disabled=ye._f.disabled||z,Array.isArray(ye._f.refs)&&ye._f.refs.forEach(xe=>{xe.disabled=ye._f.disabled||z}))},0,!1))},He=(z,W)=>async oe=>{let ye;oe&&(oe.preventDefault&&oe.preventDefault(),oe.persist&&oe.persist());let xe=Ft(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:be,values:je}=await I();n.errors=be,xe=Ft(je)}else await F(o);if(u.disabled.size)for(const be of u.disabled)dn(xe,be);if(dn(n.errors,"root"),yr(n.errors)){v.state.next({errors:{}});try{await z(xe,oe)}catch(be){ye=be}}else W&&await W({...n.errors},oe),Le(),setTimeout(Le);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:yr(n.errors)&&!ye,submitCount:n.submitCount+1,errors:n.errors}),ye)throw ye},Ht=(z,W={})=>{Ee(o,z)&&(Vt(W.defaultValue)?$(z,Ft(Ee(r,z))):($(z,W.defaultValue),Ct(r,z,Ft(W.defaultValue))),W.keepTouched||dn(n.touchedFields,z),W.keepDirty||(dn(n.dirtyFields,z),n.isDirty=W.defaultValue?se(z,Ft(Ee(r,z))):se()),W.keepError||(dn(n.errors,z),p.isValid&&S()),v.state.next({...n}))},Yt=(z,W={})=>{const oe=z?Ft(z):r,ye=Ft(oe),xe=yr(z),be=xe?r:ye;if(W.keepDefaultValues||(r=oe),!W.keepValues){if(W.keepDirtyValues){const je=new Set([...u.mount,...Object.keys(zd(r,i))]);for(const We of Array.from(je))Ee(n.dirtyFields,We)?Ct(be,We,Ee(i,We)):$(We,Ee(be,We))}else{if(nS&&Vt(z))for(const je of u.mount){const We=Ee(o,je);if(We&&We._f){const ft=Array.isArray(We._f.refs)?We._f.refs[0]:We._f.ref;if(Yp(ft)){const Rt=ft.closest("form");if(Rt){Rt.reset();break}}}}if(W.keepFieldsRef)for(const je of u.mount)$(je,Ee(be,je));else o={}}i=t.shouldUnregister?W.keepDefaultValues?Ft(r):{}:Ft(be),v.array.next({values:{...be}}),v.state.next({values:{...be}})}u={mount:W.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!p.isValid||!!W.keepIsValid||!!W.keepDirtyValues,l.watch=!!t.shouldUnregister,v.state.next({submitCount:W.keepSubmitCount?n.submitCount:0,isDirty:xe?!1:W.keepDirty?n.isDirty:!!(W.keepDefaultValues&&!Qi(z,r)),isSubmitted:W.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:xe?{}:W.keepDirtyValues?W.keepDefaultValues&&i?zd(r,i):n.dirtyFields:W.keepDefaultValues&&z?zd(r,z):W.keepDirty?n.dirtyFields:{},touchedFields:W.keepTouched?n.touchedFields:{},errors:W.keepErrors?n.errors:{},isSubmitSuccessful:W.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:r})},Kn=(z,W)=>Yt(Fo(z)?z(i):z,W),fr=(z,W={})=>{const oe=Ee(o,z),ye=oe&&oe._f;if(ye){const xe=ye.refs?ye.refs[0]:ye.ref;xe.focus&&(xe.focus(),W.shouldSelect&&Fo(xe.select)&&xe.select())}},Mt=z=>{n={...n,...z}},Pt={control:{register:Re,unregister:ue,getFieldState:H,handleSubmit:He,setError:B,_subscribe:pe,_runSchema:I,_focusError:Le,_getWatch:te,_getDirty:se,_setValid:S,_setFieldArray:E,_setDisabledField:de,_setErrors:N,_getFieldArray:ce,_reset:Yt,_resetDefaultValues:()=>Fo(t.defaultValues)&&t.defaultValues().then(z=>{Kn(z,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:Ye,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return i},get _state(){return l},set _state(z){l=z},get _defaultValues(){return r},get _names(){return u},set _names(z){u=z},get _formState(){return n},get _options(){return t},set _options(z){t={...t,...z}}},subscribe:ve,trigger:re,register:Re,handleSubmit:He,watch:Y,setValue:$,getValues:M,reset:Kn,resetField:Ht,clearErrors:le,unregister:ue,setError:B,setFocus:fr,getFieldState:H};return{...Pt,formControl:Pt}}var Ps=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Wx=(e,t,n={})=>n.shouldFocus||Vt(n.shouldFocus)?n.focusName||`${e}.${Vt(n.focusIndex)?t:n.focusIndex}.`:"",Qx=(e,t)=>[...e,...Or(t)],Jx=e=>Array.isArray(e)?e.map(()=>{}):void 0;function e_(e,t,n){return[...e.slice(0,t),...Or(n),...e.slice(t)]}var t_=(e,t,n)=>Array.isArray(e)?(Vt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],n_=(e,t)=>[...Or(t),...Or(e)];function ute(e,t){let n=0;const o=[...e];for(const r of t)o.splice(r-n,1),n++;return tv(o).length?o:[]}var r_=(e,t)=>Vt(t)?[]:ute(e,Or(t).sort((n,o)=>n-o)),o_=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},UT=(e,t,n)=>(e[t]=n,e);function _P(e){const t=Kf(),{control:n=t.control,name:o,keyName:r="id",shouldUnregister:i,rules:l}=e,[u,f]=q.useState(n._getFieldArray(o)),m=q.useRef(n._getFieldArray(o).map(Ps)),p=q.useRef(u),g=q.useRef(!1);p.current=u,n._names.array.add(o),q.useMemo(()=>l&&n.register(o,l),[n,l,o]),nv(()=>n._subjects.array.subscribe({next:({values:k,name:A})=>{if(A===o||!A){const I=Ee(k,o);Array.isArray(I)&&(f(I),m.current=I.map(Ps))}}}).unsubscribe,[n,o]);const v=q.useCallback(k=>{g.current=!0,n._setFieldArray(o,k)},[n,o]),x=(k,A)=>{const I=Or(Ft(k)),P=Qx(n._getFieldArray(o),I);n._names.focus=Wx(o,P.length-1,A),m.current=Qx(m.current,I.map(Ps)),v(P),f(P),n._setFieldArray(o,P,Qx,{argA:Jx(k)})},b=(k,A)=>{const I=Or(Ft(k)),P=n_(n._getFieldArray(o),I);n._names.focus=Wx(o,0,A),m.current=n_(m.current,I.map(Ps)),v(P),f(P),n._setFieldArray(o,P,n_,{argA:Jx(k)})},S=k=>{const A=r_(n._getFieldArray(o),k);m.current=r_(m.current,k),v(A),f(A),!Array.isArray(Ee(n._fields,o))&&Ct(n._fields,o,void 0),n._setFieldArray(o,A,r_,{argA:k})},C=(k,A,I)=>{const P=Or(Ft(A)),F=e_(n._getFieldArray(o),k,P);n._names.focus=Wx(o,k,I),m.current=e_(m.current,k,P.map(Ps)),v(F),f(F),n._setFieldArray(o,F,e_,{argA:k,argB:Jx(A)})},E=(k,A)=>{const I=n._getFieldArray(o);o_(I,k,A),o_(m.current,k,A),v(I),f(I),n._setFieldArray(o,I,o_,{argA:k,argB:A},!1)},j=(k,A)=>{const I=n._getFieldArray(o);t_(I,k,A),t_(m.current,k,A),v(I),f(I),n._setFieldArray(o,I,t_,{argA:k,argB:A},!1)},N=(k,A)=>{const I=Ft(A),P=UT(n._getFieldArray(o),k,I);m.current=[...P].map((F,L)=>!F||L===k?Ps():m.current[L]),v(P),f([...P]),n._setFieldArray(o,P,UT,{argA:k,argB:I},!0,!1)},T=k=>{const A=Or(Ft(k));m.current=A.map(Ps),v([...A]),f([...A]),n._setFieldArray(o,[...A],I=>I,{},!0,!1)};return q.useEffect(()=>{if(n._state.action=!1,ww(o,n._names)&&n._subjects.state.next({...n._formState}),g.current&&(!wc(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!wc(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([o]).then(k=>{const A=Ee(k.errors,o),I=Ee(n._formState.errors,o);(I?!A&&I.type||A&&(I.type!==A.type||I.message!==A.message):A&&A.type)&&(A?Ct(n._formState.errors,o,A):dn(n._formState.errors,o),n._subjects.state.next({errors:n._formState.errors}))});else{const k=Ee(n._fields,o);k&&k._f&&!(wc(n._options.reValidateMode).isOnSubmit&&wc(n._options.mode).isOnSubmit)&&Sw(k,n._names.disabled,n._formValues,n._options.criteriaMode===wo.all,n._options.shouldUseNativeValidation,!0).then(A=>!yr(A)&&n._subjects.state.next({errors:xP(n._formState.errors,A,o)}))}n._subjects.state.next({name:o,values:Ft(n._formValues)}),n._names.focus&&kc(n._fields,(k,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&k.focus)return k.focus(),1}),n._names.focus="",n._setValid(),g.current=!1},[u,o,n]),q.useEffect(()=>(!Ee(n._formValues,o)&&n._setFieldArray(o),()=>{const k=(A,I)=>{const P=Ee(n._fields,A);P&&P._f&&(P._f.mount=I)};n._options.shouldUnregister||i?n.unregister(o):k(o,!1)}),[o,n,r,i]),{swap:q.useCallback(E,[v,o,n]),move:q.useCallback(j,[v,o,n]),prepend:q.useCallback(b,[v,o,n]),append:q.useCallback(x,[v,o,n]),remove:q.useCallback(S,[v,o,n]),insert:q.useCallback(C,[v,o,n]),update:q.useCallback(N,[v,o,n]),replace:q.useCallback(T,[v,o,n]),fields:q.useMemo(()=>u.map((k,A)=>({...k,[r]:m.current[A]||Ps()})),[u,r])}}function vn(e={}){const t=q.useRef(void 0),n=q.useRef(void 0),[o,r]=q.useState({isDirty:!1,isValidating:!1,isLoading:Fo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Fo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Fo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...u}=cte(e);t.current={...u,formState:o}}const i=t.current.control;return i._options=e,nv(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>r({...i._formState}),reRenderRoot:!0});return r(u=>({...u,isReady:!0})),i._formState.isReady=!0,l},[i]),q.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),q.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),q.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),q.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),q.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==o.isDirty&&i._subjects.state.next({isDirty:l})}},[i,o.isDirty]),q.useEffect(()=>{e.values&&!Qi(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,r(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),q.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=fP(o,i),t.current}const yn=Zee,wP=_.createContext({}),SP=_.createContext({});function cS(){const e=_.useContext(wP),t=_.useContext(SP),{getFieldState:n}=Kf(),o=iS({name:e.name}),r=n(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...r}}function Me({...e}){const{error:t,formItemId:n,formDescriptionId:o,formMessageId:r}=cS();return c.jsx(o0,{"data-slot":"form-control",id:n,"aria-describedby":t?`${o} ${r}`:`${o}`,"aria-invalid":!!t,...e})}function Pe({...e}){return c.jsx(wP,{value:{name:e.name},children:c.jsx(Wee,{...e})})}function Oe({className:e,...t}){const n=_.useId();return c.jsx(SP,{value:{id:n},children:c.jsx("div",{"data-slot":"form-item",className:$e("grid gap-2",e),...t})})}var dte="Label",CP=_.forwardRef((e,t)=>c.jsx(Ue.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));CP.displayName=dte;var fte=CP;function uS({className:e,...t}){return c.jsx(fte,{"data-slot":"label",className:$e("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Ae({className:e,...t}){const{error:n,formItemId:o}=cS();return c.jsx(uS,{"data-slot":"form-label","data-error":!!n,className:$e("data-[error=true]:text-destructive",e),htmlFor:o,...t})}function Ie({className:e,...t}){const{error:n,formMessageId:o}=cS(),r=n?String(n?.message):t.children;return r?c.jsx("p",{"data-slot":"form-message",id:o,className:$e("text-destructive text-sm",e),...t,children:r}):null}function Fe({className:e,type:t,...n}){return c.jsx("input",{type:t,"data-slot":"input",className:$e(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
|
|
294
294
|
selection:text-primary-foreground
|
|
295
295
|
dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
|
|
296
296
|
dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
|
|
@@ -418,7 +418,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
418
418
|
focus-visible:ring-1
|
|
419
419
|
focus-visible:outline-1
|
|
420
420
|
focus-visible:ring-purple-200
|
|
421
|
-
aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var W6="Toggle",Q6=_.forwardRef((e,t)=>{const{pressed:n,defaultPressed:o,onPressedChange:r,...i}=e,[l,u]=Ei({prop:n,onChange:r,defaultProp:o??!1,caller:W6});return c.jsx(Ue.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Se(e.onClick,()=>{e.disabled||u(!l)})})});Q6.displayName=W6;var Uye=Q6;function Lye({className:e,variant:t,size:n,...o}){return c.jsx(Uye,{"data-slot":"toggle",className:$e(zye({variant:t,size:n,className:e})),...o})}const I_={limit:"100",level:"undefined",from:"",until:""},Fye=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return c.jsx(Xo,{variant:Y6(t),children:hl(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=X6(t);return c.jsx(c.Fragment,{children:t?c.jsxs(fL,{children:[c.jsx(mL,{asChild:!0,children:c.jsxs(Xo,{variant:n,children:[t.split(".")[0],"..."]})}),c.jsx(hL,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:t})]}):null})}},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:({row:e})=>{const{message:t}=e.original;return e.getIsSelected(),c.jsx("pre",{children:c.jsx("code",{children:t})})}}],Vye=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),o=new Date(t);return n<=o};function Bye(){const[e,t]=_.useState(I_),[n,o]=_.useState(!1),[r,i]=_.useState(),[l,u]=_.useState(!1),f=dr(),{data:m,isLoading:p,refetch:g,isFetching:v}=Jt(Mye({logFilters:e,...f,replicated:f.entityType==="cluster",isAutoRefreshEnabled:l})),x=vn({resolver:bn(Pye),defaultValues:I_,mode:"onChange"}),b=j=>{i(j.original),o(!0)},S=async j=>{if(!Vye(j.from,j.until)){x.setError("from",{type:"onChange",message:"Start date must be before end date"}),x.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(j)},C=async()=>{x.reset(),t(I_)},E=vl(g);return c.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[c.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3",children:[c.jsx("h2",{className:"pb-6 text-2xl",children:"Log Filters"}),c.jsx(Dye,{form:x,resetFilters:C,submitFilters:S})]}),c.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?c.jsx("div",{children:"Loading..."}):c.jsxs("div",{className:"h-32",children:[c.jsxs("div",{className:"flex items-center justify-between md:justify-normal md:space-x-2",children:[c.jsx(_e,{variant:"defaultOutline",onClick:E,disabled:v||p||l,children:c.jsx(rs,{})}),c.jsxs(Lye,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:u,children:[c.jsx(rs,{}),"Auto Refresh ",l?"On":"Off"]})]}),c.jsx(Aye,{columns:Fye,data:m||[],onRowClick:b})]})}),c.jsx($ye,{isModalOpen:n,setIsModalOpen:o,data:r})]})}function Hye(e){return et({getParentRoute:()=>e,path:"logs",component:Bye})}const Gye=new Date(2025,0).getTime(),qye=1440*60*1e3;function Kye(e){const t=[];for(const n in e){const o=e[n];t.push(...e0(n,o,0))}return t}function Zye(e){return!!e.title}function e0(e,t,n,o){if(t&&Array.isArray(t)){const r=t;return[r.length>1&&{title:e,depth:n},...t.map((i,l)=>e0(r.length>1?String(l+1):e,i,n+1,e)).flat(1)].filter(al)}if(Yye(t)){const r=t;return[{title:e,depth:n},...Object.keys(t).map(i=>e0(String(i),r[i],n+1,e)).flat(1)]}if((e==="__updatedtime__"||e==="__createdtime__")&&(e=e.replace(/_/g,"").replace("time","")),typeof t=="number")if(t>Gye&&t<Date.now()+qye){const r=Date.now()-t;t=qs(r,t)}else o==="memory"?t=mi(t):!e.startsWith("raw")&&e.toLowerCase().includes("load")&&(t=Math.round(t*10)/10+"%");else typeof t=="boolean"&&(t=t?"Yes":"No");return[{name:e,value:String(t),depth:n}]}function Yye(e){return!!e&&typeof e=="object"}function Xye({data:e}){const t=_.useMemo(()=>Kye(e),[e]);return c.jsx("div",{className:"max-w-96 grid mb-12",children:t.map((n,o)=>Zye(n)?c.jsx("div",{className:$e("font-semibold text-xl",o!==0&&"mt-4"),style:{paddingLeft:n.depth*12+"px"},children:n.title},o):c.jsx(c.Fragment,{children:c.jsxs("div",{style:{paddingLeft:n.depth*12+"px"},children:[c.jsxs("span",{className:"text-muted-foreground",children:[n.name,": "]}),n.value]},o)}))})}function Wye({entityId:e,instanceClient:t}){return{queryKey:[e,"system_information"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"system_information",attributes:["network","disk","cpu","memory","system"]});return n}}}function Qye(){const e=dr(),{data:t}=lr(Wye(e));return c.jsx(_.Suspense,{fallback:c.jsx(So,{}),children:c.jsx(Xye,{data:t})})}function Jye(){return c.jsx(Qye,{})}function ebe(e){return et({getParentRoute:()=>e,path:"status",component:Jye})}function tbe(e){const t=Oye(),n=[Hye(t),...mde(t),ebe(t),Cme(t),Ahe(t)];return t.addChildren(n)}et({getParentRoute:()=>wv,path:"profile",component:P8(async()=>q0(()=>import("./index-
|
|
421
|
+
aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var W6="Toggle",Q6=_.forwardRef((e,t)=>{const{pressed:n,defaultPressed:o,onPressedChange:r,...i}=e,[l,u]=Ei({prop:n,onChange:r,defaultProp:o??!1,caller:W6});return c.jsx(Ue.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Se(e.onClick,()=>{e.disabled||u(!l)})})});Q6.displayName=W6;var Uye=Q6;function Lye({className:e,variant:t,size:n,...o}){return c.jsx(Uye,{"data-slot":"toggle",className:$e(zye({variant:t,size:n,className:e})),...o})}const I_={limit:"100",level:"undefined",from:"",until:""},Fye=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return c.jsx(Xo,{variant:Y6(t),children:hl(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=X6(t);return c.jsx(c.Fragment,{children:t?c.jsxs(fL,{children:[c.jsx(mL,{asChild:!0,children:c.jsxs(Xo,{variant:n,children:[t.split(".")[0],"..."]})}),c.jsx(hL,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:t})]}):null})}},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:({row:e})=>{const{message:t}=e.original;return e.getIsSelected(),c.jsx("pre",{children:c.jsx("code",{children:t})})}}],Vye=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),o=new Date(t);return n<=o};function Bye(){const[e,t]=_.useState(I_),[n,o]=_.useState(!1),[r,i]=_.useState(),[l,u]=_.useState(!1),f=dr(),{data:m,isLoading:p,refetch:g,isFetching:v}=Jt(Mye({logFilters:e,...f,replicated:f.entityType==="cluster",isAutoRefreshEnabled:l})),x=vn({resolver:bn(Pye),defaultValues:I_,mode:"onChange"}),b=j=>{i(j.original),o(!0)},S=async j=>{if(!Vye(j.from,j.until)){x.setError("from",{type:"onChange",message:"Start date must be before end date"}),x.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(j)},C=async()=>{x.reset(),t(I_)},E=vl(g);return c.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[c.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3",children:[c.jsx("h2",{className:"pb-6 text-2xl",children:"Log Filters"}),c.jsx(Dye,{form:x,resetFilters:C,submitFilters:S})]}),c.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?c.jsx("div",{children:"Loading..."}):c.jsxs("div",{className:"h-32",children:[c.jsxs("div",{className:"flex items-center justify-between md:justify-normal md:space-x-2",children:[c.jsx(_e,{variant:"defaultOutline",onClick:E,disabled:v||p||l,children:c.jsx(rs,{})}),c.jsxs(Lye,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:u,children:[c.jsx(rs,{}),"Auto Refresh ",l?"On":"Off"]})]}),c.jsx(Aye,{columns:Fye,data:m||[],onRowClick:b})]})}),c.jsx($ye,{isModalOpen:n,setIsModalOpen:o,data:r})]})}function Hye(e){return et({getParentRoute:()=>e,path:"logs",component:Bye})}const Gye=new Date(2025,0).getTime(),qye=1440*60*1e3;function Kye(e){const t=[];for(const n in e){const o=e[n];t.push(...e0(n,o,0))}return t}function Zye(e){return!!e.title}function e0(e,t,n,o){if(t&&Array.isArray(t)){const r=t;return[r.length>1&&{title:e,depth:n},...t.map((i,l)=>e0(r.length>1?String(l+1):e,i,n+1,e)).flat(1)].filter(al)}if(Yye(t)){const r=t;return[{title:e,depth:n},...Object.keys(t).map(i=>e0(String(i),r[i],n+1,e)).flat(1)]}if((e==="__updatedtime__"||e==="__createdtime__")&&(e=e.replace(/_/g,"").replace("time","")),typeof t=="number")if(t>Gye&&t<Date.now()+qye){const r=Date.now()-t;t=qs(r,t)}else o==="memory"?t=mi(t):!e.startsWith("raw")&&e.toLowerCase().includes("load")&&(t=Math.round(t*10)/10+"%");else typeof t=="boolean"&&(t=t?"Yes":"No");return[{name:e,value:String(t),depth:n}]}function Yye(e){return!!e&&typeof e=="object"}function Xye({data:e}){const t=_.useMemo(()=>Kye(e),[e]);return c.jsx("div",{className:"max-w-96 grid mb-12",children:t.map((n,o)=>Zye(n)?c.jsx("div",{className:$e("font-semibold text-xl",o!==0&&"mt-4"),style:{paddingLeft:n.depth*12+"px"},children:n.title},o):c.jsx(c.Fragment,{children:c.jsxs("div",{style:{paddingLeft:n.depth*12+"px"},children:[c.jsxs("span",{className:"text-muted-foreground",children:[n.name,": "]}),n.value]},o)}))})}function Wye({entityId:e,instanceClient:t}){return{queryKey:[e,"system_information"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"system_information",attributes:["network","disk","cpu","memory","system"]});return n}}}function Qye(){const e=dr(),{data:t}=lr(Wye(e));return c.jsx(_.Suspense,{fallback:c.jsx(So,{}),children:c.jsx(Xye,{data:t})})}function Jye(){return c.jsx(Qye,{})}function ebe(e){return et({getParentRoute:()=>e,path:"status",component:Jye})}function tbe(e){const t=Oye(),n=[Hye(t),...mde(t),ebe(t),Cme(t),Ahe(t)];return t.addChildren(n)}et({getParentRoute:()=>wv,path:"profile",component:P8(async()=>q0(()=>import("./index-C4VX60Fd.js"),[]),"ProfileIndex")});const nbe=Qg.addChildren([...bse,wv.addChildren([tbe()])]);function rbe(){const e=X8(),t=d9(),n=G8({routeTree:nbe,history:t,defaultNotFoundComponent:cq,defaultErrorComponent:C0,defaultPreload:uq()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:cf,authentication:e}});return c.jsxs(c.Fragment,{children:[c.jsx(Z8,{router:n,context:{authentication:e}}),!1]})}const obe=({...e})=>c.jsx(Dq,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});var ibe=function(){return null};function sbe(){return Wie(),VJ(),c.jsxs(c.Fragment,{children:[c.jsxs(qH,{client:cf,children:[c.jsx(rbe,{}),c.jsx(ibe,{buttonPosition:"bottom-right"})]}),c.jsx(obe,{richColors:!0})]})}var $_={exports:{}},Hd={},M_={exports:{}},P_={};/**
|
|
422
422
|
* @license React
|
|
423
423
|
* scheduler.production.js
|
|
424
424
|
*
|