harperdb 4.7.0-beta.6 → 4.7.0-beta.7

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.
@@ -316,7 +316,7 @@ function kB(e,t){for(var n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&
316
316
  *
317
317
  * This source code is licensed under the ISC license.
318
318
  * See the LICENSE file in the root directory of this source tree.
319
- */const qG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],a$=Xe("x",qG);function Lw({className:e,error:t,title:n,showReturnToHome:o}){const{user:r,isLoading:i}=hl();return xu(r),c.jsxs(Lf,{className:Pe("text-red p-5 border border-red rounded-md m-12 mt-36",e),children:[c.jsxs(Wg,{children:[c.jsx(Xg,{className:"text-2xl",children:c.jsx("h2",{children:n??"Component Error"})}),c.jsx(Pw,{children:t.message})]}),o!==!1&&c.jsx(Ff,{children:r&&!i?c.jsx(Ke,{to:ca,children:c.jsxs(_e,{children:[" ",c.jsx(nl,{})," Return to Home"]})}):c.jsx(Ke,{to:"/sign-in",children:c.jsxs(_e,{children:[" ",c.jsx(nl,{})," Go to Sign In Page"]})})})]})}function GG(){const{user:e,isLoading:t}=hl();return xu(e),c.jsx("div",{className:"flex items-center justify-center h-screen px-3",children:c.jsxs(Lf,{className:"text-red p-5 border border-red rounded-md w-full max-w-md",children:[c.jsx(Wg,{children:c.jsx(Xg,{className:"text-2xl",children:c.jsx("h2",{children:"Sorry, Page Not Found"})})}),c.jsx(Ff,{children:e&&!t?c.jsx(Ke,{to:ca,children:c.jsxs(_e,{children:[" ",c.jsx(nl,{})," Return to Home"]})}):c.jsx(Ke,{to:"/sign-in",children:c.jsxs(_e,{children:[" ",c.jsx(nl,{})," Go Sign In Page"]})})})]})})}function KG(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function ZG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const YG=e=>{switch(e){case"success":return QG;case"info":return e7;case"warning":return JG;case"error":return t7;default:return null}},WG=Array(12).fill(0),XG=({visible:e,className:t})=>q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},q.createElement("div",{className:"sonner-spinner"},WG.map((n,o)=>q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),QG=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),JG=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e7=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t7=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n7=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r7=()=>{const[e,t]=q.useState(document.hidden);return q.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let pS=1;class o7{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:o,...r}=t,i=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:pS++,a=this.toasts.find(f=>f.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(f=>f.id===i?(this.publish({...f,...t,id:i,title:o}),{...f,...t,id:i,dismissible:u,title:o}):f):this.addToast({title:o,...r,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let i=o!==void 0,a;const u=r.then(async m=>{if(a=["resolve",m],q.isValidElement(m))i=!1,this.create({id:o,type:"default",message:m});else if(s7(m)&&!m.ok){i=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${m.status}`):n.description,x=typeof g=="object"&&!q.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:v,...x})}else if(m instanceof Error){i=!1;const g=typeof n.error=="function"?await n.error(m):n.error,v=typeof n.description=="function"?await n.description(m):n.description,x=typeof g=="object"&&!q.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:v,...x})}else if(n.success!==void 0){i=!1;const g=typeof n.success=="function"?await n.success(m):n.success,v=typeof n.description=="function"?await n.description(m):n.description,x=typeof g=="object"&&!q.isValidElement(g)?g:{message:g};this.create({id:o,type:"success",description:v,...x})}}).catch(async m=>{if(a=["reject",m],n.error!==void 0){i=!1;const p=typeof n.error=="function"?await n.error(m):n.error,g=typeof n.description=="function"?await n.description(m):n.description,b=typeof p=="object"&&!q.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:g,...b})}}).finally(()=>{i&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((m,p)=>u.then(()=>a[0]==="reject"?p(a[1]):m(a[1])).catch(p));return typeof o!="string"&&typeof o!="number"?{unwrap:f}:Object.assign(o,{unwrap:f})},this.custom=(t,n)=>{const o=n?.id||pS++;return this.create({jsx:t(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Dr=new o7,i7=(e,t)=>{const n=t?.id||pS++;return Dr.addToast({title:e,...t,id:n}),n},s7=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",a7=i7,l7=()=>Dr.toasts,c7=()=>Dr.getActiveToasts(),Se=Object.assign(a7,{success:Dr.success,info:Dr.info,warning:Dr.warning,error:Dr.error,custom:Dr.custom,message:Dr.message,promise:Dr.promise,dismiss:Dr.dismiss,loading:Dr.loading},{getHistory:l7,getToasts:c7});ZG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Wh(e){return e.label!==void 0}const u7=3,d7="24px",f7="16px",Wk=4e3,m7=356,h7=14,p7=45,g7=200;function pi(...e){return e.filter(Boolean).join(" ")}function v7(e){const[t,n]=e.split("-"),o=[];return t&&o.push(t),n&&o.push(n),o}const y7=e=>{var t,n,o,r,i,a,u,f,m;const{invert:p,toast:g,unstyled:v,interacting:b,setHeights:x,visibleToasts:w,heights:C,index:E,toasts:j,expanded:N,removeToast:O,defaultRichColors:k,closeButton:T,style:A,cancelButtonStyle:$,actionButtonStyle:L,className:G="",descriptionClassName:ae="",duration:re,position:se,gap:ue,expandByDefault:oe,classNames:P,icons:Z,closeButtonAriaLabel:U="Close toast"}=e,[ie,M]=q.useState(null),[V,le]=q.useState(null),[X,H]=q.useState(!1),[fe,me]=q.useState(!1),[ce,pe]=q.useState(!1),[Ne,Re]=q.useState(!1),[Fe,Be]=q.useState(!1),[qt,nn]=q.useState(0),[pr,tr]=q.useState(0),Mt=q.useRef(g.duration||re||Wk),$i=q.useRef(null),rn=q.useRef(null),z=E===0,W=E+1<=w,te=g.type,ve=g.dismissible!==!1,xe=g.className||"",be=g.descriptionClassName||"",je=q.useMemo(()=>C.findIndex(Je=>Je.toastId===g.id)||0,[C,g.id]),Ye=q.useMemo(()=>{var Je;return(Je=g.closeButton)!=null?Je:T},[g.closeButton,T]),ct=q.useMemo(()=>g.duration||re||Wk,[g.duration,re]),St=q.useRef(0),gr=q.useRef(0),vr=q.useRef(0),vo=q.useRef(null),[yo,Or]=se.split("-"),Ar=q.useMemo(()=>C.reduce((Je,dn,xn)=>xn>=je?Je:Je+dn.height,0),[C,je]),Hr=r7(),Ho=g.invert||p,qo=te==="loading";gr.current=q.useMemo(()=>je*ue+Ar,[je,Ar]),q.useEffect(()=>{Mt.current=ct},[ct]),q.useEffect(()=>{H(!0)},[]),q.useEffect(()=>{const Je=rn.current;if(Je){const dn=Je.getBoundingClientRect().height;return tr(dn),x(xn=>[{toastId:g.id,height:dn,position:g.position},...xn]),()=>x(xn=>xn.filter(Xn=>Xn.toastId!==g.id))}},[x,g.id]),q.useLayoutEffect(()=>{if(!X)return;const Je=rn.current,dn=Je.style.height;Je.style.height="auto";const xn=Je.getBoundingClientRect().height;Je.style.height=dn,tr(xn),x(Xn=>Xn.find(Tn=>Tn.toastId===g.id)?Xn.map(Tn=>Tn.toastId===g.id?{...Tn,height:xn}:Tn):[{toastId:g.id,height:xn,position:g.position},...Xn])},[X,g.title,g.description,x,g.id,g.jsx,g.action,g.cancel]);const qr=q.useCallback(()=>{me(!0),nn(gr.current),x(Je=>Je.filter(dn=>dn.toastId!==g.id)),setTimeout(()=>{O(g)},g7)},[g,O,x,gr]);q.useEffect(()=>{if(g.promise&&te==="loading"||g.duration===1/0||g.type==="loading")return;let Je;return N||b||Hr?(()=>{if(vr.current<St.current){const Xn=new Date().getTime()-St.current;Mt.current=Mt.current-Xn}vr.current=new Date().getTime()})():(()=>{Mt.current!==1/0&&(St.current=new Date().getTime(),Je=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),qr()},Mt.current))})(),()=>clearTimeout(Je)},[N,b,g,te,Hr,qr]),q.useEffect(()=>{g.delete&&(qr(),g.onDismiss==null||g.onDismiss.call(g,g))},[qr,g.delete]);function Gt(){var Je;if(Z?.loading){var dn;return q.createElement("div",{className:pi(P?.loader,g==null||(dn=g.classNames)==null?void 0:dn.loader,"sonner-loader"),"data-visible":te==="loading"},Z.loading)}return q.createElement(XG,{className:pi(P?.loader,g==null||(Je=g.classNames)==null?void 0:Je.loader),visible:te==="loading"})}const nr=g.icon||Z?.[te]||YG(te);var li,Nm;return q.createElement("li",{tabIndex:0,ref:rn,className:pi(G,xe,P?.toast,g==null||(t=g.classNames)==null?void 0:t.toast,P?.default,P?.[te],g==null||(n=g.classNames)==null?void 0:n[te]),"data-sonner-toast":"","data-rich-colors":(li=g.richColors)!=null?li:k,"data-styled":!(g.jsx||g.unstyled||v),"data-mounted":X,"data-promise":!!g.promise,"data-swiped":Fe,"data-removed":fe,"data-visible":W,"data-y-position":yo,"data-x-position":Or,"data-index":E,"data-front":z,"data-swiping":ce,"data-dismissible":ve,"data-type":te,"data-invert":Ho,"data-swipe-out":Ne,"data-swipe-direction":V,"data-expanded":!!(N||oe&&X),"data-testid":g.testId,style:{"--index":E,"--toasts-before":E,"--z-index":j.length-E,"--offset":`${fe?qt:gr.current}px`,"--initial-height":oe?"auto":`${pr}px`,...A,...g.style},onDragEnd:()=>{pe(!1),M(null),vo.current=null},onPointerDown:Je=>{Je.button!==2&&(qo||!ve||($i.current=new Date,nn(gr.current),Je.target.setPointerCapture(Je.pointerId),Je.target.tagName!=="BUTTON"&&(pe(!0),vo.current={x:Je.clientX,y:Je.clientY})))},onPointerUp:()=>{var Je,dn,xn;if(Ne||!ve)return;vo.current=null;const Xn=Number(((Je=rn.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ha=Number(((dn=rn.current)==null?void 0:dn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Tn=new Date().getTime()-((xn=$i.current)==null?void 0:xn.getTime()),fn=ie==="x"?Xn:ha,mn=Math.abs(fn)/Tn;if(Math.abs(fn)>=p7||mn>.11){nn(gr.current),g.onDismiss==null||g.onDismiss.call(g,g),le(ie==="x"?Xn>0?"right":"left":ha>0?"down":"up"),qr(),Re(!0);return}else{var Pt,Ln;(Pt=rn.current)==null||Pt.style.setProperty("--swipe-amount-x","0px"),(Ln=rn.current)==null||Ln.style.setProperty("--swipe-amount-y","0px")}Be(!1),pe(!1),M(null)},onPointerMove:Je=>{var dn,xn,Xn;if(!vo.current||!ve||((dn=window.getSelection())==null?void 0:dn.toString().length)>0)return;const Tn=Je.clientY-vo.current.y,fn=Je.clientX-vo.current.x;var mn;const Pt=(mn=e.swipeDirections)!=null?mn:v7(se);!ie&&(Math.abs(fn)>1||Math.abs(Tn)>1)&&M(Math.abs(fn)>Math.abs(Tn)?"x":"y");let Ln={x:0,y:0};const Tl=Mi=>1/(1.5+Math.abs(Mi)/20);if(ie==="y"){if(Pt.includes("top")||Pt.includes("bottom"))if(Pt.includes("top")&&Tn<0||Pt.includes("bottom")&&Tn>0)Ln.y=Tn;else{const Mi=Tn*Tl(Tn);Ln.y=Math.abs(Mi)<Math.abs(Tn)?Mi:Tn}}else if(ie==="x"&&(Pt.includes("left")||Pt.includes("right")))if(Pt.includes("left")&&fn<0||Pt.includes("right")&&fn>0)Ln.x=fn;else{const Mi=fn*Tl(fn);Ln.x=Math.abs(Mi)<Math.abs(fn)?Mi:fn}(Math.abs(Ln.x)>0||Math.abs(Ln.y)>0)&&Be(!0),(xn=rn.current)==null||xn.style.setProperty("--swipe-amount-x",`${Ln.x}px`),(Xn=rn.current)==null||Xn.style.setProperty("--swipe-amount-y",`${Ln.y}px`)}},Ye&&!g.jsx&&te!=="loading"?q.createElement("button",{"aria-label":U,"data-disabled":qo,"data-close-button":!0,onClick:qo||!ve?()=>{}:()=>{qr(),g.onDismiss==null||g.onDismiss.call(g,g)},className:pi(P?.closeButton,g==null||(o=g.classNames)==null?void 0:o.closeButton)},(Nm=Z?.close)!=null?Nm:n7):null,(te||g.icon||g.promise)&&g.icon!==null&&(Z?.[te]!==null||g.icon)?q.createElement("div",{"data-icon":"",className:pi(P?.icon,g==null||(r=g.classNames)==null?void 0:r.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Gt():null,g.type!=="loading"?nr:null):null,q.createElement("div",{"data-content":"",className:pi(P?.content,g==null||(i=g.classNames)==null?void 0:i.content)},q.createElement("div",{"data-title":"",className:pi(P?.title,g==null||(a=g.classNames)==null?void 0:a.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?q.createElement("div",{"data-description":"",className:pi(ae,be,P?.description,g==null||(u=g.classNames)==null?void 0:u.description)},typeof g.description=="function"?g.description():g.description):null),q.isValidElement(g.cancel)?g.cancel:g.cancel&&Wh(g.cancel)?q.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||$,onClick:Je=>{Wh(g.cancel)&&ve&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Je),qr())},className:pi(P?.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,q.isValidElement(g.action)?g.action:g.action&&Wh(g.action)?q.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||L,onClick:Je=>{Wh(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Je),!Je.defaultPrevented&&qr())},className:pi(P?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function Xk(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function b7(e,t){const n={};return[e,t].forEach((o,r)=>{const i=r===1,a=i?"--mobile-offset":"--offset",u=i?f7:d7;function f(m){["top","right","bottom","left"].forEach(p=>{n[`${a}-${p}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?f(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?n[`${a}-${m}`]=u:n[`${a}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):f(u)}),n}const x7=q.forwardRef(function(t,n){const{id:o,invert:r,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:f,className:m,offset:p,mobileOffset:g,theme:v="light",richColors:b,duration:x,style:w,visibleToasts:C=u7,toastOptions:E,dir:j=Xk(),gap:N=h7,icons:O,containerAriaLabel:k="Notifications"}=t,[T,A]=q.useState([]),$=q.useMemo(()=>o?T.filter(X=>X.toasterId===o):T.filter(X=>!X.toasterId),[T,o]),L=q.useMemo(()=>Array.from(new Set([i].concat($.filter(X=>X.position).map(X=>X.position)))),[$,i]),[G,ae]=q.useState([]),[re,se]=q.useState(!1),[ue,oe]=q.useState(!1),[P,Z]=q.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=q.useRef(null),ie=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=q.useRef(null),V=q.useRef(!1),le=q.useCallback(X=>{A(H=>{var fe;return(fe=H.find(me=>me.id===X.id))!=null&&fe.delete||Dr.dismiss(X.id),H.filter(({id:me})=>me!==X.id)})},[]);return q.useEffect(()=>Dr.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{A(H=>H.map(fe=>fe.id===X.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{Ow.flushSync(()=>{A(H=>{const fe=H.findIndex(me=>me.id===X.id);return fe!==-1?[...H.slice(0,fe),{...H[fe],...X},...H.slice(fe+1)]:[X,...H]})})})}),[T]),q.useEffect(()=>{if(v!=="system"){Z(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:H})=>{Z(H?"dark":"light")})}catch{X.addListener(({matches:fe})=>{try{Z(fe?"dark":"light")}catch(me){console.error(me)}})}},[v]),q.useEffect(()=>{T.length<=1&&se(!1)},[T]),q.useEffect(()=>{const X=H=>{var fe;if(a.every(pe=>H[pe]||H.code===pe)){var ce;se(!0),(ce=U.current)==null||ce.focus()}H.code==="Escape"&&(document.activeElement===U.current||(fe=U.current)!=null&&fe.contains(document.activeElement))&&se(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[a]),q.useEffect(()=>{if(U.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,V.current=!1)}},[U.current]),q.createElement("section",{ref:n,"aria-label":`${k} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((X,H)=>{var fe;const[me,ce]=X.split("-");return $.length?q.createElement("ol",{key:X,dir:j==="auto"?Xk():j,tabIndex:-1,ref:U,className:m,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":me,"data-x-position":ce,style:{"--front-toast-height":`${((fe=G[0])==null?void 0:fe.height)||0}px`,"--width":`${m7}px`,"--gap":`${N}px`,...w,...b7(p,g)},onBlur:pe=>{V.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(V.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||V.current||(V.current=!0,M.current=pe.relatedTarget)},onMouseEnter:()=>se(!0),onMouseMove:()=>se(!0),onMouseLeave:()=>{ue||se(!1)},onDragEnd:()=>se(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||oe(!0)},onPointerUp:()=>oe(!1)},$.filter(pe=>!pe.position&&H===0||pe.position===X).map((pe,Ne)=>{var Re,Fe;return q.createElement(y7,{key:pe.id,icons:O,index:Ne,toast:pe,defaultRichColors:b,duration:(Re=E?.duration)!=null?Re:x,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:r,visibleToasts:C,closeButton:(Fe=E?.closeButton)!=null?Fe:f,interacting:ue,position:X,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:le,toasts:$.filter(Be=>Be.position==pe.position),heights:G.filter(Be=>Be.position==pe.position),setHeights:ae,expandByDefault:u,gap:N,expanded:re,swipeDirections:t.swipeDirections})})):null}))});function Qk(e){let t="Error",n="We had some trouble!";console.error(e);const o=e,r=e;if(typeof e=="string"?n=e:o?.response?.data?typeof o.response.data=="string"?n=o.response.data:o.response.data.error?n=o.response.data.error:o.response.data.message&&(n=o.response.data.message):r?.message&&(n=r.message),n.includes(":")){const i=n.split(":");t=i.shift(),n=i.join(":")}Se.error(t,{description:n,action:{label:"Dismiss",onClick:()=>Se.dismiss()}})}const gf=new kH({queryCache:new dI({onError:Qk}),mutationCache:new uI({onError:Qk})});function _7(e,t){const n=_.createContext(t),o=i=>{const{children:a,...u}=i,f=_.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:f,children:a})};o.displayName=e+"Provider";function r(i){const a=_.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function si(e,t=[]){let n=[];function o(i,a){const u=_.createContext(a),f=n.length;n=[...n,a];const m=g=>{const{scope:v,children:b,...x}=g,w=v?.[e]?.[f]||u,C=_.useMemo(()=>x,Object.values(x));return c.jsx(w.Provider,{value:C,children:b})};m.displayName=i+"Provider";function p(g,v){const b=v?.[e]?.[f]||u,x=_.useContext(b);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,p]}const r=()=>{const i=n.map(a=>_.createContext(a));return function(u){const f=u?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return r.scopeName=e,[o,S7(r,...t)]}function S7(...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 a=o.reduce((u,{useScope:f,scopeName:m})=>{const g=f(i)[`__scope${m}`];return{...u,...g}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var w7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=w7.reduce((e,t)=>{const n=tl(`Primitive.${t}`),o=_.forwardRef((r,i)=>{const{asChild:a,...u}=r,f=a?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 eg(e,t){e&&gu.flushSync(()=>e.dispatchEvent(t))}var Rn=globalThis?.document?_.useLayoutEffect:()=>{},C7=fI[" useInsertionEffect ".trim().toString()]||Rn;function Ri({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,a]=E7({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=R7(p)?p(e):p;g!==e&&a.current?.(g)}else i(p)},[u,e,i,a]);return[f,m]}function E7({defaultProp:e,onChange:t}){const[n,o]=_.useState(e),r=_.useRef(n),i=_.useRef(t);return C7(()=>{i.current=t},[t]),_.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function R7(e){return typeof e=="function"}var j7=_.createContext(void 0);function _u(e){const t=_.useContext(j7);return e||t||"ltr"}function N7(e,t){return _.useReducer((n,o)=>t[n][o]??n,e)}var Dn=e=>{const{present:t,children:n}=e,o=k7(t),r=typeof n=="function"?n({present:o.isPresent}):_.Children.only(n),i=ut(o.ref,T7(r));return typeof n=="function"||o.isPresent?_.cloneElement(r,{ref:i}):null};Dn.displayName="Presence";function k7(e){const[t,n]=_.useState(),o=_.useRef(null),r=_.useRef(e),i=_.useRef("none"),a=e?"mounted":"unmounted",[u,f]=N7(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const m=Xh(o.current);i.current=u==="mounted"?m:"none"},[u]),Rn(()=>{const m=o.current,p=r.current;if(p!==e){const v=i.current,b=Xh(m);e?f("MOUNT"):b==="none"||m?.display==="none"?f("UNMOUNT"):f(p&&v!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,f]),Rn(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=b=>{const w=Xh(o.current).includes(CSS.escape(b.animationName));if(b.target===t&&w&&(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=b=>{b.target===t&&(i.current=Xh(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 Xh(e){return e?.animationName||"none"}function T7(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 O7=fI[" useId ".trim().toString()]||(()=>{}),A7=0;function ao(e){const[t,n]=_.useState(O7());return Rn(()=>{n(o=>o??String(A7++))},[e]),t?`radix-${t}`:""}function Vf(e){const t=e+"CollectionProvider",[n,o]=si(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=w=>{const{scope:C,children:E}=w,j=q.useRef(null),N=q.useRef(new Map).current;return c.jsx(r,{scope:C,itemMap:N,collectionRef:j,children:E})};a.displayName=t;const u=e+"CollectionSlot",f=tl(u),m=q.forwardRef((w,C)=>{const{scope:E,children:j}=w,N=i(u,E),O=ut(C,N.collectionRef);return c.jsx(f,{ref:O,children:j})});m.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=tl(p),b=q.forwardRef((w,C)=>{const{scope:E,children:j,...N}=w,O=q.useRef(null),k=ut(C,O),T=i(p,E);return q.useEffect(()=>(T.itemMap.set(O,{ref:O,...N}),()=>void T.itemMap.delete(O))),c.jsx(v,{[g]:"",ref:k,children:j})});b.displayName=p;function x(w){const C=i(e+"CollectionConsumer",w);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((T,A)=>N.indexOf(T.ref.current)-N.indexOf(A.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:m,ItemSlot:b},x,o]}function Zt(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}function I7(e,t=globalThis?.document){const n=Zt(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 $7="DismissableLayer",gS="dismissableLayer.update",M7="dismissableLayer.pointerDownOutside",P7="dismissableLayer.focusOutside",Jk,l$=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Su=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:a,onDismiss:u,...f}=e,m=_.useContext(l$),[p,g]=_.useState(null),v=p?.ownerDocument??globalThis?.document,[,b]=_.useState({}),x=ut(t,A=>g(A)),w=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(C),j=p?w.indexOf(p):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,O=j>=E,k=U7(A=>{const $=A.target,L=[...m.branches].some(G=>G.contains($));!O||L||(r?.(A),a?.(A),A.defaultPrevented||u?.())},v),T=L7(A=>{const $=A.target;[...m.branches].some(G=>G.contains($))||(i?.(A),a?.(A),A.defaultPrevented||u?.())},v);return I7(A=>{j===m.layers.size-1&&(o?.(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))},v),_.useEffect(()=>{if(p)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Jk=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),eT(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Jk)}},[p,v,n,m]),_.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),eT())},[p,m]),_.useEffect(()=>{const A=()=>b({});return document.addEventListener(gS,A),()=>document.removeEventListener(gS,A)},[]),c.jsx(Ue.div,{...f,ref:x,style:{pointerEvents:N?O?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,k.onPointerDownCapture)})});Su.displayName=$7;var D7="DismissableLayerBranch",z7=_.forwardRef((e,t)=>{const n=_.useContext(l$),o=_.useRef(null),r=ut(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})});z7.displayName=D7;function U7(e,t=globalThis?.document){const n=Zt(e),o=_.useRef(!1),r=_.useRef(()=>{});return _.useEffect(()=>{const i=u=>{if(u.target&&!o.current){let f=function(){c$(M7,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},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function L7(e,t=globalThis?.document){const n=Zt(e),o=_.useRef(!1);return _.useEffect(()=>{const r=i=>{i.target&&!o.current&&c$(P7,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 eT(){const e=new CustomEvent(gS);document.dispatchEvent(e)}function c$(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?eg(r,i):r.dispatchEvent(i)}function u$(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 d$=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"}),F7="VisuallyHidden",f$=_.forwardRef((e,t)=>c.jsx(Ue.span,{...e,ref:t,style:{...d$,...e.style}}));f$.displayName=F7;var m$=f$,pl="NavigationMenu",[Fw,h$,V7]=Vf(pl),[vS,B7,H7]=Vf(pl),[Vw]=si(pl,[V7,H7]),[q7,Lo]=Vw(pl),[G7,K7]=Vw(pl),p$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,delayDuration:a=200,skipDelayDuration:u=300,orientation:f="horizontal",dir:m,...p}=e,[g,v]=_.useState(null),b=ut(t,L=>v(L)),x=_u(m),w=_.useRef(0),C=_.useRef(0),E=_.useRef(0),[j,N]=_.useState(!0),[O,k]=Ri({prop:o,onChange:L=>{const G=L!=="",ae=u>0;G?(window.clearTimeout(E.current),ae&&N(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>N(!0),u)),r?.(L)},defaultProp:i??"",caller:pl}),T=_.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>k(""),150)},[k]),A=_.useCallback(L=>{window.clearTimeout(C.current),k(L)},[k]),$=_.useCallback(L=>{O===L?window.clearTimeout(C.current):w.current=window.setTimeout(()=>{window.clearTimeout(C.current),k(L)},a)},[O,k,a]);return _.useEffect(()=>()=>{window.clearTimeout(w.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),c.jsx(g$,{scope:n,isRootMenu:!0,value:O,dir:x,orientation:f,rootNavigationMenu:g,onTriggerEnter:L=>{window.clearTimeout(w.current),j?$(L):A(L)},onTriggerLeave:()=>{window.clearTimeout(w.current),T()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:T,onItemSelect:L=>{k(G=>G===L?"":L)},onItemDismiss:()=>k(""),children:c.jsx(Ue.nav,{"aria-label":"Main","data-orientation":f,dir:x,...p,ref:b})})});p$.displayName=pl;var yS="NavigationMenuSub",Z7=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,orientation:a="horizontal",...u}=e,f=Lo(yS,n),[m,p]=Ri({prop:o,onChange:r,defaultProp:i??"",caller:yS});return c.jsx(g$,{scope:n,isRootMenu:!1,value:m,dir:f.dir,orientation:a,rootNavigationMenu:f.rootNavigationMenu,onTriggerEnter:g=>p(g),onItemSelect:g=>p(g),onItemDismiss:()=>p(""),children:c.jsx(Ue.div,{"data-orientation":a,...u,ref:t})})});Z7.displayName=yS;var g$=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:o,dir:r,orientation:i,children:a,value:u,onItemSelect:f,onItemDismiss:m,onTriggerEnter:p,onTriggerLeave:g,onContentEnter:v,onContentLeave:b}=e,[x,w]=_.useState(null),[C,E]=_.useState(new Map),[j,N]=_.useState(null);return c.jsx(q7,{scope:t,isRootMenu:n,rootNavigationMenu:o,value:u,previousValue:u$(u),baseId:ao(),dir:r,orientation:i,viewport:x,onViewportChange:w,indicatorTrack:j,onIndicatorTrackChange:N,onTriggerEnter:Zt(p),onTriggerLeave:Zt(g),onContentEnter:Zt(v),onContentLeave:Zt(b),onItemSelect:Zt(f),onItemDismiss:Zt(m),onViewportContentChange:_.useCallback((O,k)=>{E(T=>(T.set(O,k),new Map(T)))},[]),onViewportContentRemove:_.useCallback(O=>{E(k=>k.has(O)?(k.delete(O),new Map(k)):k)},[]),children:c.jsx(Fw.Provider,{scope:t,children:c.jsx(G7,{scope:t,items:C,children:a})})})},v$="NavigationMenuList",y$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Lo(v$,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(Fw.Slot,{scope:n,children:r.isRootMenu?c.jsx(E$,{asChild:!0,children:i}):i})})});y$.displayName=v$;var b$="NavigationMenuItem",[Y7,x$]=Vw(b$),_$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,...r}=e,i=ao(),a=o||i||"LEGACY_REACT_AUTO_VALUE",u=_.useRef(null),f=_.useRef(null),m=_.useRef(null),p=_.useRef(()=>{}),g=_.useRef(!1),v=_.useCallback((x="start")=>{if(u.current){p.current();const w=xS(u.current);w.length&&qw(x==="start"?w:w.reverse())}},[]),b=_.useCallback(()=>{if(u.current){const x=xS(u.current);x.length&&(p.current=iK(x))}},[]);return c.jsx(Y7,{scope:n,value:a,triggerRef:f,contentRef:u,focusProxyRef:m,wasEscapeCloseRef:g,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:b,onContentFocusOutside:b,children:c.jsx(Ue.li,{...r,ref:t})})});_$.displayName=b$;var bS="NavigationMenuTrigger",W7=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:o,...r}=e,i=Lo(bS,e.__scopeNavigationMenu),a=x$(bS,e.__scopeNavigationMenu),u=_.useRef(null),f=ut(u,a.triggerRef,t),m=j$(i.baseId,a.value),p=N$(i.baseId,a.value),g=_.useRef(!1),v=_.useRef(!1),b=a.value===i.value;return c.jsxs(c.Fragment,{children:[c.jsx(Fw.ItemSlot,{scope:n,value:a.value,children:c.jsx(R$,{asChild:!0,children:c.jsx(Ue.button,{id:m,disabled:o,"data-disabled":o?"":void 0,"data-state":Gw(b),"aria-expanded":b,"aria-controls":p,...r,ref:f,onPointerEnter:Ce(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:Ce(e.onPointerMove,tg(()=>{o||v.current||a.wasEscapeCloseRef.current||g.current||(i.onTriggerEnter(a.value),g.current=!0)})),onPointerLeave:Ce(e.onPointerLeave,tg(()=>{o||(i.onTriggerLeave(),g.current=!1)})),onClick:Ce(e.onClick,()=>{i.onItemSelect(a.value),v.current=b}),onKeyDown:Ce(e.onKeyDown,x=>{const C={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];b&&x.key===C&&(a.onEntryKeyDown(),x.preventDefault())})})})}),b&&c.jsxs(c.Fragment,{children:[c.jsx(m$,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const w=a.contentRef.current,C=x.relatedTarget,E=C===u.current,j=w?.contains(C);(E||!j)&&a.onFocusProxyEnter(E?"start":"end")}}),i.viewport&&c.jsx("span",{"aria-owns":p})]})]})});W7.displayName=bS;var X7="NavigationMenuLink",tT="navigationMenu.linkSelect",S$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:o,onSelect:r,...i}=e;return c.jsx(R$,{asChild:!0,children:c.jsx(Ue.a,{"data-active":o?"":void 0,"aria-current":o?"page":void 0,...i,ref:t,onClick:Ce(e.onClick,a=>{const u=a.target,f=new CustomEvent(tT,{bubbles:!0,cancelable:!0});if(u.addEventListener(tT,m=>r?.(m),{once:!0}),eg(u,f),!f.defaultPrevented&&!a.metaKey){const m=new CustomEvent(Tp,{bubbles:!0,cancelable:!0});eg(u,m)}},{checkForDefaultPrevented:!1})})})});S$.displayName=X7;var Bw="NavigationMenuIndicator",Q7=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Lo(Bw,e.__scopeNavigationMenu),i=!!r.value;return r.indicatorTrack?Ow.createPortal(c.jsx(Dn,{present:n||i,children:c.jsx(J7,{...o,ref:t})}),r.indicatorTrack):null});Q7.displayName=Bw;var J7=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Lo(Bw,n),i=h$(n),[a,u]=_.useState(null),[f,m]=_.useState(null),p=r.orientation==="horizontal",g=!!r.value;_.useEffect(()=>{const x=i().find(w=>w.value===r.value)?.ref.current;x&&u(x)},[i,r.value]);const v=()=>{a&&m({size:p?a.offsetWidth:a.offsetHeight,offset:p?a.offsetLeft:a.offsetTop})};return _S(a,v),_S(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",eK=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Lo(Xc,e.__scopeNavigationMenu),i=x$(Xc,e.__scopeNavigationMenu),a=ut(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(tK,{forceMount:n,...f,ref:a}):c.jsx(Dn,{present:n||u,children:c.jsx(w$,{"data-state":Gw(u),...f,ref:a,onPointerEnter:Ce(e.onPointerEnter,r.onContentEnter),onPointerLeave:Ce(e.onPointerLeave,tg(r.onContentLeave)),style:{pointerEvents:!u&&r.isRootMenu?"none":void 0,...f.style}})})});eK.displayName=Xc;var tK=_.forwardRef((e,t)=>{const n=Lo(Xc,e.__scopeNavigationMenu),{onViewportContentChange:o,onViewportContentRemove:r}=n;return Rn(()=>{o(e.value,{ref:t,...e})},[e,t,o]),Rn(()=>()=>r(e.value),[e.value,r]),null}),Tp="navigationMenu.rootContentDismiss",w$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,triggerRef:r,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:u,onContentFocusOutside:f,...m}=e,p=Lo(Xc,n),g=_.useRef(null),v=ut(g,t),b=j$(p.baseId,o),x=N$(p.baseId,o),w=h$(n),C=_.useRef(null),{onItemDismiss:E}=p;_.useEffect(()=>{const N=g.current;if(p.isRootMenu&&N){const O=()=>{E(),u(),N.contains(document.activeElement)&&r.current?.focus()};return N.addEventListener(Tp,O),()=>N.removeEventListener(Tp,O)}},[p.isRootMenu,e.value,r,E,u]);const j=_.useMemo(()=>{const O=w().map(G=>G.value);p.dir==="rtl"&&O.reverse();const k=O.indexOf(p.value),T=O.indexOf(p.previousValue),A=o===p.value,$=T===O.indexOf(o);if(!A&&!$)return C.current;const L=(()=>{if(k!==T){if(A&&T!==-1)return k>T?"from-end":"from-start";if($&&k!==-1)return k>T?"to-start":"to-end"}return null})();return C.current=L,L},[p.previousValue,p.value,p.dir,w,o]);return c.jsx(E$,{asChild:!0,children:c.jsx(Su,{id:x,"aria-labelledby":b,"data-motion":j,"data-orientation":p.orientation,...m,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const N=new Event(Tp,{bubbles:!0,cancelable:!0});g.current?.dispatchEvent(N)},onFocusOutside:Ce(e.onFocusOutside,N=>{f();const O=N.target;p.rootNavigationMenu?.contains(O)&&N.preventDefault()}),onPointerDownOutside:Ce(e.onPointerDownOutside,N=>{const O=N.target,k=w().some(A=>A.ref.current?.contains(O)),T=p.isRootMenu&&p.viewport?.contains(O);(k||T||!p.isRootMenu)&&N.preventDefault()}),onKeyDown:Ce(e.onKeyDown,N=>{const O=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!O){const T=xS(N.currentTarget),A=document.activeElement,$=T.findIndex(ae=>ae===A),G=N.shiftKey?T.slice(0,$).reverse():T.slice($+1,T.length);qw(G)?N.preventDefault():i.current?.focus()}}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,N=>{a.current=!0})})})}),Hw="NavigationMenuViewport",C$=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,i=!!Lo(Hw,e.__scopeNavigationMenu).value;return c.jsx(Dn,{present:n||i,children:c.jsx(nK,{...o,ref:t})})});C$.displayName=Hw;var nK=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:o,...r}=e,i=Lo(Hw,n),a=ut(t,i.onViewportChange),u=K7(Xc,e.__scopeNavigationMenu),[f,m]=_.useState(null),[p,g]=_.useState(null),v=f?f?.width+"px":void 0,b=f?f?.height+"px":void 0,x=!!i.value,w=x?i.value:i.previousValue;return _S(p,()=>{p&&m({width:p.offsetWidth,height:p.offsetHeight})}),c.jsx(Ue.div,{"data-state":Gw(x),"data-orientation":i.orientation,...r,ref:a,style:{pointerEvents:!x&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":b,...r.style},onPointerEnter:Ce(e.onPointerEnter,i.onContentEnter),onPointerLeave:Ce(e.onPointerLeave,tg(i.onContentLeave)),children:Array.from(u.items).map(([E,{ref:j,forceMount:N,...O}])=>{const k=w===E;return c.jsx(Dn,{present:N||k,children:c.jsx(w$,{...O,ref:Uf(j,T=>{k&&T&&g(T)})})},E)})})}),rK="FocusGroup",E$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Lo(rK,n);return c.jsx(vS.Provider,{scope:n,children:c.jsx(vS.Slot,{scope:n,children:c.jsx(Ue.div,{dir:r.dir,...o,ref:t})})})}),nT=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],oK="FocusGroupItem",R$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=B7(n),i=Lo(oK,n);return c.jsx(vS.ItemSlot,{scope:n,children:c.jsx(Ue.button,{...o,ref:t,onKeyDown:Ce(e.onKeyDown,a=>{if(["Home","End",...nT].includes(a.key)){let f=r().map(g=>g.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&f.reverse(),nT.includes(a.key)){const g=f.indexOf(a.currentTarget);f=f.slice(g+1)}setTimeout(()=>qw(f)),a.preventDefault()}})})})});function xS(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 qw(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function iK(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 _S(e,t){const n=Zt(t);Rn(()=>{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 Gw(e){return e?"open":"closed"}function j$(e,t){return`${e}-trigger-${t}`}function N$(e,t){return`${e}-content-${t}`}function tg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var sK=p$,aK=y$,lK=_$,cK=S$,uK=C$;function dK({className:e,...t}){return c.jsx("div",{className:Pe("absolute top-full left-0 isolate z-50 flex justify-center"),children:c.jsx(uK,{"data-slot":"navigation-menu-viewport",className:Pe("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 k$({className:e,children:t,viewport:n=!0,...o}){return c.jsxs(sK,{"data-slot":"navigation-menu","data-viewport":n,className:Pe("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...o,children:[t,n&&c.jsx(dK,{})]})}function ng({className:e,...t}){return c.jsx(lK,{"data-slot":"navigation-menu-item",className:Pe("relative",e),...t})}function rg({className:e,...t}){return c.jsx(cK,{"data-slot":"navigation-menu-link",className:Pe("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 T$({className:e,...t}){return c.jsx(aK,{"data-slot":"navigation-menu-list",className:Pe("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function Qg(e){const{instanceId:t,clusterId:n}=We({strict:!1});return qs({id:wn,operationsUrl:e})}function Bf(e){const{instanceId:t,clusterId:n}=We({strict:!1});return{instanceClient:qs({id:wn,operationsUrl:e}),entityType:"instance"}}function Yn(e){const{instanceId:t,clusterId:n}=We({strict:!1}),o=wn;return{instanceClient:qs({id:o,operationsUrl:e}),entityId:o,entityType:"instance"}}function fK(){localStorage.clear()}function mK(){sessionStorage.clear()}async function hK(){Zn.setUserForEntity(wn,null),gf.getQueryCache().clear(),fK(),mK(),await gf.invalidateQueries({refetchType:"none"})}async function pK(e){await Zn.signOutFromPotentiallyAuthenticatedInstances(),await zf(e)}function gK(){const e=Qg();return lt({mutationFn:()=>pK({instanceClient:e}),onSuccess:hK})}function Hf(e){const{user:t}=vu(),{organizationId:n}=We({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 gl(e){const{user:t}=vu(),{organizationId:n}=We({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 Kw(e,t){const{user:n}=vu(),{organizationId:o,clusterId:r}=We({strict:!1}),i=t??r,a=n?.roles?.[e??o];if(!a?.permission&&!a?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(a.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const u=a.organization.clusters.resources?.find(m=>m.id===i),f=a.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 vK(e){const{clusterId:t,instanceId:n}=We({strict:!1}),{user:o}=ua(n??t),r=o?.role?.permission;return r?r.super_user===!0:!1}function Zw(e){const{clusterId:t,instanceId:n}=We({strict:!1}),{user:o}=ua(n??t),r=o?.role?.permission;return r?r.super_user===!0||r.structure_user===!0:!1}function Dx(e,t,n,o){const{clusterId:r,instanceId:i}=We({strict:!1}),{user:a}=ua(e??i??r),u=a?.role?.permission;return u?u.super_user===!0||u.structure_user===!0?!0:u[t]?.tables?.[n][o]===!0:!1}const yK={className:"text-white"};function bK({signOut:e}){const{user:t}=hl();xu(t);const{organizationId:n}=We({strict:!1}),{update:o}=Hf(n),{view:r}=gl(n),[i,a]=_.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(Ke,{to:ca,children:[c.jsx(Yw,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.6"})]}),c.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:()=>{a(!i)},children:[c.jsx("span",{className:"sr-only",children:i?"Close menu":"Open menu"}),i?c.jsx(a$,{}):c.jsx(o$,{})]})]}),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:[!Hc,!Hc,c.jsxs(Ke,{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(zw,{className:"mr-4"})," Docs"]}),c.jsxs(Ke,{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(r$,{className:"mr-4"})," Sign Out"]})]})]})}function xK({signOut:e}){const{user:t}=hl();xu(t);const{organizationId:n}=We({strict:!1}),{update:o}=Hf(n),{view:r}=gl(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(Ke,{to:ca,children:[c.jsx(Yw,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.6"})]})}),c.jsx(k$,{children:c.jsxs(T$,{className:"text-grey-400",children:[!Hc,!Hc,c.jsx(ng,{children:c.jsx(rg,{asChild:!0,children:c.jsxs(Ke,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(zw,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Docs"})]})})}),c.jsx(ng,{children:c.jsx(rg,{asChild:!0,children:c.jsxs(Ke,{to:void 0,onClick:e,className:"flex-row items-center",children:[c.jsx(r$,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Sign Out"})]})})})]})})]})})}function _K(){return c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(Ke,{to:"/sign-in",children:[c.jsx(Yw,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.6"})]})}),c.jsx(k$,{children:c.jsxs(T$,{className:"text-grey-400",children:[c.jsx(ng,{children:c.jsx(rg,{asChild:!0,children:c.jsxs(Ke,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(zw,{})," ",c.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),c.jsx(ng,{children:c.jsx(rg,{asChild:!0,children:c.jsxs(Ke,{to:"/sign-in",className:"flex-row items-center",activeProps:yK,children:[c.jsx(yG,{})," Sign In"]})})})]})})]})}function Yw(){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 O$(){const{mutate:e}=gK(),t=bn(),{user:n}=hl(),o=cn(),r=_.useCallback(()=>{e(void 0,{onSuccess:async()=>{Se.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Se.dismiss()}}),t({to:"/sign-in"}),o.invalidate()}})},[e,o,t]);return n?c.jsxs(c.Fragment,{children:[c.jsx(bK,{signOut:r}),c.jsx(xK,{signOut:r})]}):c.jsx(_K,{})}function Qh({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 SK(){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(O$,{})}),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(Qh,{title:"Manage All Instances",children:c.jsx("span",{children:"View, create, and delete instances from one location."})}),c.jsx(Qh,{title:"Embedded API Server",children:c.jsx("span",{children:"Harper components give you unlimited application flexibility"})}),c.jsx(Qh,{title:"Fully Managed Cloud & 5G Instances",children:c.jsx("span",{children:"Go from zero to code in minutes."})}),c.jsx(Qh,{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(ms,{})})]})]})}const zd=new Map;function Ws(e){if(!e)return"";if(zd.has(e))return zd.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return zd.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return zd.set(e,""),"";const o=[];for(let a=0;a<n.length;a++){const u=n[a],f=a+1<n.length?n[a+1]:void 0;/^[A-Z]{2,}$/.test(u)&&f==="s"?(o.push(u+"s"),a++):/^[A-Z]$/.test(u)&&f!==void 0&&/^[A-Z]s$/.test(f)?(o.push(u+f),a++):o.push(u)}const i=o.map(wK).join(" ");return zd.set(e,i),i}function wK(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=P9(),{organization:t,instance:n,cluster:o}=Aw({strict:!1}),r=_.useMemo(()=>{const i=e.pathname.split("/").filter(u=>u&&u.length>0),a=[c.jsxs(Ke,{to:"/",children:[c.jsx(dG,{"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=Ws(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"),a.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(Ke,{to:m,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[p,g]}))}return a},[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",La=e=>e instanceof Date,Er=e=>e==null;const A$=e=>typeof e=="object";var Cn=e=>!Er(e)&&!Array.isArray(e)&&A$(e)&&!La(e),I$=e=>Cn(e)&&e.target?qf(e.target)?e.target.checked:e.target.value:e,CK=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,$$=(e,t)=>e.has(CK(t)),EK=e=>{const t=e.constructor&&e.constructor.prototype;return Cn(t)&&t.hasOwnProperty("isPrototypeOf")},Ww=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Lt(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(!(Ww&&(e instanceof Blob||o))&&(n||Cn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!EK(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Lt(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):[],Xw=e=>tv(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ee=(e,t,n)=>{if(!t||!Cn(e))return n;const o=(ev(t)?[t]:Xw(t)).reduce((r,i)=>Er(r)?r:r[i],e);return Vt(o)||o===e?Vt(e[t])?n:e[t]:o},eo=e=>typeof e=="boolean",Rt=(e,t,n)=>{let o=-1;const r=ev(t)?[t]:Xw(t),i=r.length,a=i-1;for(;++o<i;){const u=r[o];let f=n;if(o!==a){const m=e[u];f=Cn(m)||Array.isArray(m)?m:isNaN(+r[o+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const og={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ao={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Qi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Qw=q.createContext(null);Qw.displayName="HookFormContext";const Gf=()=>q.useContext(Qw),RK=e=>{const{children:t,...n}=e;return q.createElement(Qw.Provider,{value:n},t)};var M$=(e,t,n,o=!0)=>{const r={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(r,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Ao.all&&(t._proxyFormState[a]=!o||Ao.all),n&&(n[a]=!0),e[a]}});return r};const nv=typeof window<"u"?q.useLayoutEffect:q.useEffect;function Jw(e){const t=Gf(),{control:n=t.control,disabled:o,name:r,exact:i}=e||{},[a,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(()=>M$(a,n,f.current,!1),[a,n])}var oo=e=>typeof e=="string",P$=(e,t,n,o,r)=>oo(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),SS=e=>Er(e)||!A$(e);function es(e,t,n=new WeakSet){if(SS(e)||SS(t))return e===t;if(La(e)&&La(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 a=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const u=t[i];if(La(a)&&La(u)||Cn(a)&&Cn(u)||Array.isArray(a)&&Array.isArray(u)?!es(a,u,n):a!==u)return!1}}return!0}function jK(e){const t=Gf(),{control:n=t.control,name:o,defaultValue:r,disabled:i,exact:a,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,b]=q.useState(m.current?m.current(g):g);return nv(()=>n._subscribe({name:o,formState:{values:!0},exact:a,callback:x=>{if(!i){const w=P$(o,n._names,x.values||n._formValues,!1,f.current);if(m.current){const C=m.current(w);es(C,p.current)||(b(C),p.current=C)}else b(w)}}}),[n,i,o,a]),q.useEffect(()=>n._removeUnmounted()),v}function NK(e){const t=Gf(),{name:n,disabled:o,control:r=t.control,shouldUnregister:i,defaultValue:a}=e,u=$$(r._names.array,n),f=q.useMemo(()=>Ee(r._formValues,n,Ee(r._defaultValues,n,a)),[r,n,a]),m=jK({control:r,name:n,defaultValue:f,exact:!0}),p=Jw({control:r,name:n,exact:!0}),g=q.useRef(e),v=q.useRef(void 0),b=q.useRef(r.register(n,{...e.rules,value:m,...eo(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]),w=q.useCallback(N=>b.current.onChange({target:{value:I$(N),name:n},type:og.CHANGE}),[n]),C=q.useCallback(()=>b.current.onBlur({target:{value:Ee(r._formValues,n),name:n},type:og.BLUR}),[n,r._formValues]),E=q.useCallback(N=>{const O=Ee(r._fields,n);O&&N&&(O._f.ref={focus:()=>N.focus&&N.focus(),select:()=>N.select&&N.select(),setCustomValidity:k=>N.setCustomValidity(k),reportValidity:()=>N.reportValidity()})},[r._fields,n]),j=q.useMemo(()=>({name:n,value:m,...eo(o)||p.disabled?{disabled:p.disabled||o}:{},onChange:w,onBlur:C,ref:E}),[n,o,p.disabled,w,C,E,m]);return q.useEffect(()=>{const N=r._options.shouldUnregister||i,O=v.current;O&&O!==n&&!u&&r.unregister(O),r.register(n,{...g.current.rules,...eo(g.current.disabled)?{disabled:g.current.disabled}:{}});const k=(T,A)=>{const $=Ee(r._fields,T);$&&$._f&&($._f.mount=A)};if(k(n,!0),N){const T=Lt(Ee(r._options.defaultValues,n));Rt(r._defaultValues,n,T),Vt(Ee(r._formValues,n))&&Rt(r._formValues,n,T)}return!u&&r.register(n),v.current=n,()=>{(u?N&&!r._state.action:N)?r.unregister(n):k(n,!1)}},[n,r,u,i]),q.useEffect(()=>{r._setDisabledField({disabled:o,name:n})},[o,n,r]),q.useMemo(()=>({field:j,formState:p,fieldState:x}),[j,p,x])}const kK=e=>e.render(NK(e));var e0=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},zr=e=>Array.isArray(e)?e:[e],rT=()=>{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=[]}}};function D$(e,t){const n={};for(const o in e)if(e.hasOwnProperty(o)){const r=e[o],i=t[o];if(r&&Cn(r)&&i){const a=D$(r,i);Cn(a)&&(n[o]=a)}else e[o]&&(n[o]=i)}return n}var Sr=e=>Cn(e)&&!Object.keys(e).length,t0=e=>e.type==="file",Wo=e=>typeof e=="function",ig=e=>{if(!Ww)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},z$=e=>e.type==="select-multiple",n0=e=>e.type==="radio",TK=e=>n0(e)||qf(e),zx=e=>ig(e)&&e.isConnected;function OK(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 AK(e){for(const t in e)if(e.hasOwnProperty(t)&&!Vt(e[t]))return!1;return!0}function vn(e,t){const n=Array.isArray(t)?t:ev(t)?[t]:Xw(t),o=n.length===1?e:OK(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(Cn(o)&&Sr(o)||Array.isArray(o)&&AK(o))&&vn(e,n.slice(0,-1)),e}var IK=e=>{for(const t in e)if(Wo(e[t]))return!0;return!1};function U$(e){return Array.isArray(e)||Cn(e)&&!IK(e)}function wS(e,t={}){for(const n in e)U$(e[n])?(t[n]=Array.isArray(e[n])?[]:{},wS(e[n],t[n])):Er(e[n])||(t[n]=!0);return t}function Rc(e,t,n){n||(n=wS(t));for(const o in e)U$(e[o])?Vt(t)||SS(n[o])?n[o]=wS(e[o],Array.isArray(e[o])?[]:{}):Rc(e[o],Er(t)?{}:t[o],n[o]):n[o]=!es(e[o],t[o]);return n}const oT={value:!1,isValid:!1},iT={value:!0,isValid:!0};var L$=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:oT}return oT},F$=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>Vt(e)?e:t?e===""?NaN:e&&+e:n&&oo(e)?new Date(e):o?o(e):e;const sT={isValid:!1,value:null};var V$=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,sT):sT;function aT(e){const t=e.ref;return t0(t)?t.files:n0(t)?V$(e.refs).value:z$(t)?[...t.selectedOptions].map(({value:n})=>n):qf(t)?L$(e.refs).value:F$(Vt(t.value)?e.ref.value:t.value,e)}var $K=(e,t,n,o)=>{const r={};for(const i of e){const a=Ee(t,i);a&&Rt(r,i,a._f)}return{criteriaMode:n,names:[...e],fields:r,shouldUseNativeValidation:o}},sg=e=>e instanceof RegExp,Ud=e=>Vt(e)?e:sg(e)?e.source:Cn(e)?sg(e.value)?e.value.source:e.value:e,Nc=e=>({isOnSubmit:!e||e===Ao.onSubmit,isOnBlur:e===Ao.onBlur,isOnChange:e===Ao.onChange,isOnAll:e===Ao.all,isOnTouch:e===Ao.onTouched});const lT="AsyncFunction";var MK=e=>!!e&&!!e.validate&&!!(Wo(e.validate)&&e.validate.constructor.name===lT||Cn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===lT)),PK=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),CS=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const Pc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Ee(e,r);if(i){const{_f:a,...u}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],r)&&!o)return!0;if(a.ref&&t(a.ref,a.name)&&!o)return!0;if(Pc(u,t))break}else if(Cn(u)&&Pc(u,t))break}}};function cT(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("."),a=Ee(t,i),u=Ee(e,i);if(a&&!Array.isArray(a)&&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 DK=(e,t,n,o)=>{n(e);const{name:r,...i}=e;return Sr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!o||Ao.all))},zK=(e,t,n)=>!e||!t||e===t||zr(e).some(o=>o&&(n?o===t:o.startsWith(t)||t.startsWith(o))),UK=(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,LK=(e,t)=>!tv(Ee(e,t)).length&&vn(e,t),B$=(e,t,n)=>{const o=zr(Ee(e,n));return Rt(o,"root",t[n]),Rt(e,n,o),e};function uT(e,t,n="validate"){if(oo(e)||Array.isArray(e)&&e.every(oo)||eo(e)&&!e)return{type:n,message:oo(e)?e:"",ref:t}}var gc=e=>Cn(e)&&!sg(e)?e:{value:e,message:""},ES=async(e,t,n,o,r,i)=>{const{ref:a,refs:u,required:f,maxLength:m,minLength:p,min:g,max:v,pattern:b,validate:x,name:w,valueAsNumber:C,mount:E}=e._f,j=Ee(n,w);if(!E||t.has(w))return{};const N=u?u[0]:a,O=re=>{r&&N.reportValidity&&(N.setCustomValidity(eo(re)?"":re||""),N.reportValidity())},k={},T=n0(a),A=qf(a),$=T||A,L=(C||t0(a))&&Vt(a.value)&&Vt(j)||ig(a)&&a.value===""||j===""||Array.isArray(j)&&!j.length,G=e0.bind(null,w,o,k),ae=(re,se,ue,oe=Qi.maxLength,P=Qi.minLength)=>{const Z=re?se:ue;k[w]={type:re?oe:P,message:Z,ref:a,...G(re?oe:P,Z)}};if(i?!Array.isArray(j)||!j.length:f&&(!$&&(L||Er(j))||eo(j)&&!j||A&&!L$(u).isValid||T&&!V$(u).isValid)){const{value:re,message:se}=oo(f)?{value:!!f,message:f}:gc(f);if(re&&(k[w]={type:Qi.required,message:se,ref:N,...G(Qi.required,se)},!o))return O(se),k}if(!L&&(!Er(g)||!Er(v))){let re,se;const ue=gc(v),oe=gc(g);if(!Er(j)&&!isNaN(j)){const P=a.valueAsNumber||j&&+j;Er(ue.value)||(re=P>ue.value),Er(oe.value)||(se=P<oe.value)}else{const P=a.valueAsDate||new Date(j),Z=M=>new Date(new Date().toDateString()+" "+M),U=a.type=="time",ie=a.type=="week";oo(ue.value)&&j&&(re=U?Z(j)>Z(ue.value):ie?j>ue.value:P>new Date(ue.value)),oo(oe.value)&&j&&(se=U?Z(j)<Z(oe.value):ie?j<oe.value:P<new Date(oe.value))}if((re||se)&&(ae(!!re,ue.message,oe.message,Qi.max,Qi.min),!o))return O(k[w].message),k}if((m||p)&&!L&&(oo(j)||i&&Array.isArray(j))){const re=gc(m),se=gc(p),ue=!Er(re.value)&&j.length>+re.value,oe=!Er(se.value)&&j.length<+se.value;if((ue||oe)&&(ae(ue,re.message,se.message),!o))return O(k[w].message),k}if(b&&!L&&oo(j)){const{value:re,message:se}=gc(b);if(sg(re)&&!j.match(re)&&(k[w]={type:Qi.pattern,message:se,ref:a,...G(Qi.pattern,se)},!o))return O(se),k}if(x){if(Wo(x)){const re=await x(j,n),se=uT(re,N);if(se&&(k[w]={...se,...G(Qi.validate,se.message)},!o))return O(se.message),k}else if(Cn(x)){let re={};for(const se in x){if(!Sr(re)&&!o)break;const ue=uT(await x[se](j,n),N,se);ue&&(re={...ue,...G(se,ue.message)},O(ue.message),o&&(k[w]=re))}if(!Sr(re)&&(k[w]={ref:N,...re},!o))return k}}return O(!0),k};const FK={mode:Ao.onSubmit,reValidateMode:Ao.onChange,shouldFocusError:!0};function VK(e={}){let t={...FK,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Wo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},o={},r=Cn(t.defaultValues)||Cn(t.values)?Lt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Lt(r),a={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:rT(),state:rT()},b=t.criteriaMode===Ao.all,x=z=>W=>{clearTimeout(m),m=setTimeout(z,W)},w=async z=>{if(!t.disabled&&(p.isValid||g.isValid||z)){const W=t.resolver?Sr((await A()).errors):await L(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(te=>{te&&(W?Rt(n.validatingFields,te,W):vn(n.validatingFields,te))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Sr(n.validatingFields)}))},E=(z,W=[],te,ve,xe=!0,be=!0)=>{if(ve&&te&&!t.disabled){if(a.action=!0,be&&Array.isArray(Ee(o,z))){const je=te(Ee(o,z),ve.argA,ve.argB);xe&&Rt(o,z,je)}if(be&&Array.isArray(Ee(n.errors,z))){const je=te(Ee(n.errors,z),ve.argA,ve.argB);xe&&Rt(n.errors,z,je),LK(n.errors,z)}if((p.touchedFields||g.touchedFields)&&be&&Array.isArray(Ee(n.touchedFields,z))){const je=te(Ee(n.touchedFields,z),ve.argA,ve.argB);xe&&Rt(n.touchedFields,z,je)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Rc(r,i)),v.state.next({name:z,isDirty:ae(z,W),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Rt(i,z,W)},j=(z,W)=>{Rt(n.errors,z,W),v.state.next({errors:n.errors})},N=z=>{n.errors=z,v.state.next({errors:n.errors,isValid:!1})},O=(z,W,te,ve)=>{const xe=Ee(o,z);if(xe){const be=Ee(i,z,Vt(te)?Ee(r,z):te);Vt(be)||ve&&ve.defaultChecked||W?Rt(i,z,W?be:aT(xe._f)):ue(z,be),a.mount&&w()}},k=(z,W,te,ve,xe)=>{let be=!1,je=!1;const Ye={name:z};if(!t.disabled){if(!te||ve){(p.isDirty||g.isDirty)&&(je=n.isDirty,n.isDirty=Ye.isDirty=ae(),be=je!==Ye.isDirty);const ct=es(Ee(r,z),W);je=!!Ee(n.dirtyFields,z),ct?vn(n.dirtyFields,z):Rt(n.dirtyFields,z,!0),Ye.dirtyFields=n.dirtyFields,be=be||(p.dirtyFields||g.dirtyFields)&&je!==!ct}if(te){const ct=Ee(n.touchedFields,z);ct||(Rt(n.touchedFields,z,te),Ye.touchedFields=n.touchedFields,be=be||(p.touchedFields||g.touchedFields)&&ct!==te)}be&&xe&&v.state.next(Ye)}return be?Ye:{}},T=(z,W,te,ve)=>{const xe=Ee(n.errors,z),be=(p.isValid||g.isValid)&&eo(W)&&n.isValid!==W;if(t.delayError&&te?(f=x(()=>j(z,te)),f(t.delayError)):(clearTimeout(m),f=null,te?Rt(n.errors,z,te):vn(n.errors,z)),(te?!es(xe,te):xe)||!Sr(ve)||be){const je={...ve,...be&&eo(W)?{isValid:W}:{},errors:n.errors,name:z};n={...n,...je},v.state.next(je)}},A=async z=>{C(z,!0);const W=await t.resolver(i,t.context,$K(z||u.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return C(z),W},$=async z=>{const{errors:W}=await A(z);if(z)for(const te of z){const ve=Ee(W,te);ve?Rt(n.errors,te,ve):vn(n.errors,te)}else n.errors=W;return W},L=async(z,W,te={valid:!0})=>{for(const ve in z){const xe=z[ve];if(xe){const{_f:be,...je}=xe;if(be){const Ye=u.array.has(be.name),ct=xe._f&&MK(xe._f);ct&&p.validatingFields&&C([be.name],!0);const St=await ES(xe,u.disabled,i,b,t.shouldUseNativeValidation&&!W,Ye);if(ct&&p.validatingFields&&C([be.name]),St[be.name]&&(te.valid=!1,W))break;!W&&(Ee(St,be.name)?Ye?B$(n.errors,St,be.name):Rt(n.errors,be.name,St[be.name]):vn(n.errors,be.name))}!Sr(je)&&await L(je,W,te)}}return te.valid},G=()=>{for(const z of u.unMount){const W=Ee(o,z);W&&(W._f.refs?W._f.refs.every(te=>!zx(te)):!zx(W._f.ref))&&ce(z)}u.unMount=new Set},ae=(z,W)=>!t.disabled&&(z&&W&&Rt(i,z,W),!es(M(),r)),re=(z,W,te)=>P$(z,u,{...a.mount?i:Vt(W)?r:oo(z)?{[z]:W}:W},te,W),se=z=>tv(Ee(a.mount?i:r,z,t.shouldUnregister?Ee(r,z,[]):[])),ue=(z,W,te={})=>{const ve=Ee(o,z);let xe=W;if(ve){const be=ve._f;be&&(!be.disabled&&Rt(i,z,F$(W,be)),xe=ig(be.ref)&&Er(W)?"":W,z$(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(Ye=>Ye===je.value):je.checked=xe===je.value||!!xe)}):be.refs.forEach(je=>je.checked=je.value===xe):t0(be.ref)?be.ref.value="":(be.ref.value=xe,be.ref.type||v.state.next({name:z,values:Lt(i)})))}(te.shouldDirty||te.shouldTouch)&&k(z,xe,te.shouldTouch,te.shouldDirty,!0),te.shouldValidate&&ie(z)},oe=(z,W,te)=>{for(const ve in W){if(!W.hasOwnProperty(ve))return;const xe=W[ve],be=z+"."+ve,je=Ee(o,be);(u.array.has(z)||Cn(xe)||je&&!je._f)&&!La(xe)?oe(be,xe,te):ue(be,xe,te)}},P=(z,W,te={})=>{const ve=Ee(o,z),xe=u.array.has(z),be=Lt(W);Rt(i,z,be),xe?(v.array.next({name:z,values:Lt(i)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&te.shouldDirty&&v.state.next({name:z,dirtyFields:Rc(r,i),isDirty:ae(z,be)})):ve&&!ve._f&&!Er(be)?oe(z,be,te):ue(z,be,te),CS(z,u)&&v.state.next({...n,name:z}),v.state.next({name:a.mount?z:void 0,values:Lt(i)})},Z=async z=>{a.mount=!0;const W=z.target;let te=W.name,ve=!0;const xe=Ee(o,te),be=ct=>{ve=Number.isNaN(ct)||La(ct)&&isNaN(ct.getTime())||es(ct,Ee(i,te,ct))},je=Nc(t.mode),Ye=Nc(t.reValidateMode);if(xe){let ct,St;const gr=W.type?aT(xe._f):I$(z),vr=z.type===og.BLUR||z.type===og.FOCUS_OUT,vo=!PK(xe._f)&&!t.resolver&&!Ee(n.errors,te)&&!xe._f.deps||UK(vr,Ee(n.touchedFields,te),n.isSubmitted,Ye,je),yo=CS(te,u,vr);Rt(i,te,gr),vr?(!W||!W.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(z),f&&f(0)):xe._f.onChange&&xe._f.onChange(z);const Or=k(te,gr,vr),Ar=!Sr(Or)||yo;if(!vr&&v.state.next({name:te,type:z.type,values:Lt(i)}),vo)return(p.isValid||g.isValid)&&(t.mode==="onBlur"?vr&&w():vr||w()),Ar&&v.state.next({name:te,...yo?{}:Or});if(!vr&&yo&&v.state.next({...n}),t.resolver){const{errors:Hr}=await A([te]);if(be(gr),ve){const Ho=cT(n.errors,o,te),qo=cT(Hr,o,Ho.name||te);ct=qo.error,te=qo.name,St=Sr(Hr)}}else C([te],!0),ct=(await ES(xe,u.disabled,i,b,t.shouldUseNativeValidation))[te],C([te]),be(gr),ve&&(ct?St=!1:(p.isValid||g.isValid)&&(St=await L(o,!0)));ve&&(xe._f.deps&&(!Array.isArray(xe._f.deps)||xe._f.deps.length>0)&&ie(xe._f.deps),T(te,St,ct,Or))}},U=(z,W)=>{if(Ee(n.errors,W)&&z.focus)return z.focus(),1},ie=async(z,W={})=>{let te,ve;const xe=zr(z);if(t.resolver){const be=await $(Vt(z)?z:xe);te=Sr(be),ve=z?!xe.some(je=>Ee(be,je)):te}else z?(ve=(await Promise.all(xe.map(async be=>{const je=Ee(o,be);return await L(je&&je._f?{[be]:je}:je)}))).every(Boolean),!(!ve&&!n.isValid)&&w()):ve=te=await L(o);return v.state.next({...!oo(z)||(p.isValid||g.isValid)&&te!==n.isValid?{}:{name:z},...t.resolver||!z?{isValid:te}:{},errors:n.errors}),W.shouldFocus&&!ve&&Pc(o,U,z?xe:u.mount),ve},M=(z,W)=>{let te={...a.mount?i:r};return W&&(te=D$(W.dirtyFields?n.dirtyFields:n.touchedFields,te)),Vt(z)?te:oo(z)?Ee(te,z):z.map(ve=>Ee(te,ve))},V=(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&&zr(z).forEach(W=>vn(n.errors,W)),v.state.next({errors:z?n.errors:{}})},X=(z,W,te)=>{const ve=(Ee(o,z,{_f:{}})._f||{}).ref,xe=Ee(n.errors,z)||{},{ref:be,message:je,type:Ye,...ct}=xe;Rt(n.errors,z,{...ct,...W,ref:ve}),v.state.next({name:z,errors:n.errors,isValid:!1}),te&&te.shouldFocus&&ve&&ve.focus&&ve.focus()},H=(z,W)=>Wo(z)?v.state.subscribe({next:te=>"values"in te&&z(re(void 0,W),te)}):re(z,W,!0),fe=z=>v.state.subscribe({next:W=>{zK(z.name,W.name,z.exact)&&DK(W,z.formState||p,Mt,z.reRenderRoot)&&z.callback({values:{...i},...n,...W,defaultValues:r})}}).unsubscribe,me=z=>(a.mount=!0,g={...g,...z.formState},fe({...z,formState:g})),ce=(z,W={})=>{for(const te of z?zr(z):u.mount)u.mount.delete(te),u.array.delete(te),W.keepValue||(vn(o,te),vn(i,te)),!W.keepError&&vn(n.errors,te),!W.keepDirty&&vn(n.dirtyFields,te),!W.keepTouched&&vn(n.touchedFields,te),!W.keepIsValidating&&vn(n.validatingFields,te),!t.shouldUnregister&&!W.keepDefaultValue&&vn(r,te);v.state.next({values:Lt(i)}),v.state.next({...n,...W.keepDirty?{isDirty:ae()}:{}}),!W.keepIsValid&&w()},pe=({disabled:z,name:W})=>{(eo(z)&&a.mount||z||u.disabled.has(W))&&(z?u.disabled.add(W):u.disabled.delete(W))},Ne=(z,W={})=>{let te=Ee(o,z);const ve=eo(W.disabled)||eo(t.disabled);return Rt(o,z,{...te||{},_f:{...te&&te._f?te._f:{ref:{name:z}},name:z,mount:!0,...W}}),u.mount.add(z),te?pe({disabled:eo(W.disabled)?W.disabled:t.disabled,name:z}):O(z,!0,W.value),{...ve?{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:Z,onBlur:Z,ref:xe=>{if(xe){Ne(z,W),te=Ee(o,z);const be=Vt(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,je=TK(be),Ye=te._f.refs||[];if(je?Ye.find(ct=>ct===be):be===te._f.ref)return;Rt(o,z,{_f:{...te._f,...je?{refs:[...Ye.filter(zx),be,...Array.isArray(Ee(r,z))?[{}]:[]],ref:{type:be.type,name:z}}:{ref:be}}}),O(z,!1,void 0,be)}else te=Ee(o,z,{}),te._f&&(te._f.mount=!1),(t.shouldUnregister||W.shouldUnregister)&&!($$(u.array,z)&&a.action)&&u.unMount.add(z)}}},Re=()=>t.shouldFocusError&&Pc(o,U,u.mount),Fe=z=>{eo(z)&&(v.state.next({disabled:z}),Pc(o,(W,te)=>{const ve=Ee(o,te);ve&&(W.disabled=ve._f.disabled||z,Array.isArray(ve._f.refs)&&ve._f.refs.forEach(xe=>{xe.disabled=ve._f.disabled||z}))},0,!1))},Be=(z,W)=>async te=>{let ve;te&&(te.preventDefault&&te.preventDefault(),te.persist&&te.persist());let xe=Lt(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:be,values:je}=await A();n.errors=be,xe=Lt(je)}else await L(o);if(u.disabled.size)for(const be of u.disabled)vn(xe,be);if(vn(n.errors,"root"),Sr(n.errors)){v.state.next({errors:{}});try{await z(xe,te)}catch(be){ve=be}}else W&&await W({...n.errors},te),Re(),setTimeout(Re);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Sr(n.errors)&&!ve,submitCount:n.submitCount+1,errors:n.errors}),ve)throw ve},qt=(z,W={})=>{Ee(o,z)&&(Vt(W.defaultValue)?P(z,Lt(Ee(r,z))):(P(z,W.defaultValue),Rt(r,z,Lt(W.defaultValue))),W.keepTouched||vn(n.touchedFields,z),W.keepDirty||(vn(n.dirtyFields,z),n.isDirty=W.defaultValue?ae(z,Lt(Ee(r,z))):ae()),W.keepError||(vn(n.errors,z),p.isValid&&w()),v.state.next({...n}))},nn=(z,W={})=>{const te=z?Lt(z):r,ve=Lt(te),xe=Sr(z),be=xe?r:ve;if(W.keepDefaultValues||(r=te),!W.keepValues){if(W.keepDirtyValues){const je=new Set([...u.mount,...Object.keys(Rc(r,i))]);for(const Ye of Array.from(je))Ee(n.dirtyFields,Ye)?Rt(be,Ye,Ee(i,Ye)):P(Ye,Ee(be,Ye))}else{if(Ww&&Vt(z))for(const je of u.mount){const Ye=Ee(o,je);if(Ye&&Ye._f){const ct=Array.isArray(Ye._f.refs)?Ye._f.refs[0]:Ye._f.ref;if(ig(ct)){const St=ct.closest("form");if(St){St.reset();break}}}}if(W.keepFieldsRef)for(const je of u.mount)P(je,Ee(be,je));else o={}}i=t.shouldUnregister?W.keepDefaultValues?Lt(r):{}:Lt(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:""},a.mount=!p.isValid||!!W.keepIsValid||!!W.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:W.keepSubmitCount?n.submitCount:0,isDirty:xe?!1:W.keepDirty?n.isDirty:!!(W.keepDefaultValues&&!es(z,r)),isSubmitted:W.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:xe?{}:W.keepDirtyValues?W.keepDefaultValues&&i?Rc(r,i):n.dirtyFields:W.keepDefaultValues&&z?Rc(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})},pr=(z,W)=>nn(Wo(z)?z(i):z,W),tr=(z,W={})=>{const te=Ee(o,z),ve=te&&te._f;if(ve){const xe=ve.refs?ve.refs[0]:ve.ref;xe.focus&&(xe.focus(),W.shouldSelect&&Wo(xe.select)&&xe.select())}},Mt=z=>{n={...n,...z}},rn={control:{register:Ne,unregister:ce,getFieldState:V,handleSubmit:Be,setError:X,_subscribe:fe,_runSchema:A,_focusError:Re,_getWatch:re,_getDirty:ae,_setValid:w,_setFieldArray:E,_setDisabledField:pe,_setErrors:N,_getFieldArray:se,_reset:nn,_resetDefaultValues:()=>Wo(t.defaultValues)&&t.defaultValues().then(z=>{pr(z,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:Fe,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return i},get _state(){return a},set _state(z){a=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:me,trigger:ie,register:Ne,handleSubmit:Be,watch:H,setValue:P,getValues:M,reset:pr,resetField:qt,clearErrors:le,unregister:ce,setError:X,setFocus:tr,getFieldState:V};return{...rn,formControl:rn}}var Ls=()=>{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)})},Ux=(e,t,n={})=>n.shouldFocus||Vt(n.shouldFocus)?n.focusName||`${e}.${Vt(n.focusIndex)?t:n.focusIndex}.`:"",Lx=(e,t)=>[...e,...zr(t)],Fx=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Vx(e,t,n){return[...e.slice(0,t),...zr(n),...e.slice(t)]}var Bx=(e,t,n)=>Array.isArray(e)?(Vt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Hx=(e,t)=>[...zr(t),...zr(e)];function BK(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 qx=(e,t)=>Vt(t)?[]:BK(e,zr(t).sort((n,o)=>n-o)),Gx=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},dT=(e,t,n)=>(e[t]=n,e);function H$(e){const t=Gf(),{control:n=t.control,name:o,keyName:r="id",shouldUnregister:i,rules:a}=e,[u,f]=q.useState(n._getFieldArray(o)),m=q.useRef(n._getFieldArray(o).map(Ls)),p=q.useRef(u),g=q.useRef(!1);p.current=u,n._names.array.add(o),q.useMemo(()=>a&&n.register(o,a),[n,a,o]),nv(()=>n._subjects.array.subscribe({next:({values:k,name:T})=>{if(T===o||!T){const A=Ee(k,o);Array.isArray(A)&&(f(A),m.current=A.map(Ls))}}}).unsubscribe,[n,o]);const v=q.useCallback(k=>{g.current=!0,n._setFieldArray(o,k)},[n,o]),b=(k,T)=>{const A=zr(Lt(k)),$=Lx(n._getFieldArray(o),A);n._names.focus=Ux(o,$.length-1,T),m.current=Lx(m.current,A.map(Ls)),v($),f($),n._setFieldArray(o,$,Lx,{argA:Fx(k)})},x=(k,T)=>{const A=zr(Lt(k)),$=Hx(n._getFieldArray(o),A);n._names.focus=Ux(o,0,T),m.current=Hx(m.current,A.map(Ls)),v($),f($),n._setFieldArray(o,$,Hx,{argA:Fx(k)})},w=k=>{const T=qx(n._getFieldArray(o),k);m.current=qx(m.current,k),v(T),f(T),!Array.isArray(Ee(n._fields,o))&&Rt(n._fields,o,void 0),n._setFieldArray(o,T,qx,{argA:k})},C=(k,T,A)=>{const $=zr(Lt(T)),L=Vx(n._getFieldArray(o),k,$);n._names.focus=Ux(o,k,A),m.current=Vx(m.current,k,$.map(Ls)),v(L),f(L),n._setFieldArray(o,L,Vx,{argA:k,argB:Fx(T)})},E=(k,T)=>{const A=n._getFieldArray(o);Gx(A,k,T),Gx(m.current,k,T),v(A),f(A),n._setFieldArray(o,A,Gx,{argA:k,argB:T},!1)},j=(k,T)=>{const A=n._getFieldArray(o);Bx(A,k,T),Bx(m.current,k,T),v(A),f(A),n._setFieldArray(o,A,Bx,{argA:k,argB:T},!1)},N=(k,T)=>{const A=Lt(T),$=dT(n._getFieldArray(o),k,A);m.current=[...$].map((L,G)=>!L||G===k?Ls():m.current[G]),v($),f([...$]),n._setFieldArray(o,$,dT,{argA:k,argB:A},!0,!1)},O=k=>{const T=zr(Lt(k));m.current=T.map(Ls),v([...T]),f([...T]),n._setFieldArray(o,[...T],A=>A,{},!0,!1)};return q.useEffect(()=>{if(n._state.action=!1,CS(o,n._names)&&n._subjects.state.next({...n._formState}),g.current&&(!Nc(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Nc(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([o]).then(k=>{const T=Ee(k.errors,o),A=Ee(n._formState.errors,o);(A?!T&&A.type||T&&(A.type!==T.type||A.message!==T.message):T&&T.type)&&(T?Rt(n._formState.errors,o,T):vn(n._formState.errors,o),n._subjects.state.next({errors:n._formState.errors}))});else{const k=Ee(n._fields,o);k&&k._f&&!(Nc(n._options.reValidateMode).isOnSubmit&&Nc(n._options.mode).isOnSubmit)&&ES(k,n._names.disabled,n._formValues,n._options.criteriaMode===Ao.all,n._options.shouldUseNativeValidation,!0).then(T=>!Sr(T)&&n._subjects.state.next({errors:B$(n._formState.errors,T,o)}))}n._subjects.state.next({name:o,values:Lt(n._formValues)}),n._names.focus&&Pc(n._fields,(k,T)=>{if(n._names.focus&&T.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=(T,A)=>{const $=Ee(n._fields,T);$&&$._f&&($._f.mount=A)};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(x,[v,o,n]),append:q.useCallback(b,[v,o,n]),remove:q.useCallback(w,[v,o,n]),insert:q.useCallback(C,[v,o,n]),update:q.useCallback(N,[v,o,n]),replace:q.useCallback(O,[v,o,n]),fields:q.useMemo(()=>u.map((k,T)=>({...k,[r]:m.current[T]||Ls()})),[u,r])}}function Yt(e={}){const t=q.useRef(void 0),n=q.useRef(void 0),[o,r]=q.useState({isDirty:!1,isValidating:!1,isLoading:Wo(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:Wo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Wo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...u}=VK(e);t.current={...u,formState:o}}const i=t.current.control;return i._options=e,nv(()=>{const a=i._subscribe({formState:i._proxyFormState,callback:()=>r({...i._formState}),reRenderRoot:!0});return r(u=>({...u,isReady:!0})),i._formState.isReady=!0,a},[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 a=i._getDirty();a!==o.isDirty&&i._subjects.state.next({isDirty:a})}},[i,o.isDirty]),q.useEffect(()=>{e.values&&!es(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,r(a=>({...a}))):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=M$(o,i),t.current}const Wt=RK,q$=_.createContext({}),G$=_.createContext({});function r0(){const e=_.useContext(q$),t=_.useContext(G$),{getFieldState:n}=Gf(),o=Jw({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}=r0();return c.jsx(Mw,{"data-slot":"form-control",id:n,"aria-describedby":t?`${o} ${r}`:`${o}`,"aria-invalid":!!t,...e})}function De({...e}){return c.jsx(q$,{value:{name:e.name},children:c.jsx(kK,{...e})})}function ke({className:e,...t}){const n=_.useId();return c.jsx(G$,{value:{id:n},children:c.jsx("div",{"data-slot":"form-item",className:Pe("grid gap-2",e),...t})})}var HK="Label",K$=_.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())}}));K$.displayName=HK;var qK=K$;function o0({className:e,...t}){return c.jsx(qK,{"data-slot":"label",className:Pe("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 $e({className:e,...t}){const{error:n,formItemId:o}=r0();return c.jsx(o0,{"data-slot":"form-label","data-error":!!n,className:Pe("data-[error=true]:text-destructive",e),htmlFor:o,...t})}function Te({className:e,...t}){const{error:n,formMessageId:o}=r0(),r=n?String(n?.message):t.children;return r?c.jsx("p",{"data-slot":"form-message",id:o,className:Pe("text-destructive text-sm",e),...t,children:r}):null}function Le({className:e,type:t,...n}){return c.jsx("input",{type:t,"data-slot":"input",className:Pe(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
319
+ */const qG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],a$=Xe("x",qG);function Lw({className:e,error:t,title:n,showReturnToHome:o}){const{user:r,isLoading:i}=hl();return xu(r),c.jsxs(Lf,{className:Pe("text-red p-5 border border-red rounded-md m-12 mt-36",e),children:[c.jsxs(Wg,{children:[c.jsx(Xg,{className:"text-2xl",children:c.jsx("h2",{children:n??"Component Error"})}),c.jsx(Pw,{children:t.message})]}),o!==!1&&c.jsx(Ff,{children:r&&!i?c.jsx(Ke,{to:ca,children:c.jsxs(_e,{children:[" ",c.jsx(nl,{})," Return to Home"]})}):c.jsx(Ke,{to:"/sign-in",children:c.jsxs(_e,{children:[" ",c.jsx(nl,{})," Go to Sign In Page"]})})})]})}function GG(){const{user:e,isLoading:t}=hl();return xu(e),c.jsx("div",{className:"flex items-center justify-center h-screen px-3",children:c.jsxs(Lf,{className:"text-red p-5 border border-red rounded-md w-full max-w-md",children:[c.jsx(Wg,{children:c.jsx(Xg,{className:"text-2xl",children:c.jsx("h2",{children:"Sorry, Page Not Found"})})}),c.jsx(Ff,{children:e&&!t?c.jsx(Ke,{to:ca,children:c.jsxs(_e,{children:[" ",c.jsx(nl,{})," Return to Home"]})}):c.jsx(Ke,{to:"/sign-in",children:c.jsxs(_e,{children:[" ",c.jsx(nl,{})," Go Sign In Page"]})})})]})})}function KG(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function ZG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const YG=e=>{switch(e){case"success":return QG;case"info":return e7;case"warning":return JG;case"error":return t7;default:return null}},WG=Array(12).fill(0),XG=({visible:e,className:t})=>q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},q.createElement("div",{className:"sonner-spinner"},WG.map((n,o)=>q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),QG=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),JG=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e7=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t7=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n7=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r7=()=>{const[e,t]=q.useState(document.hidden);return q.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let pS=1;class o7{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:o,...r}=t,i=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:pS++,a=this.toasts.find(f=>f.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(f=>f.id===i?(this.publish({...f,...t,id:i,title:o}),{...f,...t,id:i,dismissible:u,title:o}):f):this.addToast({title:o,...r,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let i=o!==void 0,a;const u=r.then(async m=>{if(a=["resolve",m],q.isValidElement(m))i=!1,this.create({id:o,type:"default",message:m});else if(s7(m)&&!m.ok){i=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${m.status}`):n.description,x=typeof g=="object"&&!q.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:v,...x})}else if(m instanceof Error){i=!1;const g=typeof n.error=="function"?await n.error(m):n.error,v=typeof n.description=="function"?await n.description(m):n.description,x=typeof g=="object"&&!q.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:v,...x})}else if(n.success!==void 0){i=!1;const g=typeof n.success=="function"?await n.success(m):n.success,v=typeof n.description=="function"?await n.description(m):n.description,x=typeof g=="object"&&!q.isValidElement(g)?g:{message:g};this.create({id:o,type:"success",description:v,...x})}}).catch(async m=>{if(a=["reject",m],n.error!==void 0){i=!1;const p=typeof n.error=="function"?await n.error(m):n.error,g=typeof n.description=="function"?await n.description(m):n.description,b=typeof p=="object"&&!q.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:g,...b})}}).finally(()=>{i&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((m,p)=>u.then(()=>a[0]==="reject"?p(a[1]):m(a[1])).catch(p));return typeof o!="string"&&typeof o!="number"?{unwrap:f}:Object.assign(o,{unwrap:f})},this.custom=(t,n)=>{const o=n?.id||pS++;return this.create({jsx:t(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Dr=new o7,i7=(e,t)=>{const n=t?.id||pS++;return Dr.addToast({title:e,...t,id:n}),n},s7=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",a7=i7,l7=()=>Dr.toasts,c7=()=>Dr.getActiveToasts(),Se=Object.assign(a7,{success:Dr.success,info:Dr.info,warning:Dr.warning,error:Dr.error,custom:Dr.custom,message:Dr.message,promise:Dr.promise,dismiss:Dr.dismiss,loading:Dr.loading},{getHistory:l7,getToasts:c7});ZG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Wh(e){return e.label!==void 0}const u7=3,d7="24px",f7="16px",Wk=4e3,m7=356,h7=14,p7=45,g7=200;function pi(...e){return e.filter(Boolean).join(" ")}function v7(e){const[t,n]=e.split("-"),o=[];return t&&o.push(t),n&&o.push(n),o}const y7=e=>{var t,n,o,r,i,a,u,f,m;const{invert:p,toast:g,unstyled:v,interacting:b,setHeights:x,visibleToasts:w,heights:C,index:E,toasts:j,expanded:N,removeToast:O,defaultRichColors:k,closeButton:T,style:A,cancelButtonStyle:$,actionButtonStyle:L,className:G="",descriptionClassName:ae="",duration:re,position:se,gap:ue,expandByDefault:oe,classNames:P,icons:Z,closeButtonAriaLabel:U="Close toast"}=e,[ie,M]=q.useState(null),[V,le]=q.useState(null),[X,H]=q.useState(!1),[fe,me]=q.useState(!1),[ce,pe]=q.useState(!1),[Ne,Re]=q.useState(!1),[Fe,Be]=q.useState(!1),[qt,nn]=q.useState(0),[pr,tr]=q.useState(0),Mt=q.useRef(g.duration||re||Wk),$i=q.useRef(null),rn=q.useRef(null),z=E===0,W=E+1<=w,te=g.type,ve=g.dismissible!==!1,xe=g.className||"",be=g.descriptionClassName||"",je=q.useMemo(()=>C.findIndex(Je=>Je.toastId===g.id)||0,[C,g.id]),Ye=q.useMemo(()=>{var Je;return(Je=g.closeButton)!=null?Je:T},[g.closeButton,T]),ct=q.useMemo(()=>g.duration||re||Wk,[g.duration,re]),St=q.useRef(0),gr=q.useRef(0),vr=q.useRef(0),vo=q.useRef(null),[yo,Or]=se.split("-"),Ar=q.useMemo(()=>C.reduce((Je,dn,xn)=>xn>=je?Je:Je+dn.height,0),[C,je]),Hr=r7(),Ho=g.invert||p,qo=te==="loading";gr.current=q.useMemo(()=>je*ue+Ar,[je,Ar]),q.useEffect(()=>{Mt.current=ct},[ct]),q.useEffect(()=>{H(!0)},[]),q.useEffect(()=>{const Je=rn.current;if(Je){const dn=Je.getBoundingClientRect().height;return tr(dn),x(xn=>[{toastId:g.id,height:dn,position:g.position},...xn]),()=>x(xn=>xn.filter(Xn=>Xn.toastId!==g.id))}},[x,g.id]),q.useLayoutEffect(()=>{if(!X)return;const Je=rn.current,dn=Je.style.height;Je.style.height="auto";const xn=Je.getBoundingClientRect().height;Je.style.height=dn,tr(xn),x(Xn=>Xn.find(Tn=>Tn.toastId===g.id)?Xn.map(Tn=>Tn.toastId===g.id?{...Tn,height:xn}:Tn):[{toastId:g.id,height:xn,position:g.position},...Xn])},[X,g.title,g.description,x,g.id,g.jsx,g.action,g.cancel]);const qr=q.useCallback(()=>{me(!0),nn(gr.current),x(Je=>Je.filter(dn=>dn.toastId!==g.id)),setTimeout(()=>{O(g)},g7)},[g,O,x,gr]);q.useEffect(()=>{if(g.promise&&te==="loading"||g.duration===1/0||g.type==="loading")return;let Je;return N||b||Hr?(()=>{if(vr.current<St.current){const Xn=new Date().getTime()-St.current;Mt.current=Mt.current-Xn}vr.current=new Date().getTime()})():(()=>{Mt.current!==1/0&&(St.current=new Date().getTime(),Je=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),qr()},Mt.current))})(),()=>clearTimeout(Je)},[N,b,g,te,Hr,qr]),q.useEffect(()=>{g.delete&&(qr(),g.onDismiss==null||g.onDismiss.call(g,g))},[qr,g.delete]);function Gt(){var Je;if(Z?.loading){var dn;return q.createElement("div",{className:pi(P?.loader,g==null||(dn=g.classNames)==null?void 0:dn.loader,"sonner-loader"),"data-visible":te==="loading"},Z.loading)}return q.createElement(XG,{className:pi(P?.loader,g==null||(Je=g.classNames)==null?void 0:Je.loader),visible:te==="loading"})}const nr=g.icon||Z?.[te]||YG(te);var li,Nm;return q.createElement("li",{tabIndex:0,ref:rn,className:pi(G,xe,P?.toast,g==null||(t=g.classNames)==null?void 0:t.toast,P?.default,P?.[te],g==null||(n=g.classNames)==null?void 0:n[te]),"data-sonner-toast":"","data-rich-colors":(li=g.richColors)!=null?li:k,"data-styled":!(g.jsx||g.unstyled||v),"data-mounted":X,"data-promise":!!g.promise,"data-swiped":Fe,"data-removed":fe,"data-visible":W,"data-y-position":yo,"data-x-position":Or,"data-index":E,"data-front":z,"data-swiping":ce,"data-dismissible":ve,"data-type":te,"data-invert":Ho,"data-swipe-out":Ne,"data-swipe-direction":V,"data-expanded":!!(N||oe&&X),"data-testid":g.testId,style:{"--index":E,"--toasts-before":E,"--z-index":j.length-E,"--offset":`${fe?qt:gr.current}px`,"--initial-height":oe?"auto":`${pr}px`,...A,...g.style},onDragEnd:()=>{pe(!1),M(null),vo.current=null},onPointerDown:Je=>{Je.button!==2&&(qo||!ve||($i.current=new Date,nn(gr.current),Je.target.setPointerCapture(Je.pointerId),Je.target.tagName!=="BUTTON"&&(pe(!0),vo.current={x:Je.clientX,y:Je.clientY})))},onPointerUp:()=>{var Je,dn,xn;if(Ne||!ve)return;vo.current=null;const Xn=Number(((Je=rn.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ha=Number(((dn=rn.current)==null?void 0:dn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Tn=new Date().getTime()-((xn=$i.current)==null?void 0:xn.getTime()),fn=ie==="x"?Xn:ha,mn=Math.abs(fn)/Tn;if(Math.abs(fn)>=p7||mn>.11){nn(gr.current),g.onDismiss==null||g.onDismiss.call(g,g),le(ie==="x"?Xn>0?"right":"left":ha>0?"down":"up"),qr(),Re(!0);return}else{var Pt,Ln;(Pt=rn.current)==null||Pt.style.setProperty("--swipe-amount-x","0px"),(Ln=rn.current)==null||Ln.style.setProperty("--swipe-amount-y","0px")}Be(!1),pe(!1),M(null)},onPointerMove:Je=>{var dn,xn,Xn;if(!vo.current||!ve||((dn=window.getSelection())==null?void 0:dn.toString().length)>0)return;const Tn=Je.clientY-vo.current.y,fn=Je.clientX-vo.current.x;var mn;const Pt=(mn=e.swipeDirections)!=null?mn:v7(se);!ie&&(Math.abs(fn)>1||Math.abs(Tn)>1)&&M(Math.abs(fn)>Math.abs(Tn)?"x":"y");let Ln={x:0,y:0};const Tl=Mi=>1/(1.5+Math.abs(Mi)/20);if(ie==="y"){if(Pt.includes("top")||Pt.includes("bottom"))if(Pt.includes("top")&&Tn<0||Pt.includes("bottom")&&Tn>0)Ln.y=Tn;else{const Mi=Tn*Tl(Tn);Ln.y=Math.abs(Mi)<Math.abs(Tn)?Mi:Tn}}else if(ie==="x"&&(Pt.includes("left")||Pt.includes("right")))if(Pt.includes("left")&&fn<0||Pt.includes("right")&&fn>0)Ln.x=fn;else{const Mi=fn*Tl(fn);Ln.x=Math.abs(Mi)<Math.abs(fn)?Mi:fn}(Math.abs(Ln.x)>0||Math.abs(Ln.y)>0)&&Be(!0),(xn=rn.current)==null||xn.style.setProperty("--swipe-amount-x",`${Ln.x}px`),(Xn=rn.current)==null||Xn.style.setProperty("--swipe-amount-y",`${Ln.y}px`)}},Ye&&!g.jsx&&te!=="loading"?q.createElement("button",{"aria-label":U,"data-disabled":qo,"data-close-button":!0,onClick:qo||!ve?()=>{}:()=>{qr(),g.onDismiss==null||g.onDismiss.call(g,g)},className:pi(P?.closeButton,g==null||(o=g.classNames)==null?void 0:o.closeButton)},(Nm=Z?.close)!=null?Nm:n7):null,(te||g.icon||g.promise)&&g.icon!==null&&(Z?.[te]!==null||g.icon)?q.createElement("div",{"data-icon":"",className:pi(P?.icon,g==null||(r=g.classNames)==null?void 0:r.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Gt():null,g.type!=="loading"?nr:null):null,q.createElement("div",{"data-content":"",className:pi(P?.content,g==null||(i=g.classNames)==null?void 0:i.content)},q.createElement("div",{"data-title":"",className:pi(P?.title,g==null||(a=g.classNames)==null?void 0:a.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?q.createElement("div",{"data-description":"",className:pi(ae,be,P?.description,g==null||(u=g.classNames)==null?void 0:u.description)},typeof g.description=="function"?g.description():g.description):null),q.isValidElement(g.cancel)?g.cancel:g.cancel&&Wh(g.cancel)?q.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||$,onClick:Je=>{Wh(g.cancel)&&ve&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Je),qr())},className:pi(P?.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,q.isValidElement(g.action)?g.action:g.action&&Wh(g.action)?q.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||L,onClick:Je=>{Wh(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Je),!Je.defaultPrevented&&qr())},className:pi(P?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function Xk(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function b7(e,t){const n={};return[e,t].forEach((o,r)=>{const i=r===1,a=i?"--mobile-offset":"--offset",u=i?f7:d7;function f(m){["top","right","bottom","left"].forEach(p=>{n[`${a}-${p}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?f(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?n[`${a}-${m}`]=u:n[`${a}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):f(u)}),n}const x7=q.forwardRef(function(t,n){const{id:o,invert:r,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:f,className:m,offset:p,mobileOffset:g,theme:v="light",richColors:b,duration:x,style:w,visibleToasts:C=u7,toastOptions:E,dir:j=Xk(),gap:N=h7,icons:O,containerAriaLabel:k="Notifications"}=t,[T,A]=q.useState([]),$=q.useMemo(()=>o?T.filter(X=>X.toasterId===o):T.filter(X=>!X.toasterId),[T,o]),L=q.useMemo(()=>Array.from(new Set([i].concat($.filter(X=>X.position).map(X=>X.position)))),[$,i]),[G,ae]=q.useState([]),[re,se]=q.useState(!1),[ue,oe]=q.useState(!1),[P,Z]=q.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=q.useRef(null),ie=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=q.useRef(null),V=q.useRef(!1),le=q.useCallback(X=>{A(H=>{var fe;return(fe=H.find(me=>me.id===X.id))!=null&&fe.delete||Dr.dismiss(X.id),H.filter(({id:me})=>me!==X.id)})},[]);return q.useEffect(()=>Dr.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{A(H=>H.map(fe=>fe.id===X.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{Ow.flushSync(()=>{A(H=>{const fe=H.findIndex(me=>me.id===X.id);return fe!==-1?[...H.slice(0,fe),{...H[fe],...X},...H.slice(fe+1)]:[X,...H]})})})}),[T]),q.useEffect(()=>{if(v!=="system"){Z(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:H})=>{Z(H?"dark":"light")})}catch{X.addListener(({matches:fe})=>{try{Z(fe?"dark":"light")}catch(me){console.error(me)}})}},[v]),q.useEffect(()=>{T.length<=1&&se(!1)},[T]),q.useEffect(()=>{const X=H=>{var fe;if(a.every(pe=>H[pe]||H.code===pe)){var ce;se(!0),(ce=U.current)==null||ce.focus()}H.code==="Escape"&&(document.activeElement===U.current||(fe=U.current)!=null&&fe.contains(document.activeElement))&&se(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[a]),q.useEffect(()=>{if(U.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,V.current=!1)}},[U.current]),q.createElement("section",{ref:n,"aria-label":`${k} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((X,H)=>{var fe;const[me,ce]=X.split("-");return $.length?q.createElement("ol",{key:X,dir:j==="auto"?Xk():j,tabIndex:-1,ref:U,className:m,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":me,"data-x-position":ce,style:{"--front-toast-height":`${((fe=G[0])==null?void 0:fe.height)||0}px`,"--width":`${m7}px`,"--gap":`${N}px`,...w,...b7(p,g)},onBlur:pe=>{V.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(V.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||V.current||(V.current=!0,M.current=pe.relatedTarget)},onMouseEnter:()=>se(!0),onMouseMove:()=>se(!0),onMouseLeave:()=>{ue||se(!1)},onDragEnd:()=>se(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||oe(!0)},onPointerUp:()=>oe(!1)},$.filter(pe=>!pe.position&&H===0||pe.position===X).map((pe,Ne)=>{var Re,Fe;return q.createElement(y7,{key:pe.id,icons:O,index:Ne,toast:pe,defaultRichColors:b,duration:(Re=E?.duration)!=null?Re:x,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:r,visibleToasts:C,closeButton:(Fe=E?.closeButton)!=null?Fe:f,interacting:ue,position:X,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:le,toasts:$.filter(Be=>Be.position==pe.position),heights:G.filter(Be=>Be.position==pe.position),setHeights:ae,expandByDefault:u,gap:N,expanded:re,swipeDirections:t.swipeDirections})})):null}))});function Qk(e){let t="Error",n="We had some trouble!";console.error(e);const o=e,r=e;if(typeof e=="string"?n=e:o?.response?.data?typeof o.response.data=="string"?n=o.response.data:o.response.data.error?n=o.response.data.error:o.response.data.message&&(n=o.response.data.message):r?.message&&(n=r.message),n.includes(":")){const i=n.split(":");t=i.shift(),n=i.join(":")}Se.error(t,{description:n,action:{label:"Dismiss",onClick:()=>Se.dismiss()}})}const gf=new kH({queryCache:new dI({onError:Qk}),mutationCache:new uI({onError:Qk})});function _7(e,t){const n=_.createContext(t),o=i=>{const{children:a,...u}=i,f=_.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:f,children:a})};o.displayName=e+"Provider";function r(i){const a=_.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function si(e,t=[]){let n=[];function o(i,a){const u=_.createContext(a),f=n.length;n=[...n,a];const m=g=>{const{scope:v,children:b,...x}=g,w=v?.[e]?.[f]||u,C=_.useMemo(()=>x,Object.values(x));return c.jsx(w.Provider,{value:C,children:b})};m.displayName=i+"Provider";function p(g,v){const b=v?.[e]?.[f]||u,x=_.useContext(b);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,p]}const r=()=>{const i=n.map(a=>_.createContext(a));return function(u){const f=u?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return r.scopeName=e,[o,S7(r,...t)]}function S7(...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 a=o.reduce((u,{useScope:f,scopeName:m})=>{const g=f(i)[`__scope${m}`];return{...u,...g}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var w7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=w7.reduce((e,t)=>{const n=tl(`Primitive.${t}`),o=_.forwardRef((r,i)=>{const{asChild:a,...u}=r,f=a?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 eg(e,t){e&&gu.flushSync(()=>e.dispatchEvent(t))}var Rn=globalThis?.document?_.useLayoutEffect:()=>{},C7=fI[" useInsertionEffect ".trim().toString()]||Rn;function Ri({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,a]=E7({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=R7(p)?p(e):p;g!==e&&a.current?.(g)}else i(p)},[u,e,i,a]);return[f,m]}function E7({defaultProp:e,onChange:t}){const[n,o]=_.useState(e),r=_.useRef(n),i=_.useRef(t);return C7(()=>{i.current=t},[t]),_.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function R7(e){return typeof e=="function"}var j7=_.createContext(void 0);function _u(e){const t=_.useContext(j7);return e||t||"ltr"}function N7(e,t){return _.useReducer((n,o)=>t[n][o]??n,e)}var Dn=e=>{const{present:t,children:n}=e,o=k7(t),r=typeof n=="function"?n({present:o.isPresent}):_.Children.only(n),i=ut(o.ref,T7(r));return typeof n=="function"||o.isPresent?_.cloneElement(r,{ref:i}):null};Dn.displayName="Presence";function k7(e){const[t,n]=_.useState(),o=_.useRef(null),r=_.useRef(e),i=_.useRef("none"),a=e?"mounted":"unmounted",[u,f]=N7(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const m=Xh(o.current);i.current=u==="mounted"?m:"none"},[u]),Rn(()=>{const m=o.current,p=r.current;if(p!==e){const v=i.current,b=Xh(m);e?f("MOUNT"):b==="none"||m?.display==="none"?f("UNMOUNT"):f(p&&v!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,f]),Rn(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=b=>{const w=Xh(o.current).includes(CSS.escape(b.animationName));if(b.target===t&&w&&(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=b=>{b.target===t&&(i.current=Xh(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 Xh(e){return e?.animationName||"none"}function T7(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 O7=fI[" useId ".trim().toString()]||(()=>{}),A7=0;function ao(e){const[t,n]=_.useState(O7());return Rn(()=>{n(o=>o??String(A7++))},[e]),t?`radix-${t}`:""}function Vf(e){const t=e+"CollectionProvider",[n,o]=si(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=w=>{const{scope:C,children:E}=w,j=q.useRef(null),N=q.useRef(new Map).current;return c.jsx(r,{scope:C,itemMap:N,collectionRef:j,children:E})};a.displayName=t;const u=e+"CollectionSlot",f=tl(u),m=q.forwardRef((w,C)=>{const{scope:E,children:j}=w,N=i(u,E),O=ut(C,N.collectionRef);return c.jsx(f,{ref:O,children:j})});m.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=tl(p),b=q.forwardRef((w,C)=>{const{scope:E,children:j,...N}=w,O=q.useRef(null),k=ut(C,O),T=i(p,E);return q.useEffect(()=>(T.itemMap.set(O,{ref:O,...N}),()=>void T.itemMap.delete(O))),c.jsx(v,{[g]:"",ref:k,children:j})});b.displayName=p;function x(w){const C=i(e+"CollectionConsumer",w);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((T,A)=>N.indexOf(T.ref.current)-N.indexOf(A.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:m,ItemSlot:b},x,o]}function Zt(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}function I7(e,t=globalThis?.document){const n=Zt(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 $7="DismissableLayer",gS="dismissableLayer.update",M7="dismissableLayer.pointerDownOutside",P7="dismissableLayer.focusOutside",Jk,l$=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Su=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:a,onDismiss:u,...f}=e,m=_.useContext(l$),[p,g]=_.useState(null),v=p?.ownerDocument??globalThis?.document,[,b]=_.useState({}),x=ut(t,A=>g(A)),w=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(C),j=p?w.indexOf(p):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,O=j>=E,k=U7(A=>{const $=A.target,L=[...m.branches].some(G=>G.contains($));!O||L||(r?.(A),a?.(A),A.defaultPrevented||u?.())},v),T=L7(A=>{const $=A.target;[...m.branches].some(G=>G.contains($))||(i?.(A),a?.(A),A.defaultPrevented||u?.())},v);return I7(A=>{j===m.layers.size-1&&(o?.(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))},v),_.useEffect(()=>{if(p)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Jk=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),eT(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Jk)}},[p,v,n,m]),_.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),eT())},[p,m]),_.useEffect(()=>{const A=()=>b({});return document.addEventListener(gS,A),()=>document.removeEventListener(gS,A)},[]),c.jsx(Ue.div,{...f,ref:x,style:{pointerEvents:N?O?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,k.onPointerDownCapture)})});Su.displayName=$7;var D7="DismissableLayerBranch",z7=_.forwardRef((e,t)=>{const n=_.useContext(l$),o=_.useRef(null),r=ut(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})});z7.displayName=D7;function U7(e,t=globalThis?.document){const n=Zt(e),o=_.useRef(!1),r=_.useRef(()=>{});return _.useEffect(()=>{const i=u=>{if(u.target&&!o.current){let f=function(){c$(M7,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},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function L7(e,t=globalThis?.document){const n=Zt(e),o=_.useRef(!1);return _.useEffect(()=>{const r=i=>{i.target&&!o.current&&c$(P7,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 eT(){const e=new CustomEvent(gS);document.dispatchEvent(e)}function c$(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?eg(r,i):r.dispatchEvent(i)}function u$(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 d$=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"}),F7="VisuallyHidden",f$=_.forwardRef((e,t)=>c.jsx(Ue.span,{...e,ref:t,style:{...d$,...e.style}}));f$.displayName=F7;var m$=f$,pl="NavigationMenu",[Fw,h$,V7]=Vf(pl),[vS,B7,H7]=Vf(pl),[Vw]=si(pl,[V7,H7]),[q7,Lo]=Vw(pl),[G7,K7]=Vw(pl),p$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,delayDuration:a=200,skipDelayDuration:u=300,orientation:f="horizontal",dir:m,...p}=e,[g,v]=_.useState(null),b=ut(t,L=>v(L)),x=_u(m),w=_.useRef(0),C=_.useRef(0),E=_.useRef(0),[j,N]=_.useState(!0),[O,k]=Ri({prop:o,onChange:L=>{const G=L!=="",ae=u>0;G?(window.clearTimeout(E.current),ae&&N(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>N(!0),u)),r?.(L)},defaultProp:i??"",caller:pl}),T=_.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>k(""),150)},[k]),A=_.useCallback(L=>{window.clearTimeout(C.current),k(L)},[k]),$=_.useCallback(L=>{O===L?window.clearTimeout(C.current):w.current=window.setTimeout(()=>{window.clearTimeout(C.current),k(L)},a)},[O,k,a]);return _.useEffect(()=>()=>{window.clearTimeout(w.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),c.jsx(g$,{scope:n,isRootMenu:!0,value:O,dir:x,orientation:f,rootNavigationMenu:g,onTriggerEnter:L=>{window.clearTimeout(w.current),j?$(L):A(L)},onTriggerLeave:()=>{window.clearTimeout(w.current),T()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:T,onItemSelect:L=>{k(G=>G===L?"":L)},onItemDismiss:()=>k(""),children:c.jsx(Ue.nav,{"aria-label":"Main","data-orientation":f,dir:x,...p,ref:b})})});p$.displayName=pl;var yS="NavigationMenuSub",Z7=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,orientation:a="horizontal",...u}=e,f=Lo(yS,n),[m,p]=Ri({prop:o,onChange:r,defaultProp:i??"",caller:yS});return c.jsx(g$,{scope:n,isRootMenu:!1,value:m,dir:f.dir,orientation:a,rootNavigationMenu:f.rootNavigationMenu,onTriggerEnter:g=>p(g),onItemSelect:g=>p(g),onItemDismiss:()=>p(""),children:c.jsx(Ue.div,{"data-orientation":a,...u,ref:t})})});Z7.displayName=yS;var g$=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:o,dir:r,orientation:i,children:a,value:u,onItemSelect:f,onItemDismiss:m,onTriggerEnter:p,onTriggerLeave:g,onContentEnter:v,onContentLeave:b}=e,[x,w]=_.useState(null),[C,E]=_.useState(new Map),[j,N]=_.useState(null);return c.jsx(q7,{scope:t,isRootMenu:n,rootNavigationMenu:o,value:u,previousValue:u$(u),baseId:ao(),dir:r,orientation:i,viewport:x,onViewportChange:w,indicatorTrack:j,onIndicatorTrackChange:N,onTriggerEnter:Zt(p),onTriggerLeave:Zt(g),onContentEnter:Zt(v),onContentLeave:Zt(b),onItemSelect:Zt(f),onItemDismiss:Zt(m),onViewportContentChange:_.useCallback((O,k)=>{E(T=>(T.set(O,k),new Map(T)))},[]),onViewportContentRemove:_.useCallback(O=>{E(k=>k.has(O)?(k.delete(O),new Map(k)):k)},[]),children:c.jsx(Fw.Provider,{scope:t,children:c.jsx(G7,{scope:t,items:C,children:a})})})},v$="NavigationMenuList",y$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Lo(v$,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(Fw.Slot,{scope:n,children:r.isRootMenu?c.jsx(E$,{asChild:!0,children:i}):i})})});y$.displayName=v$;var b$="NavigationMenuItem",[Y7,x$]=Vw(b$),_$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,...r}=e,i=ao(),a=o||i||"LEGACY_REACT_AUTO_VALUE",u=_.useRef(null),f=_.useRef(null),m=_.useRef(null),p=_.useRef(()=>{}),g=_.useRef(!1),v=_.useCallback((x="start")=>{if(u.current){p.current();const w=xS(u.current);w.length&&qw(x==="start"?w:w.reverse())}},[]),b=_.useCallback(()=>{if(u.current){const x=xS(u.current);x.length&&(p.current=iK(x))}},[]);return c.jsx(Y7,{scope:n,value:a,triggerRef:f,contentRef:u,focusProxyRef:m,wasEscapeCloseRef:g,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:b,onContentFocusOutside:b,children:c.jsx(Ue.li,{...r,ref:t})})});_$.displayName=b$;var bS="NavigationMenuTrigger",W7=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:o,...r}=e,i=Lo(bS,e.__scopeNavigationMenu),a=x$(bS,e.__scopeNavigationMenu),u=_.useRef(null),f=ut(u,a.triggerRef,t),m=j$(i.baseId,a.value),p=N$(i.baseId,a.value),g=_.useRef(!1),v=_.useRef(!1),b=a.value===i.value;return c.jsxs(c.Fragment,{children:[c.jsx(Fw.ItemSlot,{scope:n,value:a.value,children:c.jsx(R$,{asChild:!0,children:c.jsx(Ue.button,{id:m,disabled:o,"data-disabled":o?"":void 0,"data-state":Gw(b),"aria-expanded":b,"aria-controls":p,...r,ref:f,onPointerEnter:Ce(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:Ce(e.onPointerMove,tg(()=>{o||v.current||a.wasEscapeCloseRef.current||g.current||(i.onTriggerEnter(a.value),g.current=!0)})),onPointerLeave:Ce(e.onPointerLeave,tg(()=>{o||(i.onTriggerLeave(),g.current=!1)})),onClick:Ce(e.onClick,()=>{i.onItemSelect(a.value),v.current=b}),onKeyDown:Ce(e.onKeyDown,x=>{const C={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];b&&x.key===C&&(a.onEntryKeyDown(),x.preventDefault())})})})}),b&&c.jsxs(c.Fragment,{children:[c.jsx(m$,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const w=a.contentRef.current,C=x.relatedTarget,E=C===u.current,j=w?.contains(C);(E||!j)&&a.onFocusProxyEnter(E?"start":"end")}}),i.viewport&&c.jsx("span",{"aria-owns":p})]})]})});W7.displayName=bS;var X7="NavigationMenuLink",tT="navigationMenu.linkSelect",S$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:o,onSelect:r,...i}=e;return c.jsx(R$,{asChild:!0,children:c.jsx(Ue.a,{"data-active":o?"":void 0,"aria-current":o?"page":void 0,...i,ref:t,onClick:Ce(e.onClick,a=>{const u=a.target,f=new CustomEvent(tT,{bubbles:!0,cancelable:!0});if(u.addEventListener(tT,m=>r?.(m),{once:!0}),eg(u,f),!f.defaultPrevented&&!a.metaKey){const m=new CustomEvent(Tp,{bubbles:!0,cancelable:!0});eg(u,m)}},{checkForDefaultPrevented:!1})})})});S$.displayName=X7;var Bw="NavigationMenuIndicator",Q7=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Lo(Bw,e.__scopeNavigationMenu),i=!!r.value;return r.indicatorTrack?Ow.createPortal(c.jsx(Dn,{present:n||i,children:c.jsx(J7,{...o,ref:t})}),r.indicatorTrack):null});Q7.displayName=Bw;var J7=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Lo(Bw,n),i=h$(n),[a,u]=_.useState(null),[f,m]=_.useState(null),p=r.orientation==="horizontal",g=!!r.value;_.useEffect(()=>{const x=i().find(w=>w.value===r.value)?.ref.current;x&&u(x)},[i,r.value]);const v=()=>{a&&m({size:p?a.offsetWidth:a.offsetHeight,offset:p?a.offsetLeft:a.offsetTop})};return _S(a,v),_S(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",eK=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Lo(Xc,e.__scopeNavigationMenu),i=x$(Xc,e.__scopeNavigationMenu),a=ut(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(tK,{forceMount:n,...f,ref:a}):c.jsx(Dn,{present:n||u,children:c.jsx(w$,{"data-state":Gw(u),...f,ref:a,onPointerEnter:Ce(e.onPointerEnter,r.onContentEnter),onPointerLeave:Ce(e.onPointerLeave,tg(r.onContentLeave)),style:{pointerEvents:!u&&r.isRootMenu?"none":void 0,...f.style}})})});eK.displayName=Xc;var tK=_.forwardRef((e,t)=>{const n=Lo(Xc,e.__scopeNavigationMenu),{onViewportContentChange:o,onViewportContentRemove:r}=n;return Rn(()=>{o(e.value,{ref:t,...e})},[e,t,o]),Rn(()=>()=>r(e.value),[e.value,r]),null}),Tp="navigationMenu.rootContentDismiss",w$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,triggerRef:r,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:u,onContentFocusOutside:f,...m}=e,p=Lo(Xc,n),g=_.useRef(null),v=ut(g,t),b=j$(p.baseId,o),x=N$(p.baseId,o),w=h$(n),C=_.useRef(null),{onItemDismiss:E}=p;_.useEffect(()=>{const N=g.current;if(p.isRootMenu&&N){const O=()=>{E(),u(),N.contains(document.activeElement)&&r.current?.focus()};return N.addEventListener(Tp,O),()=>N.removeEventListener(Tp,O)}},[p.isRootMenu,e.value,r,E,u]);const j=_.useMemo(()=>{const O=w().map(G=>G.value);p.dir==="rtl"&&O.reverse();const k=O.indexOf(p.value),T=O.indexOf(p.previousValue),A=o===p.value,$=T===O.indexOf(o);if(!A&&!$)return C.current;const L=(()=>{if(k!==T){if(A&&T!==-1)return k>T?"from-end":"from-start";if($&&k!==-1)return k>T?"to-start":"to-end"}return null})();return C.current=L,L},[p.previousValue,p.value,p.dir,w,o]);return c.jsx(E$,{asChild:!0,children:c.jsx(Su,{id:x,"aria-labelledby":b,"data-motion":j,"data-orientation":p.orientation,...m,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const N=new Event(Tp,{bubbles:!0,cancelable:!0});g.current?.dispatchEvent(N)},onFocusOutside:Ce(e.onFocusOutside,N=>{f();const O=N.target;p.rootNavigationMenu?.contains(O)&&N.preventDefault()}),onPointerDownOutside:Ce(e.onPointerDownOutside,N=>{const O=N.target,k=w().some(A=>A.ref.current?.contains(O)),T=p.isRootMenu&&p.viewport?.contains(O);(k||T||!p.isRootMenu)&&N.preventDefault()}),onKeyDown:Ce(e.onKeyDown,N=>{const O=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!O){const T=xS(N.currentTarget),A=document.activeElement,$=T.findIndex(ae=>ae===A),G=N.shiftKey?T.slice(0,$).reverse():T.slice($+1,T.length);qw(G)?N.preventDefault():i.current?.focus()}}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,N=>{a.current=!0})})})}),Hw="NavigationMenuViewport",C$=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,i=!!Lo(Hw,e.__scopeNavigationMenu).value;return c.jsx(Dn,{present:n||i,children:c.jsx(nK,{...o,ref:t})})});C$.displayName=Hw;var nK=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:o,...r}=e,i=Lo(Hw,n),a=ut(t,i.onViewportChange),u=K7(Xc,e.__scopeNavigationMenu),[f,m]=_.useState(null),[p,g]=_.useState(null),v=f?f?.width+"px":void 0,b=f?f?.height+"px":void 0,x=!!i.value,w=x?i.value:i.previousValue;return _S(p,()=>{p&&m({width:p.offsetWidth,height:p.offsetHeight})}),c.jsx(Ue.div,{"data-state":Gw(x),"data-orientation":i.orientation,...r,ref:a,style:{pointerEvents:!x&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":b,...r.style},onPointerEnter:Ce(e.onPointerEnter,i.onContentEnter),onPointerLeave:Ce(e.onPointerLeave,tg(i.onContentLeave)),children:Array.from(u.items).map(([E,{ref:j,forceMount:N,...O}])=>{const k=w===E;return c.jsx(Dn,{present:N||k,children:c.jsx(w$,{...O,ref:Uf(j,T=>{k&&T&&g(T)})})},E)})})}),rK="FocusGroup",E$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=Lo(rK,n);return c.jsx(vS.Provider,{scope:n,children:c.jsx(vS.Slot,{scope:n,children:c.jsx(Ue.div,{dir:r.dir,...o,ref:t})})})}),nT=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],oK="FocusGroupItem",R$=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=B7(n),i=Lo(oK,n);return c.jsx(vS.ItemSlot,{scope:n,children:c.jsx(Ue.button,{...o,ref:t,onKeyDown:Ce(e.onKeyDown,a=>{if(["Home","End",...nT].includes(a.key)){let f=r().map(g=>g.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&f.reverse(),nT.includes(a.key)){const g=f.indexOf(a.currentTarget);f=f.slice(g+1)}setTimeout(()=>qw(f)),a.preventDefault()}})})})});function xS(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 qw(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function iK(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 _S(e,t){const n=Zt(t);Rn(()=>{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 Gw(e){return e?"open":"closed"}function j$(e,t){return`${e}-trigger-${t}`}function N$(e,t){return`${e}-content-${t}`}function tg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var sK=p$,aK=y$,lK=_$,cK=S$,uK=C$;function dK({className:e,...t}){return c.jsx("div",{className:Pe("absolute top-full left-0 isolate z-50 flex justify-center"),children:c.jsx(uK,{"data-slot":"navigation-menu-viewport",className:Pe("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 k$({className:e,children:t,viewport:n=!0,...o}){return c.jsxs(sK,{"data-slot":"navigation-menu","data-viewport":n,className:Pe("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...o,children:[t,n&&c.jsx(dK,{})]})}function ng({className:e,...t}){return c.jsx(lK,{"data-slot":"navigation-menu-item",className:Pe("relative",e),...t})}function rg({className:e,...t}){return c.jsx(cK,{"data-slot":"navigation-menu-link",className:Pe("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 T$({className:e,...t}){return c.jsx(aK,{"data-slot":"navigation-menu-list",className:Pe("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function Qg(e){const{instanceId:t,clusterId:n}=We({strict:!1});return qs({id:wn,operationsUrl:e})}function Bf(e){const{instanceId:t,clusterId:n}=We({strict:!1});return{instanceClient:qs({id:wn,operationsUrl:e}),entityType:"instance"}}function Yn(e){const{instanceId:t,clusterId:n}=We({strict:!1}),o=wn;return{instanceClient:qs({id:o,operationsUrl:e}),entityId:o,entityType:"instance"}}function fK(){localStorage.clear()}function mK(){sessionStorage.clear()}async function hK(){Zn.setUserForEntity(wn,null),gf.getQueryCache().clear(),fK(),mK(),await gf.invalidateQueries({refetchType:"none"})}async function pK(e){await Zn.signOutFromPotentiallyAuthenticatedInstances(),await zf(e)}function gK(){const e=Qg();return lt({mutationFn:()=>pK({instanceClient:e}),onSuccess:hK})}function Hf(e){const{user:t}=vu(),{organizationId:n}=We({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 gl(e){const{user:t}=vu(),{organizationId:n}=We({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 Kw(e,t){const{user:n}=vu(),{organizationId:o,clusterId:r}=We({strict:!1}),i=t??r,a=n?.roles?.[e??o];if(!a?.permission&&!a?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(a.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const u=a.organization.clusters.resources?.find(m=>m.id===i),f=a.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 vK(e){const{clusterId:t,instanceId:n}=We({strict:!1}),{user:o}=ua(n??t),r=o?.role?.permission;return r?r.super_user===!0:!1}function Zw(e){const{clusterId:t,instanceId:n}=We({strict:!1}),{user:o}=ua(n??t),r=o?.role?.permission;return r?r.super_user===!0||r.structure_user===!0:!1}function Dx(e,t,n,o){const{clusterId:r,instanceId:i}=We({strict:!1}),{user:a}=ua(e??i??r),u=a?.role?.permission;return u?u.super_user===!0||u.structure_user===!0?!0:u[t]?.tables?.[n][o]===!0:!1}const yK={className:"text-white"};function bK({signOut:e}){const{user:t}=hl();xu(t);const{organizationId:n}=We({strict:!1}),{update:o}=Hf(n),{view:r}=gl(n),[i,a]=_.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(Ke,{to:ca,children:[c.jsx(Yw,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.7"})]}),c.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:()=>{a(!i)},children:[c.jsx("span",{className:"sr-only",children:i?"Close menu":"Open menu"}),i?c.jsx(a$,{}):c.jsx(o$,{})]})]}),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:[!Hc,!Hc,c.jsxs(Ke,{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(zw,{className:"mr-4"})," Docs"]}),c.jsxs(Ke,{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(r$,{className:"mr-4"})," Sign Out"]})]})]})}function xK({signOut:e}){const{user:t}=hl();xu(t);const{organizationId:n}=We({strict:!1}),{update:o}=Hf(n),{view:r}=gl(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(Ke,{to:ca,children:[c.jsx(Yw,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.7"})]})}),c.jsx(k$,{children:c.jsxs(T$,{className:"text-grey-400",children:[!Hc,!Hc,c.jsx(ng,{children:c.jsx(rg,{asChild:!0,children:c.jsxs(Ke,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(zw,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Docs"})]})})}),c.jsx(ng,{children:c.jsx(rg,{asChild:!0,children:c.jsxs(Ke,{to:void 0,onClick:e,className:"flex-row items-center",children:[c.jsx(r$,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Sign Out"})]})})})]})})]})})}function _K(){return c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(Ke,{to:"/sign-in",children:[c.jsx(Yw,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-beta.7"})]})}),c.jsx(k$,{children:c.jsxs(T$,{className:"text-grey-400",children:[c.jsx(ng,{children:c.jsx(rg,{asChild:!0,children:c.jsxs(Ke,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(zw,{})," ",c.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),c.jsx(ng,{children:c.jsx(rg,{asChild:!0,children:c.jsxs(Ke,{to:"/sign-in",className:"flex-row items-center",activeProps:yK,children:[c.jsx(yG,{})," Sign In"]})})})]})})]})}function Yw(){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 O$(){const{mutate:e}=gK(),t=bn(),{user:n}=hl(),o=cn(),r=_.useCallback(()=>{e(void 0,{onSuccess:async()=>{Se.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Se.dismiss()}}),t({to:"/sign-in"}),o.invalidate()}})},[e,o,t]);return n?c.jsxs(c.Fragment,{children:[c.jsx(bK,{signOut:r}),c.jsx(xK,{signOut:r})]}):c.jsx(_K,{})}function Qh({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 SK(){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(O$,{})}),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(Qh,{title:"Manage All Instances",children:c.jsx("span",{children:"View, create, and delete instances from one location."})}),c.jsx(Qh,{title:"Embedded API Server",children:c.jsx("span",{children:"Harper components give you unlimited application flexibility"})}),c.jsx(Qh,{title:"Fully Managed Cloud & 5G Instances",children:c.jsx("span",{children:"Go from zero to code in minutes."})}),c.jsx(Qh,{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(ms,{})})]})]})}const zd=new Map;function Ws(e){if(!e)return"";if(zd.has(e))return zd.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return zd.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return zd.set(e,""),"";const o=[];for(let a=0;a<n.length;a++){const u=n[a],f=a+1<n.length?n[a+1]:void 0;/^[A-Z]{2,}$/.test(u)&&f==="s"?(o.push(u+"s"),a++):/^[A-Z]$/.test(u)&&f!==void 0&&/^[A-Z]s$/.test(f)?(o.push(u+f),a++):o.push(u)}const i=o.map(wK).join(" ");return zd.set(e,i),i}function wK(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=P9(),{organization:t,instance:n,cluster:o}=Aw({strict:!1}),r=_.useMemo(()=>{const i=e.pathname.split("/").filter(u=>u&&u.length>0),a=[c.jsxs(Ke,{to:"/",children:[c.jsx(dG,{"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=Ws(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"),a.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(Ke,{to:m,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[p,g]}))}return a},[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",La=e=>e instanceof Date,Er=e=>e==null;const A$=e=>typeof e=="object";var Cn=e=>!Er(e)&&!Array.isArray(e)&&A$(e)&&!La(e),I$=e=>Cn(e)&&e.target?qf(e.target)?e.target.checked:e.target.value:e,CK=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,$$=(e,t)=>e.has(CK(t)),EK=e=>{const t=e.constructor&&e.constructor.prototype;return Cn(t)&&t.hasOwnProperty("isPrototypeOf")},Ww=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Lt(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(!(Ww&&(e instanceof Blob||o))&&(n||Cn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!EK(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Lt(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):[],Xw=e=>tv(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ee=(e,t,n)=>{if(!t||!Cn(e))return n;const o=(ev(t)?[t]:Xw(t)).reduce((r,i)=>Er(r)?r:r[i],e);return Vt(o)||o===e?Vt(e[t])?n:e[t]:o},eo=e=>typeof e=="boolean",Rt=(e,t,n)=>{let o=-1;const r=ev(t)?[t]:Xw(t),i=r.length,a=i-1;for(;++o<i;){const u=r[o];let f=n;if(o!==a){const m=e[u];f=Cn(m)||Array.isArray(m)?m:isNaN(+r[o+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const og={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ao={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Qi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Qw=q.createContext(null);Qw.displayName="HookFormContext";const Gf=()=>q.useContext(Qw),RK=e=>{const{children:t,...n}=e;return q.createElement(Qw.Provider,{value:n},t)};var M$=(e,t,n,o=!0)=>{const r={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(r,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Ao.all&&(t._proxyFormState[a]=!o||Ao.all),n&&(n[a]=!0),e[a]}});return r};const nv=typeof window<"u"?q.useLayoutEffect:q.useEffect;function Jw(e){const t=Gf(),{control:n=t.control,disabled:o,name:r,exact:i}=e||{},[a,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(()=>M$(a,n,f.current,!1),[a,n])}var oo=e=>typeof e=="string",P$=(e,t,n,o,r)=>oo(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),SS=e=>Er(e)||!A$(e);function es(e,t,n=new WeakSet){if(SS(e)||SS(t))return e===t;if(La(e)&&La(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 a=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const u=t[i];if(La(a)&&La(u)||Cn(a)&&Cn(u)||Array.isArray(a)&&Array.isArray(u)?!es(a,u,n):a!==u)return!1}}return!0}function jK(e){const t=Gf(),{control:n=t.control,name:o,defaultValue:r,disabled:i,exact:a,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,b]=q.useState(m.current?m.current(g):g);return nv(()=>n._subscribe({name:o,formState:{values:!0},exact:a,callback:x=>{if(!i){const w=P$(o,n._names,x.values||n._formValues,!1,f.current);if(m.current){const C=m.current(w);es(C,p.current)||(b(C),p.current=C)}else b(w)}}}),[n,i,o,a]),q.useEffect(()=>n._removeUnmounted()),v}function NK(e){const t=Gf(),{name:n,disabled:o,control:r=t.control,shouldUnregister:i,defaultValue:a}=e,u=$$(r._names.array,n),f=q.useMemo(()=>Ee(r._formValues,n,Ee(r._defaultValues,n,a)),[r,n,a]),m=jK({control:r,name:n,defaultValue:f,exact:!0}),p=Jw({control:r,name:n,exact:!0}),g=q.useRef(e),v=q.useRef(void 0),b=q.useRef(r.register(n,{...e.rules,value:m,...eo(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]),w=q.useCallback(N=>b.current.onChange({target:{value:I$(N),name:n},type:og.CHANGE}),[n]),C=q.useCallback(()=>b.current.onBlur({target:{value:Ee(r._formValues,n),name:n},type:og.BLUR}),[n,r._formValues]),E=q.useCallback(N=>{const O=Ee(r._fields,n);O&&N&&(O._f.ref={focus:()=>N.focus&&N.focus(),select:()=>N.select&&N.select(),setCustomValidity:k=>N.setCustomValidity(k),reportValidity:()=>N.reportValidity()})},[r._fields,n]),j=q.useMemo(()=>({name:n,value:m,...eo(o)||p.disabled?{disabled:p.disabled||o}:{},onChange:w,onBlur:C,ref:E}),[n,o,p.disabled,w,C,E,m]);return q.useEffect(()=>{const N=r._options.shouldUnregister||i,O=v.current;O&&O!==n&&!u&&r.unregister(O),r.register(n,{...g.current.rules,...eo(g.current.disabled)?{disabled:g.current.disabled}:{}});const k=(T,A)=>{const $=Ee(r._fields,T);$&&$._f&&($._f.mount=A)};if(k(n,!0),N){const T=Lt(Ee(r._options.defaultValues,n));Rt(r._defaultValues,n,T),Vt(Ee(r._formValues,n))&&Rt(r._formValues,n,T)}return!u&&r.register(n),v.current=n,()=>{(u?N&&!r._state.action:N)?r.unregister(n):k(n,!1)}},[n,r,u,i]),q.useEffect(()=>{r._setDisabledField({disabled:o,name:n})},[o,n,r]),q.useMemo(()=>({field:j,formState:p,fieldState:x}),[j,p,x])}const kK=e=>e.render(NK(e));var e0=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},zr=e=>Array.isArray(e)?e:[e],rT=()=>{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=[]}}};function D$(e,t){const n={};for(const o in e)if(e.hasOwnProperty(o)){const r=e[o],i=t[o];if(r&&Cn(r)&&i){const a=D$(r,i);Cn(a)&&(n[o]=a)}else e[o]&&(n[o]=i)}return n}var Sr=e=>Cn(e)&&!Object.keys(e).length,t0=e=>e.type==="file",Wo=e=>typeof e=="function",ig=e=>{if(!Ww)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},z$=e=>e.type==="select-multiple",n0=e=>e.type==="radio",TK=e=>n0(e)||qf(e),zx=e=>ig(e)&&e.isConnected;function OK(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 AK(e){for(const t in e)if(e.hasOwnProperty(t)&&!Vt(e[t]))return!1;return!0}function vn(e,t){const n=Array.isArray(t)?t:ev(t)?[t]:Xw(t),o=n.length===1?e:OK(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(Cn(o)&&Sr(o)||Array.isArray(o)&&AK(o))&&vn(e,n.slice(0,-1)),e}var IK=e=>{for(const t in e)if(Wo(e[t]))return!0;return!1};function U$(e){return Array.isArray(e)||Cn(e)&&!IK(e)}function wS(e,t={}){for(const n in e)U$(e[n])?(t[n]=Array.isArray(e[n])?[]:{},wS(e[n],t[n])):Er(e[n])||(t[n]=!0);return t}function Rc(e,t,n){n||(n=wS(t));for(const o in e)U$(e[o])?Vt(t)||SS(n[o])?n[o]=wS(e[o],Array.isArray(e[o])?[]:{}):Rc(e[o],Er(t)?{}:t[o],n[o]):n[o]=!es(e[o],t[o]);return n}const oT={value:!1,isValid:!1},iT={value:!0,isValid:!0};var L$=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:oT}return oT},F$=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>Vt(e)?e:t?e===""?NaN:e&&+e:n&&oo(e)?new Date(e):o?o(e):e;const sT={isValid:!1,value:null};var V$=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,sT):sT;function aT(e){const t=e.ref;return t0(t)?t.files:n0(t)?V$(e.refs).value:z$(t)?[...t.selectedOptions].map(({value:n})=>n):qf(t)?L$(e.refs).value:F$(Vt(t.value)?e.ref.value:t.value,e)}var $K=(e,t,n,o)=>{const r={};for(const i of e){const a=Ee(t,i);a&&Rt(r,i,a._f)}return{criteriaMode:n,names:[...e],fields:r,shouldUseNativeValidation:o}},sg=e=>e instanceof RegExp,Ud=e=>Vt(e)?e:sg(e)?e.source:Cn(e)?sg(e.value)?e.value.source:e.value:e,Nc=e=>({isOnSubmit:!e||e===Ao.onSubmit,isOnBlur:e===Ao.onBlur,isOnChange:e===Ao.onChange,isOnAll:e===Ao.all,isOnTouch:e===Ao.onTouched});const lT="AsyncFunction";var MK=e=>!!e&&!!e.validate&&!!(Wo(e.validate)&&e.validate.constructor.name===lT||Cn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===lT)),PK=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),CS=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const Pc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Ee(e,r);if(i){const{_f:a,...u}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],r)&&!o)return!0;if(a.ref&&t(a.ref,a.name)&&!o)return!0;if(Pc(u,t))break}else if(Cn(u)&&Pc(u,t))break}}};function cT(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("."),a=Ee(t,i),u=Ee(e,i);if(a&&!Array.isArray(a)&&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 DK=(e,t,n,o)=>{n(e);const{name:r,...i}=e;return Sr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!o||Ao.all))},zK=(e,t,n)=>!e||!t||e===t||zr(e).some(o=>o&&(n?o===t:o.startsWith(t)||t.startsWith(o))),UK=(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,LK=(e,t)=>!tv(Ee(e,t)).length&&vn(e,t),B$=(e,t,n)=>{const o=zr(Ee(e,n));return Rt(o,"root",t[n]),Rt(e,n,o),e};function uT(e,t,n="validate"){if(oo(e)||Array.isArray(e)&&e.every(oo)||eo(e)&&!e)return{type:n,message:oo(e)?e:"",ref:t}}var gc=e=>Cn(e)&&!sg(e)?e:{value:e,message:""},ES=async(e,t,n,o,r,i)=>{const{ref:a,refs:u,required:f,maxLength:m,minLength:p,min:g,max:v,pattern:b,validate:x,name:w,valueAsNumber:C,mount:E}=e._f,j=Ee(n,w);if(!E||t.has(w))return{};const N=u?u[0]:a,O=re=>{r&&N.reportValidity&&(N.setCustomValidity(eo(re)?"":re||""),N.reportValidity())},k={},T=n0(a),A=qf(a),$=T||A,L=(C||t0(a))&&Vt(a.value)&&Vt(j)||ig(a)&&a.value===""||j===""||Array.isArray(j)&&!j.length,G=e0.bind(null,w,o,k),ae=(re,se,ue,oe=Qi.maxLength,P=Qi.minLength)=>{const Z=re?se:ue;k[w]={type:re?oe:P,message:Z,ref:a,...G(re?oe:P,Z)}};if(i?!Array.isArray(j)||!j.length:f&&(!$&&(L||Er(j))||eo(j)&&!j||A&&!L$(u).isValid||T&&!V$(u).isValid)){const{value:re,message:se}=oo(f)?{value:!!f,message:f}:gc(f);if(re&&(k[w]={type:Qi.required,message:se,ref:N,...G(Qi.required,se)},!o))return O(se),k}if(!L&&(!Er(g)||!Er(v))){let re,se;const ue=gc(v),oe=gc(g);if(!Er(j)&&!isNaN(j)){const P=a.valueAsNumber||j&&+j;Er(ue.value)||(re=P>ue.value),Er(oe.value)||(se=P<oe.value)}else{const P=a.valueAsDate||new Date(j),Z=M=>new Date(new Date().toDateString()+" "+M),U=a.type=="time",ie=a.type=="week";oo(ue.value)&&j&&(re=U?Z(j)>Z(ue.value):ie?j>ue.value:P>new Date(ue.value)),oo(oe.value)&&j&&(se=U?Z(j)<Z(oe.value):ie?j<oe.value:P<new Date(oe.value))}if((re||se)&&(ae(!!re,ue.message,oe.message,Qi.max,Qi.min),!o))return O(k[w].message),k}if((m||p)&&!L&&(oo(j)||i&&Array.isArray(j))){const re=gc(m),se=gc(p),ue=!Er(re.value)&&j.length>+re.value,oe=!Er(se.value)&&j.length<+se.value;if((ue||oe)&&(ae(ue,re.message,se.message),!o))return O(k[w].message),k}if(b&&!L&&oo(j)){const{value:re,message:se}=gc(b);if(sg(re)&&!j.match(re)&&(k[w]={type:Qi.pattern,message:se,ref:a,...G(Qi.pattern,se)},!o))return O(se),k}if(x){if(Wo(x)){const re=await x(j,n),se=uT(re,N);if(se&&(k[w]={...se,...G(Qi.validate,se.message)},!o))return O(se.message),k}else if(Cn(x)){let re={};for(const se in x){if(!Sr(re)&&!o)break;const ue=uT(await x[se](j,n),N,se);ue&&(re={...ue,...G(se,ue.message)},O(ue.message),o&&(k[w]=re))}if(!Sr(re)&&(k[w]={ref:N,...re},!o))return k}}return O(!0),k};const FK={mode:Ao.onSubmit,reValidateMode:Ao.onChange,shouldFocusError:!0};function VK(e={}){let t={...FK,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Wo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},o={},r=Cn(t.defaultValues)||Cn(t.values)?Lt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Lt(r),a={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:rT(),state:rT()},b=t.criteriaMode===Ao.all,x=z=>W=>{clearTimeout(m),m=setTimeout(z,W)},w=async z=>{if(!t.disabled&&(p.isValid||g.isValid||z)){const W=t.resolver?Sr((await A()).errors):await L(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(te=>{te&&(W?Rt(n.validatingFields,te,W):vn(n.validatingFields,te))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Sr(n.validatingFields)}))},E=(z,W=[],te,ve,xe=!0,be=!0)=>{if(ve&&te&&!t.disabled){if(a.action=!0,be&&Array.isArray(Ee(o,z))){const je=te(Ee(o,z),ve.argA,ve.argB);xe&&Rt(o,z,je)}if(be&&Array.isArray(Ee(n.errors,z))){const je=te(Ee(n.errors,z),ve.argA,ve.argB);xe&&Rt(n.errors,z,je),LK(n.errors,z)}if((p.touchedFields||g.touchedFields)&&be&&Array.isArray(Ee(n.touchedFields,z))){const je=te(Ee(n.touchedFields,z),ve.argA,ve.argB);xe&&Rt(n.touchedFields,z,je)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Rc(r,i)),v.state.next({name:z,isDirty:ae(z,W),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Rt(i,z,W)},j=(z,W)=>{Rt(n.errors,z,W),v.state.next({errors:n.errors})},N=z=>{n.errors=z,v.state.next({errors:n.errors,isValid:!1})},O=(z,W,te,ve)=>{const xe=Ee(o,z);if(xe){const be=Ee(i,z,Vt(te)?Ee(r,z):te);Vt(be)||ve&&ve.defaultChecked||W?Rt(i,z,W?be:aT(xe._f)):ue(z,be),a.mount&&w()}},k=(z,W,te,ve,xe)=>{let be=!1,je=!1;const Ye={name:z};if(!t.disabled){if(!te||ve){(p.isDirty||g.isDirty)&&(je=n.isDirty,n.isDirty=Ye.isDirty=ae(),be=je!==Ye.isDirty);const ct=es(Ee(r,z),W);je=!!Ee(n.dirtyFields,z),ct?vn(n.dirtyFields,z):Rt(n.dirtyFields,z,!0),Ye.dirtyFields=n.dirtyFields,be=be||(p.dirtyFields||g.dirtyFields)&&je!==!ct}if(te){const ct=Ee(n.touchedFields,z);ct||(Rt(n.touchedFields,z,te),Ye.touchedFields=n.touchedFields,be=be||(p.touchedFields||g.touchedFields)&&ct!==te)}be&&xe&&v.state.next(Ye)}return be?Ye:{}},T=(z,W,te,ve)=>{const xe=Ee(n.errors,z),be=(p.isValid||g.isValid)&&eo(W)&&n.isValid!==W;if(t.delayError&&te?(f=x(()=>j(z,te)),f(t.delayError)):(clearTimeout(m),f=null,te?Rt(n.errors,z,te):vn(n.errors,z)),(te?!es(xe,te):xe)||!Sr(ve)||be){const je={...ve,...be&&eo(W)?{isValid:W}:{},errors:n.errors,name:z};n={...n,...je},v.state.next(je)}},A=async z=>{C(z,!0);const W=await t.resolver(i,t.context,$K(z||u.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return C(z),W},$=async z=>{const{errors:W}=await A(z);if(z)for(const te of z){const ve=Ee(W,te);ve?Rt(n.errors,te,ve):vn(n.errors,te)}else n.errors=W;return W},L=async(z,W,te={valid:!0})=>{for(const ve in z){const xe=z[ve];if(xe){const{_f:be,...je}=xe;if(be){const Ye=u.array.has(be.name),ct=xe._f&&MK(xe._f);ct&&p.validatingFields&&C([be.name],!0);const St=await ES(xe,u.disabled,i,b,t.shouldUseNativeValidation&&!W,Ye);if(ct&&p.validatingFields&&C([be.name]),St[be.name]&&(te.valid=!1,W))break;!W&&(Ee(St,be.name)?Ye?B$(n.errors,St,be.name):Rt(n.errors,be.name,St[be.name]):vn(n.errors,be.name))}!Sr(je)&&await L(je,W,te)}}return te.valid},G=()=>{for(const z of u.unMount){const W=Ee(o,z);W&&(W._f.refs?W._f.refs.every(te=>!zx(te)):!zx(W._f.ref))&&ce(z)}u.unMount=new Set},ae=(z,W)=>!t.disabled&&(z&&W&&Rt(i,z,W),!es(M(),r)),re=(z,W,te)=>P$(z,u,{...a.mount?i:Vt(W)?r:oo(z)?{[z]:W}:W},te,W),se=z=>tv(Ee(a.mount?i:r,z,t.shouldUnregister?Ee(r,z,[]):[])),ue=(z,W,te={})=>{const ve=Ee(o,z);let xe=W;if(ve){const be=ve._f;be&&(!be.disabled&&Rt(i,z,F$(W,be)),xe=ig(be.ref)&&Er(W)?"":W,z$(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(Ye=>Ye===je.value):je.checked=xe===je.value||!!xe)}):be.refs.forEach(je=>je.checked=je.value===xe):t0(be.ref)?be.ref.value="":(be.ref.value=xe,be.ref.type||v.state.next({name:z,values:Lt(i)})))}(te.shouldDirty||te.shouldTouch)&&k(z,xe,te.shouldTouch,te.shouldDirty,!0),te.shouldValidate&&ie(z)},oe=(z,W,te)=>{for(const ve in W){if(!W.hasOwnProperty(ve))return;const xe=W[ve],be=z+"."+ve,je=Ee(o,be);(u.array.has(z)||Cn(xe)||je&&!je._f)&&!La(xe)?oe(be,xe,te):ue(be,xe,te)}},P=(z,W,te={})=>{const ve=Ee(o,z),xe=u.array.has(z),be=Lt(W);Rt(i,z,be),xe?(v.array.next({name:z,values:Lt(i)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&te.shouldDirty&&v.state.next({name:z,dirtyFields:Rc(r,i),isDirty:ae(z,be)})):ve&&!ve._f&&!Er(be)?oe(z,be,te):ue(z,be,te),CS(z,u)&&v.state.next({...n,name:z}),v.state.next({name:a.mount?z:void 0,values:Lt(i)})},Z=async z=>{a.mount=!0;const W=z.target;let te=W.name,ve=!0;const xe=Ee(o,te),be=ct=>{ve=Number.isNaN(ct)||La(ct)&&isNaN(ct.getTime())||es(ct,Ee(i,te,ct))},je=Nc(t.mode),Ye=Nc(t.reValidateMode);if(xe){let ct,St;const gr=W.type?aT(xe._f):I$(z),vr=z.type===og.BLUR||z.type===og.FOCUS_OUT,vo=!PK(xe._f)&&!t.resolver&&!Ee(n.errors,te)&&!xe._f.deps||UK(vr,Ee(n.touchedFields,te),n.isSubmitted,Ye,je),yo=CS(te,u,vr);Rt(i,te,gr),vr?(!W||!W.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(z),f&&f(0)):xe._f.onChange&&xe._f.onChange(z);const Or=k(te,gr,vr),Ar=!Sr(Or)||yo;if(!vr&&v.state.next({name:te,type:z.type,values:Lt(i)}),vo)return(p.isValid||g.isValid)&&(t.mode==="onBlur"?vr&&w():vr||w()),Ar&&v.state.next({name:te,...yo?{}:Or});if(!vr&&yo&&v.state.next({...n}),t.resolver){const{errors:Hr}=await A([te]);if(be(gr),ve){const Ho=cT(n.errors,o,te),qo=cT(Hr,o,Ho.name||te);ct=qo.error,te=qo.name,St=Sr(Hr)}}else C([te],!0),ct=(await ES(xe,u.disabled,i,b,t.shouldUseNativeValidation))[te],C([te]),be(gr),ve&&(ct?St=!1:(p.isValid||g.isValid)&&(St=await L(o,!0)));ve&&(xe._f.deps&&(!Array.isArray(xe._f.deps)||xe._f.deps.length>0)&&ie(xe._f.deps),T(te,St,ct,Or))}},U=(z,W)=>{if(Ee(n.errors,W)&&z.focus)return z.focus(),1},ie=async(z,W={})=>{let te,ve;const xe=zr(z);if(t.resolver){const be=await $(Vt(z)?z:xe);te=Sr(be),ve=z?!xe.some(je=>Ee(be,je)):te}else z?(ve=(await Promise.all(xe.map(async be=>{const je=Ee(o,be);return await L(je&&je._f?{[be]:je}:je)}))).every(Boolean),!(!ve&&!n.isValid)&&w()):ve=te=await L(o);return v.state.next({...!oo(z)||(p.isValid||g.isValid)&&te!==n.isValid?{}:{name:z},...t.resolver||!z?{isValid:te}:{},errors:n.errors}),W.shouldFocus&&!ve&&Pc(o,U,z?xe:u.mount),ve},M=(z,W)=>{let te={...a.mount?i:r};return W&&(te=D$(W.dirtyFields?n.dirtyFields:n.touchedFields,te)),Vt(z)?te:oo(z)?Ee(te,z):z.map(ve=>Ee(te,ve))},V=(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&&zr(z).forEach(W=>vn(n.errors,W)),v.state.next({errors:z?n.errors:{}})},X=(z,W,te)=>{const ve=(Ee(o,z,{_f:{}})._f||{}).ref,xe=Ee(n.errors,z)||{},{ref:be,message:je,type:Ye,...ct}=xe;Rt(n.errors,z,{...ct,...W,ref:ve}),v.state.next({name:z,errors:n.errors,isValid:!1}),te&&te.shouldFocus&&ve&&ve.focus&&ve.focus()},H=(z,W)=>Wo(z)?v.state.subscribe({next:te=>"values"in te&&z(re(void 0,W),te)}):re(z,W,!0),fe=z=>v.state.subscribe({next:W=>{zK(z.name,W.name,z.exact)&&DK(W,z.formState||p,Mt,z.reRenderRoot)&&z.callback({values:{...i},...n,...W,defaultValues:r})}}).unsubscribe,me=z=>(a.mount=!0,g={...g,...z.formState},fe({...z,formState:g})),ce=(z,W={})=>{for(const te of z?zr(z):u.mount)u.mount.delete(te),u.array.delete(te),W.keepValue||(vn(o,te),vn(i,te)),!W.keepError&&vn(n.errors,te),!W.keepDirty&&vn(n.dirtyFields,te),!W.keepTouched&&vn(n.touchedFields,te),!W.keepIsValidating&&vn(n.validatingFields,te),!t.shouldUnregister&&!W.keepDefaultValue&&vn(r,te);v.state.next({values:Lt(i)}),v.state.next({...n,...W.keepDirty?{isDirty:ae()}:{}}),!W.keepIsValid&&w()},pe=({disabled:z,name:W})=>{(eo(z)&&a.mount||z||u.disabled.has(W))&&(z?u.disabled.add(W):u.disabled.delete(W))},Ne=(z,W={})=>{let te=Ee(o,z);const ve=eo(W.disabled)||eo(t.disabled);return Rt(o,z,{...te||{},_f:{...te&&te._f?te._f:{ref:{name:z}},name:z,mount:!0,...W}}),u.mount.add(z),te?pe({disabled:eo(W.disabled)?W.disabled:t.disabled,name:z}):O(z,!0,W.value),{...ve?{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:Z,onBlur:Z,ref:xe=>{if(xe){Ne(z,W),te=Ee(o,z);const be=Vt(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,je=TK(be),Ye=te._f.refs||[];if(je?Ye.find(ct=>ct===be):be===te._f.ref)return;Rt(o,z,{_f:{...te._f,...je?{refs:[...Ye.filter(zx),be,...Array.isArray(Ee(r,z))?[{}]:[]],ref:{type:be.type,name:z}}:{ref:be}}}),O(z,!1,void 0,be)}else te=Ee(o,z,{}),te._f&&(te._f.mount=!1),(t.shouldUnregister||W.shouldUnregister)&&!($$(u.array,z)&&a.action)&&u.unMount.add(z)}}},Re=()=>t.shouldFocusError&&Pc(o,U,u.mount),Fe=z=>{eo(z)&&(v.state.next({disabled:z}),Pc(o,(W,te)=>{const ve=Ee(o,te);ve&&(W.disabled=ve._f.disabled||z,Array.isArray(ve._f.refs)&&ve._f.refs.forEach(xe=>{xe.disabled=ve._f.disabled||z}))},0,!1))},Be=(z,W)=>async te=>{let ve;te&&(te.preventDefault&&te.preventDefault(),te.persist&&te.persist());let xe=Lt(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:be,values:je}=await A();n.errors=be,xe=Lt(je)}else await L(o);if(u.disabled.size)for(const be of u.disabled)vn(xe,be);if(vn(n.errors,"root"),Sr(n.errors)){v.state.next({errors:{}});try{await z(xe,te)}catch(be){ve=be}}else W&&await W({...n.errors},te),Re(),setTimeout(Re);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Sr(n.errors)&&!ve,submitCount:n.submitCount+1,errors:n.errors}),ve)throw ve},qt=(z,W={})=>{Ee(o,z)&&(Vt(W.defaultValue)?P(z,Lt(Ee(r,z))):(P(z,W.defaultValue),Rt(r,z,Lt(W.defaultValue))),W.keepTouched||vn(n.touchedFields,z),W.keepDirty||(vn(n.dirtyFields,z),n.isDirty=W.defaultValue?ae(z,Lt(Ee(r,z))):ae()),W.keepError||(vn(n.errors,z),p.isValid&&w()),v.state.next({...n}))},nn=(z,W={})=>{const te=z?Lt(z):r,ve=Lt(te),xe=Sr(z),be=xe?r:ve;if(W.keepDefaultValues||(r=te),!W.keepValues){if(W.keepDirtyValues){const je=new Set([...u.mount,...Object.keys(Rc(r,i))]);for(const Ye of Array.from(je))Ee(n.dirtyFields,Ye)?Rt(be,Ye,Ee(i,Ye)):P(Ye,Ee(be,Ye))}else{if(Ww&&Vt(z))for(const je of u.mount){const Ye=Ee(o,je);if(Ye&&Ye._f){const ct=Array.isArray(Ye._f.refs)?Ye._f.refs[0]:Ye._f.ref;if(ig(ct)){const St=ct.closest("form");if(St){St.reset();break}}}}if(W.keepFieldsRef)for(const je of u.mount)P(je,Ee(be,je));else o={}}i=t.shouldUnregister?W.keepDefaultValues?Lt(r):{}:Lt(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:""},a.mount=!p.isValid||!!W.keepIsValid||!!W.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:W.keepSubmitCount?n.submitCount:0,isDirty:xe?!1:W.keepDirty?n.isDirty:!!(W.keepDefaultValues&&!es(z,r)),isSubmitted:W.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:xe?{}:W.keepDirtyValues?W.keepDefaultValues&&i?Rc(r,i):n.dirtyFields:W.keepDefaultValues&&z?Rc(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})},pr=(z,W)=>nn(Wo(z)?z(i):z,W),tr=(z,W={})=>{const te=Ee(o,z),ve=te&&te._f;if(ve){const xe=ve.refs?ve.refs[0]:ve.ref;xe.focus&&(xe.focus(),W.shouldSelect&&Wo(xe.select)&&xe.select())}},Mt=z=>{n={...n,...z}},rn={control:{register:Ne,unregister:ce,getFieldState:V,handleSubmit:Be,setError:X,_subscribe:fe,_runSchema:A,_focusError:Re,_getWatch:re,_getDirty:ae,_setValid:w,_setFieldArray:E,_setDisabledField:pe,_setErrors:N,_getFieldArray:se,_reset:nn,_resetDefaultValues:()=>Wo(t.defaultValues)&&t.defaultValues().then(z=>{pr(z,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:Fe,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return i},get _state(){return a},set _state(z){a=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:me,trigger:ie,register:Ne,handleSubmit:Be,watch:H,setValue:P,getValues:M,reset:pr,resetField:qt,clearErrors:le,unregister:ce,setError:X,setFocus:tr,getFieldState:V};return{...rn,formControl:rn}}var Ls=()=>{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)})},Ux=(e,t,n={})=>n.shouldFocus||Vt(n.shouldFocus)?n.focusName||`${e}.${Vt(n.focusIndex)?t:n.focusIndex}.`:"",Lx=(e,t)=>[...e,...zr(t)],Fx=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Vx(e,t,n){return[...e.slice(0,t),...zr(n),...e.slice(t)]}var Bx=(e,t,n)=>Array.isArray(e)?(Vt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Hx=(e,t)=>[...zr(t),...zr(e)];function BK(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 qx=(e,t)=>Vt(t)?[]:BK(e,zr(t).sort((n,o)=>n-o)),Gx=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},dT=(e,t,n)=>(e[t]=n,e);function H$(e){const t=Gf(),{control:n=t.control,name:o,keyName:r="id",shouldUnregister:i,rules:a}=e,[u,f]=q.useState(n._getFieldArray(o)),m=q.useRef(n._getFieldArray(o).map(Ls)),p=q.useRef(u),g=q.useRef(!1);p.current=u,n._names.array.add(o),q.useMemo(()=>a&&n.register(o,a),[n,a,o]),nv(()=>n._subjects.array.subscribe({next:({values:k,name:T})=>{if(T===o||!T){const A=Ee(k,o);Array.isArray(A)&&(f(A),m.current=A.map(Ls))}}}).unsubscribe,[n,o]);const v=q.useCallback(k=>{g.current=!0,n._setFieldArray(o,k)},[n,o]),b=(k,T)=>{const A=zr(Lt(k)),$=Lx(n._getFieldArray(o),A);n._names.focus=Ux(o,$.length-1,T),m.current=Lx(m.current,A.map(Ls)),v($),f($),n._setFieldArray(o,$,Lx,{argA:Fx(k)})},x=(k,T)=>{const A=zr(Lt(k)),$=Hx(n._getFieldArray(o),A);n._names.focus=Ux(o,0,T),m.current=Hx(m.current,A.map(Ls)),v($),f($),n._setFieldArray(o,$,Hx,{argA:Fx(k)})},w=k=>{const T=qx(n._getFieldArray(o),k);m.current=qx(m.current,k),v(T),f(T),!Array.isArray(Ee(n._fields,o))&&Rt(n._fields,o,void 0),n._setFieldArray(o,T,qx,{argA:k})},C=(k,T,A)=>{const $=zr(Lt(T)),L=Vx(n._getFieldArray(o),k,$);n._names.focus=Ux(o,k,A),m.current=Vx(m.current,k,$.map(Ls)),v(L),f(L),n._setFieldArray(o,L,Vx,{argA:k,argB:Fx(T)})},E=(k,T)=>{const A=n._getFieldArray(o);Gx(A,k,T),Gx(m.current,k,T),v(A),f(A),n._setFieldArray(o,A,Gx,{argA:k,argB:T},!1)},j=(k,T)=>{const A=n._getFieldArray(o);Bx(A,k,T),Bx(m.current,k,T),v(A),f(A),n._setFieldArray(o,A,Bx,{argA:k,argB:T},!1)},N=(k,T)=>{const A=Lt(T),$=dT(n._getFieldArray(o),k,A);m.current=[...$].map((L,G)=>!L||G===k?Ls():m.current[G]),v($),f([...$]),n._setFieldArray(o,$,dT,{argA:k,argB:A},!0,!1)},O=k=>{const T=zr(Lt(k));m.current=T.map(Ls),v([...T]),f([...T]),n._setFieldArray(o,[...T],A=>A,{},!0,!1)};return q.useEffect(()=>{if(n._state.action=!1,CS(o,n._names)&&n._subjects.state.next({...n._formState}),g.current&&(!Nc(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Nc(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([o]).then(k=>{const T=Ee(k.errors,o),A=Ee(n._formState.errors,o);(A?!T&&A.type||T&&(A.type!==T.type||A.message!==T.message):T&&T.type)&&(T?Rt(n._formState.errors,o,T):vn(n._formState.errors,o),n._subjects.state.next({errors:n._formState.errors}))});else{const k=Ee(n._fields,o);k&&k._f&&!(Nc(n._options.reValidateMode).isOnSubmit&&Nc(n._options.mode).isOnSubmit)&&ES(k,n._names.disabled,n._formValues,n._options.criteriaMode===Ao.all,n._options.shouldUseNativeValidation,!0).then(T=>!Sr(T)&&n._subjects.state.next({errors:B$(n._formState.errors,T,o)}))}n._subjects.state.next({name:o,values:Lt(n._formValues)}),n._names.focus&&Pc(n._fields,(k,T)=>{if(n._names.focus&&T.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=(T,A)=>{const $=Ee(n._fields,T);$&&$._f&&($._f.mount=A)};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(x,[v,o,n]),append:q.useCallback(b,[v,o,n]),remove:q.useCallback(w,[v,o,n]),insert:q.useCallback(C,[v,o,n]),update:q.useCallback(N,[v,o,n]),replace:q.useCallback(O,[v,o,n]),fields:q.useMemo(()=>u.map((k,T)=>({...k,[r]:m.current[T]||Ls()})),[u,r])}}function Yt(e={}){const t=q.useRef(void 0),n=q.useRef(void 0),[o,r]=q.useState({isDirty:!1,isValidating:!1,isLoading:Wo(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:Wo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Wo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...u}=VK(e);t.current={...u,formState:o}}const i=t.current.control;return i._options=e,nv(()=>{const a=i._subscribe({formState:i._proxyFormState,callback:()=>r({...i._formState}),reRenderRoot:!0});return r(u=>({...u,isReady:!0})),i._formState.isReady=!0,a},[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 a=i._getDirty();a!==o.isDirty&&i._subjects.state.next({isDirty:a})}},[i,o.isDirty]),q.useEffect(()=>{e.values&&!es(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,r(a=>({...a}))):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=M$(o,i),t.current}const Wt=RK,q$=_.createContext({}),G$=_.createContext({});function r0(){const e=_.useContext(q$),t=_.useContext(G$),{getFieldState:n}=Gf(),o=Jw({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}=r0();return c.jsx(Mw,{"data-slot":"form-control",id:n,"aria-describedby":t?`${o} ${r}`:`${o}`,"aria-invalid":!!t,...e})}function De({...e}){return c.jsx(q$,{value:{name:e.name},children:c.jsx(kK,{...e})})}function ke({className:e,...t}){const n=_.useId();return c.jsx(G$,{value:{id:n},children:c.jsx("div",{"data-slot":"form-item",className:Pe("grid gap-2",e),...t})})}var HK="Label",K$=_.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())}}));K$.displayName=HK;var qK=K$;function o0({className:e,...t}){return c.jsx(qK,{"data-slot":"label",className:Pe("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 $e({className:e,...t}){const{error:n,formItemId:o}=r0();return c.jsx(o0,{"data-slot":"form-label","data-error":!!n,className:Pe("data-[error=true]:text-destructive",e),htmlFor:o,...t})}function Te({className:e,...t}){const{error:n,formMessageId:o}=r0(),r=n?String(n?.message):t.children;return r?c.jsx("p",{"data-slot":"form-message",id:o,className:Pe("text-destructive text-sm",e),...t,children:r}):null}function Le({className:e,type:t,...n}){return c.jsx("input",{type:t,"data-slot":"input",className:Pe(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
320
320
  selection:text-primary-foreground
321
321
  dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
322
322
  dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
@@ -354,7 +354,7 @@ ${g}`,x=>{n.notifyAfterAddMessage(x-v)})}function u(g){return g!==void 0&&r[g]!=
354
354
  `);r={};const b=Dee(g.reason),x=b?t.sendOnExit:t.send;if(b&&e.isAsync){const w=e.finishSync();w.outputBytesCount&&x(FT(w));const C=[w.pendingData,v].filter(Boolean).join(`
355
355
  `);C&&x({data:C,bytesCount:Oz(C)})}else v&&e.write(e.isEmpty?v:`
356
356
  ${v}`),e.finish(w=>{x(FT(w))})}return{flushController:n,add:m,upsert:m,stop:i.unsubscribe}}function FT(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 g4({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:o,sessionExpireObservable:r}){const i=o.subscribe(x=>p(x.reason)),a=r.subscribe(()=>p("session_expire")),u=new _t(()=>()=>{i.unsubscribe(),a.unsubscribe()});let f=0,m=0;function p(x){if(m===0)return;const w=m,C=f;m=0,f=0,b(),u.notify({reason:x,messagesCount:w,bytesCount:C})}let g;function v(){g===void 0&&(g=cr(()=>{p("duration_limit")},n))}function b(){Io(g),g=void 0}return{flushObservable:u,get messagesCount(){return m},notifyBeforeAddMessage(x){f+x>=t&&p("bytes_limit"),m+=1,f+=x,v()},notifyAfterAddMessage(x=0){f+=x,m>=e?p("messages_limit"):f>=t&&p("bytes_limit")},notifyAfterRemoveMessage(x){f-=x,m-=1,m===0&&b()}}}const ia="DISCARDED",fo="SKIPPED";function zee(){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 a=i(n);if(a===ia)return ia;a!==fo&&r.push(a)}return as(...r)}}}const Qs={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},Uee=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Lee=1,Fee=[bee];let e_;function ku(){return e_||(e_=new Mz(100)),e_}function Vee(e,t,n,o,r,i){const a=new _t,{stop:u}=Hee(t,o,r,i,a),{enabled:f,metricsEnabled:m}=Bee(e,t,n,a);return{stop:u,enabled:f,metricsEnabled:m}}function Bee(e,t,n,o,r=Lee){const i={},a=!Fee.includes(t.site)&&Ba(t.telemetrySampleRate),u={[Qs.LOG]:a,[Qs.CONFIGURATION]:a&&Ba(t.telemetryConfigurationSampleRate),[Qs.USAGE]:a&&Ba(t.telemetryUsageSampleRate),metric:a&&Ba(r)},f=qee(),m=ku();return m.subscribe(({rawEvent:g,metricName:v})=>{if(v&&!u.metric||!u[g.type])return;const b=v||g.status||g.type;let x=i[b];if(x||(x=i[b]=new Set),x.size>=t.maxTelemetryEventsPerPage)return;const w=cm(g);if(x.has(w))return;const C=n.triggerHook(1,{startTime:Pn().relative});if(C===ia)return;const E=p(C,e,g,f);o.notify(E),o4("telemetry",E),x.add(w)}),m.unbuffer(),rJ(nE),{enabled:a,metricsEnabled:u.metric};function p(g,v,b,x){const C={type:"telemetry",date:Pn().timeStamp,service:v,version:"6.21.2",source:"browser",_dd:{format_version:2},telemetry:as(b,{runtime_env:x,connectivity:i4(),sdk_setup:"npm"}),ddtags:n4(t).join(","),experimental_features:Array.from(fee())};return as(C,g)}}function Hee(e,t,n,o,r){const i=[];if(lu()){const a=fm(),u=r.subscribe(f=>a.send("internal_telemetry",f));i.push(u.unsubscribe)}else{const a=[e.rumEndpointBuilder];e.replica&&Gee(e)&&a.push(e.replica.rumEndpointBuilder);const u=p4({encoder:o(4),request:m4(a,e.batchBytesLimit,t),flushController:g4({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new _t}),messageBytesLimit:e.messageBytesLimit});i.push(u.stop);const f=r.subscribe(u.add);i.push(f.unsubscribe)}return{stop:()=>i.forEach(a=>a())}}function qee(){var e;return{is_local_file:((e=ji.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:xg}}function Gee(e){return e.site===r4}function Tu(e,t){MS(xv.debug,e,t),ku().notify({rawEvent:{type:Qs.LOG,message:e,status:"debug",...t}})}function nE(e,t){ku().notify({rawEvent:{type:Qs.LOG,status:"error",...Zee(e),...t}})}function Kee(e){ku().notify({rawEvent:{type:Qs.CONFIGURATION,configuration:e}})}function kv(e,t){ku().notify({rawEvent:{type:Qs.LOG,message:e,status:"debug",...t},metricName:e})}function qn(e){ku().notify({rawEvent:{type:Qs.USAGE,usage:e}})}function Zee(e){if(Sl(e)){const t=um(e);return{error:{kind:t.name,stack:dm(Yee(t))},message:t.message}}return{error:{stack:t4},message:`Uncaught ${cm(e)}`}}function Yee(e){return e.stack=e.stack.filter(t=>!t.url||Uee.some(n=>t.url.startsWith(n))),e}const VT="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.",Wee="SDK initialized on a non-allowed domain.";function Xee(e,t,n=typeof location<"u"?location.origin:""){const o=e.allowedTrackingOrigins;if(!o){if(zJ(n,t)){ot.warn(VT);const i=UJ(t);Tu(VT,{extensionUrl:i||"unknown"})}return!0}const r=Nv(o,n);return r||ot.error(Wee),r}function Pa(e,t,n){const o=Qee(e,t);return{build(r,i){const a=Jee(e,t,r,i,n);return o(a)},trackType:t}}function Qee(e,t){const n=`/api/v2/${t}`,o=e.proxy;if(typeof o=="string"){const i=YC(o);return a=>`${i}?ddforward=${encodeURIComponent(`${n}?${a}`)}`}if(typeof o=="function")return i=>o({path:n,parameters:i});const r=v4(t,e);return i=>`https://${r}${n}?${i}`}function v4(e,t){const{site:n=Ha,internalAnalyticsSubdomain:o}=t;if(e==="logs"&&t.usePciIntake&&n===Ha)return xee;if(o&&n===Ha)return`${o}.${Ha}`;if(n===vee)return`http-intake.logs.${n}`;const r=n.split("."),i=r.pop();return`browser-intake-${r.join("-")}.${i}`}function Jee({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},o,r,{retry:i,encoding:a},u=[]){const f=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.21.2")}`,"dd-evp-origin=browser",`dd-request-id=${mr()}`].concat(u);return a&&f.push(`dd-evp-encoding=${a}`),o==="rum"&&(f.push(`batch_time=${Kn()}`,`_dd.api=${r}`),i&&f.push(`_dd.retry_count=${i.count}`,`_dd.retry_after=${i.lastFailureStatus}`)),t&&f.reverse(),f.join("&")}function ete(e){const t=e.site||Ha,n=tte(e.source),o=nte({...e,site:t,source:n});return{replica:rte({...e,site:t,source:n}),site:t,source:n,...o}}function tte(e){return e==="flutter"||e==="unity"?e:"browser"}function nte(e){return{logsEndpointBuilder:Pa(e,"logs"),rumEndpointBuilder:Pa(e,"rum"),profilingEndpointBuilder:Pa(e,"profile"),sessionReplayEndpointBuilder:Pa(e,"replay"),exposuresEndpointBuilder:Pa(e,"exposures")}}function rte(e){if(!e.replica)return;const t={...e,site:Ha,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Pa(t,"logs"),rumEndpointBuilder:Pa(t,"rum",[`application.id=${e.replica.applicationId}`])}}function ote(e){return _ee.every(t=>e.includes(t))}const Tc={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},US={ALL:"all",SAMPLED:"sampled"};function t_(e,t){return e!=null&&typeof e!="string"?(ot.error(`${t} must be defined as a string`),!1):!0}function ite(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(ot.error(`Site should be a valid Datadog site. ${GC} ${_v}/getting_started/site/.`),!1):!0}function Oc(e,t){return e!==void 0&&!ZQ(e)?(ot.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function ste(e,t){var n,o,r,i,a,u,f,m,p,g;if(!e||!e.clientToken){ot.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){ot.error("Allowed Tracking Origins must be an array");return}if(!(!ite(e.site)||!Oc(e.sessionSampleRate,"Session")||!Oc(e.telemetrySampleRate,"Telemetry")||!Oc(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!Oc(e.telemetryUsageSampleRate,"Telemetry Usage")||!t_(e.version,"Version")||!t_(e.env,"Env")||!t_(e.service,"Service")||!Xee(e,t??""))){if(e.trackingConsent!==void 0&&!bg(PS,e.trackingConsent)){ot.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&Rz(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:xg?void 0:$J(e),sessionSampleRate:(n=e.sessionSampleRate)!==null&&n!==void 0?n:100,telemetrySampleRate:(o=e.telemetrySampleRate)!==null&&o!==void 0?o:20,telemetryConfigurationSampleRate:(r=e.telemetryConfigurationSampleRate)!==null&&r!==void 0?r:5,telemetryUsageSampleRate:(i=e.telemetryUsageSampleRate)!==null&&i!==void 0?i:5,service:(a=e.service)!==null&&a!==void 0?a:void 0,env:(u=e.env)!==null&&u!==void 0?u:void 0,version:(f=e.version)!==null&&f!==void 0?f:void 0,datacenter:(m=e.datacenter)!==null&&m!==void 0?m:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(p=e.trackingConsent)!==null&&p!==void 0?p:PS.GRANTED,trackAnonymousUser:(g=e.trackAnonymousUser)!==null&&g!==void 0?g:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*iu,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*fr,batchMessagesLimit:xg?1:50,messageBytesLimit:256*iu,variant:e.variant,sdkVersion:e.sdkVersion,...ete(e)}}}function ate(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}}function Si(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 a=function(){if(i)return r.apply(this,arguments);const u=Array.from(arguments);let f;Xs(n,null,[{target:this,parameters:u,onPostCall:p=>{f=p},handlingStack:o?Cf("instrumented method"):void 0}]);const m=r.apply(this,u);return f&&Xs(f,null,[m]),m};return e[t]=a,{stop:()=>{i=!0,e[t]===a&&(e[t]=r)}}}function Zxe(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)=>{cr(()=>{i!==r&&n(u,f)},0)};const a=function(u){o.set.call(this,u),i(this,u)};return Object.defineProperty(e,t,{set:a}),{stop:()=>{var u;((u=Object.getOwnPropertyDescriptor(e,t))===null||u===void 0?void 0:u.set)===a&&Object.defineProperty(e,t,o),i=r}}}function lte(){return new _t(e=>{const t=(r,i)=>{const a=JC({stackTrace:i,originalError:r,startClocks:Pn(),nonErrorPrefix:"Uncaught",source:Nu.SOURCE,handling:"unhandled"});e.notify(a)},{stop:n}=cte(t),{stop:o}=ute(t);return()=>{n(),o()}})}function cte(e){return Si(Vo(),"onerror",({parameters:[t,n,o,r,i]})=>{let a;Sl(i)||(a=nee(t,n,o,r)),e(i??t,a)})}function ute(e){return Si(Vo(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function dte(e){const t={version:"6.21.2",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return oJ},enumerable:!1}),t}function fte(e,t,n){const o=e[t];o&&!o.q&&o.version&&ot.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=>Rz(r,"onReady callback threw an error:")())}function y4(e,t){t.silentMultipleInit||ot.error(`${e} is already initialized.`)}const Ef={intervention:"intervention",cspViolation:"csp_violation"};function mte(e,t){const n=[];t.includes(Ef.cspViolation)&&n.push(pte(e));const o=t.filter(r=>r!==Ef.cspViolation);return o.length&&n.push(hte(o)),$z(...n)}function hte(e){return new _t(t=>{if(!window.ReportingObserver)return;const n=et((r,i)=>r.forEach(a=>t.notify(gte(a)))),o=new window.ReportingObserver(n,{types:e,buffered:!0});return o.observe(),()=>{o.disconnect()}})}function pte(e){return new _t(t=>{const{stop:n}=Jt(e,document,"securitypolicyviolation",o=>{t.notify(vte(o))});return n})}function gte(e){const{type:t,body:n}=e;return b4({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:x4(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function vte(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return b4({type:e.effectiveDirective,message:`${Ef.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:x4(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${ZC(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function b4(e){return{startClocks:Pn(),source:Nu.REPORT,handling:"unhandled",...e}}function x4(e,t,n,o,r){return n?dm({name:e,message:t,stack:[{func:"?",url:n,line:o??void 0,column:r??void 0}]}):void 0}function _4(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function lf(e){return Array.isArray(e)&&e.length>0}const sp=1/0,yte=kr;let Vd=null;const Ip=new Set;function bte(){Ip.forEach(e=>e())}function Ou({expireDelay:e,maxEntries:t}){let n=[];Vd||(Vd=Ru(()=>bte(),yte));const o=()=>{const p=uo()-e;for(;n.length>0&&n[n.length-1].endTime<p;)n.pop()};Ip.add(o);function r(p,g){const v={value:p,startTime:g,endTime:sp,remove:()=>{_4(n,v)},close:b=>{v.endTime=b}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function i(p=sp,g={returnInactive:!1}){for(const v of n)if(v.startTime<=p){if(g.returnInactive||p<=v.endTime)return v.value;break}}function a(p){const g=n[0];g&&g.endTime===sp&&g.close(p)}function u(p=sp,g=0){const v=Eu(p,g);return n.filter(b=>b.startTime<=v&&p<=b.endTime).map(b=>b.value)}function f(){n=[]}function m(){Ip.delete(o),Ip.size===0&&Vd&&(wv(Vd),Vd=null)}return{add:r,find:i,closeActive:a,findAll:u,reset:f,stop:m}}const xte="datadog-synthetics-public-id",_te="datadog-synthetics-result-id",Ste="datadog-synthetics-injects-rum";function S4(){return xg?!1:!!(ji._DATADOG_SYNTHETICS_INJECTS_RUM||Bs(Ste))}function w4(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||Bs(xte);return typeof e=="string"?e:void 0}function C4(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||Bs(_te);return typeof e=="string"?e:void 0}function E4(){return!!(w4()&&C4())}const wte=kr,Cte=xl;function Ete(e,t,n,o){const r=new _t,i=new _t,a=PJ(e.sessionStoreStrategyType,e,t,n),u=Ou({expireDelay:Cte});if(a.renewObservable.subscribe(()=>{u.add(f(),uo()),r.notify()}),a.expireObservable.subscribe(()=>{i.notify(),u.closeActive(uo())}),a.expandOrRenewSession(),u.add(f(),kz().relative),ju(ss.SHORT_SESSION_INVESTIGATION)){const m=a.getSession();m&&Tte(e,m)}o.observable.subscribe(()=>{o.isGranted()?a.expandOrRenewSession():a.expire()}),Rte(e,()=>{o.isGranted()&&a.expandOrRenewSession()}),jte(e,()=>a.expandSession()),Nte(e,()=>a.restartSession());function f(){const m=a.getSession();return m?{id:m.id,trackingType:m[t],isReplayForced:!!m.forcedReplay,anonymousId:m.anonymousId}:(kte().catch(()=>{}),{id:"invalid",trackingType:Vz,isReplayForced:!1,anonymousId:void 0})}return{findSession:(m,p)=>u.find(m,p),renewObservable:r,expireObservable:i,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function Rte(e,t){const{stop:n}=oa(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function jte(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:o}=Jt(e,document,"visibilitychange",n);Ru(n,wte)}function Nte(e,t){const{stop:n}=Jt(e,window,"resume",t,{capture:!0})}async function kte(){const e=Kz();Tu("Unexpected session state",{session:e,isSyntheticsTest:E4(),createdTimestamp:e?.created,expireTimestamp:e?.expire,cookie:await R4(),currentDomain:`${window.location.protocol}//${window.location.hostname}`})}function Tte(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),o=jr(),{stop:r}=Jt(e,cookieStore,"change",i);function i(a){const u=Uz(a.changed,m=>m.name===ra);if(!u)return;const f=jr()-n;if(f>14*kr)r();else{const m=QC(u.value);if(m.id&&m.id!==t.id){r();const p=jr()-o;R4().then(g=>{Tu("Session cookie changed",{time:p,session_age:f,old:t,new:m,cookie:g})}).catch(sl)}}}}async function R4(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(ra):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(ra)),{count:e.length,domain:zz()||"undefined",...e}}function Ote(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,o){const r=Oz(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 Ate{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 n_(e,t,n){let o=0,r=!1;return{isLimitReached(){if(o===0&&cr(()=>{o=0},kr),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:Nu.AGENT,startClocks:Pn()})}finally{r=!1}}return!0}}}function rE(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:kt}):Jt(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function Ite(e,t){return new Promise(n=>{rE(e,t,n)})}let r_;const oE=new WeakMap;function $te(e){return r_||(r_=Mte(e)),r_}function Mte(e){return new _t(t=>{const{stop:n}=Si(XMLHttpRequest.prototype,"open",Pte),{stop:o}=Si(XMLHttpRequest.prototype,"send",i=>{Dte(i,e,t)},{computeHandlingStack:!0}),{stop:r}=Si(XMLHttpRequest.prototype,"abort",zte);return()=>{n(),o(),r()}})}function Pte({target:e,parameters:[t,n]}){oE.set(e,{state:"open",method:String(t).toUpperCase(),url:YC(String(n))})}function Dte({target:e,parameters:[t],handlingStack:n},o,r){const i=oE.get(e);if(!i)return;const a=i;a.state="start",a.startClocks=Pn(),a.isAborted=!1,a.xhr=e,a.handlingStack=n,a.body=t;let u=!1;const{stop:f}=Si(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&m()}),m=()=>{if(p(),f(),u)return;u=!0;const g=i;g.state="complete",g.duration=an(a.startClocks.timeStamp,Kn()),g.status=e.status,r.notify(xf(g))},{stop:p}=Jt(o,e,"loadend",m);r.notify(a)}function zte({target:e}){const t=oE.get(e);t&&(t.isAborted=!0)}let o_;function j4(){return o_||(o_=Ute()),o_}function Ute(){return new _t(e=>{if(!ji.fetch)return;const{stop:t}=Si(ji,"fetch",n=>Lte(n,e),{computeHandlingStack:!0});return t})}function Lte({parameters:e,onPostCall:t,handlingStack:n},o){const[r,i]=e;let a=i&&i.method;a===void 0&&r instanceof Request&&(a=r.method);const u=a!==void 0?String(a).toUpperCase():"GET",f=r instanceof Request?r.url:YC(String(r)),m=Pn(),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=>Fte(o,g,p))}function Fte(e,t,n){const o=n;function r(i){o.state="resolve",Object.assign(o,i),e.notify(o)}t.then(et(i=>{r({response:i,responseType:i.type,status:i.status,isAborted:!1})}),et(i=>{var a,u;r({status:0,isAborted:((u=(a=o.init)===null||a===void 0?void 0:a.signal)===null||u===void 0?void 0:u.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function Vte(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(et(e),t);return()=>window.cancelIdleCallback(n)}return Hte(e)}const Bte=50;function Hte(e){const t=jr(),n=cr(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,Bte-(jr()-t))})},0);return()=>Io(n)}const qte=fr,Gte=30;function Kte(){const e=[];function t(o){let r;if(o.didTimeout){const i=performance.now();r=()=>Gte-(performance.now()-i)}else r=o.timeRemaining.bind(o);for(;r()>0&&e.length;)e.shift()();e.length&&n()}function n(){Vte(t,{timeout:qte})}return{push(o){e.push(o)===1&&n()},stop(){e.length=0}}}let i_={};function Zte(e){const t=e.map(n=>(i_[n]||(i_[n]=Yte(n)),i_[n]));return $z(...t)}function Yte(e){return new _t(t=>{const n=ts[e];return ts[e]=(...o)=>{n.apply(console,o);const r=Cf("console error");Xs(()=>{t.notify(Wte(o,e,r))})},()=>{ts[e]=n}})}function Wte(e,t,n){const o=e.map(r=>Xte(r)).join(" ");if(t===xv.error){const r=e.find(Sl),i=JC({originalError:r,handlingStack:n,startClocks:Pn(),source:Nu.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 Xte(e){return typeof e=="string"?Ft(e):Sl(e)?e4(um(e)):cm(Ft(e),void 0,2)}const Qte=500;function Jte(){const e=[];return{add:r=>{e.push(r)>Qte&&e.splice(0,1)},remove:r=>{_4(e,r)},drain:r=>{e.forEach(i=>i(r)),e.length=0}}}function ene(e){const t=_l(e)==="object";return t||ot.error("Unsupported context:",e),t}function s_(e,t,n){const o={...e};for(const[r,{required:i,type:a}]of Object.entries(t))a==="string"&&!BT(o[r])&&(o[r]=String(o[r])),i&&BT(o[r])&&ot.warn(`The property ${r} of ${n} is required; context will not be sent to the intake.`);return o}function BT(e){return e==null||e===""}function Tv(e="",{propertiesConfig:t={}}={}){let n={};const o=new _t,r={getContext:()=>tE(n),setContext:i=>{ene(i)?n=Ft(s_(i,t,e)):r.clearContext(),o.notify()},setContextProperty:(i,a)=>{n=Ft(s_({...n,[i]:a},t,e)),o.notify()},removeContextProperty:i=>{delete n[i],s_(n,t,e),o.notify()},clearContext:()=>{n={},o.notify()},changeObservable:o};return r}function br(e,t,n,o){return et((...r)=>(o&&qn({feature:o}),e()[t][n](...r)))}const tne="_dd_c",nne=[];function iE(e,t,n,o){const r=rne(n,o);nne.push(Jt(e,window,"storage",({key:m})=>{r===m&&a()})),t.changeObservable.subscribe(u);const i=as(f(),t.getContext());bl(i)||t.setContext(i);function a(){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 rne(e,t){return`${tne}_${e}_${t}`}function one(e,t,n){const o=N4();return t.storeContextsAcrossPages&&iE(t,o,n,4),e.register(0,()=>{const r=o.getContext();return bl(r)||!r.id?fo:{account:r}}),o}function N4(){return Tv("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function ine(e,t,n,o){const r=k4();return t.storeContextsAcrossPages&&iE(t,r,n,2),e.register(0,()=>({context:r.getContext()})),r}function k4(){return Tv("global context")}function sne(e,t,n,o){const r=T4();return t.storeContextsAcrossPages&&iE(t,r,o,1),e.register(0,({eventType:i,startTime:a})=>{const u=r.getContext(),f=n.findTrackedSession(a);return f&&f.anonymousId&&!u.anonymous_id&&t.trackAnonymousUser&&(u.anonymous_id=f.anonymousId),bl(u)?fo:{type:i,usr:u}}),e.register(1,({startTime:i})=>{var a;return{anonymous_id:(a=n.findTrackedSession(i))===null||a===void 0?void 0:a.anonymousId}}),r}function T4(){return Tv("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Gn={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},xr={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function ane(e,t,n){const o=e.getReader();let r=0;i();function i(){o.read().then(et(u=>{if(u.done){a();return}r+=u.value.length,r>n.bytesLimit?a():i()}),et(u=>t(u)))}function a(){o.cancel().catch(kt),t(void 0,void 0,void 0)}}const wr={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Ov={FETCH:wr.FETCH,XHR:wr.XHR},lne=500;function cne(e=lte){const t=new Mz(lne),n=e().subscribe(o=>{t.notify({type:0,error:o})});return{observable:t,stop:()=>{n.unsubscribe()}}}function une(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const at={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},O4={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},ns={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},sE={CLICK:"click",CUSTOM:"custom"},Bd={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},Rf={DURATION:"duration",OPERATION_STEP:"operation_step"};function dne(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function fne(e,t,n){function o(a){return!t.wasInPageStateDuringPeriod("frozen",a.startClocks.relative,a.duration)}function r(a){o(a)&&e.notify(12,HT(a))}function i(a,u,f,m){if(!ju(ss.FEATURE_OPERATION_VITAL))return;const{operationKey:p,context:g,description:v}=f||{},b={name:a,type:Rf.OPERATION_STEP,operationKey:p,failureReason:m,stepType:u,startClocks:Pn(),context:Ft(g),description:v};e.notify(12,HT(b))}return{addOperationStepVital:i,addDurationVital:r,startDurationVital:(a,u={})=>A4(n,a,u),stopDurationVital:(a,u={})=>{I4(r,n,a,u)}}}function A4({vitalsByName:e,vitalsByReference:t},n,o={}){const r={name:n,startClocks:Pn(),...o},i={__dd_vital_reference:!0};return e.set(n,r),t.set(i,r),i}function I4(e,{vitalsByName:t,vitalsByReference:n},o,r={}){const i=typeof o=="string"?t.get(o):n.get(o);i&&(e(mne(i,i.startClocks,r,Pn())),typeof o=="string"?t.delete(o):n.delete(o))}function mne(e,t,n,o){var r;return{name:e.name,type:Rf.DURATION,startClocks:t,duration:an(t.timeStamp,o.timeStamp),context:as(e.context,n.context),description:(r=n.description)!==null&&r!==void 0?r:e.description}}function HT(e){const{startClocks:t,type:n,name:o,description:r,context:i}=e,a={id:mr(),type:n,name:o,description:r,...n===Rf.DURATION?{duration:st(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:a,type:at.VITAL,context:i},startTime:t.relative,duration:n===Rf.DURATION?e.duration:void 0,domainContext:{}}}function $4(e,t,n){if(e)for(const o of e){const r=o[t];r&&r(n)}}const qT=new Map;function M4(e,t){if(t===100)return!0;if(t===0)return!1;const n=qT.get(t);if(n&&e===n.sessionId)return n.decision;let o;return window.BigInt?o=hne(BigInt(`0x${e.split("-")[4]}`),t):o=Ba(t),qT.set(t,{sessionId:e,decision:o}),o}function hne(e,t){const n=BigInt("1111111111111111111"),o=BigInt("0x10000000000000000"),r=e*n%o;return Number(r)<=t/100*Number(o)}function pne(){return D4(64)}function P4(){return D4(63)}function D4(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 a=o%n*4294967296+r;o=Math.floor(o/n),r=Math.floor(a/n),i=(a%n).toString(n)+i}while(o||r);return i}}}function yc(e){return e.toString(16).padStart(16,"0")}function gne(e){const t=e;return _l(t)==="object"&&wf(t.match)&&Array.isArray(t.propagatorTypes)}function vne(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function yne(e,t,n,o){return{clearTracingIfNeeded:vne,traceFetch:r=>GT(e,r,t,n,o,i=>{var a;if(r.input instanceof Request&&!(!((a=r.init)===null||a===void 0)&&a.headers))r.input=new Request(r.input),Object.keys(i).forEach(u=>{r.input.headers.append(u,i[u])});else{r.init=xf(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(WC(i))}}),traceXhr:(r,i)=>GT(e,r,t,n,o,a=>{Object.keys(a).forEach(u=>{i.setRequestHeader(u,a[u])})})}}function GT(e,t,n,o,r,i){const a=n.findTrackedSession();if(!a)return;const u=e.allowedTracingUrls.find(p=>Nv([p.match],t.url,!0));if(!u)return;const f=M4(a.id,e.traceSampleRate);(f||e.traceContextInjection===US.ALL)&&(t.traceSampled=f,t.traceId=pne(),t.spanId=P4(),i(bne(t.traceId,t.spanId,t.traceSampled,a.id,u.propagatorTypes,o,r,e)))}function bne(e,t,n,o,r,i,a,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${yc(e)}-${yc(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(f,{b3:`${yc(e)}-${yc(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(f,{"X-B3-TraceId":yc(e),"X-B3-SpanId":yc(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=a.getContext().id;typeof g=="string"&&(m["account.id"]=g);const v=Object.entries(m).map(([b,x])=>`${b}=${encodeURIComponent(x)}`).join(",");v&&(f.baggage=v)}return f}const z4=["tracecontext","datadog"];function xne(e,t){var n,o,r,i,a,u,f;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&ot.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){ot.error("Application ID is not configured, no RUM data will be collected.");return}if(!Oc(e.sessionReplaySampleRate,"Session Replay")||!Oc(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){ot.error("Excluded Activity Urls should be an array");return}const m=_ne(e);if(!m)return;const p=ste(e,t),g=wne(e);if(!p)return;const v=(n=e.sessionReplaySampleRate)!==null&&n!==void 0?n:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:v,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:v===0,traceSampleRate:(o=e.traceSampleRate)!==null&&o!==void 0?o:100,rulePsr:am(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:m,excludedActivityUrls:(r=e.excludedActivityUrls)!==null&&r!==void 0?r:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((i=e.trackUserInteractions)!==null&&i!==void 0)||i),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((a=e.trackResources)!==null&&a!==void 0)||a),trackLongTasks:!!(!((u=e.trackLongTasks)!==null&&u!==void 0)||u),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:bg(Tc,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Tc.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:bg(US,e.traceContextInjection)?e.traceContextInjection:US.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(f=e.profilingSampleRate)!==null&&f!==void 0?f:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:g,...p}}function _ne(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){ot.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){ot.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{wf(n)?t.push({match:n,propagatorTypes:z4}):gne(n)?t.push(n):ot.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function Sne(e){const t=new Set;return lf(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{wf(n)?z4.forEach(o=>t.add(o)):_l(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(o=>t.add(o))}),Array.from(t)}function wne(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return ot.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{wf(n)?t.push({match:n,trackPayload:!1}):n&&typeof n=="object"&&"match"in n&&wf(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload})}),t}function Cne(e){return lf(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function Ene(e){var t;const n=ate(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,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:lf(e.allowedTracingUrls),use_allowed_graph_ql_urls:lf(e.allowedGraphQlUrls),use_track_graph_ql_payload:Cne(e.allowedGraphQlUrls),selected_tracing_propagators:Sne(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:lf(e.excludedActivityUrls),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,track_early_requests:e.trackEarlyRequests,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,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,...n}}function Rne(e){const t=[];let n=0,o;const r={quote:void 0,escapeSequence:void 0};let i="";for(const a of e){if(o=KT[n].find(u=>Ane[u](a,r)),!o)return[];if(r.escapeSequence!==void 0&&o!==12){if(!Mne(r.escapeSequence))return[];i+=Dne(r.escapeSequence),r.escapeSequence=void 0}Ine.includes(o)?i+=a:$ne.includes(o)&&i!==""?(t.push(i),i=""):o===12?r.escapeSequence=r.escapeSequence?`${r.escapeSequence}${a}`:a:o===8?r.quote=a:o===9&&(r.quote=void 0),n=o}return KT[n].includes(1)?(i!==""&&t.push(i),t):[]}const jne=/[a-zA-Z_$]/,Nne=/[a-zA-Z0-9_$]/,kne=/[0-9]/,Tne=/[a-fA-F0-9]/,One=`'"`,Ane={0:()=>!1,1:()=>!1,2:e=>jne.test(e),3:e=>Nne.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>kne.test(e),8:e=>One.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>e==="\\",12:(e,t)=>t.escapeSequence===void 0?`${t.quote}/\\bfnrtu`.includes(e):t.escapeSequence.startsWith("u")&&t.escapeSequence.length<5?Tne.test(e):!1},KT={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},Ine=[2,3,7,10],$ne=[4,5,6];function Mne(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const Pne={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
357
- `,r:"\r",t:" "};function Dne(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):Pne[e]}const zne="v1",Une=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function Lne(e,t){let n;const o=Vne(),r=await Gne(e);return r.ok?(o.increment("fetch","success"),n=Fne(e,r.value,t,o)):(o.increment("fetch","failure"),ot.error(r.error)),kv("remote configuration metrics",{metrics:o.get()}),n}function Fne(e,t,n,o){const r={...e};return Une.forEach(v=>{v in t&&(r[v]=i(t[v]))}),Object.keys(n).forEach(v=>{t[v]!==void 0&&a(n[v],t[v])}),r;function i(v){if(Array.isArray(v))return v.map(i);if(Bne(v)){if(Hne(v)){const b=v.rcSerializedType;switch(b){case"string":return v.value;case"regex":return U4(v.value);case"dynamic":return u(v);default:ot.error(`Unsupported remote configuration: "rcSerializedType": "${b}"`);return}}return Az(v,i)}return v}function a(v,b){b.forEach(({key:x,value:w})=>{v.setContextProperty(x,i(w))})}function u(v){const b=v.strategy;let x;switch(b){case"cookie":x=f(v);break;case"dom":x=m(v);break;case"js":x=g(v);break;default:ot.error(`Unsupported remote configuration: "strategy": "${b}"`);return}const w=v.extractor;return w!==void 0&&typeof x=="string"?qne(w,x):x}function f({name:v}){const b=jv(v);return o.increment("cookie",b!==void 0?"success":"missing"),b}function m({selector:v,attribute:b}){let x;try{x=document.querySelector(v)}catch{ot.error(`Invalid selector in the remote configuration: '${v}'`),o.increment("dom","failure");return}if(!x){o.increment("dom","missing");return}if(p(x,b)){ot.error(`Forbidden element selected by the remote configuration: '${v}'`),o.increment("dom","failure");return}const w=b!==void 0?x.getAttribute(b):x.textContent;if(w===null){o.increment("dom","missing");return}return o.increment("dom","success"),w}function p(v,b){return v.getAttribute("type")==="password"&&b==="value"}function g({path:v}){let b=window;const x=Rne(v);if(x.length===0){ot.error(`Invalid JSON path in the remote configuration: '${v}'`),o.increment("js","failure");return}for(const w of x){if(!(w in b)){o.increment("js","missing");return}try{b=b[w]}catch(C){ot.error(`Error accessing: '${v}'`,C),o.increment("js","failure");return}}return o.increment("js","success"),b}}function Vne(){const e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function Bne(e){return typeof e=="object"&&e!==null}function Hne(e){return"rcSerializedType"in e}function U4(e){try{return new RegExp(e)}catch{ot.error(`Invalid regex in the remote configuration: '${e}'`)}}function qne(e,t){const n=U4(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 Gne(e){let t;try{t=await fetch(Kne(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 Kne(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${v4("rum",e)}/${zne}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function Zne({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,o,r){const i=Jte(),a=k4();a_(a,Gn.globalContext,i);const u=T4();a_(u,Gn.userContext,i);const f=N4();a_(f,Gn.accountContext,i);let m,p,g,v;const b=n.observable.subscribe(w),x={};function w(){if(!g||!v||!n.isGranted())return;b.unsubscribe();let O;if(v.trackViewsManually){if(!m)return;i.remove(m.callback),O=m.options}const k=r(v,p,O);i.drain(k)}function C(O,k){const T=lu();if(T&&(O=Yne(O)),g=O,Kee(Ene(O)),v){y4("DD_RUM",O);return}const A=xne(O,k);if(A){if(!T&&!A.sessionStoreStrategyType){ot.warn("No storage available for session. We will not send any data.");return}A.compressIntakeRequests&&!T&&t&&(p=t(A,"Datadog RUM",kt),!p)||(v=A,j4().subscribe(kt),n.tryToInit(A.trackingConsent),w())}}const E=O=>{i.add(k=>k.addDurationVital(O))};return{init(O,k,T){if(!O){ot.error("Missing configuration");return}uee(O.enableExperimentalFeatures),g=O,!(e&&S4())&&($4(O.plugins,"onInit",{initConfiguration:O,publicApi:k}),O.remoteConfigurationId?Lne(O,{user:u,context:a}).then(A=>{A&&C(A,T)}).catch(sl):C(O,T))},get initConfiguration(){return g},getInternalContext:kt,stopSession:kt,addTiming(O,k=Kn()){i.add(T=>T.addTiming(O,k))},startView(O,k=Pn()){const T=A=>{A.startView(O,k)};i.add(T),m||(m={options:O,callback:T},w())},setViewName(O){i.add(k=>k.setViewName(O))},setViewContext(O){i.add(k=>k.setViewContext(O))},setViewContextProperty(O,k){i.add(T=>T.setViewContextProperty(O,k))},getViewContext:()=>x,globalContext:a,userContext:u,accountContext:f,addAction(O){i.add(k=>k.addAction(O))},addError(O){i.add(k=>k.addError(O))},addFeatureFlagEvaluation(O,k){i.add(T=>T.addFeatureFlagEvaluation(O,k))},startDurationVital(O,k){return A4(o,O,k)},stopDurationVital(O,k){I4(E,o,O,k)},addDurationVital:E,addOperationStepVital:(O,k,T,A)=>{i.add($=>$.addOperationStepVital(Ft(O),k,Ft(T),Ft(A)))}}}function Yne(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=fm())===null||n===void 0?void 0:n.getPrivacyLevel()}}function a_(e,t,n){e.changeObservable.subscribe(()=>{const o=e.getContext();n.add(r=>r[t].setContext(o))})}function Wne(e,t,n,o={}){const r=DJ(),i=dne(),a=cne().observable;let u=Zne(o,r,i,(g,v,b)=>{const x=e(g,t,n,b,v&&o.createDeflateEncoder?w=>o.createDeflateEncoder(g,v,w):Ote,r,i,a,o.sdkName);return t.onRumStart(x.lifeCycle,g,x.session,x.viewHistory,v,x.telemetry),n.onRumStart(x.lifeCycle,x.hooks,g,x.session,x.viewHistory),u=Xne(u,x),$4(g.plugins,"onRumStart",{strategy:u,addEvent:x.addEvent}),x});const f=()=>u,m=et(g=>{const v=typeof g=="object"?g:{name:g};u.startView(v),qn({feature:"start-view"})}),p=dte({init:g=>{const v=new Error().stack;Xs(()=>u.init(g,p,v))},setTrackingConsent:et(g=>{r.update(g),qn({feature:"set-tracking-consent",tracking_consent:g})}),setViewName:et(g=>{u.setViewName(g),qn({feature:"set-view-name"})}),setViewContext:et(g=>{u.setViewContext(g),qn({feature:"set-view-context"})}),setViewContextProperty:et((g,v)=>{u.setViewContextProperty(g,v),qn({feature:"set-view-context-property"})}),getViewContext:et(()=>(qn({feature:"set-view-context-property"}),u.getViewContext())),getInternalContext:et(g=>u.getInternalContext(g)),getInitConfiguration:et(()=>tE(u.initConfiguration)),addAction:(g,v)=>{const b=Cf("action");Xs(()=>{u.addAction({name:Ft(g),context:Ft(v),startClocks:Pn(),type:sE.CUSTOM,handlingStack:b}),qn({feature:"add-action"})})},addError:(g,v)=>{const b=Cf("error");Xs(()=>{u.addError({error:g,handlingStack:b,context:Ft(v),startClocks:Pn()}),qn({feature:"add-error"})})},addTiming:et((g,v)=>{u.addTiming(Ft(g),v)}),setGlobalContext:br(f,Gn.globalContext,xr.setContext,"set-global-context"),getGlobalContext:br(f,Gn.globalContext,xr.getContext,"get-global-context"),setGlobalContextProperty:br(f,Gn.globalContext,xr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:br(f,Gn.globalContext,xr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:br(f,Gn.globalContext,xr.clearContext,"clear-global-context"),setUser:br(f,Gn.userContext,xr.setContext,"set-user"),getUser:br(f,Gn.userContext,xr.getContext,"get-user"),setUserProperty:br(f,Gn.userContext,xr.setContextProperty,"set-user-property"),removeUserProperty:br(f,Gn.userContext,xr.removeContextProperty,"remove-user-property"),clearUser:br(f,Gn.userContext,xr.clearContext,"clear-user"),setAccount:br(f,Gn.accountContext,xr.setContext,"set-account"),getAccount:br(f,Gn.accountContext,xr.getContext,"get-account"),setAccountProperty:br(f,Gn.accountContext,xr.setContextProperty,"set-account-property"),removeAccountProperty:br(f,Gn.accountContext,xr.removeContextProperty,"remove-account-property"),clearAccount:br(f,Gn.accountContext,xr.clearContext,"clear-account"),startView:m,stopSession:et(()=>{u.stopSession(),qn({feature:"stop-session"})}),addFeatureFlagEvaluation:et((g,v)=>{u.addFeatureFlagEvaluation(Ft(g),Ft(v)),qn({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:et(()=>t.getSessionReplayLink()),startSessionReplayRecording:et(g=>{t.start(g),qn({feature:"start-session-replay-recording",force:g&&g.force})}),stopSessionReplayRecording:et(()=>t.stop()),addDurationVital:et((g,v)=>{qn({feature:"add-duration-vital"}),u.addDurationVital({name:Ft(g),type:Rf.DURATION,startClocks:WQ(v.startTime),duration:v.duration,context:Ft(v&&v.context),description:Ft(v&&v.description)})}),startDurationVital:et((g,v)=>(qn({feature:"start-duration-vital"}),u.startDurationVital(Ft(g),{context:Ft(v&&v.context),description:Ft(v&&v.description)}))),stopDurationVital:et((g,v)=>{qn({feature:"stop-duration-vital"}),u.stopDurationVital(typeof g=="string"?Ft(g):g,{context:Ft(v&&v.context),description:Ft(v&&v.description)})}),startFeatureOperation:et((g,v)=>{qn({feature:"add-operation-step-vital",action_type:"start"}),u.addOperationStepVital(g,"start",v)}),succeedFeatureOperation:et((g,v)=>{qn({feature:"add-operation-step-vital",action_type:"succeed"}),u.addOperationStepVital(g,"end",v)}),failFeatureOperation:et((g,v,b)=>{qn({feature:"add-operation-step-vital",action_type:"fail"}),u.addOperationStepVital(g,"end",b,v)})});return p}function Xne(e,t){return{init:n=>{y4("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function Qne(){const e=Jne();return new _t(t=>{if(!e)return;const n=new e(et(o=>t.notify(o)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function Jne(){let e;const t=window;if(t.Zone&&(e=na(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(kt),o=na(n,"originalInstance");e=o&&o.constructor}return e||(e=t.MutationObserver),e}function ere(){const e=new _t,{stop:t}=Si(window,"open",()=>e.notify());return{observable:e,stop:t}}function tre(e,t,n,o,r){return{get:i=>{const a=n.findView(i),u=r.findUrl(i),f=t.findTrackedSession(i);if(f&&a&&u){const m=o.findActionId(i);return{application_id:e,session_id:f.id,user_action:m?{id:m}:void 0,view:{id:a.id,name:a.name,referrer:u.referrer,url:u.url}}}}}}const nre=Ate,rre=xl;function ore(e){const t=Ou({expireDelay:rre});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 L4="initial_document",ire=[[wr.DOCUMENT,e=>L4===e],[wr.XHR,e=>e==="xmlhttprequest"],[wr.FETCH,e=>e==="fetch"],[wr.BEACON,e=>e==="beacon"],[wr.CSS,(e,t)=>/\.css$/i.test(t)],[wr.JS,(e,t)=>/\.js$/i.test(t)],[wr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[wr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[wr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function sre(e){const t=e.name;if(!lJ(t))return wr.OTHER;const n=cJ(t);for(const[o,r]of ire)if(r(e.initiatorType,n))return o;return wr.OTHER}function ZT(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function F4(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function are(e){const{duration:t,startTime:n,responseEnd:o}=e;return t===0&&n<o?an(n,o):t}function lre(e){if(!B4(e))return;const{startTime:t,fetchStart:n,workerStart:o,redirectStart:r,redirectEnd:i,domainLookupStart:a,domainLookupEnd:u,connectStart:f,secureConnectionStart:m,connectEnd:p,requestStart:g,responseStart:v,responseEnd:b}=e,x={download:Ia(t,v,b),first_byte:Ia(t,g,v)};return 0<o&&o<n&&(x.worker=Ia(t,o,n)),n<p&&(x.connect=Ia(t,f,p),f<=m&&m<=p&&(x.ssl=Ia(t,m,p))),n<u&&(x.dns=Ia(t,a,u)),t<i&&(x.redirect=Ia(t,r,i)),x}function V4(e){return e.duration>=0}function B4(e){const t=ZT(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=cre(e)?ZT(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function cre(e){return e.redirectEnd>e.startTime}function Ia(e,t,n){if(e<=t&&t<=n)return{duration:st(an(t,n)),start:st(an(e,t))}}function ure(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function dre(e){return e.deliveryType===""?"other":e.deliveryType}function fre(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 aE(e){return e&&(!ote(e)||ju(ss.TRACK_INTAKE_REQUESTS))}const mre=/data:(.+)?(;base64)?,/g,hre=24e3;function pre(e,t=hre){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(mre);return n?`${n[0]}[...]`:e}let YT=1;function gre(e,t,n,o,r){const i=yne(t,n,o,r);vre(e,t,i),yre(e,i)}function vre(e,t,n){const o=$te(t).subscribe(r=>{const i=r;if(aE(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=H4(),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:Ov.XHR,url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack,body:i.body});break}});return{stop:()=>o.unsubscribe()}}function yre(e,t){const n=j4().subscribe(o=>{const r=o;if(aE(r.url))switch(r.state){case"start":t.traceFetch(r),r.requestIndex=H4(),e.notify(7,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":bre(r,i=>{var a;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:Ov.FETCH,url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack,body:(a=r.init)===null||a===void 0?void 0:a.body})});break}});return{stop:()=>n.unsubscribe()}}function H4(){const e=YT;return YT+=1,e}function bre(e,t){const n=e.response&&Cee(e.response);!n||!n.body?t(an(e.startClocks.timeStamp,Kn())):ane(n.body,()=>{t(an(e.startClocks.timeStamp,Kn()))},{bytesLimit:Number.POSITIVE_INFINITY})}function q4(e){return am(e)&&e<0?void 0:e}function G4({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 a;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case at.ERROR:o.errorCount+=1,n();break;case at.ACTION:o.actionCount+=1,i.action.frustration&&(o.frustrationCount+=i.action.frustration.type.length),n();break;case at.LONG_TASK:o.longTaskCount+=1,n();break;case at.RESOURCE:!((a=i._dd)===null||a===void 0)&&a.discarded||(o.resourceCount+=1,n());break}});return{stop:()=>{r.unsubscribe()},eventCounts:o}}function xre(e,t){const n=jr();let o=!1;const{stop:r}=oa(e,window,["click","mousedown","keydown","touchstart","pointerdown"],u=>{if(!u.cancelable)return;const f={entryType:"first-input",processingStart:uo(),processingEnd:uo(),startTime:u.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};u.type==="pointerdown"?i(e,f):a(f)},{passive:!0,capture:!0});return{stop:r};function i(u,f){oa(u,window,["pointerup","pointercancel"],m=>{m.type==="pointerup"&&a(f)},{once:!0})}function a(u){if(!o){o=!0,r();const f=u.processingStart-u.startTime;f>=0&&f<jr()-n&&t(u)}}}var Ct;(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"})(Ct||(Ct={}));function Ni(e,t){return new _t(n=>{if(!window.PerformanceObserver)return;const o=f=>{const m=wre(f);m.length>0&&n.notify(m)};let r,i=!0;const a=new PerformanceObserver(et(f=>{i?r=cr(()=>o(f.getEntries())):o(f.getEntries())}));try{a.observe(t)}catch{if([Ct.RESOURCE,Ct.NAVIGATION,Ct.LONG_TASK,Ct.PAINT].includes(t.type)){t.buffered&&(r=cr(()=>o(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}i=!1,_re(e);let u;return!wl(Ct.FIRST_INPUT)&&t.type===Ct.FIRST_INPUT&&({stop:u}=xre(e,f=>{o([f])})),()=>{a.disconnect(),u&&u(),Io(r)}})}let Hd;function _re(e){return!Hd&&Sre()&&"addEventListener"in performance&&(Hd=Jt(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Hd?.stop()}}function Sre(){return window.performance!==void 0&&"getEntries"in performance}function wl(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function wre(e){return e.filter(t=>!Cre(t))}function Cre(e){return e.entryType===Ct.RESOURCE&&(!aE(e.name)||!V4(e))}function LS(e){return e.nodeType===Node.TEXT_NODE}function Ere(e){return e.nodeType===Node.COMMENT_NODE}function ls(e){return e.nodeType===Node.ELEMENT_NODE}function K4(e){return ls(e)&&!!e.shadowRoot}function Rre(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&ls(t.host)}function Yxe(e){return e.childNodes.length>0||K4(e)}function Wxe(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;K4(e)&&t(e.shadowRoot)}function jre(e){return Rre(e)?e.host:e.parentNode}const Z4=100,Nre=100,WT="data-dd-excluded-activity-mutations";function lE(e,t,n,o,r,i){const a=Tre(e,t,n,o);return kre(a,r,i)}function kre(e,t,n){let o,r=!1;const i=cr(et(()=>m({hadActivity:!1})),Z4),a=n!==void 0?cr(et(()=>m({hadActivity:!0,end:Kn()})),n):void 0,u=e.subscribe(({isBusy:p})=>{Io(i),Io(o);const g=Kn();p||(o=cr(et(()=>m({hadActivity:!0,end:g})),Nre))}),f=()=>{r=!0,Io(i),Io(o),Io(a),u.unsubscribe()};function m(p){r||(f(),t(p))}return{stop:f}}function Tre(e,t,n,o){return new _t(r=>{const i=[];let a,u=0;return i.push(t.subscribe(m=>{m.every(Ore)||f()}),n.subscribe(f),Ni(o,{type:Ct.RESOURCE}).subscribe(m=>{m.some(p=>!l_(o,p.name))&&f()}),e.subscribe(7,m=>{l_(o,m.url)||(a===void 0&&(a=m.requestIndex),u+=1,f())}),e.subscribe(8,m=>{l_(o,m.url)||a===void 0||m.requestIndex<a||(u-=1,f())})),()=>{i.forEach(m=>m.unsubscribe())};function f(){r.notify({isBusy:u>0})}})}function l_(e,t){return Nv(e.excludedActivityUrls,t)}function Ore(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&ls(t)&&t.matches(`[${WT}], [${WT}] *`))}const Av="data-dd-action-name",Are="Masked Element",Ire=[Av,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],$re=[W4,Pre],Mre=[W4,Dre,zre];function mm(e,t){if(!e.isConnected)return;let n,o=e;for(;o&&o.nodeName!=="HTML";){const r=XT(o,$re,Lre,t,n);if(r)return r;n=XT(o,Mre,Fre,t,n)||Iv(Ure(o),n),o=o.parentElement}return n}function Y4(e){return/[0-9]/.test(e)}function Pre(e){if(e.id&&!Y4(e.id))return`#${CSS.escape(e.id)}`}function Dre(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const o=t[n];if(!Y4(o))return`${CSS.escape(e.tagName)}.${CSS.escape(o)}`}}function zre(e){return CSS.escape(e.tagName)}function W4(e,t){if(t){const o=n(t);if(o)return o}for(const o of Ire){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 Ure(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 XT(e,t,n,o,r){for(const i of t){const a=i(e,o);if(a&&n(e,a,r))return Iv(a,r)}}function Lre(e,t,n){return e.ownerDocument.querySelectorAll(Iv(t,n)).length===1}function Fre(e,t,n){let o;if(n===void 0)o=a=>a.matches(t);else{const a=Iv(`${t}:scope`,n);o=u=>u.querySelector(a)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&o(i))return!1;i=i.nextElementSibling}return!0}function Iv(e,t){return t?`${e}>${t}`:e}const bt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Tc.ALLOW,MASK:Tc.MASK,MASK_USER_INPUT:Tc.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Tc.MASK_UNLESS_ALLOWLISTED},Vre="data-dd-privacy",Xxe="hidden",Bre="dd-privacy-",c_="***",Qxe="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",Hre={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},qre="x";function Da(e){return`[${Vre}="${e}"], .${Bre}${e}`}function cE(e,t,n){if(n&&n.has(e))return n.get(e);const o=jre(e),r=o?cE(o,t,n):t,i=Kre(e),a=Gre(i,r);return n&&n.set(e,a),a}function Gre(e,t){switch(t){case bt.HIDDEN:case bt.IGNORE:return t}switch(e){case bt.ALLOW:case bt.MASK:case bt.MASK_USER_INPUT:case bt.MASK_UNLESS_ALLOWLISTED:case bt.HIDDEN:case bt.IGNORE:return e;default:return t}}function Kre(e){if(ls(e)){if(e.tagName==="BASE")return bt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return bt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return bt.MASK}if(e.matches(Da(bt.HIDDEN)))return bt.HIDDEN;if(e.matches(Da(bt.MASK)))return bt.MASK;if(e.matches(Da(bt.MASK_UNLESS_ALLOWLISTED)))return bt.MASK_UNLESS_ALLOWLISTED;if(e.matches(Da(bt.MASK_USER_INPUT)))return bt.MASK_USER_INPUT;if(e.matches(Da(bt.ALLOW)))return bt.ALLOW;if(Zre(e))return bt.IGNORE}}function X4(e,t){switch(t){case bt.MASK:case bt.HIDDEN:case bt.IGNORE:return!0;case bt.MASK_UNLESS_ALLOWLISTED:return LS(e)?ap(e.parentNode)?!0:!J4(e.textContent||""):ap(e);case bt.MASK_USER_INPUT:return LS(e)?ap(e.parentNode):ap(e);default:return!1}}function ap(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!!Hre[t.tagName]}const Q4=e=>e.replace(/\S/g,qre);function Jxe(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 a=n;if(r==="SCRIPT")i=c_;else if(a===bt.HIDDEN)i=c_;else if(X4(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=c_:a===bt.MASK_UNLESS_ALLOWLISTED?i=Yre(i):i=Q4(i);return i}function Zre(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 J4(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function Yre(e,t){return J4(e)?e:t||Q4(e)}const eU=fr,Wre=100;function Xre(e,t){const n=[];let o=0,r;i(e);function i(f){f.stopObservable.subscribe(a),n.push(f),Io(r),r=cr(u,eU)}function a(){o===1&&n.every(f=>f.isStopped())&&(o=2,t(n))}function u(){Io(r),o===0&&(o=1,a())}return{tryAppend:f=>o!==0?!1:n.length>0&&!Qre(n[n.length-1].event,f.event)?(u(),!1):(i(f),!0),stop:()=>{u()}}}function Qre(e,t){return e.target===t.target&&Jre(e,t)<=Wre&&e.timeStamp-t.timeStamp<=eU}function Jre(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function eoe(e,t,n=bt.ALLOW){const{actionNameAttribute:o}=t,r=QT(e,Av)||o&&QT(e,o);return r?{name:r,nameSource:"custom_attribute"}:n===bt.MASK?{name:Are,nameSource:"mask_placeholder"}:JT(e,toe,t)||JT(e,noe,t)||{name:"",nameSource:"blank"}}function QT(e,t){const n=e.closest(`[${t}]`);if(!n)return;const o=n.getAttribute(t);return nU(tU(o.trim()))}const toe=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return $p(e.labels[0],t)},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)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return $p(e,t)},e=>qd(e,"aria-label"),(e,t)=>{const n=e.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map(o=>ooe(e,o)).filter(o=>!!o).map(o=>rU(o,t)).join(" "),nameSource:"text_content"}},e=>qd(e,"alt"),e=>qd(e,"name"),e=>qd(e,"title"),e=>qd(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return $p(e.options[0],t)}],noe=[(e,t)=>$p(e,t)],roe=10;function JT(e,t,n){let o=e,r=0;for(;r<=roe&&o&&o.nodeName!=="BODY"&&o.nodeName!=="HTML"&&o.nodeName!=="HEAD";){for(const i of t){const a=i(o,n);if(a){const{name:u,nameSource:f}=a,m=u&&u.trim();if(m)return{name:nU(tU(m)),nameSource:f}}}if(o.nodeName==="FORM")break;o=o.parentElement,r+=1}}function tU(e){return e.replace(/\s+/g," ")}function nU(e){return e.length>100?`${ZC(e,100)} [...]`:e}function ooe(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function qd(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function $p(e,t){return{name:rU(e,t)||"",nameSource:"text_content"}}function rU(e,t){if(e.isContentEditable)return;const{enablePrivacyForActionName:n,actionNameAttribute:o,defaultPrivacyLevel:r}=t;if(ju(ss.USE_TREE_WALKER_FOR_ACTION_NAME))return ioe(e,o,n,r);if("innerText"in e){let i=e.innerText;const a=u=>{const f=e.querySelectorAll(u);for(let m=0;m<f.length;m+=1){const p=f[m];if("innerText"in p){const g=p.innerText;g&&g.trim().length>0&&(i=i.replace(g,""))}}};return a(`[${Av}]`),o&&a(`[${o}]`),n&&a(`${Da(bt.HIDDEN)}, ${Da(bt.MASK)}`),i}return e.textContent}function ioe(e,t,n,o){const r=new Map,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,u);let a="";for(;i.nextNode();){const f=i.currentNode;if(ls(f)){(f.nodeName==="BR"||f.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(f).display))&&(a+=" ");continue}a+=f.textContent||""}return a.replace(/\s+/g," ").trim();function u(f){const m=cE(f,o,r);if(n&&m&&X4(f,m))return NodeFilter.FILTER_REJECT;if(ls(f)){if(f.hasAttribute(Av)||t&&f.hasAttribute(t))return NodeFilter.FILTER_REJECT;const p=getComputedStyle(f);if(p.visibility!=="visible"||p.display==="none"||p.contentVisibility&&p.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function soe(e,{onPointerDown:t,onPointerUp:n}){let o,r={selection:!1,input:!1,scroll:!1},i;const a=[Jt(e,window,"pointerdown",u=>{tO(u)&&(o=eO(),r={selection:!1,input:!1,scroll:!1},i=t(u))},{capture:!0}),Jt(e,window,"selectionchange",()=>{(!o||!eO())&&(r.selection=!0)},{capture:!0}),Jt(e,window,"scroll",()=>{r.scroll=!0},{capture:!0,passive:!0}),Jt(e,window,"pointerup",u=>{if(tO(u)&&i){const f=r;n(i,u,()=>f),i=void 0}},{capture:!0}),Jt(e,window,"input",()=>{r.input=!0},{capture:!0})];return{stop:()=>{a.forEach(u=>u.stop())}}}function eO(){const e=window.getSelection();return!e||e.isCollapsed}function tO(e){return e.target instanceof Element&&e.isPrimary!==!1}const nO=3;function aoe(e,t){if(loe(e))return t.addFrustration(Bd.RAGE_CLICK),e.some(rO)&&t.addFrustration(Bd.DEAD_CLICK),t.hasError&&t.addFrustration(Bd.ERROR_CLICK),{isRage:!0};const n=e.some(o=>o.getUserActivity().selection);return e.forEach(o=>{o.hasError&&o.addFrustration(Bd.ERROR_CLICK),rO(o)&&!n&&o.addFrustration(Bd.DEAD_CLICK)}),{isRage:!1}}function loe(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(nO-1);t+=1)if(e[t+nO-1].event.timeStamp-e[t].event.timeStamp<=fr)return!0;return!1}const coe='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 rO(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(coe)}const oU=10*fr,cf=new Map;function uoe(e){const t=cf.get(e);return cf.delete(e),t}function iU(e,t){cf.set(e,t),cf.forEach((n,o)=>{an(o,uo())>oU&&cf.delete(o)})}const doe=5*kr;function foe(e,t,n,o){const r=Ou({expireDelay:doe}),i=new _t;let a;e.subscribe(10,()=>{r.reset()}),e.subscribe(5,p),e.subscribe(11,g=>{g.reason===Dc.UNLOADING&&p()});const{stop:u}=soe(o,{onPointerDown:g=>moe(o,e,t,g,n),onPointerUp:({clickActionBase:g,hadActivityOnPointerDown:v},b,x)=>{hoe(o,e,t,n,r,i,m,g,b,x,v)}});return{stop:()=>{p(),i.notify(),u()},actionContexts:{findActionId:g=>r.findAll(g)}};function m(g){if(!a||!a.tryAppend(g)){const v=g.clone();a=Xre(g,b=>{goe(b,v)})}}function p(){a&&a.stop()}}function moe(e,t,n,o,r){let i;if(e.enablePrivacyForActionName?i=cE(o.target,e.defaultPrivacyLevel):i=bt.ALLOW,i===bt.HIDDEN)return;const a=poe(o,i,e);let u=!1;return lE(t,n,r,e,f=>{u=f.hadActivity},Z4),{clickActionBase:a,hadActivityOnPointerDown:()=>u}}function hoe(e,t,n,o,r,i,a,u,f,m,p){var g;const v=sU(t,r,m,u,f);a(v);const b=(g=u?.target)===null||g===void 0?void 0:g.selector;b&&iU(f.timeStamp,b);const{stop:x}=lE(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()},oU),w=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=i.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{w.unsubscribe(),x(),C.unsubscribe()})}function poe(e,t,n){const o=e.target.getBoundingClientRect(),r=mm(e.target,n.actionNameAttribute);r&&iU(e.timeStamp,r);const{name:i,nameSource:a}=eoe(e.target,n,t);return{type:sE.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,nameSource:a}}function sU(e,t,n,o,r){const i=mr(),a=Pn(),u=t.add(i,a.relative),f=G4({lifeCycle:e,isChildEvent:x=>x.action!==void 0&&(Array.isArray(x.action.id)?x.action.id.includes(i):x.action.id===i)});let m=0,p;const g=[],v=new _t;function b(x){m===0&&(p=x,m=1,p?u.close(KC(p)):u.remove(),f.stop(),v.notify())}return{event:r,stop:b,stopObservable:v,get hasError(){return f.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:x=>{g.push(x)},startClocks:a,isStopped:()=>m===1||m===2,clone:()=>sU(e,t,n,o,r),validate:x=>{if(b(),m!==1)return;const{resourceCount:w,errorCount:C,longTaskCount:E}=f.eventCounts,j={duration:p&&an(a.timeStamp,p),startClocks:a,id:i,frustrationTypes:g,counts:{resourceCount:w,errorCount:C,longTaskCount:E},events:x??[r],event:r,...o};e.notify(0,j),m=2},discard:()=>{b(),m=2}}}function goe(e,t){const{isRage:n}=aoe(e,t);n?(e.forEach(o=>o.discard()),t.stop(Kn()),t.validate(e.map(o=>o.event))):(t.discard(),e.forEach(o=>o.validate()))}function voe(e,t,n,o,r){const{unsubscribe:i}=e.subscribe(0,f=>{e.notify(12,oO(f))});t.register(0,({startTime:f,eventType:m})=>{if(m!==at.ERROR&&m!==at.RESOURCE&&m!==at.LONG_TASK)return fo;const p=a.findActionId(f);return p?{type:m,action:{id:p}}:fo}),t.register(1,({startTime:f})=>({action:{id:a.findActionId(f)}}));let a={findActionId:kt},u=kt;return r.trackUserInteractions&&({actionContexts:a,stop:u}=foe(e,n,o,r)),{addAction:f=>{e.notify(12,oO(f))},actionContexts:a,stop:()=>{i(),u()}}}function oO(e){const t=u_(e)?{action:{id:e.id,loading_time:q4(st(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=as({action:{id:mr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:at.ACTION},t),o=u_(e)?e.duration:void 0,r=u_(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:o,startTime:e.startClocks.relative,domainContext:r}}function u_(e){return e.type!==sE.CUSTOM}function yoe(e){const t=Zte([xv.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function boe(e,t){const n=mte(e,[Ef.cspViolation,Ef.intervention]).subscribe(o=>t.notify(o));return{stop:()=>{n.unsubscribe()}}}function xoe(e,t,n){const o=new _t;return n.subscribe(r=>{r.type===0&&o.notify(r.error)}),yoe(o),boe(t,o),o.subscribe(r=>e.notify(14,{error:r})),_oe(e)}function _oe(e){return e.subscribe(14,({error:t})=>{e.notify(12,Soe(t))}),{addError:({error:t,handlingStack:n,componentStack:o,startClocks:r,context:i})=>{const a=JC({originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:"Provided",source:Nu.CUSTOM,handling:"handled"});a.context=as(a.context,i),e.notify(14,{error:a})}}}function Soe(e){const t={date:e.startClocks.timeStamp,error:{id:mr(),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:at.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const iO=new WeakSet;function woe(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=>!iO.has(o)).filter(o=>V4(o)&&B4(o)).filter(o=>Coe(o,e.startClocks.relative,aU({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return iO.add(n[0]),n[0].toJSON()}function aU(e){return Eu(e.startTime,e.duration)}function Coe(e,t,n){return e.startTime>=t-1&&aU(e)<=Eu(n,1)}const Eoe=2*kr;function Roe(e){const t=joe(e)||Noe(e);if(!(!t||t.traceTime<=jr()-Eoe))return t.traceId}function joe(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return lU(t&&t.content,n&&n.content)}function Noe(e){const t=koe(e);if(t)return lU(_f(t,"trace-id"),_f(t,"trace-time"))}function lU(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function koe(e){for(let t=0;t<e.childNodes.length;t+=1){const n=sO(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=sO(n);if(o)return o;if(!LS(n))break}}function sO(e){if(e&&Ere(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function cU(){if(wl(Ct.NAVIGATION)){const n=performance.getEntriesByType(Ct.NAVIGATION)[0];if(n)return n}const e=Toe(),t={entryType:Ct.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 Toe(){const e={},t=performance.timing;for(const n in t)if(am(t[n])){const o=n,r=t[o];e[o]=r===0?0:KC(r)}return e}function Ooe(e,t,n=cU){rE(e,"interactive",()=>{const o=n(),r=Object.assign(o.toJSON(),{entryType:Ct.RESOURCE,initiatorType:L4,duration:o.responseEnd,traceId:Roe(document),toJSON:()=>({...r,toJSON:void 0})});t(r)})}const Aoe=1e3;function Ioe(e){const t=new Set,n=e.subscribe(8,o=>{t.add(o),t.size>Aoe&&(Tu("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(o){let r=1/0,i;for(const a of t){const u=o.startTime-a.startClocks.relative;0<=u&&u<r&&a.url===o.name&&(r=Math.abs(u),i=a)}return i&&t.delete(i),i},stop(){n.unsubscribe()}}}const $oe=32*iu;function Moe(e,t){return t.allowedGraphQlUrls.find(n=>Nv([n.match],e))}function Poe(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const o=n.query.trim(),r=Doe(o),i=n.operationName;if(!r)return;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:r,operationName:i,variables:a,payload:t?ZC(o,$oe,"..."):void 0}}function Doe(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}function zoe(e,t,n,o=Kte(),r=Ooe){let i;const a=t.trackEarlyRequests;a?i=Ioe(e):e.subscribe(8,m=>{f(()=>Uoe(m,t,n))});const u=Ni(t,{type:Ct.RESOURCE,buffered:!0}).subscribe(m=>{for(const p of m)(a||!F4(p))&&f(()=>aO(p,t,n,i))});r(t,m=>{f(()=>aO(m,t,n,i))});function f(m){o.push(()=>{const p=m();p&&e.notify(12,p)})}return{stop:()=>{o.stop(),u.unsubscribe()}}}function Uoe(e,t,n){const o=woe(e);return uU(o,e,n,t)}function aO(e,t,n,o){const r=F4(e)&&o?o.getMatchingRequest(e):void 0;return uU(e,r,n,t)}function uU(e,t,n,o){if(!e&&!t)return;const r=t?Boe(t,o):Hoe(e,o);if(!o.trackResources&&!r)return;const i=e?Sv(e.startTime):t.startClocks,a=e?are(e):qoe(n,i,t.duration),u=t&&Loe(t,o),f=as({date:i.timeStamp,resource:{id:mr(),duration:st(a),type:t?t.type===Ov.XHR?wr.XHR:wr.FETCH:sre(e),method:t?t.method:void 0,status_code:t?t.status:Goe(e.responseStatus),url:t?pre(t.url):e.name,protocol:e&&ure(e),delivery_type:e&&dre(e),graphql:u},type:at.RESOURCE,_dd:{discarded:!o.trackResources}},r,e&&Voe(e));return{startTime:i.relative,duration:a,rawRumEvent:f,domainContext:Foe(e,t)}}function Loe(e,t){if(!ju(ss.GRAPHQL_TRACKING))return;const n=Moe(e.url,t);if(n)return Poe(e.body,n.trackPayload)}function Foe(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Ov.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function Voe(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...fre(e),...lre(e)}}}function Boe(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 Hoe(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:P4().toString(),rule_psr:t.rulePsr}}}function qoe(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function Goe(e){return e===0?void 0:e}function Koe(e,t,n){const{stop:o,eventCounts:r}=G4({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:o,eventCounts:r}}const Zoe=10*kr;function Yoe(e,t,n){return{stop:Ni(e,{type:Ct.PAINT,buffered:!0}).subscribe(r=>{const i=r.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<Zoe);i&&n(i.startTime)}).unsubscribe}}function Woe(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(an(e,uo()))})})}function Xoe(e,t,n){const o=Ni(e,{type:Ct.FIRST_INPUT,buffered:!0}).subscribe(r=>{const i=r.find(a=>a.startTime<t.timeStamp);if(i){const a=an(i.startTime,i.processingStart);let u;i.target&&ls(i.target)&&(u=mm(i.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:i.startTime,targetSelector:u})}});return{stop:()=>{o.unsubscribe()}}}function Qoe(e,t,n=cU){return tie(e,()=>{const o=n();eie(o)||t(Joe(o))})}function Joe(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=uo()?e.responseStart:void 0}}function eie(e){return e.loadEventEnd<=0}function tie(e,t){let n;const{stop:o}=rE(e,"complete",()=>{n=cr(()=>t())});return{stop:()=>{o(),Io(n)}}}const nie=10*kr;function rie(e,t,n,o){let r=1/0;const{stop:i}=oa(e,n,["pointerdown","keydown"],f=>{r=f.timeStamp},{capture:!0,once:!0});let a=0;const u=Ni(e,{type:Ct.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(f=>{const m=Uz(f,p=>p.entryType===Ct.LARGEST_CONTENTFUL_PAINT&&p.startTime<r&&p.startTime<t.timeStamp&&p.startTime<nie&&p.size>a);if(m){let p;m.element&&(p=mm(m.element,e.actionNameAttribute)),o({value:m.startTime,targetSelector:p,resourceUrl:oie(m)}),a=m.size}});return{stop:()=>{i(),u.unsubscribe()}}}function oie(e){return e.url===""?void 0:e.url}function dU(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:kt};if(wl(Ct.VISIBILITY_STATE)){const i=performance.getEntriesByType(Ct.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:kt}}let o=1/0;const{stop:r}=oa(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 iie(e,t,n,o){const r={},{stop:i}=Qoe(e,g=>{n(g.loadEvent),r.navigationTimings=g,o()}),a=dU(e,t),{stop:u}=Yoe(e,a,g=>{r.firstContentfulPaint=g,o()}),{stop:f}=rie(e,a,window,g=>{r.largestContentfulPaint=g,o()}),{stop:m}=Xoe(e,a,g=>{r.firstInput=g,o()});function p(){i(),u(),f(),m(),a.stop()}return{stop:p,initialViewMetrics:r}}const FS=(e,t)=>e*t,sie=(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:FS(r-n,i-o)},lO=e=>{const t=FS(e.previousRect.width,e.previousRect.height),n=FS(e.currentRect.width,e.currentRect.height),o=sie(e.previousRect,e.currentRect);return t+n-o};function aie(e,t,n){if(!fie())return{stop:kt};let o=0,r;n({value:0});const i=die(),a=Ni(e,{type:Ct.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=lie(m.sources);r={target:v?.node?new WeakRef(v.node):void 0,time:an(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:sf(o,4),targetSelector:v&&mm(v,e.actionNameAttribute),time:r?.time,previousRect:r?.previousRect?cO(r.previousRect):void 0,currentRect:r?.currentRect?cO(r.currentRect):void 0,devicePixelRatio:r?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function lie(e){let t;for(const n of e)if(n.node&&ls(n.node)){const o=lO(n);(!t||lO(t)<o)&&(t=n)}return t}function cO({x:e,y:t,width:n,height:o}){return{x:e,y:t,width:n,height:o}}const cie=5*fr,uie=fr;function die(){let e=0,t,n,o=0;return{update:r=>{const i=t===void 0||r.startTime-n>=uie||r.startTime-t>=cie;let a;return i?(t=n=r.startTime,o=e=r.value,a=!0):(e+=r.value,n=r.startTime,a=r.value>o,a&&(o=r.value)),{cumulatedValue:e,isMaxValue:a}}}}function fie(){return wl(Ct.LAYOUT_SHIFT)&&"WeakRef"in window}let Mp,fU=0,d_=1/0,f_=0;function mie(){"interactionCount"in performance||Mp||(Mp=new window.PerformanceObserver(et(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(d_=Math.min(d_,n.interactionId),f_=Math.max(f_,n.interactionId),fU=(f_-d_)/7+1)})})),Mp.observe({type:"event",buffered:!0,durationThreshold:0}))}const uO=()=>Mp?fU:window.performance.interactionCount||0,dO=10,hie=1*kr;function pie(e,t,n){if(!yie())return{getInteractionToNextPaint:()=>{},setViewEnd:kt,stop:kt};const{getViewInteractionCount:o,stopViewInteractionCount:r}=vie(n);let i=1/0;const a=gie(o);let u=-1,f,m;function p(b){for(const w of b)w.interactionId&&w.startTime>=t&&w.startTime<=i&&a.process(w);const x=a.estimateP98Interaction();x&&x.duration!==u&&(u=x.duration,m=an(t,x.startTime),f=uoe(x.startTime),!f&&x.target&&ls(x.target)&&(f=mm(x.target,e.actionNameAttribute)))}const g=Ni(e,{type:Ct.FIRST_INPUT,buffered:!0}).subscribe(p),v=Ni(e,{type:Ct.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(u>=0)return{value:Math.min(u,hie),targetSelector:f,time:m};if(o())return{value:0}},setViewEnd:b=>{i=b,r()},stop:()=>{v.unsubscribe(),g.unsubscribe()}}}function gie(e){const t=[];function n(){t.sort((o,r)=>r.duration-o.duration).splice(dO)}return{process(o){const r=t.findIndex(a=>o.interactionId===a.interactionId),i=t[t.length-1];r!==-1?o.duration>t[r].duration&&(t[r]=o,n()):(t.length<dO||o.duration>i.duration)&&(t.push(o),n())},estimateP98Interaction(){const o=Math.min(t.length-1,Math.floor(e()/50));return t[o]}}}function vie(e){mie();const t=e===ns.INITIAL_LOAD?0:uO();let n={stopped:!1};function o(){return uO()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:o(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:o()}}}}function yie(){return wl(Ct.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function bie(e,t,n,o,r,i,a){let u=r===ns.INITIAL_LOAD,f=!0;const m=[],p=dU(o,i);function g(){if(!f&&!u&&m.length>0){const b=Math.max(...m);b<p.timeStamp-i.relative&&a(b)}}const{stop:v}=lE(e,t,n,o,b=>{f&&(f=!1,b.hadActivity&&m.push(an(i.timeStamp,b.end)),g())});return{stop:()=>{v(),p.stop()},setLoadEvent:b=>{u&&(u=!1,m.push(b),g())}}}function e_e(){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 xie(){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 m_;function _ie(e){return m_||(m_=Sie(e)),m_}function Sie(e){return new _t(t=>{const{throttled:n}=Cv(()=>{t.notify(uE())},200);return Jt(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function uE(){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 wie=fr;function Cie(e,t,n,o=Rie(e)){let r=0,i=0,a=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=uo();a=an(t.relative,v),g=!0}g&&n({maxDepth:Math.min(r,i),maxDepthScrollTop:m,maxScrollHeight:i,maxScrollHeightTime:a})});return{stop:()=>u.unsubscribe()}}function Eie(){const e=xie(),{height:t}=uE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),o=Math.round(t+e);return{scrollHeight:n,scrollDepth:o,scrollTop:e}}function Rie(e,t=wie){return new _t(n=>{function o(){n.notify(Eie())}if(window.ResizeObserver){const r=Cv(o,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,a=new ResizeObserver(et(r.throttled));i&&a.observe(i);const u=Jt(e,window,"scroll",r.throttled,{passive:!0});return()=>{r.cancel(),a.disconnect(),u.stop()}}})}function jie(e,t,n,o,r,i,a){const u={},{stop:f,setLoadEvent:m}=bie(e,t,n,o,i,a,w=>{u.loadingTime=w,r()}),{stop:p}=Cie(o,a,w=>{u.scroll=w}),{stop:g}=aie(o,a.relative,w=>{u.cumulativeLayoutShift=w,r()}),{stop:v,getInteractionToNextPaint:b,setViewEnd:x}=pie(o,a.relative,i);return{stop:()=>{f(),g(),p()},stopINPTracking:v,setLoadEvent:m,setViewEnd:x,getCommonViewMetrics:()=>(u.interactionToNextPaint=b(),u)}}function Nie(e,t){const{stop:n}=Jt(e,window,"pageshow",o=>{o.persisted&&t(o)},{capture:!0});return n}function kie(e,t,n){Woe(e.relative,o=>{t.firstContentfulPaint=o,t.largestContentfulPaint={value:o},n()})}const Tie=3e3,Oie=5*kr,Aie=5*kr;function Iie(e,t,n,o,r,i,a,u){const f=new Set;let m=v(ns.INITIAL_LOAD,kz(),u),p;b();let g;a&&(g=x(i),r.trackBfcacheViews&&(p=Nie(r,w=>{m.end();const C=Sv(w.timeStamp);m=v(ns.BF_CACHE,C,void 0)})));function v(w,C,E){const j=$ie(t,n,o,r,e,w,C,E);return f.add(j),j.stopObservable.subscribe(()=>{f.delete(j)}),j}function b(){t.subscribe(10,()=>{m=v(ns.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 x(w){return w.subscribe(({oldLocation:C,newLocation:E})=>{Pie(C,E)&&(m.end(),m=v(ns.ROUTE_CHANGE))})}return{addTiming:(w,C=Kn())=>{m.addTiming(w,C)},startView:(w,C)=>{m.end({endClocks:C}),m=v(ns.ROUTE_CHANGE,C,w)},setViewContext:w=>{m.contextManager.setContext(w)},setViewContextProperty:(w,C)=>{m.contextManager.setContextProperty(w,C)},setViewName:w=>{m.setViewName(w)},getViewContext:()=>m.contextManager.getContext(),stop:()=>{g&&g.unsubscribe(),p&&p(),m.end(),f.forEach(w=>w.stop())}}}function $ie(e,t,n,o,r,i,a=Pn(),u){const f=mr(),m=new _t,p={};let g=0,v;const b=xf(r),x=Tv();let w=!0,C=u?.name;const E=u?.service||o.service,j=u?.version||o.version,N=u?.context;N&&x.setContext(N);const O={id:f,name:C,startClocks:a,service:E,version:j,context:N};e.notify(1,O),e.notify(2,O);const{throttled:k,cancel:T}=Cv(M,Tie,{leading:!1}),{setLoadEvent:A,setViewEnd:$,stop:L,stopINPTracking:G,getCommonViewMetrics:ae}=jie(e,t,n,o,ie,i,a),{stop:re,initialViewMetrics:se}=i===ns.INITIAL_LOAD?iie(o,a,A,ie):{stop:kt,initialViewMetrics:{}};i===ns.BF_CACHE&&kie(a,se,ie);const{stop:ue,eventCounts:oe}=Koe(e,f,ie),P=Ru(M,Oie),Z=e.subscribe(11,V=>{V.reason===Dc.UNLOADING&&M()});M(),x.changeObservable.subscribe(ie);function U(){e.notify(3,{id:f,name:C,context:x.getContext(),startClocks:a,sessionIsActive:w})}function ie(){U(),k()}function M(){T(),U(),g+=1;const V=v===void 0?Kn():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:g,id:f,name:C,service:E,version:j,context:x.getContext(),loadingType:i,location:b,startClocks:a,commonViewMetrics:ae(),initialViewMetrics:se,duration:an(a.timeStamp,V),isActive:v===void 0,sessionIsActive:w,eventCounts:oe})}return{get name(){return C},service:E,version:j,contextManager:x,stopObservable:m,end(V={}){var le,X;v||(v=(le=V.endClocks)!==null&&le!==void 0?le:Pn(),w=(X=V.sessionIsActive)!==null&&X!==void 0?X:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),wv(P),$(v.relative),L(),Z.unsubscribe(),M(),cr(()=>{this.stop()},Aie))},stop(){re(),ue(),G(),m.notify()},addTiming(V,le){if(v)return;const X=eJ(le)?le:an(a.timeStamp,le);p[Mie(V)]=X,ie()},setViewName(V){C=V,M()}}}function Mie(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&ot.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Pie(e,t){return e.pathname!==t.pathname||!Die(t.hash)&&fO(t.hash)!==fO(e.hash)}function Die(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function fO(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function zie(e,t,n,o,r,i,a,u,f,m){return e.subscribe(4,p=>e.notify(12,Uie(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}}:ia}),t.register(1,({startTime:p})=>{var g;return{view:{id:(g=f.findView(p))===null||g===void 0?void 0:g.id}}}),Iie(o,e,r,i,n,a,!n.trackViewsManually,m)}function Uie(e,t,n){var o,r,i,a,u,f,m,p,g,v,b,x,w,C,E,j,N,O;const k=n.getReplayStats(e.id),T=(r=(o=e.commonViewMetrics)===null||o===void 0?void 0:o.cumulativeLayoutShift)===null||r===void 0?void 0:r.devicePixelRatio,A={_dd:{document_version:e.documentVersion,replay_stats:k,cls:T?{device_pixel_ratio:T}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:at.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:st((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(u=e.commonViewMetrics.cumulativeLayoutShift)===null||u===void 0?void 0:u.targetSelector,first_byte:st((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.firstByte),dom_complete:st((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domComplete),dom_content_loaded:st((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:st((g=e.initialViewMetrics.navigationTimings)===null||g===void 0?void 0:g.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:st(e.initialViewMetrics.firstContentfulPaint),first_input_delay:st((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:st((b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.time),first_input_target_selector:(x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.targetSelector,interaction_to_next_paint:st((w=e.commonViewMetrics.interactionToNextPaint)===null||w===void 0?void 0:w.value),interaction_to_next_paint_time:st((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:st((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:st((O=e.initialViewMetrics.navigationTimings)===null||O===void 0?void 0:O.loadEvent),loading_time:q4(st(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Lie(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:st(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:st(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:une()}};return bl(e.customTimings)||(A.view.custom_timings=Az(e.customTimings,st)),{rawRumEvent:A,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Lie({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:o,largestContentfulPaint:r}){return{cls:e&&{score:e.value,timestamp:st(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:st(n)},fid:o&&{duration:st(o.delay),timestamp:st(o.time),target_selector:o.targetSelector},inp:t&&{duration:st(t.value),timestamp:st(t.time),target_selector:t.targetSelector},lcp:r&&{timestamp:st(r.value),target_selector:r.targetSelector,resource_url:r.resourceUrl}}}const Fie="rum";function Vie(e,t,n){const o=Ete(e,Fie,r=>Hie(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 a=o.findSession();a&&(a.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 Bie(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:h4("records")?1:0};return{findTrackedSession:()=>e,expire:kt,expireObservable:new _t,setForcedReplay:kt}}function Hie(e,t){return qie(t)?t:Ba(e.sessionSampleRate)?Ba(e.sessionReplaySampleRate)?"1":"2":"0"}function qie(e){return e==="0"||e==="1"||e==="2"}function Gie(e,t,n,o,r,i){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const u=p4({encoder:i(2),request:m4(a,e.batchBytesLimit,n),flushController:g4({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:o,sessionExpireObservable:r}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,f=>{f.type===at.VIEW?u.upsert(f,f.view.id):u.add(f)}),u}function Kie(e){const t=fm();e.subscribe(13,n=>{t.send("rum",n)})}const Zie=xl;function Yie(e,t,n,o){const r=Ou({expireDelay:Zie});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 a=n.subscribe(({newLocation:f})=>{const m=r.find();if(m){const p=uo();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}}:ia}),{findUrl:f=>r.find(f),stop:()=>{a.unsubscribe(),r.stop()}}}function Wie(e,t){let n=xf(t);return new _t(o=>{const{stop:r}=Xie(e,a),{stop:i}=Qie(e,a);function a(){if(n.href===t.href)return;const u=xf(t);o.notify({newLocation:u,oldLocation:n}),n=u}return()=>{r(),i()}})}function Xie(e,t){const{stop:n}=Si(mO("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:o}=Si(mO("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:r}=Jt(e,window,"popstate",t);return{stop:()=>{n(),o(),r()}}}function Qie(e,t){return Jt(e,window,"hashchange",t)}function mO(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Jie=xl;function ese(e,t,n){const o=Ou({expireDelay:Jie});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([at.VIEW,at.ERROR]).includes(i))return fo;const u=o.find(r);return!u||bl(u)?fo:{type:i,feature_flags:u}}),{addFeatureFlagEvaluation:(r,i)=>{const a=o.find();a&&(a[r]=i)}}}const tse=10*fr;let zc,lp;function nse(e,t,n){e.metricsEnabled&&(mU(),lp=!1,t.subscribe(13,()=>{lp=!0}),n.subscribe(({bytesCount:o,messagesCount:r})=>{lp&&(lp=!1,zc.batchCount+=1,pO(zc.batchBytesCount,o),pO(zc.batchMessagesCount,r))}),Ru(rse,tse))}function rse(){zc.batchCount!==0&&(kv("Customer data measures",zc),mU())}function hO(){return{min:1/0,max:0,sum:0}}function pO(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function mU(){zc={batchCount:0,batchBytesCount:hO(),batchMessagesCount:hO()}}const ose=4e3,ise=500,sse=xl;function ase(e,t,n=ise){const o=Ou({expireDelay:sse,maxEntries:ose});let r;wl(Ct.VISIBILITY_STATE)&&performance.getEntriesByType(Ct.VISIBILITY_STATE).forEach(m=>{const p=m.name==="hidden"?"hidden":"active";a(p,m.startTime)}),a(hU(),uo());const{stop:i}=oa(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],f=>{a(cse(f),f.timeStamp)},{capture:!0});function a(f,m=uo()){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===at.VIEW){const g=o.findAll(f,m);return{type:p,_dd:{page_states:lse(g,f,n)}}}return p===at.ACTION||p===at.ERROR?{type:p,view:{in_foreground:u("active",f,0)}}:fo}),{wasInPageStateDuringPeriod:u,addPageState:a,stop:()=>{i(),o.stop()}}}function lse(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:o,startTime:r})=>({state:o,start:st(an(t,r))}))}function cse(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":hU()}function hU(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function use(e,t){let n;const o=requestAnimationFrame(et(()=>{n=uE()})),r=_ie(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 dse(e,t){const n=window.cookieStore?fse(e):hse;return new _t(o=>n(t,r=>o.notify(r)))}function fse(e){return(t,n)=>Jt(e,window.cookieStore,"change",r=>{const i=r.changed.find(a=>a.name===t)||r.deleted.find(a=>a.name===t);i&&n(i.value)}).stop}const mse=fr;function hse(e,t){const n=_f(document.cookie,e),o=Ru(()=>{const r=_f(document.cookie,e);r!==n&&t(r)},mse);return()=>{wv(o)}}const gO="datadog-ci-visibility-test-execution-id";function pse(e,t,n=dse(e,gO)){var o;let r=Bs(gO)||((o=window.Cypress)===null||o===void 0?void 0:o.env("traceId"));const i=n.subscribe(a=>{r=a});return t.register(0,({eventType:a})=>typeof r!="string"?fo:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:r}}),{stop:()=>{i.unsubscribe()}}}function gse(e,t){const n=Ni(t,{type:Ct.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(o=>{for(const r of o){const i=Sv(r.startTime),a={date:i.timeStamp,long_task:{id:mr(),entry_type:O4.LONG_ANIMATION_FRAME,duration:st(r.duration),blocking_duration:st(r.blockingDuration),first_ui_event_timestamp:st(r.firstUIEventTimestamp),render_start:st(r.renderStart),style_and_layout_start:st(r.styleAndLayoutStart),start_time:st(r.startTime),scripts:r.scripts.map(u=>({duration:st(u.duration),pause_duration:st(u.pauseDuration),forced_style_and_layout_duration:st(u.forcedStyleAndLayoutDuration),start_time:st(u.startTime),execution_start:st(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:at.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop:()=>n.unsubscribe()}}function vse(e,t){const n=Ni(t,{type:Ct.LONG_TASK,buffered:!0}).subscribe(o=>{for(const r of o){if(r.entryType!==Ct.LONG_TASK||!t.trackLongTasks)break;const i=Sv(r.startTime),a={date:i.timeStamp,long_task:{id:mr(),entry_type:O4.LONG_TASK,duration:st(r.duration)},type:at.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop(){n.unsubscribe()}}}function yse(e){e.register(0,({eventType:t})=>{if(!E4())return fo;const n=w4(),o=C4();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:o,injected:S4()}}})}function bse(e,t,n){const o=tE(e),r=n(o);return WC(t).forEach(([i,a])=>VS(e,o,i.split(/\.|(?=\[\])/),a)),r}function VS(e,t,n,o){const[r,...i]=n;if(r==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,u)=>VS(a,t[u],i,o));return}if(!(!vO(e)||!vO(t))){if(i.length>0)return VS(e[r],t[r],i,o);xse(e,r,t[r],o)}}function xse(e,t,n,o){const r=_l(n);r===o?e[t]=Ft(n):o==="object"&&(r==="undefined"||r==="null")&&(e[t]={})}function vO(e){return _l(e)==="object"}const bc={"view.name":"string","view.url":"string","view.referrer":"string"},xc={context:"object"},_c={service:"string",version:"string"};let pU;function _se(e,t,n,o){pU={[at.VIEW]:{"view.performance.lcp.resource_url":"string",...xc,...bc,..._c},[at.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...xc,...bc,..._c},[at.RESOURCE]:{"resource.url":"string",...ju(ss.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...xc,...bc,..._c},[at.ACTION]:{"action.target.name":"string",...xc,...bc,..._c},[at.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...xc,...bc,..._c},[at.VITAL]:{...xc,...bc,..._c}};const r={[at.ERROR]:n_(at.ERROR,e.eventRateLimiterThreshold,o),[at.ACTION]:n_(at.ACTION,e.eventRateLimiterThreshold,o),[at.VITAL]:n_(at.VITAL,e.eventRateLimiterThreshold,o)};t.subscribe(12,({startTime:i,duration:a,rawRumEvent:u,domainContext:f})=>{const m=n.triggerHook(0,{eventType:u.type,startTime:i,duration:a});if(m===ia)return;const p=as(m,u,{ddtags:n4(e).join(",")});Sse(p,e.beforeSend,f,r)&&(bl(p.context)&&delete p.context,t.notify(13,p))})}function Sse(e,t,n,o){var r;if(t){const a=bse(e,pU[e.type],u=>t(u,n));if(a===!1&&e.type!==at.VIEW)return!1;a===!1&&ot.warn("Can't dismiss view events using beforeSend!")}return!((r=o[e.type])===null||r===void 0?void 0:r.isLimitReached())}function wse(e,t,n,o){e.register(0,({eventType:r,startTime:i})=>{const a=t.findTrackedSession(i),u=o.findView(i);if(!a||!u)return ia;let f,m,p;return r===at.VIEW?(f=n.getReplayStats(u.id)?!0:void 0,m=a.sessionReplay===1,p=u.sessionIsActive?void 0:!1):f=n.isRecording()?!0:void 0,{type:r,session:{id:a.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}}:fo})}function Cse(e){e.register(0,({eventType:t})=>({type:t,connectivity:i4()}))}function Ese(e,t,n){e.register(0,({eventType:o})=>{const r=t.source;return{type:o,_dd:{format_version:2,drift:QQ(),configuration:{session_sample_rate:sf(t.sessionSampleRate,3),session_replay_sample_rate:sf(t.sessionReplaySampleRate,3),profiling_sample_rate:sf(t.profilingSampleRate,3)},browser_sdk_version:lu()?"6.21.2":void 0,sdk_name:n},application:{id:t.applicationId},date:Kn(),source:r}}),e.register(1,()=>({application:{id:t.applicationId}}))}function Rse(e,t){e.register(1,()=>t.isGranted()?fo:ia)}const jse=zee,Nse=[at.ACTION,at.ERROR,at.LONG_TASK,at.RESOURCE,at.VITAL];function kse(e){return{addEvent:(t,n,o,r)=>{Nse.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:o,duration:r})}}}function Tse(e,t){if(!t.metricsEnabled)return{stop:kt};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:o})=>{!o.largestContentfulPaint||!o.navigationTimings||(kv("Initial view metrics",{metrics:Ose(o.largestContentfulPaint,o.navigationTimings)}),n())});return{stop:n}}function Ose(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function Ase(e,t,n,o,r,i,a,u,f){const m=[],p=new nre,g=jse();p.subscribe(13,pe=>o4("rum",pe));const v=pe=>{p.notify(14,{error:pe}),Tu("Error reported to customer",{"error.message":pe.message})},b=Pee(e),x=b.subscribe(pe=>{p.notify(11,pe)});m.push(()=>x.unsubscribe());const w=Vee("browser-rum-sdk",e,g,v,b,r);m.push(w.stop);const C=lu()?Bie():Vie(e,p,i);if(lu())Kie(p);else{const pe=Gie(e,p,v,b,C.expireObservable,r);m.push(()=>pe.stop()),nse(w,p,pe.flushController.flushObservable)}const E=Qne(),j=Wie(e,location),{observable:N,stop:O}=ere();m.push(O),Ese(g,e,f);const k=ase(g,e),T=ore(p);m.push(()=>T.stop());const A=Yie(p,g,j,location);m.push(()=>A.stop());const $=ese(p,g,e);wse(g,C,t,T),Cse(g),Rse(g,i);const L=ine(g,e,"rum"),G=sne(g,e,C,"rum"),ae=one(g,e,"rum"),{actionContexts:re,addAction:se,addEvent:ue,stop:oe}=Ise(p,g,e,k,E,N,v);m.push(oe);const{addTiming:P,startView:Z,setViewName:U,setViewContext:ie,setViewContextProperty:M,getViewContext:V,stop:le}=zie(p,g,e,location,E,N,j,t,T,o);m.push(le);const{stop:X}=Tse(p,w);m.push(X);const{stop:H}=zoe(p,e,k);if(m.push(H),e.trackLongTasks)if(wl(Ct.LONG_ANIMATION_FRAME)){const{stop:pe}=gse(p,e);m.push(pe)}else vse(p,e);const{addError:fe}=xoe(p,e,u);u.unbuffer(),gre(p,e,C,G,ae);const me=fne(p,k,a),ce=tre(e.applicationId,C,T,re,A);return m.push(()=>n.stop()),{addAction:se,addEvent:ue,addError:fe,addTiming:P,addFeatureFlagEvaluation:$.addFeatureFlagEvaluation,startView:Z,setViewContext:ie,setViewContextProperty:M,getViewContext:V,setViewName:U,lifeCycle:p,viewHistory:T,session:C,stopSession:()=>C.expire(),getInternalContext:ce.get,startDurationVital:me.startDurationVital,stopDurationVital:me.stopDurationVital,addDurationVital:me.addDurationVital,addOperationStepVital:me.addOperationStepVital,globalContext:L,userContext:G,accountContext:ae,telemetry:w,stop:()=>{m.forEach(pe=>pe())},hooks:g}}function Ise(e,t,n,o,r,i,a){const u=voe(e,t,r,i,n),f=kse(e),m=use(t,n),p=pse(n,t);return yse(t),_se(n,e,t,a),{pageStateHistory:o,addAction:u.addAction,addEvent:f.addEvent,actionContexts:u.actionContexts,stop:()=>{u.stop(),p.stop(),m.stop(),o.stop()}}}function $se(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 a=Mse(e),u=`/rum/replay/sessions/${r}`;return`${a}${u}?${i.join("&")}`}function Mse(e){const t=e.site,n=e.subdomain||Pse(e);return`https://${n?`${n}.`:""}${t}`}function Pse(e){switch(e.site){case Ha:case yee:return"app";case r4:return"dd";default:return}}const Dse=1e3;let Oo;function t_e(e){return $v(e).segments_count}function n_e(e){$v(e).segments_count+=1}function r_e(e){$v(e).records_count+=1}function o_e(e,t){$v(e).segments_total_raw_size+=t}function zse(e){return Oo?.get(e)}function $v(e){Oo||(Oo=new Map);let t;return Oo.has(e)?t=Oo.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},Oo.set(e,t),Oo.size>Dse&&Use()),t}function Use(){if(!Oo)return;const e=Oo.keys().next().value;e&&Oo.delete(e)}function gU(e,t,n){let o=0,r=[],i,a=!0,u=0;const f=[],{stop:m}=Jt(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const b=f[0];b&&(b.id===v.id?(f.shift(),o+=v.additionalBytesCount,r.push(v.result),i=v.trailer,b.writeCallback?b.writeCallback(v.result.byteLength):b.finishCallback&&b.finishCallback()):b.id<v.id&&m())});function p(){const v=r.length===0?new Uint8Array(0):nJ(r.concat(i)),b={rawBytesCount:o,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return o=0,r=[],b}function g(){a||(t.postMessage({action:"reset",streamId:n}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(v,b){t.postMessage({action:"write",id:u,data:v,streamId:n}),f.push({id:u,writeCallback:b,data:v}),a=!1,u+=1},finish(v){g(),f.length?(f.forEach(b=>{delete b.writeCallback}),f[f.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){g();const v=f.map(b=>b.data).join("");return f.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){m()}}}function dE({configuredUrl:e,error:t,source:n,scriptType:o}){if(ot.error(`${n} failed to start: an error occurred while initializing the ${o}:`,t),t instanceof Event||t instanceof Error&&Lse(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.",ot.error(`${r} See documentation at ${_v}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else o==="worker"&&nE(t)}function Lse(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Fse=30*fr;function vU(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.21.2"};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 yn={status:0};function yU(e,t,n,o=vU){switch(yn.status===0&&Vse(e,t,o),yn.status){case 1:return yn.initializationFailureCallbacks.push(n),yn.worker;case 3:return yn.worker}}function yO(){return yn.status}function Vse(e,t,n=vU){try{const o=n(e),{stop:r}=Jt(e,o,"error",u=>{h_(e,t,u)}),{stop:i}=Jt(e,o,"message",({data:u})=>{u.type==="errored"?h_(e,t,u.error,u.streamId):u.type==="initialized"&&Hse(u.version)});o.postMessage({action:"init"}),cr(()=>Bse(t),Fse),yn={status:1,worker:o,stop:()=>{r(),i()},initializationFailureCallbacks:[]}}catch(o){h_(e,t,o)}}function Bse(e){yn.status===1&&(ot.error(`${e} failed to start: a timeout occurred while initializing the Worker`),yn.initializationFailureCallbacks.forEach(t=>t()),yn={status:2})}function Hse(e){yn.status===1&&(yn={status:3,worker:yn.worker,stop:yn.stop,version:e})}function h_(e,t,n,o){yn.status===1||yn.status===0?(dE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),yn.status===1&&yn.initializationFailureCallbacks.forEach(r=>r()),yn={status:2}):nE(n,{worker_version:yn.status===3&&yn.version,stream_id:o})}function bU(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function qse(e,t,n,o){const r=t.findTrackedSession(),i=Gse(r,o),a=n.findView();return $se(e,{viewContext:a,errorType:i,session:r})}function Gse(e,t){if(!bU())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function Kse(e,t){if(!e.metricsEnabled)return{stop:kt};let n,o,r;const{unsubscribe:i}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:Kn()},o=void 0,r=void 0;break;case"document-ready":n&&(o=an(n.timestamp,Kn()));break;case"recorder-settled":n&&(r=an(n.timestamp,Kn()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":i(),n&&kv("Recorder init metrics",{metrics:Zse(n.forced,r,an(n.timestamp,Kn()),a.type,o)});break}});return{stop:i}}function Zse(e,t,n,o,r){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:o,waitForDocReadyDuration:r}}function Yse(e,t,n,o,r,i,a){let u=0,f;t.subscribe(9,()=>{(u===2||u===3)&&(v(),u=1)}),t.subscribe(10,()=>{u===1&&g()});const m=new _t;Kse(a,m);const p=async b=>{m.notify({type:"start",forced:b});const[x]=await Promise.all([bO(m,{type:"recorder-settled"},r()),bO(m,{type:"document-ready"},Ite(e,"interactive"))]);if(u!==2){m.notify({type:"aborted"});return}if(!x){u=0,m.notify({type:"recorder-load-failed"});return}const w=i();if(!w){u=0,m.notify({type:"deflate-encoder-load-failed"});return}({stop:f}=x(t,e,n,o,w,a)),u=3,m.notify({type:"succeeded"})};function g(b){const x=n.findTrackedSession();if(Wse(x,b)){u=1;return}if(Xse(u))return;u=2;const w=Qse(x,b)||!1;p(w).catch(sl),w&&n.setForcedReplay()}function v(){u===3&&f?.(),u=0}return{start:g,stop:v,getSessionReplayLink(){return qse(e,n,o,u!==0)},isRecording:()=>u===3}}function Wse(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function Xse(e){return e===2||e===3}function Qse(e,t){return t&&t.force&&e.sessionReplay===0}async function bO(e,t,n){try{return await n}finally{e.notify(t)}}function Jse(){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 eae(e,t){if(lu()&&!h4("records")||!bU())return{start:kt,stop:kt,getReplayStats:()=>{},onRumStart:kt,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:o}=Jse();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:r,isRecording:()=>yO()===3&&n.isRecording(),getReplayStats:i=>yO()===3?zse(i):void 0};function r(i,a,u,f,m,p){let g;function v(){return g||(m??(m=yU(a,"Datadog Session Replay",()=>{n.stop()},t)),m&&(g=gU(a,m,1))),g}n=Yse(a,i,u,f,e,v,p),o(a)&&n.start()}}const tae="modulepreload",nae=function(e){return"/"+e},xO={},fE=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 a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");r=f(n.map(m=>{if(m=nae(m),m in xO)return;xO[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":tae,p||(v.as="script"),v.crossOrigin="",v.href=m,u&&v.setAttribute("nonce",u),document.head.appendChild(v),p)return new Promise((b,x)=>{v.addEventListener("load",b),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${m}`)))})}))}function i(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return r.then(a=>{for(const u of a||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};async function rae(e=oae){try{return await e()}catch(t){dE({error:t,source:"Recorder",scriptType:"module"})}}async function oae(){return(await fE(()=>import("./startRecording-zNVxK0tn.js"),[])).startRecording}function iae(){return Vo().Profiler!==void 0}const sae=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==at.VIEW&&n!==at.LONG_TASK?fo:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function aae(e=lae){try{return await e()}catch(t){dE({error:t,source:"Profiler",scriptType:"module"})}}async function lae(){return(await fE(()=>import("./profiler-BYMsO1hL.js"),[])).createRumProfiler}function cae(){let e;function t(n,o,r,i,a){const u=i.findTrackedSession();if(!u||!M4(u.id,r.profilingSampleRate))return;const f=sae(o);if(!iae()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}aae().then(m=>{if(!m){Tu("[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(a.findView())}).catch(sl)}return{onRumStart:t,stop:()=>{e?.stop().catch(sl)}}}const uae=eae(rae),dae=cae(),fae=Wne(Ase,uae,dae,{startDeflateWorker:yU,createDeflateEncoder:gU,sdkName:"rum"});fte(Vo(),"DD_RUM",fae);function Pp(e,t){Cf("react error"),Pn()}const _O={didCatch:!1,error:null};class i_e extends q.Component{constructor(t){super(t),this.resetError=()=>{this.setState(_O)},this.state=_O}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){Pp()}render(){return this.state.didCatch?q.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let SO=!1;function mae(){_.useEffect(()=>{SO||(SO=!0)},[])}function hae(){return c.jsx(c.Fragment,{children:c.jsx(ms,{})})}const Mv=x9()({component:hae}),Au=nt({getParentRoute:()=>Mv,id:"_authLayout",component:SK}),pae=nt({getParentRoute:()=>Au,path:"sign-in",component:MQ,beforeLoad:({context:e,location:t})=>{const n=e.authentication[wn]?.user;if(n){const o=t?.search,r=xu(n);throw ml({to:o?.redirect?.startsWith("/")?o.redirect:r})}}}),gae=nt({getParentRoute:()=>Mv,path:"sign-in",component:qC,beforeLoad:({context:e,location:t})=>{if(e.authentication[wn]?.user){const n=t?.search;throw ml({to:n?.redirect?.startsWith("/")?n.redirect:ca})}}}),vae=nt({getParentRoute:()=>Au,path:"sign-up",component:UQ}),yae=nt({getParentRoute:()=>Au,path:"forgot-password",component:CQ}),bae=nt({getParentRoute:()=>Au,path:"verify-email",component:GQ}),xae=nt({getParentRoute:()=>Au,path:"reset-password",component:NQ});Au.addChildren([pae,vae,yae,bae,xae]);const _ae=[gae];function Sae(){return c.jsx(ms,{})}function Cl({children:e}){return c.jsx("nav",{className:"fixed top-20 w-full md:h-12 z-39 py-2 px-4 md:px-12 bg-grey-700",children:c.jsxs("div",{className:"md:flex items-center h-full space-x-8",children:[c.jsx(Jg,{}),e]})})}var p_="focusScope.autoFocusOnMount",g_="focusScope.autoFocusOnUnmount",wO={bubbles:!1,cancelable:!0},wae="FocusScope",Pv=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...a}=e,[u,f]=_.useState(null),m=Zt(r),p=Zt(i),g=_.useRef(null),v=ut(t,w=>f(w)),b=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(o){let w=function(N){if(b.paused||!u)return;const O=N.target;u.contains(O)?g.current=O:Fs(g.current,{select:!0})},C=function(N){if(b.paused||!u)return;const O=N.relatedTarget;O!==null&&(u.contains(O)||Fs(g.current,{select:!0}))},E=function(N){if(document.activeElement===document.body)for(const k of N)k.removedNodes.length>0&&Fs(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const j=new MutationObserver(E);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),j.disconnect()}}},[o,u,b.paused]),_.useEffect(()=>{if(u){EO.add(b);const w=document.activeElement;if(!u.contains(w)){const E=new CustomEvent(p_,wO);u.addEventListener(p_,m),u.dispatchEvent(E),E.defaultPrevented||(Cae(kae(xU(u)),{select:!0}),document.activeElement===w&&Fs(u))}return()=>{u.removeEventListener(p_,m),setTimeout(()=>{const E=new CustomEvent(g_,wO);u.addEventListener(g_,p),u.dispatchEvent(E),E.defaultPrevented||Fs(w??document.body,{select:!0}),u.removeEventListener(g_,p),EO.remove(b)},0)}}},[u,m,p,b]);const x=_.useCallback(w=>{if(!n&&!o||b.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(C&&E){const j=w.currentTarget,[N,O]=Eae(j);N&&O?!w.shiftKey&&E===O?(w.preventDefault(),n&&Fs(N,{select:!0})):w.shiftKey&&E===N&&(w.preventDefault(),n&&Fs(O,{select:!0})):E===j&&w.preventDefault()}},[n,o,b.paused]);return c.jsx(Ue.div,{tabIndex:-1,...a,ref:v,onKeyDown:x})});Pv.displayName=wae;function Cae(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Fs(o,{select:t}),document.activeElement!==n)return}function Eae(e){const t=xU(e),n=CO(t,e),o=CO(t.reverse(),e);return[n,o]}function xU(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 CO(e,t){for(const n of e)if(!Rae(n,{upTo:t}))return n}function Rae(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jae(e){return e instanceof HTMLInputElement&&"select"in e}function Fs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jae(e)&&t&&e.select()}}var EO=Nae();function Nae(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=RO(e,t),e.unshift(t)},remove(t){e=RO(e,t),e[0]?.resume()}}}function RO(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function kae(e){return e.filter(t=>t.tagName!=="A")}var Tae="Portal",hm=_.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=_.useState(!1);Rn(()=>i(!0),[]);const a=n||r&&globalThis?.document?.body;return a?Ow.createPortal(c.jsx(Ue.div,{...o,ref:t}),a):null});hm.displayName=Tae;var v_=0;function mE(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jO()),document.body.insertAdjacentElement("beforeend",e[1]??jO()),v_++,()=>{v_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),v_--}},[])}function jO(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var vi=function(){return vi=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},vi.apply(this,arguments)};function _U(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Oae(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}var Dp="right-scroll-bar-position",zp="width-before-scroll-bar",Aae="with-scroll-bars-hidden",Iae="--removed-body-scroll-bar-size";function y_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $ae(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Mae=typeof window<"u"?_.useLayoutEffect:_.useEffect,NO=new WeakMap;function Pae(e,t){var n=$ae(null,function(o){return e.forEach(function(r){return y_(r,o)})});return Mae(function(){var o=NO.get(n);if(o){var r=new Set(o),i=new Set(e),a=n.current;r.forEach(function(u){i.has(u)||y_(u,null)}),i.forEach(function(u){r.has(u)||y_(u,a)})}NO.set(n,e)},[e]),n}function Dae(e){return e}function zae(e,t){t===void 0&&(t=Dae);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,o);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(i){for(o=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){o=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(i),a=n}var f=function(){var p=a;a=[],p.forEach(i)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(p){a.push(p),m()},filter:function(p){return a=a.filter(p),n}}}};return r}function Uae(e){e===void 0&&(e={});var t=zae(null);return t.options=vi({async:!0,ssr:!1},e),t}var SU=function(e){var t=e.sideCar,n=_U(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return _.createElement(o,vi({},n))};SU.isSideCarExport=!0;function Lae(e,t){return e.useMedium(t),SU}var wU=Uae(),b_=function(){},Dv=_.forwardRef(function(e,t){var n=_.useRef(null),o=_.useState({onScrollCapture:b_,onWheelCapture:b_,onTouchMoveCapture:b_}),r=o[0],i=o[1],a=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,p=e.enabled,g=e.shards,v=e.sideCar,b=e.noRelative,x=e.noIsolation,w=e.inert,C=e.allowPinchZoom,E=e.as,j=E===void 0?"div":E,N=e.gapMode,O=_U(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=v,T=Pae([n,t]),A=vi(vi({},O),r);return _.createElement(_.Fragment,null,p&&_.createElement(k,{sideCar:wU,removeScrollBar:m,shards:g,noRelative:b,noIsolation:x,inert:w,setCallbacks:i,allowPinchZoom:!!C,lockRef:n,gapMode:N}),a?_.cloneElement(_.Children.only(u),vi(vi({},A),{ref:T})):_.createElement(j,vi({},A,{className:f,ref:T}),u))});Dv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Dv.classNames={fullWidth:zp,zeroRight:Dp};var Fae=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vae(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Fae();return t&&e.setAttribute("nonce",t),e}function Bae(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hae(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qae=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vae())&&(Bae(t,n),Hae(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gae=function(){var e=qae();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},CU=function(){var e=Gae(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Kae={left:0,top:0,right:0,gap:0},x_=function(e){return parseInt(e||"",10)||0},Zae=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[x_(n),x_(o),x_(r)]},Yae=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kae;var t=Zae(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Wae=CU(),Uc="data-scroll-locked",Xae=function(e,t,n,o){var r=e.left,i=e.top,a=e.right,u=e.gap;return n===void 0&&(n="margin"),`
357
+ `,r:"\r",t:" "};function Dne(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):Pne[e]}const zne="v1",Une=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function Lne(e,t){let n;const o=Vne(),r=await Gne(e);return r.ok?(o.increment("fetch","success"),n=Fne(e,r.value,t,o)):(o.increment("fetch","failure"),ot.error(r.error)),kv("remote configuration metrics",{metrics:o.get()}),n}function Fne(e,t,n,o){const r={...e};return Une.forEach(v=>{v in t&&(r[v]=i(t[v]))}),Object.keys(n).forEach(v=>{t[v]!==void 0&&a(n[v],t[v])}),r;function i(v){if(Array.isArray(v))return v.map(i);if(Bne(v)){if(Hne(v)){const b=v.rcSerializedType;switch(b){case"string":return v.value;case"regex":return U4(v.value);case"dynamic":return u(v);default:ot.error(`Unsupported remote configuration: "rcSerializedType": "${b}"`);return}}return Az(v,i)}return v}function a(v,b){b.forEach(({key:x,value:w})=>{v.setContextProperty(x,i(w))})}function u(v){const b=v.strategy;let x;switch(b){case"cookie":x=f(v);break;case"dom":x=m(v);break;case"js":x=g(v);break;default:ot.error(`Unsupported remote configuration: "strategy": "${b}"`);return}const w=v.extractor;return w!==void 0&&typeof x=="string"?qne(w,x):x}function f({name:v}){const b=jv(v);return o.increment("cookie",b!==void 0?"success":"missing"),b}function m({selector:v,attribute:b}){let x;try{x=document.querySelector(v)}catch{ot.error(`Invalid selector in the remote configuration: '${v}'`),o.increment("dom","failure");return}if(!x){o.increment("dom","missing");return}if(p(x,b)){ot.error(`Forbidden element selected by the remote configuration: '${v}'`),o.increment("dom","failure");return}const w=b!==void 0?x.getAttribute(b):x.textContent;if(w===null){o.increment("dom","missing");return}return o.increment("dom","success"),w}function p(v,b){return v.getAttribute("type")==="password"&&b==="value"}function g({path:v}){let b=window;const x=Rne(v);if(x.length===0){ot.error(`Invalid JSON path in the remote configuration: '${v}'`),o.increment("js","failure");return}for(const w of x){if(!(w in b)){o.increment("js","missing");return}try{b=b[w]}catch(C){ot.error(`Error accessing: '${v}'`,C),o.increment("js","failure");return}}return o.increment("js","success"),b}}function Vne(){const e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function Bne(e){return typeof e=="object"&&e!==null}function Hne(e){return"rcSerializedType"in e}function U4(e){try{return new RegExp(e)}catch{ot.error(`Invalid regex in the remote configuration: '${e}'`)}}function qne(e,t){const n=U4(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 Gne(e){let t;try{t=await fetch(Kne(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 Kne(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${v4("rum",e)}/${zne}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function Zne({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,o,r){const i=Jte(),a=k4();a_(a,Gn.globalContext,i);const u=T4();a_(u,Gn.userContext,i);const f=N4();a_(f,Gn.accountContext,i);let m,p,g,v;const b=n.observable.subscribe(w),x={};function w(){if(!g||!v||!n.isGranted())return;b.unsubscribe();let O;if(v.trackViewsManually){if(!m)return;i.remove(m.callback),O=m.options}const k=r(v,p,O);i.drain(k)}function C(O,k){const T=lu();if(T&&(O=Yne(O)),g=O,Kee(Ene(O)),v){y4("DD_RUM",O);return}const A=xne(O,k);if(A){if(!T&&!A.sessionStoreStrategyType){ot.warn("No storage available for session. We will not send any data.");return}A.compressIntakeRequests&&!T&&t&&(p=t(A,"Datadog RUM",kt),!p)||(v=A,j4().subscribe(kt),n.tryToInit(A.trackingConsent),w())}}const E=O=>{i.add(k=>k.addDurationVital(O))};return{init(O,k,T){if(!O){ot.error("Missing configuration");return}uee(O.enableExperimentalFeatures),g=O,!(e&&S4())&&($4(O.plugins,"onInit",{initConfiguration:O,publicApi:k}),O.remoteConfigurationId?Lne(O,{user:u,context:a}).then(A=>{A&&C(A,T)}).catch(sl):C(O,T))},get initConfiguration(){return g},getInternalContext:kt,stopSession:kt,addTiming(O,k=Kn()){i.add(T=>T.addTiming(O,k))},startView(O,k=Pn()){const T=A=>{A.startView(O,k)};i.add(T),m||(m={options:O,callback:T},w())},setViewName(O){i.add(k=>k.setViewName(O))},setViewContext(O){i.add(k=>k.setViewContext(O))},setViewContextProperty(O,k){i.add(T=>T.setViewContextProperty(O,k))},getViewContext:()=>x,globalContext:a,userContext:u,accountContext:f,addAction(O){i.add(k=>k.addAction(O))},addError(O){i.add(k=>k.addError(O))},addFeatureFlagEvaluation(O,k){i.add(T=>T.addFeatureFlagEvaluation(O,k))},startDurationVital(O,k){return A4(o,O,k)},stopDurationVital(O,k){I4(E,o,O,k)},addDurationVital:E,addOperationStepVital:(O,k,T,A)=>{i.add($=>$.addOperationStepVital(Ft(O),k,Ft(T),Ft(A)))}}}function Yne(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=fm())===null||n===void 0?void 0:n.getPrivacyLevel()}}function a_(e,t,n){e.changeObservable.subscribe(()=>{const o=e.getContext();n.add(r=>r[t].setContext(o))})}function Wne(e,t,n,o={}){const r=DJ(),i=dne(),a=cne().observable;let u=Zne(o,r,i,(g,v,b)=>{const x=e(g,t,n,b,v&&o.createDeflateEncoder?w=>o.createDeflateEncoder(g,v,w):Ote,r,i,a,o.sdkName);return t.onRumStart(x.lifeCycle,g,x.session,x.viewHistory,v,x.telemetry),n.onRumStart(x.lifeCycle,x.hooks,g,x.session,x.viewHistory),u=Xne(u,x),$4(g.plugins,"onRumStart",{strategy:u,addEvent:x.addEvent}),x});const f=()=>u,m=et(g=>{const v=typeof g=="object"?g:{name:g};u.startView(v),qn({feature:"start-view"})}),p=dte({init:g=>{const v=new Error().stack;Xs(()=>u.init(g,p,v))},setTrackingConsent:et(g=>{r.update(g),qn({feature:"set-tracking-consent",tracking_consent:g})}),setViewName:et(g=>{u.setViewName(g),qn({feature:"set-view-name"})}),setViewContext:et(g=>{u.setViewContext(g),qn({feature:"set-view-context"})}),setViewContextProperty:et((g,v)=>{u.setViewContextProperty(g,v),qn({feature:"set-view-context-property"})}),getViewContext:et(()=>(qn({feature:"set-view-context-property"}),u.getViewContext())),getInternalContext:et(g=>u.getInternalContext(g)),getInitConfiguration:et(()=>tE(u.initConfiguration)),addAction:(g,v)=>{const b=Cf("action");Xs(()=>{u.addAction({name:Ft(g),context:Ft(v),startClocks:Pn(),type:sE.CUSTOM,handlingStack:b}),qn({feature:"add-action"})})},addError:(g,v)=>{const b=Cf("error");Xs(()=>{u.addError({error:g,handlingStack:b,context:Ft(v),startClocks:Pn()}),qn({feature:"add-error"})})},addTiming:et((g,v)=>{u.addTiming(Ft(g),v)}),setGlobalContext:br(f,Gn.globalContext,xr.setContext,"set-global-context"),getGlobalContext:br(f,Gn.globalContext,xr.getContext,"get-global-context"),setGlobalContextProperty:br(f,Gn.globalContext,xr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:br(f,Gn.globalContext,xr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:br(f,Gn.globalContext,xr.clearContext,"clear-global-context"),setUser:br(f,Gn.userContext,xr.setContext,"set-user"),getUser:br(f,Gn.userContext,xr.getContext,"get-user"),setUserProperty:br(f,Gn.userContext,xr.setContextProperty,"set-user-property"),removeUserProperty:br(f,Gn.userContext,xr.removeContextProperty,"remove-user-property"),clearUser:br(f,Gn.userContext,xr.clearContext,"clear-user"),setAccount:br(f,Gn.accountContext,xr.setContext,"set-account"),getAccount:br(f,Gn.accountContext,xr.getContext,"get-account"),setAccountProperty:br(f,Gn.accountContext,xr.setContextProperty,"set-account-property"),removeAccountProperty:br(f,Gn.accountContext,xr.removeContextProperty,"remove-account-property"),clearAccount:br(f,Gn.accountContext,xr.clearContext,"clear-account"),startView:m,stopSession:et(()=>{u.stopSession(),qn({feature:"stop-session"})}),addFeatureFlagEvaluation:et((g,v)=>{u.addFeatureFlagEvaluation(Ft(g),Ft(v)),qn({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:et(()=>t.getSessionReplayLink()),startSessionReplayRecording:et(g=>{t.start(g),qn({feature:"start-session-replay-recording",force:g&&g.force})}),stopSessionReplayRecording:et(()=>t.stop()),addDurationVital:et((g,v)=>{qn({feature:"add-duration-vital"}),u.addDurationVital({name:Ft(g),type:Rf.DURATION,startClocks:WQ(v.startTime),duration:v.duration,context:Ft(v&&v.context),description:Ft(v&&v.description)})}),startDurationVital:et((g,v)=>(qn({feature:"start-duration-vital"}),u.startDurationVital(Ft(g),{context:Ft(v&&v.context),description:Ft(v&&v.description)}))),stopDurationVital:et((g,v)=>{qn({feature:"stop-duration-vital"}),u.stopDurationVital(typeof g=="string"?Ft(g):g,{context:Ft(v&&v.context),description:Ft(v&&v.description)})}),startFeatureOperation:et((g,v)=>{qn({feature:"add-operation-step-vital",action_type:"start"}),u.addOperationStepVital(g,"start",v)}),succeedFeatureOperation:et((g,v)=>{qn({feature:"add-operation-step-vital",action_type:"succeed"}),u.addOperationStepVital(g,"end",v)}),failFeatureOperation:et((g,v,b)=>{qn({feature:"add-operation-step-vital",action_type:"fail"}),u.addOperationStepVital(g,"end",b,v)})});return p}function Xne(e,t){return{init:n=>{y4("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function Qne(){const e=Jne();return new _t(t=>{if(!e)return;const n=new e(et(o=>t.notify(o)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function Jne(){let e;const t=window;if(t.Zone&&(e=na(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(kt),o=na(n,"originalInstance");e=o&&o.constructor}return e||(e=t.MutationObserver),e}function ere(){const e=new _t,{stop:t}=Si(window,"open",()=>e.notify());return{observable:e,stop:t}}function tre(e,t,n,o,r){return{get:i=>{const a=n.findView(i),u=r.findUrl(i),f=t.findTrackedSession(i);if(f&&a&&u){const m=o.findActionId(i);return{application_id:e,session_id:f.id,user_action:m?{id:m}:void 0,view:{id:a.id,name:a.name,referrer:u.referrer,url:u.url}}}}}}const nre=Ate,rre=xl;function ore(e){const t=Ou({expireDelay:rre});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 L4="initial_document",ire=[[wr.DOCUMENT,e=>L4===e],[wr.XHR,e=>e==="xmlhttprequest"],[wr.FETCH,e=>e==="fetch"],[wr.BEACON,e=>e==="beacon"],[wr.CSS,(e,t)=>/\.css$/i.test(t)],[wr.JS,(e,t)=>/\.js$/i.test(t)],[wr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[wr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[wr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function sre(e){const t=e.name;if(!lJ(t))return wr.OTHER;const n=cJ(t);for(const[o,r]of ire)if(r(e.initiatorType,n))return o;return wr.OTHER}function ZT(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function F4(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function are(e){const{duration:t,startTime:n,responseEnd:o}=e;return t===0&&n<o?an(n,o):t}function lre(e){if(!B4(e))return;const{startTime:t,fetchStart:n,workerStart:o,redirectStart:r,redirectEnd:i,domainLookupStart:a,domainLookupEnd:u,connectStart:f,secureConnectionStart:m,connectEnd:p,requestStart:g,responseStart:v,responseEnd:b}=e,x={download:Ia(t,v,b),first_byte:Ia(t,g,v)};return 0<o&&o<n&&(x.worker=Ia(t,o,n)),n<p&&(x.connect=Ia(t,f,p),f<=m&&m<=p&&(x.ssl=Ia(t,m,p))),n<u&&(x.dns=Ia(t,a,u)),t<i&&(x.redirect=Ia(t,r,i)),x}function V4(e){return e.duration>=0}function B4(e){const t=ZT(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=cre(e)?ZT(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function cre(e){return e.redirectEnd>e.startTime}function Ia(e,t,n){if(e<=t&&t<=n)return{duration:st(an(t,n)),start:st(an(e,t))}}function ure(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function dre(e){return e.deliveryType===""?"other":e.deliveryType}function fre(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 aE(e){return e&&(!ote(e)||ju(ss.TRACK_INTAKE_REQUESTS))}const mre=/data:(.+)?(;base64)?,/g,hre=24e3;function pre(e,t=hre){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(mre);return n?`${n[0]}[...]`:e}let YT=1;function gre(e,t,n,o,r){const i=yne(t,n,o,r);vre(e,t,i),yre(e,i)}function vre(e,t,n){const o=$te(t).subscribe(r=>{const i=r;if(aE(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=H4(),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:Ov.XHR,url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack,body:i.body});break}});return{stop:()=>o.unsubscribe()}}function yre(e,t){const n=j4().subscribe(o=>{const r=o;if(aE(r.url))switch(r.state){case"start":t.traceFetch(r),r.requestIndex=H4(),e.notify(7,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":bre(r,i=>{var a;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:Ov.FETCH,url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack,body:(a=r.init)===null||a===void 0?void 0:a.body})});break}});return{stop:()=>n.unsubscribe()}}function H4(){const e=YT;return YT+=1,e}function bre(e,t){const n=e.response&&Cee(e.response);!n||!n.body?t(an(e.startClocks.timeStamp,Kn())):ane(n.body,()=>{t(an(e.startClocks.timeStamp,Kn()))},{bytesLimit:Number.POSITIVE_INFINITY})}function q4(e){return am(e)&&e<0?void 0:e}function G4({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 a;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case at.ERROR:o.errorCount+=1,n();break;case at.ACTION:o.actionCount+=1,i.action.frustration&&(o.frustrationCount+=i.action.frustration.type.length),n();break;case at.LONG_TASK:o.longTaskCount+=1,n();break;case at.RESOURCE:!((a=i._dd)===null||a===void 0)&&a.discarded||(o.resourceCount+=1,n());break}});return{stop:()=>{r.unsubscribe()},eventCounts:o}}function xre(e,t){const n=jr();let o=!1;const{stop:r}=oa(e,window,["click","mousedown","keydown","touchstart","pointerdown"],u=>{if(!u.cancelable)return;const f={entryType:"first-input",processingStart:uo(),processingEnd:uo(),startTime:u.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};u.type==="pointerdown"?i(e,f):a(f)},{passive:!0,capture:!0});return{stop:r};function i(u,f){oa(u,window,["pointerup","pointercancel"],m=>{m.type==="pointerup"&&a(f)},{once:!0})}function a(u){if(!o){o=!0,r();const f=u.processingStart-u.startTime;f>=0&&f<jr()-n&&t(u)}}}var Ct;(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"})(Ct||(Ct={}));function Ni(e,t){return new _t(n=>{if(!window.PerformanceObserver)return;const o=f=>{const m=wre(f);m.length>0&&n.notify(m)};let r,i=!0;const a=new PerformanceObserver(et(f=>{i?r=cr(()=>o(f.getEntries())):o(f.getEntries())}));try{a.observe(t)}catch{if([Ct.RESOURCE,Ct.NAVIGATION,Ct.LONG_TASK,Ct.PAINT].includes(t.type)){t.buffered&&(r=cr(()=>o(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}i=!1,_re(e);let u;return!wl(Ct.FIRST_INPUT)&&t.type===Ct.FIRST_INPUT&&({stop:u}=xre(e,f=>{o([f])})),()=>{a.disconnect(),u&&u(),Io(r)}})}let Hd;function _re(e){return!Hd&&Sre()&&"addEventListener"in performance&&(Hd=Jt(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Hd?.stop()}}function Sre(){return window.performance!==void 0&&"getEntries"in performance}function wl(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function wre(e){return e.filter(t=>!Cre(t))}function Cre(e){return e.entryType===Ct.RESOURCE&&(!aE(e.name)||!V4(e))}function LS(e){return e.nodeType===Node.TEXT_NODE}function Ere(e){return e.nodeType===Node.COMMENT_NODE}function ls(e){return e.nodeType===Node.ELEMENT_NODE}function K4(e){return ls(e)&&!!e.shadowRoot}function Rre(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&ls(t.host)}function Yxe(e){return e.childNodes.length>0||K4(e)}function Wxe(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;K4(e)&&t(e.shadowRoot)}function jre(e){return Rre(e)?e.host:e.parentNode}const Z4=100,Nre=100,WT="data-dd-excluded-activity-mutations";function lE(e,t,n,o,r,i){const a=Tre(e,t,n,o);return kre(a,r,i)}function kre(e,t,n){let o,r=!1;const i=cr(et(()=>m({hadActivity:!1})),Z4),a=n!==void 0?cr(et(()=>m({hadActivity:!0,end:Kn()})),n):void 0,u=e.subscribe(({isBusy:p})=>{Io(i),Io(o);const g=Kn();p||(o=cr(et(()=>m({hadActivity:!0,end:g})),Nre))}),f=()=>{r=!0,Io(i),Io(o),Io(a),u.unsubscribe()};function m(p){r||(f(),t(p))}return{stop:f}}function Tre(e,t,n,o){return new _t(r=>{const i=[];let a,u=0;return i.push(t.subscribe(m=>{m.every(Ore)||f()}),n.subscribe(f),Ni(o,{type:Ct.RESOURCE}).subscribe(m=>{m.some(p=>!l_(o,p.name))&&f()}),e.subscribe(7,m=>{l_(o,m.url)||(a===void 0&&(a=m.requestIndex),u+=1,f())}),e.subscribe(8,m=>{l_(o,m.url)||a===void 0||m.requestIndex<a||(u-=1,f())})),()=>{i.forEach(m=>m.unsubscribe())};function f(){r.notify({isBusy:u>0})}})}function l_(e,t){return Nv(e.excludedActivityUrls,t)}function Ore(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&ls(t)&&t.matches(`[${WT}], [${WT}] *`))}const Av="data-dd-action-name",Are="Masked Element",Ire=[Av,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],$re=[W4,Pre],Mre=[W4,Dre,zre];function mm(e,t){if(!e.isConnected)return;let n,o=e;for(;o&&o.nodeName!=="HTML";){const r=XT(o,$re,Lre,t,n);if(r)return r;n=XT(o,Mre,Fre,t,n)||Iv(Ure(o),n),o=o.parentElement}return n}function Y4(e){return/[0-9]/.test(e)}function Pre(e){if(e.id&&!Y4(e.id))return`#${CSS.escape(e.id)}`}function Dre(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const o=t[n];if(!Y4(o))return`${CSS.escape(e.tagName)}.${CSS.escape(o)}`}}function zre(e){return CSS.escape(e.tagName)}function W4(e,t){if(t){const o=n(t);if(o)return o}for(const o of Ire){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 Ure(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 XT(e,t,n,o,r){for(const i of t){const a=i(e,o);if(a&&n(e,a,r))return Iv(a,r)}}function Lre(e,t,n){return e.ownerDocument.querySelectorAll(Iv(t,n)).length===1}function Fre(e,t,n){let o;if(n===void 0)o=a=>a.matches(t);else{const a=Iv(`${t}:scope`,n);o=u=>u.querySelector(a)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&o(i))return!1;i=i.nextElementSibling}return!0}function Iv(e,t){return t?`${e}>${t}`:e}const bt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Tc.ALLOW,MASK:Tc.MASK,MASK_USER_INPUT:Tc.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Tc.MASK_UNLESS_ALLOWLISTED},Vre="data-dd-privacy",Xxe="hidden",Bre="dd-privacy-",c_="***",Qxe="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",Hre={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},qre="x";function Da(e){return`[${Vre}="${e}"], .${Bre}${e}`}function cE(e,t,n){if(n&&n.has(e))return n.get(e);const o=jre(e),r=o?cE(o,t,n):t,i=Kre(e),a=Gre(i,r);return n&&n.set(e,a),a}function Gre(e,t){switch(t){case bt.HIDDEN:case bt.IGNORE:return t}switch(e){case bt.ALLOW:case bt.MASK:case bt.MASK_USER_INPUT:case bt.MASK_UNLESS_ALLOWLISTED:case bt.HIDDEN:case bt.IGNORE:return e;default:return t}}function Kre(e){if(ls(e)){if(e.tagName==="BASE")return bt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return bt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return bt.MASK}if(e.matches(Da(bt.HIDDEN)))return bt.HIDDEN;if(e.matches(Da(bt.MASK)))return bt.MASK;if(e.matches(Da(bt.MASK_UNLESS_ALLOWLISTED)))return bt.MASK_UNLESS_ALLOWLISTED;if(e.matches(Da(bt.MASK_USER_INPUT)))return bt.MASK_USER_INPUT;if(e.matches(Da(bt.ALLOW)))return bt.ALLOW;if(Zre(e))return bt.IGNORE}}function X4(e,t){switch(t){case bt.MASK:case bt.HIDDEN:case bt.IGNORE:return!0;case bt.MASK_UNLESS_ALLOWLISTED:return LS(e)?ap(e.parentNode)?!0:!J4(e.textContent||""):ap(e);case bt.MASK_USER_INPUT:return LS(e)?ap(e.parentNode):ap(e);default:return!1}}function ap(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!!Hre[t.tagName]}const Q4=e=>e.replace(/\S/g,qre);function Jxe(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 a=n;if(r==="SCRIPT")i=c_;else if(a===bt.HIDDEN)i=c_;else if(X4(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=c_:a===bt.MASK_UNLESS_ALLOWLISTED?i=Yre(i):i=Q4(i);return i}function Zre(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 J4(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function Yre(e,t){return J4(e)?e:t||Q4(e)}const eU=fr,Wre=100;function Xre(e,t){const n=[];let o=0,r;i(e);function i(f){f.stopObservable.subscribe(a),n.push(f),Io(r),r=cr(u,eU)}function a(){o===1&&n.every(f=>f.isStopped())&&(o=2,t(n))}function u(){Io(r),o===0&&(o=1,a())}return{tryAppend:f=>o!==0?!1:n.length>0&&!Qre(n[n.length-1].event,f.event)?(u(),!1):(i(f),!0),stop:()=>{u()}}}function Qre(e,t){return e.target===t.target&&Jre(e,t)<=Wre&&e.timeStamp-t.timeStamp<=eU}function Jre(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function eoe(e,t,n=bt.ALLOW){const{actionNameAttribute:o}=t,r=QT(e,Av)||o&&QT(e,o);return r?{name:r,nameSource:"custom_attribute"}:n===bt.MASK?{name:Are,nameSource:"mask_placeholder"}:JT(e,toe,t)||JT(e,noe,t)||{name:"",nameSource:"blank"}}function QT(e,t){const n=e.closest(`[${t}]`);if(!n)return;const o=n.getAttribute(t);return nU(tU(o.trim()))}const toe=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return $p(e.labels[0],t)},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)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return $p(e,t)},e=>qd(e,"aria-label"),(e,t)=>{const n=e.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map(o=>ooe(e,o)).filter(o=>!!o).map(o=>rU(o,t)).join(" "),nameSource:"text_content"}},e=>qd(e,"alt"),e=>qd(e,"name"),e=>qd(e,"title"),e=>qd(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return $p(e.options[0],t)}],noe=[(e,t)=>$p(e,t)],roe=10;function JT(e,t,n){let o=e,r=0;for(;r<=roe&&o&&o.nodeName!=="BODY"&&o.nodeName!=="HTML"&&o.nodeName!=="HEAD";){for(const i of t){const a=i(o,n);if(a){const{name:u,nameSource:f}=a,m=u&&u.trim();if(m)return{name:nU(tU(m)),nameSource:f}}}if(o.nodeName==="FORM")break;o=o.parentElement,r+=1}}function tU(e){return e.replace(/\s+/g," ")}function nU(e){return e.length>100?`${ZC(e,100)} [...]`:e}function ooe(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function qd(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function $p(e,t){return{name:rU(e,t)||"",nameSource:"text_content"}}function rU(e,t){if(e.isContentEditable)return;const{enablePrivacyForActionName:n,actionNameAttribute:o,defaultPrivacyLevel:r}=t;if(ju(ss.USE_TREE_WALKER_FOR_ACTION_NAME))return ioe(e,o,n,r);if("innerText"in e){let i=e.innerText;const a=u=>{const f=e.querySelectorAll(u);for(let m=0;m<f.length;m+=1){const p=f[m];if("innerText"in p){const g=p.innerText;g&&g.trim().length>0&&(i=i.replace(g,""))}}};return a(`[${Av}]`),o&&a(`[${o}]`),n&&a(`${Da(bt.HIDDEN)}, ${Da(bt.MASK)}`),i}return e.textContent}function ioe(e,t,n,o){const r=new Map,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,u);let a="";for(;i.nextNode();){const f=i.currentNode;if(ls(f)){(f.nodeName==="BR"||f.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(f).display))&&(a+=" ");continue}a+=f.textContent||""}return a.replace(/\s+/g," ").trim();function u(f){const m=cE(f,o,r);if(n&&m&&X4(f,m))return NodeFilter.FILTER_REJECT;if(ls(f)){if(f.hasAttribute(Av)||t&&f.hasAttribute(t))return NodeFilter.FILTER_REJECT;const p=getComputedStyle(f);if(p.visibility!=="visible"||p.display==="none"||p.contentVisibility&&p.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function soe(e,{onPointerDown:t,onPointerUp:n}){let o,r={selection:!1,input:!1,scroll:!1},i;const a=[Jt(e,window,"pointerdown",u=>{tO(u)&&(o=eO(),r={selection:!1,input:!1,scroll:!1},i=t(u))},{capture:!0}),Jt(e,window,"selectionchange",()=>{(!o||!eO())&&(r.selection=!0)},{capture:!0}),Jt(e,window,"scroll",()=>{r.scroll=!0},{capture:!0,passive:!0}),Jt(e,window,"pointerup",u=>{if(tO(u)&&i){const f=r;n(i,u,()=>f),i=void 0}},{capture:!0}),Jt(e,window,"input",()=>{r.input=!0},{capture:!0})];return{stop:()=>{a.forEach(u=>u.stop())}}}function eO(){const e=window.getSelection();return!e||e.isCollapsed}function tO(e){return e.target instanceof Element&&e.isPrimary!==!1}const nO=3;function aoe(e,t){if(loe(e))return t.addFrustration(Bd.RAGE_CLICK),e.some(rO)&&t.addFrustration(Bd.DEAD_CLICK),t.hasError&&t.addFrustration(Bd.ERROR_CLICK),{isRage:!0};const n=e.some(o=>o.getUserActivity().selection);return e.forEach(o=>{o.hasError&&o.addFrustration(Bd.ERROR_CLICK),rO(o)&&!n&&o.addFrustration(Bd.DEAD_CLICK)}),{isRage:!1}}function loe(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(nO-1);t+=1)if(e[t+nO-1].event.timeStamp-e[t].event.timeStamp<=fr)return!0;return!1}const coe='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 rO(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(coe)}const oU=10*fr,cf=new Map;function uoe(e){const t=cf.get(e);return cf.delete(e),t}function iU(e,t){cf.set(e,t),cf.forEach((n,o)=>{an(o,uo())>oU&&cf.delete(o)})}const doe=5*kr;function foe(e,t,n,o){const r=Ou({expireDelay:doe}),i=new _t;let a;e.subscribe(10,()=>{r.reset()}),e.subscribe(5,p),e.subscribe(11,g=>{g.reason===Dc.UNLOADING&&p()});const{stop:u}=soe(o,{onPointerDown:g=>moe(o,e,t,g,n),onPointerUp:({clickActionBase:g,hadActivityOnPointerDown:v},b,x)=>{hoe(o,e,t,n,r,i,m,g,b,x,v)}});return{stop:()=>{p(),i.notify(),u()},actionContexts:{findActionId:g=>r.findAll(g)}};function m(g){if(!a||!a.tryAppend(g)){const v=g.clone();a=Xre(g,b=>{goe(b,v)})}}function p(){a&&a.stop()}}function moe(e,t,n,o,r){let i;if(e.enablePrivacyForActionName?i=cE(o.target,e.defaultPrivacyLevel):i=bt.ALLOW,i===bt.HIDDEN)return;const a=poe(o,i,e);let u=!1;return lE(t,n,r,e,f=>{u=f.hadActivity},Z4),{clickActionBase:a,hadActivityOnPointerDown:()=>u}}function hoe(e,t,n,o,r,i,a,u,f,m,p){var g;const v=sU(t,r,m,u,f);a(v);const b=(g=u?.target)===null||g===void 0?void 0:g.selector;b&&iU(f.timeStamp,b);const{stop:x}=lE(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()},oU),w=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=i.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{w.unsubscribe(),x(),C.unsubscribe()})}function poe(e,t,n){const o=e.target.getBoundingClientRect(),r=mm(e.target,n.actionNameAttribute);r&&iU(e.timeStamp,r);const{name:i,nameSource:a}=eoe(e.target,n,t);return{type:sE.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,nameSource:a}}function sU(e,t,n,o,r){const i=mr(),a=Pn(),u=t.add(i,a.relative),f=G4({lifeCycle:e,isChildEvent:x=>x.action!==void 0&&(Array.isArray(x.action.id)?x.action.id.includes(i):x.action.id===i)});let m=0,p;const g=[],v=new _t;function b(x){m===0&&(p=x,m=1,p?u.close(KC(p)):u.remove(),f.stop(),v.notify())}return{event:r,stop:b,stopObservable:v,get hasError(){return f.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:x=>{g.push(x)},startClocks:a,isStopped:()=>m===1||m===2,clone:()=>sU(e,t,n,o,r),validate:x=>{if(b(),m!==1)return;const{resourceCount:w,errorCount:C,longTaskCount:E}=f.eventCounts,j={duration:p&&an(a.timeStamp,p),startClocks:a,id:i,frustrationTypes:g,counts:{resourceCount:w,errorCount:C,longTaskCount:E},events:x??[r],event:r,...o};e.notify(0,j),m=2},discard:()=>{b(),m=2}}}function goe(e,t){const{isRage:n}=aoe(e,t);n?(e.forEach(o=>o.discard()),t.stop(Kn()),t.validate(e.map(o=>o.event))):(t.discard(),e.forEach(o=>o.validate()))}function voe(e,t,n,o,r){const{unsubscribe:i}=e.subscribe(0,f=>{e.notify(12,oO(f))});t.register(0,({startTime:f,eventType:m})=>{if(m!==at.ERROR&&m!==at.RESOURCE&&m!==at.LONG_TASK)return fo;const p=a.findActionId(f);return p?{type:m,action:{id:p}}:fo}),t.register(1,({startTime:f})=>({action:{id:a.findActionId(f)}}));let a={findActionId:kt},u=kt;return r.trackUserInteractions&&({actionContexts:a,stop:u}=foe(e,n,o,r)),{addAction:f=>{e.notify(12,oO(f))},actionContexts:a,stop:()=>{i(),u()}}}function oO(e){const t=u_(e)?{action:{id:e.id,loading_time:q4(st(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=as({action:{id:mr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:at.ACTION},t),o=u_(e)?e.duration:void 0,r=u_(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:o,startTime:e.startClocks.relative,domainContext:r}}function u_(e){return e.type!==sE.CUSTOM}function yoe(e){const t=Zte([xv.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function boe(e,t){const n=mte(e,[Ef.cspViolation,Ef.intervention]).subscribe(o=>t.notify(o));return{stop:()=>{n.unsubscribe()}}}function xoe(e,t,n){const o=new _t;return n.subscribe(r=>{r.type===0&&o.notify(r.error)}),yoe(o),boe(t,o),o.subscribe(r=>e.notify(14,{error:r})),_oe(e)}function _oe(e){return e.subscribe(14,({error:t})=>{e.notify(12,Soe(t))}),{addError:({error:t,handlingStack:n,componentStack:o,startClocks:r,context:i})=>{const a=JC({originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:"Provided",source:Nu.CUSTOM,handling:"handled"});a.context=as(a.context,i),e.notify(14,{error:a})}}}function Soe(e){const t={date:e.startClocks.timeStamp,error:{id:mr(),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:at.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const iO=new WeakSet;function woe(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=>!iO.has(o)).filter(o=>V4(o)&&B4(o)).filter(o=>Coe(o,e.startClocks.relative,aU({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return iO.add(n[0]),n[0].toJSON()}function aU(e){return Eu(e.startTime,e.duration)}function Coe(e,t,n){return e.startTime>=t-1&&aU(e)<=Eu(n,1)}const Eoe=2*kr;function Roe(e){const t=joe(e)||Noe(e);if(!(!t||t.traceTime<=jr()-Eoe))return t.traceId}function joe(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return lU(t&&t.content,n&&n.content)}function Noe(e){const t=koe(e);if(t)return lU(_f(t,"trace-id"),_f(t,"trace-time"))}function lU(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function koe(e){for(let t=0;t<e.childNodes.length;t+=1){const n=sO(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=sO(n);if(o)return o;if(!LS(n))break}}function sO(e){if(e&&Ere(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function cU(){if(wl(Ct.NAVIGATION)){const n=performance.getEntriesByType(Ct.NAVIGATION)[0];if(n)return n}const e=Toe(),t={entryType:Ct.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 Toe(){const e={},t=performance.timing;for(const n in t)if(am(t[n])){const o=n,r=t[o];e[o]=r===0?0:KC(r)}return e}function Ooe(e,t,n=cU){rE(e,"interactive",()=>{const o=n(),r=Object.assign(o.toJSON(),{entryType:Ct.RESOURCE,initiatorType:L4,duration:o.responseEnd,traceId:Roe(document),toJSON:()=>({...r,toJSON:void 0})});t(r)})}const Aoe=1e3;function Ioe(e){const t=new Set,n=e.subscribe(8,o=>{t.add(o),t.size>Aoe&&(Tu("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(o){let r=1/0,i;for(const a of t){const u=o.startTime-a.startClocks.relative;0<=u&&u<r&&a.url===o.name&&(r=Math.abs(u),i=a)}return i&&t.delete(i),i},stop(){n.unsubscribe()}}}const $oe=32*iu;function Moe(e,t){return t.allowedGraphQlUrls.find(n=>Nv([n.match],e))}function Poe(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const o=n.query.trim(),r=Doe(o),i=n.operationName;if(!r)return;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:r,operationName:i,variables:a,payload:t?ZC(o,$oe,"..."):void 0}}function Doe(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}function zoe(e,t,n,o=Kte(),r=Ooe){let i;const a=t.trackEarlyRequests;a?i=Ioe(e):e.subscribe(8,m=>{f(()=>Uoe(m,t,n))});const u=Ni(t,{type:Ct.RESOURCE,buffered:!0}).subscribe(m=>{for(const p of m)(a||!F4(p))&&f(()=>aO(p,t,n,i))});r(t,m=>{f(()=>aO(m,t,n,i))});function f(m){o.push(()=>{const p=m();p&&e.notify(12,p)})}return{stop:()=>{o.stop(),u.unsubscribe()}}}function Uoe(e,t,n){const o=woe(e);return uU(o,e,n,t)}function aO(e,t,n,o){const r=F4(e)&&o?o.getMatchingRequest(e):void 0;return uU(e,r,n,t)}function uU(e,t,n,o){if(!e&&!t)return;const r=t?Boe(t,o):Hoe(e,o);if(!o.trackResources&&!r)return;const i=e?Sv(e.startTime):t.startClocks,a=e?are(e):qoe(n,i,t.duration),u=t&&Loe(t,o),f=as({date:i.timeStamp,resource:{id:mr(),duration:st(a),type:t?t.type===Ov.XHR?wr.XHR:wr.FETCH:sre(e),method:t?t.method:void 0,status_code:t?t.status:Goe(e.responseStatus),url:t?pre(t.url):e.name,protocol:e&&ure(e),delivery_type:e&&dre(e),graphql:u},type:at.RESOURCE,_dd:{discarded:!o.trackResources}},r,e&&Voe(e));return{startTime:i.relative,duration:a,rawRumEvent:f,domainContext:Foe(e,t)}}function Loe(e,t){if(!ju(ss.GRAPHQL_TRACKING))return;const n=Moe(e.url,t);if(n)return Poe(e.body,n.trackPayload)}function Foe(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Ov.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function Voe(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...fre(e),...lre(e)}}}function Boe(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 Hoe(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:P4().toString(),rule_psr:t.rulePsr}}}function qoe(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function Goe(e){return e===0?void 0:e}function Koe(e,t,n){const{stop:o,eventCounts:r}=G4({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:o,eventCounts:r}}const Zoe=10*kr;function Yoe(e,t,n){return{stop:Ni(e,{type:Ct.PAINT,buffered:!0}).subscribe(r=>{const i=r.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<Zoe);i&&n(i.startTime)}).unsubscribe}}function Woe(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(an(e,uo()))})})}function Xoe(e,t,n){const o=Ni(e,{type:Ct.FIRST_INPUT,buffered:!0}).subscribe(r=>{const i=r.find(a=>a.startTime<t.timeStamp);if(i){const a=an(i.startTime,i.processingStart);let u;i.target&&ls(i.target)&&(u=mm(i.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:i.startTime,targetSelector:u})}});return{stop:()=>{o.unsubscribe()}}}function Qoe(e,t,n=cU){return tie(e,()=>{const o=n();eie(o)||t(Joe(o))})}function Joe(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=uo()?e.responseStart:void 0}}function eie(e){return e.loadEventEnd<=0}function tie(e,t){let n;const{stop:o}=rE(e,"complete",()=>{n=cr(()=>t())});return{stop:()=>{o(),Io(n)}}}const nie=10*kr;function rie(e,t,n,o){let r=1/0;const{stop:i}=oa(e,n,["pointerdown","keydown"],f=>{r=f.timeStamp},{capture:!0,once:!0});let a=0;const u=Ni(e,{type:Ct.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(f=>{const m=Uz(f,p=>p.entryType===Ct.LARGEST_CONTENTFUL_PAINT&&p.startTime<r&&p.startTime<t.timeStamp&&p.startTime<nie&&p.size>a);if(m){let p;m.element&&(p=mm(m.element,e.actionNameAttribute)),o({value:m.startTime,targetSelector:p,resourceUrl:oie(m)}),a=m.size}});return{stop:()=>{i(),u.unsubscribe()}}}function oie(e){return e.url===""?void 0:e.url}function dU(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:kt};if(wl(Ct.VISIBILITY_STATE)){const i=performance.getEntriesByType(Ct.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:kt}}let o=1/0;const{stop:r}=oa(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 iie(e,t,n,o){const r={},{stop:i}=Qoe(e,g=>{n(g.loadEvent),r.navigationTimings=g,o()}),a=dU(e,t),{stop:u}=Yoe(e,a,g=>{r.firstContentfulPaint=g,o()}),{stop:f}=rie(e,a,window,g=>{r.largestContentfulPaint=g,o()}),{stop:m}=Xoe(e,a,g=>{r.firstInput=g,o()});function p(){i(),u(),f(),m(),a.stop()}return{stop:p,initialViewMetrics:r}}const FS=(e,t)=>e*t,sie=(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:FS(r-n,i-o)},lO=e=>{const t=FS(e.previousRect.width,e.previousRect.height),n=FS(e.currentRect.width,e.currentRect.height),o=sie(e.previousRect,e.currentRect);return t+n-o};function aie(e,t,n){if(!fie())return{stop:kt};let o=0,r;n({value:0});const i=die(),a=Ni(e,{type:Ct.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=lie(m.sources);r={target:v?.node?new WeakRef(v.node):void 0,time:an(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:sf(o,4),targetSelector:v&&mm(v,e.actionNameAttribute),time:r?.time,previousRect:r?.previousRect?cO(r.previousRect):void 0,currentRect:r?.currentRect?cO(r.currentRect):void 0,devicePixelRatio:r?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function lie(e){let t;for(const n of e)if(n.node&&ls(n.node)){const o=lO(n);(!t||lO(t)<o)&&(t=n)}return t}function cO({x:e,y:t,width:n,height:o}){return{x:e,y:t,width:n,height:o}}const cie=5*fr,uie=fr;function die(){let e=0,t,n,o=0;return{update:r=>{const i=t===void 0||r.startTime-n>=uie||r.startTime-t>=cie;let a;return i?(t=n=r.startTime,o=e=r.value,a=!0):(e+=r.value,n=r.startTime,a=r.value>o,a&&(o=r.value)),{cumulatedValue:e,isMaxValue:a}}}}function fie(){return wl(Ct.LAYOUT_SHIFT)&&"WeakRef"in window}let Mp,fU=0,d_=1/0,f_=0;function mie(){"interactionCount"in performance||Mp||(Mp=new window.PerformanceObserver(et(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(d_=Math.min(d_,n.interactionId),f_=Math.max(f_,n.interactionId),fU=(f_-d_)/7+1)})})),Mp.observe({type:"event",buffered:!0,durationThreshold:0}))}const uO=()=>Mp?fU:window.performance.interactionCount||0,dO=10,hie=1*kr;function pie(e,t,n){if(!yie())return{getInteractionToNextPaint:()=>{},setViewEnd:kt,stop:kt};const{getViewInteractionCount:o,stopViewInteractionCount:r}=vie(n);let i=1/0;const a=gie(o);let u=-1,f,m;function p(b){for(const w of b)w.interactionId&&w.startTime>=t&&w.startTime<=i&&a.process(w);const x=a.estimateP98Interaction();x&&x.duration!==u&&(u=x.duration,m=an(t,x.startTime),f=uoe(x.startTime),!f&&x.target&&ls(x.target)&&(f=mm(x.target,e.actionNameAttribute)))}const g=Ni(e,{type:Ct.FIRST_INPUT,buffered:!0}).subscribe(p),v=Ni(e,{type:Ct.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(u>=0)return{value:Math.min(u,hie),targetSelector:f,time:m};if(o())return{value:0}},setViewEnd:b=>{i=b,r()},stop:()=>{v.unsubscribe(),g.unsubscribe()}}}function gie(e){const t=[];function n(){t.sort((o,r)=>r.duration-o.duration).splice(dO)}return{process(o){const r=t.findIndex(a=>o.interactionId===a.interactionId),i=t[t.length-1];r!==-1?o.duration>t[r].duration&&(t[r]=o,n()):(t.length<dO||o.duration>i.duration)&&(t.push(o),n())},estimateP98Interaction(){const o=Math.min(t.length-1,Math.floor(e()/50));return t[o]}}}function vie(e){mie();const t=e===ns.INITIAL_LOAD?0:uO();let n={stopped:!1};function o(){return uO()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:o(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:o()}}}}function yie(){return wl(Ct.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function bie(e,t,n,o,r,i,a){let u=r===ns.INITIAL_LOAD,f=!0;const m=[],p=dU(o,i);function g(){if(!f&&!u&&m.length>0){const b=Math.max(...m);b<p.timeStamp-i.relative&&a(b)}}const{stop:v}=lE(e,t,n,o,b=>{f&&(f=!1,b.hadActivity&&m.push(an(i.timeStamp,b.end)),g())});return{stop:()=>{v(),p.stop()},setLoadEvent:b=>{u&&(u=!1,m.push(b),g())}}}function e_e(){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 xie(){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 m_;function _ie(e){return m_||(m_=Sie(e)),m_}function Sie(e){return new _t(t=>{const{throttled:n}=Cv(()=>{t.notify(uE())},200);return Jt(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function uE(){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 wie=fr;function Cie(e,t,n,o=Rie(e)){let r=0,i=0,a=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=uo();a=an(t.relative,v),g=!0}g&&n({maxDepth:Math.min(r,i),maxDepthScrollTop:m,maxScrollHeight:i,maxScrollHeightTime:a})});return{stop:()=>u.unsubscribe()}}function Eie(){const e=xie(),{height:t}=uE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),o=Math.round(t+e);return{scrollHeight:n,scrollDepth:o,scrollTop:e}}function Rie(e,t=wie){return new _t(n=>{function o(){n.notify(Eie())}if(window.ResizeObserver){const r=Cv(o,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,a=new ResizeObserver(et(r.throttled));i&&a.observe(i);const u=Jt(e,window,"scroll",r.throttled,{passive:!0});return()=>{r.cancel(),a.disconnect(),u.stop()}}})}function jie(e,t,n,o,r,i,a){const u={},{stop:f,setLoadEvent:m}=bie(e,t,n,o,i,a,w=>{u.loadingTime=w,r()}),{stop:p}=Cie(o,a,w=>{u.scroll=w}),{stop:g}=aie(o,a.relative,w=>{u.cumulativeLayoutShift=w,r()}),{stop:v,getInteractionToNextPaint:b,setViewEnd:x}=pie(o,a.relative,i);return{stop:()=>{f(),g(),p()},stopINPTracking:v,setLoadEvent:m,setViewEnd:x,getCommonViewMetrics:()=>(u.interactionToNextPaint=b(),u)}}function Nie(e,t){const{stop:n}=Jt(e,window,"pageshow",o=>{o.persisted&&t(o)},{capture:!0});return n}function kie(e,t,n){Woe(e.relative,o=>{t.firstContentfulPaint=o,t.largestContentfulPaint={value:o},n()})}const Tie=3e3,Oie=5*kr,Aie=5*kr;function Iie(e,t,n,o,r,i,a,u){const f=new Set;let m=v(ns.INITIAL_LOAD,kz(),u),p;b();let g;a&&(g=x(i),r.trackBfcacheViews&&(p=Nie(r,w=>{m.end();const C=Sv(w.timeStamp);m=v(ns.BF_CACHE,C,void 0)})));function v(w,C,E){const j=$ie(t,n,o,r,e,w,C,E);return f.add(j),j.stopObservable.subscribe(()=>{f.delete(j)}),j}function b(){t.subscribe(10,()=>{m=v(ns.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 x(w){return w.subscribe(({oldLocation:C,newLocation:E})=>{Pie(C,E)&&(m.end(),m=v(ns.ROUTE_CHANGE))})}return{addTiming:(w,C=Kn())=>{m.addTiming(w,C)},startView:(w,C)=>{m.end({endClocks:C}),m=v(ns.ROUTE_CHANGE,C,w)},setViewContext:w=>{m.contextManager.setContext(w)},setViewContextProperty:(w,C)=>{m.contextManager.setContextProperty(w,C)},setViewName:w=>{m.setViewName(w)},getViewContext:()=>m.contextManager.getContext(),stop:()=>{g&&g.unsubscribe(),p&&p(),m.end(),f.forEach(w=>w.stop())}}}function $ie(e,t,n,o,r,i,a=Pn(),u){const f=mr(),m=new _t,p={};let g=0,v;const b=xf(r),x=Tv();let w=!0,C=u?.name;const E=u?.service||o.service,j=u?.version||o.version,N=u?.context;N&&x.setContext(N);const O={id:f,name:C,startClocks:a,service:E,version:j,context:N};e.notify(1,O),e.notify(2,O);const{throttled:k,cancel:T}=Cv(M,Tie,{leading:!1}),{setLoadEvent:A,setViewEnd:$,stop:L,stopINPTracking:G,getCommonViewMetrics:ae}=jie(e,t,n,o,ie,i,a),{stop:re,initialViewMetrics:se}=i===ns.INITIAL_LOAD?iie(o,a,A,ie):{stop:kt,initialViewMetrics:{}};i===ns.BF_CACHE&&kie(a,se,ie);const{stop:ue,eventCounts:oe}=Koe(e,f,ie),P=Ru(M,Oie),Z=e.subscribe(11,V=>{V.reason===Dc.UNLOADING&&M()});M(),x.changeObservable.subscribe(ie);function U(){e.notify(3,{id:f,name:C,context:x.getContext(),startClocks:a,sessionIsActive:w})}function ie(){U(),k()}function M(){T(),U(),g+=1;const V=v===void 0?Kn():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:g,id:f,name:C,service:E,version:j,context:x.getContext(),loadingType:i,location:b,startClocks:a,commonViewMetrics:ae(),initialViewMetrics:se,duration:an(a.timeStamp,V),isActive:v===void 0,sessionIsActive:w,eventCounts:oe})}return{get name(){return C},service:E,version:j,contextManager:x,stopObservable:m,end(V={}){var le,X;v||(v=(le=V.endClocks)!==null&&le!==void 0?le:Pn(),w=(X=V.sessionIsActive)!==null&&X!==void 0?X:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),wv(P),$(v.relative),L(),Z.unsubscribe(),M(),cr(()=>{this.stop()},Aie))},stop(){re(),ue(),G(),m.notify()},addTiming(V,le){if(v)return;const X=eJ(le)?le:an(a.timeStamp,le);p[Mie(V)]=X,ie()},setViewName(V){C=V,M()}}}function Mie(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&ot.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Pie(e,t){return e.pathname!==t.pathname||!Die(t.hash)&&fO(t.hash)!==fO(e.hash)}function Die(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function fO(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function zie(e,t,n,o,r,i,a,u,f,m){return e.subscribe(4,p=>e.notify(12,Uie(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}}:ia}),t.register(1,({startTime:p})=>{var g;return{view:{id:(g=f.findView(p))===null||g===void 0?void 0:g.id}}}),Iie(o,e,r,i,n,a,!n.trackViewsManually,m)}function Uie(e,t,n){var o,r,i,a,u,f,m,p,g,v,b,x,w,C,E,j,N,O;const k=n.getReplayStats(e.id),T=(r=(o=e.commonViewMetrics)===null||o===void 0?void 0:o.cumulativeLayoutShift)===null||r===void 0?void 0:r.devicePixelRatio,A={_dd:{document_version:e.documentVersion,replay_stats:k,cls:T?{device_pixel_ratio:T}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:at.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:st((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(u=e.commonViewMetrics.cumulativeLayoutShift)===null||u===void 0?void 0:u.targetSelector,first_byte:st((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.firstByte),dom_complete:st((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domComplete),dom_content_loaded:st((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:st((g=e.initialViewMetrics.navigationTimings)===null||g===void 0?void 0:g.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:st(e.initialViewMetrics.firstContentfulPaint),first_input_delay:st((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:st((b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.time),first_input_target_selector:(x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.targetSelector,interaction_to_next_paint:st((w=e.commonViewMetrics.interactionToNextPaint)===null||w===void 0?void 0:w.value),interaction_to_next_paint_time:st((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:st((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:st((O=e.initialViewMetrics.navigationTimings)===null||O===void 0?void 0:O.loadEvent),loading_time:q4(st(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Lie(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:st(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:st(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:une()}};return bl(e.customTimings)||(A.view.custom_timings=Az(e.customTimings,st)),{rawRumEvent:A,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Lie({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:o,largestContentfulPaint:r}){return{cls:e&&{score:e.value,timestamp:st(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:st(n)},fid:o&&{duration:st(o.delay),timestamp:st(o.time),target_selector:o.targetSelector},inp:t&&{duration:st(t.value),timestamp:st(t.time),target_selector:t.targetSelector},lcp:r&&{timestamp:st(r.value),target_selector:r.targetSelector,resource_url:r.resourceUrl}}}const Fie="rum";function Vie(e,t,n){const o=Ete(e,Fie,r=>Hie(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 a=o.findSession();a&&(a.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 Bie(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:h4("records")?1:0};return{findTrackedSession:()=>e,expire:kt,expireObservable:new _t,setForcedReplay:kt}}function Hie(e,t){return qie(t)?t:Ba(e.sessionSampleRate)?Ba(e.sessionReplaySampleRate)?"1":"2":"0"}function qie(e){return e==="0"||e==="1"||e==="2"}function Gie(e,t,n,o,r,i){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const u=p4({encoder:i(2),request:m4(a,e.batchBytesLimit,n),flushController:g4({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:o,sessionExpireObservable:r}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,f=>{f.type===at.VIEW?u.upsert(f,f.view.id):u.add(f)}),u}function Kie(e){const t=fm();e.subscribe(13,n=>{t.send("rum",n)})}const Zie=xl;function Yie(e,t,n,o){const r=Ou({expireDelay:Zie});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 a=n.subscribe(({newLocation:f})=>{const m=r.find();if(m){const p=uo();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}}:ia}),{findUrl:f=>r.find(f),stop:()=>{a.unsubscribe(),r.stop()}}}function Wie(e,t){let n=xf(t);return new _t(o=>{const{stop:r}=Xie(e,a),{stop:i}=Qie(e,a);function a(){if(n.href===t.href)return;const u=xf(t);o.notify({newLocation:u,oldLocation:n}),n=u}return()=>{r(),i()}})}function Xie(e,t){const{stop:n}=Si(mO("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:o}=Si(mO("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:r}=Jt(e,window,"popstate",t);return{stop:()=>{n(),o(),r()}}}function Qie(e,t){return Jt(e,window,"hashchange",t)}function mO(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Jie=xl;function ese(e,t,n){const o=Ou({expireDelay:Jie});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([at.VIEW,at.ERROR]).includes(i))return fo;const u=o.find(r);return!u||bl(u)?fo:{type:i,feature_flags:u}}),{addFeatureFlagEvaluation:(r,i)=>{const a=o.find();a&&(a[r]=i)}}}const tse=10*fr;let zc,lp;function nse(e,t,n){e.metricsEnabled&&(mU(),lp=!1,t.subscribe(13,()=>{lp=!0}),n.subscribe(({bytesCount:o,messagesCount:r})=>{lp&&(lp=!1,zc.batchCount+=1,pO(zc.batchBytesCount,o),pO(zc.batchMessagesCount,r))}),Ru(rse,tse))}function rse(){zc.batchCount!==0&&(kv("Customer data measures",zc),mU())}function hO(){return{min:1/0,max:0,sum:0}}function pO(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function mU(){zc={batchCount:0,batchBytesCount:hO(),batchMessagesCount:hO()}}const ose=4e3,ise=500,sse=xl;function ase(e,t,n=ise){const o=Ou({expireDelay:sse,maxEntries:ose});let r;wl(Ct.VISIBILITY_STATE)&&performance.getEntriesByType(Ct.VISIBILITY_STATE).forEach(m=>{const p=m.name==="hidden"?"hidden":"active";a(p,m.startTime)}),a(hU(),uo());const{stop:i}=oa(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],f=>{a(cse(f),f.timeStamp)},{capture:!0});function a(f,m=uo()){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===at.VIEW){const g=o.findAll(f,m);return{type:p,_dd:{page_states:lse(g,f,n)}}}return p===at.ACTION||p===at.ERROR?{type:p,view:{in_foreground:u("active",f,0)}}:fo}),{wasInPageStateDuringPeriod:u,addPageState:a,stop:()=>{i(),o.stop()}}}function lse(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:o,startTime:r})=>({state:o,start:st(an(t,r))}))}function cse(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":hU()}function hU(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function use(e,t){let n;const o=requestAnimationFrame(et(()=>{n=uE()})),r=_ie(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 dse(e,t){const n=window.cookieStore?fse(e):hse;return new _t(o=>n(t,r=>o.notify(r)))}function fse(e){return(t,n)=>Jt(e,window.cookieStore,"change",r=>{const i=r.changed.find(a=>a.name===t)||r.deleted.find(a=>a.name===t);i&&n(i.value)}).stop}const mse=fr;function hse(e,t){const n=_f(document.cookie,e),o=Ru(()=>{const r=_f(document.cookie,e);r!==n&&t(r)},mse);return()=>{wv(o)}}const gO="datadog-ci-visibility-test-execution-id";function pse(e,t,n=dse(e,gO)){var o;let r=Bs(gO)||((o=window.Cypress)===null||o===void 0?void 0:o.env("traceId"));const i=n.subscribe(a=>{r=a});return t.register(0,({eventType:a})=>typeof r!="string"?fo:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:r}}),{stop:()=>{i.unsubscribe()}}}function gse(e,t){const n=Ni(t,{type:Ct.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(o=>{for(const r of o){const i=Sv(r.startTime),a={date:i.timeStamp,long_task:{id:mr(),entry_type:O4.LONG_ANIMATION_FRAME,duration:st(r.duration),blocking_duration:st(r.blockingDuration),first_ui_event_timestamp:st(r.firstUIEventTimestamp),render_start:st(r.renderStart),style_and_layout_start:st(r.styleAndLayoutStart),start_time:st(r.startTime),scripts:r.scripts.map(u=>({duration:st(u.duration),pause_duration:st(u.pauseDuration),forced_style_and_layout_duration:st(u.forcedStyleAndLayoutDuration),start_time:st(u.startTime),execution_start:st(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:at.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop:()=>n.unsubscribe()}}function vse(e,t){const n=Ni(t,{type:Ct.LONG_TASK,buffered:!0}).subscribe(o=>{for(const r of o){if(r.entryType!==Ct.LONG_TASK||!t.trackLongTasks)break;const i=Sv(r.startTime),a={date:i.timeStamp,long_task:{id:mr(),entry_type:O4.LONG_TASK,duration:st(r.duration)},type:at.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop(){n.unsubscribe()}}}function yse(e){e.register(0,({eventType:t})=>{if(!E4())return fo;const n=w4(),o=C4();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:o,injected:S4()}}})}function bse(e,t,n){const o=tE(e),r=n(o);return WC(t).forEach(([i,a])=>VS(e,o,i.split(/\.|(?=\[\])/),a)),r}function VS(e,t,n,o){const[r,...i]=n;if(r==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,u)=>VS(a,t[u],i,o));return}if(!(!vO(e)||!vO(t))){if(i.length>0)return VS(e[r],t[r],i,o);xse(e,r,t[r],o)}}function xse(e,t,n,o){const r=_l(n);r===o?e[t]=Ft(n):o==="object"&&(r==="undefined"||r==="null")&&(e[t]={})}function vO(e){return _l(e)==="object"}const bc={"view.name":"string","view.url":"string","view.referrer":"string"},xc={context:"object"},_c={service:"string",version:"string"};let pU;function _se(e,t,n,o){pU={[at.VIEW]:{"view.performance.lcp.resource_url":"string",...xc,...bc,..._c},[at.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...xc,...bc,..._c},[at.RESOURCE]:{"resource.url":"string",...ju(ss.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...xc,...bc,..._c},[at.ACTION]:{"action.target.name":"string",...xc,...bc,..._c},[at.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...xc,...bc,..._c},[at.VITAL]:{...xc,...bc,..._c}};const r={[at.ERROR]:n_(at.ERROR,e.eventRateLimiterThreshold,o),[at.ACTION]:n_(at.ACTION,e.eventRateLimiterThreshold,o),[at.VITAL]:n_(at.VITAL,e.eventRateLimiterThreshold,o)};t.subscribe(12,({startTime:i,duration:a,rawRumEvent:u,domainContext:f})=>{const m=n.triggerHook(0,{eventType:u.type,startTime:i,duration:a});if(m===ia)return;const p=as(m,u,{ddtags:n4(e).join(",")});Sse(p,e.beforeSend,f,r)&&(bl(p.context)&&delete p.context,t.notify(13,p))})}function Sse(e,t,n,o){var r;if(t){const a=bse(e,pU[e.type],u=>t(u,n));if(a===!1&&e.type!==at.VIEW)return!1;a===!1&&ot.warn("Can't dismiss view events using beforeSend!")}return!((r=o[e.type])===null||r===void 0?void 0:r.isLimitReached())}function wse(e,t,n,o){e.register(0,({eventType:r,startTime:i})=>{const a=t.findTrackedSession(i),u=o.findView(i);if(!a||!u)return ia;let f,m,p;return r===at.VIEW?(f=n.getReplayStats(u.id)?!0:void 0,m=a.sessionReplay===1,p=u.sessionIsActive?void 0:!1):f=n.isRecording()?!0:void 0,{type:r,session:{id:a.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}}:fo})}function Cse(e){e.register(0,({eventType:t})=>({type:t,connectivity:i4()}))}function Ese(e,t,n){e.register(0,({eventType:o})=>{const r=t.source;return{type:o,_dd:{format_version:2,drift:QQ(),configuration:{session_sample_rate:sf(t.sessionSampleRate,3),session_replay_sample_rate:sf(t.sessionReplaySampleRate,3),profiling_sample_rate:sf(t.profilingSampleRate,3)},browser_sdk_version:lu()?"6.21.2":void 0,sdk_name:n},application:{id:t.applicationId},date:Kn(),source:r}}),e.register(1,()=>({application:{id:t.applicationId}}))}function Rse(e,t){e.register(1,()=>t.isGranted()?fo:ia)}const jse=zee,Nse=[at.ACTION,at.ERROR,at.LONG_TASK,at.RESOURCE,at.VITAL];function kse(e){return{addEvent:(t,n,o,r)=>{Nse.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:o,duration:r})}}}function Tse(e,t){if(!t.metricsEnabled)return{stop:kt};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:o})=>{!o.largestContentfulPaint||!o.navigationTimings||(kv("Initial view metrics",{metrics:Ose(o.largestContentfulPaint,o.navigationTimings)}),n())});return{stop:n}}function Ose(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function Ase(e,t,n,o,r,i,a,u,f){const m=[],p=new nre,g=jse();p.subscribe(13,pe=>o4("rum",pe));const v=pe=>{p.notify(14,{error:pe}),Tu("Error reported to customer",{"error.message":pe.message})},b=Pee(e),x=b.subscribe(pe=>{p.notify(11,pe)});m.push(()=>x.unsubscribe());const w=Vee("browser-rum-sdk",e,g,v,b,r);m.push(w.stop);const C=lu()?Bie():Vie(e,p,i);if(lu())Kie(p);else{const pe=Gie(e,p,v,b,C.expireObservable,r);m.push(()=>pe.stop()),nse(w,p,pe.flushController.flushObservable)}const E=Qne(),j=Wie(e,location),{observable:N,stop:O}=ere();m.push(O),Ese(g,e,f);const k=ase(g,e),T=ore(p);m.push(()=>T.stop());const A=Yie(p,g,j,location);m.push(()=>A.stop());const $=ese(p,g,e);wse(g,C,t,T),Cse(g),Rse(g,i);const L=ine(g,e,"rum"),G=sne(g,e,C,"rum"),ae=one(g,e,"rum"),{actionContexts:re,addAction:se,addEvent:ue,stop:oe}=Ise(p,g,e,k,E,N,v);m.push(oe);const{addTiming:P,startView:Z,setViewName:U,setViewContext:ie,setViewContextProperty:M,getViewContext:V,stop:le}=zie(p,g,e,location,E,N,j,t,T,o);m.push(le);const{stop:X}=Tse(p,w);m.push(X);const{stop:H}=zoe(p,e,k);if(m.push(H),e.trackLongTasks)if(wl(Ct.LONG_ANIMATION_FRAME)){const{stop:pe}=gse(p,e);m.push(pe)}else vse(p,e);const{addError:fe}=xoe(p,e,u);u.unbuffer(),gre(p,e,C,G,ae);const me=fne(p,k,a),ce=tre(e.applicationId,C,T,re,A);return m.push(()=>n.stop()),{addAction:se,addEvent:ue,addError:fe,addTiming:P,addFeatureFlagEvaluation:$.addFeatureFlagEvaluation,startView:Z,setViewContext:ie,setViewContextProperty:M,getViewContext:V,setViewName:U,lifeCycle:p,viewHistory:T,session:C,stopSession:()=>C.expire(),getInternalContext:ce.get,startDurationVital:me.startDurationVital,stopDurationVital:me.stopDurationVital,addDurationVital:me.addDurationVital,addOperationStepVital:me.addOperationStepVital,globalContext:L,userContext:G,accountContext:ae,telemetry:w,stop:()=>{m.forEach(pe=>pe())},hooks:g}}function Ise(e,t,n,o,r,i,a){const u=voe(e,t,r,i,n),f=kse(e),m=use(t,n),p=pse(n,t);return yse(t),_se(n,e,t,a),{pageStateHistory:o,addAction:u.addAction,addEvent:f.addEvent,actionContexts:u.actionContexts,stop:()=>{u.stop(),p.stop(),m.stop(),o.stop()}}}function $se(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 a=Mse(e),u=`/rum/replay/sessions/${r}`;return`${a}${u}?${i.join("&")}`}function Mse(e){const t=e.site,n=e.subdomain||Pse(e);return`https://${n?`${n}.`:""}${t}`}function Pse(e){switch(e.site){case Ha:case yee:return"app";case r4:return"dd";default:return}}const Dse=1e3;let Oo;function t_e(e){return $v(e).segments_count}function n_e(e){$v(e).segments_count+=1}function r_e(e){$v(e).records_count+=1}function o_e(e,t){$v(e).segments_total_raw_size+=t}function zse(e){return Oo?.get(e)}function $v(e){Oo||(Oo=new Map);let t;return Oo.has(e)?t=Oo.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},Oo.set(e,t),Oo.size>Dse&&Use()),t}function Use(){if(!Oo)return;const e=Oo.keys().next().value;e&&Oo.delete(e)}function gU(e,t,n){let o=0,r=[],i,a=!0,u=0;const f=[],{stop:m}=Jt(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const b=f[0];b&&(b.id===v.id?(f.shift(),o+=v.additionalBytesCount,r.push(v.result),i=v.trailer,b.writeCallback?b.writeCallback(v.result.byteLength):b.finishCallback&&b.finishCallback()):b.id<v.id&&m())});function p(){const v=r.length===0?new Uint8Array(0):nJ(r.concat(i)),b={rawBytesCount:o,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return o=0,r=[],b}function g(){a||(t.postMessage({action:"reset",streamId:n}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(v,b){t.postMessage({action:"write",id:u,data:v,streamId:n}),f.push({id:u,writeCallback:b,data:v}),a=!1,u+=1},finish(v){g(),f.length?(f.forEach(b=>{delete b.writeCallback}),f[f.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){g();const v=f.map(b=>b.data).join("");return f.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){m()}}}function dE({configuredUrl:e,error:t,source:n,scriptType:o}){if(ot.error(`${n} failed to start: an error occurred while initializing the ${o}:`,t),t instanceof Event||t instanceof Error&&Lse(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.",ot.error(`${r} See documentation at ${_v}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else o==="worker"&&nE(t)}function Lse(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Fse=30*fr;function vU(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.21.2"};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 yn={status:0};function yU(e,t,n,o=vU){switch(yn.status===0&&Vse(e,t,o),yn.status){case 1:return yn.initializationFailureCallbacks.push(n),yn.worker;case 3:return yn.worker}}function yO(){return yn.status}function Vse(e,t,n=vU){try{const o=n(e),{stop:r}=Jt(e,o,"error",u=>{h_(e,t,u)}),{stop:i}=Jt(e,o,"message",({data:u})=>{u.type==="errored"?h_(e,t,u.error,u.streamId):u.type==="initialized"&&Hse(u.version)});o.postMessage({action:"init"}),cr(()=>Bse(t),Fse),yn={status:1,worker:o,stop:()=>{r(),i()},initializationFailureCallbacks:[]}}catch(o){h_(e,t,o)}}function Bse(e){yn.status===1&&(ot.error(`${e} failed to start: a timeout occurred while initializing the Worker`),yn.initializationFailureCallbacks.forEach(t=>t()),yn={status:2})}function Hse(e){yn.status===1&&(yn={status:3,worker:yn.worker,stop:yn.stop,version:e})}function h_(e,t,n,o){yn.status===1||yn.status===0?(dE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),yn.status===1&&yn.initializationFailureCallbacks.forEach(r=>r()),yn={status:2}):nE(n,{worker_version:yn.status===3&&yn.version,stream_id:o})}function bU(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function qse(e,t,n,o){const r=t.findTrackedSession(),i=Gse(r,o),a=n.findView();return $se(e,{viewContext:a,errorType:i,session:r})}function Gse(e,t){if(!bU())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function Kse(e,t){if(!e.metricsEnabled)return{stop:kt};let n,o,r;const{unsubscribe:i}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:Kn()},o=void 0,r=void 0;break;case"document-ready":n&&(o=an(n.timestamp,Kn()));break;case"recorder-settled":n&&(r=an(n.timestamp,Kn()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":i(),n&&kv("Recorder init metrics",{metrics:Zse(n.forced,r,an(n.timestamp,Kn()),a.type,o)});break}});return{stop:i}}function Zse(e,t,n,o,r){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:o,waitForDocReadyDuration:r}}function Yse(e,t,n,o,r,i,a){let u=0,f;t.subscribe(9,()=>{(u===2||u===3)&&(v(),u=1)}),t.subscribe(10,()=>{u===1&&g()});const m=new _t;Kse(a,m);const p=async b=>{m.notify({type:"start",forced:b});const[x]=await Promise.all([bO(m,{type:"recorder-settled"},r()),bO(m,{type:"document-ready"},Ite(e,"interactive"))]);if(u!==2){m.notify({type:"aborted"});return}if(!x){u=0,m.notify({type:"recorder-load-failed"});return}const w=i();if(!w){u=0,m.notify({type:"deflate-encoder-load-failed"});return}({stop:f}=x(t,e,n,o,w,a)),u=3,m.notify({type:"succeeded"})};function g(b){const x=n.findTrackedSession();if(Wse(x,b)){u=1;return}if(Xse(u))return;u=2;const w=Qse(x,b)||!1;p(w).catch(sl),w&&n.setForcedReplay()}function v(){u===3&&f?.(),u=0}return{start:g,stop:v,getSessionReplayLink(){return qse(e,n,o,u!==0)},isRecording:()=>u===3}}function Wse(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function Xse(e){return e===2||e===3}function Qse(e,t){return t&&t.force&&e.sessionReplay===0}async function bO(e,t,n){try{return await n}finally{e.notify(t)}}function Jse(){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 eae(e,t){if(lu()&&!h4("records")||!bU())return{start:kt,stop:kt,getReplayStats:()=>{},onRumStart:kt,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:o}=Jse();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:r,isRecording:()=>yO()===3&&n.isRecording(),getReplayStats:i=>yO()===3?zse(i):void 0};function r(i,a,u,f,m,p){let g;function v(){return g||(m??(m=yU(a,"Datadog Session Replay",()=>{n.stop()},t)),m&&(g=gU(a,m,1))),g}n=Yse(a,i,u,f,e,v,p),o(a)&&n.start()}}const tae="modulepreload",nae=function(e){return"/"+e},xO={},fE=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 a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");r=f(n.map(m=>{if(m=nae(m),m in xO)return;xO[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":tae,p||(v.as="script"),v.crossOrigin="",v.href=m,u&&v.setAttribute("nonce",u),document.head.appendChild(v),p)return new Promise((b,x)=>{v.addEventListener("load",b),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${m}`)))})}))}function i(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return r.then(a=>{for(const u of a||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};async function rae(e=oae){try{return await e()}catch(t){dE({error:t,source:"Recorder",scriptType:"module"})}}async function oae(){return(await fE(()=>import("./startRecording-BUTy82Yk.js"),[])).startRecording}function iae(){return Vo().Profiler!==void 0}const sae=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==at.VIEW&&n!==at.LONG_TASK?fo:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function aae(e=lae){try{return await e()}catch(t){dE({error:t,source:"Profiler",scriptType:"module"})}}async function lae(){return(await fE(()=>import("./profiler-D9XZGP7Y.js"),[])).createRumProfiler}function cae(){let e;function t(n,o,r,i,a){const u=i.findTrackedSession();if(!u||!M4(u.id,r.profilingSampleRate))return;const f=sae(o);if(!iae()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}aae().then(m=>{if(!m){Tu("[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(a.findView())}).catch(sl)}return{onRumStart:t,stop:()=>{e?.stop().catch(sl)}}}const uae=eae(rae),dae=cae(),fae=Wne(Ase,uae,dae,{startDeflateWorker:yU,createDeflateEncoder:gU,sdkName:"rum"});fte(Vo(),"DD_RUM",fae);function Pp(e,t){Cf("react error"),Pn()}const _O={didCatch:!1,error:null};class i_e extends q.Component{constructor(t){super(t),this.resetError=()=>{this.setState(_O)},this.state=_O}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){Pp()}render(){return this.state.didCatch?q.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let SO=!1;function mae(){_.useEffect(()=>{SO||(SO=!0)},[])}function hae(){return c.jsx(c.Fragment,{children:c.jsx(ms,{})})}const Mv=x9()({component:hae}),Au=nt({getParentRoute:()=>Mv,id:"_authLayout",component:SK}),pae=nt({getParentRoute:()=>Au,path:"sign-in",component:MQ,beforeLoad:({context:e,location:t})=>{const n=e.authentication[wn]?.user;if(n){const o=t?.search,r=xu(n);throw ml({to:o?.redirect?.startsWith("/")?o.redirect:r})}}}),gae=nt({getParentRoute:()=>Mv,path:"sign-in",component:qC,beforeLoad:({context:e,location:t})=>{if(e.authentication[wn]?.user){const n=t?.search;throw ml({to:n?.redirect?.startsWith("/")?n.redirect:ca})}}}),vae=nt({getParentRoute:()=>Au,path:"sign-up",component:UQ}),yae=nt({getParentRoute:()=>Au,path:"forgot-password",component:CQ}),bae=nt({getParentRoute:()=>Au,path:"verify-email",component:GQ}),xae=nt({getParentRoute:()=>Au,path:"reset-password",component:NQ});Au.addChildren([pae,vae,yae,bae,xae]);const _ae=[gae];function Sae(){return c.jsx(ms,{})}function Cl({children:e}){return c.jsx("nav",{className:"fixed top-20 w-full md:h-12 z-39 py-2 px-4 md:px-12 bg-grey-700",children:c.jsxs("div",{className:"md:flex items-center h-full space-x-8",children:[c.jsx(Jg,{}),e]})})}var p_="focusScope.autoFocusOnMount",g_="focusScope.autoFocusOnUnmount",wO={bubbles:!1,cancelable:!0},wae="FocusScope",Pv=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...a}=e,[u,f]=_.useState(null),m=Zt(r),p=Zt(i),g=_.useRef(null),v=ut(t,w=>f(w)),b=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(o){let w=function(N){if(b.paused||!u)return;const O=N.target;u.contains(O)?g.current=O:Fs(g.current,{select:!0})},C=function(N){if(b.paused||!u)return;const O=N.relatedTarget;O!==null&&(u.contains(O)||Fs(g.current,{select:!0}))},E=function(N){if(document.activeElement===document.body)for(const k of N)k.removedNodes.length>0&&Fs(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const j=new MutationObserver(E);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),j.disconnect()}}},[o,u,b.paused]),_.useEffect(()=>{if(u){EO.add(b);const w=document.activeElement;if(!u.contains(w)){const E=new CustomEvent(p_,wO);u.addEventListener(p_,m),u.dispatchEvent(E),E.defaultPrevented||(Cae(kae(xU(u)),{select:!0}),document.activeElement===w&&Fs(u))}return()=>{u.removeEventListener(p_,m),setTimeout(()=>{const E=new CustomEvent(g_,wO);u.addEventListener(g_,p),u.dispatchEvent(E),E.defaultPrevented||Fs(w??document.body,{select:!0}),u.removeEventListener(g_,p),EO.remove(b)},0)}}},[u,m,p,b]);const x=_.useCallback(w=>{if(!n&&!o||b.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(C&&E){const j=w.currentTarget,[N,O]=Eae(j);N&&O?!w.shiftKey&&E===O?(w.preventDefault(),n&&Fs(N,{select:!0})):w.shiftKey&&E===N&&(w.preventDefault(),n&&Fs(O,{select:!0})):E===j&&w.preventDefault()}},[n,o,b.paused]);return c.jsx(Ue.div,{tabIndex:-1,...a,ref:v,onKeyDown:x})});Pv.displayName=wae;function Cae(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Fs(o,{select:t}),document.activeElement!==n)return}function Eae(e){const t=xU(e),n=CO(t,e),o=CO(t.reverse(),e);return[n,o]}function xU(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 CO(e,t){for(const n of e)if(!Rae(n,{upTo:t}))return n}function Rae(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jae(e){return e instanceof HTMLInputElement&&"select"in e}function Fs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jae(e)&&t&&e.select()}}var EO=Nae();function Nae(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=RO(e,t),e.unshift(t)},remove(t){e=RO(e,t),e[0]?.resume()}}}function RO(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function kae(e){return e.filter(t=>t.tagName!=="A")}var Tae="Portal",hm=_.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=_.useState(!1);Rn(()=>i(!0),[]);const a=n||r&&globalThis?.document?.body;return a?Ow.createPortal(c.jsx(Ue.div,{...o,ref:t}),a):null});hm.displayName=Tae;var v_=0;function mE(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jO()),document.body.insertAdjacentElement("beforeend",e[1]??jO()),v_++,()=>{v_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),v_--}},[])}function jO(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var vi=function(){return vi=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},vi.apply(this,arguments)};function _U(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Oae(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}var Dp="right-scroll-bar-position",zp="width-before-scroll-bar",Aae="with-scroll-bars-hidden",Iae="--removed-body-scroll-bar-size";function y_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $ae(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Mae=typeof window<"u"?_.useLayoutEffect:_.useEffect,NO=new WeakMap;function Pae(e,t){var n=$ae(null,function(o){return e.forEach(function(r){return y_(r,o)})});return Mae(function(){var o=NO.get(n);if(o){var r=new Set(o),i=new Set(e),a=n.current;r.forEach(function(u){i.has(u)||y_(u,null)}),i.forEach(function(u){r.has(u)||y_(u,a)})}NO.set(n,e)},[e]),n}function Dae(e){return e}function zae(e,t){t===void 0&&(t=Dae);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,o);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(i){for(o=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){o=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(i),a=n}var f=function(){var p=a;a=[],p.forEach(i)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(p){a.push(p),m()},filter:function(p){return a=a.filter(p),n}}}};return r}function Uae(e){e===void 0&&(e={});var t=zae(null);return t.options=vi({async:!0,ssr:!1},e),t}var SU=function(e){var t=e.sideCar,n=_U(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return _.createElement(o,vi({},n))};SU.isSideCarExport=!0;function Lae(e,t){return e.useMedium(t),SU}var wU=Uae(),b_=function(){},Dv=_.forwardRef(function(e,t){var n=_.useRef(null),o=_.useState({onScrollCapture:b_,onWheelCapture:b_,onTouchMoveCapture:b_}),r=o[0],i=o[1],a=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,p=e.enabled,g=e.shards,v=e.sideCar,b=e.noRelative,x=e.noIsolation,w=e.inert,C=e.allowPinchZoom,E=e.as,j=E===void 0?"div":E,N=e.gapMode,O=_U(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=v,T=Pae([n,t]),A=vi(vi({},O),r);return _.createElement(_.Fragment,null,p&&_.createElement(k,{sideCar:wU,removeScrollBar:m,shards:g,noRelative:b,noIsolation:x,inert:w,setCallbacks:i,allowPinchZoom:!!C,lockRef:n,gapMode:N}),a?_.cloneElement(_.Children.only(u),vi(vi({},A),{ref:T})):_.createElement(j,vi({},A,{className:f,ref:T}),u))});Dv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Dv.classNames={fullWidth:zp,zeroRight:Dp};var Fae=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vae(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Fae();return t&&e.setAttribute("nonce",t),e}function Bae(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hae(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qae=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vae())&&(Bae(t,n),Hae(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gae=function(){var e=qae();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},CU=function(){var e=Gae(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Kae={left:0,top:0,right:0,gap:0},x_=function(e){return parseInt(e||"",10)||0},Zae=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[x_(n),x_(o),x_(r)]},Yae=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kae;var t=Zae(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Wae=CU(),Uc="data-scroll-locked",Xae=function(e,t,n,o){var r=e.left,i=e.top,a=e.right,u=e.gap;return n===void 0&&(n="margin"),`
358
358
  .`.concat(Aae,` {
359
359
  overflow: hidden `).concat(o,`;
360
360
  padding-right: `).concat(u,"px ").concat(o,`;
@@ -452,7 +452,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
452
452
  focus-visible:ring-1
453
453
  focus-visible:outline-1
454
454
  focus-visible:ring-purple-200
455
- 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 bV="Toggle",xV=_.forwardRef((e,t)=>{const{pressed:n,defaultPressed:o,onPressedChange:r,...i}=e,[a,u]=Ri({prop:n,onChange:r,defaultProp:o??!1,caller:bV});return c.jsx(Ue.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Ce(e.onClick,()=>{e.disabled||u(!a)})})});xV.displayName=bV;var exe=xV;function txe({className:e,variant:t,size:n,...o}){return c.jsx(exe,{"data-slot":"toggle",className:Pe(Jbe({variant:t,size:n,className:e})),...o})}const B_={limit:"100",level:"undefined",from:"",until:""},nxe=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return c.jsx(cs,{variant:vV(t),children:Ws(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=yV(t);return c.jsx(c.Fragment,{children:t?c.jsxs(P6,{children:[c.jsx(D6,{asChild:!0,children:c.jsxs(cs,{variant:n,children:[t.split(".")[0],"..."]})}),c.jsx(z6,{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})})}}],rxe=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),o=new Date(t);return n<=o};function oxe(){const[e,t]=_.useState(B_),[n,o]=_.useState(!1),[r,i]=_.useState(),[a,u]=_.useState(!1),f=Yn(),{data:m,isLoading:p,refetch:g,isFetching:v}=Bt(Wbe({logFilters:e,...f,replicated:f.entityType==="cluster",isAutoRefreshEnabled:a})),b=Yt({resolver:tn(Xbe),defaultValues:B_,mode:"onChange"}),x=j=>{i(j.original),o(!0)},w=async j=>{if(!rxe(j.from,j.until)){b.setError("from",{type:"onChange",message:"Start date must be before end date"}),b.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(j)},C=async()=>{b.reset(),t(B_)},E=Nl(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(Qbe,{form:b,resetFilters:C,submitFilters:w})]}),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||a,children:c.jsx(Ei,{})}),c.jsxs(txe,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:u,children:[c.jsx(Ei,{}),"Auto Refresh ",a?"On":"Off"]})]}),c.jsx(Kbe,{columns:nxe,data:m||[],onRowClick:x})]})}),c.jsx(Ybe,{isModalOpen:n,setIsModalOpen:o,data:r})]})}function ixe(e){return nt({getParentRoute:()=>e,path:"logs",component:oxe})}const sxe=new Date(2025,0).getTime(),axe=1440*60*1e3;function lxe(e){const t=[];for(const n in e){const o=e[n];t.push(...hw(n,o,0))}return t}function cxe(e){return!!e.title}function hw(e,t,n,o){if(t&&Array.isArray(t)){const r=t;return[r.length>1&&{title:e,depth:n},...t.map((i,a)=>hw(r.length>1?String(a+1):e,i,n+1,e)).flat(1)].filter(gs)}if(uxe(t)){const r=t;return[{title:e,depth:n},...Object.keys(t).map(i=>hw(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>sxe&&t<Date.now()+axe){const r=Date.now()-t;t=Js(r,t)}else o==="memory"?t=gi(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 uxe(e){return!!e&&typeof e=="object"}function dxe({data:e}){const t=_.useMemo(()=>lxe(e),[e]);return c.jsx("div",{className:"max-w-96 grid mb-12",children:t.map((n,o)=>cxe(n)?c.jsx("div",{className:Pe("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 fxe({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 mxe(){const e=Yn(),{data:t}=dr(fxe(e));return c.jsx(_.Suspense,{fallback:c.jsx(Mo,{}),children:c.jsx(dxe,{data:t})})}function hxe(){return c.jsx(mxe,{})}function pxe(e){return nt({getParentRoute:()=>e,path:"status",component:hxe})}function gxe(e){const t=Gbe(),n=[ixe(t),...iye(t),pxe(t),zye(t),Fbe(t)];return t.addChildren(n)}nt({getParentRoute:()=>ay,path:"profile",component:w9(async()=>fE(()=>import("./index-DBRBB9ES.js"),[]),"ProfileIndex")});const vxe=Mv.addChildren([..._ae,ay.addChildren([gxe()])]);function yxe({routeTree:e=vxe,authentication:t}){const n=WH();return A9({routeTree:e,history:n,defaultNotFoundComponent:GG,defaultErrorComponent:Lw,defaultPreload:KG()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:gf,authentication:t||{}}})}function bxe(){const e=D9(),t=yxe({authentication:e});return c.jsxs(c.Fragment,{children:[c.jsx(M9,{router:t,context:{authentication:e}}),!1]})}const xxe=({...e})=>c.jsx(x7,{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 _xe=function(){return null};function Sxe(){return OQ(),mae(),c.jsxs(c.Fragment,{children:[c.jsxs(OH,{client:gf,children:[c.jsx(bxe,{}),c.jsx(_xe,{buttonPosition:"bottom-right"})]}),c.jsx(xxe,{richColors:!0})]})}var H_={exports:{}},Yd={},q_={exports:{}},G_={};/**
455
+ 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 bV="Toggle",xV=_.forwardRef((e,t)=>{const{pressed:n,defaultPressed:o,onPressedChange:r,...i}=e,[a,u]=Ri({prop:n,onChange:r,defaultProp:o??!1,caller:bV});return c.jsx(Ue.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Ce(e.onClick,()=>{e.disabled||u(!a)})})});xV.displayName=bV;var exe=xV;function txe({className:e,variant:t,size:n,...o}){return c.jsx(exe,{"data-slot":"toggle",className:Pe(Jbe({variant:t,size:n,className:e})),...o})}const B_={limit:"100",level:"undefined",from:"",until:""},nxe=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return c.jsx(cs,{variant:vV(t),children:Ws(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=yV(t);return c.jsx(c.Fragment,{children:t?c.jsxs(P6,{children:[c.jsx(D6,{asChild:!0,children:c.jsxs(cs,{variant:n,children:[t.split(".")[0],"..."]})}),c.jsx(z6,{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})})}}],rxe=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),o=new Date(t);return n<=o};function oxe(){const[e,t]=_.useState(B_),[n,o]=_.useState(!1),[r,i]=_.useState(),[a,u]=_.useState(!1),f=Yn(),{data:m,isLoading:p,refetch:g,isFetching:v}=Bt(Wbe({logFilters:e,...f,replicated:f.entityType==="cluster",isAutoRefreshEnabled:a})),b=Yt({resolver:tn(Xbe),defaultValues:B_,mode:"onChange"}),x=j=>{i(j.original),o(!0)},w=async j=>{if(!rxe(j.from,j.until)){b.setError("from",{type:"onChange",message:"Start date must be before end date"}),b.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(j)},C=async()=>{b.reset(),t(B_)},E=Nl(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(Qbe,{form:b,resetFilters:C,submitFilters:w})]}),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||a,children:c.jsx(Ei,{})}),c.jsxs(txe,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:u,children:[c.jsx(Ei,{}),"Auto Refresh ",a?"On":"Off"]})]}),c.jsx(Kbe,{columns:nxe,data:m||[],onRowClick:x})]})}),c.jsx(Ybe,{isModalOpen:n,setIsModalOpen:o,data:r})]})}function ixe(e){return nt({getParentRoute:()=>e,path:"logs",component:oxe})}const sxe=new Date(2025,0).getTime(),axe=1440*60*1e3;function lxe(e){const t=[];for(const n in e){const o=e[n];t.push(...hw(n,o,0))}return t}function cxe(e){return!!e.title}function hw(e,t,n,o){if(t&&Array.isArray(t)){const r=t;return[r.length>1&&{title:e,depth:n},...t.map((i,a)=>hw(r.length>1?String(a+1):e,i,n+1,e)).flat(1)].filter(gs)}if(uxe(t)){const r=t;return[{title:e,depth:n},...Object.keys(t).map(i=>hw(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>sxe&&t<Date.now()+axe){const r=Date.now()-t;t=Js(r,t)}else o==="memory"?t=gi(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 uxe(e){return!!e&&typeof e=="object"}function dxe({data:e}){const t=_.useMemo(()=>lxe(e),[e]);return c.jsx("div",{className:"max-w-96 grid mb-12",children:t.map((n,o)=>cxe(n)?c.jsx("div",{className:Pe("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 fxe({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 mxe(){const e=Yn(),{data:t}=dr(fxe(e));return c.jsx(_.Suspense,{fallback:c.jsx(Mo,{}),children:c.jsx(dxe,{data:t})})}function hxe(){return c.jsx(mxe,{})}function pxe(e){return nt({getParentRoute:()=>e,path:"status",component:hxe})}function gxe(e){const t=Gbe(),n=[ixe(t),...iye(t),pxe(t),zye(t),Fbe(t)];return t.addChildren(n)}nt({getParentRoute:()=>ay,path:"profile",component:w9(async()=>fE(()=>import("./index-DszMXbbR.js"),[]),"ProfileIndex")});const vxe=Mv.addChildren([..._ae,ay.addChildren([gxe()])]);function yxe({routeTree:e=vxe,authentication:t}){const n=WH();return A9({routeTree:e,history:n,defaultNotFoundComponent:GG,defaultErrorComponent:Lw,defaultPreload:KG()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:gf,authentication:t||{}}})}function bxe(){const e=D9(),t=yxe({authentication:e});return c.jsxs(c.Fragment,{children:[c.jsx(M9,{router:t,context:{authentication:e}}),!1]})}const xxe=({...e})=>c.jsx(x7,{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 _xe=function(){return null};function Sxe(){return OQ(),mae(),c.jsxs(c.Fragment,{children:[c.jsxs(OH,{client:gf,children:[c.jsx(bxe,{}),c.jsx(_xe,{buttonPosition:"bottom-right"})]}),c.jsx(xxe,{richColors:!0})]})}var H_={exports:{}},Yd={},q_={exports:{}},G_={};/**
456
456
  * @license React
457
457
  * scheduler.production.js
458
458
  *